Skip to content

Commit 948fda0

Browse files
fix: use api.on() not api.registerHook() — registerHook requires hooks.internal.enabled config, api.on goes directly to typedHooks registry
1 parent 8527eec commit 948fda0

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@clawdreyhepburn/carapace",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "Cedar policy enforcement for agent tool access via OpenClaw's before_tool_call hook.",
55
"license": "Apache-2.0",
66
"type": "module",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ export default function register(api: OpenClawPluginApi) {
105105
};
106106

107107
// --- Register before_tool_call hook ---
108-
if (api.registerHook) {
109-
api.registerHook("before_tool_call", async (event: any) => {
108+
if (api.on) {
109+
api.on("before_tool_call", async (event: any) => {
110110
const toolName: string = event.toolName ?? event.tool ?? event.name ?? "";
111111
const params: Record<string, unknown> = event.params ?? event.arguments ?? event.input ?? {};
112112

0 commit comments

Comments
 (0)