moi-computer 0.10.1-next.6 → 0.11.1-dev.1c52199

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 (406) hide show
  1. package/README.md +2 -2
  2. package/client/AGENTS.md +2 -2
  3. package/client/api/app-config.ts +2 -1
  4. package/client/app/AppRouter.tsx +2 -2
  5. package/client/app/routes/WorkspaceRoute.tsx +33 -27
  6. package/client/app/shell/SidebarLayout.tsx +18 -15
  7. package/client/components/shared/BottomPanel.tsx +26 -14
  8. package/client/components/shared/PanelHeader.tsx +1 -1
  9. package/client/components/shared/ReorderableList.tsx +7 -2
  10. package/client/components/shared/WorkspaceIcon.tsx +92 -0
  11. package/client/components/ui/alert-dialog.tsx +1 -0
  12. package/client/components/ui/button.tsx +1 -53
  13. package/client/components/ui/checkbox.tsx +1 -0
  14. package/client/components/ui/collapsible.tsx +1 -15
  15. package/client/components/ui/dialog.tsx +1 -58
  16. package/client/components/ui/dropdown-menu.tsx +1 -254
  17. package/client/components/ui/hover-card.tsx +1 -44
  18. package/client/components/ui/inline-input.tsx +84 -0
  19. package/client/components/ui/input.tsx +1 -21
  20. package/client/components/ui/popover.tsx +1 -88
  21. package/client/components/ui/resizable.tsx +1 -40
  22. package/client/components/ui/skeleton.tsx +1 -13
  23. package/client/components/ui/slider.tsx +1 -70
  24. package/client/components/ui/spinner.tsx +1 -18
  25. package/client/components/ui/switch.tsx +1 -23
  26. package/client/components/ui/tabs.tsx +1 -0
  27. package/client/components/ui/textarea.tsx +1 -18
  28. package/client/components/ui/toast.tsx +2 -2
  29. package/client/components/ui/tooltip.tsx +1 -51
  30. package/client/features/applets/AppletMount.tsx +5 -2
  31. package/client/features/applets/applet-cache.ts +3 -3
  32. package/client/features/applets/applet-runtime.ts +158 -108
  33. package/client/features/applets/applet-styles.ts +2 -2
  34. package/client/features/applets/applet-thumbnail.ts +6 -8
  35. package/client/features/applets/useApplet.ts +10 -9
  36. package/client/features/chat/ChatPanel.tsx +24 -15
  37. package/client/features/chat/ChatPopup.tsx +9 -5
  38. package/client/features/chat/applet-chat-intents.ts +179 -0
  39. package/client/features/chat/chat-send.ts +116 -64
  40. package/client/features/chat/chat-store.ts +51 -62
  41. package/client/features/chat/composer/ChatComposer.tsx +43 -128
  42. package/client/features/chat/composer/ModelPicker.tsx +47 -60
  43. package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
  44. package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
  45. package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
  46. package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
  47. package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
  48. package/client/features/chat/composer/attachments/types.ts +25 -0
  49. package/client/features/chat/composer/attachments/uploads.ts +26 -0
  50. package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
  51. package/client/features/chat/composer/model-order.ts +15 -0
  52. package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
  53. package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
  54. package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +10 -8
  55. package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
  56. package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
  57. package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +27 -19
  58. package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +12 -0
  59. package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +7 -11
  60. package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
  61. package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
  62. package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +2 -5
  63. package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +4 -1
  64. package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
  65. package/client/features/chat/{api.ts → sessions/api.ts} +5 -14
  66. package/client/features/chat/sessions/session-view.ts +53 -0
  67. package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +64 -20
  68. package/client/features/chat/useChat.ts +46 -24
  69. package/client/features/collab/DevCollabIdentity.tsx +170 -0
  70. package/client/features/collab/DevCollabKit.tsx +501 -0
  71. package/client/features/collab/DevCollabPage.tsx +25 -0
  72. package/client/features/collab/WorkspaceCollabControls.tsx +313 -0
  73. package/client/features/collab/client.ts +146 -0
  74. package/client/features/collab/components.tsx +307 -0
  75. package/client/features/collab/dev-persona.ts +66 -0
  76. package/client/features/collab/engine.ts +96 -0
  77. package/client/features/collab/entry.tsx +35 -0
  78. package/client/features/collab/facehash-avatar.ts +132 -0
  79. package/client/features/collab/fake-engine.ts +130 -0
  80. package/client/features/collab/hooks.tsx +253 -0
  81. package/client/features/collab/identity.ts +305 -0
  82. package/client/features/collab/index.ts +45 -0
  83. package/client/features/collab/people.ts +102 -0
  84. package/client/features/collab/personal-state.ts +61 -0
  85. package/client/features/collab/presence-publisher.ts +29 -0
  86. package/client/features/collab/presence-target.ts +10 -0
  87. package/client/features/collab/primitives.tsx +398 -0
  88. package/client/features/collab/proxy-identity.ts +24 -0
  89. package/client/features/collab/store.ts +156 -0
  90. package/client/features/dev/ChatStatesPage.tsx +8 -7
  91. package/client/features/dev/DevIndexPage.tsx +10 -0
  92. package/client/features/dev/DevRoutes.tsx +16 -1
  93. package/client/features/dev/HarnessDebugPage.tsx +11 -8
  94. package/client/features/dev/ToolCallsPage.tsx +1 -1
  95. package/client/features/dev/UiComponentPreviews.tsx +855 -0
  96. package/client/features/dev/UiComponentsPage.tsx +60 -0
  97. package/client/features/dev/chat-states-fixtures.ts +13 -2
  98. package/client/features/drawings/capture-element.ts +13 -1
  99. package/client/features/drawings/useChatAnnotation.ts +17 -17
  100. package/client/features/drawings/useDrawingLayer.ts +7 -9
  101. package/client/features/drawings/useViewBuilderSketch.ts +18 -15
  102. package/client/features/home/HomePage.tsx +8 -7
  103. package/client/features/home/WorkspacePreview.tsx +2 -2
  104. package/client/features/home/workspace-presentation.tsx +1 -11
  105. package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
  106. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
  107. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
  108. package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
  109. package/client/features/overview/HiddenPanel.tsx +109 -0
  110. package/client/features/overview/Overview.tsx +302 -0
  111. package/client/features/overview/WidgetCanvas.tsx +164 -0
  112. package/client/features/{widgets → overview}/WidgetFrame.tsx +25 -17
  113. package/client/features/overview/WorkspaceName.tsx +60 -0
  114. package/client/features/overview/api.ts +30 -0
  115. package/client/features/overview/default/ViewsWidget.tsx +252 -0
  116. package/client/features/overview/default/registry.tsx +36 -0
  117. package/client/features/{widgets → overview}/grid.ts +36 -0
  118. package/client/features/overview/useGridReconcile.ts +94 -0
  119. package/client/features/scratchpad/Scratchpad.tsx +7 -8
  120. package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
  121. package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
  122. package/client/features/settings/GeneralSettings.tsx +55 -58
  123. package/client/features/settings/SettingsLayout.tsx +2 -2
  124. package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
  125. package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
  126. package/client/features/settings/api.ts +48 -24
  127. package/client/features/views/ViewBuilder.tsx +5 -4
  128. package/client/features/views/ViewManager.tsx +28 -22
  129. package/client/features/views/api.ts +36 -2
  130. package/client/features/views/useViewBuilderActions.ts +11 -5
  131. package/client/features/views/useViewBuilderDrafts.ts +23 -21
  132. package/client/features/views/view-presentation.ts +13 -0
  133. package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
  134. package/client/features/workspace/UnavailablePage.tsx +21 -0
  135. package/client/features/workspace/WorkspaceLayoutContext.tsx +22 -10
  136. package/client/features/workspace/WorkspaceScreen.tsx +228 -172
  137. package/client/features/workspace/WorkspaceSplitLayout.tsx +7 -2
  138. package/client/features/workspace/WorkspaceTabs.tsx +2 -0
  139. package/client/features/workspace/api.ts +5 -31
  140. package/client/features/workspace/layout-save.ts +13 -0
  141. package/client/features/workspace/moi-context.ts +15 -11
  142. package/client/features/workspace/tab-resolution.ts +10 -33
  143. package/client/features/workspace/useWorkspaceNavigation.ts +173 -101
  144. package/client/index.css +23 -30
  145. package/client/index.tsx +4 -3
  146. package/client/lib/app-icon-registry.ts +2 -0
  147. package/client/lib/use-latest-ref.ts +11 -0
  148. package/client/main.tsx +1 -1
  149. package/client/runtime/useWorkspaceEvents.ts +59 -14
  150. package/client/theme.css +5 -5
  151. package/dist/chunk-1ftessc8.js +2 -0
  152. package/dist/chunk-3802vh2p.js +2 -0
  153. package/dist/chunk-542a2m9m.js +1 -0
  154. package/dist/chunk-5745d83v.js +2 -0
  155. package/dist/chunk-5zxdsjym.js +1 -0
  156. package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
  157. package/dist/chunk-7r4z77ry.js +2 -0
  158. package/dist/chunk-9cm0wjah.js +79 -0
  159. package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
  160. package/dist/chunk-cvgdm1hq.js +2 -0
  161. package/dist/chunk-gptm4jpd.js +546 -0
  162. package/dist/chunk-nf2wkvf9.js +14 -0
  163. package/dist/chunk-wnmf38ta.js +5 -0
  164. package/dist/chunk-xaehhr1j.css +1 -0
  165. package/dist/chunk-xpt063fx.js +1 -0
  166. package/dist/index.html +1 -1
  167. package/lib/app-icons.ts +1 -0
  168. package/lib/applet-selector.ts +24 -0
  169. package/lib/chat-title.ts +6 -1
  170. package/lib/collab/colors.ts +24 -0
  171. package/lib/collab/protocol.ts +83 -0
  172. package/lib/collab/types.ts +63 -0
  173. package/lib/default-widgets.ts +32 -0
  174. package/lib/experimental.ts +14 -0
  175. package/lib/format.ts +67 -7
  176. package/lib/message-attachments.ts +40 -0
  177. package/lib/moi-attachments.ts +204 -0
  178. package/lib/moi-context.ts +27 -35
  179. package/lib/navigation.ts +84 -0
  180. package/lib/themes.ts +6 -6
  181. package/lib/types.ts +103 -40
  182. package/lib/workspace-icon.ts +20 -0
  183. package/lib/workspace-layout.ts +22 -2
  184. package/lib/workspace-tabs.ts +9 -33
  185. package/package.json +44 -32
  186. package/registry.json +656 -0
  187. package/server/AGENTS.md +2 -0
  188. package/server/agent.ts +1 -1
  189. package/server/api.ts +162 -68
  190. package/server/app-config.ts +127 -34
  191. package/server/applet-typecheck.ts +100 -0
  192. package/server/applets/applet-css.ts +55 -0
  193. package/server/{bundler → applets}/build-applet.ts +21 -240
  194. package/server/applets/build-worker.ts +178 -0
  195. package/server/applets/config.ts +226 -0
  196. package/server/applets/dependencies.ts +206 -0
  197. package/server/{applets.ts → applets/index.ts} +44 -189
  198. package/server/applets/runtime/base.ts +4 -0
  199. package/server/applets/runtime/moi.ts +42 -0
  200. package/server/applets/runtime/rpc.ts +17 -0
  201. package/server/applets/view-source.ts +67 -0
  202. package/server/attachment-message.ts +95 -0
  203. package/server/chat-selection.ts +23 -0
  204. package/server/cli-ui-components.ts +28 -33
  205. package/server/cli.ts +226 -120
  206. package/server/collab/applet-module.ts +50 -0
  207. package/server/collab/cloudflare-access.ts +77 -0
  208. package/server/collab/config.ts +18 -0
  209. package/server/collab/ipc.ts +10 -0
  210. package/server/collab/manager.ts +407 -0
  211. package/server/collab/service.ts +137 -0
  212. package/server/collab/skill/collab-env.d.ts +92 -0
  213. package/server/collab/skill/index.ts +59 -0
  214. package/server/collab/worker.ts +52 -0
  215. package/server/control.ts +63 -42
  216. package/server/data-dir.ts +1 -1
  217. package/server/harness/README.md +45 -50
  218. package/server/harness/acp/NOTES.md +426 -0
  219. package/server/harness/acp/adapter.ts +7 -21
  220. package/server/harness/acp/discovery.ts +27 -30
  221. package/server/harness/acp/model-state.ts +57 -0
  222. package/server/harness/acp/session.ts +49 -56
  223. package/server/harness/claude-code/NOTES.md +54 -13
  224. package/server/harness/claude-code/adapter.ts +8 -25
  225. package/server/harness/claude-code/cli.ts +40 -0
  226. package/server/harness/claude-code/index.ts +13 -5
  227. package/server/harness/claude-code/models.ts +72 -19
  228. package/server/harness/claude-code/session.ts +447 -343
  229. package/server/harness/claude-code/sessions.ts +9 -4
  230. package/server/harness/codex/NOTES.md +222 -350
  231. package/server/harness/codex/adapter.ts +102 -52
  232. package/server/harness/codex/auth.ts +1 -3
  233. package/server/harness/codex/client.ts +169 -249
  234. package/server/harness/codex/discovery.ts +9 -17
  235. package/server/harness/codex/index.ts +3 -1
  236. package/server/harness/codex/pagination.ts +24 -0
  237. package/server/harness/codex/permissions.ts +32 -8
  238. package/server/harness/codex/probe.ts +10 -13
  239. package/server/harness/codex/session.ts +567 -181
  240. package/server/harness/codex/transport.ts +184 -0
  241. package/server/harness/debug.ts +1 -1
  242. package/server/harness/hermes/NOTES.md +19 -1
  243. package/server/harness/hermes/discovery.ts +20 -0
  244. package/server/harness/hermes/index.ts +13 -0
  245. package/server/harness/hermes/models.ts +28 -8
  246. package/server/harness/openclaw/NOTES.md +1 -1
  247. package/server/harness/openclaw/adapter.ts +22 -4
  248. package/server/harness/openclaw/gateway.ts +5 -3
  249. package/server/harness/openclaw/session.ts +27 -27
  250. package/server/harness/types.ts +9 -5
  251. package/server/layout.ts +24 -16
  252. package/server/moi-scaffold.ts +22 -14
  253. package/server/navigation-relay.ts +110 -0
  254. package/server/preview.ts +3 -1
  255. package/server/registry.ts +71 -41
  256. package/server/scratchpad-executor.ts +79 -56
  257. package/server/scratchpad-shape-defaults.ts +82 -0
  258. package/server/selected-session.ts +24 -4
  259. package/server/skill-update.ts +5 -3
  260. package/server/skill-version.ts +4 -7
  261. package/server/skills-template.ts +60 -9
  262. package/server/tabs.ts +19 -33
  263. package/server/tldraw-package.d.ts +4 -0
  264. package/server/ui-components.ts +101 -434
  265. package/server/uploads.ts +0 -0
  266. package/server/view-builders.ts +20 -2
  267. package/server/views.ts +126 -6
  268. package/server/web.ts +108 -30
  269. package/server/widgets.ts +12 -5
  270. package/server/workspace-config.ts +13 -9
  271. package/server/workspace-env.ts +3 -2
  272. package/tsconfig.json +0 -1
  273. package/ui-components/accordion.tsx +71 -0
  274. package/ui-components/alert-dialog.tsx +165 -0
  275. package/ui-components/alert.tsx +68 -0
  276. package/ui-components/attachment.tsx +195 -0
  277. package/ui-components/avatar.tsx +91 -0
  278. package/ui-components/badge.tsx +49 -0
  279. package/ui-components/button-group.tsx +78 -0
  280. package/ui-components/button.tsx +55 -0
  281. package/ui-components/calendar.tsx +180 -0
  282. package/ui-components/card.tsx +84 -0
  283. package/ui-components/carousel.tsx +235 -0
  284. package/ui-components/chart.tsx +338 -0
  285. package/ui-components/checkbox.tsx +28 -0
  286. package/ui-components/collapsible.tsx +15 -0
  287. package/ui-components/combobox.tsx +267 -0
  288. package/ui-components/context-menu.tsx +244 -0
  289. package/ui-components/dialog.tsx +138 -0
  290. package/ui-components/docs/accordion.md +463 -0
  291. package/ui-components/docs/alert-dialog.md +481 -0
  292. package/ui-components/docs/alert.md +301 -0
  293. package/ui-components/docs/attachment.md +689 -0
  294. package/ui-components/docs/avatar.md +495 -0
  295. package/ui-components/docs/badge.md +258 -0
  296. package/ui-components/docs/button-group.md +879 -0
  297. package/ui-components/docs/button.md +26 -0
  298. package/ui-components/docs/calendar.md +862 -0
  299. package/ui-components/docs/card.md +265 -0
  300. package/ui-components/docs/carousel.md +627 -0
  301. package/ui-components/docs/chart.md +1256 -0
  302. package/ui-components/docs/checkbox.md +477 -0
  303. package/ui-components/docs/collapsible.md +446 -0
  304. package/ui-components/docs/combobox.md +1003 -0
  305. package/ui-components/docs/context-menu.md +860 -0
  306. package/ui-components/docs/data-table.md +1580 -0
  307. package/ui-components/docs/date-picker.md +614 -0
  308. package/ui-components/docs/dialog.md +414 -0
  309. package/ui-components/docs/drawer.md +51 -0
  310. package/ui-components/docs/dropdown-menu.md +1000 -0
  311. package/ui-components/docs/field.md +1192 -0
  312. package/ui-components/docs/hover-card.md +275 -0
  313. package/ui-components/docs/input-group.md +866 -0
  314. package/ui-components/docs/input.md +456 -0
  315. package/ui-components/docs/kbd.md +191 -0
  316. package/ui-components/docs/label.md +295 -0
  317. package/ui-components/docs/pagination.md +416 -0
  318. package/ui-components/docs/popover.md +348 -0
  319. package/ui-components/docs/progress.md +214 -0
  320. package/ui-components/docs/radio-group.md +389 -0
  321. package/ui-components/docs/resizable.md +265 -0
  322. package/ui-components/docs/select.md +616 -0
  323. package/ui-components/docs/separator.md +216 -0
  324. package/ui-components/docs/skeleton.md +205 -0
  325. package/ui-components/docs/slider.md +226 -0
  326. package/ui-components/docs/spinner.md +332 -0
  327. package/ui-components/docs/switch.md +236 -0
  328. package/ui-components/docs/table.md +551 -0
  329. package/ui-components/docs/tabs.md +379 -0
  330. package/ui-components/docs/textarea.md +187 -0
  331. package/ui-components/docs/toggle-group.md +370 -0
  332. package/ui-components/docs/toggle.md +91 -0
  333. package/ui-components/docs/tooltip.md +290 -0
  334. package/ui-components/drawer.tsx +213 -0
  335. package/ui-components/dropdown-menu.tsx +263 -0
  336. package/ui-components/field.tsx +224 -0
  337. package/ui-components/hover-card.tsx +46 -0
  338. package/ui-components/input-group.tsx +146 -0
  339. package/ui-components/input.tsx +20 -0
  340. package/ui-components/kbd.tsx +32 -0
  341. package/ui-components/label.tsx +17 -0
  342. package/ui-components/pagination.tsx +124 -0
  343. package/ui-components/popover.tsx +81 -0
  344. package/ui-components/progress.tsx +63 -0
  345. package/ui-components/radio-group.tsx +38 -0
  346. package/ui-components/resizable.tsx +40 -0
  347. package/ui-components/scoped-portal.tsx +31 -0
  348. package/ui-components/select.tsx +195 -0
  349. package/ui-components/separator.tsx +18 -0
  350. package/ui-components/skeleton.tsx +15 -0
  351. package/ui-components/slider.tsx +75 -0
  352. package/ui-components/spinner.tsx +20 -0
  353. package/ui-components/switch.tsx +27 -0
  354. package/ui-components/table.tsx +86 -0
  355. package/ui-components/tabs.tsx +75 -0
  356. package/ui-components/textarea.tsx +17 -0
  357. package/ui-components/toggle-group.tsx +85 -0
  358. package/ui-components/toggle.tsx +42 -0
  359. package/ui-components/tooltip.tsx +61 -0
  360. package/ui-components/utils.ts +8 -0
  361. package/workspace/.claude/skills/moi-workspace/SKILL.md +295 -248
  362. package/workspace/.claude/skills/moi-workspace/references/COLLABORATIVE.md +151 -0
  363. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -152
  364. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
  365. package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
  366. package/client/features/chat/attachment-staging.ts +0 -153
  367. package/client/features/chat/uploads.ts +0 -18
  368. package/client/features/chat/useAppletChatMessage.ts +0 -68
  369. package/client/features/settings/IconPicker.tsx +0 -442
  370. package/client/features/settings/WorkspaceSettings.tsx +0 -92
  371. package/client/features/settings/render-icon.ts +0 -173
  372. package/client/features/widgets/HiddenPanel.tsx +0 -80
  373. package/client/features/widgets/WidgetGrid.tsx +0 -123
  374. package/client/features/widgets/Widgets.tsx +0 -260
  375. package/client/features/widgets/useGridReconcile.ts +0 -73
  376. package/dist/chunk-104m57qw.js +0 -2
  377. package/dist/chunk-7paadv61.js +0 -1
  378. package/dist/chunk-bj3akjs2.js +0 -1
  379. package/dist/chunk-c9pjqx9m.js +0 -14
  380. package/dist/chunk-j2w2vak4.js +0 -546
  381. package/dist/chunk-k2r9c95m.js +0 -10
  382. package/dist/chunk-kmbxhgwv.js +0 -1
  383. package/dist/chunk-pcnahct1.js +0 -5
  384. package/dist/chunk-r8s1b672.css +0 -1
  385. package/dist/chunk-tny85yt2.js +0 -2
  386. package/dist/chunk-v7wr1df4.js +0 -2
  387. package/dist/chunk-vwzshv0d.js +0 -83
  388. package/server/bundler/applet-css.ts +0 -155
  389. /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
  390. /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
  391. /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
  392. /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
  393. /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
  394. /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
  395. /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
  396. /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
  397. /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
  398. /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
  399. /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
  400. /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
  401. /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
  402. /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
  403. /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
  404. /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
  405. /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
  406. /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
@@ -22,7 +22,7 @@ Message types flow through four layers; each has one home:
22
22
  │ REST payloads (SessionInfo, Models, …) re-exports it)
23
23
  ▼
24
24
  4. client React Query cache of StreamEvents + client/features/chat/*
25
- ephemeral preview store → ViewState → (tool-group/format.ts holds the
25
+ ephemeral preview store → ViewState → (messages/tool-group/format/ holds the
26
26
  TurnView rendering per-provider labels/briefs)
27
27
  ```
28
28
 
@@ -57,8 +57,7 @@ Socket-protocol notes the layers rely on (all defined in `lib/types.ts`):
57
57
  lifecycle signal — never derived by counting sends vs results. The snapshot
58
58
  (sent on connect and re-broadcast periodically) is authoritative: the client
59
59
  rebuilds its whole activity map from it, so a lost terminal frame self-heals.
60
- `requires-action` (agent blocked on user input) is tracked but not rendered
61
- yet — the client shows no loader for it.
60
+ `requires-action` suppresses the loader.
62
61
  - **`preview`** — live token frames, cumulative text, never persisted;
63
62
  cleared when the turn with matching `meta.apiMessageId` lands.
64
63
 
@@ -75,9 +74,9 @@ server/harness/
75
74
  hand-written wire types it consumes
76
75
  session.ts live per-thread state machine (send/interrupt/turn
77
76
  accounting/preview forwarding)
78
- <transport>.ts process/connection management, named for what it is:
79
- codex/client.ts, openclaw/gateway.ts (CC has none — the
80
- Agent SDK is the transport)
77
+ <transport>.ts connection management: codex/client.ts owns processes and
78
+ codex/transport.ts frames stdio; openclaw/gateway.ts owns
79
+ the gateway connection (CC uses the Agent SDK)
81
80
  discovery.ts / models.ts / sessions.ts / mcp.ts as needed
82
81
  NOTES.md the backend's wire protocol, empirically verified
83
82
  *.test.ts tests live next to the code they cover
@@ -140,7 +139,9 @@ app-server protocol without moi).
140
139
  **Claude Code — shipped, primary harness.** Full chat integration: long-lived
141
140
  streaming-input sessions with mid-turn message queueing, resume after idle
142
141
  eviction/restart, interrupt, per-thread model + effort picker (backed by
143
- `supportedModels()`), opt-in live token streaming, image/file attachments,
142
+ `supportedModels()`, cached per CLI version so an in-place `claude` update
143
+ shows up without a server restart — `claude-code/NOTES.md` "Runtime
144
+ executable"), opt-in live token streaming, image/file attachments,
144
145
  subagent lanes, MCP status probe, and session list/history replay from the
145
146
  SDK's `.jsonl` files, with per-turn token usage folded into the final
146
147
  assistant turn. The Agent SDK remains the transport, while every query is
@@ -153,8 +154,9 @@ permission chain — settings rules, the `auto` mode classifier, and
153
154
  that reaches a prompt without passing through `PreToolUse`. This is strictly
154
155
  more access than the CLI default — the classifier's safety verdicts no longer
155
156
  apply — and is an interim policy until UI approvals land. Known gaps: no
156
- interactive approval flow yet, and effort/streaming changes require a
157
- teardown-and-resume because the SDK has no live setter for them.
157
+ interactive approval flow yet, and streaming changes require a
158
+ teardown-and-resume because the SDK has no live setter for them. Model, effort,
159
+ and fast-mode changes apply live before the next message.
158
160
 
159
161
  **OpenClaw — shipped.** Chat over the local gateway's WebSocket JSON-RPC
160
162
  (wire protocol 4 — the 2026.7.x and 2026.6.x lines; protocol-3 gateways are
@@ -189,29 +191,19 @@ tool calls left unsettled at turn end are closed (Hermes never completes file
189
191
  read/write calls live), and a completing `tool_call_update` carries no title, so
190
192
  the established name is kept. See `hermes/NOTES.md`.
191
193
 
192
- **Codex — shipped, experimental.** Chat over `codex app-server` (stdio
193
- JSON-RPC, one process per workspace so `workspaceEnv` injects at spawn —
194
- `codex/client.ts`): thread create/resume with temp-id rename, per-turn model +
195
- effort overrides (both live — no rebuild dance), opt-in token streaming from
196
- `item/*/delta`, reasoning summaries via `summary: 'auto'`, mid-turn sends
197
- steered into the running turn (`turn/steer` with `turn/start` fallback),
198
- interrupt, per-turn token usage folded into `TurnMeta`, native optimistic-id
199
- rendezvous, session list via `thread/list` (cwd-filtered) and history replay
200
- via `thread/read`, subagent (collab) child threads nested as live
201
- SubagentRecord transcripts on the parent card, semantic exec labels from
202
- `commandActions`, MCP status via `mcpServerStatus/list`, and hook / failed
203
- MCP-startup notices. Workspace discovery scans `~/.codex/sessions` rollout
204
- heads for cwds (`codex/discovery.ts` — no binary needed), and `availability()`
205
- reports a missing `codex` executable (PATH + login-shell PATH lookup, with a
206
- Codex Desktop app-bundle fallback — `executable.ts`) to setup flows and the
207
- workspace composer. Sessions use `workspace-write` with network disabled by
208
- default and `approvalPolicy: on-request`; server→client approval requests are
209
- accepted by moi at the transport — an interim default-approve policy until UI
210
- approvals land (`codex/permissions.ts`). The same policy is reapplied on
211
- thread start, resume, and every turn. Known gaps: no interactive approval flow
212
- yet. Per-turn application context tells Codex to request escalated localhost
213
- access before control-server commands. Images ride inline as data URLs only
214
- (no `localImage` path mode).
194
+ **Codex — shipped, experimental.** One `codex app-server` per workspace supplies
195
+ chat, model/session catalogs, history, steering, and interruption. The harness
196
+ maps items into shared display events, including subagent transcripts, reasoning
197
+ previews, usage, and hook/MCP failure notices.
198
+ Model, effort, and fast-mode choices apply on the next new turn; the sent model
199
+ matches the picker even when Codex config names an unavailable model.
200
+
201
+ Workspace env is fixed at process spawn. Executable lookup prefers PATH over
202
+ the desktop bundle; config and credentials remain owned by Codex. Sessions use
203
+ workspace-write access with network disabled, and moi automatically accepts
204
+ supported permission requests. Command-approval UI, native question forms, and
205
+ MCP elicitation are not implemented. See [Codex harness notes](codex/NOTES.md)
206
+ for module ownership, ordering rules, runtime diagnostics, and boundaries.
215
207
 
216
208
  Workspace availability also checks provider authentication when a workspace is
217
209
  given. Claude Code is probed with `claude auth status` under the effective
@@ -247,17 +239,18 @@ doubles as the evaluation rubric for new harnesses.
247
239
  `session_state_changed` when the CLI emits it; Codex: `turn/started` /
248
240
  `turn/completed`; OpenClaw: `agent` lifecycle phases). Flip to `running`
249
241
  optimistically on send; a session with live background tasks (CC
250
- `task_started`/`task_notification`) must not be idle-evicted.
242
+ `background_tasks_changed` snapshots, with task events as an older-CLI
243
+ fallback) must not be idle-evicted.
251
244
 
252
245
  ### Per-request configuration
253
246
 
254
247
  - **List supported models**, including per-model metadata such as supported
255
248
  effort levels (drives the picker).
256
249
  - **Set model** — ideally live mid-session.
257
- - **Set reasoning effort** — CC has no live setter, so `claude-code/session.ts`
258
- does a drain-then-teardown-then-resume dance; Codex takes it per turn.
259
- - **Thinking/reasoning display mode** (Codex: `summary: 'auto'` is required or
260
- reasoning items arrive empty).
250
+ - **Set reasoning effort** — CC applies `applyFlagSettings({ effortLevel })`
251
+ before the next message; Codex takes it per turn.
252
+ - **Thinking/reasoning display mode** (Codex requests `summary: 'detailed'`
253
+ so visible summaries do not depend on CLI defaults).
261
254
  - **Token streaming opt-in** (CC: `includePartialMessages`, construct-time;
262
255
  Codex: always streams, moi gates forwarding).
263
256
  - **Permissions / tool policy** — allowed tools, permission mode; backends
@@ -279,7 +272,9 @@ doubles as the evaluation rubric for new harnesses.
279
272
  ### Input capabilities
280
273
 
281
274
  - Images (base64 blocks vs data URLs vs file paths — a capability, not a given).
282
- - File attachments (path-note fallback via `lib/attachment-note.ts`).
275
+ - Attachments share `server/attachment-message.ts` for preparation and
276
+ `lib/moi-attachments.ts` for serialization and replay. Files and path-delivered
277
+ images carry readable paths; inline images keep their native content blocks.
283
278
  - Rich content blocks vs plain-string prompts.
284
279
 
285
280
  ### Discovery / metadata
@@ -304,36 +299,36 @@ doubles as the evaluation rubric for new harnesses.
304
299
 
305
300
  ## Capability comparison
306
301
 
307
- Legend: ✅ supported · ⚠️ partial/workaround · ❌ missing.
302
+ Legend: ✅ supported · ⚠️ partial/workaround · ❌ missing. The Codex column
303
+ describes what moi exposes, not every RPC available in the upstream protocol.
308
304
 
309
305
  | Feature | Claude Agent SDK | OpenClaw gateway | Codex app-server | Hermes (ACP) |
310
306
  | ------------------------ | --------------------------------------------------- | ------------------------- | ------------------------------------- | ------------------------------------ |
311
307
  | Long-lived session | ✅ subprocess per session | ✅ gateway-side | ✅ server-side, N threads/process | ✅ process per workspace, N sessions |
312
308
  | Queue/steer mid-turn | ⚠️ queued next turn | ⚠️ | ✅ `turn/steer` into live turn | ⚠️ queued (ACP has no steer) |
313
- | Resume | ✅ | ✅ | ✅ + fork | ✅ `session/load` (+ fork) |
309
+ | Resume | ✅ | ✅ | ✅ `thread/resume` | ✅ `session/load` (+ fork) |
314
310
  | Interrupt | ✅ `interrupt()` | ✅ | ✅ `turn/interrupt` | ✅ `session/cancel` → `cancelled` |
315
311
  | List models | ✅ `supportedModels()` | ✅ `models.list` | ✅ `model/list` | ✅ inline on `session/new` |
316
312
  | Live model switch | ✅ `setModel()` | ✅ `sessions.patch` | ✅ per-turn override | ⚠️ drops session MCP servers |
317
- | Live effort switch | ❌ rebuild | ✅ `thinkingLevel` patch | ✅ per-turn | ❌ no effort concept in ACP |
313
+ | Live effort switch | ✅ `applyFlagSettings` | ✅ `thinkingLevel` patch | ✅ per-turn | ❌ no effort concept in ACP |
318
314
  | Token deltas | ✅ opt-in | ✅ `chat` frames | ✅ `item/*/delta` | ✅ always on, thinking + text |
319
- | Images in input | ✅ base64 blocks | ⚠️ materialize to path | ✅ data URL or path | ✅ base64 blocks |
315
+ | Images in input | ✅ base64 blocks | ⚠️ materialize to path | ✅ inline data URLs | ✅ base64 blocks |
320
316
  | Interactive approvals | ⚠️ (we bypass) | ✅ | ✅ server→client requests (we bypass) | ✅ real, with diffs (we bypass) |
321
317
  | Session list/history API | ✅ `listSessions()` + jsonl | ✅ `sessions.get` | ✅ `thread/list`/`read` | ✅ `session/list` (cwd + cursor) |
322
318
  | Home card preview | ✅ session file scan | ✅ cached first message | ⚠️ live app-server only | ⚠️ live process only |
323
319
  | MCP status | ✅ `mcpServerStatus()` | n/a | ✅ `mcpServerStatus/list` | ⚠️ per-session config, no status RPC |
324
- | Usage reporting | ⚠️ cost/duration on `result` (adapter drops tokens) | ✅ tokens + cost per turn | ✅ live + rate limits | ✅ tokens per turn |
325
- | Structured output | ❌ | ❌ | ✅ per turn | ❌ |
320
+ | Usage reporting | ⚠️ cost/duration on `result` (adapter drops tokens) | ✅ tokens + cost per turn | ✅ per-turn tokens and duration | ✅ tokens per turn |
321
+ | Structured output | ❌ | ❌ | ⚠️ title generation only | ❌ |
326
322
 
327
323
  ## Design lessons so far
328
324
 
329
- - Half of `claude-code/session.ts` exists because some settings are
330
- live-settable (`setModel`) and some are construct-time (effort, streaming).
325
+ - Claude Code settings are either live-settable (`setModel`, effort/fast mode
326
+ via `applyFlagSettings`) or construct-time (streaming).
331
327
  Encode that distinction per-setting in the adapter interface instead of
332
328
  hardcoding the drain-then-rebuild machinery.
333
- - Harnesses split into two topologies: **held-open** (CC subprocess, OpenClaw
334
- gateway, Codex app-server) and **spawn-per-turn** (Codex exec SDK — see
335
- `codex/NOTES.md` §1 for why we rejected it). The session manager should
336
- support both.
329
+ - Chat harnesses keep connections open (CC subprocess, OpenClaw gateway,
330
+ Codex app-server). Separate one-shot work, such as Codex title generation,
331
+ can use a short-lived process without changing chat session ownership.
337
332
  - Event vocabularies differ in kind, not just names: CC emits raw
338
333
  tool_use/tool_result pairs; Codex emits semantic items (a patch, a command)
339
334
  with their own lifecycle. The adapter layer is where that converges on
@@ -0,0 +1,426 @@
1
+ # ACP agents — verified behavior and implementation plan
2
+
3
+ Updated 2026-09-05 (Asia/Nicosia). These notes replace the original conformance
4
+ report and its implementation plan. Findings, verification limits, and proposed
5
+ solutions are consolidated here. The fixes below are not implemented.
6
+
7
+ **Fix moi's session lifecycle and protocol mapping before adding providers.**
8
+ The independent host probe exposed twelve failed behavior checks despite all
9
+ 42 existing ACP tests passing. Provider compatibility then needs a few focused
10
+ hooks: fx process isolation and history retrieval, Hermes completion/usage
11
+ handling, and Cursor config/replay support. A generic journal, workspace-type
12
+ migration, and custom-agent registry are not prerequisites.
13
+
14
+ ## 1. Evidence and verification
15
+
16
+ Fresh tests ran against moi `9bfd2ed` and `@agentclientprotocol/sdk@1.3.0`:
17
+
18
+ | Agent | Command | Installed version | Model used |
19
+ | ------ | ------------------ | ----------------------------- | ----------------------------------- |
20
+ | Hermes | `hermes acp` | `0.21.0`, source `d3630f8532` | `xai-oauth:grok-build-0.1` |
21
+ | fx | `fx acp` | `0.0.7` | `zai/glm-5.3-flash` |
22
+ | Cursor | `cursor-agent acp` | `2026.09.02-c22c1a3` | `auto-smart[optimize_for=balanced]` |
23
+
24
+ fx source was inspected at `7e02f32f7fca`; the installed binary reports only
25
+ `0.0.7`, so that commit is corroborating source, not a proven binary identity.
26
+ Hermes source was inspected in the installed checkout at the revision above.
27
+
28
+ Fresh independent JSON-RPC probes exercised creation, config rejection, real
29
+ shell/write/read operations, injected environment values checked against the
30
+ resulting file, multiple sessions, cold list/load/resume, nonexistent sessions,
31
+ nondefault modes, cancellation during tools, and broken MCP startup. Hermes
32
+ steering was exercised during an active shell call. The host probe separately
33
+ drove moi's actual ACP client, session, and adapter through a mock subprocess.
34
+
35
+ Images, successful MCP calls, permission-denial behavior, Cursor `--force`, and
36
+ subagent transcripts have **historical capture evidence only**. Those captures
37
+ were inspected but these cases were not freshly rerun. The old matrix script
38
+ and mini-MCP script are absent from this checkout and its available git history;
39
+ the old command examples no longer apply. Aggregate pass/fail rankings have
40
+ been removed: optional methods are not conformance failures, and an RPC
41
+ acknowledgement does not prove that a setting took effect.
42
+
43
+ The one-off probe scripts and separate audit artifacts are not retained in the
44
+ repository. To repeat the provider checks, use an independent JSON-RPC client
45
+ with the commands above, existing authentication, and disposable workspaces.
46
+ Test nondefault modes before and after restarting the process, cancel while a
47
+ tool is active, and verify file contents against a random environment marker.
48
+ Restore the confirmed model after rejection tests. For host regressions, use
49
+ the observed failures and acceptance criteria in §5; run the existing suite
50
+ with `bun test server/harness/acp`.
51
+
52
+ The audit did not upgrade agents, temporarily edit global settings, or file
53
+ upstream issues. Fresh raw captures were stored in `/tmp/moi-acp-audit.f4Uoya/`;
54
+ historical captures were inspected under
55
+ `/tmp/claude-501/-Users-molefrog-git-moi/645be88d-e045-49f1-a68a-66b70769f71e/scratchpad/`.
56
+ These temporary paths may disappear and are not durable test dependencies.
57
+
58
+ ## 2. Verified compatibility summary
59
+
60
+ These are observations for the tested builds, not promises about every model,
61
+ provider configuration, or future version. See the following sections for
62
+ limitations and solutions.
63
+
64
+ | Behavior | Hermes | fx | Cursor |
65
+ | --------------------------------------------- | --------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------- |
66
+ | Earlier session usable after creating another | Yes in sequential test | No: `Session is not active` | Yes in sequential test |
67
+ | Model configuration | Legacy `models` / `session/set_model` | `configOptions`; distinct provider and model selectors | `models` and `configOptions`; exact parameterized model IDs |
68
+ | Independently settable effort | Not verified; current path omits config | Unknown effort option is inert | No separate override established; use catalog variants |
69
+ | Live tool completion | File calls remain unsettled | Output deltas and final shell envelope | Paired updates; inputs/output may arrive after start |
70
+ | Cold `session/load` | Structured replay | Tool history flattened into assistant prose | Structured replay |
71
+ | `session/resume` | Supported, also replays | Attaches without replay | Method not found in tested build; use load |
72
+ | Load nonexistent session | Returns `{}` | Error | Error |
73
+ | Changed mode after warm load | `dont_ask` preserved | `code` resets to `ask` | `plan` preserved |
74
+ | Changed mode after cold load | Resets to `default` | Resets to `ask` | `plan` preserved |
75
+ | Cancel during a tool | Internal error in finalization | `cancelled`, tool left unsettled | `cancelled`, tool left unsettled |
76
+ | Mid-turn steering | `/steer` prompt works | No equivalent verified | No equivalent verified |
77
+ | Broken stdio MCP executable on creation | Returns a session ID | Rejects creation | Returns a session ID |
78
+ | Prompt usage | Cumulative agent counters | Input/output observed | None observed |
79
+ | Context usage update | Observed | Observed, including cost | None observed |
80
+ | Alternative history path | Local SQLite exists; prefer replay | Supported `fx session --id <id> --json` | Local store contains plaintext/JSON; prefer replay |
81
+
82
+ The Hermes/Cursor sequential test does not prove unrestricted concurrent
83
+ session isolation. A safe default for unfamiliar agents is a dedicated process
84
+ per open chat. Process sharing should be an explicit provider optimization,
85
+ not a destructive runtime probe against a user's active sessions.
86
+
87
+ ## 3. Shared protocol rules
88
+
89
+ ### Tool updates replace collections
90
+
91
+ The installed SDK explicitly defines `ToolCallUpdate.content` and `locations`
92
+ as replacements. An omitted field preserves its previous value; an explicit
93
+ `[]` clears it. moi currently fails to clear both and drops `rawOutput`.
94
+ Preserve structured diffs and outputs instead of flattening them to `newText`.
95
+
96
+ `rawOutput` and `UsageUpdate.cost` are standard fields in SDK 1.3.0; cost is a
97
+ cumulative session value. `ToolCall.name` is present as an **unstable** field.
98
+ fx's `command_result` is an extension. Do not discard useful standard fields
99
+ as unknown provider extras. See [tool calls](https://agentclientprotocol.com/protocol/v1/tool-calls).
100
+
101
+ fx's incremental shell output needs an fx-specific normalization hook that
102
+ produces replacement snapshots for the shared adapter. Recognize its shell
103
+ completion envelope before treating it as metadata; retain legitimate final
104
+ text and failures. A global append rule duplicates cumulative snapshots and
105
+ can hide the final result.
106
+
107
+ ### Supplied message IDs define boundaries
108
+
109
+ Two adjacent assistant messages with IDs `a` and `b` currently collapse into
110
+ one `onetwo` message. Flush on supplied identity changes for both user and
111
+ assistant messages. Use role/tool boundary heuristics only when IDs are absent.
112
+ Keep IDs opaque, including literal newlines. Live and replay IDs need not match:
113
+ fresh Hermes replay used `call-…`, Cursor replay used `replay-…`, and both
114
+ used different live IDs. The old Hermes `functions.<tool>:<n>` replay format is
115
+ not universal. Do not reconcile persisted history through ephemeral wire IDs.
116
+
117
+ ### Configuration belongs to a session
118
+
119
+ Support advertised `configOptions` and legacy `models`/`modes`, including grouped
120
+ values and config updates. Keep selected values separate from the catalog cache.
121
+ Prefer known preset option IDs; semantic categories are a fallback, not unique
122
+ keys. fx marks **both** `provider` and `model` with category `model`.
123
+
124
+ Other ACP agents can expose `thought_level`; detect it instead of declaring
125
+ ACP incapable of effort control. Return only confirmed model/config selections
126
+ and surface rejected changes. See [session config options](https://agentclientprotocol.com/protocol/v1/session-config-options).
127
+
128
+ Modes are not a portable permission policy: `code` or `agent` does not imply
129
+ bypass. Apply an explicit preset policy and answer permission requests.
130
+ `resumeSession` already reapplies moi's no-prompt mode after `session/load`;
131
+ adding that same load-path fix again would be redundant.
132
+
133
+ ### Capabilities and authentication need separate checks
134
+
135
+ An executable resolving on PATH proves installation, not authenticated readiness.
136
+ `authMethods` advertises login methods, not current login success; an empty list
137
+ does not prove unavailability. Run provider status checks under the same
138
+ profile/environment as the session and retain an unknown state for custom
139
+ agents. No login was performed during this audit.
140
+
141
+ Check advertised image/resource capabilities. An agent reading a supplied URI
142
+ does not prove it consumed embedded content; a strict test needs an inline-only
143
+ random marker with no readable file. moi's text-only chunk handler currently
144
+ drops unsupported assistant media. Unknown extension requests should receive
145
+ prompt errors, but returning an error is not implementing the associated feature.
146
+
147
+ ## 4. Provider-specific solutions
148
+
149
+ ### Hermes
150
+
151
+ - **Missing live file-tool completions:** reproduced with three starts and one
152
+ update. Preserve an unknown/interrupted outcome when completion is absent;
153
+ never synthesize success at turn end. Upstream should pair completions by
154
+ invocation ID, not FIFO tool name, which also risks out-of-order same-name
155
+ calls. Related background is in [the Hermes notes](../hermes/NOTES.md), whose
156
+ older claims must be read against this audit.
157
+ - **Cancellation crash:** a shell cancellation returned `-32603` with
158
+ `'NoneType' object has no attribute 'startswith'`. Source uses
159
+ `result.get('final_response', '')`, which leaves explicit `None` unchanged.
160
+ Normalize optional text upstream and guarantee cancelled finalization.
161
+ Locally preserve cancellation intent, settle cards honestly, and surface
162
+ unexpected errors; do not suppress every exception after a cancel request.
163
+ - **Steering works over ACP:** during `sleep 12`, a concurrent prompt containing
164
+ `/steer … reply STEERED …` changed the original run's answer to `STEERED`.
165
+ The slash handler runs before the busy check. A dedicated Hermes steer hook
166
+ must distinguish the short acknowledgement RPC's `end_turn` from completion
167
+ of the original prompt. Its acknowledgement chunks share the session stream.
168
+ `/queue` is advertised but was not freshly exercised; ordinary queueing
169
+ remains the fallback.
170
+ - **Model switching drops session MCP configuration:** `_switch_model` rebuilds
171
+ without reattaching it. Keep specs on the session and reattach after rebuild.
172
+ The registry is also process-global by server name; conflicting same-name
173
+ configs are not proven isolated. Use dedicated chat processes when connector
174
+ configs differ. The upstream fix needs instance-scoped MCP ownership.
175
+ - **Broken MCP startup can still return a session:** creation success is not
176
+ connector readiness. Preserve connector diagnostics and verify availability
177
+ separately rather than assuming registration is all-or-nothing.
178
+ - **Usage is cumulative:** the tools prompt reported 52,132 input / 899 output;
179
+ the next short prompt reported 65,761 / 1,017. `turn_finalizer.py` copies
180
+ `agent.session_*` counters into the response. Compute provider-specific deltas
181
+ only within a known agent instance; reset on rebuild/reconnect and guard
182
+ decreases. An unknown baseline is cumulative data, not invented turn usage.
183
+ - **Effort-file workaround is unconnected:** `_make_agent` loads config but
184
+ does not pass resolved `reasoning_config` to `AIAgent`. A mocked constructor
185
+ with `agent.reasoning_effort: high` confirmed the omission. Resolve/pass
186
+ session-local reasoning on creation and rebuild, then expose `thought_level`
187
+ upstream. Keep the independent picker unavailable until that path works.
188
+ - **Missing sessions appear to load:** the nonexistent-ID test returned `{}`.
189
+ Upstream should return an explicit error; locally check known membership
190
+ where available without treating a truncated list as authoritative absence.
191
+ - **Modes:** warm load preserves `dont_ask`; cold load resets to `default`.
192
+ Reapply the chosen policy on attachment. Historical default-mode file denial
193
+ was bypassed through a shell redirect: that gate is not a filesystem sandbox.
194
+ - **Discovery can truncate:** source scans at most 1,000 ACP records before cwd
195
+ filtering. A filtered empty result does not establish that no sessions exist.
196
+
197
+ ### fx
198
+
199
+ - **One active session per process:** creating another session invalidates the
200
+ first. Source can cancel/reap current work, so serialize neither discovery nor
201
+ unrelated chats through an active chat process. Use one owned lease per open
202
+ chat and a separate short-lived discovery process when needed.
203
+ - **Prefer supported history retrieval:**
204
+ `fx session --id <id> --json` returned tool inputs/results and a complete file
205
+ presentation/diff. Adapt that for cold display; attach through
206
+ `session/resume`. `session/load` remains a visibly lossy fallback. This is
207
+ simpler than building readers for private events/checkpoints or introducing
208
+ a generic journal first. [Issue #624](https://github.com/vercel-labs/fx/issues/624)
209
+ was open when checked on 2026-09-05; no new issue was filed.
210
+ - **Normalize shell deltas locally:** accumulate incremental `in_progress`
211
+ text into a snapshot; recognize the final shell envelope and retain useful
212
+ `command_result` metadata. File writes can finish with ordinary prose and
213
+ failures with error text, so completion content is not universally metadata.
214
+ - **Use tool identity separately from display:** generic titles such as
215
+ `Running` and `Writing` need `name`, `kind`, and `rawInput` for useful labels.
216
+ File paths may be in `rawInput.path` without `locations`; some tools wrap
217
+ inputs in `rawInput.request`. Preserve the native title where useful instead
218
+ of introducing a large vocabulary table upfront.
219
+ - **Operational notices arrive as assistant chunks:** classify a buffered
220
+ prefix such as `[context]` or `skill discovery warning:` within the fx hook.
221
+ The prefix can span chunks; IDs rotate when switching between operational
222
+ and assistant output, so do not assume one diagnostic ID per run. Show
223
+ omitted-instruction notices instead of silently hiding missing context.
224
+ - **Reapply explicit policy:** setting `code` then loading resets the reported
225
+ mode to `ask`, both warm and cold. Source/historical evidence distinguishes
226
+ reported mode from effective permission settings. Verify policy behavior,
227
+ not just a response label.
228
+ - **Validate model selections:** the configured gateway accepted an invalid
229
+ model value; other providers have different validation paths. Prefer its
230
+ known `model` option ID and preserve the separate provider selector. Verify
231
+ returned state and fail the send when a required switch fails.
232
+ - **Do not swap global settings for effort:** separate processes still race
233
+ on `~/.fx/settings.json`, crashes can leave a temporary value installed, and
234
+ unrelated CLI launches can observe it. Expose a validated session-local
235
+ `thought_level` option upstream and persist effort with the session.
236
+ - **Keep measured run durations:** all four observed CLI tool results had the
237
+ same `created_at_ms`; the turn had no start/end fields. Those timestamps do
238
+ not establish per-tool duration and do not replace `run-durations.ts`.
239
+ - **Instruction discovery outside home is limited:** source has a specific
240
+ omission reason for such workspaces. This does not prohibit execution there.
241
+ Report omitted rules; do not move the workspace or spoof `HOME`.
242
+
243
+ Representative shell updates, abbreviated from the captures:
244
+
245
+ ```json
246
+ {"sessionUpdate":"tool_call","toolCallId":"…","name":"shell","title":"Running","kind":"execute","rawInput":{"action":"run","command":"echo hello"}}
247
+ {"sessionUpdate":"tool_call_update","toolCallId":"…","status":"in_progress","content":[{"type":"content","content":{"type":"text","text":"hello\n"}}]}
248
+ {"sessionUpdate":"tool_call_update","toolCallId":"…","status":"completed","content":[{"type":"content","content":{"type":"text","text":"{\"state\":\"completed\",\"exit_code\":0}"}}],"command_result":{"kind":"command","exit_code":0}}
249
+ ```
250
+
251
+ Historical captures/source also describe yielded shell calls whose invocation
252
+ finishes while their process remains running, followed by late output. Preserve
253
+ that distinction: a completed tool invocation does not prove the underlying
254
+ background command exited. Test this path before implementing late-output rules.
255
+
256
+ ### Cursor
257
+
258
+ - **Use `session/load` for attachment and structured replay.** The tested
259
+ build does not implement `session/resume`. A newly created empty session
260
+ cannot be reloaded before its first prompt, so keep its live lease; do not
261
+ assume a discovery-created ID is already durable history.
262
+ - **Keep exact catalog IDs opaque.** Parameterized variants are accepted;
263
+ invented brackets, bare IDs, and unknown config options were rejected.
264
+ Present the available variants without synthesizing combinations. No
265
+ separate per-chat effort override was established by this audit.
266
+ - **Preserve delayed tool fields:** inputs, `rawOutput`, diffs, and locations
267
+ can arrive after the start. Tool IDs can include newlines; replay IDs differ.
268
+ - **Keep the existing permission callback policy.** Shell approval was freshly
269
+ observed; successful MCP calls and `--force` have historical evidence.
270
+ The callback already supports moi's current auto-approval behavior; requiring
271
+ a global flag is unnecessary.
272
+ - **Plan mode needs an implementation:** historical captures show a
273
+ `cursor/create_plan` request. Returning an unsupported-method error prevents
274
+ a hang but does not make plan mode usable. Implement and test the extension
275
+ before exposing the mode. Changed `plan` mode persisted across warm and
276
+ cold loads, contradicting the original universal-reset claim.
277
+ - **Report usage unavailable:** no usage was observed in fresh prompts,
278
+ replay, or cancellation. Do not display zero or infer token counts. Consume
279
+ standard fields if a later version emits them.
280
+ - **The store is not encrypted as claimed:** the audit session's `store.db`
281
+ contained 14 parseable JSON blobs plus 37 other blobs; 13 contained the test
282
+ marker in plaintext. Binary records do not prove encryption. This does not
283
+ establish a supported schema or complete child-history recovery; prefer load.
284
+ - **Treat connector startup separately:** broken stdio MCP creation still
285
+ returned a session ID, as with Hermes.
286
+
287
+ ## 5. Existing moi defects and acceptance criteria
288
+
289
+ The independent host probe reproduced twelve failed checks, grouped below into
290
+ nine related problems. These are host defects, independent of the provider
291
+ observations above. The grouped collection row covers three checks; the
292
+ loading/readiness row covers two.
293
+
294
+ | Priority | Observed problem | Required behavior |
295
+ | -------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
296
+ | P1 | Concurrent cold loads issue two load RPCs and competing subscriptions. | Share one initialization promise per session; both callers receive the same complete replay from one RPC. |
297
+ | P1 | Loading records appear live; sends can run before replay finishes. | Separate loading from ready. Register the receiver early, publish readiness late, and make reads/sends await initialization. |
298
+ | P1 | A queued send changes the model during the preceding prompt. | Keep model/stream settings on the queue item and apply them at dequeue, preserving the original run's metadata. |
299
+ | P1 | Cancellation/error cleanup marks unfinished tools successful. | Only completion evidence yields success; use interrupted/unknown or an explicit error explanation for unresolved calls. |
300
+ | P1 before adding providers | Different provider specs in the same cwd reuse one client. | Key by provider/profile/config generation and session scope; retain the concrete client lease on the session. |
301
+ | P2 | Adjacent message IDs collapse into one message. | Respect identity changes, interleaved tools, and chunked diagnostics. |
302
+ | P2 | Empty content/locations do not clear; raw output is lost. | Preserve omitted fields, replace explicit collections including `[]`, and retain output data. |
303
+ | P2 | A tool-only prompt loses its response usage. | Attach completion metadata to the final assistant/tool turn or a dedicated run record, even without final assistant text. |
304
+ | P2 | RPC errors lose `code` and `data`. | Preserve typed errors so `-32601` can drive capability fallback and nested provider details remain visible. |
305
+
306
+ Additional source-confirmed gaps, not separately exercised by that mock:
307
+
308
+ - `resumeSession` ignores returned model/config state. Seed it on attachment
309
+ so replay metadata is correct and the next send does not needlessly rebuild
310
+ an already selected Hermes model. Failed model switches are currently logged
311
+ and ignored; retain the last confirmed selection and surface failure.
312
+ - There is **no ACP idle TTL**. `forgetAcpSession` drops the record/subscription
313
+ without cancelling work or releasing the backend session. Add ownership,
314
+ bounded idle cleanup, and cancel/close/release; never reap busy sessions.
315
+ - Exit cleanup compares the pool's `startClient(...)` promise with a different
316
+ inner `Promise.resolve(record)`, so identity cannot match. Compare the actual
317
+ stored promise/record and prevent stale exits from deleting replacement
318
+ clients. Validate parsed envelopes against null/primitives and settle
319
+ read/write failures without leaving child processes behind.
320
+ - After `__exit`, the old run's `finally` can drain queued work through a new
321
+ process before reattaching the session. Invalidate the client generation and
322
+ explicitly recover or discard queued work. Archive/forget must invalidate
323
+ its runner too.
324
+ - Model discovery creates a real session on the shared process. This would
325
+ invalidate fx's active chat even if normal sends used separate keys. Reuse
326
+ ready-session config or acquire a separate discovery lease.
327
+ - Listing stops after five pages; preview reads one page and trusts cwd
328
+ filtering. Expose paging, deduplicate IDs/cursors, filter mismatched cwds,
329
+ and report truncation. A generated title is not the first user message.
330
+
331
+ ## 6. Persistence and optional features
332
+
333
+ Keep transcript retrieval separate from backend attachment. A journal can
334
+ restore display but cannot make an agent without load/resume remember previous
335
+ context. Never silently replace a failed resume with a new empty conversation.
336
+ See [session setup](https://agentclientprotocol.com/protocol/v1/session-setup).
337
+
338
+ Use Hermes/Cursor load and fx's supported history CLI first. If a journal is
339
+ still needed, define versioned records, run IDs, sequence numbers, begin/end
340
+ markers, and coverage/freshness before making it authoritative. “Journal if
341
+ present” hides external CLI/editor changes and partial recordings. Appending
342
+ every accumulated UI snapshot can produce quadratic storage. Define imported
343
+ sessions, crash recovery, reconciliation, attachment lifetime, and unavailable
344
+ model context explicitly.
345
+
346
+ Historical subagent traces support flat tool cards as the initial presentation.
347
+ Hermes task logs and fx child stores may provide optional enrichment later.
348
+ Claims that thoughts are never persisted, child data is only available after
349
+ completion, or Cursor has no readable child data exceed the evidence. Do not
350
+ couple the first integration to private subagent formats.
351
+
352
+ moi-side archive is distinct from deleting provider history and must still
353
+ cancel/release owned resources. Historical missing close/fork/delete methods
354
+ are observations, not universal protocol prohibitions; detect supported methods
355
+ and preserve error codes for fallback.
356
+
357
+ ## 7. Implementation order
358
+
359
+ 1. **Fix lifecycle ownership and add regressions.** One pending/ready session
360
+ record, one client lease, one serialized queue, confirmed session config,
361
+ preserved RPC errors, explicit cancellation/release, and guarded recovery.
362
+ Cover the twelve reproduced behaviors before enabling more providers.
363
+ 2. **Correct the shared adapter.** Replacement collections, message boundaries,
364
+ structured output/diffs, honest final status, and tool-only completion data.
365
+ Keep fx delta/envelope/diagnostic handling in a small provider hook.
366
+ 3. **Add fx.** Dedicated chat processes, separate discovery, known selectors,
367
+ supported CLI history adapter, and `session/resume`; make fallback loss clear.
368
+ 4. **Add Cursor.** Reuse config/replay and the current permission callback.
369
+ Show usage as unavailable; implement/test plan requests before enabling plan.
370
+ 5. **Add user-defined agents only when that product surface is wanted.** Grow
371
+ the existing `AcpProviderConfig` with focused hooks first. A new workspace
372
+ type, migration, custom registry, presentation endpoint, and setup UI are
373
+ separate product work. Custom commands are machine-local; a shareable
374
+ workspace reference must handle a missing local definition explicitly.
375
+ 6. **Add a journal/private reader only for a demonstrated remaining gap.**
376
+ Define coverage, freshness, recovery, and backend-context behavior first.
377
+
378
+ ## 8. Tracker
379
+
380
+ Original IDs are retained so earlier references remain meaningful. “Confirmed”
381
+ means observed or source-confirmed as specified above, not fixed. The only
382
+ linked existing upstream issue is #1; no new reports were sent in this audit.
383
+
384
+ | # | Agent | Finding and disposition |
385
+ | --- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
386
+ | 1 | fx | Lossy load confirmed. [Issue #624](https://github.com/vercel-labs/fx/issues/624) open as of 2026-09-05; use supported CLI history plus resume. |
387
+ | 2 | fx | Diagnostics confirmed. Buffer/classify within fx and surface relevant notices; upstream should use a distinct notification. |
388
+ | 3 | fx | One active session confirmed. Dedicated chat leases, separate discovery, explicit cleanup. |
389
+ | 4 | fx | Mode reset confirmed; effective policy is distinct from its label. Apply/test explicit policy. |
390
+ | 5 | fx | Generic titles confirmed. Use name/kind/inputs for identity and display. |
391
+ | 6 | fx | Invalid model accepted on the tested gateway. Validate picker values and confirmed state; do not generalize to every backend. |
392
+ | 7 | Hermes | Missing file-tool completions confirmed. Honest unresolved outcomes locally; invocation-ID pairing upstream. |
393
+ | 8 | Hermes | Model rebuild omits MCP config in source. Retain/reattach specs and isolate conflicting registries. |
394
+ | 9 | Cursor | Shell approvals confirmed; MCP/force historical. Existing permission callback supports current moi policy. |
395
+ | 10 | Cursor | Usage absent in tested paths. Display unavailable and accept future standard updates. |
396
+ | 11 | All | Universal mode reset disproved. Cursor preserves plan; Hermes preserves warm mode; moi already reapplies mode after load. |
397
+ | 12 | fx | Effort option inert. No global settings swap; upstream session-local option and persistence. |
398
+ | 13 | Hermes | Effort config not passed through constructor path. Resolve/pass session reasoning upstream; keep picker unavailable meanwhile. |
399
+ | 14 | Cursor | Exact catalog variants work; separate effort override not established. Do not invent IDs or claim impossibility. |
400
+ | 15 | All | Flat subagent cards have historical evidence. Optional private-history enrichment remains separate work. |
401
+ | 16 | Hermes | Newly found cancellation finalizer crash. Normalize optional response text upstream; preserve stop intent and errors locally. |
402
+ | 17 | Hermes | Newly found cumulative prompt usage. Delta only within a known agent instance and preserve unknown baselines. |
403
+ | 18 | Hermes | Newly found nonexistent load returns `{}`. Explicit error upstream; cautious membership checks locally. |
404
+ | 19 | Cursor | Newly found empty session cannot cold-load before its first prompt. Retain live ownership. |
405
+ | 20 | moi | Twelve failed host checks plus source-confirmed lifecycle gaps. Fix and regress before adding providers (§5–7). |
406
+
407
+ ## 9. Sources and remaining uncertainty
408
+
409
+ Primary sources: the installed ACP 1.3.0 schema, installed Hermes source, and
410
+ fx's pinned [request handling](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/acp/server.zig),
411
+ [session handling](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/acp/sessions.zig),
412
+ [streaming](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/acp/prompt.zig),
413
+ and [configuration](https://github.com/vercel-labs/fx/blob/7e02f32f7fca/src/core/config/config_runtime.zig).
414
+
415
+ Cursor's exact old-version replay-fix date, separation of interactive and ACP
416
+ stores, every possible effort override, and the original Grok CLI exclusion
417
+ were not independently established. Do not carry them forward as requirements.
418
+ Catalog counts and timings vary; measure startup, first model token, and tool
419
+ completion separately with repeated controlled runs. Diagnostic first bytes
420
+ are not model latency.
421
+
422
+ At audit time, all 42 existing ACP tests passed. Full typechecking was blocked
423
+ by the existing `ui-components/drawer.tsx` import of an unexported `Drawer`.
424
+ The temporary probes passed lint and produced no type errors. Their twelve
425
+ failed host checks remain unresolved; the test suite was not modified to accept
426
+ those behaviors.