moi-computer 0.3.0 → 0.3.1-next.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 (57) hide show
  1. package/client/app/routes/WorkspaceRoute.tsx +3 -1
  2. package/client/components/shared/Composer.tsx +61 -0
  3. package/client/components/ui/dropdown-menu.tsx +3 -3
  4. package/client/features/applets/WidgetErrorBoundary.tsx +19 -3
  5. package/client/features/applets/WidgetShell.tsx +8 -1
  6. package/client/features/applets/applet-log.ts +100 -0
  7. package/client/features/applets/useApplet.ts +21 -7
  8. package/client/features/chat/ChatComposer.tsx +9 -16
  9. package/client/features/chat/ModelPicker.tsx +26 -40
  10. package/client/features/chat/chat-frames.ts +1 -0
  11. package/client/features/chat/model-order.ts +47 -0
  12. package/client/features/chat/useChat.ts +4 -0
  13. package/client/features/home/HomePage.tsx +13 -15
  14. package/client/features/home/WorkspacePreview.tsx +179 -38
  15. package/client/features/settings/GeneralSettings.tsx +12 -0
  16. package/client/features/views/ViewBuilderTab.tsx +10 -15
  17. package/client/features/widgets/WidgetFrame.tsx +3 -0
  18. package/client/features/widgets/WidgetGrid.tsx +1 -0
  19. package/client/features/widgets/Widgets.tsx +12 -3
  20. package/client/features/widgets/api.ts +47 -0
  21. package/client/features/widgets/useWidgetThumbnails.ts +107 -0
  22. package/client/features/widgets/widget-snapshot.ts +71 -0
  23. package/client/features/workspace/WorkspaceScreen.tsx +8 -1
  24. package/client/features/workspace/api.ts +6 -2
  25. package/client/index.css +0 -5
  26. package/client/main.tsx +6 -0
  27. package/dist/{chunk-fjksw6xf.js → chunk-axszxe4c.js} +1 -1
  28. package/dist/chunk-b3ynfk4g.js +62 -0
  29. package/dist/chunk-jen6xcm1.js +14 -0
  30. package/dist/chunk-npwq6jmr.css +1 -0
  31. package/dist/index.html +1 -1
  32. package/lib/types.ts +66 -2
  33. package/package.json +3 -2
  34. package/server/api.ts +87 -3
  35. package/server/applet-log.ts +149 -0
  36. package/server/cli.ts +161 -7
  37. package/server/control.ts +81 -1
  38. package/server/functions.ts +44 -14
  39. package/server/harness/README.md +1 -0
  40. package/server/harness/claude-code/index.ts +3 -1
  41. package/server/harness/claude-code/sessions.ts +51 -0
  42. package/server/harness/codex/adapter.ts +32 -0
  43. package/server/harness/codex/client.ts +36 -1
  44. package/server/harness/codex/index.ts +3 -0
  45. package/server/harness/openclaw/discovery.ts +139 -6
  46. package/server/harness/openclaw/gateway.ts +40 -18
  47. package/server/harness/openclaw/index.ts +4 -1
  48. package/server/harness/types.ts +15 -0
  49. package/server/layout.ts +81 -51
  50. package/server/scratchpad-assets.ts +41 -6
  51. package/server/scratchpad.ts +30 -0
  52. package/server/views.ts +5 -0
  53. package/server/web.ts +6 -0
  54. package/server/widgets.ts +23 -2
  55. package/workspace/.claude/skills/moi-workspace/SKILL.md +24 -0
  56. package/dist/chunk-4z52b2av.css +0 -1
  57. package/dist/chunk-y82s1jxm.js +0 -61
@@ -29,6 +29,7 @@ import { ViewBuilderTab } from '@/client/features/views/ViewBuilderTab'
29
29
  import { useViewBuilderActions } from '@/client/features/views/useViewBuilderActions'
30
30
  import { useFitsSplitLayout } from '@/client/features/workspace/useFitsSplitLayout'
31
31
  import { useWorkspaceTheme } from '@/client/features/workspace/useWorkspaceTheme'
32
+ import { useWorkspaceId } from '@/client/features/workspace/WorkspaceContext'
32
33
  import { useWorkspaceLayoutCtx } from '@/client/features/workspace/WorkspaceLayoutContext'
33
34
  import { resolveAppIcon } from '@/client/lib/app-icon-registry'
34
35
  import { cn } from '@/client/lib/cn'
@@ -100,6 +101,7 @@ type ViewAppProps = {
100
101
  // layout + scroll, so we give it a plain filled box and fade it in (mirroring
101
102
  // WidgetShell, but full-area instead of a grid cell).
102
103
  function ViewApp({ view }: ViewAppProps) {
104
+ const workspaceId = useWorkspaceId()
103
105
  const bundle = useView(view.id)
104
106
 
105
107
  return (
@@ -120,7 +122,12 @@ function ViewApp({ view }: ViewAppProps) {
120
122
  exit={{ opacity: 0, filter: 'blur(4px)' }}
121
123
  transition={{ duration: 0.3, ease: 'easeInOut' }}
122
124
  >
123
- <WidgetErrorBoundary name={view.id} resetKey={bundle.version}>
125
+ <WidgetErrorBoundary
126
+ name={view.id}
127
+ kind="view"
128
+ workspaceId={workspaceId}
129
+ resetKey={bundle.version}
130
+ >
124
131
  <bundle.Component />
125
132
  </WidgetErrorBoundary>
126
133
  </motion.div>
@@ -1,4 +1,4 @@
1
- import { useMutation, useQuery } from '@tanstack/react-query'
1
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
2
2
 
3
3
  import { jsonRequest, requestJson, requestVoid } from '@/client/api/http'
4
4
  import { WORKSPACE_RESOURCE_OPTIONS } from '@/client/api/query-options'
@@ -45,12 +45,16 @@ export function useWorkspaceViews(workspaceId: string) {
45
45
  }
46
46
 
47
47
  export function useSaveLayout(workspaceId: string) {
48
+ const queryClient = useQueryClient()
48
49
  return useMutation<void, Error, WorkspaceLayout>({
49
50
  mutationFn: layout =>
50
51
  requestVoid(
51
52
  `/api/workspaces/${workspaceId}`,
52
53
  jsonRequest('PUT', layout),
53
54
  'Failed to save layout'
54
- )
55
+ ),
56
+ onSuccess: () => {
57
+ queryClient.invalidateQueries({ queryKey: workspaceKeys.preview(workspaceId) })
58
+ }
55
59
  })
56
60
  }
package/client/index.css CHANGED
@@ -83,11 +83,6 @@
83
83
  /* Color/radius/shadow tokens — shared with widget bundles via theme.css */
84
84
  @import './theme.css';
85
85
 
86
- /* Lift all grid items so the placeholder (z-index: 0) stays behind them */
87
- .react-grid-item:not(.react-grid-placeholder) {
88
- z-index: 1;
89
- }
90
-
91
86
  /* Dragged card floats above all others */
92
87
  .react-grid-item.react-draggable-dragging {
93
88
  z-index: 10;
package/client/main.tsx CHANGED
@@ -3,6 +3,7 @@ import { Agentation } from 'agentation'
3
3
  import { createRoot } from 'react-dom/client'
4
4
  import { Router } from 'wouter'
5
5
 
6
+ import { installAppletErrorHook } from '@/client/features/applets/applet-log'
6
7
  import { initConnection } from '@/client/features/chat/chat-connection'
7
8
  import { AppRouter } from './app/AppRouter'
8
9
 
@@ -12,6 +13,11 @@ const queryClient = new QueryClient()
12
13
  // live frames fold into the RQ transcript cache. Lives for the page's lifetime.
13
14
  initConnection(queryClient)
14
15
 
16
+ // Catch applet errors that escape React (handlers, async effects) and journal
17
+ // them for `moi debug logs` — attribution is by bundle URL in the stack, so
18
+ // host-app errors never match (see features/applets/applet-log.ts).
19
+ installAppletErrorHook()
20
+
15
21
  export function mount(el: HTMLElement) {
16
22
  function Root() {
17
23
  return (
@@ -1 +1 @@
1
- import{Hc as a}from"/chunk-vkvb3hjm.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:t}=await import("/chunk-y82s1jxm.js");t(r)}globalThis.__init=e;
1
+ import{Hc as a}from"/chunk-vkvb3hjm.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:t}=await import("/chunk-b3ynfk4g.js");t(r)}globalThis.__init=e;