import type { SyncOptions, SyncResult } from "../cli/sync.js"; import type { ShareOptions, ShareResult } from "../cli/share.js"; import type { ConflictStrategy } from "../cli/conflict.js"; import type { UploadAuthor } from "../s3.js"; import type { VaultServiceConfig } from "../index.js"; import { fetchFileTombstones as defaultFetchFileTombstones } from "../cli/tombstones.js"; import { type ScopeInventoryGate } from "../sync/scope-inventory-client.js"; import { type CloudTelemetryClient, type TelemetryClaims } from "../telemetry-events.js"; import type { DeletePropagationPolicy, Direction, RunnerEvent, VaultClientSurface } from "./sync-runner.js"; import type { RunnerTarget } from "./sync-runner-planning.js"; import { type CompanyState } from "./sync-runner-rollup.js"; import type { ReconcileApplyCheckpoint } from "../sync/reconcile-cursor.js"; import type { CooperativePassCheckpoint } from "./sync-runner.js"; export interface CompanyFanoutResult { stateByCompany: Map; errors: Array<{ company: string; message: string; }>; companyFailures: Array<{ company: string; message: string; }>; transientCompanies: Array<{ company: string; message: string; }>; meaningfulOutcomeCount: number; allConflicts: Array<{ company: string; path: string; direction: "pull" | "push"; }>; pushPathResults: Array<{ relativePath: string; status: "accepted" | "refused"; operation: "delete" | "tombstone"; reason?: string; }>; /** Successful remote regular-file upserts in the watcher's path namespace. */ appliedUpserts: Array<{ relativePath: string; contentHash: string; }>; } export declare function executeCompanyFanout(options: { plan: RunnerTarget[]; direction: Direction; hqRoot: string; onConflict: ConflictStrategy; client: VaultClientSurface; vaultConfig: VaultServiceConfig; /** Test seam; production uses the fail-closed FILE_TOMBSTONE reader. */ fetchFileTombstones?: typeof defaultFetchFileTombstones; uploadAuthor?: UploadAuthor; operationLockAlreadyHeld?: boolean; syncFn: (options: SyncOptions) => Promise; shareFn: (options: ShareOptions) => Promise; resolveDeletePolicy: () => DeletePropagationPolicy; emit: (event: RunnerEvent) => void; /** Rate-limited liveness callback for synchronous engine planning loops. */ onHeartbeat?: () => void; /** * Called after each fully-settled target leg when a watch-mode full chore is * cooperatively yielding its root lock to queued realtime work. */ cooperativeCheckpoint?: CooperativePassCheckpoint; /** * Reports durable pull writes before a cooperative checkpoint can lend the * root lock to watcher work, so the watcher never republishes those bytes. */ onAppliedUpserts?: (upserts: ReadonlyArray<{ relativePath: string; contentHash: string; }>) => void; scopePaths?: string[]; deleteScopePaths?: string[]; telemetryClient?: CloudTelemetryClient | null; telemetryClaims?: TelemetryClaims | null; telemetrySessionId?: string; /** * Dormant realtime admission seam. When installed, each target refreshes * inventory before legacy membership resolution, push, or pull. Only an * explicit legacy grant may enter this V1 runner; V2/reset/revoked scopes * stop here and are owned by their dedicated realtime scheduler. */ scopeInventoryGate?: ScopeInventoryGate; /** * Ensure a company's local directory exists (recursive mkdir). Injected so * tests don't touch a developer's filesystem. Defaults to `fs.mkdirSync(dir, * { recursive: true })`. Called after a completed non-personal pull leg so a * company a member can SEE is materialized locally even when zero files were * shared with them (see the ensure block below). */ ensureCompanyDir?: (dir: string) => void; /** * Optional area-layout adapter. Legacy journal authority remains the * default until a layout-aware launcher explicitly opts in. */ reconcileApplyForTarget?: (target: RunnerTarget) => ReconcileApplyCheckpoint | undefined; }): Promise; //# sourceMappingURL=sync-runner-company.d.ts.map