@o-lang/olang 1.2.2 → 1.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o-lang/olang",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "author": "Olalekan Ogundipe <info@workfily.com>",
5
5
  "description": "O-Lang: A governance language for user-directed, rule-enforced agent workflows",
6
6
  "main": "./src/index.js",
@@ -385,18 +385,18 @@ function parseWorkflowLines(lines, filename) {
385
385
  }
386
386
 
387
387
  // Ask (for Notify/resolver calls) - ✅ PRESERVE TARGET EXACTLY (NO NORMALIZATION)
388
- const askMatch = line.match(/^Ask\s+(.+)$/i);
389
- if (askMatch) {
390
- flushCurrentStep();
391
- workflow.steps.push({
392
- type: 'ask',
393
- target: askMatch[1].trim(), // ← PRESERVED EXACTLY (no normalizeAction)
394
- stepNumber: workflow.steps.length + 1,
395
- saveAs: null,
396
- constraints: {}
397
- });
398
- continue;
399
- }
388
+ const askMatch = line.match(/^Ask\s+(.+)$/i);
389
+ if (askMatch) {
390
+ flushCurrentStep();
391
+ workflow.steps.push({
392
+ type: 'action',
393
+ actionRaw: `Action ${askMatch[1].trim()}`,
394
+ stepNumber: workflow.steps.length + 1,
395
+ saveAs: null,
396
+ constraints: {}
397
+ });
398
+ continue;
399
+ }
400
400
 
401
401
  // Return
402
402
  const returnMatch = line.match(/^Return\s+(.+)$/i);
@@ -530,30 +530,33 @@ function parseBlock(lines) {
530
530
  }
531
531
 
532
532
  // Use in block - ✅ PRESERVE TOOL EXACTLY (NO NORMALIZATION)
533
- const useMatch = line.match(/^Use\s+(.+)$/i);
534
- if (useMatch) {
535
- flush();
536
- steps.push({
537
- type: 'use',
538
- tool: useMatch[1].trim(), // ← PRESERVED EXACTLY
539
- saveAs: null,
540
- constraints: {}
541
- });
542
- continue;
543
- }
533
+ const useMatch = line.match(/^Use\s+(.+)$/i);
534
+ if (useMatch) {
535
+ flushCurrentStep();
536
+ workflow.steps.push({
537
+ type: 'action',
538
+ actionRaw: `Action ${useMatch[1].trim()}`,
539
+ stepNumber: workflow.steps.length + 1,
540
+ saveAs: null,
541
+ constraints: {}
542
+ });
543
+ continue;
544
+ }
545
+
546
+
547
+ // Ask in block — CANONICALIZE AT PARSE TIME
548
+ const askMatch = line.match(/^Ask\s+(.+)$/i);
549
+ if (askMatch) {
550
+ flush();
551
+ steps.push({
552
+ type: 'action',
553
+ actionRaw: `Action ${askMatch[1].trim()}`,
554
+ saveAs: null,
555
+ constraints: {}
556
+ });
557
+ continue;
558
+ }
544
559
 
545
- // Ask in block - ✅ PRESERVE TARGET EXACTLY (NO NORMALIZATION)
546
- const askMatch = line.match(/^Ask\s+(.+)$/i);
547
- if (askMatch) {
548
- flush();
549
- steps.push({
550
- type: 'ask',
551
- target: askMatch[1].trim(), // ← PRESERVED EXACTLY
552
- saveAs: null,
553
- constraints: {}
554
- });
555
- continue;
556
- }
557
560
 
558
561
  // Constraint inside block
559
562
  const constraintMatch = line.match(/^Constraint:\s*(.+)$/i);
@@ -552,7 +552,7 @@ class RuntimeAPI {
552
552
  break;
553
553
  }
554
554
 
555
- case 'action': {
555
+ case 'action': {
556
556
  // 🔒 Interpolate workflow variables first
557
557
  let action = this._safeInterpolate(
558
558
  step.actionRaw,
@@ -606,7 +606,6 @@ class RuntimeAPI {
606
606
  break;
607
607
  }
608
608
 
609
-
610
609
  case 'use': {
611
610
  // ✅ SAFE INTERPOLATION for tool name
612
611
  const tool = this._safeInterpolate(step.tool, this.context, 'tool name');