moi-computer 0.9.1-next.1 → 0.9.1-next.3

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.
package/README.md CHANGED
@@ -77,7 +77,10 @@ Then bring in your project, either way works:
77
77
 
78
78
  - open [http://localhost:13337](http://localhost:13337) and create a workspace
79
79
  (or import one moi found on this computer) right from the web UI;
80
- - or run `moi init` inside a folder to turn it into a workspace.
80
+ - or run `moi init` inside a folder to turn it into a workspace. It picks the
81
+ agent backend up from the folder itself — a Hermes profile, an OpenClaw
82
+ agent, or Codex/Claude Code history — and asks for
83
+ `--harness=claude-code|codex|hermes|openclaw` when it can't tell.
81
84
 
82
85
  ## Run as a service
83
86
 
@@ -11,7 +11,7 @@ const buttonVariants = cva(
11
11
  default:
12
12
  'bg-primary text-primary-foreground inset-shadow-[0_0_8px_color-mix(in_oklab,var(--color-white)_20%,transparent)] hover:bg-primary/90 disabled:bg-accent disabled:text-muted-foreground disabled:opacity-100 disabled:shadow-none',
13
13
  secondary:
14
- 'bg-accent text-foreground hover:bg-[color-mix(var(--accent),var(--foreground)_3%)] hover:text-accent-foreground',
14
+ 'bg-accent text-foreground hover:bg-[color-mix(in_oklch,var(--accent),var(--foreground)_3%)] hover:text-accent-foreground',
15
15
  outline: 'bg-background shadow-xs hover:text-accent-foreground hover:shadow-sm',
16
16
  ghost: 'hover:bg-accent hover:text-accent-foreground',
17
17
  destructive:
@@ -88,30 +88,36 @@ function useFolderRadiusScale() {
88
88
  return { ref, horizontalRadiusScale }
89
89
  }
90
90
 
91
- // Bottom-to-top placement for up to three applet thumbnails. Each card peeks
92
- // out of the folder at a slightly different angle and lifts on card hover.
93
- const STACK = [
94
- cn(
95
- 'opacity-40',
96
- '-translate-x-3 translate-y-3 -rotate-6',
97
- 'group-hover:translate-y-2 group-focus-visible:translate-y-2'
98
- ),
99
- cn(
100
- 'opacity-50',
101
- 'translate-x-3 translate-y-2 rotate-5',
102
- 'group-hover:translate-y-1 group-focus-visible:translate-y-1'
103
- ),
104
- cn(
105
- 'opacity-100',
106
- '-translate-x-1 translate-y-1 -rotate-2',
107
- 'group-hover:-translate-y-2 group-focus-visible:-translate-y-2'
108
- )
109
- ]
91
+ // Bottom-to-top treatment for up to three applet thumbnails. The frame stays
92
+ // opaque while only the image fades.
93
+ const THUMBNAIL_STYLES = [
94
+ {
95
+ frame: cn(
96
+ '-translate-x-3 translate-y-3 -rotate-6',
97
+ 'group-hover:translate-y-2 group-focus-visible:translate-y-2'
98
+ ),
99
+ img: 'opacity-40'
100
+ },
101
+ {
102
+ frame: cn(
103
+ 'translate-x-3 translate-y-2 rotate-5',
104
+ 'group-hover:translate-y-1 group-focus-visible:translate-y-1'
105
+ ),
106
+ img: 'opacity-50'
107
+ },
108
+ {
109
+ frame: cn(
110
+ '-translate-x-1 translate-y-1 -rotate-2',
111
+ 'group-hover:-translate-y-2 group-focus-visible:-translate-y-2'
112
+ ),
113
+ img: 'opacity-100'
114
+ }
115
+ ] as const
110
116
 
111
117
  export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
112
118
  const query = useWorkspacePreview(workspaceId)
113
119
  const thumbnails = query.data ? [...query.data.thumbnails].reverse() : []
114
- const slots = STACK.slice(STACK.length - thumbnails.length)
120
+ const slots = THUMBNAIL_STYLES.slice(THUMBNAIL_STYLES.length - thumbnails.length)
115
121
  const firstUserMessage = query.data?.firstUserMessage
116
122
  const theme = query.data?.theme
117
123
  const { ref, horizontalRadiusScale } = useFolderRadiusScale()
@@ -156,17 +162,24 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
156
162
  </svg>
157
163
 
158
164
  {thumbnails.map((src, index) => (
159
- <img
160
- key={index}
161
- src={src}
162
- alt=""
163
- loading="lazy"
165
+ <div
166
+ key={src}
164
167
  className={cn(
165
- 'absolute top-[12%] left-[14%] h-auto max-h-[72%] w-auto max-w-[72%] rounded-[calc(var(--radius-2xl)*0.4)] bg-background object-contain shadow-xs [corner-shape:superellipse(1.2)]',
166
- 'animate-in transition-transform duration-300 ease-out fade-in',
167
- slots[index]
168
+ 'absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs [corner-shape:superellipse(1.2)]',
169
+ 'animate-in duration-300 ease-out fade-in',
170
+ slots[index].frame
168
171
  )}
169
- />
172
+ >
173
+ <img
174
+ src={src}
175
+ alt=""
176
+ loading="lazy"
177
+ className={cn(
178
+ 'block h-auto max-h-32 w-auto max-w-full object-contain',
179
+ slots[index].img
180
+ )}
181
+ />
182
+ </div>
170
183
  ))}
171
184
 
172
185
  {thumbnails.length === 0 && firstUserMessage && (
@@ -177,7 +190,7 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
177
190
  className={cn(
178
191
  'w-max max-w-40 origin-center rounded-lg bg-card px-3 py-2 font-sans shadow-xs',
179
192
  'animate-in transition-transform duration-300 ease-out fade-in',
180
- STACK[STACK.length - 1],
193
+ '-translate-x-1 translate-y-1 -rotate-2',
181
194
  'group-hover:translate-y-0.5 group-focus-visible:translate-y-0.5'
182
195
  )}
183
196
  >
@@ -94,6 +94,10 @@ export function usePreloadWorkspaceFonts() {
94
94
  const link = document.createElement('link')
95
95
  link.id = FONT_PREVIEW_LINK_ID
96
96
  link.rel = 'stylesheet'
97
+ // CORS mode makes the sheet's cssRules readable, so thumbnail capture
98
+ // (modern-screenshot) can inline the @font-face rules into its SVG —
99
+ // an SVG rasterized in <img> can't use the page's webfonts otherwise.
100
+ link.crossOrigin = 'anonymous'
97
101
  link.href = `https://fonts.googleapis.com/css2?family=${ALL_FONTS_QUERY}&display=swap`
98
102
  document.head.appendChild(link)
99
103
 
@@ -145,6 +149,9 @@ export function useWorkspaceTheme(theme: WorkspaceLayout['theme']) {
145
149
  const link = document.createElement('link')
146
150
  link.id = FONT_LINK_ID
147
151
  link.rel = 'stylesheet'
152
+ // Same CORS requirement as the preview link above: thumbnail capture
153
+ // can only embed @font-face rules from origin-clean stylesheets.
154
+ link.crossOrigin = 'anonymous'
148
155
  link.href = url
149
156
  document.head.appendChild(link)
150
157
  }
@@ -1 +1 @@
1
- import{Vc as r}from"/chunk-zbeq02yc.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function o(a){let[{mount:t}]=await Promise.all([import("/chunk-cva7jpt4.js"),import("/chunk-cagtq45k.js").then((e)=>e.loadAppConfig())]);t(a)}globalThis.__init=o;
1
+ import{Vc as r}from"/chunk-zbeq02yc.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function o(a){let[{mount:t}]=await Promise.all([import("/chunk-n8tq2494.js"),import("/chunk-cagtq45k.js").then((e)=>e.loadAppConfig())]);t(a)}globalThis.__init=o;