import { runDoctor } from "../../services/diagnostics.js";
import { resolveInstance } from "../../services/instance-selection.js";
export async function runStatusCommand(config, parsed, context) {
    const [instanceName, instance] = resolveInstance(config, parsed);
    const checks = await runDoctor(instance, context, []);
    const health = checks.find((check) => check.name === "health endpoint");
    context.stdout.write(`${instanceName} (${instance.target}) ${instance.url}\n`);
    if (health) {
        context.stdout.write(`${health.status.toUpperCase()} ${health.message}\n`);
    }
    return health?.status === "fail" ? 1 : 0;
}
//# sourceMappingURL=action.js.map