@akiojin/gwt 4.9.1 → 4.11.6
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 +4 -4
- package/README.md +4 -4
- package/dist/claude.d.ts +1 -0
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +52 -49
- package/dist/claude.js.map +1 -1
- package/dist/cli/ui/App.solid.d.ts +29 -0
- package/dist/cli/ui/App.solid.d.ts.map +1 -0
- package/dist/cli/ui/App.solid.js +1197 -0
- package/dist/cli/ui/App.solid.js.map +1 -0
- package/dist/cli/ui/components/solid/Footer.d.ts +10 -0
- package/dist/cli/ui/components/solid/Footer.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/Footer.js +10 -0
- package/dist/cli/ui/components/solid/Footer.js.map +1 -0
- package/dist/cli/ui/components/{parts → solid}/Header.d.ts +1 -6
- package/dist/cli/ui/components/solid/Header.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/Header.js +13 -0
- package/dist/cli/ui/components/solid/Header.js.map +1 -0
- package/dist/cli/ui/components/solid/HelpOverlay.d.ts +8 -0
- package/dist/cli/ui/components/solid/HelpOverlay.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/HelpOverlay.js +118 -0
- package/dist/cli/ui/components/solid/HelpOverlay.js.map +1 -0
- package/dist/cli/ui/components/solid/QuickStartStep.d.ts +17 -0
- package/dist/cli/ui/components/solid/QuickStartStep.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/QuickStartStep.js +139 -0
- package/dist/cli/ui/components/solid/QuickStartStep.js.map +1 -0
- package/dist/cli/ui/components/solid/SelectInput.d.ts +22 -0
- package/dist/cli/ui/components/solid/SelectInput.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/SelectInput.js +44 -0
- package/dist/cli/ui/components/solid/SelectInput.js.map +1 -0
- package/dist/cli/ui/components/solid/TextInput.d.ts +12 -0
- package/dist/cli/ui/components/solid/TextInput.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/TextInput.js +9 -0
- package/dist/cli/ui/components/solid/TextInput.js.map +1 -0
- package/dist/cli/ui/components/solid/WizardController.d.ts +34 -0
- package/dist/cli/ui/components/solid/WizardController.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/WizardController.js +215 -0
- package/dist/cli/ui/components/solid/WizardController.js.map +1 -0
- package/dist/cli/ui/components/solid/WizardPopup.d.ts +26 -0
- package/dist/cli/ui/components/solid/WizardPopup.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/WizardPopup.js +68 -0
- package/dist/cli/ui/components/solid/WizardPopup.js.map +1 -0
- package/dist/cli/ui/components/solid/WizardSteps.d.ts +52 -0
- package/dist/cli/ui/components/solid/WizardSteps.d.ts.map +1 -0
- package/dist/cli/ui/components/solid/WizardSteps.js +462 -0
- package/dist/cli/ui/components/solid/WizardSteps.js.map +1 -0
- package/dist/cli/ui/core/index.d.ts +12 -0
- package/dist/cli/ui/core/index.d.ts.map +1 -0
- package/dist/cli/ui/core/index.js +15 -0
- package/dist/cli/ui/core/index.js.map +1 -0
- package/dist/cli/ui/core/keybindings.d.ts +106 -0
- package/dist/cli/ui/core/keybindings.d.ts.map +1 -0
- package/dist/cli/ui/core/keybindings.js +270 -0
- package/dist/cli/ui/core/keybindings.js.map +1 -0
- package/dist/cli/ui/core/theme.d.ts +114 -0
- package/dist/cli/ui/core/theme.d.ts.map +1 -0
- package/dist/cli/ui/core/theme.js +170 -0
- package/dist/cli/ui/core/theme.js.map +1 -0
- package/dist/cli/ui/core/types.d.ts +156 -0
- package/dist/cli/ui/core/types.d.ts.map +1 -0
- package/dist/cli/ui/core/types.js +10 -0
- package/dist/cli/ui/core/types.js.map +1 -0
- package/dist/cli/ui/hooks/solid/useScrollableList.d.ts +26 -0
- package/dist/cli/ui/hooks/solid/useScrollableList.d.ts.map +1 -0
- package/dist/cli/ui/hooks/solid/useScrollableList.js +89 -0
- package/dist/cli/ui/hooks/solid/useScrollableList.js.map +1 -0
- package/dist/cli/ui/hooks/solid/useTerminalSize.d.ts +10 -0
- package/dist/cli/ui/hooks/solid/useTerminalSize.d.ts.map +1 -0
- package/dist/cli/ui/hooks/solid/useTerminalSize.js +16 -0
- package/dist/cli/ui/hooks/solid/useTerminalSize.js.map +1 -0
- package/dist/cli/ui/index.solid.d.ts +5 -0
- package/dist/cli/ui/index.solid.d.ts.map +1 -0
- package/dist/cli/ui/index.solid.js +21 -0
- package/dist/cli/ui/index.solid.js.map +1 -0
- package/dist/cli/ui/{components/screens → screens/solid}/BranchListScreen.d.ts +8 -22
- package/dist/cli/ui/screens/solid/BranchListScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/BranchListScreen.js +756 -0
- package/dist/cli/ui/screens/solid/BranchListScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts +10 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.js +37 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/EnvironmentScreen.d.ts +14 -0
- package/dist/cli/ui/screens/solid/EnvironmentScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/EnvironmentScreen.js +91 -0
- package/dist/cli/ui/screens/solid/EnvironmentScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/ErrorScreen.d.ts +8 -0
- package/dist/cli/ui/screens/solid/ErrorScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/ErrorScreen.js +18 -0
- package/dist/cli/ui/screens/solid/ErrorScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/InputScreen.d.ts +13 -0
- package/dist/cli/ui/screens/solid/InputScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/InputScreen.js +17 -0
- package/dist/cli/ui/screens/solid/InputScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/LoadingIndicator.d.ts +9 -0
- package/dist/cli/ui/screens/solid/LoadingIndicator.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/LoadingIndicator.js +43 -0
- package/dist/cli/ui/screens/solid/LoadingIndicator.js.map +1 -0
- package/dist/cli/ui/{components/screens → screens/solid}/LogDetailScreen.d.ts +2 -2
- package/dist/cli/ui/screens/solid/LogDetailScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/LogDetailScreen.js +34 -0
- package/dist/cli/ui/screens/solid/LogDetailScreen.js.map +1 -0
- package/dist/cli/ui/{components/screens/LogListScreen.d.ts → screens/solid/LogScreen.d.ts} +4 -4
- package/dist/cli/ui/screens/solid/LogScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/LogScreen.js +95 -0
- package/dist/cli/ui/screens/solid/LogScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.d.ts +17 -0
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.js +112 -0
- package/dist/cli/ui/screens/solid/ProfileEnvScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/ProfileScreen.d.ts +17 -0
- package/dist/cli/ui/screens/solid/ProfileScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/ProfileScreen.js +50 -0
- package/dist/cli/ui/screens/solid/ProfileScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/SelectorScreen.d.ts +20 -0
- package/dist/cli/ui/screens/solid/SelectorScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/SelectorScreen.js +90 -0
- package/dist/cli/ui/screens/solid/SelectorScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.d.ts +13 -0
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.js +59 -0
- package/dist/cli/ui/screens/solid/WorktreeCreateScreen.js.map +1 -0
- package/dist/cli/ui/stores/appStore.d.ts +143 -0
- package/dist/cli/ui/stores/appStore.d.ts.map +1 -0
- package/dist/cli/ui/stores/appStore.js +158 -0
- package/dist/cli/ui/stores/appStore.js.map +1 -0
- package/dist/cli/ui/stores/branchStore.d.ts +159 -0
- package/dist/cli/ui/stores/branchStore.d.ts.map +1 -0
- package/dist/cli/ui/stores/branchStore.js +275 -0
- package/dist/cli/ui/stores/branchStore.js.map +1 -0
- package/dist/cli/ui/stores/index.d.ts +11 -0
- package/dist/cli/ui/stores/index.d.ts.map +1 -0
- package/dist/cli/ui/stores/index.js +14 -0
- package/dist/cli/ui/stores/index.js.map +1 -0
- package/dist/cli/ui/stores/uiStore.d.ts +146 -0
- package/dist/cli/ui/stores/uiStore.d.ts.map +1 -0
- package/dist/cli/ui/stores/uiStore.js +166 -0
- package/dist/cli/ui/stores/uiStore.js.map +1 -0
- package/dist/cli/ui/types.d.ts +16 -1
- 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 -210
- package/dist/cli/ui/utils/branchFormatter.js.map +1 -1
- package/dist/cli/ui/utils/continueSession.d.ts +4 -0
- package/dist/cli/ui/utils/continueSession.d.ts.map +1 -1
- package/dist/cli/ui/utils/continueSession.js +30 -0
- package/dist/cli/ui/utils/continueSession.js.map +1 -1
- package/dist/client/assets/{index-ChHC-Puh.css → index-BbfV7Wuj.css} +1 -1
- package/dist/client/assets/index-CoAyq5x1.js +78 -0
- package/dist/client/index.html +2 -2
- package/dist/codex.d.ts +1 -0
- package/dist/codex.d.ts.map +1 -1
- package/dist/codex.js +86 -45
- package/dist/codex.js.map +1 -1
- package/dist/config/builtin-coding-agents.d.ts +4 -0
- package/dist/config/builtin-coding-agents.d.ts.map +1 -1
- package/dist/config/builtin-coding-agents.js +18 -3
- package/dist/config/builtin-coding-agents.js.map +1 -1
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/tools.d.ts.map +1 -1
- package/dist/config/tools.js +11 -0
- package/dist/config/tools.js.map +1 -1
- package/dist/gemini.d.ts +1 -0
- package/dist/gemini.d.ts.map +1 -1
- package/dist/gemini.js +42 -37
- package/dist/gemini.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -102
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +18 -3
- package/dist/launcher.js.map +1 -1
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/logging/logger.js +26 -9
- package/dist/logging/logger.js.map +1 -1
- package/dist/opentui/highlights-eq9cgrbb.scm +604 -0
- package/dist/opentui/highlights-ghv9g403.scm +205 -0
- package/dist/opentui/highlights-hk7bwhj4.scm +284 -0
- package/dist/opentui/highlights-r812a2qc.scm +150 -0
- package/dist/opentui/highlights-x6tmsnaa.scm +115 -0
- package/dist/opentui/index.solid.d.ts +2 -0
- package/dist/opentui/index.solid.d.ts.map +1 -0
- package/dist/opentui/index.solid.js +52034 -0
- package/dist/opentui/index.solid.js.map +1 -0
- package/dist/opentui/injections-73j83es3.scm +27 -0
- package/dist/opentui/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist/opentui/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist/opentui/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist/opentui/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist/opentui/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist/repositories/worktree.repository.d.ts +1 -0
- package/dist/repositories/worktree.repository.d.ts.map +1 -1
- package/dist/repositories/worktree.repository.js +7 -0
- package/dist/repositories/worktree.repository.js.map +1 -1
- package/dist/services/codingAgentResolver.d.ts +2 -0
- package/dist/services/codingAgentResolver.d.ts.map +1 -1
- package/dist/services/codingAgentResolver.js +30 -4
- package/dist/services/codingAgentResolver.js.map +1 -1
- package/dist/services/dependency-installer.d.ts.map +1 -1
- package/dist/services/dependency-installer.js +0 -5
- package/dist/services/dependency-installer.js.map +1 -1
- package/dist/types/api.d.ts +3 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/coding-agent.d.ts +62 -0
- package/dist/types/coding-agent.d.ts.map +1 -0
- package/dist/types/coding-agent.js +29 -0
- package/dist/types/coding-agent.js.map +1 -0
- package/dist/types/tools.d.ts +17 -0
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/utils/coding-agent-colors.d.ts +88 -0
- package/dist/utils/coding-agent-colors.d.ts.map +1 -0
- package/dist/utils/coding-agent-colors.js +137 -0
- package/dist/utils/coding-agent-colors.js.map +1 -0
- package/dist/utils/command.d.ts +1 -1
- package/dist/utils/command.d.ts.map +1 -1
- package/dist/utils/command.js +10 -1
- package/dist/utils/command.js.map +1 -1
- package/dist/utils/error-utils.d.ts +27 -0
- package/dist/utils/error-utils.d.ts.map +1 -0
- package/dist/utils/error-utils.js +98 -0
- package/dist/utils/error-utils.js.map +1 -0
- package/dist/utils/npmRegistry.d.ts +61 -0
- package/dist/utils/npmRegistry.d.ts.map +1 -0
- package/dist/utils/npmRegistry.js +180 -0
- package/dist/utils/npmRegistry.js.map +1 -0
- package/dist/utils/prompt.d.ts +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/session/index.d.ts +5 -3
- package/dist/utils/session/index.d.ts.map +1 -1
- package/dist/utils/session/index.js +5 -2
- package/dist/utils/session/index.js.map +1 -1
- package/dist/utils/session/parsers/codex.d.ts.map +1 -1
- package/dist/utils/session/parsers/codex.js +8 -1
- package/dist/utils/session/parsers/codex.js.map +1 -1
- package/dist/utils/session/parsers/index.d.ts +1 -0
- package/dist/utils/session/parsers/index.d.ts.map +1 -1
- package/dist/utils/session/parsers/index.js +2 -0
- package/dist/utils/session/parsers/index.js.map +1 -1
- package/dist/utils/session/parsers/opencode.d.ts +23 -0
- package/dist/utils/session/parsers/opencode.d.ts.map +1 -0
- package/dist/utils/session/parsers/opencode.js +89 -0
- package/dist/utils/session/parsers/opencode.js.map +1 -0
- package/dist/utils/session/types.d.ts +4 -0
- package/dist/utils/session/types.d.ts.map +1 -1
- package/dist/utils/terminal.d.ts +1 -0
- package/dist/utils/terminal.d.ts.map +1 -1
- package/dist/utils/terminal.js +20 -0
- package/dist/utils/terminal.js.map +1 -1
- package/dist/utils.d.ts +9 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +33 -2
- package/dist/utils.js.map +1 -1
- package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts.map +1 -1
- package/dist/web/client/src/components/CodingAgentLaunchModal.js +7 -16
- package/dist/web/client/src/components/CodingAgentLaunchModal.js.map +1 -1
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts.map +1 -1
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.js +7 -2
- package/dist/web/client/src/components/branch-detail/BranchInfoCards.js.map +1 -1
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts.map +1 -1
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js +2 -1
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js.map +1 -1
- package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts +2 -2
- package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts.map +1 -1
- package/dist/web/client/src/components/branch-detail/ToolLauncher.js +5 -5
- package/dist/web/client/src/components/branch-detail/ToolLauncher.js.map +1 -1
- package/dist/web/client/src/lib/coding-agent-colors.d.ts +86 -0
- package/dist/web/client/src/lib/coding-agent-colors.d.ts.map +1 -0
- package/dist/web/client/src/lib/coding-agent-colors.js +135 -0
- package/dist/web/client/src/lib/coding-agent-colors.js.map +1 -0
- package/dist/web/client/src/pages/BranchDetailPage.js +10 -10
- package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
- package/dist/web/server/pty/manager.d.ts +2 -0
- package/dist/web/server/pty/manager.d.ts.map +1 -1
- package/dist/web/server/pty/manager.js +104 -0
- package/dist/web/server/pty/manager.js.map +1 -1
- package/dist/web/server/routes/sessions.d.ts.map +1 -1
- package/dist/web/server/routes/sessions.js +5 -1
- package/dist/web/server/routes/sessions.js.map +1 -1
- package/dist/web/server/services/branches.d.ts.map +1 -1
- package/dist/web/server/services/branches.js +10 -8
- package/dist/web/server/services/branches.js.map +1 -1
- package/dist/web/server/services/worktrees.js +2 -2
- package/dist/web/server/services/worktrees.js.map +1 -1
- package/dist/worktree.d.ts +47 -1
- package/dist/worktree.d.ts.map +1 -1
- package/dist/worktree.js +280 -94
- package/dist/worktree.js.map +1 -1
- package/package.json +12 -14
- package/src/claude.ts +68 -70
- package/src/cli/ui/App.solid.tsx +1823 -0
- package/src/cli/ui/__tests__/solid/AppSolid.cleanup.test.tsx +255 -0
- package/src/cli/ui/__tests__/solid/BranchListScreen.test.tsx +243 -0
- package/src/cli/ui/__tests__/solid/components/QuickStartStep.test.tsx +237 -0
- package/src/cli/ui/__tests__/solid/components/WizardPopup.test.tsx +231 -0
- package/src/cli/ui/__tests__/solid/components/WizardSteps.test.tsx +238 -0
- package/src/cli/ui/__tests__/utils/branchFormatter.test.ts +7 -289
- package/src/cli/ui/__tests__/utils/clipboard.test.ts +3 -3
- package/src/cli/ui/__tests__/utils/statisticsCalculator.test.ts +1 -1
- package/src/cli/ui/components/solid/Footer.tsx +36 -0
- package/src/cli/ui/components/{parts → solid}/Header.tsx +17 -28
- package/src/cli/ui/components/solid/HelpOverlay.tsx +194 -0
- package/src/cli/ui/components/solid/QuickStartStep.tsx +197 -0
- package/src/cli/ui/components/{parts → solid}/ScrollableList.tsx +7 -8
- package/src/cli/ui/components/solid/SearchInput.tsx +42 -0
- package/src/cli/ui/components/solid/SelectInput.tsx +84 -0
- package/src/cli/ui/components/solid/Stats.tsx +92 -0
- package/src/cli/ui/components/solid/TextInput.tsx +49 -0
- package/src/cli/ui/components/solid/WizardController.tsx +384 -0
- package/src/cli/ui/components/solid/WizardPopup.tsx +135 -0
- package/src/cli/ui/components/solid/WizardSteps.tsx +793 -0
- package/src/cli/ui/core/index.ts +17 -0
- package/src/cli/ui/core/keybindings.ts +367 -0
- package/src/cli/ui/core/theme.ts +234 -0
- package/src/cli/ui/core/types.ts +235 -0
- package/src/cli/ui/hooks/solid/useAsyncOperation.ts +76 -0
- package/src/cli/ui/hooks/solid/useFilter.ts +86 -0
- package/src/cli/ui/hooks/solid/useGitOperations.ts +80 -0
- package/src/cli/ui/hooks/solid/useKeyHandler.ts +103 -0
- package/src/cli/ui/hooks/solid/useScrollableList.ts +149 -0
- package/src/cli/ui/hooks/solid/useSelection.ts +77 -0
- package/src/cli/ui/hooks/solid/useTerminalSize.ts +22 -0
- package/src/cli/ui/index.solid.ts +28 -0
- package/src/cli/ui/screens/solid/BranchListScreen.tsx +1050 -0
- package/src/cli/ui/screens/solid/ConfirmScreen.tsx +74 -0
- package/src/cli/ui/screens/solid/EnvironmentScreen.tsx +159 -0
- package/src/cli/ui/screens/solid/ErrorScreen.tsx +42 -0
- package/src/cli/ui/screens/solid/InputScreen.tsx +55 -0
- package/src/cli/ui/screens/solid/LoadingIndicator.tsx +77 -0
- package/src/cli/ui/screens/solid/LogDetailScreen.tsx +75 -0
- package/src/cli/ui/screens/solid/LogScreen.tsx +175 -0
- package/src/cli/ui/screens/solid/ProfileEnvScreen.tsx +192 -0
- package/src/cli/ui/screens/solid/ProfileScreen.tsx +98 -0
- package/src/cli/ui/screens/solid/SelectorScreen.tsx +170 -0
- package/src/cli/ui/screens/solid/SettingsScreen.tsx +50 -0
- package/src/cli/ui/screens/solid/WorktreeCreateScreen.tsx +136 -0
- package/src/cli/ui/screens/solid/WorktreeDeleteScreen.tsx +40 -0
- package/src/cli/ui/stores/appStore.ts +208 -0
- package/src/cli/ui/stores/branchStore.ts +357 -0
- package/src/cli/ui/stores/index.ts +31 -0
- package/src/cli/ui/stores/uiStore.ts +226 -0
- package/src/cli/ui/types.ts +20 -3
- package/src/cli/ui/utils/__tests__/branchFormatter.test.ts +180 -0
- package/src/cli/ui/utils/branchFormatter.ts +8 -215
- package/src/cli/ui/utils/continueSession.ts +44 -0
- package/src/cli/ui/utils/modelOptions.test.ts +1 -1
- package/src/codex.ts +100 -43
- package/src/config/__tests__/saveSession.test.ts +143 -0
- package/src/config/builtin-coding-agents.ts +19 -3
- package/src/config/index.ts +4 -0
- package/src/config/tools.ts +16 -0
- package/src/gemini.ts +58 -43
- package/src/index.test.ts +12 -12
- package/src/index.ts +164 -142
- package/src/launcher.ts +22 -3
- package/src/logging/logger.ts +32 -10
- package/src/opentui/index.solid.ts +1 -0
- package/src/repositories/worktree.repository.ts +8 -0
- package/src/services/__tests__/BatchMergeService.test.ts +62 -66
- package/src/services/__tests__/WorktreeOrchestrator.test.ts +8 -7
- package/src/services/codingAgentResolver.ts +30 -4
- package/src/services/dependency-installer.ts +0 -7
- package/src/types/api.ts +3 -0
- package/src/types/coding-agent.ts +85 -0
- package/src/types/tools.ts +19 -0
- package/src/utils/__tests__/npmRegistry.test.ts +250 -0
- package/src/utils/__tests__/prompt.test.ts +4 -5
- package/src/utils/coding-agent-colors.ts +165 -0
- package/src/utils/command.ts +10 -1
- package/src/utils/error-utils.ts +133 -0
- package/src/utils/npmRegistry.ts +249 -0
- package/src/utils/prompt.ts +1 -1
- package/src/utils/session/index.ts +10 -2
- package/src/utils/session/parsers/codex.ts +9 -1
- package/src/utils/session/parsers/index.ts +6 -0
- package/src/utils/session/parsers/opencode.ts +110 -0
- package/src/utils/session/types.ts +5 -0
- package/src/utils/terminal.ts +24 -0
- package/src/utils.test.ts +1 -1
- package/src/utils.ts +37 -4
- package/src/web/client/src/components/CodingAgentLaunchModal.tsx +12 -21
- package/src/web/client/src/components/branch-detail/BranchInfoCards.tsx +16 -1
- package/src/web/client/src/components/branch-detail/SessionHistoryTable.tsx +7 -1
- package/src/web/client/src/components/branch-detail/ToolLauncher.tsx +11 -6
- package/src/web/client/src/lib/coding-agent-colors.ts +149 -0
- package/src/web/client/src/pages/BranchDetailPage.tsx +11 -11
- package/src/web/server/pty/manager.ts +139 -0
- package/src/web/server/routes/sessions.ts +6 -0
- package/src/web/server/services/branches.ts +11 -8
- package/src/web/server/services/worktrees.ts +2 -2
- package/src/worktree.ts +366 -107
- package/dist/cli/ui/components/App.d.ts +0 -25
- package/dist/cli/ui/components/App.d.ts.map +0 -1
- package/dist/cli/ui/components/App.js +0 -988
- package/dist/cli/ui/components/App.js.map +0 -1
- package/dist/cli/ui/components/common/Confirm.d.ts +0 -13
- package/dist/cli/ui/components/common/Confirm.d.ts.map +0 -1
- package/dist/cli/ui/components/common/Confirm.js +0 -20
- package/dist/cli/ui/components/common/Confirm.js.map +0 -1
- package/dist/cli/ui/components/common/ErrorBoundary.d.ts +0 -23
- package/dist/cli/ui/components/common/ErrorBoundary.d.ts.map +0 -1
- package/dist/cli/ui/components/common/ErrorBoundary.js +0 -37
- package/dist/cli/ui/components/common/ErrorBoundary.js.map +0 -1
- package/dist/cli/ui/components/common/Input.d.ts +0 -19
- package/dist/cli/ui/components/common/Input.d.ts.map +0 -1
- package/dist/cli/ui/components/common/Input.js +0 -22
- package/dist/cli/ui/components/common/Input.js.map +0 -1
- package/dist/cli/ui/components/common/LoadingIndicator.d.ts +0 -19
- package/dist/cli/ui/components/common/LoadingIndicator.d.ts.map +0 -1
- package/dist/cli/ui/components/common/LoadingIndicator.js +0 -61
- package/dist/cli/ui/components/common/LoadingIndicator.js.map +0 -1
- package/dist/cli/ui/components/common/Select.d.ts +0 -38
- package/dist/cli/ui/components/common/Select.d.ts.map +0 -1
- package/dist/cli/ui/components/common/Select.js +0 -151
- package/dist/cli/ui/components/common/Select.js.map +0 -1
- package/dist/cli/ui/components/common/SpinnerIcon.d.ts +0 -20
- package/dist/cli/ui/components/common/SpinnerIcon.d.ts.map +0 -1
- package/dist/cli/ui/components/common/SpinnerIcon.js +0 -61
- package/dist/cli/ui/components/common/SpinnerIcon.js.map +0 -1
- package/dist/cli/ui/components/parts/Footer.d.ts +0 -15
- package/dist/cli/ui/components/parts/Footer.d.ts.map +0 -1
- package/dist/cli/ui/components/parts/Footer.js +0 -20
- package/dist/cli/ui/components/parts/Footer.js.map +0 -1
- package/dist/cli/ui/components/parts/Header.d.ts.map +0 -1
- package/dist/cli/ui/components/parts/Header.js +0 -24
- package/dist/cli/ui/components/parts/Header.js.map +0 -1
- package/dist/cli/ui/components/parts/MergeStatusList.d.ts +0 -13
- package/dist/cli/ui/components/parts/MergeStatusList.d.ts.map +0 -1
- package/dist/cli/ui/components/parts/MergeStatusList.js +0 -52
- package/dist/cli/ui/components/parts/MergeStatusList.js.map +0 -1
- package/dist/cli/ui/components/parts/ProgressBar.d.ts +0 -13
- package/dist/cli/ui/components/parts/ProgressBar.d.ts.map +0 -1
- package/dist/cli/ui/components/parts/ProgressBar.js +0 -53
- package/dist/cli/ui/components/parts/ProgressBar.js.map +0 -1
- package/dist/cli/ui/components/parts/ScrollableList.d.ts +0 -12
- package/dist/cli/ui/components/parts/ScrollableList.d.ts.map +0 -1
- package/dist/cli/ui/components/parts/ScrollableList.js +0 -11
- package/dist/cli/ui/components/parts/ScrollableList.js.map +0 -1
- package/dist/cli/ui/components/parts/Stats.d.ts +0 -10
- package/dist/cli/ui/components/parts/Stats.d.ts.map +0 -1
- package/dist/cli/ui/components/parts/Stats.js +0 -55
- package/dist/cli/ui/components/parts/Stats.js.map +0 -1
- package/dist/cli/ui/components/screens/BatchMergeProgressScreen.d.ts +0 -17
- package/dist/cli/ui/components/screens/BatchMergeProgressScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/BatchMergeProgressScreen.js +0 -42
- package/dist/cli/ui/components/screens/BatchMergeProgressScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/BatchMergeResultScreen.d.ts +0 -17
- package/dist/cli/ui/components/screens/BatchMergeResultScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/BatchMergeResultScreen.js +0 -72
- package/dist/cli/ui/components/screens/BatchMergeResultScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts +0 -18
- package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/BranchCreatorScreen.js +0 -151
- package/dist/cli/ui/components/screens/BranchCreatorScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/BranchListScreen.js +0 -476
- package/dist/cli/ui/components/screens/BranchListScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.d.ts +0 -30
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.js +0 -145
- package/dist/cli/ui/components/screens/BranchQuickStartScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.d.ts +0 -27
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.js +0 -93
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/EnvironmentProfileScreen.d.ts +0 -19
- package/dist/cli/ui/components/screens/EnvironmentProfileScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/EnvironmentProfileScreen.js +0 -577
- package/dist/cli/ui/components/screens/EnvironmentProfileScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts +0 -45
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js +0 -95
- package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/LogDatePickerScreen.d.ts +0 -10
- package/dist/cli/ui/components/screens/LogDatePickerScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/LogDatePickerScreen.js +0 -44
- package/dist/cli/ui/components/screens/LogDatePickerScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/LogDetailScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/LogDetailScreen.js +0 -34
- package/dist/cli/ui/components/screens/LogDetailScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/LogListScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/LogListScreen.js +0 -107
- package/dist/cli/ui/components/screens/LogListScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts +0 -24
- package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/ModelSelectorScreen.js +0 -197
- package/dist/cli/ui/components/screens/ModelSelectorScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/PRCleanupScreen.d.ts +0 -29
- package/dist/cli/ui/components/screens/PRCleanupScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/PRCleanupScreen.js +0 -92
- package/dist/cli/ui/components/screens/PRCleanupScreen.js.map +0 -1
- package/dist/cli/ui/components/screens/SessionSelectorScreen.d.ts +0 -31
- package/dist/cli/ui/components/screens/SessionSelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/SessionSelectorScreen.js +0 -67
- package/dist/cli/ui/components/screens/SessionSelectorScreen.js.map +0 -1
- package/dist/cli/ui/hooks/useAppInput.d.ts +0 -21
- package/dist/cli/ui/hooks/useAppInput.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useAppInput.js +0 -138
- package/dist/cli/ui/hooks/useAppInput.js.map +0 -1
- package/dist/cli/ui/hooks/useBatchMerge.d.ts +0 -17
- package/dist/cli/ui/hooks/useBatchMerge.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useBatchMerge.js +0 -77
- package/dist/cli/ui/hooks/useBatchMerge.js.map +0 -1
- package/dist/cli/ui/hooks/useGitData.d.ts +0 -21
- package/dist/cli/ui/hooks/useGitData.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useGitData.js +0 -229
- package/dist/cli/ui/hooks/useGitData.js.map +0 -1
- package/dist/cli/ui/hooks/useProfiles.d.ts +0 -41
- package/dist/cli/ui/hooks/useProfiles.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useProfiles.js +0 -136
- package/dist/cli/ui/hooks/useProfiles.js.map +0 -1
- package/dist/cli/ui/hooks/useScreenState.d.ts +0 -12
- package/dist/cli/ui/hooks/useScreenState.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useScreenState.js +0 -30
- package/dist/cli/ui/hooks/useScreenState.js.map +0 -1
- package/dist/cli/ui/hooks/useTerminalSize.d.ts +0 -9
- package/dist/cli/ui/hooks/useTerminalSize.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useTerminalSize.js +0 -24
- package/dist/cli/ui/hooks/useTerminalSize.js.map +0 -1
- package/dist/cli/ui/hooks/useToolStatus.d.ts +0 -30
- package/dist/cli/ui/hooks/useToolStatus.d.ts.map +0 -1
- package/dist/cli/ui/hooks/useToolStatus.js +0 -49
- package/dist/cli/ui/hooks/useToolStatus.js.map +0 -1
- package/dist/cli/ui/screens/BranchActionSelectorScreen.d.ts +0 -24
- package/dist/cli/ui/screens/BranchActionSelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/screens/BranchActionSelectorScreen.js +0 -65
- package/dist/cli/ui/screens/BranchActionSelectorScreen.js.map +0 -1
- package/dist/client/assets/index-LNPtOrn3.js +0 -78
- package/src/cli/ui/__tests__/SKIPPED_TESTS.md +0 -119
- package/src/cli/ui/__tests__/acceptance/branchList.acceptance.test.tsx.skip +0 -239
- package/src/cli/ui/__tests__/acceptance/navigation.acceptance.test.tsx +0 -225
- package/src/cli/ui/__tests__/acceptance/realtimeUpdate.acceptance.test.tsx.skip +0 -219
- package/src/cli/ui/__tests__/components/App.protected-branch.test.tsx +0 -212
- package/src/cli/ui/__tests__/components/App.shortcuts.test.tsx +0 -440
- package/src/cli/ui/__tests__/components/App.test.tsx +0 -365
- package/src/cli/ui/__tests__/components/ModelSelectorScreen.initial.test.tsx +0 -91
- package/src/cli/ui/__tests__/components/common/Confirm.test.tsx +0 -80
- package/src/cli/ui/__tests__/components/common/ErrorBoundary.test.tsx +0 -104
- package/src/cli/ui/__tests__/components/common/Input.test.tsx +0 -100
- package/src/cli/ui/__tests__/components/common/LoadingIndicator.test.tsx +0 -148
- package/src/cli/ui/__tests__/components/common/Select.memo.test.tsx +0 -255
- package/src/cli/ui/__tests__/components/common/Select.test.tsx +0 -335
- package/src/cli/ui/__tests__/components/parts/Footer.test.tsx +0 -65
- package/src/cli/ui/__tests__/components/parts/Header.test.tsx +0 -55
- package/src/cli/ui/__tests__/components/parts/ScrollableList.test.tsx +0 -69
- package/src/cli/ui/__tests__/components/parts/Stats.test.tsx +0 -148
- package/src/cli/ui/__tests__/components/screens/BranchCreatorScreen.test.tsx +0 -253
- package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +0 -1070
- package/src/cli/ui/__tests__/components/screens/BranchQuickStartScreen.test.tsx +0 -142
- package/src/cli/ui/__tests__/components/screens/CodingAgentSelectorScreen.test.tsx +0 -174
- package/src/cli/ui/__tests__/components/screens/ExecutionModeSelectorScreen.test.tsx +0 -182
- package/src/cli/ui/__tests__/components/screens/LogDetailScreen.test.tsx +0 -57
- package/src/cli/ui/__tests__/components/screens/LogListScreen.test.tsx +0 -102
- package/src/cli/ui/__tests__/components/screens/PRCleanupScreen.test.tsx +0 -216
- package/src/cli/ui/__tests__/components/screens/SessionSelectorScreen.test.tsx +0 -147
- package/src/cli/ui/__tests__/hooks/useGitData.nonblocking.test.tsx +0 -206
- package/src/cli/ui/__tests__/hooks/useGitData.test.ts +0 -197
- package/src/cli/ui/__tests__/hooks/useGitData.test.ts.skip +0 -228
- package/src/cli/ui/__tests__/hooks/useScreenState.test.ts +0 -147
- package/src/cli/ui/__tests__/hooks/useTerminalSize.test.ts +0 -99
- package/src/cli/ui/__tests__/integration/branchList.test.tsx.skip +0 -253
- package/src/cli/ui/__tests__/integration/edgeCases.test.tsx +0 -436
- package/src/cli/ui/__tests__/integration/navigation.test.tsx +0 -514
- package/src/cli/ui/__tests__/integration/realtimeUpdate.test.tsx +0 -509
- package/src/cli/ui/__tests__/integration/realtimeUpdate.test.tsx.skip +0 -216
- package/src/cli/ui/__tests__/performance/branchList.performance.test.tsx +0 -193
- package/src/cli/ui/__tests__/performance/useMemoOptimization.test.tsx +0 -234
- package/src/cli/ui/components/App.tsx +0 -1456
- package/src/cli/ui/components/common/Confirm.tsx +0 -44
- package/src/cli/ui/components/common/ErrorBoundary.tsx +0 -60
- package/src/cli/ui/components/common/Input.tsx +0 -58
- package/src/cli/ui/components/common/LoadingIndicator.tsx +0 -98
- package/src/cli/ui/components/common/Select.tsx +0 -247
- package/src/cli/ui/components/common/SpinnerIcon.tsx +0 -86
- package/src/cli/ui/components/parts/Footer.tsx +0 -41
- package/src/cli/ui/components/parts/Header.test.tsx +0 -75
- package/src/cli/ui/components/parts/MergeStatusList.tsx +0 -75
- package/src/cli/ui/components/parts/ProgressBar.tsx +0 -73
- package/src/cli/ui/components/parts/Stats.tsx +0 -88
- package/src/cli/ui/components/screens/BatchMergeProgressScreen.tsx +0 -74
- package/src/cli/ui/components/screens/BatchMergeResultScreen.tsx +0 -108
- package/src/cli/ui/components/screens/BranchCreatorScreen.tsx +0 -242
- package/src/cli/ui/components/screens/BranchListScreen.tsx +0 -744
- package/src/cli/ui/components/screens/BranchQuickStartScreen.tsx +0 -241
- package/src/cli/ui/components/screens/CodingAgentSelectorScreen.tsx +0 -159
- package/src/cli/ui/components/screens/EnvironmentProfileScreen.tsx +0 -928
- package/src/cli/ui/components/screens/ExecutionModeSelectorScreen.tsx +0 -176
- package/src/cli/ui/components/screens/LogDatePickerScreen.tsx +0 -83
- package/src/cli/ui/components/screens/LogDetailScreen.tsx +0 -67
- package/src/cli/ui/components/screens/LogListScreen.tsx +0 -192
- package/src/cli/ui/components/screens/ModelSelectorScreen.tsx +0 -320
- package/src/cli/ui/components/screens/PRCleanupScreen.tsx +0 -171
- package/src/cli/ui/components/screens/SessionSelectorScreen.tsx +0 -135
- package/src/cli/ui/hooks/useAppInput.ts +0 -172
- package/src/cli/ui/hooks/useBatchMerge.ts +0 -96
- package/src/cli/ui/hooks/useGitData.ts +0 -347
- package/src/cli/ui/hooks/useProfiles.ts +0 -211
- package/src/cli/ui/hooks/useScreenState.ts +0 -44
- package/src/cli/ui/hooks/useTerminalSize.ts +0 -33
- package/src/cli/ui/hooks/useToolStatus.ts +0 -68
- package/src/cli/ui/screens/BranchActionSelectorScreen.tsx +0 -111
- package/src/cli/ui/screens/__tests__/BranchActionSelectorScreen.test.tsx +0 -264
package/dist/gemini.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { execa } from "execa";
|
|
2
2
|
import chalk from "chalk";
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
|
-
import { createChildStdio, getTerminalStreams, resetTerminalModes, } from "./utils/terminal.js";
|
|
4
|
+
import { createChildStdio, getTerminalStreams, resetTerminalModes, writeTerminalLine, } from "./utils/terminal.js";
|
|
5
5
|
import { findCommand } from "./utils/command.js";
|
|
6
6
|
import { findLatestGeminiSessionId } from "./utils/session.js";
|
|
7
|
-
const GEMINI_CLI_PACKAGE = "@google/gemini-cli
|
|
7
|
+
const GEMINI_CLI_PACKAGE = "@google/gemini-cli";
|
|
8
8
|
/**
|
|
9
9
|
* Error wrapper used by `launchGeminiCLI` to preserve the original failure
|
|
10
10
|
* while providing a user-friendly message.
|
|
@@ -34,12 +34,12 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
34
34
|
if (!existsSync(worktreePath)) {
|
|
35
35
|
throw new Error(`Worktree path does not exist: ${worktreePath}`);
|
|
36
36
|
}
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
writeTerminalLine(chalk.blue("🚀 Launching Gemini CLI..."));
|
|
38
|
+
writeTerminalLine(chalk.gray(` Working directory: ${worktreePath}`));
|
|
39
39
|
const args = [];
|
|
40
40
|
if (options.model) {
|
|
41
41
|
args.push("--model", options.model);
|
|
42
|
-
|
|
42
|
+
writeTerminalLine(chalk.green(` 🎯 Model: ${options.model}`));
|
|
43
43
|
}
|
|
44
44
|
// Handle execution mode
|
|
45
45
|
const resumeSessionId = options.sessionId && options.sessionId.trim().length > 0
|
|
@@ -80,28 +80,28 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
80
80
|
switch (options.mode) {
|
|
81
81
|
case "continue":
|
|
82
82
|
if (resumeSessionId) {
|
|
83
|
-
|
|
83
|
+
writeTerminalLine(chalk.cyan(` ⏭️ Continuing specific session: ${resumeSessionId}`));
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
|
-
|
|
86
|
+
writeTerminalLine(chalk.cyan(" ⏭️ Continuing most recent session"));
|
|
87
87
|
}
|
|
88
88
|
break;
|
|
89
89
|
case "resume":
|
|
90
90
|
if (resumeSessionId) {
|
|
91
|
-
|
|
91
|
+
writeTerminalLine(chalk.cyan(` 🔄 Resuming session: ${resumeSessionId}`));
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
94
|
-
|
|
94
|
+
writeTerminalLine(chalk.cyan(" 🔄 Resuming session (latest)"));
|
|
95
95
|
}
|
|
96
96
|
break;
|
|
97
97
|
case "normal":
|
|
98
98
|
default:
|
|
99
|
-
|
|
99
|
+
writeTerminalLine(chalk.green(" ✨ Starting new session"));
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
// Handle skip permissions (YOLO mode)
|
|
103
103
|
if (options.skipPermissions) {
|
|
104
|
-
|
|
104
|
+
writeTerminalLine(chalk.yellow(" ⚠️ Auto-approving all actions (YOLO mode)"));
|
|
105
105
|
}
|
|
106
106
|
terminal.exitRawMode();
|
|
107
107
|
resetTerminalModes(terminal.stdout);
|
|
@@ -115,6 +115,16 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
115
115
|
// Preserve TTY for interactive UI (colors/width) by inheriting stdout/stderr.
|
|
116
116
|
// Session ID is determined via file-based detection after exit.
|
|
117
117
|
let capturedSessionId = null;
|
|
118
|
+
// Determine execution strategy based on version selection
|
|
119
|
+
// FR-063b: "installed" option only appears when local command exists
|
|
120
|
+
const selectedVersion = options.version ?? "installed";
|
|
121
|
+
// Log version information (FR-072)
|
|
122
|
+
if (selectedVersion === "installed") {
|
|
123
|
+
writeTerminalLine(chalk.green(` 📦 Version: installed`));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
writeTerminalLine(chalk.green(` 📦 Version: @${selectedVersion}`));
|
|
127
|
+
}
|
|
118
128
|
const runGemini = async (runArgs) => {
|
|
119
129
|
const execChild = async (child) => {
|
|
120
130
|
try {
|
|
@@ -139,21 +149,16 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
139
149
|
});
|
|
140
150
|
await execChild(child);
|
|
141
151
|
};
|
|
142
|
-
if (
|
|
143
|
-
// Use
|
|
144
|
-
|
|
152
|
+
if (selectedVersion === "installed" && geminiLookup.path) {
|
|
153
|
+
// FR-066: Use locally installed command when "installed" is selected
|
|
154
|
+
// FR-063b guarantees local command exists when this option is shown
|
|
155
|
+
writeTerminalLine(chalk.green(" ✨ Using locally installed gemini command"));
|
|
145
156
|
return await run(geminiLookup.path, runArgs);
|
|
146
157
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const shouldSkipDelay = typeof process !== "undefined" &&
|
|
152
|
-
(process.env?.NODE_ENV === "test" || Boolean(process.env?.VITEST));
|
|
153
|
-
if (!shouldSkipDelay) {
|
|
154
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
155
|
-
}
|
|
156
|
-
return await run("bunx", [GEMINI_CLI_PACKAGE, ...runArgs]);
|
|
158
|
+
// FR-067, FR-068: Use bunx with version suffix for latest/specific versions
|
|
159
|
+
const packageWithVersion = `${GEMINI_CLI_PACKAGE}@${selectedVersion}`;
|
|
160
|
+
writeTerminalLine(chalk.cyan(` 🔄 Using bunx ${packageWithVersion}`));
|
|
161
|
+
return await run("bunx", [packageWithVersion, ...runArgs]);
|
|
157
162
|
};
|
|
158
163
|
let fellBackToLatest = false;
|
|
159
164
|
try {
|
|
@@ -166,7 +171,7 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
166
171
|
resumeSessionId;
|
|
167
172
|
if (shouldRetry) {
|
|
168
173
|
fellBackToLatest = true;
|
|
169
|
-
|
|
174
|
+
writeTerminalLine(chalk.yellow(` ⚠️ Failed to resume session ${resumeSessionId}. Retrying with latest session...`));
|
|
170
175
|
await runGemini(argsFallback);
|
|
171
176
|
}
|
|
172
177
|
else {
|
|
@@ -195,11 +200,11 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
if (capturedSessionId) {
|
|
198
|
-
|
|
199
|
-
|
|
203
|
+
writeTerminalLine(chalk.cyan(`\n 🆔 Session ID: ${capturedSessionId}`));
|
|
204
|
+
writeTerminalLine(chalk.gray(` Resume command: gemini --resume ${capturedSessionId}`));
|
|
200
205
|
}
|
|
201
206
|
else {
|
|
202
|
-
|
|
207
|
+
writeTerminalLine(chalk.yellow("\n ℹ️ Could not determine Gemini session ID automatically."));
|
|
203
208
|
}
|
|
204
209
|
return capturedSessionId ? { sessionId: capturedSessionId } : {};
|
|
205
210
|
}
|
|
@@ -223,16 +228,16 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
223
228
|
errorMessage = `Failed to launch Gemini CLI: ${details || "Unknown error"}`;
|
|
224
229
|
}
|
|
225
230
|
if (process.platform === "win32") {
|
|
226
|
-
|
|
231
|
+
writeTerminalLine(chalk.red("\n💡 Windows troubleshooting tips:"), "stderr");
|
|
227
232
|
if (hasLocalGemini) {
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
writeTerminalLine(chalk.yellow(" 1. Confirm that Gemini CLI is installed and the 'gemini' command is on PATH"), "stderr");
|
|
234
|
+
writeTerminalLine(chalk.yellow(' 2. Run "gemini --version" to verify the setup'), "stderr");
|
|
230
235
|
}
|
|
231
236
|
else {
|
|
232
|
-
|
|
233
|
-
|
|
237
|
+
writeTerminalLine(chalk.yellow(" 1. Confirm that Bun is installed and bunx is available"), "stderr");
|
|
238
|
+
writeTerminalLine(chalk.yellow(' 2. Run "bunx @google/gemini-cli@latest -- --version" to verify the setup'), "stderr");
|
|
234
239
|
}
|
|
235
|
-
|
|
240
|
+
writeTerminalLine(chalk.yellow(" 3. Restart your terminal or IDE to refresh PATH"), "stderr");
|
|
236
241
|
}
|
|
237
242
|
throw new GeminiError(errorMessage, error);
|
|
238
243
|
}
|
|
@@ -246,14 +251,14 @@ export async function launchGeminiCLI(worktreePath, options = {}) {
|
|
|
246
251
|
*/
|
|
247
252
|
export async function isGeminiCLIAvailable() {
|
|
248
253
|
try {
|
|
249
|
-
await execa("bunx", [GEMINI_CLI_PACKAGE
|
|
254
|
+
await execa("bunx", [`${GEMINI_CLI_PACKAGE}@latest`, "--version"]);
|
|
250
255
|
return true;
|
|
251
256
|
}
|
|
252
257
|
catch (error) {
|
|
253
258
|
const err = error;
|
|
254
259
|
if (err.code === "ENOENT") {
|
|
255
|
-
|
|
256
|
-
|
|
260
|
+
writeTerminalLine(chalk.yellow("\n⚠️ bunx command not found"), "stderr");
|
|
261
|
+
writeTerminalLine(chalk.gray(" Install Bun and confirm that bunx is available before continuing"), "stderr");
|
|
257
262
|
}
|
|
258
263
|
return false;
|
|
259
264
|
}
|
package/dist/gemini.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini.js","sourceRoot":"","sources":["../src/gemini.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"gemini.js","sourceRoot":"","s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AC,CAAC;IACtC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,kBAAkB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,KAA8B,CAAC;QAC3C,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1B,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,8BAA8B,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC1E,iBAAiB,CACf,KAAK,CAAC,IAAI,CACR,qEAAqE,CACtE,EACD,QAAQ,CACT,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAwBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAmO7D;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,IAAI,CAAC,CA0lBf;AAED,KAAK,SAAS,GAAG,MAAM,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAAC;AAC5D,KAAK,eAAe,GAAG,CAAC,SAAS,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAerE,wBAAsB,kBAAkB,CACtC,SAAS,GAAE,SAA8B,EACzC,eAAe,GAAE,eAAsC,GACtD,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;GAEG;AACH,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAmD1C;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CASrE"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { isGitRepository, getRepositoryRoot, branchExists, fetchAllRemotes, pullFastForward, getBranchDivergenceStatuses, hasUncommittedChanges, hasUnpushedCommits, getUncommittedChangesCount, getUnpushedCommitsCount,
|
|
4
|
+
import { isGitRepository, getRepositoryRoot, branchExists, fetchAllRemotes, pullFastForward, getBranchDivergenceStatuses, hasUncommittedChanges, hasUnpushedCommits, getUncommittedChangesCount, getUnpushedCommitsCount, } from "./git.js";
|
|
5
5
|
import { launchClaudeCode } from "./claude.js";
|
|
6
|
-
import { launchCodexCLI
|
|
7
|
-
import { launchGeminiCLI
|
|
6
|
+
import { launchCodexCLI } from "./codex.js";
|
|
7
|
+
import { launchGeminiCLI } from "./gemini.js";
|
|
8
8
|
import { WorktreeOrchestrator, } from "./services/WorktreeOrchestrator.js";
|
|
9
9
|
import chalk from "chalk";
|
|
10
|
-
import { isProtectedBranchName, switchToProtectedBranch,
|
|
11
|
-
import { getTerminalStreams, waitForUserAcknowledgement, } from "./utils/terminal.js";
|
|
10
|
+
import { isProtectedBranchName, switchToProtectedBranch, resolveWorktreePathForBranch, repairWorktreePath, } from "./worktree.js";
|
|
11
|
+
import { getTerminalStreams, resetTerminalModes, waitForUserAcknowledgement, writeTerminalLine, } from "./utils/terminal.js";
|
|
12
12
|
import { createLogger } from "./logging/logger.js";
|
|
13
13
|
import { getCodingAgentById, getSharedEnvironment } from "./config/tools.js";
|
|
14
14
|
import { launchCodingAgent } from "./launcher.js";
|
|
15
15
|
import { saveSession, loadSession } from "./config/index.js";
|
|
16
16
|
import { findLatestCodexSession, findLatestClaudeSession, findLatestGeminiSession, } from "./utils/session.js";
|
|
17
|
-
import { getPackageVersion } from "./utils.js";
|
|
17
|
+
import { getPackageVersion, setupExitHandlers, registerExitCleanup, clearExitCleanup, } from "./utils.js";
|
|
18
18
|
import { findLatestClaudeSessionId } from "./utils/session.js";
|
|
19
19
|
import { resolveContinueSessionId } from "./cli/ui/utils/continueSession.js";
|
|
20
20
|
import { normalizeModelId } from "./cli/ui/utils/modelOptions.js";
|
|
21
21
|
import { installDependenciesForWorktree, DependencyInstallError, } from "./services/dependency-installer.js";
|
|
22
|
-
import {
|
|
22
|
+
import { isGitRelatedError, isRecoverableError } from "./utils/error-utils.js";
|
|
23
23
|
const ERROR_PROMPT = chalk.yellow("Review the error details, then press Enter to continue.");
|
|
24
|
-
const
|
|
24
|
+
const SUCCESS_PROMPT = chalk.green("Press Enter to return to main menu...");
|
|
25
|
+
const POST_SESSION_DELAY_MS = 500;
|
|
25
26
|
// Category: cli
|
|
26
27
|
const appLogger = createLogger({ category: "cli" });
|
|
27
28
|
async function waitForErrorAcknowledgement() {
|
|
@@ -31,63 +32,18 @@ async function waitForErrorAcknowledgement() {
|
|
|
31
32
|
* Simple print functions (replacing legacy UI display functions)
|
|
32
33
|
*/
|
|
33
34
|
function printError(message) {
|
|
34
|
-
|
|
35
|
+
writeTerminalLine(chalk.red(`❌ ${message}`), "stderr");
|
|
35
36
|
appLogger.error({ message });
|
|
36
37
|
}
|
|
37
38
|
function printInfo(message) {
|
|
38
|
-
|
|
39
|
+
writeTerminalLine(chalk.blue(`ℹ️ ${message}`));
|
|
39
40
|
appLogger.info({ message });
|
|
40
41
|
}
|
|
41
42
|
function printWarning(message) {
|
|
42
|
-
|
|
43
|
+
writeTerminalLine(chalk.yellow(`⚠️ ${message}`), "stderr");
|
|
43
44
|
appLogger.warn({ message });
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
-
if (!error) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
if (error instanceof GitError || error instanceof WorktreeError) {
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
if (error instanceof Error) {
|
|
53
|
-
return error.name === "GitError" || error.name === "WorktreeError";
|
|
54
|
-
}
|
|
55
|
-
if (typeof error === "object" &&
|
|
56
|
-
"name" in error) {
|
|
57
|
-
const name = error.name;
|
|
58
|
-
return name === "GitError" || name === "WorktreeError";
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
function isRecoverableError(error) {
|
|
63
|
-
if (!error) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
if (error instanceof GitError ||
|
|
67
|
-
error instanceof WorktreeError ||
|
|
68
|
-
error instanceof CodexError ||
|
|
69
|
-
error instanceof GeminiError ||
|
|
70
|
-
error instanceof DependencyInstallError) {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
if (error instanceof Error) {
|
|
74
|
-
return (error.name === "GitError" ||
|
|
75
|
-
error.name === "WorktreeError" ||
|
|
76
|
-
error.name === "CodexError" ||
|
|
77
|
-
error.name === "GeminiError" ||
|
|
78
|
-
error.name === "DependencyInstallError");
|
|
79
|
-
}
|
|
80
|
-
if (typeof error === "object" &&
|
|
81
|
-
"name" in error) {
|
|
82
|
-
const name = error.name;
|
|
83
|
-
return (name === "GitError" ||
|
|
84
|
-
name === "WorktreeError" ||
|
|
85
|
-
name === "CodexError" ||
|
|
86
|
-
name === "GeminiError" ||
|
|
87
|
-
name === "DependencyInstallError");
|
|
88
|
-
}
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
46
|
+
// Note: isGitRelatedError and isRecoverableError are now imported from ./utils/error-utils.js
|
|
91
47
|
async function runGitStep(description, step) {
|
|
92
48
|
try {
|
|
93
49
|
const value = await step();
|
|
@@ -162,43 +118,64 @@ async function showVersion() {
|
|
|
162
118
|
}
|
|
163
119
|
}
|
|
164
120
|
/**
|
|
165
|
-
*
|
|
121
|
+
* Performs terminal cleanup when exiting.
|
|
122
|
+
*/
|
|
123
|
+
function performTerminalCleanup() {
|
|
124
|
+
const terminal = getTerminalStreams();
|
|
125
|
+
terminal.exitRawMode();
|
|
126
|
+
resetTerminalModes(terminal.stdout);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Main function for OpenTUI UI
|
|
166
130
|
* Returns SelectionResult if user made selections, undefined if user quit
|
|
167
131
|
*/
|
|
168
|
-
async function
|
|
169
|
-
const {
|
|
170
|
-
const React = await import("react");
|
|
171
|
-
const { App } = await import("./cli/ui/components/App.js");
|
|
132
|
+
async function mainSolidUI() {
|
|
133
|
+
const { renderSolidApp } = await import("./opentui/index.solid.js");
|
|
172
134
|
const terminal = getTerminalStreams();
|
|
135
|
+
// Register cleanup for signal handlers
|
|
136
|
+
registerExitCleanup(performTerminalCleanup);
|
|
173
137
|
let selectionResult;
|
|
174
|
-
//
|
|
138
|
+
// マウスキャプチャを有効にしてSelection APIで選択終了時にクリップボードへコピー
|
|
139
|
+
const useMouse = true;
|
|
140
|
+
const enableMouseMovement = false;
|
|
141
|
+
const altScreenPreference = process.env.GWT_UI_ALT_SCREEN?.trim().toLowerCase();
|
|
142
|
+
// Ink.js版ではalternate screenを使用していなかったため、デフォルトをfalseに
|
|
143
|
+
// alternate screenを使用するとコーディングエージェント起動/終了ログが見えなくなる
|
|
144
|
+
const useAlternateScreen = altScreenPreference === "true" || altScreenPreference === "1";
|
|
175
145
|
if (typeof terminal.stdin.resume === "function") {
|
|
176
146
|
terminal.stdin.resume();
|
|
177
147
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
patchConsole: false,
|
|
187
|
-
});
|
|
188
|
-
// Wait for user to exit
|
|
148
|
+
if (typeof terminal.stdin.setRawMode === "function") {
|
|
149
|
+
try {
|
|
150
|
+
terminal.stdin.setRawMode(true);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Ignore raw mode errors and let OpenTUI handle setup.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
189
156
|
try {
|
|
190
|
-
await
|
|
157
|
+
await renderSolidApp({
|
|
158
|
+
onExit: (result) => {
|
|
159
|
+
selectionResult = result;
|
|
160
|
+
},
|
|
161
|
+
}, {
|
|
162
|
+
stdin: terminal.stdin,
|
|
163
|
+
stdout: terminal.stdout,
|
|
164
|
+
exitOnCtrlC: true,
|
|
165
|
+
useAlternateScreen,
|
|
166
|
+
useMouse,
|
|
167
|
+
enableMouseMovement,
|
|
168
|
+
});
|
|
191
169
|
}
|
|
192
170
|
finally {
|
|
193
|
-
|
|
171
|
+
performTerminalCleanup();
|
|
194
172
|
if (typeof terminal.stdin.pause === "function") {
|
|
195
173
|
terminal.stdin.pause();
|
|
196
174
|
}
|
|
197
|
-
// Inkが残した data リスナーが子プロセス入力を奪わないようクリーンアップ
|
|
198
175
|
terminal.stdin.removeAllListeners?.("data");
|
|
199
176
|
terminal.stdin.removeAllListeners?.("keypress");
|
|
200
177
|
terminal.stdin.removeAllListeners?.("readable");
|
|
201
|
-
|
|
178
|
+
clearExitCleanup();
|
|
202
179
|
}
|
|
203
180
|
return selectionResult;
|
|
204
181
|
}
|
|
@@ -206,7 +183,7 @@ async function mainInkUI() {
|
|
|
206
183
|
* Handle AI tool workflow
|
|
207
184
|
*/
|
|
208
185
|
export async function handleAIToolWorkflow(selectionResult) {
|
|
209
|
-
const { branch, displayName, branchType, remoteBranch, tool, mode, skipPermissions, model, inferenceLevel, sessionId: selectedSessionId, } = selectionResult;
|
|
186
|
+
const { branch, displayName, branchType, remoteBranch, baseBranch, isNewBranch, tool, mode, skipPermissions, model, inferenceLevel, sessionId: selectedSessionId, toolVersion, } = selectionResult;
|
|
210
187
|
const branchLabel = displayName ?? branch;
|
|
211
188
|
const normalizedModel = normalizeModelId(tool, model ?? null);
|
|
212
189
|
const modelInfo = normalizedModel || inferenceLevel
|
|
@@ -222,17 +199,40 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
222
199
|
const repoRoot = repoRootResult.value;
|
|
223
200
|
// Determine ensure options (local vs remote branch)
|
|
224
201
|
const ensureOptions = {};
|
|
225
|
-
if (
|
|
202
|
+
if (isNewBranch) {
|
|
203
|
+
ensureOptions.isNewBranch = true;
|
|
204
|
+
if (baseBranch) {
|
|
205
|
+
ensureOptions.baseBranch = baseBranch;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (branchType === "remote" && !isNewBranch) {
|
|
226
209
|
const remoteRef = remoteBranch ?? branch;
|
|
227
210
|
const localExists = await branchExists(branch);
|
|
228
211
|
ensureOptions.baseBranch = remoteRef;
|
|
229
212
|
ensureOptions.isNewBranch = !localExists;
|
|
230
213
|
}
|
|
231
|
-
|
|
232
|
-
|
|
214
|
+
let existingWorktreeResolution = await resolveWorktreePathForBranch(branch);
|
|
215
|
+
let existingWorktree = existingWorktreeResolution.path;
|
|
216
|
+
// mismatch検出時に自動修復を試みる (FR-009〜FR-013)
|
|
233
217
|
if (!existingWorktree && existingWorktreeResolution.mismatch) {
|
|
234
218
|
const actualBranch = existingWorktreeResolution.mismatch.actualBranch ?? "unknown";
|
|
235
|
-
printWarning(`Worktree mismatch detected: ${existingWorktreeResolution.mismatch.path} is checked out to '${actualBranch}'.
|
|
219
|
+
printWarning(`Worktree mismatch detected: ${existingWorktreeResolution.mismatch.path} is checked out to '${actualBranch}'. Attempting to repair...`);
|
|
220
|
+
// 共通修復関数を使用してパス修復を試みる
|
|
221
|
+
const repairResult = await repairWorktreePath(branch, existingWorktreeResolution.mismatch.path, repoRoot);
|
|
222
|
+
if (repairResult.repaired) {
|
|
223
|
+
// FR-012: 修復成功時のメッセージ
|
|
224
|
+
printInfo(`Worktree path repaired: ${repairResult.newPath}`);
|
|
225
|
+
// 修復後に再度解決を試みる
|
|
226
|
+
existingWorktreeResolution = await resolveWorktreePathForBranch(branch);
|
|
227
|
+
existingWorktree = existingWorktreeResolution.path;
|
|
228
|
+
}
|
|
229
|
+
else if (repairResult.removed) {
|
|
230
|
+
// FR-013: メタデータ削除成功時のメッセージ
|
|
231
|
+
printInfo(`Stale worktree metadata removed. Creating new worktree...`);
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
printWarning(`Failed to repair worktree for '${branch}'.`);
|
|
235
|
+
}
|
|
236
236
|
}
|
|
237
237
|
const isProtectedBranch = isProtectedBranchName(branch) ||
|
|
238
238
|
(remoteBranch ? isProtectedBranchName(remoteBranch) : false);
|
|
@@ -350,25 +350,26 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
350
350
|
if (sanitizedRemoteBranch) {
|
|
351
351
|
divergenceBranches.add(sanitizedRemoteBranch);
|
|
352
352
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
353
|
+
let divergenceStatuses = [];
|
|
354
|
+
try {
|
|
355
|
+
divergenceStatuses = await getBranchDivergenceStatuses({
|
|
356
|
+
cwd: repoRoot,
|
|
357
|
+
branches: Array.from(divergenceBranches),
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
const details = error instanceof Error ? error.message : String(error);
|
|
362
|
+
printWarning(`Failed to check branch divergence. Error: ${details}. Continuing without blocking.`);
|
|
363
|
+
divergenceStatuses = [];
|
|
359
364
|
}
|
|
360
|
-
const divergenceStatuses = divergenceResult.value;
|
|
361
365
|
const divergedBranches = divergenceStatuses.filter((status) => status.remoteAhead > 0 && status.localAhead > 0);
|
|
362
366
|
if (divergedBranches.length > 0) {
|
|
363
367
|
printWarning("Potential merge conflicts detected when pulling the following local branches:");
|
|
364
368
|
divergedBranches.forEach(({ branch: divergedBranch, remoteAhead, localAhead }) => {
|
|
365
369
|
const highlight = divergedBranch === branch ? " (selected branch)" : "";
|
|
366
|
-
|
|
370
|
+
writeTerminalLine(chalk.yellow(` • ${divergedBranch}${highlight} remote:+${remoteAhead} local:+${localAhead}`), "stderr");
|
|
367
371
|
});
|
|
368
|
-
printWarning("Resolve these divergences (e.g., rebase or merge)
|
|
369
|
-
await waitForEnter("Press Enter to return to the main menu and resolve these issues manually.");
|
|
370
|
-
printWarning("AI tool launch has been cancelled until divergences are resolved.");
|
|
371
|
-
return;
|
|
372
|
+
printWarning("Resolve these divergences (e.g., rebase or merge) to avoid conflicts. Continuing without blocking.");
|
|
372
373
|
}
|
|
373
374
|
else if (fastForwardError) {
|
|
374
375
|
printWarning(`Fast-forward pull could not complete (${fastForwardError.message}). Continuing without blocking.`);
|
|
@@ -393,6 +394,7 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
393
394
|
model: normalizedModel ?? null,
|
|
394
395
|
reasoningLevel: inferenceLevel ?? null,
|
|
395
396
|
skipPermissions: skipPermissions ?? null,
|
|
397
|
+
toolVersion: toolVersion ?? null,
|
|
396
398
|
timestamp: Date.now(),
|
|
397
399
|
repositoryRoot: repoRoot,
|
|
398
400
|
});
|
|
@@ -431,6 +433,7 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
431
433
|
model: normalizedModel ?? null,
|
|
432
434
|
reasoningLevel: inferenceLevel ?? null,
|
|
433
435
|
skipPermissions: skipPermissions ?? null,
|
|
436
|
+
toolVersion: toolVersion ?? null,
|
|
434
437
|
timestamp: Date.now(),
|
|
435
438
|
repositoryRoot: repoRoot,
|
|
436
439
|
}, { skipHistory: true });
|
|
@@ -455,6 +458,7 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
455
458
|
envOverrides: sharedEnv,
|
|
456
459
|
sessionId: resumeSessionId,
|
|
457
460
|
chrome: true,
|
|
461
|
+
version: toolVersion ?? null,
|
|
458
462
|
};
|
|
459
463
|
if (normalizedModel) {
|
|
460
464
|
launchOptions.model = normalizedModel;
|
|
@@ -471,6 +475,7 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
471
475
|
bypassApprovals: skipPermissions,
|
|
472
476
|
envOverrides: sharedEnv,
|
|
473
477
|
sessionId: resumeSessionId,
|
|
478
|
+
version: toolVersion ?? null,
|
|
474
479
|
};
|
|
475
480
|
if (normalizedModel) {
|
|
476
481
|
launchOptions.model = normalizedModel;
|
|
@@ -491,6 +496,7 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
491
496
|
skipPermissions,
|
|
492
497
|
envOverrides: sharedEnv,
|
|
493
498
|
sessionId: resumeSessionId,
|
|
499
|
+
version: toolVersion ?? null,
|
|
494
500
|
};
|
|
495
501
|
if (normalizedModel) {
|
|
496
502
|
launchOptions.model = normalizedModel;
|
|
@@ -498,9 +504,9 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
498
504
|
launchResult = await launchGeminiCLI(worktreePath, launchOptions);
|
|
499
505
|
}
|
|
500
506
|
else {
|
|
501
|
-
// Custom coding agent
|
|
507
|
+
// Custom coding agent (including OpenCode)
|
|
502
508
|
printInfo(`Launching custom agent: ${agentConfig.displayName}`);
|
|
503
|
-
|
|
509
|
+
const customLaunchOptions = {
|
|
504
510
|
mode: mode === "resume"
|
|
505
511
|
? "resume"
|
|
506
512
|
: mode === "continue"
|
|
@@ -509,7 +515,11 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
509
515
|
skipPermissions,
|
|
510
516
|
cwd: worktreePath,
|
|
511
517
|
sharedEnv,
|
|
512
|
-
}
|
|
518
|
+
};
|
|
519
|
+
if (toolVersion) {
|
|
520
|
+
customLaunchOptions.version = toolVersion;
|
|
521
|
+
}
|
|
522
|
+
launchResult = await launchCodingAgent(agentConfig, customLaunchOptions);
|
|
513
523
|
}
|
|
514
524
|
}
|
|
515
525
|
finally {
|
|
@@ -589,6 +599,7 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
589
599
|
model: normalizedModel ?? null,
|
|
590
600
|
reasoningLevel: inferenceLevel ?? null,
|
|
591
601
|
skipPermissions: skipPermissions ?? null,
|
|
602
|
+
toolVersion: toolVersion ?? null,
|
|
592
603
|
timestamp: Date.now(),
|
|
593
604
|
repositoryRoot: repoRoot,
|
|
594
605
|
lastSessionId: finalSessionId,
|
|
@@ -619,7 +630,8 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
619
630
|
}
|
|
620
631
|
// Small buffer before returning to branch list to avoid abrupt screen swap
|
|
621
632
|
await new Promise((resolve) => setTimeout(resolve, POST_SESSION_DELAY_MS));
|
|
622
|
-
printInfo("Session completed successfully.
|
|
633
|
+
printInfo("Session completed successfully.");
|
|
634
|
+
await waitForUserAcknowledgement(SUCCESS_PROMPT);
|
|
623
635
|
return;
|
|
624
636
|
}
|
|
625
637
|
catch (error) {
|
|
@@ -634,6 +646,9 @@ export async function handleAIToolWorkflow(selectionResult) {
|
|
|
634
646
|
throw error;
|
|
635
647
|
}
|
|
636
648
|
}
|
|
649
|
+
function resolveUIHandler() {
|
|
650
|
+
return mainSolidUI;
|
|
651
|
+
}
|
|
637
652
|
function logLoopError(error, context) {
|
|
638
653
|
const label = context === "ui" ? "UI" : "workflow";
|
|
639
654
|
if (error instanceof Error) {
|
|
@@ -643,8 +658,8 @@ function logLoopError(error, context) {
|
|
|
643
658
|
printError(`${label} error: ${String(error)}`);
|
|
644
659
|
}
|
|
645
660
|
}
|
|
646
|
-
export async function runInteractiveLoop(uiHandler =
|
|
647
|
-
// Main loop: UI →
|
|
661
|
+
export async function runInteractiveLoop(uiHandler = resolveUIHandler(), workflowHandler = handleAIToolWorkflow) {
|
|
662
|
+
// Main loop: UI → Coding Agent → back to UI
|
|
648
663
|
while (true) {
|
|
649
664
|
let selectionResult;
|
|
650
665
|
try {
|
|
@@ -673,6 +688,8 @@ export async function runInteractiveLoop(uiHandler = mainInkUI, workflowHandler
|
|
|
673
688
|
* Main entry point
|
|
674
689
|
*/
|
|
675
690
|
export async function main() {
|
|
691
|
+
// Setup global signal handlers for clean exit
|
|
692
|
+
setupExitHandlers();
|
|
676
693
|
// Parse command line arguments
|
|
677
694
|
const args = process.argv.slice(2);
|
|
678
695
|
const showVersionFlag = args.includes("-v") || args.includes("--version");
|
|
@@ -706,6 +723,8 @@ export async function main() {
|
|
|
706
723
|
process.exit(1);
|
|
707
724
|
}
|
|
708
725
|
await runInteractiveLoop();
|
|
726
|
+
// Ensure clean exit with code 0
|
|
727
|
+
process.exit(0);
|
|
709
728
|
}
|
|
710
729
|
export function isEntryPoint(metaUrl, argv1) {
|
|
711
730
|
if (!argv1) {
|
|
@@ -721,7 +740,8 @@ export function isEntryPoint(metaUrl, argv1) {
|
|
|
721
740
|
// Run the application if this module is executed directly
|
|
722
741
|
if (isEntryPoint(import.meta.url, process.argv[1])) {
|
|
723
742
|
main().catch(async (error) => {
|
|
724
|
-
|
|
743
|
+
const details = error instanceof Error ? (error.stack ?? error.message) : String(error);
|
|
744
|
+
writeTerminalLine(`Fatal error: ${details}`, "stderr");
|
|
725
745
|
await waitForErrorAcknowledgement();
|
|
726
746
|
process.exit(1);
|
|
727
747
|
});
|