2 Commits

Author SHA1 Message Date
Ken 389a8fb655 refactor: extract parseA2UIBlocks to lib/a2ui.ts; remove unused import re
- Extract parseA2UIBlocks() from A2UIRenderer.tsx into its own
  frontend/src/lib/a2ui.ts module to satisfy react-refresh/only-export-
  components ESLint rule (A2UIRenderer should only export React components)
- Update ChatPanel.tsx and test files to import from lib/a2ui
- Split ChatPanel.test.tsx mock: separate vi.mock for lib/a2ui
  (parseA2UIBlocks) and A2UIRenderer (component only)
- Remove unused 'import re' from tests/test_runtime_html.py (ruff F401)

All 216 frontend tests and 242 bash tests still pass. TypeScript and
Vite builds are clean. Remaining ESLint warnings (react-hooks/set-state-
in-effect in MCPAppRenderer and useSessions) are pre-existing patterns
not introduced by Phase 3.
2026-05-26 21:14:10 +00:00
Ken 0751fbfa0a feat: visual artifact runtime for AI-generated inline visualizations
- Add bundle/apps/runtime.html: universal runtime that executes
  AI-generated visualization code in a sandboxed context
- Pre-loads CDN libraries: Tabler CSS, Leaflet CSS+JS, Chart.js v4,
  React 19 UMD, ReactDOM 19 UMD, Babel standalone 7
- Implements mcpBridge with JSON-RPC 2.0 protocol:
  sendToHost, callTool (with UUID ids + Promise), sendMessage, resize
- executeVisual detects JSX/HTML/plain-JS paths via regex
- Auto-resize via requestAnimationFrame + scrollHeight + 32, capped at 800
- Initial ui/initialize handshake with runtime='visual-artifact' v1.0.0
- Listens for 'render' and legacy 'tool/input' methods
- Add tests/test_runtime_html.py: 61 tests covering all spec requirements
2026-05-26 20:08:22 +00:00