/** * Index-graph registry status + drift surface (#1624). * * The durable index-graph registry already exists — built-in graphs, module- * declared graphs (framework/addon `manifest.json` → `index.graphs`), and * operator graphs (`.aiwg/aiwg.config` → `index.graphs`) all compose into * `GRAPH_CONFIGS`. But there was no reliable way to answer "which durable * indices exist, are they built, are they fresh, and is anything drifting?" * `aiwg index stats` is per-graph; nothing enumerated the whole registry. * * This module is that surface. `collectIndexStatus` is a pure-ish reader (no * mutation beyond the unavoidable `loadUserGraphConfigs` registry population) * that both `aiwg index status` and the `aiwg doctor` durable-index check * consume. `showIndexStatus` renders it (human table or JSON). * * @implements #1624 * @source @src/cli/handlers/subcommands.ts */ import { type GraphConfigWarning } from './types.js'; export interface GraphStatus { /** Graph name (e.g. `framework`, `project`, or a user/module graph). */ name: string; /** `builtin` (protected), `registered` (module- or operator-declared). */ origin: 'builtin' | 'registered'; /** Whether the graph index is shared across projects (XDG) vs project-local. */ shared: boolean; /** Included in a default `aiwg index build` (no flag). */ defaultBuild: boolean; /** Absolute path of the graph's index directory. */ location: string; /** Whether a built `metadata.json` exists at `location`. */ built: boolean; /** ISO timestamp the index was last built, or null when unbuilt/unreadable. */ builtAt: string | null; /** Hours since `builtAt` (rounded), or null. */ ageHours: number | null; /** Indexed entry count, or null when unbuilt. */ entries: number | null; /** * Registered with `defaultBuild` but no built index on disk — the * actionable "durable index is missing / never built" drift signal. */ missing: boolean; } export interface IndexStatusReport { graphs: GraphStatus[]; /** Index dirs found under `.aiwg/.index/` that match no registered graph. */ orphanIndexDirs: string[]; /** Non-silent graph-config load problems (#1624). */ warnings: GraphConfigWarning[]; /** Convenience roll-up for the doctor gate. */ summary: { total: number; built: number; missing: number; orphans: number; warnings: number; }; } /** * Enumerate every registered graph (built-in + module + operator) with its * build state, freshness, and drift, plus on-disk orphan index dirs and any * non-silent config-load warnings. * * @param nowMs - injectable clock for deterministic tests (defaults to Date.now()). */ export declare function collectIndexStatus(cwd: string, nowMs?: number): IndexStatusReport; /** Render `aiwg index status` (human table or JSON). */ export declare function showIndexStatus(cwd: string, opts?: { json?: boolean; }): Promise; //# sourceMappingURL=index-status.d.ts.map