Arms a watchdog that force-exits the process after the given duration.
Prevents hook processes from becoming zombies when stdin pipes break or
the IDE cancels the call. Since hooks MUST NOT spawn child processes
(to avoid orphan zombies), a simple exit(1) suffices.
Copilot-specific PreToolUse handler.
VS Code Copilot Chat uses the same hook format as Claude Code.
Tool names differ: “runInTerminal” / “editFile” instead of “Bash” / “Read”.
Inline rewrite: takes a command as CLI args, prints the rewritten command to stdout.
Used by the OpenCode TS plugin where the command is passed as an argument,
not via stdin JSON. Uses native OS paths (not MSYS) because the calling
shell may be PowerShell or cmd on Windows.