@aaac/runtime 0.2.4 → 0.2.5

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/index.js CHANGED
@@ -9566,6 +9566,9 @@ function agentOpts(task, step, handoffSchema, indent) {
9566
9566
  function resultVar(i) {
9567
9567
  return `step${i}Result`;
9568
9568
  }
9569
+ function gateVar(i) {
9570
+ return `step${i}Gate`;
9571
+ }
9569
9572
  function priorContextExpr(i, steps, deps) {
9570
9573
  const fragments = [];
9571
9574
  if (stepDependsOnWorkflowInput(steps[i].depends_on)) {
@@ -9664,15 +9667,16 @@ function emitGateStatements(step, i, steps, deps, pad, feedback) {
9664
9667
  promptExpr = `${promptExpr} + (${feedback.feedbackVar} !== undefined ? ${varSection} : '')`;
9665
9668
  }
9666
9669
  const label = `gate:${gateStep.gate_kind}`;
9670
+ const verdict = gateVar(i);
9667
9671
  const lines = [];
9668
- lines.push(`${pad}const gate = await agent(${promptExpr}, {`);
9672
+ lines.push(`${pad}const ${verdict} = await agent(${promptExpr}, {`);
9669
9673
  lines.push(`${pad} schema: ${jsLiteral(GATE_SCHEMA, 0).replace(/\n/g, `
9670
9674
  ${pad} `)},`);
9671
9675
  lines.push(`${pad} label: ${jsString(label)},`);
9672
9676
  lines.push(`${pad} phase: 'Gate',`);
9673
9677
  lines.push(`${pad}})`);
9674
- lines.push(`${pad}if (!gate.approved) {`);
9675
- lines.push(`${pad} return { blocked: true, gate: ${jsString(gateStep.gate_kind)}, reason: gate.reason }`);
9678
+ lines.push(`${pad}if (!${verdict}.approved) {`);
9679
+ lines.push(`${pad} return { blocked: true, gate: ${jsString(gateStep.gate_kind)}, reason: ${verdict}.reason }`);
9676
9680
  lines.push(`${pad}}`);
9677
9681
  return lines;
9678
9682
  }