/** * Shared palette + display-string primitives for any surface that renders * the Neo4j graph. Both the live `/graph` page in platform/ui and the * graph-viewer MCP plugin's PNG renderer import from here so a node looks * the same wherever it appears: same colour family per label, same short * canvas label per node. * * UI-only constants (filter-popover sets, zoom-tier wrap helpers, * agent-action label sets) stay in platform/ui/app/lib/graph-labels.ts and * platform/ui/app/graph/display-helpers.ts — they re-export the symbols * defined here. The two parity tests (this lib's __tests__ and the UI's * unchanged colour-stability tests) keep the surfaces in lockstep. * * Sources of truth: * - Label list: platform/neo4j/schema.cypher (constraints + fulltext * unions); registry doctrine in .docs/graph-label-registries.md * - Brand colour for LocalBusiness: brand.json defaultColors.primary * (resolved at runtime; this module supplies the schema-default fallback) */ /** * Label → display colour mapping. Closed list of node labels written by * the Maxy MCP write paths. A new label without an entry here renders in * FALLBACK_LABEL_COLOUR and is omitted from the legend. */ export declare const GRAPH_LABEL_COLOURS: Record; export declare const FALLBACK_LABEL_COLOUR = "#94A3B8"; /** * Labels that are an additional label stacked on a base node rather than a * standalone graph node. Each surfaces as its base node's chip and colour, so * none carries a `GRAPH_LABEL_COLOURS` hue of its own. * * Single declaration, two consumers (Task 1893): * - `platform/ui/server/lib/top-level-labels.ts` drops these from the * `/graph` chip allowlist, so a vertical granting one a * `## Top-level node types` row (which the account file-schema projection * needs for its bucket) does not silently add a fallback-grey chip. * - The memory plugin's schema-cypher drift guard exempts these from needing * a `CREATE CONSTRAINT` / `CREATE INDEX` line, because no standalone node * of the label ever exists. * * Membership is read from what the schema docs already state, not decided here: * - `Applicant` on `:Person` (schema-estate-agent.md) * - `Engineer` on `:Person` (schema-construction.md) * - `Supplier` on `:Organization` (schema-construction.md) * - `GuestProfile` on `:Person` (schema-hospitality.md) * * Adding a fifth member is an ontology decision: state it in the vertical's * schema prose first, then add it here. */ export declare const ADDITIONAL_BASE_LABELS: ReadonlySet; export declare const ALL_GRAPH_LABELS: readonly string[]; /** * Select the sublabel whose colour should drive the node hue. Walks the * label array from index 1 (skipping the base label at index 0) and * returns the first sublabel that has a registered colour; falls back to * labels[0]. Pure — drift-counting lives in resolveNodeColour. */ export declare function pickDisplayLabel(labels: readonly string[]): string | null; export declare function colourForLabel(label: string): string; export declare const EXTERNAL_LABEL_SHAPES: readonly ["dot", "triangle", "square", "diamond", "star", "triangleDown", "hexagon"]; export type GraphNodeShape = (typeof EXTERNAL_LABEL_SHAPES)[number]; export declare const FALLBACK_LABEL_SHAPE: GraphNodeShape; export declare function shapeForLabel(label: string): GraphNodeShape; /** * Node labels written by code with no schema node-type-table row and no * typed-edge declaration. They still render as graph nodes, so they must carry * a colour + glyph like any other node type. The reconciliation gate in * __tests__/icons.test.ts folds this set into the node-label universe. Add a * label here when the runtime `op=icon-fallback` census names one that no * schema table or typed edge declares. */ export declare const CODE_EMITTED_NODE_LABELS: ReadonlySet; /** * Inner SVG markup (Lucide glyph) for a label, or null when the label has no * registered icon. A null return is the signal the caller renders the fallback * dot and logs op=icon-fallback. */ export declare function iconForLabel(label: string): string | null; /** * A self-contained node image for vis-network's shape:'image' — a filled disc * in the label's colour with the Lucide glyph stroked in white on top, encoded * as a data:image/svg+xml URI. Returns null when the label has no icon, so the * caller falls back to the plain coloured dot. * * The disc replicates the legend colour; the glyph group re-declares the * stroke/fill attributes Lucide's own wrapper carries (fill:none, * stroke:currentColor, width 2, round caps) with color:#fff so both stroked * paths and the few fill='currentColor' marks render white. The glyph is scaled * to 0.6 and centred so it sits inside the disc with a margin. */ export declare function nodeImageDataUri(label: string): string | null; export interface ResolvedNodeColour { displayLabel: string | null; colour: string; driftCandidates: number; } /** * Single-source colour resolver. driftCandidates counts registered * sublabels in labels[1..]; a node with two registered sublabels has * driftCandidates = 2 and its rendered hue is order-dependent. */ export declare function resolveNodeColour(labels: readonly string[]): ResolvedNodeColour; /** * Structural type used by display-string helpers. Mirrors the shape of * GraphNode without coupling to it. */ export interface GraphNodeLike { id: string; labels: string[]; properties: Record; } /** * YYYY-MM-DD HH:mm from an ISO 8601 prefix. Reads the prefix directly so * timezone-stored UTC timestamps render identically across operator * timezones; parsing to Date + reformatting would flip the day. */ export declare function formatRunTimestamp(iso: string): string | null; /** HH:mm:ss from an ISO 8601 prefix. Same tz-stable contract. */ export declare function formatMessageTimestamp(iso: string): string | null; /** * 24-char canvas label for a node. Label precedence per label family * (ToolCall.toolName, WorkflowRun startedAt formatted, WorkflowStep.label, * Person givenName+familyName compose, Agent displayName/slug, Job * client+#jobId compose, Quote ref, InboundInvoice * supplier+#confirmationNumber compose, WhatsAppGroup clientName, * Message role+timestamp, Property address/slug, Listing displayName/slug, * Viewing date, Offer status+price, Visit purpose/status, PurchaseOrder * poNumber, Invoice confirmationNumber, Risk/Finding/Hypothesis statement), * then a generic * fallthrough across curated keys * (name, title, summary, givenName, subject, text) — :ConversationArchive * rows (Task 397) carry a stable `title` written by the writer so they pick * up the generic-fallback `title` key naturally. Finally a * Conversation-specific `Conv ` fallback so unpopulated conversations * don't render as the literal label. */ export declare function pickShortLabel(node: GraphNodeLike): string; /** * Untruncated sibling of pickShortLabel. Used by side-panel headings and * tooltips where the 24-char canvas-overlap cap does not apply. */ export declare function pickDisplayName(node: GraphNodeLike): string; //# sourceMappingURL=index.d.ts.map