import { Client } from "./client.js"; export type InstanceIDSource = "configured" | "cloud_run_revision_instance" | "hostname" | "fly_machine_id" | "railway_replica_id" | "render_instance_id" | "system_hostname" | "generated_uuid"; export declare function resolveInstanceID(explicit: string | undefined): Promise<{ id: string; source: InstanceIDSource; }>; export interface Logger { info(...args: unknown[]): void; warn(...args: unknown[]): void; error(...args: unknown[]): void; } export interface ModelCapability { provider: string; model: string; } export interface WorkerConfig { workerInstanceId?: string; concurrency?: number; name?: string; version?: string; queues?: string[]; actions?: string[]; models?: ModelCapability[]; reconnectDelayMs?: number; heartbeatIntervalMs?: number; logger?: Logger | null; } export interface ActionContext { jobId: string; sessionId?: string; agentTurnId?: string; toolCallId?: string; workerInstanceId: string; attempt: number; queue?: string; action?: string; emitEvent(type: string, payload: Record): void; } export type ActionFn = (params: Record, signal: AbortSignal, ctx: ActionContext) => Promise; export interface GenerationJob { jobId: string; sessionId?: string; agentTurnId?: string; toolCallId?: string; provider?: string; model?: string; spec: Record; } export type GenerationEmitter = (delta: Record) => void; export type GenerationFn = (ctx: ActionContext, job: GenerationJob, emit: GenerationEmitter) => Promise>; export declare class Worker { private readonly client; private readonly config; private readonly logger; private readonly actions; private readonly generators; private readonly registeredModels; private sessionToken; private stopping; private readonly stopController; private claimResponseTimeoutMs; constructor(client: Client, config?: WorkerConfig, actions?: Map); register(name: string, fn: ActionFn): this; registerGenerator(provider: string, model: string, fn: GenerationFn): this; stop(): void; run(signal?: AbortSignal): Promise; protected openSocket(): WebSocket; /** * The socket's X-Mobius-Client value: `worker/`, the version the * worker registers with, else the SDK's. The server counts socket traffic * as worker traffic by this name. */ protected clientHeader(): string; private runSocket; private terminalProtocolError; private registerFrame; private modelCapabilities; private executeJob; private generator; private actionContext; private report; } export interface WorkerPoolConfig extends Omit { count?: number; workerInstanceIdPrefix?: string; } export declare class WorkerPool { private readonly client; private readonly config; private readonly actions; private readonly generators; constructor(client: Client, config: WorkerPoolConfig); register(name: string, fn: ActionFn): this; registerGenerator(provider: string, model: string, fn: GenerationFn): this; run(signal?: AbortSignal): Promise; } //# sourceMappingURL=worker.d.ts.map