@kody-ade/kody-engine 0.3.20 → 0.3.21

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 +20 -19
  2. package/package.json +1 -1
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.3.20",
6
+ version: "0.3.21",
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",
@@ -2671,6 +2671,12 @@ function truncate2(s, maxBytes) {
2671
2671
  if (s.length <= maxBytes) return s;
2672
2672
  return `${s.slice(0, maxBytes)}\u2026 (+${s.length - maxBytes} chars)`;
2673
2673
  }
2674
+ function parsePrNumber(url) {
2675
+ const m = url.match(/\/pull\/(\d+)(?:[/?#]|$)/);
2676
+ if (!m) return null;
2677
+ const n = parseInt(m[1], 10);
2678
+ return Number.isFinite(n) ? n : null;
2679
+ }
2674
2680
  function getPr(prNumber, cwd) {
2675
2681
  const output = gh2(["pr", "view", String(prNumber), "--json", "number,title,body,headRefName,baseRefName,state"], {
2676
2682
  cwd
@@ -3138,15 +3144,16 @@ var finishFlow = async (ctx, _profile, _agentResult, args) => {
3138
3144
  if (!issueNumber) return;
3139
3145
  const label = typeof args?.label === "string" ? args.label : void 0;
3140
3146
  if (label && label.startsWith(KODY_NAMESPACE)) {
3141
- setKodyLabel(
3142
- issueNumber,
3143
- {
3144
- label,
3145
- color: typeof args?.color === "string" ? args.color : void 0,
3146
- description: typeof args?.description === "string" ? args.description : void 0
3147
- },
3148
- ctx.cwd
3149
- );
3147
+ const spec = {
3148
+ label,
3149
+ color: typeof args?.color === "string" ? args.color : void 0,
3150
+ description: typeof args?.description === "string" ? args.description : void 0
3151
+ };
3152
+ setKodyLabel(issueNumber, spec, ctx.cwd);
3153
+ const prNumber = state?.core.prUrl ? parsePrNumber(state.core.prUrl) : null;
3154
+ if (prNumber && prNumber !== issueNumber) {
3155
+ setKodyLabel(prNumber, spec, ctx.cwd);
3156
+ }
3150
3157
  }
3151
3158
  const icon = STATUS_ICON[reason] ?? "\u2139\uFE0F";
3152
3159
  const prSuffix = state?.core.prUrl ? `
@@ -4044,7 +4051,7 @@ var mirrorStateToPr = async (ctx) => {
4044
4051
  if (!issueNumber || issueTarget !== "issue") return;
4045
4052
  const prUrl = ctx.output.prUrl ?? ctx.data.prResult?.url;
4046
4053
  if (!prUrl) return;
4047
- const prNumber = parsePrNumber(prUrl);
4054
+ const prNumber = parsePrNumber2(prUrl);
4048
4055
  if (!prNumber) return;
4049
4056
  let state;
4050
4057
  try {
@@ -4062,7 +4069,7 @@ var mirrorStateToPr = async (ctx) => {
4062
4069
  );
4063
4070
  }
4064
4071
  };
4065
- function parsePrNumber(prUrl) {
4072
+ function parsePrNumber2(prUrl) {
4066
4073
  const m = prUrl.match(/\/pull\/(\d+)(?:[/?#]|$)/);
4067
4074
  if (!m) return null;
4068
4075
  const n = parseInt(m[1], 10);
@@ -5210,7 +5217,7 @@ var startFlow = async (ctx, profile, _agentResult, args) => {
5210
5217
  postKodyComment(target, issueNumber, state, entry, ctx.cwd);
5211
5218
  };
5212
5219
  function postKodyComment(target, issueNumber, state, next, cwd) {
5213
- const targetNumber = target === "pr" && state?.core.prUrl ? parsePr2(state.core.prUrl) ?? issueNumber : issueNumber;
5220
+ const targetNumber = target === "pr" && state?.core.prUrl ? parsePrNumber(state.core.prUrl) ?? issueNumber : issueNumber;
5214
5221
  const sub = target === "pr" && state?.core.prUrl ? "pr" : "issue";
5215
5222
  const body = `@kody ${next}`;
5216
5223
  try {
@@ -5226,12 +5233,6 @@ function postKodyComment(target, issueNumber, state, next, cwd) {
5226
5233
  );
5227
5234
  }
5228
5235
  }
5229
- function parsePr2(url) {
5230
- const m = url.match(/\/pull\/(\d+)(?:[/?#]|$)/);
5231
- if (!m) return null;
5232
- const n = parseInt(m[1], 10);
5233
- return Number.isFinite(n) ? n : null;
5234
- }
5235
5236
 
5236
5237
  // src/scripts/syncFlow.ts
5237
5238
  import { execFileSync as execFileSync19 } from "child_process";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
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",