@akiojin/gwt 4.9.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 +18 -34
- 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/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/tools.d.ts +16 -16
- package/dist/config/tools.d.ts.map +1 -1
- package/dist/config/tools.js +81 -78
- 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/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 +43 -39
- 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/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/tools.ts +104 -92
- 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/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 +55 -49
- 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
|
@@ -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`
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { sessionApi } from "../lib/api";
|
|
7
7
|
import type {
|
|
8
|
-
|
|
8
|
+
CodingAgentSession,
|
|
9
9
|
StartSessionRequest,
|
|
10
10
|
} from "../../../../types/api.js";
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
* セッション一覧を取得
|
|
14
14
|
*/
|
|
15
15
|
export function useSessions() {
|
|
16
|
-
return useQuery<
|
|
16
|
+
return useQuery<CodingAgentSession[]>({
|
|
17
17
|
queryKey: ["sessions"],
|
|
18
18
|
queryFn: sessionApi.list,
|
|
19
19
|
});
|
|
@@ -23,7 +23,7 @@ export function useSessions() {
|
|
|
23
23
|
* 特定のセッション情報を取得
|
|
24
24
|
*/
|
|
25
25
|
export function useSession(sessionId: string) {
|
|
26
|
-
return useQuery<
|
|
26
|
+
return useQuery<CodingAgentSession>({
|
|
27
27
|
queryKey: ["sessions", sessionId],
|
|
28
28
|
queryFn: () => sessionApi.get(sessionId),
|
|
29
29
|
enabled: !!sessionId,
|
|
@@ -38,8 +38,8 @@ export function useStartSession() {
|
|
|
38
38
|
|
|
39
39
|
return useMutation({
|
|
40
40
|
mutationFn: (request: StartSessionRequest) => sessionApi.start(request),
|
|
41
|
-
onSuccess: (session:
|
|
42
|
-
queryClient.setQueryData<
|
|
41
|
+
onSuccess: (session: CodingAgentSession) => {
|
|
42
|
+
queryClient.setQueryData<CodingAgentSession[] | undefined>(
|
|
43
43
|
["sessions"],
|
|
44
44
|
(existing) => {
|
|
45
45
|
const next =
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import type {
|
|
9
9
|
Branch,
|
|
10
10
|
Worktree,
|
|
11
|
-
|
|
11
|
+
CodingAgentSession,
|
|
12
12
|
HealthResponse,
|
|
13
13
|
CreateWorktreeRequest,
|
|
14
14
|
StartSessionRequest,
|
|
@@ -137,15 +137,15 @@ export const sessionApi = {
|
|
|
137
137
|
/**
|
|
138
138
|
* すべてのセッション一覧を取得
|
|
139
139
|
*/
|
|
140
|
-
list: async (): Promise<
|
|
141
|
-
return apiFetch<
|
|
140
|
+
list: async (): Promise<CodingAgentSession[]> => {
|
|
141
|
+
return apiFetch<CodingAgentSession[]>(`${API_BASE}/sessions`);
|
|
142
142
|
},
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* 新しいセッションを開始
|
|
146
146
|
*/
|
|
147
|
-
start: async (request: StartSessionRequest): Promise<
|
|
148
|
-
return apiFetch<
|
|
147
|
+
start: async (request: StartSessionRequest): Promise<CodingAgentSession> => {
|
|
148
|
+
return apiFetch<CodingAgentSession>(`${API_BASE}/sessions`, {
|
|
149
149
|
method: "POST",
|
|
150
150
|
body: JSON.stringify(request),
|
|
151
151
|
});
|
|
@@ -154,8 +154,8 @@ export const sessionApi = {
|
|
|
154
154
|
/**
|
|
155
155
|
* 特定のセッション情報を取得
|
|
156
156
|
*/
|
|
157
|
-
get: async (sessionId: string): Promise<
|
|
158
|
-
return apiFetch<
|
|
157
|
+
get: async (sessionId: string): Promise<CodingAgentSession> => {
|
|
158
|
+
return apiFetch<CodingAgentSession>(`${API_BASE}/sessions/${sessionId}`);
|
|
159
159
|
},
|
|
160
160
|
|
|
161
161
|
/**
|
|
@@ -173,7 +173,7 @@ export const sessionApi = {
|
|
|
173
173
|
*/
|
|
174
174
|
export const configApi = {
|
|
175
175
|
/**
|
|
176
|
-
* カスタム
|
|
176
|
+
* カスタム Coding Agent 設定を取得
|
|
177
177
|
*/
|
|
178
178
|
get: async (): Promise<ConfigPayload> => apiFetch(`${API_BASE}/config`),
|
|
179
179
|
update: async (request: ConfigPayload): Promise<ConfigPayload> =>
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "@/components/branch-detail";
|
|
23
23
|
import type {
|
|
24
24
|
Branch,
|
|
25
|
-
|
|
25
|
+
ApiCodingAgent,
|
|
26
26
|
LastToolUsage,
|
|
27
27
|
} from "../../../../types/api.js";
|
|
28
28
|
|
|
@@ -88,22 +88,22 @@ export function BranchDetailPage() {
|
|
|
88
88
|
};
|
|
89
89
|
}, [isTerminalFullscreen]);
|
|
90
90
|
|
|
91
|
-
// Available
|
|
92
|
-
const
|
|
91
|
+
// Available coding agents - must be before conditional returns
|
|
92
|
+
const customAgents: ApiCodingAgent[] = config?.codingAgents ?? [];
|
|
93
93
|
const availableTools: SelectableTool[] = useMemo(
|
|
94
94
|
() => [
|
|
95
95
|
{ id: "claude-code", label: "Claude Code", target: "claude" },
|
|
96
96
|
{ id: "codex-cli", label: "Codex CLI", target: "codex" },
|
|
97
|
-
...
|
|
98
|
-
(
|
|
99
|
-
id:
|
|
100
|
-
label:
|
|
97
|
+
...customAgents.map(
|
|
98
|
+
(agent): SelectableTool => ({
|
|
99
|
+
id: agent.id,
|
|
100
|
+
label: agent.displayName,
|
|
101
101
|
target: "custom" as const,
|
|
102
|
-
definition:
|
|
102
|
+
definition: agent,
|
|
103
103
|
}),
|
|
104
104
|
),
|
|
105
105
|
],
|
|
106
|
-
[
|
|
106
|
+
[customAgents],
|
|
107
107
|
);
|
|
108
108
|
|
|
109
109
|
// Ensure selected tool is valid - must be before conditional returns
|
|
@@ -135,13 +135,13 @@ export function BranchDetailPage() {
|
|
|
135
135
|
branch: branch.name,
|
|
136
136
|
worktreePath: branch.worktreePath ?? null,
|
|
137
137
|
toolId:
|
|
138
|
-
first.
|
|
139
|
-
? (first.
|
|
140
|
-
: (first.
|
|
138
|
+
first.agentType === "custom"
|
|
139
|
+
? (first.agentName ?? "custom")
|
|
140
|
+
: (first.agentType as LastToolUsage["toolId"]),
|
|
141
141
|
toolLabel:
|
|
142
|
-
first.
|
|
143
|
-
? (first.
|
|
144
|
-
:
|
|
142
|
+
first.agentType === "custom"
|
|
143
|
+
? (first.agentName ?? "Custom")
|
|
144
|
+
: agentLabel(first.agentType),
|
|
145
145
|
mode: first.mode ?? "normal",
|
|
146
146
|
model: null,
|
|
147
147
|
timestamp: first.startedAt ? Date.parse(first.startedAt) : Date.now(),
|
|
@@ -257,7 +257,7 @@ export function BranchDetailPage() {
|
|
|
257
257
|
if (!selectedTool) {
|
|
258
258
|
setBanner({
|
|
259
259
|
type: "error",
|
|
260
|
-
message: "起動する
|
|
260
|
+
message: "起動する Coding Agent を選択してください",
|
|
261
261
|
});
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
@@ -265,7 +265,7 @@ export function BranchDetailPage() {
|
|
|
265
265
|
if (needsRemoteSync) {
|
|
266
266
|
setBanner({
|
|
267
267
|
type: "error",
|
|
268
|
-
message: "リモートの更新を取り込むまで
|
|
268
|
+
message: "リモートの更新を取り込むまで Coding Agent は起動できません。",
|
|
269
269
|
});
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
@@ -287,7 +287,7 @@ export function BranchDetailPage() {
|
|
|
287
287
|
|
|
288
288
|
setIsStartingSession(true);
|
|
289
289
|
try {
|
|
290
|
-
const
|
|
290
|
+
const agentType: ToolType =
|
|
291
291
|
selectedTool.target === "codex"
|
|
292
292
|
? "codex-cli"
|
|
293
293
|
: selectedTool.target === "custom"
|
|
@@ -298,10 +298,10 @@ export function BranchDetailPage() {
|
|
|
298
298
|
.map((c) => c.trim())
|
|
299
299
|
.filter(Boolean);
|
|
300
300
|
const sessionRequest = {
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
agentType,
|
|
302
|
+
agentName: selectedTool.target === "custom" ? selectedTool.id : null,
|
|
303
303
|
...(selectedTool.target === "custom"
|
|
304
|
-
? {
|
|
304
|
+
? { customAgentId: selectedTool.id }
|
|
305
305
|
: {}),
|
|
306
306
|
mode: selectedMode,
|
|
307
307
|
worktreePath: branch.worktreePath,
|
|
@@ -317,7 +317,7 @@ export function BranchDetailPage() {
|
|
|
317
317
|
setIsTerminalFullscreen(false);
|
|
318
318
|
setBanner({
|
|
319
319
|
type: "info",
|
|
320
|
-
message: `${
|
|
320
|
+
message: `${agentLabel(agentType, selectedTool)} を起動しました。`,
|
|
321
321
|
});
|
|
322
322
|
} catch (err) {
|
|
323
323
|
setBanner({
|
|
@@ -438,7 +438,7 @@ export function BranchDetailPage() {
|
|
|
438
438
|
</Button>
|
|
439
439
|
) : (
|
|
440
440
|
<Button variant="secondary" asChild>
|
|
441
|
-
<Link to="/config"
|
|
441
|
+
<Link to="/config">Custom Coding Agent</Link>
|
|
442
442
|
</Button>
|
|
443
443
|
)}
|
|
444
444
|
</div>
|
|
@@ -547,9 +547,9 @@ function formatError(error: unknown, fallback: string): string {
|
|
|
547
547
|
return fallback;
|
|
548
548
|
}
|
|
549
549
|
|
|
550
|
-
function
|
|
551
|
-
if (
|
|
550
|
+
function agentLabel(agentType: string, selectedTool?: SelectableTool): string {
|
|
551
|
+
if (agentType === "custom" && selectedTool?.target === "custom")
|
|
552
552
|
return selectedTool.label;
|
|
553
|
-
if (
|
|
553
|
+
if (agentType === "codex-cli") return "Codex CLI";
|
|
554
554
|
return "Claude Code";
|
|
555
555
|
}
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useMemo, useState } from "react";
|
|
|
2
2
|
import { Link } from "react-router-dom";
|
|
3
3
|
import type {
|
|
4
4
|
ConfigPayload,
|
|
5
|
-
|
|
5
|
+
ApiCodingAgent,
|
|
6
6
|
EnvironmentVariable,
|
|
7
7
|
} from "../../../../types/api.js";
|
|
8
8
|
import { useConfig, useUpdateConfig } from "../hooks/useConfig";
|
|
@@ -39,15 +39,17 @@ function buildPayload(
|
|
|
39
39
|
sharedEnv: EnvRow[],
|
|
40
40
|
toolState: ToolEnvState,
|
|
41
41
|
): ConfigPayload {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const codingAgents: ApiCodingAgent[] = (base?.codingAgents ?? []).map(
|
|
43
|
+
(agent) => ({
|
|
44
|
+
...agent,
|
|
45
|
+
env: serializeRows(toolState[agent.id] ?? []),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
46
48
|
|
|
47
49
|
return {
|
|
48
50
|
version: base?.version ?? "1.0.0",
|
|
49
51
|
env: serializeRows(sharedEnv),
|
|
50
|
-
|
|
52
|
+
codingAgents,
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
55
|
|
|
@@ -65,8 +67,8 @@ export function ConfigManagementPage() {
|
|
|
65
67
|
if (!data) return;
|
|
66
68
|
setSharedEnv(rowsFromVariables(data.env));
|
|
67
69
|
const toolState: ToolEnvState = {};
|
|
68
|
-
data.
|
|
69
|
-
toolState[
|
|
70
|
+
data.codingAgents?.forEach((agent) => {
|
|
71
|
+
toolState[agent.id] = rowsFromVariables(agent.env);
|
|
70
72
|
});
|
|
71
73
|
setToolEnv(toolState);
|
|
72
74
|
}, [data]);
|
|
@@ -102,8 +104,11 @@ export function ConfigManagementPage() {
|
|
|
102
104
|
if (serializedOriginalShared !== serializedCurrentShared) return true;
|
|
103
105
|
if (!data) return false;
|
|
104
106
|
const currentTool =
|
|
105
|
-
data.
|
|
106
|
-
|
|
107
|
+
data.codingAgents?.map((agent) =>
|
|
108
|
+
serializeRows(toolEnv[agent.id] ?? []),
|
|
109
|
+
) ?? [];
|
|
110
|
+
const originalTool =
|
|
111
|
+
data.codingAgents?.map((agent) => agent.env ?? []) ?? [];
|
|
107
112
|
return JSON.stringify(currentTool) !== JSON.stringify(originalTool);
|
|
108
113
|
}, [data, serializedOriginalShared, serializedCurrentShared, toolEnv]);
|
|
109
114
|
|
|
@@ -195,41 +200,44 @@ export function ConfigManagementPage() {
|
|
|
195
200
|
<CardContent className="pt-6">
|
|
196
201
|
<EnvEditor
|
|
197
202
|
title="共通環境変数"
|
|
198
|
-
description="全ての
|
|
203
|
+
description="全ての Coding Agent で共有される値。PAT やプロキシ設定などはこちらに入力してください。"
|
|
199
204
|
rows={sharedEnv}
|
|
200
205
|
onChange={setSharedEnv}
|
|
201
206
|
/>
|
|
202
207
|
</CardContent>
|
|
203
208
|
</Card>
|
|
204
209
|
|
|
205
|
-
{/*
|
|
210
|
+
{/* Agent-specific Environment Variables */}
|
|
206
211
|
<Card>
|
|
207
212
|
<CardHeader className="pb-3">
|
|
208
213
|
<p className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
209
|
-
|
|
214
|
+
Agent-specific
|
|
210
215
|
</p>
|
|
211
|
-
<h3 className="mt-1 text-lg font-semibold"
|
|
216
|
+
<h3 className="mt-1 text-lg font-semibold">
|
|
217
|
+
Coding Agent 固有の環境変数
|
|
218
|
+
</h3>
|
|
212
219
|
<p className="mt-2 text-sm text-muted-foreground">
|
|
213
|
-
|
|
214
|
-
|
|
220
|
+
各 Coding Agent
|
|
221
|
+
固有に上書きしたい値がある場合はこちらから設定します。
|
|
222
|
+
共通設定との競合がある場合はエージェント設定が優先されます。
|
|
215
223
|
</p>
|
|
216
224
|
</CardHeader>
|
|
217
225
|
<CardContent className="space-y-6">
|
|
218
|
-
{data?.
|
|
219
|
-
<div key={
|
|
226
|
+
{data?.codingAgents?.map((agent) => (
|
|
227
|
+
<div key={agent.id} className="rounded-lg border p-4">
|
|
220
228
|
<EnvEditor
|
|
221
|
-
title={
|
|
222
|
-
description={`${
|
|
223
|
-
rows={toolEnv[
|
|
229
|
+
title={agent.displayName}
|
|
230
|
+
description={`${agent.executionType} / ${agent.command}`}
|
|
231
|
+
rows={toolEnv[agent.id] ?? []}
|
|
224
232
|
onChange={(rows) =>
|
|
225
|
-
setToolEnv((prev) => ({ ...prev, [
|
|
233
|
+
setToolEnv((prev) => ({ ...prev, [agent.id]: rows }))
|
|
226
234
|
}
|
|
227
235
|
/>
|
|
228
236
|
</div>
|
|
229
237
|
))}
|
|
230
|
-
{!data?.
|
|
238
|
+
{!data?.codingAgents?.length && (
|
|
231
239
|
<p className="py-4 text-center text-sm text-muted-foreground">
|
|
232
|
-
|
|
240
|
+
登録されている Coding Agent がありません。
|
|
233
241
|
</p>
|
|
234
242
|
)}
|
|
235
243
|
</CardContent>
|