@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
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
SelectTrigger,
|
|
12
12
|
SelectValue,
|
|
13
13
|
} from "@/components/ui/select";
|
|
14
|
-
import type { Branch,
|
|
14
|
+
import type { Branch, ApiCodingAgent } from "../../../../types/api.js";
|
|
15
15
|
import {
|
|
16
16
|
CLAUDE_PERMISSION_SKIP_ARGS,
|
|
17
17
|
CODEX_DEFAULT_ARGS,
|
|
18
|
-
} from "../../../../shared/
|
|
18
|
+
} from "../../../../shared/codingAgentConstants.js";
|
|
19
19
|
import { useConfig } from "../hooks/useConfig";
|
|
20
20
|
import { useStartSession } from "../hooks/useSessions";
|
|
21
21
|
import { useCreateWorktree } from "../hooks/useWorktrees";
|
|
22
22
|
import { useSyncBranch } from "../hooks/useBranches";
|
|
23
23
|
import { ApiError } from "../lib/api";
|
|
24
24
|
|
|
25
|
-
const
|
|
25
|
+
const BUILTIN_AGENT_SUMMARIES: Record<string, AgentSummary> = {
|
|
26
26
|
"claude-code": {
|
|
27
27
|
command: "claude",
|
|
28
28
|
defaultArgs: [],
|
|
@@ -44,7 +44,7 @@ const BUILTIN_TOOL_SUMMARIES: Record<string, ToolSummary> = {
|
|
|
44
44
|
},
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
interface
|
|
47
|
+
interface AgentSummary {
|
|
48
48
|
command: string;
|
|
49
49
|
defaultArgs?: string[] | null;
|
|
50
50
|
modeArgs?: {
|
|
@@ -55,19 +55,22 @@ interface ToolSummary {
|
|
|
55
55
|
permissionSkipArgs?: string[] | null;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
interface
|
|
58
|
+
interface CodingAgentLaunchModalProps {
|
|
59
59
|
branch: Branch;
|
|
60
60
|
onClose: () => void;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
type
|
|
63
|
+
type AgentMode = "normal" | "continue" | "resume";
|
|
64
64
|
|
|
65
|
-
type
|
|
65
|
+
type SelectableAgent =
|
|
66
66
|
| { id: "claude-code"; label: string; target: "claude" }
|
|
67
67
|
| { id: "codex-cli"; label: string; target: "codex" }
|
|
68
|
-
| { id: string; label: string; target: "custom"; definition:
|
|
68
|
+
| { id: string; label: string; target: "custom"; definition: ApiCodingAgent };
|
|
69
69
|
|
|
70
|
-
export function
|
|
70
|
+
export function CodingAgentLaunchModal({
|
|
71
|
+
branch,
|
|
72
|
+
onClose,
|
|
73
|
+
}: CodingAgentLaunchModalProps) {
|
|
71
74
|
const {
|
|
72
75
|
data: config,
|
|
73
76
|
isLoading: isConfigLoading,
|
|
@@ -78,8 +81,8 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
78
81
|
const syncBranch = useSyncBranch(branch.name);
|
|
79
82
|
const navigate = useNavigate();
|
|
80
83
|
|
|
81
|
-
const [
|
|
82
|
-
const [selectedMode, setSelectedMode] = useState<
|
|
84
|
+
const [selectedAgentId, setSelectedAgentId] = useState<string>("claude-code");
|
|
85
|
+
const [selectedMode, setSelectedMode] = useState<AgentMode>("normal");
|
|
83
86
|
const [skipPermissions, setSkipPermissions] = useState(false);
|
|
84
87
|
const [extraArgsText, setExtraArgsText] = useState("");
|
|
85
88
|
const [banner, setBanner] = useState<{
|
|
@@ -89,74 +92,74 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
89
92
|
const [isStartingSession, setIsStartingSession] = useState(false);
|
|
90
93
|
const [isCreatingWorktree, setIsCreatingWorktree] = useState(false);
|
|
91
94
|
|
|
92
|
-
const
|
|
93
|
-
const
|
|
95
|
+
const customAgents = config?.codingAgents ?? [];
|
|
96
|
+
const availableAgents: SelectableAgent[] = useMemo(
|
|
94
97
|
() => [
|
|
95
98
|
{ id: "claude-code", label: "Claude Code", target: "claude" },
|
|
96
99
|
{ id: "codex-cli", label: "Codex CLI", target: "codex" },
|
|
97
|
-
...
|
|
98
|
-
id:
|
|
99
|
-
label:
|
|
100
|
+
...customAgents.map((agent) => ({
|
|
101
|
+
id: agent.id,
|
|
102
|
+
label: agent.displayName,
|
|
100
103
|
target: "custom" as const,
|
|
101
|
-
definition:
|
|
104
|
+
definition: agent,
|
|
102
105
|
})),
|
|
103
106
|
],
|
|
104
|
-
[
|
|
107
|
+
[customAgents],
|
|
105
108
|
);
|
|
106
109
|
|
|
107
110
|
useEffect(() => {
|
|
108
|
-
if (!
|
|
109
|
-
|
|
111
|
+
if (!availableAgents.length) {
|
|
112
|
+
setSelectedAgentId("claude-code");
|
|
110
113
|
return;
|
|
111
114
|
}
|
|
112
|
-
if (!
|
|
113
|
-
const first =
|
|
115
|
+
if (!availableAgents.find((agent) => agent.id === selectedAgentId)) {
|
|
116
|
+
const first = availableAgents[0];
|
|
114
117
|
if (first) {
|
|
115
|
-
|
|
118
|
+
setSelectedAgentId(first.id);
|
|
116
119
|
}
|
|
117
120
|
}
|
|
118
|
-
}, [
|
|
121
|
+
}, [availableAgents, selectedAgentId]);
|
|
119
122
|
|
|
120
|
-
const
|
|
121
|
-
(
|
|
123
|
+
const selectedAgent = availableAgents.find(
|
|
124
|
+
(agent) => agent.id === selectedAgentId,
|
|
122
125
|
);
|
|
123
126
|
|
|
124
|
-
const
|
|
125
|
-
if (!
|
|
127
|
+
const selectedAgentSummary: AgentSummary | null = useMemo(() => {
|
|
128
|
+
if (!selectedAgent) {
|
|
126
129
|
return null;
|
|
127
130
|
}
|
|
128
|
-
if (
|
|
131
|
+
if (selectedAgent.target === "custom") {
|
|
129
132
|
return {
|
|
130
|
-
command:
|
|
131
|
-
defaultArgs:
|
|
132
|
-
modeArgs:
|
|
133
|
-
permissionSkipArgs:
|
|
133
|
+
command: selectedAgent.definition.command,
|
|
134
|
+
defaultArgs: selectedAgent.definition.defaultArgs ?? null,
|
|
135
|
+
modeArgs: selectedAgent.definition.modeArgs,
|
|
136
|
+
permissionSkipArgs: selectedAgent.definition.permissionSkipArgs ?? null,
|
|
134
137
|
};
|
|
135
138
|
}
|
|
136
|
-
return
|
|
137
|
-
}, [
|
|
139
|
+
return BUILTIN_AGENT_SUMMARIES[selectedAgent.id] ?? null;
|
|
140
|
+
}, [selectedAgent]);
|
|
138
141
|
|
|
139
142
|
const argsPreview = useMemo(() => {
|
|
140
|
-
if (!
|
|
143
|
+
if (!selectedAgentSummary) {
|
|
141
144
|
return null;
|
|
142
145
|
}
|
|
143
146
|
const args: string[] = [];
|
|
144
|
-
if (
|
|
145
|
-
args.push(...
|
|
147
|
+
if (selectedAgentSummary.defaultArgs?.length) {
|
|
148
|
+
args.push(...selectedAgentSummary.defaultArgs);
|
|
146
149
|
}
|
|
147
|
-
const mode =
|
|
150
|
+
const mode = selectedAgentSummary.modeArgs?.[selectedMode];
|
|
148
151
|
if (mode?.length) {
|
|
149
152
|
args.push(...mode);
|
|
150
153
|
}
|
|
151
|
-
if (skipPermissions &&
|
|
152
|
-
args.push(...
|
|
154
|
+
if (skipPermissions && selectedAgentSummary.permissionSkipArgs?.length) {
|
|
155
|
+
args.push(...selectedAgentSummary.permissionSkipArgs);
|
|
153
156
|
}
|
|
154
157
|
const extraArgs = parseExtraArgs(extraArgsText);
|
|
155
158
|
if (extraArgs.length) {
|
|
156
159
|
args.push(...extraArgs);
|
|
157
160
|
}
|
|
158
|
-
return { command:
|
|
159
|
-
}, [
|
|
161
|
+
return { command: selectedAgentSummary.command, args };
|
|
162
|
+
}, [selectedAgentSummary, selectedMode, skipPermissions, extraArgsText]);
|
|
160
163
|
|
|
161
164
|
const PROTECTED_BRANCHES = ["main", "master", "develop"];
|
|
162
165
|
const isProtectedBranch = PROTECTED_BRANCHES.includes(
|
|
@@ -256,8 +259,8 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
256
259
|
});
|
|
257
260
|
return;
|
|
258
261
|
}
|
|
259
|
-
if (!
|
|
260
|
-
setBanner({ type: "error", message: "Select
|
|
262
|
+
if (!selectedAgent) {
|
|
263
|
+
setBanner({ type: "error", message: "Select a coding agent to launch." });
|
|
261
264
|
return;
|
|
262
265
|
}
|
|
263
266
|
if (needsRemoteSync) {
|
|
@@ -285,23 +288,23 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
285
288
|
|
|
286
289
|
setIsStartingSession(true);
|
|
287
290
|
try {
|
|
288
|
-
const
|
|
289
|
-
|
|
291
|
+
const agentType =
|
|
292
|
+
selectedAgent.target === "codex"
|
|
290
293
|
? "codex-cli"
|
|
291
|
-
:
|
|
294
|
+
: selectedAgent.target === "custom"
|
|
292
295
|
? "custom"
|
|
293
296
|
: "claude-code";
|
|
294
297
|
const extraArgs = parseExtraArgs(extraArgsText);
|
|
295
298
|
const sessionRequest = {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
...(
|
|
299
|
-
? {
|
|
299
|
+
agentType,
|
|
300
|
+
agentName: selectedAgent.target === "custom" ? selectedAgent.id : null,
|
|
301
|
+
...(selectedAgent.target === "custom"
|
|
302
|
+
? { customAgentId: selectedAgent.id }
|
|
300
303
|
: {}),
|
|
301
304
|
mode: selectedMode,
|
|
302
305
|
worktreePath: branch.worktreePath,
|
|
303
306
|
skipPermissions,
|
|
304
|
-
...(
|
|
307
|
+
...(selectedAgent.target === "codex"
|
|
305
308
|
? { bypassApprovals: skipPermissions }
|
|
306
309
|
: {}),
|
|
307
310
|
...(extraArgs.length ? { extraArgs } : {}),
|
|
@@ -333,7 +336,7 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
333
336
|
<div className="flex items-start justify-between gap-4">
|
|
334
337
|
<div>
|
|
335
338
|
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
336
|
-
Launch
|
|
339
|
+
Launch Coding Agent
|
|
337
340
|
</p>
|
|
338
341
|
<h2 className="mt-1 text-lg font-semibold">{branch.name}</h2>
|
|
339
342
|
</div>
|
|
@@ -379,7 +382,8 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
379
382
|
) : (
|
|
380
383
|
<>
|
|
381
384
|
<p>
|
|
382
|
-
Worktree is missing. Create it before launching
|
|
385
|
+
Worktree is missing. Create it before launching coding
|
|
386
|
+
agents.
|
|
383
387
|
</p>
|
|
384
388
|
<Button
|
|
385
389
|
variant="secondary"
|
|
@@ -415,19 +419,19 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
415
419
|
|
|
416
420
|
<div className="grid gap-4 sm:grid-cols-3">
|
|
417
421
|
<div className="space-y-2">
|
|
418
|
-
<label className="text-sm font-medium">
|
|
422
|
+
<label className="text-sm font-medium">Coding agent</label>
|
|
419
423
|
<Select
|
|
420
|
-
value={
|
|
421
|
-
onValueChange={
|
|
424
|
+
value={selectedAgentId}
|
|
425
|
+
onValueChange={setSelectedAgentId}
|
|
422
426
|
disabled={isConfigLoading ?? false}
|
|
423
427
|
>
|
|
424
428
|
<SelectTrigger>
|
|
425
429
|
<SelectValue />
|
|
426
430
|
</SelectTrigger>
|
|
427
431
|
<SelectContent>
|
|
428
|
-
{
|
|
429
|
-
<SelectItem key={
|
|
430
|
-
{
|
|
432
|
+
{availableAgents.map((agent) => (
|
|
433
|
+
<SelectItem key={agent.id} value={agent.id}>
|
|
434
|
+
{agent.label}
|
|
431
435
|
</SelectItem>
|
|
432
436
|
))}
|
|
433
437
|
</SelectContent>
|
|
@@ -438,7 +442,7 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
438
442
|
<label className="text-sm font-medium">Launch mode</label>
|
|
439
443
|
<Select
|
|
440
444
|
value={selectedMode}
|
|
441
|
-
onValueChange={(value) => setSelectedMode(value as
|
|
445
|
+
onValueChange={(value) => setSelectedMode(value as AgentMode)}
|
|
442
446
|
>
|
|
443
447
|
<SelectTrigger>
|
|
444
448
|
<SelectValue />
|
|
@@ -477,12 +481,12 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
477
481
|
onClick={handleStartSession}
|
|
478
482
|
disabled={
|
|
479
483
|
isStartingSession ||
|
|
480
|
-
!
|
|
484
|
+
!selectedAgent ||
|
|
481
485
|
hasBlockingDivergence ||
|
|
482
486
|
needsRemoteSync
|
|
483
487
|
}
|
|
484
488
|
>
|
|
485
|
-
{isStartingSession ? "Launching..." : "Launch
|
|
489
|
+
{isStartingSession ? "Launching..." : "Launch coding agent"}
|
|
486
490
|
</Button>
|
|
487
491
|
<Button
|
|
488
492
|
variant="secondary"
|
|
@@ -496,25 +500,25 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
496
500
|
</Button>
|
|
497
501
|
</div>
|
|
498
502
|
|
|
499
|
-
{
|
|
503
|
+
{selectedAgentSummary && (
|
|
500
504
|
<div className="space-y-2 rounded-lg border bg-muted/30 p-4 text-sm">
|
|
501
505
|
<div className="grid gap-2 sm:grid-cols-3">
|
|
502
506
|
<div>
|
|
503
507
|
<span className="text-muted-foreground">Command:</span>{" "}
|
|
504
508
|
<code className="rounded bg-muted px-1.5 py-0.5 font-mono">
|
|
505
|
-
{
|
|
509
|
+
{selectedAgentSummary.command}
|
|
506
510
|
</code>
|
|
507
511
|
</div>
|
|
508
512
|
<div>
|
|
509
513
|
<span className="text-muted-foreground">defaultArgs:</span>{" "}
|
|
510
514
|
<span
|
|
511
515
|
className={
|
|
512
|
-
!
|
|
516
|
+
!selectedAgentSummary.defaultArgs?.length
|
|
513
517
|
? "text-muted-foreground/50"
|
|
514
518
|
: ""
|
|
515
519
|
}
|
|
516
520
|
>
|
|
517
|
-
{renderArgs(
|
|
521
|
+
{renderArgs(selectedAgentSummary.defaultArgs)}
|
|
518
522
|
</span>
|
|
519
523
|
</div>
|
|
520
524
|
<div>
|
|
@@ -523,12 +527,12 @@ export function AIToolLaunchModal({ branch, onClose }: AIToolLaunchModalProps) {
|
|
|
523
527
|
</span>{" "}
|
|
524
528
|
<span
|
|
525
529
|
className={
|
|
526
|
-
!
|
|
530
|
+
!selectedAgentSummary.permissionSkipArgs?.length
|
|
527
531
|
? "text-muted-foreground/50"
|
|
528
532
|
: ""
|
|
529
533
|
}
|
|
530
534
|
>
|
|
531
|
-
{renderArgs(
|
|
535
|
+
{renderArgs(selectedAgentSummary.permissionSkipArgs)}
|
|
532
536
|
</span>
|
|
533
537
|
</div>
|
|
534
538
|
</div>
|
|
@@ -9,26 +9,26 @@ import {
|
|
|
9
9
|
SelectValue,
|
|
10
10
|
} from "@/components/ui/select";
|
|
11
11
|
import type {
|
|
12
|
-
|
|
12
|
+
ApiCodingAgent,
|
|
13
13
|
EnvironmentVariable,
|
|
14
14
|
} from "../../../../types/api.js";
|
|
15
15
|
|
|
16
|
-
export interface
|
|
16
|
+
export interface CustomCodingAgentFormValue {
|
|
17
17
|
id: string;
|
|
18
18
|
displayName: string;
|
|
19
19
|
icon?: string | null;
|
|
20
20
|
description?: string | null;
|
|
21
|
-
executionType:
|
|
21
|
+
executionType: ApiCodingAgent["executionType"];
|
|
22
22
|
command: string;
|
|
23
23
|
defaultArgs?: string[] | null;
|
|
24
|
-
modeArgs:
|
|
24
|
+
modeArgs: ApiCodingAgent["modeArgs"];
|
|
25
25
|
permissionSkipArgs?: string[] | null;
|
|
26
26
|
env?: EnvironmentVariable[] | null;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
interface
|
|
30
|
-
initialValue?:
|
|
31
|
-
onSubmit: (value:
|
|
29
|
+
interface CustomCodingAgentFormProps {
|
|
30
|
+
initialValue?: ApiCodingAgent;
|
|
31
|
+
onSubmit: (value: CustomCodingAgentFormValue) => void;
|
|
32
32
|
onCancel: () => void;
|
|
33
33
|
isSaving?: boolean;
|
|
34
34
|
}
|
|
@@ -40,18 +40,18 @@ interface FormErrors {
|
|
|
40
40
|
env?: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export function
|
|
43
|
+
export function CustomCodingAgentForm({
|
|
44
44
|
initialValue,
|
|
45
45
|
onSubmit,
|
|
46
46
|
onCancel,
|
|
47
47
|
isSaving,
|
|
48
|
-
}:
|
|
48
|
+
}: CustomCodingAgentFormProps) {
|
|
49
49
|
const [formState, setFormState] = useState(() =>
|
|
50
50
|
createInitialState(initialValue),
|
|
51
51
|
);
|
|
52
52
|
const [errors, setErrors] = useState<FormErrors>({});
|
|
53
53
|
|
|
54
|
-
const title = initialValue ? "
|
|
54
|
+
const title = initialValue ? "Coding Agent を編集" : "新規 Coding Agent";
|
|
55
55
|
|
|
56
56
|
const handleChange =
|
|
57
57
|
(field: keyof typeof formState) =>
|
|
@@ -120,7 +120,7 @@ export function CustomToolForm({
|
|
|
120
120
|
{title}
|
|
121
121
|
</p>
|
|
122
122
|
<h3 className="mt-1 text-lg font-semibold">
|
|
123
|
-
{formState.displayName || "
|
|
123
|
+
{formState.displayName || "Custom Coding Agent"}
|
|
124
124
|
</h3>
|
|
125
125
|
</div>
|
|
126
126
|
<div className="flex gap-2">
|
|
@@ -140,7 +140,7 @@ export function CustomToolForm({
|
|
|
140
140
|
|
|
141
141
|
<div className="grid gap-4 sm:grid-cols-2">
|
|
142
142
|
<div className="space-y-2">
|
|
143
|
-
<label className="text-sm font-medium"
|
|
143
|
+
<label className="text-sm font-medium">Agent ID *</label>
|
|
144
144
|
<Input
|
|
145
145
|
type="text"
|
|
146
146
|
value={formState.id}
|
|
@@ -286,14 +286,14 @@ export function CustomToolForm({
|
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
function createInitialState(initialValue?:
|
|
289
|
+
function createInitialState(initialValue?: ApiCodingAgent) {
|
|
290
290
|
if (!initialValue) {
|
|
291
291
|
return {
|
|
292
292
|
id: "",
|
|
293
293
|
displayName: "",
|
|
294
294
|
icon: "",
|
|
295
295
|
description: "",
|
|
296
|
-
executionType: "bunx" as
|
|
296
|
+
executionType: "bunx" as ApiCodingAgent["executionType"],
|
|
297
297
|
command: "",
|
|
298
298
|
defaultArgs: "",
|
|
299
299
|
modeNormal: "",
|
|
@@ -7,28 +7,28 @@ import {
|
|
|
7
7
|
} from "@/components/ui/card";
|
|
8
8
|
import { Button } from "@/components/ui/button";
|
|
9
9
|
import { Badge } from "@/components/ui/badge";
|
|
10
|
-
import type {
|
|
10
|
+
import type { ApiCodingAgent } from "../../../../types/api.js";
|
|
11
11
|
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
onEdit: (
|
|
15
|
-
onDelete: (
|
|
12
|
+
interface CustomCodingAgentListProps {
|
|
13
|
+
agents: ApiCodingAgent[];
|
|
14
|
+
onEdit: (agent: ApiCodingAgent) => void;
|
|
15
|
+
onDelete: (agent: ApiCodingAgent) => void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
export function
|
|
19
|
-
|
|
18
|
+
export function CustomCodingAgentList({
|
|
19
|
+
agents,
|
|
20
20
|
onEdit,
|
|
21
21
|
onDelete,
|
|
22
|
-
}:
|
|
23
|
-
if (!
|
|
22
|
+
}: CustomCodingAgentListProps) {
|
|
23
|
+
if (!agents.length) {
|
|
24
24
|
return (
|
|
25
25
|
<Card className="border-dashed">
|
|
26
26
|
<CardContent className="flex flex-col items-center justify-center py-12 text-center">
|
|
27
27
|
<h3 className="text-lg font-semibold">
|
|
28
|
-
|
|
28
|
+
Custom Coding Agent が登録されていません
|
|
29
29
|
</h3>
|
|
30
30
|
<p className="mt-2 text-sm text-muted-foreground">
|
|
31
|
-
|
|
31
|
+
「Coding Agent を追加」から最初のエージェントを登録してください。
|
|
32
32
|
</p>
|
|
33
33
|
</CardContent>
|
|
34
34
|
</Card>
|
|
@@ -37,59 +37,59 @@ export function CustomToolList({
|
|
|
37
37
|
|
|
38
38
|
return (
|
|
39
39
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
40
|
-
{
|
|
41
|
-
<Card key={
|
|
40
|
+
{agents.map((agent) => (
|
|
41
|
+
<Card key={agent.id} className="flex flex-col">
|
|
42
42
|
<CardHeader className="pb-3">
|
|
43
43
|
<div className="flex items-start justify-between gap-2">
|
|
44
44
|
<div className="min-w-0 flex-1">
|
|
45
45
|
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
46
|
-
ID: {
|
|
46
|
+
ID: {agent.id}
|
|
47
47
|
</p>
|
|
48
48
|
<h3 className="mt-1 flex items-center gap-2 font-semibold">
|
|
49
|
-
{
|
|
50
|
-
<span className="truncate">{
|
|
49
|
+
{agent.icon && <span>{agent.icon}</span>}
|
|
50
|
+
<span className="truncate">{agent.displayName}</span>
|
|
51
51
|
</h3>
|
|
52
52
|
</div>
|
|
53
53
|
<Badge variant="outline">
|
|
54
|
-
{renderExecutionLabel(
|
|
54
|
+
{renderExecutionLabel(agent.executionType)}
|
|
55
55
|
</Badge>
|
|
56
56
|
</div>
|
|
57
57
|
</CardHeader>
|
|
58
58
|
|
|
59
59
|
<CardContent className="flex-1 space-y-3 pb-3">
|
|
60
60
|
<p className="rounded bg-muted px-2 py-1 font-mono text-sm">
|
|
61
|
-
{
|
|
61
|
+
{agent.command}
|
|
62
62
|
</p>
|
|
63
63
|
|
|
64
|
-
{
|
|
64
|
+
{agent.description && (
|
|
65
65
|
<p className="text-sm text-muted-foreground">
|
|
66
|
-
{
|
|
66
|
+
{agent.description}
|
|
67
67
|
</p>
|
|
68
68
|
)}
|
|
69
69
|
|
|
70
70
|
<dl className="grid grid-cols-3 gap-2 text-xs">
|
|
71
71
|
<div>
|
|
72
72
|
<dt className="text-muted-foreground">normal</dt>
|
|
73
|
-
<dd className="mt-0.5">{renderArgs(
|
|
73
|
+
<dd className="mt-0.5">{renderArgs(agent.modeArgs?.normal)}</dd>
|
|
74
74
|
</div>
|
|
75
75
|
<div>
|
|
76
76
|
<dt className="text-muted-foreground">continue</dt>
|
|
77
77
|
<dd className="mt-0.5">
|
|
78
|
-
{renderArgs(
|
|
78
|
+
{renderArgs(agent.modeArgs?.continue)}
|
|
79
79
|
</dd>
|
|
80
80
|
</div>
|
|
81
81
|
<div>
|
|
82
82
|
<dt className="text-muted-foreground">resume</dt>
|
|
83
|
-
<dd className="mt-0.5">{renderArgs(
|
|
83
|
+
<dd className="mt-0.5">{renderArgs(agent.modeArgs?.resume)}</dd>
|
|
84
84
|
</div>
|
|
85
85
|
</dl>
|
|
86
86
|
</CardContent>
|
|
87
87
|
|
|
88
88
|
<CardFooter className="flex gap-2 pt-0">
|
|
89
|
-
<Button variant="secondary" size="sm" onClick={() => onEdit(
|
|
89
|
+
<Button variant="secondary" size="sm" onClick={() => onEdit(agent)}>
|
|
90
90
|
編集
|
|
91
91
|
</Button>
|
|
92
|
-
<Button variant="ghost" size="sm" onClick={() => onDelete(
|
|
92
|
+
<Button variant="ghost" size="sm" onClick={() => onDelete(agent)}>
|
|
93
93
|
削除
|
|
94
94
|
</Button>
|
|
95
95
|
</CardFooter>
|
|
@@ -99,7 +99,7 @@ export function CustomToolList({
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function renderExecutionLabel(type:
|
|
102
|
+
function renderExecutionLabel(type: ApiCodingAgent["executionType"]) {
|
|
103
103
|
switch (type) {
|
|
104
104
|
case "path":
|
|
105
105
|
return "実行ファイル";
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
interface SessionInfo {
|
|
15
15
|
sessionId: string;
|
|
16
16
|
worktreePath: string;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
agentType: string;
|
|
18
|
+
agentName?: string | null;
|
|
19
19
|
mode?: string;
|
|
20
20
|
status: "pending" | "running" | "completed" | "failed";
|
|
21
21
|
startedAt?: string;
|
|
@@ -62,9 +62,9 @@ function formatDate(value?: string | null): string {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
function
|
|
66
|
-
if (
|
|
67
|
-
if (
|
|
65
|
+
function agentLabel(agentType: string, agentName?: string | null): string {
|
|
66
|
+
if (agentType === "custom") return agentName ?? "Custom";
|
|
67
|
+
if (agentType === "codex-cli") return "Codex CLI";
|
|
68
68
|
return "Claude Code";
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -93,7 +93,7 @@ export function SessionHistoryTable({
|
|
|
93
93
|
)}
|
|
94
94
|
</div>
|
|
95
95
|
<p className="mt-2 text-sm text-muted-foreground">
|
|
96
|
-
この Worktree に紐づいた
|
|
96
|
+
この Worktree に紐づいた Coding Agent セッション履歴です。CLI
|
|
97
97
|
からの起動分も共有されます。
|
|
98
98
|
</p>
|
|
99
99
|
</CardHeader>
|
|
@@ -132,7 +132,7 @@ export function SessionHistoryTable({
|
|
|
132
132
|
</Badge>
|
|
133
133
|
</TableCell>
|
|
134
134
|
<TableCell className="font-medium">
|
|
135
|
-
{
|
|
135
|
+
{agentLabel(session.agentType, session.agentName)}
|
|
136
136
|
</TableCell>
|
|
137
137
|
<TableCell>
|
|
138
138
|
<span className="text-muted-foreground">
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
SelectValue,
|
|
14
14
|
} from "@/components/ui/select";
|
|
15
15
|
import { cn } from "@/lib/utils";
|
|
16
|
-
import type {
|
|
16
|
+
import type { ApiCodingAgent, Branch } from "../../../../../types/api.js";
|
|
17
17
|
|
|
18
18
|
type ToolMode = "normal" | "continue" | "resume";
|
|
19
19
|
|
|
20
20
|
export type SelectableTool =
|
|
21
21
|
| { id: "claude-code"; label: string; target: "claude" }
|
|
22
22
|
| { id: "codex-cli"; label: string; target: "codex" }
|
|
23
|
-
| { id: string; label: string; target: "custom"; definition:
|
|
23
|
+
| { id: string; label: string; target: "custom"; definition: ApiCodingAgent };
|
|
24
24
|
|
|
25
25
|
interface ToolSummary {
|
|
26
26
|
command: string;
|
|
@@ -139,13 +139,13 @@ export function ToolLauncher({
|
|
|
139
139
|
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
140
140
|
Tool Launcher
|
|
141
141
|
</p>
|
|
142
|
-
<h3 className="mt-1 text-lg font-semibold">
|
|
142
|
+
<h3 className="mt-1 text-lg font-semibold">Coding Agent</h3>
|
|
143
143
|
</div>
|
|
144
144
|
{configError && <Badge variant="warning">設定の取得に失敗</Badge>}
|
|
145
145
|
</div>
|
|
146
146
|
<p className="mt-2 text-sm text-muted-foreground">
|
|
147
|
-
Web UI
|
|
148
|
-
|
|
147
|
+
Web UI から直接 Coding Agent
|
|
148
|
+
を起動できます。設定したカスタムエージェントも一覧に表示されます。
|
|
149
149
|
</p>
|
|
150
150
|
</CardHeader>
|
|
151
151
|
|
|
@@ -159,14 +159,14 @@ export function ToolLauncher({
|
|
|
159
159
|
{/* Form Grid */}
|
|
160
160
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
161
161
|
<div className="space-y-2">
|
|
162
|
-
<label className="text-sm font-medium">
|
|
162
|
+
<label className="text-sm font-medium">Coding Agent</label>
|
|
163
163
|
<Select
|
|
164
164
|
value={selectedToolId}
|
|
165
165
|
onValueChange={onToolChange}
|
|
166
166
|
disabled={isConfigLoading ?? false}
|
|
167
167
|
>
|
|
168
168
|
<SelectTrigger>
|
|
169
|
-
<SelectValue placeholder="
|
|
169
|
+
<SelectValue placeholder="Select Coding Agent" />
|
|
170
170
|
</SelectTrigger>
|
|
171
171
|
<SelectContent>
|
|
172
172
|
{availableTools.map((tool) => (
|
|
@@ -232,8 +232,8 @@ export function ToolLauncher({
|
|
|
232
232
|
<AlertDescription>
|
|
233
233
|
<p>
|
|
234
234
|
リモートに未取得の更新 ({branch.divergence?.behind ?? 0}{" "}
|
|
235
|
-
commits)
|
|
236
|
-
|
|
235
|
+
commits) があるため、Coding Agent
|
|
236
|
+
を起動する前に同期してください。
|
|
237
237
|
</p>
|
|
238
238
|
<p className="mt-1 text-xs text-muted-foreground">
|
|
239
239
|
CLI の `git fetch --all` と `git pull --ff-only`
|