Commit Graph

30 Commits

Author SHA1 Message Date
Dave
8583f2389f story-kit: merge 158_bug_pty_debug_log_panics_on_multi_byte_utf_8_characters 2026-02-24 16:31:43 +00:00
Dave
5567cdf480 story-kit: merge 148_story_interactive_onboarding_guides_user_through_project_setup_after_init
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:34:31 +00:00
Dave
03ca8624cd story-kit: start 147_bug_activity_indicator_still_only_shows_thinking_despite_bug_140_fix 2026-02-24 15:26:39 +00:00
Dave
73614fe5e8 story-kit: merge 141_story_improve_server_logging_with_timestamps_and_error_visibility 2026-02-24 13:48:25 +00:00
Dave
560c731869 story-kit: merge 134_story_add_process_health_monitoring_and_timeout_to_agent_pty_sessions 2026-02-24 13:13:16 +00:00
Dave
2ac9e119e3 Fix master compilation after bad story 86 squash merge revert
The revert of story 86's merge left broken code from stories 131/135
that depended on it. Removed dead inline event dispatch (referencing
undefined event_type, pty_writer, PermissionReqMsg), added activity_tx
to process_json_event, and removed unused permission_tx parameter from
chat_stream/chat (permissions go through MCP, not PTY).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:44:22 +00:00
Dave
4611a187f1 fix: remove duplicate code block from merge conflict resolution in claude_code.rs
Old process_json_event call and new handle_stream_event match block were
both kept during auto-resolution; remove the old code to fix unclosed delimiter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:34:20 +00:00
Dave
557b6e9267 fix: resolve merge conflict artifacts from story-86 merge
- Add missing closing brace and #[test] attr between test functions in claude_code.rs
- Remove premature semicolon in TypeScript union type in client.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 12:33:31 +00:00
Dave
4e4802314f story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat 2026-02-24 12:32:14 +00:00
Dave
2e2f70df72 Revert "story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat"
This reverts commit ef162d91ff.
2026-02-24 12:16:45 +00:00
Dave
ef162d91ff story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat 2026-02-24 12:08:59 +00:00
Dave
0c9588d32c story-kit: merge 124_story_test_coverage_llm_providers_claude_code_rs 2026-02-24 00:19:32 +00:00
Dave
ca9293216f story-kit: merge 123_story_test_coverage_llm_providers_anthropic_rs 2026-02-24 00:15:19 +00:00
Dave
3825cbb8fd story-kit: merge 120_story_test_coverage_llm_chat_rs 2026-02-24 00:00:35 +00:00
Dave
3087297b88 story-kit: merge 91_bug_permissions_dialog_never_triggers_in_web_ui 2026-02-23 21:38:45 +00:00
Dave
8c6bd4cf74 feat(story-93): expose server logs to agents via get_server_logs MCP tool
- Add log_buffer module: bounded 1000-line ring buffer with push/get_recent API
- Add slog! macro: drop-in for eprintln! that also captures to ring buffer
- Replace all eprintln! calls across agents, watcher, search, chat, worktree, claude_code with slog!
- Add get_server_logs MCP tool: accepts count (1-500) and optional filter params
- 5 unit tests for log_buffer covering push/retrieve, eviction, filtering, count limits, empty buffer
- 262 tests passing, clippy clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 20:38:19 +00:00
Dave
af1625a132 story-kit: merge 86_story_show_live_activity_status_instead_of_static_thinking_indicator_in_chat 2026-02-23 18:38:15 +00:00
Dave
225073649b story-kit: start 88_story_auto_assign_agents_to_available_work_on_server_startup 2026-02-23 18:20:24 +00:00
Dave
d3bd26a4de story-kit: start 62_story_allow_frontend_ui_to_accept_permissions_requests 2026-02-23 16:07:24 +00:00
Dave
214ddcd7af story-kit: merge 62_story_allow_frontend_ui_to_accept_permissions_requests 2026-02-23 16:01:25 +00:00
Dave
6962e92f0c fix: resolve merge conflict in claude_code.rs
Keep master's quiet system/rate_limit_event handlers while preserving
the story-62 permission_request handler (the core feature).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 16:01:22 +00:00
Dave
e0bc4bdc90 feat(story-62): add permission request prompts to web UI
When Claude Code requires user approval before executing a tool (file
writes, commits, etc.) the agent sends a permission_request message
over the WebSocket.  The web UI now intercepts that message, surfaces a
modal dialog showing the tool name and input, and lets the user approve
or deny.  The decision is sent back as a permission_response, allowing
the agent to continue or adjust its approach.

Backend changes:
- claude_code.rs: parse "permission_request" NDJSON events from the PTY,
  block the PTY thread via a sync channel, and write the user's decision
  back to the PTY stdin as a JSON permission_response.
- chat.rs: thread an optional UnboundedSender<PermissionReqMsg> through
  to the provider.
- ws.rs: create a permission-request channel, forward requests to the
  client, collect responses via a pending-perms map, and interleave all
  of this with the active chat session using tokio::select!.

Frontend changes:
- client.ts: add permission_request to WsResponse, permission_response
  to WsRequest, onPermissionRequest handler to ChatWebSocket.connect(),
  and sendPermissionResponse() method.
- types.ts: mirror the same type additions.
- Chat.tsx: add permissionRequest state, wire onPermissionRequest
  callback, and render an approval modal with tool name, input context,
  Approve and Deny buttons.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 15:56:01 +00:00
Dave
8133ef2847 story-kit: queue 80_story_remove_model_apikey_and_rate_limit_notifications_from_chat_ui for merge 2026-02-23 15:36:09 +00:00
Dave
44bc82d23a Story 43: Unified chat UI for Claude Code and regular chat
Integrate Claude Code provider into the chat UI alongside regular
Ollama/Anthropic providers. Updates AgentPanel and Chat components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:26:40 +00:00
Dave
cde75bd7fb Accept story 39: Persistent Claude Code Sessions in Web UI
Use --resume <session_id> with claude -p so the web UI claude-code-pty
provider maintains full conversation context across messages, identical
to a long-running terminal Claude Code session.

Changes:
- Capture session_id from claude -p stream-json system event
- Pass --resume on subsequent messages in same chat session
- Thread session_id through ProviderConfig, ChatResult, WsResponse
- Frontend stores sessionId per chat, clears on New Session
- Unset CLAUDECODE env to allow nested spawning from server
- Wait for clean process exit to ensure transcript flush to disk

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 11:51:19 +00:00
Dave
5e5cdd9b2f Accept story 30: Worktree-based agent orchestration
Add git worktree isolation for concurrent story agents. Each agent now
runs in its own worktree with setup/teardown commands driven by
.story_kit/project.toml config. Agents stream output via SSE and support
start/stop lifecycle with Pending/Running/Completed/Failed statuses.

Backend: config.rs (TOML parsing), worktree.rs (git worktree lifecycle),
refactored agents.rs (broadcast streaming), agents_sse.rs (SSE endpoint).
Frontend: AgentPanel.tsx with Run/Stop buttons and streaming output log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:58:53 +00:00
Dave
68a19c393e Spike: PTY-based Claude Code integration with multi-agent concurrency
Proves that spawning `claude -p` in a pseudo-terminal from Rust gets Max
subscription billing (apiKeySource: "none", rateLimitType: "five_hour")
instead of per-token API charges. Concurrent agents run in parallel PTY
sessions with session resumption via --resume for multi-turn conversations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:25:22 +00:00
Dave
5923165fcf Refactoring the structure a bit 2026-02-16 16:24:21 +00:00
Dave
caf293a8c4 Renamed .living_spec in a few more places 2026-02-16 15:45:44 +00:00
Dave
0876c53e17 moved from tauri to a server with embedded UI 2026-02-13 12:31:36 +00:00