/** * Guard for the one CLI shape that can hurt: an argument commander does not * recognise. * * `run` is registered as commander's DEFAULT command, because the systemd unit * execs the binary with no arguments at all (`ExecStart=/usr/local/bin/ * aicommander-agent`). Commander applies that default to ANY unrecognised * argument — so a typo does not fail, it LAUNCHES A SECOND AGENT. That agent * registers with this machine's device identity, the relay hands it the live * session, and the real (service-managed) agent is left disconnected. * * This is not hypothetical: `aicommander-agent version` — a spelling of * `--version` that anyone, human or model, would try first — knocked a machine * off the relay in the field on 2026-08-10. The binary is documented as the * thing to run over `remote_exec`, so the audience for this footgun is exactly * the audience least able to recover from it: the remote caller loses the * connection it would have needed to undo the damage. * * The rule below keeps the systemd contract (no arguments ⇒ run) and turns * everything unknown into a usage error instead of a launch. */ /** * The offending token when `argv` opens with a bare word that is not a known * command, or null when the invocation is safe to hand to commander. * * Safe by this definition: * - no arguments at all — the service's own launch, and the ONLY way to reach * the default `run` command implicitly; * - a known command name or alias (`run`, `status`, `reset-code`, …); * - anything beginning with `-`, which commander parses as a flag and rejects * on its own terms (`--version`, `--help`, an unknown `--flag`) without ever * falling through to the default command. */ export declare function unknownCliCommand(argv: readonly string[], known: Iterable): string | null; /** What to print when the guard trips. Kept here so a test can assert on it. */ export declare function unknownCliCommandMessage(token: string): string;