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,70 @@
|
|
|
1
|
+
export declare const spawnResearcherTool: {
|
|
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
|
+
research_type: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: ("general" | "architecture" | "performance" | "security" | "library")[];
|
|
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 handleSpawnResearcher: (args: unknown, ctx?: import("../types.js").ToolContext) => import("./shared-spawn.js").SpawnHandlerResult;
|
|
70
|
+
//# sourceMappingURL=spawn-researcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-researcher.d.ts","sourceRoot":"","sources":["../../src/tools/spawn-researcher.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2D/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,4GAMhC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { SpawnResearcherSchema, RESEARCH_TYPES } from '../utils/sanitize.js';
|
|
2
|
+
import { MODEL_IDS, DEFAULT_MODEL } from '../models.js';
|
|
3
|
+
import { createSpawnHandler } from './shared-spawn.js';
|
|
4
|
+
export const spawnResearcherTool = {
|
|
5
|
+
name: 'spawn_researcher',
|
|
6
|
+
description: `Spawn an autonomous research agent. Searches web, scrapes docs, analyzes Reddit, explores codebase. Evidence-based — every finding traces to a source.
|
|
7
|
+
|
|
8
|
+
**Required:** prompt (min 200 chars) with specific questions.
|
|
9
|
+
|
|
10
|
+
**Prompt must include:** WHAT TO RESEARCH (specific question), WHY IT MATTERS, WHAT'S ALREADY KNOWN, SPECIFIC QUESTIONS (2-5), HANDOFF TARGET.
|
|
11
|
+
|
|
12
|
+
**Creates:** \`.agent-workspace/researches/[topic]/\` with HANDOFF.md, recommendation, action-items.
|
|
13
|
+
Use HANDOFF.md as context_file when spawning planner/coder.
|
|
14
|
+
|
|
15
|
+
**Workflow:** spawn_researcher → 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 200 chars. Research brief with specific questions: WHAT TO RESEARCH, WHY IT MATTERS, WHAT'S KNOWN, SPECIFIC QUESTIONS (2-5), HANDOFF TARGET.`,
|
|
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 is.' },
|
|
31
|
+
},
|
|
32
|
+
required: ['path'],
|
|
33
|
+
},
|
|
34
|
+
description: `Optional. Attach code or docs for analysis. Max 20 files, 200KB each, 500KB total.`,
|
|
35
|
+
},
|
|
36
|
+
research_type: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
enum: [...RESEARCH_TYPES],
|
|
39
|
+
description: `Specialization: security (OWASP/CVE/STRIDE), library (comparison matrix, health signals), performance (benchmarks, profiling), architecture (design patterns). Default: general.`,
|
|
40
|
+
},
|
|
41
|
+
model: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
enum: MODEL_IDS,
|
|
44
|
+
description: `Default: ${DEFAULT_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 handleSpawnResearcher = createSpawnHandler({
|
|
64
|
+
schema: SpawnResearcherSchema,
|
|
65
|
+
toolName: 'spawn_researcher',
|
|
66
|
+
taskType: 'super-researcher',
|
|
67
|
+
validationHint: 'Required: `prompt` (min 200 chars) with specific questions to answer.',
|
|
68
|
+
getSpecialization: (parsed) => parsed.research_type,
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=spawn-researcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-researcher.js","sourceRoot":"","sources":["../../src/tools/spawn-researcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE;;;;;;;;;;kDAUmC;IAEhD,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kJAAkJ;aAChK;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;wBAC/D,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;qBACnE;oBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;iBACnB;gBACD,WAAW,EAAE,oFAAoF;aAClG;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,cAAc,CAAC;gBACzB,WAAW,EAAE,kLAAkL;aAChM;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,YAAY,aAAa,GAAG;aAC1C;YACD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;YAC3E,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;YAC7E,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE;YAC9D,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,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,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;IACtD,MAAM,EAAE,qBAAqB;IAC7B,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,kBAAkB;IAC5B,cAAc,EAAE,uEAAuE;IACvF,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa;CACpD,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy spawn_task tool — kept for backward compatibility.
|
|
3
|
+
* New clients should use the specialized tools: spawn_coder, spawn_planner, spawn_tester, spawn_researcher.
|
|
4
|
+
*/
|
|
5
|
+
export declare const spawnTaskTool: {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
inputSchema: {
|
|
9
|
+
type: "object";
|
|
10
|
+
properties: {
|
|
11
|
+
prompt: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
task_type: {
|
|
16
|
+
type: string;
|
|
17
|
+
enum: ("super-planner" | "super-coder" | "super-researcher" | "super-tester")[];
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
context_files: {
|
|
21
|
+
type: string;
|
|
22
|
+
items: {
|
|
23
|
+
type: string;
|
|
24
|
+
properties: {
|
|
25
|
+
path: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
description: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
required: string[];
|
|
35
|
+
};
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
model: {
|
|
39
|
+
type: string;
|
|
40
|
+
enum: ("claude-opus-4.6" | "claude-haiku-4.5" | "claude-sonnet-4.5")[];
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
cwd: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
timeout: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
autonomous: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
depends_on: {
|
|
56
|
+
type: string;
|
|
57
|
+
items: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
labels: {
|
|
63
|
+
type: string;
|
|
64
|
+
items: {
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
required: string[];
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
export declare const handleSpawnTask: (args: unknown, ctx?: import("../types.js").ToolContext) => import("./shared-spawn.js").SpawnHandlerResult;
|
|
74
|
+
//# sourceMappingURL=spawn-task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-task.d.ts","sourceRoot":"","sources":["../../src/tools/spawn-task.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FzB,CAAC;AAEF,eAAO,MAAM,eAAe,4GAK1B,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { SpawnTaskSchema } from '../utils/sanitize.js';
|
|
2
|
+
import { MODEL_IDS, DEFAULT_MODEL, OPUS_MODEL } from '../models.js';
|
|
3
|
+
import { TASK_TYPE_IDS } from '../templates/index.js';
|
|
4
|
+
import { createSpawnHandler } from './shared-spawn.js';
|
|
5
|
+
/**
|
|
6
|
+
* Legacy spawn_task tool — kept for backward compatibility.
|
|
7
|
+
* New clients should use the specialized tools: spawn_coder, spawn_planner, spawn_tester, spawn_researcher.
|
|
8
|
+
*/
|
|
9
|
+
export const spawnTaskTool = {
|
|
10
|
+
name: 'spawn_task',
|
|
11
|
+
description: `Spawn an autonomous agent task. The agent runs isolated with NO shared memory -- your prompt is its ONLY context.
|
|
12
|
+
|
|
13
|
+
⚠️ **PREFER THE SPECIALIZED TOOLS** for better guidance and validation:
|
|
14
|
+
• \`spawn_coder\` — Implementation tasks (requires detailed brief + .md context files)
|
|
15
|
+
• \`spawn_planner\` — Architecture & planning (always uses opus model)
|
|
16
|
+
• \`spawn_tester\` — QA & testing (requires context files)
|
|
17
|
+
• \`spawn_researcher\` — Investigation & research
|
|
18
|
+
|
|
19
|
+
This generic tool applies lighter validation. The specialized tools enforce structured briefs, mandatory context files, and provide task-specific guidance that produces dramatically better results.
|
|
20
|
+
|
|
21
|
+
**After spawning:** Check status via MCP Resources (not tools):
|
|
22
|
+
- \`task:///all\` → List all tasks with status
|
|
23
|
+
- \`task:///{id}\` → Full task details, output, metrics
|
|
24
|
+
- \`task:///{id}/session\` → Execution log with tool calls
|
|
25
|
+
|
|
26
|
+
**Task types:** super-coder (implementation), super-planner (architecture), super-researcher (investigation), super-tester (QA).
|
|
27
|
+
**Models:** ${MODEL_IDS.join(', ')}. Default: ${DEFAULT_MODEL}.
|
|
28
|
+
|
|
29
|
+
Account rotation and rate limit recovery happen automatically -- no manual intervention needed.`,
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
prompt: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: `The complete, self-contained instructions for the spawned agent. This is the ONLY context the agent will have.
|
|
36
|
+
|
|
37
|
+
Your prompt MUST include:
|
|
38
|
+
- WHAT to do: Clear, specific objective
|
|
39
|
+
- WHERE to do it: All relevant file paths as absolute paths
|
|
40
|
+
- HOW to verify: What does "done" look like?
|
|
41
|
+
- CONTEXT: Background the agent needs
|
|
42
|
+
|
|
43
|
+
⚠️ For better results, use the specialized tools instead:
|
|
44
|
+
• spawn_coder (min 1,000 chars + .md files)
|
|
45
|
+
• spawn_planner (min 300 chars + problem description)
|
|
46
|
+
• spawn_tester (min 300 chars + context files)
|
|
47
|
+
• spawn_researcher (min 200 chars + specific questions)`,
|
|
48
|
+
},
|
|
49
|
+
task_type: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
enum: TASK_TYPE_IDS,
|
|
52
|
+
description: `Agent template. Use specialized tools (spawn_coder, etc.) for better validation.
|
|
53
|
+
- super-coder: Implementation — writing, editing, refactoring code
|
|
54
|
+
- super-planner: Architecture — planning implementations, evaluating tradeoffs
|
|
55
|
+
- super-researcher: Investigation — answering questions, analyzing behavior
|
|
56
|
+
- super-tester: QA — testing, running test suites, verifying behavior`,
|
|
57
|
+
},
|
|
58
|
+
context_files: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
items: {
|
|
61
|
+
type: 'object',
|
|
62
|
+
properties: {
|
|
63
|
+
path: { type: 'string', description: 'Absolute path to a context file.' },
|
|
64
|
+
description: { type: 'string', description: 'What this file is and why it matters.' },
|
|
65
|
+
},
|
|
66
|
+
required: ['path'],
|
|
67
|
+
},
|
|
68
|
+
description: 'Optional context files. Their contents are read and injected into the prompt.',
|
|
69
|
+
},
|
|
70
|
+
model: {
|
|
71
|
+
type: 'string',
|
|
72
|
+
enum: MODEL_IDS,
|
|
73
|
+
description: `Model to use. Default: ${DEFAULT_MODEL}. super-planner always uses ${OPUS_MODEL}.`,
|
|
74
|
+
},
|
|
75
|
+
cwd: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
description: 'Absolute path to the working directory.',
|
|
78
|
+
},
|
|
79
|
+
timeout: {
|
|
80
|
+
type: 'number',
|
|
81
|
+
description: 'Max execution time in ms. Default: 1800000 (30 min).',
|
|
82
|
+
},
|
|
83
|
+
autonomous: {
|
|
84
|
+
type: 'boolean',
|
|
85
|
+
description: 'Run without interactive prompts. Default: true.',
|
|
86
|
+
},
|
|
87
|
+
depends_on: {
|
|
88
|
+
type: 'array',
|
|
89
|
+
items: { type: 'string' },
|
|
90
|
+
description: 'Task IDs that must complete before this task starts.',
|
|
91
|
+
},
|
|
92
|
+
labels: {
|
|
93
|
+
type: 'array',
|
|
94
|
+
items: { type: 'string' },
|
|
95
|
+
description: 'Labels for grouping and filtering tasks (max 10).',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
required: ['prompt'],
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
export const handleSpawnTask = createSpawnHandler({
|
|
102
|
+
schema: SpawnTaskSchema,
|
|
103
|
+
toolName: 'spawn_task',
|
|
104
|
+
validationHint: '💡 **TIP:** Use the specialized tools for better guidance:\n• `spawn_coder` — Implementation tasks\n• `spawn_planner` — Planning tasks\n• `spawn_tester` — Testing tasks\n• `spawn_researcher` — Research tasks',
|
|
105
|
+
getTaskType: (parsed) => parsed.task_type ? parsed.task_type : undefined,
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=spawn-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-task.js","sourceRoot":"","sources":["../../src/tools/spawn-task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,aAAa,EAAiB,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE;;;;;;;;;;;;;;;;cAgBD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,aAAa;;gGAEmC;IAC9F,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;;;;;;;;;;;;wDAYmC;aACjD;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE;;;;sEAIiD;aAC/D;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE;wBACzE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;qBACtF;oBACD,QAAQ,EAAE,CAAC,MAAM,CAAC;iBACnB;gBACD,WAAW,EAAE,+EAA+E;aAC7F;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,0BAA0B,aAAa,+BAA+B,UAAU,GAAG;aACjG;YACD,GAAG,EAAE;gBACH,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACvD;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sDAAsD;aACpE;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,iDAAiD;aAC/D;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,sDAAsD;aACpE;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EAAE,mDAAmD;aACjE;SACF;QACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC;IAChD,MAAM,EAAE,eAAe;IACvB,QAAQ,EAAE,YAAY;IACtB,cAAc,EAAE,iNAAiN;IACjO,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAE,MAAM,CAAC,SAAsB,CAAC,CAAC,CAAC,SAAS;CACvF,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const spawnTesterTool: {
|
|
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
|
+
testing_type: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: ("rest" | "general" | "playwright" | "graphql" | "suite" | "accessibility" | "performance" | "security")[];
|
|
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 handleSpawnTester: (args: unknown, ctx?: import("../types.js").ToolContext) => import("./shared-spawn.js").SpawnHandlerResult;
|
|
70
|
+
//# sourceMappingURL=spawn-tester.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-tester.d.ts","sourceRoot":"","sources":["../../src/tools/spawn-tester.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,4GAM5B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SpawnTesterSchema, TESTING_TYPES } from '../utils/sanitize.js';
|
|
2
|
+
import { MODEL_IDS, DEFAULT_MODEL } from '../models.js';
|
|
3
|
+
import { createSpawnHandler } from './shared-spawn.js';
|
|
4
|
+
export const spawnTesterTool = {
|
|
5
|
+
name: 'spawn_tester',
|
|
6
|
+
description: `Spawn an autonomous QA agent. Tests via curl, Playwright, or existing test suites. Proves things work end-to-end.
|
|
7
|
+
|
|
8
|
+
**Required:** prompt (min 300 chars) + context_files (min 1 file).
|
|
9
|
+
|
|
10
|
+
**Prompt must include:** WHAT WAS BUILT, FILES CHANGED, SUCCESS CRITERIA (testable), TEST SUGGESTIONS, EDGE CASES, BASE URL/SETUP.
|
|
11
|
+
|
|
12
|
+
**Cross-reference:** Attach coder's HANDOFF.md or planner's tester-checklist.md as context_files.
|
|
13
|
+
|
|
14
|
+
**Workflow:** spawn_planner → spawn_coder → spawn_tester. Use \`depends_on\` to chain.
|
|
15
|
+
Check status: \`task:///all\` or \`task:///{id}\``,
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: 'object',
|
|
18
|
+
properties: {
|
|
19
|
+
prompt: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
description: `Min 300 chars. Testing brief: WHAT WAS BUILT, FILES CHANGED, SUCCESS CRITERIA, TEST SUGGESTIONS, EDGE CASES, BASE URL/SETUP.`,
|
|
22
|
+
},
|
|
23
|
+
context_files: {
|
|
24
|
+
type: 'array',
|
|
25
|
+
items: {
|
|
26
|
+
type: 'object',
|
|
27
|
+
properties: {
|
|
28
|
+
path: { type: 'string', description: 'Absolute path to file.' },
|
|
29
|
+
description: { type: 'string', description: 'What this file is.' },
|
|
30
|
+
},
|
|
31
|
+
required: ['path'],
|
|
32
|
+
},
|
|
33
|
+
description: `Min 1 file. Attach code, handoffs, or test checklists. Any file type accepted. Max 20 files, 200KB each, 500KB total.`,
|
|
34
|
+
},
|
|
35
|
+
testing_type: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
enum: [...TESTING_TYPES],
|
|
38
|
+
description: `Specialization: playwright (browser/UI), rest (REST API curl), graphql (GraphQL API), suite (run existing tests), accessibility, performance, security. Default: general (auto-selects method).`,
|
|
39
|
+
},
|
|
40
|
+
model: {
|
|
41
|
+
type: 'string',
|
|
42
|
+
enum: MODEL_IDS,
|
|
43
|
+
description: `Default: ${DEFAULT_MODEL}.`,
|
|
44
|
+
},
|
|
45
|
+
cwd: { type: 'string', description: 'Absolute path to working directory.' },
|
|
46
|
+
timeout: { type: 'number', description: 'Max ms. Default: 1800000 (30min).' },
|
|
47
|
+
autonomous: { type: 'boolean', description: 'Default: true.' },
|
|
48
|
+
depends_on: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
items: { type: 'string' },
|
|
51
|
+
description: 'Task IDs that must complete first.',
|
|
52
|
+
},
|
|
53
|
+
labels: {
|
|
54
|
+
type: 'array',
|
|
55
|
+
items: { type: 'string' },
|
|
56
|
+
description: 'Labels for grouping (max 10).',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
required: ['prompt', 'context_files'],
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
export const handleSpawnTester = createSpawnHandler({
|
|
63
|
+
schema: SpawnTesterSchema,
|
|
64
|
+
toolName: 'spawn_tester',
|
|
65
|
+
taskType: 'super-tester',
|
|
66
|
+
validationHint: 'Required: `prompt` (min 300 chars) + `context_files` (min 1 file).',
|
|
67
|
+
getSpecialization: (parsed) => parsed.testing_type,
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=spawn-tester.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn-tester.js","sourceRoot":"","sources":["../../src/tools/spawn-tester.ts"],"names":[],"m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E;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,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,iBAAiB,GAAG,kBAAkB,CAAC;IAClD,MAAM,EAAE,iBAAiB;IACzB,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,cAAc,EAAE,oEAAoE;IACpF,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY;CACnD,CAAC,CAAC"}
|
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for mcp-subagents-opencode.
|
|
3
|
+
* Core types for mcp-subagents-opencode.
|
|
4
|
+
*/
|
|
5
|
+
import type { ServerNotification } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
export type Provider = 'opencode';
|
|
7
|
+
export declare enum TaskStatus {
|
|
8
|
+
PENDING = "pending",
|
|
9
|
+
WAITING = "waiting",
|
|
10
|
+
RUNNING = "running",
|
|
11
|
+
COMPLETED = "completed",
|
|
12
|
+
FAILED = "failed",
|
|
13
|
+
CANCELLED = "cancelled",
|
|
14
|
+
RATE_LIMITED = "rate_limited",
|
|
15
|
+
TIMED_OUT = "timed_out"
|
|
16
|
+
}
|
|
17
|
+
export declare const TERMINAL_STATUSES: ReadonlySet<TaskStatus>;
|
|
18
|
+
export declare function isTerminalStatus(status: TaskStatus): boolean;
|
|
19
|
+
/** HTTP status codes that trigger retry/rotation. */
|
|
20
|
+
export declare const ROTATABLE_STATUS_CODES: ReadonlySet<number>;
|
|
21
|
+
export declare const RATE_LIMIT_STATUS_CODE = 429;
|
|
22
|
+
export interface RetryInfo {
|
|
23
|
+
reason: string;
|
|
24
|
+
retryCount: number;
|
|
25
|
+
nextRetryTime: string;
|
|
26
|
+
maxRetries: number;
|
|
27
|
+
originalTaskId?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface PendingQuestion {
|
|
30
|
+
question: string;
|
|
31
|
+
choices?: string[];
|
|
32
|
+
allowFreeform: boolean;
|
|
33
|
+
askedAt: string;
|
|
34
|
+
sessionId: string;
|
|
35
|
+
}
|
|
36
|
+
export interface FailureContext {
|
|
37
|
+
errorType?: string;
|
|
38
|
+
statusCode?: number;
|
|
39
|
+
errorContext?: string;
|
|
40
|
+
recoverable?: boolean;
|
|
41
|
+
message?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface QuotaInfo {
|
|
44
|
+
remainingPercentage?: number;
|
|
45
|
+
resetDate?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface TaskState {
|
|
48
|
+
id: string;
|
|
49
|
+
status: TaskStatus;
|
|
50
|
+
prompt: string;
|
|
51
|
+
output: string[];
|
|
52
|
+
startTime: string;
|
|
53
|
+
endTime?: string;
|
|
54
|
+
lastHeartbeatAt?: string;
|
|
55
|
+
lastOutputAt?: string;
|
|
56
|
+
cwd?: string;
|
|
57
|
+
model?: string;
|
|
58
|
+
autonomous?: boolean;
|
|
59
|
+
isResume?: boolean;
|
|
60
|
+
retryInfo?: RetryInfo;
|
|
61
|
+
dependsOn?: string[];
|
|
62
|
+
labels?: string[];
|
|
63
|
+
provider?: Provider;
|
|
64
|
+
fallbackAttempted?: boolean;
|
|
65
|
+
switchAttempted?: boolean;
|
|
66
|
+
timeout?: number;
|
|
67
|
+
timeoutAt?: string;
|
|
68
|
+
timeoutReason?: string;
|
|
69
|
+
timeoutContext?: Record<string, unknown>;
|
|
70
|
+
sessionId?: string;
|
|
71
|
+
exitCode?: number;
|
|
72
|
+
error?: string;
|
|
73
|
+
pendingQuestion?: PendingQuestion;
|
|
74
|
+
outputFilePath?: string;
|
|
75
|
+
failureContext?: FailureContext;
|
|
76
|
+
quotaInfo?: QuotaInfo;
|
|
77
|
+
/** Runtime session reference (not serialized) */
|
|
78
|
+
session?: {
|
|
79
|
+
abort: () => void | Promise<void>;
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export interface SpawnOptions {
|
|
83
|
+
prompt: string;
|
|
84
|
+
timeout?: number;
|
|
85
|
+
cwd?: string;
|
|
86
|
+
model?: string;
|
|
87
|
+
taskType?: string;
|
|
88
|
+
autonomous?: boolean;
|
|
89
|
+
resumeSessionId?: string;
|
|
90
|
+
dependsOn?: string[];
|
|
91
|
+
labels?: string[];
|
|
92
|
+
provider?: Provider;
|
|
93
|
+
fallbackAttempted?: boolean;
|
|
94
|
+
switchAttempted?: boolean;
|
|
95
|
+
retryInfo?: RetryInfo;
|
|
96
|
+
}
|
|
97
|
+
export interface ToolContext {
|
|
98
|
+
progressToken?: string | number;
|
|
99
|
+
sendNotification: (notification: ServerNotification) => Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC;AAElC,oBAAY,UAAU;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;CACxB;AAED,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,UAAU,CAKpD,CAAC;AAEH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAE5D;AAED,qDAAqD;AACrD,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AO,CAAC;IAC1B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,gBAAgB,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE"}
|
package/build/types.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for mcp-subagents-opencode.
|
|
3
|
+
* Core types for mcp-subagents-opencode.
|
|
4
|
+
*/
|
|
5
|
+
export var TaskStatus;
|
|
6
|
+
(function (TaskStatus) {
|
|
7
|
+
TaskStatus["PENDING"] = "pending";
|
|
8
|
+
TaskStatus["WAITING"] = "waiting";
|
|
9
|
+
TaskStatus["RUNNING"] = "running";
|
|
10
|
+
TaskStatus["COMPLETED"] = "completed";
|
|
11
|
+
TaskStatus["FAILED"] = "failed";
|
|
12
|
+
TaskStatus["CANCELLED"] = "cancelled";
|
|
13
|
+
TaskStatus["RATE_LIMITED"] = "rate_limited";
|
|
14
|
+
TaskStatus["TIMED_OUT"] = "timed_out";
|
|
15
|
+
})(TaskStatus || (TaskStatus = {}));
|
|
16
|
+
export const TERMINAL_STATUSES = new Set([
|
|
17
|
+
TaskStatus.COMPLETED,
|
|
18
|
+
TaskStatus.FAILED,
|
|
19
|
+
TaskStatus.CANCELLED,
|
|
20
|
+
TaskStatus.TIMED_OUT,
|
|
21
|
+
]);
|
|
22
|
+
export function isTerminalStatus(status) {
|
|
23
|
+
return TERMINAL_STATUSES.has(status);
|
|
24
|
+
}
|
|
25
|
+
/** HTTP status codes that trigger retry/rotation. */
|
|
26
|
+
export const ROTATABLE_STATUS_CODES = new Set([429, 500, 502, 503, 504]);
|
|
27
|
+
export const RATE_LIMIT_STATUS_CODE = 429;
|
|
28
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,CAAN,IAAY,UASX;AATD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,qCAAuB,CAAA;IACvB,2CAA6B,CAAA;IAC7B,qCAAuB,CAAA;AACzB,CAAC,EATW,UAAU,KAAV,UAAU,QASrB;AAED,MAAM,CAAC,MAAM,iBAAiB,GAA4B,IAAI,GAAG,CAAC;IAChE,UAAU,CAAC,SAAS;IACpB,UAAU,CAAC,MAAM;IACjB,UAAU,CAAC,SAAS;IACpB,UAAU,CAAC,SAAS;CACrB,CAAC,CAAC;AAEH,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IACjD,OAAO,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC9F,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ContextFile {
|
|
2
|
+
path: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ValidationError {
|
|
6
|
+
code: string;
|
|
7
|
+
message: string;
|
|
8
|
+
detail?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ValidationResult {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
errors: ValidationError[];
|
|
13
|
+
}
|
|
14
|
+
interface ToolValidationRules {
|
|
15
|
+
toolName: string;
|
|
16
|
+
minPromptLength: number;
|
|
17
|
+
requireContextFiles: boolean;
|
|
18
|
+
minContextFiles: number;
|
|
19
|
+
requireMdExtension: boolean;
|
|
20
|
+
maxFileSizeBytes: number;
|
|
21
|
+
maxTotalSizeBytes: number;
|
|
22
|
+
briefTemplate: string;
|
|
23
|
+
workflowHint: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const VALIDATION_RULES: Record<string, ToolValidationRules>;
|
|
26
|
+
export declare function validateBrief(toolName: string, prompt: string, contextFiles?: ContextFile[]): ValidationResult;
|
|
27
|
+
export declare function formatValidationError(toolName: string, errors: ValidationError[]): string;
|
|
28
|
+
export declare function assemblePromptWithContext(prompt: string, contextFiles?: ContextFile[]): string;
|
|
29
|
+
export {};
|
|
30
|
+
//# 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":"AAKA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,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,eAAe,EAAE,CAAC;CAC3B;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;AAoGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAKhE,CAAC;AAIF,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,WAAW,EAAE,GAC3B,gBAAgB,CAuGlB;AAID,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,CA4BzF;AAID,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,WAAW,EAAE,GAAG,MAAM,CA4B9F"}
|