@openclaw/slack 2026.7.2-beta.3 → 2026.7.2-beta.4
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/dist/account-inspect-api.js +1 -1
- package/dist/{account-inspect-Bvbtu3iH.js → account-inspect-jn1xLaVi.js} +2 -2
- package/dist/account-reply-mode-DrUXogvO.js +14 -0
- package/dist/{accounts-DQEbYKh9.js → accounts-BSr252c_.js} +6 -27
- package/dist/{accounts.runtime-BIKmJdtJ.js → accounts.runtime-CjULMLTa.js} +1 -1
- package/dist/{action-runtime-DqkRwO3Z.js → action-runtime-CFU52n4W.js} +7 -7
- package/dist/action-runtime.runtime-9-17zvKH.js +2 -0
- package/dist/{actions-CF0tUY5q.js → actions-D51foiwR.js} +5 -5
- package/dist/{actions.runtime-hCbx4RXg.js → actions.runtime-BMJwtf5C.js} +1 -1
- package/dist/api.js +15 -14
- package/dist/{approval-handler.runtime-Em8I1-8-.js → approval-handler.runtime-3b4-wxMl.js} +2 -2
- package/dist/{channel-4-TRi1D6.js → channel-Ds8NKvfr.js} +26 -24
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-Cu1yjNg2.js → channel-type-DXkUajFP.js} +3 -3
- package/dist/{channel.setup-CgkADtZg.js → channel.setup-DOSTEDfA.js} +6 -5
- package/dist/{config-schema-XjJGfwQC.js → config-schema-B4j4tCOI.js} +231 -26
- package/dist/{directory-config-Bv0lcUlH.js → directory-config-B08pm5ZT.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CzUIB7th.js → directory-live-DpPKzPrn.js} +2 -2
- package/dist/{doctor-contract-DKpe5VBr.js → doctor-contract-U6oVntbM.js} +60 -89
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{group-policy-Bw-65m3V.js → group-policy-CdnQzQBI.js} +32 -5
- package/dist/{interactive-replies-Dm_t2R9S.js → interactive-replies-C3ffk6oN.js} +1 -1
- package/dist/interactive-replies-api.js +1 -1
- package/dist/{message-tool-api-C2pcf5du.js → message-tool-api-ByVyIVOh.js} +2 -2
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-CNFeF30h.js → monitor-CnB_WKvF.js} +3 -3
- package/dist/{outbound-adapter-CVi2uok0.js → outbound-adapter-DuPz2HHt.js} +3 -3
- package/dist/{pipeline.runtime-CTvokbty.js → pipeline.runtime-5rRYZuX5.js} +110 -77
- package/dist/{policy-b_dOPDCq.js → policy-C31RYSuT.js} +1 -1
- package/dist/{probe-Borhn9PQ.js → probe-CVRuArHA.js} +1 -1
- package/dist/{provider-B-HVL5ZE.js → provider-htuIJGFD.js} +365 -200
- package/dist/{relay-source-Ea_P9VcO.js → relay-source-Df9EaiTF.js} +1 -1
- package/dist/{replies-B4bOdrYb.js → replies-Cgr2Gli4.js} +3 -3
- package/dist/{resolve-channels-KTc568SU.js → resolve-channels-DodP2TFx.js} +1 -1
- package/dist/{resolve-users-DeGJf1yp.js → resolve-users-M9eF8891.js} +1 -1
- package/dist/{runtime-api-BFfNpzDe.js → runtime-api-D5XYMMsf.js} +3 -2
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-lx08L56K.js → scopes-CJRpHkDC.js} +1 -1
- package/dist/{security-audit-CikQhBUY.js → security-audit-Cz6erklv.js} +0 -10
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-KuTDky7i.js → send-BZ1tPv7-.js} +4 -4
- package/dist/{send.runtime-CXyxws1D.js → send.runtime-a2pilFor.js} +1 -1
- package/dist/{setup-core-CeiAVwQ3.js → setup-core-tPxMuFez.js} +138 -40
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-DLA0vHXp.js → setup-surface-wV-S1dE_.js} +43 -27
- package/dist/{shared-C4yVB0Q-.js → shared-BfMskaMx.js} +9 -8
- package/dist/{slash-dispatch.runtime-BT-mMm-f.js → slash-dispatch.runtime-lfeIsXTX.js} +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +16 -6
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/agent-base/README.md +145 -0
- package/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/agent-base/package.json +64 -0
- package/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/CHANGELOG.md +197 -1
- package/node_modules/axios/README.md +424 -256
- package/node_modules/axios/dist/axios.js +589 -204
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +630 -185
- package/node_modules/axios/dist/esm/axios.js +630 -185
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +949 -301
- package/node_modules/axios/index.d.cts +28 -5
- package/node_modules/axios/index.d.ts +24 -3
- package/node_modules/axios/lib/adapters/adapters.js +1 -1
- package/node_modules/axios/lib/adapters/fetch.js +223 -49
- package/node_modules/axios/lib/adapters/http.js +408 -193
- package/node_modules/axios/lib/adapters/xhr.js +3 -1
- package/node_modules/axios/lib/core/Axios.js +4 -2
- package/node_modules/axios/lib/core/AxiosError.js +13 -1
- package/node_modules/axios/lib/core/AxiosHeaders.js +13 -42
- package/node_modules/axios/lib/core/buildFullPath.js +29 -1
- package/node_modules/axios/lib/core/mergeConfig.js +35 -0
- package/node_modules/axios/lib/defaults/transitional.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -3
- package/node_modules/axios/lib/helpers/Http2Sessions.js +119 -0
- package/node_modules/axios/lib/helpers/buildURL.js +7 -4
- package/node_modules/axios/lib/helpers/composeSignals.js +48 -47
- package/node_modules/axios/lib/helpers/cookies.js +5 -1
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +16 -11
- package/node_modules/axios/lib/helpers/formDataToJSON.js +26 -4
- package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
- package/node_modules/axios/lib/helpers/fromDataURI.js +20 -5
- package/node_modules/axios/lib/helpers/progressEventReducer.js +3 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +26 -13
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +33 -1
- package/node_modules/axios/lib/helpers/toFormData.js +48 -12
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/utils.js +105 -19
- package/node_modules/axios/package.json +31 -13
- package/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
- package/node_modules/iconv-lite/encodings/utf32.js +10 -3
- package/node_modules/iconv-lite/package.json +2 -2
- package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
- package/node_modules/path-to-regexp/Readme.md +3 -3
- package/node_modules/path-to-regexp/dist/index.js +135 -158
- package/node_modules/path-to-regexp/dist/index.js.map +1 -1
- package/node_modules/path-to-regexp/package.json +2 -2
- package/node_modules/qs/CHANGELOG.md +11 -0
- package/node_modules/qs/dist/qs.js +17 -17
- package/node_modules/qs/lib/parse.js +19 -8
- package/node_modules/qs/lib/utils.js +47 -8
- package/node_modules/qs/package.json +6 -5
- package/node_modules/qs/test/parse.js +230 -0
- package/node_modules/qs/test/utils.js +194 -0
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/npm-shrinkwrap.json +54 -27
- package/openclaw.plugin.json +1759 -1908
- package/package.json +92 -14
- package/dist/action-runtime.runtime-DEWOcFM4.js +0 -2
- package/dist/config-api-Df9a1B8C.js +0 -3
- package/node_modules/axios/dist/axios.js.map +0 -1
- package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
- package/node_modules/axios/dist/esm/axios.js.map +0 -1
- package/node_modules/axios/dist/node/axios.cjs.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as resolveSlackReplyToMode } from "./account-reply-mode-DrUXogvO.js";
|
|
2
2
|
import { i as parseSlackTarget } from "./target-parsing-N6lHogYZ.js";
|
|
3
3
|
import "./targets-KmjP2E8s.js";
|
|
4
|
-
import { C as hasSlackNativeDataBlock, F as SLACK_TEXT_LIMIT, N as SLACK_EDIT_TEXT_LIMIT, O as normalizeSlackOutboundText, Y as escapeSlackMrkdwn, _ as resolveSlackReplyRenderPlan, c as normalizeSlackAllowOwnerEntry, k as buildSlackBlocksFallbackText, s as normalizeAllowListLower, u as resolveSlackAllowListMatch, z as truncateSlackText } from "./group-policy-
|
|
5
|
-
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-
|
|
6
|
-
import { r as formatSlackError } from "./probe-
|
|
4
|
+
import { C as hasSlackNativeDataBlock, F as SLACK_TEXT_LIMIT, N as SLACK_EDIT_TEXT_LIMIT, O as normalizeSlackOutboundText, Y as escapeSlackMrkdwn, _ as resolveSlackReplyRenderPlan, c as normalizeSlackAllowOwnerEntry, k as buildSlackBlocksFallbackText, s as normalizeAllowListLower, u as resolveSlackAllowListMatch, z as truncateSlackText } from "./group-policy-CdnQzQBI.js";
|
|
5
|
+
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-C3ffk6oN.js";
|
|
6
|
+
import { r as formatSlackError } from "./probe-CVRuArHA.js";
|
|
7
7
|
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode, t as mapStreamingModeToSlackLegacyDraftStreamMode } from "./streaming-compat-3_X-21wW.js";
|
|
8
|
-
import { S as buildSlackEditTextPayload, _ as resolveSlackThreadHistory, b as resolveSlackBlocksText, f as removeSlackReaction, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, v as resolveSlackThreadStarter, x as formatSlackFileReference, y as chooseSlackPrimaryText } from "./actions-
|
|
9
|
-
import { c as hasSlackThreadParticipationWithPersistence, l as recordSlackThreadParticipation, r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-
|
|
10
|
-
import { C as stripSlackMentionsForCommandDetection, _ as readSessionUpdatedAt, b as resolveStorePath, d as resolveSlackCommandIngress, f as resolveSlackEffectiveAllowFrom, g as resolveSlackChatType, h as normalizeSlackChannelType, l as resolveConversationLabel$1, m as parseSlackAssistantThreadMetadata, o as authorizeSlackDirectMessage, p as buildSlackAssistantThreadMetadata, r as resolveSlackRoomContextHints, u as authorizeSlackBotRoomMessage, v as resolveChannelContextVisibilityMode, x as updateLastRoute, y as resolveChannelResetConfig } from "./provider-
|
|
11
|
-
import { n as resolveSlackChannelConfig } from "./policy-
|
|
12
|
-
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as emitSlackMessageSentHooks, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
8
|
+
import { S as buildSlackEditTextPayload, _ as resolveSlackThreadHistory, b as resolveSlackBlocksText, f as removeSlackReaction, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, v as resolveSlackThreadStarter, x as formatSlackFileReference, y as chooseSlackPrimaryText } from "./actions-D51foiwR.js";
|
|
9
|
+
import { c as hasSlackThreadParticipationWithPersistence, l as recordSlackThreadParticipation, r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-BZ1tPv7-.js";
|
|
10
|
+
import { C as stripSlackMentionsForCommandDetection, _ as readSessionUpdatedAt, b as resolveStorePath, d as resolveSlackCommandIngress, f as resolveSlackEffectiveAllowFrom, g as resolveSlackChatType, h as normalizeSlackChannelType, l as resolveConversationLabel$1, m as parseSlackAssistantThreadMetadata, o as authorizeSlackDirectMessage, p as buildSlackAssistantThreadMetadata, r as resolveSlackRoomContextHints, u as authorizeSlackBotRoomMessage, v as resolveChannelContextVisibilityMode, x as updateLastRoute, y as resolveChannelResetConfig } from "./provider-htuIJGFD.js";
|
|
11
|
+
import { n as resolveSlackChannelConfig } from "./policy-C31RYSuT.js";
|
|
12
|
+
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as emitSlackMessageSentHooks, t as createSlackReplyDeliveryPlan } from "./replies-Cgr2Gli4.js";
|
|
13
13
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
14
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
15
15
|
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createChannelProgressReceiptTracker, createDraftStreamLoop, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, formatPlanChecklistLines, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, resolveAgentOutboundIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftConfig, resolveChannelProgressDraftMaxLineChars, resolveChannelProgressDraftMaxLines, resolveChannelProgressDraftRender, resolveChannelStreamingBlockEnabled, resolveChannelStreamingNativeTransport, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
|
|
16
16
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
17
|
-
import { danger, logVerbose, shouldLogVerbose
|
|
17
|
+
import { danger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
18
18
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
19
19
|
import { createHash } from "node:crypto";
|
|
20
20
|
import fs from "node:fs/promises";
|
|
@@ -29,7 +29,7 @@ import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-ru
|
|
|
29
29
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
30
30
|
import { resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
31
31
|
import { buildChannelInboundEventContext, buildMentionRegexes, classifyChannelInboundEvent, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, implicitMentionKindWhen, logInboundDrop, matchesMentionWithExplicit, recordDroppedChannelInboundHistory, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, resolveInboundSupplementalSenderAllowed, resolveUnmentionedGroupInboundPolicy, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
32
|
-
import { DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure,
|
|
32
|
+
import { DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure, resolveAckReaction, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
33
33
|
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
|
|
34
34
|
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
35
35
|
import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
@@ -954,36 +954,31 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
954
954
|
const incomingThreadTs = message.thread_ts;
|
|
955
955
|
let didSetStatus = false;
|
|
956
956
|
const statusReactionsEnabled = prepared.ctxPayload.InboundEventKind !== "room_event" && Boolean(prepared.ackReactionPromise) && Boolean(reactionMessageTs) && cfg.messages?.statusReactions?.enabled === true;
|
|
957
|
-
const slackStatusAdapter = {
|
|
958
|
-
setReaction: async (emoji) => {
|
|
959
|
-
await reactSlackMessage(message.channel, reactionMessageTs ?? "", emoji, {
|
|
960
|
-
token: ctx.botToken,
|
|
961
|
-
client: slackClient
|
|
962
|
-
}).catch((err) => {
|
|
963
|
-
if (formatErrorMessage(err).includes("already_reacted")) return;
|
|
964
|
-
throw err;
|
|
965
|
-
});
|
|
966
|
-
},
|
|
967
|
-
removeReaction: async (emoji) => {
|
|
968
|
-
await removeSlackReaction(message.channel, reactionMessageTs ?? "", emoji, {
|
|
969
|
-
token: ctx.botToken,
|
|
970
|
-
client: slackClient
|
|
971
|
-
}).catch((err) => {
|
|
972
|
-
if (formatErrorMessage(err).includes("no_reaction")) return;
|
|
973
|
-
throw err;
|
|
974
|
-
});
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
const statusReactionTiming = {
|
|
978
|
-
...DEFAULT_TIMING,
|
|
979
|
-
...cfg.messages?.statusReactions?.timing
|
|
980
|
-
};
|
|
981
957
|
const statusReactions = createStatusReactionController({
|
|
982
958
|
enabled: statusReactionsEnabled,
|
|
983
|
-
adapter:
|
|
959
|
+
adapter: {
|
|
960
|
+
setReaction: async (emoji) => {
|
|
961
|
+
await reactSlackMessage(message.channel, reactionMessageTs ?? "", emoji, {
|
|
962
|
+
token: ctx.botToken,
|
|
963
|
+
client: slackClient
|
|
964
|
+
}).catch((err) => {
|
|
965
|
+
if (formatErrorMessage(err).includes("already_reacted")) return;
|
|
966
|
+
throw err;
|
|
967
|
+
});
|
|
968
|
+
},
|
|
969
|
+
removeReaction: async (emoji) => {
|
|
970
|
+
await removeSlackReaction(message.channel, reactionMessageTs ?? "", emoji, {
|
|
971
|
+
token: ctx.botToken,
|
|
972
|
+
client: slackClient
|
|
973
|
+
}).catch((err) => {
|
|
974
|
+
if (formatErrorMessage(err).includes("no_reaction")) return;
|
|
975
|
+
throw err;
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
},
|
|
984
979
|
initialEmoji: prepared.ackReactionValue || "eyes",
|
|
985
|
-
emojis:
|
|
986
|
-
timing:
|
|
980
|
+
emojis: void 0,
|
|
981
|
+
timing: DEFAULT_TIMING,
|
|
987
982
|
onError: (err) => {
|
|
988
983
|
logAckFailure({
|
|
989
984
|
log: logVerbose,
|
|
@@ -2273,19 +2268,10 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
2273
2268
|
observedReplyDelivery,
|
|
2274
2269
|
fallbackDelivered: streamFallbackDelivered
|
|
2275
2270
|
});
|
|
2276
|
-
if (statusReactionsEnabled) if (dispatchError)
|
|
2277
|
-
|
|
2278
|
-
if (ctx.removeAckAfterReply) (async () => {
|
|
2279
|
-
await sleep(statusReactionTiming.errorHoldMs);
|
|
2280
|
-
if (anyReplyDelivered) await statusReactions.clear();
|
|
2281
|
-
})();
|
|
2282
|
-
} else if (anyReplyDelivered) {
|
|
2271
|
+
if (statusReactionsEnabled) if (dispatchError) await statusReactions.setError();
|
|
2272
|
+
else if (anyReplyDelivered) {
|
|
2283
2273
|
await statusReactions.setDone();
|
|
2284
|
-
|
|
2285
|
-
await sleep(statusReactionTiming.doneHoldMs);
|
|
2286
|
-
await statusReactions.clear();
|
|
2287
|
-
})();
|
|
2288
|
-
else statusReactions.restoreInitial();
|
|
2274
|
+
statusReactions.restoreInitial();
|
|
2289
2275
|
} else await statusReactions.restoreInitial();
|
|
2290
2276
|
const participationThreadTs = usedReplyThreadTs ?? statusThreadTs;
|
|
2291
2277
|
if (anyReplyDelivered && participationThreadTs) recordSlackThreadParticipation(account.accountId, message.channel, participationThreadTs, {
|
|
@@ -2301,23 +2287,6 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
2301
2287
|
const finalCount = counts.final;
|
|
2302
2288
|
logVerbose(`slack: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${prepared.replyTarget}`);
|
|
2303
2289
|
}
|
|
2304
|
-
if (!statusReactionsEnabled) removeAckReactionAfterReply({
|
|
2305
|
-
removeAfterReply: ctx.removeAckAfterReply && anyReplyDelivered,
|
|
2306
|
-
ackReactionPromise: prepared.ackReactionPromise,
|
|
2307
|
-
ackReactionValue: prepared.ackReactionValue,
|
|
2308
|
-
remove: () => removeSlackReaction(message.channel, prepared.ackReactionMessageTs ?? "", prepared.ackReactionValue, {
|
|
2309
|
-
token: ctx.botToken,
|
|
2310
|
-
client: slackClient
|
|
2311
|
-
}),
|
|
2312
|
-
onError: (err) => {
|
|
2313
|
-
logAckFailure({
|
|
2314
|
-
log: logVerbose,
|
|
2315
|
-
channel: "slack",
|
|
2316
|
-
target: `${message.channel}/${message.ts}`,
|
|
2317
|
-
error: err
|
|
2318
|
-
});
|
|
2319
|
-
}
|
|
2320
|
-
});
|
|
2321
2290
|
}
|
|
2322
2291
|
function toLintErrorObject(value, fallbackMessage) {
|
|
2323
2292
|
if (value instanceof Error) return value;
|
|
@@ -2327,6 +2296,51 @@ function toLintErrorObject(value, fallbackMessage) {
|
|
|
2327
2296
|
return error;
|
|
2328
2297
|
}
|
|
2329
2298
|
//#endregion
|
|
2299
|
+
//#region extensions/slack/src/agent-context.ts
|
|
2300
|
+
function asRecord(value) {
|
|
2301
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
2302
|
+
}
|
|
2303
|
+
function trimmedString(value) {
|
|
2304
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
2305
|
+
}
|
|
2306
|
+
function normalizeEntity(value) {
|
|
2307
|
+
const entity = asRecord(value);
|
|
2308
|
+
const type = trimmedString(entity?.type);
|
|
2309
|
+
if (!entity || !type) return;
|
|
2310
|
+
const teamId = trimmedString(entity.team_id);
|
|
2311
|
+
if (type === "slack#/types/channel_id" || type === "slack#/types/canvas_id" || type === "slack#/types/list_id") {
|
|
2312
|
+
const entityValue = trimmedString(entity.value);
|
|
2313
|
+
return entityValue ? {
|
|
2314
|
+
type,
|
|
2315
|
+
value: entityValue,
|
|
2316
|
+
...teamId ? { team_id: teamId } : {}
|
|
2317
|
+
} : void 0;
|
|
2318
|
+
}
|
|
2319
|
+
if (type !== "slack#/types/message_context") return;
|
|
2320
|
+
const message = asRecord(entity.value);
|
|
2321
|
+
const channelId = trimmedString(message?.channel_id);
|
|
2322
|
+
const messageTs = trimmedString(message?.message_ts);
|
|
2323
|
+
return channelId && messageTs ? {
|
|
2324
|
+
type,
|
|
2325
|
+
value: {
|
|
2326
|
+
channel_id: channelId,
|
|
2327
|
+
message_ts: messageTs
|
|
2328
|
+
},
|
|
2329
|
+
...teamId ? { team_id: teamId } : {}
|
|
2330
|
+
} : void 0;
|
|
2331
|
+
}
|
|
2332
|
+
function isSlackAppContext(value) {
|
|
2333
|
+
return Boolean(asRecord(value));
|
|
2334
|
+
}
|
|
2335
|
+
function normalizeSlackAppContextEntities(value) {
|
|
2336
|
+
const context = asRecord(value);
|
|
2337
|
+
if (!Array.isArray(context?.entities)) return [];
|
|
2338
|
+
return context.entities.flatMap((entity) => {
|
|
2339
|
+
const normalized = normalizeEntity(entity);
|
|
2340
|
+
return normalized ? [normalized] : [];
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
//#endregion
|
|
2330
2344
|
//#region extensions/slack/src/monitor/message-handler/preflight-audio.ts
|
|
2331
2345
|
const SLACK_DEFAULT_ECHO_TRANSCRIPT_FORMAT = "📝 \"{transcript}\"";
|
|
2332
2346
|
const loadSlackPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio.runtime-D5Bgags0.js"));
|
|
@@ -2366,8 +2380,7 @@ async function resolveSlackPreflightAudioTranscript(params) {
|
|
|
2366
2380
|
const { transcribeFirstAudio } = await loadSlackPreflightAudioRuntime();
|
|
2367
2381
|
const transcript = await transcribeFirstAudio({
|
|
2368
2382
|
ctx: {
|
|
2369
|
-
|
|
2370
|
-
MediaTypes: params.media.map((entry) => entry.contentType ?? ""),
|
|
2383
|
+
media: [...params.media],
|
|
2371
2384
|
Provider: "slack",
|
|
2372
2385
|
Surface: "slack",
|
|
2373
2386
|
OriginatingChannel: "slack",
|
|
@@ -2420,7 +2433,7 @@ async function discardSlackPreflightMedia(media) {
|
|
|
2420
2433
|
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
2421
2434
|
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
2422
2435
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
2423
|
-
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-
|
|
2436
|
+
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-D51foiwR.js").then((n) => n.g));
|
|
2424
2437
|
function collectUniqueSlackMentionIds$1(texts) {
|
|
2425
2438
|
const seen = /* @__PURE__ */ new Set();
|
|
2426
2439
|
const mentionIds = [];
|
|
@@ -2699,7 +2712,7 @@ function resolveSlackInitialAgentRoute(params) {
|
|
|
2699
2712
|
};
|
|
2700
2713
|
}
|
|
2701
2714
|
function resolveSlackRoutingContext(params) {
|
|
2702
|
-
const { ctx, account, message, isDirectMessage, isGroupDm, isRoom, isRoomish, channelConfig, seedTopLevelRoomThread, assistantThreadTs, eventScope } = params;
|
|
2715
|
+
const { ctx, account, message, isDirectMessage, isGroupDm, isRoom, isRoomish, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
2703
2716
|
let route = resolveSlackInitialAgentRoute({
|
|
2704
2717
|
ctx,
|
|
2705
2718
|
account,
|
|
@@ -2719,7 +2732,7 @@ function resolveSlackRoutingContext(params) {
|
|
|
2719
2732
|
const isThreadReply = threadContext.isThreadReply;
|
|
2720
2733
|
const autoThreadId = !isThreadReply && replyToMode === "all" && threadContext.messageTs ? threadContext.messageTs : void 0;
|
|
2721
2734
|
const seedCandidateThreadId = threadContext.incomingThreadTs ?? threadContext.messageTs;
|
|
2722
|
-
const routedThreadId = (isDirectMessage ? assistantThreadTs : isRoomish ? isThreadReply && threadTs ? threadTs : void 0 : isThreadReply ? threadTs : autoThreadId) ?? (isRoomish ? !isThreadReply && isRoom && seedTopLevelRoomThread && replyToMode !== "off" && seedCandidateThreadId ? seedCandidateThreadId : void 0 : void 0);
|
|
2735
|
+
const routedThreadId = (isDirectMessage ? assistantThreadTs ?? agentViewThreadTs : isRoomish ? isThreadReply && threadTs ? threadTs : void 0 : isThreadReply ? threadTs : autoThreadId) ?? (isRoomish ? !isThreadReply && isRoom && seedTopLevelRoomThread && replyToMode !== "off" && seedCandidateThreadId ? seedCandidateThreadId : void 0 : void 0);
|
|
2723
2736
|
const baseConversationId = resolveSlackBaseConversationId({
|
|
2724
2737
|
message,
|
|
2725
2738
|
isDirectMessage,
|
|
@@ -2842,7 +2855,7 @@ function formatSlackThreadLabelSnippet(text) {
|
|
|
2842
2855
|
}
|
|
2843
2856
|
//#endregion
|
|
2844
2857
|
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
2845
|
-
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-
|
|
2858
|
+
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-D51foiwR.js").then((n) => n.g));
|
|
2846
2859
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
2847
2860
|
function resolveSlackThreadSessionFreshness(params) {
|
|
2848
2861
|
return params.ctx.channelRuntime?.session?.resolveEntryResetFreshness?.({
|
|
@@ -3495,6 +3508,14 @@ async function prepareSlackMessage(params) {
|
|
|
3495
3508
|
const assistantThreadContext = mergeSlackAssistantThreadContext(messageAssistantThreadContext, cachedAssistantThreadContext ?? restoredAssistantThreadContext);
|
|
3496
3509
|
const assistantThreadContextToCache = messageAssistantThreadContext || restoredAssistantThreadContext ? assistantThreadContext : void 0;
|
|
3497
3510
|
if (assistantThreadContextToCache) ctx.saveSlackAssistantThreadContext(assistantThreadContextToCache, opts.eventScope);
|
|
3511
|
+
const hasAgentViewMessageSignal = isDirectMessage && !opts.eventScope && !assistantThreadContext && isSlackAppContext(message.app_context);
|
|
3512
|
+
if (hasAgentViewMessageSignal) await ctx.recordSlackAgentView();
|
|
3513
|
+
const managedViewThreadTs = message.thread_ts;
|
|
3514
|
+
const isManagedViewRoot = isDirectMessage && !opts.eventScope && !assistantThreadContext && !message.parent_user_id && Boolean(managedViewThreadTs && message.ts && managedViewThreadTs === message.ts);
|
|
3515
|
+
if (isManagedViewRoot && managedViewThreadTs) await ctx.recordSlackManagedViewThread(message.channel, managedViewThreadTs);
|
|
3516
|
+
const hasManagedViewThread = isDirectMessage && !opts.eventScope && !assistantThreadContext && Boolean(managedViewThreadTs && await ctx.isSlackManagedViewThread(message.channel, managedViewThreadTs));
|
|
3517
|
+
const isAgentViewMessage = isDirectMessage && !opts.eventScope && !assistantThreadContext && (hasAgentViewMessageSignal || isManagedViewRoot || hasManagedViewThread || await ctx.isSlackAgentView());
|
|
3518
|
+
const agentViewThreadTs = isAgentViewMessage ? message.thread_ts ?? message.ts : void 0;
|
|
3498
3519
|
const channelReplyToMode = channelConfig?.replyToMode ?? resolveSlackReplyToMode(account, channelChatType);
|
|
3499
3520
|
const willImplicitlyThreadReply = isRoom && !channelRequireMention && channelReplyToMode !== "off";
|
|
3500
3521
|
const seedTopLevelRoomThreadBySource = opts.source === "app_mention" || opts.wasMentioned === true || explicitlyMentioned || willImplicitlyThreadReply;
|
|
@@ -3509,6 +3530,7 @@ async function prepareSlackMessage(params) {
|
|
|
3509
3530
|
channelConfig,
|
|
3510
3531
|
seedTopLevelRoomThread: seedTopLevelRoomThreadBySource,
|
|
3511
3532
|
assistantThreadTs: assistantThreadContext?.threadTs,
|
|
3533
|
+
agentViewThreadTs,
|
|
3512
3534
|
eventScope: opts.eventScope
|
|
3513
3535
|
});
|
|
3514
3536
|
let mentionCheckTranscript;
|
|
@@ -3534,6 +3556,7 @@ async function prepareSlackMessage(params) {
|
|
|
3534
3556
|
const { configuredBinding, configuredBindingSessionKey } = routing;
|
|
3535
3557
|
const isAssistantThreadMessage = Boolean(isDirectMessage && messageAssistantThreadContext);
|
|
3536
3558
|
const forcedAssistantReplyThreadTs = Boolean(assistantThreadContext?.threadTs && (isThreadReply || isAssistantThreadMessage || replyToMode !== "off")) ? assistantThreadContext?.threadTs : void 0;
|
|
3559
|
+
const forcedReplyThreadTs = agentViewThreadTs ?? forcedAssistantReplyThreadTs;
|
|
3537
3560
|
if (runtimeBinding && shouldLogVerbose()) logVerbose(`slack: routed via bound conversation ${runtimeBinding.conversation.conversationId} -> ${runtimeBinding.targetSessionKey}`);
|
|
3538
3561
|
if (configuredBinding) {
|
|
3539
3562
|
const ensured = await ensureConfiguredBindingRouteReady({
|
|
@@ -3744,6 +3767,7 @@ async function prepareSlackMessage(params) {
|
|
|
3744
3767
|
channelConfig,
|
|
3745
3768
|
seedTopLevelRoomThread: true,
|
|
3746
3769
|
assistantThreadTs: assistantThreadContext?.threadTs,
|
|
3770
|
+
agentViewThreadTs,
|
|
3747
3771
|
eventScope: opts.eventScope
|
|
3748
3772
|
});
|
|
3749
3773
|
return seededMentionRouting;
|
|
@@ -3795,7 +3819,7 @@ async function prepareSlackMessage(params) {
|
|
|
3795
3819
|
preflightAudioTranscript = void 0;
|
|
3796
3820
|
preflightAudioMedia = void 0;
|
|
3797
3821
|
}
|
|
3798
|
-
const directThreadRoutedToDmSession = !assistantThreadContext && isDirectMessage && isThreadReply && threadTs && runtimeBinding?.conversation.conversationId !== threadTs;
|
|
3822
|
+
const directThreadRoutedToDmSession = !assistantThreadContext && !agentViewThreadTs && isDirectMessage && isThreadReply && threadTs && runtimeBinding?.conversation.conversationId !== threadTs;
|
|
3799
3823
|
const mentionDecision = resolveInboundMentionDecision({
|
|
3800
3824
|
facts: {
|
|
3801
3825
|
canDetectMention,
|
|
@@ -3956,7 +3980,7 @@ async function prepareSlackMessage(params) {
|
|
|
3956
3980
|
previousTimestamp,
|
|
3957
3981
|
envelope: envelopeOptions
|
|
3958
3982
|
});
|
|
3959
|
-
const dmHistoryContext = isDirectMessage && !isThreadReply && dmHistoryLimit > 0 && !previousTimestamp ? await resolveSlackDmHistoryContext({
|
|
3983
|
+
const dmHistoryContext = isDirectMessage && !assistantThreadContext && !agentViewThreadTs && !isThreadReply && dmHistoryLimit > 0 && !previousTimestamp ? await resolveSlackDmHistoryContext({
|
|
3960
3984
|
ctx,
|
|
3961
3985
|
channelId: message.channel,
|
|
3962
3986
|
currentMessageTs: message.ts,
|
|
@@ -4014,7 +4038,8 @@ async function prepareSlackMessage(params) {
|
|
|
4014
4038
|
}) : dmHistoryContext.inboundHistory;
|
|
4015
4039
|
const commandBody = textForCommandDetection.trim();
|
|
4016
4040
|
const supplementalThreadHistoryBody = directThreadRoutedToDmSession && !threadHistoryBody ? threadStarterBody : threadHistoryBody;
|
|
4017
|
-
const effectiveMessageThreadId = assistantThreadContext?.threadTs ?? threadContext.messageThreadId;
|
|
4041
|
+
const effectiveMessageThreadId = assistantThreadContext?.threadTs ?? agentViewThreadTs ?? threadContext.messageThreadId;
|
|
4042
|
+
const agentContextEntities = isAgentViewMessage ? normalizeSlackAppContextEntities(message.app_context) : [];
|
|
4018
4043
|
const ctxPayload = buildChannelInboundEventContext({
|
|
4019
4044
|
channel: "slack",
|
|
4020
4045
|
accountId: route.accountId,
|
|
@@ -4056,6 +4081,7 @@ async function prepareSlackMessage(params) {
|
|
|
4056
4081
|
commandBody,
|
|
4057
4082
|
inboundHistory
|
|
4058
4083
|
},
|
|
4084
|
+
sessionTranscript: { historyLimit: isRoomish ? ctx.historyLimit : dmHistoryLimit },
|
|
4059
4085
|
access: {
|
|
4060
4086
|
mentions: {
|
|
4061
4087
|
canDetectMention: isRoomish,
|
|
@@ -4079,8 +4105,15 @@ async function prepareSlackMessage(params) {
|
|
|
4079
4105
|
extra: {
|
|
4080
4106
|
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
4081
4107
|
UntrustedContext: untrustedChannelMetadata ? [untrustedChannelMetadata] : void 0,
|
|
4108
|
+
UntrustedStructuredContext: agentContextEntities.length > 0 ? [{
|
|
4109
|
+
label: "Slack active context",
|
|
4110
|
+
source: "slack",
|
|
4111
|
+
type: "active_view",
|
|
4112
|
+
payload: { entities: agentContextEntities }
|
|
4113
|
+
}] : void 0,
|
|
4082
4114
|
TransportThreadId: directThreadRoutedToDmSession ? threadContext.messageThreadId : void 0,
|
|
4083
4115
|
SlackAssistantThread: assistantThreadContext ? true : void 0,
|
|
4116
|
+
SlackAgentThread: agentViewThreadTs ? true : void 0,
|
|
4084
4117
|
SlackAssistantThreadContextChannelId: assistantThreadContext?.channelId,
|
|
4085
4118
|
SlackAssistantThreadContextTeamId: assistantThreadContext?.teamId,
|
|
4086
4119
|
SlackAssistantThreadContextEnterpriseId: assistantThreadContext?.enterpriseId ?? void 0,
|
|
@@ -4170,7 +4203,7 @@ async function prepareSlackMessage(params) {
|
|
|
4170
4203
|
} : void 0
|
|
4171
4204
|
},
|
|
4172
4205
|
replyToMode,
|
|
4173
|
-
...
|
|
4206
|
+
...forcedReplyThreadTs ? { forcedReplyThreadTs } : {},
|
|
4174
4207
|
...assistantThreadContext ? { slackMessageMetadata: buildSlackAssistantThreadMetadata(assistantThreadContext) } : {},
|
|
4175
4208
|
requireMention: shouldRequireMention,
|
|
4176
4209
|
isDirectMessage,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as normalizeSlackSlug, t as buildSlackChannelPolicyScope } from "./group-policy-
|
|
1
|
+
import { l as normalizeSlackSlug, t as buildSlackChannelPolicyScope } from "./group-policy-CdnQzQBI.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { applyChannelMatchMeta, buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
4
4
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
2
|
+
import { u as formatSlackBotTokenIdentityWarning } from "./accounts-BSr252c_.js";
|
|
3
3
|
import "./target-parsing-N6lHogYZ.js";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|