@cotal-ai/connector-claude-code 0.164.18 → 0.165.0

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/mcp.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AA8KtD,yFAAyF;AACzF,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IACjB;uDACmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;gFAC4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb;uDACmD;IACnD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;+BAE+B;AAC/B,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAQ3F;AA4JD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAOnD"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAgLtD,yFAAyF;AACzF,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,QAAQ,CAAC;IACjB;uDACmD;IACnD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;gFAC4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb;uDACmD;IACnD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;+BAE+B;AAC/B,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAQ3F;AAsKD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAOnD"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Claude Code's permission prompt at the hook boundary: its `PermissionRequest` payload in, the
3
+ * desk's verdict out. Type imports only, because the lifecycle hook process loads this module.
4
+ */
5
+ import type { HookEvent, PermissionAsk, PermissionVerdict } from "@cotal-ai/connector-core";
6
+ /** The hook event the relay holds open until the prompt is answered. */
7
+ export declare const isPermissionRequest: (event: unknown) => boolean;
8
+ /** The scope a hook fired in: the `agent_id` Claude sends from inside a subagent or teammate, or
9
+ * `undefined` for the main thread. A prompt, the batch that ran its tool and the turn end that closes
10
+ * it all carry the same one. */
11
+ export declare function claudeScope(ev: HookEvent): string | undefined;
12
+ /** The prompt a `PermissionRequest` payload asks, or `undefined` for one without a tool name and input. */
13
+ export declare function claudeAsk(ev: HookEvent): PermissionAsk | undefined;
14
+ /** The hook output that applies a verdict. A release prints no decision, so Claude keeps its own. */
15
+ export declare function claudeVerdict(verdict: PermissionVerdict): Record<string, unknown>;
16
+ /** The tool calls a `PostToolBatch` payload says ran. */
17
+ export declare function claudeToolCalls(ev: HookEvent): {
18
+ tool: string;
19
+ input: unknown;
20
+ }[];
21
+ //# sourceMappingURL=permission-hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permission-hook.d.ts","sourceRoot":"","sources":["../src/permission-hook.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG5F,wEAAwE;AACxE,eAAO,MAAM,mBAAmB,GAAI,OAAO,OAAO,KAAG,OACqC,CAAC;AAE3F;;iCAEiC;AACjC,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,2GAA2G;AAC3G,wBAAgB,SAAS,CAAC,EAAE,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAQlE;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAIjF;AAED,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EAAE,CAIjF"}
package/hooks/hooks.json CHANGED
@@ -31,6 +31,17 @@
31
31
  ]
32
32
  }
33
33
  ],
34
+ "PermissionRequest": [
35
+ {
36
+ "hooks": [
37
+ {
38
+ "type": "command",
39
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hook.cjs\"",
40
+ "timeout": 2147483
41
+ }
42
+ ]
43
+ }
44
+ ],
34
45
  "PostToolUse": [
35
46
  {
36
47
  "matcher": "^mcp__.+__cotal_(connect|disconnect)$",
@@ -63,6 +74,16 @@
63
74
  ]
64
75
  }
65
76
  ],
77
+ "SubagentStop": [
78
+ {
79
+ "hooks": [
80
+ {
81
+ "type": "command",
82
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hook.cjs\""
83
+ }
84
+ ]
85
+ }
86
+ ],
66
87
  "Stop": [
67
88
  {
68
89
  "hooks": [
@@ -313,7 +313,6 @@ export function register(on) {
313
313
  return next(e);
314
314
  });
315
315
  on('tool.call', async ($, e, next) => {
316
- let input = e;
317
316
  if (e.agentId === undefined && /^mcp__(cotal|plugin_cotal_cotal)__cotal_connect$/.test(e.tool)) {
318
317
  const session = await $.session.id();
319
318
  try {
@@ -326,9 +325,10 @@ export function register(on) {
326
325
  await relayNative($, nativeBinding);
327
326
  void listen($);
328
327
  } catch { return { deny: 'Cotal could not bind this native conversation to its local server. No identity was requested.' }; }
329
- input = { ...e, context: session };
328
+ // The bound session is already on the local server. Leaving the tool input unchanged lets a
329
+ // host that rejects a hook-edited call admit the first connect.
330
330
  }
331
- const result = await next(input);
331
+ const result = await next(e);
332
332
  if (e.agentId === undefined && !next.signal.aborted) await submit($, true);
333
333
  return result;
334
334
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-claude-code",
3
3
  "description": "Cotal connector for Claude Code: an installed plugin that joins a session to the mesh.",
4
- "version": "0.164.18",
4
+ "version": "0.165.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,12 +25,14 @@
25
25
  "@cotal-ai/core": ">=0.1.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@cotal-ai/connector-core": "0.164.18",
29
- "@cotal-ai/core": "0.164.18",
28
+ "@cotal-ai/auth": "0.165.0",
29
+ "@cotal-ai/connector-core": "0.165.0",
30
+ "@cotal-ai/core": "0.165.0",
30
31
  "@cotal-ai/smoke-kit": "0.0.0",
31
32
  "@modelcontextprotocol/sdk": "^1.29.0",
32
33
  "@nats-io/transport-node": "^3.4.0",
33
34
  "esbuild": "^0.28.0",
35
+ "jose": "^6.2.3",
34
36
  "tsx": "^4.22.4"
35
37
  },
36
38
  "files": [