export function parsePortFromArgs(programArguments: string[] | undefined): number | null{ if (!programArguments?.length) { returnnull;
} for (let i = 0; i < programArguments.length; i += 1) { const arg = programArguments[i]; if (arg === "--port") { const next = programArguments[i + 1]; const parsed = parsePort(next); if (parsed) { return parsed;
}
} if (arg?.startsWith("--port=")) { const parsed = parsePort(arg.split("=", 2)[1]); if (parsed) { return parsed;
}
}
} returnnull;
}
export function pickProbeHostForBind(
bindMode: string,
tailnetIPv4: string | undefined,
customBindHost?: string,
) { if (bindMode === "custom" && customBindHost?.trim()) { return customBindHost.trim();
} if (bindMode === "tailnet") { return tailnetIPv4 ?? "127.0.0.1";
} if (bindMode === "lan") { // Same as call.ts: self-connections should always target loopback. // bind=lan controls which interfaces the server listens on (0.0.0.0), // but co-located CLI probes should connect via 127.0.0.1. return"127.0.0.1";
} return"127.0.0.1";
}
export function normalizeListenerAddress(raw: string): string {
let value = raw.trim(); if (!value) { return value;
}
value = value.replace(/^TCP\s+/i, "");
value = value.replace(/\s+\(LISTEN\)\s*$/i, ""); return value.trim();
}
export function renderGatewayServiceStartHints(env: NodeJS.ProcessEnv = process.env): string[] { const profile = env.OPENCLAW_PROFILE; const container = resolveDaemonContainerContext(env); const hints = buildPlatformServiceStartHints({
installCommand: formatCliCommand("openclaw gateway install", env),
startCommand: formatCliCommand("openclaw gateway", env),
launchAgentPlistPath: `~/Library/LaunchAgents/${resolveGatewayLaunchAgentLabel(profile)}.plist`,
systemdServiceName: resolveGatewaySystemdServiceName(profile),
windowsTaskName: resolveGatewayWindowsTaskName(profile),
}); if (!container) { return hints;
} return [`Restart the container or the service that manages it for ${container}.`];
}
export function filterContainerGenericHints(
hints: string[],
env: NodeJS.ProcessEnv = process.env,
): string[] { if (!resolveDaemonContainerContext(env)) { return hints;
} return hints.filter(
(hint) =>
!hint.includes("If you're in a container, run the gateway in the foreground instead of") &&
!hint.includes("systemd user services are unavailable; install/enable systemd"),
);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-06-09)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.