moi-computer 0.7.0 → 0.8.0
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/README.md +2 -2
- package/client/components/shared/BottomPanel.tsx +2 -1
- package/client/components/shared/PanelHeader.tsx +1 -1
- package/client/features/applets/AppletMount.tsx +9 -22
- package/client/features/applets/applet-cache.ts +7 -0
- package/client/features/applets/applet-styles.ts +21 -1
- package/client/features/applets/useApplet.ts +1 -1
- package/client/features/chat/ChatComposer.tsx +18 -4
- package/client/features/chat/ChatSelector.tsx +1 -1
- package/client/features/chat/TurnView.tsx +1 -1
- package/client/features/home/api.ts +0 -10
- package/client/features/home/workspace-setup/CreateWorkspaceDialog.tsx +21 -64
- package/client/features/home/workspace-setup/ImportWorkspaceDialog.tsx +1 -1
- package/client/features/scratchpad/Scratchpad.tsx +1 -3
- package/client/features/views/ViewManager.tsx +258 -0
- package/client/features/views/view-residency.ts +77 -0
- package/client/features/widgets/WidgetFrame.tsx +6 -2
- package/client/features/workspace/CustomizePanel.tsx +40 -24
- package/client/features/workspace/WorkspaceLayoutContext.tsx +8 -0
- package/client/features/workspace/WorkspaceScreen.tsx +51 -103
- package/client/features/workspace/WorkspaceTabs.tsx +1 -1
- package/client/index.css +4 -1
- package/client/runtime/workspace-theme.ts +29 -10
- package/client/theme.css +96 -6
- package/dist/chunk-0k7brsms.js +9 -0
- package/dist/{chunk-m11ckkxd.js → chunk-dtwxpxbg.js} +1 -1
- package/dist/{chunk-55sh4dty.js → chunk-ga7t9qsk.js} +1 -1
- package/dist/{chunk-w3tnv51j.js → chunk-h9h8f176.js} +1 -1
- package/dist/{chunk-rxvx4ta9.js → chunk-r5ce5cdg.js} +2 -2
- package/dist/chunk-tey2nq7c.js +31 -0
- package/dist/{chunk-afgbg75t.js → chunk-z73xpsa0.js} +1 -1
- package/dist/chunk-zzgredta.css +1 -0
- package/dist/index.html +1 -1
- package/lib/themes.ts +123 -51
- package/lib/types.ts +2 -5
- package/package.json +5 -4
- package/server/api.ts +2 -73
- package/server/bundler/build-applet.ts +7 -4
- package/server/cli.ts +46 -15
- package/server/control.ts +13 -6
- package/server/moi-scaffold.ts +1 -1
- package/server/registry.ts +0 -20
- package/server/theme.ts +24 -27
- package/workspace/.claude/skills/moi-workspace/DESIGN.md +94 -57
- package/workspace/.claude/skills/moi-workspace/SKILL.md +10 -12
- package/dist/chunk-175bm057.js +0 -27
- package/dist/chunk-agtetn7n.css +0 -1
- package/dist/chunk-exj6hr30.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as Vz,F as j,H as Sz,I as yz,N as Xz}from"/chunk-
|
|
1
|
+
import{E as Vz,F as j,H as Sz,I as yz,N as Xz}from"/chunk-dtwxpxbg.js";import{Da as P,Ga as A,Nc as Nz,O as w,P as W,bb as Mz,kb as Dz}from"/chunk-0k7brsms.js";import{Uc as G}from"/chunk-9y2zbzqz.js";var Q=G(w(),1);var K=G(W(),1),nz=[{label:"Trivial",prompt:"Reply with exactly: pong"},{label:"Reasoning",prompt:"Think carefully: a farmer has 17 sheep, all but 9 run away, then he buys twice as many as remain. How many sheep now? Reason it out before answering."},{label:"Command",prompt:"Run `ls -la` and summarize what you see in one sentence."},{label:"File edit",prompt:"Create or overwrite scratch.txt with three random words, one per line."},{label:"Plan",prompt:"Make a 3-step plan (use your plan tool) for adding a README to this folder, then execute it."},{label:"Subagent",prompt:"Spawn a subagent (collab/agent tool) to count the files in this directory and report back its answer."},{label:"Web search",prompt:"Search the web for the current Bun version and tell me what you find."},{label:"Slow (interrupt me)",prompt:"Run this exact command: sleep 30 && echo done. Nothing else."}];function iz(Z,Y=110){let _=JSON.stringify(Z);if(!_)return"";return _.length>Y?_.slice(0,Y)+"…":_}function p(Z){let Y=Z;if(typeof Y?.method==="string")return"id"in Y?`${Y.method} #${Y.id}`:Y.method;if("id"in(Y??{}))return`response #${Y.id}`;if(typeof Y?.kind==="string")return`${Y.kind}`;if(typeof Y?.type==="string")return`${Y.type}`;return"?"}function e(Z){return new Date(Z).toLocaleTimeString("en-GB",{hour12:!1})+"."+String(Z%1000).padStart(3,"0")}function s({time:Z,badge:Y,badgeClass:_,label:q,body:$}){return K.jsxs("details",{className:"group border-b border-border/40 px-2 py-1 text-[11px] leading-tight",children:[K.jsxs("summary",{className:"flex cursor-pointer items-baseline gap-2 font-mono whitespace-nowrap",children:[K.jsx("span",{className:"text-muted-foreground/60 tabular-nums",children:e(Z)}),K.jsx("span",{className:P("rounded px-1 font-semibold",_),children:Y}),K.jsx("span",{className:"shrink-0 font-semibold",children:q}),K.jsx("span",{className:"truncate text-muted-foreground",children:iz($)})]}),K.jsx("pre",{className:"mt-1 max-h-80 overflow-auto rounded bg-muted p-2 font-mono text-[10px] whitespace-pre-wrap",children:JSON.stringify($,null,2)})]})}function Oz({title:Z,hint:Y,controls:_,onCopy:q,onClear:$,children:I}){let O=Q.useRef(null),[F,N]=Q.useState(!0),[C,B]=Q.useState(!1),S=Q.useCallback(()=>{q?.(),B(!0),setTimeout(()=>B(!1),1500)},[q]);return Q.useEffect(()=>{if(F&&O.current)O.current.scrollTop=O.current.scrollHeight}),K.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col rounded-xl border border-border bg-background",children:[K.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-2 py-1",children:[typeof Z==="string"?K.jsx("span",{className:"text-xs font-semibold",children:Z}):Z,Y&&K.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:Y}),K.jsx("span",{className:"grow"}),_,K.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[K.jsx("input",{type:"checkbox",checked:F,onChange:(J)=>N(J.target.checked)}),"follow"]}),q&&K.jsx(A,{type:"button",variant:"ghost",size:"icon-sm",onClick:S,"aria-label":"Copy log",title:"Copy log",children:C?K.jsx(Mz,{stroke:1.75,className:"text-muted-foreground"}):K.jsx(Dz,{stroke:1.75})}),$&&K.jsx(A,{type:"button",variant:"ghost",size:"sm",onClick:$,children:"Clear"})]}),K.jsx("div",{ref:O,className:"min-h-0 flex-1 overflow-y-auto",children:I})]})}function Bz(){let[Z,Y]=Vz(),[_,q]=Q.useState([]),[$,I]=Q.useState(()=>Z.get("workspace")??""),[O,F]=Q.useState([]),[N,C]=Q.useState(""),[B,S]=Q.useState(""),[J,U]=Q.useState(!0),[V,M]=Q.useState(()=>crypto.randomUUID()),[b,R]=Q.useState(!0),[qz,Hz]=Q.useState(""),[x,bz]=Q.useState(null),[d,u]=Q.useState([]),[f,Uz]=Q.useState([]),[g,c]=Q.useState(null),[l,hz]=Q.useState(!1),[E,Az]=Q.useState("frames"),[gz,mz]=Q.useState(60),n=Q.useRef(null),i=Q.useRef(0),k=Q.useRef(null),pz=Q.useRef(0),h=Q.useRef(V);h.current=V,Q.useEffect(()=>{fetch("/api/workspaces").then((z)=>z.json()).then((z)=>{q(z),I((X)=>X&&z.some((H)=>H.id===X)?X:z[0]?.id??"")}).catch(()=>{})},[]);let wz=Q.useCallback((z)=>{I(z),Y((X)=>{return X.set("workspace",z),X},{replace:!0})},[Y]),m=_.find((z)=>z.id===$)?.type??"claude-code";Q.useEffect(()=>{if(!$)return;fetch(`/api/workspaces/${$}/models`).then((z)=>z.json()).then((z)=>F(z.models)).catch(()=>F([]))},[$]),Q.useEffect(()=>{M(crypto.randomUUID()),R(!0),c(null)},[$]),Q.useEffect(()=>{if(!$)return;i.current=0,u([]);let z=setInterval(async()=>{try{let X=await fetch(`/api/workspaces/${$}/harness/debug?sinceWire=${i.current}&sinceBroadcast=-1`);if(!X.ok)return;let H=await X.json();if(bz(H.process),H.wire.length)i.current=H.wire[H.wire.length-1].seq,u((t)=>[...t,...H.wire].slice(-1000))}catch{}},1000);return()=>clearInterval(z)},[$]),Q.useEffect(()=>{if(!$)return;let z=new WebSocket(Nz("/ws"));return k.current=z,z.onmessage=(X)=>{try{let H=JSON.parse(String(X.data));if(H.workspaceId&&H.workspaceId!==$)return;if(H.type==="session_renamed"&&H.from===h.current)M(H.to),R(!1);Uz((t)=>[...t,{seq:++pz.current,ts:Date.now(),frame:H}].slice(-1000))}catch{}},()=>{k.current=null,z.close()}},[$]);let Gz=Q.useCallback((z)=>{if(!z.trim()||!k.current||k.current.readyState!==WebSocket.OPEN)return;k.current.send(JSON.stringify({type:"chat",workspaceId:$,sessionId:h.current,isNew:b,content:z,optimisticId:crypto.randomUUID(),...N?{model:N}:{},...B?{effort:B}:{},stream:J})),R(!1)},[$,b,N,B,J]),jz=Q.useCallback(()=>{k.current?.send(JSON.stringify({type:"stop",workspaceId:$,sessionId:h.current}))},[$]),xz=Q.useCallback(()=>{M(crypto.randomUUID()),R(!0),c(null)},[]),dz=Q.useCallback(async()=>{let z=await fetch(`/api/workspaces/${$}/sessions/${h.current}/events`);c(z.ok?await z.json():[])},[$]),uz=Q.useMemo(()=>O.find((z)=>z.value===N)?.supportedEffortLevels??[],[O,N]),[a,fz]=Q.useState(""),r=Q.useMemo(()=>{let z=a.trim().toLowerCase();return z?d.filter((X)=>p(X.frame).toLowerCase().includes(z)):d},[d,a]),o=Q.useMemo(()=>l?f.filter((z)=>z.frame.type!=="preview"):f,[f,l]),cz=Q.useCallback(()=>{navigator.clipboard.writeText(r.map((z)=>`${e(z.ts)} ${z.dir==="send"?"→":"←"} ${JSON.stringify(z.frame)}`).join(`
|
|
2
2
|
`))},[r]),lz=Q.useCallback(()=>{navigator.clipboard.writeText(E==="frames"?o.map((z)=>`${e(z.ts)} ws ${JSON.stringify(z.frame)}`).join(`
|
|
3
3
|
`):JSON.stringify(g??[],null,2))},[E,o,g]);return K.jsxs("div",{className:"flex h-dvh flex-col gap-2 bg-muted p-2",children:[K.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-border bg-background px-2 py-1.5 text-xs",children:[K.jsx("span",{className:"font-semibold tracking-widest text-muted-foreground uppercase",children:"Harness debug"}),K.jsxs("select",{className:"rounded border border-border bg-background px-1 py-0.5",value:$,onChange:(z)=>wz(z.target.value),children:[_.length===0&&K.jsx("option",{value:"",children:"no workspaces"}),_.map((z)=>K.jsx("option",{value:z.id,children:`${z.name??z.displayPath??z.path} · ${z.type??"claude-code"}`},z.id))]}),K.jsxs("select",{className:"rounded border border-border bg-background px-1 py-0.5",value:N,onChange:(z)=>C(z.target.value),children:[K.jsx("option",{value:"",children:"default model"}),O.map((z)=>K.jsx("option",{value:z.value,children:z.displayName},z.value))]}),K.jsxs("select",{className:"rounded border border-border bg-background px-1 py-0.5",value:B,onChange:(z)=>S(z.target.value),children:[K.jsx("option",{value:"",children:"default effort"}),uz.map((z)=>K.jsx("option",{value:z,children:z},z))]}),K.jsxs("label",{className:"flex items-center gap-1",children:[K.jsx("input",{type:"checkbox",checked:J,onChange:(z)=>U(z.target.checked)}),"stream"]}),K.jsx("span",{className:"grow"}),m==="codex"&&K.jsx("span",{className:P("rounded px-1.5 py-0.5 font-mono text-[10px]",x?.running?"bg-green-500/15 text-green-600":"bg-muted text-muted-foreground"),children:x?.running?`app-server pid ${x.pid}`:"app-server not running"}),K.jsxs("span",{className:"max-w-56 truncate font-mono text-[10px] text-muted-foreground",children:["thread ",V]}),K.jsx(A,{type:"button",size:"sm",variant:"outline",onClick:xz,children:"New thread"}),K.jsx(A,{type:"button",size:"sm",variant:"outline",onClick:jz,children:"Stop"})]}),K.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 rounded-xl border border-border bg-background px-2 py-1.5",children:[nz.map((z)=>K.jsx(A,{type:"button",size:"sm",variant:"secondary",onClick:()=>Gz(z.prompt),children:z.label},z.label)),K.jsx("input",{className:"min-w-48 grow rounded border border-border bg-background px-2 py-1 text-xs",placeholder:"or type a custom prompt and hit Enter…",value:qz,onChange:(z)=>Hz(z.target.value),onKeyDown:(z)=>{if(z.key==="Enter")Gz(qz),Hz("")}})]}),K.jsxs("div",{ref:n,className:"flex min-h-0 flex-1 gap-1",children:[K.jsx("div",{className:"flex min-w-0",style:{width:`${gz}%`},children:K.jsx(Oz,{title:m==="codex"?"App-server wire":"Harness wire",hint:m==="codex"?"raw JSON-RPC, both directions":m==="openclaw"?"no wire tap for OpenClaw yet":"raw Agent SDK messages + enqueued inputs",controls:K.jsx("input",{className:"w-36 rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px]",placeholder:"filter types…",value:a,onChange:(z)=>fz(z.target.value)}),onCopy:cz,onClear:()=>u([]),children:r.map((z)=>K.jsx(s,{time:z.ts,badge:z.dir==="send"?"→":"←",badgeClass:z.dir==="send"?"bg-blue-500/15 text-blue-600":"bg-amber-500/15 text-amber-600",label:p(z.frame),body:z.frame},z.seq))})}),K.jsx("div",{className:"w-1.5 shrink-0 cursor-col-resize touch-none rounded-full hover:bg-border active:bg-border",onPointerDown:(z)=>{z.preventDefault(),z.currentTarget.setPointerCapture(z.pointerId)},onPointerMove:(z)=>{if(!z.currentTarget.hasPointerCapture(z.pointerId)||!n.current)return;let X=n.current.getBoundingClientRect(),H=(z.clientX-X.left)/X.width*100;mz(Math.min(80,Math.max(20,H)))}}),K.jsx(Oz,{title:K.jsxs("span",{className:"flex items-center gap-1",children:[K.jsx("button",{type:"button",className:P("rounded px-1.5 py-0.5 text-xs",E==="frames"?"bg-muted font-medium":"text-muted-foreground"),onClick:()=>Az("frames"),children:"Client frames"}),K.jsx("button",{type:"button",className:P("rounded px-1.5 py-0.5 text-xs",E==="events"?"bg-muted font-medium":"text-muted-foreground"),onClick:()=>Az("events"),children:"Durable events"})]}),hint:E==="frames"?"what the browser receives on /ws":"GET /sessions/:id/events replay",onCopy:lz,onClear:E==="frames"?()=>Uz([]):void 0,children:E==="frames"?K.jsxs(K.Fragment,{children:[K.jsx("div",{className:"border-b border-border/40 px-2 py-1",children:K.jsxs("label",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[K.jsx("input",{type:"checkbox",checked:l,onChange:(z)=>hz(z.target.checked)}),"hide preview frames"]})}),o.map((z)=>K.jsx(s,{time:z.ts,badge:"ws",badgeClass:"bg-purple-500/15 text-purple-600",label:p(z.frame),body:z.frame},z.seq))]}):K.jsxs(K.Fragment,{children:[K.jsx("div",{className:"border-b border-border/40 px-2 py-1",children:K.jsx(A,{type:"button",size:"sm",variant:"secondary",onClick:dz,children:"Fetch events"})}),g?.map((z,X)=>K.jsx(s,{time:Date.now(),badge:"ev",badgeClass:"bg-teal-500/15 text-teal-600",label:p(z),body:z},X)),g?.length===0&&K.jsx("div",{className:"p-2 text-[11px] text-muted-foreground",children:"no events"})]})})]})]})}var zz=G(w(),1);var y=G(w(),1);var L=G(W(),1),az=5,rz=5,Wz=[".....","####.","#.#.#","#.#.#","#.#.#"];function Lz(Z){return Z.map((Y)=>[...Y].map((_)=>_==="#"))}function oz(){return Array.from({length:rz},()=>Array.from({length:az},()=>!1))}function Tz(){let[Z,Y]=y.useState(()=>Lz(Wz)),[_,q]=y.useState(!1),$=y.useRef(!0),[I,O]=y.useState(!1);y.useEffect(()=>{let J=()=>q(!1);return window.addEventListener("mouseup",J),()=>window.removeEventListener("mouseup",J)},[]);function F(J,U,V){Y((M)=>{if(M[J][U]===V)return M;let b=M.map((R)=>R.slice());return b[J][U]=V,b})}function N(J,U){let V=!Z[J][U];$.current=V,q(!0),F(J,U,V)}function C(J,U){if(_)F(J,U,$.current)}let B=Z.map((J)=>J.map((U)=>U?"#":".").join("")).join(`
|
|
4
4
|
`);async function S(){await navigator.clipboard.writeText(B),O(!0),setTimeout(()=>O(!1),1200)}return L.jsxs("div",{className:"flex flex-col items-center gap-4",children:[L.jsx("div",{className:"grid w-fit grid-cols-[repeat(5,28px)] gap-px bg-border p-px select-none",children:Z.map((J,U)=>J.map((V,M)=>L.jsx("div",{onMouseDown:()=>N(U,M),onMouseEnter:()=>C(U,M),className:P("size-7 cursor-pointer",V?"bg-foreground":"bg-background")},`${U}-${M}`)))}),L.jsx("pre",{className:"rounded-lg border border-border bg-card px-3 py-2 text-center font-mono text-sm leading-snug text-card-foreground",children:B}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx(A,{type:"button",size:"sm",onClick:S,children:I?"Copied!":"Copy"}),L.jsx(A,{type:"button",variant:"secondary",size:"sm",onClick:()=>Y(oz()),children:"Clear"}),L.jsx(A,{type:"button",variant:"secondary",size:"sm",onClick:()=>Y(Lz(Wz)),children:"Reset"})]})]})}var D=G(W(),1),tz=[{value:"moi",label:"M"},{value:"moi-full",label:"moi"}],sz=[{value:"none",label:"None"},{value:"wave",label:"Wave"},{value:"chaos",label:"Random"}];function Fz({options:Z,value:Y,onChange:_}){return D.jsx("div",{className:"flex gap-1 rounded-xl bg-accent p-1",children:Z.map((q)=>D.jsx(A,{type:"button",variant:Y===q.value?"default":"ghost",size:"sm",onClick:()=>_(q.value),children:q.label},String(q.value)))})}function Ez(){let[Z,Y]=zz.useState("moi"),[_,q]=zz.useState("none");return D.jsxs("div",{className:"relative flex min-h-dvh flex-col items-center justify-center gap-8 bg-muted",children:[D.jsx("span",{className:"absolute top-5 left-5 text-[11px] font-medium tracking-widest text-muted-foreground uppercase",children:"Playground"}),D.jsx(Tz,{}),D.jsx(yz,{sprite:Z,effect:_==="none"?void 0:_,pixelSize:3,gap:0.5}),D.jsxs("div",{className:"flex flex-col items-center gap-2",children:[D.jsx(Fz,{options:tz,value:Z,onChange:Y}),D.jsx(Fz,{options:sz,value:_,onChange:q})]})]})}var vz=G(w(),1);var Qz="/Users/kim/git/confetti",Pz={toolCallId:"toolu_fixture_tool_search",name:"ToolSearch",caller:"model",provider:"claude-code",state:"success",input:{query:"select:mcp__notion__notion-search,mcp__notion__notion-get-teams,mcp__notion__notion-get-users",max_results:3},output:`mcp__notion__notion-search
|