import type { ClientId } from '@zhixuan92/multi-model-agent-core'; import { type ClientCapability } from './capability-registry.js'; import { type DeclaredClientRoster } from './roster.js'; import { type ProvisioningPhase } from './marker-store.js'; import { type ClientInventoryRecord } from './inventory.js'; import { type AcquireLockOptions } from './provisioning-lock.js'; import type { ClientProvisioningStatus, ProvisioningPort } from './provisioning-port.js'; export interface ProvisioningServiceDeps { stateDir: string; port: ProvisioningPort; declared: DeclaredClientRoster | undefined; detected: ReadonlySet; capabilities?: readonly ClientCapability[]; /** Re-read the declared roster from its durable source. `declared` is a * snapshot taken when this process started; another process may have changed * the declaration since, and after waiting on the provisioning lock that is * not a hypothetical — waiting is exactly when it happens. Defaults to the * snapshot for callers with no durable source to re-read (tests, and any * entry point invoked without a config file). */ readDeclared?: () => DeclaredClientRoster | undefined; /** Test seam for the cross-process lock's timing. */ lockOptions?: AcquireLockOptions; /** Test-only: called immediately after each marker phase is durably * written. Throwing simulates a crash at exactly that point. */ onPhaseWritten?: (clientId: ClientId, phase: ProvisioningPhase) => void; } export interface RecoveryReport { clientId: ClientId; resolved: boolean; reason?: string; } export interface ProvisionRunResult { byClient: Partial>; } export interface ProvisioningService { provision(ids: ClientId[]): Promise; provisionAll(): Promise; recoverOnStartup(): Promise; inventory(): Promise; } declare function buildService(deps: ProvisioningServiceDeps): ProvisioningService; /** Production entry point. `real-port.ts` supplies the filesystem-backed * `ProvisioningPort`; callers (the daemon boot sequence, the `mma clients` / * `mma mcp install` CLI surface) provide the rest. */ export declare const createProvisioningService: typeof buildService; export {}; //# sourceMappingURL=service.d.ts.map