mirror of https://github.com/openclaw/openclaw.git
perf(slack): narrow send chunking imports
This commit is contained in:
parent
4ea1ca4849
commit
675b80c4a4
|
|
@ -2,13 +2,13 @@ import { type Block, type KnownBlock, type WebClient } from "@slack/web-api";
|
|||
import { loadConfig, type OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
||||
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
||||
import {
|
||||
chunkMarkdownTextWithMode,
|
||||
isSilentReplyText,
|
||||
resolveChunkMode,
|
||||
resolveTextChunkLimit,
|
||||
} from "openclaw/plugin-sdk/reply-runtime";
|
||||
import { isSilentReplyText } from "openclaw/plugin-sdk/reply-runtime";
|
||||
} from "openclaw/plugin-sdk/reply-chunking";
|
||||
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
||||
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
||||
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
||||
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ vi.mock("openclaw/plugin-sdk/web-media", () => ({
|
|||
|
||||
let sendMessageSlack: typeof import("./send.js").sendMessageSlack;
|
||||
let clearSlackDmChannelCache: typeof import("./send.js").clearSlackDmChannelCache;
|
||||
({ sendMessageSlack, clearSlackDmChannelCache } = await import("./send.js"));
|
||||
|
||||
type UploadTestClient = WebClient & {
|
||||
conversations: { open: ReturnType<typeof vi.fn> };
|
||||
|
|
@ -65,11 +66,6 @@ function createUploadTestClient(): UploadTestClient {
|
|||
describe("sendMessageSlack file upload with user IDs", () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
|
||||
beforeAll(async () => {
|
||||
vi.resetModules();
|
||||
({ sendMessageSlack, clearSlackDmChannelCache } = await import("./send.js"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
globalThis.fetch = vi.fn(
|
||||
async () => new Response("ok", { status: 200 }),
|
||||
|
|
|
|||
|
|
@ -101,6 +101,10 @@
|
|||
"types": "./dist/plugin-sdk/reply-runtime.d.ts",
|
||||
"default": "./dist/plugin-sdk/reply-runtime.js"
|
||||
},
|
||||
"./plugin-sdk/reply-chunking": {
|
||||
"types": "./dist/plugin-sdk/reply-chunking.d.ts",
|
||||
"default": "./dist/plugin-sdk/reply-chunking.js"
|
||||
},
|
||||
"./plugin-sdk/reply-payload": {
|
||||
"types": "./dist/plugin-sdk/reply-payload.d.ts",
|
||||
"default": "./dist/plugin-sdk/reply-payload.js"
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
"approval-runtime",
|
||||
"config-runtime",
|
||||
"reply-runtime",
|
||||
"reply-chunking",
|
||||
"reply-payload",
|
||||
"channel-reply-pipeline",
|
||||
"channel-runtime",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
export {
|
||||
chunkMarkdownTextWithMode,
|
||||
resolveChunkMode,
|
||||
resolveTextChunkLimit,
|
||||
} from "../auto-reply/chunk.js";
|
||||
export { isSilentReplyText } from "../auto-reply/tokens.js";
|
||||
Loading…
Reference in New Issue