import { ConfigService } from "@nestjs/config"; import { BaseConfigInterface } from "../../../config/interfaces/base.config.interface"; import { ContextualiserService } from "../../contextualiser/services/contextualiser.service"; import { DriftSearchService } from "../../drift/services/drift.search.service"; import { ResponderContextFactoryService } from "../factories/responder.context.factory"; import { ResponderResponseInterface } from "../interfaces/responder.response.interface"; import { ResponderAnswerNodeService } from "../nodes/responder.answer.node.service"; import { PlannerNodeService } from "../nodes/planner.node.service"; import { GraphNodeService } from "../nodes/graph.node.service"; import { MessageInterface } from "../../../common/interfaces/message.interface"; import type { AssistantSeedContext } from "../../../common/interfaces/seed.context.interface"; import { DataLimits } from "../../../common/types/data.limits"; export interface BranchToggles { graph?: boolean; contextualiser?: boolean; drift?: boolean; } /** * Composes the deployment-wide branch toggles (`responder.branches` in config) * with the per-call toggles passed to `run()`. A branch is allowed only when * BOTH say so — either side switching it off wins. Both default to `true`. */ export declare const resolveAllowedBranches: (config?: BranchToggles, perCall?: BranchToggles) => { graph: boolean; contextualiser: boolean; drift: boolean; }; /** * Documentation retrieval — how-to help and handbook — skips the planner and * runs the contextualiser alone. A documentation corpus is small and flat: * there is no case graph to walk and no drift to detect. */ export declare function usesDocumentationBranch(dataLimits: DataLimits): boolean; export declare class ResponderService { private readonly factory; private readonly contextualiserService; private readonly driftSearchService; private readonly answerNode; private readonly plannerNode; private readonly graphNode; private readonly configService; private readonly logger; constructor(factory: ResponderContextFactoryService, contextualiserService: ContextualiserService, driftSearchService: DriftSearchService, answerNode: ResponderAnswerNodeService, plannerNode: PlannerNodeService, graphNode: GraphNodeService, configService: ConfigService); run(params: { /** * The tenant the turn is billed and scoped to — ABSENT for a company-less * caller. A platform administrator has no Company, and the handbook chat * exists for exactly that user: the type says so rather than letting every * such call site cast a lie. Token accounting already tolerates it * (TokenUsageRepository makes the company edge conditional), and the * branches that genuinely need a tenant (graph, drift) are the branches a * documentation turn never runs. */ companyId: string | undefined; userId: string; userModuleIds: string[]; contentId?: string; contentType?: string; dataLimits: DataLimits; messages: MessageInterface[]; question?: string; branches?: BranchToggles; /** Id of the scope-root node the whole run is confined to. Absent = unscoped. */ scopeId?: string; /** JSON:API type of the scope root, e.g. "campaigns". Present iff scopeId is. */ scopeType?: string; /** Neo4j label of the scope root, e.g. "Campaign". Present iff scopeId is. */ scopeLabel?: string; /** Id of the `Assistant` (thread) node — the cost-attribution fallback for an unscoped turn. */ assistantId?: string; /** App-provided context blocks guaranteed present this turn. */ seedContexts?: AssistantSeedContext[]; }): Promise; /** * The attribution the responder hands DOWN to the sub-agents it invokes. * * `tokenUsageType` is the responder's own — the owner's ruling is that the * agent that CALLS a sub-agent is the agent that records its usage, so the * ledger shows one category per turn instead of one per internal component. * The scope triple is passed through untranslated: `scopeLabel` is already the * Neo4j label, and `scopeType` is only ever the registry's fallback input — * neither is ever written into Cypher as a label without going through * `buildScopeAttribution` first. */ private attribution; } //# sourceMappingURL=responder.service.d.ts.map