import { Writable } from "node:stream"; import type { GatewayService } from "../../daemon/service.js"; import { defaultRuntime } from "../../runtime.js";
export function emitDaemonActionJson(payload: DaemonActionResponse) {
defaultRuntime.writeJson(payload);
}
function classifyDaemonHintText(text: string): DaemonHintKind { if (text.includes("openclaw gateway install") || text.startsWith("Service not installed. Run:")) { return"install";
} if (text.startsWith("Restart the container or the service that manages it for ")) { return"container-restart";
} if (text.startsWith("systemd user services are unavailable;")) { return"systemd-unavailable";
} if (
text.startsWith("On a headless server (SSH/no desktop session):") ||
text.startsWith("Also ensure XDG_RUNTIME_DIR is set:")
) { return"systemd-headless";
} if (text.startsWith("If you're in a container, run the gateway in the foreground instead of")) { return"container-foreground";
} if (
text.startsWith("WSL2 needs systemd enabled:") ||
text.startsWith("Then run: wsl --shutdown") ||
text.startsWith("Verify: systemctl --user status")
) { return"wsl-systemd";
} return"generic";
}
export function buildDaemonHintItems(hints: string[] | undefined): DaemonHintItem[] | undefined { if (!hints?.length) { return undefined;
} return hints.map((text) => ({ kind: classifyDaemonHintText(text), text }));
}
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.