Server marks assistant messages with tool_use blocks as type='tool_use'
(not 'assistant'), and user messages with tool_result blocks as
type='tool_result' (not 'user'). mapHistoryMessagesToUiMessages now
handles both type variants when parsing content arrays, so tool calls
are properly restored after page refresh.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace "ERROR" text badge with material error icon (less visually jarring)
- Add "pending" icon when tool results haven't been matched yet
- Remove red border on error groups — all groups now use the same neutral border
- Single tool call ERROR badge also changed to icon
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two bugs fixed:
1. Intermediate assistant text (e.g. "项目已经有 node_modules,直接启动") was
lost between tool calls because content_start didn't flush streamingText.
Now we flush accumulated text as assistant_text before switching to the
next content block.
2. History reload (page refresh) now restores thinking blocks alongside
tool_use, tool_result, and text blocks. Previously thinking blocks were
intentionally dropped — now they're preserved for full conversation replay.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Store statusVerb from server 'status' WebSocket messages
- StreamingIndicator now shows the real CLI verb (Canoodling, Thinking, etc.)
plus elapsed time and output token count
- Only show StreamingIndicator during tool_executing (not during thinking,
where ThinkingBlock already provides feedback)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- StreamingIndicator now only shows during 'tool_executing' state
(ThinkingBlock already animates during 'thinking')
- Plain text code blocks force dark color (#24292f) instead of prism's
default faded gray which was invisible on our beige background
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Deleted desktop/src/components/chat/highlightCode.ts (no longer needed)
- Removed all .hljs-* CSS rules from globals.css
- Updated chatBlocks test for react-diff-viewer-continued (doesn't render
diff content in jsdom, so test verifies component mounting instead)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- highlightAuto was misdetecting plain text (file trees, command output) as
code and applying wrong syntax colors (red keywords, green tags, etc.)
- Now only highlights when language is explicitly specified and known to hljs
- Code blocks without a specified language render as clean plain text
- Line numbers hidden for plain text blocks (only shown for actual code)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The desktop app now keeps the composer stable while turns are active,
reduces low-signal tool noise in the transcript, restores project context
under the composer after session creation, and relies on the CLI's own
permission requests instead of injecting broader desktop-side Bash asks.
This also brings in the supporting desktop app source tree and the server
routes/session metadata needed for git info, filesystem browsing, session
resume, slash commands, and SDK-backed permission bridging so the UI can
operate as a coherent feature instead of a partial patch.
Constraint: Desktop transcript needs to stay usable during long multi-tool sessions without hiding file-change diffs
Constraint: Permission prompts must mirror CLI behavior closely enough that read-only commands do not get desktop-only prompts
Rejected: Keep rendering Read/Bash bodies inline | too noisy and unlike the intended transcript model
Rejected: Commit only the touched desktop files | would leave the newly introduced desktop app incomplete in git history
Confidence: medium
Scope-risk: broad
Reversibility: messy
Directive: Treat non-writing tools as summary-first transcript events; do not re-expand them by default without validating the UX against long sessions
Tested: cd desktop && bun run lint
Tested: cd desktop && bun run test -- --run
Tested: bun test src/server/__tests__/conversations.test.ts
Not-tested: Manual visual regression against the exact screenshots in a live desktop session
Not-tested: Full root TypeScript check (repository still has unrelated extracted-native parse failures)
- Enforce auth on API/WS when non-localhost or SERVER_AUTH_REQUIRED=1
- Fix CronScheduler: add --verbose flag and correct stream-json message envelope
- Resolve session workdir from JSONL file instead of hardcoding process.cwd()
- Give Opus 4.6 1M a unique composite ID (claude-opus-4-6-20250610:1m)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix translateCliMessage to return ServerMessage[] with full tool lifecycle
(tool_result, tool_use_complete, toolInput, thinking, stream_event)
- Add CronScheduler that actually executes scheduled tasks via CLI subprocess,
with execution log persistence and GET /api/scheduled-tasks/:id/runs API
- Add TeamWatcher polling ~/.claude/teams/ every 3s, broadcasting team_update/
team_created/team_deleted to all WebSocket clients
- 280 tests pass (51 new), real LLM integration verified via MiniMax API
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Three new modules completing the server-side functionality:
1. ConversationService: spawns CLI as subprocess with --input-format
stream-json, forwards WebSocket messages to CLI stdin/stdout.
CLI handles all AI communication, tool execution, and permissions.
Graceful fallback to echo mode when CLI unavailable.
2. Agent Teams API: GET/DELETE /api/teams, member listing with status
derivation (running/idle/completed), transcript reading from
CLI-generated JSONL files. Teams created by CLI, API is read-only.
3. TaskService: replaces placeholder with real task file scanning
from ~/.claude/tasks/, supports nested team directories.
229 tests passing (49 new: 12 conversations + 27 teams + 10 tasks).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove Search, Dispatch, Customize pages (not needed for MVP)
- Sidebar simplified to: New session + Scheduled + project filter + sessions
- Add Agent Teams panel design: team status bar, member tabs with color
coding, teammate transcript switching, running/completed/failed states
- Add Agent Teams interaction flow (create → view members → switch → back)
- Requirements reduced from 118 to 89 items, focused on:
1. Core conversation (messages, tools, permissions, streaming)
2. Session management with project selection
3. Scheduled tasks
4. Agent Teams member activity visualization
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add complete server-side implementation for the Claude Code Desktop App UI:
- REST API: sessions, conversations, settings, models, scheduled tasks,
search, agents, and status endpoints (9 modules, 30+ endpoints)
- WebSocket: real-time chat streaming with state transitions, ping/pong,
permission request forwarding, and stop generation support
- Services: sessionService (JSONL read/write, CLI-compatible),
settingsService (atomic writes), cronService, searchService (ripgrep),
agentService (YAML management)
- Middleware: CORS (localhost-only), auth, unified error handling
- Tests: 180 tests (unit + E2E + business flow), all passing
- Docs: PRD, UI design spec, server architecture design
Non-invasive: all new code under src/server/, no changes to existing CLI code.
CLI/UI data interop: reads/writes the same JSONL/JSON files as the CLI.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add GitHub-compatible slugify (github-slugger algorithm) to VitePress
config so heading anchor IDs are consistent across both platforms.
Update all inline anchor links in 22 doc files accordingly.
- Add Computer Use architecture deep dive documentation (CN/EN)
with 4 generated diagrams (architecture, security gates,
Python Bridge, patch environment comparison)
- Move Computer Use section below Skills in sidebar and README
- Fix 153 broken anchor links across 18 documentation files:
- CN docs: add missing `、` after Chinese numeral prefixes
- EN docs: add missing `_` prefix for number-starting heading IDs
- Fix em-dash and special character encoding in anchor hrefs
Navigation links now appear immediately after the project description for
quicker access. The runtime screenshot was redundant with the text content
and architecture diagrams below. Image file kept in docs/images/.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add comprehensive Skills system documentation covering the extensible
capability plugin architecture, including usage guide and deep-dive
implementation analysis with 9 branded architecture diagrams.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add comprehensive documentation for the AutoDream ("dreaming") feature - Claude Code's
background memory consolidation mechanism that periodically reviews session history and
reorganizes memory files. Includes 3 architecture diagrams and updates to existing docs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Slim down README from ~400 lines to ~140 lines, keeping only essential content
- Reorganize docs/ into guide/, features/, reference/, images/ subdirectories
- Add GitHub badges (stars, forks, issues, PRs, license, language switch)
- Extract env vars, FAQ, fixes, project structure, global usage into separate docs
- Add LICENSE file (educational and research use only)
- Update all cross-references and issue template links