/** * Worker Daemon * * Main daemon loop that polls for jobs and executes them. */ import type { Env } from '@lobu/connector-sdk'; import type { AgentKind } from '@lobu/core/contracts/worker/device-automation'; import { type WorkerCapabilities } from './client.js'; import { type ExecutorConfig } from './executor.js'; export interface DaemonConfig { apiUrl: string; workerId: string; workerApiToken?: string; capabilities?: WorkerCapabilities; pollIntervalMs?: number; maxConcurrentJobs?: number; executor?: Partial; version?: string; /** Set only for a device worker; cloud-fleet daemons leave this undefined. */ platform?: string; /** Human-readable device name for the Devices page. */ label?: string; /** Device-manifest connector definitions to register on each poll. */ manifests?: unknown[]; /** Fixed advertisement for an exact interactive session. */ agentKinds?: AgentKind[]; workerCredentialMaintenance?: (activate: (workerApiToken: string) => void) => Promise; /** Backend capacities advertised to the gateway. */ backendCapacity?: Record; } /** * Worker Daemon * * Polls for jobs from the backend and executes them. */ export declare class WorkerDaemon { private client; private env; private config; private pollLoop; private shutdownController; constructor(daemonConfig: DaemonConfig, env: Env); /** * Start the daemon */ start(): Promise; installShutdownSignals(): void; /** * Stop the daemon */ stop(): void; /** * Wait for all active jobs to finish, with a timeout. * Returns true if all jobs completed, false if timed out. */ waitForActiveJobs(timeoutMs?: number, pollMs?: number): Promise; } /** * Start the worker daemon */ export declare function startDaemon(config: DaemonConfig, env: Env): Promise; //# sourceMappingURL=worker.d.ts.map