cclawd 1.0.4 → 1.0.5

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 (67) hide show
  1. package/dist/build-info.json +2 -2
  2. package/dist/plugin-sdk/imessage.js +2 -2
  3. package/dist/plugin-sdk/index.js +35 -35
  4. package/dist/plugin-sdk/signal.js +2 -2
  5. package/extensions/mfa-auth/src/notification-service.ts +68 -24
  6. package/package.json +1 -1
  7. package/dist/plugin-sdk/active-listener-CN-tMEvN.js +0 -35
  8. package/dist/plugin-sdk/api-key-rotation-CimGYMBc.js +0 -176
  9. package/dist/plugin-sdk/audio-preflight-C-xXBoE2.js +0 -51
  10. package/dist/plugin-sdk/audio-transcription-runner-CTIHpebA.js +0 -2173
  11. package/dist/plugin-sdk/audit-membership-runtime-BFatB2LJ.js +0 -58
  12. package/dist/plugin-sdk/channel-activity-DO0FEzyj.js +0 -95
  13. package/dist/plugin-sdk/channel-web-Da-__nUF.js +0 -2238
  14. package/dist/plugin-sdk/commands-registry-6no2NNrY.js +0 -1118
  15. package/dist/plugin-sdk/compact.runtime-CCoclu5e.js +0 -35
  16. package/dist/plugin-sdk/config-B9ODwgpz.js +0 -37426
  17. package/dist/plugin-sdk/deliver-B1fFpKjV.js +0 -1757
  18. package/dist/plugin-sdk/deliver-runtime-DB-VRMe1.js +0 -15
  19. package/dist/plugin-sdk/deps-send-discord.runtime-DklqycYG.js +0 -15
  20. package/dist/plugin-sdk/deps-send-imessage.runtime-Chs8zeon.js +0 -14
  21. package/dist/plugin-sdk/deps-send-signal.runtime-clW9aSJP.js +0 -13
  22. package/dist/plugin-sdk/deps-send-slack.runtime-BUx0LYY1.js +0 -13
  23. package/dist/plugin-sdk/deps-send-telegram.runtime-LECSHgMG.js +0 -16
  24. package/dist/plugin-sdk/deps-send-whatsapp.runtime-D2d65fw0.js +0 -40
  25. package/dist/plugin-sdk/diagnostic-CxIvS-C2.js +0 -315
  26. package/dist/plugin-sdk/dispatch-BqlR4dPx.js +0 -105863
  27. package/dist/plugin-sdk/env-b9k1PHMI.js +0 -34
  28. package/dist/plugin-sdk/fetch-PoxzAANT.js +0 -326
  29. package/dist/plugin-sdk/fetch-guard-4UVSZ0uS.js +0 -164
  30. package/dist/plugin-sdk/image-Ch6M4tnJ.js +0 -2420
  31. package/dist/plugin-sdk/image-runtime-CSh2o5wY.js +0 -8
  32. package/dist/plugin-sdk/ir-CugsqGH8.js +0 -1312
  33. package/dist/plugin-sdk/local-roots-adnEg9zb.js +0 -217
  34. package/dist/plugin-sdk/logger-D6zRubj0.js +0 -1164
  35. package/dist/plugin-sdk/login-CYvkQ0At.js +0 -54
  36. package/dist/plugin-sdk/login-qr-ll4NtaT5.js +0 -316
  37. package/dist/plugin-sdk/manager-CHy8IclH.js +0 -3959
  38. package/dist/plugin-sdk/manager-runtime-C70EkEr7.js +0 -11
  39. package/dist/plugin-sdk/outbound-Wzs2iN7X.js +0 -216
  40. package/dist/plugin-sdk/outbound-attachment-khXJwucX.js +0 -17
  41. package/dist/plugin-sdk/paths-BtVqCdw4.js +0 -3063
  42. package/dist/plugin-sdk/pi-model-discovery-Dh4ziodY.js +0 -131
  43. package/dist/plugin-sdk/pi-model-discovery-runtime-b83Xe-HT.js +0 -8
  44. package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-C1z5CDBF.js +0 -349
  45. package/dist/plugin-sdk/proxy-fetch-CJEmoBxi.js +0 -54
  46. package/dist/plugin-sdk/pw-ai-Dj3Cvlzl.js +0 -1990
  47. package/dist/plugin-sdk/qmd-manager-egHUAseQ.js +0 -1581
  48. package/dist/plugin-sdk/resolve-outbound-target-BiICvIKs.js +0 -38
  49. package/dist/plugin-sdk/runtime-whatsapp-login.runtime-DNApufzW.js +0 -9
  50. package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-CBmtfIQ8.js +0 -13
  51. package/dist/plugin-sdk/send-CScblaI4.js +0 -532
  52. package/dist/plugin-sdk/send-CeHhnld6.js +0 -407
  53. package/dist/plugin-sdk/send-DP_c8JfR.js +0 -3277
  54. package/dist/plugin-sdk/send-Dc5fI6e8.js +0 -495
  55. package/dist/plugin-sdk/send-l-77_s1_.js +0 -2507
  56. package/dist/plugin-sdk/session-CkOKZaqa.js +0 -166
  57. package/dist/plugin-sdk/skill-commands-BohYCgkq.js +0 -336
  58. package/dist/plugin-sdk/slash-commands.runtime-DpLfVTM6.js +0 -8
  59. package/dist/plugin-sdk/slash-dispatch.runtime-CASMHwpm.js +0 -35
  60. package/dist/plugin-sdk/slash-skill-commands.runtime-D7rrJEci.js +0 -9
  61. package/dist/plugin-sdk/sqlite-CJE3X7Mv.js +0 -1005
  62. package/dist/plugin-sdk/subagent-registry-runtime-B1oo5bih.js +0 -35
  63. package/dist/plugin-sdk/tables-D5VgpTmm.js +0 -53
  64. package/dist/plugin-sdk/target-errors-C6zZ_OpA.js +0 -191
  65. package/dist/plugin-sdk/tokens-DUnJnpMS.js +0 -50
  66. package/dist/plugin-sdk/web-TfUM1nSi.js +0 -39
  67. package/dist/plugin-sdk/whatsapp-actions-DuWJ0j1r.js +0 -71
@@ -1,58 +0,0 @@
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 };
@@ -1,95 +0,0 @@
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 };