@indexnetwork/protocol 21.0.0-rc.489.1 → 21.0.0-rc.490.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.
- package/dist/index.d.ts +1 -0
- package/dist/negotiations/negotiation.agent.d.ts +13 -0
- package/dist/negotiations/negotiation.agent.js +53 -3
- package/dist/negotiations/negotiation.client-dm.d.ts +50 -0
- package/dist/negotiations/negotiation.client-dm.js +66 -0
- package/dist/negotiations/negotiation.graph.d.ts +110 -1
- package/dist/negotiations/negotiation.graph.js +2 -1
- package/dist/negotiations/negotiation.graph.shared.d.ts +17 -0
- package/dist/negotiations/negotiation.graph.shared.js +23 -0
- package/dist/negotiations/negotiation.graph.turn.d.ts +27 -0
- package/dist/negotiations/negotiation.graph.turn.js +64 -2
- package/dist/negotiations/negotiation.module.d.ts +2 -1
- package/dist/negotiations/negotiation.module.js +1 -1
- package/dist/negotiations/negotiation.protocol.d.ts +498 -0
- package/dist/negotiations/negotiation.question-safety.d.ts +28 -0
- package/dist/negotiations/negotiation.question-safety.js +65 -0
- package/dist/negotiations/negotiation.state.d.ts +110 -0
- package/dist/questions/question.schema.d.ts +13 -31
- package/dist/questions/question.schema.js +9 -15
- package/dist/shared/schemas/negotiation-state.schema.d.ts +182 -3
- package/dist/shared/schemas/negotiation-state.schema.js +23 -3
- package/dist/shared/schemas/structured-question.schema.d.ts +66 -0
- package/dist/shared/schemas/structured-question.schema.js +31 -0
- package/package.json +1 -1
|
@@ -51,10 +51,75 @@ export declare const InitiatorTurnSchema: z.ZodObject<{
|
|
|
51
51
|
/** Present when action is `ask_user` (v2, P3.2). */
|
|
52
52
|
askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
53
53
|
reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
|
|
54
|
+
question: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
55
|
+
title: z.ZodString;
|
|
56
|
+
prompt: z.ZodString;
|
|
57
|
+
options: z.ZodArray<z.ZodObject<{
|
|
58
|
+
label: z.ZodString;
|
|
59
|
+
description: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
label: string;
|
|
62
|
+
description: string;
|
|
63
|
+
}, {
|
|
64
|
+
label: string;
|
|
65
|
+
description: string;
|
|
66
|
+
}>, "many">;
|
|
67
|
+
multiSelect: z.ZodBoolean;
|
|
68
|
+
}, "strip", z.ZodTypeAny, {
|
|
69
|
+
prompt: string;
|
|
70
|
+
options: {
|
|
71
|
+
label: string;
|
|
72
|
+
description: string;
|
|
73
|
+
}[];
|
|
74
|
+
title: string;
|
|
75
|
+
multiSelect: boolean;
|
|
76
|
+
}, {
|
|
77
|
+
prompt: string;
|
|
78
|
+
options: {
|
|
79
|
+
label: string;
|
|
80
|
+
description: string;
|
|
81
|
+
}[];
|
|
82
|
+
title: string;
|
|
83
|
+
multiSelect: boolean;
|
|
84
|
+
}>>>, {
|
|
85
|
+
prompt: string;
|
|
86
|
+
options: {
|
|
87
|
+
label: string;
|
|
88
|
+
description: string;
|
|
89
|
+
}[];
|
|
90
|
+
title: string;
|
|
91
|
+
multiSelect: boolean;
|
|
92
|
+
} | undefined, {
|
|
93
|
+
prompt: string;
|
|
94
|
+
options: {
|
|
95
|
+
label: string;
|
|
96
|
+
description: string;
|
|
97
|
+
}[];
|
|
98
|
+
title: string;
|
|
99
|
+
multiSelect: boolean;
|
|
100
|
+
} | null | undefined>;
|
|
54
101
|
}, "strict", z.ZodTypeAny, {
|
|
55
102
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
103
|
+
question?: {
|
|
104
|
+
prompt: string;
|
|
105
|
+
options: {
|
|
106
|
+
label: string;
|
|
107
|
+
description: string;
|
|
108
|
+
}[];
|
|
109
|
+
title: string;
|
|
110
|
+
multiSelect: boolean;
|
|
111
|
+
} | undefined;
|
|
56
112
|
}, {
|
|
57
113
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
114
|
+
question?: {
|
|
115
|
+
prompt: string;
|
|
116
|
+
options: {
|
|
117
|
+
label: string;
|
|
118
|
+
description: string;
|
|
119
|
+
}[];
|
|
120
|
+
title: string;
|
|
121
|
+
multiSelect: boolean;
|
|
122
|
+
} | null | undefined;
|
|
58
123
|
}>>>;
|
|
59
124
|
}, "strip", z.ZodTypeAny, {
|
|
60
125
|
action: "counter" | "question" | "outreach" | "withdraw";
|
|
@@ -68,6 +133,15 @@ export declare const InitiatorTurnSchema: z.ZodObject<{
|
|
|
68
133
|
message?: string | null | undefined;
|
|
69
134
|
askUser?: {
|
|
70
135
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
136
|
+
question?: {
|
|
137
|
+
prompt: string;
|
|
138
|
+
options: {
|
|
139
|
+
label: string;
|
|
140
|
+
description: string;
|
|
141
|
+
}[];
|
|
142
|
+
title: string;
|
|
143
|
+
multiSelect: boolean;
|
|
144
|
+
} | undefined;
|
|
71
145
|
} | null | undefined;
|
|
72
146
|
}, {
|
|
73
147
|
action: "counter" | "question" | "outreach" | "withdraw";
|
|
@@ -81,6 +155,15 @@ export declare const InitiatorTurnSchema: z.ZodObject<{
|
|
|
81
155
|
message?: string | null | undefined;
|
|
82
156
|
askUser?: {
|
|
83
157
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
158
|
+
question?: {
|
|
159
|
+
prompt: string;
|
|
160
|
+
options: {
|
|
161
|
+
label: string;
|
|
162
|
+
description: string;
|
|
163
|
+
}[];
|
|
164
|
+
title: string;
|
|
165
|
+
multiSelect: boolean;
|
|
166
|
+
} | null | undefined;
|
|
84
167
|
} | null | undefined;
|
|
85
168
|
}>;
|
|
86
169
|
/** Counterparty seat, non-final turn: the only seat that can accept. */
|
|
@@ -115,10 +198,75 @@ export declare const CounterpartyTurnSchema: z.ZodObject<{
|
|
|
115
198
|
/** Present when action is `ask_user` (v2, P3.2). */
|
|
116
199
|
askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
117
200
|
reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
|
|
201
|
+
question: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
202
|
+
title: z.ZodString;
|
|
203
|
+
prompt: z.ZodString;
|
|
204
|
+
options: z.ZodArray<z.ZodObject<{
|
|
205
|
+
label: z.ZodString;
|
|
206
|
+
description: z.ZodString;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
label: string;
|
|
209
|
+
description: string;
|
|
210
|
+
}, {
|
|
211
|
+
label: string;
|
|
212
|
+
description: string;
|
|
213
|
+
}>, "many">;
|
|
214
|
+
multiSelect: z.ZodBoolean;
|
|
215
|
+
}, "strip", z.ZodTypeAny, {
|
|
216
|
+
prompt: string;
|
|
217
|
+
options: {
|
|
218
|
+
label: string;
|
|
219
|
+
description: string;
|
|
220
|
+
}[];
|
|
221
|
+
title: string;
|
|
222
|
+
multiSelect: boolean;
|
|
223
|
+
}, {
|
|
224
|
+
prompt: string;
|
|
225
|
+
options: {
|
|
226
|
+
label: string;
|
|
227
|
+
description: string;
|
|
228
|
+
}[];
|
|
229
|
+
title: string;
|
|
230
|
+
multiSelect: boolean;
|
|
231
|
+
}>>>, {
|
|
232
|
+
prompt: string;
|
|
233
|
+
options: {
|
|
234
|
+
label: string;
|
|
235
|
+
description: string;
|
|
236
|
+
}[];
|
|
237
|
+
title: string;
|
|
238
|
+
multiSelect: boolean;
|
|
239
|
+
} | undefined, {
|
|
240
|
+
prompt: string;
|
|
241
|
+
options: {
|
|
242
|
+
label: string;
|
|
243
|
+
description: string;
|
|
244
|
+
}[];
|
|
245
|
+
title: string;
|
|
246
|
+
multiSelect: boolean;
|
|
247
|
+
} | null | undefined>;
|
|
118
248
|
}, "strict", z.ZodTypeAny, {
|
|
119
249
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
250
|
+
question?: {
|
|
251
|
+
prompt: string;
|
|
252
|
+
options: {
|
|
253
|
+
label: string;
|
|
254
|
+
description: string;
|
|
255
|
+
}[];
|
|
256
|
+
title: string;
|
|
257
|
+
multiSelect: boolean;
|
|
258
|
+
} | undefined;
|
|
120
259
|
}, {
|
|
121
260
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
261
|
+
question?: {
|
|
262
|
+
prompt: string;
|
|
263
|
+
options: {
|
|
264
|
+
label: string;
|
|
265
|
+
description: string;
|
|
266
|
+
}[];
|
|
267
|
+
title: string;
|
|
268
|
+
multiSelect: boolean;
|
|
269
|
+
} | null | undefined;
|
|
122
270
|
}>>>;
|
|
123
271
|
}, "strip", z.ZodTypeAny, {
|
|
124
272
|
action: "accept" | "counter" | "question" | "decline";
|
|
@@ -132,6 +280,15 @@ export declare const CounterpartyTurnSchema: z.ZodObject<{
|
|
|
132
280
|
message?: string | null | undefined;
|
|
133
281
|
askUser?: {
|
|
134
282
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
283
|
+
question?: {
|
|
284
|
+
prompt: string;
|
|
285
|
+
options: {
|
|
286
|
+
label: string;
|
|
287
|
+
description: string;
|
|
288
|
+
}[];
|
|
289
|
+
title: string;
|
|
290
|
+
multiSelect: boolean;
|
|
291
|
+
} | undefined;
|
|
135
292
|
} | null | undefined;
|
|
136
293
|
}, {
|
|
137
294
|
action: "accept" | "counter" | "question" | "decline";
|
|
@@ -145,6 +302,15 @@ export declare const CounterpartyTurnSchema: z.ZodObject<{
|
|
|
145
302
|
message?: string | null | undefined;
|
|
146
303
|
askUser?: {
|
|
147
304
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
305
|
+
question?: {
|
|
306
|
+
prompt: string;
|
|
307
|
+
options: {
|
|
308
|
+
label: string;
|
|
309
|
+
description: string;
|
|
310
|
+
}[];
|
|
311
|
+
title: string;
|
|
312
|
+
multiSelect: boolean;
|
|
313
|
+
} | null | undefined;
|
|
148
314
|
} | null | undefined;
|
|
149
315
|
}>;
|
|
150
316
|
/** Initiator seat, final allowed turn: commit to walking away or leave the door open. */
|
|
@@ -179,10 +345,75 @@ export declare const FinalInitiatorTurnSchema: z.ZodObject<{
|
|
|
179
345
|
/** Present when action is `ask_user` (v2, P3.2). */
|
|
180
346
|
askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
181
347
|
reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
|
|
348
|
+
question: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
349
|
+
title: z.ZodString;
|
|
350
|
+
prompt: z.ZodString;
|
|
351
|
+
options: z.ZodArray<z.ZodObject<{
|
|
352
|
+
label: z.ZodString;
|
|
353
|
+
description: z.ZodString;
|
|
354
|
+
}, "strip", z.ZodTypeAny, {
|
|
355
|
+
label: string;
|
|
356
|
+
description: string;
|
|
357
|
+
}, {
|
|
358
|
+
label: string;
|
|
359
|
+
description: string;
|
|
360
|
+
}>, "many">;
|
|
361
|
+
multiSelect: z.ZodBoolean;
|
|
362
|
+
}, "strip", z.ZodTypeAny, {
|
|
363
|
+
prompt: string;
|
|
364
|
+
options: {
|
|
365
|
+
label: string;
|
|
366
|
+
description: string;
|
|
367
|
+
}[];
|
|
368
|
+
title: string;
|
|
369
|
+
multiSelect: boolean;
|
|
370
|
+
}, {
|
|
371
|
+
prompt: string;
|
|
372
|
+
options: {
|
|
373
|
+
label: string;
|
|
374
|
+
description: string;
|
|
375
|
+
}[];
|
|
376
|
+
title: string;
|
|
377
|
+
multiSelect: boolean;
|
|
378
|
+
}>>>, {
|
|
379
|
+
prompt: string;
|
|
380
|
+
options: {
|
|
381
|
+
label: string;
|
|
382
|
+
description: string;
|
|
383
|
+
}[];
|
|
384
|
+
title: string;
|
|
385
|
+
multiSelect: boolean;
|
|
386
|
+
} | undefined, {
|
|
387
|
+
prompt: string;
|
|
388
|
+
options: {
|
|
389
|
+
label: string;
|
|
390
|
+
description: string;
|
|
391
|
+
}[];
|
|
392
|
+
title: string;
|
|
393
|
+
multiSelect: boolean;
|
|
394
|
+
} | null | undefined>;
|
|
182
395
|
}, "strict", z.ZodTypeAny, {
|
|
183
396
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
397
|
+
question?: {
|
|
398
|
+
prompt: string;
|
|
399
|
+
options: {
|
|
400
|
+
label: string;
|
|
401
|
+
description: string;
|
|
402
|
+
}[];
|
|
403
|
+
title: string;
|
|
404
|
+
multiSelect: boolean;
|
|
405
|
+
} | undefined;
|
|
184
406
|
}, {
|
|
185
407
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
408
|
+
question?: {
|
|
409
|
+
prompt: string;
|
|
410
|
+
options: {
|
|
411
|
+
label: string;
|
|
412
|
+
description: string;
|
|
413
|
+
}[];
|
|
414
|
+
title: string;
|
|
415
|
+
multiSelect: boolean;
|
|
416
|
+
} | null | undefined;
|
|
186
417
|
}>>>;
|
|
187
418
|
}, "strip", z.ZodTypeAny, {
|
|
188
419
|
action: "counter" | "withdraw";
|
|
@@ -196,6 +427,15 @@ export declare const FinalInitiatorTurnSchema: z.ZodObject<{
|
|
|
196
427
|
message?: string | null | undefined;
|
|
197
428
|
askUser?: {
|
|
198
429
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
430
|
+
question?: {
|
|
431
|
+
prompt: string;
|
|
432
|
+
options: {
|
|
433
|
+
label: string;
|
|
434
|
+
description: string;
|
|
435
|
+
}[];
|
|
436
|
+
title: string;
|
|
437
|
+
multiSelect: boolean;
|
|
438
|
+
} | undefined;
|
|
199
439
|
} | null | undefined;
|
|
200
440
|
}, {
|
|
201
441
|
action: "counter" | "withdraw";
|
|
@@ -209,6 +449,15 @@ export declare const FinalInitiatorTurnSchema: z.ZodObject<{
|
|
|
209
449
|
message?: string | null | undefined;
|
|
210
450
|
askUser?: {
|
|
211
451
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
452
|
+
question?: {
|
|
453
|
+
prompt: string;
|
|
454
|
+
options: {
|
|
455
|
+
label: string;
|
|
456
|
+
description: string;
|
|
457
|
+
}[];
|
|
458
|
+
title: string;
|
|
459
|
+
multiSelect: boolean;
|
|
460
|
+
} | null | undefined;
|
|
212
461
|
} | null | undefined;
|
|
213
462
|
}>;
|
|
214
463
|
/** Counterparty seat, final allowed turn: must decide. */
|
|
@@ -243,10 +492,75 @@ export declare const FinalCounterpartyTurnSchema: z.ZodObject<{
|
|
|
243
492
|
/** Present when action is `ask_user` (v2, P3.2). */
|
|
244
493
|
askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
245
494
|
reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
|
|
495
|
+
question: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
496
|
+
title: z.ZodString;
|
|
497
|
+
prompt: z.ZodString;
|
|
498
|
+
options: z.ZodArray<z.ZodObject<{
|
|
499
|
+
label: z.ZodString;
|
|
500
|
+
description: z.ZodString;
|
|
501
|
+
}, "strip", z.ZodTypeAny, {
|
|
502
|
+
label: string;
|
|
503
|
+
description: string;
|
|
504
|
+
}, {
|
|
505
|
+
label: string;
|
|
506
|
+
description: string;
|
|
507
|
+
}>, "many">;
|
|
508
|
+
multiSelect: z.ZodBoolean;
|
|
509
|
+
}, "strip", z.ZodTypeAny, {
|
|
510
|
+
prompt: string;
|
|
511
|
+
options: {
|
|
512
|
+
label: string;
|
|
513
|
+
description: string;
|
|
514
|
+
}[];
|
|
515
|
+
title: string;
|
|
516
|
+
multiSelect: boolean;
|
|
517
|
+
}, {
|
|
518
|
+
prompt: string;
|
|
519
|
+
options: {
|
|
520
|
+
label: string;
|
|
521
|
+
description: string;
|
|
522
|
+
}[];
|
|
523
|
+
title: string;
|
|
524
|
+
multiSelect: boolean;
|
|
525
|
+
}>>>, {
|
|
526
|
+
prompt: string;
|
|
527
|
+
options: {
|
|
528
|
+
label: string;
|
|
529
|
+
description: string;
|
|
530
|
+
}[];
|
|
531
|
+
title: string;
|
|
532
|
+
multiSelect: boolean;
|
|
533
|
+
} | undefined, {
|
|
534
|
+
prompt: string;
|
|
535
|
+
options: {
|
|
536
|
+
label: string;
|
|
537
|
+
description: string;
|
|
538
|
+
}[];
|
|
539
|
+
title: string;
|
|
540
|
+
multiSelect: boolean;
|
|
541
|
+
} | null | undefined>;
|
|
246
542
|
}, "strict", z.ZodTypeAny, {
|
|
247
543
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
544
|
+
question?: {
|
|
545
|
+
prompt: string;
|
|
546
|
+
options: {
|
|
547
|
+
label: string;
|
|
548
|
+
description: string;
|
|
549
|
+
}[];
|
|
550
|
+
title: string;
|
|
551
|
+
multiSelect: boolean;
|
|
552
|
+
} | undefined;
|
|
248
553
|
}, {
|
|
249
554
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
555
|
+
question?: {
|
|
556
|
+
prompt: string;
|
|
557
|
+
options: {
|
|
558
|
+
label: string;
|
|
559
|
+
description: string;
|
|
560
|
+
}[];
|
|
561
|
+
title: string;
|
|
562
|
+
multiSelect: boolean;
|
|
563
|
+
} | null | undefined;
|
|
250
564
|
}>>>;
|
|
251
565
|
}, "strip", z.ZodTypeAny, {
|
|
252
566
|
action: "accept" | "decline";
|
|
@@ -260,6 +574,15 @@ export declare const FinalCounterpartyTurnSchema: z.ZodObject<{
|
|
|
260
574
|
message?: string | null | undefined;
|
|
261
575
|
askUser?: {
|
|
262
576
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
577
|
+
question?: {
|
|
578
|
+
prompt: string;
|
|
579
|
+
options: {
|
|
580
|
+
label: string;
|
|
581
|
+
description: string;
|
|
582
|
+
}[];
|
|
583
|
+
title: string;
|
|
584
|
+
multiSelect: boolean;
|
|
585
|
+
} | undefined;
|
|
263
586
|
} | null | undefined;
|
|
264
587
|
}, {
|
|
265
588
|
action: "accept" | "decline";
|
|
@@ -273,6 +596,15 @@ export declare const FinalCounterpartyTurnSchema: z.ZodObject<{
|
|
|
273
596
|
message?: string | null | undefined;
|
|
274
597
|
askUser?: {
|
|
275
598
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
599
|
+
question?: {
|
|
600
|
+
prompt: string;
|
|
601
|
+
options: {
|
|
602
|
+
label: string;
|
|
603
|
+
description: string;
|
|
604
|
+
}[];
|
|
605
|
+
title: string;
|
|
606
|
+
multiSelect: boolean;
|
|
607
|
+
} | null | undefined;
|
|
276
608
|
} | null | undefined;
|
|
277
609
|
}>;
|
|
278
610
|
/** Initiator seat, non-final turn, with the client-consult pause available. */
|
|
@@ -307,10 +639,75 @@ export declare const InitiatorAskUserTurnSchema: z.ZodObject<{
|
|
|
307
639
|
/** Present when action is `ask_user` (v2, P3.2). */
|
|
308
640
|
askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
309
641
|
reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
|
|
642
|
+
question: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
643
|
+
title: z.ZodString;
|
|
644
|
+
prompt: z.ZodString;
|
|
645
|
+
options: z.ZodArray<z.ZodObject<{
|
|
646
|
+
label: z.ZodString;
|
|
647
|
+
description: z.ZodString;
|
|
648
|
+
}, "strip", z.ZodTypeAny, {
|
|
649
|
+
label: string;
|
|
650
|
+
description: string;
|
|
651
|
+
}, {
|
|
652
|
+
label: string;
|
|
653
|
+
description: string;
|
|
654
|
+
}>, "many">;
|
|
655
|
+
multiSelect: z.ZodBoolean;
|
|
656
|
+
}, "strip", z.ZodTypeAny, {
|
|
657
|
+
prompt: string;
|
|
658
|
+
options: {
|
|
659
|
+
label: string;
|
|
660
|
+
description: string;
|
|
661
|
+
}[];
|
|
662
|
+
title: string;
|
|
663
|
+
multiSelect: boolean;
|
|
664
|
+
}, {
|
|
665
|
+
prompt: string;
|
|
666
|
+
options: {
|
|
667
|
+
label: string;
|
|
668
|
+
description: string;
|
|
669
|
+
}[];
|
|
670
|
+
title: string;
|
|
671
|
+
multiSelect: boolean;
|
|
672
|
+
}>>>, {
|
|
673
|
+
prompt: string;
|
|
674
|
+
options: {
|
|
675
|
+
label: string;
|
|
676
|
+
description: string;
|
|
677
|
+
}[];
|
|
678
|
+
title: string;
|
|
679
|
+
multiSelect: boolean;
|
|
680
|
+
} | undefined, {
|
|
681
|
+
prompt: string;
|
|
682
|
+
options: {
|
|
683
|
+
label: string;
|
|
684
|
+
description: string;
|
|
685
|
+
}[];
|
|
686
|
+
title: string;
|
|
687
|
+
multiSelect: boolean;
|
|
688
|
+
} | null | undefined>;
|
|
310
689
|
}, "strict", z.ZodTypeAny, {
|
|
311
690
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
691
|
+
question?: {
|
|
692
|
+
prompt: string;
|
|
693
|
+
options: {
|
|
694
|
+
label: string;
|
|
695
|
+
description: string;
|
|
696
|
+
}[];
|
|
697
|
+
title: string;
|
|
698
|
+
multiSelect: boolean;
|
|
699
|
+
} | undefined;
|
|
312
700
|
}, {
|
|
313
701
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
702
|
+
question?: {
|
|
703
|
+
prompt: string;
|
|
704
|
+
options: {
|
|
705
|
+
label: string;
|
|
706
|
+
description: string;
|
|
707
|
+
}[];
|
|
708
|
+
title: string;
|
|
709
|
+
multiSelect: boolean;
|
|
710
|
+
} | null | undefined;
|
|
314
711
|
}>>>;
|
|
315
712
|
}, "strip", z.ZodTypeAny, {
|
|
316
713
|
action: "counter" | "question" | "outreach" | "withdraw" | "ask_user";
|
|
@@ -324,6 +721,15 @@ export declare const InitiatorAskUserTurnSchema: z.ZodObject<{
|
|
|
324
721
|
message?: string | null | undefined;
|
|
325
722
|
askUser?: {
|
|
326
723
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
724
|
+
question?: {
|
|
725
|
+
prompt: string;
|
|
726
|
+
options: {
|
|
727
|
+
label: string;
|
|
728
|
+
description: string;
|
|
729
|
+
}[];
|
|
730
|
+
title: string;
|
|
731
|
+
multiSelect: boolean;
|
|
732
|
+
} | undefined;
|
|
327
733
|
} | null | undefined;
|
|
328
734
|
}, {
|
|
329
735
|
action: "counter" | "question" | "outreach" | "withdraw" | "ask_user";
|
|
@@ -337,6 +743,15 @@ export declare const InitiatorAskUserTurnSchema: z.ZodObject<{
|
|
|
337
743
|
message?: string | null | undefined;
|
|
338
744
|
askUser?: {
|
|
339
745
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
746
|
+
question?: {
|
|
747
|
+
prompt: string;
|
|
748
|
+
options: {
|
|
749
|
+
label: string;
|
|
750
|
+
description: string;
|
|
751
|
+
}[];
|
|
752
|
+
title: string;
|
|
753
|
+
multiSelect: boolean;
|
|
754
|
+
} | null | undefined;
|
|
340
755
|
} | null | undefined;
|
|
341
756
|
}>;
|
|
342
757
|
/** Counterparty seat, non-final turn, with the client-consult pause available. */
|
|
@@ -371,10 +786,75 @@ export declare const CounterpartyAskUserTurnSchema: z.ZodObject<{
|
|
|
371
786
|
/** Present when action is `ask_user` (v2, P3.2). */
|
|
372
787
|
askUser: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
373
788
|
reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>;
|
|
789
|
+
question: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
790
|
+
title: z.ZodString;
|
|
791
|
+
prompt: z.ZodString;
|
|
792
|
+
options: z.ZodArray<z.ZodObject<{
|
|
793
|
+
label: z.ZodString;
|
|
794
|
+
description: z.ZodString;
|
|
795
|
+
}, "strip", z.ZodTypeAny, {
|
|
796
|
+
label: string;
|
|
797
|
+
description: string;
|
|
798
|
+
}, {
|
|
799
|
+
label: string;
|
|
800
|
+
description: string;
|
|
801
|
+
}>, "many">;
|
|
802
|
+
multiSelect: z.ZodBoolean;
|
|
803
|
+
}, "strip", z.ZodTypeAny, {
|
|
804
|
+
prompt: string;
|
|
805
|
+
options: {
|
|
806
|
+
label: string;
|
|
807
|
+
description: string;
|
|
808
|
+
}[];
|
|
809
|
+
title: string;
|
|
810
|
+
multiSelect: boolean;
|
|
811
|
+
}, {
|
|
812
|
+
prompt: string;
|
|
813
|
+
options: {
|
|
814
|
+
label: string;
|
|
815
|
+
description: string;
|
|
816
|
+
}[];
|
|
817
|
+
title: string;
|
|
818
|
+
multiSelect: boolean;
|
|
819
|
+
}>>>, {
|
|
820
|
+
prompt: string;
|
|
821
|
+
options: {
|
|
822
|
+
label: string;
|
|
823
|
+
description: string;
|
|
824
|
+
}[];
|
|
825
|
+
title: string;
|
|
826
|
+
multiSelect: boolean;
|
|
827
|
+
} | undefined, {
|
|
828
|
+
prompt: string;
|
|
829
|
+
options: {
|
|
830
|
+
label: string;
|
|
831
|
+
description: string;
|
|
832
|
+
}[];
|
|
833
|
+
title: string;
|
|
834
|
+
multiSelect: boolean;
|
|
835
|
+
} | null | undefined>;
|
|
374
836
|
}, "strict", z.ZodTypeAny, {
|
|
375
837
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
838
|
+
question?: {
|
|
839
|
+
prompt: string;
|
|
840
|
+
options: {
|
|
841
|
+
label: string;
|
|
842
|
+
description: string;
|
|
843
|
+
}[];
|
|
844
|
+
title: string;
|
|
845
|
+
multiSelect: boolean;
|
|
846
|
+
} | undefined;
|
|
376
847
|
}, {
|
|
377
848
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
849
|
+
question?: {
|
|
850
|
+
prompt: string;
|
|
851
|
+
options: {
|
|
852
|
+
label: string;
|
|
853
|
+
description: string;
|
|
854
|
+
}[];
|
|
855
|
+
title: string;
|
|
856
|
+
multiSelect: boolean;
|
|
857
|
+
} | null | undefined;
|
|
378
858
|
}>>>;
|
|
379
859
|
}, "strip", z.ZodTypeAny, {
|
|
380
860
|
action: "accept" | "counter" | "question" | "decline" | "ask_user";
|
|
@@ -388,6 +868,15 @@ export declare const CounterpartyAskUserTurnSchema: z.ZodObject<{
|
|
|
388
868
|
message?: string | null | undefined;
|
|
389
869
|
askUser?: {
|
|
390
870
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
871
|
+
question?: {
|
|
872
|
+
prompt: string;
|
|
873
|
+
options: {
|
|
874
|
+
label: string;
|
|
875
|
+
description: string;
|
|
876
|
+
}[];
|
|
877
|
+
title: string;
|
|
878
|
+
multiSelect: boolean;
|
|
879
|
+
} | undefined;
|
|
391
880
|
} | null | undefined;
|
|
392
881
|
}, {
|
|
393
882
|
action: "accept" | "counter" | "question" | "decline" | "ask_user";
|
|
@@ -401,6 +890,15 @@ export declare const CounterpartyAskUserTurnSchema: z.ZodObject<{
|
|
|
401
890
|
message?: string | null | undefined;
|
|
402
891
|
askUser?: {
|
|
403
892
|
reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority";
|
|
893
|
+
question?: {
|
|
894
|
+
prompt: string;
|
|
895
|
+
options: {
|
|
896
|
+
label: string;
|
|
897
|
+
description: string;
|
|
898
|
+
}[];
|
|
899
|
+
title: string;
|
|
900
|
+
multiSelect: boolean;
|
|
901
|
+
} | null | undefined;
|
|
404
902
|
} | null | undefined;
|
|
405
903
|
}>;
|
|
406
904
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { StructuredQuestion } from '../shared/schemas/structured-question.schema.js';
|
|
1
2
|
/** Fixed prompt-safe labels; producers must not replace them with raw network/counterparty text. */
|
|
2
3
|
export declare const NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY = "the other participant";
|
|
3
4
|
export declare const NEGOTIATION_QUESTION_GENERIC_NETWORK = "the selected network";
|
|
@@ -11,6 +12,33 @@ export declare function isSafeNegotiationQuestionText(value: string, options?: {
|
|
|
11
12
|
forbiddenIdentifiers?: string[];
|
|
12
13
|
forbiddenSourceText?: string[];
|
|
13
14
|
}): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Whole-question gate for a question the NEGOTIATOR authored.
|
|
17
|
+
*
|
|
18
|
+
* The pre-A2H `disclosureSubject` never reached the client as written — the
|
|
19
|
+
* server templated the copy around it. An authored `StructuredQuestion` is
|
|
20
|
+
* rendered verbatim, so every visible field needs the same gate the subject
|
|
21
|
+
* got, and it needs it with the identifiers in hand.
|
|
22
|
+
*
|
|
23
|
+
* That is the capability the api-side `isSafeNegotiationQuestionPayload` lacks
|
|
24
|
+
* and cannot gain: at the DB boundary it holds only generic patterns, so it
|
|
25
|
+
* cannot tell that a perfectly well-formed question is naming THIS counterparty
|
|
26
|
+
* or paraphrasing THIS seed assessment. The turn node has both, which is why
|
|
27
|
+
* this runs here and not there.
|
|
28
|
+
*
|
|
29
|
+
* Fail-closed and non-rewriting, like every guard in this file: a caller that
|
|
30
|
+
* gets `false` drops the question and keeps the enum-only path, rather than
|
|
31
|
+
* shipping a repaired one.
|
|
32
|
+
*
|
|
33
|
+
* @param options.forbiddenIdentifiers Names that must not appear as words —
|
|
34
|
+
* the counterparty's, at the call site.
|
|
35
|
+
* @param options.forbiddenSourceText Private inputs that must not be echoed —
|
|
36
|
+
* the seed assessment's reasoning, at the call site.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isSafeAuthoredNegotiationQuestion(question: StructuredQuestion | null | undefined, options?: {
|
|
39
|
+
forbiddenIdentifiers?: string[];
|
|
40
|
+
forbiddenSourceText?: string[];
|
|
41
|
+
}): boolean;
|
|
14
42
|
/** Validate the only structured fields allowed to enter the inflight Questioner prompt. */
|
|
15
43
|
export declare function validateInflightAskUserFields(input: {
|
|
16
44
|
disclosureSubject?: string | null;
|