@cotal-ai/connector-claude-code 0.171.5 → 0.172.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;AA+KtD,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;AA0JD;;;;;;;;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;AAgKD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAOnD"}
@@ -0,0 +1,59 @@
1
+ import type { HookEvent, HookHandle, MeshAgent, PromptDesk } from "@cotal-ai/connector-core";
2
+ /** The hook's `agent_id`: a subagent's id, or undefined for the main thread. */
3
+ export type Scope = string | undefined;
4
+ /** One tool permission Claude asks for. */
5
+ export interface ToolPermission {
6
+ scope: Scope;
7
+ tool: string;
8
+ input: unknown;
9
+ cwd?: string;
10
+ /** The MCP server that serves the tool, for an `mcp__*` tool. */
11
+ server?: string;
12
+ }
13
+ /** One call a batch lists: its tool name, the digest of its input, and the SHA-256 of its result when
14
+ * Claude gave the result as a string. */
15
+ export interface ToolCallKey {
16
+ tool: string;
17
+ digest: string;
18
+ result?: string;
19
+ }
20
+ /** The held hook connection of one tool permission. */
21
+ export interface HeldExchange {
22
+ /** Aborts when the hook's connection closes. */
23
+ readonly closed: AbortSignal;
24
+ /** Write the one hook output. Resolves on the hook's receipt for it and stays pending without one. */
25
+ write(output: Record<string, unknown>): Promise<void>;
26
+ }
27
+ /** The module's four inputs. */
28
+ export interface ClaudePrompts {
29
+ hold(permission: ToolPermission, exchange: HeldExchange): void;
30
+ batch(scope: Scope, calls: readonly ToolCallKey[]): void;
31
+ turnEnd(scope: Scope): void;
32
+ sessionEnd(): void;
33
+ }
34
+ /**
35
+ * The prompt module over `desk`, which reads the agent's desk when a permission arrives: undefined
36
+ * while it is not served. On Windows it opens no prompts and says why once, here: serving them there
37
+ * is its own work, and the hook answers a permission itself before it reaches this module.
38
+ */
39
+ export declare function createClaudePrompts(opts: {
40
+ desk(): PromptDesk | undefined;
41
+ warn(msg: string): void;
42
+ platform?: NodeJS.Platform;
43
+ }): ClaudePrompts;
44
+ /** The hook consumer the session had before prompts: it sees every event but `PermissionRequest`. */
45
+ export interface HookConsumer {
46
+ handle(agent: MeshAgent, ev: HookEvent): Promise<Record<string, unknown>>;
47
+ onReply(ev: HookEvent, delivered: boolean, handoff?: boolean): void;
48
+ }
49
+ /**
50
+ * The control server's handler and reply observer for a session Cotal launched. A
51
+ * `PermissionRequest` is held until the module writes its output, or until its hook's connection
52
+ * closes, and the relay's receipt for that output is the exchange's receipt. Every other event goes to
53
+ * the module's inputs first and then to `next`, whole and once, which replies to it.
54
+ */
55
+ export declare function launchedSessionHooks(prompts: ClaudePrompts, next: HookConsumer, warn: (msg: string) => void): {
56
+ handle: HookHandle;
57
+ onReply(ev: HookEvent, delivered: boolean, handoff: boolean): void;
58
+ };
59
+ //# sourceMappingURL=prompts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAY,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAA6B,MAAM,0BAA0B,CAAC;AAelI,gFAAgF;AAChF,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvC,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;0CAC0C;AAC1C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE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G,EAAE,MAAM,KAAK,IAAI,GAAG;IAC7G,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACpE,CAsDA"}
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,sBAAsB,EAI3B,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AAqFxB;0EAC0E;AAC1E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAOvG;AAkKD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAAG,IAAI,CA8CvJ;AAqCD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnE,CAKA;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK/D;AA6TD,eAAO,MAAM,mBAAmB,EAAE,sBAuHjC,CAAC"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,sBAAsB,EAI3B,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AAqFxB;0EAC0E;AAC1E,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,KAAK,CAOvG;AAqLD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,GAAG,IAAI,CA8CvJ;AAqCD,oGAAoG;AACpG,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnE,CAKA;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK/D;AA4UD,eAAO,MAAM,mBAAmB,EAAE,sBAyHjC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  /** The user-owned MCP declarations, shared by setup and launch-time environment selection. */
2
+ export declare const claudeUserMcpPath: () => string;
2
3
  export declare function claudeUserMcpServers(): Record<string, unknown>;
3
4
  /** Only user-owned declarations may add ambient environment names. Repository and plugin discovery
4
5
  * stays with Claude, including approvals; reading those files here could grant an untrusted repo
@@ -1 +1 @@
1
- {"version":3,"file":"user-mcp.d.ts","sourceRoot":"","sources":["../src/user-mcp.ts"],"names":[],"mappings":"AAMA,8FAA8F;AAC9F,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU9D;AAED;;sGAEsG;AACtG,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAI/C;AAqBD;qGACqG;AACrG,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAO3E"}
1
+ {"version":3,"file":"user-mcp.d.ts","sourceRoot":"","sources":["../src/user-mcp.ts"],"names":[],"mappings":"AAMA,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,QAAO,MAAkF,CAAC;AAExH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAU9D;AAED;;sGAEsG;AACtG,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAI/C;AAqBD;qGACqG;AACrG,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAO3E"}
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": [
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.171.5",
4
+ "version": "0.172.0",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -25,8 +25,8 @@
25
25
  "@cotal-ai/core": ">=0.1.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@cotal-ai/connector-core": "0.171.5",
29
- "@cotal-ai/core": "0.171.5",
28
+ "@cotal-ai/connector-core": "0.172.0",
29
+ "@cotal-ai/core": "0.172.0",
30
30
  "@cotal-ai/smoke-kit": "0.0.0",
31
31
  "@modelcontextprotocol/sdk": "^1.29.0",
32
32
  "@nats-io/transport-node": "3.4.0",