/** * `send --register` roster writes, split out of `send.ts` (Issue #4128). */ import { ApiClient } from '../utils/api-client'; import type { RoleAssignmentInput } from '../../types/agent-roles'; import type { RelayEndpointArg } from './relays'; /** * Register an ad-hoc --instance session into the agent-instance roster * (Issue #1000: --register). No-ops when already registered so `send * --register` is safe to repeat across multiple messages to the same instance. * * This runs after the message went out, so whatever fails here (a roster that keeps moving, * Issue #4149; anything else, Issue #4159) is a warning and the send stays a success: an * error exit reads as "not sent", and a script reading it would send the message twice. */ export declare function registerInstance(client: ApiClient, worktreeId: string, instanceId: string, cliTool: string): Promise; /** Whether the alias `--register` gives `instanceId` is longer than the roster takes (Issue #4458). */ export declare function defaultAliasTooLong(cliTool: string, instanceId: string): boolean; /** * The command that registers the instance by hand, as `--register` would have. When the * default alias is longer than the roster takes, it names a short `--alias`, so the * command does what it says instead of failing for the same reason (Issue #4458). */ export declare function registerCommandFor(worktreeId: string, cliTool: string, instanceId: string): string; /** * `--register` before anything is sent (Issue #4458): the candidate row on its own (its * default alias above all, which the tool and the id alone decide), refused here with * exit 2 rather than warned about after the message went out. The room left is not asked * here: the limit of a plain --register stays a warning after the send (I3). * * J2: a send to an instance already on the roster registers nothing, so it must behave as * a send without --register. The roster is read only when the candidate would be refused, * and a read that fails does not hold the send up (the registration after it says what it * finds). */ export declare function assertCandidateRowFits(client: ApiClient, worktreeId: string, instanceId: string, cliTool: string): Promise; /** * `--register` with a role: the instance and its role are created together, before * anything goes out, so the first start already has it (Issue #4116). Without a role * the order stays as it was: sent, then {@link registerInstance}. * * Repeating the command creates nothing. The role on the send replaces what the * instance holds, and is then a condition like any `--role`. * * Issue #4449: the server judges the send this registration is for (the tool policy, * and the relay of `--reply-to`) and refuses with exit 33 before creating anything. * * @throws The roster changed since it was read (exit 31), or the server refused */ export declare function registerInstanceWithRole(client: ApiClient, worktreeId: string, instanceId: string, cliTool: string, role: RoleAssignmentInput, replyTo: RelayEndpointArg | undefined, autoYes: boolean | undefined): Promise; //# sourceMappingURL=send-roster.d.ts.map