import type { PlanContext } from "../internals/plan.js"; /** * The append-only usage event log behind `aih report`'s usage analytics. Events * are written at runtime by capture hooks (a universal git `post-commit` hook now; * per-tool skill/MCP hooks next), one JSON object per line in `.aih/usage.jsonl` * (gitignored live data). This module only READS + aggregates — the recorder that * writes is generated by `aih usage` (see `capture.ts`). */ export declare const USAGE_PATH = ".aih/usage.jsonl"; /** Optional local token/cache counters. Omitted counters mean "not captured", not zeroed telemetry. */ export interface UsageTokens { input?: number; output?: number; cacheRead?: number; cacheCreation?: number; } /** A single recorded usage event. `kind` says what happened; the rest is optional. */ export interface UsageEvent { /** Stable local event id, when an importer can derive one without storing content. */ id?: string; /** ISO timestamp the event was recorded (runtime wall-clock from the hook). */ ts?: string; /** Which tool produced it: "git" (universal floor), or a CLI name (claude, …). */ tool: string; /** commit (git activity) · skill · mcp · session · tool (generic tool call). */ kind: "commit" | "skill" | "mcp" | "session" | "tool"; /** Skill / command / MCP-tool name, when applicable. */ name?: string; /** MCP server, for kind="mcp". */ server?: string; /** Skill provenance, when the capturing hook can attribute it. */ source?: "ecc" | "canon" | "user"; /** Commit deltas, for kind="commit". */ added?: number; removed?: number; files?: number; sha?: string; /** Commit branch (kind="commit"); captured going forward — older events lack it. */ branch?: string; /** Local token/cache counters when a CLI hook can provide them. */ tokens?: UsageTokens; } /** Read + parse `.aih/usage.jsonl`, skipping malformed/invalid lines. */ export declare function readUsage(ctx: PlanContext): UsageEvent[];