@yadsh/dsh-qa-surface 0.16.0 → 0.18.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 (325) hide show
  1. package/README.md +34 -5
  2. package/compatibility.json +1 -1
  3. package/lib/account-remotes.js +13 -0
  4. package/lib/account-remotes.js.map +1 -1
  5. package/lib/accounts/database.js +120 -4
  6. package/lib/accounts/database.js.map +1 -1
  7. package/lib/accounts/file.js.map +1 -1
  8. package/lib/accounts/store.js +131 -5
  9. package/lib/accounts/store.js.map +1 -1
  10. package/lib/accounts/token.js +8 -2
  11. package/lib/accounts/token.js.map +1 -1
  12. package/lib/admin/metrics.js +15 -2
  13. package/lib/admin/metrics.js.map +1 -1
  14. package/lib/admin/read-budget.js +28 -0
  15. package/lib/admin/read-budget.js.map +1 -0
  16. package/lib/admin/service.js +135 -40
  17. package/lib/admin/service.js.map +1 -1
  18. package/lib/admin/session-log.js +63 -4
  19. package/lib/admin/session-log.js.map +1 -1
  20. package/lib/chat-sharing/native-fence.js +31 -2
  21. package/lib/chat-sharing/native-fence.js.map +1 -1
  22. package/lib/chat-sharing/store.js +9 -3
  23. package/lib/chat-sharing/store.js.map +1 -1
  24. package/lib/chat-sharing/transport.js +74 -13
  25. package/lib/chat-sharing/transport.js.map +1 -1
  26. package/lib/chat-sharing/uploads.js +79 -6
  27. package/lib/chat-sharing/uploads.js.map +1 -1
  28. package/lib/cli.js +13 -0
  29. package/lib/cli.js.map +1 -1
  30. package/lib/client/QaAccountsController.js +79 -0
  31. package/lib/client/QaAccountsController.js.map +1 -1
  32. package/lib/client/QaRouteController.js +3 -1
  33. package/lib/client/QaRouteController.js.map +1 -1
  34. package/lib/client/QaSessionController.js +102 -29
  35. package/lib/client/QaSessionController.js.map +1 -1
  36. package/lib/client/QaSurface.js +89 -19
  37. package/lib/client/QaSurface.js.map +1 -1
  38. package/lib/client/QaTranscriptAdapter.js +15 -2
  39. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  40. package/lib/client/account-sessions.js +74 -8
  41. package/lib/client/account-sessions.js.map +1 -1
  42. package/lib/client/admin/CapabilityPicker.js +50 -0
  43. package/lib/client/admin/CapabilityPicker.js.map +1 -0
  44. package/lib/client/admin/CoverageNotice.js +9 -0
  45. package/lib/client/admin/CoverageNotice.js.map +1 -0
  46. package/lib/client/admin/QaAdmin.js +3 -150
  47. package/lib/client/admin/QaAdmin.js.map +1 -1
  48. package/lib/client/admin/RoleEditor.js +46 -0
  49. package/lib/client/admin/RoleEditor.js.map +1 -0
  50. package/lib/client/admin/capability-selection.js +63 -0
  51. package/lib/client/admin/capability-selection.js.map +1 -0
  52. package/lib/client/admin/pages/Conversations.js +35 -17
  53. package/lib/client/admin/pages/Conversations.js.map +1 -1
  54. package/lib/client/admin/pages/Overview.js +3 -2
  55. package/lib/client/admin/pages/Overview.js.map +1 -1
  56. package/lib/client/admin/pages/Quality.js +77 -20
  57. package/lib/client/admin/pages/Quality.js.map +1 -1
  58. package/lib/client/admin/pages/SkillFiles.js +14 -3
  59. package/lib/client/admin/pages/SkillFiles.js.map +1 -1
  60. package/lib/client/admin/shared.js +68 -3
  61. package/lib/client/admin/shared.js.map +1 -1
  62. package/lib/client/answer-review.js +89 -0
  63. package/lib/client/answer-review.js.map +1 -0
  64. package/lib/client/chat-artifacts.js +1 -0
  65. package/lib/client/chat-artifacts.js.map +1 -1
  66. package/lib/client/components/QaAnswerReviewStatus.js +45 -0
  67. package/lib/client/components/QaAnswerReviewStatus.js.map +1 -0
  68. package/lib/client/components/QaAuthGate.js +31 -28
  69. package/lib/client/components/QaAuthGate.js.map +1 -1
  70. package/lib/client/components/QaChangelog.js +79 -0
  71. package/lib/client/components/QaChangelog.js.map +1 -1
  72. package/lib/client/components/QaChatActions.js +52 -0
  73. package/lib/client/components/QaChatActions.js.map +1 -0
  74. package/lib/client/components/QaChatSharing.js +22 -19
  75. package/lib/client/components/QaChatSharing.js.map +1 -1
  76. package/lib/client/components/QaComposer.js +27 -4
  77. package/lib/client/components/QaComposer.js.map +1 -1
  78. package/lib/client/components/QaFormItem.js +63 -0
  79. package/lib/client/components/QaFormItem.js.map +1 -0
  80. package/lib/client/components/QaInputForm.js +281 -0
  81. package/lib/client/components/QaInputForm.js.map +1 -0
  82. package/lib/client/components/QaMarkdownPreview.js +86 -0
  83. package/lib/client/components/QaMarkdownPreview.js.map +1 -0
  84. package/lib/client/components/QaMessage.js +8 -2
  85. package/lib/client/components/QaMessage.js.map +1 -1
  86. package/lib/client/components/QaModal.js +34 -4
  87. package/lib/client/components/QaModal.js.map +1 -1
  88. package/lib/client/components/QaRightRail.js +6 -4
  89. package/lib/client/components/QaRightRail.js.map +1 -1
  90. package/lib/client/components/QaRightRailResize.js +129 -0
  91. package/lib/client/components/QaRightRailResize.js.map +1 -0
  92. package/lib/client/components/QaSidebar.js +10 -1
  93. package/lib/client/components/QaSidebar.js.map +1 -1
  94. package/lib/client/components/QaSourceFilters.js +22 -0
  95. package/lib/client/components/QaSourceFilters.js.map +1 -0
  96. package/lib/client/components/QaSourcesPanel.js +57 -13
  97. package/lib/client/components/QaSourcesPanel.js.map +1 -1
  98. package/lib/client/components/QaSpreadsheetPreview.js +56 -0
  99. package/lib/client/components/QaSpreadsheetPreview.js.map +1 -0
  100. package/lib/client/components/QaWelcomeNotice.js +2 -2
  101. package/lib/client/components/QaWelcomeNotice.js.map +1 -1
  102. package/lib/client/components/QaWorkspaceBrowser.js +22 -9
  103. package/lib/client/components/QaWorkspaceBrowser.js.map +1 -1
  104. package/lib/client/components/QaZoomImage.js +56 -0
  105. package/lib/client/components/QaZoomImage.js.map +1 -0
  106. package/lib/client/components/source-refs.js +18 -4
  107. package/lib/client/components/source-refs.js.map +1 -1
  108. package/lib/client/forms-styles.js +14 -0
  109. package/lib/client/forms-styles.js.map +1 -0
  110. package/lib/client/forms.js +40 -0
  111. package/lib/client/forms.js.map +1 -0
  112. package/lib/client/index.js +31 -3
  113. package/lib/client/index.js.map +1 -1
  114. package/lib/client/markdown/SourceImage.js +52 -0
  115. package/lib/client/markdown/SourceImage.js.map +1 -0
  116. package/lib/client/markdown/blocks.js +150 -115
  117. package/lib/client/markdown/blocks.js.map +1 -1
  118. package/lib/client/markdown/render.js +23 -5
  119. package/lib/client/markdown/render.js.map +1 -1
  120. package/lib/client/markdown/source-chip.js +2 -1
  121. package/lib/client/markdown/source-chip.js.map +1 -1
  122. package/lib/client/oidc-browser.js +39 -0
  123. package/lib/client/oidc-browser.js.map +1 -0
  124. package/lib/client/panels/PanelHost.js +23 -1
  125. package/lib/client/panels/PanelHost.js.map +1 -1
  126. package/lib/client/settings/sections/interface.js +2 -1
  127. package/lib/client/settings/sections/interface.js.map +1 -1
  128. package/lib/client/settings/sections/sources.js +1 -1
  129. package/lib/client/settings/sections/sources.js.map +1 -1
  130. package/lib/client/settings/sections/status.js +3 -1
  131. package/lib/client/settings/sections/status.js.map +1 -1
  132. package/lib/client/settings/styles.js +18 -28
  133. package/lib/client/settings/styles.js.map +1 -1
  134. package/lib/client/source-filters-styles.js +11 -0
  135. package/lib/client/source-filters-styles.js.map +1 -0
  136. package/lib/client/styles.js +56 -5
  137. package/lib/client/styles.js.map +1 -1
  138. package/lib/client/types.js.map +1 -1
  139. package/lib/client/use-right-rail.js +1 -1
  140. package/lib/client/use-right-rail.js.map +1 -1
  141. package/lib/client/user-settings/IntegrationTokensPage.js +30 -6
  142. package/lib/client/user-settings/IntegrationTokensPage.js.map +1 -1
  143. package/lib/client.js +540 -71128
  144. package/lib/client.js.map +1 -1
  145. package/lib/config-resolvers/accounts.js +5 -4
  146. package/lib/config-resolvers/accounts.js.map +1 -1
  147. package/lib/config-resolvers/defaults.js +20 -3
  148. package/lib/config-resolvers/defaults.js.map +1 -1
  149. package/lib/config-resolvers/oidc.js +53 -0
  150. package/lib/config-resolvers/oidc.js.map +1 -0
  151. package/lib/config-resolvers/sources.js +2 -0
  152. package/lib/config-resolvers/sources.js.map +1 -1
  153. package/lib/config.js +74 -0
  154. package/lib/config.js.map +1 -1
  155. package/lib/forms/attachments.js +214 -0
  156. package/lib/forms/attachments.js.map +1 -0
  157. package/lib/forms/errors.js +37 -0
  158. package/lib/forms/errors.js.map +1 -0
  159. package/lib/forms/fingerprint.js +21 -0
  160. package/lib/forms/fingerprint.js.map +1 -0
  161. package/lib/forms/gate.js +125 -0
  162. package/lib/forms/gate.js.map +1 -0
  163. package/lib/forms/schema.js +182 -0
  164. package/lib/forms/schema.js.map +1 -0
  165. package/lib/forms/service.js +220 -0
  166. package/lib/forms/service.js.map +1 -0
  167. package/lib/forms/store.js +194 -0
  168. package/lib/forms/store.js.map +1 -0
  169. package/lib/forms/types.js +2 -0
  170. package/lib/forms/types.js.map +1 -0
  171. package/lib/forms/validation.js +113 -0
  172. package/lib/forms/validation.js.map +1 -0
  173. package/lib/index.js +276 -5
  174. package/lib/index.js.map +1 -1
  175. package/lib/integration/host-runner.js +1 -0
  176. package/lib/integration/host-runner.js.map +1 -1
  177. package/lib/integration/question-policy.js +126 -0
  178. package/lib/integration/question-policy.js.map +1 -0
  179. package/lib/integration/service.js +2 -0
  180. package/lib/integration/service.js.map +1 -1
  181. package/lib/llm-identity.js +27 -0
  182. package/lib/llm-identity.js.map +1 -0
  183. package/lib/markdown-frontmatter.js +47 -0
  184. package/lib/markdown-frontmatter.js.map +1 -0
  185. package/lib/markdown-images.js +33 -0
  186. package/lib/markdown-images.js.map +1 -0
  187. package/lib/oidc/http.js +30 -0
  188. package/lib/oidc/http.js.map +1 -0
  189. package/lib/oidc/service.js +250 -0
  190. package/lib/oidc/service.js.map +1 -0
  191. package/lib/prompt-notes.js +1 -1
  192. package/lib/prompt-notes.js.map +1 -1
  193. package/lib/provenance/collector.js +2 -0
  194. package/lib/provenance/collector.js.map +1 -1
  195. package/lib/provenance/connectors.js +25 -19
  196. package/lib/provenance/connectors.js.map +1 -1
  197. package/lib/provenance/dedupe.js +17 -0
  198. package/lib/provenance/dedupe.js.map +1 -1
  199. package/lib/provenance/document-preview.js +12 -2
  200. package/lib/provenance/document-preview.js.map +1 -1
  201. package/lib/provenance/extractors.js +23 -5
  202. package/lib/provenance/extractors.js.map +1 -1
  203. package/lib/provenance/file-preview.js +9 -2
  204. package/lib/provenance/file-preview.js.map +1 -1
  205. package/lib/provenance/integration-extractor.js +5 -6
  206. package/lib/provenance/integration-extractor.js.map +1 -1
  207. package/lib/provenance/snapshot-store.js +2 -0
  208. package/lib/provenance/snapshot-store.js.map +1 -1
  209. package/lib/provenance/source-content.js +103 -0
  210. package/lib/provenance/source-content.js.map +1 -0
  211. package/lib/provenance/source-image.js +57 -0
  212. package/lib/provenance/source-image.js.map +1 -0
  213. package/lib/provenance/spreadsheet-preview.js +52 -0
  214. package/lib/provenance/spreadsheet-preview.js.map +1 -0
  215. package/lib/qa-tools/activation-manager.js +24 -2
  216. package/lib/qa-tools/activation-manager.js.map +1 -1
  217. package/lib/qa-tools/catalog.js +11 -1
  218. package/lib/qa-tools/catalog.js.map +1 -1
  219. package/lib/qa-tools/index.js +27 -0
  220. package/lib/qa-tools/index.js.map +1 -1
  221. package/lib/qa-tools/request-user-form.js +121 -0
  222. package/lib/qa-tools/request-user-form.js.map +1 -0
  223. package/lib/questions.js +6 -1
  224. package/lib/questions.js.map +1 -1
  225. package/lib/resolve-config.js +2 -0
  226. package/lib/resolve-config.js.map +1 -1
  227. package/lib/secure-session.js +14 -8
  228. package/lib/secure-session.js.map +1 -1
  229. package/lib/shared/documents.js +12 -0
  230. package/lib/shared/documents.js.map +1 -1
  231. package/lib/typert.host.js +5136 -1341
  232. package/lib/typert.remote-client.d.ts +141 -7
  233. package/lib/typert.remote-client.js +5896 -2255
  234. package/lib/types/account-remotes.d.ts +3 -0
  235. package/lib/types/accounts/database.d.ts +13 -0
  236. package/lib/types/accounts/file.d.ts +2 -0
  237. package/lib/types/accounts/store.d.ts +23 -1
  238. package/lib/types/accounts/token.d.ts +3 -1
  239. package/lib/types/admin/metrics.d.ts +5 -1
  240. package/lib/types/admin/read-budget.d.ts +8 -0
  241. package/lib/types/admin/service.d.ts +17 -0
  242. package/lib/types/admin/session-log.d.ts +30 -1
  243. package/lib/types/answer-review.js +2 -0
  244. package/lib/types/answer-review.js.map +1 -0
  245. package/lib/types/chat-sharing/store.d.ts +1 -0
  246. package/lib/types/chat-sharing/transport.d.ts +1 -0
  247. package/lib/types/chat-sharing/uploads.d.ts +2 -1
  248. package/lib/types/client/QaAccountsController.d.ts +5 -0
  249. package/lib/types/client/QaRouteController.d.ts +1 -0
  250. package/lib/types/client/QaSessionController.d.ts +12 -3
  251. package/lib/types/client/QaSurface.d.ts +2 -0
  252. package/lib/types/client/admin/CapabilityPicker.d.ts +14 -0
  253. package/lib/types/client/admin/CoverageNotice.d.ts +6 -0
  254. package/lib/types/client/admin/RoleEditor.d.ts +15 -0
  255. package/lib/types/client/admin/capability-selection.d.ts +27 -0
  256. package/lib/types/client/admin/shared.d.ts +39 -1
  257. package/lib/types/client/answer-review.d.ts +16 -0
  258. package/lib/types/client/components/QaAnswerReviewStatus.d.ts +8 -0
  259. package/lib/types/client/components/QaAuthGate.d.ts +2 -0
  260. package/lib/types/client/components/QaChatActions.d.ts +7 -0
  261. package/lib/types/client/components/QaChatSharing.d.ts +4 -2
  262. package/lib/types/client/components/QaFormItem.d.ts +20 -0
  263. package/lib/types/client/components/QaInputForm.d.ts +18 -0
  264. package/lib/types/client/components/QaMarkdownPreview.d.ts +13 -0
  265. package/lib/types/client/components/QaModal.d.ts +9 -0
  266. package/lib/types/client/components/QaRightRail.d.ts +3 -2
  267. package/lib/types/client/components/QaRightRailResize.d.ts +9 -0
  268. package/lib/types/client/components/QaSidebar.d.ts +2 -0
  269. package/lib/types/client/components/QaSourceFilters.d.ts +12 -0
  270. package/lib/types/client/components/QaSpreadsheetPreview.d.ts +8 -0
  271. package/lib/types/client/components/QaWelcomeNotice.d.ts +1 -1
  272. package/lib/types/client/components/QaZoomImage.d.ts +38 -0
  273. package/lib/types/client/forms-styles.d.ts +2 -0
  274. package/lib/types/client/forms.d.ts +23 -0
  275. package/lib/types/client/markdown/SourceImage.d.ts +7 -0
  276. package/lib/types/client/markdown/blocks.d.ts +8 -1
  277. package/lib/types/client/markdown/render.d.ts +5 -1
  278. package/lib/types/client/markdown/source-chip.d.ts +1 -0
  279. package/lib/types/client/oidc-browser.d.ts +12 -0
  280. package/lib/types/client/settings/styles.d.ts +2 -5
  281. package/lib/types/client/source-filters-styles.d.ts +2 -0
  282. package/lib/types/client/types.d.ts +18 -6
  283. package/lib/types/config-resolvers/oidc.d.ts +3 -0
  284. package/lib/types/forms/attachments.d.ts +48 -0
  285. package/lib/types/forms/errors.d.ts +11 -0
  286. package/lib/types/forms/fingerprint.d.ts +9 -0
  287. package/lib/types/forms/gate.d.ts +33 -0
  288. package/lib/types/forms/schema.d.ts +72 -0
  289. package/lib/types/forms/service.d.ts +15 -0
  290. package/lib/types/forms/store.d.ts +25 -0
  291. package/lib/types/forms/types.d.ts +215 -0
  292. package/lib/types/forms/validation.d.ts +20 -0
  293. package/lib/types/index.d.ts +36 -3
  294. package/lib/types/integration/contract.d.ts +1 -0
  295. package/lib/types/integration/question-policy.d.ts +20 -0
  296. package/lib/types/integration/service.d.ts +1 -0
  297. package/lib/types/llm-identity.d.ts +20 -0
  298. package/lib/types/markdown-frontmatter.d.ts +10 -0
  299. package/lib/types/markdown-images.d.ts +3 -0
  300. package/lib/types/oidc/http.d.ts +5 -0
  301. package/lib/types/oidc/service.d.ts +30 -0
  302. package/lib/types/oidc.js +2 -0
  303. package/lib/types/oidc.js.map +1 -0
  304. package/lib/types/prompt-notes.d.ts +1 -1
  305. package/lib/types/provenance/document-preview.d.ts +3 -2
  306. package/lib/types/provenance/file-preview.d.ts +2 -1
  307. package/lib/types/provenance/source-content.d.ts +19 -0
  308. package/lib/types/provenance/source-image.d.ts +4 -0
  309. package/lib/types/provenance/spreadsheet-preview.d.ts +5 -0
  310. package/lib/types/provenance/types.d.ts +3 -0
  311. package/lib/types/qa-tools/activation-manager.d.ts +5 -0
  312. package/lib/types/qa-tools/catalog.d.ts +4 -1
  313. package/lib/types/qa-tools/index.d.ts +5 -1
  314. package/lib/types/qa-tools/request-user-form.d.ts +5 -0
  315. package/lib/types/questions.d.ts +2 -1
  316. package/lib/types/secure-session.d.ts +1 -0
  317. package/lib/types/shared/documents.d.ts +2 -0
  318. package/lib/types/types/accounts.d.ts +7 -1
  319. package/lib/types/types/admin.d.ts +6 -0
  320. package/lib/types/types/answer-review.d.ts +11 -0
  321. package/lib/types/types/config.d.ts +9 -0
  322. package/lib/types/types/oidc.d.ts +36 -0
  323. package/lib/types/types/session.d.ts +18 -3
  324. package/lib/types/types.d.ts +3 -0
  325. package/package.json +58 -56
@@ -0,0 +1,215 @@
1
+ /** Browser-safe wire contract; storage and tool waiting have independent lifetimes. */
2
+ export interface QaFormPolicy {
3
+ enabled: boolean;
4
+ maxSteps: number;
5
+ maxItemsPerForm: number;
6
+ maxOptionsPerItem: number;
7
+ maxSchemaBytes: number;
8
+ maxTextLength: number;
9
+ maxTotalAnswerBytes: number;
10
+ maxFilesPerItem: number;
11
+ maxFileSizeBytes: number;
12
+ maxTotalFileBytesPerForm: number;
13
+ maxConcurrentUploadsPerSession: number;
14
+ uploadIntentTtlSeconds: number;
15
+ allowedExtensions: readonly string[];
16
+ }
17
+ export interface QaFormOption {
18
+ value: string;
19
+ label: string;
20
+ description?: string | undefined;
21
+ recommended?: boolean | undefined;
22
+ }
23
+ export type QaFormAnswerSpec = {
24
+ type: "text" | "textarea";
25
+ required: boolean;
26
+ placeholder?: string | undefined;
27
+ min_length?: number | undefined;
28
+ max_length?: number | undefined;
29
+ } | {
30
+ type: "single_select" | "multi_select";
31
+ required: boolean;
32
+ options: QaFormOption[];
33
+ allow_other?: boolean | undefined;
34
+ min_selected?: number | undefined;
35
+ max_selected?: number | undefined;
36
+ };
37
+ export type QaFormFilesSpec = {
38
+ requirement: "none";
39
+ } | {
40
+ requirement: "required";
41
+ min_count: number;
42
+ max_count: number;
43
+ accept: string[];
44
+ max_file_size_bytes: number;
45
+ } | {
46
+ requirement: "optional";
47
+ max_count: number;
48
+ accept: string[];
49
+ max_file_size_bytes: number;
50
+ };
51
+ export interface QaFormItem {
52
+ id: string;
53
+ title: string;
54
+ description?: string | undefined;
55
+ answer?: QaFormAnswerSpec | undefined;
56
+ files: QaFormFilesSpec;
57
+ }
58
+ export interface QaFormStep {
59
+ id: string;
60
+ title: string;
61
+ description?: string | undefined;
62
+ items: QaFormItem[];
63
+ }
64
+ export interface QaFormSchema {
65
+ schema_version: 1;
66
+ title: string;
67
+ description?: string | undefined;
68
+ submit_label?: string | undefined;
69
+ steps: QaFormStep[];
70
+ }
71
+ export type QaFormAnswer = {
72
+ type: "text" | "textarea";
73
+ text: string;
74
+ } | {
75
+ type: "single_select" | "multi_select";
76
+ selected: string[];
77
+ other_text?: string | undefined;
78
+ };
79
+ export interface QaFormAttachment {
80
+ attachment_id: string;
81
+ version: number;
82
+ name: string;
83
+ size_bytes: number;
84
+ media_type: string;
85
+ sha256: string;
86
+ resource_id: string;
87
+ }
88
+ export interface QaFormUpload {
89
+ id: string;
90
+ item_id: string;
91
+ name: string;
92
+ size_bytes: number;
93
+ state: "pending" | "uploading" | "failed" | "ready" | "cancelled";
94
+ expires_at: number;
95
+ target?: {
96
+ attachment_id: string;
97
+ version: number;
98
+ } | undefined;
99
+ result?: QaFormAttachment;
100
+ error?: string;
101
+ }
102
+ export interface QaFormFieldError {
103
+ step_id: string;
104
+ item_id: string;
105
+ component: "answer" | "files";
106
+ code: string;
107
+ message: string;
108
+ }
109
+ export interface QaFormSubmission {
110
+ status: "submitted";
111
+ form_id: string;
112
+ submission_id: string;
113
+ schema_version: 1;
114
+ schema_hash: string;
115
+ form_revision: number;
116
+ submitted_at: string;
117
+ items: {
118
+ step_id: string;
119
+ item_id: string;
120
+ answer: QaFormAnswer | null;
121
+ files: QaFormAttachment[];
122
+ }[];
123
+ empty_optional_item_ids: string[];
124
+ }
125
+ export interface QaFormRecord {
126
+ storage_version: 1;
127
+ id: string;
128
+ session_id: string;
129
+ creator_id: string;
130
+ request_key: string;
131
+ schema: QaFormSchema;
132
+ schema_hash: string;
133
+ status: "draft" | "submitted" | "cancelled" | "expired";
134
+ revision: number;
135
+ created_at: string;
136
+ answers: Record<string, QaFormAnswer | null>;
137
+ attachments: Record<string, QaFormAttachment[]>;
138
+ uploads: QaFormUpload[];
139
+ step: number;
140
+ submission?: QaFormSubmission;
141
+ }
142
+ export type QaFormView = QaFormRecord & {
143
+ waiting: boolean;
144
+ field_errors: QaFormFieldError[];
145
+ };
146
+ export interface QaFormMutation {
147
+ form_id: string;
148
+ expected_revision: number;
149
+ mutation_id: string;
150
+ }
151
+ export type QaFormCommand = (QaFormMutation & {
152
+ action: "save";
153
+ answers: Record<string, QaFormAnswer | null>;
154
+ step: number;
155
+ }) | (QaFormMutation & {
156
+ action: "submit" | "pause";
157
+ }) | (QaFormMutation & {
158
+ action: "begin_upload";
159
+ item_id: string;
160
+ name: string;
161
+ size_bytes: number;
162
+ target?: {
163
+ attachment_id: string;
164
+ version: number;
165
+ } | undefined;
166
+ }) | (QaFormMutation & {
167
+ action: "cancel_upload";
168
+ upload_id: string;
169
+ }) | (QaFormMutation & {
170
+ action: "remove";
171
+ item_id: string;
172
+ attachment_id: string;
173
+ version: number;
174
+ });
175
+ export type QaFormResult<T> = {
176
+ ok: true;
177
+ value: T;
178
+ } | {
179
+ ok: false;
180
+ error: {
181
+ code: string;
182
+ message: string;
183
+ form_revision?: number;
184
+ field_errors?: QaFormFieldError[];
185
+ };
186
+ };
187
+ /**
188
+ * The store surface the service programs against.
189
+ *
190
+ * The service must never reach into a concrete storage backend: the shipped
191
+ * store is sqlite (durable), and the client component tests mount an in-memory
192
+ * implementation, which a browser test environment could never load through
193
+ * the sqlite bridge.
194
+ */
195
+ export interface QaFormStoreApi {
196
+ list(session: string): QaFormRecord[];
197
+ create(session: string, key: string, schema: QaFormRecord["schema"], creator?: string): QaFormRecord;
198
+ get(session: string, id: string): QaFormRecord;
199
+ editableOrSubmitted(record: QaFormRecord): void;
200
+ mutate(session: string, id: string, revision: number, mutationId: string, input: unknown, work: (r: QaFormRecord) => void): QaFormRecord;
201
+ update(session: string, id: string, work: (r: QaFormRecord) => void): QaFormRecord;
202
+ resource(formId: string, id: string): Uint8Array;
203
+ saveResource(formId: string, id: string, data: Uint8Array): void;
204
+ storedBytes(session: string): number;
205
+ identityReservedBytes(creator: string): number;
206
+ cancelSession(session: string): void;
207
+ /**
208
+ * Submit retries are idempotent: when this mutation identity was already
209
+ * applied, return its recorded result and refuse a reused identity that
210
+ * carries different data. `null` means the identity is unused.
211
+ */
212
+ replayedMutation(formId: string, mutationId: string, input: unknown): QaFormRecord | null;
213
+ close(): void;
214
+ }
215
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ import type { QaFormAnswer, QaFormAnswerSpec, QaFormFieldError, QaFormPolicy, QaFormRecord } from "./types.js";
3
+ export declare const formAnswerParser: z.ZodUnion<readonly [z.ZodObject<{
4
+ type: z.ZodEnum<{
5
+ text: "text";
6
+ textarea: "textarea";
7
+ }>;
8
+ text: z.ZodString;
9
+ }, z.core.$strict>, z.ZodObject<{
10
+ type: z.ZodEnum<{
11
+ multi_select: "multi_select";
12
+ single_select: "single_select";
13
+ }>;
14
+ selected: z.ZodArray<z.ZodString>;
15
+ other_text: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strict>]>;
17
+ /** Requiredness is checked at navigation/submit; invalid supplied values fail even if optional. */
18
+ export declare function normalizeFormAnswer(spec: QaFormAnswerSpec | undefined, raw: unknown, policy: Readonly<QaFormPolicy>, requireComplete?: boolean): QaFormAnswer | null;
19
+ export declare function validateForm(record: QaFormRecord, policy: Readonly<QaFormPolicy>, stepId?: string): QaFormFieldError[];
20
+ //# sourceMappingURL=validation.d.ts.map
@@ -3,9 +3,10 @@ import type { SessionPageRequest, SessionFollowRequest, SessionPromptRequest, Se
3
3
  import { TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
4
4
  import type { Context } from "@deepseek-ai/cordis";
5
5
  import type { QaSurfaceConfigRefs } from "./config.js";
6
+ import type { QaFormCommand, QaFormResult, QaFormView } from "./forms/types.js";
6
7
  import type { QaAccountNotificationsInput } from "./types.js";
7
8
  import type { QaTurnSources } from "./provenance/types.js";
8
- import type { QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaDocumentPreview, QaDocumentWorkflowStatus, QaIssuedServiceToken, QaLockdownProof, QaOwnershipEntry, QaPasswordResetRequest, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaQueueStatus, QaServiceTokenCreateInput, QaServiceTokenSummary, ResolvedQaSurfaceConfig, QaAdminSkillScope, QaAdminSkillsView, QaExpertMemoryDraft, QaExpertMemoryPage, QaExpertMemoryRecord, QaExpertMemoryScope, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaWhoamiResult, QaWorkspaceFile, QaWorkspaceFileChunk, QaWorkspaceListing, QaPrincipal, QaAccessAdminSnapshot, QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaCapabilitySelection, QaConversationDetail, QaConversationDeletion, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaCurrentAccess, QaFeedbackHarvestEntry, QaFeedbackHarvestResult, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaModelCatalogEntry, QaModelPair, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaSessionAccess, QaSlashCatalog, QaSlashExecution, QaSlashSubmitAttachment, QaSkillActivationRecord, QaSkillAssignmentOverride, QaSubrole, QaUserAccess, QaUserQuery } from "./types.js";
9
+ import type { QaAccountProfileInput, QaAccountSession, QaAccountStartersInput, QaAccountUserPublic, QaApprovalDecision, QaClaimResult, QaDocumentPreview, QaSpreadsheetPreviewSelection, QaDocumentWorkflowStatus, QaIssuedServiceToken, QaLockdownProof, QaOwnershipEntry, QaPasswordResetRequest, QaPendingApproval, QaPendingQuestion, QaQuestionAnswerItem, QaQueueStatus, QaServiceTokenCreateInput, QaServiceTokenSummary, ResolvedQaSurfaceConfig, QaAdminSkillScope, QaAdminSkillsView, QaExpertMemoryDraft, QaExpertMemoryPage, QaExpertMemoryRecord, QaExpertMemoryScope, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, QaSourceFilePreview, QaWhoamiResult, QaWorkspaceFile, QaWorkspaceFileChunk, QaWorkspaceListing, QaPrincipal, QaAccessAdminSnapshot, QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaCapabilitySelection, QaConversationDetail, QaConversationDeletion, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaCurrentAccess, QaFeedbackHarvestEntry, QaFeedbackHarvestResult, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaModelCatalogEntry, QaModelPair, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaSessionAccess, QaSlashCatalog, QaSlashExecution, QaSlashSubmitAttachment, QaSkillActivationRecord, QaSkillAssignmentOverride, QaSubrole, QaUserAccess, QaUserQuery } from "./types.js";
9
10
  export declare const name = "qa-surface";
10
11
  export declare const inject: string[];
11
12
  import { QA_SURFACE_SETTINGS_NAMESPACE } from "./shared/settings.js";
@@ -26,6 +27,10 @@ export declare class QaSurface extends TypertRemoteService {
26
27
  private readonly approvals;
27
28
  private readonly fileDeleteGate;
28
29
  private readonly userQuestions;
30
+ private formService?;
31
+ private readonly formGate;
32
+ private readonly formAttachments;
33
+ private forms;
29
34
  private readonly provenance;
30
35
  private readonly notes;
31
36
  /** Assigned after the admission gate; that gate only reads it per execution. */
@@ -54,6 +59,9 @@ export declare class QaSurface extends TypertRemoteService {
54
59
  private readonly integrationPrincipals;
55
60
  private webServer;
56
61
  private disposeRoute;
62
+ private readonly oidc;
63
+ private disposeOidcRoute;
64
+ private oidcRouteKey;
57
65
  private routeKey;
58
66
  /**
59
67
  * The HTTP API an external application asks questions through. Constructed
@@ -142,6 +150,9 @@ export declare class QaSurface extends TypertRemoteService {
142
150
  */
143
151
  accountsRegister(email: string, password: string): QaAccountSession;
144
152
  accountsLogin(email: string, password: string): QaAccountSession;
153
+ accountsOidcStart(): Promise<import("./types.js").QaOidcStart>;
154
+ accountsOidcComplete(handoff: string, completionKey: string): QaAccountSession;
155
+ accountsOidcLogout(token: string): Promise<string | null>;
145
156
  /** Identity probe; safe to call with an empty or expired token. */
146
157
  accountsChangePassword(token: string, currentPassword: string, nextPassword: string): QaAccountSession;
147
158
  /**
@@ -214,6 +225,9 @@ export declare class QaSurface extends TypertRemoteService {
214
225
  accountsRevokeServiceToken(token: string, tokenId: string): {
215
226
  readonly revoked: boolean;
216
227
  };
228
+ accountsSetServiceTokenClarifications(token: string, tokenId: string, allowed: boolean): {
229
+ readonly updated: boolean;
230
+ };
217
231
  /**
218
232
  * Serve the effective QA configuration to the browser. The DSH gateway pins
219
233
  * settings RPCs to loopback, so a browser served over the LAN always sees
@@ -388,6 +402,22 @@ export declare class QaSurface extends TypertRemoteService {
388
402
  * deployment with unsupported questions answers with an empty list.
389
403
  */
390
404
  pendingQuestions(token: string, sessionId: string): Promise<readonly QaPendingQuestion[]>;
405
+ /** Forms stay owner-scoped; UUIDs and a browser-supplied session never grant access. */
406
+ private admitForm;
407
+ listForms(token: string, sessionId: string): Promise<QaFormResult<QaFormView[]>>;
408
+ getForm(token: string, sessionId: string, formId: string): Promise<QaFormResult<QaFormView>>;
409
+ mutateForm(token: string, sessionId: string, command: QaFormCommand): Promise<QaFormResult<QaFormView>>;
410
+ validateFormStep(token: string, sessionId: string, formId: string, stepId: string, revision: number): Promise<QaFormResult<null>>;
411
+ formCapabilities(): Promise<{
412
+ enabled: boolean;
413
+ schemaVersion: number;
414
+ upload: boolean;
415
+ }>;
416
+ readFormAttachment(token: string, sessionId: string, formId: string, resourceId: string): Promise<QaFormResult<{
417
+ name: string;
418
+ media_type: string;
419
+ data: string;
420
+ }>>;
391
421
  /**
392
422
  * Apply the operator's answers to one parked question request. Every question
393
423
  * of the request must be present in `answers`; one the browser omits reads as
@@ -405,7 +435,9 @@ export declare class QaSurface extends TypertRemoteService {
405
435
  * read — the normal case for a deployment whose docs and code live beside
406
436
  * the per-account scratch directory — could never be opened in the panel.
407
437
  */
408
- readSourceFile(token: string, sessionId: string, sourcePath: string): Promise<QaSourceFilePreview>;
438
+ readSourceFile(token: string, sessionId: string, sourcePath: string, selection?: QaSpreadsheetPreviewSelection): Promise<QaSourceFilePreview>;
439
+ /** Load one relative raster illustration of an attested Markdown source. */
440
+ readSourceImage(token: string, sessionId: string, sourcePath: string, imagePath: string): Promise<string>;
409
441
  /**
410
442
  * List one directory of the chat's own workspace for the files panel.
411
443
  *
@@ -439,7 +471,7 @@ export declare class QaSurface extends TypertRemoteService {
439
471
  * produced PDF is read back here and travels as base64, so the audience never
440
472
  * reaches an unfenced byte route.
441
473
  */
442
- previewWorkspaceDocument(token: string, sessionId: string, path: string): Promise<QaDocumentPreview>;
474
+ previewWorkspaceDocument(token: string, sessionId: string, path: string, selection?: QaSpreadsheetPreviewSelection): Promise<QaDocumentPreview>;
443
475
  /**
444
476
  * Shared admission facts of both browse methods: the preview switch is what
445
477
  * opens the panel's file reading at all, and the chat's cwd is the tree that
@@ -506,6 +538,7 @@ export declare class QaSurface extends TypertRemoteService {
506
538
  * immediately rather than at the next restart.
507
539
  */
508
540
  private refreshIntegrationRoutes;
541
+ private refreshOidcRoute;
509
542
  private refreshRoute;
510
543
  /**
511
544
  * A deployment that set `lockdown.allowSlashCommands: true` before this
@@ -166,6 +166,7 @@ export interface QaIntegrationRunner {
166
166
  /** The chat to continue, or null for a new conversation. */
167
167
  readonly chatId: string | null;
168
168
  readonly message: string;
169
+ readonly allowClarifications?: boolean;
169
170
  readonly attachments: readonly QaIntegrationAttachment[];
170
171
  readonly ticketKey: string | null;
171
172
  /** Ends the wait: the caller's own lifetime merged with the deployment's budget. */
@@ -0,0 +1,20 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { Agent } from "@deepseek-ai/dsh-agent";
3
+ import type { QaAccounts } from "../accounts/store.js";
4
+ export declare const QA_INTEGRATION_NO_CLARIFICATIONS = "Clarifying questions are disabled for this integration turn. Do not call ask_user_question or ask follow-up questions in your answer. Answer from available evidence, label assumptions and missing facts, and state what cannot be determined when evidence is insufficient. Do not invent facts or bypass permission approvals.";
5
+ /** A queued request's durable policy follows its turn and its delegated agents. */
6
+ export declare class QaIntegrationQuestionPolicy {
7
+ private readonly ctx;
8
+ private readonly accounts;
9
+ private readonly qaRoot;
10
+ private readonly turns;
11
+ private readonly notes;
12
+ private readonly disposers;
13
+ constructor(ctx: Context, accounts: () => QaAccounts | undefined, qaRoot?: (id: string) => string | undefined);
14
+ allowed(agent: Agent): boolean;
15
+ private root;
16
+ /** Recover after a plugin reload from consumed messages, never queued future input. */
17
+ private recover;
18
+ dispose(): void;
19
+ }
20
+ //# sourceMappingURL=question-policy.d.ts.map
@@ -31,6 +31,7 @@ export declare const QA_INTEGRATION_MAX_CITATIONS = 5;
31
31
  export declare function sourceCitations(sources: readonly QaSourceReference[]): readonly string[];
32
32
  /** Who a presented credential turned out to be. */
33
33
  export interface QaIntegrationIdentity {
34
+ readonly allowClarifications: boolean;
34
35
  readonly tokenId: string;
35
36
  readonly userId: string;
36
37
  readonly scopes: readonly QaServiceTokenScope[];
@@ -0,0 +1,20 @@
1
+ import { Service, type Context } from "@deepseek-ai/cordis";
2
+ import type { QaAccounts } from "./accounts/store.js";
3
+ interface IdentityAccounts {
4
+ ownerIdOf: QaAccounts["ownerIdOf"];
5
+ accountById: QaAccounts["accountById"];
6
+ }
7
+ export interface QaLlmIdentityOptions {
8
+ /** Resolves only roots attested by this QA deployment and their live children. */
9
+ rootOf(sessionId: string): string | undefined;
10
+ accounts(): IdentityAccounts | undefined;
11
+ }
12
+ /** Runtime-only identity seam; it grants no account or tool access. */
13
+ export declare class QaLlmIdentity extends Service {
14
+ private readonly options;
15
+ constructor(ctx: Context, options: QaLlmIdentityOptions);
16
+ /** Stable pseudonym of the chat's active owner, never the browser viewing it. */
17
+ forSession(sessionId: string): string | undefined;
18
+ }
19
+ export {};
20
+ //# sourceMappingURL=llm-identity.d.ts.map
@@ -0,0 +1,10 @@
1
+ import type { QaSourceMetadata } from "./provenance/types.js";
2
+ export interface MarkdownFrontmatter {
3
+ readonly body: string;
4
+ /** Physical lines removed, including both fences. */
5
+ readonly offset: number;
6
+ readonly fields: QaSourceMetadata;
7
+ }
8
+ /** Only a complete, bounded YAML mapping at the start earns a metadata card. */
9
+ export declare function readFrontmatter(text: string): MarkdownFrontmatter | undefined;
10
+ //# sourceMappingURL=markdown-frontmatter.d.ts.map
@@ -0,0 +1,3 @@
1
+ /** Exact image destinations from the same grammar the source preview renders. */
2
+ export declare function markdownImageTargets(text: string): ReadonlySet<string>;
3
+ //# sourceMappingURL=markdown-images.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { WebServer } from "@deepseek-ai/dsh-host-webserver";
2
+ import type { ResolvedQaSurfaceConfig } from "../types.js";
3
+ import type { QaOidcService } from "./service.js";
4
+ export declare function registerQaOidcRoute(webServer: Pick<WebServer, "register">, config: ResolvedQaSurfaceConfig, service: QaOidcService): () => void;
5
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1,30 @@
1
+ import * as oidc from "openid-client";
2
+ import type { QaAccounts } from "../accounts/store.js";
3
+ import type { QaAccountSession, QaOidcStart, ResolvedQaSurfaceConfig } from "../types.js";
4
+ /** A coarse refusal never carries provider responses, codes or tokens. */
5
+ export declare function oidcRefusal(): Error;
6
+ /** Authorization Code + PKCE with a browser-bound, single-use QA handoff. */
7
+ export declare class QaOidcService {
8
+ private readonly options;
9
+ private generation;
10
+ private key;
11
+ private discovery;
12
+ private readonly transactions;
13
+ private readonly handoffs;
14
+ private attempts;
15
+ constructor(options: {
16
+ config: () => ResolvedQaSurfaceConfig;
17
+ accounts: () => QaAccounts | undefined;
18
+ discover?: typeof oidc.discovery;
19
+ });
20
+ private sync;
21
+ clear(): void;
22
+ private prune;
23
+ private client;
24
+ start(): Promise<QaOidcStart>;
25
+ /** Callback is reconstructed from configured origin, never Host/Forwarded headers. */
26
+ callback(requestUrl: string): Promise<string>;
27
+ complete(handoff: string, completionKey: string): QaAccountSession;
28
+ logout(token: string): Promise<string | null>;
29
+ }
30
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=oidc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oidc.js","sourceRoot":"","sources":["../../src/types/oidc.ts"],"names":[],"mappings":""}
@@ -41,7 +41,7 @@ export declare const QA_IDENTITY_NOTE_TEMPLATE = "{identity}\n\n{instructions}";
41
41
  export declare const QA_SOURCES_NOTE_TEMPLATE = "Source provenance is collected automatically from your tool calls; the QA surface lists what it collected beside the answer. Do not append a manual Sources/\u0418\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0438 bibliography of your own.";
42
42
  export declare const QA_SOURCES_FALLBACK_TEMPLATE = "A delegated run whose provider cannot expose tool events must call {reportTool} before finishing.";
43
43
  export declare const QA_DELEGATION_NOTE_TEMPLATE = "When you start a background subagent, give the delegation a short vivid name in its description field: two or three words in the user's language that say what the run is for (\u00AB\u0421\u0432\u0435\u0440\u043A\u0430 \u043E\u0442\u0447\u0451\u0442\u043E\u0432\u00BB, \"Log triage\"). The QA surface shows that description as the subagent's display name in the operator's panel and completion notices.";
44
- export declare const QA_DOCUMENTS_NOTE_TEMPLATE = "A document a chat user attached is a path on disk, not text: read it with the deployment's document pipeline \u2014 `document_inspect` says what a DOCX or PDF is, `document_to_markdown` extracts its text, `document_from_url` stores the text of an attachment that only exists behind a URL. The plain file reader refuses those formats as binary, so that refusal is expected and is not a hint to go looking for the file somewhere else. When the pipeline itself refuses a path, report the refusal and the path it named instead of trying another reader.";
44
+ export declare const QA_DOCUMENTS_NOTE_TEMPLATE = "A document a chat user attached is a path on disk, not text: read it with the deployment's document pipeline \u2014 `document_inspect` says what a DOCX or PDF is, `document_to_markdown` extracts its text, `document_from_url` stores the text of an attachment that only exists behind a URL. For XLSX, CSV, TSV, ODS or FODS, `spreadsheet_inspect` lists all sheets and detects text delimiter/encoding, `spreadsheet_read` reads pages, and `spreadsheet_create` creates a file in the selected format. CSV/TSV have one Data sheet with string fields; reuse detected delimiter and encoding when paging. XLSX/ODS/FODS support multiple sheets. Inspect all sheet names before selecting data; formula values are saved caches, not recalculated results. The plain file reader refuses those formats as binary, so that refusal is expected and is not a hint to go looking for the file somewhere else. When the pipeline itself refuses a path, report the refusal and the path it named instead of trying another reader.";
45
45
  export declare const QA_SOURCE_PRIORITY_NOTE_TEMPLATE = "Answer from the source that owns the question: read what the conversation and its attachments already carry, then search the product documentation and ask the domain expert, and only then look in memory. Recalled memory is background from earlier sessions \u2014 a miss there is not evidence that no source exists, and it is not where a document, a page or a product fact should be looked up.";
46
46
  export interface QaIdentityRenderInput {
47
47
  /** The owner's account address; the one fact accounts always provide. */
@@ -1,5 +1,5 @@
1
1
  import type { DocumentsFace } from "@yadsh/dsh-documents";
2
- import type { QaDocumentPreview } from "../types.js";
2
+ import type { QaDocumentPreview, QaSpreadsheetPreviewSelection } from "../types.js";
3
3
  import { type QaAllowedFileRequest } from "./file-preview.js";
4
4
  /** Look up the document subsystem a sibling Host plugin published. */
5
5
  export type DocumentsLookup = () => DocumentsFace | undefined;
@@ -9,6 +9,7 @@ export interface QaDocumentPreviewRequest extends QaAllowedFileRequest {
9
9
  readonly sessionId: string;
10
10
  /** Bytes of the rendered PDF the panel accepts before it gives up. */
11
11
  readonly maxBytes: number;
12
+ readonly selection?: QaSpreadsheetPreviewSelection;
12
13
  }
13
14
  /**
14
15
  * Render one Word document as a PDF for the files panel.
@@ -24,7 +25,7 @@ export interface QaDocumentPreviewRequest extends QaAllowedFileRequest {
24
25
  * an uploaded Word file lives in the attachment store, and a pipeline that is
25
26
  * not told about that root refuses the file this check just accepted.
26
27
  */
27
- export declare function previewConvertibleDocument({ documents, sessionId, maxBytes, ...file }: QaDocumentPreviewRequest): Promise<QaDocumentPreview>;
28
+ export declare function previewConvertibleDocument({ documents, sessionId, maxBytes, selection, ...file }: QaDocumentPreviewRequest): Promise<QaDocumentPreview>;
28
29
  /** Native PDF or pipeline preview, after the caller has verified chat evidence. */
29
30
  export declare function previewSourceDocument(request: QaDocumentPreviewRequest): Promise<QaDocumentPreview>;
30
31
  //# sourceMappingURL=document-preview.d.ts.map
@@ -40,6 +40,7 @@ export interface QaSourceFilePreviewRequest {
40
40
  readonly attachmentRoot?: string;
41
41
  readonly maxBytes: number;
42
42
  readonly maxMarkdownRenderBytes: number;
43
+ readonly renderFrontmatter?: boolean;
43
44
  }
44
45
  /** A file request the panel may make: the chat's own tree or a shared root. */
45
46
  export interface QaAllowedFileRequest {
@@ -77,7 +78,7 @@ export declare function resolveAllowedFile({ filePath, cwd, sharedReadOnlyRoots,
77
78
  * same way before it is matched, or a file inside the chat's own workspace is
78
79
  * refused as foreign evidence.
79
80
  */
80
- export declare function readSourceFilePreview({ sourcePath, cwd, isEvidence, sharedReadOnlyRoots, attachmentRoot, maxBytes, maxMarkdownRenderBytes, }: QaSourceFilePreviewRequest): Promise<QaSourceFilePreview>;
81
+ export declare function readSourceFilePreview({ sourcePath, cwd, isEvidence, sharedReadOnlyRoots, attachmentRoot, maxBytes, maxMarkdownRenderBytes, renderFrontmatter, }: QaSourceFilePreviewRequest): Promise<QaSourceFilePreview>;
81
82
  /** One directory request from the files panel. */
82
83
  export interface QaWorkspaceListRequest {
83
84
  /** The directory to list, absolute or relative to the chat cwd. Empty = root. */
@@ -0,0 +1,19 @@
1
+ /** Text retained from a single addressed tool result, never from model prose. */
2
+ export declare const MAX_SOURCE_CONTENT = 32000;
3
+ type RecordValue = Record<string, unknown>;
4
+ export declare function retainedSourceContent(value: string | undefined, partial?: boolean): {
5
+ content?: undefined;
6
+ contentTruncated?: undefined;
7
+ } | {
8
+ content: string;
9
+ contentTruncated: boolean;
10
+ };
11
+ export declare function structuredSourceContent(item: RecordValue): {
12
+ content?: undefined;
13
+ contentTruncated?: undefined;
14
+ } | {
15
+ content: string;
16
+ contentTruncated: boolean;
17
+ };
18
+ export {};
19
+ //# sourceMappingURL=source-content.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { type QaSourceFilePreviewRequest } from "./file-preview.js";
2
+ /** The image must be named by an attested Markdown file and stay inside allowed roots. */
3
+ export declare function readSourceImage(request: QaSourceFilePreviewRequest, imagePath: string): Promise<string>;
4
+ //# sourceMappingURL=source-image.d.ts.map
@@ -0,0 +1,5 @@
1
+ import type { QaDocumentPreviewRequest } from "./document-preview.js";
2
+ import type { QaSpreadsheetPreview } from "../types.js";
3
+ /** Reuse the agent's bounded parser and the panel's canonical root fence. */
4
+ export declare function previewSpreadsheetDocument(request: QaDocumentPreviewRequest): Promise<QaSpreadsheetPreview>;
5
+ //# sourceMappingURL=spreadsheet-preview.d.ts.map
@@ -33,6 +33,9 @@ export interface QaSourceReference {
33
33
  readonly uri?: string;
34
34
  readonly path?: string;
35
35
  readonly snippet?: string;
36
+ /** Bounded text actually returned for this source by a retrieval tool. */
37
+ readonly content?: string;
38
+ readonly contentTruncated?: boolean;
36
39
  readonly locations: readonly QaSourceLocation[];
37
40
  readonly evidence: QaSourceEvidence;
38
41
  readonly origins: readonly QaSourceOrigin[];
@@ -19,7 +19,12 @@ export interface QaToolActivationManagerOptions {
19
19
  export declare class QaToolActivationManager implements QaToolActivation {
20
20
  private readonly options;
21
21
  private readonly states;
22
+ private readonly activeAgents;
23
+ private catalog;
22
24
  constructor(options: QaToolActivationManagerOptions);
25
+ /** Reconcile feature switches only for scopes which already earned activation. */
26
+ replaceCatalog(catalog: readonly QaToolDescriptor[]): void;
27
+ disposeAll(): void;
23
28
  /**
24
29
  * Register the whole catalog on one agent, all or nothing.
25
30
  *
@@ -1,5 +1,6 @@
1
1
  import type { Agent } from "@deepseek-ai/dsh-agent";
2
2
  import type { QaToolDescriptor } from "./types.js";
3
+ import type { QaFormGate } from "../forms/gate.js";
3
4
  /**
4
5
  * Deterministic catalog identity. The durable activation marker is derived from
5
6
  * the session log rather than stored, so this version is not compared against a
@@ -8,9 +9,11 @@ import type { QaToolDescriptor } from "./types.js";
8
9
  *
9
10
  * Bump it whenever the catalog's tool set or their schemas change.
10
11
  */
11
- export declare const QA_TOOL_CATALOG_VERSION = "3";
12
+ export declare const QA_TOOL_CATALOG_VERSION = "4";
12
13
  /** What the catalog's definitions read, beyond the execution record. */
13
14
  export interface QaToolsSelfcheckDeps {
15
+ readonly forms?: QaFormGate;
16
+ readonly formProjection?: (submission: import("../forms/types.js").QaFormSubmission) => Promise<unknown>;
14
17
  readonly catalogVersion: string;
15
18
  readonly activationMode: string;
16
19
  /** Names the catalog contributes, in catalog order. */
@@ -3,6 +3,9 @@ import type { Context } from "@deepseek-ai/cordis";
3
3
  import type { PluginLogger } from "@yadsh/dsh-plugin-log";
4
4
  import type { QaToolActivation } from "./types.js";
5
5
  export interface QaToolsOptions {
6
+ readonly forms?: import("../forms/gate.js").QaFormGate;
7
+ readonly formsEnabled?: () => boolean;
8
+ readonly formProjection?: (submission: import("../forms/types.js").QaFormSubmission) => Promise<unknown>;
6
9
  readonly logger: PluginLogger;
7
10
  readonly dynamicActivation: boolean;
8
11
  readonly activationSkill: string;
@@ -31,12 +34,13 @@ export declare class QaTools implements QaToolActivation {
31
34
  private readonly manager;
32
35
  private readonly detector;
33
36
  private readonly lifecycle;
34
- private readonly catalogTools;
37
+ private catalogTools;
35
38
  constructor(ctx: Context, options: QaToolsOptions);
36
39
  /** Names currently registered on one agent; the admission guard reads this per call. */
37
40
  activeToolNames(agent: Agent): readonly string[];
38
41
  /** Shipped scope-local names, including entries not activated on an agent yet. */
39
42
  catalogToolNames(): readonly string[];
43
+ refreshForms(): void;
40
44
  dispose(): void;
41
45
  /**
42
46
  * The preset gate. An empty `activationPresets` leaves it open, which is only
@@ -0,0 +1,5 @@
1
+ import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
2
+ import type { QaFormGate } from "../forms/gate.js";
3
+ /** Build only; the QA activation manager owns registration and role admission. */
4
+ export declare function createRequestUserFormTool(gate: QaFormGate, project?: (submission: import("../forms/types.js").QaFormSubmission) => Promise<unknown>): ToolDefinition;
5
+ //# sourceMappingURL=request-user-form.d.ts.map
@@ -62,9 +62,10 @@ export declare class QaQuestionGate {
62
62
  private readonly interactive;
63
63
  private readonly ownership;
64
64
  private readonly logger;
65
+ private readonly questionsAllowed;
65
66
  private readonly pending;
66
67
  private readonly disposers;
67
- constructor(ctx: Context, interactive: () => boolean, ownership: QaSessionOwnership, logger: PluginLogger);
68
+ constructor(ctx: Context, interactive: () => boolean, ownership: QaSessionOwnership, logger: PluginLogger, questionsAllowed?: (agent: Agent) => boolean);
68
69
  /** Claim question requests for the chats this deployment answers. */
69
70
  install(): void;
70
71
  /** Questions of one chat, oldest first: what the QA view renders. */