import type { Client } from "@libsql/client"; import { observeActiveActor, readIdentityCache, type FederationGhClient, type FederationInitBranch, type GhExecutor, type MaterializePodResult, type MeshGhClient, type CreationMutationEvidence, type CreationPlanV1, type RecoverDrop, type RecoverPodResult, type VaultCloneFn } from "@younndai/lyt-vault"; import type { HealResult } from "./heal.js"; export type InitBootstrapBranch = "fresh" | "re-init" | "discovery" | "adopt"; export type IntegrityStatus = "ok" | "missing" | "unparseable" | "orphaned-home-mesh"; export interface IntegrityIssue { vaultName: string; status: IntegrityStatus; error?: string; } export type DiscoveredRepoKind = "lyt-prefix" | "lyt-public-topic"; export interface DiscoveredRepo { fullName: string; kind: DiscoveredRepoKind; alreadyInRegistry: boolean; } export interface DiscoveryProbeResult { repos: DiscoveredRepo[]; } export interface DiscoveryProbe { probe(handle: string): Promise; } export interface InitBootstrapMeshAssignment { meshRidHex: string; meshName: string; meshAutoCreated: boolean; mainVaultName?: string; mainVaultPath?: string; } export interface InitBootstrapFederation { handle: string; fedRidHex: string; branch: FederationInitBranch; localPath: string; federationYonPath: string; remoteCreated: boolean; pushed: boolean; remoteFullName: string; } export interface InitBootstrapAdopt { podBranch: FederationInitBranch; podHandle: string; podLocalPath: string; vaultsRecoveredFromManifest: number; vaultsAcquired: number; manifestSkipped: { vaultName: string; reason: string; }[]; manifestDrops?: RecoverDrop[]; manifestRefused?: boolean; manifestRefusedKind?: RecoverPodResult["refusedKind"]; manifestRefusedReason?: string; firstVaultCreated: boolean; primaryVaultPath: string | null; primaryMeshName: string | null; reconciledVaultPaths: string[]; } export interface InitBootstrapResult { branch: InitBootstrapBranch; meshAssignment?: InitBootstrapMeshAssignment; federation?: InitBootstrapFederation; integrityIssues?: IntegrityIssue[]; discoveredRepos?: DiscoveredRepo[]; adopt?: InitBootstrapAdopt; adoptError?: { reason: string; }; heal?: HealResult; reconciledVaultPaths?: string[]; publish?: MaterializePodResult; creation?: { plan: CreationPlanV1; mutations: CreationMutationEvidence; podCheckpointCommitSha?: string; }; durationMs: number; } export type InitBootstrapMode = "auto" | "custom" | "discover"; export interface InitBootstrapCustomOverrides { meshName?: string; pushTarget?: string; starterFigment?: boolean; } export interface InitBootstrapArgs { mode: InitBootstrapMode; meshGhClient?: MeshGhClient; federationGhClient?: FederationGhClient; vaultCloneFn?: VaultCloneFn; ghExecutor?: GhExecutor; registryDb?: Client; nowIso?: string; discoveryProbe?: DiscoveryProbe; handle?: string; observeActor?: typeof observeActiveActor; customOverrides?: InitBootstrapCustomOverrides; heal?: (() => Promise) | undefined; materializePublish?: ((db: Client) => Promise) | undefined; refreshExistingPod?: ((db: Client) => Promise) | undefined; onPhase?: (op: string, label: string) => void | Promise; } export declare function probeFreshState(registryDb?: Client): Promise; export declare function resolveLocalFirst(cached: ReturnType): boolean; export declare function initBootstrapFlow(args: InitBootstrapArgs): Promise; //# sourceMappingURL=init-bootstrap.d.ts.map