@openclaw/discord 2026.7.2-beta.7 → 2026.8.1-beta.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 (95) hide show
  1. package/dist/{account-inspect-SXiCBCgP.js → account-inspect-CqzrH14k.js} +48 -42
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/{active-turn-thread-route-MlKWp8RD.js → active-turn-thread-route-fmHl1HNd.js} +9 -11
  5. package/dist/{activities-api-DTKsuDxf.js → activities-api-DS7vpdtp.js} +4 -4
  6. package/dist/activities-api.js +1 -1
  7. package/dist/{allow-list-DzKrtfah.js → allow-list-DnxIlPP2.js} +2 -3
  8. package/dist/{api-DnrK9gML.js → api-DNVbJyEy.js} +7 -2
  9. package/dist/api.js +15 -15
  10. package/dist/{approval-handler.runtime-HymvFTYn.js → approval-handler.runtime-B6yEV79q.js} +5 -5
  11. package/dist/{approval-message-safety-DEyKVsAw.js → approval-message-safety-AcIxvrf3.js} +1 -1
  12. package/dist/{audit-CjsrabP8.js → audit-Db-rlntl.js} +4 -4
  13. package/dist/{channel-vKa-76xY.js → channel-CnnbJSt5.js} +46 -72
  14. package/dist/{channel-actions-uXFTJX3o.js → channel-actions-5s_hjYKd.js} +4 -4
  15. package/dist/{channel-actions.runtime-CIYU90sl.js → channel-actions.runtime-CLKrx6tr.js} +53 -36
  16. package/dist/channel-config-api.js +1 -1
  17. package/dist/channel-plugin-api.js +1 -1
  18. package/dist/{channel.setup-CmcwZ_qd.js → channel.setup-BFAO-V1P.js} +15 -53
  19. package/dist/{config-schema-WHRQcY19.js → config-schema-BgEskFAs.js} +9 -4
  20. package/dist/{directory-config-D_LojtCe.js → directory-config-BVX7Cflc.js} +1 -1
  21. package/dist/directory-contract-api.js +1 -1
  22. package/dist/{directory-live-Bw5Ephzv.js → directory-live-DGIGxpIo.js} +6 -3
  23. package/dist/{doctor-Bc4S1qyd.js → doctor-BzC-TLnB.js} +4 -4
  24. package/dist/{doctor-contract-CCFMIDk9.js → doctor-contract-DLa-BTiU.js} +2 -3
  25. package/dist/doctor-contract-api.js +147 -2
  26. package/dist/{handle-action.guild-admin-D6VRRW-C.js → handle-action.guild-admin-BNVTUISF.js} +4 -7
  27. package/dist/{inbound-event-delivery-CEPlt2uz.js → inbound-event-delivery-De2qxTrP.js} +4 -25
  28. package/dist/index.js +4 -2
  29. package/dist/{message-handler-CeiSulIw.js → message-handler-Unk_f10F.js} +41 -32
  30. package/dist/{message-handler.preflight-DibgQFf2.js → message-handler.preflight-C9zecxR9.js} +50 -26
  31. package/dist/{message-handler.process-Dnc_oz9y.js → message-handler.process-DWQ6UHHu.js} +130 -166
  32. package/dist/{message-utils-BgTwT_q7.js → message-utils-BSCPVgy0.js} +4 -4
  33. package/dist/{model-picker-preference-primitives-D25pnCOu.js → model-picker-preference-primitives-BHT1LkR_.js} +3 -3
  34. package/dist/{outbound-adapter-DtE-i2OJ.js → outbound-adapter-D9nRivT1.js} +91 -32
  35. package/dist/{outbound-components-C7GVyfPh.js → outbound-components-cTzwBJ60.js} +3 -3
  36. package/dist/{outbound-session-route-H-HoyH5U.js → outbound-session-route-DxLkrgKQ.js} +68 -95
  37. package/dist/{pluralkit-CD4B11JB.js → pluralkit-DdiJ9KMK.js} +1 -1
  38. package/dist/{preflight-audio-BjnQZ5yS.js → preflight-audio-DrnqFA8U.js} +22 -28
  39. package/dist/{probe-BeWKhjqX.js → probe-Bl-k5_Ku.js} +36 -12
  40. package/dist/probe.runtime-M9fREKvp.js +2 -0
  41. package/dist/{provider-DfQJX3z5.js → provider-DvSNb-2v.js} +969 -1248
  42. package/dist/{provider-session.runtime-Bo88k0pV.js → provider-session.runtime-BUEqD0rA.js} +3 -3
  43. package/dist/provider.runtime-C9PnJZbZ.js +2 -0
  44. package/dist/realtime-session.runtime-C7wen-aF.js +1340 -0
  45. package/dist/{resolve-allowlist-common-DHERApxi.js → resolve-allowlist-common-D04lpEzb.js} +2 -2
  46. package/dist/{resolve-channels-BjepAj8b.js → resolve-channels-Dm7jEeg6.js} +4 -4
  47. package/dist/{resolve-users-Bc28htgt.js → resolve-users-bktrCUUU.js} +3 -3
  48. package/dist/{chunk-DX4jpFQP.js → retry-CLpJcXXf.js} +291 -68
  49. package/dist/{runtime-_aRC6V2s.js → runtime-DGsSyDTS.js} +30 -25
  50. package/dist/{runtime-BmW_j_hl.js → runtime-DoHjckYm.js} +4 -6
  51. package/dist/runtime-api.actions.js +2 -2
  52. package/dist/runtime-api.js +22 -23
  53. package/dist/runtime-api.lookup.js +5 -5
  54. package/dist/runtime-api.monitor-CHxrFPnW.js +5 -0
  55. package/dist/runtime-api.monitor.js +5 -5
  56. package/dist/runtime-api.send.js +6 -6
  57. package/dist/runtime-api.threads.js +5 -6
  58. package/dist/sdk-runtime-QpY8PvCh.js +370 -0
  59. package/dist/{send-CdkZ6zeW.js → send-B7Q6Oc1I.js} +175 -86
  60. package/dist/{send.components-5uqwkjgE.js → send.components-iJyFXw9L.js} +24 -28
  61. package/dist/{send.outbound-D-80Ej-t.js → send.outbound-DS5tHwfR.js} +37 -24
  62. package/dist/{send.reactions-CtlmGd_o.js → send.reactions-BAn0iiVQ.js} +14 -21
  63. package/dist/{send.receipt-CuwRrpFz.js → send.receipt-IPI1p-SP.js} +19 -1
  64. package/dist/{send.shared-jpvAG_u6.js → send.shared-BmwFjW6T.js} +16 -85
  65. package/dist/{sender-identity-mG_zsdox.js → sender-identity-QtalnCYv.js} +1 -1
  66. package/dist/setup-entry.js +0 -5
  67. package/dist/setup-plugin-api.js +1 -1
  68. package/dist/{shared-CXF1tup1.js → shared-BIXIX6uJ.js} +16 -17
  69. package/dist/{subagent-hooks-Dxy7Fmnq.js → subagent-hooks-CTt5KCJr.js} +2 -2
  70. package/dist/subagent-hooks-api.js +2 -6
  71. package/dist/subagent-progress-DhaE_h8a.js +109 -0
  72. package/dist/{system-events-DdUqf91B.js → system-events-CTqDf6_s.js} +2 -2
  73. package/dist/{target-resolver-C3s_2m0t.js → target-resolver-maOKSqO0.js} +2 -2
  74. package/dist/targets-yUFTHoAx.js +3 -0
  75. package/dist/{thread-bindings-C-M-ly7P.js → thread-bindings-3L8p82GV.js} +5 -7
  76. package/dist/{thread-bindings.manager-DYvSlrva.js → thread-bindings.manager-DCIH6WDC.js} +257 -29
  77. package/dist/{thread-bindings.session-updates-DAIlp7Px.js → thread-bindings.session-updates-bJ2KQFY6.js} +1 -1
  78. package/dist/{thread-bindings.state-Cgi5uRn-.js → thread-bindings.state-aeV8HNgV.js} +2 -15
  79. package/dist/{transcripts-source-DIKGsTGT.js → transcripts-source-CfFMexGt.js} +1 -1
  80. package/dist/transcripts-source-api.js +1 -1
  81. package/dist/{typing--Mzo2kM7.js → typing-CS-nNVoe.js} +1 -1
  82. package/dist/voice-runtime-BEdqNcST.js +2459 -0
  83. package/openclaw.plugin.json +203 -19
  84. package/package.json +15 -9
  85. package/skills/discord/SKILL.md +22 -115
  86. package/dist/legacy-state-migrations-api.js +0 -138
  87. package/dist/manager.runtime-Bjav3pfC.js +0 -3655
  88. package/dist/preflight-audio.runtime-CoCXMM8r.js +0 -7
  89. package/dist/probe.runtime-DqFGFMbZ.js +0 -2
  90. package/dist/provider.runtime-Cy7XZmyh.js +0 -2
  91. package/dist/runtime-api.monitor-CCRubd3-.js +0 -5
  92. package/dist/session-binding-contract-api.js +0 -2
  93. package/dist/subagent-progress-DI3sYLLo.js +0 -664
  94. package/dist/targets-Dv_RN7vT.js +0 -3
  95. package/dist/thread-bindings.discord-api-BoDNqamb.js +0 -246
@@ -1,246 +0,0 @@
1
- import { st as createChannelWebhook, u as resolveDiscordChannelId, yt as getChannel } from "./chunk-DX4jpFQP.js";
2
- import { F as createDiscordRestClient } from "./send.shared-jpvAG_u6.js";
3
- import { t as sendMessageDiscord } from "./send.outbound-D-80Ej-t.js";
4
- import { a as createThreadDiscord, r as sendWebhookMessageDiscord } from "./send-CdkZ6zeW.js";
5
- import { g as rememberReusableWebhook, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, j as toReusableWebhookKey, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-Cgi5uRn-.js";
6
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
- import { ChannelType } from "discord-api-types/v10";
8
- import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
9
- import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
10
- import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
11
- import { SYSTEM_MARK } from "openclaw/plugin-sdk/text-chunking";
12
- import { formatThreadBindingDurationLabel, resolveThreadBindingFarewellText, resolveThreadBindingIntroText, resolveThreadBindingThreadName } from "openclaw/plugin-sdk/conversation-runtime";
13
- //#region extensions/discord/src/monitor/thread-bindings.persona.ts
14
- const THREAD_BINDING_PERSONA_MAX_CHARS = 80;
15
- function normalizePersonaLabel(value) {
16
- if (!value) return;
17
- return value.replace(/\s+/g, " ").trim() || void 0;
18
- }
19
- function resolveThreadBindingPersona(params) {
20
- return truncateUtf16Safe(`${SYSTEM_MARK} ${normalizePersonaLabel(params.label) || normalizePersonaLabel(params.agentId) || "agent"}`, THREAD_BINDING_PERSONA_MAX_CHARS);
21
- }
22
- function resolveThreadBindingPersonaFromRecord(record) {
23
- return resolveThreadBindingPersona({
24
- label: record.label,
25
- agentId: record.agentId
26
- });
27
- }
28
- //#endregion
29
- //#region extensions/discord/src/monitor/channel-access.ts
30
- function readDiscordChannelPropertySafe(channel, key) {
31
- if (!channel || typeof channel !== "object") return;
32
- try {
33
- if (!(key in channel)) return;
34
- return channel[key];
35
- } catch {
36
- return;
37
- }
38
- }
39
- function resolveDiscordChannelStringPropertySafe(channel, key) {
40
- const value = readDiscordChannelPropertySafe(channel, key);
41
- return typeof value === "string" ? value : void 0;
42
- }
43
- function resolveDiscordChannelNumberPropertySafe(channel, key) {
44
- const value = readDiscordChannelPropertySafe(channel, key);
45
- return typeof value === "number" ? value : void 0;
46
- }
47
- const DISCORD_CHANNEL_SNAKE_CASE_ALIASES = {
48
- ownerId: "owner_id",
49
- parentId: "parent_id"
50
- };
51
- function resolveDiscordChannelStringWithAliasSafe(channel, camelKey) {
52
- const camelValue = resolveDiscordChannelStringPropertySafe(channel, camelKey);
53
- if (camelValue !== void 0) return camelValue;
54
- const snakeKey = DISCORD_CHANNEL_SNAKE_CASE_ALIASES[camelKey];
55
- if (!snakeKey) return;
56
- const directSnakeValue = resolveDiscordChannelStringPropertySafe(channel, snakeKey);
57
- if (directSnakeValue !== void 0) return directSnakeValue;
58
- return resolveDiscordChannelStringPropertySafe(readDiscordChannelPropertySafe(channel, "rawData"), snakeKey);
59
- }
60
- function resolveDiscordChannelNameSafe(channel) {
61
- return resolveDiscordChannelStringPropertySafe(channel, "name");
62
- }
63
- function resolveDiscordChannelIdSafe(channel) {
64
- return resolveDiscordChannelStringPropertySafe(channel, "id");
65
- }
66
- function resolveDiscordChannelTopicSafe(channel) {
67
- return resolveDiscordChannelStringPropertySafe(channel, "topic");
68
- }
69
- function resolveDiscordChannelParentIdSafe(channel) {
70
- return resolveDiscordChannelStringWithAliasSafe(channel, "parentId");
71
- }
72
- function resolveDiscordChannelOwnerIdSafe(channel) {
73
- return resolveDiscordChannelStringWithAliasSafe(channel, "ownerId");
74
- }
75
- function resolveDiscordChannelParentSafe(channel) {
76
- return readDiscordChannelPropertySafe(channel, "parent");
77
- }
78
- function resolveDiscordChannelInfoSafe(channel) {
79
- const parent = resolveDiscordChannelParentSafe(channel);
80
- return {
81
- name: resolveDiscordChannelNameSafe(channel),
82
- topic: resolveDiscordChannelTopicSafe(channel),
83
- type: resolveDiscordChannelNumberPropertySafe(channel, "type"),
84
- parentId: resolveDiscordChannelParentIdSafe(channel),
85
- ownerId: resolveDiscordChannelOwnerIdSafe(channel),
86
- parentName: resolveDiscordChannelNameSafe(parent)
87
- };
88
- }
89
- //#endregion
90
- //#region extensions/discord/src/monitor/thread-bindings.types.ts
91
- const THREAD_BINDINGS_SWEEP_INTERVAL_MS = 12e4;
92
- const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS = 1440 * 60 * 1e3;
93
- //#endregion
94
- //#region extensions/discord/src/monitor/thread-bindings.discord-api.ts
95
- function buildThreadTarget(threadId) {
96
- return /^(channel:|user:)/i.test(threadId) ? threadId : `channel:${threadId}`;
97
- }
98
- function isThreadArchived(raw) {
99
- if (!raw || typeof raw !== "object") return false;
100
- const asRecord = raw;
101
- if (asRecord.archived === true) return true;
102
- if (asRecord.thread_metadata?.archived === true) return true;
103
- if (asRecord.threadMetadata?.archived === true) return true;
104
- return false;
105
- }
106
- function isThreadChannelType(type) {
107
- return type === ChannelType.PublicThread || type === ChannelType.PrivateThread || type === ChannelType.AnnouncementThread;
108
- }
109
- function normalizeDiscordBindingChannelId(raw) {
110
- const trimmed = normalizeOptionalString(raw) ?? "";
111
- if (!trimmed) return null;
112
- try {
113
- return resolveDiscordChannelId(trimmed);
114
- } catch {
115
- return null;
116
- }
117
- }
118
- function summarizeDiscordError(err) {
119
- if (err instanceof Error) return err.message;
120
- if (typeof err === "string") return err;
121
- if (typeof err === "number" || typeof err === "boolean" || typeof err === "bigint" || typeof err === "symbol") return String(err);
122
- return "error";
123
- }
124
- function extractNumericDiscordErrorValue(value) {
125
- return parseStrictNonNegativeInteger(value);
126
- }
127
- function extractDiscordErrorStatus(err) {
128
- if (!err || typeof err !== "object") return;
129
- const candidate = err;
130
- return extractNumericDiscordErrorValue(candidate.status) ?? extractNumericDiscordErrorValue(candidate.statusCode) ?? extractNumericDiscordErrorValue(candidate.response?.status);
131
- }
132
- function extractDiscordErrorCode(err) {
133
- if (!err || typeof err !== "object") return;
134
- const candidate = err;
135
- return extractNumericDiscordErrorValue(candidate.code) ?? extractNumericDiscordErrorValue(candidate.rawError?.code) ?? extractNumericDiscordErrorValue(candidate.body?.code) ?? extractNumericDiscordErrorValue(candidate.response?.body?.code) ?? extractNumericDiscordErrorValue(candidate.response?.data?.code);
136
- }
137
- function isDiscordThreadGoneError(err) {
138
- if (extractDiscordErrorCode(err) === 10003) return true;
139
- const status = extractDiscordErrorStatus(err);
140
- return status === 404 || status === 403;
141
- }
142
- async function maybeSendBindingMessage(params) {
143
- const text = params.text.trim();
144
- if (!text) return;
145
- const record = params.record;
146
- if (params.preferWebhook !== false && record.webhookId && record.webhookToken) try {
147
- await sendWebhookMessageDiscord(text, {
148
- cfg: params.cfg,
149
- webhookId: record.webhookId,
150
- webhookToken: record.webhookToken,
151
- accountId: record.accountId,
152
- threadId: record.threadId,
153
- username: resolveThreadBindingPersonaFromRecord(record)
154
- });
155
- return;
156
- } catch (err) {
157
- logVerbose(`discord thread binding webhook send failed: ${summarizeDiscordError(err)}`);
158
- }
159
- try {
160
- await sendMessageDiscord(buildThreadTarget(record.threadId), text, {
161
- cfg: params.cfg,
162
- accountId: record.accountId
163
- });
164
- } catch (err) {
165
- logVerbose(`discord thread binding fallback send failed: ${summarizeDiscordError(err)}`);
166
- }
167
- }
168
- async function createWebhookForChannel(params) {
169
- try {
170
- const rest = createDiscordRestClient({
171
- cfg: params.cfg,
172
- accountId: params.accountId,
173
- token: params.token
174
- }).rest;
175
- const created = await createChannelWebhook(rest, params.channelId, { body: { name: "OpenClaw Agents" } });
176
- const webhookId = normalizeOptionalString(created?.id) ?? "";
177
- const webhookToken = normalizeOptionalString(created?.token) ?? "";
178
- if (!webhookId || !webhookToken) return {};
179
- return {
180
- webhookId,
181
- webhookToken
182
- };
183
- } catch (err) {
184
- logVerbose(`discord thread binding webhook create failed for ${params.channelId}: ${summarizeDiscordError(err)}`);
185
- return {};
186
- }
187
- }
188
- function findReusableWebhook(params) {
189
- const reusableKey = toReusableWebhookKey({
190
- accountId: params.accountId,
191
- channelId: params.channelId
192
- });
193
- const cached = REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL.get(reusableKey);
194
- if (cached) return {
195
- webhookId: cached.webhookId,
196
- webhookToken: cached.webhookToken
197
- };
198
- for (const record of BINDINGS_BY_THREAD_ID.values()) {
199
- if (record.accountId !== params.accountId) continue;
200
- if (record.channelId !== params.channelId) continue;
201
- if (!record.webhookId || !record.webhookToken) continue;
202
- rememberReusableWebhook(record);
203
- return {
204
- webhookId: record.webhookId,
205
- webhookToken: record.webhookToken
206
- };
207
- }
208
- return {};
209
- }
210
- async function resolveChannelIdForBinding(params) {
211
- const explicit = normalizeDiscordBindingChannelId(params.channelId);
212
- if (explicit) return explicit;
213
- const lookupThreadId = normalizeDiscordBindingChannelId(params.threadId);
214
- if (!lookupThreadId) return null;
215
- try {
216
- const rest = createDiscordRestClient({
217
- cfg: params.cfg,
218
- accountId: params.accountId,
219
- token: params.token
220
- }).rest;
221
- const channel = await getChannel(rest, lookupThreadId);
222
- const channelInfo = resolveDiscordChannelInfoSafe(channel);
223
- const channelId = normalizeOptionalString(resolveDiscordChannelIdSafe(channel)) ?? "";
224
- const type = channelInfo.type;
225
- const parentId = normalizeOptionalString(channelInfo.parentId) ?? "";
226
- if (parentId && isThreadChannelType(type)) return parentId;
227
- return channelId || null;
228
- } catch (err) {
229
- logVerbose(`discord thread binding channel resolve failed for ${lookupThreadId}: ${summarizeDiscordError(err)}`);
230
- return null;
231
- }
232
- }
233
- async function createThreadForBinding(params) {
234
- try {
235
- return (normalizeOptionalString((await createThreadDiscord(params.channelId, { name: params.threadName }, {
236
- cfg: params.cfg,
237
- accountId: params.accountId,
238
- token: params.token
239
- }))?.id) ?? "") || null;
240
- } catch (err) {
241
- logVerbose(`discord thread binding auto-thread create failed for ${params.channelId}: ${summarizeDiscordError(err)}`);
242
- return null;
243
- }
244
- }
245
- //#endregion
246
- export { resolveThreadBindingThreadName as S, resolveThreadBindingPersona as _, isThreadArchived as a, resolveThreadBindingFarewellText as b, summarizeDiscordError as c, resolveDiscordChannelIdSafe as d, resolveDiscordChannelInfoSafe as f, resolveDiscordChannelTopicSafe as g, resolveDiscordChannelParentSafe as h, isDiscordThreadGoneError as i, DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS as l, resolveDiscordChannelParentIdSafe as m, createWebhookForChannel as n, maybeSendBindingMessage as o, resolveDiscordChannelNameSafe as p, findReusableWebhook as r, resolveChannelIdForBinding as s, createThreadForBinding as t, THREAD_BINDINGS_SWEEP_INTERVAL_MS as u, resolveThreadBindingPersonaFromRecord as v, resolveThreadBindingIntroText as x, formatThreadBindingDurationLabel as y };