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,35 +0,0 @@
1
- import "./paths-BtVqCdw4.js";
2
- import "./config-B9ODwgpz.js";
3
- import { a as countPendingDescendantRuns, c as listSubagentRunsForRequester, d as shouldIgnorePostCompletionAnnounceForSession, i as countActiveDescendantRuns, l as replaceSubagentRunAfterSteer, o as countPendingDescendantRunsExcludingRun, s as isSubagentSessionRunActive, u as resolveRequesterForChildSession } from "./dispatch-BqlR4dPx.js";
4
- import "./paths-eFexkPEh.js";
5
- import "./github-copilot-token-Cxf8QYZb.js";
6
- import "./logger-D6zRubj0.js";
7
- import "./env-b9k1PHMI.js";
8
- import "./send-DP_c8JfR.js";
9
- import "./fetch-BSKpf2dM.js";
10
- import "./channel-activity-DO0FEzyj.js";
11
- import "./fetch-guard-4UVSZ0uS.js";
12
- import "./local-roots-adnEg9zb.js";
13
- import "./ir-CugsqGH8.js";
14
- import "./render-CKf6NJ1M.js";
15
- import "./tables-D5VgpTmm.js";
16
- import "./send-l-77_s1_.js";
17
- import "./target-errors-C6zZ_OpA.js";
18
- import "./send-CeHhnld6.js";
19
- import "./deliver-B1fFpKjV.js";
20
- import "./diagnostic-CxIvS-C2.js";
21
- import "./pi-model-discovery-Dh4ziodY.js";
22
- import "./audio-transcription-runner-CTIHpebA.js";
23
- import "./image-Ch6M4tnJ.js";
24
- import "./api-key-rotation-CimGYMBc.js";
25
- import "./proxy-fetch-CJEmoBxi.js";
26
- import "./tokens-DUnJnpMS.js";
27
- import "./commands-registry-6no2NNrY.js";
28
- import "./skill-commands-BohYCgkq.js";
29
- import "./send-CScblaI4.js";
30
- import "./outbound-attachment-khXJwucX.js";
31
- import "./send-Dc5fI6e8.js";
32
- import "./sqlite-CJE3X7Mv.js";
33
- import "./fetch-PoxzAANT.js";
34
- import "./manager-CHy8IclH.js";
35
- export { countActiveDescendantRuns, countPendingDescendantRuns, countPendingDescendantRunsExcludingRun, isSubagentSessionRunActive, listSubagentRunsForRequester, replaceSubagentRunAfterSteer, resolveRequesterForChildSession, shouldIgnorePostCompletionAnnounceForSession };
@@ -1,53 +0,0 @@
1
- import { r as markdownToIRWithMeta } from "./ir-CugsqGH8.js";
2
- import { t as renderMarkdownWithMarkers } from "./render-CKf6NJ1M.js";
3
- //#region src/markdown/tables.ts
4
- const MARKDOWN_STYLE_MARKERS = {
5
- bold: {
6
- open: "**",
7
- close: "**"
8
- },
9
- italic: {
10
- open: "_",
11
- close: "_"
12
- },
13
- strikethrough: {
14
- open: "~~",
15
- close: "~~"
16
- },
17
- code: {
18
- open: "`",
19
- close: "`"
20
- },
21
- code_block: {
22
- open: "```\n",
23
- close: "```"
24
- }
25
- };
26
- function convertMarkdownTables(markdown, mode) {
27
- if (!markdown || mode === "off") return markdown;
28
- const { ir, hasTables } = markdownToIRWithMeta(markdown, {
29
- linkify: false,
30
- autolink: false,
31
- headingStyle: "none",
32
- blockquotePrefix: "",
33
- tableMode: mode
34
- });
35
- if (!hasTables) return markdown;
36
- return renderMarkdownWithMarkers(ir, {
37
- styleMarkers: MARKDOWN_STYLE_MARKERS,
38
- escapeText: (text) => text,
39
- buildLink: (link, text) => {
40
- const href = link.href.trim();
41
- if (!href) return null;
42
- if (!text.slice(link.start, link.end)) return null;
43
- return {
44
- start: link.start,
45
- end: link.end,
46
- open: "[",
47
- close: `](${href})`
48
- };
49
- }
50
- });
51
- }
52
- //#endregion
53
- export { convertMarkdownTables as t };
@@ -1,191 +0,0 @@
1
- import { Ts as detectMime, Vn as sanitizeToolResultImages } from "./config-B9ODwgpz.js";
2
- import fs from "node:fs/promises";
3
- //#region src/agents/tools/common.ts
4
- var ToolInputError = class extends Error {
5
- constructor(message) {
6
- super(message);
7
- this.status = 400;
8
- this.name = "ToolInputError";
9
- }
10
- };
11
- var ToolAuthorizationError = class extends ToolInputError {
12
- constructor(message) {
13
- super(message);
14
- this.status = 403;
15
- this.name = "ToolAuthorizationError";
16
- }
17
- };
18
- function createActionGate(actions) {
19
- return (key, defaultValue = true) => {
20
- const value = actions?.[key];
21
- if (value === void 0) return defaultValue;
22
- return value !== false;
23
- };
24
- }
25
- function toSnakeCaseKey(key) {
26
- return key.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
27
- }
28
- function readParamRaw(params, key) {
29
- if (Object.hasOwn(params, key)) return params[key];
30
- const snakeKey = toSnakeCaseKey(key);
31
- if (snakeKey !== key && Object.hasOwn(params, snakeKey)) return params[snakeKey];
32
- }
33
- function readStringParam(params, key, options = {}) {
34
- const { required = false, trim = true, label = key, allowEmpty = false } = options;
35
- const raw = readParamRaw(params, key);
36
- if (typeof raw !== "string") {
37
- if (required) throw new ToolInputError(`${label} required`);
38
- return;
39
- }
40
- const value = trim ? raw.trim() : raw;
41
- if (!value && !allowEmpty) {
42
- if (required) throw new ToolInputError(`${label} required`);
43
- return;
44
- }
45
- return value;
46
- }
47
- function readStringOrNumberParam(params, key, options = {}) {
48
- const { required = false, label = key } = options;
49
- const raw = readParamRaw(params, key);
50
- if (typeof raw === "number" && Number.isFinite(raw)) return String(raw);
51
- if (typeof raw === "string") {
52
- const value = raw.trim();
53
- if (value) return value;
54
- }
55
- if (required) throw new ToolInputError(`${label} required`);
56
- }
57
- function readNumberParam(params, key, options = {}) {
58
- const { required = false, label = key, integer = false, strict = false } = options;
59
- const raw = readParamRaw(params, key);
60
- let value;
61
- if (typeof raw === "number" && Number.isFinite(raw)) value = raw;
62
- else if (typeof raw === "string") {
63
- const trimmed = raw.trim();
64
- if (trimmed) {
65
- const parsed = strict ? Number(trimmed) : Number.parseFloat(trimmed);
66
- if (Number.isFinite(parsed)) value = parsed;
67
- }
68
- }
69
- if (value === void 0) {
70
- if (required) throw new ToolInputError(`${label} required`);
71
- return;
72
- }
73
- return integer ? Math.trunc(value) : value;
74
- }
75
- function readStringArrayParam(params, key, options = {}) {
76
- const { required = false, label = key } = options;
77
- const raw = readParamRaw(params, key);
78
- if (Array.isArray(raw)) {
79
- const values = raw.filter((entry) => typeof entry === "string").map((entry) => entry.trim()).filter(Boolean);
80
- if (values.length === 0) {
81
- if (required) throw new ToolInputError(`${label} required`);
82
- return;
83
- }
84
- return values;
85
- }
86
- if (typeof raw === "string") {
87
- const value = raw.trim();
88
- if (!value) {
89
- if (required) throw new ToolInputError(`${label} required`);
90
- return;
91
- }
92
- return [value];
93
- }
94
- if (required) throw new ToolInputError(`${label} required`);
95
- }
96
- function readReactionParams(params, options) {
97
- const emojiKey = options.emojiKey ?? "emoji";
98
- const removeKey = options.removeKey ?? "remove";
99
- const remove = typeof params[removeKey] === "boolean" ? params[removeKey] : false;
100
- const emoji = readStringParam(params, emojiKey, {
101
- required: true,
102
- allowEmpty: true
103
- });
104
- if (remove && !emoji) throw new ToolInputError(options.removeErrorMessage);
105
- return {
106
- emoji,
107
- remove,
108
- isEmpty: !emoji
109
- };
110
- }
111
- function jsonResult(payload) {
112
- return {
113
- content: [{
114
- type: "text",
115
- text: JSON.stringify(payload, null, 2)
116
- }],
117
- details: payload
118
- };
119
- }
120
- async function imageResult(params) {
121
- return await sanitizeToolResultImages({
122
- content: [{
123
- type: "text",
124
- text: params.extraText ?? `MEDIA:${params.path}`
125
- }, {
126
- type: "image",
127
- data: params.base64,
128
- mimeType: params.mimeType
129
- }],
130
- details: {
131
- path: params.path,
132
- ...params.details
133
- }
134
- }, params.label, params.imageSanitization);
135
- }
136
- async function imageResultFromFile(params) {
137
- const buf = await fs.readFile(params.path);
138
- const mimeType = await detectMime({ buffer: buf.slice(0, 256) }) ?? "image/png";
139
- return await imageResult({
140
- label: params.label,
141
- path: params.path,
142
- base64: buf.toString("base64"),
143
- mimeType,
144
- extraText: params.extraText,
145
- details: params.details,
146
- imageSanitization: params.imageSanitization
147
- });
148
- }
149
- /**
150
- * Validate and parse an `availableTags` parameter from untrusted input.
151
- * Returns `undefined` when the value is missing or not an array.
152
- * Entries that lack a string `name` are silently dropped.
153
- */
154
- function parseAvailableTags(raw) {
155
- if (raw === void 0 || raw === null) return;
156
- if (!Array.isArray(raw)) return;
157
- const result = raw.filter((t) => typeof t === "object" && t !== null && typeof t.name === "string").map((t) => ({
158
- ...t.id !== void 0 && typeof t.id === "string" ? { id: t.id } : {},
159
- name: t.name,
160
- ...typeof t.moderated === "boolean" ? { moderated: t.moderated } : {},
161
- ...t.emoji_id === null || typeof t.emoji_id === "string" ? { emoji_id: t.emoji_id } : {},
162
- ...t.emoji_name === null || typeof t.emoji_name === "string" ? { emoji_name: t.emoji_name } : {}
163
- }));
164
- return result.length ? result : void 0;
165
- }
166
- //#endregion
167
- //#region src/infra/outbound/target-errors.ts
168
- function missingTargetMessage(provider, hint) {
169
- return `Delivering to ${provider} requires target${formatTargetHint(hint)}`;
170
- }
171
- function missingTargetError(provider, hint) {
172
- return new Error(missingTargetMessage(provider, hint));
173
- }
174
- function ambiguousTargetMessage(provider, raw, hint) {
175
- return `Ambiguous target "${raw}" for ${provider}. Provide a unique name or an explicit id.${formatTargetHint(hint, true)}`;
176
- }
177
- function ambiguousTargetError(provider, raw, hint) {
178
- return new Error(ambiguousTargetMessage(provider, raw, hint));
179
- }
180
- function unknownTargetMessage(provider, raw, hint) {
181
- return `Unknown target "${raw}" for ${provider}.${formatTargetHint(hint, true)}`;
182
- }
183
- function unknownTargetError(provider, raw, hint) {
184
- return new Error(unknownTargetMessage(provider, raw, hint));
185
- }
186
- function formatTargetHint(hint, withLabel = false) {
187
- if (!hint) return "";
188
- return withLabel ? ` Hint: ${hint}` : ` ${hint}`;
189
- }
190
- //#endregion
191
- export { ToolInputError as a, imageResultFromFile as c, readNumberParam as d, readReactionParams as f, readStringParam as h, ToolAuthorizationError as i, jsonResult as l, readStringOrNumberParam as m, missingTargetError as n, createActionGate as o, readStringArrayParam as p, unknownTargetError as r, imageResult as s, ambiguousTargetError as t, parseAvailableTags as u };
@@ -1,50 +0,0 @@
1
- import { v as escapeRegExp } from "./logger-D6zRubj0.js";
2
- //#region src/auto-reply/tokens.ts
3
- const HEARTBEAT_TOKEN = "HEARTBEAT_OK";
4
- const SILENT_REPLY_TOKEN = "NO_REPLY";
5
- const silentExactRegexByToken = /* @__PURE__ */ new Map();
6
- const silentTrailingRegexByToken = /* @__PURE__ */ new Map();
7
- function getSilentExactRegex(token) {
8
- const cached = silentExactRegexByToken.get(token);
9
- if (cached) return cached;
10
- const escaped = escapeRegExp(token);
11
- const regex = new RegExp(`^\\s*${escaped}\\s*$`);
12
- silentExactRegexByToken.set(token, regex);
13
- return regex;
14
- }
15
- function getSilentTrailingRegex(token) {
16
- const cached = silentTrailingRegexByToken.get(token);
17
- if (cached) return cached;
18
- const escaped = escapeRegExp(token);
19
- const regex = new RegExp(`(?:^|\\s+|\\*+)${escaped}\\s*$`);
20
- silentTrailingRegexByToken.set(token, regex);
21
- return regex;
22
- }
23
- function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
24
- if (!text) return false;
25
- return getSilentExactRegex(token).test(text);
26
- }
27
- /**
28
- * Strip a trailing silent reply token from mixed-content text.
29
- * Returns the remaining text with the token removed (trimmed).
30
- * If the result is empty, the entire message should be treated as silent.
31
- */
32
- function stripSilentToken(text, token = SILENT_REPLY_TOKEN) {
33
- return text.replace(getSilentTrailingRegex(token), "").trim();
34
- }
35
- function isSilentReplyPrefixText(text, token = SILENT_REPLY_TOKEN) {
36
- if (!text) return false;
37
- const trimmed = text.trimStart();
38
- if (!trimmed) return false;
39
- if (trimmed !== trimmed.toUpperCase()) return false;
40
- const normalized = trimmed.toUpperCase();
41
- if (!normalized) return false;
42
- if (normalized.length < 2) return false;
43
- if (/[^A-Z_]/.test(normalized)) return false;
44
- const tokenUpper = token.toUpperCase();
45
- if (!tokenUpper.startsWith(normalized)) return false;
46
- if (normalized.includes("_")) return true;
47
- return tokenUpper === "NO_REPLY" && normalized === "NO";
48
- }
49
- //#endregion
50
- export { stripSilentToken as a, isSilentReplyText as i, SILENT_REPLY_TOKEN as n, isSilentReplyPrefixText as r, HEARTBEAT_TOKEN as t };
@@ -1,39 +0,0 @@
1
- import "./paths-BtVqCdw4.js";
2
- import { Ka as logWebSelfId, Wa as WA_WEB_AUTH_DIR, Ya as pickWebChannel, to as webAuthExists } from "./config-B9ODwgpz.js";
3
- import "./dispatch-BqlR4dPx.js";
4
- import "./paths-eFexkPEh.js";
5
- import "./github-copilot-token-Cxf8QYZb.js";
6
- import "./logger-D6zRubj0.js";
7
- import "./env-b9k1PHMI.js";
8
- import "./send-DP_c8JfR.js";
9
- import "./fetch-BSKpf2dM.js";
10
- import "./channel-activity-DO0FEzyj.js";
11
- import "./fetch-guard-4UVSZ0uS.js";
12
- import "./local-roots-adnEg9zb.js";
13
- import "./ir-CugsqGH8.js";
14
- import "./render-CKf6NJ1M.js";
15
- import "./tables-D5VgpTmm.js";
16
- import "./send-l-77_s1_.js";
17
- import "./target-errors-C6zZ_OpA.js";
18
- import "./send-CeHhnld6.js";
19
- import "./deliver-B1fFpKjV.js";
20
- import "./diagnostic-CxIvS-C2.js";
21
- import "./pi-model-discovery-Dh4ziodY.js";
22
- import "./audio-transcription-runner-CTIHpebA.js";
23
- import "./image-Ch6M4tnJ.js";
24
- import "./api-key-rotation-CimGYMBc.js";
25
- import "./proxy-fetch-CJEmoBxi.js";
26
- import "./tokens-DUnJnpMS.js";
27
- import "./commands-registry-6no2NNrY.js";
28
- import "./skill-commands-BohYCgkq.js";
29
- import "./send-CScblaI4.js";
30
- import "./outbound-attachment-khXJwucX.js";
31
- import "./send-Dc5fI6e8.js";
32
- import "./sqlite-CJE3X7Mv.js";
33
- import "./fetch-PoxzAANT.js";
34
- import "./manager-CHy8IclH.js";
35
- import { n as monitorWebInbox, t as monitorWebChannel } from "./channel-web-Da-__nUF.js";
36
- import { t as sendMessageWhatsApp } from "./outbound-Wzs2iN7X.js";
37
- import { i as waitForWaConnection, t as createWaSocket } from "./session-CkOKZaqa.js";
38
- import { t as loginWeb } from "./login-CYvkQ0At.js";
39
- export { WA_WEB_AUTH_DIR, createWaSocket, logWebSelfId, loginWeb, monitorWebChannel, monitorWebInbox, pickWebChannel, sendMessageWhatsApp, waitForWaConnection, webAuthExists };
@@ -1,71 +0,0 @@
1
- import "./paths-BtVqCdw4.js";
2
- import { Va as resolveWhatsAppAccount } from "./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 "./local-roots-adnEg9zb.js";
9
- import "./ir-CugsqGH8.js";
10
- import "./render-CKf6NJ1M.js";
11
- import "./tables-D5VgpTmm.js";
12
- import { f as readReactionParams, h as readStringParam, i as ToolAuthorizationError, l as jsonResult, o as createActionGate } from "./target-errors-C6zZ_OpA.js";
13
- import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-BiICvIKs.js";
14
- import { r as sendReactionWhatsApp } from "./outbound-Wzs2iN7X.js";
15
- //#region src/agents/tools/whatsapp-target-auth.ts
16
- function resolveAuthorizedWhatsAppOutboundTarget(params) {
17
- const account = resolveWhatsAppAccount({
18
- cfg: params.cfg,
19
- accountId: params.accountId
20
- });
21
- const resolution = resolveWhatsAppOutboundTarget({
22
- to: params.chatJid,
23
- allowFrom: account.allowFrom ?? [],
24
- mode: "implicit"
25
- });
26
- if (!resolution.ok) throw new ToolAuthorizationError(`WhatsApp ${params.actionLabel} blocked: chatJid "${params.chatJid}" is not in the configured allowFrom list for account "${account.accountId}".`);
27
- return {
28
- to: resolution.to,
29
- accountId: account.accountId
30
- };
31
- }
32
- //#endregion
33
- //#region src/agents/tools/whatsapp-actions.ts
34
- async function handleWhatsAppAction(params, cfg) {
35
- const action = readStringParam(params, "action", { required: true });
36
- const isActionEnabled = createActionGate(cfg.channels?.whatsapp?.actions);
37
- if (action === "react") {
38
- if (!isActionEnabled("reactions")) throw new Error("WhatsApp reactions are disabled.");
39
- const chatJid = readStringParam(params, "chatJid", { required: true });
40
- const messageId = readStringParam(params, "messageId", { required: true });
41
- const { emoji, remove, isEmpty } = readReactionParams(params, { removeErrorMessage: "Emoji is required to remove a WhatsApp reaction." });
42
- const participant = readStringParam(params, "participant");
43
- const accountId = readStringParam(params, "accountId");
44
- const fromMeRaw = params.fromMe;
45
- const fromMe = typeof fromMeRaw === "boolean" ? fromMeRaw : void 0;
46
- const resolved = resolveAuthorizedWhatsAppOutboundTarget({
47
- cfg,
48
- chatJid,
49
- accountId,
50
- actionLabel: "reaction"
51
- });
52
- const resolvedEmoji = remove ? "" : emoji;
53
- await sendReactionWhatsApp(resolved.to, messageId, resolvedEmoji, {
54
- verbose: false,
55
- fromMe,
56
- participant: participant ?? void 0,
57
- accountId: resolved.accountId
58
- });
59
- if (!remove && !isEmpty) return jsonResult({
60
- ok: true,
61
- added: emoji
62
- });
63
- return jsonResult({
64
- ok: true,
65
- removed: true
66
- });
67
- }
68
- throw new Error(`Unsupported WhatsApp action: ${action}`);
69
- }
70
- //#endregion
71
- export { handleWhatsAppAction };