EU Parliament Monitor — API Documentation - v0.8.44
    Preparing search index...

    Function stripArtifactMetadataPreamble

    • Strip the operational metadata preamble that agent pipelines prepend to artifacts. These are lines of the form **Run:** …, **Window:** …, **Methodology:** …, etc., followed optionally by a standalone --- horizontal rule. They are agent-operational metadata that should not appear in the published article.

      Algorithm:

      1. Skip leading blank lines (they don't count as metadata).
      2. If the first non-blank line does NOT match the metadata pattern, return the document unchanged (lines: 0).
      3. Otherwise consume all metadata lines and interspersed blank lines.
      4. If the next non-blank line is a standalone ---, consume that too.
      5. Return the stripped Markdown and the count of lines removed.

      Parameters

      • md: string

        Markdown source (after banner/heading passes)

      Returns { md: string; lines: number }

      { md, lines } — stripped Markdown and number of lines removed