import type { CommandSpec } from "../internals/plan.js"; import { type WorkspaceEdge, type WorkspaceManifest } from "./manifest.js"; /** * `aih workspace graph` (#505) — project the workspace's OWN declared contract * relations (`.aih-workspace.json` `repos[]` + `edges[]`) into a queryable * cross-repo graph. Declared topology is the source of truth; graph-tool * inference (the workspace graph MCP servers) is optional enrichment and is * never required to answer "what depends on what" for declared contracts. * * The projection is a PURE function of the manifest: no child checkout, no * indexing, no tool execution, no timestamps — the same manifest always yields * a byte-identical artifact. */ export declare const WORKSPACE_GRAPH_PATH: string; export interface WorkspaceGraphNode { id: string; path: string; kind?: string; owner?: string; router: string; } export interface WorkspaceGraphEdge extends WorkspaceEdge { /** Where this edge came from. Declared edges are authored, never inferred. */ provenance: "declared"; } export interface WorkspaceGraph { schemaVersion: 1; /** The single source of truth this graph is projected from. */ source: ".aih-workspace.json"; /** Declared-over-inferred posture marker: every edge here was authored. */ topology: "declared"; generatedBy: "aih workspace graph"; nodes: WorkspaceGraphNode[]; edges: WorkspaceGraphEdge[]; } export interface WorkspaceGraphQuery { /** Match edges touching this repo id in either direction. */ repo?: string; /** Match edges declared from this repo id. */ from?: string; /** Match edges declared to this repo id. */ to?: string; /** Match edges with exactly this contract kind label. */ kind?: string; } /** * Project the declared manifest into graph form. Fails closed on an edge whose * endpoint is not a declared repo id: a dangling edge is a manifest bug, and * silently emitting it would let a typo masquerade as topology. */ export declare function projectWorkspaceGraph(manifest: WorkspaceManifest): WorkspaceGraph; /** * Filter declared edges. Repo-id filters fail closed on an undeclared id (a * typo must not read as "no dependencies"); `kind` is a free-form label, so a * zero-match kind is answered honestly instead of rejected. */ export declare function filterWorkspaceGraph(graph: WorkspaceGraph, query: WorkspaceGraphQuery): WorkspaceGraphEdge[]; export declare const workspaceGraphCommand: CommandSpec;