@indexnetwork/protocol 6.7.1 → 6.9.0-rc.396.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 (66) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/index.d.ts +6 -3
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +4 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/intent/intent.graph.d.ts +5 -0
  7. package/dist/intent/intent.graph.d.ts.map +1 -1
  8. package/dist/intent/intent.graph.js +4 -0
  9. package/dist/intent/intent.graph.js.map +1 -1
  10. package/dist/intent/intent.state.d.ts +5 -0
  11. package/dist/intent/intent.state.d.ts.map +1 -1
  12. package/dist/intent/intent.state.js +8 -0
  13. package/dist/intent/intent.state.js.map +1 -1
  14. package/dist/negotiation/negotiation.agent.d.ts +3 -1
  15. package/dist/negotiation/negotiation.agent.d.ts.map +1 -1
  16. package/dist/negotiation/negotiation.agent.js +4 -1
  17. package/dist/negotiation/negotiation.agent.js.map +1 -1
  18. package/dist/negotiation/negotiation.graph.d.ts +53 -22
  19. package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
  20. package/dist/negotiation/negotiation.graph.js +235 -71
  21. package/dist/negotiation/negotiation.graph.js.map +1 -1
  22. package/dist/negotiation/negotiation.question-safety.d.ts +26 -0
  23. package/dist/negotiation/negotiation.question-safety.d.ts.map +1 -0
  24. package/dist/negotiation/negotiation.question-safety.js +56 -0
  25. package/dist/negotiation/negotiation.question-safety.js.map +1 -0
  26. package/dist/negotiation/negotiation.state.d.ts +22 -2
  27. package/dist/negotiation/negotiation.state.d.ts.map +1 -1
  28. package/dist/negotiation/negotiation.state.js +30 -0
  29. package/dist/negotiation/negotiation.state.js.map +1 -1
  30. package/dist/opportunity/opportunity.graph.d.ts +12 -1
  31. package/dist/opportunity/opportunity.graph.d.ts.map +1 -1
  32. package/dist/opportunity/opportunity.graph.js +43 -5
  33. package/dist/opportunity/opportunity.graph.js.map +1 -1
  34. package/dist/opportunity/opportunity.state.d.ts +5 -2
  35. package/dist/opportunity/opportunity.state.d.ts.map +1 -1
  36. package/dist/opportunity/opportunity.state.js +5 -0
  37. package/dist/opportunity/opportunity.state.js.map +1 -1
  38. package/dist/questioner/questioner.agent.d.ts +1 -1
  39. package/dist/questioner/questioner.agent.d.ts.map +1 -1
  40. package/dist/questioner/questioner.agent.js +6 -1
  41. package/dist/questioner/questioner.agent.js.map +1 -1
  42. package/dist/questioner/questioner.presets.d.ts +2 -2
  43. package/dist/questioner/questioner.presets.d.ts.map +1 -1
  44. package/dist/questioner/questioner.presets.js +61 -14
  45. package/dist/questioner/questioner.presets.js.map +1 -1
  46. package/dist/questioner/questioner.types.d.ts +59 -11
  47. package/dist/questioner/questioner.types.d.ts.map +1 -1
  48. package/dist/questioner/questioner.types.js +56 -1
  49. package/dist/questioner/questioner.types.js.map +1 -1
  50. package/dist/shared/agent/tool.factory.d.ts.map +1 -1
  51. package/dist/shared/agent/tool.factory.js +1 -0
  52. package/dist/shared/agent/tool.factory.js.map +1 -1
  53. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts +3 -0
  54. package/dist/shared/interfaces/agent-dispatcher.interface.d.ts.map +1 -1
  55. package/dist/shared/interfaces/agent-dispatcher.interface.js.map +1 -1
  56. package/dist/shared/interfaces/database.interface.d.ts +89 -6
  57. package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
  58. package/dist/shared/interfaces/database.interface.js.map +1 -1
  59. package/dist/shared/interfaces/negotiation-events.interface.d.ts +14 -2
  60. package/dist/shared/interfaces/negotiation-events.interface.d.ts.map +1 -1
  61. package/dist/shared/interfaces/negotiation-events.interface.js.map +1 -1
  62. package/dist/shared/schemas/question.schema.d.ts +413 -21
  63. package/dist/shared/schemas/question.schema.d.ts.map +1 -1
  64. package/dist/shared/schemas/question.schema.js +165 -3
  65. package/dist/shared/schemas/question.schema.js.map +1 -1
  66. package/package.json +1 -1
@@ -46,11 +46,23 @@ export interface NegotiationTimeoutQueue {
46
46
  }
47
47
  /** Payload carried by an ask_user answer-window expiry job. */
48
48
  export interface AskUserExpiryPayload {
49
+ /** Deterministic durable settlement/outbox key for this exact paused task. */
50
+ settlementId: string;
49
51
  /** Opportunity to resume via the run-existing continuation path. */
50
52
  opportunityId: string;
51
53
  /** The asking side's client (the user who was asked and did not answer). */
52
54
  userId: string;
53
- /** What the negotiator wanted permission to share / needed to know. */
54
- disclosureSubject: string;
55
+ /** Exact owned signal consulted by the paused negotiator. */
56
+ recipientIntentId: string;
57
+ /** Exact non-personal network shared by the opportunity actors. */
58
+ networkId: string;
59
+ /** Admission-time canonical hash of the recipient intent payload/summary. */
60
+ intentFingerprint: string;
61
+ /** Admission-time opportunity lifecycle marker. */
62
+ opportunityStatus: string;
63
+ opportunityUpdatedAt: string;
64
+ /** Exact counterparty provenance for settlement-time eligibility checks. */
65
+ counterpartyUserId: string;
66
+ counterpartyIntentId: string;
55
67
  }
56
68
  //# sourceMappingURL=negotiation-events.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation-events.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/negotiation-events.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5F;;;OAGG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
1
+ {"version":3,"file":"negotiation-events.interface.d.ts","sourceRoot":"/","sources":["shared/interfaces/negotiation-events.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE5F;;;OAGG;IACH,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnB;;;;OAIG;IACH,mBAAmB,CAAC,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mDAAmD;IACnD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;CAC9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation-events.interface.js","sourceRoot":"/","sources":["shared/interfaces/negotiation-events.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * Interfaces for negotiation yield/resume support.\n * Used by the negotiation graph and dispatcher to manage timeouts\n * for external agents that haven't responded yet.\n */\n\n/**\n * Manages delayed timeout jobs for negotiations waiting on external agents.\n * When a negotiation yields, a timeout is enqueued. If the external agent\n * responds before the timeout, the job is cancelled.\n */\nexport interface NegotiationTimeoutQueue {\n /**\n * Enqueue a delayed timeout job.\n * @param negotiationId - The negotiation task ID\n * @param turnNumber - Current turn number (used to detect stale jobs)\n * @param delayMs - Delay in milliseconds before the timeout fires\n * @returns The BullMQ job ID for cancellation\n */\n enqueueTimeout(negotiationId: string, turnNumber: number, delayMs: number): Promise<string>;\n\n /**\n * Cancel a pending timeout job for a negotiation.\n * @param negotiationId - The negotiation task ID\n */\n cancelTimeout(negotiationId: string): Promise<void>;\n\n /**\n * Arm the answer-window timer for an `ask_user` pause (P3.2). Fires after\n * `delayMs` (typically 24 h); the worker resumes the negotiation with a\n * conservative no-disclosure default when the task is still\n * `input_required`, and no-ops otherwise (stale job).\n *\n * Optional so fakes and pre-P3.2 implementations stay valid; the graph only\n * offers `ask_user` when this method is present.\n *\n * @param negotiationId - The paused negotiation task ID\n * @param payload - Resume coordinates + observability context\n * @param delayMs - Delay before the expiry fires\n * @returns The job ID for cancellation\n */\n enqueueAskUserExpiry?(\n negotiationId: string,\n payload: AskUserExpiryPayload,\n delayMs: number,\n ): Promise<string>;\n\n /**\n * Cancel a pending ask_user answer-window timer (the client answered in\n * time, or the negotiation reached a terminal state another way).\n * @param negotiationId - The paused negotiation task ID\n */\n cancelAskUserExpiry?(negotiationId: string): Promise<void>;\n}\n\n/** Payload carried by an ask_user answer-window expiry job. */\nexport interface AskUserExpiryPayload {\n /** Opportunity to resume via the run-existing continuation path. */\n opportunityId: string;\n /** The asking side's client (the user who was asked and did not answer). */\n userId: string;\n /** What the negotiator wanted permission to share / needed to know. */\n disclosureSubject: string;\n}\n"]}
1
+ {"version":3,"file":"negotiation-events.interface.js","sourceRoot":"/","sources":["shared/interfaces/negotiation-events.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * Interfaces for negotiation yield/resume support.\n * Used by the negotiation graph and dispatcher to manage timeouts\n * for external agents that haven't responded yet.\n */\n\n/**\n * Manages delayed timeout jobs for negotiations waiting on external agents.\n * When a negotiation yields, a timeout is enqueued. If the external agent\n * responds before the timeout, the job is cancelled.\n */\nexport interface NegotiationTimeoutQueue {\n /**\n * Enqueue a delayed timeout job.\n * @param negotiationId - The negotiation task ID\n * @param turnNumber - Current turn number (used to detect stale jobs)\n * @param delayMs - Delay in milliseconds before the timeout fires\n * @returns The BullMQ job ID for cancellation\n */\n enqueueTimeout(negotiationId: string, turnNumber: number, delayMs: number): Promise<string>;\n\n /**\n * Cancel a pending timeout job for a negotiation.\n * @param negotiationId - The negotiation task ID\n */\n cancelTimeout(negotiationId: string): Promise<void>;\n\n /**\n * Arm the answer-window timer for an `ask_user` pause (P3.2). Fires after\n * `delayMs` (typically 24 h); the worker resumes the negotiation with a\n * conservative no-disclosure default when the task is still\n * `input_required`, and no-ops otherwise (stale job).\n *\n * Optional so fakes and pre-P3.2 implementations stay valid; the graph only\n * offers `ask_user` when this method is present.\n *\n * @param negotiationId - The paused negotiation task ID\n * @param payload - Resume coordinates + observability context\n * @param delayMs - Delay before the expiry fires\n * @returns The job ID for cancellation\n */\n enqueueAskUserExpiry?(\n negotiationId: string,\n payload: AskUserExpiryPayload,\n delayMs: number,\n ): Promise<string>;\n\n /**\n * Cancel a pending ask_user answer-window timer (the client answered in\n * time, or the negotiation reached a terminal state another way).\n * @param negotiationId - The paused negotiation task ID\n */\n cancelAskUserExpiry?(negotiationId: string): Promise<void>;\n}\n\n/** Payload carried by an ask_user answer-window expiry job. */\nexport interface AskUserExpiryPayload {\n /** Deterministic durable settlement/outbox key for this exact paused task. */\n settlementId: string;\n /** Opportunity to resume via the run-existing continuation path. */\n opportunityId: string;\n /** The asking side's client (the user who was asked and did not answer). */\n userId: string;\n /** Exact owned signal consulted by the paused negotiator. */\n recipientIntentId: string;\n /** Exact non-personal network shared by the opportunity actors. */\n networkId: string;\n /** Admission-time canonical hash of the recipient intent payload/summary. */\n intentFingerprint: string;\n /** Admission-time opportunity lifecycle marker. */\n opportunityStatus: string;\n opportunityUpdatedAt: string;\n /** Exact counterparty provenance for settlement-time eligibility checks. */\n counterpartyUserId: string;\n counterpartyIntentId: string;\n}\n"]}
@@ -220,7 +220,156 @@ export interface QuestionGenerationResult {
220
220
  underspecificationTypes: Array<UnderspecificationType | null>;
221
221
  }
222
222
  /** Internal reason a question was generated, orthogonal to mode and QUD metadata. */
223
- export declare const QuestionPurposeSchema: z.ZodEnum<["uptake"]>;
223
+ export declare const NegotiationQuestionPurposeSchema: z.ZodEnum<["uptake", "stalled_followup", "inflight_consultation"]>;
224
+ export declare const QuestionPurposeSchema: z.ZodEnum<["uptake", "recovery", "stalled_followup", "inflight_consultation"]>;
225
+ /**
226
+ * Producer-supplied candidate binding. The API re-resolves every field from
227
+ * authoritative rows before generation; callers cannot mint provenance.
228
+ */
229
+ export declare const NegotiationQuestionCandidateSchema: z.ZodEffects<z.ZodObject<{
230
+ purpose: z.ZodEnum<["uptake", "stalled_followup", "inflight_consultation"]>;
231
+ recipientUserId: z.ZodString;
232
+ recipientIntentId: z.ZodString;
233
+ opportunityId: z.ZodString;
234
+ taskId: z.ZodOptional<z.ZodString>;
235
+ networkId: z.ZodString;
236
+ /** Uptake only: exact low-authority counterparty eligibility binding. */
237
+ counterpartyUserId: z.ZodOptional<z.ZodString>;
238
+ counterpartyIntentId: z.ZodOptional<z.ZodString>;
239
+ counterpartyFelicityAuthority: z.ZodOptional<z.ZodNumber>;
240
+ }, "strip", z.ZodTypeAny, {
241
+ networkId: string;
242
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
243
+ recipientUserId: string;
244
+ recipientIntentId: string;
245
+ opportunityId: string;
246
+ taskId?: string | undefined;
247
+ counterpartyUserId?: string | undefined;
248
+ counterpartyIntentId?: string | undefined;
249
+ counterpartyFelicityAuthority?: number | undefined;
250
+ }, {
251
+ networkId: string;
252
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
253
+ recipientUserId: string;
254
+ recipientIntentId: string;
255
+ opportunityId: string;
256
+ taskId?: string | undefined;
257
+ counterpartyUserId?: string | undefined;
258
+ counterpartyIntentId?: string | undefined;
259
+ counterpartyFelicityAuthority?: number | undefined;
260
+ }>, {
261
+ networkId: string;
262
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
263
+ recipientUserId: string;
264
+ recipientIntentId: string;
265
+ opportunityId: string;
266
+ taskId?: string | undefined;
267
+ counterpartyUserId?: string | undefined;
268
+ counterpartyIntentId?: string | undefined;
269
+ counterpartyFelicityAuthority?: number | undefined;
270
+ }, {
271
+ networkId: string;
272
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
273
+ recipientUserId: string;
274
+ recipientIntentId: string;
275
+ opportunityId: string;
276
+ taskId?: string | undefined;
277
+ counterpartyUserId?: string | undefined;
278
+ counterpartyIntentId?: string | undefined;
279
+ counterpartyFelicityAuthority?: number | undefined;
280
+ }>;
281
+ /**
282
+ * Durable server-only routing and freshness envelope for negotiation-family
283
+ * questions. This object is stripped from every REST/MCP projection.
284
+ */
285
+ export declare const NegotiationQuestionProvenanceSchema: z.ZodEffects<z.ZodObject<{
286
+ version: z.ZodLiteral<1>;
287
+ purpose: z.ZodEnum<["uptake", "stalled_followup", "inflight_consultation"]>;
288
+ recipientUserId: z.ZodString;
289
+ recipientIntentId: z.ZodString;
290
+ opportunityId: z.ZodString;
291
+ taskId: z.ZodOptional<z.ZodString>;
292
+ networkId: z.ZodString;
293
+ intentFingerprint: z.ZodString;
294
+ opportunityStatus: z.ZodEnum<["latent", "draft", "negotiating", "pending", "stalled", "accepted", "rejected", "expired"]>;
295
+ opportunityUpdatedAt: z.ZodString;
296
+ taskState: z.ZodOptional<z.ZodEnum<["submitted", "working", "input_required", "completed", "canceled", "failed", "rejected", "auth_required", "waiting_for_agent", "claimed"]>>;
297
+ taskUpdatedAt: z.ZodOptional<z.ZodString>;
298
+ /** Uptake only: exact low-authority counterparty eligibility binding. */
299
+ counterpartyUserId: z.ZodOptional<z.ZodString>;
300
+ counterpartyIntentId: z.ZodOptional<z.ZodString>;
301
+ counterpartyFelicityAuthority: z.ZodOptional<z.ZodNumber>;
302
+ /** Stable per-generation position so retries dedupe without reducing cardinality. */
303
+ questionOrdinal: z.ZodNumber;
304
+ }, "strip", z.ZodTypeAny, {
305
+ networkId: string;
306
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
307
+ recipientUserId: string;
308
+ recipientIntentId: string;
309
+ opportunityId: string;
310
+ version: 1;
311
+ intentFingerprint: string;
312
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
313
+ opportunityUpdatedAt: string;
314
+ questionOrdinal: number;
315
+ taskId?: string | undefined;
316
+ counterpartyUserId?: string | undefined;
317
+ counterpartyIntentId?: string | undefined;
318
+ counterpartyFelicityAuthority?: number | undefined;
319
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
320
+ taskUpdatedAt?: string | undefined;
321
+ }, {
322
+ networkId: string;
323
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
324
+ recipientUserId: string;
325
+ recipientIntentId: string;
326
+ opportunityId: string;
327
+ version: 1;
328
+ intentFingerprint: string;
329
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
330
+ opportunityUpdatedAt: string;
331
+ questionOrdinal: number;
332
+ taskId?: string | undefined;
333
+ counterpartyUserId?: string | undefined;
334
+ counterpartyIntentId?: string | undefined;
335
+ counterpartyFelicityAuthority?: number | undefined;
336
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
337
+ taskUpdatedAt?: string | undefined;
338
+ }>, {
339
+ networkId: string;
340
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
341
+ recipientUserId: string;
342
+ recipientIntentId: string;
343
+ opportunityId: string;
344
+ version: 1;
345
+ intentFingerprint: string;
346
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
347
+ opportunityUpdatedAt: string;
348
+ questionOrdinal: number;
349
+ taskId?: string | undefined;
350
+ counterpartyUserId?: string | undefined;
351
+ counterpartyIntentId?: string | undefined;
352
+ counterpartyFelicityAuthority?: number | undefined;
353
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
354
+ taskUpdatedAt?: string | undefined;
355
+ }, {
356
+ networkId: string;
357
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
358
+ recipientUserId: string;
359
+ recipientIntentId: string;
360
+ opportunityId: string;
361
+ version: 1;
362
+ intentFingerprint: string;
363
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
364
+ opportunityUpdatedAt: string;
365
+ questionOrdinal: number;
366
+ taskId?: string | undefined;
367
+ counterpartyUserId?: string | undefined;
368
+ counterpartyIntentId?: string | undefined;
369
+ counterpartyFelicityAuthority?: number | undefined;
370
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
371
+ taskUpdatedAt?: string | undefined;
372
+ }>;
224
373
  export declare const QuestionModeSchema: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat", "pool_discovery"]>;
225
374
  /** One server-side candidate→side assignment (never serialized to clients). */
226
375
  export declare const QuestionPoolAssignmentSchema: z.ZodObject<{
@@ -436,8 +585,8 @@ export declare const QuestionPoolSnapshotSchema: z.ZodObject<{
436
585
  embeddingModel?: string | undefined;
437
586
  }[];
438
587
  runId?: string | undefined;
439
- intentText?: string | undefined;
440
588
  intentFingerprint?: string | undefined;
589
+ intentText?: string | undefined;
441
590
  opportunityIds?: string[] | undefined;
442
591
  }, {
443
592
  poolSize: number;
@@ -471,8 +620,8 @@ export declare const QuestionPoolSnapshotSchema: z.ZodObject<{
471
620
  embeddingModel?: string | undefined;
472
621
  }[];
473
622
  runId?: string | undefined;
474
- intentText?: string | undefined;
475
623
  intentFingerprint?: string | undefined;
624
+ intentText?: string | undefined;
476
625
  opportunityIds?: string[] | undefined;
477
626
  }>;
478
627
  /** Internal delivery ledger for proactive pool-question pushes (IND-421). */
@@ -521,15 +670,126 @@ export declare const QuestionPoolPushSchema: z.ZodObject<{
521
670
  }>;
522
671
  /** Durable request state for proactive pool-question delivery. */
523
672
  export declare const QuestionPoolPushRequestStatusSchema: z.ZodEnum<["requested", "suppressed"]>;
524
- /** Internal reason a pending pool question was voided. */
525
- export declare const QuestionVoidedReasonSchema: z.ZodEnum<["pool_drift", "intent_edit"]>;
673
+ /** Private snapshot for a post-discovery recovery refinement question. */
674
+ export declare const QuestionRecoverySnapshotSchema: z.ZodObject<{
675
+ version: z.ZodLiteral<1>;
676
+ intentFingerprint: z.ZodString;
677
+ completionSource: z.ZodEnum<["from_intent", "discovery_run"]>;
678
+ /** Privacy-safe aggregate only; raw negotiation evidence is never persisted. */
679
+ rejectedNegotiationCount: z.ZodOptional<z.ZodNumber>;
680
+ /** Bounded internal correlation id for an asynchronous discovery run. */
681
+ runId: z.ZodOptional<z.ZodString>;
682
+ }, "strip", z.ZodTypeAny, {
683
+ version: 1;
684
+ intentFingerprint: string;
685
+ completionSource: "from_intent" | "discovery_run";
686
+ runId?: string | undefined;
687
+ rejectedNegotiationCount?: number | undefined;
688
+ }, {
689
+ version: 1;
690
+ intentFingerprint: string;
691
+ completionSource: "from_intent" | "discovery_run";
692
+ runId?: string | undefined;
693
+ rejectedNegotiationCount?: number | undefined;
694
+ }>;
695
+ /** Internal reason a pending question was voided. */
696
+ export declare const QuestionVoidedReasonSchema: z.ZodEnum<["pool_drift", "intent_edit", "recovery_drift", "negotiation_stale"]>;
526
697
  /** Permanent reasons that terminalize an unclaimed proactive push request. */
527
698
  export declare const QuestionPoolPushRequestReasonSchema: z.ZodEnum<["question_lifecycle", "intent_lifecycle", "malformed_source", "malformed_actor", "malformed_pool", "malformed_cycle", "visited", "pool_size", "voi", "cycle_budget"]>;
528
699
  export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
529
700
  /** Which preset mode generated this question. */
530
701
  mode: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat", "pool_discovery"]>;
531
702
  /** Internal reason for generation; independent of mode and QUD repair metadata. */
532
- purpose: z.ZodOptional<z.ZodEnum<["uptake"]>>;
703
+ purpose: z.ZodOptional<z.ZodEnum<["uptake", "recovery", "stalled_followup", "inflight_consultation"]>>;
704
+ /** Exact negotiation recipient/intent/task routing provenance. Internal only. */
705
+ negotiation: z.ZodOptional<z.ZodEffects<z.ZodObject<{
706
+ version: z.ZodLiteral<1>;
707
+ purpose: z.ZodEnum<["uptake", "stalled_followup", "inflight_consultation"]>;
708
+ recipientUserId: z.ZodString;
709
+ recipientIntentId: z.ZodString;
710
+ opportunityId: z.ZodString;
711
+ taskId: z.ZodOptional<z.ZodString>;
712
+ networkId: z.ZodString;
713
+ intentFingerprint: z.ZodString;
714
+ opportunityStatus: z.ZodEnum<["latent", "draft", "negotiating", "pending", "stalled", "accepted", "rejected", "expired"]>;
715
+ opportunityUpdatedAt: z.ZodString;
716
+ taskState: z.ZodOptional<z.ZodEnum<["submitted", "working", "input_required", "completed", "canceled", "failed", "rejected", "auth_required", "waiting_for_agent", "claimed"]>>;
717
+ taskUpdatedAt: z.ZodOptional<z.ZodString>;
718
+ /** Uptake only: exact low-authority counterparty eligibility binding. */
719
+ counterpartyUserId: z.ZodOptional<z.ZodString>;
720
+ counterpartyIntentId: z.ZodOptional<z.ZodString>;
721
+ counterpartyFelicityAuthority: z.ZodOptional<z.ZodNumber>;
722
+ /** Stable per-generation position so retries dedupe without reducing cardinality. */
723
+ questionOrdinal: z.ZodNumber;
724
+ }, "strip", z.ZodTypeAny, {
725
+ networkId: string;
726
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
727
+ recipientUserId: string;
728
+ recipientIntentId: string;
729
+ opportunityId: string;
730
+ version: 1;
731
+ intentFingerprint: string;
732
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
733
+ opportunityUpdatedAt: string;
734
+ questionOrdinal: number;
735
+ taskId?: string | undefined;
736
+ counterpartyUserId?: string | undefined;
737
+ counterpartyIntentId?: string | undefined;
738
+ counterpartyFelicityAuthority?: number | undefined;
739
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
740
+ taskUpdatedAt?: string | undefined;
741
+ }, {
742
+ networkId: string;
743
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
744
+ recipientUserId: string;
745
+ recipientIntentId: string;
746
+ opportunityId: string;
747
+ version: 1;
748
+ intentFingerprint: string;
749
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
750
+ opportunityUpdatedAt: string;
751
+ questionOrdinal: number;
752
+ taskId?: string | undefined;
753
+ counterpartyUserId?: string | undefined;
754
+ counterpartyIntentId?: string | undefined;
755
+ counterpartyFelicityAuthority?: number | undefined;
756
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
757
+ taskUpdatedAt?: string | undefined;
758
+ }>, {
759
+ networkId: string;
760
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
761
+ recipientUserId: string;
762
+ recipientIntentId: string;
763
+ opportunityId: string;
764
+ version: 1;
765
+ intentFingerprint: string;
766
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
767
+ opportunityUpdatedAt: string;
768
+ questionOrdinal: number;
769
+ taskId?: string | undefined;
770
+ counterpartyUserId?: string | undefined;
771
+ counterpartyIntentId?: string | undefined;
772
+ counterpartyFelicityAuthority?: number | undefined;
773
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
774
+ taskUpdatedAt?: string | undefined;
775
+ }, {
776
+ networkId: string;
777
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
778
+ recipientUserId: string;
779
+ recipientIntentId: string;
780
+ opportunityId: string;
781
+ version: 1;
782
+ intentFingerprint: string;
783
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
784
+ opportunityUpdatedAt: string;
785
+ questionOrdinal: number;
786
+ taskId?: string | undefined;
787
+ counterpartyUserId?: string | undefined;
788
+ counterpartyIntentId?: string | undefined;
789
+ counterpartyFelicityAuthority?: number | undefined;
790
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
791
+ taskUpdatedAt?: string | undefined;
792
+ }>>;
533
793
  /** Entity type that triggered generation (e.g. "opportunity", "intent", "profile"). */
534
794
  sourceType: z.ZodString;
535
795
  /** ID of the triggering entity. */
@@ -544,6 +804,8 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
544
804
  underspecificationType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["missing_constituent", "missing_constraint", "open_alternative_set"]>>>;
545
805
  /** ID of the assistant message that triggered this question. Used by the frontend to anchor the question card inline. */
546
806
  messageId: z.ZodOptional<z.ZodString>;
807
+ /** Durable server-only conversation session binding used to validate messageId. */
808
+ sessionId: z.ZodOptional<z.ZodString>;
547
809
  /**
548
810
  * pool_discovery only: the mined pool snapshot (assignments + alternates).
549
811
  * INTERNAL — stripped from every client-facing read (web + MCP).
@@ -694,8 +956,8 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
694
956
  embeddingModel?: string | undefined;
695
957
  }[];
696
958
  runId?: string | undefined;
697
- intentText?: string | undefined;
698
959
  intentFingerprint?: string | undefined;
960
+ intentText?: string | undefined;
699
961
  opportunityIds?: string[] | undefined;
700
962
  }, {
701
963
  poolSize: number;
@@ -729,10 +991,32 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
729
991
  embeddingModel?: string | undefined;
730
992
  }[];
731
993
  runId?: string | undefined;
732
- intentText?: string | undefined;
733
994
  intentFingerprint?: string | undefined;
995
+ intentText?: string | undefined;
734
996
  opportunityIds?: string[] | undefined;
735
997
  }>>;
998
+ /** Post-discovery intent recovery snapshot. Internal only. */
999
+ recovery: z.ZodOptional<z.ZodObject<{
1000
+ version: z.ZodLiteral<1>;
1001
+ intentFingerprint: z.ZodString;
1002
+ completionSource: z.ZodEnum<["from_intent", "discovery_run"]>;
1003
+ /** Privacy-safe aggregate only; raw negotiation evidence is never persisted. */
1004
+ rejectedNegotiationCount: z.ZodOptional<z.ZodNumber>;
1005
+ /** Bounded internal correlation id for an asynchronous discovery run. */
1006
+ runId: z.ZodOptional<z.ZodString>;
1007
+ }, "strip", z.ZodTypeAny, {
1008
+ version: 1;
1009
+ intentFingerprint: string;
1010
+ completionSource: "from_intent" | "discovery_run";
1011
+ runId?: string | undefined;
1012
+ rejectedNegotiationCount?: number | undefined;
1013
+ }, {
1014
+ version: 1;
1015
+ intentFingerprint: string;
1016
+ completionSource: "from_intent" | "discovery_run";
1017
+ runId?: string | undefined;
1018
+ rejectedNegotiationCount?: number | undefined;
1019
+ }>>;
736
1020
  /** Durable request marker written before enqueueing proactive delivery. Internal only. */
737
1021
  pushRequestedAt: z.ZodOptional<z.ZodString>;
738
1022
  /** Last bounded recovery sweep that selected this request. Internal only. */
@@ -788,7 +1072,7 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
788
1072
  failure?: string | undefined;
789
1073
  }>>;
790
1074
  /** Internal reason this question was voided after pool or intent drift. */
791
- voidedReason: z.ZodOptional<z.ZodEnum<["pool_drift", "intent_edit"]>>;
1075
+ voidedReason: z.ZodOptional<z.ZodEnum<["pool_drift", "intent_edit", "recovery_drift", "negotiation_stale"]>>;
792
1076
  /** Authoritative successful-delivery ledger timestamp. Internal only. */
793
1077
  pushedAt: z.ZodOptional<z.ZodString>;
794
1078
  }, "strip", z.ZodTypeAny, {
@@ -813,9 +1097,35 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
813
1097
  } | undefined;
814
1098
  strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
815
1099
  underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
1100
+ recovery?: {
1101
+ version: 1;
1102
+ intentFingerprint: string;
1103
+ completionSource: "from_intent" | "discovery_run";
1104
+ runId?: string | undefined;
1105
+ rejectedNegotiationCount?: number | undefined;
1106
+ } | undefined;
1107
+ purpose?: "uptake" | "stalled_followup" | "inflight_consultation" | "recovery" | undefined;
1108
+ negotiation?: {
1109
+ networkId: string;
1110
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
1111
+ recipientUserId: string;
1112
+ recipientIntentId: string;
1113
+ opportunityId: string;
1114
+ version: 1;
1115
+ intentFingerprint: string;
1116
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
1117
+ opportunityUpdatedAt: string;
1118
+ questionOrdinal: number;
1119
+ taskId?: string | undefined;
1120
+ counterpartyUserId?: string | undefined;
1121
+ counterpartyIntentId?: string | undefined;
1122
+ counterpartyFelicityAuthority?: number | undefined;
1123
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
1124
+ taskUpdatedAt?: string | undefined;
1125
+ } | undefined;
816
1126
  messageId?: string | undefined;
817
- purpose?: "uptake" | undefined;
818
1127
  triggeredBy?: string | undefined;
1128
+ sessionId?: string | undefined;
819
1129
  pool?: {
820
1130
  poolSize: number;
821
1131
  minedAt: string;
@@ -848,8 +1158,8 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
848
1158
  embeddingModel?: string | undefined;
849
1159
  }[];
850
1160
  runId?: string | undefined;
851
- intentText?: string | undefined;
852
1161
  intentFingerprint?: string | undefined;
1162
+ intentText?: string | undefined;
853
1163
  opportunityIds?: string[] | undefined;
854
1164
  } | undefined;
855
1165
  pushRequestedAt?: string | undefined;
@@ -857,7 +1167,7 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
857
1167
  pushRequestStatus?: "suppressed" | "requested" | undefined;
858
1168
  pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
859
1169
  pushRequestSuppressedAt?: string | undefined;
860
- voidedReason?: "pool_drift" | "intent_edit" | undefined;
1170
+ voidedReason?: "pool_drift" | "intent_edit" | "recovery_drift" | "negotiation_stale" | undefined;
861
1171
  pushedAt?: string | undefined;
862
1172
  }, {
863
1173
  mode: "chat" | "intent" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
@@ -881,9 +1191,35 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
881
1191
  } | undefined;
882
1192
  strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
883
1193
  underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
1194
+ recovery?: {
1195
+ version: 1;
1196
+ intentFingerprint: string;
1197
+ completionSource: "from_intent" | "discovery_run";
1198
+ runId?: string | undefined;
1199
+ rejectedNegotiationCount?: number | undefined;
1200
+ } | undefined;
1201
+ purpose?: "uptake" | "stalled_followup" | "inflight_consultation" | "recovery" | undefined;
1202
+ negotiation?: {
1203
+ networkId: string;
1204
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
1205
+ recipientUserId: string;
1206
+ recipientIntentId: string;
1207
+ opportunityId: string;
1208
+ version: 1;
1209
+ intentFingerprint: string;
1210
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
1211
+ opportunityUpdatedAt: string;
1212
+ questionOrdinal: number;
1213
+ taskId?: string | undefined;
1214
+ counterpartyUserId?: string | undefined;
1215
+ counterpartyIntentId?: string | undefined;
1216
+ counterpartyFelicityAuthority?: number | undefined;
1217
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
1218
+ taskUpdatedAt?: string | undefined;
1219
+ } | undefined;
884
1220
  messageId?: string | undefined;
885
- purpose?: "uptake" | undefined;
886
1221
  triggeredBy?: string | undefined;
1222
+ sessionId?: string | undefined;
887
1223
  pool?: {
888
1224
  poolSize: number;
889
1225
  minedAt: string;
@@ -916,8 +1252,8 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
916
1252
  embeddingModel?: string | undefined;
917
1253
  }[];
918
1254
  runId?: string | undefined;
919
- intentText?: string | undefined;
920
1255
  intentFingerprint?: string | undefined;
1256
+ intentText?: string | undefined;
921
1257
  opportunityIds?: string[] | undefined;
922
1258
  } | undefined;
923
1259
  pushRequestedAt?: string | undefined;
@@ -925,7 +1261,7 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
925
1261
  pushRequestStatus?: "suppressed" | "requested" | undefined;
926
1262
  pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
927
1263
  pushRequestSuppressedAt?: string | undefined;
928
- voidedReason?: "pool_drift" | "intent_edit" | undefined;
1264
+ voidedReason?: "pool_drift" | "intent_edit" | "recovery_drift" | "negotiation_stale" | undefined;
929
1265
  pushedAt?: string | undefined;
930
1266
  }>, {
931
1267
  mode: "chat" | "intent" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
@@ -949,9 +1285,35 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
949
1285
  } | undefined;
950
1286
  strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
951
1287
  underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
1288
+ recovery?: {
1289
+ version: 1;
1290
+ intentFingerprint: string;
1291
+ completionSource: "from_intent" | "discovery_run";
1292
+ runId?: string | undefined;
1293
+ rejectedNegotiationCount?: number | undefined;
1294
+ } | undefined;
1295
+ purpose?: "uptake" | "stalled_followup" | "inflight_consultation" | "recovery" | undefined;
1296
+ negotiation?: {
1297
+ networkId: string;
1298
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
1299
+ recipientUserId: string;
1300
+ recipientIntentId: string;
1301
+ opportunityId: string;
1302
+ version: 1;
1303
+ intentFingerprint: string;
1304
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
1305
+ opportunityUpdatedAt: string;
1306
+ questionOrdinal: number;
1307
+ taskId?: string | undefined;
1308
+ counterpartyUserId?: string | undefined;
1309
+ counterpartyIntentId?: string | undefined;
1310
+ counterpartyFelicityAuthority?: number | undefined;
1311
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
1312
+ taskUpdatedAt?: string | undefined;
1313
+ } | undefined;
952
1314
  messageId?: string | undefined;
953
- purpose?: "uptake" | undefined;
954
1315
  triggeredBy?: string | undefined;
1316
+ sessionId?: string | undefined;
955
1317
  pool?: {
956
1318
  poolSize: number;
957
1319
  minedAt: string;
@@ -984,8 +1346,8 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
984
1346
  embeddingModel?: string | undefined;
985
1347
  }[];
986
1348
  runId?: string | undefined;
987
- intentText?: string | undefined;
988
1349
  intentFingerprint?: string | undefined;
1350
+ intentText?: string | undefined;
989
1351
  opportunityIds?: string[] | undefined;
990
1352
  } | undefined;
991
1353
  pushRequestedAt?: string | undefined;
@@ -993,7 +1355,7 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
993
1355
  pushRequestStatus?: "suppressed" | "requested" | undefined;
994
1356
  pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
995
1357
  pushRequestSuppressedAt?: string | undefined;
996
- voidedReason?: "pool_drift" | "intent_edit" | undefined;
1358
+ voidedReason?: "pool_drift" | "intent_edit" | "recovery_drift" | "negotiation_stale" | undefined;
997
1359
  pushedAt?: string | undefined;
998
1360
  }, {
999
1361
  mode: "chat" | "intent" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
@@ -1017,9 +1379,35 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
1017
1379
  } | undefined;
1018
1380
  strategy?: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge" | undefined;
1019
1381
  underspecificationType?: "missing_constituent" | "missing_constraint" | "open_alternative_set" | null | undefined;
1382
+ recovery?: {
1383
+ version: 1;
1384
+ intentFingerprint: string;
1385
+ completionSource: "from_intent" | "discovery_run";
1386
+ runId?: string | undefined;
1387
+ rejectedNegotiationCount?: number | undefined;
1388
+ } | undefined;
1389
+ purpose?: "uptake" | "stalled_followup" | "inflight_consultation" | "recovery" | undefined;
1390
+ negotiation?: {
1391
+ networkId: string;
1392
+ purpose: "uptake" | "stalled_followup" | "inflight_consultation";
1393
+ recipientUserId: string;
1394
+ recipientIntentId: string;
1395
+ opportunityId: string;
1396
+ version: 1;
1397
+ intentFingerprint: string;
1398
+ opportunityStatus: "latent" | "draft" | "negotiating" | "pending" | "stalled" | "accepted" | "rejected" | "expired";
1399
+ opportunityUpdatedAt: string;
1400
+ questionOrdinal: number;
1401
+ taskId?: string | undefined;
1402
+ counterpartyUserId?: string | undefined;
1403
+ counterpartyIntentId?: string | undefined;
1404
+ counterpartyFelicityAuthority?: number | undefined;
1405
+ taskState?: "rejected" | "waiting_for_agent" | "input_required" | "completed" | "failed" | "submitted" | "working" | "canceled" | "auth_required" | "claimed" | undefined;
1406
+ taskUpdatedAt?: string | undefined;
1407
+ } | undefined;
1020
1408
  messageId?: string | undefined;
1021
- purpose?: "uptake" | undefined;
1022
1409
  triggeredBy?: string | undefined;
1410
+ sessionId?: string | undefined;
1023
1411
  pool?: {
1024
1412
  poolSize: number;
1025
1413
  minedAt: string;
@@ -1052,8 +1440,8 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
1052
1440
  embeddingModel?: string | undefined;
1053
1441
  }[];
1054
1442
  runId?: string | undefined;
1055
- intentText?: string | undefined;
1056
1443
  intentFingerprint?: string | undefined;
1444
+ intentText?: string | undefined;
1057
1445
  opportunityIds?: string[] | undefined;
1058
1446
  } | undefined;
1059
1447
  pushRequestedAt?: string | undefined;
@@ -1061,7 +1449,7 @@ export declare const QuestionDetectionSchema: z.ZodEffects<z.ZodObject<{
1061
1449
  pushRequestStatus?: "suppressed" | "requested" | undefined;
1062
1450
  pushRequestReason?: "voi" | "question_lifecycle" | "intent_lifecycle" | "malformed_source" | "malformed_actor" | "malformed_pool" | "malformed_cycle" | "visited" | "pool_size" | "cycle_budget" | undefined;
1063
1451
  pushRequestSuppressedAt?: string | undefined;
1064
- voidedReason?: "pool_drift" | "intent_edit" | undefined;
1452
+ voidedReason?: "pool_drift" | "intent_edit" | "recovery_drift" | "negotiation_stale" | undefined;
1065
1453
  pushedAt?: string | undefined;
1066
1454
  }>;
1067
1455
  export declare const QuestionActorSchema: z.ZodObject<{
@@ -1100,6 +1488,9 @@ export declare const QuestionAnswerSchema: z.ZodObject<{
1100
1488
  answeredAt: string;
1101
1489
  freeText?: string | undefined;
1102
1490
  }>;
1491
+ export type NegotiationQuestionPurpose = z.infer<typeof NegotiationQuestionPurposeSchema>;
1492
+ export type NegotiationQuestionCandidate = z.infer<typeof NegotiationQuestionCandidateSchema>;
1493
+ export type NegotiationQuestionProvenance = z.infer<typeof NegotiationQuestionProvenanceSchema>;
1103
1494
  export type QuestionPurpose = z.infer<typeof QuestionPurposeSchema>;
1104
1495
  export type QuestionMode = z.infer<typeof QuestionModeSchema>;
1105
1496
  export type QuestionDetection = z.infer<typeof QuestionDetectionSchema>;
@@ -1108,6 +1499,7 @@ export type QuestionAnswer = z.infer<typeof QuestionAnswerSchema>;
1108
1499
  export type QuestionPoolAssignment = z.infer<typeof QuestionPoolAssignmentSchema>;
1109
1500
  export type QuestionPoolDiscriminator = z.infer<typeof QuestionPoolDiscriminatorSchema>;
1110
1501
  export type QuestionPoolSnapshot = z.infer<typeof QuestionPoolSnapshotSchema>;
1502
+ export type QuestionRecoverySnapshot = z.infer<typeof QuestionRecoverySnapshotSchema>;
1111
1503
  export type QuestionPoolPush = z.infer<typeof QuestionPoolPushSchema>;
1112
1504
  export type QuestionVoidedReason = z.infer<typeof QuestionVoidedReasonSchema>;
1113
1505
  export type QuestionPoolPushRequestStatus = z.infer<typeof QuestionPoolPushRequestStatusSchema>;