mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:10:49 +00:00
refactor: trim transport model helper exports
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { OpenClawConfig } from "../config/types.js";
|
||||
|
||||
export type ProviderModelRef = {
|
||||
type ProviderModelRef = {
|
||||
provider: string;
|
||||
model: string;
|
||||
};
|
||||
|
||||
@@ -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 };
|
||||
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user