export interface CostEntry { agent: string; usd: number; model?: string; round?: string; /** ISO-8601. Caller supplies — keeps the module testable. */ at: string; /** Where the cost was incurred (PR comment URL, run URL, etc.) */ source_url?: string; /** Optional token breakdown for forensic audits. */ tokens_in?: number; tokens_out?: number; cache_read?: number; cache_create?: number; } /** Sidecar path for a story's cost log. */ export declare function costSidecarPath(repoRoot: string, storyId: string): string; /** * Append one cost entry to the sidecar. Creates the file (and any * missing parent dirs) if it doesn't exist. Does NOT touch the spec * yaml — call `applyCostToSpec` separately so the caller controls * when the spec changes (one write at end-of-round vs N writes per * LLM call). */ export declare function appendCostEntry(repoRoot: string, storyId: string, entry: CostEntry): void; /** * Read + sum all entries in a story's sidecar. Tolerant of: * - missing sidecar (returns zero/empty). * - blank lines. * - malformed lines (logged via the optional callback; total uses parseable ones). */ export declare function readCostTotal(repoRoot: string, storyId: string, onMalformed?: (lineNo: number, raw: string) => void): { totalUsd: number; entries: CostEntry[]; }; /** * Recompute spec.cost.total_usd + spec.cost.last_updated from the * sidecar and write it back. Returns true if the spec was actually * modified (caller stages + commits). Safe to call when the spec * doesn't exist yet — returns false. * * Uses a low-fidelity YAML round-trip (parse + stringify) so it * preserves keys but doesn't preserve comments or key ordering. That's * acceptable for refine-emitted specs which don't carry hand-authored * comments. If we later want comment-preserving updates, switch to * yaml's Document API. */ export declare function applyCostToSpec(repoRoot: string, storyId: string, nowIso?: string): { changed: boolean; totalUsd: number; }; //# sourceMappingURL=cost-store.d.ts.map