perf: narrow slack test imports · openclaw/openclaw@a59d1bd
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -119,6 +119,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
|
119 | 119 | | `plugin-sdk/approval-handler-runtime` | Broader approval handler runtime helpers; prefer the narrower adapter/gateway seams when they are enough | |
120 | 120 | | `plugin-sdk/approval-native-runtime` | Native approval target + account-binding helpers | |
121 | 121 | | `plugin-sdk/approval-reply-runtime` | Exec/plugin approval reply payload helpers | |
| 122 | +| `plugin-sdk/channel-contract-testing` | Narrow channel contract test helpers without the broad testing barrel | |
122 | 123 | | `plugin-sdk/command-auth-native` | Native command auth + native session-target helpers | |
123 | 124 | | `plugin-sdk/command-detection` | Shared command detection helpers | |
124 | 125 | | `plugin-sdk/command-primitives-runtime` | Lightweight command text predicates for hot channel paths | |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import fs from "node:fs"; |
2 | 2 | import type { App } from "@slack/bolt"; |
| 3 | +import { expectChannelInboundContextContract as expectInboundContextContract } from "openclaw/plugin-sdk/channel-contract-testing"; |
3 | 4 | import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; |
4 | 5 | import { |
5 | 6 | registerSessionBindingAdapter, |
@@ -9,7 +10,6 @@ import {
|
9 | 10 | } from "openclaw/plugin-sdk/conversation-runtime"; |
10 | 11 | import { resolveAgentRoute } from "openclaw/plugin-sdk/routing"; |
11 | 12 | import { resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing"; |
12 | | -import { expectChannelInboundContextContract as expectInboundContextContract } from "openclaw/plugin-sdk/testing"; |
13 | 13 | import { afterAll, beforeAll, describe, expect, it, vi } from "vitest"; |
14 | 14 | import type { ResolvedSlackAccount } from "../../accounts.js"; |
15 | 15 | import type { SlackMessageEvent } from "../../types.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ import { resolveControlCommandGate } from "openclaw/plugin-sdk/command-gating";
|
17 | 17 | import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface"; |
18 | 18 | import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime"; |
19 | 19 | import { enqueueSystemEvent } from "openclaw/plugin-sdk/infra-runtime"; |
| 20 | +import { finalizeInboundContext } from "openclaw/plugin-sdk/reply-dispatch-runtime"; |
20 | 21 | import { |
21 | 22 | buildPendingHistoryContextFromMap, |
22 | 23 | recordPendingHistoryEntryIfEnabled, |
@@ -50,7 +51,6 @@ import { normalizeSlackChannelType, type SlackMonitorContext } from "../context.
|
50 | 51 | import { recordInboundSession, resolveConversationLabel } from "../conversation.runtime.js"; |
51 | 52 | import { authorizeSlackDirectMessage } from "../dm-auth.js"; |
52 | 53 | import { resolveSlackThreadStarter } from "../media.js"; |
53 | | -import { finalizeInboundContext } from "../reply.runtime.js"; |
54 | 54 | import { resolveSlackRoomContextHints } from "../room-context.js"; |
55 | 55 | import { sendMessageSlack } from "../send.runtime.js"; |
56 | 56 | import { resolveSlackMessageContent } from "./prepare-content.js"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { MarkdownTableMode, OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; |
| 2 | +import { |
| 3 | +chunkMarkdownTextWithMode, |
| 4 | +isSilentReplyText, |
| 5 | +SILENT_REPLY_TOKEN, |
| 6 | +type ChunkMode, |
| 7 | +} from "openclaw/plugin-sdk/reply-chunking"; |
2 | 8 | import { |
3 | 9 | deliverTextOrMediaReply, |
4 | 10 | resolveSendableOutboundReplyParts, |
| 11 | +type ReplyPayload, |
5 | 12 | } from "openclaw/plugin-sdk/reply-payload"; |
6 | | -import type { ChunkMode } from "openclaw/plugin-sdk/reply-runtime"; |
7 | | -import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; |
| 13 | +import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference"; |
8 | 14 | import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; |
9 | 15 | import { markdownToSlackMrkdwnChunks } from "../format.js"; |
10 | 16 | import { SLACK_TEXT_LIMIT } from "../limits.js"; |
11 | 17 | import { resolveSlackReplyBlocks } from "../reply-blocks.js"; |
12 | | -import { |
13 | | -chunkMarkdownTextWithMode, |
14 | | -createReplyReferencePlanner, |
15 | | -isSilentReplyText, |
16 | | -SILENT_REPLY_TOKEN, |
17 | | -} from "./reply.runtime.js"; |
18 | 18 | import { sendMessageSlack, type SlackSendIdentity } from "./send.runtime.js"; |
19 | 19 | |
20 | 20 | export function readSlackReplyBlocks(payload: ReplyPayload) { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +import { installChannelOutboundPayloadContractSuite } from "openclaw/plugin-sdk/channel-contract-testing"; |
1 | 2 | import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; |
2 | | -import { installChannelOutboundPayloadContractSuite } from "openclaw/plugin-sdk/testing"; |
3 | 3 | import { describe, expect, it } from "vitest"; |
4 | 4 | import { createSlackOutboundPayloadHarness } from "../test-api.js"; |
5 | 5 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -509,6 +509,10 @@
|
509 | 509 | "types": "./dist/plugin-sdk/boolean-param.d.ts", |
510 | 510 | "default": "./dist/plugin-sdk/boolean-param.js" |
511 | 511 | }, |
| 512 | +"./plugin-sdk/channel-contract-testing": { |
| 513 | +"types": "./dist/plugin-sdk/channel-contract-testing.d.ts", |
| 514 | +"default": "./dist/plugin-sdk/channel-contract-testing.js" |
| 515 | + }, |
512 | 516 | "./plugin-sdk/dangerous-name-runtime": { |
513 | 517 | "types": "./dist/plugin-sdk/dangerous-name-runtime.d.ts", |
514 | 518 | "default": "./dist/plugin-sdk/dangerous-name-runtime.js" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -113,6 +113,7 @@
|
113 | 113 | "browser-setup-tools", |
114 | 114 | "browser-support", |
115 | 115 | "boolean-param", |
| 116 | +"channel-contract-testing", |
116 | 117 | "dangerous-name-runtime", |
117 | 118 | "command-auth", |
118 | 119 | "command-auth-native", |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +export { |
| 2 | +expectChannelInboundContextContract, |
| 3 | +primeChannelOutboundSendMock, |
| 4 | +} from "../channels/plugins/contracts/test-helpers.js"; |
| 5 | +export { |
| 6 | +installChannelOutboundPayloadContractSuite, |
| 7 | +type OutboundPayloadHarnessParams, |
| 8 | +} from "../channels/plugins/contracts/outbound-payload-testkit.js"; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,5 +6,5 @@ export {
|
6 | 6 | resolveTextChunkLimit, |
7 | 7 | } from "../auto-reply/chunk.js"; |
8 | 8 | export type { ChunkMode } from "../auto-reply/chunk.js"; |
9 | | -export { isSilentReplyText } from "../auto-reply/tokens.js"; |
| 9 | +export { isSilentReplyText, SILENT_REPLY_TOKEN } from "../auto-reply/tokens.js"; |
10 | 10 | export type { ReplyPayload } from "./reply-payload.js"; |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。