@sweny-ai/core 0.1.50 → 0.1.52

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/mcp.test.js CHANGED
@@ -665,4 +665,71 @@ describe("buildSkillMcpServers", () => {
665
665
  });
666
666
  expect(result["betterstack"]?.headers?.Authorization).toBe("Bearer primary");
667
667
  });
668
+ // ── Skill-declared MCP servers ──────────────────────────────────────
669
+ it("includes skill-declared MCP servers", () => {
670
+ const result = buildSkillMcpServers({
671
+ referencedSkills: new Set(["our-crm"]),
672
+ credentials: {},
673
+ skillMcpServers: {
674
+ "our-crm": {
675
+ type: "stdio",
676
+ command: "npx",
677
+ args: ["-y", "@company/crm-server"],
678
+ env: { API_KEY: "test-key" },
679
+ },
680
+ },
681
+ });
682
+ expect(result["our-crm"]).toBeDefined();
683
+ expect(result["our-crm"].command).toBe("npx");
684
+ });
685
+ it("skill-declared MCP is only included when skill is referenced", () => {
686
+ const result = buildSkillMcpServers({
687
+ referencedSkills: new Set(["github"]),
688
+ credentials: { GITHUB_TOKEN: "ghp_test" },
689
+ skillMcpServers: {
690
+ "our-crm": {
691
+ type: "stdio",
692
+ command: "npx",
693
+ args: ["-y", "@company/crm-server"],
694
+ },
695
+ },
696
+ });
697
+ expect(result["github"]).toBeDefined();
698
+ expect(result["our-crm"]).toBeUndefined();
699
+ });
700
+ it("user-supplied servers win over skill-declared", () => {
701
+ const result = buildSkillMcpServers({
702
+ referencedSkills: new Set(["our-crm"]),
703
+ credentials: {},
704
+ skillMcpServers: {
705
+ "our-crm": {
706
+ type: "stdio",
707
+ command: "npx",
708
+ args: ["-y", "@company/crm-server"],
709
+ },
710
+ },
711
+ userMcpServers: {
712
+ "our-crm": {
713
+ type: "http",
714
+ url: "https://override.example.com",
715
+ },
716
+ },
717
+ });
718
+ expect(result["our-crm"].url).toBe("https://override.example.com");
719
+ });
720
+ it("skill-declared and auto-wired MCPs coexist", () => {
721
+ const result = buildSkillMcpServers({
722
+ referencedSkills: new Set(["github", "our-crm"]),
723
+ credentials: { GITHUB_TOKEN: "ghp_test" },
724
+ skillMcpServers: {
725
+ "our-crm": {
726
+ type: "stdio",
727
+ command: "npx",
728
+ args: ["-y", "@company/crm-server"],
729
+ },
730
+ },
731
+ });
732
+ expect(result["github"]).toBeDefined();
733
+ expect(result["our-crm"]).toBeDefined();
734
+ });
668
735
  });
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 skillZ: z.ZodObject<{
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
  };