/** @internal Fetch the worker registry URL from the backend init-config endpoint. */ export declare function fetchAgentInitConfig(authToken: string, apiBaseUrl?: string, opts?: { timeout?: number; }): Promise; type AnyJobContext = any; /** @internal Entrypoint invoked with a job context when a job is assigned. */ export type RegistrationEntrypoint = (ctx: AnyJobContext) => Promise | unknown; /** @internal Per-job context seed: a factory, a prebuilt context, or `null`. */ export type RegistrationJobctxFactory = (() => AnyJobContext) | AnyJobContext | null; /** @internal Options for {@link AgentRegistration}. */ export type RegistrationOptions = { authToken: string; /** Agent name; empty falls back to `ZeroRuntimeAgent`. */ agentId: string; apiBaseUrl: string; /** Reported load threshold, 0..1. Default `0.75`. */ loadThreshold?: number; /** Max concurrent jobs. Default `10`. */ maxProcesses?: number; /** Advertised capabilities. Default `['room', 'voice', 'stt', 'tts']`. */ capabilities?: string[] | null; /** Job entrypoint; omit to register presence-only. */ entrypoint?: RegistrationEntrypoint | null; jobctxFactory?: RegistrationJobctxFactory; /** Fallback room options when none provided. */ defaultRoomOptions?: any; }; /** @internal Manages a worker's registration and job lifecycle over the registry WS. */ export declare class AgentRegistration { private readonly _authToken; private readonly _agentId; private readonly _apiBaseUrl; private readonly _loadThreshold; private readonly _maxProcesses; private readonly _capabilities; private readonly _entrypoint; private readonly _jobctxFactory; private readonly _defaultRoomOptions; private readonly _activeJobs; private _draining; private _ws; private _workerId; private _closed; private _inbox; private _recvWaiter; private _wsClosedFlag; private _recvTask; private _statusTask; private _supervisorTask; private readonly _firstAttemptDone; constructor(options: RegistrationOptions); /** Assigned worker id, or `''` until registration completes. */ get workerId(): string; /** Start the supervisor and wait for the first attempt; returns `true` if registered. */ start(): Promise; /** * Gracefully shut down active jobs and their tasks before tearing down. Calls * `ctx.shutdown()` on each active job, then waits up to `timeoutSec` for the job * tasks to finish, cancelling any stragglers. */ private _drainActiveJobs; /** Stop the supervisor, report offline status, and tear down the connection. */ stop(): Promise; private _supervisor; private _runOneConnection; private _cleanup; private _openWs; private _wireWs; private _waitWsOpen; private _enqueue; private _wakeRecv; private _receive; private _recvLoop; private _statusLoop; private _handleInbound; private _handleAvailability; private _handleJobAssignment; private _handleJobTermination; private _buildJobContext; private _send; private _sendJobUpdate; private _sendStatusUpdateNow; private _wsIsClosed; private _wsSend; } /** @internal Derive the worker WS URL from a registry URL (ws scheme + `agent` path). */ export declare function agentWsUrl(registryUrl: string): string; export {};