@yadsh/dsh-qa-surface 0.15.7 → 0.17.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 (348) hide show
  1. package/README.md +27 -2
  2. package/lib/access/capability-catalog.js +11 -4
  3. package/lib/access/capability-catalog.js.map +1 -1
  4. package/lib/access/service.js +46 -5
  5. package/lib/access/service.js.map +1 -1
  6. package/lib/account-remotes.js +9 -0
  7. package/lib/account-remotes.js.map +1 -1
  8. package/lib/accounts/database.js +34 -3
  9. package/lib/accounts/database.js.map +1 -1
  10. package/lib/accounts/store.js +22 -2
  11. package/lib/accounts/store.js.map +1 -1
  12. package/lib/admin/service.js +4 -2
  13. package/lib/admin/service.js.map +1 -1
  14. package/lib/admin/session-log.js +3 -0
  15. package/lib/admin/session-log.js.map +1 -1
  16. package/lib/agent-scope.js +9 -0
  17. package/lib/agent-scope.js.map +1 -0
  18. package/lib/chat-sharing/native-fence.js +120 -0
  19. package/lib/chat-sharing/native-fence.js.map +1 -0
  20. package/lib/chat-sharing/resources.js +57 -0
  21. package/lib/chat-sharing/resources.js.map +1 -0
  22. package/lib/chat-sharing/store.js +199 -0
  23. package/lib/chat-sharing/store.js.map +1 -0
  24. package/lib/chat-sharing/transport.js +329 -0
  25. package/lib/chat-sharing/transport.js.map +1 -0
  26. package/lib/chat-sharing/turn-guard.js +154 -0
  27. package/lib/chat-sharing/turn-guard.js.map +1 -0
  28. package/lib/chat-sharing/types.js +2 -0
  29. package/lib/chat-sharing/types.js.map +1 -0
  30. package/lib/chat-sharing/uploads.js +55 -0
  31. package/lib/chat-sharing/uploads.js.map +1 -0
  32. package/lib/client/QaAccountsController.js +47 -2
  33. package/lib/client/QaAccountsController.js.map +1 -1
  34. package/lib/client/QaConfigController.js +7 -12
  35. package/lib/client/QaConfigController.js.map +1 -1
  36. package/lib/client/QaSessionController.js +195 -19
  37. package/lib/client/QaSessionController.js.map +1 -1
  38. package/lib/client/QaSurface.js +156 -14
  39. package/lib/client/QaSurface.js.map +1 -1
  40. package/lib/client/QaSurfaceGuard.js +6 -1
  41. package/lib/client/QaSurfaceGuard.js.map +1 -1
  42. package/lib/client/QaTranscriptAdapter.js +28 -5
  43. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  44. package/lib/client/account-conversation.js +33 -0
  45. package/lib/client/account-conversation.js.map +1 -0
  46. package/lib/client/account-sessions.js +106 -0
  47. package/lib/client/account-sessions.js.map +1 -0
  48. package/lib/client/account-upload.js +30 -0
  49. package/lib/client/account-upload.js.map +1 -0
  50. package/lib/client/answer-review.js +89 -0
  51. package/lib/client/answer-review.js.map +1 -0
  52. package/lib/client/chat-artifacts.js +18 -3
  53. package/lib/client/chat-artifacts.js.map +1 -1
  54. package/lib/client/chat-sharing-api.js +2 -0
  55. package/lib/client/chat-sharing-api.js.map +1 -0
  56. package/lib/client/components/QaAnswerReviewStatus.js +45 -0
  57. package/lib/client/components/QaAnswerReviewStatus.js.map +1 -0
  58. package/lib/client/components/QaChangelog.js +92 -3
  59. package/lib/client/components/QaChangelog.js.map +1 -1
  60. package/lib/client/components/QaChatActions.js +52 -0
  61. package/lib/client/components/QaChatActions.js.map +1 -0
  62. package/lib/client/components/QaChatSharing.js +95 -0
  63. package/lib/client/components/QaChatSharing.js.map +1 -0
  64. package/lib/client/components/QaComposer.js +8 -4
  65. package/lib/client/components/QaComposer.js.map +1 -1
  66. package/lib/client/components/QaFileAttachment.js +12 -3
  67. package/lib/client/components/QaFileAttachment.js.map +1 -1
  68. package/lib/client/components/QaFilesPanel.js +11 -4
  69. package/lib/client/components/QaFilesPanel.js.map +1 -1
  70. package/lib/client/components/QaHeader.js +3 -3
  71. package/lib/client/components/QaHeader.js.map +1 -1
  72. package/lib/client/components/QaMarkdownPreview.js +86 -0
  73. package/lib/client/components/QaMarkdownPreview.js.map +1 -0
  74. package/lib/client/components/QaMessage.js +41 -10
  75. package/lib/client/components/QaMessage.js.map +1 -1
  76. package/lib/client/components/QaModal.js +17 -0
  77. package/lib/client/components/QaModal.js.map +1 -1
  78. package/lib/client/components/QaRightRail.js +6 -4
  79. package/lib/client/components/QaRightRail.js.map +1 -1
  80. package/lib/client/components/QaRightRailResize.js +129 -0
  81. package/lib/client/components/QaRightRailResize.js.map +1 -0
  82. package/lib/client/components/QaSidebar.js +11 -2
  83. package/lib/client/components/QaSidebar.js.map +1 -1
  84. package/lib/client/components/QaSourceFilters.js +22 -0
  85. package/lib/client/components/QaSourceFilters.js.map +1 -0
  86. package/lib/client/components/QaSourcesPanel.js +66 -14
  87. package/lib/client/components/QaSourcesPanel.js.map +1 -1
  88. package/lib/client/components/QaSpreadsheetPreview.js +56 -0
  89. package/lib/client/components/QaSpreadsheetPreview.js.map +1 -0
  90. package/lib/client/components/QaWelcomeNotice.js +2 -2
  91. package/lib/client/components/QaWelcomeNotice.js.map +1 -1
  92. package/lib/client/components/QaWorkspaceBrowser.js +46 -12
  93. package/lib/client/components/QaWorkspaceBrowser.js.map +1 -1
  94. package/lib/client/components/QaZoomImage.js +56 -0
  95. package/lib/client/components/QaZoomImage.js.map +1 -0
  96. package/lib/client/components/source-refs.js +57 -24
  97. package/lib/client/components/source-refs.js.map +1 -1
  98. package/lib/client/index.js +76 -8
  99. package/lib/client/index.js.map +1 -1
  100. package/lib/client/lineage.js +4 -3
  101. package/lib/client/lineage.js.map +1 -1
  102. package/lib/client/markdown/SourceImage.js +52 -0
  103. package/lib/client/markdown/SourceImage.js.map +1 -0
  104. package/lib/client/markdown/blocks.js +150 -115
  105. package/lib/client/markdown/blocks.js.map +1 -1
  106. package/lib/client/markdown/katex-css.js +1 -1
  107. package/lib/client/markdown/render.js +26 -9
  108. package/lib/client/markdown/render.js.map +1 -1
  109. package/lib/client/markdown/source-chip.js +6 -2
  110. package/lib/client/markdown/source-chip.js.map +1 -1
  111. package/lib/client/notifications/notification-dispatcher.js +50 -11
  112. package/lib/client/notifications/notification-dispatcher.js.map +1 -1
  113. package/lib/client/notifications/use-turn-notifications.js +107 -18
  114. package/lib/client/notifications/use-turn-notifications.js.map +1 -1
  115. package/lib/client/project-session-state.js +28 -13
  116. package/lib/client/project-session-state.js.map +1 -1
  117. package/lib/client/session-admission.js +9 -1
  118. package/lib/client/session-admission.js.map +1 -1
  119. package/lib/client/session-sources.js +44 -3
  120. package/lib/client/session-sources.js.map +1 -1
  121. package/lib/client/settings/sections/sources.js +1 -1
  122. package/lib/client/settings/sections/sources.js.map +1 -1
  123. package/lib/client/settings/styles.js +18 -28
  124. package/lib/client/settings/styles.js.map +1 -1
  125. package/lib/client/slash/useSlashNavigation.js +8 -5
  126. package/lib/client/slash/useSlashNavigation.js.map +1 -1
  127. package/lib/client/source-filters-styles.js +11 -0
  128. package/lib/client/source-filters-styles.js.map +1 -0
  129. package/lib/client/source-preview.js +1 -1
  130. package/lib/client/source-preview.js.map +1 -1
  131. package/lib/client/styles.js +62 -4
  132. package/lib/client/styles.js.map +1 -1
  133. package/lib/client/turn-sources.js +2 -1
  134. package/lib/client/turn-sources.js.map +1 -1
  135. package/lib/client/types.js.map +1 -1
  136. package/lib/client/use-right-rail.js +1 -1
  137. package/lib/client/use-right-rail.js.map +1 -1
  138. package/lib/client/user-settings/IntegrationTokensPage.js +30 -6
  139. package/lib/client/user-settings/IntegrationTokensPage.js.map +1 -1
  140. package/lib/client/workspace-download.js +42 -2
  141. package/lib/client/workspace-download.js.map +1 -1
  142. package/lib/client.js +6481 -2234
  143. package/lib/client.js.map +1 -1
  144. package/lib/config-resolvers/defaults.js +4 -3
  145. package/lib/config-resolvers/defaults.js.map +1 -1
  146. package/lib/config-resolvers/sources.js +2 -0
  147. package/lib/config-resolvers/sources.js.map +1 -1
  148. package/lib/config.js +3 -0
  149. package/lib/config.js.map +1 -1
  150. package/lib/enforcement/skill-policy.js +29 -4
  151. package/lib/enforcement/skill-policy.js.map +1 -1
  152. package/lib/enforcement/skill-resource-paths.js +32 -0
  153. package/lib/enforcement/skill-resource-paths.js.map +1 -0
  154. package/lib/enforcement/structured-result.js +38 -0
  155. package/lib/enforcement/structured-result.js.map +1 -0
  156. package/lib/enforcement/tool-grants.js +3 -1
  157. package/lib/enforcement/tool-grants.js.map +1 -1
  158. package/lib/index.js +447 -17
  159. package/lib/index.js.map +1 -1
  160. package/lib/integration/host-runner.js +1 -0
  161. package/lib/integration/host-runner.js.map +1 -1
  162. package/lib/integration/question-policy.js +126 -0
  163. package/lib/integration/question-policy.js.map +1 -0
  164. package/lib/integration/service.js +2 -0
  165. package/lib/integration/service.js.map +1 -1
  166. package/lib/llm-identity.js +27 -0
  167. package/lib/llm-identity.js.map +1 -0
  168. package/lib/markdown-frontmatter.js +47 -0
  169. package/lib/markdown-frontmatter.js.map +1 -0
  170. package/lib/markdown-images.js +33 -0
  171. package/lib/markdown-images.js.map +1 -0
  172. package/lib/prompt-notes.js +19 -2
  173. package/lib/prompt-notes.js.map +1 -1
  174. package/lib/provenance/collector.js +15 -1
  175. package/lib/provenance/collector.js.map +1 -1
  176. package/lib/provenance/connectors.js +57 -27
  177. package/lib/provenance/connectors.js.map +1 -1
  178. package/lib/provenance/dedupe.js +25 -1
  179. package/lib/provenance/dedupe.js.map +1 -1
  180. package/lib/provenance/document-preview.js +31 -3
  181. package/lib/provenance/document-preview.js.map +1 -1
  182. package/lib/provenance/extractors.js +88 -4
  183. package/lib/provenance/extractors.js.map +1 -1
  184. package/lib/provenance/file-download.js +56 -0
  185. package/lib/provenance/file-download.js.map +1 -0
  186. package/lib/provenance/file-preview.js +20 -2
  187. package/lib/provenance/file-preview.js.map +1 -1
  188. package/lib/provenance/host-store.js +59 -10
  189. package/lib/provenance/host-store.js.map +1 -1
  190. package/lib/provenance/integration-extractor.js +62 -0
  191. package/lib/provenance/integration-extractor.js.map +1 -0
  192. package/lib/provenance/snapshot-store.js +2 -0
  193. package/lib/provenance/snapshot-store.js.map +1 -1
  194. package/lib/provenance/source-content.js +103 -0
  195. package/lib/provenance/source-content.js.map +1 -0
  196. package/lib/provenance/source-image.js +57 -0
  197. package/lib/provenance/source-image.js.map +1 -0
  198. package/lib/provenance/spreadsheet-preview.js +52 -0
  199. package/lib/provenance/spreadsheet-preview.js.map +1 -0
  200. package/lib/qa-tools/docs-tools.js +14 -0
  201. package/lib/qa-tools/docs-tools.js.map +1 -1
  202. package/lib/questions.js +6 -1
  203. package/lib/questions.js.map +1 -1
  204. package/lib/secure-session.js +9 -3
  205. package/lib/secure-session.js.map +1 -1
  206. package/lib/session-fork-host.js +157 -0
  207. package/lib/session-fork-host.js.map +1 -0
  208. package/lib/session-fork.js +34 -0
  209. package/lib/session-fork.js.map +1 -0
  210. package/lib/session-ownership.js +5 -1
  211. package/lib/session-ownership.js.map +1 -1
  212. package/lib/shared/documents.js +12 -0
  213. package/lib/shared/documents.js.map +1 -1
  214. package/lib/shared/session-lineage.js +6 -0
  215. package/lib/shared/session-lineage.js.map +1 -0
  216. package/lib/slash/draft-target.js +21 -0
  217. package/lib/slash/draft-target.js.map +1 -0
  218. package/lib/slash/remotes.js +39 -4
  219. package/lib/slash/remotes.js.map +1 -1
  220. package/lib/typert.host.js +1869 -163
  221. package/lib/typert.remote-client.d.ts +56 -5
  222. package/lib/typert.remote-client.js +1678 -154
  223. package/lib/types/access/capability-catalog.d.ts +1 -1
  224. package/lib/types/access/service.d.ts +7 -0
  225. package/lib/types/access.js +2 -0
  226. package/lib/types/access.js.map +1 -0
  227. package/lib/types/account-remotes.d.ts +3 -0
  228. package/lib/types/accounts/database.d.ts +5 -0
  229. package/lib/types/accounts/store.d.ts +7 -2
  230. package/lib/types/accounts.js +2 -0
  231. package/lib/types/accounts.js.map +1 -0
  232. package/lib/types/admin/session-log.d.ts +2 -0
  233. package/lib/types/admin.js +2 -0
  234. package/lib/types/admin.js.map +1 -0
  235. package/lib/types/agent-scope.d.ts +4 -0
  236. package/lib/types/answer-review.js +2 -0
  237. package/lib/types/answer-review.js.map +1 -0
  238. package/lib/types/capability.js +2 -0
  239. package/lib/types/capability.js.map +1 -0
  240. package/lib/types/chat-sharing/native-fence.d.ts +11 -0
  241. package/lib/types/chat-sharing/resources.d.ts +5 -0
  242. package/lib/types/chat-sharing/store.d.ts +29 -0
  243. package/lib/types/chat-sharing/transport.d.ts +32 -0
  244. package/lib/types/chat-sharing/turn-guard.d.ts +21 -0
  245. package/lib/types/chat-sharing/types.d.ts +25 -0
  246. package/lib/types/chat-sharing/uploads.d.ts +5 -0
  247. package/lib/types/client/QaAccountsController.d.ts +4 -0
  248. package/lib/types/client/QaConfigController.d.ts +3 -2
  249. package/lib/types/client/QaSessionController.d.ts +17 -3
  250. package/lib/types/client/QaSurface.d.ts +6 -1
  251. package/lib/types/client/account-conversation.d.ts +6 -0
  252. package/lib/types/client/account-sessions.d.ts +7 -0
  253. package/lib/types/client/account-upload.d.ts +15 -0
  254. package/lib/types/client/answer-review.d.ts +16 -0
  255. package/lib/types/client/chat-sharing-api.d.ts +35 -0
  256. package/lib/types/client/components/QaAnswerReviewStatus.d.ts +8 -0
  257. package/lib/types/client/components/QaChatActions.d.ts +7 -0
  258. package/lib/types/client/components/QaChatSharing.d.ts +12 -0
  259. package/lib/types/client/components/QaComposer.d.ts +2 -0
  260. package/lib/types/client/components/QaFileAttachment.d.ts +3 -2
  261. package/lib/types/client/components/QaFilesPanel.d.ts +4 -1
  262. package/lib/types/client/components/QaMarkdownPreview.d.ts +13 -0
  263. package/lib/types/client/components/QaMessage.d.ts +5 -2
  264. package/lib/types/client/components/QaModal.d.ts +9 -0
  265. package/lib/types/client/components/QaRightRail.d.ts +3 -2
  266. package/lib/types/client/components/QaRightRailResize.d.ts +9 -0
  267. package/lib/types/client/components/QaSidebar.d.ts +2 -0
  268. package/lib/types/client/components/QaSourceFilters.d.ts +12 -0
  269. package/lib/types/client/components/QaSpreadsheetPreview.d.ts +8 -0
  270. package/lib/types/client/components/QaWelcomeNotice.d.ts +1 -1
  271. package/lib/types/client/components/QaWorkspaceBrowser.d.ts +8 -1
  272. package/lib/types/client/components/QaZoomImage.d.ts +38 -0
  273. package/lib/types/client/components/source-refs.d.ts +1 -0
  274. package/lib/types/client/lineage.d.ts +2 -2
  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/notifications/notification-dispatcher.d.ts +10 -6
  280. package/lib/types/client/notifications/use-turn-notifications.d.ts +4 -0
  281. package/lib/types/client/project-session-state.d.ts +1 -0
  282. package/lib/types/client/session-admission.d.ts +2 -0
  283. package/lib/types/client/session-sources.d.ts +1 -0
  284. package/lib/types/client/settings/styles.d.ts +2 -5
  285. package/lib/types/client/source-filters-styles.d.ts +2 -0
  286. package/lib/types/client/turn-sources.d.ts +1 -1
  287. package/lib/types/client/types.d.ts +18 -5
  288. package/lib/types/client/workspace-download.d.ts +9 -1
  289. package/lib/types/config.js +2 -0
  290. package/lib/types/config.js.map +1 -0
  291. package/lib/types/documents.js +2 -0
  292. package/lib/types/documents.js.map +1 -0
  293. package/lib/types/enforcement/skill-resource-paths.d.ts +5 -0
  294. package/lib/types/enforcement/structured-result.d.ts +11 -0
  295. package/lib/types/expert-memory.js +2 -0
  296. package/lib/types/expert-memory.js.map +1 -0
  297. package/lib/types/index.d.ts +42 -3
  298. package/lib/types/integration/contract.d.ts +1 -0
  299. package/lib/types/integration/question-policy.d.ts +20 -0
  300. package/lib/types/integration/service.d.ts +1 -0
  301. package/lib/types/llm-identity.d.ts +20 -0
  302. package/lib/types/markdown-frontmatter.d.ts +10 -0
  303. package/lib/types/markdown-images.d.ts +3 -0
  304. package/lib/types/policy.js +2 -0
  305. package/lib/types/policy.js.map +1 -0
  306. package/lib/types/prompt-notes.d.ts +3 -1
  307. package/lib/types/provenance/connectors.d.ts +4 -1
  308. package/lib/types/provenance/document-preview.d.ts +5 -2
  309. package/lib/types/provenance/extractors.d.ts +2 -0
  310. package/lib/types/provenance/file-download.d.ts +10 -0
  311. package/lib/types/provenance/file-preview.d.ts +2 -1
  312. package/lib/types/provenance/host-store.d.ts +2 -0
  313. package/lib/types/provenance/integration-extractor.d.ts +5 -0
  314. package/lib/types/provenance/source-content.d.ts +19 -0
  315. package/lib/types/provenance/source-image.d.ts +4 -0
  316. package/lib/types/provenance/spreadsheet-preview.d.ts +5 -0
  317. package/lib/types/provenance/types.d.ts +5 -0
  318. package/lib/types/qa-tools/docs-tools.d.ts +2 -0
  319. package/lib/types/quality.js +7 -0
  320. package/lib/types/quality.js.map +1 -0
  321. package/lib/types/questions.d.ts +2 -1
  322. package/lib/types/session-fork-host.d.ts +27 -0
  323. package/lib/types/session-fork.d.ts +7 -0
  324. package/lib/types/session.js +2 -0
  325. package/lib/types/session.js.map +1 -0
  326. package/lib/types/shared/documents.d.ts +2 -0
  327. package/lib/types/shared/session-lineage.d.ts +7 -0
  328. package/lib/types/skills.js +2 -0
  329. package/lib/types/skills.js.map +1 -0
  330. package/lib/types/slash/draft-target.d.ts +7 -0
  331. package/lib/types/slash/remotes.d.ts +7 -0
  332. package/lib/types/slash.js +2 -0
  333. package/lib/types/slash.js.map +1 -0
  334. package/lib/types/types/access.d.ts +43 -0
  335. package/lib/types/types/accounts.d.ts +177 -0
  336. package/lib/types/types/admin.d.ts +286 -0
  337. package/lib/types/types/answer-review.d.ts +11 -0
  338. package/lib/types/types/capability.d.ts +230 -0
  339. package/lib/types/types/config.d.ts +597 -0
  340. package/lib/types/types/documents.d.ts +34 -0
  341. package/lib/types/types/expert-memory.d.ts +35 -0
  342. package/lib/types/types/policy.d.ts +54 -0
  343. package/lib/types/types/quality.d.ts +100 -0
  344. package/lib/types/types/session.d.ts +397 -0
  345. package/lib/types/types/skills.d.ts +143 -0
  346. package/lib/types/types/slash.d.ts +159 -0
  347. package/lib/types/types.d.ts +14 -2180
  348. package/package.json +8 -7
@@ -0,0 +1,54 @@
1
+ export type QaSessionPolicy = "browser-persistent" | "new-on-load" | "fixed";
2
+ export type QaSandboxMode = "read-only" | "workspace-write";
3
+ export type QaApprovalPolicy = "never";
4
+ export type QaToolPolicyMode = "allow-list";
5
+ /**
6
+ * How the QA tool catalog is attached. `all` attaches the whole catalog once
7
+ * the activation skill loads; the field is reserved so a future grouped or
8
+ * searched mode needs no config redesign.
9
+ */
10
+ export type QaToolActivationMode = "all";
11
+ /**
12
+ * How a tool policy `ask` resolves on an attested QA agent. `blocked` refuses
13
+ * the call with the surface's own reason; `interactive` parks it until the
14
+ * operator answers in the QA view.
15
+ */
16
+ export type QaApprovalInteraction = "blocked" | "interactive";
17
+ /**
18
+ * How a user-questions request resolves on an attested QA agent. `unsupported`
19
+ * refuses the ask outright; `interactive` answers it from the QA view.
20
+ */
21
+ export type QaQuestionInteraction = "unsupported" | "interactive";
22
+ /**
23
+ * What a deployment may write for the question seam. `enabled` is accepted as
24
+ * the spelling of `interactive` a feature request asked for; the resolved
25
+ * config carries one name only.
26
+ */
27
+ export type QaQuestionInteractionInput = QaQuestionInteraction | "enabled";
28
+ /** The operator's answer to one parked tool call. */
29
+ export type QaApprovalDecision = "allowed-once" | "rejected";
30
+ /** One answered question; `custom` is free text, and may accompany `selected`. */
31
+ export interface QaQuestionAnswerItem {
32
+ readonly id: string;
33
+ readonly selected: readonly string[];
34
+ readonly custom?: string;
35
+ }
36
+ /**
37
+ * Authorization inside QA Surface. It is deliberately independent of a QA
38
+ * subrole: an admin may work as any analyst profile while still holding the
39
+ * administrative permissions, and a reviewer answers conversations without
40
+ * being able to manage accounts.
41
+ */
42
+ export type QaAccountRole = "user" | "reviewer" | "admin";
43
+ /** Administrative permissions a role grants; see `admin/permissions.ts`. */
44
+ export type QaPermission = "users.read" | "users.manage" | "roles.read" | "roles.manage" | "conversations.read.all" | "conversations.read.own" | "conversations.delete" | "reviews.read" | "reviews.write" | "analytics.read" | "audit.read" | "settings.manage"
45
+ /** Write access to skill files, personal and deployment-wide. */
46
+ | "skills.manage"
47
+ /**
48
+ * What the domain experts wrote into their durable memory. Reading is split
49
+ * from correcting because a reviewer is the one who notices a remembered
50
+ * inaccuracy in an answer, and an answer the expert keeps getting wrong is
51
+ * the reviewer's business even though the fix is not.
52
+ */
53
+ | "memory.read" | "memory.manage";
54
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1,100 @@
1
+ /** A user's verdict on one assistant message. Binary by design. */
2
+ export type QaFeedbackRating = "positive" | "negative";
3
+ /**
4
+ * Optional negative-feedback reasons. The list is short on purpose: asking for
5
+ * a precise cause at rating time costs more answers than it buys insight, and
6
+ * a reviewer classifies the hard cases afterwards.
7
+ */
8
+ export type QaFeedbackReason = "incorrect" | "instruction_not_followed" | "missing_information" | "outdated_information" | "tool_issue" | "too_verbose" | "too_short" | "other";
9
+ /** One user's rating of one assistant message. */
10
+ export interface QaMessageFeedback {
11
+ readonly id: string;
12
+ readonly conversationId: string;
13
+ readonly messageId: string;
14
+ readonly userId: string;
15
+ readonly rating: QaFeedbackRating;
16
+ readonly reasons?: readonly QaFeedbackReason[];
17
+ readonly comment?: string;
18
+ readonly createdAt: string;
19
+ readonly updatedAt?: string;
20
+ }
21
+ /** The rating fields a browser may write; identity and time are Host-owned. */
22
+ export interface QaMessageFeedbackInput {
23
+ readonly rating: QaFeedbackRating;
24
+ readonly reasons?: readonly QaFeedbackReason[];
25
+ readonly comment?: string;
26
+ }
27
+ /**
28
+ * One rating a browser still holds locally: a verdict given while the surface
29
+ * had no way to file it, replayed by the harvest. Reasons never ride along —
30
+ * the browser's map only ever stored the thumbs.
31
+ */
32
+ export interface QaFeedbackHarvestEntry {
33
+ readonly conversationId: string;
34
+ /** The durable log position, exactly as a live rating carries it. */
35
+ readonly messageId: string;
36
+ readonly rating: QaFeedbackRating;
37
+ }
38
+ /** What one harvest write did; the counts answer for the whole batch. */
39
+ export interface QaFeedbackHarvestResult {
40
+ /** Ratings the Host stored now. Replaying the same batch stores none. */
41
+ readonly recorded: number;
42
+ /** Entries the Host already held a rating for, left as they were. */
43
+ readonly present: number;
44
+ /** Entries refused: not the caller's conversation, or unusable. */
45
+ readonly rejected: number;
46
+ }
47
+ /** Review workflow state of a conversation or one of its messages. */
48
+ export type QaReviewStatus = "unreviewed" | "in_review" | "reviewed" | "needs_followup";
49
+ /**
50
+ * Reviewer taxonomy, grouped the way the spec groups it. Issue ids stay flat so
51
+ * aggregations never depend on walking a tree in the browser.
52
+ */
53
+ export type QaQualityIssueType = "answer.incorrect" | "answer.incomplete" | "answer.hallucination" | "answer.request_not_followed" | "answer.poor_formatting" | "answer.communication" | "context.missing_conversation" | "context.missing_knowledge" | "context.outdated_knowledge" | "tool.wrong_selection" | "tool.should_have_been_used" | "tool.bad_arguments" | "tool.failure" | "tool.unavailable" | "skill.missing" | "skill.wrong" | "skill.not_followed" | "skill.prompt_policy" | "access.missing_capability" | "access.excessive_capability" | "other";
54
+ export type QaQualitySeverity = "minor" | "major" | "critical";
55
+ /** Where a reviewer thinks the fix belongs; the loop's change target. */
56
+ export type QaRemediationTarget = "prompt" | "skill" | "tool" | "knowledge" | "role" | "model" | "product_ux" | "user_misunderstanding" | "unknown";
57
+ /** One reviewer result. `needs_followup` keeps the item in the queue. */
58
+ export interface QaConversationReview {
59
+ readonly id: string;
60
+ readonly conversationId: string;
61
+ readonly messageId?: string;
62
+ readonly reviewerId: string;
63
+ readonly status: "reviewed" | "needs_followup";
64
+ readonly issues: readonly QaQualityIssueType[];
65
+ readonly severity: QaQualitySeverity;
66
+ readonly notes?: string;
67
+ readonly target?: QaRemediationTarget;
68
+ readonly suggestedAction?: string;
69
+ readonly createdAt: string;
70
+ readonly updatedAt?: string;
71
+ }
72
+ /** A reviewer's write; ids, author and first-seen time are Host-owned. */
73
+ export interface QaConversationReviewInput {
74
+ readonly conversationId: string;
75
+ readonly messageId?: string;
76
+ readonly status: "reviewed" | "needs_followup";
77
+ readonly issues: readonly QaQualityIssueType[];
78
+ readonly severity: QaQualitySeverity;
79
+ readonly notes?: string;
80
+ readonly target?: QaRemediationTarget;
81
+ readonly suggestedAction?: string;
82
+ }
83
+ /** Why a conversation entered the review queue. */
84
+ export type QaReviewReason = "negative_feedback" | "manual" | "tool_failure" | "automatic";
85
+ export type QaReviewPriority = "low" | "normal" | "high";
86
+ /** One queue row: a conversation needing attention, with its derived state. */
87
+ export interface QaReviewQueueItem {
88
+ readonly conversationId: string;
89
+ readonly messageId?: string;
90
+ readonly reason: QaReviewReason;
91
+ readonly priority: QaReviewPriority;
92
+ readonly status: QaReviewStatus;
93
+ readonly assignedReviewerId?: string;
94
+ /** ISO time of the signal that put the item in the queue. */
95
+ readonly raisedAt: string;
96
+ readonly reviewerId?: string;
97
+ readonly reviewId?: string;
98
+ readonly feedbackId?: string;
99
+ }
100
+ //# sourceMappingURL=quality.d.ts.map
@@ -0,0 +1,397 @@
1
+ import type { QaTurnSources } from "../provenance/types.js";
2
+ import type { QaArtifactView } from "./documents.js";
3
+ import type { QaCommandActivity, QaSlashView } from "./slash.js";
4
+ export interface QaSourceFilePreview {
5
+ readonly path: string;
6
+ readonly content: string;
7
+ readonly size: number;
8
+ readonly truncated: boolean;
9
+ readonly markdown: boolean;
10
+ readonly renderableMarkdown: boolean;
11
+ readonly document?: QaDocumentPreview;
12
+ readonly frontmatter?: import("../markdown-frontmatter.js").MarkdownFrontmatter;
13
+ }
14
+ /**
15
+ * A PDF payload, including Word documents rendered by the document pipeline.
16
+ */
17
+ export interface QaPdfPreview {
18
+ readonly kind: "pdf";
19
+ readonly base64: string;
20
+ readonly mime: "application/pdf";
21
+ readonly name: string;
22
+ readonly bytes: number;
23
+ }
24
+ /** A bounded cell window; the complete workbook stays on the Host. */
25
+ export interface QaSpreadsheetPreview {
26
+ readonly kind: "spreadsheet";
27
+ readonly name: string;
28
+ readonly bytes: number;
29
+ readonly inventory: import("@yadsh/dsh-documents").SpreadsheetInspectResult;
30
+ readonly page: import("@yadsh/dsh-documents").SpreadsheetReadResult;
31
+ }
32
+ export interface QaSpreadsheetPreviewSelection {
33
+ readonly sheet?: string;
34
+ readonly startRow?: number;
35
+ readonly startColumn?: number;
36
+ }
37
+ export type QaDocumentPreview = QaPdfPreview | QaSpreadsheetPreview;
38
+ /** One directory entry of a chat's own workspace, as the files panel browses it. */
39
+ export interface QaWorkspaceEntry {
40
+ readonly name: string;
41
+ readonly type: "file" | "directory";
42
+ readonly size: number | null;
43
+ }
44
+ /**
45
+ * One directory of the chat's workspace. `path` is the canonical form of the
46
+ * directory as requested — the chat root itself is the empty string — so the
47
+ * panel can build a breadcrumb without another round trip.
48
+ */
49
+ export interface QaWorkspaceListing {
50
+ readonly path: string;
51
+ readonly entries: readonly QaWorkspaceEntry[];
52
+ /** More children existed than one listing carries. */
53
+ readonly truncated: boolean;
54
+ }
55
+ /**
56
+ * One file of the chat's workspace: decoded text when it reads as UTF-8, base64
57
+ * bytes when it does not. The panel needs both — documents the agent produced
58
+ * are binary, while notes and transcripts preview as text.
59
+ */
60
+ export interface QaWorkspaceFileChunk {
61
+ readonly path: string;
62
+ readonly size: number;
63
+ readonly offset: number;
64
+ readonly version: string;
65
+ readonly base64: string;
66
+ readonly done: boolean;
67
+ }
68
+ export interface QaWorkspaceFile {
69
+ readonly path: string;
70
+ readonly size: number;
71
+ readonly truncated: boolean;
72
+ readonly markdown: boolean;
73
+ readonly renderableMarkdown: boolean;
74
+ readonly mime: string;
75
+ /** Present when the file decoded as text; absent for binary content. */
76
+ readonly text?: string;
77
+ /** Present when the file is not text; base64 of at most the byte cap. */
78
+ readonly base64?: string;
79
+ }
80
+ /** Host-attested facts required before the QA composer may become writable. */
81
+ export interface QaLockdownProof {
82
+ readonly chatAccess?: import("../chat-sharing/types.js").QaChatAccess;
83
+ readonly sessionId: string;
84
+ /** Last inherited event in an ordinary fork; absent on an original chat. */
85
+ readonly inheritedThroughSeq?: number;
86
+ readonly enabled: boolean;
87
+ readonly agentPresetMatches: boolean;
88
+ readonly workspaceMatches: boolean;
89
+ readonly modelMatches: boolean;
90
+ readonly sandboxModeMatches: boolean;
91
+ readonly approvalIsNever: boolean;
92
+ readonly permissionPreset: string;
93
+ readonly toolPolicyLoaded: boolean;
94
+ readonly toolAllowList: readonly string[];
95
+ }
96
+ export interface QaUserMessage {
97
+ readonly id: string;
98
+ readonly role: "user";
99
+ readonly text: string;
100
+ /** `pending` is a browser-only optimistic row until the Host emits it. */
101
+ readonly status: "pending" | "committed";
102
+ readonly timestamp?: number;
103
+ readonly images?: readonly QaImageView[];
104
+ /** Durable files the user attached to this message, in prompt order. */
105
+ readonly files?: readonly QaFileView[];
106
+ /**
107
+ * Chat owner's display name, set only for an admin reading a foreign
108
+ * chat; the owner themself sees their messages unlabeled.
109
+ */
110
+ readonly author?: string;
111
+ }
112
+ /** Browser-only user row shown while the Host prepares the accepted turn. */
113
+ export type QaPendingUserMessage = Omit<QaUserMessage, "status"> & {
114
+ readonly status: "pending";
115
+ };
116
+ export type QaMessage = QaUserMessage | {
117
+ readonly id: string;
118
+ readonly role: "assistant";
119
+ readonly text: string;
120
+ readonly status: "streaming" | "committed" | "failed";
121
+ readonly timestamp?: number;
122
+ /**
123
+ * Position of this answer in the session's durable event log. Feedback is
124
+ * keyed to it: a rating survives a replay, a reload and a role change,
125
+ * while the browser's own message id does not.
126
+ */
127
+ readonly seq?: number;
128
+ readonly review?: import("./answer-review.js").QaAnswerReview;
129
+ /** Final text of a completed turn with a durable fork boundary. */
130
+ readonly forkable?: boolean;
131
+ /** Host turn this answer belongs to; groups regenerations into variants. */
132
+ readonly turn?: number;
133
+ /**
134
+ * Files this turn produced, in the order the tools reported them. The
135
+ * answer is the place a produced document is handed over: without these
136
+ * cards the file exists only as a path in a paragraph, and a reader who
137
+ * does not know the files tab concludes nothing was made.
138
+ */
139
+ readonly artifacts?: readonly QaArtifactView[];
140
+ /** Canonical evidence snapshot shared with this answer's source drawer. */
141
+ readonly sources?: readonly QaSource[];
142
+ readonly sourcesComplete?: boolean;
143
+ readonly incompleteSourceOrigins?: QaTurnSources["incompleteOrigins"];
144
+ /** Host-recorded response timing, present on finalized messages only. */
145
+ readonly stats?: {
146
+ /** step start → final message. */
147
+ readonly durationMs: number;
148
+ /** step start → first token; null when no token delta was recorded. */
149
+ readonly ttftMs: number | null;
150
+ /** Estimated from visible text (≈4 chars/token) over the generation window. */
151
+ readonly tokensPerSecond: number | null;
152
+ };
153
+ } | {
154
+ readonly id: string;
155
+ readonly role: "system";
156
+ readonly text: string;
157
+ readonly status: "info" | "error";
158
+ readonly timestamp?: number;
159
+ /**
160
+ * Set on a human command row. Commands stay out of the model
161
+ * conversation, so this projection is the only trace the user sees.
162
+ */
163
+ readonly command?: QaCommandActivity;
164
+ /** Collapsible settlement row (subagent finished/stopped/failed). */
165
+ readonly notice?: {
166
+ readonly title: string;
167
+ readonly body: string;
168
+ /** Muted correlation line above the body (task name, session id). */
169
+ readonly meta?: string;
170
+ };
171
+ } | {
172
+ readonly id: string;
173
+ readonly role: "work";
174
+ readonly turn: number;
175
+ /**
176
+ * "error" marks a turn the host ended with a provider failure; "stopped"
177
+ * marks one the user ended, whose answer is a prefix rather than a reply.
178
+ */
179
+ readonly status: "running" | "complete" | "error" | "stopped";
180
+ readonly startedAt?: number;
181
+ readonly endedAt?: number;
182
+ readonly items: readonly QaWorkItem[];
183
+ };
184
+ export type QaWorkItem = {
185
+ readonly id: string;
186
+ readonly kind: "reasoning" | "progress";
187
+ readonly text: string;
188
+ readonly status: "running" | "complete";
189
+ } | {
190
+ readonly id: string;
191
+ readonly kind: "tool";
192
+ readonly name: string;
193
+ readonly label: string;
194
+ readonly summary: string;
195
+ readonly input: string | null;
196
+ readonly output: string | null;
197
+ readonly status: "running" | "ok" | "error" | "stopped";
198
+ /** Durable child id, present on subagent launch calls that started one. */
199
+ readonly subagentId?: string;
200
+ readonly startedAt?: number;
201
+ readonly endedAt?: number;
202
+ };
203
+ export type QaSessionPhase = "idle" | "creating" | "ready" | "running" | "reconnecting" | "blocked" | "error";
204
+ /** Transitional UI name; the drawer now consumes the canonical source object. */
205
+ export type QaSource = import("../provenance/types.js").QaSourceReference;
206
+ /** Raster formats the attachment path accepts (mirrors the host contract). */
207
+ export type QaImageMediaType = "image/png" | "image/jpeg" | "image/webp" | "image/gif";
208
+ /** One image pending in the composer, browser-owned until the prompt lands. */
209
+ export interface QaImageDraft {
210
+ readonly kind: "image";
211
+ readonly id: string;
212
+ readonly mediaType: QaImageMediaType;
213
+ readonly name: string;
214
+ /** Canonical base64 of the image bytes, without the data: URL prefix. */
215
+ readonly data: string;
216
+ /** Local object URL for the preview thumbnail. */
217
+ readonly previewUrl: string;
218
+ }
219
+ /**
220
+ * One file pending in the composer. The bytes stay in the browser until the
221
+ * prompt is sent: an image can ride the prompt inline, but a file must be
222
+ * staged through the Host upload route first and then cited by its receipt.
223
+ */
224
+ export interface QaFileDraft {
225
+ readonly kind: "file";
226
+ readonly id: string;
227
+ readonly name: string;
228
+ readonly bytes: number;
229
+ /** Verbatim payload; a pasted blob is a File built from the pasted text. */
230
+ readonly blob: Blob;
231
+ }
232
+ /** Anything the composer may hold before the prompt is sent. */
233
+ export type QaAttachmentDraft = QaImageDraft | QaFileDraft;
234
+ /** A durable image attached to a sent message. */
235
+ export interface QaImageView {
236
+ readonly attachmentId: string;
237
+ readonly mediaType: QaImageMediaType;
238
+ /** Browser-local thumbnail URL, present only on an optimistic message. */
239
+ readonly previewUrl?: string;
240
+ }
241
+ /**
242
+ * A durable file attached to a sent message. The browser never reads these
243
+ * bytes back (the attachment route serves images); the row shows the handle
244
+ * the model resolves, and the Host keeps the verbatim copy.
245
+ */
246
+ export interface QaFileView {
247
+ readonly attachmentId: string;
248
+ readonly name: string;
249
+ readonly bytes: number;
250
+ }
251
+ /** A subagent transcript opened read-only from the agents panel. */
252
+ export interface QaSubagentView {
253
+ readonly id: string;
254
+ readonly title: string;
255
+ }
256
+ /**
257
+ * One tool call waiting for the operator. The browser lists these over its own
258
+ * remote and answers them one by one; nothing here is answered automatically.
259
+ */
260
+ export interface QaPendingApproval {
261
+ readonly id: string;
262
+ /** The chat the request belongs to: a delegated child asks under its root. */
263
+ readonly sessionId: string;
264
+ readonly toolName: string;
265
+ /** The reason the composed gate gave for asking, when it gave one. */
266
+ readonly reason: string | null;
267
+ readonly createdAt: number;
268
+ /** True when a delegated child of the chat made the call. */
269
+ readonly delegated: boolean;
270
+ }
271
+ /**
272
+ * One question waiting for the operator, normalized for the form the QA view
273
+ * renders. The protocol fields are the harness user-questions contract; absent
274
+ * ones become explicit nulls so the browser never branches on undefined.
275
+ */
276
+ export interface QaPendingQuestionItem {
277
+ readonly id: string;
278
+ readonly question: string;
279
+ readonly header: string | null;
280
+ readonly detail: string | null;
281
+ readonly options: readonly QaPendingQuestionOption[];
282
+ readonly multiSelect: boolean;
283
+ }
284
+ export interface QaPendingQuestionOption {
285
+ readonly label: string;
286
+ readonly description: string | null;
287
+ }
288
+ /**
289
+ * One user-questions request parked for the operator. A single request carries
290
+ * every question the model asked in one call, so the card is a form with a
291
+ * pager, not a list of independent prompts.
292
+ */
293
+ export interface QaPendingQuestion {
294
+ readonly id: string;
295
+ /** The chat the request belongs to. */
296
+ readonly sessionId: string;
297
+ readonly questions: readonly QaPendingQuestionItem[];
298
+ readonly createdAt: number;
299
+ }
300
+ /**
301
+ * One message that waits for the agent's next turn. Rows the Host already
302
+ * admitted carry their durable occurrence id, which is what a queue operation
303
+ * addresses; a row still in flight carries a browser id and edits nothing.
304
+ */
305
+ export interface QaQueueRow {
306
+ readonly id: string;
307
+ /** Short single-line text for the strip; newlines are folded away. */
308
+ readonly preview: string;
309
+ /** Full text to edit, or null when the row is not plain text. */
310
+ readonly text: string | null;
311
+ /** Attachments the row carries besides its text. */
312
+ readonly attachments: number;
313
+ /** Set for a local row the Host queue has not echoed back yet. */
314
+ readonly sending: boolean;
315
+ }
316
+ /** What the queue strip may ask the Host to do with one waiting message. */
317
+ export type QaQueueOperation = "edit" | "remove" | "steer";
318
+ /**
319
+ * What `qaSurface/queueStatus` answers: how much of the deployment's request
320
+ * ceiling is in use right now. The Host counts the chats whose agent is running
321
+ * a turn, so the load is read where the whole of it is visible rather than
322
+ * guessed from one browser's view of the stand.
323
+ */
324
+ export interface QaQueueStatus {
325
+ /** The configured ceiling; 0 means the deployment sets none. */
326
+ readonly limit: number;
327
+ /**
328
+ * Turns answering at the moment of the read, this visitor's own included —
329
+ * the stand cannot tell a place it owes someone from one it owes you.
330
+ */
331
+ readonly active: number;
332
+ /** Whether one more turn fits; false while no ceiling is set. */
333
+ readonly full: boolean;
334
+ }
335
+ export interface QaSessionState {
336
+ readonly chatAccess?: import("../chat-sharing/types.js").QaChatAccess;
337
+ readonly phase: QaSessionPhase;
338
+ readonly sessionId: string | null;
339
+ /**
340
+ * Identity of the chat the surface is showing. Unique across every chat the
341
+ * page has opened — a controller that is re-created for a new chat is handed
342
+ * a new identity, so a component keyed by it cannot carry one chat's composer
343
+ * text into another. It is taken only when the chat changes: a draft that
344
+ * creates its session on the first prompt keeps its key, because the composer
345
+ * holds an unsent question in component state, and remounting it on the new
346
+ * session id would throw that text away before the Host has accepted
347
+ * anything. `0` means no chat — see `QA_SESSION_IDLE_STATE`.
348
+ */
349
+ readonly chatKey: number;
350
+ readonly messages: readonly QaMessage[];
351
+ /** Immediate send feedback, kept outside the durable transcript. */
352
+ readonly pendingMessage: QaPendingUserMessage | null;
353
+ readonly error: string | null;
354
+ /**
355
+ * An owner-authorized historical chat whose recorded composition no longer
356
+ * matches the deployment. Its transcript remains visible, but no Host
357
+ * operation may be issued through this binding.
358
+ */
359
+ readonly compatibilityReadOnly?: boolean;
360
+ readonly canSend: boolean;
361
+ readonly canStop: boolean;
362
+ /**
363
+ * Messages waiting for the next turn, oldest first. Sending while the agent
364
+ * runs lands here instead of in the transcript, so the strip beside the
365
+ * composer is the only place the user can still see them.
366
+ */
367
+ readonly queue: readonly QaQueueRow[];
368
+ /** Whether a queue operation may be issued on this binding right now. */
369
+ readonly canEditQueue: boolean;
370
+ /** Bumped whenever this browser's chat index changes (add/forget). */
371
+ readonly chatsRevision: number;
372
+ /** Tool-derived sources of the current chat (web targets and files read). */
373
+ readonly sources: readonly QaSource[];
374
+ readonly sourcesComplete: boolean;
375
+ readonly incompleteSourceOrigins: QaTurnSources["incompleteOrigins"];
376
+ /** Set while the bound session is a subagent watched from the panel. */
377
+ readonly viewingSubagent: QaSubagentView | null;
378
+ /** Tool calls parked for the operator's answer, oldest first. */
379
+ readonly approvals: readonly QaPendingApproval[];
380
+ /** Question requests parked for the operator's answer, oldest first. */
381
+ readonly questions: readonly QaPendingQuestion[];
382
+ /**
383
+ * Set when a send was held back because the stand is already answering as
384
+ * many questions as it allows. The question never left the browser, so this
385
+ * is the whole of what the visitor is told about it; the surface answers with
386
+ * the request-ceiling dialog and the composer keeps the draft. Named apart
387
+ * from `queue`, which is the same chat's list of waiting messages.
388
+ */
389
+ readonly requestQueue: QaQueueStatus | null;
390
+ /** Slash palette state, keyed to the chat this snapshot describes. */
391
+ readonly slash: QaSlashView;
392
+ }
393
+ /** Minimal server-trusted identity exposed to principal-scoped plugins. */
394
+ export interface QaPrincipal {
395
+ readonly userId: string;
396
+ }
397
+ //# sourceMappingURL=session.d.ts.map