mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:50:43 +00:00
refactor: hide infra helper internals
This commit is contained in:
@@ -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}`;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 ?? "");
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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<RestartSentinel | null> {
|
||||
|
||||
Reference in New Issue
Block a user