refactor: trim transport model helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 21:26:06 +01:00
parent 62e1be2b98
commit 732aa11f2b
9 changed files with 14 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
import type { OpenClawConfig } from "../config/types.js";
export type ProviderModelRef = {
type ProviderModelRef = {
provider: string;
model: string;
};

View File

@@ -6,13 +6,13 @@ import { isMcpConfigRecord, toMcpStringRecord } from "./mcp-config-shared.js";
export type HttpMcpTransportType = "sse" | "streamable-http";
export type HttpMcpServerLaunchConfig = {
type HttpMcpServerLaunchConfig = {
transportType: HttpMcpTransportType;
url: string;
headers?: Record<string, string>;
};
export type HttpMcpServerLaunchResult =
type HttpMcpServerLaunchResult =
| { ok: true; config: HttpMcpServerLaunchConfig }
| { ok: false; reason: string };

View File

@@ -1,6 +1,6 @@
import { isMcpConfigRecord, toMcpEnvRecord, toMcpStringArray } from "./mcp-config-shared.js";
type StdioMcpServerLaunchConfig = {
export type StdioMcpServerLaunchConfig = {
command: string;
args?: string[];
env?: Record<string, string>;
@@ -50,5 +50,3 @@ export function describeStdioMcpServerLaunchConfig(config: StdioMcpServerLaunchC
const cwd = config.cwd ? ` (cwd=${config.cwd})` : "";
return `${config.command}${args}${cwd}`;
}
export type { StdioMcpServerLaunchConfig, StdioMcpServerLaunchResult };

View File

@@ -17,7 +17,7 @@ type ResolvedBaseMcpTransportConfig = {
connectionTimeoutMs: number;
};
export type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
kind: "stdio";
transportType: "stdio";
command: string;
@@ -26,16 +26,14 @@ export type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
cwd?: string;
};
export type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
kind: "http";
transportType: HttpMcpTransportType;
url: string;
headers?: Record<string, string>;
};
export type ResolvedMcpTransportConfig =
| ResolvedStdioMcpTransportConfig
| ResolvedHttpMcpTransportConfig;
type ResolvedMcpTransportConfig = ResolvedStdioMcpTransportConfig | ResolvedHttpMcpTransportConfig;
const DEFAULT_CONNECTION_TIMEOUT_MS = 30_000;

View File

@@ -10,7 +10,7 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
import { OpenClawStdioClientTransport } from "./mcp-stdio-transport.js";
import { resolveMcpTransportConfig } from "./mcp-transport-config.js";
export type ResolvedMcpTransport = {
type ResolvedMcpTransport = {
transport: Transport;
description: string;
transportType: "stdio" | "sse" | "streamable-http";

View File

@@ -3,7 +3,7 @@ import type { ModelCatalogEntry } from "./model-catalog.js";
import { createProviderAuthChecker } from "./model-provider-auth.js";
import { buildAllowedModelSet, buildConfiguredModelCatalog, modelKey } from "./model-selection.js";
export type ModelCatalogVisibilityView = "default" | "configured" | "all";
type ModelCatalogVisibilityView = "default" | "configured" | "all";
function sortModelCatalogEntries(entries: ModelCatalogEntry[]): ModelCatalogEntry[] {
return entries.toSorted(

View File

@@ -3,7 +3,7 @@ import { normalizeAgentId } from "../routing/session-key.js";
import { resolveAgentRuntimePolicy } from "./agent-runtime-policy.js";
import { normalizeProviderId } from "./provider-id.js";
export type LegacyRuntimeModelProviderAlias = {
type LegacyRuntimeModelProviderAlias = {
/** Legacy provider id that encoded the runtime in the model ref. */
legacyProvider: string;
/** Canonical provider id that should own model selection. */
@@ -50,7 +50,7 @@ export function listLegacyRuntimeModelProviderAliases(): readonly LegacyRuntimeM
return LEGACY_RUNTIME_MODEL_PROVIDER_ALIASES;
}
export function resolveLegacyRuntimeModelProviderAlias(
function resolveLegacyRuntimeModelProviderAlias(
provider: string,
): LegacyRuntimeModelProviderAlias | undefined {
return LEGACY_ALIAS_BY_PROVIDER.get(normalizeProviderId(provider));

View File

@@ -2,12 +2,12 @@ import crypto from "node:crypto";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { normalizeOptionalString } from "../shared/string-coerce.js";
export type OwnerDisplaySetting = {
type OwnerDisplaySetting = {
ownerDisplay?: "raw" | "hash";
ownerDisplaySecret?: string;
};
export type OwnerDisplaySecretResolution = {
type OwnerDisplaySecretResolution = {
config: OpenClawConfig;
generatedSecret?: string;
};

View File

@@ -2,7 +2,7 @@ import crypto from "node:crypto";
import { estimateBase64DecodedBytes } from "../media/base64.js";
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
export const REDACTED_IMAGE_DATA = "<redacted>";
const REDACTED_IMAGE_DATA = "<redacted>";
const NON_CREDENTIAL_FIELD_NAMES = new Set([
"passwordfile",