moi-computer 0.12.0 → 0.12.1-next.1

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 (367) hide show
  1. package/README.md +27 -27
  2. package/bin/moi.mjs +2 -2
  3. package/client/AGENTS.md +7 -4
  4. package/client/api/app-config.ts +3 -2
  5. package/client/api/app-ui-keys.ts +1 -1
  6. package/client/api/workspace-keys.ts +2 -4
  7. package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
  8. package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
  9. package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +20 -31
  10. package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +10 -10
  11. package/client/dev/index.html +43 -0
  12. package/client/dev/index.ts +15 -0
  13. package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
  14. package/client/features/applets/applet-runtime.ts +11 -13
  15. package/client/features/applets/applet-thumbnail.ts +1 -1
  16. package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
  17. package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
  18. package/client/features/chat/applet-chat-intents.ts +33 -14
  19. package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +80 -59
  20. package/client/features/chat/chat-popup.tsx +171 -0
  21. package/client/features/chat/chat-send.ts +33 -1
  22. package/client/features/chat/chat-store.ts +10 -0
  23. package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
  24. package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
  25. package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
  26. package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
  27. package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
  28. package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
  29. package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +31 -33
  30. package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +4 -4
  31. package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +14 -30
  32. package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
  33. package/client/features/chat/connection/chat-frames.ts +15 -8
  34. package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +37 -23
  35. package/client/features/chat/messages/fork-history.ts +14 -0
  36. package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +4 -4
  37. package/client/features/chat/messages/tool-group/index.ts +1 -1
  38. package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
  39. package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
  40. package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
  41. package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
  42. package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
  43. package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
  44. package/client/features/chat/sessions/api.ts +109 -19
  45. package/client/features/chat/sessions/browser-tab-state.ts +30 -7
  46. package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +139 -80
  47. package/client/features/chat/sessions/use-selected-session.ts +351 -0
  48. package/client/features/chat/{useChat.ts → use-chat.ts} +46 -48
  49. package/client/features/collab/client.ts +10 -11
  50. package/client/features/collab/hooks.tsx +6 -11
  51. package/client/features/collab/host-state.ts +57 -128
  52. package/client/features/collab/provider.tsx +3 -3
  53. package/client/features/collab/proxy-user.ts +1 -1
  54. package/client/features/collab/testing/fake-engine.ts +6 -27
  55. package/client/features/collab/workspace-users-menu.tsx +3 -7
  56. package/client/features/connectors/mcp-icons.ts +1 -1
  57. package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
  58. package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +6 -6
  59. package/client/features/dev/chat-states-fixtures.ts +4 -4
  60. package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
  61. package/client/features/dev/collab/local-user-settings.tsx +4 -4
  62. package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
  63. package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
  64. package/client/features/dev/workspace-setup-mocks.ts +102 -0
  65. package/client/features/dev/workspace-setup-page.tsx +11 -0
  66. package/client/features/dev/workspace-setup-preview.tsx +226 -0
  67. package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
  68. package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
  69. package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
  70. package/client/features/drawings/{useViewBuilderSketch.ts → use-view-sketch.ts} +8 -8
  71. package/client/features/harness/api.ts +36 -0
  72. package/client/features/harness/device-login-steps.tsx +97 -0
  73. package/client/features/home/api.ts +1 -81
  74. package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
  75. package/client/features/home/{HomePage.tsx → home-page.tsx} +16 -20
  76. package/client/features/overview/api.ts +2 -2
  77. package/client/features/overview/default/registry.tsx +3 -5
  78. package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +6 -13
  79. package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
  80. package/client/features/overview/{Overview.tsx → overview.tsx} +9 -12
  81. package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
  82. package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
  83. package/client/features/overview/workspace-name.tsx +55 -0
  84. package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +7 -7
  85. package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
  86. package/client/features/settings/api.ts +1 -1
  87. package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
  88. package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
  89. package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
  90. package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
  91. package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
  92. package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
  93. package/client/features/update/api.ts +1 -1
  94. package/client/features/views/api.ts +64 -131
  95. package/client/features/views/pending-view-screen.tsx +282 -0
  96. package/client/features/views/use-view-actions.ts +151 -0
  97. package/client/features/views/use-view-drafts.ts +88 -0
  98. package/client/features/views/{ViewManager.tsx → view-manager.tsx} +13 -13
  99. package/client/features/views/view-presentation.ts +4 -5
  100. package/client/features/views/view-submission.ts +88 -0
  101. package/client/features/workspace/add/api.ts +80 -0
  102. package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
  103. package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
  104. package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
  105. package/client/features/workspace/add/workspace-agent-options.ts +53 -0
  106. package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
  107. package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
  108. package/client/features/workspace/api.ts +24 -15
  109. package/client/features/workspace/browser-tab-state.ts +16 -9
  110. package/client/features/workspace/moi-context.ts +14 -16
  111. package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
  112. package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
  113. package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
  114. package/client/features/workspace/setup/workspace-setup.tsx +77 -0
  115. package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
  116. package/client/features/workspace/tab-resolution.ts +16 -29
  117. package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
  118. package/client/features/workspace/use-workspace-navigation.ts +245 -0
  119. package/client/features/workspace/workspace-content.tsx +641 -0
  120. package/client/features/workspace/workspace-identity.tsx +40 -0
  121. package/client/features/workspace/workspace-menu.tsx +63 -0
  122. package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
  123. package/client/features/workspace/workspace-screen.tsx +28 -0
  124. package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
  125. package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
  126. package/client/index.css +2 -2
  127. package/client/index.html +1 -1
  128. package/client/index.tsx +5 -1
  129. package/client/lib/agent-availability.ts +0 -5
  130. package/client/main.tsx +1 -1
  131. package/client/runtime/{useWorkspaceEvents.ts → use-workspace-events.ts} +10 -18
  132. package/client/store/ui.ts +25 -29
  133. package/dist/chunk-08ndj2rg.js +2 -0
  134. package/dist/chunk-2x040tmg.js +68 -0
  135. package/dist/chunk-3smxq0ts.js +1 -0
  136. package/dist/chunk-68ch5hs8.js +2 -0
  137. package/dist/{chunk-z3byfve5.js → chunk-9vg3xa81.js} +2 -2
  138. package/dist/chunk-c2p00p9j.css +1 -0
  139. package/dist/chunk-cs833y9j.js +1 -0
  140. package/dist/{chunk-97eg9mjn.js → chunk-d7cbm65e.js} +1 -1
  141. package/dist/{chunk-efdyz6xp.js → chunk-hvh9f5h0.js} +1 -1
  142. package/dist/{chunk-vfpsc75k.js → chunk-jvyvwwv3.js} +1 -1
  143. package/dist/chunk-nwevqe86.js +10 -0
  144. package/dist/{chunk-3a48fyf7.js → chunk-q0gbdts4.js} +4 -4
  145. package/dist/chunk-rt30jbcm.js +1 -0
  146. package/dist/chunk-y5y3kj67.js +1 -0
  147. package/dist/index.html +2 -2
  148. package/lib/format.ts +1 -1
  149. package/lib/harness-instructions.ts +30 -0
  150. package/lib/ids.ts +3 -6
  151. package/lib/moi-context.ts +102 -75
  152. package/lib/navigation.ts +48 -87
  153. package/lib/scratchpad-skew.ts +3 -3
  154. package/lib/session-drafts.ts +10 -0
  155. package/lib/types.ts +92 -51
  156. package/lib/update.ts +1 -1
  157. package/lib/view-build-directives.ts +12 -0
  158. package/lib/workspace-layout.ts +1 -1
  159. package/lib/workspace-tabs.ts +12 -7
  160. package/package.json +7 -2
  161. package/server/AGENTS.md +10 -4
  162. package/server/README.md +102 -0
  163. package/server/agent-launcher.ts +27 -0
  164. package/server/api/harnesses.ts +56 -0
  165. package/server/{api.ts → api/index.ts} +197 -299
  166. package/server/app-config.ts +45 -14
  167. package/server/app-settings.ts +1 -1
  168. package/server/applets/applet-css.ts +1 -1
  169. package/server/applets/build-applet.ts +4 -4
  170. package/server/applets/build-worker.ts +3 -2
  171. package/server/applets/config.ts +1 -1
  172. package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
  173. package/server/{functions.ts → applets/functions.ts} +3 -2
  174. package/server/applets/index.ts +2 -2
  175. package/server/{thumbnails.ts → applets/thumbnails.ts} +1 -1
  176. package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
  177. package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
  178. package/server/applets/view-source.ts +7 -1
  179. package/server/{views.ts → applets/views.ts} +35 -46
  180. package/server/{widgets.ts → applets/widgets.ts} +2 -2
  181. package/server/cli/applet-selector.ts +19 -0
  182. package/server/cli/args.ts +5 -0
  183. package/server/{cli-colors.ts → cli/colors.ts} +1 -1
  184. package/server/cli/commands/bundle.ts +119 -0
  185. package/server/cli/commands/call-server-fn.ts +42 -0
  186. package/server/cli/commands/check.ts +53 -0
  187. package/server/cli/commands/config.ts +132 -0
  188. package/server/cli/commands/debug.ts +119 -0
  189. package/server/cli/commands/env.ts +162 -0
  190. package/server/cli/commands/hermes.ts +149 -0
  191. package/server/cli/commands/init.ts +286 -0
  192. package/server/cli/commands/navigate.ts +35 -0
  193. package/server/cli/commands/openclaw.ts +168 -0
  194. package/server/cli/commands/refresh.ts +39 -0
  195. package/server/cli/commands/scratch.ts +496 -0
  196. package/server/cli/commands/service.ts +298 -0
  197. package/server/cli/commands/skill.ts +122 -0
  198. package/server/cli/commands/start.ts +138 -0
  199. package/server/cli/commands/status.ts +80 -0
  200. package/server/cli/commands/tabs.ts +43 -0
  201. package/server/cli/commands/theme.ts +192 -0
  202. package/server/cli/commands/ui-components.ts +15 -0
  203. package/server/cli/commands/update.ts +192 -0
  204. package/server/cli/commands/version.ts +9 -0
  205. package/server/cli/commands/views.ts +87 -0
  206. package/server/cli/control.ts +89 -0
  207. package/server/{cli-env.ts → cli/env.ts} +78 -56
  208. package/server/cli/index.ts +171 -0
  209. package/server/{cli-pc.ts → cli/pc.ts} +1 -1
  210. package/server/cli/provider.ts +25 -0
  211. package/server/cli/server-version.ts +16 -0
  212. package/server/cli/server.ts +81 -0
  213. package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
  214. package/server/cli.ts +2 -3215
  215. package/server/collab/manager.ts +3 -3
  216. package/server/collab/skill/index.ts +2 -2
  217. package/server/control.ts +97 -78
  218. package/server/data-dir.ts +13 -0
  219. package/server/harness/README.md +55 -25
  220. package/server/harness/acp/NOTES.md +11 -11
  221. package/server/harness/acp/adapter.ts +2 -2
  222. package/server/harness/acp/archived.ts +3 -3
  223. package/server/harness/acp/client.ts +4 -3
  224. package/server/harness/acp/discovery.ts +3 -3
  225. package/server/harness/acp/run-durations.ts +1 -1
  226. package/server/harness/acp/session.ts +9 -12
  227. package/server/harness/auth.ts +303 -0
  228. package/server/harness/claude-code/NOTES.md +9 -7
  229. package/server/harness/claude-code/adapter.ts +13 -8
  230. package/server/harness/claude-code/auth.ts +127 -18
  231. package/server/harness/claude-code/cli.ts +3 -1
  232. package/server/harness/claude-code/git-worktree.ts +5 -2
  233. package/server/harness/claude-code/index.ts +7 -1
  234. package/server/harness/claude-code/mcp.ts +3 -1
  235. package/server/harness/claude-code/models.ts +2 -0
  236. package/server/harness/claude-code/session.ts +13 -39
  237. package/server/harness/claude-code/sessions.ts +8 -12
  238. package/server/harness/codex/NOTES.md +35 -16
  239. package/server/harness/codex/adapter.ts +5 -3
  240. package/server/harness/codex/auth.ts +86 -19
  241. package/server/harness/codex/client.ts +30 -34
  242. package/server/harness/codex/index.ts +20 -1
  243. package/server/harness/codex/permissions.ts +3 -3
  244. package/server/harness/codex/probe.ts +3 -5
  245. package/server/harness/codex/session.ts +20 -25
  246. package/server/harness/codex/thread-list.ts +74 -0
  247. package/server/harness/codex/transport.ts +5 -5
  248. package/server/harness/executable.ts +42 -18
  249. package/server/harness/fork.ts +12 -0
  250. package/server/harness/hermes/NOTES.md +70 -70
  251. package/server/harness/hermes/discovery.ts +1 -1
  252. package/server/harness/openclaw/NOTES.md +24 -24
  253. package/server/harness/openclaw/adapter.ts +4 -4
  254. package/server/harness/openclaw/compat.ts +1 -1
  255. package/server/harness/openclaw/session.ts +6 -31
  256. package/server/harness/registry.ts +1 -1
  257. package/server/harness/session-title.ts +12 -3
  258. package/server/harness/shell-path.ts +31 -21
  259. package/server/harness/types.ts +17 -5
  260. package/server/navigation-relay.ts +1 -1
  261. package/server/open-browser.ts +7 -0
  262. package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
  263. package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
  264. package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
  265. package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
  266. package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
  267. package/server/server-cwd.ts +1 -1
  268. package/server/service.ts +18 -4
  269. package/server/sessions/archive.ts +32 -0
  270. package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
  271. package/server/sessions/config.ts +41 -0
  272. package/server/sessions/lifecycle.ts +17 -0
  273. package/server/sessions/pending-views.ts +164 -0
  274. package/server/sessions/selected.ts +199 -0
  275. package/server/sessions/store.ts +127 -0
  276. package/server/sessions/view-sessions.ts +267 -0
  277. package/server/{skills-template.ts → skills/template.ts} +1 -1
  278. package/server/{skill-update.ts → skills/update.ts} +5 -5
  279. package/server/{skill-version.ts → skills/version.ts} +4 -4
  280. package/server/static.ts +1 -1
  281. package/server/status.ts +6 -4
  282. package/server/web.ts +58 -49
  283. package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
  284. package/server/{workspace-env.ts → workspaces/env.ts} +30 -3
  285. package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
  286. package/server/{workspace-init.ts → workspaces/init.ts} +10 -6
  287. package/server/{layout.ts → workspaces/layout.ts} +2 -2
  288. package/server/{preview.ts → workspaces/preview.ts} +1 -1
  289. package/server/{registry.ts → workspaces/registry.ts} +17 -7
  290. package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
  291. package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +4 -3
  292. package/server/{tabs.ts → workspaces/tabs.ts} +7 -10
  293. package/ui-components/button.tsx +1 -1
  294. package/ui-components/docs/attachment.md +2 -2
  295. package/ui-components/docs/button.md +1 -1
  296. package/ui-components/docs/calendar.md +1 -1
  297. package/ui-components/docs/chart.md +4 -4
  298. package/ui-components/docs/data-table.md +1 -1
  299. package/ui-components/docs/drawer.md +1 -1
  300. package/ui-components/docs/field.md +1 -1
  301. package/ui-components/docs/input.md +2 -2
  302. package/ui-components/docs/label.md +2 -2
  303. package/ui-components/docs/table.md +2 -2
  304. package/workspace/.claude/skills/moi-workspace/SKILL.md +61 -32
  305. package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +4 -7
  306. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
  307. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
  308. package/client/features/chat/ChatPopup.tsx +0 -98
  309. package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
  310. package/client/features/chat/sessions/useSelectedSession.ts +0 -185
  311. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
  312. package/client/features/overview/WorkspaceName.tsx +0 -60
  313. package/client/features/views/ViewBuilder.tsx +0 -239
  314. package/client/features/views/useViewBuilderActions.ts +0 -103
  315. package/client/features/views/useViewBuilderDrafts.ts +0 -68
  316. package/client/features/workspace/WorkspaceScreen.tsx +0 -839
  317. package/client/features/workspace/useWorkspaceNavigation.ts +0 -203
  318. package/dist/chunk-2jncyq65.js +0 -1
  319. package/dist/chunk-e2q5ken7.js +0 -68
  320. package/dist/chunk-h2kj1ysj.js +0 -1
  321. package/dist/chunk-jf6czgrz.js +0 -2
  322. package/dist/chunk-nez8sdta.js +0 -1
  323. package/dist/chunk-nzwgm8vc.css +0 -1
  324. package/dist/chunk-ph0h6h86.js +0 -1
  325. package/dist/chunk-ryg9z3kn.js +0 -10
  326. package/dist/chunk-tpn177bt.js +0 -2
  327. package/lib/view-builder-directives.ts +0 -16
  328. package/server/agent.ts +0 -223
  329. package/server/chat-selection.ts +0 -22
  330. package/server/selected-session.ts +0 -152
  331. package/server/session-config.ts +0 -136
  332. package/server/view-builders.ts +0 -453
  333. /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
  334. /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
  335. /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
  336. /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
  337. /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
  338. /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
  339. /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
  340. /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
  341. /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
  342. /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
  343. /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
  344. /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
  345. /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
  346. /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
  347. /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
  348. /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
  349. /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
  350. /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
  351. /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
  352. /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
  353. /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
  354. /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
  355. /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
  356. /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
  357. /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
  358. /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
  359. /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
  360. /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
  361. /package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +0 -0
  362. /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
  363. /package/server/{applet-log.ts → applets/log.ts} +0 -0
  364. /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
  365. /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
  366. /package/server/{icon.ts → workspaces/icon.ts} +0 -0
  367. /package/server/{theme.ts → workspaces/theme.ts} +0 -0
@@ -69,7 +69,7 @@ function verifiedMessage(
69
69
  return message.profile.id === verifiedProfile.id ? { ...message, profile: verifiedProfile } : null
70
70
  }
71
71
 
72
- // One owner map per moi server. No LRU: active workspaces cannot be evicted.
72
+ // One owner map per Moi server. No LRU: active workspaces cannot be evicted.
73
73
  export class CollabManager {
74
74
  private slots = new Map<string, Slot>()
75
75
  private bindings = new Map<ClientSocket, Binding>()
@@ -108,7 +108,7 @@ export class CollabManager {
108
108
  binding.workspacePaths.add(canonicalPath)
109
109
  if (binding.closed) throw new CollabRuntimeError('unavailable', 'Collab connection closed')
110
110
  if (!(await (this.options.enabled ?? isCollabEnabled)(canonicalPath))) {
111
- throw new CollabRuntimeError('unavailable', 'Start moi with --experimental-collab')
111
+ throw new CollabRuntimeError('unavailable', 'Start Moi with --experimental-collab')
112
112
  }
113
113
  if (this.closed || binding.closed)
114
114
  throw new CollabRuntimeError('unavailable', 'Collab connection closed')
@@ -389,7 +389,7 @@ export class CollabManager {
389
389
  if (this.livenessTimer) clearInterval(this.livenessTimer)
390
390
  this.livenessTimer = null
391
391
  const slots = [...this.slots.values()]
392
- for (const slot of slots) this.stopSlot(slot, 'moi is shutting down')
392
+ for (const slot of slots) this.stopSlot(slot, 'Moi is shutting down')
393
393
  await Promise.allSettled(slots.map(slot => slot.child.exited))
394
394
  }
395
395
 
@@ -4,8 +4,8 @@ import { dirname, join } from 'node:path'
4
4
  import type { WorkspaceType } from '@/lib/types'
5
5
 
6
6
  import { appletDeclarationPath, installCollabDeclaration } from '../../applets/declarations'
7
- import { COLLAB_REFERENCE_SOURCE_PATH } from '../../skills-template'
8
- import { skillsDirFor } from '../../workspace-init'
7
+ import { COLLAB_REFERENCE_SOURCE_PATH } from '../../skills/template'
8
+ import { skillsDirFor } from '../../workspaces/init'
9
9
 
10
10
  export type SkillPaths = { referencePath: string; typesPath: string }
11
11
 
package/server/control.ts CHANGED
@@ -4,38 +4,44 @@ import { resolve } from 'path'
4
4
  import { parseAppletSelector } from '@/lib/applet-selector'
5
5
  import { resolveWorkspaceTheme } from '@/lib/themes'
6
6
  import type { WorkspaceEntry } from '@/lib/types'
7
- import { moiHref, parseMoiHref } from '@/lib/navigation'
7
+ import { resolveUrl } from '@/lib/navigation'
8
+ import { isWorkspaceTabId } from '@/lib/workspace-tabs'
8
9
  import { navigationRelay } from './navigation-relay'
9
10
 
10
- import { clearAppletLog, getAppletLog, getAppletLogCount } from './applet-log'
11
- import { serializeWorkspaceBundle } from './bundle-queue'
11
+ import { getAppConfig } from './app-config'
12
+ import { clearAppletLog, getAppletLog, getAppletLogCount } from './applets/log'
13
+ import { serializeWorkspaceBundle } from './applets/bundle-queue'
12
14
  import { CONTROL_HOST, CONTROL_PORT, PORT } from './constants'
13
- import { applyEnvChanged } from './env-apply'
14
- import { callFunctionEphemeral, parseFunctionPath } from './functions'
15
- import { processIcon } from './icon'
16
- import { loadLayout, saveLayout } from './layout'
15
+ import { applyEnvChanged } from './workspaces/env-apply'
16
+ import { callFunctionEphemeral, parseFunctionPath } from './applets/functions'
17
+ import { processIcon } from './workspaces/icon'
18
+ import { loadLayout, saveLayout } from './workspaces/layout'
17
19
  import { publishEvent } from './events'
18
- import { findWorkspaceForPath, listWorkspaces, registerWorkspace } from './registry'
19
- import { executeScratchOp } from './scratchpad-executor'
20
- import { readScratchpadImage, readScratchpadShapes } from './scratchpad'
21
- import { relayScratchOp } from './scratchpad-relay'
20
+ import { findWorkspaceForPath, listWorkspaces, registerWorkspace } from './workspaces/registry'
21
+ import { requiredEnvFor } from './workspaces/required-env'
22
+ import { executeScratchOp } from './scratchpad/executor'
23
+ import { readScratchpadImage, readScratchpadShapes } from './scratchpad/document'
24
+ import { relayScratchOp } from './scratchpad/relay'
22
25
  import { broadcastAll } from './state'
23
- import { assembleTabRows, assertNavigableTab } from './tabs'
24
- import { applyThemeUpdate } from './theme'
25
- import { handleBundle } from './widgets'
26
- import { getViewList, handleBundleViews, hasViewId } from './views'
27
- import {
28
- ViewBuilderError,
29
- listViewBuilders,
30
- reconcileViewBuilders,
31
- setBuilder
32
- } from './view-builders'
26
+ import { assembleTabRows, assertNavigableTab } from './workspaces/tabs'
27
+ import { applyThemeUpdate } from './workspaces/theme'
28
+ import { handleBundle } from './applets/widgets'
29
+ import { getWorkspaceViews, handleBundleViews } from './applets/views'
30
+ import { updatePendingView, PendingViewError } from './sessions/pending-views'
31
+ import { createViewFromSession, ViewStartupError } from './sessions/view-sessions'
33
32
  import {
34
33
  getWorkspaceConfig,
35
34
  setWorkspaceConfig,
36
35
  type WorkspaceConfigPatch
37
- } from './workspace-config'
36
+ } from './workspaces/config'
38
37
  import { VERSION } from './version'
38
+ import {
39
+ getWorkspaceEnvView,
40
+ parseEnvUpdate,
41
+ resolveWorkspaceEnv,
42
+ secretBackend,
43
+ updateWorkspaceEnv
44
+ } from './workspaces/env'
39
45
 
40
46
  type ControlSocket = { send(data: string): void }
41
47
 
@@ -59,7 +65,7 @@ async function resolveWorkspace(
59
65
  if (!match) {
60
66
  ws.send(
61
67
  JSON.stringify({
62
- error: `${reqPath} is not inside a registered moi workspace. Open it in moi, or run from the workspace root.`
68
+ error: `${reqPath} is not inside a registered Moi workspace. Open it in Moi, or run from the workspace root.`
63
69
  })
64
70
  )
65
71
  return null
@@ -104,6 +110,7 @@ export const control = Bun.serve({
104
110
  version: VERSION,
105
111
  pid: process.pid,
106
112
  port: PORT,
113
+ unixSocket: getAppConfig().unixSocket ?? undefined,
107
114
  service: !!process.env.MOI_SERVICE
108
115
  })
109
116
  )
@@ -118,9 +125,6 @@ export const control = Bun.serve({
118
125
  if (!match) return
119
126
  const workspacePath = match.path
120
127
  const force = !!data.force
121
- // `--no-status`: compile without advancing any view builder to `ready`
122
- // (status stays whatever the agent last reported).
123
- const skipStatus = data.noStatus === true
124
128
  const only = typeof data.only === 'string' ? parseAppletSelector(data.only) : undefined
125
129
  if (data.only && !only) {
126
130
  ws.send(JSON.stringify({ error: `Invalid applet selector "${data.only}"` }))
@@ -146,7 +150,6 @@ export const control = Bun.serve({
146
150
  match.id,
147
151
  workspacePath,
148
152
  force,
149
- skipStatus,
150
153
  only?.id
151
154
  )) {
152
155
  if (!only?.id || r.name === only.id) {
@@ -240,18 +243,44 @@ export const control = Bun.serve({
240
243
  return
241
244
  }
242
245
 
243
- if (data.type === 'builder:set') {
246
+ if (data.type === 'view:create') {
247
+ const match = await resolveWorkspace(ws, data.path)
248
+ if (!match) return
249
+ try {
250
+ if (typeof data.requirements !== 'string')
251
+ throw new Error('View requirements are required')
252
+ if (data.fromSessionId !== undefined && typeof data.fromSessionId !== 'string')
253
+ throw new Error('Invalid session id')
254
+ const result = await createViewFromSession(match, data.fromSessionId, data.requirements)
255
+ let warning: string | undefined
256
+ try {
257
+ await navigationRelay.navigate(match.id, `moi:/views/${result.viewId}`)
258
+ } catch (error) {
259
+ const message = error instanceof Error ? error.message : 'Navigation failed'
260
+ warning = `View was created, but could not open it: ${message}. Open it with moi navigate 'moi:/views/${result.viewId}'.`
261
+ }
262
+ ws.send(JSON.stringify({ ok: true, ...result, ...(warning ? { warning } : {}) }))
263
+ } catch (error) {
264
+ ws.send(
265
+ JSON.stringify({
266
+ error: error instanceof Error ? error.message : 'Couldn’t start view',
267
+ ...(error instanceof ViewStartupError
268
+ ? { sessionId: error.sessionId, viewId: error.viewId }
269
+ : {})
270
+ })
271
+ )
272
+ }
273
+ return
274
+ }
275
+
276
+ if (data.type === 'view:set') {
244
277
  const match = await resolveWorkspace(ws, data.path)
245
278
  if (!match) return
246
279
  const appletId = typeof data.id === 'string' ? data.id.trim() : ''
247
- const builderId = typeof data.builder === 'string' ? data.builder.trim() : ''
248
- const kind = data.kind === 'widget' ? 'widget' : 'view'
249
- const status =
250
- data.status === 'building' || data.status === 'waiting' ? data.status : undefined
251
280
  const title = typeof data.title === 'string' ? data.title.trim() : undefined
252
281
  const icon = typeof data.icon === 'string' ? data.icon.trim() : undefined
253
282
  if (!appletId) {
254
- ws.send(JSON.stringify({ error: 'A view or widget id is required' }))
283
+ ws.send(JSON.stringify({ error: 'A view id is required' }))
255
284
  return
256
285
  }
257
286
  if (!/^[a-z0-9][a-z0-9_-]*$/.test(appletId)) {
@@ -271,29 +300,15 @@ export const control = Bun.serve({
271
300
  return
272
301
  }
273
302
  try {
274
- // A view can't claim an id that already exists on disk (unless this
275
- // builder already owns it). Widgets live in a separate namespace.
276
- if (kind === 'view') {
277
- const current = (await listViewBuilders(match.path)).find(builder =>
278
- builderId ? builder.id === builderId : builder.viewId === appletId
279
- )
280
- if (current?.viewId !== appletId && (await hasViewId(match.path, appletId))) {
281
- ws.send(JSON.stringify({ error: `View id "${appletId}" already exists` }))
282
- return
283
- }
284
- }
285
- const builder = await setBuilder(match.id, match.path, appletId, {
286
- builderId: builderId || undefined,
287
- kind,
288
- status,
303
+ const view = await updatePendingView(match.id, match.path, appletId, {
289
304
  title,
290
305
  icon
291
306
  })
292
- ws.send(JSON.stringify({ ok: true, builder, workspacePath: match.path }))
307
+ ws.send(JSON.stringify({ ok: true, viewId: view.id }))
293
308
  } catch (err) {
294
309
  ws.send(
295
310
  JSON.stringify({
296
- error: err instanceof ViewBuilderError ? err.message : 'Could not set builder'
311
+ error: err instanceof PendingViewError ? err.message : 'Couldn’t update view'
297
312
  })
298
313
  )
299
314
  }
@@ -306,7 +321,7 @@ export const control = Bun.serve({
306
321
  if (!match) return
307
322
  const [layout, views] = await Promise.all([
308
323
  loadLayout(match.path),
309
- getViewList(match.path)
324
+ getWorkspaceViews(match.path)
310
325
  ])
311
326
  ws.send(JSON.stringify({ ok: true, tabs: assembleTabRows(views, layout.tabs.active) }))
312
327
  return
@@ -317,9 +332,11 @@ export const control = Bun.serve({
317
332
  const match = await resolveWorkspace(ws, data.path)
318
333
  if (!match) return
319
334
  try {
320
- const address = parseMoiHref(data.href)
321
- const href = moiHref(address.tab, address.search)
322
- assertNavigableTab(address.tab, await getViewList(match.path))
335
+ const href = resolveUrl(data.href)
336
+ if (!href.startsWith('moi:/') || href.startsWith('moi:/files/'))
337
+ throw new Error('Navigation needs a workspace page address')
338
+ const tab = href.slice(5).split('?', 1)[0]
339
+ if (isWorkspaceTabId(tab)) assertNavigableTab(tab, await getWorkspaceViews(match.path))
323
340
  await navigationRelay.navigate(match.id, href)
324
341
  ws.send(JSON.stringify({ ok: true, href }))
325
342
  } catch (error) {
@@ -355,13 +372,35 @@ export const control = Bun.serve({
355
372
  return
356
373
  }
357
374
 
358
- if (data.type === 'env:changed') {
359
- // A CLI env write (`moi env set`/`unset`) already landed on disk —
360
- // reap + broadcast so it takes effect (same path as PUT /env).
375
+ // `moi env` reads and writes the workspace env only through here, so a
376
+ // write takes effect at once (same path as PUT /env), and the agent on
377
+ // a managed machine, which can't open moi's data folder, can use it.
378
+ if (data.type === 'env:view') {
361
379
  const match = await resolveWorkspace(ws, data.path)
362
380
  if (!match) return
381
+ const view = await getWorkspaceEnvView(match.path, requiredEnvFor(match.path))
382
+ ws.send(JSON.stringify({ view }))
383
+ return
384
+ }
385
+
386
+ if (data.type === 'env:update') {
387
+ const match = await resolveWorkspace(ws, data.path)
388
+ if (!match) return
389
+ const patch = parseEnvUpdate(data.patch)
390
+ if (typeof patch === 'string') {
391
+ ws.send(JSON.stringify({ error: patch }))
392
+ return
393
+ }
394
+ await updateWorkspaceEnv(match.path, patch)
363
395
  applyEnvChanged(match)
364
- ws.send(JSON.stringify({ ok: true }))
396
+ ws.send(JSON.stringify({ ok: true, backend: await secretBackend() }))
397
+ return
398
+ }
399
+
400
+ if (data.type === 'env:resolve') {
401
+ const match = await resolveWorkspace(ws, data.path)
402
+ if (!match) return
403
+ ws.send(JSON.stringify({ env: await resolveWorkspaceEnv(match.path) }))
365
404
  return
366
405
  }
367
406
 
@@ -505,23 +544,3 @@ export const control = Bun.serve({
505
544
  }
506
545
  }
507
546
  })
508
-
509
- // On boot, correct any builder a previous process left mid-flight. With no live
510
- // sessions yet, a persisted `building` record is by definition stale, so
511
- // reconcile hands it back to `waiting` — or promotes it to `ready` if its view
512
- // actually reached disk. GET-time reconcile would eventually do this too, but
513
- // only once a client reopens the workspace; this makes the stored state correct
514
- // even if no one does.
515
- async function reconcileBuildersOnBoot(): Promise<void> {
516
- const workspaces = await listWorkspaces()
517
- await Promise.all(
518
- workspaces.map(async entry => {
519
- try {
520
- await reconcileViewBuilders(entry.id, entry.path, await getViewList(entry.path), new Set())
521
- } catch (err) {
522
- console.error('[control] boot reconcile failed', entry.path, err)
523
- }
524
- })
525
- )
526
- }
527
- void reconcileBuildersOnBoot()
@@ -5,5 +5,18 @@
5
5
  // e2e tests: env-paths only honors XDG_DATA_HOME on Linux, so on macOS a
6
6
  // spawned CLI would otherwise read the developer's real data dir.
7
7
  import envPaths from 'env-paths'
8
+ import { accessSync, constants } from 'node:fs'
8
9
 
9
10
  export const DATA_DIR = process.env.MOI_DATA_DIR || envPaths('moi', { suffix: '' }).data
11
+
12
+ // Can this process open moi's data folder? Not when it's the agent's own OS
13
+ // user on a managed machine (docs/config.md): such callers go through
14
+ // the running server instead. A folder that doesn't exist yet counts as usable.
15
+ export function canUseDataDir(): boolean {
16
+ try {
17
+ accessSync(DATA_DIR, constants.R_OK | constants.W_OK | constants.X_OK)
18
+ return true
19
+ } catch (err) {
20
+ return (err as NodeJS.ErrnoException).code === 'ENOENT'
21
+ }
22
+ }
@@ -1,8 +1,8 @@
1
1
  # Harnesses
2
2
 
3
- A **harness** is an agent backend moi can drive: it receives user messages,
3
+ A **harness** is an agent backend Moi can drive: it receives user messages,
4
4
  runs an agentic loop (model + tools) in a workspace, and streams back events
5
- that moi normalizes into its agent-agnostic display format.
5
+ that Moi normalizes into its agent-agnostic display format.
6
6
 
7
7
  ## The layers
8
8
 
@@ -47,6 +47,8 @@ Socket-protocol notes the layers rely on (all defined in `lib/types.ts`):
47
47
  uuid, then rekeyed to the backend's real session/thread id.
48
48
  - **`sessions_changed`** — a provider changed session-list metadata such as a
49
49
  generated session title; clients refresh that workspace's session list.
50
+ - **`session_archived`** — a chat was archived; clients remove it from caches and
51
+ clear its selections and pin, including browser-local Collab selections.
50
52
  - **Optimistic-id rendezvous** — the client sends `optimisticId` with each
51
53
  chat; the user's bubble must upsert under that id. Backends differ: Codex
52
54
  echoes it natively (`clientUserMessageId` → `clientId`), Claude Code never
@@ -66,6 +68,7 @@ Socket-protocol notes the layers rely on (all defined in `lib/types.ts`):
66
68
  ```
67
69
  server/harness/
68
70
  README.md this file
71
+ auth.ts shared login lifecycle and readiness checks
69
72
  debug.ts shared debug taps (wire + client-frame rings) for /dev/harness
70
73
  detect.ts which harness owns a directory — `moi init`'s auto-detection
71
74
  (Hermes profile → OpenClaw agent → Codex → Claude Code)
@@ -87,9 +90,10 @@ server/harness/
87
90
  `sessionTitle`, `generateSessionTitle`, and `session-title.ts`. Chat naming is
88
91
  for client and UI labels. Thread naming stays at provider wire and RPC
89
92
  boundaries.
90
- - Outside code imports only this folder's top level. Documented exceptions:
91
- `cli.ts` (`moi openclaw init` provisioning) imports
92
- `harness/openclaw/discovery.ts`; tests may import harness internals.
93
+ - Outside code imports this folder's top level. Provisioning exceptions are
94
+ `cli/commands/openclaw.ts`, `cli/commands/hermes.ts`, and `workspaces/import.ts`,
95
+ which use the corresponding provider's discovery module. Tests may import
96
+ harness internals.
93
97
 
94
98
  Current harnesses:
95
99
 
@@ -132,7 +136,7 @@ Hermes still implements; delete that block when agents move to
132
136
  Dev tooling: `/dev/harness` (live wire log + client frames + trigger
133
137
  scenarios for any workspace, backed by `GET /api/workspaces/:id/harness/debug`
134
138
  and the taps in `debug.ts`) and `codex/probe.ts` (drive the raw codex
135
- app-server protocol without moi).
139
+ app-server protocol without Moi).
136
140
 
137
141
  ## Implementation status
138
142
 
@@ -183,8 +187,8 @@ per-chat model switching from the catalog `session/new` returns inline, and
183
187
  backend-generated session titles surfaced through `sessions_changed`. Agents are
184
188
  Hermes **profiles** — discovered from `$HERMES_HOME`, imported with
185
189
  `moi hermes init <profile>`, never created from the UI (OpenClaw's model).
186
- Sessions run in Hermes's `dont_ask` mode to match moi's bypass-permissions trust
187
- model. Known gaps: no mid-turn steering (moi queues instead), no subagent lanes,
190
+ Sessions run in Hermes's `dont_ask` mode to match Moi's bypass-permissions trust
191
+ model. Known gaps: no mid-turn steering (Moi queues instead), no subagent lanes,
188
192
  no reasoning-effort control, and `session/set_model` drops session-scoped MCP
189
193
  servers upstream. Two backend quirks are worked around in `acp/session.ts`:
190
194
  tool calls left unsettled at turn end are closed (Hermes never completes file
@@ -200,21 +204,41 @@ matches the picker even when Codex config names an unavailable model.
200
204
 
201
205
  Workspace env is fixed at process spawn. Executable lookup prefers PATH over
202
206
  the desktop bundle; config and credentials remain owned by Codex. Sessions use
203
- workspace-write access with network disabled, and moi automatically accepts
207
+ workspace-write access with network disabled, and Moi automatically accepts
204
208
  supported permission requests. Command-approval UI, native question forms, and
205
209
  MCP elicitation are not implemented. See [Codex harness notes](codex/NOTES.md)
206
210
  for module ownership, ordering rules, runtime diagnostics, and boundaries.
207
211
 
208
- Workspace availability also checks provider authentication when a workspace is
209
- given. Claude Code is probed with `claude auth status` under the effective
210
- workspace env; `claude auth login` launches its browser sign-in from the composer. Codex
211
- uses app-server `account/read` and returns a browser OAuth URL through
212
- `account/login/start`. The server owns the recovery loop (`server/agent.ts`):
213
- `GET /api/workspaces/:id/agent` serves a cached availability snapshot alongside
214
- the model catalog, `POST .../auth/login` reuses a pending browser URL or restarts
215
- a URL-less provider flow, and a server-side watch loop re-probes until the login
216
- lands or times out, pushing `agent:updated` events to every tab. The composer
217
- renders that state; it never polls.
212
+ ### Authentication and readiness
213
+
214
+ `auth.ts` owns cached readiness checks and one active login per harness.
215
+ Login uses the server process environment; workspace readiness checks use each
216
+ workspace's environment. Login credentials remain owned by the provider CLI.
217
+
218
+ - **Claude Code:** `claude auth status` checks readiness. `claude auth login`
219
+ opens the browser callback URL locally, with a separate manual-code URL as a
220
+ fallback. Cloud uses the manual-code URL and writes the returned `code#state`
221
+ to the CLI's stdin.
222
+ - **Codex:** `account/read` checks readiness; ChatGPT accounts also require a
223
+ successful `account/rateLimits/read` to detect expired credentials.
224
+ `account/login/start` uses browser OAuth locally and `chatgptDeviceCode` in
225
+ cloud. Local login opens the browser; cloud returns a URL and device code.
226
+
227
+ `GET /api/harnesses/:type/auth` returns cached global readiness and login state.
228
+ `POST /api/harnesses/:type/auth/login` starts or reuses an attempt;
229
+ `POST /api/harnesses/:type/auth/login/:id/code` submits a manual authorization
230
+ code. The attempt ID rejects submissions from an older login. Startup reports
231
+ `starting`; `pending` includes an attempt ID and sign-in URL.
232
+
233
+ During login, the server rechecks readiness until the provider confirms
234
+ completion and readiness succeeds, or the attempt fails or reaches its
235
+ ten-minute deadline. Shutdown cancels active attempts. Auth changes trigger
236
+ independent readiness checks for registered workspaces using that harness,
237
+ published as `harness:updated` events.
238
+
239
+ `GET /api/workspaces/:id/agent` returns workspace readiness and the model
240
+ catalog. Adding `?refresh=true` refreshes the shell PATH and bypasses the
241
+ readiness cache.
218
242
 
219
243
  ## What a harness adapter must support
220
244
 
@@ -244,6 +268,12 @@ doubles as the evaluation rubric for new harnesses.
244
268
 
245
269
  ### Per-request configuration
246
270
 
271
+ - **Fork settings** — shared orchestration snapshots the source `SessionConfig`,
272
+ passes it to native `forkSession`, saves it on the child, and uses it for the
273
+ first send. Model, effort, and fast mode are inherited together. Adapters only
274
+ translate settings their native fork needs at creation; they do not read or
275
+ copy stored settings themselves. The fresh-chat fallback follows the same
276
+ rule when native forking is unavailable. Hermes currently has no effort control.
247
277
  - **List supported models**, including per-model metadata such as supported
248
278
  effort levels (drives the picker).
249
279
  - **Set model** — ideally live mid-session.
@@ -252,7 +282,7 @@ doubles as the evaluation rubric for new harnesses.
252
282
  - **Thinking/reasoning display mode** (Codex requests `summary: 'detailed'`
253
283
  so visible summaries do not depend on CLI defaults).
254
284
  - **Token streaming opt-in** (CC: `includePartialMessages`, construct-time;
255
- Codex: always streams, moi gates forwarding).
285
+ Codex: always streams, Moi gates forwarding).
256
286
  - **Permissions / tool policy** — allowed tools, permission mode; backends
257
287
  with interactive approvals need a prompt-callback path.
258
288
  - **Env injection + cwd** — per-workspace env for the agent's shell, frozen at
@@ -272,7 +302,7 @@ doubles as the evaluation rubric for new harnesses.
272
302
  ### Input capabilities
273
303
 
274
304
  - Images (base64 blocks vs data URLs vs file paths — a capability, not a given).
275
- - Attachments share `server/attachment-message.ts` for preparation and
305
+ - Attachments share `server/sessions/attachment-message.ts` for preparation and
276
306
  `lib/moi-attachments.ts` for serialization and replay. Files and path-delivered
277
307
  images carry readable paths; inline images keep their native content blocks.
278
308
  - Rich content blocks vs plain-string prompts.
@@ -293,14 +323,14 @@ doubles as the evaluation rubric for new harnesses.
293
323
  - Compaction trigger/observe.
294
324
  - Queued-message semantics: does the backend queue natively or must the
295
325
  server?
296
- - Push health/auth status events from the backend itself (the server watch
297
- loop still discovers login completion by re-probing; a provider callback
298
- would let `agent:updated` fire without polling anywhere).
326
+ - Push unsolicited health/auth changes from providers, such as an external
327
+ sign-out. Login completion is already tracked; readiness checks are still
328
+ needed to detect changes outside an active login.
299
329
 
300
330
  ## Capability comparison
301
331
 
302
332
  Legend: ✅ supported · ⚠️ partial/workaround · ❌ missing. The Codex column
303
- describes what moi exposes, not every RPC available in the upstream protocol.
333
+ describes what Moi exposes, not every RPC available in the upstream protocol.
304
334
 
305
335
  | Feature | Claude Agent SDK | OpenClaw gateway | Codex app-server | Hermes (ACP) |
306
336
  | ------------------------ | --------------------------------------------------- | ------------------------- | ------------------------------------- | ------------------------------------ |
@@ -4,7 +4,7 @@ Updated 2026-09-05 (Asia/Nicosia). These notes replace the original conformance
4
4
  report and its implementation plan. Findings, verification limits, and proposed
5
5
  solutions are consolidated here. The fixes below are not implemented.
6
6
 
7
- **Fix moi's session lifecycle and protocol mapping before adding providers.**
7
+ **Fix Moi's session lifecycle and protocol mapping before adding providers.**
8
8
  The independent host probe exposed twelve failed behavior checks despite all
9
9
  42 existing ACP tests passing. Provider compatibility then needs a few focused
10
10
  hooks: fx process isolation and history retrieval, Hermes completion/usage
@@ -13,7 +13,7 @@ migration, and custom-agent registry are not prerequisites.
13
13
 
14
14
  ## 1. Evidence and verification
15
15
 
16
- Fresh tests ran against moi `9bfd2ed` and `@agentclientprotocol/sdk@1.3.0`:
16
+ Fresh tests ran against Moi `9bfd2ed` and `@agentclientprotocol/sdk@1.3.0`:
17
17
 
18
18
  | Agent | Command | Installed version | Model used |
19
19
  | ------ | ------------------ | ----------------------------- | ----------------------------------- |
@@ -30,7 +30,7 @@ shell/write/read operations, injected environment values checked against the
30
30
  resulting file, multiple sessions, cold list/load/resume, nonexistent sessions,
31
31
  nondefault modes, cancellation during tools, and broken MCP startup. Hermes
32
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.
33
+ drove Moi's actual ACP client, session, and adapter through a mock subprocess.
34
34
 
35
35
  Images, successful MCP calls, permission-denial behavior, Cursor `--force`, and
36
36
  subagent transcripts have **historical capture evidence only**. Those captures
@@ -90,7 +90,7 @@ not a destructive runtime probe against a user's active sessions.
90
90
 
91
91
  The installed SDK explicitly defines `ToolCallUpdate.content` and `locations`
92
92
  as replacements. An omitted field preserves its previous value; an explicit
93
- `[]` clears it. moi currently fails to clear both and drops `rawOutput`.
93
+ `[]` clears it. Moi currently fails to clear both and drops `rawOutput`.
94
94
  Preserve structured diffs and outputs instead of flattening them to `newText`.
95
95
 
96
96
  `rawOutput` and `UsageUpdate.cost` are standard fields in SDK 1.3.0; cost is a
@@ -127,7 +127,7 @@ and surface rejected changes. See [session config options](https://agentclientpr
127
127
 
128
128
  Modes are not a portable permission policy: `code` or `agent` does not imply
129
129
  bypass. Apply an explicit preset policy and answer permission requests.
130
- `resumeSession` already reapplies moi's no-prompt mode after `session/load`;
130
+ `resumeSession` already reapplies Moi's no-prompt mode after `session/load`;
131
131
  adding that same load-path fix again would be redundant.
132
132
 
133
133
  ### Capabilities and authentication need separate checks
@@ -140,7 +140,7 @@ agents. No login was performed during this audit.
140
140
 
141
141
  Check advertised image/resource capabilities. An agent reading a supplied URI
142
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
143
+ random marker with no readable file. Moi's text-only chunk handler currently
144
144
  drops unsupported assistant media. Unknown extension requests should receive
145
145
  prompt errors, but returning an error is not implementing the associated feature.
146
146
 
@@ -267,7 +267,7 @@ background command exited. Test this path before implementing late-output rules.
267
267
  can arrive after the start. Tool IDs can include newlines; replay IDs differ.
268
268
  - **Keep the existing permission callback policy.** Shell approval was freshly
269
269
  observed; successful MCP calls and `--force` have historical evidence.
270
- The callback already supports moi's current auto-approval behavior; requiring
270
+ The callback already supports Moi's current auto-approval behavior; requiring
271
271
  a global flag is unnecessary.
272
272
  - **Plan mode needs an implementation:** historical captures show a
273
273
  `cursor/create_plan` request. Returning an unsupported-method error prevents
@@ -284,7 +284,7 @@ background command exited. Test this path before implementing late-output rules.
284
284
  - **Treat connector startup separately:** broken stdio MCP creation still
285
285
  returned a session ID, as with Hermes.
286
286
 
287
- ## 5. Existing moi defects and acceptance criteria
287
+ ## 5. Existing Moi defects and acceptance criteria
288
288
 
289
289
  The independent host probe reproduced twelve failed checks, grouped below into
290
290
  nine related problems. These are host defects, independent of the provider
@@ -391,9 +391,9 @@ linked existing upstream issue is #1; no new reports were sent in this audit.
391
391
  | 6 | fx | Invalid model accepted on the tested gateway. Validate picker values and confirmed state; do not generalize to every backend. |
392
392
  | 7 | Hermes | Missing file-tool completions confirmed. Honest unresolved outcomes locally; invocation-ID pairing upstream. |
393
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. |
394
+ | 9 | Cursor | Shell approvals confirmed; MCP/force historical. Existing permission callback supports current Moi policy. |
395
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. |
396
+ | 11 | All | Universal mode reset disproved. Cursor preserves plan; Hermes preserves warm mode; Moi already reapplies mode after load. |
397
397
  | 12 | fx | Effort option inert. No global settings swap; upstream session-local option and persistence. |
398
398
  | 13 | Hermes | Effort config not passed through constructor path. Resolve/pass session reasoning upstream; keep picker unavailable meanwhile. |
399
399
  | 14 | Cursor | Exact catalog variants work; separate effort override not established. Do not invent IDs or claim impossibility. |
@@ -402,7 +402,7 @@ linked existing upstream issue is #1; no new reports were sent in this audit.
402
402
  | 17 | Hermes | Newly found cumulative prompt usage. Delta only within a known agent instance and preserve unknown baselines. |
403
403
  | 18 | Hermes | Newly found nonexistent load returns `{}`. Explicit error upstream; cautious membership checks locally. |
404
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). |
405
+ | 20 | Moi | Twelve failed host checks plus source-confirmed lifecycle gaps. Fix and regress before adding providers (§5–7). |
406
406
 
407
407
  ## 9. Sources and remaining uncertainty
408
408
 
@@ -18,7 +18,7 @@ import {
18
18
  type Usage,
19
19
  toolContentToText
20
20
  } from './wire'
21
- import type { SessionInfo } from '@/lib/types'
21
+ import type { SessionSummary } from '@/lib/types'
22
22
 
23
23
  export type AcpProviderId = NonNullable<ToolCall['provider']>
24
24
 
@@ -115,7 +115,7 @@ export function replayedUserParts(raw: string, images: readonly Part[] = []): Pa
115
115
  return replayAttachmentParts([...images, { type: 'text', text: raw }])
116
116
  }
117
117
 
118
- export function acpSessionToSessionInfo(entry: AcpSessionListEntry): SessionInfo {
118
+ export function acpSessionToSessionInfo(entry: AcpSessionListEntry): SessionSummary {
119
119
  const updated = entry.updatedAt ? Date.parse(entry.updatedAt) : NaN
120
120
  return {
121
121
  sessionId: entry.sessionId,
@@ -9,13 +9,13 @@
9
9
  //
10
10
  // Nothing is destroyed: the chat stays in the backend's own store and remains
11
11
  // visible to that agent's CLI, which is the correct boundary — moi hides a chat
12
- // from moi, not from the user's agent.
12
+ // from Moi, not from the user's agent.
13
13
  //
14
- // Stored OUTSIDE the workspace (no repo churn) in ONE global JSON file in moi's
14
+ // Stored OUTSIDE the workspace (no repo churn) in ONE global JSON file in Moi's
15
15
  // data dir, keyed by workspace path then session id:
16
16
  // { "<workspacePath>": ["<sessionId>", …] }
17
17
  // Path (not registry id) is the key so the list survives re-registration, the
18
- // same choice session-config.ts makes.
18
+ // same choice server/sessions/config.ts makes.
19
19
  import { mkdir, rename } from 'node:fs/promises'
20
20
  import { join } from 'node:path'
21
21