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.
- package/client/app/app-router.tsx +2 -0
- package/client/app/routes/settings-route.tsx +10 -0
- package/client/app/shell/sidebar-layout.tsx +34 -53
- package/client/features/account/account-menu.tsx +96 -0
- package/client/features/account/account-provider.tsx +142 -0
- package/client/features/account/account-test-utils.tsx +293 -0
- package/client/features/account/api.ts +142 -0
- package/client/features/account/identity.ts +23 -0
- package/client/features/collab/applet-api.ts +15 -14
- package/client/features/collab/components/cursors.tsx +61 -24
- package/client/features/collab/components/presence-avatars.tsx +25 -12
- package/client/features/collab/components/presence-frame.tsx +20 -24
- package/client/features/collab/components/presence-group.tsx +15 -7
- package/client/features/collab/components/user-avatar-group.tsx +21 -8
- package/client/features/collab/components/user-avatar.tsx +38 -7
- package/client/features/collab/components/user.tsx +31 -12
- package/client/features/collab/users.ts +0 -5
- package/client/features/collab/workspace-users-menu.tsx +3 -3
- package/client/features/dev/collab/collab-playground.tsx +7 -7
- package/client/features/dev/collab/local-user-settings.tsx +7 -53
- package/client/features/settings/connectors-settings.tsx +3 -3
- package/client/features/settings/environment-settings.tsx +3 -3
- package/client/features/settings/general-settings.tsx +1 -1
- package/client/features/settings/profile-settings.tsx +95 -0
- package/client/features/settings/settings-page.tsx +44 -0
- package/client/features/settings/settings-section.tsx +26 -0
- package/client/features/settings/users-settings.tsx +195 -0
- package/client/features/update/update-control.tsx +1 -1
- package/client/features/workspace/add/create-workspace-dialog.tsx +5 -2
- package/client/lib/user-display-name.ts +6 -0
- package/client/main.tsx +4 -1
- package/dist/{chunk-vt6zybej.js → chunk-20ynagd4.js} +2 -2
- package/dist/chunk-42tde9a6.js +1 -0
- package/dist/{chunk-hmka9rt5.js → chunk-9w543s0r.js} +2 -2
- package/dist/{chunk-y8nbwp21.js → chunk-a5372n61.js} +2 -2
- package/dist/chunk-aja9y1vn.js +68 -0
- package/dist/chunk-fvcvrh3d.css +1 -0
- package/dist/{chunk-ysfdcew7.js → chunk-gtfjw3nx.js} +1 -1
- package/dist/{chunk-hvh9f5h0.js → chunk-j39y2aky.js} +1 -1
- package/dist/chunk-pja30km3.js +1 -0
- package/dist/{chunk-d7cbm65e.js → chunk-rm894bc2.js} +1 -1
- package/dist/chunk-tevvtfbk.js +10 -0
- package/dist/{chunk-am4agx6v.js → chunk-tgt9zd0r.js} +1 -1
- package/dist/chunk-tv5k5z00.js +1 -0
- package/dist/chunk-zq2ae5dx.js +2 -0
- package/dist/index.html +1 -1
- package/lib/types.ts +1 -1
- package/package.json +1 -1
- package/server/api/index.ts +2 -6
- package/server/app-config.ts +7 -0
- package/server/web.ts +1 -0
- package/server/workspaces/init.ts +0 -10
- package/server/workspaces/registry.ts +31 -9
- package/dist/chunk-00rh9df4.js +0 -2
- package/dist/chunk-4nh7y1hq.css +0 -1
- package/dist/chunk-hbpdv7vd.js +0 -1
- package/dist/chunk-mjjregkn.js +0 -10
- package/dist/chunk-rt30jbcm.js +0 -1
- package/dist/chunk-wbkwf6cc.js +0 -68
- 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
|
|
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};
|
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-
|
|
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
|
|
555
|
+
// Deduplicated in canonical provider order; empty for folders without agent history.
|
|
556
556
|
types: WorkspaceType[]
|
|
557
557
|
}
|
|
558
558
|
|
package/package.json
CHANGED
package/server/api/index.ts
CHANGED
|
@@ -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'
|
package/server/app-config.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
231
|
-
|
|
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
|
-
//
|
|
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
|
|
256
|
-
|
|
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
|
}
|
package/dist/chunk-00rh9df4.js
DELETED