@kody-ade/kody-engine 0.4.516 → 0.4.521

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.521",
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) {
@@ -4636,7 +4638,8 @@ function normalizeWorkflowDefinition(value) {
4636
4638
  }
4637
4639
  const workflow = parseCapabilityWorkflow({
4638
4640
  steps: raw.steps,
4639
- startAt: raw.startAt
4641
+ startAt: raw.startAt,
4642
+ report: raw.report
4640
4643
  });
4641
4644
  const steps = workflow?.steps;
4642
4645
  const capabilities = steps ? steps.map((step) => step.capability) : normalizeWorkflowCapabilities(raw.capabilities);
@@ -4648,6 +4651,7 @@ function normalizeWorkflowDefinition(value) {
4648
4651
  ...raw.runWithoutApproval === true ? { runWithoutApproval: true } : {},
4649
4652
  ...steps ? { steps } : {},
4650
4653
  ...workflow?.startAt ? { startAt: workflow.startAt } : {},
4654
+ ...workflow?.report ? { report: workflow.report } : {},
4651
4655
  ...typeof raw.createdAt === "string" ? { createdAt: raw.createdAt } : {},
4652
4656
  ...typeof raw.updatedAt === "string" ? { updatedAt: raw.updatedAt } : {}
4653
4657
  };
@@ -4700,7 +4704,8 @@ function normalizeWorkflowCapabilities(value) {
4700
4704
  function workflowDefinitionToConfig(workflow) {
4701
4705
  return {
4702
4706
  steps: workflow.steps ?? workflow.capabilities.map((capability) => ({ capability })),
4703
- ...workflow.startAt ? { startAt: workflow.startAt } : {}
4707
+ ...workflow.startAt ? { startAt: workflow.startAt } : {},
4708
+ ...workflow.report ? { report: workflow.report } : {}
4704
4709
  };
4705
4710
  }
4706
4711
  function parseWorkflowDefinition(content) {
@@ -7335,7 +7340,9 @@ function resolveLitellmCommand() {
7335
7340
  }
7336
7341
  }
7337
7342
  if (!installed || !litellmImportable()) {
7338
- throw new Error(`litellm not installed and auto-install failed \u2014 run: pip install ${LITELLM_PIP_PACKAGES.join(" ")}`);
7343
+ throw new Error(
7344
+ `litellm not installed and auto-install failed \u2014 run: pip install ${LITELLM_PIP_PACKAGES.join(" ")}`
7345
+ );
7339
7346
  }
7340
7347
  }
7341
7348
  const script = locateLitellmScript();
@@ -17899,6 +17906,57 @@ function buildRuntimeReportMarkdown(input) {
17899
17906
  ""
17900
17907
  ].join("\n");
17901
17908
  }
17909
+ async function publishWorkflowReport(input) {
17910
+ const slug = input.publication.slug;
17911
+ if (!slug || !SAFE_SLUG.test(slug)) return;
17912
+ const tenantId2 = input.config.github?.owner && input.config.github.repo ? `${input.config.github.owner}/${input.config.github.repo}` : process.env.GITHUB_REPOSITORY;
17913
+ if (!tenantId2) return;
17914
+ const generatedAt = (/* @__PURE__ */ new Date()).toISOString();
17915
+ const title = input.publication.title ?? input.workflowTitle;
17916
+ const summary = input.state.status === "done" ? `${input.workflowTitle} completed` : `${input.workflowTitle} ${input.state.status}${input.state.blocker ? `: ${input.state.blocker}` : ""}`;
17917
+ const markdown = buildRuntimeReportMarkdown({
17918
+ generatedAt,
17919
+ reportType: input.publication.type,
17920
+ reportTypeVersion: input.publication.version ?? 1,
17921
+ owner: input.publication.owner,
17922
+ capability: input.workflowId,
17923
+ title,
17924
+ summary,
17925
+ data: {
17926
+ workflow: {
17927
+ id: input.workflowId,
17928
+ status: input.state.status,
17929
+ completedStepIds: input.state.completedStepIds,
17930
+ transitionCounts: input.state.transitionCounts,
17931
+ facts: input.state.facts,
17932
+ evidence: input.state.evidence,
17933
+ artifacts: input.state.artifacts,
17934
+ ...input.state.blocker ? { blocker: input.state.blocker } : {}
17935
+ }
17936
+ },
17937
+ ...input.publication.reviewStatus ? { reviewStatus: input.publication.reviewStatus } : {},
17938
+ ...input.publication.reviewArea ? { reviewArea: input.publication.reviewArea } : {}
17939
+ });
17940
+ const runId = generatedAt.replace(/\.\d{3}Z$/, "Z").replace(/:/g, "-");
17941
+ if (hasStateBackendConfig()) {
17942
+ await createStateBackendFromEnv().saveReport(
17943
+ tenantId2,
17944
+ slug,
17945
+ runId,
17946
+ title,
17947
+ markdown,
17948
+ {
17949
+ reportType: input.publication.type,
17950
+ reportTypeVersion: input.publication.version ?? 1,
17951
+ owner: input.publication.owner,
17952
+ capability: input.workflowId
17953
+ },
17954
+ generatedAt
17955
+ );
17956
+ } else if (process.env.GITHUB_ACTIONS === "true") {
17957
+ throw new Error("Kody backend access is required for reports in GitHub Actions");
17958
+ }
17959
+ }
17902
17960
  function parsePublication(value) {
17903
17961
  if (!value || typeof value !== "object" || Array.isArray(value)) return null;
17904
17962
  const raw = value;
@@ -22383,7 +22441,19 @@ async function runCapabilityWorkflow(parent, workflow, capability, base, checkpo
22383
22441
  }
22384
22442
  return { exitCode: 64, reason: invalid };
22385
22443
  }
22386
- if (isGraphWorkflow(workflow)) return runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
22444
+ if (isGraphWorkflow(workflow)) {
22445
+ const result = await runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
22446
+ if (workflow.report && result.workflowState) {
22447
+ await publishWorkflowReport({
22448
+ config: base.config ?? loadConfig(base.cwd),
22449
+ publication: workflow.report,
22450
+ workflowId: capability.slug,
22451
+ workflowTitle: capability.title,
22452
+ state: result.workflowState
22453
+ });
22454
+ }
22455
+ return result;
22456
+ }
22387
22457
  return runLinearCapabilityWorkflow(parent, workflow, capability, base);
22388
22458
  }
22389
22459
  async function runLinearCapabilityWorkflow(parent, workflow, capability, base) {
@@ -22943,10 +23013,12 @@ var init_job = __esm({
22943
23013
  "use strict";
22944
23014
  init_agencyBoundaryEval();
22945
23015
  init_capabilityFolders();
23016
+ init_config();
22946
23017
  init_definition_paths();
22947
23018
  init_executor();
22948
23019
  init_registry();
22949
23020
  init_runIndex();
23021
+ init_publishReport();
22950
23022
  init_simpleCapabilityRuntime();
22951
23023
  init_state_backend();
22952
23024
  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.521",
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
+ }