Skip to content

Commit 732aa11

Browse files
committed
refactor: trim transport model helper exports
1 parent 62e1be2 commit 732aa11

9 files changed

Lines changed: 14 additions & 18 deletions

src/agents/configured-provider-fallback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { OpenClawConfig } from "../config/types.js";
22

3-
export type ProviderModelRef = {
3+
type ProviderModelRef = {
44
provider: string;
55
model: string;
66
};

src/agents/mcp-http.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import { isMcpConfigRecord, toMcpStringRecord } from "./mcp-config-shared.js";
66

77
export type HttpMcpTransportType = "sse" | "streamable-http";
88

9-
export type HttpMcpServerLaunchConfig = {
9+
type HttpMcpServerLaunchConfig = {
1010
transportType: HttpMcpTransportType;
1111
url: string;
1212
headers?: Record<string, string>;
1313
};
1414

15-
export type HttpMcpServerLaunchResult =
15+
type HttpMcpServerLaunchResult =
1616
| { ok: true; config: HttpMcpServerLaunchConfig }
1717
| { ok: false; reason: string };
1818

src/agents/mcp-stdio.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isMcpConfigRecord, toMcpEnvRecord, toMcpStringArray } from "./mcp-config-shared.js";
22

3-
type StdioMcpServerLaunchConfig = {
3+
export type StdioMcpServerLaunchConfig = {
44
command: string;
55
args?: string[];
66
env?: Record<string, string>;
@@ -50,5 +50,3 @@ export function describeStdioMcpServerLaunchConfig(config: StdioMcpServerLaunchC
5050
const cwd = config.cwd ? ` (cwd=${config.cwd})` : "";
5151
return `${config.command}${args}${cwd}`;
5252
}
53-
54-
export type { StdioMcpServerLaunchConfig, StdioMcpServerLaunchResult };

src/agents/mcp-transport-config.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type ResolvedBaseMcpTransportConfig = {
1717
connectionTimeoutMs: number;
1818
};
1919

20-
export type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
20+
type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
2121
kind: "stdio";
2222
transportType: "stdio";
2323
command: string;
@@ -26,16 +26,14 @@ export type ResolvedStdioMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
2626
cwd?: string;
2727
};
2828

29-
export type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
29+
type ResolvedHttpMcpTransportConfig = ResolvedBaseMcpTransportConfig & {
3030
kind: "http";
3131
transportType: HttpMcpTransportType;
3232
url: string;
3333
headers?: Record<string, string>;
3434
};
3535

36-
export type ResolvedMcpTransportConfig =
37-
| ResolvedStdioMcpTransportConfig
38-
| ResolvedHttpMcpTransportConfig;
36+
type ResolvedMcpTransportConfig = ResolvedStdioMcpTransportConfig | ResolvedHttpMcpTransportConfig;
3937

4038
const DEFAULT_CONNECTION_TIMEOUT_MS = 30_000;
4139

src/agents/mcp-transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
1010
import { OpenClawStdioClientTransport } from "./mcp-stdio-transport.js";
1111
import { resolveMcpTransportConfig } from "./mcp-transport-config.js";
1212

13-
export type ResolvedMcpTransport = {
13+
type ResolvedMcpTransport = {
1414
transport: Transport;
1515
description: string;
1616
transportType: "stdio" | "sse" | "streamable-http";

src/agents/model-catalog-visibility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { ModelCatalogEntry } from "./model-catalog.js";
33
import { createProviderAuthChecker } from "./model-provider-auth.js";
44
import { buildAllowedModelSet, buildConfiguredModelCatalog, modelKey } from "./model-selection.js";
55

6-
export type ModelCatalogVisibilityView = "default" | "configured" | "all";
6+
type ModelCatalogVisibilityView = "default" | "configured" | "all";
77

88
function sortModelCatalogEntries(entries: ModelCatalogEntry[]): ModelCatalogEntry[] {
99
return entries.toSorted(

src/agents/model-runtime-aliases.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { normalizeAgentId } from "../routing/session-key.js";
33
import { resolveAgentRuntimePolicy } from "./agent-runtime-policy.js";
44
import { normalizeProviderId } from "./provider-id.js";
55

6-
export type LegacyRuntimeModelProviderAlias = {
6+
type LegacyRuntimeModelProviderAlias = {
77
/** Legacy provider id that encoded the runtime in the model ref. */
88
legacyProvider: string;
99
/** Canonical provider id that should own model selection. */
@@ -50,7 +50,7 @@ export function listLegacyRuntimeModelProviderAliases(): readonly LegacyRuntimeM
5050
return LEGACY_RUNTIME_MODEL_PROVIDER_ALIASES;
5151
}
5252

53-
export function resolveLegacyRuntimeModelProviderAlias(
53+
function resolveLegacyRuntimeModelProviderAlias(
5454
provider: string,
5555
): LegacyRuntimeModelProviderAlias | undefined {
5656
return LEGACY_ALIAS_BY_PROVIDER.get(normalizeProviderId(provider));

src/agents/owner-display.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import crypto from "node:crypto";
22
import type { OpenClawConfig } from "../config/types.openclaw.js";
33
import { normalizeOptionalString } from "../shared/string-coerce.js";
44

5-
export type OwnerDisplaySetting = {
5+
type OwnerDisplaySetting = {
66
ownerDisplay?: "raw" | "hash";
77
ownerDisplaySecret?: string;
88
};
99

10-
export type OwnerDisplaySecretResolution = {
10+
type OwnerDisplaySecretResolution = {
1111
config: OpenClawConfig;
1212
generatedSecret?: string;
1313
};

src/agents/payload-redaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import crypto from "node:crypto";
22
import { estimateBase64DecodedBytes } from "../media/base64.js";
33
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
44

5-
export const REDACTED_IMAGE_DATA = "<redacted>";
5+
const REDACTED_IMAGE_DATA = "<redacted>";
66

77
const NON_CREDENTIAL_FIELD_NAMES = new Set([
88
"passwordfile",

0 commit comments

Comments
 (0)