Commit graph

5 commits

Author SHA1 Message Date
scotttong
1d06bd62c5 experiment: board chat UX polish and beginner guide
- Fix company isolation: reset chat state when switching companies,
  clear stale comment cache, fix Board Operations issue creation
  (status: todo instead of in_progress to avoid assignee requirement)
- Optimistic user messages: show user's message instantly before server
  round-trip for a natural chat feel
- Live status indicators: forward tool-use events from Claude CLI as
  SSE status messages (Running a command, Reading a file, Searching, etc.)
  shown as a separate bar below the streaming response
- Paperclip SVG thinking animation (slowed to 1s loop)
- Chat bubble styling: blue user bubbles, shaped corners via raw CSS
  to bypass --radius:0 design system
- Agent system prompt template: add Model field (default: sonnet)
- Add beginner guide: doc/BOARD-CHAT-GUIDE.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 19:15:19 -07:00
scotttong
08e0e91af0 experiment: board concierge skill + web UI chat surface
Add a board-member skill that teaches Claude how to manage a Paperclip
company via chat — covering onboarding, hiring plans, approvals, task
monitoring, cost oversight, and agent system prompt management.

Phase 1 (Claude Code surface):
- Board skill at skills/paperclip-board/SKILL.md with full API reference
- CLI bootstrap command `paperclipai board setup` that installs the skill
  and prints env exports

Phase 2 (Web UI surface):
- New /board/chat/stream endpoint that spawns Claude with the board skill
  as system prompt, passing PAPERCLIP_API_URL and PAPERCLIP_COMPANY_ID
- BoardChat page with streaming responses, status indicators, and
  conversation persistence via Board Operations issue
- Sidebar nav link and route registration

The skill is a portable knowledge layer — same document powers Claude Code
(Surface 1), web UI chat (Surface 2), and future MCP server (Surface 3).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:05:57 -07:00
scotttong
9bc683b17b experiment: two-layer observer, canned openers, structured action signals
Layer 1 (instant): detectUserIntent() on user message creates work product
+ fires background artifact generation immediately.
Layer 2 (CEO confirm): parseStructuredActions() on %%ACTIONS%% signal in
CEO response, with regex fallback. Deduplicates against Layer 1.

Also adds: canned openers for common messages (hybrid with real streaming),
message action metadata bars, cleanAgentMessage strips action signals,
generate-artifact now posts CEO comment and updates task to in_review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:52:49 -07:00
scotttong
8abbc48c71 experiment: direct CLI streaming, observer pattern, artifact generation
Replace adapter-based chat relay with lightweight claude CLI streaming
endpoint. CEO responses now arrive in 2-5s instead of minutes.

Key changes:
- POST /agents/:id/chat/stream — spawns claude -p directly, SSE streaming
- POST /agents/:id/chat/canned — persist welcome/approval messages
- POST /agents/:id/chat/generate-artifact — background doc generation
- Server-side detectArtifactCommitments() replaces unreliable AI observer
- Frontend: optimistic user messages, typewriter streaming, observer events
- Onboarding: separated name/mission substeps, back navigation
- Dev script: full server restart + fresh company + mission setup
- Removed: canned responses, heartbeat polling, inline plan detection

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:07:26 -07:00
scotttong
fbd87da6d6 experiment: add chat relay endpoint for real-time streaming responses
New POST /api/agents/:id/chat/relay endpoint that calls the adapter
directly and streams stdout back via SSE, bypassing the heartbeat
queue. Comments are persisted normally so conversations stay durable.
Frontend tries the relay first, falls back to poll-based flow if
unavailable.

Backend: 1 new file (agent-chat.ts), 1 line in app.ts.
Frontend: streaming fetch in CEOChatPanel with fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 17:02:10 -07:00