@exaudeus/workrail 1.13.0 → 1.13.1

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.
@@ -413,9 +413,9 @@ let ValidationEngine = ValidationEngine_1 = class ValidationEngine {
413
413
  issues.push(`Inline step '${inlineStep.id || 'unknown'}' must have a title`);
414
414
  suggestions.push('Add a title to all inline steps');
415
415
  }
416
- if (!inlineStep.prompt) {
417
- issues.push(`Inline step '${inlineStep.id || 'unknown'}' must have a prompt`);
418
- suggestions.push('Add a prompt to all inline steps');
416
+ if (!(0, workflow_definition_1.stepHasPromptSource)(inlineStep)) {
417
+ issues.push(`Inline step '${inlineStep.id || 'unknown'}' must have prompt, promptBlocks, or templateCall`);
418
+ suggestions.push('Add a prompt string, structured promptBlocks, or a templateCall to all inline steps');
419
419
  }
420
420
  if ((0, workflow_definition_1.isLoopStepDefinition)(inlineStep)) {
421
421
  issues.push(`Nested loops are not currently supported. Inline step '${inlineStep.id}' is a loop`);
@@ -486,8 +486,9 @@ let ValidationEngine = ValidationEngine_1 = class ValidationEngine {
486
486
  if (!step.title) {
487
487
  issues.push(`Step '${step.id}' missing required title`);
488
488
  }
489
- if (!step.prompt) {
490
- issues.push(`Step '${step.id}' missing required prompt`);
489
+ if (!(0, workflow_definition_1.stepHasPromptSource)(step)) {
490
+ issues.push(`Step '${step.id}' must have prompt, promptBlocks, or templateCall`);
491
+ suggestions.push('Add a prompt string, structured promptBlocks, or a templateCall to each step');
491
492
  }
492
493
  this.collectQuotedJsonValidationMessageWarnings(step, `Step '${step.id}'`, warnings);
493
494
  const callValidation = this.validateStepFunctionCalls(step, workflow.definition.functionDefinitions || []);
@@ -322,13 +322,7 @@ let WorkflowInterpreter = class WorkflowInterpreter {
322
322
  if (result.kind === 'found') {
323
323
  return (0, neverthrow_1.ok)(result.decision === 'continue');
324
324
  }
325
- return (0, neverthrow_1.err)({
326
- code: 'LOOP_MISSING_CONTEXT',
327
- loopId: loopCompiled.loop.id,
328
- message: result.kind === 'not_found'
329
- ? `Loop '${source.loopId}' requires a wr.loop_control artifact but none was provided`
330
- : `Loop '${source.loopId}' has an invalid loop control artifact: ${result.reason}`,
331
- });
325
+ return (0, neverthrow_1.ok)(true);
332
326
  }
333
327
  case 'context_variable': {
334
328
  const raw = (0, condition_evaluator_1.evaluateCondition)(source.condition, this.projectLoopContextAtIteration(loopCompiled.loop, iteration, context));
@@ -94,8 +94,8 @@
94
94
  "bytes": 2030
95
95
  },
96
96
  "application/services/validation-engine.js": {
97
- "sha256": "81592794bad1d77b0f8cdf6ed6486a17c6eebc3a4fe9e484693fbb6f8cdc5c96",
98
- "bytes": 31038
97
+ "sha256": "a2ad656656b8d2554d0a08f6e230c190c72939d11cdba329b8de268d9ad52584",
98
+ "bytes": 31342
99
99
  },
100
100
  "application/services/workflow-compiler.d.ts": {
101
101
  "sha256": "41d0643ae2f07e5ce77a6e02344b5ca5b3c26bde828fbb307528a2ae097ac9d5",
@@ -110,8 +110,8 @@
110
110
  "bytes": 1507
111
111
  },
112
112
  "application/services/workflow-interpreter.js": {
113
- "sha256": "0ea1861801d095d27e1e4c7c97978941b9d48613e28ce3a4c2efe64342814f5c",
114
- "bytes": 21402
113
+ "sha256": "e6ea1bc6f3881bc46a901b78720dee584090f86809bfa1979f04efa4c8a35613",
114
+ "bytes": 21011
115
115
  },
116
116
  "application/services/workflow-service.d.ts": {
117
117
  "sha256": "b92da17c6d91c90758ec42b4ee3bc448e5d5b1dfe7351f2fe0f5e1d10a715ec6",
@@ -1114,12 +1114,12 @@
1114
1114
  "bytes": 395
1115
1115
  },
1116
1116
  "types/workflow-definition.d.ts": {
1117
- "sha256": "13681513404db7396b07ded2c72fac53a9e42a76e5016c34f0fc77fc6591aa5a",
1118
- "bytes": 3951
1117
+ "sha256": "19c5588e038d0d703def5ad59809bd9f7bbf4402999e56e664725cfeb9a0e18c",
1118
+ "bytes": 4035
1119
1119
  },
1120
1120
  "types/workflow-definition.js": {
1121
- "sha256": "e269d62f27b7f37f870183d6b77800b7aa1e22dabc894374bab8f34db049a55b",
1122
- "bytes": 1584
1121
+ "sha256": "293e18cc856c8b0f4d48858873c5832f7b9d2dc3896256bf19e59c92a222056d",
1122
+ "bytes": 1749
1123
1123
  },
1124
1124
  "types/workflow-source.d.ts": {
1125
1125
  "sha256": "ee439c36ac3002780837ff393120d08a1c21ef2641421cdf72f0e1449d0211eb",
@@ -1542,8 +1542,8 @@
1542
1542
  "bytes": 2743
1543
1543
  },
1544
1544
  "v2/durable-core/schemas/artifacts/loop-control.js": {
1545
- "sha256": "9d8277a83fb4c6e2e07019feab437853c2eccd94b7e6958eda6500fb064d5f6e",
1546
- "bytes": 2099
1545
+ "sha256": "1e0b70991023554e0ea3c858517aee7ffd050ab695a2f31768c4ec3d8de1cf92",
1546
+ "bytes": 2152
1547
1547
  },
1548
1548
  "v2/durable-core/schemas/compiled-workflow/index.d.ts": {
1549
1549
  "sha256": "d909c13d0d46bba1dcd411a0c53e767cf7e4c8bc5206581344ca1e7315552d95",
@@ -88,5 +88,6 @@ export interface WorkflowDefinition {
88
88
  }
89
89
  export declare function isLoopStepDefinition(step: WorkflowStepDefinition | LoopStepDefinition): step is LoopStepDefinition;
90
90
  export declare function isWorkflowStepDefinition(step: WorkflowStepDefinition | LoopStepDefinition): step is WorkflowStepDefinition;
91
+ export declare function stepHasPromptSource(step: WorkflowStepDefinition): boolean;
91
92
  export declare function hasWorkflowDefinitionShape(obj: unknown): obj is WorkflowDefinition;
92
93
  export declare function createWorkflowDefinition(definition: WorkflowDefinition): WorkflowDefinition;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isLoopStepDefinition = isLoopStepDefinition;
4
4
  exports.isWorkflowStepDefinition = isWorkflowStepDefinition;
5
+ exports.stepHasPromptSource = stepHasPromptSource;
5
6
  exports.hasWorkflowDefinitionShape = hasWorkflowDefinitionShape;
6
7
  exports.createWorkflowDefinition = createWorkflowDefinition;
7
8
  function isLoopStepDefinition(step) {
@@ -10,6 +11,9 @@ function isLoopStepDefinition(step) {
10
11
  function isWorkflowStepDefinition(step) {
11
12
  return !isLoopStepDefinition(step);
12
13
  }
14
+ function stepHasPromptSource(step) {
15
+ return Boolean(step.prompt || step.promptBlocks || step.templateCall);
16
+ }
13
17
  function hasWorkflowDefinitionShape(obj) {
14
18
  if (!obj || typeof obj !== 'object')
15
19
  return false;
@@ -36,7 +36,8 @@ function parseLoopControlArtifact(artifact) {
36
36
  return result.success ? result.data : null;
37
37
  }
38
38
  function findLoopControlArtifact(artifacts, loopId) {
39
- for (const artifact of artifacts) {
39
+ for (let i = artifacts.length - 1; i >= 0; i--) {
40
+ const artifact = artifacts[i];
40
41
  if (!isLoopControlArtifact(artifact))
41
42
  continue;
42
43
  const parsed = parseLoopControlArtifact(artifact);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exaudeus/workrail",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Step-by-step workflow enforcement for AI agents via MCP",
5
5
  "license": "MIT",
6
6
  "repository": {