@yadsh/dsh-qa-surface 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (380) hide show
  1. package/README.md +206 -11
  2. package/compatibility.json +10 -1
  3. package/cordis.patch.yml +11 -1
  4. package/lib/account-remotes.js +10 -0
  5. package/lib/account-remotes.js.map +1 -1
  6. package/lib/accounts/errors.js.map +1 -1
  7. package/lib/accounts/file.js.map +1 -1
  8. package/lib/accounts/store.js +22 -0
  9. package/lib/accounts/store.js.map +1 -1
  10. package/lib/attestation.js +6 -0
  11. package/lib/attestation.js.map +1 -1
  12. package/lib/client/QaAccountsController.js +29 -0
  13. package/lib/client/QaAccountsController.js.map +1 -1
  14. package/lib/client/QaSessionController.js +205 -61
  15. package/lib/client/QaSessionController.js.map +1 -1
  16. package/lib/client/QaSurface.js +125 -56
  17. package/lib/client/QaSurface.js.map +1 -1
  18. package/lib/client/QaSurfaceGuard.js +96 -0
  19. package/lib/client/QaSurfaceGuard.js.map +1 -0
  20. package/lib/client/QaTranscriptAdapter.js +11 -5
  21. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  22. package/lib/client/attestation.js +14 -2
  23. package/lib/client/attestation.js.map +1 -1
  24. package/lib/client/components/QaChangelog.js +44 -0
  25. package/lib/client/components/QaChangelog.js.map +1 -1
  26. package/lib/client/components/QaComposer.js +1 -1
  27. package/lib/client/components/QaComposer.js.map +1 -1
  28. package/lib/client/components/QaHeader.js +2 -8
  29. package/lib/client/components/QaHeader.js.map +1 -1
  30. package/lib/client/components/QaMessage.js +20 -7
  31. package/lib/client/components/QaMessage.js.map +1 -1
  32. package/lib/client/components/QaModal.js +24 -6
  33. package/lib/client/components/QaModal.js.map +1 -1
  34. package/lib/client/components/QaSidebar.js +2 -6
  35. package/lib/client/components/QaSidebar.js.map +1 -1
  36. package/lib/client/components/QaSourcesPanel.js +6 -5
  37. package/lib/client/components/QaSourcesPanel.js.map +1 -1
  38. package/lib/client/components/QaWidthHandle.js +21 -1
  39. package/lib/client/components/QaWidthHandle.js.map +1 -1
  40. package/lib/client/components/surface-utils.js +2 -0
  41. package/lib/client/components/surface-utils.js.map +1 -1
  42. package/lib/client/index.js +72 -24
  43. package/lib/client/index.js.map +1 -1
  44. package/lib/client/panels/PanelHost.js +209 -0
  45. package/lib/client/panels/PanelHost.js.map +1 -0
  46. package/lib/client/panels/PanelLauncher.js +39 -0
  47. package/lib/client/panels/PanelLauncher.js.map +1 -0
  48. package/lib/client/panels/contract.js +2 -0
  49. package/lib/client/panels/contract.js.map +1 -0
  50. package/lib/client/panels/index.js +2 -0
  51. package/lib/client/panels/index.js.map +1 -0
  52. package/lib/client/panels/registry.js +171 -0
  53. package/lib/client/panels/registry.js.map +1 -0
  54. package/lib/client/project-session-state.js +13 -5
  55. package/lib/client/project-session-state.js.map +1 -1
  56. package/lib/client/settings/card.js +2 -2
  57. package/lib/client/settings/card.js.map +1 -1
  58. package/lib/client/settings/sections/accounts.js +3 -1
  59. package/lib/client/settings/sections/accounts.js.map +1 -1
  60. package/lib/client/settings/sections/documents.js +88 -0
  61. package/lib/client/settings/sections/documents.js.map +1 -0
  62. package/lib/client/settings/sections/interface.js +2 -0
  63. package/lib/client/settings/sections/interface.js.map +1 -1
  64. package/lib/client/settings/sections.js +1 -0
  65. package/lib/client/settings/sections.js.map +1 -1
  66. package/lib/client/settings-extensions/contract.js +2 -0
  67. package/lib/client/settings-extensions/contract.js.map +1 -0
  68. package/lib/client/settings-extensions/index.js +2 -0
  69. package/lib/client/settings-extensions/index.js.map +1 -0
  70. package/lib/client/settings-extensions/registry.js +63 -0
  71. package/lib/client/settings-extensions/registry.js.map +1 -0
  72. package/lib/client/settlement.js +51 -5
  73. package/lib/client/settlement.js.map +1 -1
  74. package/lib/client/source-preview.js +24 -0
  75. package/lib/client/source-preview.js.map +1 -0
  76. package/lib/client/styles.js +158 -32
  77. package/lib/client/styles.js.map +1 -1
  78. package/lib/client/subagent-codenames.js +109 -0
  79. package/lib/client/subagent-codenames.js.map +1 -0
  80. package/lib/client/types.js +2 -0
  81. package/lib/client/types.js.map +1 -1
  82. package/lib/client/user-settings/GeneralSettingsPage.js +13 -0
  83. package/lib/client/user-settings/GeneralSettingsPage.js.map +1 -0
  84. package/lib/client/user-settings/ProfileSettingsPage.js +59 -0
  85. package/lib/client/user-settings/ProfileSettingsPage.js.map +1 -0
  86. package/lib/client/user-settings/SkillCatalog.js +23 -0
  87. package/lib/client/user-settings/SkillCatalog.js.map +1 -0
  88. package/lib/client/user-settings/SkillEditor.js +89 -0
  89. package/lib/client/user-settings/SkillEditor.js.map +1 -0
  90. package/lib/client/user-settings/SkillToolPicker.js +58 -0
  91. package/lib/client/user-settings/SkillToolPicker.js.map +1 -0
  92. package/lib/client/user-settings/SkillsSettingsPage.js +171 -0
  93. package/lib/client/user-settings/SkillsSettingsPage.js.map +1 -0
  94. package/lib/client/user-settings/StartersSettingsPage.js +78 -0
  95. package/lib/client/user-settings/StartersSettingsPage.js.map +1 -0
  96. package/lib/client/user-settings/UserSettingsDialog.js +50 -0
  97. package/lib/client/user-settings/UserSettingsDialog.js.map +1 -0
  98. package/lib/client/user-settings/copy.js +84 -0
  99. package/lib/client/user-settings/copy.js.map +1 -0
  100. package/lib/client/user-settings/draft.js +127 -0
  101. package/lib/client/user-settings/draft.js.map +1 -0
  102. package/lib/client/user-settings/fields.js +24 -0
  103. package/lib/client/user-settings/fields.js.map +1 -0
  104. package/lib/client.js +5554 -1415
  105. package/lib/client.js.map +1 -1
  106. package/lib/config-resolvers/accounts.js +30 -0
  107. package/lib/config-resolvers/accounts.js.map +1 -1
  108. package/lib/config-resolvers/defaults.js +23 -0
  109. package/lib/config-resolvers/defaults.js.map +1 -1
  110. package/lib/config-resolvers/tools.js +37 -0
  111. package/lib/config-resolvers/tools.js.map +1 -0
  112. package/lib/config-resolvers/ui.js +2 -0
  113. package/lib/config-resolvers/ui.js.map +1 -1
  114. package/lib/config.js +288 -0
  115. package/lib/config.js.map +1 -1
  116. package/lib/documents/artifacts/ids.js +43 -0
  117. package/lib/documents/artifacts/ids.js.map +1 -0
  118. package/lib/documents/artifacts/manifest.js +66 -0
  119. package/lib/documents/artifacts/manifest.js.map +1 -0
  120. package/lib/documents/artifacts/store.js +169 -0
  121. package/lib/documents/artifacts/store.js.map +1 -0
  122. package/lib/documents/capabilities.js +93 -0
  123. package/lib/documents/capabilities.js.map +1 -0
  124. package/lib/documents/config.js +302 -0
  125. package/lib/documents/config.js.map +1 -0
  126. package/lib/documents/defaults.js +78 -0
  127. package/lib/documents/defaults.js.map +1 -0
  128. package/lib/documents/errors.js +101 -0
  129. package/lib/documents/errors.js.map +1 -0
  130. package/lib/documents/index.js +80 -0
  131. package/lib/documents/index.js.map +1 -0
  132. package/lib/documents/inspect/facts.js +161 -0
  133. package/lib/documents/inspect/facts.js.map +1 -0
  134. package/lib/documents/inspect/zip.js +108 -0
  135. package/lib/documents/inspect/zip.js.map +1 -0
  136. package/lib/documents/markdown/directives.js +135 -0
  137. package/lib/documents/markdown/directives.js.map +1 -0
  138. package/lib/documents/markdown/frontmatter.js +35 -0
  139. package/lib/documents/markdown/frontmatter.js.map +1 -0
  140. package/lib/documents/markdown/normalize.js +113 -0
  141. package/lib/documents/markdown/normalize.js.map +1 -0
  142. package/lib/documents/orchestrator/assets.js +243 -0
  143. package/lib/documents/orchestrator/assets.js.map +1 -0
  144. package/lib/documents/orchestrator/convert-document.js +186 -0
  145. package/lib/documents/orchestrator/convert-document.js.map +1 -0
  146. package/lib/documents/orchestrator/create-document.js +292 -0
  147. package/lib/documents/orchestrator/create-document.js.map +1 -0
  148. package/lib/documents/orchestrator/extract-document.js +162 -0
  149. package/lib/documents/orchestrator/extract-document.js.map +1 -0
  150. package/lib/documents/orchestrator/inspect-document.js +89 -0
  151. package/lib/documents/orchestrator/inspect-document.js.map +1 -0
  152. package/lib/documents/orchestrator/runtime-deps.js +59 -0
  153. package/lib/documents/orchestrator/runtime-deps.js.map +1 -0
  154. package/lib/documents/orchestrator/scope.js +132 -0
  155. package/lib/documents/orchestrator/scope.js.map +1 -0
  156. package/lib/documents/providers/docling.js +247 -0
  157. package/lib/documents/providers/docling.js.map +1 -0
  158. package/lib/documents/providers/libreoffice.js +130 -0
  159. package/lib/documents/providers/libreoffice.js.map +1 -0
  160. package/lib/documents/providers/markitdown.js +89 -0
  161. package/lib/documents/providers/markitdown.js.map +1 -0
  162. package/lib/documents/providers/pandoc.js +161 -0
  163. package/lib/documents/providers/pandoc.js.map +1 -0
  164. package/lib/documents/providers/process.js +164 -0
  165. package/lib/documents/providers/process.js.map +1 -0
  166. package/lib/documents/providers/registry.js +152 -0
  167. package/lib/documents/providers/registry.js.map +1 -0
  168. package/lib/documents/providers/shared.js +75 -0
  169. package/lib/documents/providers/shared.js.map +1 -0
  170. package/lib/documents/runtime.js +114 -0
  171. package/lib/documents/runtime.js.map +1 -0
  172. package/lib/documents/security/file-types.js +188 -0
  173. package/lib/documents/security/file-types.js.map +1 -0
  174. package/lib/documents/security/limits.js +78 -0
  175. package/lib/documents/security/limits.js.map +1 -0
  176. package/lib/documents/security/mime.js +43 -0
  177. package/lib/documents/security/mime.js.map +1 -0
  178. package/lib/documents/security/paths.js +133 -0
  179. package/lib/documents/security/paths.js.map +1 -0
  180. package/lib/documents/templates/registry.js +147 -0
  181. package/lib/documents/templates/registry.js.map +1 -0
  182. package/lib/documents/templates/resolver.js +59 -0
  183. package/lib/documents/templates/resolver.js.map +1 -0
  184. package/lib/documents/tools/convert.js +125 -0
  185. package/lib/documents/tools/convert.js.map +1 -0
  186. package/lib/documents/tools/create.js +187 -0
  187. package/lib/documents/tools/create.js.map +1 -0
  188. package/lib/documents/tools/index.js +41 -0
  189. package/lib/documents/tools/index.js.map +1 -0
  190. package/lib/documents/tools/inspect.js +135 -0
  191. package/lib/documents/tools/inspect.js.map +1 -0
  192. package/lib/documents/tools/shared.js +88 -0
  193. package/lib/documents/tools/shared.js.map +1 -0
  194. package/lib/documents/tools/to-markdown.js +125 -0
  195. package/lib/documents/tools/to-markdown.js.map +1 -0
  196. package/lib/documents/types.js +12 -0
  197. package/lib/documents/types.js.map +1 -0
  198. package/lib/index.js +231 -22
  199. package/lib/index.js.map +1 -1
  200. package/lib/integration-principals.js +22 -0
  201. package/lib/integration-principals.js.map +1 -0
  202. package/lib/lockdown-policy.js +15 -3
  203. package/lib/lockdown-policy.js.map +1 -1
  204. package/lib/personal-skills/errors.js +9 -0
  205. package/lib/personal-skills/errors.js.map +1 -0
  206. package/lib/personal-skills/host.js +80 -0
  207. package/lib/personal-skills/host.js.map +1 -0
  208. package/lib/personal-skills/index.js +10 -0
  209. package/lib/personal-skills/index.js.map +1 -0
  210. package/lib/personal-skills/paths.js +127 -0
  211. package/lib/personal-skills/paths.js.map +1 -0
  212. package/lib/personal-skills/provider.js +109 -0
  213. package/lib/personal-skills/provider.js.map +1 -0
  214. package/lib/personal-skills/remotes.js +40 -0
  215. package/lib/personal-skills/remotes.js.map +1 -0
  216. package/lib/personal-skills/service.js +686 -0
  217. package/lib/personal-skills/service.js.map +1 -0
  218. package/lib/personal-skills/skill-file.js +278 -0
  219. package/lib/personal-skills/skill-file.js.map +1 -0
  220. package/lib/personal-skills/skill-format.js +202 -0
  221. package/lib/personal-skills/skill-format.js.map +1 -0
  222. package/lib/personal-skills/watcher.js +96 -0
  223. package/lib/personal-skills/watcher.js.map +1 -0
  224. package/lib/profile.js +6 -4
  225. package/lib/profile.js.map +1 -1
  226. package/lib/prompt-notes.js +19 -0
  227. package/lib/prompt-notes.js.map +1 -1
  228. package/lib/provenance/file-preview.js +68 -21
  229. package/lib/provenance/file-preview.js.map +1 -1
  230. package/lib/provenance/host-store.js +44 -11
  231. package/lib/provenance/host-store.js.map +1 -1
  232. package/lib/provenance/index.js +1 -0
  233. package/lib/provenance/index.js.map +1 -1
  234. package/lib/provenance/normalize.js +3 -1
  235. package/lib/provenance/normalize.js.map +1 -1
  236. package/lib/provenance/snapshot-store.js +154 -0
  237. package/lib/provenance/snapshot-store.js.map +1 -0
  238. package/lib/qa-tools/activation-detector.js +53 -0
  239. package/lib/qa-tools/activation-detector.js.map +1 -0
  240. package/lib/qa-tools/activation-manager.js +111 -0
  241. package/lib/qa-tools/activation-manager.js.map +1 -0
  242. package/lib/qa-tools/catalog.js +108 -0
  243. package/lib/qa-tools/catalog.js.map +1 -0
  244. package/lib/qa-tools/durable-marker.js +115 -0
  245. package/lib/qa-tools/durable-marker.js.map +1 -0
  246. package/lib/qa-tools/index.js +83 -0
  247. package/lib/qa-tools/index.js.map +1 -0
  248. package/lib/qa-tools/lifecycle.js +64 -0
  249. package/lib/qa-tools/lifecycle.js.map +1 -0
  250. package/lib/qa-tools/types.js +2 -0
  251. package/lib/qa-tools/types.js.map +1 -0
  252. package/lib/resolve-config.js +5 -0
  253. package/lib/resolve-config.js.map +1 -1
  254. package/lib/secure-session.js +75 -18
  255. package/lib/secure-session.js.map +1 -1
  256. package/lib/starters.js +117 -0
  257. package/lib/starters.js.map +1 -0
  258. package/lib/typert.host.js +767 -22
  259. package/lib/typert.remote-client.d.ts +17 -1
  260. package/lib/typert.remote-client.js +609 -17
  261. package/lib/types/account-remotes.d.ts +3 -1
  262. package/lib/types/accounts/errors.d.ts +1 -1
  263. package/lib/types/accounts/file.d.ts +10 -0
  264. package/lib/types/accounts/store.d.ts +7 -1
  265. package/lib/types/attestation.d.ts +2 -0
  266. package/lib/types/client/QaAccountsController.d.ts +7 -1
  267. package/lib/types/client/QaSessionController.d.ts +14 -0
  268. package/lib/types/client/QaSurface.d.ts +14 -4
  269. package/lib/types/client/QaSurfaceGuard.d.ts +27 -0
  270. package/lib/types/client/QaTranscriptAdapter.d.ts +7 -0
  271. package/lib/types/client/attestation.d.ts +8 -1
  272. package/lib/types/client/components/QaComposer.d.ts +3 -1
  273. package/lib/types/client/components/QaHeader.d.ts +3 -1
  274. package/lib/types/client/components/QaModal.d.ts +5 -4
  275. package/lib/types/client/components/QaSidebar.d.ts +8 -11
  276. package/lib/types/client/components/QaWidthHandle.d.ts +13 -0
  277. package/lib/types/client/index.d.ts +1 -0
  278. package/lib/types/client/panels/PanelHost.d.ts +18 -0
  279. package/lib/types/client/panels/PanelLauncher.d.ts +5 -0
  280. package/lib/types/client/panels/contract.d.ts +83 -0
  281. package/lib/types/client/panels/index.d.ts +3 -0
  282. package/lib/types/client/panels/registry.d.ts +40 -0
  283. package/lib/types/client/project-session-state.d.ts +7 -0
  284. package/lib/types/client/settings/sections/documents.d.ts +13 -0
  285. package/lib/types/client/settings/sections.d.ts +1 -0
  286. package/lib/types/client/settings-extensions/contract.d.ts +32 -0
  287. package/lib/types/client/settings-extensions/index.d.ts +3 -0
  288. package/lib/types/client/settings-extensions/registry.d.ts +15 -0
  289. package/lib/types/client/settlement.d.ts +41 -5
  290. package/lib/types/client/source-preview.d.ts +8 -0
  291. package/lib/types/client/styles.d.ts +2 -0
  292. package/lib/types/client/subagent-codenames.d.ts +18 -0
  293. package/lib/types/client/types.d.ts +35 -3
  294. package/lib/types/client/user-settings/GeneralSettingsPage.d.ts +14 -0
  295. package/lib/types/client/user-settings/ProfileSettingsPage.d.ts +18 -0
  296. package/lib/types/client/user-settings/SkillCatalog.d.ts +16 -0
  297. package/lib/types/client/user-settings/SkillEditor.d.ts +42 -0
  298. package/lib/types/client/user-settings/SkillToolPicker.d.ts +17 -0
  299. package/lib/types/client/user-settings/SkillsSettingsPage.d.ts +15 -0
  300. package/lib/types/client/user-settings/StartersSettingsPage.d.ts +14 -0
  301. package/lib/types/client/user-settings/UserSettingsDialog.d.ts +43 -0
  302. package/lib/types/client/user-settings/copy.d.ts +25 -0
  303. package/lib/types/client/user-settings/draft.d.ts +51 -0
  304. package/lib/types/client/user-settings/fields.d.ts +43 -0
  305. package/lib/types/config-resolvers/tools.d.ts +6 -0
  306. package/lib/types/documents/artifacts/ids.d.ts +14 -0
  307. package/lib/types/documents/artifacts/manifest.d.ts +32 -0
  308. package/lib/types/documents/artifacts/store.d.ts +67 -0
  309. package/lib/types/documents/capabilities.d.ts +32 -0
  310. package/lib/types/documents/config.d.ts +27 -0
  311. package/lib/types/documents/defaults.d.ts +161 -0
  312. package/lib/types/documents/errors.d.ts +42 -0
  313. package/lib/types/documents/index.d.ts +63 -0
  314. package/lib/types/documents/inspect/facts.d.ts +43 -0
  315. package/lib/types/documents/inspect/zip.d.ts +28 -0
  316. package/lib/types/documents/markdown/directives.d.ts +39 -0
  317. package/lib/types/documents/markdown/frontmatter.d.ts +15 -0
  318. package/lib/types/documents/markdown/normalize.d.ts +30 -0
  319. package/lib/types/documents/orchestrator/assets.d.ts +55 -0
  320. package/lib/types/documents/orchestrator/convert-document.d.ts +25 -0
  321. package/lib/types/documents/orchestrator/create-document.d.ts +18 -0
  322. package/lib/types/documents/orchestrator/extract-document.d.ts +24 -0
  323. package/lib/types/documents/orchestrator/inspect-document.d.ts +12 -0
  324. package/lib/types/documents/orchestrator/runtime-deps.d.ts +43 -0
  325. package/lib/types/documents/orchestrator/scope.d.ts +52 -0
  326. package/lib/types/documents/providers/docling.d.ts +54 -0
  327. package/lib/types/documents/providers/libreoffice.d.ts +40 -0
  328. package/lib/types/documents/providers/markitdown.d.ts +28 -0
  329. package/lib/types/documents/providers/pandoc.d.ts +42 -0
  330. package/lib/types/documents/providers/process.d.ts +54 -0
  331. package/lib/types/documents/providers/registry.d.ts +68 -0
  332. package/lib/types/documents/providers/shared.d.ts +27 -0
  333. package/lib/types/documents/runtime.d.ts +59 -0
  334. package/lib/types/documents/security/file-types.d.ts +39 -0
  335. package/lib/types/documents/security/limits.d.ts +24 -0
  336. package/lib/types/documents/security/mime.d.ts +13 -0
  337. package/lib/types/documents/security/paths.d.ts +38 -0
  338. package/lib/types/documents/templates/registry.d.ts +50 -0
  339. package/lib/types/documents/templates/resolver.d.ts +30 -0
  340. package/lib/types/documents/tools/convert.d.ts +9 -0
  341. package/lib/types/documents/tools/create.d.ts +14 -0
  342. package/lib/types/documents/tools/index.d.ts +33 -0
  343. package/lib/types/documents/tools/inspect.d.ts +9 -0
  344. package/lib/types/documents/tools/shared.d.ts +77 -0
  345. package/lib/types/documents/tools/to-markdown.d.ts +12 -0
  346. package/lib/types/documents/types.d.ts +294 -0
  347. package/lib/types/index.d.ts +75 -3
  348. package/lib/types/integration-principals.d.ts +9 -0
  349. package/lib/types/lockdown-policy.d.ts +12 -2
  350. package/lib/types/personal-skills/errors.d.ts +11 -0
  351. package/lib/types/personal-skills/host.d.ts +42 -0
  352. package/lib/types/personal-skills/index.d.ts +10 -0
  353. package/lib/types/personal-skills/paths.d.ts +39 -0
  354. package/lib/types/personal-skills/provider.d.ts +33 -0
  355. package/lib/types/personal-skills/remotes.d.ts +35 -0
  356. package/lib/types/personal-skills/service.d.ts +131 -0
  357. package/lib/types/personal-skills/skill-file.d.ts +64 -0
  358. package/lib/types/personal-skills/skill-format.d.ts +100 -0
  359. package/lib/types/personal-skills/watcher.d.ts +39 -0
  360. package/lib/types/profile.d.ts +13 -0
  361. package/lib/types/prompt-notes.d.ts +9 -0
  362. package/lib/types/provenance/file-preview.d.ts +47 -4
  363. package/lib/types/provenance/host-store.d.ts +7 -1
  364. package/lib/types/provenance/index.d.ts +1 -0
  365. package/lib/types/provenance/snapshot-store.d.ts +23 -0
  366. package/lib/types/qa-tools/activation-detector.d.ts +29 -0
  367. package/lib/types/qa-tools/activation-manager.d.ts +47 -0
  368. package/lib/types/qa-tools/catalog.d.ts +40 -0
  369. package/lib/types/qa-tools/durable-marker.d.ts +16 -0
  370. package/lib/types/qa-tools/index.d.ts +40 -0
  371. package/lib/types/qa-tools/lifecycle.d.ts +44 -0
  372. package/lib/types/qa-tools/types.d.ts +45 -0
  373. package/lib/types/secure-session.d.ts +33 -2
  374. package/lib/types/starters.d.ts +45 -0
  375. package/lib/types/types.d.ts +208 -3
  376. package/package.json +22 -9
  377. package/scripts/repair-session-events.mjs +260 -0
  378. package/lib/client/components/QaProfile.js +0 -64
  379. package/lib/client/components/QaProfile.js.map +0 -1
  380. package/lib/types/client/components/QaProfile.d.ts +0 -25
@@ -0,0 +1,47 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
2
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
3
+ import type { QaToolActivation, QaToolActivationOrigin, QaToolActivationResult, QaToolDescriptor } from "./types.js";
4
+ export interface QaToolActivationManagerOptions {
5
+ /** Live catalog; read per activation so a reload sees the new set. */
6
+ readonly catalog: readonly QaToolDescriptor[];
7
+ readonly catalogVersion: string;
8
+ readonly logger: PluginLogger;
9
+ }
10
+ /**
11
+ * Per-agent runtime ownership of the QA tool registrations.
12
+ *
13
+ * One agent's tools exist only while that agent is live: activation registers
14
+ * the whole catalog through the agent's own scoped context, and disposal
15
+ * unwinds the exact disposers `tools.register()` returned. State is a WeakMap
16
+ * keyed by the live agent, so nothing has to be keyed by id and a stale agent
17
+ * can never be mistaken for a resumed one.
18
+ */
19
+ export declare class QaToolActivationManager implements QaToolActivation {
20
+ private readonly options;
21
+ private readonly states;
22
+ constructor(options: QaToolActivationManagerOptions);
23
+ /**
24
+ * Register the whole catalog on one agent, all or nothing.
25
+ *
26
+ * A failed registration unwinds every tool this attempt registered and leaves
27
+ * the agent inactive: a partially attached QA surface would be worse than
28
+ * none, because the model would see a tool it cannot rely on.
29
+ * @param agent - the live agent receiving the tools.
30
+ * @param origin - why activation ran, for the operator log.
31
+ * @returns the outcome; `failed` carries the original error for the caller to report.
32
+ */
33
+ activate(agent: Agent, origin: QaToolActivationOrigin): QaToolActivationResult;
34
+ /** Whether this agent currently has the QA tools registered. */
35
+ isActive(agent: Agent): boolean;
36
+ /** Names registered on this agent; the admission guard evaluates this per call. */
37
+ activeToolNames(agent: Agent): readonly string[];
38
+ /**
39
+ * Unregister one agent's QA tools and forget its state. Safe to call more
40
+ * than once, and safe for an agent that never activated.
41
+ * @param agent - the agent whose registrations must be unwound.
42
+ */
43
+ disposeAgent(agent: Agent): void;
44
+ /** Dispose in reverse registration order, containing individual failures. */
45
+ private rollback;
46
+ }
47
+ //# sourceMappingURL=activation-manager.d.ts.map
@@ -0,0 +1,40 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
2
+ import type { QaToolDescriptor } from "./types.js";
3
+ /**
4
+ * Deterministic catalog identity. The durable activation marker is derived from
5
+ * the session log rather than stored, so this version is not compared against a
6
+ * persisted record; it is reported by `qa_tools_selfcheck` and by the operator
7
+ * log so a catalog change is visible in a running deployment.
8
+ *
9
+ * Bump it whenever the catalog's tool set or their schemas change.
10
+ */
11
+ export declare const QA_TOOL_CATALOG_VERSION = "1";
12
+ /** One QA tool reports the activation state of whichever agent calls it. */
13
+ export interface QaToolsSelfcheckDeps {
14
+ readonly catalogVersion: string;
15
+ readonly activationMode: string;
16
+ /** Names the catalog contributes, in catalog order. */
17
+ readonly catalogTools: () => readonly string[];
18
+ /** Names currently registered on the calling agent. */
19
+ readonly activeTools: (agent: Agent) => readonly string[];
20
+ /** Whether the calling agent's session shows the activation skill was loaded. */
21
+ readonly skillLoaded: (agent: Agent) => boolean;
22
+ }
23
+ /**
24
+ * Build the shipped QA tool catalog.
25
+ *
26
+ * Side-effect free: constructing it registers nothing with `ctx.tools`. The
27
+ * activation manager owns every registration.
28
+ */
29
+ export declare function createQaToolCatalog(deps: QaToolsSelfcheckDeps): readonly QaToolDescriptor[];
30
+ /** QA tool names, in catalog order; the admission gate treats them as dynamic. */
31
+ export declare function qaToolNames(catalog: readonly QaToolDescriptor[]): string[];
32
+ /**
33
+ * Validate the catalog before it is registered anywhere: names must be unique
34
+ * and non-empty. Called once at activation preflight so a broken catalog fails
35
+ * before the first registration rather than halfway through.
36
+ * @param catalog - descriptors to validate.
37
+ * @throws when two descriptors share a name or a name is empty.
38
+ */
39
+ export declare function assertValidQaToolCatalog(catalog: readonly QaToolDescriptor[]): void;
40
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { Session } from "@deepseek-ai/dsh-session";
2
+ /**
3
+ * Whether one session's log shows the configured skill was successfully loaded.
4
+ *
5
+ * Pairs each `tool/call` for the `skill` tool with its `tool/result`, then reads
6
+ * the loaded skill's name from the canonical rendered content. The rendered
7
+ * block is the only record of the returned skill identity that survives to the
8
+ * log — `tool/result` stores the model-facing message, not the tool's canonical
9
+ * value — and the pair closes only on a non-error result, so a refused or
10
+ * failed load never counts.
11
+ * @param session - the live session to inspect.
12
+ * @param skillName - the configured activation skill name.
13
+ * @returns whether that skill was loaded and its result succeeded.
14
+ */
15
+ export declare function sessionLoadedSkill(session: Pick<Session, "snapshotEvents">, skillName: string): boolean;
16
+ //# sourceMappingURL=durable-marker.d.ts.map
@@ -0,0 +1,40 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
2
+ import type { Context } from "@deepseek-ai/cordis";
3
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
4
+ import type { QaToolActivation } from "./types.js";
5
+ export interface QaToolsOptions {
6
+ readonly logger: PluginLogger;
7
+ readonly dynamicActivation: boolean;
8
+ readonly activationSkill: string;
9
+ readonly activationMode: string;
10
+ readonly activationPresets: readonly string[];
11
+ }
12
+ /**
13
+ * The QA tool subsystem: one catalog, one per-agent activation manager, and the
14
+ * two edges that drive it — the skill-result detector and the agent lifecycle.
15
+ *
16
+ * `dsh-qa-surface` owns the tools but never registers them at boot. Nothing in
17
+ * the catalog reaches the model until an agent it belongs to loads the
18
+ * activation skill, so the initial request of a session carries only the
19
+ * composition's own schemas.
20
+ */
21
+ export declare class QaTools implements QaToolActivation {
22
+ private readonly ctx;
23
+ private readonly options;
24
+ private readonly manager;
25
+ private readonly detector;
26
+ private readonly lifecycle;
27
+ private readonly catalogTools;
28
+ constructor(ctx: Context, options: QaToolsOptions);
29
+ /** Names currently registered on one agent; the admission guard reads this per call. */
30
+ activeToolNames(agent: Agent): readonly string[];
31
+ dispose(): void;
32
+ /**
33
+ * The preset gate. An empty `activationPresets` leaves it open, which is only
34
+ * coherent when this plugin serves a single agent composition; naming the QA
35
+ * preset keeps an unrelated DSH agent from unlocking the same catalog by
36
+ * loading a skill of the same name.
37
+ */
38
+ private isManagedAgent;
39
+ }
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,44 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
2
+ import type { Context } from "@deepseek-ai/cordis";
3
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
4
+ import type { QaToolActivationManager } from "./activation-manager.js";
5
+ export interface QaToolActivationLifecycleOptions {
6
+ readonly manager: QaToolActivationManager;
7
+ readonly logger: PluginLogger;
8
+ /** Whether this agent's composition participates in QA tool activation. */
9
+ readonly isManagedAgent: (agent: Agent) => boolean;
10
+ /**
11
+ * `true` waits for the activation skill; `false` attaches the catalog to
12
+ * every managed agent as soon as it is created.
13
+ */
14
+ readonly dynamicActivation: boolean;
15
+ /** The skill name whose load unlocks the tools in dynamic mode. */
16
+ readonly activationSkill: string;
17
+ }
18
+ /**
19
+ * Owns the arrival and departure edges of one agent's QA tool surface.
20
+ *
21
+ * Arrival: in dynamic mode a resumed session is recognized by the durable
22
+ * marker in its own log and gets its current catalog back before the first
23
+ * model step, while a fresh session waits for the detector. In immediate mode
24
+ * every managed agent is served at creation.
25
+ *
26
+ * Departure: the exact registrations this plugin made are unwound when the
27
+ * agent is disposed, so an agent that leaves never leaves a scoped tool behind.
28
+ */
29
+ export declare class QaToolActivationLifecycle {
30
+ private readonly ctx;
31
+ private readonly options;
32
+ private readonly disposers;
33
+ constructor(ctx: Context, options: QaToolActivationLifecycleOptions);
34
+ /**
35
+ * Restore a resumed activation, or attach immediately in the compatibility
36
+ * mode. A fresh managed session ends this handler inactive by design: the
37
+ * tools arrive when the model loads the activation skill.
38
+ */
39
+ private onAgentCreated;
40
+ private attach;
41
+ private onAgentDisposed;
42
+ dispose(): void;
43
+ }
44
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1,45 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
2
+ import type { ToolDefinition } from "@deepseek-ai/dsh-tools";
3
+ /**
4
+ * One entry of the QA tool catalog.
5
+ *
6
+ * `group` and `tags` are passive metadata: the MVP activation policy activates
7
+ * the whole catalog and never filters on them. They exist so a later
8
+ * `activationMode` can select subsets without touching the tool definitions.
9
+ */
10
+ export interface QaToolDescriptor {
11
+ readonly definition: ToolDefinition;
12
+ /** Capability bucket reserved for a future grouped activation mode. */
13
+ readonly group?: string;
14
+ /** Free-form labels reserved for a future search/unlock mode. */
15
+ readonly tags?: readonly string[];
16
+ }
17
+ /** Why one activation ran; the origin only shapes logging and the event guard. */
18
+ export type QaToolActivationOrigin = "skill" | "restore" | "immediate";
19
+ /** Runtime activation state of one live agent. */
20
+ export interface QaToolActivationState {
21
+ status: "inactive" | "activating" | "active";
22
+ /** Catalog version whose tools are registered; set once `status` is active. */
23
+ catalogVersion?: string | undefined;
24
+ /** Exact disposers returned by `tools.register()`, in registration order. */
25
+ disposers: (() => void)[];
26
+ }
27
+ /** Outcome of one activation attempt. */
28
+ export type QaToolActivationResult = {
29
+ readonly status: "activated";
30
+ readonly count: number;
31
+ } | {
32
+ readonly status: "already-active";
33
+ } | {
34
+ readonly status: "failed";
35
+ readonly error: unknown;
36
+ };
37
+ /** The activation subsystem's observable surface, injected into the admission gate. */
38
+ export interface QaToolActivation {
39
+ /**
40
+ * Names currently registered on one live agent. The admission guard evaluates
41
+ * this per execution, so a tool becomes callable exactly when it appears here.
42
+ */
43
+ activeToolNames(agent: Agent): readonly string[];
44
+ }
45
+ //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,4 @@
1
+ import type { Agent } from "@deepseek-ai/dsh-agent";
1
2
  import type { Context } from "@deepseek-ai/cordis";
2
3
  import type { PluginLogger } from "@yadsh/dsh-plugin-log";
3
4
  import type { QaLockdownProof, ResolvedQaSurfaceConfig } from "./types.js";
@@ -25,7 +26,15 @@ export declare class QaPolicyAdmission {
25
26
  private readonly config;
26
27
  private readonly logger;
27
28
  private readonly accounts?;
29
+ /**
30
+ * Names the QA tool catalog attached to one agent after its activation
31
+ * skill loaded. Read per execution, so a tool becomes callable exactly when
32
+ * it is registered and stops being callable once the agent is disposed.
33
+ */
34
+ private readonly dynamicToolNames;
28
35
  private readonly appliedPolicies;
36
+ /** Host-trusted principal-scoped plugin tools enabled outside static config. */
37
+ private readonly principalScopedTools;
29
38
  /**
30
39
  * Sessions the QA surface has attested. The provenance note is written for
31
40
  * exactly these, and a delegated child resolves through its root session, so
@@ -34,15 +43,35 @@ export declare class QaPolicyAdmission {
34
43
  private readonly attested;
35
44
  private readonly workspaceAccess;
36
45
  private readonly disposeWorkspaceGuard;
37
- constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig, logger: PluginLogger, accounts?: QaAccountsGate | undefined);
46
+ constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig, logger: PluginLogger, accounts?: QaAccountsGate | undefined,
47
+ /**
48
+ * Names the QA tool catalog attached to one agent after its activation
49
+ * skill loaded. Read per execution, so a tool becomes callable exactly when
50
+ * it is registered and stops being callable once the agent is disposed.
51
+ */
52
+ dynamicToolNames?: (agent: Agent) => readonly string[]);
53
+ /**
54
+ * Add tools whose own executor resolves the QA principal server-side.
55
+ * Enabling the contributing plugin is the operator decision; model arguments
56
+ * still cannot select an owner. The returned disposer mirrors tool lifetime.
57
+ */
58
+ registerPrincipalScopedTools(names: readonly string[]): () => void;
59
+ /**
60
+ * Validate deployment-owned facts before a Host session is materialized.
61
+ * Agent-scoped facts (preset composition and tools) remain in secureSession,
62
+ * but a missing Workspace or mismatched permission preset must not leave a
63
+ * newly-created, permanently unusable chat behind.
64
+ */
65
+ preflightDeployment(): void;
38
66
  /**
39
67
  * The mounted attachment store's verbatim root, when the backend exposes
40
68
  * one. It sits outside every workspace, so the per-user fence would
41
69
  * otherwise deny the model the exact file an upload produced and the prompt
42
70
  * points it at. A backend without a resolvable root simply keeps the fence
43
71
  * closed — attachments then only work where reads are not fenced per user.
72
+ * Source preview asks for the same root, so one upload is readable by both.
44
73
  */
45
- private attachmentRoot;
74
+ attachmentRoot(): string | undefined;
46
75
  /**
47
76
  * The live agent for one session, resuming a Session the Host has not
48
77
  * materialized in this process.
@@ -63,6 +92,8 @@ export declare class QaPolicyAdmission {
63
92
  */
64
93
  private liveAgent;
65
94
  secureSession(token: string, sessionId: string): Promise<QaLockdownProof>;
95
+ /** Resolve the deployment facts shared by creation and full attestation. */
96
+ private deploymentPins;
66
97
  /**
67
98
  * Whether one session went through this boundary. The provenance note is
68
99
  * written only for attested sessions, which is what keeps a deployment's
@@ -0,0 +1,45 @@
1
+ import type { QaAccountStarters, QaAccountStartersInput, QaAccountStarter } from "./types.js";
2
+ /**
3
+ * Per-account starter messages: the labeled buttons above an empty composer,
4
+ * and what each of them sends. Shape, limits, and the normalization both
5
+ * halves of the plugin agree on. Deliberately free of Node built-ins — the
6
+ * accounts store and the browser-side form import these same rules, the same
7
+ * way profile.ts does for the self-declared identity.
8
+ */
9
+ /** Most starter buttons one account may store. */
10
+ export declare const QA_STARTERS_MAX_ITEMS = 12;
11
+ /** Longest accepted button label. */
12
+ export declare const QA_STARTERS_MAX_LABEL = 80;
13
+ /** Longest accepted prompt one button sends. */
14
+ export declare const QA_STARTERS_MAX_PROMPT = 2000;
15
+ /** The starters of an account that never customized them. */
16
+ export declare function emptyStarters(): QaAccountStarters;
17
+ /**
18
+ * Read one stored (or wire-delivered) starters record into its public shape.
19
+ * Unknown or hand-edited input degrades to the readable subset instead of
20
+ * throwing, mirroring the profile read path: a malformed record must never
21
+ * cost the account its session.
22
+ */
23
+ export declare function normalizeStarters(value: unknown): QaAccountStarters;
24
+ /** Validated starters values, before the store persists them. */
25
+ export type QaStartersWrite = QaAccountStartersInput;
26
+ export type QaStartersWriteResult = {
27
+ readonly ok: true;
28
+ readonly value: QaStartersWrite;
29
+ } | {
30
+ readonly ok: false;
31
+ readonly message: string;
32
+ };
33
+ /**
34
+ * Validate one full-replace starters write. Values are cleaned the same way
35
+ * the read path cleans them, but limits are refused with a message instead of
36
+ * truncated, so a user pasting an essay learns why it was not stored.
37
+ */
38
+ export declare function validateStartersWrite(input: unknown): QaStartersWriteResult;
39
+ /**
40
+ * The buttons an empty composer shows: the account's own starters first,
41
+ * then the deployment's suggestions unless the account hid them. An anonymous
42
+ * visitor (no starters of their own) sees exactly the deployment's list.
43
+ */
44
+ export declare function effectiveQuickQuestions(own: QaAccountStarters | undefined, defaults: readonly string[]): readonly QaAccountStarter[];
45
+ //# sourceMappingURL=starters.d.ts.map