moi-computer 0.8.1-next.0 → 0.9.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.
- package/client/assets/hermes.png +0 -0
- package/client/components/shared/IconGhost.tsx +15 -18
- package/client/components/ui/button.tsx +2 -2
- package/client/components/ui/hover-card.tsx +1 -1
- package/client/components/ui/popover.tsx +3 -1
- package/client/features/chat/ChatEmptyState.tsx +25 -7
- package/client/features/chat/ChatPanel.tsx +70 -28
- package/client/features/chat/ChatPopup.tsx +3 -2
- package/client/features/chat/ChatPromptBubbles.tsx +1 -1
- package/client/features/chat/MarkdownContent.tsx +1 -1
- package/client/features/chat/attachment-staging.ts +153 -0
- package/client/features/chat/chat-send.ts +55 -0
- package/client/features/chat/chat-store.ts +32 -8
- package/client/features/chat/composer/ChatComposer.tsx +190 -77
- package/client/features/chat/{ModelPicker.tsx → composer/ModelPicker.tsx} +29 -25
- package/client/features/chat/composer/banners/ComposerBanner.tsx +1 -1
- package/client/features/chat/composer/banners/WorkspaceAgentAvailabilityBanner.tsx +4 -13
- package/client/features/chat/{model-order.ts → composer/model-order.ts} +16 -0
- package/client/features/chat/composer/useWorkspaceComposerState.tsx +9 -4
- package/client/features/chat/tool-group/format/claude.ts +48 -0
- package/client/features/chat/tool-group/format/codex.ts +126 -0
- package/client/features/chat/tool-group/format/hermes.ts +68 -0
- package/client/features/chat/tool-group/format/index.ts +34 -0
- package/client/features/chat/tool-group/format/mcp.ts +64 -0
- package/client/features/chat/tool-group/format/openclaw.ts +116 -0
- package/client/features/chat/tool-group/format/shared.ts +49 -0
- package/client/features/chat/useChat.ts +5 -10
- package/client/features/dev/ChatStatesPage.tsx +40 -2
- package/client/features/drawings/DrawingLayer.tsx +49 -0
- package/client/features/drawings/DrawingToolbar.tsx +95 -0
- package/client/features/drawings/annotation-availability.ts +10 -0
- package/client/features/drawings/capture-element.ts +45 -0
- package/client/features/drawings/useChatAnnotation.ts +222 -0
- package/client/features/drawings/useDrawingLayer.ts +758 -0
- package/client/features/drawings/useViewBuilderSketch.ts +151 -0
- package/client/features/home/workspace-presentation.tsx +6 -2
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +12 -6
- package/client/features/scratchpad/ScratchpadControls.tsx +19 -5
- package/client/features/views/ViewBuilder.tsx +224 -0
- package/client/features/views/api.ts +1 -0
- package/client/features/views/useViewBuilderActions.ts +24 -3
- package/client/features/views/useViewBuilderDrafts.ts +66 -0
- package/client/features/widgets/Widgets.tsx +23 -39
- package/client/features/workspace/CustomizePanel.tsx +1 -1
- package/client/features/workspace/WorkspaceScreen.tsx +157 -57
- package/client/features/workspace/WorkspaceTabs.tsx +3 -3
- package/client/features/workspace/useFitsSplitLayout.ts +14 -8
- package/client/index.css +8 -0
- package/client/store/ui.ts +19 -0
- package/client/theme.css +33 -8
- package/dist/chunk-3becmq75.js +81 -0
- package/dist/{chunk-kkj86722.js → chunk-6w6j9g4b.js} +78 -78
- package/dist/{chunk-xeyxk7ep.js → chunk-8ew39cvq.js} +4 -4
- package/dist/chunk-c8gtrjwp.js +1 -0
- package/dist/{chunk-2vaafjp4.js → chunk-pp62fnxh.js} +1 -1
- package/dist/{chunk-35fq49qa.js → chunk-sxc24vfp.js} +1 -1
- package/dist/{chunk-xzx7c9hq.js → chunk-v964b5g7.js} +1 -1
- package/dist/chunk-zx33ts9d.css +1 -0
- package/dist/hermes-pznd63x9.png +0 -0
- package/dist/index.html +1 -1
- package/lib/format.ts +21 -7
- package/lib/themes.ts +8 -8
- package/lib/types.ts +8 -1
- package/lib/workspace-types.ts +2 -1
- package/package.json +6 -4
- package/server/api.ts +21 -2
- package/server/bundler/build-applet.ts +35 -44
- package/server/cli-env.ts +2 -2
- package/server/cli.ts +227 -56
- package/server/constants.ts +8 -0
- package/server/control-client.ts +124 -0
- package/server/control.ts +2 -2
- package/server/harness/README.md +74 -23
- package/server/harness/acp/adapter.ts +220 -0
- package/server/harness/acp/archived.ts +88 -0
- package/server/harness/acp/client.ts +328 -0
- package/server/harness/acp/discovery.ts +130 -0
- package/server/harness/acp/run-durations.ts +68 -0
- package/server/harness/acp/session.ts +788 -0
- package/server/harness/acp/wire.ts +132 -0
- package/server/harness/executable.ts +15 -1
- package/server/harness/hermes/NOTES.md +815 -0
- package/server/harness/hermes/discovery.ts +155 -0
- package/server/harness/hermes/index.ts +155 -0
- package/server/harness/hermes/models.ts +79 -0
- package/server/harness/openclaw/NOTES.md +196 -94
- package/server/harness/openclaw/adapter.ts +28 -55
- package/server/harness/openclaw/compat.ts +4 -8
- package/server/harness/openclaw/session.ts +257 -238
- package/server/harness/openclaw/strip.ts +10 -34
- package/server/harness/openclaw/thinking.ts +5 -53
- package/server/harness/registry.ts +3 -1
- package/server/service.ts +2 -2
- package/server/view-builders.ts +4 -2
- package/server/workspace-import.ts +30 -1
- package/workspace/.claude/skills/moi-workspace/SKILL.md +6 -6
- package/client/features/chat/tool-group/format.ts +0 -359
- package/client/features/views/ViewBuilderTab.tsx +0 -152
- package/dist/chunk-gny990qx.css +0 -1
- package/dist/chunk-gt7n06ef.js +0 -1
- package/dist/chunk-n7pga5x3.js +0 -80
- /package/workspace/.claude/skills/moi-workspace/{DESIGN.md → references/DESIGN.md} +0 -0
- /package/workspace/.claude/skills/moi-workspace/{SCRATCHPAD.md → references/SCRATCHPAD.md} +0 -0
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { type FormEvent, type KeyboardEvent, useEffect, useRef, useState } from 'react'
|
|
2
|
-
|
|
3
|
-
import { Button } from '@/client/components/ui/button'
|
|
4
|
-
import {
|
|
5
|
-
canSubmitComposerAction,
|
|
6
|
-
type ComposerAvailability,
|
|
7
|
-
Composer,
|
|
8
|
-
ComposerFooter,
|
|
9
|
-
ComposerSubmitButton,
|
|
10
|
-
ComposerTextarea
|
|
11
|
-
} from '@/client/components/shared/Composer'
|
|
12
|
-
import { ModelPicker } from '@/client/features/chat/ModelPicker'
|
|
13
|
-
import type { ViewBuilder } from '@/lib/types'
|
|
14
|
-
import { Spinner } from '@/client/components/ui/spinner'
|
|
15
|
-
|
|
16
|
-
type ViewBuilderTabProps = {
|
|
17
|
-
builder: ViewBuilder
|
|
18
|
-
composerAvailability: ComposerAvailability
|
|
19
|
-
onSave: (requirements: string) => Promise<unknown>
|
|
20
|
-
onSubmit: (requirements: string) => Promise<unknown>
|
|
21
|
-
onOpenChat: () => void
|
|
22
|
-
onDiscard: () => void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function ViewBuilderTab({
|
|
26
|
-
builder,
|
|
27
|
-
composerAvailability,
|
|
28
|
-
onSave,
|
|
29
|
-
onSubmit,
|
|
30
|
-
onOpenChat,
|
|
31
|
-
onDiscard
|
|
32
|
-
}: ViewBuilderTabProps) {
|
|
33
|
-
const [requirements, setRequirements] = useState(builder.input.requirements)
|
|
34
|
-
const [submitting, setSubmitting] = useState(false)
|
|
35
|
-
const [saveError, setSaveError] = useState<string | null>(null)
|
|
36
|
-
const composerRef = useRef<HTMLTextAreaElement>(null)
|
|
37
|
-
const onSaveRef = useRef(onSave)
|
|
38
|
-
onSaveRef.current = onSave
|
|
39
|
-
const hasRequirements = requirements.trim().length > 0
|
|
40
|
-
const canSubmit = canSubmitComposerAction(hasRequirements, submitting, composerAvailability)
|
|
41
|
-
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
if (builder.status !== 'draft' || requirements === builder.input.requirements) return
|
|
44
|
-
const timer = setTimeout(() => {
|
|
45
|
-
void onSaveRef
|
|
46
|
-
.current(requirements)
|
|
47
|
-
.then(() => setSaveError(null))
|
|
48
|
-
.catch(error =>
|
|
49
|
-
setSaveError(error instanceof Error ? error.message : 'Could not save requirements')
|
|
50
|
-
)
|
|
51
|
-
}, 500)
|
|
52
|
-
return () => clearTimeout(timer)
|
|
53
|
-
}, [builder.input.requirements, builder.status, requirements])
|
|
54
|
-
|
|
55
|
-
const submit = async (event: FormEvent) => {
|
|
56
|
-
event.preventDefault()
|
|
57
|
-
if (!canSubmit) return
|
|
58
|
-
setSubmitting(true)
|
|
59
|
-
try {
|
|
60
|
-
await onSubmit(requirements)
|
|
61
|
-
} catch (error) {
|
|
62
|
-
setSaveError(error instanceof Error ? error.message : 'Could not start view builder')
|
|
63
|
-
setSubmitting(false)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (builder.status === 'draft') {
|
|
68
|
-
return (
|
|
69
|
-
<div className="flex min-h-0 flex-1 items-center justify-center px-3 py-6">
|
|
70
|
-
<div className="flex w-full max-w-(--chat-max-container) flex-col gap-6">
|
|
71
|
-
<div className="flex flex-col gap-1 text-center">
|
|
72
|
-
<h1 className="font-medium">What should this view do?</h1>
|
|
73
|
-
<p className="mx-auto max-w-sm text-sm text-muted-foreground">
|
|
74
|
-
Describe the content, data, and actions you need.
|
|
75
|
-
</p>
|
|
76
|
-
</div>
|
|
77
|
-
<Composer composerRef={composerRef} onSubmit={submit}>
|
|
78
|
-
<label className="sr-only" htmlFor={`view-builder-${builder.id}`}>
|
|
79
|
-
View requirements
|
|
80
|
-
</label>
|
|
81
|
-
<ComposerTextarea
|
|
82
|
-
textareaRef={composerRef}
|
|
83
|
-
id={`view-builder-${builder.id}`}
|
|
84
|
-
value={requirements}
|
|
85
|
-
onChange={event => setRequirements(event.target.value)}
|
|
86
|
-
onKeyDown={(event: KeyboardEvent<HTMLTextAreaElement>) => {
|
|
87
|
-
if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) {
|
|
88
|
-
event.preventDefault()
|
|
89
|
-
event.currentTarget.form?.requestSubmit()
|
|
90
|
-
}
|
|
91
|
-
}}
|
|
92
|
-
placeholder="Build a customer dashboard with…"
|
|
93
|
-
rows={1}
|
|
94
|
-
className="min-h-16"
|
|
95
|
-
aria-describedby={saveError ? `view-builder-error-${builder.id}` : undefined}
|
|
96
|
-
aria-invalid={Boolean(saveError)}
|
|
97
|
-
autoFocus
|
|
98
|
-
/>
|
|
99
|
-
<ComposerFooter>
|
|
100
|
-
<ModelPicker scope="workspace" />
|
|
101
|
-
<ComposerSubmitButton
|
|
102
|
-
label="Build view"
|
|
103
|
-
hasContent={hasRequirements}
|
|
104
|
-
loading={submitting}
|
|
105
|
-
availability={composerAvailability}
|
|
106
|
-
/>
|
|
107
|
-
</ComposerFooter>
|
|
108
|
-
</Composer>
|
|
109
|
-
{saveError && (
|
|
110
|
-
<p
|
|
111
|
-
id={`view-builder-error-${builder.id}`}
|
|
112
|
-
role="alert"
|
|
113
|
-
className="text-sm text-destructive"
|
|
114
|
-
>
|
|
115
|
-
{saveError}
|
|
116
|
-
</p>
|
|
117
|
-
)}
|
|
118
|
-
</div>
|
|
119
|
-
</div>
|
|
120
|
-
)
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
if (builder.status === 'waiting') {
|
|
124
|
-
return (
|
|
125
|
-
<div className="flex min-h-0 flex-1 items-center justify-center p-6">
|
|
126
|
-
<div className="flex max-w-md flex-col items-center gap-4 text-center">
|
|
127
|
-
<div className="flex flex-col gap-1">
|
|
128
|
-
<h1 className="text-lg font-semibold">The view needs your attention</h1>
|
|
129
|
-
<p className="text-sm text-muted-foreground">
|
|
130
|
-
{builder.error ?? 'Open its chat to answer or ask the agent to continue.'}
|
|
131
|
-
</p>
|
|
132
|
-
</div>
|
|
133
|
-
<div className="flex gap-2">
|
|
134
|
-
<Button onClick={onOpenChat}>Open chat</Button>
|
|
135
|
-
<Button variant="secondary" onClick={onDiscard}>
|
|
136
|
-
Discard
|
|
137
|
-
</Button>
|
|
138
|
-
</div>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return (
|
|
145
|
-
<div className="flex min-h-0 flex-1 items-center justify-center p-6">
|
|
146
|
-
<div className="flex items-center gap-2 text-sm text-muted-foreground">
|
|
147
|
-
<Spinner />
|
|
148
|
-
{builder.status === 'ready' ? 'Opening view…' : 'Building view…'}
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
)
|
|
152
|
-
}
|