perf: reduce telegram test import drag · openclaw/openclaw@754acc4
steipete
·
2026-04-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -1d2767b688414ac41305e88c830858c00947e2d7c713f1a25d86f38cd577620e plugin-sdk-api-baseline.json |
2 | | -e5167477ab6aa2e67bd4361048cf5f6f8fd1cb7ee570544c634d14417f890674 plugin-sdk-api-baseline.jsonl |
| 1 | +793ed905cb0ba93b9a2f8c2c85c3cfb4d194dd9263353e74952bf9e382b03dc2 plugin-sdk-api-baseline.json |
| 2 | +032e7fd6f48344c9b3b98fd3e877e6d30cab92ed9a39dd309796cf1f0220820f plugin-sdk-api-baseline.jsonl |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -121,6 +121,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
|
121 | 121 | | `plugin-sdk/approval-reply-runtime` | Exec/plugin approval reply payload helpers | |
122 | 122 | | `plugin-sdk/command-auth-native` | Native command auth + native session-target helpers | |
123 | 123 | | `plugin-sdk/command-detection` | Shared command detection helpers | |
| 124 | +| `plugin-sdk/command-primitives-runtime` | Lightweight command text predicates for hot channel paths | |
124 | 125 | | `plugin-sdk/command-surface` | Command-body normalization and command-surface helpers | |
125 | 126 | | `plugin-sdk/allow-from` | `formatAllowFromLowercase` | |
126 | 127 | | `plugin-sdk/channel-secret-runtime` | Narrow secret-contract collection helpers for channel/plugin secret surfaces | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,6 +10,7 @@ import {
|
10 | 10 | resolveChannelStreamingBlockEnabled, |
11 | 11 | resolveChannelStreamingPreviewToolProgress, |
12 | 12 | } from "openclaw/plugin-sdk/channel-streaming"; |
| 13 | +import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime"; |
13 | 14 | import type { |
14 | 15 | OpenClawConfig, |
15 | 16 | ReplyToMode, |
@@ -22,15 +23,15 @@ import {
|
22 | 23 | } from "openclaw/plugin-sdk/outbound-runtime"; |
23 | 24 | import { clearHistoryEntriesIfEnabled } from "openclaw/plugin-sdk/reply-history"; |
24 | 25 | import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload"; |
25 | | -import { isAbortRequestText, type ReplyPayload } from "openclaw/plugin-sdk/reply-runtime"; |
| 26 | +import type { ReplyPayload } from "openclaw/plugin-sdk/reply-payload"; |
26 | 27 | import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env"; |
27 | 28 | import { |
28 | 29 | createSubsystemLogger, |
29 | 30 | danger, |
30 | 31 | logVerbose, |
31 | 32 | sleepWithAbort, |
32 | 33 | } from "openclaw/plugin-sdk/runtime-env"; |
33 | | -import { defaultTelegramBotDeps, type TelegramBotDeps } from "./bot-deps.js"; |
| 34 | +import type { TelegramBotDeps } from "./bot-deps.js"; |
34 | 35 | import type { TelegramMessageContext } from "./bot-message-context.js"; |
35 | 36 | import { |
36 | 37 | findModelInCatalog, |
@@ -215,9 +216,11 @@ export const dispatchTelegramMessage = async ({
|
215 | 216 | streamMode, |
216 | 217 | textLimit, |
217 | 218 | telegramCfg, |
218 | | - telegramDeps = defaultTelegramBotDeps, |
| 219 | +telegramDeps: injectedTelegramDeps, |
219 | 220 | opts, |
220 | 221 | }: DispatchTelegramMessageParams) => { |
| 222 | +const telegramDeps = |
| 223 | +injectedTelegramDeps ?? (await import("./bot-deps.js")).defaultTelegramBotDeps; |
221 | 224 | const { |
222 | 225 | ctxPayload, |
223 | 226 | msg, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -273,4 +273,4 @@ describe("telegram target normalization", () => {
|
273 | 273 | }); |
274 | 274 | }); |
275 | 275 | |
276 | | -installMaybePersistResolvedTelegramTargetTests(); |
| 276 | +installMaybePersistResolvedTelegramTargetTests({ includeGatewayScopeCases: true }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -525,6 +525,10 @@
|
525 | 525 | "types": "./dist/plugin-sdk/command-gating.d.ts", |
526 | 526 | "default": "./dist/plugin-sdk/command-gating.js" |
527 | 527 | }, |
| 528 | +"./plugin-sdk/command-primitives-runtime": { |
| 529 | +"types": "./dist/plugin-sdk/command-primitives-runtime.d.ts", |
| 530 | +"default": "./dist/plugin-sdk/command-primitives-runtime.js" |
| 531 | + }, |
528 | 532 | "./plugin-sdk/command-status": { |
529 | 533 | "types": "./dist/plugin-sdk/command-status.d.ts", |
530 | 534 | "default": "./dist/plugin-sdk/command-status.js" |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -117,6 +117,7 @@
|
117 | 117 | "command-auth", |
118 | 118 | "command-auth-native", |
119 | 119 | "command-gating", |
| 120 | +"command-primitives-runtime", |
120 | 121 | "command-status", |
121 | 122 | "command-status-runtime", |
122 | 123 | "command-detection", |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +export { isAbortRequestText } from "../auto-reply/reply/abort-primitives.js"; |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。