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,217 +0,0 @@
1
- import { L as resolveAgentWorkspaceDir } from "./paths-BtVqCdw4.js";
2
- import { Es as extensionForMime, Ts as detectMime } from "./config-B9ODwgpz.js";
3
- import { c as resolveStateDir } from "./paths-eFexkPEh.js";
4
- import { Q as resolvePreferredOpenClawTmpDir } from "./logger-D6zRubj0.js";
5
- import { n as withStrictGuardedFetchMode, t as fetchWithSsrFGuard } from "./fetch-guard-4UVSZ0uS.js";
6
- import path from "node:path";
7
- //#region src/media/read-response-with-limit.ts
8
- async function readChunkWithIdleTimeout(reader, chunkTimeoutMs) {
9
- let timeoutId;
10
- let timedOut = false;
11
- return await new Promise((resolve, reject) => {
12
- const clear = () => {
13
- if (timeoutId !== void 0) {
14
- clearTimeout(timeoutId);
15
- timeoutId = void 0;
16
- }
17
- };
18
- timeoutId = setTimeout(() => {
19
- timedOut = true;
20
- clear();
21
- reader.cancel().catch(() => void 0);
22
- reject(/* @__PURE__ */ new Error(`Media download stalled: no data received for ${chunkTimeoutMs}ms`));
23
- }, chunkTimeoutMs);
24
- reader.read().then((result) => {
25
- clear();
26
- if (!timedOut) resolve(result);
27
- }, (err) => {
28
- clear();
29
- if (!timedOut) reject(err);
30
- });
31
- });
32
- }
33
- async function readResponseWithLimit(res, maxBytes, opts) {
34
- const onOverflow = opts?.onOverflow ?? ((params) => /* @__PURE__ */ new Error(`Content too large: ${params.size} bytes (limit: ${params.maxBytes} bytes)`));
35
- const chunkTimeoutMs = opts?.chunkTimeoutMs;
36
- const body = res.body;
37
- if (!body || typeof body.getReader !== "function") {
38
- const fallback = Buffer.from(await res.arrayBuffer());
39
- if (fallback.length > maxBytes) throw onOverflow({
40
- size: fallback.length,
41
- maxBytes,
42
- res
43
- });
44
- return fallback;
45
- }
46
- const reader = body.getReader();
47
- const chunks = [];
48
- let total = 0;
49
- try {
50
- while (true) {
51
- const { done, value } = chunkTimeoutMs ? await readChunkWithIdleTimeout(reader, chunkTimeoutMs) : await reader.read();
52
- if (done) break;
53
- if (value?.length) {
54
- total += value.length;
55
- if (total > maxBytes) {
56
- try {
57
- await reader.cancel();
58
- } catch {}
59
- throw onOverflow({
60
- size: total,
61
- maxBytes,
62
- res
63
- });
64
- }
65
- chunks.push(value);
66
- }
67
- }
68
- } finally {
69
- try {
70
- reader.releaseLock();
71
- } catch {}
72
- }
73
- return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)), total);
74
- }
75
- //#endregion
76
- //#region src/media/fetch.ts
77
- var MediaFetchError = class extends Error {
78
- constructor(code, message) {
79
- super(message);
80
- this.code = code;
81
- this.name = "MediaFetchError";
82
- }
83
- };
84
- function stripQuotes(value) {
85
- return value.replace(/^["']|["']$/g, "");
86
- }
87
- function parseContentDispositionFileName(header) {
88
- if (!header) return;
89
- const starMatch = /filename\*\s*=\s*([^;]+)/i.exec(header);
90
- if (starMatch?.[1]) {
91
- const cleaned = stripQuotes(starMatch[1].trim());
92
- const encoded = cleaned.split("''").slice(1).join("''") || cleaned;
93
- try {
94
- return path.basename(decodeURIComponent(encoded));
95
- } catch {
96
- return path.basename(encoded);
97
- }
98
- }
99
- const match = /filename\s*=\s*([^;]+)/i.exec(header);
100
- if (match?.[1]) return path.basename(stripQuotes(match[1].trim()));
101
- }
102
- async function readErrorBodySnippet(res, maxChars = 200) {
103
- try {
104
- const text = await res.text();
105
- if (!text) return;
106
- const collapsed = text.replace(/\s+/g, " ").trim();
107
- if (!collapsed) return;
108
- if (collapsed.length <= maxChars) return collapsed;
109
- return `${collapsed.slice(0, maxChars)}…`;
110
- } catch {
111
- return;
112
- }
113
- }
114
- async function fetchRemoteMedia(options) {
115
- const { url, fetchImpl, requestInit, filePathHint, maxBytes, maxRedirects, readIdleTimeoutMs, ssrfPolicy, lookupFn } = options;
116
- let res;
117
- let finalUrl = url;
118
- let release = null;
119
- try {
120
- const result = await fetchWithSsrFGuard(withStrictGuardedFetchMode({
121
- url,
122
- fetchImpl,
123
- init: requestInit,
124
- maxRedirects,
125
- policy: ssrfPolicy,
126
- lookupFn
127
- }));
128
- res = result.response;
129
- finalUrl = result.finalUrl;
130
- release = result.release;
131
- } catch (err) {
132
- throw new MediaFetchError("fetch_failed", `Failed to fetch media from ${url}: ${String(err)}`);
133
- }
134
- try {
135
- if (!res.ok) {
136
- const statusText = res.statusText ? ` ${res.statusText}` : "";
137
- const redirected = finalUrl !== url ? ` (redirected to ${finalUrl})` : "";
138
- let detail = `HTTP ${res.status}${statusText}`;
139
- if (!res.body) detail = `HTTP ${res.status}${statusText}; empty response body`;
140
- else {
141
- const snippet = await readErrorBodySnippet(res);
142
- if (snippet) detail += `; body: ${snippet}`;
143
- }
144
- throw new MediaFetchError("http_error", `Failed to fetch media from ${url}${redirected}: ${detail}`);
145
- }
146
- const contentLength = res.headers.get("content-length");
147
- if (maxBytes && contentLength) {
148
- const length = Number(contentLength);
149
- if (Number.isFinite(length) && length > maxBytes) throw new MediaFetchError("max_bytes", `Failed to fetch media from ${url}: content length ${length} exceeds maxBytes ${maxBytes}`);
150
- }
151
- let buffer;
152
- try {
153
- buffer = maxBytes ? await readResponseWithLimit(res, maxBytes, {
154
- onOverflow: ({ maxBytes, res }) => new MediaFetchError("max_bytes", `Failed to fetch media from ${res.url || url}: payload exceeds maxBytes ${maxBytes}`),
155
- chunkTimeoutMs: readIdleTimeoutMs
156
- }) : Buffer.from(await res.arrayBuffer());
157
- } catch (err) {
158
- if (err instanceof MediaFetchError) throw err;
159
- throw new MediaFetchError("fetch_failed", `Failed to fetch media from ${res.url || url}: ${String(err)}`);
160
- }
161
- let fileNameFromUrl;
162
- try {
163
- const parsed = new URL(finalUrl);
164
- fileNameFromUrl = path.basename(parsed.pathname) || void 0;
165
- } catch {}
166
- const headerFileName = parseContentDispositionFileName(res.headers.get("content-disposition"));
167
- let fileName = headerFileName || fileNameFromUrl || (filePathHint ? path.basename(filePathHint) : void 0);
168
- const filePathForMime = headerFileName && path.extname(headerFileName) ? headerFileName : filePathHint ?? finalUrl;
169
- const contentType = await detectMime({
170
- buffer,
171
- headerMime: res.headers.get("content-type"),
172
- filePath: filePathForMime
173
- });
174
- if (fileName && !path.extname(fileName) && contentType) {
175
- const ext = extensionForMime(contentType);
176
- if (ext) fileName = `${fileName}${ext}`;
177
- }
178
- return {
179
- buffer,
180
- contentType: contentType ?? void 0,
181
- fileName
182
- };
183
- } finally {
184
- if (release) await release();
185
- }
186
- }
187
- //#endregion
188
- //#region src/media/local-roots.ts
189
- let cachedPreferredTmpDir;
190
- function resolveCachedPreferredTmpDir() {
191
- if (!cachedPreferredTmpDir) cachedPreferredTmpDir = resolvePreferredOpenClawTmpDir();
192
- return cachedPreferredTmpDir;
193
- }
194
- function buildMediaLocalRoots(stateDir, options = {}) {
195
- const resolvedStateDir = path.resolve(stateDir);
196
- return [
197
- options.preferredTmpDir ?? resolveCachedPreferredTmpDir(),
198
- path.join(resolvedStateDir, "media"),
199
- path.join(resolvedStateDir, "agents"),
200
- path.join(resolvedStateDir, "workspace"),
201
- path.join(resolvedStateDir, "sandboxes")
202
- ];
203
- }
204
- function getDefaultMediaLocalRoots() {
205
- return buildMediaLocalRoots(resolveStateDir());
206
- }
207
- function getAgentScopedMediaLocalRoots(cfg, agentId) {
208
- const roots = buildMediaLocalRoots(resolveStateDir());
209
- if (!agentId?.trim()) return roots;
210
- const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId);
211
- if (!workspaceDir) return roots;
212
- const normalizedWorkspaceDir = path.resolve(workspaceDir);
213
- if (!roots.includes(normalizedWorkspaceDir)) roots.push(normalizedWorkspaceDir);
214
- return roots;
215
- }
216
- //#endregion
217
- export { readResponseWithLimit as a, fetchRemoteMedia as i, getDefaultMediaLocalRoots as n, MediaFetchError as r, getAgentScopedMediaLocalRoots as t };