/** * Shared parser for `platform/neo4j/schema.cypher`. * * Two consumers today: * 1. The admin SCHEMA prompt block (`platform/ui/app/lib/admin-schema-block.ts`) * renders labels declared in schema.cypher into the agent's * system prompt. * 2. The memory-plugin schema validator treats schema.cypher * declarations as the "promise" half of the recognised-label set — * labels that exist as constraints/indexes but may not yet have a node * in the graph (fresh-install bootstrap). * * The previous home was admin-schema-block.ts; that owner was wrong as * soon as a second consumer arrived. Lifting here keeps a single source of * truth and removes the cross-package shape coupling. * * Also exports a compact `levenshtein` for "did you mean?" suggestions on * unknown labels — used by the memory-plugin validator. The graph-mcp * cypher validator has its own copy in schema-cache.ts (private to the * stale-miss heuristic); the duplication is intentional, since this * exported one targets human-readable error UX, not refresh debouncing. */ /** * Extract every Neo4j label declared in a `schema.cypher` file by scanning * `FOR (alias:Label)` and `FOR (alias:A|B|C)` constraint and index forms. * Returns a sorted, de-duped list. Pure function — no I/O. */ export declare function parseLabelsFromSchemaCypher(schemaCypher: string): string[]; /** * Standard iterative-DP Levenshtein. Used to suggest a near-match when an * agent submits an unknown label — small alphabets, short strings, runs in * microseconds. Identical algorithm to the private copy in schema-cache.ts; * exported here so callers outside graph-mcp don't have to roll their own. */ export declare function levenshtein(a: string, b: string): number; /** * Find the closest label in `candidates` to `unknown` by edit distance. * Returns null when the closest match is further than `maxDistance` (default * 3) — beyond that a suggestion is more confusing than helpful. */ export declare function nearestLabel(unknown: string, candidates: Iterable, maxDistance?: number): string | null; //# sourceMappingURL=schema-cypher-parser.d.ts.map