@kody-ade/kody-engine 0.4.516 → 0.4.520

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.516",
18
+ version: "0.4.520",
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",
@@ -48,7 +48,7 @@ var init_package = __esm({
48
48
  format: "biome format --write",
49
49
  "verify:package": "node scripts/verify-package-tarball.cjs",
50
50
  "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",
51
- prepublishOnly: "pnpm typecheck && vitest run tests/unit tests/int --no-coverage && pnpm test:runtime-services && pnpm build && pnpm verify:package"
51
+ prepublishOnly: "pnpm typecheck && pnpm test:runtime-services && pnpm build && pnpm verify:package"
52
52
  },
53
53
  dependencies: {
54
54
  "@actions/cache": "^6.0.0",
@@ -2045,9 +2045,11 @@ function parseCapabilityWorkflow(value) {
2045
2045
  const steps = stepsRaw.map(parseWorkflowStep).filter((step) => step !== null);
2046
2046
  if (steps.length === 0) return void 0;
2047
2047
  const startAt = value && typeof value === "object" && !Array.isArray(value) ? stringField(value.startAt) : void 0;
2048
+ const report = value && typeof value === "object" && !Array.isArray(value) ? parseReportPublication(value.report) : void 0;
2048
2049
  return {
2049
2050
  steps,
2050
- ...startAt && isSafeStepId(startAt) ? { startAt } : {}
2051
+ ...startAt && isSafeStepId(startAt) ? { startAt } : {},
2052
+ ...report ? { report } : {}
2051
2053
  };
2052
2054
  }
2053
2055
  function parseWorkflowStep(value) {
@@ -7335,7 +7337,9 @@ function resolveLitellmCommand() {
7335
7337
  }
7336
7338
  }
7337
7339
  if (!installed || !litellmImportable()) {
7338
- throw new Error(`litellm not installed and auto-install failed \u2014 run: pip install ${LITELLM_PIP_PACKAGES.join(" ")}`);
7340
+ throw new Error(
7341
+ `litellm not installed and auto-install failed \u2014 run: pip install ${LITELLM_PIP_PACKAGES.join(" ")}`
7342
+ );
7339
7343
  }
7340
7344
  }
7341
7345
  const script = locateLitellmScript();
@@ -17899,6 +17903,57 @@ function buildRuntimeReportMarkdown(input) {
17899
17903
  ""
17900
17904
  ].join("\n");
17901
17905
  }
17906
+ async function publishWorkflowReport(input) {
17907
+ const slug = input.publication.slug;
17908
+ if (!slug || !SAFE_SLUG.test(slug)) return;
17909
+ const tenantId2 = input.config.github?.owner && input.config.github.repo ? `${input.config.github.owner}/${input.config.github.repo}` : process.env.GITHUB_REPOSITORY;
17910
+ if (!tenantId2) return;
17911
+ const generatedAt = (/* @__PURE__ */ new Date()).toISOString();
17912
+ const title = input.publication.title ?? input.workflowTitle;
17913
+ const summary = input.state.status === "done" ? `${input.workflowTitle} completed` : `${input.workflowTitle} ${input.state.status}${input.state.blocker ? `: ${input.state.blocker}` : ""}`;
17914
+ const markdown = buildRuntimeReportMarkdown({
17915
+ generatedAt,
17916
+ reportType: input.publication.type,
17917
+ reportTypeVersion: input.publication.version ?? 1,
17918
+ owner: input.publication.owner,
17919
+ capability: input.workflowId,
17920
+ title,
17921
+ summary,
17922
+ data: {
17923
+ workflow: {
17924
+ id: input.workflowId,
17925
+ status: input.state.status,
17926
+ completedStepIds: input.state.completedStepIds,
17927
+ transitionCounts: input.state.transitionCounts,
17928
+ facts: input.state.facts,
17929
+ evidence: input.state.evidence,
17930
+ artifacts: input.state.artifacts,
17931
+ ...input.state.blocker ? { blocker: input.state.blocker } : {}
17932
+ }
17933
+ },
17934
+ ...input.publication.reviewStatus ? { reviewStatus: input.publication.reviewStatus } : {},
17935
+ ...input.publication.reviewArea ? { reviewArea: input.publication.reviewArea } : {}
17936
+ });
17937
+ const runId = generatedAt.replace(/\.\d{3}Z$/, "Z").replace(/:/g, "-");
17938
+ if (hasStateBackendConfig()) {
17939
+ await createStateBackendFromEnv().saveReport(
17940
+ tenantId2,
17941
+ slug,
17942
+ runId,
17943
+ title,
17944
+ markdown,
17945
+ {
17946
+ reportType: input.publication.type,
17947
+ reportTypeVersion: input.publication.version ?? 1,
17948
+ owner: input.publication.owner,
17949
+ capability: input.workflowId
17950
+ },
17951
+ generatedAt
17952
+ );
17953
+ } else if (process.env.GITHUB_ACTIONS === "true") {
17954
+ throw new Error("Kody backend access is required for reports in GitHub Actions");
17955
+ }
17956
+ }
17902
17957
  function parsePublication(value) {
17903
17958
  if (!value || typeof value !== "object" || Array.isArray(value)) return null;
17904
17959
  const raw = value;
@@ -22383,7 +22438,19 @@ async function runCapabilityWorkflow(parent, workflow, capability, base, checkpo
22383
22438
  }
22384
22439
  return { exitCode: 64, reason: invalid };
22385
22440
  }
22386
- if (isGraphWorkflow(workflow)) return runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
22441
+ if (isGraphWorkflow(workflow)) {
22442
+ const result = await runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
22443
+ if (workflow.report && result.workflowState) {
22444
+ await publishWorkflowReport({
22445
+ config: base.config ?? loadConfig(base.cwd),
22446
+ publication: workflow.report,
22447
+ workflowId: capability.slug,
22448
+ workflowTitle: capability.title,
22449
+ state: result.workflowState
22450
+ });
22451
+ }
22452
+ return result;
22453
+ }
22387
22454
  return runLinearCapabilityWorkflow(parent, workflow, capability, base);
22388
22455
  }
22389
22456
  async function runLinearCapabilityWorkflow(parent, workflow, capability, base) {
@@ -22943,10 +23010,12 @@ var init_job = __esm({
22943
23010
  "use strict";
22944
23011
  init_agencyBoundaryEval();
22945
23012
  init_capabilityFolders();
23013
+ init_config();
22946
23014
  init_definition_paths();
22947
23015
  init_executor();
22948
23016
  init_registry();
22949
23017
  init_runIndex();
23018
+ init_publishReport();
22950
23019
  init_simpleCapabilityRuntime();
22951
23020
  init_state_backend();
22952
23021
  init_workflowDefinitions();
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.516",
4
- "description": "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
3
+ "version": "0.4.520",
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",
7
7
  "bin": {
@@ -12,29 +12,6 @@
12
12
  "templates",
13
13
  "kody.config.schema.json"
14
14
  ],
15
- "scripts": {
16
- "kody:run": "tsx bin/kody.ts",
17
- "serve": "tsx bin/kody.ts serve",
18
- "serve:vscode": "tsx bin/kody.ts serve vscode",
19
- "serve:claude": "tsx bin/kody.ts serve claude",
20
- "clean:dist": "node scripts/clean-dist.cjs",
21
- "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
22
- "check:modularity": "tsx scripts/check-script-modularity.ts",
23
- "pretest": "pnpm check:modularity",
24
- "test": "vitest run tests/unit tests/int --coverage",
25
- "posttest": "tsx scripts/check-coverage-floor.ts",
26
- "test:smoke": "vitest run tests/smoke --no-coverage",
27
- "test:e2e": "vitest run tests/e2e --no-coverage",
28
- "test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
29
- "test:all": "vitest run tests --no-coverage",
30
- "typecheck": "tsc --noEmit",
31
- "lint": "biome check",
32
- "lint:fix": "biome check --write",
33
- "format": "biome format --write",
34
- "verify:package": "node scripts/verify-package-tarball.cjs",
35
- "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",
36
- "prepublishOnly": "pnpm typecheck && vitest run tests/unit tests/int --no-coverage && pnpm test:runtime-services && pnpm build && pnpm verify:package"
37
- },
38
15
  "dependencies": {
39
16
  "@actions/cache": "^6.0.0",
40
17
  "@anthropic-ai/claude-agent-sdk": "0.2.119",
@@ -61,5 +38,27 @@
61
38
  "url": "git+https://github.com/aharonyaircohen/kody-engine.git"
62
39
  },
63
40
  "homepage": "https://github.com/aharonyaircohen/kody-engine",
64
- "bugs": "https://github.com/aharonyaircohen/kody-engine/issues"
65
- }
41
+ "bugs": "https://github.com/aharonyaircohen/kody-engine/issues",
42
+ "scripts": {
43
+ "kody:run": "tsx bin/kody.ts",
44
+ "serve": "tsx bin/kody.ts serve",
45
+ "serve:vscode": "tsx bin/kody.ts serve vscode",
46
+ "serve:claude": "tsx bin/kody.ts serve claude",
47
+ "clean:dist": "node scripts/clean-dist.cjs",
48
+ "build": "pnpm clean:dist && tsup && node scripts/copy-assets.cjs",
49
+ "check:modularity": "tsx scripts/check-script-modularity.ts",
50
+ "pretest": "pnpm check:modularity",
51
+ "test": "vitest run tests/unit tests/int --coverage",
52
+ "posttest": "tsx scripts/check-coverage-floor.ts",
53
+ "test:smoke": "vitest run tests/smoke --no-coverage",
54
+ "test:e2e": "vitest run tests/e2e --no-coverage",
55
+ "test:runtime-services": "node --test \"tests/runtime-services/*.test.mjs\"",
56
+ "test:all": "vitest run tests --no-coverage",
57
+ "typecheck": "tsc --noEmit",
58
+ "lint": "biome check",
59
+ "lint:fix": "biome check --write",
60
+ "format": "biome format --write",
61
+ "verify:package": "node scripts/verify-package-tarball.cjs",
62
+ "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"
63
+ }
64
+ }