@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.
Files changed (153) hide show
  1. package/README.ja.md +58 -34
  2. package/README.md +18 -34
  3. package/dist/cli/ui/components/App.d.ts +2 -2
  4. package/dist/cli/ui/components/App.d.ts.map +1 -1
  5. package/dist/cli/ui/components/App.js +8 -8
  6. package/dist/cli/ui/components/App.js.map +1 -1
  7. package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.d.ts +27 -0
  8. package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.d.ts.map +1 -0
  9. package/dist/cli/ui/components/screens/{AIToolSelectorScreen.js → CodingAgentSelectorScreen.js} +35 -35
  10. package/dist/cli/ui/components/screens/CodingAgentSelectorScreen.js.map +1 -0
  11. package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts +2 -2
  12. package/dist/cli/ui/components/screens/ModelSelectorScreen.d.ts.map +1 -1
  13. package/dist/cli/ui/components/screens/ModelSelectorScreen.js.map +1 -1
  14. package/dist/cli/ui/types.d.ts +2 -2
  15. package/dist/cli/ui/types.d.ts.map +1 -1
  16. package/dist/cli/ui/utils/modelOptions.d.ts +4 -4
  17. package/dist/cli/ui/utils/modelOptions.d.ts.map +1 -1
  18. package/dist/cli/ui/utils/modelOptions.js.map +1 -1
  19. package/dist/client/assets/{index-PqK9jkug.js → index-LNPtOrn3.js} +17 -17
  20. package/dist/client/index.html +1 -1
  21. package/dist/config/builtin-coding-agents.d.ts +23 -0
  22. package/dist/config/builtin-coding-agents.d.ts.map +1 -0
  23. package/dist/config/{builtin-tools.js → builtin-coding-agents.js} +6 -6
  24. package/dist/config/builtin-coding-agents.js.map +1 -0
  25. package/dist/config/tools.d.ts +16 -16
  26. package/dist/config/tools.d.ts.map +1 -1
  27. package/dist/config/tools.js +81 -78
  28. package/dist/config/tools.js.map +1 -1
  29. package/dist/index.js +19 -19
  30. package/dist/index.js.map +1 -1
  31. package/dist/launcher.d.ts +8 -8
  32. package/dist/launcher.d.ts.map +1 -1
  33. package/dist/launcher.js +32 -28
  34. package/dist/launcher.js.map +1 -1
  35. package/dist/services/codingAgentCommandResolver.d.ts +10 -0
  36. package/dist/services/codingAgentCommandResolver.d.ts.map +1 -0
  37. package/dist/services/{customToolResolver.js → codingAgentCommandResolver.js} +25 -20
  38. package/dist/services/codingAgentCommandResolver.js.map +1 -0
  39. package/dist/services/{aiToolResolver.d.ts → codingAgentResolver.d.ts} +6 -6
  40. package/dist/services/codingAgentResolver.d.ts.map +1 -0
  41. package/dist/services/{aiToolResolver.js → codingAgentResolver.js} +23 -23
  42. package/dist/services/codingAgentResolver.js.map +1 -0
  43. package/dist/shared/{aiToolConstants.d.ts → codingAgentConstants.d.ts} +2 -2
  44. package/dist/shared/codingAgentConstants.d.ts.map +1 -0
  45. package/dist/shared/{aiToolConstants.js → codingAgentConstants.js} +2 -2
  46. package/dist/shared/codingAgentConstants.js.map +1 -0
  47. package/dist/types/api.d.ts +12 -12
  48. package/dist/types/api.d.ts.map +1 -1
  49. package/dist/types/tools.d.ts +30 -30
  50. package/dist/types/tools.d.ts.map +1 -1
  51. package/dist/types/tools.js +1 -1
  52. package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts +9 -0
  53. package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts.map +1 -0
  54. package/dist/web/client/src/components/{AIToolLaunchModal.js → CodingAgentLaunchModal.js} +58 -58
  55. package/dist/web/client/src/components/CodingAgentLaunchModal.js.map +1 -0
  56. package/dist/web/client/src/components/CustomCodingAgentForm.d.ts +23 -0
  57. package/dist/web/client/src/components/CustomCodingAgentForm.d.ts.map +1 -0
  58. package/dist/web/client/src/components/{CustomToolForm.js → CustomCodingAgentForm.js} +5 -5
  59. package/dist/web/client/src/components/CustomCodingAgentForm.js.map +1 -0
  60. package/dist/web/client/src/components/CustomCodingAgentList.d.ts +10 -0
  61. package/dist/web/client/src/components/CustomCodingAgentList.d.ts.map +1 -0
  62. package/dist/web/client/src/components/{CustomToolList.js → CustomCodingAgentList.js} +17 -17
  63. package/dist/web/client/src/components/CustomCodingAgentList.js.map +1 -0
  64. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts +2 -2
  65. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts.map +1 -1
  66. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js +6 -6
  67. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js.map +1 -1
  68. package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts +2 -2
  69. package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts.map +1 -1
  70. package/dist/web/client/src/components/branch-detail/ToolLauncher.js +5 -5
  71. package/dist/web/client/src/components/branch-detail/ToolLauncher.js.map +1 -1
  72. package/dist/web/client/src/hooks/useSessions.d.ts +4 -4
  73. package/dist/web/client/src/hooks/useSessions.d.ts.map +1 -1
  74. package/dist/web/client/src/hooks/useSessions.js.map +1 -1
  75. package/dist/web/client/src/lib/api.d.ts +5 -5
  76. package/dist/web/client/src/lib/api.d.ts.map +1 -1
  77. package/dist/web/client/src/lib/api.js +1 -1
  78. package/dist/web/client/src/lib/api.js.map +1 -1
  79. package/dist/web/client/src/pages/BranchDetailPage.js +24 -24
  80. package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
  81. package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +1 -1
  82. package/dist/web/client/src/pages/ConfigManagementPage.js +15 -15
  83. package/dist/web/client/src/pages/ConfigManagementPage.js.map +1 -1
  84. package/dist/web/client/src/pages/ConfigPage.d.ts.map +1 -1
  85. package/dist/web/client/src/pages/ConfigPage.js +43 -39
  86. package/dist/web/client/src/pages/ConfigPage.js.map +1 -1
  87. package/dist/web/server/env/importer.d.ts.map +1 -1
  88. package/dist/web/server/env/importer.js +3 -3
  89. package/dist/web/server/env/importer.js.map +1 -1
  90. package/dist/web/server/pty/manager.d.ts +6 -6
  91. package/dist/web/server/pty/manager.d.ts.map +1 -1
  92. package/dist/web/server/pty/manager.js +11 -11
  93. package/dist/web/server/pty/manager.js.map +1 -1
  94. package/dist/web/server/routes/config.d.ts.map +1 -1
  95. package/dist/web/server/routes/config.js +34 -34
  96. package/dist/web/server/routes/config.js.map +1 -1
  97. package/dist/web/server/routes/sessions.d.ts +1 -1
  98. package/dist/web/server/routes/sessions.d.ts.map +1 -1
  99. package/dist/web/server/routes/sessions.js +20 -20
  100. package/dist/web/server/routes/sessions.js.map +1 -1
  101. package/package.json +2 -2
  102. package/src/cli/ui/__tests__/components/screens/{AIToolSelectorScreen.test.tsx → CodingAgentSelectorScreen.test.tsx} +38 -38
  103. package/src/cli/ui/components/App.tsx +22 -20
  104. package/src/cli/ui/components/screens/CodingAgentSelectorScreen.tsx +159 -0
  105. package/src/cli/ui/components/screens/ModelSelectorScreen.tsx +6 -2
  106. package/src/cli/ui/types.ts +2 -2
  107. package/src/cli/ui/utils/modelOptions.ts +6 -4
  108. package/src/config/{builtin-tools.ts → builtin-coding-agents.ts} +9 -9
  109. package/src/config/tools.ts +104 -92
  110. package/src/index.ts +19 -19
  111. package/src/launcher.ts +38 -31
  112. package/src/services/{customToolResolver.ts → codingAgentCommandResolver.ts} +33 -28
  113. package/src/services/{aiToolResolver.ts → codingAgentResolver.ts} +28 -28
  114. package/src/shared/{aiToolConstants.ts → codingAgentConstants.ts} +1 -1
  115. package/src/types/api.ts +12 -12
  116. package/src/types/tools.ts +30 -30
  117. package/src/web/client/src/components/{AIToolLaunchModal.tsx → CodingAgentLaunchModal.tsx} +74 -70
  118. package/src/web/client/src/components/{CustomToolForm.tsx → CustomCodingAgentForm.tsx} +14 -14
  119. package/src/web/client/src/components/{CustomToolList.tsx → CustomCodingAgentList.tsx} +26 -26
  120. package/src/web/client/src/components/branch-detail/SessionHistoryTable.tsx +7 -7
  121. package/src/web/client/src/components/branch-detail/ToolLauncher.tsx +9 -9
  122. package/src/web/client/src/hooks/useSessions.ts +5 -5
  123. package/src/web/client/src/lib/api.ts +8 -8
  124. package/src/web/client/src/pages/BranchDetailPage.tsx +26 -26
  125. package/src/web/client/src/pages/ConfigManagementPage.tsx +32 -24
  126. package/src/web/client/src/pages/ConfigPage.tsx +55 -49
  127. package/src/web/server/env/importer.ts +6 -3
  128. package/src/web/server/pty/manager.ts +20 -20
  129. package/src/web/server/routes/config.ts +45 -39
  130. package/src/web/server/routes/sessions.ts +29 -26
  131. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts +0 -27
  132. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts.map +0 -1
  133. package/dist/cli/ui/components/screens/AIToolSelectorScreen.js.map +0 -1
  134. package/dist/config/builtin-tools.d.ts +0 -23
  135. package/dist/config/builtin-tools.d.ts.map +0 -1
  136. package/dist/config/builtin-tools.js.map +0 -1
  137. package/dist/services/aiToolResolver.d.ts.map +0 -1
  138. package/dist/services/aiToolResolver.js.map +0 -1
  139. package/dist/services/customToolResolver.d.ts +0 -10
  140. package/dist/services/customToolResolver.d.ts.map +0 -1
  141. package/dist/services/customToolResolver.js.map +0 -1
  142. package/dist/shared/aiToolConstants.d.ts.map +0 -1
  143. package/dist/shared/aiToolConstants.js.map +0 -1
  144. package/dist/web/client/src/components/AIToolLaunchModal.d.ts +0 -9
  145. package/dist/web/client/src/components/AIToolLaunchModal.d.ts.map +0 -1
  146. package/dist/web/client/src/components/AIToolLaunchModal.js.map +0 -1
  147. package/dist/web/client/src/components/CustomToolForm.d.ts +0 -23
  148. package/dist/web/client/src/components/CustomToolForm.d.ts.map +0 -1
  149. package/dist/web/client/src/components/CustomToolForm.js.map +0 -1
  150. package/dist/web/client/src/components/CustomToolList.d.ts +0 -10
  151. package/dist/web/client/src/components/CustomToolList.d.ts.map +0 -1
  152. package/dist/web/client/src/components/CustomToolList.js.map +0 -1
  153. package/src/cli/ui/components/screens/AIToolSelectorScreen.tsx +0 -153
package/src/index.ts CHANGED
@@ -39,8 +39,8 @@ import {
39
39
  waitForUserAcknowledgement,
40
40
  } from "./utils/terminal.js";
41
41
  import { createLogger } from "./logging/logger.js";
42
- import { getToolById, getSharedEnvironment } from "./config/tools.js";
43
- import { launchCustomAITool } from "./launcher.js";
42
+ import { getCodingAgentById, getSharedEnvironment } from "./config/tools.js";
43
+ import { launchCodingAgent } from "./launcher.js";
44
44
  import { saveSession, loadSession } from "./config/index.js";
45
45
  import {
46
46
  findLatestCodexSession,
@@ -543,24 +543,24 @@ export async function handleAIToolWorkflow(
543
543
  );
544
544
  }
545
545
 
546
- // Get tool definition and shared environment overrides
547
- const [toolConfig, sharedEnv] = await Promise.all([
548
- getToolById(tool),
546
+ // Get coding agent definition and shared environment overrides
547
+ const [agentConfig, sharedEnv] = await Promise.all([
548
+ getCodingAgentById(tool),
549
549
  getSharedEnvironment(),
550
550
  ]);
551
551
 
552
- if (!toolConfig) {
553
- throw new Error(`Tool not found: ${tool}`);
552
+ if (!agentConfig) {
553
+ throw new Error(`Coding agent not found: ${tool}`);
554
554
  }
555
555
 
556
- // Save selection immediately (including history) so "last tool" is reflected
557
- // even if the tool is interrupted or killed mid-run (e.g., Ctrl+C).
558
- // FR-042: Record timestamp to session history immediately on tool start.
556
+ // Save selection immediately (including history) so "last agent" is reflected
557
+ // even if the agent is interrupted or killed mid-run (e.g., Ctrl+C).
558
+ // FR-042: Record timestamp to session history immediately on agent start.
559
559
  await saveSession({
560
560
  lastWorktreePath: worktreePath,
561
561
  lastBranch: branch,
562
562
  lastUsedTool: tool,
563
- toolLabel: toolConfig.displayName ?? tool,
563
+ toolLabel: agentConfig.displayName ?? tool,
564
564
  mode,
565
565
  model: normalizedModel ?? null,
566
566
  reasoningLevel: inferenceLevel ?? null,
@@ -607,7 +607,7 @@ export async function handleAIToolWorkflow(
607
607
  lastWorktreePath: worktreePath,
608
608
  lastBranch: branch,
609
609
  lastUsedTool: tool,
610
- toolLabel: toolConfig.displayName ?? tool,
610
+ toolLabel: agentConfig.displayName ?? tool,
611
611
  mode,
612
612
  model: normalizedModel ?? null,
613
613
  reasoningLevel: inferenceLevel ?? null,
@@ -622,9 +622,9 @@ export async function handleAIToolWorkflow(
622
622
  }
623
623
  }, SESSION_UPDATE_INTERVAL_MS);
624
624
 
625
- // Launch selected AI tool
626
- // Builtin tools use their dedicated launch functions
627
- // Custom tools use the generic launchCustomAITool function
625
+ // Launch selected coding agent
626
+ // Builtin agents use their dedicated launch functions
627
+ // Custom agents use the generic launchCodingAgent function
628
628
  let launchResult: { sessionId?: string | null } | void;
629
629
  try {
630
630
  if (tool === "claude-code") {
@@ -701,9 +701,9 @@ export async function handleAIToolWorkflow(
701
701
  }
702
702
  launchResult = await launchGeminiCLI(worktreePath, launchOptions);
703
703
  } else {
704
- // Custom tool
705
- printInfo(`Launching custom tool: ${toolConfig.displayName}`);
706
- launchResult = await launchCustomAITool(toolConfig, {
704
+ // Custom coding agent
705
+ printInfo(`Launching custom agent: ${agentConfig.displayName}`);
706
+ launchResult = await launchCodingAgent(agentConfig, {
707
707
  mode:
708
708
  mode === "resume"
709
709
  ? "resume"
@@ -786,7 +786,7 @@ export async function handleAIToolWorkflow(
786
786
  lastWorktreePath: worktreePath,
787
787
  lastBranch: branch,
788
788
  lastUsedTool: tool,
789
- toolLabel: toolConfig.displayName ?? tool,
789
+ toolLabel: agentConfig.displayName ?? tool,
790
790
  mode,
791
791
  model: normalizedModel ?? null,
792
792
  reasoningLevel: inferenceLevel ?? null,
package/src/launcher.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
- * カスタムツール起動機能
2
+ * コーディングエージェント起動機能
3
3
  *
4
- * カスタムAIツールの起動処理を管理します。
4
+ * コーディングエージェントの起動処理を管理します。
5
5
  * 3つの実行タイプ(path, bunx, command)をサポートします。
6
6
  */
7
7
 
8
8
  import { execa } from "execa";
9
- import type { CustomAITool, LaunchOptions } from "./types/tools.js";
9
+ import type { CodingAgent, CodingAgentLaunchOptions } from "./types/tools.js";
10
10
  import { createLogger } from "./logging/logger.js";
11
11
 
12
12
  const logger = createLogger({ category: "launcher" });
@@ -63,21 +63,24 @@ export async function resolveCommand(commandName: string): Promise<string> {
63
63
  * defaultArgs + modeArgs[mode] + extraArgs の順で引数を結合します。
64
64
  * 未定義のフィールドは空配列として扱います。
65
65
  *
66
- * @param tool - カスタムツール定義
66
+ * @param agent - コーディングエージェント定義
67
67
  * @param options - 起動オプション
68
68
  * @returns 結合された引数配列
69
69
  */
70
- function buildArgs(tool: CustomAITool, options: LaunchOptions): string[] {
70
+ function buildArgs(
71
+ agent: CodingAgent,
72
+ options: CodingAgentLaunchOptions,
73
+ ): string[] {
71
74
  const args: string[] = [];
72
75
 
73
76
  // 1. defaultArgs
74
- if (tool.defaultArgs) {
75
- args.push(...tool.defaultArgs);
77
+ if (agent.defaultArgs) {
78
+ args.push(...agent.defaultArgs);
76
79
  }
77
80
 
78
81
  // 2. modeArgs[mode]
79
82
  const mode = options.mode || "normal";
80
- const modeArgs = tool.modeArgs[mode];
83
+ const modeArgs = agent.modeArgs[mode];
81
84
  if (modeArgs) {
82
85
  args.push(...modeArgs);
83
86
  }
@@ -88,32 +91,36 @@ function buildArgs(tool: CustomAITool, options: LaunchOptions): string[] {
88
91
  }
89
92
 
90
93
  logger.debug(
91
- { toolId: tool.id, mode: options.mode ?? "normal", argsCount: args.length },
94
+ {
95
+ agentId: agent.id,
96
+ mode: options.mode ?? "normal",
97
+ argsCount: args.length,
98
+ },
92
99
  "Args built",
93
100
  );
94
101
  return args;
95
102
  }
96
103
 
97
104
  /**
98
- * カスタムAIツールを起動
105
+ * コーディングエージェントを起動
99
106
  *
100
- * ツールの実行タイプ(path/bunx/command)に応じて適切な方法で起動します。
101
- * stdio: "inherit" で起動するため、ツールの入出力は親プロセスに継承されます。
107
+ * エージェントの実行タイプ(path/bunx/command)に応じて適切な方法で起動します。
108
+ * stdio: "inherit" で起動するため、エージェントの入出力は親プロセスに継承されます。
102
109
  *
103
- * @param tool - カスタムツール定義
110
+ * @param agent - コーディングエージェント定義
104
111
  * @param options - 起動オプション
105
112
  * @throws 起動に失敗した場合
106
113
  */
107
- export async function launchCustomAITool(
108
- tool: CustomAITool,
109
- options: LaunchOptions = {},
114
+ export async function launchCodingAgent(
115
+ agent: CodingAgent,
116
+ options: CodingAgentLaunchOptions = {},
110
117
  ): Promise<void> {
111
- const args = buildArgs(tool, options);
118
+ const args = buildArgs(agent, options);
112
119
 
113
120
  const env = {
114
121
  ...process.env,
115
122
  ...(options.sharedEnv ?? {}),
116
- ...(tool.env ?? {}),
123
+ ...(agent.env ?? {}),
117
124
  };
118
125
 
119
126
  // execa共通オプション(cwdがundefinedの場合は含めない)
@@ -125,43 +132,43 @@ export async function launchCustomAITool(
125
132
 
126
133
  logger.info(
127
134
  {
128
- toolId: tool.id,
129
- toolType: tool.type,
130
- command: tool.command,
135
+ agentId: agent.id,
136
+ agentType: agent.type,
137
+ command: agent.command,
131
138
  mode: options.mode ?? "normal",
132
139
  },
133
- "Launching custom AI tool",
140
+ "Launching coding agent",
134
141
  );
135
142
 
136
- switch (tool.type) {
143
+ switch (agent.type) {
137
144
  case "path": {
138
145
  // 絶対パスで直接実行
139
- await execa(tool.command, args, execaOptions);
140
- logger.info({ toolId: tool.id }, "Custom AI tool completed (path)");
146
+ await execa(agent.command, args, execaOptions);
147
+ logger.info({ agentId: agent.id }, "Coding agent completed (path)");
141
148
  break;
142
149
  }
143
150
 
144
151
  case "bunx": {
145
152
  // bunx経由でパッケージ実行
146
153
  // bunx [package] [args...]
147
- await execa("bunx", [tool.command, ...args], execaOptions);
148
- logger.info({ toolId: tool.id }, "Custom AI tool completed (bunx)");
154
+ await execa("bunx", [agent.command, ...args], execaOptions);
155
+ logger.info({ agentId: agent.id }, "Coding agent completed (bunx)");
149
156
  break;
150
157
  }
151
158
 
152
159
  case "command": {
153
160
  // PATH解決 → 実行
154
- const resolvedPath = await resolveCommand(tool.command);
161
+ const resolvedPath = await resolveCommand(agent.command);
155
162
  await execa(resolvedPath, args, execaOptions);
156
- logger.info({ toolId: tool.id }, "Custom AI tool completed (command)");
163
+ logger.info({ agentId: agent.id }, "Coding agent completed (command)");
157
164
  break;
158
165
  }
159
166
 
160
167
  default: {
161
168
  // TypeScriptの型チェックで到達不可能だが、実行時の安全性のため
162
- const exhaustiveCheck: never = tool.type;
169
+ const exhaustiveCheck: never = agent.type;
163
170
  throw new Error(
164
- `Unknown tool execution type: ${exhaustiveCheck as string}`,
171
+ `Unknown agent execution type: ${exhaustiveCheck as string}`,
165
172
  );
166
173
  }
167
174
  }
@@ -1,10 +1,10 @@
1
1
  import { execa } from "execa";
2
- import type { CustomAITool, LaunchOptions } from "../types/tools.js";
2
+ import type { CodingAgent, CodingAgentLaunchOptions } from "../types/tools.js";
3
3
  import { createLogger } from "../logging/logger.js";
4
4
 
5
- const logger = createLogger({ category: "custom-resolver" });
5
+ const logger = createLogger({ category: "agent-resolver" });
6
6
 
7
- export interface CustomToolExecutionPlan {
7
+ export interface CodingAgentExecutionPlan {
8
8
  command: string;
9
9
  args: string[];
10
10
  env?: NodeJS.ProcessEnv;
@@ -35,24 +35,24 @@ export async function resolveCommandPath(commandName: string): Promise<string> {
35
35
  }
36
36
  }
37
37
 
38
- export function buildCustomToolArgs(
39
- tool: CustomAITool,
40
- options: LaunchOptions = {},
38
+ export function buildCodingAgentArgs(
39
+ agent: CodingAgent,
40
+ options: CodingAgentLaunchOptions = {},
41
41
  ): string[] {
42
42
  const args: string[] = [];
43
43
 
44
- if (tool.defaultArgs?.length) {
45
- args.push(...tool.defaultArgs);
44
+ if (agent.defaultArgs?.length) {
45
+ args.push(...agent.defaultArgs);
46
46
  }
47
47
 
48
48
  const mode = options.mode ?? "normal";
49
- const modeArgs = tool.modeArgs?.[mode];
49
+ const modeArgs = agent.modeArgs?.[mode];
50
50
  if (modeArgs?.length) {
51
51
  args.push(...modeArgs);
52
52
  }
53
53
 
54
- if (options.skipPermissions && tool.permissionSkipArgs?.length) {
55
- args.push(...tool.permissionSkipArgs);
54
+ if (options.skipPermissions && agent.permissionSkipArgs?.length) {
55
+ args.push(...agent.permissionSkipArgs);
56
56
  }
57
57
 
58
58
  if (options.extraArgs?.length) {
@@ -60,49 +60,54 @@ export function buildCustomToolArgs(
60
60
  }
61
61
 
62
62
  logger.debug(
63
- { toolId: tool.id, argsCount: args.length },
64
- "Custom tool args built",
63
+ { agentId: agent.id, argsCount: args.length },
64
+ "Coding agent args built",
65
65
  );
66
66
  return args;
67
67
  }
68
68
 
69
- export async function prepareCustomToolExecution(
70
- tool: CustomAITool,
71
- options: LaunchOptions = {},
72
- ): Promise<CustomToolExecutionPlan> {
73
- const baseArgs = buildCustomToolArgs(tool, options);
74
- const envOverrides: NodeJS.ProcessEnv | undefined = tool.env
75
- ? ({ ...tool.env } as NodeJS.ProcessEnv)
69
+ export async function prepareCodingAgentExecution(
70
+ agent: CodingAgent,
71
+ options: CodingAgentLaunchOptions = {},
72
+ ): Promise<CodingAgentExecutionPlan> {
73
+ const baseArgs = buildCodingAgentArgs(agent, options);
74
+ const envOverrides: NodeJS.ProcessEnv | undefined = agent.env
75
+ ? ({ ...agent.env } as NodeJS.ProcessEnv)
76
76
  : undefined;
77
77
 
78
78
  let command: string;
79
79
  let args: string[];
80
80
 
81
- switch (tool.type) {
81
+ switch (agent.type) {
82
82
  case "path": {
83
- command = tool.command;
83
+ command = agent.command;
84
84
  args = baseArgs;
85
85
  break;
86
86
  }
87
87
  case "bunx": {
88
88
  command = "bunx";
89
- args = [tool.command, ...baseArgs];
89
+ args = [agent.command, ...baseArgs];
90
90
  break;
91
91
  }
92
92
  case "command": {
93
- command = await resolveCommandPath(tool.command);
93
+ command = await resolveCommandPath(agent.command);
94
94
  args = baseArgs;
95
95
  break;
96
96
  }
97
97
  default: {
98
- const exhaustive: never = tool.type;
99
- throw new Error(`Unknown custom tool type: ${exhaustive as string}`);
98
+ const exhaustive: never = agent.type;
99
+ throw new Error(`Unknown coding agent type: ${exhaustive as string}`);
100
100
  }
101
101
  }
102
102
 
103
103
  logger.debug(
104
- { toolId: tool.id, toolType: tool.type, command, hasEnv: !!envOverrides },
105
- "Custom tool execution prepared",
104
+ {
105
+ agentId: agent.id,
106
+ agentType: agent.type,
107
+ command,
108
+ hasEnv: !!envOverrides,
109
+ },
110
+ "Coding agent execution prepared",
106
111
  );
107
112
 
108
113
  return {
@@ -1,13 +1,13 @@
1
1
  import { execa } from "execa";
2
2
  import { platform } from "os";
3
- import { getToolById } from "../config/tools.js";
4
- import { CLAUDE_CODE_TOOL } from "../config/builtin-tools.js";
3
+ import { getCodingAgentById } from "../config/tools.js";
4
+ import { CLAUDE_CODE_TOOL } from "../config/builtin-coding-agents.js";
5
5
  import {
6
6
  CODEX_DEFAULT_ARGS,
7
7
  CLAUDE_PERMISSION_SKIP_ARGS,
8
- } from "../shared/aiToolConstants.js";
9
- import { prepareCustomToolExecution } from "./customToolResolver.js";
10
- import type { LaunchOptions } from "../types/tools.js";
8
+ } from "../shared/codingAgentConstants.js";
9
+ import { prepareCodingAgentExecution } from "./codingAgentCommandResolver.js";
10
+ import type { CodingAgentLaunchOptions } from "../types/tools.js";
11
11
  import { createLogger } from "../logging/logger.js";
12
12
 
13
13
  const logger = createLogger({ category: "resolver" });
@@ -31,14 +31,14 @@ export interface ResolvedCommand {
31
31
  env?: NodeJS.ProcessEnv;
32
32
  }
33
33
 
34
- export class AIToolResolutionError extends Error {
34
+ export class CodingAgentResolutionError extends Error {
35
35
  constructor(
36
36
  public code: ResolverErrorCode,
37
37
  message: string,
38
38
  public hints?: string[],
39
39
  ) {
40
40
  super(message);
41
- this.name = "AIToolResolutionError";
41
+ this.name = "CodingAgentResolutionError";
42
42
  }
43
43
  }
44
44
 
@@ -78,7 +78,7 @@ async function ensureBunxAvailable(): Promise<void> {
78
78
  bunxCheckPromise = (async () => {
79
79
  const bunxExists = await commandExists("bunx");
80
80
  if (!bunxExists) {
81
- throw new AIToolResolutionError(
81
+ throw new CodingAgentResolutionError(
82
82
  "BUNX_NOT_FOUND",
83
83
  "bunx command not found. Install Bun 1.0+ so bunx is available on PATH.",
84
84
  [
@@ -94,7 +94,7 @@ async function ensureBunxAvailable(): Promise<void> {
94
94
  logger.debug({ bunVersion: version }, "Bun version detected");
95
95
  const major = parseInt(version.split(".")[0] ?? "0", 10);
96
96
  if (!Number.isFinite(major) || major < MIN_BUN_MAJOR) {
97
- throw new AIToolResolutionError(
97
+ throw new CodingAgentResolutionError(
98
98
  "BUN_TOO_OLD",
99
99
  `Detected Bun ${version}. Bun ${MIN_BUN_MAJOR}.0+ is required for bunx fallback execution.`,
100
100
  [
@@ -104,12 +104,12 @@ async function ensureBunxAvailable(): Promise<void> {
104
104
  );
105
105
  }
106
106
  } catch (error: unknown) {
107
- if (error instanceof AIToolResolutionError) {
107
+ if (error instanceof CodingAgentResolutionError) {
108
108
  throw error;
109
109
  }
110
110
  const err = error as NodeJS.ErrnoException;
111
111
  if (err?.code === "ENOENT") {
112
- throw new AIToolResolutionError(
112
+ throw new CodingAgentResolutionError(
113
113
  "BUNX_NOT_FOUND",
114
114
  "bun command not found while verifying bunx. Install Bun 1.0+ and ensure it is on PATH.",
115
115
  [
@@ -118,7 +118,7 @@ async function ensureBunxAvailable(): Promise<void> {
118
118
  ],
119
119
  );
120
120
  }
121
- throw new AIToolResolutionError(
121
+ throw new CodingAgentResolutionError(
122
122
  "BUN_TOO_OLD",
123
123
  `Failed to verify Bun version: ${err?.message ?? "unknown error"}`,
124
124
  );
@@ -274,37 +274,37 @@ export async function resolveCodexCommand(
274
274
  };
275
275
  }
276
276
 
277
- export interface CustomToolCommandOptions extends LaunchOptions {
278
- toolId: string;
277
+ export interface CodingAgentCommandOptions extends CodingAgentLaunchOptions {
278
+ agentId: string;
279
279
  }
280
280
 
281
- export async function resolveCustomToolCommand(
282
- options: CustomToolCommandOptions,
281
+ export async function resolveCodingAgentCommand(
282
+ options: CodingAgentCommandOptions,
283
283
  ): Promise<ResolvedCommand> {
284
- const tool = await getToolById(options.toolId);
285
- if (!tool) {
286
- logger.error({ toolId: options.toolId }, "Custom tool not found");
287
- throw new AIToolResolutionError(
284
+ const agent = await getCodingAgentById(options.agentId);
285
+ if (!agent) {
286
+ logger.error({ agentId: options.agentId }, "Coding agent not found");
287
+ throw new CodingAgentResolutionError(
288
288
  "CUSTOM_TOOL_NOT_FOUND",
289
- `Custom tool not found: ${options.toolId}`,
289
+ `Coding agent not found: ${options.agentId}`,
290
290
  [
291
291
  "Update ~/.gwt/tools.json to include this ID",
292
- "Reload the Web UI after editing the tools list",
292
+ "Reload the Web UI after editing the agents list",
293
293
  ],
294
294
  );
295
295
  }
296
296
 
297
- const execution = await prepareCustomToolExecution(tool, options);
297
+ const execution = await prepareCodingAgentExecution(agent, options);
298
298
 
299
299
  logger.info(
300
- { toolId: options.toolId, command: execution.command },
301
- "Custom tool command resolved",
300
+ { agentId: options.agentId, command: execution.command },
301
+ "Coding agent command resolved",
302
302
  );
303
303
 
304
304
  return {
305
305
  command: execution.command,
306
306
  args: execution.args,
307
- usesFallback: tool.type === "bunx",
307
+ usesFallback: agent.type === "bunx",
308
308
  ...(execution.env ? { env: execution.env } : {}),
309
309
  };
310
310
  }
@@ -314,7 +314,7 @@ export async function isClaudeCodeAvailable(): Promise<boolean> {
314
314
  await resolveClaudeCommand();
315
315
  return true;
316
316
  } catch (error) {
317
- if (error instanceof AIToolResolutionError) {
317
+ if (error instanceof CodingAgentResolutionError) {
318
318
  return false;
319
319
  }
320
320
  return false;
@@ -326,7 +326,7 @@ export async function isCodexAvailable(): Promise<boolean> {
326
326
  await resolveCodexCommand();
327
327
  return true;
328
328
  } catch (error) {
329
- if (error instanceof AIToolResolutionError) {
329
+ if (error instanceof CodingAgentResolutionError) {
330
330
  return false;
331
331
  }
332
332
  return false;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Shared constants for AI tool integrations.
2
+ * Shared constants for Coding Agent integrations.
3
3
  *
4
4
  * These values are consumed by both the CLI (Node) runtime and the Web UI so
5
5
  * that command previews, permission flags, and default arguments stay in sync.
package/src/types/api.ts CHANGED
@@ -51,12 +51,12 @@ export interface Worktree {
51
51
  }
52
52
 
53
53
  /**
54
- * AIToolSession - AI Tool実行セッション
54
+ * CodingAgentSession - Coding Agent実行セッション
55
55
  */
56
- export interface AIToolSession {
56
+ export interface CodingAgentSession {
57
57
  sessionId: string; // UUID v4
58
- toolType: "claude-code" | "codex-cli" | "custom";
59
- toolName?: string | null;
58
+ agentType: "claude-code" | "codex-cli" | "custom";
59
+ agentName?: string | null;
60
60
  mode: "normal" | "continue" | "resume";
61
61
  worktreePath: string;
62
62
  ptyPid?: number | null;
@@ -69,7 +69,7 @@ export interface AIToolSession {
69
69
  }
70
70
 
71
71
  /**
72
- * CustomAITool - カスタムAI Tool設定
72
+ * CodingAgent - カスタム Coding Agent 設定
73
73
  */
74
74
  export interface EnvironmentVariable {
75
75
  key: string;
@@ -85,7 +85,7 @@ export interface EnvironmentHistoryEntry {
85
85
  source: "ui" | "os" | "cli";
86
86
  }
87
87
 
88
- export interface CustomAITool {
88
+ export interface ApiCodingAgent {
89
89
  id: string; // UUID v4 or slug
90
90
  displayName: string;
91
91
  icon?: string | null;
@@ -144,14 +144,14 @@ export type BranchResponse = SuccessResponse<Branch>;
144
144
  export type BranchSyncResponse = SuccessResponse<BranchSyncResult>;
145
145
  export type WorktreeListResponse = SuccessResponse<Worktree[]>;
146
146
  export type WorktreeResponse = SuccessResponse<Worktree>;
147
- export type SessionListResponse = SuccessResponse<AIToolSession[]>;
148
- export type SessionResponse = SuccessResponse<AIToolSession>;
147
+ export type SessionListResponse = SuccessResponse<CodingAgentSession[]>;
148
+ export type SessionResponse = SuccessResponse<CodingAgentSession>;
149
149
  export interface ConfigPayload {
150
150
  version: string;
151
151
  updatedAt?: string | null;
152
152
  env?: EnvironmentVariable[] | null;
153
153
  history?: EnvironmentHistoryEntry[] | null;
154
- tools: CustomAITool[];
154
+ codingAgents: ApiCodingAgent[];
155
155
  }
156
156
 
157
157
  export type ConfigResponse = SuccessResponse<ConfigPayload>;
@@ -169,14 +169,14 @@ export interface BranchSyncRequest {
169
169
  }
170
170
 
171
171
  export interface StartSessionRequest {
172
- toolType: "claude-code" | "codex-cli" | "custom";
173
- toolName?: string | null;
172
+ agentType: "claude-code" | "codex-cli" | "custom";
173
+ agentName?: string | null;
174
174
  mode: "normal" | "continue" | "resume";
175
175
  worktreePath: string;
176
176
  skipPermissions?: boolean;
177
177
  bypassApprovals?: boolean;
178
178
  extraArgs?: string[];
179
- customToolId?: string | null;
179
+ customAgentId?: string | null;
180
180
  }
181
181
 
182
182
  export type UpdateConfigRequest = ConfigPayload;