perf: narrow inbound debounce sdk imports

This commit is contained in:
Peter Steinberger
2026-04-24 05:06:58 +01:00
parent 51186d2725
commit c7ee5d8ecf
11 changed files with 23 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ For the plugin authoring guide, see [Plugin SDK overview](/plugins/sdk-overview)
| `plugin-sdk/direct-dm` | Shared direct-DM auth/guard helpers |
| `plugin-sdk/interactive-runtime` | Semantic message presentation, delivery, and legacy interactive reply helpers. See [Message Presentation](/plugins/message-presentation) |
| `plugin-sdk/channel-inbound` | Compatibility barrel for inbound debounce, mention matching, mention-policy helpers, and envelope helpers |
| `plugin-sdk/channel-inbound-debounce` | Narrow inbound debounce helpers |
| `plugin-sdk/channel-mention-gating` | Narrow mention-policy helpers without the broader inbound runtime surface |
| `plugin-sdk/channel-location` | Channel location context and formatting helpers |
| `plugin-sdk/channel-logging` | Channel logging helpers for inbound drops and typing/ack failures |

View File

@@ -2,7 +2,7 @@ import fs from "node:fs";
import path from "node:path";
import { Readable } from "node:stream";
import type * as Lark from "@larksuiteoapi/node-sdk";
import { mediaKindFromMime } from "openclaw/plugin-sdk/media-runtime";
import { mediaKindFromMime } from "openclaw/plugin-sdk/media-mime";
import { withTempDownloadPath } from "openclaw/plugin-sdk/temp-path";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
import type { ClawdbotConfig } from "../runtime-api.js";

View File

@@ -1,8 +1,8 @@
import {
createInboundDebouncer,
resolveInboundDebounceMs,
} from "openclaw/plugin-sdk/channel-inbound";
import { hasControlCommand } from "openclaw/plugin-sdk/command-auth";
} from "openclaw/plugin-sdk/channel-inbound-debounce";
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "../runtime-api.js";

View File

@@ -1,8 +1,8 @@
import {
createInboundDebouncer,
resolveInboundDebounceMs,
} from "openclaw/plugin-sdk/channel-inbound";
import { hasControlCommand } from "openclaw/plugin-sdk/command-auth";
} from "openclaw/plugin-sdk/channel-inbound-debounce";
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { createNonExitingTypedRuntimeEnv } from "../../../test/helpers/plugins/runtime-env.js";
import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "../runtime-api.js";

View File

@@ -4,7 +4,7 @@ import { shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
import {
createInboundDebouncer,
resolveInboundDebounceMs,
} from "openclaw/plugin-sdk/channel-inbound";
} from "openclaw/plugin-sdk/channel-inbound-debounce";
import { resolveStoredModelOverride } from "openclaw/plugin-sdk/command-auth";
import {
resolveCommandAuthorization,

View File

@@ -1,5 +1,5 @@
import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
import { resolveInboundDebounceMs } from "openclaw/plugin-sdk/channel-inbound";
import { resolveInboundDebounceMs } from "openclaw/plugin-sdk/channel-inbound-debounce";
import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
import { drainPendingDeliveries } from "openclaw/plugin-sdk/infra-runtime";

View File

@@ -5,7 +5,8 @@ import type {
WAMessage,
WASocket,
} from "@whiskeysockets/baileys";
import { createInboundDebouncer, formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
import { createInboundDebouncer } from "openclaw/plugin-sdk/channel-inbound-debounce";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { defaultRuntime } from "openclaw/plugin-sdk/runtime-env";
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";

View File

@@ -637,6 +637,10 @@
"types": "./dist/plugin-sdk/channel-inbound.d.ts",
"default": "./dist/plugin-sdk/channel-inbound.js"
},
"./plugin-sdk/channel-inbound-debounce": {
"types": "./dist/plugin-sdk/channel-inbound-debounce.d.ts",
"default": "./dist/plugin-sdk/channel-inbound-debounce.js"
},
"./plugin-sdk/channel-inbound-roots": {
"types": "./dist/plugin-sdk/channel-inbound-roots.d.ts",
"default": "./dist/plugin-sdk/channel-inbound-roots.js"

View File

@@ -145,6 +145,7 @@
"channel-contract",
"channel-feedback",
"channel-inbound",
"channel-inbound-debounce",
"channel-inbound-roots",
"channel-logging",
"channel-location",

View File

@@ -0,0 +1,7 @@
// Narrow inbound debounce helpers for channel plugins.
export {
createInboundDebouncer,
resolveInboundDebounceMs,
type InboundDebounceCreateParams,
} from "../auto-reply/inbound-debounce.js";

View File

@@ -6,3 +6,4 @@ export {
getFileExtension,
normalizeMimeType,
} from "../media/mime.js";
export { mediaKindFromMime, type MediaKind } from "../media/constants.js";