@indexnetwork/protocol 4.6.0 → 4.7.0-rc.344.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.
@@ -41,6 +41,12 @@ export declare const QuestionSchema: z.ZodObject<{
41
41
  }>, "many">;
42
42
  /** True when options are not mutually exclusive (priorities, bundles). */
43
43
  multiSelect: z.ZodBoolean;
44
+ /**
45
+ * Optional provenance line rendered as a muted chip above the prompt
46
+ * (e.g. "based on 18 people matching this intent"). Aggregate counts only —
47
+ * never individual identities (pool_discovery k-anonymity invariant).
48
+ */
49
+ evidence: z.ZodOptional<z.ZodString>;
44
50
  }, "strip", z.ZodTypeAny, {
45
51
  options: {
46
52
  description: string;
@@ -49,6 +55,7 @@ export declare const QuestionSchema: z.ZodObject<{
49
55
  prompt: string;
50
56
  title: string;
51
57
  multiSelect: boolean;
58
+ evidence?: string | undefined;
52
59
  }, {
53
60
  options: {
54
61
  description: string;
@@ -57,6 +64,7 @@ export declare const QuestionSchema: z.ZodObject<{
57
64
  prompt: string;
58
65
  title: string;
59
66
  multiSelect: boolean;
67
+ evidence?: string | undefined;
60
68
  }>;
61
69
  export declare const QuestionStrategySchema: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
62
70
  export declare const QuestionWithStrategySchema: z.ZodObject<{
@@ -79,6 +87,12 @@ export declare const QuestionWithStrategySchema: z.ZodObject<{
79
87
  }>, "many">;
80
88
  /** True when options are not mutually exclusive (priorities, bundles). */
81
89
  multiSelect: z.ZodBoolean;
90
+ /**
91
+ * Optional provenance line rendered as a muted chip above the prompt
92
+ * (e.g. "based on 18 people matching this intent"). Aggregate counts only —
93
+ * never individual identities (pool_discovery k-anonymity invariant).
94
+ */
95
+ evidence: z.ZodOptional<z.ZodString>;
82
96
  } & {
83
97
  strategy: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
84
98
  }, "strip", z.ZodTypeAny, {
@@ -90,6 +104,7 @@ export declare const QuestionWithStrategySchema: z.ZodObject<{
90
104
  title: string;
91
105
  multiSelect: boolean;
92
106
  strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
107
+ evidence?: string | undefined;
93
108
  }, {
94
109
  options: {
95
110
  description: string;
@@ -99,6 +114,7 @@ export declare const QuestionWithStrategySchema: z.ZodObject<{
99
114
  title: string;
100
115
  multiSelect: boolean;
101
116
  strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
117
+ evidence?: string | undefined;
102
118
  }>;
103
119
  export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
104
120
  questions: z.ZodArray<z.ZodObject<{
@@ -121,6 +137,12 @@ export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
121
137
  }>, "many">;
122
138
  /** True when options are not mutually exclusive (priorities, bundles). */
123
139
  multiSelect: z.ZodBoolean;
140
+ /**
141
+ * Optional provenance line rendered as a muted chip above the prompt
142
+ * (e.g. "based on 18 people matching this intent"). Aggregate counts only —
143
+ * never individual identities (pool_discovery k-anonymity invariant).
144
+ */
145
+ evidence: z.ZodOptional<z.ZodString>;
124
146
  } & {
125
147
  strategy: z.ZodEnum<["refine_intent", "surface_missing_detail", "open_adjacent_thread", "reflective_summary", "surface_emergent_knowledge"]>;
126
148
  }, "strip", z.ZodTypeAny, {
@@ -132,6 +154,7 @@ export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
132
154
  title: string;
133
155
  multiSelect: boolean;
134
156
  strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
157
+ evidence?: string | undefined;
135
158
  }, {
136
159
  options: {
137
160
  description: string;
@@ -141,6 +164,7 @@ export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
141
164
  title: string;
142
165
  multiSelect: boolean;
143
166
  strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
167
+ evidence?: string | undefined;
144
168
  }>, "many">;
145
169
  }, "strip", z.ZodTypeAny, {
146
170
  questions: {
@@ -152,6 +176,7 @@ export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
152
176
  title: string;
153
177
  multiSelect: boolean;
154
178
  strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
179
+ evidence?: string | undefined;
155
180
  }[];
156
181
  }, {
157
182
  questions: {
@@ -163,6 +188,7 @@ export declare const QuestionGeneratorResponseSchema: z.ZodObject<{
163
188
  title: string;
164
189
  multiSelect: boolean;
165
190
  strategy: "refine_intent" | "surface_missing_detail" | "open_adjacent_thread" | "reflective_summary" | "surface_emergent_knowledge";
191
+ evidence?: string | undefined;
166
192
  }[];
167
193
  }>;
168
194
  export type QuestionOption = z.infer<typeof QuestionOptionSchema>;
@@ -179,10 +205,219 @@ export interface QuestionGenerationResult {
179
205
  questions: Question[];
180
206
  strategies: QuestionStrategy[];
181
207
  }
182
- export declare const QuestionModeSchema: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat"]>;
208
+ export declare const QuestionModeSchema: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat", "pool_discovery"]>;
209
+ /** One server-side candidate→side assignment (never serialized to clients). */
210
+ export declare const QuestionPoolAssignmentSchema: z.ZodObject<{
211
+ opportunityId: z.ZodString;
212
+ side: z.ZodString;
213
+ }, "strip", z.ZodTypeAny, {
214
+ opportunityId: string;
215
+ side: string;
216
+ }, {
217
+ opportunityId: string;
218
+ side: string;
219
+ }>;
220
+ /**
221
+ * One mined discriminator carried inside a pool_discovery question's
222
+ * detection (the asked one plus ranked alternates for interview-mode
223
+ * chaining). INTERNAL — the read path strips `detection.pool` before any
224
+ * payload leaves the server.
225
+ */
226
+ export declare const QuestionPoolDiscriminatorSchema: z.ZodObject<{
227
+ label: z.ZodString;
228
+ questionSeed: z.ZodString;
229
+ sides: z.ZodArray<z.ZodString, "many">;
230
+ /** Verified-assignment count per side label. */
231
+ sideCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
232
+ voi: z.ZodNumber;
233
+ evidenceRate: z.ZodNumber;
234
+ /** Verified assignments only — the P3 re-rank input. */
235
+ assignments: z.ZodArray<z.ZodObject<{
236
+ opportunityId: z.ZodString;
237
+ side: z.ZodString;
238
+ }, "strip", z.ZodTypeAny, {
239
+ opportunityId: string;
240
+ side: string;
241
+ }, {
242
+ opportunityId: string;
243
+ side: string;
244
+ }>, "many">;
245
+ }, "strip", z.ZodTypeAny, {
246
+ label: string;
247
+ questionSeed: string;
248
+ sides: string[];
249
+ sideCounts: Record<string, number>;
250
+ voi: number;
251
+ evidenceRate: number;
252
+ assignments: {
253
+ opportunityId: string;
254
+ side: string;
255
+ }[];
256
+ }, {
257
+ label: string;
258
+ questionSeed: string;
259
+ sides: string[];
260
+ sideCounts: Record<string, number>;
261
+ voi: number;
262
+ evidenceRate: number;
263
+ assignments: {
264
+ opportunityId: string;
265
+ side: string;
266
+ }[];
267
+ }>;
268
+ /** Pool snapshot stored on pool_discovery questions (server-side only). */
269
+ export declare const QuestionPoolSnapshotSchema: z.ZodObject<{
270
+ poolSize: z.ZodNumber;
271
+ /** ISO-8601 timestamp of the mining pass. */
272
+ minedAt: z.ZodString;
273
+ /** Discovery run that produced the pool, when known. */
274
+ runId: z.ZodOptional<z.ZodString>;
275
+ /** The discriminator this question asks about. */
276
+ discriminator: z.ZodObject<{
277
+ label: z.ZodString;
278
+ questionSeed: z.ZodString;
279
+ sides: z.ZodArray<z.ZodString, "many">;
280
+ /** Verified-assignment count per side label. */
281
+ sideCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
282
+ voi: z.ZodNumber;
283
+ evidenceRate: z.ZodNumber;
284
+ /** Verified assignments only — the P3 re-rank input. */
285
+ assignments: z.ZodArray<z.ZodObject<{
286
+ opportunityId: z.ZodString;
287
+ side: z.ZodString;
288
+ }, "strip", z.ZodTypeAny, {
289
+ opportunityId: string;
290
+ side: string;
291
+ }, {
292
+ opportunityId: string;
293
+ side: string;
294
+ }>, "many">;
295
+ }, "strip", z.ZodTypeAny, {
296
+ label: string;
297
+ questionSeed: string;
298
+ sides: string[];
299
+ sideCounts: Record<string, number>;
300
+ voi: number;
301
+ evidenceRate: number;
302
+ assignments: {
303
+ opportunityId: string;
304
+ side: string;
305
+ }[];
306
+ }, {
307
+ label: string;
308
+ questionSeed: string;
309
+ sides: string[];
310
+ sideCounts: Record<string, number>;
311
+ voi: number;
312
+ evidenceRate: number;
313
+ assignments: {
314
+ opportunityId: string;
315
+ side: string;
316
+ }[];
317
+ }>;
318
+ /** Remaining ranked discriminators for interview-mode chaining. */
319
+ alternates: z.ZodArray<z.ZodObject<{
320
+ label: z.ZodString;
321
+ questionSeed: z.ZodString;
322
+ sides: z.ZodArray<z.ZodString, "many">;
323
+ /** Verified-assignment count per side label. */
324
+ sideCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
325
+ voi: z.ZodNumber;
326
+ evidenceRate: z.ZodNumber;
327
+ /** Verified assignments only — the P3 re-rank input. */
328
+ assignments: z.ZodArray<z.ZodObject<{
329
+ opportunityId: z.ZodString;
330
+ side: z.ZodString;
331
+ }, "strip", z.ZodTypeAny, {
332
+ opportunityId: string;
333
+ side: string;
334
+ }, {
335
+ opportunityId: string;
336
+ side: string;
337
+ }>, "many">;
338
+ }, "strip", z.ZodTypeAny, {
339
+ label: string;
340
+ questionSeed: string;
341
+ sides: string[];
342
+ sideCounts: Record<string, number>;
343
+ voi: number;
344
+ evidenceRate: number;
345
+ assignments: {
346
+ opportunityId: string;
347
+ side: string;
348
+ }[];
349
+ }, {
350
+ label: string;
351
+ questionSeed: string;
352
+ sides: string[];
353
+ sideCounts: Record<string, number>;
354
+ voi: number;
355
+ evidenceRate: number;
356
+ assignments: {
357
+ opportunityId: string;
358
+ side: string;
359
+ }[];
360
+ }>, "many">;
361
+ }, "strip", z.ZodTypeAny, {
362
+ poolSize: number;
363
+ minedAt: string;
364
+ discriminator: {
365
+ label: string;
366
+ questionSeed: string;
367
+ sides: string[];
368
+ sideCounts: Record<string, number>;
369
+ voi: number;
370
+ evidenceRate: number;
371
+ assignments: {
372
+ opportunityId: string;
373
+ side: string;
374
+ }[];
375
+ };
376
+ alternates: {
377
+ label: string;
378
+ questionSeed: string;
379
+ sides: string[];
380
+ sideCounts: Record<string, number>;
381
+ voi: number;
382
+ evidenceRate: number;
383
+ assignments: {
384
+ opportunityId: string;
385
+ side: string;
386
+ }[];
387
+ }[];
388
+ runId?: string | undefined;
389
+ }, {
390
+ poolSize: number;
391
+ minedAt: string;
392
+ discriminator: {
393
+ label: string;
394
+ questionSeed: string;
395
+ sides: string[];
396
+ sideCounts: Record<string, number>;
397
+ voi: number;
398
+ evidenceRate: number;
399
+ assignments: {
400
+ opportunityId: string;
401
+ side: string;
402
+ }[];
403
+ };
404
+ alternates: {
405
+ label: string;
406
+ questionSeed: string;
407
+ sides: string[];
408
+ sideCounts: Record<string, number>;
409
+ voi: number;
410
+ evidenceRate: number;
411
+ assignments: {
412
+ opportunityId: string;
413
+ side: string;
414
+ }[];
415
+ }[];
416
+ runId?: string | undefined;
417
+ }>;
183
418
  export declare const QuestionDetectionSchema: z.ZodObject<{
184
419
  /** Which preset mode generated this question. */
185
- mode: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat"]>;
420
+ mode: z.ZodEnum<["discovery", "intent", "enrichment", "negotiation", "negotiation_inflight", "chat", "pool_discovery"]>;
186
421
  /** Entity type that triggered generation (e.g. "opportunity", "intent", "profile"). */
187
422
  sourceType: z.ZodString;
188
423
  /** ID of the triggering entity. */
@@ -193,20 +428,231 @@ export declare const QuestionDetectionSchema: z.ZodObject<{
193
428
  timestamp: z.ZodString;
194
429
  /** ID of the assistant message that triggered this question. Used by the frontend to anchor the question card inline. */
195
430
  messageId: z.ZodOptional<z.ZodString>;
431
+ /**
432
+ * pool_discovery only: the mined pool snapshot (assignments + alternates).
433
+ * INTERNAL — stripped from every client-facing read (web + MCP).
434
+ */
435
+ pool: z.ZodOptional<z.ZodObject<{
436
+ poolSize: z.ZodNumber;
437
+ /** ISO-8601 timestamp of the mining pass. */
438
+ minedAt: z.ZodString;
439
+ /** Discovery run that produced the pool, when known. */
440
+ runId: z.ZodOptional<z.ZodString>;
441
+ /** The discriminator this question asks about. */
442
+ discriminator: z.ZodObject<{
443
+ label: z.ZodString;
444
+ questionSeed: z.ZodString;
445
+ sides: z.ZodArray<z.ZodString, "many">;
446
+ /** Verified-assignment count per side label. */
447
+ sideCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
448
+ voi: z.ZodNumber;
449
+ evidenceRate: z.ZodNumber;
450
+ /** Verified assignments only — the P3 re-rank input. */
451
+ assignments: z.ZodArray<z.ZodObject<{
452
+ opportunityId: z.ZodString;
453
+ side: z.ZodString;
454
+ }, "strip", z.ZodTypeAny, {
455
+ opportunityId: string;
456
+ side: string;
457
+ }, {
458
+ opportunityId: string;
459
+ side: string;
460
+ }>, "many">;
461
+ }, "strip", z.ZodTypeAny, {
462
+ label: string;
463
+ questionSeed: string;
464
+ sides: string[];
465
+ sideCounts: Record<string, number>;
466
+ voi: number;
467
+ evidenceRate: number;
468
+ assignments: {
469
+ opportunityId: string;
470
+ side: string;
471
+ }[];
472
+ }, {
473
+ label: string;
474
+ questionSeed: string;
475
+ sides: string[];
476
+ sideCounts: Record<string, number>;
477
+ voi: number;
478
+ evidenceRate: number;
479
+ assignments: {
480
+ opportunityId: string;
481
+ side: string;
482
+ }[];
483
+ }>;
484
+ /** Remaining ranked discriminators for interview-mode chaining. */
485
+ alternates: z.ZodArray<z.ZodObject<{
486
+ label: z.ZodString;
487
+ questionSeed: z.ZodString;
488
+ sides: z.ZodArray<z.ZodString, "many">;
489
+ /** Verified-assignment count per side label. */
490
+ sideCounts: z.ZodRecord<z.ZodString, z.ZodNumber>;
491
+ voi: z.ZodNumber;
492
+ evidenceRate: z.ZodNumber;
493
+ /** Verified assignments only — the P3 re-rank input. */
494
+ assignments: z.ZodArray<z.ZodObject<{
495
+ opportunityId: z.ZodString;
496
+ side: z.ZodString;
497
+ }, "strip", z.ZodTypeAny, {
498
+ opportunityId: string;
499
+ side: string;
500
+ }, {
501
+ opportunityId: string;
502
+ side: string;
503
+ }>, "many">;
504
+ }, "strip", z.ZodTypeAny, {
505
+ label: string;
506
+ questionSeed: string;
507
+ sides: string[];
508
+ sideCounts: Record<string, number>;
509
+ voi: number;
510
+ evidenceRate: number;
511
+ assignments: {
512
+ opportunityId: string;
513
+ side: string;
514
+ }[];
515
+ }, {
516
+ label: string;
517
+ questionSeed: string;
518
+ sides: string[];
519
+ sideCounts: Record<string, number>;
520
+ voi: number;
521
+ evidenceRate: number;
522
+ assignments: {
523
+ opportunityId: string;
524
+ side: string;
525
+ }[];
526
+ }>, "many">;
527
+ }, "strip", z.ZodTypeAny, {
528
+ poolSize: number;
529
+ minedAt: string;
530
+ discriminator: {
531
+ label: string;
532
+ questionSeed: string;
533
+ sides: string[];
534
+ sideCounts: Record<string, number>;
535
+ voi: number;
536
+ evidenceRate: number;
537
+ assignments: {
538
+ opportunityId: string;
539
+ side: string;
540
+ }[];
541
+ };
542
+ alternates: {
543
+ label: string;
544
+ questionSeed: string;
545
+ sides: string[];
546
+ sideCounts: Record<string, number>;
547
+ voi: number;
548
+ evidenceRate: number;
549
+ assignments: {
550
+ opportunityId: string;
551
+ side: string;
552
+ }[];
553
+ }[];
554
+ runId?: string | undefined;
555
+ }, {
556
+ poolSize: number;
557
+ minedAt: string;
558
+ discriminator: {
559
+ label: string;
560
+ questionSeed: string;
561
+ sides: string[];
562
+ sideCounts: Record<string, number>;
563
+ voi: number;
564
+ evidenceRate: number;
565
+ assignments: {
566
+ opportunityId: string;
567
+ side: string;
568
+ }[];
569
+ };
570
+ alternates: {
571
+ label: string;
572
+ questionSeed: string;
573
+ sides: string[];
574
+ sideCounts: Record<string, number>;
575
+ voi: number;
576
+ evidenceRate: number;
577
+ assignments: {
578
+ opportunityId: string;
579
+ side: string;
580
+ }[];
581
+ }[];
582
+ runId?: string | undefined;
583
+ }>>;
196
584
  }, "strip", z.ZodTypeAny, {
197
- mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight";
585
+ mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
198
586
  sourceType: string;
199
587
  sourceId: string;
200
588
  timestamp: string;
201
589
  triggeredBy?: string | undefined;
202
590
  messageId?: string | undefined;
591
+ pool?: {
592
+ poolSize: number;
593
+ minedAt: string;
594
+ discriminator: {
595
+ label: string;
596
+ questionSeed: string;
597
+ sides: string[];
598
+ sideCounts: Record<string, number>;
599
+ voi: number;
600
+ evidenceRate: number;
601
+ assignments: {
602
+ opportunityId: string;
603
+ side: string;
604
+ }[];
605
+ };
606
+ alternates: {
607
+ label: string;
608
+ questionSeed: string;
609
+ sides: string[];
610
+ sideCounts: Record<string, number>;
611
+ voi: number;
612
+ evidenceRate: number;
613
+ assignments: {
614
+ opportunityId: string;
615
+ side: string;
616
+ }[];
617
+ }[];
618
+ runId?: string | undefined;
619
+ } | undefined;
203
620
  }, {
204
- mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight";
621
+ mode: "intent" | "chat" | "enrichment" | "discovery" | "negotiation" | "negotiation_inflight" | "pool_discovery";
205
622
  sourceType: string;
206
623
  sourceId: string;
207
624
  timestamp: string;
208
625
  triggeredBy?: string | undefined;
209
626
  messageId?: string | undefined;
627
+ pool?: {
628
+ poolSize: number;
629
+ minedAt: string;
630
+ discriminator: {
631
+ label: string;
632
+ questionSeed: string;
633
+ sides: string[];
634
+ sideCounts: Record<string, number>;
635
+ voi: number;
636
+ evidenceRate: number;
637
+ assignments: {
638
+ opportunityId: string;
639
+ side: string;
640
+ }[];
641
+ };
642
+ alternates: {
643
+ label: string;
644
+ questionSeed: string;
645
+ sides: string[];
646
+ sideCounts: Record<string, number>;
647
+ voi: number;
648
+ evidenceRate: number;
649
+ assignments: {
650
+ opportunityId: string;
651
+ side: string;
652
+ }[];
653
+ }[];
654
+ runId?: string | undefined;
655
+ } | undefined;
210
656
  }>;
211
657
  export declare const QuestionActorSchema: z.ZodObject<{
212
658
  /** The user this question is for. */
@@ -248,4 +694,7 @@ export type QuestionMode = z.infer<typeof QuestionModeSchema>;
248
694
  export type QuestionDetection = z.infer<typeof QuestionDetectionSchema>;
249
695
  export type QuestionActor = z.infer<typeof QuestionActorSchema>;
250
696
  export type QuestionAnswer = z.infer<typeof QuestionAnswerSchema>;
697
+ export type QuestionPoolAssignment = z.infer<typeof QuestionPoolAssignmentSchema>;
698
+ export type QuestionPoolDiscriminator = z.infer<typeof QuestionPoolDiscriminatorSchema>;
699
+ export type QuestionPoolSnapshot = z.infer<typeof QuestionPoolSnapshotSchema>;
251
700
  //# sourceMappingURL=question.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"question.schema.d.ts","sourceRoot":"/","sources":["shared/schemas/question.schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;IAC/B,+EAA+E;;IAE/E,iFAAiF;;;;;;;;EAEjF,CAAC;AAEH,eAAO,MAAM,cAAc;IACzB,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/E,iFAAiF;;;;;;;;;IAWjF,0EAA0E;;;;;;;;;;;;;;;;;;EAE1E,CAAC;AAEH,eAAO,MAAM,sBAAsB,oIAMjC,CAAC;AAEH,eAAO,MAAM,0BAA0B;IAlBrC,+EAA+E;;IAE/E,yDAAyD;;IAEzD,6EAA6E;;QAX7E,+EAA+E;;QAE/E,iFAAiF;;;;;;;;;IAWjF,0EAA0E;;;;;;;;;;;;;;;;;;;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D,wDAAwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAaxD,mEAAmE;;;;;YAjBnE,gDAAgD;;;;YAIhD,wDAAwD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmCxD,CAAC;AAEH,eAAO,MAAM,mBAAmB;IAC9B,qCAAqC;;IAErC,gCAAgC;;IAEhC,iEAAiE;;;;;;;;;;EAEjE,CAAC;AAEH,eAAO,MAAM,oBAAoB;IAC/B,uCAAuC;;IAEvC,iEAAiE;;IAEjE,+BAA+B;;IAE/B,2DAA2D;;;;;;;;;;;;EAE3D,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -24,6 +24,12 @@ export const QuestionSchema = z.object({
24
24
  options: z.array(QuestionOptionSchema).min(2).max(4),
25
25
  /** True when options are not mutually exclusive (priorities, bundles). */
26
26
  multiSelect: z.boolean(),
27
+ /**
28
+ * Optional provenance line rendered as a muted chip above the prompt
29
+ * (e.g. "based on 18 people matching this intent"). Aggregate counts only —
30
+ * never individual identities (pool_discovery k-anonymity invariant).
31
+ */
32
+ evidence: z.string().min(1).max(160).optional(),
27
33
  });
28
34
  export const QuestionStrategySchema = z.enum([
29
35
  "refine_intent",
@@ -49,7 +55,44 @@ export const QuestionModeSchema = z.enum([
49
55
  "negotiation_inflight",
50
56
  // Orchestrator-initiated mid-conversation questions (ask_user_question tool).
51
57
  "chat",
58
+ // Pool-discriminator questions mined from the intent's candidate pool
59
+ // (IND-418). Synthesized deterministically — no generator LLM call.
60
+ "pool_discovery",
52
61
  ]);
62
+ /** One server-side candidate→side assignment (never serialized to clients). */
63
+ export const QuestionPoolAssignmentSchema = z.object({
64
+ opportunityId: z.string().min(1),
65
+ side: z.string().min(1),
66
+ });
67
+ /**
68
+ * One mined discriminator carried inside a pool_discovery question's
69
+ * detection (the asked one plus ranked alternates for interview-mode
70
+ * chaining). INTERNAL — the read path strips `detection.pool` before any
71
+ * payload leaves the server.
72
+ */
73
+ export const QuestionPoolDiscriminatorSchema = z.object({
74
+ label: z.string().min(1),
75
+ questionSeed: z.string().min(1),
76
+ sides: z.array(z.string().min(1)).min(2).max(3),
77
+ /** Verified-assignment count per side label. */
78
+ sideCounts: z.record(z.string(), z.number()),
79
+ voi: z.number(),
80
+ evidenceRate: z.number(),
81
+ /** Verified assignments only — the P3 re-rank input. */
82
+ assignments: z.array(QuestionPoolAssignmentSchema),
83
+ });
84
+ /** Pool snapshot stored on pool_discovery questions (server-side only). */
85
+ export const QuestionPoolSnapshotSchema = z.object({
86
+ poolSize: z.number().int().min(0),
87
+ /** ISO-8601 timestamp of the mining pass. */
88
+ minedAt: z.string().min(1),
89
+ /** Discovery run that produced the pool, when known. */
90
+ runId: z.string().optional(),
91
+ /** The discriminator this question asks about. */
92
+ discriminator: QuestionPoolDiscriminatorSchema,
93
+ /** Remaining ranked discriminators for interview-mode chaining. */
94
+ alternates: z.array(QuestionPoolDiscriminatorSchema),
95
+ });
53
96
  export const QuestionDetectionSchema = z.object({
54
97
  /** Which preset mode generated this question. */
55
98
  mode: QuestionModeSchema,
@@ -63,6 +106,11 @@ export const QuestionDetectionSchema = z.object({
63
106
  timestamp: z.string().min(1),
64
107
  /** ID of the assistant message that triggered this question. Used by the frontend to anchor the question card inline. */
65
108
  messageId: z.string().optional(),
109
+ /**
110
+ * pool_discovery only: the mined pool snapshot (assignments + alternates).
111
+ * INTERNAL — stripped from every client-facing read (web + MCP).
112
+ */
113
+ pool: QuestionPoolSnapshotSchema.optional(),
66
114
  });
67
115
  export const QuestionActorSchema = z.object({
68
116
  /** The user this question is for. */