@kody-ade/kody-engine 0.4.627 → 0.4.629
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 +44 -18
- package/package.json +1 -1
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.629",
|
|
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: {
|
|
@@ -12739,6 +12739,7 @@ var init_commitAndPush = __esm({
|
|
|
12739
12739
|
const replay = JSON.parse(fs33.readFileSync(sentinel, "utf-8"));
|
|
12740
12740
|
ctx.data.commitResult = replay.commitResult ?? { committed: false, pushed: false };
|
|
12741
12741
|
if (Array.isArray(replay.changedFiles)) ctx.data.changedFiles = replay.changedFiles;
|
|
12742
|
+
if (Array.isArray(replay.deliveryOmissions)) ctx.data.deliveryOmissions = replay.deliveryOmissions;
|
|
12742
12743
|
if (typeof replay.hasCommitsAhead === "boolean") ctx.data.hasCommitsAhead = replay.hasCommitsAhead;
|
|
12743
12744
|
if (replay.salvagedFromMissingMarker) ctx.data.salvagedFromMissingMarker = true;
|
|
12744
12745
|
if (typeof replay.commitCrash === "string") {
|
|
@@ -12806,6 +12807,7 @@ var init_commitAndPush = __esm({
|
|
|
12806
12807
|
{
|
|
12807
12808
|
commitResult: ctx.data.commitResult,
|
|
12808
12809
|
changedFiles: ctx.data.changedFiles,
|
|
12810
|
+
deliveryOmissions: ctx.data.deliveryOmissions,
|
|
12809
12811
|
hasCommitsAhead: ctx.data.hasCommitsAhead,
|
|
12810
12812
|
salvagedFromMissingMarker: ctx.data.salvagedFromMissingMarker === true,
|
|
12811
12813
|
commitCrash: typeof ctx.data.commitCrash === "string" ? ctx.data.commitCrash : void 0,
|
|
@@ -18388,6 +18390,11 @@ function computeFailureSuffix(input) {
|
|
|
18388
18390
|
}
|
|
18389
18391
|
function renderMessage(input) {
|
|
18390
18392
|
const suffix = computeFailureSuffix(input);
|
|
18393
|
+
if (input.isFailure && input.partialDelivery) {
|
|
18394
|
+
const destination = renderDeliveryDestination(input);
|
|
18395
|
+
const proof = input.partialDelivery.pushedSha ? ` (${input.partialDelivery.pushedSha.slice(0, 7)})` : "";
|
|
18396
|
+
return `\u26A0\uFE0F kody PARTIAL: pushed allowed changes to ${destination}${proof}; omitted protected files: ${input.partialDelivery.omittedFiles.join(", ")}`;
|
|
18397
|
+
}
|
|
18391
18398
|
if (input.isFailure) {
|
|
18392
18399
|
return `\u26A0\uFE0F kody FAILED: ${truncate2(input.failureReason, 1500)}${suffix}`;
|
|
18393
18400
|
}
|
|
@@ -18404,6 +18411,15 @@ function renderMessage(input) {
|
|
|
18404
18411
|
return `\u26A0\uFE0F kody finished but PR step did not run${suffix}`;
|
|
18405
18412
|
}
|
|
18406
18413
|
}
|
|
18414
|
+
function renderDeliveryDestination(input) {
|
|
18415
|
+
if (input.prResult?.kind === "created" || input.prResult?.kind === "updated") {
|
|
18416
|
+
return `PR ${input.prResult.url}`;
|
|
18417
|
+
}
|
|
18418
|
+
if (input.branch && input.githubOwner && input.githubRepo) {
|
|
18419
|
+
return `branch https://github.com/${input.githubOwner}/${input.githubRepo}/tree/${input.branch}`;
|
|
18420
|
+
}
|
|
18421
|
+
return "the pushed branch";
|
|
18422
|
+
}
|
|
18407
18423
|
function renderDeliveryProof(ctx) {
|
|
18408
18424
|
const quality = ctx.config.quality;
|
|
18409
18425
|
const gates = quality ? [
|
|
@@ -18420,7 +18436,7 @@ function renderDeliveryProof(ctx) {
|
|
|
18420
18436
|
Proof: ${verification}; ${delivery}.`;
|
|
18421
18437
|
}
|
|
18422
18438
|
function computeFailureReason2(ctx) {
|
|
18423
|
-
const omissions =
|
|
18439
|
+
const omissions = readDeliveryOmissions(ctx.data);
|
|
18424
18440
|
if (omissions.length > 0) {
|
|
18425
18441
|
return `delivery blocked protected files: ${omissions.join(", ")}`;
|
|
18426
18442
|
}
|
|
@@ -18433,6 +18449,9 @@ function computeFailureReason2(ctx) {
|
|
|
18433
18449
|
if (ctx.data.verifyOk === false) return ctx.data.verifyReason || "verify failed";
|
|
18434
18450
|
return "";
|
|
18435
18451
|
}
|
|
18452
|
+
function readDeliveryOmissions(data) {
|
|
18453
|
+
return Array.isArray(data.deliveryOmissions) ? data.deliveryOmissions.filter((file) => typeof file === "string") : [];
|
|
18454
|
+
}
|
|
18436
18455
|
function actionFailureReason2(action) {
|
|
18437
18456
|
if (!action || typeof action !== "object" || Array.isArray(action)) return "";
|
|
18438
18457
|
const payload = action.payload;
|
|
@@ -18537,6 +18556,8 @@ var init_postIssueComment = __esm({
|
|
|
18537
18556
|
}
|
|
18538
18557
|
const failureReason = computeFailureReason2(ctx);
|
|
18539
18558
|
const isFailure = failureReason.length > 0;
|
|
18559
|
+
const deliveryOmissions = readDeliveryOmissions(ctx.data);
|
|
18560
|
+
const isPartialDelivery = commitResult?.pushed === true && deliveryOmissions.length > 0;
|
|
18540
18561
|
const branch = ctx.data.branch;
|
|
18541
18562
|
const msg = renderMessage({
|
|
18542
18563
|
prResult,
|
|
@@ -18547,7 +18568,8 @@ var init_postIssueComment = __esm({
|
|
|
18547
18568
|
branchPushed: commitResult?.committed === true,
|
|
18548
18569
|
githubOwner: ctx.config.github?.owner,
|
|
18549
18570
|
githubRepo: ctx.config.github?.repo,
|
|
18550
|
-
deliveryProof: renderDeliveryProof(ctx)
|
|
18571
|
+
deliveryProof: renderDeliveryProof(ctx),
|
|
18572
|
+
partialDelivery: isPartialDelivery ? { omittedFiles: deliveryOmissions, pushedSha: commitResult.sha } : void 0
|
|
18551
18573
|
});
|
|
18552
18574
|
postWith(targetType, targetNumber, msg, ctx.cwd);
|
|
18553
18575
|
const prIsDraft = (prResult?.kind === "created" || prResult?.kind === "updated") && prResult.draft === true;
|
|
@@ -24415,20 +24437,17 @@ async function runCapabilityWorkflow(parent, workflow, capability, base, checkpo
|
|
|
24415
24437
|
await checkpoint?.(state);
|
|
24416
24438
|
return { exitCode: 64, reason: resumeBlocker, workflowState: state };
|
|
24417
24439
|
}
|
|
24418
|
-
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24422
|
-
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
});
|
|
24428
|
-
}
|
|
24429
|
-
return result;
|
|
24440
|
+
const result = isGraphWorkflow(workflow) ? await runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint) : await runLinearCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
|
|
24441
|
+
if (workflow.report && result.workflowState) {
|
|
24442
|
+
await publishWorkflowReport({
|
|
24443
|
+
config: base.config ?? loadConfig(base.cwd),
|
|
24444
|
+
publication: workflow.report,
|
|
24445
|
+
workflowId: capability.slug,
|
|
24446
|
+
workflowTitle: capability.title,
|
|
24447
|
+
state: result.workflowState
|
|
24448
|
+
});
|
|
24430
24449
|
}
|
|
24431
|
-
return
|
|
24450
|
+
return result;
|
|
24432
24451
|
}
|
|
24433
24452
|
async function runLinearCapabilityWorkflow(parent, workflow, capability, base, checkpoint) {
|
|
24434
24453
|
const state = initialWorkflowState(parent, workflow);
|
|
@@ -24840,7 +24859,7 @@ function withWorkflowBoundaryEval(capability, result) {
|
|
|
24840
24859
|
function workflowStepToJob(step, parent, chainData, cwd) {
|
|
24841
24860
|
const action = step.action ?? step.capability;
|
|
24842
24861
|
const targetNumber = workflowStepTargetNumber(step, parent, chainData);
|
|
24843
|
-
const mappedInputs = resolveWorkflowStepInputs(step, chainData);
|
|
24862
|
+
const mappedInputs = resolveWorkflowStepInputs(step, chainData, cwd);
|
|
24844
24863
|
const rawArgs = mappedInputs ? { ...mappedInputs } : { ...parent.cliArgs };
|
|
24845
24864
|
if (step.target === "pr") {
|
|
24846
24865
|
if (typeof targetNumber !== "number") {
|
|
@@ -24874,7 +24893,7 @@ function workflowStepToJob(step, parent, chainData, cwd) {
|
|
|
24874
24893
|
...parent.resultTarget ? { resultTarget: parent.resultTarget } : {}
|
|
24875
24894
|
};
|
|
24876
24895
|
}
|
|
24877
|
-
function resolveWorkflowStepInputs(step, chainData) {
|
|
24896
|
+
function resolveWorkflowStepInputs(step, chainData, cwd) {
|
|
24878
24897
|
if (!step.inputs) return void 0;
|
|
24879
24898
|
const source = {
|
|
24880
24899
|
workflow: {
|
|
@@ -24884,16 +24903,23 @@ function resolveWorkflowStepInputs(step, chainData) {
|
|
|
24884
24903
|
},
|
|
24885
24904
|
steps: chainData.workflowStepResults ?? {}
|
|
24886
24905
|
};
|
|
24906
|
+
const folder = resolveCapabilityFolder(step.capability, hydratedCapabilitiesRoot(cwd));
|
|
24907
|
+
const requiredInputs = folder ? capabilityRequiredInputNames(folder) : null;
|
|
24887
24908
|
const input = {};
|
|
24888
24909
|
for (const [name, binding] of Object.entries(step.inputs)) {
|
|
24889
24910
|
const value = resolveDottedPath2(source, binding.from);
|
|
24890
24911
|
if (value === void 0) {
|
|
24912
|
+
if (requiredInputs && !requiredInputs.has(name)) continue;
|
|
24891
24913
|
throw new InvalidJobError(`workflow step ${step.id ?? step.capability} needs missing input ${binding.from}`);
|
|
24892
24914
|
}
|
|
24893
24915
|
input[name] = value;
|
|
24894
24916
|
}
|
|
24895
24917
|
return input;
|
|
24896
24918
|
}
|
|
24919
|
+
function capabilityRequiredInputNames(folder) {
|
|
24920
|
+
const required2 = folder.config.inputSchema?.required;
|
|
24921
|
+
return new Set(Array.isArray(required2) ? required2.filter((name) => typeof name === "string") : []);
|
|
24922
|
+
}
|
|
24897
24923
|
function capabilityInputNames(folder) {
|
|
24898
24924
|
const properties = folder.config.inputSchema?.properties;
|
|
24899
24925
|
if (!properties || typeof properties !== "object" || Array.isArray(properties)) return /* @__PURE__ */ new Set();
|
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.629",
|
|
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": {
|