@sweny-ai/core 0.1.51 → 0.1.53
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/__tests__/publish.test.js +146 -0
- package/dist/__tests__/schema.test.js +156 -1
- package/dist/__tests__/skills.test.js +135 -4
- package/dist/__tests__/templates.test.d.ts +1 -0
- package/dist/__tests__/templates.test.js +49 -0
- package/dist/__tests__/version-consistency.test.js +7 -7
- package/dist/cli/config-file.d.ts +1 -1
- package/dist/cli/config-file.js +1 -1
- package/dist/cli/credentials.d.ts +1 -1
- package/dist/cli/credentials.js +1 -1
- package/dist/cli/credentials.test.js +1 -1
- package/dist/cli/e2e.d.ts +5 -1
- package/dist/cli/e2e.js +7 -3
- package/dist/cli/e2e.test.js +46 -1
- package/dist/cli/main.js +21 -7
- package/dist/cli/new.d.ts +101 -0
- package/dist/cli/new.js +670 -0
- package/dist/cli/new.test.d.ts +1 -0
- package/dist/cli/{init.test.js → new.test.js} +216 -78
- package/dist/cli/publish.d.ts +34 -0
- package/dist/cli/publish.js +368 -0
- package/dist/cli/templates.d.ts +13 -0
- package/dist/cli/templates.js +181 -0
- package/dist/executor.js +63 -20
- package/dist/executor.test.js +233 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +8 -0
- package/dist/mcp.test.js +67 -0
- package/dist/schema.d.ts +428 -18
- package/dist/schema.js +71 -4
- package/dist/skills/custom-loader.d.ts +12 -12
- package/dist/skills/custom-loader.js +105 -50
- package/dist/types.d.ts +18 -1
- package/dist/workflows/browser.js +3 -3
- package/package.json +10 -2
- package/dist/cli/init.d.ts +0 -53
- package/dist/cli/init.js +0 -521
- /package/dist/{cli/init.test.d.ts → __tests__/publish.test.d.ts} +0 -0
package/dist/schema.d.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* parsing untrusted input (JSON/YAML import, Studio editor).
|
|
8
8
|
*/
|
|
9
9
|
import { z } from "zod";
|
|
10
|
+
import type { Workflow } from "./types.js";
|
|
10
11
|
export declare const jsonSchemaZ: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
11
12
|
export declare const configFieldZ: z.ZodObject<{
|
|
12
13
|
description: z.ZodString;
|
|
@@ -40,12 +41,137 @@ export declare const toolZ: z.ZodObject<{
|
|
|
40
41
|
input_schema: Record<string, unknown>;
|
|
41
42
|
}>;
|
|
42
43
|
export declare const skillCategoryZ: z.ZodEnum<["git", "observability", "tasks", "notification", "general"]>;
|
|
43
|
-
export declare const
|
|
44
|
+
export declare const mcpServerConfigZ: z.ZodEffects<z.ZodObject<{
|
|
45
|
+
type: z.ZodOptional<z.ZodEnum<["stdio", "http"]>>;
|
|
46
|
+
command: z.ZodOptional<z.ZodString>;
|
|
47
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
48
|
+
url: z.ZodOptional<z.ZodString>;
|
|
49
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
50
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
type?: "stdio" | "http" | undefined;
|
|
53
|
+
url?: string | undefined;
|
|
54
|
+
headers?: Record<string, string> | undefined;
|
|
55
|
+
env?: Record<string, string> | undefined;
|
|
56
|
+
command?: string | undefined;
|
|
57
|
+
args?: string[] | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
type?: "stdio" | "http" | undefined;
|
|
60
|
+
url?: string | undefined;
|
|
61
|
+
headers?: Record<string, string> | undefined;
|
|
62
|
+
env?: Record<string, string> | undefined;
|
|
63
|
+
command?: string | undefined;
|
|
64
|
+
args?: string[] | undefined;
|
|
65
|
+
}>, {
|
|
66
|
+
type?: "stdio" | "http" | undefined;
|
|
67
|
+
url?: string | undefined;
|
|
68
|
+
headers?: Record<string, string> | undefined;
|
|
69
|
+
env?: Record<string, string> | undefined;
|
|
70
|
+
command?: string | undefined;
|
|
71
|
+
args?: string[] | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
type?: "stdio" | "http" | undefined;
|
|
74
|
+
url?: string | undefined;
|
|
75
|
+
headers?: Record<string, string> | undefined;
|
|
76
|
+
env?: Record<string, string> | undefined;
|
|
77
|
+
command?: string | undefined;
|
|
78
|
+
args?: string[] | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
export declare const skillDefinitionZ: z.ZodEffects<z.ZodObject<{
|
|
81
|
+
name: z.ZodOptional<z.ZodString>;
|
|
82
|
+
description: z.ZodOptional<z.ZodString>;
|
|
83
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
84
|
+
mcp: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
85
|
+
type: z.ZodOptional<z.ZodEnum<["stdio", "http"]>>;
|
|
86
|
+
command: z.ZodOptional<z.ZodString>;
|
|
87
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
88
|
+
url: z.ZodOptional<z.ZodString>;
|
|
89
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
90
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
type?: "stdio" | "http" | undefined;
|
|
93
|
+
url?: string | undefined;
|
|
94
|
+
headers?: Record<string, string> | undefined;
|
|
95
|
+
env?: Record<string, string> | undefined;
|
|
96
|
+
command?: string | undefined;
|
|
97
|
+
args?: string[] | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
type?: "stdio" | "http" | undefined;
|
|
100
|
+
url?: string | undefined;
|
|
101
|
+
headers?: Record<string, string> | undefined;
|
|
102
|
+
env?: Record<string, string> | undefined;
|
|
103
|
+
command?: string | undefined;
|
|
104
|
+
args?: string[] | undefined;
|
|
105
|
+
}>, {
|
|
106
|
+
type?: "stdio" | "http" | undefined;
|
|
107
|
+
url?: string | undefined;
|
|
108
|
+
headers?: Record<string, string> | undefined;
|
|
109
|
+
env?: Record<string, string> | undefined;
|
|
110
|
+
command?: string | undefined;
|
|
111
|
+
args?: string[] | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
type?: "stdio" | "http" | undefined;
|
|
114
|
+
url?: string | undefined;
|
|
115
|
+
headers?: Record<string, string> | undefined;
|
|
116
|
+
env?: Record<string, string> | undefined;
|
|
117
|
+
command?: string | undefined;
|
|
118
|
+
args?: string[] | undefined;
|
|
119
|
+
}>>;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
instruction?: string | undefined;
|
|
122
|
+
name?: string | undefined;
|
|
123
|
+
description?: string | undefined;
|
|
124
|
+
mcp?: {
|
|
125
|
+
type?: "stdio" | "http" | undefined;
|
|
126
|
+
url?: string | undefined;
|
|
127
|
+
headers?: Record<string, string> | undefined;
|
|
128
|
+
env?: Record<string, string> | undefined;
|
|
129
|
+
command?: string | undefined;
|
|
130
|
+
args?: string[] | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
}, {
|
|
133
|
+
instruction?: string | undefined;
|
|
134
|
+
name?: string | undefined;
|
|
135
|
+
description?: string | undefined;
|
|
136
|
+
mcp?: {
|
|
137
|
+
type?: "stdio" | "http" | undefined;
|
|
138
|
+
url?: string | undefined;
|
|
139
|
+
headers?: Record<string, string> | undefined;
|
|
140
|
+
env?: Record<string, string> | undefined;
|
|
141
|
+
command?: string | undefined;
|
|
142
|
+
args?: string[] | undefined;
|
|
143
|
+
} | undefined;
|
|
144
|
+
}>, {
|
|
145
|
+
instruction?: string | undefined;
|
|
146
|
+
name?: string | undefined;
|
|
147
|
+
description?: string | undefined;
|
|
148
|
+
mcp?: {
|
|
149
|
+
type?: "stdio" | "http" | undefined;
|
|
150
|
+
url?: string | undefined;
|
|
151
|
+
headers?: Record<string, string> | undefined;
|
|
152
|
+
env?: Record<string, string> | undefined;
|
|
153
|
+
command?: string | undefined;
|
|
154
|
+
args?: string[] | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
instruction?: string | undefined;
|
|
158
|
+
name?: string | undefined;
|
|
159
|
+
description?: string | undefined;
|
|
160
|
+
mcp?: {
|
|
161
|
+
type?: "stdio" | "http" | undefined;
|
|
162
|
+
url?: string | undefined;
|
|
163
|
+
headers?: Record<string, string> | undefined;
|
|
164
|
+
env?: Record<string, string> | undefined;
|
|
165
|
+
command?: string | undefined;
|
|
166
|
+
args?: string[] | undefined;
|
|
167
|
+
} | undefined;
|
|
168
|
+
}>;
|
|
169
|
+
export declare const skillZ: z.ZodEffects<z.ZodObject<{
|
|
44
170
|
id: z.ZodString;
|
|
45
171
|
name: z.ZodString;
|
|
46
172
|
description: z.ZodString;
|
|
47
173
|
category: z.ZodEnum<["git", "observability", "tasks", "notification", "general"]>;
|
|
48
|
-
config: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
174
|
+
config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
49
175
|
description: z.ZodString;
|
|
50
176
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
51
177
|
env: z.ZodOptional<z.ZodString>;
|
|
@@ -57,8 +183,8 @@ export declare const skillZ: z.ZodObject<{
|
|
|
57
183
|
description: string;
|
|
58
184
|
required?: boolean | undefined;
|
|
59
185
|
env?: string | undefined;
|
|
60
|
-
}
|
|
61
|
-
tools: z.ZodArray<z.ZodObject<{
|
|
186
|
+
}>>>;
|
|
187
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
62
188
|
name: z.ZodString;
|
|
63
189
|
description: z.ZodString;
|
|
64
190
|
input_schema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
@@ -70,10 +196,47 @@ export declare const skillZ: z.ZodObject<{
|
|
|
70
196
|
name: string;
|
|
71
197
|
description: string;
|
|
72
198
|
input_schema: Record<string, unknown>;
|
|
73
|
-
}>, "many"
|
|
199
|
+
}>, "many">>;
|
|
200
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
201
|
+
mcp: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
202
|
+
type: z.ZodOptional<z.ZodEnum<["stdio", "http"]>>;
|
|
203
|
+
command: z.ZodOptional<z.ZodString>;
|
|
204
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
205
|
+
url: z.ZodOptional<z.ZodString>;
|
|
206
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
207
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
type?: "stdio" | "http" | undefined;
|
|
210
|
+
url?: string | undefined;
|
|
211
|
+
headers?: Record<string, string> | undefined;
|
|
212
|
+
env?: Record<string, string> | undefined;
|
|
213
|
+
command?: string | undefined;
|
|
214
|
+
args?: string[] | undefined;
|
|
215
|
+
}, {
|
|
216
|
+
type?: "stdio" | "http" | undefined;
|
|
217
|
+
url?: string | undefined;
|
|
218
|
+
headers?: Record<string, string> | undefined;
|
|
219
|
+
env?: Record<string, string> | undefined;
|
|
220
|
+
command?: string | undefined;
|
|
221
|
+
args?: string[] | undefined;
|
|
222
|
+
}>, {
|
|
223
|
+
type?: "stdio" | "http" | undefined;
|
|
224
|
+
url?: string | undefined;
|
|
225
|
+
headers?: Record<string, string> | undefined;
|
|
226
|
+
env?: Record<string, string> | undefined;
|
|
227
|
+
command?: string | undefined;
|
|
228
|
+
args?: string[] | undefined;
|
|
229
|
+
}, {
|
|
230
|
+
type?: "stdio" | "http" | undefined;
|
|
231
|
+
url?: string | undefined;
|
|
232
|
+
headers?: Record<string, string> | undefined;
|
|
233
|
+
env?: Record<string, string> | undefined;
|
|
234
|
+
command?: string | undefined;
|
|
235
|
+
args?: string[] | undefined;
|
|
236
|
+
}>>;
|
|
74
237
|
}, "strip", z.ZodTypeAny, {
|
|
75
|
-
id: string;
|
|
76
238
|
name: string;
|
|
239
|
+
id: string;
|
|
77
240
|
description: string;
|
|
78
241
|
category: "git" | "observability" | "tasks" | "notification" | "general";
|
|
79
242
|
config: Record<string, {
|
|
@@ -86,9 +249,42 @@ export declare const skillZ: z.ZodObject<{
|
|
|
86
249
|
description: string;
|
|
87
250
|
input_schema: Record<string, unknown>;
|
|
88
251
|
}[];
|
|
252
|
+
instruction?: string | undefined;
|
|
253
|
+
mcp?: {
|
|
254
|
+
type?: "stdio" | "http" | undefined;
|
|
255
|
+
url?: string | undefined;
|
|
256
|
+
headers?: Record<string, string> | undefined;
|
|
257
|
+
env?: Record<string, string> | undefined;
|
|
258
|
+
command?: string | undefined;
|
|
259
|
+
args?: string[] | undefined;
|
|
260
|
+
} | undefined;
|
|
89
261
|
}, {
|
|
262
|
+
name: string;
|
|
90
263
|
id: string;
|
|
264
|
+
description: string;
|
|
265
|
+
category: "git" | "observability" | "tasks" | "notification" | "general";
|
|
266
|
+
instruction?: string | undefined;
|
|
267
|
+
mcp?: {
|
|
268
|
+
type?: "stdio" | "http" | undefined;
|
|
269
|
+
url?: string | undefined;
|
|
270
|
+
headers?: Record<string, string> | undefined;
|
|
271
|
+
env?: Record<string, string> | undefined;
|
|
272
|
+
command?: string | undefined;
|
|
273
|
+
args?: string[] | undefined;
|
|
274
|
+
} | undefined;
|
|
275
|
+
config?: Record<string, {
|
|
276
|
+
description: string;
|
|
277
|
+
required?: boolean | undefined;
|
|
278
|
+
env?: string | undefined;
|
|
279
|
+
}> | undefined;
|
|
280
|
+
tools?: {
|
|
281
|
+
name: string;
|
|
282
|
+
description: string;
|
|
283
|
+
input_schema: Record<string, unknown>;
|
|
284
|
+
}[] | undefined;
|
|
285
|
+
}>, {
|
|
91
286
|
name: string;
|
|
287
|
+
id: string;
|
|
92
288
|
description: string;
|
|
93
289
|
category: "git" | "observability" | "tasks" | "notification" | "general";
|
|
94
290
|
config: Record<string, {
|
|
@@ -101,6 +297,39 @@ export declare const skillZ: z.ZodObject<{
|
|
|
101
297
|
description: string;
|
|
102
298
|
input_schema: Record<string, unknown>;
|
|
103
299
|
}[];
|
|
300
|
+
instruction?: string | undefined;
|
|
301
|
+
mcp?: {
|
|
302
|
+
type?: "stdio" | "http" | undefined;
|
|
303
|
+
url?: string | undefined;
|
|
304
|
+
headers?: Record<string, string> | undefined;
|
|
305
|
+
env?: Record<string, string> | undefined;
|
|
306
|
+
command?: string | undefined;
|
|
307
|
+
args?: string[] | undefined;
|
|
308
|
+
} | undefined;
|
|
309
|
+
}, {
|
|
310
|
+
name: string;
|
|
311
|
+
id: string;
|
|
312
|
+
description: string;
|
|
313
|
+
category: "git" | "observability" | "tasks" | "notification" | "general";
|
|
314
|
+
instruction?: string | undefined;
|
|
315
|
+
mcp?: {
|
|
316
|
+
type?: "stdio" | "http" | undefined;
|
|
317
|
+
url?: string | undefined;
|
|
318
|
+
headers?: Record<string, string> | undefined;
|
|
319
|
+
env?: Record<string, string> | undefined;
|
|
320
|
+
command?: string | undefined;
|
|
321
|
+
args?: string[] | undefined;
|
|
322
|
+
} | undefined;
|
|
323
|
+
config?: Record<string, {
|
|
324
|
+
description: string;
|
|
325
|
+
required?: boolean | undefined;
|
|
326
|
+
env?: string | undefined;
|
|
327
|
+
}> | undefined;
|
|
328
|
+
tools?: {
|
|
329
|
+
name: string;
|
|
330
|
+
description: string;
|
|
331
|
+
input_schema: Record<string, unknown>;
|
|
332
|
+
}[] | undefined;
|
|
104
333
|
}>;
|
|
105
334
|
export declare const nodeZ: z.ZodObject<{
|
|
106
335
|
name: z.ZodString;
|
|
@@ -108,15 +337,15 @@ export declare const nodeZ: z.ZodObject<{
|
|
|
108
337
|
skills: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
109
338
|
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
110
339
|
}, "strip", z.ZodTypeAny, {
|
|
111
|
-
skills: string[];
|
|
112
340
|
instruction: string;
|
|
113
341
|
name: string;
|
|
342
|
+
skills: string[];
|
|
114
343
|
output?: Record<string, unknown> | undefined;
|
|
115
344
|
}, {
|
|
116
345
|
instruction: string;
|
|
117
346
|
name: string;
|
|
118
|
-
skills?: string[] | undefined;
|
|
119
347
|
output?: Record<string, unknown> | undefined;
|
|
348
|
+
skills?: string[] | undefined;
|
|
120
349
|
}>;
|
|
121
350
|
export declare const edgeZ: z.ZodObject<{
|
|
122
351
|
from: z.ZodString;
|
|
@@ -144,15 +373,15 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
144
373
|
skills: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
145
374
|
output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
146
375
|
}, "strip", z.ZodTypeAny, {
|
|
147
|
-
skills: string[];
|
|
148
376
|
instruction: string;
|
|
149
377
|
name: string;
|
|
378
|
+
skills: string[];
|
|
150
379
|
output?: Record<string, unknown> | undefined;
|
|
151
380
|
}, {
|
|
152
381
|
instruction: string;
|
|
153
382
|
name: string;
|
|
154
|
-
skills?: string[] | undefined;
|
|
155
383
|
output?: Record<string, unknown> | undefined;
|
|
384
|
+
skills?: string[] | undefined;
|
|
156
385
|
}>>;
|
|
157
386
|
edges: z.ZodArray<z.ZodObject<{
|
|
158
387
|
from: z.ZodString;
|
|
@@ -171,14 +400,116 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
171
400
|
max_iterations?: number | undefined;
|
|
172
401
|
}>, "many">;
|
|
173
402
|
entry: z.ZodString;
|
|
403
|
+
skills: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
404
|
+
name: z.ZodOptional<z.ZodString>;
|
|
405
|
+
description: z.ZodOptional<z.ZodString>;
|
|
406
|
+
instruction: z.ZodOptional<z.ZodString>;
|
|
407
|
+
mcp: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
408
|
+
type: z.ZodOptional<z.ZodEnum<["stdio", "http"]>>;
|
|
409
|
+
command: z.ZodOptional<z.ZodString>;
|
|
410
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
411
|
+
url: z.ZodOptional<z.ZodString>;
|
|
412
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
413
|
+
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
414
|
+
}, "strip", z.ZodTypeAny, {
|
|
415
|
+
type?: "stdio" | "http" | undefined;
|
|
416
|
+
url?: string | undefined;
|
|
417
|
+
headers?: Record<string, string> | undefined;
|
|
418
|
+
env?: Record<string, string> | undefined;
|
|
419
|
+
command?: string | undefined;
|
|
420
|
+
args?: string[] | undefined;
|
|
421
|
+
}, {
|
|
422
|
+
type?: "stdio" | "http" | undefined;
|
|
423
|
+
url?: string | undefined;
|
|
424
|
+
headers?: Record<string, string> | undefined;
|
|
425
|
+
env?: Record<string, string> | undefined;
|
|
426
|
+
command?: string | undefined;
|
|
427
|
+
args?: string[] | undefined;
|
|
428
|
+
}>, {
|
|
429
|
+
type?: "stdio" | "http" | undefined;
|
|
430
|
+
url?: string | undefined;
|
|
431
|
+
headers?: Record<string, string> | undefined;
|
|
432
|
+
env?: Record<string, string> | undefined;
|
|
433
|
+
command?: string | undefined;
|
|
434
|
+
args?: string[] | undefined;
|
|
435
|
+
}, {
|
|
436
|
+
type?: "stdio" | "http" | undefined;
|
|
437
|
+
url?: string | undefined;
|
|
438
|
+
headers?: Record<string, string> | undefined;
|
|
439
|
+
env?: Record<string, string> | undefined;
|
|
440
|
+
command?: string | undefined;
|
|
441
|
+
args?: string[] | undefined;
|
|
442
|
+
}>>;
|
|
443
|
+
}, "strip", z.ZodTypeAny, {
|
|
444
|
+
instruction?: string | undefined;
|
|
445
|
+
name?: string | undefined;
|
|
446
|
+
description?: string | undefined;
|
|
447
|
+
mcp?: {
|
|
448
|
+
type?: "stdio" | "http" | undefined;
|
|
449
|
+
url?: string | undefined;
|
|
450
|
+
headers?: Record<string, string> | undefined;
|
|
451
|
+
env?: Record<string, string> | undefined;
|
|
452
|
+
command?: string | undefined;
|
|
453
|
+
args?: string[] | undefined;
|
|
454
|
+
} | undefined;
|
|
455
|
+
}, {
|
|
456
|
+
instruction?: string | undefined;
|
|
457
|
+
name?: string | undefined;
|
|
458
|
+
description?: string | undefined;
|
|
459
|
+
mcp?: {
|
|
460
|
+
type?: "stdio" | "http" | undefined;
|
|
461
|
+
url?: string | undefined;
|
|
462
|
+
headers?: Record<string, string> | undefined;
|
|
463
|
+
env?: Record<string, string> | undefined;
|
|
464
|
+
command?: string | undefined;
|
|
465
|
+
args?: string[] | undefined;
|
|
466
|
+
} | undefined;
|
|
467
|
+
}>, {
|
|
468
|
+
instruction?: string | undefined;
|
|
469
|
+
name?: string | undefined;
|
|
470
|
+
description?: string | undefined;
|
|
471
|
+
mcp?: {
|
|
472
|
+
type?: "stdio" | "http" | undefined;
|
|
473
|
+
url?: string | undefined;
|
|
474
|
+
headers?: Record<string, string> | undefined;
|
|
475
|
+
env?: Record<string, string> | undefined;
|
|
476
|
+
command?: string | undefined;
|
|
477
|
+
args?: string[] | undefined;
|
|
478
|
+
} | undefined;
|
|
479
|
+
}, {
|
|
480
|
+
instruction?: string | undefined;
|
|
481
|
+
name?: string | undefined;
|
|
482
|
+
description?: string | undefined;
|
|
483
|
+
mcp?: {
|
|
484
|
+
type?: "stdio" | "http" | undefined;
|
|
485
|
+
url?: string | undefined;
|
|
486
|
+
headers?: Record<string, string> | undefined;
|
|
487
|
+
env?: Record<string, string> | undefined;
|
|
488
|
+
command?: string | undefined;
|
|
489
|
+
args?: string[] | undefined;
|
|
490
|
+
} | undefined;
|
|
491
|
+
}>>>;
|
|
174
492
|
}, "strip", z.ZodTypeAny, {
|
|
175
|
-
id: string;
|
|
176
493
|
name: string;
|
|
494
|
+
id: string;
|
|
177
495
|
description: string;
|
|
496
|
+
skills: Record<string, {
|
|
497
|
+
instruction?: string | undefined;
|
|
498
|
+
name?: string | undefined;
|
|
499
|
+
description?: string | undefined;
|
|
500
|
+
mcp?: {
|
|
501
|
+
type?: "stdio" | "http" | undefined;
|
|
502
|
+
url?: string | undefined;
|
|
503
|
+
headers?: Record<string, string> | undefined;
|
|
504
|
+
env?: Record<string, string> | undefined;
|
|
505
|
+
command?: string | undefined;
|
|
506
|
+
args?: string[] | undefined;
|
|
507
|
+
} | undefined;
|
|
508
|
+
}>;
|
|
178
509
|
nodes: Record<string, {
|
|
179
|
-
skills: string[];
|
|
180
510
|
instruction: string;
|
|
181
511
|
name: string;
|
|
512
|
+
skills: string[];
|
|
182
513
|
output?: Record<string, unknown> | undefined;
|
|
183
514
|
}>;
|
|
184
515
|
edges: {
|
|
@@ -189,13 +520,13 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
189
520
|
}[];
|
|
190
521
|
entry: string;
|
|
191
522
|
}, {
|
|
192
|
-
id: string;
|
|
193
523
|
name: string;
|
|
524
|
+
id: string;
|
|
194
525
|
nodes: Record<string, {
|
|
195
526
|
instruction: string;
|
|
196
527
|
name: string;
|
|
197
|
-
skills?: string[] | undefined;
|
|
198
528
|
output?: Record<string, unknown> | undefined;
|
|
529
|
+
skills?: string[] | undefined;
|
|
199
530
|
}>;
|
|
200
531
|
edges: {
|
|
201
532
|
to: string;
|
|
@@ -205,16 +536,42 @@ export declare const workflowZ: z.ZodObject<{
|
|
|
205
536
|
}[];
|
|
206
537
|
entry: string;
|
|
207
538
|
description?: string | undefined;
|
|
539
|
+
skills?: Record<string, {
|
|
540
|
+
instruction?: string | undefined;
|
|
541
|
+
name?: string | undefined;
|
|
542
|
+
description?: string | undefined;
|
|
543
|
+
mcp?: {
|
|
544
|
+
type?: "stdio" | "http" | undefined;
|
|
545
|
+
url?: string | undefined;
|
|
546
|
+
headers?: Record<string, string> | undefined;
|
|
547
|
+
env?: Record<string, string> | undefined;
|
|
548
|
+
command?: string | undefined;
|
|
549
|
+
args?: string[] | undefined;
|
|
550
|
+
} | undefined;
|
|
551
|
+
}> | undefined;
|
|
208
552
|
}>;
|
|
209
553
|
/** Parse + validate a raw object as a Workflow. Throws on invalid input. */
|
|
210
554
|
export declare function parseWorkflow(raw: unknown): {
|
|
211
|
-
id: string;
|
|
212
555
|
name: string;
|
|
556
|
+
id: string;
|
|
213
557
|
description: string;
|
|
558
|
+
skills: Record<string, {
|
|
559
|
+
instruction?: string | undefined;
|
|
560
|
+
name?: string | undefined;
|
|
561
|
+
description?: string | undefined;
|
|
562
|
+
mcp?: {
|
|
563
|
+
type?: "stdio" | "http" | undefined;
|
|
564
|
+
url?: string | undefined;
|
|
565
|
+
headers?: Record<string, string> | undefined;
|
|
566
|
+
env?: Record<string, string> | undefined;
|
|
567
|
+
command?: string | undefined;
|
|
568
|
+
args?: string[] | undefined;
|
|
569
|
+
} | undefined;
|
|
570
|
+
}>;
|
|
214
571
|
nodes: Record<string, {
|
|
215
|
-
skills: string[];
|
|
216
572
|
instruction: string;
|
|
217
573
|
name: string;
|
|
574
|
+
skills: string[];
|
|
218
575
|
output?: Record<string, unknown> | undefined;
|
|
219
576
|
}>;
|
|
220
577
|
edges: {
|
|
@@ -226,7 +583,7 @@ export declare function parseWorkflow(raw: unknown): {
|
|
|
226
583
|
entry: string;
|
|
227
584
|
};
|
|
228
585
|
export interface WorkflowError {
|
|
229
|
-
code: "MISSING_ENTRY" | "UNKNOWN_EDGE_SOURCE" | "UNKNOWN_EDGE_TARGET" | "UNREACHABLE_NODE" | "UNKNOWN_SKILL" | "SELF_LOOP" | "UNBOUNDED_CYCLE";
|
|
586
|
+
code: "MISSING_ENTRY" | "UNKNOWN_EDGE_SOURCE" | "UNKNOWN_EDGE_TARGET" | "UNREACHABLE_NODE" | "UNKNOWN_SKILL" | "SELF_LOOP" | "UNBOUNDED_CYCLE" | "INVALID_INLINE_SKILL";
|
|
230
587
|
message: string;
|
|
231
588
|
nodeId?: string;
|
|
232
589
|
}
|
|
@@ -244,7 +601,7 @@ export interface WorkflowError {
|
|
|
244
601
|
* Note: nodes with no outgoing edges are valid terminal nodes — the executor
|
|
245
602
|
* returns null when it reaches one, ending the workflow cleanly.
|
|
246
603
|
*/
|
|
247
|
-
export declare function validateWorkflow(workflow: z.infer<typeof workflowZ>, knownSkills?: Set<string>): WorkflowError[];
|
|
604
|
+
export declare function validateWorkflow(workflow: Workflow | z.infer<typeof workflowZ>, knownSkills?: Set<string>): WorkflowError[];
|
|
248
605
|
/**
|
|
249
606
|
* Static JSON Schema for the Workflow type.
|
|
250
607
|
* Use this for external validation (YAML files, Studio import, CI checks).
|
|
@@ -331,5 +688,58 @@ export declare const workflowJsonSchema: {
|
|
|
331
688
|
};
|
|
332
689
|
};
|
|
333
690
|
};
|
|
691
|
+
readonly skills: {
|
|
692
|
+
readonly type: "object";
|
|
693
|
+
readonly description: "Inline skill definitions scoped to this workflow";
|
|
694
|
+
readonly additionalProperties: {
|
|
695
|
+
readonly type: "object";
|
|
696
|
+
readonly properties: {
|
|
697
|
+
readonly name: {
|
|
698
|
+
readonly type: "string";
|
|
699
|
+
};
|
|
700
|
+
readonly description: {
|
|
701
|
+
readonly type: "string";
|
|
702
|
+
};
|
|
703
|
+
readonly instruction: {
|
|
704
|
+
readonly type: "string";
|
|
705
|
+
readonly description: "Natural language expertise injected into the node prompt";
|
|
706
|
+
};
|
|
707
|
+
readonly mcp: {
|
|
708
|
+
readonly type: "object";
|
|
709
|
+
readonly description: "External MCP server definition";
|
|
710
|
+
readonly properties: {
|
|
711
|
+
readonly type: {
|
|
712
|
+
readonly type: "string";
|
|
713
|
+
readonly enum: readonly ["stdio", "http"];
|
|
714
|
+
};
|
|
715
|
+
readonly command: {
|
|
716
|
+
readonly type: "string";
|
|
717
|
+
};
|
|
718
|
+
readonly args: {
|
|
719
|
+
readonly type: "array";
|
|
720
|
+
readonly items: {
|
|
721
|
+
readonly type: "string";
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
readonly url: {
|
|
725
|
+
readonly type: "string";
|
|
726
|
+
};
|
|
727
|
+
readonly headers: {
|
|
728
|
+
readonly type: "object";
|
|
729
|
+
readonly additionalProperties: {
|
|
730
|
+
readonly type: "string";
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
readonly env: {
|
|
734
|
+
readonly type: "object";
|
|
735
|
+
readonly additionalProperties: {
|
|
736
|
+
readonly type: "string";
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
};
|
|
334
744
|
};
|
|
335
745
|
};
|
package/dist/schema.js
CHANGED
|
@@ -25,13 +25,41 @@ export const toolZ = z.object({
|
|
|
25
25
|
input_schema: jsonSchemaZ,
|
|
26
26
|
});
|
|
27
27
|
export const skillCategoryZ = z.enum(["git", "observability", "tasks", "notification", "general"]);
|
|
28
|
-
export const
|
|
28
|
+
export const mcpServerConfigZ = z
|
|
29
|
+
.object({
|
|
30
|
+
type: z.enum(["stdio", "http"]).optional(),
|
|
31
|
+
command: z.string().optional(),
|
|
32
|
+
args: z.array(z.string()).optional(),
|
|
33
|
+
url: z.string().optional(),
|
|
34
|
+
headers: z.record(z.string()).optional(),
|
|
35
|
+
env: z.record(z.string()).optional(),
|
|
36
|
+
})
|
|
37
|
+
.refine((c) => c.command || c.url, {
|
|
38
|
+
message: "MCP server must have either command (stdio) or url (HTTP)",
|
|
39
|
+
});
|
|
40
|
+
export const skillDefinitionZ = z
|
|
41
|
+
.object({
|
|
42
|
+
name: z.string().optional(),
|
|
43
|
+
description: z.string().optional(),
|
|
44
|
+
instruction: z.string().optional(),
|
|
45
|
+
mcp: mcpServerConfigZ.optional(),
|
|
46
|
+
})
|
|
47
|
+
.refine((s) => s.instruction || s.mcp, {
|
|
48
|
+
message: "Inline skill must provide instruction, mcp, or both",
|
|
49
|
+
});
|
|
50
|
+
export const skillZ = z
|
|
51
|
+
.object({
|
|
29
52
|
id: z.string().min(1),
|
|
30
53
|
name: z.string(),
|
|
31
54
|
description: z.string(),
|
|
32
55
|
category: skillCategoryZ,
|
|
33
|
-
config: z.record(configFieldZ),
|
|
34
|
-
tools: z.array(toolZ),
|
|
56
|
+
config: z.record(configFieldZ).default({}),
|
|
57
|
+
tools: z.array(toolZ).default([]),
|
|
58
|
+
instruction: z.string().optional(),
|
|
59
|
+
mcp: mcpServerConfigZ.optional(),
|
|
60
|
+
})
|
|
61
|
+
.refine((s) => s.tools.length > 0 || s.instruction || s.mcp, {
|
|
62
|
+
message: "Skill must provide at least one of: tools, instruction, or mcp",
|
|
35
63
|
});
|
|
36
64
|
export const nodeZ = z.object({
|
|
37
65
|
name: z.string().min(1),
|
|
@@ -52,6 +80,7 @@ export const workflowZ = z.object({
|
|
|
52
80
|
nodes: z.record(nodeZ),
|
|
53
81
|
edges: z.array(edgeZ),
|
|
54
82
|
entry: z.string().min(1),
|
|
83
|
+
skills: z.record(skillDefinitionZ).default({}),
|
|
55
84
|
});
|
|
56
85
|
/** Parse + validate a raw object as a Workflow. Throws on invalid input. */
|
|
57
86
|
export function parseWorkflow(raw) {
|
|
@@ -168,11 +197,25 @@ export function validateWorkflow(workflow, knownSkills) {
|
|
|
168
197
|
}
|
|
169
198
|
}
|
|
170
199
|
}
|
|
200
|
+
// Inline skill definitions must have instruction or mcp
|
|
201
|
+
for (const [skillId, def] of Object.entries(workflow.skills ?? {})) {
|
|
202
|
+
if (!def.instruction && !def.mcp) {
|
|
203
|
+
errors.push({
|
|
204
|
+
code: "INVALID_INLINE_SKILL",
|
|
205
|
+
message: `Inline skill "${skillId}" must provide at least instruction or mcp`,
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
171
209
|
// Skill references
|
|
172
210
|
if (knownSkills) {
|
|
211
|
+
// Merge workflow inline skills into known set
|
|
212
|
+
const allKnown = new Set(knownSkills);
|
|
213
|
+
for (const id of Object.keys(workflow.skills ?? {})) {
|
|
214
|
+
allKnown.add(id);
|
|
215
|
+
}
|
|
173
216
|
for (const [nodeId, node] of Object.entries(workflow.nodes)) {
|
|
174
217
|
for (const skillId of node.skills) {
|
|
175
|
-
if (!
|
|
218
|
+
if (!allKnown.has(skillId)) {
|
|
176
219
|
errors.push({
|
|
177
220
|
code: "UNKNOWN_SKILL",
|
|
178
221
|
message: `Node "${nodeId}" references unknown skill "${skillId}"`,
|
|
@@ -241,5 +284,29 @@ export const workflowJsonSchema = {
|
|
|
241
284
|
},
|
|
242
285
|
},
|
|
243
286
|
},
|
|
287
|
+
skills: {
|
|
288
|
+
type: "object",
|
|
289
|
+
description: "Inline skill definitions scoped to this workflow",
|
|
290
|
+
additionalProperties: {
|
|
291
|
+
type: "object",
|
|
292
|
+
properties: {
|
|
293
|
+
name: { type: "string" },
|
|
294
|
+
description: { type: "string" },
|
|
295
|
+
instruction: { type: "string", description: "Natural language expertise injected into the node prompt" },
|
|
296
|
+
mcp: {
|
|
297
|
+
type: "object",
|
|
298
|
+
description: "External MCP server definition",
|
|
299
|
+
properties: {
|
|
300
|
+
type: { type: "string", enum: ["stdio", "http"] },
|
|
301
|
+
command: { type: "string" },
|
|
302
|
+
args: { type: "array", items: { type: "string" } },
|
|
303
|
+
url: { type: "string" },
|
|
304
|
+
headers: { type: "object", additionalProperties: { type: "string" } },
|
|
305
|
+
env: { type: "object", additionalProperties: { type: "string" } },
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
},
|
|
244
311
|
},
|
|
245
312
|
};
|