@kody-ade/kody-engine 0.4.447 → 0.4.449
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 +27 -5
- 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.449",
|
|
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",
|
|
@@ -13924,6 +13924,9 @@ var init_loopDefinitions = __esm({
|
|
|
13924
13924
|
|
|
13925
13925
|
// src/scripts/dispatchSimpleLoops.ts
|
|
13926
13926
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
13927
|
+
function loopDispatchSlot(loop, now, force, nonce) {
|
|
13928
|
+
return force ? `manual:${now.toISOString()}:${nonce}` : dueSlot(loop, now);
|
|
13929
|
+
}
|
|
13927
13930
|
function dueSlot(loop, now) {
|
|
13928
13931
|
if (!loop.enabled || loop.trigger.type !== "schedule") return null;
|
|
13929
13932
|
const match = /^(\d+)([mhd])$/.exec(loop.trigger.every);
|
|
@@ -13977,18 +13980,29 @@ var init_dispatchSimpleLoops = __esm({
|
|
|
13977
13980
|
const tenantId2 = repositoryTenant2(ctx.config);
|
|
13978
13981
|
if (!tenantId2) throw new Error("Repository identity is required for Loop dispatch");
|
|
13979
13982
|
const now = /* @__PURE__ */ new Date();
|
|
13980
|
-
const
|
|
13983
|
+
const force = ctx.data.jobForce === true;
|
|
13984
|
+
const due = listLoopDefinitions(ctx.cwd).filter(
|
|
13985
|
+
(loop) => loop.enabled && loop.trigger.type === "schedule" && (force || dueSlot(loop, now) !== null)
|
|
13986
|
+
);
|
|
13987
|
+
process.stdout.write(
|
|
13988
|
+
`\u2192 kody: Loop scheduler found ${due.length} runnable Loop(s)${force ? " (manual)" : ""}
|
|
13989
|
+
`
|
|
13990
|
+
);
|
|
13981
13991
|
const backend = createStateBackendFromEnv();
|
|
13982
13992
|
const results = [];
|
|
13983
13993
|
for (const loop of due) {
|
|
13984
|
-
const slot =
|
|
13994
|
+
const slot = loopDispatchSlot(loop, now, force, randomUUID2());
|
|
13985
13995
|
if (!slot) continue;
|
|
13986
13996
|
const reservationId = `reservation-${randomUUID2()}`;
|
|
13987
13997
|
const idempotencyKey = `${loop.id}:${slot}`;
|
|
13988
13998
|
const claimed = await backend.reserveAgencyDispatch(tenantId2, {
|
|
13989
13999
|
idempotencyKey,
|
|
13990
14000
|
loopId: loop.id,
|
|
13991
|
-
decision: {
|
|
14001
|
+
decision: {
|
|
14002
|
+
kind: "fire",
|
|
14003
|
+
reason: force ? "manual Loop run requested" : "local Loop schedule is due",
|
|
14004
|
+
scheduledAt: slot
|
|
14005
|
+
},
|
|
13992
14006
|
leaseUntil: new Date(now.getTime() + 6 * 60 * 60 * 1e3).toISOString(),
|
|
13993
14007
|
reservationId,
|
|
13994
14008
|
correlationId: `corr-${randomUUID2()}`,
|
|
@@ -14017,6 +14031,12 @@ var init_dispatchSimpleLoops = __esm({
|
|
|
14017
14031
|
await backend.finishAgencyDispatch(tenantId2, idempotencyKey, reservationId, status, (/* @__PURE__ */ new Date()).toISOString());
|
|
14018
14032
|
results.push({ loopId: loop.id, status, reason: result.reason ?? status });
|
|
14019
14033
|
}
|
|
14034
|
+
for (const result of results) {
|
|
14035
|
+
process.stdout.write(
|
|
14036
|
+
`\u2192 kody: Loop ${result.loopId} ${result.status}: ${result.reason}
|
|
14037
|
+
`
|
|
14038
|
+
);
|
|
14039
|
+
}
|
|
14020
14040
|
ctx.data.simpleLoopDispatchResults = results;
|
|
14021
14041
|
};
|
|
14022
14042
|
}
|
|
@@ -22973,6 +22993,7 @@ function mintScheduledJob(input) {
|
|
|
22973
22993
|
agent: input.agent,
|
|
22974
22994
|
cliArgs: input.cliArgs ?? {},
|
|
22975
22995
|
flavor: "scheduled",
|
|
22996
|
+
force: input.force === true,
|
|
22976
22997
|
saveReport: input.saveReport === true
|
|
22977
22998
|
};
|
|
22978
22999
|
}
|
|
@@ -25647,7 +25668,8 @@ async function runScheduledFanOut(cwd, args, opts) {
|
|
|
25647
25668
|
action: match.action,
|
|
25648
25669
|
capability: match.capability,
|
|
25649
25670
|
implementation: match.implementation,
|
|
25650
|
-
cliArgs: match.cliArgs
|
|
25671
|
+
cliArgs: match.cliArgs,
|
|
25672
|
+
force: opts.force
|
|
25651
25673
|
}),
|
|
25652
25674
|
{
|
|
25653
25675
|
cwd,
|
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.449",
|
|
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",
|