From 5c3043bb3759c5187f793823f380e7a37dc2b643 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 01:54:25 +0100 Subject: [PATCH] refactor: trim auth cli type exports --- src/channels/plugins/bundled.ts | 12 ++++++------ src/channels/plugins/package-state-probes.ts | 10 +++++----- src/cli/outbound-send-mapping.ts | 2 +- src/commands/auth-choice-options.static.ts | 2 -- src/commands/auth-choice.apply.ts | 2 -- src/commands/onboard-types.ts | 2 +- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/channels/plugins/bundled.ts b/src/channels/plugins/bundled.ts index 98972fa8ccb..0e4f2e0da93 100644 --- a/src/channels/plugins/bundled.ts +++ b/src/channels/plugins/bundled.ts @@ -13,12 +13,12 @@ import { type BundledChannelPluginMetadata, } from "../../plugins/bundled-channel-runtime.js"; import { normalizePluginsConfig } from "../../plugins/config-state.js"; -import { - getCachedPluginJitiLoader, - type PluginJitiLoaderCache, -} from "../../plugins/jiti-loader-cache.js"; import { passesManifestOwnerBasePolicy } from "../../plugins/manifest-owner-policy.js"; import { unwrapDefaultModuleExport } from "../../plugins/module-export.js"; +import { + getCachedPluginModuleLoader, + type PluginModuleLoaderCache, +} from "../../plugins/plugin-module-loader-cache.js"; import type { PluginRuntime } from "../../plugins/runtime/types.js"; import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"; import { resolveBundledChannelRootScope, type BundledChannelRootScope } from "./bundled-root.js"; @@ -94,7 +94,7 @@ type BundledChannelLoadContext = { const log = createSubsystemLogger("channels"); const MAX_BUNDLED_CHANNEL_LOAD_CONTEXTS = 32; const bundledChannelLoadContextsByRoot = new Map(); -const sourceBundledEntryLoaderCache: PluginJitiLoaderCache = new Map(); +const sourceBundledEntryLoaderCache: PluginModuleLoaderCache = new Map(); function isSourceModulePath(modulePath: string): boolean { return /\.(?:c|m)?tsx?$/iu.test(modulePath); @@ -223,7 +223,7 @@ function loadGeneratedBundledChannelModule(params: { if (!isSourceModulePath(modulePath)) { throw error; } - const loader = getCachedPluginJitiLoader({ + const loader = getCachedPluginModuleLoader({ cache: sourceBundledEntryLoaderCache, modulePath, importerUrl: import.meta.url, diff --git a/src/channels/plugins/package-state-probes.ts b/src/channels/plugins/package-state-probes.ts index caea7403356..b922b596bb0 100644 --- a/src/channels/plugins/package-state-probes.ts +++ b/src/channels/plugins/package-state-probes.ts @@ -6,9 +6,9 @@ import { type PluginChannelCatalogEntry, } from "../../plugins/channel-catalog-registry.js"; import { - getCachedPluginJitiLoader, - type PluginJitiLoaderCache, -} from "../../plugins/jiti-loader-cache.js"; + getCachedPluginModuleLoader, + type PluginModuleLoaderCache, +} from "../../plugins/plugin-module-loader-cache.js"; import { normalizeOptionalString } from "../../shared/string-coerce.js"; import { loadChannelPluginModule, resolveExistingPluginModulePath } from "./module-loader.js"; @@ -29,7 +29,7 @@ type ChannelPackageStateMetadata = { export type ChannelPackageStateMetadataKey = "configuredState" | "persistedAuthState"; const log = createSubsystemLogger("channels"); -const sourcePackageStateLoaderCache: PluginJitiLoaderCache = new Map(); +const sourcePackageStateLoaderCache: PluginModuleLoaderCache = new Map(); function isSourceModulePath(modulePath: string): boolean { return /\.(?:c|m)?tsx?$/iu.test(modulePath); @@ -42,7 +42,7 @@ function loadChannelPackageStateModule(params: { modulePath: string; rootDir: st if (!isSourceModulePath(params.modulePath)) { throw error; } - const loader = getCachedPluginJitiLoader({ + const loader = getCachedPluginModuleLoader({ cache: sourcePackageStateLoaderCache, modulePath: params.modulePath, importerUrl: import.meta.url, diff --git a/src/cli/outbound-send-mapping.ts b/src/cli/outbound-send-mapping.ts index 2464452c126..70b177b7868 100644 --- a/src/cli/outbound-send-mapping.ts +++ b/src/cli/outbound-send-mapping.ts @@ -12,7 +12,7 @@ export const CLI_OUTBOUND_SEND_FACTORY: unique symbol = Symbol.for( "openclaw.cliOutboundSendFactory", ) as never; -export type CliOutboundSendFactory = (channelId: string) => unknown; +type CliOutboundSendFactory = (channelId: string) => unknown; export type CliOutboundSendSource = { [channelId: string]: unknown; [CLI_OUTBOUND_SEND_FACTORY]?: CliOutboundSendFactory; diff --git a/src/commands/auth-choice-options.static.ts b/src/commands/auth-choice-options.static.ts index da25536b9aa..b0d15f894f5 100644 --- a/src/commands/auth-choice-options.static.ts +++ b/src/commands/auth-choice-options.static.ts @@ -1,8 +1,6 @@ import { resolveLegacyAuthChoiceAliasesForCli } from "./auth-choice-legacy.js"; import type { AuthChoice, AuthChoiceGroupId } from "./onboard-types.js"; -export type { AuthChoiceGroupId }; - export type AuthChoiceOption = { value: AuthChoice; label: string; diff --git a/src/commands/auth-choice.apply.ts b/src/commands/auth-choice.apply.ts index f79b9ee3de8..47138083005 100644 --- a/src/commands/auth-choice.apply.ts +++ b/src/commands/auth-choice.apply.ts @@ -2,8 +2,6 @@ import { applyAuthChoiceLoadedPluginProvider } from "../plugins/provider-auth-ch import type { ApplyAuthChoiceParams, ApplyAuthChoiceResult } from "./auth-choice.apply.types.js"; import type { AuthChoice } from "./onboard-types.js"; -export type { ApplyAuthChoiceParams, ApplyAuthChoiceResult } from "./auth-choice.apply.types.js"; - async function normalizeLegacyChoice( authChoice: AuthChoice | undefined, params: Pick, diff --git a/src/commands/onboard-types.ts b/src/commands/onboard-types.ts index afb2613ddc0..5e7769379d5 100644 --- a/src/commands/onboard-types.ts +++ b/src/commands/onboard-types.ts @@ -7,7 +7,7 @@ export type OnboardMode = "local" | "remote"; * Auth choices are plugin-owned contract ids plus a few legacy aliases that * are normalized elsewhere (for example `oauth` -> `setup-token`). */ -export type BuiltInAuthChoice = +type BuiltInAuthChoice = /** @deprecated Use `setup-token`. */ "oauth" | "setup-token" | "token" | "apiKey" | "custom-api-key" | "skip"; export type AuthChoice = BuiltInAuthChoice | (string & {});