@kody-ade/kody-engine 0.4.417 → 0.4.419
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 +42 -1
- package/package.json +1 -1
- package/templates/kody.yml +8 -0
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.419",
|
|
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",
|
|
@@ -13392,6 +13392,7 @@ async function dispatchAgencyLoopsWith(input) {
|
|
|
13392
13392
|
let succeeded = false;
|
|
13393
13393
|
let reason = "target failed";
|
|
13394
13394
|
let finalRunId;
|
|
13395
|
+
let finalCapabilityResults = [];
|
|
13395
13396
|
const budgetDeadline = Date.now() + budget.maxDurationSeconds * 1e3;
|
|
13396
13397
|
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
|
13397
13398
|
const remainingMilliseconds = budgetDeadline - Date.now();
|
|
@@ -13429,6 +13430,7 @@ async function dispatchAgencyLoopsWith(input) {
|
|
|
13429
13430
|
costUsd += attemptResult.usage?.costUsd ?? 0;
|
|
13430
13431
|
const finishedAt2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
13431
13432
|
succeeded = attemptResult.exitCode === 0;
|
|
13433
|
+
finalCapabilityResults = attemptResult.capabilityResults ?? [];
|
|
13432
13434
|
reason = attemptResult.reason ?? (succeeded ? "target dispatched" : "target failed");
|
|
13433
13435
|
const usage = {
|
|
13434
13436
|
tokens: attemptResult.usage?.tokens ?? 0,
|
|
@@ -13454,6 +13456,19 @@ async function dispatchAgencyLoopsWith(input) {
|
|
|
13454
13456
|
await wait(backoffMilliseconds);
|
|
13455
13457
|
}
|
|
13456
13458
|
const finishedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
13459
|
+
const goalRecord = record2.definition.targetRef.kind === "goal" ? records.find(
|
|
13460
|
+
(candidate) => "executionRef" in candidate.definition && candidate.definition.id === record2.definition.targetRef.id
|
|
13461
|
+
) : void 0;
|
|
13462
|
+
if (succeeded && goalRecord && finalRunId) {
|
|
13463
|
+
await appendCapabilityOutputs(
|
|
13464
|
+
repository,
|
|
13465
|
+
finalRunId,
|
|
13466
|
+
target.reference,
|
|
13467
|
+
finalCapabilityResults,
|
|
13468
|
+
finishedAt
|
|
13469
|
+
);
|
|
13470
|
+
await repository.refreshGoalProgress(goalRecord, finishedAt);
|
|
13471
|
+
}
|
|
13457
13472
|
await input.backend.finishAgencyDispatch(
|
|
13458
13473
|
input.tenantId,
|
|
13459
13474
|
decision.idempotencyKey,
|
|
@@ -13529,6 +13544,32 @@ async function runAttempt(run, job, timeoutSeconds) {
|
|
|
13529
13544
|
if (timer) clearTimeout(timer);
|
|
13530
13545
|
}
|
|
13531
13546
|
}
|
|
13547
|
+
async function appendCapabilityOutputs(repository, runId, producer, results, createdAt) {
|
|
13548
|
+
for (const result of results) {
|
|
13549
|
+
const outputs = [
|
|
13550
|
+
...Object.entries(result.facts).map(([key, value]) => ({ kind: "fact", key, value })),
|
|
13551
|
+
...Object.entries(result.evidence ?? {}).map(([key, value]) => ({
|
|
13552
|
+
kind: "evidence",
|
|
13553
|
+
key,
|
|
13554
|
+
value
|
|
13555
|
+
})),
|
|
13556
|
+
...result.artifacts.map((artifact, index) => ({
|
|
13557
|
+
kind: "artifact",
|
|
13558
|
+
key: artifact.label || `artifact-${index + 1}`,
|
|
13559
|
+
value: artifact
|
|
13560
|
+
}))
|
|
13561
|
+
];
|
|
13562
|
+
for (const output of outputs) {
|
|
13563
|
+
await repository.appendOutput(`output-${randomUUID()}`, {
|
|
13564
|
+
...output,
|
|
13565
|
+
runId,
|
|
13566
|
+
producer: { kind: producer.kind, id: producer.id },
|
|
13567
|
+
contract: "capability-result/v1",
|
|
13568
|
+
createdAt
|
|
13569
|
+
});
|
|
13570
|
+
}
|
|
13571
|
+
}
|
|
13572
|
+
}
|
|
13532
13573
|
function formatSeconds(seconds) {
|
|
13533
13574
|
return Number.isInteger(seconds) ? String(seconds) : seconds.toFixed(3).replace(/0+$/, "").replace(/\.$/, "");
|
|
13534
13575
|
}
|
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.419",
|
|
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",
|
package/templates/kody.yml
CHANGED
|
@@ -79,6 +79,14 @@ jobs:
|
|
|
79
79
|
cache: pip
|
|
80
80
|
cache-dependency-path: .kody-pip-requirements.txt
|
|
81
81
|
|
|
82
|
+
- name: Hydrate Kody Store definitions
|
|
83
|
+
uses: actions/checkout@v4
|
|
84
|
+
with:
|
|
85
|
+
repository: ${{ vars.KODY_STORE_REPOSITORY || 'aharonyaircohen/kody-company-store' }}
|
|
86
|
+
ref: ${{ vars.KODY_STORE_REF || 'main' }}
|
|
87
|
+
path: .kody-engine/definitions
|
|
88
|
+
token: ${{ secrets.GH_PAT || secrets.KODY_TOKEN || github.token }}
|
|
89
|
+
|
|
82
90
|
- env:
|
|
83
91
|
ALL_SECRETS: ${{ toJSON(secrets) }}
|
|
84
92
|
SESSION_ID: ${{ inputs.sessionId }}
|