Commit Graph

3 Commits

Author SHA1 Message Date
Michael Ramos 4627f75426 feat: external annotations API with real-time SSE (#400)
Adds a general-purpose External Annotations API that allows external programs (linters, AI tools, security scanners) to push annotations into a live Plannotator session via HTTP, with real-time delivery over SSE.

## What's included

- **Shared core** (`packages/shared/external-annotation.ts`): types, in-memory store, input validation, SSE serialization
- **Server handlers**: Bun + Pi implementations with full CRUD (GET/POST/PATCH/DELETE) + SSE streaming
- **Client hook** (`useExternalAnnotations`): EventSource with polling fallback, optimistic updates
- **Editor integration**: two-array state model (local + external), content-aware dedup, ID-based routing
- **Persistence**: source field preserved through share URLs and crash-recovery drafts
- **Docs**: new Integrations category with API overview page, updated API reference

## API surface

All three servers (plan, review, annotate) expose:
- `GET /api/external-annotations/stream` - SSE stream
- `GET /api/external-annotations` - JSON snapshot (polling fallback)
- `POST /api/external-annotations` - Add annotations (single or batch)
- `PATCH /api/external-annotations?id=` - Update fields
- `DELETE /api/external-annotations` - Remove by id, source, or clear all

For provenance purposes, this commit was AI assisted.
2026-03-29 17:18:31 -07:00
Sean Swanson 4f37699e03 Widen plan viewer layout for responsiveness (#32) 2026-01-06 13:33:03 -08:00
Michael Ramos 34297b5c55 Restructure to Bun monorepo with apps and packages
- apps/hooks: Claude Code hook integration (ExitPlanMode)
- apps/portal: Standalone web portal (future)
- apps/marketing: Landing page (future)
- packages/ui: Shared React components and utilities

Key improvements:
- Cookie-based settings persistence (works across random ports)
- Bundled highlight.js with per-block language detection
- Inline markdown rendering (bold, italic, code, links)
- Fixed sprite z-index layering

Legacy code preserved in legacy/ for reference.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:24:05 -08:00