@cotal-ai/connector-claude-code 0.79.0 → 0.82.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/.mcp.json +1 -1
- package/dist/agui-map.d.ts +7 -0
- package/dist/agui-map.d.ts.map +1 -1
- package/dist/agui-source.d.ts.map +1 -1
- package/dist/carried.d.ts +1 -1
- package/dist/carried.d.ts.map +1 -1
- package/dist/extension.d.ts.map +1 -1
- package/dist/hook.cjs +37 -18
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.js +13 -48
- package/dist/mcp.cjs +960 -344
- package/dist/mcp.d.cts +34 -0
- package/dist/mcp.d.ts +33 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/trust.d.ts +5 -7
- package/dist/trust.d.ts.map +1 -1
- package/hooks/hooks.json +10 -0
- package/package.json +9 -5
package/dist/mcp.d.cts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cotal Claude Code connector — MCP (stdio) server.
|
|
3
|
+
*
|
|
4
|
+
* Turns the Claude Code session that launches it into a first-class Cotal mesh
|
|
5
|
+
* peer: presence + the shared cotal_* tools (from @cotal-ai/connector-core), plus
|
|
6
|
+
* Claude's `claude/channel` push so an idle session wakes the instant a peer
|
|
7
|
+
* message arrives. Identity comes from `COTAL_*` env.
|
|
8
|
+
*
|
|
9
|
+
* stdio transport owns stdout for JSON-RPC — ALL diagnostics go to stderr.
|
|
10
|
+
*/
|
|
11
|
+
import type { Readable, Writable } from "node:stream";
|
|
12
|
+
/** One managed session: its launch env (read only from here) and its MCP stream pair. */
|
|
13
|
+
export interface ClaudeSessionOptions {
|
|
14
|
+
env: NodeJS.ProcessEnv;
|
|
15
|
+
input: Readable;
|
|
16
|
+
output: Writable;
|
|
17
|
+
/** Exit the process when the control socket cannot be bound. A host serving several sessions
|
|
18
|
+
* leaves it off, and the call rejects instead. */
|
|
19
|
+
fatalBind?: boolean;
|
|
20
|
+
/** A shutdown frame or the end or closure of `input` ended the session. Called once after teardown;
|
|
21
|
+
* `code` is 1 if teardown failed, or the requested exit code otherwise. */
|
|
22
|
+
onShutdown?: (code: number) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface ClaudeSession {
|
|
25
|
+
name: string;
|
|
26
|
+
/** Leave the mesh and stop serving. Idempotent; may reject if teardown fails.
|
|
27
|
+
* The streams stay open; the caller owns them. */
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/** Serve one managed Claude Code session over `input`/`output`. Every per-session object lives in
|
|
31
|
+
* the call, so one process can serve several sessions. A startup failure closes what was started
|
|
32
|
+
* before the call rejects. */
|
|
33
|
+
export declare function serveClaudeSession(opts: ClaudeSessionOptions): Promise<ClaudeSession>;
|
|
34
|
+
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,2 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Cotal Claude Code connector — MCP (stdio) server.
|
|
3
|
+
*
|
|
4
|
+
* Turns the Claude Code session that launches it into a first-class Cotal mesh
|
|
5
|
+
* peer: presence + the shared cotal_* tools (from @cotal-ai/connector-core), plus
|
|
6
|
+
* Claude's `claude/channel` push so an idle session wakes the instant a peer
|
|
7
|
+
* message arrives. Identity comes from `COTAL_*` env.
|
|
8
|
+
*
|
|
9
|
+
* stdio transport owns stdout for JSON-RPC — ALL diagnostics go to stderr.
|
|
10
|
+
*/
|
|
11
|
+
import type { Readable, Writable } from "node:stream";
|
|
12
|
+
/** One managed session: its launch env (read only from here) and its MCP stream pair. */
|
|
13
|
+
export interface ClaudeSessionOptions {
|
|
14
|
+
env: NodeJS.ProcessEnv;
|
|
15
|
+
input: Readable;
|
|
16
|
+
output: Writable;
|
|
17
|
+
/** Exit the process when the control socket cannot be bound. A host serving several sessions
|
|
18
|
+
* leaves it off, and the call rejects instead. */
|
|
19
|
+
fatalBind?: boolean;
|
|
20
|
+
/** A shutdown frame or the end or closure of `input` ended the session. Called once after teardown;
|
|
21
|
+
* `code` is 1 if teardown failed, or the requested exit code otherwise. */
|
|
22
|
+
onShutdown?: (code: number) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface ClaudeSession {
|
|
25
|
+
name: string;
|
|
26
|
+
/** Leave the mesh and stop serving. Idempotent; may reject if teardown fails.
|
|
27
|
+
* The streams stay open; the caller owns them. */
|
|
28
|
+
close(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/** Serve one managed Claude Code session over `input`/`output`. Every per-session object lives in
|
|
31
|
+
* the call, so one process can serve several sessions. A startup failure closes what was started
|
|
32
|
+
* before the call rejects. */
|
|
33
|
+
export declare function serveClaudeSession(opts: ClaudeSessionOptions): Promise<ClaudeSession>;
|
|
2
34
|
//# sourceMappingURL=mcp.d.ts.map
|
package/dist/mcp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":""}
|
|
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;AAgFtD,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"}
|
package/dist/trust.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export declare function refuseUntrustedCwd(cwd: string): void;
|
|
1
|
+
import type { StartupReply } from "@cotal-ai/core";
|
|
2
|
+
/** An authorized managed launch accepts its workspace through Claude's own dialog. The second
|
|
3
|
+
* response requires the selected Yes row rather than blindly answering the default No choice.
|
|
4
|
+
* Claude persists its own trust state; Cotal never edits the operator's config file. */
|
|
5
|
+
export declare const CLAUDE_WORKSPACE_TRUST_REPLIES: readonly StartupReply[];
|
|
8
6
|
//# sourceMappingURL=trust.d.ts.map
|
package/dist/trust.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../src/trust.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../src/trust.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD;;wFAEwF;AACxF,eAAO,MAAM,8BAA8B,EAAE,SAAS,YAAY,EAGhE,CAAC"}
|
package/hooks/hooks.json
CHANGED
|
@@ -30,6 +30,16 @@
|
|
|
30
30
|
]
|
|
31
31
|
}
|
|
32
32
|
],
|
|
33
|
+
"PostToolBatch": [
|
|
34
|
+
{
|
|
35
|
+
"hooks": [
|
|
36
|
+
{
|
|
37
|
+
"type": "command",
|
|
38
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/dist/hook.cjs\""
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
33
43
|
"Notification": [
|
|
34
44
|
{
|
|
35
45
|
"matcher": "permission_prompt|agent_needs_input|elicitation_dialog",
|
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.
|
|
4
|
+
"version": "0.82.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,14 +15,18 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./mcp": {
|
|
20
|
+
"types": "./dist/mcp.d.cts",
|
|
21
|
+
"default": "./dist/mcp.cjs"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"peerDependencies": {
|
|
21
25
|
"@cotal-ai/core": ">=0.1.0"
|
|
22
26
|
},
|
|
23
27
|
"devDependencies": {
|
|
24
|
-
"@cotal-ai/connector-core": "0.
|
|
25
|
-
"@cotal-ai/core": "0.
|
|
28
|
+
"@cotal-ai/connector-core": "0.82.0",
|
|
29
|
+
"@cotal-ai/core": "0.82.0",
|
|
26
30
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
27
31
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
28
32
|
"@nats-io/transport-node": "^3.4.0",
|
|
@@ -42,7 +46,7 @@
|
|
|
42
46
|
"scripts": {
|
|
43
47
|
"test": "tsx smoke/launch-env.smoke.ts",
|
|
44
48
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.smoke.json",
|
|
45
|
-
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json --emitDeclarationOnly && pnpm run bundle",
|
|
46
|
-
"bundle": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js --external:@cotal-ai/core && esbuild src/mcp.ts src/hook.ts --bundle --platform=node --format=cjs --target=node20 --
|
|
49
|
+
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json --emitDeclarationOnly && node -e \"require('node:fs').copyFileSync('dist/mcp.d.ts','dist/mcp.d.cts')\" && pnpm run bundle",
|
|
50
|
+
"bundle": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js --external:@cotal-ai/core && esbuild src/mcp.ts --bundle --platform=node --format=cjs --target=node20 --outfile=dist/mcp.cjs --footer:js=\"module.exports = { serveClaudeSession: module.exports.serveClaudeSession };\" && esbuild src/hook.ts --bundle --platform=node --format=cjs --target=node20 --outfile=dist/hook.cjs"
|
|
47
51
|
}
|
|
48
52
|
}
|