@sweny-ai/core 0.1.53 → 0.1.55

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.
Files changed (45) hide show
  1. package/dist/__tests__/executor.test.js +2 -1
  2. package/dist/__tests__/integration/sources.integration.test.d.ts +1 -0
  3. package/dist/__tests__/integration/sources.integration.test.js +123 -0
  4. package/dist/__tests__/workflow-yaml.test.js +12 -5
  5. package/dist/cli/__tests__/report-cloud.test.d.ts +1 -0
  6. package/dist/cli/__tests__/report-cloud.test.js +165 -0
  7. package/dist/cli/cloud-report.d.ts +12 -0
  8. package/dist/cli/cloud-report.js +79 -0
  9. package/dist/cli/config-file.d.ts +3 -3
  10. package/dist/cli/config-file.js +18 -0
  11. package/dist/cli/config.d.ts +3 -0
  12. package/dist/cli/config.js +18 -2
  13. package/dist/cli/config.test.js +65 -1
  14. package/dist/cli/e2e.js +4 -2
  15. package/dist/cli/e2e.test.js +9 -2
  16. package/dist/cli/main.js +46 -19
  17. package/dist/cli/new.d.ts +0 -5
  18. package/dist/cli/new.js +0 -5
  19. package/dist/cli/new.test.js +1 -9
  20. package/dist/cli/output.test.js +1 -0
  21. package/dist/cli/publish.js +23 -12
  22. package/dist/cli/publish.test.d.ts +1 -0
  23. package/dist/cli/publish.test.js +610 -0
  24. package/dist/executor.d.ts +8 -0
  25. package/dist/executor.js +21 -3
  26. package/dist/executor.test.js +56 -1
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +1 -1
  29. package/dist/mermaid.test.js +2 -0
  30. package/dist/schema.d.ts +174 -46
  31. package/dist/schema.js +31 -2
  32. package/dist/sources.d.ts +70 -0
  33. package/dist/sources.js +194 -0
  34. package/dist/sources.test.d.ts +1 -0
  35. package/dist/sources.test.js +264 -0
  36. package/dist/sources.validation.test.d.ts +12 -0
  37. package/dist/sources.validation.test.js +360 -0
  38. package/dist/templates.d.ts +6 -2
  39. package/dist/templates.js +36 -46
  40. package/dist/testing.js +4 -1
  41. package/dist/types.d.ts +8 -1
  42. package/dist/types.js +0 -5
  43. package/dist/workflows/browser.js +1 -1
  44. package/dist/workflows/triage.yml +1 -23
  45. package/package.json +1 -5
@@ -186,8 +186,9 @@ describe("executor", () => {
186
186
  expect(existsSync(path.join(outputDir, "result.json"))).toBe(true);
187
187
  const written = JSON.parse(readFileSync(path.join(outputDir, "result.json"), "utf-8"));
188
188
  expect(written.status).toBe("done");
189
- // Events were emitted correctly
189
+ // Events were emitted correctly — workflow:start fires first, then sources:resolved (per spec)
190
190
  expect(events[0]).toEqual({ type: "workflow:start", workflow: "test-simple" });
191
+ expect(events[1].type).toBe("sources:resolved");
191
192
  const nodeEnters = events.filter((e) => e.type === "node:enter");
192
193
  expect(nodeEnters).toHaveLength(3);
193
194
  expect(events[events.length - 1].type).toBe("workflow:end");
@@ -546,3 +547,57 @@ describe("skill instruction injection", () => {
546
547
  expect(capturedInstruction).not.toContain("Inline instruction should NOT appear.");
547
548
  });
548
549
  });
550
+ // ─── Source resolution phase tests ────────────────────────────────
551
+ describe("executor: Source resolution phase", () => {
552
+ it("populates trace.sources with node instructions keyed by field path", async () => {
553
+ const workflow = {
554
+ id: "src-test",
555
+ name: "Source test",
556
+ description: "",
557
+ entry: "only",
558
+ nodes: { only: { name: "Only", instruction: "Say hi", skills: [] } },
559
+ edges: [],
560
+ };
561
+ const skills = createSkillMap([]);
562
+ const claude = new MockClaude({ responses: { only: { data: {} } } });
563
+ const result = await execute(workflow, {}, { skills, claude });
564
+ expect(result.trace.sources["nodes.only.instruction"]).toBeDefined();
565
+ expect(result.trace.sources["nodes.only.instruction"].content).toBe("Say hi");
566
+ expect(result.trace.sources["nodes.only.instruction"].kind).toBe("inline");
567
+ });
568
+ it("emits workflow:start before sources:resolved (per spec)", async () => {
569
+ const workflow = {
570
+ id: "evt-test",
571
+ name: "Event test",
572
+ description: "",
573
+ entry: "a",
574
+ nodes: { a: { name: "A", instruction: "Do A", skills: [] } },
575
+ edges: [],
576
+ };
577
+ const events = [];
578
+ const claude = new MockClaude({ responses: { a: { data: {} } } });
579
+ await execute(workflow, {}, {
580
+ skills: createSkillMap([]),
581
+ claude,
582
+ observer: (e) => events.push(e),
583
+ });
584
+ const startIdx = events.findIndex((e) => e.type === "workflow:start");
585
+ const srcIdx = events.findIndex((e) => e.type === "sources:resolved");
586
+ expect(startIdx).toBeGreaterThanOrEqual(0);
587
+ expect(srcIdx).toBeGreaterThan(startIdx);
588
+ });
589
+ it("resolves object-form Source (inline tag)", async () => {
590
+ const workflow = {
591
+ id: "obj-src",
592
+ name: "Object source",
593
+ description: "",
594
+ entry: "only",
595
+ nodes: { only: { name: "Only", instruction: { inline: "Hello from inline" }, skills: [] } },
596
+ edges: [],
597
+ };
598
+ const claude = new MockClaude({ responses: { only: { data: {} } } });
599
+ const result = await execute(workflow, {}, { skills: createSkillMap([]), claude });
600
+ expect(result.trace.sources["nodes.only.instruction"].content).toBe("Hello from inline");
601
+ expect(result.trace.sources["nodes.only.instruction"].kind).toBe("inline");
602
+ });
603
+ });
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  * })
22
22
  * ```
23
23
  */
24
- export type { Skill, SkillCategory, SkillDefinition, Tool, ToolContext, ConfigField, JSONSchema, Workflow, Node, Edge, NodeResult, ToolCall, ExecutionEvent, Observer, Claude, Logger, TraceStep, TraceEdge, ExecutionTrace, ExecutionResult, } from "./types.js";
24
+ export type { Skill, SkillCategory, SkillDefinition, Tool, ToolContext, ConfigField, JSONSchema, Workflow, Node, Edge, NodeResult, ToolCall, ExecutionEvent, Observer, Claude, Logger, TraceStep, TraceEdge, ExecutionTrace, ExecutionResult, Source, ResolvedSource, SourceKind, SourceResolutionMap, } from "./types.js";
25
25
  export { consoleLogger } from "./types.js";
26
26
  export { execute } from "./executor.js";
27
27
  export type { ExecuteOptions } from "./executor.js";
@@ -30,7 +30,7 @@ export type { ClaudeClientOptions } from "./claude.js";
30
30
  export { github, linear, slack, sentry, datadog, notification, supabase, builtinSkills, createSkillMap, allSkills, isSkillConfigured, configuredBuiltinSkills, validateWorkflowSkills, } from "./skills/index.js";
31
31
  export type { SkillValidationResult } from "./skills/index.js";
32
32
  export { loadCustomSkills, discoverSkills, configuredSkills } from "./skills/custom-loader.js";
33
- export { workflowZ, nodeZ, edgeZ, skillZ, mcpServerConfigZ, skillDefinitionZ, parseWorkflow, validateWorkflow, workflowJsonSchema, } from "./schema.js";
33
+ export { workflowZ, nodeZ, edgeZ, skillZ, mcpServerConfigZ, skillDefinitionZ, sourceZ, parseWorkflow, validateWorkflow, workflowJsonSchema, } from "./schema.js";
34
34
  export type { WorkflowError } from "./schema.js";
35
35
  export { buildAutoMcpServers, buildSkillMcpServers, buildProviderContext } from "./mcp.js";
36
36
  export type { ProviderContextOptions, SkillMcpOptions } from "./mcp.js";
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ export { github, linear, slack, sentry, datadog, notification, supabase, builtin
31
31
  // Node-only skill discovery (filesystem-based)
32
32
  export { loadCustomSkills, discoverSkills, configuredSkills } from "./skills/custom-loader.js";
33
33
  // Schema & validation
34
- export { workflowZ, nodeZ, edgeZ, skillZ, mcpServerConfigZ, skillDefinitionZ, parseWorkflow, validateWorkflow, workflowJsonSchema, } from "./schema.js";
34
+ export { workflowZ, nodeZ, edgeZ, skillZ, mcpServerConfigZ, skillDefinitionZ, sourceZ, parseWorkflow, validateWorkflow, workflowJsonSchema, } from "./schema.js";
35
35
  // MCP auto-injection
36
36
  export { buildAutoMcpServers, buildSkillMcpServers, buildProviderContext } from "./mcp.js";
37
37
  // Workflow builder
@@ -179,6 +179,7 @@ describe("toMermaid", () => {
179
179
  { from: "triage", to: "investigate", reason: "severity is high or critical" },
180
180
  { from: "investigate", to: "close", reason: "only path" },
181
181
  ],
182
+ sources: {},
182
183
  };
183
184
  const result = toMermaid(branching, { trace });
184
185
  // Taken edges get green bold styling (edges 0 and 2 in the workflow)
@@ -198,6 +199,7 @@ describe("toMermaid", () => {
198
199
  { from: "a", to: "a", reason: "needs retry" },
199
200
  { from: "a", to: "b", reason: "only path" },
200
201
  ],
202
+ sources: {},
201
203
  };
202
204
  const result = toMermaid(withLoop, { trace });
203
205
  // Node a ran twice — should show ×2
package/dist/schema.d.ts CHANGED
@@ -8,6 +8,8 @@
8
8
  */
9
9
  import { z } from "zod";
10
10
  import type { Workflow } from "./types.js";
11
+ import { sourceZ } from "./sources.js";
12
+ export { sourceZ };
11
13
  export declare const jsonSchemaZ: z.ZodRecord<z.ZodString, z.ZodUnknown>;
12
14
  export declare const configFieldZ: z.ZodObject<{
13
15
  description: z.ZodString;
@@ -49,29 +51,29 @@ export declare const mcpServerConfigZ: z.ZodEffects<z.ZodObject<{
49
51
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
50
52
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
51
53
  }, "strip", z.ZodTypeAny, {
52
- type?: "stdio" | "http" | undefined;
53
54
  url?: string | undefined;
55
+ type?: "stdio" | "http" | undefined;
54
56
  headers?: Record<string, string> | undefined;
55
57
  env?: Record<string, string> | undefined;
56
58
  command?: string | undefined;
57
59
  args?: string[] | undefined;
58
60
  }, {
59
- type?: "stdio" | "http" | undefined;
60
61
  url?: string | undefined;
62
+ type?: "stdio" | "http" | undefined;
61
63
  headers?: Record<string, string> | undefined;
62
64
  env?: Record<string, string> | undefined;
63
65
  command?: string | undefined;
64
66
  args?: string[] | undefined;
65
67
  }>, {
66
- type?: "stdio" | "http" | undefined;
67
68
  url?: string | undefined;
69
+ type?: "stdio" | "http" | undefined;
68
70
  headers?: Record<string, string> | undefined;
69
71
  env?: Record<string, string> | undefined;
70
72
  command?: string | undefined;
71
73
  args?: string[] | undefined;
72
74
  }, {
73
- type?: "stdio" | "http" | undefined;
74
75
  url?: string | undefined;
76
+ type?: "stdio" | "http" | undefined;
75
77
  headers?: Record<string, string> | undefined;
76
78
  env?: Record<string, string> | undefined;
77
79
  command?: string | undefined;
@@ -89,29 +91,29 @@ export declare const skillDefinitionZ: z.ZodEffects<z.ZodObject<{
89
91
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
90
92
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
91
93
  }, "strip", z.ZodTypeAny, {
92
- type?: "stdio" | "http" | undefined;
93
94
  url?: string | undefined;
95
+ type?: "stdio" | "http" | undefined;
94
96
  headers?: Record<string, string> | undefined;
95
97
  env?: Record<string, string> | undefined;
96
98
  command?: string | undefined;
97
99
  args?: string[] | undefined;
98
100
  }, {
99
- type?: "stdio" | "http" | undefined;
100
101
  url?: string | undefined;
102
+ type?: "stdio" | "http" | undefined;
101
103
  headers?: Record<string, string> | undefined;
102
104
  env?: Record<string, string> | undefined;
103
105
  command?: string | undefined;
104
106
  args?: string[] | undefined;
105
107
  }>, {
106
- type?: "stdio" | "http" | undefined;
107
108
  url?: string | undefined;
109
+ type?: "stdio" | "http" | undefined;
108
110
  headers?: Record<string, string> | undefined;
109
111
  env?: Record<string, string> | undefined;
110
112
  command?: string | undefined;
111
113
  args?: string[] | undefined;
112
114
  }, {
113
- type?: "stdio" | "http" | undefined;
114
115
  url?: string | undefined;
116
+ type?: "stdio" | "http" | undefined;
115
117
  headers?: Record<string, string> | undefined;
116
118
  env?: Record<string, string> | undefined;
117
119
  command?: string | undefined;
@@ -122,8 +124,8 @@ export declare const skillDefinitionZ: z.ZodEffects<z.ZodObject<{
122
124
  name?: string | undefined;
123
125
  description?: string | undefined;
124
126
  mcp?: {
125
- type?: "stdio" | "http" | undefined;
126
127
  url?: string | undefined;
128
+ type?: "stdio" | "http" | undefined;
127
129
  headers?: Record<string, string> | undefined;
128
130
  env?: Record<string, string> | undefined;
129
131
  command?: string | undefined;
@@ -134,8 +136,8 @@ export declare const skillDefinitionZ: z.ZodEffects<z.ZodObject<{
134
136
  name?: string | undefined;
135
137
  description?: string | undefined;
136
138
  mcp?: {
137
- type?: "stdio" | "http" | undefined;
138
139
  url?: string | undefined;
140
+ type?: "stdio" | "http" | undefined;
139
141
  headers?: Record<string, string> | undefined;
140
142
  env?: Record<string, string> | undefined;
141
143
  command?: string | undefined;
@@ -146,8 +148,8 @@ export declare const skillDefinitionZ: z.ZodEffects<z.ZodObject<{
146
148
  name?: string | undefined;
147
149
  description?: string | undefined;
148
150
  mcp?: {
149
- type?: "stdio" | "http" | undefined;
150
151
  url?: string | undefined;
152
+ type?: "stdio" | "http" | undefined;
151
153
  headers?: Record<string, string> | undefined;
152
154
  env?: Record<string, string> | undefined;
153
155
  command?: string | undefined;
@@ -158,8 +160,8 @@ export declare const skillDefinitionZ: z.ZodEffects<z.ZodObject<{
158
160
  name?: string | undefined;
159
161
  description?: string | undefined;
160
162
  mcp?: {
161
- type?: "stdio" | "http" | undefined;
162
163
  url?: string | undefined;
164
+ type?: "stdio" | "http" | undefined;
163
165
  headers?: Record<string, string> | undefined;
164
166
  env?: Record<string, string> | undefined;
165
167
  command?: string | undefined;
@@ -206,29 +208,29 @@ export declare const skillZ: z.ZodEffects<z.ZodObject<{
206
208
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
207
209
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
208
210
  }, "strip", z.ZodTypeAny, {
209
- type?: "stdio" | "http" | undefined;
210
211
  url?: string | undefined;
212
+ type?: "stdio" | "http" | undefined;
211
213
  headers?: Record<string, string> | undefined;
212
214
  env?: Record<string, string> | undefined;
213
215
  command?: string | undefined;
214
216
  args?: string[] | undefined;
215
217
  }, {
216
- type?: "stdio" | "http" | undefined;
217
218
  url?: string | undefined;
219
+ type?: "stdio" | "http" | undefined;
218
220
  headers?: Record<string, string> | undefined;
219
221
  env?: Record<string, string> | undefined;
220
222
  command?: string | undefined;
221
223
  args?: string[] | undefined;
222
224
  }>, {
223
- type?: "stdio" | "http" | undefined;
224
225
  url?: string | undefined;
226
+ type?: "stdio" | "http" | undefined;
225
227
  headers?: Record<string, string> | undefined;
226
228
  env?: Record<string, string> | undefined;
227
229
  command?: string | undefined;
228
230
  args?: string[] | undefined;
229
231
  }, {
230
- type?: "stdio" | "http" | undefined;
231
232
  url?: string | undefined;
233
+ type?: "stdio" | "http" | undefined;
232
234
  headers?: Record<string, string> | undefined;
233
235
  env?: Record<string, string> | undefined;
234
236
  command?: string | undefined;
@@ -251,8 +253,8 @@ export declare const skillZ: z.ZodEffects<z.ZodObject<{
251
253
  }[];
252
254
  instruction?: string | undefined;
253
255
  mcp?: {
254
- type?: "stdio" | "http" | undefined;
255
256
  url?: string | undefined;
257
+ type?: "stdio" | "http" | undefined;
256
258
  headers?: Record<string, string> | undefined;
257
259
  env?: Record<string, string> | undefined;
258
260
  command?: string | undefined;
@@ -265,8 +267,8 @@ export declare const skillZ: z.ZodEffects<z.ZodObject<{
265
267
  category: "git" | "observability" | "tasks" | "notification" | "general";
266
268
  instruction?: string | undefined;
267
269
  mcp?: {
268
- type?: "stdio" | "http" | undefined;
269
270
  url?: string | undefined;
271
+ type?: "stdio" | "http" | undefined;
270
272
  headers?: Record<string, string> | undefined;
271
273
  env?: Record<string, string> | undefined;
272
274
  command?: string | undefined;
@@ -299,8 +301,8 @@ export declare const skillZ: z.ZodEffects<z.ZodObject<{
299
301
  }[];
300
302
  instruction?: string | undefined;
301
303
  mcp?: {
302
- type?: "stdio" | "http" | undefined;
303
304
  url?: string | undefined;
305
+ type?: "stdio" | "http" | undefined;
304
306
  headers?: Record<string, string> | undefined;
305
307
  env?: Record<string, string> | undefined;
306
308
  command?: string | undefined;
@@ -313,8 +315,8 @@ export declare const skillZ: z.ZodEffects<z.ZodObject<{
313
315
  category: "git" | "observability" | "tasks" | "notification" | "general";
314
316
  instruction?: string | undefined;
315
317
  mcp?: {
316
- type?: "stdio" | "http" | undefined;
317
318
  url?: string | undefined;
319
+ type?: "stdio" | "http" | undefined;
318
320
  headers?: Record<string, string> | undefined;
319
321
  env?: Record<string, string> | undefined;
320
322
  command?: string | undefined;
@@ -333,16 +335,51 @@ export declare const skillZ: z.ZodEffects<z.ZodObject<{
333
335
  }>;
334
336
  export declare const nodeZ: z.ZodObject<{
335
337
  name: z.ZodString;
336
- instruction: z.ZodString;
338
+ instruction: z.ZodUnion<[z.ZodString, z.ZodObject<{
339
+ inline: z.ZodString;
340
+ }, "strict", z.ZodTypeAny, {
341
+ inline: string;
342
+ }, {
343
+ inline: string;
344
+ }>, z.ZodObject<{
345
+ file: z.ZodString;
346
+ }, "strict", z.ZodTypeAny, {
347
+ file: string;
348
+ }, {
349
+ file: string;
350
+ }>, z.ZodObject<{
351
+ url: z.ZodString;
352
+ type: z.ZodOptional<z.ZodString>;
353
+ }, "strict", z.ZodTypeAny, {
354
+ url: string;
355
+ type?: string | undefined;
356
+ }, {
357
+ url: string;
358
+ type?: string | undefined;
359
+ }>]>;
337
360
  skills: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
338
361
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
339
362
  }, "strip", z.ZodTypeAny, {
340
- instruction: string;
363
+ instruction: string | {
364
+ inline: string;
365
+ } | {
366
+ file: string;
367
+ } | {
368
+ url: string;
369
+ type?: string | undefined;
370
+ };
341
371
  name: string;
342
372
  skills: string[];
343
373
  output?: Record<string, unknown> | undefined;
344
374
  }, {
345
- instruction: string;
375
+ instruction: string | {
376
+ inline: string;
377
+ } | {
378
+ file: string;
379
+ } | {
380
+ url: string;
381
+ type?: string | undefined;
382
+ };
346
383
  name: string;
347
384
  output?: Record<string, unknown> | undefined;
348
385
  skills?: string[] | undefined;
@@ -369,16 +406,51 @@ export declare const workflowZ: z.ZodObject<{
369
406
  description: z.ZodDefault<z.ZodString>;
370
407
  nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
371
408
  name: z.ZodString;
372
- instruction: z.ZodString;
409
+ instruction: z.ZodUnion<[z.ZodString, z.ZodObject<{
410
+ inline: z.ZodString;
411
+ }, "strict", z.ZodTypeAny, {
412
+ inline: string;
413
+ }, {
414
+ inline: string;
415
+ }>, z.ZodObject<{
416
+ file: z.ZodString;
417
+ }, "strict", z.ZodTypeAny, {
418
+ file: string;
419
+ }, {
420
+ file: string;
421
+ }>, z.ZodObject<{
422
+ url: z.ZodString;
423
+ type: z.ZodOptional<z.ZodString>;
424
+ }, "strict", z.ZodTypeAny, {
425
+ url: string;
426
+ type?: string | undefined;
427
+ }, {
428
+ url: string;
429
+ type?: string | undefined;
430
+ }>]>;
373
431
  skills: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
374
432
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
375
433
  }, "strip", z.ZodTypeAny, {
376
- instruction: string;
434
+ instruction: string | {
435
+ inline: string;
436
+ } | {
437
+ file: string;
438
+ } | {
439
+ url: string;
440
+ type?: string | undefined;
441
+ };
377
442
  name: string;
378
443
  skills: string[];
379
444
  output?: Record<string, unknown> | undefined;
380
445
  }, {
381
- instruction: string;
446
+ instruction: string | {
447
+ inline: string;
448
+ } | {
449
+ file: string;
450
+ } | {
451
+ url: string;
452
+ type?: string | undefined;
453
+ };
382
454
  name: string;
383
455
  output?: Record<string, unknown> | undefined;
384
456
  skills?: string[] | undefined;
@@ -412,29 +484,29 @@ export declare const workflowZ: z.ZodObject<{
412
484
  headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
413
485
  env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
414
486
  }, "strip", z.ZodTypeAny, {
415
- type?: "stdio" | "http" | undefined;
416
487
  url?: string | undefined;
488
+ type?: "stdio" | "http" | undefined;
417
489
  headers?: Record<string, string> | undefined;
418
490
  env?: Record<string, string> | undefined;
419
491
  command?: string | undefined;
420
492
  args?: string[] | undefined;
421
493
  }, {
422
- type?: "stdio" | "http" | undefined;
423
494
  url?: string | undefined;
495
+ type?: "stdio" | "http" | undefined;
424
496
  headers?: Record<string, string> | undefined;
425
497
  env?: Record<string, string> | undefined;
426
498
  command?: string | undefined;
427
499
  args?: string[] | undefined;
428
500
  }>, {
429
- type?: "stdio" | "http" | undefined;
430
501
  url?: string | undefined;
502
+ type?: "stdio" | "http" | undefined;
431
503
  headers?: Record<string, string> | undefined;
432
504
  env?: Record<string, string> | undefined;
433
505
  command?: string | undefined;
434
506
  args?: string[] | undefined;
435
507
  }, {
436
- type?: "stdio" | "http" | undefined;
437
508
  url?: string | undefined;
509
+ type?: "stdio" | "http" | undefined;
438
510
  headers?: Record<string, string> | undefined;
439
511
  env?: Record<string, string> | undefined;
440
512
  command?: string | undefined;
@@ -445,8 +517,8 @@ export declare const workflowZ: z.ZodObject<{
445
517
  name?: string | undefined;
446
518
  description?: string | undefined;
447
519
  mcp?: {
448
- type?: "stdio" | "http" | undefined;
449
520
  url?: string | undefined;
521
+ type?: "stdio" | "http" | undefined;
450
522
  headers?: Record<string, string> | undefined;
451
523
  env?: Record<string, string> | undefined;
452
524
  command?: string | undefined;
@@ -457,8 +529,8 @@ export declare const workflowZ: z.ZodObject<{
457
529
  name?: string | undefined;
458
530
  description?: string | undefined;
459
531
  mcp?: {
460
- type?: "stdio" | "http" | undefined;
461
532
  url?: string | undefined;
533
+ type?: "stdio" | "http" | undefined;
462
534
  headers?: Record<string, string> | undefined;
463
535
  env?: Record<string, string> | undefined;
464
536
  command?: string | undefined;
@@ -469,8 +541,8 @@ export declare const workflowZ: z.ZodObject<{
469
541
  name?: string | undefined;
470
542
  description?: string | undefined;
471
543
  mcp?: {
472
- type?: "stdio" | "http" | undefined;
473
544
  url?: string | undefined;
545
+ type?: "stdio" | "http" | undefined;
474
546
  headers?: Record<string, string> | undefined;
475
547
  env?: Record<string, string> | undefined;
476
548
  command?: string | undefined;
@@ -481,8 +553,8 @@ export declare const workflowZ: z.ZodObject<{
481
553
  name?: string | undefined;
482
554
  description?: string | undefined;
483
555
  mcp?: {
484
- type?: "stdio" | "http" | undefined;
485
556
  url?: string | undefined;
557
+ type?: "stdio" | "http" | undefined;
486
558
  headers?: Record<string, string> | undefined;
487
559
  env?: Record<string, string> | undefined;
488
560
  command?: string | undefined;
@@ -498,8 +570,8 @@ export declare const workflowZ: z.ZodObject<{
498
570
  name?: string | undefined;
499
571
  description?: string | undefined;
500
572
  mcp?: {
501
- type?: "stdio" | "http" | undefined;
502
573
  url?: string | undefined;
574
+ type?: "stdio" | "http" | undefined;
503
575
  headers?: Record<string, string> | undefined;
504
576
  env?: Record<string, string> | undefined;
505
577
  command?: string | undefined;
@@ -507,7 +579,14 @@ export declare const workflowZ: z.ZodObject<{
507
579
  } | undefined;
508
580
  }>;
509
581
  nodes: Record<string, {
510
- instruction: string;
582
+ instruction: string | {
583
+ inline: string;
584
+ } | {
585
+ file: string;
586
+ } | {
587
+ url: string;
588
+ type?: string | undefined;
589
+ };
511
590
  name: string;
512
591
  skills: string[];
513
592
  output?: Record<string, unknown> | undefined;
@@ -523,7 +602,14 @@ export declare const workflowZ: z.ZodObject<{
523
602
  name: string;
524
603
  id: string;
525
604
  nodes: Record<string, {
526
- instruction: string;
605
+ instruction: string | {
606
+ inline: string;
607
+ } | {
608
+ file: string;
609
+ } | {
610
+ url: string;
611
+ type?: string | undefined;
612
+ };
527
613
  name: string;
528
614
  output?: Record<string, unknown> | undefined;
529
615
  skills?: string[] | undefined;
@@ -541,8 +627,8 @@ export declare const workflowZ: z.ZodObject<{
541
627
  name?: string | undefined;
542
628
  description?: string | undefined;
543
629
  mcp?: {
544
- type?: "stdio" | "http" | undefined;
545
630
  url?: string | undefined;
631
+ type?: "stdio" | "http" | undefined;
546
632
  headers?: Record<string, string> | undefined;
547
633
  env?: Record<string, string> | undefined;
548
634
  command?: string | undefined;
@@ -560,8 +646,8 @@ export declare function parseWorkflow(raw: unknown): {
560
646
  name?: string | undefined;
561
647
  description?: string | undefined;
562
648
  mcp?: {
563
- type?: "stdio" | "http" | undefined;
564
649
  url?: string | undefined;
650
+ type?: "stdio" | "http" | undefined;
565
651
  headers?: Record<string, string> | undefined;
566
652
  env?: Record<string, string> | undefined;
567
653
  command?: string | undefined;
@@ -569,7 +655,14 @@ export declare function parseWorkflow(raw: unknown): {
569
655
  } | undefined;
570
656
  }>;
571
657
  nodes: Record<string, {
572
- instruction: string;
658
+ instruction: string | {
659
+ inline: string;
660
+ } | {
661
+ file: string;
662
+ } | {
663
+ url: string;
664
+ type?: string | undefined;
665
+ };
573
666
  name: string;
574
667
  skills: string[];
575
668
  output?: Record<string, unknown> | undefined;
@@ -602,10 +695,6 @@ export interface WorkflowError {
602
695
  * returns null when it reaches one, ending the workflow cleanly.
603
696
  */
604
697
  export declare function validateWorkflow(workflow: Workflow | z.infer<typeof workflowZ>, knownSkills?: Set<string>): WorkflowError[];
605
- /**
606
- * Static JSON Schema for the Workflow type.
607
- * Use this for external validation (YAML files, Studio import, CI checks).
608
- */
609
698
  export declare const workflowJsonSchema: {
610
699
  readonly $schema: "https://json-schema.org/draft/2020-12/schema";
611
700
  readonly $id: "https://sweny.ai/schemas/workflow.json";
@@ -614,6 +703,46 @@ export declare const workflowJsonSchema: {
614
703
  readonly type: "object";
615
704
  readonly required: readonly ["id", "name", "nodes", "edges", "entry"];
616
705
  readonly additionalProperties: false;
706
+ readonly $defs: {
707
+ readonly Source: {
708
+ readonly oneOf: readonly [{
709
+ readonly type: "string";
710
+ readonly minLength: 1;
711
+ }, {
712
+ readonly type: "object";
713
+ readonly properties: {
714
+ readonly inline: {
715
+ readonly type: "string";
716
+ };
717
+ };
718
+ readonly required: readonly ["inline"];
719
+ readonly additionalProperties: false;
720
+ }, {
721
+ readonly type: "object";
722
+ readonly properties: {
723
+ readonly file: {
724
+ readonly type: "string";
725
+ readonly minLength: 1;
726
+ };
727
+ };
728
+ readonly required: readonly ["file"];
729
+ readonly additionalProperties: false;
730
+ }, {
731
+ readonly type: "object";
732
+ readonly properties: {
733
+ readonly url: {
734
+ readonly type: "string";
735
+ readonly format: "uri";
736
+ };
737
+ readonly type: {
738
+ readonly type: "string";
739
+ };
740
+ };
741
+ readonly required: readonly ["url"];
742
+ readonly additionalProperties: false;
743
+ }];
744
+ };
745
+ };
617
746
  readonly properties: {
618
747
  readonly id: {
619
748
  readonly type: "string";
@@ -643,8 +772,7 @@ export declare const workflowJsonSchema: {
643
772
  readonly minLength: 1;
644
773
  };
645
774
  readonly instruction: {
646
- readonly type: "string";
647
- readonly minLength: 1;
775
+ readonly $ref: "#/$defs/Source";
648
776
  readonly description: "What Claude should do at this node";
649
777
  };
650
778
  readonly skills: {