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.
Files changed (230) hide show
  1. package/client/api/app-config.ts +12 -2
  2. package/client/api/http.ts +11 -1
  3. package/client/app/app-router.tsx +3 -2
  4. package/client/app/routes/home-route.tsx +1 -1
  5. package/client/app/routes/workspace-registration.tsx +68 -0
  6. package/client/app/routes/workspace-route.tsx +37 -13
  7. package/client/app/shell/sidebar-layout.tsx +10 -5
  8. package/client/components/shared/workspace-icon.tsx +8 -17
  9. package/client/features/account/account-test-utils.tsx +18 -4
  10. package/client/features/account/api.ts +10 -8
  11. package/client/features/account/profile-actions.ts +5 -7
  12. package/client/features/app-settings/avatar-upload.tsx +62 -0
  13. package/client/features/app-settings/profile-settings.tsx +10 -0
  14. package/client/features/app-settings/settings-page.tsx +2 -1
  15. package/client/features/applets/api.ts +6 -6
  16. package/client/features/applets/applet-cache.ts +6 -5
  17. package/client/features/applets/applet-log.ts +2 -1
  18. package/client/features/applets/applet-runtime.ts +2 -1
  19. package/client/features/applets/use-applet.ts +73 -18
  20. package/client/features/applets/widget-shell.tsx +4 -2
  21. package/client/features/chat/applet-chat-intents.ts +5 -13
  22. package/client/features/chat/chat-popup.tsx +8 -4
  23. package/client/features/chat/chat-send.ts +2 -2
  24. package/client/features/chat/composer/model-order.ts +4 -4
  25. package/client/features/chat/composer/model-picker.tsx +12 -10
  26. package/client/features/chat/composer/use-workspace-composer-state.tsx +1 -1
  27. package/client/features/chat/sessions/api.ts +11 -28
  28. package/client/features/chat/sessions/use-selected-session.ts +18 -100
  29. package/client/features/chat/use-chat.ts +8 -12
  30. package/client/features/collab/applet-api.ts +1 -1
  31. package/client/features/collab/components/cursors.tsx +6 -1
  32. package/client/features/collab/components/presence-avatars.tsx +1 -1
  33. package/client/features/collab/components/presence-frame.tsx +1 -1
  34. package/client/features/collab/components/presence-group.tsx +1 -1
  35. package/client/features/collab/components/presence-helpers.ts +2 -2
  36. package/client/features/collab/components/user-avatar-group.tsx +1 -1
  37. package/client/features/collab/components/user-avatar.tsx +1 -1
  38. package/client/features/collab/components/user.tsx +1 -1
  39. package/client/features/collab/index.ts +3 -3
  40. package/client/features/collab/members/api.ts +17 -0
  41. package/client/features/collab/members/hooks.ts +97 -0
  42. package/client/features/collab/members/store.ts +148 -0
  43. package/client/features/{workspace-members → collab/members}/types.ts +7 -5
  44. package/client/features/collab/{client.ts → presence/client.ts} +4 -5
  45. package/client/features/collab/{hooks.tsx → presence/hooks.tsx} +1 -1
  46. package/client/features/collab/{provider.tsx → presence/provider.tsx} +1 -12
  47. package/client/features/collab/{users.ts → presence/users.ts} +19 -21
  48. package/client/features/collab/proxy-user.ts +1 -3
  49. package/client/features/collab/sharing/agent-invite.tsx +30 -0
  50. package/client/features/collab/sharing/workspace-members.tsx +269 -0
  51. package/client/features/collab/sharing/workspace-sharing-menu.tsx +179 -0
  52. package/client/features/collab/testing/component-fixtures.tsx +3 -3
  53. package/client/features/collab/testing/fake-engine.ts +2 -2
  54. package/client/features/dev/chat-states-page.tsx +3 -1
  55. package/client/features/dev/collab/collab-playground.tsx +2 -2
  56. package/client/features/dev/dev-index-page.tsx +0 -6
  57. package/client/features/dev/dev-routes.tsx +0 -2
  58. package/client/features/dev/harness-debug-page.tsx +7 -7
  59. package/client/features/dev/workspace-setup-mocks.ts +1 -2
  60. package/client/features/dev/workspace-setup-preview.tsx +6 -4
  61. package/client/features/harness/api.ts +13 -10
  62. package/client/features/harness/harness-login-panel.tsx +9 -5
  63. package/client/features/harness/harness-presentation.ts +4 -4
  64. package/client/features/harness/harness-selector.tsx +13 -13
  65. package/client/features/harness/use-harness-login.ts +5 -5
  66. package/client/features/home/api.ts +38 -2
  67. package/client/features/home/home-page.tsx +43 -13
  68. package/client/features/home/shared-workspaces.tsx +70 -0
  69. package/client/features/home/workspace-invitations.tsx +101 -0
  70. package/client/features/identity/host-api.ts +5 -4
  71. package/client/features/identity/store.ts +1 -7
  72. package/client/features/onboarding/agent-setup-step.tsx +8 -8
  73. package/client/features/onboarding/onboarding-page.tsx +3 -2
  74. package/client/features/onboarding/workspace-setup-step.tsx +1 -1
  75. package/client/features/overview/api.ts +3 -5
  76. package/client/features/overview/default/registry.tsx +1 -1
  77. package/client/features/overview/default/views-widget.tsx +2 -2
  78. package/client/features/overview/hidden-panel.tsx +7 -5
  79. package/client/features/overview/overview.tsx +18 -16
  80. package/client/features/overview/workspace-name.tsx +2 -2
  81. package/client/features/scratchpad/scratchpad.tsx +9 -7
  82. package/client/features/scratchpad/use-scratchpad-snapshot.tsx +13 -5
  83. package/client/features/views/api.ts +34 -16
  84. package/client/features/views/use-view-actions.ts +10 -20
  85. package/client/features/views/view-manager.tsx +1 -1
  86. package/client/features/views/view-submission.ts +2 -21
  87. package/client/features/workspace/add/api.ts +5 -4
  88. package/client/features/workspace/add/create-workspace-dialog.tsx +12 -9
  89. package/client/features/workspace/add/import-workspace-dialog.tsx +7 -7
  90. package/client/features/workspace/add/use-workspace-import.ts +10 -10
  91. package/client/features/workspace/add/workspace-agent-options.ts +21 -20
  92. package/client/features/workspace/add/workspace-agent-selector.tsx +11 -11
  93. package/client/features/workspace/api.ts +60 -13
  94. package/client/features/workspace/harness-transition.ts +7 -13
  95. package/client/features/workspace/remote.ts +25 -0
  96. package/client/features/workspace/settings/api.ts +7 -12
  97. package/client/features/workspace/settings/connectors-settings.tsx +3 -3
  98. package/client/features/workspace/settings/general-settings.tsx +8 -8
  99. package/client/features/workspace/setup/workspace-login-state.tsx +4 -4
  100. package/client/features/workspace/setup/workspace-recovery-states.tsx +43 -14
  101. package/client/features/workspace/setup/workspace-setup.tsx +6 -6
  102. package/client/features/workspace/tab-resolution.ts +2 -2
  103. package/client/features/workspace/use-workspace-navigation.ts +7 -4
  104. package/client/features/workspace/workspace-content.tsx +32 -26
  105. package/client/features/workspace/workspace-frame.tsx +13 -26
  106. package/client/features/workspace/workspace-layout-context.tsx +45 -12
  107. package/client/features/workspace/workspace-menu.tsx +2 -2
  108. package/client/features/workspace/workspace-pane.tsx +22 -0
  109. package/client/features/workspace/workspace-pending-screen.tsx +1 -1
  110. package/client/features/workspace/workspace-preferences.ts +34 -0
  111. package/client/features/workspace/workspace-presentation.tsx +12 -16
  112. package/client/features/workspace/workspace-screen.tsx +2 -2
  113. package/client/features/workspace/workspace-state.ts +2 -1
  114. package/client/features/workspace/workspace-tabs.tsx +1 -1
  115. package/client/features/workspace/workspace-test-utils.ts +23 -0
  116. package/client/runtime/use-workspace-events.ts +14 -0
  117. package/client/runtime/workspace-events.ts +9 -9
  118. package/client/store/ui.ts +29 -9
  119. package/dist/chunk-44khk4sp.js +2 -0
  120. package/dist/chunk-ba6mz56s.js +72 -0
  121. package/dist/chunk-ec5ennpv.js +1 -0
  122. package/dist/chunk-ectsnw81.js +2 -0
  123. package/dist/chunk-en7w5ypg.js +1 -0
  124. package/dist/chunk-f695wcx5.js +5 -0
  125. package/dist/chunk-kffcah9w.css +1 -0
  126. package/dist/{chunk-kdgk4dac.js → chunk-n0fawy9x.js} +1 -1
  127. package/dist/chunk-pdt9hxfw.js +2 -0
  128. package/dist/chunk-rmd0ctfx.js +546 -0
  129. package/dist/chunk-zv22wv0g.js +1 -0
  130. package/dist/index.html +1 -1
  131. package/lib/harness-instructions.ts +4 -4
  132. package/lib/harness-types.ts +13 -0
  133. package/lib/types.ts +34 -50
  134. package/lib/workspace-config.ts +48 -0
  135. package/lib/workspace-layout.ts +2 -4
  136. package/package.json +4 -2
  137. package/server/README.md +29 -27
  138. package/server/api/harnesses.ts +5 -5
  139. package/server/api/index.ts +170 -68
  140. package/server/app-config.ts +2 -7
  141. package/server/applets/declarations.ts +6 -7
  142. package/server/applets/index.ts +15 -9
  143. package/server/applets/views.ts +2 -17
  144. package/server/applets/widgets.ts +3 -2
  145. package/server/cli/commands/config.ts +8 -20
  146. package/server/cli/commands/hermes.ts +2 -2
  147. package/server/cli/commands/init.ts +96 -64
  148. package/server/cli/commands/openclaw.ts +2 -2
  149. package/server/cli/commands/refresh.ts +10 -1
  150. package/server/cli/commands/remote.ts +228 -0
  151. package/server/cli/commands/skill.ts +4 -4
  152. package/server/cli/commands/tabs.ts +5 -12
  153. package/server/cli/control.ts +35 -4
  154. package/server/cli/index.ts +10 -6
  155. package/server/cli/remote-command.ts +77 -0
  156. package/server/cli/remote-control.ts +70 -0
  157. package/server/cli/remote-operations.ts +244 -0
  158. package/server/collab/config.ts +4 -8
  159. package/server/collab/manager.ts +5 -2
  160. package/server/collab/skill/index.ts +4 -50
  161. package/server/control.ts +38 -11
  162. package/server/harness/acp/session.ts +4 -4
  163. package/server/harness/auth.ts +26 -31
  164. package/server/harness/claude-code/index.ts +1 -1
  165. package/server/harness/codex/discovery.ts +1 -1
  166. package/server/harness/codex/session.ts +1 -1
  167. package/server/harness/detect.ts +14 -19
  168. package/server/harness/executable.ts +10 -10
  169. package/server/harness/hermes/NOTES.md +2 -2
  170. package/server/harness/hermes/index.ts +1 -1
  171. package/server/harness/install.ts +11 -11
  172. package/server/harness/openclaw/index.ts +1 -1
  173. package/server/harness/registry.ts +7 -6
  174. package/server/harness/types.ts +4 -4
  175. package/server/onboarding/jobs.ts +1 -1
  176. package/server/operations/commands.ts +46 -0
  177. package/server/operations/files.ts +148 -0
  178. package/server/operations/server.ts +206 -0
  179. package/server/remote/agent.ts +103 -0
  180. package/server/remote/client.ts +665 -0
  181. package/server/remote/workspace.ts +34 -0
  182. package/server/scratchpad/document.ts +32 -12
  183. package/server/scratchpad/executor.ts +16 -7
  184. package/server/sessions/config.ts +8 -5
  185. package/server/sessions/pending-views.ts +16 -0
  186. package/server/sessions/view-sessions.ts +10 -12
  187. package/server/skills/locations.ts +4 -4
  188. package/server/skills/template.ts +3 -2
  189. package/server/skills/update.ts +12 -12
  190. package/server/skills/version.ts +7 -7
  191. package/server/skills/workspace.ts +13 -13
  192. package/server/web.ts +12 -10
  193. package/server/workspace-state/file.ts +2 -0
  194. package/server/workspace-state/index.ts +0 -4
  195. package/server/workspaces/api.ts +28 -0
  196. package/server/workspaces/change-harness.ts +15 -26
  197. package/server/workspaces/import.ts +4 -4
  198. package/server/workspaces/init.ts +15 -13
  199. package/server/workspaces/layout.ts +60 -66
  200. package/server/workspaces/registry.ts +43 -18
  201. package/server/workspaces/scaffold.ts +1 -0
  202. package/server/workspaces/shared.ts +74 -0
  203. package/server/workspaces/tabs.ts +6 -12
  204. package/skill/SKILL.md +24 -4
  205. package/client/api/app-ui-keys.ts +0 -6
  206. package/client/features/chat/sessions/browser-tab-state.ts +0 -43
  207. package/client/features/collab/workspace-users-menu.tsx +0 -190
  208. package/client/features/dev/cloud-avatar-upload.tsx +0 -58
  209. package/client/features/dev/cloud-page.tsx +0 -363
  210. package/client/features/workspace/browser-tab-state.ts +0 -51
  211. package/client/features/workspace/layout-save.ts +0 -13
  212. package/client/features/workspace-members/api.ts +0 -20
  213. package/client/features/workspace-members/hooks.ts +0 -127
  214. package/client/features/workspace-members/keys.ts +0 -6
  215. package/client/features/workspace-members/store.ts +0 -123
  216. package/dist/chunk-00s35r33.js +0 -546
  217. package/dist/chunk-7rz6g7g7.js +0 -1
  218. package/dist/chunk-af2jyddf.js +0 -2
  219. package/dist/chunk-cekekc3f.css +0 -1
  220. package/dist/chunk-ep5vh16c.js +0 -75
  221. package/dist/chunk-s5s1vzdw.js +0 -2
  222. package/dist/chunk-svxhxfeq.js +0 -2
  223. package/dist/chunk-t0r0bds1.js +0 -1
  224. package/dist/chunk-vp2qzc0d.js +0 -1
  225. package/dist/chunk-wz5qv1bn.js +0 -2
  226. package/lib/workspace-types.ts +0 -13
  227. package/server/workspace-state/legacy-migration.ts +0 -79
  228. /package/client/features/collab/{presence-publisher.ts → presence/presence-publisher.ts} +0 -0
  229. /package/client/features/collab/{presence-target.ts → presence/presence-target.ts} +0 -0
  230. /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
- provider: string
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 provider = workspaces.find(w => w.id === workspaceId)?.type ?? 'claude-code'
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.type ?? 'claude-code'}`}
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
- {provider === 'codex' && (
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={provider === 'codex' ? 'App-server wire' : 'Harness wire'}
475
+ title={harness === 'codex' ? 'App-server wire' : 'Harness wire'}
476
476
  hint={
477
- provider === 'codex'
477
+ harness === 'codex'
478
478
  ? 'raw JSON-RPC, both directions'
479
- : provider === 'openclaw'
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
- provider: harness,
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 { workspaceTypeLabel } from '@/client/features/workspace/workspace-presentation'
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
- {workspaceTypeLabel[value]}
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
- provider: harness,
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" workspaceType={harness} />
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, WorkspaceType } from '@/lib/types'
3
+ import type { HarnessStatuses, HarnessLogin, HarnessType } from '@/lib/types'
4
4
 
5
- export function startHarnessLogin(type: WorkspaceType): Promise<HarnessLogin> {
5
+ export function startHarnessLogin(harness: HarnessType): Promise<HarnessLogin> {
6
6
  return requestJson(
7
- `/api/harnesses/${type}/auth/login`,
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(type: WorkspaceType | undefined) {
52
+ export function useHarnessStatus(harness: HarnessType | undefined) {
53
53
  return useQuery({
54
54
  ...harnessStatusOptions,
55
- enabled: type === 'claude-code' || type === 'codex',
56
- select: statuses => (type ? statuses[type] : undefined)
55
+ enabled: harness === 'claude-code' || harness === 'codex',
56
+ select: statuses => (harness ? statuses[harness] : undefined)
57
57
  })
58
58
  }
59
59
 
60
- export function submitHarnessLoginCode(type: WorkspaceType, id: string, code: string) {
61
- return requestVoid(`/api/harnesses/${type}/auth/login/${id}/code`, jsonRequest('POST', { code }))
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(type: LoginHarness) {
65
- return requestVoid(`/api/harnesses/${type}/auth/install`, { method: 'POST' })
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
- type: LoginHarness
14
+ harness: LoginHarness
15
15
  onConnected: () => void
16
16
  connectedContent?: ReactNode
17
17
  }
18
18
 
19
- export function HarnessLoginPanel({ type, onConnected, connectedContent }: HarnessLoginPanelProps) {
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(type)
39
+ } = useHarnessLogin(harness)
36
40
  const retry = useRetryHarnessStatus()
37
- const name = harnessLabel[type]
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[type]} alt="" className="mb-4 size-10" />
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 { WorkspaceType } from '@/lib/types'
2
- export { workspaceProviderIcon as harnessIcon } from '@/client/components/shared/workspace-icon'
3
- export const harnessLabel: Record<WorkspaceType, string> = {
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<WorkspaceType, string> = {
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 { WorkspaceType } from '@/lib/types'
4
+ import type { HarnessType } from '@/lib/types'
5
5
  import { harnessLabel, harnessIcon } from './harness-presentation'
6
6
 
7
7
  export type HarnessOption = {
8
- type: WorkspaceType
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
- selectedType?: WorkspaceType
21
- onTypeChange: (type: WorkspaceType) => void
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
- selectedType,
30
- onTypeChange
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.type}
40
+ key={option.harness}
41
41
  option={option}
42
42
  className={cardClassName}
43
- selected={mode === 'select' ? selectedType === option.type : undefined}
44
- onSelect={onTypeChange}
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: (type: WorkspaceType) => void
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.type)
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.type]} alt="" className="size-8 shrink-0" />
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.type]}</span>
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(type: LoginHarness) {
12
+ export function useHarnessLogin(harness: LoginHarness) {
13
13
  const { environment, demo } = useAppConfig()
14
- const auth = useHarnessStatus(type)
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(type)
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(type)
33
+ await startHarnessLogin(harness)
34
34
  }
35
35
  if (kind === 'submit' && pending) {
36
- await submitHarnessLoginCode(type, pending.id, code)
36
+ await submitHarnessLoginCode(harness, pending.id, code)
37
37
  setCode('')
38
38
  }
39
39
  },
@@ -1,4 +1,12 @@
1
- import { queryOptions, useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
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, WorkspaceEntry } from '@/lib/types'
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
- onTypeChange={importFlow.selectType}
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: WorkspaceEntry
198
+ workspace: HomeWorkspace
175
199
  }
176
200
 
177
201
  function WorkspaceCard({ workspace }: WorkspaceCardProps) {
178
- const name = workspaceDisplayName(workspace)
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 = previewQuery.data?.updatedAt ?? new Date(workspace.addedAt).getTime()
184
- const workspaceHref = `/workspace/${workspace.id}`
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
- workspaceType={workspace.type}
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
- <span className="text-xs text-muted-foreground">{formatUpdatedAt(updatedAt)}</span>
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, types } = suggestion
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 types={types} />
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
+ }