import "./paths-CutK9mvd.js";
import "./registry-DScA7GM7.js";
import { N as setVerbose, z as theme } from "./utils-BXq128Ep.js";
import { f as defaultRuntime } from "./subsystem-C0jWWDsO.js";
import "./boolean-DtWR5bt3.js";
import "./auth-profiles-Ci0m1nDj.js";
import "./exec-BfxXkFYo.js";
import "./agent-scope-C9lu5zYP.js";
import "./frontmatter-B3s_6fwe.js";
import "./skills-CXwgvGur.js";
import "./manifest-registry-CLylU6AG.js";
import "./skills-status-C_4ZtMSQ.js";
import "./io-CD_zuK0D.js";
import "./config-DiWsrVKe.js";
import "./client-DcGx78uR.js";
import "./call-DfwL1J3H.js";
import "./message-channel-f25bXyKM.js";
import "./subagent-registry-C2sM5Cyw.js";
import "./sessions-Mt8f23sr.js";
import "./tokens-D7kBZYPD.js";
import "./plugins-CiXA7mtz.js";
import "./accounts-DlyBFGv4.js";
import "./bindings-DjR4yXgA.js";
import "./logging-pqyrk15z.js";
import "./send-BSyWSMGa.js";
import "./send-Bv-Ugxhn.js";
import "./with-timeout-CMUEB0p-.js";
import "./deliver-CkqGoWHC.js";
import "./accounts-DNDn42nY.js";
import "./send-Dbw-1Nv6.js";
import "./image-ops-DX6lds-i.js";
import "./models-config-6QdRrV1c.js";
import "./pi-embedded-helpers-_sjZz5r6.js";
import "./sandbox-Cgi5GRjr.js";
import "./chrome-CCvAKFA-.js";
import "./tailscale-BrDWEIwI.js";
import "./auth-B80pI0Uh.js";
import "./server-context-CPsi2755.js";
import "./routes-MRFMs3Hh.js";
import "./redact-CFj039qF.js";
import "./errors-8VQXhB4u.js";
import "./paths-BKv1HwMq.js";
import "./ssrf-weuQnXiO.js";
import "./store-BgSeZwv0.js";
import "./ports-BTCCmBPN.js";
import "./trash-RPQQ3ep-.js";
import "./accounts-IQLo28rM.js";
import "./paths-mQAx86lp.js";
import "./tool-images-BtNaJzDf.js";
import "./reply-prefix-CTkJoXqQ.js";
import "./memory-cli-DhQ3BMgb.js";
import "./manager-BUwPVwMU.js";
import "./gemini-auth-D_WaKG1u.js";
import "./sqlite-B6wrIncg.js";
import "./retry-eZfsfPJw.js";
import "./common-Cb-qblwg.js";
import "./chunk-CCkvwRI1.js";
import "./markdown-tables-BmPL6gxD.js";
import "./fetch-guard-DgkwAf8y.js";
import "./fetch-Cyj7bUtQ.js";
import "./ir-Zi6SqHuv.js";
import "./render-lL152pED.js";
import "./commands-registry-Bb7wps-U.js";
import "./runner-Dq5pUJw7.js";
import "./tool-display-C_2MZJqm.js";
import "./model-catalog-I10Mw32M.js";
import "./session-utils-rRgbDHdn.js";
import "./pi-tools.policy-Dl38gqLG.js";
import "./pairing-store-BFjZsQfU.js";
import "./fetch-FKiEPHsu.js";
import "./nodes-screen-aqjJyJKK.js";
import "./session-cost-usage-CFkSIl99.js";
import "./send-Dm5td_ud.js";
import "./outbound-attachment-DbnUFGg7.js";
import "./delivery-queue-CrM_98Zj.js";
import "./project-context-CDgzGX_i.js";
import "./control-service-Da4pvhRF.js";
import "./stagger-vDSk1wpM.js";
import "./channel-selection-C9HQldEr.js";
import "./send-DVTkNDIS.js";
import "./resolve-route-DfP8shJU.js";
import "./channel-activity-CjNqpxzA.js";
import "./tables-D0RFg7_p.js";
import { t as formatDocsLink } from "./links-Crq8FXFM.js";
import { n as runCommandWithRuntime } from "./cli-utils-m10N0YX2.js";
import { t as formatHelpExamples } from "./help-format-xwRPMYQn.js";
import "./progress-Czj96fRf.js";
import "./replies-D7zeCuNw.js";
import "./onboard-helpers-BfUVfjJm.js";
import "./prompt-style-gyFdZw9z.js";
import "./pairing-labels-DcHuGxfy.js";
import "./dangerous-tools-Ab7vwZqw.js";
import "./skill-scanner-C1a4nYAb.js";
import "./channels-status-issues-DtrUrEfm.js";
import { n as parsePositiveIntOrUndefined } from "./helpers-BNIrmPjb.js";
import "./runtime-guard-CV_MGdwf.js";
import "./systemd-DJnyEJey.js";
import "./service-B4bQU0ni.js";
import "./diagnostics-ks9adiD4.js";
import "./table-DV997vFl.js";
import "./audit-C405IAHv.js";
import { n as statusCommand } from "./status-BP_wXBQL.js";
import { r as healthCommand } from "./health-DSAmjFa7.js";
import "./update-check-WiRoNCAg.js";
import "./dm-policy-shared-BQQ5gTsK.js";
import "./node-service-CAvmeENU.js";
import "./status.update-B7rkKE12.js";
import { t as sessionsCommand } from "./sessions-BC_qhgxj.js";

//#region src/cli/program/register.status-health-sessions.ts
function resolveVerbose(opts) {
	return Boolean(opts.verbose || opts.debug);
}
function parseTimeoutMs(timeout) {
	const parsed = parsePositiveIntOrUndefined(timeout);
	if (timeout !== void 0 && parsed === void 0) {
		defaultRuntime.error("--timeout must be a positive integer (milliseconds)");
		defaultRuntime.exit(1);
		return null;
	}
	return parsed;
}
function registerStatusHealthSessionsCommands(program) {
	program.command("status").description("Show channel health and recent session recipients").option("--json", "Output JSON instead of text", false).option("--all", "Full diagnosis (read-only, pasteable)", false).option("--usage", "Show model provider usage/quota snapshots", false).option("--deep", "Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal)", false).option("--timeout <ms>", "Probe timeout in milliseconds", "10000").option("--verbose", "Verbose logging", false).option("--debug", "Alias for --verbose", false).addHelpText("after", () => `\n${theme.heading("Examples:")}\n${formatHelpExamples([
		["coderclaw status", "Show channel health + session summary."],
		["coderclaw status --all", "Full diagnosis (read-only)."],
		["coderclaw status --json", "Machine-readable output."],
		["coderclaw status --usage", "Show model provider usage/quota snapshots."],
		["coderclaw status --deep", "Run channel probes (WA + Telegram + Discord + Slack + Signal)."],
		["coderclaw status --deep --timeout 5000", "Tighten probe timeout."]
	])}`).addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/status", "docs.coderclaw.ai/cli/status")}\n`).action(async (opts) => {
		const verbose = resolveVerbose(opts);
		setVerbose(verbose);
		const timeout = parseTimeoutMs(opts.timeout);
		if (timeout === null) return;
		await runCommandWithRuntime(defaultRuntime, async () => {
			await statusCommand({
				json: Boolean(opts.json),
				all: Boolean(opts.all),
				deep: Boolean(opts.deep),
				usage: Boolean(opts.usage),
				timeoutMs: timeout,
				verbose
			}, defaultRuntime);
		});
	});
	program.command("health").description("Fetch health from the running gateway").option("--json", "Output JSON instead of text", false).option("--timeout <ms>", "Connection timeout in milliseconds", "10000").option("--verbose", "Verbose logging", false).option("--debug", "Alias for --verbose", false).addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/health", "docs.coderclaw.ai/cli/health")}\n`).action(async (opts) => {
		const verbose = resolveVerbose(opts);
		setVerbose(verbose);
		const timeout = parseTimeoutMs(opts.timeout);
		if (timeout === null) return;
		await runCommandWithRuntime(defaultRuntime, async () => {
			await healthCommand({
				json: Boolean(opts.json),
				timeoutMs: timeout,
				verbose
			}, defaultRuntime);
		});
	});
	program.command("sessions").description("List stored conversation sessions").option("--json", "Output as JSON", false).option("--verbose", "Verbose logging", false).option("--store <path>", "Path to session store (default: resolved from config)").option("--active <minutes>", "Only show sessions updated within the past N minutes").addHelpText("after", () => `\n${theme.heading("Examples:")}\n${formatHelpExamples([
		["coderclaw sessions", "List all sessions."],
		["coderclaw sessions --active 120", "Only last 2 hours."],
		["coderclaw sessions --json", "Machine-readable output."],
		["coderclaw sessions --store ./tmp/sessions.json", "Use a specific session store."]
	])}\n\n${theme.muted("Shows token usage per session when the agent reports it; set agents.defaults.contextTokens to cap the window and show %.")}`).addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/cli/sessions", "docs.coderclaw.ai/cli/sessions")}\n`).action(async (opts) => {
		setVerbose(Boolean(opts.verbose));
		await sessionsCommand({
			json: Boolean(opts.json),
			store: opts.store,
			active: opts.active
		}, defaultRuntime);
	});
}

//#endregion
export { registerStatusHealthSessionsCommands };