moi-computer 0.11.0 → 0.11.1-next.1
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/client/AGENTS.md +2 -2
- package/client/components/ui/button.tsx +1 -53
- package/client/components/ui/collapsible.tsx +1 -15
- package/client/components/ui/dialog.tsx +1 -58
- package/client/components/ui/dropdown-menu.tsx +1 -254
- package/client/components/ui/hover-card.tsx +1 -44
- package/client/components/ui/input.tsx +1 -21
- package/client/components/ui/popover.tsx +1 -88
- package/client/components/ui/resizable.tsx +1 -40
- package/client/components/ui/skeleton.tsx +1 -13
- package/client/components/ui/slider.tsx +1 -70
- package/client/components/ui/spinner.tsx +1 -18
- package/client/components/ui/switch.tsx +1 -23
- package/client/components/ui/tabs.tsx +1 -0
- package/client/components/ui/textarea.tsx +1 -18
- package/client/components/ui/tooltip.tsx +1 -51
- package/client/features/chat/ChatPanel.tsx +6 -6
- package/client/features/chat/ChatPopup.tsx +3 -4
- package/client/features/chat/TurnView.tsx +5 -4
- package/client/features/chat/api.ts +5 -14
- package/client/features/chat/chat-frames.ts +5 -2
- package/client/features/chat/composer/ChatComposer.tsx +5 -1
- package/client/features/chat/composer/ModelPicker.tsx +4 -3
- package/client/features/chat/composer/banners/ErrorBanner.tsx +20 -12
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +15 -7
- package/client/features/chat/group-turns.ts +11 -0
- package/client/features/chat/session-view.ts +53 -0
- package/client/features/chat/useChat.ts +5 -1
- package/client/features/dev/ChatStatesPage.tsx +3 -1
- package/client/features/dev/DevIndexPage.tsx +5 -0
- package/client/features/dev/DevRoutes.tsx +2 -0
- package/client/features/dev/HarnessDebugPage.tsx +1 -1
- package/client/features/dev/UiComponentPreviews.tsx +834 -0
- package/client/features/dev/UiComponentsPage.tsx +60 -0
- package/client/features/home/WorkspacePreview.tsx +1 -1
- package/client/features/home/workspace-setup/DemoDialog.tsx +3 -2
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +5 -8
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +7 -20
- package/client/features/settings/SettingsLayout.tsx +1 -1
- package/client/features/settings/WorkspaceSettings.tsx +4 -1
- package/client/features/views/ViewManager.tsx +14 -9
- package/client/features/widgets/WidgetFrame.tsx +1 -1
- package/client/features/widgets/Widgets.tsx +1 -3
- package/client/features/workspace/WorkspaceScreen.tsx +5 -1
- package/client/features/workspace/WorkspaceSplitLayout.tsx +6 -1
- package/client/features/workspace/api.ts +2 -4
- package/client/index.css +22 -29
- package/dist/{chunk-tny85yt2.js → chunk-4s15axjs.js} +2 -2
- package/dist/{chunk-c9pjqx9m.js → chunk-53a7pxcz.js} +1 -1
- package/dist/chunk-6664vxpk.css +1 -0
- package/dist/{chunk-104m57qw.js → chunk-87thzbtw.js} +2 -2
- package/dist/chunk-a6jad1a6.js +1 -0
- package/dist/chunk-dghwstd2.js +9 -0
- package/dist/chunk-eg120aca.js +1 -0
- package/dist/{chunk-v7wr1df4.js → chunk-j3wvxjr7.js} +1 -1
- package/dist/chunk-vwjeezeb.js +1 -0
- package/dist/chunk-w482ew2c.js +546 -0
- package/dist/chunk-yc471zah.js +70 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +49 -1
- package/lib/themes.ts +6 -6
- package/lib/types.ts +5 -7
- package/package.json +17 -7
- package/registry.json +643 -0
- package/server/AGENTS.md +1 -0
- package/server/agent.ts +1 -1
- package/server/api.ts +25 -29
- package/server/applets.ts +30 -29
- package/server/bundler/applet-css.ts +6 -1
- package/server/bundler/build-applet.ts +5 -1
- package/server/bundler/build-worker.ts +178 -0
- package/server/cli-ui-components.ts +28 -33
- package/server/cli.ts +6 -11
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +13 -9
- package/server/harness/acp/NOTES.md +426 -0
- package/server/harness/acp/discovery.ts +27 -30
- package/server/harness/acp/model-state.ts +57 -0
- package/server/harness/acp/session.ts +18 -6
- package/server/harness/claude-code/NOTES.md +47 -12
- package/server/harness/claude-code/cli.ts +40 -0
- package/server/harness/claude-code/index.ts +11 -5
- package/server/harness/claude-code/models.ts +72 -19
- package/server/harness/claude-code/session.ts +408 -299
- package/server/harness/hermes/NOTES.md +18 -0
- package/server/harness/hermes/discovery.ts +20 -0
- package/server/harness/hermes/index.ts +9 -0
- package/server/harness/hermes/models.ts +28 -8
- package/server/harness/types.ts +4 -2
- package/server/moi-scaffold.ts +1 -1
- package/server/preview.ts +3 -1
- package/server/registry.ts +63 -41
- package/server/scratchpad-executor.ts +79 -56
- package/server/scratchpad-shape-defaults.ts +82 -0
- package/server/tldraw-package.d.ts +4 -0
- package/server/ui-components.ts +101 -434
- package/server/view-builders.ts +2 -1
- package/server/web.ts +9 -5
- package/server/workspace-env.ts +3 -2
- package/tsconfig.json +0 -1
- package/ui-components/accordion.tsx +71 -0
- package/ui-components/alert-dialog.tsx +165 -0
- package/ui-components/alert.tsx +68 -0
- package/ui-components/attachment.tsx +195 -0
- package/ui-components/avatar.tsx +90 -0
- package/ui-components/badge.tsx +49 -0
- package/ui-components/button-group.tsx +78 -0
- package/ui-components/button.tsx +55 -0
- package/ui-components/calendar.tsx +180 -0
- package/ui-components/card.tsx +84 -0
- package/ui-components/carousel.tsx +235 -0
- package/ui-components/chart.tsx +338 -0
- package/ui-components/checkbox.tsx +27 -0
- package/ui-components/collapsible.tsx +15 -0
- package/ui-components/combobox.tsx +265 -0
- package/ui-components/context-menu.tsx +244 -0
- package/ui-components/dialog.tsx +138 -0
- package/ui-components/docs/accordion.md +463 -0
- package/ui-components/docs/alert-dialog.md +481 -0
- package/ui-components/docs/alert.md +301 -0
- package/ui-components/docs/attachment.md +689 -0
- package/ui-components/docs/avatar.md +495 -0
- package/ui-components/docs/badge.md +258 -0
- package/ui-components/docs/button-group.md +879 -0
- package/ui-components/docs/button.md +26 -0
- package/ui-components/docs/calendar.md +862 -0
- package/ui-components/docs/card.md +265 -0
- package/ui-components/docs/carousel.md +627 -0
- package/ui-components/docs/chart.md +1256 -0
- package/ui-components/docs/checkbox.md +477 -0
- package/ui-components/docs/collapsible.md +446 -0
- package/ui-components/docs/combobox.md +1003 -0
- package/ui-components/docs/context-menu.md +860 -0
- package/ui-components/docs/data-table.md +1580 -0
- package/ui-components/docs/date-picker.md +614 -0
- package/ui-components/docs/dialog.md +414 -0
- package/ui-components/docs/drawer.md +51 -0
- package/ui-components/docs/dropdown-menu.md +1000 -0
- package/ui-components/docs/field.md +1192 -0
- package/ui-components/docs/hover-card.md +275 -0
- package/ui-components/docs/input-group.md +866 -0
- package/ui-components/docs/input.md +456 -0
- package/ui-components/docs/label.md +295 -0
- package/ui-components/docs/pagination.md +416 -0
- package/ui-components/docs/popover.md +348 -0
- package/ui-components/docs/progress.md +214 -0
- package/ui-components/docs/radio-group.md +389 -0
- package/ui-components/docs/resizable.md +265 -0
- package/ui-components/docs/select.md +616 -0
- package/ui-components/docs/separator.md +216 -0
- package/ui-components/docs/skeleton.md +205 -0
- package/ui-components/docs/slider.md +226 -0
- package/ui-components/docs/spinner.md +332 -0
- package/ui-components/docs/switch.md +236 -0
- package/ui-components/docs/table.md +551 -0
- package/ui-components/docs/tabs.md +379 -0
- package/ui-components/docs/textarea.md +187 -0
- package/ui-components/docs/toggle-group.md +370 -0
- package/ui-components/docs/toggle.md +91 -0
- package/ui-components/docs/tooltip.md +290 -0
- package/ui-components/drawer.tsx +213 -0
- package/ui-components/dropdown-menu.tsx +263 -0
- package/ui-components/field.tsx +224 -0
- package/ui-components/hover-card.tsx +46 -0
- package/ui-components/input-group.tsx +146 -0
- package/ui-components/input.tsx +20 -0
- package/ui-components/label.tsx +17 -0
- package/ui-components/pagination.tsx +124 -0
- package/ui-components/popover.tsx +81 -0
- package/ui-components/progress.tsx +63 -0
- package/ui-components/radio-group.tsx +37 -0
- package/ui-components/resizable.tsx +40 -0
- package/ui-components/scoped-portal.tsx +31 -0
- package/ui-components/select.tsx +195 -0
- package/ui-components/separator.tsx +18 -0
- package/ui-components/skeleton.tsx +15 -0
- package/ui-components/slider.tsx +75 -0
- package/ui-components/spinner.tsx +20 -0
- package/ui-components/switch.tsx +26 -0
- package/ui-components/table.tsx +86 -0
- package/ui-components/tabs.tsx +75 -0
- package/ui-components/textarea.tsx +17 -0
- package/ui-components/toggle-group.tsx +85 -0
- package/ui-components/toggle.tsx +42 -0
- package/ui-components/tooltip.tsx +61 -0
- package/ui-components/utils.ts +8 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +11 -20
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +4 -3
- package/workspace/.claude/skills/moi-workspace/references/UI-COMPONENTS.md +67 -203
- package/dist/chunk-59zf0m6n.js +0 -1
- package/dist/chunk-bj3akjs2.js +0 -1
- package/dist/chunk-j2w2vak4.js +0 -546
- package/dist/chunk-k2r9c95m.js +0 -10
- package/dist/chunk-kmbxhgwv.js +0 -1
- package/dist/chunk-p1yqa71k.js +0 -83
- package/dist/chunk-r5xrenjy.css +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { Link } from 'wouter'
|
|
4
|
+
|
|
5
|
+
import { Button } from '@/client/components/ui/button'
|
|
6
|
+
import registry from '@/registry.json'
|
|
7
|
+
import { UI_COMPONENT_PREVIEWS } from './UiComponentPreviews'
|
|
8
|
+
|
|
9
|
+
const registryItems = registry.items.filter(item => item.type === 'registry:ui')
|
|
10
|
+
|
|
11
|
+
export function UiComponentsPage() {
|
|
12
|
+
const [selectedName, setSelectedName] = useState(registryItems[0]?.name ?? '')
|
|
13
|
+
const Preview = UI_COMPONENT_PREVIEWS[selectedName as keyof typeof UI_COMPONENT_PREVIEWS]
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<main className="min-h-dvh bg-muted px-6 py-10 text-foreground">
|
|
17
|
+
<div className="mx-auto w-full max-w-7xl">
|
|
18
|
+
<Link href="/dev" className="text-sm text-muted-foreground hover:text-foreground">
|
|
19
|
+
← Dev pages
|
|
20
|
+
</Link>
|
|
21
|
+
|
|
22
|
+
<header className="mt-5 max-w-2xl">
|
|
23
|
+
<p className="text-[11px] font-medium tracking-widest text-muted-foreground uppercase">
|
|
24
|
+
Playground
|
|
25
|
+
</p>
|
|
26
|
+
<h1 className="mt-2 text-3xl font-medium tracking-tight">UI components</h1>
|
|
27
|
+
<p className="mt-2 text-sm leading-6 text-muted-foreground">
|
|
28
|
+
Interactive previews for registry components.
|
|
29
|
+
</p>
|
|
30
|
+
</header>
|
|
31
|
+
|
|
32
|
+
<div className="mt-8 grid items-start gap-6 lg:grid-cols-[14rem_minmax(0,1fr)]">
|
|
33
|
+
<aside
|
|
34
|
+
aria-label="UI components"
|
|
35
|
+
className="flex h-[min(42rem,70dvh)] flex-col gap-1 overflow-y-auto"
|
|
36
|
+
>
|
|
37
|
+
{registryItems.map(item => (
|
|
38
|
+
<Button
|
|
39
|
+
key={item.name}
|
|
40
|
+
type="button"
|
|
41
|
+
variant={item.name === selectedName ? 'secondary' : 'ghost'}
|
|
42
|
+
className="justify-start"
|
|
43
|
+
onClick={() => setSelectedName(item.name)}
|
|
44
|
+
>
|
|
45
|
+
{item.title}
|
|
46
|
+
</Button>
|
|
47
|
+
))}
|
|
48
|
+
</aside>
|
|
49
|
+
|
|
50
|
+
<section
|
|
51
|
+
data-applet="dev:ui-components"
|
|
52
|
+
className="relative isolate flex h-[min(42rem,70dvh)] min-h-96 min-w-0 items-center justify-center overflow-hidden rounded-xl bg-muted p-6 shadow-sm sm:p-10"
|
|
53
|
+
>
|
|
54
|
+
{Preview && <Preview key={selectedName} />}
|
|
55
|
+
</section>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</main>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
@@ -165,7 +165,7 @@ export function WorkspacePreview({ workspaceId }: WorkspacePreviewProps) {
|
|
|
165
165
|
<div
|
|
166
166
|
key={src}
|
|
167
167
|
className={cn(
|
|
168
|
-
'absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs
|
|
168
|
+
'absolute top-[12%] left-[14%] w-fit max-w-[72%] overflow-hidden rounded-[calc(var(--radius-2xl)*0.4)] bg-background shadow-xs squircle',
|
|
169
169
|
'animate-in duration-300 ease-out fade-in',
|
|
170
170
|
slots[index].frame
|
|
171
171
|
)}
|
|
@@ -134,7 +134,8 @@ function DemoDialogContent() {
|
|
|
134
134
|
return (
|
|
135
135
|
<DialogContent
|
|
136
136
|
data-vivid
|
|
137
|
-
|
|
137
|
+
showCloseButton={false}
|
|
138
|
+
className="block w-full max-w-md overflow-hidden rounded-2xl bg-primary texture-checker-16 p-2 text-primary-foreground sm:max-w-md md:max-w-2xl"
|
|
138
139
|
>
|
|
139
140
|
<div className="absolute inset-0 bg-[linear-gradient(to_right,color-mix(in_oklch,var(--background)_14%,transparent),color-mix(in_oklch,var(--background)_6%,transparent))]" />
|
|
140
141
|
{/* Film grain keeps the illustration gradient from banding. */}
|
|
@@ -154,7 +155,7 @@ function DemoDialogContent() {
|
|
|
154
155
|
</svg>
|
|
155
156
|
|
|
156
157
|
<div className="relative grid max-h-[calc(100dvh-2rem)] overflow-y-auto md:grid-cols-[3fr_2fr] md:overflow-visible">
|
|
157
|
-
<div className="rounded-xl bg-
|
|
158
|
+
<div className="rounded-xl bg-background p-6 text-foreground shadow-sm md:p-8">
|
|
158
159
|
<div className="flex flex-col gap-0.5">
|
|
159
160
|
<DialogTitle>Unlock all features</DialogTitle>
|
|
160
161
|
<DialogDescription className="mt-1">
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { Button } from '@/client/components/ui/button'
|
|
4
|
-
import { Dialog } from '@/client/components/ui/dialog'
|
|
4
|
+
import { Dialog, DialogClose } from '@/client/components/ui/dialog'
|
|
5
5
|
import { workspaceDisplayName } from '@/client/features/home/workspace-presentation'
|
|
6
6
|
import type { HarnessAvailability, WorkspaceType } from '@/lib/types'
|
|
7
7
|
|
|
@@ -15,7 +15,6 @@ type ImportWorkspaceStepProps = {
|
|
|
15
15
|
isPending: boolean
|
|
16
16
|
errorMessage?: string
|
|
17
17
|
onTypeChange: (type: WorkspaceType) => void
|
|
18
|
-
onCancel: () => void
|
|
19
18
|
onSubmit: () => void
|
|
20
19
|
}
|
|
21
20
|
|
|
@@ -25,7 +24,6 @@ function ImportWorkspaceStep({
|
|
|
25
24
|
isPending,
|
|
26
25
|
errorMessage,
|
|
27
26
|
onTypeChange,
|
|
28
|
-
onCancel,
|
|
29
27
|
onSubmit
|
|
30
28
|
}: ImportWorkspaceStepProps) {
|
|
31
29
|
return (
|
|
@@ -37,9 +35,9 @@ function ImportWorkspaceStep({
|
|
|
37
35
|
isPending={isPending}
|
|
38
36
|
errorMessage={errorMessage}
|
|
39
37
|
secondaryAction={
|
|
40
|
-
<Button variant="secondary"
|
|
38
|
+
<DialogClose render={<Button variant="secondary" />} disabled={isPending}>
|
|
41
39
|
Cancel
|
|
42
|
-
</
|
|
40
|
+
</DialogClose>
|
|
43
41
|
}
|
|
44
42
|
primaryLabel="Add workspace"
|
|
45
43
|
pendingLabel="Adding…"
|
|
@@ -49,7 +47,7 @@ function ImportWorkspaceStep({
|
|
|
49
47
|
)
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
type ImportWorkspaceDialogProps =
|
|
50
|
+
type ImportWorkspaceDialogProps = ImportWorkspaceStepProps & {
|
|
53
51
|
onReset: () => void
|
|
54
52
|
}
|
|
55
53
|
|
|
@@ -79,14 +77,13 @@ export function ImportWorkspaceDialog({
|
|
|
79
77
|
onOpenChange={handleOpenChange}
|
|
80
78
|
onOpenChangeComplete={handleOpenChangeComplete}
|
|
81
79
|
>
|
|
82
|
-
<WorkspaceDialogContent
|
|
80
|
+
<WorkspaceDialogContent showCloseButton={!isPending}>
|
|
83
81
|
<ImportWorkspaceStep
|
|
84
82
|
choice={choice}
|
|
85
83
|
availability={availability}
|
|
86
84
|
isPending={isPending}
|
|
87
85
|
errorMessage={errorMessage}
|
|
88
86
|
onTypeChange={onTypeChange}
|
|
89
|
-
onCancel={() => setOpen(false)}
|
|
90
87
|
onSubmit={onSubmit}
|
|
91
88
|
/>
|
|
92
89
|
</WorkspaceDialogContent>
|
|
@@ -1,34 +1,21 @@
|
|
|
1
1
|
import type { ReactNode } from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { Button } from '@/client/components/ui/button'
|
|
6
|
-
import { DialogClose, DialogContent } from '@/client/components/ui/dialog'
|
|
3
|
+
import { DialogContent } from '@/client/components/ui/dialog'
|
|
7
4
|
|
|
8
5
|
type WorkspaceDialogContentProps = {
|
|
9
6
|
children: ReactNode
|
|
10
|
-
|
|
7
|
+
showCloseButton?: boolean
|
|
11
8
|
}
|
|
12
9
|
|
|
13
10
|
export function WorkspaceDialogContent({
|
|
14
11
|
children,
|
|
15
|
-
|
|
12
|
+
showCloseButton = true
|
|
16
13
|
}: WorkspaceDialogContentProps) {
|
|
17
14
|
return (
|
|
18
|
-
<DialogContent
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
variant="ghost"
|
|
23
|
-
size="icon-sm"
|
|
24
|
-
aria-label="Close"
|
|
25
|
-
className="absolute top-4 right-4"
|
|
26
|
-
disabled={closeDisabled}
|
|
27
|
-
>
|
|
28
|
-
<IconX stroke={1.75} />
|
|
29
|
-
</Button>
|
|
30
|
-
}
|
|
31
|
-
/>
|
|
15
|
+
<DialogContent
|
|
16
|
+
showCloseButton={showCloseButton}
|
|
17
|
+
className="block w-[calc(100%-2rem)] max-w-xl overflow-hidden p-6 sm:max-w-xl"
|
|
18
|
+
>
|
|
32
19
|
{children}
|
|
33
20
|
</DialogContent>
|
|
34
21
|
)
|
|
@@ -27,7 +27,7 @@ export function SettingsSection({ label, children }: SettingsSectionProps) {
|
|
|
27
27
|
return (
|
|
28
28
|
<section className="flex flex-col gap-2">
|
|
29
29
|
{label && <p className="px-0.5 text-xs font-medium text-muted-foreground">{label}</p>}
|
|
30
|
-
<div className="flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border
|
|
30
|
+
<div className="flex flex-col divide-y divide-dashed divide-border overflow-hidden rounded-xl border bg-background text-foreground">
|
|
31
31
|
{children}
|
|
32
32
|
</div>
|
|
33
33
|
</section>
|
|
@@ -41,7 +41,10 @@ export function WorkspaceSettings() {
|
|
|
41
41
|
</Tooltip>
|
|
42
42
|
|
|
43
43
|
<Dialog open={open} onOpenChange={setOpen}>
|
|
44
|
-
<DialogContent
|
|
44
|
+
<DialogContent
|
|
45
|
+
showCloseButton={false}
|
|
46
|
+
className="flex h-[min(680px,90vh)] w-[880px] max-w-[94vw] gap-0 overflow-hidden p-0 sm:max-w-[94vw]"
|
|
47
|
+
>
|
|
45
48
|
<DialogTitle className="sr-only">Space settings</DialogTitle>
|
|
46
49
|
|
|
47
50
|
{/* Sidebar nav — top padding lines the "Settings" label up with the
|
|
@@ -203,6 +203,9 @@ type ViewFrameProps = {
|
|
|
203
203
|
|
|
204
204
|
// One build of one view, in its style scope. Frames stack absolutely, so during
|
|
205
205
|
// a rebuild the incoming one dissolves in over the outgoing one still on screen.
|
|
206
|
+
//
|
|
207
|
+
// The frame itself never scrolls; a child does. Applet-scoped overlays portal
|
|
208
|
+
// into this root and position against it.
|
|
206
209
|
function ViewFrame({ view, build, params, entering, thumbnailTarget }: ViewFrameProps) {
|
|
207
210
|
const workspaceId = useWorkspaceId()
|
|
208
211
|
|
|
@@ -213,18 +216,20 @@ function ViewFrame({ view, build, params, entering, thumbnailTarget }: ViewFrame
|
|
|
213
216
|
className={cn(
|
|
214
217
|
// Keep applet z-indexes inside the view. Host overlays render after this
|
|
215
218
|
// frame and should always stack above the view as a single unit.
|
|
216
|
-
'absolute inset-0 isolate
|
|
219
|
+
'absolute inset-0 isolate',
|
|
217
220
|
entering && 'animate-in duration-200 ease-out blur-in-4 fade-in'
|
|
218
221
|
)}
|
|
219
222
|
>
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
223
|
+
<div className="size-full overflow-auto">
|
|
224
|
+
<WidgetErrorBoundary
|
|
225
|
+
name={view.id}
|
|
226
|
+
kind="view"
|
|
227
|
+
workspaceId={workspaceId}
|
|
228
|
+
resetKey={build.version}
|
|
229
|
+
>
|
|
230
|
+
<build.Component params={params} />
|
|
231
|
+
</WidgetErrorBoundary>
|
|
232
|
+
</div>
|
|
228
233
|
</div>
|
|
229
234
|
)
|
|
230
235
|
}
|
|
@@ -42,7 +42,7 @@ export function WidgetFrame({ editing, hidden, onRemove, children }: WidgetFrame
|
|
|
42
42
|
data-vivid
|
|
43
43
|
style={getWorkspaceThemeStyle(theme, 'widget')}
|
|
44
44
|
className={cn(
|
|
45
|
-
'absolute inset-0 overflow-hidden rounded-2xl text-foreground
|
|
45
|
+
'absolute inset-0 overflow-hidden rounded-2xl text-foreground squircle',
|
|
46
46
|
// Outer drop shadow on the wrapper itself.
|
|
47
47
|
'shadow-[0_1px_2px_-1px_rgba(0,0,0,0.08),0_2px_4px_0_rgba(0,0,0,0.03)]',
|
|
48
48
|
// 1px inset stroke painted on a pseudo so it lands ON TOP of the
|
|
@@ -28,9 +28,7 @@ const EMPTY_WIDGET_ITEMS: GridItem[] = Array.from({ length: 10 }, (_, index) =>
|
|
|
28
28
|
}))
|
|
29
29
|
|
|
30
30
|
function renderEmptyWidget() {
|
|
31
|
-
return
|
|
32
|
-
<Skeleton className="size-full animate-none rounded-2xl texture-checker [corner-shape:superellipse(1.2)]" />
|
|
33
|
-
)
|
|
31
|
+
return <Skeleton className="size-full animate-none rounded-2xl texture-checker squircle" />
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
type NoWidgetsCreatedProps = {
|
|
@@ -266,6 +266,8 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
266
266
|
sessionId,
|
|
267
267
|
processing,
|
|
268
268
|
error,
|
|
269
|
+
loadError,
|
|
270
|
+
retryLoad,
|
|
269
271
|
send,
|
|
270
272
|
stop,
|
|
271
273
|
selectSession,
|
|
@@ -275,7 +277,9 @@ export function WorkspaceScreen({ widgets, views, builders }: WorkspaceScreenPro
|
|
|
275
277
|
workspaceId,
|
|
276
278
|
{
|
|
277
279
|
chatError: error,
|
|
278
|
-
onDismissChatError: dismissError
|
|
280
|
+
onDismissChatError: dismissError,
|
|
281
|
+
chatLoadError: loadError,
|
|
282
|
+
onRetryChatLoad: retryLoad
|
|
279
283
|
}
|
|
280
284
|
)
|
|
281
285
|
|
|
@@ -75,7 +75,12 @@ export function WorkspaceSplitLayout({
|
|
|
75
75
|
{workspace}
|
|
76
76
|
</div>
|
|
77
77
|
</ResizablePanel>
|
|
78
|
-
<ResizableHandle
|
|
78
|
+
<ResizableHandle
|
|
79
|
+
aria-label="Resize chat"
|
|
80
|
+
showDivider={false}
|
|
81
|
+
hidden={!open}
|
|
82
|
+
disabled={!open}
|
|
83
|
+
/>
|
|
79
84
|
<ResizablePanel
|
|
80
85
|
id="chat"
|
|
81
86
|
aria-hidden={!open}
|
|
@@ -34,10 +34,8 @@ export function useWorkspaceLayout(workspaceId: string) {
|
|
|
34
34
|
|
|
35
35
|
// The workspace's agent backend in one snapshot: availability (runtime
|
|
36
36
|
// presence + auth), any in-flight login ceremony, the model catalog, and
|
|
37
|
-
// capabilities.
|
|
38
|
-
//
|
|
39
|
-
// the server owns the login watch loop, so the client never polls. Focus
|
|
40
|
-
// refetch stays as a cheap safety net (the server serves its cache).
|
|
37
|
+
// capabilities. `agent:updated` events refresh availability and login state;
|
|
38
|
+
// focus refetches pick up model changes after a CLI update.
|
|
41
39
|
export function useWorkspaceAgent(workspaceId: string) {
|
|
42
40
|
const queryClient = useQueryClient()
|
|
43
41
|
useEffect(
|
package/client/index.css
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
@import 'highlight.js/styles/github.css';
|
|
6
6
|
|
|
7
|
-
.
|
|
8
|
-
|
|
9
|
-
padding: 0;
|
|
10
|
-
}
|
|
7
|
+
/* Theme tokens and texture utilities shared with applet bundles. */
|
|
8
|
+
@import './theme.css';
|
|
11
9
|
|
|
12
10
|
@plugin '@tailwindcss/typography';
|
|
13
11
|
|
|
@@ -29,7 +27,7 @@
|
|
|
29
27
|
--primary-foreground: oklch(0.985 0 0);
|
|
30
28
|
--muted: oklch(0.97 0 0);
|
|
31
29
|
--muted-foreground: oklch(0.64 0 0);
|
|
32
|
-
--accent: oklch(0 0 0 / 0.
|
|
30
|
+
--accent: oklch(0 0 0 / 0.06);
|
|
33
31
|
--accent-foreground: var(--foreground);
|
|
34
32
|
--success: oklch(0.527 0.154 150.069);
|
|
35
33
|
--destructive: oklch(0.58 0.22 27);
|
|
@@ -102,23 +100,6 @@
|
|
|
102
100
|
--chart-5: oklch(0.645 0.246 16.439);
|
|
103
101
|
}
|
|
104
102
|
|
|
105
|
-
/* Theme tokens and texture utilities shared with applet bundles. */
|
|
106
|
-
@import './theme.css';
|
|
107
|
-
|
|
108
|
-
/* Dragged card floats above all others */
|
|
109
|
-
.react-grid-item.react-draggable-dragging {
|
|
110
|
-
z-index: 10;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/* Drop placeholder shown while dragging a widget — matches card shape */
|
|
114
|
-
.react-grid-item.react-grid-placeholder {
|
|
115
|
-
background: var(--muted);
|
|
116
|
-
opacity: 0.75;
|
|
117
|
-
border-radius: var(--radius-2xl);
|
|
118
|
-
corner-shape: superellipse(1.2);
|
|
119
|
-
z-index: 0;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
103
|
@layer base {
|
|
123
104
|
/* Mirrored into the synthetic applet Tailwind entry (writeSyntheticTailwindCss
|
|
124
105
|
in server/bundler/build-applet.ts): this file never reaches applet builds,
|
|
@@ -195,13 +176,25 @@
|
|
|
195
176
|
cursor: var(--cursor-pencil);
|
|
196
177
|
}
|
|
197
178
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
179
|
+
@utility squircle {
|
|
180
|
+
corner-shape: superellipse(1.2);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.hljs {
|
|
184
|
+
background: transparent;
|
|
185
|
+
padding: 0;
|
|
201
186
|
}
|
|
202
|
-
|
|
203
|
-
|
|
187
|
+
|
|
188
|
+
/* Dragged card floats above all others */
|
|
189
|
+
.react-grid-item.react-draggable-dragging {
|
|
190
|
+
z-index: 10;
|
|
204
191
|
}
|
|
205
|
-
|
|
206
|
-
|
|
192
|
+
|
|
193
|
+
/* Drop placeholder shown while dragging a widget — matches card shape */
|
|
194
|
+
.react-grid-item.react-grid-placeholder {
|
|
195
|
+
background: var(--muted);
|
|
196
|
+
opacity: 0.75;
|
|
197
|
+
border-radius: var(--radius-2xl);
|
|
198
|
+
corner-shape: superellipse(1.2);
|
|
199
|
+
z-index: 0;
|
|
207
200
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{u as
|
|
1
|
+
import{Ec as w,Gc as s}from"/chunk-87thzbtw.js";import{Ic as q}from"/chunk-j3wvxjr7.js";var R=q(w(),1);async function i(o,t){let a=await o.text();return Error(a||t)}async function u(o,t,a="Request failed"){let n=await fetch(o,t);if(!n.ok)throw await i(n,a);return n.json()}async function T(o,t,a="Request failed"){let n=await fetch(o,t);if(!n.ok)throw await i(n,a)}function y(o,t){return{method:o,headers:{"Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}}var r={cloudDemo:!1,experiments:[],demoInstallUrl:"https://moi.computer"},d=r,e=new Set;function I(o){return e.add(o),()=>{e.delete(o)}}async function f(){try{d=await u("/api/config");for(let o of e)o()}catch{}}async function c(){await f(),s(()=>{f()})}function h(){return R.useSyncExternalStore(I,()=>d)}
|
|
2
|
+
export{u as zc,T as Ac,y as Bc,c as Cc,h as Dc};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"/chunk-
|
|
1
|
+
import"/chunk-j3wvxjr7.js";function t(z,Q){return z[13]=1,z[14]=Q>>8,z[15]=Q&255,z[16]=Q>>8,z[17]=Q&255,z}var e=112,zz=72,Qz=89,Zz=115,p;function Nz(){let z=new Int32Array(256);for(let Q=0;Q<256;Q++){let Z=Q;for(let $=0;$<8;$++)Z=Z&1?3988292384^Z>>>1:Z>>>1;z[Q]=Z}return z}function Iz(z){let Q=-1;if(!p)p=Nz();for(let Z=0;Z<z.length;Z++)Q=p[(Q^z[Z])&255]^Q>>>8;return Q^-1}function Uz(z){let Q=z.length-1;for(let Z=Q;Z>=4;Z--)if(z[Z-4]===9&&z[Z-3]===e&&z[Z-2]===zz&&z[Z-1]===Qz&&z[Z]===Zz)return Z-3;return 0}function $z(z,Q,Z=!1){let $=new Uint8Array(13);Q*=39.3701,$[0]=e,$[1]=zz,$[2]=Qz,$[3]=Zz,$[4]=Q>>>24,$[5]=Q>>>16,$[6]=Q>>>8,$[7]=Q&255,$[8]=$[4],$[9]=$[5],$[10]=$[6],$[11]=$[7],$[12]=1;let Y=Iz($),K=new Uint8Array(4);if(K[0]=Y>>>24,K[1]=Y>>>16,K[2]=Y>>>8,K[3]=Y&255,Z){let X=Uz(z);return z.set($,X),z.set(K,X+13),z}else{let X=new Uint8Array(4);X[0]=0,X[1]=0,X[2]=0,X[3]=9;let J=new Uint8Array(54);return J.set(z,0),J.set(X,33),J.set($,37),J.set(K,50),J}}var Dz="AAlwSFlz",Fz="AAAJcEhZ",Rz="AAAACXBI";function wz(z){let Q=z.indexOf(Dz);if(Q===-1)Q=z.indexOf(Fz);if(Q===-1)Q=z.indexOf(Rz);return Q}var Jz="[modern-screenshot]",D=typeof window<"u",Ez=D&&"Worker"in window,Kz=D&&"atob"in window,Cz=D&&"btoa"in window,x=D?window.navigator?.userAgent:"",Yz=x.includes("Chrome"),S=x.includes("AppleWebKit")&&!Yz,u=x.includes("Firefox"),fz=(z)=>z&&("__CONTEXT__"in z),Tz=(z)=>z.constructor.name==="CSSFontFaceRule",bz=(z)=>z.constructor.name==="CSSImportRule",Sz=(z)=>z.constructor.name==="CSSLayerBlockRule",k=(z)=>z.nodeType===1,f=(z)=>typeof z.className==="object",Xz=(z)=>z.tagName==="image",hz=(z)=>z.tagName==="use",w=(z)=>k(z)&&typeof z.style<"u"&&!f(z),gz=(z)=>z.nodeType===8,vz=(z)=>z.nodeType===3,R=(z)=>z.tagName==="IMG",h=(z)=>z.tagName==="VIDEO",pz=(z)=>z.tagName==="CANVAS",yz=(z)=>z.tagName==="TEXTAREA",mz=(z)=>z.tagName==="INPUT",xz=(z)=>z.tagName==="STYLE",uz=(z)=>z.tagName==="SCRIPT",iz=(z)=>z.tagName==="SELECT",cz=(z)=>z.tagName==="SLOT",dz=(z)=>z.tagName==="IFRAME",az=(...z)=>console.warn(Jz,...z);function lz(z){let Q=z?.createElement?.("canvas");if(Q)Q.height=Q.width=1;return Boolean(Q)&&"toDataURL"in Q&&Boolean(Q.toDataURL("image/webp").includes("image/webp"))}var y=(z)=>z.startsWith("data:");function Gz(z,Q){if(z.match(/^[a-z]+:\/\//i))return z;if(D&&z.match(/^\/\//))return window.location.protocol+z;if(z.match(/^[a-z]+:/i))return z;if(!D)return z;let Z=g().implementation.createHTMLDocument(),$=Z.createElement("base"),Y=Z.createElement("a");if(Z.head.appendChild($),Z.body.appendChild(Y),Q)$.href=Q;return Y.href=z,Y.href}function g(z){return(z&&k(z)?z?.ownerDocument:z)??window.document}var v="http://www.w3.org/2000/svg";function jz(z,Q,Z){let $=g(Z).createElementNS(v,"svg");return $.setAttributeNS(null,"width",z.toString()),$.setAttributeNS(null,"height",Q.toString()),$.setAttributeNS(null,"viewBox",`0 0 ${z} ${Q}`),$}function Vz(z,Q){let Z=new XMLSerializer().serializeToString(z);if(Q)Z=Z.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"");return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(Z)}`}async function sz(z,Q="image/png",Z=1){try{return await new Promise(($,Y)=>{z.toBlob((K)=>{if(K)$(K);else Y(Error("Blob is null"))},Q,Z)})}catch($){if(Kz)return rz(z.toDataURL(Q,Z));throw $}}function rz(z){let[Q,Z]=z.split(","),$=Q.match(/data:(.+);/)?.[1]??void 0,Y=window.atob(Z),K=Y.length,X=new Uint8Array(K);for(let J=0;J<K;J+=1)X[J]=Y.charCodeAt(J);return new Blob([X],{type:$})}function Hz(z,Q){return new Promise((Z,$)=>{let Y=new FileReader;if(Y.onload=()=>Z(Y.result),Y.onerror=()=>$(Y.error),Y.onabort=()=>$(Error(`Failed read blob to ${Q}`)),Q==="dataUrl")Y.readAsDataURL(z);else if(Q==="arrayBuffer")Y.readAsArrayBuffer(z)})}var nz=(z)=>Hz(z,"dataUrl"),oz=(z)=>Hz(z,"arrayBuffer");function F(z,Q){let Z=g(Q).createElement("img");return Z.decoding="sync",Z.loading="eager",Z.src=z,Z}function E(z,Q){return new Promise((Z)=>{let{timeout:$,ownerDocument:Y,onError:K,onWarn:X}=Q??{},J=typeof z==="string"?F(z,g(Y)):z,V=null,j=null;function G(){Z(J),V&&clearTimeout(V),j?.()}if($)V=setTimeout(G,$);if(h(J)){let M=J.currentSrc||J.src;if(!M){if(J.poster)return E(J.poster,Q).then(Z);return G()}if(J.readyState>=2)return G();let B=G,q=(W)=>{X?.("Failed video load",M,W),K?.(W),G()};j=()=>{J.removeEventListener("loadeddata",B),J.removeEventListener("error",q)},J.addEventListener("loadeddata",B,{once:!0}),J.addEventListener("error",q,{once:!0})}else{let M=Xz(J)?J.href.baseVal:J.currentSrc||J.src;if(!M)return G();let B=async()=>{if(R(J)&&"decode"in J)try{await J.decode()}catch(W){X?.("Failed to decode image, trying to render anyway",J.dataset.originalSrc||M,W)}G()},q=(W)=>{X?.("Failed image load",J.dataset.originalSrc||M,W),G()};if(R(J)&&J.complete)return B();j=()=>{J.removeEventListener("load",B),J.removeEventListener("error",q)},J.addEventListener("load",B,{once:!0}),J.addEventListener("error",q,{once:!0})}})}async function tz(z,Q){if(w(z))if(R(z)||h(z))await E(z,Q);else await Promise.all(["img","video"].flatMap((Z)=>{return Array.from(z.querySelectorAll(Z)).map(($)=>E($,Q))}))}var Bz=function(){let Q=0,Z=()=>`0000${(Math.random()*1679616<<0).toString(36)}`.slice(-4);return()=>{return Q+=1,`u${Z()}${Q}`}}();function Mz(z){return z?.split(",").map((Q)=>Q.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var a=0;function ez(z){let Q=`${Jz}[#${a}]`;return a++,{time:(Z)=>z&&console.time(`${Q} ${Z}`),timeEnd:(Z)=>z&&console.timeEnd(`${Q} ${Z}`),warn:(...Z)=>z&&az(...Z)}}function zQ(z){return{cache:z?"no-cache":"force-cache"}}async function N(z,Q){return fz(z)?z:QQ(z,{...Q,autoDestruct:!0})}async function QQ(z,Q){let{scale:Z=1,workerUrl:$,workerNumber:Y=1}=Q||{},K=Boolean(Q?.debug),X=Q?.features??!0,J=z.ownerDocument??(D?window.document:void 0),V=z.ownerDocument?.defaultView??(D?window:void 0),j=new Map,G={width:0,height:0,quality:1,type:"image/png",scale:Z,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:30000,progress:null,debug:K,fetch:{requestInit:zQ(Q?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...Q?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:Y,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...Q,__CONTEXT__:!0,log:ez(K),node:z,ownerDocument:J,ownerWindow:V,dpi:Z===1?null:96*Z,svgStyleElement:qz(J),svgDefsElement:J?.createElementNS(v,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Ez&&$&&Y?Y:0})].map(()=>{try{let q=new Worker($);return q.onmessage=async(W)=>{let{url:H,result:L}=W.data;if(L)j.get(H)?.resolve?.(L);else j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q.onmessageerror=(W)=>{let{url:H}=W.data;j.get(H)?.reject?.(Error(`Error receiving message from worker: ${H}`))},q}catch(q){return G.log.warn("Failed to new Worker",q),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[lz(J)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:j,drawImageCount:0,tasks:[],features:X,isEnable:(q)=>{if(q==="restoreScrollPosition")return typeof X==="boolean"?!1:X[q]??!1;if(typeof X==="boolean")return X;return X[q]??!0},shadowRoots:[]};G.log.time("wait until load"),await tz(z,{timeout:G.timeout,onWarn:G.log.warn}),G.log.timeEnd("wait until load");let{width:M,height:B}=ZQ(z,G);return G.width=M,G.height=B,G}function qz(z){if(!z)return;let Q=z.createElement("style"),Z=Q.ownerDocument.createTextNode(`
|
|
2
2
|
.______background-clip--text {
|
|
3
3
|
background-clip: text;
|
|
4
4
|
-webkit-background-clip: text;
|