moi-computer 0.3.1-next.0 → 0.4.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 +49 -12
- package/client/api/workspace-keys.ts +2 -2
- package/client/app/AppRouter.tsx +0 -2
- package/client/app/shell/SidebarLayout.tsx +3 -16
- package/client/assets/openai.svg +1 -3
- package/client/components/shared/Composer.tsx +53 -2
- package/client/components/ui/button.tsx +1 -1
- package/client/components/ui/tooltip.tsx +12 -15
- package/client/features/chat/ChatComposer.tsx +25 -15
- package/client/features/chat/ChatPanel.tsx +5 -2
- package/client/features/chat/MarkdownContent.tsx +20 -2
- package/client/features/chat/ModelPicker.tsx +5 -3
- package/client/features/chat/TurnView.tsx +2 -2
- package/client/features/chat/chat-frames.ts +13 -6
- package/client/features/chat/chat-send.ts +1 -1
- package/client/features/chat/chat-store.ts +22 -17
- package/client/features/chat/tool-group/ToolOutput.tsx +4 -12
- package/client/features/chat/tool-group/format.ts +22 -7
- package/client/features/chat/useChat.ts +11 -2
- package/client/features/connectors/McpServerCards.tsx +95 -0
- package/client/features/connectors/api.ts +0 -11
- package/client/features/dev/HarnessDebugPage.tsx +210 -74
- package/client/features/home/HomePage.tsx +33 -28
- package/client/features/home/api.ts +24 -12
- package/client/features/home/workspace-presentation.tsx +17 -15
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +243 -0
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +95 -0
- package/client/features/home/workspace-setup/WorkspaceAgentStep.tsx +230 -0
- package/client/features/home/workspace-setup/WorkspaceDialogContent.tsx +35 -0
- package/client/features/home/workspace-setup/useWorkspaceImport.ts +61 -0
- package/client/features/settings/ConnectorsSettings.tsx +89 -0
- package/client/features/settings/SettingsLayout.tsx +2 -2
- package/client/features/settings/WorkspaceSettings.tsx +8 -4
- package/client/features/views/ViewBuilderTab.tsx +19 -15
- package/client/features/views/useViewBuilderActions.ts +1 -1
- package/client/features/workspace/WorkspaceLayoutContext.tsx +3 -4
- package/client/features/workspace/WorkspaceScreen.tsx +11 -3
- package/client/features/workspace/api.ts +19 -1
- package/client/features/workspace/moi-context.ts +85 -0
- package/client/main.tsx +16 -5
- package/dist/chunk-19g80zc9.css +1 -0
- package/dist/{chunk-jen6xcm1.js → chunk-2vaafjp4.js} +1 -1
- package/dist/{chunk-vkvb3hjm.js → chunk-35fq49qa.js} +1 -1
- package/dist/chunk-69nhbjhy.js +50 -0
- package/dist/{chunk-axszxe4c.js → chunk-72atbmh3.js} +1 -1
- package/dist/{chunk-zpxrb1ce.js → chunk-7mkv2gr0.js} +2 -2
- package/dist/{chunk-cs8vbert.js → chunk-fh2mf6v9.js} +3 -3
- package/dist/chunk-gt7n06ef.js +1 -0
- package/dist/chunk-jwmc32rp.js +63 -0
- package/dist/chunk-kh24bstm.js +10 -0
- package/dist/chunk-sfa4mbmx.js +15 -0
- package/dist/index.html +1 -1
- package/dist/openai-ep9ht2pq.svg +1 -0
- package/lib/ids.ts +15 -0
- package/lib/moi-context.ts +170 -0
- package/lib/types.ts +29 -11
- package/lib/view-builder-directives.ts +16 -0
- package/lib/workspace-types.ts +12 -0
- package/package.json +2 -1
- package/server/api.ts +92 -30
- package/server/harness/README.md +25 -9
- package/server/harness/claude-code/NOTES.md +20 -6
- package/server/harness/claude-code/adapter.ts +2 -2
- package/server/harness/claude-code/git-worktree.ts +32 -0
- package/server/harness/claude-code/index.ts +33 -12
- package/server/harness/claude-code/mcp.ts +16 -65
- package/server/harness/claude-code/models.ts +3 -0
- package/server/harness/claude-code/session.ts +196 -61
- package/server/harness/codex/NOTES.md +41 -11
- package/server/harness/codex/adapter.ts +121 -16
- package/server/harness/codex/client.ts +67 -18
- package/server/harness/codex/discovery.ts +114 -0
- package/server/harness/codex/index.ts +10 -5
- package/server/harness/codex/probe.ts +4 -2
- package/server/harness/codex/session.ts +89 -13
- package/server/harness/executable.ts +82 -0
- package/server/harness/openclaw/adapter.ts +8 -1
- package/server/harness/openclaw/index.ts +8 -14
- package/server/harness/openclaw/session.ts +50 -10
- package/server/harness/openclaw/strip.ts +2 -2
- package/server/harness/shell-path.ts +79 -0
- package/server/harness/types.ts +22 -5
- package/server/registry.ts +57 -12
- package/server/view-builders.ts +3 -2
- package/server/web.ts +24 -8
- package/server/workspace-import.ts +45 -0
- package/workspace/.claude/skills/moi-workspace/SKILL.md +3 -3
- package/client/features/connectors/ConnectorsPage.tsx +0 -92
- package/client/features/connectors/McpMenu.tsx +0 -145
- package/client/features/home/CreateWorkspaceDialog.tsx +0 -130
- package/client/features/home/CreateWorkspaceDialogSteps.tsx +0 -234
- package/dist/chunk-4vf1t6v1.js +0 -10
- package/dist/chunk-6c8cwpzc.js +0 -1
- package/dist/chunk-b3ynfk4g.js +0 -62
- package/dist/chunk-b4b276wx.js +0 -15
- package/dist/chunk-kxmvv1ax.js +0 -48
- package/dist/chunk-npwq6jmr.css +0 -1
- package/dist/openai-h13pza4b.svg +0 -3
- package/lib/view-builder-meta.ts +0 -35
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import type { FormEvent } from 'react'
|
|
2
|
-
|
|
3
|
-
import { IconCircleCheckFilled } from '@tabler/icons-react'
|
|
4
|
-
|
|
5
|
-
import { Button } from '@/client/components/ui/button'
|
|
6
|
-
import { DialogDescription, DialogTitle } from '@/client/components/ui/dialog'
|
|
7
|
-
import { Input } from '@/client/components/ui/input'
|
|
8
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip'
|
|
9
|
-
import { cn } from '@/client/lib/cn'
|
|
10
|
-
import {
|
|
11
|
-
WorkspaceTypeIcon,
|
|
12
|
-
workspaceTypeLabel
|
|
13
|
-
} from '@/client/features/home/workspace-presentation'
|
|
14
|
-
import type { WorkspaceType } from '@/lib/types'
|
|
15
|
-
|
|
16
|
-
type WorkspaceAgentOption = {
|
|
17
|
-
type: WorkspaceType
|
|
18
|
-
hint: string
|
|
19
|
-
disabled?: boolean
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Only Claude Code workspaces can be created from scratch for now. OpenClaw
|
|
23
|
-
// workspaces arrive through discovery, and Hermes has no initialization path.
|
|
24
|
-
const WORKSPACE_AGENT_OPTIONS: WorkspaceAgentOption[] = [
|
|
25
|
-
{ type: 'claude-code', hint: 'Great all-rounder for complex tasks built by Anthropic' },
|
|
26
|
-
{
|
|
27
|
-
type: 'openclaw',
|
|
28
|
-
hint: 'Initialize OpenClaw in the folder manually, then import it to moi',
|
|
29
|
-
disabled: true
|
|
30
|
-
}
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
type WorkspaceAgentStepProps = {
|
|
34
|
-
type: WorkspaceType
|
|
35
|
-
canChooseFolder: boolean
|
|
36
|
-
isPending: boolean
|
|
37
|
-
errorMessage?: string
|
|
38
|
-
onTypeChange: (type: WorkspaceType) => void
|
|
39
|
-
onUseExisting: () => void
|
|
40
|
-
onContinue: () => void
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function WorkspaceAgentStep({
|
|
44
|
-
type,
|
|
45
|
-
canChooseFolder,
|
|
46
|
-
isPending,
|
|
47
|
-
errorMessage,
|
|
48
|
-
onTypeChange,
|
|
49
|
-
onUseExisting,
|
|
50
|
-
onContinue
|
|
51
|
-
}: WorkspaceAgentStepProps) {
|
|
52
|
-
return (
|
|
53
|
-
<div className="flex flex-col gap-5">
|
|
54
|
-
<div className="flex flex-col gap-0.5 pr-8">
|
|
55
|
-
<DialogTitle>Choose agent</DialogTitle>
|
|
56
|
-
<DialogDescription>It will be used to build your workspace</DialogDescription>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<div role="group" aria-label="Agent" className="grid grid-cols-2 gap-2">
|
|
60
|
-
{WORKSPACE_AGENT_OPTIONS.map(option => (
|
|
61
|
-
<WorkspaceAgentOptionButton
|
|
62
|
-
key={option.type}
|
|
63
|
-
option={option}
|
|
64
|
-
selected={type === option.type}
|
|
65
|
-
onSelect={onTypeChange}
|
|
66
|
-
/>
|
|
67
|
-
))}
|
|
68
|
-
</div>
|
|
69
|
-
|
|
70
|
-
{errorMessage && (
|
|
71
|
-
<p role="alert" className="text-xs text-destructive">
|
|
72
|
-
{errorMessage}
|
|
73
|
-
</p>
|
|
74
|
-
)}
|
|
75
|
-
|
|
76
|
-
<div className="flex items-center justify-end gap-2">
|
|
77
|
-
<ExistingFolderButton
|
|
78
|
-
available={canChooseFolder}
|
|
79
|
-
disabled={isPending}
|
|
80
|
-
onClick={onUseExisting}
|
|
81
|
-
/>
|
|
82
|
-
<Button onClick={onContinue} disabled={isPending}>
|
|
83
|
-
Next
|
|
84
|
-
</Button>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
type WorkspaceNameStepProps = {
|
|
91
|
-
name: string
|
|
92
|
-
validationError: string | null
|
|
93
|
-
requestError?: string
|
|
94
|
-
isPending: boolean
|
|
95
|
-
onNameChange: (name: string) => void
|
|
96
|
-
onSubmit: () => void
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function WorkspaceNameStep({
|
|
100
|
-
name,
|
|
101
|
-
validationError,
|
|
102
|
-
requestError,
|
|
103
|
-
isPending,
|
|
104
|
-
onNameChange,
|
|
105
|
-
onSubmit
|
|
106
|
-
}: WorkspaceNameStepProps) {
|
|
107
|
-
function handleSubmit(event: FormEvent<HTMLFormElement>) {
|
|
108
|
-
event.preventDefault()
|
|
109
|
-
onSubmit()
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return (
|
|
113
|
-
<form className="flex flex-col gap-5" onSubmit={handleSubmit}>
|
|
114
|
-
<div className="flex flex-col gap-0.5 pr-8">
|
|
115
|
-
<DialogTitle>Name workspace</DialogTitle>
|
|
116
|
-
<DialogDescription>Keep it short and recognizable</DialogDescription>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
<div className="flex flex-col gap-2">
|
|
120
|
-
<label htmlFor="workspace-name" className="sr-only">
|
|
121
|
-
Workspace name
|
|
122
|
-
</label>
|
|
123
|
-
<Input
|
|
124
|
-
id="workspace-name"
|
|
125
|
-
value={name}
|
|
126
|
-
onChange={event => onNameChange(event.target.value)}
|
|
127
|
-
placeholder="my-workspace"
|
|
128
|
-
autoFocus
|
|
129
|
-
aria-invalid={Boolean(validationError)}
|
|
130
|
-
aria-describedby={validationError ? 'workspace-name-error' : undefined}
|
|
131
|
-
autoComplete="off"
|
|
132
|
-
spellCheck={false}
|
|
133
|
-
/>
|
|
134
|
-
{validationError && (
|
|
135
|
-
<p id="workspace-name-error" role="alert" className="text-xs text-destructive">
|
|
136
|
-
{validationError}
|
|
137
|
-
</p>
|
|
138
|
-
)}
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
{requestError && (
|
|
142
|
-
<p role="alert" className="text-xs text-destructive">
|
|
143
|
-
{requestError}
|
|
144
|
-
</p>
|
|
145
|
-
)}
|
|
146
|
-
|
|
147
|
-
<div className="flex items-center justify-end gap-2">
|
|
148
|
-
<Button type="submit" disabled={!name.trim() || Boolean(validationError) || isPending}>
|
|
149
|
-
{isPending ? 'Creating…' : `Create workspace`}
|
|
150
|
-
</Button>
|
|
151
|
-
</div>
|
|
152
|
-
</form>
|
|
153
|
-
)
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
type WorkspaceAgentOptionButtonProps = {
|
|
157
|
-
option: WorkspaceAgentOption
|
|
158
|
-
selected: boolean
|
|
159
|
-
onSelect: (type: WorkspaceType) => void
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function WorkspaceAgentOptionButton({
|
|
163
|
-
option,
|
|
164
|
-
selected,
|
|
165
|
-
onSelect
|
|
166
|
-
}: WorkspaceAgentOptionButtonProps) {
|
|
167
|
-
return (
|
|
168
|
-
<button
|
|
169
|
-
type="button"
|
|
170
|
-
disabled={option.disabled}
|
|
171
|
-
onClick={() => onSelect(option.type)}
|
|
172
|
-
aria-pressed={selected}
|
|
173
|
-
className={cn(
|
|
174
|
-
'relative flex w-full flex-col items-start justify-between gap-6 rounded-lg bg-card p-4 text-left ring-1 ring-border transition-shadow outline-none focus-visible:ring-3 focus-visible:ring-ring/50',
|
|
175
|
-
!selected && !option.disabled && 'cursor-pointer',
|
|
176
|
-
option.disabled && 'cursor-not-allowed opacity-50'
|
|
177
|
-
)}
|
|
178
|
-
>
|
|
179
|
-
<span className="relative inline-flex">
|
|
180
|
-
<WorkspaceTypeIcon type={option.type} className="size-10" />
|
|
181
|
-
{selected && (
|
|
182
|
-
<IconCircleCheckFilled
|
|
183
|
-
size={20}
|
|
184
|
-
stroke={1.5}
|
|
185
|
-
aria-hidden="true"
|
|
186
|
-
className="absolute -top-1.5 -right-1.5"
|
|
187
|
-
/>
|
|
188
|
-
)}
|
|
189
|
-
</span>
|
|
190
|
-
<span className="flex min-w-0 flex-col gap-0.5">
|
|
191
|
-
<span className="text-sm font-medium text-foreground">
|
|
192
|
-
{workspaceTypeLabel[option.type]}
|
|
193
|
-
</span>
|
|
194
|
-
<span className="text-xs leading-4 text-muted-foreground">{option.hint}</span>
|
|
195
|
-
</span>
|
|
196
|
-
</button>
|
|
197
|
-
)
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
type ExistingFolderButtonProps = {
|
|
201
|
-
available: boolean
|
|
202
|
-
disabled: boolean
|
|
203
|
-
onClick: () => void
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function ExistingFolderButton({ available, disabled, onClick }: ExistingFolderButtonProps) {
|
|
207
|
-
if (available) {
|
|
208
|
-
return (
|
|
209
|
-
<Button variant="secondary" onClick={onClick} disabled={disabled}>
|
|
210
|
-
Use existing folder
|
|
211
|
-
</Button>
|
|
212
|
-
)
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return (
|
|
216
|
-
<Tooltip delay={50}>
|
|
217
|
-
<TooltipTrigger
|
|
218
|
-
render={
|
|
219
|
-
<Button
|
|
220
|
-
variant="secondary"
|
|
221
|
-
aria-disabled
|
|
222
|
-
onClick={event => event.preventDefault()}
|
|
223
|
-
className="cursor-not-allowed opacity-50"
|
|
224
|
-
>
|
|
225
|
-
Use existing folder
|
|
226
|
-
</Button>
|
|
227
|
-
}
|
|
228
|
-
/>
|
|
229
|
-
<TooltipContent className="max-w-64 text-center">
|
|
230
|
-
Run <code className="font-mono">moi init</code> in the folder to add it manually.
|
|
231
|
-
</TooltipContent>
|
|
232
|
-
</Tooltip>
|
|
233
|
-
)
|
|
234
|
-
}
|