mcp-codex-subagent 2.0.8 → 2.0.10
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/dist/event/bus.d.ts +53 -0
- package/dist/event/bus.d.ts.map +1 -0
- package/dist/event/bus.js +94 -0
- package/dist/event/bus.js.map +1 -0
- package/dist/event/throttle.d.ts +36 -0
- package/dist/event/throttle.d.ts.map +1 -0
- package/dist/event/throttle.js +66 -0
- package/dist/event/throttle.js.map +1 -0
- package/dist/index.js +32 -1
- package/dist/index.js.map +1 -1
- package/dist/process/event-parser.d.ts +37 -0
- package/dist/process/event-parser.d.ts.map +1 -0
- package/dist/process/event-parser.js +141 -0
- package/dist/process/event-parser.js.map +1 -0
- package/dist/process/runner.d.ts +48 -0
- package/dist/process/runner.d.ts.map +1 -0
- package/dist/process/runner.js +227 -0
- package/dist/process/runner.js.map +1 -0
- package/dist/process/types.d.ts +74 -0
- package/dist/process/types.d.ts.map +1 -0
- package/dist/process/types.js +5 -0
- package/dist/process/types.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +128 -36
- package/dist/server.js.map +1 -1
- package/dist/services/account-rotator.d.ts +28 -0
- package/dist/services/account-rotator.d.ts.map +1 -0
- package/dist/services/account-rotator.js +216 -0
- package/dist/services/account-rotator.js.map +1 -0
- package/dist/services/output-file.d.ts.map +1 -1
- package/dist/services/output-file.js +80 -36
- package/dist/services/output-file.js.map +1 -1
- package/dist/services/task-manager.d.ts +6 -0
- package/dist/services/task-manager.d.ts.map +1 -1
- package/dist/services/task-manager.js +24 -1
- package/dist/services/task-manager.js.map +1 -1
- package/dist/services/template-init.d.ts +10 -0
- package/dist/services/template-init.d.ts.map +1 -0
- package/dist/services/template-init.js +41 -0
- package/dist/services/template-init.js.map +1 -0
- package/dist/session/file-storage.d.ts +27 -0
- package/dist/session/file-storage.d.ts.map +1 -0
- package/dist/session/file-storage.js +281 -0
- package/dist/session/file-storage.js.map +1 -0
- package/dist/session/storage.js +1 -1
- package/dist/session/storage.js.map +1 -1
- package/dist/task/state-machine.d.ts +27 -0
- package/dist/task/state-machine.d.ts.map +1 -0
- package/dist/task/state-machine.js +59 -0
- package/dist/task/state-machine.js.map +1 -0
- package/dist/task/store.d.ts +91 -0
- package/dist/task/store.d.ts.map +1 -0
- package/dist/task/store.js +317 -0
- package/dist/task/store.js.map +1 -0
- package/dist/task/types.d.ts +72 -0
- package/dist/task/types.d.ts.map +1 -0
- package/dist/task/types.js +13 -0
- package/dist/task/types.js.map +1 -0
- package/dist/templates/index.d.ts +16 -0
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/index.js +57 -5
- package/dist/templates/index.js.map +1 -1
- package/dist/tools/definitions.d.ts +5 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +253 -179
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/description-builder.d.ts +18 -0
- package/dist/tools/description-builder.d.ts.map +1 -0
- package/dist/tools/description-builder.js +88 -0
- package/dist/tools/description-builder.js.map +1 -0
- package/dist/tools/handlers.d.ts +19 -17
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +287 -341
- package/dist/tools/handlers.js.map +1 -1
- package/dist/types.d.ts +5 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +7 -10
- package/dist/types.js.map +1 -1
- package/dist/utils/ring-buffer.d.ts +41 -0
- package/dist/utils/ring-buffer.d.ts.map +1 -0
- package/dist/utils/ring-buffer.js +83 -0
- package/dist/utils/ring-buffer.js.map +1 -0
- package/dist/wave/dag.d.ts +32 -0
- package/dist/wave/dag.d.ts.map +1 -0
- package/dist/wave/dag.js +186 -0
- package/dist/wave/dag.js.map +1 -0
- package/dist/wave/git.d.ts +57 -0
- package/dist/wave/git.d.ts.map +1 -0
- package/dist/wave/git.js +227 -0
- package/dist/wave/git.js.map +1 -0
- package/dist/wave/orchestrator.d.ts +15 -0
- package/dist/wave/orchestrator.d.ts.map +1 -0
- package/dist/wave/orchestrator.js +565 -0
- package/dist/wave/orchestrator.js.map +1 -0
- package/dist/wave/progress.d.ts +51 -0
- package/dist/wave/progress.d.ts.map +1 -0
- package/dist/wave/progress.js +176 -0
- package/dist/wave/progress.js.map +1 -0
- package/dist/wave/registry.d.ts +66 -0
- package/dist/wave/registry.d.ts.map +1 -0
- package/dist/wave/registry.js +340 -0
- package/dist/wave/registry.js.map +1 -0
- package/dist/wave/semaphore.d.ts +42 -0
- package/dist/wave/semaphore.d.ts.map +1 -0
- package/dist/wave/semaphore.js +119 -0
- package/dist/wave/semaphore.js.map +1 -0
- package/dist/wave/types.d.ts +197 -0
- package/dist/wave/types.d.ts.map +1 -0
- package/dist/wave/types.js +147 -0
- package/dist/wave/types.js.map +1 -0
- package/package.json +15 -15
|
@@ -1,195 +1,269 @@
|
|
|
1
1
|
import { TOOLS } from '../types.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type: 'integer',
|
|
51
|
-
description: 'End line (1-indexed, optional)',
|
|
2
|
+
import { buildSpawnSubagentDescription, buildCodeReviewDescription, buildAgentGroupDescription, } from './description-builder.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build tool definitions dynamically.
|
|
5
|
+
* Called after template init so discoverAvailableTemplates() can scan disk.
|
|
6
|
+
*/
|
|
7
|
+
export function getToolDefinitions() {
|
|
8
|
+
return [
|
|
9
|
+
{
|
|
10
|
+
name: TOOLS.SPAWN_SUBAGENT,
|
|
11
|
+
description: buildSpawnSubagentDescription(),
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
prompt: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'The coding task, question, or analysis request',
|
|
18
|
+
},
|
|
19
|
+
role: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
enum: ['coder', 'planner', 'tester', 'researcher'],
|
|
22
|
+
description: 'Agent role — applies a structured system prompt template. coder: implementation tasks, planner: architecture/planning, tester: QA/testing, researcher: investigation/research',
|
|
23
|
+
},
|
|
24
|
+
specialization: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'Specialization overlay for the role. Coder: typescript, python, rust, go, java, kotlin, ruby, csharp, swift, react, vue, nextjs, tauri, triggerdev, supabase, supastarter. Planner: feature, bugfix, refactor, architecture, migration. Researcher: security, performance, library. Tester: playwright, rest, graphql, suite',
|
|
27
|
+
},
|
|
28
|
+
context_files: {
|
|
29
|
+
type: 'array',
|
|
30
|
+
description: 'Context files. Required for coder (min 1 .md) and tester (min 1). Max 20 files, 200KB each, 500KB total.',
|
|
31
|
+
items: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
path: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Absolute file path to read',
|
|
37
|
+
},
|
|
38
|
+
description: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'What this file is and why it matters',
|
|
41
|
+
},
|
|
42
|
+
start_line: {
|
|
43
|
+
type: 'integer',
|
|
44
|
+
description: 'Start line (1-indexed, optional)',
|
|
45
|
+
},
|
|
46
|
+
end_line: {
|
|
47
|
+
type: 'integer',
|
|
48
|
+
description: 'End line (1-indexed, optional)',
|
|
49
|
+
},
|
|
52
50
|
},
|
|
51
|
+
required: ['path'],
|
|
53
52
|
},
|
|
54
|
-
|
|
53
|
+
},
|
|
54
|
+
sessionId: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Optional session ID for conversational context. Note: when resuming a session, sandbox/workingDirectory parameters are not applied (CLI limitation)',
|
|
57
|
+
},
|
|
58
|
+
resetSession: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
description: 'Reset the session history before processing this request',
|
|
61
|
+
},
|
|
62
|
+
reasoningEffort: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
enum: ['low', 'medium', 'high', 'xhigh'],
|
|
65
|
+
description: 'Control reasoning depth (low < medium < high < xhigh). This is the primary tuning knob. Defaults to xhigh.',
|
|
66
|
+
},
|
|
67
|
+
sandbox: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
enum: ['read-only', 'workspace-write', 'danger-full-access'],
|
|
70
|
+
description: 'Sandbox policy for shell command execution. Defaults to danger-full-access.',
|
|
71
|
+
},
|
|
72
|
+
workingDirectory: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'Working directory for the agent to use as its root (passed via -C flag)',
|
|
75
|
+
},
|
|
76
|
+
callbackUri: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'Static MCP callback URI to pass to Codex via environment (if provided)',
|
|
55
79
|
},
|
|
56
80
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
type: '
|
|
63
|
-
description: 'Reset the session history before processing this request',
|
|
64
|
-
},
|
|
65
|
-
reasoningEffort: {
|
|
66
|
-
type: 'string',
|
|
67
|
-
enum: ['low', 'medium', 'high', 'xhigh'],
|
|
68
|
-
description: 'Control reasoning depth (low < medium < high < xhigh). This is the primary tuning knob. Defaults to xhigh.',
|
|
69
|
-
},
|
|
70
|
-
sandbox: {
|
|
71
|
-
type: 'string',
|
|
72
|
-
enum: ['read-only', 'workspace-write', 'danger-full-access'],
|
|
73
|
-
description: 'Sandbox policy for shell command execution. Defaults to danger-full-access.',
|
|
74
|
-
},
|
|
75
|
-
workingDirectory: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
description: 'Working directory for the agent to use as its root (passed via -C flag)',
|
|
78
|
-
},
|
|
79
|
-
callbackUri: {
|
|
80
|
-
type: 'string',
|
|
81
|
-
description: 'Static MCP callback URI to pass to Codex via environment (if provided)',
|
|
81
|
+
required: ['prompt'],
|
|
82
|
+
},
|
|
83
|
+
outputSchema: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
threadId: { type: 'string' },
|
|
82
87
|
},
|
|
83
88
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
89
|
+
annotations: {
|
|
90
|
+
title: 'Spawn Codex Agent',
|
|
91
|
+
readOnlyHint: false,
|
|
92
|
+
destructiveHint: true,
|
|
93
|
+
idempotentHint: false,
|
|
94
|
+
openWorldHint: true,
|
|
90
95
|
},
|
|
91
96
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
title: {
|
|
123
|
-
type: 'string',
|
|
124
|
-
description: 'Optional title to display in the review summary',
|
|
125
|
-
},
|
|
126
|
-
workingDirectory: {
|
|
127
|
-
type: 'string',
|
|
128
|
-
description: 'Working directory to run the review in (passed via -C as a global Codex option)',
|
|
97
|
+
{
|
|
98
|
+
name: TOOLS.CODE_REVIEW,
|
|
99
|
+
description: buildCodeReviewDescription(),
|
|
100
|
+
inputSchema: {
|
|
101
|
+
type: 'object',
|
|
102
|
+
properties: {
|
|
103
|
+
prompt: {
|
|
104
|
+
type: 'string',
|
|
105
|
+
description: 'Custom review instructions or focus areas (cannot be used with uncommitted=true; use base/commit review instead)',
|
|
106
|
+
},
|
|
107
|
+
uncommitted: {
|
|
108
|
+
type: 'boolean',
|
|
109
|
+
description: 'Review staged, unstaged, and untracked changes (working tree) - cannot be combined with custom prompt',
|
|
110
|
+
},
|
|
111
|
+
base: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
description: 'Review changes against a specific base branch (e.g., "main", "develop")',
|
|
114
|
+
},
|
|
115
|
+
commit: {
|
|
116
|
+
type: 'string',
|
|
117
|
+
description: 'Review the changes introduced by a specific commit SHA',
|
|
118
|
+
},
|
|
119
|
+
title: {
|
|
120
|
+
type: 'string',
|
|
121
|
+
description: 'Optional title to display in the review summary',
|
|
122
|
+
},
|
|
123
|
+
workingDirectory: {
|
|
124
|
+
type: 'string',
|
|
125
|
+
description: 'Working directory to run the review in (passed via -C as a global Codex option)',
|
|
126
|
+
},
|
|
129
127
|
},
|
|
128
|
+
required: [],
|
|
129
|
+
},
|
|
130
|
+
annotations: {
|
|
131
|
+
title: 'Code Review',
|
|
132
|
+
readOnlyHint: true,
|
|
133
|
+
destructiveHint: false,
|
|
134
|
+
idempotentHint: true,
|
|
135
|
+
openWorldHint: true,
|
|
130
136
|
},
|
|
131
|
-
required: [],
|
|
132
|
-
},
|
|
133
|
-
annotations: {
|
|
134
|
-
title: 'Code Review',
|
|
135
|
-
readOnlyHint: true,
|
|
136
|
-
destructiveHint: false,
|
|
137
|
-
idempotentHint: true,
|
|
138
|
-
openWorldHint: true,
|
|
139
137
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
138
|
+
{
|
|
139
|
+
name: TOOLS.SPAWN_AGENT_GROUP,
|
|
140
|
+
description: buildAgentGroupDescription(),
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: 'object',
|
|
143
|
+
properties: {
|
|
144
|
+
agents: {
|
|
145
|
+
type: 'array',
|
|
146
|
+
description: 'Array of agent specifications. Each agent runs in the shared worktree.',
|
|
147
|
+
items: {
|
|
148
|
+
type: 'object',
|
|
149
|
+
properties: {
|
|
150
|
+
alias: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
description: 'Unique name for this agent within the group (letters, numbers, hyphens, underscores)',
|
|
153
|
+
},
|
|
154
|
+
prompt: {
|
|
155
|
+
type: 'string',
|
|
156
|
+
description: 'The task for this agent to perform',
|
|
157
|
+
},
|
|
158
|
+
role: {
|
|
159
|
+
type: 'string',
|
|
160
|
+
enum: ['coder', 'planner', 'tester', 'researcher'],
|
|
161
|
+
description: 'Agent role — applies a structured system prompt template',
|
|
162
|
+
},
|
|
163
|
+
specialization: {
|
|
164
|
+
type: 'string',
|
|
165
|
+
description: 'Specialization overlay for the role (e.g., typescript, react, playwright)',
|
|
166
|
+
},
|
|
167
|
+
context_files: {
|
|
168
|
+
type: 'array',
|
|
169
|
+
description: 'Context files for this agent. Max 20 files, 200KB each, 500KB total.',
|
|
170
|
+
items: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
properties: {
|
|
173
|
+
path: {
|
|
174
|
+
type: 'string',
|
|
175
|
+
description: 'Absolute file path',
|
|
176
|
+
},
|
|
177
|
+
description: {
|
|
178
|
+
type: 'string',
|
|
179
|
+
description: 'What this file is',
|
|
180
|
+
},
|
|
181
|
+
start_line: { type: 'integer' },
|
|
182
|
+
end_line: { type: 'integer' },
|
|
183
|
+
},
|
|
184
|
+
required: ['path'],
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
reasoningEffort: {
|
|
188
|
+
type: 'string',
|
|
189
|
+
enum: ['low', 'medium', 'high', 'xhigh'],
|
|
190
|
+
description: 'Reasoning depth for this agent. Defaults to xhigh.',
|
|
191
|
+
},
|
|
192
|
+
sandbox: {
|
|
193
|
+
type: 'string',
|
|
194
|
+
enum: ['read-only', 'workspace-write', 'danger-full-access'],
|
|
195
|
+
description: 'Sandbox policy. Defaults to danger-full-access.',
|
|
196
|
+
},
|
|
197
|
+
depends_on: {
|
|
198
|
+
type: 'array',
|
|
199
|
+
items: { type: 'string' },
|
|
200
|
+
description: 'Aliases of agents that must complete before this one starts',
|
|
201
|
+
},
|
|
202
|
+
maxAttempts: {
|
|
203
|
+
type: 'integer',
|
|
204
|
+
description: 'Max retry attempts (1-5). Default 2 (1 original + 1 retry).',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
required: ['alias', 'prompt'],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
commonContext: {
|
|
211
|
+
type: 'string',
|
|
212
|
+
description: 'Shared context prepended to every agent prompt (separated by ---)',
|
|
213
|
+
},
|
|
214
|
+
commonContextFiles: {
|
|
215
|
+
type: 'array',
|
|
216
|
+
description: "Shared context files merged into every agent's context_files",
|
|
217
|
+
items: {
|
|
218
|
+
type: 'object',
|
|
219
|
+
properties: {
|
|
220
|
+
path: { type: 'string', description: 'Absolute file path' },
|
|
221
|
+
description: {
|
|
222
|
+
type: 'string',
|
|
223
|
+
description: 'What this file is',
|
|
224
|
+
},
|
|
225
|
+
start_line: { type: 'integer' },
|
|
226
|
+
end_line: { type: 'integer' },
|
|
227
|
+
},
|
|
228
|
+
required: ['path'],
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
dependsOn: {
|
|
232
|
+
type: 'array',
|
|
233
|
+
items: { type: 'string' },
|
|
234
|
+
description: 'Group IDs that must complete before this group starts',
|
|
235
|
+
},
|
|
236
|
+
append: {
|
|
237
|
+
type: 'boolean',
|
|
238
|
+
description: 'If true, reuse an existing worktree instead of creating a new one',
|
|
239
|
+
},
|
|
240
|
+
appendToGroupTaskId: {
|
|
241
|
+
type: 'string',
|
|
242
|
+
description: 'Group ID whose worktree to reuse (required if append=true)',
|
|
243
|
+
},
|
|
244
|
+
groupName: {
|
|
245
|
+
type: 'string',
|
|
246
|
+
description: 'Optional human-readable name for this group',
|
|
247
|
+
},
|
|
248
|
+
workingDirectory: {
|
|
249
|
+
type: 'string',
|
|
250
|
+
description: 'Base working directory (default: server cwd)',
|
|
251
|
+
},
|
|
252
|
+
callbackUri: {
|
|
253
|
+
type: 'string',
|
|
254
|
+
description: 'Static MCP callback URI passed to each Codex agent',
|
|
255
|
+
},
|
|
150
256
|
},
|
|
257
|
+
required: ['agents'],
|
|
258
|
+
},
|
|
259
|
+
annotations: {
|
|
260
|
+
title: 'Spawn Agent Group',
|
|
261
|
+
readOnlyHint: false,
|
|
262
|
+
destructiveHint: true,
|
|
263
|
+
idempotentHint: false,
|
|
264
|
+
openWorldHint: true,
|
|
151
265
|
},
|
|
152
|
-
required: [],
|
|
153
|
-
},
|
|
154
|
-
annotations: {
|
|
155
|
-
title: 'Ping Server',
|
|
156
|
-
readOnlyHint: true,
|
|
157
|
-
destructiveHint: false,
|
|
158
|
-
idempotentHint: true,
|
|
159
|
-
openWorldHint: false,
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: TOOLS.HELP,
|
|
164
|
-
description: 'Get Codex CLI help information',
|
|
165
|
-
inputSchema: {
|
|
166
|
-
type: 'object',
|
|
167
|
-
properties: {},
|
|
168
|
-
required: [],
|
|
169
|
-
},
|
|
170
|
-
annotations: {
|
|
171
|
-
title: 'Get Help',
|
|
172
|
-
readOnlyHint: true,
|
|
173
|
-
destructiveHint: false,
|
|
174
|
-
idempotentHint: true,
|
|
175
|
-
openWorldHint: false,
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
name: TOOLS.LIST_SESSIONS,
|
|
180
|
-
description: 'List all active conversation sessions with metadata',
|
|
181
|
-
inputSchema: {
|
|
182
|
-
type: 'object',
|
|
183
|
-
properties: {},
|
|
184
|
-
required: [],
|
|
185
|
-
},
|
|
186
|
-
annotations: {
|
|
187
|
-
title: 'List Sessions',
|
|
188
|
-
readOnlyHint: true,
|
|
189
|
-
destructiveHint: false,
|
|
190
|
-
idempotentHint: true,
|
|
191
|
-
openWorldHint: false,
|
|
192
266
|
},
|
|
193
|
-
|
|
194
|
-
|
|
267
|
+
];
|
|
268
|
+
}
|
|
195
269
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAuB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/tools/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAuB,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL;YACE,IAAI,EAAE,KAAK,CAAC,cAAc;YAC1B,WAAW,EAAE,6BAA6B,EAAE;YAC5C,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,gDAAgD;qBAC9D;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC;wBAClD,WAAW,EACT,+KAA+K;qBAClL;oBACD,cAAc,EAAE;wBACd,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,8TAA8T;qBACjU;oBACD,aAAa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AAQ,EAAE,CAAC,QAAQ,CAAC;aACrB;YACD,WAAW,EAAE;gBACX,KAAK,EAAE,mBAAmB;gBAC1B,YAAY,EAAE,KAAK;gBACnB,eAAe,EAAE,IAAI;gBACrB,cAAc,EAAE,KAAK;gBACrB,aAAa,EAAE,IAAI;aACpB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic description builder for MCP tool definitions.
|
|
3
|
+
* Scans ~/.mcp-codex-subagent/templates/ to build rich descriptions
|
|
4
|
+
* that automatically reflect available roles and specializations.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Build the description for the spawn_subagent tool.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildSpawnSubagentDescription(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Build the description for the spawn_agent_group tool.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildAgentGroupDescription(): string;
|
|
14
|
+
/**
|
|
15
|
+
* Build the description for the code_review tool.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildCodeReviewDescription(): string;
|
|
18
|
+
//# sourceMappingURL=description-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-builder.d.ts","sourceRoot":"","sources":["../../src/tools/description-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,MAAM,CAwCtD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAiCnD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,MAAM,CAUnD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic description builder for MCP tool definitions.
|
|
3
|
+
* Scans ~/.mcp-codex-subagent/templates/ to build rich descriptions
|
|
4
|
+
* that automatically reflect available roles and specializations.
|
|
5
|
+
*/
|
|
6
|
+
import { discoverAvailableTemplates } from '../templates/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Build the description for the spawn_subagent tool.
|
|
9
|
+
*/
|
|
10
|
+
export function buildSpawnSubagentDescription() {
|
|
11
|
+
const { roles, specializations } = discoverAvailableTemplates();
|
|
12
|
+
const roleDescriptions = {
|
|
13
|
+
coder: 'coder: Implementation. Min 1000-char prompt + min 1 .md context file. Include: OBJECTIVE, FILES, CRITERIA, CONSTRAINTS, PATTERNS.',
|
|
14
|
+
planner: 'planner: Architecture/planning. Min 300-char prompt. Include: PROBLEM, CONSTRAINTS, SCOPE, OUTPUT.',
|
|
15
|
+
tester: 'tester: QA/testing. Min 300-char prompt + min 1 context file. Include: WHAT BUILT, FILES, CRITERIA, TESTS, EDGE CASES.',
|
|
16
|
+
researcher: 'researcher: Investigation. Min 200-char prompt. Include: TOPIC, QUESTIONS, HANDOFF TARGET.',
|
|
17
|
+
};
|
|
18
|
+
const roleSections = roles
|
|
19
|
+
.filter((r) => roleDescriptions[r])
|
|
20
|
+
.map((r) => `- ${roleDescriptions[r]}`)
|
|
21
|
+
.join('\n');
|
|
22
|
+
// Build specializations section dynamically
|
|
23
|
+
const specLines = [];
|
|
24
|
+
for (const role of roles) {
|
|
25
|
+
const specs = specializations[role];
|
|
26
|
+
if (specs && specs.length > 0) {
|
|
27
|
+
specLines.push(` ${role}: ${specs.join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const specSection = specLines.length > 0
|
|
31
|
+
? `\n\n**Specializations:** (from ~/.mcp-codex-subagent/templates/overlays/)\n${specLines.join('\n')}`
|
|
32
|
+
: '';
|
|
33
|
+
return `Execute Codex CLI agent. Model pinned to gpt-5.3-codex. Returns immediately with task_id — agent runs in background. Use reasoningEffort as the primary tuning knob.
|
|
34
|
+
|
|
35
|
+
**Roles:**
|
|
36
|
+
${roleSections}${specSection}
|
|
37
|
+
|
|
38
|
+
**Workflow:** researcher -> planner -> coder -> tester.
|
|
39
|
+
**Status:** Read resource \`task:///all\` or \`task:///{id}\`.`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Build the description for the spawn_agent_group tool.
|
|
43
|
+
*/
|
|
44
|
+
export function buildAgentGroupDescription() {
|
|
45
|
+
const { specializations } = discoverAvailableTemplates();
|
|
46
|
+
const specLines = [];
|
|
47
|
+
for (const [role, specs] of Object.entries(specializations)) {
|
|
48
|
+
if (specs && specs.length > 0) {
|
|
49
|
+
specLines.push(` ${role}: ${specs.join(', ')}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const specSection = specLines.length > 0
|
|
53
|
+
? `\n\n**Specializations:** (from ~/.mcp-codex-subagent/templates/overlays/)\n${specLines.join('\n')}`
|
|
54
|
+
: '';
|
|
55
|
+
return `Spawn a group of Codex agents that work in a shared Git worktree. Synchronous — blocks until all agents complete, timeout (30 min), or failure. Streams progress via MCP notifications.
|
|
56
|
+
|
|
57
|
+
**Key features:**
|
|
58
|
+
- Agents share a single Git worktree and branch (\`sub-agent/{group_id}\`)
|
|
59
|
+
- DAG-based scheduling: agents can depend on other agents via \`depends_on\`
|
|
60
|
+
- Global concurrency limit (default 20 parallel agents)
|
|
61
|
+
- Automatic retry on failure (default 2 attempts per agent)
|
|
62
|
+
- Commits all changes on success; no auto-merge
|
|
63
|
+
|
|
64
|
+
**Roles:**
|
|
65
|
+
- coder: Implementation (min 1000-char prompt + min 1 .md context file)
|
|
66
|
+
- planner: Architecture/planning (min 300-char prompt)
|
|
67
|
+
- tester: QA/testing (min 300-char prompt + min 1 context file)
|
|
68
|
+
- researcher: Investigation (min 200-char prompt)${specSection}
|
|
69
|
+
|
|
70
|
+
**Group dependencies:** Use \`dependsOn\` to chain groups sequentially.
|
|
71
|
+
**Append mode:** Use \`append: true\` + \`appendToGroupTaskId\` to add agents to an existing worktree.
|
|
72
|
+
**Status:** Read resource \`group:///{group_id}\` for detailed state.`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Build the description for the code_review tool.
|
|
76
|
+
*/
|
|
77
|
+
export function buildCodeReviewDescription() {
|
|
78
|
+
return `Run a code review against the current repository using Codex CLI. Read-only — never modifies files.
|
|
79
|
+
|
|
80
|
+
**Use this to:**
|
|
81
|
+
- Review uncommitted changes: \`{ "uncommitted": true }\`
|
|
82
|
+
- Review against a branch: \`{ "base": "main" }\`
|
|
83
|
+
- Review a specific commit: \`{ "commit": "abc123" }\`
|
|
84
|
+
- Custom focus: \`{ "base": "main", "prompt": "Focus on security" }\`
|
|
85
|
+
|
|
86
|
+
**Note:** \`prompt\` cannot be combined with \`uncommitted=true\`.`;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=description-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-builder.js","sourceRoot":"","sources":["../../src/tools/description-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;GAEG;AACH,MAAM,UAAU,6BAA6B;IAC3C,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAEhE,MAAM,gBAAgB,GAA2B;QAC/C,KAAK,EACH,mIAAmI;QACrI,OAAO,EACL,oGAAoG;QACtG,MAAM,EACJ,wHAAwH;QAC1H,UAAU,EACR,4FAA4F;KAC/F,CAAC;IAEF,MAAM,YAAY,GAAG,KAAK;SACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;SAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;SACtC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,4CAA4C;IAC5C,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAA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