@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.
Files changed (88) hide show
  1. package/dist/account-inspect-D7AZNs8C.js +77 -0
  2. package/dist/account-inspect-api.js +10 -0
  3. package/dist/accounts-ClAPP5ry.js +139 -0
  4. package/dist/accounts.runtime-DDVcLJUI.js +2 -0
  5. package/dist/action-runtime-e2UhRsNx.js +350 -0
  6. package/dist/action-runtime.runtime-BFcqMbOm.js +2 -0
  7. package/dist/actions-CYLFK-Zy.js +292 -0
  8. package/dist/actions.runtime-CO3OaTLb.js +2 -0
  9. package/dist/allow-list-BPnnlRPL.js +82 -0
  10. package/dist/api.js +21 -0
  11. package/dist/approval-handler.runtime-CmeRr9qA.js +256 -0
  12. package/dist/blocks-input-CwTFVImV.js +29 -0
  13. package/dist/blocks-render-BIDw-Pom.js +161 -0
  14. package/dist/channel-DRjHBTDB.js +1020 -0
  15. package/dist/channel-api-B_nZwosg.js +20 -0
  16. package/dist/channel-config-api.js +2 -0
  17. package/dist/channel-entry.js +22 -0
  18. package/dist/channel-plugin-api.js +2 -0
  19. package/dist/channel.setup-Cayn7afd.js +73 -0
  20. package/dist/client-CPe4GmDR.js +103 -0
  21. package/dist/config-api-B_jq4NJW.js +2 -0
  22. package/dist/config-schema-D9B5LB_L.js +167 -0
  23. package/dist/configured-state.js +11 -0
  24. package/dist/contract-api.js +5 -0
  25. package/dist/directory-config-B3JiHeB7.js +54 -0
  26. package/dist/directory-contract-api.js +2 -0
  27. package/dist/directory-live-Bf16GwDh.js +133 -0
  28. package/dist/doctor-contract-KUjHnkQm.js +147 -0
  29. package/dist/doctor-contract-api.js +2 -0
  30. package/dist/errors-BYFHR24f.js +109 -0
  31. package/dist/exec-approvals-7xUNgLi9.js +58 -0
  32. package/dist/group-policy-CyLUK6My.js +41 -0
  33. package/dist/http-routes-api.js +2 -0
  34. package/dist/inbound-contract-test-api.js +3 -0
  35. package/dist/index.js +33 -0
  36. package/dist/interactive-replies-api.js +2 -0
  37. package/dist/interactive-replies-qAIfuBor.js +173 -0
  38. package/dist/magic-string.es-BMaGRRZ1.js +1011 -0
  39. package/dist/media-D1XCd1uP.js +469 -0
  40. package/dist/message-tool-api-6lowf9zE.js +104 -0
  41. package/dist/message-tool-api.js +2 -0
  42. package/dist/monitor-a97o17G6.js +13 -0
  43. package/dist/mrkdwn-Cax-eSfK.js +6 -0
  44. package/dist/outbound-adapter-B_5sEhCg.js +174 -0
  45. package/dist/outbound-payload-test-api.js +2 -0
  46. package/dist/outbound-payload.test-harness-CVCamg1x.js +13558 -0
  47. package/dist/pipeline.runtime-DT0hLnq2.js +1379 -0
  48. package/dist/plugin-routes-DtTPmga1.js +20 -0
  49. package/dist/prepare-D3YqV8jB.js +1482 -0
  50. package/dist/prepare.test-helpers-DVcjRhfG.js +49 -0
  51. package/dist/probe-3eZf1FjI.js +42 -0
  52. package/dist/provider-D7uAN3Fq.js +3235 -0
  53. package/dist/registry-CeaoNfoP.js +39 -0
  54. package/dist/replies-Xe_jMR6o.js +139 -0
  55. package/dist/reply-blocks-Z5l6_R6H.js +14 -0
  56. package/dist/resolve-allowlist-common-Bk3clYPK.js +43 -0
  57. package/dist/resolve-channels-BRYqyNVJ.js +81 -0
  58. package/dist/resolve-users-Bd_SdP8j.js +113 -0
  59. package/dist/rolldown-runtime-CiIaOW0V.js +13 -0
  60. package/dist/room-context-0vovmZPU.js +787 -0
  61. package/dist/runtime-Bo-KHM-F.js +8 -0
  62. package/dist/runtime-api-Dd1xIV5v.js +9 -0
  63. package/dist/runtime-api.js +14 -0
  64. package/dist/runtime-setter-api.js +2 -0
  65. package/dist/scopes-CDevO8jg.js +74 -0
  66. package/dist/secret-contract-Bo6lbSkh.js +141 -0
  67. package/dist/secret-contract-api.js +2 -0
  68. package/dist/security-audit-BtHGnD3d.js +51 -0
  69. package/dist/security-contract-api.js +2 -0
  70. package/dist/send-D_A9kL-C.js +721 -0
  71. package/dist/send.runtime-BRE_ncCU.js +2 -0
  72. package/dist/send.runtime-_l76lUuL.js +2 -0
  73. package/dist/setup-core-B9NetDkM.js +320 -0
  74. package/dist/setup-entry.js +15 -0
  75. package/dist/setup-plugin-api.js +2 -0
  76. package/dist/setup-surface-D88QBVOW.js +128 -0
  77. package/dist/shared-D8U42xFL.js +208 -0
  78. package/dist/slash-commands.runtime-22kgyst2.js +19 -0
  79. package/dist/slash-dispatch.runtime-BJgT0jwV.js +32 -0
  80. package/dist/slash-plugin-commands.runtime-CF-n3MeP.js +2 -0
  81. package/dist/slash-skill-commands.runtime-BMs0VjTe.js +7 -0
  82. package/dist/streaming-compat-RkZgTmQ2.js +43 -0
  83. package/dist/target-parsing-CQmv-iSm.js +55 -0
  84. package/dist/targets-B1tYCAr6.js +2 -0
  85. package/dist/test-api.js +8 -0
  86. package/dist/thread-ts-C2x7c5PP.js +24 -0
  87. package/openclaw.plugin.json +2405 -0
  88. package/package.json +84 -0
@@ -0,0 +1,161 @@
1
+ import { i as truncateSlackText } from "./thread-ts-C2x7c5PP.js";
2
+ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ import { presentationToInteractiveControlsReply, reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
4
+ //#region extensions/slack/src/reply-action-ids.ts
5
+ const SLACK_REPLY_BUTTON_ACTION_ID = "openclaw:reply_button";
6
+ const SLACK_REPLY_SELECT_ACTION_ID = "openclaw:reply_select";
7
+ //#endregion
8
+ //#region extensions/slack/src/blocks-render.ts
9
+ const SLACK_SECTION_TEXT_MAX = 3e3;
10
+ const SLACK_PLAIN_TEXT_MAX = 75;
11
+ const SLACK_OPTION_VALUE_MAX = 150;
12
+ const SLACK_BUTTON_VALUE_MAX = 2e3;
13
+ const SLACK_BUTTON_URL_MAX = 3e3;
14
+ const SLACK_STATIC_SELECT_OPTIONS_MAX = 100;
15
+ const SLACK_ACTION_BLOCK_ELEMENTS_MAX = 25;
16
+ function buildSlackReplyButtonActionId(buttonIndex, choiceIndex) {
17
+ return `${SLACK_REPLY_BUTTON_ACTION_ID}:${String(buttonIndex)}:${String(choiceIndex + 1)}`;
18
+ }
19
+ function buildSlackReplySelectActionId(selectIndex) {
20
+ return `${SLACK_REPLY_SELECT_ACTION_ID}:${String(selectIndex)}`;
21
+ }
22
+ function resolveSlackButtonStyle(style) {
23
+ if (style === "primary" || style === "danger") return style;
24
+ if (style === "success") return "primary";
25
+ }
26
+ function isWithinSlackLimit(value, maxLength) {
27
+ return value.length <= maxLength;
28
+ }
29
+ function readSlackBlockId(block) {
30
+ const value = block.block_id;
31
+ return typeof value === "string" ? value : void 0;
32
+ }
33
+ function readSlackOpenClawBlockIndex(blockId, prefix) {
34
+ if (!blockId.startsWith(prefix)) return;
35
+ const value = Number.parseInt(blockId.slice(prefix.length), 10);
36
+ return Number.isSafeInteger(value) && value > 0 ? value : void 0;
37
+ }
38
+ function resolveSlackInteractiveBlockOffsets(blocks) {
39
+ let buttonIndexOffset = 0;
40
+ let selectIndexOffset = 0;
41
+ for (const block of blocks ?? []) {
42
+ const blockId = readSlackBlockId(block);
43
+ if (!blockId) continue;
44
+ buttonIndexOffset = Math.max(buttonIndexOffset, readSlackOpenClawBlockIndex(blockId, "openclaw_reply_buttons_") ?? 0);
45
+ selectIndexOffset = Math.max(selectIndexOffset, readSlackOpenClawBlockIndex(blockId, "openclaw_reply_select_") ?? 0);
46
+ }
47
+ return {
48
+ buttonIndexOffset,
49
+ selectIndexOffset
50
+ };
51
+ }
52
+ function buildSlackInteractiveBlocks(interactive, options = {}) {
53
+ return reduceInteractiveReply(interactive, {
54
+ blocks: [],
55
+ buttonIndex: options.buttonIndexOffset ?? 0,
56
+ selectIndex: options.selectIndexOffset ?? 0
57
+ }, (state, block) => {
58
+ if (block.type === "text") {
59
+ const trimmed = block.text.trim();
60
+ if (!trimmed) return state;
61
+ state.blocks.push({
62
+ type: "section",
63
+ text: {
64
+ type: "mrkdwn",
65
+ text: truncateSlackText(trimmed, SLACK_SECTION_TEXT_MAX)
66
+ }
67
+ });
68
+ return state;
69
+ }
70
+ if (block.type === "buttons") {
71
+ const elements = block.buttons.flatMap((button, choiceIndex) => {
72
+ const value = button.value && isWithinSlackLimit(button.value, SLACK_BUTTON_VALUE_MAX) ? button.value : void 0;
73
+ const url = button.url && isWithinSlackLimit(button.url, SLACK_BUTTON_URL_MAX) ? button.url : void 0;
74
+ if (!value && !url) return [];
75
+ const style = resolveSlackButtonStyle(button.style);
76
+ return [{
77
+ type: "button",
78
+ action_id: buildSlackReplyButtonActionId(state.buttonIndex + 1, choiceIndex),
79
+ text: {
80
+ type: "plain_text",
81
+ text: truncateSlackText(button.label, SLACK_PLAIN_TEXT_MAX),
82
+ emoji: true
83
+ },
84
+ ...value ? { value } : {},
85
+ ...url ? { url } : {},
86
+ ...style ? { style } : {}
87
+ }];
88
+ }).slice(0, SLACK_ACTION_BLOCK_ELEMENTS_MAX);
89
+ if (elements.length === 0) return state;
90
+ state.blocks.push({
91
+ type: "actions",
92
+ block_id: `openclaw_reply_buttons_${++state.buttonIndex}`,
93
+ elements
94
+ });
95
+ return state;
96
+ }
97
+ const options = block.options.filter((option) => isWithinSlackLimit(option.value, SLACK_OPTION_VALUE_MAX)).slice(0, SLACK_STATIC_SELECT_OPTIONS_MAX);
98
+ if (options.length === 0) return state;
99
+ state.blocks.push({
100
+ type: "actions",
101
+ block_id: `openclaw_reply_select_${++state.selectIndex}`,
102
+ elements: [{
103
+ type: "static_select",
104
+ action_id: buildSlackReplySelectActionId(state.selectIndex),
105
+ placeholder: {
106
+ type: "plain_text",
107
+ text: truncateSlackText(normalizeOptionalString(block.placeholder) ?? "Choose an option", SLACK_PLAIN_TEXT_MAX),
108
+ emoji: true
109
+ },
110
+ options: options.map((option, _choiceIndex) => ({
111
+ text: {
112
+ type: "plain_text",
113
+ text: truncateSlackText(option.label, SLACK_PLAIN_TEXT_MAX),
114
+ emoji: true
115
+ },
116
+ value: option.value
117
+ }))
118
+ }]
119
+ });
120
+ return state;
121
+ }).blocks;
122
+ }
123
+ function buildSlackPresentationBlocks(presentation, options = {}) {
124
+ if (!presentation) return [];
125
+ const blocks = [];
126
+ if (presentation.title) blocks.push({
127
+ type: "header",
128
+ text: {
129
+ type: "plain_text",
130
+ text: truncateSlackText(presentation.title, 150),
131
+ emoji: true
132
+ }
133
+ });
134
+ for (const block of presentation.blocks) {
135
+ if (block.type === "text" || block.type === "context") {
136
+ const text = block.text.trim();
137
+ if (!text) continue;
138
+ if (block.type === "context") blocks.push({
139
+ type: "context",
140
+ elements: [{
141
+ type: "mrkdwn",
142
+ text: truncateSlackText(text, SLACK_SECTION_TEXT_MAX)
143
+ }]
144
+ });
145
+ else blocks.push({
146
+ type: "section",
147
+ text: {
148
+ type: "mrkdwn",
149
+ text: truncateSlackText(text, SLACK_SECTION_TEXT_MAX)
150
+ }
151
+ });
152
+ continue;
153
+ }
154
+ if (block.type === "divider") blocks.push({ type: "divider" });
155
+ }
156
+ const interactive = presentationToInteractiveControlsReply(presentation);
157
+ blocks.push(...buildSlackInteractiveBlocks(interactive, options));
158
+ return blocks;
159
+ }
160
+ //#endregion
161
+ export { SLACK_REPLY_SELECT_ACTION_ID as a, SLACK_REPLY_BUTTON_ACTION_ID as i, buildSlackPresentationBlocks as n, resolveSlackInteractiveBlockOffsets as r, buildSlackInteractiveBlocks as t };