refactor: trim transport model helper exports · openclaw/openclaw@732aa11
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { OpenClawConfig } from "../config/types.js"; |
2 | 2 | |
3 | | -export type ProviderModelRef = { |
| 3 | +type ProviderModelRef = { |
4 | 4 | provider: string; |
5 | 5 | model: string; |
6 | 6 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,13 +6,13 @@ import { isMcpConfigRecord, toMcpStringRecord } from "./mcp-config-shared.js";
|
6 | 6 | |
7 | 7 | export type HttpMcpTransportType = "sse" | "streamable-http"; |
8 | 8 | |
9 | | -export type HttpMcpServerLaunchConfig = { |
| 9 | +type HttpMcpServerLaunchConfig = { |
10 | 10 | transportType: HttpMcpTransportType; |
11 | 11 | url: string; |
12 | 12 | headers?: Record<string, string>; |
13 | 13 | }; |
14 | 14 | |
15 | | -export type HttpMcpServerLaunchResult = |
| 15 | +type HttpMcpServerLaunchResult = |
16 | 16 | | { ok: true; config: HttpMcpServerLaunchConfig } |
17 | 17 | | { ok: false; reason: string }; |
18 | 18 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { isMcpConfigRecord, toMcpEnvRecord, toMcpStringArray } from "./mcp-config-shared.js"; |
2 | 2 | |
3 | | -type StdioMcpServerLaunchConfig = { |
| 3 | +export type StdioMcpServerLaunchConfig = { |
4 | 4 | command: string; |
5 | 5 | args?: string[]; |
6 | 6 | env?: Record<string, string>; |
@@ -50,5 +50,3 @@ export function describeStdioMcpServerLaunchConfig(config: StdioMcpServerLaunchC
|
50 | 50 | const cwd = config.cwd ? ` (cwd=${config.cwd})` : ""; |
51 | 51 | return `${config.command}${args}${cwd}`; |
52 | 52 | } |
53 | | - |
54 | | -export type { StdioMcpServerLaunchConfig, StdioMcpServerLaunchResult }; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,7 +17,7 @@ type ResolvedBaseMcpTransportConfig = {
|
17 | 17 | connectionTimeoutMs: number; |
18 | 18 | }; |
19 | 19 | |
20 | | -export type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & { |
| 20 | +type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & { |
21 | 21 | kind: "stdio"; |
22 | 22 | transportType: "stdio"; |
23 | 23 | command: string; |
@@ -26,16 +26,14 @@ export type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
|
26 | 26 | cwd?: string; |
27 | 27 | }; |
28 | 28 | |
29 | | -export type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & { |
| 29 | +type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & { |
30 | 30 | kind: "http"; |
31 | 31 | transportType: HttpMcpTransportType; |
32 | 32 | url: string; |
33 | 33 | headers?: Record<string, string>; |
34 | 34 | }; |
35 | 35 | |
36 | | -export type ResolvedMcpTransportConfig = |
37 | | -| ResolvedStdioMcpTransportConfig |
38 | | -| ResolvedHttpMcpTransportConfig; |
| 36 | +type ResolvedMcpTransportConfig = ResolvedStdioMcpTransportConfig | ResolvedHttpMcpTransportConfig; |
39 | 37 | |
40 | 38 | const DEFAULT_CONNECTION_TIMEOUT_MS = 30_000; |
41 | 39 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
|
10 | 10 | import { OpenClawStdioClientTransport } from "./mcp-stdio-transport.js"; |
11 | 11 | import { resolveMcpTransportConfig } from "./mcp-transport-config.js"; |
12 | 12 | |
13 | | -export type ResolvedMcpTransport = { |
| 13 | +type ResolvedMcpTransport = { |
14 | 14 | transport: Transport; |
15 | 15 | description: string; |
16 | 16 | transportType: "stdio" | "sse" | "streamable-http"; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import type { ModelCatalogEntry } from "./model-catalog.js";
|
3 | 3 | import { createProviderAuthChecker } from "./model-provider-auth.js"; |
4 | 4 | import { buildAllowedModelSet, buildConfiguredModelCatalog, modelKey } from "./model-selection.js"; |
5 | 5 | |
6 | | -export type ModelCatalogVisibilityView = "default" | "configured" | "all"; |
| 6 | +type ModelCatalogVisibilityView = "default" | "configured" | "all"; |
7 | 7 | |
8 | 8 | function sortModelCatalogEntries(entries: ModelCatalogEntry[]): ModelCatalogEntry[] { |
9 | 9 | return entries.toSorted( |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ import { normalizeAgentId } from "../routing/session-key.js";
|
3 | 3 | import { resolveAgentRuntimePolicy } from "./agent-runtime-policy.js"; |
4 | 4 | import { normalizeProviderId } from "./provider-id.js"; |
5 | 5 | |
6 | | -export type LegacyRuntimeModelProviderAlias = { |
| 6 | +type LegacyRuntimeModelProviderAlias = { |
7 | 7 | /** Legacy provider id that encoded the runtime in the model ref. */ |
8 | 8 | legacyProvider: string; |
9 | 9 | /** Canonical provider id that should own model selection. */ |
@@ -50,7 +50,7 @@ export function listLegacyRuntimeModelProviderAliases(): readonly LegacyRuntimeM
|
50 | 50 | return LEGACY_RUNTIME_MODEL_PROVIDER_ALIASES; |
51 | 51 | } |
52 | 52 | |
53 | | -export function resolveLegacyRuntimeModelProviderAlias( |
| 53 | +function resolveLegacyRuntimeModelProviderAlias( |
54 | 54 | provider: string, |
55 | 55 | ): LegacyRuntimeModelProviderAlias | undefined { |
56 | 56 | return LEGACY_ALIAS_BY_PROVIDER.get(normalizeProviderId(provider)); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,12 +2,12 @@ import crypto from "node:crypto";
|
2 | 2 | import type { OpenClawConfig } from "../config/types.openclaw.js"; |
3 | 3 | import { normalizeOptionalString } from "../shared/string-coerce.js"; |
4 | 4 | |
5 | | -export type OwnerDisplaySetting = { |
| 5 | +type OwnerDisplaySetting = { |
6 | 6 | ownerDisplay?: "raw" | "hash"; |
7 | 7 | ownerDisplaySecret?: string; |
8 | 8 | }; |
9 | 9 | |
10 | | -export type OwnerDisplaySecretResolution = { |
| 10 | +type OwnerDisplaySecretResolution = { |
11 | 11 | config: OpenClawConfig; |
12 | 12 | generatedSecret?: string; |
13 | 13 | }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@ import crypto from "node:crypto";
|
2 | 2 | import { estimateBase64DecodedBytes } from "../media/base64.js"; |
3 | 3 | import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js"; |
4 | 4 | |
5 | | -export const REDACTED_IMAGE_DATA = "<redacted>"; |
| 5 | +const REDACTED_IMAGE_DATA = "<redacted>"; |
6 | 6 | |
7 | 7 | const NON_CREDENTIAL_FIELD_NAMES = new Set([ |
8 | 8 | "passwordfile", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。