@agentcomms/whatsapp 0.12.3 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.mjs +97 -82
- package/dist/{coerce-BscjcmYU.mjs → coerce-CqGigABD.mjs} +2 -10
- package/dist/{dist-COPefvtq-D67MoOnB.mjs → dist-COPefvtq-COGS2a-K.mjs} +1 -1
- package/dist/index.d.mts +2893 -1654
- package/dist/index.mjs +2 -3
- package/dist/{schemas-DiGKNDNq.mjs → iso-USuVU_sk.mjs} +13 -5
- package/dist/{mcp-DXXb3Vv3-Co5BzjYe.mjs → mcp-DXXb3Vv3-kCxsVLO4.mjs} +2 -2
- package/dist/{server-B1EmZ6FZ.mjs → server-DNyMO_pq.mjs} +8 -8
- package/dist/{src-D_zzAWoS-BhK0GFdq-XAvBzdGB.mjs → src-D_zzAWoS-BhK0GFdq-oo-8IJem.mjs} +2 -2
- package/dist/{stdio-CHZ2WRcx-5iYMXTdw.mjs → stdio-CHZ2WRcx-B2_wGdA5.mjs} +1 -1
- package/dist/{stdio-entry-CAM7LpPv.mjs → stdio-entry-vXXVDpnA.mjs} +1 -1
- package/dist/{stdio-BR8R87El.mjs → stdio-q4c3585j.mjs} +1 -1
- package/dist/{sync-DJlsr6xq.mjs → sync-DrWJVoXp.mjs} +2463 -822
- package/package.json +6 -4
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createWhatsAppMcpServer } from "./server-
|
|
1
|
+
import { _t as VERSION, gt as PACKAGE_NAME, u as composeDraft } from "./sync-DrWJVoXp.mjs";
|
|
2
|
+
import { t as createWhatsAppMcpServer } from "./server-DNyMO_pq.mjs";
|
|
3
3
|
//#region src/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* The library entry of `@agentcomms/whatsapp`.
|
|
@@ -7,6 +7,5 @@ import { t as createWhatsAppMcpServer } from "./server-B1EmZ6FZ.mjs";
|
|
|
7
7
|
* Small on purpose, as the Slack package's is: the server, the draft composer and the version. Everything else is
|
|
8
8
|
* reached through the `agent-whatsapp` command.
|
|
9
9
|
*/
|
|
10
|
-
const PACKAGE_NAME = "@agentcomms/whatsapp";
|
|
11
10
|
//#endregion
|
|
12
11
|
export { PACKAGE_NAME, VERSION, composeDraft, createWhatsAppMcpServer };
|
|
@@ -1013,7 +1013,7 @@ const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468
|
|
|
1013
1013
|
function anchor(source) {
|
|
1014
1014
|
return new RegExp(`^${source}$`);
|
|
1015
1015
|
}
|
|
1016
|
-
const date = /*@__PURE__*/ anchor(dateSource);
|
|
1016
|
+
const date$1 = /*@__PURE__*/ anchor(dateSource);
|
|
1017
1017
|
function timeSource(args) {
|
|
1018
1018
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
1019
1019
|
return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -1021,7 +1021,7 @@ function timeSource(args) {
|
|
|
1021
1021
|
function time(args) {
|
|
1022
1022
|
return new RegExp(`^${timeSource(args)}$`);
|
|
1023
1023
|
}
|
|
1024
|
-
function datetime(args) {
|
|
1024
|
+
function datetime$1(args) {
|
|
1025
1025
|
const opts = ["Z"];
|
|
1026
1026
|
if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
1027
1027
|
const qualified = `${timeSource({
|
|
@@ -1672,11 +1672,11 @@ const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
|
|
|
1672
1672
|
$ZodStringFormat.init(inst, def);
|
|
1673
1673
|
});
|
|
1674
1674
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1675
|
-
def.pattern ?? (def.pattern = datetime(def));
|
|
1675
|
+
def.pattern ?? (def.pattern = datetime$1(def));
|
|
1676
1676
|
$ZodStringFormat.init(inst, def);
|
|
1677
1677
|
});
|
|
1678
1678
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1679
|
-
def.pattern ?? (def.pattern = date);
|
|
1679
|
+
def.pattern ?? (def.pattern = date$1);
|
|
1680
1680
|
$ZodStringFormat.init(inst, def);
|
|
1681
1681
|
});
|
|
1682
1682
|
const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
|
|
@@ -5882,4 +5882,12 @@ function preprocess(fn, schema) {
|
|
|
5882
5882
|
});
|
|
5883
5883
|
}
|
|
5884
5884
|
//#endregion
|
|
5885
|
-
|
|
5885
|
+
//#region ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/iso.js
|
|
5886
|
+
function datetime(params) {
|
|
5887
|
+
return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
|
|
5888
|
+
}
|
|
5889
|
+
function date(params) {
|
|
5890
|
+
return /* @__PURE__ */ _isoDate(ZodISODate, params);
|
|
5891
|
+
}
|
|
5892
|
+
//#endregion
|
|
5893
|
+
export { unknown as C, _coercedNumber as D, toJSONSchema as E, NEVER as O, union as S, safeParse as T, optional as _, _null as a, strictObject as b, boolean as c, intersection as d, lazy as f, object as g, number as h, _enum as i, discriminatedUnion as l, looseObject as m, datetime as n, any as o, literal as p, ZodNumber as r, array as s, date as t, email as u, preprocess as v, url as w, string as x, record as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as unknown, E as toJSONSchema, O as NEVER, S as union, T as safeParse, _ as optional, a as _null, c as boolean, d as intersection, f as lazy, g as object, h as number, i as _enum, l as discriminatedUnion, m as looseObject, n as datetime, o as any, p as literal, s as array, t as date, u as email, v as preprocess, w as url, x as string, y as record } from "./iso-USuVU_sk.mjs";
|
|
2
|
+
import { n as ZodIssueCode, t as number$1 } from "./coerce-CqGigABD.mjs";
|
|
3
3
|
import process$1 from "node:process";
|
|
4
4
|
//#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
|
|
5
5
|
var __create = Object.create;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as boolean, h as number, x as string } from "./
|
|
3
|
-
import { t as McpServer } from "./mcp-DXXb3Vv3-
|
|
1
|
+
import { E as strictToolArguments, _t as VERSION, a as listChats, ct as toCommsError, d as draftMessage, dt as updateToolGate, i as CHAT_KINDS, j as UNTRUSTED_NOTICE, m as WhatsAppContext, n as whatsappStatus, o as readChat, s as searchMessages, t as syncAccount } from "./sync-DrWJVoXp.mjs";
|
|
2
|
+
import { c as boolean, h as number, x as string } from "./iso-USuVU_sk.mjs";
|
|
3
|
+
import { t as McpServer } from "./mcp-DXXb3Vv3-kCxsVLO4.mjs";
|
|
4
4
|
//#region src/mcp/server.ts
|
|
5
5
|
async function buildInstructions(context) {
|
|
6
6
|
let names = [];
|
|
@@ -29,7 +29,7 @@ async function buildInstructions(context) {
|
|
|
29
29
|
...pinned !== void 0 ? [`This server is pinned to ${pinned}: every call acts on it, \`account\` may be left out, and any other is refused.`] : [
|
|
30
30
|
"Pass `account` on every call except whatsapp_status — there is no default. On whatsapp_draft it applies that",
|
|
31
31
|
"account’s lists; without it, every account’s do.",
|
|
32
|
-
names.length > 0 ? `Known accounts: ${names.slice(0, 8).join(", ")}${names.length > 8 ? `, and ${names.length - 8} more` : ""}.` : "No account is set up yet: a person
|
|
32
|
+
names.length > 0 ? `Known accounts: ${names.slice(0, 8).join(", ")}${names.length > 8 ? `, and ${names.length - 8} more` : ""}.` : "No account is set up yet: a person adds one in a terminal — whatsapp_status gives the command, as `setup`."
|
|
33
33
|
]
|
|
34
34
|
].join("\n");
|
|
35
35
|
}
|
|
@@ -44,7 +44,7 @@ async function createWhatsAppMcpServer(options = {}) {
|
|
|
44
44
|
version: VERSION
|
|
45
45
|
}, { instructions: await buildInstructions(context) });
|
|
46
46
|
const reply = (data) => {
|
|
47
|
-
const structured = data;
|
|
47
|
+
const structured = JSON.parse(JSON.stringify(data));
|
|
48
48
|
return {
|
|
49
49
|
structuredContent: structured,
|
|
50
50
|
content: [{
|
|
@@ -55,12 +55,12 @@ async function createWhatsAppMcpServer(options = {}) {
|
|
|
55
55
|
};
|
|
56
56
|
const fail = (error) => {
|
|
57
57
|
const comms = toCommsError(error);
|
|
58
|
-
const structured = { error: {
|
|
58
|
+
const structured = JSON.parse(JSON.stringify({ error: {
|
|
59
59
|
code: comms.code,
|
|
60
60
|
message: comms.message,
|
|
61
61
|
hint: comms.hint ?? null,
|
|
62
62
|
...comms.details !== void 0 ? { details: comms.details } : {}
|
|
63
|
-
} };
|
|
63
|
+
} }));
|
|
64
64
|
return {
|
|
65
65
|
isError: true,
|
|
66
66
|
structuredContent: structured,
|
|
@@ -214,7 +214,7 @@ async function createWhatsAppMcpServer(options = {}) {
|
|
|
214
214
|
return {
|
|
215
215
|
server,
|
|
216
216
|
async connectStdio() {
|
|
217
|
-
const { StdioServerTransport } = await import("./stdio-
|
|
217
|
+
const { StdioServerTransport } = await import("./stdio-q4c3585j.mjs");
|
|
218
218
|
await server.connect(new StdioServerTransport());
|
|
219
219
|
}
|
|
220
220
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as unknown, E as toJSONSchema, O as NEVER, S as union, T as safeParse, _ as optional, a as _null, c as boolean, d as intersection, f as lazy, g as object, h as number, i as _enum, l as discriminatedUnion, m as looseObject, n as datetime, o as any, p as literal, s as array, t as date, u as email, v as preprocess, w as url, x as string, y as record } from "./iso-USuVU_sk.mjs";
|
|
2
|
+
import { n as ZodIssueCode, t as number$1 } from "./coerce-CqGigABD.mjs";
|
|
3
3
|
const SUPPORTED_PROTOCOL_VERSIONS = [
|
|
4
4
|
"2025-11-25",
|
|
5
5
|
"2025-06-18",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ReadBuffer, c as SdkErrorCode, k as serializeMessage, s as SdkError } from "./src-D_zzAWoS-BhK0GFdq-
|
|
1
|
+
import { a as ReadBuffer, c as SdkErrorCode, k as serializeMessage, s as SdkError } from "./src-D_zzAWoS-BhK0GFdq-oo-8IJem.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import process$1 from "node:process";
|
|
4
4
|
import { PassThrough } from "node:stream";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createWhatsAppMcpServer } from "./server-
|
|
1
|
+
import { t as createWhatsAppMcpServer } from "./server-DNyMO_pq.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as serializeMessage, n as process, r as ReadBuffer } from "./mcp-DXXb3Vv3-
|
|
1
|
+
import { i as serializeMessage, n as process, r as ReadBuffer } from "./mcp-DXXb3Vv3-kCxsVLO4.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/@modelcontextprotocol+server@2.0.0/node_modules/@modelcontextprotocol/server/dist/stdio.mjs
|
|
3
3
|
/**
|
|
4
4
|
* Server transport for stdio: this communicates with an MCP client by reading from the current process' `stdin` and writing to `stdout`.
|