@yadsh/dsh-qa-surface 0.6.0 → 0.7.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 (292) hide show
  1. package/README.md +148 -9
  2. package/capability-policy.json +1 -1
  3. package/cordis.patch.yml +2 -1
  4. package/lib/access/capability-catalog.js +144 -0
  5. package/lib/access/capability-catalog.js.map +1 -0
  6. package/lib/access/model.js +379 -0
  7. package/lib/access/model.js.map +1 -0
  8. package/lib/access/role-repository.js +195 -0
  9. package/lib/access/role-repository.js.map +1 -0
  10. package/lib/access/service.js +380 -0
  11. package/lib/access/service.js.map +1 -0
  12. package/lib/access/skill-metadata.js +234 -0
  13. package/lib/access/skill-metadata.js.map +1 -0
  14. package/lib/account-remotes.js +20 -10
  15. package/lib/account-remotes.js.map +1 -1
  16. package/lib/accounts/errors.js.map +1 -1
  17. package/lib/accounts/file.js.map +1 -1
  18. package/lib/accounts/store.js +202 -3
  19. package/lib/accounts/store.js.map +1 -1
  20. package/lib/admin/conversation-log.js +256 -0
  21. package/lib/admin/conversation-log.js.map +1 -0
  22. package/lib/admin/index.js +17 -0
  23. package/lib/admin/index.js.map +1 -0
  24. package/lib/admin/metrics.js +103 -0
  25. package/lib/admin/metrics.js.map +1 -0
  26. package/lib/admin/paging.js +23 -0
  27. package/lib/admin/paging.js.map +1 -0
  28. package/lib/admin/permissions.js +50 -0
  29. package/lib/admin/permissions.js.map +1 -0
  30. package/lib/admin/quality-store.js +485 -0
  31. package/lib/admin/quality-store.js.map +1 -0
  32. package/lib/admin/queue.js +107 -0
  33. package/lib/admin/queue.js.map +1 -0
  34. package/lib/admin/redaction.js +45 -0
  35. package/lib/admin/redaction.js.map +1 -0
  36. package/lib/admin/service.js +897 -0
  37. package/lib/admin/service.js.map +1 -0
  38. package/lib/admin/session-log.js +142 -0
  39. package/lib/admin/session-log.js.map +1 -0
  40. package/lib/attestation.js +6 -0
  41. package/lib/attestation.js.map +1 -1
  42. package/lib/cli.js +9 -6
  43. package/lib/cli.js.map +1 -1
  44. package/lib/client/QaSessionController.js +65 -15
  45. package/lib/client/QaSessionController.js.map +1 -1
  46. package/lib/client/QaSurface.js +144 -6
  47. package/lib/client/QaSurface.js.map +1 -1
  48. package/lib/client/QaTranscriptAdapter.js +1 -0
  49. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  50. package/lib/client/admin/QaAdmin.js +458 -0
  51. package/lib/client/admin/QaAdmin.js.map +1 -0
  52. package/lib/client/admin/format.js +177 -0
  53. package/lib/client/admin/format.js.map +1 -0
  54. package/lib/client/admin/pages/Conversations.js +114 -0
  55. package/lib/client/admin/pages/Conversations.js.map +1 -0
  56. package/lib/client/admin/pages/Overview.js +24 -0
  57. package/lib/client/admin/pages/Overview.js.map +1 -0
  58. package/lib/client/admin/pages/Quality.js +71 -0
  59. package/lib/client/admin/pages/Quality.js.map +1 -0
  60. package/lib/client/admin/pages/Review.js +93 -0
  61. package/lib/client/admin/pages/Review.js.map +1 -0
  62. package/lib/client/admin/pages/Users.js +95 -0
  63. package/lib/client/admin/pages/Users.js.map +1 -0
  64. package/lib/client/admin/routes.js +127 -0
  65. package/lib/client/admin/routes.js.map +1 -0
  66. package/lib/client/admin/shared.js +91 -0
  67. package/lib/client/admin/shared.js.map +1 -0
  68. package/lib/client/admin/styles.js +111 -0
  69. package/lib/client/admin/styles.js.map +1 -0
  70. package/lib/client/attestation.js +14 -2
  71. package/lib/client/attestation.js.map +1 -1
  72. package/lib/client/components/QaChangelog.js +48 -0
  73. package/lib/client/components/QaChangelog.js.map +1 -1
  74. package/lib/client/components/QaHeader.js +3 -3
  75. package/lib/client/components/QaHeader.js.map +1 -1
  76. package/lib/client/components/QaMessage.js +61 -2
  77. package/lib/client/components/QaMessage.js.map +1 -1
  78. package/lib/client/create-session.js +1 -1
  79. package/lib/client/create-session.js.map +1 -1
  80. package/lib/client/index.js +33 -1
  81. package/lib/client/index.js.map +1 -1
  82. package/lib/client/project-session-state.js +10 -5
  83. package/lib/client/project-session-state.js.map +1 -1
  84. package/lib/client/role/RoleSelector.js +31 -0
  85. package/lib/client/role/RoleSelector.js.map +1 -0
  86. package/lib/client/session-sources.js +37 -1
  87. package/lib/client/session-sources.js.map +1 -1
  88. package/lib/client/settings/card.js +2 -2
  89. package/lib/client/settings/card.js.map +1 -1
  90. package/lib/client/settings/sections.js +0 -1
  91. package/lib/client/settings/sections.js.map +1 -1
  92. package/lib/client/styles.js +32 -0
  93. package/lib/client/styles.js.map +1 -1
  94. package/lib/client/types.js +1 -0
  95. package/lib/client/types.js.map +1 -1
  96. package/lib/client.js +10786 -5684
  97. package/lib/client.js.map +1 -1
  98. package/lib/config-resolvers/defaults.js +0 -2
  99. package/lib/config-resolvers/defaults.js.map +1 -1
  100. package/lib/config.js +0 -249
  101. package/lib/config.js.map +1 -1
  102. package/lib/enforcement/skill-policy.js +172 -0
  103. package/lib/enforcement/skill-policy.js.map +1 -0
  104. package/lib/enforcement/tool-grants.js +151 -0
  105. package/lib/enforcement/tool-grants.js.map +1 -0
  106. package/lib/index.js +230 -44
  107. package/lib/index.js.map +1 -1
  108. package/lib/personal-skills/service.js +10 -3
  109. package/lib/personal-skills/service.js.map +1 -1
  110. package/lib/qa-tools/index.js +4 -0
  111. package/lib/qa-tools/index.js.map +1 -1
  112. package/lib/resolve-config.js +0 -2
  113. package/lib/resolve-config.js.map +1 -1
  114. package/lib/secure-session.js +111 -32
  115. package/lib/secure-session.js.map +1 -1
  116. package/lib/typert.host.js +2237 -202
  117. package/lib/typert.remote-client.d.ts +49 -3
  118. package/lib/typert.remote-client.js +1863 -183
  119. package/lib/types/access/capability-catalog.d.ts +37 -0
  120. package/lib/types/access/model.d.ts +60 -0
  121. package/lib/types/access/role-repository.d.ts +32 -0
  122. package/lib/types/access/service.d.ts +57 -0
  123. package/lib/types/access/skill-metadata.d.ts +53 -0
  124. package/lib/types/account-remotes.d.ts +6 -0
  125. package/lib/types/accounts/errors.d.ts +1 -1
  126. package/lib/types/accounts/file.d.ts +16 -5
  127. package/lib/types/accounts/store.d.ts +83 -3
  128. package/lib/types/admin/conversation-log.d.ts +39 -0
  129. package/lib/types/admin/index.d.ts +24 -0
  130. package/lib/types/admin/metrics.d.ts +29 -0
  131. package/lib/types/admin/paging.d.ts +33 -0
  132. package/lib/types/admin/permissions.d.ts +10 -0
  133. package/lib/types/admin/quality-store.d.ts +82 -0
  134. package/lib/types/admin/queue.d.ts +21 -0
  135. package/lib/types/admin/redaction.d.ts +29 -0
  136. package/lib/types/admin/service.d.ts +105 -0
  137. package/lib/types/admin/session-log.d.ts +53 -0
  138. package/lib/types/attestation.d.ts +2 -0
  139. package/lib/types/client/QaSessionController.d.ts +14 -1
  140. package/lib/types/client/QaSurface.d.ts +7 -1
  141. package/lib/types/client/admin/QaAdmin.d.ts +17 -0
  142. package/lib/types/client/admin/format.d.ts +43 -0
  143. package/lib/types/client/admin/pages/Conversations.d.ts +21 -0
  144. package/lib/types/client/admin/pages/Overview.d.ts +13 -0
  145. package/lib/types/client/admin/pages/Quality.d.ts +18 -0
  146. package/lib/types/client/admin/pages/Review.d.ts +15 -0
  147. package/lib/types/client/admin/pages/Users.d.ts +22 -0
  148. package/lib/types/client/admin/routes.d.ts +50 -0
  149. package/lib/types/client/admin/shared.d.ts +53 -0
  150. package/lib/types/client/admin/styles.d.ts +11 -0
  151. package/lib/types/client/attestation.d.ts +8 -1
  152. package/lib/types/client/components/QaHeader.d.ts +5 -1
  153. package/lib/types/client/components/QaMessage.d.ts +14 -1
  154. package/lib/types/client/create-session.d.ts +2 -0
  155. package/lib/types/client/project-session-state.d.ts +2 -0
  156. package/lib/types/client/role/RoleSelector.d.ts +14 -0
  157. package/lib/types/client/session-sources.d.ts +9 -0
  158. package/lib/types/client/settings/sections.d.ts +0 -1
  159. package/lib/types/client/types.d.ts +39 -2
  160. package/lib/types/enforcement/skill-policy.d.ts +29 -0
  161. package/lib/types/enforcement/tool-grants.d.ts +84 -0
  162. package/lib/types/index.d.ts +62 -14
  163. package/lib/types/qa-tools/index.d.ts +2 -0
  164. package/lib/types/secure-session.d.ts +19 -1
  165. package/lib/types/types.d.ts +574 -5
  166. package/package.json +3 -3
  167. package/lib/client/settings/sections/documents.js +0 -88
  168. package/lib/client/settings/sections/documents.js.map +0 -1
  169. package/lib/documents/artifacts/ids.js +0 -43
  170. package/lib/documents/artifacts/ids.js.map +0 -1
  171. package/lib/documents/artifacts/manifest.js +0 -66
  172. package/lib/documents/artifacts/manifest.js.map +0 -1
  173. package/lib/documents/artifacts/store.js +0 -169
  174. package/lib/documents/artifacts/store.js.map +0 -1
  175. package/lib/documents/capabilities.js +0 -93
  176. package/lib/documents/capabilities.js.map +0 -1
  177. package/lib/documents/config.js +0 -302
  178. package/lib/documents/config.js.map +0 -1
  179. package/lib/documents/defaults.js +0 -78
  180. package/lib/documents/defaults.js.map +0 -1
  181. package/lib/documents/errors.js +0 -101
  182. package/lib/documents/errors.js.map +0 -1
  183. package/lib/documents/index.js +0 -80
  184. package/lib/documents/index.js.map +0 -1
  185. package/lib/documents/inspect/facts.js +0 -161
  186. package/lib/documents/inspect/facts.js.map +0 -1
  187. package/lib/documents/inspect/zip.js +0 -108
  188. package/lib/documents/inspect/zip.js.map +0 -1
  189. package/lib/documents/markdown/directives.js +0 -135
  190. package/lib/documents/markdown/directives.js.map +0 -1
  191. package/lib/documents/markdown/frontmatter.js +0 -35
  192. package/lib/documents/markdown/frontmatter.js.map +0 -1
  193. package/lib/documents/markdown/normalize.js +0 -113
  194. package/lib/documents/markdown/normalize.js.map +0 -1
  195. package/lib/documents/orchestrator/assets.js +0 -243
  196. package/lib/documents/orchestrator/assets.js.map +0 -1
  197. package/lib/documents/orchestrator/convert-document.js +0 -186
  198. package/lib/documents/orchestrator/convert-document.js.map +0 -1
  199. package/lib/documents/orchestrator/create-document.js +0 -292
  200. package/lib/documents/orchestrator/create-document.js.map +0 -1
  201. package/lib/documents/orchestrator/extract-document.js +0 -162
  202. package/lib/documents/orchestrator/extract-document.js.map +0 -1
  203. package/lib/documents/orchestrator/inspect-document.js +0 -89
  204. package/lib/documents/orchestrator/inspect-document.js.map +0 -1
  205. package/lib/documents/orchestrator/runtime-deps.js +0 -59
  206. package/lib/documents/orchestrator/runtime-deps.js.map +0 -1
  207. package/lib/documents/orchestrator/scope.js +0 -132
  208. package/lib/documents/orchestrator/scope.js.map +0 -1
  209. package/lib/documents/providers/docling.js +0 -247
  210. package/lib/documents/providers/docling.js.map +0 -1
  211. package/lib/documents/providers/libreoffice.js +0 -130
  212. package/lib/documents/providers/libreoffice.js.map +0 -1
  213. package/lib/documents/providers/markitdown.js +0 -89
  214. package/lib/documents/providers/markitdown.js.map +0 -1
  215. package/lib/documents/providers/pandoc.js +0 -161
  216. package/lib/documents/providers/pandoc.js.map +0 -1
  217. package/lib/documents/providers/process.js +0 -164
  218. package/lib/documents/providers/process.js.map +0 -1
  219. package/lib/documents/providers/registry.js +0 -152
  220. package/lib/documents/providers/registry.js.map +0 -1
  221. package/lib/documents/providers/shared.js +0 -75
  222. package/lib/documents/providers/shared.js.map +0 -1
  223. package/lib/documents/runtime.js +0 -114
  224. package/lib/documents/runtime.js.map +0 -1
  225. package/lib/documents/security/file-types.js +0 -188
  226. package/lib/documents/security/file-types.js.map +0 -1
  227. package/lib/documents/security/limits.js +0 -78
  228. package/lib/documents/security/limits.js.map +0 -1
  229. package/lib/documents/security/mime.js +0 -43
  230. package/lib/documents/security/mime.js.map +0 -1
  231. package/lib/documents/security/paths.js +0 -133
  232. package/lib/documents/security/paths.js.map +0 -1
  233. package/lib/documents/templates/registry.js +0 -147
  234. package/lib/documents/templates/registry.js.map +0 -1
  235. package/lib/documents/templates/resolver.js +0 -59
  236. package/lib/documents/templates/resolver.js.map +0 -1
  237. package/lib/documents/tools/convert.js +0 -125
  238. package/lib/documents/tools/convert.js.map +0 -1
  239. package/lib/documents/tools/create.js +0 -187
  240. package/lib/documents/tools/create.js.map +0 -1
  241. package/lib/documents/tools/index.js +0 -41
  242. package/lib/documents/tools/index.js.map +0 -1
  243. package/lib/documents/tools/inspect.js +0 -135
  244. package/lib/documents/tools/inspect.js.map +0 -1
  245. package/lib/documents/tools/shared.js +0 -88
  246. package/lib/documents/tools/shared.js.map +0 -1
  247. package/lib/documents/tools/to-markdown.js +0 -125
  248. package/lib/documents/tools/to-markdown.js.map +0 -1
  249. package/lib/documents/types.js +0 -12
  250. package/lib/documents/types.js.map +0 -1
  251. package/lib/types/client/settings/sections/documents.d.ts +0 -13
  252. package/lib/types/documents/artifacts/ids.d.ts +0 -14
  253. package/lib/types/documents/artifacts/manifest.d.ts +0 -32
  254. package/lib/types/documents/artifacts/store.d.ts +0 -67
  255. package/lib/types/documents/capabilities.d.ts +0 -32
  256. package/lib/types/documents/config.d.ts +0 -27
  257. package/lib/types/documents/defaults.d.ts +0 -161
  258. package/lib/types/documents/errors.d.ts +0 -42
  259. package/lib/types/documents/index.d.ts +0 -63
  260. package/lib/types/documents/inspect/facts.d.ts +0 -43
  261. package/lib/types/documents/inspect/zip.d.ts +0 -28
  262. package/lib/types/documents/markdown/directives.d.ts +0 -39
  263. package/lib/types/documents/markdown/frontmatter.d.ts +0 -15
  264. package/lib/types/documents/markdown/normalize.d.ts +0 -30
  265. package/lib/types/documents/orchestrator/assets.d.ts +0 -55
  266. package/lib/types/documents/orchestrator/convert-document.d.ts +0 -25
  267. package/lib/types/documents/orchestrator/create-document.d.ts +0 -18
  268. package/lib/types/documents/orchestrator/extract-document.d.ts +0 -24
  269. package/lib/types/documents/orchestrator/inspect-document.d.ts +0 -12
  270. package/lib/types/documents/orchestrator/runtime-deps.d.ts +0 -43
  271. package/lib/types/documents/orchestrator/scope.d.ts +0 -52
  272. package/lib/types/documents/providers/docling.d.ts +0 -54
  273. package/lib/types/documents/providers/libreoffice.d.ts +0 -40
  274. package/lib/types/documents/providers/markitdown.d.ts +0 -28
  275. package/lib/types/documents/providers/pandoc.d.ts +0 -42
  276. package/lib/types/documents/providers/process.d.ts +0 -54
  277. package/lib/types/documents/providers/registry.d.ts +0 -68
  278. package/lib/types/documents/providers/shared.d.ts +0 -27
  279. package/lib/types/documents/runtime.d.ts +0 -59
  280. package/lib/types/documents/security/file-types.d.ts +0 -39
  281. package/lib/types/documents/security/limits.d.ts +0 -24
  282. package/lib/types/documents/security/mime.d.ts +0 -13
  283. package/lib/types/documents/security/paths.d.ts +0 -38
  284. package/lib/types/documents/templates/registry.d.ts +0 -50
  285. package/lib/types/documents/templates/resolver.d.ts +0 -30
  286. package/lib/types/documents/tools/convert.d.ts +0 -9
  287. package/lib/types/documents/tools/create.d.ts +0 -14
  288. package/lib/types/documents/tools/index.d.ts +0 -33
  289. package/lib/types/documents/tools/inspect.d.ts +0 -9
  290. package/lib/types/documents/tools/shared.d.ts +0 -77
  291. package/lib/types/documents/tools/to-markdown.d.ts +0 -12
  292. package/lib/types/documents/types.d.ts +0 -294
@@ -0,0 +1,21 @@
1
+ import type { QaConversationReview, QaMessageFeedback, QaReviewQueueItem } from "../types.js";
2
+ import type { QaManualQueueEntry } from "./quality-store.js";
3
+ /** A tool call that failed inside one conversation, found while projecting it. */
4
+ export interface QaToolFailureSignal {
5
+ readonly conversationId: string;
6
+ readonly messageId?: string;
7
+ readonly at: string;
8
+ }
9
+ export interface QaQueueInput {
10
+ readonly feedback: readonly QaMessageFeedback[];
11
+ readonly reviews: readonly QaConversationReview[];
12
+ readonly manual: readonly QaManualQueueEntry[];
13
+ readonly failures?: readonly QaToolFailureSignal[];
14
+ }
15
+ /**
16
+ * Build queue rows, newest signal first within a priority band. A conversation
17
+ * reached by several signals appears once per answered target, so a reviewer
18
+ * can see that the same chat was rated down twice.
19
+ */
20
+ export declare function deriveQueue({ feedback, reviews, manual, failures, }: QaQueueInput): readonly QaReviewQueueItem[];
21
+ //# sourceMappingURL=queue.d.ts.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The redaction seam of the review console.
3
+ *
4
+ * Review work needs user prompts, tool arguments and tool results — the exact
5
+ * material most likely to carry credentials, customer data or internal
6
+ * knowledge. The default implementation does not pretend to be a DLP engine; it
7
+ * bounds every preview and masks the credential shapes that appear in tool
8
+ * traffic. A deployment that needs more replaces this object, which is why the
9
+ * projection takes a redactor rather than reading the environment.
10
+ */
11
+ export interface QaAdminRedactor {
12
+ /** One user or assistant message text, as the reviewer reads it. */
13
+ redactMessage(text: string): string;
14
+ /** One tool call's raw argument JSON. */
15
+ redactToolArguments(value: string): string;
16
+ /** One tool result preview. */
17
+ redactToolResult(value: string): string;
18
+ }
19
+ /**
20
+ * Preview bounds. A review needs enough to judge a call, not a full dump: a
21
+ * large result would otherwise dominate the transcript and the wire payload.
22
+ */
23
+ export declare const QA_ADMIN_TEXT_LIMIT = 8000;
24
+ export declare const QA_ADMIN_ARGUMENTS_LIMIT = 2000;
25
+ export declare const QA_ADMIN_RESULT_LIMIT = 6000;
26
+ export declare function maskSecrets(value: string): string;
27
+ /** The deployment default: bounded previews with credential shapes masked. */
28
+ export declare const defaultAdminRedactor: QaAdminRedactor;
29
+ //# sourceMappingURL=redaction.d.ts.map
@@ -0,0 +1,105 @@
1
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
2
+ import type { QaAccounts } from "../accounts/store.js";
3
+ import type { QaAccessService } from "../access/service.js";
4
+ import type { QaRoleRepository } from "../access/role-repository.js";
5
+ import type { QaAdminAuditEvent, QaAdminOverview, QaAdminPage, QaAdminUserDetail, QaAdminUserRow, QaAdminUserUpdate, QaAuditQuery, QaConversationDetail, QaConversationQuery, QaConversationReview, QaConversationReviewInput, QaConversationSummary, QaFeedbackQuery, QaFeedbackRow, QaMessageFeedback, QaMessageFeedbackInput, QaQualityMetrics, QaReviewQueueItem, QaReviewQueueRow, QaUserQuery } from "../types.js";
6
+ import type { QaQualityStore } from "./quality-store.js";
7
+ import type { QaAdminRedactor } from "./redaction.js";
8
+ import type { QaSessionLogReader } from "./session-log.js";
9
+ /**
10
+ * The administrative console's server side.
11
+ *
12
+ * Every entry point takes the caller's token and names the permission it
13
+ * needs; there is no `isAdmin` shortcut and no client-supplied identity. The
14
+ * browser may only ever read what a role grants, and every write lands in the
15
+ * audit trail with its before and after images.
16
+ */
17
+ export declare const QA_ADMIN_PAGE_DEFAULT = 25;
18
+ export declare const QA_ADMIN_PAGE_MAX = 100;
19
+ /**
20
+ * How many conversations one metrics or search pass will open. Reading every
21
+ * stored log is unbounded work, so the aggregation covers the newest logs and
22
+ * says so; moving these counters onto a real index is the next iteration.
23
+ */
24
+ export declare const QA_ADMIN_SCAN_LIMIT = 200;
25
+ interface QaServiceClock {
26
+ now(): number;
27
+ }
28
+ export interface QaAdminServiceOptions {
29
+ readonly accounts: () => QaAccounts | undefined;
30
+ readonly quality: () => QaQualityStore;
31
+ readonly roles: () => QaRoleRepository;
32
+ readonly access: () => QaAccessService;
33
+ readonly sessionLog: QaSessionLogReader;
34
+ readonly logger: PluginLogger;
35
+ readonly redactor?: QaAdminRedactor;
36
+ readonly clock?: QaServiceClock;
37
+ }
38
+ export declare class QaAdminService {
39
+ private readonly options;
40
+ private readonly redactor;
41
+ private readonly transcripts;
42
+ constructor(options: QaAdminServiceOptions);
43
+ private requireAccounts;
44
+ /**
45
+ * Resolve the caller and check one permission. The refusal carries the shared
46
+ * `forbidden` reason, so a browser shows the same audience-safe copy for
47
+ * every administrative surface it may not open.
48
+ */
49
+ private require;
50
+ /**
51
+ * The deployment's conversation index: one row per reserved QA session,
52
+ * enriched with the stored header when the deployment can list one. A chat
53
+ * that exists but has no readable log still appears — the reviewer must see
54
+ * that it happened.
55
+ */
56
+ private index;
57
+ /** One conversation's projected log, cached for the TTL unless asked fresh. */
58
+ private transcript;
59
+ private facts;
60
+ overview(token: string): Promise<QaAdminOverview>;
61
+ metrics(token: string): Promise<QaQualityMetrics>;
62
+ private metricsOf;
63
+ /** One attention line per condition worth an administrator's time. */
64
+ private alertsOf;
65
+ users(token: string, query: QaUserQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaAdminUserRow>>;
66
+ user(token: string, userId: string): Promise<QaAdminUserDetail>;
67
+ updateUser(token: string, userId: string, update: QaAdminUserUpdate): Promise<QaAdminUserDetail>;
68
+ /**
69
+ * Refuse a write that would leave the deployment without a usable admin.
70
+ * Granting the admin role carries no such risk; demoting or disabling the
71
+ * last enabled administrator locks everyone out of the console.
72
+ */
73
+ private assertAdminSurvives;
74
+ /** Validate an assignment against the enabled roles before storing it. */
75
+ private exactAssignment;
76
+ conversations(token: string, query: QaConversationQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaConversationSummary>>;
77
+ private summaryOf;
78
+ conversation(token: string, conversationId: string): Promise<QaConversationDetail>;
79
+ private failuresOf;
80
+ private failureSignals;
81
+ /**
82
+ * Record the caller's verdict on one assistant message. The conversation must
83
+ * be the caller's own: a rating is the user's own signal, and nobody rates
84
+ * someone else's answer on their behalf.
85
+ */
86
+ rateMessage(token: string, conversationId: string, messageId: string, input: QaMessageFeedbackInput): QaMessageFeedback;
87
+ feedback(token: string, query: QaFeedbackQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaFeedbackRow>>;
88
+ private feedbackRows;
89
+ private queueRows;
90
+ reviewQueue(token: string, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaReviewQueueRow>>;
91
+ /** Park a conversation for review without rating it. */
92
+ queueConversation(token: string, conversationId: string, messageId: string | undefined): QaReviewQueueItem;
93
+ /** Save a reviewer's verdict, and take the item out of the queue when done. */
94
+ saveReview(token: string, input: QaConversationReviewInput): QaConversationReview;
95
+ /**
96
+ * The audit trail as one table. Two writers keep records — the capability
97
+ * service, whose repository predates the console, and the quality store —
98
+ * and an administrator expects one timeline, so both are normalized here.
99
+ */
100
+ audit(token: string, query: QaAuditQuery, cursor: string | undefined, limit: number | undefined): Promise<QaAdminPage<QaAdminAuditEvent>>;
101
+ /** Capability-policy events, reshaped into the console's audit vocabulary. */
102
+ private accessAuditEvents;
103
+ }
104
+ export {};
105
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1,53 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { QaTranscriptUnavailableReason } from "../types.js";
3
+ import type { StoredSessionEvent } from "./conversation-log.js";
4
+ /**
5
+ * Read access to the deployment's conversations.
6
+ *
7
+ * Two sources, because neither alone is complete:
8
+ *
9
+ * - Durable storage (`ctx.sessionQuery`) owns history — every conversation a
10
+ * deployment ever had, including the ones this process never opened. Its
11
+ * concrete backend is a deployment choice, so the service is read off the
12
+ * context at call time and described structurally: the QA bundle must keep
13
+ * loading on a deployment that serves no query engine.
14
+ * - The live session store (`ctx.sessions`) owns the chats running right now.
15
+ * It is the one source that always exists, and it is what a chat becomes the
16
+ * moment its first message is appended.
17
+ *
18
+ * Reads never throw for an unavailable backend: the caller gets a reason, so
19
+ * the review viewer can say why a transcript is missing instead of failing the
20
+ * whole page.
21
+ */
22
+ export interface QaStoredSessionHeader {
23
+ readonly id: string;
24
+ /** Epoch milliseconds, as the session header records it. */
25
+ readonly createdAt: number;
26
+ readonly cwd?: string;
27
+ /** Set on a subagent's session; such sessions are not conversations. */
28
+ readonly parentSessionId?: string;
29
+ readonly agentPreset?: string;
30
+ }
31
+ export type QaSessionReadResult = {
32
+ readonly ok: true;
33
+ readonly events: readonly StoredSessionEvent[];
34
+ } | {
35
+ readonly ok: false;
36
+ readonly reason: QaTranscriptUnavailableReason;
37
+ };
38
+ export interface QaSessionLogReader {
39
+ list(): Promise<readonly QaStoredSessionHeader[]>;
40
+ read(sessionId: string): Promise<QaSessionReadResult>;
41
+ }
42
+ /**
43
+ * Build the reader for one plugin instance. The services are looked up per
44
+ * call rather than captured: a cordis provider is only visible once its fiber
45
+ * is active, and a reference taken at construction time would stay dead.
46
+ */
47
+ export declare function createSessionLogReader(ctx: Context): QaSessionLogReader;
48
+ /** A reader over an explicit set of logs; the tests' seam, and the empty default. */
49
+ export declare function staticSessionLogReader(input: {
50
+ readonly sessions?: readonly QaStoredSessionHeader[];
51
+ readonly events?: Readonly<Record<string, readonly StoredSessionEvent[]>>;
52
+ }): QaSessionLogReader;
53
+ //# sourceMappingURL=session-log.d.ts.map
@@ -14,4 +14,6 @@ export declare class QaAttestationError extends Error {
14
14
  readonly reason: QaAttestationReason;
15
15
  constructor(reason: QaAttestationReason, message: string);
16
16
  }
17
+ /** Keep deployment details in Host logs while preserving a stable wire hint. */
18
+ export declare function qaAttestationFailureMessage(message: string, error: unknown): string;
17
19
  //# sourceMappingURL=attestation.d.ts.map
@@ -46,6 +46,9 @@ export interface QaSessionControllerOptions {
46
46
  readonly fileUpload?: () => QaFileUpload | undefined;
47
47
  /** Present while the deployment gates QA users with accounts. */
48
48
  readonly accounts?: QaAccountsFacade;
49
+ /** Server-validated role requested for newly materialized sessions. */
50
+ readonly initialSubrole?: string | null;
51
+ readonly adminPreview?: boolean;
49
52
  readonly timeoutMs?: number;
50
53
  /**
51
54
  * Minimum spacing between projections of a running turn's stream frames.
@@ -91,6 +94,8 @@ export declare class QaSessionController {
91
94
  private pendingSubmission;
92
95
  private pendingSequence;
93
96
  private policyReady;
97
+ /** Historical transcript retained after the Host classifies policy drift. */
98
+ private compatibilityReadOnly;
94
99
  private drafting;
95
100
  /** The chat session to return to when a subagent view closes. */
96
101
  private chatSessionId;
@@ -99,6 +104,8 @@ export declare class QaSessionController {
99
104
  private disposed;
100
105
  private generation;
101
106
  private chatsRevision;
107
+ private selectedSubrole;
108
+ private adminPreview;
102
109
  /** Host-side provenance of the bound chat, merged into the projection. */
103
110
  private readonly hostSources;
104
111
  /** Host-side approvals of the bound chat waiting for the operator. */
@@ -111,6 +118,12 @@ export declare class QaSessionController {
111
118
  getSnapshot: () => QaSessionState;
112
119
  subscribe: (listener: () => void) => (() => void);
113
120
  ensureSession(): Promise<void>;
121
+ /**
122
+ * Select a different capability profile for the next agent. The current
123
+ * agent is never mutated: even a blank materialized chat is abandoned in
124
+ * favor of a fresh Host-owned session.
125
+ */
126
+ selectSubrole(subroleId: string, adminPreview?: boolean): Promise<void>;
114
127
  send(text: string, attachments?: readonly QaAttachmentDraft[]): Promise<boolean>;
115
128
  /** Publish a browser-only copy before any network or Host admission awaits. */
116
129
  private beginSubmission;
@@ -129,7 +142,7 @@ export declare class QaSessionController {
129
142
  * until the first prompt is actually sent, which materializes the session
130
143
  * lazily ({@link materializeDraft}). Fixed-policy deployments cannot draft.
131
144
  */
132
- startDraft(): Promise<void>;
145
+ startDraft(policyChange?: boolean): Promise<void>;
133
146
  /**
134
147
  * Turn the current draft into a real attested session. Runs inside the
135
148
  * send flow; concurrent sends share one materialization. A refusal here is
@@ -3,7 +3,7 @@ import type { InjectFace, PropsRenderSlots, PropsRuntime } from "@deepseek-ai/ds
3
3
  import type { QaConfigController } from "./QaConfigController.js";
4
4
  import type { QaRouteController } from "./QaRouteController.js";
5
5
  import type { QaAccountsController } from "./QaAccountsController.js";
6
- import type { QaApprovalApi, QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaQuestionApi, QaSkillApi, QaSourceApi } from "./types.js";
6
+ import type { QaApprovalApi, QaAccessApi, QaAdminApi, QaConversation, QaCreateSession, QaFileUpload, QaSecureSession, QaSessions, QaSessionsApi, QaQuestionApi, QaSkillApi, QaSourceApi } from "./types.js";
7
7
  import type { QaSurfacePanelRegistry } from "./panels/registry.js";
8
8
  import type { QaUserSettingsSections } from "./settings-extensions/index.js";
9
9
  export interface QaSurfaceFace {
@@ -15,6 +15,12 @@ export interface QaSurfaceFace {
15
15
  readonly connection: ConnectionGenerationState;
16
16
  readonly secureSession: QaSecureSession;
17
17
  readonly createSession: QaCreateSession;
18
+ readonly accessApi: QaAccessApi;
19
+ /**
20
+ * The administrative console's surface. Optional so an older Host that does
21
+ * not answer it still renders the capability editors.
22
+ */
23
+ readonly adminApi?: QaAdminApi;
18
24
  readonly sourceApi: QaSourceApi;
19
25
  /**
20
26
  * Personal-skill half of the plugin's namespace. Absent on a page whose Host
@@ -0,0 +1,17 @@
1
+ import type { QaAccountRole, QaSubrole } from "../../types.js";
2
+ import type { QaAccessApi, QaAdminApi } from "../types.js";
3
+ export declare function QaAdmin(props: {
4
+ /** Capability administration; the access service's own wire surface. */
5
+ readonly api: QaAccessApi;
6
+ /**
7
+ * The console's own surface. A deployment that serves only the chat surface
8
+ * has no accounts, so the console falls back to the role editors.
9
+ */
10
+ readonly adminApi?: QaAdminApi;
11
+ readonly token: string;
12
+ readonly routePath: string;
13
+ /** The signed-in account's role, used only to filter the navigation. */
14
+ readonly role?: QaAccountRole;
15
+ readonly onPreview: (role: QaSubrole) => void;
16
+ }): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=QaAdmin.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { QaAccountRole, QaFeedbackReason, QaQualityIssueType, QaQualitySeverity, QaRemediationTarget, QaReviewPriority, QaReviewStatus, QaTranscriptUnavailableReason } from "../../types.js";
2
+ /**
3
+ * Russian copy for the console's vocabulary. Kept in one module so the pages
4
+ * stay about layout, and so the wording an operator sees is edited in one
5
+ * place rather than hunted across components.
6
+ */
7
+ export declare const ADMIN_ROLE_LABELS: Readonly<Record<QaAccountRole, string>>;
8
+ export declare const FEEDBACK_RATING_LABELS: {
9
+ readonly positive: "Полезно";
10
+ readonly negative: "Проблема";
11
+ };
12
+ export declare const FEEDBACK_REASON_LABELS: Readonly<Record<QaFeedbackReason, string>>;
13
+ export declare const REVIEW_STATUS_LABELS: Readonly<Record<QaReviewStatus, string>>;
14
+ export declare const REVIEW_PRIORITY_LABELS: Readonly<Record<QaReviewPriority, string>>;
15
+ export declare const REVIEW_REASON_LABELS: {
16
+ readonly negative_feedback: "Негативная оценка";
17
+ readonly manual: "Отправлено на разбор";
18
+ readonly tool_failure: "Сбой инструмента";
19
+ readonly automatic: "Автоматически";
20
+ };
21
+ export declare const SEVERITY_LABELS: Readonly<Record<QaQualitySeverity, string>>;
22
+ /**
23
+ * Issue labels grouped by the taxonomy's own branches (spec §21). The groups
24
+ * are only a rendering concern: issue ids stay flat so aggregations never walk
25
+ * a tree.
26
+ */
27
+ export declare const ISSUE_GROUPS: readonly {
28
+ readonly title: string;
29
+ readonly issues: readonly QaQualityIssueType[];
30
+ }[];
31
+ export declare const ISSUE_LABELS: Readonly<Record<QaQualityIssueType, string>>;
32
+ export declare const TARGET_LABELS: Readonly<Record<QaRemediationTarget, string>>;
33
+ export declare const TRANSCRIPT_UNAVAILABLE_LABELS: Readonly<Record<QaTranscriptUnavailableReason, string>>;
34
+ /** Percent, or a dash when there is nothing to take a share of. */
35
+ export declare function formatRate(value: number | null): string;
36
+ /** Local date and time of an ISO stamp, or a dash for an unusable value. */
37
+ export declare function formatStamp(iso: string | undefined): string;
38
+ /** Coarse "how long ago", which is what a triage list needs. */
39
+ export declare function formatRelative(iso: string, now?: number): string;
40
+ /** Milliseconds as a short duration; tool timings are second-scale. */
41
+ export declare function formatDuration(ms: number | undefined): string;
42
+ export declare function formatCount(value: number): string;
43
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1,21 @@
1
+ import type { QaAdminApi } from "../../types.js";
2
+ export declare function AdminConversations(props: {
3
+ readonly api: QaAdminApi;
4
+ readonly token: string;
5
+ readonly userId?: string;
6
+ readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * The review viewer: the conversation as it happened, next to the reviewer's
10
+ * form. Tool calls collapse by default — a reviewer looking for "the tool
11
+ * failed" should not have to scroll past every argument to find it.
12
+ */
13
+ export declare function AdminConversation(props: {
14
+ readonly api: QaAdminApi;
15
+ readonly token: string;
16
+ readonly conversationId: string;
17
+ readonly messageId?: string;
18
+ readonly canReview: boolean;
19
+ readonly onBack: () => void;
20
+ }): import("react/jsx-runtime").JSX.Element;
21
+ //# sourceMappingURL=Conversations.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { QaReviewQueueRow } from "../../../types.js";
2
+ import type { QaAdminApi } from "../../types.js";
3
+ export declare function AdminOverview(props: {
4
+ readonly api: QaAdminApi;
5
+ readonly token: string;
6
+ readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
7
+ readonly onOpenQueue: () => void;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export declare function QueuePreview(props: {
10
+ readonly rows: readonly QaReviewQueueRow[];
11
+ readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=Overview.d.ts.map
@@ -0,0 +1,18 @@
1
+ import type { QaAdminApi } from "../../types.js";
2
+ /** The feedback table: every rating against the exact answer it judged. */
3
+ export declare function AdminFeedback(props: {
4
+ readonly api: QaAdminApi;
5
+ readonly token: string;
6
+ readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ /** Issue distribution, per-subrole satisfaction and the trend over time. */
9
+ export declare function AdminQuality(props: {
10
+ readonly api: QaAdminApi;
11
+ readonly token: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ /** Every administrative action, newest first, from both writers. */
14
+ export declare function AdminAudit(props: {
15
+ readonly api: QaAdminApi;
16
+ readonly token: string;
17
+ }): import("react/jsx-runtime").JSX.Element;
18
+ //# sourceMappingURL=Quality.d.ts.map
@@ -0,0 +1,15 @@
1
+ import type { QaConversationDetail } from "../../../types.js";
2
+ import type { QaAdminApi } from "../../types.js";
3
+ export declare function AdminReviewQueue(props: {
4
+ readonly api: QaAdminApi;
5
+ readonly token: string;
6
+ readonly onOpenConversation: (conversationId: string, messageId?: string) => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ReviewPanel(props: {
9
+ readonly api: QaAdminApi;
10
+ readonly token: string;
11
+ readonly detail: QaConversationDetail;
12
+ readonly canReview: boolean;
13
+ readonly onSaved: () => void;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ //# sourceMappingURL=Review.d.ts.map
@@ -0,0 +1,22 @@
1
+ import type { QaAdminApi, QaAccessApi } from "../../types.js";
2
+ /**
3
+ * Users: the table an administrator triages from, and the detail page that
4
+ * separates authorization from the QA subrole assignment — an admin may work
5
+ * as an analyst without that saying anything about their administrative reach.
6
+ */
7
+ export declare function AdminUsers(props: {
8
+ readonly api: QaAdminApi;
9
+ readonly token: string;
10
+ readonly onOpenUser: (userId: string) => void;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ /** Authorization, assignment and the activity counters of one account. */
13
+ export declare function AdminUserDetail(props: {
14
+ readonly api: QaAdminApi;
15
+ readonly accessApi: QaAccessApi;
16
+ readonly token: string;
17
+ readonly userId: string;
18
+ readonly onBack: () => void;
19
+ readonly onOpenAudit: () => void;
20
+ readonly onOpenConversations: (userId: string) => void;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ //# sourceMappingURL=Users.d.ts.map
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The admin console's route model.
3
+ *
4
+ * The console lives under one host route (`/qa/admin`) and gives every entity
5
+ * with its own identity its own path, because a review finding is something
6
+ * people paste into a chat. Parsing and serializing live here, away from the
7
+ * components, so the mapping is testable without a DOM.
8
+ */
9
+ export type QaAdminRoute = {
10
+ readonly page: "overview";
11
+ } | {
12
+ readonly page: "users";
13
+ } | {
14
+ readonly page: "user";
15
+ readonly userId: string;
16
+ } | {
17
+ readonly page: "subroles";
18
+ } | {
19
+ readonly page: "skills";
20
+ } | {
21
+ readonly page: "common";
22
+ } | {
23
+ readonly page: "conversations";
24
+ } | {
25
+ readonly page: "conversation";
26
+ readonly conversationId: string;
27
+ /** Deep link to one message inside the conversation (spec §34). */
28
+ readonly messageId?: string;
29
+ } | {
30
+ readonly page: "review";
31
+ } | {
32
+ readonly page: "feedback";
33
+ } | {
34
+ readonly page: "quality";
35
+ } | {
36
+ readonly page: "audit";
37
+ };
38
+ /** Path segments after `/qa/admin`, without the leading slash. */
39
+ export declare function adminSegments(pathname: string, routePath: string): string[];
40
+ /**
41
+ * Resolve a pathname into a console route. Unknown segments fall back to the
42
+ * section they live under rather than to an error page: a stale link should
43
+ * still land the reviewer somewhere useful.
44
+ */
45
+ export declare function parseAdminRoute(pathname: string, routePath: string): QaAdminRoute;
46
+ /** The pathname for one console route; the inverse of {@link parseAdminRoute}. */
47
+ export declare function adminPath(routePath: string, route: QaAdminRoute, search?: string): string;
48
+ /** Which navigation entry is current for one route. */
49
+ export declare function adminSectionOf(route: QaAdminRoute): "overview" | "users" | "access" | "conversations" | "review" | "feedback" | "quality" | "audit";
50
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1,53 @@
1
+ import type { RemoteResult } from "../types.js";
2
+ /** The audience-safe text of a refused Remote call. */
3
+ export declare function errorMessage(error: unknown): string;
4
+ /**
5
+ * The refusal copy a console page shows. The Host sends a coarse reason code
6
+ * on the wire and nothing else, so the wording lives here — one place to edit,
7
+ * and no deployment detail leaks into the browser.
8
+ */
9
+ export declare function adminErrorMessage(error: unknown): string;
10
+ /**
11
+ * Load one administrative resource, keeping the previous value visible while
12
+ * it refreshes. Reviewers page through lists while new conversations arrive;
13
+ * blanking the table on every reload would make that unusable.
14
+ */
15
+ export declare function useAdminResource<T>(load: () => Promise<RemoteResult<T>>, deps: readonly unknown[]): {
16
+ readonly data: T | undefined;
17
+ readonly error: string | undefined;
18
+ readonly loading: boolean;
19
+ reload: () => Promise<void>;
20
+ };
21
+ /** A status chip; the modifier class carries the semantic colour. */
22
+ export declare function Badge(props: {
23
+ readonly tone?: "neutral" | "positive" | "negative" | "warning";
24
+ readonly children: React.ReactNode;
25
+ }): import("react/jsx-runtime").JSX.Element;
26
+ export declare function Empty(props: {
27
+ readonly children: React.ReactNode;
28
+ }): import("react/jsx-runtime").JSX.Element;
29
+ /** A relative timestamp with the exact one available on hover. */
30
+ export declare function Stamp(props: {
31
+ readonly value: string | undefined;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export declare function ErrorLine(props: {
34
+ readonly message: string | undefined;
35
+ }): import("react/jsx-runtime").JSX.Element | null;
36
+ /**
37
+ * Cursor paging controls. The cursor is opaque to the browser by design: only
38
+ * the Host knows how a page was cut.
39
+ */
40
+ export declare function Pager(props: {
41
+ readonly total: number;
42
+ readonly shown: number;
43
+ readonly hasMore: boolean;
44
+ readonly loading: boolean;
45
+ readonly onMore: () => void;
46
+ readonly onReset: () => void;
47
+ }): import("react/jsx-runtime").JSX.Element;
48
+ /** One labeled filter control in a table toolbar. */
49
+ export declare function FilterField(props: {
50
+ readonly label: string;
51
+ readonly children: React.ReactNode;
52
+ }): import("react/jsx-runtime").JSX.Element;
53
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The administrative console's stylesheet. Colors come only from the QA
3
+ * palette tokens or the host's themed aliases, so light, dark and system themes
4
+ * stay coherent; the stylesheet test enforces that rule.
5
+ *
6
+ * Layout intent: a dense table surface for triage, a side panel for the review
7
+ * form, and no modal windows — the console is a place to work through a list,
8
+ * not a wizard.
9
+ */
10
+ export declare const QA_ADMIN_CONSOLE_STYLES: string;
11
+ //# sourceMappingURL=styles.d.ts.map
@@ -6,8 +6,15 @@ import type { QaLockdownProof, ResolvedQaSurfaceConfig } from "../types.js";
6
6
  * reason class and an operator hint.
7
7
  */
8
8
  export declare class QaPolicyAttestationError extends Error {
9
- constructor();
9
+ readonly reason: string | null;
10
+ constructor(reason?: string | null);
10
11
  }
12
+ /**
13
+ * Refusals that classify an existing chat as belonging to an older deployment
14
+ * composition. Keeping only its transcript is safe: policyReady stays false,
15
+ * so no prompt, cancel, approval or question reaches the Host.
16
+ */
17
+ export declare function canOpenAsCompatibilityReadOnly(reason: string | null): boolean;
11
18
  /**
12
19
  * Extract the coarse attestation reason code from a Host wire failure, if the
13
20
  * failure carries the marker.
@@ -21,6 +21,10 @@ export interface QaHeaderProps {
21
21
  readonly viewingSubagent: boolean;
22
22
  readonly onCloseSubagent: () => void;
23
23
  readonly agentPreset: string | null;
24
+ readonly roleSelector?: ReactNode;
25
+ readonly administration?: {
26
+ readonly onOpen: () => void;
27
+ };
24
28
  readonly agentCount: number;
25
29
  readonly agentsOpen: boolean;
26
30
  /** Toggles the agents drawer; also closes the right rail. */
@@ -39,5 +43,5 @@ export interface QaHeaderProps {
39
43
  readonly resetDisabled: boolean;
40
44
  readonly onReset: () => void;
41
45
  }
42
- export declare function QaHeader({ logoUrl, title, viewingSubagent, onCloseSubagent, agentPreset, agentCount, agentsOpen, onToggleAgents, sourcesVisible, sourcesCount, sourcesComplete, sourcesOpen, onOpenSources, fileCount, filesOpen, onOpenFiles, panelLauncher, showReset, resetDisabled, onReset, }: QaHeaderProps): import("react/jsx-runtime").JSX.Element;
46
+ export declare function QaHeader({ logoUrl, title, viewingSubagent, onCloseSubagent, agentPreset, roleSelector, administration, agentCount, agentsOpen, onToggleAgents, sourcesVisible, sourcesCount, sourcesComplete, sourcesOpen, onOpenSources, fileCount, filesOpen, onOpenFiles, panelLauncher, showReset, resetDisabled, onReset, }: QaHeaderProps): import("react/jsx-runtime").JSX.Element;
43
47
  //# sourceMappingURL=QaHeader.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { QaMessage as QaMessageModel, QaSource, QaTurnSources } from "../../types.js";
2
+ import type { QaFeedbackReason } from "../../types.js";
2
3
  export interface QaMessageProps {
3
4
  readonly message: QaMessageModel;
4
5
  readonly renderMarkdown: boolean;
@@ -18,6 +19,18 @@ export interface QaMessageProps {
18
19
  readonly onSourceDetail?: (source: QaSource) => void;
19
20
  /** Operator-configured running phrases; omitted reads the built-in list. */
20
21
  readonly thinkingPhrases?: readonly string[];
22
+ /**
23
+ * Persist a rating for this answer. Omitted on a surface with no accounts or
24
+ * no durable message identity: the control then only records the choice
25
+ * locally, which is what the standalone QA surface has always done.
26
+ */
27
+ readonly onRateFeedback?: (input: {
28
+ /** Durable log position of this answer, when the transcript knows it. */
29
+ readonly messageId?: number;
30
+ readonly rating: "positive" | "negative";
31
+ readonly reasons?: readonly QaFeedbackReason[];
32
+ readonly comment?: string;
33
+ }) => void;
21
34
  }
22
35
  /**
23
36
  * Whether two transcript messages render identically. The transcript
@@ -26,5 +39,5 @@ export interface QaMessageProps {
26
39
  * comparison is by value, which keeps fresh copies cheap to recognize.
27
40
  */
28
41
  export declare function sameMessage(a: QaMessageModel, b: QaMessageModel): boolean;
29
- export declare const QaMessage: import("react").MemoExoticComponent<({ message, renderMarkdown, showTimestamp, stateKey, onRegenerate, resolveImage, onOpenSources, onSourceDetail, thinkingPhrases, }: QaMessageProps) => import("react/jsx-runtime").JSX.Element>;
42
+ export declare const QaMessage: import("react").MemoExoticComponent<({ message, renderMarkdown, showTimestamp, stateKey, onRegenerate, resolveImage, onOpenSources, onSourceDetail, thinkingPhrases, onRateFeedback, }: QaMessageProps) => import("react/jsx-runtime").JSX.Element>;
30
43
  //# sourceMappingURL=QaMessage.d.ts.map
@@ -9,5 +9,7 @@ import type { QaCreateSession } from "./types.js";
9
9
  export declare function createQaSession(args: {
10
10
  readonly createSession: QaCreateSession;
11
11
  readonly token: string;
12
+ readonly subroleId: string | null;
13
+ readonly adminPreview: boolean;
12
14
  }): Promise<string>;
13
15
  //# sourceMappingURL=create-session.d.ts.map