@murmurv2/cli 2.13.0 → 2.14.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@murmurv2/cli",
3
- "version": "2.13.0",
3
+ "version": "2.14.0",
4
4
  "type": "module",
5
5
  "main": "runtime/packages/setup/dist/src/index.js",
6
6
  "types": "runtime/packages/setup/dist/src/index.d.ts",
@@ -14,9 +14,9 @@
14
14
  "dependencies": {
15
15
  "@iarna/toml": "^2.2.5",
16
16
  "@murmurv2/broker-nats": "^0.3.7",
17
- "@murmurv2/core": "^0.6.6",
17
+ "@murmurv2/core": "^0.6.7",
18
18
  "@murmurv2/federation": "^0.2.2",
19
- "@murmurv2/mcp-server": "^0.2.4",
19
+ "@murmurv2/mcp-server": "^0.2.5",
20
20
  "@murmurv2/security": "^0.1.3",
21
21
  "nats": "^2.28.2",
22
22
  "ws": "^8.21.0"
Binary file
@@ -1,26 +1,26 @@
1
1
  {
2
2
  "schema": "murmur.npm-cli/1",
3
- "sourceCommit": "7d92d599eaf951598c59202ee289fc54e4957a53",
3
+ "sourceCommit": "c3805f0bf4e14cadd8f02edca8fa7151e1136fe6",
4
4
  "sourceDirty": false,
5
- "declaredVersion": "2.13.0",
6
- "sourceLockSha256": "c57e6a354fa6e33b7b1879198863afcdb5221c421b24a7ca97af9af25375c264",
5
+ "declaredVersion": "2.14.0",
6
+ "sourceLockSha256": "6059c57db87408054aee22ab61a1ed97eeac75f7f76c17447675c06951cca2c1",
7
7
  "windowsHelper": {
8
8
  "component": "windows-service",
9
9
  "platform": "windows",
10
10
  "arch": "amd64",
11
- "version": "2.13.0",
12
- "sourceCommit": "7d92d599eaf951598c59202ee289fc54e4957a53",
13
- "sha256": "f62d1c25f162eeed552dd90aa003eb0f2cb6ca101369bdf3d2f0a3e9c05ca06c",
11
+ "version": "2.14.0",
12
+ "sourceCommit": "c3805f0bf4e14cadd8f02edca8fa7151e1136fe6",
13
+ "sha256": "2f1760eb96f0aca5c2d224e586689628549010e505cb20081c459eb4036bf40e",
14
14
  "size": 2964480,
15
15
  "nativeVersionExecuted": false
16
16
  },
17
17
  "files": {
18
18
  "package.json": {
19
- "sha256": "1d2ac8aef5d547728d0908c1d4b1ceee8da72c1994761a872818a424b1952c4c",
19
+ "sha256": "afafa962e506ad8e429ddc0c38dc529f6a330a2cea7671c3ba98cb6e65d297d1",
20
20
  "size": 83
21
21
  },
22
22
  "packages/setup/package.json": {
23
- "sha256": "37b3b230561ac452a7c27ab9fa5b6e641290552b1b79981191a4855cade5900c",
23
+ "sha256": "fdeba35d2c66ec9ecb5c76dddacca65e2670967f4e0b0fc980652a24d64a6104",
24
24
  "size": 132
25
25
  },
26
26
  "packages/setup/dist/src/appdata.d.ts": {
@@ -31,6 +31,14 @@
31
31
  "sha256": "1c1627aa1724a56dc6631d728b56f7715de80d9f8b730cf69e7d0afbdf5b5ddc",
32
32
  "size": 2678
33
33
  },
34
+ "packages/setup/dist/src/autoreply.d.ts": {
35
+ "sha256": "a75e617eed9a9897d20da662ddf4232768848530d4ad2ef8c58de687550737f0",
36
+ "size": 654
37
+ },
38
+ "packages/setup/dist/src/autoreply.js": {
39
+ "sha256": "9abfd46a37bc9105107ed88f45872b316a132e8726478312169db286da46fc8c",
40
+ "size": 3443
41
+ },
34
42
  "packages/setup/dist/src/backups.d.ts": {
35
43
  "sha256": "9e293568d06f7d27867922c35d05ed7b533f9fa380383a3f83560cdcf025380d",
36
44
  "size": 1182
@@ -68,24 +76,24 @@
68
76
  "size": 462
69
77
  },
70
78
  "packages/setup/dist/src/cli.js": {
71
- "sha256": "5a3e753151f26700cae82f3f8692f9fee4ccf667932f42664a403c2dc542b91d",
72
- "size": 16484
79
+ "sha256": "76ebae7e65bfe8cb23625abeeb3ab104703bd00a46c4d4b2539675eb5b40cabe",
80
+ "size": 19889
73
81
  },
74
82
  "packages/setup/dist/src/clients.d.ts": {
75
- "sha256": "9c90a80706808f7e38aa7f6790491a434594e51fa5176f7d46c753e11637771f",
76
- "size": 3534
83
+ "sha256": "56e7b33649aea5feaa64ef3b9800a92d44b80b4b20aa200035eb71c9570fdd37",
84
+ "size": 3644
77
85
  },
78
86
  "packages/setup/dist/src/clients.js": {
79
87
  "sha256": "75cb578869a430a46a13e327f182dbbabd1b0e8ab34d48245c4f21762e69eb11",
80
88
  "size": 22524
81
89
  },
82
90
  "packages/setup/dist/src/commands.d.ts": {
83
- "sha256": "c930b1058ff2d45be38f74df2251a722fe0f1599b5d7afbc6bf74d17a780633c",
84
- "size": 1417
91
+ "sha256": "4640c704a642c3ffb3cb391290243ed415c97548168aae6fa99954f21b6b5117",
92
+ "size": 1457
85
93
  },
86
94
  "packages/setup/dist/src/commands.js": {
87
- "sha256": "fcfbafe2fd83eb69f0d6c5f1fe3dfec14d34e0235b98180d20787598c59481aa",
88
- "size": 6482
95
+ "sha256": "b56371bff3deff9a43230aa3e72fb6d0ecd5eaafab83e09e5e4c03d9e00bd7cb",
96
+ "size": 7204
89
97
  },
90
98
  "packages/setup/dist/src/config.d.ts": {
91
99
  "sha256": "13425d2fe6d9c6b34405ea9428a31cdc38ecee0816ae273e191bbd636a374eca",
@@ -96,12 +104,20 @@
96
104
  "size": 14165
97
105
  },
98
106
  "packages/setup/dist/src/connect.d.ts": {
99
- "sha256": "28281572d2e241c84033426549cf6ca1217c11f595d9a8a9be9203d3faa0f8bc",
100
- "size": 4364
107
+ "sha256": "b320b9c6412d9174073e66dbb4bd9f59b7606f401d0876bdf7710e8488301299",
108
+ "size": 4474
101
109
  },
102
110
  "packages/setup/dist/src/connect.js": {
103
- "sha256": "d808c124eb477ffe9c0c6d32261fd83dac2bf600f28f29d0302b99b6d1ee2851",
104
- "size": 6503
111
+ "sha256": "7d3c4faf86c6f50e953f949bb56b6e8b8ecd2b208813f27808ce3c0705ef869b",
112
+ "size": 6621
113
+ },
114
+ "packages/setup/dist/src/conversations.d.ts": {
115
+ "sha256": "a75bbd04f430d19657c3683b631eb53ed3fec6fe712f78eb400bcdb8119f4bea",
116
+ "size": 7499
117
+ },
118
+ "packages/setup/dist/src/conversations.js": {
119
+ "sha256": "f00101720f1467066c39318d99f5eadef6ce91d108aedec2042eb8458a23c652",
120
+ "size": 37861
105
121
  },
106
122
  "packages/setup/dist/src/doctor.d.ts": {
107
123
  "sha256": "35697caa5300f299f2eec43131f148c6bcd94a6057c335508b13991f2e69f4c9",
@@ -180,16 +196,16 @@
180
196
  "size": 728
181
197
  },
182
198
  "packages/setup/dist/src/platform/darwin.js": {
183
- "sha256": "b91df6b457f5708280919638ed10ae658b51ea91fdf93587f0418f4c716cc77c",
184
- "size": 26807
199
+ "sha256": "2009a01706620f61d36b70a8bca34d9547cb84e4f673d2779be5759a1970a1ca",
200
+ "size": 27684
185
201
  },
186
202
  "packages/setup/dist/src/platform/linux.d.ts": {
187
203
  "sha256": "989d39cc9d5c73c9dae7dc926344fa2c6dde5e80f0a8d7657d5ce1f774da9b44",
188
204
  "size": 375
189
205
  },
190
206
  "packages/setup/dist/src/platform/linux.js": {
191
- "sha256": "df78ba3effc70c65becc7c4237301ac3be7a5f5b50e3e0b73edcb7cfb8dc35db",
192
- "size": 15483
207
+ "sha256": "42bd656b84769fd1702947e54a0d0f9e86fcd175ca425c722e52c87034ec06f0",
208
+ "size": 16304
193
209
  },
194
210
  "packages/setup/dist/src/platform/profile-usage.d.ts": {
195
211
  "sha256": "21a3bd4d6233ba788461c7850007aec0c01aac2270d5b2dc2873dfdd27e5fe7d",
@@ -204,8 +220,8 @@
204
220
  "size": 1123
205
221
  },
206
222
  "packages/setup/dist/src/platform/windows.js": {
207
- "sha256": "af8026e1aa75e3e05be2598d1a565241830ce2ed85da2dae58148de759dbd829",
208
- "size": 15703
223
+ "sha256": "5b9948077fc57ef813fe7228afb7edb57eca1989b894daec1877ac56d96d7c65",
224
+ "size": 16889
209
225
  },
210
226
  "packages/setup/dist/src/private-file.d.ts": {
211
227
  "sha256": "0e3101e489f780da4026e11deb4a91b76a2473697b5d30835b54a1ef3c969765",
@@ -248,8 +264,8 @@
248
264
  "size": 18289
249
265
  },
250
266
  "packages/setup/dist/src/types.d.ts": {
251
- "sha256": "2df31397e719e526b9e395630a5b920d744187935bf06bbee65ae4b1efa4e22e",
252
- "size": 2763
267
+ "sha256": "c7af5899e33a2ae287cdcaf7829dc97f7d17132455f28f3071f22b916ba0e24b",
268
+ "size": 2785
253
269
  },
254
270
  "packages/setup/dist/src/types.js": {
255
271
  "sha256": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
@@ -304,12 +320,12 @@
304
320
  "size": 63
305
321
  },
306
322
  "scripts/murmur-daemon.mjs": {
307
- "sha256": "a92bef78ca2557c18a843902778bdc1e873a563ae4e98fd8201e02d586df6a9f",
308
- "size": 25096
323
+ "sha256": "6681cc7e4d9242b931e41214ba72b1efc83f7bdadaa2114d909f2b81526487c7",
324
+ "size": 25344
309
325
  },
310
326
  "scripts/murmur-shell-send.mjs": {
311
- "sha256": "76de516514519861f7958b4fa49ef3f39bce8f7a275a53d21bb5c7053a82a249",
312
- "size": 5194
327
+ "sha256": "333791aa4884e6ceeaf2bd182fab4b4cb993f00024779601e46b85de7a857abc",
328
+ "size": 5494
313
329
  },
314
330
  "scripts/murmur-auth-token.mjs": {
315
331
  "sha256": "5c95a20526fc29448d3d3a8fba4d2a5f29435ec981e93af8d04adf1780de2adb",
@@ -324,16 +340,20 @@
324
340
  "size": 10755
325
341
  },
326
342
  "scripts/codex-app-server-wake.mjs": {
327
- "sha256": "a6ee04dd2c3df3ff7e2e4b012e9fb24b09e2886e61dba4f6546c6cb1b050e08b",
328
- "size": 35235
343
+ "sha256": "36b3e9b27856b04e21b1c3821f9694a4b934d87a412942c418c02d46cea1a468",
344
+ "size": 36767
345
+ },
346
+ "scripts/owner-review-store.mjs": {
347
+ "sha256": "a5a69cf378fec959ed971bd987aff0686a9ec8196bee8d8b0fedbc88415a569c",
348
+ "size": 2965
329
349
  },
330
350
  "scripts/murmur-jetstream-advisory.mjs": {
331
351
  "sha256": "0d0f235d5fb4f0eec212618e0128aad0e67d63796f650064b22de4b6032dc265",
332
352
  "size": 1701
333
353
  },
334
354
  "scripts/wake-monitor.mjs": {
335
- "sha256": "f51f1c6f7653d60d5eb9877b4a17f1d69fd6c75a0b65cf56c9c26767cd2378bf",
336
- "size": 33488
355
+ "sha256": "926044e599df14eac03f8f568e93aaf31412dca0dcb14936c6be8e03ec735c8e",
356
+ "size": 36127
337
357
  },
338
358
  "scripts/lease.mjs": {
339
359
  "sha256": "c380ec90c0b5cef4d010df4d59793f86f0dc319c82039997c3d8884a9e92f56e",
@@ -404,7 +424,7 @@
404
424
  "size": 705
405
425
  },
406
426
  "bin/murmur-svc.exe": {
407
- "sha256": "f62d1c25f162eeed552dd90aa003eb0f2cb6ca101369bdf3d2f0a3e9c05ca06c",
427
+ "sha256": "2f1760eb96f0aca5c2d224e586689628549010e505cb20081c459eb4036bf40e",
408
428
  "size": 2964480
409
429
  }
410
430
  }
@@ -1 +1 @@
1
- {"name":"murmur","private":true,"version":"2.13.0","engines":{"node":">=22.13.0"}}
1
+ {"name":"murmur","private":true,"version":"2.14.0","engines":{"node":">=22.13.0"}}
@@ -0,0 +1,23 @@
1
+ import type { ServiceContext } from './types.js';
2
+ export declare function showAutoreply(context: ServiceContext): Promise<{
3
+ schema: string;
4
+ agentId: string;
5
+ installed: boolean;
6
+ peers: {
7
+ peer: string;
8
+ enabled: boolean;
9
+ supported: boolean;
10
+ updatedAt: string | null;
11
+ }[];
12
+ }>;
13
+ export declare function setAutoreply(context: ServiceContext, peer: string, enabled: boolean, expectedAgent: string): Promise<{
14
+ schema: string;
15
+ agentId: string;
16
+ installed: boolean;
17
+ peers: {
18
+ peer: string;
19
+ enabled: boolean;
20
+ supported: boolean;
21
+ updatedAt: string | null;
22
+ }[];
23
+ }>;
@@ -0,0 +1,71 @@
1
+ import path from 'node:path';
2
+ import { loadConfig, readJson } from './config.js';
3
+ import { writeState } from './state.js';
4
+ import { withSetupLock } from './conversations.js';
5
+ /** Per-peer auto-reply policy. An external auto-reply handler reads it before it works on a letter
6
+ * and again right before it sends, so switching off takes effect at once. The app never runs a
7
+ * responder itself; a missing or foreign policy file means off. */
8
+ const FILE = 'autoreply-policy.json';
9
+ const SCHEMA = 'murmur.autoreply-policy/1';
10
+ async function readPolicy(context, agentId) {
11
+ try {
12
+ const state = await readJson(path.join(context.dataDir, FILE));
13
+ if (state?.schema !== SCHEMA || state.agentId !== agentId || typeof state.peers !== 'object' || !state.peers)
14
+ return {};
15
+ const peers = {};
16
+ for (const [peer, value] of Object.entries(state.peers)) {
17
+ if (typeof value?.enabled === 'boolean')
18
+ peers[peer] = { enabled: value.enabled, updatedAt: String(value.updatedAt ?? '') };
19
+ }
20
+ return peers;
21
+ }
22
+ catch {
23
+ return {};
24
+ }
25
+ }
26
+ /** Whether the profile's receive hook is the auto-reply handler: the switch only has an effect then. */
27
+ const handlerInstalled = (config) => typeof config?.onReceive === 'string' && /murmur-autoreply[\\/]receive\.mjs/.test(config.onReceive);
28
+ /** Contacts the handler itself answers (its own allowedPeers); the switch can only turn on one of them. */
29
+ async function handlerPeers() {
30
+ const file = process.env.MURMUR_AUTOREPLY_CONFIG || path.join(process.env.HOME ?? '', '.config', 'murmur-autoreply', 'config.json');
31
+ try {
32
+ const peers = (await readJson(file))?.allowedPeers;
33
+ return Array.isArray(peers) ? peers.filter((p) => typeof p === 'string') : null;
34
+ }
35
+ catch {
36
+ return null;
37
+ }
38
+ }
39
+ export async function showAutoreply(context) {
40
+ const config = await loadConfig(context);
41
+ const policy = await readPolicy(context, config.agentId);
42
+ const allowed = await handlerPeers();
43
+ return {
44
+ schema: 'murmur.autoreply/1',
45
+ agentId: config.agentId,
46
+ installed: handlerInstalled(config),
47
+ peers: Object.keys(config.peers ?? {}).sort().map(peer => ({
48
+ peer,
49
+ enabled: policy[peer]?.enabled === true,
50
+ supported: allowed?.includes(peer) === true,
51
+ updatedAt: policy[peer]?.updatedAt || null,
52
+ })),
53
+ };
54
+ }
55
+ export async function setAutoreply(context, peer, enabled, expectedAgent) {
56
+ const config = await loadConfig(context);
57
+ if (config.agentId !== expectedAgent)
58
+ throw new Error('autoreply.identity-changed');
59
+ if (!Object.hasOwn(config.peers ?? {}, peer))
60
+ throw new Error('autoreply.unknown-peer');
61
+ if (enabled && !(await handlerPeers())?.includes(peer))
62
+ throw new Error('autoreply.peer-not-allowed');
63
+ // The handler holds the same lock while it checks the policy and queues a reply, so once this returns no
64
+ // new auto-reply can be queued for a switched-off peer. Its send can take seconds: wait longer.
65
+ await withSetupLock(context, async () => {
66
+ const peers = await readPolicy(context, config.agentId);
67
+ peers[peer] = { enabled, updatedAt: new Date().toISOString() };
68
+ await writeState(context, path.join(context.dataDir, FILE), { schema: SCHEMA, agentId: config.agentId, peers });
69
+ }, 20000);
70
+ return showAutoreply(context);
71
+ }
@@ -18,6 +18,8 @@ import { readStatus } from './status.js';
18
18
  import { setWakeEnabled, markInboxRead, readInbox, readLogPath } from './commands.js';
19
19
  import { renderStatusLine } from './status-line.js';
20
20
  import { readVersion, checkUpdates, setUpdateChecks } from './updates.js';
21
+ import { listConversations, showConversation, showRouting, sendDirect, markConversationRead, inboxFeed, listSessions } from './conversations.js';
22
+ import { showAutoreply, setAutoreply } from './autoreply.js';
21
23
  export function platformAdapter() {
22
24
  if (process.platform === 'linux')
23
25
  return createLinuxAdapter();
@@ -54,6 +56,7 @@ export async function main(args, adapter = platformAdapter(), input = process.st
54
56
  'agent-id': { type: 'string' }, 'broker-url': { type: 'string' }, broker: { type: 'string' }, 'token-file': { type: 'string' }, 'invite-file': { type: 'string' }, 'reply-file': { type: 'string' }, 'reply-out': { type: 'string' }, out: { type: 'string' },
55
57
  invite: { type: 'string' }, 'no-service': { type: 'boolean' }, 'copy-reply': { type: 'boolean' }, 'print-secret': { type: 'boolean' },
56
58
  'invite-stdin': { type: 'boolean' }, 'reply-stdin': { type: 'boolean' },
59
+ id: { type: 'string' }, to: { type: 'string' }, conversation: { type: 'string' }, 'text-stdin': { type: 'boolean' }, 'text-file': { type: 'string' }, 'expect-after': { type: 'string' }, 'resend-of': { type: 'string' }, through: { type: 'string' },
57
60
  client: { type: 'string' }, replace: { type: 'boolean' }, 'replace-previous': { type: 'boolean' }, 'plan-id': { type: 'string' }, 'test-token': { type: 'string' }, json: { type: 'boolean' }, line: { type: 'boolean' }, limit: { type: 'string' }, peer: { type: 'string' }, timeout: { type: 'string' }, 'data-dir': { type: 'string' }, 'service-name': { type: 'string' }, apply: { type: 'boolean' }, help: { type: 'boolean' },
58
61
  } });
59
62
  }
@@ -63,7 +66,7 @@ export async function main(args, adapter = platformAdapter(), input = process.st
63
66
  }
64
67
  const { values, positionals } = parsed;
65
68
  if (values.help || !positionals.length)
66
- return { commands: ['broker migrate --broker-url URL [--token-file FILE|--user-file FILE --password-file FILE] [--ca-file FILE] [--server-name NAME] [--apply]', 'installation show [--installation-file ABSOLUTE]', 'installation select --data-dir ABSOLUTE [--replace] [--installation-file ABSOLUTE]', 'backups preview|cleanup --kind agent|client [--config-file ABSOLUTE] [--keep-file ABSOLUTE] [--plan-id SHA256]', 'version --json', 'updates check|enable|disable --json', 'init --agent-id ID --broker-url URL [--token-file FILE] [--select]', 'invite [--out FILE] [--broker-url PUBLIC_URL|--broker PUBLIC_URL] [--print-secret] [--json]', 'connect (--invite TEXT_OR_FILE|--invite-file FILE|--invite-stdin) [--agent-id ID] [--data-dir ABSOLUTE] [--reply-out FILE] [--client auto|claude-code|claude-desktop|codex|codex-cli|none] [--no-service] [--copy-reply] [--json]', 'join --agent-id ID (--invite-stdin|--invite-file FILE) [--reply-out FILE] [--select] [--json]', 'add-peer (--reply-stdin|--reply-file FILE)', 'status --json|--line', 'doctor --json [--peer AGENT] [--timeout MILLISECONDS]', 'logs path --json', 'service install [--replace-previous]|start|stop|uninstall', 'clients detect', 'clients preview --client ID [--project-dir ABSOLUTE]', 'clients configure --client ID [--project-dir ABSOLUTE] [--replace] [--plan-id SHA256]', 'reply-test prepare --peer AGENT', 'reply-test check --test-token TOKEN', 'wake pause|resume [--apply]', 'wake dismiss --msg-id ID --expected-agent ID', 'inbox read [--limit 1..100]', 'inbox mark-read', 'outbox list --json', 'outbox dismiss|restore --msg-id ID --expected-state TOKEN --expected-agent ID', 'mcp serve [--data-dir ABSOLUTE]'],
69
+ return { commands: ['broker migrate --broker-url URL [--token-file FILE|--user-file FILE --password-file FILE] [--ca-file FILE] [--server-name NAME] [--apply]', 'installation show [--installation-file ABSOLUTE]', 'installation select --data-dir ABSOLUTE [--replace] [--installation-file ABSOLUTE]', 'backups preview|cleanup --kind agent|client [--config-file ABSOLUTE] [--keep-file ABSOLUTE] [--plan-id SHA256]', 'version --json', 'updates check|enable|disable --json', 'init --agent-id ID --broker-url URL [--token-file FILE] [--select]', 'invite [--out FILE] [--broker-url PUBLIC_URL|--broker PUBLIC_URL] [--print-secret] [--json]', 'connect (--invite TEXT_OR_FILE|--invite-file FILE|--invite-stdin) [--agent-id ID] [--data-dir ABSOLUTE] [--reply-out FILE] [--client auto|claude-code|claude-desktop|codex|codex-cli|cursor|gemini|antigravity|none] [--no-service] [--copy-reply] [--json]', 'join --agent-id ID (--invite-stdin|--invite-file FILE) [--reply-out FILE] [--select] [--json]', 'add-peer (--reply-stdin|--reply-file FILE)', 'status --json|--line', 'doctor --json [--peer AGENT] [--timeout MILLISECONDS]', 'logs path --json', 'service install [--replace-previous]|start|stop|uninstall', 'clients detect', 'clients preview --client ID [--project-dir ABSOLUTE]', 'clients configure --client ID [--project-dir ABSOLUTE] [--replace] [--plan-id SHA256]', 'reply-test prepare --peer AGENT', 'reply-test check --test-token TOKEN', 'wake pause|resume [--apply]', 'wake dismiss --msg-id ID --expected-agent ID', 'conversations list [--limit 1..200]', 'conversations show --id ID [--limit 1..200]', 'routing show', 'conversations read --id ID --through MSG_ID --expected-agent ID', 'inbox feed [--limit 1..100]', 'sessions list', 'autoreply show', 'autoreply enable|disable --peer AGENT --expected-agent ID', 'send --to PEER --conversation ID --msg-id UUID --expected-agent ID [--expect-after MSG_ID] (--text-stdin|--text-file FILE|--resend-of MSG_ID)', 'inbox read [--limit 1..100]', 'inbox mark-read', 'outbox list --json', 'outbox dismiss|restore --msg-id ID --expected-state TOKEN --expected-agent ID', 'mcp serve [--data-dir ABSOLUTE]'],
67
70
  options: ['--data-dir ABSOLUTE', '--service-name NAME'], note: 'Windows service mutations require an elevated terminal and the matching native helper.' };
68
71
  const [command, action, extra] = positionals;
69
72
  if (extra)
@@ -201,6 +204,49 @@ export async function main(args, adapter = platformAdapter(), input = process.st
201
204
  return setWakeEnabled(context, adapter, action === 'resume', values.apply);
202
205
  if (command === 'wake' && action === 'dismiss')
203
206
  return dismissWake(context, required('msg-id'), required('expected-agent'));
207
+ if (command === 'conversations' && action === 'list')
208
+ return listConversations(context, values.limit === undefined ? 50 : Number(values.limit));
209
+ if (command === 'conversations' && action === 'show')
210
+ return showConversation(context, required('id'), values.limit === undefined ? 60 : Number(values.limit));
211
+ if (command === 'routing' && action === 'show')
212
+ return showRouting(context);
213
+ if (command === 'conversations' && action === 'read')
214
+ return markConversationRead(context, required('id'), required('through'), required('expected-agent'));
215
+ if (command === 'inbox' && action === 'feed')
216
+ return inboxFeed(context, values.limit === undefined ? 30 : Number(values.limit));
217
+ if (command === 'sessions' && action === 'list')
218
+ return listSessions(context);
219
+ if (command === 'autoreply' && action === 'show')
220
+ return showAutoreply(context);
221
+ if (command === 'autoreply' && (action === 'enable' || action === 'disable'))
222
+ return setAutoreply(context, required('peer'), action === 'enable', required('expected-agent'));
223
+ if (command === 'send' && !action) {
224
+ if ([values['text-file'] !== undefined, values['text-stdin'], values['resend-of'] !== undefined].filter(Boolean).length > 1)
225
+ throw new Error('send.input-conflict');
226
+ let text;
227
+ if (values['resend-of'] !== undefined)
228
+ text = undefined;
229
+ else if (values['text-file'] !== undefined)
230
+ text = await (await import('node:fs/promises')).readFile(values['text-file'], 'utf8');
231
+ else if (values['text-stdin']) {
232
+ if (input === process.stdin && process.stdin.isTTY)
233
+ throw new Error('send.stdin-required');
234
+ const chunks = [];
235
+ let size = 0;
236
+ for await (const chunk of input) {
237
+ const bytes = Buffer.from(chunk);
238
+ size += bytes.length;
239
+ if (size > 16384)
240
+ throw new Error('send.text-too-large');
241
+ chunks.push(bytes);
242
+ }
243
+ text = Buffer.concat(chunks).toString('utf8');
244
+ }
245
+ else
246
+ throw new Error('send.input-required');
247
+ return sendDirect(context, { to: required('to'), conversationId: required('conversation'), msgId: required('msg-id'),
248
+ expectedAgent: required('expected-agent'), expectAfter: values['expect-after'], resendOf: values['resend-of'], text });
249
+ }
204
250
  if (command === 'inbox' && action === 'read')
205
251
  return readInbox(context, values.limit === undefined ? 20 : Number(values.limit));
206
252
  if (command === 'inbox' && action === 'mark-read')
@@ -14,7 +14,7 @@ export declare function previewClientConfiguration(c: ServiceContext, adapter: P
14
14
  action: "replace" | "unchanged" | "add";
15
15
  } | undefined;
16
16
  schema: string;
17
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
17
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
18
18
  configPath: string;
19
19
  agentId: string;
20
20
  dataDir: string;
@@ -34,7 +34,7 @@ export declare function configureClient(c: ServiceContext, adapter: PlatformAdap
34
34
  agentId?: string | undefined;
35
35
  dataDir?: string | undefined;
36
36
  schema: string;
37
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
37
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
38
38
  configPath: string;
39
39
  changed: boolean;
40
40
  backup: null;
@@ -47,7 +47,7 @@ export declare function configureClient(c: ServiceContext, adapter: PlatformAdap
47
47
  agentId?: string | undefined;
48
48
  dataDir?: string | undefined;
49
49
  schema: string;
50
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
50
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
51
51
  configPath: string;
52
52
  changed: boolean;
53
53
  backup: string | null;
@@ -71,7 +71,7 @@ export declare function configureClient(c: ServiceContext, adapter: PlatformAdap
71
71
  agentId?: string | undefined;
72
72
  dataDir?: string | undefined;
73
73
  schema: string;
74
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
74
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
75
75
  configPath: string;
76
76
  backup: null;
77
77
  restartRequired: boolean;
@@ -97,7 +97,7 @@ export declare function configureClient(c: ServiceContext, adapter: PlatformAdap
97
97
  agentId?: string | undefined;
98
98
  dataDir?: string | undefined;
99
99
  schema: string;
100
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
100
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
101
101
  configPath: string;
102
102
  backup: string | null;
103
103
  }>;
@@ -19,6 +19,7 @@ export declare function setWakeEnabled(context: ServiceContext, adapter: Platfor
19
19
  }>;
20
20
  /** Explicit read action only; merely displaying status never consumes unread state. */
21
21
  export declare function markInboxRead(context: ServiceContext): Promise<{
22
+ conversations?: object | undefined;
22
23
  schema: string;
23
24
  agentId: string;
24
25
  rowid: number;
@@ -6,6 +6,7 @@ import { loadConfig, readJson, safeError } from './config.js';
6
6
  import { readStatus } from './status.js';
7
7
  import { assistantRead, wakeColumns, personalInboxSql } from './message-status.js';
8
8
  import { writeState } from './state.js';
9
+ import { withSetupLock } from './conversations.js';
9
10
  /** Observe the configured directory only; this does not prove a live daemon's log destination. */
10
11
  export async function readLogPath(context, adapter) {
11
12
  const config = await loadConfig(context);
@@ -81,9 +82,20 @@ export async function markInboxRead(context) {
81
82
  const db = new DatabaseSync(context.storePath, { readOnly: true });
82
83
  try {
83
84
  const rowid = Number(db.prepare("SELECT COALESCE(MAX(rowid),0) AS rowid FROM local_messages WHERE direction='inbound'").get().rowid);
84
- const state = { schema: 'murmur.read/1', agentId: config.agentId, rowid };
85
- await writeState(context, path.join(context.dataDir, 'read-state.json'), state);
86
- return state;
85
+ const file = path.join(context.dataDir, 'read-state.json');
86
+ // Per-conversation marks of the desktop app survive a profile-wide mark-read; both writers share the lock.
87
+ return await withSetupLock(context, async () => {
88
+ let conversations;
89
+ try {
90
+ const old = await readJson(file);
91
+ if (old?.schema === 'murmur.read/1' && old.agentId === config.agentId)
92
+ conversations = old.conversations;
93
+ }
94
+ catch { }
95
+ const state = { schema: 'murmur.read/1', agentId: config.agentId, rowid, ...(conversations && typeof conversations === 'object' ? { conversations } : {}) };
96
+ await writeState(context, file, state);
97
+ return state;
98
+ });
87
99
  }
88
100
  finally {
89
101
  db.close();
@@ -108,10 +120,10 @@ export async function readInbox(context, limit = 20) {
108
120
  cursor = state.rowid;
109
121
  }
110
122
  catch { /* Reading messages must not invent or repair read state. */ }
111
- const unread = cursor === null ? null : Number(db.prepare(`SELECT COUNT(*) AS n FROM local_messages WHERE direction='inbound' AND ${personalInboxSql} AND rowid>?`).get(cursor).n);
123
+ const unread = cursor === null ? null : Number(db.prepare(`SELECT COUNT(*) AS n FROM local_messages WHERE direction='inbound' AND ${personalInboxSql} AND COALESCE(transport,'')<>'desktop-note' AND rowid>?`).get(cursor).n);
112
124
  const rows = db.prepare(`SELECT rowid,conversation_id AS conversationId,msg_id AS msgId,sender,text,
113
125
  created_at AS createdAt,transport,channel_id AS channelId,sender_member_id AS senderMemberId,
114
- addressee_member_id AS addresseeMemberId,${wakeColumns(db)} FROM local_messages WHERE direction='inbound' AND ${personalInboxSql}
126
+ addressee_member_id AS addresseeMemberId,${wakeColumns(db)} FROM local_messages WHERE direction='inbound' AND ${personalInboxSql} AND COALESCE(transport,'')<>'desktop-note'
115
127
  ORDER BY created_at DESC,rowid DESC LIMIT ?`).all(limit);
116
128
  db.exec('COMMIT');
117
129
  return { schema: 'murmur.inbox/1', agentId: config.agentId, readCursor: cursor,
@@ -43,7 +43,7 @@ export declare function connect(adapter: PlatformAdapter, options: {
43
43
  agentId?: string | undefined;
44
44
  dataDir?: string | undefined;
45
45
  schema: string;
46
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
46
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
47
47
  configPath: string;
48
48
  changed: boolean;
49
49
  backup: null;
@@ -59,7 +59,7 @@ export declare function connect(adapter: PlatformAdapter, options: {
59
59
  agentId?: string | undefined;
60
60
  dataDir?: string | undefined;
61
61
  schema: string;
62
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
62
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
63
63
  configPath: string;
64
64
  changed: boolean;
65
65
  backup: string | null;
@@ -86,7 +86,7 @@ export declare function connect(adapter: PlatformAdapter, options: {
86
86
  agentId?: string | undefined;
87
87
  dataDir?: string | undefined;
88
88
  schema: string;
89
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
89
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
90
90
  configPath: string;
91
91
  backup: null;
92
92
  restartRequired: boolean;
@@ -115,11 +115,11 @@ export declare function connect(adapter: PlatformAdapter, options: {
115
115
  agentId?: string | undefined;
116
116
  dataDir?: string | undefined;
117
117
  schema: string;
118
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
118
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
119
119
  configPath: string;
120
120
  backup: string | null;
121
121
  } | {
122
- client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop";
122
+ client: "claude-code" | "claude-desktop" | "codex-cli" | "codex-desktop" | "cursor" | "gemini";
123
123
  state: string;
124
124
  error: string;
125
125
  hint: string;
@@ -5,10 +5,12 @@ import { safeError, validAgentId } from './config.js';
5
5
  import { join } from './onboarding.js';
6
6
  import { defaultProfileDir, resolveContext } from './paths.js';
7
7
  import { readStatus } from './status.js';
8
- const automaticClients = new Set(['claude-code', 'codex-cli', 'codex-desktop']);
8
+ const automaticClients = new Set(['claude-code', 'codex-cli', 'codex-desktop', 'cursor', 'gemini']);
9
9
  const clientIds = new Map([
10
10
  ['claude-code', 'claude-code'], ['claude-desktop', 'claude-desktop'],
11
11
  ['codex-cli', 'codex-cli'], ['codex', 'codex-desktop'],
12
+ ['cursor', 'cursor'], ['gemini', 'gemini'],
13
+ ['antigravity', 'gemini'], ['agy', 'gemini'],
12
14
  ]);
13
15
  function defaultAgentId() {
14
16
  let username = '';