@yadsh/dsh-qa-surface 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/README.md +236 -20
  2. package/compatibility.json +11 -3
  3. package/lib/account-remotes.js +100 -0
  4. package/lib/account-remotes.js.map +1 -0
  5. package/lib/accounts/credentials.js +27 -0
  6. package/lib/accounts/credentials.js.map +1 -0
  7. package/lib/accounts/errors.js +9 -0
  8. package/lib/accounts/errors.js.map +1 -0
  9. package/lib/accounts/file.js +101 -0
  10. package/lib/accounts/file.js.map +1 -0
  11. package/lib/accounts/index.js +2 -0
  12. package/lib/accounts/index.js.map +1 -0
  13. package/lib/accounts/store.js +461 -0
  14. package/lib/accounts/store.js.map +1 -0
  15. package/lib/accounts/token.js +61 -0
  16. package/lib/accounts/token.js.map +1 -0
  17. package/lib/attachment-rules.js +111 -0
  18. package/lib/attachment-rules.js.map +1 -0
  19. package/lib/attestation.js.map +1 -1
  20. package/lib/cli.js +256 -0
  21. package/lib/cli.js.map +1 -0
  22. package/lib/client/QaAccountsController.js +359 -0
  23. package/lib/client/QaAccountsController.js.map +1 -0
  24. package/lib/client/QaSessionController.js +238 -180
  25. package/lib/client/QaSessionController.js.map +1 -1
  26. package/lib/client/QaSurface.js +281 -105
  27. package/lib/client/QaSurface.js.map +1 -1
  28. package/lib/client/QaTranscriptAdapter.js +95 -244
  29. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  30. package/lib/client/attachments.js +150 -0
  31. package/lib/client/attachments.js.map +1 -0
  32. package/lib/client/attestation.js +7 -1
  33. package/lib/client/attestation.js.map +1 -1
  34. package/lib/client/base64.js +16 -0
  35. package/lib/client/base64.js.map +1 -0
  36. package/lib/client/chat-files.js +48 -0
  37. package/lib/client/chat-files.js.map +1 -0
  38. package/lib/client/components/Markdown.js +54 -13
  39. package/lib/client/components/Markdown.js.map +1 -1
  40. package/lib/client/components/QaAuthGate.js +40 -0
  41. package/lib/client/components/QaAuthGate.js.map +1 -0
  42. package/lib/client/components/QaChangelog.js +131 -0
  43. package/lib/client/components/QaChangelog.js.map +1 -0
  44. package/lib/client/components/QaComposer.js +56 -74
  45. package/lib/client/components/QaComposer.js.map +1 -1
  46. package/lib/client/components/QaFileAttachment.js +19 -0
  47. package/lib/client/components/QaFileAttachment.js.map +1 -0
  48. package/lib/client/components/QaFilesPanel.js +45 -0
  49. package/lib/client/components/QaFilesPanel.js.map +1 -0
  50. package/lib/client/components/QaHeader.js +34 -0
  51. package/lib/client/components/QaHeader.js.map +1 -0
  52. package/lib/client/components/QaMessage.js +61 -18
  53. package/lib/client/components/QaMessage.js.map +1 -1
  54. package/lib/client/components/QaModal.js +31 -0
  55. package/lib/client/components/QaModal.js.map +1 -0
  56. package/lib/client/components/QaProfile.js +64 -0
  57. package/lib/client/components/QaProfile.js.map +1 -0
  58. package/lib/client/components/QaRightRail.js +15 -0
  59. package/lib/client/components/QaRightRail.js.map +1 -0
  60. package/lib/client/components/QaSidebar.js +68 -20
  61. package/lib/client/components/QaSidebar.js.map +1 -1
  62. package/lib/client/components/QaSourcesPanel.js +127 -0
  63. package/lib/client/components/QaSourcesPanel.js.map +1 -0
  64. package/lib/client/components/QaTurnRail.js +296 -0
  65. package/lib/client/components/QaTurnRail.js.map +1 -0
  66. package/lib/client/components/QaWelcomeNotice.js +125 -0
  67. package/lib/client/components/QaWelcomeNotice.js.map +1 -0
  68. package/lib/client/components/QaWidthHandle.js +147 -0
  69. package/lib/client/components/QaWidthHandle.js.map +1 -0
  70. package/lib/client/components/QaWorkGroup.js +19 -20
  71. package/lib/client/components/QaWorkGroup.js.map +1 -1
  72. package/lib/client/components/source-refs.js +78 -0
  73. package/lib/client/components/source-refs.js.map +1 -0
  74. package/lib/client/components/surface-utils.js +28 -0
  75. package/lib/client/components/surface-utils.js.map +1 -0
  76. package/lib/client/components/thinking-phrases.js +24 -0
  77. package/lib/client/components/thinking-phrases.js.map +1 -0
  78. package/lib/client/create-session.js +26 -0
  79. package/lib/client/create-session.js.map +1 -0
  80. package/lib/client/failure-copy.js +63 -0
  81. package/lib/client/failure-copy.js.map +1 -0
  82. package/lib/client/index.js +135 -16
  83. package/lib/client/index.js.map +1 -1
  84. package/lib/client/project-session-state.js +78 -0
  85. package/lib/client/project-session-state.js.map +1 -0
  86. package/lib/client/prompt-content.js +54 -0
  87. package/lib/client/prompt-content.js.map +1 -0
  88. package/lib/client/session-admission.js +38 -0
  89. package/lib/client/session-admission.js.map +1 -0
  90. package/lib/client/session-assets.js +52 -0
  91. package/lib/client/session-assets.js.map +1 -0
  92. package/lib/client/session-sources.js +61 -0
  93. package/lib/client/session-sources.js.map +1 -0
  94. package/lib/client/settings/card.js +143 -0
  95. package/lib/client/settings/card.js.map +1 -0
  96. package/lib/client/settings/fields.js +145 -0
  97. package/lib/client/settings/fields.js.map +1 -0
  98. package/lib/client/settings/format.js +255 -0
  99. package/lib/client/settings/format.js.map +1 -0
  100. package/lib/client/settings/sections/access.js +25 -0
  101. package/lib/client/settings/sections/access.js.map +1 -0
  102. package/lib/client/settings/sections/accounts.js +47 -0
  103. package/lib/client/settings/sections/accounts.js.map +1 -0
  104. package/lib/client/settings/sections/attachments.js +46 -0
  105. package/lib/client/settings/sections/attachments.js.map +1 -0
  106. package/lib/client/settings/sections/branding.js +28 -0
  107. package/lib/client/settings/sections/branding.js.map +1 -0
  108. package/lib/client/settings/sections/common.js +20 -0
  109. package/lib/client/settings/sections/common.js.map +1 -0
  110. package/lib/client/settings/sections/embedding.js +19 -0
  111. package/lib/client/settings/sections/embedding.js.map +1 -0
  112. package/lib/client/settings/sections/interface.js +60 -0
  113. package/lib/client/settings/sections/interface.js.map +1 -0
  114. package/lib/client/settings/sections/lockdown.js +82 -0
  115. package/lib/client/settings/sections/lockdown.js.map +1 -0
  116. package/lib/client/settings/sections/session.js +53 -0
  117. package/lib/client/settings/sections/session.js.map +1 -0
  118. package/lib/client/settings/sections/sources.js +72 -0
  119. package/lib/client/settings/sections/sources.js.map +1 -0
  120. package/lib/client/settings/sections/status.js +37 -0
  121. package/lib/client/settings/sections/status.js.map +1 -0
  122. package/lib/client/settings/sections.js +23 -0
  123. package/lib/client/settings/sections.js.map +1 -0
  124. package/lib/client/settings/styles.js +57 -0
  125. package/lib/client/settings/styles.js.map +1 -0
  126. package/lib/client/settlement.js +24 -0
  127. package/lib/client/settlement.js.map +1 -0
  128. package/lib/client/stream-publisher.js +47 -0
  129. package/lib/client/stream-publisher.js.map +1 -0
  130. package/lib/client/styles.js +225 -17
  131. package/lib/client/styles.js.map +1 -1
  132. package/lib/client/tool-presentation.js +102 -0
  133. package/lib/client/tool-presentation.js.map +1 -0
  134. package/lib/client/turn-sources.js +98 -0
  135. package/lib/client/turn-sources.js.map +1 -0
  136. package/lib/client/types.js +2 -0
  137. package/lib/client/types.js.map +1 -1
  138. package/lib/client/use-right-rail.js +96 -0
  139. package/lib/client/use-right-rail.js.map +1 -0
  140. package/lib/client/use-session-ui-state.js +75 -0
  141. package/lib/client/use-session-ui-state.js.map +1 -0
  142. package/lib/client/use-transcript-view.js +44 -0
  143. package/lib/client/use-transcript-view.js.map +1 -0
  144. package/lib/client.js +9052 -1345
  145. package/lib/client.js.map +1 -1
  146. package/lib/config-resolvers/accounts.js +60 -0
  147. package/lib/config-resolvers/accounts.js.map +1 -0
  148. package/lib/config-resolvers/attachments.js +28 -0
  149. package/lib/config-resolvers/attachments.js.map +1 -0
  150. package/lib/config-resolvers/basics.js +59 -0
  151. package/lib/config-resolvers/basics.js.map +1 -0
  152. package/lib/config-resolvers/defaults.js +132 -0
  153. package/lib/config-resolvers/defaults.js.map +1 -0
  154. package/lib/config-resolvers/lockdown.js +79 -0
  155. package/lib/config-resolvers/lockdown.js.map +1 -0
  156. package/lib/config-resolvers/session.js +42 -0
  157. package/lib/config-resolvers/session.js.map +1 -0
  158. package/lib/config-resolvers/shared.js +42 -0
  159. package/lib/config-resolvers/shared.js.map +1 -0
  160. package/lib/config-resolvers/sources.js +81 -0
  161. package/lib/config-resolvers/sources.js.map +1 -0
  162. package/lib/config-resolvers/ui.js +20 -0
  163. package/lib/config-resolvers/ui.js.map +1 -0
  164. package/lib/config.js +279 -102
  165. package/lib/config.js.map +1 -1
  166. package/lib/entry-redirect.js +45 -0
  167. package/lib/entry-redirect.js.map +1 -0
  168. package/lib/host-route.js +25 -1
  169. package/lib/host-route.js.map +1 -1
  170. package/lib/index.js +258 -23
  171. package/lib/index.js.map +1 -1
  172. package/lib/launch-token.js +42 -0
  173. package/lib/launch-token.js.map +1 -0
  174. package/lib/profile.js +214 -0
  175. package/lib/profile.js.map +1 -0
  176. package/lib/prompt-notes.js +231 -0
  177. package/lib/prompt-notes.js.map +1 -0
  178. package/lib/provenance/collector.js +40 -0
  179. package/lib/provenance/collector.js.map +1 -0
  180. package/lib/provenance/connectors.js +147 -0
  181. package/lib/provenance/connectors.js.map +1 -0
  182. package/lib/provenance/dedupe.js +89 -0
  183. package/lib/provenance/dedupe.js.map +1 -0
  184. package/lib/provenance/extractors.js +340 -0
  185. package/lib/provenance/extractors.js.map +1 -0
  186. package/lib/provenance/file-preview.js +39 -0
  187. package/lib/provenance/file-preview.js.map +1 -0
  188. package/lib/provenance/host-store.js +387 -0
  189. package/lib/provenance/host-store.js.map +1 -0
  190. package/lib/provenance/index.js +9 -0
  191. package/lib/provenance/index.js.map +1 -0
  192. package/lib/provenance/normalize.js +128 -0
  193. package/lib/provenance/normalize.js.map +1 -0
  194. package/lib/provenance/reported.js +53 -0
  195. package/lib/provenance/reported.js.map +1 -0
  196. package/lib/provenance/types.js +2 -0
  197. package/lib/provenance/types.js.map +1 -0
  198. package/lib/resolve-config.js +35 -249
  199. package/lib/resolve-config.js.map +1 -1
  200. package/lib/secure-session.js +122 -14
  201. package/lib/secure-session.js.map +1 -1
  202. package/lib/shared/session-key.js +18 -0
  203. package/lib/shared/session-key.js.map +1 -0
  204. package/lib/shared/settings.js +10 -0
  205. package/lib/shared/settings.js.map +1 -0
  206. package/lib/thinking-phrases.js +68 -0
  207. package/lib/thinking-phrases.js.map +1 -0
  208. package/lib/typert.host.js +749 -11
  209. package/lib/typert.remote-client.d.ts +23 -3
  210. package/lib/typert.remote-client.js +593 -6
  211. package/lib/types/account-remotes.d.ts +42 -0
  212. package/lib/types/accounts/credentials.d.ts +14 -0
  213. package/lib/types/accounts/errors.d.ts +11 -0
  214. package/lib/types/accounts/file.d.ts +82 -0
  215. package/lib/types/accounts/index.d.ts +2 -0
  216. package/lib/types/accounts/store.d.ts +144 -0
  217. package/lib/types/accounts/token.d.ts +31 -0
  218. package/lib/types/attachment-rules.d.ts +44 -0
  219. package/lib/types/attestation.d.ts +1 -1
  220. package/lib/types/cli.d.ts +9 -0
  221. package/lib/types/client/QaAccountsController.d.ts +102 -0
  222. package/lib/types/client/QaConfigController.d.ts +1 -1
  223. package/lib/types/client/QaSessionController.d.ts +61 -22
  224. package/lib/types/client/QaSurface.d.ts +14 -3
  225. package/lib/types/client/QaTranscriptAdapter.d.ts +5 -10
  226. package/lib/types/client/attachments.d.ts +54 -0
  227. package/lib/types/client/base64.d.ts +10 -0
  228. package/lib/types/client/chat-files.d.ts +30 -0
  229. package/lib/types/client/components/Markdown.d.ts +11 -1
  230. package/lib/types/client/components/QaAgentsDrawer.d.ts +1 -1
  231. package/lib/types/client/components/QaAuthGate.d.ts +15 -0
  232. package/lib/types/client/components/QaChangelog.d.ts +21 -0
  233. package/lib/types/client/components/QaComposer.d.ts +8 -4
  234. package/lib/types/client/components/QaFileAttachment.d.ts +14 -0
  235. package/lib/types/client/components/QaFilesPanel.d.ts +15 -0
  236. package/lib/types/client/components/QaHeader.d.ts +41 -0
  237. package/lib/types/client/components/QaMessage.d.ts +12 -3
  238. package/lib/types/client/components/QaModal.d.ts +26 -0
  239. package/lib/types/client/components/QaProfile.d.ts +25 -0
  240. package/lib/types/client/components/QaRightRail.d.ts +23 -0
  241. package/lib/types/client/components/QaSidebar.d.ts +44 -2
  242. package/lib/types/client/components/QaSourcesPanel.d.ts +23 -0
  243. package/lib/types/client/components/QaTurnRail.d.ts +65 -0
  244. package/lib/types/client/components/QaWelcomeNotice.d.ts +27 -0
  245. package/lib/types/client/components/QaWidthHandle.d.ts +43 -0
  246. package/lib/types/client/components/QaWorkGroup.d.ts +5 -3
  247. package/lib/types/client/components/source-refs.d.ts +16 -0
  248. package/lib/types/client/components/surface-utils.d.ts +11 -0
  249. package/lib/types/client/components/thinking-phrases.d.ts +9 -0
  250. package/lib/types/client/create-session.d.ts +13 -0
  251. package/lib/types/client/failure-copy.d.ts +19 -0
  252. package/lib/types/client/index.d.ts +1 -0
  253. package/lib/types/client/project-session-state.d.ts +30 -0
  254. package/lib/types/client/prompt-content.d.ts +30 -0
  255. package/lib/types/client/session-admission.d.ts +23 -0
  256. package/lib/types/client/session-assets.d.ts +20 -0
  257. package/lib/types/client/session-sources.d.ts +28 -0
  258. package/lib/types/client/settings/card.d.ts +23 -0
  259. package/lib/types/client/settings/fields.d.ts +139 -0
  260. package/lib/types/client/settings/format.d.ts +108 -0
  261. package/lib/types/client/settings/sections/access.d.ts +9 -0
  262. package/lib/types/client/settings/sections/accounts.d.ts +9 -0
  263. package/lib/types/client/settings/sections/attachments.d.ts +15 -0
  264. package/lib/types/client/settings/sections/branding.d.ts +8 -0
  265. package/lib/types/client/settings/sections/common.d.ts +28 -0
  266. package/lib/types/client/settings/sections/embedding.d.ts +8 -0
  267. package/lib/types/client/settings/sections/interface.d.ts +9 -0
  268. package/lib/types/client/settings/sections/lockdown.d.ts +9 -0
  269. package/lib/types/client/settings/sections/session.d.ts +9 -0
  270. package/lib/types/client/settings/sections/sources.d.ts +9 -0
  271. package/lib/types/client/settings/sections/status.d.ts +22 -0
  272. package/lib/types/client/settings/sections.d.ts +25 -0
  273. package/lib/types/client/settings/styles.d.ts +8 -0
  274. package/lib/types/client/settlement.d.ts +6 -0
  275. package/lib/types/client/stream-publisher.d.ts +28 -0
  276. package/lib/types/client/tool-presentation.d.ts +6 -0
  277. package/lib/types/client/turn-sources.d.ts +14 -0
  278. package/lib/types/client/types.d.ts +101 -9
  279. package/lib/types/client/use-right-rail.d.ts +56 -0
  280. package/lib/types/client/use-session-ui-state.d.ts +41 -0
  281. package/lib/types/client/use-transcript-view.d.ts +20 -0
  282. package/lib/types/config-resolvers/accounts.d.ts +15 -0
  283. package/lib/types/config-resolvers/attachments.d.ts +6 -0
  284. package/lib/types/config-resolvers/basics.d.ts +8 -0
  285. package/lib/types/config-resolvers/defaults.d.ts +4 -0
  286. package/lib/types/config-resolvers/lockdown.d.ts +10 -0
  287. package/lib/types/config-resolvers/session.d.ts +6 -0
  288. package/lib/types/config-resolvers/shared.d.ts +16 -0
  289. package/lib/types/config-resolvers/sources.d.ts +6 -0
  290. package/lib/types/config-resolvers/ui.d.ts +6 -0
  291. package/lib/types/entry-redirect.d.ts +20 -0
  292. package/lib/types/host-route.d.ts +14 -1
  293. package/lib/types/index.d.ts +54 -3
  294. package/lib/types/launch-token.d.ts +21 -0
  295. package/lib/types/profile.d.ts +76 -0
  296. package/lib/types/prompt-notes.d.ts +110 -0
  297. package/lib/types/provenance/collector.d.ts +26 -0
  298. package/lib/types/provenance/connectors.d.ts +11 -0
  299. package/lib/types/provenance/dedupe.d.ts +6 -0
  300. package/lib/types/provenance/extractors.d.ts +14 -0
  301. package/lib/types/provenance/file-preview.d.ts +10 -0
  302. package/lib/types/provenance/host-store.d.ts +54 -0
  303. package/lib/types/provenance/index.d.ts +10 -0
  304. package/lib/types/provenance/normalize.d.ts +13 -0
  305. package/lib/types/provenance/reported.d.ts +5 -0
  306. package/lib/types/provenance/types.d.ts +78 -0
  307. package/lib/types/resolve-config.d.ts +8 -3
  308. package/lib/types/secure-session.d.ts +36 -2
  309. package/lib/types/shared/session-key.d.ts +23 -0
  310. package/lib/types/shared/settings.d.ts +10 -0
  311. package/lib/types/thinking-phrases.d.ts +17 -0
  312. package/lib/types/types.d.ts +290 -16
  313. package/lib/types/user-workspace.d.ts +38 -0
  314. package/lib/user-workspace.js +231 -0
  315. package/lib/user-workspace.js.map +1 -0
  316. package/package.json +71 -47
  317. package/CHANGELOG.md +0 -93
  318. package/SPEC-dsh-qa-surface.md +0 -2425
  319. package/docs/ARCHITECTURE.md +0 -66
  320. package/docs/COMPATIBILITY.md +0 -14
  321. package/docs/CONFIGURATION.md +0 -112
  322. package/docs/EMBEDDING.md +0 -13
  323. package/lib/client/components/QaSourcesDrawer.js +0 -46
  324. package/lib/client/components/QaSourcesDrawer.js.map +0 -1
  325. package/lib/types/client/components/QaSourcesDrawer.d.ts +0 -8
@@ -33,13 +33,31 @@ const QA_BRAND_PALETTE = {
33
33
  warningHover: "#DF9911",
34
34
  // Text/icon color placed on top of an accent fill.
35
35
  accentContrast: "#FFFFFF",
36
+ // Translucent dialog backdrop over the conversation.
37
+ overlay: "rgba(15, 22, 26, 0.55)",
36
38
  };
37
39
  const QA_BRAND_TOKENS = Object.entries(QA_BRAND_PALETTE)
38
40
  .map(([token, value]) => `--dsh-qa-${token.replace(/[A-Z]/gu, (letter) => `-${letter.toLowerCase()}`)}:${value}`)
39
41
  .join(";");
40
42
  export const QA_SURFACE_STYLES = String.raw `
41
43
  .dsh-qa-surface{${QA_BRAND_TOKENS};position:fixed;inset:0;z-index:2147483000;pointer-events:auto;display:flex;flex-direction:row;min-width:0;height:100vh;height:100dvh;overflow:hidden;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-family:inherit}
44
+ .dsh-qa-onboarding{${QA_BRAND_TOKENS};position:fixed;inset:0;z-index:2147483640;display:grid;place-items:center;padding:24px;background:var(--dsh-qa-overlay);color:var(--dsw-alias-label-primary);font-family:inherit}
45
+ .dsh-qa-onboarding__panel{display:grid;grid-template-columns:auto minmax(0,1fr);gap:18px;width:min(620px,100%);max-height:100%;overflow-y:auto;padding:28px;border:1px solid var(--dsw-alias-border-l2);border-radius:18px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 22px 64px rgba(0,0,0,.28)}
46
+ .dsh-qa-onboarding__mark{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:var(--dsh-qa-accent-soft);color:var(--dsh-qa-accent-hover)}
47
+ .dsh-qa-onboarding__mark svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
48
+ .dsh-qa-onboarding__content{min-width:0}
49
+ .dsh-qa-onboarding__title{margin:2px 0 12px;color:var(--dsw-alias-label-primary);font-size:20px;font-weight:650;line-height:1.35}
50
+ .dsh-qa-onboarding__description{color:var(--dsw-alias-label-secondary);font-size:14px;line-height:1.65}
51
+ .dsh-qa-onboarding__description p{margin:0 0 12px}
52
+ .dsh-qa-onboarding__description p:last-child{margin-bottom:0}
53
+ .dsh-qa-onboarding__actions{display:flex;justify-content:flex-end;margin-top:22px}
54
+ .dsh-qa-onboarding__continue{appearance:none;min-width:164px;padding:10px 18px;border:0;border-radius:999px;background:var(--dsh-qa-accent);color:var(--dsh-qa-accent-contrast);font:inherit;font-size:14px;font-weight:600;line-height:20px;cursor:pointer;transition:background .14s,transform .14s}
55
+ .dsh-qa-onboarding__continue:hover{background:var(--dsh-qa-accent-hover)}
56
+ .dsh-qa-onboarding__continue:active{transform:translateY(1px)}
57
+ .dsh-qa-onboarding__continue:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px}
58
+ @media (max-width:600px){.dsh-qa-onboarding{padding:14px}.dsh-qa-onboarding__panel{grid-template-columns:1fr;gap:12px;padding:22px;border-radius:15px}.dsh-qa-onboarding__mark{width:38px;height:38px;border-radius:11px}.dsh-qa-onboarding__title{font-size:18px}.dsh-qa-onboarding__actions{margin-top:18px}.dsh-qa-onboarding__continue{width:100%}}
42
59
  .dsh-qa-body{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
60
+ .dsh-qa-chat{position:relative;flex:1;min-width:0;min-height:0;display:flex;flex-direction:column}
43
61
  .dsh-qa-sidebar{flex:none;width:264px;display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
44
62
  .dsh-qa-sidebar--collapsed{width:52px;align-items:center;padding-top:12px}
45
63
  .dsh-qa-sidebar__head{display:flex;align-items:center;justify-content:space-between;gap:6px;flex:none;padding:14px 10px 10px 16px}
@@ -59,17 +77,25 @@ export const QA_SURFACE_STYLES = String.raw `
59
77
  .dsh-qa-sidebar__new:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}
60
78
  .dsh-qa-sidebar__new svg{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
61
79
  .dsh-qa-sidebar__search{position:relative;flex:none;padding:0 12px 10px}
62
- .dsh-qa-sidebar__search svg{position:absolute;top:7px;left:22px;width:14px;height:14px;fill:none;stroke:var(--dsw-alias-label-tertiary);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
63
- .dsh-qa-sidebar__search input{display:block;width:100%;padding:7px 10px 7px 32px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:18px;-webkit-appearance:none;appearance:none}
80
+ .dsh-qa-sidebar__search>svg{position:absolute;top:17px;left:22px;width:14px;height:14px;fill:none;stroke:var(--dsw-alias-label-tertiary);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round;pointer-events:none;transform:translateY(-50%)}
81
+ .dsh-qa-sidebar__search input{display:block;width:100%;height:34px;min-width:0;padding:0 34px 0 32px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:18px;-webkit-appearance:none;appearance:none}
82
+ .dsh-qa-sidebar__search input::-webkit-search-cancel-button{-webkit-appearance:none;appearance:none}
64
83
  .dsh-qa-sidebar__search input::placeholder{color:var(--dsw-alias-label-tertiary)}
65
84
  .dsh-qa-sidebar__search input:focus{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px;border-color:transparent}
85
+ .dsh-qa-sidebar__search-clear{position:absolute;top:17px;right:18px;display:grid;place-items:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer;transform:translateY(-50%)}
86
+ .dsh-qa-sidebar__search-clear:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
87
+ .dsh-qa-sidebar__search-clear:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
88
+ .dsh-qa-sidebar__search-clear svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
66
89
  .dsh-qa-sidebar__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 8px 12px}
90
+ .dsh-qa-sidebar__group{margin-top:6px}
91
+ .dsh-qa-sidebar__group:first-child{margin-top:0}
92
+ .dsh-qa-sidebar__group-name{padding:4px 6px 2px;color:var(--dsw-alias-label-tertiary);font-size:11px;font-weight:600;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
67
93
  .dsh-qa-sidebar__empty{margin:8px 8px 0;color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:18px}
68
- .dsh-qa-sidebar__item{display:flex;align-items:center;gap:2px;width:100%;padding:2px;border-radius:8px}
94
+ .dsh-qa-sidebar__item{position:relative;display:flex;align-items:center;width:100%;padding:2px;border-radius:8px}
69
95
  .dsh-qa-sidebar__item:hover,.dsh-qa-sidebar__item--active{background:var(--dsw-alias-bg-layer-2)}
70
- .dsh-qa-sidebar__item-main{appearance:none;display:flex;align-items:center;gap:8px;flex:1;min-width:0;border:0;background:0 0;cursor:pointer;text-align:left;font:inherit;padding:7px 6px;border-radius:8px}
96
+ .dsh-qa-sidebar__item-main{appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-width:0;border:0;background:0 0;cursor:pointer;text-align:left;font:inherit;padding:7px 8px;border-radius:8px}
71
97
  .dsh-qa-sidebar__item-main:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
72
- .dsh-qa-sidebar__item-delete{appearance:none;flex:none;display:flex;align-items:center;justify-content:center;border:0;background:0 0;cursor:pointer;color:var(--dsw-alias-label-tertiary);padding:5px;border-radius:6px;opacity:0;transition:opacity .12s}
98
+ .dsh-qa-sidebar__item-delete{appearance:none;position:absolute;top:50%;right:4px;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border:0;background:var(--dsw-alias-bg-layer-2);cursor:pointer;color:var(--dsw-alias-label-tertiary);padding:5px;border-radius:6px;opacity:0;transform:translateY(-50%);transition:opacity .12s}
73
99
  .dsh-qa-sidebar__item:hover .dsh-qa-sidebar__item-delete,.dsh-qa-sidebar__item-delete:focus-visible,.dsh-qa-sidebar__item-delete--confirm{opacity:1}
74
100
  .dsh-qa-sidebar__item-delete:hover{color:var(--dsw-alias-label-primary)}
75
101
  .dsh-qa-sidebar__item-delete:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
@@ -79,6 +105,78 @@ export const QA_SURFACE_STYLES = String.raw `
79
105
  .dsh-qa-sidebar__item--active .dsh-qa-sidebar__item-title{color:var(--dsw-alias-label-primary);font-weight:500}
80
106
  .dsh-qa-sidebar__item-meta{flex:none;display:flex;align-items:center;gap:5px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:14px}
81
107
  .dsh-qa-sidebar__dot{width:7px;height:7px;border-radius:999px;background:var(--dsh-qa-brand);flex:none}
108
+ .dsh-qa-sidebar__footer{flex:none;padding:8px 16px 12px;border-top:1px solid var(--dsw-alias-border-l2)}
109
+ .dsh-qa-sidebar__version{appearance:none;display:inline-flex;align-items:center;padding:2px 0;border:0;background:0 0;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:12px;line-height:16px;cursor:pointer;transition:color .12s}
110
+ .dsh-qa-sidebar__version:hover{color:var(--dsw-alias-label-primary)}
111
+ .dsh-qa-sidebar__version:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px;border-radius:4px}
112
+ .dsh-qa-sidebar__account{display:flex;align-items:center;gap:6px;min-width:0;margin-bottom:6px}
113
+ .dsh-qa-sidebar__account-name{appearance:none;min-width:0;overflow:hidden;padding:0;border:0;background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:16px;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;transition:color .12s}
114
+ .dsh-qa-sidebar__account-name:hover{color:var(--dsw-alias-label-primary)}
115
+ .dsh-qa-sidebar__account-name:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px;border-radius:4px}
116
+ .dsh-qa-sidebar__account-role{flex:none;padding:1px 6px;border-radius:999px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-tertiary);font-size:10px;font-weight:500;line-height:15px}
117
+ .dsh-qa-sidebar__account-exit{appearance:none;display:grid;place-items:center;flex:none;width:24px;height:24px;padding:0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
118
+ .dsh-qa-sidebar__account-exit:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
119
+ .dsh-qa-sidebar__account-exit:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
120
+ .dsh-qa-sidebar__account-exit svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
121
+ .dsh-qa-auth{align-items:center;justify-content:center;padding:24px}
122
+ .dsh-qa-auth__card{display:flex;flex-direction:column;gap:14px;width:min(360px,100%);padding:28px;border:1px solid var(--dsw-alias-border-l2);border-radius:14px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 18px 48px var(--dsh-qa-overlay)}
123
+ .dsh-qa-auth__brand{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
124
+ .dsh-qa-auth__logo{width:32px;height:32px;fill:none;stroke:var(--dsh-qa-brand);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
125
+ .dsh-qa-auth__brand h1{margin:0;color:var(--dsw-alias-label-primary);font-size:19px;font-weight:600;line-height:26px}
126
+ .dsh-qa-auth__tabs{display:flex;gap:4px;padding:3px;border-radius:9px;background:var(--dsw-alias-bg-module-platform)}
127
+ .dsh-qa-auth__tab{appearance:none;flex:1;padding:6px 0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background .12s,color .12s}
128
+ .dsh-qa-auth__tab:hover{color:var(--dsw-alias-label-primary)}
129
+ .dsh-qa-auth__tab--active{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary)}
130
+ .dsh-qa-auth__tab:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
131
+ .dsh-qa-auth__field{display:flex;flex-direction:column;gap:5px}
132
+ .dsh-qa-auth__field span{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px}
133
+ .dsh-qa-auth__field input{appearance:none;width:100%;padding:9px 11px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:20px}
134
+ .dsh-qa-auth__field input:focus{outline:none;border-color:var(--dsh-qa-brand)}
135
+ .dsh-qa-auth__field input:disabled{opacity:.55}
136
+ .dsh-qa-auth__error{margin:0;color:var(--dsh-qa-error);font-size:12px;line-height:17px}
137
+ .dsh-qa-auth__submit{appearance:none;margin-top:2px;padding:10px 0;border:0;border-radius:9px;background:var(--dsh-qa-brand);color:var(--dsh-qa-accent-contrast);font:inherit;font-size:14px;font-weight:600;line-height:20px;cursor:pointer;transition:background .12s}
138
+ .dsh-qa-auth__submit:hover{background:var(--dsh-qa-accent-hover)}
139
+ .dsh-qa-auth__submit:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
140
+ .dsh-qa-auth__submit:disabled{opacity:.6;cursor:default}
141
+ .dsh-qa-modal{position:fixed;inset:0;z-index:2147483600;display:grid;place-items:center;padding:24px;background:var(--dsh-qa-overlay)}
142
+ .dsh-qa-modal__panel{display:flex;flex-direction:column;width:min(560px,100%);max-height:min(640px,100%);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;background:var(--dsw-alias-bg-layer-2);box-shadow:0 18px 48px var(--dsh-qa-overlay);overflow:hidden}
143
+ .dsh-qa-modal__panel--wide{width:min(720px,100%)}
144
+ .dsh-qa-modal__head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:16px 18px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}
145
+ .dsh-qa-modal__title{margin:0;color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:20px}
146
+ .dsh-qa-modal__close{appearance:none;display:grid;place-items:center;flex:none;width:28px;height:28px;padding:0;border:0;border-radius:8px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
147
+ .dsh-qa-modal__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
148
+ .dsh-qa-modal__close:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
149
+ .dsh-qa-modal__close svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
150
+ .dsh-qa-modal__body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:6px 18px 18px}
151
+ .dsh-qa-modal__footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:none;padding:12px 18px;border-top:1px solid var(--dsw-alias-border-l2)}
152
+ .dsh-qa-changelog__entry{padding-top:10px}
153
+ .dsh-qa-changelog__version{display:flex;align-items:baseline;gap:8px;margin:0 0 2px;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:20px}
154
+ .dsh-qa-changelog__date{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400;line-height:16px}
155
+ .dsh-qa-changelog__current{padding:0 8px;border-radius:999px;background:var(--dsh-qa-accent-soft);color:var(--dsh-qa-accent-hover);font-size:11px;font-weight:500;line-height:17px;white-space:nowrap}
156
+ .dsh-qa-changelog__section{margin:6px 0 0}
157
+ .dsh-qa-changelog__section-title{margin:0;color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}
158
+ .dsh-qa-changelog__list{margin:4px 0 0;padding-left:18px;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}
159
+ .dsh-qa-changelog__list li{margin:3px 0}
160
+ .dsh-qa-changelog__list li::marker{color:var(--dsw-alias-label-tertiary)}
161
+ .dsh-qa-profile{display:flex;flex-direction:column;gap:12px;margin-top:6px}
162
+ .dsh-qa-profile__lead{margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}
163
+ .dsh-qa-profile__field{display:flex;flex-direction:column;gap:5px}
164
+ .dsh-qa-profile__field span{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px}
165
+ .dsh-qa-profile__field input,.dsh-qa-profile__field textarea{appearance:none;width:100%;padding:9px 11px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:20px}
166
+ .dsh-qa-profile__field textarea{min-height:76px;line-height:19px;resize:vertical}
167
+ .dsh-qa-profile__field input:focus,.dsh-qa-profile__field textarea:focus{outline:none;border-color:var(--dsh-qa-brand)}
168
+ .dsh-qa-profile__field input:read-only{opacity:.6}
169
+ .dsh-qa-profile__count{margin:-6px 0 0;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px;text-align:right}
170
+ .dsh-qa-profile__hint{margin:0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}
171
+ .dsh-qa-profile__error{margin:0;color:var(--dsh-qa-error);font-size:12px;line-height:17px}
172
+ .dsh-qa-profile__save{appearance:none;padding:8px 16px;border:0;border-radius:9px;background:var(--dsh-qa-brand);color:var(--dsh-qa-accent-contrast);font:inherit;font-size:13px;font-weight:600;line-height:19px;cursor:pointer;transition:background .12s}
173
+ .dsh-qa-profile__save:hover{background:var(--dsh-qa-accent-hover)}
174
+ .dsh-qa-profile__save:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
175
+ .dsh-qa-profile__save:disabled{opacity:.6;cursor:default}
176
+ .dsh-qa-profile__cancel{appearance:none;padding:8px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:0 0;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:19px;cursor:pointer;transition:color .12s}
177
+ .dsh-qa-profile__cancel:hover{color:var(--dsw-alias-label-primary)}
178
+ .dsh-qa-profile__cancel:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
179
+ .dsh-qa-profile__cancel:disabled{opacity:.6;cursor:default}
82
180
  .dsh-qa-surface *{box-sizing:border-box}
83
181
  .dsh-qa-surface ::selection{background:var(--dsh-qa-text-select)}
84
182
  .dsh-qa-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@@ -92,7 +190,6 @@ export const QA_SURFACE_STYLES = String.raw `
92
190
  .dsh-qa-header__mode svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
93
191
  .dsh-qa-header__reset{margin-left:auto;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;cursor:pointer}
94
192
  .dsh-qa-header__agents{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:20px;cursor:pointer}
95
- .dsh-qa-header__agents--end{margin-left:auto}
96
193
  .dsh-qa-header__agents:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
97
194
  .dsh-qa-header__agents:disabled{opacity:.45;cursor:default}
98
195
  .dsh-qa-header__agents[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
@@ -127,19 +224,32 @@ export const QA_SURFACE_STYLES = String.raw `
127
224
  .dsh-qa-agents__meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:15px}
128
225
  .dsh-qa-agents__open{flex:none;color:var(--dsh-qa-accent);font-size:12px;font-weight:500;line-height:18px}
129
226
  .dsh-qa-header__sources{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:20px;cursor:pointer}
130
- .dsh-qa-header__sources--end{margin-left:auto}
131
227
  .dsh-qa-header__sources:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
132
228
  .dsh-qa-header__sources:disabled{opacity:.45;cursor:default}
133
229
  .dsh-qa-header__sources[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
134
230
  .dsh-qa-header__sources svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
135
231
  .dsh-qa-header__sources:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
232
+ .dsh-qa-header__files{display:inline-flex;align-items:center;gap:6px;flex:none;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;line-height:20px;cursor:pointer}
233
+ .dsh-qa-header__files--end{margin-left:auto}
234
+ .dsh-qa-header__files:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
235
+ .dsh-qa-header__files:disabled{opacity:.45;cursor:default}
236
+ .dsh-qa-header__files[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
237
+ .dsh-qa-header__files svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
238
+ .dsh-qa-header__files:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
136
239
  .dsh-qa-header__reset:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
137
240
  .dsh-qa-header__reset:disabled{opacity:.45;cursor:default}
138
241
  .dsh-qa-header__tabs{position:relative;z-index:1;display:flex;gap:32px;margin-top:4px}
139
242
  .dsh-qa-header__tabs span{position:relative;padding:0 0 11px;color:var(--dsh-qa-accent);font-size:13px;font-weight:500;line-height:16px}
140
243
  .dsh-qa-header__tabs span::after{content:"";position:absolute;right:0;bottom:1px;left:0;height:2px;border-radius:2px;background:var(--dsh-qa-accent)}
141
244
  .dsh-qa-transcript{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
142
- .dsh-qa-transcript__inner{width:100%;min-height:100%;margin:0 auto;padding:18px 16px 42px}
245
+ .dsh-qa-transcript__inner{width:100%;max-width:var(--dsh-qa-content-width);min-height:100%;margin:0 auto;padding:18px 16px 42px}
246
+ .dsh-qa-width-handle{position:absolute;z-index:8;top:0;bottom:0;width:max(0px,min(40px,calc((100% - var(--dsh-qa-content-width)) / 2 - 48px)));cursor:col-resize;touch-action:none;user-select:none}
247
+ .dsh-qa-width-handle[data-side="left"]{right:calc(50% + var(--dsh-qa-content-width) / 2 + 24px)}
248
+ .dsh-qa-width-handle[data-side="right"]{left:calc(50% + var(--dsh-qa-content-width) / 2 + 24px)}
249
+ .dsh-qa-width-handle::after{content:"";position:absolute;top:0;bottom:0;width:3px;border-radius:3px;background:linear-gradient(to bottom,transparent calc(var(--dsh-qa-width-handle-pointer-y,50%) - 52px),var(--dsw-alias-scrollbar-hover-l1) calc(var(--dsh-qa-width-handle-pointer-y,50%) - 12px),var(--dsw-alias-scrollbar-hover-l1) calc(var(--dsh-qa-width-handle-pointer-y,50%) + 12px),transparent calc(var(--dsh-qa-width-handle-pointer-y,50%) + 52px));opacity:0;pointer-events:none}
250
+ .dsh-qa-width-handle[data-side="left"]::after{right:16px}
251
+ .dsh-qa-width-handle[data-side="right"]::after{left:16px}
252
+ .dsh-qa-width-handle:hover::after,.dsh-qa-width-handle[data-dragging]::after{opacity:1}
143
253
  .dsh-qa-welcome{min-height:calc(100% - 40px);display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center;padding:48px 0 88px}
144
254
  .dsh-qa-welcome h2{max-width:620px;margin:0;color:var(--dsw-alias-label-primary);font-size:clamp(25px,4vw,34px);font-weight:600;line-height:1.24;letter-spacing:-.02em}
145
255
  .dsh-qa-welcome p{max-width:520px;margin:10px 0 0;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:21px}
@@ -151,13 +261,43 @@ export const QA_SURFACE_STYLES = String.raw `
151
261
  .dsh-qa-variants button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-1px}
152
262
  .dsh-qa-variants button svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
153
263
  .dsh-qa-variants span{min-width:34px;text-align:center;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;font-variant-numeric:tabular-nums}
154
- .dsh-qa-sources{flex:none;display:flex;flex-direction:column;width:360px;min-height:0;border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
155
- .dsh-qa-sources__head{display:flex;align-items:center;justify-content:space-between;flex:none;padding:14px 12px 10px 16px;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:20px}
156
- .dsh-qa-sources__head button{appearance:none;display:grid;place-items:center;width:26px;height:26px;padding:0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
157
- .dsh-qa-sources__head button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
158
- .dsh-qa-sources__head button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
159
- .dsh-qa-sources__head button svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}
264
+ .dsh-qa-panel{flex:none;display:flex;flex-direction:column;width:360px;min-height:0;border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base)}
265
+ .dsh-qa-panel__strip{display:flex;align-items:center;gap:4px;flex:none;padding:10px 10px 8px 12px}
266
+ .dsh-qa-panel__tab{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:13px;font-weight:500;line-height:20px;cursor:pointer}
267
+ .dsh-qa-panel__tab span{display:inline-grid;place-items:center;min-width:19px;height:18px;padding:0 5px;border-radius:999px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-tertiary);font-size:10px;font-weight:400;line-height:18px}
268
+ .dsh-qa-panel__tab:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
269
+ .dsh-qa-panel__tab--active{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
270
+ .dsh-qa-panel__tab--active span{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary)}
271
+ .dsh-qa-panel__tab:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
272
+ .dsh-qa-panel__close{appearance:none;display:grid;place-items:center;width:26px;height:26px;margin-left:auto;flex:none;padding:0;border:0;border-radius:7px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
273
+ .dsh-qa-panel__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
274
+ .dsh-qa-panel__close:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
275
+ .dsh-qa-panel__close svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}
276
+ .dsh-qa-panel__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
277
+ .dsh-qa-sourcespanel{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
278
+ .dsh-qa-sourcespanel__all{appearance:none;flex:none;align-self:flex-start;margin:2px 12px 10px 16px;padding:0;border:0;background:transparent;color:var(--dsh-qa-accent);font:inherit;font-size:12px;cursor:pointer}
279
+ .dsh-qa-sourcespanel__all:hover{text-decoration:underline}
280
+ .dsh-qa-sourcespanel__all:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
281
+ .dsh-qa-files{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 10px 12px}
282
+ .dsh-qa-files__empty{margin:12px 6px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:17px}
283
+ .dsh-qa-files__group{margin:0 0 14px}
284
+ .dsh-qa-files__group h3{display:flex;align-items:center;gap:7px;margin:6px 4px 8px;color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}
285
+ .dsh-qa-files__jump{appearance:none;display:grid;place-items:center;width:22px;height:22px;flex:none;padding:0;border:0;border-radius:6px;background:0 0;color:var(--dsw-alias-label-tertiary);cursor:pointer}
286
+ .dsh-qa-files__jump:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
287
+ .dsh-qa-files__jump:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:-2px}
288
+ .dsh-qa-files__jump svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
289
+ .dsh-qa-files__items{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
290
+ .dsh-qa-files__thumb{display:inline-block;width:72px;height:54px;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2)}
291
+ span.dsh-qa-files__thumb{display:inline-block}
292
+ img.dsh-qa-files__thumb{object-fit:cover;background:var(--dsw-alias-bg-layer-3)}
160
293
  .dsh-qa-sources__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 10px 12px}
294
+ .dsh-qa-sources__group{margin:0 0 14px}
295
+ .dsh-qa-sources__group h3{display:flex;align-items:center;gap:7px;margin:4px 4px 8px;color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}
296
+ .dsh-qa-sources__group h3 span{display:inline-grid;place-items:center;min-width:19px;height:18px;padding:0 5px;border-radius:999px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-tertiary);font-size:10px}
297
+ .dsh-qa-sources__incomplete{margin:0 2px 12px;padding:9px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:9px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:17px}
298
+ .dsh-qa-sources__more{appearance:none;width:100%;padding:5px;border:0;background:transparent;color:var(--dsh-qa-accent);font:inherit;font-size:12px;cursor:pointer}
299
+ .dsh-qa-sources__badges{display:flex;flex-wrap:wrap;gap:4px;margin-top:2px}
300
+ .dsh-qa-sources__badges>span{padding:1px 6px;border-radius:999px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);font-size:10px;line-height:15px}
161
301
  button.dsh-qa-sources__item{display:flex;gap:10px;width:100%;margin:0 0 8px;padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2);font:inherit;text-align:left;cursor:pointer;transition:border-color .12s}
162
302
  .dsh-qa-sources__kind{display:grid;place-items:center;width:18px;height:18px;flex:none;margin-top:1px;color:var(--dsw-alias-label-tertiary)}
163
303
  .dsh-qa-sources__kind svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}
@@ -185,6 +325,21 @@ a.dsh-qa-sources__title:hover{text-decoration:underline}
185
325
  .dsh-qa-sourcedetail__body a{color:var(--dsh-qa-accent);text-decoration:underline}
186
326
  .dsh-qa-sourcedetail__body p{margin:0}
187
327
  .dsh-qa-sourcedetail__empty{margin:0;color:var(--dsw-alias-label-tertiary)}
328
+ .dsh-qa-sourcedetail__provenance{display:flex;flex-wrap:wrap;gap:3px 10px;margin-top:10px!important;color:var(--dsw-alias-label-tertiary)}
329
+ .dsh-qa-preview__toggle{display:flex;flex:none;padding:2px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-3)}
330
+ .dsh-qa-preview__toggle button{appearance:none;padding:2px 7px;border:0;border-radius:5px;background:transparent;color:var(--dsw-alias-label-tertiary);font:inherit;font-size:10px;line-height:16px;cursor:pointer}
331
+ .dsh-qa-preview__toggle button[aria-pressed="true"]{background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}
332
+ .dsh-qa-preview__toggle button:disabled{opacity:.45;cursor:not-allowed}
333
+ .dsh-qa-preview__notice{margin:0 0 9px!important;padding:7px 9px;border-radius:7px;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}
334
+ .dsh-qa-preview__range{display:flex;align-items:center;gap:8px;margin:0 0 9px!important;color:var(--dsw-alias-label-secondary);font-size:11px}
335
+ .dsh-qa-preview__range button{appearance:none;padding:1px 6px;border:0;background:transparent;color:var(--dsh-qa-accent);font:inherit;font-size:11px;cursor:pointer}
336
+ .dsh-qa-preview__markdown{white-space:normal;color:var(--dsw-alias-label-primary);font-size:13px;line-height:1.6}
337
+ .dsh-qa-preview__markdown p,.dsh-qa-preview__markdown ul,.dsh-qa-preview__markdown ol,.dsh-qa-preview__markdown blockquote,.dsh-qa-preview__markdown pre,.dsh-qa-preview__markdown table{margin:0 0 10px}
338
+ .dsh-qa-preview__raw{max-width:100%;margin:0;overflow:auto;white-space:pre;background:var(--dsw-alias-bg-layer-3);font:11px/18px ui-monospace,SFMono-Regular,Consolas,monospace}
339
+ .dsh-qa-preview__raw code{display:block;min-width:max-content}
340
+ .dsh-qa-preview__line{display:flex;min-height:18px}
341
+ .dsh-qa-preview__line--highlight{background:var(--dsw-alias-interactive-bg-hover)}
342
+ .dsh-qa-preview__number{width:46px;flex:none;padding-right:10px;color:var(--dsw-alias-label-tertiary);text-align:right;user-select:none}
188
343
  .dsh-qa-message{display:flex;flex-direction:column;width:100%;min-width:0;margin:0 0 20px}
189
344
  .dsh-qa-message--user{align-items:flex-end;margin-left:auto}
190
345
  .dsh-qa-message--assistant{align-items:flex-start;margin-right:auto}
@@ -192,7 +347,11 @@ a.dsh-qa-sources__title:hover{text-decoration:underline}
192
347
  .dsh-qa-message--system{align-items:center;margin:4px auto 20px}
193
348
  .dsh-qa-message__content{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font-size:15px;line-height:1.62}
194
349
  .dsh-qa-message--user .dsh-qa-message__content{max-width:min(525px,82%);padding:10px 16px;border-radius:22px;background:var(--dsw-specific-bubble);font-size:16px;line-height:24px}
350
+ .dsh-qa-message__byline{display:block;margin-bottom:2px;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:16px;font-weight:500}
195
351
  .dsh-qa-message__images{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px}
352
+ .dsh-qa-message__files{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px}
353
+ .dsh-qa-message--user .dsh-qa-message__files{justify-content:flex-end}
354
+ .dsh-qa-message__files .dsh-qa-file{background:var(--dsw-alias-bg-layer-3)}
196
355
  .dsh-qa-message--user .dsh-qa-message__images{justify-content:flex-end}
197
356
  .dsh-qa-message__image{display:block;width:132px;height:96px;border-radius:12px;border:1px solid var(--dsw-alias-border-l2);object-fit:cover;background:var(--dsw-alias-bg-layer-2)}
198
357
  a.dsh-qa-message__image{padding:0}
@@ -200,6 +359,9 @@ span.dsh-qa-message__image{display:grid;place-items:center;color:var(--dsw-alias
200
359
  span.dsh-qa-message__image[data-state="broken"]::after{content:"Не удалось загрузить"}
201
360
  span.dsh-qa-message__image[data-state="loading"]{animation:dsh-qa-spin 1.2s linear infinite;border-style:dashed}
202
361
  .dsh-qa-message--assistant .dsh-qa-message__content{width:100%;padding:2px 0}
362
+ .dsh-qa-message__sources{appearance:none;margin-top:10px;padding:4px 9px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;line-height:18px;cursor:pointer}
363
+ .dsh-qa-message__sources:hover{border-color:var(--dsw-alias-label-dimmed);color:var(--dsw-alias-label-primary)}
364
+ .dsh-qa-message__sources:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:1px}
203
365
  .dsh-qa-message--system .dsh-qa-message__content{padding:7px 11px;border-radius:9px;background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}
204
366
  .dsh-qa-message[data-status="info"] .dsh-qa-message__content{color:var(--dsh-qa-info)}
205
367
  .dsh-qa-message[data-status="error"] .dsh-qa-message__content{color:var(--dsh-qa-error)}
@@ -212,6 +374,40 @@ span.dsh-qa-message__image[data-state="loading"]{animation:dsh-qa-spin 1.2s line
212
374
  .dsh-qa-message__actions button[data-active]{color:var(--dsh-qa-accent)}
213
375
  .dsh-qa-message__actions button[data-active]:hover{color:var(--dsh-qa-accent)}
214
376
  .dsh-qa-message__meta{display:flex;align-items:center;gap:12px;min-width:0;padding:0 8px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;white-space:nowrap}
377
+ .dsh-qa-rail{position:sticky;top:0;z-index:7;height:0;pointer-events:none}.dsh-qa-rail__frame{--dsh-qa-rail-band:320px;--dsh-qa-rail-natural:0px;--dsh-qa-rail-inset:6px;--dsh-qa-rail-scroll-top:0px;--dsh-qa-rail-preview-height:100px;position:absolute;top:calc(var(--dsh-qa-rail-band)/2);right:12px;width:28px;height:min(var(--dsh-qa-rail-natural),max(0px,calc(var(--dsh-qa-rail-band) - 64px)),420px);cursor:pointer;pointer-events:auto;transform:translateY(-50%);transition:height 220ms cubic-bezier(.2,.8,.2,1)}
378
+ .dsh-qa-rail__scroll{position:absolute;inset:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none}
379
+ .dsh-qa-rail__scroll::-webkit-scrollbar{display:none}
380
+ .dsh-qa-rail__scroll--fade-top{mask-image:linear-gradient(to bottom,transparent 0,#000 24px,#000 100%)}
381
+ .dsh-qa-rail__scroll--fade-bottom{mask-image:linear-gradient(to bottom,#000 0,#000 calc(100% - 24px),transparent 100%)}
382
+ .dsh-qa-rail__scroll--fade-top.dsh-qa-rail__scroll--fade-bottom{mask-image:linear-gradient(to bottom,transparent 0,#000 24px,#000 calc(100% - 24px),transparent 100%)}
383
+ .dsh-qa-rail__marks{position:relative;height:var(--dsh-qa-rail-natural)}
384
+ .dsh-qa-rail__pos{position:absolute;top:calc(var(--dsh-qa-rail-pos) + var(--dsh-qa-rail-inset));right:0;left:0;height:10px;transform:translateY(-50%);transition:top 220ms cubic-bezier(.2,.8,.2,1);animation:dsh-qa-rail-enter 150ms ease-out}
385
+ .dsh-qa-rail__mark{position:absolute;inset:0 0 0 auto;width:20px;padding:0;border:0;border-radius:8px;background:transparent;cursor:pointer;pointer-events:none}
386
+ .dsh-qa-rail__mark::before{position:absolute;top:50%;right:0;width:12px;height:2px;border-radius:2px;background:var(--dsw-alias-border-l4,var(--dsw-alias-border-l2));content:"";transform:translateY(-50%);transition:width 140ms ease,background-color 140ms ease}
387
+ .dsh-qa-rail__mark--preview::before{width:18px;background:var(--dsw-alias-label-tertiary)}
388
+ .dsh-qa-rail__mark--busy::before{animation:dsh-qa-rail-busy 1s ease-in-out infinite}
389
+ .dsh-qa-rail__mark--active::before{width:20px;background:var(--dsw-alias-label-primary)}
390
+ .dsh-qa-rail__mark:focus-visible{outline:1px solid var(--dsh-qa-accent);outline-offset:2px}
391
+ .dsh-qa-rail__mark:focus-visible::before{width:20px;background:var(--dsh-qa-accent)}
392
+ .dsh-qa-rail__preview{position:absolute;top:clamp(0px,calc(var(--dsh-qa-rail-pos) + var(--dsh-qa-rail-inset) - var(--dsh-qa-rail-scroll-top) - var(--dsh-qa-rail-preview-height)/2),calc(100% - var(--dsh-qa-rail-preview-height)));right:calc(100% + 10px);box-sizing:border-box;width:min(300px,60vw);max-height:var(--dsh-qa-rail-preview-height);overflow:hidden;padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-shadow-lv2);pointer-events:none;animation:dsh-qa-rail-preview-enter 120ms ease-out;transition:top 140ms cubic-bezier(.2,.8,.2,1)}
393
+ .dsh-qa-rail__preview-prompt,.dsh-qa-rail__preview-response{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical}
394
+ .dsh-qa-rail__preview-prompt{font-size:13px;font-weight:600;line-height:18px;-webkit-line-clamp:1}
395
+ .dsh-qa-rail__preview-response{margin-top:4px;color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary));font-size:12px;line-height:17px;-webkit-line-clamp:3}
396
+ @keyframes dsh-qa-rail-enter{from{opacity:0}to{opacity:1}}
397
+ @keyframes dsh-qa-rail-preview-enter{from{opacity:0;transform:translateX(4px)}to{opacity:1;transform:translateX(0)}}
398
+ @keyframes dsh-qa-rail-busy{0%,100%{opacity:1}50%{opacity:.35}}
399
+ @media (max-width:900px){.dsh-qa-rail{display:none}}
400
+ .dsh-qa-srcref{position:relative;display:inline-flex;align-items:center;gap:5px;max-width:320px;margin:0 1px;padding:2px 9px 2px 7px;border:1px solid var(--dsw-alias-border-l2);border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);font-size:13px;line-height:18px;font-weight:500;text-decoration:none;vertical-align:baseline;cursor:pointer;transition:border-color .12s,color .12s}
401
+ a.dsh-qa-srcref:hover,button.dsh-qa-srcref:hover{border-color:var(--dsw-alias-label-dimmed);color:var(--dsw-alias-label-primary)}
402
+ .dsh-qa-srcref:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:1px}
403
+ .dsh-qa-srcref__icon{display:grid;place-items:center;width:14px;height:14px;flex:none;color:var(--dsw-alias-label-tertiary)}
404
+ .dsh-qa-srcref__icon svg{width:13px;height:13px;display:block;fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
405
+ .dsh-qa-srcref__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
406
+ .dsh-qa-srcref__card{position:absolute;top:calc(100% + 6px);left:0;z-index:9;display:none;width:min(320px,calc(100vw - 48px));padding:10px 12px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);font-size:12px;line-height:17px;font-weight:400;text-align:left;white-space:normal;cursor:default}
407
+ .dsh-qa-srcref:hover .dsh-qa-srcref__card,.dsh-qa-srcref:focus-visible .dsh-qa-srcref__card{display:block}
408
+ .dsh-qa-srcref__card-title{display:flex;align-items:center;gap:6px;min-width:0;overflow:hidden;color:var(--dsw-alias-label-primary);font-weight:600;text-overflow:ellipsis;white-space:nowrap}
409
+ .dsh-qa-srcref__card-target{display:block;overflow:hidden;margin-top:2px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px;text-overflow:ellipsis;white-space:nowrap}
410
+ .dsh-qa-srcref__card-snippet{display:-webkit-box;overflow:hidden;margin-top:6px;color:var(--dsw-alias-label-secondary);-webkit-box-orient:vertical;-webkit-line-clamp:3}
215
411
 
216
412
  .dsh-qa-message__content p,.dsh-qa-message__content ul,.dsh-qa-message__content blockquote,.dsh-qa-message__content pre{margin:0 0 14px}
217
413
  .dsh-qa-message__content :last-child{margin-bottom:0}
@@ -247,6 +443,8 @@ span.dsh-qa-message__image[data-state="loading"]{animation:dsh-qa-spin 1.2s line
247
443
  .dsh-qa-work{width:100%;color:var(--dsw-alias-label-secondary);font-size:14px;line-height:22px}
248
444
  .dsh-qa-work__toggle{display:flex;align-items:center;gap:7px;min-height:30px;margin:0;padding:3px 5px 3px 0;border:0;border-radius:7px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer}
249
445
  .dsh-qa-work__toggle:hover{color:var(--dsw-alias-label-primary)}
446
+ .dsh-qa-work[data-state="error"] .dsh-qa-work__toggle{color:var(--dsh-qa-error)}
447
+ .dsh-qa-work[data-state="error"] .dsh-qa-work__toggle:hover{color:var(--dsh-qa-error)}
250
448
  .dsh-qa-work__toggle:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
251
449
  .dsh-qa-work__chevron{width:14px;height:14px;flex:none;fill:none;stroke:currentColor;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease}
252
450
  .dsh-qa-work__chevron[data-open],.dsh-qa-work-tool[open]>.dsh-qa-work-item .dsh-qa-work__chevron{transform:rotate(90deg)}
@@ -277,7 +475,7 @@ span.dsh-qa-message__image[data-state="loading"]{animation:dsh-qa-spin 1.2s line
277
475
  .dsh-qa-error{display:flex;align-items:center;justify-content:center;gap:10px;margin:16px auto;padding:10px 12px;border:1px solid var(--dsh-qa-error);border-radius:10px;color:var(--dsw-alias-label-primary);font-size:13px}
278
476
  .dsh-qa-error button{border:0;background:transparent;color:var(--dsh-qa-accent);font:inherit;font-weight:600;cursor:pointer}
279
477
  .dsh-qa-footer{position:relative;flex:none;padding:28px 16px max(12px,env(safe-area-inset-bottom));background:linear-gradient(180deg,color-mix(in srgb,var(--dsw-alias-bg-base) 0%,transparent) 0,var(--dsw-alias-bg-base) 28px)}
280
- .dsh-qa-footer__inner{width:100%;margin:0 auto}
478
+ .dsh-qa-footer__inner{width:100%;max-width:var(--dsh-qa-content-width);margin:0 auto}
281
479
  .dsh-qa-composer-wrap{display:flex;flex-direction:column;gap:10px;width:100%}
282
480
  .dsh-qa-footer__disclaimer{display:flex;align-items:flex-start;justify-content:center;gap:6px;margin:10px auto 0;max-width:640px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px;text-align:left}
283
481
  .dsh-qa-footer__disclaimer svg{width:13px;height:13px;flex:none;margin-top:1px;fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round}
@@ -288,6 +486,16 @@ span.dsh-qa-message__image[data-state="loading"]{animation:dsh-qa-spin 1.2s line
288
486
  .dsh-qa-quick-questions button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:1px}
289
487
  .dsh-qa-composer-wrap--drag .dsh-qa-composer{border-color:var(--dsh-qa-accent);border-style:dashed;background:color-mix(in srgb,var(--dsh-qa-accent) 6%,var(--dsw-specific-input-major))}
290
488
  .dsh-qa-composer__images{display:flex;flex-wrap:wrap;gap:8px}
489
+ .dsh-qa-composer__files{display:flex;flex-wrap:wrap;gap:8px}
490
+ .dsh-qa-file{display:flex;align-items:center;gap:10px;max-width:280px;min-width:0;padding:8px 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}
491
+ .dsh-qa-file__badge{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:9px;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-secondary);font-size:10px;font-weight:700;letter-spacing:.02em}
492
+ .dsh-qa-file__text{display:flex;flex-direction:column;gap:1px;min-width:0}
493
+ .dsh-qa-file__name{color:var(--dsw-alias-label-primary);font-size:13px;line-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
494
+ .dsh-qa-file__meta{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}
495
+ .dsh-qa-file button{display:grid;place-items:center;flex:none;width:18px;height:18px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}
496
+ .dsh-qa-file button:hover{color:var(--dsh-qa-error)}
497
+ .dsh-qa-file button:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:1px}
498
+ .dsh-qa-file button svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
291
499
  .dsh-qa-composer__image{position:relative;display:block;width:64px;height:64px;flex:none}
292
500
  .dsh-qa-composer__image img{display:block;width:100%;height:100%;object-fit:cover;border-radius:10px;border:1px solid var(--dsw-alias-border-l2)}
293
501
  .dsh-qa-composer__image button{position:absolute;top:-6px;right:-6px;display:grid;place-items:center;width:18px;height:18px;padding:0;border:0;border-radius:999px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);cursor:pointer;box-shadow:var(--dsw-shadow-lv2)}
@@ -316,8 +524,8 @@ span.dsh-qa-message__image[data-state="loading"]{animation:dsh-qa-spin 1.2s line
316
524
  .dsh-qa-composer__action:disabled{opacity:.4;cursor:default}
317
525
  .dsh-qa-composer__action:focus-visible,.dsh-qa-error button:focus-visible,.dsh-qa-header__reset:focus-visible{outline:2px solid var(--dsh-qa-accent);outline-offset:2px}
318
526
  @media (hover:hover){.dsh-qa-message__actions .dsh-qa-message__meta{opacity:0;transition:opacity 80ms ease}.dsh-qa-message:hover .dsh-qa-message__actions .dsh-qa-message__meta,.dsh-qa-message:focus-within .dsh-qa-message__actions .dsh-qa-message__meta,.dsh-qa-message__actions[data-persistent] .dsh-qa-message__meta{opacity:1}}.dsh-qa-message__actions[data-persistent] .dsh-qa-message__meta{opacity:1}
319
- @media (max-width:600px){.dsh-qa-sidebar{display:none}.dsh-qa-sources,.dsh-qa-agents{position:absolute;inset:0;z-index:6;width:100%;border-left:0}.dsh-qa-header__inner{padding-left:16px;padding-right:16px}.dsh-qa-header h1{max-width:48vw}.dsh-qa-header__mode{font-size:12px}.dsh-qa-transcript__inner{padding:16px 16px 28px}.dsh-qa-message{margin-bottom:16px}.dsh-qa-message--user .dsh-qa-message__content{max-width:88%;font-size:15px}.dsh-qa-message__content{font-size:14px}.dsh-qa-footer{padding-left:10px;padding-right:10px;padding-bottom:max(8px,env(safe-area-inset-bottom))}.dsh-qa-composer{min-height:84px;padding-top:12px}.dsh-qa-composer__hint{font-size:0}.dsh-qa-composer__hint::after{content:"Enter: отправить";font-size:11px}}
527
+ @media (max-width:600px){.dsh-qa-sidebar{display:none}.dsh-qa-panel,.dsh-qa-agents{position:absolute;inset:0;z-index:6;width:100%;border-left:0}.dsh-qa-header__inner{padding-left:16px;padding-right:16px}.dsh-qa-header h1{max-width:48vw}.dsh-qa-header__mode{font-size:12px}.dsh-qa-width-handle{display:none}.dsh-qa-transcript__inner{max-width:100%;padding:16px 16px 28px}.dsh-qa-footer__inner{max-width:100%}.dsh-qa-message{margin-bottom:16px}.dsh-qa-message--user .dsh-qa-message__content{max-width:88%;font-size:15px}.dsh-qa-message__content{font-size:14px}.dsh-qa-footer{padding-left:10px;padding-right:10px;padding-bottom:max(8px,env(safe-area-inset-bottom))}.dsh-qa-composer{min-height:84px;padding-top:12px}.dsh-qa-composer__hint{font-size:0}.dsh-qa-composer__hint::after{content:"Enter: отправить";font-size:11px}}
320
528
  @media (max-height:480px) and (orientation:landscape){.dsh-qa-header__inner{padding-top:6px}.dsh-qa-header__tabs{display:none}.dsh-qa-transcript__inner{padding-top:12px}.dsh-qa-footer{padding-top:12px}.dsh-qa-composer{min-height:72px;gap:4px;padding-top:8px}}
321
- @media (prefers-reduced-motion:reduce){.dsh-qa-message__cursor,.dsh-qa-work__spinner,.dsh-qa-work-item__spinner{animation:none}.dsh-qa-work__chevron{transition:none}}
529
+ @media (prefers-reduced-motion:reduce){.dsh-qa-message__cursor,.dsh-qa-work__spinner,.dsh-qa-work-item__spinner{animation:none}.dsh-qa-work__chevron{transition:none}.dsh-qa-rail__frame,.dsh-qa-rail__pos,.dsh-qa-rail__mark::before,.dsh-qa-rail__mark--busy::before,.dsh-qa-rail__preview{transition:none;animation:none}}
322
530
  `;
323
531
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/client/styles.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,SAAS;IAChB,yDAAyD;IACzD,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,SAAS;IACrB,UAAU,EAAE,SAAS;IACrB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsenC,CAAC"}
@@ -0,0 +1,102 @@
1
+ function firstLine(value) {
2
+ return value.split(/\r?\n/u, 1)[0]?.trim() ?? "";
3
+ }
4
+ function truncate(value, length = 140) {
5
+ return value.length <= length ? value : `${value.slice(0, length - 3)}...`;
6
+ }
7
+ export function flattenToolOutput(node) {
8
+ const parts = node.content.map((block) => block.type === "text" ? block.text : JSON.stringify(block, null, 2));
9
+ if (parts.length === 0 && node.error !== undefined) {
10
+ parts.push(`${node.error.name}: ${node.error.code}`);
11
+ }
12
+ return parts.join("\n") || null;
13
+ }
14
+ function formatToolInput(argsRaw) {
15
+ if (argsRaw === "")
16
+ return null;
17
+ try {
18
+ return JSON.stringify(JSON.parse(argsRaw), null, 2);
19
+ }
20
+ catch {
21
+ return argsRaw;
22
+ }
23
+ }
24
+ function toolSummary(name, argsRaw) {
25
+ try {
26
+ const parsed = JSON.parse(argsRaw);
27
+ if (typeof parsed === "object" && parsed !== null) {
28
+ const values = parsed;
29
+ for (const key of [
30
+ "description",
31
+ "path",
32
+ "file_path",
33
+ "query",
34
+ "pattern",
35
+ "url",
36
+ "command",
37
+ ]) {
38
+ const value = values[key];
39
+ if (typeof value === "string" && value.trim() !== "") {
40
+ return truncate(firstLine(value));
41
+ }
42
+ }
43
+ const fallback = Object.values(values).find((value) => typeof value === "string" && value.trim() !== "");
44
+ if (fallback !== undefined)
45
+ return truncate(firstLine(fallback));
46
+ }
47
+ }
48
+ catch {
49
+ const raw = firstLine(argsRaw);
50
+ if (raw !== "")
51
+ return truncate(raw);
52
+ }
53
+ return name;
54
+ }
55
+ const TOOL_LABELS = Object.freeze({
56
+ bash: "Bash",
57
+ pwsh: "PowerShell",
58
+ read: "Чтение",
59
+ web_fetch: "Загрузка",
60
+ web_search: "Поиск",
61
+ grep: "Поиск",
62
+ glob: "Поиск",
63
+ write: "Запись",
64
+ edit: "Правка",
65
+ str_replace_editor: "Правка",
66
+ run_code: "Код",
67
+ subagent: "Субагент",
68
+ subagent_fork: "Субагент (форк)",
69
+ send_message: "Сообщение агенту",
70
+ list_agents: "Список агентов",
71
+ interrupt_agent: "Остановка агента",
72
+ });
73
+ /** The durable id a continuable launch reports back ("started subagent <id>"). */
74
+ const SUBAGENT_STARTED = /started subagent ([0-9a-f][0-9a-f-]*)/iu;
75
+ function toolLabel(name) {
76
+ return (TOOL_LABELS[name] ?? name.replaceAll("_", " ")) || "Инструмент";
77
+ }
78
+ export function toolStatus(node) {
79
+ if (node.error?.code === "interrupted")
80
+ return "stopped";
81
+ return node.isError ? "error" : "ok";
82
+ }
83
+ export function workTool(callId, name, argsRaw, status, startedAt, endedAt, output) {
84
+ const launched = name === "subagent" || name === "subagent_fork"
85
+ ? (SUBAGENT_STARTED.exec(output ?? "")?.[1] ??
86
+ SUBAGENT_STARTED.exec(argsRaw)?.[1])
87
+ : undefined;
88
+ return {
89
+ id: `tool:${callId}`,
90
+ kind: "tool",
91
+ name,
92
+ label: toolLabel(name),
93
+ summary: toolSummary(name, argsRaw),
94
+ input: formatToolInput(argsRaw),
95
+ output,
96
+ status,
97
+ ...(launched === undefined ? {} : { subagentId: launched }),
98
+ ...(startedAt === undefined ? {} : { startedAt }),
99
+ ...(endedAt === undefined ? {} : { endedAt }),
100
+ };
101
+ }
102
+ //# sourceMappingURL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CAAC,CAAC,CAAC,CAAC;QACtC,CAAC,CAAC,SAAS,CAAC;IAChB,OAAO;QACL,EAAE,EAAE,QAAQ,MAAM,EAAE;QACpB,IAAI,EAAE,MAAM;QACZ,IAAI;QACJ,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC;QACtB,OAAO,EAAE,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC;QACnC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC;QAC/B,MAAM;QACN,MAAM;QACN,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;QAC3D,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;QACjD,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;KAC9C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,98 @@
1
+ import { QaSourceCollector } from "../provenance/collector.js";
2
+ import { createDefaultSourceExtractorRegistry } from "../provenance/extractors.js";
3
+ /** Empty Chat slice matching the host's EMPTY_CHAT_SNAPSHOT, without a value import. */
4
+ const EMPTY_LEGACY = Object.freeze({
5
+ nodes: Object.freeze([]),
6
+ turnTimings: new Map(),
7
+ turnEnds: new Map(),
8
+ partial: null,
9
+ runningCalls: Object.freeze([]),
10
+ });
11
+ /** The transcript-bearing Chat slice of one Conversation snapshot (absent before the view activates). */
12
+ export function chatLegacyOf(snapshot) {
13
+ return snapshot?.views.get("chat")?.legacy ?? EMPTY_LEGACY;
14
+ }
15
+ const DEFAULT_SOURCE_EXTRACTORS = createDefaultSourceExtractorRegistry();
16
+ /**
17
+ * Rebuild canonical turn bundles from durable tool-result metadata. Since the
18
+ * metadata is persisted by DSH, this projection is identical on live updates
19
+ * and replay and requires no assistant-authored bibliography.
20
+ */
21
+ export function projectTurnSources(snapshot, sessionId = "unknown", workspaceRoot) {
22
+ const legacy = chatLegacyOf(snapshot);
23
+ const heads = new Map();
24
+ for (const node of legacy.nodes) {
25
+ if (node.kind !== "assistant")
26
+ continue;
27
+ for (const block of node.blocks) {
28
+ if (block.kind !== "tool-call" || block.callId === "")
29
+ continue;
30
+ heads.set(block.callId, {
31
+ turn: node.turn,
32
+ step: node.step,
33
+ name: block.name,
34
+ argsRaw: block.argsRaw,
35
+ });
36
+ }
37
+ }
38
+ const collectors = new Map();
39
+ const collectorFor = (turn) => {
40
+ let collector = collectors.get(turn);
41
+ if (collector === undefined) {
42
+ collector = new QaSourceCollector({
43
+ sessionId,
44
+ turn,
45
+ registry: DEFAULT_SOURCE_EXTRACTORS,
46
+ });
47
+ collectors.set(turn, collector);
48
+ }
49
+ return collector;
50
+ };
51
+ for (const node of legacy.nodes) {
52
+ if (node.kind === "assistant")
53
+ collectorFor(node.turn);
54
+ }
55
+ let nearestTurn;
56
+ let nearestStep;
57
+ for (const node of legacy.nodes) {
58
+ if (node.kind === "assistant") {
59
+ nearestTurn = node.turn;
60
+ nearestStep = node.step;
61
+ continue;
62
+ }
63
+ if (node.kind !== "tool-result" || node.isError)
64
+ continue;
65
+ const head = heads.get(node.callId);
66
+ // A truncated event window can retain a result after its assistant call
67
+ // head. Keep it addressable in the synthetic turn 0 instead of dropping
68
+ // durable evidence altogether.
69
+ const turn = head?.turn ?? nearestTurn ?? 0;
70
+ const name = head?.name ?? node.call?.name ?? node.callId;
71
+ const argsRaw = head?.argsRaw ?? node.call?.argsRaw ?? "";
72
+ collectorFor(turn).observe({
73
+ toolName: name,
74
+ args: argsRaw,
75
+ result: node.content,
76
+ presentation: node.meta,
77
+ origin: {
78
+ sessionId,
79
+ turn,
80
+ ...((head?.step ?? nearestStep) === undefined
81
+ ? {}
82
+ : { step: head?.step ?? nearestStep }),
83
+ toolCallId: node.callId,
84
+ toolName: name,
85
+ role: "parent",
86
+ },
87
+ ...(workspaceRoot === undefined ? {} : { workspaceRoot }),
88
+ });
89
+ }
90
+ return [...collectors.entries()]
91
+ .sort(([left], [right]) => left - right)
92
+ .map(([, collector]) => collector.snapshot());
93
+ }
94
+ /** Visible evidence sources for the latest turn, shared by the drawer/footer. */
95
+ export function projectSources(snapshot, sessionId = "unknown", workspaceRoot) {
96
+ return (projectTurnSources(snapshot, sessionId, workspaceRoot).at(-1)?.sources ?? []);
97
+ }
98
+ //# sourceMappingURL=turn-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-sources.js","sourceRoot":"","sources":["../../src/client/turn-sources.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,6BAA6B,CAAC;AAEnF,wFAAwF;AACxF,MAAM,YAAY,GAA4B,MAAM,CAAC,MAAM,CAAC;IAC1D,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACxB,WAAW,EAAE,IAAI,GAAG,EAAE;IACtB,QAAQ,EAAE,IAAI,GAAG,EAAE;IACnB,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CAChC,CAAC,CAAC;AAEH,yGAAyG;AACzG,MAAM,UAAU,YAAY,CAC1B,QAA0C;IAE1C,OAAO,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,YAAY,CAAC;AAC7D,CAAC;AAED,MAAM,yBAAyB,GAAG,oCAAoC,EAAE,CAAC;AASzE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,QAA0C,EAC1C,SAAS,GAAG,SAAS,EACrB,aAAsB;IAEtB,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,GAAG,EAA0B,CAAC;IAChD,KAAK,MAAM,IAAI,IAAI,MAAM,C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