mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
refactor: hide gateway helper internals
This commit is contained in:
@@ -11,7 +11,7 @@ export type GatewayClientStartReadinessOptions = {
|
||||
signal?: AbortSignal;
|
||||
};
|
||||
|
||||
export function resolveGatewayClientStartReadinessTimeoutMs(
|
||||
function resolveGatewayClientStartReadinessTimeoutMs(
|
||||
options: GatewayClientStartReadinessOptions = {},
|
||||
): number {
|
||||
if (typeof options.timeoutMs === "number" && Number.isFinite(options.timeoutMs)) {
|
||||
|
||||
@@ -36,7 +36,7 @@ export {
|
||||
export const OPENCLAW_MODEL_ID = "openclaw";
|
||||
export const OPENCLAW_DEFAULT_MODEL_ID = "openclaw/default";
|
||||
|
||||
export function resolveAgentIdFromHeader(req: IncomingMessage): string | undefined {
|
||||
function resolveAgentIdFromHeader(req: IncomingMessage): string | undefined {
|
||||
const raw =
|
||||
normalizeOptionalString(getHeader(req, "x-openclaw-agent-id")) ||
|
||||
normalizeOptionalString(getHeader(req, "x-openclaw-agent")) ||
|
||||
@@ -126,7 +126,7 @@ export function resolveAgentIdForRequest(params: {
|
||||
return fromModel ?? resolveDefaultAgentId(cfg);
|
||||
}
|
||||
|
||||
export function resolveSessionKey(params: {
|
||||
function resolveSessionKey(params: {
|
||||
req: IncomingMessage;
|
||||
agentId: string;
|
||||
user?: string | undefined;
|
||||
|
||||
@@ -1283,14 +1283,6 @@ export function startGatewayModelPricingRefresh(params: {
|
||||
};
|
||||
}
|
||||
|
||||
export function getGatewayModelPricingCacheMeta(): {
|
||||
cachedAt: number;
|
||||
ttlMs: number;
|
||||
size: number;
|
||||
} {
|
||||
return { ...getGatewayModelPricingCacheMetaState(), ttlMs: CACHE_TTL_MS };
|
||||
}
|
||||
|
||||
export function __resetGatewayModelPricingCacheForTest(): void {
|
||||
clearGatewayModelPricingCacheState();
|
||||
clearRefreshTimer();
|
||||
|
||||
@@ -277,7 +277,7 @@ export function buildPairingConnectErrorMessage(
|
||||
: "pairing required";
|
||||
}
|
||||
|
||||
export function buildPairingConnectRemediationHint(
|
||||
function buildPairingConnectRemediationHint(
|
||||
reason: ConnectPairingRequiredReason | undefined,
|
||||
): string {
|
||||
return reason
|
||||
|
||||
Reference in New Issue
Block a user