@kody-ade/kody-engine 0.4.653 → 0.4.655

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.655",
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,29 @@ 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
+ return parseOutput(wrapped);
18550
+ }
18551
+ function blockInvalidContractOutput(ctx, output, error) {
18552
+ const reason = error instanceof Error ? error.message : String(error);
18553
+ ctx.output.exitCode = 64;
18554
+ ctx.output.reason = reason;
18555
+ ctx.data.capabilityOutput = output;
18556
+ ctx.data.capabilityResults = [
18557
+ {
18558
+ version: 1,
18559
+ status: "blocked",
18560
+ summary: reason,
18561
+ facts: {},
18562
+ artifacts: [],
18563
+ missingEvidence: [],
18564
+ blockers: [reason]
18565
+ }
18566
+ ];
18567
+ }
18545
18568
  function isObject2(value) {
18546
18569
  return Boolean(value) && typeof value === "object" && !Array.isArray(value);
18547
18570
  }
@@ -18580,7 +18603,7 @@ var init_parseSimpleCapabilityOutput = __esm({
18580
18603
  const outputPath = typeof ctx.data.capabilityOutputPath === "string" ? ctx.data.capabilityOutputPath : void 0;
18581
18604
  const fileOutput = readOutputFile(outputPath);
18582
18605
  const hasScriptOutput = Object.hasOwn(ctx.data, "capabilityScriptOutput");
18583
- const output = fileOutput.found ? fileOutput.value : hasScriptOutput ? ctx.data.capabilityScriptOutput : parseOutput(agentResult?.finalText);
18606
+ let output = fileOutput.found ? fileOutput.value : hasScriptOutput ? ctx.data.capabilityScriptOutput : parseOutput(agentResult?.finalText);
18584
18607
  if (output === void 0) {
18585
18608
  const reason2 = agentResult?.outcomeKind === "out_of_turns" ? "Capability execution limit reached" : "Capability execution ended before returning a result";
18586
18609
  const blocked = {
@@ -18609,22 +18632,17 @@ var init_parseSimpleCapabilityOutput = __esm({
18609
18632
  try {
18610
18633
  validateCapabilityContractOutput(outputSchema, output);
18611
18634
  } 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]
18635
+ const unwrapped = unwrapSingleOutput(output);
18636
+ if (unwrapped !== void 0) {
18637
+ try {
18638
+ validateCapabilityContractOutput(outputSchema, unwrapped);
18639
+ output = unwrapped;
18640
+ } catch {
18641
+ return blockInvalidContractOutput(ctx, output, error);
18625
18642
  }
18626
- ];
18627
- return;
18643
+ } else {
18644
+ return blockInvalidContractOutput(ctx, output, error);
18645
+ }
18628
18646
  }
18629
18647
  }
18630
18648
  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.655",
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
+ }