import { n as EventPayload, r as EventSubscriber } from "./event-subscriber-base-DOVIZK7N.js"; //#region src/architecture-snapshot.d.ts /** * Public, versioned snapshot format. The generator and any downstream tooling * target this spec. Bumping the spec version is a breaking change for * downstream consumers, so add fields rather than rename existing ones. */ declare const ARCHITECTURE_SNAPSHOT_SPEC: "autotel-architecture/v0.1.0"; type ArchitectureSnapshot = { spec: typeof ARCHITECTURE_SNAPSHOT_SPEC; generatedAt: string; service: string; events: Record; }; type EventObservation = { name: string; observedCount: number; firstSeen: string; lastSeen: string; /** Dotted field paths observed in any payload (e.g. `items[].sku`). */ fieldPaths: string[]; /** Up to 3 trace IDs for click-through from the catalog into the backend. */ sampleTraceIds: string[]; /** Channel the event was published on, if the caller provided `_autotel.channel`. */ channel?: string; /** Service that produced the event, if not the snapshot's own service. */ producer?: string; /** Services known to consume this event (optional metadata from _autotel.consumers). */ consumers?: string[]; /** Observed runtime types and sample primitive values per field path. */ fieldStats?: Record; /** Optional contract schema metadata carried from track() call sites. */ schema?: { source: 'zod'; jsonSchema: unknown; hash: string; }; }; type FieldStats = { /** Runtime types observed for this field path (e.g. string, number). */types: string[]; /** Small set of observed primitive values (for enum/value drift checks). */ sampleValues: Array; }; interface ArchitectureSnapshotConfig { /** Service identifier that appears in the snapshot header. */ service: string; /** Maximum number of trace IDs to retain per event (default 3). */ maxSampleTraceIds?: number; } declare class ArchitectureSnapshotSubscriber extends EventSubscriber { readonly name = "ArchitectureSnapshotSubscriber"; private readonly service; private readonly maxSampleTraceIds; private readonly observations; constructor(config: ArchitectureSnapshotConfig); protected sendToDestination(payload: EventPayload): Promise; /** * Build the snapshot in memory. Use this in tests or when you want to * inspect the result before writing it. Field paths and trace IDs are * sorted so equal inputs always produce byte-identical snapshots. * * @param options.now Clock used for the snapshot's `generatedAt` field. * @param options.freezeTimestamps If supplied, every timestamp in the * output (`generatedAt`, and each event's `firstSeen` / `lastSeen`) * is replaced with this value. Use when writing a snapshot intended * to be committed to a repo as a stable artifact — production code * should not pass this. */ toSnapshot(options?: { now?: () => Date; freezeTimestamps?: string; }): ArchitectureSnapshot; /** * Write the snapshot to disk. Creates parent directories as needed. * Files are written with a trailing newline so they diff cleanly in git. * * See {@link toSnapshot} for option semantics, including `freezeTimestamps` * for byte-stable committed artifacts. */ writeToFile(filePath: string, options?: { now?: () => Date; freezeTimestamps?: string; }): Promise; /** Reset all accumulated state. Useful between test cases. */ reset(): void; } /** * Walk a JSON-like value and produce a sorted list of dotted field paths. * Arrays collapse with `[]`, so `items: [{ sku: 'x' }]` yields `items[].sku`. */ declare function extractFieldPaths(value: unknown, prefix?: string): string[]; //#endregion export { ARCHITECTURE_SNAPSHOT_SPEC, ArchitectureSnapshot, ArchitectureSnapshotConfig, ArchitectureSnapshotSubscriber, EventObservation, FieldStats, extractFieldPaths }; //# sourceMappingURL=architecture-snapshot.d.ts.map