diff --git a/docs/.generated/plugin-sdk-api-baseline.json b/docs/.generated/plugin-sdk-api-baseline.json index ae7629c2f02..719ffdbd54d 100644 --- a/docs/.generated/plugin-sdk-api-baseline.json +++ b/docs/.generated/plugin-sdk-api-baseline.json @@ -3144,7 +3144,7 @@ "exportName": "buildChannelOutboundSessionRoute", "kind": "function", "source": { - "line": 163, + "line": 181, "path": "src/plugin-sdk/core.ts" } }, @@ -3189,7 +3189,7 @@ "exportName": "createChannelPluginBase", "kind": "function", "source": { - "line": 447, + "line": 527, "path": "src/plugin-sdk/core.ts" } }, @@ -3198,7 +3198,7 @@ "exportName": "createChatChannelPlugin", "kind": "function", "source": { - "line": 424, + "line": 504, "path": "src/plugin-sdk/core.ts" } }, @@ -3207,7 +3207,7 @@ "exportName": "defineChannelPluginEntry", "kind": "function", "source": { - "line": 251, + "line": 274, "path": "src/plugin-sdk/core.ts" } }, @@ -3225,7 +3225,7 @@ "exportName": "defineSetupPluginEntry", "kind": "function", "source": { - "line": 287, + "line": 311, "path": "src/plugin-sdk/core.ts" } }, @@ -3279,8 +3279,8 @@ "exportName": "getChatChannelMeta", "kind": "function", "source": { - "line": 155, - "path": "src/channels/registry.ts" + "line": 124, + "path": "src/channels/chat-meta.ts" } }, { @@ -3423,7 +3423,7 @@ "exportName": "stripChannelTargetPrefix", "kind": "function", "source": { - "line": 143, + "line": 161, "path": "src/plugin-sdk/core.ts" } }, @@ -3432,7 +3432,7 @@ "exportName": "stripTargetKindPrefix", "kind": "function", "source": { - "line": 155, + "line": 173, "path": "src/plugin-sdk/core.ts" } }, @@ -3513,7 +3513,7 @@ "exportName": "ChannelOutboundSessionRouteParams", "kind": "type", "source": { - "line": 138, + "line": 156, "path": "src/plugin-sdk/core.ts" } }, @@ -3540,7 +3540,7 @@ "exportName": "GatewayRequestHandlerOptions", "kind": "type", "source": { - "line": 114, + "line": 115, "path": "src/gateway/server-methods/types.ts" } }, diff --git a/docs/.generated/plugin-sdk-api-baseline.jsonl b/docs/.generated/plugin-sdk-api-baseline.jsonl index eda679169a5..8eb2931787c 100644 --- a/docs/.generated/plugin-sdk-api-baseline.jsonl +++ b/docs/.generated/plugin-sdk-api-baseline.jsonl @@ -345,22 +345,22 @@ {"declaration":"export function applyAccountNameToChannelSection(params: { cfg: OpenClawConfig; channelKey: string; accountId: string; name?: string | undefined; alwaysUseAccounts?: boolean | undefined; }): OpenClawConfig;","entrypoint":"core","exportName":"applyAccountNameToChannelSection","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":34,"sourcePath":"src/channels/plugins/setup-helpers.ts"} {"declaration":"export function buildAgentSessionKey(params: { agentId: string; channel: string; accountId?: string | null | undefined; peer?: RoutePeer | null | undefined; dmScope?: \"main\" | \"per-peer\" | \"per-channel-peer\" | \"per-account-channel-peer\" | undefined; identityLinks?: Record<...> | undefined; }): string;","entrypoint":"core","exportName":"buildAgentSessionKey","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":91,"sourcePath":"src/routing/resolve-route.ts"} {"declaration":"export function buildChannelConfigSchema(schema: ZodType>, options?: BuildChannelConfigSchemaOptions | undefined): ChannelConfigSchema;","entrypoint":"core","exportName":"buildChannelConfigSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":75,"sourcePath":"src/channels/plugins/config-schema.ts"} -{"declaration":"export function buildChannelOutboundSessionRoute(params: { cfg: OpenClawConfig; agentId: string; channel: string; accountId?: string | null | undefined; peer: { kind: \"direct\" | \"group\" | \"channel\"; id: string; }; chatType: \"direct\" | \"group\" | \"channel\"; from: string; to: string; threadId?: string | ... 1 more ... | undefined; }): ChannelOutboundSessionRoute;","entrypoint":"core","exportName":"buildChannelOutboundSessionRoute","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":163,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function buildChannelOutboundSessionRoute(params: { cfg: OpenClawConfig; agentId: string; channel: string; accountId?: string | null | undefined; peer: { kind: \"direct\" | \"group\" | \"channel\"; id: string; }; chatType: \"direct\" | \"group\" | \"channel\"; from: string; to: string; threadId?: string | ... 1 more ... | undefined; }): ChannelOutboundSessionRoute;","entrypoint":"core","exportName":"buildChannelOutboundSessionRoute","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":181,"sourcePath":"src/plugin-sdk/core.ts"} {"declaration":"export function buildPluginConfigSchema(schema: ZodType>, options?: BuildPluginConfigSchemaOptions | undefined): OpenClawPluginConfigSchema;","entrypoint":"core","exportName":"buildPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":78,"sourcePath":"src/plugins/config-schema.ts"} {"declaration":"export function channelTargetSchema(options?: { description?: string | undefined; } | undefined): TString;","entrypoint":"core","exportName":"channelTargetSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":38,"sourcePath":"src/agents/schema/typebox.ts"} {"declaration":"export function channelTargetsSchema(options?: { description?: string | undefined; } | undefined): TArray;","entrypoint":"core","exportName":"channelTargetsSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":44,"sourcePath":"src/agents/schema/typebox.ts"} {"declaration":"export function clearAccountEntryFields(params: { accounts?: Record | undefined; accountId: string; fields: string[]; isValueSet?: ((value: unknown) => boolean) | undefined; markClearedOnFieldPresence?: boolean | undefined; }): { ...; };","entrypoint":"core","exportName":"clearAccountEntryFields","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":122,"sourcePath":"src/channels/plugins/config-helpers.ts"} -{"declaration":"export function createChannelPluginBase(params: CreateChannelPluginBaseOptions): CreatedChannelPluginBase;","entrypoint":"core","exportName":"createChannelPluginBase","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":447,"sourcePath":"src/plugin-sdk/core.ts"} -{"declaration":"export function createChatChannelPlugin(params: { base: ChatChannelPluginBase; security?: ChannelSecurityAdapter | ChatChannelSecurityOptions<...> | undefined; pairing?: ChannelPairingAdapter | ... 1 more ... | undefined; threading?: ChannelThreadingAdapter | ... 1 more ... | undefined; outbound?: ChannelOutboundAdapter | ... 1 more ... | undefined; }): ChannelPlugin<...>;","entrypoint":"core","exportName":"createChatChannelPlugin","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":424,"sourcePath":"src/plugin-sdk/core.ts"} -{"declaration":"export function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerFull, }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry;","entrypoint":"core","exportName":"defineChannelPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":251,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function createChannelPluginBase(params: CreateChannelPluginBaseOptions): CreatedChannelPluginBase;","entrypoint":"core","exportName":"createChannelPluginBase","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":527,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function createChatChannelPlugin(params: { base: ChatChannelPluginBase; security?: ChannelSecurityAdapter | ChatChannelSecurityOptions<...> | undefined; pairing?: ChannelPairingAdapter | ... 1 more ... | undefined; threading?: ChannelThreadingAdapter | ... 1 more ... | undefined; outbound?: ChannelOutboundAdapter | ... 1 more ... | undefined; }): ChannelPlugin<...>;","entrypoint":"core","exportName":"createChatChannelPlugin","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":504,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerFull, }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry;","entrypoint":"core","exportName":"defineChannelPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":274,"sourcePath":"src/plugin-sdk/core.ts"} {"declaration":"export function definePluginEntry({ id, name, description, kind, configSchema, register, }: DefinePluginEntryOptions): DefinedPluginEntry;","entrypoint":"core","exportName":"definePluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":129,"sourcePath":"src/plugin-sdk/plugin-entry.ts"} -{"declaration":"export function defineSetupPluginEntry(plugin: TPlugin): { plugin: TPlugin; };","entrypoint":"core","exportName":"defineSetupPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":287,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function defineSetupPluginEntry(plugin: TPlugin): { plugin: TPlugin; };","entrypoint":"core","exportName":"defineSetupPluginEntry","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":311,"sourcePath":"src/plugin-sdk/core.ts"} {"declaration":"export function delegateCompactionToRuntime(params: { sessionId: string; sessionKey?: string | undefined; sessionFile: string; tokenBudget?: number | undefined; force?: boolean | undefined; currentTokenCount?: number | undefined; compactionTarget?: \"budget\" | ... 1 more ... | undefined; customInstructions?: string | undefined; runtimeContext?: ContextEngineRuntimeContext | undefined; }): Promise<...>;","entrypoint":"core","exportName":"delegateCompactionToRuntime","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":16,"sourcePath":"src/context-engine/delegate.ts"} {"declaration":"export function deleteAccountFromConfigSection(params: { cfg: OpenClawConfig; sectionKey: string; accountId: string; clearBaseFields?: string[] | undefined; }): OpenClawConfig;","entrypoint":"core","exportName":"deleteAccountFromConfigSection","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":60,"sourcePath":"src/channels/plugins/config-helpers.ts"} {"declaration":"export function emptyPluginConfigSchema(): OpenClawPluginConfigSchema;","entrypoint":"core","exportName":"emptyPluginConfigSchema","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":108,"sourcePath":"src/plugins/config-schema.ts"} {"declaration":"export function enqueueKeyedTask(params: { tails: Map>; key: string; task: () => Promise; hooks?: KeyedAsyncQueueHooks | undefined; }): Promise<...>;","entrypoint":"core","exportName":"enqueueKeyedTask","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":7,"sourcePath":"src/plugin-sdk/keyed-async-queue.ts"} {"declaration":"export function formatPairingApproveHint(channelId: string): string;","entrypoint":"core","exportName":"formatPairingApproveHint","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":17,"sourcePath":"src/channels/plugins/helpers.ts"} -{"declaration":"export function getChatChannelMeta(id: \"telegram\" | \"whatsapp\" | \"discord\" | \"irc\" | \"googlechat\" | \"slack\" | \"signal\" | \"imessage\" | \"line\"): ChannelMeta;","entrypoint":"core","exportName":"getChatChannelMeta","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":155,"sourcePath":"src/channels/registry.ts"} +{"declaration":"export function getChatChannelMeta(id: \"telegram\" | \"whatsapp\" | \"discord\" | \"irc\" | \"googlechat\" | \"slack\" | \"signal\" | \"imessage\" | \"line\"): ChannelMeta;","entrypoint":"core","exportName":"getChatChannelMeta","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":124,"sourcePath":"src/channels/chat-meta.ts"} {"declaration":"export function isSecretRef(value: unknown): value is SecretRef;","entrypoint":"core","exportName":"isSecretRef","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":34,"sourcePath":"src/config/types.secrets.ts"} {"declaration":"export function loadSecretFileSync(filePath: string, label: string, options?: SecretFileReadOptions): SecretFileReadResult;","entrypoint":"core","exportName":"loadSecretFileSync","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":29,"sourcePath":"src/infra/secret-file.ts"} {"declaration":"export function migrateBaseNameToDefaultAccount(params: { cfg: OpenClawConfig; channelKey: string; alwaysUseAccounts?: boolean | undefined; }): OpenClawConfig;","entrypoint":"core","exportName":"migrateBaseNameToDefaultAccount","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":93,"sourcePath":"src/channels/plugins/setup-helpers.ts"} @@ -376,8 +376,8 @@ {"declaration":"export function resolveThreadSessionKeys(params: { baseSessionKey: string; threadId?: string | null | undefined; parentSessionKey?: string | undefined; useSuffix?: boolean | undefined; normalizeThreadId?: ((threadId: string) => string) | undefined; }): { ...; };","entrypoint":"core","exportName":"resolveThreadSessionKeys","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":234,"sourcePath":"src/routing/session-key.ts"} {"declaration":"export function setAccountEnabledInConfigSection(params: { cfg: OpenClawConfig; sectionKey: string; accountId: string; enabled: boolean; allowTopLevel?: boolean | undefined; }): OpenClawConfig;","entrypoint":"core","exportName":"setAccountEnabledInConfigSection","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":16,"sourcePath":"src/channels/plugins/config-helpers.ts"} {"declaration":"export function stringEnum(values: T, options?: StringEnumOptions): TUnsafe;","entrypoint":"core","exportName":"stringEnum","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":15,"sourcePath":"src/agents/schema/typebox.ts"} -{"declaration":"export function stripChannelTargetPrefix(raw: string, ...providers: string[]): string;","entrypoint":"core","exportName":"stripChannelTargetPrefix","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":143,"sourcePath":"src/plugin-sdk/core.ts"} -{"declaration":"export function stripTargetKindPrefix(raw: string): string;","entrypoint":"core","exportName":"stripTargetKindPrefix","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":155,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function stripChannelTargetPrefix(raw: string, ...providers: string[]): string;","entrypoint":"core","exportName":"stripChannelTargetPrefix","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":161,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export function stripTargetKindPrefix(raw: string): string;","entrypoint":"core","exportName":"stripTargetKindPrefix","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":173,"sourcePath":"src/plugin-sdk/core.ts"} {"declaration":"export function tryReadSecretFileSync(filePath: string | undefined, label: string, options?: SecretFileReadOptions): string | undefined;","entrypoint":"core","exportName":"tryReadSecretFileSync","importSpecifier":"openclaw/plugin-sdk/core","kind":"function","recordType":"export","sourceLine":130,"sourcePath":"src/infra/secret-file.ts"} {"declaration":"export const DEFAULT_ACCOUNT_ID: \"default\";","entrypoint":"core","exportName":"DEFAULT_ACCOUNT_ID","importSpecifier":"openclaw/plugin-sdk/core","kind":"const","recordType":"export","sourceLine":3,"sourcePath":"src/routing/account-id.ts"} {"declaration":"export const DEFAULT_SECRET_FILE_MAX_BYTES: number;","entrypoint":"core","exportName":"DEFAULT_SECRET_FILE_MAX_BYTES","importSpecifier":"openclaw/plugin-sdk/core","kind":"const","recordType":"export","sourceLine":5,"sourcePath":"src/infra/secret-file.ts"} @@ -386,10 +386,10 @@ {"declaration":"export type ChannelMessageActionContext = ChannelMessageActionContext;","entrypoint":"core","exportName":"ChannelMessageActionContext","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":482,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelMessagingAdapter = ChannelMessagingAdapter;","entrypoint":"core","exportName":"ChannelMessagingAdapter","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":395,"sourcePath":"src/channels/plugins/types.core.ts"} {"declaration":"export type ChannelOutboundSessionRoute = ChannelOutboundSessionRoute;","entrypoint":"core","exportName":"ChannelOutboundSessionRoute","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":309,"sourcePath":"src/channels/plugins/types.core.ts"} -{"declaration":"export type ChannelOutboundSessionRouteParams = { cfg: OpenClawConfig; agentId: string; accountId?: string | null; target: string; resolvedTarget?: { to: string; kind: import(\"src/channels/plugins/types.core\").ChannelDirectoryEntryKind | \"channel\"; display?: string; source: \"normalized\" | \"directory\"; }; replyToId?: string | null; threadId?: string | number | null;};","entrypoint":"core","exportName":"ChannelOutboundSessionRouteParams","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":138,"sourcePath":"src/plugin-sdk/core.ts"} +{"declaration":"export type ChannelOutboundSessionRouteParams = { cfg: OpenClawConfig; agentId: string; accountId?: string | null; target: string; resolvedTarget?: { to: string; kind: import(\"src/channels/plugins/types.core\").ChannelDirectoryEntryKind | \"channel\"; display?: string; source: \"normalized\" | \"directory\"; }; replyToId?: string | null; threadId?: string | number | null;};","entrypoint":"core","exportName":"ChannelOutboundSessionRouteParams","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":156,"sourcePath":"src/plugin-sdk/core.ts"} {"declaration":"export type ChannelPlugin = ChannelPlugin;","entrypoint":"core","exportName":"ChannelPlugin","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":76,"sourcePath":"src/channels/plugins/types.plugin.ts"} {"declaration":"export type GatewayBindUrlResult = GatewayBindUrlResult;","entrypoint":"core","exportName":"GatewayBindUrlResult","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1,"sourcePath":"src/shared/gateway-bind-url.ts"} -{"declaration":"export type GatewayRequestHandlerOptions = GatewayRequestHandlerOptions;","entrypoint":"core","exportName":"GatewayRequestHandlerOptions","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":114,"sourcePath":"src/gateway/server-methods/types.ts"} +{"declaration":"export type GatewayRequestHandlerOptions = GatewayRequestHandlerOptions;","entrypoint":"core","exportName":"GatewayRequestHandlerOptions","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":115,"sourcePath":"src/gateway/server-methods/types.ts"} {"declaration":"export type MediaUnderstandingProviderPlugin = MediaUnderstandingProvider;","entrypoint":"core","exportName":"MediaUnderstandingProviderPlugin","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1138,"sourcePath":"src/plugins/types.ts"} {"declaration":"export type OpenClawConfig = OpenClawConfig;","entrypoint":"core","exportName":"OpenClawConfig","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":32,"sourcePath":"src/config/types.openclaw.ts"} {"declaration":"export type OpenClawPluginApi = OpenClawPluginApi;","entrypoint":"core","exportName":"OpenClawPluginApi","importSpecifier":"openclaw/plugin-sdk/core","kind":"type","recordType":"export","sourceLine":1529,"sourcePath":"src/plugins/types.ts"} diff --git a/extensions/anthropic/api.ts b/extensions/anthropic/api.ts new file mode 100644 index 00000000000..972445b9b29 --- /dev/null +++ b/extensions/anthropic/api.ts @@ -0,0 +1 @@ +export { CLAUDE_CLI_BACKEND_ID, isClaudeCliProvider } from "./cli-shared.js"; diff --git a/extensions/browser/runtime-api.ts b/extensions/browser/runtime-api.ts index a2af011c361..c1194df28b9 100644 --- a/extensions/browser/runtime-api.ts +++ b/extensions/browser/runtime-api.ts @@ -1,4 +1,5 @@ export { createBrowserTool } from "./src/browser-tool.js"; +export * from "./src/browser-runtime.js"; export { registerBrowserCli } from "./src/cli/browser-cli.js"; export { createBrowserPluginService } from "./src/plugin-service.js"; export { handleBrowserGatewayRequest } from "./src/gateway/browser-request.js"; diff --git a/extensions/discord/api.ts b/extensions/discord/api.ts index b535bbc9899..daf4ed43ebd 100644 --- a/extensions/discord/api.ts +++ b/extensions/discord/api.ts @@ -12,6 +12,10 @@ export * from "./src/probe.js"; export * from "./src/session-key-normalization.js"; export * from "./src/status-issues.js"; export * from "./src/targets.js"; +export { + DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, + DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, +} from "./src/monitor/timeouts.js"; export type { DiscordSendComponents, DiscordSendEmbeds } from "./src/send.shared.js"; export type { DiscordSendResult } from "./src/send.types.js"; export type { DiscordTokenResolution } from "./src/token.js"; diff --git a/extensions/github-copilot/api.ts b/extensions/github-copilot/api.ts new file mode 100644 index 00000000000..bd0a8ba072a --- /dev/null +++ b/extensions/github-copilot/api.ts @@ -0,0 +1 @@ +export { githubCopilotLoginCommand } from "./login.js"; diff --git a/extensions/matrix/api.ts b/extensions/matrix/api.ts index 607926aca99..fcd571976a0 100644 --- a/extensions/matrix/api.ts +++ b/extensions/matrix/api.ts @@ -1,10 +1,17 @@ export * from "./src/setup-core.js"; export * from "./src/setup-surface.js"; +export * from "./src/account-selection.js"; +export * from "./src/env-vars.js"; +export * from "./src/storage-paths.js"; export { createMatrixThreadBindingManager, getMatrixThreadBindingManager, resetMatrixThreadBindingsForTests, } from "./src/matrix/thread-bindings.js"; +export { + setMatrixThreadBindingIdleTimeoutBySessionKey, + setMatrixThreadBindingMaxAgeBySessionKey, +} from "./src/matrix/thread-bindings-shared.js"; export { matrixOnboardingAdapter as matrixSetupWizard } from "./src/onboarding.js"; export const matrixSessionBindingAdapterChannels = ["matrix"] as const; diff --git a/extensions/matrix/runtime-api.ts b/extensions/matrix/runtime-api.ts index 55f5e319931..81f29ef0e10 100644 --- a/extensions/matrix/runtime-api.ts +++ b/extensions/matrix/runtime-api.ts @@ -6,7 +6,9 @@ export { requiresExplicitMatrixDefaultAccount, resolveMatrixDefaultOrOnlyAccountId, } from "./src/account-selection.js"; -export * from "./helper-api.js"; +export * from "./src/account-selection.js"; +export * from "./src/env-vars.js"; +export * from "./src/storage-paths.js"; export { assertHttpUrlTargetsPrivateNetwork, closeDispatcher, @@ -19,7 +21,7 @@ export { export { setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingMaxAgeBySessionKey, -} from "./thread-bindings-runtime.js"; +} from "./src/matrix/thread-bindings-shared.js"; export { setMatrixRuntime } from "./src/runtime.js"; export { writeJsonFileAtomically } from "openclaw/plugin-sdk/json-store"; export type { diff --git a/extensions/modelstudio/onboard.ts b/extensions/modelstudio/onboard.ts index c3a1eeb17c8..b35c989b1e5 100644 --- a/extensions/modelstudio/onboard.ts +++ b/extensions/modelstudio/onboard.ts @@ -8,7 +8,7 @@ import { MODELSTUDIO_GLOBAL_BASE_URL, MODELSTUDIO_STANDARD_CN_BASE_URL, MODELSTUDIO_STANDARD_GLOBAL_BASE_URL, -} from "./model-definitions.js"; +} from "./models.js"; import { buildModelStudioProvider } from "./provider-catalog.js"; export { diff --git a/extensions/vercel-ai-gateway/api.ts b/extensions/vercel-ai-gateway/api.ts index 6edbe64f6e1..c7f2727d669 100644 --- a/extensions/vercel-ai-gateway/api.ts +++ b/extensions/vercel-ai-gateway/api.ts @@ -2,6 +2,11 @@ export { discoverVercelAiGatewayModels, getStaticVercelAiGatewayModelCatalog, VERCEL_AI_GATEWAY_BASE_URL, + VERCEL_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW, + VERCEL_AI_GATEWAY_DEFAULT_COST, + VERCEL_AI_GATEWAY_DEFAULT_MAX_TOKENS, + VERCEL_AI_GATEWAY_DEFAULT_MODEL_ID, + VERCEL_AI_GATEWAY_PROVIDER_ID, } from "./models.js"; export { buildVercelAiGatewayProvider } from "./provider-catalog.js"; export { applyVercelAiGatewayConfig, VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF } from "./onboard.js"; diff --git a/scripts/lib/plugin-sdk-facades.mjs b/scripts/lib/plugin-sdk-facades.mjs index 03b295121a3..0e32c271f5d 100644 --- a/scripts/lib/plugin-sdk-facades.mjs +++ b/scripts/lib/plugin-sdk-facades.mjs @@ -83,7 +83,7 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "discord-session-key", - source: "../../extensions/discord/session-key-api.js", + source: "../../extensions/discord/api.js", exports: ["normalizeExplicitDiscordSessionKey"], }, { @@ -147,12 +147,12 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "discord-timeouts", - source: "../../extensions/discord/timeouts.js", + source: "../../extensions/discord/api.js", exports: ["DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS", "DISCORD_DEFAULT_LISTENER_TIMEOUT_MS"], }, { subpath: "anthropic-cli", - source: "../../extensions/anthropic/cli-shared.js", + source: "../../extensions/anthropic/api.js", exports: ["CLAUDE_CLI_BACKEND_ID", "isClaudeCliProvider"], }, { @@ -177,7 +177,7 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "browser-runtime", - source: "../../extensions/browser/browser-runtime-api.js", + source: "../../extensions/browser/runtime-api.js", exportAll: true, }, { @@ -260,12 +260,12 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "feishu-setup", - source: "../../extensions/feishu/setup-api.js", + source: "../../extensions/feishu/api.js", exports: ["feishuSetupAdapter", "feishuSetupWizard"], }, { subpath: "github-copilot-login", - source: "../../extensions/github-copilot/login.js", + source: "../../extensions/github-copilot/api.js", exports: ["githubCopilotLoginCommand"], }, { @@ -443,7 +443,7 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "matrix-helper", - source: "../../extensions/matrix/helper-api.js", + source: "../../extensions/matrix/api.js", exports: [ "findMatrixAccountEntry", "getMatrixScopedEnvVarNames", @@ -469,7 +469,7 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "matrix-thread-bindings", - source: "../../extensions/matrix/thread-bindings-runtime.js", + source: "../../extensions/matrix/api.js", exports: [ "setMatrixThreadBindingIdleTimeoutBySessionKey", "setMatrixThreadBindingMaxAgeBySessionKey", @@ -497,11 +497,21 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ { subpath: "modelstudio", source: "../../extensions/modelstudio/api.js", - exports: ["MODELSTUDIO_BASE_URL", "MODELSTUDIO_DEFAULT_MODEL_ID", "buildModelStudioProvider"], + exports: [ + "buildModelStudioDefaultModelDefinition", + "buildModelStudioModelDefinition", + "MODELSTUDIO_BASE_URL", + "MODELSTUDIO_CN_BASE_URL", + "MODELSTUDIO_DEFAULT_COST", + "MODELSTUDIO_DEFAULT_MODEL_ID", + "MODELSTUDIO_DEFAULT_MODEL_REF", + "MODELSTUDIO_GLOBAL_BASE_URL", + "buildModelStudioProvider", + ], }, { subpath: "modelstudio-definitions", - source: "../../extensions/modelstudio/model-definitions.js", + source: "../../extensions/modelstudio/api.js", exports: [ "buildModelStudioDefaultModelDefinition", "buildModelStudioModelDefinition", @@ -752,7 +762,7 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ }, { subpath: "telegram-allow-from", - source: "../../extensions/telegram/allow-from.js", + source: "../../extensions/telegram/api.js", exports: ["isNumericTelegramUserId", "normalizeTelegramAllowFromEntry"], }, { @@ -846,7 +856,12 @@ export const GENERATED_PLUGIN_SDK_FACADES = [ "discoverVercelAiGatewayModels", "getStaticVercelAiGatewayModelCatalog", "VERCEL_AI_GATEWAY_BASE_URL", + "VERCEL_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW", + "VERCEL_AI_GATEWAY_DEFAULT_COST", + "VERCEL_AI_GATEWAY_DEFAULT_MAX_TOKENS", + "VERCEL_AI_GATEWAY_DEFAULT_MODEL_ID", "VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF", + "VERCEL_AI_GATEWAY_PROVIDER_ID", ], }, { diff --git a/src/agents/models-config.providers.discovery.ts b/src/agents/models-config.providers.discovery.ts index 4057fbc3e94..e16fb67a2d9 100644 --- a/src/agents/models-config.providers.discovery.ts +++ b/src/agents/models-config.providers.discovery.ts @@ -3,13 +3,13 @@ import type { ModelDefinitionConfig } from "../config/types.models.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { resolveOllamaApiBase } from "../plugin-sdk/provider-models.js"; import { isReasoningModelHeuristic } from "../plugin-sdk/provider-reasoning.js"; +import { SGLANG_DEFAULT_BASE_URL, SGLANG_PROVIDER_LABEL } from "../plugin-sdk/sglang.js"; +import { VLLM_DEFAULT_BASE_URL, VLLM_PROVIDER_LABEL } from "../plugin-sdk/vllm.js"; import { SELF_HOSTED_DEFAULT_CONTEXT_WINDOW, SELF_HOSTED_DEFAULT_COST, SELF_HOSTED_DEFAULT_MAX_TOKENS, } from "./self-hosted-provider-defaults.js"; -import { SGLANG_DEFAULT_BASE_URL, SGLANG_PROVIDER_LABEL } from "./sglang-defaults.js"; -import { VLLM_DEFAULT_BASE_URL, VLLM_PROVIDER_LABEL } from "./vllm-defaults.js"; export { buildHuggingfaceProvider, buildKilocodeProviderWithDiscovery, diff --git a/src/agents/sglang-defaults.ts b/src/agents/sglang-defaults.ts index d91355a8257..3c03bb3a80c 100644 --- a/src/agents/sglang-defaults.ts +++ b/src/agents/sglang-defaults.ts @@ -1,4 +1,7 @@ -export const SGLANG_DEFAULT_BASE_URL = "http://127.0.0.1:30000/v1"; -export const SGLANG_PROVIDER_LABEL = "SGLang"; -export const SGLANG_DEFAULT_API_KEY_ENV_VAR = "SGLANG_API_KEY"; -export const SGLANG_MODEL_PLACEHOLDER = "Qwen/Qwen3-8B"; +// Deprecated compat shim. Prefer openclaw/plugin-sdk/sglang. +export { + SGLANG_DEFAULT_API_KEY_ENV_VAR, + SGLANG_DEFAULT_BASE_URL, + SGLANG_MODEL_PLACEHOLDER, + SGLANG_PROVIDER_LABEL, +} from "../plugin-sdk/sglang.js"; diff --git a/src/agents/vercel-ai-gateway.ts b/src/agents/vercel-ai-gateway.ts index a236474708f..914b1b44e1e 100644 --- a/src/agents/vercel-ai-gateway.ts +++ b/src/agents/vercel-ai-gateway.ts @@ -1,197 +1,12 @@ -import type { ModelDefinitionConfig } from "../config/types.models.js"; -import { createSubsystemLogger } from "../logging/subsystem.js"; - -export const VERCEL_AI_GATEWAY_PROVIDER_ID = "vercel-ai-gateway"; -export const VERCEL_AI_GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh"; -export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_ID = "anthropic/claude-opus-4.6"; -export const VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF = `${VERCEL_AI_GATEWAY_PROVIDER_ID}/${VERCEL_AI_GATEWAY_DEFAULT_MODEL_ID}`; -export const VERCEL_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW = 200_000; -export const VERCEL_AI_GATEWAY_DEFAULT_MAX_TOKENS = 128_000; -export const VERCEL_AI_GATEWAY_DEFAULT_COST = { - input: 0, - output: 0, - cacheRead: 0, - cacheWrite: 0, -} as const; - -const log = createSubsystemLogger("agents/vercel-ai-gateway"); - -type VercelPricingShape = { - input?: number | string; - output?: number | string; - input_cache_read?: number | string; - input_cache_write?: number | string; -}; - -type VercelGatewayModelShape = { - id?: string; - name?: string; - context_window?: number; - max_tokens?: number; - tags?: string[]; - pricing?: VercelPricingShape; -}; - -type VercelGatewayModelsResponse = { - data?: VercelGatewayModelShape[]; -}; - -type StaticVercelGatewayModel = Omit & { - cost?: Partial; -}; - -const STATIC_VERCEL_AI_GATEWAY_MODEL_CATALOG: readonly StaticVercelGatewayModel[] = [ - { - id: "anthropic/claude-opus-4.6", - name: "Claude Opus 4.6", - reasoning: true, - input: ["text", "image"], - contextWindow: 1_000_000, - maxTokens: 128_000, - cost: { - input: 5, - output: 25, - cacheRead: 0.5, - cacheWrite: 6.25, - }, - }, - { - id: "openai/gpt-5.4", - name: "GPT 5.4", - reasoning: true, - input: ["text", "image"], - contextWindow: 200_000, - maxTokens: 128_000, - cost: { - input: 2.5, - output: 15, - cacheRead: 0.25, - }, - }, - { - id: "openai/gpt-5.4-pro", - name: "GPT 5.4 Pro", - reasoning: true, - input: ["text", "image"], - contextWindow: 200_000, - maxTokens: 128_000, - cost: { - input: 30, - output: 180, - cacheRead: 0, - }, - }, -] as const; - -function toPerMillionCost(value: number | string | undefined): number { - const numeric = - typeof value === "number" - ? value - : typeof value === "string" - ? Number.parseFloat(value) - : Number.NaN; - if (!Number.isFinite(numeric) || numeric < 0) { - return 0; - } - return numeric * 1_000_000; -} - -function normalizeCost(pricing?: VercelPricingShape): ModelDefinitionConfig["cost"] { - return { - input: toPerMillionCost(pricing?.input), - output: toPerMillionCost(pricing?.output), - cacheRead: toPerMillionCost(pricing?.input_cache_read), - cacheWrite: toPerMillionCost(pricing?.input_cache_write), - }; -} - -function buildStaticModelDefinition(model: StaticVercelGatewayModel): ModelDefinitionConfig { - return { - id: model.id, - name: model.name, - reasoning: model.reasoning, - input: model.input, - contextWindow: model.contextWindow, - maxTokens: model.maxTokens, - cost: { - ...VERCEL_AI_GATEWAY_DEFAULT_COST, - ...model.cost, - }, - }; -} - -function getStaticFallbackModel(id: string): ModelDefinitionConfig | undefined { - const fallback = STATIC_VERCEL_AI_GATEWAY_MODEL_CATALOG.find((model) => model.id === id); - return fallback ? buildStaticModelDefinition(fallback) : undefined; -} - -export function getStaticVercelAiGatewayModelCatalog(): ModelDefinitionConfig[] { - return STATIC_VERCEL_AI_GATEWAY_MODEL_CATALOG.map(buildStaticModelDefinition); -} - -function buildDiscoveredModelDefinition( - model: VercelGatewayModelShape, -): ModelDefinitionConfig | null { - const id = typeof model.id === "string" ? model.id.trim() : ""; - if (!id) { - return null; - } - - const fallback = getStaticFallbackModel(id); - const contextWindow = - typeof model.context_window === "number" && Number.isFinite(model.context_window) - ? model.context_window - : (fallback?.contextWindow ?? VERCEL_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW); - const maxTokens = - typeof model.max_tokens === "number" && Number.isFinite(model.max_tokens) - ? model.max_tokens - : (fallback?.maxTokens ?? VERCEL_AI_GATEWAY_DEFAULT_MAX_TOKENS); - const normalizedCost = normalizeCost(model.pricing); - - return { - id, - name: (typeof model.name === "string" ? model.name.trim() : "") || fallback?.name || id, - reasoning: - Array.isArray(model.tags) && model.tags.includes("reasoning") - ? true - : (fallback?.reasoning ?? false), - input: Array.isArray(model.tags) - ? model.tags.includes("vision") - ? ["text", "image"] - : ["text"] - : (fallback?.input ?? ["text"]), - contextWindow, - maxTokens, - cost: - normalizedCost.input > 0 || - normalizedCost.output > 0 || - normalizedCost.cacheRead > 0 || - normalizedCost.cacheWrite > 0 - ? normalizedCost - : (fallback?.cost ?? VERCEL_AI_GATEWAY_DEFAULT_COST), - }; -} - -export async function discoverVercelAiGatewayModels(): Promise { - if (process.env.VITEST || process.env.NODE_ENV === "test") { - return getStaticVercelAiGatewayModelCatalog(); - } - - try { - const response = await fetch(`${VERCEL_AI_GATEWAY_BASE_URL}/v1/models`, { - signal: AbortSignal.timeout(5000), - }); - if (!response.ok) { - log.warn(`Failed to discover Vercel AI Gateway models: HTTP ${response.status}`); - return getStaticVercelAiGatewayModelCatalog(); - } - const data = (await response.json()) as VercelGatewayModelsResponse; - const discovered = (data.data ?? []) - .map(buildDiscoveredModelDefinition) - .filter((entry): entry is ModelDefinitionConfig => entry !== null); - return discovered.length > 0 ? discovered : getStaticVercelAiGatewayModelCatalog(); - } catch (error) { - log.warn(`Failed to discover Vercel AI Gateway models: ${String(error)}`); - return getStaticVercelAiGatewayModelCatalog(); - } -} +// Deprecated compat shim. Prefer openclaw/plugin-sdk/vercel-ai-gateway. +export { + discoverVercelAiGatewayModels, + getStaticVercelAiGatewayModelCatalog, + VERCEL_AI_GATEWAY_BASE_URL, + VERCEL_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW, + VERCEL_AI_GATEWAY_DEFAULT_COST, + VERCEL_AI_GATEWAY_DEFAULT_MAX_TOKENS, + VERCEL_AI_GATEWAY_DEFAULT_MODEL_ID, + VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF, + VERCEL_AI_GATEWAY_PROVIDER_ID, +} from "../plugin-sdk/vercel-ai-gateway.js"; diff --git a/src/agents/vllm-defaults.ts b/src/agents/vllm-defaults.ts index 3f2498221f0..5b0c2793a75 100644 --- a/src/agents/vllm-defaults.ts +++ b/src/agents/vllm-defaults.ts @@ -1,4 +1,7 @@ -export const VLLM_DEFAULT_BASE_URL = "http://127.0.0.1:8000/v1"; -export const VLLM_PROVIDER_LABEL = "vLLM"; -export const VLLM_DEFAULT_API_KEY_ENV_VAR = "VLLM_API_KEY"; -export const VLLM_MODEL_PLACEHOLDER = "meta-llama/Meta-Llama-3-8B-Instruct"; +// Deprecated compat shim. Prefer openclaw/plugin-sdk/vllm. +export { + VLLM_DEFAULT_API_KEY_ENV_VAR, + VLLM_DEFAULT_BASE_URL, + VLLM_MODEL_PLACEHOLDER, + VLLM_PROVIDER_LABEL, +} from "../plugin-sdk/vllm.js"; diff --git a/src/plugin-sdk/agent-runtime.ts b/src/plugin-sdk/agent-runtime.ts index 93b20704d51..e17c48b8c32 100644 --- a/src/plugin-sdk/agent-runtime.ts +++ b/src/plugin-sdk/agent-runtime.ts @@ -16,12 +16,12 @@ export * from "../agents/pi-embedded-utils.js"; export * from "../agents/provider-id.js"; export * from "../agents/sandbox-paths.js"; export * from "../agents/schema/typebox.js"; -export * from "../agents/sglang-defaults.js"; +export * from "./sglang.js"; export * from "../agents/tools/common.js"; export * from "../agents/tools/web-guarded-fetch.js"; export * from "../agents/tools/web-shared.js"; export * from "../agents/tools/web-fetch-utils.js"; -export * from "../agents/vllm-defaults.js"; +export * from "./vllm.js"; // Intentional public runtime surface: channel plugins use ingress agent helpers directly. export * from "../agents/agent-command.js"; export * from "../tts/tts.js"; diff --git a/src/plugin-sdk/anthropic-cli.ts b/src/plugin-sdk/anthropic-cli.ts index 0dcd868e398..0896b3f78c9 100644 --- a/src/plugin-sdk/anthropic-cli.ts +++ b/src/plugin-sdk/anthropic-cli.ts @@ -1,5 +1,2 @@ // Generated by scripts/generate-plugin-sdk-facades.mjs. Do not edit manually. -export { - CLAUDE_CLI_BACKEND_ID, - isClaudeCliProvider, -} from "../../extensions/anthropic/cli-shared.js"; +export { CLAUDE_CLI_BACKEND_ID, isClaudeCliProvider } from "../../extensions/anthropic/api.js"; diff --git a/src/plugin-sdk/browser-runtime.ts b/src/plugin-sdk/browser-runtime.ts index 295e7a75894..663c50db9c7 100644 --- a/src/plugin-sdk/browser-runtime.ts +++ b/src/plugin-sdk/browser-runtime.ts @@ -1,2 +1,2 @@ // Generated by scripts/generate-plugin-sdk-facades.mjs. Do not edit manually. -export * from "../../extensions/browser/browser-runtime-api.js"; +export * from "../../extensions/browser/runtime-api.js"; diff --git a/src/plugin-sdk/discord-session-key.ts b/src/plugin-sdk/discord-session-key.ts index 6253e0dde61..5ed6f6b496c 100644 --- a/src/plugin-sdk/discord-session-key.ts +++ b/src/plugin-sdk/discord-session-key.ts @@ -1,2 +1,2 @@ // Generated by scripts/generate-plugin-sdk-facades.mjs. Do not edit manually. -export { normalizeExplicitDiscordSessionKey } from "../../extensions/discord/session-key-api.js"; +export { normalizeExplicitDiscordSessionKey } from "../../extensions/discord/api.js"; diff --git a/src/plugin-sdk/discord-timeouts.ts b/src/plugin-sdk/discord-timeouts.ts index 166d266476c..529b8dadb26 100644 --- a/src/plugin-sdk/discord-timeouts.ts +++ b/src/plugin-sdk/discord-timeouts.ts @@ -2,4 +2,4 @@ export { DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, -} from "../../extensions/discord/timeouts.js"; +} from "../../extensions/discord/api.js"; diff --git a/src/plugin-sdk/feishu-setup.ts b/src/plugin-sdk/feishu-setup.ts index 94ed7122cca..013d381b945 100644 --- a/src/plugin-sdk/feishu-setup.ts +++ b/src/plugin-sdk/feishu-setup.ts @@ -1,2 +1,2 @@ // Generated by scripts/generate-plugin-sdk-facades.mjs. Do not edit manually. -export { feishuSetupAdapter, feishuSetupWizard } from "../../extensions/feishu/setup-api.js"; +export { feishuSetupAdapter, feishuSetupWizard } from "../../extensions/feishu/api.js"; diff --git a/src/plugin-sdk/github-copilot-login.ts b/src/plugin-sdk/github-copilot-login.ts index 5963b5ec99b..903ed9759a4 100644 --- a/src/plugin-sdk/github-copilot-login.ts +++ b/src/plugin-sdk/github-copilot-login.ts @@ -1,2 +1,2 @@ // Generated by scripts/generate-plugin-sdk-facades.mjs. Do not edit manually. -export { githubCopilotLoginCommand } from "../../extensions/github-copilot/login.js"; +export { githubCopilotLoginCommand } from "../../extensions/github-copilot/api.js"; diff --git a/src/plugin-sdk/matrix-helper.ts b/src/plugin-sdk/matrix-helper.ts index 819431073a2..69a8ce60f48 100644 --- a/src/plugin-sdk/matrix-helper.ts +++ b/src/plugin-sdk/matrix-helper.ts @@ -10,4 +10,4 @@ export { resolveMatrixCredentialsPath, resolveMatrixDefaultOrOnlyAccountId, resolveMatrixLegacyFlatStoragePaths, -} from "../../extensions/matrix/helper-api.js"; +} from "../../extensions/matrix/api.js"; diff --git a/src/plugin-sdk/matrix-thread-bindings.ts b/src/plugin-sdk/matrix-thread-bindings.ts index 1034d195fa1..4da938055d3 100644 --- a/src/plugin-sdk/matrix-thread-bindings.ts +++ b/src/plugin-sdk/matrix-thread-bindings.ts @@ -2,4 +2,4 @@ export { setMatrixThreadBindingIdleTimeoutBySessionKey, setMatrixThreadBindingMaxAgeBySessionKey, -} from "../../extensions/matrix/thread-bindings-runtime.js"; +} from "../../extensions/matrix/api.js"; diff --git a/src/plugin-sdk/modelstudio-definitions.ts b/src/plugin-sdk/modelstudio-definitions.ts index eebec9f0bd7..49e09a5807e 100644 --- a/src/plugin-sdk/modelstudio-definitions.ts +++ b/src/plugin-sdk/modelstudio-definitions.ts @@ -7,4 +7,4 @@ export { MODELSTUDIO_DEFAULT_MODEL_ID, MODELSTUDIO_DEFAULT_MODEL_REF, MODELSTUDIO_GLOBAL_BASE_URL, -} from "../../extensions/modelstudio/model-definitions.js"; +} from "../../extensions/modelstudio/api.js"; diff --git a/src/plugin-sdk/modelstudio.ts b/src/plugin-sdk/modelstudio.ts index bf69cb43d2a..c4c10420d63 100644 --- a/src/plugin-sdk/modelstudio.ts +++ b/src/plugin-sdk/modelstudio.ts @@ -1,6 +1,12 @@ // Generated by scripts/generate-plugin-sdk-facades.mjs. Do not edit manually. export { + buildModelStudioDefaultModelDefinition, + buildModelStudioModelDefinition, MODELSTUDIO_BASE_URL, + MODELSTUDIO_CN_BASE_URL, + MODELSTUDIO_DEFAULT_COST, MODELSTUDIO_DEFAULT_MODEL_ID, + MODELSTUDIO_DEFAULT_MODEL_REF, + MODELSTUDIO_GLOBAL_BASE_URL, buildModelStudioProvider, } from "../../extensions/modelstudio/api.js"; diff --git a/src/plugin-sdk/provider-models.ts b/src/plugin-sdk/provider-models.ts index be48a9b332f..0233fe334ff 100644 --- a/src/plugin-sdk/provider-models.ts +++ b/src/plugin-sdk/provider-models.ts @@ -150,4 +150,4 @@ export { MODELSTUDIO_DEFAULT_MODEL_ID, MODELSTUDIO_DEFAULT_MODEL_REF, MODELSTUDIO_GLOBAL_BASE_URL, -} from "./modelstudio-definitions.js"; +} from "./modelstudio.js"; diff --git a/src/plugin-sdk/telegram-allow-from.ts b/src/plugin-sdk/telegram-allow-from.ts index bf40d26ec91..d0671d1a97a 100644 --- a/src/plugin-sdk/telegram-allow-from.ts +++ b/src/plugin-sdk/telegram-allow-from.ts @@ -2,4 +2,4 @@ export { isNumericTelegramUserId, normalizeTelegramAllowFromEntry, -} from "../../extensions/telegram/allow-from.js"; +} from "../../extensions/telegram/api.js"; diff --git a/src/plugin-sdk/vercel-ai-gateway.ts b/src/plugin-sdk/vercel-ai-gateway.ts index fe8a94dee57..b838b95538d 100644 --- a/src/plugin-sdk/vercel-ai-gateway.ts +++ b/src/plugin-sdk/vercel-ai-gateway.ts @@ -4,5 +4,10 @@ export { discoverVercelAiGatewayModels, getStaticVercelAiGatewayModelCatalog, VERCEL_AI_GATEWAY_BASE_URL, + VERCEL_AI_GATEWAY_DEFAULT_CONTEXT_WINDOW, + VERCEL_AI_GATEWAY_DEFAULT_COST, + VERCEL_AI_GATEWAY_DEFAULT_MAX_TOKENS, + VERCEL_AI_GATEWAY_DEFAULT_MODEL_ID, VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF, + VERCEL_AI_GATEWAY_PROVIDER_ID, } from "../../extensions/vercel-ai-gateway/api.js"; diff --git a/src/plugins/bundled-plugin-metadata.generated.ts b/src/plugins/bundled-plugin-metadata.generated.ts index c8b8ebee443..71abaa385ea 100644 --- a/src/plugins/bundled-plugin-metadata.generated.ts +++ b/src/plugins/bundled-plugin-metadata.generated.ts @@ -163,6 +163,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ built: "index.js", }, publicSurfaceArtifacts: [ + "api.js", "cli-backend.js", "cli-migration.js", "cli-shared.js", @@ -870,7 +871,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "provider-catalog.js"], packageName: "@openclaw/byteplus-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw BytePlus provider plugin", @@ -913,7 +914,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/chutes-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Chutes.ai provider plugin", @@ -967,7 +968,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["onboard.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js"], packageName: "@openclaw/cloudflare-ai-gateway-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Cloudflare AI Gateway provider plugin", @@ -1076,7 +1077,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/deepseek-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw DeepSeek provider plugin", @@ -5402,7 +5403,14 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["login.js", "models-defaults.js", "models.js", "token.js", "usage.js"], + publicSurfaceArtifacts: [ + "api.js", + "login.js", + "models-defaults.js", + "models.js", + "token.js", + "usage.js", + ], packageName: "@openclaw/github-copilot-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw GitHub Copilot provider plugin", @@ -5443,6 +5451,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ built: "index.js", }, publicSurfaceArtifacts: [ + "api.js", "cli-backend.js", "gemini-cli-provider.js", "image-generation-provider.js", @@ -6395,7 +6404,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/huggingface-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Hugging Face provider plugin", @@ -7730,7 +7739,13 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js", "shared.js"], + publicSurfaceArtifacts: [ + "api.js", + "onboard.js", + "provider-catalog.js", + "provider-models.js", + "shared.js", + ], packageName: "@openclaw/kilocode-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Kilo Gateway provider plugin", @@ -9571,6 +9586,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ "oauth.runtime.js", "onboard.js", "provider-catalog.js", + "provider-models.js", ], packageName: "@openclaw/minimax-provider", packageVersion: "2026.3.26", @@ -9710,7 +9726,13 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "model-definitions.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: [ + "api.js", + "model-definitions.js", + "models.js", + "onboard.js", + "provider-catalog.js", + ], packageName: "@openclaw/modelstudio-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Model Studio provider plugin", @@ -11340,6 +11362,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ publicSurfaceArtifacts: [ "api.js", "cli-backend.js", + "default-models.js", "image-generation-provider.js", "media-understanding-provider.js", "openai-codex-auth-identity.js", @@ -11410,7 +11433,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["onboard.js"], + publicSurfaceArtifacts: ["api.js", "onboard.js"], packageName: "@openclaw/opencode-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw OpenCode Zen provider plugin", @@ -11453,7 +11476,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["onboard.js"], + publicSurfaceArtifacts: ["api.js", "onboard.js"], packageName: "@openclaw/opencode-go-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw OpenCode Go provider plugin", @@ -11781,6 +11804,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, + publicSurfaceArtifacts: ["api.js", "defaults.js"], packageName: "@openclaw/sglang-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw SGLang provider plugin", @@ -14331,7 +14355,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/synthetic-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Synthetic provider plugin", @@ -16731,7 +16755,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/together-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Together provider plugin", @@ -17008,7 +17032,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/venice-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Venice provider plugin", @@ -17051,7 +17075,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "onboard.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "onboard.js", "provider-catalog.js"], packageName: "@openclaw/vercel-ai-gateway-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Vercel AI Gateway provider plugin", @@ -17094,6 +17118,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, + publicSurfaceArtifacts: ["api.js", "defaults.js"], packageName: "@openclaw/vllm-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw vLLM provider plugin", @@ -17762,7 +17787,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ source: "./index.ts", built: "index.js", }, - publicSurfaceArtifacts: ["api.js", "provider-catalog.js"], + publicSurfaceArtifacts: ["api.js", "models.js", "provider-catalog.js"], packageName: "@openclaw/volcengine-provider", packageVersion: "2026.3.26", packageDescription: "OpenClaw Volcengine provider plugin", @@ -18419,6 +18444,7 @@ export const GENERATED_BUNDLED_PLUGIN_METADATA = [ built: "index.js", }, publicSurfaceArtifacts: [ + "api.js", "model-definitions.js", "onboard.js", "provider-catalog.js", diff --git a/src/plugins/provider-vllm-setup.ts b/src/plugins/provider-vllm-setup.ts index 01f291abbe5..cf07b359c29 100644 --- a/src/plugins/provider-vllm-setup.ts +++ b/src/plugins/provider-vllm-setup.ts @@ -1,10 +1,10 @@ +import type { OpenClawConfig } from "../config/config.js"; import { VLLM_DEFAULT_API_KEY_ENV_VAR, VLLM_DEFAULT_BASE_URL, VLLM_MODEL_PLACEHOLDER, VLLM_PROVIDER_LABEL, -} from "../agents/vllm-defaults.js"; -import type { OpenClawConfig } from "../config/config.js"; +} from "../plugin-sdk/vllm.js"; import type { WizardPrompter } from "../wizard/prompts.js"; import { applyProviderDefaultModel, @@ -14,7 +14,7 @@ import { promptAndConfigureOpenAICompatibleSelfHostedProvider, } from "./provider-self-hosted-setup.js"; -export { VLLM_DEFAULT_BASE_URL } from "../agents/vllm-defaults.js"; +export { VLLM_DEFAULT_BASE_URL } from "../plugin-sdk/vllm.js"; export const VLLM_DEFAULT_CONTEXT_WINDOW = SELF_HOSTED_DEFAULT_CONTEXT_WINDOW; export const VLLM_DEFAULT_MAX_TOKENS = SELF_HOSTED_DEFAULT_MAX_TOKENS; export const VLLM_DEFAULT_COST = SELF_HOSTED_DEFAULT_COST;