import { BaseMessage } from "@langchain/core/messages"; import type { CallerAttributionState } from "../../common/usage-attribution"; import type { ToolCallRecord } from "../../graph/tools/tool.factory"; import type { EntityReference } from "../../responder/interfaces/entity.reference.interface"; export type OperatorCitation = { chunkId: string; relevance: number; reason: string; }; export type OperatorFinalAnswer = { answer: string; questions: string[]; }; export declare const OperatorContext: import("@langchain/langgraph").AnnotationRoot<{ messages: import("@langchain/langgraph").BaseChannel, import("@langchain/core/messages").MessageType>[], BaseMessage, import("@langchain/core/messages").MessageType>[] | import("@langchain/langgraph").OverwriteValue, import("@langchain/core/messages").MessageType>[]>, unknown>; companyId: { (annotation: import("@langchain/langgraph").SingleReducer): import("@langchain/langgraph").BaseChannel, unknown>; (): import("@langchain/langgraph").LastValue; Root: (sd: S) => import("@langchain/langgraph").AnnotationRoot; }; userId: { (annotation: import("@langchain/langgraph").SingleReducer): import("@langchain/langgraph").BaseChannel, unknown>; (): import("@langchain/langgraph").LastValue; Root: (sd: S) => import("@langchain/langgraph").AnnotationRoot; }; userModuleIds: { (annotation: import("@langchain/langgraph").SingleReducer): import("@langchain/langgraph").BaseChannel, unknown>; (): import("@langchain/langgraph").LastValue; Root: (sd: S) => import("@langchain/langgraph").AnnotationRoot; }; contentId: import("@langchain/langgraph").BaseChannel, unknown>; contentType: import("@langchain/langgraph").BaseChannel, unknown>; /** Id of the scope-root node the whole run is confined to. Absent = unscoped. */ scopeId: import("@langchain/langgraph").BaseChannel, unknown>; /** JSON:API type of the scope root, e.g. "campaigns". Present iff scopeId is. */ scopeType: import("@langchain/langgraph").BaseChannel, unknown>; /** Neo4j label of the scope root, e.g. "Campaign". Present iff scopeId is. */ scopeLabel: import("@langchain/langgraph").BaseChannel, unknown>; /** * Id of the `Assistant` (thread) node this turn belongs to. Cost attribution * falls back to it when the turn has no scope root, so an unscoped turn still * bills. Checkpointed, so a resumed run keeps it without being told again. */ assistantId: import("@langchain/langgraph").BaseChannel, unknown>; question: { (annotation: import("@langchain/langgraph").SingleReducer): import("@langchain/langgraph").BaseChannel, unknown>; (): import("@langchain/langgraph").LastValue; Root: (sd: S) => import("@langchain/langgraph").AnnotationRoot; }; toolCalls: import("@langchain/langgraph").BaseChannel, unknown>; references: import("@langchain/langgraph").BaseChannel, unknown>; citations: import("@langchain/langgraph").BaseChannel, unknown>; iterations: import("@langchain/langgraph").BaseChannel, unknown>; tokens: import("@langchain/langgraph").BaseChannel<{ input: number; output: number; }, { input: number; output: number; } | import("@langchain/langgraph").OverwriteValue<{ input: number; output: number; }>, unknown>; finalAnswer: import("@langchain/langgraph").BaseChannel, unknown>; /** * Error the approved destructive tool of the last tools pass returned instead * of writing. Last-write-wins, and written on EVERY pass that executed an * approved destructive call — a successful one writes `null`, so a failure can * never linger and mark a later action failed. The assistant layer reads it to * transition the AssistantAction to `failed` instead of `executed`. */ actionError: import("@langchain/langgraph").BaseChannel, unknown>; }>; /** * The attribution channels added to the root above, as OPTIONAL properties. * * LangGraph's `StateType` makes EVERY channel a required property, so adding a * channel would add a required key to the PUBLISHED {@link OperatorContextState} * (re-exported from `agents/index.ts`) and break any consumer that builds a * state literal. Re-declaring them here — the same fix * `ContextualiserContextState` and `DriftContextState` use — keeps the state * carrying them while existing literals still compile. * * Only the two channels this branch ADDED are re-declared: `scopeId` / * `scopeType` predate it and are left exactly as consumers already see them. */ type OperatorAttributionState = Pick; /** * Every channel added after the published state shape froze, declared OPTIONAL * for the reason above: a consumer's existing state literal must keep compiling. * `actionError` joins the attribution pair here for exactly that reason. */ type OperatorLateState = OperatorAttributionState & { actionError?: string | null; }; /** * The un-widened shape LangGraph itself hands to a node callback — every * channel required, `StateGraph`'s own view of the state. * * Nothing in this package consumes it: `OperatorService` builds the graph from * `new StateGraph(OperatorContext)` and lets LangGraph infer each node * callback's state, so no signature has to name this type. It is exported for * the same reason `DriftGraphState` is — a consumer that wants the exact * LangGraph view rather than the widened public one — and it is the base * {@link OperatorContextState} widens. */ export type OperatorGraphState = typeof OperatorContext.State; export type OperatorContextState = Omit & OperatorLateState; export {}; //# sourceMappingURL=operator.context.d.ts.map