moi-computer 0.11.1-dev.1c52199 → 0.11.1-dev.be1ed10
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 +1 -2
- package/client/app/routes/WorkspaceRoute.tsx +19 -27
- package/client/features/applets/AppletMount.tsx +1 -4
- package/client/features/applets/applet-runtime.ts +2 -13
- package/client/features/chat/applet-chat-intents.ts +6 -15
- package/client/features/chat/sessions/useSelectedSession.ts +20 -64
- package/client/features/chat/useChat.ts +0 -4
- package/client/features/dev/DevIndexPage.tsx +0 -5
- package/client/features/dev/DevRoutes.tsx +1 -14
- package/client/features/views/ViewManager.tsx +1 -4
- package/client/features/views/api.ts +2 -2
- package/client/features/views/useViewBuilderActions.ts +0 -3
- package/client/features/workspace/WorkspaceLayoutContext.tsx +3 -18
- package/client/features/workspace/WorkspaceScreen.tsx +11 -19
- package/client/features/workspace/api.ts +1 -3
- package/client/features/workspace/moi-context.ts +2 -7
- package/client/features/workspace/useWorkspaceNavigation.ts +3 -12
- package/client/index.tsx +3 -4
- package/dist/chunk-691pqsj6.js +2 -0
- package/dist/chunk-7a5nm4k9.css +1 -0
- package/dist/chunk-amb8y04y.js +1 -0
- package/dist/chunk-cf3pgy7j.js +546 -0
- package/dist/{chunk-wnmf38ta.js → chunk-mzrgr577.js} +1 -1
- package/dist/chunk-q6a0g26x.js +1 -0
- package/dist/chunk-twgdemkc.js +74 -0
- package/dist/chunk-x90k0f5c.js +2 -0
- package/dist/chunk-yq00csvd.js +2 -0
- package/dist/index.html +1 -1
- package/lib/moi-context.ts +0 -7
- package/lib/types.ts +6 -12
- package/package.json +1 -3
- package/server/api.ts +2 -23
- package/server/app-config.ts +34 -127
- package/server/applet-typecheck.ts +1 -6
- package/server/applets/build-applet.ts +0 -10
- package/server/cli.ts +12 -57
- package/server/layout.ts +3 -16
- package/server/skills-template.ts +2 -14
- package/server/web.ts +17 -62
- package/ui-components/avatar.tsx +4 -5
- package/ui-components/docs/avatar.md +5 -5
- package/client/features/collab/DevCollabIdentity.tsx +0 -170
- package/client/features/collab/DevCollabKit.tsx +0 -501
- package/client/features/collab/DevCollabPage.tsx +0 -25
- package/client/features/collab/WorkspaceCollabControls.tsx +0 -313
- package/client/features/collab/client.ts +0 -146
- package/client/features/collab/components.tsx +0 -307
- package/client/features/collab/dev-persona.ts +0 -66
- package/client/features/collab/engine.ts +0 -96
- package/client/features/collab/entry.tsx +0 -35
- package/client/features/collab/facehash-avatar.ts +0 -132
- package/client/features/collab/fake-engine.ts +0 -130
- package/client/features/collab/hooks.tsx +0 -253
- package/client/features/collab/identity.ts +0 -305
- package/client/features/collab/index.ts +0 -45
- package/client/features/collab/people.ts +0 -102
- package/client/features/collab/personal-state.ts +0 -61
- package/client/features/collab/presence-publisher.ts +0 -29
- package/client/features/collab/presence-target.ts +0 -10
- package/client/features/collab/primitives.tsx +0 -398
- package/client/features/collab/proxy-identity.ts +0 -24
- package/client/features/collab/store.ts +0 -156
- package/client/features/workspace/layout-save.ts +0 -13
- package/dist/chunk-1ftessc8.js +0 -2
- package/dist/chunk-3802vh2p.js +0 -2
- package/dist/chunk-542a2m9m.js +0 -1
- package/dist/chunk-5745d83v.js +0 -2
- package/dist/chunk-5zxdsjym.js +0 -1
- package/dist/chunk-7r4z77ry.js +0 -2
- package/dist/chunk-9cm0wjah.js +0 -79
- package/dist/chunk-cvgdm1hq.js +0 -2
- package/dist/chunk-gptm4jpd.js +0 -546
- package/dist/chunk-xaehhr1j.css +0 -1
- package/dist/chunk-xpt063fx.js +0 -1
- package/lib/collab/colors.ts +0 -24
- package/lib/collab/protocol.ts +0 -83
- package/lib/collab/types.ts +0 -63
- package/lib/experimental.ts +0 -14
- package/server/chat-selection.ts +0 -23
- package/server/collab/applet-module.ts +0 -50
- package/server/collab/cloudflare-access.ts +0 -77
- package/server/collab/config.ts +0 -18
- package/server/collab/ipc.ts +0 -10
- package/server/collab/manager.ts +0 -407
- package/server/collab/service.ts +0 -137
- package/server/collab/skill/collab-env.d.ts +0 -92
- package/server/collab/skill/index.ts +0 -59
- package/server/collab/worker.ts +0 -52
- package/workspace/.claude/skills/moi-workspace/references/COLLABORATIVE.md +0 -151
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WorkspaceLayoutContext } from './WorkspaceLayoutContext'
|
|
2
1
|
// Central assembly of the moi context sent with every chat message — the one
|
|
3
2
|
// place that snapshots the workspace's primary UI state (active tab, view
|
|
4
3
|
// titles) and drains queued one-shot directives. The structured `MoiContext`
|
|
@@ -22,9 +21,8 @@ import { WorkspaceLayoutContext } from './WorkspaceLayoutContext'
|
|
|
22
21
|
// Adding a new ambient field (e.g. scratchpad selection): extend the
|
|
23
22
|
// `MoiContext` type and its renderer in lib/moi-context.ts, then supply
|
|
24
23
|
// the field in `useMoiUserMessageContext`'s builder below.
|
|
25
|
-
import { useCallback
|
|
24
|
+
import { useCallback } from 'react'
|
|
26
25
|
|
|
27
|
-
import { useAppConfig } from '@/client/api/app-config'
|
|
28
26
|
import { useViewBuilders, useViews } from '@/client/features/views/api'
|
|
29
27
|
import { useWorkspaceId } from '@/client/features/workspace/WorkspaceContext'
|
|
30
28
|
import type { MoiAppletMessage, MoiContext } from '@/lib/moi-context'
|
|
@@ -113,8 +111,6 @@ export function useMoiUserMessageContext({
|
|
|
113
111
|
appletParams
|
|
114
112
|
}: WorkspaceTabAddress): (options?: MoiUserMessageOptions) => MoiContext {
|
|
115
113
|
const workspaceId = useWorkspaceId()
|
|
116
|
-
const { experimental } = useAppConfig()
|
|
117
|
-
const collabReference = useContext(WorkspaceLayoutContext)?.collabReference
|
|
118
114
|
const views = useViews(workspaceId).data
|
|
119
115
|
const builders = useViewBuilders(workspaceId).data
|
|
120
116
|
return useCallback(
|
|
@@ -123,13 +119,12 @@ export function useMoiUserMessageContext({
|
|
|
123
119
|
const tabParams = envelopeTabParams(activeTab, appletParams)
|
|
124
120
|
return {
|
|
125
121
|
activeTab,
|
|
126
|
-
...(experimental.collab && collabReference ? { collabReference } : {}),
|
|
127
122
|
tabTitle: activeTabTitle(activeTab, views, builders),
|
|
128
123
|
...(tabParams ? { tabParams } : {}),
|
|
129
124
|
...(options.applet ? { applet: options.applet } : {}),
|
|
130
125
|
...(directives.length > 0 ? { directives } : {})
|
|
131
126
|
}
|
|
132
127
|
},
|
|
133
|
-
[workspaceId, activeTab, appletParams, views, builders
|
|
128
|
+
[workspaceId, activeTab, appletParams, views, builders]
|
|
134
129
|
)
|
|
135
130
|
}
|
|
@@ -6,8 +6,6 @@ import { usePathname, useSearch } from 'wouter/use-browser-location'
|
|
|
6
6
|
import { toast } from '@/client/components/ui/toast'
|
|
7
7
|
import { reportAppletError } from '@/client/features/applets/applet-log'
|
|
8
8
|
import { useAppletEvent } from '@/client/features/applets/applet-runtime'
|
|
9
|
-
import { useCollabIdentityEnabled } from '@/client/features/collab/entry'
|
|
10
|
-
import { usePersonalTabs } from '@/client/features/collab/personal-state'
|
|
11
9
|
import { normalizeTabsState, resolveActiveTab, tabAvailable } from './tab-resolution'
|
|
12
10
|
import { useWorkspaceLayoutCtx } from './WorkspaceLayoutContext'
|
|
13
11
|
import { useLatestRef } from '@/client/lib/use-latest-ref'
|
|
@@ -33,7 +31,6 @@ type UseWorkspaceNavigationOptions = { views: ViewInfo[]; builders: ViewBuilder[
|
|
|
33
31
|
|
|
34
32
|
export function useWorkspaceNavigation({ views, builders, split }: UseWorkspaceNavigationOptions) {
|
|
35
33
|
const { layout, setLayout, workspaceId } = useWorkspaceLayoutCtx()
|
|
36
|
-
const personal = useCollabIdentityEnabled()
|
|
37
34
|
const [, navigate] = useLocation()
|
|
38
35
|
const router = useRouter()
|
|
39
36
|
const { base } = router
|
|
@@ -42,12 +39,7 @@ export function useWorkspaceNavigation({ views, builders, split }: UseWorkspaceN
|
|
|
42
39
|
const path = usePathname(router).slice(workspacePath(workspaceId, base).length + 1)
|
|
43
40
|
const search = canonicalSearch(useSearch(router))
|
|
44
41
|
const appletParams = useMemo(() => readViewParams(search), [search])
|
|
45
|
-
const
|
|
46
|
-
workspaceId,
|
|
47
|
-
personal,
|
|
48
|
-
normalizeTabsState(layout.tabs)
|
|
49
|
-
)
|
|
50
|
-
const tabsState = normalizeTabsState(personalTabs)
|
|
42
|
+
const tabsState = normalizeTabsState(layout.tabs)
|
|
51
43
|
const tabsStateRef = useLatestRef(tabsState)
|
|
52
44
|
const remembered = useMemo(() => {
|
|
53
45
|
let entries = rememberedAddresses.get(workspaceId)
|
|
@@ -64,10 +56,9 @@ export function useWorkspaceNavigation({ views, builders, split }: UseWorkspaceN
|
|
|
64
56
|
const setTabs = useCallback(
|
|
65
57
|
(tabs: WorkspaceTabsState) => {
|
|
66
58
|
tabsStateRef.current = tabs
|
|
67
|
-
|
|
68
|
-
else setLayout({ tabs })
|
|
59
|
+
setLayout({ tabs })
|
|
69
60
|
},
|
|
70
|
-
[setLayout, tabsStateRef
|
|
61
|
+
[setLayout, tabsStateRef]
|
|
71
62
|
)
|
|
72
63
|
|
|
73
64
|
const go = useCallback(
|
package/client/index.tsx
CHANGED
|
@@ -22,12 +22,11 @@ if (import.meta.hot) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export async function init(el: HTMLElement) {
|
|
25
|
-
// Startup config
|
|
26
|
-
//
|
|
25
|
+
// Startup config loads in parallel with the main chunk, so it is available
|
|
26
|
+
// synchronously to every component from the first render.
|
|
27
27
|
const [{ mount }] = await Promise.all([
|
|
28
28
|
import('./main'),
|
|
29
|
-
import('./api/app-config').then(m => m.loadAppConfig())
|
|
30
|
-
import('./features/collab/proxy-identity').then(m => m.loadProxyIdentity())
|
|
29
|
+
import('./api/app-config').then(m => m.loadAppConfig())
|
|
31
30
|
])
|
|
32
31
|
mount(el)
|
|
33
32
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var f=Object.create;var{getPrototypeOf:k,defineProperty:v,getOwnPropertyNames:y}=Object;var u=Object.prototype.hasOwnProperty;function z(a){return this[a]}var _,j,e=(a,r,t)=>{var l=a!=null&&typeof a==="object";if(l){var n=r?_??=new WeakMap:j??=new WeakMap,o=n.get(a);if(o)return o}t=a!=null?f(k(a)):{};let s=r||!a||!a.__esModule||!u.call(a,"default")?v(t,"default",{value:a,enumerable:!0}):t;if(a&&typeof a==="object"||typeof a==="function"){for(let i of y(a))if(!u.call(s,i))v(s,i,{get:z.bind(a,i),enumerable:!0})}if(l)n.set(a,s);return s};var x=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports);var C=(a)=>a;function E(a,r){this[a]=C.bind(null,r)}var Z=(a,r)=>{for(var t in r)v(a,t,{get:r[t],enumerable:!0,configurable:!0,set:E.bind(r,t)})};var Ie=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var b,w,h,H=(a,r)=>{for(var[t,l,n]of b||[])for(var o=[a],s=globalThis,i=s.document,m,p,g,c,d;p=o.pop();)if(!w[p]&&(g=l[p])){w[p]=1;for(c=1;c<g.length;c++)o.push(n[g[c]]);if(!r&&p!==a&&(m=i&&i.head)){if(h===void 0)h=(c=i.querySelector("meta[property=csp-nonce]"))&&(c.nonce||c.getAttribute("nonce"))||"";if(d=i.createElement("link"),d.rel="modulepreload",d.crossOrigin="",h)d.nonce=h;d.href=new s.URL(g[0],t),m.appendChild(d)}}},q=(a,r,t,l)=>{for(var n={},o=0;o<r.length;o++)n[r[o]]=t[o];(b||=[]).push([a,n,r]),w||={},H(r[l],1)};q(import.meta.url,["691pqsj6","twgdemkc","q6a0g26x","nf2wkvf9","cf3pgy7j","x90k0f5c","yq00csvd","amb8y04y","mzrgr577"],[["/chunk-691pqsj6.js"],["/chunk-twgdemkc.js",5,6,0],["/chunk-q6a0g26x.js",6],["/chunk-nf2wkvf9.js"],["/chunk-cf3pgy7j.js",8,5,6,0],["/chunk-x90k0f5c.js",0,6],["/chunk-yq00csvd.js",0],["/chunk-amb8y04y.js",8],["/chunk-mzrgr577.js"]],0);
|
|
2
|
+
if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function A(a){let[{mount:r}]=await Promise.all([(H("twgdemkc"),import("/chunk-twgdemkc.js")),(H("q6a0g26x"),import("/chunk-q6a0g26x.js")).then((t)=>t.loadAppConfig())]);r(a)}globalThis.__init=A;export{e,x,Z,Ie,H};
|