cclawd 1.0.1 → 1.0.2

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 (121) hide show
  1. package/dist/{active-listener-Dkhmfuwx.js → active-listener-BLd27Pxd.js} +1 -1
  2. package/dist/{api-key-rotation-BOfI3cG3.js → api-key-rotation-Dg3JlNDQ.js} +1 -1
  3. package/dist/{audio-preflight-CtkZ5SAs.js → audio-preflight-eV5m9mMp.js} +6 -6
  4. package/dist/{audio-transcription-runner-CbPqoiHX.js → audio-transcription-runner-CQU4Eg1M.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-DWAER4wd.js → channel-activity-dT3cYb0e.js} +1 -1
  9. package/dist/{commands-registry-BUyiA7nE.js → commands-registry-CyLMCPuP.js} +1 -1
  10. package/dist/compact.runtime-DGRl4st4.js +39 -0
  11. package/dist/{deliver-aHOaRbkt.js → deliver-B6eTtXSk.js} +4 -4
  12. package/dist/{deliver-runtime-D4bCsr6d.js → deliver-runtime-CLDpY6AW.js} +7 -7
  13. package/dist/{deps-send-discord.runtime-BziKU-pE.js → deps-send-discord.runtime-CxADlame.js} +7 -7
  14. package/dist/{deps-send-imessage.runtime-CFRnDTqp.js → deps-send-imessage.runtime-Wi79xm6H.js} +7 -7
  15. package/dist/{deps-send-signal.runtime-BuOtABJm.js → deps-send-signal.runtime-BDtzvsnR.js} +6 -6
  16. package/dist/{deps-send-slack.runtime-BOLqvMxW.js → deps-send-slack.runtime-CgX24hgT.js} +5 -5
  17. package/dist/{deps-send-telegram.runtime-DeEoFLv5.js → deps-send-telegram.runtime-CEWc7ePn.js} +6 -6
  18. package/dist/deps-send-whatsapp.runtime-B1KJ7YOp.js +43 -0
  19. package/dist/{diagnostic-BdcXX9iJ.js → diagnostic-BZmAxdu9.js} +1 -1
  20. package/dist/{fetch-D9NUULbj.js → fetch-CMLoICyN.js} +2 -2
  21. package/dist/{fetch-guard-B5ZMnGaN.js → fetch-guard-DCj3k042.js} +1 -1
  22. package/dist/{image-4x07m4Jl.js → image-Bt49ybRv.js} +2 -2
  23. package/dist/{image-runtime-smkMrIol.js → image-runtime-Cilhq73U.js} +2 -2
  24. package/dist/{ir-CsgNUpOU.js → ir-CVtBjUiL.js} +2 -2
  25. package/dist/llm-slug-generator.js +23 -23
  26. package/dist/{login-p_O59TVQ.js → login-D0fUoX-p.js} +2 -2
  27. package/dist/{login-qr-BCJpDsAy.js → login-qr-ClBxstxZ.js} +2 -2
  28. package/dist/{manager-CwYv8O3T.js → manager-DSfEj66R.js} +3 -3
  29. package/dist/{manager-runtime-D_jEoBr9.js → manager-runtime-BrZlGJsj.js} +4 -4
  30. package/dist/{model-selection-Cv2Puf5z.js → model-selection-CMEj8bpy.js} +11 -11
  31. package/dist/{outbound-Chpiwybe.js → outbound-BxIJyMzV.js} +4 -4
  32. package/dist/{outbound-attachment-BnAVJDLe.js → outbound-attachment-CVJwpypG.js} +2 -2
  33. package/dist/{pi-embedded-CJVNBk0y.js → pi-embedded-CHNPEUAv.js} +57 -57
  34. package/dist/{pi-model-discovery-7IzK0Uc3.js → pi-model-discovery-D-r5y7kV.js} +1 -1
  35. package/dist/{pi-model-discovery-runtime-DABef3qy.js → pi-model-discovery-runtime-DZQXYmdu.js} +2 -2
  36. package/dist/{pi-tools.before-tool-call.runtime-BP2UvGJb.js → pi-tools.before-tool-call.runtime-DagGpfw0.js} +2 -2
  37. package/dist/plugin-sdk/compat.js +35 -35
  38. package/dist/{pw-ai-DwH5GpEO.js → pw-ai-CoIUdns_.js} +1 -1
  39. package/dist/{runtime-whatsapp-login.runtime-BI3U306v.js → runtime-whatsapp-login.runtime-ChqE9BkX.js} +3 -3
  40. package/dist/{runtime-whatsapp-outbound.runtime-Bsc2uD09.js → runtime-whatsapp-outbound.runtime-yiy6jzKk.js} +6 -6
  41. package/dist/{send-DtBvCnPQ.js → send-4rRrSKp9.js} +4 -4
  42. package/dist/{send-ORtn50qg.js → send-BKO1-P1t.js} +3 -3
  43. package/dist/{send-C-Q_WPMf.js → send-EDBPXjTT.js} +3 -3
  44. package/dist/{send-DUibfNQD.js → send-K2mAG7KC.js} +4 -4
  45. package/dist/{send-BDnOgWIp.js → send-V1MRV7QF.js} +3 -3
  46. package/dist/{session-B7imi6T5.js → session-CuVCho2m.js} +1 -1
  47. package/dist/{skill-commands-B9brPuiL.js → skill-commands-B55LOaMB.js} +2 -2
  48. package/dist/{slash-commands.runtime-Cf6ygfBp.js → slash-commands.runtime-BchS0VkW.js} +2 -2
  49. package/dist/{slash-dispatch.runtime-CsmvhO5K.js → slash-dispatch.runtime-BIKRY3fr.js} +23 -23
  50. package/dist/{slash-skill-commands.runtime-CX7stIEP.js → slash-skill-commands.runtime-BP4jBHU9.js} +3 -3
  51. package/dist/{subagent-registry-runtime-B_S1nf7y.js → subagent-registry-runtime-DjEYzSyM.js} +23 -23
  52. package/dist/{tables-CjQqTOdD.js → tables-BAGqh2XD.js} +1 -1
  53. package/dist/{target-errors-BZE1mc-W.js → target-errors-CeBF8Pws.js} +1 -1
  54. package/dist/{web-Cd8yK1Zq.js → web-BRSmQdtm.js} +27 -27
  55. package/dist/{whatsapp-actions-CYEzUMBI.js → whatsapp-actions-Dxb2K2Xh.js} +7 -7
  56. package/extensions/mfa-auth/index.ts +3 -3
  57. package/extensions/mfa-auth/src/notification-service.ts +2 -2
  58. package/package.json +458 -458
  59. package/dist/compact.runtime-DpcZpcTl.js +0 -39
  60. package/dist/deps-send-whatsapp.runtime-CG1uXYLY.js +0 -43
  61. package/dist/plugin-sdk/active-listener-CN-tMEvN.js +0 -35
  62. package/dist/plugin-sdk/api-key-rotation-CimGYMBc.js +0 -176
  63. package/dist/plugin-sdk/audio-preflight-C-xXBoE2.js +0 -51
  64. package/dist/plugin-sdk/audio-transcription-runner-CTIHpebA.js +0 -2173
  65. package/dist/plugin-sdk/audit-membership-runtime-BFatB2LJ.js +0 -58
  66. package/dist/plugin-sdk/channel-activity-DO0FEzyj.js +0 -95
  67. package/dist/plugin-sdk/channel-web-Da-__nUF.js +0 -2238
  68. package/dist/plugin-sdk/commands-registry-6no2NNrY.js +0 -1118
  69. package/dist/plugin-sdk/compact.runtime-CCoclu5e.js +0 -35
  70. package/dist/plugin-sdk/config-B9ODwgpz.js +0 -37426
  71. package/dist/plugin-sdk/deliver-B1fFpKjV.js +0 -1757
  72. package/dist/plugin-sdk/deliver-runtime-DB-VRMe1.js +0 -15
  73. package/dist/plugin-sdk/deps-send-discord.runtime-DklqycYG.js +0 -15
  74. package/dist/plugin-sdk/deps-send-imessage.runtime-Chs8zeon.js +0 -14
  75. package/dist/plugin-sdk/deps-send-signal.runtime-clW9aSJP.js +0 -13
  76. package/dist/plugin-sdk/deps-send-slack.runtime-BUx0LYY1.js +0 -13
  77. package/dist/plugin-sdk/deps-send-telegram.runtime-LECSHgMG.js +0 -16
  78. package/dist/plugin-sdk/deps-send-whatsapp.runtime-D2d65fw0.js +0 -40
  79. package/dist/plugin-sdk/diagnostic-CxIvS-C2.js +0 -315
  80. package/dist/plugin-sdk/dispatch-BqlR4dPx.js +0 -105863
  81. package/dist/plugin-sdk/env-b9k1PHMI.js +0 -34
  82. package/dist/plugin-sdk/fetch-PoxzAANT.js +0 -326
  83. package/dist/plugin-sdk/fetch-guard-4UVSZ0uS.js +0 -164
  84. package/dist/plugin-sdk/image-Ch6M4tnJ.js +0 -2420
  85. package/dist/plugin-sdk/image-runtime-CSh2o5wY.js +0 -8
  86. package/dist/plugin-sdk/ir-CugsqGH8.js +0 -1312
  87. package/dist/plugin-sdk/local-roots-adnEg9zb.js +0 -217
  88. package/dist/plugin-sdk/logger-D6zRubj0.js +0 -1164
  89. package/dist/plugin-sdk/login-CYvkQ0At.js +0 -54
  90. package/dist/plugin-sdk/login-qr-ll4NtaT5.js +0 -316
  91. package/dist/plugin-sdk/manager-CHy8IclH.js +0 -3959
  92. package/dist/plugin-sdk/manager-runtime-C70EkEr7.js +0 -11
  93. package/dist/plugin-sdk/outbound-Wzs2iN7X.js +0 -216
  94. package/dist/plugin-sdk/outbound-attachment-khXJwucX.js +0 -17
  95. package/dist/plugin-sdk/paths-BtVqCdw4.js +0 -3063
  96. package/dist/plugin-sdk/pi-model-discovery-Dh4ziodY.js +0 -131
  97. package/dist/plugin-sdk/pi-model-discovery-runtime-b83Xe-HT.js +0 -8
  98. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C1z5CDBF.js +0 -349
  99. package/dist/plugin-sdk/proxy-fetch-CJEmoBxi.js +0 -54
  100. package/dist/plugin-sdk/pw-ai-Dj3Cvlzl.js +0 -1990
  101. package/dist/plugin-sdk/qmd-manager-egHUAseQ.js +0 -1581
  102. package/dist/plugin-sdk/resolve-outbound-target-BiICvIKs.js +0 -38
  103. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DNApufzW.js +0 -9
  104. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-CBmtfIQ8.js +0 -13
  105. package/dist/plugin-sdk/send-CScblaI4.js +0 -532
  106. package/dist/plugin-sdk/send-CeHhnld6.js +0 -407
  107. package/dist/plugin-sdk/send-DP_c8JfR.js +0 -3277
  108. package/dist/plugin-sdk/send-Dc5fI6e8.js +0 -495
  109. package/dist/plugin-sdk/send-l-77_s1_.js +0 -2507
  110. package/dist/plugin-sdk/session-CkOKZaqa.js +0 -166
  111. package/dist/plugin-sdk/skill-commands-BohYCgkq.js +0 -336
  112. package/dist/plugin-sdk/slash-commands.runtime-DpLfVTM6.js +0 -8
  113. package/dist/plugin-sdk/slash-dispatch.runtime-CASMHwpm.js +0 -35
  114. package/dist/plugin-sdk/slash-skill-commands.runtime-D7rrJEci.js +0 -9
  115. package/dist/plugin-sdk/sqlite-CJE3X7Mv.js +0 -1005
  116. package/dist/plugin-sdk/subagent-registry-runtime-B1oo5bih.js +0 -35
  117. package/dist/plugin-sdk/tables-D5VgpTmm.js +0 -53
  118. package/dist/plugin-sdk/target-errors-C6zZ_OpA.js +0 -191
  119. package/dist/plugin-sdk/tokens-DUnJnpMS.js +0 -50
  120. package/dist/plugin-sdk/web-TfUM1nSi.js +0 -39
  121. 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 };