@openclaw/slack 2026.9.1-beta.1 → 2026.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-inspect-CN2hBsim.js → account-inspect-C3sePHWa.js} +3 -3
- package/dist/account-inspect-api.js +1 -1
- package/dist/{action-runtime-BoSeX09X.js → action-runtime-DftQWpI4.js} +84 -66
- package/dist/action-runtime.runtime-rHI3UAh4.js +2 -0
- package/dist/{actions-XdQyjG_p.js → actions-CFkvEv1d.js} +198 -54
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-DxXfGX_Z.js → approval-handler.runtime-BeILKdw4.js} +47 -25
- package/dist/{channel-C_vnTgxo.js → channel-CmOuxbOD.js} +76 -133
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-j-2lalcC.js → channel-type-BWt2CRaI.js} +2 -2
- package/dist/{channel.setup-aal8tokM.js → channel.setup-D5z1ReaT.js} +29 -23
- package/dist/{config-schema-CN3XZRX5.js → config-schema-JDx_f9Zb.js} +26 -17
- package/dist/{cursor-pages-eX7p8Wwt.js → cursor-pages-ByFwo-Py.js} +7 -1
- package/dist/{directory-config-DqfQ42OV.js → directory-config-Bmw4ykSy.js} +4 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-lC6X_Ru-.js → directory-live-BuBPHmju.js} +3 -8
- package/dist/{doctor-contract-BAy7-EUQ.js → doctor-contract-BNjw9bxb.js} +5 -4
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{message-tool-api-CWosHSi5.js → message-tool-api-uNEfQYGY.js} +19 -2
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-DrNCGneD.js → monitor-DI07pfJl.js} +3 -3
- package/dist/{outbound-adapter-DkT2vUE9.js → outbound-adapter-B5QyTRpJ.js} +96 -91
- package/dist/{pipeline.runtime-CRRng_Nw.js → pipeline.runtime-BdIwZgm4.js} +596 -920
- package/dist/{policy-BoP6t88v.js → policy-Bh5TOqII.js} +7 -4
- package/dist/{probe-4_aHtVT3.js → probe-Biy--yhL.js} +251 -12
- package/dist/{provider-D4nDgxCh.js → provider-DoaUvAM4.js} +5621 -4944
- package/dist/{relay-source-CEmze11m.js → relay-source-D4uecp68.js} +6 -4
- package/dist/{replies-D9XMM_S0.js → replies-DENuTcPO.js} +21 -16
- package/dist/reply-blocks-PRkhyAN7.js +790 -0
- package/dist/{resolve-channels-DSamDgVs.js → resolve-channels-DQGV2VrE.js} +6 -10
- package/dist/{resolve-users-CIzwbaJR.js → resolve-users-DRGt_Q4I.js} +5 -4
- package/dist/runtime-api.js +10 -10
- package/dist/{scopes-BBrUzpBH.js → scopes-CZzeGdWV.js} +1 -1
- package/dist/{send-DtjEnlLh.js → send-DElUcgIs.js} +32 -24
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-DQeNKa2J.js → send.runtime-C8D6cKGm.js} +1 -1
- package/dist/{group-policy-CU1tEGpS.js → session-status-BynwcZSO.js} +284 -1013
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CsBCM4rP.js → setup-surface-B1_gpGBl.js} +5 -5
- package/dist/{shared-D9GeeR9K.js → shared-CNQsWJT7.js} +7 -5
- package/dist/{slash-dispatch.runtime-Chr3YHnT.js → slash-dispatch.runtime-DhsXavSY.js} +2 -2
- package/dist/{target-parsing-BnMD2ZqZ.js → target-parsing-PbxGDbr9.js} +11 -6
- package/dist/{targets-Cx5W_n3W.js → targets-7FexXJ62.js} +1 -1
- package/dist/{thread-ts-DUGhaYKq.js → thread-ts-CukseRVL.js} +5 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/package.json +16 -10
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/openclaw.plugin.json +17 -9
- package/package.json +6 -6
- package/skills/_vendor/slack-skills-plugin.LICENSE +21 -0
- package/skills/_vendor/slack-skills-plugin.json +31 -0
- package/skills/block-kit/SKILL.md +37 -0
- package/skills/block-kit/references/official-block-kit.md +257 -0
- package/skills/block-kit/references/official-common-patterns.md +385 -0
- package/skills/slack/SKILL.md +1 -1
- package/dist/action-runtime.runtime-Dpa16J87.js +0 -2
- package/dist/conversation-binding-route-DFVLUdYF.js +0 -115
- package/dist/slack-client-kind-hSfjXyUM.js +0 -94
- package/node_modules/@slack/bolt/node_modules/negotiator/HISTORY.md +0 -114
|
@@ -35,13 +35,13 @@ function inspectSlackAccount(params) {
|
|
|
35
35
|
const mode = merged.mode ?? "socket";
|
|
36
36
|
const identity = merged.postAs ?? "bot";
|
|
37
37
|
const isHttpMode = mode === "http";
|
|
38
|
-
const
|
|
38
|
+
const isSocketMode = mode === "socket";
|
|
39
39
|
const configBot = inspectSlackToken(merged.botToken);
|
|
40
|
-
const configApp = inspectSlackToken(merged.appToken);
|
|
40
|
+
const configApp = inspectSlackToken(isSocketMode ? merged.appToken : void 0);
|
|
41
41
|
const configSigningSecret = inspectSlackToken(merged.signingSecret);
|
|
42
42
|
const configUser = inspectSlackToken(merged.userToken);
|
|
43
43
|
const envBot = allowEnv ? normalizeSecretInputString(params.envBotToken ?? process.env.SLACK_BOT_TOKEN) : void 0;
|
|
44
|
-
const envApp = allowEnv &&
|
|
44
|
+
const envApp = allowEnv && isSocketMode ? normalizeSecretInputString(params.envAppToken ?? process.env.SLACK_APP_TOKEN) : void 0;
|
|
45
45
|
const envUser = allowEnv ? normalizeSecretInputString(params.envUserToken ?? process.env.SLACK_USER_TOKEN) : void 0;
|
|
46
46
|
const botCredential = resolveInspectedSlackToken(configBot, envBot);
|
|
47
47
|
const appCredential = resolveInspectedSlackToken(configApp, envApp);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectSlackAccount } from "./account-inspect-C3sePHWa.js";
|
|
2
2
|
//#region extensions/slack/account-inspect-api.ts
|
|
3
3
|
function inspectSlackReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectSlackAccount({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
1
|
+
import { Mt as resolveSlackAutoThreadId, bt as getSlackInstallationKind, f as assertSlackDetachedTargetAllowed, jt as SLACK_PRIVATE_ACTION_DELIVERY_RESULT, r as buildSlackChannelIdCandidates, st as parseSlackBlocksInput, v as hasSlackNativeDataBlock } from "./session-status-BynwcZSO.js";
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget, o as resolveSlackChannelId } from "./target-parsing-PbxGDbr9.js";
|
|
3
|
+
import { t as slackContextTargetsMatch } from "./targets-7FexXJ62.js";
|
|
4
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-Bh5TOqII.js";
|
|
5
|
+
import { t as mergeSlackSendResults } from "./send-results-eeOu_HYm.js";
|
|
5
6
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
6
7
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
8
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -11,6 +12,7 @@ import { createActionGate, imageResultFromFile, jsonResult, readPositiveIntegerP
|
|
|
11
12
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
12
13
|
//#region extensions/slack/src/action-runtime.ts
|
|
13
14
|
const messagingActions = /* @__PURE__ */ new Set([
|
|
15
|
+
"openConversation",
|
|
14
16
|
"sendMessage",
|
|
15
17
|
"uploadFile",
|
|
16
18
|
"editMessage",
|
|
@@ -25,9 +27,9 @@ const pinActions = /* @__PURE__ */ new Set([
|
|
|
25
27
|
"listPins"
|
|
26
28
|
]);
|
|
27
29
|
const SLACK_REACTION_RESULT_LIMIT = 100;
|
|
28
|
-
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-
|
|
30
|
+
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-CFkvEv1d.js").then((n) => n.t));
|
|
29
31
|
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts.runtime-DRuEK6mL.js"));
|
|
30
|
-
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-
|
|
32
|
+
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-BWt2CRaI.js").then((n) => n.t));
|
|
31
33
|
function createLazySlackAction(key) {
|
|
32
34
|
return (async (...args) => {
|
|
33
35
|
const action = (await loadSlackActionsRuntime())[key];
|
|
@@ -42,6 +44,7 @@ const slackActionRuntime = {
|
|
|
42
44
|
listSlackEmojis: createLazySlackAction("listSlackEmojis"),
|
|
43
45
|
listSlackPins: createLazySlackAction("listSlackPins"),
|
|
44
46
|
listSlackReactions: createLazySlackAction("listSlackReactions"),
|
|
47
|
+
openSlackConversation: createLazySlackAction("openSlackConversation"),
|
|
45
48
|
parseSlackBlocksInput,
|
|
46
49
|
pinSlackMessage: createLazySlackAction("pinSlackMessage"),
|
|
47
50
|
reactSlackMessage: createLazySlackAction("reactSlackMessage"),
|
|
@@ -278,7 +281,8 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
278
281
|
accountId
|
|
279
282
|
});
|
|
280
283
|
const resolveChannelTarget = () => resolveSlackActionChannelTarget(account, readStringParam(params, "channelId", { required: true }), context);
|
|
281
|
-
const
|
|
284
|
+
const actionConfig = account.actions ?? cfg.channels?.slack?.actions;
|
|
285
|
+
const isActionEnabled = createActionGate(actionConfig);
|
|
282
286
|
const botToken = account.botToken?.trim();
|
|
283
287
|
const buildActionOpts = (operation, teamId) => {
|
|
284
288
|
const token = resolveSlackOperationToken(account, operation);
|
|
@@ -318,10 +322,13 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
318
322
|
removed: emoji
|
|
319
323
|
});
|
|
320
324
|
}
|
|
321
|
-
if (isEmpty)
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
+
if (isEmpty) {
|
|
326
|
+
const removed = await slackActionRuntime.removeOwnSlackReactions(channelId, messageId, writeOpts);
|
|
327
|
+
return jsonResult({
|
|
328
|
+
ok: true,
|
|
329
|
+
removed
|
|
330
|
+
});
|
|
331
|
+
}
|
|
325
332
|
await slackActionRuntime.reactSlackMessage(channelId, messageId, emoji, writeOpts);
|
|
326
333
|
return jsonResult({
|
|
327
334
|
ok: true,
|
|
@@ -330,13 +337,15 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
330
337
|
}
|
|
331
338
|
await assertReadTargetAllowed(target);
|
|
332
339
|
const limit = Math.min(readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." }) ?? SLACK_REACTION_RESULT_LIMIT, SLACK_REACTION_RESULT_LIMIT);
|
|
340
|
+
const reactions = await slackActionRuntime.listSlackReactions(channelId, messageId, readOpts);
|
|
333
341
|
return jsonResult({
|
|
334
342
|
ok: true,
|
|
335
|
-
reactions:
|
|
343
|
+
reactions: reactions?.map((reaction) => reaction.users ? Object.assign({}, reaction, { users: reaction.users.slice(0, limit) }) : reaction)
|
|
336
344
|
});
|
|
337
345
|
}
|
|
338
346
|
if (messagingActions.has(action)) {
|
|
339
347
|
if (!isActionEnabled("messages")) throw new Error("Slack messages are disabled.");
|
|
348
|
+
const sentResults = [];
|
|
340
349
|
const sendSlackMessage = async (target, content, options) => {
|
|
341
350
|
const replyReference = context?.hasRepliedRef && slackContextTargetsMatch(target, context) ? context.hasRepliedRef : void 0;
|
|
342
351
|
const result = await slackActionRuntime.sendSlackMessage(target, content, {
|
|
@@ -346,9 +355,22 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
346
355
|
} } : {}
|
|
347
356
|
});
|
|
348
357
|
if (replyReference) replyReference.value = true;
|
|
358
|
+
sentResults.push(result);
|
|
349
359
|
return result;
|
|
350
360
|
};
|
|
351
361
|
switch (action) {
|
|
362
|
+
case "openConversation": {
|
|
363
|
+
const teamId = readStringParam(params, "teamId") ?? resolveTrustedCurrentSlackTeamId({
|
|
364
|
+
account,
|
|
365
|
+
context
|
|
366
|
+
});
|
|
367
|
+
assertSlackDetachedTargetAllowed(account.accountId, teamId);
|
|
368
|
+
const result = await slackActionRuntime.openSlackConversation(params.userIds, buildActionOpts("write", teamId));
|
|
369
|
+
return jsonResult({
|
|
370
|
+
ok: true,
|
|
371
|
+
...result
|
|
372
|
+
});
|
|
373
|
+
}
|
|
352
374
|
case "sendMessage": {
|
|
353
375
|
const destination = resolveSlackActionTarget(account, readStringParam(params, "to", { required: true }), context).routingTarget;
|
|
354
376
|
const content = readStringParam(params, "content", { allowEmpty: true });
|
|
@@ -396,35 +418,27 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
396
418
|
blocks
|
|
397
419
|
});
|
|
398
420
|
};
|
|
421
|
+
if (mediaUrl && (preparedMessages?.length || blocks)) await sendSlackMessage(destination, "", {
|
|
422
|
+
...preparedMessages?.length ? baseSendOpts : sendOpts,
|
|
423
|
+
mediaUrl
|
|
424
|
+
});
|
|
425
|
+
if (preparedMessages?.length) for (const [index, message] of preparedMessages.entries()) await sendSlackMessage(destination, message.text, {
|
|
426
|
+
...baseSendOpts,
|
|
427
|
+
...index === 0 && replyBroadcast ? { replyBroadcast: true } : {},
|
|
428
|
+
...message.blocks ? { blocks: message.blocks } : {},
|
|
429
|
+
...message.authoredTextPlacement ? { authoredTextPlacement: message.authoredTextPlacement } : {},
|
|
430
|
+
...Object.hasOwn(message, "nativeDataFallbackBaseText") ? { nativeDataFallbackBaseText: message.nativeDataFallbackBaseText } : {},
|
|
431
|
+
...message.textIsSlackPlainText ? { textIsSlackPlainText: true } : {}
|
|
432
|
+
});
|
|
433
|
+
else if (blocks) await sendContentAndBlocks();
|
|
434
|
+
else await sendSlackMessage(destination, content ?? "", {
|
|
435
|
+
...sendOpts,
|
|
436
|
+
mediaUrl: mediaUrl ?? void 0,
|
|
437
|
+
blocks
|
|
438
|
+
});
|
|
399
439
|
return jsonResult({
|
|
400
440
|
ok: true,
|
|
401
|
-
result:
|
|
402
|
-
let lastResult;
|
|
403
|
-
if (mediaUrl) lastResult = await sendSlackMessage(destination, "", {
|
|
404
|
-
...baseSendOpts,
|
|
405
|
-
mediaUrl
|
|
406
|
-
});
|
|
407
|
-
for (const [index, message] of preparedMessages.entries()) lastResult = await sendSlackMessage(destination, message.text, {
|
|
408
|
-
...baseSendOpts,
|
|
409
|
-
...index === 0 && replyBroadcast ? { replyBroadcast: true } : {},
|
|
410
|
-
...message.blocks ? { blocks: message.blocks } : {},
|
|
411
|
-
...message.authoredTextPlacement ? { authoredTextPlacement: message.authoredTextPlacement } : {},
|
|
412
|
-
...Object.hasOwn(message, "nativeDataFallbackBaseText") ? { nativeDataFallbackBaseText: message.nativeDataFallbackBaseText } : {},
|
|
413
|
-
...message.textIsSlackPlainText ? { textIsSlackPlainText: true } : {}
|
|
414
|
-
});
|
|
415
|
-
if (!lastResult) throw new Error("Slack prepared message plan produced no delivery.");
|
|
416
|
-
return lastResult;
|
|
417
|
-
})() : blocks ? await (async () => {
|
|
418
|
-
if (mediaUrl) await sendSlackMessage(destination, "", {
|
|
419
|
-
...sendOpts,
|
|
420
|
-
mediaUrl
|
|
421
|
-
});
|
|
422
|
-
return await sendContentAndBlocks();
|
|
423
|
-
})() : await sendSlackMessage(destination, content ?? "", {
|
|
424
|
-
...sendOpts,
|
|
425
|
-
mediaUrl: mediaUrl ?? void 0,
|
|
426
|
-
blocks
|
|
427
|
-
})
|
|
441
|
+
result: mergeSlackSendResults(sentResults)
|
|
428
442
|
});
|
|
429
443
|
}
|
|
430
444
|
case "uploadFile": {
|
|
@@ -439,19 +453,20 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
439
453
|
const forceDocument = readBooleanParam(params, "forceDocument") === true;
|
|
440
454
|
if (readBooleanParam(params, "replyBroadcast")) throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");
|
|
441
455
|
const threadTs = resolveThreadTsFromContext(readStringParam(params, "threadTs"), destination, context, { suppressImplicitThread: params.topLevel === true || params.threadTs === null });
|
|
456
|
+
const result = await sendSlackMessage(destination, initialComment ?? "", {
|
|
457
|
+
...buildActionOpts("write"),
|
|
458
|
+
mediaUrl: filePath,
|
|
459
|
+
mediaAccess: context?.mediaAccess,
|
|
460
|
+
mediaLocalRoots: context?.mediaLocalRoots,
|
|
461
|
+
mediaReadFile: context?.mediaReadFile,
|
|
462
|
+
threadTs: threadTs ?? void 0,
|
|
463
|
+
...forceDocument ? { forceDocument: true } : {},
|
|
464
|
+
...filename ? { uploadFileName: filename } : {},
|
|
465
|
+
...title ? { uploadTitle: title } : {}
|
|
466
|
+
});
|
|
442
467
|
return jsonResult({
|
|
443
468
|
ok: true,
|
|
444
|
-
result
|
|
445
|
-
...buildActionOpts("write"),
|
|
446
|
-
mediaUrl: filePath,
|
|
447
|
-
mediaAccess: context?.mediaAccess,
|
|
448
|
-
mediaLocalRoots: context?.mediaLocalRoots,
|
|
449
|
-
mediaReadFile: context?.mediaReadFile,
|
|
450
|
-
threadTs: threadTs ?? void 0,
|
|
451
|
-
...forceDocument ? { forceDocument: true } : {},
|
|
452
|
-
...filename ? { uploadFileName: filename } : {},
|
|
453
|
-
...title ? { uploadTitle: title } : {}
|
|
454
|
-
})
|
|
469
|
+
result
|
|
455
470
|
});
|
|
456
471
|
}
|
|
457
472
|
case "editMessage": {
|
|
@@ -513,7 +528,7 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
513
528
|
const { channelId } = target;
|
|
514
529
|
await assertReadTargetAllowed(target);
|
|
515
530
|
const threadId = readStringParam(params, "threadId") ?? readStringParam(params, "replyTo");
|
|
516
|
-
const maxBytes = account.config?.mediaMaxMb ? account.config.mediaMaxMb * 1024 * 1024 :
|
|
531
|
+
const maxBytes = account.config?.mediaMaxMb ? account.config.mediaMaxMb * 1024 * 1024 : 20971520;
|
|
517
532
|
const readToken = resolveSlackOperationToken(account, "read");
|
|
518
533
|
const readOpts = buildActionOpts("read", target.teamId);
|
|
519
534
|
const downloaded = await slackActionRuntime.downloadSlackFile(fileId, {
|
|
@@ -548,10 +563,10 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
548
563
|
path: downloaded.path,
|
|
549
564
|
...downloaded.contentType ? { contentType: downloaded.contentType } : {},
|
|
550
565
|
media: { outbound: false }
|
|
551
|
-
}
|
|
566
|
+
},
|
|
567
|
+
imageSanitization: { maxDimensionPx: cfg.agents?.defaults?.imageMaxDimensionPx }
|
|
552
568
|
});
|
|
553
569
|
}
|
|
554
|
-
default: break;
|
|
555
570
|
}
|
|
556
571
|
}
|
|
557
572
|
if (pinActions.has(action)) {
|
|
@@ -573,12 +588,13 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
573
588
|
return jsonResult({ ok: true });
|
|
574
589
|
}
|
|
575
590
|
await assertReadTargetAllowed(target);
|
|
591
|
+
const normalizedPins = (await slackActionRuntime.listSlackPins(channelId, readOpts)).map((pin) => {
|
|
592
|
+
const message = pin.message ? withNormalizedTimestamp(pin.message, pin.message.ts) : pin.message;
|
|
593
|
+
return message ? Object.assign({}, pin, { message }) : pin;
|
|
594
|
+
});
|
|
576
595
|
return jsonResult({
|
|
577
596
|
ok: true,
|
|
578
|
-
pins:
|
|
579
|
-
const message = pin.message ? withNormalizedTimestamp(pin.message, pin.message.ts) : pin.message;
|
|
580
|
-
return message ? Object.assign({}, pin, { message }) : pin;
|
|
581
|
-
})
|
|
597
|
+
pins: normalizedPins
|
|
582
598
|
});
|
|
583
599
|
}
|
|
584
600
|
if (action === "memberInfo") {
|
|
@@ -594,9 +610,10 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
594
610
|
context
|
|
595
611
|
});
|
|
596
612
|
assertSlackDetachedTargetAllowed(account.accountId, teamId);
|
|
613
|
+
const info = await slackActionRuntime.getSlackMemberInfo(userId, buildActionOpts("read", teamId));
|
|
597
614
|
return jsonResult({
|
|
598
615
|
ok: true,
|
|
599
|
-
info
|
|
616
|
+
info
|
|
600
617
|
});
|
|
601
618
|
}
|
|
602
619
|
if (action === "emojiList") {
|
|
@@ -608,16 +625,17 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
608
625
|
});
|
|
609
626
|
assertSlackDetachedTargetAllowed(account.accountId, teamId);
|
|
610
627
|
const result = await slackActionRuntime.listSlackEmojis(buildActionOpts("read", teamId));
|
|
628
|
+
const emojis = Object.entries(result.emoji ?? {}).toSorted(([left], [right]) => left.localeCompare(right)).slice(0, limit).map(([name, value]) => value.startsWith("alias:") ? {
|
|
629
|
+
name,
|
|
630
|
+
identifier: name,
|
|
631
|
+
aliasOf: value.slice(6)
|
|
632
|
+
} : {
|
|
633
|
+
name,
|
|
634
|
+
identifier: name
|
|
635
|
+
});
|
|
611
636
|
return jsonResult({
|
|
612
637
|
ok: true,
|
|
613
|
-
emojis
|
|
614
|
-
name,
|
|
615
|
-
identifier: name,
|
|
616
|
-
aliasOf: value.slice(6)
|
|
617
|
-
} : {
|
|
618
|
-
name,
|
|
619
|
-
identifier: name
|
|
620
|
-
})
|
|
638
|
+
emojis
|
|
621
639
|
});
|
|
622
640
|
}
|
|
623
641
|
throw new Error(`Unknown action: ${action}`);
|