@yadsh/dsh-qa-surface 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/README.md +153 -12
  2. package/lib/account-remotes.js +100 -0
  3. package/lib/account-remotes.js.map +1 -0
  4. package/lib/accounts/credentials.js +27 -0
  5. package/lib/accounts/credentials.js.map +1 -0
  6. package/lib/accounts/errors.js +9 -0
  7. package/lib/accounts/errors.js.map +1 -0
  8. package/lib/accounts/file.js +101 -0
  9. package/lib/accounts/file.js.map +1 -0
  10. package/lib/accounts/store.js +144 -161
  11. package/lib/accounts/store.js.map +1 -1
  12. package/lib/accounts/token.js +61 -0
  13. package/lib/accounts/token.js.map +1 -0
  14. package/lib/attachment-rules.js +111 -0
  15. package/lib/attachment-rules.js.map +1 -0
  16. package/lib/cli.js +122 -9
  17. package/lib/cli.js.map +1 -1
  18. package/lib/client/QaAccountsController.js +32 -2
  19. package/lib/client/QaAccountsController.js.map +1 -1
  20. package/lib/client/QaSessionController.js +47 -65
  21. package/lib/client/QaSessionController.js.map +1 -1
  22. package/lib/client/QaSurface.js +121 -107
  23. package/lib/client/QaSurface.js.map +1 -1
  24. package/lib/client/QaTranscriptAdapter.js +71 -6
  25. package/lib/client/QaTranscriptAdapter.js.map +1 -1
  26. package/lib/client/attachments.js +150 -0
  27. package/lib/client/attachments.js.map +1 -0
  28. package/lib/client/attestation.js +1 -1
  29. package/lib/client/attestation.js.map +1 -1
  30. package/lib/client/base64.js +16 -0
  31. package/lib/client/base64.js.map +1 -0
  32. package/lib/client/chat-files.js +48 -0
  33. package/lib/client/chat-files.js.map +1 -0
  34. package/lib/client/components/Markdown.js +1 -1
  35. package/lib/client/components/Markdown.js.map +1 -1
  36. package/lib/client/components/QaChangelog.js +38 -19
  37. package/lib/client/components/QaChangelog.js.map +1 -1
  38. package/lib/client/components/QaComposer.js +56 -74
  39. package/lib/client/components/QaComposer.js.map +1 -1
  40. package/lib/client/components/QaFileAttachment.js +19 -0
  41. package/lib/client/components/QaFileAttachment.js.map +1 -0
  42. package/lib/client/components/QaFilesPanel.js +45 -0
  43. package/lib/client/components/QaFilesPanel.js.map +1 -0
  44. package/lib/client/components/QaHeader.js +34 -0
  45. package/lib/client/components/QaHeader.js.map +1 -0
  46. package/lib/client/components/QaMessage.js +17 -4
  47. package/lib/client/components/QaMessage.js.map +1 -1
  48. package/lib/client/components/QaModal.js +31 -0
  49. package/lib/client/components/QaModal.js.map +1 -0
  50. package/lib/client/components/QaProfile.js +64 -0
  51. package/lib/client/components/QaProfile.js.map +1 -0
  52. package/lib/client/components/QaRightRail.js +15 -0
  53. package/lib/client/components/QaRightRail.js.map +1 -0
  54. package/lib/client/components/QaSidebar.js +6 -1
  55. package/lib/client/components/QaSidebar.js.map +1 -1
  56. package/lib/client/components/{QaSourcesDrawer.js → QaSourcesPanel.js} +3 -3
  57. package/lib/client/components/QaSourcesPanel.js.map +1 -0
  58. package/lib/client/components/QaTurnRail.js +15 -0
  59. package/lib/client/components/QaTurnRail.js.map +1 -1
  60. package/lib/client/components/QaWidthHandle.js +25 -20
  61. package/lib/client/components/QaWidthHandle.js.map +1 -1
  62. package/lib/client/components/QaWorkGroup.js +19 -20
  63. package/lib/client/components/QaWorkGroup.js.map +1 -1
  64. package/lib/client/components/surface-utils.js +28 -0
  65. package/lib/client/components/surface-utils.js.map +1 -0
  66. package/lib/client/components/thinking-phrases.js +24 -0
  67. package/lib/client/components/thinking-phrases.js.map +1 -0
  68. package/lib/client/create-session.js +7 -32
  69. package/lib/client/create-session.js.map +1 -1
  70. package/lib/client/failure-copy.js +63 -0
  71. package/lib/client/failure-copy.js.map +1 -0
  72. package/lib/client/index.js +38 -7
  73. package/lib/client/index.js.map +1 -1
  74. package/lib/client/prompt-content.js +54 -0
  75. package/lib/client/prompt-content.js.map +1 -0
  76. package/lib/client/settings/card.js +143 -0
  77. package/lib/client/settings/card.js.map +1 -0
  78. package/lib/client/settings/fields.js +145 -0
  79. package/lib/client/settings/fields.js.map +1 -0
  80. package/lib/client/settings/format.js +255 -0
  81. package/lib/client/settings/format.js.map +1 -0
  82. package/lib/client/settings/sections/access.js +25 -0
  83. package/lib/client/settings/sections/access.js.map +1 -0
  84. package/lib/client/settings/sections/accounts.js +47 -0
  85. package/lib/client/settings/sections/accounts.js.map +1 -0
  86. package/lib/client/settings/sections/attachments.js +46 -0
  87. package/lib/client/settings/sections/attachments.js.map +1 -0
  88. package/lib/client/settings/sections/branding.js +28 -0
  89. package/lib/client/settings/sections/branding.js.map +1 -0
  90. package/lib/client/settings/sections/common.js +20 -0
  91. package/lib/client/settings/sections/common.js.map +1 -0
  92. package/lib/client/settings/sections/embedding.js +19 -0
  93. package/lib/client/settings/sections/embedding.js.map +1 -0
  94. package/lib/client/settings/sections/interface.js +60 -0
  95. package/lib/client/settings/sections/interface.js.map +1 -0
  96. package/lib/client/settings/sections/lockdown.js +82 -0
  97. package/lib/client/settings/sections/lockdown.js.map +1 -0
  98. package/lib/client/settings/sections/session.js +53 -0
  99. package/lib/client/settings/sections/session.js.map +1 -0
  100. package/lib/client/settings/sections/sources.js +72 -0
  101. package/lib/client/settings/sections/sources.js.map +1 -0
  102. package/lib/client/settings/sections/status.js +37 -0
  103. package/lib/client/settings/sections/status.js.map +1 -0
  104. package/lib/client/settings/sections.js +23 -0
  105. package/lib/client/settings/sections.js.map +1 -0
  106. package/lib/client/settings/styles.js +57 -0
  107. package/lib/client/settings/styles.js.map +1 -0
  108. package/lib/client/stream-publisher.js +47 -0
  109. package/lib/client/stream-publisher.js.map +1 -0
  110. package/lib/client/styles.js +85 -19
  111. package/lib/client/styles.js.map +1 -1
  112. package/lib/client/types.js.map +1 -1
  113. package/lib/client/use-right-rail.js +96 -0
  114. package/lib/client/use-right-rail.js.map +1 -0
  115. package/lib/client/use-session-ui-state.js +26 -19
  116. package/lib/client/use-session-ui-state.js.map +1 -1
  117. package/lib/client.js +4788 -869
  118. package/lib/client.js.map +1 -1
  119. package/lib/config-resolvers/accounts.js +60 -0
  120. package/lib/config-resolvers/accounts.js.map +1 -0
  121. package/lib/config-resolvers/attachments.js +28 -0
  122. package/lib/config-resolvers/attachments.js.map +1 -0
  123. package/lib/config-resolvers/basics.js +59 -0
  124. package/lib/config-resolvers/basics.js.map +1 -0
  125. package/lib/config-resolvers/defaults.js +132 -0
  126. package/lib/config-resolvers/defaults.js.map +1 -0
  127. package/lib/config-resolvers/lockdown.js +79 -0
  128. package/lib/config-resolvers/lockdown.js.map +1 -0
  129. package/lib/config-resolvers/session.js +42 -0
  130. package/lib/config-resolvers/session.js.map +1 -0
  131. package/lib/config-resolvers/shared.js +42 -0
  132. package/lib/config-resolvers/shared.js.map +1 -0
  133. package/lib/config-resolvers/sources.js +81 -0
  134. package/lib/config-resolvers/sources.js.map +1 -0
  135. package/lib/config-resolvers/ui.js +20 -0
  136. package/lib/config-resolvers/ui.js.map +1 -0
  137. package/lib/config.js +65 -4
  138. package/lib/config.js.map +1 -1
  139. package/lib/entry-redirect.js +2 -1
  140. package/lib/entry-redirect.js.map +1 -1
  141. package/lib/index.js +123 -74
  142. package/lib/index.js.map +1 -1
  143. package/lib/profile.js +214 -0
  144. package/lib/profile.js.map +1 -0
  145. package/lib/prompt-notes.js +231 -0
  146. package/lib/prompt-notes.js.map +1 -0
  147. package/lib/resolve-config.js +35 -410
  148. package/lib/resolve-config.js.map +1 -1
  149. package/lib/secure-session.js +82 -16
  150. package/lib/secure-session.js.map +1 -1
  151. package/lib/shared/session-key.js +18 -0
  152. package/lib/shared/session-key.js.map +1 -0
  153. package/lib/shared/settings.js +10 -0
  154. package/lib/shared/settings.js.map +1 -0
  155. package/lib/thinking-phrases.js +68 -0
  156. package/lib/thinking-phrases.js.map +1 -0
  157. package/lib/typert.host.js +162 -17
  158. package/lib/typert.remote-client.d.ts +5 -1
  159. package/lib/typert.remote-client.js +132 -13
  160. package/lib/types/account-remotes.d.ts +42 -0
  161. package/lib/types/accounts/credentials.d.ts +14 -0
  162. package/lib/types/accounts/errors.d.ts +11 -0
  163. package/lib/types/accounts/file.d.ts +82 -0
  164. package/lib/types/accounts/store.d.ts +66 -43
  165. package/lib/types/accounts/token.d.ts +31 -0
  166. package/lib/types/attachment-rules.d.ts +44 -0
  167. package/lib/types/cli.d.ts +2 -2
  168. package/lib/types/client/QaAccountsController.d.ts +8 -1
  169. package/lib/types/client/QaSessionController.d.ts +16 -16
  170. package/lib/types/client/QaSurface.d.ts +7 -1
  171. package/lib/types/client/attachments.d.ts +54 -0
  172. package/lib/types/client/base64.d.ts +10 -0
  173. package/lib/types/client/chat-files.d.ts +30 -0
  174. package/lib/types/client/components/QaChangelog.d.ts +1 -1
  175. package/lib/types/client/components/QaComposer.d.ts +8 -4
  176. package/lib/types/client/components/QaFileAttachment.d.ts +14 -0
  177. package/lib/types/client/components/QaFilesPanel.d.ts +15 -0
  178. package/lib/types/client/components/QaHeader.d.ts +41 -0
  179. package/lib/types/client/components/QaMessage.d.ts +3 -1
  180. package/lib/types/client/components/QaModal.d.ts +26 -0
  181. package/lib/types/client/components/QaProfile.d.ts +25 -0
  182. package/lib/types/client/components/QaRightRail.d.ts +23 -0
  183. package/lib/types/client/components/QaSidebar.d.ts +14 -0
  184. package/lib/types/client/components/{QaSourcesDrawer.d.ts → QaSourcesPanel.d.ts} +7 -4
  185. package/lib/types/client/components/QaTurnRail.d.ts +6 -0
  186. package/lib/types/client/components/QaWidthHandle.d.ts +14 -7
  187. package/lib/types/client/components/QaWorkGroup.d.ts +5 -3
  188. package/lib/types/client/components/surface-utils.d.ts +11 -0
  189. package/lib/types/client/components/thinking-phrases.d.ts +9 -0
  190. package/lib/types/client/create-session.d.ts +6 -9
  191. package/lib/types/client/failure-copy.d.ts +19 -0
  192. package/lib/types/client/prompt-content.d.ts +30 -0
  193. package/lib/types/client/settings/card.d.ts +23 -0
  194. package/lib/types/client/settings/fields.d.ts +139 -0
  195. package/lib/types/client/settings/format.d.ts +108 -0
  196. package/lib/types/client/settings/sections/access.d.ts +9 -0
  197. package/lib/types/client/settings/sections/accounts.d.ts +9 -0
  198. package/lib/types/client/settings/sections/attachments.d.ts +15 -0
  199. package/lib/types/client/settings/sections/branding.d.ts +8 -0
  200. package/lib/types/client/settings/sections/common.d.ts +28 -0
  201. package/lib/types/client/settings/sections/embedding.d.ts +8 -0
  202. package/lib/types/client/settings/sections/interface.d.ts +9 -0
  203. package/lib/types/client/settings/sections/lockdown.d.ts +9 -0
  204. package/lib/types/client/settings/sections/session.d.ts +9 -0
  205. package/lib/types/client/settings/sections/sources.d.ts +9 -0
  206. package/lib/types/client/settings/sections/status.d.ts +22 -0
  207. package/lib/types/client/settings/sections.d.ts +25 -0
  208. package/lib/types/client/settings/styles.d.ts +8 -0
  209. package/lib/types/client/stream-publisher.d.ts +28 -0
  210. package/lib/types/client/types.d.ts +29 -1
  211. package/lib/types/client/use-right-rail.d.ts +56 -0
  212. package/lib/types/client/use-session-ui-state.d.ts +13 -7
  213. package/lib/types/config-resolvers/accounts.d.ts +15 -0
  214. package/lib/types/config-resolvers/attachments.d.ts +6 -0
  215. package/lib/types/config-resolvers/basics.d.ts +8 -0
  216. package/lib/types/config-resolvers/defaults.d.ts +4 -0
  217. package/lib/types/config-resolvers/lockdown.d.ts +10 -0
  218. package/lib/types/config-resolvers/session.d.ts +6 -0
  219. package/lib/types/config-resolvers/shared.d.ts +16 -0
  220. package/lib/types/config-resolvers/sources.d.ts +6 -0
  221. package/lib/types/config-resolvers/ui.d.ts +6 -0
  222. package/lib/types/index.d.ts +20 -13
  223. package/lib/types/profile.d.ts +76 -0
  224. package/lib/types/prompt-notes.d.ts +110 -0
  225. package/lib/types/resolve-config.d.ts +8 -3
  226. package/lib/types/secure-session.d.ts +26 -1
  227. package/lib/types/shared/session-key.d.ts +23 -0
  228. package/lib/types/shared/settings.d.ts +10 -0
  229. package/lib/types/thinking-phrases.d.ts +17 -0
  230. package/lib/types/types.d.ts +123 -5
  231. package/lib/types/user-workspace.d.ts +38 -0
  232. package/lib/user-workspace.js +231 -0
  233. package/lib/user-workspace.js.map +1 -0
  234. package/package.json +14 -7
  235. package/CHANGELOG.md +0 -176
  236. package/SPEC-dsh-qa-surface.md +0 -2425
  237. package/docs/ARCHITECTURE.md +0 -66
  238. package/docs/COMPATIBILITY.md +0 -14
  239. package/docs/CONFIGURATION.md +0 -199
  240. package/docs/EMBEDDING.md +0 -13
  241. package/docs/SOURCES-MIGRATION.md +0 -28
  242. package/docs/SOURCES-PROVENANCE-AUDIT.md +0 -88
  243. package/docs/SPEC-dsh-qa-surface-accounts.md +0 -219
  244. package/docs/SPEC-dsh-qa-surface-sources-provenance.md +0 -1692
  245. package/lib/client/components/QaSourcesDrawer.js.map +0 -1
@@ -29,6 +29,12 @@ const _yadsh_dsh_qa_surface_qaSurface_accountsLogin_result$schema = z.object({
29
29
  'createdAt': z.string().readonly(),
30
30
  'lastLoginAt': z.union([z.literal(null), z.string()]).readonly(),
31
31
  'disabled': z.boolean().readonly(),
32
+ 'profile': z.object({
33
+ 'fullName': z.string().readonly(),
34
+ 'identities': z.record(z.string(), z.string()).readonly().readonly(),
35
+ 'instructions': z.string().readonly(),
36
+ 'updatedAt': z.union([z.literal(null), z.string()]).readonly(),
37
+ }).readonly(),
32
38
  }).readonly(),
33
39
  })
34
40
  const _yadsh_dsh_qa_surface_qaSurface_accountsOwnedSessions_parameter_0$schema = z.string()
@@ -47,6 +53,33 @@ const _yadsh_dsh_qa_surface_qaSurface_accountsRegister_result$schema = z.object(
47
53
  'createdAt': z.string().readonly(),
48
54
  'lastLoginAt': z.union([z.literal(null), z.string()]).readonly(),
49
55
  'disabled': z.boolean().readonly(),
56
+ 'profile': z.object({
57
+ 'fullName': z.string().readonly(),
58
+ 'identities': z.record(z.string(), z.string()).readonly().readonly(),
59
+ 'instructions': z.string().readonly(),
60
+ 'updatedAt': z.union([z.literal(null), z.string()]).readonly(),
61
+ }).readonly(),
62
+ }).readonly(),
63
+ })
64
+ const _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_parameter_0$schema = z.string()
65
+ const _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_parameter_1$schema = z.object({
66
+ 'fullName': z.string().readonly(),
67
+ 'identities': z.record(z.string(), z.string()).readonly().readonly(),
68
+ 'instructions': z.string().readonly(),
69
+ })
70
+ const _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_result$schema = z.object({
71
+ 'id': z.string().readonly(),
72
+ 'email': z.string().readonly(),
73
+ 'displayName': z.string().readonly(),
74
+ 'role': z.union([z.literal("user"), z.literal("admin")]).readonly(),
75
+ 'createdAt': z.string().readonly(),
76
+ 'lastLoginAt': z.union([z.literal(null), z.string()]).readonly(),
77
+ 'disabled': z.boolean().readonly(),
78
+ 'profile': z.object({
79
+ 'fullName': z.string().readonly(),
80
+ 'identities': z.record(z.string(), z.string()).readonly().readonly(),
81
+ 'instructions': z.string().readonly(),
82
+ 'updatedAt': z.union([z.literal(null), z.string()]).readonly(),
50
83
  }).readonly(),
51
84
  })
52
85
  const _yadsh_dsh_qa_surface_qaSurface_accountsWhoami_parameter_0$schema = z.string()
@@ -62,8 +95,16 @@ const _yadsh_dsh_qa_surface_qaSurface_accountsWhoami_result$schema = z.union([z.
62
95
  'createdAt': z.string().readonly(),
63
96
  'lastLoginAt': z.union([z.literal(null), z.string()]).readonly(),
64
97
  'disabled': z.boolean().readonly(),
98
+ 'profile': z.object({
99
+ 'fullName': z.string().readonly(),
100
+ 'identities': z.record(z.string(), z.string()).readonly().readonly(),
101
+ 'instructions': z.string().readonly(),
102
+ 'updatedAt': z.union([z.literal(null), z.string()]).readonly(),
103
+ }).readonly(),
65
104
  }).readonly(),
66
105
  })])
106
+ const _yadsh_dsh_qa_surface_qaSurface_createSession_parameter_0$schema = z.string()
107
+ const _yadsh_dsh_qa_surface_qaSurface_createSession_result$schema = z.string()
67
108
  const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
68
109
  'enabled': z.boolean().readonly(),
69
110
  'route': z.object({
@@ -97,10 +138,11 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
97
138
  'showToolActivity': z.boolean().readonly(),
98
139
  'showReasoning': z.boolean().readonly(),
99
140
  'renderMarkdown': z.boolean().readonly(),
100
- 'maxContentWidth': z.number().readonly(),
141
+ 'minContentWidth': z.number().readonly(),
101
142
  'showSessionList': z.boolean().readonly(),
102
143
  }).readonly(),
103
144
  'suggestedQuestions': z.array(z.string()).readonly(),
145
+ 'thinkingPhrases': z.array(z.string()).readonly(),
104
146
  'interaction': z.object({
105
147
  'approvals': z.literal("blocked").readonly(),
106
148
  'questions': z.literal("unsupported").readonly(),
@@ -110,7 +152,7 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
110
152
  'enforceFixedAgentPreset': z.boolean().readonly(),
111
153
  'enforceFixedWorkspace': z.boolean().readonly(),
112
154
  'enforceFixedModel': z.boolean().readonly(),
113
- 'sandboxMode': z.literal("read-only").readonly(),
155
+ 'sandboxMode': z.union([z.literal("read-only"), z.literal("workspace-write")]).readonly(),
114
156
  'approvalPolicy': z.literal("never").readonly(),
115
157
  'permissionPreset': z.string().readonly(),
116
158
  'allowPermissionChanges': z.literal(false).readonly(),
@@ -133,6 +175,16 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
133
175
  'allowRegistration': z.boolean().readonly(),
134
176
  'sessionTtlDays': z.number().readonly(),
135
177
  'showOtherUsersChats': z.boolean().readonly(),
178
+ 'perUserWorkspace': z.boolean().readonly(),
179
+ 'profile': z.object({
180
+ 'enabled': z.boolean().readonly(),
181
+ 'inject': z.boolean().readonly(),
182
+ 'identities': z.array(z.object({
183
+ 'key': z.string().readonly(),
184
+ 'label': z.string().readonly(),
185
+ })).readonly(),
186
+ 'instructionsMaxLength': z.number().readonly(),
187
+ }).readonly(),
136
188
  }).readonly(),
137
189
  'entry': z.object({
138
190
  'redirectNonLoopback': z.boolean().readonly(),
@@ -177,6 +229,13 @@ const _yadsh_dsh_qa_surface_qaSurface_describe_result$schema = z.object({
177
229
  'legacy': z.object({
178
230
  'parseAssistantSourcesBlock': z.boolean().readonly(),
179
231
  }).readonly(),
232
+ }).readonly(),
233
+ 'attachments': z.object({
234
+ 'textFiles': z.boolean().readonly(),
235
+ 'pastedTextLines': z.number().readonly(),
236
+ 'maxFileBytes': z.number().readonly(),
237
+ 'maxPending': z.number().readonly(),
238
+ 'extensions': z.array(z.string()).readonly(),
180
239
  }).readonly(),
181
240
  })
182
241
  const _yadsh_dsh_qa_surface_qaSurface_readSourceFile_parameter_0$schema = z.string()
@@ -198,7 +257,7 @@ const _yadsh_dsh_qa_surface_qaSurface_secureSession_result$schema = z.object({
198
257
  'agentPresetMatches': z.boolean().readonly(),
199
258
  'workspaceMatches': z.boolean().readonly(),
200
259
  'modelMatches': z.boolean().readonly(),
201
- 'sandboxIsReadOnly': z.boolean().readonly(),
260
+ 'sandboxModeMatches': z.boolean().readonly(),
202
261
  'approvalIsNever': z.boolean().readonly(),
203
262
  'permissionPreset': z.string().readonly(),
204
263
  'toolPolicyLoaded': z.boolean().readonly(),
@@ -314,7 +373,7 @@ export const TYPERT_REMOTE = {
314
373
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaClaimResult',
315
374
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsClaimSessions_result$schema,
316
375
  },
317
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":256,"column":3},
376
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":230,"column":3},
318
377
  },
319
378
  {
320
379
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsListOwnership',
@@ -339,7 +398,7 @@ export const TYPERT_REMOTE = {
339
398
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/accountsListOwnership:result',
340
399
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsListOwnership_result$schema,
341
400
  },
342
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":280,"column":3},
401
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":249,"column":3},
343
402
  },
344
403
  {
345
404
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsLogin',
@@ -374,7 +433,7 @@ export const TYPERT_REMOTE = {
374
433
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountSession',
375
434
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsLogin_result$schema,
376
435
  },
377
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":241,"column":3},
436
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":218,"column":3},
378
437
  },
379
438
  {
380
439
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsOwnedSessions',
@@ -399,7 +458,7 @@ export const TYPERT_REMOTE = {
399
458
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/accountsOwnedSessions:result',
400
459
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsOwnedSessions_result$schema,
401
460
  },
402
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":266,"column":3},
461
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":239,"column":3},
403
462
  },
404
463
  {
405
464
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsRegister',
@@ -434,7 +493,42 @@ export const TYPERT_REMOTE = {
434
493
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountSession',
435
494
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsRegister_result$schema,
436
495
  },
437
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":235,"column":3},
496
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":213,"column":3},
497
+ },
498
+ {
499
+ id: '@yadsh/dsh-qa-surface#qaSurface/accountsUpdateProfile',
500
+ service: 'qaSurface',
501
+ namespace: 'qaSurface',
502
+ method: 'accountsUpdateProfile',
503
+ invocation: { kind: 'direct' },
504
+ parameters: [
505
+ {
506
+ name: 'token',
507
+ wire: 'token',
508
+ source: 'json',
509
+ codec: {
510
+ mode: 'strict',
511
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/accountsUpdateProfile:token',
512
+ schema: _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_parameter_0$schema,
513
+ },
514
+ },
515
+ {
516
+ name: 'input',
517
+ wire: 'input',
518
+ source: 'json',
519
+ codec: {
520
+ mode: 'strict',
521
+ typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountProfileInput',
522
+ schema: _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_parameter_1$schema,
523
+ },
524
+ },
525
+ ],
526
+ result: {
527
+ mode: 'strict',
528
+ typeSymbol: '@yadsh/dsh-qa-surface/types#QaAccountUserPublic',
529
+ schema: _yadsh_dsh_qa_surface_qaSurface_accountsUpdateProfile_result$schema,
530
+ },
531
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":262,"column":3},
438
532
  },
439
533
  {
440
534
  id: '@yadsh/dsh-qa-surface#qaSurface/accountsWhoami',
@@ -459,7 +553,32 @@ export const TYPERT_REMOTE = {
459
553
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaWhoamiResult',
460
554
  schema: _yadsh_dsh_qa_surface_qaSurface_accountsWhoami_result$schema,
461
555
  },
462
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":248,"column":3},
556
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":224,"column":3},
557
+ },
558
+ {
559
+ id: '@yadsh/dsh-qa-surface#qaSurface/createSession',
560
+ service: 'qaSurface',
561
+ namespace: 'qaSurface',
562
+ method: 'createSession',
563
+ invocation: { kind: 'direct' },
564
+ parameters: [
565
+ {
566
+ name: 'token',
567
+ wire: 'token',
568
+ source: 'json',
569
+ codec: {
570
+ mode: 'strict',
571
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/createSession:token',
572
+ schema: _yadsh_dsh_qa_surface_qaSurface_createSession_parameter_0$schema,
573
+ },
574
+ },
575
+ ],
576
+ result: {
577
+ mode: 'strict',
578
+ typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/createSession:result',
579
+ schema: _yadsh_dsh_qa_surface_qaSurface_createSession_result$schema,
580
+ },
581
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":287,"column":9},
463
582
  },
464
583
  {
465
584
  id: '@yadsh/dsh-qa-surface#qaSurface/describe',
@@ -474,7 +593,7 @@ export const TYPERT_REMOTE = {
474
593
  typeSymbol: '@yadsh/dsh-qa-surface/types#ResolvedQaSurfaceConfig',
475
594
  schema: _yadsh_dsh_qa_surface_qaSurface_describe_result$schema,
476
595
  },
477
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":298,"column":3},
596
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":277,"column":3},
478
597
  },
479
598
  {
480
599
  id: '@yadsh/dsh-qa-surface#qaSurface/readSourceFile',
@@ -519,7 +638,7 @@ export const TYPERT_REMOTE = {
519
638
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaSourceFilePreview',
520
639
  schema: _yadsh_dsh_qa_surface_qaSurface_readSourceFile_result$schema,
521
640
  },
522
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":337,"column":9},
641
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":394,"column":9},
523
642
  },
524
643
  {
525
644
  id: '@yadsh/dsh-qa-surface#qaSurface/secureSession',
@@ -554,7 +673,7 @@ export const TYPERT_REMOTE = {
554
673
  typeSymbol: '@yadsh/dsh-qa-surface/types#QaLockdownProof',
555
674
  schema: _yadsh_dsh_qa_surface_qaSurface_secureSession_result$schema,
556
675
  },
557
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":304,"column":3},
676
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":361,"column":3},
558
677
  },
559
678
  {
560
679
  id: '@yadsh/dsh-qa-surface#qaSurface/sources',
@@ -589,7 +708,7 @@ export const TYPERT_REMOTE = {
589
708
  typeSymbol: '@yadsh/dsh-qa-surface#qaSurface/sources:result',
590
709
  schema: _yadsh_dsh_qa_surface_qaSurface_sources_result$schema,
591
710
  },
592
- sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":330,"column":3},
711
+ sourceLocation: {"file":"packages/dsh-qa-surface/src/index.ts","line":387,"column":3},
593
712
  },
594
713
  ],
595
714
  }
@@ -0,0 +1,42 @@
1
+ import type { PluginLogger } from "@yadsh/dsh-plugin-log";
2
+ import { QaAccounts } from "./accounts/store.js";
3
+ import type { QaAccountProfileInput, QaAccountSession, QaAccountUserPublic, QaClaimResult, QaOwnershipEntry, QaWhoamiResult, ResolvedQaSurfaceConfig } from "./types.js";
4
+ /**
5
+ * Host-side bodies of the account remotes the `QaSurface` service exposes.
6
+ * The `@Remote`-decorated signatures stay on the service class (typert code
7
+ * generation reads the class shape); this context carries everything behind
8
+ * them: store construction and memoization, the disabled refusal, and the
9
+ * error mapping onto the shared `(reason: <code>)` wire marker.
10
+ */
11
+ export interface QaAccountRemotes {
12
+ /** The accounts store behind the runtime toggle, or undefined while off. */
13
+ resolve(config: ResolvedQaSurfaceConfig): QaAccounts | undefined;
14
+ /** Map a store failure onto the shared `(reason: <code>)` wire marker. */
15
+ run<T>(operation: () => T, sessionIdForLog?: string): T;
16
+ register(email: string, password: string): QaAccountSession;
17
+ login(email: string, password: string): QaAccountSession;
18
+ /** Identity probe; safe to call with an empty or expired token. */
19
+ whoami(token: string): QaWhoamiResult;
20
+ /** Migrate a browser's local chat index into server-side ownership. */
21
+ claimSessions(token: string, sessionIds: readonly string[]): QaClaimResult;
22
+ /** The token user's owned session ids; the sidebar list authority. */
23
+ ownedSessions(token: string): {
24
+ readonly ids: readonly string[];
25
+ };
26
+ /**
27
+ * Every chat-ownership entry with owner display names; the cross-user view
28
+ * admin browsers group the sidebar by. Ordinary accounts are refused with
29
+ * the dedicated reason, anonymous ones with auth-required.
30
+ */
31
+ listOwnership(token: string): {
32
+ readonly entries: readonly QaOwnershipEntry[];
33
+ };
34
+ /** Replace the caller's own self-declared profile; the token is the identity. */
35
+ updateProfile(token: string, input: QaAccountProfileInput): QaAccountUserPublic;
36
+ }
37
+ /** Build the account-remotes context for one `QaSurface` service instance. */
38
+ export declare function createQaAccountRemotes(options: {
39
+ getConfig: () => ResolvedQaSurfaceConfig;
40
+ logger: PluginLogger;
41
+ }): QaAccountRemotes;
42
+ //# sourceMappingURL=account-remotes.d.ts.map
@@ -0,0 +1,14 @@
1
+ /** An account request after normalization, ready to become a stored user. */
2
+ export interface ValidatedCredentials {
3
+ readonly email: string;
4
+ /** Trimmed display name; empty means "derive one from the address". */
5
+ readonly displayName: string;
6
+ }
7
+ /**
8
+ * The email/password/display-name gate shared by self-registration and the
9
+ * operator's addUser, so both paths reject unusable input with the same
10
+ * errors and messages, in the same order. Returns the normalized address and
11
+ * trimmed display name; the caller still decides uniqueness and role.
12
+ */
13
+ export declare function validateCredentials(email: string, password: string, displayName: string | undefined): ValidatedCredentials;
14
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Coarse, wire-safe account failure codes. They ride the `(reason: <code>)`
3
+ * marker pattern the attestation path established; the browser maps them to
4
+ * audience-safe copy and the precise cause stays in the Host logs.
5
+ */
6
+ export type QaAccountsErrorReason = "auth-required" | "admin-required" | "invalid-credentials" | "account-disabled" | "email-taken" | "invalid-email" | "invalid-display-name" | "invalid-profile" | "profile-disabled" | "invalid-role" | "weak-password" | "registration-disabled" | "rate-limited" | "session-owned-elsewhere";
7
+ export declare class QaAccountsError extends Error {
8
+ readonly reason: QaAccountsErrorReason;
9
+ constructor(reason: QaAccountsErrorReason, message: string);
10
+ }
11
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1,82 @@
1
+ import type { Stats } from "node:fs";
2
+ import type { QaAccountRole } from "../types.js";
3
+ /** One account's self-declared profile as it rests in the accounts file. */
4
+ export interface StoredProfile {
5
+ fullName?: string;
6
+ identities?: Record<string, string>;
7
+ instructions?: string;
8
+ updatedAt?: string;
9
+ }
10
+ export interface StoredUser {
11
+ readonly id: string;
12
+ readonly email: string;
13
+ readonly displayName: string;
14
+ readonly role: QaAccountRole;
15
+ /** scrypt material: hex salt + hex hash. */
16
+ readonly passwordHash: {
17
+ readonly salt: string;
18
+ readonly hash: string;
19
+ };
20
+ readonly createdAt: string;
21
+ lastLoginAt: string | null;
22
+ /** Disabled accounts are refused at login and lose their live tokens. */
23
+ disabled?: boolean;
24
+ /**
25
+ * Bumped to invalidate every token ever issued to the account: the value
26
+ * rides the token payload and must match at verification time.
27
+ */
28
+ tokenVersion?: number;
29
+ /** Absent until the owner fills the profile form for the first time. */
30
+ profile?: StoredProfile;
31
+ }
32
+ export interface AccountsFile {
33
+ readonly version: 1;
34
+ /** HMAC key for account tokens; rotated on password change by rewriting it. */
35
+ readonly secret: string;
36
+ readonly users: StoredUser[];
37
+ readonly ownership: Record<string, {
38
+ readonly userId: string;
39
+ readonly claimedAt: string;
40
+ }>;
41
+ }
42
+ /** mtime+size pair identifying one on-disk version of the accounts file. */
43
+ export interface FileStamp {
44
+ readonly mtimeMs: number;
45
+ readonly size: number;
46
+ }
47
+ /**
48
+ * Where the last-seen stamp lives. Load and persist keep it current in place,
49
+ * so a caller holds one mutable ref instead of threading the stamp through
50
+ * every read-modify-write.
51
+ */
52
+ export interface FileStampRef {
53
+ current: FileStamp;
54
+ }
55
+ /** A stamp no real file can match, so the first load always reads the disk. */
56
+ export declare function createFileStampRef(): FileStampRef;
57
+ export declare function stampOf(stat: Stats): FileStamp;
58
+ /** The accounts file lives next to the DSH home the launcher exports. */
59
+ export declare function defaultAccountsFilePath(): string;
60
+ /**
61
+ * Read the accounts file, or create it on first run with a fresh token
62
+ * secret. The stamp ref is left pointing at the version just read.
63
+ */
64
+ export declare function loadAccountsFile(filePath: string, stamp: FileStampRef): AccountsFile;
65
+ /**
66
+ * Persist the accounts file atomically (temp file + rename) and leave the
67
+ * stamp ref pointing at the freshly written version.
68
+ */
69
+ export declare function persistAccountsFile(filePath: string, file: AccountsFile, stamp: FileStampRef): void;
70
+ /**
71
+ * The qa-accounts CLI runs in its own process against the same file. Re-read
72
+ * it whenever it changed on disk, before every read or read-modify-write:
73
+ * without this a running Host would keep honoring tokens the CLI revoked
74
+ * and its next save would resurrect the CLI's change from a stale snapshot.
75
+ * One file, one writer at a time remains the deployment's discipline; LAN
76
+ * scale keeps the stat per operation trivial.
77
+ *
78
+ * Returns the freshly loaded file, or undefined when the caller should keep
79
+ * serving its in-memory state.
80
+ */
81
+ export declare function reloadAccountsFileIfChanged(filePath: string, stamp: FileStampRef): AccountsFile | undefined;
82
+ //# sourceMappingURL=file.d.ts.map
@@ -1,46 +1,30 @@
1
- import type { QaAccountRole, QaAccountSession, QaAccountUserPublic, QaClaimResult, QaOwnershipEntry, QaWhoamiResult } from "../types.js";
2
- /**
3
- * Coarse, wire-safe account failure codes. They ride the `(reason: <code>)`
4
- * marker pattern the attestation path established; the browser maps them to
5
- * audience-safe copy and the precise cause stays in the Host logs.
6
- */
7
- export type QaAccountsErrorReason = "auth-required" | "admin-required" | "invalid-credentials" | "account-disabled" | "email-taken" | "invalid-email" | "invalid-display-name" | "invalid-role" | "weak-password" | "registration-disabled" | "rate-limited" | "session-owned-elsewhere";
8
- export declare class QaAccountsError extends Error {
9
- readonly reason: QaAccountsErrorReason;
10
- constructor(reason: QaAccountsErrorReason, message: string);
11
- }
12
- interface StoredUser {
13
- readonly id: string;
14
- readonly email: string;
15
- readonly displayName: string;
16
- readonly role: QaAccountRole;
17
- /** scrypt material: hex salt + hex hash. */
18
- readonly passwordHash: {
19
- readonly salt: string;
20
- readonly hash: string;
21
- };
22
- readonly createdAt: string;
23
- lastLoginAt: string | null;
24
- /** Disabled accounts are refused at login and lose their live tokens. */
25
- disabled?: boolean;
26
- /**
27
- * Bumped to invalidate every token ever issued to the account: the value
28
- * rides the token payload and must match at verification time.
29
- */
30
- tokenVersion?: number;
31
- }
1
+ import type { QaAccountIdentityField, QaAccountProfile, QaAccountProfileInput, QaAccountRole, QaAccountSession, QaAccountUserPublic, QaClaimResult, QaOwnershipEntry, QaWhoamiResult } from "../types.js";
2
+ import type { StoredUser } from "./file.js";
3
+ export { QaAccountsError } from "./errors.js";
4
+ export type { QaAccountsErrorReason } from "./errors.js";
5
+ export { defaultAccountsFilePath } from "./file.js";
32
6
  export interface QaAccountsOptions {
33
7
  readonly sessionTtlDays: number;
34
8
  readonly allowRegistration: boolean;
35
9
  /** Login/registration attempts accepted per rolling minute, store-wide. */
36
10
  readonly maxAuthAttemptsPerMinute?: number;
11
+ /** Character cap on a stored profile's agent guidance. */
12
+ readonly instructionsMaxLength?: number;
13
+ /**
14
+ * Fields the deployment declares. Self-service writes may name only these;
15
+ * omitting the list (the operator CLI) checks the key shape alone.
16
+ */
17
+ readonly identityFields?: readonly QaAccountIdentityField[];
37
18
  }
38
- /** The accounts file lives next to the DSH home the launcher exports. */
39
- export declare function defaultAccountsFilePath(): string;
40
19
  /**
41
20
  * Host authority for QA accounts: the file-backed user list, the session
42
21
  * ownership map and the HMAC account tokens. All mutations are synchronous
43
22
  * and persisted atomically (temp file + rename); LAN scale keeps this trivial.
23
+ *
24
+ * The class is the facade: token mechanics live in token.ts, the file format
25
+ * and its atomic persistence plus the external-change probe in file.ts, and
26
+ * the credential rules shared by registration and the operator CLI in
27
+ * credentials.ts.
44
28
  */
45
29
  export declare class QaAccounts {
46
30
  readonly filePath: string;
@@ -49,20 +33,19 @@ export declare class QaAccounts {
49
33
  private readonly maxAuthAttemptsPerMinute;
50
34
  private readonly sessionTtlDays;
51
35
  private readonly allowRegistration;
36
+ /** Character cap on a stored profile's agent guidance. */
37
+ private readonly instructionsMaxLength;
38
+ /** Declared handle fields; undefined lets an operator write any shape-valid key. */
39
+ private readonly identityFields;
52
40
  /** mtime+size of the file as of the last load; the external-change probe. */
53
- private lastLoadStamp;
41
+ private readonly fileStamp;
54
42
  constructor(filePath: string | undefined, options: QaAccountsOptions);
55
43
  /**
56
- * The qa-accounts CLI runs in its own process against the same file. Re-read
57
- * it whenever it changed on disk, before every read or read-modify-write:
58
- * without this a running Host would keep honoring tokens the CLI revoked
59
- * and its next save would resurrect the CLI's change from a stale snapshot.
60
- * One file, one writer at a time remains the deployment's discipline; LAN
61
- * scale keeps the stat per operation trivial.
44
+ * Re-read the accounts file when it changed on disk, before every read or
45
+ * read-modify-write. The probe itself and its cross-process rationale live
46
+ * with the file layer (reloadAccountsFileIfChanged).
62
47
  */
63
48
  private reloadIfChanged;
64
- private load;
65
- private persist;
66
49
  private save;
67
50
  private pruneAuthAttempts;
68
51
  private assertAuthBudget;
@@ -81,6 +64,14 @@ export declare class QaAccounts {
81
64
  * foreign sessions unless the caller administers the deployment.
82
65
  */
83
66
  ensureSessionAccess(token: string, sessionId: string): QaAccountUserPublic;
67
+ /**
68
+ * Atomically reserve a Host-generated session id for the token user before
69
+ * the Session exists. Browser callers therefore never get a race window in
70
+ * which they can claim another user's newly created chat.
71
+ */
72
+ reserveSession(token: string, sessionId: string): QaAccountUserPublic;
73
+ /** Roll back a reservation if Host creation failed before a chat existed. */
74
+ releaseSessionReservation(userId: string, sessionId: string): void;
84
75
  /** Bulk-claim a browser's local chat index; foreign ids come back as conflicts. */
85
76
  claimSessions(token: string, sessionIds: readonly string[]): QaClaimResult;
86
77
  /** Session ids owned by the token's user, most recently claimed first. */
@@ -116,6 +107,38 @@ export declare class QaAccounts {
116
107
  setUserDisabled(email: string, disabled: boolean): QaAccountUserPublic;
117
108
  /** Invalidate every token of the account (password-leak response). */
118
109
  revokeTokens(email: string): QaAccountUserPublic;
110
+ /**
111
+ * The account that owns one session, or undefined while nobody claimed it.
112
+ * The prompt renderer resolves a chat's owner through this map, so a session
113
+ * that predates accounts simply carries no identity.
114
+ */
115
+ ownerIdOf(sessionId: string): string | undefined;
116
+ /**
117
+ * Email plus profile of one account, for the prompt renderer. A disabled
118
+ * account resolves to nothing: its identity leaves the prompt together with
119
+ * its access, so a revoked user is no longer addressed by name.
120
+ */
121
+ identityOf(userId: string): {
122
+ readonly email: string;
123
+ readonly profile: QaAccountProfile;
124
+ } | undefined;
125
+ /** One account in its public shape; undefined when the address is unknown. */
126
+ findUser(email: string): QaAccountUserPublic | undefined;
127
+ /**
128
+ * Operator write: replace one account's profile, addressed by email. The
129
+ * CLI merges field-level flags into a full profile before calling this.
130
+ */
131
+ setProfile(email: string, input: QaAccountProfileInput): QaAccountUserPublic;
132
+ /**
133
+ * Self-service write for the token's own account. The token is verified
134
+ * first, so a browser can only ever edit the profile it is signed in as.
135
+ */
136
+ updateOwnProfile(token: string, input: QaAccountProfileInput): QaAccountUserPublic;
137
+ /**
138
+ * Validate one profile write and stamp it onto the account. Throws before
139
+ * anything is mutated, so a rejected write leaves the stored profile, and
140
+ * the address it is keyed to, exactly as they were.
141
+ */
142
+ private stampedProfile;
119
143
  }
120
- export {};
121
144
  //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1,31 @@
1
+ /** The account facts token verification needs: identity plus token version. */
2
+ interface TokenUser {
3
+ readonly id: string;
4
+ readonly tokenVersion?: number;
5
+ }
6
+ /** The claims carried by a v1 account token payload. */
7
+ export interface TokenPayload {
8
+ readonly uid: string;
9
+ /** Expiry, epoch milliseconds. */
10
+ readonly exp: number;
11
+ /** The account's token version at mint time. */
12
+ readonly ver: number;
13
+ }
14
+ export declare function base64Url(value: Buffer | string): string;
15
+ /**
16
+ * Mint a v1 account token: a base64url JSON payload plus an HMAC-SHA256
17
+ * signature keyed with the accounts file secret.
18
+ */
19
+ export declare function mintToken(secret: string, payload: TokenPayload): string;
20
+ /**
21
+ * Verify a v1 account token against the current secret and account list and
22
+ * return its user id, or null for anything malformed, foreign-signed,
23
+ * expired or superseded. Signature computation, the length check and the
24
+ * payload decode share one try, so a hostile token can only ever resolve to
25
+ * null; the comparison is timing-safe (equal length first, then
26
+ * timingSafeEqual) so a signature guess cannot be accelerated by measuring
27
+ * HMAC rejection time.
28
+ */
29
+ export declare function verifyToken(secret: string, token: string, users: readonly TokenUser[]): string | null;
30
+ export {};
31
+ //# sourceMappingURL=token.d.ts.map
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Attachment vocabulary shared by the Host configuration and the browser
3
+ * composer. The module stays free of Node and DOM imports: the client bundle
4
+ * imports it directly, and the Host resolver uses it to normalize the
5
+ * operator's configuration.
6
+ */
7
+ /**
8
+ * Text-file extensions the composer accepts out of the box. Compared
9
+ * lowercase and without the leading dot; an entry is a suffix, not a glob.
10
+ */
11
+ export declare const DEFAULT_QA_TEXT_EXTENSIONS: readonly string[];
12
+ /** Bounds the resolver and the settings card agree on. */
13
+ export declare const QA_PASTED_TEXT_LINES_MIN = 0;
14
+ export declare const QA_PASTED_TEXT_LINES_MAX = 10000;
15
+ export declare const QA_MAX_FILE_BYTES_MIN = 1024;
16
+ export declare const QA_MAX_FILE_BYTES_MAX = 52428800;
17
+ export declare const QA_MAX_PENDING_MIN = 1;
18
+ export declare const QA_MAX_PENDING_MAX = 40;
19
+ /**
20
+ * Normalize an operator-authored extension list: lowercase, leading dots
21
+ * stripped, malformed entries and duplicates dropped, order preserved.
22
+ * An empty result means no extension is accepted by name — the composer then
23
+ * still accepts whatever the browser reports as `text/*`.
24
+ * @param values - raw extension tokens from configuration.
25
+ * @returns the normalized token list.
26
+ */
27
+ export declare function normalizeTextExtensions(values: readonly string[]): readonly string[];
28
+ /**
29
+ * Whether one file name carries an accepted text extension. The comparison is
30
+ * case-insensitive; a name without a dot, or with a hidden-file dot only
31
+ * (`.gitignore`), is matched against the whole leaf.
32
+ * @param name - display file name.
33
+ * @param extensions - normalized accepted extensions.
34
+ * @returns whether the name matches one accepted extension.
35
+ */
36
+ export declare function hasTextExtension(name: string, extensions: readonly string[]): boolean;
37
+ /**
38
+ * Count the lines of a pasted blob the way a reader counts them: a single
39
+ * trailing newline does not open a new line, and CRLF counts once.
40
+ * @param text - pasted plain text.
41
+ * @returns the line count, at least 1 for any non-empty text.
42
+ */
43
+ export declare function countTextLines(text: string): number;
44
+ //# sourceMappingURL=attachment-rules.d.ts.map
@@ -4,6 +4,6 @@ export interface CliIo {
4
4
  err(line: string): void;
5
5
  }
6
6
  /** Execute one management command; returns the process exit code. */
7
- export declare function run(argv: readonly string[], io: CliIo, readPassword?: () => string): number;
8
- export declare function main(argv: readonly string[], io?: CliIo, readPassword?: () => string): number;
7
+ export declare function run(argv: readonly string[], io: CliIo, readStdin?: () => string): number;
8
+ export declare function main(argv: readonly string[], io?: CliIo, readStdin?: () => string): number;
9
9
  //# sourceMappingURL=cli.d.ts.map