From ba21070a575db1350059822fc4324dfc600749c7 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 03:03:22 +0100 Subject: [PATCH] refactor: trim flow contribution exports --- src/flows/channel-setup.prompts.ts | 2 +- src/flows/channel-setup.status.ts | 4 ++-- src/flows/provider-flow.runtime.ts | 4 ++-- src/flows/provider-flow.ts | 8 +++----- src/flows/search-setup.ts | 6 +++--- src/flows/types.ts | 8 ++++---- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/flows/channel-setup.prompts.ts b/src/flows/channel-setup.prompts.ts index 64781863f21..0241f0e2f9a 100644 --- a/src/flows/channel-setup.prompts.ts +++ b/src/flows/channel-setup.prompts.ts @@ -13,7 +13,7 @@ import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "../routing/session-key.j import { formatDocsLink } from "../terminal/links.js"; import type { WizardPrompter, WizardSelectOption } from "../wizard/prompts.js"; -export type ConfiguredChannelAction = "update" | "disable" | "delete" | "skip"; +type ConfiguredChannelAction = "update" | "disable" | "delete" | "skip"; export function formatAccountLabel(accountId: string): string { return accountId === DEFAULT_ACCOUNT_ID ? "default (primary)" : accountId; diff --git a/src/flows/channel-setup.status.ts b/src/flows/channel-setup.status.ts index 491d088d6fc..d6a32e1850e 100644 --- a/src/flows/channel-setup.status.ts +++ b/src/flows/channel-setup.status.ts @@ -27,7 +27,7 @@ import { sanitizeTerminalText } from "../terminal/safe-text.js"; import type { WizardPrompter } from "../wizard/prompts.js"; import type { FlowContribution } from "./types.js"; -export type ChannelStatusSummary = { +type ChannelStatusSummary = { installedPlugins: ChannelSetupPlugin[]; catalogEntries: ReturnType; installedCatalogEntries: ReturnType; @@ -35,7 +35,7 @@ export type ChannelStatusSummary = { statusLines: string[]; }; -export type ChannelSetupSelectionContribution = FlowContribution & { +type ChannelSetupSelectionContribution = FlowContribution & { kind: "channel"; surface: "setup"; channel: ChannelChoice; diff --git a/src/flows/provider-flow.runtime.ts b/src/flows/provider-flow.runtime.ts index 1fdba8c7fd4..f36a464729c 100644 --- a/src/flows/provider-flow.runtime.ts +++ b/src/flows/provider-flow.runtime.ts @@ -9,9 +9,9 @@ import { normalizeOptionalString } from "../shared/string-coerce.js"; import type { FlowContribution } from "./types.js"; import { sortFlowContributionsByLabel } from "./types.js"; -export type ProviderModelPickerFlowEntry = ProviderModelPickerEntry; +type ProviderModelPickerFlowEntry = ProviderModelPickerEntry; -export type ProviderModelPickerFlowContribution = FlowContribution & { +type ProviderModelPickerFlowContribution = FlowContribution & { kind: "provider"; surface: "model-picker"; providerId: string; diff --git a/src/flows/provider-flow.ts b/src/flows/provider-flow.ts index 2b1e192814a..e6959666a66 100644 --- a/src/flows/provider-flow.ts +++ b/src/flows/provider-flow.ts @@ -5,15 +5,15 @@ import { resolveProviderInstallCatalogEntries } from "../plugins/provider-instal import type { FlowContribution, FlowOption } from "./types.js"; import { sortFlowContributionsByLabel } from "./types.js"; -export type ProviderFlowScope = "text-inference" | "image-generation"; +type ProviderFlowScope = "text-inference" | "image-generation"; const DEFAULT_PROVIDER_FLOW_SCOPE: ProviderFlowScope = "text-inference"; -export type ProviderSetupFlowOption = FlowOption & { +type ProviderSetupFlowOption = FlowOption & { onboardingScopes?: ProviderFlowScope[]; }; -export type ProviderSetupFlowContribution = FlowContribution & { +type ProviderSetupFlowContribution = FlowContribution & { kind: "provider"; surface: "setup"; providerId: string; @@ -151,5 +151,3 @@ export function resolveProviderSetupFlowContributions(params?: { }).filter((contribution) => !seenOptionValues.has(contribution.option.value)); return sortFlowContributionsByLabel([...manifestContributions, ...installCatalogContributions]); } - -export { includesProviderFlowScope }; diff --git a/src/flows/search-setup.ts b/src/flows/search-setup.ts index 8b2c0169daf..947911482a0 100644 --- a/src/flows/search-setup.ts +++ b/src/flows/search-setup.ts @@ -23,11 +23,11 @@ export type SearchProvider = NonNullable< type SearchConfig = NonNullable["web"]>["search"]>; type MutableSearchConfig = SearchConfig & Record; -export type SearchProviderSetupOption = FlowOption & { +type SearchProviderSetupOption = FlowOption & { value: SearchProvider; }; -export type SearchProviderSetupContribution = FlowContribution & { +type SearchProviderSetupContribution = FlowContribution & { kind: "search"; surface: "setup"; provider: PluginWebSearchProviderEntry; @@ -83,7 +83,7 @@ function buildSearchProviderSetupContribution(params: { }; } -export function resolveSearchProviderSetupContributions( +function resolveSearchProviderSetupContributions( config?: OpenClawConfig, ): SearchProviderSetupContribution[] { const providers = sortWebSearchProviders( diff --git a/src/flows/types.ts b/src/flows/types.ts index 7c782e47faa..b41636f1d06 100644 --- a/src/flows/types.ts +++ b/src/flows/types.ts @@ -1,13 +1,13 @@ -export type FlowDocsLink = { +type FlowDocsLink = { path: string; label?: string; }; -export type FlowContributionKind = "channel" | "core" | "provider" | "search"; +type FlowContributionKind = "channel" | "core" | "provider" | "search"; -export type FlowContributionSurface = "auth-choice" | "health" | "model-picker" | "setup"; +type FlowContributionSurface = "auth-choice" | "health" | "model-picker" | "setup"; -export type FlowOptionGroup = { +type FlowOptionGroup = { id: string; label: string; hint?: string;