perf(plugins): narrow boundary compile import surfaces

This commit is contained in:
Vincent Koc
2026-04-08 08:27:30 +01:00
parent 73c475023f
commit 952862b9e2
16 changed files with 21 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import { buildPluginConfigSchema } from "openclaw/plugin-sdk/core";
import { buildPluginConfigSchema } from "openclaw/plugin-sdk/plugin-entry";
import { z } from "openclaw/plugin-sdk/zod";
import type { OpenClawPluginConfigSchema } from "../api.js";
import {

View File

@@ -4,7 +4,7 @@ import {
shouldDebounceTextInbound,
} from "openclaw/plugin-sdk/channel-inbound";
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/config-runtime";
import { createDedupeCache } from "openclaw/plugin-sdk/core";
import { createDedupeCache } from "openclaw/plugin-sdk/infra-runtime";
import { danger } from "openclaw/plugin-sdk/runtime-env";
import { buildDiscordInboundJob } from "./inbound-job.js";
import {

View File

@@ -2,11 +2,12 @@
// Keep monitor internals off the broad package runtime-api barrel so monitor
// tests and shared workers do not pull unrelated Matrix helper surfaces.
export type { NormalizedLocation, PluginRuntime, RuntimeLogger } from "openclaw/plugin-sdk/core";
export { ensureConfiguredAcpBindingReady } from "openclaw/plugin-sdk/acp-binding-runtime";
export type { NormalizedLocation } from "openclaw/plugin-sdk/channel-inbound";
export type { PluginRuntime, RuntimeLogger } from "openclaw/plugin-sdk/plugin-runtime";
export type { BlockReplyContext, ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
export type { MarkdownTableMode, OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
export type { RuntimeEnv } from "openclaw/plugin-sdk/runtime";
export { ensureConfiguredAcpBindingReady } from "openclaw/plugin-sdk/core";
export {
addAllowlistUserEntriesFromConfigEntry,
buildAllowlistResolutionSummary,

View File

@@ -1,4 +1,4 @@
import type { GatewayRequestHandlerOptions } from "openclaw/plugin-sdk/core";
import type { GatewayRequestHandlerOptions } from "openclaw/plugin-sdk/gateway-runtime";
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
import { formatMatrixErrorMessage } from "./matrix/errors.js";

View File

@@ -5,5 +5,5 @@ export {
type OpenClawConfig,
type OpenClawPluginApi,
type OpenClawPluginConfigSchema,
} from "openclaw/plugin-sdk/core";
} from "openclaw/plugin-sdk/plugin-entry";
export { z } from "openclaw/plugin-sdk/zod";

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: "memory-wiki",

View File

@@ -6,7 +6,7 @@ import type {
} from "openclaw/plugin-sdk/config-runtime";
import type { SessionScope } from "openclaw/plugin-sdk/config-runtime";
import type { DmPolicy, GroupPolicy } from "openclaw/plugin-sdk/config-runtime";
import { createDedupeCache } from "openclaw/plugin-sdk/core";
import { createDedupeCache } from "openclaw/plugin-sdk/infra-runtime";
import type { HistoryEntry } from "openclaw/plugin-sdk/reply-history";
import { resolveAgentRoute } from "openclaw/plugin-sdk/routing";
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";

View File

@@ -1,4 +1,4 @@
import { generateSecureToken } from "openclaw/plugin-sdk/core";
import { generateSecureToken } from "openclaw/plugin-sdk/infra-runtime";
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
const SLACK_EXTERNAL_ARG_MENU_TOKEN_LENGTH = Math.ceil(

View File

@@ -1,4 +1,4 @@
import { resolveGlobalDedupeCache } from "openclaw/plugin-sdk/core";
import { resolveGlobalDedupeCache } from "openclaw/plugin-sdk/infra-runtime";
/**
* In-memory cache of Slack threads the bot has participated in.

View File

@@ -1,5 +1,5 @@
import type { Message } from "@grammyjs/types";
import { createDedupeCache } from "openclaw/plugin-sdk/core";
import { createDedupeCache } from "openclaw/plugin-sdk/infra-runtime";
import type { TelegramContext } from "./bot/types.js";
const MEDIA_GROUP_TIMEOUT_MS = 500;

View File

@@ -1,16 +1,13 @@
import { resolveNormalizedAccountEntry } from "openclaw/plugin-sdk/account-core";
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
import {
adaptScopedAccountAccessor,
createScopedChannelConfigAdapter,
} from "openclaw/plugin-sdk/channel-config-helpers";
import { createChannelPluginBase, type ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
import { getChatChannelMeta } from "openclaw/plugin-sdk/channel-plugin-common";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { createChannelPluginBase } from "openclaw/plugin-sdk/core";
import {
getChatChannelMeta,
normalizeAccountId,
type ChannelPlugin,
} from "openclaw/plugin-sdk/core";
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/routing";
import { inspectTelegramAccount } from "./account-inspect.js";
import {

View File

@@ -1,5 +1,6 @@
import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
import { getChatChannelMeta, type ChannelPlugin } from "openclaw/plugin-sdk/core";
import type { ChannelPlugin } from "openclaw/plugin-sdk/channel-core";
import { getChatChannelMeta } from "openclaw/plugin-sdk/channel-plugin-common";
import type { ResolvedTelegramAccount } from "./src/accounts.js";
import { resolveTelegramAccount } from "./src/accounts.js";
import { telegramApprovalCapability } from "./src/approval-native.js";

View File

@@ -12,6 +12,7 @@ export {
buildChannelConfigSchema,
buildChannelOutboundSessionRoute,
clearAccountEntryFields,
createChannelPluginBase,
createChatChannelPlugin,
defineChannelPluginEntry,
defineSetupPluginEntry,

View File

@@ -7,3 +7,4 @@ export {
withOperatorApprovalsGatewayClient,
} from "../gateway/operator-approvals-client.js";
export type { EventFrame } from "../gateway/protocol/index.js";
export type { GatewayRequestHandlerOptions } from "../gateway/server-methods/types.js";

View File

@@ -142,7 +142,7 @@ export type {
};
export type { OpenClawConfig };
export { emptyPluginConfigSchema } from "../plugins/config-schema.js";
export { buildPluginConfigSchema, emptyPluginConfigSchema } from "../plugins/config-schema.js";
/** Options for a plugin entry that registers providers, tools, commands, or services. */
type DefinePluginEntryOptions = {

View File

@@ -8,4 +8,4 @@ export * from "../plugins/interactive-binding-helpers.js";
export * from "../plugins/interactive.js";
export * from "../plugins/lazy-service-module.js";
export * from "../plugins/types.js";
export type { RuntimeLogger } from "../plugins/runtime/types.js";
export type { PluginRuntime, RuntimeLogger } from "../plugins/runtime/types.js";