@kody-ade/kody-engine 0.4.48 → 0.4.50

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/bin/kody.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@kody-ade/kody-engine",
6
- version: "0.4.48",
6
+ version: "0.4.50",
7
7
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
8
8
  license: "MIT",
9
9
  type: "module",
@@ -4485,15 +4485,17 @@ var dispatchClassified = async (ctx) => {
4485
4485
  if (!issueNumber) return;
4486
4486
  const classification = ctx.data.classification;
4487
4487
  if (!classification || !VALID_CLASSES2.has(classification)) return;
4488
+ const baseArg = typeof ctx.args.base === "string" && ctx.args.base.length > 0 ? ` --base ${ctx.args.base}` : "";
4489
+ const body = `@kody ${classification}${baseArg}`;
4488
4490
  try {
4489
- execFileSync13("gh", ["issue", "comment", String(issueNumber), "--body", `@kody ${classification}`], {
4491
+ execFileSync13("gh", ["issue", "comment", String(issueNumber), "--body", body], {
4490
4492
  cwd: ctx.cwd,
4491
4493
  timeout: API_TIMEOUT_MS5,
4492
4494
  stdio: ["ignore", "pipe", "pipe"]
4493
4495
  });
4494
4496
  } catch (err) {
4495
4497
  process.stderr.write(
4496
- `[kody dispatchClassified] failed to dispatch @kody ${classification}: ${err instanceof Error ? err.message : String(err)}
4498
+ `[kody dispatchClassified] failed to dispatch ${body}: ${err instanceof Error ? err.message : String(err)}
4497
4499
  `
4498
4500
  );
4499
4501
  ctx.data.action = failedAction3("dispatch post failed");
@@ -7182,7 +7184,7 @@ var FAILED_LABEL_SPEC = {
7182
7184
  color: "e11d21",
7183
7185
  description: "kody: flow failed"
7184
7186
  };
7185
- var postIssueComment2 = async (ctx) => {
7187
+ var postIssueComment2 = async (ctx, profile) => {
7186
7188
  if (ctx.skipAgent && ctx.output.exitCode !== void 0) return;
7187
7189
  const targetType = ctx.data.commentTargetType;
7188
7190
  const targetNumber = Number(ctx.data.commentTargetNumber ?? 0);
@@ -7193,6 +7195,18 @@ var postIssueComment2 = async (ctx) => {
7193
7195
  if (!commitResult?.committed && !hasCommits) {
7194
7196
  const specific = computeFailureReason2(ctx);
7195
7197
  const reason = specific.length > 0 ? specific : "no changes to commit";
7198
+ const containerParent = process.env.KODY_CONTAINER_PARENT;
7199
+ if (containerParent) {
7200
+ postWith(
7201
+ targetType,
7202
+ targetNumber,
7203
+ `\u2139\uFE0F kody ${profile.name}: ${truncate2(reason, 1200)} \u2014 ${containerParent} container will route to the next stage`,
7204
+ ctx.cwd
7205
+ );
7206
+ ctx.output.exitCode = 3;
7207
+ ctx.output.reason = reason;
7208
+ return;
7209
+ }
7196
7210
  postWith(targetType, targetNumber, `\u26A0\uFE0F kody FAILED: ${truncate2(reason, 1500)}`, ctx.cwd);
7197
7211
  markRunFailed(ctx);
7198
7212
  ctx.output.exitCode = 3;
@@ -9655,6 +9669,8 @@ async function runContainerLoop(profile, ctx, input) {
9655
9669
  }
9656
9670
  let childOut;
9657
9671
  const childStartedAt = Date.now();
9672
+ const priorParent = process.env.KODY_CONTAINER_PARENT;
9673
+ process.env.KODY_CONTAINER_PARENT = profile.name;
9658
9674
  try {
9659
9675
  childOut = await runChild(child.exec, {
9660
9676
  cliArgs,
@@ -9687,6 +9703,9 @@ async function runContainerLoop(profile, ctx, input) {
9687
9703
  ctx.output.exitCode = 1;
9688
9704
  ctx.output.reason = `child "${child.exec}" crashed: ${msg}`;
9689
9705
  return;
9706
+ } finally {
9707
+ if (priorParent === void 0) delete process.env.KODY_CONTAINER_PARENT;
9708
+ else process.env.KODY_CONTAINER_PARENT = priorParent;
9690
9709
  }
9691
9710
  const priorAttempts = priorState.core?.attempts?.[child.exec] ?? 0;
9692
9711
  const next = readContainerState(ctx, child, reader);
@@ -9,6 +9,13 @@
9
9
  "type": "int",
10
10
  "required": true,
11
11
  "describe": "GitHub issue number to drive the flow on."
12
+ },
13
+ {
14
+ "name": "base",
15
+ "flag": "--base",
16
+ "type": "string",
17
+ "required": false,
18
+ "describe": "Optional base branch override (stacked-PR). Forwarded to the `run` child by the container loop."
12
19
  }
13
20
  ],
14
21
  "claudeCode": {
@@ -9,6 +9,13 @@
9
9
  "type": "int",
10
10
  "required": true,
11
11
  "describe": "GitHub issue number to drive the flow on."
12
+ },
13
+ {
14
+ "name": "base",
15
+ "flag": "--base",
16
+ "type": "string",
17
+ "required": false,
18
+ "describe": "Optional base branch override (stacked-PR). Forwarded to the `run` child by the container loop."
12
19
  }
13
20
  ],
14
21
  "claudeCode": {
@@ -9,6 +9,13 @@
9
9
  "type": "int",
10
10
  "required": true,
11
11
  "describe": "GitHub issue number to classify."
12
+ },
13
+ {
14
+ "name": "base",
15
+ "flag": "--base",
16
+ "type": "string",
17
+ "required": false,
18
+ "describe": "Optional base branch override forwarded by goal-tick's stacked-PR dispatch. dispatchClassified re-emits this on the `@kody <classification>` comment so the downstream container/run keeps the stacked base."
12
19
  }
13
20
  ],
14
21
  "claudeCode": {
@@ -9,6 +9,13 @@
9
9
  "type": "int",
10
10
  "required": true,
11
11
  "describe": "GitHub issue number to drive the flow on."
12
+ },
13
+ {
14
+ "name": "base",
15
+ "flag": "--base",
16
+ "type": "string",
17
+ "required": false,
18
+ "describe": "Optional base branch override (stacked-PR). Forwarded to the `run` child by the container loop."
12
19
  }
13
20
  ],
14
21
  "claudeCode": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.48",
3
+ "version": "0.4.50",
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",