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
@@ -1,5 +1,5 @@
1
1
  // Per-workspace environment variables surfaced to both spawn sites: the widget
2
- // function workers (functions.ts) and the agent chat session (cc-session.ts).
2
+ // function workers (server/applets/functions.ts) and agent harness processes.
3
3
  //
4
4
  // Two sources feed a workspace's effective env:
5
5
  // 1. Discovered `.env` files in the workspace root (`.env`, then `.env.local`,
@@ -20,7 +20,7 @@ import { parseEnv } from 'node:util'
20
20
 
21
21
  import type { WorkspaceEnvVar, WorkspaceEnvView } from '@/lib/types'
22
22
 
23
- import { DATA_DIR } from './data-dir'
23
+ import { DATA_DIR } from '../data-dir'
24
24
 
25
25
  // Dotenv files scanned in the workspace root, low → high precedence. A later
26
26
  // file's keys override an earlier file's (base `.env`, machine-local `.env.local`).
@@ -299,7 +299,7 @@ async function loadWorkspaceEnvState(workspacePath: string): Promise<WorkspaceEn
299
299
 
300
300
  // The effective env: discovered `.env` (when inherited) overlaid with the
301
301
  // custom secrets. Injected at spawn — env is frozen once the process starts,
302
- // so changes require a restart (see functions.ts / cc-session.ts).
302
+ // so changes require a restart (see server/applets/functions.ts and server/harness/).
303
303
  export async function resolveWorkspaceEnv(workspacePath: string): Promise<Record<string, string>> {
304
304
  const { secrets, dotenv } = await loadWorkspaceEnvState(workspacePath)
305
305
  return { ...dotenv, ...secrets }
@@ -328,6 +328,33 @@ export type EnvUpdate = {
328
328
  inheritDotenv?: boolean
329
329
  }
330
330
 
331
+ // Validate an env patch that arrives from outside the process (PUT /env, the
332
+ // control port). Returns the patch, or an error message for the caller.
333
+ export function parseEnvUpdate(body: unknown): EnvUpdate | string {
334
+ if (!body || typeof body !== 'object') return 'Bad request'
335
+ const raw = body as Record<string, unknown>
336
+ const patch: EnvUpdate = {}
337
+ if (raw.set !== undefined) {
338
+ if (typeof raw.set !== 'object' || raw.set === null) return 'set must be an object'
339
+ for (const [k, v] of Object.entries(raw.set)) {
340
+ if (!isValidEnvKey(k)) return `Invalid env key: ${k}`
341
+ if (typeof v !== 'string') return `Value for ${k} must be a string`
342
+ }
343
+ patch.set = raw.set as Record<string, string>
344
+ }
345
+ if (raw.remove !== undefined) {
346
+ if (!Array.isArray(raw.remove) || raw.remove.some(k => typeof k !== 'string')) {
347
+ return 'remove must be an array of strings'
348
+ }
349
+ patch.remove = raw.remove as string[]
350
+ }
351
+ if (raw.inheritDotenv !== undefined) {
352
+ if (typeof raw.inheritDotenv !== 'boolean') return 'inheritDotenv must be a boolean'
353
+ patch.inheritDotenv = raw.inheritDotenv
354
+ }
355
+ return patch
356
+ }
357
+
331
358
  // Apply a patch to a workspace's custom secrets + metadata. Patch (not replace)
332
359
  // semantics, because values are write-only — the UI can add/update one key
333
360
  // without resending the others. Serialized per workspace to avoid lost updates.
@@ -2,10 +2,10 @@ import { resolve } from 'node:path'
2
2
 
3
3
  import type { WorkspaceType } from '@/lib/types'
4
4
 
5
- import { discoverHermesProfiles } from './harness/hermes/discovery'
6
- import type { HermesProfile } from './harness/hermes/discovery'
7
- import { discoverOpenClawAgents } from './harness/openclaw/discovery'
8
- import type { OpenClawAgent } from './harness/openclaw/discovery'
5
+ import { discoverHermesProfiles } from '../harness/hermes/discovery'
6
+ import type { HermesProfile } from '../harness/hermes/discovery'
7
+ import { discoverOpenClawAgents } from '../harness/openclaw/discovery'
8
+ import type { OpenClawAgent } from '../harness/openclaw/discovery'
9
9
 
10
10
  export type WorkspaceImportMetadata = {
11
11
  name?: string
@@ -1,4 +1,4 @@
1
- // The one place that knows how to turn a directory into a moi workspace:
1
+ // The one place that knows how to turn a directory into a Moi workspace:
2
2
  // bundled skills + the `.moi/` scaffold, with the skills location keyed on the
3
3
  // agent backend. `moi init`, `moi openclaw init`, and the HTTP API (UI import /
4
4
  // create) all provision through here, so a workspace set up from the UI is
@@ -10,9 +10,10 @@ import { join } from 'node:path'
10
10
  import type { WorkspaceType } from '@/lib/types'
11
11
  export { validateWorkspaceFolderName } from '@/lib/workspace-name'
12
12
 
13
- import { harnessFor } from './harness/registry'
14
- import { createDependencyInstallLogPath, scaffoldMoiDir } from './moi-scaffold'
15
- import { installBundledSkills } from './skills-template'
13
+ import { getAppConfig } from '../app-config'
14
+ import { harnessFor } from '../harness/registry'
15
+ import { createDependencyInstallLogPath, scaffoldMoiDir } from './scaffold'
16
+ import { installBundledSkills } from '../skills/template'
16
17
 
17
18
  // Where each backend loads skills from — the harness owns the answer
18
19
  // (Claude Code: `.claude/skills/`; OpenClaw: `<workspace>/skills/`; Codex:
@@ -24,8 +25,11 @@ export function skillsDirFor(workspaceRoot: string, type?: WorkspaceType): strin
24
25
 
25
26
  // Folder that holds workspaces created from the UI (`/workspace/create`) — a
26
27
  // visible home-dir folder, mirroring how Cowork keeps its session folders under
27
- // the user's home rather than an app-data dir.
28
- export const CREATED_WORKSPACES_ROOT = join(homedir(), 'moi')
28
+ // the user's home rather than an app-data dir. Managed machines set their own
29
+ // (`workspacesDir` in config.json).
30
+ export function createdWorkspacesRoot(): string {
31
+ return getAppConfig().workspacesDir ?? join(homedir(), 'moi')
32
+ }
29
33
 
30
34
  export type ProvisionResult = {
31
35
  // Where the skills were installed (backend-dependent, see skillsDirFor).
@@ -9,7 +9,7 @@ import type {
9
9
  import { createDefaultWorkspaceLayout, normalizeWorkspaceTabs } from '@/lib/workspace-layout'
10
10
  import { isWorkspaceIcon } from '@/lib/workspace-icon'
11
11
 
12
- import { getCapturedThumbnails } from './thumbnails'
12
+ import { getCapturedThumbnails } from '../applets/thumbnails'
13
13
 
14
14
  function normalizeLayout(parsed: Record<string, unknown>): WorkspaceLayout {
15
15
  const defaults = createDefaultWorkspaceLayout()
@@ -24,7 +24,7 @@ function normalizeLayout(parsed: Record<string, unknown>): WorkspaceLayout {
24
24
  delete layout.icon
25
25
  }
26
26
  // Legacy thumbnail caches are intentionally dropped, not migrated — images
27
- // now live as files under `.moi/.cache/thumbnails` (server/thumbnails.ts)
27
+ // now live as files under `.moi/.cache/thumbnails` (server/applets/thumbnails.ts)
28
28
  // and applets are simply captured again there.
29
29
  delete layout.widgetThumbnails
30
30
  delete layout.viewThumbnails
@@ -14,7 +14,7 @@ import { statSync } from 'node:fs'
14
14
 
15
15
  import sharp from 'sharp'
16
16
 
17
- import { resolveWorkspaceMediaFile } from './applets'
17
+ import { resolveWorkspaceMediaFile } from '../applets'
18
18
 
19
19
  // Long edge of the rendered preview. 2× the ~300px display size keeps it crisp
20
20
  // on retina without shipping the original.
@@ -1,4 +1,4 @@
1
- import { existsSync } from 'node:fs'
1
+ import { existsSync, realpathSync } from 'node:fs'
2
2
  import { rename, rm } from 'node:fs/promises'
3
3
  import { homedir } from 'node:os'
4
4
  import { join, resolve, sep } from 'path'
@@ -7,9 +7,9 @@ import { newWorkspaceId, validateWorkspaceId } from '@/lib/ids'
7
7
  import type { DiscoveredWorkspace, WorkspaceEntry, WorkspaceType } from '@/lib/types'
8
8
  import { orderWorkspaceTypes } from '@/lib/workspace-types'
9
9
 
10
- import { DATA_DIR } from './data-dir'
11
- import { allHarnesses } from './harness/registry'
12
- import type { DiscoveredWorkspaceCandidate } from './harness/types'
10
+ import { DATA_DIR } from '../data-dir'
11
+ import { allHarnesses } from '../harness/registry'
12
+ import type { DiscoveredWorkspaceCandidate } from '../harness/types'
13
13
 
14
14
  // Replace the home-dir prefix with `~` for display. Keeps the original
15
15
  // absolute path in place; callers should put the result in `displayPath`.
@@ -186,10 +186,20 @@ export function findWorkspaceForPath<T extends { path: string }>(
186
186
  workspaces: T[],
187
187
  reqPath: string
188
188
  ): T | null {
189
- const normal = resolve(reqPath)
190
- const matches = workspaces.filter(w => normal === w.path || normal.startsWith(w.path + sep))
189
+ // Shells can resolve aliases such as macOS /tmp → /private/tmp differently.
190
+ function canonicalPath(path: string) {
191
+ try {
192
+ return realpathSync(path)
193
+ } catch {
194
+ return resolve(path)
195
+ }
196
+ }
197
+ const normal = canonicalPath(reqPath)
198
+ const matches = workspaces
199
+ .map(workspace => ({ workspace, path: canonicalPath(workspace.path) }))
200
+ .filter(w => normal === w.path || normal.startsWith(w.path + sep))
191
201
  if (matches.length === 0) return null
192
- return matches.reduce((best, w) => (w.path.length > best.path.length ? w : best))
202
+ return matches.reduce((best, w) => (w.path.length > best.path.length ? w : best)).workspace
193
203
  }
194
204
 
195
205
  // If `p` lies inside a workspace's `.moi/` directory, return the workspace root
@@ -1,8 +1,8 @@
1
1
  // The env "required" view aggregates `config.requiredEnv` declared by both
2
2
  // widgets and views, each key mapped to the bundle ids that asked for it.
3
- // Shared by the env API (api.ts) and the `moi env` CLI (cli-env.ts).
4
- import { collectViewRequiredEnv } from './views'
5
- import { collectRequiredEnv } from './widgets'
3
+ // Shared by the env API (server/api/index.ts) and control-port handlers.
4
+ import { collectViewRequiredEnv } from '../applets/views'
5
+ import { collectRequiredEnv } from '../applets/widgets'
6
6
 
7
7
  export async function requiredEnvFor(workspacePath: string): Promise<Record<string, string[]>> {
8
8
  const [widgets, views] = await Promise.all([
@@ -6,7 +6,8 @@ import { appendFile, mkdir, open, stat } from 'node:fs/promises'
6
6
  import { tmpdir } from 'node:os'
7
7
  import { join, resolve, sep } from 'node:path'
8
8
 
9
- import { syncAppletDeclarations } from './applets/declarations'
9
+ import { agentCommand } from '../agent-launcher'
10
+ import { syncAppletDeclarations } from '../applets/declarations'
10
11
 
11
12
  // Dependency set available to widgets. `react`/`react-dom` are stubs — at
12
13
  // runtime they resolve to moi's locally-vendored ESM via the browser importmap
@@ -54,7 +55,7 @@ async function runBunInstall(moiDir: string, logPath: string): Promise<number> {
54
55
  await log.writeFile(
55
56
  `bun install started at ${new Date().toISOString()}\nWorking directory: ${moiDir}\n\n`
56
57
  )
57
- install = Bun.spawn(['bun', 'install'], {
58
+ install = Bun.spawn(agentCommand(['bun', 'install']), {
58
59
  cwd: moiDir,
59
60
  stdin: 'ignore',
60
61
  // Direct file descriptors keep capturing both streams after a
@@ -94,7 +95,7 @@ async function runBunInstall(moiDir: string, logPath: string): Promise<number> {
94
95
  // package.json, and lockfile stay committable — they ARE the workspace.
95
96
  const REQUIRED_IGNORES = ['.build/', '.cache/', 'node_modules/'] as const
96
97
 
97
- export const MOI_GITIGNORE = `# moi internals — machine-local, re-creatable state
98
+ export const MOI_GITIGNORE = `# Moi internals — machine-local, re-creatable state
98
99
  ${REQUIRED_IGNORES.join('\n')}
99
100
  `
100
101
 
@@ -1,6 +1,5 @@
1
1
  // Tab discovery with portable navigation addresses.
2
2
  import type { ViewInfo, WorkspaceTabId } from '@/lib/types'
3
- import { moiHref } from '@/lib/navigation'
4
3
  import { viewTabId } from '@/lib/workspace-tabs'
5
4
 
6
5
  // One row of `moi tabs`. `isDefault` marks the workspace's saved default tab
@@ -9,27 +8,25 @@ export type TabRow = {
9
8
  id: WorkspaceTabId
10
9
  title: string
11
10
  isDefault: boolean
12
- href?: string
11
+ href: string
13
12
  }
14
13
 
15
14
  // The always-present tabs, titled like the tab bar renders them.
16
15
  const STATIC_TABS: { id: WorkspaceTabId; title: string }[] = [
17
16
  { id: 'overview', title: 'Overview' },
18
- { id: 'agent', title: 'Agent' },
19
17
  { id: 'scratchpad', title: 'Scratchpad' }
20
18
  ]
21
19
 
22
- // The `moi tabs` listing: static tabs plus each built view, the saved default
23
- // marked. View builders are transient build-state, not addressable tabs, so
24
- // they don't list (and a builder default simply marks no row).
20
+ // The `moi tabs` listing: static tabs plus every compiled or pending view, with
21
+ // the saved default marked.
25
22
  export function assembleTabRows(views: ViewInfo[], defaultTab: WorkspaceTabId): TabRow[] {
26
23
  return [
27
24
  ...STATIC_TABS,
28
- ...views.map(view => ({ id: viewTabId(view.id), title: view.config.title || view.id }))
25
+ ...views.map(view => ({ id: viewTabId(view.id), title: view.title || view.id }))
29
26
  ].map(row => ({
30
27
  ...row,
31
28
  isDefault: row.id === defaultTab,
32
- ...(row.id === 'agent' ? {} : { href: moiHref(row.id) })
29
+ href: `moi:/${row.id}`
33
30
  }))
34
31
  }
35
32
 
@@ -37,9 +34,9 @@ export function assembleTabRows(views: ViewInfo[], defaultTab: WorkspaceTabId):
37
34
  // browser to move. The browser repeats the availability check in case its view
38
35
  // list is stale in either direction.
39
36
  export function assertNavigableTab(tab: WorkspaceTabId, views: ViewInfo[]): void {
40
- const rows = assembleTabRows(views, 'agent').filter(row => row.href)
37
+ const rows = assembleTabRows(views, 'overview')
41
38
  if (rows.some(row => row.id === tab)) return
42
39
  throw new Error(
43
- `Unknown destination "${moiHref(tab)}". Valid addresses: ${rows.map(row => row.href).join(', ')}`
40
+ `Unknown destination "moi:/${tab}". Valid addresses: ${rows.map(row => row.href).join(', ')}`
44
41
  )
45
42
  }
@@ -11,7 +11,7 @@ const buttonVariants = cva(
11
11
  default:
12
12
  'bg-primary text-primary-foreground inset-shadow-[0_0_8px_color-mix(in_oklab,var(--color-white)_20%,transparent)] hover:bg-primary/90 disabled:bg-accent disabled:text-muted-foreground disabled:opacity-100 disabled:shadow-none',
13
13
  secondary:
14
- 'bg-accent text-accent-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)]',
14
+ 'bg-accent text-accent-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)] disabled:text-muted-foreground disabled:opacity-100',
15
15
  outline:
16
16
  'border bg-background text-foreground hover:bg-[color-mix(in_oklch,var(--background),var(--foreground)_3%)]',
17
17
  ghost: 'hover:bg-accent hover:text-accent-foreground',
@@ -112,7 +112,7 @@ moi ui-components add attachment
112
112
 
113
113
  <Steps className="mb-0 pt-2">
114
114
 
115
- <Step>Install the required moi component:</Step>
115
+ <Step>Install the required Moi component:</Step>
116
116
 
117
117
  ```bash
118
118
  moi ui-components add button
@@ -664,7 +664,7 @@ A container for one or more actions, aligned to the end of the attachment.
664
664
 
665
665
  ### AttachmentAction
666
666
 
667
- An action button. Renders a [`Button`](/docs/components/button) and accepts all of its props.
667
+ An action button. Renders a [`Button`](button.md) and accepts all of its props.
668
668
 
669
669
  | Prop | Type | Default | Description |
670
670
  | ---------- | ------------------------------------- | ----------- | ---------------------------------------- |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Button
3
- description: The shared button for moi and its views.
3
+ description: The shared button for Moi and its views.
4
4
  ---
5
5
 
6
6
  ## Add
@@ -95,7 +95,7 @@ The `Calendar` component is built on top of [React DayPicker](https://react-day-
95
95
 
96
96
  ## Date Picker
97
97
 
98
- You can use the `<Calendar>` component to build a date picker. See the [Date Picker](/docs/components/base/date-picker) page for more information.
98
+ You can use the `<Calendar>` component to build a date picker. See the [Date Picker](date-picker.md) page for more information.
99
99
 
100
100
  ## Persian / Hijri / Jalali Calendar
101
101
 
@@ -170,7 +170,7 @@ Introducing **Charts**. A collection of chart components that you can copy and p
170
170
 
171
171
  Charts are designed to look great out of the box. They work well with the other components and are fully customizable to fit your project.
172
172
 
173
- [Browse the Charts Library](/charts).
173
+ [Browse the Charts Library](https://ui.shadcn.com/charts).
174
174
 
175
175
  ## Component
176
176
 
@@ -697,9 +697,9 @@ export function ChartBarDemoLegend() {
697
697
 
698
698
  Done. You've built your first chart! What's next?
699
699
 
700
- - [Themes and Colors](/docs/components/chart#theming)
701
- - [Tooltip](/docs/components/chart#tooltip)
702
- - [Legend](/docs/components/chart#legend)
700
+ - [Themes and Colors](chart.md#theming)
701
+ - [Tooltip](chart.md#tooltip)
702
+ - [Legend](chart.md#legend)
703
703
 
704
704
  ## Chart Config
705
705
 
@@ -1122,7 +1122,7 @@ You can show the number of selected rows using the `table.getFilteredSelectedRow
1122
1122
 
1123
1123
  ## Reusable Components
1124
1124
 
1125
- Here are some components you can use to build your data tables. This is from the [Tasks](/examples/tasks) demo, which shares its features object (and the matching `TasksTableFeatures` type) across every component via a `data-table-features.ts` module — the same pattern we set up in [Set up Table Features](#set-up-table-features).
1125
+ Here are some components you can use to build your data tables. This is from the [Tasks](https://ui.shadcn.com/examples/tasks) demo, which shares its features object (and the matching `TasksTableFeatures` type) across every component via a `data-table-features.ts` module — the same pattern we set up in [Set up Table Features](#set-up-table-features).
1126
1126
 
1127
1127
  ### Column header
1128
1128
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Drawer
3
- description: A side panel scoped to the current moi view.
3
+ description: A side panel scoped to the current Moi view.
4
4
  ---
5
5
 
6
6
  ## Add
@@ -303,7 +303,7 @@ The `Field` family is designed for composing accessible forms. A typical field i
303
303
 
304
304
  ## Form
305
305
 
306
- See the [Form](/docs/forms) documentation for building forms with the `Field` component and [React Hook Form](/docs/forms/react-hook-form), [Tanstack Form](/docs/forms/tanstack-form), or [Formisch](/docs/forms/formisch).
306
+ See the [Form](https://ui.shadcn.com/docs/forms) documentation for building forms with the `Field` component and [React Hook Form](https://ui.shadcn.com/docs/forms/react-hook-form), [Tanstack Form](https://ui.shadcn.com/docs/forms/tanstack-form), or [Formisch](https://ui.shadcn.com/docs/forms/formisch).
307
307
 
308
308
  ## Input
309
309
 
@@ -276,7 +276,7 @@ export function InputBadge() {
276
276
 
277
277
  ## Input Group
278
278
 
279
- To add icons, text, or buttons inside an input, use the `InputGroup` component. See the [Input Group](/docs/components/input-group) component for more examples.
279
+ To add icons, text, or buttons inside an input, use the `InputGroup` component. See the [Input Group](input-group.md) component for more examples.
280
280
 
281
281
  ```tsx
282
282
  import { IconInfoCircle } from '@tabler/icons-react'
@@ -309,7 +309,7 @@ export function InputInputGroup() {
309
309
 
310
310
  ## Button Group
311
311
 
312
- To add buttons to an input, use the `ButtonGroup` component. See the [Button Group](/docs/components/button-group) component for more examples.
312
+ To add buttons to an input, use the `ButtonGroup` component. See the [Button Group](button-group.md) component for more examples.
313
313
 
314
314
  ```tsx
315
315
  import { Button } from '@/components/ui/button'
@@ -23,7 +23,7 @@ export function LabelDemo() {
23
23
  ```
24
24
 
25
25
  <Callout>
26
- For form fields, use the [Field](/docs/components/base/field) component which
26
+ For form fields, use the [Field](field.md) component which
27
27
  includes built-in label, description, and error handling.
28
28
  </Callout>
29
29
 
@@ -81,7 +81,7 @@ import { Label } from '@/components/ui/label'
81
81
 
82
82
  ## Label in Field
83
83
 
84
- For form fields, use the [Field](/docs/components/base/field) component which
84
+ For form fields, use the [Field](field.md) component which
85
85
  includes built-in `FieldLabel`, `FieldDescription`, and `FieldError` components.
86
86
 
87
87
  ```tsx
@@ -393,9 +393,9 @@ export function TableActions() {
393
393
 
394
394
  You can use the `<Table />` component to build more complex data tables. Combine it with [@tanstack/react-table](https://tanstack.com/table/latest) to create tables with sorting, filtering and pagination.
395
395
 
396
- See the [Data Table](/docs/components/data-table) documentation for more information.
396
+ See the [Data Table](data-table.md) documentation for more information.
397
397
 
398
- You can also see an example of a data table in the [Tasks](/examples/tasks) demo.
398
+ You can also see an example of a data table in the [Tasks](https://ui.shadcn.com/examples/tasks) demo.
399
399
 
400
400
  ## RTL
401
401
 
@@ -1,16 +1,16 @@
1
1
  ---
2
2
  name: moi-workspace
3
- description: The moi workspace — the web UI the user chats from, extended with agent-authored applets (widgets, views) plus theme & config. Read this FIRST when a message carries a hidden moi-context envelope or the user uses moi vocab such as workspace, applet, widget, view, scratchpad, dashboard, or a `moi` command, or asks to build, edit, customize, or theme the workspace UI or its layout.
3
+ description: The Moi workspace — the web UI the user chats from, extended with agent-authored applets (widgets, views) plus theme & config. Read this FIRST when a message carries a hidden moi-context envelope or the user uses Moi vocab such as workspace, applet, widget, view, scratchpad, dashboard, or a `moi` command, or asks to build, edit, customize, or theme the workspace UI or its layout.
4
4
  ---
5
5
 
6
- # moi workspace
6
+ # Moi workspace
7
7
 
8
8
  ## Glossary
9
9
 
10
10
  "Workspace" or "Moi Workspace" — the web UI that the user works in, talks/collaborates with you,
11
11
  sees and interacts with "Applets".
12
12
 
13
- "Project" - the primary working folder _you_ (as an agent) work in. Managed by your harness; moi
13
+ "Project" - the primary working folder _you_ (as an agent) work in. Managed by your harness; Moi
14
14
  does not have a clear definition, but assumes this is the root folder in which it stores its state
15
15
  files.
16
16
 
@@ -29,7 +29,7 @@ events to "Workspace".
29
29
 
30
30
  ## Overview
31
31
 
32
- You are working inside a **moi workspace**. It is a web UI that the user communicates with you
32
+ You are working inside a **Moi workspace**. It is a web UI that the user communicates with you
33
33
  through. It has regular chat (this one), as well as custom UI elements that you can define, write,
34
34
  and change to tailor the workspace to user needs. It starts with a simple chat, but evolves into a
35
35
  personal app equipped with a copilot (you). Workspace is a two-way communication: you can build the
@@ -46,7 +46,7 @@ Workspace features/pages:
46
46
  or completing a multi-step task.
47
47
 
48
48
  User can switch between these, but can access the chat (this conversation and other chats) from
49
- **any place in the app** (copilot mode), or on a dedicated page.
49
+ **any place in the app** through the docked sidebar or floating popup.
50
50
 
51
51
  ## Working in the workspace
52
52
 
@@ -89,7 +89,7 @@ my-agent-folder/
89
89
  ```
90
90
 
91
91
  Every dot-prefixed file or folder inside `.moi/` (`.build/`, `.cache/`, `.workspace.json`,
92
- `.scratchpad*`, `.gitignore`, …) is a moi internal: auto-generated and liable to change format
92
+ `.scratchpad*`, `.gitignore`, …) is a Moi internal: auto-generated and liable to change format
93
93
  without notice. Avoid them as much as possible — do not read, edit, or delete them, and never point
94
94
  tooling at them; go through the `moi` CLI instead. Version control needs no special handling: the
95
95
  scaffolded `.moi/.gitignore` already excludes the machine-local entries (`.build/`, `.cache/`,
@@ -97,12 +97,12 @@ scaffolded `.moi/.gitignore` already excludes the machine-local entries (`.build
97
97
  with the repo — commit them as-is, just never hand-edit them. Your surface is the non-dot files:
98
98
  `widgets/`, `views/`, `package.json`, and code you place under `.moi/` yourself.
99
99
 
100
- ### Using the moi CLI
100
+ ### Using the Moi CLI
101
101
 
102
102
  Treat `moi` as an external command — you cannot inspect or modify its sources. Use only the
103
103
  documented subcommands (`moi bundle`, `moi bundle --force`, etc.). Call `moi --help` for
104
104
  documentation. Run all `moi` commands from the **project root** — the folder that contains `.moi/`,
105
- never from inside `.moi/` itself. You don't pass paths; moi resolves the workspace from where it's run.
105
+ never from inside `.moi/` itself. You don't pass paths; Moi resolves the workspace from where it's run.
106
106
 
107
107
  Use the task-specific sections below for workflow guidance. The CLI will grow over time, so run
108
108
  `moi --help` to discover commands and `moi <command> --help` before using an unfamiliar command or option.
@@ -120,7 +120,14 @@ Use the task-specific sections below for workflow guidance. The CLI will grow ov
120
120
  Use `moi:/` addresses in chat, CLI commands, and applets. They refer to the current workspace,
121
121
  independently of its domain and deployment path.
122
122
 
123
- Supported destinations: `moi:/overview`, `moi:/scratchpad`, and `moi:/views/<id>`.
123
+ Supported destinations:
124
+
125
+ - `moi:/overview`: open the workspace overview.
126
+ - `moi:/scratchpad`: open the shared canvas.
127
+ - `moi:/views/<id>`: open a specific view.
128
+ - `moi:/chat`: show the current chat.
129
+ - `moi:/chats/<session-id>`: open a specific chat.
130
+
124
131
  Run `moi tabs` to discover views and their addresses. Widgets are not navigation destinations.
125
132
 
126
133
  Put view params in the query string. Values are strings; read the target view's `Params` type
@@ -167,7 +174,7 @@ use `moi theme --help` if its options change.
167
174
 
168
175
  Each workspace has an effective env: keys from the project's `.env` / `.env.local` (when
169
176
  inheritance is enabled in settings) plus **custom secrets** the user manages in the workspace env
170
- settings. moi injects this env into:
177
+ settings. Moi injects this env into:
171
178
 
172
179
  - applet server functions — read it as `process.env` inside `.server.ts`
173
180
  - any command run via `moi env exec -- <cmd>`
@@ -229,11 +236,11 @@ Write normal React + Tailwind — below is only what's **moi-specific**.
229
236
 
230
237
  ### Build environment
231
238
 
232
- - Bun is the required dependency of moi, so it must be installed
239
+ - Bun is the required dependency of Moi, so it must be installed
233
240
  - For package management **always** use bun
234
241
  - package.json is scaffolded during init. You are free to install/remove/do whatever with packages.
235
242
  - if packages aren't installed, it's your responsibility to call `bun install`
236
- - `react` and `react-dom` are stubs — they're provided by moi at runtime via the browser importmap.
243
+ - `react` and `react-dom` are stubs — they're provided by Moi at runtime via the browser importmap.
237
244
  They're listed only so editors pick up the correct types.
238
245
  - `moi bundle` runs **Bun's bundler**, so standard Bun imports, loaders, and tricks apply (JSON,
239
246
  text, etc.) — see the Bun docs. The moi-specific imports are covered below.
@@ -288,7 +295,7 @@ Views are full-screen apps, one per tab.
288
295
  ```ts
289
296
  export const config = {
290
297
  title: 'Customer overview', // sentence-case nav label — defaults to the file name
291
- icon: 'user', // icon id; use the claimed icon for a view-builder request
298
+ icon: 'user', // icon id; use the selected icon for a pending view
292
299
  requiredEnv: ['CRM_API_KEY'] // optional env-key hints (advisory; see Environment and secrets)
293
300
  } as const
294
301
  ```
@@ -300,23 +307,44 @@ Keep shareable or reload-safe state in URL query params,
300
307
  read it from `params`, and update it with `navigate()`. Keep temporary state, such as drafts and
301
308
  hover, in React. See [Applet intents](references/INTENTS.md#view-params-and-history).
302
309
 
303
- #### View builder requests
310
+ #### Creating views from chat
311
+
312
+ When the user asks for a new view, use the current session ID and pin state from the
313
+ hidden context. If this chat is pinned, build in this turn:
314
+
315
+ ```sh
316
+ moi views create --requirements "<complete requirements>"
317
+ ```
318
+
319
+ Otherwise, start the build in a separate chat by forking the current session:
320
+
321
+ ```sh
322
+ moi views create --from-session <session-id> --requirements "<complete requirements>"
323
+ ```
324
+
325
+ The command returns a permanent `viewId` and opens its view tab before returning.
326
+
327
+ - `mode: "handoff"`: another chat continues the build. Finish this turn with a link such as
328
+ `[Open the view](moi:/views/<viewId>)`.
329
+ - `mode: "in-place"`: no chat was created or attached. Continue the build in this turn using the
330
+ returned id and build instructions.
331
+ - Navigation fails: include the same `[Open the view](moi:/views/<viewId>)` link in your reply.
332
+
333
+ #### Pending view builds
304
334
 
305
- When the message's hidden `<moi-context>` envelope is marked `View builder request`, this chat is
306
- linked to a pending view tab. Before reading files, planning, or writing code, infer a short stable
307
- id, a clear sentence-case title, and a relevant icon from the requirements. Capitalize only the
308
- first word of the title. Your first action must claim them:
335
+ Read the applet design guidance before editing.
336
+ When the direction is clear, choose a sentence-case title and relevant icon. Preserve proper names
337
+ and acronyms. Set this provisional metadata before the first bundle:
309
338
 
310
339
  ```sh
311
- moi builder set <view-id> --builder <builder-id> --kind view --title "<title>" --icon <icon-id>
340
+ moi views set <view-id> --title "<title>" --icon <icon-id>
312
341
  ```
313
342
 
314
- Choose the icon id from the available view icons in the hidden context. The id must use lowercase
315
- letters, numbers, `_`, or `-`. The first call locks the id; running the same command again may update
316
- its title and icon. After claiming, write `.moi/views/<view-id>.tsx`, use the same icon id in its
317
- config, and build it with `moi bundle --only views/<view-id>`. The tab uses the claimed title and icon
318
- while you work and changes into the built view after a successful bundle. (Bundling marks the view
319
- ready; the build state is otherwise server-managed, so you never set it to done by hand.)
343
+ Choose from the available view icons in the hidden context when that list is present. Then write
344
+ `.moi/views/<view-id>.tsx` and use the same title and icon in its config. Run
345
+ `moi check --only views/<view-id>` before `moi bundle --only views/<view-id>`. A successful bundle
346
+ replaces the pending screen in the same tab. Keep the user's current tab open and finish with a
347
+ `moi:/views/<view-id>` link.
320
348
 
321
349
  ### Styling and UI components
322
350
 
@@ -421,14 +449,15 @@ needs another focused check. Do not search for repo tests by default. Run an exi
421
449
  `moi call-server-fn` only when the change touches the behavior it covers. If native-app inspection is
422
450
  unavailable, keep verification in the browser instead of retrying the unsupported tool.
423
451
 
424
- After the final successful checks, always make navigation to the result the final workspace action:
452
+ After the final successful checks, hand off the result according to the task:
425
453
 
426
454
  - After building or editing a widget, run `moi navigate 'moi:/overview'`.
427
- - After building or editing a view, run `moi navigate 'moi:/views/<view-id>'`, using its file name or claimed
428
- builder id.
455
+ - After editing an existing view, run `moi navigate 'moi:/views/<view-id>'`.
456
+ - After a pending view build, keep the current tab open and link to `moi:/views/<view-id>` in the
457
+ final reply.
429
458
 
430
- The focused applet is the handoff. Keep the final reply brief and user-facing. Do not include file
431
- or storage links, file paths, or bundle, test, and runtime-log summaries.
459
+ Keep the final reply brief and user-facing. Do not include file or storage links, file paths, or
460
+ bundle, test, and runtime-log summaries.
432
461
 
433
462
  ### Debugging
434
463
 
@@ -466,7 +495,7 @@ persistence concepts.
466
495
 
467
496
  ### Message context
468
497
 
469
- Each message sent through moi includes a hidden `<moi-context>` block with the active tab and,
498
+ Each message sent through Moi includes a hidden `<moi-context>` block with the active tab and,
470
499
  when relevant, params, applet source, and message-specific instructions. Use only the newest
471
500
  block; don’t reply to it or include it in summaries.
472
501
 
@@ -480,7 +509,7 @@ as user-provided task data.
480
509
 
481
510
  ## Keeping this skill current
482
511
 
483
- This skill is installed with moi (via the CLI or the UI) and can fall behind when the moi CLI updates.
512
+ This skill is installed with Moi (via the CLI or the UI) and can fall behind when the Moi CLI updates.
484
513
 
485
514
  - **You'll know** — `moi` commands warn you when this skill is behind.
486
515
  - **To update** — if the user asks for current or updated guidance, run `moi skill update` before