@kody-ade/kody-engine 0.4.598 → 0.4.599
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 +24 -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.
|
|
18
|
+
version: "0.4.599",
|
|
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",
|
|
@@ -861,8 +861,30 @@ function createOutputContractPostWriteHook(contract) {
|
|
|
861
861
|
};
|
|
862
862
|
}
|
|
863
863
|
function createOutputContractStopHook(contract) {
|
|
864
|
-
return async () => {
|
|
864
|
+
return async (input = {}) => {
|
|
865
865
|
if (!fs4.existsSync(contract.path)) {
|
|
866
|
+
const message = input.last_assistant_message;
|
|
867
|
+
if (typeof message === "string" && message.trim()) {
|
|
868
|
+
let value;
|
|
869
|
+
try {
|
|
870
|
+
value = JSON.parse(message);
|
|
871
|
+
} catch {
|
|
872
|
+
value = void 0;
|
|
873
|
+
}
|
|
874
|
+
if (value !== void 0) {
|
|
875
|
+
try {
|
|
876
|
+
validateCapabilityContractOutput(contract.schema, value);
|
|
877
|
+
fs4.mkdirSync(path5.dirname(contract.path), { recursive: true });
|
|
878
|
+
fs4.writeFileSync(contract.path, JSON.stringify(value), { mode: 384 });
|
|
879
|
+
return {};
|
|
880
|
+
} catch (error2) {
|
|
881
|
+
return {
|
|
882
|
+
decision: "block",
|
|
883
|
+
reason: `The final JSON response does not match its required contract: ${error2 instanceof Error ? error2.message : String(error2)}. Return one corrected JSON value and finish.`
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
}
|
|
866
888
|
return {
|
|
867
889
|
decision: "block",
|
|
868
890
|
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."
|
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.599",
|
|
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",
|