moi-computer 0.12.1-next.3 → 0.13.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/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 +4 -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 +1 -1
- package/client/app/routes/workspace-route.tsx +21 -19
- 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-test-utils.tsx +4 -3
- package/client/features/app-settings/api.ts +33 -0
- package/client/features/app-settings/general-settings.tsx +39 -0
- package/client/features/{settings → app-settings}/settings-page.tsx +5 -1
- 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/tool-group/subagent-card.tsx +1 -0
- 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/components/user-avatar.tsx +4 -10
- package/client/features/collab/workspace-users-menu.tsx +1 -1
- package/client/features/connectors/api.ts +12 -4
- package/client/features/connectors/mcp-server-cards.tsx +17 -7
- package/client/features/connectors/read-connectors.ts +35 -0
- package/client/features/demo/demo-dialog.tsx +11 -3
- package/client/features/dev/collab/local-user-settings.tsx +1 -1
- 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/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 +6 -5
- 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 +89 -0
- package/client/features/{settings → workspace/settings}/api.ts +1 -34
- package/client/features/{settings → workspace/settings}/connectors-settings.tsx +31 -10
- package/client/features/workspace/settings/general-settings.tsx +180 -0
- 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/runtime/workspace-events.ts +21 -4
- package/client/runtime/workspace-theme.ts +9 -0
- package/client/tailwind-config.ts +43 -0
- package/dist/chunk-2y59vrxg.js +5 -0
- package/dist/chunk-58dyt9bk.js +2 -0
- package/dist/{chunk-tqd3pkg8.css → chunk-60q353jq.css} +1 -1
- package/dist/chunk-bncc7heg.js +1 -0
- package/dist/{chunk-11cab5dq.css → chunk-cq2r11fg.css} +1 -1
- package/dist/chunk-cqt3s31j.js +546 -0
- package/dist/chunk-dcmks9sm.js +75 -0
- package/dist/chunk-md45evr2.css +1 -0
- package/dist/chunk-n0nab26d.js +1 -0
- package/dist/chunk-nf2wkvf9.js +14 -0
- package/dist/chunk-nmzhgyp9.js +2 -0
- package/dist/chunk-q37knr3m.js +2 -0
- package/dist/chunk-s90m4qkz.js +1 -0
- package/dist/chunk-wjvd4byz.js +2 -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 +75 -64
- 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 +11 -8
- package/server/README.md +27 -25
- package/server/api/harnesses.ts +31 -8
- package/server/api/index.ts +189 -127
- package/server/api/onboarding.ts +46 -0
- package/server/app-config.ts +16 -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 +5 -6
- package/server/harness/claude-code/mcp.ts +17 -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 +22 -10
- package/server/harness/codex/adapter.ts +14 -17
- package/server/harness/codex/client.ts +8 -5
- package/server/harness/codex/connectors.ts +92 -0
- package/server/harness/codex/index.ts +4 -1
- package/server/harness/codex/pagination.ts +8 -5
- 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/codex/transport.ts +13 -6
- 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 +30 -3
- 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 +22 -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 -6
- package/server/workspaces/layout.ts +3 -0
- package/server/workspaces/registry.ts +27 -1
- 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 +167 -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/settings/general-settings.tsx +0 -103
- package/client/features/workspace/setup/workspace-setup-panel.tsx +0 -18
- package/dist/chunk-20ynagd4.js +0 -2
- package/dist/chunk-42tde9a6.js +0 -1
- package/dist/chunk-9w543s0r.js +0 -2
- package/dist/chunk-a5372n61.js +0 -546
- package/dist/chunk-aja9y1vn.js +0 -68
- package/dist/chunk-fvcvrh3d.css +0 -1
- package/dist/chunk-gtfjw3nx.js +0 -1
- package/dist/chunk-j39y2aky.js +0 -14
- package/dist/chunk-pcnahct1.js +0 -5
- package/dist/chunk-pja30km3.js +0 -1
- package/dist/chunk-rm894bc2.js +0 -2
- package/dist/chunk-tevvtfbk.js +0 -10
- package/dist/chunk-tgt9zd0r.js +0 -2
- package/dist/chunk-tv5k5z00.js +0 -1
- package/dist/chunk-zq2ae5dx.js +0 -2
- package/lib/experimental.ts +0 -14
- package/workspace/.claude/skills/moi-workspace/references/DESIGN.md +0 -157
- /package/client/features/{settings → app-settings}/profile-settings.tsx +0 -0
- /package/client/features/{settings → app-settings}/settings-section.tsx +0 -0
- /package/client/features/{settings → app-settings}/users-settings.tsx +0 -0
- /package/client/features/{settings → workspace/settings}/environment-settings.tsx +0 -0
- /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
|
@@ -1,28 +1,81 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { SpeedMode } from '@/lib/types'
|
|
2
|
+
import type {
|
|
3
|
+
CompiledView,
|
|
4
|
+
MessageAttachment,
|
|
5
|
+
PendingView,
|
|
6
|
+
SelectedSessionScope,
|
|
7
|
+
ViewInfo,
|
|
8
|
+
WorkspaceState
|
|
9
|
+
} from '@/lib/types'
|
|
10
|
+
import { useMutation, useQuery, useQueryClient, type QueryClient } from '@tanstack/react-query'
|
|
11
|
+
import { useMemo } from 'react'
|
|
3
12
|
import { jsonRequest, requestJson, requestVoid } from '@/client/api/http'
|
|
4
|
-
import { WORKSPACE_RESOURCE_OPTIONS } from '@/client/api/query-options'
|
|
5
13
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
14
|
+
import {
|
|
15
|
+
getCachedWorkspaceState,
|
|
16
|
+
useWorkspaceState
|
|
17
|
+
} from '@/client/features/workspace/workspace-state'
|
|
6
18
|
import { useWorkspaceEvent } from '@/client/runtime/use-workspace-events'
|
|
7
19
|
|
|
20
|
+
// Compiled views from `.moi/views/`. Build and layout events refetch the list;
|
|
21
|
+
// mounts within 30 s reuse it.
|
|
22
|
+
export function compiledViewsOptions(workspaceId: string) {
|
|
23
|
+
return {
|
|
24
|
+
queryKey: workspaceKeys.views(workspaceId),
|
|
25
|
+
queryFn: async () =>
|
|
26
|
+
(await requestJson<{ views: CompiledView[] }>(`/api/workspaces/${workspaceId}/views`)).views,
|
|
27
|
+
staleTime: 30_000,
|
|
28
|
+
gcTime: 5 * 60_000,
|
|
29
|
+
refetchOnMount: true,
|
|
30
|
+
refetchOnWindowFocus: true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Compiled views first, then the views still being built (from the workspace
|
|
35
|
+
// state), in creation order. A view that just compiled shows once.
|
|
36
|
+
export function mergeViews(
|
|
37
|
+
compiled: CompiledView[] | undefined,
|
|
38
|
+
pending: WorkspaceState['pendingViews'] | undefined
|
|
39
|
+
): ViewInfo[] | undefined {
|
|
40
|
+
if (!compiled || !pending) return undefined
|
|
41
|
+
const ids = new Set(compiled.map(view => view.id))
|
|
42
|
+
const building = Object.entries(pending)
|
|
43
|
+
.filter(([id]) => !ids.has(id))
|
|
44
|
+
.map(([id, view]): PendingView => ({ id, ...view }))
|
|
45
|
+
return [...compiled, ...building]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function getCachedViews(
|
|
49
|
+
queryClient: QueryClient,
|
|
50
|
+
workspaceId: string
|
|
51
|
+
): ViewInfo[] | undefined {
|
|
52
|
+
return mergeViews(
|
|
53
|
+
queryClient.getQueryData<CompiledView[]>(workspaceKeys.views(workspaceId)),
|
|
54
|
+
getCachedWorkspaceState(queryClient, workspaceId)?.pendingViews
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const selectPendingViews = (state: WorkspaceState) => state.pendingViews
|
|
59
|
+
|
|
8
60
|
export function useViews(workspaceId: string) {
|
|
9
61
|
const queryClient = useQueryClient()
|
|
10
62
|
useWorkspaceEvent(event => {
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
event.
|
|
14
|
-
|
|
63
|
+
if (event.type === 'view-layout:updated' && event.workspaceId === workspaceId) {
|
|
64
|
+
const queryKey = workspaceKeys.views(workspaceId)
|
|
65
|
+
// The event is newer than an in-flight list request. Apply it immediately
|
|
66
|
+
// so the following state:changed can safely remove the pending view.
|
|
67
|
+
void queryClient.cancelQueries({ queryKey })
|
|
68
|
+
queryClient.setQueryData(queryKey, event.views)
|
|
69
|
+
}
|
|
70
|
+
if (event.type === 'view:deleted' && event.workspaceId === workspaceId) {
|
|
15
71
|
void queryClient.invalidateQueries({ queryKey: workspaceKeys.views(workspaceId) })
|
|
16
|
-
|
|
17
|
-
void queryClient.invalidateQueries({ queryKey: workspaceKeys.sessions(workspaceId) })
|
|
72
|
+
void queryClient.invalidateQueries({ queryKey: workspaceKeys.sessions(workspaceId) })
|
|
18
73
|
}
|
|
19
74
|
})
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
...WORKSPACE_RESOURCE_OPTIONS
|
|
25
|
-
})
|
|
75
|
+
const compiled = useQuery(compiledViewsOptions(workspaceId))
|
|
76
|
+
const pending = useWorkspaceState(workspaceId, selectPendingViews)
|
|
77
|
+
const data = useMemo(() => mergeViews(compiled.data, pending.data), [compiled.data, pending.data])
|
|
78
|
+
return { data, isLoading: compiled.isLoading || pending.isLoading }
|
|
26
79
|
}
|
|
27
80
|
function useViewMutation<T, Input>(workspaceId: string, mutationFn: (input: Input) => Promise<T>) {
|
|
28
81
|
const queryClient = useQueryClient()
|
|
@@ -78,7 +131,7 @@ export type SubmitViewInput = {
|
|
|
78
131
|
attachments?: MessageAttachment[]
|
|
79
132
|
model?: string
|
|
80
133
|
effort?: string
|
|
81
|
-
|
|
134
|
+
speedMode?: SpeedMode
|
|
82
135
|
stream?: boolean
|
|
83
136
|
}
|
|
84
137
|
export function useSubmitView(workspaceId: string) {
|
|
@@ -31,6 +31,7 @@ type PendingViewScreenProps = {
|
|
|
31
31
|
running: boolean
|
|
32
32
|
sketchSessionId?: string
|
|
33
33
|
chatDocked: boolean
|
|
34
|
+
chatOpen?: boolean
|
|
34
35
|
workspaceId: string
|
|
35
36
|
onEditingStart: () => void
|
|
36
37
|
onContinueInChat: () => void
|
|
@@ -45,6 +46,7 @@ export function PendingViewScreen({
|
|
|
45
46
|
running,
|
|
46
47
|
sketchSessionId,
|
|
47
48
|
chatDocked,
|
|
49
|
+
chatOpen = false,
|
|
48
50
|
workspaceId,
|
|
49
51
|
onEditingStart,
|
|
50
52
|
onContinueInChat,
|
|
@@ -57,9 +59,7 @@ export function PendingViewScreen({
|
|
|
57
59
|
active: active && pendingView.status === 'draft',
|
|
58
60
|
viewId: pendingView.id,
|
|
59
61
|
sessionId:
|
|
60
|
-
sketchSessionId ??
|
|
61
|
-
pendingView.executionSessionId ??
|
|
62
|
-
draftSessionId(viewTabId(pendingView.id)),
|
|
62
|
+
sketchSessionId ?? pendingView.buildSessionId ?? draftSessionId(viewTabId(pendingView.id)),
|
|
63
63
|
source: viewTabId(pendingView.id),
|
|
64
64
|
workspaceId,
|
|
65
65
|
onEditingStart,
|
|
@@ -79,6 +79,7 @@ export function PendingViewScreen({
|
|
|
79
79
|
<PendingViewScreenSketchSurface
|
|
80
80
|
active={active}
|
|
81
81
|
chatDocked={chatDocked}
|
|
82
|
+
chatOpen={chatOpen}
|
|
82
83
|
error={pendingView.error}
|
|
83
84
|
sketch={sketch}
|
|
84
85
|
displayStatus={displayStatus}
|
|
@@ -100,17 +101,25 @@ function PendingViewScreenStarting() {
|
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
type PendingViewScreenFailedProps = {
|
|
104
|
+
chatOpen?: boolean
|
|
103
105
|
error?: string
|
|
104
106
|
onOpenChat: () => void
|
|
105
107
|
onDiscard: () => void
|
|
106
108
|
}
|
|
107
109
|
|
|
108
|
-
function PendingViewScreenFailed({
|
|
110
|
+
function PendingViewScreenFailed({
|
|
111
|
+
error,
|
|
112
|
+
chatOpen,
|
|
113
|
+
onOpenChat,
|
|
114
|
+
onDiscard
|
|
115
|
+
}: PendingViewScreenFailedProps) {
|
|
109
116
|
return (
|
|
110
117
|
<PendingViewScreenStatusLayout>
|
|
111
118
|
<div className="pointer-events-auto flex max-w-md flex-col items-center gap-4 bg-radial from-background from-50% to-transparent to-75% p-8 text-center">
|
|
112
119
|
<p className="text-sm text-muted-foreground">{error}</p>
|
|
113
|
-
<Button onClick={onOpenChat}>
|
|
120
|
+
<Button variant={chatOpen ? 'secondary' : 'default'} onClick={onOpenChat}>
|
|
121
|
+
{chatOpen ? 'Go to chat' : 'Open chat'}
|
|
122
|
+
</Button>
|
|
114
123
|
<Button variant="secondary" onClick={onDiscard}>
|
|
115
124
|
Discard view
|
|
116
125
|
</Button>
|
|
@@ -122,6 +131,7 @@ function PendingViewScreenFailed({ error, onOpenChat, onDiscard }: PendingViewSc
|
|
|
122
131
|
type PendingViewScreenSketchSurfaceProps = {
|
|
123
132
|
active: boolean
|
|
124
133
|
chatDocked: boolean
|
|
134
|
+
chatOpen?: boolean
|
|
125
135
|
error?: string
|
|
126
136
|
sketch: ViewSketchController
|
|
127
137
|
displayStatus: 'draft' | 'starting' | 'building' | 'waiting' | 'failed'
|
|
@@ -132,6 +142,7 @@ type PendingViewScreenSketchSurfaceProps = {
|
|
|
132
142
|
function PendingViewScreenSketchSurface({
|
|
133
143
|
active,
|
|
134
144
|
chatDocked,
|
|
145
|
+
chatOpen = false,
|
|
135
146
|
error,
|
|
136
147
|
sketch,
|
|
137
148
|
displayStatus,
|
|
@@ -178,12 +189,18 @@ function PendingViewScreenSketchSurface({
|
|
|
178
189
|
{displayStatus === 'waiting' && (
|
|
179
190
|
<PendingViewScreenWaitingState
|
|
180
191
|
error={error}
|
|
192
|
+
chatOpen={chatOpen}
|
|
181
193
|
onDiscard={onDiscard}
|
|
182
194
|
onOpenChat={onOpenChat}
|
|
183
195
|
/>
|
|
184
196
|
)}
|
|
185
197
|
{displayStatus === 'failed' && (
|
|
186
|
-
<PendingViewScreenFailed
|
|
198
|
+
<PendingViewScreenFailed
|
|
199
|
+
chatOpen={chatOpen}
|
|
200
|
+
error={error}
|
|
201
|
+
onOpenChat={onOpenChat}
|
|
202
|
+
onDiscard={onDiscard}
|
|
203
|
+
/>
|
|
187
204
|
)}
|
|
188
205
|
</div>
|
|
189
206
|
)
|
|
@@ -225,6 +242,7 @@ function PendingViewScreenSketchBackground({
|
|
|
225
242
|
}
|
|
226
243
|
|
|
227
244
|
type PendingViewScreenWaitingStateProps = {
|
|
245
|
+
chatOpen?: boolean
|
|
228
246
|
error?: string
|
|
229
247
|
onDiscard: () => void
|
|
230
248
|
onOpenChat: () => void
|
|
@@ -232,6 +250,7 @@ type PendingViewScreenWaitingStateProps = {
|
|
|
232
250
|
|
|
233
251
|
function PendingViewScreenWaitingState({
|
|
234
252
|
error,
|
|
253
|
+
chatOpen,
|
|
235
254
|
onDiscard,
|
|
236
255
|
onOpenChat
|
|
237
256
|
}: PendingViewScreenWaitingStateProps) {
|
|
@@ -241,11 +260,13 @@ function PendingViewScreenWaitingState({
|
|
|
241
260
|
<div className="flex flex-col gap-1">
|
|
242
261
|
<h1 className="font-medium">The view needs your attention</h1>
|
|
243
262
|
<p className="text-sm text-muted-foreground">
|
|
244
|
-
{error ?? '
|
|
263
|
+
{error ?? 'Use the chat to work through the issue and continue'}
|
|
245
264
|
</p>
|
|
246
265
|
</div>
|
|
247
266
|
<div className="flex gap-2">
|
|
248
|
-
<Button onClick={onOpenChat}>
|
|
267
|
+
<Button variant={chatOpen ? 'secondary' : 'default'} onClick={onOpenChat}>
|
|
268
|
+
{chatOpen ? 'Go to chat' : 'Open chat'}
|
|
269
|
+
</Button>
|
|
249
270
|
<Button variant="secondary" onClick={onDiscard}>
|
|
250
271
|
Discard view
|
|
251
272
|
</Button>
|
|
@@ -264,7 +285,7 @@ function PendingViewScreenBuildingState({ controls }: PendingViewScreenBuildingS
|
|
|
264
285
|
|
|
265
286
|
return (
|
|
266
287
|
<PendingViewScreenStatusLayout>
|
|
267
|
-
{!hasStrokes && <Spinner className="size-
|
|
288
|
+
{!hasStrokes && <Spinner className="size-8 text-muted-foreground" stroke={0.75} />}
|
|
268
289
|
</PendingViewScreenStatusLayout>
|
|
269
290
|
)
|
|
270
291
|
}
|
|
@@ -11,13 +11,16 @@ import {
|
|
|
11
11
|
startOptimisticSession
|
|
12
12
|
} from '@/client/features/chat/chat-send'
|
|
13
13
|
import {
|
|
14
|
-
optimisticallySetSelectedSession,
|
|
15
14
|
renameSelectedSessionInCache,
|
|
15
|
+
setSelectedSessionInCache,
|
|
16
16
|
usePinnedSession
|
|
17
17
|
} from '@/client/features/chat/sessions/use-selected-session'
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
changeWorkspaceStateCache,
|
|
20
|
+
getCachedWorkspaceState
|
|
21
|
+
} from '@/client/features/workspace/workspace-state'
|
|
19
22
|
import { useCollabEnabled } from '@/client/features/collab'
|
|
20
|
-
import {
|
|
23
|
+
import { useWorkspaceHarness } from '@/client/features/workspace/api'
|
|
21
24
|
import { useWorkspaceLayoutCtx } from '@/client/features/workspace/workspace-layout-context'
|
|
22
25
|
import {
|
|
23
26
|
useCreateView,
|
|
@@ -26,7 +29,7 @@ import {
|
|
|
26
29
|
useSubmitView
|
|
27
30
|
} from '@/client/features/views/api'
|
|
28
31
|
import { recoverViewSubmission } from './view-submission'
|
|
29
|
-
import type { PendingView
|
|
32
|
+
import type { PendingView } from '@/lib/types'
|
|
30
33
|
import { viewTabId } from '@/lib/workspace-tabs'
|
|
31
34
|
|
|
32
35
|
export function useViewActions() {
|
|
@@ -35,7 +38,7 @@ export function useViewActions() {
|
|
|
35
38
|
const selectionScope = collabEnabled ? 'browser-tab' : 'shared'
|
|
36
39
|
const { workspaceId, layout } = useWorkspaceLayoutCtx()
|
|
37
40
|
const { pinnedSessionId } = usePinnedSession()
|
|
38
|
-
const modelData =
|
|
41
|
+
const modelData = useWorkspaceHarness(workspaceId).data
|
|
39
42
|
const createMutation = useCreateView(workspaceId)
|
|
40
43
|
const saveMutation = useSaveViewDraft(workspaceId)
|
|
41
44
|
const submitMutation = useSubmitView(workspaceId)
|
|
@@ -64,7 +67,7 @@ export function useViewActions() {
|
|
|
64
67
|
})
|
|
65
68
|
if (!pinnedSessionId) {
|
|
66
69
|
moveChatDraft(workspaceId, draftId, sessionId)
|
|
67
|
-
|
|
70
|
+
setSelectedSessionInCache(
|
|
68
71
|
queryClient,
|
|
69
72
|
workspaceId,
|
|
70
73
|
sessionId,
|
|
@@ -77,23 +80,19 @@ export function useViewActions() {
|
|
|
77
80
|
attachments
|
|
78
81
|
)
|
|
79
82
|
|
|
80
|
-
const config = queryClient
|
|
81
|
-
|
|
82
|
-
)?.config
|
|
83
|
-
const { model, effort, fastMode, stream } = resolveChatRunOptions(
|
|
83
|
+
const config = getCachedWorkspaceState(queryClient, workspaceId)?.sessions[sessionId]?.config
|
|
84
|
+
const { model, effort, speedMode, stream } = resolveChatRunOptions(
|
|
84
85
|
modelData,
|
|
85
86
|
config?.model ?? layout.selectedModel,
|
|
86
87
|
config?.effort ?? layout.selectedEffort,
|
|
87
|
-
config?.
|
|
88
|
+
config?.speedMode ?? layout.selectedSpeedMode
|
|
88
89
|
)
|
|
89
90
|
|
|
90
|
-
queryClient
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
)
|
|
96
|
-
)
|
|
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
|
+
})
|
|
97
96
|
|
|
98
97
|
try {
|
|
99
98
|
const result = await submitMutation.mutateAsync({
|
|
@@ -109,13 +108,13 @@ export function useViewActions() {
|
|
|
109
108
|
: {}),
|
|
110
109
|
model,
|
|
111
110
|
effort,
|
|
112
|
-
|
|
111
|
+
speedMode,
|
|
113
112
|
stream
|
|
114
113
|
})
|
|
115
114
|
moveChatDraft(workspaceId, sessionId, result.sessionId)
|
|
116
115
|
renameSelectedSessionInCache(queryClient, workspaceId, sessionId, result.sessionId)
|
|
117
116
|
if (!pinnedSessionId)
|
|
118
|
-
|
|
117
|
+
setSelectedSessionInCache(
|
|
119
118
|
queryClient,
|
|
120
119
|
workspaceId,
|
|
121
120
|
result.sessionId,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IconArticle, type TablerIcon } from '@tabler/icons-react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { resolveIdentityIcon } from '@/client/lib/identity-icon-registry'
|
|
4
4
|
import type { ViewInfo } from '@/lib/types'
|
|
5
5
|
|
|
6
6
|
export function getViewLabel(view: ViewInfo): string {
|
|
@@ -8,5 +8,5 @@ export function getViewLabel(view: ViewInfo): string {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export function getViewIcon(view: ViewInfo): TablerIcon {
|
|
11
|
-
return
|
|
11
|
+
return resolveIdentityIcon(view.icon) ?? IconArticle
|
|
12
12
|
}
|
|
@@ -1,28 +1,22 @@
|
|
|
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 { appUiKeys } from '@/client/api/app-ui-keys'
|
|
5
4
|
import {
|
|
6
5
|
readSelectedSession,
|
|
7
|
-
writeSelectedSession
|
|
6
|
+
writeSelectedSession,
|
|
7
|
+
type BrowserTabSelection
|
|
8
8
|
} from '@/client/features/chat/sessions/browser-tab-state'
|
|
9
|
-
import {
|
|
9
|
+
import { browserTabSelectionKey } from '@/client/features/chat/sessions/use-selected-session'
|
|
10
10
|
import { moveChatDraft } from '@/client/features/chat/chat-send'
|
|
11
11
|
import { liveStore } from '@/client/features/chat/chat-store'
|
|
12
|
+
import {
|
|
13
|
+
getCachedWorkspaceState,
|
|
14
|
+
receiveWorkspaceState
|
|
15
|
+
} from '@/client/features/workspace/workspace-state'
|
|
12
16
|
import { useUiStore } from '@/client/store/ui'
|
|
13
17
|
import { composerDraftKey, draftSessionId } from '@/lib/session-drafts'
|
|
14
18
|
import { viewTabId } from '@/lib/workspace-tabs'
|
|
15
|
-
import type {
|
|
16
|
-
PendingView,
|
|
17
|
-
SelectedSessionScope,
|
|
18
|
-
SessionInfo,
|
|
19
|
-
ViewInfo,
|
|
20
|
-
WorkspaceSessionSelection
|
|
21
|
-
} from '@/lib/types'
|
|
22
|
-
|
|
23
|
-
function pendingView(view: ViewInfo | undefined): PendingView | undefined {
|
|
24
|
-
return view?.status === 'compiled' ? undefined : view
|
|
25
|
-
}
|
|
19
|
+
import type { SelectedSessionScope, SessionSummary, WorkspaceState } from '@/lib/types'
|
|
26
20
|
|
|
27
21
|
// A failed HTTP response does not prove startup failed. Refresh the server's
|
|
28
22
|
// state before restoring the fresh composer; never replay the request.
|
|
@@ -35,52 +29,45 @@ export async function recoverViewSubmission(
|
|
|
35
29
|
pinned: boolean,
|
|
36
30
|
selectionScope: SelectedSessionScope = 'shared'
|
|
37
31
|
) {
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)
|
|
43
|
-
let target = cachedView?.executionSessionId ?? sessionId
|
|
32
|
+
const tabId = viewTabId(viewId)
|
|
33
|
+
let target =
|
|
34
|
+
getCachedWorkspaceState(queryClient, workspaceId)?.pendingViews[viewId]?.buildSessionId ??
|
|
35
|
+
sessionId
|
|
44
36
|
try {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
requestJson<WorkspaceSessionSelection>(`/api/workspaces/${workspaceId}/selected-session`)
|
|
48
|
-
])
|
|
49
|
-
const view = pendingView(views.find(view => view.id === viewId))
|
|
37
|
+
const state = await requestJson<WorkspaceState>(`/api/workspaces/${workspaceId}/state`)
|
|
38
|
+
const view = state.pendingViews[viewId]
|
|
50
39
|
if (!pinned && view?.status === 'draft') {
|
|
51
|
-
target = draftSessionId(
|
|
52
|
-
queryClient.setQueryData<
|
|
40
|
+
target = draftSessionId(tabId)
|
|
41
|
+
queryClient.setQueryData<SessionSummary[]>(workspaceKeys.sessions(workspaceId), sessions =>
|
|
53
42
|
sessions?.filter(session => session.sessionId !== sessionId)
|
|
54
43
|
)
|
|
55
44
|
queryClient.removeQueries({ queryKey: workspaceKeys.events(workspaceId, sessionId) })
|
|
56
45
|
} else {
|
|
57
46
|
target =
|
|
58
|
-
view?.
|
|
59
|
-
(pinned ?
|
|
47
|
+
view?.buildSessionId ??
|
|
48
|
+
(pinned ? state.pinnedSessionId : state.selected[tabId]) ??
|
|
60
49
|
sessionId
|
|
61
50
|
}
|
|
62
51
|
moveChatDraft(workspaceId, sessionId, target)
|
|
63
52
|
if (view?.status === 'draft' || view?.status === 'failed')
|
|
64
53
|
liveStore.getState().setActivity(workspaceId, target, 'idle')
|
|
65
|
-
queryClient
|
|
66
|
-
queryClient.setQueryData(appUiKeys.sessionSelection(workspaceId), selection)
|
|
54
|
+
receiveWorkspaceState(queryClient, workspaceId, state)
|
|
67
55
|
if (selectionScope === 'browser-tab' && !pinned) {
|
|
68
56
|
const local =
|
|
69
|
-
queryClient.getQueryData<
|
|
70
|
-
|
|
71
|
-
) ?? readSelectedSession(workspaceId)
|
|
57
|
+
queryClient.getQueryData<BrowserTabSelection>(browserTabSelectionKey(workspaceId)) ??
|
|
58
|
+
readSelectedSession(workspaceId)
|
|
72
59
|
const selected = { ...local.selected }
|
|
73
|
-
if (view?.status === 'draft') delete selected[
|
|
74
|
-
else selected[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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 })
|
|
78
66
|
}
|
|
79
67
|
} catch {
|
|
80
68
|
moveChatDraft(workspaceId, sessionId, target)
|
|
81
69
|
// Offline: retain the draft at its current identity until state can refresh.
|
|
82
|
-
void queryClient.invalidateQueries({ queryKey: workspaceKeys.
|
|
83
|
-
void queryClient.invalidateQueries({ queryKey: appUiKeys.sessionSelection(workspaceId) })
|
|
70
|
+
void queryClient.invalidateQueries({ queryKey: workspaceKeys.state(workspaceId) })
|
|
84
71
|
}
|
|
85
72
|
const draftKey = composerDraftKey(workspaceId, target)
|
|
86
73
|
const ui = useUiStore.getState()
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { useMutation,
|
|
1
|
+
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
|
2
2
|
|
|
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 {
|
|
7
|
-
DiscoveredWorkspace,
|
|
8
|
-
HarnessInstallations,
|
|
9
|
-
WorkspaceEntry,
|
|
10
|
-
WorkspaceType
|
|
11
|
-
} from '@/lib/types'
|
|
6
|
+
import type { DiscoveredWorkspace, WorkspaceEntry, WorkspaceType } from '@/lib/types'
|
|
12
7
|
|
|
13
8
|
export function upsertWorkspaceEntry(
|
|
14
9
|
entries: WorkspaceEntry[] | undefined,
|
|
@@ -42,23 +37,8 @@ export type ImportWorkspaceInput = {
|
|
|
42
37
|
type: WorkspaceType
|
|
43
38
|
}
|
|
44
39
|
|
|
45
|
-
export type WorkspaceCreationInfo = {
|
|
46
|
-
installed: HarnessInstallations
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function useWorkspaceCreationInfo() {
|
|
50
|
-
return useQuery<WorkspaceCreationInfo>({
|
|
51
|
-
queryKey: workspaceKeys.creationInfo,
|
|
52
|
-
// Installations can change while the app is open (the user installs the
|
|
53
|
-
// agent CLI) — refetch on mount instead of caching forever.
|
|
54
|
-
queryFn: () => requestJson('/api/workspaces/create'),
|
|
55
|
-
staleTime: 30_000,
|
|
56
|
-
refetchOnMount: 'always'
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
|
|
60
40
|
export type CreateWorkspaceInput = {
|
|
61
|
-
name
|
|
41
|
+
name?: string
|
|
62
42
|
type: WorkspaceType
|
|
63
43
|
}
|
|
64
44
|
|
|
@@ -2,7 +2,8 @@ import { type FormEvent, type ReactElement, useState } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { useLocation } from 'wouter'
|
|
4
4
|
|
|
5
|
-
import { useCreateWorkspace
|
|
5
|
+
import { useCreateWorkspace } from '@/client/features/workspace/add/api'
|
|
6
|
+
import { useHarnessStatuses } from '@/client/features/harness/api'
|
|
6
7
|
import { useAppConfig } from '@/client/api/app-config'
|
|
7
8
|
import { Button } from '@/client/components/ui/button'
|
|
8
9
|
import {
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
} from '@/client/components/ui/dialog'
|
|
14
15
|
import { Input } from '@/client/components/ui/input'
|
|
15
16
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip'
|
|
16
|
-
import {
|
|
17
|
+
import { validateWorkspaceName } from '@/lib/workspace-name'
|
|
17
18
|
import { WORKSPACE_TYPE_ORDER } from '@/lib/workspace-types'
|
|
18
19
|
import type { WorkspaceType } from '@/lib/types'
|
|
19
20
|
|
|
@@ -34,7 +35,7 @@ const DEFAULT_WORKSPACE_TYPE = WORKSPACE_TYPE_ORDER[0]
|
|
|
34
35
|
export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
35
36
|
const [, navigate] = useLocation()
|
|
36
37
|
const appConfig = useAppConfig()
|
|
37
|
-
const info =
|
|
38
|
+
const info = useHarnessStatuses()
|
|
38
39
|
const createMutation = useCreateWorkspace()
|
|
39
40
|
|
|
40
41
|
const [open, setOpen] = useState(false)
|
|
@@ -43,10 +44,10 @@ export function CreateWorkspaceDialog({ trigger }: CreateWorkspaceDialogProps) {
|
|
|
43
44
|
const [name, setName] = useState('')
|
|
44
45
|
|
|
45
46
|
const trimmedName = name.trim()
|
|
46
|
-
const nameError = trimmedName ?
|
|
47
|
+
const nameError = trimmedName ? validateWorkspaceName(trimmedName) : null
|
|
47
48
|
const isCreating = createMutation.isPending
|
|
48
49
|
const isChecking = info.isPending || info.isFetching
|
|
49
|
-
const installed = info.isError ? undefined : info.data
|
|
50
|
+
const installed = info.isError ? undefined : info.data
|
|
50
51
|
const options = getWorkspaceAgentOptions(installed)
|
|
51
52
|
const selectedAvailable = options.some(option => option.type === type && !option.disabled)
|
|
52
53
|
const detectionError = !isChecking && !installed ? 'Could not check installed agents.' : undefined
|
|
@@ -6,7 +6,7 @@ import { workspaceDisplayName } from '@/client/features/workspace/workspace-pres
|
|
|
6
6
|
import type { WorkspaceType } from '@/lib/types'
|
|
7
7
|
|
|
8
8
|
import { WorkspaceAgentSelector } from './workspace-agent-selector'
|
|
9
|
-
import {
|
|
9
|
+
import { useHarnessStatuses } from '@/client/features/harness/api'
|
|
10
10
|
import { getWorkspaceAgentOptions } from './workspace-agent-options'
|
|
11
11
|
import { WorkspaceDialogContent } from './workspace-dialog-content'
|
|
12
12
|
import type { WorkspaceImportChoice } from './use-workspace-import'
|
|
@@ -29,9 +29,9 @@ export function ImportWorkspaceDialog({
|
|
|
29
29
|
onReset
|
|
30
30
|
}: ImportWorkspaceDialogProps) {
|
|
31
31
|
const [open, setOpen] = useState(true)
|
|
32
|
-
const info =
|
|
32
|
+
const info = useHarnessStatuses()
|
|
33
33
|
const isChecking = info.isPending || info.isFetching
|
|
34
|
-
const installed = info.isError ? undefined : info.data
|
|
34
|
+
const installed = info.isError ? undefined : info.data
|
|
35
35
|
const options = getWorkspaceAgentOptions(installed, choice.workspace.types)
|
|
36
36
|
const detectionError = !isChecking && !installed ? 'Could not check installed agents.' : undefined
|
|
37
37
|
const canImport =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { workspaceTypeDescription } from '@/client/features/workspace/workspace-presentation'
|
|
2
2
|
import { HARNESS_INSTRUCTIONS } from '@/lib/harness-instructions'
|
|
3
|
-
import type {
|
|
3
|
+
import type { HarnessStatuses, WorkspaceType } from '@/lib/types'
|
|
4
4
|
import { WORKSPACE_TYPE_ORDER } from '@/lib/workspace-types'
|
|
5
5
|
|
|
6
6
|
type WorkspaceAgentConfig = {
|
|
@@ -14,25 +14,24 @@ const workspaceAgents: Record<WorkspaceType, WorkspaceAgentConfig> = {
|
|
|
14
14
|
hermes: { importOnly: true }
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export type WorkspaceAgentOption
|
|
18
|
-
|
|
19
|
-
description: string
|
|
20
|
-
disabled: boolean
|
|
21
|
-
disabledReason?: string
|
|
22
|
-
disabledCommand?: string
|
|
23
|
-
}
|
|
17
|
+
export type { HarnessOption as WorkspaceAgentOption } from '@/client/features/harness/harness-selector'
|
|
18
|
+
import type { HarnessOption as WorkspaceAgentOption } from '@/client/features/harness/harness-selector'
|
|
24
19
|
|
|
25
20
|
export function getWorkspaceAgentOptions(
|
|
26
|
-
|
|
21
|
+
statuses?: HarnessStatuses,
|
|
27
22
|
detectedTypes: WorkspaceType[] = []
|
|
28
23
|
): WorkspaceAgentOption[] {
|
|
29
|
-
if (!
|
|
24
|
+
if (!statuses) return []
|
|
25
|
+
const installed = (type: WorkspaceType) => {
|
|
26
|
+
const availability = statuses[type].availability
|
|
27
|
+
return availability.status !== 'unavailable' || availability.code !== 'not-installed'
|
|
28
|
+
}
|
|
30
29
|
return WORKSPACE_TYPE_ORDER.filter(
|
|
31
|
-
type => installed
|
|
30
|
+
type => installed(type) || !workspaceAgents[type].importOnly
|
|
32
31
|
).map(type => {
|
|
33
32
|
const config = workspaceAgents[type]
|
|
34
33
|
const instruction = HARNESS_INSTRUCTIONS[type]
|
|
35
|
-
const disabled = !installed
|
|
34
|
+
const disabled = !installed(type) || (config.importOnly && !detectedTypes.includes(type))
|
|
36
35
|
return {
|
|
37
36
|
type,
|
|
38
37
|
description: workspaceTypeDescription[type],
|