claude-mcp-workflow 0.1.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/.claude-plugin/plugin.json +13 -0
- package/.mcp.json +9 -0
- package/LICENSE +21 -0
- package/README.md +260 -0
- package/build/dashboard.d.ts +4 -0
- package/build/dashboard.d.ts.map +1 -0
- package/build/dashboard.js +91 -0
- package/build/dashboard.js.map +1 -0
- package/build/engine.d.ts +55 -0
- package/build/engine.d.ts.map +1 -0
- package/build/engine.js +486 -0
- package/build/engine.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +60 -0
- package/build/index.js.map +1 -0
- package/build/loader.d.ts +29 -0
- package/build/loader.d.ts.map +1 -0
- package/build/loader.js +166 -0
- package/build/loader.js.map +1 -0
- package/build/modifier.d.ts +42 -0
- package/build/modifier.d.ts.map +1 -0
- package/build/modifier.js +96 -0
- package/build/modifier.js.map +1 -0
- package/build/storage.d.ts +12 -0
- package/build/storage.d.ts.map +1 -0
- package/build/storage.js +62 -0
- package/build/storage.js.map +1 -0
- package/build/tools.d.ts +7 -0
- package/build/tools.d.ts.map +1 -0
- package/build/tools.js +316 -0
- package/build/tools.js.map +1 -0
- package/build/types.d.ts +417 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.js +82 -0
- package/build/types.js.map +1 -0
- package/dashboard/dagre.min.js +801 -0
- package/dashboard/index.html +652 -0
- package/hooks/hooks.json +24 -0
- package/hooks/workflow-cleanup.sh +51 -0
- package/hooks/workflow-start.sh +79 -0
- package/package.json +44 -0
- package/templates/bug-fix.yaml +283 -0
- package/templates/code-review.yaml +164 -0
- package/templates/coding.yaml +176 -0
- package/templates/debugging.yaml +162 -0
- package/templates/explore.yaml +90 -0
- package/templates/file-code.yaml +69 -0
- package/templates/file-review.yaml +164 -0
- package/templates/investigate.yaml +84 -0
- package/templates/master.yaml +202 -0
- package/templates/new-feature.yaml +41 -0
- package/templates/planning.yaml +85 -0
- package/templates/refactoring.yaml +56 -0
- package/templates/reflection.yaml +61 -0
- package/templates/skills/architecture/SKILL.md +55 -0
- package/templates/skills/coding-skill-selector/SKILL.md +25 -0
- package/templates/skills/lang-haxe/SKILL.md +257 -0
- package/templates/skills/lang-python/SKILL.md +16 -0
- package/templates/skills/math/SKILL.md +14 -0
- package/templates/skills/preferences/SKILL.md +25 -0
- package/templates/skills/task-delegation/SKILL.md +53 -0
- package/templates/skills/web-reading/SKILL.md +62 -0
- package/templates/subagent.yaml +67 -0
- package/templates/testing.yaml +120 -0
- package/templates/web-research.yaml +53 -0
package/build/types.d.ts
ADDED
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const StateDefinitionSchema: z.ZodObject<{
|
|
3
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
4
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
5
|
+
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
outcome: z.ZodOptional<z.ZodEnum<["complete", "fail", "needs_action"]>>;
|
|
7
|
+
max_visits: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
sub_workflow: z.ZodOptional<z.ZodString>;
|
|
9
|
+
on_complete: z.ZodOptional<z.ZodString>;
|
|
10
|
+
on_fail: z.ZodOptional<z.ZodString>;
|
|
11
|
+
task: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
prompt?: string | undefined;
|
|
14
|
+
transitions?: Record<string, string> | undefined;
|
|
15
|
+
terminal?: boolean | undefined;
|
|
16
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
17
|
+
max_visits?: number | undefined;
|
|
18
|
+
sub_workflow?: string | undefined;
|
|
19
|
+
on_complete?: string | undefined;
|
|
20
|
+
on_fail?: string | undefined;
|
|
21
|
+
task?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
prompt?: string | undefined;
|
|
24
|
+
transitions?: Record<string, string> | undefined;
|
|
25
|
+
terminal?: boolean | undefined;
|
|
26
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
27
|
+
max_visits?: number | undefined;
|
|
28
|
+
sub_workflow?: string | undefined;
|
|
29
|
+
on_complete?: string | undefined;
|
|
30
|
+
on_fail?: string | undefined;
|
|
31
|
+
task?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export type StateDefinition = z.infer<typeof StateDefinitionSchema>;
|
|
34
|
+
export declare const WorkflowDefinitionSchema: z.ZodObject<{
|
|
35
|
+
name: z.ZodString;
|
|
36
|
+
description: z.ZodOptional<z.ZodString>;
|
|
37
|
+
initial: z.ZodString;
|
|
38
|
+
max_transitions: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
39
|
+
states: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
40
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
41
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
42
|
+
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
outcome: z.ZodOptional<z.ZodEnum<["complete", "fail", "needs_action"]>>;
|
|
44
|
+
max_visits: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
sub_workflow: z.ZodOptional<z.ZodString>;
|
|
46
|
+
on_complete: z.ZodOptional<z.ZodString>;
|
|
47
|
+
on_fail: z.ZodOptional<z.ZodString>;
|
|
48
|
+
task: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
prompt?: string | undefined;
|
|
51
|
+
transitions?: Record<string, string> | undefined;
|
|
52
|
+
terminal?: boolean | undefined;
|
|
53
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
54
|
+
max_visits?: number | undefined;
|
|
55
|
+
sub_workflow?: string | undefined;
|
|
56
|
+
on_complete?: string | undefined;
|
|
57
|
+
on_fail?: string | undefined;
|
|
58
|
+
task?: string | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
prompt?: string | undefined;
|
|
61
|
+
transitions?: Record<string, string> | undefined;
|
|
62
|
+
terminal?: boolean | undefined;
|
|
63
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
64
|
+
max_visits?: number | undefined;
|
|
65
|
+
sub_workflow?: string | undefined;
|
|
66
|
+
on_complete?: string | undefined;
|
|
67
|
+
on_fail?: string | undefined;
|
|
68
|
+
task?: string | undefined;
|
|
69
|
+
}>>;
|
|
70
|
+
}, "strip", z.ZodTypeAny, {
|
|
71
|
+
name: string;
|
|
72
|
+
initial: string;
|
|
73
|
+
max_transitions: number;
|
|
74
|
+
states: Record<string, {
|
|
75
|
+
prompt?: string | undefined;
|
|
76
|
+
transitions?: Record<string, string> | undefined;
|
|
77
|
+
terminal?: boolean | undefined;
|
|
78
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
79
|
+
max_visits?: number | undefined;
|
|
80
|
+
sub_workflow?: string | undefined;
|
|
81
|
+
on_complete?: string | undefined;
|
|
82
|
+
on_fail?: string | undefined;
|
|
83
|
+
task?: string | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
name: string;
|
|
88
|
+
initial: string;
|
|
89
|
+
states: Record<string, {
|
|
90
|
+
prompt?: string | undefined;
|
|
91
|
+
transitions?: Record<string, string> | undefined;
|
|
92
|
+
terminal?: boolean | undefined;
|
|
93
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
94
|
+
max_visits?: number | undefined;
|
|
95
|
+
sub_workflow?: string | undefined;
|
|
96
|
+
on_complete?: string | undefined;
|
|
97
|
+
on_fail?: string | undefined;
|
|
98
|
+
task?: string | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
description?: string | undefined;
|
|
101
|
+
max_transitions?: number | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
export type WorkflowDefinition = z.infer<typeof WorkflowDefinitionSchema>;
|
|
104
|
+
export interface StackFrame {
|
|
105
|
+
readonly workflow: string;
|
|
106
|
+
readonly current_state: string;
|
|
107
|
+
readonly state_visits: Record<string, number>;
|
|
108
|
+
readonly total_transitions: number;
|
|
109
|
+
}
|
|
110
|
+
export interface HistoryEntry {
|
|
111
|
+
readonly frame: number;
|
|
112
|
+
readonly at: string;
|
|
113
|
+
readonly from?: string;
|
|
114
|
+
readonly to?: string;
|
|
115
|
+
readonly via?: string;
|
|
116
|
+
readonly event?: string;
|
|
117
|
+
readonly workflow?: string;
|
|
118
|
+
readonly actor?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface SessionState {
|
|
121
|
+
readonly session_id: string;
|
|
122
|
+
readonly parent_session_id?: string;
|
|
123
|
+
readonly stack: StackFrame[];
|
|
124
|
+
readonly active_frame: number;
|
|
125
|
+
readonly started_at: string;
|
|
126
|
+
readonly updated_at: string;
|
|
127
|
+
readonly history: HistoryEntry[];
|
|
128
|
+
readonly overrides: Record<string, WorkflowOverrides>;
|
|
129
|
+
readonly context: Record<string, unknown>;
|
|
130
|
+
readonly outcome?: "completed" | "abandoned";
|
|
131
|
+
readonly soft_terminal?: boolean;
|
|
132
|
+
readonly pending_pop?: {
|
|
133
|
+
readonly outcome: "complete" | "fail";
|
|
134
|
+
};
|
|
135
|
+
readonly global_state_visits?: Record<string, number>;
|
|
136
|
+
}
|
|
137
|
+
export interface WorkflowOverrides {
|
|
138
|
+
readonly add_states?: Record<string, StateDefinition>;
|
|
139
|
+
readonly modify_states?: Record<string, Partial<StateDefinition>>;
|
|
140
|
+
readonly add_transitions?: Array<{
|
|
141
|
+
from: string;
|
|
142
|
+
name: string;
|
|
143
|
+
to: string;
|
|
144
|
+
}>;
|
|
145
|
+
readonly remove_transitions?: Array<{
|
|
146
|
+
from: string;
|
|
147
|
+
name: string;
|
|
148
|
+
}>;
|
|
149
|
+
}
|
|
150
|
+
export declare const WorkflowStartInputSchema: z.ZodObject<{
|
|
151
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
152
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
153
|
+
parent_session_id: z.ZodOptional<z.ZodString>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
workflow?: string | undefined;
|
|
156
|
+
actor?: string | undefined;
|
|
157
|
+
parent_session_id?: string | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
workflow?: string | undefined;
|
|
160
|
+
actor?: string | undefined;
|
|
161
|
+
parent_session_id?: string | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
export declare const WorkflowTransitionInputSchema: z.ZodObject<{
|
|
164
|
+
session_id: z.ZodString;
|
|
165
|
+
transition: z.ZodString;
|
|
166
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
session_id: string;
|
|
169
|
+
transition: string;
|
|
170
|
+
actor?: string | undefined;
|
|
171
|
+
}, {
|
|
172
|
+
session_id: string;
|
|
173
|
+
transition: string;
|
|
174
|
+
actor?: string | undefined;
|
|
175
|
+
}>;
|
|
176
|
+
export declare const WorkflowStatusInputSchema: z.ZodObject<{
|
|
177
|
+
session_id: z.ZodString;
|
|
178
|
+
}, "strip", z.ZodTypeAny, {
|
|
179
|
+
session_id: string;
|
|
180
|
+
}, {
|
|
181
|
+
session_id: string;
|
|
182
|
+
}>;
|
|
183
|
+
export declare const WorkflowContextSetInputSchema: z.ZodObject<{
|
|
184
|
+
session_id: z.ZodString;
|
|
185
|
+
key: z.ZodString;
|
|
186
|
+
value: z.ZodUnknown;
|
|
187
|
+
actor: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, "strip", z.ZodTypeAny, {
|
|
189
|
+
session_id: string;
|
|
190
|
+
key: string;
|
|
191
|
+
value?: unknown;
|
|
192
|
+
actor?: string | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
session_id: string;
|
|
195
|
+
key: string;
|
|
196
|
+
value?: unknown;
|
|
197
|
+
actor?: string | undefined;
|
|
198
|
+
}>;
|
|
199
|
+
export declare const WorkflowModifyInputSchema: z.ZodObject<{
|
|
200
|
+
session_id: z.ZodString;
|
|
201
|
+
add_state: z.ZodOptional<z.ZodObject<{
|
|
202
|
+
name: z.ZodString;
|
|
203
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
204
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
205
|
+
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
outcome: z.ZodOptional<z.ZodEnum<["complete", "fail", "needs_action"]>>;
|
|
207
|
+
max_visits: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
sub_workflow: z.ZodOptional<z.ZodString>;
|
|
209
|
+
on_complete: z.ZodOptional<z.ZodString>;
|
|
210
|
+
on_fail: z.ZodOptional<z.ZodString>;
|
|
211
|
+
}, "strip", z.ZodTypeAny, {
|
|
212
|
+
name: string;
|
|
213
|
+
prompt?: string | undefined;
|
|
214
|
+
transitions?: Record<string, string> | undefined;
|
|
215
|
+
terminal?: boolean | undefined;
|
|
216
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
217
|
+
max_visits?: number | undefined;
|
|
218
|
+
sub_workflow?: string | undefined;
|
|
219
|
+
on_complete?: string | undefined;
|
|
220
|
+
on_fail?: string | undefined;
|
|
221
|
+
}, {
|
|
222
|
+
name: string;
|
|
223
|
+
prompt?: string | undefined;
|
|
224
|
+
transitions?: Record<string, string> | undefined;
|
|
225
|
+
terminal?: boolean | undefined;
|
|
226
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
227
|
+
max_visits?: number | undefined;
|
|
228
|
+
sub_workflow?: string | undefined;
|
|
229
|
+
on_complete?: string | undefined;
|
|
230
|
+
on_fail?: string | undefined;
|
|
231
|
+
}>>;
|
|
232
|
+
add_transition: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
from: z.ZodString;
|
|
234
|
+
name: z.ZodString;
|
|
235
|
+
to: z.ZodString;
|
|
236
|
+
}, "strip", z.ZodTypeAny, {
|
|
237
|
+
name: string;
|
|
238
|
+
from: string;
|
|
239
|
+
to: string;
|
|
240
|
+
}, {
|
|
241
|
+
name: string;
|
|
242
|
+
from: string;
|
|
243
|
+
to: string;
|
|
244
|
+
}>>;
|
|
245
|
+
remove_transition: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
from: z.ZodString;
|
|
247
|
+
name: z.ZodString;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
name: string;
|
|
250
|
+
from: string;
|
|
251
|
+
}, {
|
|
252
|
+
name: string;
|
|
253
|
+
from: string;
|
|
254
|
+
}>>;
|
|
255
|
+
}, "strip", z.ZodTypeAny, {
|
|
256
|
+
session_id: string;
|
|
257
|
+
add_state?: {
|
|
258
|
+
name: string;
|
|
259
|
+
prompt?: string | undefined;
|
|
260
|
+
transitions?: Record<string, string> | undefined;
|
|
261
|
+
terminal?: boolean | undefined;
|
|
262
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
263
|
+
max_visits?: number | undefined;
|
|
264
|
+
sub_workflow?: string | undefined;
|
|
265
|
+
on_complete?: string | undefined;
|
|
266
|
+
on_fail?: string | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
add_transition?: {
|
|
269
|
+
name: string;
|
|
270
|
+
from: string;
|
|
271
|
+
to: string;
|
|
272
|
+
} | undefined;
|
|
273
|
+
remove_transition?: {
|
|
274
|
+
name: string;
|
|
275
|
+
from: string;
|
|
276
|
+
} | undefined;
|
|
277
|
+
}, {
|
|
278
|
+
session_id: string;
|
|
279
|
+
add_state?: {
|
|
280
|
+
name: string;
|
|
281
|
+
prompt?: string | undefined;
|
|
282
|
+
transitions?: Record<string, string> | undefined;
|
|
283
|
+
terminal?: boolean | undefined;
|
|
284
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
285
|
+
max_visits?: number | undefined;
|
|
286
|
+
sub_workflow?: string | undefined;
|
|
287
|
+
on_complete?: string | undefined;
|
|
288
|
+
on_fail?: string | undefined;
|
|
289
|
+
} | undefined;
|
|
290
|
+
add_transition?: {
|
|
291
|
+
name: string;
|
|
292
|
+
from: string;
|
|
293
|
+
to: string;
|
|
294
|
+
} | undefined;
|
|
295
|
+
remove_transition?: {
|
|
296
|
+
name: string;
|
|
297
|
+
from: string;
|
|
298
|
+
} | undefined;
|
|
299
|
+
}>;
|
|
300
|
+
export declare const WorkflowCreateInputSchema: z.ZodObject<{
|
|
301
|
+
name: z.ZodString;
|
|
302
|
+
definition: z.ZodObject<{
|
|
303
|
+
description: z.ZodOptional<z.ZodString>;
|
|
304
|
+
initial: z.ZodString;
|
|
305
|
+
max_transitions: z.ZodOptional<z.ZodNumber>;
|
|
306
|
+
states: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
307
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
308
|
+
transitions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
309
|
+
terminal: z.ZodOptional<z.ZodBoolean>;
|
|
310
|
+
outcome: z.ZodOptional<z.ZodEnum<["complete", "fail", "needs_action"]>>;
|
|
311
|
+
max_visits: z.ZodOptional<z.ZodNumber>;
|
|
312
|
+
sub_workflow: z.ZodOptional<z.ZodString>;
|
|
313
|
+
on_complete: z.ZodOptional<z.ZodString>;
|
|
314
|
+
on_fail: z.ZodOptional<z.ZodString>;
|
|
315
|
+
task: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
prompt?: string | undefined;
|
|
318
|
+
transitions?: Record<string, string> | undefined;
|
|
319
|
+
terminal?: boolean | undefined;
|
|
320
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
321
|
+
max_visits?: number | undefined;
|
|
322
|
+
sub_workflow?: string | undefined;
|
|
323
|
+
on_complete?: string | undefined;
|
|
324
|
+
on_fail?: string | undefined;
|
|
325
|
+
task?: string | undefined;
|
|
326
|
+
}, {
|
|
327
|
+
prompt?: string | undefined;
|
|
328
|
+
transitions?: Record<string, string> | undefined;
|
|
329
|
+
terminal?: boolean | undefined;
|
|
330
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
331
|
+
max_visits?: number | undefined;
|
|
332
|
+
sub_workflow?: string | undefined;
|
|
333
|
+
on_complete?: string | undefined;
|
|
334
|
+
on_fail?: string | undefined;
|
|
335
|
+
task?: string | undefined;
|
|
336
|
+
}>>;
|
|
337
|
+
}, "strip", z.ZodTypeAny, {
|
|
338
|
+
initial: string;
|
|
339
|
+
states: Record<string, {
|
|
340
|
+
prompt?: string | undefined;
|
|
341
|
+
transitions?: Record<string, string> | undefined;
|
|
342
|
+
terminal?: boolean | undefined;
|
|
343
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
344
|
+
max_visits?: number | undefined;
|
|
345
|
+
sub_workflow?: string | undefined;
|
|
346
|
+
on_complete?: string | undefined;
|
|
347
|
+
on_fail?: string | undefined;
|
|
348
|
+
task?: string | undefined;
|
|
349
|
+
}>;
|
|
350
|
+
description?: string | undefined;
|
|
351
|
+
max_transitions?: number | undefined;
|
|
352
|
+
}, {
|
|
353
|
+
initial: string;
|
|
354
|
+
states: Record<string, {
|
|
355
|
+
prompt?: string | undefined;
|
|
356
|
+
transitions?: Record<string, string> | undefined;
|
|
357
|
+
terminal?: boolean | undefined;
|
|
358
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
359
|
+
max_visits?: number | undefined;
|
|
360
|
+
sub_workflow?: string | undefined;
|
|
361
|
+
on_complete?: string | undefined;
|
|
362
|
+
on_fail?: string | undefined;
|
|
363
|
+
task?: string | undefined;
|
|
364
|
+
}>;
|
|
365
|
+
description?: string | undefined;
|
|
366
|
+
max_transitions?: number | undefined;
|
|
367
|
+
}>;
|
|
368
|
+
}, "strip", z.ZodTypeAny, {
|
|
369
|
+
name: string;
|
|
370
|
+
definition: {
|
|
371
|
+
initial: string;
|
|
372
|
+
states: Record<string, {
|
|
373
|
+
prompt?: string | undefined;
|
|
374
|
+
transitions?: Record<string, string> | undefined;
|
|
375
|
+
terminal?: boolean | undefined;
|
|
376
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
377
|
+
max_visits?: number | undefined;
|
|
378
|
+
sub_workflow?: string | undefined;
|
|
379
|
+
on_complete?: string | undefined;
|
|
380
|
+
on_fail?: string | undefined;
|
|
381
|
+
task?: string | undefined;
|
|
382
|
+
}>;
|
|
383
|
+
description?: string | undefined;
|
|
384
|
+
max_transitions?: number | undefined;
|
|
385
|
+
};
|
|
386
|
+
}, {
|
|
387
|
+
name: string;
|
|
388
|
+
definition: {
|
|
389
|
+
initial: string;
|
|
390
|
+
states: Record<string, {
|
|
391
|
+
prompt?: string | undefined;
|
|
392
|
+
transitions?: Record<string, string> | undefined;
|
|
393
|
+
terminal?: boolean | undefined;
|
|
394
|
+
outcome?: "complete" | "fail" | "needs_action" | undefined;
|
|
395
|
+
max_visits?: number | undefined;
|
|
396
|
+
sub_workflow?: string | undefined;
|
|
397
|
+
on_complete?: string | undefined;
|
|
398
|
+
on_fail?: string | undefined;
|
|
399
|
+
task?: string | undefined;
|
|
400
|
+
}>;
|
|
401
|
+
description?: string | undefined;
|
|
402
|
+
max_transitions?: number | undefined;
|
|
403
|
+
};
|
|
404
|
+
}>;
|
|
405
|
+
export declare const WorkflowAbortInputSchema: z.ZodObject<{
|
|
406
|
+
session_id: z.ZodString;
|
|
407
|
+
}, "strip", z.ZodTypeAny, {
|
|
408
|
+
session_id: string;
|
|
409
|
+
}, {
|
|
410
|
+
session_id: string;
|
|
411
|
+
}>;
|
|
412
|
+
export declare const WorkflowListInputSchema: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
413
|
+
export declare const WorkflowSessionsInputSchema: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
414
|
+
export declare const MAX_STACK_DEPTH = 10;
|
|
415
|
+
export declare const DEFAULT_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,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrE;AAID,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAIxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;EAKxC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQpC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AAEH,eAAO,MAAM,uBAAuB,+DAA0B,CAAC;AAE/D,eAAO,MAAM,2BAA2B,+DAA0B,CAAC;AAInE,eAAO,MAAM,eAAe,KAAK,CAAC;AAClC,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,aAAa,OAAO,CAAC"}
|
package/build/types.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// --- Workflow Definition (parsed from YAML) ---
|
|
3
|
+
export const StateDefinitionSchema = z.object({
|
|
4
|
+
prompt: z.string().optional(),
|
|
5
|
+
transitions: z.record(z.string()).optional(),
|
|
6
|
+
terminal: z.boolean().optional(),
|
|
7
|
+
outcome: z.enum(["complete", "fail", "needs_action"]).optional(),
|
|
8
|
+
max_visits: z.number().int().positive().optional(),
|
|
9
|
+
sub_workflow: z.string().optional(),
|
|
10
|
+
on_complete: z.string().optional(),
|
|
11
|
+
on_fail: z.string().optional(),
|
|
12
|
+
task: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
export const WorkflowDefinitionSchema = z.object({
|
|
15
|
+
name: z.string().min(1),
|
|
16
|
+
description: z.string().optional(),
|
|
17
|
+
initial: z.string().min(1),
|
|
18
|
+
max_transitions: z.number().int().positive().optional().default(50),
|
|
19
|
+
states: z.record(StateDefinitionSchema),
|
|
20
|
+
});
|
|
21
|
+
// --- Tool input schemas ---
|
|
22
|
+
export const WorkflowStartInputSchema = z.object({
|
|
23
|
+
workflow: z.string().optional().describe("Name of the workflow to start. Defaults to \"master\""),
|
|
24
|
+
actor: z.string().optional().describe("Identity of the agent performing this action"),
|
|
25
|
+
parent_session_id: z.string().optional().describe("Parent session ID for sub-agent tracking"),
|
|
26
|
+
});
|
|
27
|
+
export const WorkflowTransitionInputSchema = z.object({
|
|
28
|
+
session_id: z.string().describe("Session identifier"),
|
|
29
|
+
transition: z.string().describe("Name of the transition to take"),
|
|
30
|
+
actor: z.string().optional().describe("Identity of the agent performing this action"),
|
|
31
|
+
});
|
|
32
|
+
export const WorkflowStatusInputSchema = z.object({
|
|
33
|
+
session_id: z.string().describe("Session identifier"),
|
|
34
|
+
});
|
|
35
|
+
export const WorkflowContextSetInputSchema = z.object({
|
|
36
|
+
session_id: z.string().describe("Session identifier"),
|
|
37
|
+
key: z.string().describe("Context key"),
|
|
38
|
+
value: z.unknown().describe("Context value"),
|
|
39
|
+
actor: z.string().optional().describe("Identity of the agent performing this action"),
|
|
40
|
+
});
|
|
41
|
+
export const WorkflowModifyInputSchema = z.object({
|
|
42
|
+
session_id: z.string().describe("Session identifier"),
|
|
43
|
+
add_state: z.object({
|
|
44
|
+
name: z.string(),
|
|
45
|
+
prompt: z.string().optional(),
|
|
46
|
+
transitions: z.record(z.string()).optional(),
|
|
47
|
+
terminal: z.boolean().optional(),
|
|
48
|
+
outcome: z.enum(["complete", "fail", "needs_action"]).optional(),
|
|
49
|
+
max_visits: z.number().int().positive().optional(),
|
|
50
|
+
sub_workflow: z.string().optional(),
|
|
51
|
+
on_complete: z.string().optional(),
|
|
52
|
+
on_fail: z.string().optional(),
|
|
53
|
+
}).optional().describe("Add a new state to the current workflow"),
|
|
54
|
+
add_transition: z.object({
|
|
55
|
+
from: z.string(),
|
|
56
|
+
name: z.string(),
|
|
57
|
+
to: z.string(),
|
|
58
|
+
}).optional().describe("Add a transition between states"),
|
|
59
|
+
remove_transition: z.object({
|
|
60
|
+
from: z.string(),
|
|
61
|
+
name: z.string(),
|
|
62
|
+
}).optional().describe("Remove a transition"),
|
|
63
|
+
});
|
|
64
|
+
export const WorkflowCreateInputSchema = z.object({
|
|
65
|
+
name: z.string().min(1).describe("Workflow name (used as filename)"),
|
|
66
|
+
definition: z.object({
|
|
67
|
+
description: z.string().optional(),
|
|
68
|
+
initial: z.string().min(1),
|
|
69
|
+
max_transitions: z.number().int().positive().optional(),
|
|
70
|
+
states: z.record(StateDefinitionSchema),
|
|
71
|
+
}).describe("Full workflow definition"),
|
|
72
|
+
});
|
|
73
|
+
export const WorkflowAbortInputSchema = z.object({
|
|
74
|
+
session_id: z.string().describe("Session identifier"),
|
|
75
|
+
});
|
|
76
|
+
export const WorkflowListInputSchema = z.object({}).optional();
|
|
77
|
+
export const WorkflowSessionsInputSchema = z.object({}).optional();
|
|
78
|
+
// --- Constants ---
|
|
79
|
+
export const MAX_STACK_DEPTH = 10;
|
|
80
|
+
export const DEFAULT_MAX_TRANSITIONS = 50;
|
|
81
|
+
export const LOCK_STALE_MS = 5000;
|
|
82
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iDAAiD;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM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