@openclaw/slack 2026.5.12-beta.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/dist/account-inspect-D7AZNs8C.js +77 -0
- package/dist/account-inspect-api.js +10 -0
- package/dist/accounts-ClAPP5ry.js +139 -0
- package/dist/accounts.runtime-DDVcLJUI.js +2 -0
- package/dist/action-runtime-e2UhRsNx.js +350 -0
- package/dist/action-runtime.runtime-BFcqMbOm.js +2 -0
- package/dist/actions-CYLFK-Zy.js +292 -0
- package/dist/actions.runtime-CO3OaTLb.js +2 -0
- package/dist/allow-list-BPnnlRPL.js +82 -0
- package/dist/api.js +21 -0
- package/dist/approval-handler.runtime-CmeRr9qA.js +256 -0
- package/dist/blocks-input-CwTFVImV.js +29 -0
- package/dist/blocks-render-BIDw-Pom.js +161 -0
- package/dist/channel-DRjHBTDB.js +1020 -0
- package/dist/channel-api-B_nZwosg.js +20 -0
- package/dist/channel-config-api.js +2 -0
- package/dist/channel-entry.js +22 -0
- package/dist/channel-plugin-api.js +2 -0
- package/dist/channel.setup-Cayn7afd.js +73 -0
- package/dist/client-CPe4GmDR.js +103 -0
- package/dist/config-api-B_jq4NJW.js +2 -0
- package/dist/config-schema-D9B5LB_L.js +167 -0
- package/dist/configured-state.js +11 -0
- package/dist/contract-api.js +5 -0
- package/dist/directory-config-B3JiHeB7.js +54 -0
- package/dist/directory-contract-api.js +2 -0
- package/dist/directory-live-Bf16GwDh.js +133 -0
- package/dist/doctor-contract-KUjHnkQm.js +147 -0
- package/dist/doctor-contract-api.js +2 -0
- package/dist/errors-BYFHR24f.js +109 -0
- package/dist/exec-approvals-7xUNgLi9.js +58 -0
- package/dist/group-policy-CyLUK6My.js +41 -0
- package/dist/http-routes-api.js +2 -0
- package/dist/inbound-contract-test-api.js +3 -0
- package/dist/index.js +33 -0
- package/dist/interactive-replies-api.js +2 -0
- package/dist/interactive-replies-qAIfuBor.js +173 -0
- package/dist/magic-string.es-BMaGRRZ1.js +1011 -0
- package/dist/media-D1XCd1uP.js +469 -0
- package/dist/message-tool-api-6lowf9zE.js +104 -0
- package/dist/message-tool-api.js +2 -0
- package/dist/monitor-a97o17G6.js +13 -0
- package/dist/mrkdwn-Cax-eSfK.js +6 -0
- package/dist/outbound-adapter-B_5sEhCg.js +174 -0
- package/dist/outbound-payload-test-api.js +2 -0
- package/dist/outbound-payload.test-harness-CVCamg1x.js +13558 -0
- package/dist/pipeline.runtime-DT0hLnq2.js +1379 -0
- package/dist/plugin-routes-DtTPmga1.js +20 -0
- package/dist/prepare-D3YqV8jB.js +1482 -0
- package/dist/prepare.test-helpers-DVcjRhfG.js +49 -0
- package/dist/probe-3eZf1FjI.js +42 -0
- package/dist/provider-D7uAN3Fq.js +3235 -0
- package/dist/registry-CeaoNfoP.js +39 -0
- package/dist/replies-Xe_jMR6o.js +139 -0
- package/dist/reply-blocks-Z5l6_R6H.js +14 -0
- package/dist/resolve-allowlist-common-Bk3clYPK.js +43 -0
- package/dist/resolve-channels-BRYqyNVJ.js +81 -0
- package/dist/resolve-users-Bd_SdP8j.js +113 -0
- package/dist/rolldown-runtime-CiIaOW0V.js +13 -0
- package/dist/room-context-0vovmZPU.js +787 -0
- package/dist/runtime-Bo-KHM-F.js +8 -0
- package/dist/runtime-api-Dd1xIV5v.js +9 -0
- package/dist/runtime-api.js +14 -0
- package/dist/runtime-setter-api.js +2 -0
- package/dist/scopes-CDevO8jg.js +74 -0
- package/dist/secret-contract-Bo6lbSkh.js +141 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/security-audit-BtHGnD3d.js +51 -0
- package/dist/security-contract-api.js +2 -0
- package/dist/send-D_A9kL-C.js +721 -0
- package/dist/send.runtime-BRE_ncCU.js +2 -0
- package/dist/send.runtime-_l76lUuL.js +2 -0
- package/dist/setup-core-B9NetDkM.js +320 -0
- package/dist/setup-entry.js +15 -0
- package/dist/setup-plugin-api.js +2 -0
- package/dist/setup-surface-D88QBVOW.js +128 -0
- package/dist/shared-D8U42xFL.js +208 -0
- package/dist/slash-commands.runtime-22kgyst2.js +19 -0
- package/dist/slash-dispatch.runtime-BJgT0jwV.js +32 -0
- package/dist/slash-plugin-commands.runtime-CF-n3MeP.js +2 -0
- package/dist/slash-skill-commands.runtime-BMs0VjTe.js +7 -0
- package/dist/streaming-compat-RkZgTmQ2.js +43 -0
- package/dist/target-parsing-CQmv-iSm.js +55 -0
- package/dist/targets-B1tYCAr6.js +2 -0
- package/dist/test-api.js +8 -0
- package/dist/thread-ts-C2x7c5PP.js +24 -0
- package/openclaw.plugin.json +2405 -0
- package/package.json +84 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
|
+
import { n as buildSlackPresentationBlocks, r as resolveSlackInteractiveBlockOffsets, t as buildSlackInteractiveBlocks } from "./blocks-render-BIDw-Pom.js";
|
|
3
|
+
import { n as resolveSlackThreadTsValue, r as SLACK_TEXT_LIMIT } from "./thread-ts-C2x7c5PP.js";
|
|
4
|
+
import { t as compileSlackInteractiveReplies } from "./interactive-replies-qAIfuBor.js";
|
|
5
|
+
import { n as parseSlackBlocksInput } from "./blocks-input-CwTFVImV.js";
|
|
6
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
8
|
+
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/outbound-send-deps";
|
|
9
|
+
import { resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
10
|
+
import { resolvePayloadMediaUrls, sendPayloadMediaSequenceAndFinalize, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
11
|
+
//#region extensions/slack/src/outbound-adapter.ts
|
|
12
|
+
var outbound_adapter_exports = /* @__PURE__ */ __exportAll({ slackOutbound: () => slackOutbound });
|
|
13
|
+
const SLACK_MAX_BLOCKS = 50;
|
|
14
|
+
let slackSendRuntimePromise;
|
|
15
|
+
async function loadSlackSendRuntime() {
|
|
16
|
+
slackSendRuntimePromise ??= import("./send.runtime-_l76lUuL.js");
|
|
17
|
+
return await slackSendRuntimePromise;
|
|
18
|
+
}
|
|
19
|
+
function resolveRenderedInteractiveBlocks(interactive, previousBlocks) {
|
|
20
|
+
if (!interactive) return;
|
|
21
|
+
const blocks = buildSlackInteractiveBlocks(interactive, resolveSlackInteractiveBlockOffsets(previousBlocks));
|
|
22
|
+
return blocks.length > 0 ? blocks : void 0;
|
|
23
|
+
}
|
|
24
|
+
function resolveSlackSendIdentity(identity) {
|
|
25
|
+
if (!identity) return;
|
|
26
|
+
const username = normalizeOptionalString(identity.name);
|
|
27
|
+
const iconUrl = normalizeOptionalString(identity.avatarUrl);
|
|
28
|
+
const rawEmoji = normalizeOptionalString(identity.emoji);
|
|
29
|
+
const iconEmoji = !iconUrl && rawEmoji && /^:[^:\s]+:$/.test(rawEmoji) ? rawEmoji : void 0;
|
|
30
|
+
if (!username && !iconUrl && !iconEmoji) return;
|
|
31
|
+
return {
|
|
32
|
+
username,
|
|
33
|
+
iconUrl,
|
|
34
|
+
iconEmoji
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async function sendSlackOutboundMessage(params) {
|
|
38
|
+
const send = resolveOutboundSendDep(params.deps, "slack") ?? (await loadSlackSendRuntime()).sendMessageSlack;
|
|
39
|
+
const slackIdentity = resolveSlackSendIdentity(params.identity);
|
|
40
|
+
const threadTs = resolveSlackThreadTsValue({
|
|
41
|
+
replyToId: params.replyToId,
|
|
42
|
+
threadId: params.threadId
|
|
43
|
+
});
|
|
44
|
+
return await send(params.to, params.text, {
|
|
45
|
+
cfg: params.cfg,
|
|
46
|
+
threadTs,
|
|
47
|
+
accountId: params.accountId ?? void 0,
|
|
48
|
+
...params.mediaUrl ? {
|
|
49
|
+
mediaUrl: params.mediaUrl,
|
|
50
|
+
mediaAccess: params.mediaAccess,
|
|
51
|
+
mediaLocalRoots: params.mediaLocalRoots,
|
|
52
|
+
mediaReadFile: params.mediaReadFile
|
|
53
|
+
} : {},
|
|
54
|
+
...params.blocks ? { blocks: params.blocks } : {},
|
|
55
|
+
...slackIdentity ? { identity: slackIdentity } : {}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function resolveSlackBlocks(payload) {
|
|
59
|
+
const slackData = payload.channelData?.slack;
|
|
60
|
+
const nativeBlocks = parseSlackBlocksInput(slackData?.blocks);
|
|
61
|
+
const renderedPresentation = slackData?.presentationBlocks ?? buildSlackPresentationBlocks(payload.presentation, resolveSlackInteractiveBlockOffsets(nativeBlocks));
|
|
62
|
+
const previousBlocks = [...nativeBlocks ?? [], ...renderedPresentation];
|
|
63
|
+
const renderedInteractive = resolveRenderedInteractiveBlocks(payload.interactive, previousBlocks);
|
|
64
|
+
const mergedBlocks = [...previousBlocks, ...renderedInteractive ?? []];
|
|
65
|
+
if (mergedBlocks.length === 0) return;
|
|
66
|
+
if (mergedBlocks.length > SLACK_MAX_BLOCKS) throw new Error(`Slack blocks cannot exceed ${SLACK_MAX_BLOCKS} items after interactive render`);
|
|
67
|
+
return mergedBlocks;
|
|
68
|
+
}
|
|
69
|
+
const slackOutbound = {
|
|
70
|
+
deliveryMode: "direct",
|
|
71
|
+
chunker: null,
|
|
72
|
+
textChunkLimit: SLACK_TEXT_LIMIT,
|
|
73
|
+
normalizePayload: ({ payload }) => compileSlackInteractiveReplies(payload),
|
|
74
|
+
presentationCapabilities: {
|
|
75
|
+
supported: true,
|
|
76
|
+
buttons: true,
|
|
77
|
+
selects: true,
|
|
78
|
+
context: true,
|
|
79
|
+
divider: true
|
|
80
|
+
},
|
|
81
|
+
renderPresentation: ({ payload, presentation }) => {
|
|
82
|
+
const slackData = payload.channelData?.slack;
|
|
83
|
+
const nativeBlocks = parseSlackBlocksInput(slackData?.blocks);
|
|
84
|
+
return {
|
|
85
|
+
...payload,
|
|
86
|
+
channelData: {
|
|
87
|
+
...payload.channelData,
|
|
88
|
+
slack: {
|
|
89
|
+
...slackData,
|
|
90
|
+
presentationBlocks: buildSlackPresentationBlocks(presentation, resolveSlackInteractiveBlockOffsets(nativeBlocks))
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
sendPayload: async (ctx) => {
|
|
96
|
+
const payload = {
|
|
97
|
+
...ctx.payload,
|
|
98
|
+
text: resolveInteractiveTextFallback({
|
|
99
|
+
text: ctx.payload.text,
|
|
100
|
+
interactive: ctx.payload.interactive
|
|
101
|
+
}) ?? ""
|
|
102
|
+
};
|
|
103
|
+
const blocks = resolveSlackBlocks(payload);
|
|
104
|
+
if (!blocks) return await sendTextMediaPayload({
|
|
105
|
+
channel: "slack",
|
|
106
|
+
ctx: {
|
|
107
|
+
...ctx,
|
|
108
|
+
payload
|
|
109
|
+
},
|
|
110
|
+
adapter: slackOutbound
|
|
111
|
+
});
|
|
112
|
+
return attachChannelToResult("slack", await sendPayloadMediaSequenceAndFinalize({
|
|
113
|
+
text: "",
|
|
114
|
+
mediaUrls: resolvePayloadMediaUrls(payload),
|
|
115
|
+
send: async ({ text, mediaUrl }) => await sendSlackOutboundMessage({
|
|
116
|
+
cfg: ctx.cfg,
|
|
117
|
+
to: ctx.to,
|
|
118
|
+
text,
|
|
119
|
+
mediaUrl,
|
|
120
|
+
mediaAccess: ctx.mediaAccess,
|
|
121
|
+
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
122
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
123
|
+
accountId: ctx.accountId,
|
|
124
|
+
deps: ctx.deps,
|
|
125
|
+
replyToId: ctx.replyToId,
|
|
126
|
+
threadId: ctx.threadId,
|
|
127
|
+
identity: ctx.identity
|
|
128
|
+
}),
|
|
129
|
+
finalize: async () => await sendSlackOutboundMessage({
|
|
130
|
+
cfg: ctx.cfg,
|
|
131
|
+
to: ctx.to,
|
|
132
|
+
text: payload.text ?? "",
|
|
133
|
+
mediaAccess: ctx.mediaAccess,
|
|
134
|
+
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
135
|
+
mediaReadFile: ctx.mediaReadFile,
|
|
136
|
+
blocks,
|
|
137
|
+
accountId: ctx.accountId,
|
|
138
|
+
deps: ctx.deps,
|
|
139
|
+
replyToId: ctx.replyToId,
|
|
140
|
+
threadId: ctx.threadId,
|
|
141
|
+
identity: ctx.identity
|
|
142
|
+
})
|
|
143
|
+
}));
|
|
144
|
+
},
|
|
145
|
+
...createAttachedChannelResultAdapter({
|
|
146
|
+
channel: "slack",
|
|
147
|
+
sendText: async ({ cfg, to, text, accountId, deps, replyToId, threadId, identity }) => await sendSlackOutboundMessage({
|
|
148
|
+
cfg,
|
|
149
|
+
to,
|
|
150
|
+
text,
|
|
151
|
+
accountId,
|
|
152
|
+
deps,
|
|
153
|
+
replyToId,
|
|
154
|
+
threadId,
|
|
155
|
+
identity
|
|
156
|
+
}),
|
|
157
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, deps, replyToId, threadId, identity }) => await sendSlackOutboundMessage({
|
|
158
|
+
cfg,
|
|
159
|
+
to,
|
|
160
|
+
text,
|
|
161
|
+
mediaUrl,
|
|
162
|
+
mediaAccess,
|
|
163
|
+
mediaLocalRoots,
|
|
164
|
+
mediaReadFile,
|
|
165
|
+
accountId,
|
|
166
|
+
deps,
|
|
167
|
+
replyToId,
|
|
168
|
+
threadId,
|
|
169
|
+
identity
|
|
170
|
+
})
|
|
171
|
+
})
|
|
172
|
+
};
|
|
173
|
+
//#endregion
|
|
174
|
+
export { slackOutbound as n, outbound_adapter_exports as t };
|