@clawchatsai/connector 0.0.48 → 0.0.50

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/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ interface PluginApi {
51
51
  name: string;
52
52
  description?: string;
53
53
  }) => void;
54
- registerTypedHook: (hookName: string, handler: (event: Record<string, unknown>, ctx: Record<string, unknown>) => void | Promise<void>, opts?: {
54
+ on: (hookName: string, handler: (event: Record<string, unknown>, ctx: Record<string, unknown>) => void | Promise<void>, opts?: {
55
55
  name?: string;
56
56
  description?: string;
57
57
  priority?: number;
package/dist/index.js CHANGED
@@ -964,10 +964,9 @@ const plugin = {
964
964
  const mediaStash = new Map();
965
965
  // Capture MEDIA: paths from exec tool results before the gateway strips them from message text.
966
966
  // Fires after every tool call; we filter to exec only and check for MEDIA: lines.
967
- api.registerTypedHook('after_tool_call', (event, ctx) => {
968
- // Diagnostic: log every tool call so we can confirm hook fires + see real tool names
969
- console.log(`[clawchats] hook:after_tool_call toolName=${String(event.toolName)} sessionKey=${String(ctx.sessionKey)}`);
970
- if (event.toolName !== 'exec')
967
+ // Uses api.on() — the correct public API for typed lifecycle hooks (NOT registerTypedHook).
968
+ api.on('after_tool_call', (event, ctx) => {
969
+ if (event.toolName !== 'exec' && event.toolName !== 'process')
971
970
  return;
972
971
  // result is { content: [{ type: 'text', text: '...' }] } — extract text defensively
973
972
  const result = event.result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawchatsai/connector",
3
- "version": "0.0.48",
3
+ "version": "0.0.50",
4
4
  "type": "module",
5
5
  "description": "ClawChats OpenClaw plugin — P2P tunnel + local API bridge",
6
6
  "main": "dist/index.js",