moi-computer 0.11.1-next.4 → 0.12.0

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 (131) hide show
  1. package/client/api/app-config.ts +7 -4
  2. package/client/app/AppRouter.tsx +2 -2
  3. package/client/app/routes/WorkspaceRoute.tsx +27 -19
  4. package/client/features/applets/{AppletMount.tsx → AppletContainer.tsx} +7 -5
  5. package/client/features/applets/WidgetShell.tsx +3 -3
  6. package/client/features/applets/applet-cache.ts +3 -5
  7. package/client/features/applets/applet-runtime.ts +27 -12
  8. package/client/features/applets/applet-thumbnail.ts +2 -1
  9. package/client/features/chat/applet-chat-intents.ts +14 -6
  10. package/client/features/chat/composer/attachments/draft-attachments.ts +21 -4
  11. package/client/features/chat/messages/MarkdownContent.tsx +5 -2
  12. package/client/features/chat/sessions/browser-tab-state.ts +18 -0
  13. package/client/features/chat/sessions/useSelectedSession.ts +55 -21
  14. package/client/features/chat/useChat.ts +4 -0
  15. package/client/features/collab/applet-api.ts +34 -0
  16. package/client/features/collab/client.ts +239 -0
  17. package/client/features/collab/components/cursors.tsx +199 -0
  18. package/client/features/collab/components/presence-avatars.tsx +61 -0
  19. package/client/features/collab/components/presence-frame.tsx +126 -0
  20. package/client/features/collab/components/presence-group.tsx +23 -0
  21. package/client/features/collab/components/presence-helpers.ts +50 -0
  22. package/client/features/collab/components/user-avatar-group.tsx +22 -0
  23. package/client/features/collab/components/user-avatar.tsx +40 -0
  24. package/client/features/collab/components/user.tsx +50 -0
  25. package/client/features/collab/hooks.tsx +164 -0
  26. package/client/features/collab/host-state.ts +254 -0
  27. package/client/features/collab/index.ts +5 -0
  28. package/client/features/collab/local-user.ts +46 -0
  29. package/client/features/collab/presence-publisher.ts +30 -0
  30. package/client/features/collab/presence-target.ts +8 -0
  31. package/client/features/collab/provider.tsx +79 -0
  32. package/client/features/collab/proxy-user.ts +35 -0
  33. package/client/features/collab/store.ts +156 -0
  34. package/client/features/collab/testing/component-fixtures.tsx +54 -0
  35. package/client/features/collab/testing/fake-engine.ts +129 -0
  36. package/client/features/collab/users.ts +106 -0
  37. package/client/features/collab/workspace-users-menu.tsx +194 -0
  38. package/client/features/connectors/mcp-icons.ts +0 -2
  39. package/client/features/dev/DevIndexPage.tsx +5 -0
  40. package/client/features/dev/DevRoutes.tsx +16 -4
  41. package/client/features/dev/collab/collab-page.tsx +24 -0
  42. package/client/features/dev/collab/collab-playground.tsx +614 -0
  43. package/client/features/dev/collab/local-user-settings.tsx +166 -0
  44. package/client/features/dev/collab/playground-room.ts +33 -0
  45. package/client/features/dev/{UiComponentsPage.tsx → ui-components/ui-components-page.tsx} +1 -1
  46. package/client/features/overview/WidgetCanvas.tsx +3 -1
  47. package/client/features/views/ViewManager.tsx +12 -7
  48. package/client/features/views/api.ts +2 -2
  49. package/client/features/views/useViewBuilderActions.ts +3 -0
  50. package/client/features/workspace/WorkspaceContext.tsx +1 -1
  51. package/client/features/workspace/WorkspaceLayoutContext.tsx +8 -2
  52. package/client/features/workspace/WorkspaceScreen.tsx +19 -11
  53. package/client/features/workspace/WorkspaceTabs.tsx +3 -3
  54. package/client/features/workspace/api.ts +2 -1
  55. package/client/features/workspace/browser-tab-state.ts +44 -0
  56. package/client/features/workspace/layout-save.ts +13 -0
  57. package/client/features/workspace/moi-context.ts +2 -1
  58. package/client/features/workspace/useWorkspaceNavigation.ts +20 -8
  59. package/client/index.css +45 -0
  60. package/client/index.tsx +9 -4
  61. package/client/main.tsx +1 -11
  62. package/client/theme.css +4 -1
  63. package/dist/chunk-2jncyq65.js +1 -0
  64. package/dist/{chunk-brr0zbeh.js → chunk-3a48fyf7.js} +2 -2
  65. package/dist/{chunk-tzz101ea.js → chunk-97eg9mjn.js} +1 -1
  66. package/dist/chunk-e2q5ken7.js +68 -0
  67. package/dist/{chunk-zs4mte79.js → chunk-efdyz6xp.js} +1 -1
  68. package/dist/chunk-h2kj1ysj.js +1 -0
  69. package/dist/chunk-jf6czgrz.js +2 -0
  70. package/dist/chunk-nez8sdta.js +1 -0
  71. package/dist/chunk-nzwgm8vc.css +1 -0
  72. package/dist/chunk-ph0h6h86.js +1 -0
  73. package/dist/chunk-ryg9z3kn.js +10 -0
  74. package/dist/chunk-tpn177bt.js +2 -0
  75. package/dist/chunk-vfpsc75k.js +2 -0
  76. package/dist/{chunk-m1fvqssh.js → chunk-z3byfve5.js} +2 -2
  77. package/dist/index.html +1 -1
  78. package/lib/collab/colors.ts +30 -0
  79. package/lib/collab/protocol.ts +84 -0
  80. package/lib/collab/types.ts +52 -0
  81. package/lib/experimental.ts +14 -0
  82. package/lib/moi-context.ts +11 -3
  83. package/lib/navigation.ts +25 -5
  84. package/lib/types.ts +20 -33
  85. package/package.json +2 -2
  86. package/server/AGENTS.md +1 -1
  87. package/server/api.ts +28 -5
  88. package/server/app-config.ts +127 -34
  89. package/server/applet-typecheck.ts +8 -3
  90. package/server/applets/applet-css.ts +1 -1
  91. package/server/applets/build-applet.ts +9 -3
  92. package/server/applets/declarations/base.d.ts +75 -0
  93. package/server/applets/declarations/collab.d.ts +88 -0
  94. package/server/applets/declarations.ts +46 -0
  95. package/server/applets/index.ts +8 -8
  96. package/server/applets/runtime/collab.ts +94 -0
  97. package/server/applets/runtime/moi.ts +12 -19
  98. package/server/applets/runtime/rpc.ts +2 -4
  99. package/server/chat-selection.ts +22 -0
  100. package/server/cli.ts +86 -21
  101. package/server/collab/cloudflare-access.ts +78 -0
  102. package/server/collab/config.ts +18 -0
  103. package/server/collab/manager.ts +407 -0
  104. package/server/collab/service.ts +136 -0
  105. package/server/collab/skill/index.ts +53 -0
  106. package/server/collab/worker-messages.ts +10 -0
  107. package/server/collab/worker.ts +52 -0
  108. package/server/layout.ts +10 -3
  109. package/server/moi-scaffold.ts +55 -84
  110. package/server/preview.ts +1 -1
  111. package/server/skill-update.ts +7 -9
  112. package/server/skills-template.ts +14 -2
  113. package/server/web.ts +65 -17
  114. package/server/workspace-init.ts +6 -3
  115. package/ui-components/avatar.tsx +24 -11
  116. package/ui-components/button.tsx +9 -9
  117. package/ui-components/docs/avatar.md +11 -30
  118. package/workspace/.claude/skills/moi-workspace/SKILL.md +14 -11
  119. package/workspace/.claude/skills/moi-workspace/references/COLLAB.md +262 -0
  120. package/workspace/.claude/skills/moi-workspace/references/INTENTS.md +10 -7
  121. package/client/assets/mcp/agentation.png +0 -0
  122. package/dist/agentation-4s0nn45p.png +0 -0
  123. package/dist/chunk-2gs8jjx4.css +0 -1
  124. package/dist/chunk-7vvg5fyz.js +0 -68
  125. package/dist/chunk-94m3q9ce.js +0 -1
  126. package/dist/chunk-by2wqgak.js +0 -1
  127. package/dist/chunk-p34hvqt3.js +0 -1
  128. package/dist/chunk-p83f0jnj.js +0 -2
  129. package/dist/chunk-xg01f6pn.js +0 -10
  130. /package/client/features/dev/{UiComponentPreviews.tsx → ui-components/ui-component-previews.tsx} +0 -0
  131. /package/server/applets/{runtime/base.ts → api-base.ts} +0 -0
package/client/index.css CHANGED
@@ -180,6 +180,51 @@
180
180
  corner-shape: superellipse(1.2);
181
181
  }
182
182
 
183
+ [data-collab-color] {
184
+ --collab: var(--muted-foreground);
185
+ --collab-foreground: var(--background);
186
+ }
187
+
188
+ [data-collab-color='pink'] {
189
+ --collab: var(--color-pink-500);
190
+ --collab-foreground: white;
191
+ }
192
+
193
+ [data-collab-color='orange'] {
194
+ --collab: var(--color-orange-500);
195
+ --collab-foreground: black;
196
+ }
197
+
198
+ [data-collab-color='amber'] {
199
+ --collab: var(--color-amber-500);
200
+ --collab-foreground: black;
201
+ }
202
+
203
+ [data-collab-color='lime'] {
204
+ --collab: var(--color-lime-500);
205
+ --collab-foreground: black;
206
+ }
207
+
208
+ [data-collab-color='emerald'] {
209
+ --collab: var(--color-emerald-500);
210
+ --collab-foreground: black;
211
+ }
212
+
213
+ [data-collab-color='cyan'] {
214
+ --collab: var(--color-cyan-500);
215
+ --collab-foreground: black;
216
+ }
217
+
218
+ [data-collab-color='blue'] {
219
+ --collab: var(--color-blue-500);
220
+ --collab-foreground: white;
221
+ }
222
+
223
+ [data-collab-color='violet'] {
224
+ --collab: var(--color-violet-500);
225
+ --collab-foreground: white;
226
+ }
227
+
183
228
  .hljs {
184
229
  background: transparent;
185
230
  padding: 0;
package/client/index.tsx CHANGED
@@ -4,6 +4,8 @@ import './structured-clone-shim'
4
4
  import 'blobatar/motion.css'
5
5
  import './index.css'
6
6
 
7
+ import { initializeLocalUser, installHostApi } from './features/collab/host-state'
8
+
7
9
  import { startHmrWatchdog } from './runtime/hmr-watchdog'
8
10
 
9
11
  // React Fast Refresh works here despite React being externalized to the
@@ -22,12 +24,15 @@ if (import.meta.hot) {
22
24
  }
23
25
 
24
26
  export async function init(el: HTMLElement) {
25
- // Startup config loads in parallel with the main chunk, so it is available
26
- // synchronously to every component from the first render.
27
- const [{ mount }] = await Promise.all([
27
+ installHostApi()
28
+ // Startup config and any proxy-verified user load in parallel with the
29
+ // main chunk, so both are available synchronously from the first render.
30
+ const [{ mount }, config, proxyUser] = await Promise.all([
28
31
  import('./main'),
29
- import('./api/app-config').then(m => m.loadAppConfig())
32
+ import('./api/app-config').then(m => m.loadAppConfig()),
33
+ import('./features/collab/proxy-user').then(m => m.loadProxyUser())
30
34
  ])
35
+ initializeLocalUser(config?.experimental.collab === true, proxyUser)
31
36
  mount(el)
32
37
  }
33
38
 
package/client/main.tsx CHANGED
@@ -1,7 +1,6 @@
1
1
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2
- import { Agentation } from 'agentation'
3
2
  import { createRoot } from 'react-dom/client'
4
- import { Router, useRoute } from 'wouter'
3
+ import { Router } from 'wouter'
5
4
 
6
5
  import { Toaster } from '@/client/components/ui/toast'
7
6
  import { TooltipProvider } from '@/client/components/ui/tooltip'
@@ -11,14 +10,6 @@ import { AppRouter } from './app/AppRouter'
11
10
 
12
11
  const queryClient = new QueryClient()
13
12
 
14
- // Agentation has no built-in route filter (checked v2.3.3 props), so gate the
15
- // mount ourselves: the harness debug page is a raw log surface where the
16
- // annotation toolbar just overlaps the panes.
17
- function DevAgentation() {
18
- const [onHarnessDebug] = useRoute('/dev/harness')
19
- return onHarnessDebug ? null : <Agentation />
20
- }
21
-
22
13
  // Open the single app-wide chat WebSocket once and hand it the query client so
23
14
  // live frames fold into the RQ transcript cache. Lives for the page's lifetime.
24
15
  initConnection(queryClient)
@@ -37,7 +28,6 @@ export function mount(el: HTMLElement) {
37
28
  <AppRouter />
38
29
  </Router>
39
30
  <Toaster />
40
- {process.env.NODE_ENV === 'development' && <DevAgentation />}
41
31
  </TooltipProvider>
42
32
  </QueryClientProvider>
43
33
  )
package/client/theme.css CHANGED
@@ -5,7 +5,8 @@
5
5
  *
6
6
  * The actual CSS variables (`--sans`, `--mono`, `--background`, etc.)
7
7
  * are owned by the host and declared on `:root` / `.dark` in
8
- * `client/index.css`. This file only maps Tailwind's `--font-*` /
8
+ * `client/index.css`. Collaboration colors are scoped to `[data-collab-color]`
9
+ * elements. This file only maps Tailwind's `--font-*` /
9
10
  * `--color-*` / `--radius-*` tokens onto those host-owned variables via
10
11
  * `@theme inline`,
11
12
  * which:
@@ -39,6 +40,8 @@
39
40
  --color-border: var(--border);
40
41
  --color-input: var(--input);
41
42
  --color-ring: var(--ring);
43
+ --color-collab: var(--collab);
44
+ --color-collab-foreground: var(--collab-foreground);
42
45
 
43
46
  /* shadcn compatibility: secondary surfaces and chart palettes. */
44
47
  --color-secondary: var(--secondary);
@@ -0,0 +1 @@
1
+ import{Dc as a,Ec as b}from"/chunk-jf6czgrz.js";import"/chunk-vfpsc75k.js";import"/chunk-z3byfve5.js";import"/chunk-97eg9mjn.js";export{b as useAppConfig,a as loadAppConfig};