mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:50:43 +00:00
refactor: trim flow contribution exports
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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<typeof listChannelPluginCatalogEntries>;
|
||||
installedCatalogEntries: ReturnType<typeof listChannelPluginCatalogEntries>;
|
||||
@@ -35,7 +35,7 @@ export type ChannelStatusSummary = {
|
||||
statusLines: string[];
|
||||
};
|
||||
|
||||
export type ChannelSetupSelectionContribution = FlowContribution & {
|
||||
type ChannelSetupSelectionContribution = FlowContribution & {
|
||||
kind: "channel";
|
||||
surface: "setup";
|
||||
channel: ChannelChoice;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -23,11 +23,11 @@ export type SearchProvider = NonNullable<
|
||||
type SearchConfig = NonNullable<NonNullable<NonNullable<OpenClawConfig["tools"]>["web"]>["search"]>;
|
||||
type MutableSearchConfig = SearchConfig & Record<string, unknown>;
|
||||
|
||||
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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user