@indexnetwork/protocol 5.4.0-rc.374.1 → 6.1.0-rc.376.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/dist/index.d.ts +50 -121
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +26 -55
  5. package/dist/index.js.map +1 -1
  6. package/dist/intent/intent.graph.d.ts +19 -19
  7. package/dist/intent/intent.indexer.d.ts +3 -3
  8. package/dist/intent/intent.inferrer.d.ts +8 -8
  9. package/dist/intent/intent.reconciler.d.ts +11 -11
  10. package/dist/intent/intent.state.d.ts +4 -4
  11. package/dist/intent/intent.verifier.d.ts +6 -6
  12. package/dist/negotiation/negotiation.agent.d.ts +10 -0
  13. package/dist/negotiation/negotiation.agent.d.ts.map +1 -1
  14. package/dist/negotiation/negotiation.agent.js +11 -1
  15. package/dist/negotiation/negotiation.agent.js.map +1 -1
  16. package/dist/negotiation/negotiation.deadlock.d.ts +96 -0
  17. package/dist/negotiation/negotiation.deadlock.d.ts.map +1 -0
  18. package/dist/negotiation/negotiation.deadlock.js +103 -0
  19. package/dist/negotiation/negotiation.deadlock.js.map +1 -0
  20. package/dist/negotiation/negotiation.graph.d.ts +7 -1
  21. package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
  22. package/dist/negotiation/negotiation.graph.js +67 -0
  23. package/dist/negotiation/negotiation.graph.js.map +1 -1
  24. package/dist/negotiation/negotiation.state.d.ts +9 -0
  25. package/dist/negotiation/negotiation.state.d.ts.map +1 -1
  26. package/dist/negotiation/negotiation.state.js +11 -0
  27. package/dist/negotiation/negotiation.state.js.map +1 -1
  28. package/dist/network/indexer/indexer.graph.d.ts +15 -15
  29. package/dist/network/indexer/indexer.state.d.ts +4 -4
  30. package/dist/network/membership/membership.graph.d.ts +4 -4
  31. package/dist/network/membership/membership.state.d.ts +1 -1
  32. package/dist/network/network.graph.d.ts +4 -4
  33. package/dist/network/network.state.d.ts +1 -1
  34. package/dist/opportunity/discriminator/discriminator.assigner.d.ts +4 -4
  35. package/dist/opportunity/opportunity.evaluator.d.ts +9 -9
  36. package/dist/opportunity/opportunity.graph.d.ts +6 -6
  37. package/dist/opportunity/opportunity.state.d.ts +1 -1
  38. package/dist/premise/premise.analyzer.d.ts +2 -2
  39. package/dist/premise/premise.decomposer.d.ts +2 -2
  40. package/dist/premise/premise.indexer.d.ts +2 -2
  41. package/dist/shared/hyde/hyde.frame.d.ts +4 -4
  42. package/dist/shared/hyde/hyde.validator.d.ts +4 -4
  43. package/dist/shared/hyde/lens.inferrer.d.ts +6 -6
  44. package/dist/shared/interfaces/database.interface.d.ts +10 -0
  45. package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
  46. package/dist/shared/interfaces/database.interface.js.map +1 -1
  47. package/dist/shared/schemas/negotiation-digest.schema.d.ts +2 -2
  48. package/dist/shared/schemas/question.schema.d.ts +36 -36
  49. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation.state.js","sourceRoot":"/","sources":["negotiation/negotiation.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAmC,MAAM,+CAA+C,CAAC;AAE3I;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC;YACvB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,SA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AE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KAClB,CAAC;IAEF,OAAO,EAAE,UAAU,CAA4B;QAC7C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;IACF,KAAK,EAAE,UAAU,CAAgB;QAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { Annotation } from \"@langchain/langgraph\";\nimport { z } from \"zod\";\nimport type { NegotiationUserAnswer } from \"../shared/interfaces/database.interface.js\";\nimport type { ScreenDecisionRecord } from \"./negotiation.screen.js\";\nimport type { NegotiatorMemoryEntry } from \"./negotiation.memory.js\";\nimport { AskUserPayloadSchema, NEGOTIATION_ACTIONS, type NegotiationProtocolVersion } from \"../shared/schemas/negotiation-state.schema.js\";\n\n/**\n * Zod schema for a single negotiation turn (DataPart payload in A2A message).\n * Accepts the full v1+v2 action union — which subset is valid for a given turn\n * is enforced by the seat-scoped schemas in `negotiation.protocol.ts`.\n */\nexport const NegotiationTurnSchema = z.object({\n action: z.enum(NEGOTIATION_ACTIONS),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n /** Present when action is `ask_user` (v2, P3.2). */\n askUser: AskUserPayloadSchema.nullable().optional(),\n});\n\n/** Restricted v1 turn schema for the system agent (no question action). */\nexport const SystemNegotiationTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\"]),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\n\n/** v1 turn schema for system agent's final allowed turn (must decide). */\nexport const FinalNegotiationTurnSchema = z.object({\n action: z.enum([\"accept\", \"reject\"]),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\n\nexport type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;\n\n/** Zod schema for the negotiation outcome (Artifact payload on COMPLETED task). */\nexport const NegotiationOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: z.enum([\"agent\", \"patient\", \"peer\"]),\n })),\n reasoning: z.string(),\n turnCount: z.number(),\n reason: z.enum([\"turn_cap\", \"timeout\", \"screened_out\"]).optional(),\n});\n\nexport type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;\n\n/** Context each agent receives about its user. */\nexport interface UserNegotiationContext {\n id: string;\n intents: Array<{ id: string; title: string; description: string; confidence: number }>;\n profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[] };\n}\n\n/** Seed assessment from the evaluator pre-filter. */\nexport interface SeedAssessment {\n reasoning: string;\n valencyRole: string;\n actors?: Array<{ userId: string; role: string }>;\n}\n\n/** Typed interface for a negotiation graph's invoke signature. */\nexport interface NegotiationGraphLike {\n invoke(input: {\n sourceUser: UserNegotiationContext;\n candidateUser: UserNegotiationContext;\n indexContext: { networkId: string; prompt: string };\n seedAssessment: Omit<SeedAssessment, \"actors\">;\n discoveryQuery?: string;\n opportunityId?: string;\n maxTurns?: number;\n timeoutMs?: number;\n /**\n * The user who holds the initiating seat for this match (v2 client-advocate\n * protocol). Stamped into task metadata by the init node. When omitted, the\n * init node resolves it: inherit from the prior task for the same\n * opportunity → conversation-scoped tie-break → fall back to sourceUser.id.\n */\n initiatorUserId?: string;\n }): Promise<{\n outcome: NegotiationOutcome | null;\n messages?: NegotiationMessage[];\n conversationId?: string;\n isContinuation?: boolean;\n priorTurnCount?: number;\n }>;\n}\n\n/** A2A message record shape (matches messages table). */\nexport interface NegotiationMessage {\n id: string;\n senderId: string;\n role: \"agent\";\n parts: unknown[];\n createdAt: Date;\n}\n\n/** LangGraph state annotation for the negotiation graph. */\nexport const NegotiationGraphState = Annotation.Root({\n sourceUser: Annotation<UserNegotiationContext>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ id: \"\", intents: [], profile: {} }),\n }),\n candidateUser: Annotation<UserNegotiationContext>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ id: \"\", intents: [], profile: {} }),\n }),\n indexContext: Annotation<{ networkId: string; prompt: string }>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ networkId: \"\", prompt: \"\" }),\n }),\n seedAssessment: Annotation<SeedAssessment>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ reasoning: \"\", valencyRole: \"\" }),\n }),\n\n /**\n * Explicit initiator seat for this match (purely additive metadata — no seat\n * rules attach to it yet). Resolution when unset happens in the init node;\n * the resolved value is written back to state and into task metadata.\n */\n initiatorUserId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /** The explicit search query that triggered discovery (if any). */\n discoveryQuery: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n /**\n * Negotiation protocol version for this session's task. Resolved by the\n * init node: inherited from the prior task on the conversation when one\n * exists (never re-stamped — a v1 conversation stays v1 mid-flight), else\n * stamped from `NEGOTIATION_PROTOCOL_VERSION` for genuinely fresh runs.\n */\n protocolVersion: Annotation<NegotiationProtocolVersion>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"v1\" as const,\n }),\n\n /**\n * Screen-gate decision for this fresh run (P2.1 shadow mode). Written by the\n * screen node; null when the gate is off, on continuations, or before the\n * node runs. Mirrors `tasks.metadata.screenDecision`.\n */\n screenDecision: Annotation<ScreenDecisionRecord | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n\n /**\n * Per-side negotiator-memory cache (P5.3 read path). Populated lazily the\n * first time each side's memory is retrieved (screen node for the client,\n * turn node for the speaker) so a multi-turn session pays for retrieval at\n * most once per side. `undefined` per side = not yet retrieved; `[]` =\n * retrieved and empty (flag off / no rows / retrieval failed).\n */\n memoryBySide: Annotation<Partial<Record<\"source\" | \"candidate\", NegotiatorMemoryEntry[]>>>({\n reducer: (curr, next) => ({ ...curr, ...next }),\n default: () => ({}),\n }),\n\n /** Whether this run is continuing a prior conversation with the same pair. */\n isContinuation: Annotation<boolean>({\n reducer: (curr, next) => next ?? curr,\n default: () => false,\n }),\n opportunityId: Annotation<string>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"\",\n }),\n conversationId: Annotation<string>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"\",\n }),\n taskId: Annotation<string>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"\",\n }),\n messages: Annotation<NegotiationMessage[]>({\n reducer: (curr, next) => [...curr, ...(next || [])],\n default: () => [],\n }),\n turnCount: Annotation<number>({\n reducer: (curr, next) => next ?? curr,\n default: () => 0,\n }),\n maxTurns: Annotation<number | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n /**\n * Park-window budget in milliseconds. Ambient callers pass `AMBIENT_PARK_WINDOW_MS`\n * (5 minutes); orchestrator callers pass a shorter window. This annotation default\n * is a safety net for any caller that omits the field — keep it aligned with\n * `AMBIENT_PARK_WINDOW_MS` in packages/protocol/src/negotiation/negotiation.tools.ts.\n * Inlined rather than imported to avoid a state↔tools cycle.\n */\n timeoutMs: Annotation<number>({\n reducer: (curr, next) => next ?? curr,\n default: () => 5 * 60 * 1000,\n }),\n\n currentSpeaker: Annotation<\"source\" | \"candidate\">({\n reducer: (curr, next) => next ?? curr,\n default: () => \"source\" as const,\n }),\n lastTurn: Annotation<NegotiationTurn | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n\n /**\n * Graph status.\n * - `active` — agents are exchanging turns (default)\n * - `waiting_for_agent` — graph suspended; awaiting external agent response or timeout\n * - `input_required` — graph suspended on an `ask_user` pause; awaiting the\n * negotiator's own client (answer or 24 h window expiry resumes it)\n * - `completed` — negotiation finalized (accept/reject/turn-cap/timeout)\n */\n status: Annotation<'active' | 'waiting_for_agent' | 'input_required' | 'completed'>({\n reducer: (curr, next) => next ?? curr,\n default: () => 'active' as const,\n }),\n\n /** Number of turns present in the conversation before this session started. */\n priorTurnCount: Annotation<number>({\n reducer: (curr, next) => next ?? curr,\n default: () => 0,\n }),\n\n /** User answers collected by the questioner between negotiation sessions. */\n userAnswers: Annotation<NegotiationUserAnswer[]>({\n reducer: (curr, next) => next ?? curr,\n default: () => [],\n }),\n\n outcome: Annotation<NegotiationOutcome | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n error: Annotation<string | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n});\n"]}
1
+ {"version":3,"file":"negotiation.state.js","sourceRoot":"/","sources":["negotiation/negotiation.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAmC,MAAM,+CAA+C,CAAC;AAE3I;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,cAA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AAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAiB;KACjC,CAAC;IAEF,+EAA+E;IAC/E,cAAc,EAAE,UAAU,CAAS;QACjC,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;KACjB,CAAC;IAEF,6EAA6E;IAC7E,WAAW,EAAE,UAAU,CAA0B;QAC/C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE;KAClB,CAAC;IAEF,OAAO,EAAE,UAAU,CAA4B;QAC7C,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;IACF,KAAK,EAAE,UAAU,CAAgB;QAC/B,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,IAAI;QACrC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { Annotation } from \"@langchain/langgraph\";\nimport { z } from \"zod\";\nimport type { NegotiationUserAnswer } from \"../shared/interfaces/database.interface.js\";\nimport type { ScreenDecisionRecord } from \"./negotiation.screen.js\";\nimport type { DeadlockShiftRecord } from \"./negotiation.deadlock.js\";\nimport type { NegotiatorMemoryEntry } from \"./negotiation.memory.js\";\nimport { AskUserPayloadSchema, NEGOTIATION_ACTIONS, type NegotiationProtocolVersion } from \"../shared/schemas/negotiation-state.schema.js\";\n\n/**\n * Zod schema for a single negotiation turn (DataPart payload in A2A message).\n * Accepts the full v1+v2 action union — which subset is valid for a given turn\n * is enforced by the seat-scoped schemas in `negotiation.protocol.ts`.\n */\nexport const NegotiationTurnSchema = z.object({\n action: z.enum(NEGOTIATION_ACTIONS),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n /** Present when action is `ask_user` (v2, P3.2). */\n askUser: AskUserPayloadSchema.nullable().optional(),\n});\n\n/** Restricted v1 turn schema for the system agent (no question action). */\nexport const SystemNegotiationTurnSchema = z.object({\n action: z.enum([\"propose\", \"accept\", \"reject\", \"counter\"]),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\n\n/** v1 turn schema for system agent's final allowed turn (must decide). */\nexport const FinalNegotiationTurnSchema = z.object({\n action: z.enum([\"accept\", \"reject\"]),\n assessment: z.object({\n reasoning: z.string(),\n suggestedRoles: z.object({\n ownUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n otherUser: z.enum([\"agent\", \"patient\", \"peer\"]),\n }),\n }),\n message: z.string().nullable().optional(),\n});\n\nexport type NegotiationTurn = z.infer<typeof NegotiationTurnSchema>;\n\n/** Zod schema for the negotiation outcome (Artifact payload on COMPLETED task). */\nexport const NegotiationOutcomeSchema = z.object({\n hasOpportunity: z.boolean(),\n agreedRoles: z.array(z.object({\n userId: z.string(),\n role: z.enum([\"agent\", \"patient\", \"peer\"]),\n })),\n reasoning: z.string(),\n turnCount: z.number(),\n reason: z.enum([\"turn_cap\", \"timeout\", \"screened_out\"]).optional(),\n});\n\nexport type NegotiationOutcome = z.infer<typeof NegotiationOutcomeSchema>;\n\n/** Context each agent receives about its user. */\nexport interface UserNegotiationContext {\n id: string;\n intents: Array<{ id: string; title: string; description: string; confidence: number }>;\n profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[] };\n}\n\n/** Seed assessment from the evaluator pre-filter. */\nexport interface SeedAssessment {\n reasoning: string;\n valencyRole: string;\n actors?: Array<{ userId: string; role: string }>;\n}\n\n/** Typed interface for a negotiation graph's invoke signature. */\nexport interface NegotiationGraphLike {\n invoke(input: {\n sourceUser: UserNegotiationContext;\n candidateUser: UserNegotiationContext;\n indexContext: { networkId: string; prompt: string };\n seedAssessment: Omit<SeedAssessment, \"actors\">;\n discoveryQuery?: string;\n opportunityId?: string;\n maxTurns?: number;\n timeoutMs?: number;\n /**\n * The user who holds the initiating seat for this match (v2 client-advocate\n * protocol). Stamped into task metadata by the init node. When omitted, the\n * init node resolves it: inherit from the prior task for the same\n * opportunity → conversation-scoped tie-break → fall back to sourceUser.id.\n */\n initiatorUserId?: string;\n }): Promise<{\n outcome: NegotiationOutcome | null;\n messages?: NegotiationMessage[];\n conversationId?: string;\n isContinuation?: boolean;\n priorTurnCount?: number;\n }>;\n}\n\n/** A2A message record shape (matches messages table). */\nexport interface NegotiationMessage {\n id: string;\n senderId: string;\n role: \"agent\";\n parts: unknown[];\n createdAt: Date;\n}\n\n/** LangGraph state annotation for the negotiation graph. */\nexport const NegotiationGraphState = Annotation.Root({\n sourceUser: Annotation<UserNegotiationContext>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ id: \"\", intents: [], profile: {} }),\n }),\n candidateUser: Annotation<UserNegotiationContext>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ id: \"\", intents: [], profile: {} }),\n }),\n indexContext: Annotation<{ networkId: string; prompt: string }>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ networkId: \"\", prompt: \"\" }),\n }),\n seedAssessment: Annotation<SeedAssessment>({\n reducer: (curr, next) => next ?? curr,\n default: () => ({ reasoning: \"\", valencyRole: \"\" }),\n }),\n\n /**\n * Explicit initiator seat for this match (purely additive metadata — no seat\n * rules attach to it yet). Resolution when unset happens in the init node;\n * the resolved value is written back to state and into task metadata.\n */\n initiatorUserId: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n\n /** The explicit search query that triggered discovery (if any). */\n discoveryQuery: Annotation<string | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n /**\n * Negotiation protocol version for this session's task. Resolved by the\n * init node: inherited from the prior task on the conversation when one\n * exists (never re-stamped — a v1 conversation stays v1 mid-flight), else\n * stamped from `NEGOTIATION_PROTOCOL_VERSION` for genuinely fresh runs.\n */\n protocolVersion: Annotation<NegotiationProtocolVersion>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"v1\" as const,\n }),\n\n /**\n * Screen-gate decision for this fresh run (P2.1 shadow mode). Written by the\n * screen node; null when the gate is off, on continuations, or before the\n * node runs. Mirrors `tasks.metadata.screenDecision`.\n */\n screenDecision: Annotation<ScreenDecisionRecord | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n\n /**\n * First applied deadlock→bargaining shift in this session (IND-428).\n * Written by the turn node when the system agent first drafts in the\n * bargaining stance; used to record the shift exactly once per session.\n * Internal analytics only — mirrored to `tasks.metadata.deadlockShift`,\n * never into any turn payload or public projection.\n */\n deadlockShift: Annotation<DeadlockShiftRecord | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n\n /**\n * Per-side negotiator-memory cache (P5.3 read path). Populated lazily the\n * first time each side's memory is retrieved (screen node for the client,\n * turn node for the speaker) so a multi-turn session pays for retrieval at\n * most once per side. `undefined` per side = not yet retrieved; `[]` =\n * retrieved and empty (flag off / no rows / retrieval failed).\n */\n memoryBySide: Annotation<Partial<Record<\"source\" | \"candidate\", NegotiatorMemoryEntry[]>>>({\n reducer: (curr, next) => ({ ...curr, ...next }),\n default: () => ({}),\n }),\n\n /** Whether this run is continuing a prior conversation with the same pair. */\n isContinuation: Annotation<boolean>({\n reducer: (curr, next) => next ?? curr,\n default: () => false,\n }),\n opportunityId: Annotation<string>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"\",\n }),\n conversationId: Annotation<string>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"\",\n }),\n taskId: Annotation<string>({\n reducer: (curr, next) => next ?? curr,\n default: () => \"\",\n }),\n messages: Annotation<NegotiationMessage[]>({\n reducer: (curr, next) => [...curr, ...(next || [])],\n default: () => [],\n }),\n turnCount: Annotation<number>({\n reducer: (curr, next) => next ?? curr,\n default: () => 0,\n }),\n maxTurns: Annotation<number | undefined>({\n reducer: (curr, next) => next ?? curr,\n default: () => undefined,\n }),\n /**\n * Park-window budget in milliseconds. Ambient callers pass `AMBIENT_PARK_WINDOW_MS`\n * (5 minutes); orchestrator callers pass a shorter window. This annotation default\n * is a safety net for any caller that omits the field — keep it aligned with\n * `AMBIENT_PARK_WINDOW_MS` in packages/protocol/src/negotiation/negotiation.tools.ts.\n * Inlined rather than imported to avoid a state↔tools cycle.\n */\n timeoutMs: Annotation<number>({\n reducer: (curr, next) => next ?? curr,\n default: () => 5 * 60 * 1000,\n }),\n\n currentSpeaker: Annotation<\"source\" | \"candidate\">({\n reducer: (curr, next) => next ?? curr,\n default: () => \"source\" as const,\n }),\n lastTurn: Annotation<NegotiationTurn | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n\n /**\n * Graph status.\n * - `active` — agents are exchanging turns (default)\n * - `waiting_for_agent` — graph suspended; awaiting external agent response or timeout\n * - `input_required` — graph suspended on an `ask_user` pause; awaiting the\n * negotiator's own client (answer or 24 h window expiry resumes it)\n * - `completed` — negotiation finalized (accept/reject/turn-cap/timeout)\n */\n status: Annotation<'active' | 'waiting_for_agent' | 'input_required' | 'completed'>({\n reducer: (curr, next) => next ?? curr,\n default: () => 'active' as const,\n }),\n\n /** Number of turns present in the conversation before this session started. */\n priorTurnCount: Annotation<number>({\n reducer: (curr, next) => next ?? curr,\n default: () => 0,\n }),\n\n /** User answers collected by the questioner between negotiation sessions. */\n userAnswers: Annotation<NegotiationUserAnswer[]>({\n reducer: (curr, next) => next ?? curr,\n default: () => [],\n }),\n\n outcome: Annotation<NegotiationOutcome | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n error: Annotation<string | null>({\n reducer: (curr, next) => next ?? curr,\n default: () => null,\n }),\n});\n"]}
@@ -20,14 +20,14 @@ export declare class IntentNetworkGraphFactory {
20
20
  userId: string;
21
21
  networkId: string | undefined;
22
22
  intentId: string | undefined;
23
- operationMode: "create" | "delete" | "read";
23
+ operationMode: "delete" | "create" | "read";
24
24
  skipEvaluation: boolean;
25
25
  intent: import("./indexer.state.js").IntentForIndexing | null;
26
26
  indexContext: import("./indexer.state.js").IndexMemberContext | null;
27
27
  evaluation: {
28
+ reasoning: string;
28
29
  indexScore: number;
29
30
  memberScore: number;
30
- reasoning: string;
31
31
  } | null;
32
32
  shouldAssign: boolean | undefined;
33
33
  finalScore: number | undefined;
@@ -59,18 +59,18 @@ export declare class IntentNetworkGraphFactory {
59
59
  userId?: string | undefined;
60
60
  networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
61
61
  intentId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
62
- operationMode?: "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read"> | undefined;
62
+ operationMode?: "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read"> | undefined;
63
63
  skipEvaluation?: boolean | import("@langchain/langgraph").OverwriteValue<boolean> | undefined;
64
64
  intent?: import("./indexer.state.js").IntentForIndexing | import("@langchain/langgraph").OverwriteValue<import("./indexer.state.js").IntentForIndexing | null> | null | undefined;
65
65
  indexContext?: import("./indexer.state.js").IndexMemberContext | import("@langchain/langgraph").OverwriteValue<import("./indexer.state.js").IndexMemberContext | null> | null | undefined;
66
66
  evaluation?: {
67
+ reasoning: string;
67
68
  indexScore: number;
68
69
  memberScore: number;
69
- reasoning: string;
70
70
  } | import("@langchain/langgraph").OverwriteValue<{
71
+ reasoning: string;
71
72
  indexScore: number;
72
73
  memberScore: number;
73
- reasoning: string;
74
74
  } | null> | null | undefined;
75
75
  shouldAssign?: boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined;
76
76
  finalScore?: number | import("@langchain/langgraph").OverwriteValue<number | undefined> | undefined;
@@ -124,22 +124,22 @@ export declare class IntentNetworkGraphFactory {
124
124
  };
125
125
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
126
126
  intentId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
127
- operationMode: import("@langchain/langgraph").BaseChannel<"create" | "delete" | "read", "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read">, unknown>;
127
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "create" | "read", "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read">, unknown>;
128
128
  skipEvaluation: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
129
129
  intent: import("@langchain/langgraph").BaseChannel<import("./indexer.state.js").IntentForIndexing | null, import("./indexer.state.js").IntentForIndexing | import("@langchain/langgraph").OverwriteValue<import("./indexer.state.js").IntentForIndexing | null> | null, unknown>;
130
130
  indexContext: import("@langchain/langgraph").BaseChannel<import("./indexer.state.js").IndexMemberContext | null, import("./indexer.state.js").IndexMemberContext | import("@langchain/langgraph").OverwriteValue<import("./indexer.state.js").IndexMemberContext | null> | null, unknown>;
131
131
  evaluation: import("@langchain/langgraph").BaseChannel<{
132
+ reasoning: string;
132
133
  indexScore: number;
133
134
  memberScore: number;
134
- reasoning: string;
135
135
  } | null, {
136
+ reasoning: string;
136
137
  indexScore: number;
137
138
  memberScore: number;
138
- reasoning: string;
139
139
  } | import("@langchain/langgraph").OverwriteValue<{
140
+ reasoning: string;
140
141
  indexScore: number;
141
142
  memberScore: number;
142
- reasoning: string;
143
143
  } | null> | null, unknown>;
144
144
  shouldAssign: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
145
145
  finalScore: import("@langchain/langgraph").BaseChannel<number | undefined, number | import("@langchain/langgraph").OverwriteValue<number | undefined> | undefined, unknown>;
@@ -211,22 +211,22 @@ export declare class IntentNetworkGraphFactory {
211
211
  };
212
212
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
213
213
  intentId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
214
- operationMode: import("@langchain/langgraph").BaseChannel<"create" | "delete" | "read", "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read">, unknown>;
214
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "create" | "read", "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read">, unknown>;
215
215
  skipEvaluation: import("@langchain/langgraph").BaseChannel<boolean, boolean | import("@langchain/langgraph").OverwriteValue<boolean>, unknown>;
216
216
  intent: import("@langchain/langgraph").BaseChannel<import("./indexer.state.js").IntentForIndexing | null, import("./indexer.state.js").IntentForIndexing | import("@langchain/langgraph").OverwriteValue<import("./indexer.state.js").IntentForIndexing | null> | null, unknown>;
217
217
  indexContext: import("@langchain/langgraph").BaseChannel<import("./indexer.state.js").IndexMemberContext | null, import("./indexer.state.js").IndexMemberContext | import("@langchain/langgraph").OverwriteValue<import("./indexer.state.js").IndexMemberContext | null> | null, unknown>;
218
218
  evaluation: import("@langchain/langgraph").BaseChannel<{
219
+ reasoning: string;
219
220
  indexScore: number;
220
221
  memberScore: number;
221
- reasoning: string;
222
222
  } | null, {
223
+ reasoning: string;
223
224
  indexScore: number;
224
225
  memberScore: number;
225
- reasoning: string;
226
226
  } | import("@langchain/langgraph").OverwriteValue<{
227
+ reasoning: string;
227
228
  indexScore: number;
228
229
  memberScore: number;
229
- reasoning: string;
230
230
  } | null> | null, unknown>;
231
231
  shouldAssign: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
232
232
  finalScore: import("@langchain/langgraph").BaseChannel<number | undefined, number | import("@langchain/langgraph").OverwriteValue<number | undefined> | undefined, unknown>;
@@ -349,9 +349,9 @@ export declare class IntentNetworkGraphFactory {
349
349
  } | {
350
350
  agentTimings: DebugMetaAgent[];
351
351
  evaluation: {
352
+ reasoning: string;
352
353
  indexScore: number;
353
354
  memberScore: number;
354
- reasoning: string;
355
355
  };
356
356
  shouldAssign: boolean;
357
357
  finalScore: number;
@@ -364,9 +364,9 @@ export declare class IntentNetworkGraphFactory {
364
364
  } | {
365
365
  agentTimings: DebugMetaAgent[];
366
366
  evaluation: {
367
+ reasoning: string;
367
368
  indexScore: number;
368
369
  memberScore: number;
369
- reasoning: string;
370
370
  };
371
371
  shouldAssign: boolean;
372
372
  finalScore: number;
@@ -53,7 +53,7 @@ export declare const IntentNetworkGraphState: import("@langchain/langgraph").Ann
53
53
  /** Target intent for assign/read-by-intent. From tool arg. */
54
54
  intentId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
55
55
  /** Operation mode. */
56
- operationMode: import("@langchain/langgraph").BaseChannel<"create" | "delete" | "read", "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read">, unknown>;
56
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "create" | "read", "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read">, unknown>;
57
57
  /**
58
58
  * When true, skip LLM evaluation and assign directly.
59
59
  * (Migrated from old Network Graph.)
@@ -65,17 +65,17 @@ export declare const IntentNetworkGraphState: import("@langchain/langgraph").Ann
65
65
  indexContext: import("@langchain/langgraph").BaseChannel<IndexMemberContext | null, IndexMemberContext | import("@langchain/langgraph").OverwriteValue<IndexMemberContext | null> | null, unknown>;
66
66
  /** LLM evaluation result. Null if skipped. */
67
67
  evaluation: import("@langchain/langgraph").BaseChannel<{
68
+ reasoning: string;
68
69
  indexScore: number;
69
70
  memberScore: number;
70
- reasoning: string;
71
71
  } | null, {
72
+ reasoning: string;
72
73
  indexScore: number;
73
74
  memberScore: number;
74
- reasoning: string;
75
75
  } | import("@langchain/langgraph").OverwriteValue<{
76
+ reasoning: string;
76
77
  indexScore: number;
77
78
  memberScore: number;
78
- reasoning: string;
79
79
  } | null> | null, unknown>;
80
80
  /** Final decision: should intent be in this network? */
81
81
  shouldAssign: import("@langchain/langgraph").BaseChannel<boolean | undefined, boolean | import("@langchain/langgraph").OverwriteValue<boolean | undefined> | undefined, unknown>;
@@ -13,7 +13,7 @@ export declare class NetworkMembershipGraphFactory {
13
13
  createGraph(): import("@langchain/langgraph").CompiledStateGraph<{
14
14
  userId: string;
15
15
  networkId: string;
16
- operationMode: "create" | "delete" | "read";
16
+ operationMode: "delete" | "create" | "read";
17
17
  targetUserId: string | undefined;
18
18
  readResult: {
19
19
  networkId: string;
@@ -36,7 +36,7 @@ export declare class NetworkMembershipGraphFactory {
36
36
  }, {
37
37
  userId?: string | undefined;
38
38
  networkId?: string | undefined;
39
- operationMode?: "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read"> | undefined;
39
+ operationMode?: "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read"> | undefined;
40
40
  targetUserId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
41
41
  readResult?: {
42
42
  networkId: string;
@@ -82,7 +82,7 @@ export declare class NetworkMembershipGraphFactory {
82
82
  (): import("@langchain/langgraph").LastValue<string>;
83
83
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
84
84
  };
85
- operationMode: import("@langchain/langgraph").BaseChannel<"create" | "delete" | "read", "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read">, unknown>;
85
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "create" | "read", "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read">, unknown>;
86
86
  targetUserId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
87
87
  readResult: import("@langchain/langgraph").BaseChannel<{
88
88
  networkId: string;
@@ -143,7 +143,7 @@ export declare class NetworkMembershipGraphFactory {
143
143
  (): import("@langchain/langgraph").LastValue<string>;
144
144
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
145
145
  };
146
- operationMode: import("@langchain/langgraph").BaseChannel<"create" | "delete" | "read", "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read">, unknown>;
146
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "create" | "read", "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read">, unknown>;
147
147
  targetUserId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
148
148
  readResult: import("@langchain/langgraph").BaseChannel<{
149
149
  networkId: string;
@@ -19,7 +19,7 @@ export declare const NetworkMembershipGraphState: import("@langchain/langgraph")
19
19
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
20
20
  };
21
21
  /** Operation mode. */
22
- operationMode: import("@langchain/langgraph").BaseChannel<"create" | "delete" | "read", "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"create" | "delete" | "read">, unknown>;
22
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "create" | "read", "delete" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "create" | "read">, unknown>;
23
23
  /** For create/delete: the user being added/removed. */
24
24
  targetUserId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
25
25
  /** Output for read mode: list of members. */
@@ -15,7 +15,7 @@ export declare class NetworkGraphFactory {
15
15
  createGraph(): import("@langchain/langgraph").CompiledStateGraph<{
16
16
  userId: string;
17
17
  networkId: string | undefined;
18
- operationMode: "update" | "create" | "delete" | "read";
18
+ operationMode: "delete" | "update" | "create" | "read";
19
19
  createInput: {
20
20
  title: string;
21
21
  prompt?: string;
@@ -75,7 +75,7 @@ export declare class NetworkGraphFactory {
75
75
  }, {
76
76
  userId?: string | undefined;
77
77
  networkId?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
78
- operationMode?: "update" | "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"update" | "create" | "delete" | "read"> | undefined;
78
+ operationMode?: "delete" | "update" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "update" | "create" | "read"> | undefined;
79
79
  createInput?: {
80
80
  title: string;
81
81
  prompt?: string;
@@ -189,7 +189,7 @@ export declare class NetworkGraphFactory {
189
189
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
190
190
  };
191
191
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
192
- operationMode: import("@langchain/langgraph").BaseChannel<"update" | "create" | "delete" | "read", "update" | "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"update" | "create" | "delete" | "read">, unknown>;
192
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "update" | "create" | "read", "delete" | "update" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "update" | "create" | "read">, unknown>;
193
193
  createInput: import("@langchain/langgraph").BaseChannel<{
194
194
  title: string;
195
195
  prompt?: string;
@@ -353,7 +353,7 @@ export declare class NetworkGraphFactory {
353
353
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
354
354
  };
355
355
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
356
- operationMode: import("@langchain/langgraph").BaseChannel<"update" | "create" | "delete" | "read", "update" | "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"update" | "create" | "delete" | "read">, unknown>;
356
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "update" | "create" | "read", "delete" | "update" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "update" | "create" | "read">, unknown>;
357
357
  createInput: import("@langchain/langgraph").BaseChannel<{
358
358
  title: string;
359
359
  prompt?: string;
@@ -15,7 +15,7 @@ export declare const NetworkGraphState: import("@langchain/langgraph").Annotatio
15
15
  /** Target network ID. Required for read/update/delete. From ChatGraph or tool arg. */
16
16
  networkId: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
17
17
  /** Operation mode. */
18
- operationMode: import("@langchain/langgraph").BaseChannel<"update" | "create" | "delete" | "read", "update" | "create" | "delete" | "read" | import("@langchain/langgraph").OverwriteValue<"update" | "create" | "delete" | "read">, unknown>;
18
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "update" | "create" | "read", "delete" | "update" | "create" | "read" | import("@langchain/langgraph").OverwriteValue<"delete" | "update" | "create" | "read">, unknown>;
19
19
  /** For create mode: index creation data. */
20
20
  createInput: import("@langchain/langgraph").BaseChannel<{
21
21
  title: string;
@@ -9,25 +9,25 @@ declare const AxisSchema: z.ZodObject<{
9
9
  evidence: z.ZodNullable<z.ZodString>;
10
10
  }, "strip", z.ZodTypeAny, {
11
11
  evidence: string | null;
12
- side: string | null;
13
12
  candidateId: string;
13
+ side: string | null;
14
14
  }, {
15
15
  evidence: string | null;
16
- side: string | null;
17
16
  candidateId: string;
17
+ side: string | null;
18
18
  }>, "many">;
19
19
  }, "strip", z.ZodTypeAny, {
20
20
  assignments: {
21
21
  evidence: string | null;
22
- side: string | null;
23
22
  candidateId: string;
23
+ side: string | null;
24
24
  }[];
25
25
  questionId: string;
26
26
  }, {
27
27
  assignments: {
28
28
  evidence: string | null;
29
- side: string | null;
30
29
  candidateId: string;
30
+ side: string | null;
31
31
  }[];
32
32
  questionId: string;
33
33
  }>;
@@ -10,15 +10,15 @@ declare const OpportunitySchema: z.ZodObject<{
10
10
  sourceId: z.ZodString;
11
11
  candidateId: z.ZodString;
12
12
  }, "strip", z.ZodTypeAny, {
13
+ reasoning: string;
13
14
  score: number;
14
15
  sourceId: string;
15
- reasoning: string;
16
16
  valencyRole: "Agent" | "Patient" | "Peer";
17
17
  candidateId: string;
18
18
  }, {
19
+ reasoning: string;
19
20
  score: number;
20
21
  sourceId: string;
21
- reasoning: string;
22
22
  valencyRole: "Agent" | "Patient" | "Peer";
23
23
  candidateId: string;
24
24
  }>;
@@ -97,8 +97,8 @@ declare const OpportunityWithActorsSchema: z.ZodObject<{
97
97
  evidenceKey?: string | null | undefined;
98
98
  }>, "many">;
99
99
  }, "strip", z.ZodTypeAny, {
100
- score: number;
101
100
  reasoning: string;
101
+ score: number;
102
102
  actors: {
103
103
  userId: string;
104
104
  role: "agent" | "patient" | "peer";
@@ -106,8 +106,8 @@ declare const OpportunityWithActorsSchema: z.ZodObject<{
106
106
  evidenceKey?: string | null | undefined;
107
107
  }[];
108
108
  }, {
109
- score: number;
110
109
  reasoning: string;
110
+ score: number;
111
111
  actors: {
112
112
  userId: string;
113
113
  role: "agent" | "patient" | "peer";
@@ -136,8 +136,8 @@ declare const entityBundleResponseFormat: z.ZodObject<{
136
136
  evidenceKey?: string | null | undefined;
137
137
  }>, "many">;
138
138
  }, "strip", z.ZodTypeAny, {
139
- score: number;
140
139
  reasoning: string;
140
+ score: number;
141
141
  actors: {
142
142
  userId: string;
143
143
  role: "agent" | "patient" | "peer";
@@ -145,8 +145,8 @@ declare const entityBundleResponseFormat: z.ZodObject<{
145
145
  evidenceKey?: string | null | undefined;
146
146
  }[];
147
147
  }, {
148
- score: number;
149
148
  reasoning: string;
149
+ score: number;
150
150
  actors: {
151
151
  userId: string;
152
152
  role: "agent" | "patient" | "peer";
@@ -156,8 +156,8 @@ declare const entityBundleResponseFormat: z.ZodObject<{
156
156
  }>, "many">;
157
157
  }, "strip", z.ZodTypeAny, {
158
158
  opportunities: {
159
- score: number;
160
159
  reasoning: string;
160
+ score: number;
161
161
  actors: {
162
162
  userId: string;
163
163
  role: "agent" | "patient" | "peer";
@@ -167,8 +167,8 @@ declare const entityBundleResponseFormat: z.ZodObject<{
167
167
  }[];
168
168
  }, {
169
169
  opportunities: {
170
- score: number;
171
170
  reasoning: string;
171
+ score: number;
172
172
  actors: {
173
173
  userId: string;
174
174
  role: "agent" | "patient" | "peer";
@@ -265,9 +265,9 @@ export declare class OpportunityEvaluator {
265
265
  minScore?: number | undefined;
266
266
  candidatesJson?: string | undefined;
267
267
  }, {
268
+ reasoning: string;
268
269
  score: number;
269
270
  sourceId: string;
270
- reasoning: string;
271
271
  valencyRole: "Agent" | "Patient" | "Peer";
272
272
  candidateId: string;
273
273
  }[], unknown, "opportunity_evaluator">;
@@ -145,7 +145,7 @@ export declare class OpportunityGraphFactory {
145
145
  opportunityId: string;
146
146
  counterpartyUserId: string;
147
147
  }[];
148
- operationMode: "send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction";
148
+ operationMode: "delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction";
149
149
  introductionEntities: EvaluatorEntity[];
150
150
  introductionHint: string | undefined;
151
151
  requiredNetworkId: Id<"networks"> | undefined;
@@ -258,7 +258,7 @@ export declare class OpportunityGraphFactory {
258
258
  opportunityId: string;
259
259
  counterpartyUserId: string;
260
260
  }[]> | undefined;
261
- operationMode?: "send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction"> | undefined;
261
+ operationMode?: "delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction"> | undefined;
262
262
  introductionEntities?: EvaluatorEntity[] | import("@langchain/langgraph").OverwriteValue<EvaluatorEntity[]> | undefined;
263
263
  introductionHint?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
264
264
  requiredNetworkId?: Id<"networks"> | import("@langchain/langgraph").OverwriteValue<Id<"networks"> | undefined> | undefined;
@@ -416,7 +416,7 @@ export declare class OpportunityGraphFactory {
416
416
  seedAssessmentScore?: number | undefined;
417
417
  }[]> | undefined;
418
418
  discoverySummary?: import("../index.js").DiscoverySummary | import("@langchain/langgraph").OverwriteValue<import("../index.js").DiscoverySummary | null> | null | undefined;
419
- }, "scope" | "send" | "update" | "discovery" | "read" | "__start__" | "prep" | "negotiate_existing" | "approve_introduction" | "resolve" | "evaluation" | "ranking" | "intro_validation" | "intro_evaluation" | "persist" | "delete_opp" | "negotiate", {
419
+ }, "scope" | "send" | "update" | "discovery" | "read" | "negotiate_existing" | "approve_introduction" | "__start__" | "prep" | "persist" | "resolve" | "evaluation" | "ranking" | "intro_validation" | "intro_evaluation" | "delete_opp" | "negotiate", {
420
420
  userId: import("@langchain/langgraph").BaseChannel<Id<"users">, Id<"users"> | import("@langchain/langgraph").OverwriteValue<Id<"users">>, unknown>;
421
421
  searchQuery: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
422
422
  networkId: import("@langchain/langgraph").BaseChannel<Id<"networks"> | undefined, Id<"networks"> | import("@langchain/langgraph").OverwriteValue<Id<"networks"> | undefined> | undefined, unknown>;
@@ -436,7 +436,7 @@ export declare class OpportunityGraphFactory {
436
436
  opportunityId: string;
437
437
  counterpartyUserId: string;
438
438
  }[]>, unknown>;
439
- operationMode: import("@langchain/langgraph").BaseChannel<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction", "send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction">, unknown>;
439
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction", "delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction">, unknown>;
440
440
  introductionEntities: import("@langchain/langgraph").BaseChannel<EvaluatorEntity[], EvaluatorEntity[] | import("@langchain/langgraph").OverwriteValue<EvaluatorEntity[]>, unknown>;
441
441
  introductionHint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
442
442
  requiredNetworkId: import("@langchain/langgraph").BaseChannel<Id<"networks"> | undefined, Id<"networks"> | import("@langchain/langgraph").OverwriteValue<Id<"networks"> | undefined> | undefined, unknown>;
@@ -676,7 +676,7 @@ export declare class OpportunityGraphFactory {
676
676
  opportunityId: string;
677
677
  counterpartyUserId: string;
678
678
  }[]>, unknown>;
679
- operationMode: import("@langchain/langgraph").BaseChannel<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction", "send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction">, unknown>;
679
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction", "delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction">, unknown>;
680
680
  introductionEntities: import("@langchain/langgraph").BaseChannel<EvaluatorEntity[], EvaluatorEntity[] | import("@langchain/langgraph").OverwriteValue<EvaluatorEntity[]>, unknown>;
681
681
  introductionHint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
682
682
  requiredNetworkId: import("@langchain/langgraph").BaseChannel<Id<"networks"> | undefined, Id<"networks"> | import("@langchain/langgraph").OverwriteValue<Id<"networks"> | undefined> | undefined, unknown>;
@@ -1215,7 +1215,7 @@ export declare class OpportunityGraphFactory {
1215
1215
  opportunityId: string;
1216
1216
  counterpartyUserId: string;
1217
1217
  }[]>, unknown>;
1218
- operationMode: import("@langchain/langgraph").BaseChannel<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction", "send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction">, unknown>;
1218
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction", "delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction">, unknown>;
1219
1219
  introductionEntities: import("@langchain/langgraph").BaseChannel<EvaluatorEntity[], EvaluatorEntity[] | import("@langchain/langgraph").OverwriteValue<EvaluatorEntity[]>, unknown>;
1220
1220
  introductionHint: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
1221
1221
  requiredNetworkId: import("@langchain/langgraph").BaseChannel<Id<"networks"> | undefined, Id<"networks"> | import("@langchain/langgraph").OverwriteValue<Id<"networks"> | undefined> | undefined, unknown>;
@@ -231,7 +231,7 @@ export declare const OpportunityGraphState: import("@langchain/langgraph").Annot
231
231
  *
232
232
  * Defaults to 'create' for backward compatibility.
233
233
  */
234
- operationMode: import("@langchain/langgraph").BaseChannel<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction", "send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"send" | "update" | "create" | "delete" | "read" | "create_introduction" | "continue_discovery" | "negotiate_existing" | "approve_introduction">, unknown>;
234
+ operationMode: import("@langchain/langgraph").BaseChannel<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction", "delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction" | import("@langchain/langgraph").OverwriteValue<"delete" | "send" | "update" | "create" | "create_introduction" | "continue_discovery" | "read" | "negotiate_existing" | "approve_introduction">, unknown>;
235
235
  /** Introduction mode: pre-gathered entities (profiles + intents per party). */
236
236
  introductionEntities: import("@langchain/langgraph").BaseChannel<EvaluatorEntity[], EvaluatorEntity[] | import("@langchain/langgraph").OverwriteValue<EvaluatorEntity[]>, unknown>;
237
237
  /** Introduction mode: optional hint from the introducer. */
@@ -7,19 +7,19 @@ declare const responseFormat: z.ZodObject<{
7
7
  felicityClarity: z.ZodNumber;
8
8
  semanticEntropy: z.ZodNumber;
9
9
  }, "strip", z.ZodTypeAny, {
10
+ reasoning: string;
10
11
  semanticEntropy: number;
11
12
  felicityAuthority: number;
12
13
  felicitySincerity: number;
13
14
  felicityClarity: number;
14
15
  speechActType: "DECLARATIVE" | "ASSERTIVE";
15
- reasoning: string;
16
16
  }, {
17
+ reasoning: string;
17
18
  semanticEntropy: number;
18
19
  felicityAuthority: number;
19
20
  felicitySincerity: number;
20
21
  felicityClarity: number;
21
22
  speechActType: "DECLARATIVE" | "ASSERTIVE";
22
- reasoning: string;
23
23
  }>;
24
24
  export type PremiseAnalyzerOutput = z.infer<typeof responseFormat>;
25
25
  /**
@@ -30,21 +30,21 @@ declare const responseFormat: z.ZodObject<{
30
30
  retractedPremiseIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
31
31
  revisedBio: z.ZodDefault<z.ZodNullable<z.ZodString>>;
32
32
  }, "strip", z.ZodTypeAny, {
33
+ reasoning: string;
33
34
  premises: {
34
35
  text: string;
35
36
  tier: "assertive" | "contextual";
36
37
  validityDays: number | null;
37
38
  }[];
38
- reasoning: string;
39
39
  retractedPremiseIds: string[];
40
40
  revisedBio: string | null;
41
41
  }, {
42
+ reasoning: string;
42
43
  premises: {
43
44
  text: string;
44
45
  tier: "assertive" | "contextual";
45
46
  validityDays: number | null;
46
47
  }[];
47
- reasoning: string;
48
48
  retractedPremiseIds?: string[] | undefined;
49
49
  revisedBio?: string | null | undefined;
50
50
  }>;
@@ -4,13 +4,13 @@ declare const responseFormat: z.ZodObject<{
4
4
  memberScore: z.ZodNumber;
5
5
  reasoning: z.ZodString;
6
6
  }, "strip", z.ZodTypeAny, {
7
+ reasoning: string;
7
8
  indexScore: number;
8
9
  memberScore: number;
9
- reasoning: string;
10
10
  }, {
11
+ reasoning: string;
11
12
  indexScore: number;
12
13
  memberScore: number;
13
- reasoning: string;
14
14
  }>;
15
15
  export type PremiseIndexerOutput = z.infer<typeof responseFormat>;
16
16
  /**