@things-factory/ai-assistant 10.1.278 → 10.1.280

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 (531) hide show
  1. package/dist-client/bootstrap.d.ts +4 -4
  2. package/dist-client/bootstrap.js +4 -8
  3. package/dist-client/components/ai-model-price-table.d.ts +32 -0
  4. package/dist-client/components/ai-model-price-table.js +311 -0
  5. package/dist-client/components/ai-usage-table.d.ts +17 -0
  6. package/dist-client/components/ai-usage-table.js +151 -0
  7. package/dist-client/index.d.ts +1 -0
  8. package/dist-client/index.js +2 -0
  9. package/dist-client/pages/ai-model-price-page.d.ts +37 -0
  10. package/dist-client/pages/ai-model-price-page.js +312 -0
  11. package/dist-client/route.d.ts +1 -1
  12. package/dist-client/route.js +4 -0
  13. package/dist-client/settings/ai-agent-setting-let.js +11 -0
  14. package/dist-client/utils/model-price-model.d.ts +31 -0
  15. package/dist-client/utils/model-price-model.js +30 -0
  16. package/dist-client/utils/usage-charts.d.ts +21 -0
  17. package/dist-client/utils/usage-charts.js +45 -0
  18. package/dist-client/utils/usage-model.d.ts +44 -0
  19. package/dist-client/utils/usage-model.js +44 -0
  20. package/dist-server/service/ai-agent-resolver.d.ts +46 -0
  21. package/dist-server/service/ai-agent-resolver.js +252 -0
  22. package/package.json +25 -10
  23. package/things-factory.config.js +4 -1
  24. package/translations/en.json +46 -4
  25. package/translations/es.json +43 -1
  26. package/translations/ja.json +43 -1
  27. package/translations/ko.json +46 -4
  28. package/translations/ms.json +43 -1
  29. package/translations/zh.json +43 -1
  30. package/client/bootstrap.ts +0 -27
  31. package/client/components/assistant-chat.test.ts +0 -149
  32. package/client/components/assistant-chat.ts +0 -5599
  33. package/client/components/assistant-dock.ts +0 -1036
  34. package/client/components/assistant-invite.ts +0 -138
  35. package/client/components/assistant-mode.test.ts +0 -119
  36. package/client/components/assistant-mode.ts +0 -174
  37. package/client/components/assistant-selection-bar.test.ts +0 -167
  38. package/client/components/assistant-selection-bar.ts +0 -178
  39. package/client/components/assistant-session-manager.ts +0 -915
  40. package/client/components/assistant-session-toolbar.ts +0 -80
  41. package/client/components/chat-defaults.ts +0 -64
  42. package/client/components/chat-echo-dedup.test.ts +0 -253
  43. package/client/components/chat-echo-dedup.ts +0 -190
  44. package/client/components/chat-input-builder.test.ts +0 -86
  45. package/client/components/chat-input-builder.ts +0 -133
  46. package/client/components/chat-proposal-survival.test.ts +0 -73
  47. package/client/components/entry-review.ts +0 -346
  48. package/client/components/markdown.test.ts +0 -518
  49. package/client/components/markdown.ts +0 -508
  50. package/client/components/mention-popup-helpers.ts +0 -433
  51. package/client/components/mention-popup.test.ts +0 -588
  52. package/client/components/mention-popup.ts +0 -261
  53. package/client/components/panel-aria.test.ts +0 -59
  54. package/client/components/proposal-outcome-line.ts +0 -74
  55. package/client/components/proposal-request.test.ts +0 -73
  56. package/client/components/reply-message.test.ts +0 -15
  57. package/client/components/reply-message.ts +0 -11
  58. package/client/components/roster-identity.test.ts +0 -8
  59. package/client/components/roster-identity.ts +0 -4
  60. package/client/components/workspace-view.ts +0 -486
  61. package/client/index.ts +0 -36
  62. package/client/pages/assistant-workspace-page.ts +0 -317
  63. package/client/route.ts +0 -9
  64. package/client/settings/agent-settings-model.ts +0 -164
  65. package/client/settings/ai-agent-setting-let.ts +0 -667
  66. package/client/settings/ai-usage-setting-let.ts +0 -240
  67. package/client/settings/usage-model.ts +0 -46
  68. package/client/setup-assistant-dock.ts +0 -177
  69. package/client/tsconfig.json +0 -13
  70. package/client/utils/addressed-draft.test.ts +0 -31
  71. package/client/utils/agent-choice.ts +0 -56
  72. package/client/utils/applied-screens.ts +0 -36
  73. package/client/utils/assistant-activity.ts +0 -122
  74. package/client/utils/assistant-ask.test.ts +0 -38
  75. package/client/utils/assistant-ask.ts +0 -93
  76. package/client/utils/assistant-capability-read.ts +0 -24
  77. package/client/utils/assistant-capability.test.ts +0 -17
  78. package/client/utils/assistant-capability.ts +0 -19
  79. package/client/utils/assistant-navigation.test.ts +0 -66
  80. package/client/utils/assistant-navigation.ts +0 -11
  81. package/client/utils/assistant-proposals.ts +0 -85
  82. package/client/utils/assistant-request-context.ts +0 -63
  83. package/client/utils/assistant-selection.test.ts +0 -54
  84. package/client/utils/assistant-selection.ts +0 -75
  85. package/client/utils/assistant-session-actions.ts +0 -32
  86. package/client/utils/assistant-session-admin.ts +0 -239
  87. package/client/utils/assistant-session-controller.test.ts +0 -75
  88. package/client/utils/assistant-session-controller.ts +0 -208
  89. package/client/utils/assistant-session-transport.ts +0 -46
  90. package/client/utils/assistant-surface.ts +0 -178
  91. package/client/utils/assistant-typing.test.ts +0 -33
  92. package/client/utils/assistant-typing.ts +0 -53
  93. package/client/utils/attachment-policy.ts +0 -106
  94. package/client/utils/composer-frame.ts +0 -77
  95. package/client/utils/document-text.ts +0 -332
  96. package/client/utils/entry-hash.ts +0 -35
  97. package/client/utils/entry-proposal.ts +0 -215
  98. package/client/utils/entry-workspace.ts +0 -70
  99. package/client/utils/invite-proposal-register.ts +0 -31
  100. package/client/utils/invite-proposal.test.ts +0 -40
  101. package/client/utils/invite-proposal.ts +0 -54
  102. package/client/utils/menu-room.ts +0 -33
  103. package/client/utils/open-page.ts +0 -21
  104. package/client/utils/pasted-table.ts +0 -145
  105. package/client/utils/pdf-pages.ts +0 -25
  106. package/client/utils/spreadsheet-text.ts +0 -125
  107. package/client/utils/workspace.ts +0 -89
  108. package/dist-client/bootstrap.js.map +0 -1
  109. package/dist-client/components/assistant-chat.js.map +0 -1
  110. package/dist-client/components/assistant-chat.test.d.ts +0 -1
  111. package/dist-client/components/assistant-chat.test.js +0 -138
  112. package/dist-client/components/assistant-chat.test.js.map +0 -1
  113. package/dist-client/components/assistant-dock.js.map +0 -1
  114. package/dist-client/components/assistant-invite.js.map +0 -1
  115. package/dist-client/components/assistant-mode.js.map +0 -1
  116. package/dist-client/components/assistant-mode.test.d.ts +0 -1
  117. package/dist-client/components/assistant-mode.test.js +0 -100
  118. package/dist-client/components/assistant-mode.test.js.map +0 -1
  119. package/dist-client/components/assistant-selection-bar.js.map +0 -1
  120. package/dist-client/components/assistant-selection-bar.test.d.ts +0 -1
  121. package/dist-client/components/assistant-selection-bar.test.js +0 -148
  122. package/dist-client/components/assistant-selection-bar.test.js.map +0 -1
  123. package/dist-client/components/assistant-session-manager.js.map +0 -1
  124. package/dist-client/components/assistant-session-toolbar.js.map +0 -1
  125. package/dist-client/components/chat-defaults.js.map +0 -1
  126. package/dist-client/components/chat-echo-dedup.js.map +0 -1
  127. package/dist-client/components/chat-echo-dedup.test.d.ts +0 -1
  128. package/dist-client/components/chat-echo-dedup.test.js +0 -223
  129. package/dist-client/components/chat-echo-dedup.test.js.map +0 -1
  130. package/dist-client/components/chat-input-builder.js.map +0 -1
  131. package/dist-client/components/chat-input-builder.test.d.ts +0 -1
  132. package/dist-client/components/chat-input-builder.test.js +0 -70
  133. package/dist-client/components/chat-input-builder.test.js.map +0 -1
  134. package/dist-client/components/chat-proposal-survival.test.d.ts +0 -1
  135. package/dist-client/components/chat-proposal-survival.test.js +0 -61
  136. package/dist-client/components/chat-proposal-survival.test.js.map +0 -1
  137. package/dist-client/components/entry-review.js.map +0 -1
  138. package/dist-client/components/markdown.js.map +0 -1
  139. package/dist-client/components/markdown.test.d.ts +0 -1
  140. package/dist-client/components/markdown.test.js +0 -418
  141. package/dist-client/components/markdown.test.js.map +0 -1
  142. package/dist-client/components/mention-popup-helpers.js.map +0 -1
  143. package/dist-client/components/mention-popup.js.map +0 -1
  144. package/dist-client/components/mention-popup.test.d.ts +0 -1
  145. package/dist-client/components/mention-popup.test.js +0 -474
  146. package/dist-client/components/mention-popup.test.js.map +0 -1
  147. package/dist-client/components/panel-aria.test.d.ts +0 -1
  148. package/dist-client/components/panel-aria.test.js +0 -53
  149. package/dist-client/components/panel-aria.test.js.map +0 -1
  150. package/dist-client/components/proposal-outcome-line.js.map +0 -1
  151. package/dist-client/components/proposal-request.test.d.ts +0 -1
  152. package/dist-client/components/proposal-request.test.js +0 -63
  153. package/dist-client/components/proposal-request.test.js.map +0 -1
  154. package/dist-client/components/reply-message.js.map +0 -1
  155. package/dist-client/components/reply-message.test.d.ts +0 -1
  156. package/dist-client/components/reply-message.test.js +0 -16
  157. package/dist-client/components/reply-message.test.js.map +0 -1
  158. package/dist-client/components/roster-identity.js.map +0 -1
  159. package/dist-client/components/roster-identity.test.d.ts +0 -1
  160. package/dist-client/components/roster-identity.test.js +0 -9
  161. package/dist-client/components/roster-identity.test.js.map +0 -1
  162. package/dist-client/components/workspace-view.js.map +0 -1
  163. package/dist-client/index.js.map +0 -1
  164. package/dist-client/pages/assistant-workspace-page.js.map +0 -1
  165. package/dist-client/route.js.map +0 -1
  166. package/dist-client/settings/agent-settings-model.js.map +0 -1
  167. package/dist-client/settings/ai-agent-setting-let.js.map +0 -1
  168. package/dist-client/settings/ai-usage-setting-let.d.ts +0 -25
  169. package/dist-client/settings/ai-usage-setting-let.js +0 -258
  170. package/dist-client/settings/ai-usage-setting-let.js.map +0 -1
  171. package/dist-client/settings/usage-model.d.ts +0 -32
  172. package/dist-client/settings/usage-model.js +0 -25
  173. package/dist-client/settings/usage-model.js.map +0 -1
  174. package/dist-client/setup-assistant-dock.js.map +0 -1
  175. package/dist-client/tsconfig.tsbuildinfo +0 -1
  176. package/dist-client/utils/addressed-draft.test.d.ts +0 -1
  177. package/dist-client/utils/addressed-draft.test.js +0 -27
  178. package/dist-client/utils/addressed-draft.test.js.map +0 -1
  179. package/dist-client/utils/agent-choice.js.map +0 -1
  180. package/dist-client/utils/applied-screens.js.map +0 -1
  181. package/dist-client/utils/assistant-activity.js.map +0 -1
  182. package/dist-client/utils/assistant-ask.js.map +0 -1
  183. package/dist-client/utils/assistant-ask.test.d.ts +0 -1
  184. package/dist-client/utils/assistant-ask.test.js +0 -40
  185. package/dist-client/utils/assistant-ask.test.js.map +0 -1
  186. package/dist-client/utils/assistant-capability-read.js.map +0 -1
  187. package/dist-client/utils/assistant-capability.js.map +0 -1
  188. package/dist-client/utils/assistant-capability.test.d.ts +0 -1
  189. package/dist-client/utils/assistant-capability.test.js +0 -16
  190. package/dist-client/utils/assistant-capability.test.js.map +0 -1
  191. package/dist-client/utils/assistant-navigation.js.map +0 -1
  192. package/dist-client/utils/assistant-navigation.test.d.ts +0 -1
  193. package/dist-client/utils/assistant-navigation.test.js +0 -63
  194. package/dist-client/utils/assistant-navigation.test.js.map +0 -1
  195. package/dist-client/utils/assistant-proposals.js.map +0 -1
  196. package/dist-client/utils/assistant-request-context.js.map +0 -1
  197. package/dist-client/utils/assistant-selection.js.map +0 -1
  198. package/dist-client/utils/assistant-selection.test.d.ts +0 -1
  199. package/dist-client/utils/assistant-selection.test.js +0 -46
  200. package/dist-client/utils/assistant-selection.test.js.map +0 -1
  201. package/dist-client/utils/assistant-session-actions.js.map +0 -1
  202. package/dist-client/utils/assistant-session-admin.js.map +0 -1
  203. package/dist-client/utils/assistant-session-controller.js.map +0 -1
  204. package/dist-client/utils/assistant-session-controller.test.d.ts +0 -1
  205. package/dist-client/utils/assistant-session-controller.test.js +0 -56
  206. package/dist-client/utils/assistant-session-controller.test.js.map +0 -1
  207. package/dist-client/utils/assistant-session-transport.js.map +0 -1
  208. package/dist-client/utils/assistant-surface.js.map +0 -1
  209. package/dist-client/utils/assistant-typing.js.map +0 -1
  210. package/dist-client/utils/assistant-typing.test.d.ts +0 -1
  211. package/dist-client/utils/assistant-typing.test.js +0 -30
  212. package/dist-client/utils/assistant-typing.test.js.map +0 -1
  213. package/dist-client/utils/attachment-policy.js.map +0 -1
  214. package/dist-client/utils/composer-frame.js.map +0 -1
  215. package/dist-client/utils/document-text.js.map +0 -1
  216. package/dist-client/utils/entry-hash.js.map +0 -1
  217. package/dist-client/utils/entry-proposal.js.map +0 -1
  218. package/dist-client/utils/entry-workspace.js.map +0 -1
  219. package/dist-client/utils/invite-proposal-register.js.map +0 -1
  220. package/dist-client/utils/invite-proposal.js.map +0 -1
  221. package/dist-client/utils/invite-proposal.test.d.ts +0 -1
  222. package/dist-client/utils/invite-proposal.test.js +0 -35
  223. package/dist-client/utils/invite-proposal.test.js.map +0 -1
  224. package/dist-client/utils/menu-room.js.map +0 -1
  225. package/dist-client/utils/open-page.js.map +0 -1
  226. package/dist-client/utils/pasted-table.js.map +0 -1
  227. package/dist-client/utils/pdf-pages.js.map +0 -1
  228. package/dist-client/utils/spreadsheet-text.js.map +0 -1
  229. package/dist-client/utils/workspace.js.map +0 -1
  230. package/dist-server/door-declaration-report.js.map +0 -1
  231. package/dist-server/index.js.map +0 -1
  232. package/dist-server/role-tasks.js.map +0 -1
  233. package/dist-server/service/ai-agent-resolver.js.map +0 -1
  234. package/dist-server/service/assistant-capability-resolver.js.map +0 -1
  235. package/dist-server/service/assistant-chat-resolver.js.map +0 -1
  236. package/dist-server/service/assistant-mode/assistant-mode-resolver.js.map +0 -1
  237. package/dist-server/service/assistant-mode/fallback-subjects.js.map +0 -1
  238. package/dist-server/service/assistant-mode/index.js.map +0 -1
  239. package/dist-server/service/assistant-mode/mode-categories.js.map +0 -1
  240. package/dist-server/service/assistant-mode/record-subject.js.map +0 -1
  241. package/dist-server/service/assistant-mode/registry.js.map +0 -1
  242. package/dist-server/service/assistant-mode/resolve.js.map +0 -1
  243. package/dist-server/service/assistant-mode/screen-rules.js.map +0 -1
  244. package/dist-server/service/assistant-mode/turn-lines.js.map +0 -1
  245. package/dist-server/service/assistant-mode/types.js.map +0 -1
  246. package/dist-server/service/chat-message/carried-turns.js.map +0 -1
  247. package/dist-server/service/chat-message/chat-message-broadcast.js.map +0 -1
  248. package/dist-server/service/chat-message/chat-message-publish.js.map +0 -1
  249. package/dist-server/service/chat-message/chat-message-room.js.map +0 -1
  250. package/dist-server/service/chat-message/chat-message-subscription.js.map +0 -1
  251. package/dist-server/service/chat-message/chat-message.js.map +0 -1
  252. package/dist-server/service/chat-message/chat-typing-subscription.js.map +0 -1
  253. package/dist-server/service/chat-message/chat-typing.js.map +0 -1
  254. package/dist-server/service/chat-message/door-access.js.map +0 -1
  255. package/dist-server/service/chat-message/fold-history.js.map +0 -1
  256. package/dist-server/service/chat-message/fold-session-history.js.map +0 -1
  257. package/dist-server/service/chat-message/history-summary.js.map +0 -1
  258. package/dist-server/service/chat-message/index.js.map +0 -1
  259. package/dist-server/service/chat-message/llm-history.js.map +0 -1
  260. package/dist-server/service/chat-message/message-doors.js.map +0 -1
  261. package/dist-server/service/chat-message/proposal-outcome.js.map +0 -1
  262. package/dist-server/service/chat-message/reader-gate.js.map +0 -1
  263. package/dist-server/service/chat-message/room-message.js.map +0 -1
  264. package/dist-server/service/chat-message/room-turn.js.map +0 -1
  265. package/dist-server/service/chat-message/used-tools.js.map +0 -1
  266. package/dist-server/service/chat-session/attachment-policy.js.map +0 -1
  267. package/dist-server/service/chat-session/attachment-route.js.map +0 -1
  268. package/dist-server/service/chat-session/attachment-tool-result.js.map +0 -1
  269. package/dist-server/service/chat-session/attachment-tools.js.map +0 -1
  270. package/dist-server/service/chat-session/chat-session.js.map +0 -1
  271. package/dist-server/service/chat-session/index.js.map +0 -1
  272. package/dist-server/service/chat-session/session-activity-broadcast.js.map +0 -1
  273. package/dist-server/service/chat-session/session-activity-publish.js.map +0 -1
  274. package/dist-server/service/chat-session/session-activity-subscription.js.map +0 -1
  275. package/dist-server/service/chat-session/session-anchor.js.map +0 -1
  276. package/dist-server/service/chat-session/session-attachments.js.map +0 -1
  277. package/dist-server/service/chat-session/session-cleanup.js.map +0 -1
  278. package/dist-server/service/chat-session/session-inbox.js.map +0 -1
  279. package/dist-server/service/chat-session/session-kind.js.map +0 -1
  280. package/dist-server/service/chat-session/session-name.js.map +0 -1
  281. package/dist-server/service/chat-session/session-purge.js.map +0 -1
  282. package/dist-server/service/chat-session/session-retention.js.map +0 -1
  283. package/dist-server/service/chat-session/session-visibility.js.map +0 -1
  284. package/dist-server/service/chat-session/session-write-gate.js.map +0 -1
  285. package/dist-server/service/chat-session/station-session-guard.js.map +0 -1
  286. package/dist-server/service/chat-session/turn-attachments.js.map +0 -1
  287. package/dist-server/service/chat-session-participant/chat-session-participant.js.map +0 -1
  288. package/dist-server/service/chat-session-participant/index.js.map +0 -1
  289. package/dist-server/service/chat-session-participant/invite-notification.js.map +0 -1
  290. package/dist-server/service/chat-session-participant/mention-invite.js.map +0 -1
  291. package/dist-server/service/chat-session-participant/participant-lookup-roles.js.map +0 -1
  292. package/dist-server/service/chat-session-participant/participant-lookup.js.map +0 -1
  293. package/dist-server/service/chat-session-participant/presence.js.map +0 -1
  294. package/dist-server/service/chat-session-participant/read-roster.js.map +0 -1
  295. package/dist-server/service/chat-session-resolver.js.map +0 -1
  296. package/dist-server/service/data-entry/entry-apply.js.map +0 -1
  297. package/dist-server/service/data-entry/entry-hash.js.map +0 -1
  298. package/dist-server/service/data-entry/entry-refusal.js.map +0 -1
  299. package/dist-server/service/data-entry/entry-resolver.js.map +0 -1
  300. package/dist-server/service/data-entry/entry-screen.js.map +0 -1
  301. package/dist-server/service/data-entry/entry-sources.js.map +0 -1
  302. package/dist-server/service/data-entry/entry-target.js.map +0 -1
  303. package/dist-server/service/data-entry/entry-tools.js.map +0 -1
  304. package/dist-server/service/data-entry/entry-update.js.map +0 -1
  305. package/dist-server/service/data-read/list-read.js.map +0 -1
  306. package/dist-server/service/data-read/read-target.js.map +0 -1
  307. package/dist-server/service/data-read/read-tools.js.map +0 -1
  308. package/dist-server/service/grounding-sources.js.map +0 -1
  309. package/dist-server/service/help-documents/help-keys.js.map +0 -1
  310. package/dist-server/service/help-documents/help-tools.js.map +0 -1
  311. package/dist-server/service/index.js.map +0 -1
  312. package/dist-server/service/people/index.js.map +0 -1
  313. package/dist-server/service/people/invite-tools.js.map +0 -1
  314. package/dist-server/service/people/people-keys.js.map +0 -1
  315. package/dist-server/service/people/people-read.js.map +0 -1
  316. package/dist-server/service/people/person-subject.js.map +0 -1
  317. package/dist-server/service/request-translator.js.map +0 -1
  318. package/dist-server/service/testing/conversation-script.js.map +0 -1
  319. package/dist-server/service/testing/mode-conformance.js.map +0 -1
  320. package/dist-server/service/tool-access.js.map +0 -1
  321. package/dist-server/service/types.js.map +0 -1
  322. package/dist-server/service/unattended-run/assistant-run.js.map +0 -1
  323. package/dist-server/service/unattended-run/index.js.map +0 -1
  324. package/dist-server/service/unattended-run/limits.js.map +0 -1
  325. package/dist-server/service/unattended-run/run-as.js.map +0 -1
  326. package/dist-server/service/unattended-run/run-budget.js.map +0 -1
  327. package/dist-server/service/unattended-run/run-ledger.js.map +0 -1
  328. package/dist-server/service/unattended-run/run-outcome.js.map +0 -1
  329. package/dist-server/service/unattended-run/run-store.js.map +0 -1
  330. package/dist-server/service/unattended-run/run-unattended.js.map +0 -1
  331. package/dist-server/service/unattended-run/unattended-prompt.js.map +0 -1
  332. package/dist-server/service/workspace/workspace-blocks.js.map +0 -1
  333. package/dist-server/service/workspace/workspace-tools.js.map +0 -1
  334. package/dist-server/tool-registry-boot-report.js.map +0 -1
  335. package/dist-server/tsconfig.tsbuildinfo +0 -1
  336. package/docs/session-controller.md +0 -52
  337. package/server/door-declaration-report.test.ts +0 -53
  338. package/server/door-declaration-report.ts +0 -61
  339. package/server/explicit-graphql-types.test.ts +0 -56
  340. package/server/index.ts +0 -36
  341. package/server/role-tasks.ts +0 -14
  342. package/server/service/ai-agent-resolver.ts +0 -330
  343. package/server/service/assistant-capability-resolver.ts +0 -66
  344. package/server/service/assistant-chat-resolver.ts +0 -640
  345. package/server/service/assistant-mode/assistant-mode-resolver.ts +0 -101
  346. package/server/service/assistant-mode/conversation-category.test.ts +0 -48
  347. package/server/service/assistant-mode/fallback-subjects.ts +0 -36
  348. package/server/service/assistant-mode/index.ts +0 -22
  349. package/server/service/assistant-mode/mode-categories.ts +0 -178
  350. package/server/service/assistant-mode/mode-front.test.ts +0 -183
  351. package/server/service/assistant-mode/one-conversation-per-subject.test.ts +0 -37
  352. package/server/service/assistant-mode/open-subject-door.test.ts +0 -52
  353. package/server/service/assistant-mode/record-subject.test.ts +0 -41
  354. package/server/service/assistant-mode/record-subject.ts +0 -44
  355. package/server/service/assistant-mode/registry.test.ts +0 -171
  356. package/server/service/assistant-mode/registry.ts +0 -139
  357. package/server/service/assistant-mode/resolve.test.ts +0 -129
  358. package/server/service/assistant-mode/resolve.ts +0 -113
  359. package/server/service/assistant-mode/screen-rules.test.ts +0 -99
  360. package/server/service/assistant-mode/screen-rules.ts +0 -103
  361. package/server/service/assistant-mode/turn-lines.ts +0 -43
  362. package/server/service/assistant-mode/types.ts +0 -138
  363. package/server/service/chat-message/carried-turns.test.ts +0 -80
  364. package/server/service/chat-message/carried-turns.ts +0 -112
  365. package/server/service/chat-message/chat-message-broadcast.integration.test.ts +0 -73
  366. package/server/service/chat-message/chat-message-broadcast.test.ts +0 -40
  367. package/server/service/chat-message/chat-message-broadcast.ts +0 -70
  368. package/server/service/chat-message/chat-message-publish.ts +0 -22
  369. package/server/service/chat-message/chat-message-room.test.ts +0 -145
  370. package/server/service/chat-message/chat-message-room.ts +0 -50
  371. package/server/service/chat-message/chat-message-subscription.ts +0 -77
  372. package/server/service/chat-message/chat-message.ts +0 -289
  373. package/server/service/chat-message/chat-typing-subscription.ts +0 -52
  374. package/server/service/chat-message/chat-typing.test.ts +0 -45
  375. package/server/service/chat-message/chat-typing.ts +0 -48
  376. package/server/service/chat-message/door-access.test.ts +0 -72
  377. package/server/service/chat-message/door-access.ts +0 -65
  378. package/server/service/chat-message/fold-history-window.test.ts +0 -184
  379. package/server/service/chat-message/fold-history.test.ts +0 -98
  380. package/server/service/chat-message/fold-history.ts +0 -77
  381. package/server/service/chat-message/fold-session-history.test.ts +0 -116
  382. package/server/service/chat-message/fold-session-history.ts +0 -115
  383. package/server/service/chat-message/history-summary.test.ts +0 -127
  384. package/server/service/chat-message/history-summary.ts +0 -100
  385. package/server/service/chat-message/index.ts +0 -13
  386. package/server/service/chat-message/llm-history.test.ts +0 -245
  387. package/server/service/chat-message/llm-history.ts +0 -182
  388. package/server/service/chat-message/message-doors.test.ts +0 -124
  389. package/server/service/chat-message/message-doors.ts +0 -132
  390. package/server/service/chat-message/proposal-outcome.test.ts +0 -111
  391. package/server/service/chat-message/proposal-outcome.ts +0 -99
  392. package/server/service/chat-message/reader-gate.ts +0 -44
  393. package/server/service/chat-message/room-message.test.ts +0 -21
  394. package/server/service/chat-message/room-message.ts +0 -22
  395. package/server/service/chat-message/room-turn.ts +0 -42
  396. package/server/service/chat-message/used-tools.test.ts +0 -19
  397. package/server/service/chat-message/used-tools.ts +0 -25
  398. package/server/service/chat-session/attachment-policy.test.ts +0 -42
  399. package/server/service/chat-session/attachment-policy.ts +0 -91
  400. package/server/service/chat-session/attachment-route.ts +0 -45
  401. package/server/service/chat-session/attachment-tool-result.test.ts +0 -63
  402. package/server/service/chat-session/attachment-tool-result.ts +0 -37
  403. package/server/service/chat-session/attachment-tools.ts +0 -66
  404. package/server/service/chat-session/chat-session.ts +0 -244
  405. package/server/service/chat-session/group-room.test.ts +0 -233
  406. package/server/service/chat-session/index.ts +0 -5
  407. package/server/service/chat-session/session-activity-broadcast.ts +0 -77
  408. package/server/service/chat-session/session-activity-publish.ts +0 -49
  409. package/server/service/chat-session/session-activity-receivers.test.ts +0 -26
  410. package/server/service/chat-session/session-activity-subscription.ts +0 -66
  411. package/server/service/chat-session/session-anchor.ts +0 -142
  412. package/server/service/chat-session/session-attachments.ts +0 -90
  413. package/server/service/chat-session/session-cleanup.test.ts +0 -83
  414. package/server/service/chat-session/session-cleanup.ts +0 -69
  415. package/server/service/chat-session/session-inbox.test.ts +0 -273
  416. package/server/service/chat-session/session-inbox.ts +0 -240
  417. package/server/service/chat-session/session-kind.test.ts +0 -24
  418. package/server/service/chat-session/session-kind.ts +0 -32
  419. package/server/service/chat-session/session-name.ts +0 -32
  420. package/server/service/chat-session/session-purge.test.ts +0 -24
  421. package/server/service/chat-session/session-purge.ts +0 -117
  422. package/server/service/chat-session/session-retention.ts +0 -17
  423. package/server/service/chat-session/session-visibility.test.ts +0 -130
  424. package/server/service/chat-session/session-visibility.ts +0 -68
  425. package/server/service/chat-session/session-write-gate.test.ts +0 -59
  426. package/server/service/chat-session/session-write-gate.ts +0 -31
  427. package/server/service/chat-session/station-session-guard.ts +0 -25
  428. package/server/service/chat-session/turn-attachments.test.ts +0 -106
  429. package/server/service/chat-session/turn-attachments.ts +0 -45
  430. package/server/service/chat-session-participant/chat-session-participant.ts +0 -135
  431. package/server/service/chat-session-participant/index.ts +0 -8
  432. package/server/service/chat-session-participant/invite-notification.test.ts +0 -80
  433. package/server/service/chat-session-participant/invite-notification.ts +0 -118
  434. package/server/service/chat-session-participant/mention-invite.test.ts +0 -173
  435. package/server/service/chat-session-participant/mention-invite.ts +0 -180
  436. package/server/service/chat-session-participant/participant-lookup-roles.ts +0 -6
  437. package/server/service/chat-session-participant/participant-lookup.ts +0 -22
  438. package/server/service/chat-session-participant/presence.test.ts +0 -39
  439. package/server/service/chat-session-participant/presence.ts +0 -21
  440. package/server/service/chat-session-participant/read-roster.test.ts +0 -27
  441. package/server/service/chat-session-participant/read-roster.ts +0 -17
  442. package/server/service/chat-session-resolver.ts +0 -1455
  443. package/server/service/data-entry/data-entry-update.test.ts +0 -378
  444. package/server/service/data-entry/data-entry.test.ts +0 -494
  445. package/server/service/data-entry/entry-apply.ts +0 -247
  446. package/server/service/data-entry/entry-hash.ts +0 -35
  447. package/server/service/data-entry/entry-refusal.test.ts +0 -73
  448. package/server/service/data-entry/entry-refusal.ts +0 -20
  449. package/server/service/data-entry/entry-resolver.ts +0 -74
  450. package/server/service/data-entry/entry-screen.ts +0 -14
  451. package/server/service/data-entry/entry-sources.ts +0 -39
  452. package/server/service/data-entry/entry-target.ts +0 -774
  453. package/server/service/data-entry/entry-tools.ts +0 -282
  454. package/server/service/data-entry/entry-update.ts +0 -238
  455. package/server/service/data-read/data-read.test.ts +0 -395
  456. package/server/service/data-read/detail-lists.test.ts +0 -61
  457. package/server/service/data-read/list-missing.test.ts +0 -49
  458. package/server/service/data-read/list-read.ts +0 -146
  459. package/server/service/data-read/list-status.test.ts +0 -46
  460. package/server/service/data-read/read-target.ts +0 -509
  461. package/server/service/data-read/read-tools.ts +0 -334
  462. package/server/service/data-read/read-words.test.ts +0 -99
  463. package/server/service/data-read/record-keys.test.ts +0 -42
  464. package/server/service/grounding-sources.test.ts +0 -55
  465. package/server/service/grounding-sources.ts +0 -46
  466. package/server/service/help-documents/help-keys.ts +0 -2
  467. package/server/service/help-documents/help-tools.test.ts +0 -40
  468. package/server/service/help-documents/help-tools.ts +0 -88
  469. package/server/service/index.ts +0 -99
  470. package/server/service/people/index.ts +0 -15
  471. package/server/service/people/invite-tools.ts +0 -159
  472. package/server/service/people/invite.test.ts +0 -159
  473. package/server/service/people/people-keys.ts +0 -16
  474. package/server/service/people/people-read.test.ts +0 -82
  475. package/server/service/people/people-read.ts +0 -56
  476. package/server/service/people/person-subject.test.ts +0 -161
  477. package/server/service/people/person-subject.ts +0 -83
  478. package/server/service/request-translator.test.ts +0 -45
  479. package/server/service/request-translator.ts +0 -33
  480. package/server/service/session-anchor.test.ts +0 -198
  481. package/server/service/station-session-guard.test.ts +0 -31
  482. package/server/service/testing/conversation-scenario.test.ts +0 -164
  483. package/server/service/testing/conversation-script.test.ts +0 -133
  484. package/server/service/testing/conversation-script.ts +0 -296
  485. package/server/service/testing/mode-conformance.test.ts +0 -61
  486. package/server/service/testing/mode-conformance.ts +0 -165
  487. package/server/service/tool-access.test.ts +0 -96
  488. package/server/service/tool-access.ts +0 -36
  489. package/server/service/types.ts +0 -15
  490. package/server/service/unattended-run/assistant-run.ts +0 -199
  491. package/server/service/unattended-run/index.ts +0 -10
  492. package/server/service/unattended-run/limits.ts +0 -24
  493. package/server/service/unattended-run/run-as.ts +0 -38
  494. package/server/service/unattended-run/run-budget.ts +0 -58
  495. package/server/service/unattended-run/run-ledger.ts +0 -31
  496. package/server/service/unattended-run/run-outcome.ts +0 -43
  497. package/server/service/unattended-run/run-store-race.pg.test.ts +0 -83
  498. package/server/service/unattended-run/run-store.ts +0 -162
  499. package/server/service/unattended-run/run-unattended.test.ts +0 -478
  500. package/server/service/unattended-run/run-unattended.ts +0 -248
  501. package/server/service/unattended-run/unattended-prompt.ts +0 -24
  502. package/server/service/workspace/workspace-blocks.ts +0 -134
  503. package/server/service/workspace/workspace-tools.ts +0 -108
  504. package/server/service/workspace/workspace.test.ts +0 -74
  505. package/server/tool-registry-boot-report.test.ts +0 -41
  506. package/server/tool-registry-boot-report.ts +0 -63
  507. package/test/ai-agent-settings.test.ts +0 -123
  508. package/test/applied-screens.test.ts +0 -65
  509. package/test/assistant-chat-call-sites.test.ts +0 -92
  510. package/test/assistant-dock.test.ts +0 -294
  511. package/test/assistant-request-context.test.ts +0 -72
  512. package/test/assistant-session-controller.test.ts +0 -87
  513. package/test/assistant-session-manager.test.ts +0 -186
  514. package/test/assistant-session-toolbar.test.ts +0 -43
  515. package/test/attachment-one-rule.test.ts +0 -46
  516. package/test/attachment-policy-agree.test.ts +0 -38
  517. package/test/composer-frame.test.ts +0 -173
  518. package/test/document-text.test.ts +0 -175
  519. package/test/entry-card-styles.test.ts +0 -18
  520. package/test/entry-proposal.test.ts +0 -186
  521. package/test/entry-workspace.test.ts +0 -89
  522. package/test/menu-room.test.ts +0 -33
  523. package/test/open-doors.test.ts +0 -164
  524. package/test/open-page.test.ts +0 -31
  525. package/test/pasted-table.test.ts +0 -147
  526. package/test/refusals-in-korean.test.ts +0 -80
  527. package/test/session-discovery.test.ts +0 -43
  528. package/test/spreadsheet-text.test.ts +0 -92
  529. package/test/translations.test.ts +0 -80
  530. package/test/workspace.test.ts +0 -54
  531. package/tsconfig.json +0 -9
@@ -1,164 +0,0 @@
1
- /*
2
- * Which of ai-assistant's doors are open, and why each one is allowed to be.
3
- *
4
- * ── The thing this catches ──────────────────────────────────────────────────
5
- * `@privilege` is opt-in. A root field that declares nothing is recorded as open, and that is
6
- * indistinguishable from a field somebody decided to open. The list below turns the absence into a
7
- * statement: anything open that is not on it fails, and the reason has to be written first. Same
8
- * measure as `worklist/tests/open-doors.test.ts` and `headless-twin/test/open-doors.test.ts`.
9
- *
10
- * ── What the census found (2026-09-24) ──────────────────────────────────────
11
- * 27 root fields, 25 declare `ai-assistant:query` or `:mutation`. The two open ones are the
12
- * subscriptions — a stream has no `@privilege` to carry, so what keeps it inside the tenant is its
13
- * subscribe and its filter. Writing their reasons found one false: `chatMessageActivity` asked the
14
- * domain and the session but not the room, so a private conversation streamed to anyone in the
15
- * domain holding its id (ADR-0073 decision 2). Fixed in `8264dc46e7`; the reason below is true
16
- * from then on, and `chat-message-room.test.ts` keeps it true.
17
- *
18
- * ── Why the compiled output ──────────────────────────────────────────────────
19
- * type-graphql needs `emitDecoratorMetadata` to build the schema; jest's babel transform does not
20
- * emit it. So this reads `dist-server` — and a build older than its sources would miss a door added
21
- * since and pass, hence the freshness check before anything else.
22
- */
23
- import { existsSync, readdirSync, readFileSync, statSync } from 'fs'
24
- import { join, relative } from 'path'
25
-
26
- import { buildSchema } from 'type-graphql'
27
- import type { GraphQLSchema } from 'graphql'
28
-
29
- const PKG = join(__dirname, '..')
30
- const DIST = join(PKG, 'dist-server')
31
- const AUTH_BASE_DIST = join(PKG, '..', 'auth-base', 'dist-server')
32
-
33
- /** Resolver sources newer than their build: the schema below would not be the one served. */
34
- function staleResolvers(): string[] {
35
- const out: string[] = []
36
- const walk = (dir: string) => {
37
- for (const name of readdirSync(dir)) {
38
- const path = join(dir, name)
39
- if (statSync(path).isDirectory()) walk(path)
40
- else if (path.endsWith('.ts') && !path.endsWith('.test.ts') && /@(Query|Mutation|Subscription)\(/.test(readFileSync(path, 'utf8'))) {
41
- const built = join(DIST, relative(join(PKG, 'server'), path)).replace(/\.ts$/, '.js')
42
- if (!existsSync(built) || statSync(built).mtimeMs < statSync(path).mtimeMs) out.push(relative(PKG, path))
43
- }
44
- }
45
- }
46
- walk(join(PKG, 'server'))
47
- return out
48
- }
49
-
50
- type Root = 'Query' | 'Mutation' | 'Subscription'
51
-
52
- /** Open on purpose, each with what keeps it inside the caller's tenant — and, for a room, inside the room. */
53
- const OPEN_BY_DECISION: Record<Root, Record<string, string>> = {
54
- Query: {},
55
- Mutation: {},
56
- Subscription: {
57
- chatMessageActivity:
58
- "subscribe: a member of the domain, and the room open to the caller — open to the domain, group or private to its seats " +
59
- '(ADR-0073 decision 2), refused with the words of a missing session otherwise. Every message: same domain + session, ' +
60
- 'and the room asked again. The body is redacted by doors for each receiver (ADR-0073 ruling 1).',
61
- mySessionActivity:
62
- "subscribe: a member of the domain. Every message: same domain, and the caller among the payload's participants. " +
63
- 'Badge fields and a one-line preview only, no body.',
64
- chatTyping:
65
- 'subscribe: a member of the domain, and the room open to the caller, asked as chatMessageActivity asks it. Every notice: ' +
66
- "same domain + session, not the caller's own, and the room asked again. A user id, a name and a time - nothing stored, no body."
67
- }
68
- }
69
-
70
- let schema: GraphQLSchema
71
- let privilegeOfField: (typeName: string, field: string) => { known: boolean; gate?: unknown }
72
-
73
- beforeAll(async () => {
74
- const stale = staleResolvers()
75
- if (stale.length) {
76
- throw new Error(
77
- `dist-server is older than ${stale.length} resolver source(s), so the schema below is not the one served:\n ` +
78
- stale.join('\n ') +
79
- '\nBuild first: yarn workspace @things-factory/ai-assistant build:server'
80
- )
81
- }
82
-
83
- const { schema: declared } = require(join(DIST, 'service', 'index.js'))
84
- const directive = require(join(AUTH_BASE_DIST, 'service', 'privilege', 'privilege-directive.js'))
85
- privilegeOfField = directive.privilegeOfField
86
-
87
- schema = await buildSchema({
88
- resolvers: declared.resolverClasses,
89
- validate: false,
90
- /* The subscriptions name their own subscribe; the walk only needs a pubSub to accept them. */
91
- pubSub: { publish() {}, subscribe() {} } as any
92
- })
93
- directive.privilegeDirectiveResolver(schema)
94
- })
95
-
96
- function fieldsOf(typeName: Root): string[] {
97
- const type = typeName === 'Query' ? schema.getQueryType() : typeName === 'Mutation' ? schema.getMutationType() : schema.getSubscriptionType()
98
- return Object.keys(type?.getFields() ?? {})
99
- }
100
-
101
- function openFields(typeName: Root): string[] {
102
- return fieldsOf(typeName).filter(field => {
103
- const gate = privilegeOfField(typeName, field)
104
- return gate.known && gate.gate === null
105
- })
106
- }
107
-
108
- describe('every open door has a written reason', () => {
109
- it.each(['Query', 'Mutation', 'Subscription'] as const)('%s', typeName => {
110
- expect(openFields(typeName).sort()).toEqual(Object.keys(OPEN_BY_DECISION[typeName]).sort())
111
- })
112
- })
113
-
114
- describe('the domain owner may call every door (ruled 2026-09-24)', () => {
115
- /*
116
- * The conversation doors did not admit domain owners, and warehouse has no role that grants
117
- * ai-assistant — so on :3500 nobody could open the AI dock, the owner included. Every business door
118
- * of the apps admits the owner; these now do too. Calling a door is not reading a conversation:
119
- * private ones stay with their participants (`session-visibility.test.ts`).
120
- */
121
- it.each(['Query', 'Mutation'] as const)('%s — every declared door admits the owner', typeName => {
122
- const notForOwners = fieldsOf(typeName).filter(field => {
123
- const gate: any = privilegeOfField(typeName, field)
124
- return gate.known && gate.gate && gate.gate.owner !== true
125
- })
126
- expect(notForOwners).toEqual([])
127
- })
128
- })
129
-
130
- describe('what the walk itself has to be true for', () => {
131
- it('reaches the whole schema, not a handful of fields', () => {
132
- /* If the resolver list shrank to nothing, the lists above would pass by having nothing to look at. */
133
- expect(fieldsOf('Query').length).toBeGreaterThanOrEqual(10)
134
- expect(fieldsOf('Mutation').length).toBeGreaterThanOrEqual(13)
135
- expect(fieldsOf('Subscription')).toHaveLength(3)
136
- })
137
-
138
- it('tells an undeclared field from one the schema does not have', () => {
139
- /* `known: false` must never read as open — that is how a typo becomes a gate that is not there. */
140
- expect(privilegeOfField('Query', 'noSuchField')).toEqual({ known: false })
141
- })
142
-
143
- it('the census, in plain numbers', () => {
144
- /*
145
- * 2026-09-24: 27 root fields, 25 declared, 2 open — both streams.
146
- * 2026-09-25: 28 — attachToConversation (a conversation's files, shared dock §9), declared.
147
- * 2026-09-28: 29 — requestProposal (a proposal is requested once, ADR-0097 Q-D4), declared.
148
- * 2026-09-30: 30 — applyEntryProposal (enter the rows the person pressed, design/ai/data-entry.md), declared.
149
- * 2026-10-12: 35 — aiAgentSettings · aiAgentChoices · aiProviderModels · saveAiAgents · aiUsageSummary (a domain's AI
150
- * agents and their usage, design/ai/agent-settings.md), declared.
151
- * 2026-10-24: 41 — mayInviteToAISession · inviteToAISession · removeFromAISession · leaveAISession · sayTyping declared, chatTyping open (a
152
- * group conversation and its typing line, ADR-0073 decision 3).
153
- * 2026-10-25: 46 — archivedSessionCount · cleanupSessionCount · aiSessionKeeping · deletedAISessions · restoreAISession
154
- * (archive, suggestions to clear and bringing a deleted one back, shared dock §2-7), declared.
155
- * 2026-11-12: 47 — keptInAISession (the person a conversation is about, whom the screen offers no way to send out,
156
- * ADR-0200), declared.
157
- */
158
- const all = fieldsOf('Query').length + fieldsOf('Mutation').length + fieldsOf('Subscription').length
159
- const open = openFields('Query').length + openFields('Mutation').length + openFields('Subscription').length
160
-
161
- expect(all).toBe(47)
162
- expect(open).toBe(3)
163
- })
164
- })
@@ -1,31 +0,0 @@
1
- /*
2
- * The screen card (design/ai/read-targets.md §5) - it opens an address of the application only, and says the
3
- * conditions the screen does not take. The chat's wiring is read as text: importing it pulls the shell.
4
- */
5
- import { readFileSync } from 'fs'
6
- import { join } from 'path'
7
-
8
- import { isAppAddress, isOpenPageProposal, openPageNote } from '../client/utils/open-page'
9
-
10
- const t = (key: string, options: any = {}) => String(options.defaultValue ?? key).replace(/\{(\w+)\}/g, (_, name) => String(options[name] ?? ''))
11
-
12
- describe('the screen card', () => {
13
- it('★ opens an address of the application - never another origin or a script', () => {
14
- expect(isAppAddress('cash-transaction-list?flow=EXPENSE')).toBe(true)
15
- for (const href of ['https://evil.example/x', '//evil.example/x', 'javascript:alert(1)', ' JavaScript:alert(1)', '', 42]) expect(isAppAddress(href)).toBe(false)
16
- expect(isOpenPageProposal({ kind: 'open-page', href: 'javascript:alert(1)' })).toBe(false)
17
- })
18
-
19
- it('★ says the conditions the screen does not take', () => {
20
- expect(openPageNote({ notAppliedLabels: ['기간', '금액'] }, t)).toBe('the screen does not take: 기간, 금액')
21
- expect(openPageNote({ notAppliedLabels: [] }, t)).toBe('')
22
- })
23
-
24
- it('the chat draws it before the generic run button, and opens it through the dock', () => {
25
- const chat = readFileSync(join(__dirname, '../client/components/assistant-chat.ts'), 'utf8')
26
- const cards = chat.slice(chat.indexOf('if (isWorkspaceProposal(p))'), chat.indexOf('const card = proposalCardState('))
27
- expect(cards).toMatch(/if \(isOpenPageProposal\(p\)\) return this\.renderOpenPageCard\(p\)/)
28
- const card = chat.slice(chat.indexOf('private renderOpenPageCard('), chat.indexOf('private renderWorkspaceCard('))
29
- expect(card).toMatch(/new CustomEvent\('assistant-open-page', \{ detail: \{ href: p\.href \}/)
30
- })
31
- })
@@ -1,147 +0,0 @@
1
- /*
2
- * A table pasted into the composer (client/utils/pasted-table.ts) - what is a table, what is words, and the file it
3
- * becomes. The clipboards are the shapes Excel, Google Sheets and a browser put there.
4
- */
5
- import { readFileSync } from 'fs'
6
- import { join } from 'path'
7
-
8
- import { pastedTable, pastedTableFile, pastedTableText, tableOfHtml, tableOfText } from '../client/utils/pasted-table'
9
-
10
- /* Excel for the web / desktop: a whole document, a style block, a conditional comment, classes, &nbsp; in an empty cell. */
11
- const EXCEL_HTML = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">
12
- <head><meta charset="utf-8"><style>
13
- .xl65 { mso-number-format:"\\#\\,\\#\\#0"; }
14
- td { padding: 0 }
15
- </style></head>
16
- <body link="#0563C1">
17
- <!--StartFragment-->
18
- <table border=0 cellpadding=0 cellspacing=0 width=300>
19
- <col width=100 span=3>
20
- <tr height=20>
21
- <td height=20 width=100>이용일</td>
22
- <td width=100>가맹점</td>
23
- <td width=100>이용금액</td>
24
- </tr>
25
- <tr height=20>
26
- <td height=20 class=xl66 align=right>2026-09-12</td>
27
- <td>카카오T</td>
28
- <td class=xl65 align=right>12,400</td>
29
- </tr>
30
- <tr height=20>
31
- <td height=20 class=xl66 align=right>2026-09-13</td>
32
- <td>스타벅스 &amp; 브런치</td>
33
- <td class=xl65 align=right>5,000</td>
34
- </tr>
35
- <tr height=20>
36
- <td height=20>&nbsp;</td>
37
- <td>합계</td>
38
- <td class=xl65 align=right>17,400</td>
39
- </tr>
40
- </table>
41
- <!--EndFragment-->
42
- </body></html>`
43
-
44
- const EXCEL_TEXT = '이용일\t가맹점\t이용금액\r\n2026-09-12\t카카오T\t12,400\r\n2026-09-13\t스타벅스 & 브런치\t5,000\r\n\t합계\t17,400\r\n'
45
-
46
- /* Google Sheets: its own wrapper and a colgroup, cells without closing tags never happen here but a <br> in a cell does. */
47
- const SHEETS_HTML =
48
- '<google-sheets-html-origin><style type="text/css"><!--td {border: 1px solid #cccccc;}--></style>' +
49
- '<table xmlns="http://www.w3.org/1999/xhtml" cellspacing="0" cellpadding="0" dir="ltr" border="1"><colgroup><col width="100"/><col width="100"/></colgroup>' +
50
- '<tbody><tr style="height:21px;"><td style="overflow:hidden;">품목</td><td>비고</td></tr>' +
51
- '<tr style="height:21px;"><td>볼트 M8</td><td>1차 납품<br/>나머지 다음 주</td></tr></tbody></table></google-sheets-html-origin>'
52
-
53
- describe('a pasted table', () => {
54
- it('★ Excel - the HTML is read: the header, the rows, an empty cell kept in its column, &amp; decoded', () => {
55
- const table = pastedTable({ html: EXCEL_HTML, text: EXCEL_TEXT })
56
- expect(table).toEqual({
57
- columns: 3,
58
- rows: [
59
- ['이용일', '가맹점', '이용금액'],
60
- ['2026-09-12', '카카오T', '12,400'],
61
- ['2026-09-13', '스타벅스 & 브런치', '5,000'],
62
- ['', '합계', '17,400']
63
- ]
64
- })
65
- })
66
-
67
- it('★ the plain text alone gives the same table - a spreadsheet\'s tab-separated lines', () => {
68
- expect(pastedTable({ text: EXCEL_TEXT })?.rows).toEqual(pastedTable({ html: EXCEL_HTML })?.rows)
69
- })
70
-
71
- it('Google Sheets - its wrapper and style are not cells, a line break in a cell stays in the cell', () => {
72
- expect(tableOfHtml(SHEETS_HTML)).toEqual([
73
- ['품목', '비고'],
74
- ['볼트 M8', '1차 납품 나머지 다음 주']
75
- ])
76
- })
77
-
78
- it('a cell spanning columns keeps the next cells in their columns', () => {
79
- expect(tableOfHtml('<table><tr><td colspan="2">9월</td><td>합계</td></tr><tr><td>a</td><td>b</td><td>3</td></tr></table>')).toEqual([
80
- ['9월', '', '합계'],
81
- ['a', 'b', '3']
82
- ])
83
- })
84
-
85
- it('a quoted cell of the plain text holds its line break and its tab', () => {
86
- expect(tableOfText('품목\t비고\n볼트\t"1차\n2차\t분할"\n너트\t-\n')).toEqual([
87
- ['품목', '비고'],
88
- ['볼트', '1차 2차 분할'],
89
- ['너트', '-']
90
- ])
91
- })
92
-
93
- it('★ a web page whose words lie mostly outside its table is words, not a table paste', () => {
94
- const page = '<p>9월 경비 정산 안내입니다. 아래 표를 참고하시고 이번 주 금요일까지 제출해 주십시오.</p><table><tr><td>a</td><td>b</td></tr><tr><td>c</td><td>d</td></tr></table>'
95
- expect(tableOfHtml(page)).toBeNull()
96
- expect(pastedTable({ html: page, text: '9월 경비 정산 안내입니다.\n\na\tb\nc\td' })).toBeNull()
97
- })
98
-
99
- it('★ words are words - a sentence, a sentence with one tab, one row, one column', () => {
100
- expect(pastedTable({ text: '카카오T 12,400원 경비로 올려 줘' })).toBeNull()
101
- expect(pastedTable({ text: '메모:\t내일 다시\n오늘은 여기까지\n그리고 하나 더' })).toBeNull()
102
- expect(pastedTable({ text: 'a\tb\tc\n' })).toBeNull()
103
- expect(pastedTable({ html: '<table><tr><td>a</td></tr><tr><td>b</td></tr></table>' })).toBeNull()
104
- })
105
-
106
- it('★ the file has the shape of a read sheet - a line naming it, each row led by its number, CSV quoting', () => {
107
- const table = pastedTable({ text: EXCEL_TEXT })!
108
- expect(pastedTableText(table, '붙여넣은 표').split('\n')).toEqual([
109
- '# 붙여넣은 표 · a table the person pasted · the first column is the row number in the pasted table',
110
- '1,이용일,가맹점,이용금액',
111
- '2,2026-09-12,카카오T,"12,400"',
112
- '3,2026-09-13,스타벅스 & 브런치,"5,000"',
113
- '4,,합계,"17,400"',
114
- ''
115
- ])
116
- })
117
-
118
- const nameOf = (rows: number) => `붙여넣은 표 ${rows}행`
119
-
120
- it('★ a conversation that takes text gets a CSV file - one that takes none keeps the paste as words', () => {
121
- expect(pastedTableFile({ text: EXCEL_TEXT }, { kinds: ['image', 'text'] }, nameOf)).toEqual({ name: '붙여넣은 표 4행.csv', text: pastedTableText(pastedTable({ text: EXCEL_TEXT })!, '붙여넣은 표 4행'), table: pastedTable({ text: EXCEL_TEXT }) })
122
- expect(pastedTableFile({ text: EXCEL_TEXT }, { kinds: ['spreadsheet'] }, nameOf)).toMatchObject({ name: '붙여넣은 표 4행.csv' })
123
- expect(pastedTableFile({ text: EXCEL_TEXT }, { kinds: ['image'] }, nameOf)).toBeNull()
124
- expect(pastedTableFile({ text: EXCEL_TEXT }, null, nameOf)).toBeNull()
125
- expect(pastedTableFile({ text: '그냥 글입니다' }, { kinds: ['text'] }, nameOf)).toBeNull()
126
- })
127
-
128
- it('★ a table longer than the model reads is refused, never cut', () => {
129
- expect(pastedTableFile({ text: EXCEL_TEXT }, { kinds: ['text'], maxChars: 50 }, nameOf)).toEqual({ refusal: { code: 'attachment-paste-too-long', rows: 4, maxChars: 50 } })
130
- })
131
-
132
- it('★ the composer takes the table before the files - the picture a spreadsheet puts beside it is not attached', () => {
133
- const source = readFileSync(join(__dirname, '../client/components/assistant-chat.ts'), 'utf8')
134
- const paste = source.slice(source.indexOf('private onComposerPaste('), source.indexOf('private onComposerDragOver('))
135
- expect(paste.indexOf('pastedTableFile(')).toBeGreaterThan(0)
136
- expect(paste.indexOf('pastedTableFile(')).toBeLessThan(paste.indexOf("item.kind === 'file'"))
137
- expect(paste).toMatch(/e\.preventDefault\(\)[\s\S]*?return\n/)
138
- })
139
-
140
- it('★ the Enter that ends a syllable belongs to the input method - the composer does not send on it', () => {
141
- const source = readFileSync(join(__dirname, '../client/components/assistant-chat.ts'), 'utf8')
142
- const keys = source.slice(source.indexOf('private onKeyDown('), source.indexOf('this.send()', source.indexOf('private onKeyDown(')))
143
- expect(keys).toMatch(/if \(e\.isComposing \|\| e\.keyCode === 229\) return/)
144
- expect(keys.indexOf('e.isComposing')).toBeLessThan(keys.indexOf("e.key === 'Enter'"))
145
- })
146
- })
147
-
@@ -1,80 +0,0 @@
1
- /*
2
- * What this holds: **a Korean reader is refused in Korean, with the bound, and nothing is cut without a word.**
3
- *
4
- * Found by the inline help audit of 2026-10-30: the conversation doors threw English sentences
5
- * (「ChatSession … not found」, 「Only the user who created this session…」), four owner and invite
6
- * refusals had no Korean entry, the attachment refusal listed the kind ids `image, text, …` inside a
7
- * Korean sentence, the roster said `3 online / 5 total` and `owner`, and a session name was cut at 200
8
- * characters while an empty one came back as `false` with no reason.
9
- */
10
- import { readFileSync, readdirSync } from 'fs'
11
- import { join } from 'path'
12
-
13
- import { attachmentKindWords, sessionNameOf, SESSION_NAME_MAX } from '../server/service/chat-session/session-name'
14
-
15
- const ROOT = join(__dirname, '..')
16
- const read = (file: string) => readFileSync(join(ROOT, file), 'utf8')
17
- const ko: Record<string, string> = JSON.parse(read('translations/ko.json'))
18
-
19
- /* The framework's single-brace placeholders, in Korean. */
20
- const t = (key: string, options: any = {}) =>
21
- String(ko[key] ?? options.defaultValue ?? key).replace(/\{(\w+)\}/g, (whole, name) => (name in options ? String(options[name]) : whole))
22
-
23
- function serverFiles(dir: string): string[] {
24
- return readdirSync(dir, { withFileTypes: true }).flatMap(entry => {
25
- const path = join(dir, entry.name)
26
- if (entry.isDirectory()) return serverFiles(path)
27
- return /\.ts$/.test(entry.name) && !/\.test\.ts$/.test(entry.name) ? [path] : []
28
- })
29
- }
30
-
31
- describe('a conversation door refuses in the reader’s words', () => {
32
- const files = serverFiles(join(ROOT, 'server'))
33
-
34
- it('reads the server source of this package', () => {
35
- expect(files.length).toBeGreaterThanOrEqual(20)
36
- })
37
-
38
- it('★ every key the server translates has a Korean entry - a missing one is read in English', () => {
39
- const used = new Set(files.flatMap(file => [...readFileSync(file, 'utf8').matchAll(/\(\s*'(ai-assistant\.[a-z0-9.-]+)'/g)].map(m => m[1])))
40
- expect(used.size).toBeGreaterThanOrEqual(20)
41
- expect([...used].filter(key => !(key in ko))).toEqual([])
42
- })
43
-
44
- it('★ the session doors throw no English sentence', () => {
45
- for (const file of ['server/service/chat-session-resolver.ts', 'server/service/assistant-chat-resolver.ts']) {
46
- expect({ file, english: read(file).match(/throw new Error\(\s*['`][A-Za-z][^'`]*['`]/g) ?? [] }).toEqual({ file, english: [] })
47
- }
48
- })
49
- })
50
-
51
- describe('a session name', () => {
52
- it('★ a name over the bound is refused with the bound, not cut', () => {
53
- const long = '가'.repeat(SESSION_NAME_MAX + 1)
54
- expect(() => sessionNameOf(long, t, false)).toThrow(`대화 이름은 ${SESSION_NAME_MAX}자까지입니다. 지금 ${SESSION_NAME_MAX + 1}자입니다.`)
55
- expect(sessionNameOf(' ' + '가'.repeat(SESSION_NAME_MAX) + ' ', t, false)).toBe('가'.repeat(SESSION_NAME_MAX))
56
- expect(read('server/service/chat-session-resolver.ts')).not.toMatch(/\.slice\(0, 200\)/)
57
- })
58
-
59
- it('★ an empty name is refused in words where the door does not take it', () => {
60
- expect(() => sessionNameOf(' ', t, false)).toThrow('대화 이름을 비울 수 없습니다.')
61
- expect(sessionNameOf(' ', t, true)).toBe('')
62
- })
63
- })
64
-
65
- describe('words on the screen', () => {
66
- it('★ attachment kinds are named in Korean, on the door and on the screen', () => {
67
- expect(attachmentKindWords(['image', 'text', 'spreadsheet', 'document'], t)).toBe('이미지, 텍스트 파일, 스프레드시트(엑셀·CSV), 문서(PDF·Word·PowerPoint)')
68
- expect(read('server/service/chat-session-resolver.ts')).not.toMatch(/kinds\.join\(/)
69
- expect(read('client/components/assistant-chat.ts')).not.toMatch(/params\.kinds = refusal\.kinds\.join\(/)
70
- })
71
-
72
- it('★ the roster says online and the role in the reader’s words', () => {
73
- const chat = read('client/components/assistant-chat.ts')
74
- expect(chat).not.toMatch(/ online \/ |' · online'| · \$\{p\.role\}/)
75
- for (const key of ['roster-count', 'participant-role-owner', 'participant-role-member', 'participant-online']) {
76
- const full = key === 'roster-count' ? `ai-assistant.text.${key}` : `ai-assistant.label.${key}`
77
- expect(ko[full]).toBeTruthy()
78
- }
79
- })
80
- })
@@ -1,43 +0,0 @@
1
- import { readFileSync } from 'node:fs'
2
- import { join } from 'node:path'
3
- import { autoSessionName, searchReadableMessages } from '../server/service/chat-session/session-inbox.js'
4
-
5
- describe('returning to work by its subject', () => {
6
- it('finds an earlier question, not just the final execution log', () => {
7
- expect([...searchReadableMessages([
8
- { sessionId: 'lift', role: 'user', content: '리프트 테이블을 만들어 줘' },
9
- { sessionId: 'lift', role: 'system', content: 'accepted 13/13' }
10
- ], '리프트')]).toEqual(['lift'])
11
- })
12
- it('cannot discover redacted answers or internal execution notes', () => {
13
- expect([...searchReadableMessages([
14
- { sessionId: 'secret', role: 'assistant', content: 'restricted value', redacted: true },
15
- { sessionId: 'log', role: 'system', content: 'restricted value' },
16
- { sessionId: 'public', role: 'assistant', content: 'Restricted value is unavailable' }
17
- ], 'restricted')]).toEqual(['public'])
18
- expect(searchReadableMessages([{ sessionId: 'a', role: 'user', content: 'hi' }], ' ').size).toBe(0)
19
- })
20
- it('names a new conversation from the first question', () => {
21
- expect(autoSessionName('리프트 테이블을 만들어 줘. 폭은 600')).toBe('리프트 테이블을 만들어 줘')
22
- const resolver = readFileSync(join(__dirname, '../server/service/chat-session-resolver.ts'), 'utf8')
23
- expect(resolver).toContain("const finalName = name?.trim() || null")
24
- expect(resolver).toContain('await readerGate(context)(messages)')
25
- expect(resolver).toContain('take: 2001')
26
- })
27
- })
28
-
29
- describe('discoverable conversation controls', () => {
30
- const manager = readFileSync(join(__dirname, '../client/components/assistant-session-manager.ts'), 'utf8')
31
- it('uses a native button to open a conversation and a visible button to manage it in the platform menu', () => {
32
- expect(manager).toContain('<button class="open-row"')
33
- expect(manager).toContain('class="more-menu"')
34
- expect(manager).toContain('OxPopupMenu.open(')
35
- })
36
- it('distinguishes filtered emptiness, supplies one clear, and keeps the filters open', () => {
37
- expect(manager).toContain("t('filtered-empty'")
38
- expect(manager).toContain('this.clearFilters()')
39
- expect(manager).toContain('<div class="filters">')
40
- expect(manager).not.toContain('filtersOpen')
41
- expect(manager).toContain('e.stopPropagation(); this.onSearch')
42
- })
43
- })
@@ -1,92 +0,0 @@
1
- /*
2
- * A spreadsheet read into the text a conversation carries (design/ai/shared-dock.md §9-5): computed values, ISO
3
- * dates, the sheet's own row numbers kept, .xls refused by name, and a sheet longer than the limit refused - never cut.
4
- */
5
- import ExcelJS from 'exceljs'
6
-
7
- import * as server from '../server/service/chat-session/attachment-policy'
8
- import * as screen from '../client/utils/attachment-policy'
9
- import { cellText, readSpreadsheet, sheetFileName, sheetText, spreadsheetKindOf } from '../client/utils/spreadsheet-text'
10
-
11
- async function workbook(build: (wb: any) => void): Promise<Uint8Array> {
12
- const wb = new ExcelJS.Workbook()
13
- build(wb)
14
- return new Uint8Array(await wb.xlsx.writeBuffer())
15
- }
16
-
17
- describe('a spreadsheet as text', () => {
18
- it('keeps the sheet\'s own row numbers - an empty row is left out, never renumbered', async () => {
19
- const data = await workbook(wb => {
20
- const ws = wb.addWorksheet('9월')
21
- ws.getCell('A1').value = '거래일'
22
- ws.getCell('B1').value = '금액'
23
- ws.getCell('A2').value = new Date(Date.UTC(2026, 8, 22))
24
- ws.getCell('B2').value = 4400000
25
- /* row 3 empty */
26
- ws.getCell('A4').value = new Date(Date.UTC(2026, 8, 23, 9, 30))
27
- ws.getCell('B4').value = { formula: 'B2/8', result: 550000 }
28
- ws.getCell('C4').value = '메모, "따옴표"'
29
- })
30
- const read: any = await readSpreadsheet(data, '거래내역.xlsx', 20_000, ExcelJS.Workbook)
31
- expect(read.files.map((one: any) => one.name)).toEqual(['거래내역 - 9월.csv'])
32
- expect(read.files[0].text.split('\n').slice(1, 4)).toEqual(['1,거래일,금액', '2,2026-09-22,4400000', '4,2026-09-23T09:30:00,550000,"메모, ""따옴표"""'])
33
- })
34
-
35
- it('reads every sheet with something in it, and says so when none has', async () => {
36
- const two = await workbook(wb => {
37
- wb.addWorksheet('빈 시트')
38
- wb.addWorksheet('계약').getCell('A1').value = 'H2026001'
39
- })
40
- expect(((await readSpreadsheet(two, 'a.xlsx', 20_000, ExcelJS.Workbook)) as any).files.map((one: any) => one.name)).toEqual(['a - 계약.csv'])
41
- const none = await workbook(wb => wb.addWorksheet('빈 시트'))
42
- expect(await readSpreadsheet(none, 'b.xlsx', 20_000, ExcelJS.Workbook)).toEqual({ refusal: { code: 'attachment-sheet-empty', name: 'b.xlsx' } })
43
- })
44
-
45
- it('refuses a sheet longer than the limit as text - a small file can be a long text - and never cuts it', async () => {
46
- const data = await workbook(wb => {
47
- const ws = wb.addWorksheet('원장')
48
- for (let i = 1; i <= 400; i++) ws.addRow([i, '가나다라마바사아자차카타파하', 1234567])
49
- })
50
- expect(data.byteLength).toBeLessThan(20_000)
51
- expect(await readSpreadsheet(data, 'big.xlsx', 5_000, ExcelJS.Workbook)).toEqual({ refusal: { code: 'attachment-sheet-too-long', name: 'big.xlsx · 원장', maxChars: 5_000 } })
52
- const fits: any = await readSpreadsheet(data, 'big.xlsx', 50_000, ExcelJS.Workbook)
53
- expect(fits.files[0].text.trim().split('\n')).toHaveLength(401)
54
- })
55
-
56
- it('names a file that is not a workbook instead of failing silently', async () => {
57
- expect(await readSpreadsheet(new TextEncoder().encode('not a zip'), 'x.xlsx', 20_000, ExcelJS.Workbook)).toEqual({ refusal: { code: 'attachment-sheet-unreadable', name: 'x.xlsx' } })
58
- })
59
-
60
- it('tells .xlsx from the old .xls, by type or by name', () => {
61
- expect(spreadsheetKindOf({ name: '원장.XLSX' })).toBe('xlsx')
62
- expect(spreadsheetKindOf({ name: 'x', type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })).toBe('xlsx')
63
- expect(spreadsheetKindOf({ name: '옛 원장.xls' })).toBe('xls')
64
- expect(spreadsheetKindOf({ name: 'a.csv', type: 'text/csv' })).toBeNull()
65
- })
66
-
67
- it('reads a cell as Excel shows its value', () => {
68
- expect(cellText({ richText: [{ text: '굵은' }, { text: ' 글' }] })).toBe('굵은 글')
69
- expect(cellText({ text: '링크', hyperlink: 'https://x' })).toBe('링크')
70
- expect(cellText({ formula: 'A1+1' })).toBe('')
71
- expect(cellText({ error: '#DIV/0!' })).toBe('#DIV/0!')
72
- expect(cellText(true)).toBe('true')
73
- expect(sheetText('f.xlsx', 's', [{ number: 7, cells: ['a', '', ''] }])).toBe('# f.xlsx · sheet "s" · the first column is the sheet\'s own row number\n7,a\n')
74
- expect(sheetFileName('a/b.xlsx', '9/10월')).toBe('a/b - 9_10월.csv')
75
- })
76
- })
77
-
78
- describe('a mode that takes spreadsheets takes their text - on the screen and at the door alike', () => {
79
- const policy = { kinds: ['spreadsheet'] } as any
80
- const sheet = [{ name: '거래내역 - 9월.csv', type: 'text/csv', size: 10 }]
81
- it('the sheets\' text passes; an image does not', () => {
82
- for (const rule of [screen, server]) {
83
- expect(rule.refuseAttachments(policy, sheet)).toBeNull()
84
- expect(rule.refuseAttachments(policy, [{ name: 'a.png', type: 'image/png', size: 1 }])).toEqual({ code: 'attachment-kind-not-accepted', name: 'a.png', kinds: ['spreadsheet'] })
85
- }
86
- })
87
- it('the limit of text the model reads is the mode\'s, the same on both sides', () => {
88
- expect(screen.textCharsOf({ kinds: ['spreadsheet'], maxChars: 150_000 })).toBe(150_000)
89
- expect(screen.textCharsOf(undefined)).toBe(server.TEXT_CHARS_FOR_MODEL)
90
- expect(screen.TEXT_CHARS_FOR_MODEL).toBe(server.TEXT_CHARS_FOR_MODEL)
91
- })
92
- })
@@ -1,80 +0,0 @@
1
- /*
2
- * What this holds: **the chat's words live in the same package as the chat.**
3
- *
4
- * The chat component moved from `board-ai` to this package on 2026-09-10, but its translation
5
- * files stayed behind. In an app that loads board-ai the strings still resolved, so nothing looked
6
- * wrong. In an app that does not — operato-figure was the first — the dock opened with twelve raw
7
- * keys on screen (`board-ai.text.triggers-heading`, ...). No build error, no console error.
8
- *
9
- * The keys are strings, so neither tsc nor eslint can see a key that has no entry. These tests are
10
- * the only thing that can.
11
- */
12
- import { readFileSync, readdirSync } from 'fs'
13
- import { join } from 'path'
14
-
15
- const PACKAGE_ROOT = join(__dirname, '..')
16
- const CLIENT_DIR = join(PACKAGE_ROOT, 'client')
17
- const TRANSLATIONS_DIR = join(PACKAGE_ROOT, 'translations')
18
-
19
- const KEY_IN_SOURCE = /'(ai-assistant\.[a-z0-9.-]+)'/g
20
-
21
- function sourceFiles(dir: string): string[] {
22
- return readdirSync(dir, { withFileTypes: true }).flatMap(entry => {
23
- const path = join(dir, entry.name)
24
- if (entry.isDirectory()) return sourceFiles(path)
25
- return /\.tsx?$/.test(entry.name) ? [path] : []
26
- })
27
- }
28
-
29
- const files = sourceFiles(CLIENT_DIR)
30
- const usedKeys = new Set<string>(
31
- files.flatMap(file => [...readFileSync(file, 'utf8').matchAll(KEY_IN_SOURCE)].map(match => match[1]))
32
- )
33
-
34
- function locale(name: string): Record<string, string> {
35
- return JSON.parse(readFileSync(join(TRANSLATIONS_DIR, `${name}.json`), 'utf8'))
36
- }
37
-
38
- /*
39
- * An absence test passes for free once it stops finding anything to look at — a renamed directory,
40
- * a changed key prefix, a moved component. So state the floor: this suite only means something
41
- * while it is still reading the real client source and the real translation files.
42
- */
43
- describe('the suite examined something', () => {
44
- it('reads the client source of this package', () => {
45
- expect(files.length).toBeGreaterThanOrEqual(5)
46
- expect(usedKeys.size).toBeGreaterThanOrEqual(30)
47
- })
48
-
49
- it('reads the translation files of this package', () => {
50
- const locales = readdirSync(TRANSLATIONS_DIR).filter(name => name.endsWith('.json'))
51
- expect(locales).toEqual(expect.arrayContaining(['en.json', 'ko.json']))
52
- })
53
- })
54
-
55
- describe('every key the chat asks for has an entry', () => {
56
- it('★ english — a missing entry renders the key itself on screen', () => {
57
- const entries = locale('en')
58
- const missing = [...usedKeys].filter(key => !(key in entries))
59
- expect(missing).toEqual([])
60
- })
61
-
62
- it('★ korean — the same, for the language most of these screens run in', () => {
63
- const entries = locale('ko')
64
- const missing = [...usedKeys].filter(key => !(key in entries))
65
- expect(missing).toEqual([])
66
- })
67
- })
68
-
69
- describe('the keys belong to this package', () => {
70
- it('★ no key still carries the board-ai prefix — the component is not in board-ai any more', () => {
71
- const stale = files.filter(file => /'board-ai\.[a-z0-9.-]+'/.test(readFileSync(file, 'utf8')))
72
- expect(stale).toEqual([])
73
- })
74
-
75
- /* A task this package declares is worded as task.<id>, and its id begins with the package (ADR-0139 decision 11). */
76
- it('every entry in en.json is an ai-assistant key', () => {
77
- const wrongPrefix = Object.keys(locale('en')).filter(key => !key.startsWith('ai-assistant.') && !key.startsWith('task.ai-assistant.'))
78
- expect(wrongPrefix).toEqual([])
79
- })
80
- })