@agentcomms/whatsapp 0.24.0 → 0.25.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/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as gatedChangeAtTerminal, A as requireAccount, B as PATH_OPTIONS, Ct as CALLER, F as expandSource, G as approveChangeAtTerminal, H as absoluteSearchPath, J as cliHandoffs, K as canPrompt, L as CHANNEL_SERVERS, M as storeIdentity, N as checkStorePath, O as PLATFORM, P as defaultStorePath, Q as exemptFromUpdateNotice, R as CommsError, S as chatRefOf, St as writeResult, Tt as VERSION, U as agentMarker, W as approveAndWaitSentence, X as commandPathOf, Y as colorEnabled, Z as escapeForDisplay, _ as WhatsAppContext, _t as truncateDisplay, a as CHAT_KINDS, at as nameAvailable, b as requireSupportedNode, bt as windowsSystemProgram, c as searchMessages, ct as paint, dt as renderPrune, et as handoffSentence, f as draftMessage, ft as resolvePaths, ht as serverPruneChange, i as probeStore, it as lookupName, j as requireNamedConfig, k as newWhatsAppAccount, l as Presenter, lt as pathOverridesFromCliOptions, m as listKey, mt as serverInstallChange, nt as installExitStatus, o as listChats, ot as nameShapeProblem, p as Visibility, pt as runCommand, q as childEnvironment, r as whatsappStatus, rt as isCommsError, s as readChat, st as openCore, t as syncAccount, tt as handoffText, u as innerText, ut as renderInstall, v as WhatsAppIndex, vt as updateNoticeAtTerminal, xt as withFileLock, z as EXIT_CODES } from "./sync-DYq2CGVj.mjs";
2
+ import { $ as gatedChangeAtTerminal, A as requireAccount, B as PATH_OPTIONS, Ct as CALLER, F as expandSource, G as approveChangeAtTerminal, H as absoluteSearchPath, J as cliHandoffs, K as canPrompt, L as CHANNEL_SERVERS, M as storeIdentity, N as checkStorePath, O as PLATFORM, P as defaultStorePath, Q as exemptFromUpdateNotice, R as CommsError, S as chatRefOf, St as writeResult, Tt as VERSION, U as agentMarker, W as approveAndWaitSentence, X as commandPathOf, Y as colorEnabled, Z as escapeForDisplay, _ as WhatsAppContext, _t as truncateDisplay, a as CHAT_KINDS, at as nameAvailable, b as requireSupportedNode, bt as windowsSystemProgram, c as searchMessages, ct as paint, dt as renderPrune, et as handoffSentence, f as draftMessage, ft as resolvePaths, ht as serverPruneChange, i as probeStore, it as lookupName, j as requireNamedConfig, k as newWhatsAppAccount, l as Presenter, lt as pathOverridesFromCliOptions, m as listKey, mt as serverInstallChange, nt as installExitStatus, o as listChats, ot as nameShapeProblem, p as Visibility, pt as runCommand, q as childEnvironment, r as whatsappStatus, rt as isCommsError, s as readChat, st as openCore, t as syncAccount, tt as handoffText, u as innerText, ut as renderInstall, v as WhatsAppIndex, vt as updateNoticeAtTerminal, xt as withFileLock, z as EXIT_CODES } from "./sync-DEG2YdIm.mjs";
3
3
  import { rm } from "node:fs/promises";
4
4
  import path, { delimiter, join } from "node:path";
5
5
  import { stripVTControlCharacters } from "node:util";
@@ -3569,7 +3569,7 @@ a macOS dialog may be waiting) · 77 permission needed (macOS privacy) · 78 con
3569
3569
  ran = true;
3570
3570
  exitCode = await runCommand(output(), async () => {
3571
3571
  requireSupportedNode();
3572
- await (deps.startMcp ?? (await import("./stdio-entry-pwRwRiwa.mjs")).startWhatsAppStdioServer)({
3572
+ await (deps.startMcp ?? (await import("./stdio-entry-CYFb_dWj.mjs")).startWhatsAppStdioServer)({
3573
3573
  env,
3574
3574
  platform,
3575
3575
  ...deps,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { C as chatKindOf, D as text, E as numeric, R as CommsError, T as kindOf, Tt as VERSION, _ as WhatsAppContext, d as composeDraft, g as visibilityUnitKey, h as statusAuthor, m as listKey, n as withCheckedCopy, p as Visibility, w as coreDataToIso, wt as PACKAGE_NAME, x as inspectSchema, y as rebuildIndex } from "./sync-DYq2CGVj.mjs";
2
- import { t as createWhatsAppMcpServer } from "./server-Btcjiqz2.mjs";
1
+ import { C as chatKindOf, D as text, E as numeric, R as CommsError, T as kindOf, Tt as VERSION, _ as WhatsAppContext, d as composeDraft, g as visibilityUnitKey, h as statusAuthor, m as listKey, n as withCheckedCopy, p as Visibility, w as coreDataToIso, wt as PACKAGE_NAME, x as inspectSchema, y as rebuildIndex } from "./sync-DEG2YdIm.mjs";
2
+ import { t as createWhatsAppMcpServer } from "./server-DtDXnPRw.mjs";
3
3
  //#region src/source/event-reader.ts
4
4
  function rawFromMe(value) {
5
5
  const number = numeric(value);
@@ -1,4 +1,4 @@
1
- import { I as strictToolArguments, Tt as VERSION, V as UNTRUSTED_NOTICE, _ as WhatsAppContext, a as CHAT_KINDS, c as searchMessages, f as draftMessage, gt as toCommsError, o as listChats, r as whatsappStatus, s as readChat, t as syncAccount, yt as updateToolNotice } from "./sync-DYq2CGVj.mjs";
1
+ import { I as strictToolArguments, Tt as VERSION, V as UNTRUSTED_NOTICE, _ as WhatsAppContext, a as CHAT_KINDS, c as searchMessages, f as draftMessage, gt as toCommsError, o as listChats, r as whatsappStatus, s as readChat, t as syncAccount, yt as updateToolNotice } from "./sync-DEG2YdIm.mjs";
2
2
  import { c as boolean, h as number, x as string } from "./iso-USuVU_sk.mjs";
3
3
  import { t as McpServer } from "./mcp-DIH4cS6P-CIWWZQbz.mjs";
4
4
  //#region src/mcp/server.ts
@@ -1,4 +1,4 @@
1
- import { t as createWhatsAppMcpServer } from "./server-Btcjiqz2.mjs";
1
+ import { t as createWhatsAppMcpServer } from "./server-DtDXnPRw.mjs";
2
2
  //#region src/mcp/stdio-entry.ts
3
3
  /**
4
4
  * Starting the stdio server. On stdio, stdout is the protocol, so the console is redirected to stderr first — the
@@ -11,7 +11,7 @@ import { execFile, spawn } from "node:child_process";
11
11
  //#endregion
12
12
  //#region src/version.ts
13
13
  /** The package version, read from package.json at build time. */
14
- const VERSION$2 = "0.24.0";
14
+ const VERSION$2 = "0.25.0";
15
15
  //#endregion
16
16
  //#region src/caller.ts
17
17
  /** This package's name, as its manifest has it. */
@@ -28,7 +28,7 @@ const CALLER = Object.freeze({
28
28
  packageName: PACKAGE_NAME
29
29
  });
30
30
  //#endregion
31
- //#region ../core/dist/update-check-BY5xNUZa.mjs
31
+ //#region ../core/dist/update-check-CMD_Te5S.mjs
32
32
  /**
33
33
  * Every failure a user or an agent can act on carries a specific, stable code from this registry, a message, an
34
34
  * optional one-line hint and structured `details`. The code decides the process exit status; agents and skills branch
@@ -7157,6 +7157,24 @@ function parseConfig(text, source = "config.json") {
7157
7157
  if (!parsed.success) throw new CommsError("CONFIG", `${source} is invalid: ${describeIssues(parsed.error, naming === 1 ? 1 : 2)}`);
7158
7158
  return parsed.data;
7159
7159
  }
7160
+ /**
7161
+ * How a config write waits for the config lock: five seconds for each holder, thirty seconds in all.
7162
+ *
7163
+ * The lock is a queue. Every send prepare, claim and approval on every channel runs `ensureSendEpochConfig` first, and
7164
+ * while a legacy drain is open that is a config write or two per call, so an agent's parallel calls across several MCP
7165
+ * servers arrive at this lock together, each holding it for one read, check and fsynced rename (and the drain's, for a
7166
+ * list of the approvals too). Counted from when each waiter began, the lock's five seconds were a budget for the whole
7167
+ * line ahead: on the Windows runner a line of twelve writes gave up at the ninth, "another agent-communications process
7168
+ * is holding", while the lock was being handed on exactly as it should be. A holder there took about half a second, and
7169
+ * on Windows a rename alone may retry for one. Counted per holder, as Resend's throttle and Gmail's history caches count
7170
+ * theirs, a write gives up only on a holder that keeps the lock for the whole five seconds: the stuck lock the timeout is
7171
+ * for. The lock is polled rather than queued, so thirty seconds in all bounds the rest, and leaves room inside the minute
7172
+ * an MCP client waits for a tool call.
7173
+ */
7174
+ const CONFIG_WRITE_LOCK = {
7175
+ timeoutPerHolder: true,
7176
+ maxWaitMs: 3e4
7177
+ };
7160
7178
  var ConfigStore = class {
7161
7179
  path;
7162
7180
  #lockPath;
@@ -7177,6 +7195,10 @@ var ConfigStore = class {
7177
7195
  #namesMigrateAgain(why) {
7178
7196
  return handoffSentence(requiredHandoffs(this.#handoffs).core(["names", "migrate"]), (command) => `Run ${command} again ${why}.`, { instead: `Call comms_names_migrate again ${why}.` });
7179
7197
  }
7198
+ /** Runs `fn` holding the config lock, waited for as a write waits for it (`CONFIG_WRITE_LOCK`). */
7199
+ #withWriteLock(fn) {
7200
+ return withFileLock(this.#lockPath, fn, CONFIG_WRITE_LOCK);
7201
+ }
7180
7202
  /** The current config; an empty one when the file does not exist yet. */
7181
7203
  async load() {
7182
7204
  let key;
@@ -7203,7 +7225,7 @@ var ConfigStore = class {
7203
7225
  let committed;
7204
7226
  let result;
7205
7227
  try {
7206
- result = await withFileLock(this.#lockPath, async () => {
7228
+ result = await this.#withWriteLock(async () => {
7207
7229
  options.signal?.throwIfAborted();
7208
7230
  this.#cache = null;
7209
7231
  const current = structuredClone(await this.load());
@@ -12004,7 +12026,7 @@ function folding(platform) {
12004
12026
  return platform === "win32" ? (text) => text.toLowerCase() : (text) => text;
12005
12027
  }
12006
12028
  /** The package version, read from package.json at build time. */
12007
- const VERSION = "0.24.0";
12029
+ const VERSION = "0.25.0";
12008
12030
  /**
12009
12031
  * The command a person is told to run for one of this suite's own CLIs (design 2026-10-04, D1 and D5; CUE-403).
12010
12032
  *
@@ -15667,7 +15689,7 @@ function serverPruneChange(core, env, request, own) {
15667
15689
  };
15668
15690
  const { packageName, version } = ownProduct(request.channel, own) ?? {
15669
15691
  packageName: serverFacts(request.channel).packageName,
15670
- version: "0.24.0"
15692
+ version: "0.25.0"
15671
15693
  };
15672
15694
  const product = {
15673
15695
  packageName,
@@ -16206,7 +16228,7 @@ function commandDecisionLine(core, decision, channel, platform) {
16206
16228
  }
16207
16229
  channelServer("core").packageName;
16208
16230
  //#endregion
16209
- //#region ../core/dist/tool-arguments-5t8Xd2eK.mjs
16231
+ //#region ../core/dist/tool-arguments-BW3WUyxT.mjs
16210
16232
  const APPLIED = Symbol.for("agentcomms.strictToolArguments");
16211
16233
  const TARGET = "draft-2020-12";
16212
16234
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentcomms/whatsapp",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "WhatsApp for coding agents, read-only: list, read and search the chats WhatsApp for Mac keeps on this Mac, and draft replies as links the person sends. No network client; it never sends.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "access": "public"
35
35
  },
36
36
  "dependencies": {
37
- "@agentcomms/core": "0.24.0"
37
+ "@agentcomms/core": "0.25.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@modelcontextprotocol/client": "2.3.1",
@@ -98,5 +98,5 @@
98
98
  "typecheck": "tsc -p tsconfig.json",
99
99
  "test": "node --experimental-strip-types --disable-warning=ExperimentalWarning --test --test-timeout=600000 \"test/**/*.test.ts\""
100
100
  },
101
- "gitHead": "f239501ba696ae239586f22f1dae43f181bbe817"
101
+ "gitHead": "1aca79f8c2674add5086fe4f05a52c8fb2719657"
102
102
  }