@lyupro/codex-bridge 0.5.2 → 0.5.3

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.
@@ -46,6 +46,14 @@ export const STOP_TOOLS = Object.freeze(['TaskStop']);
46
46
  /** A PreToolUse matcher is a regular expression over tool names, so the list remains authoritative. */
47
47
  export const STOP_TOOL_MATCHER = STOP_TOOLS.join('|');
48
48
 
49
+ /**
50
+ * The lock listens to file tools and shells through one registration, not two. A second definition
51
+ * naming the same file lands twice in the installation record, and that record forbids duplicate
52
+ * files — 33 tests failed on it the day the shell side was added. One hook, one entry, one matcher
53
+ * wide enough for both.
54
+ */
55
+ export const LOCKED_TOOL_MATCHER = [...WRITE_TOOLS, ...SHELL_TOOLS].join('|');
56
+
49
57
  /**
50
58
  * Stable CLI names live beside each event and file because the Plan_19 drift incident left
51
59
  * registration, diagnostics, and the guard itself carrying different hook identities. The
@@ -54,7 +62,8 @@ export const STOP_TOOL_MATCHER = STOP_TOOLS.join('|');
54
62
  export const HOOK_DEFINITIONS = Object.freeze([
55
63
  Object.freeze({ name: 'reply-guard', event: 'SubagentStop', matcher: '*', file: 'reply-guard.mjs' }),
56
64
  Object.freeze({ name: 'order-gate', event: 'PreToolUse', matcher: SUBAGENT_TOOL_MATCHER, file: 'order-gate.mjs' }),
57
- Object.freeze({ name: 'worktree-lock', event: 'PreToolUse', matcher: WRITE_TOOL_MATCHER, file: 'worktree-lock.mjs' }),
65
+ Object.freeze({ name: 'worktree-lock', event: 'PreToolUse', matcher: LOCKED_TOOL_MATCHER, file: 'worktree-lock.mjs' }),
58
66
  Object.freeze({ name: 'prune-guard', event: 'PreToolUse', matcher: SHELL_TOOL_MATCHER, file: 'prune-guard.mjs' }),
67
+ Object.freeze({ name: 'worktree-witness', event: 'PostToolUse', matcher: SHELL_TOOL_MATCHER, file: 'worktree-witness.mjs' }),
59
68
  Object.freeze({ name: 'stop-guard', event: 'PreToolUse', matcher: STOP_TOOL_MATCHER, file: 'stop-guard.mjs' }),
60
69
  ]);