@yadsh/dsh-qa-surface 0.4.0 → 0.5.0

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 (89) hide show
  1. package/README.md +41 -5
  2. package/cordis.patch.yml +8 -0
  3. package/lib/accounts/credentials.js +12 -4
  4. package/lib/accounts/credentials.js.map +1 -1
  5. package/lib/accounts/store.js +16 -1
  6. package/lib/accounts/store.js.map +1 -1
  7. package/lib/approvals.js +179 -0
  8. package/lib/approvals.js.map +1 -0
  9. package/lib/cli.js +10 -0
  10. package/lib/cli.js.map +1 -1
  11. package/lib/client/QaSessionController.js +93 -0
  12. package/lib/client/QaSessionController.js.map +1 -1
  13. package/lib/client/QaSurface.js +14 -1
  14. package/lib/client/QaSurface.js.map +1 -1
  15. package/lib/client/approvals.js +104 -0
  16. package/lib/client/approvals.js.map +1 -0
  17. package/lib/client/attestation.js +3 -0
  18. package/lib/client/attestation.js.map +1 -1
  19. package/lib/client/components/QaApproval.js +23 -0
  20. package/lib/client/components/QaApproval.js.map +1 -0
  21. package/lib/client/components/QaChangelog.js +24 -0
  22. package/lib/client/components/QaChangelog.js.map +1 -1
  23. package/lib/client/components/QaQuestions.js +96 -0
  24. package/lib/client/components/QaQuestions.js.map +1 -0
  25. package/lib/client/index.js +11 -0
  26. package/lib/client/index.js.map +1 -1
  27. package/lib/client/project-session-state.js +5 -3
  28. package/lib/client/project-session-state.js.map +1 -1
  29. package/lib/client/questions.js +114 -0
  30. package/lib/client/questions.js.map +1 -0
  31. package/lib/client/settings/sections/sources.js +2 -0
  32. package/lib/client/settings/sections/sources.js.map +1 -1
  33. package/lib/client/styles.js +42 -0
  34. package/lib/client/styles.js.map +1 -1
  35. package/lib/client/types.js +2 -0
  36. package/lib/client/types.js.map +1 -1
  37. package/lib/client.js +1018 -56
  38. package/lib/client.js.map +1 -1
  39. package/lib/config-resolvers/basics.js +4 -2
  40. package/lib/config-resolvers/basics.js.map +1 -1
  41. package/lib/config-resolvers/defaults.js +4 -0
  42. package/lib/config-resolvers/defaults.js.map +1 -1
  43. package/lib/config-resolvers/lockdown.js +11 -0
  44. package/lib/config-resolvers/lockdown.js.map +1 -1
  45. package/lib/config-resolvers/session.js +2 -2
  46. package/lib/config-resolvers/session.js.map +1 -1
  47. package/lib/config-resolvers/shared.js +9 -0
  48. package/lib/config-resolvers/shared.js.map +1 -1
  49. package/lib/config-resolvers/sources.js +2 -0
  50. package/lib/config-resolvers/sources.js.map +1 -1
  51. package/lib/config.js +11 -2
  52. package/lib/config.js.map +1 -1
  53. package/lib/index.js +76 -6
  54. package/lib/index.js.map +1 -1
  55. package/lib/provenance/host-store.js +25 -9
  56. package/lib/provenance/host-store.js.map +1 -1
  57. package/lib/provenance/reported.js +37 -12
  58. package/lib/provenance/reported.js.map +1 -1
  59. package/lib/questions.js +185 -0
  60. package/lib/questions.js.map +1 -0
  61. package/lib/secure-session.js +69 -17
  62. package/lib/secure-session.js.map +1 -1
  63. package/lib/session-ownership.js +55 -0
  64. package/lib/session-ownership.js.map +1 -0
  65. package/lib/typert.host.js +357 -17
  66. package/lib/typert.remote-client.d.ts +11 -1
  67. package/lib/typert.remote-client.js +287 -14
  68. package/lib/types/accounts/credentials.d.ts +6 -0
  69. package/lib/types/accounts/store.d.ts +8 -0
  70. package/lib/types/approvals.d.ts +65 -0
  71. package/lib/types/client/QaSessionController.d.ts +38 -1
  72. package/lib/types/client/QaSurface.d.ts +8 -1
  73. package/lib/types/client/approvals.d.ts +39 -0
  74. package/lib/types/client/components/QaApproval.d.ts +13 -0
  75. package/lib/types/client/components/QaQuestions.d.ts +13 -0
  76. package/lib/types/client/project-session-state.d.ts +8 -1
  77. package/lib/types/client/questions.d.ts +45 -0
  78. package/lib/types/client/types.d.ts +48 -1
  79. package/lib/types/config-resolvers/shared.d.ts +7 -0
  80. package/lib/types/index.d.ts +29 -3
  81. package/lib/types/provenance/reported.d.ts +9 -1
  82. package/lib/types/questions.d.ts +83 -0
  83. package/lib/types/secure-session.d.ts +21 -2
  84. package/lib/types/session-ownership.d.ts +30 -0
  85. package/lib/types/types.d.ts +80 -4
  86. package/lib/types/user-workspace.d.ts +5 -1
  87. package/lib/user-workspace.js +21 -6
  88. package/lib/user-workspace.js.map +1 -1
  89. package/package.json +3 -3
@@ -103,6 +103,24 @@ const _yadsh_dsh_qa_surface_qaSurface_accountsWhoami_result$schema = z.union([z.
103
103
  }).readonly(),
104
104
  }).readonly(),
105
105
  })])
106
+ const _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_0$schema = z.string()
107
+ const _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_1$schema = z.string()
108
+ const _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_2$schema = z.string()
109
+ const _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_3$schema = z.union([z.literal("allowed-once"), z.literal("rejected")])
110
+ const _yadsh_dsh_qa_surface_qaSurface_answerApproval_result$schema = z.boolean()
111
+ const _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_0$schema = z.string()
112
+ const _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_1$schema = z.string()
113
+ const _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_2$schema = z.string()
114
+ const _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_3$schema = z.array(z.object({
115
+ 'id': z.string().readonly(),
116
+ 'selected': z.array(z.string()).readonly(),
117
+ 'custom': z.string().readonly().optional(),
118
+ }))
119
+ const _yadsh_dsh_qa_surface_qaSurface_answerQuestion_result$schema = z.boolean()
120
+ const _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_parameter_0$schema = z.string()
121
+ const _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_parameter_1$schema = z.string()
122
+ const _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_parameter_2$schema = z.string()
123
+ const _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_result$schema = z.boolean()
106
124
  const _yadsh_dsh_qa_surface_qaSurface_createSession_parameter_0$schema = z.string()
107
125
  const _yadsh_dsh_qa_surface_qaSurface_createSession_result$schema = z.string()
108
126
  const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
@@ -144,8 +162,8 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
144
162
  'suggestedQuestions': z.array(z.string()).readonly(),
145
163
  'thinkingPhrases': z.array(z.string()).readonly(),
146
164
  'interaction': z.object({
147
- 'approvals': z.literal("blocked").readonly(),
148
- 'questions': z.literal("unsupported").readonly(),
165
+ 'approvals': z.union([z.literal("blocked"), z.literal("interactive")]).readonly(),
166
+ 'questions': z.union([z.literal("interactive"), z.literal("unsupported")]).readonly(),
149
167
  }).readonly(),
150
168
  'lockdown': z.object({
151
169
  'enabled': z.boolean().readonly(),
@@ -166,6 +184,7 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
166
184
  'mode': z.literal("allow-list").readonly(),
167
185
  'allow': z.array(z.string()).readonly(),
168
186
  }).readonly(),
187
+ 'sharedReadOnlyRoots': z.array(z.string()).readonly(),
169
188
  }).readonly(),
170
189
  'embedding': z.object({
171
190
  'frameAncestors': z.union([z.literal(null), z.string()]).readonly(),
@@ -225,6 +244,7 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
225
244
  'inheritSources': z.boolean().readonly(),
226
245
  'enableReportToolFallback': z.boolean().readonly(),
227
246
  'markIncompleteOpaqueRuns': z.boolean().readonly(),
247
+ 'validateReportedSources': z.boolean().readonly(),
228
248
  }).readonly(),
229
249
  'legacy': z.object({
230
250
  'parseAssistantSourcesBlock': z.boolean().readonly(),
@@ -238,6 +258,34 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
238
258
  'extensions': z.array(z.string()).readonly(),
239
259
  }).readonly(),
240
260
  })
261
+ const _yadsh_dsh_qa_surface_qaSurface_pendingApprovals_parameter_0$schema = z.string()
262
+ const _yadsh_dsh_qa_surface_qaSurface_pendingApprovals_parameter_1$schema = z.string()
263
+ const _yadsh_dsh_qa_surface_qaSurface_pendingApprovals_result$schema = z.array(z.object({
264
+ 'id': z.string().readonly(),
265
+ 'sessionId': z.string().readonly(),
266
+ 'toolName': z.string().readonly(),
267
+ 'reason': z.union([z.literal(null), z.string()]).readonly(),
268
+ 'createdAt': z.number().readonly(),
269
+ 'delegated': z.boolean().readonly(),
270
+ }))
271
+ const _yadsh_dsh_qa_surface_qaSurface_pendingQuestions_parameter_0$schema = z.string()
272
+ const _yadsh_dsh_qa_surface_qaSurface_pendingQuestions_parameter_1$schema = z.string()
273
+ const _yadsh_dsh_qa_surface_qaSurface_pendingQuestions_result$schema = z.array(z.object({
274
+ 'id': z.string().readonly(),
275
+ 'sessionId': z.string().readonly(),
276
+ 'questions': z.array(z.object({
277
+ 'id': z.string().readonly(),
278
+ 'question': z.string().readonly(),
279
+ 'header': z.union([z.literal(null), z.string()]).readonly(),
280
+ 'detail': z.union([z.literal(null), z.string()]).readonly(),
281
+ 'options': z.array(z.object({
282
+ 'label': z.string().readonly(),
283
+ 'description': z.union([z.literal(null), z.string()]).readonly(),
284
+ })).readonly(),
285
+ 'multiSelect': z.boolean().readonly(),
286
+ })).readonly(),
287
+ 'createdAt': z.number().readonly(),
288
+ }))
241
289
  const _yadsh_dsh_qa_surface_qaSurface_readSourceFile_parameter_0$schema = z.string()
242
290
  const _yadsh_dsh_qa_surface_qaSurface_readSourceFile_parameter_1$schema = z.string()
243
291
  const _yadsh_dsh_qa_surface_qaSurface_readSourceFile_parameter_2$schema = z.string()
@@ -373,7 +421,7 @@ export const TYPERT_REMOTE = {
373
421
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaClaimResult',
374
422
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsClaimSessions_result$schema,
375
423
  },
376
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":230,"column":3},
424
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":268,"column":3},
377
425
  },
378
426
  {
379
427
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsListOwnership',
@@ -398,7 +446,7 @@ export const TYPERT_REMOTE = {
398
446
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/accountsListOwnership:result',
399
447
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsListOwnership_result$schema,
400
448
  },
401
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":249,"column":3},
449
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":287,"column":3},
402
450
  },
403
451
  {
404
452
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsLogin',
@@ -433,7 +481,7 @@ export const TYPERT_REMOTE = {
433
481
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountSession',
434
482
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsLogin_result$schema,
435
483
  },
436
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":218,"column":3},
484
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":256,"column":3},
437
485
  },
438
486
  {
439
487
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsOwnedSessions',
@@ -458,7 +506,7 @@ export const TYPERT_REMOTE = {
458
506
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/accountsOwnedSessions:result',
459
507
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsOwnedSessions_result$schema,
460
508
  },
461
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":239,"column":3},
509
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":277,"column":3},
462
510
  },
463
511
  {
464
512
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsRegister',
@@ -493,7 +541,7 @@ export const TYPERT_REMOTE = {
493
541
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountSession',
494
542
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsRegister_result$schema,
495
543
  },
496
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":213,"column":3},
544
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":251,"column":3},
497
545
  },
498
546
  {
499
547
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsUpdateProfile',
@@ -528,7 +576,7 @@ export const TYPERT_REMOTE = {
528
576
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountUserPublic',
529
577
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_result$schema,
530
578
  },
531
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":262,"column":3},
579
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":300,"column":3},
532
580
  },
533
581
  {
534
582
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsWhoami',
@@ -553,7 +601,162 @@ export const TYPERT_REMOTE = {
553
601
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaWhoamiResult',
554
602
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsWhoami_result$schema,
555
603
  },
556
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":224,"column":3},
604
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":262,"column":3},
605
+ },
606
+ {
607
+ id: '@yadsh/dsh-qa-surface#qaSurface/answerApproval',
608
+ service: 'qaSurface',
609
+ namespace: 'qaSurface',
610
+ method: 'answerApproval',
611
+ invocation: { kind: 'direct' },
612
+ parameters: [
613
+ {
614
+ name: 'token',
615
+ wire: 'token',
616
+ source: 'json',
617
+ codec: {
618
+ mode: 'strict',
619
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerApproval:token',
620
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_0$schema,
621
+ },
622
+ },
623
+ {
624
+ name: 'sessionId',
625
+ wire: 'sessionId',
626
+ source: 'json',
627
+ codec: {
628
+ mode: 'strict',
629
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerApproval:sessionId',
630
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_1$schema,
631
+ },
632
+ },
633
+ {
634
+ name: 'requestId',
635
+ wire: 'requestId',
636
+ source: 'json',
637
+ codec: {
638
+ mode: 'strict',
639
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerApproval:requestId',
640
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_2$schema,
641
+ },
642
+ },
643
+ {
644
+ name: 'decision',
645
+ wire: 'decision',
646
+ source: 'json',
647
+ codec: {
648
+ mode: 'strict',
649
+ typeSymbol: '@yadsh/dsh-qa-surface/types#QaApprovalDecision',
650
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerApproval_parameter_3$schema,
651
+ },
652
+ },
653
+ ],
654
+ result: {
655
+ mode: 'strict',
656
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerApproval:result',
657
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerApproval_result$schema,
658
+ },
659
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":455,"column":9},
660
+ },
661
+ {
662
+ id: '@yadsh/dsh-qa-surface#qaSurface/answerQuestion',
663
+ service: 'qaSurface',
664
+ namespace: 'qaSurface',
665
+ method: 'answerQuestion',
666
+ invocation: { kind: 'direct' },
667
+ parameters: [
668
+ {
669
+ name: 'token',
670
+ wire: 'token',
671
+ source: 'json',
672
+ codec: {
673
+ mode: 'strict',
674
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerQuestion:token',
675
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_0$schema,
676
+ },
677
+ },
678
+ {
679
+ name: 'sessionId',
680
+ wire: 'sessionId',
681
+ source: 'json',
682
+ codec: {
683
+ mode: 'strict',
684
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerQuestion:sessionId',
685
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_1$schema,
686
+ },
687
+ },
688
+ {
689
+ name: 'requestId',
690
+ wire: 'requestId',
691
+ source: 'json',
692
+ codec: {
693
+ mode: 'strict',
694
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerQuestion:requestId',
695
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_2$schema,
696
+ },
697
+ },
698
+ {
699
+ name: 'answers',
700
+ wire: 'answers',
701
+ source: 'json',
702
+ codec: {
703
+ mode: 'strict',
704
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerQuestion:answers',
705
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerQuestion_parameter_3$schema,
706
+ },
707
+ },
708
+ ],
709
+ result: {
710
+ mode: 'strict',
711
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/answerQuestion:result',
712
+ schema: _yadsh_dsh_qa_surface_qaSurface_answerQuestion_result$schema,
713
+ },
714
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":484,"column":9},
715
+ },
716
+ {
717
+ id: '@yadsh/dsh-qa-surface#qaSurface/cancelQuestion',
718
+ service: 'qaSurface',
719
+ namespace: 'qaSurface',
720
+ method: 'cancelQuestion',
721
+ invocation: { kind: 'direct' },
722
+ parameters: [
723
+ {
724
+ name: 'token',
725
+ wire: 'token',
726
+ source: 'json',
727
+ codec: {
728
+ mode: 'strict',
729
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/cancelQuestion:token',
730
+ schema: _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_parameter_0$schema,
731
+ },
732
+ },
733
+ {
734
+ name: 'sessionId',
735
+ wire: 'sessionId',
736
+ source: 'json',
737
+ codec: {
738
+ mode: 'strict',
739
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/cancelQuestion:sessionId',
740
+ schema: _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_parameter_1$schema,
741
+ },
742
+ },
743
+ {
744
+ name: 'requestId',
745
+ wire: 'requestId',
746
+ source: 'json',
747
+ codec: {
748
+ mode: 'strict',
749
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/cancelQuestion:requestId',
750
+ schema: _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_parameter_2$schema,
751
+ },
752
+ },
753
+ ],
754
+ result: {
755
+ mode: 'strict',
756
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/cancelQuestion:result',
757
+ schema: _yadsh_dsh_qa_surface_qaSurface_cancelQuestion_result$schema,
758
+ },
759
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":496,"column":9},
557
760
  },
558
761
  {
559
762
  id: '@yadsh/dsh-qa-surface#qaSurface/createSession',
@@ -578,7 +781,7 @@ export const TYPERT_REMOTE = {
578
781
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/createSession:result',
579
782
  schema: _yadsh_dsh_qa_surface_qaSurface_createSession_result$schema,
580
783
  },
581
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":287,"column":9},
784
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":325,"column":9},
582
785
  },
583
786
  {
584
787
  id: '@yadsh/dsh-qa-surface#qaSurface/describe',
@@ -593,7 +796,77 @@ export const TYPERT_REMOTE = {
593
796
  typeSymbol: '@yadsh/dsh-qa-surface/types#ResolvedQaSurfaceConfig',
594
797
  schema: _yadsh_dsh_qa_surface_qaSurface_describe_result$schema,
595
798
  },
596
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":277,"column":3},
799
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":315,"column":3},
800
+ },
801
+ {
802
+ id: '@yadsh/dsh-qa-surface#qaSurface/pendingApprovals',
803
+ service: 'qaSurface',
804
+ namespace: 'qaSurface',
805
+ method: 'pendingApprovals',
806
+ invocation: { kind: 'direct' },
807
+ parameters: [
808
+ {
809
+ name: 'token',
810
+ wire: 'token',
811
+ source: 'json',
812
+ codec: {
813
+ mode: 'strict',
814
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/pendingApprovals:token',
815
+ schema: _yadsh_dsh_qa_surface_qaSurface_pendingApprovals_parameter_0$schema,
816
+ },
817
+ },
818
+ {
819
+ name: 'sessionId',
820
+ wire: 'sessionId',
821
+ source: 'json',
822
+ codec: {
823
+ mode: 'strict',
824
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/pendingApprovals:sessionId',
825
+ schema: _yadsh_dsh_qa_surface_qaSurface_pendingApprovals_parameter_1$schema,
826
+ },
827
+ },
828
+ ],
829
+ result: {
830
+ mode: 'strict',
831
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/pendingApprovals:result',
832
+ schema: _yadsh_dsh_qa_surface_qaSurface_pendingApprovals_result$schema,
833
+ },
834
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":441,"column":9},
835
+ },
836
+ {
837
+ id: '@yadsh/dsh-qa-surface#qaSurface/pendingQuestions',
838
+ service: 'qaSurface',
839
+ namespace: 'qaSurface',
840
+ method: 'pendingQuestions',
841
+ invocation: { kind: 'direct' },
842
+ parameters: [
843
+ {
844
+ name: 'token',
845
+ wire: 'token',
846
+ source: 'json',
847
+ codec: {
848
+ mode: 'strict',
849
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/pendingQuestions:token',
850
+ schema: _yadsh_dsh_qa_surface_qaSurface_pendingQuestions_parameter_0$schema,
851
+ },
852
+ },
853
+ {
854
+ name: 'sessionId',
855
+ wire: 'sessionId',
856
+ source: 'json',
857
+ codec: {
858
+ mode: 'strict',
859
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/pendingQuestions:sessionId',
860
+ schema: _yadsh_dsh_qa_surface_qaSurface_pendingQuestions_parameter_1$schema,
861
+ },
862
+ },
863
+ ],
864
+ result: {
865
+ mode: 'strict',
866
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/pendingQuestions:result',
867
+ schema: _yadsh_dsh_qa_surface_qaSurface_pendingQuestions_result$schema,
868
+ },
869
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":470,"column":9},
597
870
  },
598
871
  {
599
872
  id: '@yadsh/dsh-qa-surface#qaSurface/readSourceFile',
@@ -638,7 +911,7 @@ export const TYPERT_REMOTE = {
638
911
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaSourceFilePreview',
639
912
  schema: _yadsh_dsh_qa_surface_qaSurface_readSourceFile_result$schema,
640
913
  },
641
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":394,"column":9},
914
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":507,"column":9},
642
915
  },
643
916
  {
644
917
  id: '@yadsh/dsh-qa-surface#qaSurface/secureSession',
@@ -673,7 +946,7 @@ export const TYPERT_REMOTE = {
673
946
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaLockdownProof',
674
947
  schema: _yadsh_dsh_qa_surface_qaSurface_secureSession_result$schema,
675
948
  },
676
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":361,"column":3},
949
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":399,"column":9},
677
950
  },
678
951
  {
679
952
  id: '@yadsh/dsh-qa-surface#qaSurface/sources',
@@ -708,7 +981,7 @@ export const TYPERT_REMOTE = {
708
981
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/sources:result',
709
982
  schema: _yadsh_dsh_qa_surface_qaSurface_sources_result$schema,
710
983
  },
711
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":387,"column":3},
984
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":428,"column":9},
712
985
  },
713
986
  ],
714
987
  }
@@ -4,6 +4,12 @@ export interface ValidatedCredentials {
4
4
  /** Trimmed display name; empty means "derive one from the address". */
5
5
  readonly displayName: string;
6
6
  }
7
+ /**
8
+ * The length gate every path that sets a password goes through — registration,
9
+ * the operator's addUser, and a reset — so a password good enough to register is
10
+ * exactly the one an operator can put back.
11
+ */
12
+ export declare function validatePassword(password: string): void;
7
13
  /**
8
14
  * The email/password/display-name gate shared by self-registration and the
9
15
  * operator's addUser, so both paths reject unusable input with the same
@@ -99,6 +99,14 @@ export declare class QaAccounts {
99
99
  private editUser;
100
100
  /** Grant or revoke the admin role. */
101
101
  setUserRole(email: string, role: QaAccountRole): QaAccountUserPublic;
102
+ /**
103
+ * Replace an account's password, which is what a forgotten one needs. The
104
+ * token version bumps with it, so every token minted under the old password
105
+ * dies server-side: a reset is also the response to a leaked credential.
106
+ * Ownership, profile and the account id survive, so the user's chats are
107
+ * still theirs after signing in again.
108
+ */
109
+ setPassword(email: string, password: string): QaAccountUserPublic;
102
110
  /**
103
111
  * Disable an account: future logins are refused and every live token is
104
112
  * invalidated (the token version bumps). `enable` does not resurrect old
@@ -0,0 +1,65 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
2
+ import type { Context } from "@deepseek-ai/cordis";
3
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
4
+ import type { QaSessionOwnership } from "./session-ownership.js";
5
+ import type { QaApprovalDecision, QaPendingApproval } from "./types.js";
6
+ /**
7
+ * The slice of the `tools/pre-execute` execution record this gate reads. The
8
+ * listener is owned by the plugin context, so it is unfiltered: it also wraps
9
+ * the calls of a delegated child, whose scope chain never reaches the chat's
10
+ * own agent context.
11
+ */
12
+ export interface QaApprovalExecution {
13
+ readonly name: string;
14
+ readonly agent?: Agent;
15
+ readonly signal?: AbortSignal;
16
+ }
17
+ /**
18
+ * Interactive resolution of the tool policy `ask` decision.
19
+ *
20
+ * A composed gate — a content classifier, a hook rule — answers `ask` for a
21
+ * call it will not decide alone. On an attested QA agent that ask resolves
22
+ * against the deployment's pinned `approval=never` policy, so the model is told
23
+ * the user rejected a call the user never saw. This gate sits outside every
24
+ * other `tools/pre-execute` listener and hands the decision to the operator
25
+ * instead: the request is parked here, the QA view lists it over its own
26
+ * remote, and the answer becomes the decision the chain would have produced.
27
+ *
28
+ * `interaction.approvals: blocked` keeps the previous fail-closed behavior —
29
+ * the call is refused with the surface's own reason. Either way nothing is
30
+ * approved automatically, and the allow-list, the workspace fence and the
31
+ * read-only sandbox still run on the resolved call.
32
+ *
33
+ * Only sessions this deployment attested are touched. Any other session's ask
34
+ * is handed back to the chain untouched, so an operator instance that also
35
+ * serves ordinary chats keeps its own approval flow.
36
+ */
37
+ export declare class QaApprovalGate {
38
+ private readonly ctx;
39
+ private readonly interactive;
40
+ private readonly ownership;
41
+ private readonly logger;
42
+ private readonly pending;
43
+ private readonly disposers;
44
+ constructor(ctx: Context, interactive: () => boolean, ownership: QaSessionOwnership, logger: PluginLogger);
45
+ /** Wrap every tool call; other gates compose inside this listener. */
46
+ install(): void;
47
+ /** Approvals of one chat, oldest first: what the QA view lists. */
48
+ list(sessionId: string): readonly QaPendingApproval[];
49
+ /** Apply the operator's answer; an unknown or foreign id is refused. */
50
+ answer(sessionId: string, requestId: string, decision: QaApprovalDecision): boolean;
51
+ /** Detach the listener and fail every parked request. Wired as an effect. */
52
+ dispose(): void;
53
+ private handle;
54
+ /**
55
+ * The chat a call belongs to, when this deployment attested it. A child of an
56
+ * attested chat answers under the chat the operator is looking at.
57
+ */
58
+ private ownerOf;
59
+ /** Park one call until the operator answers, the turn is cancelled, or … */
60
+ private request;
61
+ private resolve;
62
+ /** Fail the requests one session's agent owns; a child never holds the chat. */
63
+ private settleOwner;
64
+ }
65
+ //# sourceMappingURL=approvals.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import type { ConnectionGenerationState } from "@deepseek-ai/dsh-client-connection/client";
2
2
  import type { QaAttachmentDraft, QaSessionState, ResolvedQaSurfaceConfig } from "../types.js";
3
- import type { QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaSourceApi, StorageLike } from "./types.js";
3
+ import type { QaApprovalApi, QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaQuestionApi, QaSourceApi, StorageLike } from "./types.js";
4
+ import type { QaApprovalDecision, QaQuestionAnswerItem } from "../types.js";
4
5
  export interface QaAccountsFacade {
5
6
  /** The account bearer token, or null while anonymous. */
6
7
  readonly token: () => string | null;
@@ -26,6 +27,17 @@ export interface QaSessionControllerOptions {
26
27
  readonly config: ResolvedQaSurfaceConfig;
27
28
  readonly secureSession: QaSecureSession;
28
29
  readonly sourceApi?: QaSourceApi;
30
+ /**
31
+ * The approval half of the Host namespace. Absent on a page built against a
32
+ * Host that does not answer approvals: the surface then never shows a
33
+ * request and keeps the composer as it is.
34
+ */
35
+ readonly approvalApi?: QaApprovalApi;
36
+ /**
37
+ * The question half of the Host namespace. Absent on a page whose Host build
38
+ * does not answer questions: the surface then only renders what it can.
39
+ */
40
+ readonly questionApi?: QaQuestionApi;
29
41
  readonly storage?: StorageLike;
30
42
  /**
31
43
  * Browser file-upload service, resolved lazily: the page may not serve the
@@ -87,6 +99,12 @@ export declare class QaSessionController {
87
99
  private chatsRevision;
88
100
  /** Host-side provenance of the bound chat, merged into the projection. */
89
101
  private readonly hostSources;
102
+ /** Host-side approvals of the bound chat waiting for the operator. */
103
+ private readonly hostApprovals;
104
+ /** Host-side question requests of the bound chat waiting for the operator. */
105
+ private readonly hostQuestions;
106
+ /** Set while a running turn is polled for parked requests. */
107
+ private pendingTimer;
90
108
  constructor(options: QaSessionControllerOptions);
91
109
  getSnapshot: () => QaSessionState;
92
110
  subscribe: (listener: () => void) => (() => void);
@@ -181,5 +199,24 @@ export declare class QaSessionController {
181
199
  */
182
200
  private attestPolicy;
183
201
  private emit;
202
+ /**
203
+ * Answer a request the Host parked for this chat. The Host re-checks the
204
+ * request against the chat, so an answer that lost its race is a no-op; the
205
+ * refresh that follows is what the surface renders.
206
+ */
207
+ answerApproval(requestId: string, decision: QaApprovalDecision): Promise<void>;
208
+ /** Send the operator's answers to one parked question request. */
209
+ answerQuestion(requestId: string, answers: readonly QaQuestionAnswerItem[]): Promise<void>;
210
+ /** Close a parked question request without answering it. */
211
+ cancelQuestion(requestId: string): Promise<void>;
212
+ /**
213
+ * Poll the Host for parked requests while a turn runs. A request only exists
214
+ * inside an open turn, and it is Host state: polling is how the page learns
215
+ * about it, and how it reappears after a reload. One timer serves both seams,
216
+ * and each is polled only where the deployment answers it.
217
+ */
218
+ private syncPendingPolling;
219
+ private stopPendingPolling;
220
+ private hostToken;
184
221
  }
185
222
  //# sourceMappingURL=QaSessionController.d.ts.map
@@ -3,7 +3,7 @@ import type { InjectFace, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots"
3
3
  import type { QaConfigController } from "./QaConfigController.js";
4
4
  import type { QaRouteController } from "./QaRouteController.js";
5
5
  import type { QaAccountsController } from "./QaAccountsController.js";
6
- import type { QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaSourceApi } from "./types.js";
6
+ import type { QaApprovalApi, QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaQuestionApi, QaSourceApi } from "./types.js";
7
7
  export interface QaSurfaceFace {
8
8
  readonly route: QaRouteController;
9
9
  readonly config: QaConfigController;
@@ -14,6 +14,13 @@ export interface QaSurfaceFace {
14
14
  readonly secureSession: QaSecureSession;
15
15
  readonly createSession: QaCreateSession;
16
16
  readonly sourceApi: QaSourceApi;
17
+ /**
18
+ * Approval half of the plugin's namespace. Absent on a page whose Host build
19
+ * does not answer it; the surface then only blocks sends it cannot attest.
20
+ */
21
+ readonly approvalApi?: QaApprovalApi;
22
+ /** Question half of the plugin's namespace, when the Host answers it. */
23
+ readonly questionApi?: QaQuestionApi;
17
24
  /**
18
25
  * Browser file-upload service, when the page serves the upload plugin.
19
26
  * Resolved per send so a page that loads it later still gets file support.
@@ -0,0 +1,39 @@
1
+ import type { QaApprovalDecision, QaPendingApproval } from "../types.js";
2
+ import type { QaApprovalApi } from "./types.js";
3
+ /**
4
+ * The operator's side of a parked tool call.
5
+ *
6
+ * A composed gate's `ask` is answered on the Host, so the waiting request is
7
+ * Host state: it survives a page reload, and the surface learns about it by
8
+ * asking rather than by receiving an event. The bridge holds the last list it
9
+ * saw, refreshes it while a turn runs, and forwards an answer.
10
+ */
11
+ export declare class QaHostApprovalBridge {
12
+ private readonly approvalApi;
13
+ private approvals;
14
+ private signature;
15
+ private refreshing;
16
+ private answering;
17
+ /** Bumped on reset so a stale in-flight response never lands. */
18
+ private generation;
19
+ constructor(approvalApi: QaApprovalApi | undefined);
20
+ /** Leave the chat: a chat switch drops the previous chat's requests. */
21
+ reset(): void;
22
+ /** The last list this bridge saw; empty when the deployment blocks them. */
23
+ list(): readonly QaPendingApproval[];
24
+ /** Whether this page can ask the Host about approvals at all. */
25
+ get available(): boolean;
26
+ /**
27
+ * Re-read the chat's pending requests; a changed list republishes through the
28
+ * callback. Overlapping calls coalesce, and a response that outlives its chat
29
+ * is dropped.
30
+ */
31
+ refresh(sessionId: string, token: string, onChanged: () => void): Promise<void>;
32
+ /**
33
+ * Answer one request and re-read the list. A refusal is not an error: the
34
+ * request was already settled (the turn was stopped, the call went away), so
35
+ * the refresh — not the answer — is what the surface shows.
36
+ */
37
+ answer(sessionId: string, token: string, requestId: string, decision: QaApprovalDecision): Promise<void>;
38
+ }
39
+ //# sourceMappingURL=approvals.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { QaApprovalDecision, QaPendingApproval } from "../../types.js";
2
+ export interface QaApprovalProps {
3
+ readonly approvals: readonly QaPendingApproval[];
4
+ readonly onAnswer: (requestId: string, decision: QaApprovalDecision) => Promise<void>;
5
+ }
6
+ /**
7
+ * The tool calls a composed gate parked for a person. One row per request, the
8
+ * gate's own reason on top, and the two answers stock DSH offers: refuse, or
9
+ * let this one call through. Nothing here decides on its own — an unanswered
10
+ * request simply keeps the turn waiting.
11
+ */
12
+ export declare const QaApproval: import("react").MemoExoticComponent<(props: QaApprovalProps) => import("react/jsx-runtime").JSX.Element | null>;
13
+ //# sourceMappingURL=QaApproval.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { QaPendingQuestion, QaQuestionAnswerItem } from "../../types.js";
2
+ export interface QaQuestionsProps {
3
+ readonly questions: readonly QaPendingQuestion[];
4
+ readonly onAnswer: (requestId: string, answers: readonly QaQuestionAnswerItem[]) => Promise<void>;
5
+ readonly onCancel: (requestId: string) => Promise<void>;
6
+ }
7
+ /**
8
+ * The questions a running turn waits on. Answers are the operator's own: the
9
+ * form refuses to submit a question left blank, and a question explicitly
10
+ * skipped is reported as skipped rather than answered by guesswork.
11
+ */
12
+ export declare const QaQuestions: import("react").MemoExoticComponent<(props: QaQuestionsProps) => import("react/jsx-runtime").JSX.Element | null>;
13
+ //# sourceMappingURL=QaQuestions.d.ts.map