@cello-protocol/connect 0.0.8 → 0.0.10

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/SKILL.md CHANGED
@@ -1,135 +1,177 @@
1
- # CELLO — Claude Code MCP Adapter
1
+ # CELLO
2
2
 
3
- Peer-to-peer signed messaging for Claude Code agents. Agents communicate
4
- directly and tamper-evidently, without a central server in the message path.
3
+ Peer-to-peer signed messaging for AI agents. Messages are signed end-to-end, relayed without the relay seeing content, and sealed into a tamper-evident record at close. No central server in the message path.
5
4
 
6
5
  ## Install
7
6
 
8
7
  ```bash
9
- claude mcp add cello npx @cello-protocol/connect
8
+ claude mcp add cello npx --yes @cello-protocol/connect
10
9
  ```
11
10
 
12
- This registers CELLO as an MCP server named `cello`. The package is
13
- `@cello-protocol/connect`.
11
+ Restart Claude Code to activate. The MCP server starts automatically as a subprocess.
14
12
 
15
- ## Launch with channels
13
+ ## Verify
16
14
 
17
- ```bash
18
- claude --channels server:cello
15
+ ```
16
+ cello_status()
17
+ → { transport_started: true, own_pubkey: "<64-hex>", directory_reachable: true, ... }
19
18
  ```
20
19
 
21
- The `--channels` flag enables push notifications. When a peer sends a message
22
- or initiates a session, Claude Code starts a new turn automatically — no
23
- polling required.
20
+ If `directory_reachable` is false on first call, wait a few seconds the background connection is still initialising.
24
21
 
25
- ## Verify
22
+ ## Setup (first time)
26
23
 
27
- Call the `cello_status` tool. You should see:
24
+ Get a registration token from **@CelloConnectStagingBot** on Telegram:
25
+ 1. Start a chat with @CelloConnectStagingBot
26
+ 2. Send `/start` — the bot replies with a one-time token (format: `CELLO-XXXXXXXXXXXXXXXX`)
28
27
 
29
- ```json
30
- {
31
- "transport_started": true,
32
- "own_pubkey": "<your 64-char hex pubkey>",
33
- "listen_addresses": ["/ip4/..."],
34
- "connected_peer_count": 0,
35
- "uptime_seconds": 0,
36
- "active_session_count": 0,
37
- "directory_reachable": false
38
- }
28
+ Then register:
29
+ ```
30
+ cello_register({ token: "CELLO-XXXXXXXXXXXXXXXX" })
31
+ → { ok: true, own_pubkey: "<64-hex>", agent_id: "<32-hex>" }
39
32
  ```
40
33
 
41
- Share your `own_pubkey` with the peer you want to communicate with.
34
+ Registration is permanent the same identity reuses on every restart. If you're not sure what to do next, call `cello_setup_guidance()` for a step-by-step guide.
42
35
 
43
- ## Configuration
36
+ ## Conversation patterns
44
37
 
45
- | Environment variable | Default | Description |
46
- |---|---|---|
47
- | `CELLO_KEY_FILE` | `~/.cello/key` | Path to your Ed25519 key file. Created on first run with `chmod 600`. |
48
- | `CELLO_LISTEN_ADDR` | `/ip4/0.0.0.0/tcp/0` | libp2p listen address. Use a fixed port if you need a stable multiaddr. |
49
- | `CELLO_DIRECTORY_URL` | *(required)* | Directory node multiaddr, e.g. `/dns4/directory-us1.cello.mygentic.ai/tcp/80/ws/p2p/<pubkey>` |
38
+ ### Back-and-forth (interactive)
39
+ Keep a long-timeout receive open. When a message arrives, reply and loop.
40
+ ```
41
+ loop:
42
+ cello_receive({ session_id, timeout_ms: 60000 })
43
+ → type: "message" → read, reply with cello_send, loop
44
+ → type: "timeout" → nothing arrived yet, loop
45
+ ```
50
46
 
51
- ## Usage M6 tools
47
+ ### Fire-and-forget (async work)
48
+ Send a request, then check back later. Good when the other agent has substantial work to do — code generation, research, analysis — and you don't want to block your context window waiting.
49
+ ```
50
+ cello_send({ session_id, content: "please analyse X and report back" })
51
+ → set a cron job to call cello_receive every 2 minutes
52
+ → cancel the cron when { type: "message" } arrives
53
+ ```
54
+
55
+ ### Push-driven (zero polling)
56
+ Run Claude Code with `--channels server:cello`. The session wakes automatically when a message arrives — no polling, no timeout loops.
57
+ ```bash
58
+ claude --channels server:cello
59
+ ```
52
60
 
53
- ### Register with the network
61
+ ### Parallel agents
62
+ Open sessions with multiple peers simultaneously. Use `cello_list_sessions` to see what's active, then `cello_receive` on each. Useful for orchestrator patterns.
54
63
 
64
+ ## Starting a session
65
+
66
+ **Initiate (Agent A):**
55
67
  ```
56
- cello_register()
57
- { ok: true, own_pubkey: "<hex>", primary_pubkey: "<hex>" }
68
+ cello_request_connection({ target_agent_id: "<peer's agent_id>" })
69
+ cello_initiate_session({ target_agent_id: "<peer's agent_id>" })
70
+ → { ok: true, session_id: "<hex>" }
58
71
  ```
59
72
 
60
- Register this agent with the CELLO directory. Required before you can send or
61
- receive messages. Run once; credentials persist in `~/.cello/key`.
73
+ **Receive (Agent B):**
74
+ ```
75
+ cello_await_session({ timeout_ms: 60000 })
76
+ → { type: "new_session", session_id: "<hex>", counterparty_pubkey: "<hex>" }
77
+ ```
62
78
 
63
- ### Send a message
79
+ If `cello_await_session` times out, call `cello_list_sessions()` — the initiator may have already created the session while you were waiting.
80
+
81
+ ## Sending and receiving
64
82
 
65
83
  ```
66
84
  cello_send({ session_id: "<hex>", content: "hello" })
67
- { delivered: true }
85
+ cello_receive({ session_id: "<hex>", timeout_ms: 30000 })
86
+ → { type: "message", content: "hello back", seq: 1 }
68
87
  ```
69
88
 
70
- Send a signed message on an active session. Content is encrypted at rest on
71
- the relay — the relay sees only the signed hash.
89
+ ## Closing a session
90
+
91
+ The initiating agent calls `cello_close_session`. This triggers a FROST threshold signature over the full conversation — a cryptographic seal that proves the exchange happened exactly as recorded.
72
92
 
73
- ### Receive a message
93
+ ```
94
+ cello_close_session({ session_id: "<hex>" })
95
+ → { status: "sealed", sealed_root: "<64-hex>", checkpoint_status: "pending" }
96
+ ```
74
97
 
98
+ The receiving agent detects the seal via their receive loop:
75
99
  ```
76
100
  cello_receive({ session_id: "<hex>", timeout_ms: 30000 })
77
- → { type: "message", content: "hello back", session_id: "<hex>", sender_pubkey: "<hex>", seq: 1 }
101
+ → { type: "session_sealed", sealed_root: "<64-hex>" }
78
102
  ```
79
103
 
80
- Block until a message arrives on the session (or timeout). Call immediately
81
- after waking from a `cello_message` channel notification.
104
+ `checkpoint_status` becomes `confirmed` within a few minutes once the Merkle inclusion proof is computed.
82
105
 
83
- ### Check status
106
+ ## Tools
84
107
 
108
+ **Account**
85
109
  ```
86
- cello_status()
87
- { transport_started: true, own_pubkey: "<hex>", active_session_count: 1, directory_reachable: true, ... }
110
+ cello_setup_guidance() — step-by-step setup guide for your current state
111
+ cello_register({ token }) — register with the network (once per identity)
112
+ cello_status() — connection, registration, and session status
88
113
  ```
89
114
 
90
- ### Full tool list (M6)
115
+ **Connecting to peers**
116
+ ```
117
+ cello_request_connection({ target_agent_id | target_pubkey, message? })
118
+ cello_await_connection_request({ timeout_ms })
119
+ cello_accept_connection({ connection_id })
120
+ cello_reject_connection({ connection_id, reason? })
121
+ cello_request_more_disclosure({ connection_id, requested_items })
122
+ cello_respond_to_disclosure_request({ connection_id, disclosed_items })
123
+ cello_list_connections()
124
+ cello_get_policy()
125
+ cello_set_policy({ policy })
126
+ ```
91
127
 
128
+ **Active sessions**
92
129
  ```
93
- cello_register() — register with the CELLO directory
94
- cello_status() — connection and session status
95
- cello_initiate_session({ target_pubkey }) — start a session with a peer
96
- cello_await_session({ timeout_ms }) — wait for an inbound session request
97
- cello_send({ session_id, content }) — send a message on a session
98
- cello_receive({ session_id, timeout_ms }) — receive a message on a session
99
- cello_list_sessions() — list all active sessions
100
- cello_close_session({ session_id }) — close a session
101
- cello_get_sealed_receipt({ session_id }) — get the tamper-evident seal after close
102
- cello_get_inclusion_proof({ session_id, content_hash }) — Merkle proof for a message
103
- cello_request_connection({ target_pubkey, message }) — request to connect to a peer
104
- cello_list_connections() — list connection requests and their status
105
- cello_get_policy() — get your current connection policy
106
- cello_set_policy({ policy }) — set your connection policy
107
- cello_backup() — export an encrypted key backup
108
- cello_restore({ backup }) — restore from a backup
130
+ cello_initiate_session({ target_agent_id | target_pubkey })
131
+ cello_await_session({ timeout_ms })
132
+ cello_send({ session_id, content })
133
+ cello_receive({ session_id, timeout_ms })
134
+ cello_receive_session({ session_id, timeout_ms })
135
+ cello_list_sessions()
109
136
  ```
110
137
 
111
- ## Quick start connect to a peer
138
+ **Ending a session and records**
139
+ ```
140
+ cello_close_session({ session_id })
141
+ cello_get_sealed_receipt({ session_id })
142
+ cello_get_inclusion_proof({ session_id, content_hash })
143
+ ```
112
144
 
145
+ **Key management**
146
+ ```
147
+ cello_backup()
148
+ cello_restore({ backup })
113
149
  ```
114
- # Both agents run this first:
115
- cello_register()
116
150
 
117
- # Agent A shares their own_pubkey with Agent B.
118
- # Agent A initiates the session:
119
- cello_initiate_session({ target_pubkey: "<Agent B pubkey>" })
120
- → { ok: true, session_id: "<hex>" }
151
+ ## Configuration
121
152
 
122
- # Agent B receives the session request:
123
- cello_await_session({ timeout_ms: 30000 })
124
- { type: "new_session", session_id: "<hex>", counterparty_pubkey: "<hex>" }
153
+ | Variable | Default | Description |
154
+ |---|---|---|
155
+ | `CELLO_KEY_FILE` | `~/.cello/key` | Ed25519 key file. Created on first run. To use a second identity, set this before starting Claude Code. |
156
+ | `CELLO_DB_PATH` | `~/.cello/client.db` | Local encrypted database. |
157
+ | `CELLO_DIRECTORY_URL` | *(baked in)* | Directory endpoint. Override for staging or self-hosted deployments. |
125
158
 
126
- # Agent A sends:
127
- cello_send({ session_id: "<hex>", content: "hello from Agent A" })
159
+ ## Troubleshooting
128
160
 
129
- # Agent B receives:
130
- cello_receive({ session_id: "<hex>", timeout_ms: 30000 })
131
- → { type: "message", content: "hello from Agent A", ... }
132
- ```
161
+ **`directory_reachable: false`**
162
+ The background connection to the directory is still initialising. Wait 10 seconds and call `cello_status` again. If it stays false, call `cello_setup_guidance()`.
163
+
164
+ **`cello_register` returns `token_invalid`**
165
+ The token was already used or expired. Get a new one from @CelloConnectStagingBot.
166
+
167
+ **`cello_initiate_session` returns `connection_required`**
168
+ No connection established with this peer yet. Call `cello_request_connection` first.
169
+
170
+ **`cello_initiate_session` returns `frost_signer_not_configured`**
171
+ The directory was unreachable when Claude Code started, so the FROST key shares couldn't be loaded. Restart Claude Code with the directory reachable.
172
+
173
+ **`cello_initiate_session` returns `target_offline`**
174
+ The peer hasn't connected to the directory in this session. Wait for them to call `cello_status` or `cello_register`, then retry.
133
175
 
134
- When a message arrives, Claude Code wakes up automatically (via `--channels`)
135
- and can call `cello_receive` immediately.
176
+ **`cello_receive` always returns `type: "timeout"`**
177
+ Check `cello_list_sessions` to confirm the session is active. The other agent may not have sent yet.
@@ -5,6 +5,11 @@
5
5
  * One key file. One libp2p node. One client. One MCP server.
6
6
  * Two agents = two separate processes, each running this binary with their own CELLO_KEY_FILE.
7
7
  *
8
+ * AC-002 (DX-001): TTY detection — if stdin is a TTY, print install instructions and exit.
9
+ * AC-009 (DX-001): Lazy startup — MCP server connects and registers tools immediately;
10
+ * bootstrap fetch, directory dial, SQLCipher open, and loadPersistedState move to background.
11
+ * AC-001 (DX-001): Startup progress lines emitted to stderr at each step.
12
+ *
8
13
  * Environment variables:
9
14
  * CELLO_KEY_FILE Path to Ed25519 key file (default: ~/.cello/key)
10
15
  * CELLO_LISTEN_ADDR libp2p listen address (default: /ip4/0.0.0.0/tcp/0)
@@ -1 +1 @@
1
- {"version":3,"file":"cello-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/cello-mcp.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG"}
1
+ {"version":3,"file":"cello-mcp.d.ts","sourceRoot":"","sources":["../../src/bin/cello-mcp.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG"}
@@ -5,6 +5,11 @@
5
5
  * One key file. One libp2p node. One client. One MCP server.
6
6
  * Two agents = two separate processes, each running this binary with their own CELLO_KEY_FILE.
7
7
  *
8
+ * AC-002 (DX-001): TTY detection — if stdin is a TTY, print install instructions and exit.
9
+ * AC-009 (DX-001): Lazy startup — MCP server connects and registers tools immediately;
10
+ * bootstrap fetch, directory dial, SQLCipher open, and loadPersistedState move to background.
11
+ * AC-001 (DX-001): Startup progress lines emitted to stderr at each step.
12
+ *
8
13
  * Environment variables:
9
14
  * CELLO_KEY_FILE Path to Ed25519 key file (default: ~/.cello/key)
10
15
  * CELLO_LISTEN_ADDR libp2p listen address (default: /ip4/0.0.0.0/tcp/0)
@@ -25,6 +30,18 @@
25
30
  */
26
31
  import { homedir } from "node:os";
27
32
  import { createWriteStream, readFileSync } from "node:fs";
33
+ // AC-002 (DX-001): TTY detection — BEFORE anything else.
34
+ // If stdin is a TTY, the binary was run directly in a terminal, not as an MCP subprocess.
35
+ // Print install instructions to stdout and exit cleanly.
36
+ if (process.stdin.isTTY) {
37
+ process.stdout.write("This is a CELLO MCP server. It is designed to run as a subprocess of Claude Code.\n" +
38
+ "\n" +
39
+ "To install, run:\n" +
40
+ " claude mcp add cello npx --yes @cello-protocol/connect\n" +
41
+ "\n" +
42
+ "Then restart Claude Code to activate CELLO.\n");
43
+ process.exit(0);
44
+ }
28
45
  // Tee stderr to a log file for diagnostics (especially [sigstream] instrumentation)
29
46
  const stderrLog = createWriteStream("/tmp/cello-mcp-stderr.log", { flags: "a" });
30
47
  const origWrite = process.stderr.write.bind(process.stderr);
@@ -48,6 +65,9 @@ import { createClient, createMcpSessionServer, NetworkDirectoryNode, bootstrapNe
48
65
  import { LocalCloudStorageProvider, LocalClientStore } from "@cello-protocol/interfaces/stubs";
49
66
  import { pushChannelNotification } from "../notifications.js";
50
67
  import { resolveDirectoryUrl, fetchBootstrapMultiaddr } from "../config.js";
68
+ // AC-001 (DX-001): Startup progress — emit one line per step to stderr.
69
+ // Format: 'cello: <step>... <outcome>'
70
+ process.stderr.write("cello: starting...\n");
51
71
  const keyPath = process.env["CELLO_KEY_FILE"] ?? join(homedir(), ".cello", "key");
52
72
  const listenAddr = process.env["CELLO_LISTEN_ADDR"] ?? "/ip4/0.0.0.0/tcp/0";
53
73
  // AC-003 (REPOSPLIT-002): production directory endpoint baked in as default; overridable by env.
@@ -117,16 +137,13 @@ if (celloEnv === "local") {
117
137
  // Local: use filesystem-backed provider in ~/.cello/backups
118
138
  const localBackupDir = join(homedir(), ".cello", "backups");
119
139
  cloudStorageForBackup = new LocalCloudStorageProvider(localBackupDir);
120
- process.stderr.write(`cello-mcp: backup: using LocalCloudStorageProvider at ${localBackupDir}\n`);
121
140
  }
122
141
  else if (backupS3Bucket) {
123
142
  // Non-local with bucket configured: use S3
124
143
  cloudStorageForBackup = new S3CloudStorageProvider({ bucket: backupS3Bucket, region: awsRegion });
125
- process.stderr.write(`cello-mcp: backup: using S3CloudStorageProvider, bucket=${backupS3Bucket}, region=${awsRegion}\n`);
126
144
  }
127
145
  else {
128
146
  // Non-local without bucket: no backup configured — ClientBackup will log client.backup.not.configured
129
- process.stderr.write(`cello-mcp: backup: BACKUP_S3_BUCKET not set — backup not configured\n`);
130
147
  }
131
148
  // PERSIST-022: Construct ClientBackup (only if identity key is available)
132
149
  // A minimal logger for the composition root backup instance that writes to stderr.
@@ -135,7 +152,14 @@ const backupLogger = {
135
152
  debug: (event, ctx) => process.stderr.write(`cello-mcp: [debug] ${event} ${JSON.stringify(ctx ?? {})}\n`),
136
153
  info: (event, ctx) => process.stderr.write(`cello-mcp: [info] ${event} ${JSON.stringify(ctx ?? {})}\n`),
137
154
  warn: (event, ctx) => process.stderr.write(`cello-mcp: [warn] ${event} ${JSON.stringify(ctx ?? {})}\n`),
138
- error: (event, ctx) => process.stderr.write(`cello-mcp: [error] ${event} ${JSON.stringify(ctx ?? {})}\n`),
155
+ error: (event, errorOrContext, context) => {
156
+ if (errorOrContext instanceof Error) {
157
+ process.stderr.write(`cello-mcp: [error] ${event} ${JSON.stringify({ message: errorOrContext.message, stack: errorOrContext.stack, ...context })}\n`);
158
+ }
159
+ else {
160
+ process.stderr.write(`cello-mcp: [error] ${event} ${JSON.stringify(errorOrContext ?? {})}\n`);
161
+ }
162
+ },
139
163
  };
140
164
  // PERSIST-024 (CRIT-1): Derive dbKey for SQLCipher from identity key before zeroing.
141
165
  // The dbKey is derived via HKDF (RFC 5869) from the Ed25519 seed (SI-003: never stored).
@@ -196,162 +220,35 @@ if (identityKeyBytes) {
196
220
  identityKeyBytes.fill(0);
197
221
  identityKeyBytes = null;
198
222
  }
199
- // Parse directory endpoint from CELLO_DIRECTORY_MULTIADDR (if set).
200
- // When not set, auto-fetch the multiaddr from GET /bootstrap on the directory HTTP endpoint.
201
- // Pseudocode:
202
- // 1. If CELLO_DIRECTORY_MULTIADDR is set use it directly (existing behaviour)
203
- // 2. Else GET ${directoryUrl}/bootstrap with 5s timeout
204
- // a. Success + valid multiaddr → use it as if CELLO_DIRECTORY_MULTIADDR was set
205
- // b. 503 / network error / invalid JSON → log warning, continue without threshold signing
206
- let resolvedDirectoryMultiaddr = directoryMultiaddr;
207
- if (!resolvedDirectoryMultiaddr) {
208
- process.stderr.write(`cello-mcp: auto-discovering directory multiaddr from ${directoryUrl}/bootstrap\n`);
209
- // fetchFn defaults to global fetch; injectable in tests via config.ts
210
- const discovered = await fetchBootstrapMultiaddr(directoryUrl);
211
- if (discovered) {
212
- resolvedDirectoryMultiaddr = discovered;
213
- process.stderr.write(`cello-mcp: bootstrap fetch succeeded — multiaddr=${resolvedDirectoryMultiaddr}\n`);
214
- }
215
- else {
216
- process.stderr.write(`cello-mcp: bootstrap fetch failed — threshold signing unavailable\n`);
217
- }
218
- }
219
- let directoryEndpoint = undefined;
220
- if (resolvedDirectoryMultiaddr) {
221
- const parts = resolvedDirectoryMultiaddr.split("/");
222
- const p2pIndex = parts.findIndex((p) => p === "p2p");
223
- const peerId = p2pIndex !== -1 ? parts[p2pIndex + 1] : null;
224
- if (peerId) {
225
- directoryEndpoint = { peer_id: peerId, multiaddrs: [resolvedDirectoryMultiaddr] };
226
- }
227
- else {
228
- process.stderr.write("cello-mcp: directory multiaddr must include /p2p/<peer-id>\n");
229
- }
230
- }
231
- // Create and start single node
223
+ // AC-009 (DX-001): Lazy startup.
224
+ // Create the libp2p node synchronously (fast no network), then create the client and MCP server.
225
+ // The heavy operations (bootstrap fetch, directory dial, SQLCipher open, loadPersistedState)
226
+ // move to a background async task. Tools that need the directory/FROST await readyPromise.
227
+ // Create and start single node (fast — just opens a TCP port)
232
228
  const node = await createNode({ keyProvider: kp, listenAddresses: [listenAddr] });
233
229
  await node.start();
234
- // Bootstrap FROST key shares (test-only shortcut)
235
- // In production (M3+), real DKG ceremony replaces this.
236
- let thresholdSigner;
237
- let primaryPubkey;
238
- process.stderr.write(`cello-mcp: NODE_ENV=${process.env.NODE_ENV ?? "(unset)"} CELLO_DIRECTORY_URL=${directoryUrl} CELLO_DIRECTORY_MULTIADDR=${resolvedDirectoryMultiaddr ?? "(unset)"}\n`);
239
- {
240
- const ownPubkey = await kp.getPublicKey();
241
- if (resolvedDirectoryMultiaddr && directoryEndpoint) {
242
- process.stderr.write(`cello-mcp: bootstrapping FROST via network directory...\n`);
243
- try {
244
- await node.dial(directoryEndpoint.multiaddrs[0]);
245
- process.stderr.write(`cello-mcp: node dialed directory OK\n`);
246
- const networkNodes = [new NetworkDirectoryNode({
247
- id: `cello-test-node-0000`,
248
- node,
249
- directoryPeerId: directoryEndpoint.peer_id,
250
- directoryMultiaddrs: directoryEndpoint.multiaddrs,
251
- })];
252
- const bootstrap = await bootstrapNetworkKeyShares(ownPubkey, {
253
- threshold: 2,
254
- participants: 1,
255
- directoryNodes: networkNodes,
256
- });
257
- thresholdSigner = bootstrap.signer;
258
- primaryPubkey = bootstrap.primaryPubkey;
259
- process.stderr.write(`cello-mcp: FROST bootstrap OK, primaryPubkey=${Buffer.from(primaryPubkey).toString("hex").slice(0, 16)}...\n`);
260
- }
261
- catch (err) {
262
- const msg = err instanceof Error ? `${err.name}: ${err.message}\n${err.stack}` : JSON.stringify(err);
263
- process.stderr.write(`cello-mcp: FROST bootstrap FAILED: ${msg}\n`);
264
- process.stderr.write(`cello-mcp: continuing without threshold signer (already-registered agents use persistent signaling stream)\n`);
265
- }
266
- }
267
- else {
268
- process.stderr.write(`cello-mcp: no directory multiaddr configured — threshold signing unavailable\n`);
269
- }
270
- }
271
- // PERSIST-024 (CRIT-1): Construct and open the SQLCipher store, then wire ClientStatePersistence.
272
- // dbKey is derived from identityKeyBytes before it is zeroed (see above).
273
- let clientPersistence;
274
- let sqlCipherStore;
275
- if (dbKey) {
276
- try {
277
- sqlCipherStore = new SQLCipherClientStore(dbKey, {
278
- dbPath,
279
- agentId,
280
- env: celloEnv,
281
- logger: backupLogger,
282
- });
283
- await sqlCipherStore.open();
284
- clientPersistence = new ClientStatePersistence({
285
- store: sqlCipherStore,
286
- agentPubkey: agentId,
287
- keyFilePath: keyPath,
288
- logger: backupLogger,
289
- });
290
- // PERSIST-024 (MED-2): expose to backup setMetadata/getMetadata callbacks (late binding)
291
- clientPersistenceRef = clientPersistence;
292
- // Note: upsertAgent() is NOT called here. loadPersistedState() calls it after all
293
- // state loading completes — that is the authoritative call site that updates last_seen_at
294
- // only on a fully successful startup.
295
- process.stderr.write(`cello-mcp: persistence: SQLCipher store opened at ${dbPath}\n`);
296
- }
297
- catch (err) {
298
- const msg = err instanceof Error ? err.message : String(err);
299
- // Detect native module load failures (missing pre-built binary, ABI mismatch, missing system libs).
300
- const isNativeModuleError = msg.includes("Cannot find module") ||
301
- msg.includes("was compiled against a different Node.js version") ||
302
- msg.includes("NODE_MODULE_VERSION") ||
303
- msg.includes("invalid ELF header") ||
304
- msg.includes("dlopen") ||
305
- msg.includes("libcrypto") ||
306
- msg.includes("libssl");
307
- if (isNativeModuleError) {
308
- const platform = process.platform;
309
- process.stderr.write(`cello-mcp: SQLCipher failed to load: ${msg}\n`);
310
- if (platform === "win32") {
311
- process.stderr.write(`cello-mcp: Windows requires a manual SQLCipher install.\n`);
312
- process.stderr.write(`cello-mcp: Download and install SQLCipher from https://www.zetetic.net/sqlcipher/\n`);
313
- process.stderr.write(`cello-mcp: Then re-run: npx @cello-protocol/connect\n`);
314
- }
315
- else if (platform === "linux") {
316
- process.stderr.write(`cello-mcp: Missing OpenSSL build dependencies on Linux.\n`);
317
- process.stderr.write(`cello-mcp: Run: sudo apt-get install build-essential libssl-dev\n`);
318
- process.stderr.write(`cello-mcp: Then re-run: npx @cello-protocol/connect\n`);
319
- }
320
- else {
321
- // macOS: Xcode Command Line Tools (~500MB) are required to compile SQLCipher.
322
- process.stderr.write(`cello-mcp: Xcode Command Line Tools are required on macOS.\n`);
323
- process.stderr.write(`cello-mcp: Run: xcode-select --install\n`);
324
- process.stderr.write(`cello-mcp: Then re-run: npx @cello-protocol/connect\n`);
325
- }
326
- process.stderr.write(`cello-mcp: Continuing without persistence — data will not survive restarts.\n`);
327
- }
328
- else {
329
- process.stderr.write(`cello-mcp: persistence: failed to open SQLCipher store — ${msg}\n`);
330
- }
331
- // Non-fatal: client continues without persistence
332
- clientPersistence = undefined;
333
- sqlCipherStore = undefined;
334
- }
335
- }
336
- else {
337
- process.stderr.write(`cello-mcp: persistence: identity key not available — SQLCipher store disabled\n`);
338
- }
339
230
  // Late-bound server reference — set after createMcpServer returns.
340
231
  // The closure captures the box; notifications fired before server is assigned are dropped.
341
232
  let mcpServer;
342
- // Create single client
233
+ // AC-009: readySignal — resolved when background init completes (or fails).
234
+ // Tools that require the directory await this with a 10s timeout.
235
+ let readyResolve = () => { };
236
+ let readyReject = () => { };
237
+ const readyPromise = new Promise((resolve, reject) => {
238
+ readyResolve = resolve;
239
+ readyReject = reject;
240
+ });
241
+ // Create client with no thresholdSigner initially — background task populates it.
242
+ // directoryEndpoint is also populated in the background task.
343
243
  const client = createClient(node, kp, {
344
- thresholdSigner,
345
- directoryEndpoint,
346
- persistence: clientPersistence,
244
+ thresholdSigner: undefined,
245
+ directoryEndpoint: undefined,
246
+ persistence: undefined, // wired in background task after SQLCipher opens
347
247
  onMessageQueued: (senderHex) => {
348
248
  if (mcpServer)
349
249
  void pushChannelNotification(mcpServer, senderHex);
350
250
  },
351
251
  });
352
- if (primaryPubkey) {
353
- client.setPrimaryPubkey(primaryPubkey);
354
- }
355
252
  // Create server with single identity.
356
253
  // PERSIST-017: checkpointStatusProvider is not available in the cello-mcp binary
357
254
  // (the client binary has no access to the directory's MmrStore). The provider is
@@ -359,27 +256,252 @@ if (primaryPubkey) {
359
256
  // Passing undefined is a safe fallback — the tools return M1 stub responses.
360
257
  // PERSIST-022: clientBackupInstance passed so cello_backup/cello_restore are registered
361
258
  // inside createMcpSessionServer (single canonical registration path).
362
- const server = createMcpSessionServer(node, client, kp, { clientBackup: clientBackupInstance });
363
- mcpServer = server;
364
- // PERSIST-024 (CRIT-1): Load persisted state before accepting any MCP tool calls.
365
- // This must happen before server.connect() so the first tool call sees restored state.
366
- await client.loadPersistedState();
367
- // PERSIST-024 AC-008: Build an in-memory AgentHashQueue and populate it from the pending_hashes
368
- // DB table. Using LocalClientStore (in-memory) avoids the SQLCipherClientStore.set() throw.
369
- // The queue is wired into the client so #reconnectRelayStream can check it on relay reconnect.
370
- const loadedPendingHashes = client.getLoadedPendingHashes();
371
- const hashQueue = new AgentHashQueue({
372
- store: new LocalClientStore(),
373
- agentId,
259
+ const server = createMcpSessionServer(node, client, kp, {
260
+ clientBackup: clientBackupInstance,
261
+ // AC-007 (DX-001): pass directoryUrl so agent_id lookup works in tool handlers
262
+ directoryUrl,
263
+ // AC-009 (DX-001): pass readyPromise so tools can await background init (up to 10s)
264
+ readyPromise,
265
+ // Wire logger so observability events (e.g. client.directory.agent_lookup.failed) are emitted
374
266
  logger: backupLogger,
375
267
  });
376
- if (loadedPendingHashes.length > 0) {
377
- await hashQueue.loadPending(loadedPendingHashes);
378
- process.stderr.write(`cello-mcp: ${loadedPendingHashes.length} pending hash(es) loaded into AgentHashQueue relay resubmission will occur on reconnect\n`);
379
- }
380
- // Wire queue into client so relay reconnect can access pending hashes (AC-008)
381
- client.setHashQueue(hashQueue);
382
- // Connect stdio transport and register handler
268
+ mcpServer = server;
269
+ // AC-009 (DX-001): Connect stdio transport NOW — before any network operations.
270
+ // This ensures tools/list responds within 2s of process start.
383
271
  await server.connect(new StdioServerTransport());
384
272
  await client.registerHandler();
273
+ // AC-009 (DX-001): Background init task — runs concurrently with MCP tool calls.
274
+ // All network and disk I/O happens here, not on the critical path of server startup.
275
+ void (async () => {
276
+ try {
277
+ // Step 1: Open SQLCipher database
278
+ process.stderr.write("cello: opening database...");
279
+ let clientPersistence;
280
+ let sqlCipherStore;
281
+ const t0Db = Date.now();
282
+ if (dbKey) {
283
+ try {
284
+ sqlCipherStore = new SQLCipherClientStore(dbKey, {
285
+ dbPath,
286
+ agentId,
287
+ env: celloEnv,
288
+ logger: backupLogger,
289
+ });
290
+ await sqlCipherStore.open();
291
+ clientPersistence = new ClientStatePersistence({
292
+ store: sqlCipherStore,
293
+ agentPubkey: agentId,
294
+ keyFilePath: keyPath,
295
+ logger: backupLogger,
296
+ });
297
+ // PERSIST-024 (MED-2): expose to backup setMetadata/getMetadata callbacks (late binding)
298
+ clientPersistenceRef = clientPersistence;
299
+ // Wire persistence into client
300
+ client.setPersistence?.(clientPersistence);
301
+ const durationMs = Date.now() - t0Db;
302
+ // AC-001: report schema version and table count when available
303
+ const schemaInfo = sqlCipherStore.getSchemaInfo?.();
304
+ if (schemaInfo) {
305
+ process.stderr.write(` ok (V${schemaInfo.version}, ${schemaInfo.tableCount} tables)\n`);
306
+ }
307
+ else {
308
+ process.stderr.write(` ok (${durationMs}ms)\n`);
309
+ }
310
+ backupLogger.info("client.startup.progress", { step: "opening_database", outcome: "ok", durationMs });
311
+ }
312
+ catch (err) {
313
+ const msg = err instanceof Error ? err.message : String(err);
314
+ process.stderr.write(` failed: ${msg}\n`);
315
+ backupLogger.warn("client.startup.progress", { step: "opening_database", outcome: "failed", reason: msg, durationMs: Date.now() - t0Db });
316
+ // Detect native module load failures
317
+ const isNativeModuleError = msg.includes("Cannot find module") ||
318
+ msg.includes("was compiled against a different Node.js version") ||
319
+ msg.includes("NODE_MODULE_VERSION") ||
320
+ msg.includes("invalid ELF header") ||
321
+ msg.includes("dlopen") ||
322
+ msg.includes("libcrypto") ||
323
+ msg.includes("libssl");
324
+ if (isNativeModuleError) {
325
+ const platform = process.platform;
326
+ if (platform === "win32") {
327
+ process.stderr.write(`cello-mcp: Windows is not yet supported in the CELLO beta.\n`);
328
+ process.stderr.write(`cello-mcp: Windows support is on the roadmap. Follow https://github.com/Mygentic-AI/cello-client for updates.\n`);
329
+ }
330
+ else if (platform === "linux") {
331
+ process.stderr.write(`cello-mcp: Missing OpenSSL build dependencies on Linux.\n`);
332
+ process.stderr.write(`cello-mcp: Run: sudo apt-get install build-essential libssl-dev\n`);
333
+ process.stderr.write(`cello-mcp: Then re-run: npx --yes @cello-protocol/connect\n`);
334
+ }
335
+ else {
336
+ process.stderr.write(`cello-mcp: Xcode Command Line Tools are required on macOS.\n`);
337
+ process.stderr.write(`cello-mcp: Run: xcode-select --install\n`);
338
+ process.stderr.write(`cello-mcp: Then re-run: npx --yes @cello-protocol/connect\n`);
339
+ }
340
+ process.stderr.write(`cello-mcp: Continuing without persistence — data will not survive restarts.\n`);
341
+ }
342
+ // Non-fatal: client continues without persistence
343
+ clientPersistence = undefined;
344
+ sqlCipherStore = undefined;
345
+ }
346
+ }
347
+ else {
348
+ process.stderr.write(` failed: identity key not available\n`);
349
+ backupLogger.warn("client.startup.progress", { step: "opening_database", outcome: "failed", reason: "identity key not available", durationMs: Date.now() - t0Db });
350
+ }
351
+ // Step 2: Fetch directory address
352
+ let resolvedDirectoryMultiaddr = directoryMultiaddr;
353
+ let directoryEndpoint = undefined;
354
+ if (!resolvedDirectoryMultiaddr) {
355
+ process.stderr.write(`cello: fetching directory address...`);
356
+ const t0Bootstrap = Date.now();
357
+ try {
358
+ const discovered = await fetchBootstrapMultiaddr(directoryUrl);
359
+ if (discovered) {
360
+ resolvedDirectoryMultiaddr = discovered;
361
+ const parts = resolvedDirectoryMultiaddr.split("/");
362
+ const p2pIndex = parts.findIndex((p) => p === "p2p");
363
+ const peerId = p2pIndex !== -1 ? parts[p2pIndex + 1] : null;
364
+ const shortPeerId = peerId ? peerId.slice(0, 20) + "..." : "(unknown)";
365
+ process.stderr.write(` ok (${shortPeerId})\n`);
366
+ backupLogger.info("client.startup.progress", { step: "fetching_directory_address", outcome: "ok", durationMs: Date.now() - t0Bootstrap });
367
+ }
368
+ else {
369
+ const reason = "bootstrap endpoint unreachable";
370
+ backupLogger.warn("client.bootstrap.fetch.failed", { directoryUrl, reason: "endpoint_returned_null", durationMs: Date.now() - t0Bootstrap });
371
+ process.stderr.write(` failed: ${reason}\n`);
372
+ backupLogger.warn("client.startup.progress", { step: "fetching_directory_address", outcome: "failed", reason, durationMs: Date.now() - t0Bootstrap });
373
+ }
374
+ }
375
+ catch (err) {
376
+ const msg = err instanceof Error ? err.message : String(err);
377
+ backupLogger.warn("client.bootstrap.fetch.failed", { directoryUrl, reason: msg, durationMs: Date.now() - t0Bootstrap });
378
+ process.stderr.write(` failed: ${msg}\n`);
379
+ backupLogger.warn("client.startup.progress", { step: "fetching_directory_address", outcome: "failed", reason: msg, durationMs: Date.now() - t0Bootstrap });
380
+ }
381
+ }
382
+ else {
383
+ // CELLO_DIRECTORY_MULTIADDR is set — use it directly
384
+ process.stderr.write(`cello: fetching directory address... ok (from CELLO_DIRECTORY_MULTIADDR)\n`);
385
+ backupLogger.info("client.startup.progress", { step: "fetching_directory_address", outcome: "ok", durationMs: 0 });
386
+ }
387
+ if (resolvedDirectoryMultiaddr) {
388
+ const parts = resolvedDirectoryMultiaddr.split("/");
389
+ const p2pIndex = parts.findIndex((p) => p === "p2p");
390
+ const peerId = p2pIndex !== -1 ? parts[p2pIndex + 1] : null;
391
+ if (peerId) {
392
+ directoryEndpoint = { peer_id: peerId, multiaddrs: [resolvedDirectoryMultiaddr] };
393
+ }
394
+ else {
395
+ // Multiaddr is present but lacks /p2p/<peer-id> — setDirectoryEndpoint will not be called.
396
+ backupLogger.warn("client.startup.multiaddr_parse.failed", { reason: "multiaddr_missing_peer_id", multiaddr: resolvedDirectoryMultiaddr });
397
+ process.stderr.write("cello-mcp: directory multiaddr must include /p2p/<peer-id>\n");
398
+ }
399
+ }
400
+ // AC-003 (DX-001): Set directoryEndpoint on the client BEFORE loadPersistedState() so that
401
+ // loadPersistedState() can populate directoryNodeStubs in the reconstructed FrostThresholdSigner.
402
+ // Only called when directoryEndpoint is parsed successfully (requires /p2p/<peer-id> in the
403
+ // multiaddr). If multiaddr lacks peer ID, loadPersistedState() will reconstruct the
404
+ // FrostThresholdSigner with directoryNodeStubs: undefined — ceremonies will fail until the
405
+ // agent reconnects with a valid multiaddr.
406
+ if (directoryEndpoint) {
407
+ client.setDirectoryEndpoint?.(directoryEndpoint);
408
+ }
409
+ // Step 3: Load agent state (moved BEFORE directory connection/bootstrap)
410
+ // Registered agents will have their FrostThresholdSigner reconstructed from DB here.
411
+ // directoryEndpoint is already set, so directoryNodeStubs will be populated.
412
+ process.stderr.write("cello: loading agent state...");
413
+ const t0LoadState = Date.now();
414
+ try {
415
+ await client.loadPersistedState();
416
+ process.stderr.write(" ok\n");
417
+ backupLogger.info("client.startup.progress", { step: "loading_agent_state", outcome: "ok", durationMs: Date.now() - t0LoadState });
418
+ }
419
+ catch (err) {
420
+ const msg = err instanceof Error ? err.message : String(err);
421
+ process.stderr.write(` failed: ${msg}\n`);
422
+ backupLogger.warn("client.startup.progress", { step: "loading_agent_state", outcome: "failed", reason: msg, durationMs: Date.now() - t0LoadState });
423
+ throw err;
424
+ }
425
+ // PERSIST-024 AC-008: Build AgentHashQueue
426
+ const loadedPendingHashes = client.getLoadedPendingHashes();
427
+ const hashQueue = new AgentHashQueue({
428
+ store: new LocalClientStore(),
429
+ agentId,
430
+ logger: backupLogger,
431
+ });
432
+ if (loadedPendingHashes.length > 0) {
433
+ await hashQueue.loadPending(loadedPendingHashes);
434
+ process.stderr.write(`cello-mcp: ${loadedPendingHashes.length} pending hash(es) loaded into AgentHashQueue\n`);
435
+ }
436
+ client.setHashQueue(hashQueue);
437
+ // Check if the agent is already registered (FROST share was loaded from DB).
438
+ // If so, skip bootstrap — the signer is already reconstructed from the DB.
439
+ const regStateAfterLoad = typeof client.getRegistrationState === "function"
440
+ ? client.getRegistrationState()
441
+ : null;
442
+ // Step 4: Connect to directory and bootstrap ONLY if not already registered
443
+ let thresholdSigner;
444
+ let primaryPubkey;
445
+ const t0Connect = Date.now();
446
+ if (resolvedDirectoryMultiaddr && directoryEndpoint) {
447
+ process.stderr.write(`cello: connecting to directory...`);
448
+ try {
449
+ await node.dial(directoryEndpoint.multiaddrs[0]);
450
+ if (!regStateAfterLoad) {
451
+ // Not yet registered — run bootstrap to initialize FROST key shares.
452
+ // Registered agents already have their signer from loadPersistedState().
453
+ const ownPubkey = await kp.getPublicKey();
454
+ const networkNodes = [new NetworkDirectoryNode({
455
+ id: `cello-test-node-0000`,
456
+ node,
457
+ directoryPeerId: directoryEndpoint.peer_id,
458
+ directoryMultiaddrs: directoryEndpoint.multiaddrs,
459
+ })];
460
+ const bootstrap = await bootstrapNetworkKeyShares(ownPubkey, {
461
+ threshold: 2,
462
+ participants: 1,
463
+ directoryNodes: networkNodes,
464
+ });
465
+ thresholdSigner = bootstrap.signer;
466
+ primaryPubkey = bootstrap.primaryPubkey;
467
+ }
468
+ process.stderr.write(` ok\n`);
469
+ backupLogger.info("client.startup.progress", { step: "connecting_to_directory", outcome: "ok", durationMs: Date.now() - t0Connect });
470
+ }
471
+ catch (err) {
472
+ const msg = err instanceof Error ? `${err.name}: ${err.message}` : JSON.stringify(err);
473
+ process.stderr.write(` failed: ${msg}\n`);
474
+ process.stderr.write(`cello-mcp: continuing without threshold signer\n`);
475
+ backupLogger.warn("client.startup.progress", { step: "connecting_to_directory", outcome: "failed", reason: msg, durationMs: Date.now() - t0Connect });
476
+ }
477
+ }
478
+ else {
479
+ process.stderr.write(`cello: connecting to directory... failed: no multiaddr configured\n`);
480
+ backupLogger.warn("client.startup.progress", { step: "connecting_to_directory", outcome: "failed", reason: "no multiaddr configured", durationMs: Date.now() - t0Connect });
481
+ }
482
+ // Wire threshold signer into client only when bootstrap ran (unregistered agents).
483
+ // Registered agents already have their signer from loadPersistedState().
484
+ if (thresholdSigner) {
485
+ client.setThresholdSigner?.(thresholdSigner);
486
+ }
487
+ if (primaryPubkey) {
488
+ client.setPrimaryPubkey(primaryPubkey);
489
+ }
490
+ // Step 5: Emit final ready message (use regStateAfterLoad from loadPersistedState)
491
+ if (regStateAfterLoad) {
492
+ process.stderr.write(`cello: ready (registered as ${regStateAfterLoad.agent_id})\n`);
493
+ }
494
+ else {
495
+ process.stderr.write(`cello: ready (not registered — call cello_setup_guidance for setup)\n`);
496
+ }
497
+ // durationMs: 0 — "ready" is a completion marker, not a timed operation.
498
+ backupLogger.info("client.startup.progress", { step: "ready", outcome: "ok", durationMs: 0 });
499
+ readyResolve();
500
+ }
501
+ catch (err) {
502
+ const msg = err instanceof Error ? err.message : String(err);
503
+ process.stderr.write(`cello-mcp: background init failed: ${msg}\n`);
504
+ readyReject(err);
505
+ }
506
+ })();
385
507
  //# sourceMappingURL=cello-mcp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cello-mcp.js","sourceRoot":"","sources":["../../src/bin/cello-mcp.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE1D,oFAAoF;AACpF,MAAM,SAAS,GAAG,iBAAiB,CAAC,2BAA2B,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;AACjF,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAgC,CAAC;AAC3F,uDAAuD;AACvD,8FAA8F;AAC9F,OAAO,CAAC,MAAM,CAAC,KAAK,GAAG,CACrB,KAA0B,EAC1B,YAA8D,EAC9D,EAAiC,EACxB,EAAE;IACX,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE,CAAC;QACvC,OAAO,SAAS,CAAC,KAAe,EAAE,YAAY,CAAC,CAAC;IAClD,CAAC;SAAM,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC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CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/connect",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -25,23 +25,23 @@
25
25
  "package.json",
26
26
  "SKILL.md"
27
27
  ],
28
+ "scripts": {
29
+ "typecheck": "tsc --build",
30
+ "test": "vitest run"
31
+ },
28
32
  "dependencies": {
33
+ "@cello-protocol/client": "workspace:*",
34
+ "@cello-protocol/crypto": "workspace:*",
29
35
  "@cello-protocol/interfaces": "0.0.3",
36
+ "@cello-protocol/transport": "workspace:*",
30
37
  "@libp2p/peer-id": "^6.0.8",
31
38
  "@modelcontextprotocol/sdk": "^1.29.0",
32
- "zod": "^4.4.2",
33
- "@cello-protocol/client": "0.0.5",
34
- "@cello-protocol/crypto": "0.0.4",
35
- "@cello-protocol/transport": "0.0.3"
39
+ "zod": "^4.4.2"
36
40
  },
37
41
  "devDependencies": {
38
42
  "@claude-flow/testing": "3.0.0-alpha.6",
39
43
  "@types/node": "^25.6.2",
40
44
  "cbor-x": "^1.6.0",
41
45
  "it-length-prefixed": "^10.0.1"
42
- },
43
- "scripts": {
44
- "typecheck": "tsc --build",
45
- "test": "vitest run"
46
46
  }
47
47
  }