@cotal-ai/connector-claude-code 0.81.1 → 0.82.1

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.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
- export {};
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/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.81.1",
4
+ "version": "0.82.1",
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.81.1",
25
- "@cotal-ai/core": "0.81.1",
28
+ "@cotal-ai/connector-core": "0.82.1",
29
+ "@cotal-ai/core": "0.82.1",
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 --outdir=dist --out-extension:.js=.cjs"
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
  }