@yadsh/dsh-qa-surface 0.4.0 → 0.6.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 (421) hide show
  1. package/README.md +235 -14
  2. package/compatibility.json +10 -1
  3. package/cordis.patch.yml +17 -0
  4. package/lib/account-remotes.js +10 -0
  5. package/lib/account-remotes.js.map +1 -1
  6. package/lib/accounts/credentials.js +12 -4
  7. package/lib/accounts/credentials.js.map +1 -1
  8. package/lib/accounts/errors.js.map +1 -1
  9. package/lib/accounts/file.js.map +1 -1
  10. package/lib/accounts/store.js +38 -1
  11. package/lib/accounts/store.js.map +1 -1
  12. package/lib/approvals.js +179 -0
  13. package/lib/approvals.js.map +1 -0
  14. package/lib/cli.js +10 -0
  15. package/lib/cli.js.map +1 -1
  16. package/lib/client/QaAccountsController.js +29 -0
  17. package/lib/client/QaAccountsController.js.map +1 -1
  18. package/lib/client/QaSessionController.js +261 -48
  19. package/lib/client/QaSessionController.js.map +1 -1
  20. package/lib/client/QaSurface.js +138 -56
  21. package/lib/client/QaSurface.js.map +1 -1
  22. package/lib/client/QaSurfaceGuard.js +96 -0
  23. package/lib/client/QaSurfaceGuard.js.map +1 -0
  24. package/lib/client/QaTranscriptAdapter.js +11 -5
  25. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  26. package/lib/client/approvals.js +104 -0
  27. package/lib/client/approvals.js.map +1 -0
  28. package/lib/client/attestation.js +3 -0
  29. package/lib/client/attestation.js.map +1 -1
  30. package/lib/client/components/QaApproval.js +23 -0
  31. package/lib/client/components/QaApproval.js.map +1 -0
  32. package/lib/client/components/QaChangelog.js +55 -0
  33. package/lib/client/components/QaChangelog.js.map +1 -1
  34. package/lib/client/components/QaComposer.js +1 -1
  35. package/lib/client/components/QaComposer.js.map +1 -1
  36. package/lib/client/components/QaHeader.js +2 -8
  37. package/lib/client/components/QaHeader.js.map +1 -1
  38. package/lib/client/components/QaMessage.js +20 -7
  39. package/lib/client/components/QaMessage.js.map +1 -1
  40. package/lib/client/components/QaModal.js +24 -6
  41. package/lib/client/components/QaModal.js.map +1 -1
  42. package/lib/client/components/QaQuestions.js +96 -0
  43. package/lib/client/components/QaQuestions.js.map +1 -0
  44. package/lib/client/components/QaSidebar.js +2 -6
  45. package/lib/client/components/QaSidebar.js.map +1 -1
  46. package/lib/client/components/QaSourcesPanel.js +6 -5
  47. package/lib/client/components/QaSourcesPanel.js.map +1 -1
  48. package/lib/client/components/QaWidthHandle.js +21 -1
  49. package/lib/client/components/QaWidthHandle.js.map +1 -1
  50. package/lib/client/components/surface-utils.js +2 -0
  51. package/lib/client/components/surface-utils.js.map +1 -1
  52. package/lib/client/index.js +81 -22
  53. package/lib/client/index.js.map +1 -1
  54. package/lib/client/panels/PanelHost.js +209 -0
  55. package/lib/client/panels/PanelHost.js.map +1 -0
  56. package/lib/client/panels/PanelLauncher.js +39 -0
  57. package/lib/client/panels/PanelLauncher.js.map +1 -0
  58. package/lib/client/panels/contract.js +2 -0
  59. package/lib/client/panels/contract.js.map +1 -0
  60. package/lib/client/panels/index.js +2 -0
  61. package/lib/client/panels/index.js.map +1 -0
  62. package/lib/client/panels/registry.js +171 -0
  63. package/lib/client/panels/registry.js.map +1 -0
  64. package/lib/client/project-session-state.js +8 -3
  65. package/lib/client/project-session-state.js.map +1 -1
  66. package/lib/client/questions.js +114 -0
  67. package/lib/client/questions.js.map +1 -0
  68. package/lib/client/settings/card.js +2 -2
  69. package/lib/client/settings/card.js.map +1 -1
  70. package/lib/client/settings/sections/accounts.js +3 -1
  71. package/lib/client/settings/sections/accounts.js.map +1 -1
  72. package/lib/client/settings/sections/documents.js +88 -0
  73. package/lib/client/settings/sections/documents.js.map +1 -0
  74. package/lib/client/settings/sections/interface.js +2 -0
  75. package/lib/client/settings/sections/interface.js.map +1 -1
  76. package/lib/client/settings/sections/sources.js +2 -0
  77. package/lib/client/settings/sections/sources.js.map +1 -1
  78. package/lib/client/settings/sections.js +1 -0
  79. package/lib/client/settings/sections.js.map +1 -1
  80. package/lib/client/settings-extensions/contract.js +2 -0
  81. package/lib/client/settings-extensions/contract.js.map +1 -0
  82. package/lib/client/settings-extensions/index.js +2 -0
  83. package/lib/client/settings-extensions/index.js.map +1 -0
  84. package/lib/client/settings-extensions/registry.js +63 -0
  85. package/lib/client/settings-extensions/registry.js.map +1 -0
  86. package/lib/client/settlement.js +51 -5
  87. package/lib/client/settlement.js.map +1 -1
  88. package/lib/client/source-preview.js +24 -0
  89. package/lib/client/source-preview.js.map +1 -0
  90. package/lib/client/styles.js +199 -32
  91. package/lib/client/styles.js.map +1 -1
  92. package/lib/client/subagent-codenames.js +109 -0
  93. package/lib/client/subagent-codenames.js.map +1 -0
  94. package/lib/client/types.js +3 -0
  95. package/lib/client/types.js.map +1 -1
  96. package/lib/client/user-settings/GeneralSettingsPage.js +13 -0
  97. package/lib/client/user-settings/GeneralSettingsPage.js.map +1 -0
  98. package/lib/client/user-settings/ProfileSettingsPage.js +59 -0
  99. package/lib/client/user-settings/ProfileSettingsPage.js.map +1 -0
  100. package/lib/client/user-settings/SkillCatalog.js +23 -0
  101. package/lib/client/user-settings/SkillCatalog.js.map +1 -0
  102. package/lib/client/user-settings/SkillEditor.js +89 -0
  103. package/lib/client/user-settings/SkillEditor.js.map +1 -0
  104. package/lib/client/user-settings/SkillToolPicker.js +58 -0
  105. package/lib/client/user-settings/SkillToolPicker.js.map +1 -0
  106. package/lib/client/user-settings/SkillsSettingsPage.js +171 -0
  107. package/lib/client/user-settings/SkillsSettingsPage.js.map +1 -0
  108. package/lib/client/user-settings/StartersSettingsPage.js +78 -0
  109. package/lib/client/user-settings/StartersSettingsPage.js.map +1 -0
  110. package/lib/client/user-settings/UserSettingsDialog.js +50 -0
  111. package/lib/client/user-settings/UserSettingsDialog.js.map +1 -0
  112. package/lib/client/user-settings/copy.js +84 -0
  113. package/lib/client/user-settings/copy.js.map +1 -0
  114. package/lib/client/user-settings/draft.js +127 -0
  115. package/lib/client/user-settings/draft.js.map +1 -0
  116. package/lib/client/user-settings/fields.js +24 -0
  117. package/lib/client/user-settings/fields.js.map +1 -0
  118. package/lib/client.js +6629 -1579
  119. package/lib/client.js.map +1 -1
  120. package/lib/config-resolvers/accounts.js +30 -0
  121. package/lib/config-resolvers/accounts.js.map +1 -1
  122. package/lib/config-resolvers/basics.js +4 -2
  123. package/lib/config-resolvers/basics.js.map +1 -1
  124. package/lib/config-resolvers/defaults.js +27 -0
  125. package/lib/config-resolvers/defaults.js.map +1 -1
  126. package/lib/config-resolvers/lockdown.js +11 -0
  127. package/lib/config-resolvers/lockdown.js.map +1 -1
  128. package/lib/config-resolvers/session.js +2 -2
  129. package/lib/config-resolvers/session.js.map +1 -1
  130. package/lib/config-resolvers/shared.js +9 -0
  131. package/lib/config-resolvers/shared.js.map +1 -1
  132. package/lib/config-resolvers/sources.js +2 -0
  133. package/lib/config-resolvers/sources.js.map +1 -1
  134. package/lib/config-resolvers/tools.js +37 -0
  135. package/lib/config-resolvers/tools.js.map +1 -0
  136. package/lib/config-resolvers/ui.js +2 -0
  137. package/lib/config-resolvers/ui.js.map +1 -1
  138. package/lib/config.js +299 -2
  139. package/lib/config.js.map +1 -1
  140. package/lib/documents/artifacts/ids.js +43 -0
  141. package/lib/documents/artifacts/ids.js.map +1 -0
  142. package/lib/documents/artifacts/manifest.js +66 -0
  143. package/lib/documents/artifacts/manifest.js.map +1 -0
  144. package/lib/documents/artifacts/store.js +169 -0
  145. package/lib/documents/artifacts/store.js.map +1 -0
  146. package/lib/documents/capabilities.js +93 -0
  147. package/lib/documents/capabilities.js.map +1 -0
  148. package/lib/documents/config.js +302 -0
  149. package/lib/documents/config.js.map +1 -0
  150. package/lib/documents/defaults.js +78 -0
  151. package/lib/documents/defaults.js.map +1 -0
  152. package/lib/documents/errors.js +101 -0
  153. package/lib/documents/errors.js.map +1 -0
  154. package/lib/documents/index.js +80 -0
  155. package/lib/documents/index.js.map +1 -0
  156. package/lib/documents/inspect/facts.js +161 -0
  157. package/lib/documents/inspect/facts.js.map +1 -0
  158. package/lib/documents/inspect/zip.js +108 -0
  159. package/lib/documents/inspect/zip.js.map +1 -0
  160. package/lib/documents/markdown/directives.js +135 -0
  161. package/lib/documents/markdown/directives.js.map +1 -0
  162. package/lib/documents/markdown/frontmatter.js +35 -0
  163. package/lib/documents/markdown/frontmatter.js.map +1 -0
  164. package/lib/documents/markdown/normalize.js +113 -0
  165. package/lib/documents/markdown/normalize.js.map +1 -0
  166. package/lib/documents/orchestrator/assets.js +243 -0
  167. package/lib/documents/orchestrator/assets.js.map +1 -0
  168. package/lib/documents/orchestrator/convert-document.js +186 -0
  169. package/lib/documents/orchestrator/convert-document.js.map +1 -0
  170. package/lib/documents/orchestrator/create-document.js +292 -0
  171. package/lib/documents/orchestrator/create-document.js.map +1 -0
  172. package/lib/documents/orchestrator/extract-document.js +162 -0
  173. package/lib/documents/orchestrator/extract-document.js.map +1 -0
  174. package/lib/documents/orchestrator/inspect-document.js +89 -0
  175. package/lib/documents/orchestrator/inspect-document.js.map +1 -0
  176. package/lib/documents/orchestrator/runtime-deps.js +59 -0
  177. package/lib/documents/orchestrator/runtime-deps.js.map +1 -0
  178. package/lib/documents/orchestrator/scope.js +132 -0
  179. package/lib/documents/orchestrator/scope.js.map +1 -0
  180. package/lib/documents/providers/docling.js +247 -0
  181. package/lib/documents/providers/docling.js.map +1 -0
  182. package/lib/documents/providers/libreoffice.js +130 -0
  183. package/lib/documents/providers/libreoffice.js.map +1 -0
  184. package/lib/documents/providers/markitdown.js +89 -0
  185. package/lib/documents/providers/markitdown.js.map +1 -0
  186. package/lib/documents/providers/pandoc.js +161 -0
  187. package/lib/documents/providers/pandoc.js.map +1 -0
  188. package/lib/documents/providers/process.js +164 -0
  189. package/lib/documents/providers/process.js.map +1 -0
  190. package/lib/documents/providers/registry.js +152 -0
  191. package/lib/documents/providers/registry.js.map +1 -0
  192. package/lib/documents/providers/shared.js +75 -0
  193. package/lib/documents/providers/shared.js.map +1 -0
  194. package/lib/documents/runtime.js +114 -0
  195. package/lib/documents/runtime.js.map +1 -0
  196. package/lib/documents/security/file-types.js +188 -0
  197. package/lib/documents/security/file-types.js.map +1 -0
  198. package/lib/documents/security/limits.js +78 -0
  199. package/lib/documents/security/limits.js.map +1 -0
  200. package/lib/documents/security/mime.js +43 -0
  201. package/lib/documents/security/mime.js.map +1 -0
  202. package/lib/documents/security/paths.js +133 -0
  203. package/lib/documents/security/paths.js.map +1 -0
  204. package/lib/documents/templates/registry.js +147 -0
  205. package/lib/documents/templates/registry.js.map +1 -0
  206. package/lib/documents/templates/resolver.js +59 -0
  207. package/lib/documents/templates/resolver.js.map +1 -0
  208. package/lib/documents/tools/convert.js +125 -0
  209. package/lib/documents/tools/convert.js.map +1 -0
  210. package/lib/documents/tools/create.js +187 -0
  211. package/lib/documents/tools/create.js.map +1 -0
  212. package/lib/documents/tools/index.js +41 -0
  213. package/lib/documents/tools/index.js.map +1 -0
  214. package/lib/documents/tools/inspect.js +135 -0
  215. package/lib/documents/tools/inspect.js.map +1 -0
  216. package/lib/documents/tools/shared.js +88 -0
  217. package/lib/documents/tools/shared.js.map +1 -0
  218. package/lib/documents/tools/to-markdown.js +125 -0
  219. package/lib/documents/tools/to-markdown.js.map +1 -0
  220. package/lib/documents/types.js +12 -0
  221. package/lib/documents/types.js.map +1 -0
  222. package/lib/index.js +299 -24
  223. package/lib/index.js.map +1 -1
  224. package/lib/integration-principals.js +22 -0
  225. package/lib/integration-principals.js.map +1 -0
  226. package/lib/lockdown-policy.js +15 -3
  227. package/lib/lockdown-policy.js.map +1 -1
  228. package/lib/personal-skills/errors.js +9 -0
  229. package/lib/personal-skills/errors.js.map +1 -0
  230. package/lib/personal-skills/host.js +80 -0
  231. package/lib/personal-skills/host.js.map +1 -0
  232. package/lib/personal-skills/index.js +10 -0
  233. package/lib/personal-skills/index.js.map +1 -0
  234. package/lib/personal-skills/paths.js +127 -0
  235. package/lib/personal-skills/paths.js.map +1 -0
  236. package/lib/personal-skills/provider.js +109 -0
  237. package/lib/personal-skills/provider.js.map +1 -0
  238. package/lib/personal-skills/remotes.js +40 -0
  239. package/lib/personal-skills/remotes.js.map +1 -0
  240. package/lib/personal-skills/service.js +686 -0
  241. package/lib/personal-skills/service.js.map +1 -0
  242. package/lib/personal-skills/skill-file.js +278 -0
  243. package/lib/personal-skills/skill-file.js.map +1 -0
  244. package/lib/personal-skills/skill-format.js +202 -0
  245. package/lib/personal-skills/skill-format.js.map +1 -0
  246. package/lib/personal-skills/watcher.js +96 -0
  247. package/lib/personal-skills/watcher.js.map +1 -0
  248. package/lib/profile.js +6 -4
  249. package/lib/profile.js.map +1 -1
  250. package/lib/prompt-notes.js +19 -0
  251. package/lib/prompt-notes.js.map +1 -1
  252. package/lib/provenance/file-preview.js +68 -21
  253. package/lib/provenance/file-preview.js.map +1 -1
  254. package/lib/provenance/host-store.js +69 -20
  255. package/lib/provenance/host-store.js.map +1 -1
  256. package/lib/provenance/index.js +1 -0
  257. package/lib/provenance/index.js.map +1 -1
  258. package/lib/provenance/normalize.js +3 -1
  259. package/lib/provenance/normalize.js.map +1 -1
  260. package/lib/provenance/reported.js +37 -12
  261. package/lib/provenance/reported.js.map +1 -1
  262. package/lib/provenance/snapshot-store.js +154 -0
  263. package/lib/provenance/snapshot-store.js.map +1 -0
  264. package/lib/qa-tools/activation-detector.js +53 -0
  265. package/lib/qa-tools/activation-detector.js.map +1 -0
  266. package/lib/qa-tools/activation-manager.js +111 -0
  267. package/lib/qa-tools/activation-manager.js.map +1 -0
  268. package/lib/qa-tools/catalog.js +108 -0
  269. package/lib/qa-tools/catalog.js.map +1 -0
  270. package/lib/qa-tools/durable-marker.js +115 -0
  271. package/lib/qa-tools/durable-marker.js.map +1 -0
  272. package/lib/qa-tools/index.js +83 -0
  273. package/lib/qa-tools/index.js.map +1 -0
  274. package/lib/qa-tools/lifecycle.js +64 -0
  275. package/lib/qa-tools/lifecycle.js.map +1 -0
  276. package/lib/qa-tools/types.js +2 -0
  277. package/lib/qa-tools/types.js.map +1 -0
  278. package/lib/questions.js +185 -0
  279. package/lib/questions.js.map +1 -0
  280. package/lib/resolve-config.js +5 -0
  281. package/lib/resolve-config.js.map +1 -1
  282. package/lib/secure-session.js +104 -20
  283. package/lib/secure-session.js.map +1 -1
  284. package/lib/session-ownership.js +55 -0
  285. package/lib/session-ownership.js.map +1 -0
  286. package/lib/starters.js +117 -0
  287. package/lib/starters.js.map +1 -0
  288. package/lib/typert.host.js +1162 -77
  289. package/lib/typert.remote-client.d.ts +27 -1
  290. package/lib/typert.remote-client.js +879 -14
  291. package/lib/types/account-remotes.d.ts +3 -1
  292. package/lib/types/accounts/credentials.d.ts +6 -0
  293. package/lib/types/accounts/errors.d.ts +1 -1
  294. package/lib/types/accounts/file.d.ts +10 -0
  295. package/lib/types/accounts/store.d.ts +15 -1
  296. package/lib/types/approvals.d.ts +65 -0
  297. package/lib/types/client/QaAccountsController.d.ts +7 -1
  298. package/lib/types/client/QaSessionController.d.ts +50 -1
  299. package/lib/types/client/QaSurface.d.ts +21 -4
  300. package/lib/types/client/QaSurfaceGuard.d.ts +27 -0
  301. package/lib/types/client/QaTranscriptAdapter.d.ts +7 -0
  302. package/lib/types/client/approvals.d.ts +39 -0
  303. package/lib/types/client/components/QaApproval.d.ts +13 -0
  304. package/lib/types/client/components/QaComposer.d.ts +3 -1
  305. package/lib/types/client/components/QaHeader.d.ts +3 -1
  306. package/lib/types/client/components/QaModal.d.ts +5 -4
  307. package/lib/types/client/components/QaQuestions.d.ts +13 -0
  308. package/lib/types/client/components/QaSidebar.d.ts +8 -11
  309. package/lib/types/client/components/QaWidthHandle.d.ts +13 -0
  310. package/lib/types/client/index.d.ts +1 -0
  311. package/lib/types/client/panels/PanelHost.d.ts +18 -0
  312. package/lib/types/client/panels/PanelLauncher.d.ts +5 -0
  313. package/lib/types/client/panels/contract.d.ts +83 -0
  314. package/lib/types/client/panels/index.d.ts +3 -0
  315. package/lib/types/client/panels/registry.d.ts +40 -0
  316. package/lib/types/client/project-session-state.d.ts +13 -1
  317. package/lib/types/client/questions.d.ts +45 -0
  318. package/lib/types/client/settings/sections/documents.d.ts +13 -0
  319. package/lib/types/client/settings/sections.d.ts +1 -0
  320. package/lib/types/client/settings-extensions/contract.d.ts +32 -0
  321. package/lib/types/client/settings-extensions/index.d.ts +3 -0
  322. package/lib/types/client/settings-extensions/registry.d.ts +15 -0
  323. package/lib/types/client/settlement.d.ts +41 -5
  324. package/lib/types/client/source-preview.d.ts +8 -0
  325. package/lib/types/client/styles.d.ts +2 -0
  326. package/lib/types/client/subagent-codenames.d.ts +18 -0
  327. package/lib/types/client/types.d.ts +82 -3
  328. package/lib/types/client/user-settings/GeneralSettingsPage.d.ts +14 -0
  329. package/lib/types/client/user-settings/ProfileSettingsPage.d.ts +18 -0
  330. package/lib/types/client/user-settings/SkillCatalog.d.ts +16 -0
  331. package/lib/types/client/user-settings/SkillEditor.d.ts +42 -0
  332. package/lib/types/client/user-settings/SkillToolPicker.d.ts +17 -0
  333. package/lib/types/client/user-settings/SkillsSettingsPage.d.ts +15 -0
  334. package/lib/types/client/user-settings/StartersSettingsPage.d.ts +14 -0
  335. package/lib/types/client/user-settings/UserSettingsDialog.d.ts +43 -0
  336. package/lib/types/client/user-settings/copy.d.ts +25 -0
  337. package/lib/types/client/user-settings/draft.d.ts +51 -0
  338. package/lib/types/client/user-settings/fields.d.ts +43 -0
  339. package/lib/types/config-resolvers/shared.d.ts +7 -0
  340. package/lib/types/config-resolvers/tools.d.ts +6 -0
  341. package/lib/types/documents/artifacts/ids.d.ts +14 -0
  342. package/lib/types/documents/artifacts/manifest.d.ts +32 -0
  343. package/lib/types/documents/artifacts/store.d.ts +67 -0
  344. package/lib/types/documents/capabilities.d.ts +32 -0
  345. package/lib/types/documents/config.d.ts +27 -0
  346. package/lib/types/documents/defaults.d.ts +161 -0
  347. package/lib/types/documents/errors.d.ts +42 -0
  348. package/lib/types/documents/index.d.ts +63 -0
  349. package/lib/types/documents/inspect/facts.d.ts +43 -0
  350. package/lib/types/documents/inspect/zip.d.ts +28 -0
  351. package/lib/types/documents/markdown/directives.d.ts +39 -0
  352. package/lib/types/documents/markdown/frontmatter.d.ts +15 -0
  353. package/lib/types/documents/markdown/normalize.d.ts +30 -0
  354. package/lib/types/documents/orchestrator/assets.d.ts +55 -0
  355. package/lib/types/documents/orchestrator/convert-document.d.ts +25 -0
  356. package/lib/types/documents/orchestrator/create-document.d.ts +18 -0
  357. package/lib/types/documents/orchestrator/extract-document.d.ts +24 -0
  358. package/lib/types/documents/orchestrator/inspect-document.d.ts +12 -0
  359. package/lib/types/documents/orchestrator/runtime-deps.d.ts +43 -0
  360. package/lib/types/documents/orchestrator/scope.d.ts +52 -0
  361. package/lib/types/documents/providers/docling.d.ts +54 -0
  362. package/lib/types/documents/providers/libreoffice.d.ts +40 -0
  363. package/lib/types/documents/providers/markitdown.d.ts +28 -0
  364. package/lib/types/documents/providers/pandoc.d.ts +42 -0
  365. package/lib/types/documents/providers/process.d.ts +54 -0
  366. package/lib/types/documents/providers/registry.d.ts +68 -0
  367. package/lib/types/documents/providers/shared.d.ts +27 -0
  368. package/lib/types/documents/runtime.d.ts +59 -0
  369. package/lib/types/documents/security/file-types.d.ts +39 -0
  370. package/lib/types/documents/security/limits.d.ts +24 -0
  371. package/lib/types/documents/security/mime.d.ts +13 -0
  372. package/lib/types/documents/security/paths.d.ts +38 -0
  373. package/lib/types/documents/templates/registry.d.ts +50 -0
  374. package/lib/types/documents/templates/resolver.d.ts +30 -0
  375. package/lib/types/documents/tools/convert.d.ts +9 -0
  376. package/lib/types/documents/tools/create.d.ts +14 -0
  377. package/lib/types/documents/tools/index.d.ts +33 -0
  378. package/lib/types/documents/tools/inspect.d.ts +9 -0
  379. package/lib/types/documents/tools/shared.d.ts +77 -0
  380. package/lib/types/documents/tools/to-markdown.d.ts +12 -0
  381. package/lib/types/documents/types.d.ts +294 -0
  382. package/lib/types/index.d.ts +103 -5
  383. package/lib/types/integration-principals.d.ts +9 -0
  384. package/lib/types/lockdown-policy.d.ts +12 -2
  385. package/lib/types/personal-skills/errors.d.ts +11 -0
  386. package/lib/types/personal-skills/host.d.ts +42 -0
  387. package/lib/types/personal-skills/index.d.ts +10 -0
  388. package/lib/types/personal-skills/paths.d.ts +39 -0
  389. package/lib/types/personal-skills/provider.d.ts +33 -0
  390. package/lib/types/personal-skills/remotes.d.ts +35 -0
  391. package/lib/types/personal-skills/service.d.ts +131 -0
  392. package/lib/types/personal-skills/skill-file.d.ts +64 -0
  393. package/lib/types/personal-skills/skill-format.d.ts +100 -0
  394. package/lib/types/personal-skills/watcher.d.ts +39 -0
  395. package/lib/types/profile.d.ts +13 -0
  396. package/lib/types/prompt-notes.d.ts +9 -0
  397. package/lib/types/provenance/file-preview.d.ts +47 -4
  398. package/lib/types/provenance/host-store.d.ts +7 -1
  399. package/lib/types/provenance/index.d.ts +1 -0
  400. package/lib/types/provenance/reported.d.ts +9 -1
  401. package/lib/types/provenance/snapshot-store.d.ts +23 -0
  402. package/lib/types/qa-tools/activation-detector.d.ts +29 -0
  403. package/lib/types/qa-tools/activation-manager.d.ts +47 -0
  404. package/lib/types/qa-tools/catalog.d.ts +40 -0
  405. package/lib/types/qa-tools/durable-marker.d.ts +16 -0
  406. package/lib/types/qa-tools/index.d.ts +40 -0
  407. package/lib/types/qa-tools/lifecycle.d.ts +44 -0
  408. package/lib/types/qa-tools/types.d.ts +45 -0
  409. package/lib/types/questions.d.ts +83 -0
  410. package/lib/types/secure-session.d.ts +45 -4
  411. package/lib/types/session-ownership.d.ts +30 -0
  412. package/lib/types/starters.d.ts +45 -0
  413. package/lib/types/types.d.ts +282 -7
  414. package/lib/types/user-workspace.d.ts +5 -1
  415. package/lib/user-workspace.js +21 -6
  416. package/lib/user-workspace.js.map +1 -1
  417. package/package.json +22 -9
  418. package/scripts/repair-session-events.mjs +260 -0
  419. package/lib/client/components/QaProfile.js +0 -64
  420. package/lib/client/components/QaProfile.js.map +0 -1
  421. package/lib/types/client/components/QaProfile.d.ts +0 -25
@@ -0,0 +1,131 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
3
+ import type { QaSkillDiagnostic, QaSkillDocument, QaSkillDraftInput, QaSkillRemoval, QaSkillSummary, QaSkillToolDescriptor, QaSkillValidation, ResolvedQaSurfaceConfig } from "../types.js";
4
+ import { type QaSkillFileContents } from "./skill-file.js";
5
+ /** Per-account identity of the skill storage boundary. */
6
+ export interface QaPersonalSkillContext {
7
+ /** The authenticated account id whose personal root holds these skills. */
8
+ readonly userId: string;
9
+ }
10
+ /** One stored skill: its parsed contents plus the facts a DTO needs. */
11
+ export interface QaStoredSkill {
12
+ /** Whether the skill directory itself exists. */
13
+ readonly exists: boolean;
14
+ /** Directory name; the skill's identity for every write. */
15
+ readonly directoryName: string;
16
+ readonly directory: string;
17
+ readonly filePath: string;
18
+ readonly raw: string;
19
+ readonly revision: string;
20
+ readonly updatedAt: string | null;
21
+ /** Absent when the file is missing or its frontmatter does not parse. */
22
+ readonly contents: QaSkillFileContents | undefined;
23
+ readonly diagnostics: readonly QaSkillDiagnostic[];
24
+ readonly resourceCount: number;
25
+ }
26
+ export interface QaPersonalSkillsOptions {
27
+ readonly getConfig: () => ResolvedQaSurfaceConfig;
28
+ readonly logger: PluginLogger;
29
+ /** The registered workspace path this deployment pins QA accounts under. */
30
+ readonly workspacePath: () => string | undefined;
31
+ /** Tells the DSH skill registry that a personal catalog may have changed. */
32
+ readonly invalidate: () => void;
33
+ /** Called once per storage root the discovery provider meets. */
34
+ readonly onRootDiscovered?: (root: string) => void;
35
+ }
36
+ /**
37
+ * Personal Skills over one account's own directory.
38
+ *
39
+ * The service is the only writer: it derives every path from the account id,
40
+ * validates a draft before touching the disk, writes `SKILL.md` through a
41
+ * temporary file and a rename, and keeps a removed skill recoverable in the
42
+ * trash beside its skills root. Reading is deliberately permissive — a skill
43
+ * whose file the parser rejects still returns a document carrying the
44
+ * diagnostic that says why, so the editor can repair it.
45
+ */
46
+ export declare class QaPersonalSkills {
47
+ private readonly ctx;
48
+ private readonly options;
49
+ constructor(ctx: Context, options: QaPersonalSkillsOptions);
50
+ /** Whether the feature is available on this deployment at all. */
51
+ get enabled(): boolean;
52
+ /** Resolve one account's storage roots, or refuse the operation. */
53
+ private rootsFor;
54
+ /**
55
+ * Resolve the storage roots a session cwd names. This is the discovery
56
+ * provider's entry point and takes no account token: the cwd itself is the
57
+ * boundary, validated as a provisioned `<workspace>/.qa-users/<uuid>`
58
+ * directory, so no arbitrary directory can name another account's storage.
59
+ */
60
+ private rootsForCwd;
61
+ /** Every skill of one account, sorted by directory name. */
62
+ list(context: QaPersonalSkillContext): readonly QaSkillSummary[];
63
+ /** One skill with everything the editor needs. */
64
+ get(context: QaPersonalSkillContext, name: string): QaSkillDocument;
65
+ /**
66
+ * Check one unsaved draft without touching storage: the serializer is the
67
+ * one a Save uses and the preserved frontmatter is the stored file's, so the
68
+ * preview the editor shows is byte-for-byte the file that save would write,
69
+ * and the diagnostics carry the operator's own limit (which the browser
70
+ * cannot know). `name` is the stored skill being edited, or null to create.
71
+ */
72
+ validate(context: QaPersonalSkillContext, name: string | null, input: QaSkillDraftInput): QaSkillValidation;
73
+ /** Whether one account stores a skill under this name. */
74
+ has(context: QaPersonalSkillContext, name: string): boolean;
75
+ /** Create one skill directory and its `SKILL.md`. */
76
+ create(context: QaPersonalSkillContext, input: QaSkillDraftInput): QaSkillDocument;
77
+ /**
78
+ * Replace one skill's file, preserving the frontmatter fields this editor
79
+ * does not own and moving the whole directory when the name changed.
80
+ */
81
+ update(context: QaPersonalSkillContext, name: string, input: QaSkillDraftInput): QaSkillDocument;
82
+ /** Move one skill directory into the trash beside its skills root. */
83
+ remove(context: QaPersonalSkillContext, name: string, expectedRevision: string | null): QaSkillRemoval;
84
+ /**
85
+ * The tool catalog the picker offers. Availability is the QA session's own
86
+ * scope — the deployment's reviewed allow-list — never a suggestion of what
87
+ * a skill may grant: a declared tool the scope excludes stays listed and
88
+ * stays unavailable.
89
+ */
90
+ tools(context: QaPersonalSkillContext): readonly QaSkillToolDescriptor[];
91
+ /**
92
+ * The skills one session cwd exposes to DSH. A file the parser rejects, or
93
+ * one whose name disagrees with its directory, is reported in the editor and
94
+ * never handed to the model as a half-valid skill.
95
+ */
96
+ discover(cwd: string): readonly QaStoredSkill[];
97
+ /** Re-read one skill of a session cwd, re-checking the same boundary. */
98
+ read(cwd: string, directoryName: string): QaStoredSkill | undefined;
99
+ private observe;
100
+ private isDiscoverable;
101
+ private availableTools;
102
+ private declaredTools;
103
+ /** The foreign frontmatter a save must keep, read from the stored file. */
104
+ private storedFrontmatter;
105
+ /** Read one skill directory, tolerating every failure the editor must see. */
106
+ private load;
107
+ private resources;
108
+ /**
109
+ * Normalize one editor draft into the file to write. `strict` is the
110
+ * difference between a save and a check: a save refuses a draft the Host
111
+ * will not store, while a check hands the same problems back as diagnostics,
112
+ * because that is what the editor asked for.
113
+ */
114
+ private prepareWrite;
115
+ /** Move a renamed skill's whole directory, resources included. */
116
+ private renameSkillDirectory;
117
+ /** Write one file through a temporary sibling and a rename. */
118
+ private writeSkillFile;
119
+ private trashTarget;
120
+ private assertRevision;
121
+ private summarize;
122
+ private document;
123
+ private storageError;
124
+ /**
125
+ * Publish one write: audit it, then refresh the DSH catalog. The two are
126
+ * separate stages on purpose — a stored skill whose catalog refresh failed
127
+ * is still stored, and the deployment needs to see which half broke.
128
+ */
129
+ private refreshCatalog;
130
+ }
131
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1,64 @@
1
+ import type { QaSkillDiagnostic, QaSkillDiagnosticCode, QaSkillJsonValue } from "../types.js";
2
+ /** The parsed shape of one skill file, without its generated diagnostics. */
3
+ export interface QaSkillFileContents {
4
+ readonly name: string;
5
+ readonly description: string;
6
+ readonly whenToUse: string | null;
7
+ readonly modelInvocable: boolean;
8
+ readonly userInvocable: boolean;
9
+ readonly allowedTools: readonly string[];
10
+ /** Declared tool names dropped as unusable; reported, never silently kept. */
11
+ readonly rejectedTools: readonly string[];
12
+ /** Every frontmatter key the editor does not own, in document order. */
13
+ readonly extraFrontmatter: Readonly<Record<string, QaSkillJsonValue>>;
14
+ readonly body: string;
15
+ /** Non-blocking anomalies found while reading the file. */
16
+ readonly warnings: readonly QaSkillDiagnostic[];
17
+ }
18
+ /**
19
+ * A parse either yields contents or the single reason the file cannot become
20
+ * a skill. The blocking codes carry the upstream reason: `frontmatter-missing`
21
+ * covers both an absent block and a file that is nothing but a body.
22
+ */
23
+ export type QaSkillFileParse = {
24
+ readonly ok: true;
25
+ readonly value: QaSkillFileContents;
26
+ } | {
27
+ readonly ok: false;
28
+ readonly code: QaSkillDiagnosticCode;
29
+ readonly detail: string | null;
30
+ };
31
+ export interface QaSkillFileDraft {
32
+ readonly name: string;
33
+ readonly description: string;
34
+ readonly whenToUse: string | null;
35
+ readonly modelInvocable: boolean;
36
+ readonly userInvocable: boolean;
37
+ readonly allowedTools: readonly string[];
38
+ readonly extraFrontmatter: Readonly<Record<string, QaSkillJsonValue>>;
39
+ readonly body: string;
40
+ }
41
+ /**
42
+ * Coerce one YAML node to a JSON value, or undefined when JSON cannot carry
43
+ * it: preserved frontmatter crosses a JSON bridge, so what crosses it has to
44
+ * be exactly what a Save writes back.
45
+ */
46
+ export declare function toJsonValue(value: unknown): QaSkillJsonValue | undefined;
47
+ /** Parse one `SKILL.md` into its canonical shape plus read-time warnings. */
48
+ export declare function parseSkillFile(raw: string): QaSkillFileParse;
49
+ /**
50
+ * Write one `SKILL.md` from a draft. Known fields are emitted first in the
51
+ * canonical order every reader of this plugin sees; preserved foreign fields
52
+ * follow in the order they were read, so a skill authored elsewhere keeps its
53
+ * extra frontmatter across a Save in the editor.
54
+ */
55
+ export declare function serializeSkillFile(draft: QaSkillFileDraft): string;
56
+ /**
57
+ * The markdown body of a skill file, whether or not its frontmatter parses.
58
+ * A file the editor cannot open still has to show its instructions, so a
59
+ * malformed block yields the text below it and a file without a block yields
60
+ * itself.
61
+ */
62
+ export declare function skillFileBody(raw: string): string;
63
+ export * from "./skill-format.js";
64
+ //# sourceMappingURL=skill-file.d.ts.map
@@ -0,0 +1,100 @@
1
+ import type { QaSkillDiagnostic, QaSkillDiagnosticCode } from "../types.js";
2
+ /**
3
+ * The rules of the `SKILL.md` format that need no YAML: the name grammar, the
4
+ * declared-tool list, the draft limits, and where a personal root may sit.
5
+ *
6
+ * This module is deliberately free of Node builtins *and* of the YAML
7
+ * dependency, because the browser editor imports it: a YAML library ships a
8
+ * Node build beside its browser one, and the DSH module loader has no engine
9
+ * for the `require("process")` that build contains. The parser and serializer
10
+ * that do need YAML live in `skill-file.js`, which only the Host loads — the
11
+ * editor asks the Host for the file a draft would write and for the
12
+ * authoritative diagnostics, and shows its own answer immediately for the
13
+ * rules below.
14
+ */
15
+ /** Name length cap; the upstream grammar itself is unbounded. */
16
+ export declare const QA_SKILL_NAME_MAX = 64;
17
+ export declare const QA_SKILL_DESCRIPTION_MAX = 1024;
18
+ export declare const QA_SKILL_WHEN_TO_USE_MAX = 2048;
19
+ /** One skill file's own ceiling, before any resource directory is considered. */
20
+ export declare const QA_SKILL_FILE_MAX_BYTES: number;
21
+ export declare const QA_SKILL_MAX_BYTES_MIN = 4096;
22
+ export declare const QA_SKILL_MAX_BYTES_MAX: number;
23
+ export declare const QA_SKILL_MAX_TOOLS = 256;
24
+ /**
25
+ * Whether the feature is on for a deployment that could host it. The resolver
26
+ * still turns it off wherever accounts or per-account directories are absent:
27
+ * this is the operator's intent, not a capability.
28
+ */
29
+ export declare const QA_SKILL_ENABLED_BY_DEFAULT = true;
30
+ /** Where personal skills live below one account's own workspace directory. */
31
+ export declare const QA_SKILL_DEFAULT_RELATIVE_ROOT = ".dsh/skills";
32
+ export declare const QA_SKILL_RELATIVE_ROOT_MAX = 512;
33
+ /** DSH's skill-name grammar: the registry refuses anything else outright. */
34
+ export declare const QA_SKILL_NAME_PATTERN: RegExp;
35
+ /** Frontmatter keys the editor owns. */
36
+ export declare const KNOWN_SKILL_FIELDS: Set<string>;
37
+ /**
38
+ * Agent Skills fields the editor preserves without offering a control for
39
+ * them. Anything outside both sets is still preserved; it only earns a
40
+ * warning that the deployment's editor does not know the field.
41
+ */
42
+ export declare const PRESERVED_SKILL_FIELDS: Set<string>;
43
+ /**
44
+ * Whether a configured `relativeRoot` may be resolved below a personal root.
45
+ * Only a relative, ordinary path qualifies: the value decides where the
46
+ * filesystem boundary of the feature sits, so an absolute path or one
47
+ * climbing out would move the boundary rather than relocate inside it.
48
+ */
49
+ export declare function skillRelativeRootProblem(value: string): string | null;
50
+ /** The directory segments of an already-validated relative root. */
51
+ export declare function skillRelativeRootSegments(value: string): readonly string[];
52
+ /** The reason a candidate name cannot be used, or null when it can. */
53
+ export declare function skillNameProblem(value: string): "name-required" | "name-invalid" | null;
54
+ export interface QaToolListNormalization {
55
+ readonly tools: readonly string[];
56
+ /** Entries that are not usable tool names; reported, never silently kept. */
57
+ readonly rejected: readonly string[];
58
+ }
59
+ /**
60
+ * Read a declared tool list. The canonical form is one space-separated
61
+ * scalar, but an array (and comma separators) are accepted for compatibility
62
+ * with skills authored elsewhere, and every form normalizes to the canonical
63
+ * deduplicated order.
64
+ */
65
+ export declare function normalizeAllowedTools(value: unknown): QaToolListNormalization | undefined;
66
+ export declare function skillWarning(code: QaSkillDiagnosticCode, field: string | null, detail: string | null): QaSkillDiagnostic;
67
+ /** Byte length of the text a Save would write, in UTF-8. */
68
+ export declare function skillFileBytes(text: string): number;
69
+ export interface QaSkillValidationInput {
70
+ readonly name: string;
71
+ readonly description: string;
72
+ readonly whenToUse: string | null;
73
+ readonly modelInvocable: boolean;
74
+ readonly userInvocable: boolean;
75
+ readonly allowedTools: readonly string[];
76
+ /**
77
+ * Byte length of the serialized file. Omitted by a caller that cannot
78
+ * serialize — the browser editor — so the size rule stays on the Host,
79
+ * which knows both the operator's ceiling and the file it would write.
80
+ */
81
+ readonly sizeBytes?: number | undefined;
82
+ /** Operator-configured ceiling; the built-in default applies when omitted. */
83
+ readonly maxBytes?: number | undefined;
84
+ /**
85
+ * Names the current QA scope can actually use. Omitted when the catalog is
86
+ * unknown: a missing catalog must not turn every tool into a warning.
87
+ */
88
+ readonly availableTools?: readonly string[] | undefined;
89
+ /** Tool names submitted through the picker that are not usable names. */
90
+ readonly rejectedTools?: readonly string[] | undefined;
91
+ /** Frontmatter keys carried over from the file, for the unknown-field notice. */
92
+ readonly extraFieldNames?: readonly string[] | undefined;
93
+ }
94
+ /**
95
+ * Validate an editor draft. Every rule here is enforced again on the Host at
96
+ * write time; running it in the browser only makes the editor immediate, it is
97
+ * not the authority.
98
+ */
99
+ export declare function validateSkillDraft(input: QaSkillValidationInput): readonly QaSkillDiagnostic[];
100
+ //# sourceMappingURL=skill-format.d.ts.map
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Follows personal skill directories so a file edited by hand — outside the
3
+ * editor — still reaches the DSH catalog without a restart.
4
+ *
5
+ * Registration is lazy and bounded: a root is watched the first time the
6
+ * discovery provider meets it, at most {@link QA_SKILL_WATCH_LIMIT} roots stay
7
+ * open (least recently used first), and every watcher is closed on dispose. A
8
+ * root that cannot be watched degrades to "no live refresh for that account":
9
+ * a save through the editor invalidates the registry directly and never
10
+ * depends on this path.
11
+ */
12
+ export declare const QA_SKILL_WATCH_LIMIT = 16;
13
+ export interface QaSkillWatcherOptions {
14
+ readonly onChange: () => void;
15
+ readonly onError: (message: string) => void;
16
+ readonly limit?: number;
17
+ readonly debounceMs?: number;
18
+ }
19
+ export declare class QaSkillWatcher {
20
+ private readonly options;
21
+ private readonly watchers;
22
+ private readonly limit;
23
+ private readonly debounceMs;
24
+ private timer;
25
+ constructor(options: QaSkillWatcherOptions);
26
+ /** How many roots are currently watched (tests and diagnostics). */
27
+ get size(): number;
28
+ /** Start following one skills root; idempotent per path. */
29
+ follow(root: string): void;
30
+ /** Stop following one root. */
31
+ close(root: string): void;
32
+ dispose(): void;
33
+ /**
34
+ * Coalesce a burst of filesystem events into one catalog refresh. The timer
35
+ * never holds the process open: a watcher must not keep the Host alive.
36
+ */
37
+ private schedule;
38
+ }
39
+ //# sourceMappingURL=watcher.d.ts.map
@@ -24,6 +24,19 @@ export declare const QA_PROFILE_INSTRUCTIONS_MAX_MIN = 200;
24
24
  export declare const QA_PROFILE_INSTRUCTIONS_MAX_MAX = 20000;
25
25
  /** The profile of an account that never filled one in. */
26
26
  export declare function emptyProfile(): QaAccountProfile;
27
+ /**
28
+ * One single-line field: control characters out, whitespace runs collapsed to
29
+ * a space, trimmed to at most `maxLength` characters. Shared with the starter
30
+ * editor, whose button label obeys the same rules.
31
+ */
32
+ export declare function cleanLine(value: unknown, maxLength: number): string;
33
+ /**
34
+ * One multi-line field: line feeds survive (three or more collapse to a blank
35
+ * line), every other control character is dropped, and the result is trimmed
36
+ * to at most `maxLength` characters. Shared with the starter editor, whose
37
+ * sent prompt obeys the same rules.
38
+ */
39
+ export declare function cleanBlock(value: unknown, maxLength: number): string;
27
40
  /**
28
41
  * Read one stored (or wire-delivered) profile into its public shape. Unknown
29
42
  * or hand-edited input degrades to the readable subset instead of throwing:
@@ -12,6 +12,8 @@ export declare const QA_NOTES_PLUGIN = "qa-surface";
12
12
  export declare const QA_IDENTITY_NOTE = "dsh-qa-surface:user-identity";
13
13
  /** Note name carrying the deployment's rule about source provenance. */
14
14
  export declare const QA_SOURCES_NOTE = "dsh-qa-surface:structured-sources";
15
+ /** Note name asking the model to name its delegations. */
16
+ export declare const QA_DELEGATION_NOTE = "dsh-qa-surface:delegation-naming";
15
17
  export interface QaIdentityRenderInput {
16
18
  /** The owner's account address; the one fact accounts always provide. */
17
19
  readonly email: string;
@@ -89,6 +91,13 @@ export declare class QaPromptNotes {
89
91
  private identityNotes;
90
92
  /** What the deployment expects around the sources the surface collects. */
91
93
  private sourcesNotes;
94
+ /**
95
+ * How the model should label its delegations: the host keeps the
96
+ * delegation's `description` as the child's durable creation label, and the
97
+ * surface shows it as the subagent's display name. A named delegation is
98
+ * the difference between a panel of hashes and a panel of tasks.
99
+ */
100
+ private delegationNotes;
92
101
  private carriedKey;
93
102
  /**
94
103
  * The text one note already carries in this agent's conversation. Process
@@ -1,10 +1,53 @@
1
1
  import type { QaSourceFilePreview } from "../types.js";
2
- export interface QaSourceFilePreviewOptions {
3
- readonly root: string;
2
+ /**
3
+ * Coarse, wire-safe preview refusal codes. They ride the shared
4
+ * `(reason: <code>)` marker, so the panel can tell "this file is not in a
5
+ * directory the QA read policy opens" from "this file is gone" instead of
6
+ * telling every audience that a present file moved away.
7
+ */
8
+ export type QaSourcePreviewReason = "outside-roots" | "not-evidence" | "unavailable";
9
+ /** Host refusal whose wire message carries the coarse reason marker. */
10
+ export declare class QaSourcePreviewError extends Error {
11
+ readonly reason: QaSourcePreviewReason;
12
+ constructor(reason: QaSourcePreviewReason);
13
+ }
14
+ export interface QaSourceFilePreviewRequest {
4
15
  readonly sourcePath: string;
16
+ /**
17
+ * The attested chat's cwd. It is the root every relative source path in the
18
+ * evidence bundle was canonicalized against, and the anchor this read
19
+ * resolves a relative request against.
20
+ */
21
+ readonly cwd: string;
22
+ /**
23
+ * Whether one canonical path is evidence of the attested chat. The preview
24
+ * never browses: it opens exactly the files the bundle already recorded.
25
+ */
26
+ readonly isEvidence: (canonicalPath: string) => boolean;
27
+ /**
28
+ * Shared read directories of the deployment. The per-user execution guard
29
+ * already lets the model read these, so a source recorded from one of them
30
+ * must stay previewable.
31
+ */
32
+ readonly sharedReadOnlyRoots?: readonly string[];
33
+ /**
34
+ * The mounted attachment store. It sits outside every workspace on purpose,
35
+ * and the upload prompt points the model at the exact file an upload
36
+ * produced, so that one file is readable here too.
37
+ */
38
+ readonly attachmentRoot?: string;
5
39
  readonly maxBytes: number;
6
40
  readonly maxMarkdownRenderBytes: number;
7
41
  }
8
- /** Read one canonical in-root file without following a symlink outside root. */
9
- export declare function readSourceFilePreview({ root, sourcePath, maxBytes, maxMarkdownRenderBytes, }: QaSourceFilePreviewOptions): Promise<QaSourceFilePreview>;
42
+ /**
43
+ * Read one evidence file from the roots the QA read policy opens.
44
+ *
45
+ * The bundle canonicalized each recorded path against the chat cwd, while the
46
+ * browser may hold either spelling of the same file: it projects sources with
47
+ * the *configured* session cwd, which is null whenever the chat is pinned by
48
+ * workspaceId or by an account directory. So the request is canonicalized the
49
+ * same way before it is matched, or a file inside the chat's own workspace is
50
+ * refused as foreign evidence.
51
+ */
52
+ export declare function readSourceFilePreview({ sourcePath, cwd, isEvidence, sharedReadOnlyRoots, attachmentRoot, maxBytes, maxMarkdownRenderBytes, }: QaSourceFilePreviewRequest): Promise<QaSourceFilePreview>;
10
53
  //# sourceMappingURL=file-preview.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { Context } from "@deepseek-ai/cordis";
2
+ import { type QaProvenanceSnapshotStore } from "./snapshot-store.js";
2
3
  import type { QaTurnSources } from "./types.js";
3
4
  import type { ResolvedQaSurfaceConfig } from "../types.js";
4
5
  export declare const QA_REPORT_SOURCES_TOOL = "qa_report_sources";
@@ -23,12 +24,15 @@ declare module "@deepseek-ai/cordis" {
23
24
  export declare class QaProvenanceHost {
24
25
  private readonly ctx;
25
26
  private readonly config;
27
+ private readonly store;
28
+ private readonly onPersistenceError;
26
29
  private readonly collectors;
27
30
  private readonly snapshots;
31
+ private readonly seededSessions;
28
32
  private readonly calls;
29
33
  private readonly lineage;
30
34
  private readonly disposers;
31
- constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig);
35
+ constructor(ctx: Context, config: () => ResolvedQaSurfaceConfig, store?: QaProvenanceSnapshotStore, onPersistenceError?: (error: unknown) => void);
32
36
  dispose(): void;
33
37
  /**
34
38
  * Drop every per-session record of one chat. Long-lived servers outlive
@@ -49,6 +53,8 @@ export declare class QaProvenanceHost {
49
53
  private collector;
50
54
  private sessionCalls;
51
55
  private sessionSnapshots;
56
+ private hydrateStored;
57
+ private persistSnapshot;
52
58
  }
53
59
  export {};
54
60
  //# sourceMappingURL=host-store.d.ts.map
@@ -6,5 +6,6 @@ export * from "./file-preview.js";
6
6
  export * from "./host-store.js";
7
7
  export * from "./normalize.js";
8
8
  export * from "./reported.js";
9
+ export * from "./snapshot-store.js";
9
10
  export type * from "./types.js";
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,13 @@
1
1
  import { canonicalizeUrl } from "./normalize.js";
2
2
  import type { QaReportedSource, QaSourceOrigin, QaSourceReference } from "./types.js";
3
+ export interface ReportedSourceOptions {
4
+ /**
5
+ * Whether a reported source must carry an address to be recorded. With
6
+ * `false`, a source the model wrote without a usable path or URL keeps its
7
+ * own type, title and snippet instead of being dropped.
8
+ */
9
+ readonly validate?: boolean;
10
+ }
3
11
  /** Normalize a source explicitly reported by a delegated provider. */
4
- export declare function normalizeReportedSource(source: QaReportedSource, origin: QaSourceOrigin, workspaceRoot?: string, urlOptions?: Parameters<typeof canonicalizeUrl>[1]): QaSourceReference | null;
12
+ export declare function normalizeReportedSource(source: QaReportedSource, origin: QaSourceOrigin, workspaceRoot?: string, urlOptions?: Parameters<typeof canonicalizeUrl>[1], options?: ReportedSourceOptions): QaSourceReference | null;
5
13
  //# sourceMappingURL=reported.d.ts.map
@@ -0,0 +1,23 @@
1
+ import type { QaTurnSources } from "./types.js";
2
+ export interface QaProvenanceSnapshotStore {
3
+ list(sessionId: string): readonly QaTurnSources[];
4
+ put(bundle: QaTurnSources): void;
5
+ }
6
+ /** Process-local store used by tests and explicit ephemeral deployments. */
7
+ export declare class MemoryQaProvenanceSnapshotStore implements QaProvenanceSnapshotStore {
8
+ private readonly sessions;
9
+ list(sessionId: string): readonly QaTurnSources[];
10
+ put(bundle: QaTurnSources): void;
11
+ }
12
+ /** Default durable provenance path, deliberately outside Harness journals. */
13
+ export declare function defaultQaProvenanceFilePath(): string;
14
+ /** Atomically persists per-turn QA source snapshots in plugin-owned storage. */
15
+ export declare class FileQaProvenanceSnapshotStore implements QaProvenanceSnapshotStore {
16
+ private readonly filePath;
17
+ constructor(filePath?: string);
18
+ list(sessionId: string): readonly QaTurnSources[];
19
+ put(bundle: QaTurnSources): void;
20
+ private load;
21
+ private persist;
22
+ }
23
+ //# sourceMappingURL=snapshot-store.d.ts.map
@@ -0,0 +1,29 @@
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 QaToolActivationDetectorOptions {
6
+ readonly manager: QaToolActivationManager;
7
+ readonly logger: PluginLogger;
8
+ /** The exact skill name that unlocks the QA tools. */
9
+ readonly activationSkill: string;
10
+ /** Whether this agent's composition participates in QA tool activation. */
11
+ readonly isManagedAgent: (agent: Agent) => boolean;
12
+ }
13
+ /**
14
+ * Turns a successful QA skill load into an activation request.
15
+ *
16
+ * The trigger is the authoritative `tools/result` of the built-in `skill` tool,
17
+ * not the model's attempt and not the rendered conversation text: a refused,
18
+ * unknown, or cancelled skill load reaches this listener as an error result and
19
+ * activates nothing.
20
+ */
21
+ export declare class QaToolActivationDetector {
22
+ private readonly ctx;
23
+ private readonly options;
24
+ private readonly dispose;
25
+ constructor(ctx: Context, options: QaToolActivationDetectorOptions);
26
+ private observe;
27
+ disposeListeners(): void;
28
+ }
29
+ //# sourceMappingURL=activation-detector.d.ts.map
@@ -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