@openclaw/discord 2026.9.6 → 2026.9.7
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.
- package/assets/icon.png +0 -0
- package/dist/.setup/{account-inspect-BwQj24ht.mjs → account-inspect-De8hOUxG.mjs} +1 -1
- package/dist/.setup/{accounts-CwJQoLjM.mjs → accounts-ChaMcixG.mjs} +1 -4
- package/dist/.setup/{activities-api-COU4-0nR.mjs → activities-api-tvbsU2e3.mjs} +38 -66
- package/dist/.setup/{api-CBK9zcq5.mjs → api-DVbJwZVt.mjs} +10 -2
- package/dist/.setup/{approval-handler.runtime-CbBktBb4.mjs → approval-handler.runtime-DxCK2Rux.mjs} +49 -125
- package/dist/.setup/{approval-message-updates-jf9zMaIC.mjs → approval-message-updates-BKFqavHZ.mjs} +2 -2
- package/dist/.setup/{audit-vKbh-LFR.mjs → audit-CLg9I71N.mjs} +5 -5
- package/dist/.setup/{channel-Dv4e3Jpc.mjs → channel-DxlUVU9t.mjs} +121 -227
- package/dist/.setup/{channel-type-DKnjV1XW.mjs → channel-type-DRCrEMss.mjs} +22 -22
- package/dist/.setup/{channel.setup-0NX6FFwi.mjs → channel.setup-CRo1GjV7.mjs} +6 -9
- package/dist/.setup/{components-yBEb75bB.mjs → components-Cq1PvIpN.mjs} +41 -69
- package/dist/.setup/{config-schema-CiZz-mtA.mjs → config-schema-oxELUSDx.mjs} +19 -44
- package/dist/.setup/{conversation-binding-route-B7qImK_b.mjs → conversation-binding-route-Caz_XuFH.mjs} +10 -5
- package/dist/.setup/{directory-config-BytTftz-.mjs → directory-config-esqNn0Eo.mjs} +6 -9
- package/dist/.setup/{directory-live--EGTH0DC.mjs → directory-live-DtKRHuGV.mjs} +6 -12
- package/dist/.setup/{discord-BXpHW-cu.mjs → discord-0xJYfdDD.mjs} +82 -386
- package/dist/.setup/{doctor-D1R-uFIu.mjs → doctor-BCl1H5tl.mjs} +21 -36
- package/dist/.setup/{doctor-contract-Co5vRCZ6.mjs → doctor-contract-CvvgwrrG.mjs} +41 -50
- package/dist/.setup/{channel-actions.runtime-leZuw01r.mjs → handle-action-CUvQWnE7.mjs} +67 -104
- package/dist/.setup/{handle-action.guild-admin-DcFa8NwA.mjs → handle-action.guild-admin-Df-8gVle.mjs} +62 -120
- package/dist/.setup/{live-policy-config-eKQ-PLdy.mjs → live-policy-config-8Pv20CHc.mjs} +2 -3
- package/dist/.setup/{message-handler-X6ejmbtY.mjs → message-handler-B-Jk4oDk.mjs} +18 -94
- package/dist/.setup/{message-handler.preflight-pluralkit-8Xji34AF.mjs → message-handler.preflight-pluralkit-CWLUBVcx.mjs} +8 -10
- package/dist/.setup/{message-handler.preflight-DE_POxFc.mjs → message-handler.preflight-v-__NSDq.mjs} +69 -180
- package/dist/.setup/{message-handler.process-CCmIVnxy.mjs → message-handler.process-BNFFuChn.mjs} +65 -86
- package/dist/.setup/{outbound-adapter-ClIgmu4F.mjs → outbound-adapter-BobT-kse.mjs} +105 -19
- package/dist/.setup/{outbound-session-route-VulUE0yV.mjs → outbound-session-route-zVGxxceg.mjs} +140 -108
- package/dist/.setup/{pluralkit-CdAt1G0P.mjs → pluralkit-a6_NLfH9.mjs} +1 -1
- package/dist/.setup/{presence-cache-dYSHPWMx.mjs → presence-cache-Di3H3DIU.mjs} +0 -4
- package/dist/.setup/{probe-CupW4we4.mjs → probe-LYrIHlBF.mjs} +13 -4
- package/dist/.setup/{provider-iOf73HW-.mjs → provider-B_G5hASF.mjs} +721 -1416
- package/dist/.setup/provider-session.runtime-BYlTBFD2.mjs +6 -0
- package/dist/.setup/provider.runtime-CUE3UxER.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-Dz8uVutq.mjs → realtime-session.runtime-oUd9DOcz.mjs} +41 -55
- package/dist/.setup/{receive-recovery-DHst8WRx.mjs → receive-recovery-CHPOsnLc.mjs} +1 -4
- package/dist/.setup/{resolve-allowlist-common-CwMBzbx9.mjs → resolve-allowlist-common-DPdRggu5.mjs} +4 -7
- package/dist/.setup/{resolve-channels-BbvsLQOZ.mjs → resolve-channels-BFPNRmVv.mjs} +21 -40
- package/dist/.setup/{resolve-users-ByFlR7LQ.mjs → resolve-users-0-aBuCy3.mjs} +4 -4
- package/dist/.setup/{retry-BEYkDy0P.mjs → retry-pz_cSha2.mjs} +3 -3
- package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
- package/dist/.setup/{runtime-B8lJfyrA.mjs → runtime-FN000lxA.mjs} +60 -162
- package/dist/.setup/runtime-doctor-migrations-CshUGl36.mjs +159 -0
- package/dist/.setup/{runtime-DisDbixd.mjs → runtime-sUksZ--Q.mjs} +2 -5
- package/dist/.setup/{secret-config-contract-DFu9hfU8.mjs → secret-config-contract-uOE2J7yM.mjs} +15 -85
- package/dist/.setup/{security-audit-s5w50-Ly.mjs → security-audit-Cdaegq7C.mjs} +3 -1
- package/dist/.setup/{send-CIBzvXjS.mjs → send-CrfEI6Bs.mjs} +53 -108
- package/dist/.setup/{send.components-ChY21qr-.mjs → send.components-DxQAMfES.mjs} +62 -107
- package/dist/.setup/{send.outbound-QTyuFupn.mjs → send.outbound-BISKnb-a.mjs} +66 -140
- package/dist/.setup/{send.shared-VNvWfX2T.mjs → send.shared-DGFkbkQR.mjs} +10 -25
- package/dist/.setup/{sender-identity-0Ymgvmaj.mjs → sender-identity-B9X5Vb9R.mjs} +2 -3
- package/dist/.setup/setup-plugin-api-BQUBxbhe.mjs +3 -0
- package/dist/.setup/{shared-DHPDaMSx.mjs → shared-B3wZ4hN-.mjs} +25 -32
- package/dist/.setup/{subagent-hooks-CjW7r8Pe.mjs → subagent-hooks-nlUE9ow7.mjs} +5 -6
- package/dist/.setup/system-events-CdeZnvPV.mjs +33 -0
- package/dist/.setup/{target-resolver-BXpy6VT8.mjs → target-resolver-BuLapkhy.mjs} +9 -12
- package/dist/.setup/targets-0KUcEIYx.mjs +3 -0
- package/dist/.setup/{thread-bindings-CEh2dhqP.mjs → thread-bindings-D7TfgjR_.mjs} +33 -35
- package/dist/.setup/{thread-bindings.manager-ve-i6oqt.mjs → thread-bindings.manager-DN-NissX.mjs} +325 -233
- package/dist/.setup/thread-bindings.session-updates-CshfKghV.mjs +359 -0
- package/dist/.setup/{thread-bindings.state-BThFQEga.mjs → thread-bindings.state-g6v9zAym.mjs} +21 -62
- package/dist/.setup/{transcripts-source-DVegW0WI.mjs → transcripts-source-p8EV179h.mjs} +76 -235
- package/dist/.setup/{typing-BKZL5fGj.mjs → typing-BiHCzBRu.mjs} +2 -1
- package/dist/.setup/{voice-runtime-elTtjEIG.mjs → voice-runtime-B46rcwrG.mjs} +140 -244
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +18 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +4 -4
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +20 -20
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +15 -24
- package/dist/subagent-hooks-api.js +3 -4
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/child_process.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +20 -8
- package/node_modules/@types/node/ffi.d.ts +14 -0
- package/node_modules/@types/node/http2.d.ts +3 -2
- package/node_modules/@types/node/net.d.ts +16 -4
- package/node_modules/@types/node/package.json +2 -17
- package/node_modules/@types/node/process.d.ts +1 -0
- package/node_modules/@types/node/quic.d.ts +39 -1
- package/node_modules/@types/node/stream/iter.d.ts +9 -12
- package/node_modules/@types/node/test/reporters.d.ts +1 -0
- package/node_modules/@types/node/test.d.ts +72 -0
- package/node_modules/@types/node/tls.d.ts +14 -10
- package/node_modules/@types/node/vm.d.ts +2 -1
- package/node_modules/@types/node/worker_threads.d.ts +4 -1
- package/node_modules/typebox/build/compile/code.mjs +1 -2
- package/node_modules/typebox/build/compile/validator.mjs +5 -1
- package/node_modules/typebox/build/format/iri.mjs +16 -9
- package/node_modules/typebox/build/guard/emit.mjs +2 -2
- package/node_modules/typebox/build/guard/guard.d.mts +7 -5
- package/node_modules/typebox/build/guard/guard.mjs +14 -9
- package/node_modules/typebox/build/guard/index.mjs +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/{string.mjs → unicode/unicode_segment.mjs} +16 -19
- package/node_modules/typebox/build/schema/build.mjs +2 -3
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +13 -5
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/format.mjs +9 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/properties.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/ref.d.mts +1 -1
- package/node_modules/typebox/build/schema/engine/ref.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/schema.mjs +24 -24
- package/node_modules/typebox/build/schema/parse.mjs +3 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +1 -6
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +47 -64
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +11 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +14 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +1 -1
- package/node_modules/typebox/build/type/extends/inference.mjs +15 -2
- package/node_modules/typebox/build/type/extends/tuple.d.mts +2 -1
- package/node_modules/typebox/build/type/extends/tuple.mjs +21 -1
- package/node_modules/typebox/build/value/parse/parse.mjs +10 -4
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +3 -1
- package/openclaw.plugin.json +21 -1
- package/package.json +5 -5
- package/dist/.setup/agent-components.runtime-CEPrf2SY.mjs +0 -4
- package/dist/.setup/probe.runtime-DBQ_AGPe.mjs +0 -2
- package/dist/.setup/provider-session.runtime-DrGAYnZv.mjs +0 -6
- package/dist/.setup/provider.runtime-BmjW_pIw.mjs +0 -2
- package/dist/.setup/security-audit.runtime-DHtYenx9.mjs +0 -2
- package/dist/.setup/setup-plugin-api-Dvr41dyx.mjs +0 -3
- package/dist/.setup/system-events-B2YEEMbS.mjs +0 -34
- package/dist/.setup/targets-CvemhN3i.mjs +0 -3
- package/dist/.setup/thread-bindings.session-updates-DCQq1WZ5.mjs +0 -55
- /package/node_modules/typebox/build/guard/{string.d.mts → unicode/unicode_segment.d.mts} +0 -0
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
import { c as resolveDiscordAccount, d as resolveDiscordAccountDisabledReason, f as resolveDiscordAccountDmPolicy, l as resolveDiscordAccountAllowFrom, n as isDiscordAccountEnabledForRuntime, o as mergeDiscordAccountConfig, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
3
|
-
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-
|
|
4
|
-
import { t as DiscordChannelConfigSchema } from "./config-schema-
|
|
5
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
6
|
-
import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-
|
|
1
|
+
import { c as resolveDiscordAccount, d as resolveDiscordAccountDisabledReason, f as resolveDiscordAccountDmPolicy, l as resolveDiscordAccountAllowFrom, n as isDiscordAccountEnabledForRuntime, o as mergeDiscordAccountConfig, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-ChaMcixG.mjs";
|
|
2
|
+
import { t as inspectDiscordAccount } from "./account-inspect-De8hOUxG.mjs";
|
|
3
|
+
import { n as discordIngressIdentity, t as selectDiscordLivePolicyConfig } from "./live-policy-config-8Pv20CHc.mjs";
|
|
4
|
+
import { t as DiscordChannelConfigSchema } from "./config-schema-oxELUSDx.mjs";
|
|
5
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-CvvgwrrG.mjs";
|
|
6
|
+
import { r as secretTargetRegistryEntries, t as collectRuntimeConfigAssignments } from "./secret-config-contract-uOE2J7yM.mjs";
|
|
7
7
|
import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DSHk7I2w.mjs";
|
|
8
8
|
import { t as deriveLegacySessionChatType } from "./session-contract-BO5tlIdl.mjs";
|
|
9
9
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
10
|
-
import {
|
|
10
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
11
11
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
12
|
-
import {
|
|
12
|
+
import { resolveConfiguredFromCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
13
13
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
14
14
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
15
15
|
import { createConditionalWarningCollector, createOpenProviderConfiguredRouteWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
16
16
|
import { identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
17
17
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
18
18
|
import { createEnvPatchedAccountSetupAdapter } from "openclaw/plugin-sdk/setup-runtime";
|
|
19
|
-
//#region extensions/discord/src/channel-api.ts
|
|
20
|
-
const DISCORD_CHANNEL_META = {
|
|
21
|
-
id: "discord",
|
|
22
|
-
label: "Discord",
|
|
23
|
-
selectionLabel: "Discord (Bot API)",
|
|
24
|
-
detailLabel: "Discord Bot",
|
|
25
|
-
docsPath: "/channels/discord",
|
|
26
|
-
docsLabel: "discord",
|
|
27
|
-
blurb: "very well supported right now.",
|
|
28
|
-
systemImage: "bubble.left.and.bubble.right",
|
|
29
|
-
markdownCapable: true,
|
|
30
|
-
preferSessionLookupForAnnounceTarget: true
|
|
31
|
-
};
|
|
32
|
-
function getChatChannelMeta(id) {
|
|
33
|
-
if (id !== DISCORD_CHANNEL_META.id) throw new Error(`Unsupported Discord channel meta lookup: ${id}`);
|
|
34
|
-
return DISCORD_CHANNEL_META;
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
19
|
//#region extensions/discord/src/security.ts
|
|
38
20
|
const resolveDiscordDmPolicy = createScopedDmSecurityResolver({
|
|
39
21
|
channelKey: "discord",
|
|
@@ -75,7 +57,7 @@ const collectDiscordSecurityFindings = createConditionalWarningCollector.finding
|
|
|
75
57
|
severity: "warn",
|
|
76
58
|
title: "Discord security warning"
|
|
77
59
|
});
|
|
78
|
-
const loadDiscordSecurityAuditModule = createLazyRuntimeModule(() => import("./security-audit
|
|
60
|
+
const loadDiscordSecurityAuditModule = createLazyRuntimeModule(() => import("./security-audit-Cdaegq7C.mjs").then((n) => n.n));
|
|
79
61
|
const discordSecurityAdapter = {
|
|
80
62
|
resolveDmPolicy: resolveDiscordDmPolicy,
|
|
81
63
|
collectWarnings: collectDiscordSecurityFindings,
|
|
@@ -119,7 +101,7 @@ const DISCORD_LEGACY_CONFIG_RULES = [];
|
|
|
119
101
|
//#region extensions/discord/src/shared.ts
|
|
120
102
|
const DISCORD_CHANNEL = "discord";
|
|
121
103
|
const livePolicyConfigPrefixes = Object.keys(selectDiscordLivePolicyConfig({})).flatMap((key) => [`channels.discord.${key}`, `channels.discord.accounts.*.${key}`]);
|
|
122
|
-
const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-
|
|
104
|
+
const loadDiscordDoctorModule = createLazyRuntimeModule(() => import("./doctor-BCl1H5tl.mjs"));
|
|
123
105
|
const discordDoctor = {
|
|
124
106
|
dmAllowFromMode: "topOnly",
|
|
125
107
|
groupModel: "route",
|
|
@@ -165,7 +147,18 @@ function createDiscordPluginBase(params) {
|
|
|
165
147
|
id: DISCORD_CHANNEL,
|
|
166
148
|
setupContract: params.setupContract,
|
|
167
149
|
...params.setupWizard ? { setupWizard: params.setupWizard } : {},
|
|
168
|
-
meta: {
|
|
150
|
+
meta: {
|
|
151
|
+
id: "discord",
|
|
152
|
+
label: "Discord",
|
|
153
|
+
selectionLabel: "Discord (Bot API)",
|
|
154
|
+
detailLabel: "Discord Bot",
|
|
155
|
+
docsPath: "/channels/discord",
|
|
156
|
+
docsLabel: "discord",
|
|
157
|
+
blurb: "very well supported right now.",
|
|
158
|
+
systemImage: "bubble.left.and.bubble.right",
|
|
159
|
+
markdownCapable: true,
|
|
160
|
+
preferSessionLookupForAnnounceTarget: true
|
|
161
|
+
},
|
|
169
162
|
capabilities: {
|
|
170
163
|
chatTypes: [
|
|
171
164
|
"direct",
|
|
@@ -203,10 +196,10 @@ function createDiscordPluginBase(params) {
|
|
|
203
196
|
hasConfiguredState: ({ env }) => typeof env?.DISCORD_BOT_TOKEN === "string" && env.DISCORD_BOT_TOKEN.trim().length > 0,
|
|
204
197
|
isEnabled: (account, cfg) => isDiscordAccountEnabledForRuntime(account, cfg),
|
|
205
198
|
disabledReason: (account, cfg) => resolveDiscordAccountDisabledReason(account, cfg),
|
|
206
|
-
isConfigured: (account) => resolveConfiguredFromCredentialStatuses
|
|
199
|
+
isConfigured: (account) => resolveConfiguredFromCredentialStatuses(account) ?? Boolean(account.token?.trim()),
|
|
207
200
|
describeAccount: (account) => describeAccountSnapshot({
|
|
208
201
|
account,
|
|
209
|
-
configured: resolveConfiguredFromCredentialStatuses
|
|
202
|
+
configured: resolveConfiguredFromCredentialStatuses(account) ?? Boolean(account.token?.trim()),
|
|
210
203
|
extra: {
|
|
211
204
|
tokenSource: account.tokenSource,
|
|
212
205
|
tokenStatus: account.tokenStatus
|
|
@@ -224,4 +217,4 @@ function createDiscordPluginBase(params) {
|
|
|
224
217
|
};
|
|
225
218
|
}
|
|
226
219
|
//#endregion
|
|
227
|
-
export { discordSecurityAdapter as a,
|
|
220
|
+
export { discordSecurityAdapter as a, discordSetupContract as i, discordConfigAdapter as n, DISCORD_LEGACY_CONFIG_RULES as r, createDiscordPluginBase as t };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { o as
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { u as ensureBindingsLoadedAsync } from "./thread-bindings.state-g6v9zAym.mjs";
|
|
3
|
+
import { o as listThreadBindingsBySessionKey, u as unbindThreadBindingsBySessionKeyAsync } from "./thread-bindings-D7TfgjR_.mjs";
|
|
4
4
|
import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/discord/src/subagent-hooks.ts
|
|
6
6
|
var subagent_hooks_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
-
ensureBindingsLoadedAsync: () => ensureBindingsLoadedAsync,
|
|
8
7
|
handleDiscordSubagentDeliveryTarget: () => handleDiscordSubagentDeliveryTarget,
|
|
9
8
|
handleDiscordSubagentDeliveryTargetAsync: () => handleDiscordSubagentDeliveryTargetAsync,
|
|
10
9
|
handleDiscordSubagentEnded: () => handleDiscordSubagentEnded
|
|
@@ -13,8 +12,8 @@ function normalizeThreadBindingTargetKind(raw) {
|
|
|
13
12
|
const normalized = normalizeOptionalLowercaseString(raw);
|
|
14
13
|
if (normalized === "subagent" || normalized === "acp") return normalized;
|
|
15
14
|
}
|
|
16
|
-
function handleDiscordSubagentEnded(event) {
|
|
17
|
-
|
|
15
|
+
async function handleDiscordSubagentEnded(event) {
|
|
16
|
+
await unbindThreadBindingsBySessionKeyAsync({
|
|
18
17
|
targetSessionKey: event.targetSessionKey,
|
|
19
18
|
accountId: event.accountId,
|
|
20
19
|
targetKind: normalizeThreadBindingTargetKind(event.targetKind),
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { t as discord_exports } from "./discord-0xJYfdDD.mjs";
|
|
2
|
+
import { S as formatDiscordUserTag } from "./channel-type-DRCrEMss.mjs";
|
|
3
|
+
//#region extensions/discord/src/monitor/system-events.ts
|
|
4
|
+
const SYSTEM_EVENT_ACTIONS = /* @__PURE__ */ new Map([
|
|
5
|
+
[discord_exports.MessageType.ChannelPinnedMessage, "pinned a message"],
|
|
6
|
+
[discord_exports.MessageType.RecipientAdd, "added a recipient"],
|
|
7
|
+
[discord_exports.MessageType.RecipientRemove, "removed a recipient"],
|
|
8
|
+
[discord_exports.MessageType.UserJoin, "user joined"],
|
|
9
|
+
[discord_exports.MessageType.GuildBoost, "boosted the server"],
|
|
10
|
+
[discord_exports.MessageType.GuildBoostTier1, "boosted the server (Tier 1 reached)"],
|
|
11
|
+
[discord_exports.MessageType.GuildBoostTier2, "boosted the server (Tier 2 reached)"],
|
|
12
|
+
[discord_exports.MessageType.GuildBoostTier3, "boosted the server (Tier 3 reached)"],
|
|
13
|
+
[discord_exports.MessageType.ThreadCreated, "created a thread"],
|
|
14
|
+
[discord_exports.MessageType.AutoModerationAction, "auto moderation action"],
|
|
15
|
+
[discord_exports.MessageType.GuildIncidentAlertModeEnabled, "raid protection enabled"],
|
|
16
|
+
[discord_exports.MessageType.GuildIncidentAlertModeDisabled, "raid protection disabled"],
|
|
17
|
+
[discord_exports.MessageType.GuildIncidentReportRaid, "raid reported"],
|
|
18
|
+
[discord_exports.MessageType.GuildIncidentReportFalseAlarm, "raid report marked false alarm"],
|
|
19
|
+
[discord_exports.MessageType.StageStart, "stage started"],
|
|
20
|
+
[discord_exports.MessageType.StageEnd, "stage ended"],
|
|
21
|
+
[discord_exports.MessageType.StageSpeaker, "stage speaker updated"],
|
|
22
|
+
[discord_exports.MessageType.StageTopic, "stage topic updated"],
|
|
23
|
+
[discord_exports.MessageType.PollResult, "poll results posted"],
|
|
24
|
+
[discord_exports.MessageType.PurchaseNotification, "purchase notification"]
|
|
25
|
+
]);
|
|
26
|
+
function resolveDiscordSystemEvent(message, location) {
|
|
27
|
+
const action = message.type === void 0 ? void 0 : SYSTEM_EVENT_ACTIONS.get(message.type);
|
|
28
|
+
if (!action) return null;
|
|
29
|
+
const authorLabel = message.author ? formatDiscordUserTag(message.author) : "";
|
|
30
|
+
return `Discord system: ${authorLabel ? `${authorLabel} ` : ""}${action} in ${location}`;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { resolveDiscordSystemEvent };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as resolveDiscordAccount, l as resolveDiscordAccountAllowFrom } from "./accounts-
|
|
3
|
-
import { a as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live
|
|
4
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { c as resolveDiscordAccount, l as resolveDiscordAccountAllowFrom } from "./accounts-ChaMcixG.mjs";
|
|
3
|
+
import { a as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-DtKRHuGV.mjs";
|
|
4
|
+
import { b as parseDiscordTarget, h as allowFromContainsDiscordUserId } from "./retry-pz_cSha2.mjs";
|
|
5
5
|
import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
|
|
6
|
-
//#region extensions/discord/src/send-target-parsing.ts
|
|
7
|
-
const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
|
|
8
|
-
//#endregion
|
|
9
6
|
//#region extensions/discord/src/target-resolver.ts
|
|
10
7
|
var target_resolver_exports = /* @__PURE__ */ __exportAll({
|
|
11
8
|
parseAndResolveDiscordTarget: () => parseAndResolveDiscordTarget,
|
|
@@ -23,7 +20,7 @@ async function resolveDiscordTarget(raw, options, parseOptions = {}) {
|
|
|
23
20
|
if (/^\d+$/.test(trimmed) && parseOptions.defaultKind !== "user" && isConfiguredAllowedDiscordDmUser(trimmed, options)) return buildMessagingTarget("user", trimmed, trimmed);
|
|
24
21
|
const directParse = safeParseDiscordTarget(trimmed, parseOptions);
|
|
25
22
|
if (directParse && directParse.kind !== "channel" && !likelyUsername) return directParse;
|
|
26
|
-
if (!shouldLookup) return directParse ??
|
|
23
|
+
if (!shouldLookup) return directParse ?? parseDiscordTarget(trimmed, parseOptions);
|
|
27
24
|
try {
|
|
28
25
|
const match = (await listDiscordDirectoryPeersLive({
|
|
29
26
|
...options,
|
|
@@ -48,16 +45,16 @@ async function resolveDiscordTarget(raw, options, parseOptions = {}) {
|
|
|
48
45
|
return buildMessagingTarget("user", userId, trimmed);
|
|
49
46
|
}
|
|
50
47
|
} catch {}
|
|
51
|
-
return
|
|
48
|
+
return parseDiscordTarget(trimmed, parseOptions);
|
|
52
49
|
}
|
|
53
50
|
async function parseAndResolveDiscordTarget(raw, options, parseOptions = {}) {
|
|
54
|
-
const resolved = await resolveDiscordTarget(raw, options, parseOptions)
|
|
51
|
+
const resolved = await resolveDiscordTarget(raw, options, parseOptions);
|
|
55
52
|
if (!resolved) throw new Error("Recipient is required for Discord sends");
|
|
56
53
|
return resolved;
|
|
57
54
|
}
|
|
58
55
|
function safeParseDiscordTarget(input, options) {
|
|
59
56
|
try {
|
|
60
|
-
return
|
|
57
|
+
return parseDiscordTarget(input, options);
|
|
61
58
|
} catch {
|
|
62
59
|
return;
|
|
63
60
|
}
|
|
@@ -81,4 +78,4 @@ function isLikelyUsername(input) {
|
|
|
81
78
|
return true;
|
|
82
79
|
}
|
|
83
80
|
//#endregion
|
|
84
|
-
export {
|
|
81
|
+
export { resolveDiscordTarget as n, target_resolver_exports as r, parseAndResolveDiscordTarget as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./targets-
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { b as parseDiscordTarget } from "./retry-pz_cSha2.mjs";
|
|
3
|
+
import "./targets-0KUcEIYx.mjs";
|
|
4
|
+
import { D as resolveThreadBindingMaxAgeMs$1, E as resolveThreadBindingMaxAgeExpiresAt, T as resolveThreadBindingInactivityExpiresAt, _ as refreshUnboundThreadWebhookIdentity, f as getThreadBindingToken, n as MANAGERS_BY_ACCOUNT_ID, t as BINDINGS_BY_THREAD_ID, w as resolveThreadBindingIdleTimeoutMs$1 } from "./thread-bindings.state-g6v9zAym.mjs";
|
|
5
|
+
import { a as mutateBindingsForTargetSession, i as setThreadBindingMaxAgeBySessionKeyAsync, n as setThreadBindingIdleTimeoutBySessionKeyAsync, o as resolveBindingIdsForTargetSession, r as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey, u as removeBindingRecordSync } from "./thread-bindings.session-updates-CshfKghV.mjs";
|
|
6
|
+
import { c as resolveThreadBindingPersonaFromRecord, i as createNoopThreadBindingManager, n as getThreadBindingManager, o as resolveChannelIdForBinding, s as resolveThreadBindingPersona, t as createThreadBindingManager } from "./thread-bindings.manager-DN-NissX.mjs";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
8
|
-
import { normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
-
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
8
|
+
import { normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import { formatThreadBindingDurationLabel as formatThreadBindingDurationLabel$1, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingIntroText, resolveThreadBindingIntroText as resolveThreadBindingIntroText$1, resolveThreadBindingMaxAgeMs, resolveThreadBindingThreadName, resolveThreadBindingThreadName as resolveThreadBindingThreadName$1, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
10
10
|
import { readAcpSessionEntry } from "openclaw/plugin-sdk/acp-runtime";
|
|
11
11
|
import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
12
12
|
//#region extensions/discord/src/monitor/thread-bindings.config.ts
|
|
@@ -32,9 +32,7 @@ function resolveDiscordThreadBindingMaxAgeMs(params) {
|
|
|
32
32
|
//#region extensions/discord/src/monitor/thread-bindings.lifecycle.ts
|
|
33
33
|
const ACP_STARTUP_HEALTH_PROBE_CONCURRENCY_LIMIT = 8;
|
|
34
34
|
function listThreadBindingsForAccount(accountId) {
|
|
35
|
-
|
|
36
|
-
if (!manager) return [];
|
|
37
|
-
return manager.listBindings();
|
|
35
|
+
return getThreadBindingManager(accountId)?.listBindings() ?? [];
|
|
38
36
|
}
|
|
39
37
|
function listThreadBindingsBySessionKey(params) {
|
|
40
38
|
return resolveBindingIdsForTargetSession(params).map((bindingKey) => BINDINGS_BY_THREAD_ID.get(bindingKey)).filter((entry) => Boolean(entry));
|
|
@@ -44,7 +42,7 @@ async function autoBindSpawnedDiscordSubagent(params) {
|
|
|
44
42
|
const manager = getThreadBindingManager(params.accountId);
|
|
45
43
|
if (!manager) return null;
|
|
46
44
|
const managerToken = getThreadBindingToken(manager.accountId);
|
|
47
|
-
const requesterThreadId =
|
|
45
|
+
const requesterThreadId = normalizeOptionalStringifiedId(params.threadId);
|
|
48
46
|
let channelId = "";
|
|
49
47
|
if (requesterThreadId) {
|
|
50
48
|
const existing = manager.getByThreadId(requesterThreadId);
|
|
@@ -93,6 +91,7 @@ async function autoBindSpawnedDiscordSubagent(params) {
|
|
|
93
91
|
})
|
|
94
92
|
});
|
|
95
93
|
}
|
|
94
|
+
/** @deprecated Public SDK compatibility; bundled callers use the awaited variant. */
|
|
96
95
|
function unbindThreadBindingsBySessionKey(params) {
|
|
97
96
|
const ids = resolveBindingIdsForTargetSession(params);
|
|
98
97
|
if (ids.length === 0) return [];
|
|
@@ -101,28 +100,22 @@ function unbindThreadBindingsBySessionKey(params) {
|
|
|
101
100
|
const record = BINDINGS_BY_THREAD_ID.get(bindingKey);
|
|
102
101
|
if (!record) continue;
|
|
103
102
|
const manager = MANAGERS_BY_ACCOUNT_ID.get(record.accountId);
|
|
104
|
-
if (manager)
|
|
105
|
-
|
|
106
|
-
threadId: record.threadId,
|
|
107
|
-
reason: params.reason,
|
|
108
|
-
sendFarewell: params.sendFarewell,
|
|
109
|
-
farewellText: params.farewellText
|
|
110
|
-
});
|
|
111
|
-
if (unbound) removed.push(unbound);
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
const unbound = removeBindingRecord(bindingKey);
|
|
103
|
+
if (manager?.isStopping()) throw new Error("Discord thread binding manager is stopping");
|
|
104
|
+
const unbound = removeBindingRecordSync(bindingKey);
|
|
115
105
|
if (unbound) {
|
|
116
|
-
|
|
106
|
+
if (manager) manager.notifyUnbound(unbound, params);
|
|
107
|
+
else refreshUnboundThreadWebhookIdentity(unbound);
|
|
117
108
|
removed.push(unbound);
|
|
118
109
|
}
|
|
119
110
|
}
|
|
120
|
-
if (removed.length > 0 && shouldPersistBindingMutations()) saveBindingsToDisk({ force: true });
|
|
121
111
|
return removed;
|
|
122
112
|
}
|
|
123
|
-
function
|
|
124
|
-
|
|
125
|
-
return
|
|
113
|
+
async function unbindThreadBindingsBySessionKeyAsync(input) {
|
|
114
|
+
const params = { ...input };
|
|
115
|
+
return mutateBindingsForTargetSession(params, () => null, (record, manager) => {
|
|
116
|
+
if (manager) manager.notifyUnbound(record, params);
|
|
117
|
+
else refreshUnboundThreadWebhookIdentity(record);
|
|
118
|
+
});
|
|
126
119
|
}
|
|
127
120
|
async function reconcileAcpThreadBindingsOnStartup(params) {
|
|
128
121
|
const manager = getThreadBindingManager(params.accountId);
|
|
@@ -150,7 +143,7 @@ async function reconcileAcpThreadBindingsOnStartup(params) {
|
|
|
150
143
|
continue;
|
|
151
144
|
}
|
|
152
145
|
if (session.storeReadFailed) continue;
|
|
153
|
-
if (
|
|
146
|
+
if (!session.acp) {
|
|
154
147
|
staleBindings.push(binding);
|
|
155
148
|
continue;
|
|
156
149
|
}
|
|
@@ -197,8 +190,10 @@ async function reconcileAcpThreadBindingsOnStartup(params) {
|
|
|
197
190
|
let removed = 0;
|
|
198
191
|
for (const binding of staleBindings) {
|
|
199
192
|
staleSessionKeys.push(binding.targetSessionKey);
|
|
200
|
-
if (manager.
|
|
193
|
+
if (getThreadBindingManager(manager.accountId) !== manager || manager.getByThreadId(binding.threadId) !== binding) continue;
|
|
194
|
+
if (await manager.unbindThread({
|
|
201
195
|
threadId: binding.threadId,
|
|
196
|
+
expected: binding,
|
|
202
197
|
reason: "stale-session",
|
|
203
198
|
sendFarewell: params.sendFarewell ?? false
|
|
204
199
|
})) removed += 1;
|
|
@@ -215,7 +210,7 @@ var thread_bindings_exports = /* @__PURE__ */ __exportAll({
|
|
|
215
210
|
autoBindSpawnedDiscordSubagent: () => autoBindSpawnedDiscordSubagent,
|
|
216
211
|
createNoopThreadBindingManager: () => createNoopThreadBindingManager,
|
|
217
212
|
createThreadBindingManager: () => createThreadBindingManager,
|
|
218
|
-
formatThreadBindingDurationLabel: () => formatThreadBindingDurationLabel,
|
|
213
|
+
formatThreadBindingDurationLabel: () => formatThreadBindingDurationLabel$1,
|
|
219
214
|
getThreadBindingManager: () => getThreadBindingManager,
|
|
220
215
|
listThreadBindingsBySessionKey: () => listThreadBindingsBySessionKey,
|
|
221
216
|
listThreadBindingsForAccount: () => listThreadBindingsForAccount,
|
|
@@ -224,16 +219,19 @@ var thread_bindings_exports = /* @__PURE__ */ __exportAll({
|
|
|
224
219
|
resolveDiscordThreadBindingMaxAgeMs: () => resolveDiscordThreadBindingMaxAgeMs,
|
|
225
220
|
resolveThreadBindingIdleTimeoutMs: () => resolveThreadBindingIdleTimeoutMs$1,
|
|
226
221
|
resolveThreadBindingInactivityExpiresAt: () => resolveThreadBindingInactivityExpiresAt,
|
|
227
|
-
resolveThreadBindingIntroText: () => resolveThreadBindingIntroText,
|
|
222
|
+
resolveThreadBindingIntroText: () => resolveThreadBindingIntroText$1,
|
|
228
223
|
resolveThreadBindingMaxAgeExpiresAt: () => resolveThreadBindingMaxAgeExpiresAt,
|
|
229
224
|
resolveThreadBindingMaxAgeMs: () => resolveThreadBindingMaxAgeMs$1,
|
|
230
225
|
resolveThreadBindingPersona: () => resolveThreadBindingPersona,
|
|
231
226
|
resolveThreadBindingPersonaFromRecord: () => resolveThreadBindingPersonaFromRecord,
|
|
232
|
-
resolveThreadBindingThreadName: () => resolveThreadBindingThreadName,
|
|
227
|
+
resolveThreadBindingThreadName: () => resolveThreadBindingThreadName$1,
|
|
233
228
|
resolveThreadBindingsEnabled: () => resolveThreadBindingsEnabled,
|
|
234
229
|
setThreadBindingIdleTimeoutBySessionKey: () => setThreadBindingIdleTimeoutBySessionKey,
|
|
230
|
+
setThreadBindingIdleTimeoutBySessionKeyAsync: () => setThreadBindingIdleTimeoutBySessionKeyAsync,
|
|
235
231
|
setThreadBindingMaxAgeBySessionKey: () => setThreadBindingMaxAgeBySessionKey,
|
|
236
|
-
|
|
232
|
+
setThreadBindingMaxAgeBySessionKeyAsync: () => setThreadBindingMaxAgeBySessionKeyAsync,
|
|
233
|
+
unbindThreadBindingsBySessionKey: () => unbindThreadBindingsBySessionKey,
|
|
234
|
+
unbindThreadBindingsBySessionKeyAsync: () => unbindThreadBindingsBySessionKeyAsync
|
|
237
235
|
});
|
|
238
236
|
//#endregion
|
|
239
|
-
export {
|
|
237
|
+
export { autoBindSpawnedDiscordSubagent as a, reconcileAcpThreadBindingsOnStartup as c, resolveDiscordThreadBindingIdleTimeoutMs as d, resolveDiscordThreadBindingMaxAgeMs as f, thread_bindings_exports as i, unbindThreadBindingsBySessionKey as l, resolveThreadBindingIntroText$1 as n, listThreadBindingsBySessionKey as o, resolveThreadBindingsEnabled as p, resolveThreadBindingThreadName$1 as r, listThreadBindingsForAccount as s, formatThreadBindingDurationLabel$1 as t, unbindThreadBindingsBySessionKeyAsync as u };
|