moi-computer 0.13.1-next.1 → 0.13.1-next.3
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/api/app-config.ts +12 -1
- package/client/api/http.ts +11 -1
- package/client/app/app-router.tsx +3 -2
- package/client/app/routes/home-route.tsx +1 -1
- package/client/app/routes/workspace-registration.tsx +68 -0
- package/client/app/routes/workspace-route.tsx +33 -6
- package/client/app/shell/sidebar-layout.tsx +10 -5
- package/client/components/shared/workspace-icon.tsx +8 -17
- package/client/features/account/account-test-utils.tsx +15 -9
- package/client/features/account/api.ts +6 -6
- package/client/features/account/profile-actions.ts +5 -7
- package/client/features/app-settings/settings-page.tsx +2 -1
- package/client/features/applets/api.ts +6 -6
- package/client/features/applets/applet-cache.ts +6 -5
- package/client/features/applets/applet-log.ts +2 -1
- package/client/features/applets/applet-runtime.ts +2 -1
- package/client/features/applets/use-applet.ts +73 -18
- package/client/features/applets/widget-shell.tsx +4 -2
- package/client/features/chat/applet-chat-intents.ts +5 -13
- package/client/features/chat/chat-popup.tsx +8 -4
- package/client/features/chat/chat-send.ts +2 -2
- package/client/features/chat/composer/model-order.ts +4 -4
- package/client/features/chat/composer/model-picker.tsx +12 -10
- package/client/features/chat/composer/use-workspace-composer-state.tsx +1 -1
- package/client/features/chat/sessions/api.ts +11 -28
- package/client/features/chat/sessions/use-selected-session.ts +14 -109
- package/client/features/chat/use-chat.ts +8 -12
- package/client/features/collab/members/api.ts +4 -10
- package/client/features/collab/members/hooks.ts +32 -38
- package/client/features/collab/members/store.ts +96 -71
- package/client/features/collab/members/types.ts +5 -3
- package/client/features/collab/presence/client.ts +2 -3
- package/client/features/collab/presence/hooks.tsx +1 -1
- package/client/features/collab/proxy-user.ts +1 -3
- package/client/features/collab/sharing/workspace-members.tsx +0 -8
- package/client/features/dev/chat-states-page.tsx +3 -1
- package/client/features/dev/harness-debug-page.tsx +7 -7
- package/client/features/dev/workspace-setup-mocks.ts +1 -1
- package/client/features/dev/workspace-setup-preview.tsx +6 -4
- package/client/features/harness/api.ts +13 -10
- package/client/features/harness/harness-login-panel.tsx +9 -5
- package/client/features/harness/harness-presentation.ts +4 -4
- package/client/features/harness/harness-selector.tsx +13 -13
- package/client/features/harness/use-harness-login.ts +5 -5
- package/client/features/home/api.ts +38 -2
- package/client/features/home/home-page.tsx +43 -13
- package/client/features/home/shared-workspaces.tsx +70 -0
- package/client/features/home/workspace-invitations.tsx +101 -0
- package/client/features/identity/host-api.ts +3 -2
- package/client/features/identity/store.ts +1 -7
- package/client/features/onboarding/agent-setup-step.tsx +8 -8
- package/client/features/onboarding/onboarding-page.tsx +3 -2
- package/client/features/onboarding/workspace-setup-step.tsx +1 -1
- package/client/features/overview/api.ts +3 -5
- package/client/features/overview/default/registry.tsx +1 -1
- package/client/features/overview/default/views-widget.tsx +2 -2
- package/client/features/overview/hidden-panel.tsx +7 -5
- package/client/features/overview/overview.tsx +18 -16
- package/client/features/overview/workspace-name.tsx +2 -2
- package/client/features/scratchpad/scratchpad.tsx +9 -7
- package/client/features/scratchpad/use-scratchpad-snapshot.tsx +13 -5
- package/client/features/views/api.ts +66 -23
- package/client/features/views/use-view-actions.ts +10 -41
- package/client/features/views/view-manager.tsx +1 -1
- package/client/features/views/view-submission.ts +2 -21
- package/client/features/workspace/add/api.ts +5 -4
- package/client/features/workspace/add/create-workspace-dialog.tsx +12 -9
- package/client/features/workspace/add/import-workspace-dialog.tsx +7 -7
- package/client/features/workspace/add/use-workspace-import.ts +10 -10
- package/client/features/workspace/add/workspace-agent-options.ts +21 -20
- package/client/features/workspace/add/workspace-agent-selector.tsx +11 -11
- package/client/features/workspace/api.ts +60 -13
- package/client/features/workspace/harness-transition.ts +7 -13
- package/client/features/workspace/remote.ts +25 -0
- package/client/features/workspace/settings/api.ts +7 -12
- package/client/features/workspace/settings/connectors-settings.tsx +3 -3
- package/client/features/workspace/settings/general-settings.tsx +8 -8
- package/client/features/workspace/setup/workspace-login-state.tsx +4 -4
- package/client/features/workspace/setup/workspace-recovery-states.tsx +43 -14
- package/client/features/workspace/setup/workspace-setup.tsx +6 -6
- package/client/features/workspace/tab-resolution.ts +1 -8
- package/client/features/workspace/use-workspace-navigation.ts +11 -7
- package/client/features/workspace/workspace-content.tsx +24 -31
- package/client/features/workspace/workspace-frame.tsx +13 -26
- package/client/features/workspace/workspace-layout-context.tsx +45 -12
- package/client/features/workspace/workspace-menu.tsx +2 -2
- package/client/features/workspace/workspace-pane.tsx +22 -0
- package/client/features/workspace/workspace-pending-screen.tsx +1 -1
- package/client/features/workspace/workspace-preferences.ts +91 -0
- package/client/features/workspace/workspace-presentation.tsx +12 -16
- package/client/features/workspace/workspace-screen.tsx +2 -2
- package/client/features/workspace/workspace-state.ts +42 -16
- package/client/features/workspace/workspace-tabs.tsx +1 -1
- package/client/features/workspace/workspace-test-utils.ts +23 -0
- package/client/runtime/use-workspace-events.ts +14 -0
- package/client/runtime/workspace-events.ts +9 -9
- package/client/store/ui.ts +24 -9
- package/client/store/workspace-session.ts +30 -0
- package/dist/chunk-0h4zypgf.js +1 -0
- package/dist/chunk-1tksq43z.js +72 -0
- package/dist/chunk-6gxf0xr8.js +5 -0
- package/dist/chunk-a865c7x4.js +1 -0
- package/dist/chunk-f44cs6mw.js +2 -0
- package/dist/chunk-h3qag4a6.js +2 -0
- package/dist/chunk-kffcah9w.css +1 -0
- package/dist/chunk-q2tpy0h7.js +2 -0
- package/dist/chunk-r95acex1.js +546 -0
- package/dist/chunk-w5h9grdr.js +1 -0
- package/dist/{chunk-th91xfnp.js → chunk-xj1pjhng.js} +1 -1
- package/dist/index.html +1 -1
- package/lib/harness-instructions.ts +4 -4
- package/lib/harness-types.ts +13 -0
- package/lib/moi-context.ts +19 -5
- package/lib/types.ts +38 -54
- package/lib/workspace-config.ts +48 -0
- package/lib/workspace-layout.ts +5 -24
- package/package.json +5 -2
- package/server/AGENTS.md +1 -1
- package/server/README.md +36 -31
- package/server/api/harnesses.ts +5 -5
- package/server/api/index.ts +268 -162
- package/server/applets/index.ts +15 -9
- package/server/applets/views.ts +2 -17
- package/server/applets/widgets.ts +3 -2
- package/server/cli/commands/config.ts +8 -20
- package/server/cli/commands/hermes.ts +2 -2
- package/server/cli/commands/init.ts +102 -54
- package/server/cli/commands/openclaw.ts +2 -2
- package/server/cli/commands/refresh.ts +10 -1
- package/server/cli/commands/remote.ts +330 -0
- package/server/cli/commands/skill.ts +4 -4
- package/server/cli/commands/tabs.ts +5 -12
- package/server/cli/control.ts +35 -4
- package/server/cli/index.ts +10 -6
- package/server/cli/remote-command.ts +77 -0
- package/server/cli/remote-control.ts +73 -0
- package/server/cli/remote-operations.ts +247 -0
- package/server/collab/config.ts +3 -3
- package/server/collab/skill/index.ts +3 -3
- package/server/control.ts +47 -12
- package/server/harness/acp/session.ts +4 -4
- package/server/harness/auth.ts +26 -31
- package/server/harness/claude-code/index.ts +1 -1
- package/server/harness/codex/discovery.ts +1 -1
- package/server/harness/codex/session.ts +1 -1
- package/server/harness/detect.ts +14 -19
- package/server/harness/executable.ts +10 -10
- package/server/harness/hermes/NOTES.md +2 -2
- package/server/harness/hermes/index.ts +1 -1
- package/server/harness/install.ts +11 -11
- package/server/harness/openclaw/index.ts +1 -1
- package/server/harness/registry.ts +7 -6
- package/server/harness/types.ts +4 -4
- package/server/onboarding/jobs.ts +2 -2
- package/server/operations/commands.ts +46 -0
- package/server/operations/files.ts +148 -0
- package/server/operations/server.ts +206 -0
- package/server/remote/agent.ts +103 -0
- package/server/remote/broker-client.ts +76 -0
- package/server/remote/broker.ts +81 -0
- package/server/remote/client.ts +725 -0
- package/server/remote/errors.ts +2 -0
- package/server/remote/routes.ts +121 -0
- package/server/remote/workspace.ts +34 -0
- package/server/scratchpad/document.ts +33 -12
- package/server/scratchpad/executor.ts +16 -7
- package/server/sessions/config.ts +8 -5
- package/server/sessions/pending-views.ts +17 -0
- package/server/sessions/send-message.ts +102 -0
- package/server/sessions/view-sessions.ts +9 -101
- package/server/skills/locations.ts +4 -4
- package/server/skills/update.ts +11 -11
- package/server/skills/version.ts +7 -7
- package/server/skills/workspace.ts +13 -11
- package/server/web.ts +13 -9
- package/server/workspace-state/file.ts +4 -0
- package/server/workspace-state/index.ts +0 -4
- package/server/workspaces/api.ts +24 -0
- package/server/workspaces/change-harness.ts +15 -26
- package/server/workspaces/import.ts +4 -4
- package/server/workspaces/init.ts +15 -13
- package/server/workspaces/layout.ts +60 -66
- package/server/workspaces/registry.ts +43 -18
- package/server/workspaces/shared.ts +74 -0
- package/server/workspaces/tabs.ts +5 -12
- package/skill/SKILL.md +80 -19
- package/skill/references/SCRATCHPAD.md +4 -0
- package/skill/references/UI-COMPONENTS.md +1 -1
- package/client/api/app-ui-keys.ts +0 -6
- package/client/features/chat/sessions/browser-tab-state.ts +0 -43
- package/client/features/collab/members/keys.ts +0 -6
- package/client/features/workspace/browser-tab-state.ts +0 -51
- package/client/features/workspace/layout-save.ts +0 -13
- package/dist/chunk-3smkkcfw.js +0 -546
- package/dist/chunk-47h9c2qy.js +0 -2
- package/dist/chunk-8qed2gqp.js +0 -75
- package/dist/chunk-8zy3vesm.js +0 -1
- package/dist/chunk-a47zy276.js +0 -2
- package/dist/chunk-g4c1nte9.css +0 -1
- package/dist/chunk-kcactdr4.js +0 -2
- package/dist/chunk-m8bhx6tw.js +0 -1
- package/dist/chunk-pf19zcrn.js +0 -2
- package/dist/chunk-ygzxah0e.js +0 -1
- package/lib/workspace-types.ts +0 -13
- package/server/workspace-state/legacy-migration.ts +0 -79
|
@@ -12,14 +12,9 @@ import {
|
|
|
12
12
|
} from '@/client/features/chat/chat-send'
|
|
13
13
|
import {
|
|
14
14
|
renameSelectedSessionInCache,
|
|
15
|
-
setSelectedSessionInCache,
|
|
16
15
|
usePinnedSession
|
|
17
16
|
} from '@/client/features/chat/sessions/use-selected-session'
|
|
18
|
-
import {
|
|
19
|
-
changeWorkspaceStateCache,
|
|
20
|
-
getCachedWorkspaceState
|
|
21
|
-
} from '@/client/features/workspace/workspace-state'
|
|
22
|
-
import { useAppConfig } from '@/client/api/app-config'
|
|
17
|
+
import { getCachedWorkspaceState } from '@/client/features/workspace/workspace-state'
|
|
23
18
|
import { useWorkspaceHarness } from '@/client/features/workspace/api'
|
|
24
19
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/workspace-layout-context'
|
|
25
20
|
import {
|
|
@@ -34,9 +29,7 @@ import { viewTabId } from '@/lib/workspace-tabs'
|
|
|
34
29
|
|
|
35
30
|
export function useViewActions() {
|
|
36
31
|
const queryClient = useQueryClient()
|
|
37
|
-
const
|
|
38
|
-
const selectionScope = cloud ? 'browser-tab' : 'shared'
|
|
39
|
-
const { workspaceId, layout } = useWorkspaceLayoutCtx()
|
|
32
|
+
const { workspaceId } = useWorkspaceLayoutCtx()
|
|
40
33
|
const { pinnedSessionId } = usePinnedSession()
|
|
41
34
|
const modelData = useWorkspaceHarness(workspaceId).data
|
|
42
35
|
const createMutation = useCreateView(workspaceId)
|
|
@@ -58,49 +51,34 @@ export function useViewActions() {
|
|
|
58
51
|
|
|
59
52
|
if (!pinnedSessionId)
|
|
60
53
|
startOptimisticSession({
|
|
61
|
-
tabId: viewTabId(pendingView.id),
|
|
62
54
|
queryClient,
|
|
63
55
|
workspaceId,
|
|
64
56
|
sessionId,
|
|
65
57
|
text,
|
|
66
58
|
filenames: attachments.map(attachment => attachment.label)
|
|
67
59
|
})
|
|
68
|
-
if (!pinnedSessionId)
|
|
69
|
-
moveChatDraft(workspaceId, draftId, sessionId)
|
|
70
|
-
setSelectedSessionInCache(
|
|
71
|
-
queryClient,
|
|
72
|
-
workspaceId,
|
|
73
|
-
sessionId,
|
|
74
|
-
viewTabId(pendingView.id),
|
|
75
|
-
selectionScope
|
|
76
|
-
)
|
|
77
|
-
}
|
|
60
|
+
if (!pinnedSessionId) moveChatDraft(workspaceId, draftId, sessionId)
|
|
78
61
|
const prepared = prepareOptimisticSend(
|
|
79
62
|
{ queryClient, workspaceId, sessionId, text },
|
|
80
63
|
attachments
|
|
81
64
|
)
|
|
82
65
|
|
|
83
|
-
const
|
|
66
|
+
const state = getCachedWorkspaceState(queryClient, workspaceId)
|
|
67
|
+
const config = state?.sessions[sessionId]?.config
|
|
68
|
+
const defaults = state?.chatDefaults
|
|
84
69
|
const { model, effort, speedMode, stream } = resolveChatRunOptions(
|
|
85
70
|
modelData,
|
|
86
|
-
config?.model ??
|
|
87
|
-
config?.effort ??
|
|
88
|
-
config?.speedMode ??
|
|
71
|
+
config?.model ?? defaults?.model,
|
|
72
|
+
config?.effort ?? defaults?.effort,
|
|
73
|
+
config?.speedMode ?? defaults?.speedMode
|
|
89
74
|
)
|
|
90
75
|
|
|
91
|
-
changeWorkspaceStateCache(queryClient, workspaceId, draft => {
|
|
92
|
-
const view = draft.pendingViews[pendingView.id]
|
|
93
|
-
if (view?.status === 'draft')
|
|
94
|
-
Object.assign(view, { status: 'starting', requirements: text, buildSessionId: sessionId })
|
|
95
|
-
})
|
|
96
|
-
|
|
97
76
|
try {
|
|
98
77
|
const result = await submitMutation.mutateAsync({
|
|
99
78
|
viewId: pendingView.id,
|
|
100
79
|
sessionId,
|
|
101
80
|
requirements: text,
|
|
102
81
|
optimisticId: prepared.optimisticId,
|
|
103
|
-
selectedSessionScope: selectionScope,
|
|
104
82
|
...(attachments.length > 0
|
|
105
83
|
? {
|
|
106
84
|
attachments: prepared.attachments
|
|
@@ -113,14 +91,6 @@ export function useViewActions() {
|
|
|
113
91
|
})
|
|
114
92
|
moveChatDraft(workspaceId, sessionId, result.sessionId)
|
|
115
93
|
renameSelectedSessionInCache(queryClient, workspaceId, sessionId, result.sessionId)
|
|
116
|
-
if (!pinnedSessionId)
|
|
117
|
-
setSelectedSessionInCache(
|
|
118
|
-
queryClient,
|
|
119
|
-
workspaceId,
|
|
120
|
-
result.sessionId,
|
|
121
|
-
viewTabId(pendingView.id),
|
|
122
|
-
selectionScope
|
|
123
|
-
)
|
|
124
94
|
finishComposerSend(workspaceId, attachments)
|
|
125
95
|
const draftKey = composerDraftKey(workspaceId, result.sessionId)
|
|
126
96
|
const ui = useUiStore.getState()
|
|
@@ -132,8 +102,7 @@ export function useViewActions() {
|
|
|
132
102
|
pendingView.id,
|
|
133
103
|
sessionId,
|
|
134
104
|
text,
|
|
135
|
-
!!pinnedSessionId
|
|
136
|
-
selectionScope
|
|
105
|
+
!!pinnedSessionId
|
|
137
106
|
)
|
|
138
107
|
throw error
|
|
139
108
|
}
|
|
@@ -129,7 +129,7 @@ type ViewSlotProps = {
|
|
|
129
129
|
// place, so it is current the moment the user comes back to it.
|
|
130
130
|
function ViewSlot({ view, active, params }: ViewSlotProps) {
|
|
131
131
|
const workspaceId = useWorkspaceId()
|
|
132
|
-
const bundle = useView(view.id)
|
|
132
|
+
const bundle = useView(view.id, view.revision)
|
|
133
133
|
const { current, outgoing } = useLoadedBundle(bundle, active)
|
|
134
134
|
// A parked view keeps rendering with the params it was last shown with: the
|
|
135
135
|
// active view's URL state is not its to render.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import type { QueryClient } from '@tanstack/react-query'
|
|
2
2
|
import { requestJson } from '@/client/api/http'
|
|
3
3
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
4
|
-
import {
|
|
5
|
-
readSelectedSession,
|
|
6
|
-
writeSelectedSession,
|
|
7
|
-
type BrowserTabSelection
|
|
8
|
-
} from '@/client/features/chat/sessions/browser-tab-state'
|
|
9
|
-
import { browserTabSelectionKey } from '@/client/features/chat/sessions/use-selected-session'
|
|
10
4
|
import { moveChatDraft } from '@/client/features/chat/chat-send'
|
|
11
5
|
import { liveStore } from '@/client/features/chat/chat-store'
|
|
12
6
|
import {
|
|
@@ -16,7 +10,7 @@ import {
|
|
|
16
10
|
import { useUiStore } from '@/client/store/ui'
|
|
17
11
|
import { composerDraftKey, draftSessionId } from '@/lib/session-drafts'
|
|
18
12
|
import { viewTabId } from '@/lib/workspace-tabs'
|
|
19
|
-
import type {
|
|
13
|
+
import type { SessionSummary, WorkspaceState } from '@/lib/types'
|
|
20
14
|
|
|
21
15
|
// A failed HTTP response does not prove startup failed. Refresh the server's
|
|
22
16
|
// state before restoring the fresh composer; never replay the request.
|
|
@@ -26,8 +20,7 @@ export async function recoverViewSubmission(
|
|
|
26
20
|
viewId: string,
|
|
27
21
|
sessionId: string,
|
|
28
22
|
text: string,
|
|
29
|
-
pinned: boolean
|
|
30
|
-
selectionScope: SelectedSessionScope = 'shared'
|
|
23
|
+
pinned: boolean
|
|
31
24
|
) {
|
|
32
25
|
const tabId = viewTabId(viewId)
|
|
33
26
|
let target =
|
|
@@ -52,18 +45,6 @@ export async function recoverViewSubmission(
|
|
|
52
45
|
if (view?.status === 'draft' || view?.status === 'failed')
|
|
53
46
|
liveStore.getState().setActivity(workspaceId, target, 'idle')
|
|
54
47
|
receiveWorkspaceState(queryClient, workspaceId, state)
|
|
55
|
-
if (selectionScope === 'browser-tab' && !pinned) {
|
|
56
|
-
const local =
|
|
57
|
-
queryClient.getQueryData<BrowserTabSelection>(browserTabSelectionKey(workspaceId)) ??
|
|
58
|
-
readSelectedSession(workspaceId)
|
|
59
|
-
const selected = { ...local.selected }
|
|
60
|
-
if (view?.status === 'draft') delete selected[tabId]
|
|
61
|
-
else selected[tabId] = target
|
|
62
|
-
queryClient.setQueryData<BrowserTabSelection>(browserTabSelectionKey(workspaceId), {
|
|
63
|
-
selected
|
|
64
|
-
})
|
|
65
|
-
writeSelectedSession(workspaceId, { selected })
|
|
66
|
-
}
|
|
67
48
|
} catch {
|
|
68
49
|
moveChatDraft(workspaceId, sessionId, target)
|
|
69
50
|
// Offline: retain the draft at its current identity until state can refresh.
|
|
@@ -3,7 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
|
|
|
3
3
|
import { jsonRequest, requestJson } from '@/client/api/http'
|
|
4
4
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
5
5
|
import { useUiStore } from '@/client/store/ui'
|
|
6
|
-
import type { DiscoveredWorkspace, WorkspaceEntry,
|
|
6
|
+
import type { DiscoveredWorkspace, WorkspaceEntry, HarnessType } from '@/lib/types'
|
|
7
7
|
|
|
8
8
|
export function upsertWorkspaceEntry(
|
|
9
9
|
entries: WorkspaceEntry[] | undefined,
|
|
@@ -21,7 +21,8 @@ export function useImportWorkspace() {
|
|
|
21
21
|
mutationFn: input =>
|
|
22
22
|
requestJson('/api/workspaces', jsonRequest('POST', input), 'Failed to add workspace'),
|
|
23
23
|
onSuccess: (entry, input) => {
|
|
24
|
-
|
|
24
|
+
// A remote reference holds no local project files to analyze.
|
|
25
|
+
if (!entry.remote) useUiStore.getState().markWorkspacePendingAnalysis(entry.id)
|
|
25
26
|
queryClient.setQueryData<WorkspaceEntry[]>(workspaceKeys.all, previous =>
|
|
26
27
|
upsertWorkspaceEntry(previous, entry)
|
|
27
28
|
)
|
|
@@ -34,12 +35,12 @@ export function useImportWorkspace() {
|
|
|
34
35
|
|
|
35
36
|
export type ImportWorkspaceInput = {
|
|
36
37
|
path: string
|
|
37
|
-
|
|
38
|
+
harness: HarnessType
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
export type CreateWorkspaceInput = {
|
|
41
42
|
name?: string
|
|
42
|
-
|
|
43
|
+
harness: HarnessType
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
export function useCreateWorkspace() {
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
import { Input } from '@/client/components/ui/input'
|
|
16
16
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip'
|
|
17
17
|
import { validateWorkspaceName } from '@/lib/workspace-name'
|
|
18
|
-
import {
|
|
19
|
-
import type {
|
|
18
|
+
import { HARNESS_ORDER } from '@/lib/harness-types'
|
|
19
|
+
import type { HarnessType } from '@/lib/types'
|
|
20
20
|
|
|
21
21
|
import { DemoDialog } from '@/client/features/demo/demo-dialog'
|
|
22
22
|
import { welcomeNewWorkspace } from '../setup/workspace-welcome-state'
|
|
@@ -30,7 +30,7 @@ type CreateWorkspaceDialogProps = {
|
|
|
30
30
|
|
|
31
31
|
type CreateWorkspaceStep = 'agent' | 'name'
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const DEFAULT_HARNESS = HARNESS_ORDER[0]
|
|
34
34
|
|
|
35
35
|
export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
36
36
|
const [, navigate] = useLocation()
|
|
@@ -40,7 +40,7 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
40
40
|
|
|
41
41
|
const [open, setOpen] = useState(false)
|
|
42
42
|
const [step, setStep] = useState<CreateWorkspaceStep>('name')
|
|
43
|
-
const [
|
|
43
|
+
const [harness, setHarness] = useState<HarnessType>(DEFAULT_HARNESS)
|
|
44
44
|
const [name, setName] = useState('')
|
|
45
45
|
|
|
46
46
|
const trimmedName = name.trim()
|
|
@@ -49,7 +49,7 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
49
49
|
const isChecking = info.isPending || info.isFetching
|
|
50
50
|
const installed = info.isError ? undefined : info.data
|
|
51
51
|
const options = getWorkspaceAgentOptions(installed)
|
|
52
|
-
const selectedAvailable = options.some(option => option.
|
|
52
|
+
const selectedAvailable = options.some(option => option.harness === harness && !option.disabled)
|
|
53
53
|
const detectionError = !isChecking && !installed ? 'Could not check installed agents.' : undefined
|
|
54
54
|
const canUseAgent = !isChecking && !detectionError && selectedAvailable
|
|
55
55
|
|
|
@@ -67,7 +67,7 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
67
67
|
|
|
68
68
|
function resetDialog() {
|
|
69
69
|
setStep('name')
|
|
70
|
-
|
|
70
|
+
setHarness(DEFAULT_HARNESS)
|
|
71
71
|
setName('')
|
|
72
72
|
createMutation.reset()
|
|
73
73
|
}
|
|
@@ -81,7 +81,10 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
81
81
|
function createWorkspace() {
|
|
82
82
|
if (!trimmedName || nameError || isCreating || !canUseAgent) return
|
|
83
83
|
createMutation.reset()
|
|
84
|
-
createMutation.mutate(
|
|
84
|
+
createMutation.mutate(
|
|
85
|
+
{ name: trimmedName, harness: harness },
|
|
86
|
+
{ onSuccess: entry => finish(entry.id) }
|
|
87
|
+
)
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
return (
|
|
@@ -109,7 +112,7 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
109
112
|
) : (
|
|
110
113
|
<WorkspaceAgentSelector
|
|
111
114
|
title="Create new workspace"
|
|
112
|
-
|
|
115
|
+
selectedHarness={harness}
|
|
113
116
|
options={options}
|
|
114
117
|
isLoading={isChecking && !installed}
|
|
115
118
|
errorMessage={detectionError ?? createMutation.error?.message}
|
|
@@ -122,7 +125,7 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
122
125
|
}
|
|
123
126
|
primaryLabel="Create workspace"
|
|
124
127
|
pendingLabel={isCreating ? 'Creating…' : undefined}
|
|
125
|
-
|
|
128
|
+
onHarnessChange={setHarness}
|
|
126
129
|
onSubmit={createWorkspace}
|
|
127
130
|
/>
|
|
128
131
|
)}
|
|
@@ -3,7 +3,7 @@ import { useState } from 'react'
|
|
|
3
3
|
import { Button } from '@/client/components/ui/button'
|
|
4
4
|
import { Dialog, DialogClose } from '@/client/components/ui/dialog'
|
|
5
5
|
import { workspaceDisplayName } from '@/client/features/workspace/workspace-presentation'
|
|
6
|
-
import type {
|
|
6
|
+
import type { HarnessType } from '@/lib/types'
|
|
7
7
|
|
|
8
8
|
import { WorkspaceAgentSelector } from './workspace-agent-selector'
|
|
9
9
|
import { useHarnessStatuses } from '@/client/features/harness/api'
|
|
@@ -15,7 +15,7 @@ type ImportWorkspaceDialogProps = {
|
|
|
15
15
|
choice: WorkspaceImportChoice
|
|
16
16
|
isPending: boolean
|
|
17
17
|
errorMessage?: string
|
|
18
|
-
|
|
18
|
+
onHarnessChange: (harness: HarnessType) => void
|
|
19
19
|
onSubmit: () => void
|
|
20
20
|
onReset: () => void
|
|
21
21
|
}
|
|
@@ -24,7 +24,7 @@ export function ImportWorkspaceDialog({
|
|
|
24
24
|
choice,
|
|
25
25
|
isPending,
|
|
26
26
|
errorMessage,
|
|
27
|
-
|
|
27
|
+
onHarnessChange,
|
|
28
28
|
onSubmit,
|
|
29
29
|
onReset
|
|
30
30
|
}: ImportWorkspaceDialogProps) {
|
|
@@ -32,13 +32,13 @@ export function ImportWorkspaceDialog({
|
|
|
32
32
|
const info = useHarnessStatuses()
|
|
33
33
|
const isChecking = info.isPending || info.isFetching
|
|
34
34
|
const installed = info.isError ? undefined : info.data
|
|
35
|
-
const options = getWorkspaceAgentOptions(installed, choice.workspace.
|
|
35
|
+
const options = getWorkspaceAgentOptions(installed, choice.workspace.harnesses)
|
|
36
36
|
const detectionError = !isChecking && !installed ? 'Could not check installed agents.' : undefined
|
|
37
37
|
const canImport =
|
|
38
38
|
!isPending &&
|
|
39
39
|
!isChecking &&
|
|
40
40
|
!detectionError &&
|
|
41
|
-
options.some(option => option.
|
|
41
|
+
options.some(option => option.harness === choice.selectedHarness && !option.disabled)
|
|
42
42
|
|
|
43
43
|
function handleOpenChange(nextOpen: boolean) {
|
|
44
44
|
if (!nextOpen && isPending) return
|
|
@@ -58,7 +58,7 @@ export function ImportWorkspaceDialog({
|
|
|
58
58
|
<WorkspaceDialogContent showCloseButton={!isPending}>
|
|
59
59
|
<WorkspaceAgentSelector
|
|
60
60
|
title={`Import ${workspaceDisplayName(choice.workspace)}`}
|
|
61
|
-
|
|
61
|
+
selectedHarness={choice.selectedHarness}
|
|
62
62
|
options={options}
|
|
63
63
|
isLoading={isChecking && !installed}
|
|
64
64
|
isPending={isPending || isChecking || Boolean(detectionError)}
|
|
@@ -70,7 +70,7 @@ export function ImportWorkspaceDialog({
|
|
|
70
70
|
}
|
|
71
71
|
primaryLabel="Add workspace"
|
|
72
72
|
pendingLabel={isPending ? 'Adding…' : undefined}
|
|
73
|
-
|
|
73
|
+
onHarnessChange={onHarnessChange}
|
|
74
74
|
onSubmit={() => {
|
|
75
75
|
if (canImport) onSubmit()
|
|
76
76
|
}}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
|
|
3
3
|
import { useImportWorkspace } from '@/client/features/workspace/add/api'
|
|
4
|
-
import {
|
|
5
|
-
import type { DiscoveredWorkspace, WorkspaceEntry,
|
|
4
|
+
import { HARNESS_ORDER } from '@/lib/harness-types'
|
|
5
|
+
import type { DiscoveredWorkspace, WorkspaceEntry, HarnessType } from '@/lib/types'
|
|
6
6
|
|
|
7
|
-
export function workspaceImportDefaultType(workspace: DiscoveredWorkspace):
|
|
8
|
-
return workspace.
|
|
7
|
+
export function workspaceImportDefaultType(workspace: DiscoveredWorkspace): HarnessType {
|
|
8
|
+
return workspace.harnesses[0] ?? HARNESS_ORDER[0]
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
type UseWorkspaceImportProps = {
|
|
@@ -14,7 +14,7 @@ type UseWorkspaceImportProps = {
|
|
|
14
14
|
|
|
15
15
|
export type WorkspaceImportChoice = {
|
|
16
16
|
workspace: DiscoveredWorkspace
|
|
17
|
-
|
|
17
|
+
selectedHarness: HarnessType
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export function useWorkspaceImport({ onSuccess }: UseWorkspaceImportProps) {
|
|
@@ -25,12 +25,12 @@ export function useWorkspaceImport({ onSuccess }: UseWorkspaceImportProps) {
|
|
|
25
25
|
mutation.reset()
|
|
26
26
|
setChoice({
|
|
27
27
|
workspace,
|
|
28
|
-
|
|
28
|
+
selectedHarness: workspaceImportDefaultType(workspace)
|
|
29
29
|
})
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
function
|
|
33
|
-
setChoice(current => (current ? { ...current,
|
|
32
|
+
function selectHarness(harness: HarnessType) {
|
|
33
|
+
setChoice(current => (current ? { ...current, selectedHarness: harness } : current))
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function submit() {
|
|
@@ -38,7 +38,7 @@ export function useWorkspaceImport({ onSuccess }: UseWorkspaceImportProps) {
|
|
|
38
38
|
mutation.mutate(
|
|
39
39
|
{
|
|
40
40
|
path: choice.workspace.path,
|
|
41
|
-
|
|
41
|
+
harness: choice.selectedHarness
|
|
42
42
|
},
|
|
43
43
|
{ onSuccess }
|
|
44
44
|
)
|
|
@@ -54,7 +54,7 @@ export function useWorkspaceImport({ onSuccess }: UseWorkspaceImportProps) {
|
|
|
54
54
|
isPending: mutation.isPending,
|
|
55
55
|
error: mutation.error,
|
|
56
56
|
startImport,
|
|
57
|
-
|
|
57
|
+
selectHarness,
|
|
58
58
|
submit,
|
|
59
59
|
reset
|
|
60
60
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { harnessDescription } from '@/client/features/harness/harness-presentation'
|
|
2
2
|
import { HARNESS_INSTRUCTIONS } from '@/lib/harness-instructions'
|
|
3
|
-
import type { HarnessStatuses,
|
|
4
|
-
import {
|
|
3
|
+
import type { HarnessStatuses, HarnessType } from '@/lib/types'
|
|
4
|
+
import { HARNESS_ORDER } from '@/lib/harness-types'
|
|
5
5
|
|
|
6
6
|
type WorkspaceAgentConfig = {
|
|
7
7
|
importOnly: boolean
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
const workspaceAgents: Record<
|
|
10
|
+
const workspaceAgents: Record<HarnessType, WorkspaceAgentConfig> = {
|
|
11
11
|
'claude-code': { importOnly: false },
|
|
12
12
|
codex: { importOnly: false },
|
|
13
13
|
openclaw: { importOnly: true },
|
|
@@ -19,22 +19,23 @@ import type { HarnessOption as WorkspaceAgentOption } from '@/client/features/ha
|
|
|
19
19
|
|
|
20
20
|
export function getWorkspaceAgentOptions(
|
|
21
21
|
statuses?: HarnessStatuses,
|
|
22
|
-
|
|
22
|
+
detectedHarnesses: HarnessType[] = []
|
|
23
23
|
): WorkspaceAgentOption[] {
|
|
24
24
|
if (!statuses) return []
|
|
25
|
-
const installed = (
|
|
26
|
-
const availability = statuses[
|
|
25
|
+
const installed = (harness: HarnessType) => {
|
|
26
|
+
const availability = statuses[harness].availability
|
|
27
27
|
return availability.status !== 'unavailable' || availability.code !== 'not-installed'
|
|
28
28
|
}
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
).map(
|
|
32
|
-
const config = workspaceAgents[
|
|
33
|
-
const instruction = HARNESS_INSTRUCTIONS[
|
|
34
|
-
const disabled =
|
|
29
|
+
return HARNESS_ORDER.filter(
|
|
30
|
+
harness => installed(harness) || !workspaceAgents[harness].importOnly
|
|
31
|
+
).map(harness => {
|
|
32
|
+
const config = workspaceAgents[harness]
|
|
33
|
+
const instruction = HARNESS_INSTRUCTIONS[harness]
|
|
34
|
+
const disabled =
|
|
35
|
+
!installed(harness) || (config.importOnly && !detectedHarnesses.includes(harness))
|
|
35
36
|
return {
|
|
36
|
-
|
|
37
|
-
description:
|
|
37
|
+
harness,
|
|
38
|
+
description: harnessDescription[harness],
|
|
38
39
|
disabled,
|
|
39
40
|
disabledReason: disabled ? instruction.reason : undefined,
|
|
40
41
|
disabledCommand: disabled ? instruction.command : undefined
|
|
@@ -44,9 +45,9 @@ export function getWorkspaceAgentOptions(
|
|
|
44
45
|
|
|
45
46
|
export function resolveWorkspaceAgentSelection(
|
|
46
47
|
options: WorkspaceAgentOption[],
|
|
47
|
-
|
|
48
|
-
):
|
|
49
|
-
const selected = options.find(option => option.
|
|
50
|
-
if (selected && !selected.disabled) return selected.
|
|
51
|
-
return options.find(option => !option.disabled)?.
|
|
48
|
+
selectedHarness: HarnessType
|
|
49
|
+
): HarnessType | undefined {
|
|
50
|
+
const selected = options.find(option => option.harness === selectedHarness)
|
|
51
|
+
if (selected && !selected.disabled) return selected.harness
|
|
52
|
+
return options.find(option => !option.disabled)?.harness
|
|
52
53
|
}
|
|
@@ -4,7 +4,7 @@ import { type ReactNode, useEffect } from 'react'
|
|
|
4
4
|
import { Button } from '@/client/components/ui/button'
|
|
5
5
|
import { DialogDescription, DialogTitle } from '@/client/components/ui/dialog'
|
|
6
6
|
import { Skeleton } from '@/client/components/ui/skeleton'
|
|
7
|
-
import type {
|
|
7
|
+
import type { HarnessType } from '@/lib/types'
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
10
|
resolveWorkspaceAgentSelection,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
const WORKSPACE_AGENT_DESCRIPTION = 'Choose the agent to build the workspace'
|
|
15
15
|
type WorkspaceAgentSelectorProps = {
|
|
16
16
|
title: string
|
|
17
|
-
|
|
17
|
+
selectedHarness: HarnessType
|
|
18
18
|
options: WorkspaceAgentOption[]
|
|
19
19
|
isLoading?: boolean
|
|
20
20
|
isPending: boolean
|
|
@@ -23,13 +23,13 @@ type WorkspaceAgentSelectorProps = {
|
|
|
23
23
|
secondaryAction: ReactNode
|
|
24
24
|
primaryLabel: string
|
|
25
25
|
pendingLabel?: string
|
|
26
|
-
|
|
26
|
+
onHarnessChange: (harness: HarnessType) => void
|
|
27
27
|
onSubmit: () => void
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export function WorkspaceAgentSelector({
|
|
31
31
|
title,
|
|
32
|
-
|
|
32
|
+
selectedHarness,
|
|
33
33
|
options,
|
|
34
34
|
isLoading = false,
|
|
35
35
|
isPending,
|
|
@@ -38,15 +38,15 @@ export function WorkspaceAgentSelector({
|
|
|
38
38
|
secondaryAction,
|
|
39
39
|
primaryLabel,
|
|
40
40
|
pendingLabel,
|
|
41
|
-
|
|
41
|
+
onHarnessChange,
|
|
42
42
|
onSubmit
|
|
43
43
|
}: WorkspaceAgentSelectorProps) {
|
|
44
|
-
const selectableType = resolveWorkspaceAgentSelection(options,
|
|
45
|
-
const selectedUnavailable = selectableType !==
|
|
44
|
+
const selectableType = resolveWorkspaceAgentSelection(options, selectedHarness)
|
|
45
|
+
const selectedUnavailable = selectableType !== selectedHarness
|
|
46
46
|
|
|
47
47
|
useEffect(() => {
|
|
48
|
-
if (!isPending && selectableType && selectedUnavailable)
|
|
49
|
-
}, [isPending,
|
|
48
|
+
if (!isPending && selectableType && selectedUnavailable) onHarnessChange(selectableType)
|
|
49
|
+
}, [isPending, onHarnessChange, selectableType, selectedUnavailable])
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
52
|
<div className="flex min-w-[min(22rem,calc(100vw-5rem))] flex-col gap-5">
|
|
@@ -69,8 +69,8 @@ export function WorkspaceAgentSelector({
|
|
|
69
69
|
<HarnessSelector
|
|
70
70
|
disabled={isPending}
|
|
71
71
|
options={options}
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
selectedHarness={selectedUnavailable ? undefined : selectedHarness}
|
|
73
|
+
onHarnessChange={onHarnessChange}
|
|
74
74
|
/>
|
|
75
75
|
)}
|
|
76
76
|
</div>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getWorkspaceApiBase, isRemoteWorkspace } from './remote'
|
|
2
|
+
import { toast } from '@/client/components/ui/toast'
|
|
1
3
|
import { receiveWorkspaceHarness } from './harness-transition'
|
|
2
4
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
3
5
|
|
|
@@ -7,22 +9,54 @@ import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
|
7
9
|
import { BROWSER_TAB_ID } from '@/client/lib/browser-tab-id'
|
|
8
10
|
import { useWorkspaceEvent } from '@/client/runtime/use-workspace-events'
|
|
9
11
|
import type {
|
|
10
|
-
WorkspaceHarness,
|
|
11
12
|
WorkspaceEntry,
|
|
13
|
+
WorkspaceHarness,
|
|
12
14
|
WorkspaceLayoutResponse,
|
|
13
|
-
|
|
15
|
+
WorkspaceInfoResponse,
|
|
16
|
+
WorkspaceLayout,
|
|
14
17
|
WorkspaceSkillsStatus,
|
|
15
18
|
WorkspaceSkillsUpdateFailure,
|
|
16
|
-
|
|
19
|
+
HarnessType
|
|
17
20
|
} from '@/lib/types'
|
|
18
21
|
|
|
19
22
|
export type { WorkspaceLayoutResponse } from '@/lib/types'
|
|
20
23
|
|
|
24
|
+
// One info query per API address, shared by discovery and the workspace loader.
|
|
25
|
+
export function workspaceInfoOptions(apiBase: string) {
|
|
26
|
+
const address = decodeURIComponent(apiBase.slice('/api/workspaces/'.length))
|
|
27
|
+
return {
|
|
28
|
+
queryKey: workspaceKeys.layout(address),
|
|
29
|
+
queryFn: ({ signal }: { signal: AbortSignal }) =>
|
|
30
|
+
requestJson<WorkspaceInfoResponse>(apiBase, { signal }),
|
|
31
|
+
staleTime: 60_000,
|
|
32
|
+
retry: false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
export function useWorkspaceLayout(workspaceId: string) {
|
|
37
|
+
const client = useQueryClient()
|
|
38
|
+
const options = workspaceInfoOptions(`/api/workspaces/${workspaceId}`)
|
|
22
39
|
return useQuery<WorkspaceLayoutResponse>({
|
|
23
|
-
queryKey:
|
|
24
|
-
queryFn:
|
|
25
|
-
|
|
40
|
+
queryKey: options.queryKey,
|
|
41
|
+
queryFn: async context => {
|
|
42
|
+
const local = await options.queryFn(context)
|
|
43
|
+
if (context.signal.aborted) throw context.signal.reason
|
|
44
|
+
if (!local.isRemote) return local
|
|
45
|
+
const owner = await client.fetchQuery(workspaceInfoOptions(local.apiBase))
|
|
46
|
+
if (context.signal.aborted) throw context.signal.reason
|
|
47
|
+
if (owner.isRemote) throw new Error('The owner address points to another remote reference')
|
|
48
|
+
// Shared content comes from the owner; the folder and agent are this visitor's.
|
|
49
|
+
return {
|
|
50
|
+
...owner,
|
|
51
|
+
apiBase: local.apiBase,
|
|
52
|
+
isRemote: local.isRemote,
|
|
53
|
+
cwd: local.cwd,
|
|
54
|
+
harness: local.harness,
|
|
55
|
+
agentId: local.agentId
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
...WORKSPACE_RESOURCE_OPTIONS,
|
|
59
|
+
retry: false
|
|
26
60
|
})
|
|
27
61
|
}
|
|
28
62
|
|
|
@@ -110,14 +144,27 @@ export function useUpdateWorkspaceSkills(workspaceId: string) {
|
|
|
110
144
|
|
|
111
145
|
export function useSaveLayout(workspaceId: string) {
|
|
112
146
|
const queryClient = useQueryClient()
|
|
113
|
-
return useMutation<void, Error,
|
|
147
|
+
return useMutation<void, Error, WorkspaceLayout>({
|
|
114
148
|
mutationFn: layout =>
|
|
115
149
|
requestVoid(
|
|
116
|
-
|
|
117
|
-
jsonRequest('PUT', { ...layout, origin: BROWSER_TAB_ID })
|
|
118
|
-
'Failed to save layout'
|
|
150
|
+
getWorkspaceApiBase(workspaceId, queryClient),
|
|
151
|
+
jsonRequest('PUT', { ...layout, origin: BROWSER_TAB_ID })
|
|
119
152
|
),
|
|
153
|
+
onError: error => {
|
|
154
|
+
toast.add({ title: 'Couldn’t save workspace', description: error.message, type: 'error' })
|
|
155
|
+
if (isRemoteWorkspace(workspaceId, queryClient))
|
|
156
|
+
void queryClient.invalidateQueries({
|
|
157
|
+
queryKey: workspaceInfoOptions(getWorkspaceApiBase(workspaceId, queryClient)).queryKey,
|
|
158
|
+
refetchType: 'none'
|
|
159
|
+
})
|
|
160
|
+
void queryClient.invalidateQueries({ queryKey: workspaceKeys.layout(workspaceId) })
|
|
161
|
+
},
|
|
120
162
|
onSuccess: () => {
|
|
163
|
+
if (isRemoteWorkspace(workspaceId, queryClient))
|
|
164
|
+
void queryClient.invalidateQueries({
|
|
165
|
+
queryKey: workspaceInfoOptions(getWorkspaceApiBase(workspaceId, queryClient)).queryKey
|
|
166
|
+
})
|
|
167
|
+
void queryClient.invalidateQueries({ queryKey: workspaceKeys.all, exact: true })
|
|
121
168
|
queryClient.invalidateQueries({ queryKey: workspaceKeys.previews })
|
|
122
169
|
}
|
|
123
170
|
})
|
|
@@ -126,13 +173,13 @@ export function useSaveLayout(workspaceId: string) {
|
|
|
126
173
|
export function useChangeWorkspaceHarness(workspaceId: string) {
|
|
127
174
|
const queryClient = useQueryClient()
|
|
128
175
|
return useMutation({
|
|
129
|
-
mutationFn: (
|
|
176
|
+
mutationFn: (harness: HarnessType) =>
|
|
130
177
|
requestJson<WorkspaceEntry>(
|
|
131
178
|
`/api/workspaces/${workspaceId}/harness`,
|
|
132
|
-
jsonRequest('PATCH', {
|
|
179
|
+
jsonRequest('PATCH', { harness })
|
|
133
180
|
),
|
|
134
181
|
onSuccess: entry => {
|
|
135
|
-
void receiveWorkspaceHarness(queryClient, workspaceId, entry.
|
|
182
|
+
void receiveWorkspaceHarness(queryClient, workspaceId, entry.harness ?? 'claude-code')
|
|
136
183
|
}
|
|
137
184
|
})
|
|
138
185
|
}
|