refactor: trim auth cli type exports

This commit is contained in:
Peter Steinberger
2026-05-02 01:54:25 +01:00
parent 5046cbc6f9
commit 5c3043bb37
6 changed files with 13 additions and 17 deletions

View File

@@ -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<string, BundledChannelLoadContext>();
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,

View File

@@ -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,

View File

@@ -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;

View File

@@ -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;

View File

@@ -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<ApplyAuthChoiceParams, "config" | "env">,

View File

@@ -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 & {});