@cotal-ai/connector-claude-code 0.1.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 ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":""}
package/dist/mcp.js ADDED
@@ -0,0 +1,181 @@
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 { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
12
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
13
+ import { configFromEnv, hasIdentity, MeshAgent, controlSocketPath, startControlServer, registerCotalTools, laneLine, formatInjection, fmtFrom, channelMeta, } from "@cotal-ai/connector-core";
14
+ /**
15
+ * Last tool Claude tried to use, captured on PreToolUse. When a permission Notification
16
+ * fires moments later, this is *what* it's blocked on — so the dashboard shows the actual
17
+ * command/action awaiting approval, not just "Claude needs your permission".
18
+ */
19
+ let pendingTool;
20
+ /** A short, human-readable preview of a tool call: its most salient input, else compact JSON. */
21
+ function toolDetail(name, input) {
22
+ if (typeof name !== "string" || !name)
23
+ return undefined;
24
+ const i = (input ?? {});
25
+ const salient = i.command ?? i.file_path ?? i.path ?? i.url ?? i.pattern ?? i.description;
26
+ let detail = typeof salient === "string" ? salient : Object.keys(i).length ? JSON.stringify(i) : "";
27
+ if (detail.length > 300)
28
+ detail = `${detail.slice(0, 299)}…`;
29
+ return { name, detail };
30
+ }
31
+ /** Claude Code lifecycle events → presence + (on inject-capable events) queued peer messages. */
32
+ const claudeHandle = async (agent, ev) => {
33
+ const event = ev.hook_event_name ?? "";
34
+ const withContext = (text) => text ? { hookSpecificOutput: { hookEventName: event, additionalContext: text } } : {};
35
+ try {
36
+ switch (event) {
37
+ case "SessionStart":
38
+ await agent.setStatus("idle");
39
+ return withContext(formatInjection(agent.drainInbox()));
40
+ case "UserPromptSubmit":
41
+ pendingTool = undefined; // new turn — the previous block (if any) is resolved
42
+ await agent.setStatus("working");
43
+ return withContext(formatInjection(agent.drainInbox()));
44
+ case "PreToolUse":
45
+ // Remember what Claude is about to do; if it needs permission, the Notification
46
+ // below turns this into the "blocked on" detail. Auto-approved tools just overwrite it.
47
+ pendingTool = toolDetail(ev.tool_name, ev.tool_input);
48
+ return {};
49
+ case "Notification": {
50
+ // Claude Code's Notification carries the human-readable reason the session is
51
+ // blocked in `message`. When a tool permission is pending, lead with *what* it's
52
+ // waiting on (the actual command) so a one-line card preview stays informative — the
53
+ // `waiting` status + the dashboard's "BLOCKED ON" label already convey the *why*.
54
+ // Otherwise (idle-input / elicitation, no tool) the message itself is the content.
55
+ const msg = typeof ev.message === "string" ? ev.message : undefined;
56
+ const activity = pendingTool
57
+ ? `${pendingTool.name}${pendingTool.detail ? `: ${pendingTool.detail}` : ""}`
58
+ : msg;
59
+ await agent.setStatus("waiting", activity);
60
+ return {};
61
+ }
62
+ case "Stop":
63
+ case "StopFailure": // turn died on an API error — Stop won't fire, so reset here too
64
+ pendingTool = undefined; // turn ended — don't let a stale tool attach to an idle-wait notification
65
+ await agent.setStatus("idle");
66
+ // Now idle: if ambient channel chatter was held while we were busy, ask the channel to
67
+ // wake one turn so its UserPromptSubmit drains+acks the batch (the sole ack site). Stop
68
+ // can't inject context itself, so we must NOT drain here — that would ack with no vehicle
69
+ // to the model and silently lose the messages.
70
+ if (agent.inboxCount() > 0)
71
+ agent.requestWake();
72
+ return {};
73
+ case "SessionEnd":
74
+ await agent.setStatus("offline");
75
+ return {};
76
+ default:
77
+ return {};
78
+ }
79
+ }
80
+ catch {
81
+ return {}; // never block the session
82
+ }
83
+ };
84
+ async function main() {
85
+ // No identity → this is a plain `claude`, not a launcher-spawned agent. Stay
86
+ // inert: never connect to the mesh, so an installed plugin can't make the
87
+ // operator's own sessions join as stray peers.
88
+ if (!hasIdentity()) {
89
+ process.stderr.write("[cotal-connector] no COTAL_NAME — not a managed session; staying off the mesh\n");
90
+ return;
91
+ }
92
+ const config = configFromEnv();
93
+ const agent = new MeshAgent(config);
94
+ agent.start(); // background connect with retry — never blocks tool serving
95
+ // Local control plane for the lifecycle hooks (presence + message injection).
96
+ const socketPath = controlSocketPath(config.space, config.name);
97
+ const controlServer = startControlServer(agent, socketPath, claudeHandle);
98
+ const server = new McpServer({ name: "cotal", version: "0.0.0" }, {
99
+ // `claude/channel` makes this MCP server a Claude Code *channel*: peer
100
+ // messages can be pushed straight into the session (waking it if idle).
101
+ capabilities: { experimental: { "claude/channel": {} } },
102
+ instructions: `You are connected to the Cotal mesh as "${config.name}"` +
103
+ `${config.role ? ` (role: ${config.role})` : ""} in space "${config.space}". ` +
104
+ laneLine(config) +
105
+ `Other agents coordinate with you here as lateral peers. ` +
106
+ `Peer messages may arrive as <channel source="cotal" from="<name>" role="<role>" ` +
107
+ `kind="dm|channel|anycast" channel="<name>">…</channel> — read them and, when a reply is ` +
108
+ `warranted, respond with cotal_dm (back to that peer), cotal_send (to a channel), or ` +
109
+ `cotal_anycast (to a role). Use cotal_roster to see who is present, cotal_inbox to pull ` +
110
+ `anything you may have missed, and cotal_status to report what you are doing. ` +
111
+ `Reply only when a reply is actually needed — a silent acknowledgement is correct; ` +
112
+ `"agreed/thanks/good point" messages are noise. And @-mention a peer only when you need ` +
113
+ `THAT specific peer to act: a mention wakes them, so mentioning in acknowledgements or ` +
114
+ `sign-offs makes peers ping-pong wake-ups in an endless loop.`,
115
+ });
116
+ registerCotalTools(server, agent, config);
117
+ // One wake-nudge path, shared by incoming messages and the Stop→idle flush. It stays a stable
118
+ // function gated on a *mutable* `channelActive` flag (flipped true only after the MCP
119
+ // handshake confirms the client speaks claude/channel — see below). If it fires before then it
120
+ // simply no-ops; the message waits unacked in the inbox and is drained at the next
121
+ // UserPromptSubmit, so nothing is lost. This only ever *wakes* a turn — drainInbox stays the
122
+ // sole ack site.
123
+ let channelActive = false;
124
+ const nudge = (item) => {
125
+ if (!channelActive)
126
+ return;
127
+ const n = agent.inboxCount();
128
+ const content = item
129
+ ? `📨 New ${item.kind}${item.mentionsMe ? " — you were mentioned" : ""} from ${fmtFrom(item)} — delivering your Cotal inbox now.`
130
+ : `📨 ${n} Cotal message${n === 1 ? "" : "s"} waiting — delivering your inbox now.`;
131
+ void server.server
132
+ .notification({
133
+ method: "notifications/claude/channel",
134
+ params: { content, meta: item ? channelMeta(item) : { kind: "batch" } },
135
+ })
136
+ .catch((e) => process.stderr.write(`[cotal-connector] channel nudge failed: ${e.message}\n`));
137
+ };
138
+ // Two priority tiers. A *directed* message (DM, anycast, or an @mention of us) always nudges,
139
+ // so the addressee sees it promptly — woken now if idle, at the next turn boundary if busy.
140
+ // *Ambient* channel chatter (not addressed to us) is suppressed while we're mid-turn ("working")
141
+ // and instead accumulates in the inbox; the Stop→idle flush then fires one batch nudge.
142
+ agent.on("incoming", (item) => {
143
+ const ambient = item.kind === "channel" && !item.mentionsMe && agent.status === "working";
144
+ if (!ambient)
145
+ nudge(item);
146
+ });
147
+ agent.on("wake", () => nudge());
148
+ const shutdown = async () => {
149
+ try {
150
+ controlServer.close();
151
+ }
152
+ catch {
153
+ /* ignore */
154
+ }
155
+ try {
156
+ await agent.stop();
157
+ }
158
+ finally {
159
+ process.exit(0);
160
+ }
161
+ };
162
+ process.on("SIGINT", () => void shutdown());
163
+ process.on("SIGTERM", () => void shutdown());
164
+ const transport = new StdioServerTransport();
165
+ await server.connect(transport);
166
+ // Is this session consuming us as a channel? Only now (post-handshake) can we read the
167
+ // client's capabilities, so we flip the mutable flag the nudge path is gated on. The handlers
168
+ // were registered above and simply no-op'd until this point.
169
+ const clientCaps = server.server.getClientCapabilities();
170
+ const envFlag = process.env.COTAL_CHANNEL;
171
+ channelActive = envFlag
172
+ ? /^(1|true|yes|on)$/i.test(envFlag)
173
+ : Boolean(clientCaps?.experimental?.["claude/channel"]);
174
+ process.stderr.write(`[cotal-connector] client capabilities: ${JSON.stringify(clientCaps ?? {})} → channel ${channelActive ? "ACTIVE" : "off"}\n`);
175
+ process.stderr.write(`[cotal-connector] MCP ready (stdio) — space="${config.space}" name="${config.name}"${config.role ? ` role="${config.role}"` : ""}\n`);
176
+ }
177
+ main().catch((e) => {
178
+ process.stderr.write(`[cotal-connector] fatal: ${e.stack ?? String(e)}\n`);
179
+ process.exit(1);
180
+ });
181
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,aAAa,EACb,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,GAGZ,MAAM,0BAA0B,CAAC;AAElC;;;;GAIG;AACH,IAAI,WAAyD,CAAC;AAE9D,iGAAiG;AACjG,SAAS,UAAU,CAAC,IAAa,EAAE,KAAc;IAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IACxD,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAA4B,CAAC;IACnD,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,C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AAC,KAAK,IAAI,CAC7H,CAAC;IAEF,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,gDAAgD,MAAM,CAAC,KAAK,WAAW,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CACtI,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA6B,CAAW,CAAC,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@cotal-ai/connector-claude-code",
3
+ "version": "0.1.0",
4
+ "license": "Apache-2.0",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "dependencies": {
15
+ "@modelcontextprotocol/sdk": "^1.29.0",
16
+ "@cotal-ai/connector-core": "0.1.0"
17
+ },
18
+ "peerDependencies": {
19
+ "@cotal-ai/core": "0.1.0"
20
+ },
21
+ "devDependencies": {
22
+ "esbuild": "^0.28.0",
23
+ "tsx": "^4.22.4",
24
+ "@cotal-ai/core": "0.1.0"
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "scripts": {
33
+ "typecheck": "tsc -p tsconfig.json --noEmit",
34
+ "build": "tsc -p tsconfig.json",
35
+ "bundle": "esbuild src/mcp.ts src/hook.ts --bundle --platform=node --format=cjs --target=node20 --outdir=dist --out-extension:.js=.cjs"
36
+ }
37
+ }