import { ClsService } from "nestjs-cls"; import { AbstractRepository } from "../../../core/neo4j/abstracts/abstract.repository"; import { Neo4jService } from "../../../core/neo4j/services/neo4j.service"; import { SecurityService } from "../../../core/security/services/security.service"; import type { EntityReference } from "../../../agents/responder/interfaces/entity.reference.interface"; import { AssistantMessage, AssistantMessageDescriptor } from "../entities/assistant-message"; /** * AssistantMessageRepository * * Owner-RBAC is inherited from the parent Assistant (a user may only see the * messages that belong to their own assistants). Company scope is applied * automatically via `buildDefaultMatch()` (`isCompanyScoped: true`). */ export declare class AssistantMessageRepository extends AbstractRepository { protected readonly descriptor: import("../../..").EntityDescriptor import("../../..").DataModelInterface; }; }; citations: { model: import("../../..").DataMeta; direction: "out"; relationship: string; cardinality: "many"; required: false; dtoKey: string; fields: ({ name: string; type: "number"; required: true; } | { name: string; type: "string"; required: false; })[]; }; action: { model: import("../../..").DataMeta; direction: "out"; relationship: string; cardinality: "one"; required: false; dtoKey: string; immutable: true; }; }>; constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService); protected buildUserHasAccess(): string; private readonly refLogger; /** * Resolve the next position to assign to a new AssistantMessage under the * given Assistant. Returns 0 for an empty thread, otherwise max(position)+1. */ getNextPosition(params: { assistantId: string; }): Promise; /** * Materialise one (:AssistantMessage)-[:REFERENCES { reason, relevance, createdAt }]->(target) * edge per reference. JSON:API type → Neo4j label is resolved through the * pre-seeded modelRegistry. Unknown types are logged and skipped. * * Idempotent via MERGE. `relevance` is optional; when absent it is stored as null. */ linkReferences(params: { messageId: string; references: EntityReference[]; }): Promise; /** * Materialise one (:AssistantMessage)-[:CITES { relevance, reason, createdAt }]->(:Chunk) * edge per citation. The chunk node is matched by id (no registry lookup — * Chunk is a fixed label). * * Idempotent via MERGE. `reason` is optional; when absent it is stored as null. */ linkCitations(params: { messageId: string; citations: Array<{ chunkId: string; relevance: number; reason?: string; }>; }): Promise; /** * Persist the assistant's reasoning trace as a string property on the message * node. Overwrites any prior value. */ setTrace(params: { messageId: string; trace: string; }): Promise; /** * For the given message IDs, return every (messageId, targetType, targetId) triple * for the outgoing :REFERENCES edges. Label is mapped to JSON:API type via modelRegistry. */ findReferencedTypeIdPairs(params: { messageIds: string[]; }): Promise<{ messageId: string; type: string; id: string; }[]>; } //# sourceMappingURL=assistant-message.repository.d.ts.map