moi-computer 0.12.1-next.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 (319) hide show
  1. package/README.md +26 -26
  2. package/bin/moi.mjs +2 -2
  3. package/client/AGENTS.md +5 -2
  4. package/client/api/app-config.ts +3 -2
  5. package/client/api/workspace-keys.ts +1 -1
  6. package/client/app/{AppRouter.tsx → app-router.tsx} +4 -4
  7. package/client/app/routes/{HomeRoute.tsx → home-route.tsx} +2 -2
  8. package/client/app/routes/{WorkspaceRoute.tsx → workspace-route.tsx} +18 -23
  9. package/client/app/shell/{SidebarLayout.tsx → sidebar-layout.tsx} +10 -10
  10. package/client/dev/index.html +43 -0
  11. package/client/dev/index.ts +15 -0
  12. package/client/features/applets/{AppletContainer.tsx → applet-container.tsx} +1 -1
  13. package/client/features/applets/applet-thumbnail.ts +1 -1
  14. package/client/features/applets/{useApplet.ts → use-applet.ts} +2 -2
  15. package/client/features/applets/{WidgetShell.tsx → widget-shell.tsx} +4 -4
  16. package/client/features/chat/applet-chat-intents.ts +4 -4
  17. package/client/features/chat/{ChatPanel.tsx → chat-panel.tsx} +11 -11
  18. package/client/features/chat/{ChatPopup.tsx → chat-popup.tsx} +1 -1
  19. package/client/features/chat/composer/attachments/{DrawingAttachmentChip.tsx → drawing-attachment-chip.tsx} +1 -1
  20. package/client/features/chat/composer/attachments/{FileAttachmentChip.tsx → file-attachment-chip.tsx} +1 -1
  21. package/client/features/chat/composer/attachments/{TextAttachmentChip.tsx → text-attachment-chip.tsx} +1 -1
  22. package/client/features/chat/composer/banners/{ComposerBanner.tsx → composer-banner.tsx} +0 -14
  23. package/client/features/chat/composer/banners/{ErrorBanner.tsx → error-banner.tsx} +1 -1
  24. package/client/features/chat/composer/banners/{SkillUpdateBanner.tsx → skill-update-banner.tsx} +3 -3
  25. package/client/features/chat/composer/{ChatComposer.tsx → chat-composer.tsx} +8 -7
  26. package/client/features/chat/composer/{ModelPicker.tsx → model-picker.tsx} +1 -1
  27. package/client/features/chat/composer/{useWorkspaceComposerState.tsx → use-workspace-composer-state.tsx} +12 -28
  28. package/client/features/chat/composer/{useWorkspaceSkillUpdates.ts → use-workspace-skill-updates.ts} +1 -1
  29. package/client/features/chat/connection/chat-frames.ts +1 -1
  30. package/client/features/chat/messages/{ChatEmptyState.tsx → chat-empty-state.tsx} +4 -4
  31. package/client/features/chat/messages/{MarkdownContent.tsx → markdown-content.tsx} +1 -1
  32. package/client/features/chat/messages/tool-group/index.ts +1 -1
  33. package/client/features/chat/messages/tool-group/{ReadImagePreview.tsx → read-image-preview.tsx} +2 -2
  34. package/client/features/chat/messages/tool-group/{SubagentCard.tsx → subagent-card.tsx} +3 -3
  35. package/client/features/chat/messages/tool-group/{TimelineRow.tsx → timeline-row.tsx} +1 -1
  36. package/client/features/chat/messages/tool-group/{ToolCallGroup.tsx → tool-call-group.tsx} +8 -8
  37. package/client/features/chat/messages/tool-group/{ToolOutput.tsx → tool-output.tsx} +1 -1
  38. package/client/features/chat/messages/{TurnView.tsx → turn-view.tsx} +4 -4
  39. package/client/features/chat/sessions/api.ts +2 -2
  40. package/client/features/chat/sessions/{ChatSelector.tsx → chat-selector.tsx} +2 -2
  41. package/client/features/chat/sessions/{useSelectedSession.ts → use-selected-session.ts} +2 -2
  42. package/client/features/chat/{useChat.ts → use-chat.ts} +3 -3
  43. package/client/features/collab/proxy-user.ts +1 -1
  44. package/client/features/connectors/mcp-icons.ts +1 -1
  45. package/client/features/connectors/{McpServerCards.tsx → mcp-server-cards.tsx} +1 -1
  46. package/client/features/{home/workspace-setup/DemoDialog.tsx → demo/demo-dialog.tsx} +6 -6
  47. package/client/features/dev/chat-states-fixtures.ts +4 -4
  48. package/client/features/dev/{ChatStatesPage.tsx → chat-states-page.tsx} +6 -6
  49. package/client/features/dev/collab/local-user-settings.tsx +4 -4
  50. package/client/features/dev/{DevIndexPage.tsx → dev-index-page.tsx} +7 -1
  51. package/client/features/dev/{DevRoutes.tsx → dev-routes.tsx} +8 -6
  52. package/client/features/dev/workspace-setup-mocks.ts +102 -0
  53. package/client/features/dev/workspace-setup-page.tsx +11 -0
  54. package/client/features/dev/workspace-setup-preview.tsx +226 -0
  55. package/client/features/drawings/{DrawingToolbar.tsx → drawing-toolbar.tsx} +1 -1
  56. package/client/features/drawings/{useChatAnnotation.ts → use-chat-annotation.ts} +29 -23
  57. package/client/features/drawings/{useDrawingLayer.ts → use-drawing-layer.ts} +1 -1
  58. package/client/features/drawings/{useViewSketch.ts → use-view-sketch.ts} +1 -1
  59. package/client/features/harness/api.ts +36 -0
  60. package/client/features/harness/device-login-steps.tsx +97 -0
  61. package/client/features/home/api.ts +1 -81
  62. package/client/features/home/{HomeLogo.tsx → home-logo.tsx} +1 -1
  63. package/client/features/home/{HomePage.tsx → home-page.tsx} +14 -18
  64. package/client/features/overview/api.ts +2 -2
  65. package/client/features/overview/default/registry.tsx +1 -1
  66. package/client/features/overview/default/{ViewsWidget.tsx → views-widget.tsx} +1 -1
  67. package/client/features/overview/{HiddenPanel.tsx → hidden-panel.tsx} +2 -2
  68. package/client/features/overview/{Overview.tsx → overview.tsx} +6 -6
  69. package/client/features/overview/{WidgetCanvas.tsx → widget-canvas.tsx} +1 -1
  70. package/client/features/overview/{WidgetFrame.tsx → widget-frame.tsx} +1 -1
  71. package/client/features/overview/workspace-name.tsx +55 -0
  72. package/client/features/scratchpad/{Scratchpad.tsx → scratchpad.tsx} +7 -7
  73. package/client/features/scratchpad/{useScratchpadSnapshot.tsx → use-scratchpad-snapshot.tsx} +3 -3
  74. package/client/features/settings/api.ts +1 -1
  75. package/client/features/settings/{ConnectorsSettings.tsx → connectors-settings.tsx} +3 -3
  76. package/client/features/settings/{EnvironmentSettings.tsx → environment-settings.tsx} +3 -3
  77. package/client/features/settings/{GeneralSettings.tsx → general-settings.tsx} +5 -5
  78. package/client/features/settings/{useEnvVars.ts → use-env-vars.ts} +1 -1
  79. package/client/features/settings/{WorkspaceIconPicker.tsx → workspace-icon-picker.tsx} +1 -1
  80. package/client/features/settings/{WorkspaceSettingsDialog.tsx → workspace-settings-dialog.tsx} +3 -3
  81. package/client/features/update/api.ts +1 -1
  82. package/client/features/views/api.ts +1 -1
  83. package/client/features/views/{PendingViewScreen.tsx → pending-view-screen.tsx} +7 -4
  84. package/client/features/views/{useViewActions.ts → use-view-actions.ts} +2 -2
  85. package/client/features/views/{useViewDrafts.ts → use-view-drafts.ts} +15 -6
  86. package/client/features/views/{ViewManager.tsx → view-manager.tsx} +3 -3
  87. package/client/features/views/view-submission.ts +1 -1
  88. package/client/features/workspace/add/api.ts +80 -0
  89. package/client/features/{home/workspace-setup/CreateWorkspaceDialog.tsx → workspace/add/create-workspace-dialog.tsx} +56 -42
  90. package/client/features/workspace/add/import-workspace-dialog.tsx +81 -0
  91. package/client/features/{home/workspace-setup/useWorkspaceImport.ts → workspace/add/use-workspace-import.ts} +1 -1
  92. package/client/features/workspace/add/workspace-agent-options.ts +53 -0
  93. package/client/features/{home/workspace-setup/WorkspaceAgentStep.tsx → workspace/add/workspace-agent-selector.tsx} +59 -98
  94. package/client/features/{home/workspace-setup/WorkspaceDialogContent.tsx → workspace/add/workspace-dialog-content.tsx} +1 -1
  95. package/client/features/workspace/api.ts +24 -15
  96. package/client/features/workspace/browser-tab-state.ts +1 -1
  97. package/client/features/workspace/moi-context.ts +1 -1
  98. package/client/features/workspace/setup/workspace-login-state.tsx +175 -0
  99. package/client/features/workspace/setup/workspace-recovery-states.tsx +125 -0
  100. package/client/features/workspace/setup/workspace-setup-panel.tsx +18 -0
  101. package/client/features/workspace/setup/workspace-setup.tsx +77 -0
  102. package/client/features/workspace/setup/workspace-welcome-state.tsx +81 -0
  103. package/client/features/workspace/{ThemePanel.tsx → theme-panel.tsx} +3 -3
  104. package/client/features/workspace/{useWorkspaceNavigation.ts → use-workspace-navigation.ts} +2 -2
  105. package/client/features/workspace/{WorkspaceScreen.tsx → workspace-content.tsx} +27 -30
  106. package/client/features/workspace/workspace-identity.tsx +40 -0
  107. package/client/features/workspace/{WorkspaceMenu.tsx → workspace-menu.tsx} +3 -3
  108. package/client/features/{home → workspace}/workspace-presentation.tsx +10 -3
  109. package/client/features/workspace/workspace-screen.tsx +28 -0
  110. package/client/features/workspace/{WorkspaceSplitLayout.tsx → workspace-split-layout.tsx} +1 -1
  111. package/client/features/workspace/{WorkspaceTabs.tsx → workspace-tabs.tsx} +2 -2
  112. package/client/index.css +2 -2
  113. package/client/index.html +1 -1
  114. package/client/lib/agent-availability.ts +0 -5
  115. package/client/main.tsx +1 -1
  116. package/client/runtime/{useWorkspaceEvents.ts → use-workspace-events.ts} +3 -12
  117. package/dist/chunk-08ndj2rg.js +2 -0
  118. package/dist/chunk-2x040tmg.js +68 -0
  119. package/dist/chunk-3smxq0ts.js +1 -0
  120. package/dist/{chunk-am1x230f.js → chunk-68ch5hs8.js} +1 -1
  121. package/dist/{chunk-yvzhwtfa.js → chunk-9vg3xa81.js} +2 -2
  122. package/dist/chunk-c2p00p9j.css +1 -0
  123. package/dist/chunk-cs833y9j.js +1 -0
  124. package/dist/{chunk-gps4qc38.js → chunk-d7cbm65e.js} +1 -1
  125. package/dist/{chunk-j905va8r.js → chunk-hvh9f5h0.js} +1 -1
  126. package/dist/{chunk-vqpkqtdr.js → chunk-jvyvwwv3.js} +1 -1
  127. package/dist/chunk-nwevqe86.js +10 -0
  128. package/dist/{chunk-hzwr8dp8.js → chunk-q0gbdts4.js} +3 -3
  129. package/dist/chunk-rt30jbcm.js +1 -0
  130. package/dist/chunk-y5y3kj67.js +1 -0
  131. package/dist/index.html +2 -2
  132. package/lib/format.ts +1 -1
  133. package/lib/harness-instructions.ts +30 -0
  134. package/lib/ids.ts +1 -1
  135. package/lib/moi-context.ts +2 -2
  136. package/lib/scratchpad-skew.ts +3 -3
  137. package/lib/types.ts +28 -20
  138. package/lib/update.ts +1 -1
  139. package/package.json +5 -2
  140. package/server/AGENTS.md +10 -4
  141. package/server/README.md +102 -0
  142. package/server/api/harnesses.ts +56 -0
  143. package/server/{api.ts → api/index.ts} +85 -97
  144. package/server/app-config.ts +24 -12
  145. package/server/app-settings.ts +1 -1
  146. package/server/applets/applet-css.ts +1 -1
  147. package/server/applets/build-applet.ts +4 -4
  148. package/server/applets/build-worker.ts +1 -1
  149. package/server/applets/config.ts +1 -1
  150. package/server/{functions-worker.ts → applets/functions-worker.ts} +1 -1
  151. package/server/{functions.ts → applets/functions.ts} +2 -2
  152. package/server/applets/index.ts +2 -2
  153. package/server/{thumbnails.ts → applets/thumbnails.ts} +1 -1
  154. package/server/{applet-typecheck.ts → applets/typecheck.ts} +4 -4
  155. package/server/{ui-components.ts → applets/ui-components.ts} +2 -2
  156. package/server/{views.ts → applets/views.ts} +7 -7
  157. package/server/{widgets.ts → applets/widgets.ts} +2 -2
  158. package/server/cli/applet-selector.ts +19 -0
  159. package/server/cli/args.ts +5 -0
  160. package/server/{cli-colors.ts → cli/colors.ts} +1 -1
  161. package/server/cli/commands/bundle.ts +119 -0
  162. package/server/cli/commands/call-server-fn.ts +42 -0
  163. package/server/cli/commands/check.ts +53 -0
  164. package/server/cli/commands/config.ts +132 -0
  165. package/server/cli/commands/debug.ts +119 -0
  166. package/server/cli/commands/env.ts +162 -0
  167. package/server/cli/commands/hermes.ts +149 -0
  168. package/server/cli/commands/init.ts +286 -0
  169. package/server/cli/commands/navigate.ts +35 -0
  170. package/server/cli/commands/openclaw.ts +168 -0
  171. package/server/cli/commands/refresh.ts +39 -0
  172. package/server/cli/commands/scratch.ts +496 -0
  173. package/server/cli/commands/service.ts +298 -0
  174. package/server/cli/commands/skill.ts +122 -0
  175. package/server/cli/commands/start.ts +138 -0
  176. package/server/cli/commands/status.ts +80 -0
  177. package/server/cli/commands/tabs.ts +43 -0
  178. package/server/cli/commands/theme.ts +192 -0
  179. package/server/cli/commands/ui-components.ts +15 -0
  180. package/server/cli/commands/update.ts +192 -0
  181. package/server/cli/commands/version.ts +9 -0
  182. package/server/cli/commands/views.ts +87 -0
  183. package/server/cli/control.ts +89 -0
  184. package/server/{cli-env.ts → cli/env.ts} +9 -9
  185. package/server/cli/index.ts +171 -0
  186. package/server/{cli-pc.ts → cli/pc.ts} +1 -1
  187. package/server/cli/provider.ts +25 -0
  188. package/server/cli/server-version.ts +16 -0
  189. package/server/cli/server.ts +81 -0
  190. package/server/{cli-ui-components.ts → cli/ui-components.ts} +5 -5
  191. package/server/cli.ts +2 -3252
  192. package/server/collab/manager.ts +3 -3
  193. package/server/collab/skill/index.ts +2 -2
  194. package/server/control.ts +20 -20
  195. package/server/harness/README.md +47 -25
  196. package/server/harness/acp/NOTES.md +11 -11
  197. package/server/harness/acp/archived.ts +3 -3
  198. package/server/harness/acp/client.ts +2 -2
  199. package/server/harness/acp/run-durations.ts +1 -1
  200. package/server/harness/acp/session.ts +5 -5
  201. package/server/harness/auth.ts +303 -0
  202. package/server/harness/claude-code/NOTES.md +9 -7
  203. package/server/harness/claude-code/auth.ts +125 -17
  204. package/server/harness/claude-code/index.ts +2 -1
  205. package/server/harness/claude-code/mcp.ts +1 -1
  206. package/server/harness/claude-code/session.ts +10 -7
  207. package/server/harness/codex/NOTES.md +12 -12
  208. package/server/harness/codex/auth.ts +86 -19
  209. package/server/harness/codex/client.ts +17 -13
  210. package/server/harness/codex/index.ts +2 -1
  211. package/server/harness/codex/permissions.ts +3 -3
  212. package/server/harness/codex/probe.ts +3 -5
  213. package/server/harness/codex/session.ts +16 -13
  214. package/server/harness/codex/transport.ts +5 -5
  215. package/server/harness/executable.ts +42 -18
  216. package/server/harness/hermes/NOTES.md +70 -70
  217. package/server/harness/hermes/discovery.ts +1 -1
  218. package/server/harness/openclaw/NOTES.md +24 -24
  219. package/server/harness/openclaw/adapter.ts +1 -1
  220. package/server/harness/openclaw/compat.ts +1 -1
  221. package/server/harness/openclaw/session.ts +5 -2
  222. package/server/harness/registry.ts +1 -1
  223. package/server/harness/shell-path.ts +31 -21
  224. package/server/harness/types.ts +9 -2
  225. package/server/navigation-relay.ts +1 -1
  226. package/server/open-browser.ts +7 -0
  227. package/server/{scratchpad-assets.ts → scratchpad/assets.ts} +4 -4
  228. package/server/{scratchpad.ts → scratchpad/document.ts} +8 -8
  229. package/server/{scratchpad-executor.ts → scratchpad/executor.ts} +7 -7
  230. package/server/{scratchpad-relay.ts → scratchpad/relay.ts} +4 -5
  231. package/server/{scratchpad-shape-defaults.ts → scratchpad/shape-defaults.ts} +2 -2
  232. package/server/server-cwd.ts +1 -1
  233. package/server/service.ts +2 -2
  234. package/server/{session-archive.ts → sessions/archive.ts} +5 -5
  235. package/server/{attachment-message.ts → sessions/attachment-message.ts} +1 -1
  236. package/server/{session-config.ts → sessions/config.ts} +1 -1
  237. package/server/{session-lifecycle.ts → sessions/lifecycle.ts} +3 -3
  238. package/server/{pending-views.ts → sessions/pending-views.ts} +3 -3
  239. package/server/{selected-session.ts → sessions/selected.ts} +1 -1
  240. package/server/{session-store.ts → sessions/store.ts} +1 -1
  241. package/server/{view-sessions.ts → sessions/view-sessions.ts} +9 -9
  242. package/server/{skills-template.ts → skills/template.ts} +1 -1
  243. package/server/{skill-update.ts → skills/update.ts} +5 -5
  244. package/server/{skill-version.ts → skills/version.ts} +4 -4
  245. package/server/static.ts +1 -1
  246. package/server/status.ts +3 -3
  247. package/server/web.ts +14 -7
  248. package/server/{env-apply.ts → workspaces/env-apply.ts} +5 -5
  249. package/server/{workspace-env.ts → workspaces/env.ts} +3 -3
  250. package/server/{workspace-import.ts → workspaces/import.ts} +4 -4
  251. package/server/{workspace-init.ts → workspaces/init.ts} +5 -5
  252. package/server/{layout.ts → workspaces/layout.ts} +2 -2
  253. package/server/{preview.ts → workspaces/preview.ts} +1 -1
  254. package/server/{registry.ts → workspaces/registry.ts} +3 -3
  255. package/server/{required-env.ts → workspaces/required-env.ts} +3 -3
  256. package/server/{moi-scaffold.ts → workspaces/scaffold.ts} +3 -3
  257. package/ui-components/button.tsx +1 -1
  258. package/ui-components/docs/attachment.md +2 -2
  259. package/ui-components/docs/button.md +1 -1
  260. package/ui-components/docs/calendar.md +1 -1
  261. package/ui-components/docs/chart.md +4 -4
  262. package/ui-components/docs/data-table.md +1 -1
  263. package/ui-components/docs/drawer.md +1 -1
  264. package/ui-components/docs/field.md +1 -1
  265. package/ui-components/docs/input.md +2 -2
  266. package/ui-components/docs/label.md +2 -2
  267. package/ui-components/docs/table.md +2 -2
  268. package/workspace/.claude/skills/moi-workspace/SKILL.md +12 -12
  269. package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +2 -2
  270. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +2 -2
  271. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +2 -2
  272. package/client/features/chat/composer/banners/AgentAvailabilityBanner.tsx +0 -101
  273. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +0 -92
  274. package/client/features/overview/WorkspaceName.tsx +0 -60
  275. package/dist/chunk-1zhnhy00.js +0 -1
  276. package/dist/chunk-27501vke.js +0 -1
  277. package/dist/chunk-9xtv6djt.js +0 -2
  278. package/dist/chunk-darpsw65.js +0 -1
  279. package/dist/chunk-n33w9y38.js +0 -10
  280. package/dist/chunk-r63ks44z.js +0 -68
  281. package/dist/chunk-wd46nk26.css +0 -1
  282. package/dist/chunk-xgt7vxt9.js +0 -1
  283. package/server/agent.ts +0 -223
  284. /package/client/components/shared/{AgentBlobatar.tsx → agent-blobatar.tsx} +0 -0
  285. /package/client/components/shared/{BottomPanel.tsx → bottom-panel.tsx} +0 -0
  286. /package/client/components/shared/{Composer.tsx → composer.tsx} +0 -0
  287. /package/client/components/shared/{LedLogo.tsx → led-logo.tsx} +0 -0
  288. /package/client/components/shared/{PanelHeader.tsx → panel-header.tsx} +0 -0
  289. /package/client/components/shared/{ReorderableList.tsx → reorderable-list.tsx} +0 -0
  290. /package/client/components/shared/{WorkspaceIcon.tsx → workspace-icon.tsx} +0 -0
  291. /package/client/features/applets/{WidgetErrorBoundary.tsx → widget-error-boundary.tsx} +0 -0
  292. /package/client/features/chat/composer/attachments/{AttachmentChip.tsx → attachment-chip.tsx} +0 -0
  293. /package/client/features/chat/messages/{ChatPromptBubbles.tsx → chat-prompt-bubbles.tsx} +0 -0
  294. /package/client/features/chat/messages/{ShimmerText.tsx → shimmer-text.tsx} +0 -0
  295. /package/client/features/chat/messages/tool-group/{CodeBlock.tsx → code-block.tsx} +0 -0
  296. /package/client/features/chat/messages/tool-group/{Collapse.tsx → collapse.tsx} +0 -0
  297. /package/client/features/chat/messages/{useStickToBottom.ts → use-stick-to-bottom.ts} +0 -0
  298. /package/client/features/connectors/{IconMcp.tsx → icon-mcp.tsx} +0 -0
  299. /package/client/features/dev/{BlobatarShapesPage.tsx → blobatar-shapes-page.tsx} +0 -0
  300. /package/client/features/dev/{HarnessDebugPage.tsx → harness-debug-page.tsx} +0 -0
  301. /package/client/features/dev/{TextureLabPage.tsx → texture-lab-page.tsx} +0 -0
  302. /package/client/features/dev/{ToolCallsPage.tsx → tool-calls-page.tsx} +0 -0
  303. /package/client/features/drawings/{DrawingLayer.tsx → drawing-layer.tsx} +0 -0
  304. /package/client/features/home/{WorkspacePreview.tsx → workspace-preview.tsx} +0 -0
  305. /package/client/features/overview/{useGridReconcile.ts → use-grid-reconcile.ts} +0 -0
  306. /package/client/features/scratchpad/{ScratchpadControls.tsx → scratchpad-controls.tsx} +0 -0
  307. /package/client/features/settings/{SettingsLayout.tsx → settings-layout.tsx} +0 -0
  308. /package/client/features/update/{UpdateControl.tsx → update-control.tsx} +0 -0
  309. /package/client/features/workspace/{UnavailablePage.tsx → unavailable-page.tsx} +0 -0
  310. /package/client/features/workspace/{useFitsSplitLayout.ts → use-fits-split-layout.ts} +0 -0
  311. /package/client/features/workspace/{WorkspaceContext.tsx → workspace-context.tsx} +0 -0
  312. /package/client/features/workspace/{WorkspaceLayoutContext.tsx → workspace-layout-context.tsx} +0 -0
  313. /package/server/{bundle-queue.ts → applets/bundle-queue.ts} +0 -0
  314. /package/server/{applet-log.ts → applets/log.ts} +0 -0
  315. /package/server/{cli-ui.ts → cli/ui.ts} +0 -0
  316. /package/server/{workspace-config.ts → workspaces/config.ts} +0 -0
  317. /package/server/{icon.ts → workspaces/icon.ts} +0 -0
  318. /package/server/{tabs.ts → workspaces/tabs.ts} +0 -0
  319. /package/server/{theme.ts → workspaces/theme.ts} +0 -0
@@ -0,0 +1,18 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ type WorkspaceSetupPanelProps = {
4
+ children: ReactNode
5
+ }
6
+
7
+ export function WorkspaceSetupPanel({ children }: WorkspaceSetupPanelProps) {
8
+ return (
9
+ <section
10
+ aria-label="Workspace setup"
11
+ className="flex min-h-0 flex-1 flex-col overflow-y-auto bg-muted texture-checker-20"
12
+ >
13
+ <div className="flex flex-1 flex-col bg-radial from-background from-25% to-transparent">
14
+ {children}
15
+ </div>
16
+ </section>
17
+ )
18
+ }
@@ -0,0 +1,77 @@
1
+ import { useCallback } from 'react'
2
+
3
+ import { useWorkspaceAgent } from '../api'
4
+ import {
5
+ useWorkspaceWelcome,
6
+ WorkspaceWelcomeState,
7
+ type WorkspaceWelcomeStateProps
8
+ } from './workspace-welcome-state'
9
+ import { WorkspaceLoginState } from './workspace-login-state'
10
+ import {
11
+ HarnessUnavailableState,
12
+ WorkspaceCheckFailedState,
13
+ WorkspaceLoadingState,
14
+ WorkspaceMissingState
15
+ } from './workspace-recovery-states'
16
+
17
+ export function useWorkspaceSetup(
18
+ workspaceId: string,
19
+ contentPending = false,
20
+ welcome: WorkspaceWelcomeStateProps = {}
21
+ ) {
22
+ const { data, isError, isPending, isFetching, isFetchedAfterMount, refetch } =
23
+ useWorkspaceAgent(workspaceId)
24
+ // A cached failure is only a hint until this visit's check has settled.
25
+ const checking =
26
+ isPending || (isFetching && !isFetchedAfterMount && data?.availability.status !== 'available')
27
+ const recheck = useCallback(() => {
28
+ void refetch()
29
+ }, [refetch])
30
+
31
+ function renderRecovery() {
32
+ if (checking) return undefined
33
+ // Background network failures do not invalidate a known working workspace.
34
+ if (isError && data?.availability.status === 'available') return undefined
35
+ if (isError || !data) {
36
+ return <WorkspaceCheckFailedState retrying={isFetching} onRetry={recheck} />
37
+ }
38
+ if (data.workspaceFolderMissing) {
39
+ return <WorkspaceMissingState workspaceId={workspaceId} />
40
+ }
41
+ const { provider, availability } = data
42
+ if (availability.status === 'available') return undefined
43
+ if (
44
+ availability.status === 'login-required' &&
45
+ (provider === 'claude-code' || provider === 'codex')
46
+ ) {
47
+ return (
48
+ <WorkspaceLoginState
49
+ type={provider}
50
+ reason={availability.reason}
51
+ checking={isFetching}
52
+ onRecheck={recheck}
53
+ />
54
+ )
55
+ }
56
+ return (
57
+ <HarnessUnavailableState
58
+ type={provider}
59
+ availability={availability}
60
+ retrying={isFetching}
61
+ onRetry={recheck}
62
+ />
63
+ )
64
+ }
65
+
66
+ const recovery = renderRecovery()
67
+ const ready = !recovery && !contentPending && !checking
68
+ const welcoming = useWorkspaceWelcome(workspaceId)
69
+ return {
70
+ content: welcoming ? (
71
+ <WorkspaceWelcomeState {...welcome} />
72
+ ) : (
73
+ (recovery ?? <WorkspaceLoadingState />)
74
+ ),
75
+ ready: ready && !welcoming
76
+ }
77
+ }
@@ -0,0 +1,81 @@
1
+ import { useEffect, useState } from 'react'
2
+
3
+ import { WorkspaceIdentity, type WorkspaceIdentityProps } from '../workspace-identity'
4
+ import { APP_ICON_IDS } from '@/client/lib/app-icon-registry'
5
+
6
+ const greetings = [
7
+ 'Welcome to',
8
+ 'This is',
9
+ 'Make yourself at home in',
10
+ 'A fresh start in',
11
+ 'Good to see you in'
12
+ ]
13
+
14
+ export type WorkspaceWelcomeStateProps = Omit<
15
+ WorkspaceIdentityProps,
16
+ 'onNameChange' | 'onNameCommit' | 'renderIcon'
17
+ >
18
+
19
+ // A one-time handoff from creation to the first visit. Never persisted.
20
+ let newlyCreatedWorkspaceId: string | undefined
21
+
22
+ export function welcomeNewWorkspace(workspaceId: string) {
23
+ newlyCreatedWorkspaceId = workspaceId
24
+ }
25
+
26
+ export function useWorkspaceWelcome(workspaceId: string) {
27
+ const [welcoming, setWelcoming] = useState(() => newlyCreatedWorkspaceId === workspaceId)
28
+
29
+ useEffect(() => {
30
+ if (newlyCreatedWorkspaceId === workspaceId) newlyCreatedWorkspaceId = undefined
31
+ if (!welcoming) return
32
+ const timer = setTimeout(() => setWelcoming(false), 3000)
33
+ return () => clearTimeout(timer)
34
+ }, [workspaceId, welcoming])
35
+
36
+ return welcoming
37
+ }
38
+
39
+ export function WorkspaceWelcomeState({
40
+ name = 'Workspace',
41
+ icon,
42
+ ...iconProps
43
+ }: WorkspaceWelcomeStateProps) {
44
+ const [greeting] = useState(() => greetings[Math.floor(Math.random() * greetings.length)])
45
+ const [icons] = useState(() => {
46
+ const choices = [...APP_ICON_IDS]
47
+ return Array.from(
48
+ { length: 4 },
49
+ () => choices.splice(Math.floor(Math.random() * choices.length), 1)[0]!
50
+ )
51
+ })
52
+ const [step, setStep] = useState(() =>
53
+ typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
54
+ ? 4
55
+ : 0
56
+ )
57
+
58
+ useEffect(() => {
59
+ if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches) return
60
+ const timers = [500, 1000, 1500, 2000].map((delay, index) =>
61
+ setTimeout(() => setStep(index + 1), delay)
62
+ )
63
+ return () => timers.forEach(clearTimeout)
64
+ }, [])
65
+
66
+ return (
67
+ <div
68
+ aria-label="Workspace welcome"
69
+ className="flex flex-1 items-center justify-center p-6 text-center"
70
+ >
71
+ <div className="flex min-w-0 flex-col items-center gap-1">
72
+ <p className="text-sm text-muted-foreground">{greeting}</p>
73
+ <WorkspaceIdentity
74
+ {...iconProps}
75
+ name={name}
76
+ icon={step < 4 ? { type: 'glyph', value: icons[step]! } : icon}
77
+ />
78
+ </div>
79
+ </div>
80
+ )
81
+ }
@@ -2,9 +2,9 @@ import type { CSSProperties, ReactNode, Ref } from 'react'
2
2
 
3
3
  import { IconCircleCheckFilled } from '@tabler/icons-react'
4
4
 
5
- import { AgentBlobatar } from '@/client/components/shared/AgentBlobatar'
6
- import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
7
- import { BottomPanel } from '@/client/components/shared/BottomPanel'
5
+ import { AgentBlobatar } from '@/client/components/shared/agent-blobatar'
6
+ import { useWorkspaceLayoutCtx } from '@/client/features/workspace/workspace-layout-context'
7
+ import { BottomPanel } from '@/client/components/shared/bottom-panel'
8
8
  import { cn } from '@/client/lib/cn'
9
9
  import { getWorkspaceThemeStyle, usePreloadWorkspaceFonts } from '@/client/runtime/workspace-theme'
10
10
  import {
@@ -10,8 +10,8 @@ import { reportAppletError } from '@/client/features/applets/applet-log'
10
10
  import { useAppletEvent } from '@/client/features/applets/applet-runtime'
11
11
  import { useWorkspaceTabs } from '@/client/features/workspace/browser-tab-state'
12
12
  import { resolveActiveTab, tabAvailable } from './tab-resolution'
13
- import { useWorkspaceLayoutCtx } from './WorkspaceLayoutContext'
14
- import { useNavigationClient } from '@/client/runtime/useWorkspaceEvents'
13
+ import { useWorkspaceLayoutCtx } from './workspace-layout-context'
14
+ import { useNavigationClient } from '@/client/runtime/use-workspace-events'
15
15
  import { useSelectLinkedChat } from '@/client/features/chat/sessions/api'
16
16
  import type { ViewInfo, WorkspaceTabId, WorkspaceTabsState } from '@/lib/types'
17
17
  import { resolveUrl } from '@/lib/navigation'
@@ -9,16 +9,16 @@ import {
9
9
  IconSketching
10
10
  } from '@tabler/icons-react'
11
11
 
12
- import { DrawingLayer } from '@/client/features/drawings/DrawingLayer'
13
- import { DrawingToolbar } from '@/client/features/drawings/DrawingToolbar'
14
- import { useChatAnnotation } from '@/client/features/drawings/useChatAnnotation'
15
- import { ChatPanel } from '@/client/features/chat/ChatPanel'
16
- import type { WelcomeDestination } from '@/client/features/chat/messages/ChatEmptyState'
17
- import { ChatPopup } from '@/client/features/chat/ChatPopup'
18
- import { ThemePanel } from '@/client/features/workspace/ThemePanel'
19
- import { Overview } from '@/client/features/overview/Overview'
12
+ import { DrawingLayer } from '@/client/features/drawings/drawing-layer'
13
+ import { DrawingToolbar } from '@/client/features/drawings/drawing-toolbar'
14
+ import { useChatAnnotation } from '@/client/features/drawings/use-chat-annotation'
15
+ import { ChatPanel } from '@/client/features/chat/chat-panel'
16
+ import type { WelcomeDestination } from '@/client/features/chat/messages/chat-empty-state'
17
+ import { ChatPopup } from '@/client/features/chat/chat-popup'
18
+ import { ThemePanel } from '@/client/features/workspace/theme-panel'
19
+ import { Overview } from '@/client/features/overview/overview'
20
20
  import { WorkspaceUsersMenu } from '@/client/features/collab'
21
- import { PanelHeader } from '@/client/components/shared/PanelHeader'
21
+ import { PanelHeader } from '@/client/components/shared/panel-header'
22
22
  import { Button } from '@/client/components/ui/button'
23
23
  import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip'
24
24
  import { toast } from '@/client/components/ui/toast'
@@ -26,37 +26,36 @@ import {
26
26
  useAppletChatMessage,
27
27
  useAppletChatAttachment
28
28
  } from '@/client/features/chat/applet-chat-intents'
29
- import { useChat } from '@/client/features/chat/useChat'
30
- import { usePinnedSession } from '@/client/features/chat/sessions/useSelectedSession'
29
+ import { useChat } from '@/client/features/chat/use-chat'
30
+ import { usePinnedSession } from '@/client/features/chat/sessions/use-selected-session'
31
31
  import {
32
32
  PendingViewScreen,
33
33
  type PendingViewHandle
34
- } from '@/client/features/views/PendingViewScreen'
35
- import { ViewManager } from '@/client/features/views/ViewManager'
34
+ } from '@/client/features/views/pending-view-screen'
35
+ import { ViewManager } from '@/client/features/views/view-manager'
36
36
  import { getViewIcon, getViewLabel } from '@/client/features/views/view-presentation'
37
- import { useViewActions } from '@/client/features/views/useViewActions'
38
- import { useViewDrafts } from '@/client/features/views/useViewDrafts'
39
- import { useFitsSplitLayout } from '@/client/features/workspace/useFitsSplitLayout'
40
- import { useWorkspaceComposerState } from '@/client/features/chat/composer/useWorkspaceComposerState'
41
- import { useWorkspaceTheme } from '@/client/runtime/workspace-theme'
37
+ import { useViewActions } from '@/client/features/views/use-view-actions'
38
+ import { useViewDrafts } from '@/client/features/views/use-view-drafts'
39
+ import { useFitsSplitLayout } from '@/client/features/workspace/use-fits-split-layout'
40
+ import { useWorkspaceComposerState } from '@/client/features/chat/composer/use-workspace-composer-state'
42
41
  import { resolveWorkspaceTheme } from '@/lib/themes'
43
42
  import {
44
43
  hasRunningWorkspaceActivity,
45
44
  isSessionRunning,
46
45
  useLive
47
46
  } from '@/client/features/chat/chat-store'
48
- import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
49
- import { WorkspaceMenu } from '@/client/features/workspace/WorkspaceMenu'
47
+ import { useWorkspaceLayoutCtx } from '@/client/features/workspace/workspace-layout-context'
48
+ import { WorkspaceMenu } from '@/client/features/workspace/workspace-menu'
50
49
  import { effectiveOpenTabs, tabAvailable } from '@/client/features/workspace/tab-resolution'
51
- import { useWorkspaceNavigation } from '@/client/features/workspace/useWorkspaceNavigation'
50
+ import { useWorkspaceNavigation } from '@/client/features/workspace/use-workspace-navigation'
52
51
  import { cn } from '@/client/lib/cn'
53
- import { useWorkspaceEvent } from '@/client/runtime/useWorkspaceEvents'
52
+ import { useWorkspaceEvent } from '@/client/runtime/use-workspace-events'
54
53
  import { useUiStore } from '@/client/store/ui'
55
54
  import {
56
55
  type CreateWorkspaceTabItem,
57
56
  type WorkspaceTabItem,
58
57
  WorkspaceTabs
59
- } from '@/client/features/workspace/WorkspaceTabs'
58
+ } from '@/client/features/workspace/workspace-tabs'
60
59
  import { isDefaultWidget } from '@/lib/default-widgets'
61
60
  import { composerDraftKey, draftSessionId } from '@/lib/session-drafts'
62
61
  import type {
@@ -69,16 +68,16 @@ import type {
69
68
  } from '@/lib/types'
70
69
  import { viewIdFromTab, viewTabId } from '@/lib/workspace-tabs'
71
70
 
72
- import { WorkspaceSplitLayout } from './WorkspaceSplitLayout'
73
- import { UnavailablePage } from './UnavailablePage'
71
+ import { WorkspaceSplitLayout } from './workspace-split-layout'
72
+ import { UnavailablePage } from './unavailable-page'
74
73
 
75
74
  const Scratchpad = lazy(() =>
76
- import('@/client/features/scratchpad/Scratchpad').then(module => ({
75
+ import('@/client/features/scratchpad/scratchpad').then(module => ({
77
76
  default: module.Scratchpad
78
77
  }))
79
78
  )
80
79
 
81
- type WorkspaceScreenProps = {
80
+ type WorkspaceContentProps = {
82
81
  widgets: WidgetInfo[]
83
82
  views: ViewInfo[]
84
83
  }
@@ -124,7 +123,7 @@ function tabItemFor(
124
123
  : null
125
124
  }
126
125
 
127
- export function WorkspaceScreen({ widgets, views: allViews }: WorkspaceScreenProps) {
126
+ export function WorkspaceContent({ widgets, views: allViews }: WorkspaceContentProps) {
128
127
  const { layout, setLayout, workspaceId } = useWorkspaceLayoutCtx()
129
128
  const theme = resolveWorkspaceTheme(layout.theme)
130
129
  const viewActions = useViewActions()
@@ -149,8 +148,6 @@ export function WorkspaceScreen({ widgets, views: allViews }: WorkspaceScreenPro
149
148
  onSave: (viewId, requirements) => viewActions.save(viewId, requirements)
150
149
  })
151
150
 
152
- useWorkspaceTheme(layout.theme)
153
-
154
151
  const hasAppletWidgets = widgets.some(widget => !isDefaultWidget(widget.id))
155
152
  const hasWorkspaceApplets = hasAppletWidgets || views.length > 0
156
153
 
@@ -0,0 +1,40 @@
1
+ import type { ComponentProps, ReactNode } from 'react'
2
+
3
+ import { WorkspaceIcon } from '@/client/components/shared/workspace-icon'
4
+ import { InlineInput } from '@/client/components/ui/inline-input'
5
+ import { cn } from '@/client/lib/cn'
6
+
7
+ export type WorkspaceIdentityProps = Omit<ComponentProps<typeof WorkspaceIcon>, 'className'> & {
8
+ name?: string
9
+ onNameChange?: (name: string) => void
10
+ onNameCommit?: (name: string) => void
11
+ renderIcon?: (icon: ReactNode) => ReactNode
12
+ }
13
+
14
+ export function WorkspaceIdentity({
15
+ name = 'Workspace',
16
+ onNameChange,
17
+ onNameCommit,
18
+ renderIcon,
19
+ ...iconProps
20
+ }: WorkspaceIdentityProps) {
21
+ const icon = <WorkspaceIcon {...iconProps} className="size-10 rounded-lg" />
22
+
23
+ return (
24
+ <div className="flex max-w-full min-w-0 flex-1 items-center gap-4">
25
+ {renderIcon ? renderIcon(icon) : icon}
26
+ <InlineInput
27
+ aria-label="Workspace name"
28
+ value={name}
29
+ onValueChange={onNameChange}
30
+ onValueCommit={onNameCommit}
31
+ readOnly={!onNameChange}
32
+ tabIndex={onNameChange ? undefined : -1}
33
+ className={cn(
34
+ 'min-w-0 truncate text-3xl font-semibold md:text-3xl',
35
+ !onNameChange && 'pointer-events-none'
36
+ )}
37
+ />
38
+ </div>
39
+ )
40
+ }
@@ -2,7 +2,7 @@ import { useState } from 'react'
2
2
 
3
3
  import { IconLetterCase, IconSettings } from '@tabler/icons-react'
4
4
 
5
- import { WorkspaceIcon } from '@/client/components/shared/WorkspaceIcon'
5
+ import { WorkspaceIcon } from '@/client/components/shared/workspace-icon'
6
6
  import {
7
7
  DropdownMenu,
8
8
  DropdownMenuContent,
@@ -13,8 +13,8 @@ import {
13
13
  import {
14
14
  WorkspaceSettingsDialog,
15
15
  WorkspaceSettingsDialogTrigger
16
- } from '@/client/features/settings/WorkspaceSettingsDialog'
17
- import { useWorkspaceLayoutCtx } from './WorkspaceLayoutContext'
16
+ } from '@/client/features/settings/workspace-settings-dialog'
17
+ import { useWorkspaceLayoutCtx } from './workspace-layout-context'
18
18
 
19
19
  type WorkspaceMenuProps = {
20
20
  onOpenTheme: () => void
@@ -1,13 +1,20 @@
1
- import { workspaceProviderIcon } from '@/client/components/shared/WorkspaceIcon'
1
+ import { workspaceProviderIcon } from '@/client/components/shared/workspace-icon'
2
2
  import type { DiscoveredWorkspace, WorkspaceEntry, WorkspaceType } from '@/lib/types'
3
3
 
4
4
  export const workspaceTypeLabel: Record<WorkspaceType, string> = {
5
- 'claude-code': 'Claude Code',
5
+ 'claude-code': 'Claude',
6
6
  openclaw: 'OpenClaw',
7
- codex: 'Codex',
7
+ codex: 'ChatGPT',
8
8
  hermes: 'Hermes'
9
9
  }
10
10
 
11
+ export const workspaceTypeDescription: Record<WorkspaceType, string> = {
12
+ 'claude-code': 'Anthropic',
13
+ codex: 'OpenAI',
14
+ openclaw: 'Open-source',
15
+ hermes: 'Nous Research'
16
+ }
17
+
11
18
  type WorkspaceAgentIconsProps = {
12
19
  types: WorkspaceType[]
13
20
  }
@@ -0,0 +1,28 @@
1
+ import type { ViewInfo, WidgetInfo } from '@/lib/types'
2
+
3
+ import { useWorkspaceLayoutCtx } from './workspace-layout-context'
4
+ import { WorkspaceContent } from './workspace-content'
5
+ import { WorkspaceSetupPanel } from './setup/workspace-setup-panel'
6
+ import { useWorkspaceSetup } from './setup/workspace-setup'
7
+
8
+ type WorkspaceScreenProps = {
9
+ contentPending: boolean
10
+ widgets: WidgetInfo[]
11
+ views: ViewInfo[]
12
+ }
13
+
14
+ export function WorkspaceScreen({ contentPending, widgets, views }: WorkspaceScreenProps) {
15
+ const { layout, workspaceId, name, provider } = useWorkspaceLayoutCtx()
16
+ const { content, ready } = useWorkspaceSetup(workspaceId, contentPending, {
17
+ name: name ?? 'Workspace',
18
+ icon: layout.icon,
19
+ workspaceType: provider,
20
+ workspaceTheme: layout.theme
21
+ })
22
+
23
+ return ready ? (
24
+ <WorkspaceContent widgets={widgets} views={views} />
25
+ ) : (
26
+ <WorkspaceSetupPanel>{content}</WorkspaceSetupPanel>
27
+ )
28
+ }
@@ -5,7 +5,7 @@ import type { PanelImperativeHandle } from 'react-resizable-panels'
5
5
  import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '../../components/ui/resizable'
6
6
  import { cn } from '../../lib/cn'
7
7
 
8
- import type { WorkspaceSplitLayoutConstraints } from './useFitsSplitLayout'
8
+ import type { WorkspaceSplitLayoutConstraints } from './use-fits-split-layout'
9
9
 
10
10
  type WorkspaceSplitLayoutProps = WorkspaceSplitLayoutConstraints & {
11
11
  workspace: ReactNode
@@ -1,8 +1,8 @@
1
1
  import { IconPlus, IconX, type Icon as TabIcon } from '@tabler/icons-react'
2
2
  import { cva } from 'class-variance-authority'
3
3
 
4
- import { ReorderableList } from '@/client/components/shared/ReorderableList'
5
- import type { ReorderableRenderState } from '@/client/components/shared/ReorderableList'
4
+ import { ReorderableList } from '@/client/components/shared/reorderable-list'
5
+ import type { ReorderableRenderState } from '@/client/components/shared/reorderable-list'
6
6
  import { Button, buttonVariants } from '@/client/components/ui/button'
7
7
  import { Spinner } from '@/client/components/ui/spinner'
8
8
  import {
package/client/index.css CHANGED
@@ -50,8 +50,8 @@
50
50
  --mono: var(--default-mono);
51
51
 
52
52
  /* Workspace page layout — single source of truth for the widget/chat panel.
53
- Read by routes/workspace/[id].tsx; don't hardcode equivalents. (The app
54
- sidebar's own widths live in SidebarLayout.tsx.) */
53
+ Read by features/workspace/workspace-content.tsx; don't hardcode equivalents. (The app
54
+ sidebar's own widths live in sidebar-layout.tsx.) */
55
55
  --page-pad: 2rem; /* padding around the working area */
56
56
  --column-w: 40rem; /* grid content width; also the widget area's min before the chat yields */
57
57
  --chat-min: 320px; /* docked chat min width — narrower than this and it floats */
package/client/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <!-- The app has no dark mode (nothing ever adds the `.dark` class), so say
7
7
  so: without this the browser picks a base canvas from the OS setting. -->
8
8
  <meta name="color-scheme" content="light" />
9
- <title>moi</title>
9
+ <title>Moi</title>
10
10
  <!-- First-paint background, inline and before the stylesheet link on
11
11
  purpose. index.css is render-blocking, so until it resolves the browser
12
12
  has only its own white canvas to paint — on a cold load or a new tab
@@ -5,11 +5,6 @@ export type AgentAvailability =
5
5
  | { status: 'checking' }
6
6
  | { status: 'disconnected' }
7
7
 
8
- export type AgentUnavailable = Exclude<
9
- AgentAvailability,
10
- { status: 'checking' } | { status: 'available' }
11
- >
12
-
13
8
  export function resolveAgentAvailability(
14
9
  availability: HarnessAvailability | undefined,
15
10
  disconnected: boolean
package/client/main.tsx CHANGED
@@ -6,7 +6,7 @@ import { Toaster } from '@/client/components/ui/toast'
6
6
  import { TooltipProvider } from '@/client/components/ui/tooltip'
7
7
  import { installAppletErrorHook } from '@/client/features/applets/applet-log'
8
8
  import { initConnection } from '@/client/features/chat/connection/chat-connection'
9
- import { AppRouter } from './app/AppRouter'
9
+ import { AppRouter } from './app/app-router'
10
10
 
11
11
  const queryClient = new QueryClient()
12
12
 
@@ -3,13 +3,7 @@ import type { NavigationRequest } from '@/lib/navigation'
3
3
 
4
4
  import { useLatestRef } from '@/client/lib/use-latest-ref'
5
5
  import { wsUrl } from '@/client/lib/ws-url'
6
- import type {
7
- AgentLoginState,
8
- AppSettings,
9
- HarnessAvailability,
10
- ViewInfo,
11
- WidgetInfo
12
- } from '@/lib/types'
6
+ import type { AppSettings, HarnessAvailability, ViewInfo, WidgetInfo } from '@/lib/types'
13
7
 
14
8
  export type WorkspaceEvent =
15
9
  | { type: 'widget:updated'; name: string }
@@ -29,14 +23,11 @@ export type WorkspaceEvent =
29
23
  | { type: 'workspaces-list:updated' }
30
24
  // A workspace's env changed outside the UI — refetch the env view.
31
25
  | { type: 'env:updated'; workspaceId: string }
32
- // The agent backend's availability or login ceremony changed (login landed,
33
- // ceremony timed out, auth probe flipped). Carries the new state so caches
34
- // patch without a refetch.
26
+ // Workspace readiness changed. Patch its cache without a refetch.
35
27
  | {
36
- type: 'agent:updated'
28
+ type: 'harness:updated'
37
29
  workspaceId: string
38
30
  availability: HarnessAvailability
39
- login?: AgentLoginState
40
31
  }
41
32
  // The Scratchpad canvas for `workspaceId` was saved — open tabs reload from
42
33
  // disk. `origin` is the tab that wrote it, so that tab can skip its own echo.
@@ -0,0 +1,2 @@
1
+ import{Rc as p}from"/chunk-jvyvwwv3.js";import{Uc as y,Xc as r}from"/chunk-9vg3xa81.js";import{_c as m}from"/chunk-d7cbm65e.js";var E=m(y(),1);var a={collab:!1},f=Object.keys(a);var F={environment:"local",demo:!1,experimental:{...a},demoInstallUrl:"https://moi.computer"},t=F,o=new Set;function d(e){return o.add(e),()=>{o.delete(e)}}async function x(){try{t=await p("/api/config");for(let e of o)e();return t}catch{}}async function b(){let e=await x();return r(()=>{x()}),e}function A(){return E.useSyncExternalStore(d,()=>t)}
2
+ export{b as Hc,A as Ic};