@agentcomms/whatsapp 0.13.0 → 0.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/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { pt as VERSION, u as composeDraft } from "./sync-fzUQKMxy.mjs";
2
- import { t as createWhatsAppMcpServer } from "./server-DIlBV3Wu.mjs";
1
+ import { gt as VERSION, ht as PACKAGE_NAME, u as composeDraft } from "./sync-DQHqQIgH.mjs";
2
+ import { t as createWhatsAppMcpServer } from "./server-B0AHo-sF.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-DIlBV3Wu.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 };
@@ -1,4 +1,4 @@
1
- import { E as strictToolArguments, a as listChats, d as draftMessage, i as CHAT_KINDS, j as UNTRUSTED_NOTICE, lt as updateToolGate, m as WhatsAppContext, n as whatsappStatus, o as readChat, ot as toCommsError, pt as VERSION, s as searchMessages, t as syncAccount } from "./sync-fzUQKMxy.mjs";
1
+ import { E as strictToolArguments, a as listChats, d as draftMessage, gt as VERSION, i as CHAT_KINDS, j as UNTRUSTED_NOTICE, m as WhatsAppContext, n as whatsappStatus, o as readChat, s as searchMessages, st as toCommsError, t as syncAccount, ut as updateToolGate } from "./sync-DQHqQIgH.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-DXXb3Vv3-kCxsVLO4.mjs";
4
4
  //#region src/mcp/server.ts
@@ -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 runs `agent-whatsapp add <organisation>/whatsapp` in a terminal."
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,
@@ -1,4 +1,4 @@
1
- import { t as createWhatsAppMcpServer } from "./server-DIlBV3Wu.mjs";
1
+ import { t as createWhatsAppMcpServer } from "./server-B0AHo-sF.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