cclawd 1.0.7 → 1.0.8

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 (168) hide show
  1. package/dist/{active-listener-DYmI7imH.js → active-listener-Dkhmfuwx.js} +2 -2
  2. package/dist/{api-key-rotation-DLU4jvSu.js → api-key-rotation-BOfI3cG3.js} +1 -1
  3. package/dist/{audio-preflight-C9TMbRb4.js → audio-preflight-CtkZ5SAs.js} +15 -15
  4. package/dist/{audio-transcription-runner-Q5zG_hYd.js → audio-transcription-runner-CbPqoiHX.js} +10 -10
  5. package/dist/{audit-membership-runtime-DhxSwFnF.js → audit-membership-runtime-hXUuer4x.js} +6 -6
  6. package/dist/build-info.json +3 -3
  7. package/dist/bundled/boot-md/handler.js +35 -35
  8. package/dist/bundled/bootstrap-extra-files/handler.js +5 -5
  9. package/dist/bundled/command-logger/handler.js +2 -2
  10. package/dist/bundled/session-memory/handler.js +35 -35
  11. package/dist/{channel-activity-Bx08UTAg.js → channel-activity-DWAER4wd.js} +2 -2
  12. package/dist/{commands-registry-llLVCTH9.js → commands-registry-BUyiA7nE.js} +2 -2
  13. package/dist/compact.runtime-DpcZpcTl.js +39 -0
  14. package/dist/{deliver-DJf2ZBpe.js → deliver-aHOaRbkt.js} +19 -19
  15. package/dist/deliver-runtime-D4bCsr6d.js +19 -0
  16. package/dist/deps-send-discord.runtime-BziKU-pE.js +19 -0
  17. package/dist/deps-send-imessage.runtime-CFRnDTqp.js +18 -0
  18. package/dist/deps-send-signal.runtime-BuOtABJm.js +17 -0
  19. package/dist/deps-send-slack.runtime-BOLqvMxW.js +17 -0
  20. package/dist/deps-send-telegram.runtime-DeEoFLv5.js +20 -0
  21. package/dist/deps-send-whatsapp.runtime-CG1uXYLY.js +43 -0
  22. package/dist/{diagnostic-BCCMF3O_.js → diagnostic-BdcXX9iJ.js} +2 -2
  23. package/dist/{env-aYXLHjfZ.js → env-lw2hsIUY.js} +1 -1
  24. package/dist/{fetch-bvgIiupu.js → fetch-C0iyt-Iz.js} +3 -3
  25. package/dist/{fetch-DCTUdr1U.js → fetch-D9NUULbj.js} +5 -5
  26. package/dist/{fetch-guard-CqpEmMQ2.js → fetch-guard-B5ZMnGaN.js} +2 -2
  27. package/dist/{frontmatter-DjZuS525.js → frontmatter-C_obXuTp.js} +3 -3
  28. package/dist/{github-copilot-token-CQmATy5E.js → github-copilot-token-8N63GdbE.js} +7 -7
  29. package/dist/{image-Q8E1-lZn.js → image-4x07m4Jl.js} +4 -4
  30. package/dist/image-runtime-smkMrIol.js +12 -0
  31. package/dist/{ir-CzM3SxId.js → ir-CsgNUpOU.js} +6 -6
  32. package/dist/llm-slug-generator.js +35 -35
  33. package/dist/{logger-ChbX1G7s.js → logger-CbUVl62f.js} +7 -7
  34. package/dist/{login-B0mtU11X.js → login-p_O59TVQ.js} +4 -4
  35. package/dist/{login-qr-DY_i60f5.js → login-qr-BCJpDsAy.js} +10 -10
  36. package/dist/{manager-FAQPC0uO.js → manager-CwYv8O3T.js} +12 -12
  37. package/dist/manager-runtime-D_jEoBr9.js +15 -0
  38. package/dist/{model-selection-wf3OY5DX.js → model-selection-Cv2Puf5z.js} +122 -122
  39. package/dist/{outbound-Bw0dOVS7.js → outbound-Chpiwybe.js} +6 -6
  40. package/dist/{outbound-attachment-1R6r9Pg_.js → outbound-attachment-BnAVJDLe.js} +2 -2
  41. package/dist/{paths-C0HLtPu0.js → paths-CehYKFsO.js} +7 -7
  42. package/dist/{paths-hfkBoC7i.js → paths-DkxwiA8g.js} +5 -5
  43. package/dist/{pi-embedded-BAHaY-Oh.js → pi-embedded-CJVNBk0y.js} +150 -150
  44. package/dist/pi-model-discovery-7IzK0Uc3.js +131 -0
  45. package/dist/pi-model-discovery-runtime-DABef3qy.js +12 -0
  46. package/dist/{pi-tools.before-tool-call.runtime-D_mthvtC.js → pi-tools.before-tool-call.runtime-BP2UvGJb.js} +10 -10
  47. package/dist/plugin-sdk/active-listener-CN-tMEvN.js +35 -0
  48. package/dist/plugin-sdk/api-key-rotation-CimGYMBc.js +176 -0
  49. package/dist/plugin-sdk/audio-preflight-C-xXBoE2.js +51 -0
  50. package/dist/plugin-sdk/audio-transcription-runner-CTIHpebA.js +2173 -0
  51. package/dist/plugin-sdk/audit-membership-runtime-BFatB2LJ.js +58 -0
  52. package/dist/plugin-sdk/channel-activity-DO0FEzyj.js +95 -0
  53. package/dist/plugin-sdk/channel-web-Da-__nUF.js +2238 -0
  54. package/dist/plugin-sdk/commands-registry-6no2NNrY.js +1118 -0
  55. package/dist/plugin-sdk/compact.runtime-CCoclu5e.js +35 -0
  56. package/dist/plugin-sdk/compat.js +35 -35
  57. package/dist/plugin-sdk/config-B9ODwgpz.js +37426 -0
  58. package/dist/plugin-sdk/deliver-B1fFpKjV.js +1757 -0
  59. package/dist/plugin-sdk/deliver-runtime-DB-VRMe1.js +15 -0
  60. package/dist/plugin-sdk/deps-send-discord.runtime-DklqycYG.js +15 -0
  61. package/dist/plugin-sdk/deps-send-imessage.runtime-Chs8zeon.js +14 -0
  62. package/dist/plugin-sdk/deps-send-signal.runtime-clW9aSJP.js +13 -0
  63. package/dist/plugin-sdk/deps-send-slack.runtime-BUx0LYY1.js +13 -0
  64. package/dist/plugin-sdk/deps-send-telegram.runtime-LECSHgMG.js +16 -0
  65. package/dist/plugin-sdk/deps-send-whatsapp.runtime-D2d65fw0.js +40 -0
  66. package/dist/plugin-sdk/diagnostic-CxIvS-C2.js +315 -0
  67. package/dist/plugin-sdk/dispatch-BqlR4dPx.js +105863 -0
  68. package/dist/plugin-sdk/env-b9k1PHMI.js +34 -0
  69. package/dist/plugin-sdk/fetch-PoxzAANT.js +326 -0
  70. package/dist/plugin-sdk/fetch-guard-4UVSZ0uS.js +164 -0
  71. package/dist/plugin-sdk/image-Ch6M4tnJ.js +2420 -0
  72. package/dist/plugin-sdk/image-runtime-CSh2o5wY.js +8 -0
  73. package/dist/plugin-sdk/ir-CugsqGH8.js +1312 -0
  74. package/dist/plugin-sdk/local-roots-adnEg9zb.js +217 -0
  75. package/dist/plugin-sdk/logger-D6zRubj0.js +1164 -0
  76. package/dist/plugin-sdk/login-CYvkQ0At.js +54 -0
  77. package/dist/plugin-sdk/login-qr-ll4NtaT5.js +316 -0
  78. package/dist/plugin-sdk/manager-CHy8IclH.js +3959 -0
  79. package/dist/plugin-sdk/manager-runtime-C70EkEr7.js +11 -0
  80. package/dist/plugin-sdk/outbound-Wzs2iN7X.js +216 -0
  81. package/dist/plugin-sdk/outbound-attachment-khXJwucX.js +17 -0
  82. package/dist/plugin-sdk/paths-BtVqCdw4.js +3063 -0
  83. package/dist/{pi-model-discovery-ItS07aJB.js → plugin-sdk/pi-model-discovery-Dh4ziodY.js} +2 -2
  84. package/dist/plugin-sdk/pi-model-discovery-runtime-b83Xe-HT.js +8 -0
  85. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C1z5CDBF.js +349 -0
  86. package/dist/{proxy-fetch-c1ZUFFcO.js → plugin-sdk/proxy-fetch-CJEmoBxi.js} +1 -1
  87. package/dist/plugin-sdk/pw-ai-Dj3Cvlzl.js +1990 -0
  88. package/dist/plugin-sdk/qmd-manager-egHUAseQ.js +1581 -0
  89. package/dist/plugin-sdk/resolve-outbound-target-BiICvIKs.js +38 -0
  90. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DNApufzW.js +9 -0
  91. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-CBmtfIQ8.js +13 -0
  92. package/dist/plugin-sdk/send-CScblaI4.js +532 -0
  93. package/dist/plugin-sdk/send-CeHhnld6.js +407 -0
  94. package/dist/plugin-sdk/send-DP_c8JfR.js +3277 -0
  95. package/dist/plugin-sdk/send-Dc5fI6e8.js +495 -0
  96. package/dist/plugin-sdk/send-l-77_s1_.js +2507 -0
  97. package/dist/plugin-sdk/session-CkOKZaqa.js +166 -0
  98. package/dist/plugin-sdk/signal.js +2 -2
  99. package/dist/plugin-sdk/skill-commands-BohYCgkq.js +336 -0
  100. package/dist/plugin-sdk/slash-commands.runtime-DpLfVTM6.js +8 -0
  101. package/dist/plugin-sdk/slash-dispatch.runtime-CASMHwpm.js +35 -0
  102. package/dist/plugin-sdk/slash-skill-commands.runtime-D7rrJEci.js +9 -0
  103. package/dist/plugin-sdk/sqlite-CJE3X7Mv.js +1005 -0
  104. package/dist/plugin-sdk/subagent-registry-runtime-B1oo5bih.js +35 -0
  105. package/dist/plugin-sdk/tables-D5VgpTmm.js +53 -0
  106. package/dist/plugin-sdk/target-errors-C6zZ_OpA.js +191 -0
  107. package/dist/{tokens-BWDIKewp.js → plugin-sdk/tokens-DUnJnpMS.js} +1 -1
  108. package/dist/plugin-sdk/web-TfUM1nSi.js +39 -0
  109. package/dist/plugin-sdk/whatsapp-actions-DuWJ0j1r.js +71 -0
  110. package/dist/proxy-fetch-BOh1PLOW.js +54 -0
  111. package/dist/{pw-ai-Ok6KGelf.js → pw-ai-DwH5GpEO.js} +9 -9
  112. package/dist/{qmd-manager-DhfEz4Ar.js → qmd-manager-DEscZz5_.js} +6 -6
  113. package/dist/{query-expansion-GqNV2iIE.js → query-expansion-BErUY8P2.js} +4 -4
  114. package/dist/runtime-whatsapp-login.runtime-BI3U306v.js +13 -0
  115. package/dist/runtime-whatsapp-outbound.runtime-Bsc2uD09.js +17 -0
  116. package/dist/{send-DwAoiT2p.js → send-BDnOgWIp.js} +25 -25
  117. package/dist/{send-CS0ocZHl.js → send-C-Q_WPMf.js} +3 -3
  118. package/dist/{send-6R8b9zsj.js → send-DUibfNQD.js} +5 -5
  119. package/dist/{send-DPflcjM5.js → send-DtBvCnPQ.js} +6 -6
  120. package/dist/{send-CEg4P96c.js → send-ORtn50qg.js} +5 -5
  121. package/dist/{session-BoIID5UR.js → session-B7imi6T5.js} +7 -7
  122. package/dist/{skill-commands-DhdiziMs.js → skill-commands-B9brPuiL.js} +9 -9
  123. package/dist/slash-commands.runtime-Cf6ygfBp.js +12 -0
  124. package/dist/slash-dispatch.runtime-CsmvhO5K.js +39 -0
  125. package/dist/slash-skill-commands.runtime-CX7stIEP.js +13 -0
  126. package/dist/subagent-registry-runtime-B_S1nf7y.js +39 -0
  127. package/dist/{subsystem-C8z6w6xC.js → subsystem-DfXy5gUB.js} +14 -14
  128. package/dist/{tables-DQusRhkD.js → tables-CjQqTOdD.js} +1 -1
  129. package/dist/{target-errors-CfavnC9U.js → target-errors-BZE1mc-W.js} +1 -1
  130. package/dist/tokens-6ul2IrzG.js +50 -0
  131. package/dist/{web-CrcrTQ2c.js → web-Cd8yK1Zq.js} +39 -39
  132. package/dist/{whatsapp-actions-B0u0ZAme.js → whatsapp-actions-CYEzUMBI.js} +15 -15
  133. package/dist/{workspace-CWDYHR27.js → workspace-DGIcKCCW.js} +20 -20
  134. package/extensions/cclawd-mfa-auth/README.md +118 -0
  135. package/extensions/cclawd-mfa-auth/index.ts +382 -0
  136. package/extensions/cclawd-mfa-auth/openclaw.plugin.json +34 -0
  137. package/extensions/cclawd-mfa-auth/package.json +27 -0
  138. package/extensions/cclawd-mfa-auth/src/auth-manager.ts +536 -0
  139. package/extensions/cclawd-mfa-auth/src/config.ts +82 -0
  140. package/extensions/cclawd-mfa-auth/src/dabby-client.ts +200 -0
  141. package/extensions/cclawd-mfa-auth/src/notification-service.ts +417 -0
  142. package/extensions/cclawd-mfa-auth/src/polling-manager.ts +232 -0
  143. package/extensions/cclawd-mfa-auth/src/providers/base.ts +25 -0
  144. package/extensions/cclawd-mfa-auth/src/providers/qr-code.ts +98 -0
  145. package/extensions/cclawd-mfa-auth/src/sensitive-detector.ts +159 -0
  146. package/extensions/cclawd-mfa-auth/src/session-resolver.ts +159 -0
  147. package/extensions/cclawd-mfa-auth/src/types.ts +156 -0
  148. package/extensions/mfa-auth/index.ts +675 -1028
  149. package/extensions/mfa-auth/openclaw.plugin.json +1 -1
  150. package/extensions/mfa-auth/src/notification-service.ts +2 -8
  151. package/package.json +453 -453
  152. package/dist/compact.runtime-BEn3giMt.js +0 -39
  153. package/dist/deliver-runtime-DkQ3XzGv.js +0 -19
  154. package/dist/deps-send-discord.runtime-BLpqSj6s.js +0 -19
  155. package/dist/deps-send-imessage.runtime-BFzyYqvR.js +0 -18
  156. package/dist/deps-send-signal.runtime-DT0TYCy1.js +0 -17
  157. package/dist/deps-send-slack.runtime-BhaGFfMX.js +0 -17
  158. package/dist/deps-send-telegram.runtime-B6Cic9NX.js +0 -20
  159. package/dist/deps-send-whatsapp.runtime-WtEhIq2S.js +0 -43
  160. package/dist/image-runtime-B1LFYfQ2.js +0 -12
  161. package/dist/manager-runtime-Da7ME9vS.js +0 -15
  162. package/dist/pi-model-discovery-runtime-DjM7Z1fx.js +0 -12
  163. package/dist/runtime-whatsapp-login.runtime-D4BRhQkK.js +0 -13
  164. package/dist/runtime-whatsapp-outbound.runtime-DJPpS6g-.js +0 -17
  165. package/dist/slash-commands.runtime-Cu1lTjV9.js +0 -12
  166. package/dist/slash-dispatch.runtime-DRVJEF4l.js +0 -39
  167. package/dist/slash-skill-commands.runtime-C373PJjv.js +0 -13
  168. package/dist/subagent-registry-runtime-D7hWBo1G.js +0 -39
@@ -0,0 +1,58 @@
1
+ import "./paths-eFexkPEh.js";
2
+ import { b as isRecord } from "./logger-D6zRubj0.js";
3
+ import "./env-b9k1PHMI.js";
4
+ import { n as fetchWithTimeout } from "./fetch-timeout-D2j7yeE1.js";
5
+ import "./fetch-BSKpf2dM.js";
6
+ import { n as makeProxyFetch } from "./proxy-fetch-CJEmoBxi.js";
7
+ import { t as resolveTelegramFetch } from "./fetch-PoxzAANT.js";
8
+ //#region src/telegram/audit-membership-runtime.ts
9
+ const TELEGRAM_API_BASE = "https://api.telegram.org";
10
+ async function auditTelegramGroupMembershipImpl(params) {
11
+ const fetcher = resolveTelegramFetch(params.proxyUrl ? makeProxyFetch(params.proxyUrl) : void 0, { network: params.network });
12
+ const base = `${TELEGRAM_API_BASE}/bot${params.token}`;
13
+ const groups = [];
14
+ for (const chatId of params.groupIds) try {
15
+ const res = await fetchWithTimeout(`${base}/getChatMember?chat_id=${encodeURIComponent(chatId)}&user_id=${encodeURIComponent(String(params.botId))}`, {}, params.timeoutMs, fetcher);
16
+ const json = await res.json();
17
+ if (!res.ok || !isRecord(json) || !json.ok) {
18
+ const desc = isRecord(json) && !json.ok && typeof json.description === "string" ? json.description : `getChatMember failed (${res.status})`;
19
+ groups.push({
20
+ chatId,
21
+ ok: false,
22
+ status: null,
23
+ error: desc,
24
+ matchKey: chatId,
25
+ matchSource: "id"
26
+ });
27
+ continue;
28
+ }
29
+ const status = isRecord(json.result) ? json.result.status ?? null : null;
30
+ const ok = status === "creator" || status === "administrator" || status === "member";
31
+ groups.push({
32
+ chatId,
33
+ ok,
34
+ status,
35
+ error: ok ? null : "bot not in group",
36
+ matchKey: chatId,
37
+ matchSource: "id"
38
+ });
39
+ } catch (err) {
40
+ groups.push({
41
+ chatId,
42
+ ok: false,
43
+ status: null,
44
+ error: err instanceof Error ? err.message : String(err),
45
+ matchKey: chatId,
46
+ matchSource: "id"
47
+ });
48
+ }
49
+ return {
50
+ ok: groups.every((g) => g.ok),
51
+ checkedGroups: groups.length,
52
+ unresolvedGroups: 0,
53
+ hasWildcardUnmentionedGroups: false,
54
+ groups
55
+ };
56
+ }
57
+ //#endregion
58
+ export { auditTelegramGroupMembershipImpl };
@@ -0,0 +1,95 @@
1
+ import { Hs as formatErrorMessage, in as retryAsync, rn as resolveRetryConfig } from "./config-B9ODwgpz.js";
2
+ import { a as createSubsystemLogger } from "./logger-D6zRubj0.js";
3
+ import { RateLimitError } from "@buape/carbon";
4
+ //#region src/infra/retry-policy.ts
5
+ const DISCORD_RETRY_DEFAULTS = {
6
+ attempts: 3,
7
+ minDelayMs: 500,
8
+ maxDelayMs: 3e4,
9
+ jitter: .1
10
+ };
11
+ const TELEGRAM_RETRY_DEFAULTS = {
12
+ attempts: 3,
13
+ minDelayMs: 400,
14
+ maxDelayMs: 3e4,
15
+ jitter: .1
16
+ };
17
+ const TELEGRAM_RETRY_RE = /429|timeout|connect|reset|closed|unavailable|temporarily/i;
18
+ const log = createSubsystemLogger("retry-policy");
19
+ function resolveTelegramShouldRetry(params) {
20
+ if (!params.shouldRetry) return (err) => TELEGRAM_RETRY_RE.test(formatErrorMessage(err));
21
+ if (params.strictShouldRetry) return params.shouldRetry;
22
+ return (err) => params.shouldRetry?.(err) || TELEGRAM_RETRY_RE.test(formatErrorMessage(err));
23
+ }
24
+ function getTelegramRetryAfterMs(err) {
25
+ if (!err || typeof err !== "object") return;
26
+ const candidate = "parameters" in err && err.parameters && typeof err.parameters === "object" ? err.parameters.retry_after : "response" in err && err.response && typeof err.response === "object" && "parameters" in err.response ? err.response.parameters?.retry_after : "error" in err && err.error && typeof err.error === "object" && "parameters" in err.error ? err.error.parameters?.retry_after : void 0;
27
+ return typeof candidate === "number" && Number.isFinite(candidate) ? candidate * 1e3 : void 0;
28
+ }
29
+ function createDiscordRetryRunner(params) {
30
+ const retryConfig = resolveRetryConfig(DISCORD_RETRY_DEFAULTS, {
31
+ ...params.configRetry,
32
+ ...params.retry
33
+ });
34
+ return (fn, label) => retryAsync(fn, {
35
+ ...retryConfig,
36
+ label,
37
+ shouldRetry: (err) => err instanceof RateLimitError,
38
+ retryAfterMs: (err) => err instanceof RateLimitError ? err.retryAfter * 1e3 : void 0,
39
+ onRetry: params.verbose ? (info) => {
40
+ const labelText = info.label ?? "request";
41
+ const maxRetries = Math.max(1, info.maxAttempts - 1);
42
+ log.warn(`discord ${labelText} rate limited, retry ${info.attempt}/${maxRetries} in ${info.delayMs}ms`);
43
+ } : void 0
44
+ });
45
+ }
46
+ function createTelegramRetryRunner(params) {
47
+ const retryConfig = resolveRetryConfig(TELEGRAM_RETRY_DEFAULTS, {
48
+ ...params.configRetry,
49
+ ...params.retry
50
+ });
51
+ const shouldRetry = resolveTelegramShouldRetry(params);
52
+ return (fn, label) => retryAsync(fn, {
53
+ ...retryConfig,
54
+ label,
55
+ shouldRetry,
56
+ retryAfterMs: getTelegramRetryAfterMs,
57
+ onRetry: params.verbose ? (info) => {
58
+ const maxRetries = Math.max(1, info.maxAttempts - 1);
59
+ log.warn(`telegram send retry ${info.attempt}/${maxRetries} for ${info.label ?? label ?? "request"} in ${info.delayMs}ms: ${formatErrorMessage(info.err)}`);
60
+ } : void 0
61
+ });
62
+ }
63
+ //#endregion
64
+ //#region src/infra/channel-activity.ts
65
+ const activity = /* @__PURE__ */ new Map();
66
+ function keyFor(channel, accountId) {
67
+ return `${channel}:${accountId || "default"}`;
68
+ }
69
+ function ensureEntry(channel, accountId) {
70
+ const key = keyFor(channel, accountId);
71
+ const existing = activity.get(key);
72
+ if (existing) return existing;
73
+ const created = {
74
+ inboundAt: null,
75
+ outboundAt: null
76
+ };
77
+ activity.set(key, created);
78
+ return created;
79
+ }
80
+ function recordChannelActivity(params) {
81
+ const at = typeof params.at === "number" ? params.at : Date.now();
82
+ const accountId = params.accountId?.trim() || "default";
83
+ const entry = ensureEntry(params.channel, accountId);
84
+ if (params.direction === "inbound") entry.inboundAt = at;
85
+ if (params.direction === "outbound") entry.outboundAt = at;
86
+ }
87
+ function getChannelActivity(params) {
88
+ const accountId = params.accountId?.trim() || "default";
89
+ return activity.get(keyFor(params.channel, accountId)) ?? {
90
+ inboundAt: null,
91
+ outboundAt: null
92
+ };
93
+ }
94
+ //#endregion
95
+ export { createTelegramRetryRunner as i, recordChannelActivity as n, createDiscordRetryRunner as r, getChannelActivity as t };