moi-computer 0.13.1-next.0 → 0.13.1-next.2
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 -2
- 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 +37 -13
- 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 +18 -4
- package/client/features/account/api.ts +10 -8
- package/client/features/account/profile-actions.ts +5 -7
- package/client/features/app-settings/avatar-upload.tsx +62 -0
- package/client/features/app-settings/profile-settings.tsx +10 -0
- 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 +18 -100
- package/client/features/chat/use-chat.ts +8 -12
- package/client/features/collab/applet-api.ts +1 -1
- package/client/features/collab/components/cursors.tsx +6 -1
- package/client/features/collab/components/presence-avatars.tsx +1 -1
- package/client/features/collab/components/presence-frame.tsx +1 -1
- package/client/features/collab/components/presence-group.tsx +1 -1
- package/client/features/collab/components/presence-helpers.ts +2 -2
- package/client/features/collab/components/user-avatar-group.tsx +1 -1
- package/client/features/collab/components/user-avatar.tsx +1 -1
- package/client/features/collab/components/user.tsx +1 -1
- package/client/features/collab/index.ts +3 -3
- package/client/features/collab/members/api.ts +17 -0
- package/client/features/collab/members/hooks.ts +97 -0
- package/client/features/collab/members/store.ts +148 -0
- package/client/features/{workspace-members → collab/members}/types.ts +7 -5
- package/client/features/collab/{client.ts → presence/client.ts} +4 -5
- package/client/features/collab/{hooks.tsx → presence/hooks.tsx} +1 -1
- package/client/features/collab/{provider.tsx → presence/provider.tsx} +1 -12
- package/client/features/collab/{users.ts → presence/users.ts} +19 -21
- package/client/features/collab/proxy-user.ts +1 -3
- package/client/features/collab/sharing/agent-invite.tsx +30 -0
- package/client/features/collab/sharing/workspace-members.tsx +269 -0
- package/client/features/collab/sharing/workspace-sharing-menu.tsx +179 -0
- package/client/features/collab/testing/component-fixtures.tsx +3 -3
- package/client/features/collab/testing/fake-engine.ts +2 -2
- package/client/features/dev/chat-states-page.tsx +3 -1
- package/client/features/dev/collab/collab-playground.tsx +2 -2
- package/client/features/dev/dev-index-page.tsx +0 -6
- package/client/features/dev/dev-routes.tsx +0 -2
- package/client/features/dev/harness-debug-page.tsx +7 -7
- package/client/features/dev/workspace-setup-mocks.ts +1 -2
- 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 +5 -4
- 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 +34 -16
- package/client/features/views/use-view-actions.ts +10 -20
- 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 +2 -2
- package/client/features/workspace/use-workspace-navigation.ts +7 -4
- package/client/features/workspace/workspace-content.tsx +32 -26
- 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 +34 -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 +2 -1
- 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 +29 -9
- package/dist/chunk-44khk4sp.js +2 -0
- package/dist/chunk-ba6mz56s.js +72 -0
- package/dist/chunk-ec5ennpv.js +1 -0
- package/dist/chunk-ectsnw81.js +2 -0
- package/dist/chunk-en7w5ypg.js +1 -0
- package/dist/chunk-f695wcx5.js +5 -0
- package/dist/chunk-kffcah9w.css +1 -0
- package/dist/{chunk-kdgk4dac.js → chunk-n0fawy9x.js} +1 -1
- package/dist/chunk-pdt9hxfw.js +2 -0
- package/dist/chunk-rmd0ctfx.js +546 -0
- package/dist/chunk-zv22wv0g.js +1 -0
- package/dist/index.html +1 -1
- package/lib/harness-instructions.ts +4 -4
- package/lib/harness-types.ts +13 -0
- package/lib/types.ts +34 -50
- package/lib/workspace-config.ts +48 -0
- package/lib/workspace-layout.ts +2 -4
- package/package.json +4 -2
- package/server/README.md +29 -27
- package/server/api/harnesses.ts +5 -5
- package/server/api/index.ts +170 -68
- package/server/app-config.ts +2 -7
- package/server/applets/declarations.ts +6 -7
- 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 +96 -64
- package/server/cli/commands/openclaw.ts +2 -2
- package/server/cli/commands/refresh.ts +10 -1
- package/server/cli/commands/remote.ts +228 -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 +70 -0
- package/server/cli/remote-operations.ts +244 -0
- package/server/collab/config.ts +4 -8
- package/server/collab/manager.ts +5 -2
- package/server/collab/skill/index.ts +4 -50
- package/server/control.ts +38 -11
- 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 +1 -1
- 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/client.ts +665 -0
- package/server/remote/workspace.ts +34 -0
- package/server/scratchpad/document.ts +32 -12
- package/server/scratchpad/executor.ts +16 -7
- package/server/sessions/config.ts +8 -5
- package/server/sessions/pending-views.ts +16 -0
- package/server/sessions/view-sessions.ts +10 -12
- package/server/skills/locations.ts +4 -4
- package/server/skills/template.ts +3 -2
- package/server/skills/update.ts +12 -12
- package/server/skills/version.ts +7 -7
- package/server/skills/workspace.ts +13 -13
- package/server/web.ts +12 -10
- package/server/workspace-state/file.ts +2 -0
- package/server/workspace-state/index.ts +0 -4
- package/server/workspaces/api.ts +28 -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/scaffold.ts +1 -0
- package/server/workspaces/shared.ts +74 -0
- package/server/workspaces/tabs.ts +6 -12
- package/skill/SKILL.md +24 -4
- package/client/api/app-ui-keys.ts +0 -6
- package/client/features/chat/sessions/browser-tab-state.ts +0 -43
- package/client/features/collab/workspace-users-menu.tsx +0 -190
- package/client/features/dev/cloud-avatar-upload.tsx +0 -58
- package/client/features/dev/cloud-page.tsx +0 -363
- package/client/features/workspace/browser-tab-state.ts +0 -51
- package/client/features/workspace/layout-save.ts +0 -13
- package/client/features/workspace-members/api.ts +0 -20
- package/client/features/workspace-members/hooks.ts +0 -127
- package/client/features/workspace-members/keys.ts +0 -6
- package/client/features/workspace-members/store.ts +0 -123
- package/dist/chunk-00s35r33.js +0 -546
- package/dist/chunk-7rz6g7g7.js +0 -1
- package/dist/chunk-af2jyddf.js +0 -2
- package/dist/chunk-cekekc3f.css +0 -1
- package/dist/chunk-ep5vh16c.js +0 -75
- package/dist/chunk-s5s1vzdw.js +0 -2
- package/dist/chunk-svxhxfeq.js +0 -2
- package/dist/chunk-t0r0bds1.js +0 -1
- package/dist/chunk-vp2qzc0d.js +0 -1
- package/dist/chunk-wz5qv1bn.js +0 -2
- package/lib/workspace-types.ts +0 -13
- package/server/workspace-state/legacy-migration.ts +0 -79
- /package/client/features/collab/{presence-publisher.ts → presence/presence-publisher.ts} +0 -0
- /package/client/features/collab/{presence-target.ts → presence/presence-target.ts} +0 -0
- /package/client/features/collab/{store.ts → presence/store.ts} +0 -0
|
@@ -7,12 +7,6 @@ type DevRouteEntry = {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const DEV_ROUTES: DevRouteEntry[] = [
|
|
10
|
-
{
|
|
11
|
-
path: '/dev/cloud',
|
|
12
|
-
title: 'Workspace sharing',
|
|
13
|
-
description:
|
|
14
|
-
'Inspect identity and workspace members, update your profile, and test invitations.'
|
|
15
|
-
},
|
|
16
10
|
{
|
|
17
11
|
path: '/dev/onboarding',
|
|
18
12
|
title: 'Onboarding ideas',
|
|
@@ -10,7 +10,6 @@ import { TextureLabPage } from './texture-lab-page'
|
|
|
10
10
|
import { ToolCallsPage } from './tool-calls-page'
|
|
11
11
|
import { UiComponentsPage } from './ui-components/ui-components-page'
|
|
12
12
|
import { OnboardingPreviewPage } from './onboarding-preview-page'
|
|
13
|
-
import { CloudPage } from './cloud-page'
|
|
14
13
|
|
|
15
14
|
// All /dev/* routes live with their pages here and load only in development;
|
|
16
15
|
// see the dynamic import in AppRouter. /dev itself is the index; list new
|
|
@@ -22,7 +21,6 @@ const CollabPage = lazy(() =>
|
|
|
22
21
|
export default function DevRoutes() {
|
|
23
22
|
return (
|
|
24
23
|
<Switch>
|
|
25
|
-
<Route path="/dev/cloud" component={CloudPage} />
|
|
26
24
|
<Route path="/dev/onboarding" component={OnboardingPreviewPage} />
|
|
27
25
|
<Route path="/dev/collab-kit">
|
|
28
26
|
<Redirect to="/dev/collab" />
|
|
@@ -20,7 +20,7 @@ type BroadcastFrame = { seq: number; ts: number; frame: unknown }
|
|
|
20
20
|
type ProcessInfo = { running: boolean; pid?: number; binary: string | null }
|
|
21
21
|
|
|
22
22
|
type DebugPayload = {
|
|
23
|
-
|
|
23
|
+
harness: string
|
|
24
24
|
process: ProcessInfo | null
|
|
25
25
|
wire: WireFrame[]
|
|
26
26
|
broadcasts: BroadcastFrame[]
|
|
@@ -231,7 +231,7 @@ export function HarnessDebugPage() {
|
|
|
231
231
|
[setSearchParams]
|
|
232
232
|
)
|
|
233
233
|
|
|
234
|
-
const
|
|
234
|
+
const harness = workspaces.find(w => w.id === workspaceId)?.harness ?? 'claude-code'
|
|
235
235
|
|
|
236
236
|
// Model list for the selected workspace.
|
|
237
237
|
useEffect(() => {
|
|
@@ -388,7 +388,7 @@ export function HarnessDebugPage() {
|
|
|
388
388
|
{workspaces.length === 0 && <option value="">no workspaces</option>}
|
|
389
389
|
{workspaces.map(w => (
|
|
390
390
|
<option key={w.id} value={w.id}>
|
|
391
|
-
{`${w.name ?? w.displayPath ?? w.path} · ${w.
|
|
391
|
+
{`${w.name ?? w.displayPath ?? w.path} · ${w.harness ?? 'claude-code'}`}
|
|
392
392
|
</option>
|
|
393
393
|
))}
|
|
394
394
|
</select>
|
|
@@ -421,7 +421,7 @@ export function HarnessDebugPage() {
|
|
|
421
421
|
stream
|
|
422
422
|
</label>
|
|
423
423
|
<span className="grow" />
|
|
424
|
-
{
|
|
424
|
+
{harness === 'codex' && (
|
|
425
425
|
<span
|
|
426
426
|
className={cn(
|
|
427
427
|
'rounded px-1.5 py-0.5 font-mono text-[10px]',
|
|
@@ -472,11 +472,11 @@ export function HarnessDebugPage() {
|
|
|
472
472
|
{/* Dynamic drag geometry can't be a static Tailwind class */}
|
|
473
473
|
<div className="flex min-w-0" style={{ width: `${leftPct}%` }}>
|
|
474
474
|
<Pane
|
|
475
|
-
title={
|
|
475
|
+
title={harness === 'codex' ? 'App-server wire' : 'Harness wire'}
|
|
476
476
|
hint={
|
|
477
|
-
|
|
477
|
+
harness === 'codex'
|
|
478
478
|
? 'raw JSON-RPC, both directions'
|
|
479
|
-
:
|
|
479
|
+
: harness === 'openclaw'
|
|
480
480
|
? 'no wire tap for OpenClaw yet'
|
|
481
481
|
: 'raw Agent SDK messages + enqueued inputs'
|
|
482
482
|
}
|
|
@@ -46,7 +46,6 @@ export function createSetupMocks(
|
|
|
46
46
|
return Response.json({
|
|
47
47
|
environment,
|
|
48
48
|
demo: false,
|
|
49
|
-
collab: false,
|
|
50
49
|
demoInstallUrl: ''
|
|
51
50
|
})
|
|
52
51
|
}
|
|
@@ -54,7 +53,7 @@ export function createSetupMocks(
|
|
|
54
53
|
return new Response(null, { status: 204 })
|
|
55
54
|
if (path === `/api/workspaces/${PREVIEW_WORKSPACE_ID}/harness` && method === 'GET') {
|
|
56
55
|
return Response.json({
|
|
57
|
-
|
|
56
|
+
harness: harness,
|
|
58
57
|
availability,
|
|
59
58
|
models: [],
|
|
60
59
|
supportsStreaming: true,
|
|
@@ -22,7 +22,7 @@ import { useWorkspaceSetup } from '@/client/features/workspace/setup/workspace-s
|
|
|
22
22
|
import { WorkspaceWelcomeState } from '@/client/features/workspace/setup/workspace-welcome-state'
|
|
23
23
|
import { WorkspaceLoadingState } from '@/client/features/workspace/setup/workspace-recovery-states'
|
|
24
24
|
import type { AppEnvironment } from '@/lib/types'
|
|
25
|
-
import {
|
|
25
|
+
import { harnessLabel } from '@/client/features/harness/harness-presentation'
|
|
26
26
|
import { useHarnessStatus, type LoginHarness } from '@/client/features/harness/api'
|
|
27
27
|
import {
|
|
28
28
|
createSetupMocks,
|
|
@@ -104,7 +104,7 @@ function SetupPreview({ mocks, client, environment, harness, scenario }: SetupPr
|
|
|
104
104
|
variant={harness === value ? 'default' : 'secondary'}
|
|
105
105
|
onClick={() => restart({ harness: value })}
|
|
106
106
|
>
|
|
107
|
-
{
|
|
107
|
+
{harnessLabel[value]}
|
|
108
108
|
</Button>
|
|
109
109
|
))}
|
|
110
110
|
</div>
|
|
@@ -129,14 +129,16 @@ function SetupPreview({ mocks, client, environment, harness, scenario }: SetupPr
|
|
|
129
129
|
setLayout: update => setLayout(current => ({ ...current, ...update })),
|
|
130
130
|
name: 'My workspace',
|
|
131
131
|
cwd: null,
|
|
132
|
-
|
|
132
|
+
harness: harness,
|
|
133
|
+
apiBase: '/api/workspaces/test',
|
|
134
|
+
isRemote: false,
|
|
133
135
|
isLoading: false
|
|
134
136
|
}}
|
|
135
137
|
>
|
|
136
138
|
<main className="flex min-h-0 flex-1 overflow-y-auto bg-muted">
|
|
137
139
|
{scenario === 'welcome' ? (
|
|
138
140
|
<WorkspacePendingScreen setupRequired>
|
|
139
|
-
<WorkspaceWelcomeState name="My workspace"
|
|
141
|
+
<WorkspaceWelcomeState name="My workspace" harness={harness} />
|
|
140
142
|
</WorkspacePendingScreen>
|
|
141
143
|
) : scenario === 'loading' ? (
|
|
142
144
|
<WorkspacePendingScreen>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { queryOptions, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
2
2
|
import { jsonRequest, requestJson, requestVoid } from '@/client/api/http'
|
|
3
|
-
import type { HarnessStatuses, HarnessLogin,
|
|
3
|
+
import type { HarnessStatuses, HarnessLogin, HarnessType } from '@/lib/types'
|
|
4
4
|
|
|
5
|
-
export function startHarnessLogin(
|
|
5
|
+
export function startHarnessLogin(harness: HarnessType): Promise<HarnessLogin> {
|
|
6
6
|
return requestJson(
|
|
7
|
-
`/api/harnesses/${
|
|
7
|
+
`/api/harnesses/${harness}/auth/login`,
|
|
8
8
|
{ method: 'POST' },
|
|
9
9
|
'Could not start sign-in'
|
|
10
10
|
)
|
|
@@ -49,18 +49,21 @@ export function useHarnessStatuses() {
|
|
|
49
49
|
return useQuery(harnessStatusOptions)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
export function useHarnessStatus(
|
|
52
|
+
export function useHarnessStatus(harness: HarnessType | undefined) {
|
|
53
53
|
return useQuery({
|
|
54
54
|
...harnessStatusOptions,
|
|
55
|
-
enabled:
|
|
56
|
-
select: statuses => (
|
|
55
|
+
enabled: harness === 'claude-code' || harness === 'codex',
|
|
56
|
+
select: statuses => (harness ? statuses[harness] : undefined)
|
|
57
57
|
})
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export function submitHarnessLoginCode(
|
|
61
|
-
return requestVoid(
|
|
60
|
+
export function submitHarnessLoginCode(harness: HarnessType, id: string, code: string) {
|
|
61
|
+
return requestVoid(
|
|
62
|
+
`/api/harnesses/${harness}/auth/login/${id}/code`,
|
|
63
|
+
jsonRequest('POST', { code })
|
|
64
|
+
)
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
export function installHarness(
|
|
65
|
-
return requestVoid(`/api/harnesses/${
|
|
67
|
+
export function installHarness(harness: LoginHarness) {
|
|
68
|
+
return requestVoid(`/api/harnesses/${harness}/auth/install`, { method: 'POST' })
|
|
66
69
|
}
|
|
@@ -11,12 +11,16 @@ import { useHarnessLogin } from './use-harness-login'
|
|
|
11
11
|
import { useRetryHarnessStatus, type LoginHarness } from './api'
|
|
12
12
|
|
|
13
13
|
type HarnessLoginPanelProps = {
|
|
14
|
-
|
|
14
|
+
harness: LoginHarness
|
|
15
15
|
onConnected: () => void
|
|
16
16
|
connectedContent?: ReactNode
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export function HarnessLoginPanel({
|
|
19
|
+
export function HarnessLoginPanel({
|
|
20
|
+
harness,
|
|
21
|
+
onConnected,
|
|
22
|
+
connectedContent
|
|
23
|
+
}: HarnessLoginPanelProps) {
|
|
20
24
|
const {
|
|
21
25
|
auth,
|
|
22
26
|
needsInstall,
|
|
@@ -32,9 +36,9 @@ export function HarnessLoginPanel({ type, onConnected, connectedContent }: Harne
|
|
|
32
36
|
action,
|
|
33
37
|
checkError,
|
|
34
38
|
failure
|
|
35
|
-
} = useHarnessLogin(
|
|
39
|
+
} = useHarnessLogin(harness)
|
|
36
40
|
const retry = useRetryHarnessStatus()
|
|
37
|
-
const name = harnessLabel[
|
|
41
|
+
const name = harnessLabel[harness]
|
|
38
42
|
useEffect(() => {
|
|
39
43
|
if (connected) onConnected()
|
|
40
44
|
}, [connected, onConnected])
|
|
@@ -92,7 +96,7 @@ export function HarnessLoginPanel({ type, onConnected, connectedContent }: Harne
|
|
|
92
96
|
|
|
93
97
|
return (
|
|
94
98
|
<div className="mx-auto flex w-full max-w-5xl flex-1 flex-col items-center justify-center p-6 text-center">
|
|
95
|
-
<img src={harnessIcon[
|
|
99
|
+
<img src={harnessIcon[harness]} alt="" className="mb-4 size-10" />
|
|
96
100
|
<h1 className="text-center text-xl font-medium">Set up {name}</h1>
|
|
97
101
|
<section
|
|
98
102
|
className={cn('flex w-full flex-col items-center', !pending?.userCode && 'max-w-xs')}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export {
|
|
3
|
-
export const harnessLabel: Record<
|
|
1
|
+
import type { HarnessType } from '@/lib/types'
|
|
2
|
+
export { harnessIcon } from '@/client/components/shared/workspace-icon'
|
|
3
|
+
export const harnessLabel: Record<HarnessType, string> = {
|
|
4
4
|
'claude-code': 'Claude',
|
|
5
5
|
openclaw: 'OpenClaw',
|
|
6
6
|
codex: 'ChatGPT',
|
|
7
7
|
hermes: 'Hermes'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export const harnessDescription: Record<
|
|
10
|
+
export const harnessDescription: Record<HarnessType, string> = {
|
|
11
11
|
'claude-code': 'Anthropic',
|
|
12
12
|
codex: 'OpenAI',
|
|
13
13
|
openclaw: 'Open-source',
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IconCircleCheckFilled } from '@tabler/icons-react'
|
|
2
2
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/client/components/ui/tooltip'
|
|
3
3
|
import { cn } from '@/client/lib/cn'
|
|
4
|
-
import type {
|
|
4
|
+
import type { HarnessType } from '@/lib/types'
|
|
5
5
|
import { harnessLabel, harnessIcon } from './harness-presentation'
|
|
6
6
|
|
|
7
7
|
export type HarnessOption = {
|
|
8
|
-
|
|
8
|
+
harness: HarnessType
|
|
9
9
|
description: string
|
|
10
10
|
disabled: boolean
|
|
11
11
|
disabledReason?: string
|
|
@@ -17,8 +17,8 @@ type HarnessSelectorProps = {
|
|
|
17
17
|
cardClassName?: string
|
|
18
18
|
disabled: boolean
|
|
19
19
|
options: HarnessOption[]
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
selectedHarness?: HarnessType
|
|
21
|
+
onHarnessChange: (harness: HarnessType) => void
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export function HarnessSelector({
|
|
@@ -26,8 +26,8 @@ export function HarnessSelector({
|
|
|
26
26
|
cardClassName,
|
|
27
27
|
disabled,
|
|
28
28
|
options,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
selectedHarness,
|
|
30
|
+
onHarnessChange
|
|
31
31
|
}: HarnessSelectorProps) {
|
|
32
32
|
return (
|
|
33
33
|
<fieldset
|
|
@@ -37,11 +37,11 @@ export function HarnessSelector({
|
|
|
37
37
|
>
|
|
38
38
|
{options.map(option => (
|
|
39
39
|
<HarnessOptionButton
|
|
40
|
-
key={option.
|
|
40
|
+
key={option.harness}
|
|
41
41
|
option={option}
|
|
42
42
|
className={cardClassName}
|
|
43
|
-
selected={mode === 'select' ?
|
|
44
|
-
onSelect={
|
|
43
|
+
selected={mode === 'select' ? selectedHarness === option.harness : undefined}
|
|
44
|
+
onSelect={onHarnessChange}
|
|
45
45
|
/>
|
|
46
46
|
))}
|
|
47
47
|
</fieldset>
|
|
@@ -52,7 +52,7 @@ type HarnessOptionButtonProps = {
|
|
|
52
52
|
className?: string
|
|
53
53
|
option: HarnessOption
|
|
54
54
|
selected?: boolean
|
|
55
|
-
onSelect: (
|
|
55
|
+
onSelect: (harness: HarnessType) => void
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function HarnessOptionButton({ option, selected, onSelect, className }: HarnessOptionButtonProps) {
|
|
@@ -68,7 +68,7 @@ function HarnessOptionButton({ option, selected, onSelect, className }: HarnessO
|
|
|
68
68
|
event.preventDefault()
|
|
69
69
|
return
|
|
70
70
|
}
|
|
71
|
-
onSelect(option.
|
|
71
|
+
onSelect(option.harness)
|
|
72
72
|
}}
|
|
73
73
|
className={cn(
|
|
74
74
|
'relative flex h-32 min-w-32 flex-1 flex-col items-start justify-between gap-6 rounded-xl bg-card p-4 text-left ring-1 ring-border transition-opacity outline-none focus-visible:ring-3 focus-visible:ring-ring/50',
|
|
@@ -79,7 +79,7 @@ function HarnessOptionButton({ option, selected, onSelect, className }: HarnessO
|
|
|
79
79
|
)}
|
|
80
80
|
>
|
|
81
81
|
<span className="relative inline-flex">
|
|
82
|
-
<img src={harnessIcon[option.
|
|
82
|
+
<img src={harnessIcon[option.harness]} alt="" className="size-8 shrink-0" />
|
|
83
83
|
{selected && (
|
|
84
84
|
<IconCircleCheckFilled
|
|
85
85
|
size={16}
|
|
@@ -90,7 +90,7 @@ function HarnessOptionButton({ option, selected, onSelect, className }: HarnessO
|
|
|
90
90
|
)}
|
|
91
91
|
</span>
|
|
92
92
|
<span className="flex min-w-0 flex-col gap-0.5">
|
|
93
|
-
<span className="text-sm font-medium text-foreground">{harnessLabel[option.
|
|
93
|
+
<span className="text-sm font-medium text-foreground">{harnessLabel[option.harness]}</span>
|
|
94
94
|
<span className="text-xs leading-4 text-muted-foreground">{option.description}</span>
|
|
95
95
|
</span>
|
|
96
96
|
</button>
|
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
type LoginHarness
|
|
10
10
|
} from './api'
|
|
11
11
|
|
|
12
|
-
export function useHarnessLogin(
|
|
12
|
+
export function useHarnessLogin(harness: LoginHarness) {
|
|
13
13
|
const { environment, demo } = useAppConfig()
|
|
14
|
-
const auth = useHarnessStatus(
|
|
14
|
+
const auth = useHarnessStatus(harness)
|
|
15
15
|
const queryClient = useQueryClient()
|
|
16
16
|
const [code, setCode] = useState('')
|
|
17
17
|
const [manualLogin, setManualLogin] = useState(false)
|
|
@@ -23,17 +23,17 @@ export function useHarnessLogin(type: LoginHarness) {
|
|
|
23
23
|
const action = useMutation({
|
|
24
24
|
mutationFn: async (kind: 'install' | 'start' | 'submit') => {
|
|
25
25
|
if (kind === 'install') {
|
|
26
|
-
await installHarness(
|
|
26
|
+
await installHarness(harness)
|
|
27
27
|
const refreshed = await auth.refetch({ throwOnError: true })
|
|
28
28
|
if (refreshed.data?.availability.status === 'available') return
|
|
29
29
|
}
|
|
30
30
|
if (kind === 'start' || kind === 'install') {
|
|
31
31
|
setManualLogin(false)
|
|
32
32
|
setCode('')
|
|
33
|
-
await startHarnessLogin(
|
|
33
|
+
await startHarnessLogin(harness)
|
|
34
34
|
}
|
|
35
35
|
if (kind === 'submit' && pending) {
|
|
36
|
-
await submitHarnessLoginCode(
|
|
36
|
+
await submitHarnessLoginCode(harness, pending.id, code)
|
|
37
37
|
setCode('')
|
|
38
38
|
}
|
|
39
39
|
},
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { workspaceApiBase, type RemoteWorkspaceTarget } from '@/lib/workspace-config'
|
|
2
|
+
import { workspaceInfoOptions } from '../workspace/api'
|
|
3
|
+
import {
|
|
4
|
+
queryOptions,
|
|
5
|
+
useMutation,
|
|
6
|
+
useQuery,
|
|
7
|
+
useQueries,
|
|
8
|
+
useQueryClient
|
|
9
|
+
} from '@tanstack/react-query'
|
|
2
10
|
|
|
3
11
|
import { jsonRequest, requestJson, requestVoid } from '@/client/api/http'
|
|
4
12
|
import { workspaceKeys } from '@/client/api/workspace-keys'
|
|
@@ -8,7 +16,7 @@ import type { DiscoveredWorkspace, WorkspaceEntry, WorkspacePreview } from '@/li
|
|
|
8
16
|
export function useWorkspaces() {
|
|
9
17
|
return useQuery<WorkspaceEntry[]>({
|
|
10
18
|
queryKey: workspaceKeys.all,
|
|
11
|
-
queryFn: () => requestJson('/api/workspaces'),
|
|
19
|
+
queryFn: () => requestJson<WorkspaceEntry[]>('/api/workspaces'),
|
|
12
20
|
// Live events invalidate the list on every change. This only bounds how
|
|
13
21
|
// long a missed event (socket down) can leave it wrong; route switches
|
|
14
22
|
// within the window reuse the cache.
|
|
@@ -16,6 +24,34 @@ export function useWorkspaces() {
|
|
|
16
24
|
})
|
|
17
25
|
}
|
|
18
26
|
|
|
27
|
+
// Enrich a deduplicated list independently: local cards and healthy owners never
|
|
28
|
+
// wait for a slow owner. Home and sidebar share the same metadata requests.
|
|
29
|
+
export function useWorkspaceMetadata<T extends { remote?: RemoteWorkspaceTarget }>(
|
|
30
|
+
entries: T[]
|
|
31
|
+
): T[] {
|
|
32
|
+
const addresses = [
|
|
33
|
+
...new Set(
|
|
34
|
+
entries.flatMap(entry =>
|
|
35
|
+
entry.remote ? [workspaceApiBase(entry.remote.workspace_id, entry.remote.user_id)] : []
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
]
|
|
39
|
+
const queries = useQueries({ queries: addresses.map(workspaceInfoOptions) })
|
|
40
|
+
const byAddress = new Map(addresses.map((address, i) => [address, queries[i]?.data]))
|
|
41
|
+
return entries.map(entry => {
|
|
42
|
+
const info =
|
|
43
|
+
entry.remote &&
|
|
44
|
+
byAddress.get(workspaceApiBase(entry.remote.workspace_id, entry.remote.user_id))
|
|
45
|
+
if (!info || info.isRemote) return entry
|
|
46
|
+
return {
|
|
47
|
+
...entry,
|
|
48
|
+
...(info.name && { name: info.name }),
|
|
49
|
+
icon: info.icon,
|
|
50
|
+
theme: info.theme
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
19
55
|
const workspacePreviewsOptions = queryOptions({
|
|
20
56
|
queryKey: workspaceKeys.previews,
|
|
21
57
|
queryFn: () => requestJson<Record<string, WorkspacePreview>>('/api/workspaces/previews'),
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { WorkspaceInvitations } from './workspace-invitations'
|
|
2
|
+
import { homeWorkspaces, useSharedWorkspaces, type HomeWorkspace } from './shared-workspaces'
|
|
1
3
|
import { useState } from 'react'
|
|
2
4
|
|
|
3
5
|
import { IconChevronRight, IconEggCracked, IconLoader2, IconPlus } from '@tabler/icons-react'
|
|
@@ -7,7 +9,8 @@ import {
|
|
|
7
9
|
useDiscoveredWorkspaces,
|
|
8
10
|
useWorkspacePreview,
|
|
9
11
|
useWorkspacePreviews,
|
|
10
|
-
useWorkspaces
|
|
12
|
+
useWorkspaces,
|
|
13
|
+
useWorkspaceMetadata
|
|
11
14
|
} from './api'
|
|
12
15
|
import { CreateWorkspaceDialog } from '@/client/features/workspace/add/create-workspace-dialog'
|
|
13
16
|
import { ImportWorkspaceDialog } from '@/client/features/workspace/add/import-workspace-dialog'
|
|
@@ -33,7 +36,7 @@ import {
|
|
|
33
36
|
workspaceDisplayName
|
|
34
37
|
} from '@/client/features/workspace/workspace-presentation'
|
|
35
38
|
import { resolveWorkspaceTheme } from '@/lib/themes'
|
|
36
|
-
import type { DiscoveredWorkspace
|
|
39
|
+
import type { DiscoveredWorkspace } from '@/lib/types'
|
|
37
40
|
import { resolveUrl } from '@/lib/navigation'
|
|
38
41
|
|
|
39
42
|
import { WorkspacePreview } from './workspace-preview'
|
|
@@ -42,6 +45,7 @@ export function HomePage() {
|
|
|
42
45
|
usePreloadWorkspaceFonts()
|
|
43
46
|
const [, navigate] = useLocation()
|
|
44
47
|
const workspacesQuery = useWorkspaces()
|
|
48
|
+
const sharedQuery = useSharedWorkspaces()
|
|
45
49
|
useWorkspacePreviews()
|
|
46
50
|
const discoveredQuery = useDiscoveredWorkspaces()
|
|
47
51
|
const importFlow = useWorkspaceImport({
|
|
@@ -52,6 +56,13 @@ export function HomePage() {
|
|
|
52
56
|
const discoveredWorkspacesOpen = useUiStore(state => state.discoveredWorkspacesOpen)
|
|
53
57
|
const setDiscoveredWorkspacesOpen = useUiStore(state => state.setDiscoveredWorkspacesOpen)
|
|
54
58
|
|
|
59
|
+
const workspaces = useWorkspaceMetadata(
|
|
60
|
+
homeWorkspaces(
|
|
61
|
+
workspacesQuery.data ?? [],
|
|
62
|
+
appConfig.environment === 'cloud' ? (sharedQuery.data ?? []) : []
|
|
63
|
+
)
|
|
64
|
+
)
|
|
65
|
+
|
|
55
66
|
if (workspacesQuery.isPending || discoveredQuery.isPending) {
|
|
56
67
|
return (
|
|
57
68
|
<div className="flex min-h-[50vh] items-center justify-center">
|
|
@@ -68,7 +79,6 @@ export function HomePage() {
|
|
|
68
79
|
)
|
|
69
80
|
}
|
|
70
81
|
|
|
71
|
-
const workspaces = workspacesQuery.data
|
|
72
82
|
const discovered = discoveredQuery.data
|
|
73
83
|
const count = workspaces.length
|
|
74
84
|
|
|
@@ -119,6 +129,20 @@ export function HomePage() {
|
|
|
119
129
|
</div>
|
|
120
130
|
)}
|
|
121
131
|
|
|
132
|
+
{appConfig.environment === 'cloud' && sharedQuery.isPending && (
|
|
133
|
+
<p className="mb-12 text-sm text-muted-foreground">Loading shared workspaces…</p>
|
|
134
|
+
)}
|
|
135
|
+
{appConfig.environment === 'cloud' && sharedQuery.isError && (
|
|
136
|
+
<div className="mb-12" role="alert">
|
|
137
|
+
<p className="text-sm text-muted-foreground">{sharedQuery.error.message}</p>
|
|
138
|
+
<Button variant="ghost" onClick={() => void sharedQuery.refetch()}>
|
|
139
|
+
Retry
|
|
140
|
+
</Button>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
<WorkspaceInvitations />
|
|
145
|
+
|
|
122
146
|
{discovered.length > 0 && (
|
|
123
147
|
<section>
|
|
124
148
|
<Collapsible
|
|
@@ -159,7 +183,7 @@ export function HomePage() {
|
|
|
159
183
|
choice={importFlow.choice}
|
|
160
184
|
isPending={importFlow.isPending}
|
|
161
185
|
errorMessage={importFlow.error?.message}
|
|
162
|
-
|
|
186
|
+
onHarnessChange={importFlow.selectHarness}
|
|
163
187
|
onSubmit={importFlow.submit}
|
|
164
188
|
onReset={importFlow.reset}
|
|
165
189
|
/>
|
|
@@ -171,17 +195,19 @@ export function HomePage() {
|
|
|
171
195
|
}
|
|
172
196
|
|
|
173
197
|
type WorkspaceCardProps = {
|
|
174
|
-
workspace:
|
|
198
|
+
workspace: HomeWorkspace
|
|
175
199
|
}
|
|
176
200
|
|
|
177
201
|
function WorkspaceCard({ workspace }: WorkspaceCardProps) {
|
|
178
|
-
const name =
|
|
202
|
+
const name = workspace.name
|
|
179
203
|
const previewQuery = useWorkspacePreview(workspace.id)
|
|
180
204
|
const theme = workspace.theme ?? previewQuery.data?.theme
|
|
181
205
|
const agent = resolveWorkspaceTheme(theme).agent
|
|
182
206
|
const running = useLive(state => hasRunningWorkspaceActivity(state.activity, workspace.id))
|
|
183
|
-
const updatedAt =
|
|
184
|
-
|
|
207
|
+
const updatedAt =
|
|
208
|
+
previewQuery.data?.updatedAt ??
|
|
209
|
+
(workspace.addedAt ? new Date(workspace.addedAt).getTime() : undefined)
|
|
210
|
+
const workspaceHref = workspace.href
|
|
185
211
|
|
|
186
212
|
return (
|
|
187
213
|
<div className="group flex min-w-0 flex-col gap-3">
|
|
@@ -192,7 +218,7 @@ function WorkspaceCard({ workspace }: WorkspaceCardProps) {
|
|
|
192
218
|
aria-label={`Open ${name}`}
|
|
193
219
|
className="absolute inset-0 rounded-2xl outline-none focus-visible:ring-3 focus-visible:ring-ring/50"
|
|
194
220
|
/>
|
|
195
|
-
{previewQuery.data && (
|
|
221
|
+
{previewQuery.data && !workspace.remote && (
|
|
196
222
|
<Tooltip>
|
|
197
223
|
<TooltipTrigger
|
|
198
224
|
render={
|
|
@@ -227,13 +253,17 @@ function WorkspaceCard({ workspace }: WorkspaceCardProps) {
|
|
|
227
253
|
>
|
|
228
254
|
<WorkspaceIcon
|
|
229
255
|
icon={workspace.icon}
|
|
230
|
-
|
|
256
|
+
harness={workspace.harness}
|
|
231
257
|
workspaceTheme={theme}
|
|
232
258
|
className="size-4 shrink-0 rounded-xs"
|
|
233
259
|
/>
|
|
234
260
|
<span className="truncate text-sm font-medium text-foreground">{name}</span>
|
|
235
261
|
</div>
|
|
236
|
-
|
|
262
|
+
{(updatedAt !== undefined || workspace.ownerName) && (
|
|
263
|
+
<span className="text-xs text-muted-foreground">
|
|
264
|
+
{updatedAt !== undefined ? formatUpdatedAt(updatedAt) : workspace.ownerName}
|
|
265
|
+
</span>
|
|
266
|
+
)}
|
|
237
267
|
</Link>
|
|
238
268
|
</div>
|
|
239
269
|
)
|
|
@@ -245,11 +275,11 @@ type SuggestedRowProps = {
|
|
|
245
275
|
}
|
|
246
276
|
|
|
247
277
|
function SuggestedRow({ suggestion, onAdd }: SuggestedRowProps) {
|
|
248
|
-
const { path,
|
|
278
|
+
const { path, harnesses } = suggestion
|
|
249
279
|
const name = workspaceDisplayName(suggestion)
|
|
250
280
|
return (
|
|
251
281
|
<li className="flex items-center gap-2 border-b border-border px-1 py-3">
|
|
252
|
-
<WorkspaceAgentIcons
|
|
282
|
+
<WorkspaceAgentIcons harnesses={harnesses} />
|
|
253
283
|
<span className="shrink-0 text-sm font-medium text-foreground">{name}</span>
|
|
254
284
|
<span title={path} className="min-w-0 flex-1 truncate text-xs text-muted-foreground">
|
|
255
285
|
{suggestion.displayPath ?? path}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { useQuery } from '@tanstack/react-query'
|
|
2
|
+
import { useAppConfig } from '@/client/api/app-config'
|
|
3
|
+
import { cloudRequest } from '@/client/features/account/api'
|
|
4
|
+
import { workspaceDisplayName } from '@/client/features/workspace/workspace-presentation'
|
|
5
|
+
import { workspaceAddress } from '@/lib/workspace-config'
|
|
6
|
+
import type { WorkspaceEntry } from '@/lib/types'
|
|
7
|
+
|
|
8
|
+
export type SharedWorkspace = {
|
|
9
|
+
id: string
|
|
10
|
+
owner: { id: string; name: string }
|
|
11
|
+
name?: string
|
|
12
|
+
icon?: WorkspaceEntry['icon']
|
|
13
|
+
theme?: WorkspaceEntry['theme']
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function useSharedWorkspaces() {
|
|
17
|
+
const cloud = useAppConfig().environment === 'cloud'
|
|
18
|
+
return useQuery({
|
|
19
|
+
queryKey: ['shared-workspaces'],
|
|
20
|
+
enabled: cloud,
|
|
21
|
+
queryFn: async () => {
|
|
22
|
+
const { workspaces } = (await (await cloudRequest('/api/workspaces/shared')).json()) as {
|
|
23
|
+
workspaces: SharedWorkspace[]
|
|
24
|
+
}
|
|
25
|
+
return workspaces
|
|
26
|
+
},
|
|
27
|
+
staleTime: 60_000,
|
|
28
|
+
refetchOnWindowFocus: true,
|
|
29
|
+
retry: false
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type HomeWorkspace = Pick<WorkspaceEntry, 'id' | 'icon' | 'theme' | 'harness' | 'remote'> & {
|
|
34
|
+
name: string
|
|
35
|
+
href: string
|
|
36
|
+
addedAt?: string
|
|
37
|
+
ownerName?: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function homeWorkspaces(
|
|
41
|
+
entries: WorkspaceEntry[],
|
|
42
|
+
shares: SharedWorkspace[]
|
|
43
|
+
): HomeWorkspace[] {
|
|
44
|
+
const registered = new Set(
|
|
45
|
+
entries.flatMap(entry =>
|
|
46
|
+
entry.remote ? [workspaceAddress(entry.remote.workspace_id, entry.remote.user_id)] : []
|
|
47
|
+
)
|
|
48
|
+
)
|
|
49
|
+
const workspaces: HomeWorkspace[] = entries.map(entry => ({
|
|
50
|
+
...entry,
|
|
51
|
+
name: workspaceDisplayName(entry),
|
|
52
|
+
href: `/workspace/${entry.id}`
|
|
53
|
+
}))
|
|
54
|
+
const unopened: HomeWorkspace[] = []
|
|
55
|
+
for (const share of shares) {
|
|
56
|
+
const address = workspaceAddress(share.id, share.owner.id)
|
|
57
|
+
if (registered.has(address)) continue
|
|
58
|
+
registered.add(address)
|
|
59
|
+
unopened.push({
|
|
60
|
+
id: address,
|
|
61
|
+
name: share.name || share.id,
|
|
62
|
+
icon: share.icon,
|
|
63
|
+
theme: share.theme,
|
|
64
|
+
remote: { user_id: share.owner.id, workspace_id: share.id },
|
|
65
|
+
ownerName: share.owner.name,
|
|
66
|
+
href: `/workspace/${address}`
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
return [...unopened, ...workspaces]
|
|
70
|
+
}
|