@kody-ade/kody-engine 0.4.327 → 0.4.329

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 +16 -9
  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.327",
18
+ version: "0.4.329",
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",
@@ -6592,6 +6592,7 @@ function statusFromGoalEvent(event, decision) {
6592
6592
  if (status === "failure" || status === "failed" || eventName.includes("fail")) return "failed";
6593
6593
  if (status === "cancelled") return "cancelled";
6594
6594
  if (decisionKind === "blocked") return "blocked";
6595
+ if (status === "idle" || decisionKind === "idle" || eventName.includes(".idle")) return "waiting";
6595
6596
  if (status === "running" || status === "dispatch" || decisionKind === "dispatch" || eventName.includes("dispatch"))
6596
6597
  return "running";
6597
6598
  return "recorded";
@@ -8908,7 +8909,7 @@ function planTargetLoopSchedule(opts) {
8908
8909
  const preferred = opts.goal.preferredRunTime;
8909
8910
  if (preferred) {
8910
8911
  const gate = preferredRunTimeGate(preferred, now, opts.previousScheduleState, {
8911
- allowRepeatAfterCompletedTarget: opts.allowRepeatAfterCompletedTarget === true
8912
+ allowSameDayTargetDispatch: opts.allowSameDayTargetDispatch === true
8912
8913
  });
8913
8914
  if (!gate.ok) return targetLoopDecision("idle", gate.reason, at);
8914
8915
  }
@@ -9085,7 +9086,7 @@ function preferredRunTimeGate(preferred, now, previous, opts) {
9085
9086
  const lastDispatchAt = previous?.lastDecision.kind === "dispatch" ? previous.lastDecision.at : void 0;
9086
9087
  if (lastDispatchAt) {
9087
9088
  const last = zonedTimeParts(new Date(lastDispatchAt), preferred.timezone);
9088
- if (last?.date === current.date && opts?.allowRepeatAfterCompletedTarget !== true) {
9089
+ if (last?.date === current.date && opts?.allowSameDayTargetDispatch !== true) {
9089
9090
  return { ok: false, reason: `already dispatched today at preferred time ${preferred.time} ${preferred.timezone}` };
9090
9091
  }
9091
9092
  }
@@ -9377,12 +9378,12 @@ var init_advanceManagedGoal = __esm({
9377
9378
  const previousScheduleState = goal.raw.extra.scheduleState && typeof goal.raw.extra.scheduleState === "object" ? goal.raw.extra.scheduleState : void 0;
9378
9379
  const now = goalLoopNow();
9379
9380
  const activeTarget = isGoalTargetLoop(managed) ? resolveActiveGoalLoopTarget(ctx.config, ctx.cwd, goal.id, managed) : null;
9380
- const allowRepeatAfterCompletedTarget = isGoalTargetLoop(managed) && !activeTarget && previousDispatchWasTargetInstance(managed, previousScheduleState);
9381
+ const allowSameDayTargetDispatch = isGoalTargetLoop(managed) && (!!activeTarget || previousDispatchWasTargetInstance(managed, previousScheduleState));
9381
9382
  let decision2 = planTargetLoopSchedule({
9382
9383
  goal: managed,
9383
9384
  previousScheduleState,
9384
9385
  now,
9385
- allowRepeatAfterCompletedTarget
9386
+ allowSameDayTargetDispatch
9386
9387
  });
9387
9388
  let targetResolution;
9388
9389
  if (decision2.kind === "dispatch" && decision2.dispatch && isGoalTargetLoop(managed)) {
@@ -9392,7 +9393,7 @@ var init_advanceManagedGoal = __esm({
9392
9393
  previousScheduleState,
9393
9394
  now,
9394
9395
  resolvedGoalTargetId: targetResolution.targetId,
9395
- allowRepeatAfterCompletedTarget
9396
+ allowSameDayTargetDispatch
9396
9397
  });
9397
9398
  }
9398
9399
  restoreGoalIdFact();
@@ -19817,6 +19818,12 @@ function lastIndexOfScript(entries, names) {
19817
19818
  }
19818
19819
  async function runExecutableChain(profileName, input) {
19819
19820
  let result = await runExecutable(profileName, input);
19821
+ let chainConfig = input.config;
19822
+ const configForHandoff = () => {
19823
+ if (chainConfig || input.skipConfig) return chainConfig;
19824
+ chainConfig = loadConfig(input.cwd);
19825
+ return chainConfig;
19826
+ };
19820
19827
  let chainData = {
19821
19828
  ...input.preloadedData ?? {},
19822
19829
  ...result.taskState ? { taskState: result.taskState } : {}
@@ -19832,7 +19839,7 @@ async function runExecutableChain(profileName, input) {
19832
19839
  const { runJob: runJob3 } = await Promise.resolve().then(() => (init_job(), job_exports));
19833
19840
  const childResult = await runJob3(next2, {
19834
19841
  cwd: input.cwd,
19835
- config: input.config,
19842
+ config: configForHandoff(),
19836
19843
  verbose: input.verbose,
19837
19844
  quiet: input.quiet,
19838
19845
  preloadedData: chainData
@@ -19857,7 +19864,7 @@ async function runExecutableChain(profileName, input) {
19857
19864
  const { runJob: runJob4 } = await Promise.resolve().then(() => (init_job(), job_exports));
19858
19865
  result = await runJob4(afterJob, {
19859
19866
  cwd: input.cwd,
19860
- config: input.config,
19867
+ config: configForHandoff(),
19861
19868
  verbose: input.verbose,
19862
19869
  quiet: input.quiet,
19863
19870
  preloadedData: chainData
@@ -19891,7 +19898,7 @@ async function runExecutableChain(profileName, input) {
19891
19898
  const { runJob: runJob2 } = await Promise.resolve().then(() => (init_job(), job_exports));
19892
19899
  result = await runJob2(nextJob, {
19893
19900
  cwd: input.cwd,
19894
- config: input.config,
19901
+ config: configForHandoff(),
19895
19902
  verbose: input.verbose,
19896
19903
  quiet: input.quiet,
19897
19904
  preloadedData: chainData
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.327",
3
+ "version": "0.4.329",
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",