@kody-ade/kody-engine 0.4.298 → 0.4.299

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 (2) hide show
  1. package/dist/bin/kody.js +30 -14
  2. package/package.json +1 -1
package/dist/bin/kody.js CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "package.json"() {
16
16
  package_default = {
17
17
  name: "@kody-ade/kody-engine",
18
- version: "0.4.298",
18
+ version: "0.4.299",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -5539,11 +5539,11 @@ async function runContainerLoop(profile, ctx, input) {
5539
5539
  const priorState = readContainerState(ctx, child, reader);
5540
5540
  if (priorState.core?.prUrl) knownPrUrl = priorState.core.prUrl;
5541
5541
  const priorAction = priorState.executables?.[child.exec]?.lastAction;
5542
- let actionType;
5542
+ let actionType2;
5543
5543
  if (priorAction && /_COMPLETED$/i.test(priorAction.type)) {
5544
5544
  process.stderr.write(`[kody container] skipping ${child.exec}: already completed (${priorAction.type})
5545
5545
  `);
5546
- actionType = priorAction.type;
5546
+ actionType2 = priorAction.type;
5547
5547
  } else {
5548
5548
  let cliArgs;
5549
5549
  if (child.target === "pr") {
@@ -5634,12 +5634,12 @@ async function runContainerLoop(profile, ctx, input) {
5634
5634
  const nextChildAction = next.executables?.[child.exec]?.lastAction;
5635
5635
  const childWrote = nextAttempts > priorAttempts && nextChildAction != null;
5636
5636
  if (childWrote && nextChildAction) {
5637
- actionType = nextChildAction.type;
5637
+ actionType2 = nextChildAction.type;
5638
5638
  } else {
5639
5639
  const childTag = child.exec.toUpperCase().replace(/-/g, "_");
5640
- actionType = childOut.exitCode === 0 ? `${childTag}_COMPLETED` : `${childTag}_FAILED`;
5640
+ actionType2 = childOut.exitCode === 0 ? `${childTag}_COMPLETED` : `${childTag}_FAILED`;
5641
5641
  const synthetic = {
5642
- type: actionType,
5642
+ type: actionType2,
5643
5643
  payload: {
5644
5644
  synthesized: true,
5645
5645
  child: child.exec,
@@ -5670,16 +5670,16 @@ async function runContainerLoop(profile, ctx, input) {
5670
5670
  }
5671
5671
  ctx.data.taskState = next;
5672
5672
  }
5673
- const route = child.next[actionType] ?? child.next["*"];
5673
+ const route = child.next[actionType2] ?? child.next["*"];
5674
5674
  if (!route) {
5675
- const reason = `no route for action "${actionType}" from child "${child.exec}"`;
5675
+ const reason = `no route for action "${actionType2}" from child "${child.exec}"`;
5676
5676
  process.stderr.write(`[kody container] aborting: ${reason}
5677
5677
  `);
5678
5678
  ctx.output.exitCode = 1;
5679
5679
  ctx.output.reason = reason;
5680
5680
  return;
5681
5681
  }
5682
- process.stderr.write(`[kody container] outcome ${actionType}: dispatching to ${route}
5682
+ process.stderr.write(`[kody container] outcome ${actionType2}: dispatching to ${route}
5683
5683
  `);
5684
5684
  if (route === "done") {
5685
5685
  ctx.output.exitCode = 0;
@@ -5687,7 +5687,7 @@ async function runContainerLoop(profile, ctx, input) {
5687
5687
  }
5688
5688
  if (route === "abort") {
5689
5689
  ctx.output.exitCode = 1;
5690
- ctx.output.reason = `container aborted by route from "${child.exec}" on ${actionType}`;
5690
+ ctx.output.reason = `container aborted by route from "${child.exec}" on ${actionType2}`;
5691
5691
  return;
5692
5692
  }
5693
5693
  const nextIdx = children.findIndex((c) => c.exec === route);
@@ -14761,6 +14761,21 @@ function actionFailureReason2(action) {
14761
14761
  const reason = payload.reason;
14762
14762
  return typeof reason === "string" ? reason : "";
14763
14763
  }
14764
+ function actionType(action) {
14765
+ if (!action || typeof action !== "object" || Array.isArray(action)) return "";
14766
+ const type = action.type;
14767
+ return typeof type === "string" ? type : "";
14768
+ }
14769
+ function continuableParentLabel(ctx) {
14770
+ const workflowCapability = typeof ctx.data.workflowCapability === "string" && ctx.data.workflowCapability.trim() ? ctx.data.workflowCapability.trim() : "";
14771
+ const workflowContinueOn = Array.isArray(ctx.data.workflowContinueOn) ? ctx.data.workflowContinueOn.filter((entry) => typeof entry === "string") : [];
14772
+ const currentActionType = actionType(ctx.data.action);
14773
+ if (workflowCapability && currentActionType && workflowContinueOn.includes(currentActionType)) {
14774
+ return `${workflowCapability} workflow`;
14775
+ }
14776
+ const containerParent = process.env.KODY_CONTAINER_PARENT;
14777
+ return containerParent ? `${containerParent} container` : "";
14778
+ }
14764
14779
  function postWith(type, n, body, cwd) {
14765
14780
  try {
14766
14781
  if (type === "issue") postIssueComment(n, body, cwd);
@@ -14799,12 +14814,12 @@ var init_postIssueComment = __esm({
14799
14814
  return;
14800
14815
  }
14801
14816
  const reason = specific;
14802
- const containerParent = process.env.KODY_CONTAINER_PARENT;
14803
- if (containerParent) {
14817
+ const continuableParent = continuableParentLabel(ctx);
14818
+ if (continuableParent) {
14804
14819
  postWith(
14805
14820
  targetType,
14806
14821
  targetNumber,
14807
- `\u2139\uFE0F kody ${profile.name}: ${truncate(reason, 1200)} \u2014 ${containerParent} container will route to the next stage`,
14822
+ `\u2139\uFE0F kody ${profile.name}: ${truncate(reason, 1200)} \u2014 ${continuableParent} will route to the next stage`,
14808
14823
  ctx.cwd
14809
14824
  );
14810
14825
  ctx.output.exitCode = 3;
@@ -19066,7 +19081,8 @@ async function runCapabilityWorkflow(parent, workflow, capability, base) {
19066
19081
  ...chainData,
19067
19082
  workflowStep: label,
19068
19083
  workflowStepIndex: index + 1,
19069
- workflowStepReason: step.reason
19084
+ workflowStepReason: step.reason,
19085
+ workflowContinueOn: step.continueOn ?? []
19070
19086
  }
19071
19087
  });
19072
19088
  const outcome = workflowOutcome(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.298",
3
+ "version": "0.4.299",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",