@kody-ade/kody-engine 0.4.230 → 0.4.231
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 +36 -12
- 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.231",
|
|
19
19
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
20
20
|
license: "MIT",
|
|
21
21
|
type: "module",
|
|
@@ -9948,11 +9948,35 @@ var init_loadDutyState = __esm({
|
|
|
9948
9948
|
});
|
|
9949
9949
|
|
|
9950
9950
|
// src/scripts/loadGoalState.ts
|
|
9951
|
-
|
|
9951
|
+
function retryDelaysMs() {
|
|
9952
|
+
const raw = process.env.KODY_GOAL_STATE_RETRY_DELAYS_MS?.trim();
|
|
9953
|
+
if (!raw) return DEFAULT_RETRY_DELAYS_MS;
|
|
9954
|
+
return raw.split(",").map((part) => Number(part.trim())).filter((value) => Number.isFinite(value) && value >= 0);
|
|
9955
|
+
}
|
|
9956
|
+
function sleep(ms) {
|
|
9957
|
+
if (ms <= 0) return Promise.resolve();
|
|
9958
|
+
return new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
9959
|
+
}
|
|
9960
|
+
async function fetchGoalStateWithRetry(owner, repo, goalId, cwd) {
|
|
9961
|
+
let state = fetchGoalState(owner, repo, goalId, cwd);
|
|
9962
|
+
if (state) return state;
|
|
9963
|
+
for (const delay of retryDelaysMs()) {
|
|
9964
|
+
await sleep(delay);
|
|
9965
|
+
state = fetchGoalState(owner, repo, goalId, cwd);
|
|
9966
|
+
if (state) {
|
|
9967
|
+
process.stdout.write(`[goal-manager] loaded goal state for ${goalId} after retry
|
|
9968
|
+
`);
|
|
9969
|
+
return state;
|
|
9970
|
+
}
|
|
9971
|
+
}
|
|
9972
|
+
return null;
|
|
9973
|
+
}
|
|
9974
|
+
var DEFAULT_RETRY_DELAYS_MS, loadGoalState;
|
|
9952
9975
|
var init_loadGoalState = __esm({
|
|
9953
9976
|
"src/scripts/loadGoalState.ts"() {
|
|
9954
9977
|
"use strict";
|
|
9955
9978
|
init_stateStore();
|
|
9979
|
+
DEFAULT_RETRY_DELAYS_MS = [250, 750, 1500, 2500];
|
|
9956
9980
|
loadGoalState = async (ctx) => {
|
|
9957
9981
|
const goalId = ctx.args.goal;
|
|
9958
9982
|
if (typeof goalId !== "string" || goalId.length === 0) {
|
|
@@ -9976,7 +10000,7 @@ var init_loadGoalState = __esm({
|
|
|
9976
10000
|
return;
|
|
9977
10001
|
}
|
|
9978
10002
|
try {
|
|
9979
|
-
const state =
|
|
10003
|
+
const state = await fetchGoalStateWithRetry(owner, repo, goalId, ctx.cwd);
|
|
9980
10004
|
if (!state) {
|
|
9981
10005
|
process.stdout.write(`[goal-manager] no goal state for ${goalId} on ${owner}/${repo}; nothing to tick
|
|
9982
10006
|
`);
|
|
@@ -13559,7 +13583,7 @@ function tryPostPr7(prNumber, body, cwd) {
|
|
|
13559
13583
|
} catch {
|
|
13560
13584
|
}
|
|
13561
13585
|
}
|
|
13562
|
-
function
|
|
13586
|
+
function sleep2(ms) {
|
|
13563
13587
|
return new Promise((res) => setTimeout(res, ms));
|
|
13564
13588
|
}
|
|
13565
13589
|
var API_TIMEOUT_MS8, waitForCi;
|
|
@@ -13581,17 +13605,17 @@ var init_waitForCi = __esm({
|
|
|
13581
13605
|
return;
|
|
13582
13606
|
}
|
|
13583
13607
|
const fixCiAttempts = state?.core.attempts?.["fix-ci"] ?? 0;
|
|
13584
|
-
await
|
|
13608
|
+
await sleep2(initialWaitSeconds * 1e3);
|
|
13585
13609
|
const deadline = Date.now() + timeoutMinutes * 6e4;
|
|
13586
13610
|
let lastSummary = "";
|
|
13587
13611
|
while (Date.now() < deadline) {
|
|
13588
13612
|
const rows = fetchChecks(prNumber, ctx.cwd);
|
|
13589
13613
|
if (rows === null) {
|
|
13590
|
-
await
|
|
13614
|
+
await sleep2(pollSeconds * 1e3);
|
|
13591
13615
|
continue;
|
|
13592
13616
|
}
|
|
13593
13617
|
if (rows.length === 0) {
|
|
13594
|
-
await
|
|
13618
|
+
await sleep2(pollSeconds * 1e3);
|
|
13595
13619
|
continue;
|
|
13596
13620
|
}
|
|
13597
13621
|
const summary = summarize(rows);
|
|
@@ -13634,7 +13658,7 @@ var init_waitForCi = __esm({
|
|
|
13634
13658
|
tryPostPr7(prNumber, `\u2705 kody waitForCi: all ${rows.length} checks green on PR #${prNumber}`, ctx.cwd);
|
|
13635
13659
|
return;
|
|
13636
13660
|
}
|
|
13637
|
-
await
|
|
13661
|
+
await sleep2(pollSeconds * 1e3);
|
|
13638
13662
|
}
|
|
13639
13663
|
ctx.data.action = mkAction("CI_TIMEOUT", {
|
|
13640
13664
|
reason: `CI did not complete within ${timeoutMinutes} minutes`,
|
|
@@ -17837,10 +17861,10 @@ async function waitForNextUserMessage(opts) {
|
|
|
17837
17861
|
const remainingIdle = opts.idleTimeoutMs - (Date.now() - idleStart);
|
|
17838
17862
|
const sleepMs2 = Math.max(0, Math.min(pollMs, remainingDeadline, remainingIdle));
|
|
17839
17863
|
if (sleepMs2 === 0) continue;
|
|
17840
|
-
await
|
|
17864
|
+
await sleep3(sleepMs2);
|
|
17841
17865
|
}
|
|
17842
17866
|
}
|
|
17843
|
-
function
|
|
17867
|
+
function sleep3(ms) {
|
|
17844
17868
|
return new Promise((resolve7) => setTimeout(resolve7, ms));
|
|
17845
17869
|
}
|
|
17846
17870
|
function currentBranch(cwd) {
|
|
@@ -18455,7 +18479,7 @@ var FlyClient = class {
|
|
|
18455
18479
|
if (res.ok) return true;
|
|
18456
18480
|
} catch {
|
|
18457
18481
|
}
|
|
18458
|
-
await
|
|
18482
|
+
await sleep4(intervalMs);
|
|
18459
18483
|
}
|
|
18460
18484
|
return false;
|
|
18461
18485
|
}
|
|
@@ -18463,7 +18487,7 @@ var FlyClient = class {
|
|
|
18463
18487
|
function enc(s) {
|
|
18464
18488
|
return encodeURIComponent(s);
|
|
18465
18489
|
}
|
|
18466
|
-
function
|
|
18490
|
+
function sleep4(ms) {
|
|
18467
18491
|
return new Promise((r) => setTimeout(r, ms));
|
|
18468
18492
|
}
|
|
18469
18493
|
|
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.231",
|
|
4
4
|
"description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|