/** * Session facts the sidebar and footer show, derived from the session branch and tool events. * * - usage: token and cost totals over the current branch (cached by entry count + leaf id) * - modified files: paths written by edit/write tool calls in the branch, with +/- line counts * - todos: the latest todo list a `todo`/`todowrite` style tool reported, if any * - git: branch and dirty counts, refreshed after each agent run */ import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; export interface UsageTotals { input: number; output: number; cacheRead: number; cacheWrite: number; cost: number; } export interface TodoItem { text: string; done: boolean; active?: boolean; } export interface GitInfo { branch?: string; dirty: number; ahead: number; behind: number; /** True when cwd is in a linked worktree rather than the main checkout. */ worktree?: boolean; } export declare function branchKey(ctx: ExtensionContext): string; export declare function usageTotals(ctx: ExtensionContext): UsageTotals; /** Count +/- lines in a unified-ish diff string. */ export declare function diffStats(diff: string | undefined): { added: number; removed: number; }; /** Latest todo list from a todo-style tool result in the branch (pi's todo example, todowrite, ...). */ export declare function latestTodos(ctx: ExtensionContext): TodoItem[]; export declare function readGit(cwd: string): Promise;