From d64a27feeb3164cb5bc0aacdef1057f002ec7104 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Mon, 22 Jun 2026 00:32:42 +0800 Subject: [PATCH] chore(deadcode): drop node daemon runtime alias --- src/cli/node-cli/daemon.ts | 12 ++++++------ src/commands/node-daemon-install-helpers.ts | 4 ++-- src/commands/node-daemon-runtime.ts | 17 ----------------- 3 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 src/commands/node-daemon-runtime.ts diff --git a/src/cli/node-cli/daemon.ts b/src/cli/node-cli/daemon.ts index 1fe4fe0dba1..2b86adf03e0 100644 --- a/src/cli/node-cli/daemon.ts +++ b/src/cli/node-cli/daemon.ts @@ -1,11 +1,11 @@ // Node-host daemon lifecycle commands for install, status, start, stop, and restart. import { normalizeOptionalString } from "@openclaw/normalization-core/string-coerce"; import { colorize } from "../../../packages/terminal-core/src/theme.js"; -import { buildNodeInstallPlan } from "../../commands/node-daemon-install-helpers.js"; import { - DEFAULT_NODE_DAEMON_RUNTIME, - isNodeDaemonRuntime, -} from "../../commands/node-daemon-runtime.js"; + DEFAULT_GATEWAY_DAEMON_RUNTIME, + isGatewayDaemonRuntime, +} from "../../commands/daemon-runtime.js"; +import { buildNodeInstallPlan } from "../../commands/node-daemon-install-helpers.js"; import { resolveNodeLaunchAgentLabel, resolveNodeSystemdServiceName, @@ -106,8 +106,8 @@ export async function runNodeDaemonInstall(opts: NodeDaemonInstallOptions) { return; } - const runtimeRaw = opts.runtime ? opts.runtime : DEFAULT_NODE_DAEMON_RUNTIME; - if (!isNodeDaemonRuntime(runtimeRaw)) { + const runtimeRaw = opts.runtime ? opts.runtime : DEFAULT_GATEWAY_DAEMON_RUNTIME; + if (!isGatewayDaemonRuntime(runtimeRaw)) { fail('Invalid --runtime (use "node" or "bun")'); return; } diff --git a/src/commands/node-daemon-install-helpers.ts b/src/commands/node-daemon-install-helpers.ts index 9da58740281..405e0045f53 100644 --- a/src/commands/node-daemon-install-helpers.ts +++ b/src/commands/node-daemon-install-helpers.ts @@ -9,7 +9,7 @@ import { resolveDaemonNodeBinDir, } from "./daemon-install-plan.shared.js"; import type { DaemonInstallWarnFn } from "./daemon-install-runtime-warning.js"; -import type { NodeDaemonRuntime } from "./node-daemon-runtime.js"; +import type { GatewayDaemonRuntime } from "./daemon-runtime.js"; type NodeInstallPlan = { programArguments: string[]; @@ -37,7 +37,7 @@ export async function buildNodeInstallPlan(params: { tlsFingerprint?: string; nodeId?: string; displayName?: string; - runtime: NodeDaemonRuntime; + runtime: GatewayDaemonRuntime; devMode?: boolean; nodePath?: string; warn?: DaemonInstallWarnFn; diff --git a/src/commands/node-daemon-runtime.ts b/src/commands/node-daemon-runtime.ts deleted file mode 100644 index 52422c0cdfb..00000000000 --- a/src/commands/node-daemon-runtime.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** Compatibility exports for the Node daemon runtime selector. */ -import { - DEFAULT_GATEWAY_DAEMON_RUNTIME, - isGatewayDaemonRuntime, - type GatewayDaemonRuntime, -} from "./daemon-runtime.js"; - -/** Runtime id accepted by Node daemon install/start helpers. */ -export type NodeDaemonRuntime = GatewayDaemonRuntime; - -/** Default Node daemon runtime, currently shared with the gateway daemon runtime. */ -export const DEFAULT_NODE_DAEMON_RUNTIME = DEFAULT_GATEWAY_DAEMON_RUNTIME; - -/** Returns true when a string is a supported Node daemon runtime id. */ -export function isNodeDaemonRuntime(value: string | undefined): value is NodeDaemonRuntime { - return isGatewayDaemonRuntime(value); -}