/** * `astrid-agent`: the runner command a scheduler or a GitHub Actions job calls. * Its exit codes are the interface: * * queue 0 there is work, start a run * 3 nothing to do, skip this tick * 1 could not tell (network, auth); never treat this as idle * claim 0 claimed, start the task * heartbeat 0 lease renewed, keep working * release 0 released * 2 someone else has it, or it is no longer eligible; move on * 1 error * * These match astrid-web's scripts/agent-queue-status.ts and * scripts/claim-fixall-task.ts, which this command is meant to replace. * * Credentials come from the environment and are never printed: * ASTRID_TOKEN an agent-bound token (preferred) * ASTRID_CLIENT_ID + ASTRID_CLIENT_SECRET client credentials * (ASTRID_OAUTH_CLIENT_ID / ASTRID_OAUTH_CLIENT_SECRET are accepted too) * ASTRID_API_URL the server origin */ export declare const EXIT: { /** Work to do / the write succeeded. */ readonly WORK: 0; readonly ERROR: 1; /** Claim or release refused: another worker has it, or it is not eligible. */ readonly CONFLICT: 2; /** The queue is idle. */ readonly IDLE: 3; }; export interface CliIO { env: Record; fetch?: typeof fetch; stdout: (line: string) => void; stderr: (line: string) => void; } export declare const USAGE = "Usage: astrid-agent [options]\n\nCommands:\n queue --agent [--list ] [--include-unassigned]\n [--seen [--write-seen]]\n Print the queue verdict as JSON. Exit 0 work, 3 idle, 1 could not tell.\n claim [--agent ] [--resume] [--lease-seconds ]\n Atomic claim (POST /api/v1/tasks/:id/claim). Exit 0 claimed, 2 taken, 1 error.\n The claim holds a lease (15 min by default): heartbeat while you work.\n heartbeat [--agent ] [--lease-seconds ]\n Renew the claim lease. Exit 0 renewed, 2 the claim is gone (stop), 1 error.\n claim --fixall [--agent ] [--list ]\n Claim through /claim-fixall (Astrid's allowlisted boards).\n release [--agent ] [--comment ]\n Give a Doing claim back to Ready. Exit 0 released, 2 not yours, 1 error.\n\nOptions:\n --origin Server origin (default: ASTRID_API_URL, then production)\n -h, --help Show this help\n -v, --version Show the version\n\nEnvironment:\n ASTRID_TOKEN, or ASTRID_CLIENT_ID and ASTRID_CLIENT_SECRET"; /** Runs one command and resolves to its exit code. Never calls process.exit. */ export declare function runCli(argv: string[], io: CliIO): Promise; //# sourceMappingURL=cli.d.ts.map