/** * Agent journal: per-agent markdown journal at `.harnery/journal/.md`. * * Rules: * - Single writer (the agent itself, via this lib). Peers read but never write. * - Append-only, newest entry first. Atomic temp-file + rename on each write. * - Strict entry-header format: `## · `. The * linter enforces this so format violations are impossible at the write path. * - 50 KB hard cap; auto-prunes oldest entries when exceeded. * - SessionEnd hook archives to `.harnery/journal/archived/-.md`; * SessionStart janitor deletes archives older than 7 days + surfaces the * most-recent archive as a recovery cue. */ export declare const JOURNAL_CATEGORIES: readonly ["note", "plan", "decision", "blocker", "question", "done", "handoff"]; export type JournalCategory = (typeof JOURNAL_CATEGORIES)[number]; export declare const MAX_JOURNAL_BYTES: number; export declare const WARN_JOURNAL_BYTES: number; export declare const ARCHIVE_RETENTION_DAYS = 7; /** Entry-header regex: `## 2026-05-15 1:48 AM CDT · note` */ export declare const ENTRY_HEADER_RE: RegExp; /** First line of every journal file: this prefix followed by the agent name. */ export declare const JOURNAL_HEADER_PREFIX = "# Journal: agent-"; export interface JournalEntry { ts_iso: string; ts_display: string; category: JournalCategory; body: string; } export interface JournalHeader { name: string; session_id: string; machine: string; started: string; last_updated: string; } export interface JournalDoc { path: string; header: JournalHeader; entries: JournalEntry[]; bytes: number; } export declare function journalDir(): string; export declare function archiveDir(): string; export declare function journalPath(instanceId: string): string; /** Format `Date` as `2026-05-15 1:48 AM CDT`, what we write into the file. */ export declare function formatChicago(d?: Date): string; /** Parse a journal file (or empty content) into a structured doc. */ export declare function parseJournal(path: string, content: string): JournalDoc; /** Serialize a parsed doc back to markdown. */ export declare function serializeJournal(doc: JournalDoc): string; export interface LintIssue { line: number; message: string; } export declare function lintJournal(content: string, byteCap?: number): LintIssue[]; export declare function appendEntry(instanceId: string, category: JournalCategory, body: string): JournalDoc; /** Move `.md` → `archived/-.md`. No-op if missing. Returns archive path (or null). */ export declare function archiveJournal(instanceId: string): string | null; /** Delete archives older than `days`. Returns number deleted. */ export declare function pruneArchives(days?: number): number; /** Sweep journals whose corresponding authoritative V3 generation is gone. */ export declare function sweepOrphanJournals(): string[]; /** List archive files sorted by mtime descending. */ export declare function listArchives(): { path: string; basename: string; mtimeMs: number; bytes: number; }[]; export declare function currentOwnerOrThrow(): string; export declare function loadJournal(instanceId: string): JournalDoc | null; /** Resolve an agent name through the authority-safe V3 coordination projection. */ export declare function resolveOwnerByName(name: string): string | null; //# sourceMappingURL=index.d.ts.map