mcp-agent-foundry 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 +477 -0
- package/dist/cli/install-skills.d.ts +11 -0
- package/dist/cli/install-skills.d.ts.map +1 -0
- package/dist/cli/install-skills.js +143 -0
- package/dist/cli/install-skills.js.map +1 -0
- package/dist/cli/recovery-commands.d.ts +41 -0
- package/dist/cli/recovery-commands.d.ts.map +1 -0
- package/dist/cli/recovery-commands.js +241 -0
- package/dist/cli/recovery-commands.js.map +1 -0
- package/dist/cli/setup-wizard.d.ts +25 -0
- package/dist/cli/setup-wizard.d.ts.map +1 -0
- package/dist/cli/setup-wizard.js +1417 -0
- package/dist/cli/setup-wizard.js.map +1 -0
- package/dist/cli/test-connection.d.ts +45 -0
- package/dist/cli/test-connection.d.ts.map +1 -0
- package/dist/cli/test-connection.js +317 -0
- package/dist/cli/test-connection.js.map +1 -0
- package/dist/cli.d.ts +75 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +704 -0
- package/dist/cli.js.map +1 -0
- package/dist/config/defaults.d.ts +57 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +99 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +22 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/manager.d.ts +184 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +347 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/merger.d.ts +76 -0
- package/dist/config/merger.d.ts.map +1 -0
- package/dist/config/merger.js +189 -0
- package/dist/config/merger.js.map +1 -0
- package/dist/config/schema.d.ts +20 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +20 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/config/validator.d.ts +254 -0
- package/dist/config/validator.d.ts.map +1 -0
- package/dist/config/validator.js +363 -0
- package/dist/config/validator.js.map +1 -0
- package/dist/config/worktree-defaults.d.ts +23 -0
- package/dist/config/worktree-defaults.d.ts.map +1 -0
- package/dist/config/worktree-defaults.js +78 -0
- package/dist/config/worktree-defaults.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/tools/compare-agents.d.ts +25 -0
- package/dist/mcp/tools/compare-agents.d.ts.map +1 -0
- package/dist/mcp/tools/compare-agents.js +177 -0
- package/dist/mcp/tools/compare-agents.js.map +1 -0
- package/dist/mcp/tools/critique-plan.d.ts +26 -0
- package/dist/mcp/tools/critique-plan.d.ts.map +1 -0
- package/dist/mcp/tools/critique-plan.js +162 -0
- package/dist/mcp/tools/critique-plan.js.map +1 -0
- package/dist/mcp/tools/design-feedback.d.ts +26 -0
- package/dist/mcp/tools/design-feedback.d.ts.map +1 -0
- package/dist/mcp/tools/design-feedback.js +216 -0
- package/dist/mcp/tools/design-feedback.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +50 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +191 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/invoke-agent.d.ts +25 -0
- package/dist/mcp/tools/invoke-agent.d.ts.map +1 -0
- package/dist/mcp/tools/invoke-agent.js +141 -0
- package/dist/mcp/tools/invoke-agent.js.map +1 -0
- package/dist/mcp/tools/review-code.d.ts +25 -0
- package/dist/mcp/tools/review-code.d.ts.map +1 -0
- package/dist/mcp/tools/review-code.js +170 -0
- package/dist/mcp/tools/review-code.js.map +1 -0
- package/dist/mcp/tools/tasks/claim-next-task.d.ts +22 -0
- package/dist/mcp/tools/tasks/claim-next-task.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/claim-next-task.js +203 -0
- package/dist/mcp/tools/tasks/claim-next-task.js.map +1 -0
- package/dist/mcp/tools/tasks/create-routed-task.d.ts +17 -0
- package/dist/mcp/tools/tasks/create-routed-task.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/create-routed-task.js +178 -0
- package/dist/mcp/tools/tasks/create-routed-task.js.map +1 -0
- package/dist/mcp/tools/tasks/execute-pipeline.d.ts +22 -0
- package/dist/mcp/tools/tasks/execute-pipeline.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/execute-pipeline.js +401 -0
- package/dist/mcp/tools/tasks/execute-pipeline.js.map +1 -0
- package/dist/mcp/tools/tasks/execute-task.d.ts +32 -0
- package/dist/mcp/tools/tasks/execute-task.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/execute-task.js +284 -0
- package/dist/mcp/tools/tasks/execute-task.js.map +1 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.d.ts +26 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.js +460 -0
- package/dist/mcp/tools/tasks/get-pipeline-status.js.map +1 -0
- package/dist/mcp/tools/tasks/index.d.ts +36 -0
- package/dist/mcp/tools/tasks/index.d.ts.map +1 -0
- package/dist/mcp/tools/tasks/index.js +66 -0
- package/dist/mcp/tools/tasks/index.js.map +1 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.d.ts +17 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.js +147 -0
- package/dist/mcp/tools/worktree/cleanup-worktrees.js.map +1 -0
- package/dist/mcp/tools/worktree/get-worktree-status.d.ts +17 -0
- package/dist/mcp/tools/worktree/get-worktree-status.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/get-worktree-status.js +123 -0
- package/dist/mcp/tools/worktree/get-worktree-status.js.map +1 -0
- package/dist/mcp/tools/worktree/index.d.ts +41 -0
- package/dist/mcp/tools/worktree/index.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/index.js +69 -0
- package/dist/mcp/tools/worktree/index.js.map +1 -0
- package/dist/mcp/tools/worktree/list-worktrees.d.ts +17 -0
- package/dist/mcp/tools/worktree/list-worktrees.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/list-worktrees.js +136 -0
- package/dist/mcp/tools/worktree/list-worktrees.js.map +1 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.d.ts +19 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.d.ts.map +1 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.js +228 -0
- package/dist/mcp/tools/worktree/resolve-conflicts.js.map +1 -0
- package/dist/mcp/transport/stdio.d.ts +13 -0
- package/dist/mcp/transport/stdio.d.ts.map +1 -0
- package/dist/mcp/transport/stdio.js +15 -0
- package/dist/mcp/transport/stdio.js.map +1 -0
- package/dist/observability/logger.d.ts +137 -0
- package/dist/observability/logger.d.ts.map +1 -0
- package/dist/observability/logger.js +235 -0
- package/dist/observability/logger.js.map +1 -0
- package/dist/observability/metrics.d.ts +250 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +364 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/persistence/index.d.ts +9 -0
- package/dist/persistence/index.d.ts.map +1 -0
- package/dist/persistence/index.js +9 -0
- package/dist/persistence/index.js.map +1 -0
- package/dist/persistence/state-schema.d.ts +116 -0
- package/dist/persistence/state-schema.d.ts.map +1 -0
- package/dist/persistence/state-schema.js +28 -0
- package/dist/persistence/state-schema.js.map +1 -0
- package/dist/persistence/state-store.d.ts +111 -0
- package/dist/persistence/state-store.d.ts.map +1 -0
- package/dist/persistence/state-store.js +291 -0
- package/dist/persistence/state-store.js.map +1 -0
- package/dist/providers/anthropic.d.ts +164 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +500 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/base.d.ts +151 -0
- package/dist/providers/base.d.ts.map +1 -0
- package/dist/providers/base.js +227 -0
- package/dist/providers/base.js.map +1 -0
- package/dist/providers/gemini.d.ts +85 -0
- package/dist/providers/gemini.d.ts.map +1 -0
- package/dist/providers/gemini.js +414 -0
- package/dist/providers/gemini.js.map +1 -0
- package/dist/providers/kimi.d.ts +19 -0
- package/dist/providers/kimi.d.ts.map +1 -0
- package/dist/providers/kimi.js +20 -0
- package/dist/providers/kimi.js.map +1 -0
- package/dist/providers/manager.d.ts +160 -0
- package/dist/providers/manager.d.ts.map +1 -0
- package/dist/providers/manager.js +264 -0
- package/dist/providers/manager.js.map +1 -0
- package/dist/providers/ollama.d.ts +83 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +453 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/openai.d.ts +96 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +457 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/zai.d.ts +19 -0
- package/dist/providers/zai.d.ts.map +1 -0
- package/dist/providers/zai.js +20 -0
- package/dist/providers/zai.js.map +1 -0
- package/dist/router/context-manager.d.ts +2 -0
- package/dist/router/context-manager.d.ts.map +1 -0
- package/dist/router/context-manager.js +3 -0
- package/dist/router/context-manager.js.map +1 -0
- package/dist/router/engine.d.ts +169 -0
- package/dist/router/engine.d.ts.map +1 -0
- package/dist/router/engine.js +435 -0
- package/dist/router/engine.js.map +1 -0
- package/dist/router/pattern-executor.d.ts +317 -0
- package/dist/router/pattern-executor.d.ts.map +1 -0
- package/dist/router/pattern-executor.js +571 -0
- package/dist/router/pattern-executor.js.map +1 -0
- package/dist/router/role-resolver.d.ts +59 -0
- package/dist/router/role-resolver.d.ts.map +1 -0
- package/dist/router/role-resolver.js +95 -0
- package/dist/router/role-resolver.js.map +1 -0
- package/dist/server.d.ts +32 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +223 -0
- package/dist/server.js.map +1 -0
- package/dist/startup.d.ts +78 -0
- package/dist/startup.d.ts.map +1 -0
- package/dist/startup.js +107 -0
- package/dist/startup.js.map +1 -0
- package/dist/tasks/coordinator.d.ts +141 -0
- package/dist/tasks/coordinator.d.ts.map +1 -0
- package/dist/tasks/coordinator.js +331 -0
- package/dist/tasks/coordinator.js.map +1 -0
- package/dist/tasks/index.d.ts +13 -0
- package/dist/tasks/index.d.ts.map +1 -0
- package/dist/tasks/index.js +13 -0
- package/dist/tasks/index.js.map +1 -0
- package/dist/tasks/persistent-state-coordinator.d.ts +89 -0
- package/dist/tasks/persistent-state-coordinator.d.ts.map +1 -0
- package/dist/tasks/persistent-state-coordinator.js +371 -0
- package/dist/tasks/persistent-state-coordinator.js.map +1 -0
- package/dist/tasks/pipeline-manager.d.ts +103 -0
- package/dist/tasks/pipeline-manager.d.ts.map +1 -0
- package/dist/tasks/pipeline-manager.js +358 -0
- package/dist/tasks/pipeline-manager.js.map +1 -0
- package/dist/tasks/state-coordinator.d.ts +79 -0
- package/dist/tasks/state-coordinator.d.ts.map +1 -0
- package/dist/tasks/state-coordinator.js +200 -0
- package/dist/tasks/state-coordinator.js.map +1 -0
- package/dist/tasks/worker-mode.d.ts +65 -0
- package/dist/tasks/worker-mode.d.ts.map +1 -0
- package/dist/tasks/worker-mode.js +208 -0
- package/dist/tasks/worker-mode.js.map +1 -0
- package/dist/translation/errors.d.ts +203 -0
- package/dist/translation/errors.d.ts.map +1 -0
- package/dist/translation/errors.js +477 -0
- package/dist/translation/errors.js.map +1 -0
- package/dist/translation/index.d.ts +12 -0
- package/dist/translation/index.d.ts.map +1 -0
- package/dist/translation/index.js +32 -0
- package/dist/translation/index.js.map +1 -0
- package/dist/translation/messages.d.ts +295 -0
- package/dist/translation/messages.d.ts.map +1 -0
- package/dist/translation/messages.js +557 -0
- package/dist/translation/messages.js.map +1 -0
- package/dist/translation/streaming.d.ts +226 -0
- package/dist/translation/streaming.d.ts.map +1 -0
- package/dist/translation/streaming.js +520 -0
- package/dist/translation/streaming.js.map +1 -0
- package/dist/translation/tools.d.ts +209 -0
- package/dist/translation/tools.d.ts.map +1 -0
- package/dist/translation/tools.js +331 -0
- package/dist/translation/tools.js.map +1 -0
- package/dist/types.d.ts +747 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +86 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/circuit-breaker.d.ts +175 -0
- package/dist/utils/circuit-breaker.d.ts.map +1 -0
- package/dist/utils/circuit-breaker.js +315 -0
- package/dist/utils/circuit-breaker.js.map +1 -0
- package/dist/utils/env.d.ts +2 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +3 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/git.d.ts +58 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +197 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/merge-ordering.d.ts +45 -0
- package/dist/utils/merge-ordering.d.ts.map +1 -0
- package/dist/utils/merge-ordering.js +128 -0
- package/dist/utils/merge-ordering.js.map +1 -0
- package/dist/utils/retry.d.ts +106 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +188 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/worktrees/branch-manager.d.ts +55 -0
- package/dist/worktrees/branch-manager.d.ts.map +1 -0
- package/dist/worktrees/branch-manager.js +129 -0
- package/dist/worktrees/branch-manager.js.map +1 -0
- package/dist/worktrees/conflict-handler.d.ts +72 -0
- package/dist/worktrees/conflict-handler.d.ts.map +1 -0
- package/dist/worktrees/conflict-handler.js +287 -0
- package/dist/worktrees/conflict-handler.js.map +1 -0
- package/dist/worktrees/conflict-parser.d.ts +28 -0
- package/dist/worktrees/conflict-parser.d.ts.map +1 -0
- package/dist/worktrees/conflict-parser.js +140 -0
- package/dist/worktrees/conflict-parser.js.map +1 -0
- package/dist/worktrees/index.d.ts +20 -0
- package/dist/worktrees/index.d.ts.map +1 -0
- package/dist/worktrees/index.js +20 -0
- package/dist/worktrees/index.js.map +1 -0
- package/dist/worktrees/instructions.d.ts +20 -0
- package/dist/worktrees/instructions.d.ts.map +1 -0
- package/dist/worktrees/instructions.js +84 -0
- package/dist/worktrees/instructions.js.map +1 -0
- package/dist/worktrees/manager.d.ts +76 -0
- package/dist/worktrees/manager.d.ts.map +1 -0
- package/dist/worktrees/manager.js +277 -0
- package/dist/worktrees/manager.js.map +1 -0
- package/dist/worktrees/pipeline-merge-orchestrator.d.ts +55 -0
- package/dist/worktrees/pipeline-merge-orchestrator.d.ts.map +1 -0
- package/dist/worktrees/pipeline-merge-orchestrator.js +221 -0
- package/dist/worktrees/pipeline-merge-orchestrator.js.map +1 -0
- package/dist/worktrees/pool.d.ts +95 -0
- package/dist/worktrees/pool.d.ts.map +1 -0
- package/dist/worktrees/pool.js +271 -0
- package/dist/worktrees/pool.js.map +1 -0
- package/dist/worktrees/recovery.d.ts +94 -0
- package/dist/worktrees/recovery.d.ts.map +1 -0
- package/dist/worktrees/recovery.js +371 -0
- package/dist/worktrees/recovery.js.map +1 -0
- package/dist/worktrees/resource-manager.d.ts +74 -0
- package/dist/worktrees/resource-manager.d.ts.map +1 -0
- package/dist/worktrees/resource-manager.js +228 -0
- package/dist/worktrees/resource-manager.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* execute_task MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Executes a Claude Code task using AgentRouter.
|
|
5
|
+
* Coordinates with TaskCoordinator for lifecycle management.
|
|
6
|
+
* Automatically allocates isolated git worktrees for coder/developer roles.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { roleNeedsWorktree } from "../../../config/worktree-defaults.js";
|
|
10
|
+
import { injectWorktreeContext } from "../../../worktrees/instructions.js";
|
|
11
|
+
// ============================================================================
|
|
12
|
+
// Constants
|
|
13
|
+
// ============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Available agent roles
|
|
16
|
+
*/
|
|
17
|
+
const AGENT_ROLES = ["coder", "critic", "designer", "researcher", "reviewer"];
|
|
18
|
+
/**
|
|
19
|
+
* Tool description for execute_task
|
|
20
|
+
*/
|
|
21
|
+
const TOOL_DESCRIPTION = "Execute a Claude Code task using AgentRouter. Claims the task, invokes the appropriate agent, and returns completion instructions. " +
|
|
22
|
+
"For coder/developer roles, an isolated git worktree is automatically allocated to prevent conflicts with other parallel agents. " +
|
|
23
|
+
"The worktree path and branch information are included in the response when allocated.";
|
|
24
|
+
/**
|
|
25
|
+
* Default worker name for task claims
|
|
26
|
+
*/
|
|
27
|
+
const DEFAULT_WORKER_NAME = "agent-router";
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// Input Schema
|
|
30
|
+
// ============================================================================
|
|
31
|
+
/**
|
|
32
|
+
* Zod schema shape for execute_task input validation.
|
|
33
|
+
* Uses raw shape format as expected by MCP SDK's registerTool.
|
|
34
|
+
*/
|
|
35
|
+
const executeTaskInputSchemaShape = {
|
|
36
|
+
taskId: z.string().min(1).describe("The Claude Code task ID to execute"),
|
|
37
|
+
role: z
|
|
38
|
+
.enum(AGENT_ROLES)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe("The agent role to use. If not provided, must be specified in task metadata."),
|
|
41
|
+
context: z
|
|
42
|
+
.string()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe("Optional additional context for the agent"),
|
|
45
|
+
autoComplete: z
|
|
46
|
+
.boolean()
|
|
47
|
+
.default(true)
|
|
48
|
+
.describe("Automatically mark the task as complete on success (default: true)"),
|
|
49
|
+
};
|
|
50
|
+
// ============================================================================
|
|
51
|
+
// Response Formatter
|
|
52
|
+
// ============================================================================
|
|
53
|
+
/**
|
|
54
|
+
* Formats the task execution response for MCP text output
|
|
55
|
+
*
|
|
56
|
+
* @param taskId - The Claude Code task ID
|
|
57
|
+
* @param role - The agent role used
|
|
58
|
+
* @param response - The agent response
|
|
59
|
+
* @param durationMs - Execution duration in milliseconds
|
|
60
|
+
* @param autoComplete - Whether to include auto-complete instructions
|
|
61
|
+
* @param worktreeInfo - Optional worktree information if one was allocated
|
|
62
|
+
* @returns Formatted string with execution details and instructions
|
|
63
|
+
*/
|
|
64
|
+
function formatTaskExecutionResponse(taskId, role, response, durationMs, autoComplete, worktreeInfo) {
|
|
65
|
+
const header = `## Task Execution Complete\n\n`;
|
|
66
|
+
let meta = `**Task ID:** ${taskId}\n` +
|
|
67
|
+
`**Role:** ${role}\n` +
|
|
68
|
+
`**Provider:** ${response.provider} | **Model:** ${response.model}\n` +
|
|
69
|
+
`**Duration:** ${String(durationMs)}ms\n`;
|
|
70
|
+
// Add worktree info if allocated
|
|
71
|
+
if (worktreeInfo?.allocated) {
|
|
72
|
+
meta +=
|
|
73
|
+
`\n### Worktree Allocated\n` +
|
|
74
|
+
`**Path:** \`${worktreeInfo.path}\`\n` +
|
|
75
|
+
`**Branch:** \`${worktreeInfo.branch}\`\n`;
|
|
76
|
+
}
|
|
77
|
+
meta += "\n";
|
|
78
|
+
const instructions = `### Instructions for Claude\n` +
|
|
79
|
+
(autoComplete
|
|
80
|
+
? `TaskUpdate({ taskId: "${taskId}", status: "completed" })\n\n`
|
|
81
|
+
: `Manual completion required\n\n`);
|
|
82
|
+
const content = response.content
|
|
83
|
+
.filter((block) => block.type === "text")
|
|
84
|
+
.map((block) => block.text ?? "")
|
|
85
|
+
.join("\n");
|
|
86
|
+
const agentResponse = `### Agent Response\n${content}`;
|
|
87
|
+
return header + meta + instructions + agentResponse;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Formats an error response for task execution failure
|
|
91
|
+
*
|
|
92
|
+
* @param taskId - The Claude Code task ID
|
|
93
|
+
* @param role - The agent role attempted
|
|
94
|
+
* @param errorMessage - The error message
|
|
95
|
+
* @returns Formatted error string with release instructions
|
|
96
|
+
*/
|
|
97
|
+
function formatTaskErrorResponse(taskId, role, errorMessage) {
|
|
98
|
+
return (`## Task Execution Failed\n\n` +
|
|
99
|
+
`**Task ID:** ${taskId}\n` +
|
|
100
|
+
`**Role:** ${role}\n\n` +
|
|
101
|
+
`### Instructions for Claude\n` +
|
|
102
|
+
`TaskUpdate({ taskId: "${taskId}", status: "pending", owner: null })\n\n` +
|
|
103
|
+
`### Error\n${errorMessage}`);
|
|
104
|
+
}
|
|
105
|
+
// ============================================================================
|
|
106
|
+
// Tool Registration
|
|
107
|
+
// ============================================================================
|
|
108
|
+
/**
|
|
109
|
+
* Registers the execute_task tool with the MCP server
|
|
110
|
+
*
|
|
111
|
+
* @param server - MCP server instance
|
|
112
|
+
* @param router - RouterEngine for agent invocation
|
|
113
|
+
* @param coordinator - TaskCoordinator for task lifecycle management
|
|
114
|
+
* @param logger - Logger instance for structured logging
|
|
115
|
+
* @param worktreeManager - Optional WorktreeManager for git worktree allocation
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* const server = new McpServer({ name: 'agent-router', version: '3.0.0' });
|
|
120
|
+
* const router = new RouterEngine(config, providers, logger);
|
|
121
|
+
* const coordinator = new TaskCoordinator(logger);
|
|
122
|
+
* const worktreeManager = new WorktreeManager(repoPath, worktreeConfig);
|
|
123
|
+
* registerExecuteTaskTool(server, router, coordinator, logger, worktreeManager);
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export function registerExecuteTaskTool(server, router, coordinator, logger, worktreeManager) {
|
|
127
|
+
// Use type assertion to work around Zod version compatibility issues
|
|
128
|
+
// between zod 3.25+ and the MCP SDK's ZodRawShapeCompat type
|
|
129
|
+
/* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */
|
|
130
|
+
const inputSchema = executeTaskInputSchemaShape;
|
|
131
|
+
server.registerTool("execute_task", {
|
|
132
|
+
title: "Execute Task",
|
|
133
|
+
description: TOOL_DESCRIPTION,
|
|
134
|
+
inputSchema,
|
|
135
|
+
},
|
|
136
|
+
/* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */
|
|
137
|
+
async (args) => {
|
|
138
|
+
// Type-safe access with explicit casting after validation
|
|
139
|
+
const { taskId, role, context, autoComplete } = args;
|
|
140
|
+
// Role must be provided either in args or will need to come from task metadata
|
|
141
|
+
// For now, we require it in args
|
|
142
|
+
if (!role) {
|
|
143
|
+
logger.warn("execute_task called without role", { taskId });
|
|
144
|
+
return {
|
|
145
|
+
content: [
|
|
146
|
+
{
|
|
147
|
+
type: "text",
|
|
148
|
+
text: `## Error Executing Task\n\n` +
|
|
149
|
+
`**Task ID:** ${taskId}\n\n` +
|
|
150
|
+
`Role is required. Please specify a role: coder, critic, designer, researcher, or reviewer.`,
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
logger.info("execute_task called", {
|
|
156
|
+
taskId,
|
|
157
|
+
role,
|
|
158
|
+
hasContext: context !== undefined,
|
|
159
|
+
autoComplete,
|
|
160
|
+
});
|
|
161
|
+
// Track worktree info for response
|
|
162
|
+
let worktreeInfo;
|
|
163
|
+
let allocatedWorktree;
|
|
164
|
+
let worktreeInstructions;
|
|
165
|
+
try {
|
|
166
|
+
// Generate claim instructions (for logging/reference)
|
|
167
|
+
const claimInstructions = coordinator.generateClaimInstructions(taskId, DEFAULT_WORKER_NAME);
|
|
168
|
+
logger.debug("Task claim instructions generated", {
|
|
169
|
+
taskId,
|
|
170
|
+
preExecution: claimInstructions.preExecution,
|
|
171
|
+
});
|
|
172
|
+
// Start tracking the execution
|
|
173
|
+
coordinator.startExecution(taskId, role);
|
|
174
|
+
const startTime = Date.now();
|
|
175
|
+
// Check if this role needs a worktree (coder, developer, etc.)
|
|
176
|
+
const needsWorktree = roleNeedsWorktree(role);
|
|
177
|
+
// Allocate worktree if needed and manager is available
|
|
178
|
+
if (needsWorktree && worktreeManager) {
|
|
179
|
+
logger.info("Allocating worktree for coding role", { taskId, role });
|
|
180
|
+
const allocationResult = await worktreeManager.allocate(taskId, DEFAULT_WORKER_NAME);
|
|
181
|
+
if (allocationResult.success && allocationResult.worktree) {
|
|
182
|
+
allocatedWorktree = allocationResult.worktree;
|
|
183
|
+
worktreeInstructions = allocationResult.instructions;
|
|
184
|
+
worktreeInfo = {
|
|
185
|
+
path: allocatedWorktree.path,
|
|
186
|
+
branch: allocatedWorktree.branch,
|
|
187
|
+
allocated: true,
|
|
188
|
+
};
|
|
189
|
+
logger.info("Worktree allocated successfully", {
|
|
190
|
+
taskId,
|
|
191
|
+
worktreeId: allocatedWorktree.id,
|
|
192
|
+
path: allocatedWorktree.path,
|
|
193
|
+
branch: allocatedWorktree.branch,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
// Log warning but continue without worktree
|
|
198
|
+
logger.warn("Failed to allocate worktree, continuing without isolation", {
|
|
199
|
+
taskId,
|
|
200
|
+
role,
|
|
201
|
+
error: allocationResult.error,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else if (needsWorktree && !worktreeManager) {
|
|
206
|
+
logger.debug("Role needs worktree but WorktreeManager not available", {
|
|
207
|
+
taskId,
|
|
208
|
+
role,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
// Build task context with worktree instructions if allocated
|
|
212
|
+
let effectiveContext = context;
|
|
213
|
+
if (worktreeInstructions && allocatedWorktree) {
|
|
214
|
+
// Inject worktree context into the task prompt
|
|
215
|
+
const taskPrompt = context ?? taskId;
|
|
216
|
+
effectiveContext = injectWorktreeContext(taskPrompt, allocatedWorktree, "full");
|
|
217
|
+
}
|
|
218
|
+
// Build input with optional context only if provided
|
|
219
|
+
const invokeInput = effectiveContext !== undefined
|
|
220
|
+
? { role, task: taskId, context: effectiveContext }
|
|
221
|
+
: { role, task: taskId };
|
|
222
|
+
// Invoke the agent through the router
|
|
223
|
+
const response = await router.invokeAgent(invokeInput);
|
|
224
|
+
const durationMs = Date.now() - startTime;
|
|
225
|
+
// Mark execution complete
|
|
226
|
+
coordinator.completeExecution(taskId, response);
|
|
227
|
+
logger.info("execute_task completed", {
|
|
228
|
+
taskId,
|
|
229
|
+
role,
|
|
230
|
+
provider: response.provider,
|
|
231
|
+
model: response.model,
|
|
232
|
+
durationMs,
|
|
233
|
+
traceId: response.metadata.traceId,
|
|
234
|
+
worktreeAllocated: !!allocatedWorktree,
|
|
235
|
+
});
|
|
236
|
+
return {
|
|
237
|
+
content: [
|
|
238
|
+
{
|
|
239
|
+
type: "text",
|
|
240
|
+
text: formatTaskExecutionResponse(taskId, role, response, durationMs, autoComplete, worktreeInfo),
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
247
|
+
// Mark execution failed and generate release instructions
|
|
248
|
+
try {
|
|
249
|
+
coordinator.failExecution(taskId, error instanceof Error ? error : new Error(errorMessage));
|
|
250
|
+
}
|
|
251
|
+
catch {
|
|
252
|
+
// Execution may not exist if it failed before startExecution
|
|
253
|
+
logger.debug("Could not mark execution as failed", { taskId });
|
|
254
|
+
}
|
|
255
|
+
// Only pass error to logger if it's an Error instance
|
|
256
|
+
if (error instanceof Error) {
|
|
257
|
+
logger.error("execute_task failed", {
|
|
258
|
+
taskId,
|
|
259
|
+
role,
|
|
260
|
+
error,
|
|
261
|
+
errorMessage,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
logger.error("execute_task failed", {
|
|
266
|
+
taskId,
|
|
267
|
+
role,
|
|
268
|
+
errorMessage,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
// Return error as text content for MCP compatibility
|
|
272
|
+
return {
|
|
273
|
+
content: [
|
|
274
|
+
{
|
|
275
|
+
type: "text",
|
|
276
|
+
text: formatTaskErrorResponse(taskId, role, errorMessage),
|
|
277
|
+
},
|
|
278
|
+
],
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
logger.debug("Registered execute_task tool", { roles: AGENT_ROLES });
|
|
283
|
+
}
|
|
284
|
+
//# sourceMappingURL=execute-task.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-task.js","sourceRoot":"","sources":["../../../../src/mcp/tools/tasks/execute-task.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAMzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E;;GAEG;AACH,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AAEvF;;GAEG;AACH,MAAM,gBAAgB,GACpB,qIAAqI;IACrI,kIAAkI;IAClI,uFAAuF,CAAC;AAE1F;;GAEG;AACH,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,2BAA2B,GAAG;IAClC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IACxE,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,WAAW,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CACP,6EAA6E,CAC9E;IACH,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,2CAA2C,CAAC;IACxD,YAAY,EAAE,CAAC;SACZ,OAAO,EAAE;SACT,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,oEAAoE,CAAC;CAClF,CAAC;AA4BF,+EAA+E;AAC/E,qB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ACvE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* get_pipeline_status MCP Tool
|
|
3
|
+
*
|
|
4
|
+
* Queries the execution status of a pipeline, showing step progress,
|
|
5
|
+
* dependency graph, and available results.
|
|
6
|
+
*/
|
|
7
|
+
import { type McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
|
+
import type { Logger } from "../../../observability/logger.js";
|
|
9
|
+
import type { PipelineManager } from "../../../tasks/pipeline-manager.js";
|
|
10
|
+
/**
|
|
11
|
+
* Options for registering the get_pipeline_status tool
|
|
12
|
+
*/
|
|
13
|
+
export interface GetPipelineStatusToolOptions {
|
|
14
|
+
/** Whether worktree support is enabled */
|
|
15
|
+
worktreesEnabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Registers the get_pipeline_status tool with the MCP server
|
|
19
|
+
*
|
|
20
|
+
* @param server - MCP server instance
|
|
21
|
+
* @param pipelineManager - PipelineManager for querying executions
|
|
22
|
+
* @param logger - Logger instance for structured logging
|
|
23
|
+
* @param options - Optional configuration for worktree support
|
|
24
|
+
*/
|
|
25
|
+
export declare function registerGetPipelineStatusTool(server: McpServer, pipelineManager: PipelineManager, logger: Logger, options?: GetPipelineStatusToolOptions): void;
|
|
26
|
+
//# sourceMappingURL=get-pipeline-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-pipeline-status.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/tasks/get-pipeline-status.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAuc1E;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,4BAAiC,GACzC,IAAI,CA+GN"}
|