feat: add assistant chat to Home page with global CLI sessions (#649)#656
Merged
feat: add assistant chat to Home page with global CLI sessions (#649)#656
Conversation
…ector UX - Add GET /api/assistant/tools endpoint returning installed CLI tools - Add AssistantToolInfo type and getInstalledTools() to assistantApi - Update AssistantChatPanel to fetch installed tools on mount - Show non-installed tools as disabled with '(not installed)' label - Update CLAUDE.md with new modules (Issue #649) - Add dev-reports for iteration-1 (refactor, progress) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Home 画面にアシスタントチャット UI を追加し、特定の worktree に紐づかない汎用的なグローバル CLI セッション(インストール済み全 CLI ツール対応)を利用可能にします。
Closes #649
Changes
Added
src/lib/session/global-session-constants.ts— グローバルセッション定数(GLOBAL_SESSION_WORKTREE_ID = '__global__')src/types/assistant.ts— アシスタント API 型定義src/lib/polling/global-session-poller.ts— グローバルセッション専用ポーリング(DB チェックなし)src/lib/assistant/context-builder.ts— デフォルトコンテキスト生成(CLI 使い方 + リポジトリ情報)src/app/api/assistant/start/route.ts— POST: セッション開始(cliToolId 検証・DB 操作なし)src/app/api/assistant/terminal/route.ts— POST: メッセージ送信src/app/api/assistant/current-output/route.ts— GET: ターミナル出力取得src/app/api/assistant/session/route.ts— DELETE: セッション停止src/app/api/assistant/tools/route.ts— GET: インストール済み CLI ツール一覧src/lib/api/assistant-api.ts— クライアント API(startSession / sendCommand / getCurrentOutput / stopSession / getInstalledTools)src/components/home/AssistantChatPanel.tsx— メインパネル(折りたたみ可能・最大 50vh・ポーリング)src/components/home/AssistantMessageInput.tsx— 送信専用入力(スラッシュコマンド/画像添付なし)Changed
src/lib/session-cleanup.ts—cleanupGlobalSessions()追加(mcbd-{tool}-__global__パターン検出・クリーンアップ)src/lib/session/worktree-status-helper.ts—__global__セッションをサイドバーから除外src/app/page.tsx—AssistantChatPanelを Session Overview 上部に組み込みCLAUDE.md— 新規モジュール一覧追記Architecture Notes
chat_messages/session_statesの FOREIGN KEY 制約を回避し、DB 操作を一切行わないBaseCLITool.getSessionName('__global__')を再利用しmcbd-{tool}-__global__形式/api/assistant/*はAUTH_EXCLUDED_PATHSに追加せず、認証ミドルウェアで保護response-checker.tsの DB チェック問題を回避するため専用pollGlobalSession()を実装Test Results
Unit Tests
Lint & Type Check
Build
Checklist
/api/assistant/*routes/api/assistant/*not inAUTH_EXCLUDED_PATHS🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com