import type { SignedGrant, AuthorizationSubject } from './authorization.js'; export type WorkerLifecycle = 'REGISTERED' | 'READY' | 'BUSY' | 'DRAINING' | 'OFFLINE' | 'RECOVERING'; export type WorkerHealth = 'HEALTHY' | 'DEGRADED' | 'UNHEALTHY' | 'UNKNOWN'; export interface WorkerRegistration { tenant_id: string; application_id: string; name: string; runtime: 'wasm' | 'process' | 'container' | 'browser' | 'remote' | 'hosted' | 'edge' | 'customer'; version: string; capabilities: string[]; workload_kinds?: string[]; resource_profile?: Record; labels?: Record; capacity: { concurrency: number; active?: number; }; authorization_grant: SignedGrant; registered_by: AuthorizationSubject; registered_at?: number; } export interface Worker { worker_id: string; tenant_id: string; application_id: string; name: string; runtime: string; version: string; declared_capabilities: string[]; granted_capabilities: string[]; workload_kinds: string[]; labels: Record; capacity: { concurrency: number; active: number; }; health: WorkerHealth; lifecycle: WorkerLifecycle; last_seen: number; capability_version: number; claims: string[]; } export interface WorkerPool { pool_id: string; tenant_id: string; application_id?: string; name: string; capabilities: string[]; required_labels?: Record; worker_ids: string[]; max_concurrency?: number; created_at: number; } declare class MeshTransport { protected baseUrl: string; protected fetcher: typeof fetch; constructor(baseUrl?: string, fetcher?: typeof fetch); protected json(path: string, init?: RequestInit): Promise; } export declare class WorkerClient extends MeshTransport { register(input: WorkerRegistration): Promise; list(applicationId: string): Promise<{ workers: Worker[]; }>; inspect(id: string): Promise; heartbeat(id: string, heartbeat: unknown, grant: SignedGrant): Promise; drain(id: string, grant: SignedGrant): Promise; recover(id: string, grant: SignedGrant): Promise; reconcile(id: string, reconciliation: unknown, grant: SignedGrant): Promise; } export declare class WorkerPoolClient extends MeshTransport { list(applicationId: string): Promise<{ pools: WorkerPool[]; }>; create(pool: WorkerPool, grant: SignedGrant): Promise; inspect(id: string): Promise; } export declare class MeshClient extends MeshTransport { status(applicationId: string): Promise<{ workers: Worker[]; pools: WorkerPool[]; ready: number; busy: number; }>; eligibleWorkers(workloadId: string): Promise<{ eligible_workers: string[]; }>; } export {}; //# sourceMappingURL=worker.d.ts.map