moi-computer 0.11.0 → 0.11.1-dev.be1ed10

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 (362) hide show
  1. package/README.md +2 -2
  2. package/client/AGENTS.md +2 -2
  3. package/client/app/AppRouter.tsx +2 -2
  4. package/client/app/routes/WorkspaceRoute.tsx +7 -9
  5. package/client/app/shell/SidebarLayout.tsx +18 -15
  6. package/client/components/shared/BottomPanel.tsx +26 -14
  7. package/client/components/shared/PanelHeader.tsx +1 -1
  8. package/client/components/shared/ReorderableList.tsx +7 -2
  9. package/client/components/shared/WorkspaceIcon.tsx +92 -0
  10. package/client/components/ui/alert-dialog.tsx +1 -0
  11. package/client/components/ui/button.tsx +1 -53
  12. package/client/components/ui/checkbox.tsx +1 -0
  13. package/client/components/ui/collapsible.tsx +1 -15
  14. package/client/components/ui/dialog.tsx +1 -58
  15. package/client/components/ui/dropdown-menu.tsx +1 -254
  16. package/client/components/ui/hover-card.tsx +1 -44
  17. package/client/components/ui/inline-input.tsx +84 -0
  18. package/client/components/ui/input.tsx +1 -21
  19. package/client/components/ui/popover.tsx +1 -88
  20. package/client/components/ui/resizable.tsx +1 -40
  21. package/client/components/ui/skeleton.tsx +1 -13
  22. package/client/components/ui/slider.tsx +1 -70
  23. package/client/components/ui/spinner.tsx +1 -18
  24. package/client/components/ui/switch.tsx +1 -23
  25. package/client/components/ui/tabs.tsx +1 -0
  26. package/client/components/ui/textarea.tsx +1 -18
  27. package/client/components/ui/toast.tsx +2 -2
  28. package/client/components/ui/tooltip.tsx +1 -51
  29. package/client/features/applets/AppletMount.tsx +1 -1
  30. package/client/features/applets/applet-cache.ts +3 -3
  31. package/client/features/applets/applet-runtime.ts +147 -108
  32. package/client/features/applets/applet-styles.ts +2 -2
  33. package/client/features/applets/applet-thumbnail.ts +6 -8
  34. package/client/features/applets/useApplet.ts +10 -9
  35. package/client/features/chat/ChatPanel.tsx +24 -15
  36. package/client/features/chat/ChatPopup.tsx +9 -5
  37. package/client/features/chat/applet-chat-intents.ts +170 -0
  38. package/client/features/chat/chat-send.ts +116 -64
  39. package/client/features/chat/chat-store.ts +51 -62
  40. package/client/features/chat/composer/ChatComposer.tsx +43 -128
  41. package/client/features/chat/composer/ModelPicker.tsx +47 -60
  42. package/client/features/chat/composer/attachments/AttachmentChip.tsx +99 -0
  43. package/client/features/chat/composer/attachments/DrawingAttachmentChip.tsx +37 -0
  44. package/client/features/chat/composer/attachments/FileAttachmentChip.tsx +22 -0
  45. package/client/features/chat/composer/attachments/TextAttachmentChip.tsx +11 -0
  46. package/client/features/chat/composer/attachments/draft-attachments.ts +168 -0
  47. package/client/features/chat/composer/attachments/types.ts +25 -0
  48. package/client/features/chat/composer/attachments/uploads.ts +26 -0
  49. package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
  50. package/client/features/chat/composer/model-order.ts +15 -0
  51. package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
  52. package/client/features/chat/{chat-connection.ts → connection/chat-connection.ts} +1 -1
  53. package/client/features/chat/{chat-frames.ts → connection/chat-frames.ts} +10 -8
  54. package/client/features/chat/{ChatEmptyState.tsx → messages/ChatEmptyState.tsx} +16 -11
  55. package/client/features/chat/{MarkdownContent.tsx → messages/MarkdownContent.tsx} +16 -1
  56. package/client/features/chat/{TurnView.tsx → messages/TurnView.tsx} +27 -19
  57. package/client/features/chat/{group-turns.ts → messages/group-turns.ts} +12 -0
  58. package/client/features/chat/{interleave-notices.ts → messages/interleave-notices.ts} +7 -11
  59. package/client/features/chat/{tool-group → messages/tool-group}/SubagentCard.tsx +1 -1
  60. package/client/features/chat/{tool-group → messages/tool-group}/TimelineRow.tsx +2 -2
  61. package/client/features/chat/{tool-group → messages/tool-group}/ToolCallGroup.tsx +2 -5
  62. package/client/features/chat/{tool-group → messages/tool-group}/format/codex.ts +4 -1
  63. package/client/features/chat/{ChatSelector.tsx → sessions/ChatSelector.tsx} +3 -3
  64. package/client/features/chat/{api.ts → sessions/api.ts} +5 -14
  65. package/client/features/chat/sessions/session-view.ts +53 -0
  66. package/client/features/chat/useChat.ts +42 -24
  67. package/client/features/dev/ChatStatesPage.tsx +8 -7
  68. package/client/features/dev/DevIndexPage.tsx +5 -0
  69. package/client/features/dev/DevRoutes.tsx +2 -0
  70. package/client/features/dev/HarnessDebugPage.tsx +11 -8
  71. package/client/features/dev/ToolCallsPage.tsx +1 -1
  72. package/client/features/dev/UiComponentPreviews.tsx +855 -0
  73. package/client/features/dev/UiComponentsPage.tsx +60 -0
  74. package/client/features/dev/chat-states-fixtures.ts +13 -2
  75. package/client/features/drawings/useChatAnnotation.ts +17 -17
  76. package/client/features/drawings/useDrawingLayer.ts +7 -9
  77. package/client/features/drawings/useViewBuilderSketch.ts +18 -15
  78. package/client/features/home/HomePage.tsx +8 -7
  79. package/client/features/home/WorkspacePreview.tsx +2 -2
  80. package/client/features/home/workspace-presentation.tsx +1 -11
  81. package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
  82. package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
  83. package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +2 -4
  84. package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
  85. package/client/features/overview/HiddenPanel.tsx +109 -0
  86. package/client/features/overview/Overview.tsx +302 -0
  87. package/client/features/overview/WidgetCanvas.tsx +164 -0
  88. package/client/features/{widgets → overview}/WidgetFrame.tsx +25 -17
  89. package/client/features/overview/WorkspaceName.tsx +60 -0
  90. package/client/features/overview/api.ts +30 -0
  91. package/client/features/overview/default/ViewsWidget.tsx +252 -0
  92. package/client/features/overview/default/registry.tsx +36 -0
  93. package/client/features/{widgets → overview}/grid.ts +36 -0
  94. package/client/features/overview/useGridReconcile.ts +94 -0
  95. package/client/features/scratchpad/Scratchpad.tsx +7 -8
  96. package/client/features/scratchpad/ScratchpadControls.tsx +0 -1
  97. package/client/features/scratchpad/useScratchpadSnapshot.tsx +23 -13
  98. package/client/features/settings/GeneralSettings.tsx +55 -58
  99. package/client/features/settings/SettingsLayout.tsx +2 -2
  100. package/client/features/settings/WorkspaceIconPicker.tsx +318 -0
  101. package/client/features/settings/WorkspaceSettingsDialog.tsx +65 -0
  102. package/client/features/settings/api.ts +48 -24
  103. package/client/features/views/ViewBuilder.tsx +5 -4
  104. package/client/features/views/ViewManager.tsx +25 -22
  105. package/client/features/views/api.ts +36 -2
  106. package/client/features/views/useViewBuilderActions.ts +8 -5
  107. package/client/features/views/useViewBuilderDrafts.ts +23 -21
  108. package/client/features/views/view-presentation.ts +13 -0
  109. package/client/features/workspace/{CustomizePanel.tsx → ThemePanel.tsx} +26 -31
  110. package/client/features/workspace/UnavailablePage.tsx +21 -0
  111. package/client/features/workspace/WorkspaceLayoutContext.tsx +4 -7
  112. package/client/features/workspace/WorkspaceScreen.tsx +210 -162
  113. package/client/features/workspace/WorkspaceSplitLayout.tsx +7 -2
  114. package/client/features/workspace/WorkspaceTabs.tsx +2 -0
  115. package/client/features/workspace/api.ts +2 -30
  116. package/client/features/workspace/moi-context.ts +8 -9
  117. package/client/features/workspace/tab-resolution.ts +10 -33
  118. package/client/features/workspace/useWorkspaceNavigation.ts +164 -101
  119. package/client/index.css +23 -30
  120. package/client/lib/app-icon-registry.ts +2 -0
  121. package/client/lib/use-latest-ref.ts +11 -0
  122. package/client/main.tsx +1 -1
  123. package/client/runtime/useWorkspaceEvents.ts +59 -14
  124. package/client/theme.css +5 -5
  125. package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
  126. package/dist/chunk-691pqsj6.js +2 -0
  127. package/dist/chunk-7a5nm4k9.css +1 -0
  128. package/dist/chunk-amb8y04y.js +1 -0
  129. package/dist/chunk-cf3pgy7j.js +546 -0
  130. package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
  131. package/dist/chunk-mzrgr577.js +5 -0
  132. package/dist/chunk-nf2wkvf9.js +14 -0
  133. package/dist/chunk-q6a0g26x.js +1 -0
  134. package/dist/chunk-twgdemkc.js +74 -0
  135. package/dist/chunk-x90k0f5c.js +2 -0
  136. package/dist/chunk-yq00csvd.js +2 -0
  137. package/dist/index.html +1 -1
  138. package/lib/app-icons.ts +1 -0
  139. package/lib/applet-selector.ts +24 -0
  140. package/lib/chat-title.ts +6 -1
  141. package/lib/default-widgets.ts +32 -0
  142. package/lib/format.ts +67 -7
  143. package/lib/message-attachments.ts +40 -0
  144. package/lib/moi-attachments.ts +204 -0
  145. package/lib/moi-context.ts +20 -35
  146. package/lib/navigation.ts +84 -0
  147. package/lib/themes.ts +6 -6
  148. package/lib/types.ts +91 -34
  149. package/lib/workspace-icon.ts +20 -0
  150. package/lib/workspace-layout.ts +22 -2
  151. package/lib/workspace-tabs.ts +9 -33
  152. package/package.json +42 -32
  153. package/registry.json +656 -0
  154. package/server/AGENTS.md +2 -0
  155. package/server/agent.ts +1 -1
  156. package/server/api.ts +139 -66
  157. package/server/applet-typecheck.ts +95 -0
  158. package/server/applets/applet-css.ts +55 -0
  159. package/server/{bundler → applets}/build-applet.ts +13 -242
  160. package/server/applets/build-worker.ts +178 -0
  161. package/server/applets/config.ts +226 -0
  162. package/server/applets/dependencies.ts +206 -0
  163. package/server/{applets.ts → applets/index.ts} +44 -189
  164. package/server/applets/runtime/base.ts +4 -0
  165. package/server/applets/runtime/moi.ts +42 -0
  166. package/server/applets/runtime/rpc.ts +17 -0
  167. package/server/applets/view-source.ts +67 -0
  168. package/server/attachment-message.ts +95 -0
  169. package/server/cli-ui-components.ts +28 -33
  170. package/server/cli.ts +169 -108
  171. package/server/control.ts +63 -42
  172. package/server/data-dir.ts +1 -1
  173. package/server/harness/README.md +45 -50
  174. package/server/harness/acp/NOTES.md +426 -0
  175. package/server/harness/acp/adapter.ts +7 -21
  176. package/server/harness/acp/discovery.ts +27 -30
  177. package/server/harness/acp/model-state.ts +57 -0
  178. package/server/harness/acp/session.ts +49 -56
  179. package/server/harness/claude-code/NOTES.md +54 -13
  180. package/server/harness/claude-code/adapter.ts +8 -25
  181. package/server/harness/claude-code/cli.ts +40 -0
  182. package/server/harness/claude-code/index.ts +13 -5
  183. package/server/harness/claude-code/models.ts +72 -19
  184. package/server/harness/claude-code/session.ts +447 -343
  185. package/server/harness/claude-code/sessions.ts +9 -4
  186. package/server/harness/codex/NOTES.md +222 -350
  187. package/server/harness/codex/adapter.ts +102 -52
  188. package/server/harness/codex/auth.ts +1 -3
  189. package/server/harness/codex/client.ts +169 -249
  190. package/server/harness/codex/discovery.ts +9 -17
  191. package/server/harness/codex/index.ts +3 -1
  192. package/server/harness/codex/pagination.ts +24 -0
  193. package/server/harness/codex/permissions.ts +32 -8
  194. package/server/harness/codex/probe.ts +10 -13
  195. package/server/harness/codex/session.ts +567 -181
  196. package/server/harness/codex/transport.ts +184 -0
  197. package/server/harness/debug.ts +1 -1
  198. package/server/harness/hermes/NOTES.md +19 -1
  199. package/server/harness/hermes/discovery.ts +20 -0
  200. package/server/harness/hermes/index.ts +13 -0
  201. package/server/harness/hermes/models.ts +28 -8
  202. package/server/harness/openclaw/NOTES.md +1 -1
  203. package/server/harness/openclaw/adapter.ts +22 -4
  204. package/server/harness/openclaw/gateway.ts +5 -3
  205. package/server/harness/openclaw/session.ts +27 -27
  206. package/server/harness/types.ts +9 -5
  207. package/server/layout.ts +9 -14
  208. package/server/moi-scaffold.ts +22 -14
  209. package/server/navigation-relay.ts +110 -0
  210. package/server/preview.ts +3 -1
  211. package/server/registry.ts +71 -41
  212. package/server/scratchpad-executor.ts +79 -56
  213. package/server/scratchpad-shape-defaults.ts +82 -0
  214. package/server/selected-session.ts +24 -4
  215. package/server/skill-update.ts +5 -3
  216. package/server/skill-version.ts +4 -7
  217. package/server/skills-template.ts +48 -9
  218. package/server/tabs.ts +19 -33
  219. package/server/tldraw-package.d.ts +4 -0
  220. package/server/ui-components.ts +101 -434
  221. package/server/uploads.ts +0 -0
  222. package/server/view-builders.ts +20 -2
  223. package/server/views.ts +126 -6
  224. package/server/web.ts +46 -13
  225. package/server/widgets.ts +12 -5
  226. package/server/workspace-config.ts +13 -9
  227. package/server/workspace-env.ts +3 -2
  228. package/tsconfig.json +0 -1
  229. package/ui-components/accordion.tsx +71 -0
  230. package/ui-components/alert-dialog.tsx +165 -0
  231. package/ui-components/alert.tsx +68 -0
  232. package/ui-components/attachment.tsx +195 -0
  233. package/ui-components/avatar.tsx +90 -0
  234. package/ui-components/badge.tsx +49 -0
  235. package/ui-components/button-group.tsx +78 -0
  236. package/ui-components/button.tsx +55 -0
  237. package/ui-components/calendar.tsx +180 -0
  238. package/ui-components/card.tsx +84 -0
  239. package/ui-components/carousel.tsx +235 -0
  240. package/ui-components/chart.tsx +338 -0
  241. package/ui-components/checkbox.tsx +28 -0
  242. package/ui-components/collapsible.tsx +15 -0
  243. package/ui-components/combobox.tsx +267 -0
  244. package/ui-components/context-menu.tsx +244 -0
  245. package/ui-components/dialog.tsx +138 -0
  246. package/ui-components/docs/accordion.md +463 -0
  247. package/ui-components/docs/alert-dialog.md +481 -0
  248. package/ui-components/docs/alert.md +301 -0
  249. package/ui-components/docs/attachment.md +689 -0
  250. package/ui-components/docs/avatar.md +495 -0
  251. package/ui-components/docs/badge.md +258 -0
  252. package/ui-components/docs/button-group.md +879 -0
  253. package/ui-components/docs/button.md +26 -0
  254. package/ui-components/docs/calendar.md +862 -0
  255. package/ui-components/docs/card.md +265 -0
  256. package/ui-components/docs/carousel.md +627 -0
  257. package/ui-components/docs/chart.md +1256 -0
  258. package/ui-components/docs/checkbox.md +477 -0
  259. package/ui-components/docs/collapsible.md +446 -0
  260. package/ui-components/docs/combobox.md +1003 -0
  261. package/ui-components/docs/context-menu.md +860 -0
  262. package/ui-components/docs/data-table.md +1580 -0
  263. package/ui-components/docs/date-picker.md +614 -0
  264. package/ui-components/docs/dialog.md +414 -0
  265. package/ui-components/docs/drawer.md +51 -0
  266. package/ui-components/docs/dropdown-menu.md +1000 -0
  267. package/ui-components/docs/field.md +1192 -0
  268. package/ui-components/docs/hover-card.md +275 -0
  269. package/ui-components/docs/input-group.md +866 -0
  270. package/ui-components/docs/input.md +456 -0
  271. package/ui-components/docs/kbd.md +191 -0
  272. package/ui-components/docs/label.md +295 -0
  273. package/ui-components/docs/pagination.md +416 -0
  274. package/ui-components/docs/popover.md +348 -0
  275. package/ui-components/docs/progress.md +214 -0
  276. package/ui-components/docs/radio-group.md +389 -0
  277. package/ui-components/docs/resizable.md +265 -0
  278. package/ui-components/docs/select.md +616 -0
  279. package/ui-components/docs/separator.md +216 -0
  280. package/ui-components/docs/skeleton.md +205 -0
  281. package/ui-components/docs/slider.md +226 -0
  282. package/ui-components/docs/spinner.md +332 -0
  283. package/ui-components/docs/switch.md +236 -0
  284. package/ui-components/docs/table.md +551 -0
  285. package/ui-components/docs/tabs.md +379 -0
  286. package/ui-components/docs/textarea.md +187 -0
  287. package/ui-components/docs/toggle-group.md +370 -0
  288. package/ui-components/docs/toggle.md +91 -0
  289. package/ui-components/docs/tooltip.md +290 -0
  290. package/ui-components/drawer.tsx +213 -0
  291. package/ui-components/dropdown-menu.tsx +263 -0
  292. package/ui-components/field.tsx +224 -0
  293. package/ui-components/hover-card.tsx +46 -0
  294. package/ui-components/input-group.tsx +146 -0
  295. package/ui-components/input.tsx +20 -0
  296. package/ui-components/kbd.tsx +32 -0
  297. package/ui-components/label.tsx +17 -0
  298. package/ui-components/pagination.tsx +124 -0
  299. package/ui-components/popover.tsx +81 -0
  300. package/ui-components/progress.tsx +63 -0
  301. package/ui-components/radio-group.tsx +38 -0
  302. package/ui-components/resizable.tsx +40 -0
  303. package/ui-components/scoped-portal.tsx +31 -0
  304. package/ui-components/select.tsx +195 -0
  305. package/ui-components/separator.tsx +18 -0
  306. package/ui-components/skeleton.tsx +15 -0
  307. package/ui-components/slider.tsx +75 -0
  308. package/ui-components/spinner.tsx +20 -0
  309. package/ui-components/switch.tsx +27 -0
  310. package/ui-components/table.tsx +86 -0
  311. package/ui-components/tabs.tsx +75 -0
  312. package/ui-components/textarea.tsx +17 -0
  313. package/ui-components/toggle-group.tsx +85 -0
  314. package/ui-components/toggle.tsx +42 -0
  315. package/ui-components/tooltip.tsx +61 -0
  316. package/ui-components/utils.ts +8 -0
  317. package/workspace/.claude/skills/moi-workspace/SKILL.md +295 -248
  318. package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +100 -152
  319. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +156 -0
  320. package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
  321. package/client/features/chat/attachment-staging.ts +0 -153
  322. package/client/features/chat/uploads.ts +0 -18
  323. package/client/features/chat/useAppletChatMessage.ts +0 -68
  324. package/client/features/settings/IconPicker.tsx +0 -442
  325. package/client/features/settings/WorkspaceSettings.tsx +0 -92
  326. package/client/features/settings/render-icon.ts +0 -173
  327. package/client/features/widgets/HiddenPanel.tsx +0 -80
  328. package/client/features/widgets/WidgetGrid.tsx +0 -123
  329. package/client/features/widgets/Widgets.tsx +0 -264
  330. package/client/features/widgets/useGridReconcile.ts +0 -73
  331. package/dist/chunk-104m57qw.js +0 -2
  332. package/dist/chunk-59zf0m6n.js +0 -1
  333. package/dist/chunk-bj3akjs2.js +0 -1
  334. package/dist/chunk-c9pjqx9m.js +0 -14
  335. package/dist/chunk-j2w2vak4.js +0 -546
  336. package/dist/chunk-k2r9c95m.js +0 -10
  337. package/dist/chunk-kmbxhgwv.js +0 -1
  338. package/dist/chunk-p1yqa71k.js +0 -83
  339. package/dist/chunk-pcnahct1.js +0 -5
  340. package/dist/chunk-r5xrenjy.css +0 -1
  341. package/dist/chunk-tny85yt2.js +0 -2
  342. package/dist/chunk-v7wr1df4.js +0 -2
  343. package/server/bundler/applet-css.ts +0 -155
  344. /package/client/features/chat/{ChatPromptBubbles.tsx → messages/ChatPromptBubbles.tsx} +0 -0
  345. /package/client/features/chat/{ShimmerText.tsx → messages/ShimmerText.tsx} +0 -0
  346. /package/client/features/chat/{preview-turn.ts → messages/preview-turn.ts} +0 -0
  347. /package/client/features/chat/{tool-group → messages/tool-group}/CodeBlock.tsx +0 -0
  348. /package/client/features/chat/{tool-group → messages/tool-group}/Collapse.tsx +0 -0
  349. /package/client/features/chat/{tool-group → messages/tool-group}/ReadImagePreview.tsx +0 -0
  350. /package/client/features/chat/{tool-group → messages/tool-group}/ToolOutput.tsx +0 -0
  351. /package/client/features/chat/{tool-group → messages/tool-group}/detect.ts +0 -0
  352. /package/client/features/chat/{tool-group → messages/tool-group}/fixtures.ts +0 -0
  353. /package/client/features/chat/{tool-group → messages/tool-group}/format/claude.ts +0 -0
  354. /package/client/features/chat/{tool-group → messages/tool-group}/format/hermes.ts +0 -0
  355. /package/client/features/chat/{tool-group → messages/tool-group}/format/index.ts +0 -0
  356. /package/client/features/chat/{tool-group → messages/tool-group}/format/mcp.ts +0 -0
  357. /package/client/features/chat/{tool-group → messages/tool-group}/format/openclaw.ts +0 -0
  358. /package/client/features/chat/{tool-group → messages/tool-group}/format/shared.ts +0 -0
  359. /package/client/features/chat/{tool-group → messages/tool-group}/format/shell.ts +0 -0
  360. /package/client/features/chat/{tool-group → messages/tool-group}/index.ts +0 -0
  361. /package/client/features/chat/{useStickToBottom.ts → messages/useStickToBottom.ts} +0 -0
  362. /package/client/features/chat/{useSelectedSession.ts → sessions/useSelectedSession.ts} +0 -0
package/lib/types.ts CHANGED
@@ -1,8 +1,20 @@
1
1
  import type { PreviewBlock, StreamEvent } from './format'
2
+ import type { AppIconId } from './app-icons'
3
+ import type { MoiContext } from './moi-context'
4
+ import type { WorkspaceTheme } from './themes'
2
5
 
3
6
  // A custom UI unit embedded in a workspace.
4
7
  export type AppletKind = 'view' | 'widget'
5
8
 
9
+ // What a bundled applet's `moi` module may call on its host-attached bridge.
10
+ // Inputs stay unknown at this trust boundary; the browser host narrows them.
11
+ export type AppletBridge = {
12
+ addChatAttachment: (input: unknown) => void
13
+ navigate: (href: unknown) => void
14
+ resolveHref: (href: unknown) => string
15
+ sendChatMessage: (input: unknown, context?: unknown) => void
16
+ }
17
+
6
18
  export type AppletInfo = {
7
19
  id: string
8
20
  // Content revision of the built bundle (`<size>-<mtime>` of index.js).
@@ -68,7 +80,7 @@ export type ViewBuilder = {
68
80
  // server-side (bundle pipeline, RPC route); `load`/`render`/`window`/`runtime`
69
81
  // are browser-side and reach the journal via POST
70
82
  // /api/workspaces/:id/applet-log. `runtime` is the applet API refusing a
71
- // request rather than code throwing — a `focusTab` at a tab that no longer
83
+ // request rather than code throwing — a `navigate` to a view that no longer
72
84
  // exists, a `sendChatMessage` dropped by the rate limit — which the applet's
73
85
  // own code never sees.
74
86
  export type AppletLogSource = 'build' | 'load' | 'render' | 'window' | 'rpc' | 'runtime'
@@ -184,11 +196,45 @@ export type ScratchOpResult = { name: string } | { image: string } | { ok: true
184
196
  // the snapshot can name the version it needs (see lib/scratchpad-skew.ts).
185
197
  export type ScratchpadWriter = { moi: string; tldraw: string }
186
198
 
187
- // An attachment uploaded ahead of a chat message. The bytes live server-side in
188
- // an in-memory upload store (see server/uploads.ts); a chat frame references it
189
- // by `id`. `kind` splits the two delivery paths: an `image` is inlined as a
190
- // base64 vision block in the agent message, a `file` is written to a temp path
191
- // the agent can `Read`. Returned by POST /api/workspaces/:id/uploads.
199
+ // Attachments: caller input → upload receipt → send reference → resolved data.
200
+ // Text skips uploading. Origin and drawing purpose follow the attachment.
201
+ export type DrawingPurpose = 'annotation' | 'sketch'
202
+
203
+ // Host-stamped ID of the applet or workspace tab that created the attachment.
204
+ export type AttachmentOrigin = { source: string }
205
+
206
+ export type TextAttachment = Partial<AttachmentOrigin> & { label: string; text: string }
207
+
208
+ type FileAttachment = Partial<AttachmentOrigin> & {
209
+ mediaType: string
210
+ path: string
211
+ // Only set when the file contains a drawing image.
212
+ purpose?: DrawingPurpose
213
+ }
214
+
215
+ type ImageAttachment = Partial<AttachmentOrigin> & {
216
+ mediaType: string
217
+ label: string
218
+ purpose?: DrawingPurpose
219
+ }
220
+
221
+ // Resolved payloads: JSON-safe data shared by prompts and transcript replay.
222
+ export type Attachment =
223
+ | ({ type: 'text' } & TextAttachment)
224
+ | ({ type: 'file' } & FileAttachment)
225
+ | ({ type: 'image' } & ImageAttachment)
226
+
227
+ // Caller input: text or a browser file / workspace-relative path.
228
+ export type TextAttachmentInput = Pick<TextAttachment, 'label' | 'text'>
229
+
230
+ type FileAttachmentInput = { file: File; path?: never } | { path: string; file?: never }
231
+
232
+ export type AttachmentInput =
233
+ | ({ type: 'text' } & TextAttachmentInput)
234
+ | ({ type: 'file' } & FileAttachmentInput)
235
+
236
+ // Upload receipt: returned by the upload API before sending the message.
237
+ // Bytes or an absolute file path live in the server's workspace-scoped store.
192
238
  export type UploadKind = 'image' | 'file'
193
239
  export type UploadInfo = {
194
240
  id: string
@@ -202,9 +248,13 @@ export type UploadInfo = {
202
248
  height?: number
203
249
  }
204
250
 
205
- // Client → Server messages.
206
- // The chat WebSocket is app-wide (one socket for the whole client, not scoped to
207
- // a workspace), so every message carries the `workspaceId` it targets.
251
+ // Send reference: inline text or an upload ID for the server to resolve.
252
+ // Drawing purpose belongs to this message's use of the uploaded image.
253
+ export type MessageAttachment =
254
+ | ({ type: 'text' } & TextAttachment)
255
+ | ({ type: 'upload'; uploadId: string; purpose?: DrawingPurpose } & Partial<AttachmentOrigin>)
256
+
257
+ // Client → server messages, routed by workspaceId over the shared WebSocket.
208
258
  export type ClientMessage =
209
259
  | {
210
260
  type: 'chat'
@@ -212,10 +262,9 @@ export type ClientMessage =
212
262
  content: string
213
263
  sessionId: string
214
264
  isNew: boolean
215
- // Upload ids (from POST .../uploads) to attach to this turn. The server
216
- // resolves each from its upload store and turns it into a vision block
217
- // (image) or a temp-file path reference (other files). Order is preserved.
218
- attachments?: string[]
265
+ // Text and upload references for this turn. The server resolves uploads
266
+ // and describes all attachments together, preserving their order.
267
+ attachments?: MessageAttachment[]
219
268
  // Client-chosen stable id for the user's turn. The server tells the
220
269
  // adapter to use this id when the SDK echoes the user input back, so
221
270
  // the optimistic bubble the client rendered gets upserted in place.
@@ -240,7 +289,7 @@ export type ClientMessage =
240
289
  // snapshotted at send time, assembled by
241
290
  // client/features/workspace/moi-context.ts. The server renders it per
242
291
  // harness; display paths strip the rendered envelope from bubbles.
243
- context?: import('./moi-context').MoiContext
292
+ context?: MoiContext
244
293
  }
245
294
  | { type: 'stop'; workspaceId: string; sessionId: string }
246
295
  // Reply to a relayed Scratchpad op (see ScratchpadOpMessage). Carries the
@@ -436,6 +485,11 @@ export type AgentLoginState =
436
485
  | { state: 'pending'; url?: string }
437
486
  | { state: 'failed'; reason: string }
438
487
 
488
+ export type WorkspaceIcon =
489
+ | { type: 'emoji'; value: string; background?: 'theme' }
490
+ | { type: 'glyph'; value: AppIconId; background?: 'theme' }
491
+ | { type: 'upload'; value: string }
492
+
439
493
  // One MCP server's connection status, as surfaced by GET /api/workspaces/:id/mcp
440
494
  // (a subset of the agent SDK's McpServerStatus — only what the UI renders).
441
495
  export type McpServerState = 'connected' | 'failed' | 'needs-auth' | 'pending' | 'disabled'
@@ -454,9 +508,11 @@ export type WorkspaceEntry = {
454
508
  // basename). Persisted so we don't re-probe the gateway for each listing.
455
509
  // The list endpoint overrides this with the live layout `name` when set.
456
510
  name?: string
457
- // Workspace icon override (base64 data URL), merged in from the layout by the
458
- // list endpoint. Undefined → the sidebar uses the provider icon.
459
- icon?: string
511
+ // Workspace icon override. Undefined uses the provider icon.
512
+ icon?: WorkspaceIcon
513
+ // Merged in from the layout so app-wide workspace lists can paint a themed
514
+ // icon without inheriting the active workspace's color.
515
+ theme?: WorkspaceTheme
460
516
  // Home-relative rendering of `path` (e.g. "~/.openclaw/workspace"). Set by
461
517
  // the server on the wire — clients render it as-is.
462
518
  displayPath?: string
@@ -492,6 +548,9 @@ export type ErrorFrame = {
492
548
  workspaceId: string
493
549
  sessionId: string
494
550
  content: string
551
+ // A failed steer or interrupt leaves the current run active. Older senders
552
+ // omit this field and retain terminal-error behavior.
553
+ terminal?: boolean
495
554
  }
496
555
 
497
556
  export type StoppedFrame = {
@@ -504,8 +563,8 @@ export type StoppedFrame = {
504
563
  // lifecycle signal (CC `session_state_changed`, Codex `turn/*`, OpenClaw run
505
564
  // lifecycle) rather than derived by counting messages:
506
565
  // running — the agent is working; the client shows the loader/Stop
507
- // requires-action — the agent is blocked on user input (permission prompt,
508
- // MCP elicitation). Not rendered yet: no loader, no Stop.
566
+ // requires-action — waiting for user input; no loader/Stop. Input notices
567
+ // provide the answer form independently of this state.
509
568
  // idle — everything else, including interrupted/failed turns
510
569
  export type SessionActivity = 'idle' | 'running' | 'requires-action'
511
570
 
@@ -526,10 +585,10 @@ export type LayoutMode = 'fullscreen' | 'split'
526
585
 
527
586
  export type WorkspaceTabId =
528
587
  | 'agent'
529
- | 'widgets'
588
+ | 'overview'
530
589
  | 'scratchpad'
531
- | `view:${string}`
532
- | `view-builder:${string}`
590
+ | `views/${string}`
591
+ | `view-builders/${string}`
533
592
 
534
593
  // Open tabs plus the workspace's saved DEFAULT tab. `active` is not live focus
535
594
  // state — the live active tab is each browser tab's URL (`/workspace/:id/<tab>`).
@@ -553,9 +612,8 @@ export type WorkspaceLayout = {
553
612
  // User-set display-name override. When empty/undefined the API falls back to
554
613
  // the workspace folder name, so the resolved name always comes from the API.
555
614
  name?: string
556
- // Workspace icon override — a base64 data URL (128×128 transparent WebP,
557
- // produced by the server). Undefined falls back to the provider icon.
558
- icon?: string
615
+ // Workspace icon override. Emoji and glyphs may use a themed background.
616
+ icon?: WorkspaceIcon
559
617
  // Model id chosen in the composer picker (`supportedModels()` `value`, an
560
618
  // alias like `sonnet`). Persisted so the choice survives a reload. Sent with
561
619
  // each chat frame; undefined means the agent runs on the SDK default. Note
@@ -571,7 +629,7 @@ export type WorkspaceLayout = {
571
629
  selectedEffort?: string
572
630
  // Fast-mode default for new sessions. Undefined inherits the provider setting.
573
631
  selectedFastMode?: boolean
574
- theme?: import('./themes').WorkspaceTheme
632
+ theme?: WorkspaceTheme
575
633
  }
576
634
 
577
635
  // One applet's thumbnail freshness record. Image bytes live as files in the
@@ -648,12 +706,14 @@ export type Model = {
648
706
  // Id used to select the model (Claude `value`; OpenClaw catalog id).
649
707
  value: string
650
708
  // Canonical wire model id this row resolves to (Claude, e.g. 'default' and
651
- // 'opus[1m]' both → 'claude-opus-4-8[1m]'). Lets the picker map the synthetic
652
- // "default" entry onto the concrete model it points at.
709
+ // 'opus[1m]' both → 'claude-opus-4-8[1m]'; Hermes maps its structured ACP
710
+ // default the same way). Lets the picker map a synthetic "default" entry
711
+ // onto the concrete model it points at.
653
712
  resolvedModel?: string
654
713
  // Human-readable label (Claude `displayName`; OpenClaw `name`).
655
714
  displayName: string
656
- // " · "-joined blurb (Claude): "<headline> · <tagline> · …". Absent for OpenClaw.
715
+ // One-line blurb (Claude: "Most efficient for everyday tasks"). Not shown by
716
+ // the picker. Absent for OpenClaw.
657
717
  description?: string
658
718
  // Heading this model sits under in the picker (Hermes: the upstream provider,
659
719
  // e.g. 'Ollama'). Absent when the backend serves one flat catalog.
@@ -677,11 +737,8 @@ export type Model = {
677
737
  supportsAutoMode?: boolean
678
738
  }
679
739
 
680
- // GET /api/workspaces/:id/agent payload — everything the client needs to know
681
- // about the workspace's agent backend in one request at workspace open.
682
- // `models` and capabilities are stable per process; `availability` and `login`
683
- // are the volatile part, kept fresh after load by `agent:updated` events
684
- // instead of refetches.
740
+ // GET /api/workspaces/:id/agent. Model changes arrive on refetch;
741
+ // `agent:updated` events refresh availability and login state.
685
742
  export type WorkspaceAgent = {
686
743
  // The agent backend that produced this snapshot — matches the workspace
687
744
  // provider.
@@ -0,0 +1,20 @@
1
+ import { isAppIconId } from './app-icons'
2
+ import type { WorkspaceIcon } from './types'
3
+
4
+ export function isWorkspaceIcon(value: unknown): value is WorkspaceIcon {
5
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return false
6
+ const icon = value as Record<string, unknown>
7
+ if (typeof icon.value !== 'string') return false
8
+ if (icon.background !== undefined && icon.background !== 'theme') return false
9
+
10
+ switch (icon.type) {
11
+ case 'emoji':
12
+ return icon.value.length > 0 && icon.value.length <= 64
13
+ case 'glyph':
14
+ return isAppIconId(icon.value)
15
+ case 'upload':
16
+ return icon.background === undefined
17
+ default:
18
+ return false
19
+ }
20
+ }
@@ -1,13 +1,33 @@
1
+ import { createDefaultWidgetGrid } from './default-widgets'
1
2
  import type { WorkspaceLayout, WorkspaceTabsState } from './types'
3
+ import { isWorkspaceTabId } from './workspace-tabs'
2
4
 
3
5
  export function createDefaultWorkspaceTabs(): WorkspaceTabsState {
4
- return { open: ['agent', 'widgets', 'scratchpad'], active: 'agent' }
6
+ return { open: ['overview', 'agent', 'scratchpad'], active: 'overview' }
7
+ }
8
+
9
+ export function normalizeWorkspaceTabs(value: unknown): WorkspaceTabsState {
10
+ const defaults = createDefaultWorkspaceTabs()
11
+ if (!value || typeof value !== 'object') return defaults
12
+
13
+ const raw = value as Record<string, unknown>
14
+ const savedOpen = Array.isArray(raw.open)
15
+ ? raw.open.filter(isWorkspaceTabId).filter((tab, index, all) => all.indexOf(tab) === index)
16
+ : []
17
+ if (savedOpen.length === 0) return defaults
18
+
19
+ const open = [
20
+ 'overview',
21
+ ...savedOpen.filter(tab => tab !== 'overview')
22
+ ] satisfies WorkspaceTabsState['open']
23
+ const active = isWorkspaceTabId(raw.active) && open.includes(raw.active) ? raw.active : 'overview'
24
+ return { open, active }
5
25
  }
6
26
 
7
27
  export function createDefaultWorkspaceLayout(): WorkspaceLayout {
8
28
  return {
9
29
  version: 1,
10
- widgetGrid: [],
30
+ widgetGrid: createDefaultWidgetGrid(),
11
31
  layoutMode: 'split',
12
32
  tabs: createDefaultWorkspaceTabs()
13
33
  }
@@ -1,48 +1,24 @@
1
- // Workspace tab addressing, shared by the client router, the control server,
2
- // and the CLI. A tab id doubles as the URL suffix of `/workspace/:id/<tab>` —
3
- // ids are URL-safe as-is (`:` is a legal path character), so building a path
4
- // is plain concatenation and parsing is plain validation.
1
+ // Tab IDs are workspace-relative paths without query strings.
5
2
  import type { WorkspaceTabId } from './types'
6
3
 
7
4
  export function isWorkspaceTabId(value: unknown): value is WorkspaceTabId {
8
5
  return (
9
6
  value === 'agent' ||
10
- value === 'widgets' ||
7
+ value === 'overview' ||
11
8
  value === 'scratchpad' ||
12
- // One path segment: a URL wildcard can span segments, a tab id never does.
13
- (typeof value === 'string' &&
14
- (/^view:[^/]+$/.test(value) || /^view-builder:[^/]+$/.test(value)))
9
+ // Match the applet IDs accepted by the server's module routes.
10
+ (typeof value === 'string' && /^(views|view-builders)\/[a-zA-Z0-9_-]+$/.test(value))
15
11
  )
16
12
  }
17
13
 
18
- // The tab id carried by a URL's wildcard segment, or null when the segment is
19
- // missing or isn't a tab id (bare `/workspace/:id`, stale or mangled links).
20
- export function parseWorkspaceTab(segment: string | null | undefined): WorkspaceTabId | null {
21
- return isWorkspaceTabId(segment) ? segment : null
22
- }
23
-
24
- export function workspaceTabPath(workspaceId: string, tab: WorkspaceTabId): string {
25
- return `/workspace/${workspaceId}/${tab}`
26
- }
27
-
28
- export const viewTabId = (viewId: string): WorkspaceTabId => `view:${viewId}`
14
+ export const viewTabId = (viewId: string): WorkspaceTabId => `views/${viewId}`
29
15
  export const viewIdFromTab = (tab: WorkspaceTabId): string | null =>
30
- tab.startsWith('view:') ? tab.slice('view:'.length) : null
31
- export const viewBuilderTabId = (builderId: string): WorkspaceTabId => `view-builder:${builderId}`
16
+ tab.startsWith('views/') ? tab.slice('views/'.length) : null
17
+ export const viewBuilderTabId = (builderId: string): WorkspaceTabId => `view-builders/${builderId}`
32
18
  export const viewBuilderIdFromTab = (tab: WorkspaceTabId): string | null =>
33
- tab.startsWith('view-builder:') ? tab.slice('view-builder:'.length) : null
19
+ tab.startsWith('view-builders/') ? tab.slice('view-builders/'.length) : null
34
20
 
35
- // The only params shape focusTab / `moi tab focus` carry: one JSON-plain
36
- // object. Arrays and null are valid JSON but not a params record.
21
+ // A record check shared by JSON boundary validators.
37
22
  export function isParamsRecord(value: unknown): value is Record<string, unknown> {
38
23
  return typeof value === 'object' && value !== null && !Array.isArray(value)
39
24
  }
40
-
41
- // Applet params as read back from navigation state (`state.appletParams`).
42
- // Anything malformed degrades to `{}` — a view must render with empty params
43
- // anyway (fresh mount, new browser tab, plain tab-bar click).
44
- export function readAppletParams(state: unknown): Record<string, unknown> {
45
- if (!isParamsRecord(state)) return {}
46
- const params = (state as { appletParams?: unknown }).appletParams
47
- return isParamsRecord(params) ? params : {}
48
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moi-computer",
3
- "version": "0.11.0",
3
+ "version": "0.11.1-dev.be1ed10",
4
4
  "description": "Local AI workspace powered by the Claude Agent SDK, Bun, React, and Tailwind. Requires Bun.",
5
5
  "license": "Elastic-2.0",
6
6
  "type": "module",
@@ -33,6 +33,8 @@
33
33
  "client",
34
34
  "lib",
35
35
  "workspace",
36
+ "registry.json",
37
+ "ui-components",
36
38
  "bunfig.toml",
37
39
  "tsconfig.json",
38
40
  "dist",
@@ -50,74 +52,82 @@
50
52
  "prepack": "bun scripts/build-client.ts",
51
53
  "lint": "oxlint",
52
54
  "lint:fix": "oxlint --fix",
53
- "typecheck:client": "tsc -p tsconfig.client.json",
55
+ "registry:validate": "shadcn registry validate",
56
+ "typecheck": "tsc -p tsconfig.json",
54
57
  "format": "oxfmt",
55
58
  "format:check": "oxfmt --check",
56
59
  "prepare": "git config core.hooksPath .githooks"
57
60
  },
58
61
  "dependencies": {
59
- "@anthropic-ai/claude-agent-sdk": "^0.3.197",
62
+ "@anthropic-ai/claude-agent-sdk": "^0.3.263",
60
63
  "@anthropic-ai/sdk": "^0.109.1",
61
64
  "@babel/parser": "^7.29.8",
62
- "@base-ui/react": "^1.2.0",
63
- "@blobatar/react": "^2.2.0",
65
+ "@base-ui/react": "^1.8.0",
66
+ "@blobatar/react": "^2.7.0",
64
67
  "@dnd-kit/core": "^6.3.1",
65
- "@tabler/icons-react": "^3.44.0",
66
- "@tailwindcss/typography": "^0.5.19",
67
- "@tanstack/react-query": "^5.100.1",
68
+ "@tabler/icons-react": "^3.46.0",
69
+ "@tailwindcss/typography": "^0.5.20",
70
+ "@tanstack/react-query": "^5.102.8",
71
+ "@tldraw/store": "5.2.3",
72
+ "@tldraw/tlschema": "5.2.3",
73
+ "@tldraw/utils": "5.2.3",
74
+ "@types/bun": "1.3.10",
68
75
  "agentation": "^2.3.3",
69
- "blobatar": "^2.2.0",
76
+ "blobatar": "^2.7.0",
70
77
  "bun-plugin-tailwind": "^0.1.2",
71
- "citty": "^0.2.1",
78
+ "citty": "^0.2.2",
72
79
  "class-variance-authority": "^0.7.1",
73
80
  "clsx": "^2.1.1",
74
81
  "conf": "^15.1.0",
75
82
  "culori": "^4.0.2",
76
- "devalue": "^5.6.4",
83
+ "devalue": "^5.9.2",
77
84
  "env-paths": "^4.0.0",
78
85
  "frimousse": "^0.3.0",
79
86
  "highlight.js": "^10.7.3",
80
- "hono": "^4.12.26",
81
- "lru-cache": "^11.3.5",
87
+ "hono": "^4.13.7",
88
+ "lru-cache": "^11.5.2",
82
89
  "modern-screenshot": "^4.7.0",
83
- "motion": "^12.35.1",
90
+ "motion": "^12.43.0",
84
91
  "nanoevents": "^10.0.0",
85
- "nanoid": "^6.0.0",
92
+ "nanoid": "^6.0.1",
86
93
  "pathe": "^2.0.3",
87
94
  "picocolors": "^1.1.1",
88
- "postcss": "^8.5.19",
89
- "react": "^19",
90
- "react-dom": "^19",
91
- "react-grid-layout": "^2.2.3",
95
+ "postcss": "^8.5.28",
96
+ "react": "19.2.4",
97
+ "react-dom": "19.2.4",
98
+ "react-grid-layout": "^2.2.4",
92
99
  "react-markdown": "^10.1.0",
93
- "react-resizable": "^3.1.3",
94
- "react-resizable-panels": "^4.12.2",
100
+ "react-resizable": "^3.2.0",
101
+ "react-resizable-panels": "^4.12.4",
95
102
  "rehype-highlight": "^7.0.2",
96
103
  "remark-gfm": "^4.0.1",
97
- "shadcn": "4.13.0",
98
- "sharp": "^0.35.1",
104
+ "shadcn": "4.21.0",
105
+ "sharp": "^0.35.4",
99
106
  "shell-quote": "^1.10.0",
100
- "sugar-high": "^1.2.1",
107
+ "sugar-high": "^1.3.0",
101
108
  "tailwind-merge": "^3.6.0",
102
109
  "tailwindcss": "^4.3.3",
103
110
  "tldraw": "5.2.3",
104
111
  "tw-animate-css": "^1.4.0",
105
- "wouter": "^3.9.0",
106
- "zustand": "^5.0.12"
112
+ "typescript": "^5.9.3",
113
+ "wouter": "^3.11.0",
114
+ "zustand": "^5.0.15"
107
115
  },
108
116
  "optionalDependencies": {
109
117
  "openclaw": "2026.7.1"
110
118
  },
111
119
  "devDependencies": {
112
- "@agentclientprotocol/sdk": "^1.3.0",
120
+ "@agentclientprotocol/sdk": "^1.4.0",
113
121
  "@babel/types": "^7.29.8",
114
- "@types/bun": "latest",
115
122
  "@types/culori": "^4.0.1",
116
- "@types/react": "^19",
117
- "@types/react-dom": "^19",
123
+ "@types/react": "^19.2.18",
124
+ "@types/react-dom": "^19.2.7",
118
125
  "@types/react-grid-layout": "^2.1.0",
126
+ "date-fns": "^4.4.0",
127
+ "embla-carousel-react": "^8.6.0",
119
128
  "oxfmt": "^0.54.0",
120
- "oxlint": "^1.69.0",
121
- "typescript": "^5.9.3"
129
+ "oxlint": "^1.82.0",
130
+ "react-day-picker": "^10.0.1",
131
+ "recharts": "3.8.0"
122
132
  }
123
133
  }