refactor(commands): split CLI commands

This commit is contained in:
Peter Steinberger
2026-01-14 05:39:47 +00:00
parent 2b60ee96f2
commit a58ff1ac63
74 changed files with 7995 additions and 7806 deletions

View File

@@ -0,0 +1,34 @@
import { resolveGatewayService } from "../daemon/service.js";
import { formatDaemonRuntimeShort } from "./status.format.js";
export async function getDaemonStatusSummary(): Promise<{
label: string;
installed: boolean | null;
loadedText: string;
runtimeShort: string | null;
}> {
try {
const service = resolveGatewayService();
const [loaded, runtime, command] = await Promise.all([
service
.isLoaded({
env: process.env,
profile: process.env.CLAWDBOT_PROFILE,
})
.catch(() => false),
service.readRuntime(process.env).catch(() => undefined),
service.readCommand(process.env).catch(() => null),
]);
const installed = command != null;
const loadedText = loaded ? service.loadedText : service.notLoadedText;
const runtimeShort = formatDaemonRuntimeShort(runtime);
return { label: service.label, installed, loadedText, runtimeShort };
} catch {
return {
label: "Daemon",
installed: null,
loadedText: "unknown",
runtimeShort: null,
};
}
}