@agent_forge/forge 1.45.4 → 1.47.0
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/package.json +6 -6
- package/run.js +16 -1
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent_forge/forge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.0",
|
|
4
4
|
"description": "AI 开发质量门禁引擎 — 结构化门禁管道,在 AI 生成的代码进入仓库前进行质量锻造",
|
|
5
5
|
"bin": {
|
|
6
6
|
"forge": "run.js"
|
|
7
7
|
},
|
|
8
8
|
"optionalDependencies": {
|
|
9
|
-
"@agent_forge/forge-darwin-arm64": "1.
|
|
10
|
-
"@agent_forge/forge-darwin-x64": "1.
|
|
11
|
-
"@agent_forge/forge-linux-arm64": "1.
|
|
12
|
-
"@agent_forge/forge-linux-x64": "1.
|
|
13
|
-
"@agent_forge/forge-win32-x64": "1.
|
|
9
|
+
"@agent_forge/forge-darwin-arm64": "1.47.0",
|
|
10
|
+
"@agent_forge/forge-darwin-x64": "1.47.0",
|
|
11
|
+
"@agent_forge/forge-linux-arm64": "1.47.0",
|
|
12
|
+
"@agent_forge/forge-linux-x64": "1.47.0",
|
|
13
|
+
"@agent_forge/forge-win32-x64": "1.47.0"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"run.js",
|
package/run.js
CHANGED
|
@@ -36,6 +36,21 @@ const child = spawn(binaryPath, process.argv.slice(2), {
|
|
|
36
36
|
env: process.env,
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// spawn 失败走 error 事件而非 exit——无监听器会带栈迹非零崩溃,违反本包装器的
|
|
40
|
+
// fail-open 契约(宿主表现为 hook 异常而非 approve)。
|
|
41
|
+
child.on("error", (e) => {
|
|
42
|
+
console.error(`[forge] spawn failed: ${e.message}; failing open — hooks will not fire.`);
|
|
43
|
+
console.log('{"decision":"approve"}');
|
|
44
|
+
process.exit(0);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// exit 的 code 为 null 表示被信号杀死(OOM/SIGKILL)——不能折叠成成功语义;
|
|
48
|
+
// 按包装器 fail-open 契约显式 approve 并留 stderr 线索。
|
|
49
|
+
child.on("exit", (code, signal) => {
|
|
50
|
+
if (code === null) {
|
|
51
|
+
console.error(`[forge] forge exited on signal ${signal}; failing open — hooks will not fire.`);
|
|
52
|
+
console.log('{"decision":"approve"}');
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
40
55
|
process.exit(code || 0);
|
|
41
56
|
});
|