From 2cc79ff184b2b3e0d85eb365b7d648682bf246d5 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 07:02:28 +0100 Subject: [PATCH] refactor: hide infra helper internals --- src/infra/clawhub.ts | 2 +- src/infra/net/proxy/proxy-validation.ts | 2 +- src/infra/outbound/channel-target-prefix.ts | 2 +- src/infra/outbound/message-action-params.ts | 2 +- src/infra/restart-sentinel.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/infra/clawhub.ts b/src/infra/clawhub.ts index e7c169ba6cc..02cac31d946 100644 --- a/src/infra/clawhub.ts +++ b/src/infra/clawhub.ts @@ -467,7 +467,7 @@ export function resolveClawHubBaseUrl(baseUrl?: string): string { return normalizeBaseUrl(baseUrl); } -export function formatSha256Integrity(bytes: Uint8Array): string { +function formatSha256Integrity(bytes: Uint8Array): string { const digest = createHash("sha256").update(bytes).digest("base64"); return `sha256-${digest}`; } diff --git a/src/infra/net/proxy/proxy-validation.ts b/src/infra/net/proxy/proxy-validation.ts index 71463fee3b1..e7dca108d5a 100644 --- a/src/infra/net/proxy/proxy-validation.ts +++ b/src/infra/net/proxy/proxy-validation.ts @@ -6,7 +6,7 @@ import { createHttp1ProxyAgent } from "../undici-runtime.js"; export const DEFAULT_PROXY_VALIDATION_ALLOWED_URLS = ["https://example.com/"] as const; -export const DEFAULT_PROXY_VALIDATION_TIMEOUT_MS = 5000; +const DEFAULT_PROXY_VALIDATION_TIMEOUT_MS = 5000; const DENIED_CANARY_HEADER = "x-openclaw-proxy-validation-canary"; export type ProxyValidationConfigSource = "override" | "config" | "env" | "missing" | "disabled"; diff --git a/src/infra/outbound/channel-target-prefix.ts b/src/infra/outbound/channel-target-prefix.ts index a60a0ea0794..2e5c3fefa7e 100644 --- a/src/infra/outbound/channel-target-prefix.ts +++ b/src/infra/outbound/channel-target-prefix.ts @@ -39,7 +39,7 @@ function resolvePluginTargetPrefix(prefix: string): string | undefined { return undefined; } -export function resolveChannelTargetProviderPrefix( +function resolveChannelTargetProviderPrefix( raw?: string | null, ): ChannelTargetProviderPrefix | undefined { const match = /^\s*([a-z][a-z0-9_-]*):/i.exec(raw ?? ""); diff --git a/src/infra/outbound/message-action-params.ts b/src/infra/outbound/message-action-params.ts index 08ab16b52c2..78f079025a6 100644 --- a/src/infra/outbound/message-action-params.ts +++ b/src/infra/outbound/message-action-params.ts @@ -22,7 +22,7 @@ import { hasPotentialPluginActionParam } from "./message-action-param-keys.js"; export const readBooleanParam = readBooleanParamShared; -export const BASE_ACTION_MEDIA_SOURCE_PARAM_KEYS = [ +const BASE_ACTION_MEDIA_SOURCE_PARAM_KEYS = [ "media", "path", "filePath", diff --git a/src/infra/restart-sentinel.ts b/src/infra/restart-sentinel.ts index 879d55658ec..376a850e649 100644 --- a/src/infra/restart-sentinel.ts +++ b/src/infra/restart-sentinel.ts @@ -96,7 +96,7 @@ function cloneRestartSentinelPayload(payload: RestartSentinelPayload): RestartSe return JSON.parse(JSON.stringify(payload)) as RestartSentinelPayload; } -export async function rewriteRestartSentinel( +async function rewriteRestartSentinel( rewrite: (payload: RestartSentinelPayload) => RestartSentinelPayload | null, env: NodeJS.ProcessEnv = process.env, ): Promise {