/** * Filesystem layout + version identity for the connector seeding engine. Everything the reconcile * writes lives under `/cotal/seed/`, a sibling of the `extensions/` npm prefix — the prefix * is npm-owned (a stray dir there would confuse `npm install`), the seed state is ours. * * The seed store is DURABLE by design: `npm install --install-links ` normalizes a `file:` dep * pointing at ``, so a volatile source (an `npx` `_npx` cache) would later fail to reify. We * copy each shipped connector payload into `store//` and `ext add` from THAT stable * path, keyed by the binary's version so a `cotal-ai` upgrade lands a fresh generation. */ /** The first-party seeded extensions, in a stable seed order: the connectors plus the web dashboard. * Keys of {@link SEEDED_EXTENSIONS}. */ export declare const SEED_BUILTINS: readonly string[]; /** `/cotal/seed` — the seed engine's own state root (NOT inside the npm prefix). */ export declare function seedDir(): string; /** The monotonic ever-seeded authority: which built-ins were ever seeded (never shrinks). */ export declare function authorityPath(): string; /** The durable append-only backup of the authority — the ONLY source `ext seed --repair` can * recover a lost {@link authorityPath} from (a witness alone can't tell removed from never-seeded). */ export declare function authorityBackupPath(): string; /** The initialization witness: proof the seeder ever ran here (distinguishes a pristine prefix from * one whose authority was lost). Written after the authority, before the stamp. */ export declare function witnessPath(): string; /** The version stamp, written LAST: the generation the last reconcile completed for. A boot whose * stamp equals the current generation short-circuits (after the health preamble). */ export declare function stampPath(): string; /** The reconcile-wide lock (shared advisory-lock primitive: atomic hard-link publish, PID + * process-start liveness, bounded wait, dead-owner reclaim). */ export declare function reconcileLockPath(): string; /** The durable reconcile cursor `{nonce, package, phase}`: a partial-reconcile journal a crashed * (SIGKILL) run leaves behind, so the next boot fails loud instead of silently proceeding. */ export declare function reconcileCursorPath(): string; /** The seed-child liveness marker `{pid, start, ts}`: a validated `ext add` seed child writes it * before it mutates the prefix and clears it on exit, so a reclaim/repair after a parent SIGKILL can * refuse to race an orphaned child that is still installing. */ export declare function reconcileChildPath(): string; /** The durable maintenance-recovery obligation `{rebuildFromDisk?, repairAllSeeded?}`: a `--repair`/ * `--reset` writes it BEFORE it destructively quarantines a corrupt manifest/cursor, so a SIGKILL * after the quarantine but before the reinstalls doesn't forget that the built-ins must be rebuilt * from disk (or all reinstalled). Cleared only at the final commit. */ export declare function reconcileRecoveryPath(): string; /** The durable seed store root: `/cotal/seed/store`. */ export declare function seedStoreDir(): string; /** A seeded connector's stable copy for one generation: `store//`. */ export declare function seedStorePath(generation: string, name: string): string; export type SeedWriterKind = "released" | "checkout" | "unknown"; /** * Who is about to mutate the operator-global seed store. Fail closed: a released * install or an npx unpack is allowed; a source checkout is refused; anything * that cannot be proven is `unknown` and is also refused. A missing answer is * never treated as a released install. */ export declare function seedWriterKind(): SeedWriterKind; /** * Refuse a checkout (or unproven) writer before it can copy payloads, stamp a * generation, or GC an installed one. `COTAL_ALLOW_CHECKOUT_SEED=1` is the * deliberate opt-in for a sandboxed release test. */ export declare function assertReleasedSeedWriter(generation: string, action: string): void; /** Resolve package-manager bin symlinks to the exact CLI entry this process is running. */ export declare function entryScript(): string; /** The package root that owns this process's resolved entry script. This is the shared artifact * identity for version and provenance reporting, so a package-manager bin symlink cannot make the * two surfaces describe different installs. */ export declare function cliPackageRoot(): string; /** * This `cotal-ai` binary's published version — the nearest `package.json` above the {@link entryScript} * (`cotal-ai` published, or `bin/package.json` in a dev `tsx bin/cotal.ts` run). Surfaced by * `cotal version` and `cotal status`. Fails loud if unreadable. */ export declare function cliVersion(): string; /** * The seed generation: this binary's version ({@link cliVersion}). Ties a reconcile-refresh to the * shipped payload changing — including the bundled `connector-core`, so a `cotal-ai` upgrade re-seeds * the connectors that carry version-coupled behavior (e.g. the v0.4 lifecycle parse). Fails loud if * unreadable — a generation-less seed can't gate refresh. */ export declare function seedGeneration(): string; /** True iff `v` parses as a numeric-core semver (the only thing the refresh comparison can order). */ export declare function isValidSemver(v: string): boolean; export interface Semver { readonly rel: [number, number, number]; readonly pre: string[]; } export declare function parseSemver(v: string): Semver; /** * The shipped payload directory for one built-in connector — the source the reconcile copies into the * durable store. Dev resolves `extensions/` from this module's location (NEVER `cwd`); * published resolves `/seeded-connectors/` beside the {@link entryScript} (the `bin` * prepublish copy). Fails loud if neither carries a `package.json` — a build missing its seeded * connectors. */ export declare function shippedSourceDir(name: string): string; /** Atomically write JSON (temp-then-rename, exclusive temp — never follows a pre-planted symlink), * the same durability `writeLaunchSpec`/manifest writes use. Creates the parent dir. */ export declare function writeJsonAtomic(path: string, value: unknown, mode?: number): void; /** Read + parse a JSON state file. Returns undefined when absent; throws (loud) on corrupt JSON — a * seed-state file is never silently treated as missing (that would resurrect removed connectors). */ export declare function readJsonFile(path: string): T | undefined; //# sourceMappingURL=paths.d.ts.map