moi-computer 0.6.1-next.0 → 0.8.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.
- package/README.md +2 -2
- package/client/components/shared/BottomPanel.tsx +2 -1
- package/client/components/shared/PanelHeader.tsx +1 -1
- package/client/features/applets/AppletMount.tsx +9 -22
- package/client/features/applets/applet-cache.ts +7 -0
- package/client/features/applets/applet-styles.ts +21 -1
- package/client/features/applets/useApplet.ts +1 -1
- package/client/features/chat/ChatComposer.tsx +18 -4
- package/client/features/chat/ChatSelector.tsx +1 -1
- package/client/features/chat/TurnView.tsx +1 -1
- package/client/features/home/api.ts +0 -10
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +21 -64
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +1 -1
- package/client/features/scratchpad/Scratchpad.tsx +1 -3
- package/client/features/views/ViewManager.tsx +258 -0
- package/client/features/views/view-residency.ts +77 -0
- package/client/features/widgets/WidgetFrame.tsx +6 -2
- package/client/features/workspace/CustomizePanel.tsx +40 -24
- package/client/features/workspace/WorkspaceLayoutContext.tsx +8 -0
- package/client/features/workspace/WorkspaceScreen.tsx +51 -103
- package/client/features/workspace/WorkspaceTabs.tsx +1 -1
- package/client/index.css +4 -1
- package/client/runtime/workspace-theme.ts +29 -10
- package/client/theme.css +96 -6
- package/dist/chunk-0k7brsms.js +9 -0
- package/dist/{chunk-m11ckkxd.js → chunk-dtwxpxbg.js} +1 -1
- package/dist/{chunk-55sh4dty.js → chunk-ga7t9qsk.js} +1 -1
- package/dist/{chunk-w3tnv51j.js → chunk-h9h8f176.js} +1 -1
- package/dist/{chunk-rxvx4ta9.js → chunk-r5ce5cdg.js} +2 -2
- package/dist/chunk-tey2nq7c.js +31 -0
- package/dist/{chunk-afgbg75t.js → chunk-z73xpsa0.js} +1 -1
- package/dist/chunk-zzgredta.css +1 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +18 -4
- package/lib/system-messages.ts +241 -0
- package/lib/themes.ts +123 -51
- package/lib/types.ts +2 -5
- package/package.json +5 -4
- package/server/api.ts +2 -73
- package/server/bundler/build-applet.ts +7 -4
- package/server/cli.ts +46 -15
- package/server/control.ts +13 -6
- package/server/harness/README.md +11 -0
- package/server/harness/claude-code/NOTES.md +22 -7
- package/server/harness/claude-code/adapter.ts +39 -5
- package/server/moi-scaffold.ts +1 -1
- package/server/registry.ts +0 -20
- package/server/scratchpad-executor.ts +23 -1
- package/server/theme.ts +24 -27
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +94 -57
- package/workspace/.claude/skills/moi-workspace/SKILL.md +10 -12
- package/dist/chunk-175bm057.js +0 -27
- package/dist/chunk-agtetn7n.css +0 -1
- package/dist/chunk-exj6hr30.js +0 -9
|
@@ -29,57 +29,97 @@ spacing, or interaction patterns. They do not need to look identical.
|
|
|
29
29
|
|
|
30
30
|
## Color
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Widgets and views use the same semantic token vocabulary. Use
|
|
33
|
+
`h-full w-full bg-background text-foreground` for most applet roots. Each token keeps the same
|
|
34
|
+
purpose in both applet types; the host changes its value to suit the surrounding surface.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
use dark-mode values regardless of the workspace color preset. The host frame stays transparent, so
|
|
36
|
-
every widget root must cover the full frame with an opaque background.
|
|
36
|
+
### How tokens resolve
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
- **Widgets:** The host applies a widget-local semantic theme derived from the selected workspace
|
|
39
|
+
color. `background` is the workspace `primary`, `foreground` is its paired readable color, and
|
|
40
|
+
the local `primary` pair becomes the light action surface derived from that color. The host frame
|
|
41
|
+
stays transparent, so every widget root must cover the full frame with an opaque background. An
|
|
42
|
+
image or visualization may own the surface when it has an opaque fallback.
|
|
43
|
+
- **Views:** Semantic tokens inherit the workspace page theme. The default root uses the normal
|
|
44
|
+
workspace page surface and text.
|
|
45
|
+
- **Portalled UI:** Menus, tooltips, and popovers render in workspace scope and keep
|
|
46
|
+
`bg-popover text-popover-foreground`.
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
fits. In the widget scope, it resolves to a dark background with light text.
|
|
45
|
-
|
|
46
|
-
### View surfaces
|
|
47
|
-
|
|
48
|
-
Views are separate pages. Their semantic tokens inherit the workspace theme, so
|
|
49
|
-
`h-full w-full bg-background text-foreground` is a sensible default root.
|
|
48
|
+
### Semantic token reference
|
|
50
49
|
|
|
51
50
|
| Context or intent | Tailwind classes | Use |
|
|
52
51
|
| --- | --- | --- |
|
|
53
|
-
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
| Inset surface | `bg-card text-card-foreground` | A real contained object or raised region inside the applet |
|
|
52
|
+
| Applet root | `bg-background text-foreground` | The full widget surface or view page |
|
|
53
|
+
| Main content | `text-foreground` | Titles, labels, values, and important icons |
|
|
54
|
+
| Supporting content | `text-muted-foreground` | Descriptions and secondary information |
|
|
55
|
+
| Inset surface | `bg-card text-card-foreground` | A functionally distinct contained region, used sparingly |
|
|
58
56
|
| Floating surface | `bg-popover text-popover-foreground` | Menus, tooltips, and other floating content |
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
57
|
+
| Quiet fill | `bg-muted` | Inset regions, skeletons, and disabled structure |
|
|
58
|
+
| Control state | `bg-accent text-accent-foreground` | Hover, active, and selected controls |
|
|
59
|
+
| Main action | `bg-primary text-primary-foreground hover:bg-primary/90` | The most important action in a local region |
|
|
60
|
+
| Positive or active state | `text-success` / `bg-success/10` | Positive outcomes, healthy states, presence, and progress indicators |
|
|
61
|
+
| Error or danger | `text-destructive` / `bg-destructive/10` | Errors, destructive actions, and invalid states |
|
|
62
|
+
| Object edge | `ring-1 ring-border` | Complete outlines around containers and controls |
|
|
63
|
+
| Focus | `focus-visible:ring-2 focus-visible:ring-ring` | Visible keyboard focus on interactive elements |
|
|
64
|
+
| Separator | `border-b border-border` | A one-sided division between adjacent regions |
|
|
64
65
|
|
|
65
66
|
Use lower opacity from the surface's foreground only for tertiary metadata that remains readable.
|
|
66
|
-
Avoid weak alpha text for important labels or values.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
Avoid weak alpha text for important labels or values.
|
|
68
|
+
|
|
69
|
+
Prefer a subtle ring for the complete outline of a container or control. Use `ring-1 ring-border` on
|
|
70
|
+
semantic surfaces. Reserve one-sided borders such as `border-b` for separators between adjacent
|
|
71
|
+
regions. Never use a border and a ring on the same element. Avoid raw high-contrast colors for
|
|
72
|
+
either treatment.
|
|
73
|
+
|
|
74
|
+
Derive extra neutral or tonal colors and custom gradients from the local semantic tokens with
|
|
75
|
+
`color-mix()`. Use Tailwind palette colors only when they have clear content meaning, distinguish
|
|
76
|
+
infographic data, or follow an explicit user request. Keep each mapping consistent and explain it
|
|
77
|
+
with labels, legends, shapes, or direct values. Do not use palette colors for generic decoration or
|
|
78
|
+
unrelated widget backgrounds. Purple, violet, and fuchsia need a content, brand, or user reason;
|
|
79
|
+
never use a purple gradient as a default creativity or technology cue. On a saturated surface,
|
|
80
|
+
choose an explicit light or dark foreground with strong contrast.
|
|
81
|
+
|
|
82
|
+
### Surfaces and grouping
|
|
83
|
+
|
|
84
|
+
Use an open layout by default. Group content with spacing, alignment, type hierarchy, and, when
|
|
85
|
+
needed, a one-sided separator. Add one surface around content that shares a functional boundary: an
|
|
86
|
+
interactive object, an independently scrolling region, a distinct state, or a self-contained work
|
|
87
|
+
region. Page headers, tab rows, summaries, metrics, and ordinary sections stay unboxed by default.
|
|
88
|
+
Standard controls keep their normal component surfaces.
|
|
89
|
+
|
|
90
|
+
Never use a large rounded surface as a second page frame around the header, navigation, summary,
|
|
91
|
+
primary content, and supporting sections. Avoid adjacent or nested cards and wrappers that only
|
|
92
|
+
repeat the page structure.
|
|
93
|
+
|
|
94
|
+
Align page-level content to shared edges or grid columns. Apply outer padding once on the root or
|
|
95
|
+
layout grid, then use gaps to group unboxed content. When removing a surface, remove its card-like
|
|
96
|
+
padding and radius and realign its children; do not leave spacing that implies an invisible card.
|
|
97
|
+
|
|
98
|
+
### Textures
|
|
99
|
+
|
|
100
|
+
Use one texture on every widget or view root and no more than one per applet. Pair it with an opaque
|
|
101
|
+
semantic base, such as `h-full w-full bg-background text-foreground texture-checker`. The same
|
|
102
|
+
classes resolve through the widget-local theme or view page theme. Skip it only when an opaque
|
|
103
|
+
full-bleed image, map, canvas, or visualization owns the background, the user explicitly asks for a
|
|
104
|
+
plain surface, or preserving readability would require several extra solid wrappers.
|
|
105
|
+
|
|
106
|
+
| Texture | Tailwind class | Character |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| Checker | `texture-checker` | Two softly tinted semantic squares with no empty cells |
|
|
109
|
+
| Grid | `texture-grid` | Fine semantic graph-paper lines over the base color |
|
|
110
|
+
| Noise | `texture-noise` | Foreground-tinted fractal grain that lets the base tint show through |
|
|
111
|
+
| Linear gradient | `texture-gradient-linear` | A restrained top-to-bottom wash derived from `primary` |
|
|
112
|
+
| Inset shadow | `texture-inset-shadow` | A soft edge glow derived from `primary` |
|
|
113
|
+
|
|
114
|
+
Textures add an effect without setting `background-color`; the base color remains visible through
|
|
115
|
+
them. Open content may sit directly on the textured root when contrast stays clear. Add an opaque
|
|
116
|
+
semantic surface above it only when that surface has a functional reason described under Surfaces
|
|
117
|
+
and grouping. Do not apply a texture to a card, panel, control, or text region, and do not stack
|
|
118
|
+
textures or add tuning variables.
|
|
119
|
+
|
|
120
|
+
Check nearby widgets and views before choosing one. Give unrelated applets different textures so
|
|
121
|
+
they remain distinct at a glance. A widget that opens, summarizes, or represents a view shares that
|
|
122
|
+
view's texture as part of the same visual language.
|
|
83
123
|
|
|
84
124
|
## Typography and hierarchy
|
|
85
125
|
|
|
@@ -154,6 +194,8 @@ Data-driven applets need the following when applicable:
|
|
|
154
194
|
|
|
155
195
|
Keep state layouts stable so loading, success, empty, and error do not cause avoidable jumps. Errors
|
|
156
196
|
and empty states should still fit the configured widget height or the view's normal content frame.
|
|
197
|
+
When a primary region uses a surface, loading, populated, empty, success, and error states keep that
|
|
198
|
+
surface in the same position and size.
|
|
157
199
|
|
|
158
200
|
## Widgets
|
|
159
201
|
|
|
@@ -234,21 +276,16 @@ stretching a widget-like card to fill the page.
|
|
|
234
276
|
|
|
235
277
|
## Final review
|
|
236
278
|
|
|
237
|
-
After implementation, do a removal pass from top to bottom. For every
|
|
238
|
-
|
|
239
|
-
|
|
279
|
+
After implementation, do a removal pass from top to bottom. For every visible element and wrapper,
|
|
280
|
+
ask what it helps the user understand, do, or recognize as a state. Remove it when the screen stays
|
|
281
|
+
clear without it, then realign the remaining content.
|
|
240
282
|
|
|
241
283
|
Before finishing an applet, confirm:
|
|
242
284
|
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
- Custom container outlines suit their surface and stay subtle.
|
|
251
|
-
- The layout handles realistic content and deliberate overflow.
|
|
252
|
-
- Every control is necessary, complete, and accessible.
|
|
253
|
-
- The widget or view follows its frame, sizing, and scrolling rules.
|
|
254
|
-
- It feels related to the workspace without copying the quieter host shell.
|
|
285
|
+
- The first reading and every visible element have a clear purpose.
|
|
286
|
+
- Color, texture, type, spacing, and expression support the content and remain readable.
|
|
287
|
+
- Surfaces mark real boundaries, and unboxed page content shares clear alignment axes.
|
|
288
|
+
- States remain stable, and the layout handles realistic content and deliberate overflow.
|
|
289
|
+
- Controls are necessary, complete, and accessible.
|
|
290
|
+
- The widget or view follows its frame, sizing, and scrolling rules and feels related to the
|
|
291
|
+
workspace.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: moi-workspace
|
|
3
|
-
description:
|
|
4
|
-
The moi workspace — the web UI the user chats from, extended with agent-authored applets
|
|
5
|
-
(widgets, views) plus theme & config. Read this FIRST in two cases. (a) A message carries a hidden
|
|
6
|
-
moi-context envelope: it was fired from a moi workspace, so you are running inside one even if
|
|
7
|
-
nothing else says so. (b) The user uses moi vocab — workspace, applet, widget, view, scratchpad,
|
|
8
|
-
dashboard, or a `moi` command — or asks to build, edit, customize, or theme the workspace UI or
|
|
9
|
-
its layout.
|
|
3
|
+
description: The moi workspace — the web UI the user chats from, extended with agent-authored applets (widgets, views) plus theme & config. Read this FIRST when a message carries a hidden moi-context envelope or the user uses moi vocab such as workspace, applet, widget, view, scratchpad, dashboard, or a `moi` command, or asks to build, edit, customize, or theme the workspace UI or its layout.
|
|
10
4
|
---
|
|
11
5
|
|
|
12
6
|
# Workspace
|
|
@@ -127,6 +121,7 @@ never from inside `.moi/` itself. You don't pass paths; moi resolves the workspa
|
|
|
127
121
|
- `moi debug logs` — applet runtime errors on record (experimental)
|
|
128
122
|
- `moi theme --font=<key>` — change font theme (omit `--font` to list options)
|
|
129
123
|
- `moi theme --color=<key>` — change color preset (omit `--color` to list options)
|
|
124
|
+
- `moi theme --radius=<key>` — change corner-radius preset (omit `--radius` to list options)
|
|
130
125
|
- `moi config` — set the workspace name & icon (`moi config --help` for usage)
|
|
131
126
|
- `moi env` — list available env keys and where they come from (never values);
|
|
132
127
|
`moi env exec -- <cmd>` runs a command with the workspace env (see Environment & secrets)
|
|
@@ -336,9 +331,12 @@ Render **content only**: a plain `h-full w-full` region with no card chrome (`ro
|
|
|
336
331
|
own the fill, so the widget must set its own opaque background.
|
|
337
332
|
Changing `colSpan`/`rowSpan` needs `moi bundle --force`. See `DESIGN.md`.
|
|
338
333
|
|
|
339
|
-
Typical loop: check/`bun install` deps → write
|
|
340
|
-
|
|
341
|
-
|
|
334
|
+
Typical loop: check/`bun install` deps → write the applet → `moi bundle` → run any checks.
|
|
335
|
+
After the final successful bundle and any checks, always make tab focus the final workspace action:
|
|
336
|
+
|
|
337
|
+
- After building or editing a widget, run `moi tab focus widgets`.
|
|
338
|
+
- After building or editing a view, run `moi tab focus view:<view-id>`, using its file name or claimed
|
|
339
|
+
builder id.
|
|
342
340
|
|
|
343
341
|
# Debugging applets
|
|
344
342
|
|
|
@@ -381,7 +379,7 @@ moi builder set <view-id> --builder <builder-id> --kind view --title "<title>" -
|
|
|
381
379
|
Choose the icon id from the available view icons in the hidden context. The id must use lowercase
|
|
382
380
|
letters, numbers, `_`, or `-`. The first call locks the id; running the same command again may update
|
|
383
381
|
its title and icon. After claiming, write `.moi/views/<view-id>.tsx`, use the same icon id in its
|
|
384
|
-
config, and
|
|
382
|
+
config, and build it with `moi bundle --only views`. The tab uses the claimed title and icon while you
|
|
385
383
|
work and changes into the built view after a successful bundle. (Bundling marks the view ready; the
|
|
386
384
|
build state is otherwise server-managed, so you never set it to done by hand.)
|
|
387
385
|
|
|
@@ -408,4 +406,4 @@ This skill is installed with moi (via the CLI or the UI) and can fall behind whe
|
|
|
408
406
|
- **Then** — if you updated, mention it.
|
|
409
407
|
|
|
410
408
|
<!-- moi skill version marker — read by `moi skill` to detect drift; do not edit by hand -->
|
|
411
|
-
<moi-skill version="0.
|
|
409
|
+
<moi-skill version="0.11.0" />
|