portable-agent-layer 0.43.0 → 0.43.1
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 +1 -1
- package/src/hooks/lib/agent.ts +6 -2
package/package.json
CHANGED
package/src/hooks/lib/agent.ts
CHANGED
|
@@ -42,7 +42,7 @@ export const isOpencode = () => getActiveAgent() === "opencode";
|
|
|
42
42
|
* Format a "block this action" response for the current agent.
|
|
43
43
|
* Claude Code: { decision: "block", reason }
|
|
44
44
|
* Cursor preToolUse: { permission: "deny", user_message }
|
|
45
|
-
* Codex PreToolUse: { hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny" } }
|
|
45
|
+
* Codex PreToolUse: { hookSpecificOutput: { hookEventName: "PreToolUse", permissionDecision: "deny", permissionDecisionReason: reason } }
|
|
46
46
|
*/
|
|
47
47
|
export function blockResponse(reason: string, hookEventName?: string): string {
|
|
48
48
|
if (isCursor()) {
|
|
@@ -50,7 +50,11 @@ export function blockResponse(reason: string, hookEventName?: string): string {
|
|
|
50
50
|
}
|
|
51
51
|
if (isCodex() && hookEventName === "PreToolUse") {
|
|
52
52
|
return JSON.stringify({
|
|
53
|
-
hookSpecificOutput: {
|
|
53
|
+
hookSpecificOutput: {
|
|
54
|
+
hookEventName: "PreToolUse",
|
|
55
|
+
permissionDecision: "deny",
|
|
56
|
+
permissionDecisionReason: reason,
|
|
57
|
+
},
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
60
|
return JSON.stringify({ decision: "block", reason });
|