@sudocode-ai/local-server 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/execution/executors/agent-executor-wrapper.d.ts.map +1 -1
- package/dist/execution/executors/agent-executor-wrapper.js +57 -2
- package/dist/execution/executors/agent-executor-wrapper.js.map +1 -1
- package/dist/execution/process/builders/claude.d.ts.map +1 -1
- package/dist/execution/process/builders/claude.js +32 -1
- package/dist/execution/process/builders/claude.js.map +1 -1
- package/dist/execution/worktree/config.js +1 -1
- package/dist/execution/worktree/config.js.map +1 -1
- package/dist/execution/worktree/git-cli.d.ts +48 -0
- package/dist/execution/worktree/git-cli.d.ts.map +1 -1
- package/dist/execution/worktree/git-cli.js +81 -0
- package/dist/execution/worktree/git-cli.js.map +1 -1
- package/dist/execution/worktree/types.d.ts.map +1 -1
- package/dist/execution/worktree/types.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/public/assets/index-Nz4IjDwB.css +1 -0
- package/dist/public/assets/index-Z8yftXvD.js +824 -0
- package/dist/public/assets/index-Z8yftXvD.js.map +1 -0
- package/dist/public/assets/{react-vendor-DiL5hC7l.js → react-vendor-5f1Wq1qs.js} +5 -5
- package/dist/public/assets/{react-vendor-DiL5hC7l.js.map → react-vendor-5f1Wq1qs.js.map} +1 -1
- package/dist/public/assets/{ui-vendor-B4WMPEfa.js → ui-vendor-BDDPoYki.js} +2 -2
- package/dist/public/assets/{ui-vendor-B4WMPEfa.js.map → ui-vendor-BDDPoYki.js.map} +1 -1
- package/dist/public/index.html +4 -4
- package/dist/routes/executions.d.ts.map +1 -1
- package/dist/routes/executions.js +3 -1
- package/dist/routes/executions.js.map +1 -1
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +13 -0
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/specs.d.ts.map +1 -1
- package/dist/routes/specs.js +14 -0
- package/dist/routes/specs.js.map +1 -1
- package/dist/routes/workflows.d.ts +8 -0
- package/dist/routes/workflows.d.ts.map +1 -0
- package/dist/routes/workflows.js +1729 -0
- package/dist/routes/workflows.js.map +1 -0
- package/dist/services/execution-event-callbacks.d.ts +73 -0
- package/dist/services/execution-event-callbacks.d.ts.map +1 -0
- package/dist/services/execution-event-callbacks.js +82 -0
- package/dist/services/execution-event-callbacks.js.map +1 -0
- package/dist/services/execution-lifecycle.d.ts +38 -2
- package/dist/services/execution-lifecycle.d.ts.map +1 -1
- package/dist/services/execution-lifecycle.js +94 -23
- package/dist/services/execution-lifecycle.js.map +1 -1
- package/dist/services/execution-service.d.ts +31 -3
- package/dist/services/execution-service.d.ts.map +1 -1
- package/dist/services/execution-service.js +161 -34
- package/dist/services/execution-service.js.map +1 -1
- package/dist/services/executions.d.ts +1 -0
- package/dist/services/executions.d.ts.map +1 -1
- package/dist/services/executions.js +4 -0
- package/dist/services/executions.js.map +1 -1
- package/dist/services/project-context.d.ts +25 -0
- package/dist/services/project-context.d.ts.map +1 -1
- package/dist/services/project-context.js +53 -3
- package/dist/services/project-context.js.map +1 -1
- package/dist/services/project-manager.d.ts +7 -0
- package/dist/services/project-manager.d.ts.map +1 -1
- package/dist/services/project-manager.js +108 -13
- package/dist/services/project-manager.js.map +1 -1
- package/dist/services/websocket.d.ts +10 -2
- package/dist/services/websocket.d.ts.map +1 -1
- package/dist/services/websocket.js +18 -0
- package/dist/services/websocket.js.map +1 -1
- package/dist/services/workflow-broadcast-service.d.ts +43 -0
- package/dist/services/workflow-broadcast-service.d.ts.map +1 -0
- package/dist/services/workflow-broadcast-service.js +145 -0
- package/dist/services/workflow-broadcast-service.js.map +1 -0
- package/dist/services/worktree-sync-service.d.ts +76 -4
- package/dist/services/worktree-sync-service.d.ts.map +1 -1
- package/dist/services/worktree-sync-service.js +264 -23
- package/dist/services/worktree-sync-service.js.map +1 -1
- package/dist/workflow/base-workflow-engine.d.ts +186 -0
- package/dist/workflow/base-workflow-engine.d.ts.map +1 -0
- package/dist/workflow/base-workflow-engine.js +549 -0
- package/dist/workflow/base-workflow-engine.js.map +1 -0
- package/dist/workflow/dependency-analyzer.d.ts +78 -0
- package/dist/workflow/dependency-analyzer.d.ts.map +1 -0
- package/dist/workflow/dependency-analyzer.js +264 -0
- package/dist/workflow/dependency-analyzer.js.map +1 -0
- package/dist/workflow/engines/orchestrator-engine.d.ts +237 -0
- package/dist/workflow/engines/orchestrator-engine.d.ts.map +1 -0
- package/dist/workflow/engines/orchestrator-engine.js +749 -0
- package/dist/workflow/engines/orchestrator-engine.js.map +1 -0
- package/dist/workflow/engines/sequential-engine.d.ts +276 -0
- package/dist/workflow/engines/sequential-engine.d.ts.map +1 -0
- package/dist/workflow/engines/sequential-engine.js +1110 -0
- package/dist/workflow/engines/sequential-engine.js.map +1 -0
- package/dist/workflow/index.d.ts +15 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +22 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/mcp/api-client.d.ts +103 -0
- package/dist/workflow/mcp/api-client.d.ts.map +1 -0
- package/dist/workflow/mcp/api-client.js +193 -0
- package/dist/workflow/mcp/api-client.js.map +1 -0
- package/dist/workflow/mcp/index.d.ts +16 -0
- package/dist/workflow/mcp/index.d.ts.map +1 -0
- package/dist/workflow/mcp/index.js +114 -0
- package/dist/workflow/mcp/index.js.map +1 -0
- package/dist/workflow/mcp/server.d.ts +85 -0
- package/dist/workflow/mcp/server.d.ts.map +1 -0
- package/dist/workflow/mcp/server.js +520 -0
- package/dist/workflow/mcp/server.js.map +1 -0
- package/dist/workflow/mcp/tools/escalation.d.ts +36 -0
- package/dist/workflow/mcp/tools/escalation.d.ts.map +1 -0
- package/dist/workflow/mcp/tools/escalation.js +47 -0
- package/dist/workflow/mcp/tools/escalation.js.map +1 -0
- package/dist/workflow/mcp/tools/execution.d.ts +59 -0
- package/dist/workflow/mcp/tools/execution.d.ts.map +1 -0
- package/dist/workflow/mcp/tools/execution.js +67 -0
- package/dist/workflow/mcp/tools/execution.js.map +1 -0
- package/dist/workflow/mcp/tools/inspection.d.ts +82 -0
- package/dist/workflow/mcp/tools/inspection.d.ts.map +1 -0
- package/dist/workflow/mcp/tools/inspection.js +57 -0
- package/dist/workflow/mcp/tools/inspection.js.map +1 -0
- package/dist/workflow/mcp/tools/workflow.d.ts +59 -0
- package/dist/workflow/mcp/tools/workflow.d.ts.map +1 -0
- package/dist/workflow/mcp/tools/workflow.js +40 -0
- package/dist/workflow/mcp/tools/workflow.js.map +1 -0
- package/dist/workflow/mcp/types.d.ts +345 -0
- package/dist/workflow/mcp/types.d.ts.map +1 -0
- package/dist/workflow/mcp/types.js +7 -0
- package/dist/workflow/mcp/types.js.map +1 -0
- package/dist/workflow/services/prompt-builder.d.ts +36 -0
- package/dist/workflow/services/prompt-builder.d.ts.map +1 -0
- package/dist/workflow/services/prompt-builder.js +329 -0
- package/dist/workflow/services/prompt-builder.js.map +1 -0
- package/dist/workflow/services/wakeup-service.d.ts +262 -0
- package/dist/workflow/services/wakeup-service.d.ts.map +1 -0
- package/dist/workflow/services/wakeup-service.js +809 -0
- package/dist/workflow/services/wakeup-service.js.map +1 -0
- package/dist/workflow/workflow-engine.d.ts +221 -0
- package/dist/workflow/workflow-engine.d.ts.map +1 -0
- package/dist/workflow/workflow-engine.js +94 -0
- package/dist/workflow/workflow-engine.js.map +1 -0
- package/dist/workflow/workflow-event-emitter.d.ts +278 -0
- package/dist/workflow/workflow-event-emitter.d.ts.map +1 -0
- package/dist/workflow/workflow-event-emitter.js +259 -0
- package/dist/workflow/workflow-event-emitter.js.map +1 -0
- package/package.json +8 -6
- package/dist/public/assets/index-DV9Tbujb.css +0 -1
- package/dist/public/assets/index-DcDX9-Ad.js +0 -740
- package/dist/public/assets/index-DcDX9-Ad.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Implements execute_issue, execution_status, and execution_cancel tools
|
|
5
|
+
* for the orchestrator agent to manage step executions.
|
|
6
|
+
*
|
|
7
|
+
* All operations go through the HTTP API client.
|
|
8
|
+
*/
|
|
9
|
+
import type { ExecutionStatus } from "@sudocode-ai/types";
|
|
10
|
+
import type { WorkflowMCPContext, ExecuteIssueParams, ExecutionStatusParams, ExecutionCancelParams, ToolResult } from "../types.js";
|
|
11
|
+
/**
|
|
12
|
+
* execute_issue response structure
|
|
13
|
+
*/
|
|
14
|
+
export interface ExecuteIssueResponse extends ToolResult {
|
|
15
|
+
execution_id: string;
|
|
16
|
+
worktree_path: string;
|
|
17
|
+
branch_name: string;
|
|
18
|
+
status: "pending" | "running";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* execution_status response structure
|
|
22
|
+
*/
|
|
23
|
+
export interface ExecutionStatusResponse {
|
|
24
|
+
id: string;
|
|
25
|
+
status: ExecutionStatus;
|
|
26
|
+
exit_code?: number;
|
|
27
|
+
error?: string;
|
|
28
|
+
summary?: string;
|
|
29
|
+
files_changed?: string[];
|
|
30
|
+
started_at?: string;
|
|
31
|
+
completed_at?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* execution_cancel response structure
|
|
35
|
+
*/
|
|
36
|
+
export interface ExecutionCancelResponse extends ToolResult {
|
|
37
|
+
message: string;
|
|
38
|
+
final_status: ExecutionStatus;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handle execute_issue tool call.
|
|
42
|
+
*
|
|
43
|
+
* Starts an execution for an issue within the workflow.
|
|
44
|
+
* Supports multiple worktree modes for different isolation strategies.
|
|
45
|
+
*/
|
|
46
|
+
export declare function handleExecuteIssue(context: WorkflowMCPContext, params: ExecuteIssueParams): Promise<ExecuteIssueResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* Handle execution_status tool call.
|
|
49
|
+
*
|
|
50
|
+
* Returns current status and details of an execution.
|
|
51
|
+
*/
|
|
52
|
+
export declare function handleExecutionStatus(context: WorkflowMCPContext, params: ExecutionStatusParams): Promise<ExecutionStatusResponse>;
|
|
53
|
+
/**
|
|
54
|
+
* Handle execution_cancel tool call.
|
|
55
|
+
*
|
|
56
|
+
* Cancels a running execution.
|
|
57
|
+
*/
|
|
58
|
+
export declare function handleExecutionCancel(context: WorkflowMCPContext, params: ExecutionCancelParams): Promise<ExecutionCancelResponse>;
|
|
59
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../../../src/workflow/mcp/tools/execution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,EACX,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,eAAe,CAAC;CAC/B;AAMD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,oBAAoB,CAAC,CAc/B;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAalC;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,uBAAuB,CAAC,CAkBlC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Implements execute_issue, execution_status, and execution_cancel tools
|
|
5
|
+
* for the orchestrator agent to manage step executions.
|
|
6
|
+
*
|
|
7
|
+
* All operations go through the HTTP API client.
|
|
8
|
+
*/
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Tool Handlers
|
|
11
|
+
// =============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Handle execute_issue tool call.
|
|
14
|
+
*
|
|
15
|
+
* Starts an execution for an issue within the workflow.
|
|
16
|
+
* Supports multiple worktree modes for different isolation strategies.
|
|
17
|
+
*/
|
|
18
|
+
export async function handleExecuteIssue(context, params) {
|
|
19
|
+
const result = await context.apiClient.executeIssue(params);
|
|
20
|
+
console.error(`[execute_issue] Started execution ${result.execution_id} for issue ${params.issue_id} in workflow ${context.workflowId}`);
|
|
21
|
+
return {
|
|
22
|
+
success: true,
|
|
23
|
+
execution_id: result.execution_id,
|
|
24
|
+
worktree_path: result.worktree_path || "",
|
|
25
|
+
branch_name: result.branch_name || "",
|
|
26
|
+
status: result.status,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Handle execution_status tool call.
|
|
31
|
+
*
|
|
32
|
+
* Returns current status and details of an execution.
|
|
33
|
+
*/
|
|
34
|
+
export async function handleExecutionStatus(context, params) {
|
|
35
|
+
const result = await context.apiClient.getExecutionStatus(params);
|
|
36
|
+
return {
|
|
37
|
+
id: result.id,
|
|
38
|
+
status: result.status,
|
|
39
|
+
exit_code: result.exit_code,
|
|
40
|
+
error: result.error,
|
|
41
|
+
summary: result.summary,
|
|
42
|
+
files_changed: result.files_changed?.map((f) => f.path),
|
|
43
|
+
started_at: result.started_at,
|
|
44
|
+
completed_at: result.completed_at,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Handle execution_cancel tool call.
|
|
49
|
+
*
|
|
50
|
+
* Cancels a running execution.
|
|
51
|
+
*/
|
|
52
|
+
export async function handleExecutionCancel(context, params) {
|
|
53
|
+
const { execution_id, reason } = params;
|
|
54
|
+
const result = await context.apiClient.cancelExecution(params);
|
|
55
|
+
if (reason) {
|
|
56
|
+
console.error(`[execution_cancel] Cancelled execution ${execution_id}: ${reason}`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
console.error(`[execution_cancel] Cancelled execution ${execution_id}`);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
success: result.success,
|
|
63
|
+
message: result.message,
|
|
64
|
+
final_status: result.final_status,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../../../src/workflow/mcp/tools/execution.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgDH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA2B,EAC3B,MAA0B;IAE1B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAE5D,OAAO,CAAC,KAAK,CACX,qCA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M,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,0CAA0C,YAAY,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,YAAY,EAAE,MAAM,CAAC,YAA+B;KACrD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspection MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Implements execution_trajectory and execution_changes tools
|
|
5
|
+
* for the orchestrator agent to inspect execution results.
|
|
6
|
+
*
|
|
7
|
+
* All operations go through the HTTP API client.
|
|
8
|
+
*/
|
|
9
|
+
import type { WorkflowMCPContext, ExecutionTrajectoryParams, ExecutionChangesParams } from "../types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Individual trajectory entry
|
|
12
|
+
*/
|
|
13
|
+
export interface TrajectoryEntry {
|
|
14
|
+
type: "tool_call" | "tool_result" | "message" | "error";
|
|
15
|
+
timestamp: string;
|
|
16
|
+
tool_name?: string;
|
|
17
|
+
tool_args?: Record<string, unknown>;
|
|
18
|
+
content?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Trajectory summary statistics
|
|
22
|
+
*/
|
|
23
|
+
export interface TrajectorySummary {
|
|
24
|
+
total_entries: number;
|
|
25
|
+
tool_calls: number;
|
|
26
|
+
errors: number;
|
|
27
|
+
duration_ms?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* execution_trajectory response structure
|
|
31
|
+
*/
|
|
32
|
+
export interface ExecutionTrajectoryResponse {
|
|
33
|
+
execution_id: string;
|
|
34
|
+
entries: TrajectoryEntry[];
|
|
35
|
+
summary: TrajectorySummary;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* File change info for response
|
|
39
|
+
*/
|
|
40
|
+
export interface FileChangeInfo {
|
|
41
|
+
path: string;
|
|
42
|
+
status: "added" | "modified" | "deleted" | "renamed";
|
|
43
|
+
additions: number;
|
|
44
|
+
deletions: number;
|
|
45
|
+
diff?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Commit info for response
|
|
49
|
+
*/
|
|
50
|
+
export interface CommitInfo {
|
|
51
|
+
hash: string;
|
|
52
|
+
message: string;
|
|
53
|
+
author: string;
|
|
54
|
+
timestamp: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* execution_changes response structure
|
|
58
|
+
*/
|
|
59
|
+
export interface ExecutionChangesResponse {
|
|
60
|
+
execution_id: string;
|
|
61
|
+
files: FileChangeInfo[];
|
|
62
|
+
commits: CommitInfo[];
|
|
63
|
+
summary: {
|
|
64
|
+
files_changed: number;
|
|
65
|
+
total_additions: number;
|
|
66
|
+
total_deletions: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Handle execution_trajectory tool call.
|
|
71
|
+
*
|
|
72
|
+
* Returns agent actions and tool calls from an execution.
|
|
73
|
+
* Useful for understanding what the agent did and debugging issues.
|
|
74
|
+
*/
|
|
75
|
+
export declare function handleExecutionTrajectory(context: WorkflowMCPContext, params: ExecutionTrajectoryParams): Promise<ExecutionTrajectoryResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Handle execution_changes tool call.
|
|
78
|
+
*
|
|
79
|
+
* Returns code changes made by an execution including files modified and commits.
|
|
80
|
+
*/
|
|
81
|
+
export declare function handleExecutionChanges(context: WorkflowMCPContext, params: ExecutionChangesParams): Promise<ExecutionChangesResponse>;
|
|
82
|
+
//# sourceMappingURL=inspection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection.d.ts","sourceRoot":"","sources":["../../../../src/workflow/mcp/tools/inspection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,aA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M,CAAC;KACzB,CAAC;CACH;AAMD;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,2BAA2B,CAAC,CActC;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAoBnC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inspection MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Implements execution_trajectory and execution_changes tools
|
|
5
|
+
* for the orchestrator agent to inspect execution results.
|
|
6
|
+
*
|
|
7
|
+
* All operations go through the HTTP API client.
|
|
8
|
+
*/
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Tool Handlers
|
|
11
|
+
// =============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Handle execution_trajectory tool call.
|
|
14
|
+
*
|
|
15
|
+
* Returns agent actions and tool calls from an execution.
|
|
16
|
+
* Useful for understanding what the agent did and debugging issues.
|
|
17
|
+
*/
|
|
18
|
+
export async function handleExecutionTrajectory(context, params) {
|
|
19
|
+
const result = await context.apiClient.getExecutionTrajectory(params);
|
|
20
|
+
return {
|
|
21
|
+
execution_id: result.execution_id,
|
|
22
|
+
entries: result.entries.map((e) => ({
|
|
23
|
+
type: e.type,
|
|
24
|
+
timestamp: e.timestamp,
|
|
25
|
+
tool_name: e.tool_name,
|
|
26
|
+
tool_args: e.tool_args,
|
|
27
|
+
content: e.content,
|
|
28
|
+
})),
|
|
29
|
+
summary: result.summary,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Handle execution_changes tool call.
|
|
34
|
+
*
|
|
35
|
+
* Returns code changes made by an execution including files modified and commits.
|
|
36
|
+
*/
|
|
37
|
+
export async function handleExecutionChanges(context, params) {
|
|
38
|
+
const result = await context.apiClient.getExecutionChanges(params);
|
|
39
|
+
return {
|
|
40
|
+
execution_id: result.execution_id,
|
|
41
|
+
files: result.files.map((f) => ({
|
|
42
|
+
path: f.path,
|
|
43
|
+
status: f.status,
|
|
44
|
+
additions: f.additions,
|
|
45
|
+
deletions: f.deletions,
|
|
46
|
+
diff: f.diff,
|
|
47
|
+
})),
|
|
48
|
+
commits: result.commits.map((c) => ({
|
|
49
|
+
hash: c.hash,
|
|
50
|
+
message: c.message,
|
|
51
|
+
author: c.author,
|
|
52
|
+
timestamp: c.timestamp,
|
|
53
|
+
})),
|
|
54
|
+
summary: result.summary,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=inspection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspection.js","sourceRoot":"","sources":["../../../../src/workflow/mcp/tools/inspection.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA6EH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,OAA2B,EAC3B,MAAiC;IAEjC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAEtE,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAA2B,EAC3B,MAA8B;IAE9B,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAEnE,OAAO;QACL,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9B,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,IAAI,EAAE,CAAC,CAAC,IAAI;SACb,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,SAAS,EAAE,CAAC,CAAC,SAAS;SACvB,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Control MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Implements workflow_status and workflow_complete tools
|
|
5
|
+
* for the orchestrator agent to manage workflow state.
|
|
6
|
+
*
|
|
7
|
+
* All operations go through the HTTP API client.
|
|
8
|
+
*/
|
|
9
|
+
import type { ExecutionStatus } from "@sudocode-ai/types";
|
|
10
|
+
import type { WorkflowMCPContext, WorkflowCompleteParams, ToolResult, WorkflowStatusResult } from "../types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Step info returned in workflow_status response
|
|
13
|
+
*/
|
|
14
|
+
export interface StepInfo {
|
|
15
|
+
id: string;
|
|
16
|
+
issueId: string;
|
|
17
|
+
issueTitle: string;
|
|
18
|
+
status: string;
|
|
19
|
+
executionId?: string;
|
|
20
|
+
dependsOn: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Active execution info returned in workflow_status response
|
|
24
|
+
*/
|
|
25
|
+
export interface ActiveExecutionInfo {
|
|
26
|
+
id: string;
|
|
27
|
+
stepId: string;
|
|
28
|
+
status: ExecutionStatus;
|
|
29
|
+
startedAt: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* workflow_status response structure
|
|
33
|
+
*/
|
|
34
|
+
export type WorkflowStatusResponse = WorkflowStatusResult;
|
|
35
|
+
/**
|
|
36
|
+
* workflow_complete response structure
|
|
37
|
+
*/
|
|
38
|
+
export interface WorkflowCompleteResponse extends ToolResult {
|
|
39
|
+
workflow_status: string;
|
|
40
|
+
completed_at: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Handle workflow_status tool call.
|
|
44
|
+
*
|
|
45
|
+
* Returns current workflow state including:
|
|
46
|
+
* - Workflow metadata
|
|
47
|
+
* - Step statuses with issue titles
|
|
48
|
+
* - Active executions
|
|
49
|
+
* - Ready steps (dependencies met, not started)
|
|
50
|
+
*/
|
|
51
|
+
export declare function handleWorkflowStatus(context: WorkflowMCPContext): Promise<WorkflowStatusResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Handle workflow_complete tool call.
|
|
54
|
+
*
|
|
55
|
+
* Marks the workflow as completed or failed with a summary.
|
|
56
|
+
* Validates that workflow is in a completable state.
|
|
57
|
+
*/
|
|
58
|
+
export declare function handleWorkflowComplete(context: WorkflowMCPContext, params: WorkflowCompleteParams): Promise<WorkflowCompleteResponse>;
|
|
59
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../../src/workflow/mcp/tools/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAMrB;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,UAAU;IAC1D,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,sBAAsB,CAAC,CAEjC;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,kBAAkB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAcnC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Control MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Implements workflow_status and workflow_complete tools
|
|
5
|
+
* for the orchestrator agent to manage workflow state.
|
|
6
|
+
*
|
|
7
|
+
* All operations go through the HTTP API client.
|
|
8
|
+
*/
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Tool Handlers
|
|
11
|
+
// =============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Handle workflow_status tool call.
|
|
14
|
+
*
|
|
15
|
+
* Returns current workflow state including:
|
|
16
|
+
* - Workflow metadata
|
|
17
|
+
* - Step statuses with issue titles
|
|
18
|
+
* - Active executions
|
|
19
|
+
* - Ready steps (dependencies met, not started)
|
|
20
|
+
*/
|
|
21
|
+
export async function handleWorkflowStatus(context) {
|
|
22
|
+
return context.apiClient.getWorkflowStatus();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Handle workflow_complete tool call.
|
|
26
|
+
*
|
|
27
|
+
* Marks the workflow as completed or failed with a summary.
|
|
28
|
+
* Validates that workflow is in a completable state.
|
|
29
|
+
*/
|
|
30
|
+
export async function handleWorkflowComplete(context, params) {
|
|
31
|
+
const { summary, status = "completed" } = params;
|
|
32
|
+
const result = await context.apiClient.completeWorkflow({ summary, status });
|
|
33
|
+
console.error(`[workflow_complete] Workflow ${context.workflowId} marked as ${result.workflow_status}: ${summary}`);
|
|
34
|
+
return {
|
|
35
|
+
success: true,
|
|
36
|
+
workflow_status: result.workflow_status,
|
|
37
|
+
completed_at: result.completed_at,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../../src/workflow/mcp/tools/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkDH,gFAAgF;AAChF,gBAAgB;AAChB,gFAAgF;AAEhF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAA2B;IAE3B,OAAO,OAAO,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAA2B,EAC3B,MAA8B;IAE9B,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC;IAEjD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;IAE7E,OAAO,CAAC,KAAK,CACX,gCAAgC,OAAO,CAAC,UAAU,cAAc,MAAM,CAAC,eAAe,KAAK,OAAO,EAAE,CACrG,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,YAAY,EAAE,MAAM,CAAC,YAAY;KAClC,CAAC;AACJ,CAAC"}
|