/** * @fileoverview Sidecar v2 โ€” pooled, position-indexed attribution * format. One sidecar per generated file. Lives at * `/.skmtc//.maps/.skm.json` (Phase D * wires the path). * * Stable enough for round-trip via Valibot (see {@link sidecarSchema}). * Format details: docs/notes/gen-maps/plan.md ยง4.1. */ import * as v from 'valibot'; /** * Registry pool entry. References the JSR-protocol registry that * hosts a generator's source โ€” `jsr.io` for public, `jsr.skmtc.dev` * for the SKMTC private registry, plus any future SKMTC-compatible * hosts. */ export declare const registryEntry: v.ObjectSchema<{ readonly host: v.StringSchema; readonly type: v.UnionSchema<[v.LiteralSchema<"jsr", undefined>, v.LiteralSchema<"jsr-private", undefined>], undefined>; }, undefined>; /** * Generator pool entry. `r` indexes into the registry pool so the * viewer can build a URL without baking the registry host into every * generator entry. */ export declare const generatorEntry: v.ObjectSchema<{ readonly name: v.StringSchema; readonly version: v.StringSchema; readonly r: v.NumberSchema; }, undefined>; /** * One row in the anchor table. Tuple of pool indices + byte range: * * `[Li, Pi, gi, si, vi, fromByte, toByte]` * * Where `Li` = landmark, `Pi` = AST path, `gi` = generator, * `si` = schema pointer, `vi` = variant. Each index is a non-negative * integer; pools are flat string arrays (or objects for `R` / `G`). */ export declare const anchorRow: v.TupleSchema<[v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema], undefined>; /** * Sidecar v2. JSON document carried alongside each generated file. * * - `v` is the format version. Phase 0 froze v2; format evolution * bumps this number and ships an adapter in the viewer. * - `f` is the file path (relative to `basePath`), `src` is the * schema source the producer ran against. * - `parser` is `"@"` (e.g. `"tsc@5.6.3"`); consumers * that re-anchor a reformatted file warn on mismatch. * - `R`, `G`, `S`, `V`, `L`, `P` are pools. `A` is the anchor table * keyed into them. * - `N` is the producer-name pool (each producer's own class name); * `An` is parallel to `A` โ€” `An[i]` indexes into `N` for `A[i]`'s * producer. Both are optional + additive (the `A` tuple stays at 7), * so v2 consumers that don't know about them are unaffected. */ export declare const sidecarSchema: v.ObjectSchema<{ readonly v: v.LiteralSchema<2, undefined>; readonly f: v.StringSchema; readonly src: v.StringSchema; readonly parser: v.StringSchema; readonly R: v.ArraySchema; readonly type: v.UnionSchema<[v.LiteralSchema<"jsr", undefined>, v.LiteralSchema<"jsr-private", undefined>], undefined>; }, undefined>, undefined>; readonly G: v.ArraySchema; readonly version: v.StringSchema; readonly r: v.NumberSchema; }, undefined>, undefined>; readonly S: v.ArraySchema, undefined>; readonly V: v.ArraySchema, undefined>; readonly L: v.ArraySchema, undefined>; readonly P: v.ArraySchema, undefined>; readonly A: v.ArraySchema, v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema, v.NumberSchema], undefined>, undefined>; readonly N: v.OptionalSchema, undefined>, undefined>; readonly An: v.OptionalSchema, undefined>, undefined>; }, undefined>; export type Sidecar = v.InferOutput; export type RegistryEntry = v.InferOutput; export type GeneratorEntry = v.InferOutput; export type AnchorRow = v.InferOutput; /** * Empty sidecar with the given file/source/parser metadata. Anchor * pools start empty and grow via `intern`-style appends during * `buildSidecar`. */ export declare const emptySidecar: (filePath: string, schemaSrc: string, parser: string) => Sidecar;