feat: fold gateway service commands into gateway

This commit is contained in:
Peter Steinberger
2026-01-21 17:45:06 +00:00
parent 6f58d508b8
commit 9e22f019db
27 changed files with 166 additions and 88 deletions

View File

@@ -4,7 +4,19 @@ import { colorize, isRich, theme } from "../../terminal/theme.js";
import type { RuntimeEnv } from "../../runtime.js";
import { formatCliCommand } from "../command-format.js";
const ALLOWED_INVALID_COMMANDS = new Set(["doctor", "logs", "health", "help", "status", "service"]);
const ALLOWED_INVALID_COMMANDS = new Set(["doctor", "logs", "health", "help", "status"]);
const ALLOWED_INVALID_GATEWAY_SUBCOMMANDS = new Set([
"status",
"probe",
"health",
"discover",
"call",
"install",
"uninstall",
"start",
"stop",
"restart",
]);
let didRunDoctorConfigFlow = false;
function formatConfigIssues(issues: Array<{ path: string; message: string }>): string[] {
@@ -25,7 +37,13 @@ export async function ensureConfigReady(params: {
const snapshot = await readConfigFileSnapshot();
const commandName = params.commandPath?.[0];
const allowInvalid = commandName ? ALLOWED_INVALID_COMMANDS.has(commandName) : false;
const subcommandName = params.commandPath?.[1];
const allowInvalid = commandName
? ALLOWED_INVALID_COMMANDS.has(commandName) ||
(commandName === "gateway" &&
subcommandName &&
ALLOWED_INVALID_GATEWAY_SUBCOMMANDS.has(subcommandName))
: false;
const issues = snapshot.exists && !snapshot.valid ? formatConfigIssues(snapshot.issues) : [];
const legacyIssues =
snapshot.legacyIssues.length > 0

View File

@@ -36,14 +36,6 @@ const entries: SubCliEntry[] = [
mod.registerAcpCli(program);
},
},
{
name: "daemon",
description: "Manage the gateway daemon",
register: async (program) => {
const mod = await import("../daemon-cli.js");
mod.registerDaemonCli(program);
},
},
{
name: "gateway",
description: "Gateway control",