/** * daemon/agentish-stats.ts — is AG2 actually cheaper, measured on the real * traffic between sessions rather than a hand-picked pair. * * `agentish measure` compares one message against a prose twin somebody * wrote to make the point. That is a demonstration, not a measurement: it * proves AG2 CAN be smaller, not that it IS, night after night, across every * session that is supposed to be speaking it. This reads the audit log * instead — every `send` between two sessions is already recorded there, * body and all — and classifies each one as AG2 or prose by running it * through the real validator, not a guess from its shape. */ /** * AG2 did not exist before this date, so a send from before it is prose * however it happens to parse — a validator that classified by shape alone * would call a coincidentally `k=v`-shaped sentence "AG2" and quietly * inflate the count of a format nobody was using yet. */ export declare const AG2_BASELINE_DATE = "2026-09-05"; export type MessageClass = "ag2" | "prose"; /** * Tokens, from raw characters — not tiktoken (no such dependency here), and * not the word-plus-punctuation counter `agentish.ts`'s `measure()` uses for * a pairwise comparison either. That counter treats `|`, `@`, `=` — AG2's * own punctuation — as one token each, the same as it treats an English * word; real tokenizers pack runs of ordinary text tighter than runs of * symbols. So this heuristic UNDERSTATES the AG2 side specifically, more * than it understates prose, which means the ratio this module prints is a * floor on the real saving, not a ceiling — read it as "at least this much", * never as "exactly this much". */ export declare function approxTokens(text: string): number; export interface AgentishStatsOptions { since?: Date; until?: Date; } export interface ClassSummary { count: number; totalTokens: number; meanTokens: number; medianTokens: number; } export interface DayRow { day: string; ag2: number; prose: number; } export interface AgentishStatsReport { ag2: ClassSummary; prose: ClassSummary; /** prose mean / ag2 mean, or null when either class has no messages. */ ratio: number | null; perDay: DayRow[]; baseline: string; heuristic: string; } /** * Every session-to-session `send` in the audit log, classified and summed. * Reads real messages, not samples — the whole point is that this is the * traffic that actually happened, not a fixture built to make a point. */ export declare function agentishStats(opts?: AgentishStatsOptions): AgentishStatsReport; /** The report, as a human reads it — never a bare ratio. */ export declare function formatStatsReport(r: AgentishStatsReport): string; //# sourceMappingURL=agentish-stats.d.ts.map