/** * `agent-relay rm ` — release a spawned agent via the broker's * `DELETE /api/spawned/{name}` route. * * Trivial wrapper. Prints a one-line confirmation on success and a * one-line explanatory error on failure. Connection discovery uses the * shared `resolveBrokerConnection` helper so the same `--broker-url` / * `RELAY_BROKER_URL` / `connection.json` chain works as for `view` / * `drive` / `passthrough`. * * The longer-form `release` command in `agent-management.ts` layers * broker autostart on top of the same SDK client; `rm` is the lighter * "I already have a broker" entry point. */ import { Command } from 'commander'; import { type BrokerConnection } from '../lib/broker-connection.js'; type ExitFn = (code: number) => never; export interface RmDependencies { readConnectionFile: (stateDir: string) => unknown; getDefaultStateDir: () => string; env: NodeJS.ProcessEnv; fetch: typeof globalThis.fetch; log: (...args: unknown[]) => void; error: (...args: unknown[]) => void; exit: ExitFn; } /** Outcome of `releaseAgent`. Useful for the `--ephemeral` teardown in `run`. */ export interface ReleaseResult { ok: boolean; status: number; message?: string; } /** * Release through the SDK client against the resolved broker. Returns a * structured outcome the caller can decide how to surface — `rm` prints * a one-liner, the `--ephemeral` teardown in `run` swallows failures * because the client is already on its way out. */ export declare function releaseAgent(connection: BrokerConnection, agentName: string, fetchFn: typeof globalThis.fetch): Promise; /** * Run the `rm ` verb. Resolves with the exit code the CLI should * propagate. Pure — no signal handlers, no event loop hooks. */ export declare function runRm(agentName: string, options: { brokerUrl?: string; apiKey?: string; stateDir?: string; }, deps: RmDependencies): Promise; /** Register `agent-relay rm ` on the supplied commander program. */ export declare function registerRmCommands(program: Command, overrides?: Partial): void; export {}; //# sourceMappingURL=rm.d.ts.map