Shape the context
Days, times, places, costs and notes are compacted in src/lib/agent.ts. The full local plan never leaves as an uncontrolled dump.
ArchitectureRepository / 2026
Architecture / one user-triggered loop
The browser owns the itinerary. A small local Node server owns the credentials and the two external calls: Bailian Managed Agent for the second opinion, FlyAI for real Fliggy inventory. Nothing polls. Nothing is written by the agent without a user action.
Managed Agent live after rechargeFlyAI liveState localStorageFallback optional
The map
Browser / React 19
The board is the source of truth. The browser never holds a Bailian or FlyAI key.
Archify-style map drawn from the repository, not a generic diagram.
Request lifecycle
The agent is not a background loop. A user message compacts the current trip, goes to the local server once, and returns either a Managed Agent reply or a clearly marked fallback. FlyAI is a separate, cacheable inventory call.
Days, times, places, costs and notes are compacted in src/lib/agent.ts. The full local plan never leaves as an uncontrolled dump.
POST /api/agent runs bl managed-agent session run --no-stream --output json against the configured agent, environment and vault.
The server extracts assistant text and at most one fenced JSON suggestion, clamps its fields, and returns it with the session id.
Suggestions render as cards. The plan changes only when the traveller chooses to add one; the agent never edits the itinerary directly.