moi-computer 0.12.1-next.2 → 0.12.1-next.4
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/bunfig.toml +1 -5
- package/client/api/app-config.ts +1 -2
- package/client/api/app-ui-keys.ts +3 -1
- package/client/api/http.ts +4 -1
- package/client/api/workspace-keys.ts +3 -3
- package/client/app/app-provider.tsx +22 -2
- package/client/app/app-router.tsx +6 -0
- package/client/app/routes/home-route.tsx +14 -0
- package/client/app/routes/onboarding-route.tsx +11 -0
- package/client/app/routes/settings-route.tsx +10 -0
- package/client/app/routes/workspace-route.tsx +21 -19
- package/client/app/shell/sidebar-layout.tsx +34 -53
- package/client/components/shared/screen-shell.tsx +23 -0
- package/client/components/shared/ultrafast-icon.tsx +61 -0
- package/client/components/shared/workspace-icon.tsx +2 -2
- package/client/features/account/account-menu.tsx +96 -0
- package/client/features/account/account-provider.tsx +142 -0
- package/client/features/account/account-test-utils.tsx +294 -0
- package/client/features/account/api.ts +142 -0
- package/client/features/account/identity.ts +23 -0
- package/client/features/app-settings/api.ts +33 -0
- package/client/features/app-settings/general-settings.tsx +39 -0
- package/client/features/app-settings/profile-settings.tsx +95 -0
- package/client/features/app-settings/settings-page.tsx +48 -0
- package/client/features/app-settings/settings-section.tsx +26 -0
- package/client/features/app-settings/users-settings.tsx +195 -0
- package/client/features/chat/applet-chat-intents.ts +4 -20
- package/client/features/chat/chat-send.ts +17 -13
- package/client/features/chat/composer/model-order.ts +8 -4
- package/client/features/chat/composer/model-picker.tsx +88 -34
- package/client/features/chat/composer/use-workspace-composer-state.tsx +11 -3
- package/client/features/chat/composer/use-workspace-skill-updates.ts +1 -1
- package/client/features/chat/connection/chat-frames.ts +3 -15
- package/client/features/chat/messages/chat-empty-state.tsx +1 -4
- package/client/features/chat/messages/fork-history.ts +5 -5
- package/client/features/chat/messages/turn-view.tsx +3 -12
- package/client/features/chat/messages/user-message-bubble.tsx +63 -0
- package/client/features/chat/sessions/api.ts +121 -80
- package/client/features/chat/sessions/browser-tab-state.ts +14 -12
- package/client/features/chat/sessions/chat-selector.tsx +5 -6
- package/client/features/chat/sessions/use-selected-session.ts +172 -257
- package/client/features/chat/use-chat.ts +14 -19
- package/client/features/collab/applet-api.ts +15 -14
- package/client/features/collab/components/cursors.tsx +61 -24
- package/client/features/collab/components/presence-avatars.tsx +25 -12
- package/client/features/collab/components/presence-frame.tsx +20 -24
- package/client/features/collab/components/presence-group.tsx +15 -7
- package/client/features/collab/components/user-avatar-group.tsx +21 -8
- package/client/features/collab/components/user-avatar.tsx +38 -7
- package/client/features/collab/components/user.tsx +31 -12
- package/client/features/collab/users.ts +0 -5
- package/client/features/collab/workspace-users-menu.tsx +4 -4
- package/client/features/demo/demo-dialog.tsx +11 -3
- package/client/features/dev/collab/collab-playground.tsx +7 -7
- package/client/features/dev/collab/local-user-settings.tsx +7 -53
- package/client/features/dev/dev-index-page.tsx +5 -0
- package/client/features/dev/dev-routes.tsx +2 -0
- package/client/features/dev/harness-debug-page.tsx +3 -3
- package/client/features/dev/onboarding-preview-page.tsx +76 -0
- package/client/features/dev/workspace-setup-mocks.ts +16 -14
- package/client/features/dev/workspace-setup-preview.tsx +11 -17
- package/client/features/harness/api.ts +45 -15
- package/client/features/harness/device-login-steps.tsx +9 -3
- package/client/features/harness/harness-login-panel.tsx +228 -0
- package/client/features/harness/harness-presentation.ts +15 -0
- package/client/features/harness/harness-selector.tsx +119 -0
- package/client/features/harness/use-harness-login.ts +77 -0
- package/client/features/home/home-page.tsx +7 -7
- package/client/features/onboarding/agent-setup-step.tsx +57 -0
- package/client/features/onboarding/api.ts +42 -0
- package/client/features/onboarding/onboarding-idea-disk.tsx +129 -0
- package/client/features/onboarding/onboarding-page.tsx +32 -0
- package/client/features/onboarding/onboarding-screen.tsx +20 -0
- package/client/features/onboarding/onboarding-status.tsx +24 -0
- package/client/features/onboarding/workspace-setup-step.tsx +239 -0
- package/client/features/overview/default/registry.tsx +2 -2
- package/client/features/overview/default/views-widget.tsx +6 -5
- package/client/features/overview/overview.tsx +9 -11
- package/client/features/overview/widget-canvas.tsx +1 -1
- package/client/features/overview/workspace-name.tsx +2 -2
- package/client/features/update/update-control.tsx +1 -1
- package/client/features/views/api.ts +69 -16
- package/client/features/views/pending-view-screen.tsx +30 -9
- package/client/features/views/use-view-actions.ts +19 -20
- package/client/features/views/view-presentation.ts +2 -2
- package/client/features/views/view-submission.ts +28 -41
- package/client/features/workspace/add/api.ts +3 -23
- package/client/features/workspace/add/create-workspace-dialog.tsx +11 -7
- package/client/features/workspace/add/import-workspace-dialog.tsx +3 -3
- package/client/features/workspace/add/workspace-agent-options.ts +11 -12
- package/client/features/workspace/add/workspace-agent-selector.tsx +3 -132
- package/client/features/workspace/api.ts +32 -36
- package/client/features/workspace/harness-transition.ts +88 -0
- package/client/features/{settings → workspace/settings}/api.ts +1 -34
- package/client/features/{settings → workspace/settings}/connectors-settings.tsx +3 -3
- package/client/features/{settings → workspace/settings}/environment-settings.tsx +3 -3
- package/client/features/{settings → workspace/settings}/general-settings.tsx +77 -3
- package/client/features/{settings → workspace/settings}/use-env-vars.ts +1 -1
- package/client/features/{settings → workspace/settings}/workspace-icon-picker.tsx +3 -3
- package/client/features/workspace/setup/workspace-login-state.tsx +37 -156
- package/client/features/workspace/setup/workspace-recovery-states.tsx +0 -12
- package/client/features/workspace/setup/workspace-setup.tsx +34 -14
- package/client/features/workspace/setup/workspace-welcome-state.tsx +2 -2
- package/client/features/workspace/use-workspace-navigation.ts +25 -9
- package/client/features/workspace/workspace-content.tsx +11 -8
- package/client/features/workspace/workspace-frame.tsx +2 -1
- package/client/features/workspace/workspace-layout-context.tsx +5 -2
- package/client/features/workspace/workspace-menu.tsx +12 -8
- package/client/features/workspace/workspace-pending-screen.tsx +10 -10
- package/client/features/workspace/workspace-presentation.tsx +5 -13
- package/client/features/workspace/workspace-state.ts +169 -0
- package/client/features/workspace/workspace-tabs.tsx +22 -2
- package/client/index.css +2 -0
- package/client/index.tsx +3 -3
- package/client/lib/flags.ts +1 -1
- package/client/lib/{app-icon-registry.ts → identity-icon-registry.ts} +10 -14
- package/client/lib/user-display-name.ts +6 -0
- package/client/main.tsx +4 -1
- package/client/runtime/workspace-events.ts +21 -4
- package/client/runtime/workspace-theme.ts +9 -0
- package/client/tailwind-config.ts +43 -0
- package/dist/chunk-0mjzg20x.js +2 -0
- package/dist/chunk-2y59vrxg.js +5 -0
- package/dist/chunk-58dyt9bk.js +2 -0
- package/dist/chunk-5aj040e5.css +1 -0
- package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
- package/dist/chunk-71fn6rmj.js +546 -0
- package/dist/chunk-7yg1m8hx.js +2 -0
- package/dist/chunk-825hys3h.js +1 -0
- package/dist/chunk-9bb8m9rx.js +2 -0
- package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
- package/dist/chunk-g0tcwqxc.js +1 -0
- package/dist/chunk-n0nab26d.js +1 -0
- package/dist/chunk-nf2wkvf9.js +14 -0
- package/dist/chunk-v88n1bay.js +74 -0
- package/dist/index.html +1 -1
- package/lib/harness-instructions.ts +1 -1
- package/lib/{app-icons.ts → identity-icons.ts} +6 -7
- package/lib/onboarding.ts +41 -0
- package/lib/speed-mode.ts +5 -0
- package/lib/types.ts +72 -63
- package/lib/view-build-directives.ts +1 -2
- package/lib/workspace-icon.ts +2 -2
- package/lib/workspace-layout.ts +1 -1
- package/lib/workspace-name.ts +15 -12
- package/package.json +9 -8
- package/server/README.md +27 -25
- package/server/api/harnesses.ts +31 -8
- package/server/api/index.ts +164 -131
- package/server/api/onboarding.ts +46 -0
- package/server/app-config.ts +23 -24
- package/server/app-settings.ts +6 -2
- package/server/applets/config.ts +5 -5
- package/server/applets/views.ts +19 -17
- package/server/cli/commands/init.ts +3 -3
- package/server/cli/commands/skill.ts +16 -17
- package/server/cli/commands/start.ts +8 -34
- package/server/cli/server.ts +18 -6
- package/server/collab/config.ts +1 -2
- package/server/collab/manager.ts +4 -1
- package/server/collab/skill/index.ts +1 -1
- package/server/control.ts +3 -3
- package/server/data-dir.ts +1 -1
- package/server/harness/README.md +24 -8
- package/server/harness/acp/session.ts +8 -4
- package/server/harness/auth.ts +14 -17
- package/server/harness/claude-code/NOTES.md +4 -3
- package/server/harness/claude-code/index.ts +2 -0
- package/server/harness/claude-code/models.ts +2 -20
- package/server/harness/claude-code/run-action.ts +123 -0
- package/server/harness/claude-code/session-title.ts +5 -7
- package/server/harness/claude-code/session.ts +24 -16
- package/server/harness/codex/NOTES.md +14 -9
- package/server/harness/codex/adapter.ts +14 -17
- package/server/harness/codex/index.ts +2 -0
- package/server/harness/codex/run-action.ts +93 -0
- package/server/harness/codex/session-title.ts +6 -8
- package/server/harness/codex/session.ts +11 -11
- package/server/harness/command.ts +45 -0
- package/server/harness/executable.ts +5 -0
- package/server/harness/fork.ts +6 -4
- package/server/harness/install.ts +49 -0
- package/server/harness/openclaw/session.ts +1 -2
- package/server/harness/run-action.ts +85 -0
- package/server/harness/session-title.ts +0 -46
- package/server/harness/types.ts +26 -2
- package/server/onboarding/brief.ts +29 -0
- package/server/onboarding/ideas.ts +48 -0
- package/server/onboarding/jobs.ts +291 -0
- package/server/onboarding/prompt.md +49 -0
- package/server/sessions/archive.ts +5 -14
- package/server/sessions/config.ts +17 -16
- package/server/sessions/lifecycle.ts +15 -13
- package/server/sessions/pending-views.ts +79 -108
- package/server/sessions/selected.ts +75 -161
- package/server/sessions/store.ts +40 -113
- package/server/sessions/view-sessions.ts +128 -111
- package/server/skills/locations.ts +82 -0
- package/server/skills/lock.ts +29 -0
- package/server/skills/template.ts +36 -25
- package/server/skills/update.ts +52 -5
- package/server/skills/version.ts +17 -22
- package/server/skills/workspace.ts +121 -0
- package/server/web.ts +23 -8
- package/server/workspace-state/file.ts +177 -0
- package/server/workspace-state/index.ts +162 -0
- package/server/workspace-state/legacy-migration.ts +79 -0
- package/server/workspace-state/lock.ts +42 -0
- package/server/workspace-state/types.ts +16 -0
- package/server/workspaces/change-harness.ts +88 -0
- package/server/workspaces/harness-transition.ts +29 -0
- package/server/workspaces/init.ts +29 -16
- package/server/workspaces/layout.ts +3 -0
- package/server/workspaces/registry.ts +58 -10
- package/{workspace/.claude/skills/moi-workspace → skill}/SKILL.md +7 -5
- package/{workspace/.claude/skills/moi-workspace → skill}/references/COLLAB.md +4 -8
- package/skill/references/DESIGN.md +148 -0
- package/{workspace/.claude/skills/moi-workspace → skill}/references/SCRATCHPAD.md +2 -2
- package/{workspace/.claude/skills/moi-workspace → skill}/references/UI-COMPONENTS.md +3 -0
- package/ui-components/badge.tsx +1 -1
- package/client/accept-hmr-dependencies.ts +0 -22
- package/client/features/workspace/setup/workspace-setup-panel.tsx +0 -18
- package/dist/chunk-00rh9df4.js +0 -2
- package/dist/chunk-4nh7y1hq.css +0 -1
- package/dist/chunk-am4agx6v.js +0 -2
- package/dist/chunk-d7cbm65e.js +0 -2
- package/dist/chunk-hbpdv7vd.js +0 -1
- package/dist/chunk-hmka9rt5.js +0 -2
- package/dist/chunk-hvh9f5h0.js +0 -14
- package/dist/chunk-mjjregkn.js +0 -10
- package/dist/chunk-pcnahct1.js +0 -5
- package/dist/chunk-rt30jbcm.js +0 -1
- package/dist/chunk-vt6zybej.js +0 -2
- package/dist/chunk-wbkwf6cc.js +0 -68
- package/dist/chunk-xjyfyz64.js +0 -1
- package/dist/chunk-y8nbwp21.js +0 -546
- package/dist/chunk-ysfdcew7.js +0 -1
- package/lib/experimental.ts +0 -14
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +0 -157
- /package/client/features/{settings → workspace/settings}/icon-picker-options.ts +0 -0
- /package/client/features/{settings → workspace/settings}/settings-layout.tsx +0 -0
- /package/client/features/{settings → workspace/settings}/workspace-settings-dialog.tsx +0 -0
- /package/{workspace/.claude/skills/moi-workspace → skill}/references/INTENTS.md +0 -0
|
@@ -3,15 +3,16 @@ import { type ComponentProps, type ReactNode, memo, useState } from 'react'
|
|
|
3
3
|
import { AnimatePresence, motion } from 'motion/react'
|
|
4
4
|
|
|
5
5
|
import { IconBolt, IconBoltFilled } from '@tabler/icons-react'
|
|
6
|
+
import { IconUltrafast } from '@/client/components/shared/ultrafast-icon'
|
|
6
7
|
|
|
7
|
-
import { useSaveSessionConfig,
|
|
8
|
-
import {
|
|
8
|
+
import { useSaveSessionConfig, useSessionState } from '../sessions/api'
|
|
9
|
+
import { useWorkspaceHarness } from '@/client/features/workspace/api'
|
|
9
10
|
import {
|
|
10
11
|
groupModels,
|
|
11
12
|
hasEffortChoice,
|
|
12
13
|
resolveDisplayedEffort,
|
|
13
14
|
resolveEffortIndex,
|
|
14
|
-
|
|
15
|
+
resolveSpeedMode,
|
|
15
16
|
resolveSelectedModel,
|
|
16
17
|
sortModelsByProviderOrder
|
|
17
18
|
} from './model-order'
|
|
@@ -35,7 +36,7 @@ import { Slider } from '@/client/components/ui/slider'
|
|
|
35
36
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip'
|
|
36
37
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/workspace-layout-context'
|
|
37
38
|
import { cn } from '@/client/lib/cn'
|
|
38
|
-
import type { Model } from '@/lib/types'
|
|
39
|
+
import type { SpeedMode, Model } from '@/lib/types'
|
|
39
40
|
|
|
40
41
|
function capitalize(s: string): string {
|
|
41
42
|
return s.charAt(0).toUpperCase() + s.slice(1)
|
|
@@ -113,9 +114,39 @@ function ModelDropdown({ current, model, models, onValueChange }: ModelDropdownP
|
|
|
113
114
|
)
|
|
114
115
|
}
|
|
115
116
|
|
|
116
|
-
type
|
|
117
|
+
type SpeedModeToggleProps = {
|
|
118
|
+
speedMode: SpeedMode
|
|
119
|
+
supportsFastMode: boolean
|
|
120
|
+
supportsUltrafastMode: boolean
|
|
121
|
+
onChange: (value: SpeedMode) => void
|
|
122
|
+
}
|
|
117
123
|
|
|
118
|
-
function
|
|
124
|
+
function SpeedModeToggle({
|
|
125
|
+
speedMode,
|
|
126
|
+
supportsFastMode,
|
|
127
|
+
supportsUltrafastMode,
|
|
128
|
+
onChange
|
|
129
|
+
}: SpeedModeToggleProps) {
|
|
130
|
+
const nextMode =
|
|
131
|
+
speedMode === 'ultrafast'
|
|
132
|
+
? 'normal'
|
|
133
|
+
: speedMode === 'fast'
|
|
134
|
+
? supportsUltrafastMode
|
|
135
|
+
? 'ultrafast'
|
|
136
|
+
: 'normal'
|
|
137
|
+
: supportsFastMode
|
|
138
|
+
? 'fast'
|
|
139
|
+
: 'ultrafast'
|
|
140
|
+
const actionLabel =
|
|
141
|
+
nextMode === 'normal'
|
|
142
|
+
? `Disable ${speedMode === 'ultrafast' ? 'ultrafast' : 'fast'} mode`
|
|
143
|
+
: `Enable ${nextMode} mode`
|
|
144
|
+
const description =
|
|
145
|
+
nextMode === 'normal'
|
|
146
|
+
? 'Normal usage'
|
|
147
|
+
: nextMode === 'ultrafast'
|
|
148
|
+
? 'Much more usage'
|
|
149
|
+
: 'More usage'
|
|
119
150
|
return (
|
|
120
151
|
<Tooltip>
|
|
121
152
|
<TooltipTrigger
|
|
@@ -124,12 +155,14 @@ function FastModeToggle({ fastMode, onChange }: FastModeToggleProps) {
|
|
|
124
155
|
type="button"
|
|
125
156
|
variant="ghost"
|
|
126
157
|
size="icon-sm"
|
|
127
|
-
aria-label={
|
|
128
|
-
aria-pressed={
|
|
129
|
-
onClick={() => onChange(
|
|
158
|
+
aria-label={actionLabel}
|
|
159
|
+
aria-pressed={speedMode !== 'normal'}
|
|
160
|
+
onClick={() => onChange(nextMode)}
|
|
130
161
|
className="-my-1 -mr-1"
|
|
131
162
|
>
|
|
132
|
-
{
|
|
163
|
+
{speedMode === 'ultrafast' ? (
|
|
164
|
+
<IconUltrafast className="text-primary" stroke={1.75} />
|
|
165
|
+
) : speedMode === 'fast' ? (
|
|
133
166
|
<IconBoltFilled className="text-primary" stroke={1.75} />
|
|
134
167
|
) : (
|
|
135
168
|
<IconBolt className="text-muted-foreground" stroke={1.75} />
|
|
@@ -138,8 +171,8 @@ function FastModeToggle({ fastMode, onChange }: FastModeToggleProps) {
|
|
|
138
171
|
}
|
|
139
172
|
/>
|
|
140
173
|
<TooltipContent align="center" className="flex-col gap-0">
|
|
141
|
-
<span>
|
|
142
|
-
<span className="font-normal text-muted-foreground">
|
|
174
|
+
<span>{actionLabel}</span>
|
|
175
|
+
<span className="font-normal text-muted-foreground">{description}</span>
|
|
143
176
|
</TooltipContent>
|
|
144
177
|
</Tooltip>
|
|
145
178
|
)
|
|
@@ -148,18 +181,20 @@ function FastModeToggle({ fastMode, onChange }: FastModeToggleProps) {
|
|
|
148
181
|
type EffortPickerProps = {
|
|
149
182
|
currentEffort: string
|
|
150
183
|
effortLevels: readonly string[]
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
184
|
+
speedMode: SpeedMode
|
|
185
|
+
supportsFastMode: boolean
|
|
186
|
+
supportsUltrafastMode: boolean
|
|
187
|
+
onSpeedModeChange: (value: SpeedMode) => void
|
|
154
188
|
onValueChange: (value: string) => void
|
|
155
189
|
}
|
|
156
190
|
|
|
157
191
|
function EffortPicker({
|
|
158
192
|
currentEffort,
|
|
159
193
|
effortLevels,
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
194
|
+
speedMode,
|
|
195
|
+
supportsFastMode,
|
|
196
|
+
supportsUltrafastMode,
|
|
197
|
+
onSpeedModeChange,
|
|
163
198
|
onValueChange
|
|
164
199
|
}: EffortPickerProps) {
|
|
165
200
|
const currentIndex = resolveEffortIndex(effortLevels, currentEffort)
|
|
@@ -187,7 +222,13 @@ function EffortPicker({
|
|
|
187
222
|
render={
|
|
188
223
|
<PickerTrigger
|
|
189
224
|
label={displayedLabel}
|
|
190
|
-
leadingIcon={
|
|
225
|
+
leadingIcon={
|
|
226
|
+
speedMode === 'ultrafast' ? (
|
|
227
|
+
<IconUltrafast className="text-muted-foreground" stroke={1.5} />
|
|
228
|
+
) : speedMode === 'fast' ? (
|
|
229
|
+
<IconBoltFilled className="text-muted-foreground" stroke={1.5} />
|
|
230
|
+
) : undefined
|
|
231
|
+
}
|
|
191
232
|
aria-label={`Effort: ${displayedLabel}`}
|
|
192
233
|
/>
|
|
193
234
|
}
|
|
@@ -223,7 +264,14 @@ function EffortPicker({
|
|
|
223
264
|
<span className="text-muted-foreground">Effort</span>
|
|
224
265
|
<output aria-live="polite">{displayedLabel}</output>
|
|
225
266
|
</div>
|
|
226
|
-
{
|
|
267
|
+
{(supportsFastMode || supportsUltrafastMode) && (
|
|
268
|
+
<SpeedModeToggle
|
|
269
|
+
speedMode={speedMode}
|
|
270
|
+
supportsFastMode={supportsFastMode}
|
|
271
|
+
supportsUltrafastMode={supportsUltrafastMode}
|
|
272
|
+
onChange={onSpeedModeChange}
|
|
273
|
+
/>
|
|
274
|
+
)}
|
|
227
275
|
</motion.div>
|
|
228
276
|
)}
|
|
229
277
|
</AnimatePresence>
|
|
@@ -277,12 +325,12 @@ type ModelPickerProps = {
|
|
|
277
325
|
}
|
|
278
326
|
|
|
279
327
|
// Model selector for composer surfaces. The workspace's available models come
|
|
280
|
-
// from `/api/workspaces/:id/
|
|
328
|
+
// from `/api/workspaces/:id/harness`; effort options follow the selected model.
|
|
281
329
|
// A session id targets that chat's stored config. Null targets the workspace
|
|
282
330
|
// defaults that seed new chats such as the pending view.
|
|
283
331
|
export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerProps) {
|
|
284
332
|
const { workspaceId, layout, setLayout } = useWorkspaceLayoutCtx()
|
|
285
|
-
const { data } =
|
|
333
|
+
const { data } = useWorkspaceHarness(workspaceId)
|
|
286
334
|
|
|
287
335
|
// The SDK prepends a synthetic "default" entry ("Use the default model
|
|
288
336
|
// (currently …)"). Drop it and name the concrete model it resolves to.
|
|
@@ -295,13 +343,13 @@ export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerP
|
|
|
295
343
|
)
|
|
296
344
|
: []
|
|
297
345
|
|
|
298
|
-
const sessionConfig =
|
|
346
|
+
const sessionConfig = useSessionState(workspaceId, sessionId).data?.config
|
|
299
347
|
const saveSessionConfig = useSaveSessionConfig(workspaceId)
|
|
300
348
|
|
|
301
349
|
const selectedModel = (sessionId ? sessionConfig?.model : undefined) ?? layout.selectedModel
|
|
302
350
|
const selectedEffort = (sessionId ? sessionConfig?.effort : undefined) ?? layout.selectedEffort
|
|
303
|
-
const
|
|
304
|
-
(sessionId ? sessionConfig?.
|
|
351
|
+
const selectedSpeedMode =
|
|
352
|
+
(sessionId ? sessionConfig?.speedMode : undefined) ?? layout.selectedSpeedMode
|
|
305
353
|
|
|
306
354
|
const setSelectedModel = (value: string) => {
|
|
307
355
|
if (sessionId) saveSessionConfig.mutate({ sessionId, patch: { model: value } })
|
|
@@ -313,9 +361,9 @@ export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerP
|
|
|
313
361
|
else setLayout({ selectedEffort: value })
|
|
314
362
|
}
|
|
315
363
|
|
|
316
|
-
const
|
|
317
|
-
if (sessionId) saveSessionConfig.mutate({ sessionId, patch: {
|
|
318
|
-
else setLayout({
|
|
364
|
+
const setSelectedSpeedMode = (value: SpeedMode) => {
|
|
365
|
+
if (sessionId) saveSessionConfig.mutate({ sessionId, patch: { speedMode: value } })
|
|
366
|
+
else setLayout({ selectedSpeedMode: value })
|
|
319
367
|
}
|
|
320
368
|
|
|
321
369
|
const model = resolveSelectedModel(models, selectedModel, defaultEntry?.resolvedModel)
|
|
@@ -323,7 +371,7 @@ export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerP
|
|
|
323
371
|
const effortLevels = model.supportsEffort ? (model.supportedEffortLevels ?? []) : []
|
|
324
372
|
const currentEffort = resolveDisplayedEffort(effortLevels, selectedEffort, model.defaultEffort)
|
|
325
373
|
const showEffort = hasEffortChoice(effortLevels) && currentEffort !== undefined
|
|
326
|
-
const
|
|
374
|
+
const speedMode = resolveSpeedMode(model, selectedSpeedMode)
|
|
327
375
|
|
|
328
376
|
return (
|
|
329
377
|
<div className="flex min-w-0 items-center gap-1">
|
|
@@ -333,17 +381,23 @@ export const ModelPicker = memo(function ModelPicker({ sessionId }: ModelPickerP
|
|
|
333
381
|
models={models}
|
|
334
382
|
onValueChange={setSelectedModel}
|
|
335
383
|
/>
|
|
336
|
-
{!showEffort && model.supportsFastMode && (
|
|
337
|
-
<
|
|
384
|
+
{!showEffort && (model.supportsFastMode || model.supportsUltrafastMode) && (
|
|
385
|
+
<SpeedModeToggle
|
|
386
|
+
speedMode={speedMode}
|
|
387
|
+
supportsFastMode={model.supportsFastMode === true}
|
|
388
|
+
supportsUltrafastMode={model.supportsUltrafastMode === true}
|
|
389
|
+
onChange={setSelectedSpeedMode}
|
|
390
|
+
/>
|
|
338
391
|
)}
|
|
339
392
|
{showEffort && (
|
|
340
393
|
<EffortPicker
|
|
341
394
|
key={model.value}
|
|
342
395
|
currentEffort={currentEffort}
|
|
343
396
|
effortLevels={effortLevels}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
397
|
+
speedMode={speedMode}
|
|
398
|
+
supportsFastMode={model.supportsFastMode === true}
|
|
399
|
+
supportsUltrafastMode={model.supportsUltrafastMode === true}
|
|
400
|
+
onSpeedModeChange={setSelectedSpeedMode}
|
|
347
401
|
onValueChange={setSelectedEffort}
|
|
348
402
|
/>
|
|
349
403
|
)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useHarnessStatus } from '@/client/features/harness/api'
|
|
2
|
+
import { useWorkspaceHarness } from '@/client/features/workspace/api'
|
|
2
3
|
import { resolveAgentAvailability, type AgentAvailability } from '@/client/lib/agent-availability'
|
|
3
4
|
|
|
4
5
|
import { ErrorBanner } from './banners/error-banner'
|
|
@@ -23,8 +24,15 @@ export function useWorkspaceComposerState(
|
|
|
23
24
|
workspaceId: string,
|
|
24
25
|
{ chatError, onDismissChatError, chatLoadError, onRetryChatLoad }: WorkspaceComposerStateOptions
|
|
25
26
|
): WorkspaceComposerState {
|
|
26
|
-
const
|
|
27
|
-
const
|
|
27
|
+
const workspace = useWorkspaceHarness(workspaceId)
|
|
28
|
+
const harness = workspace.data
|
|
29
|
+
const status = useHarnessStatus(
|
|
30
|
+
harness?.hasAuthOverrides || harness?.isFolderMissing ? undefined : harness?.provider
|
|
31
|
+
)
|
|
32
|
+
const readiness = status.isEnabled ? status : workspace
|
|
33
|
+
const error = readiness.error ?? workspace.error
|
|
34
|
+
const refetch = workspace.isError ? workspace.refetch : readiness.refetch
|
|
35
|
+
const availability = readiness.data?.availability
|
|
28
36
|
const { bannerProps: skillUpdateBanner } = useWorkspaceSkillUpdates(workspaceId)
|
|
29
37
|
const agentAvailability = resolveAgentAvailability(availability, Boolean(error))
|
|
30
38
|
// Recovery hides chat. Only checks that leave the workspace visible need a banner.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { useAppSettings, useSaveAppSettings } from '@/client/features/settings/api'
|
|
3
|
+
import { useAppSettings, useSaveAppSettings } from '@/client/features/app-settings/api'
|
|
4
4
|
import { useUpdateWorkspaceSkills, useWorkspaceSkills } from '@/client/features/workspace/api'
|
|
5
5
|
|
|
6
6
|
import type {
|
|
@@ -12,8 +12,7 @@ import type {
|
|
|
12
12
|
PreviewFrame,
|
|
13
13
|
ScratchOp,
|
|
14
14
|
SessionActivity,
|
|
15
|
-
|
|
16
|
-
SessionInfo,
|
|
15
|
+
SessionSummary,
|
|
17
16
|
StreamEvent,
|
|
18
17
|
ViewState
|
|
19
18
|
} from '@/lib/types'
|
|
@@ -62,7 +61,7 @@ export function reduceChatFrame(data: Record<string, unknown>, context: ChatFram
|
|
|
62
61
|
const from = data.from as string
|
|
63
62
|
const to = data.to as string
|
|
64
63
|
const sessionsKey = workspaceKeys.sessions(workspaceId)
|
|
65
|
-
const cachedSessions = queryClient?.getQueryData<
|
|
64
|
+
const cachedSessions = queryClient?.getQueryData<SessionSummary[]>(sessionsKey)
|
|
66
65
|
const cachedSession = cachedSessions?.find(
|
|
67
66
|
session => session.sessionId === from || session.sessionId === to
|
|
68
67
|
)
|
|
@@ -72,7 +71,7 @@ export function reduceChatFrame(data: Record<string, unknown>, context: ChatFram
|
|
|
72
71
|
store.renameSession(workspaceId, from, to)
|
|
73
72
|
if (queryClient) renameSelectedSessionInCache(queryClient, workspaceId, from, to)
|
|
74
73
|
if (cachedSession) {
|
|
75
|
-
queryClient?.setQueryData<
|
|
74
|
+
queryClient?.setQueryData<SessionSummary[]>(sessionsKey, current => [
|
|
76
75
|
{
|
|
77
76
|
...cachedSession,
|
|
78
77
|
sessionId: to
|
|
@@ -89,13 +88,6 @@ export function reduceChatFrame(data: Record<string, unknown>, context: ChatFram
|
|
|
89
88
|
queryClient?.removeQueries({ queryKey: workspaceKeys.events(workspaceId, from) })
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
const previousSession = queryClient?.getQueryData<SessionRecord>(
|
|
93
|
-
workspaceKeys.session(workspaceId, from)
|
|
94
|
-
)
|
|
95
|
-
if (previousSession !== undefined) {
|
|
96
|
-
queryClient?.setQueryData(workspaceKeys.session(workspaceId, to), previousSession)
|
|
97
|
-
queryClient?.removeQueries({ queryKey: workspaceKeys.session(workspaceId, from) })
|
|
98
|
-
}
|
|
99
91
|
if (!cachedSession) {
|
|
100
92
|
queryClient?.invalidateQueries({ queryKey: sessionsKey })
|
|
101
93
|
}
|
|
@@ -109,10 +101,6 @@ export function reduceChatFrame(data: Record<string, unknown>, context: ChatFram
|
|
|
109
101
|
const sessionsKey = workspaceKeys.sessions(workspaceId)
|
|
110
102
|
queryClient?.invalidateQueries({ queryKey: sessionsKey })
|
|
111
103
|
queryClient?.invalidateQueries({ queryKey: workspaceKeys.previews })
|
|
112
|
-
if (typeof data.sessionId === 'string')
|
|
113
|
-
queryClient?.invalidateQueries({
|
|
114
|
-
queryKey: workspaceKeys.session(workspaceId, data.sessionId)
|
|
115
|
-
})
|
|
116
104
|
return
|
|
117
105
|
}
|
|
118
106
|
if (data.type === 'workspace:switch') {
|
|
@@ -202,10 +202,7 @@ function WelcomeState({
|
|
|
202
202
|
<EmptyStateFrame agent={agent} className="@container w-full max-w-md min-w-0">
|
|
203
203
|
<div className="mt-2 flex flex-col gap-4">
|
|
204
204
|
<div className="prose prose-sm min-w-0 wrap-anywhere prose-inherit">
|
|
205
|
-
<p>
|
|
206
|
-
Moi is the personal workspace built for you by your agent. It grows and adapts to your
|
|
207
|
-
needs.
|
|
208
|
-
</p>
|
|
205
|
+
<p>Moi is the personal workspace that grows and adapts to your needs.</p>
|
|
209
206
|
<p>
|
|
210
207
|
Ask the agent to build widgets on the{' '}
|
|
211
208
|
<WelcomeTerm Icon={IconLayout2} destination="overview" onNavigate={onNavigate}>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SessionFork, ViewState } from '@/lib/types'
|
|
2
2
|
|
|
3
|
-
export function visibleForkHistory(view: ViewState,
|
|
4
|
-
if (!
|
|
5
|
-
const cutoff =
|
|
3
|
+
export function visibleForkHistory(view: ViewState, fork?: SessionFork): ViewState {
|
|
4
|
+
if (!fork?.throughMessageId) return view
|
|
5
|
+
const cutoff = fork.throughMessageId
|
|
6
6
|
const index = view.turns.findIndex(turn => turn.id === cutoff)
|
|
7
7
|
if (index < 0) return view
|
|
8
|
-
const forkedNoticeIds = new Set(
|
|
8
|
+
const forkedNoticeIds = new Set(fork.noticeIds)
|
|
9
9
|
return {
|
|
10
10
|
...view,
|
|
11
11
|
turns: view.turns.slice(index + 1),
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
CollapsibleTrigger
|
|
12
12
|
} from '@/client/components/ui/collapsible'
|
|
13
13
|
import { MarkdownContent } from '@/client/features/chat/messages/markdown-content'
|
|
14
|
+
import { UserMessageBubble } from './user-message-bubble'
|
|
14
15
|
import { ToolCallGroup } from '@/client/features/chat/messages/tool-group/tool-call-group'
|
|
15
16
|
import { formatDuration } from '@/client/features/chat/messages/tool-group/format'
|
|
16
17
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/workspace-layout-context'
|
|
17
|
-
import { cn } from '@/client/lib/cn'
|
|
18
18
|
|
|
19
19
|
// A part either folds into a tool-group "run" (reasoning + tool calls — including
|
|
20
20
|
// subagents and skills, which render as their own timeline rows) or stands alone
|
|
@@ -163,7 +163,7 @@ export const TurnView = memo(function TurnView({ turn, processing = false }: Tur
|
|
|
163
163
|
const cwd = useWorkspaceLayoutCtx().cwd
|
|
164
164
|
|
|
165
165
|
if (turn.role === 'user' && turn.origin.kind === 'user-input') {
|
|
166
|
-
//
|
|
166
|
+
// User input — right-aligned. Attachments (images/files) stack above
|
|
167
167
|
// the text bubble.
|
|
168
168
|
const fileParts = turn.parts.filter(
|
|
169
169
|
(p): p is Extract<Part, { type: 'file-attachment' }> => p.type === 'file-attachment'
|
|
@@ -182,16 +182,7 @@ export const TurnView = memo(function TurnView({ turn, processing = false }: Tur
|
|
|
182
182
|
{fileParts.map((p, i) => (
|
|
183
183
|
<FilePart key={i} mediaType={p.mediaType} previewUrl={p.previewUrl} label={p.label} />
|
|
184
184
|
))}
|
|
185
|
-
{text &&
|
|
186
|
-
<p
|
|
187
|
-
className={cn(
|
|
188
|
-
'max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere whitespace-pre-wrap text-primary-foreground',
|
|
189
|
-
'inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]'
|
|
190
|
-
)}
|
|
191
|
-
>
|
|
192
|
-
{text}
|
|
193
|
-
</p>
|
|
194
|
-
)}
|
|
185
|
+
{text && <UserMessageBubble content={text} />}
|
|
195
186
|
</div>
|
|
196
187
|
)
|
|
197
188
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useId, useRef, useState } from 'react'
|
|
2
|
+
import { IconChevronDown, IconChevronUp } from '@tabler/icons-react'
|
|
3
|
+
import { Button } from '@/client/components/ui/button'
|
|
4
|
+
import { cn } from '@/client/lib/cn'
|
|
5
|
+
import { MarkdownContent } from './markdown-content'
|
|
6
|
+
|
|
7
|
+
type UserMessageBubbleProps = { content: string }
|
|
8
|
+
|
|
9
|
+
export function UserMessageBubble({ content }: UserMessageBubbleProps) {
|
|
10
|
+
const [expanded, setExpanded] = useState(false)
|
|
11
|
+
const [overflowing, setOverflowing] = useState(false)
|
|
12
|
+
const viewportRef = useRef<HTMLDivElement>(null)
|
|
13
|
+
const contentRef = useRef<HTMLDivElement>(null)
|
|
14
|
+
const contentId = useId()
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const viewport = viewportRef.current
|
|
18
|
+
const body = contentRef.current
|
|
19
|
+
if (!viewport || !body) return
|
|
20
|
+
const measure = () => {
|
|
21
|
+
// Keep the toggle while expanded; measure again after collapsing.
|
|
22
|
+
if (!expanded) setOverflowing(body.scrollHeight > viewport.clientHeight + 1)
|
|
23
|
+
}
|
|
24
|
+
measure()
|
|
25
|
+
const observer = new ResizeObserver(measure)
|
|
26
|
+
observer.observe(body)
|
|
27
|
+
observer.observe(viewport)
|
|
28
|
+
return () => observer.disconnect()
|
|
29
|
+
}, [content, expanded])
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div className="max-w-full min-w-0 rounded-lg bg-primary px-3 py-2 text-sm leading-normal wrap-anywhere text-primary-foreground inset-shadow-[0_0_10px_color-mix(in_oklab,var(--color-white)_30%,transparent)]">
|
|
33
|
+
<div
|
|
34
|
+
id={contentId}
|
|
35
|
+
ref={viewportRef}
|
|
36
|
+
className={cn(!expanded && 'max-h-80 overflow-hidden')}
|
|
37
|
+
onFocusCapture={() => {
|
|
38
|
+
if (overflowing) setExpanded(true)
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<div ref={contentRef}>
|
|
42
|
+
<MarkdownContent content={content} />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
{overflowing && (
|
|
46
|
+
<>
|
|
47
|
+
{!expanded && <div aria-hidden="true">…</div>}
|
|
48
|
+
<Button
|
|
49
|
+
variant="ghost"
|
|
50
|
+
size="sm"
|
|
51
|
+
className="mt-4 px-0 font-normal hover:bg-transparent hover:text-inherit"
|
|
52
|
+
aria-expanded={expanded}
|
|
53
|
+
aria-controls={contentId}
|
|
54
|
+
onClick={() => setExpanded(value => !value)}
|
|
55
|
+
>
|
|
56
|
+
{expanded ? 'Show less' : 'Show more'}
|
|
57
|
+
{expanded ? <IconChevronUp stroke={1.75} /> : <IconChevronDown stroke={1.75} />}
|
|
58
|
+
</Button>
|
|
59
|
+
</>
|
|
60
|
+
)}
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
}
|