@akiojin/gwt 4.10.0 → 4.12.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 +4 -4
- package/README.md +4 -4
- package/bin/gwt.js +1 -1
- package/dist/claude.d.ts +2 -0
- package/dist/claude.d.ts.map +1 -1
- package/dist/claude.js +97 -68
- 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 +1395 -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 +152 -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 +45 -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 +223 -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 +419 -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 +123 -0
- package/dist/cli/ui/core/theme.d.ts.map +1 -0
- package/dist/cli/ui/core/theme.js +191 -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/screens/solid/BranchListScreen.d.ts +53 -0
- package/dist/cli/ui/screens/solid/BranchListScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/BranchListScreen.js +829 -0
- package/dist/cli/ui/screens/solid/BranchListScreen.js.map +1 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts +11 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/ConfirmScreen.js +45 -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 +90 -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} +10 -4
- package/dist/cli/ui/screens/solid/LogScreen.d.ts.map +1 -0
- package/dist/cli/ui/screens/solid/LogScreen.js +333 -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 +115 -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 +98 -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 +17 -1
- package/dist/cli/ui/types.d.ts.map +1 -1
- package/dist/cli/ui/utils/branchFormatter.d.ts +1 -0
- package/dist/cli/ui/utils/branchFormatter.d.ts.map +1 -1
- package/dist/cli/ui/utils/branchFormatter.js +36 -217
- package/dist/cli/ui/utils/branchFormatter.js.map +1 -1
- package/dist/cli/ui/utils/continueSession.d.ts +18 -0
- package/dist/cli/ui/utils/continueSession.d.ts.map +1 -1
- package/dist/cli/ui/utils/continueSession.js +90 -2
- package/dist/cli/ui/utils/continueSession.js.map +1 -1
- package/dist/cli/ui/utils/versionCache.d.ts +37 -0
- package/dist/cli/ui/utils/versionCache.d.ts.map +1 -0
- package/dist/cli/ui/utils/versionCache.js +70 -0
- package/dist/cli/ui/utils/versionCache.js.map +1 -0
- package/dist/cli/ui/utils/versionFetcher.d.ts +41 -0
- package/dist/cli/ui/utils/versionFetcher.d.ts.map +1 -0
- package/dist/cli/ui/utils/versionFetcher.js +89 -0
- package/dist/cli/ui/utils/versionFetcher.js.map +1 -0
- 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 +2 -0
- package/dist/codex.d.ts.map +1 -1
- package/dist/codex.js +109 -39
- package/dist/codex.js.map +1 -1
- package/dist/config/builtin-coding-agents.js +4 -4
- 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 +11 -0
- package/dist/config/index.js.map +1 -1
- package/dist/gemini.d.ts +2 -0
- package/dist/gemini.d.ts.map +1 -1
- package/dist/gemini.js +77 -39
- 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 +153 -103
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +56 -6
- package/dist/launcher.js.map +1 -1
- package/dist/logging/agentOutput.d.ts +21 -0
- package/dist/logging/agentOutput.d.ts.map +1 -0
- package/dist/logging/agentOutput.js +164 -0
- package/dist/logging/agentOutput.js.map +1 -0
- package/dist/logging/formatter.d.ts.map +1 -1
- package/dist/logging/formatter.js +18 -4
- package/dist/logging/formatter.js.map +1 -1
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/logging/logger.js +28 -9
- package/dist/logging/logger.js.map +1 -1
- package/dist/logging/reader.d.ts +21 -0
- package/dist/logging/reader.d.ts.map +1 -1
- package/dist/logging/reader.js +79 -0
- package/dist/logging/reader.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 +53687 -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 +2 -7
- 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.js +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/common.d.ts +8 -0
- package/dist/utils/session/common.d.ts.map +1 -1
- package/dist/utils/session/common.js +22 -0
- package/dist/utils/session/common.js.map +1 -1
- package/dist/utils/session/parsers/claude.d.ts +10 -4
- package/dist/utils/session/parsers/claude.d.ts.map +1 -1
- package/dist/utils/session/parsers/claude.js +64 -18
- package/dist/utils/session/parsers/claude.js.map +1 -1
- package/dist/utils/session/parsers/codex.d.ts.map +1 -1
- package/dist/utils/session/parsers/codex.js +47 -20
- package/dist/utils/session/parsers/codex.js.map +1 -1
- package/dist/utils/session/parsers/gemini.d.ts.map +1 -1
- package/dist/utils/session/parsers/gemini.js +43 -6
- package/dist/utils/session/parsers/gemini.js.map +1 -1
- package/dist/utils/session/parsers/opencode.d.ts.map +1 -1
- package/dist/utils/session/parsers/opencode.js +43 -6
- package/dist/utils/session/parsers/opencode.js.map +1 -1
- package/dist/utils/session/types.d.ts +7 -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/components/ui/alert.d.ts +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 +50 -1
- package/dist/worktree.d.ts.map +1 -1
- package/dist/worktree.js +292 -100
- package/dist/worktree.js.map +1 -1
- package/package.json +13 -14
- package/src/claude.ts +129 -95
- package/src/cli/ui/App.solid.tsx +2096 -0
- package/src/cli/ui/__tests__/solid/AppSolid.cleanup.test.tsx +1084 -0
- package/src/cli/ui/__tests__/solid/BranchListScreen.test.tsx +343 -0
- package/src/cli/ui/__tests__/solid/ConfirmScreen.test.tsx +77 -0
- package/src/cli/ui/__tests__/solid/LogScreen.test.tsx +351 -0
- package/src/cli/ui/__tests__/solid/components/QuickStartStep.test.tsx +308 -0
- package/src/cli/ui/__tests__/solid/components/WizardPopup.test.tsx +231 -0
- package/src/cli/ui/__tests__/solid/components/WizardSteps.test.tsx +241 -0
- package/src/cli/ui/__tests__/utils/branchFormatter.test.ts +79 -334
- 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 +209 -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 +88 -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 +393 -0
- package/src/cli/ui/components/solid/WizardPopup.tsx +135 -0
- package/src/cli/ui/components/solid/WizardSteps.tsx +736 -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 +266 -0
- package/src/cli/ui/core/types.ts +235 -0
- package/src/cli/ui/hooks/solid/useAsyncOperation.ts +78 -0
- package/src/cli/ui/hooks/solid/useFilter.ts +86 -0
- package/src/cli/ui/hooks/solid/useGitOperations.ts +81 -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 +1153 -0
- package/src/cli/ui/screens/solid/ConfirmScreen.tsx +86 -0
- package/src/cli/ui/screens/solid/EnvironmentScreen.tsx +161 -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 +504 -0
- package/src/cli/ui/screens/solid/ProfileEnvScreen.tsx +196 -0
- package/src/cli/ui/screens/solid/ProfileScreen.tsx +98 -0
- package/src/cli/ui/screens/solid/SelectorScreen.tsx +181 -0
- package/src/cli/ui/screens/solid/SettingsScreen.tsx +52 -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 +21 -3
- package/src/cli/ui/utils/__tests__/branchFormatter.test.ts +227 -0
- package/src/cli/ui/utils/branchFormatter.ts +43 -222
- package/src/cli/ui/utils/continueSession.ts +133 -2
- package/src/cli/ui/utils/modelOptions.test.ts +1 -1
- package/src/cli/ui/utils/versionCache.ts +93 -0
- package/src/cli/ui/utils/versionFetcher.ts +120 -0
- package/src/codex.ts +138 -39
- package/src/config/__tests__/saveSession.test.ts +143 -0
- package/src/config/builtin-coding-agents.ts +4 -4
- package/src/config/index.ts +14 -0
- package/src/gemini.ts +107 -46
- package/src/index.test.ts +25 -19
- package/src/index.ts +202 -143
- package/src/launcher.ts +66 -6
- package/src/logging/agentOutput.ts +216 -0
- package/src/logging/formatter.ts +23 -4
- package/src/logging/logger.ts +34 -10
- package/src/logging/reader.ts +117 -0
- package/src/opentui/index.solid.ts +1 -0
- package/src/repositories/worktree.repository.ts +8 -0
- package/src/services/__tests__/BatchMergeService.test.ts +83 -67
- package/src/services/__tests__/WorktreeOrchestrator.test.ts +8 -7
- package/src/services/codingAgentResolver.ts +30 -4
- package/src/services/dependency-installer.ts +2 -9
- 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 +1 -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/common.ts +28 -0
- package/src/utils/session/parsers/claude.ts +79 -29
- package/src/utils/session/parsers/codex.ts +50 -18
- package/src/utils/session/parsers/gemini.ts +46 -5
- package/src/utils/session/parsers/opencode.ts +46 -5
- package/src/utils/session/types.ts +4 -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 +386 -114
- 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 -1006
- 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 +0 -60
- 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 -148
- 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 -1478
- 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 -244
- 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/src/launcher.ts
CHANGED
|
@@ -6,8 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { execa } from "execa";
|
|
9
|
+
import chalk from "chalk";
|
|
9
10
|
import type { CodingAgent, CodingAgentLaunchOptions } from "./types/tools.js";
|
|
10
11
|
import { createLogger } from "./logging/logger.js";
|
|
12
|
+
import {
|
|
13
|
+
runAgentWithPty,
|
|
14
|
+
shouldCaptureAgentOutput,
|
|
15
|
+
} from "./logging/agentOutput.js";
|
|
16
|
+
import {
|
|
17
|
+
parsePackageCommand,
|
|
18
|
+
resolveVersionSuffix,
|
|
19
|
+
} from "./utils/npmRegistry.js";
|
|
20
|
+
import { writeTerminalLine } from "./utils/terminal.js";
|
|
11
21
|
|
|
12
22
|
const logger = createLogger({ category: "launcher" });
|
|
13
23
|
|
|
@@ -122,14 +132,32 @@ export async function launchCodingAgent(
|
|
|
122
132
|
...(options.sharedEnv ?? {}),
|
|
123
133
|
...(agent.env ?? {}),
|
|
124
134
|
};
|
|
135
|
+
const workingDir = options.cwd ?? process.cwd();
|
|
136
|
+
const captureOutput = shouldCaptureAgentOutput(env);
|
|
125
137
|
|
|
126
138
|
// execa共通オプション(cwdがundefinedの場合は含めない)
|
|
127
139
|
const execaOptions = {
|
|
128
140
|
stdio: "inherit" as const,
|
|
129
|
-
...(
|
|
141
|
+
...(workingDir ? { cwd: workingDir } : {}),
|
|
130
142
|
env,
|
|
131
143
|
};
|
|
132
144
|
|
|
145
|
+
const runWithCapture = async (command: string, commandArgs: string[]) => {
|
|
146
|
+
const result = await runAgentWithPty({
|
|
147
|
+
command,
|
|
148
|
+
args: commandArgs,
|
|
149
|
+
cwd: workingDir,
|
|
150
|
+
env,
|
|
151
|
+
agentId: agent.id,
|
|
152
|
+
});
|
|
153
|
+
if (result.signal !== null && result.signal !== undefined) {
|
|
154
|
+
throw new Error(`Coding agent terminated by signal ${result.signal}`);
|
|
155
|
+
}
|
|
156
|
+
if (result.exitCode !== null && result.exitCode !== 0) {
|
|
157
|
+
throw new Error(`Coding agent exited with code ${result.exitCode}`);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
133
161
|
logger.info(
|
|
134
162
|
{
|
|
135
163
|
agentId: agent.id,
|
|
@@ -143,23 +171,55 @@ export async function launchCodingAgent(
|
|
|
143
171
|
switch (agent.type) {
|
|
144
172
|
case "path": {
|
|
145
173
|
// 絶対パスで直接実行
|
|
146
|
-
|
|
174
|
+
if (captureOutput) {
|
|
175
|
+
await runWithCapture(agent.command, args);
|
|
176
|
+
} else {
|
|
177
|
+
await execa(agent.command, args, execaOptions);
|
|
178
|
+
}
|
|
147
179
|
logger.info({ agentId: agent.id }, "Coding agent completed (path)");
|
|
148
180
|
break;
|
|
149
181
|
}
|
|
150
182
|
|
|
151
183
|
case "bunx": {
|
|
152
184
|
// bunx経由でパッケージ実行
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
185
|
+
// バージョン指定がある場合はパッケージ名に付与
|
|
186
|
+
const { packageName, version: embeddedVersion } = parsePackageCommand(
|
|
187
|
+
agent.command,
|
|
188
|
+
);
|
|
189
|
+
const selectedVersion = options.version ?? embeddedVersion ?? "latest";
|
|
190
|
+
const versionSuffix = resolveVersionSuffix(selectedVersion);
|
|
191
|
+
const packageWithVersion = `${packageName}${versionSuffix}`;
|
|
192
|
+
|
|
193
|
+
// FR-072: Log version information
|
|
194
|
+
if (selectedVersion === "installed") {
|
|
195
|
+
writeTerminalLine(chalk.green(` 📦 Version: installed`));
|
|
196
|
+
} else {
|
|
197
|
+
writeTerminalLine(chalk.green(` 📦 Version: @${selectedVersion}`));
|
|
198
|
+
}
|
|
199
|
+
writeTerminalLine(chalk.cyan(` 🔄 Using bunx ${packageWithVersion}`));
|
|
200
|
+
|
|
201
|
+
// bunx [package@version] [args...]
|
|
202
|
+
const bunxCommand = captureOutput ? await resolveCommand("bunx") : "bunx";
|
|
203
|
+
if (captureOutput) {
|
|
204
|
+
await runWithCapture(bunxCommand, [packageWithVersion, ...args]);
|
|
205
|
+
} else {
|
|
206
|
+
await execa("bunx", [packageWithVersion, ...args], execaOptions);
|
|
207
|
+
}
|
|
208
|
+
logger.info(
|
|
209
|
+
{ agentId: agent.id, version: selectedVersion },
|
|
210
|
+
"Coding agent completed (bunx)",
|
|
211
|
+
);
|
|
156
212
|
break;
|
|
157
213
|
}
|
|
158
214
|
|
|
159
215
|
case "command": {
|
|
160
216
|
// PATH解決 → 実行
|
|
161
217
|
const resolvedPath = await resolveCommand(agent.command);
|
|
162
|
-
|
|
218
|
+
if (captureOutput) {
|
|
219
|
+
await runWithCapture(resolvedPath, args);
|
|
220
|
+
} else {
|
|
221
|
+
await execa(resolvedPath, args, execaOptions);
|
|
222
|
+
}
|
|
163
223
|
logger.info({ agentId: agent.id }, "Coding agent completed (command)");
|
|
164
224
|
break;
|
|
165
225
|
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import * as pty from "node-pty";
|
|
2
|
+
import type { IPty } from "node-pty";
|
|
3
|
+
import { createLogger } from "./logger.js";
|
|
4
|
+
import { resolveLogDir } from "./reader.js";
|
|
5
|
+
import { getTerminalStreams } from "../utils/terminal.js";
|
|
6
|
+
|
|
7
|
+
export const CAPTURE_AGENT_OUTPUT_ENV = "GWT_CAPTURE_AGENT_OUTPUT";
|
|
8
|
+
|
|
9
|
+
export function shouldCaptureAgentOutput(
|
|
10
|
+
env: NodeJS.ProcessEnv = process.env,
|
|
11
|
+
): boolean {
|
|
12
|
+
const raw = env[CAPTURE_AGENT_OUTPUT_ENV];
|
|
13
|
+
if (raw === undefined) {
|
|
14
|
+
// Default to false to avoid PTY stdin/stdout conflicts with OpenTUI.
|
|
15
|
+
// Set GWT_CAPTURE_AGENT_OUTPUT=true to enable agent output logging.
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
const normalized = String(raw).trim().toLowerCase();
|
|
19
|
+
if (!normalized) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return normalized === "true" || normalized === "1";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// eslint-disable-next-line no-control-regex
|
|
26
|
+
const ANSI_PATTERN = new RegExp("\\u001b\\[[0-9;]*[A-Za-z]", "g");
|
|
27
|
+
|
|
28
|
+
export function stripAnsi(value: string): string {
|
|
29
|
+
return value.replace(ANSI_PATTERN, "");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface AgentOutputLineBuffer {
|
|
33
|
+
push: (chunk: string) => void;
|
|
34
|
+
flush: () => void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function createAgentOutputLineBuffer(
|
|
38
|
+
onLine: (line: string) => void,
|
|
39
|
+
): AgentOutputLineBuffer {
|
|
40
|
+
let buffer = "";
|
|
41
|
+
|
|
42
|
+
const push = (chunk: string) => {
|
|
43
|
+
const normalized = chunk.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
44
|
+
buffer += normalized;
|
|
45
|
+
while (true) {
|
|
46
|
+
const index = buffer.indexOf("\n");
|
|
47
|
+
if (index === -1) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
const line = buffer.slice(0, index);
|
|
51
|
+
buffer = buffer.slice(index + 1);
|
|
52
|
+
onLine(line);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const flush = () => {
|
|
57
|
+
if (!buffer) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const line = buffer;
|
|
61
|
+
buffer = "";
|
|
62
|
+
onLine(line);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return { push, flush };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface AgentOutputCaptureOptions {
|
|
69
|
+
command: string;
|
|
70
|
+
args: string[];
|
|
71
|
+
cwd: string;
|
|
72
|
+
env: NodeJS.ProcessEnv;
|
|
73
|
+
agentId: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface AgentOutputCaptureResult {
|
|
77
|
+
exitCode: number | null;
|
|
78
|
+
signal?: number | null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const normalizeEnv = (env: NodeJS.ProcessEnv): Record<string, string> =>
|
|
82
|
+
Object.fromEntries(
|
|
83
|
+
Object.entries(env).filter(
|
|
84
|
+
(entry): entry is [string, string] => typeof entry[1] === "string",
|
|
85
|
+
),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const getTerminalSize = (terminal: ReturnType<typeof getTerminalStreams>) => {
|
|
89
|
+
const stdout = terminal.stdout as
|
|
90
|
+
| (NodeJS.WriteStream & { columns?: number; rows?: number })
|
|
91
|
+
| undefined;
|
|
92
|
+
const cols = stdout?.columns ?? process.stdout.columns ?? 80;
|
|
93
|
+
const rows = stdout?.rows ?? process.stdout.rows ?? 24;
|
|
94
|
+
return { cols, rows };
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export async function runAgentWithPty(
|
|
98
|
+
options: AgentOutputCaptureOptions,
|
|
99
|
+
): Promise<AgentOutputCaptureResult> {
|
|
100
|
+
const terminal = getTerminalStreams();
|
|
101
|
+
const { cols, rows } = getTerminalSize(terminal);
|
|
102
|
+
const logDir = resolveLogDir(options.cwd);
|
|
103
|
+
const stdoutLogger = createLogger({
|
|
104
|
+
category: "agent.stdout",
|
|
105
|
+
logDir,
|
|
106
|
+
base: { agentId: options.agentId },
|
|
107
|
+
});
|
|
108
|
+
const stderrLogger = createLogger({
|
|
109
|
+
category: "agent.stderr",
|
|
110
|
+
logDir,
|
|
111
|
+
base: { agentId: options.agentId },
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const normalizedEnv = normalizeEnv(options.env);
|
|
115
|
+
const ptyProcess: IPty = pty.spawn(options.command, options.args, {
|
|
116
|
+
name: process.env.TERM ?? "xterm-256color",
|
|
117
|
+
cols,
|
|
118
|
+
rows,
|
|
119
|
+
cwd: options.cwd,
|
|
120
|
+
env: normalizedEnv,
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
const lineBuffer = createAgentOutputLineBuffer((line) => {
|
|
124
|
+
const cleaned = stripAnsi(line).trimEnd();
|
|
125
|
+
if (!cleaned) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
stdoutLogger.info(cleaned);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const stdout = terminal.stdout;
|
|
132
|
+
const writeToTerminal =
|
|
133
|
+
stdout && typeof stdout.write === "function"
|
|
134
|
+
? stdout.write.bind(stdout)
|
|
135
|
+
: null;
|
|
136
|
+
|
|
137
|
+
ptyProcess.onData((data) => {
|
|
138
|
+
if (writeToTerminal) {
|
|
139
|
+
try {
|
|
140
|
+
writeToTerminal(data);
|
|
141
|
+
} catch {
|
|
142
|
+
// Ignore terminal write errors.
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
lineBuffer.push(data);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const stdin = terminal.stdin;
|
|
149
|
+
const handleInput = (chunk: Buffer | string) => {
|
|
150
|
+
const data = typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
151
|
+
ptyProcess.write(data);
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const stdinWasRaw =
|
|
155
|
+
stdin &&
|
|
156
|
+
typeof (stdin as NodeJS.ReadStream & { isRaw?: boolean }).isRaw ===
|
|
157
|
+
"boolean"
|
|
158
|
+
? (stdin as NodeJS.ReadStream & { isRaw?: boolean }).isRaw
|
|
159
|
+
: undefined;
|
|
160
|
+
|
|
161
|
+
if (stdin && typeof stdin.on === "function") {
|
|
162
|
+
if (stdin.isTTY && typeof stdin.setRawMode === "function") {
|
|
163
|
+
try {
|
|
164
|
+
stdin.setRawMode(true);
|
|
165
|
+
} catch {
|
|
166
|
+
// Ignore raw mode errors.
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (typeof stdin.resume === "function") {
|
|
170
|
+
stdin.resume();
|
|
171
|
+
}
|
|
172
|
+
stdin.on("data", handleInput);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const handleResize = () => {
|
|
176
|
+
const next = getTerminalSize(terminal);
|
|
177
|
+
try {
|
|
178
|
+
ptyProcess.resize(next.cols, next.rows);
|
|
179
|
+
} catch {
|
|
180
|
+
// Ignore resize errors.
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
if (process.stdout && typeof process.stdout.on === "function") {
|
|
184
|
+
process.stdout.on("resize", handleResize);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return await new Promise<AgentOutputCaptureResult>((resolve) => {
|
|
188
|
+
ptyProcess.onExit(({ exitCode, signal }) => {
|
|
189
|
+
lineBuffer.flush();
|
|
190
|
+
if (stdin && typeof stdin.off === "function") {
|
|
191
|
+
stdin.off("data", handleInput);
|
|
192
|
+
}
|
|
193
|
+
if (stdin && typeof stdin.pause === "function") {
|
|
194
|
+
stdin.pause();
|
|
195
|
+
}
|
|
196
|
+
if (stdin && stdin.isTTY && typeof stdin.setRawMode === "function") {
|
|
197
|
+
try {
|
|
198
|
+
stdin.setRawMode(Boolean(stdinWasRaw));
|
|
199
|
+
} catch {
|
|
200
|
+
// Ignore raw mode restore errors.
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (process.stdout && typeof process.stdout.off === "function") {
|
|
204
|
+
process.stdout.off("resize", handleResize);
|
|
205
|
+
}
|
|
206
|
+
if (exitCode !== null && exitCode !== 0) {
|
|
207
|
+
stderrLogger.error(
|
|
208
|
+
{ exitCode, signal },
|
|
209
|
+
"Agent exited with non-zero code",
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
const normalizedSignal = signal ?? null;
|
|
213
|
+
resolve({ exitCode, signal: normalizedSignal });
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
}
|
package/src/logging/formatter.ts
CHANGED
|
@@ -19,17 +19,36 @@ const LEVEL_LABELS: Record<number, string> = {
|
|
|
19
19
|
60: "FATAL",
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
const LOCAL_TIME_FORMATTER = new Intl.DateTimeFormat(undefined, {
|
|
23
|
+
hour: "2-digit",
|
|
24
|
+
minute: "2-digit",
|
|
25
|
+
second: "2-digit",
|
|
26
|
+
hour12: false,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const formatLocalTimeParts = (date: Date): string => {
|
|
30
|
+
const parts = LOCAL_TIME_FORMATTER.formatToParts(date);
|
|
31
|
+
const get = (type: Intl.DateTimeFormatPartTypes) =>
|
|
32
|
+
parts.find((part) => part.type === type)?.value;
|
|
33
|
+
const hour = get("hour");
|
|
34
|
+
const minute = get("minute");
|
|
35
|
+
const second = get("second");
|
|
36
|
+
|
|
37
|
+
if (!hour || !minute || !second) {
|
|
38
|
+
return LOCAL_TIME_FORMATTER.format(date);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return `${hour}:${minute}:${second}`;
|
|
42
|
+
};
|
|
43
|
+
|
|
22
44
|
const formatTimeLabel = (
|
|
23
45
|
value: unknown,
|
|
24
46
|
): { label: string; timestamp: number | null } => {
|
|
25
47
|
if (typeof value === "string" || typeof value === "number") {
|
|
26
48
|
const date = new Date(value);
|
|
27
49
|
if (!Number.isNaN(date.getTime())) {
|
|
28
|
-
const hours = String(date.getHours()).padStart(2, "0");
|
|
29
|
-
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
30
|
-
const seconds = String(date.getSeconds()).padStart(2, "0");
|
|
31
50
|
return {
|
|
32
|
-
label:
|
|
51
|
+
label: formatLocalTimeParts(date),
|
|
33
52
|
timestamp: date.getTime(),
|
|
34
53
|
};
|
|
35
54
|
}
|
package/src/logging/logger.ts
CHANGED
|
@@ -31,6 +31,11 @@ export function createLogger(config: LoggerConfig = {}): Logger {
|
|
|
31
31
|
const filename = config.filename ?? `${formatDate(new Date())}.jsonl`;
|
|
32
32
|
const category = config.category ?? "default";
|
|
33
33
|
const keepDays = config.keepDays ?? 7;
|
|
34
|
+
const platform = os.platform();
|
|
35
|
+
const isWSL =
|
|
36
|
+
platform === "linux" && os.release().toLowerCase().includes("microsoft");
|
|
37
|
+
const preferDirectDestination =
|
|
38
|
+
platform === "win32" || isWSL || process.env.GWT_LOGGER_TRANSPORT === "0";
|
|
34
39
|
|
|
35
40
|
if (!fs.existsSync(logDir)) {
|
|
36
41
|
fs.mkdirSync(logDir, { recursive: true });
|
|
@@ -54,21 +59,40 @@ export function createLogger(config: LoggerConfig = {}): Logger {
|
|
|
54
59
|
const destinationStream = pino.destination({
|
|
55
60
|
dest: destination,
|
|
56
61
|
sync: true,
|
|
62
|
+
append: true,
|
|
57
63
|
});
|
|
58
64
|
return pino(options, destinationStream);
|
|
59
65
|
}
|
|
60
66
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
if (!preferDirectDestination) {
|
|
68
|
+
try {
|
|
69
|
+
const transport = pino.transport({
|
|
70
|
+
targets: [
|
|
71
|
+
{
|
|
72
|
+
target: "pino/file",
|
|
73
|
+
options: { destination, mkdir: true, append: true },
|
|
74
|
+
level,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return pino(options, transport);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
if (process.env.DEBUG_LOGGER) {
|
|
82
|
+
console.error(
|
|
83
|
+
"Logger transport disabled; falling back to direct file destination.",
|
|
84
|
+
error instanceof Error ? error.message : String(error),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
70
89
|
|
|
71
|
-
|
|
90
|
+
const destinationStream = pino.destination({
|
|
91
|
+
dest: destination,
|
|
92
|
+
sync: false,
|
|
93
|
+
append: true,
|
|
94
|
+
});
|
|
95
|
+
return pino(options, destinationStream);
|
|
72
96
|
}
|
|
73
97
|
|
|
74
98
|
/** Convenience logger for quick use (category defaults to "default"). */
|
package/src/logging/reader.ts
CHANGED
|
@@ -9,6 +9,25 @@ export interface LogFileInfo {
|
|
|
9
9
|
mtimeMs: number;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
export type LogTargetReason =
|
|
13
|
+
| "worktree"
|
|
14
|
+
| "worktree-inaccessible"
|
|
15
|
+
| "current-working-directory"
|
|
16
|
+
| "working-directory"
|
|
17
|
+
| "no-worktree";
|
|
18
|
+
|
|
19
|
+
export interface LogTargetBranch {
|
|
20
|
+
name: string;
|
|
21
|
+
isCurrent?: boolean;
|
|
22
|
+
worktree?: { path: string; isAccessible?: boolean } | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface LogTargetResolution {
|
|
26
|
+
logDir: string | null;
|
|
27
|
+
sourcePath: string | null;
|
|
28
|
+
reason: LogTargetReason;
|
|
29
|
+
}
|
|
30
|
+
|
|
12
31
|
const LOG_FILENAME_PATTERN = /^\d{4}-\d{2}-\d{2}\.jsonl$/;
|
|
13
32
|
|
|
14
33
|
export function resolveLogDir(cwd: string = process.cwd()): string {
|
|
@@ -16,6 +35,46 @@ export function resolveLogDir(cwd: string = process.cwd()): string {
|
|
|
16
35
|
return path.join(os.homedir(), ".gwt", "logs", cwdBase);
|
|
17
36
|
}
|
|
18
37
|
|
|
38
|
+
export function resolveLogTarget(
|
|
39
|
+
branch: LogTargetBranch | null,
|
|
40
|
+
workingDirectory: string = process.cwd(),
|
|
41
|
+
): LogTargetResolution {
|
|
42
|
+
if (!branch) {
|
|
43
|
+
return {
|
|
44
|
+
logDir: resolveLogDir(workingDirectory),
|
|
45
|
+
sourcePath: workingDirectory,
|
|
46
|
+
reason: "working-directory",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const worktreePath = branch.worktree?.path;
|
|
51
|
+
if (worktreePath) {
|
|
52
|
+
const accessible = branch.worktree?.isAccessible !== false;
|
|
53
|
+
if (accessible) {
|
|
54
|
+
return {
|
|
55
|
+
logDir: resolveLogDir(worktreePath),
|
|
56
|
+
sourcePath: worktreePath,
|
|
57
|
+
reason: "worktree",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
logDir: null,
|
|
62
|
+
sourcePath: worktreePath,
|
|
63
|
+
reason: "worktree-inaccessible",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (branch.isCurrent) {
|
|
68
|
+
return {
|
|
69
|
+
logDir: resolveLogDir(workingDirectory),
|
|
70
|
+
sourcePath: workingDirectory,
|
|
71
|
+
reason: "current-working-directory",
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return { logDir: null, sourcePath: null, reason: "no-worktree" };
|
|
76
|
+
}
|
|
77
|
+
|
|
19
78
|
export function buildLogFilePath(logDir: string, date: string): string {
|
|
20
79
|
return path.join(logDir, `${date}.jsonl`);
|
|
21
80
|
}
|
|
@@ -66,6 +125,23 @@ export async function listLogFiles(logDir: string): Promise<LogFileInfo[]> {
|
|
|
66
125
|
}
|
|
67
126
|
}
|
|
68
127
|
|
|
128
|
+
export async function clearLogFiles(logDir: string): Promise<number> {
|
|
129
|
+
const files = await listLogFiles(logDir);
|
|
130
|
+
let cleared = 0;
|
|
131
|
+
for (const file of files) {
|
|
132
|
+
try {
|
|
133
|
+
await fs.truncate(file.path, 0);
|
|
134
|
+
cleared += 1;
|
|
135
|
+
} catch (error) {
|
|
136
|
+
const err = error as NodeJS.ErrnoException;
|
|
137
|
+
if (err.code !== "ENOENT") {
|
|
138
|
+
throw error;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return cleared;
|
|
143
|
+
}
|
|
144
|
+
|
|
69
145
|
export async function listRecentLogFiles(
|
|
70
146
|
logDir: string,
|
|
71
147
|
days = 7,
|
|
@@ -74,3 +150,44 @@ export async function listRecentLogFiles(
|
|
|
74
150
|
const cutoff = Date.now() - days * 24 * 60 * 60 * 1000;
|
|
75
151
|
return files.filter((file) => file.mtimeMs >= cutoff);
|
|
76
152
|
}
|
|
153
|
+
|
|
154
|
+
export interface LogReadResult {
|
|
155
|
+
date: string;
|
|
156
|
+
lines: string[];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export async function readLogLinesForDate(
|
|
160
|
+
logDir: string,
|
|
161
|
+
preferredDate: string,
|
|
162
|
+
): Promise<LogReadResult | null> {
|
|
163
|
+
const files = await listLogFiles(logDir);
|
|
164
|
+
if (files.length === 0) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const ordered: LogFileInfo[] = [];
|
|
169
|
+
const preferred = files.find((file) => file.date === preferredDate);
|
|
170
|
+
if (preferred) {
|
|
171
|
+
ordered.push(preferred);
|
|
172
|
+
}
|
|
173
|
+
for (const file of files) {
|
|
174
|
+
if (preferred && file.date === preferred.date) {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
ordered.push(file);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
for (const file of ordered) {
|
|
181
|
+
const lines = await readLogFileLines(file.path);
|
|
182
|
+
if (lines.length > 0) {
|
|
183
|
+
return { date: file.date, lines };
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const fallback = files[0];
|
|
188
|
+
if (!fallback) {
|
|
189
|
+
return { date: preferredDate, lines: [] };
|
|
190
|
+
}
|
|
191
|
+
const fallbackDate = preferred?.date ?? fallback.date;
|
|
192
|
+
return { date: fallbackDate, lines: [] };
|
|
193
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { renderSolidApp } from "../cli/ui/index.solid.js";
|
|
@@ -66,4 +66,12 @@ export class WorktreeRepository {
|
|
|
66
66
|
async prune(): Promise<void> {
|
|
67
67
|
await this.execute(["prune"]);
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
async repair(worktreePaths?: string[]): Promise<void> {
|
|
71
|
+
const args = ["repair"];
|
|
72
|
+
if (worktreePaths && worktreePaths.length > 0) {
|
|
73
|
+
args.push(...worktreePaths);
|
|
74
|
+
}
|
|
75
|
+
await this.execute(args);
|
|
76
|
+
}
|
|
69
77
|
}
|