import type { SettingValueOf } from "../config/registry.js"; import type { cfgStartupChangelogMode } from "../modes/settings.js"; export interface ChangelogEntry { major: number; minor: number; patch: number; content: string; } /** Number of changelog releases shown by automatic and default recent views. */ export declare const RECENT_CHANGELOG_ENTRY_LIMIT = 3; /** Maximum Markdown source bytes allowed in automatic startup release notes. */ export declare const STARTUP_CHANGELOG_MAX_BYTES: number; /** Hint appended when automatic startup release notes are truncated. */ export declare const STARTUP_CHANGELOG_FULL_HINT = "Use `/changelog full` to view the complete changelog."; /** Releases shown by `/changelog last` when no count is given. */ export declare const DEFAULT_LAST_CHANGELOG_COUNT = 1; /** Usage line printed when `/changelog` arguments are not `full` or `last [N]`. */ export declare const CHANGELOG_COMMAND_USAGE = "Usage: /changelog [full|last [N]]"; /** * Parsed `/changelog` view. `recent` is the bare default; `last` is an explicit count. */ export type ChangelogView = { kind: "full"; } | { kind: "recent"; count: number; } | { kind: "last"; count: number; }; /** * Parse `/changelog` arguments. `{ error }` is a usage string callers should print instead of entries. */ export declare function parseChangelogView(args: string): ChangelogView | { error: string; }; /** Newest-first slice for a parsed view. `full` returns a copy of every entry. */ export declare function selectChangelogEntries(entries: readonly ChangelogEntry[], view: ChangelogView): ChangelogEntry[]; /** Markdown generated from selected changelog entries and whether it hit a size cap. */ export interface RenderedChangelog { markdown: string; truncated: boolean; } /** Automatic startup changelog decision, including whether the marker should advance. */ export interface StartupChangelogSelection { markdown: string | undefined; persistCurrentVersion: boolean; truncated: boolean; selectedEntries: number; totalUnseenEntries: number; latestVersion: string | undefined; changeCount: number; categoryCounts: Record; } /** Format the compact, deterministic startup update notice. */ export declare function formatStartupChangelogSummary(selection: StartupChangelogSelection): string; /** * Parse changelog entries from omp's package asset when available, falling back * to the copy embedded in compiled binaries. * * The embedded fallback keeps standalone binaries self-contained without * resolving relative to the host project's cwd, which caused issue #1423. */ export declare function resolveBundledChangelogPath(assetPath: string, moduleUrl: string | URL): string | URL; export declare function parseChangelog(changelogPath: string | undefined): Promise; /** * Parse an omp changelog marker version into comparable parts. */ export declare function parseChangelogVersion(version: string | undefined): ChangelogEntry | undefined; /** * Get entries newer than lastVersion. */ export declare function getNewEntries(entries: ChangelogEntry[], lastVersion: string): ChangelogEntry[]; /** * Render changelog entries oldest-first by default and optionally cap the Markdown source size. */ export declare function renderChangelogEntries(entries: ChangelogEntry[], options?: { maxBytes?: number; truncationHint?: string; oldestFirst?: boolean; }): RenderedChangelog; /** * Select bounded release notes for interactive startup. */ export declare function selectStartupChangelog(entries: ChangelogEntry[], lastVersion: string | undefined, currentVersion: string): StartupChangelogSelection; /** * Resolve and persist the automatic startup changelog decision. * * `lastVersion` is the marker as this launch read it ({@link readLastChangelogVersion}); * `agentDir` locates the marker this call advances. * Hidden mode advances the marker only for an upgrade, so downgrades do not * erase knowledge of a newer version the user has already seen. */ export declare function resolveStartupChangelogForDisplay(options: { mode: SettingValueOf; currentVersion: string; lastVersion: string | undefined; changelogPath?: string; agentDir?: string; }): Promise; export { getChangelogPath } from "../config.js"; /** * Last omp version whose changelog the user has seen. Stored as a plain-text * marker file (`~/.omp/agent/last-changelog-version`) rather than in * `config.yml`, so version bumps never dirty user-tracked config files. */ export declare function readLastChangelogVersion(agentDir?: string): Promise; /** Persist the last-seen changelog version marker. Best-effort: failures are logged, never thrown. */ export declare function writeLastChangelogVersion(version: string, agentDir?: string): Promise;