@kody-ade/kody-engine 0.4.462 → 0.4.464
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.
|
|
18
|
+
version: "0.4.464",
|
|
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",
|
|
@@ -11469,11 +11469,13 @@ var init_classifyByLabel = __esm({
|
|
|
11469
11469
|
});
|
|
11470
11470
|
|
|
11471
11471
|
// src/scripts/commitAndPush.ts
|
|
11472
|
+
import { createHash as createHash4 } from "crypto";
|
|
11472
11473
|
import * as fs31 from "fs";
|
|
11473
11474
|
import * as path29 from "path";
|
|
11474
|
-
function sentinelPathForStage(cwd, profileName) {
|
|
11475
|
+
function sentinelPathForStage(cwd, profileName, workflowExecutionKey) {
|
|
11475
11476
|
const runId = resolveRunId();
|
|
11476
|
-
|
|
11477
|
+
const executionSuffix = typeof workflowExecutionKey === "string" && workflowExecutionKey.length > 0 ? `-${createHash4("sha256").update(workflowExecutionKey).digest("hex").slice(0, 16)}` : "";
|
|
11478
|
+
return runtimeStatePath(cwd, "agent-runs", runId, `commit-${profileName}${executionSuffix}.lock`);
|
|
11477
11479
|
}
|
|
11478
11480
|
var DEFAULT_COMMIT_MESSAGE, commitAndPush2;
|
|
11479
11481
|
var init_commitAndPush = __esm({
|
|
@@ -11490,7 +11492,7 @@ var init_commitAndPush = __esm({
|
|
|
11490
11492
|
return;
|
|
11491
11493
|
}
|
|
11492
11494
|
const idempotencyEnabled = process.env.KODY_COMMIT_IDEMPOTENCY !== "0";
|
|
11493
|
-
const sentinel = idempotencyEnabled ? sentinelPathForStage(ctx.cwd, profile.name) : null;
|
|
11495
|
+
const sentinel = idempotencyEnabled ? sentinelPathForStage(ctx.cwd, profile.name, ctx.data.workflowExecutionKey) : null;
|
|
11494
11496
|
if (sentinel && fs31.existsSync(sentinel)) {
|
|
11495
11497
|
try {
|
|
11496
11498
|
const replay = JSON.parse(fs31.readFileSync(sentinel, "utf-8"));
|
|
@@ -13287,7 +13289,7 @@ var init_triggerDispatcher = __esm({
|
|
|
13287
13289
|
});
|
|
13288
13290
|
|
|
13289
13291
|
// src/goal/policyResolver.ts
|
|
13290
|
-
import { createHash as
|
|
13292
|
+
import { createHash as createHash5 } from "crypto";
|
|
13291
13293
|
function resolveDispatchPolicy(input) {
|
|
13292
13294
|
const operation = input.catalog.operations.get(input.owner.definition.operationId);
|
|
13293
13295
|
if (!operation) throw new Error(`Dispatch blocked: Operation "${input.owner.definition.operationId}" is unresolved`);
|
|
@@ -13305,7 +13307,7 @@ function resolveDispatchPolicy(input) {
|
|
|
13305
13307
|
const snapshotValue = { policy, constraints };
|
|
13306
13308
|
return {
|
|
13307
13309
|
snapshot: {
|
|
13308
|
-
hash:
|
|
13310
|
+
hash: createHash5("sha256").update(stableJson(snapshotValue)).digest("hex"),
|
|
13309
13311
|
...snapshotValue
|
|
13310
13312
|
},
|
|
13311
13313
|
operation,
|
|
@@ -15919,9 +15921,9 @@ var init_kodyVariables = __esm({
|
|
|
15919
15921
|
});
|
|
15920
15922
|
|
|
15921
15923
|
// src/backendVault.ts
|
|
15922
|
-
import { createDecipheriv, createHash as
|
|
15924
|
+
import { createDecipheriv, createHash as createHash6 } from "crypto";
|
|
15923
15925
|
function cacheKey(owner, repo, masterKey) {
|
|
15924
|
-
const keyHash =
|
|
15926
|
+
const keyHash = createHash6("sha256").update(masterKey).digest("hex").slice(0, 16);
|
|
15925
15927
|
return `${owner}/${repo}:${keyHash}`.toLowerCase();
|
|
15926
15928
|
}
|
|
15927
15929
|
function decryptVault(payload, masterKey) {
|
|
@@ -16704,7 +16706,7 @@ var init_notifyTerminal = __esm({
|
|
|
16704
16706
|
});
|
|
16705
16707
|
|
|
16706
16708
|
// src/scripts/openAgencyModelReviewPr.ts
|
|
16707
|
-
import { createHash as
|
|
16709
|
+
import { createHash as createHash7 } from "crypto";
|
|
16708
16710
|
function parseAgencyModelProposal(raw) {
|
|
16709
16711
|
const text2 = raw.trim();
|
|
16710
16712
|
const jsonText = (text2.match(/^```(?:json)?\s*\n([\s\S]*?)\n```$/i)?.[1] ?? text2).trim();
|
|
@@ -16756,7 +16758,7 @@ function normalizeBundleFiles(bundle) {
|
|
|
16756
16758
|
});
|
|
16757
16759
|
}
|
|
16758
16760
|
function buildProposalId(issueNumber, bundle, sourceLabel) {
|
|
16759
|
-
const digest =
|
|
16761
|
+
const digest = createHash7("sha256").update(JSON.stringify({ issueNumber, sourceLabel, title: bundle.title, files: normalizeBundleFiles(bundle) })).digest("hex").slice(0, 16);
|
|
16760
16762
|
return `issue-${issueNumber}-${digest}`;
|
|
16761
16763
|
}
|
|
16762
16764
|
function isDryRun(ctx) {
|
|
@@ -19086,9 +19088,9 @@ var init_reviewFlow = __esm({
|
|
|
19086
19088
|
});
|
|
19087
19089
|
|
|
19088
19090
|
// src/scripts/previewBuildHelpers.ts
|
|
19089
|
-
import { createDecipheriv as createDecipheriv2, createHash as
|
|
19091
|
+
import { createDecipheriv as createDecipheriv2, createHash as createHash8, hkdfSync as hkdfSync2 } from "crypto";
|
|
19090
19092
|
function shortHash(s) {
|
|
19091
|
-
return
|
|
19093
|
+
return createHash8("sha256").update(s).digest("hex").slice(0, 6);
|
|
19092
19094
|
}
|
|
19093
19095
|
function previewAppName(repo, pr) {
|
|
19094
19096
|
const [owner, name] = repo.split("/");
|
|
@@ -19121,7 +19123,7 @@ function formatPreviewComment(args) {
|
|
|
19121
19123
|
].join("\n");
|
|
19122
19124
|
}
|
|
19123
19125
|
function defaultImageTag(repo, ref) {
|
|
19124
|
-
return
|
|
19126
|
+
return createHash8("sha256").update(`${repo}@${ref}`).digest("hex").slice(0, 12);
|
|
19125
19127
|
}
|
|
19126
19128
|
var init_previewBuildHelpers = __esm({
|
|
19127
19129
|
"src/scripts/previewBuildHelpers.ts"() {
|
|
@@ -22717,6 +22719,7 @@ async function runLinearCapabilityWorkflow(parent, workflow, capability, base) {
|
|
|
22717
22719
|
runSubjectLabel: label,
|
|
22718
22720
|
workflowStep: label,
|
|
22719
22721
|
workflowStepIndex: index + 1,
|
|
22722
|
+
workflowExecutionKey: [capability.slug, label, index + 1].join(":"),
|
|
22720
22723
|
workflowStepReason: step.reason,
|
|
22721
22724
|
workflowContinueOn: step.continueOn ?? []
|
|
22722
22725
|
}
|
|
@@ -22853,6 +22856,12 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
|
|
|
22853
22856
|
runSubjectLabel: step.id,
|
|
22854
22857
|
workflowStep: step.id,
|
|
22855
22858
|
workflowStepIndex: index + 1,
|
|
22859
|
+
workflowExecutionKey: graphWorkflowExecutionKey(
|
|
22860
|
+
base.preloadedData?.workflowExecutionKey,
|
|
22861
|
+
capability.slug,
|
|
22862
|
+
step.id,
|
|
22863
|
+
state.transitionCounts
|
|
22864
|
+
),
|
|
22856
22865
|
workflowStepReason: step.reason,
|
|
22857
22866
|
workflowContinueOn: step.continueOn ?? []
|
|
22858
22867
|
}
|
|
@@ -22919,6 +22928,15 @@ async function runGraphCapabilityWorkflow(parent, workflow, capability, base, ch
|
|
|
22919
22928
|
await checkpoint?.(state);
|
|
22920
22929
|
return withWorkflowBoundaryEval(capability, { ...result, workflowState: state });
|
|
22921
22930
|
}
|
|
22931
|
+
function graphWorkflowExecutionKey(parentExecutionKey, workflowSlug, stepId, transitionCounts) {
|
|
22932
|
+
const transitionHistory = Object.entries(transitionCounts).filter(([, count]) => count > 0).sort(([left], [right]) => left.localeCompare(right)).map(([transition, count]) => `${transition}=${count}`).join(",");
|
|
22933
|
+
return [
|
|
22934
|
+
typeof parentExecutionKey === "string" && parentExecutionKey.length > 0 ? parentExecutionKey : void 0,
|
|
22935
|
+
workflowSlug,
|
|
22936
|
+
stepId,
|
|
22937
|
+
transitionHistory || "initial"
|
|
22938
|
+
].filter((part) => part !== void 0).join(":");
|
|
22939
|
+
}
|
|
22922
22940
|
function mergeWorkflowResults(state, results) {
|
|
22923
22941
|
for (const result of results ?? []) {
|
|
22924
22942
|
Object.assign(state.facts, result.facts);
|
|
@@ -25368,7 +25386,18 @@ function installLitellmIfNeeded(cwd) {
|
|
|
25368
25386
|
} catch {
|
|
25369
25387
|
}
|
|
25370
25388
|
process.stdout.write("\u2192 kody: installing litellm (pip install 'litellm[proxy]')\n");
|
|
25371
|
-
|
|
25389
|
+
const installCode = shellOut("pip", ["install", "litellm[proxy]"], cwd);
|
|
25390
|
+
if (installCode === 0) return 0;
|
|
25391
|
+
try {
|
|
25392
|
+
execFileSync24("python3", ["-c", "import litellm"], { stdio: "pipe" });
|
|
25393
|
+
process.stderr.write(
|
|
25394
|
+
`\u2192 kody: pip exited ${installCode}, but litellm is importable; continuing
|
|
25395
|
+
`
|
|
25396
|
+
);
|
|
25397
|
+
return 0;
|
|
25398
|
+
} catch {
|
|
25399
|
+
return installCode;
|
|
25400
|
+
}
|
|
25372
25401
|
}
|
|
25373
25402
|
function configureGitIdentity(cwd) {
|
|
25374
25403
|
try {
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.464",
|
|
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",
|
|
@@ -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
|
+
}
|