@andyqiu/codeforge 0.6.6 → 0.6.7
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/index.js +32 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19889,7 +19889,7 @@ import * as zlib from "node:zlib";
|
|
|
19889
19889
|
// lib/version-injected.ts
|
|
19890
19890
|
function getInjectedVersion() {
|
|
19891
19891
|
try {
|
|
19892
|
-
const v = "0.6.
|
|
19892
|
+
const v = "0.6.7";
|
|
19893
19893
|
if (typeof v === "string" && /^\d+\.\d+\.\d+/.test(v)) {
|
|
19894
19894
|
return v;
|
|
19895
19895
|
}
|
|
@@ -21345,8 +21345,7 @@ function formatLazyBindDenyReason(input) {
|
|
|
21345
21345
|
var CLASS_B_CALLER_WHITELIST = new Set([
|
|
21346
21346
|
"codeforge",
|
|
21347
21347
|
"reviewer",
|
|
21348
|
-
"reviewer-lite"
|
|
21349
|
-
"general"
|
|
21348
|
+
"reviewer-lite"
|
|
21350
21349
|
]);
|
|
21351
21350
|
var MERGE_CALLER_WHITELIST = new Set([
|
|
21352
21351
|
"codeforge",
|
|
@@ -21558,10 +21557,38 @@ var sessionWorktreeGuardPlugin = async (ctx) => {
|
|
|
21558
21557
|
try {
|
|
21559
21558
|
entry = await getSessionWorktree(sessionId, mainRoot);
|
|
21560
21559
|
} catch (err) {
|
|
21561
|
-
|
|
21560
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
21561
|
+
if (isWriteOperation(toolName, argsObj, mainRoot)) {
|
|
21562
|
+
log13.warn(`[registry-fail-closed] DENY (getSessionWorktree failed)`, {
|
|
21563
|
+
sessionId,
|
|
21564
|
+
mainRoot,
|
|
21565
|
+
tool: toolName,
|
|
21566
|
+
error: errMsg
|
|
21567
|
+
});
|
|
21568
|
+
safeWriteLog(PLUGIN_NAME22, {
|
|
21569
|
+
hook: "tool.execute.before",
|
|
21570
|
+
tool: toolName,
|
|
21571
|
+
sessionID: input.sessionID,
|
|
21572
|
+
action: "deny",
|
|
21573
|
+
source: "registry-query-failed",
|
|
21574
|
+
error: errMsg
|
|
21575
|
+
});
|
|
21576
|
+
denied = new DeniedError(`[session-worktree-guard] DENIED: session ${sessionId} 的 worktree 绑定信息查询失败` + `(${errMsg}),为防止写操作污染主工作区已拒绝执行。请重试;持续失败请检查 registry ` + `文件或设 CODEFORGE_DISABLE_WORKTREE_GUARD=1 显式放弃隔离`);
|
|
21577
|
+
return;
|
|
21578
|
+
}
|
|
21579
|
+
log13.warn(`getSessionWorktree failed (只读放行)`, {
|
|
21562
21580
|
sessionId,
|
|
21563
21581
|
mainRoot,
|
|
21564
|
-
|
|
21582
|
+
tool: toolName,
|
|
21583
|
+
error: errMsg
|
|
21584
|
+
});
|
|
21585
|
+
safeWriteLog(PLUGIN_NAME22, {
|
|
21586
|
+
hook: "tool.execute.before",
|
|
21587
|
+
tool: toolName,
|
|
21588
|
+
sessionID: input.sessionID,
|
|
21589
|
+
action: "skip",
|
|
21590
|
+
source: "registry-query-failed-readonly",
|
|
21591
|
+
is_write: false
|
|
21565
21592
|
});
|
|
21566
21593
|
return;
|
|
21567
21594
|
}
|