cclawd 1.0.4 → 1.0.6

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.
Files changed (123) hide show
  1. package/dist/{active-listener-BLd27Pxd.js → active-listener-Dkhmfuwx.js} +1 -1
  2. package/dist/{api-key-rotation-Dg3JlNDQ.js → api-key-rotation-BOfI3cG3.js} +1 -1
  3. package/dist/{audio-preflight-eV5m9mMp.js → audio-preflight-CtkZ5SAs.js} +6 -6
  4. package/dist/{audio-transcription-runner-CQU4Eg1M.js → audio-transcription-runner-CbPqoiHX.js} +6 -6
  5. package/dist/build-info.json +3 -3
  6. package/dist/bundled/boot-md/handler.js +23 -23
  7. package/dist/bundled/session-memory/handler.js +23 -23
  8. package/dist/{channel-activity-dT3cYb0e.js → channel-activity-DWAER4wd.js} +1 -1
  9. package/dist/{commands-registry-CyLMCPuP.js → commands-registry-BUyiA7nE.js} +1 -1
  10. package/dist/compact.runtime-DpcZpcTl.js +39 -0
  11. package/dist/{deliver-B6eTtXSk.js → deliver-aHOaRbkt.js} +4 -4
  12. package/dist/{deliver-runtime-CLDpY6AW.js → deliver-runtime-D4bCsr6d.js} +7 -7
  13. package/dist/{deps-send-discord.runtime-CxADlame.js → deps-send-discord.runtime-BziKU-pE.js} +7 -7
  14. package/dist/{deps-send-imessage.runtime-Wi79xm6H.js → deps-send-imessage.runtime-CFRnDTqp.js} +7 -7
  15. package/dist/{deps-send-signal.runtime-BDtzvsnR.js → deps-send-signal.runtime-BuOtABJm.js} +6 -6
  16. package/dist/{deps-send-slack.runtime-CgX24hgT.js → deps-send-slack.runtime-BOLqvMxW.js} +5 -5
  17. package/dist/{deps-send-telegram.runtime-CEWc7ePn.js → deps-send-telegram.runtime-DeEoFLv5.js} +6 -6
  18. package/dist/deps-send-whatsapp.runtime-CG1uXYLY.js +43 -0
  19. package/dist/{diagnostic-BZmAxdu9.js → diagnostic-BdcXX9iJ.js} +1 -1
  20. package/dist/{fetch-CMLoICyN.js → fetch-D9NUULbj.js} +2 -2
  21. package/dist/{fetch-guard-DCj3k042.js → fetch-guard-B5ZMnGaN.js} +1 -1
  22. package/dist/{image-Bt49ybRv.js → image-4x07m4Jl.js} +2 -2
  23. package/dist/{image-runtime-Cilhq73U.js → image-runtime-smkMrIol.js} +2 -2
  24. package/dist/{ir-CVtBjUiL.js → ir-CsgNUpOU.js} +2 -2
  25. package/dist/llm-slug-generator.js +23 -23
  26. package/dist/{login-D0fUoX-p.js → login-p_O59TVQ.js} +2 -2
  27. package/dist/{login-qr-ClBxstxZ.js → login-qr-BCJpDsAy.js} +2 -2
  28. package/dist/{manager-DSfEj66R.js → manager-CwYv8O3T.js} +3 -3
  29. package/dist/{manager-runtime-BrZlGJsj.js → manager-runtime-D_jEoBr9.js} +4 -4
  30. package/dist/{model-selection-CMEj8bpy.js → model-selection-Cv2Puf5z.js} +11 -11
  31. package/dist/{outbound-BxIJyMzV.js → outbound-Chpiwybe.js} +4 -4
  32. package/dist/{outbound-attachment-CVJwpypG.js → outbound-attachment-BnAVJDLe.js} +2 -2
  33. package/dist/{pi-embedded-CHNPEUAv.js → pi-embedded-CJVNBk0y.js} +57 -57
  34. package/dist/{pi-model-discovery-D-r5y7kV.js → pi-model-discovery-7IzK0Uc3.js} +1 -1
  35. package/dist/{pi-model-discovery-runtime-DZQXYmdu.js → pi-model-discovery-runtime-DABef3qy.js} +2 -2
  36. package/dist/{pi-tools.before-tool-call.runtime-DagGpfw0.js → pi-tools.before-tool-call.runtime-BP2UvGJb.js} +2 -2
  37. package/dist/plugin-sdk/index.js +35 -35
  38. package/dist/plugin-sdk/signal.js +2 -2
  39. package/dist/{pw-ai-CoIUdns_.js → pw-ai-DwH5GpEO.js} +1 -1
  40. package/dist/{runtime-whatsapp-login.runtime-ChqE9BkX.js → runtime-whatsapp-login.runtime-BI3U306v.js} +3 -3
  41. package/dist/{runtime-whatsapp-outbound.runtime-yiy6jzKk.js → runtime-whatsapp-outbound.runtime-Bsc2uD09.js} +6 -6
  42. package/dist/{send-V1MRV7QF.js → send-BDnOgWIp.js} +3 -3
  43. package/dist/{send-EDBPXjTT.js → send-C-Q_WPMf.js} +3 -3
  44. package/dist/{send-K2mAG7KC.js → send-DUibfNQD.js} +4 -4
  45. package/dist/{send-4rRrSKp9.js → send-DtBvCnPQ.js} +4 -4
  46. package/dist/{send-BKO1-P1t.js → send-ORtn50qg.js} +3 -3
  47. package/dist/{session-CuVCho2m.js → session-B7imi6T5.js} +1 -1
  48. package/dist/{skill-commands-B55LOaMB.js → skill-commands-B9brPuiL.js} +2 -2
  49. package/dist/{slash-commands.runtime-BchS0VkW.js → slash-commands.runtime-Cf6ygfBp.js} +2 -2
  50. package/dist/{slash-dispatch.runtime-BIKRY3fr.js → slash-dispatch.runtime-CsmvhO5K.js} +23 -23
  51. package/dist/{slash-skill-commands.runtime-BP4jBHU9.js → slash-skill-commands.runtime-CX7stIEP.js} +3 -3
  52. package/dist/{subagent-registry-runtime-DjEYzSyM.js → subagent-registry-runtime-B_S1nf7y.js} +23 -23
  53. package/dist/{tables-BAGqh2XD.js → tables-CjQqTOdD.js} +1 -1
  54. package/dist/{target-errors-CeBF8Pws.js → target-errors-BZE1mc-W.js} +1 -1
  55. package/dist/{web-BRSmQdtm.js → web-Cd8yK1Zq.js} +27 -27
  56. package/dist/{whatsapp-actions-Dxb2K2Xh.js → whatsapp-actions-CYEzUMBI.js} +7 -7
  57. package/extensions/mfa-auth/index.ts +20 -39
  58. package/extensions/mfa-auth/src/auth-manager.ts +0 -4
  59. package/extensions/mfa-auth/src/notification-service.ts +3 -7
  60. package/package.json +1 -1
  61. package/dist/compact.runtime-DGRl4st4.js +0 -39
  62. package/dist/deps-send-whatsapp.runtime-B1KJ7YOp.js +0 -43
  63. package/dist/plugin-sdk/active-listener-CN-tMEvN.js +0 -35
  64. package/dist/plugin-sdk/api-key-rotation-CimGYMBc.js +0 -176
  65. package/dist/plugin-sdk/audio-preflight-C-xXBoE2.js +0 -51
  66. package/dist/plugin-sdk/audio-transcription-runner-CTIHpebA.js +0 -2173
  67. package/dist/plugin-sdk/audit-membership-runtime-BFatB2LJ.js +0 -58
  68. package/dist/plugin-sdk/channel-activity-DO0FEzyj.js +0 -95
  69. package/dist/plugin-sdk/channel-web-Da-__nUF.js +0 -2238
  70. package/dist/plugin-sdk/commands-registry-6no2NNrY.js +0 -1118
  71. package/dist/plugin-sdk/compact.runtime-CCoclu5e.js +0 -35
  72. package/dist/plugin-sdk/config-B9ODwgpz.js +0 -37426
  73. package/dist/plugin-sdk/deliver-B1fFpKjV.js +0 -1757
  74. package/dist/plugin-sdk/deliver-runtime-DB-VRMe1.js +0 -15
  75. package/dist/plugin-sdk/deps-send-discord.runtime-DklqycYG.js +0 -15
  76. package/dist/plugin-sdk/deps-send-imessage.runtime-Chs8zeon.js +0 -14
  77. package/dist/plugin-sdk/deps-send-signal.runtime-clW9aSJP.js +0 -13
  78. package/dist/plugin-sdk/deps-send-slack.runtime-BUx0LYY1.js +0 -13
  79. package/dist/plugin-sdk/deps-send-telegram.runtime-LECSHgMG.js +0 -16
  80. package/dist/plugin-sdk/deps-send-whatsapp.runtime-D2d65fw0.js +0 -40
  81. package/dist/plugin-sdk/diagnostic-CxIvS-C2.js +0 -315
  82. package/dist/plugin-sdk/dispatch-BqlR4dPx.js +0 -105863
  83. package/dist/plugin-sdk/env-b9k1PHMI.js +0 -34
  84. package/dist/plugin-sdk/fetch-PoxzAANT.js +0 -326
  85. package/dist/plugin-sdk/fetch-guard-4UVSZ0uS.js +0 -164
  86. package/dist/plugin-sdk/image-Ch6M4tnJ.js +0 -2420
  87. package/dist/plugin-sdk/image-runtime-CSh2o5wY.js +0 -8
  88. package/dist/plugin-sdk/ir-CugsqGH8.js +0 -1312
  89. package/dist/plugin-sdk/local-roots-adnEg9zb.js +0 -217
  90. package/dist/plugin-sdk/logger-D6zRubj0.js +0 -1164
  91. package/dist/plugin-sdk/login-CYvkQ0At.js +0 -54
  92. package/dist/plugin-sdk/login-qr-ll4NtaT5.js +0 -316
  93. package/dist/plugin-sdk/manager-CHy8IclH.js +0 -3959
  94. package/dist/plugin-sdk/manager-runtime-C70EkEr7.js +0 -11
  95. package/dist/plugin-sdk/outbound-Wzs2iN7X.js +0 -216
  96. package/dist/plugin-sdk/outbound-attachment-khXJwucX.js +0 -17
  97. package/dist/plugin-sdk/paths-BtVqCdw4.js +0 -3063
  98. package/dist/plugin-sdk/pi-model-discovery-Dh4ziodY.js +0 -131
  99. package/dist/plugin-sdk/pi-model-discovery-runtime-b83Xe-HT.js +0 -8
  100. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C1z5CDBF.js +0 -349
  101. package/dist/plugin-sdk/proxy-fetch-CJEmoBxi.js +0 -54
  102. package/dist/plugin-sdk/pw-ai-Dj3Cvlzl.js +0 -1990
  103. package/dist/plugin-sdk/qmd-manager-egHUAseQ.js +0 -1581
  104. package/dist/plugin-sdk/resolve-outbound-target-BiICvIKs.js +0 -38
  105. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DNApufzW.js +0 -9
  106. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-CBmtfIQ8.js +0 -13
  107. package/dist/plugin-sdk/send-CScblaI4.js +0 -532
  108. package/dist/plugin-sdk/send-CeHhnld6.js +0 -407
  109. package/dist/plugin-sdk/send-DP_c8JfR.js +0 -3277
  110. package/dist/plugin-sdk/send-Dc5fI6e8.js +0 -495
  111. package/dist/plugin-sdk/send-l-77_s1_.js +0 -2507
  112. package/dist/plugin-sdk/session-CkOKZaqa.js +0 -166
  113. package/dist/plugin-sdk/skill-commands-BohYCgkq.js +0 -336
  114. package/dist/plugin-sdk/slash-commands.runtime-DpLfVTM6.js +0 -8
  115. package/dist/plugin-sdk/slash-dispatch.runtime-CASMHwpm.js +0 -35
  116. package/dist/plugin-sdk/slash-skill-commands.runtime-D7rrJEci.js +0 -9
  117. package/dist/plugin-sdk/sqlite-CJE3X7Mv.js +0 -1005
  118. package/dist/plugin-sdk/subagent-registry-runtime-B1oo5bih.js +0 -35
  119. package/dist/plugin-sdk/tables-D5VgpTmm.js +0 -53
  120. package/dist/plugin-sdk/target-errors-C6zZ_OpA.js +0 -191
  121. package/dist/plugin-sdk/tokens-DUnJnpMS.js +0 -50
  122. package/dist/plugin-sdk/web-TfUM1nSi.js +0 -39
  123. package/dist/plugin-sdk/whatsapp-actions-DuWJ0j1r.js +0 -71
@@ -1,11 +0,0 @@
1
- import "./paths-BtVqCdw4.js";
2
- import "./config-B9ODwgpz.js";
3
- import "./paths-eFexkPEh.js";
4
- import "./github-copilot-token-Cxf8QYZb.js";
5
- import "./logger-D6zRubj0.js";
6
- import "./env-b9k1PHMI.js";
7
- import "./fetch-guard-4UVSZ0uS.js";
8
- import "./api-key-rotation-CimGYMBc.js";
9
- import "./sqlite-CJE3X7Mv.js";
10
- import { n as closeAllMemoryIndexManagers, t as MemoryIndexManager } from "./manager-CHy8IclH.js";
11
- export { MemoryIndexManager, closeAllMemoryIndexManagers };
@@ -1,216 +0,0 @@
1
- import { Sl as redactIdentifier, Ua as resolveWhatsAppMediaMaxBytes, Va as resolveWhatsAppAccount, r as loadConfig, ts as generateSecureUuid } from "./config-B9ODwgpz.js";
2
- import { K as getChildLogger, N as toWhatsappJid, a as createSubsystemLogger, v as escapeRegExp } from "./logger-D6zRubj0.js";
3
- import { n as normalizePollInput } from "./polls-CL1LDouN.js";
4
- import { i as resolveMarkdownTableMode, v as loadWebMedia } from "./ir-CugsqGH8.js";
5
- import { t as convertMarkdownTables } from "./tables-D5VgpTmm.js";
6
- import { n as requireActiveWebListener } from "./active-listener-CN-tMEvN.js";
7
- //#region src/markdown/whatsapp.ts
8
- /**
9
- * Convert standard Markdown formatting to WhatsApp-compatible markup.
10
- *
11
- * WhatsApp uses its own formatting syntax:
12
- * bold: *text*
13
- * italic: _text_
14
- * strikethrough: ~text~
15
- * monospace: ```text```
16
- *
17
- * Standard Markdown uses:
18
- * bold: **text** or __text__
19
- * italic: *text* or _text_
20
- * strikethrough: ~~text~~
21
- * code: `text` (inline) or ```text``` (block)
22
- *
23
- * The conversion preserves fenced code blocks and inline code,
24
- * then converts bold and strikethrough markers.
25
- */
26
- /** Placeholder tokens used during conversion to protect code spans. */
27
- const FENCE_PLACEHOLDER = "\0FENCE";
28
- const INLINE_CODE_PLACEHOLDER = "\0CODE";
29
- /**
30
- * Convert standard Markdown bold/italic/strikethrough to WhatsApp formatting.
31
- *
32
- * Order of operations matters:
33
- * 1. Protect fenced code blocks (```...```) — already WhatsApp-compatible
34
- * 2. Protect inline code (`...`) — leave as-is
35
- * 3. Convert **bold** → *bold* and __bold__ → *bold*
36
- * 4. Convert ~~strike~~ → ~strike~
37
- * 5. Restore protected spans
38
- *
39
- * Italic *text* and _text_ are left alone since WhatsApp uses _text_ for italic
40
- * and single * is already WhatsApp bold — no conversion needed for single markers.
41
- */
42
- function markdownToWhatsApp(text) {
43
- if (!text) return text;
44
- const fences = [];
45
- let result = text.replace(/```[\s\S]*?```/g, (match) => {
46
- fences.push(match);
47
- return `${FENCE_PLACEHOLDER}${fences.length - 1}`;
48
- });
49
- const inlineCodes = [];
50
- result = result.replace(/`[^`\n]+`/g, (match) => {
51
- inlineCodes.push(match);
52
- return `${INLINE_CODE_PLACEHOLDER}${inlineCodes.length - 1}`;
53
- });
54
- result = result.replace(/\*\*(.+?)\*\*/g, "*$1*");
55
- result = result.replace(/__(.+?)__/g, "*$1*");
56
- result = result.replace(/~~(.+?)~~/g, "~$1~");
57
- result = result.replace(new RegExp(`${escapeRegExp(INLINE_CODE_PLACEHOLDER)}(\\d+)`, "g"), (_, idx) => inlineCodes[Number(idx)] ?? "");
58
- result = result.replace(new RegExp(`${escapeRegExp(FENCE_PLACEHOLDER)}(\\d+)`, "g"), (_, idx) => fences[Number(idx)] ?? "");
59
- return result;
60
- }
61
- //#endregion
62
- //#region src/web/outbound.ts
63
- const outboundLog = createSubsystemLogger("gateway/channels/whatsapp").child("outbound");
64
- async function sendMessageWhatsApp(to, body, options) {
65
- let text = body;
66
- const correlationId = generateSecureUuid();
67
- const startedAt = Date.now();
68
- const { listener: active, accountId: resolvedAccountId } = requireActiveWebListener(options.accountId);
69
- const cfg = options.cfg ?? loadConfig();
70
- const account = resolveWhatsAppAccount({
71
- cfg,
72
- accountId: resolvedAccountId ?? options.accountId
73
- });
74
- const tableMode = resolveMarkdownTableMode({
75
- cfg,
76
- channel: "whatsapp",
77
- accountId: resolvedAccountId ?? options.accountId
78
- });
79
- text = convertMarkdownTables(text ?? "", tableMode);
80
- text = markdownToWhatsApp(text);
81
- const redactedTo = redactIdentifier(to);
82
- const logger = getChildLogger({
83
- module: "web-outbound",
84
- correlationId,
85
- to: redactedTo
86
- });
87
- try {
88
- const jid = toWhatsappJid(to);
89
- const redactedJid = redactIdentifier(jid);
90
- let mediaBuffer;
91
- let mediaType;
92
- let documentFileName;
93
- if (options.mediaUrl) {
94
- const media = await loadWebMedia(options.mediaUrl, {
95
- maxBytes: resolveWhatsAppMediaMaxBytes(account),
96
- localRoots: options.mediaLocalRoots
97
- });
98
- const caption = text || void 0;
99
- mediaBuffer = media.buffer;
100
- mediaType = media.contentType;
101
- if (media.kind === "audio") mediaType = media.contentType === "audio/ogg" ? "audio/ogg; codecs=opus" : media.contentType ?? "application/octet-stream";
102
- else if (media.kind === "video") text = caption ?? "";
103
- else if (media.kind === "image") text = caption ?? "";
104
- else {
105
- text = caption ?? "";
106
- documentFileName = media.fileName;
107
- }
108
- }
109
- outboundLog.info(`Sending message -> ${redactedJid}${options.mediaUrl ? " (media)" : ""}`);
110
- logger.info({
111
- jid: redactedJid,
112
- hasMedia: Boolean(options.mediaUrl)
113
- }, "sending message");
114
- await active.sendComposingTo(to);
115
- const accountId = Boolean(options.accountId?.trim()) ? resolvedAccountId : void 0;
116
- const sendOptions = options.gifPlayback || accountId || documentFileName ? {
117
- ...options.gifPlayback ? { gifPlayback: true } : {},
118
- ...documentFileName ? { fileName: documentFileName } : {},
119
- accountId
120
- } : void 0;
121
- const messageId = (sendOptions ? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions) : await active.sendMessage(to, text, mediaBuffer, mediaType))?.messageId ?? "unknown";
122
- const durationMs = Date.now() - startedAt;
123
- outboundLog.info(`Sent message ${messageId} -> ${redactedJid}${options.mediaUrl ? " (media)" : ""} (${durationMs}ms)`);
124
- logger.info({
125
- jid: redactedJid,
126
- messageId
127
- }, "sent message");
128
- return {
129
- messageId,
130
- toJid: jid
131
- };
132
- } catch (err) {
133
- logger.error({
134
- err: String(err),
135
- to: redactedTo,
136
- hasMedia: Boolean(options.mediaUrl)
137
- }, "failed to send via web session");
138
- throw err;
139
- }
140
- }
141
- async function sendReactionWhatsApp(chatJid, messageId, emoji, options) {
142
- const correlationId = generateSecureUuid();
143
- const { listener: active } = requireActiveWebListener(options.accountId);
144
- const redactedChatJid = redactIdentifier(chatJid);
145
- const logger = getChildLogger({
146
- module: "web-outbound",
147
- correlationId,
148
- chatJid: redactedChatJid,
149
- messageId
150
- });
151
- try {
152
- const redactedJid = redactIdentifier(toWhatsappJid(chatJid));
153
- outboundLog.info(`Sending reaction "${emoji}" -> message ${messageId}`);
154
- logger.info({
155
- chatJid: redactedJid,
156
- messageId,
157
- emoji
158
- }, "sending reaction");
159
- await active.sendReaction(chatJid, messageId, emoji, options.fromMe ?? false, options.participant);
160
- outboundLog.info(`Sent reaction "${emoji}" -> message ${messageId}`);
161
- logger.info({
162
- chatJid: redactedJid,
163
- messageId,
164
- emoji
165
- }, "sent reaction");
166
- } catch (err) {
167
- logger.error({
168
- err: String(err),
169
- chatJid: redactedChatJid,
170
- messageId,
171
- emoji
172
- }, "failed to send reaction via web session");
173
- throw err;
174
- }
175
- }
176
- async function sendPollWhatsApp(to, poll, options) {
177
- const correlationId = generateSecureUuid();
178
- const startedAt = Date.now();
179
- const { listener: active } = requireActiveWebListener(options.accountId);
180
- const redactedTo = redactIdentifier(to);
181
- const logger = getChildLogger({
182
- module: "web-outbound",
183
- correlationId,
184
- to: redactedTo
185
- });
186
- try {
187
- const jid = toWhatsappJid(to);
188
- const redactedJid = redactIdentifier(jid);
189
- const normalized = normalizePollInput(poll, { maxOptions: 12 });
190
- outboundLog.info(`Sending poll -> ${redactedJid}`);
191
- logger.info({
192
- jid: redactedJid,
193
- optionCount: normalized.options.length,
194
- maxSelections: normalized.maxSelections
195
- }, "sending poll");
196
- const messageId = (await active.sendPoll(to, normalized))?.messageId ?? "unknown";
197
- const durationMs = Date.now() - startedAt;
198
- outboundLog.info(`Sent poll ${messageId} -> ${redactedJid} (${durationMs}ms)`);
199
- logger.info({
200
- jid: redactedJid,
201
- messageId
202
- }, "sent poll");
203
- return {
204
- messageId,
205
- toJid: jid
206
- };
207
- } catch (err) {
208
- logger.error({
209
- err: String(err),
210
- to: redactedTo
211
- }, "failed to send poll via web session");
212
- throw err;
213
- }
214
- }
215
- //#endregion
216
- export { markdownToWhatsApp as i, sendPollWhatsApp as n, sendReactionWhatsApp as r, sendMessageWhatsApp as t };
@@ -1,17 +0,0 @@
1
- import { ws as saveMediaBuffer } from "./config-B9ODwgpz.js";
2
- import { t as buildOutboundMediaLoadOptions } from "./load-options-CE0_U2E0.js";
3
- import { v as loadWebMedia } from "./ir-CugsqGH8.js";
4
- //#region src/media/outbound-attachment.ts
5
- async function resolveOutboundAttachmentFromUrl(mediaUrl, maxBytes, options) {
6
- const media = await loadWebMedia(mediaUrl, buildOutboundMediaLoadOptions({
7
- maxBytes,
8
- mediaLocalRoots: options?.localRoots
9
- }));
10
- const saved = await saveMediaBuffer(media.buffer, media.contentType ?? void 0, "outbound", maxBytes);
11
- return {
12
- path: saved.path,
13
- contentType: saved.contentType
14
- };
15
- }
16
- //#endregion
17
- export { resolveOutboundAttachmentFromUrl as t };