| 1 | /** Times are unix seconds; paths have a leading slash and no `/file` prefix. */ |
| 2 | export interface ProcessorStats { |
| 3 | name: string; |
| 4 | /** What it does, like "encode av1 high". */ |
| 5 | title: string; |
| 6 | version: number; |
| 7 | /** False when this host lacks the tool it needs or lists it in CLOVER_PROCESSORS_DISABLE. */ |
| 8 | runnable: boolean; |
| 9 | /** Files whose extension this processor applies to. */ |
| 10 | applicable: number; |
| 11 | /** Done at the current version. */ |
| 12 | done: number; |
| 13 | failed: number; |
| 14 | /** Done at an older version; re-run on the next sweep. */ |
| 15 | stale: number; |
| 16 | /** Files and bytes in the derived store produced by this processor; none when it only records metadata. */ |
| 17 | outputs: number | null; |
| 18 | bytes: number | null; |
| 19 | /** Mean time one file takes. */ |
| 20 | seconds: number | null; |
| 21 | } |
| 22 | |
| 23 | export interface PaperCloverStats { |
| 24 | indexer: { enabled: boolean; watching: boolean; nextSweepAt: number | null }; |
| 25 | /** The latest full sweep; `endedAt` is null while it runs. */ |
| 26 | lastSweep: { startedAt: number; endedAt: number | null; error: string | null } | null; |
| 27 | files: number; |
| 28 | directories: number; |
| 29 | bytes: number; |
| 30 | /** Top-level folders, like "2026". */ |
| 31 | folders: { name: string; files: number; bytes: number }[]; |
| 32 | types: { ext: string; files: number; bytes: number }[]; |
| 33 | processors: ProcessorStats[]; |
| 34 | derived: { files: number; bytes: number }; |
| 35 | /** Files with a failed processor; `made` names the processors that did produce their output. */ |
| 36 | failures: { |
| 37 | path: string; |
| 38 | size: number; |
| 39 | mime: string; |
| 40 | made: string[]; |
| 41 | errors: { processor: string; error: string; at: number }[]; |
| 42 | }[]; |
| 43 | recent: { path: string; size: number; at: number }[]; |
| 44 | largest: { path: string; size: number; duration: number; dimensions: string }[]; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * A line of upstream's live progress tree (@clo/lib/progress `ReadOnlyNode`, decoded from its `/progress` stream), |
| 49 | * with hidden nodes and childless passive ones dropped the way its terminal renderer drops them. |
| 50 | */ |
| 51 | export interface ProgressNode { |
| 52 | /** The published file or folder a line is about, split off the front of upstream's "path - step" text. */ |
| 53 | path: string | null; |
| 54 | text: string; |
| 55 | /** Upstream's `valueFormatter(value, total)`, like "7/12"; empty when there's nothing to count. */ |
| 56 | count: string; |
| 57 | /** `value / total` when upstream draws a bar. */ |
| 58 | progress: number | null; |
| 59 | /** Estimated finish. */ |
| 60 | eta: number | null; |
| 61 | /** When the adapter first saw the node. */ |
| 62 | since: number; |
| 63 | /** ANSI stripped. */ |
| 64 | logs: { level: "error" | "warn" | "info" | "debug"; text: string }[]; |
| 65 | children: ProgressNode[]; |
| 66 | } |