@kody-ade/kody-engine 0.4.653 → 0.4.654

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
@@ -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.653",
18
+ version: "0.4.654",
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
  repository: {
@@ -18542,6 +18542,33 @@ function parseSingleJsonCandidate(candidates) {
18542
18542
  }
18543
18543
  return parsed.length === 1 ? { found: true, value: parsed[0] } : { found: false };
18544
18544
  }
18545
+ function unwrapSingleOutput(value) {
18546
+ if (!isObject2(value) || Object.keys(value).length !== 1 || !Object.hasOwn(value, "output")) return void 0;
18547
+ const wrapped = value.output;
18548
+ if (typeof wrapped !== "string") return wrapped;
18549
+ try {
18550
+ return JSON.parse(wrapped);
18551
+ } catch {
18552
+ return void 0;
18553
+ }
18554
+ }
18555
+ function blockInvalidContractOutput(ctx, output, error) {
18556
+ const reason = error instanceof Error ? error.message : String(error);
18557
+ ctx.output.exitCode = 64;
18558
+ ctx.output.reason = reason;
18559
+ ctx.data.capabilityOutput = output;
18560
+ ctx.data.capabilityResults = [
18561
+ {
18562
+ version: 1,
18563
+ status: "blocked",
18564
+ summary: reason,
18565
+ facts: {},
18566
+ artifacts: [],
18567
+ missingEvidence: [],
18568
+ blockers: [reason]
18569
+ }
18570
+ ];
18571
+ }
18545
18572
  function isObject2(value) {
18546
18573
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
18547
18574
  }
@@ -18580,7 +18607,7 @@ var init_parseSimpleCapabilityOutput = __esm({
18580
18607
  const outputPath = typeof ctx.data.capabilityOutputPath === "string" ? ctx.data.capabilityOutputPath : void 0;
18581
18608
  const fileOutput = readOutputFile(outputPath);
18582
18609
  const hasScriptOutput = Object.hasOwn(ctx.data, "capabilityScriptOutput");
18583
- const output = fileOutput.found ? fileOutput.value : hasScriptOutput ? ctx.data.capabilityScriptOutput : parseOutput(agentResult?.finalText);
18610
+ let output = fileOutput.found ? fileOutput.value : hasScriptOutput ? ctx.data.capabilityScriptOutput : parseOutput(agentResult?.finalText);
18584
18611
  if (output === void 0) {
18585
18612
  const reason2 = agentResult?.outcomeKind === "out_of_turns" ? "Capability execution limit reached" : "Capability execution ended before returning a result";
18586
18613
  const blocked = {
@@ -18609,22 +18636,17 @@ var init_parseSimpleCapabilityOutput = __esm({
18609
18636
  try {
18610
18637
  validateCapabilityContractOutput(outputSchema, output);
18611
18638
  } catch (error) {
18612
- const reason2 = error instanceof Error ? error.message : String(error);
18613
- ctx.output.exitCode = 64;
18614
- ctx.output.reason = reason2;
18615
- ctx.data.capabilityOutput = output;
18616
- ctx.data.capabilityResults = [
18617
- {
18618
- version: 1,
18619
- status: "blocked",
18620
- summary: reason2,
18621
- facts: {},
18622
- artifacts: [],
18623
- missingEvidence: [],
18624
- blockers: [reason2]
18639
+ const unwrapped = unwrapSingleOutput(output);
18640
+ if (unwrapped !== void 0) {
18641
+ try {
18642
+ validateCapabilityContractOutput(outputSchema, unwrapped);
18643
+ output = unwrapped;
18644
+ } catch {
18645
+ return blockInvalidContractOutput(ctx, output, error);
18625
18646
  }
18626
- ];
18627
- return;
18647
+ } else {
18648
+ return blockInvalidContractOutput(ctx, output, error);
18649
+ }
18628
18650
  }
18629
18651
  }
18630
18652
  if (fileOutput.found || hasScriptOutput) acceptAuthoritativeCapabilityOutput(ctx, profile, output);
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.653",
3
+ "version": "0.4.654",
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
  "repository": {
@@ -17,30 +17,6 @@
17
17
  "docs/delivery-boundary.md",
18
18
  "kody.config.schema.json"
19
19
  ],
20
- "scripts": {
21
- "kody:run": "tsx bin/kody.ts",
22
- "serve": "tsx bin/kody.ts serve",
23
- "serve:vscode": "tsx bin/kody.ts serve vscode",
24
- "serve:claude": "tsx bin/kody.ts serve claude",
25
- "clean:dist": "node scripts/clean-dist.cjs",
26
- "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
27
- "check:modularity": "tsx scripts/check-script-modularity.ts",
28
- "pretest": "pnpm check:modularity",
29
- "test": "vitest run tests/unit tests/int --coverage",
30
- "posttest": "tsx scripts/check-coverage-floor.ts",
31
- "test:smoke": "vitest run tests/smoke --no-coverage",
32
- "test:e2e": "vitest run tests/e2e --no-coverage",
33
- "verify:live-release": "tsx scripts/live-release-gate.ts",
34
- "test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
35
- "test:all": "vitest run tests --no-coverage",
36
- "typecheck": "tsc --noEmit",
37
- "lint": "biome check",
38
- "lint:fix": "biome check --write",
39
- "format": "biome format --write",
40
- "verify:package": "node scripts/verify-package-tarball.cjs",
41
- "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain --build-arg KODY_ENGINE_REF=$(git rev-parse HEAD) -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner",
42
- "prepublishOnly": "pnpm typecheck && pnpm test:runtime-services && pnpm build && pnpm verify:package"
43
- },
44
20
  "dependencies": {
45
21
  "@actions/cache": "^6.0.0",
46
22
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
@@ -63,5 +39,28 @@
63
39
  "node": ">=22"
64
40
  },
65
41
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
66
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
67
- }
42
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
43
+ "scripts": {
44
+ "kody:run": "tsx bin/kody.ts",
45
+ "serve": "tsx bin/kody.ts serve",
46
+ "serve:vscode": "tsx bin/kody.ts serve vscode",
47
+ "serve:claude": "tsx bin/kody.ts serve claude",
48
+ "clean:dist": "node scripts/clean-dist.cjs",
49
+ "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
50
+ "check:modularity": "tsx scripts/check-script-modularity.ts",
51
+ "pretest": "pnpm check:modularity",
52
+ "test": "vitest run tests/unit tests/int --coverage",
53
+ "posttest": "tsx scripts/check-coverage-floor.ts",
54
+ "test:smoke": "vitest run tests/smoke --no-coverage",
55
+ "test:e2e": "vitest run tests/e2e --no-coverage",
56
+ "verify:live-release": "tsx scripts/live-release-gate.ts",
57
+ "test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
58
+ "test:all": "vitest run tests --no-coverage",
59
+ "typecheck": "tsc --noEmit",
60
+ "lint": "biome check",
61
+ "lint:fix": "biome check --write",
62
+ "format": "biome format --write",
63
+ "verify:package": "node scripts/verify-package-tarball.cjs",
64
+ "brain:publish": "docker buildx build --platform linux/amd64 -f runner/Dockerfile.brain --build-arg KODY_ENGINE_REF=$(git rev-parse HEAD) -t ghcr.io/${KODY_BRAIN_GHCR_OWNER:-aharonyaircohen}/kody-brain:latest --push runner"
65
+ }
66
+ }