import { OnApplicationBootstrap } from "@nestjs/common"; import { CatalogEntity } from "../interfaces/graph.catalog.interface"; import { ChatWritableConfig, FieldKind } from "../../../common/interfaces/entity.schema.interface"; /** * Provided by the library bootstrap layer. Must return the full list of registered * entity descriptors (including their `moduleId` — the stable UUID of the `(Module)` * node in Neo4j, supplied by the feature module at `graphRegistry.register()` time). */ export interface DescriptorSource { loadAll(): Array<{ model: { type: string; nodeName: string; labelName: string; }; description?: string; moduleId: string; fields: Record; relationships: Record; chat?: { summary?: (d: any) => string; textSearchFields?: string[]; list?: string[]; scope?: string; writable?: boolean | ChatWritableConfig; /** Compile a polymorphic chat-only "related" traversal (RELATES_TO, both directions). */ related?: boolean; }; bridge?: { materialiseTo: string[]; }; }>; } export declare class GraphCatalogService implements OnApplicationBootstrap { private readonly source; private readonly logger; private entities; /** Keyed by `moduleId` (UUID), value is the pre-rendered text fragment. */ private renderedByModuleId; constructor(source: DescriptorSource); onApplicationBootstrap(): void; buildCatalog(): void; /** * A `chat.writable` object form names exactly what the assistant may write, so * a typo in it silently narrows the assistant instead of failing — the model is * simply told a field is not writable and gives up. Every listed name is * therefore checked at boot, in the same style as the writable/scope check * above: a misconfiguration is a boot failure, never a runtime surprise. */ private validateWritableAllowLists; /** * Resolve `chat.scope` into a Cypher-ready chain of hops ending at a * `chat.scope === "self"` root. Runs once, at catalog build time: a chain * that cannot be resolved is a configuration error, and an entity that is * catalogued but unscoped would be reachable across every scope root. */ private compileScope; private renderModule; getMapFor(userModuleIds: string[]): string; private filterCrossModule; /** * Returns a flat type index for the given user modules: one line per accessible * entity, in the form `- — `. No fields, no relationships. * * Used as the lightweight planner catalog and as the slim graph-node prompt body * (the LLM fetches per-type schema on demand via `describe_entity`). */ getTypeIndexFor(userModuleIds: string[]): string; /** * Returns the accessible entity-type names for a user's modules. Used by the * tool layer to compute "Did you mean" suggestions for unknown types. */ getAccessibleTypes(userModuleIds: string[]): string[]; getAllChatEnabledEntities(): CatalogEntity[]; /** * EVERY catalogued entity, unfiltered by module access. * * Deliberately not `getAccessibleTypes`: this feeds the SCOPE predicate, and * scope and permission are different questions. A type the caller cannot * reach is already excluded by the permission layer; leaving it out of the * scope predicate as well would silently narrow retrieval for reasons that * have nothing to do with which campaign the run is in. */ getAllEntities(): CatalogEntity[]; hasType(type: string): boolean; getEntityDetail(type: string, userModuleIds: string[]): CatalogEntity | null; } //# sourceMappingURL=graph.catalog.service.d.ts.map