@sudocode-ai/local-server 0.1.10 → 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/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/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/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 +36 -0
- package/dist/services/execution-lifecycle.d.ts.map +1 -1
- package/dist/services/execution-lifecycle.js +87 -0
- 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 +90 -1
- 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/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-CQoCSnhl.css +0 -1
- package/dist/public/assets/index-iWE3gSYw.js +0 -758
- package/dist/public/assets/index-iWE3gSYw.js.map +0 -1
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow MCP Server Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for MCP tool parameters, results, and context.
|
|
5
|
+
*/
|
|
6
|
+
import type { AgentType, Workflow, WorkflowStep } from "@sudocode-ai/types";
|
|
7
|
+
/**
|
|
8
|
+
* Worktree isolation strategy for executions.
|
|
9
|
+
*/
|
|
10
|
+
export type WorktreeMode = "create_root" | "use_root" | "create_branch" | "use_branch";
|
|
11
|
+
/**
|
|
12
|
+
* Parameters for execute_issue tool.
|
|
13
|
+
*/
|
|
14
|
+
export interface ExecuteIssueParams {
|
|
15
|
+
/** Issue ID to execute */
|
|
16
|
+
issue_id: string;
|
|
17
|
+
/** Agent type to use (defaults to workflow config) */
|
|
18
|
+
agent_type?: AgentType;
|
|
19
|
+
/** Model override */
|
|
20
|
+
model?: string;
|
|
21
|
+
/** Worktree isolation strategy */
|
|
22
|
+
worktree_mode: WorktreeMode;
|
|
23
|
+
/** Execution ID to reuse worktree from (for use_root/use_branch) */
|
|
24
|
+
worktree_id?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parameters for execution_status tool.
|
|
28
|
+
*/
|
|
29
|
+
export interface ExecutionStatusParams {
|
|
30
|
+
/** Execution ID to check */
|
|
31
|
+
execution_id: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parameters for execution_cancel tool.
|
|
35
|
+
*/
|
|
36
|
+
export interface ExecutionCancelParams {
|
|
37
|
+
/** Execution ID to cancel */
|
|
38
|
+
execution_id: string;
|
|
39
|
+
/** Optional reason for cancellation */
|
|
40
|
+
reason?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parameters for execution_trajectory tool.
|
|
44
|
+
*/
|
|
45
|
+
export interface ExecutionTrajectoryParams {
|
|
46
|
+
/** Execution ID to get trajectory for */
|
|
47
|
+
execution_id: string;
|
|
48
|
+
/** Maximum entries to return (default: 50) */
|
|
49
|
+
max_entries?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Parameters for execution_changes tool.
|
|
53
|
+
*/
|
|
54
|
+
export interface ExecutionChangesParams {
|
|
55
|
+
/** Execution ID to get changes for */
|
|
56
|
+
execution_id: string;
|
|
57
|
+
/** Include full diff content (default: false) */
|
|
58
|
+
include_diff?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parameters for workflow_complete tool.
|
|
62
|
+
*/
|
|
63
|
+
export interface WorkflowCompleteParams {
|
|
64
|
+
/** Summary of work completed */
|
|
65
|
+
summary: string;
|
|
66
|
+
/** Final status (default: completed) */
|
|
67
|
+
status?: "completed" | "failed";
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Notification level for notify_user tool.
|
|
71
|
+
*/
|
|
72
|
+
export type NotificationLevel = "info" | "warning" | "error";
|
|
73
|
+
/**
|
|
74
|
+
* Parameters for escalate_to_user tool.
|
|
75
|
+
*/
|
|
76
|
+
export interface EscalateToUserParams {
|
|
77
|
+
/** Message displayed to user explaining what input is needed */
|
|
78
|
+
message: string;
|
|
79
|
+
/** Optional predefined options for user to choose from */
|
|
80
|
+
options?: string[];
|
|
81
|
+
/** Additional context for the escalation (passed back in response) */
|
|
82
|
+
context?: Record<string, unknown>;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Parameters for notify_user tool.
|
|
86
|
+
*/
|
|
87
|
+
export interface NotifyUserParams {
|
|
88
|
+
/** Notification message */
|
|
89
|
+
message: string;
|
|
90
|
+
/** Notification level (default: info) */
|
|
91
|
+
level?: NotificationLevel;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Parameters for merge_branch tool.
|
|
95
|
+
*/
|
|
96
|
+
export interface MergeBranchParams {
|
|
97
|
+
/** Source branch to merge from */
|
|
98
|
+
source_branch: string;
|
|
99
|
+
/** Target branch to merge into (defaults to workflow branch) */
|
|
100
|
+
target_branch?: string;
|
|
101
|
+
/** Merge strategy: auto (fast-forward if possible, else merge) or squash */
|
|
102
|
+
strategy?: "auto" | "squash";
|
|
103
|
+
/** Custom commit message for the merge */
|
|
104
|
+
message?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Event types the orchestrator can wait for.
|
|
108
|
+
*/
|
|
109
|
+
export type AwaitableEventType = "step_completed" | "step_failed" | "user_response" | "escalation_resolved" | "timeout";
|
|
110
|
+
/**
|
|
111
|
+
* Parameters for await_events tool.
|
|
112
|
+
*/
|
|
113
|
+
export interface AwaitEventsParams {
|
|
114
|
+
/** Event types to wait for. Wakeup triggers when ANY event occurs. */
|
|
115
|
+
event_types: AwaitableEventType[];
|
|
116
|
+
/** Optional: Only wake for events from these execution IDs */
|
|
117
|
+
execution_ids?: string[];
|
|
118
|
+
/** Optional: Maximum seconds to wait before auto-wakeup with timeout event */
|
|
119
|
+
timeout_seconds?: number;
|
|
120
|
+
/** Optional: Message to show in UI while waiting */
|
|
121
|
+
message?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Result from workflow_status tool.
|
|
125
|
+
*/
|
|
126
|
+
export interface WorkflowStatusResult {
|
|
127
|
+
workflow: {
|
|
128
|
+
id: string;
|
|
129
|
+
title: string;
|
|
130
|
+
status: Workflow["status"];
|
|
131
|
+
source: Workflow["source"];
|
|
132
|
+
config: Workflow["config"];
|
|
133
|
+
worktreePath?: string;
|
|
134
|
+
};
|
|
135
|
+
steps: Array<{
|
|
136
|
+
id: string;
|
|
137
|
+
issueId: string;
|
|
138
|
+
issueTitle: string;
|
|
139
|
+
status: WorkflowStep["status"];
|
|
140
|
+
executionId?: string;
|
|
141
|
+
dependsOn: string[];
|
|
142
|
+
}>;
|
|
143
|
+
activeExecutions: Array<{
|
|
144
|
+
id: string;
|
|
145
|
+
stepId: string;
|
|
146
|
+
status: string;
|
|
147
|
+
startedAt: string;
|
|
148
|
+
}>;
|
|
149
|
+
readySteps: string[];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Result from execute_issue tool.
|
|
153
|
+
*/
|
|
154
|
+
export interface ExecuteIssueResult {
|
|
155
|
+
execution_id: string;
|
|
156
|
+
worktree_path?: string;
|
|
157
|
+
branch_name?: string;
|
|
158
|
+
status: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Result from execution_status tool.
|
|
162
|
+
*/
|
|
163
|
+
export interface ExecutionStatusResult {
|
|
164
|
+
id: string;
|
|
165
|
+
status: string;
|
|
166
|
+
exit_code?: number;
|
|
167
|
+
error?: string;
|
|
168
|
+
summary?: string;
|
|
169
|
+
files_changed?: Array<{
|
|
170
|
+
path: string;
|
|
171
|
+
additions: number;
|
|
172
|
+
deletions: number;
|
|
173
|
+
}>;
|
|
174
|
+
started_at?: string;
|
|
175
|
+
completed_at?: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Result from execution_cancel tool.
|
|
179
|
+
*/
|
|
180
|
+
export interface ExecutionCancelResult {
|
|
181
|
+
success: boolean;
|
|
182
|
+
message: string;
|
|
183
|
+
final_status: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Result from execution_trajectory tool.
|
|
187
|
+
*/
|
|
188
|
+
export interface ExecutionTrajectoryResult {
|
|
189
|
+
execution_id: string;
|
|
190
|
+
entries: Array<{
|
|
191
|
+
type: "tool_call" | "tool_result" | "message" | "error";
|
|
192
|
+
timestamp: string;
|
|
193
|
+
tool_name?: string;
|
|
194
|
+
tool_args?: Record<string, unknown>;
|
|
195
|
+
content?: string;
|
|
196
|
+
}>;
|
|
197
|
+
summary: {
|
|
198
|
+
total_entries: number;
|
|
199
|
+
tool_calls: number;
|
|
200
|
+
errors: number;
|
|
201
|
+
duration_ms?: number;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Result from execution_changes tool.
|
|
206
|
+
*/
|
|
207
|
+
export interface ExecutionChangesResult {
|
|
208
|
+
execution_id: string;
|
|
209
|
+
files: Array<{
|
|
210
|
+
path: string;
|
|
211
|
+
status: "added" | "modified" | "deleted" | "renamed";
|
|
212
|
+
additions: number;
|
|
213
|
+
deletions: number;
|
|
214
|
+
diff?: string;
|
|
215
|
+
}>;
|
|
216
|
+
commits: Array<{
|
|
217
|
+
hash: string;
|
|
218
|
+
message: string;
|
|
219
|
+
author: string;
|
|
220
|
+
timestamp: string;
|
|
221
|
+
}>;
|
|
222
|
+
summary: {
|
|
223
|
+
files_changed: number;
|
|
224
|
+
total_additions: number;
|
|
225
|
+
total_deletions: number;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Result from workflow_complete tool.
|
|
230
|
+
*/
|
|
231
|
+
export interface WorkflowCompleteResult {
|
|
232
|
+
success: boolean;
|
|
233
|
+
workflow_status: Workflow["status"];
|
|
234
|
+
completed_at: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Status of escalation request.
|
|
238
|
+
*/
|
|
239
|
+
export type EscalationResultStatus = "pending" | "auto_approved";
|
|
240
|
+
/**
|
|
241
|
+
* Result from escalate_to_user tool.
|
|
242
|
+
*/
|
|
243
|
+
export interface EscalateToUserResult {
|
|
244
|
+
/** Status of the escalation */
|
|
245
|
+
status: EscalationResultStatus;
|
|
246
|
+
/** Escalation ID (for pending status) */
|
|
247
|
+
escalation_id?: string;
|
|
248
|
+
/** Message for orchestrator */
|
|
249
|
+
message: string;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Result from notify_user tool.
|
|
253
|
+
*/
|
|
254
|
+
export interface NotifyUserResult {
|
|
255
|
+
/** Whether notification was successfully queued */
|
|
256
|
+
success: boolean;
|
|
257
|
+
/** Whether notification was delivered (may be false if user not connected) */
|
|
258
|
+
delivered: boolean;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Result from merge_branch tool.
|
|
262
|
+
*/
|
|
263
|
+
export interface MergeBranchResult {
|
|
264
|
+
/** Whether the merge was successful */
|
|
265
|
+
success: boolean;
|
|
266
|
+
/** SHA of the merge commit (if successful) */
|
|
267
|
+
merge_commit?: string;
|
|
268
|
+
/** Strategy used for the merge */
|
|
269
|
+
strategy_used: "fast-forward" | "merge" | "squash";
|
|
270
|
+
/** List of files with conflicts (if merge failed) */
|
|
271
|
+
conflicting_files?: string[];
|
|
272
|
+
/** Error message (if merge failed) */
|
|
273
|
+
error?: string;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Result from await_events tool.
|
|
277
|
+
*/
|
|
278
|
+
export interface AwaitEventsResult {
|
|
279
|
+
/** Status - always "waiting" since tool returns immediately */
|
|
280
|
+
status: "waiting";
|
|
281
|
+
/** Unique ID for this await condition */
|
|
282
|
+
await_id: string;
|
|
283
|
+
/** Confirmation message */
|
|
284
|
+
message: string;
|
|
285
|
+
/** Event types being waited for */
|
|
286
|
+
will_wake_on: AwaitableEventType[];
|
|
287
|
+
/** When timeout will trigger (if specified) */
|
|
288
|
+
timeout_at?: string;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* API client interface for tool handlers.
|
|
292
|
+
* Matches the WorkflowAPIClient class interface.
|
|
293
|
+
*/
|
|
294
|
+
export interface WorkflowAPIClientInterface {
|
|
295
|
+
getWorkflowStatus(): Promise<WorkflowStatusResult>;
|
|
296
|
+
completeWorkflow(params: WorkflowCompleteParams): Promise<WorkflowCompleteResult>;
|
|
297
|
+
executeIssue(params: ExecuteIssueParams): Promise<ExecuteIssueResult>;
|
|
298
|
+
getExecutionStatus(params: ExecutionStatusParams): Promise<ExecutionStatusResult>;
|
|
299
|
+
cancelExecution(params: ExecutionCancelParams): Promise<ExecutionCancelResult>;
|
|
300
|
+
getExecutionTrajectory(params: ExecutionTrajectoryParams): Promise<ExecutionTrajectoryResult>;
|
|
301
|
+
getExecutionChanges(params: ExecutionChangesParams): Promise<ExecutionChangesResult>;
|
|
302
|
+
escalateToUser(params: EscalateToUserParams): Promise<EscalateToUserResult>;
|
|
303
|
+
notifyUser(params: NotifyUserParams): Promise<NotifyUserResult>;
|
|
304
|
+
mergeBranch(params: MergeBranchParams): Promise<MergeBranchResult>;
|
|
305
|
+
awaitEvents(params: AwaitEventsParams): Promise<AwaitEventsResult>;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Context passed to tool handlers.
|
|
309
|
+
*
|
|
310
|
+
* All communication with the main server goes through the API client.
|
|
311
|
+
* The MCP server does not have direct database access.
|
|
312
|
+
*/
|
|
313
|
+
export interface WorkflowMCPContext {
|
|
314
|
+
/** The workflow ID this server is managing */
|
|
315
|
+
workflowId: string;
|
|
316
|
+
/** API client for communicating with main server */
|
|
317
|
+
apiClient: WorkflowAPIClientInterface;
|
|
318
|
+
/** Path to the repository root */
|
|
319
|
+
repoPath: string;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Generic tool result wrapper.
|
|
323
|
+
*/
|
|
324
|
+
export interface ToolResult<T = unknown> {
|
|
325
|
+
success: boolean;
|
|
326
|
+
data?: T;
|
|
327
|
+
error?: string;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Tool definition for registration.
|
|
331
|
+
*/
|
|
332
|
+
export interface ToolDefinition {
|
|
333
|
+
name: string;
|
|
334
|
+
description: string;
|
|
335
|
+
inputSchema: {
|
|
336
|
+
type: "object";
|
|
337
|
+
properties: Record<string, unknown>;
|
|
338
|
+
required?: string[];
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Tool handler function signature.
|
|
343
|
+
*/
|
|
344
|
+
export type ToolHandler<TParams = unknown, TResult = unknown> = (params: TParams, context: WorkflowMCPContext) => Promise<ToolResult<TResult>>;
|
|
345
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/workflow/mcp/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAM5E;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,aAAa,GACb,UAAU,GACV,eAAe,GACf,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,qBAAqB;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,aAAa,EAAE,YAAY,CAAC;IAC5B,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,4BAA4B;IAC5B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;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,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnE,WAAW,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACpE;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,SAAS,EAAE,0BAA0B,CAAC;IACtC,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,CAC9D,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,kBAAkB,KACxB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/workflow/mcp/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowPromptBuilder
|
|
3
|
+
*
|
|
4
|
+
* Constructs prompts for the orchestrator agent.
|
|
5
|
+
* Builds initial prompts when workflows start and wakeup messages when events occur.
|
|
6
|
+
*/
|
|
7
|
+
import type { Workflow, WorkflowEvent, Issue, Execution } from "@sudocode-ai/types";
|
|
8
|
+
import type { ResolvedAwait } from "./wakeup-service.js";
|
|
9
|
+
/**
|
|
10
|
+
* Builds prompts and messages for the orchestrator agent.
|
|
11
|
+
*/
|
|
12
|
+
export declare class WorkflowPromptBuilder {
|
|
13
|
+
/**
|
|
14
|
+
* Build the initial prompt for the orchestrator when workflow starts.
|
|
15
|
+
* Includes: workflow source, config, available issues, relationships.
|
|
16
|
+
*/
|
|
17
|
+
buildInitialPrompt(workflow: Workflow, issues: Issue[]): string;
|
|
18
|
+
/**
|
|
19
|
+
* Build a wakeup message from workflow events.
|
|
20
|
+
* Summarizes what happened since last orchestrator interaction.
|
|
21
|
+
*
|
|
22
|
+
* @param events - Unprocessed workflow events
|
|
23
|
+
* @param executions - Map of execution ID to execution data
|
|
24
|
+
* @param resolvedAwait - Optional resolved await context (if woken from await_events)
|
|
25
|
+
*/
|
|
26
|
+
buildWakeupMessage(events: WorkflowEvent[], executions: Map<string, Execution>, resolvedAwait?: ResolvedAwait): string;
|
|
27
|
+
/**
|
|
28
|
+
* Create a compact summary of an execution result.
|
|
29
|
+
*/
|
|
30
|
+
summarizeExecution(execution: Execution): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get emoji for execution status
|
|
33
|
+
*/
|
|
34
|
+
private getStatusEmoji;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=prompt-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-builder.d.ts","sourceRoot":"","sources":["../../../src/workflow/services/prompt-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,QAAQ,EAGR,aAAa,EACb,KAAK,EACL,SAAS,EACV,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AA6FzD;;GAEG;AACH,qBAAa,qBAAqB;IAChC;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM;IAoF/D;;;;;;;OAOG;IACH,kBAAkB,CAChB,MAAM,EAAE,aAAa,EAAE,EACvB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,EAClC,aAAa,CAAC,EAAE,aAAa,GAC5B,MAAM;IAmHT;;OAEG;IACH,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IAqDhD;;OAEG;IACH,OAAO,CAAC,cAAc;CAgBvB"}
|