/** * Shared operator contract for the `gjc daemon` command surface. * * One source of truth for the beginner-safe operational vocabulary so the * guided human surface and the machine-readable JSON never drift: * - the terse action verbs plus the retired `reload` operator alias, * - process exit codes, * - concise vs. `--verbose` human rendering of statuses and results, and * - actionable recovery guidance for a token/chat ownership mismatch. * * The full roots/debug payload lives behind `--verbose` (human) or `--json` * (automation); the default human output stays a concise per-daemon result. */ import type { DaemonAction, DaemonOperationResult, DaemonRecovery, DaemonStatus } from "./control-types"; /** Canonical daemon actions accepted as the leading verb. */ export declare const DAEMON_CANONICAL_ACTIONS: readonly DaemonAction[]; /** * `restart` is the routine "reload if running, otherwise start" verb. Keep * `reload` only as an input compatibility token; internal callers must use * the canonical restart action. */ export declare const DAEMON_ACTION_ALIASES: Readonly>; /** Every token accepted in the leading action position (canonical + aliases). */ export declare const DAEMON_ACTION_TOKENS: readonly string[]; /** Resolve a leading verb (canonical or alias) to its canonical action. */ export declare function resolveDaemonAction(token: string | undefined): DaemonAction | undefined; /** Exit codes for `gjc daemon`. Backward compatible: success 0, any failure 1. */ export declare const DAEMON_EXIT: { readonly ok: 0; readonly failure: 1; }; /** Human-facing headline when a spawn/reload is refused by a live foreign identity. */ export declare const OWNERSHIP_MISMATCH_MESSAGE = "refused: a live Telegram daemon with a different bot token or chat already owns this workspace"; /** Structured, actionable recovery for a token/chat ownership mismatch. */ export declare function ownershipMismatchRecovery(): DaemonRecovery; /** * Render one daemon status. Concise by default (single head line + any * actionable warning); `--verbose` adds runtime detail and the full roots list. */ export declare function formatDaemonStatus(status: DaemonStatus, opts?: { verbose?: boolean; }): string; /** * Render one operation result. Keeps the stable ` : ok|failed — * ` head line, then any warnings, then actionable recovery steps. */ export declare function formatDaemonResult(result: DaemonOperationResult): string;