@akiojin/gwt 4.8.0 → 4.9.1
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 +58 -34
- package/README.md +19 -35
- package/dist/cli/ui/components/App.d.ts +2 -2
- package/dist/cli/ui/components/App.d.ts.map +1 -1
- package/dist/cli/ui/components/App.js +8 -8
- package/dist/cli/ui/components/App.js.map +1 -1
- package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/BranchListScreen.js +3 -1
- package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.d.ts +27 -0
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.d.ts.map +1 -0
- package/dist/cli/ui/components/screens/{AIToolSelectorScreen.js → CodingAgentSelectorScreen.js} +35 -35
- package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.js.map +1 -0
- package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts +2 -2
- package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts.map +1 -1
- package/dist/cli/ui/components/screens/ModelSelectorScreen.js.map +1 -1
- package/dist/cli/ui/types.d.ts +2 -2
- package/dist/cli/ui/types.d.ts.map +1 -1
- package/dist/cli/ui/utils/modelOptions.d.ts +4 -4
- package/dist/cli/ui/utils/modelOptions.d.ts.map +1 -1
- package/dist/cli/ui/utils/modelOptions.js.map +1 -1
- package/dist/client/assets/{index-PqK9jkug.js → index-LNPtOrn3.js} +17 -17
- package/dist/client/index.html +1 -1
- package/dist/config/builtin-coding-agents.d.ts +23 -0
- package/dist/config/builtin-coding-agents.d.ts.map +1 -0
- package/dist/config/{builtin-tools.js → builtin-coding-agents.js} +6 -6
- package/dist/config/builtin-coding-agents.js.map +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +3 -7
- package/dist/config/index.js.map +1 -1
- package/dist/config/profiles.d.ts +2 -2
- package/dist/config/profiles.d.ts.map +1 -1
- package/dist/config/profiles.js +4 -7
- package/dist/config/profiles.js.map +1 -1
- package/dist/config/tools.d.ts +17 -17
- package/dist/config/tools.d.ts.map +1 -1
- package/dist/config/tools.js +84 -121
- package/dist/config/tools.js.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts +8 -8
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +32 -28
- package/dist/launcher.js.map +1 -1
- package/dist/services/codingAgentCommandResolver.d.ts +10 -0
- package/dist/services/codingAgentCommandResolver.d.ts.map +1 -0
- package/dist/services/{customToolResolver.js → codingAgentCommandResolver.js} +25 -20
- package/dist/services/codingAgentCommandResolver.js.map +1 -0
- package/dist/services/{aiToolResolver.d.ts → codingAgentResolver.d.ts} +6 -6
- package/dist/services/codingAgentResolver.d.ts.map +1 -0
- package/dist/services/{aiToolResolver.js → codingAgentResolver.js} +23 -23
- package/dist/services/codingAgentResolver.js.map +1 -0
- package/dist/shared/{aiToolConstants.d.ts → codingAgentConstants.d.ts} +2 -2
- package/dist/shared/codingAgentConstants.d.ts.map +1 -0
- package/dist/shared/{aiToolConstants.js → codingAgentConstants.js} +2 -2
- package/dist/shared/codingAgentConstants.js.map +1 -0
- package/dist/types/api.d.ts +12 -12
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/tools.d.ts +30 -30
- package/dist/types/tools.d.ts.map +1 -1
- package/dist/types/tools.js +1 -1
- package/dist/utils/command.d.ts +11 -0
- package/dist/utils/command.d.ts.map +1 -1
- package/dist/utils/command.js +33 -0
- package/dist/utils/command.js.map +1 -1
- package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts +9 -0
- package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts.map +1 -0
- package/dist/web/client/src/components/{AIToolLaunchModal.js → CodingAgentLaunchModal.js} +58 -58
- package/dist/web/client/src/components/CodingAgentLaunchModal.js.map +1 -0
- package/dist/web/client/src/components/CustomCodingAgentForm.d.ts +23 -0
- package/dist/web/client/src/components/CustomCodingAgentForm.d.ts.map +1 -0
- package/dist/web/client/src/components/{CustomToolForm.js → CustomCodingAgentForm.js} +5 -5
- package/dist/web/client/src/components/CustomCodingAgentForm.js.map +1 -0
- package/dist/web/client/src/components/CustomCodingAgentList.d.ts +10 -0
- package/dist/web/client/src/components/CustomCodingAgentList.d.ts.map +1 -0
- package/dist/web/client/src/components/{CustomToolList.js → CustomCodingAgentList.js} +17 -17
- package/dist/web/client/src/components/CustomCodingAgentList.js.map +1 -0
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts +2 -2
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts.map +1 -1
- package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js +6 -6
- 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/hooks/useSessions.d.ts +4 -4
- package/dist/web/client/src/hooks/useSessions.d.ts.map +1 -1
- package/dist/web/client/src/hooks/useSessions.js.map +1 -1
- package/dist/web/client/src/lib/api.d.ts +5 -5
- package/dist/web/client/src/lib/api.d.ts.map +1 -1
- package/dist/web/client/src/lib/api.js +1 -1
- package/dist/web/client/src/lib/api.js.map +1 -1
- package/dist/web/client/src/pages/BranchDetailPage.js +24 -24
- package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
- package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/ConfigManagementPage.js +15 -15
- package/dist/web/client/src/pages/ConfigManagementPage.js.map +1 -1
- package/dist/web/client/src/pages/ConfigPage.d.ts.map +1 -1
- package/dist/web/client/src/pages/ConfigPage.js +44 -40
- package/dist/web/client/src/pages/ConfigPage.js.map +1 -1
- package/dist/web/server/env/importer.d.ts.map +1 -1
- package/dist/web/server/env/importer.js +3 -3
- package/dist/web/server/env/importer.js.map +1 -1
- package/dist/web/server/pty/manager.d.ts +6 -6
- package/dist/web/server/pty/manager.d.ts.map +1 -1
- package/dist/web/server/pty/manager.js +11 -11
- package/dist/web/server/pty/manager.js.map +1 -1
- package/dist/web/server/routes/config.d.ts.map +1 -1
- package/dist/web/server/routes/config.js +34 -34
- package/dist/web/server/routes/config.js.map +1 -1
- package/dist/web/server/routes/sessions.d.ts +1 -1
- package/dist/web/server/routes/sessions.d.ts.map +1 -1
- package/dist/web/server/routes/sessions.js +20 -20
- package/dist/web/server/routes/sessions.js.map +1 -1
- package/package.json +2 -2
- package/src/cli/ui/__tests__/components/screens/{AIToolSelectorScreen.test.tsx → CodingAgentSelectorScreen.test.tsx} +38 -38
- package/src/cli/ui/components/App.tsx +22 -20
- package/src/cli/ui/components/screens/BranchListScreen.tsx +4 -2
- package/src/cli/ui/components/screens/CodingAgentSelectorScreen.tsx +159 -0
- package/src/cli/ui/components/screens/ModelSelectorScreen.tsx +6 -2
- package/src/cli/ui/types.ts +2 -2
- package/src/cli/ui/utils/modelOptions.ts +6 -4
- package/src/config/{builtin-tools.ts → builtin-coding-agents.ts} +9 -9
- package/src/config/index.ts +3 -7
- package/src/config/profiles.ts +4 -7
- package/src/config/tools.ts +107 -148
- package/src/index.ts +19 -19
- package/src/launcher.ts +38 -31
- package/src/services/{customToolResolver.ts → codingAgentCommandResolver.ts} +33 -28
- package/src/services/{aiToolResolver.ts → codingAgentResolver.ts} +28 -28
- package/src/shared/{aiToolConstants.ts → codingAgentConstants.ts} +1 -1
- package/src/types/api.ts +12 -12
- package/src/types/tools.ts +30 -30
- package/src/utils/command.ts +37 -0
- package/src/web/client/src/components/{AIToolLaunchModal.tsx → CodingAgentLaunchModal.tsx} +74 -70
- package/src/web/client/src/components/{CustomToolForm.tsx → CustomCodingAgentForm.tsx} +14 -14
- package/src/web/client/src/components/{CustomToolList.tsx → CustomCodingAgentList.tsx} +26 -26
- package/src/web/client/src/components/branch-detail/SessionHistoryTable.tsx +7 -7
- package/src/web/client/src/components/branch-detail/ToolLauncher.tsx +9 -9
- package/src/web/client/src/hooks/useSessions.ts +5 -5
- package/src/web/client/src/lib/api.ts +8 -8
- package/src/web/client/src/pages/BranchDetailPage.tsx +26 -26
- package/src/web/client/src/pages/ConfigManagementPage.tsx +32 -24
- package/src/web/client/src/pages/ConfigPage.tsx +57 -51
- package/src/web/server/env/importer.ts +6 -3
- package/src/web/server/pty/manager.ts +20 -20
- package/src/web/server/routes/config.ts +45 -39
- package/src/web/server/routes/sessions.ts +29 -26
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts +0 -27
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts.map +0 -1
- package/dist/cli/ui/components/screens/AIToolSelectorScreen.js.map +0 -1
- package/dist/config/builtin-tools.d.ts +0 -23
- package/dist/config/builtin-tools.d.ts.map +0 -1
- package/dist/config/builtin-tools.js.map +0 -1
- package/dist/services/aiToolResolver.d.ts.map +0 -1
- package/dist/services/aiToolResolver.js.map +0 -1
- package/dist/services/customToolResolver.d.ts +0 -10
- package/dist/services/customToolResolver.d.ts.map +0 -1
- package/dist/services/customToolResolver.js.map +0 -1
- package/dist/shared/aiToolConstants.d.ts.map +0 -1
- package/dist/shared/aiToolConstants.js.map +0 -1
- package/dist/web/client/src/components/AIToolLaunchModal.d.ts +0 -9
- package/dist/web/client/src/components/AIToolLaunchModal.d.ts.map +0 -1
- package/dist/web/client/src/components/AIToolLaunchModal.js.map +0 -1
- package/dist/web/client/src/components/CustomToolForm.d.ts +0 -23
- package/dist/web/client/src/components/CustomToolForm.d.ts.map +0 -1
- package/dist/web/client/src/components/CustomToolForm.js.map +0 -1
- package/dist/web/client/src/components/CustomToolList.d.ts +0 -10
- package/dist/web/client/src/components/CustomToolList.d.ts.map +0 -1
- package/dist/web/client/src/components/CustomToolList.js.map +0 -1
- package/src/cli/ui/components/screens/AIToolSelectorScreen.tsx +0 -153
- package/src/index.ts.backup +0 -1543
|
@@ -640,7 +640,7 @@ export const BranchListScreen = React.memo(function BranchListScreen({
|
|
|
640
640
|
)}
|
|
641
641
|
</Box>
|
|
642
642
|
|
|
643
|
-
{/* Tool Status - FR-019, FR-021 */}
|
|
643
|
+
{/* Tool Status - FR-019, FR-021, FR-022 */}
|
|
644
644
|
{toolStatuses && toolStatuses.length > 0 && (
|
|
645
645
|
<Box>
|
|
646
646
|
<Text dimColor>Tools: </Text>
|
|
@@ -648,7 +648,9 @@ export const BranchListScreen = React.memo(function BranchListScreen({
|
|
|
648
648
|
<React.Fragment key={tool.id}>
|
|
649
649
|
<Text>{tool.name}: </Text>
|
|
650
650
|
<Text color={tool.status === "installed" ? "green" : "yellow"}>
|
|
651
|
-
{tool.status
|
|
651
|
+
{tool.status === "installed" && tool.version
|
|
652
|
+
? tool.version
|
|
653
|
+
: tool.status}
|
|
652
654
|
</Text>
|
|
653
655
|
{index < toolStatuses.length - 1 && <Text dimColor> | </Text>}
|
|
654
656
|
</React.Fragment>
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React, { useState, useEffect } from "react";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { Header } from "../parts/Header.js";
|
|
4
|
+
import { Footer } from "../parts/Footer.js";
|
|
5
|
+
import { Select } from "../common/Select.js";
|
|
6
|
+
import { useAppInput } from "../../hooks/useAppInput.js";
|
|
7
|
+
import { useTerminalSize } from "../../hooks/useTerminalSize.js";
|
|
8
|
+
import { getAllCodingAgents } from "../../../../config/tools.js";
|
|
9
|
+
import type { CodingAgentConfig } from "../../../../types/tools.js";
|
|
10
|
+
import type { CodingAgentId } from "../../types.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Renderable item for the coding agent selector list.
|
|
14
|
+
*/
|
|
15
|
+
export interface CodingAgentItem {
|
|
16
|
+
label: string;
|
|
17
|
+
value: CodingAgentId;
|
|
18
|
+
description: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Props for `CodingAgentSelectorScreen`.
|
|
23
|
+
*/
|
|
24
|
+
export interface CodingAgentSelectorScreenProps {
|
|
25
|
+
onBack: () => void;
|
|
26
|
+
onSelect: (agentId: CodingAgentId) => void;
|
|
27
|
+
version?: string | null;
|
|
28
|
+
initialAgentId?: CodingAgentId | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* CodingAgentSelectorScreen - Screen for selecting coding agent (Claude Code, Codex CLI, or custom agents)
|
|
33
|
+
* Layout: Header + Agent Selection + Footer
|
|
34
|
+
*
|
|
35
|
+
* This screen dynamically loads available agents from the configuration (builtin + custom).
|
|
36
|
+
*/
|
|
37
|
+
export function CodingAgentSelectorScreen({
|
|
38
|
+
onBack,
|
|
39
|
+
onSelect,
|
|
40
|
+
version,
|
|
41
|
+
initialAgentId,
|
|
42
|
+
}: CodingAgentSelectorScreenProps) {
|
|
43
|
+
const { rows } = useTerminalSize();
|
|
44
|
+
const [agentItems, setAgentItems] = useState<CodingAgentItem[]>([]);
|
|
45
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
46
|
+
const [selectedIndex, setSelectedIndex] = useState<number>(0);
|
|
47
|
+
|
|
48
|
+
// Load agents from getAllCodingAgents()
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const loadAgents = async () => {
|
|
51
|
+
try {
|
|
52
|
+
const agents = await getAllCodingAgents();
|
|
53
|
+
|
|
54
|
+
// Convert CodingAgentConfig[] to CodingAgentItem[]
|
|
55
|
+
const items: CodingAgentItem[] = agents.map(
|
|
56
|
+
(agent: CodingAgentConfig) => {
|
|
57
|
+
// Generate description based on whether it's builtin or custom
|
|
58
|
+
const description = agent.isBuiltin
|
|
59
|
+
? `Official ${agent.displayName} agent`
|
|
60
|
+
: `Custom coding agent`;
|
|
61
|
+
|
|
62
|
+
// Add icon to label if present
|
|
63
|
+
const label = agent.icon
|
|
64
|
+
? `${agent.icon} ${agent.displayName}`
|
|
65
|
+
: agent.displayName;
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
label,
|
|
69
|
+
value: agent.id,
|
|
70
|
+
description,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
setAgentItems(items);
|
|
76
|
+
|
|
77
|
+
// Decide initial cursor position based on last used agent
|
|
78
|
+
const idx =
|
|
79
|
+
initialAgentId && items.length > 0
|
|
80
|
+
? items.findIndex((item) => item.value === initialAgentId)
|
|
81
|
+
: 0;
|
|
82
|
+
setSelectedIndex(idx >= 0 ? idx : 0);
|
|
83
|
+
} catch (error) {
|
|
84
|
+
// If loading fails, show error in console but don't crash
|
|
85
|
+
console.error("Failed to load coding agents:", error);
|
|
86
|
+
// Fall back to empty array
|
|
87
|
+
setAgentItems([]);
|
|
88
|
+
} finally {
|
|
89
|
+
setIsLoading(false);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
loadAgents();
|
|
94
|
+
}, [initialAgentId]);
|
|
95
|
+
|
|
96
|
+
// Update selection when props or items change
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (isLoading || agentItems.length === 0) return;
|
|
99
|
+
const idx =
|
|
100
|
+
initialAgentId && agentItems.length > 0
|
|
101
|
+
? agentItems.findIndex((item) => item.value === initialAgentId)
|
|
102
|
+
: 0;
|
|
103
|
+
setSelectedIndex(idx >= 0 ? idx : 0);
|
|
104
|
+
}, [initialAgentId, agentItems, isLoading]);
|
|
105
|
+
|
|
106
|
+
// Handle keyboard input
|
|
107
|
+
// Note: Select component handles Enter and arrow keys
|
|
108
|
+
useAppInput((input, key) => {
|
|
109
|
+
if (key.escape) {
|
|
110
|
+
onBack();
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// Handle agent selection
|
|
115
|
+
const handleSelect = (item: CodingAgentItem) => {
|
|
116
|
+
onSelect(item.value);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Footer actions
|
|
120
|
+
const footerActions = [
|
|
121
|
+
{ key: "enter", description: "Select" },
|
|
122
|
+
{ key: "esc", description: "Back" },
|
|
123
|
+
];
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<Box flexDirection="column" height={rows}>
|
|
127
|
+
{/* Header */}
|
|
128
|
+
<Header
|
|
129
|
+
title="Coding Agent Selection"
|
|
130
|
+
titleColor="blue"
|
|
131
|
+
version={version}
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
{/* Content */}
|
|
135
|
+
<Box flexDirection="column" flexGrow={1} marginTop={1}>
|
|
136
|
+
<Box marginBottom={1}>
|
|
137
|
+
<Text>Select coding agent to use:</Text>
|
|
138
|
+
</Box>
|
|
139
|
+
{isLoading ? (
|
|
140
|
+
<Text>Loading coding agents...</Text>
|
|
141
|
+
) : agentItems.length === 0 ? (
|
|
142
|
+
<Text color="yellow">
|
|
143
|
+
No coding agents available. Please check your configuration.
|
|
144
|
+
</Text>
|
|
145
|
+
) : (
|
|
146
|
+
<Select
|
|
147
|
+
items={agentItems}
|
|
148
|
+
onSelect={handleSelect}
|
|
149
|
+
selectedIndex={selectedIndex}
|
|
150
|
+
onSelectedIndexChange={setSelectedIndex}
|
|
151
|
+
/>
|
|
152
|
+
)}
|
|
153
|
+
</Box>
|
|
154
|
+
|
|
155
|
+
{/* Footer */}
|
|
156
|
+
<Footer actions={footerActions} />
|
|
157
|
+
</Box>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
@@ -5,7 +5,11 @@ import { Footer } from "../parts/Footer.js";
|
|
|
5
5
|
import { Select, type SelectItem } from "../common/Select.js";
|
|
6
6
|
import { useAppInput } from "../../hooks/useAppInput.js";
|
|
7
7
|
import { useTerminalSize } from "../../hooks/useTerminalSize.js";
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
CodingAgentId,
|
|
10
|
+
InferenceLevel,
|
|
11
|
+
ModelOption,
|
|
12
|
+
} from "../../types.js";
|
|
9
13
|
import {
|
|
10
14
|
getDefaultInferenceForModel,
|
|
11
15
|
getDefaultModelOption,
|
|
@@ -33,7 +37,7 @@ interface InferenceSelectItem extends SelectItem {
|
|
|
33
37
|
* Props for `ModelSelectorScreen`.
|
|
34
38
|
*/
|
|
35
39
|
export interface ModelSelectorScreenProps {
|
|
36
|
-
tool:
|
|
40
|
+
tool: CodingAgentId;
|
|
37
41
|
onBack: () => void;
|
|
38
42
|
onSelect: (selection: ModelSelectionResult) => void;
|
|
39
43
|
version?: string | null;
|
package/src/cli/ui/types.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface WorktreeInfo {
|
|
|
9
9
|
hasUncommittedChanges?: boolean;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export type
|
|
12
|
+
export type CodingAgentId = string;
|
|
13
13
|
export type InferenceLevel = "low" | "medium" | "high" | "xhigh";
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -194,7 +194,7 @@ export type ScreenType =
|
|
|
194
194
|
| "branch-creator"
|
|
195
195
|
| "branch-action-selector"
|
|
196
196
|
| "branch-quick-start"
|
|
197
|
-
| "
|
|
197
|
+
| "coding-agent-selector"
|
|
198
198
|
| "model-selector"
|
|
199
199
|
| "session-selector"
|
|
200
200
|
| "execution-mode-selector"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CodingAgentId, InferenceLevel, ModelOption } from "../types.js";
|
|
2
2
|
|
|
3
3
|
const CODEX_BASE_LEVELS: InferenceLevel[] = ["high", "medium", "low"];
|
|
4
4
|
const CODEX_MAX_LEVELS: InferenceLevel[] = ["xhigh", "high", "medium", "low"];
|
|
@@ -105,11 +105,13 @@ const MODEL_OPTIONS: Record<string, ModelOption[]> = {
|
|
|
105
105
|
],
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
-
export function getModelOptions(tool:
|
|
108
|
+
export function getModelOptions(tool: CodingAgentId): ModelOption[] {
|
|
109
109
|
return MODEL_OPTIONS[tool] ?? [];
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export function getDefaultModelOption(
|
|
112
|
+
export function getDefaultModelOption(
|
|
113
|
+
tool: CodingAgentId,
|
|
114
|
+
): ModelOption | undefined {
|
|
113
115
|
const options = getModelOptions(tool);
|
|
114
116
|
return options.find((opt) => opt.isDefault) ?? options[0];
|
|
115
117
|
}
|
|
@@ -136,7 +138,7 @@ export function getDefaultInferenceForModel(
|
|
|
136
138
|
* Normalize a model identifier for consistent display and persistence.
|
|
137
139
|
*/
|
|
138
140
|
export function normalizeModelId(
|
|
139
|
-
tool:
|
|
141
|
+
tool: CodingAgentId,
|
|
140
142
|
model?: string | null,
|
|
141
143
|
): string | null {
|
|
142
144
|
if (model === null || model === undefined) return model ?? null;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* ビルトインコーディングエージェント定義
|
|
3
3
|
*
|
|
4
|
-
* Claude Code、Codex、Gemini の
|
|
4
|
+
* Claude Code、Codex、Gemini の CodingAgent 形式定義
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type { CodingAgent } from "../types/tools.js";
|
|
8
8
|
import {
|
|
9
9
|
CLAUDE_PERMISSION_SKIP_ARGS,
|
|
10
10
|
CODEX_DEFAULT_ARGS,
|
|
11
|
-
} from "../shared/
|
|
11
|
+
} from "../shared/codingAgentConstants.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Claude Code のビルトイン定義
|
|
15
15
|
*/
|
|
16
|
-
export const CLAUDE_CODE_TOOL:
|
|
16
|
+
export const CLAUDE_CODE_TOOL: CodingAgent = {
|
|
17
17
|
id: "claude-code",
|
|
18
18
|
displayName: "Claude Code",
|
|
19
19
|
type: "bunx",
|
|
@@ -32,7 +32,7 @@ export const CLAUDE_CODE_TOOL: CustomAITool = {
|
|
|
32
32
|
/**
|
|
33
33
|
* Codex のビルトイン定義
|
|
34
34
|
*/
|
|
35
|
-
export const CODEX_CLI_TOOL:
|
|
35
|
+
export const CODEX_CLI_TOOL: CodingAgent = {
|
|
36
36
|
id: "codex-cli",
|
|
37
37
|
displayName: "Codex",
|
|
38
38
|
type: "bunx",
|
|
@@ -48,7 +48,7 @@ export const CODEX_CLI_TOOL: CustomAITool = {
|
|
|
48
48
|
/**
|
|
49
49
|
* Gemini のビルトイン定義
|
|
50
50
|
*/
|
|
51
|
-
export const GEMINI_CLI_TOOL:
|
|
51
|
+
export const GEMINI_CLI_TOOL: CodingAgent = {
|
|
52
52
|
id: "gemini-cli",
|
|
53
53
|
displayName: "Gemini",
|
|
54
54
|
type: "bunx",
|
|
@@ -62,9 +62,9 @@ export const GEMINI_CLI_TOOL: CustomAITool = {
|
|
|
62
62
|
};
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* すべてのビルトインコーディングエージェント
|
|
66
66
|
*/
|
|
67
|
-
export const
|
|
67
|
+
export const BUILTIN_CODING_AGENTS: CodingAgent[] = [
|
|
68
68
|
CLAUDE_CODE_TOOL,
|
|
69
69
|
CODEX_CLI_TOOL,
|
|
70
70
|
GEMINI_CLI_TOOL,
|
package/src/config/index.ts
CHANGED
|
@@ -52,11 +52,8 @@ const DEFAULT_CONFIG: AppConfig = {
|
|
|
52
52
|
export async function loadConfig(): Promise<AppConfig> {
|
|
53
53
|
const configPaths = [
|
|
54
54
|
path.join(process.cwd(), ".gwt.json"),
|
|
55
|
-
path.join(process.cwd(), ".claude-worktree.json"), // 後方互換性
|
|
56
55
|
path.join(homedir(), ".config", "gwt", "config.json"),
|
|
57
|
-
path.join(homedir(), ".config", "claude-worktree", "config.json"), // 後方互換性
|
|
58
56
|
path.join(homedir(), ".gwt.json"),
|
|
59
|
-
path.join(homedir(), ".claude-worktree.json"), // 後方互換性
|
|
60
57
|
];
|
|
61
58
|
|
|
62
59
|
for (const configPath of configPaths) {
|
|
@@ -79,10 +76,9 @@ export async function loadConfig(): Promise<AppConfig> {
|
|
|
79
76
|
return {
|
|
80
77
|
...DEFAULT_CONFIG,
|
|
81
78
|
defaultBaseBranch:
|
|
82
|
-
process.env.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
enableGitHubIntegration: process.env.CLAUDE_WORKTREE_GITHUB !== "false",
|
|
79
|
+
process.env.GWT_BASE_BRANCH || DEFAULT_CONFIG.defaultBaseBranch,
|
|
80
|
+
skipPermissions: process.env.GWT_SKIP_PERMISSIONS === "true",
|
|
81
|
+
enableGitHubIntegration: process.env.GWT_GITHUB !== "false",
|
|
86
82
|
enableDebugMode:
|
|
87
83
|
process.env.DEBUG_CLEANUP === "true" || process.env.DEBUG === "true",
|
|
88
84
|
};
|
package/src/config/profiles.ts
CHANGED
|
@@ -29,16 +29,13 @@ import {
|
|
|
29
29
|
/**
|
|
30
30
|
* 設定ディレクトリのパスを取得
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* 環境変数 GWT_HOME が設定されている場合はそれを使用、それ以外はホームディレクトリ
|
|
33
33
|
*/
|
|
34
34
|
function getConfigDir(): string {
|
|
35
35
|
const worktreeHome =
|
|
36
36
|
process.env.GWT_HOME && process.env.GWT_HOME.trim().length > 0
|
|
37
37
|
? process.env.GWT_HOME
|
|
38
|
-
:
|
|
39
|
-
process.env.CLAUDE_WORKTREE_HOME.trim().length > 0
|
|
40
|
-
? process.env.CLAUDE_WORKTREE_HOME
|
|
41
|
-
: homedir();
|
|
38
|
+
: homedir();
|
|
42
39
|
return path.join(worktreeHome, ".gwt");
|
|
43
40
|
}
|
|
44
41
|
|
|
@@ -133,11 +130,11 @@ async function mutateProfiles(
|
|
|
133
130
|
}
|
|
134
131
|
|
|
135
132
|
/**
|
|
136
|
-
*
|
|
133
|
+
* プロファイル設定ファイルのパス
|
|
137
134
|
*
|
|
138
135
|
* @deprecated 内部では getProfilesConfigPath() を使用してください。
|
|
139
136
|
* この定数はモジュールロード時に評価されるため、
|
|
140
|
-
* 実行中に環境変数(GWT_HOME
|
|
137
|
+
* 実行中に環境変数(GWT_HOME)を変更しても反映されません。
|
|
141
138
|
*/
|
|
142
139
|
export const PROFILES_CONFIG_PATH = getProfilesConfigPath();
|
|
143
140
|
|