import { Ontology, OntologyNodeKind } from './types.js'; /** A node reference rendered as a chip in a table cell. */ export interface NodeChip { id: string; name: string; kind: OntologyNodeKind; } /** A process adjacent in the resource flow, with the resources that * connect it — the row-level answer to "how does this process affect * the next one". */ export interface FlowNeighbor { id: string; name: string; /** Names of the resources carrying the dependency. */ via: string[]; } /** One process leaf row. */ export interface ProcessRow { id: string; name: string; description: string | undefined; /** 1-based global value-chain stage (longest-path layer of the SCC * condensation). Identical for every member of a resource cycle. */ stage: number; /** True iff this process is in a resource-flow cycle (SCC size > 1). */ cyclic: boolean; /** Names of the other processes in the same cycle (empty if acyclic). */ cycleWith: string[]; /** Processes that produce a resource this one uses (what feeds me). */ upstream: FlowNeighbor[]; /** Processes that use a resource this one produces (what I feed). */ downstream: FlowNeighbor[]; uses: NodeChip[]; produces: NodeChip[]; kpis: NodeChip[]; data: NodeChip[]; decisions: NodeChip[]; policies: NodeChip[]; agents: NodeChip[]; /** KPIs (beyond the section's own) that also connect this row to the * enclosing objective — rendered as "also via …" chips. */ alsoVia: NodeChip[]; /** Row-level completeness warnings (REA duality etc.). */ lints: string[]; } /** A KPI sub-section within an objective group. `kpi === null` collects * processes that reach the objective without a connecting KPI (direct * `process --drives--> objective`). */ export interface KpiSection { kpi: NodeChip | null; rows: ProcessRow[]; } /** An objective group — one node of the objective forest. */ export interface ObjectiveGroup { /** `null` for the synthetic "Unassigned" group. */ id: string | null; name: string; description: string | undefined; /** Indent depth in the objective forest (apex = 0). */ depth: number; /** KPI sub-sections. A single section with `kpi: null` when the * objective has at most one connecting KPI (no tier tax). */ sections: KpiSection[]; /** Sub-objectives indented beneath this one. */ children: ObjectiveGroup[]; /** Totals across this group (excluding children). */ processCount: number; decisionCount: number; lintCount: number; } /** The full table projection. */ export interface TableProjection { groups: ObjectiveGroup[]; /** Graph-level warnings (unattached KPIs, idle decisions, orphan links…). */ lints: string[]; /** Highest stage number assigned (for the stage legend). */ stageCount: number; /** Total process count (for the empty state). */ processCount: number; } export declare function projectTable(ontology: Ontology): TableProjection; //# sourceMappingURL=projection.d.ts.map