@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,63 +0,0 @@
1
- /*
2
- * At boot, say what registered but is not yet what the contracts require — tools that named no doors
3
- * (ADR-0071 decision 2) and modes offering `/` sentences their tools cannot answer (ADR-0058
4
- * decision 3).
5
- *
6
- * One window, because it is one question: what state is this deployment's AI in (standard A7-a).
7
- *
8
- * A tool that names no doors still registers; refusing at registration would stop a whole app from
9
- * booting over one omission. It is the **gate** that refuses it, tool by tool — such a tool is
10
- * offered to no conversation (`resolveToolScope`). So this list is not a soft warning about
11
- * something that still works: it names the tools that are not working, and why.
12
- */
13
- import { logger } from '@things-factory/env'
14
- import { getToolRegistryWarnings, type ToolRegistryWarning } from '@things-factory/ai-client-base'
15
-
16
- import { getAssistantModeWarnings, type AssistantModeWarning } from './service/assistant-mode/index.js'
17
- import { doorDeclarationWarnings, formatDoorDeclarationWarnings } from './door-declaration-report.js'
18
-
19
- /** One line per code: the code, how many, and which tools. Empty when there is nothing to report. */
20
- export function formatToolRegistryWarnings(warnings: ReadonlyArray<ToolRegistryWarning>): string[] {
21
- const byCode = new Map<string, string[]>()
22
- for (const warning of warnings) {
23
- const tools = byCode.get(warning.code) ?? []
24
- /* 문 이름이 있으면 함께 적는다 — 「어느 문이 아직 선언이 없나」가 다음에 할 일이다. */
25
- tools.push(`${warning.params.category}/${warning.params.tool}(${warning.params.kind})`)
26
- byCode.set(warning.code, tools)
27
- }
28
- return [...byCode].map(([code, tools]) => `[ai-assistant] ${code} ×${tools.length}: ${tools.join(', ')}`)
29
- }
30
-
31
- /** What one warning is about, in the words its code needs - a subject claimed twice names the subject and both. */
32
- function detailOf(warning: AssistantModeWarning): string {
33
- const { kind, slash, tool, subject, kinds, target } = warning.params
34
- switch (warning.code) {
35
- case 'assistant-mode-subject-claimed-twice':
36
- return `${subject}:${(kinds ?? []).join('+')}`
37
- case 'assistant-mode-entry-target-unknown':
38
- return `${kind}→${target}`
39
- default:
40
- return `${kind}:/${slash}→${tool}`
41
- }
42
- }
43
-
44
- /** One line per code: the code, how many, and what each is about. */
45
- export function formatAssistantModeWarnings(warnings: ReadonlyArray<AssistantModeWarning>): string[] {
46
- const byCode = new Map<string, string[]>()
47
- for (const warning of warnings) byCode.set(warning.code, [...(byCode.get(warning.code) ?? []), detailOf(warning)])
48
- return [...byCode].map(([code, details]) => `[ai-assistant] ${code} ×${details.length}: ${details.join(', ')}`)
49
- }
50
-
51
- /*
52
- * After every module has registered: a mode may declare its slash sentences before the package
53
- * that registers the tools they need, so this cannot be checked when the mode registers.
54
- */
55
- process.on('bootstrap-module-start' as any, () => {
56
- for (const line of formatToolRegistryWarnings(getToolRegistryWarnings())) logger.warn(line)
57
- for (const line of formatAssistantModeWarnings(getAssistantModeWarnings())) logger.warn(line)
58
- /*
59
- * 이 자리에서만 물을 수 있는 것 — 적어 둔 문이 스키마에 있나. AUTH 의 필드 표는 스키마를 지은 뒤에
60
- * 차고, 이 훅은 그 뒤에 돈다(`builtSchema` 를 함께 받는다).
61
- */
62
- for (const line of formatDoorDeclarationWarnings(doorDeclarationWarnings())) logger.warn(line)
63
- })
@@ -1,123 +0,0 @@
1
- /*
2
- * What this guards: **the dock sends the agent a person picked while the domain still offers it, and every action on
3
- * the settings card saves the domain's agents as one whole list without pinning what was inherited**
4
- * (design/ai/agent-settings.md §5, §7).
5
- */
6
- import { offersAgentPicker, pickAgentId } from '../client/utils/agent-choice'
7
- import { draftOf, groupByOwner, saveInput, type AgentSettings, type AgentView } from '../client/settings/agent-settings-model'
8
- import { periodRange } from '../client/settings/usage-model'
9
-
10
- const choice = (id: string, isDefault = false) => ({ id, name: id, provider: 'openai', model: 'gpt-4o', isDefault })
11
-
12
- describe('the dock\'s agent', () => {
13
- it('★ the remembered agent while the domain still offers it, else the default, else the first', () => {
14
- const choices = [choice('a'), choice('b', true), choice('c')]
15
- expect(pickAgentId(choices, 'c')).toBe('c')
16
- expect(pickAgentId(choices, 'gone')).toBe('b')
17
- expect(pickAgentId([choice('a'), choice('c')], undefined)).toBe('a')
18
- expect(pickAgentId([], 'a')).toBeUndefined()
19
- })
20
-
21
- it('★ no picker for one agent or none', () => {
22
- expect(offersAgentPicker([])).toBe(false)
23
- expect(offersAgentPicker([choice('a')])).toBe(false)
24
- expect(offersAgentPicker([choice('a'), choice('b')])).toBe(true)
25
- })
26
- })
27
-
28
- const domain = (id: string, name: string) => ({ id, name })
29
- const plant = domain('plant', '서울공장')
30
- const hq = domain('hq', '본사')
31
- const group = domain('group', '그룹')
32
-
33
- function agent(id: string, owner: { id: string; name: string }, extra: Partial<AgentView> = {}): AgentView {
34
- return {
35
- id,
36
- name: id.toUpperCase(),
37
- provider: 'openai',
38
- model: 'gpt-4o',
39
- baseURL: null,
40
- organization: null,
41
- active: true,
42
- owner,
43
- inherited: owner.id !== 'plant',
44
- turnedOff: false,
45
- keyState: owner.id !== 'plant' ? 'inherited' : 'own',
46
- usable: true,
47
- isDefault: false,
48
- usedBelow: [],
49
- ...extra
50
- }
51
- }
52
-
53
- const settings = (extra: Partial<AgentSettings> = {}): AgentSettings => ({
54
- chain: [plant, hq, group],
55
- agents: [agent('p1', plant), agent('h1', hq), agent('h2', hq, { turnedOff: true }), agent('g1', group)],
56
- defaultAgentId: 'h1',
57
- defaultFrom: 'inherited',
58
- state: 'configured',
59
- ...extra
60
- })
61
-
62
- describe('the card\'s groups', () => {
63
- it('★ this domain first, then each domain above closest first, named by its place when there are several', () => {
64
- expect(groupByOwner(settings()).map(one => [one.ownerId, one.inherited, one.path, one.agents.map(a => a.id)])).toEqual([
65
- ['plant', false, '그룹 › 본사 › 서울공장', ['p1']],
66
- ['hq', true, '그룹 › 본사', ['h1', 'h2']],
67
- ['group', true, '그룹', ['g1']]
68
- ])
69
- })
70
-
71
- it('a domain above with no agents has no group; this domain always has one', () => {
72
- const groups = groupByOwner(settings({ agents: [agent('g1', group)] }))
73
- expect(groups.map(one => one.ownerId)).toEqual(['plant', 'group'])
74
- })
75
- })
76
-
77
- describe('what the card saves', () => {
78
- it('★ only this domain\'s own agents are written, and an inherited default is not pinned here', () => {
79
- const input = saveInput(settings(), { kind: 'active', agentId: 'p1', active: false })
80
- expect(input.agents).toEqual([{ id: 'p1', name: 'P1', provider: 'openai', model: 'gpt-4o', active: false }])
81
- expect(input).not.toHaveProperty('defaultAgentId')
82
- expect(input.turnedOff).toEqual(['h2'])
83
- })
84
-
85
- it('★ picking a default writes this domain\'s own choice', () => {
86
- expect(saveInput(settings(), { kind: 'default', agentId: 'g1' })).toMatchObject({ defaultAgentId: 'g1' })
87
- })
88
-
89
- it('★ turning an inherited agent off here adds it to this domain\'s list; on again takes it out', () => {
90
- expect(saveInput(settings(), { kind: 'turn-off', agentId: 'h1', off: true }).turnedOff).toEqual(['h2', 'h1'])
91
- expect(saveInput(settings(), { kind: 'turn-off', agentId: 'h2', off: false }).turnedOff).toEqual([])
92
- })
93
-
94
- it('★ a new agent is appended with its key; an edit keeps the stored key when none was typed', () => {
95
- const added = saveInput(settings(), { kind: 'upsert', draft: { ...draftOf(), name: ' New ', provider: 'gemini', model: 'gemini-x', apiKey: ' k ' } })
96
- expect(added.agents.at(-1)).toEqual({ name: 'New', provider: 'gemini', model: 'gemini-x', active: true, apiKey: 'k' })
97
-
98
- const edited = saveInput(settings(), { kind: 'upsert', draft: { ...draftOf(agent('p1', plant)), model: 'gpt-4o-mini' } })
99
- expect(edited.agents).toEqual([{ id: 'p1', name: 'P1', provider: 'openai', model: 'gpt-4o-mini', active: true }])
100
- })
101
-
102
- it('an organization is only an OpenAI field', () => {
103
- const input = saveInput(settings(), { kind: 'upsert', draft: { ...draftOf(), name: 'C', provider: 'anthropic', model: 'c', organization: 'org-x' } })
104
- expect(input.agents.at(-1)).not.toHaveProperty('organization')
105
- })
106
-
107
- it('★ deleting the agent that was this domain\'s default drops the default with it', () => {
108
- const own = settings({ defaultAgentId: 'p1', defaultFrom: 'own' })
109
- expect(saveInput(own, { kind: 'delete', agentId: 'p1' })).toEqual({ agents: [], turnedOff: ['h2'] })
110
- })
111
-
112
- it('★ an inherited agent answered with this domain\'s key, and given back', () => {
113
- expect(saveInput(settings(), { kind: 'key-override', agentId: 'h1', apiKey: 'k' }).inheritedKeys).toEqual([{ agentId: 'h1', apiKey: 'k' }])
114
- expect(saveInput(settings(), { kind: 'key-clear', agentId: 'h1' }).inheritedKeys).toEqual([{ agentId: 'h1', clear: true }])
115
- })
116
- })
117
-
118
- it('a period runs from the start of its first day to the end of the hour in progress', () => {
119
- const now = new Date(2026, 9, 12, 14, 25)
120
- expect(periodRange('today', now)).toEqual({ from: new Date(2026, 9, 12, 0, 0), to: new Date(2026, 9, 12, 15, 0) })
121
- expect(periodRange('7d', now).from).toEqual(new Date(2026, 9, 6, 0, 0))
122
- expect(periodRange('30d', now).from).toEqual(new Date(2026, 8, 13, 0, 0))
123
- })
@@ -1,65 +0,0 @@
1
- /*
2
- * What an applied card wrote is read again by the screens that show it, and only by them (applied-screens.ts).
3
- */
4
- import { refreshAppliedScreens } from '../client/utils/applied-screens'
5
-
6
- function deps(page: { name?: string; dirty?: boolean; refresh?: boolean } = {}, shown?: { kind: string; id: string }) {
7
- const asked: any[] = []
8
- let read360 = false
9
- return {
10
- asked,
11
- read360: () => read360,
12
- deps: {
13
- page: () => ({
14
- name: page.name,
15
- element: page.refresh === false ? {} : { refresh: async (options?: any) => (asked.push(options), !page.dirty) }
16
- }),
17
- refresh360: (about: (subject: { kind: string; id: string }) => boolean) => (read360 = !!shown && about(shown))
18
- }
19
- }
20
- }
21
-
22
- const card = { target: 'office.counterparty', screen: 'counterparty-list' }
23
-
24
- describe('the screens behind the dock after a card is applied', () => {
25
- it('★ the page that is the card\'s screen reads again, never asking about unsaved edits', async () => {
26
- const one = deps({ name: 'counterparty-list' })
27
- await refreshAppliedScreens(card, ['a'], one.deps)
28
- expect(one.asked).toEqual([{ ask: false }])
29
- })
30
-
31
- it('★ a page with unsaved edits is left as it is, and that is said', async () => {
32
- const one = deps({ name: 'counterparty-list', dirty: true })
33
- expect(await refreshAppliedScreens(card, ['a'], one.deps)).toBe('kept-edits')
34
- expect(await refreshAppliedScreens(card, ['a'], deps({ name: 'counterparty-list' }).deps)).toBeUndefined()
35
- })
36
-
37
- it('★ another page keeps its rows and its scroll', async () => {
38
- const one = deps({ name: 'contract-list' })
39
- await refreshAppliedScreens(card, ['a'], one.deps)
40
- expect(one.asked).toEqual([])
41
- })
42
-
43
- it('a shell without the page refresh leaves the page as it is', async () => {
44
- await expect(refreshAppliedScreens(card, ['a'], deps({ name: 'counterparty-list', refresh: false }).deps)).resolves.toBeUndefined()
45
- })
46
-
47
- it('★ the shown 360 reads again when it is one of the records, or a record the card is about', async () => {
48
- const own = deps({}, { kind: 'counterparty', id: 'a' })
49
- await refreshAppliedScreens(card, ['a'], own.deps)
50
- expect(own.read360()).toBe(true)
51
-
52
- const other = deps({}, { kind: 'counterparty', id: 'z' })
53
- await refreshAppliedScreens(card, ['a'], other.deps)
54
- expect(other.read360()).toBe(false)
55
-
56
- const about = deps({}, { kind: 'contract', id: 'c' })
57
- await refreshAppliedScreens({ target: 'office.collection-match', axes: ['cash-transaction', 'contract'] }, ['l'], about.deps)
58
- expect(about.read360()).toBe(true)
59
- })
60
-
61
- it('a refresh that throws keeps the screen and the card', async () => {
62
- const failing = { page: () => ({ name: 'counterparty-list', element: { refresh: async () => { throw new Error('x') } } }), refresh360: () => { throw new Error('y') } }
63
- await expect(refreshAppliedScreens(card, ['a'], failing as any)).resolves.toBeUndefined()
64
- })
65
- })
@@ -1,92 +0,0 @@
1
- /*
2
- * What this guards: nothing sends the conversation's persona, tools, model or limits any more.
3
- *
4
- * ADR-0061 decision 7 took six fields off `assistantChat` with no compatibility field, on the
5
- * condition that a test counts the callers still passing them. Types catch a caller that compiles
6
- * against this source; an app compiled against an installed copy, or a hand-written GraphQL
7
- * document, would not be caught by anything else.
8
- */
9
- import { readFileSync, readdirSync, statSync } from 'fs'
10
- import path from 'path'
11
-
12
- const PACKAGES = path.resolve(__dirname, '../..')
13
- const MOVED = ['systemPrompt', 'toolCategories', 'model', 'temperature', 'maxTokens', 'requireGroundingTools']
14
-
15
- /** Source files only — a built copy of yesterday's source is not a call site. */
16
- function sources(dir: string, out: string[] = []): string[] {
17
- for (const entry of readdirSync(dir)) {
18
- if (entry === 'node_modules' || entry === 'dist-server' || entry === 'dist-client' || entry.startsWith('.')) continue
19
- const full = path.join(dir, entry)
20
- if (statSync(full).isDirectory()) sources(full, out)
21
- else if (/\.(ts|js)$/.test(entry)) out.push(full)
22
- }
23
- return out
24
- }
25
-
26
- const files = sources(PACKAGES)
27
- /* This file names the fields it looks for; counting itself would report itself. */
28
- .filter(file => !file.endsWith('assistant-chat-call-sites.test.ts'))
29
- .map(file => ({ file, text: readFileSync(file, 'utf-8') }))
30
-
31
- it('★ one place builds the neutral door input, and it sends none of the moved fields', () => {
32
- const builders = files.filter(f => f.text.includes('buildAssistantChatInput(')).map(f => path.relative(PACKAGES, f.file))
33
-
34
- expect(builders.sort()).toEqual(
35
- [
36
- 'ai-assistant/client/components/assistant-chat.ts',
37
- 'ai-assistant/client/components/chat-input-builder.test.ts',
38
- 'ai-assistant/client/components/chat-input-builder.ts'
39
- ].sort()
40
- )
41
-
42
- const builder = files.find(f => f.file.endsWith('chat-input-builder.ts'))!.text
43
- const neutral = builder.slice(builder.indexOf('export function buildAssistantChatInput'))
44
- for (const field of MOVED) expect(neutral).not.toContain(`args.${field}`)
45
- })
46
-
47
- it('★ no hand-written document sends the moved fields to assistantChat', () => {
48
- const offenders: string[] = []
49
- for (const { file, text } of files) {
50
- /* The mutation document, wherever it is written. */
51
- const at = text.indexOf('assistantChat(input:')
52
- if (at < 0) continue
53
- const document = text.slice(Math.max(0, at - 2000), at + 2000)
54
- for (const field of MOVED) {
55
- if (new RegExp(`${field}\\s*:`).test(document)) offenders.push(`${path.relative(PACKAGES, file)} → ${field}`)
56
- }
57
- }
58
-
59
- expect(offenders).toEqual([])
60
- })
61
-
62
- /*
63
- * `model` and `temperature` are left out here on purpose: a board surface passes `.model=` for the
64
- * board it is editing, and matching that would report the wrong thing. The door test above covers
65
- * them on the wire, which is where they mattered.
66
- */
67
- const ELEMENT_PROPERTIES = ['systemPrompt', 'toolCategories', 'requireGroundingTools']
68
-
69
- it('★ 긴 제안 상태 문구가 좁은 도크의 제목 폭을 0으로 밀어내지 않는다', () => {
70
- const source = readFileSync(path.resolve(__dirname, '../client/components/assistant-chat.ts'), 'utf-8')
71
- const proposalCss = source.slice(source.indexOf(' .proposal {'), source.indexOf(' .proposal-choices {'))
72
-
73
- expect(proposalCss).toContain('flex-wrap: wrap')
74
- expect(proposalCss).toContain('flex: 1 1 132px')
75
- expect(proposalCss).toContain('max-width: 100%')
76
- expect(proposalCss).toContain('overflow-wrap: anywhere')
77
- })
78
-
79
- it('★ no surface in this repo declares a conversation the server should own', () => {
80
- const offenders: string[] = []
81
- for (const { file, text } of files) {
82
- if (!/<ox-assistant-chat/.test(text)) continue
83
- if (file.includes('ai-assistant/client/components/')) continue
84
- for (const field of ELEMENT_PROPERTIES) {
85
- if (new RegExp(`\\.${field}=|${field.replace(/[A-Z]/g, c => '-' + c.toLowerCase())}=`).test(text)) {
86
- offenders.push(`${path.relative(PACKAGES, file)} → ${field}`)
87
- }
88
- }
89
- }
90
-
91
- expect(offenders).toEqual([])
92
- })
@@ -1,294 +0,0 @@
1
- /*
2
- * The shared AI dock's contract (design/ai/shared-dock.md §8) - checked once here instead of in every app.
3
- * The dock is read as text: importing it would pull the shell and i18n, which the runner cannot load.
4
- */
5
- import assert from 'node:assert/strict'
6
- import { readFileSync } from 'node:fs'
7
- import { join } from 'node:path'
8
-
9
- import { runProposal, registerProposalHandler } from '../client/utils/assistant-proposals'
10
-
11
- const read = (file: string) => readFileSync(join(__dirname, file), 'utf8')
12
- const code = (file: string) => read(file).replace(/\/\*[\s\S]*?\*\//g, '').replace(/^\s*\/\/.*$/gm, '')
13
- const dock = code('../client/components/assistant-dock.ts')
14
- /* Not comment-stripped: the chat has strings like 'image/*' that a comment regex would eat. */
15
- const chat = read('../client/components/assistant-chat.ts')
16
- const transport = read('../client/utils/assistant-session-transport.ts')
17
-
18
- describe('no empty panel', () => {
19
- it('not configured, unreadable, no surface and a stuck anchor are each said', () => {
20
- for (const key of ['not-configured', 'capability-unknown', 'no-surface']) assert.match(dock, new RegExp(`t\\('${key}'`))
21
- assert.match(dock, /if \(anchor && !isAnchor\(anchor\)\) return anchor\.message/)
22
- assert.match(dock, /readAiCapability\(\)/)
23
- })
24
-
25
- it('an unreadable capability offers a retry', () => {
26
- assert.match(dock, /this\.capability === 'unknown'\s*\?\s*html`<div><button class="sbtn" @click=\$\{\(\) => this\.open\(\)\}>/)
27
- })
28
-
29
- it('a surface can give the person one concrete next route', () => {
30
- assert.match(dock, /surface\?\.nextStep \? html`<div class="next-step" role="status">/)
31
- assert.match(dock, /<a href=\$\{surface\.nextStep\.href\}>\$\{surface\.nextStep\.label\(\)\}/)
32
- })
33
- })
34
-
35
- describe('the dock opens on every screen', () => {
36
- it('it stays on editors that bleed wide - the board modeller hides the aside bar', () => {
37
- assert.match(code('../client/setup-assistant-dock.ts'), /persistent: true/)
38
- })
39
- })
40
-
41
- describe('every request the chat makes is taken', () => {
42
- it('new conversation and proposal execute', () => {
43
- assert.match(dock, /addEventListener\('assistant-start-new-session'/)
44
- assert.match(dock, /@assistant-proposal-execute=\$\{this\.onProposal\}/)
45
- })
46
-
47
- it('a board surface gets the scene edits, reverts and actions', () => {
48
- for (const event of ['scene-edit-patch', 'board-edit-revert', 'scene-action-execute']) assert.match(dock, new RegExp(`@${event}=`))
49
- })
50
-
51
- it('the toolbar opens the manager, and the manager asks with the same events', () => {
52
- assert.match(dock, /historyEnabled/)
53
- assert.match(dock, /@assistant-session-history=/)
54
- assert.match(dock, /<ox-assistant-session-manager/)
55
- })
56
- })
57
-
58
- describe('every proposal ends in one reported outcome', () => {
59
- it('the dock reports whatever the handler returned', () => {
60
- assert.match(dock, /const outcome: ProposalOutcome =[\s\S]*await runProposal\(proposal, this\.proposalContext\(sessionId\)\)[\s\S]*const \{ records, \.\.\.reported \} = outcome\s*await this\.report\(sessionId, proposalKey, reported\)/)
61
- })
62
-
63
- it('★ an applied card has the screens that show its records read them again - not a refused one', () => {
64
- assert.match(dock, /if \(outcome\.verdict === 'accepted' && \(outcome\.applied \?\? 1\) > 0\)\s*void refreshAppliedScreens\(proposal, records, APPLIED_SCREENS\)\.then\(kept => \{\s*if \(kept\) notify\(\{ level: 'info', message: t\('screen-kept-edits'/)
65
- assert.match(dock, /page: \(\) => \{\s*const route = \(store\.getState\(\) as any\)\?\.route \?\? \{\}\s*return \{ name: route\.page, element: route\.activePage \}/)
66
- })
67
-
68
- it('a kind nobody handles is unavailable, by name', async () => {
69
- const outcome = await runProposal({ tool: 'proposeNothingKnown' }, {} as any)
70
- assert.deepEqual(outcome, { verdict: 'unavailable', errorCode: 'unknown-proposal-kind' })
71
- })
72
-
73
- it('a handler that throws is refused with its message, never a silent pass', async () => {
74
- registerProposalHandler('proposeThrows', async () => {
75
- throw new Error('kernel-refused')
76
- })
77
- assert.deepEqual(await runProposal({ tool: 'proposeThrows' }, {} as any), { verdict: 'refused', errorCode: 'kernel-refused' })
78
- })
79
-
80
- it('a handler that answers nothing is not taken as done', async () => {
81
- registerProposalHandler('proposeSilent', async () => undefined as any)
82
- assert.deepEqual(await runProposal({ tool: 'proposeSilent' }, {} as any), { verdict: 'unavailable', errorCode: 'no-outcome' })
83
- })
84
-
85
- it('a handler that asks the person uses the platform confirm', () => {
86
- assert.match(dock, /OxPrompt\.open\(/)
87
- })
88
- })
89
-
90
- describe('sessions', () => {
91
- it('the key carries the conversation kind', () => {
92
- assert.match(dock, /scope: JSON\.stringify\(\[this\.app\.contextPath, userId, this\.kind\]\)/)
93
- })
94
-
95
- it('★ a screen opens its one conversation - nothing to pick, nothing to follow (design/ai/screen-pattern.md §3)', () => {
96
- assert.match(dock, /assistantModeFor\(subject: \$subject\)/)
97
- assert.match(dock, /this\.kind = mode\?\.kind \?\? ''/)
98
- assert.doesNotMatch(dock, /chosenKind|onModeChange|assistant-mode-change|followPickedConversation/)
99
- })
100
- })
101
-
102
- describe('what is being written stays with its conversation (ADR-0072 rule, ruled 2026-10-13)', () => {
103
- const chat = readFileSync(join(__dirname, '../client/components/assistant-chat.ts'), 'utf8')
104
-
105
- it('★ the unsent text and the attachments both leave the box with the conversation, and come back to it', () => {
106
- const take = chat.slice(chat.indexOf(' takeDraft()'), chat.indexOf(' restoreDraft('))
107
- assert.match(take, /const draft = \{ text: this\.input, attachments: this\.attachments \}/)
108
- assert.match(take, /this\.input = ''\s+this\.attachments = \[\]/)
109
- const restore = chat.slice(chat.indexOf(' restoreDraft('), chat.indexOf(' restoreDraft(') + 200)
110
- assert.match(restore, /this\.input = draft\.text\s+this\.attachments = draft\.attachments/)
111
- })
112
-
113
- it('★ the dock keeps it per subject when the page moves, except when the person signed in changed', () => {
114
- assert.match(dock, /if \(transition !== 'reset'\) this\.keepDraft\(\)/)
115
- assert.match(dock, /if \(draft\) this\.drafts\.set\(this\.openedFor!, draft\)/)
116
- assert.match(dock, /void this\.restoreDraft\(\)/)
117
- })
118
-
119
- it('★ a page change while answering waits for the answer - it lands in the conversation it was asked in', () => {
120
- assert.match(dock, /if \(!force && transition === 'wait'\) \{[\s\S]{0,160}this\.followWhenIdle\(\)/)
121
- })
122
- })
123
-
124
- describe('the screen is checked at send time', () => {
125
- it('a send after the screen moved on is refused', () => {
126
- assert.match(dock, /if \(openedFor !== this\.scopeKey\(currentAssistantSurface\(\)\) \|\| this\.openedIdentity !== this\.identityKey\(\)\) throw new Error/)
127
- })
128
-
129
- it('the draft is read at send time, never cached', () => {
130
- assert.match(dock, /return \{ hostContext: surface\?\.hostContext\?\.\(\) \?\? \{\} \}/)
131
- })
132
- })
133
-
134
- describe('the dock knows no application', () => {
135
- it('no app names and no proposal kinds in the dock', () => {
136
- assert.doesNotMatch(dock, /\b(twin|plant|figure|warehouse|ecs|operato-[a-z]+)\b/i)
137
- assert.doesNotMatch(dock, /'propose[A-Z]\w*'/)
138
- })
139
- })
140
-
141
- describe('attachments in the chat follow the mode', () => {
142
- it('no attach button when the mode declares nothing (the board door keeps its images)', () => {
143
- assert.match(chat, /this\.acceptsAttachments\s*\?\s*html`<button/)
144
- assert.match(chat, /return !this\.usesAttachmentPolicy \|\| !!this\.modeView\?\.attachments\?\.kinds\?\.length/)
145
- })
146
-
147
- it('said before sending, then uploaded to the conversation and sent by id', () => {
148
- assert.match(chat, /refuseAttachments\(\s*this\.modeView\?\.attachments/)
149
- assert.match(chat, /mutation: ATTACH_TO_CONVERSATION_MUTATION/)
150
- /* Without it the client sends the File as {} and the server refuses the upload (found on :3700, 2026-09-25). */
151
- assert.match(chat, /context: \{ hasUpload: true \}/)
152
- /* Sent with the turn's input - the agent the person picked follows it (design/ai/agent-settings.md §5). */
153
- assert.match(chat, /\n\s*attachmentIds,\s*\n\s*agentId: this\.agentId,\s*\n\s*page: \(store\.getState\(\) as any\)\?\.route\?\.page \|\| undefined\s*\n\s*\}\)/)
154
- })
155
-
156
- it('a stored file opens through the conversation route', () => {
157
- assert.match(chat, /chatAttachmentUrl\(this\.sessionId, att\.id\)/)
158
- })
159
- })
160
-
161
- describe('what twin needed of the dock', () => {
162
- it('a surface that says its words changed repaints the header without reopening the conversation', () => {
163
- assert.match(dock, /transition === 'refresh'\) \{\s*this\.surface = next\s*this\.requestUpdate\(\)\s*return/)
164
- })
165
-
166
- it('a question with no conversation to go to is said now, never sent later; a draft waits', () => {
167
- assert.match(dock, /if \(waiting\.ask\) notify\(/)
168
- assert.match(dock, /else holdAssistantAsk\(waiting\)/)
169
- /* Taken when the opening ends whatever it found - a stuck anchor is said by takeAsk at once. */
170
- assert.match(dock, /this\.loading = false\s*if \(this\.anchor\) void this\.takeAsk\(\)/)
171
- assert.match(dock, /if \(!isAnchor\(this\.anchor\)\) \{/)
172
- })
173
-
174
- it('a handler\'s note stays in the conversation after its outcome is reported', () => {
175
- assert.match(dock, /await this\.report\(sessionId, proposalKey, outcome\)\s*if \(outcome\.note && sessionId\) await this\.appendNote\(sessionId, outcome\.note\)/)
176
- })
177
-
178
- it('a carried conversation that could not be made is said, not swallowed', () => {
179
- assert.match(dock, /this\.startCarried\(ask\)\.catch\(\(?\w*\)? => \{\s*notify\(\{ level: 'error'/)
180
- })
181
-
182
- it('★ a request made on the screen is never dropped while an answer is written - it waits and is taken after', () => {
183
- const busy = dock.slice(dock.indexOf('if (this.navigationState.busy) {', dock.indexOf('private async takeAsk')), dock.indexOf('if (this.navigationState.draft', dock.indexOf('private async takeAsk')))
184
- assert.match(busy, /this\.takeWhenIdle\(\)\s*return/)
185
- assert.doesNotMatch(busy, /takeAssistantAsk\(\)/)
186
- })
187
-
188
- it('★ unsent words are asked about before a new request takes the dock - never dropped without asking', () => {
189
- assert.match(dock, /if \(this\.navigationState\.draft && !\(await this\.mayLeaveConversation\(\)\)\) \{\s*const waiting = takeAssistantAsk\(\)/)
190
- })
191
-
192
- it('a note is drawn without the line only the model reads', () => {
193
- assert.match(chat, />\$\{noteForDisplay\(content\)\}<\/span/)
194
- })
195
-
196
- it('★ and nothing is sent into the previous conversation after it - the request depended on the context that failed', () => {
197
- assert.match(dock, /this\.startCarried\(ask\)\.catch\([\s\S]*?return undefined\s*\}\)[\s\S]{0,200}?if \(!id\) return\n/)
198
- })
199
- })
200
-
201
- describe('closing and opening the dock again (design/ai/shared-dock.md §2-1, §2-7)', () => {
202
- const setup = code('../client/setup-assistant-dock.ts')
203
- const between = (text: string, from: string, to: string) => text.slice(text.indexOf(from), text.indexOf(to, text.indexOf(from)))
204
-
205
- it('★ the viewpart puts back one dock - a template that makes the element makes a new dock on every opening', () => {
206
- assert.match(setup, /const dock = document\.createElement\('ox-assistant-dock'\)/)
207
- assert.match(setup, /template: html`\$\{dock\}`/)
208
- assert.doesNotMatch(setup, /<ox-assistant-dock[\s>]/)
209
- })
210
-
211
- it('★ closing keeps the conversation - no reset, no cancelled opening', () => {
212
- const closing = between(dock, 'disconnectedCallback() {', 'super.disconnectedCallback()')
213
- assert.doesNotMatch(closing, /controller\.clear\(\)/)
214
- assert.doesNotMatch(closing, /this\.revision\+\+/)
215
- })
216
-
217
- it('★ opening again follows what moved, it does not open the conversation anew', () => {
218
- const opening = between(dock, 'connectedCallback() {', 'disconnectedCallback() {')
219
- assert.match(opening, /if \(!this\.openedIdentity\) return this\.follow\(true\)/)
220
- assert.match(opening, /setOpenSession\(this\.sessionId\)\s*this\.follow\(\)/)
221
- })
222
-
223
- it('★ the chat put back reads its conversation again and starts its broadcast and presence again', () => {
224
- const opening = between(chat, ' connectedCallback() {', ' private async onSubjectChanged()')
225
- assert.match(opening, /if \(this\.hasUpdated && this\.sessionId\) \{\s*this\.loadHistory\(\)\s*this\._startPresence\(\)\s*this\._startMessageSubscription\(\)/)
226
- })
227
- })
228
-
229
- /*
230
- * A screen request (「AI와 작업」) - design/ai/shared-dock.md §2-11-1, the user (2026-10-24): 「"AI와 작업" 기능이 unstable
231
- * 하다. 작동 방식을 신뢰할 수 있도록 새로운 세션을 여는지, 기존 세션을 활용하는지 등등을 명확하게 하라.」 One test per rule.
232
- */
233
- describe('a screen request', () => {
234
- const take = dock.slice(dock.indexOf('private async takeScreenRequest()'), dock.indexOf('\n }\n', dock.indexOf('private async takeScreenRequest()')))
235
- const send = chat.slice(chat.indexOf('async sendScreenRequest('), chat.indexOf('\n }\n', chat.indexOf('async sendScreenRequest(')))
236
-
237
- it('★ a request that reopens this screen\'s conversation is taken once the opening is done - never while it loads', () => {
238
- const opening = dock.slice(dock.indexOf('private async open(): Promise<void> {'), dock.indexOf('private target('))
239
- const [body, rest] = opening.split('} finally {')
240
- /* takeAsk passes while loading: called inside the opening, the request stayed waiting and was never sent. */
241
- assert.doesNotMatch(body, /this\.takeAsk\(\)/)
242
- assert.match(rest, /this\.loading = false\s*if \(this\.anchor\) void this\.takeAsk\(\)/)
243
- assert.match(dock, /private async takeAsk\(\) \{\s*if \(this\.loading \|\| !this\.anchor\) return/)
244
- })
245
-
246
- it('goes its own way - a request carrying a selection is a screen request', () => {
247
- assert.match(dock, /if \(peekAssistantAsk\(\)\?\.selection\) return this\.takeScreenRequest\(\)/)
248
- })
249
-
250
- it('★ 1. to this screen\'s conversation - never a new one; another screen\'s conversation open comes back here', () => {
251
- assert.doesNotMatch(take, /newConversation|startCarried|createAISession|controller\.reset|conversationView\+\+/)
252
- assert.match(take, /if \(this\.scopeKey\(here\) !== this\.openedFor[^\n]*\) \{\s*(?:\/\*[^*]*\*\/\s*)?this\.keepDraft\(\)\s*this\.surface = here\s*await this\.open\(\)/)
253
- assert.match(take, /this\.showingHistory = false/)
254
- /* Someone else's open conversation the dock showed by default is not this person's - their own is started (draft along). */
255
- assert.match(take, /if \(this\.sessions\.find\(one => one\.id === this\.sessionId\)\?\.participant === false\) await this\.goToOwnConversation\(\)/)
256
- /* ...and that is their own most recent one here, a new one only when they have none. */
257
- assert.match(dock, /const own = this\.sessions\.find\(one => one\.participant !== false && one\.id !== this\.sessionId\)/)
258
- assert.match(dock, /if \(own\) \{\s*if \(this\.controller\.select\(own\.id\)\) this\.conversationView\+\+\s*\} else \{\s*await this\.controller\.reset\(\)/)
259
- assert.match(transport, /participant\}\}/)
260
- /* No conversation yet: the chat makes this screen's one on sending, through the controller - never a second. */
261
- assert.match(send, /if \(!this\.sessionId && this\.prepareSession\) \{\s*await this\.prepareSession\(/)
262
- })
263
-
264
- it('★ 2. the selection is noted for that turn, before the request', () => {
265
- assert.match(take, /chat\.sendScreenRequest\(request, selectionNote\(ask\.selection!, t\)\)/)
266
- const noted = send.indexOf('APPEND_SESSION_NOTE_MUTATION')
267
- assert.ok(noted > 0 && noted < send.indexOf('await this.send()'))
268
- })
269
-
270
- it('★ 3. sent, always - the request goes out, never as a draft', () => {
271
- assert.match(send, /this\.input = text\s*await this\.send\(\)/)
272
- assert.doesNotMatch(take, /asking|draft:/)
273
- assert.match(take, /ask\.ask\?\.trim\(\) \|\| t\('screen-request-default'/)
274
- })
275
-
276
- it('★ 4. what the person was writing is set aside and put back', () => {
277
- assert.match(send, /const kept = this\.takeDraft\(\)/)
278
- assert.match(send, /finally \{[\s\S]*if \(kept && !this\.input\.trim\(\) && !this\.attachments\.length\) this\.restoreDraft\(kept\)/)
279
- assert.match(send, /if \(this\.input\.trim\(\) === text\.trim\(\)\) this\.input = ''/)
280
- })
281
-
282
- it('★ 5. not sent: said, and the screen is told', () => {
283
- assert.match(take, /const fail = \(reason: string\) => \{\s*notify\(\{ level: 'error', message: reason \}\)\s*settleAssistantAsk\(ask, \{ sent: false, reason \}\)/)
284
- assert.match(take, /if \(!outcome\?\.sent\) return fail\(/)
285
- assert.match(take, /settleAssistantAsk\(ask, \{ sent: true \}\)/)
286
- })
287
-
288
- it('★ 6. an answer being written: said once, and the request goes right after it', () => {
289
- const busy = take.slice(take.indexOf('if (this.navigationState.busy)'), take.indexOf('const here'))
290
- assert.match(busy, /notify\(\{ level: 'info', message: t\('screen-request-waits'/)
291
- assert.match(busy, /this\.takeWhenIdle\(\)\s*return/)
292
- assert.doesNotMatch(busy, /takeAssistantAsk\(\)/)
293
- })
294
- })