@kody-ade/kody-engine 0.4.556 → 0.4.557

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 +26 -2
  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.556",
18
+ version: "0.4.557",
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",
@@ -756,6 +756,22 @@ function createOutputContractPostWriteHook(contract) {
756
756
  };
757
757
  };
758
758
  }
759
+ function createOutputContractStopHook(contract) {
760
+ return async () => {
761
+ if (!fs3.existsSync(contract.path)) {
762
+ return {
763
+ decision: "block",
764
+ reason: "Continue the Journey from the current page and complete the next unresolved user outcome. Do not write the result merely because you paused; write it only after the Journey passes, fails, or cannot safely continue."
765
+ };
766
+ }
767
+ const error = outputContractError(contract);
768
+ if (!error) return {};
769
+ return {
770
+ decision: "block",
771
+ reason: correctionMessage(contract, error)
772
+ };
773
+ };
774
+ }
759
775
  var init_outputContractHooks = __esm({
760
776
  "src/outputContractHooks.ts"() {
761
777
  "use strict";
@@ -3907,6 +3923,7 @@ async function runAgent(opts) {
3907
3923
  const invokedSubagents = /* @__PURE__ */ new Set();
3908
3924
  const subagentInvocationHook = createSubagentInvocationHook(invokedSubagents);
3909
3925
  const outputContractPostWriteHook = opts.outputContract ? createOutputContractPostWriteHook(opts.outputContract) : null;
3926
+ const outputContractStopHook = opts.outputContract ? createOutputContractStopHook(opts.outputContract) : null;
3910
3927
  for (let attempt = 0; ; attempt++) {
3911
3928
  let ndjsonWriteFailed = false;
3912
3929
  let ndjsonWriteError;
@@ -3954,7 +3971,14 @@ async function runAgent(opts) {
3954
3971
  hooks: [outputContractPostWriteHook]
3955
3972
  }
3956
3973
  ] : []
3957
- ]
3974
+ ],
3975
+ ...outputContractStopHook ? {
3976
+ Stop: [
3977
+ {
3978
+ hooks: [outputContractStopHook]
3979
+ }
3980
+ ]
3981
+ } : {}
3958
3982
  }
3959
3983
  };
3960
3984
  const additionalDirectories = new Set(opts.additionalDirectories ?? []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.556",
3
+ "version": "0.4.557",
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",