perf(plugins): narrow boundary compile sdk imports

This commit is contained in:
Vincent Koc
2026-04-08 07:49:44 +01:00
parent 2e7a0fc7fb
commit 4260ac4cf6
28 changed files with 46 additions and 45 deletions

View File

@@ -4,7 +4,7 @@ import {
resolveMergedAccountConfig,
} from "openclaw/plugin-sdk/account-resolution";
import { resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-streaming";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { isBlockedHostnameOrIp } from "openclaw/plugin-sdk/ssrf-runtime";
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
import { hasConfiguredSecretInput, normalizeSecretInputString } from "./secret-input.js";

View File

@@ -1,4 +1,4 @@
import type { ChannelPlugin } from "openclaw/plugin-sdk/core";
import type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
import { type ResolvedBlueBubblesAccount } from "./accounts.js";
import {
bluebubblesCapabilities,

View File

@@ -1,5 +1,5 @@
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
type BlueBubblesConfigPatch = {
serverUrl?: string;

View File

@@ -1,4 +1,4 @@
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/core";
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/channel-core";
export const bluebubblesChannelConfigUiHints = {
"": {

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import type { ResolvedBlueBubblesAccount } from "./accounts.js";
import { getBlueBubblesRuntime } from "./runtime.js";
export {

View File

@@ -1,7 +1,8 @@
export type { ChannelMessageActionName } from "openclaw/plugin-sdk/channel-contract";
export type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
export { PAIRING_APPROVED_MESSAGE } from "openclaw/plugin-sdk/channel-status";
export type { ChannelPlugin, OpenClawConfig } from "openclaw/plugin-sdk/core";
export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/core";
export type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
export {
buildProbeChannelStatusSummary,
createDefaultChannelRuntimeState,

View File

@@ -1,4 +1,4 @@
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/core";
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/channel-core";
export const msTeamsChannelConfigUiHints = {
"": {

View File

@@ -3,7 +3,7 @@ import {
stripChannelTargetPrefix,
stripTargetKindPrefix,
type ChannelOutboundSessionRouteParams,
} from "openclaw/plugin-sdk/core";
} from "openclaw/plugin-sdk/channel-core";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
export function resolveMSTeamsOutboundSessionRoute(params: ChannelOutboundSessionRouteParams) {

View File

@@ -1,4 +1,4 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
import { registerSandboxBackend } from "openclaw/plugin-sdk/sandbox";
import {
createOpenShellSandboxBackendFactory,
@@ -6,12 +6,12 @@ import {
} from "./src/backend.js";
import { createOpenShellPluginConfigSchema, resolveOpenShellPluginConfig } from "./src/config.js";
const plugin = {
export default definePluginEntry({
id: "openshell",
name: "OpenShell Sandbox",
description: "OpenShell-backed sandbox runtime for agent exec and file tools.",
configSchema: createOpenShellPluginConfigSchema(),
register(api: OpenClawPluginApi) {
register(api) {
if (api.registrationMode !== "full") {
return;
}
@@ -25,6 +25,4 @@ const plugin = {
}),
});
},
};
export default plugin;
});

View File

@@ -1,4 +1,4 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/channel-core";
import { qaChannelPlugin } from "./src/channel.js";
export default defineSetupPluginEntry(qaChannelPlugin);

View File

@@ -1,5 +1,5 @@
import { Type } from "@sinclair/typebox";
import { jsonResult, readStringParam } from "openclaw/plugin-sdk/core";
import { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions";
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
import { resolveQaChannelAccount } from "./accounts.js";
import {

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { dispatchInboundReplyWithBase } from "openclaw/plugin-sdk/inbound-reply-dispatch";
import { buildQaTarget, sendQaBusMessage, type QaBusMessage } from "./bus-client.js";
import { getQaChannelRuntime } from "./runtime.js";

View File

@@ -1,20 +1,20 @@
export type {
ChannelMessageActionAdapter,
ChannelMessageActionName,
ChannelGatewayContext,
} from "openclaw/plugin-sdk/channel-contract";
export type { PluginRuntime } from "openclaw/plugin-sdk/core";
export type { ChannelGatewayContext } from "openclaw/plugin-sdk/channel-contract";
export type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
export type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
export type { RuntimeEnv } from "openclaw/plugin-sdk/runtime";
export type { ChannelPlugin } from "openclaw/plugin-sdk/core";
export type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store";
export {
buildChannelConfigSchema,
buildChannelOutboundSessionRoute,
createChatChannelPlugin,
defineChannelPluginEntry,
getChatChannelMeta,
jsonResult,
readStringParam,
} from "openclaw/plugin-sdk/core";
} from "openclaw/plugin-sdk/channel-core";
export { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions";
export { getChatChannelMeta } from "openclaw/plugin-sdk/channel-plugin-common";
export {
createComputedAccountStatusAdapter,
createDefaultChannelRuntimeState,

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { DEFAULT_ACCOUNT_ID } from "./accounts.js";
import type { CoreConfig } from "./types.js";

View File

@@ -1,4 +1,4 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/core";
import type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store";
type SessionRecord = {
sessionKey: string;

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
import {
defaultQaModelForMode,

View File

@@ -1,7 +1,8 @@
export type { Command } from "commander";
export type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/core";
export { definePluginEntry } from "openclaw/plugin-sdk/core";
export type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
export { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
export { callGatewayFromCli } from "openclaw/plugin-sdk/browser-node-runtime";
export type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store";
export {
buildQaTarget,
createQaBusThread,

View File

@@ -1,6 +1,6 @@
import fs from "node:fs/promises";
import path from "node:path";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import type { QaBusState } from "./bus-state.js";
import { startQaLabServer } from "./lab-server.js";
import { renderQaMarkdownReport } from "./report.js";

View File

@@ -5,7 +5,7 @@ import path from "node:path";
import { setTimeout as sleep } from "node:timers/promises";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import {
formatMemoryDreamingDay,

View File

@@ -1,12 +1,13 @@
export type { OpenClawPluginApi, PluginRuntime } from "openclaw/plugin-sdk/core";
export type { OpenClawPluginApi } from "openclaw/plugin-sdk/plugin-entry";
export type { ChannelMessageActionAdapter } from "openclaw/plugin-sdk/channel-contract";
export type { TelegramApiOverride } from "./src/send.js";
export type {
OpenClawPluginService,
OpenClawPluginServiceContext,
PluginLogger,
} from "openclaw/plugin-sdk/core";
} from "openclaw/plugin-sdk/plugin-entry";
import type { OpenClawConfig as RuntimeOpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
export type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store";
export type {
AcpRuntime,
AcpRuntimeCapabilities,
@@ -22,11 +23,11 @@ export type {
export { AcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
export {
clearAccountEntryFields,
emptyPluginConfigSchema,
formatPairingApproveHint,
getChatChannelMeta,
} from "openclaw/plugin-sdk/core";
} from "openclaw/plugin-sdk/channel-plugin-common";
export { clearAccountEntryFields } from "openclaw/plugin-sdk/channel-core";
export { buildChannelConfigSchema, TelegramConfigSchema } from "./config-api.js";
export { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
export {
@@ -84,7 +85,7 @@ export {
} from "./src/thread-bindings.js";
export { resolveTelegramToken } from "./src/token.js";
export { setTelegramRuntime } from "./src/runtime.js";
export type { ChannelPlugin } from "openclaw/plugin-sdk/core";
export type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
export type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
export type TelegramAccountConfig = NonNullable<
NonNullable<RuntimeOpenClawConfig["channels"]>["telegram"]

View File

@@ -1,8 +1,8 @@
import { resolveAccountWithDefaultFallback } from "openclaw/plugin-sdk/account-core";
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/channel-core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { coerceSecretRef } from "openclaw/plugin-sdk/config-runtime";
import type { TelegramAccountConfig } from "openclaw/plugin-sdk/config-runtime";
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";
import { resolveDefaultSecretProviderAlias } from "openclaw/plugin-sdk/provider-auth";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
import {

View File

@@ -1,4 +1,4 @@
import type { ChannelPlugin } from "openclaw/plugin-sdk/core";
import type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
import { type ResolvedTelegramAccount } from "./accounts.js";
import type { TelegramProbe } from "./probe.js";
import { telegramSetupAdapter } from "./setup-core.js";

View File

@@ -1,4 +1,4 @@
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/core";
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/channel-core";
export const telegramChannelConfigUiHints = {
"": {

View File

@@ -1,4 +1,4 @@
import type { PluginRuntime } from "openclaw/plugin-sdk/core";
import type { PluginRuntime } from "openclaw/plugin-sdk/runtime-store";
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
type TelegramChannelRuntime = {

View File

@@ -1,8 +1,8 @@
import { resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-core";
import type { BaseTokenResolution } from "openclaw/plugin-sdk/channel-contract";
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/channel-core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import type { TelegramAccountConfig } from "openclaw/plugin-sdk/config-runtime";
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/core";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";

View File

@@ -1,4 +1,4 @@
import { definePluginEntry } from "openclaw/plugin-sdk/core";
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
export default definePluginEntry({
id: "voice-call",

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import type {
RealtimeVoiceProviderConfig,

View File

@@ -1,6 +1,6 @@
import http from "node:http";
import { URL } from "node:url";
import type { OpenClawConfig } from "openclaw/plugin-sdk/core";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
import {
createWebhookInFlightLimiter,