/** * Memory row -> astramem/atom@1 wire shape (ADR-001, contracts/schemas/atom.v1.schema.json). * * astramem-local's storage columns are the pragmatic v1 form: flat * provenance fields (repo/project/agent/session_id), epoch-ms timestamps, * and a single evidence excerpt string. The wire contract nests provenance * and uses ISO 8601 timestamps to match the capture envelope precedent * (docs/capture-protocol.md) and to stay storage-engine-agnostic for the * cloud (.NET/Postgres) consumer. This mapper is the one place that * reconciles the two shapes — see contracts/README.md "Evidence * reconciliation" for why evidence is left as-is (string) rather than * upgraded to the array-of-refs form here. */ import type { Memory } from './memory.js'; export interface AtomWireV1 { schema: 'astramem/atom@1'; id: string; type: string; text: string; evidence: string | Array<{ transcript_id: string; span?: [number, number]; }>; confidence: number; importance: number; provenance: { tool: string | null; session_id: string | null; repo: string | null; project: string | null; extractor: string | null; }; valid_from: string; valid_to: string | null; superseded_by: string | null; derived_from: string[] | null; scope: string; content_hash: string; entities: string[]; created_at: string; updated_at: string; } /** * Serialize a local `memories` row into the astramem/atom@1 wire shape. * Pure function — no I/O, no DB access — so it is trivially unit-testable * and reusable from the (future) sync shipper (Wave 3d). */ export declare function toAtomWireV1(memory: Memory): AtomWireV1;