Skip to content

Commit 84fc00a

Browse files
committed
perf: narrow whatsapp test imports
1 parent a7c1376 commit 84fc00a

22 files changed

Lines changed: 76 additions & 25 deletions

‎docs/plugins/sdk-subpaths.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
6767
| `plugin-sdk/interactive-runtime` | Semantic message presentation, delivery, and legacy interactive reply helpers. See [Message Presentation](/plugins/message-presentation) |
6868
| `plugin-sdk/channel-inbound` | Compatibility barrel for inbound debounce, mention matching, mention-policy helpers, and envelope helpers |
6969
| `plugin-sdk/channel-inbound-debounce` | Narrow inbound debounce helpers |
70-
| `plugin-sdk/channel-mention-gating` | Narrow mention-policy helpers without the broader inbound runtime surface |
70+
| `plugin-sdk/channel-mention-gating` | Narrow mention-policy and mention text helpers without the broader inbound runtime surface |
71+
| `plugin-sdk/channel-envelope` | Narrow inbound envelope formatting helpers |
7172
| `plugin-sdk/channel-location` | Channel location context and formatting helpers |
7273
| `plugin-sdk/channel-logging` | Channel logging helpers for inbound drops and typing/ack failures |
7374
| `plugin-sdk/channel-send-result` | Reply result types |
@@ -105,6 +106,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
105106
| `plugin-sdk/provider-transport-runtime` | Native provider transport helpers such as guarded fetch, transport message transforms, and writable transport event streams |
106107
| `plugin-sdk/provider-onboard` | Onboarding config patch helpers |
107108
| `plugin-sdk/global-singleton` | Process-local singleton/map/cache helpers |
109+
| `plugin-sdk/group-activation` | Narrow group activation mode and command parsing helpers |
108110
</Accordion>
109111

110112
<Accordion title="Auth and security subpaths">
@@ -120,6 +122,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
120122
| `plugin-sdk/approval-handler-runtime` | Broader approval handler runtime helpers; prefer the narrower adapter/gateway seams when they are enough |
121123
| `plugin-sdk/approval-native-runtime` | Native approval target + account-binding helpers |
122124
| `plugin-sdk/approval-reply-runtime` | Exec/plugin approval reply payload helpers |
125+
| `plugin-sdk/reply-dedupe` | Narrow inbound reply dedupe reset helpers |
123126
| `plugin-sdk/channel-contract-testing` | Narrow channel contract test helpers without the broad testing barrel |
124127
| `plugin-sdk/command-auth-native` | Native command auth + native session-target helpers |
125128
| `plugin-sdk/command-detection` | Shared command detection helpers |
@@ -172,7 +175,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
172175
| `plugin-sdk/tool-send` | Extract canonical send target fields from tool args |
173176
| `plugin-sdk/temp-path` | Shared temp-download path helpers |
174177
| `plugin-sdk/logging-core` | Subsystem logger and redaction helpers |
175-
| `plugin-sdk/markdown-table-runtime` | Markdown table mode helpers |
178+
| `plugin-sdk/markdown-table-runtime` | Markdown table mode and conversion helpers |
176179
| `plugin-sdk/json-store` | Small JSON state read/write helpers |
177180
| `plugin-sdk/file-lock` | Re-entrant file-lock helpers |
178181
| `plugin-sdk/persistent-dedupe` | Disk-backed dedupe cache helpers |
@@ -210,6 +213,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
210213
| Subpath | Key exports |
211214
| --- | --- |
212215
| `plugin-sdk/media-runtime` | Shared media fetch/transform/store helpers plus media payload builders |
216+
| `plugin-sdk/media-store` | Narrow media store helpers such as `saveMediaBuffer` |
213217
| `plugin-sdk/media-generation-runtime` | Shared media-generation failover helpers, candidate selection, and missing-model messaging |
214218
| `plugin-sdk/media-understanding` | Media understanding provider types plus provider-facing image/audio helper exports |
215219
| `plugin-sdk/text-runtime` | Shared text/markdown/logging helpers such as assistant-visible-text stripping, markdown render/chunking/table helpers, redaction helpers, directive-tag helpers, and safe-text utilities |

‎extensions/whatsapp/src/auto-reply.test-harness.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import "./test-helpers.js";
22
import fs from "node:fs/promises";
33
import os from "node:os";
44
import path from "node:path";
5-
import { resetInboundDedupe } from "openclaw/plugin-sdk/reply-runtime";
5+
import { resetInboundDedupe } from "openclaw/plugin-sdk/reply-dedupe";
66
import { resetLogger, setLoggerOverride } from "openclaw/plugin-sdk/runtime-env";
77
import { mockPinnedHostnameResolution } from "openclaw/plugin-sdk/testing";
88
import { afterAll, afterEach, beforeAll, beforeEach, vi, type Mock } from "vitest";

‎extensions/whatsapp/src/auto-reply/mentions.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { buildMentionRegexes, normalizeMentionText } from "openclaw/plugin-sdk/channel-inbound";
1+
import {
2+
buildMentionRegexes,
3+
normalizeMentionText,
4+
} from "openclaw/plugin-sdk/channel-mention-gating";
25
import type { loadConfig } from "openclaw/plugin-sdk/config-runtime";
36
import {
47
getComparableIdentityValues,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { normalizeGroupActivation } from "openclaw/plugin-sdk/reply-runtime";
1+
export { normalizeGroupActivation } from "openclaw/plugin-sdk/group-activation";
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export {
22
implicitMentionKindWhen,
33
resolveInboundMentionDecision,
4-
} from "openclaw/plugin-sdk/channel-inbound";
4+
} from "openclaw/plugin-sdk/channel-mention-gating";
55
export { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
66
export { recordPendingHistoryEntryIfEnabled } from "openclaw/plugin-sdk/reply-history";
7-
export { parseActivationCommand } from "openclaw/plugin-sdk/reply-runtime";
7+
export { parseActivationCommand } from "openclaw/plugin-sdk/group-activation";
88
export { normalizeE164 } from "../../text-runtime.js";

‎extensions/whatsapp/src/auto-reply/monitor/message-line.runtime.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ export { resolveMessagePrefix } from "openclaw/plugin-sdk/agent-runtime";
22
export {
33
formatInboundEnvelope,
44
type EnvelopeFormatOptions,
5-
} from "openclaw/plugin-sdk/channel-inbound";
5+
} from "openclaw/plugin-sdk/channel-envelope";

‎extensions/whatsapp/src/auto-reply/monitor/runtime-api.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
export { resolveIdentityNamePrefix } from "openclaw/plugin-sdk/agent-runtime";
22
export {
33
formatInboundEnvelope,
4-
resolveInboundSessionEnvelopeContext,
5-
toLocationContext,
6-
} from "openclaw/plugin-sdk/channel-inbound";
4+
resolveEnvelopeFormatOptions,
5+
} from "openclaw/plugin-sdk/channel-envelope";
6+
export { resolveInboundSessionEnvelopeContext } from "openclaw/plugin-sdk/channel-inbound";
7+
export { toLocationContext } from "openclaw/plugin-sdk/channel-location";
78
export { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pipeline";
89
export { shouldComputeCommandAuthorized } from "openclaw/plugin-sdk/command-detection";
910
export {

‎extensions/whatsapp/src/inbound.media.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ vi.mock("../../../src/pairing/pairing-store.js", () => {
6060
};
6161
});
6262

63-
vi.mock("openclaw/plugin-sdk/media-runtime", async () => {
64-
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/media-runtime")>(
65-
"openclaw/plugin-sdk/media-runtime",
63+
vi.mock("openclaw/plugin-sdk/media-store", async () => {
64+
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/media-store")>(
65+
"openclaw/plugin-sdk/media-store",
6666
);
6767
return {
6868
...actual,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { saveMediaBuffer } from "openclaw/plugin-sdk/media-runtime";
1+
export { saveMediaBuffer } from "openclaw/plugin-sdk/media-store";

‎extensions/whatsapp/src/inbound/types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { AnyMessageContent, MiscMessageGenerationOptions } from "@whiskeysockets/baileys";
22
import type { NormalizedLocation } from "openclaw/plugin-sdk/channel-inbound";
3-
import type { PollInput } from "openclaw/plugin-sdk/media-runtime";
3+
import type { PollInput } from "openclaw/plugin-sdk/poll-runtime";
44
import type { WhatsAppIdentity, WhatsAppReplyContext, WhatsAppSelfIdentity } from "../identity.js";
55

66
export type WebListenerCloseReason = {

0 commit comments

Comments
 (0)