diff --git a/src/cli/gateway-cli/shared.ts b/src/cli/gateway-cli/shared.ts index 848279e9b63..101675dc805 100644 --- a/src/cli/gateway-cli/shared.ts +++ b/src/cli/gateway-cli/shared.ts @@ -6,39 +6,8 @@ import { import { resolveGatewayService } from "../../daemon/service.js"; import { defaultRuntime } from "../../runtime.js"; import { formatCliCommand } from "../command-format.js"; -import { parsePort } from "../shared/parse-port.js"; -export { parsePort }; - -export const toOptionString = (value: unknown): string | undefined => { - if (typeof value === "string") { - return value; - } - if (typeof value === "number" || typeof value === "bigint") { - return value.toString(); - } - return undefined; -}; - -export function extractGatewayMiskeys(parsed: unknown): { - hasGatewayToken: boolean; - hasRemoteToken: boolean; -} { - if (!parsed || typeof parsed !== "object") { - return { hasGatewayToken: false, hasRemoteToken: false }; - } - const gateway = (parsed as Record).gateway; - if (!gateway || typeof gateway !== "object") { - return { hasGatewayToken: false, hasRemoteToken: false }; - } - const hasGatewayToken = "token" in (gateway as Record); - const remote = (gateway as Record).remote; - const hasRemoteToken = - remote && typeof remote === "object" ? "token" in (remote as Record) : false; - return { hasGatewayToken, hasRemoteToken }; -} - -export function renderGatewayServiceStopHints(env: NodeJS.ProcessEnv = process.env): string[] { +function renderGatewayServiceStopHints(env: NodeJS.ProcessEnv = process.env): string[] { const profile = env.OPENCLAW_PROFILE; switch (process.platform) { case "darwin": diff --git a/src/cli/update-cli/shared.ts b/src/cli/update-cli/shared.ts index c96d85e2d0a..784d114ae36 100644 --- a/src/cli/update-cli/shared.ts +++ b/src/cli/update-cli/shared.ts @@ -65,7 +65,7 @@ export function normalizeTag(value?: string | null): string | null { return normalizePackageTagInput(value, ["openclaw", DEFAULT_PACKAGE_NAME]); } -export function normalizeVersionTag(tag: string): string | null { +function normalizeVersionTag(tag: string): string | null { const trimmed = tag.trim(); if (!trimmed) { return null; @@ -100,7 +100,7 @@ export async function isGitCheckout(root: string): Promise { } } -export async function isCorePackage(root: string): Promise { +async function isCorePackage(root: string): Promise { const name = await readPackageName(root); return Boolean(name && CORE_PACKAGE_NAMES.has(name)); } diff --git a/src/commands/gateway-status/discovery.ts b/src/commands/gateway-status/discovery.ts index 0095f9f1375..7c8a9520a2e 100644 --- a/src/commands/gateway-status/discovery.ts +++ b/src/commands/gateway-status/discovery.ts @@ -26,11 +26,7 @@ export function inferSshTargetFromRemoteUrl(rawUrl?: string | null): string | nu return user ? `${user}@${host}` : host; } -export function buildSshTarget(input: { - user?: string; - host?: string; - port?: number; -}): string | null { +function buildSshTarget(input: { user?: string; host?: string; port?: number }): string | null { const host = normalizeOptionalString(input.host) ?? ""; if (!host) { return null; diff --git a/src/commands/gateway-status/helpers.ts b/src/commands/gateway-status/helpers.ts index 9923e6803d7..daa9742c109 100644 --- a/src/commands/gateway-status/helpers.ts +++ b/src/commands/gateway-status/helpers.ts @@ -338,7 +338,7 @@ function colorForGatewayProbeCapability(capability: GatewayProbeCapability) { } } -export function renderProbeCapabilityLine(probe: GatewayProbeResult, rich: boolean) { +function renderProbeCapabilityLine(probe: GatewayProbeResult, rich: boolean) { const capability = getGatewayProbeCapability(probe); return colorize( rich, diff --git a/src/commands/migrate/output.ts b/src/commands/migrate/output.ts index c057658cd09..d65dfb9321e 100644 --- a/src/commands/migrate/output.ts +++ b/src/commands/migrate/output.ts @@ -5,7 +5,7 @@ import type { RuntimeEnv } from "../../runtime.js"; import { theme } from "../../terminal/theme.js"; import type { MigrateApplyOptions } from "./types.js"; -export function formatCount(value: number, label: string): string { +function formatCount(value: number, label: string): string { return `${value} ${label}${value === 1 ? "" : "s"}`; } @@ -52,7 +52,7 @@ export function formatMigrationPlan(plan: MigrationPlan): string[] { return lines; } -export function formatMigrationItem(item: MigrationItem): string { +function formatMigrationItem(item: MigrationItem): string { const target = item.target ? ` -> ${item.target}` : ""; const message = item.message ? ` (${item.message})` : item.reason ? ` (${item.reason})` : ""; const sensitive = item.sensitive ? " [sensitive]" : ""; diff --git a/src/proxy-capture/paths.ts b/src/proxy-capture/paths.ts index 3c0b3df986c..00e19422646 100644 --- a/src/proxy-capture/paths.ts +++ b/src/proxy-capture/paths.ts @@ -1,7 +1,7 @@ import path from "node:path"; import { resolveStateDir } from "../config/paths.js"; -export function resolveDebugProxyRootDir(env: NodeJS.ProcessEnv = process.env): string { +function resolveDebugProxyRootDir(env: NodeJS.ProcessEnv = process.env): string { return path.join(resolveStateDir(env), "debug-proxy"); } diff --git a/src/routing/default-account-warnings.ts b/src/routing/default-account-warnings.ts index 8c15aff4ed3..fd4770ca606 100644 --- a/src/routing/default-account-warnings.ts +++ b/src/routing/default-account-warnings.ts @@ -1,4 +1,4 @@ -export function formatChannelDefaultAccountPath(channelKey: string): string { +function formatChannelDefaultAccountPath(channelKey: string): string { return `channels.${channelKey}.defaultAccount`; }