/** * Shared, dependency-free changelog parsing + serialization. * * Used by BOTH: * - the browser bundle (rendering an app's CHANGELOG.md in the command * menu / settings "What's new" surface), and * - the `agent-native changelog` CLI (rolling pending entry files up into * CHANGELOG.md). * * Keep this file isomorphic: no Node, no browser, no third-party deps. The * markdown shape is the conventional "Keep a Changelog" layout — a top-level * `# Changelog` heading followed by one `## ` section per release. */ /** A single released section of a CHANGELOG.md file. */ export interface ChangelogEntry { /** Stable id derived from the heading — used for "unseen" tracking. */ id: string; /** Raw heading text, e.g. `2026-06-23` or `v1.2.0 — 2026-06-23`. */ title: string; /** ISO date (YYYY-MM-DD) extracted from the heading, if present. */ date?: string; /** Version label extracted from the heading, if present. */ version?: string; /** Markdown body beneath the heading (until the next `## ` section). */ body: string; } /** A not-yet-released entry authored as a `changelog/.md` file. */ export interface PendingChangelogEntry { /** Category — `added`, `improved`, `fixed`, `changed`, etc. */ type: ChangelogChangeType; /** ISO date the entry was authored (YYYY-MM-DD). */ date?: string; /** User-facing description (markdown, single bullet). */ text: string; } export type ChangelogChangeType = "added" | "improved" | "fixed" | "changed" | "removed" | "security"; /** * Order changes are grouped under a release heading. Anything not listed here * falls back to the "changed" group, then renders in insertion order. */ export declare const CHANGELOG_GROUP_ORDER: ChangelogChangeType[]; declare const GROUP_LABELS: Record; /** Lowercase, hyphenate, and strip to a URL/id-safe slug. */ export declare function changelogSlug(value: string): string; /** * Parse a CHANGELOG.md document into structured release entries. * * Tolerant by design: an empty or malformed file yields an empty list rather * than throwing, so a missing/partial changelog never breaks the UI. */ export declare function parseChangelog(markdown: string): ChangelogEntry[]; /** * Parse a pending `changelog/.md` entry: optional `---` frontmatter * (`type:` / `date:`) followed by the markdown description body. Callers that * know the entry filename can provide its date as a fallback for hand-written * entries that omit `date:`. */ export declare function parsePendingEntry(content: string, fallbackDate?: string): PendingChangelogEntry; /** * Render a set of pending entries as a single dated release section (the body * that goes beneath a `## ` heading). Groups bullets by type. */ export declare function renderReleaseBody(entries: PendingChangelogEntry[]): string; declare const CHANGELOG_HEADER: string; /** * Roll a batch of pending entries into an existing CHANGELOG.md document, * prepending a new `## ` section above the most recent release. Returns * the full updated document. Pure — the CLI handles file IO and deletion. */ export declare function rollupChangelog(existing: string, pending: PendingChangelogEntry[], releaseDate: string): string; /** * Render an app-facing changelog that includes both released CHANGELOG.md * sections and adjacent pending `changelog/*.md` entries. Unlike `release`, * this is pure and non-destructive, so build/dev bundles can show current * product notes without deleting the conflict-free pending files. */ export declare function mergePendingChangelog(existing: string, pending: PendingChangelogEntry[]): string; export { CHANGELOG_HEADER, GROUP_LABELS }; //# sourceMappingURL=parse.d.ts.map