@yadsh/dsh-qa-surface 0.15.6 → 0.16.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 (244) hide show
  1. package/README.md +8 -0
  2. package/lib/access/capability-catalog.js +11 -4
  3. package/lib/access/capability-catalog.js.map +1 -1
  4. package/lib/access/service.js +46 -5
  5. package/lib/access/service.js.map +1 -1
  6. package/lib/accounts/store.js +2 -2
  7. package/lib/accounts/store.js.map +1 -1
  8. package/lib/admin/service.js +4 -2
  9. package/lib/admin/service.js.map +1 -1
  10. package/lib/admin/session-log.js +3 -0
  11. package/lib/admin/session-log.js.map +1 -1
  12. package/lib/agent-scope.js +9 -0
  13. package/lib/agent-scope.js.map +1 -0
  14. package/lib/chat-sharing/native-fence.js +111 -0
  15. package/lib/chat-sharing/native-fence.js.map +1 -0
  16. package/lib/chat-sharing/resources.js +57 -0
  17. package/lib/chat-sharing/resources.js.map +1 -0
  18. package/lib/chat-sharing/store.js +193 -0
  19. package/lib/chat-sharing/store.js.map +1 -0
  20. package/lib/chat-sharing/transport.js +274 -0
  21. package/lib/chat-sharing/transport.js.map +1 -0
  22. package/lib/chat-sharing/turn-guard.js +154 -0
  23. package/lib/chat-sharing/turn-guard.js.map +1 -0
  24. package/lib/chat-sharing/types.js +2 -0
  25. package/lib/chat-sharing/types.js.map +1 -0
  26. package/lib/chat-sharing/uploads.js +55 -0
  27. package/lib/chat-sharing/uploads.js.map +1 -0
  28. package/lib/client/QaAccountsController.js +29 -2
  29. package/lib/client/QaAccountsController.js.map +1 -1
  30. package/lib/client/QaConfigController.js +7 -12
  31. package/lib/client/QaConfigController.js.map +1 -1
  32. package/lib/client/QaSessionController.js +186 -19
  33. package/lib/client/QaSessionController.js.map +1 -1
  34. package/lib/client/QaSurface.js +110 -9
  35. package/lib/client/QaSurface.js.map +1 -1
  36. package/lib/client/QaSurfaceGuard.js +6 -1
  37. package/lib/client/QaSurfaceGuard.js.map +1 -1
  38. package/lib/client/QaTranscriptAdapter.js +13 -3
  39. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  40. package/lib/client/account-conversation.js +33 -0
  41. package/lib/client/account-conversation.js.map +1 -0
  42. package/lib/client/account-sessions.js +106 -0
  43. package/lib/client/account-sessions.js.map +1 -0
  44. package/lib/client/account-upload.js +30 -0
  45. package/lib/client/account-upload.js.map +1 -0
  46. package/lib/client/chat-artifacts.js +17 -3
  47. package/lib/client/chat-artifacts.js.map +1 -1
  48. package/lib/client/chat-sharing-api.js +2 -0
  49. package/lib/client/chat-sharing-api.js.map +1 -0
  50. package/lib/client/components/QaChangelog.js +70 -3
  51. package/lib/client/components/QaChangelog.js.map +1 -1
  52. package/lib/client/components/QaChatSharing.js +92 -0
  53. package/lib/client/components/QaChatSharing.js.map +1 -0
  54. package/lib/client/components/QaComposer.js +8 -4
  55. package/lib/client/components/QaComposer.js.map +1 -1
  56. package/lib/client/components/QaFileAttachment.js +12 -3
  57. package/lib/client/components/QaFileAttachment.js.map +1 -1
  58. package/lib/client/components/QaFilesPanel.js +11 -4
  59. package/lib/client/components/QaFilesPanel.js.map +1 -1
  60. package/lib/client/components/QaHeader.js +3 -3
  61. package/lib/client/components/QaHeader.js.map +1 -1
  62. package/lib/client/components/QaMessage.js +34 -9
  63. package/lib/client/components/QaMessage.js.map +1 -1
  64. package/lib/client/components/QaSidebar.js +1 -1
  65. package/lib/client/components/QaSidebar.js.map +1 -1
  66. package/lib/client/components/QaSourcesPanel.js +12 -4
  67. package/lib/client/components/QaSourcesPanel.js.map +1 -1
  68. package/lib/client/components/QaWorkspaceBrowser.js +28 -7
  69. package/lib/client/components/QaWorkspaceBrowser.js.map +1 -1
  70. package/lib/client/components/source-refs.js +42 -23
  71. package/lib/client/components/source-refs.js.map +1 -1
  72. package/lib/client/index.js +60 -6
  73. package/lib/client/index.js.map +1 -1
  74. package/lib/client/lineage.js +4 -3
  75. package/lib/client/lineage.js.map +1 -1
  76. package/lib/client/markdown/katex-css.js +1 -1
  77. package/lib/client/markdown/render.js +3 -4
  78. package/lib/client/markdown/render.js.map +1 -1
  79. package/lib/client/markdown/source-chip.js +4 -1
  80. package/lib/client/markdown/source-chip.js.map +1 -1
  81. package/lib/client/notifications/notification-dispatcher.js +50 -11
  82. package/lib/client/notifications/notification-dispatcher.js.map +1 -1
  83. package/lib/client/notifications/use-turn-notifications.js +107 -18
  84. package/lib/client/notifications/use-turn-notifications.js.map +1 -1
  85. package/lib/client/project-session-state.js +28 -13
  86. package/lib/client/project-session-state.js.map +1 -1
  87. package/lib/client/session-admission.js +9 -1
  88. package/lib/client/session-admission.js.map +1 -1
  89. package/lib/client/session-sources.js +44 -3
  90. package/lib/client/session-sources.js.map +1 -1
  91. package/lib/client/slash/useSlashNavigation.js +8 -5
  92. package/lib/client/slash/useSlashNavigation.js.map +1 -1
  93. package/lib/client/source-preview.js +1 -1
  94. package/lib/client/source-preview.js.map +1 -1
  95. package/lib/client/styles.js +9 -2
  96. package/lib/client/styles.js.map +1 -1
  97. package/lib/client/turn-sources.js +2 -1
  98. package/lib/client/turn-sources.js.map +1 -1
  99. package/lib/client/types.js.map +1 -1
  100. package/lib/client/workspace-download.js +42 -2
  101. package/lib/client/workspace-download.js.map +1 -1
  102. package/lib/client.js +3337 -947
  103. package/lib/client.js.map +1 -1
  104. package/lib/enforcement/skill-policy.js +29 -4
  105. package/lib/enforcement/skill-policy.js.map +1 -1
  106. package/lib/enforcement/skill-resource-paths.js +32 -0
  107. package/lib/enforcement/skill-resource-paths.js.map +1 -0
  108. package/lib/enforcement/structured-result.js +38 -0
  109. package/lib/enforcement/structured-result.js.map +1 -0
  110. package/lib/enforcement/tool-grants.js +3 -1
  111. package/lib/enforcement/tool-grants.js.map +1 -1
  112. package/lib/index.js +403 -15
  113. package/lib/index.js.map +1 -1
  114. package/lib/prompt-notes.js +18 -1
  115. package/lib/prompt-notes.js.map +1 -1
  116. package/lib/provenance/collector.js +13 -1
  117. package/lib/provenance/collector.js.map +1 -1
  118. package/lib/provenance/connectors.js +32 -8
  119. package/lib/provenance/connectors.js.map +1 -1
  120. package/lib/provenance/dedupe.js +8 -1
  121. package/lib/provenance/dedupe.js.map +1 -1
  122. package/lib/provenance/document-preview.js +19 -1
  123. package/lib/provenance/document-preview.js.map +1 -1
  124. package/lib/provenance/extractors.js +67 -1
  125. package/lib/provenance/extractors.js.map +1 -1
  126. package/lib/provenance/file-download.js +56 -0
  127. package/lib/provenance/file-download.js.map +1 -0
  128. package/lib/provenance/file-preview.js +12 -1
  129. package/lib/provenance/file-preview.js.map +1 -1
  130. package/lib/provenance/host-store.js +59 -10
  131. package/lib/provenance/host-store.js.map +1 -1
  132. package/lib/provenance/integration-extractor.js +63 -0
  133. package/lib/provenance/integration-extractor.js.map +1 -0
  134. package/lib/qa-tools/docs-tools.js +14 -0
  135. package/lib/qa-tools/docs-tools.js.map +1 -1
  136. package/lib/secure-session.js +37 -5
  137. package/lib/secure-session.js.map +1 -1
  138. package/lib/session-fork-host.js +157 -0
  139. package/lib/session-fork-host.js.map +1 -0
  140. package/lib/session-fork.js +34 -0
  141. package/lib/session-fork.js.map +1 -0
  142. package/lib/session-ownership.js +5 -1
  143. package/lib/session-ownership.js.map +1 -1
  144. package/lib/shared/session-lineage.js +6 -0
  145. package/lib/shared/session-lineage.js.map +1 -0
  146. package/lib/slash/draft-target.js +21 -0
  147. package/lib/slash/draft-target.js.map +1 -0
  148. package/lib/slash/remotes.js +39 -4
  149. package/lib/slash/remotes.js.map +1 -1
  150. package/lib/typert.host.js +1628 -231
  151. package/lib/typert.remote-client.d.ts +48 -1
  152. package/lib/typert.remote-client.js +1436 -193
  153. package/lib/types/access/capability-catalog.d.ts +1 -1
  154. package/lib/types/access/service.d.ts +7 -0
  155. package/lib/types/access.js +2 -0
  156. package/lib/types/access.js.map +1 -0
  157. package/lib/types/accounts/store.d.ts +1 -1
  158. package/lib/types/accounts.js +2 -0
  159. package/lib/types/accounts.js.map +1 -0
  160. package/lib/types/admin/session-log.d.ts +2 -0
  161. package/lib/types/admin.js +2 -0
  162. package/lib/types/admin.js.map +1 -0
  163. package/lib/types/agent-scope.d.ts +4 -0
  164. package/lib/types/capability.js +2 -0
  165. package/lib/types/capability.js.map +1 -0
  166. package/lib/types/chat-sharing/native-fence.d.ts +11 -0
  167. package/lib/types/chat-sharing/resources.d.ts +5 -0
  168. package/lib/types/chat-sharing/store.d.ts +28 -0
  169. package/lib/types/chat-sharing/transport.d.ts +31 -0
  170. package/lib/types/chat-sharing/turn-guard.d.ts +21 -0
  171. package/lib/types/chat-sharing/types.d.ts +25 -0
  172. package/lib/types/chat-sharing/uploads.d.ts +5 -0
  173. package/lib/types/client/QaAccountsController.d.ts +3 -0
  174. package/lib/types/client/QaConfigController.d.ts +3 -2
  175. package/lib/types/client/QaSessionController.d.ts +17 -3
  176. package/lib/types/client/QaSurface.d.ts +6 -1
  177. package/lib/types/client/account-conversation.d.ts +6 -0
  178. package/lib/types/client/account-sessions.d.ts +7 -0
  179. package/lib/types/client/account-upload.d.ts +15 -0
  180. package/lib/types/client/chat-sharing-api.d.ts +35 -0
  181. package/lib/types/client/components/QaChatSharing.d.ts +10 -0
  182. package/lib/types/client/components/QaComposer.d.ts +2 -0
  183. package/lib/types/client/components/QaFileAttachment.d.ts +3 -2
  184. package/lib/types/client/components/QaFilesPanel.d.ts +4 -1
  185. package/lib/types/client/components/QaMessage.d.ts +5 -2
  186. package/lib/types/client/components/QaWorkspaceBrowser.d.ts +8 -1
  187. package/lib/types/client/components/source-refs.d.ts +1 -0
  188. package/lib/types/client/lineage.d.ts +2 -2
  189. package/lib/types/client/notifications/notification-dispatcher.d.ts +10 -6
  190. package/lib/types/client/notifications/use-turn-notifications.d.ts +4 -0
  191. package/lib/types/client/project-session-state.d.ts +1 -0
  192. package/lib/types/client/session-admission.d.ts +2 -0
  193. package/lib/types/client/session-sources.d.ts +1 -0
  194. package/lib/types/client/turn-sources.d.ts +1 -1
  195. package/lib/types/client/types.d.ts +8 -1
  196. package/lib/types/client/workspace-download.d.ts +9 -1
  197. package/lib/types/config.js +2 -0
  198. package/lib/types/config.js.map +1 -0
  199. package/lib/types/documents.js +2 -0
  200. package/lib/types/documents.js.map +1 -0
  201. package/lib/types/enforcement/skill-resource-paths.d.ts +5 -0
  202. package/lib/types/enforcement/structured-result.d.ts +11 -0
  203. package/lib/types/expert-memory.js +2 -0
  204. package/lib/types/expert-memory.js.map +1 -0
  205. package/lib/types/index.d.ts +35 -1
  206. package/lib/types/policy.js +2 -0
  207. package/lib/types/policy.js.map +1 -0
  208. package/lib/types/prompt-notes.d.ts +2 -0
  209. package/lib/types/provenance/connectors.d.ts +4 -1
  210. package/lib/types/provenance/document-preview.d.ts +2 -0
  211. package/lib/types/provenance/extractors.d.ts +2 -0
  212. package/lib/types/provenance/file-download.d.ts +10 -0
  213. package/lib/types/provenance/host-store.d.ts +2 -0
  214. package/lib/types/provenance/integration-extractor.d.ts +5 -0
  215. package/lib/types/provenance/types.d.ts +2 -0
  216. package/lib/types/qa-tools/docs-tools.d.ts +2 -0
  217. package/lib/types/quality.js +7 -0
  218. package/lib/types/quality.js.map +1 -0
  219. package/lib/types/secure-session.d.ts +20 -1
  220. package/lib/types/session-fork-host.d.ts +27 -0
  221. package/lib/types/session-fork.d.ts +7 -0
  222. package/lib/types/session.js +2 -0
  223. package/lib/types/session.js.map +1 -0
  224. package/lib/types/shared/session-lineage.d.ts +7 -0
  225. package/lib/types/skills.js +2 -0
  226. package/lib/types/skills.js.map +1 -0
  227. package/lib/types/slash/draft-target.d.ts +7 -0
  228. package/lib/types/slash/remotes.d.ts +7 -0
  229. package/lib/types/slash.js +2 -0
  230. package/lib/types/slash.js.map +1 -0
  231. package/lib/types/types/access.d.ts +43 -0
  232. package/lib/types/types/accounts.d.ts +173 -0
  233. package/lib/types/types/admin.d.ts +286 -0
  234. package/lib/types/types/capability.d.ts +230 -0
  235. package/lib/types/types/config.d.ts +594 -0
  236. package/lib/types/types/documents.d.ts +34 -0
  237. package/lib/types/types/expert-memory.d.ts +35 -0
  238. package/lib/types/types/policy.d.ts +54 -0
  239. package/lib/types/types/quality.d.ts +100 -0
  240. package/lib/types/types/session.d.ts +382 -0
  241. package/lib/types/types/skills.d.ts +143 -0
  242. package/lib/types/types/slash.d.ts +159 -0
  243. package/lib/types/types.d.ts +13 -2180
  244. package/package.json +8 -7
@@ -0,0 +1,173 @@
1
+ import type { QaAccountRole } from "./policy.js";
2
+ /** The account fields projected to browsers; never includes credentials. */
3
+ export interface QaAccountUserPublic {
4
+ readonly id: string;
5
+ readonly email: string;
6
+ readonly displayName: string;
7
+ readonly role: QaAccountRole;
8
+ readonly createdAt: string;
9
+ readonly lastLoginAt: string | null;
10
+ readonly disabled: boolean;
11
+ /** Self-declared identity the QA prompt renders; empty until edited. */
12
+ readonly profile: QaAccountProfile;
13
+ /** The account's own starter buttons; empty until customized. */
14
+ readonly starters: QaAccountStarters;
15
+ /** Which channels a finished turn may use for this reader. */
16
+ readonly notifications: QaAccountNotifications;
17
+ }
18
+ /** One external system the deployment collects a handle for. */
19
+ export interface QaAccountIdentityField {
20
+ /** Stable lowercase key: the profile's storage key and the prompt's label. */
21
+ readonly key: string;
22
+ /** Operator copy shown in the profile form. */
23
+ readonly label: string;
24
+ }
25
+ /**
26
+ * What one account says about itself. Every value is the owner's own wording,
27
+ * which is why the prompt renders it as self-declared rather than as a
28
+ * verified directory attribute.
29
+ */
30
+ export interface QaAccountProfile {
31
+ /** Full name as the user writes it; empty when unset. */
32
+ readonly fullName: string;
33
+ /** External-system handles, keyed by the declared field key. */
34
+ readonly identities: Readonly<Record<string, string>>;
35
+ /** Free-form guidance about how the user wants answers; empty when unset. */
36
+ readonly instructions: string;
37
+ /** ISO timestamp of the last edit; null while the profile is untouched. */
38
+ readonly updatedAt: string | null;
39
+ }
40
+ /** Full-replace profile write: an absent value clears the stored one. */
41
+ export interface QaAccountProfileInput {
42
+ readonly fullName: string;
43
+ readonly identities: Readonly<Record<string, string>>;
44
+ readonly instructions: string;
45
+ }
46
+ /** One starter button: what it reads and what pressing it sends. */
47
+ export interface QaAccountStarter {
48
+ readonly label: string;
49
+ readonly prompt: string;
50
+ }
51
+ /**
52
+ * An account's own starter buttons plus the choice about the deployment's
53
+ * built-in suggestions. Pure UI preferences: unlike the profile, none of this
54
+ * reaches the agent prompt.
55
+ */
56
+ export interface QaAccountStarters {
57
+ readonly items: readonly QaAccountStarter[];
58
+ /** Hide the deployment's suggested questions in this account's composer. */
59
+ readonly hideDefaults: boolean;
60
+ }
61
+ /** Full-replace starters write: an absent value clears the stored one. */
62
+ export interface QaAccountStartersInput {
63
+ readonly items: readonly QaAccountStarter[];
64
+ readonly hideDefaults: boolean;
65
+ }
66
+ /**
67
+ * What one account allows a finished turn to do to it. Pure UI preferences:
68
+ * unlike the profile, none of this reaches the agent prompt, and unlike the
69
+ * starter buttons, none of it is content — it is two switches over the
70
+ * channels the plugin already knows how to raise.
71
+ *
72
+ * The deployment's `config.notifications` sits above these: a channel the stand
73
+ * closed stays closed whatever an account asks for, which is the operator's
74
+ * answer to a laptop more than one person signs in on.
75
+ */
76
+ export interface QaAccountNotifications {
77
+ /** Show the in-page line naming the chat whose turn ended. */
78
+ readonly inApp: boolean;
79
+ /**
80
+ * Hand the same fact to the operating system while this page is hidden or
81
+ * behind another window. Needs the browser's permission as well: without it
82
+ * the line stays inside the page and nothing asks a second time.
83
+ */
84
+ readonly desktop: boolean;
85
+ }
86
+ /** Full-replace notifications write: both channels are always sent. */
87
+ export interface QaAccountNotificationsInput {
88
+ readonly inApp: boolean;
89
+ readonly desktop: boolean;
90
+ }
91
+ /** One successful login/registration: the bearer token plus the user. */
92
+ export interface QaAccountSession {
93
+ readonly token: string;
94
+ readonly user: QaAccountUserPublic;
95
+ }
96
+ /**
97
+ * One forgotten-password request waiting for an operator. The address and name
98
+ * travel with it so the console can show who is locked out without a second
99
+ * lookup; the count makes repeated taps visible instead of silent.
100
+ */
101
+ export interface QaPasswordResetRequest {
102
+ readonly userId: string;
103
+ readonly email: string;
104
+ readonly displayName: string;
105
+ readonly requestedAt: string;
106
+ readonly lastRequestedAt: string;
107
+ readonly requestCount: number;
108
+ /** True when the account is disabled: a reset will not let it sign in. */
109
+ readonly disabled: boolean;
110
+ }
111
+ export type QaWhoamiResult = {
112
+ readonly authenticated: false;
113
+ } | {
114
+ readonly authenticated: true;
115
+ readonly user: QaAccountUserPublic;
116
+ };
117
+ /** Bulk ownership claim outcome for one browser's local chat index. */
118
+ export interface QaClaimResult {
119
+ readonly claimed: number;
120
+ /** Ids already owned by a different user; the browser drops them. */
121
+ readonly conflicts: readonly string[];
122
+ }
123
+ /**
124
+ * What an integration token may do. The credential a non-browser application
125
+ * presents to the QA HTTP API carries its own scopes, so a bridge that asks
126
+ * questions cannot read back conversations it was never given.
127
+ */
128
+ export type QaServiceTokenScope = "ask" | "sessions:read";
129
+ /**
130
+ * What an account asks a new integration token to be. The credential is always
131
+ * issued to the caller: nothing a browser sends may name another account, so
132
+ * this shape has no owner field and the administrative path keeps its own.
133
+ */
134
+ export interface QaServiceTokenCreateInput {
135
+ /** A note the operator's list shows; empty becomes a generic label. */
136
+ readonly label?: string;
137
+ /** Requested scopes; unknown ones are dropped, empty falls back to `ask`. */
138
+ readonly scopes?: readonly string[];
139
+ /** How long the token lives, in days; bounded server-side. */
140
+ readonly ttlDays?: number;
141
+ }
142
+ /**
143
+ * One integration token as a list shows it. The plaintext is deliberately not
144
+ * part of this shape: a secret is shown once, when it is minted, and a list
145
+ * that could repeat it would be a list that leaks it.
146
+ */
147
+ export interface QaServiceTokenSummary {
148
+ readonly id: string;
149
+ readonly label: string;
150
+ readonly scopes: readonly QaServiceTokenScope[];
151
+ readonly createdAt: string;
152
+ readonly expiresAt: string;
153
+ readonly lastUsedAt: string | null;
154
+ readonly revokedAt: string | null;
155
+ readonly useCount: number;
156
+ }
157
+ /** One freshly minted token: the plaintext is here and nowhere else, ever. */
158
+ export interface QaIssuedServiceToken extends QaServiceTokenSummary {
159
+ /** The credential to hand to the integration. Never recoverable later. */
160
+ readonly token: string;
161
+ }
162
+ /**
163
+ * One chat-ownership entry as the admin views see it: the session, its owner
164
+ * and the owner's display name resolved at read time (a disabled account
165
+ * still names its chats).
166
+ */
167
+ export interface QaOwnershipEntry {
168
+ readonly sessionId: string;
169
+ readonly userId: string;
170
+ readonly displayName: string;
171
+ readonly claimedAt: string;
172
+ }
173
+ //# sourceMappingURL=accounts.d.ts.map
@@ -0,0 +1,286 @@
1
+ import type { QaUserAccess } from "./capability.js";
2
+ import type { QaAccountRole } from "./policy.js";
3
+ import type { QaConversationReview, QaFeedbackRating, QaFeedbackReason, QaMessageFeedback, QaQualityIssueType, QaQualitySeverity, QaReviewQueueItem, QaReviewStatus } from "./quality.js";
4
+ /** Administrative actions recorded in the audit trail. */
5
+ export type QaAdminAuditAction = "user.created" | "user.updated" | "user.enabled" | "user.disabled"
6
+ /** An operator set a new password for an account that had requested one. */
7
+ | "user.password-reset" | "authorization.changed" | "subrole.assignment.changed" | "subrole.created" | "subrole.updated" | "subrole.deleted" | "common_capabilities.updated" | "conversation.reviewed" | "conversation.deleted" | "review.updated" | "review.queued" | "admin.settings.updated" | "skill.created" | "skill.updated" | "skill.deleted"
8
+ /** An operator rewrote a line an expert had remembered. */
9
+ | "memory.corrected"
10
+ /** One or several remembered lines were deleted; the count is in the target. */
11
+ | "memory.deleted"
12
+ /** A whole namespace was emptied. */
13
+ | "memory.wiped";
14
+ export interface QaAdminAuditEvent {
15
+ readonly id: string;
16
+ readonly timestamp: string;
17
+ readonly actorId: string;
18
+ readonly action: QaAdminAuditAction;
19
+ readonly targetType?: string;
20
+ readonly targetId?: string;
21
+ /** JSON snapshots serialized at the storage boundary for a strict Remote type. */
22
+ readonly before?: string;
23
+ readonly after?: string;
24
+ }
25
+ /**
26
+ * One tool call as the review viewer shows it. `arguments` and `result` are
27
+ * preview strings, not raw payloads: the admin redaction seam owns trimming.
28
+ */
29
+ export interface QaConversationToolCall {
30
+ readonly callId: string;
31
+ readonly name: string;
32
+ readonly arguments: string;
33
+ readonly result?: string;
34
+ readonly error?: string;
35
+ readonly time?: number;
36
+ readonly durationMs?: number;
37
+ }
38
+ /** Token accounting of one assistant message, when the log carries it. */
39
+ export interface QaMessageUsage {
40
+ readonly inputTokens: number;
41
+ readonly outputTokens: number;
42
+ readonly totalTokens?: number;
43
+ }
44
+ /** One message in the review viewer, in log order. */
45
+ export interface QaConversationMessage {
46
+ /** Stable message identity: the session event seq it was projected from. */
47
+ readonly id: string;
48
+ readonly seq: number;
49
+ readonly role: "user" | "assistant" | "system";
50
+ readonly text: string;
51
+ readonly time: number;
52
+ readonly model?: string;
53
+ readonly provider?: string;
54
+ readonly usage?: QaMessageUsage;
55
+ readonly interrupted?: boolean;
56
+ readonly toolCalls?: readonly QaConversationToolCall[];
57
+ /** Ratings of this message by its owner, newest first. */
58
+ readonly feedback?: readonly QaMessageFeedback[];
59
+ /** Reviewer results attached to this exact message. */
60
+ readonly reviews?: readonly QaConversationReview[];
61
+ }
62
+ /**
63
+ * What the agent could use in a conversation, frozen when the session was
64
+ * reserved. Reviewing an old answer against today's role configuration would
65
+ * answer the wrong question.
66
+ */
67
+ export interface QaConversationRuntime {
68
+ readonly subroleId: string;
69
+ readonly adminPreview: boolean;
70
+ readonly model?: string;
71
+ readonly provider?: string;
72
+ readonly agentPreset?: string;
73
+ readonly effectiveTools?: readonly string[];
74
+ readonly effectiveSkills?: readonly string[];
75
+ /** Skills the model actually loaded, derived from the log's skill tool calls. */
76
+ readonly loadedSkills?: readonly string[];
77
+ /** True when the stored log could not be read; counts stay 0 and text is absent. */
78
+ readonly transcriptUnavailable?: QaTranscriptUnavailableReason;
79
+ }
80
+ /** Why a stored transcript could not be projected for the reviewer. */
81
+ export type QaTranscriptUnavailableReason = "storage-unavailable" | "not-found" | "unreadable";
82
+ /** One conversation row of the administrative list. */
83
+ export interface QaConversationSummary {
84
+ readonly conversationId: string;
85
+ readonly userId: string;
86
+ readonly displayName: string;
87
+ readonly subroleId: string;
88
+ readonly createdAt: string;
89
+ /** Newest activity the deployment can see: creation, log tail, or a review. */
90
+ readonly updatedAt: string;
91
+ readonly title?: string;
92
+ readonly messageCount: number;
93
+ readonly positiveFeedback: number;
94
+ readonly negativeFeedback: number;
95
+ readonly reviewStatus: QaReviewStatus;
96
+ }
97
+ /** The full review payload of one conversation. */
98
+ export interface QaConversationDetail {
99
+ readonly conversationId: string;
100
+ readonly summary: QaConversationSummary;
101
+ readonly runtime: QaConversationRuntime;
102
+ readonly messages: readonly QaConversationMessage[];
103
+ readonly reviews: readonly QaConversationReview[];
104
+ readonly queueItems: readonly QaReviewQueueItem[];
105
+ }
106
+ /** What one administrative deletion removed, for the console to report. */
107
+ export interface QaConversationDeletion {
108
+ readonly conversationId: string;
109
+ /**
110
+ * Every session whose stored log is gone, the chat first: a conversation's
111
+ * subagent sessions are part of it and are removed with it.
112
+ */
113
+ readonly sessions: readonly string[];
114
+ /** Quality rows dropped with the conversation. */
115
+ readonly qualityRows: number;
116
+ }
117
+ /**
118
+ * Server-side filter for the conversation list. Every field is optional and
119
+ * accepts an explicit null: the wire carries whatever the browser has, and an
120
+ * absent filter must never be mistaken for a filter on `null`.
121
+ */
122
+ export interface QaConversationQuery {
123
+ readonly userId?: string | null;
124
+ readonly subroleId?: string | null;
125
+ readonly from?: string | null;
126
+ readonly to?: string | null;
127
+ readonly rating?: QaFeedbackRating | null;
128
+ readonly reviewStatus?: QaReviewStatus | null;
129
+ /** Search matches the conversation title and the owner's name or email. */
130
+ readonly search?: string | null;
131
+ }
132
+ /** Server-side filter for the feedback table. */
133
+ export interface QaFeedbackQuery {
134
+ readonly rating?: QaFeedbackRating | null;
135
+ readonly userId?: string | null;
136
+ readonly subroleId?: string | null;
137
+ readonly reason?: QaFeedbackReason | null;
138
+ readonly from?: string | null;
139
+ readonly to?: string | null;
140
+ readonly reviewStatus?: QaReviewStatus | null;
141
+ }
142
+ /** Server-side filter for the audit table. */
143
+ export interface QaAuditQuery {
144
+ readonly actorId?: string | null;
145
+ readonly action?: QaAdminAuditAction | null;
146
+ readonly from?: string | null;
147
+ readonly to?: string | null;
148
+ }
149
+ /** Server-side filter for the user list. */
150
+ export interface QaUserQuery {
151
+ readonly search?: string | null;
152
+ readonly status?: "active" | "disabled" | null;
153
+ readonly role?: QaAccountRole | null;
154
+ readonly subroleId?: string | null;
155
+ }
156
+ /** Cursor page of any admin list. `nextCursor` is null on the last page. */
157
+ export interface QaAdminPage<T> {
158
+ readonly items: readonly T[];
159
+ readonly nextCursor: string | null;
160
+ readonly total: number;
161
+ }
162
+ /** One pending item of the review queue, with the context to triage it. */
163
+ export interface QaReviewQueueRow extends QaReviewQueueItem {
164
+ readonly displayName: string;
165
+ readonly subroleId: string;
166
+ readonly title?: string;
167
+ readonly raisedAtLabel: string;
168
+ readonly issueSummary?: readonly QaQualityIssueType[];
169
+ readonly severity?: QaQualitySeverity;
170
+ }
171
+ /** One row of the feedback table (spec §33). */
172
+ export interface QaFeedbackRow extends QaMessageFeedback {
173
+ readonly displayName: string;
174
+ readonly subroleId: string;
175
+ readonly conversationTitle?: string;
176
+ readonly reviewStatus: QaReviewStatus;
177
+ }
178
+ /** Aggregated quality counters (spec §27). */
179
+ export interface QaQualityIssueCount {
180
+ readonly issue: QaQualityIssueType;
181
+ readonly count: number;
182
+ }
183
+ export interface QaQualityRatingBreakdown {
184
+ readonly key: string;
185
+ readonly label: string;
186
+ readonly rated: number;
187
+ readonly positive: number;
188
+ readonly negative: number;
189
+ readonly positiveRate: number | null;
190
+ }
191
+ export interface QaQualityTrendPoint {
192
+ /** ISO date (UTC) of the bucket. */
193
+ readonly date: string;
194
+ readonly rated: number;
195
+ readonly positive: number;
196
+ readonly negative: number;
197
+ }
198
+ export interface QaQualityMetrics {
199
+ readonly conversations: number;
200
+ readonly activeUsers: number;
201
+ readonly assistantMessages: number;
202
+ readonly ratedMessages: number;
203
+ readonly positiveRatings: number;
204
+ readonly negativeRatings: number;
205
+ /** Share of assistant messages that carry a rating; null without messages. */
206
+ readonly ratingRate: number | null;
207
+ /** Share of positive ratings among rated messages; null without ratings. */
208
+ readonly positiveRate: number | null;
209
+ readonly unreviewedNegatives: number;
210
+ readonly reviewedItems: number;
211
+ readonly issues: readonly QaQualityIssueCount[];
212
+ readonly bySubrole: readonly QaQualityRatingBreakdown[];
213
+ readonly trend: readonly QaQualityTrendPoint[];
214
+ }
215
+ /**
216
+ * One attention line on the admin overview. The Host reports the condition and
217
+ * its numbers; the browser owns the wording, so an operator's language never
218
+ * depends on the deployment's locale.
219
+ */
220
+ export interface QaOverviewAlert {
221
+ readonly level: "critical" | "warning" | "info";
222
+ readonly code: "unreviewed-negatives" | "subrole-satisfaction" | "recurring-reason";
223
+ readonly count: number;
224
+ /** Subrole id or feedback reason, when the condition names one. */
225
+ readonly subject?: string;
226
+ /** Positive-feedback share of the subject, when the condition measured one. */
227
+ readonly rate?: number;
228
+ }
229
+ /** The /qa/admin landing payload. */
230
+ export interface QaAdminOverview {
231
+ readonly metrics: QaQualityMetrics;
232
+ readonly alerts: readonly QaOverviewAlert[];
233
+ readonly recentFeedback: readonly QaFeedbackRow[];
234
+ readonly queue: readonly QaReviewQueueRow[];
235
+ }
236
+ /** The account columns the store owns, without any joined counters. */
237
+ export interface QaAdminAccountRow {
238
+ readonly id: string;
239
+ readonly email: string;
240
+ readonly displayName: string;
241
+ readonly fullName: string;
242
+ readonly role: QaAccountRole;
243
+ readonly disabled: boolean;
244
+ readonly createdAt: string;
245
+ readonly lastLoginAt: string | null;
246
+ readonly access: QaUserAccess;
247
+ }
248
+ /** One user row of the admin user list (spec §5). */
249
+ export interface QaAdminUserRow extends QaAdminAccountRow {
250
+ readonly conversations: number;
251
+ readonly feedbackGiven: number;
252
+ }
253
+ /** Everything the user detail page renders, in one payload (spec §6). */
254
+ export interface QaAdminUserDetail {
255
+ readonly user: QaAdminUserRow;
256
+ /** Effective capability counts per assigned subrole, for the access preview. */
257
+ readonly effective: readonly {
258
+ readonly subroleId: string;
259
+ readonly name: string;
260
+ /** Visible from the first step: system-required, Common and the role. */
261
+ readonly tools: number;
262
+ /** The role's ceiling for tools a loaded skill requires. */
263
+ readonly grantableTools: number;
264
+ /** Tools the profile withdraws, whatever else grants them. */
265
+ readonly deniedTools: number;
266
+ readonly skills: number;
267
+ }[];
268
+ readonly activity: {
269
+ readonly conversations: number;
270
+ /**
271
+ * Unknown until the conversations page is opened: the count needs every
272
+ * conversation's log read, so the detail card reports null instead of
273
+ * blocking its payload on the scan.
274
+ */
275
+ readonly messages: number | null;
276
+ readonly positiveRatings: number;
277
+ readonly negativeRatings: number;
278
+ };
279
+ }
280
+ /** The administrative write of one account; absent fields stay unchanged. */
281
+ export interface QaAdminUserUpdate {
282
+ readonly role?: QaAccountRole | null;
283
+ readonly disabled?: boolean | null;
284
+ readonly access?: QaUserAccess | null;
285
+ }
286
+ //# sourceMappingURL=admin.d.ts.map
@@ -0,0 +1,230 @@
1
+ /**
2
+ * Tools split by how they become available. `always` is visible from the first
3
+ * model step; `skillGrantable` is a ceiling — the tool only appears once an
4
+ * activated skill requires it, and never outside this list.
5
+ */
6
+ export interface QaToolSelection {
7
+ readonly always: readonly string[];
8
+ readonly skillGrantable: readonly string[];
9
+ /**
10
+ * Names this layer takes away, whatever grants them.
11
+ *
12
+ * The deployment's pinned tools and the Common layer reach every role, so
13
+ * without this a system tool could only be withdrawn by editing the profile
14
+ * and restarting the Host. A denial beats every grant — system, Common, the
15
+ * role's own list and every skill — and it narrows the ceiling a delegated
16
+ * assistant is held to, so one checkbox takes a tool away from a role and
17
+ * from the experts that role may spawn.
18
+ */
19
+ readonly deny?: readonly string[];
20
+ }
21
+ /** Tool/skill selection shared by the common layer and one QA subrole. */
22
+ export interface QaCapabilitySelection {
23
+ readonly tools: QaToolSelection;
24
+ readonly skills: readonly string[];
25
+ /** Reserved extension seams; v1 enforcement intentionally ignores them. */
26
+ readonly mcpServers?: readonly string[];
27
+ readonly knowledgeSources?: readonly string[];
28
+ readonly promptAdditions?: readonly string[];
29
+ }
30
+ /** Audience one skill declares for itself in its own SKILL.md metadata. */
31
+ export type QaSkillAudience = {
32
+ readonly type: "unassigned";
33
+ } | {
34
+ readonly type: "common";
35
+ } | {
36
+ readonly type: "subroles";
37
+ readonly include: readonly string[];
38
+ };
39
+ /**
40
+ * Normalized `metadata.qa-surface` of one skill. Discovery never throws on a
41
+ * malformed block: the fields fall back to the fail-closed defaults and every
42
+ * complaint lands in `warnings` for the administration surface.
43
+ */
44
+ export interface QaSkillDescriptor {
45
+ readonly name: string;
46
+ readonly audience: QaSkillAudience;
47
+ /** Tools the skill needs to work; the role ceiling still decides the grant. */
48
+ readonly requiredTools: readonly string[];
49
+ /** Whether activation must be refused when one required tool is unavailable. */
50
+ readonly requireAll: boolean;
51
+ readonly lifecycle: "session";
52
+ /** `metadata.qa-surface.version`; 0 when the block declared none. */
53
+ readonly schemaVersion: number;
54
+ /** Whether the skill carried a readable qa-surface metadata block. */
55
+ readonly declared: boolean;
56
+ readonly warnings: readonly string[];
57
+ }
58
+ /**
59
+ * Administrator overlay over one skill's declared audience. The skill file is
60
+ * never rewritten: assignments are stored beside the policy and merged here.
61
+ */
62
+ export interface QaSkillAssignmentOverride {
63
+ readonly skillName: string;
64
+ readonly addToSubroles?: readonly string[];
65
+ readonly removeFromSubroles?: readonly string[];
66
+ readonly forceCommon?: boolean;
67
+ readonly disabled?: boolean;
68
+ }
69
+ export type QaSkillHealth = "healthy" | "degraded" | "blocked" | "unassigned";
70
+ /** Per-role projection of one skill: what the role sees and what it may grant. */
71
+ export interface QaSkillRoleGrant {
72
+ readonly roleId: string;
73
+ readonly visible: boolean;
74
+ readonly declared: boolean;
75
+ readonly addedByAdmin: boolean;
76
+ readonly removedByAdmin: boolean;
77
+ readonly disabled: boolean;
78
+ /** Required tools this role's ceiling admits. */
79
+ readonly grantableTools: readonly string[];
80
+ /** Required tools this role cannot grant: outside the ceiling or not installed. */
81
+ readonly unavailableTools: readonly string[];
82
+ }
83
+ /** One row of the administration Skills table plus its detail view. */
84
+ export interface QaSkillAccess {
85
+ readonly name: string;
86
+ readonly description?: string;
87
+ readonly whenToUse?: string;
88
+ readonly source: QaCapabilityDescriptor["source"];
89
+ readonly status: "available" | "missing";
90
+ readonly descriptor: QaSkillDescriptor;
91
+ /** Roles whose policy currently exposes the skill. */
92
+ readonly visibleTo: readonly string[];
93
+ readonly disabled: boolean;
94
+ readonly forceCommon: boolean;
95
+ readonly overridden: boolean;
96
+ readonly health: QaSkillHealth;
97
+ /** Every required tool with the union of roles that could grant it. */
98
+ readonly tools: readonly {
99
+ readonly id: string;
100
+ readonly installed: boolean;
101
+ readonly grantableBy: readonly string[];
102
+ readonly blockedFor: readonly string[];
103
+ }[];
104
+ readonly roles: readonly QaSkillRoleGrant[];
105
+ }
106
+ /** Why a skill activation was attempted; recorded for conversation review. */
107
+ export type QaSkillActivationOrigin = "model" | "user" | "preview";
108
+ /**
109
+ * One activation attempt on a live session, appended to the session record.
110
+ * `denied` covers an audience refusal, `rejected` a failed `requireAll` check.
111
+ */
112
+ export interface QaSkillActivationRecord {
113
+ readonly timestamp: string;
114
+ readonly skillName: string;
115
+ readonly origin: QaSkillActivationOrigin;
116
+ readonly outcome: "activated" | "rejected" | "denied";
117
+ readonly requestedTools: readonly string[];
118
+ readonly grantedTools: readonly string[];
119
+ readonly deniedTools: readonly string[];
120
+ readonly reason?: string;
121
+ }
122
+ /**
123
+ * One provider and model pair, fixed by policy rather than chosen in the
124
+ * interface. `provider` and `model` are named together or not at all, because
125
+ * the Host refuses either of them alone.
126
+ */
127
+ export interface QaModelPair {
128
+ readonly provider: string;
129
+ readonly model: string;
130
+ readonly reasoningEffort?: string;
131
+ }
132
+ /** One agent capability profile. It never grants administrative access. */
133
+ export interface QaSubrole {
134
+ readonly id: string;
135
+ readonly name: string;
136
+ readonly description?: string;
137
+ readonly enabled: boolean;
138
+ readonly capabilities: QaCapabilitySelection;
139
+ /**
140
+ * The pair every chat of this role is opened on, whatever the visitor picks
141
+ * in the interface. Absent means the role keeps no opinion and the
142
+ * deployment's pair serves it.
143
+ */
144
+ readonly model?: QaModelPair;
145
+ readonly ui?: {
146
+ readonly icon?: string;
147
+ readonly accent?: string;
148
+ };
149
+ }
150
+ /** Host-owned, versioned capability configuration. */
151
+ export interface QaCapabilityConfig {
152
+ readonly version: 1;
153
+ readonly common: QaCapabilitySelection;
154
+ readonly subroles: readonly QaSubrole[];
155
+ /** Administrator assignments layered over what each skill declares. */
156
+ readonly skillOverrides: readonly QaSkillAssignmentOverride[];
157
+ }
158
+ /**
159
+ * One pair the Host can serve right now, as the administration surface lists
160
+ * it. A projection of the harness catalog, so the browser never learns the
161
+ * provider's own catalog shape and a policy can only be written by picking one
162
+ * of these.
163
+ */
164
+ export interface QaModelCatalogEntry {
165
+ readonly provider: string;
166
+ readonly model: string;
167
+ /** The catalog's display name for the model, or its id when it has none. */
168
+ readonly label: string;
169
+ readonly reasoningEfforts: readonly string[];
170
+ }
171
+ /** The QA profiles one account may choose, independently of its access role. */
172
+ export interface QaUserAccess {
173
+ readonly allowedSubroles: readonly string[];
174
+ readonly defaultSubrole: string;
175
+ /**
176
+ * The pair this account is opened on, ahead of what its role says: a support
177
+ * desk runs on the local model even when it borrows a role the rest of the
178
+ * deployment shares. Absent means the account keeps no opinion.
179
+ */
180
+ readonly model?: QaModelPair;
181
+ }
182
+ export type QaCapabilitySourceKind = "core" | "plugin" | "mcp" | "filesystem" | "runtime";
183
+ /** One capability currently installed, or retained as a missing selection. */
184
+ export interface QaCapabilityDescriptor {
185
+ readonly type: "tool" | "skill";
186
+ readonly id: string;
187
+ readonly title: string;
188
+ readonly description?: string;
189
+ readonly source: {
190
+ readonly kind: QaCapabilitySourceKind;
191
+ readonly name?: string;
192
+ };
193
+ readonly status: "available" | "missing";
194
+ readonly modelInvocable?: boolean;
195
+ readonly userInvocable?: boolean;
196
+ }
197
+ /** JSON-safe projection of an immutable policy snapshot. */
198
+ export interface QaEffectiveCapabilityPolicy {
199
+ readonly subroleId: string;
200
+ /** Tools visible from the first model step, before any skill is loaded. */
201
+ readonly tools: readonly string[];
202
+ /** Ceiling for the tools an activated skill may add to this session. */
203
+ readonly grantableTools: readonly string[];
204
+ /** Skills the model may see and load for the frozen subrole. */
205
+ readonly skills: readonly string[];
206
+ /**
207
+ * Visible skills a person may invoke with `/name`, including skills that
208
+ * opted out of model invocation and therefore stay out of the catalog. The
209
+ * skills this account owns are here for it without a role grant, unless an
210
+ * administrator has withdrawn the name outright.
211
+ */
212
+ readonly userSkills: readonly string[];
213
+ readonly sources: {
214
+ readonly systemTools: readonly string[];
215
+ readonly commonTools: readonly string[];
216
+ readonly roleTools: readonly string[];
217
+ readonly commonGrantableTools: readonly string[];
218
+ readonly roleGrantableTools: readonly string[];
219
+ readonly systemSkills: readonly string[];
220
+ readonly commonSkills: readonly string[];
221
+ readonly roleSkills: readonly string[];
222
+ /** Skills this subrole received from their own SKILL.md audience. */
223
+ readonly declaredSkills: readonly string[];
224
+ };
225
+ readonly missingTools: readonly string[];
226
+ readonly missingSkills: readonly string[];
227
+ /** Revision of the resolved policy, recorded with the session snapshot. */
228
+ readonly policyRevision: string;
229
+ }
230
+ //# sourceMappingURL=capability.d.ts.map