/** * Multi-document YAML stream assembly for the knowledge sources. * * Every writer here builds a stream from two kinds of part, and they disagree * about the document marker: * * - `stringify(obj)` emits the body only, never a leading `---`. * - `Document.toString()` on a doc parsed out of a stream emits its own * `---` for every document that had one — i.e. all but the first. * * Joining both with `'---\n'` doubled the marker on every preserved document, * which inserts an empty document between each pair of real ones. Valid YAML, * a different document stream, and a whole-file diff for a command that * changed nothing (bugfix knowledge-rebuild-readonly/AC-2). * * `joinDocuments` normalizes by *adding* a marker only where one is missing, * never by re-serializing: a part that already carries its own marker is * emitted verbatim, so hand-written comments and scalar quoting survive the * round trip. For callers that feed it only `stringify` output the result is * byte-identical to the old join (AC-3). * * Requirements: knowledge-rebuild-readonly/AC-2, AC-3 * * @module */ /** * True when `text` opens a YAML document explicitly — a `---` line reached * before any content, looking past blank lines, comments and directives. */ export declare function startsWithDocumentMarker(text: string): boolean; /** * Concatenate serialized YAML documents into one stream with exactly one * `---` between consecutive documents. * * The first emitted part keeps whatever it had — the knowledge sources open * with a bare `_meta:` mapping and no marker, and a file that does open with * one is left alone rather than reformatted. Empty parts are dropped. * * @param parts - Serialized documents, in output order. */ export declare function joinDocuments(parts: string[]): string; //# sourceMappingURL=yaml-documents.d.ts.map