Skip to content

Dev Changelog โ€” 2026-04-27 (v0.1.0) โ€‹

Added โ€” Lantern Chat (Admin AI Assistant) โ€‹

A floating Claude-powered chat assistant for the admin portal. Soft-glow lantern bubble at bottom-right opens a slide-up panel. The assistant answers questions contextually and may, when it decides it's needed, read repo files (docs/code), grep the repo, list directories, list registered API services, or query a small allow-list of Firestore collections.

New Cloud Run service: services/api/assistant/ (port 8086) โ€‹

  • POST /assistant/chat โ€” agentic Claude endpoint (admin-authed, rate-limited 30/5min/user)
  • GET /health, GET /openapi.json, GET /api-docs โ€” public, follows the API service convention
  • Sandboxed tools (allow-list of repo prefixes, deny-list of secrets, 200 KB / 100-match / 200-entry caps)
  • Default model claude-sonnet-4-5 (override via ASSISTANT_MODEL)
  • Stateless: full conversation passed each turn; server-side agentic loop runs until non-tool_use stop

Admin UI โ€‹

  • New <LanternChat /> component (only rendered for admin users)
  • Floating amber bubble with lantern-glow pulse animation; 420ร—640 panel
  • Persists last 30 messages to localStorage
  • Sends current page route as context every turn
  • Markdown rendering, collapsible tool-call disclosures, AbortController-cancellable in-flight requests

Wiring โ€‹

  • Registered in packages/shared/services/index.js โ†’ auto-appears in admin API Reference
  • npm run assistant-api:dev, apis:dev, apis:kill, kill:ports updated
  • VS Code extension PORT_MAP + DEV_SERVER_SCRIPTS updated
  • Vite proxy /api/assistant โ†’ ASSISTANT_API_ORIGIN
  • New env vars: ANTHROPIC_API_KEY (required), ASSISTANT_API_ORIGIN, VITE_ASSISTANT_API_URL, optional ASSISTANT_MODEL / ASSISTANT_MAX_TOKENS

Verified โ€‹

  • npm install clean
  • ESLint clean on all new code
  • Boot smoke test: /health, /openapi.json, /assistant/chat 401 paths all pass
  • npm run build -w apps/admin green

Deferred โ€‹

  • Merchant-portal access (separate system prompt + tighter tool allow-list)
  • Deploy script must populate repo-snapshot/ before gcloud run deploy (sanitized copy of the repo, no secrets / node_modules / build artifacts)
  • Real-API smoke test pending an ANTHROPIC_API_KEY in dev env

Files โ€‹

See docs/worklog/2026-04-27_ADMIN_AI_ASSISTANT_COMPLETE.md for the full file list and architecture notes.

Built with VitePress