@kody-ade/kody-engine 0.4.576 → 0.4.578

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 +23 -4
  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.576",
18
+ version: "0.4.578",
19
19
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
20
20
  license: "MIT",
21
21
  type: "module",
@@ -14160,6 +14160,11 @@ var init_loopDefinitions = __esm({
14160
14160
 
14161
14161
  // src/scripts/dispatchLoops.ts
14162
14162
  import { randomUUID } from "crypto";
14163
+ function loopRunId(loopId, nonce) {
14164
+ const safeNonce = nonce.toLowerCase().replace(/[^a-z0-9_-]/g, "-");
14165
+ const loopPrefixLength = MAX_WORKFLOW_RUN_ID_LENGTH - "loop--".length - safeNonce.length;
14166
+ return `loop-${loopId.slice(0, Math.max(1, loopPrefixLength))}-${safeNonce}`;
14167
+ }
14163
14168
  function assertLoopDispatchesSucceeded(results) {
14164
14169
  const didNotRun = results.filter((result) => result.status === "failed" || result.status === "blocked");
14165
14170
  if (didNotRun.length === 0) return;
@@ -14201,7 +14206,7 @@ async function dispatchLoopsWith(input) {
14201
14206
  results.push({ loopId: loop.id, status: status2, reason: reason2 });
14202
14207
  continue;
14203
14208
  }
14204
- const runId = `loop-${loop.id}-${input.nonce()}`;
14209
+ const runId = loopRunId(loop.id, input.nonce());
14205
14210
  const startedAt = input.now.toISOString();
14206
14211
  const running = {
14207
14212
  id: runId,
@@ -14342,7 +14347,7 @@ function repositoryTenant(config) {
14342
14347
  const repo = config.github?.repo?.trim() || envRepo?.trim();
14343
14348
  return owner && repo ? `${owner}/${repo}` : null;
14344
14349
  }
14345
- var LOOP_DISPATCH_LEASE_MS, LOOP_DISPATCH_RENEW_INTERVAL_MS, dispatchLoops;
14350
+ var LOOP_DISPATCH_LEASE_MS, LOOP_DISPATCH_RENEW_INTERVAL_MS, MAX_WORKFLOW_RUN_ID_LENGTH, dispatchLoops;
14346
14351
  var init_dispatchLoops = __esm({
14347
14352
  "src/scripts/dispatchLoops.ts"() {
14348
14353
  "use strict";
@@ -14351,6 +14356,7 @@ var init_dispatchLoops = __esm({
14351
14356
  init_state_backend();
14352
14357
  LOOP_DISPATCH_LEASE_MS = 10 * 60 * 1e3;
14353
14358
  LOOP_DISPATCH_RENEW_INTERVAL_MS = 60 * 1e3;
14359
+ MAX_WORKFLOW_RUN_ID_LENGTH = 80;
14354
14360
  dispatchLoops = async (ctx) => {
14355
14361
  const tenantId2 = repositoryTenant(ctx.config);
14356
14362
  if (!tenantId2) throw new Error("Repository identity is required for Loop dispatch");
@@ -17403,6 +17409,18 @@ var init_parseReproOutput = __esm({
17403
17409
 
17404
17410
  // src/scripts/parseSimpleCapabilityOutput.ts
17405
17411
  import * as fs47 from "fs";
17412
+ function acceptAuthoritativeFileOutput(ctx, profile, output) {
17413
+ ctx.data.agentDone = true;
17414
+ delete ctx.data.agentFailureReason;
17415
+ const summary = isObject2(output) && typeof output.summary === "string" ? output.summary.trim() : "";
17416
+ if (summary && !ctx.data.prSummary) ctx.data.prSummary = summary;
17417
+ const mode = typeof ctx.args?.mode === "string" ? ctx.args.mode : profile.name || "capability";
17418
+ ctx.data.action = {
17419
+ type: `${mode.replace(/-/g, "_").toUpperCase()}_COMPLETED`,
17420
+ payload: {},
17421
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
17422
+ };
17423
+ }
17406
17424
  function stringList2(value) {
17407
17425
  return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
17408
17426
  }
@@ -17456,7 +17474,7 @@ var init_parseSimpleCapabilityOutput = __esm({
17456
17474
  "use strict";
17457
17475
  init_capability_contract_validation();
17458
17476
  init_capabilityResult();
17459
- parseSimpleCapabilityOutput = async (ctx, _profile, agentResult) => {
17477
+ parseSimpleCapabilityOutput = async (ctx, profile, agentResult) => {
17460
17478
  const requiredSubagents = stringList2(ctx.data.requiredSubagents);
17461
17479
  const invokedSubagents = new Set(agentResult?.invokedSubagents ?? []);
17462
17480
  const missingSubagents = requiredSubagents.filter((name) => !invokedSubagents.has(name));
@@ -17528,6 +17546,7 @@ var init_parseSimpleCapabilityOutput = __esm({
17528
17546
  return;
17529
17547
  }
17530
17548
  }
17549
+ if (fileOutput.found) acceptAuthoritativeFileOutput(ctx, profile, output);
17531
17550
  ctx.data.capabilityOutput = output;
17532
17551
  const structuredResult = parseCapabilityResult(output);
17533
17552
  if (structuredResult) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.576",
3
+ "version": "0.4.578",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",