// patterns.mjs - THE FORMAT GRAMMAR. // // Every regex below is preceded by a verbatim example of the transcript bytes it matches. // This file is the single source of truth for what SpecStory transcripts look like, across // providers and eras; parse.mjs consumes these names and contains no inline format knowledge. // // Eras (verified against specstory-cli source + a 1,311-session real corpus): // MODERN (Markdown v2.x, ~Oct 2025+): tool calls wrapped in HTML envelopes. // LEGACY (~Jun–Oct 2025): bare "Tool use: **Name**" lines, no envelope. // Both eras share the session header and the _**User/Agent**_ turn markers. // ───────────────────────────── 1. SESSION ENVELOPE ───────────────────────────── // // // (provider names vary, incl. lowercase) // Capture 1 = provider name (slugified into the agent tag), capture 2 = session UUID. export const SESSION_HDR = /