import { type ImportRulesResult } from './import-client.js'; import type { DiscoveredGuideFile } from './discover.js'; export type ImportDiscoveredGuidesOptions = { dashboardUrl: string; token: string; /** Checkout digest (`repoIdFromRoot`); see `ImportRulesOptions.repoId`. */ repoId?: string; /** * The repo's declared portable identity; see `ImportRulesOptions.projectId`. * Travels with `repoId` and is withheld from the global batch on exactly the * same grounds — a file outside this checkout belongs to no project either. */ projectId?: string; /** * Absolute repo root `repoId` was derived from. Required alongside `repoId` * to split `--global` files out — a file outside this root belongs to no * checkout and must not be stamped with this one's id. */ repoRoot?: string; /** * Where the **pre-consolidation** guide baseline lives. Defaults to * `~/.auden/state/guide-baselines.json`; overridden only by tests, which must * not read or write the real user's store. * * Read-only now: it is the fallback for a machine whose last import predates * the machine cache, and the write below folds what it finds into the cache at * the file's real absolute path. Nothing writes it any more. */ baselinePath?: string; /** * Where the machine cache lives (`state/machine-cache.ts`). Defaults to * `~/.auden/state/machine-cache.json`; overridden only by tests, for the same * reason `baselinePath` is. */ machineCachePath?: string; /** * `expectedVersion` per `(root, path)`, overriding the machine-local baseline * for exactly the files it names — how an explicitly confirmed conflict * resolution is sent (`resolveGuideImportConflicts`). * * Kept as an override on this one path rather than as a "force" flag on the * wire: the server's precondition stays a version it can check, so a * resolution the user confirmed against version N still refuses if the * dashboard moved to N+1 while they were deciding. */ expectedVersions?: ReadonlyMap; /** Override fetch for tests. Defaults to globalThis.fetch. */ fetchImpl?: typeof fetch; }; /** * `(root, path)` as one lookup key for {@link ImportDiscoveredGuidesOptions.expectedVersions}. * Separator matches the baseline store's for the same reason it does there. */ export declare const importOverrideKey: (root: string, path: string) => string; /** * Send already-discovered guide files to the dashboard — the repo→dashboard * direction of `auden init`, and the tail of `auden import`. * * Discovery stays the caller's job: `auden init` scans before it writes its own * AGENTS.md stub and bundled skills, so the offer it makes covers only files * the user already had. * * **The machine-local baseline is read and written here, not by the callers.** * Sending `expectedVersion` and recording what came back are two halves of one * precondition, and a caller that did the first without the second would send a * stale version forever while its imports quietly conflicted. Both `auden init` * and `auden import` reach the server through this function, so this is * the one place where neither half can be forgotten * (`guide-versioned-identity-plan.md` → slice 2b-B). */ export declare function importDiscoveredGuides(files: ReadonlyArray, options: ImportDiscoveredGuidesOptions): Promise; /** A file the server refused, paired back with the payload that produced it. */ export type GuideImportConflict = { file: DiscoveredGuideFile; /** The version the dashboard holds — the precondition an override must send. */ version: number; }; /** * Pair each refused result back with the file it came from. * * Matched on `(root, path)` because that is the identity the server answered * with; a conflict naming a file this run did not send is dropped rather than * guessed at. */ export declare function guideImportConflicts(files: ReadonlyArray, result: ImportRulesResult): GuideImportConflict[]; /** * Re-send refused files with the dashboard's current version as their * `expectedVersion` — the explicit resolution half of the baseline design * (D10: *"an edited file with no baseline is reported as a conflict requiring * explicit resolution"*). * * **This is not a force flag, and the difference matters.** The server still * checks the precondition; what the user confirms is a *specific* version, so a * dashboard edit landing while they were deciding refuses again instead of * being swallowed. It also cannot overwrite an autosave in progress — that is * content no version has captured, so no version can license it. */ export declare function resolveGuideImportConflicts(conflicts: ReadonlyArray, options: ImportDiscoveredGuidesOptions): Promise; /** * Render the shared "what landed" lines so `auden init` and `auden guides * import` report an import identically. */ export declare function formatImportSummary(result: ImportRulesResult): string[]; //# sourceMappingURL=init-import.d.ts.map