mcp-subagents-opencode 1.0.0
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/LICENSE +21 -0
- package/README.md +602 -0
- package/build/config/timeouts.d.ts +9 -0
- package/build/config/timeouts.d.ts.map +1 -0
- package/build/config/timeouts.js +18 -0
- package/build/config/timeouts.js.map +1 -0
- package/build/helpers.d.ts +6 -0
- package/build/helpers.d.ts.map +1 -0
- package/build/helpers.js +47 -0
- package/build/helpers.js.map +1 -0
- package/build/index.d.ts +3 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +245 -0
- package/build/index.js.map +1 -0
- package/build/models.d.ts +32 -0
- package/build/models.d.ts.map +1 -0
- package/build/models.js +58 -0
- package/build/models.js.map +1 -0
- package/build/server/register-notifications.d.ts +3 -0
- package/build/server/register-notifications.d.ts.map +1 -0
- package/build/server/register-notifications.js +77 -0
- package/build/server/register-notifications.js.map +1 -0
- package/build/server/register-resources.d.ts +3 -0
- package/build/server/register-resources.d.ts.map +1 -0
- package/build/server/register-resources.js +210 -0
- package/build/server/register-resources.js.map +1 -0
- package/build/server/register-retry-execution.d.ts +2 -0
- package/build/server/register-retry-execution.d.ts.map +1 -0
- package/build/server/register-retry-execution.js +28 -0
- package/build/server/register-retry-execution.js.map +1 -0
- package/build/server/register-tasks.d.ts +3 -0
- package/build/server/register-tasks.d.ts.map +1 -0
- package/build/server/register-tasks.js +52 -0
- package/build/server/register-tasks.js.map +1 -0
- package/build/server/register-tools.d.ts +3 -0
- package/build/server/register-tools.d.ts.map +1 -0
- package/build/server/register-tools.js +32 -0
- package/build/server/register-tools.js.map +1 -0
- package/build/server/resource-helpers.d.ts +21 -0
- package/build/server/resource-helpers.d.ts.map +1 -0
- package/build/server/resource-helpers.js +84 -0
- package/build/server/resource-helpers.js.map +1 -0
- package/build/services/account-manager.d.ts +88 -0
- package/build/services/account-manager.d.ts.map +1 -0
- package/build/services/account-manager.js +239 -0
- package/build/services/account-manager.js.map +1 -0
- package/build/services/claude-code-runner.d.ts +15 -0
- package/build/services/claude-code-runner.d.ts.map +1 -0
- package/build/services/claude-code-runner.js +475 -0
- package/build/services/claude-code-runner.js.map +1 -0
- package/build/services/client-context.d.ts +31 -0
- package/build/services/client-context.d.ts.map +1 -0
- package/build/services/client-context.js +44 -0
- package/build/services/client-context.js.map +1 -0
- package/build/services/exhaustion-fallback.d.ts +27 -0
- package/build/services/exhaustion-fallback.d.ts.map +1 -0
- package/build/services/exhaustion-fallback.js +30 -0
- package/build/services/exhaustion-fallback.js.map +1 -0
- package/build/services/fallback-orchestrator.d.ts +16 -0
- package/build/services/fallback-orchestrator.d.ts.map +1 -0
- package/build/services/fallback-orchestrator.js +48 -0
- package/build/services/fallback-orchestrator.js.map +1 -0
- package/build/services/opencode-client.d.ts +40 -0
- package/build/services/opencode-client.d.ts.map +1 -0
- package/build/services/opencode-client.js +147 -0
- package/build/services/opencode-client.js.map +1 -0
- package/build/services/opencode-spawner.d.ts +56 -0
- package/build/services/opencode-spawner.d.ts.map +1 -0
- package/build/services/opencode-spawner.js +426 -0
- package/build/services/opencode-spawner.js.map +1 -0
- package/build/services/output-file.d.ts +24 -0
- package/build/services/output-file.d.ts.map +1 -0
- package/build/services/output-file.js +90 -0
- package/build/services/output-file.js.map +1 -0
- package/build/services/progress-registry.d.ts +12 -0
- package/build/services/progress-registry.d.ts.map +1 -0
- package/build/services/progress-registry.js +97 -0
- package/build/services/progress-registry.js.map +1 -0
- package/build/services/question-registry.d.ts +79 -0
- package/build/services/question-registry.d.ts.map +1 -0
- package/build/services/question-registry.js +249 -0
- package/build/services/question-registry.js.map +1 -0
- package/build/services/retry-queue.d.ts +41 -0
- package/build/services/retry-queue.d.ts.map +1 -0
- package/build/services/retry-queue.js +195 -0
- package/build/services/retry-queue.js.map +1 -0
- package/build/services/sdk-client-manager.d.ts +149 -0
- package/build/services/sdk-client-manager.d.ts.map +1 -0
- package/build/services/sdk-client-manager.js +632 -0
- package/build/services/sdk-client-manager.js.map +1 -0
- package/build/services/sdk-session-adapter.d.ts +203 -0
- package/build/services/sdk-session-adapter.d.ts.map +1 -0
- package/build/services/sdk-session-adapter.js +1088 -0
- package/build/services/sdk-session-adapter.js.map +1 -0
- package/build/services/sdk-spawner.d.ts +42 -0
- package/build/services/sdk-spawner.d.ts.map +1 -0
- package/build/services/sdk-spawner.js +488 -0
- package/build/services/sdk-spawner.js.map +1 -0
- package/build/services/session-hooks.d.ts +24 -0
- package/build/services/session-hooks.d.ts.map +1 -0
- package/build/services/session-hooks.js +130 -0
- package/build/services/session-hooks.js.map +1 -0
- package/build/services/session-snapshot.d.ts +19 -0
- package/build/services/session-snapshot.d.ts.map +1 -0
- package/build/services/session-snapshot.js +203 -0
- package/build/services/session-snapshot.js.map +1 -0
- package/build/services/subscription-registry.d.ts +12 -0
- package/build/services/subscription-registry.d.ts.map +1 -0
- package/build/services/subscription-registry.js +27 -0
- package/build/services/subscription-registry.js.map +1 -0
- package/build/services/task-manager.d.ts +150 -0
- package/build/services/task-manager.d.ts.map +1 -0
- package/build/services/task-manager.js +765 -0
- package/build/services/task-manager.js.map +1 -0
- package/build/services/task-persistence.d.ts +29 -0
- package/build/services/task-persistence.d.ts.map +1 -0
- package/build/services/task-persistence.js +159 -0
- package/build/services/task-persistence.js.map +1 -0
- package/build/services/task-status-mapper.d.ts +21 -0
- package/build/services/task-status-mapper.d.ts.map +1 -0
- package/build/services/task-status-mapper.js +171 -0
- package/build/services/task-status-mapper.js.map +1 -0
- package/build/templates/index.d.ts +22 -0
- package/build/templates/index.d.ts.map +1 -0
- package/build/templates/index.js +147 -0
- package/build/templates/index.js.map +1 -0
- package/build/templates/overlays/coder-csharp.mdx +58 -0
- package/build/templates/overlays/coder-go.mdx +53 -0
- package/build/templates/overlays/coder-java.mdx +54 -0
- package/build/templates/overlays/coder-kotlin.mdx +56 -0
- package/build/templates/overlays/coder-nextjs.mdx +65 -0
- package/build/templates/overlays/coder-python.mdx +53 -0
- package/build/templates/overlays/coder-react.mdx +55 -0
- package/build/templates/overlays/coder-ruby.mdx +59 -0
- package/build/templates/overlays/coder-rust.mdx +48 -0
- package/build/templates/overlays/coder-supabase.mdx +268 -0
- package/build/templates/overlays/coder-supastarter.mdx +313 -0
- package/build/templates/overlays/coder-swift.mdx +56 -0
- package/build/templates/overlays/coder-tauri.mdx +566 -0
- package/build/templates/overlays/coder-triggerdev.mdx +296 -0
- package/build/templates/overlays/coder-typescript.mdx +45 -0
- package/build/templates/overlays/coder-vue.mdx +62 -0
- package/build/templates/overlays/planner-architecture.mdx +78 -0
- package/build/templates/overlays/planner-bugfix.mdx +36 -0
- package/build/templates/overlays/planner-feature.mdx +38 -0
- package/build/templates/overlays/planner-migration.mdx +50 -0
- package/build/templates/overlays/planner-refactor.mdx +57 -0
- package/build/templates/overlays/researcher-library.mdx +59 -0
- package/build/templates/overlays/researcher-performance.mdx +68 -0
- package/build/templates/overlays/researcher-security.mdx +86 -0
- package/build/templates/overlays/tester-graphql.mdx +191 -0
- package/build/templates/overlays/tester-playwright.mdx +621 -0
- package/build/templates/overlays/tester-rest.mdx +101 -0
- package/build/templates/overlays/tester-suite.mdx +177 -0
- package/build/templates/super-coder.mdx +529 -0
- package/build/templates/super-planner.mdx +568 -0
- package/build/templates/super-researcher.mdx +406 -0
- package/build/templates/super-tester.mdx +243 -0
- package/build/tools/answer-question.d.ts +30 -0
- package/build/tools/answer-question.d.ts.map +1 -0
- package/build/tools/answer-question.js +108 -0
- package/build/tools/answer-question.js.map +1 -0
- package/build/tools/cancel-task.d.ts +44 -0
- package/build/tools/cancel-task.d.ts.map +1 -0
- package/build/tools/cancel-task.js +144 -0
- package/build/tools/cancel-task.js.map +1 -0
- package/build/tools/send-message.d.ts +39 -0
- package/build/tools/send-message.d.ts.map +1 -0
- package/build/tools/send-message.js +124 -0
- package/build/tools/send-message.js.map +1 -0
- package/build/tools/shared-spawn.d.ts +56 -0
- package/build/tools/shared-spawn.d.ts.map +1 -0
- package/build/tools/shared-spawn.js +114 -0
- package/build/tools/shared-spawn.js.map +1 -0
- package/build/tools/spawn-agent.d.ts +85 -0
- package/build/tools/spawn-agent.d.ts.map +1 -0
- package/build/tools/spawn-agent.js +133 -0
- package/build/tools/spawn-agent.js.map +1 -0
- package/build/tools/spawn-coder.d.ts +70 -0
- package/build/tools/spawn-coder.d.ts.map +1 -0
- package/build/tools/spawn-coder.js +71 -0
- package/build/tools/spawn-coder.js.map +1 -0
- package/build/tools/spawn-planner.d.ts +70 -0
- package/build/tools/spawn-planner.d.ts.map +1 -0
- package/build/tools/spawn-planner.js +71 -0
- package/build/tools/spawn-planner.js.map +1 -0
- package/build/tools/spawn-researcher.d.ts +70 -0
- package/build/tools/spawn-researcher.d.ts.map +1 -0
- package/build/tools/spawn-researcher.js +70 -0
- package/build/tools/spawn-researcher.js.map +1 -0
- package/build/tools/spawn-task.d.ts +74 -0
- package/build/tools/spawn-task.d.ts.map +1 -0
- package/build/tools/spawn-task.js +107 -0
- package/build/tools/spawn-task.js.map +1 -0
- package/build/tools/spawn-tester.d.ts +70 -0
- package/build/tools/spawn-tester.d.ts.map +1 -0
- package/build/tools/spawn-tester.js +69 -0
- package/build/tools/spawn-tester.js.map +1 -0
- package/build/types.d.ts +101 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +28 -0
- package/build/types.js.map +1 -0
- package/build/utils/brief-validator.d.ts +30 -0
- package/build/utils/brief-validator.d.ts.map +1 -0
- package/build/utils/brief-validator.js +254 -0
- package/build/utils/brief-validator.js.map +1 -0
- package/build/utils/format.d.ts +34 -0
- package/build/utils/format.d.ts.map +1 -0
- package/build/utils/format.js +55 -0
- package/build/utils/format.js.map +1 -0
- package/build/utils/sanitize.d.ts +240 -0
- package/build/utils/sanitize.d.ts.map +1 -0
- package/build/utils/sanitize.js +89 -0
- package/build/utils/sanitize.js.map +1 -0
- package/build/utils/task-id-generator.d.ts +10 -0
- package/build/utils/task-id-generator.d.ts.map +1 -0
- package/build/utils/task-id-generator.js +22 -0
- package/build/utils/task-id-generator.js.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared spawn logic used by all spawn tool handlers.
|
|
3
|
+
* Ported from mcp-supersubagents, adapted for OpenCode.
|
|
4
|
+
*/
|
|
5
|
+
import { spawnOpenCodeTask } from '../services/opencode-spawner.js';
|
|
6
|
+
import { taskManager } from '../services/task-manager.js';
|
|
7
|
+
import { applyTemplate, isValidTaskType } from '../templates/index.js';
|
|
8
|
+
import { progressRegistry } from '../services/progress-registry.js';
|
|
9
|
+
import { TaskStatus } from '../types.js';
|
|
10
|
+
import { mcpText, mcpValidationError } from '../utils/format.js';
|
|
11
|
+
import { validateBrief, formatValidationError, assemblePromptWithContext, } from '../utils/brief-validator.js';
|
|
12
|
+
/**
|
|
13
|
+
* Generic factory that creates a spawn tool handler.
|
|
14
|
+
*/
|
|
15
|
+
export function createSpawnHandler(config) {
|
|
16
|
+
return async (args, ctx) => {
|
|
17
|
+
let parsed;
|
|
18
|
+
try {
|
|
19
|
+
parsed = config.schema.parse(args);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
return mcpValidationError(`**SCHEMA VALIDATION FAILED -- ${config.toolName}**\n\n${error instanceof Error ? error.message : 'Invalid arguments'}\n\n${config.validationHint}`);
|
|
23
|
+
}
|
|
24
|
+
return handleSharedSpawn({
|
|
25
|
+
prompt: parsed.prompt,
|
|
26
|
+
context_files: parsed.context_files,
|
|
27
|
+
model: config.getModel?.(parsed) ?? parsed.model,
|
|
28
|
+
cwd: parsed.cwd,
|
|
29
|
+
timeout: parsed.timeout,
|
|
30
|
+
autonomous: parsed.autonomous,
|
|
31
|
+
depends_on: parsed.depends_on,
|
|
32
|
+
labels: parsed.labels,
|
|
33
|
+
}, {
|
|
34
|
+
toolName: config.toolName,
|
|
35
|
+
taskType: config.getTaskType?.(parsed) ?? config.taskType,
|
|
36
|
+
specialization: config.getSpecialization?.(parsed),
|
|
37
|
+
}, ctx);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Shared spawn handler used by all spawn tools.
|
|
42
|
+
* Performs: brief validation -> context file assembly -> template application -> task spawn.
|
|
43
|
+
*/
|
|
44
|
+
export async function handleSharedSpawn(params, config, ctx) {
|
|
45
|
+
// 1. Validate the brief
|
|
46
|
+
const validation = await validateBrief(config.toolName, params.prompt, params.context_files);
|
|
47
|
+
if (!validation.valid) {
|
|
48
|
+
return mcpValidationError(formatValidationError(config.toolName, validation.errors));
|
|
49
|
+
}
|
|
50
|
+
// 2. Validate dependencies if provided
|
|
51
|
+
const dependsOn = params.depends_on?.filter((d) => d.trim()) || [];
|
|
52
|
+
if (dependsOn.length > 0) {
|
|
53
|
+
const depError = taskManager.validateDependencies(dependsOn);
|
|
54
|
+
if (depError) {
|
|
55
|
+
return mcpValidationError(`**DEPENDENCY ERROR:** ${depError}\n\nEnsure all dependency task IDs exist. Read resource \`task:///all\` to find valid task IDs.`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// 3. Assemble prompt with context file contents
|
|
59
|
+
const enrichedPrompt = await assemblePromptWithContext(params.prompt, params.context_files);
|
|
60
|
+
// 4. Apply matryoshka template (base + specialization overlay)
|
|
61
|
+
const finalPrompt = config.taskType && isValidTaskType(config.taskType)
|
|
62
|
+
? applyTemplate(config.taskType, enrichedPrompt, config.specialization)
|
|
63
|
+
: enrichedPrompt;
|
|
64
|
+
// 5. Spawn the task
|
|
65
|
+
const labels = params.labels?.filter((l) => l.trim()) || [];
|
|
66
|
+
try {
|
|
67
|
+
const taskId = await spawnOpenCodeTask({
|
|
68
|
+
prompt: finalPrompt,
|
|
69
|
+
timeout: params.timeout,
|
|
70
|
+
cwd: params.cwd,
|
|
71
|
+
model: params.model,
|
|
72
|
+
autonomous: params.autonomous,
|
|
73
|
+
dependsOn: dependsOn.length > 0 ? dependsOn : undefined,
|
|
74
|
+
labels: labels.length > 0 ? labels : undefined,
|
|
75
|
+
taskType: config.taskType || 'super-coder',
|
|
76
|
+
});
|
|
77
|
+
const task = taskManager.getTask(taskId);
|
|
78
|
+
const isWaiting = task?.status === TaskStatus.WAITING;
|
|
79
|
+
if (ctx?.progressToken != null) {
|
|
80
|
+
progressRegistry.register(taskId, ctx.progressToken, ctx.sendNotification);
|
|
81
|
+
progressRegistry.sendProgress(taskId, `Task created: ${taskId}, status: ${task?.status || 'pending'}`);
|
|
82
|
+
}
|
|
83
|
+
if (isWaiting) {
|
|
84
|
+
const depsList = dependsOn.map(d => `\`${d}\``).join(', ');
|
|
85
|
+
const parts = [
|
|
86
|
+
`**Task queued (waiting for dependencies)**`,
|
|
87
|
+
`task_id: \`${taskId}\``,
|
|
88
|
+
task?.outputFilePath ? `output_file: \`${task.outputFilePath}\`` : null,
|
|
89
|
+
'',
|
|
90
|
+
`**Waiting on:** ${depsList}`,
|
|
91
|
+
'',
|
|
92
|
+
'Task will auto-start when dependencies complete. Continue with other work.',
|
|
93
|
+
].filter(Boolean);
|
|
94
|
+
return mcpText(parts.join('\n'));
|
|
95
|
+
}
|
|
96
|
+
const parts = [
|
|
97
|
+
`**Task launched** (${config.toolName})`,
|
|
98
|
+
`task_id: \`${taskId}\``,
|
|
99
|
+
task?.outputFilePath ? `output_file: \`${task.outputFilePath}\`` : null,
|
|
100
|
+
'',
|
|
101
|
+
'The agent is working in the background. MCP notifications will alert on completion.',
|
|
102
|
+
'',
|
|
103
|
+
'**Optional progress check:**',
|
|
104
|
+
task?.outputFilePath ? `- \`tail -20 ${task.outputFilePath}\` -- Last 20 lines` : null,
|
|
105
|
+
task?.outputFilePath ? `- \`wc -l ${task.outputFilePath}\` -- Line count` : null,
|
|
106
|
+
`- Read resource: \`task:///${taskId}\``,
|
|
107
|
+
].filter(Boolean);
|
|
108
|
+
return mcpText(parts.join('\n'));
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
return mcpValidationError(`**SPAWN ERROR:** ${error instanceof Error ? error.message : 'Unknown error'}\n\nCheck that all parameters are valid and try again.`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=shared-spawn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-spawn.js","sourceRoot":"","sources":["../../src/tools/shared-spawn.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,eAAe,EAAiB,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,yBAAyB,GAE1B,MAAM,6BAA6B,CAAC;AA+BrC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAA6B;IAE7B,OAAO,KAAK,EAAE,IAAa,EAAE,GAAiB,EAAsB,EAAE;QACpE,IAAI,MAAS,CAAC;QACd,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,kBAAkB,CACvB,iCAAiC,MAAM,CAAC,QAAQ,SAAS,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,OAAO,MAAM,CAAC,cAAc,EAAE,CACpJ,CAAC;QACJ,CAAC;QAED,OAAO,iBAAiB,CACtB;YACE,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,KAAK,EAAE,MAAM,CAAC,QAAQ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AAO,CAAC,CAAC;QAClB,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,kBAAkB,CACvB,oBAAoB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,wDAAwD,CACrI,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spawn Agent Tool - Unified spawn: role=coder|planner|tester|researcher.
|
|
3
|
+
* Ported from mcp-supersubagents, adapted for OpenCode.
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolContext } from '../types.js';
|
|
6
|
+
export declare const spawnAgentTool: {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object";
|
|
11
|
+
properties: {
|
|
12
|
+
role: {
|
|
13
|
+
type: string;
|
|
14
|
+
enum: ("coder" | "planner" | "tester" | "researcher")[];
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
prompt: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
context_files: {
|
|
22
|
+
type: string;
|
|
23
|
+
items: {
|
|
24
|
+
type: string;
|
|
25
|
+
properties: {
|
|
26
|
+
path: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
description: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
required: string[];
|
|
36
|
+
};
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
specialization: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
model: {
|
|
44
|
+
type: string;
|
|
45
|
+
enum: ("claude-sonnet-4.5" | "claude-opus-4.6" | "claude-haiku-4.5")[];
|
|
46
|
+
description: string;
|
|
47
|
+
};
|
|
48
|
+
cwd: {
|
|
49
|
+
type: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
timeout: {
|
|
53
|
+
type: string;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
autonomous: {
|
|
57
|
+
type: string;
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
depends_on: {
|
|
61
|
+
type: string;
|
|
62
|
+
items: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
labels: {
|
|
68
|
+
type: string;
|
|
69
|
+
items: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
required: string[];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare function handleSpawnAgent(args: unknown, ctx?: ToolContext): Promise<{
|
|
79
|
+
content: Array<{
|
|
80
|
+
type: string;
|
|
81
|
+
text: string;
|
|
82
|
+
}>;
|
|
83
|
+
isError?: true;
|
|
84
|
+
}>;
|
|
85
|
+
//# sourceMappingURL=spawn-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-agent.d.ts","sourceRoot":"","sources":["../../src/tools/spawn-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AA0C/C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8D1B,CAAC;AAIF,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,OAAO,EACb,GAAG,CAAC,EAAE,WAAW,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,CAuC7E"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spawn Agent Tool - Unified spawn: role=coder|planner|tester|researcher.
|
|
3
|
+
* Ported from mcp-supersubagents, adapted for OpenCode.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { ALL_ACCEPTED_MODELS, MODEL_IDS, DEFAULT_MODEL, OPUS_MODEL } from '../models.js';
|
|
7
|
+
import { handleSharedSpawn } from './shared-spawn.js';
|
|
8
|
+
import { mcpValidationError } from '../utils/format.js';
|
|
9
|
+
import { TASK_TIMEOUT_DEFAULT_MS, TASK_TIMEOUT_MAX_MS, TASK_TIMEOUT_MIN_MS, } from '../config/timeouts.js';
|
|
10
|
+
// --- Role definitions ---
|
|
11
|
+
const ROLES = ['coder', 'planner', 'tester', 'researcher'];
|
|
12
|
+
const ROLE_TO_TASK_TYPE = {
|
|
13
|
+
coder: 'super-coder',
|
|
14
|
+
planner: 'super-planner',
|
|
15
|
+
tester: 'super-tester',
|
|
16
|
+
researcher: 'super-researcher',
|
|
17
|
+
};
|
|
18
|
+
// --- Zod schema ---
|
|
19
|
+
const contextFileSchema = z.object({
|
|
20
|
+
path: z.string().min(1),
|
|
21
|
+
description: z.string().max(2000).optional(),
|
|
22
|
+
});
|
|
23
|
+
const SpawnAgentSchema = z.object({
|
|
24
|
+
role: z.enum(ROLES),
|
|
25
|
+
prompt: z.string().min(1).max(100000),
|
|
26
|
+
context_files: z.array(contextFileSchema).max(20).optional(),
|
|
27
|
+
specialization: z.string().optional(),
|
|
28
|
+
model: z.enum(ALL_ACCEPTED_MODELS).optional(),
|
|
29
|
+
cwd: z.string().optional(),
|
|
30
|
+
timeout: z.number().int().min(TASK_TIMEOUT_MIN_MS).max(TASK_TIMEOUT_MAX_MS).default(TASK_TIMEOUT_DEFAULT_MS).optional(),
|
|
31
|
+
autonomous: z.boolean().default(true).optional(),
|
|
32
|
+
depends_on: z.array(z.string().min(1)).optional(),
|
|
33
|
+
labels: z.array(z.string().min(1).max(50)).max(10).optional(),
|
|
34
|
+
});
|
|
35
|
+
// --- Tool definition ---
|
|
36
|
+
export const spawnAgentTool = {
|
|
37
|
+
name: 'spawn_agent',
|
|
38
|
+
description: `Spawn an autonomous AI agent via OpenCode. Runs isolated -- prompt + context_files are its ONLY context.
|
|
39
|
+
|
|
40
|
+
**Roles:**
|
|
41
|
+
- coder: Implementation. Min 1000-char prompt + min 1 .md context file. Include: OBJECTIVE, FILES, CRITERIA, CONSTRAINTS, PATTERNS.
|
|
42
|
+
- planner: Architecture/planning. Min 300-char prompt. Always uses opus. Include: PROBLEM, CONSTRAINTS, SCOPE, OUTPUT.
|
|
43
|
+
- tester: QA/testing. Min 300-char prompt + min 1 context file. Include: WHAT BUILT, FILES, CRITERIA, TESTS, EDGE CASES.
|
|
44
|
+
- researcher: Investigation. Min 200-char prompt. Include: TOPIC, QUESTIONS, HANDOFF TARGET.
|
|
45
|
+
|
|
46
|
+
**Workflow:** researcher -> planner -> coder -> tester. Chain with depends_on.
|
|
47
|
+
**Status:** Read resource \`task:///all\` or \`task:///{id}\`.`,
|
|
48
|
+
inputSchema: {
|
|
49
|
+
type: 'object',
|
|
50
|
+
properties: {
|
|
51
|
+
role: {
|
|
52
|
+
type: 'string',
|
|
53
|
+
enum: [...ROLES],
|
|
54
|
+
description: 'Agent role: coder, planner, tester, or researcher.',
|
|
55
|
+
},
|
|
56
|
+
prompt: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'Complete self-contained instructions for the agent. Min length varies by role.',
|
|
59
|
+
},
|
|
60
|
+
context_files: {
|
|
61
|
+
type: 'array',
|
|
62
|
+
items: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
path: { type: 'string', description: 'Absolute file path.' },
|
|
66
|
+
description: { type: 'string', description: 'What this file contains.' },
|
|
67
|
+
},
|
|
68
|
+
required: ['path'],
|
|
69
|
+
},
|
|
70
|
+
description: 'Context files. Required for coder (min 1 .md) and tester (min 1). Max 20 files, 200KB each, 500KB total.',
|
|
71
|
+
},
|
|
72
|
+
specialization: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
description: 'Role-specific specialization. coder: typescript/python/react/etc. planner: feature/bugfix/migration/etc. tester: playwright/rest/suite/etc. researcher: security/library/performance/etc.',
|
|
75
|
+
},
|
|
76
|
+
model: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
enum: MODEL_IDS,
|
|
79
|
+
description: `Model. Default: ${DEFAULT_MODEL}. Planner always uses ${OPUS_MODEL} regardless.`,
|
|
80
|
+
},
|
|
81
|
+
cwd: { type: 'string', description: 'Working directory (absolute path).' },
|
|
82
|
+
timeout: { type: 'number', description: `Max duration in ms. Default: ${TASK_TIMEOUT_DEFAULT_MS}. Max: ${TASK_TIMEOUT_MAX_MS}.` },
|
|
83
|
+
autonomous: { type: 'boolean', description: 'Run without asking for confirmation. Default: true.' },
|
|
84
|
+
depends_on: {
|
|
85
|
+
type: 'array',
|
|
86
|
+
items: { type: 'string' },
|
|
87
|
+
description: 'Task IDs that must complete before this task starts.',
|
|
88
|
+
},
|
|
89
|
+
labels: {
|
|
90
|
+
type: 'array',
|
|
91
|
+
items: { type: 'string' },
|
|
92
|
+
description: 'Labels for grouping/filtering (max 10, 50 chars each).',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
required: ['role', 'prompt'],
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
// --- Handler ---
|
|
99
|
+
export async function handleSpawnAgent(args, ctx) {
|
|
100
|
+
let parsed;
|
|
101
|
+
try {
|
|
102
|
+
parsed = SpawnAgentSchema.parse(args);
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
return mcpValidationError(`**SCHEMA VALIDATION FAILED -- spawn_agent**\n\n${error instanceof Error ? error.message : 'Invalid arguments'}\n\nRequired: role (coder|planner|tester|researcher) + prompt (string).`);
|
|
106
|
+
}
|
|
107
|
+
const role = parsed.role;
|
|
108
|
+
const taskType = ROLE_TO_TASK_TYPE[role];
|
|
109
|
+
// Planner always uses opus regardless of user input
|
|
110
|
+
const model = role === 'planner' ? OPUS_MODEL : parsed.model;
|
|
111
|
+
const params = {
|
|
112
|
+
prompt: parsed.prompt,
|
|
113
|
+
context_files: parsed.context_files,
|
|
114
|
+
model,
|
|
115
|
+
cwd: parsed.cwd,
|
|
116
|
+
timeout: parsed.timeout,
|
|
117
|
+
autonomous: parsed.autonomous,
|
|
118
|
+
depends_on: parsed.depends_on,
|
|
119
|
+
labels: parsed.labels,
|
|
120
|
+
};
|
|
121
|
+
const config = {
|
|
122
|
+
toolName: `spawn_agent`,
|
|
123
|
+
taskType,
|
|
124
|
+
specialization: parsed.specialization,
|
|
125
|
+
};
|
|
126
|
+
// Use the role name for brief validation
|
|
127
|
+
const validationConfig = {
|
|
128
|
+
...config,
|
|
129
|
+
toolName: role,
|
|
130
|
+
};
|
|
131
|
+
return handleSharedSpawn(params, validationConfig, ctx);
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=spawn-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-agent.js","sourceRoot":"","sources":["../../src/tools/spawn-agent.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzF,OAAO,EAAE,iBAAiB,EAAgD,MAAM,mBAAmB,CAAC;AAGpG,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,2BAA2B;AAE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AAM,EAAE,MAAM,CAAC,MAAM;QACrB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,KAAK;QACL,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;IAEF,MAAM,MAAM,GAAoB;QAC9B,QAAQ,EAAE,aAAa;QACvB,QAAQ;QACR,cAAc,EAAE,MAAM,CAAC,cAAc;KACtC,CAAC;IAEF,yCAAyC;IACzC,MAAM,gBAAgB,GAAoB;QACxC,GAAG,MAAM;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IAEF,OAAO,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const spawnCoderTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
prompt: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
context_files: {
|
|
12
|
+
type: string;
|
|
13
|
+
items: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: {
|
|
16
|
+
path: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
description: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
required: string[];
|
|
26
|
+
};
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
language: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: ("typescript" | "python" | "rust" | "go" | "java" | "ruby" | "swift" | "csharp" | "kotlin" | "react" | "nextjs" | "vue" | "supabase" | "tauri" | "triggerdev" | "supastarter" | "general")[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
model: {
|
|
35
|
+
type: string;
|
|
36
|
+
enum: ("claude-opus-4.6" | "claude-haiku-4.5" | "claude-sonnet-4.5")[];
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
cwd: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
timeout: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
autonomous: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
depends_on: {
|
|
52
|
+
type: string;
|
|
53
|
+
items: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
labels: {
|
|
59
|
+
type: string;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const handleSpawnCoder: (args: unknown, ctx?: import("../types.js").ToolContext) => import("./shared-spawn.js").SpawnHandlerResult;
|
|
70
|
+
//# sourceMappingURL=spawn-coder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-coder.d.ts","sourceRoot":"","sources":["../../src/tools/spawn-coder.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,4GAM3B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SpawnCoderSchema, CODER_LANGUAGES } from '../utils/sanitize.js';
|
|
2
|
+
import { MODEL_IDS, DEFAULT_MODEL } from '../models.js';
|
|
3
|
+
import { createSpawnHandler } from './shared-spawn.js';
|
|
4
|
+
export const spawnCoderTool = {
|
|
5
|
+
name: 'spawn_coder',
|
|
6
|
+
description: `Spawn an autonomous coding agent. Runs isolated — your brief + context_files are its ONLY context.
|
|
7
|
+
|
|
8
|
+
**Required:** prompt (min 1000 chars) + context_files (min 1 .md file).
|
|
9
|
+
|
|
10
|
+
**Prompt must include:** OBJECTIVE (what to build), FILES TO MODIFY (absolute paths), SUCCESS CRITERIA (testable), CONSTRAINTS (what NOT to do), PATTERNS TO FOLLOW (reference files).
|
|
11
|
+
|
|
12
|
+
**Cross-reference outputs:**
|
|
13
|
+
- Planner: \`.agent-workspace/plans/[topic]/05-handoff/builder-briefing.md\`
|
|
14
|
+
- Researcher: \`.agent-workspace/researches/[topic]/HANDOFF.md\`
|
|
15
|
+
|
|
16
|
+
**Workflow:** spawn_planner → spawn_coder → spawn_tester. Use \`depends_on\` to chain.
|
|
17
|
+
Check status: \`task:///all\` or \`task:///{id}\``,
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: 'object',
|
|
20
|
+
properties: {
|
|
21
|
+
prompt: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: `Min 1000 chars. Complete implementation brief: OBJECTIVE, FILES TO MODIFY (absolute paths), SUCCESS CRITERIA, CONSTRAINTS, PATTERNS TO FOLLOW, CONTEXT. Agent cannot see your conversation — everything must be in the prompt.`,
|
|
24
|
+
},
|
|
25
|
+
context_files: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
path: { type: 'string', description: 'Absolute path to a .md file.' },
|
|
31
|
+
description: { type: 'string', description: 'What this file contains.' },
|
|
32
|
+
},
|
|
33
|
+
required: ['path'],
|
|
34
|
+
},
|
|
35
|
+
description: `Min 1 Markdown (.md) file required. Attach planner handoffs, specs, or your own brief. Max 20 files, 200KB each, 500KB total.`,
|
|
36
|
+
},
|
|
37
|
+
language: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
enum: [...CODER_LANGUAGES],
|
|
40
|
+
description: `Language/framework specialization overlay. Languages: typescript, python, rust, go, java, ruby, swift, csharp, kotlin. Frameworks: react, nextjs, vue, supabase, tauri, triggerdev, supastarter. Default: general (infers from codebase).`,
|
|
41
|
+
},
|
|
42
|
+
model: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
enum: MODEL_IDS,
|
|
45
|
+
description: `Default: ${DEFAULT_MODEL}. Use claude-haiku-4.5 for simple single-file changes.`,
|
|
46
|
+
},
|
|
47
|
+
cwd: { type: 'string', description: 'Absolute path to working directory.' },
|
|
48
|
+
timeout: { type: 'number', description: 'Max ms. Default: 1800000 (30min).' },
|
|
49
|
+
autonomous: { type: 'boolean', description: 'Default: true.' },
|
|
50
|
+
depends_on: {
|
|
51
|
+
type: 'array',
|
|
52
|
+
items: { type: 'string' },
|
|
53
|
+
description: 'Task IDs that must complete first.',
|
|
54
|
+
},
|
|
55
|
+
labels: {
|
|
56
|
+
type: 'array',
|
|
57
|
+
items: { type: 'string' },
|
|
58
|
+
description: 'Labels for grouping (max 10).',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
required: ['prompt', 'context_files'],
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export const handleSpawnCoder = createSpawnHandler({
|
|
65
|
+
schema: SpawnCoderSchema,
|
|
66
|
+
toolName: 'spawn_coder',
|
|
67
|
+
taskType: 'super-coder',
|
|
68
|
+
validationHint: 'Required: `prompt` (min 1000 chars) + `context_files` (min 1 .md file).',
|
|
69
|
+
getSpecialization: (parsed) => parsed.language,
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=spawn-coder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-coder.js","sourceRoot":"","sources":["../../src/tools/spawn-coder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAA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AE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,oCAAoC;aAClD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,+BAA+B;aAC7C;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;KACtC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;IACjD,MAAM,EAAE,gBAAgB;IACxB,QAAQ,EAAE,aAAa;IACvB,QAAQ,EAAE,aAAa;IACvB,cAAc,EAAE,yEAAyE;IACzF,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ;CAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const spawnPlannerTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object";
|
|
6
|
+
properties: {
|
|
7
|
+
prompt: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
context_files: {
|
|
12
|
+
type: string;
|
|
13
|
+
items: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties: {
|
|
16
|
+
path: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
description: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
required: string[];
|
|
26
|
+
};
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
planning_type: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: ("feature" | "bugfix" | "migration" | "refactor" | "architecture")[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
model: {
|
|
35
|
+
type: string;
|
|
36
|
+
enum: ("claude-opus-4.6" | "claude-haiku-4.5" | "claude-sonnet-4.5")[];
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
cwd: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
timeout: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
autonomous: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
depends_on: {
|
|
52
|
+
type: string;
|
|
53
|
+
items: {
|
|
54
|
+
type: string;
|
|
55
|
+
};
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
labels: {
|
|
59
|
+
type: string;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
required: string[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export declare const handleSpawnPlanner: (args: unknown, ctx?: import("../types.js").ToolContext) => import("./shared-spawn.js").SpawnHandlerResult;
|
|
70
|
+
//# sourceMappingURL=spawn-planner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-planner.d.ts","sourceRoot":"","sources":["../../src/tools/spawn-planner.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D5B,CAAC;AAEF,eAAO,MAAM,kBAAkB,4GAO7B,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SpawnPlannerSchema, PLANNING_TYPES } from '../utils/sanitize.js';
|
|
2
|
+
import { MODEL_IDS, OPUS_MODEL } from '../models.js';
|
|
3
|
+
import { createSpawnHandler } from './shared-spawn.js';
|
|
4
|
+
export const spawnPlannerTool = {
|
|
5
|
+
name: 'spawn_planner',
|
|
6
|
+
description: `Spawn an autonomous planning agent. Always uses ${OPUS_MODEL} regardless of model param.
|
|
7
|
+
|
|
8
|
+
**Required:** prompt (min 300 chars). Describe the PROBLEM, not the solution.
|
|
9
|
+
|
|
10
|
+
**Prompt must include:** PROBLEM STATEMENT, CONSTRAINTS, VERIFIED FACTS, SCOPE (in/out), EXPECTED OUTPUT.
|
|
11
|
+
|
|
12
|
+
**Creates:** \`.agent-workspace/plans/[topic]/\` with PLAN.md, builder-briefing.md, tester-checklist.md.
|
|
13
|
+
Use these as context_files when spawning coder/tester.
|
|
14
|
+
|
|
15
|
+
**Workflow:** spawn_planner → spawn_coder → spawn_tester. Use \`depends_on\` to chain.
|
|
16
|
+
Check status: \`task:///all\` or \`task:///{id}\``,
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
properties: {
|
|
20
|
+
prompt: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
description: `Min 300 chars. Describe the PROBLEM (not solution): PROBLEM STATEMENT, CONSTRAINTS, VERIFIED FACTS, SCOPE, EXPECTED OUTPUT.`,
|
|
23
|
+
},
|
|
24
|
+
context_files: {
|
|
25
|
+
type: 'array',
|
|
26
|
+
items: {
|
|
27
|
+
type: 'object',
|
|
28
|
+
properties: {
|
|
29
|
+
path: { type: 'string', description: 'Absolute path to file.' },
|
|
30
|
+
description: { type: 'string', description: 'What this file contains.' },
|
|
31
|
+
},
|
|
32
|
+
required: ['path'],
|
|
33
|
+
},
|
|
34
|
+
description: `Optional. Attach code, research findings, or architecture docs. Max 20 files, 200KB each, 500KB total.`,
|
|
35
|
+
},
|
|
36
|
+
planning_type: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
enum: [...PLANNING_TYPES],
|
|
39
|
+
description: `Specialization: feature (new feature), bugfix (root cause analysis), migration (incremental strategy), refactor (strangler fig), architecture (system design). Default: general.`,
|
|
40
|
+
},
|
|
41
|
+
model: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
enum: MODEL_IDS,
|
|
44
|
+
description: `Ignored — always uses ${OPUS_MODEL}.`,
|
|
45
|
+
},
|
|
46
|
+
cwd: { type: 'string', description: 'Absolute path to working directory.' },
|
|
47
|
+
timeout: { type: 'number', description: 'Max ms. Default: 1800000 (30min).' },
|
|
48
|
+
autonomous: { type: 'boolean', description: 'Default: true.' },
|
|
49
|
+
depends_on: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
items: { type: 'string' },
|
|
52
|
+
description: 'Task IDs that must complete first.',
|
|
53
|
+
},
|
|
54
|
+
labels: {
|
|
55
|
+
type: 'array',
|
|
56
|
+
items: { type: 'string' },
|
|
57
|
+
description: 'Labels for grouping (max 10).',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
required: ['prompt'],
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
export const handleSpawnPlanner = createSpawnHandler({
|
|
64
|
+
schema: SpawnPlannerSchema,
|
|
65
|
+
toolName: 'spawn_planner',
|
|
66
|
+
taskType: 'super-planner',
|
|
67
|
+
validationHint: 'Required: `prompt` (min 300 chars). Describe the PROBLEM, not the solution.',
|
|
68
|
+
getModel: () => OPUS_MODEL,
|
|
69
|
+
getSpecialization: (parsed) => parsed.planning_type,
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=spawn-planner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-planner.js","sourceRoot":"","sources":["../../src/tools/spawn-planner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,mDAAmD,UAAU;;;;;;;;;;kDAU1B;IAEhD,WAAW,EAAE;QACX,IAAI,EAAE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