@akiojin/gwt 2.12.1 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +33 -0
- package/README.md +31 -0
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +17 -11
- package/dist/claude.js.map +1 -1
- package/dist/cli/ui/components/App.d.ts +0 -6
- package/dist/cli/ui/components/App.d.ts.map +1 -1
- package/dist/cli/ui/components/App.js +93 -85
- package/dist/cli/ui/components/App.js.map +1 -1
- package/dist/cli/ui/components/common/Select.js +2 -2
- package/dist/cli/ui/components/common/Select.js.map +1 -1
- package/dist/cli/ui/components/screens/BranchListScreen.d.ts +3 -1
- package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/BranchListScreen.js +168 -34
- package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.js +3 -3
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.js.map +1 -1
- package/dist/cli/ui/hooks/useGitData.d.ts.map +1 -1
- package/dist/cli/ui/hooks/useGitData.js +17 -0
- package/dist/cli/ui/hooks/useGitData.js.map +1 -1
- package/dist/cli/ui/types.d.ts +2 -0
- package/dist/cli/ui/types.d.ts.map +1 -1
- package/dist/cli/ui/utils/branchFormatter.d.ts.map +1 -1
- package/dist/cli/ui/utils/branchFormatter.js +7 -2
- package/dist/cli/ui/utils/branchFormatter.js.map +1 -1
- package/dist/cli/ui/utils/continueSession.d.ts.map +1 -1
- package/dist/cli/ui/utils/continueSession.js +1 -1
- package/dist/cli/ui/utils/continueSession.js.map +1 -1
- package/dist/cli/ui/utils/modelOptions.d.ts.map +1 -1
- package/dist/cli/ui/utils/modelOptions.js +7 -0
- package/dist/cli/ui/utils/modelOptions.js.map +1 -1
- package/dist/client/assets/index-DPWWHorC.js +72 -0
- package/dist/client/assets/index-DsDNCy5f.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/codex.d.ts.map +1 -1
- package/dist/codex.js +21 -11
- package/dist/codex.js.map +1 -1
- package/dist/config/builtin-tools.d.ts.map +1 -1
- package/dist/config/builtin-tools.js +3 -2
- package/dist/config/builtin-tools.js.map +1 -1
- package/dist/config/shared-env.d.ts +41 -0
- package/dist/config/shared-env.d.ts.map +1 -0
- package/dist/config/shared-env.js +114 -0
- package/dist/config/shared-env.js.map +1 -0
- package/dist/gemini.d.ts.map +1 -1
- package/dist/gemini.js +20 -17
- package/dist/gemini.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +55 -7
- package/dist/index.js.map +1 -1
- package/dist/logging/logger.d.ts +24 -0
- package/dist/logging/logger.d.ts.map +1 -0
- package/dist/logging/logger.js +60 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/rotation.d.ts +6 -0
- package/dist/logging/rotation.d.ts.map +1 -0
- package/dist/logging/rotation.js +26 -0
- package/dist/logging/rotation.js.map +1 -0
- package/dist/qwen.d.ts.map +1 -1
- package/dist/qwen.js +15 -11
- package/dist/qwen.js.map +1 -1
- package/dist/services/aiToolResolver.d.ts +41 -0
- package/dist/services/aiToolResolver.d.ts.map +1 -0
- package/dist/services/aiToolResolver.js +194 -0
- package/dist/services/aiToolResolver.js.map +1 -0
- package/dist/services/customToolResolver.d.ts +10 -0
- package/dist/services/customToolResolver.d.ts.map +1 -0
- package/dist/services/customToolResolver.js +71 -0
- package/dist/services/customToolResolver.js.map +1 -0
- package/dist/shared/aiToolConstants.d.ts +9 -0
- package/dist/shared/aiToolConstants.d.ts.map +1 -0
- package/dist/shared/aiToolConstants.js +29 -0
- package/dist/shared/aiToolConstants.js.map +1 -0
- package/dist/types/tools.d.ts +12 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/prompt.d.ts.map +1 -1
- package/dist/utils/prompt.js.map +1 -1
- package/dist/utils/session.d.ts.map +1 -1
- package/dist/utils/session.js +15 -6
- package/dist/utils/session.js.map +1 -1
- package/dist/utils/terminal.d.ts +12 -3
- package/dist/utils/terminal.d.ts.map +1 -1
- package/dist/utils/terminal.js +5 -34
- package/dist/utils/terminal.js.map +1 -1
- package/dist/utils/webui.d.ts +8 -0
- package/dist/utils/webui.d.ts.map +1 -0
- package/dist/utils/webui.js +35 -0
- package/dist/utils/webui.js.map +1 -0
- package/dist/web/client/src/components/AIToolLaunchModal.d.ts +9 -0
- package/dist/web/client/src/components/AIToolLaunchModal.d.ts.map +1 -0
- package/dist/web/client/src/components/AIToolLaunchModal.js +363 -0
- package/dist/web/client/src/components/AIToolLaunchModal.js.map +1 -0
- package/dist/web/client/src/components/BranchGraph.d.ts.map +1 -1
- package/dist/web/client/src/components/BranchGraph.js +46 -49
- package/dist/web/client/src/components/BranchGraph.js.map +1 -1
- package/dist/web/client/src/components/CustomToolForm.d.ts +23 -0
- package/dist/web/client/src/components/CustomToolForm.d.ts.map +1 -0
- package/dist/web/client/src/components/CustomToolForm.js +209 -0
- package/dist/web/client/src/components/CustomToolForm.js.map +1 -0
- package/dist/web/client/src/components/CustomToolList.d.ts +10 -0
- package/dist/web/client/src/components/CustomToolList.d.ts.map +1 -0
- package/dist/web/client/src/components/CustomToolList.js +57 -0
- package/dist/web/client/src/components/CustomToolList.js.map +1 -0
- package/dist/web/client/src/components/EnvEditor.d.ts.map +1 -1
- package/dist/web/client/src/components/EnvEditor.js +33 -26
- package/dist/web/client/src/components/EnvEditor.js.map +1 -1
- package/dist/web/client/src/components/EnvironmentEditor.d.ts +17 -0
- package/dist/web/client/src/components/EnvironmentEditor.d.ts.map +1 -0
- package/dist/web/client/src/components/EnvironmentEditor.js +22 -0
- package/dist/web/client/src/components/EnvironmentEditor.js.map +1 -0
- package/dist/web/client/src/components/Terminal.d.ts.map +1 -1
- package/dist/web/client/src/components/Terminal.js +10 -3
- package/dist/web/client/src/components/Terminal.js.map +1 -1
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts +10 -0
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts.map +1 -0
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.js +104 -0
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.js.map +1 -0
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts +22 -0
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts.map +1 -0
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js +79 -0
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js.map +1 -0
- package/dist/web/client/src/components/branch-detail/TerminalPanel.d.ts +11 -0
- package/dist/web/client/src/components/branch-detail/TerminalPanel.d.ts.map +1 -0
- package/dist/web/client/src/components/branch-detail/TerminalPanel.js +32 -0
- package/dist/web/client/src/components/branch-detail/TerminalPanel.js.map +1 -0
- package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts +40 -0
- package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts.map +1 -0
- package/dist/web/client/src/components/branch-detail/ToolLauncher.js +147 -0
- package/dist/web/client/src/components/branch-detail/ToolLauncher.js.map +1 -0
- package/dist/web/client/src/components/branch-detail/index.d.ts +5 -0
- package/dist/web/client/src/components/branch-detail/index.d.ts.map +1 -0
- package/dist/web/client/src/components/branch-detail/index.js +5 -0
- package/dist/web/client/src/components/branch-detail/index.js.map +1 -0
- package/dist/web/client/src/components/common/BranchCard.d.ts +17 -0
- package/dist/web/client/src/components/common/BranchCard.d.ts.map +1 -0
- package/dist/web/client/src/components/common/BranchCard.js +36 -0
- package/dist/web/client/src/components/common/BranchCard.js.map +1 -0
- package/dist/web/client/src/components/common/MetricCard.d.ts +10 -0
- package/dist/web/client/src/components/common/MetricCard.d.ts.map +1 -0
- package/dist/web/client/src/components/common/MetricCard.js +10 -0
- package/dist/web/client/src/components/common/MetricCard.js.map +1 -0
- package/dist/web/client/src/components/common/PageHeader.d.ts +12 -0
- package/dist/web/client/src/components/common/PageHeader.d.ts.map +1 -0
- package/dist/web/client/src/components/common/PageHeader.js +14 -0
- package/dist/web/client/src/components/common/PageHeader.js.map +1 -0
- package/dist/web/client/src/components/common/SearchInput.d.ts +14 -0
- package/dist/web/client/src/components/common/SearchInput.d.ts.map +1 -0
- package/dist/web/client/src/components/common/SearchInput.js +15 -0
- package/dist/web/client/src/components/common/SearchInput.js.map +1 -0
- package/dist/web/client/src/components/common/StatusBadge.d.ts +10 -0
- package/dist/web/client/src/components/common/StatusBadge.d.ts.map +1 -0
- package/dist/web/client/src/components/common/StatusBadge.js +15 -0
- package/dist/web/client/src/components/common/StatusBadge.js.map +1 -0
- package/dist/web/client/src/components/common/index.d.ts +6 -0
- package/dist/web/client/src/components/common/index.d.ts.map +1 -0
- package/dist/web/client/src/components/common/index.js +6 -0
- package/dist/web/client/src/components/common/index.js.map +1 -0
- package/dist/web/client/src/components/ui/alert.d.ts +9 -0
- package/dist/web/client/src/components/ui/alert.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/alert.js +25 -0
- package/dist/web/client/src/components/ui/alert.js.map +1 -0
- package/dist/web/client/src/components/ui/badge.d.ts +10 -0
- package/dist/web/client/src/components/ui/badge.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/badge.js +25 -0
- package/dist/web/client/src/components/ui/badge.js.map +1 -0
- package/dist/web/client/src/components/ui/button.d.ts +12 -0
- package/dist/web/client/src/components/ui/button.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/button.js +33 -0
- package/dist/web/client/src/components/ui/button.js.map +1 -0
- package/dist/web/client/src/components/ui/card.d.ts +9 -0
- package/dist/web/client/src/components/ui/card.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/card.js +16 -0
- package/dist/web/client/src/components/ui/card.js.map +1 -0
- package/dist/web/client/src/components/ui/index.d.ts +8 -0
- package/dist/web/client/src/components/ui/index.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/index.js +8 -0
- package/dist/web/client/src/components/ui/index.js.map +1 -0
- package/dist/web/client/src/components/ui/input.d.ts +4 -0
- package/dist/web/client/src/components/ui/input.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/input.js +8 -0
- package/dist/web/client/src/components/ui/input.js.map +1 -0
- package/dist/web/client/src/components/ui/select.d.ts +14 -0
- package/dist/web/client/src/components/ui/select.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/select.js +39 -0
- package/dist/web/client/src/components/ui/select.js.map +1 -0
- package/dist/web/client/src/components/ui/table.d.ts +11 -0
- package/dist/web/client/src/components/ui/table.d.ts.map +1 -0
- package/dist/web/client/src/components/ui/table.js +21 -0
- package/dist/web/client/src/components/ui/table.js.map +1 -0
- package/dist/web/client/src/hooks/useSessions.d.ts.map +1 -1
- package/dist/web/client/src/hooks/useSessions.js +6 -1
- package/dist/web/client/src/hooks/useSessions.js.map +1 -1
- package/dist/web/client/src/lib/utils.d.ts +7 -0
- package/dist/web/client/src/lib/utils.d.ts.map +1 -0
- package/dist/web/client/src/lib/utils.js +10 -0
- package/dist/web/client/src/lib/utils.js.map +1 -0
- package/dist/web/client/src/lib/websocket.d.ts +7 -0
- package/dist/web/client/src/lib/websocket.d.ts.map +1 -1
- package/dist/web/client/src/lib/websocket.js +44 -0
- package/dist/web/client/src/lib/websocket.js.map +1 -1
- package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/BranchDetailPage.js +113 -361
- package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
- package/dist/web/client/src/pages/BranchListPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/BranchListPage.js +89 -127
- package/dist/web/client/src/pages/BranchListPage.js.map +1 -1
- package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/ConfigManagementPage.js +46 -41
- package/dist/web/client/src/pages/ConfigManagementPage.js.map +1 -1
- package/dist/web/client/src/pages/ConfigPage.d.ts +3 -0
- package/dist/web/client/src/pages/ConfigPage.d.ts.map +1 -0
- package/dist/web/client/src/pages/ConfigPage.js +216 -0
- package/dist/web/client/src/pages/ConfigPage.js.map +1 -0
- package/dist/web/client/vite.config.d.ts.map +1 -1
- package/dist/web/client/vite.config.js +8 -1
- package/dist/web/client/vite.config.js.map +1 -1
- package/dist/web/server/index.d.ts +24 -2
- package/dist/web/server/index.d.ts.map +1 -1
- package/dist/web/server/index.js +49 -18
- package/dist/web/server/index.js.map +1 -1
- package/dist/web/server/pty/manager.d.ts +12 -10
- package/dist/web/server/pty/manager.d.ts.map +1 -1
- package/dist/web/server/pty/manager.js +76 -43
- package/dist/web/server/pty/manager.js.map +1 -1
- package/dist/web/server/routes/branches.d.ts +2 -2
- package/dist/web/server/routes/branches.d.ts.map +1 -1
- package/dist/web/server/routes/branches.js.map +1 -1
- package/dist/web/server/routes/config.d.ts +2 -2
- package/dist/web/server/routes/config.d.ts.map +1 -1
- package/dist/web/server/routes/config.js.map +1 -1
- package/dist/web/server/routes/index.d.ts +2 -2
- package/dist/web/server/routes/index.d.ts.map +1 -1
- package/dist/web/server/routes/index.js.map +1 -1
- package/dist/web/server/routes/sessions.d.ts +2 -2
- package/dist/web/server/routes/sessions.d.ts.map +1 -1
- package/dist/web/server/routes/sessions.js +35 -2
- package/dist/web/server/routes/sessions.js.map +1 -1
- package/dist/web/server/routes/worktrees.d.ts +2 -2
- package/dist/web/server/routes/worktrees.d.ts.map +1 -1
- package/dist/web/server/routes/worktrees.js +2 -2
- package/dist/web/server/routes/worktrees.js.map +1 -1
- package/dist/web/server/services/worktrees.d.ts.map +1 -1
- package/dist/web/server/services/worktrees.js +7 -1
- package/dist/web/server/services/worktrees.js.map +1 -1
- package/dist/web/server/tray.d.ts +24 -0
- package/dist/web/server/tray.d.ts.map +1 -0
- package/dist/web/server/tray.js +79 -0
- package/dist/web/server/tray.js.map +1 -0
- package/dist/web/server/types.d.ts +4 -0
- package/dist/web/server/types.d.ts.map +1 -0
- package/dist/web/server/types.js +2 -0
- package/dist/web/server/types.js.map +1 -0
- package/dist/web/server/websocket/handler.d.ts +18 -2
- package/dist/web/server/websocket/handler.d.ts.map +1 -1
- package/dist/web/server/websocket/handler.js +82 -9
- package/dist/web/server/websocket/handler.js.map +1 -1
- package/dist/worktree.d.ts +1 -0
- package/dist/worktree.d.ts.map +1 -1
- package/dist/worktree.js.map +1 -1
- package/package.json +17 -3
- package/src/claude.ts +26 -15
- package/src/cli/ui/__tests__/components/ModelSelectorScreen.initial.test.tsx +13 -13
- package/src/cli/ui/__tests__/components/common/Select.test.tsx +11 -0
- package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +97 -33
- package/src/cli/ui/__tests__/components/screens/BranchQuickStartScreen.test.tsx +4 -4
- package/src/cli/ui/__tests__/performance/branchList.performance.test.tsx +7 -3
- package/src/cli/ui/components/App.tsx +111 -125
- package/src/cli/ui/components/common/Select.tsx +2 -2
- package/src/cli/ui/components/screens/BranchListScreen.tsx +220 -34
- package/src/cli/ui/components/screens/BranchQuickStartScreen.tsx +41 -46
- package/src/cli/ui/hooks/useGitData.ts +20 -0
- package/src/cli/ui/types.ts +3 -0
- package/src/cli/ui/utils/branchFormatter.ts +7 -2
- package/src/cli/ui/utils/continueSession.ts +1 -7
- package/src/cli/ui/utils/modelOptions.test.ts +14 -0
- package/src/cli/ui/utils/modelOptions.ts +7 -0
- package/src/codex.ts +31 -22
- package/src/config/builtin-tools.ts +6 -2
- package/src/config/shared-env.ts +139 -0
- package/src/gemini.ts +35 -22
- package/src/index.ts +61 -7
- package/src/logging/logger.ts +82 -0
- package/src/logging/rotation.ts +25 -0
- package/src/qwen.ts +28 -19
- package/src/services/aiToolResolver.ts +276 -0
- package/src/services/customToolResolver.ts +98 -0
- package/src/shared/aiToolConstants.ts +30 -0
- package/src/trayicon.d.ts +30 -0
- package/src/types/tools.ts +15 -0
- package/src/utils/prompt.ts +15 -9
- package/src/utils/session.ts +80 -26
- package/src/utils/terminal.ts +11 -41
- package/src/utils/webui.ts +43 -0
- package/src/web/client/components.json +21 -0
- package/src/web/client/src/components/AIToolLaunchModal.tsx +575 -0
- package/src/web/client/src/components/BranchGraph.tsx +95 -75
- package/src/web/client/src/components/CustomToolForm.tsx +386 -0
- package/src/web/client/src/components/CustomToolList.tsx +119 -0
- package/src/web/client/src/components/EnvEditor.tsx +91 -81
- package/src/web/client/src/components/EnvironmentEditor.tsx +97 -0
- package/src/web/client/src/components/Terminal.tsx +11 -3
- package/src/web/client/src/components/branch-detail/BranchInfoCards.tsx +179 -0
- package/src/web/client/src/components/branch-detail/SessionHistoryTable.tsx +181 -0
- package/src/web/client/src/components/branch-detail/TerminalPanel.tsx +92 -0
- package/src/web/client/src/components/branch-detail/ToolLauncher.tsx +327 -0
- package/src/web/client/src/components/branch-detail/index.ts +4 -0
- package/src/web/client/src/components/common/BranchCard.tsx +117 -0
- package/src/web/client/src/components/common/MetricCard.tsx +22 -0
- package/src/web/client/src/components/common/PageHeader.tsx +44 -0
- package/src/web/client/src/components/common/SearchInput.tsx +40 -0
- package/src/web/client/src/components/common/StatusBadge.tsx +37 -0
- package/src/web/client/src/components/common/index.ts +5 -0
- package/src/web/client/src/components/ui/alert.tsx +63 -0
- package/src/web/client/src/components/ui/badge.tsx +44 -0
- package/src/web/client/src/components/ui/button.tsx +57 -0
- package/src/web/client/src/components/ui/card.tsx +82 -0
- package/src/web/client/src/components/ui/index.ts +32 -0
- package/src/web/client/src/components/ui/input.tsx +21 -0
- package/src/web/client/src/components/ui/select.tsx +156 -0
- package/src/web/client/src/components/ui/table.tsx +119 -0
- package/src/web/client/src/hooks/useSessions.ts +10 -1
- package/src/web/client/src/index.css +46 -816
- package/src/web/client/src/lib/utils.ts +10 -0
- package/src/web/client/src/lib/websocket.ts +48 -1
- package/src/web/client/src/pages/BranchDetailPage.tsx +222 -694
- package/src/web/client/src/pages/BranchListPage.tsx +190 -236
- package/src/web/client/src/pages/ConfigManagementPage.tsx +94 -76
- package/src/web/client/src/pages/ConfigPage.tsx +362 -0
- package/src/web/client/vite.config.ts +8 -1
- package/src/web/server/index.ts +78 -19
- package/src/web/server/pty/manager.ts +128 -55
- package/src/web/server/routes/branches.ts +2 -2
- package/src/web/server/routes/config.ts +2 -2
- package/src/web/server/routes/index.ts +2 -2
- package/src/web/server/routes/sessions.ts +61 -9
- package/src/web/server/routes/worktrees.ts +5 -5
- package/src/web/server/services/worktrees.ts +12 -4
- package/src/web/server/tray.ts +93 -0
- package/src/web/server/types.ts +14 -0
- package/src/web/server/websocket/handler.ts +119 -13
- package/src/worktree.ts +1 -0
- package/dist/client/assets/index-DeNwPosA.css +0 -1
- package/dist/client/assets/index-Dl798X5w.js +0 -32
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Card, CardHeader, CardContent } from "@/components/ui/card";
|
|
3
|
+
import { Badge } from "@/components/ui/badge";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Table,
|
|
7
|
+
TableHeader,
|
|
8
|
+
TableBody,
|
|
9
|
+
TableRow,
|
|
10
|
+
TableHead,
|
|
11
|
+
TableCell,
|
|
12
|
+
} from "@/components/ui/table";
|
|
13
|
+
|
|
14
|
+
interface SessionInfo {
|
|
15
|
+
sessionId: string;
|
|
16
|
+
worktreePath: string;
|
|
17
|
+
toolType: string;
|
|
18
|
+
toolName?: string | null;
|
|
19
|
+
mode?: string;
|
|
20
|
+
status: "pending" | "running" | "completed" | "failed";
|
|
21
|
+
startedAt?: string;
|
|
22
|
+
endedAt?: string | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface SessionHistoryTableProps {
|
|
26
|
+
sessions: SessionInfo[];
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
terminatingSessionId: string | null;
|
|
29
|
+
isDeleting?: boolean;
|
|
30
|
+
onTerminate: (sessionId: string) => void;
|
|
31
|
+
onSelectSession: (sessionId: string) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const SESSION_STATUS_VARIANT: Record<
|
|
35
|
+
SessionInfo["status"],
|
|
36
|
+
"default" | "success" | "warning" | "destructive" | "outline"
|
|
37
|
+
> = {
|
|
38
|
+
pending: "outline",
|
|
39
|
+
running: "success",
|
|
40
|
+
completed: "default",
|
|
41
|
+
failed: "destructive",
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const SESSION_STATUS_LABEL: Record<SessionInfo["status"], string> = {
|
|
45
|
+
pending: "Pending",
|
|
46
|
+
running: "Running",
|
|
47
|
+
completed: "Completed",
|
|
48
|
+
failed: "Failed",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
function formatDate(value?: string | null): string {
|
|
52
|
+
if (!value) return "--";
|
|
53
|
+
try {
|
|
54
|
+
return new Intl.DateTimeFormat("ja-JP", {
|
|
55
|
+
month: "short",
|
|
56
|
+
day: "numeric",
|
|
57
|
+
hour: "2-digit",
|
|
58
|
+
minute: "2-digit",
|
|
59
|
+
}).format(new Date(value));
|
|
60
|
+
} catch {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function toolLabel(toolType: string, toolName?: string | null): string {
|
|
66
|
+
if (toolType === "custom") return toolName ?? "Custom";
|
|
67
|
+
if (toolType === "codex-cli") return "Codex CLI";
|
|
68
|
+
return "Claude Code";
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function SessionHistoryTable({
|
|
72
|
+
sessions,
|
|
73
|
+
isLoading,
|
|
74
|
+
terminatingSessionId,
|
|
75
|
+
isDeleting,
|
|
76
|
+
onTerminate,
|
|
77
|
+
onSelectSession,
|
|
78
|
+
}: SessionHistoryTableProps) {
|
|
79
|
+
return (
|
|
80
|
+
<Card>
|
|
81
|
+
<CardHeader className="pb-3">
|
|
82
|
+
<div className="flex items-center justify-between">
|
|
83
|
+
<div>
|
|
84
|
+
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
85
|
+
Session History
|
|
86
|
+
</p>
|
|
87
|
+
<h3 className="mt-1 text-lg font-semibold">セッション履歴</h3>
|
|
88
|
+
</div>
|
|
89
|
+
{isLoading && (
|
|
90
|
+
<Badge variant="outline" className="animate-pulse">
|
|
91
|
+
読み込み中...
|
|
92
|
+
</Badge>
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
96
|
+
この Worktree に紐づいた AI セッション履歴です。CLI
|
|
97
|
+
からの起動分も共有されます。
|
|
98
|
+
</p>
|
|
99
|
+
</CardHeader>
|
|
100
|
+
<CardContent>
|
|
101
|
+
{sessions.length === 0 ? (
|
|
102
|
+
<p className="py-8 text-center text-sm text-muted-foreground">
|
|
103
|
+
セッション履歴はまだありません。
|
|
104
|
+
</p>
|
|
105
|
+
) : (
|
|
106
|
+
<div className="overflow-x-auto rounded-md border">
|
|
107
|
+
<Table>
|
|
108
|
+
<TableHeader>
|
|
109
|
+
<TableRow>
|
|
110
|
+
<TableHead className="w-24">状態</TableHead>
|
|
111
|
+
<TableHead>ツール</TableHead>
|
|
112
|
+
<TableHead className="w-20">モード</TableHead>
|
|
113
|
+
<TableHead>開始</TableHead>
|
|
114
|
+
<TableHead>終了</TableHead>
|
|
115
|
+
<TableHead className="w-24 text-right">操作</TableHead>
|
|
116
|
+
</TableRow>
|
|
117
|
+
</TableHeader>
|
|
118
|
+
<TableBody>
|
|
119
|
+
{sessions.slice(0, 5).map((session) => (
|
|
120
|
+
<TableRow
|
|
121
|
+
key={session.sessionId}
|
|
122
|
+
className="cursor-pointer hover:bg-muted/50"
|
|
123
|
+
onClick={() => {
|
|
124
|
+
if (session.status === "running") {
|
|
125
|
+
onSelectSession(session.sessionId);
|
|
126
|
+
}
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<TableCell>
|
|
130
|
+
<Badge variant={SESSION_STATUS_VARIANT[session.status]}>
|
|
131
|
+
{SESSION_STATUS_LABEL[session.status]}
|
|
132
|
+
</Badge>
|
|
133
|
+
</TableCell>
|
|
134
|
+
<TableCell className="font-medium">
|
|
135
|
+
{toolLabel(session.toolType, session.toolName)}
|
|
136
|
+
</TableCell>
|
|
137
|
+
<TableCell>
|
|
138
|
+
<span className="text-muted-foreground">
|
|
139
|
+
{session.mode}
|
|
140
|
+
</span>
|
|
141
|
+
</TableCell>
|
|
142
|
+
<TableCell className="text-muted-foreground">
|
|
143
|
+
{formatDate(session.startedAt)}
|
|
144
|
+
</TableCell>
|
|
145
|
+
<TableCell className="text-muted-foreground">
|
|
146
|
+
{formatDate(session.endedAt)}
|
|
147
|
+
</TableCell>
|
|
148
|
+
<TableCell className="text-right">
|
|
149
|
+
{session.status === "running" ? (
|
|
150
|
+
<Button
|
|
151
|
+
variant="ghost"
|
|
152
|
+
size="sm"
|
|
153
|
+
onClick={(e) => {
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
onTerminate(session.sessionId);
|
|
156
|
+
}}
|
|
157
|
+
disabled={
|
|
158
|
+
terminatingSessionId === session.sessionId ||
|
|
159
|
+
isDeleting
|
|
160
|
+
}
|
|
161
|
+
>
|
|
162
|
+
{terminatingSessionId === session.sessionId
|
|
163
|
+
? "終了中..."
|
|
164
|
+
: "終了"}
|
|
165
|
+
</Button>
|
|
166
|
+
) : (
|
|
167
|
+
<span className="text-sm text-muted-foreground">
|
|
168
|
+
--
|
|
169
|
+
</span>
|
|
170
|
+
)}
|
|
171
|
+
</TableCell>
|
|
172
|
+
</TableRow>
|
|
173
|
+
))}
|
|
174
|
+
</TableBody>
|
|
175
|
+
</Table>
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
178
|
+
</CardContent>
|
|
179
|
+
</Card>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Card, CardHeader, CardContent } from "@/components/ui/card";
|
|
3
|
+
import { Button } from "@/components/ui/button";
|
|
4
|
+
import { Terminal } from "../Terminal";
|
|
5
|
+
import { cn } from "@/lib/utils";
|
|
6
|
+
|
|
7
|
+
interface TerminalPanelProps {
|
|
8
|
+
sessionId: string | null;
|
|
9
|
+
isFullscreen: boolean;
|
|
10
|
+
onToggleFullscreen: () => void;
|
|
11
|
+
onExit: (code: number) => void;
|
|
12
|
+
onError: (message: string | null) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function TerminalPanel({
|
|
16
|
+
sessionId,
|
|
17
|
+
isFullscreen,
|
|
18
|
+
onToggleFullscreen,
|
|
19
|
+
onExit,
|
|
20
|
+
onError,
|
|
21
|
+
}: TerminalPanelProps) {
|
|
22
|
+
if (!sessionId) {
|
|
23
|
+
return (
|
|
24
|
+
<Card className="h-full">
|
|
25
|
+
<CardHeader className="pb-2">
|
|
26
|
+
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
27
|
+
Terminal
|
|
28
|
+
</p>
|
|
29
|
+
<h3 className="text-lg font-semibold">セッションは未起動</h3>
|
|
30
|
+
</CardHeader>
|
|
31
|
+
<CardContent className="flex min-h-[200px] items-center justify-center">
|
|
32
|
+
<p className="text-center text-sm text-muted-foreground">
|
|
33
|
+
上部のアクションからAIツールを起動すると、
|
|
34
|
+
<br />
|
|
35
|
+
このエリアにターミナルが表示されます。
|
|
36
|
+
</p>
|
|
37
|
+
</CardContent>
|
|
38
|
+
</Card>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Card
|
|
44
|
+
className={cn(
|
|
45
|
+
"flex flex-col transition-all",
|
|
46
|
+
isFullscreen && "fixed inset-4 z-50 h-auto",
|
|
47
|
+
)}
|
|
48
|
+
data-testid="active-terminal"
|
|
49
|
+
>
|
|
50
|
+
<CardHeader className="flex-shrink-0 pb-2">
|
|
51
|
+
<div className="flex items-center justify-between">
|
|
52
|
+
<div>
|
|
53
|
+
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
54
|
+
Active Session
|
|
55
|
+
</p>
|
|
56
|
+
<h3 className="text-lg font-semibold">ターミナルセッション</h3>
|
|
57
|
+
</div>
|
|
58
|
+
<div className="flex gap-2">
|
|
59
|
+
<Button variant="ghost" size="sm" onClick={onToggleFullscreen}>
|
|
60
|
+
{isFullscreen ? "通常表示に戻す" : "最大化"}
|
|
61
|
+
</Button>
|
|
62
|
+
{isFullscreen && (
|
|
63
|
+
<Button
|
|
64
|
+
variant="ghost"
|
|
65
|
+
size="sm"
|
|
66
|
+
onClick={onToggleFullscreen}
|
|
67
|
+
aria-label="ターミナルを閉じる"
|
|
68
|
+
>
|
|
69
|
+
×
|
|
70
|
+
</Button>
|
|
71
|
+
)}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<p className="text-sm text-muted-foreground">
|
|
75
|
+
出力はリアルタイムにストリームされます。終了するとこのパネルは自動で閉じます。
|
|
76
|
+
</p>
|
|
77
|
+
</CardHeader>
|
|
78
|
+
<CardContent
|
|
79
|
+
className={cn("flex-1 overflow-hidden", isFullscreen && "h-full")}
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
className={cn(
|
|
83
|
+
"h-full min-h-[300px] overflow-auto rounded-lg border bg-black p-4",
|
|
84
|
+
isFullscreen && "min-h-0",
|
|
85
|
+
)}
|
|
86
|
+
>
|
|
87
|
+
<Terminal sessionId={sessionId} onExit={onExit} onError={onError} />
|
|
88
|
+
</div>
|
|
89
|
+
</CardContent>
|
|
90
|
+
</Card>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { Link } from "react-router-dom";
|
|
3
|
+
import { Card, CardHeader, CardContent } from "@/components/ui/card";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import { Input } from "@/components/ui/input";
|
|
6
|
+
import { Badge } from "@/components/ui/badge";
|
|
7
|
+
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
8
|
+
import {
|
|
9
|
+
Select,
|
|
10
|
+
SelectContent,
|
|
11
|
+
SelectItem,
|
|
12
|
+
SelectTrigger,
|
|
13
|
+
SelectValue,
|
|
14
|
+
} from "@/components/ui/select";
|
|
15
|
+
import { cn } from "@/lib/utils";
|
|
16
|
+
import type { CustomAITool, Branch } from "../../../../../types/api.js";
|
|
17
|
+
|
|
18
|
+
type ToolMode = "normal" | "continue" | "resume";
|
|
19
|
+
|
|
20
|
+
export type SelectableTool =
|
|
21
|
+
| { id: "claude-code"; label: string; target: "claude" }
|
|
22
|
+
| { id: "codex-cli"; label: string; target: "codex" }
|
|
23
|
+
| { id: string; label: string; target: "custom"; definition: CustomAITool };
|
|
24
|
+
|
|
25
|
+
interface ToolSummary {
|
|
26
|
+
command: string;
|
|
27
|
+
defaultArgs?: string[] | null;
|
|
28
|
+
modeArgs?: {
|
|
29
|
+
normal?: string[];
|
|
30
|
+
continue?: string[];
|
|
31
|
+
resume?: string[];
|
|
32
|
+
};
|
|
33
|
+
permissionSkipArgs?: string[] | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface ToolLauncherProps {
|
|
37
|
+
branch: Branch;
|
|
38
|
+
availableTools: SelectableTool[];
|
|
39
|
+
selectedToolId: string;
|
|
40
|
+
selectedMode: ToolMode;
|
|
41
|
+
skipPermissions: boolean;
|
|
42
|
+
extraArgsText: string;
|
|
43
|
+
isConfigLoading?: boolean;
|
|
44
|
+
configError?: Error | null;
|
|
45
|
+
isStartingSession: boolean;
|
|
46
|
+
isSyncingBranch: boolean;
|
|
47
|
+
needsRemoteSync: boolean;
|
|
48
|
+
hasBlockingDivergence: boolean;
|
|
49
|
+
onToolChange: (toolId: string) => void;
|
|
50
|
+
onModeChange: (mode: ToolMode) => void;
|
|
51
|
+
onSkipPermissionsChange: (skip: boolean) => void;
|
|
52
|
+
onExtraArgsChange: (args: string) => void;
|
|
53
|
+
onStartSession: () => void;
|
|
54
|
+
onSyncBranch: () => void;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const BUILTIN_TOOL_SUMMARIES: Record<string, ToolSummary> = {
|
|
58
|
+
"claude-code": {
|
|
59
|
+
command: "claude",
|
|
60
|
+
defaultArgs: [],
|
|
61
|
+
modeArgs: {
|
|
62
|
+
normal: [],
|
|
63
|
+
continue: ["-c"],
|
|
64
|
+
resume: ["-r"],
|
|
65
|
+
},
|
|
66
|
+
permissionSkipArgs: ["--dangerously-skip-permissions"],
|
|
67
|
+
},
|
|
68
|
+
"codex-cli": {
|
|
69
|
+
command: "codex",
|
|
70
|
+
defaultArgs: ["--auto-approve", "--verbose"],
|
|
71
|
+
modeArgs: {
|
|
72
|
+
normal: [],
|
|
73
|
+
continue: ["resume", "--last"],
|
|
74
|
+
resume: ["resume"],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export function ToolLauncher({
|
|
80
|
+
branch,
|
|
81
|
+
availableTools,
|
|
82
|
+
selectedToolId,
|
|
83
|
+
selectedMode,
|
|
84
|
+
skipPermissions,
|
|
85
|
+
extraArgsText,
|
|
86
|
+
isConfigLoading,
|
|
87
|
+
configError,
|
|
88
|
+
isStartingSession,
|
|
89
|
+
isSyncingBranch,
|
|
90
|
+
needsRemoteSync,
|
|
91
|
+
hasBlockingDivergence,
|
|
92
|
+
onToolChange,
|
|
93
|
+
onModeChange,
|
|
94
|
+
onSkipPermissionsChange,
|
|
95
|
+
onExtraArgsChange,
|
|
96
|
+
onStartSession,
|
|
97
|
+
onSyncBranch,
|
|
98
|
+
}: ToolLauncherProps) {
|
|
99
|
+
const canStartSession = Boolean(branch.worktreePath);
|
|
100
|
+
const selectedTool = availableTools.find((t) => t.id === selectedToolId);
|
|
101
|
+
|
|
102
|
+
const selectedToolSummary: ToolSummary | null = useMemo(() => {
|
|
103
|
+
if (!selectedTool) return null;
|
|
104
|
+
if (selectedTool.target === "custom") {
|
|
105
|
+
return {
|
|
106
|
+
command: selectedTool.definition.command,
|
|
107
|
+
defaultArgs: selectedTool.definition.defaultArgs ?? null,
|
|
108
|
+
modeArgs: selectedTool.definition.modeArgs,
|
|
109
|
+
permissionSkipArgs: selectedTool.definition.permissionSkipArgs ?? null,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return BUILTIN_TOOL_SUMMARIES[selectedTool.id] ?? null;
|
|
113
|
+
}, [selectedTool]);
|
|
114
|
+
|
|
115
|
+
const argsPreview = useMemo(() => {
|
|
116
|
+
if (!selectedToolSummary) return null;
|
|
117
|
+
const args: string[] = [];
|
|
118
|
+
if (selectedToolSummary.defaultArgs?.length) {
|
|
119
|
+
args.push(...selectedToolSummary.defaultArgs);
|
|
120
|
+
}
|
|
121
|
+
const mode = selectedToolSummary.modeArgs?.[selectedMode];
|
|
122
|
+
if (mode?.length) args.push(...mode);
|
|
123
|
+
if (skipPermissions && selectedToolSummary.permissionSkipArgs?.length) {
|
|
124
|
+
args.push(...selectedToolSummary.permissionSkipArgs);
|
|
125
|
+
}
|
|
126
|
+
const extraArgs = extraArgsText
|
|
127
|
+
.split(/\s+/)
|
|
128
|
+
.map((c) => c.trim())
|
|
129
|
+
.filter(Boolean);
|
|
130
|
+
if (extraArgs.length) args.push(...extraArgs);
|
|
131
|
+
return { command: selectedToolSummary.command, args };
|
|
132
|
+
}, [selectedToolSummary, selectedMode, skipPermissions, extraArgsText]);
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<Card>
|
|
136
|
+
<CardHeader className="pb-3">
|
|
137
|
+
<div className="flex items-center justify-between">
|
|
138
|
+
<div>
|
|
139
|
+
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
140
|
+
Tool Launcher
|
|
141
|
+
</p>
|
|
142
|
+
<h3 className="mt-1 text-lg font-semibold">AIツール起動</h3>
|
|
143
|
+
</div>
|
|
144
|
+
{configError && <Badge variant="warning">設定の取得に失敗</Badge>}
|
|
145
|
+
</div>
|
|
146
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
147
|
+
Web UI
|
|
148
|
+
から直接AIツールを起動できます。設定したカスタムツールも一覧に表示されます。
|
|
149
|
+
</p>
|
|
150
|
+
</CardHeader>
|
|
151
|
+
|
|
152
|
+
<CardContent className="space-y-4">
|
|
153
|
+
{!canStartSession ? (
|
|
154
|
+
<p className="py-4 text-center text-sm text-muted-foreground">
|
|
155
|
+
Worktreeが未作成のため、先にWorktreeを作成してください。
|
|
156
|
+
</p>
|
|
157
|
+
) : (
|
|
158
|
+
<>
|
|
159
|
+
{/* Form Grid */}
|
|
160
|
+
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
161
|
+
<div className="space-y-2">
|
|
162
|
+
<label className="text-sm font-medium">AIツール</label>
|
|
163
|
+
<Select
|
|
164
|
+
value={selectedToolId}
|
|
165
|
+
onValueChange={onToolChange}
|
|
166
|
+
disabled={isConfigLoading ?? false}
|
|
167
|
+
>
|
|
168
|
+
<SelectTrigger>
|
|
169
|
+
<SelectValue placeholder="ツールを選択" />
|
|
170
|
+
</SelectTrigger>
|
|
171
|
+
<SelectContent>
|
|
172
|
+
{availableTools.map((tool) => (
|
|
173
|
+
<SelectItem key={tool.id} value={tool.id}>
|
|
174
|
+
{tool.label}
|
|
175
|
+
</SelectItem>
|
|
176
|
+
))}
|
|
177
|
+
</SelectContent>
|
|
178
|
+
</Select>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div className="space-y-2">
|
|
182
|
+
<label className="text-sm font-medium">起動モード</label>
|
|
183
|
+
<Select
|
|
184
|
+
value={selectedMode}
|
|
185
|
+
onValueChange={(v) => onModeChange(v as ToolMode)}
|
|
186
|
+
>
|
|
187
|
+
<SelectTrigger>
|
|
188
|
+
<SelectValue />
|
|
189
|
+
</SelectTrigger>
|
|
190
|
+
<SelectContent>
|
|
191
|
+
<SelectItem value="normal">Normal</SelectItem>
|
|
192
|
+
<SelectItem value="continue">Continue</SelectItem>
|
|
193
|
+
<SelectItem value="resume">Resume</SelectItem>
|
|
194
|
+
</SelectContent>
|
|
195
|
+
</Select>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div className="space-y-2 sm:col-span-2 lg:col-span-1">
|
|
199
|
+
<label className="text-sm font-medium">追加引数</label>
|
|
200
|
+
<Input
|
|
201
|
+
type="text"
|
|
202
|
+
value={extraArgsText}
|
|
203
|
+
onChange={(e) => onExtraArgsChange(e.target.value)}
|
|
204
|
+
placeholder="--flag value"
|
|
205
|
+
/>
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
|
|
209
|
+
{/* Skip Permissions Checkbox */}
|
|
210
|
+
<label className="flex items-center gap-2 text-sm">
|
|
211
|
+
<input
|
|
212
|
+
type="checkbox"
|
|
213
|
+
checked={skipPermissions}
|
|
214
|
+
onChange={(e) => onSkipPermissionsChange(e.target.checked)}
|
|
215
|
+
className="h-4 w-4 rounded border-border"
|
|
216
|
+
/>
|
|
217
|
+
<span>権限チェックをスキップ (自己責任)</span>
|
|
218
|
+
</label>
|
|
219
|
+
|
|
220
|
+
{skipPermissions && (
|
|
221
|
+
<Alert variant="warning">
|
|
222
|
+
<AlertDescription>
|
|
223
|
+
権限チェックをスキップすることで、CLI での
|
|
224
|
+
`--dangerously-skip-permissions`
|
|
225
|
+
指定と同様のリスクを負います。
|
|
226
|
+
</AlertDescription>
|
|
227
|
+
</Alert>
|
|
228
|
+
)}
|
|
229
|
+
|
|
230
|
+
{needsRemoteSync && (
|
|
231
|
+
<Alert variant="info" data-testid="sync-required">
|
|
232
|
+
<AlertDescription>
|
|
233
|
+
<p>
|
|
234
|
+
リモートに未取得の更新 ({branch.divergence?.behind ?? 0}{" "}
|
|
235
|
+
commits)
|
|
236
|
+
があるため、AIツールを起動する前に同期してください。
|
|
237
|
+
</p>
|
|
238
|
+
<p className="mt-1 text-xs text-muted-foreground">
|
|
239
|
+
CLI の `git fetch --all` と `git pull --ff-only`
|
|
240
|
+
と同じ処理を Web UI から実行できます。
|
|
241
|
+
</p>
|
|
242
|
+
</AlertDescription>
|
|
243
|
+
</Alert>
|
|
244
|
+
)}
|
|
245
|
+
|
|
246
|
+
{hasBlockingDivergence && (
|
|
247
|
+
<Alert variant="warning" data-testid="divergence-warning">
|
|
248
|
+
<AlertDescription>
|
|
249
|
+
<p>
|
|
250
|
+
リモートとローカルの両方に未解決の差分があるため、起動をブロックしています。
|
|
251
|
+
</p>
|
|
252
|
+
<ul className="mt-2 list-inside list-disc text-xs text-muted-foreground">
|
|
253
|
+
<li>
|
|
254
|
+
git fetch && git pull --ff-only origin {branch.name}
|
|
255
|
+
</li>
|
|
256
|
+
<li>git push origin {branch.name} でローカル進捗を共有</li>
|
|
257
|
+
</ul>
|
|
258
|
+
</AlertDescription>
|
|
259
|
+
</Alert>
|
|
260
|
+
)}
|
|
261
|
+
|
|
262
|
+
{/* Action Buttons */}
|
|
263
|
+
<div className="flex flex-wrap gap-2 pt-2">
|
|
264
|
+
<Button
|
|
265
|
+
onClick={onStartSession}
|
|
266
|
+
disabled={
|
|
267
|
+
isStartingSession ||
|
|
268
|
+
!selectedTool ||
|
|
269
|
+
hasBlockingDivergence ||
|
|
270
|
+
needsRemoteSync ||
|
|
271
|
+
isSyncingBranch
|
|
272
|
+
}
|
|
273
|
+
>
|
|
274
|
+
{isStartingSession ? "起動中..." : "セッションを起動"}
|
|
275
|
+
</Button>
|
|
276
|
+
<Button
|
|
277
|
+
variant="secondary"
|
|
278
|
+
onClick={onSyncBranch}
|
|
279
|
+
disabled={!branch.worktreePath || isSyncingBranch}
|
|
280
|
+
>
|
|
281
|
+
{isSyncingBranch ? "同期中..." : "最新の変更を同期"}
|
|
282
|
+
</Button>
|
|
283
|
+
<Button variant="ghost" asChild>
|
|
284
|
+
<Link to="/config">設定を編集</Link>
|
|
285
|
+
</Button>
|
|
286
|
+
</div>
|
|
287
|
+
|
|
288
|
+
{/* Command Preview */}
|
|
289
|
+
{selectedToolSummary && (
|
|
290
|
+
<div className="space-y-2 rounded-lg border bg-muted/30 p-4">
|
|
291
|
+
<div className="grid gap-2 text-sm sm:grid-cols-2">
|
|
292
|
+
<div>
|
|
293
|
+
<span className="text-muted-foreground">コマンド:</span>{" "}
|
|
294
|
+
<code className="rounded bg-muted px-1.5 py-0.5 font-mono">
|
|
295
|
+
{selectedToolSummary.command}
|
|
296
|
+
</code>
|
|
297
|
+
</div>
|
|
298
|
+
<div>
|
|
299
|
+
<span className="text-muted-foreground">defaultArgs:</span>{" "}
|
|
300
|
+
<span
|
|
301
|
+
className={cn(
|
|
302
|
+
!selectedToolSummary.defaultArgs?.length &&
|
|
303
|
+
"text-muted-foreground/50",
|
|
304
|
+
)}
|
|
305
|
+
>
|
|
306
|
+
{selectedToolSummary.defaultArgs?.join(" ") || "未設定"}
|
|
307
|
+
</span>
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
{argsPreview && (
|
|
311
|
+
<div className="border-t pt-2">
|
|
312
|
+
<span className="text-xs text-muted-foreground">
|
|
313
|
+
最終コマンド:
|
|
314
|
+
</span>
|
|
315
|
+
<pre className="mt-1 overflow-x-auto rounded bg-background p-2 font-mono text-sm">
|
|
316
|
+
{argsPreview.command} {argsPreview.args.join(" ")}
|
|
317
|
+
</pre>
|
|
318
|
+
</div>
|
|
319
|
+
)}
|
|
320
|
+
</div>
|
|
321
|
+
)}
|
|
322
|
+
</>
|
|
323
|
+
)}
|
|
324
|
+
</CardContent>
|
|
325
|
+
</Card>
|
|
326
|
+
);
|
|
327
|
+
}
|