import type { ResolvedProfileContext, SemanticGraph } from './compiler.js'; import type { Aspect, Layer } from './profile.js'; export interface CanvasNode { readonly id: string; readonly localId: string; readonly document: string; readonly kind: string; readonly kindLabel: string; /** * The core-vocabulary kind this one resolves to, from * `profileContext.conceptKindLineages[0]`, the way an edge already carries * its own. The ArchiMate relationship table is keyed on core kinds, so a * consumer deciding what may connect two nodes needs this rather than the * profile kind it was authored as. */ readonly coreKindLabel: string; /** * The core relationship kinds this node's PATTERN ports, or `[]` where its * kind has no pattern with ports (#268 phase 3, ADR 0124). * * A macro edge needs both ends to port its kind, so an editor offering a * palette between two instances intersects the two lists. Two raw groupings * permit ten of the eleven kinds, which is no guidance at all; this is what * restores the narrowing the relationship table gives everywhere else. */ readonly portKinds: readonly string[]; readonly layer: Layer | null; readonly aspect: Aspect | null; readonly name: string; readonly description: string | null; readonly aka: readonly string[]; readonly status: string | null; readonly owner: string | null; /** * The folder the author filed this subject under, or null. A label, never a * directory (ADR 0104): the rail groups by it where it is set and by the * subject's ArchiMate layer where it is not. */ readonly folder: string | null; readonly distinctFrom: readonly string[]; readonly supersedes: readonly string[]; readonly constraints: ReadonlyArray<{ readonly id: string; readonly ref: string; readonly expects: { readonly provider: string; readonly key: string; readonly value: string; } | null; }>; readonly references: ReadonlyArray<{ readonly id: string; readonly ref: string; }>; readonly presentIn: readonly string[]; readonly attestations: ReadonlyArray<{ readonly topic: string; readonly by: string; readonly on: string; readonly recordedBy: string | null; }>; } export interface CanvasEdge { readonly id: string; readonly localId: string; readonly document: string; readonly kind: string; readonly kindLabel: string; readonly coreKindLabel: string; /** * The kind whose reading the edge label speaks (ADR 0159): an extension * identity with a reading of its own, else `coreKindLabel`. */ readonly readingKind?: string; /** * The responsibility letter this edge carries (#557): R, C or I for the * shipped responsibility kinds and their subkinds, null for every other * kind. The canvas draws these only when the view asks (`showResponsibility`). */ readonly responsibility?: ResponsibilityLetter | null; /** * A reading the endpoints decide (ADR 0160): "threatens" for an * influence from a risk, "mitigates" for one into a risk, "bears on" for * an association from an assumption. Absent, the kind's own reading. */ readonly reading?: string; readonly from: string; readonly to: string; readonly name: string | null; readonly description: string | null; readonly mode: string | null; readonly content: string | null; readonly status: string | null; readonly references: ReadonlyArray<{ readonly id: string; readonly ref: string; }>; readonly presentIn: readonly string[]; } export interface CanvasGraph { readonly nodes: readonly CanvasNode[]; readonly edges: readonly CanvasEdge[]; } import { type ResponsibilityLetter } from './responsibility-kinds.js'; export declare function projectGraphForCanvas(graph: SemanticGraph, profileContext: ResolvedProfileContext): CanvasGraph;