Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/JAVA/Openclaw/src/commands/   (KI Agentensystem Version 22©)  Datei vom 26.3.2026 mit Größe 1 kB image not shown  

Quelle  status.node-mode.ts

  Sprache: JAVA
 

Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

import { DEFAULT_GATEWAY_PORT } from "../config/paths.js";
import { loadNodeHostConfig } from "../node-host/config.js";

type NodeOnlyServiceLike = {
  installed: boolean | null;
  loaded?: boolean | null;
  externallyManaged?: boolean;
  runtime?:
    | {
        status?: string;
        pid?: number;
      }
    | undefined;
  runtimeShort?: string | null;
};

export type NodeOnlyGatewayInfo = {
  gatewayTarget: string;
  gatewayValue: string;
  connectionDetails: string;
};

function resolveNodeGatewayTarget(gateway?: { host?: string; port?: number }): string {
  return gateway?.host
    ? `${gateway.host}:${gateway.port ?? DEFAULT_GATEWAY_PORT}`
    : "(gateway address unknown)";
}

function hasRunningRuntime(
  runtime:
    | {
        status?: string;
        pid?: number;
      }
    | undefined,
): boolean {
  return runtime?.status === "running" || typeof runtime?.pid === "number";
}

function isNodeServiceActive(node: NodeOnlyServiceLike): boolean {
  if (node.installed !== true) {
    return false;
  }
  if (node.externallyManaged === true) {
    return true;
  }
  if (node.loaded === true) {
    return true;
  }
  if (hasRunningRuntime(node.runtime)) {
    return true;
  }
  return typeof node.runtimeShort === "string" && node.runtimeShort.startsWith("running");
}

export async function resolveNodeOnlyGatewayInfo(params: {
  daemon: Pick<NodeOnlyServiceLike, "installed">;
  node: NodeOnlyServiceLike;
}): Promise<NodeOnlyGatewayInfo | null> {
  if (params.daemon.installed !== false || !isNodeServiceActive(params.node)) {
    return null;
  }

  const gatewayTarget = resolveNodeGatewayTarget((await loadNodeHostConfig())?.gateway);
  return {
    gatewayTarget,
    gatewayValue: `node → ${gatewayTarget} · no local gateway`,
    connectionDetails: [
      "Node-only mode detected",
      "Local gateway: not expected on this machine",
      `Remote gateway target: ${gatewayTarget}`,
      "Inspect the remote gateway host for live channel and health details.",
    ].join("\n"),
  };
}

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-04-27) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

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.