perf: reduce telegram test import drag

This commit is contained in:
Peter Steinberger
2026-04-24 02:28:26 +01:00
parent d268c850e6
commit 754acc4478
8 changed files with 16 additions and 9 deletions

View File

@@ -1,2 +1,2 @@
1d2767b688414ac41305e88c830858c00947e2d7c713f1a25d86f38cd577620e plugin-sdk-api-baseline.json
e5167477ab6aa2e67bd4361048cf5f6f8fd1cb7ee570544c634d14417f890674 plugin-sdk-api-baseline.jsonl
793ed905cb0ba93b9a2f8c2c85c3cfb4d194dd9263353e74952bf9e382b03dc2 plugin-sdk-api-baseline.json
032e7fd6f48344c9b3b98fd3e877e6d30cab92ed9a39dd309796cf1f0220820f plugin-sdk-api-baseline.jsonl

View File

@@ -121,6 +121,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
| `plugin-sdk/approval-reply-runtime` | Exec/plugin approval reply payload helpers |
| `plugin-sdk/command-auth-native` | Native command auth + native session-target helpers |
| `plugin-sdk/command-detection` | Shared command detection helpers |
| `plugin-sdk/command-primitives-runtime` | Lightweight command text predicates for hot channel paths |
| `plugin-sdk/command-surface` | Command-body normalization and command-surface helpers |
| `plugin-sdk/allow-from` | `formatAllowFromLowercase` |
| `plugin-sdk/channel-secret-runtime` | Narrow secret-contract collection helpers for channel/plugin secret surfaces |

View File

@@ -10,6 +10,7 @@ import {
resolveChannelStreamingBlockEnabled,
resolveChannelStreamingPreviewToolProgress,
} from "openclaw/plugin-sdk/channel-streaming";
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
import type {
OpenClawConfig,
ReplyToMode,
@@ -22,7 +23,7 @@ import {
} from "openclaw/plugin-sdk/outbound-runtime";
import { clearHistoryEntriesIfEnabled } from "openclaw/plugin-sdk/reply-history";
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
import { isAbortRequestText, type ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-payload";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import {
createSubsystemLogger,
@@ -30,7 +31,7 @@ import {
logVerbose,
sleepWithAbort,
} from "openclaw/plugin-sdk/runtime-env";
import { defaultTelegramBotDeps, type TelegramBotDeps } from "./bot-deps.js";
import type { TelegramBotDeps } from "./bot-deps.js";
import type { TelegramMessageContext } from "./bot-message-context.js";
import {
findModelInCatalog,
@@ -215,9 +216,11 @@ export const dispatchTelegramMessage = async ({
streamMode,
textLimit,
telegramCfg,
telegramDeps = defaultTelegramBotDeps,
telegramDeps: injectedTelegramDeps,
opts,
}: DispatchTelegramMessageParams) => {
const telegramDeps =
injectedTelegramDeps ?? (await import("./bot-deps.js")).defaultTelegramBotDeps;
const {
ctxPayload,
msg,

View File

@@ -1,3 +0,0 @@
import { installMaybePersistResolvedTelegramTargetTests } from "./target-writeback.test-shared.js";
installMaybePersistResolvedTelegramTargetTests({ includeGatewayScopeCases: true });

View File

@@ -273,4 +273,4 @@ describe("telegram target normalization", () => {
});
});
installMaybePersistResolvedTelegramTargetTests();
installMaybePersistResolvedTelegramTargetTests({ includeGatewayScopeCases: true });

View File

@@ -525,6 +525,10 @@
"types": "./dist/plugin-sdk/command-gating.d.ts",
"default": "./dist/plugin-sdk/command-gating.js"
},
"./plugin-sdk/command-primitives-runtime": {
"types": "./dist/plugin-sdk/command-primitives-runtime.d.ts",
"default": "./dist/plugin-sdk/command-primitives-runtime.js"
},
"./plugin-sdk/command-status": {
"types": "./dist/plugin-sdk/command-status.d.ts",
"default": "./dist/plugin-sdk/command-status.js"

View File

@@ -117,6 +117,7 @@
"command-auth",
"command-auth-native",
"command-gating",
"command-primitives-runtime",
"command-status",
"command-status-runtime",
"command-detection",

View File

@@ -0,0 +1 @@
export { isAbortRequestText } from "../auto-reply/reply/abort-primitives.js";