moi-computer 0.12.1-next.2 → 0.12.1-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/client/app/app-router.tsx +2 -0
  2. package/client/app/routes/settings-route.tsx +10 -0
  3. package/client/app/shell/sidebar-layout.tsx +34 -53
  4. package/client/features/account/account-menu.tsx +96 -0
  5. package/client/features/account/account-provider.tsx +142 -0
  6. package/client/features/account/account-test-utils.tsx +293 -0
  7. package/client/features/account/api.ts +142 -0
  8. package/client/features/account/identity.ts +23 -0
  9. package/client/features/collab/applet-api.ts +15 -14
  10. package/client/features/collab/components/cursors.tsx +61 -24
  11. package/client/features/collab/components/presence-avatars.tsx +25 -12
  12. package/client/features/collab/components/presence-frame.tsx +20 -24
  13. package/client/features/collab/components/presence-group.tsx +15 -7
  14. package/client/features/collab/components/user-avatar-group.tsx +21 -8
  15. package/client/features/collab/components/user-avatar.tsx +38 -7
  16. package/client/features/collab/components/user.tsx +31 -12
  17. package/client/features/collab/users.ts +0 -5
  18. package/client/features/collab/workspace-users-menu.tsx +3 -3
  19. package/client/features/dev/collab/collab-playground.tsx +7 -7
  20. package/client/features/dev/collab/local-user-settings.tsx +7 -53
  21. package/client/features/settings/connectors-settings.tsx +3 -3
  22. package/client/features/settings/environment-settings.tsx +3 -3
  23. package/client/features/settings/general-settings.tsx +1 -1
  24. package/client/features/settings/profile-settings.tsx +95 -0
  25. package/client/features/settings/settings-page.tsx +44 -0
  26. package/client/features/settings/settings-section.tsx +26 -0
  27. package/client/features/settings/users-settings.tsx +195 -0
  28. package/client/features/update/update-control.tsx +1 -1
  29. package/client/features/workspace/add/create-workspace-dialog.tsx +5 -2
  30. package/client/lib/user-display-name.ts +6 -0
  31. package/client/main.tsx +4 -1
  32. package/dist/{chunk-vt6zybej.js → chunk-20ynagd4.js} +2 -2
  33. package/dist/chunk-42tde9a6.js +1 -0
  34. package/dist/{chunk-hmka9rt5.js → chunk-9w543s0r.js} +2 -2
  35. package/dist/{chunk-y8nbwp21.js → chunk-a5372n61.js} +2 -2
  36. package/dist/chunk-aja9y1vn.js +68 -0
  37. package/dist/chunk-fvcvrh3d.css +1 -0
  38. package/dist/{chunk-ysfdcew7.js → chunk-gtfjw3nx.js} +1 -1
  39. package/dist/{chunk-hvh9f5h0.js → chunk-j39y2aky.js} +1 -1
  40. package/dist/chunk-pja30km3.js +1 -0
  41. package/dist/{chunk-d7cbm65e.js → chunk-rm894bc2.js} +1 -1
  42. package/dist/chunk-tevvtfbk.js +10 -0
  43. package/dist/{chunk-am4agx6v.js → chunk-tgt9zd0r.js} +1 -1
  44. package/dist/chunk-tv5k5z00.js +1 -0
  45. package/dist/chunk-zq2ae5dx.js +2 -0
  46. package/dist/index.html +1 -1
  47. package/lib/types.ts +1 -1
  48. package/package.json +1 -1
  49. package/server/api/index.ts +2 -6
  50. package/server/app-config.ts +7 -0
  51. package/server/web.ts +1 -0
  52. package/server/workspaces/init.ts +0 -10
  53. package/server/workspaces/registry.ts +31 -9
  54. package/dist/chunk-00rh9df4.js +0 -2
  55. package/dist/chunk-4nh7y1hq.css +0 -1
  56. package/dist/chunk-hbpdv7vd.js +0 -1
  57. package/dist/chunk-mjjregkn.js +0 -10
  58. package/dist/chunk-rt30jbcm.js +0 -1
  59. package/dist/chunk-wbkwf6cc.js +0 -68
  60. package/dist/chunk-xjyfyz64.js +0 -1
@@ -1,2 +1,2 @@
1
1
  async function s(t,e){let o=await t.text();return Error(o||e)}async function i(t,e,o="Request failed"){let n=await fetch(t,e);if(!n.ok)throw await s(n,o);return n.json()}async function r(t,e,o="Request failed"){let n=await fetch(t,e);if(!n.ok)throw await s(n,o)}function a(t,e){return{method:t,headers:{"Content-Type":"application/json"},body:e===void 0?void 0:JSON.stringify(e)}}
2
- export{i as Xc,r as Yc,a as Zc};
2
+ export{i as cd,r as dd,a as ed};
@@ -0,0 +1 @@
1
+ import{Mc as a,Nc as b}from"/chunk-20ynagd4.js";import"/chunk-zq2ae5dx.js";import"/chunk-tgt9zd0r.js";import"/chunk-rm894bc2.js";export{b as useAppConfig,a as loadAppConfig};
@@ -0,0 +1,2 @@
1
+ import{gd as e}from"/chunk-rm894bc2.js";var o=e((a,t)=>{t.exports=globalThis.__esm.react});
2
+ export{o as Oc};
package/dist/index.html CHANGED
@@ -55,7 +55,7 @@
55
55
  <link rel="modulepreload" href="/vendor/react/19.2.4/production/react-dom-client.js" />
56
56
  <link rel="modulepreload" href="/vendor/react/19.2.4/production/_impl/react-dom-client.js" />
57
57
 
58
- <link rel="stylesheet" crossorigin href="/chunk-4nh7y1hq.css"><script type="module" crossorigin src="/chunk-hbpdv7vd.js"></script></head>
58
+ <link rel="stylesheet" crossorigin href="/chunk-fvcvrh3d.css"><script type="module" crossorigin src="/chunk-pja30km3.js"></script></head>
59
59
  <body>
60
60
  <div id="root"></div>
61
61
 
package/lib/types.ts CHANGED
@@ -552,7 +552,7 @@ export type WorkspaceEntry = {
552
552
  export type DiscoveredWorkspace = {
553
553
  path: string
554
554
  displayPath?: string
555
- // Deduplicated in canonical provider order by the discovery API.
555
+ // Deduplicated in canonical provider order; empty for folders without agent history.
556
556
  types: WorkspaceType[]
557
557
  }
558
558
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moi-computer",
3
- "version": "0.12.1-next.2",
3
+ "version": "0.12.1-next.3",
4
4
  "description": "Local AI workspace powered by the Claude Agent SDK, Bun, React, and Tailwind. Requires Bun.",
5
5
  "license": "Elastic-2.0",
6
6
  "type": "module",
@@ -26,7 +26,7 @@ import { proxyUserState } from '../collab/cloudflare-access'
26
26
  import { collabManager } from '../collab/manager'
27
27
  import { harnessStore } from '../harness/auth'
28
28
  import { harnesses } from './harnesses'
29
- import { clientAppConfig, getAppConfig } from '../app-config'
29
+ import { clientAppConfig, createdWorkspacesRoot, getAppConfig } from '../app-config'
30
30
  import { getAppSettings, pickAppSettingsPatch, saveAppSettings } from '../app-settings'
31
31
  import { appletForModule, recordAppletError } from '../applets/log'
32
32
  import { apiBaseFor, parseAppletTail, serveWorkspaceFile } from '../applets'
@@ -94,11 +94,7 @@ import {
94
94
  import { submitView, ViewStartupError } from '../sessions/view-sessions'
95
95
  import { listWidgets, serveWidget } from '../applets/widgets'
96
96
  import { getWorkspaceConfig, setWorkspaceConfig } from '../workspaces/config'
97
- import {
98
- createdWorkspacesRoot,
99
- provisionWorkspace,
100
- validateWorkspaceFolderName
101
- } from '../workspaces/init'
97
+ import { provisionWorkspace, validateWorkspaceFolderName } from '../workspaces/init'
102
98
  import { resolveWorkspaceImportMetadata } from '../workspaces/import'
103
99
  import type { WorkspaceImportMetadata } from '../workspaces/import'
104
100
  import { getWorkspaceEnvView, parseEnvUpdate, updateWorkspaceEnv } from '../workspaces/env'
@@ -1,4 +1,5 @@
1
1
  import { readFileSync } from 'node:fs'
2
+ import { homedir } from 'node:os'
2
3
  import { isAbsolute, join } from 'path'
3
4
 
4
5
  import type { AppEnvironment, ClientAppConfig, ExperimentalFeatures } from '@/lib/types'
@@ -254,6 +255,12 @@ export function getAppConfig(): AppConfig {
254
255
  return _config
255
256
  }
256
257
 
258
+ // Folder for workspaces created from the UI. Managed machines override it
259
+ // with workspacesDir in config.json.
260
+ export function createdWorkspacesRoot(): string {
261
+ return getAppConfig().workspacesDir ?? join(homedir(), 'moi')
262
+ }
263
+
257
264
  // Test seam: drop the cached config so the next getAppConfig() re-resolves
258
265
  // (tests point MOI_DATA_DIR elsewhere or set MOI_DEMO).
259
266
  export function resetAppConfig(): void {
package/server/web.ts CHANGED
@@ -157,6 +157,7 @@ export const app = Bun.serve<WsData>({
157
157
  ? new Response('Not found', { status: 404 })
158
158
  : devSandbox,
159
159
  '/workspace/*': shell,
160
+ '/settings': shell,
160
161
 
161
162
  // Chat websocket — app-wide (one per client, not per workspace). Each chat
162
163
  // frame carries its own workspaceId.
@@ -4,13 +4,11 @@
4
4
  // create) all provision through here, so a workspace set up from the UI is
5
5
  // indistinguishable from one set up via the CLI.
6
6
  import { mkdir } from 'node:fs/promises'
7
- import { homedir } from 'node:os'
8
7
  import { join } from 'node:path'
9
8
 
10
9
  import type { WorkspaceType } from '@/lib/types'
11
10
  export { validateWorkspaceFolderName } from '@/lib/workspace-name'
12
11
 
13
- import { getAppConfig } from '../app-config'
14
12
  import { harnessFor } from '../harness/registry'
15
13
  import { createDependencyInstallLogPath, scaffoldMoiDir } from './scaffold'
16
14
  import { installBundledSkills } from '../skills/template'
@@ -23,14 +21,6 @@ export function skillsDirFor(workspaceRoot: string, type?: WorkspaceType): strin
23
21
  return harnessFor(type).skillsDir?.(workspaceRoot) ?? join(workspaceRoot, '.claude', 'skills')
24
22
  }
25
23
 
26
- // Folder that holds workspaces created from the UI (`/workspace/create`) — a
27
- // visible home-dir folder, mirroring how Cowork keeps its session folders under
28
- // the user's home rather than an app-data dir. Managed machines set their own
29
- // (`workspacesDir` in config.json).
30
- export function createdWorkspacesRoot(): string {
31
- return getAppConfig().workspacesDir ?? join(homedir(), 'moi')
32
- }
33
-
34
24
  export type ProvisionResult = {
35
25
  // Where the skills were installed (backend-dependent, see skillsDirFor).
36
26
  skillsDir: string
@@ -1,5 +1,5 @@
1
1
  import { existsSync, realpathSync } from 'node:fs'
2
- import { rename, rm } from 'node:fs/promises'
2
+ import { readdir, rename, rm, stat } from 'node:fs/promises'
3
3
  import { homedir } from 'node:os'
4
4
  import { join, resolve, sep } from 'path'
5
5
 
@@ -10,6 +10,7 @@ import { orderWorkspaceTypes } from '@/lib/workspace-types'
10
10
  import { DATA_DIR } from '../data-dir'
11
11
  import { allHarnesses } from '../harness/registry'
12
12
  import type { DiscoveredWorkspaceCandidate } from '../harness/types'
13
+ import { createdWorkspacesRoot } from '../app-config'
13
14
 
14
15
  // Replace the home-dir prefix with `~` for display. Keeps the original
15
16
  // absolute path in place; callers should put the result in `displayPath`.
@@ -216,7 +217,7 @@ export function liftToWorkspaceRoot(p: string): string {
216
217
  return segments.slice(0, i).join(sep) || sep
217
218
  }
218
219
 
219
- async function collectDiscoveredWorkspaces(
220
+ async function discoverHarnessWorkspaces(
220
221
  registeredPaths: Set<string>
221
222
  ): Promise<DiscoveredWorkspaceCandidate[]> {
222
223
  const perHarness = await Promise.all(
@@ -227,8 +228,25 @@ async function collectDiscoveredWorkspaces(
227
228
  return perHarness.flat()
228
229
  }
229
230
 
230
- export function groupDiscoveredWorkspaces(
231
- candidates: DiscoveredWorkspaceCandidate[],
231
+ // Only inspect immediate children of the workspace root, never the whole disk.
232
+ export async function discoverWorkspaceFolders(
233
+ root = createdWorkspacesRoot()
234
+ ): Promise<{ path: string }[]> {
235
+ const entries = await readdir(root, { withFileTypes: true }).catch(() => [])
236
+ const candidates = await Promise.all(
237
+ entries
238
+ .filter(entry => entry.isDirectory() || entry.isSymbolicLink())
239
+ .map(async entry => {
240
+ const path = resolve(root, entry.name)
241
+ const moi = await stat(join(path, '.moi')).catch(() => undefined)
242
+ return moi?.isDirectory() ? { path } : undefined
243
+ })
244
+ )
245
+ return candidates.filter(candidate => candidate !== undefined)
246
+ }
247
+
248
+ export function mergeWorkspaceCandidates(
249
+ candidates: { path: string; type?: WorkspaceType }[],
232
250
  registeredPaths: Set<string> = new Set()
233
251
  ): DiscoveredWorkspace[] {
234
252
  const normalizedRegisteredPaths = new Set([...registeredPaths].map(path => resolve(path)))
@@ -238,7 +256,7 @@ export function groupDiscoveredWorkspaces(
238
256
  const path = resolve(candidate.path)
239
257
  if (normalizedRegisteredPaths.has(path)) continue
240
258
  const types = byPath.get(path) ?? new Set<WorkspaceType>()
241
- types.add(candidate.type)
259
+ if (candidate.type) types.add(candidate.type)
242
260
  byPath.set(path, types)
243
261
  }
244
262
 
@@ -248,10 +266,14 @@ export function groupDiscoveredWorkspaces(
248
266
  }))
249
267
  }
250
268
 
251
- // Ask every harness for workspaces it knows about that aren't registered yet,
252
- // then combine providers that claim the same normalized folder.
269
+ // Combine agent history with Moi folders that may not have any chats yet.
253
270
  export async function discoverWorkspaces(): Promise<DiscoveredWorkspace[]> {
254
271
  const registeredPaths = new Set((await readRegistry()).map(e => e.path))
255
- const found = await collectDiscoveredWorkspaces(registeredPaths)
256
- return groupDiscoveredWorkspaces(found, registeredPaths).map(withDisplayPath)
272
+ const [harnessWorkspaces, workspaceFolders] = await Promise.all([
273
+ discoverHarnessWorkspaces(registeredPaths),
274
+ discoverWorkspaceFolders()
275
+ ])
276
+ return mergeWorkspaceCandidates([...harnessWorkspaces, ...workspaceFolders], registeredPaths).map(
277
+ withDisplayPath
278
+ )
257
279
  }
@@ -1,2 +0,0 @@
1
- import{$c as e}from"/chunk-d7cbm65e.js";var o=e((a,t)=>{t.exports=globalThis.__esm.react});
2
- export{o as Nc};