@kody-ade/kody-engine 0.4.447 → 0.4.448

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.
Files changed (2) hide show
  1. package/dist/bin/kody.js +17 -5
  2. 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.447",
18
+ version: "0.4.448",
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,25 @@ 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 due = listLoopDefinitions(ctx.cwd).filter((loop) => dueSlot(loop, now) !== null);
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
+ );
13981
13987
  const backend = createStateBackendFromEnv();
13982
13988
  const results = [];
13983
13989
  for (const loop of due) {
13984
- const slot = dueSlot(loop, now);
13990
+ const slot = loopDispatchSlot(loop, now, force, randomUUID2());
13985
13991
  if (!slot) continue;
13986
13992
  const reservationId = `reservation-${randomUUID2()}`;
13987
13993
  const idempotencyKey = `${loop.id}:${slot}`;
13988
13994
  const claimed = await backend.reserveAgencyDispatch(tenantId2, {
13989
13995
  idempotencyKey,
13990
13996
  loopId: loop.id,
13991
- decision: { kind: "fire", reason: "local Loop schedule is due", scheduledAt: slot },
13997
+ decision: {
13998
+ kind: "fire",
13999
+ reason: force ? "manual Loop run requested" : "local Loop schedule is due",
14000
+ scheduledAt: slot
14001
+ },
13992
14002
  leaseUntil: new Date(now.getTime() + 6 * 60 * 60 * 1e3).toISOString(),
13993
14003
  reservationId,
13994
14004
  correlationId: `corr-${randomUUID2()}`,
@@ -22973,6 +22983,7 @@ function mintScheduledJob(input) {
22973
22983
  agent: input.agent,
22974
22984
  cliArgs: input.cliArgs ?? {},
22975
22985
  flavor: "scheduled",
22986
+ force: input.force === true,
22976
22987
  saveReport: input.saveReport === true
22977
22988
  };
22978
22989
  }
@@ -25647,7 +25658,8 @@ async function runScheduledFanOut(cwd, args, opts) {
25647
25658
  action: match.action,
25648
25659
  capability: match.capability,
25649
25660
  implementation: match.implementation,
25650
- cliArgs: match.cliArgs
25661
+ cliArgs: match.cliArgs,
25662
+ force: opts.force
25651
25663
  }),
25652
25664
  {
25653
25665
  cwd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.447",
3
+ "version": "0.4.448",
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",