refactor(hooks): remove grep-blocker (grep tool now overrides built-in)

The grep tool now properly overrides OpenCode's built-in grep,
making the blocker hook unnecessary.

Generated by [OpenCode](https://opencode.ai/)
This commit is contained in:
YeonGyu-Kim
2025-12-08 14:04:49 +09:00
parent ed3d7a55f4
commit c5f651c0a9

View File

@@ -1,18 +0,0 @@
import type { PluginInput } from "@opencode-ai/plugin"
const BLOCKED_MESSAGE =
"Error: [BLOCKED] grep has no timeout and can freeze the system. " +
"It is permanently disabled. Use 'safe_grep' instead."
export function createGrepBlocker(_ctx: PluginInput) {
return {
"tool.execute.before": async (
input: { tool: string; sessionID: string; callID: string },
_output: { args: unknown }
) => {
if (input.tool === "grep") {
throw new Error(BLOCKED_MESSAGE)
}
},
}
}