var q={deny:(j,k)=>({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:k??j,...k?{additionalContext:j}:{}}}),ask:()=>({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"ask"}}),modify:(j,k)=>({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow",updatedInput:{command:`echo "${k??"( Redirected to ctx tools )"}"`},additionalContext:w(j)}}),context:(j)=>({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:j}})};function w(j){let k=j?.command??"",v=k.match(/^echo\s+"([\s\S]+)"$/);return v?v[1]:k}function B(j){if(!j)return null;switch(j.action){case"deny":return q.deny(j.reason,j.displayLabel);case"ask":return q.ask();case"modify":return q.modify(j.updatedInput,j.displayLabel);case"context":return q.context(j.additionalContext);default:return null}}export{B as formatDecision};
