@kody-ade/kody-engine 0.4.355 → 0.4.356

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 +14 -3
  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.355",
18
+ version: "0.4.356",
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",
@@ -9367,7 +9367,7 @@ function scalarFacts(facts) {
9367
9367
  )
9368
9368
  );
9369
9369
  }
9370
- function autonomyBlockReason(ctx, goalId, goal, goalState, dispatch2) {
9370
+ function autonomyBlockReason(ctx, goalId, goal, goalState, dispatch2, options = {}) {
9371
9371
  if (ctx.data.jobForce === true) return null;
9372
9372
  const selfMode = firstTrustOverride(ctx, subjectCandidates(managedModelSubjectKind(goal), goalId, goalState));
9373
9373
  if (selfMode === "ask" || selfMode !== "auto" && goal.runWithoutApproval !== true) {
@@ -9381,7 +9381,7 @@ function autonomyBlockReason(ctx, goalId, goal, goalState, dispatch2) {
9381
9381
  }
9382
9382
  }
9383
9383
  const targetGoal = dispatch2.action === "goal-manager" && typeof dispatch2.cliArgs.goal === "string" ? dispatch2.cliArgs.goal : null;
9384
- if (targetGoal && targetGoal !== goalId) {
9384
+ if (targetGoal && targetGoal !== goalId && options.checkTargets !== false) {
9385
9385
  const target = fetchGoalState(ctx.config, targetGoal, ctx.cwd);
9386
9386
  const targetManaged = target ? managedGoalFromState(expandManagedGoalState(target)) : null;
9387
9387
  const targetMode = targetManaged ? firstTrustOverride(ctx, subjectCandidates(managedModelSubjectKind(targetManaged), targetGoal, target)) : null;
@@ -9727,6 +9727,17 @@ var init_advanceManagedGoal = __esm({
9727
9727
  allowSameDayTargetDispatch
9728
9728
  });
9729
9729
  let targetResolution;
9730
+ const selfAutonomyBlock = decision2.kind === "dispatch" && decision2.dispatch ? autonomyBlockReason(ctx, goal.id, managed, goal.raw, decision2.dispatch, { checkTargets: false }) : null;
9731
+ if (selfAutonomyBlock) {
9732
+ restoreGoalIdFact();
9733
+ goal.raw = writeManagedGoalToState({ ...goal.raw, state: goal.state }, managed);
9734
+ const waitDecision = scheduleWaitDecision(previousScheduleState, decision2, selfAutonomyBlock);
9735
+ goal.raw.extra.scheduleState = waitDecision.scheduleState;
9736
+ ctx.data.managedGoalDecision = waitDecision;
9737
+ stageAutonomyBlocked(ctx.data, goal.id, managed, goal.state, waitDecision, previousScheduleState);
9738
+ ctx.output.reason = selfAutonomyBlock;
9739
+ return;
9740
+ }
9730
9741
  if (decision2.kind === "dispatch" && decision2.dispatch && isGoalTargetLoop(managed)) {
9731
9742
  targetResolution = resolveGoalLoopTarget(ctx.config, ctx.cwd, goal.id, managed, now);
9732
9743
  decision2 = planTargetLoopSchedule({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.355",
3
+ "version": "0.4.356",
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",