mcp-codex-subagent 1.0.0 → 2.0.5
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/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +366 -4
- package/dist/server.js.map +1 -1
- package/dist/services/output-file.d.ts +38 -0
- package/dist/services/output-file.d.ts.map +1 -0
- package/dist/services/output-file.js +136 -0
- package/dist/services/output-file.js.map +1 -0
- package/dist/services/task-manager.d.ts +69 -0
- package/dist/services/task-manager.d.ts.map +1 -0
- package/dist/services/task-manager.js +171 -0
- package/dist/services/task-manager.js.map +1 -0
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/definitions.js +11 -2
- package/dist/tools/definitions.js.map +1 -1
- package/dist/tools/handlers.d.ts +2 -1
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/handlers.js +287 -116
- package/dist/tools/handlers.js.map +1 -1
- package/dist/types.d.ts +23 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/brief-validator.d.ts +34 -0
- package/dist/utils/brief-validator.d.ts.map +1 -0
- package/dist/utils/brief-validator.js +251 -0
- package/dist/utils/brief-validator.js.map +1 -0
- package/dist/utils/format.d.ts +34 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +40 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/task-id-generator.d.ts +15 -0
- package/dist/utils/task-id-generator.d.ts.map +1 -0
- package/dist/utils/task-id-generator.js +45 -0
- package/dist/utils/task-id-generator.js.map +1 -0
- package/package.json +15 -15
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates spawn tool prompts and context file requirements.
|
|
3
|
+
* Ported from mcp-supersubagents/src/utils/brief-validator.ts
|
|
4
|
+
*/
|
|
5
|
+
export interface ContextFile {
|
|
6
|
+
path: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BriefValidationError {
|
|
10
|
+
code: string;
|
|
11
|
+
message: string;
|
|
12
|
+
detail?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ValidationResult {
|
|
15
|
+
valid: boolean;
|
|
16
|
+
errors: BriefValidationError[];
|
|
17
|
+
}
|
|
18
|
+
interface RoleValidationRules {
|
|
19
|
+
roleName: string;
|
|
20
|
+
minPromptLength: number;
|
|
21
|
+
requireContextFiles: boolean;
|
|
22
|
+
minContextFiles: number;
|
|
23
|
+
requireMdExtension: boolean;
|
|
24
|
+
maxFileSizeBytes: number;
|
|
25
|
+
maxTotalSizeBytes: number;
|
|
26
|
+
briefTemplate: string;
|
|
27
|
+
workflowHint: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const VALIDATION_RULES: Record<string, RoleValidationRules>;
|
|
30
|
+
export declare function validateBrief(role: string, prompt: string, contextFiles?: ContextFile[]): Promise<ValidationResult>;
|
|
31
|
+
export declare function formatBriefValidationError(role: string, errors: BriefValidationError[]): string;
|
|
32
|
+
export declare function assemblePromptWithContext(prompt: string, contextFiles?: ContextFile[]): Promise<string>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=brief-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brief-validator.d.ts","sourceRoot":"","sources":["../../src/utils/brief-validator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AA6FD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAKhE,CAAC;AAIF,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,WAAW,EAAE,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAsG3B;AAID,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,CA4B/F;AAID,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2B7G"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates spawn tool prompts and context file requirements.
|
|
3
|
+
* Ported from mcp-supersubagents/src/utils/brief-validator.ts
|
|
4
|
+
*/
|
|
5
|
+
import { access, stat, readFile, constants } from 'fs/promises';
|
|
6
|
+
import { extname, isAbsolute } from 'path';
|
|
7
|
+
// --- Per-role validation rules ---
|
|
8
|
+
const MAX_FILE_SIZE = 200 * 1024; // 200KB per file
|
|
9
|
+
const MAX_TOTAL_SIZE = 500 * 1024; // 500KB total
|
|
10
|
+
const CODER_RULES = {
|
|
11
|
+
roleName: 'codex(role: "coder")',
|
|
12
|
+
minPromptLength: 1000,
|
|
13
|
+
requireContextFiles: true,
|
|
14
|
+
minContextFiles: 1,
|
|
15
|
+
requireMdExtension: true,
|
|
16
|
+
maxFileSizeBytes: MAX_FILE_SIZE,
|
|
17
|
+
maxTotalSizeBytes: MAX_TOTAL_SIZE,
|
|
18
|
+
briefTemplate: [
|
|
19
|
+
'OBJECTIVE: [What exactly to build/modify — specific deliverables, not vague goals]',
|
|
20
|
+
'FILES TO MODIFY: [ALL absolute file paths the agent needs to touch]',
|
|
21
|
+
'SUCCESS CRITERIA: [Exactly how to verify the implementation is correct]',
|
|
22
|
+
'CONSTRAINTS: [What NOT to do — boundaries, forbidden approaches, patterns to avoid]',
|
|
23
|
+
'PATTERNS TO FOLLOW: [Existing code patterns to match, utilities to reuse]',
|
|
24
|
+
'CONTEXT: [Background — why this matters, dependencies, architectural decisions]',
|
|
25
|
+
].join('\n'),
|
|
26
|
+
workflowHint: [
|
|
27
|
+
'RECOMMENDED WORKFLOW:',
|
|
28
|
+
'1. codex(role: "researcher") → investigate unknowns',
|
|
29
|
+
'2. codex(role: "planner") → creates plan',
|
|
30
|
+
'3. codex(role: "coder") → reference plan files in context_files',
|
|
31
|
+
'4. codex(role: "tester") → verify the implementation',
|
|
32
|
+
].join('\n'),
|
|
33
|
+
};
|
|
34
|
+
const PLANNER_RULES = {
|
|
35
|
+
roleName: 'codex(role: "planner")',
|
|
36
|
+
minPromptLength: 300,
|
|
37
|
+
requireContextFiles: false,
|
|
38
|
+
minContextFiles: 0,
|
|
39
|
+
requireMdExtension: false,
|
|
40
|
+
maxFileSizeBytes: MAX_FILE_SIZE,
|
|
41
|
+
maxTotalSizeBytes: MAX_TOTAL_SIZE,
|
|
42
|
+
briefTemplate: [
|
|
43
|
+
'PROBLEM STATEMENT: [What needs to be solved — the actual problem, not a solution]',
|
|
44
|
+
'CONSTRAINTS: [What\'s been ruled out, what must be preserved]',
|
|
45
|
+
'VERIFIED FACTS: [What you already know — don\'t re-investigate these]',
|
|
46
|
+
'SCOPE: [What\'s in/out of scope — be explicit]',
|
|
47
|
+
'EXPECTED OUTPUT: [What the next agent (Coder/Tester) needs from this plan]',
|
|
48
|
+
].join('\n'),
|
|
49
|
+
workflowHint: [
|
|
50
|
+
'TIP: Use planner output as context_files when spawning codex(role: "coder") next.',
|
|
51
|
+
].join('\n'),
|
|
52
|
+
};
|
|
53
|
+
const TESTER_RULES = {
|
|
54
|
+
roleName: 'codex(role: "tester")',
|
|
55
|
+
minPromptLength: 300,
|
|
56
|
+
requireContextFiles: true,
|
|
57
|
+
minContextFiles: 1,
|
|
58
|
+
requireMdExtension: false,
|
|
59
|
+
maxFileSizeBytes: MAX_FILE_SIZE,
|
|
60
|
+
maxTotalSizeBytes: MAX_TOTAL_SIZE,
|
|
61
|
+
briefTemplate: [
|
|
62
|
+
'WHAT WAS BUILT: [Feature/fix to verify — specific deliverable]',
|
|
63
|
+
'FILES CHANGED: [Where to focus testing — absolute paths]',
|
|
64
|
+
'SUCCESS CRITERIA: [What "working" means — specific, testable conditions]',
|
|
65
|
+
'TEST SUGGESTIONS: [Specific flows to test — happy path + edge cases]',
|
|
66
|
+
'EDGE CASES: [What the coder is worried about — potential failure points]',
|
|
67
|
+
'BASE URL / SETUP: [How to access the system under test]',
|
|
68
|
+
].join('\n'),
|
|
69
|
+
workflowHint: [
|
|
70
|
+
'TIP: Reference coder output files as context_files for the tester.',
|
|
71
|
+
].join('\n'),
|
|
72
|
+
};
|
|
73
|
+
const RESEARCHER_RULES = {
|
|
74
|
+
roleName: 'codex(role: "researcher")',
|
|
75
|
+
minPromptLength: 200,
|
|
76
|
+
requireContextFiles: false,
|
|
77
|
+
minContextFiles: 0,
|
|
78
|
+
requireMdExtension: false,
|
|
79
|
+
maxFileSizeBytes: MAX_FILE_SIZE,
|
|
80
|
+
maxTotalSizeBytes: MAX_TOTAL_SIZE,
|
|
81
|
+
briefTemplate: [
|
|
82
|
+
'WHAT TO RESEARCH: [Specific topic or question — not vague "research X"]',
|
|
83
|
+
'WHY IT MATTERS: [What decision this research informs]',
|
|
84
|
+
'WHAT\'S ALREADY KNOWN: [Don\'t re-research verified facts]',
|
|
85
|
+
'SPECIFIC QUESTIONS: [2-5 pointed, answerable questions]',
|
|
86
|
+
'HANDOFF TARGET: [Who reads the output — Planner? Coder? Human?]',
|
|
87
|
+
].join('\n'),
|
|
88
|
+
workflowHint: [
|
|
89
|
+
'TIP: Reference research output when spawning codex(role: "planner") or codex(role: "coder") next.',
|
|
90
|
+
].join('\n'),
|
|
91
|
+
};
|
|
92
|
+
export const VALIDATION_RULES = {
|
|
93
|
+
coder: CODER_RULES,
|
|
94
|
+
planner: PLANNER_RULES,
|
|
95
|
+
tester: TESTER_RULES,
|
|
96
|
+
researcher: RESEARCHER_RULES,
|
|
97
|
+
};
|
|
98
|
+
// --- Validation functions ---
|
|
99
|
+
export async function validateBrief(role, prompt, contextFiles) {
|
|
100
|
+
const rules = VALIDATION_RULES[role];
|
|
101
|
+
if (!rules)
|
|
102
|
+
return { valid: true, errors: [] };
|
|
103
|
+
const errors = [];
|
|
104
|
+
// 1. Prompt length check
|
|
105
|
+
if (prompt.length < rules.minPromptLength) {
|
|
106
|
+
errors.push({
|
|
107
|
+
code: 'PROMPT_TOO_SHORT',
|
|
108
|
+
message: `PROMPT TOO SHORT: ${prompt.length} characters (MINIMUM: ${rules.minPromptLength})`,
|
|
109
|
+
detail: `Your prompt MUST include these sections:\n${rules.briefTemplate}`,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// 2. Context files required check
|
|
113
|
+
const files = contextFiles || [];
|
|
114
|
+
if (rules.requireContextFiles && files.length < rules.minContextFiles) {
|
|
115
|
+
errors.push({
|
|
116
|
+
code: 'MISSING_CONTEXT_FILES',
|
|
117
|
+
message: `MISSING CONTEXT FILES: ${rules.roleName} REQUIRES at least ${rules.minContextFiles} file(s)`,
|
|
118
|
+
detail: rules.requireMdExtension
|
|
119
|
+
? 'Attach Markdown files (.md) — plan documents, specifications, or research findings.\nEach file must have an absolute path ending with .md'
|
|
120
|
+
: 'Attach relevant files — code, handoff documents, or specifications.\nEach file must have an absolute path.',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// 3. Validate each context file
|
|
124
|
+
let totalSize = 0;
|
|
125
|
+
for (const file of files) {
|
|
126
|
+
// Absolute path check
|
|
127
|
+
if (!isAbsolute(file.path)) {
|
|
128
|
+
errors.push({
|
|
129
|
+
code: 'RELATIVE_PATH',
|
|
130
|
+
message: `RELATIVE PATH: "${file.path}" — paths MUST be absolute (start with /)`,
|
|
131
|
+
detail: `Use the full absolute path, e.g. /Users/dev/project/${file.path}`,
|
|
132
|
+
});
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
// .md extension check (coder only)
|
|
136
|
+
if (rules.requireMdExtension && extname(file.path).toLowerCase() !== '.md') {
|
|
137
|
+
errors.push({
|
|
138
|
+
code: 'NOT_MARKDOWN',
|
|
139
|
+
message: `NOT A MARKDOWN FILE: "${file.path}" — ${rules.roleName} requires .md files`,
|
|
140
|
+
detail: 'Context files for the coder MUST be Markdown (.md) plan/specification documents.',
|
|
141
|
+
});
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
// File existence and readability check
|
|
145
|
+
try {
|
|
146
|
+
await access(file.path, constants.R_OK);
|
|
147
|
+
}
|
|
148
|
+
catch (err) {
|
|
149
|
+
const code = err?.code;
|
|
150
|
+
if (code === 'ENOENT') {
|
|
151
|
+
errors.push({
|
|
152
|
+
code: 'FILE_NOT_FOUND',
|
|
153
|
+
message: `FILE NOT FOUND: "${file.path}" does not exist`,
|
|
154
|
+
detail: 'Ensure the file path is correct and the file has been created.',
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
errors.push({
|
|
159
|
+
code: 'FILE_NOT_READABLE',
|
|
160
|
+
message: `FILE NOT READABLE: "${file.path}" exists but cannot be read`,
|
|
161
|
+
detail: 'Check file permissions. The MCP server needs read access to this file.',
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
// Size check
|
|
167
|
+
try {
|
|
168
|
+
const fileStat = await stat(file.path);
|
|
169
|
+
if (fileStat.size > rules.maxFileSizeBytes) {
|
|
170
|
+
errors.push({
|
|
171
|
+
code: 'FILE_TOO_LARGE',
|
|
172
|
+
message: `FILE TOO LARGE: "${file.path}" is ${Math.round(fileStat.size / 1024)}KB (max: ${Math.round(rules.maxFileSizeBytes / 1024)}KB)`,
|
|
173
|
+
});
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
totalSize += fileStat.size;
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
errors.push({
|
|
180
|
+
code: 'FILE_STAT_FAILED',
|
|
181
|
+
message: `FILE STAT FAILED: "${file.path}" — ${err instanceof Error ? err.message : 'unknown error'}`,
|
|
182
|
+
detail: 'The file exists but its metadata could not be read.',
|
|
183
|
+
});
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Total size check
|
|
188
|
+
if (totalSize > rules.maxTotalSizeBytes) {
|
|
189
|
+
errors.push({
|
|
190
|
+
code: 'TOTAL_SIZE_EXCEEDED',
|
|
191
|
+
message: `TOTAL FILE SIZE EXCEEDED: ${Math.round(totalSize / 1024)}KB (max: ${Math.round(rules.maxTotalSizeBytes / 1024)}KB)`,
|
|
192
|
+
detail: 'Reduce the number of context files or use smaller files.',
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return { valid: errors.length === 0, errors };
|
|
196
|
+
}
|
|
197
|
+
// --- Error message formatting ---
|
|
198
|
+
export function formatBriefValidationError(role, errors) {
|
|
199
|
+
const rules = VALIDATION_RULES[role];
|
|
200
|
+
if (!rules)
|
|
201
|
+
return errors.map(e => e.message).join('\n');
|
|
202
|
+
const parts = [
|
|
203
|
+
`❌ **VALIDATION FAILED — ${rules.roleName}**`,
|
|
204
|
+
'',
|
|
205
|
+
'**ISSUES FOUND:**',
|
|
206
|
+
];
|
|
207
|
+
for (const err of errors) {
|
|
208
|
+
parts.push(`• **${err.message}**`);
|
|
209
|
+
if (err.detail) {
|
|
210
|
+
for (const line of err.detail.split('\n')) {
|
|
211
|
+
parts.push(` ${line}`);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
parts.push('');
|
|
216
|
+
parts.push('**HOW TO FIX — Follow this brief template:**');
|
|
217
|
+
parts.push('```');
|
|
218
|
+
parts.push(rules.briefTemplate);
|
|
219
|
+
parts.push('```');
|
|
220
|
+
parts.push('');
|
|
221
|
+
parts.push(rules.workflowHint);
|
|
222
|
+
return parts.join('\n');
|
|
223
|
+
}
|
|
224
|
+
// --- Context file content assembly ---
|
|
225
|
+
export async function assemblePromptWithContext(prompt, contextFiles) {
|
|
226
|
+
if (!contextFiles || contextFiles.length === 0)
|
|
227
|
+
return prompt;
|
|
228
|
+
const sections = [prompt, '', '---', '', '## ATTACHED CONTEXT FILES', ''];
|
|
229
|
+
for (const file of contextFiles) {
|
|
230
|
+
sections.push(`### File: ${file.path}`);
|
|
231
|
+
if (file.description) {
|
|
232
|
+
sections.push(`> ${file.description}`);
|
|
233
|
+
}
|
|
234
|
+
sections.push('');
|
|
235
|
+
try {
|
|
236
|
+
const content = await readFile(file.path, 'utf-8');
|
|
237
|
+
const truncated = content.length > MAX_FILE_SIZE
|
|
238
|
+
? content.slice(0, MAX_FILE_SIZE) + '\n\n[... TRUNCATED — file exceeds 200KB limit ...]'
|
|
239
|
+
: content;
|
|
240
|
+
sections.push('```');
|
|
241
|
+
sections.push(truncated);
|
|
242
|
+
sections.push('```');
|
|
243
|
+
}
|
|
244
|
+
catch {
|
|
245
|
+
sections.push('> Could not read file contents');
|
|
246
|
+
}
|
|
247
|
+
sections.push('');
|
|
248
|
+
}
|
|
249
|
+
return sections.join('\n');
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=brief-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brief-validator.js","sourceRoot":"","sources":["../../src/utils/brief-validator.ts"],"names":[],"mappings":"AAAA;;;GAGG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AAC,WAAW,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAElB,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,aAAa;gBAC9C,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG,oDAAoD;gBACxF,CAAC,CAAC,OAAO,CAAC;YACZ,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzB,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAClD,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared formatting helpers for converting MCP tool responses to markdown.
|
|
3
|
+
* Ported from mcp-supersubagents/src/utils/format.ts
|
|
4
|
+
*/
|
|
5
|
+
/** Wraps a markdown string in the MCP response shape. */
|
|
6
|
+
export declare function mcpText(markdown: string): {
|
|
7
|
+
content: Array<{
|
|
8
|
+
type: 'text';
|
|
9
|
+
text: string;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
/** Display status in human-readable form: "rate_limited" -> "rate limited" */
|
|
13
|
+
export declare function displayStatus(status: string): string;
|
|
14
|
+
/** Standard error block with optional actionable hint. */
|
|
15
|
+
export declare function formatError(error: string, hint?: string): string;
|
|
16
|
+
/** MCP-compliant validation error response with isError: true. */
|
|
17
|
+
export declare function mcpValidationError(markdown: string): {
|
|
18
|
+
content: Array<{
|
|
19
|
+
type: 'text';
|
|
20
|
+
text: string;
|
|
21
|
+
}>;
|
|
22
|
+
isError: true;
|
|
23
|
+
};
|
|
24
|
+
/** MCP-compliant error response with optional actionable hint. */
|
|
25
|
+
export declare function mcpError(error: string, hint?: string): {
|
|
26
|
+
content: Array<{
|
|
27
|
+
type: 'text';
|
|
28
|
+
text: string;
|
|
29
|
+
}>;
|
|
30
|
+
isError: true;
|
|
31
|
+
};
|
|
32
|
+
/** Render a markdown table from headers and rows. */
|
|
33
|
+
export declare function formatTable(headers: string[], rows: string[][]): string;
|
|
34
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yDAAyD;AACzD,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CAE5F;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAEtH;AAED,kEAAkE;AAClE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAGxH;AAOD,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,CAKvE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared formatting helpers for converting MCP tool responses to markdown.
|
|
3
|
+
* Ported from mcp-supersubagents/src/utils/format.ts
|
|
4
|
+
*/
|
|
5
|
+
/** Wraps a markdown string in the MCP response shape. */
|
|
6
|
+
export function mcpText(markdown) {
|
|
7
|
+
return { content: [{ type: 'text', text: markdown }] };
|
|
8
|
+
}
|
|
9
|
+
/** Display status in human-readable form: "rate_limited" -> "rate limited" */
|
|
10
|
+
export function displayStatus(status) {
|
|
11
|
+
return status.replace(/_/g, ' ');
|
|
12
|
+
}
|
|
13
|
+
/** Standard error block with optional actionable hint. */
|
|
14
|
+
export function formatError(error, hint) {
|
|
15
|
+
const parts = [`**Error:** ${error}`];
|
|
16
|
+
if (hint)
|
|
17
|
+
parts.push('', hint);
|
|
18
|
+
return parts.join('\n');
|
|
19
|
+
}
|
|
20
|
+
/** MCP-compliant validation error response with isError: true. */
|
|
21
|
+
export function mcpValidationError(markdown) {
|
|
22
|
+
return { content: [{ type: 'text', text: markdown }], isError: true };
|
|
23
|
+
}
|
|
24
|
+
/** MCP-compliant error response with optional actionable hint. */
|
|
25
|
+
export function mcpError(error, hint) {
|
|
26
|
+
const text = hint ? `**Error:** ${error}\n\n${hint}` : `**Error:** ${error}`;
|
|
27
|
+
return { content: [{ type: 'text', text }], isError: true };
|
|
28
|
+
}
|
|
29
|
+
/** Escape pipe characters in table cell content. */
|
|
30
|
+
function escapeCell(value) {
|
|
31
|
+
return value.replace(/\|/g, '\\|');
|
|
32
|
+
}
|
|
33
|
+
/** Render a markdown table from headers and rows. */
|
|
34
|
+
export function formatTable(headers, rows) {
|
|
35
|
+
const headerRow = `| ${headers.map(escapeCell).join(' | ')} |`;
|
|
36
|
+
const separator = `|${headers.map(() => '------').join('|')}|`;
|
|
37
|
+
const dataRows = rows.map(r => `| ${r.map(escapeCell).join(' | ')} |`);
|
|
38
|
+
return [headerRow, separator, ...dataRows].join('\n');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yDAAyD;AACzD,MAAM,UAAU,OAAO,CAAC,QAAgB;IACtC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;AAClE,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACnC,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,WAAW,CAAC,KAAa,EAAE,IAAa;IACtD,MAAM,KAAK,GAAG,CAAC,cAAc,KAAK,EAAE,CAAC,CAAC;IACtC,IAAI,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;AAC1F,CAAC;AAED,kEAAkE;AAClE,MAAM,UAAU,QAAQ,CAAC,KAAa,EAAE,IAAa;IACnD,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,cAAc,KAAK,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,cAAc,KAAK,EAAE,CAAC;IAC7E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;AAChF,CAAC;AAED,oDAAoD;AACpD,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,WAAW,CAAC,OAAiB,EAAE,IAAgB;IAC7D,MAAM,SAAS,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IAC/D,MAAM,SAAS,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvE,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates human-readable task IDs like "brave-tiger-42".
|
|
3
|
+
* Ported from mcp-supersubagents/src/utils/task-id-generator.ts
|
|
4
|
+
* Uses inline word lists to avoid external dependency.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Generates human-readable task IDs like "brave-tiger-42" or "cosmic-falcon-17".
|
|
8
|
+
* Much easier to remember and communicate than UUIDs.
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateTaskId(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Normalizes task ID for case-insensitive lookups.
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeTaskId(taskId: string): string;
|
|
15
|
+
//# sourceMappingURL=task-id-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-id-generator.d.ts","sourceRoot":"","sources":["../../src/utils/task-id-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA4BH;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAKvC;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates human-readable task IDs like "brave-tiger-42".
|
|
3
|
+
* Ported from mcp-supersubagents/src/utils/task-id-generator.ts
|
|
4
|
+
* Uses inline word lists to avoid external dependency.
|
|
5
|
+
*/
|
|
6
|
+
const ADJECTIVES = [
|
|
7
|
+
'brave', 'calm', 'clever', 'cosmic', 'daring', 'eager', 'fast', 'gentle',
|
|
8
|
+
'happy', 'keen', 'lively', 'mighty', 'noble', 'proud', 'quick', 'sharp',
|
|
9
|
+
'silent', 'smooth', 'steady', 'swift', 'bold', 'bright', 'cool', 'crisp',
|
|
10
|
+
'dark', 'deep', 'fair', 'fierce', 'free', 'grand', 'green', 'iron',
|
|
11
|
+
'jade', 'kind', 'light', 'loud', 'neat', 'pale', 'prime', 'pure',
|
|
12
|
+
'rare', 'rich', 'safe', 'slim', 'soft', 'true', 'vast', 'warm',
|
|
13
|
+
'wild', 'wise', 'young', 'zinc', 'able', 'agile', 'amber', 'azure',
|
|
14
|
+
'coral', 'gold', 'ivory', 'lunar', 'neon', 'opal', 'plum', 'ruby',
|
|
15
|
+
];
|
|
16
|
+
const ANIMALS = [
|
|
17
|
+
'tiger', 'falcon', 'wolf', 'eagle', 'fox', 'hawk', 'bear', 'lion',
|
|
18
|
+
'shark', 'cobra', 'lynx', 'orca', 'raven', 'viper', 'crane', 'horse',
|
|
19
|
+
'panda', 'otter', 'bison', 'whale', 'stork', 'finch', 'heron', 'ibis',
|
|
20
|
+
'koala', 'lemur', 'moose', 'newt', 'okapi', 'quail', 'robin', 'snail',
|
|
21
|
+
'trout', 'gecko', 'hound', 'jaguar', 'manta', 'owl', 'pike', 'seal',
|
|
22
|
+
'swan', 'toad', 'wren', 'yak', 'zebu', 'ant', 'bat', 'cat',
|
|
23
|
+
'deer', 'dove', 'duck', 'elk', 'frog', 'goat', 'gull', 'hare',
|
|
24
|
+
'kite', 'lark', 'mole', 'moth', 'ox', 'parrot', 'ram', 'slug',
|
|
25
|
+
];
|
|
26
|
+
function pick(arr) {
|
|
27
|
+
return arr[Math.floor(Math.random() * arr.length)];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Generates human-readable task IDs like "brave-tiger-42" or "cosmic-falcon-17".
|
|
31
|
+
* Much easier to remember and communicate than UUIDs.
|
|
32
|
+
*/
|
|
33
|
+
export function generateTaskId() {
|
|
34
|
+
const adj = pick(ADJECTIVES);
|
|
35
|
+
const animal = pick(ANIMALS);
|
|
36
|
+
const num = Math.floor(Math.random() * 100);
|
|
37
|
+
return `${adj}-${animal}-${num}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Normalizes task ID for case-insensitive lookups.
|
|
41
|
+
*/
|
|
42
|
+
export function normalizeTaskId(taskId) {
|
|
43
|
+
return taskId.toLowerCase().trim();
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=task-id-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-id-generator.js","sourceRoot":"","sources":["../../src/utils/task-id-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,UAAU,GAAG;IACj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OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM;IACnE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IAC1D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAC7D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM;CAC9D,CAAC;AAEF,SAAS,IAAI,CAAI,GAAQ;IACvB,OAAO,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;IAC5C,OAAO,GAAG,GAAG,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-codex-subagent",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "MCP server for OpenAI Codex CLI with role-based templates, specialization overlays, and context file injection",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,19 +12,6 @@
|
|
|
12
12
|
"directories": {
|
|
13
13
|
"doc": "docs"
|
|
14
14
|
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "tsc && mkdir -p dist/templates/overlays && cp src/templates/*.mdx dist/templates/ && cp src/templates/overlays/*.mdx dist/templates/overlays/",
|
|
17
|
-
"start": "node dist/index.js",
|
|
18
|
-
"dev": "tsx src/index.ts",
|
|
19
|
-
"test": "jest",
|
|
20
|
-
"test:watch": "jest --watch",
|
|
21
|
-
"test:coverage": "jest --coverage",
|
|
22
|
-
"lint": "eslint src/**/*.ts",
|
|
23
|
-
"lint:fix": "eslint src/**/*.ts --fix",
|
|
24
|
-
"format": "prettier --write src/**/*.ts",
|
|
25
|
-
"format:check": "prettier --check src/**/*.ts",
|
|
26
|
-
"clean": "rm -rf dist"
|
|
27
|
-
},
|
|
28
15
|
"repository": {
|
|
29
16
|
"type": "git",
|
|
30
17
|
"url": "git+https://github.com/yigitkonur/mcp-codex-subagent.git"
|
|
@@ -66,5 +53,18 @@
|
|
|
66
53
|
"ts-jest": "^29.4.1",
|
|
67
54
|
"tsx": "^4.20.4",
|
|
68
55
|
"typescript": "^5.9.2"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc && mkdir -p dist/templates/overlays && cp src/templates/*.mdx dist/templates/ && cp src/templates/overlays/*.mdx dist/templates/overlays/",
|
|
59
|
+
"start": "node dist/index.js",
|
|
60
|
+
"dev": "tsx src/index.ts",
|
|
61
|
+
"test": "jest",
|
|
62
|
+
"test:watch": "jest --watch",
|
|
63
|
+
"test:coverage": "jest --coverage",
|
|
64
|
+
"lint": "eslint src/**/*.ts",
|
|
65
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
66
|
+
"format": "prettier --write src/**/*.ts",
|
|
67
|
+
"format:check": "prettier --check src/**/*.ts",
|
|
68
|
+
"clean": "rm -rf dist"
|
|
69
69
|
}
|
|
70
|
-
}
|
|
70
|
+
}
|