mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 14:48:48 +02:00
Back MAF's opt-in AG-UI snapshot persistence with a DB store so the conversation survives page reloads and restarts: - ChatThreadSnapshot: one upserted row per (scope, thread_id), JSONB messages/state/interrupt (migration 794baf50635b) - PostgresSnapshotStore implements the AGUIThreadSnapshotStore protocol. It opens its own sessions (MAF saves during SSE streaming, after the request middleware has closed the ContextVar session) and sanitizes on save: camelCase toolCalls/toolCallId (the @ag-ui/client Zod schema strips snake_case, which would lose cards on replay), drop BFF ctx-* context messages, dedupe MAF's re-recorded multi-run turns, and drop orphaned tool results - Endpoint mount gains snapshot_store + a constant scope resolver (single-user app; auth already enforced by agent_auth_and_session) - DELETE /api/v1/chat/thread resets the conversation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
43 lines
1.2 KiB
Python
43 lines
1.2 KiB
Python
from fastapi import APIRouter
|
|
|
|
from app.api.v1.endpoints import (
|
|
accounts,
|
|
analytics,
|
|
auth,
|
|
budget,
|
|
categories,
|
|
chat,
|
|
exchange_rate,
|
|
import_transactions,
|
|
installments,
|
|
municipal_receipts,
|
|
notifications,
|
|
pensions,
|
|
salarios,
|
|
savings_accrual,
|
|
settings,
|
|
sync_status,
|
|
tokens,
|
|
transactions,
|
|
)
|
|
|
|
api_router = APIRouter(prefix="/api/v1")
|
|
api_router.include_router(auth.router)
|
|
api_router.include_router(accounts.router)
|
|
api_router.include_router(categories.router)
|
|
api_router.include_router(transactions.router)
|
|
api_router.include_router(import_transactions.router)
|
|
api_router.include_router(installments.router)
|
|
api_router.include_router(exchange_rate.router)
|
|
api_router.include_router(tokens.router)
|
|
api_router.include_router(analytics.router)
|
|
api_router.include_router(settings.router)
|
|
api_router.include_router(budget.router)
|
|
api_router.include_router(notifications.router)
|
|
api_router.include_router(salarios.router)
|
|
api_router.include_router(pensions.router)
|
|
api_router.include_router(municipal_receipts.router)
|
|
api_router.include_router(savings_accrual.router)
|
|
api_router.include_router(sync_status.router)
|
|
api_router.include_router(chat.router)
|