Commit Graph

12 Commits

Author SHA1 Message Date
f38ee499ae feat(bot): unified topic processor replacing router+interpreter stack
Replace 3-layer architecture (gpt-5-nano router + gpt-4o-mini interpreter) with
single unified topic processor (gpt-4o-mini) for simplified message handling.

New components:
- HouseholdContextCache: TTL-based caching (5 min) for household config data
- TopicProcessor: Unified classification + parsing with structured JSON output

Key changes:
- Renamed ASSISTANT_ROUTER_MODEL → TOPIC_PROCESSOR_MODEL
- Added TOPIC_PROCESSOR_TIMEOUT_MS (default 10s)
- Refactored save() → saveWithInterpretation() for pre-parsed interpretations
- Removed deprecated createOpenAiTopicMessageRouter and ~300 lines legacy code
- Fixed typing indicator to only start when needed (purchase routes)
- Fixed amount formatting: convert minor units to major for rawText

Routes: silent, chat_reply, purchase, purchase_clarification, payment,
payment_clarification, topic_helper, dismiss_workflow

All 212 bot tests pass. Typecheck, lint, format, build clean.
2026-03-14 13:33:57 +04:00
488a488137 feat: add quick payment action and improve copy button UX
Mini App Home Screen:
- Add 'Record Payment' button to utilities and rent period cards
- Pre-fill payment amount with member's share (rentShare/utilityShare)
- Modal dialog with amount input and currency display
- Toast notifications for copy and payment success/failure feedback

Copy Button Improvements:
- Increase spacing between icon and text (4px → 8px)
- Add hover background and padding for better touch target
- Green background highlight when copied (in addition to icon color change)
- Toast notification appears when copying any value

Backend:
- Add /api/miniapp/payments/add endpoint for quick payments
- Payment notifications sent to 'reminders' topic in Telegram
- Include member name, payment type, amount, and period in notification

Files:
- New: apps/miniapp/src/components/ui/toast.tsx
- Modified: apps/miniapp/src/routes/home.tsx, apps/miniapp/src/index.css,
  apps/miniapp/src/theme.css, apps/miniapp/src/i18n.ts,
  apps/bot/src/miniapp-billing.ts, apps/bot/src/server.ts

Quality Gates:  format, lint, typecheck, build, test

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-14 08:51:53 +04:00
1274cefc0f Stabilize purchase functionality: fix ID prefix, uniqueness, and split participant inclusion 2026-03-13 22:29:17 +04:00
f1670c521f Refine topic workflow followups 2026-03-13 02:21:08 +04:00
8374d18189 feat(bot): add shared topic router 2026-03-12 17:12:26 +04:00
6053379f31 fix(miniapp): clarify cycle summary and balance sections 2026-03-12 13:12:39 +04:00
135a2301ca feat(miniapp): redesign member balance surfaces 2026-03-12 02:10:22 +04:00
79f96ba45b feat(payments): add transparent balance guidance 2026-03-11 14:52:09 +04:00
fce2d30beb feat(bot): support tagged assistant replies in topics 2026-03-11 12:15:56 +04:00
9553ca342a fix(bot): shorten payment topic callback payloads 2026-03-11 11:46:25 +04:00
3ff4bbc246 feat(bot): add structured payment topic confirmations 2026-03-11 11:23:49 +04:00
1988521931 feat(payments): track household payment confirmations 2026-03-10 17:00:45 +04:00