moi-computer 0.3.0-next.2 → 0.3.0-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 (125) hide show
  1. package/README.md +1 -1
  2. package/client/AGENTS.md +2 -2
  3. package/client/api/http.ts +1 -1
  4. package/client/api/workspace-keys.ts +1 -0
  5. package/client/app/AppRouter.tsx +14 -5
  6. package/client/app/routes/HomeRoute.tsx +1 -1
  7. package/client/app/routes/WorkspaceRoute.tsx +8 -2
  8. package/client/app/shell/SidebarLayout.tsx +10 -5
  9. package/client/assets/openai.svg +3 -0
  10. package/client/components/shared/BottomPanel.tsx +2 -2
  11. package/client/components/ui/button.tsx +3 -2
  12. package/client/components/ui/input.tsx +1 -1
  13. package/client/features/applets/AppletMount.tsx +44 -0
  14. package/client/features/applets/WidgetShell.tsx +4 -1
  15. package/client/features/applets/applet-cache.ts +8 -0
  16. package/client/features/applets/applet-styles.ts +61 -0
  17. package/client/features/chat/ChatComposer.tsx +2 -2
  18. package/client/features/chat/ChatPanel.tsx +8 -25
  19. package/client/features/chat/ChatPopup.tsx +3 -3
  20. package/client/features/chat/{ThreadSelector.tsx → ChatSelector.tsx} +4 -4
  21. package/client/features/chat/TurnView.tsx +8 -9
  22. package/client/features/chat/api.ts +1 -1
  23. package/client/features/chat/chat-send.ts +57 -0
  24. package/client/features/chat/tool-group/ToolCallGroup.tsx +2 -1
  25. package/client/features/chat/tool-group/format.ts +117 -0
  26. package/client/features/chat/useChat.ts +10 -34
  27. package/client/features/connectors/McpMenu.tsx +4 -21
  28. package/client/features/dev/DevRoutes.tsx +18 -0
  29. package/client/features/dev/HarnessDebugPage.tsx +468 -0
  30. package/client/{components/playground → features/dev}/PlaygroundPage.tsx +1 -1
  31. package/client/features/home/CreateWorkspaceDialog.tsx +64 -158
  32. package/client/features/home/CreateWorkspaceDialogSteps.tsx +234 -0
  33. package/client/features/home/HomeLogo.tsx +344 -0
  34. package/client/features/home/HomePage.tsx +15 -21
  35. package/client/features/home/WorkspacePreview.tsx +2 -2
  36. package/client/features/home/api.ts +11 -3
  37. package/client/features/home/workspace-presentation.tsx +4 -4
  38. package/client/features/settings/GeneralSettings.tsx +3 -3
  39. package/client/features/settings/IconPicker.tsx +4 -3
  40. package/client/features/settings/icon-picker-options.ts +0 -131
  41. package/client/features/views/ViewBuilderTab.tsx +153 -0
  42. package/client/features/views/api.ts +124 -0
  43. package/client/features/views/useViewBuilderActions.ts +72 -0
  44. package/client/features/widgets/WidgetGrid.tsx +36 -20
  45. package/client/features/widgets/Widgets.tsx +140 -90
  46. package/client/features/workspace/WorkspaceLayoutContext.tsx +3 -9
  47. package/client/features/workspace/WorkspaceScreen.tsx +179 -40
  48. package/client/features/workspace/WorkspaceTabs.tsx +4 -4
  49. package/client/index.css +0 -35
  50. package/client/index.html +1 -1
  51. package/client/lib/app-icon-registry.ts +145 -0
  52. package/client/runtime/useWorkspaceEvents.ts +3 -1
  53. package/client/theme.css +1 -1
  54. package/dist/chunk-4vf1t6v1.js +10 -0
  55. package/dist/chunk-6c24yndg.js +61 -0
  56. package/dist/chunk-6c8cwpzc.js +1 -0
  57. package/dist/chunk-b4b276wx.js +15 -0
  58. package/dist/{chunk-c4j722at.js → chunk-cs8vbert.js} +2 -2
  59. package/dist/chunk-cwqmay73.css +1 -0
  60. package/dist/chunk-kxmvv1ax.js +48 -0
  61. package/dist/chunk-rq0ar7vp.js +1 -0
  62. package/dist/{chunk-p68fnz3q.js → chunk-vkvb3hjm.js} +1 -1
  63. package/dist/chunk-zpxrb1ce.js +2 -0
  64. package/dist/index.html +2 -2
  65. package/dist/openai-h13pza4b.svg +3 -0
  66. package/lib/format.ts +2 -2
  67. package/lib/types.ts +38 -2
  68. package/lib/view-builder-meta.ts +35 -0
  69. package/lib/workspace-layout.ts +14 -0
  70. package/package.json +2 -1
  71. package/server/AGENTS.md +3 -3
  72. package/server/api.ts +165 -51
  73. package/server/applets.ts +1 -1
  74. package/server/bundle-queue.ts +19 -0
  75. package/server/bundler/applet-css.ts +50 -0
  76. package/server/{build-applet.ts → bundler/build-applet.ts} +36 -26
  77. package/server/cli.ts +79 -2
  78. package/server/control.ts +106 -8
  79. package/server/env-apply.ts +2 -2
  80. package/server/harness/README.md +228 -0
  81. package/server/harness/claude-code/NOTES.md +578 -0
  82. package/{lib/claude-adapter.ts → server/harness/claude-code/adapter.ts} +67 -5
  83. package/server/harness/claude-code/index.ts +124 -0
  84. package/server/{mcp.ts → harness/claude-code/mcp.ts} +1 -1
  85. package/server/{cc-session.ts → harness/claude-code/session.ts} +42 -14
  86. package/server/harness/claude-code/sessions.ts +42 -0
  87. package/server/harness/codex/NOTES.md +239 -0
  88. package/server/harness/codex/adapter.ts +414 -0
  89. package/server/harness/codex/client.ts +343 -0
  90. package/server/harness/codex/index.ts +68 -0
  91. package/server/harness/codex/probe.ts +186 -0
  92. package/server/harness/codex/session.ts +617 -0
  93. package/server/harness/debug.ts +57 -0
  94. package/server/harness/openclaw/NOTES.md +316 -0
  95. package/server/{openclaw-adapter.ts → harness/openclaw/adapter.ts} +2 -2
  96. package/server/harness/openclaw/index.ts +93 -0
  97. package/server/{openclaw-session.ts → harness/openclaw/session.ts} +44 -9
  98. package/server/{openclaw-strip.ts → harness/openclaw/strip.ts} +3 -1
  99. package/server/harness/registry.ts +36 -0
  100. package/server/harness/types.ts +87 -0
  101. package/server/layout.ts +6 -12
  102. package/server/moi-scaffold.ts +1 -1
  103. package/server/registry.ts +14 -52
  104. package/server/state.ts +5 -38
  105. package/server/status.ts +7 -46
  106. package/server/vendor.ts +1 -1
  107. package/server/view-builders.ts +428 -0
  108. package/server/views.ts +0 -0
  109. package/server/web.ts +18 -40
  110. package/server/workspace-init.ts +6 -6
  111. package/workspace/.claude/skills/moi-workspace/DESIGN.md +1 -0
  112. package/workspace/.claude/skills/moi-workspace/SKILL.md +28 -7
  113. package/client/assets/hermes-nous.png +0 -0
  114. package/client/hooks/useScrollFade.ts +0 -38
  115. package/dist/chunk-23cgr1tz.css +0 -1
  116. package/dist/chunk-3hy3qy6d.js +0 -10
  117. package/dist/chunk-dyfaffyz.js +0 -119
  118. package/dist/chunk-kpe40hm8.js +0 -1
  119. package/dist/chunk-ty6dvda0.js +0 -1
  120. package/dist/hermes-nous-pznd63x9.png +0 -0
  121. /package/client/{components/playground → features/dev}/PixelPainter.tsx +0 -0
  122. /package/client/{components/playground → features/dev}/ToolCallsPage.tsx +0 -0
  123. /package/server/{agent.ts → harness/claude-code/models.ts} +0 -0
  124. /package/server/{openclaw.ts → harness/openclaw/discovery.ts} +0 -0
  125. /package/server/{openclaw-gateway.ts → harness/openclaw/gateway.ts} +0 -0
@@ -0,0 +1,48 @@
1
+ import{C as S,E as Wz,ba as H,ea as Az,fa as Kz}from"/chunk-b4b276wx.js";import{ga as h,ha as D,ia as _z,yc as I}from"/chunk-4vf1t6v1.js";import{Ec as A}from"/chunk-vkvb3hjm.js";var Y=A(h(),1);var K=A(D(),1),kz=[{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=110){let Q=JSON.stringify(_);if(!Q)return"";return Q.length>Z?Q.slice(0,Z)+"…":Q}function c(_){let Z=_;if(typeof Z?.method==="string")return"id"in Z?`${Z.method} #${Z.id}`:Z.method;if("id"in(Z??{}))return`response #${Z.id}`;if(typeof Z?.kind==="string")return`${Z.kind}`;if(typeof Z?.type==="string")return`${Z.type}`;return"?"}function Cz(_){return new Date(_).toLocaleTimeString("en-GB",{hour12:!1})+"."+String(_%1000).padStart(3,"0")}function i({time:_,badge:Z,badgeClass:Q,label:J,body:X}){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:Cz(_)}),K.jsx("span",{className:I("rounded px-1 font-semibold",Q),children:Z}),K.jsx("span",{className:"shrink-0 font-semibold",children:J}),K.jsx("span",{className:"truncate text-muted-foreground",children:Iz(X)})]}),K.jsx("pre",{className:"mt-1 max-h-80 overflow-auto rounded bg-muted p-2 text-[10px] whitespace-pre-wrap",children:JSON.stringify(X,null,2)})]})}function l({title:_,hint:Z,onClear:Q,children:J}){let X=Y.useRef(null),[B,U]=Y.useState(!0);return Y.useEffect(()=>{if(B&&X.current)X.current.scrollTop=X.current.scrollHeight}),K.jsxs("div",{className:"flex min-h-0 flex-1 flex-col rounded-lg border border-border bg-background",children:[K.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-2 py-1",children:[K.jsx("span",{className:"text-xs font-semibold",children:_}),Z&&K.jsx("span",{className:"truncate text-[10px] text-muted-foreground",children:Z}),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:B,onChange:(F)=>U(F.target.checked)}),"follow"]}),Q&&K.jsx(H,{type:"button",variant:"ghost",size:"sm",onClick:Q,children:"Clear"})]}),K.jsx("div",{ref:X,className:"min-h-0 flex-1 overflow-y-auto",children:J})]})}function $z(){let[_,Z]=Y.useState([]),[Q,J]=Y.useState(""),[X,B]=Y.useState([]),[U,F]=Y.useState(""),[L,g]=Y.useState(""),[E,p]=Y.useState(!0),[$,q]=Y.useState(()=>crypto.randomUUID()),[M,G]=Y.useState(!0),[b,C]=Y.useState(""),[m,Nz]=Y.useState(null),[yz,w]=Y.useState([]),[j,Qz]=Y.useState([]),[Yz,x]=Y.useState(null),[d,Bz]=Y.useState(!1),u=Y.useRef(0),P=Y.useRef(null),Fz=Y.useRef(0),k=Y.useRef($);k.current=$,Y.useEffect(()=>{fetch("/api/workspaces").then((z)=>z.json()).then((z)=>{Z(z),J((N)=>N||(z[0]?.id??""))}).catch(()=>{})},[]);let v=_.find((z)=>z.id===Q)?.type??"claude-code";Y.useEffect(()=>{if(!Q)return;fetch(`/api/workspaces/${Q}/models`).then((z)=>z.json()).then((z)=>B(z.models)).catch(()=>B([]))},[Q]),Y.useEffect(()=>{q(crypto.randomUUID()),G(!0),x(null)},[Q]),Y.useEffect(()=>{if(!Q)return;u.current=0,w([]);let z=setInterval(async()=>{try{let N=await fetch(`/api/workspaces/${Q}/harness/debug?sinceWire=${u.current}&sinceBroadcast=-1`);if(!N.ok)return;let O=await N.json();if(Nz(O.process),O.wire.length)u.current=O.wire[O.wire.length-1].seq,w((f)=>[...f,...O.wire].slice(-1000))}catch{}},1000);return()=>clearInterval(z)},[Q]),Y.useEffect(()=>{if(!Q)return;let z=new WebSocket(_z("/ws"));return P.current=z,z.onmessage=(N)=>{try{let O=JSON.parse(String(N.data));if(O.workspaceId&&O.workspaceId!==Q)return;if(O.type==="session_renamed"&&O.from===k.current)q(O.to),G(!1);Qz((f)=>[...f,{seq:++Fz.current,ts:Date.now(),frame:O}].slice(-1000))}catch{}},()=>{P.current=null,z.close()}},[Q]);let Zz=Y.useCallback((z)=>{if(!z.trim()||!P.current||P.current.readyState!==WebSocket.OPEN)return;P.current.send(JSON.stringify({type:"chat",workspaceId:Q,sessionId:k.current,isNew:M,content:z,optimisticId:crypto.randomUUID(),...U?{model:U}:{},...L?{effort:L}:{},stream:E})),G(!1)},[Q,M,U,L,E]),Lz=Y.useCallback(()=>{P.current?.send(JSON.stringify({type:"stop",workspaceId:Q,sessionId:k.current}))},[Q]),Ez=Y.useCallback(()=>{q(crypto.randomUUID()),G(!0),x(null)},[]),Pz=Y.useCallback(async()=>{let z=await fetch(`/api/workspaces/${Q}/sessions/${k.current}/events`);x(z.ok?await z.json():[])},[Q]),Rz=Y.useMemo(()=>X.find((z)=>z.value===U)?.supportedEffortLevels??[],[X,U]),bz=Y.useMemo(()=>d?j.filter((z)=>z.frame.type!=="preview"):j,[j,d]);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-lg 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:Q,onChange:(z)=>J(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:U,onChange:(z)=>F(z.target.value),children:[K.jsx("option",{value:"",children:"default model"}),X.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:L,onChange:(z)=>g(z.target.value),children:[K.jsx("option",{value:"",children:"default effort"}),Rz.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:E,onChange:(z)=>p(z.target.checked)}),"stream"]}),K.jsx("span",{className:"grow"}),v==="codex"&&K.jsx("span",{className:I("rounded px-1.5 py-0.5 font-mono text-[10px]",m?.running?"bg-green-500/15 text-green-600":"bg-muted text-muted-foreground"),children:m?.running?`app-server pid ${m.pid}`:"app-server not running"}),K.jsxs("span",{className:"max-w-56 truncate font-mono text-[10px] text-muted-foreground",children:["thread ",$]}),K.jsx(H,{type:"button",size:"sm",variant:"outline",onClick:Ez,children:"New thread"}),K.jsx(H,{type:"button",size:"sm",variant:"outline",onClick:Lz,children:"Stop"})]}),K.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 rounded-lg border border-border bg-background px-2 py-1.5",children:[kz.map((z)=>K.jsx(H,{type:"button",size:"sm",variant:"secondary",onClick:()=>Zz(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:b,onChange:(z)=>C(z.target.value),onKeyDown:(z)=>{if(z.key==="Enter")Zz(b),C("")}})]}),K.jsxs("div",{className:"flex min-h-0 flex-1 gap-2",children:[K.jsx(l,{title:v==="codex"?"App-server wire":"Harness wire",hint:v==="codex"?"raw JSON-RPC, both directions":v==="openclaw"?"no wire tap for OpenClaw yet":"raw Agent SDK messages + enqueued inputs",onClear:()=>w([]),children:yz.map((z)=>K.jsx(i,{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:c(z.frame),body:z.frame},z.seq))}),K.jsxs(l,{title:"Client frames",hint:"what the browser receives on /ws",onClear:()=>Qz([]),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:d,onChange:(z)=>Bz(z.target.checked)}),"hide preview frames"]})}),bz.map((z)=>K.jsx(i,{time:z.ts,badge:"ws",badgeClass:"bg-purple-500/15 text-purple-600",label:c(z.frame),body:z.frame},z.seq))]}),K.jsxs(l,{title:"Durable events",hint:"GET /sessions/:id/events replay",children:[K.jsx("div",{className:"border-b border-border/40 px-2 py-1",children:K.jsx(H,{type:"button",size:"sm",variant:"secondary",onClick:Pz,children:"Fetch events"})}),Yz?.map((z,N)=>K.jsx(i,{time:Date.now(),badge:"ev",badgeClass:"bg-teal-500/15 text-teal-600",label:c(z),body:z},N)),Yz?.length===0&&K.jsx("div",{className:"p-2 text-[11px] text-muted-foreground",children:"no events"})]})]})]})}var n=A(h(),1);var y=A(h(),1);var T=A(D(),1),vz=5,hz=5,qz=[".....","####.","#.#.#","#.#.#","#.#.#"];function Jz(_){return _.map((Z)=>[...Z].map((Q)=>Q==="#"))}function Sz(){return Array.from({length:hz},()=>Array.from({length:vz},()=>!1))}function Xz(){let[_,Z]=y.useState(()=>Jz(qz)),[Q,J]=y.useState(!1),X=y.useRef(!0),[B,U]=y.useState(!1);y.useEffect(()=>{let $=()=>J(!1);return window.addEventListener("mouseup",$),()=>window.removeEventListener("mouseup",$)},[]);function F($,q,M){Z((G)=>{if(G[$][q]===M)return G;let b=G.map((C)=>C.slice());return b[$][q]=M,b})}function L($,q){let M=!_[$][q];X.current=M,J(!0),F($,q,M)}function g($,q){if(Q)F($,q,X.current)}let E=_.map(($)=>$.map((q)=>q?"#":".").join("")).join(`
2
+ `);async function p(){await navigator.clipboard.writeText(E),U(!0),setTimeout(()=>U(!1),1200)}return T.jsxs("div",{className:"flex flex-col items-center gap-4",children:[T.jsx("div",{className:"grid w-fit grid-cols-[repeat(5,28px)] gap-px bg-border p-px select-none",children:_.map(($,q)=>$.map((M,G)=>T.jsx("div",{onMouseDown:()=>L(q,G),onMouseEnter:()=>g(q,G),className:I("size-7 cursor-pointer",M?"bg-foreground":"bg-background")},`${q}-${G}`)))}),T.jsx("pre",{className:"rounded-md border border-border bg-card px-3 py-2 text-center font-mono text-sm leading-snug text-card-foreground",children:E}),T.jsxs("div",{className:"flex gap-2",children:[T.jsx(H,{type:"button",size:"sm",onClick:p,children:B?"Copied!":"Copy"}),T.jsx(H,{type:"button",variant:"secondary",size:"sm",onClick:()=>Z(Sz()),children:"Clear"}),T.jsx(H,{type:"button",variant:"secondary",size:"sm",onClick:()=>Z(Jz(qz)),children:"Reset"})]})]})}var V=A(D(),1),gz=[{value:"moi",label:"M"},{value:"moi-full",label:"moi"}],pz=[{value:"none",label:"None"},{value:"wave",label:"Wave"},{value:"chaos",label:"Random"}];function Hz({options:_,value:Z,onChange:Q}){return V.jsx("div",{className:"flex gap-1 rounded-lg bg-accent p-1",children:_.map((J)=>V.jsx(H,{type:"button",variant:Z===J.value?"default":"ghost",size:"sm",onClick:()=>Q(J.value),children:J.label},String(J.value)))})}function Gz(){let[_,Z]=n.useState("moi"),[Q,J]=n.useState("none");return V.jsxs("div",{className:"relative flex min-h-dvh flex-col items-center justify-center gap-8 bg-muted",children:[V.jsx("span",{className:"absolute top-5 left-5 text-[11px] font-medium tracking-widest text-muted-foreground uppercase",children:"Playground"}),V.jsx(Xz,{}),V.jsx(Az,{sprite:_,effect:Q==="none"?void 0:Q,pixelSize:3,gap:0.5}),V.jsxs("div",{className:"flex flex-col items-center gap-2",children:[V.jsx(Hz,{options:gz,value:_,onChange:Z}),V.jsx(Hz,{options:pz,value:Q,onChange:J})]})]})}var Dz=A(h(),1);var r="/Users/kim/git/confetti",Oz={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
3
+ mcp__notion__notion-get-teams
4
+ mcp__notion__notion-get-users`},Uz={toolCallId:"toolu_fixture_notion_search",name:"mcp__notion__notion-search",caller:"model",provider:"claude-code",state:"success",input:{query:"project notes docs overview",query_type:"internal",page_size:25},output:'{"results":[{"id":"3f1c9a72-0d62-4511-9dc9-5b7f38409a22","title":"Reading List","url":"https://app.notion.com/p/3f1c9a720d6245119dc95b7f38409a22?pvs=1","type":"page","highlight":"Reading List","timestamp":"2024-10-17T13:51:00.000Z"},{"id":"8b2d17aa-6741-4993-88bc-5adf2dabb8da","title":"To-Do","url":"https://app.notion.com/p/8b2d17aa6741499388bc5adf2dabb8da?pvs=1","type":"page","highlight":"canvas-confetti performance notes and particle pooling","timestamp":"2026-06-15T13:14:00.000Z"},{"id":"244536fd-e65b-433f-92bf-aa95efa91f35","title":"Plans & Notes","url":"https://app.notion.com/p/244536fde65b433f92bfaa95efa91f35?pvs=1","type":"database","highlight":"Plans & Notes","timestamp":"2024-02-06T10:02:00.000Z"},{"id":"5a668c31-b678-4035-b58e-d33e3ce86f5e","title":"Animation Research","url":"https://app.notion.com/p/5a668c31b6784035b58ed33e3ce86f5e?pvs=1","type":"page","highlight":"spring easings vs. bezier — generate N particle bursts in parallel and compare frame budgets","timestamp":"2025-11-03T08:07:00.000Z"},{"id":"41c28e19-b678-40df-ade3-dd8cec63de64","title":"Roadmap","url":"https://app.notion.com/p/41c28e19b67840dfade3dd8cec63de64?pvs=1","type":"database","highlight":"Roadmap","timestamp":"2026-06-09T08:00:00.000Z"},{"id":"6d9e2f44-b678-423e-9795-01de5d5f6734","title":"Meeting notes","url":"https://app.notion.com/p/6d9e2f44b678423e979501de5d5f6734?pvs=1","type":"database","highlight":"Meeting notes","timestamp":"2025-11-06T15:22:00.000Z"},{"id":"7fa31c55-b678-401d-948f-c47118e21516","title":"illustrations","url":"https://app.notion.com/p/7fa31c55b678401d948fc47118e21516?pvs=1","type":"page","highlight":"illustrations","timestamp":"2026-06-09T18:01:00.000Z"},{"id":"92e4b5c8-8d50-4938-8808-716a4e89dba6","title":"Weekly Update: March 4","url":"https://app.notion.com/p/92e4b5c88d5049388808716a4e89dba6?pvs=1","type":"page","highlight":"add backlog project for migrating v1 users","timestamp":"2022-07-30T18:34:00.000Z"},{"id":"1c778a02-b678-407b-9340-e1e830e38c50","title":"demo site","url":"https://app.notion.com/p/1c778a02b678407b9340e1e830e38c50?pvs=1","type":"page","highlight":"Interactive playground (CodeSandbox style)","timestamp":"2026-06-15T08:15:00.000Z"},{"id":"e3558d21-b678-406b-9a90-efaac9d864cf","title":"Feature Requests","url":"https://app.notion.com/p/e3558d21b678406b9a90efaac9d864cf?pvs=1","type":"database","highlight":"Feature Requests","timestamp":"2026-03-09T13:03:00.000Z"},{"id":"a91f4c6e-ce16-4002-bcb1-ead4923b9963","title":"Beta feedback","url":"https://app.notion.com/p/a91f4c6ece164002bcb1ead4923b9963?pvs=1","type":"database","highlight":"Beta feedback","timestamp":"2026-04-22T11:56:00.000Z"},{"id":"b0537e88-b678-40f3-8f04-cc7fef16e055","title":"confetti-v2","url":"https://app.notion.com/p/b0537e88b67840f38f04cc7fef16e055?pvs=1","type":"page","highlight":"WebGL renderer spike — offscreen canvas + worker, fall back to 2d context","timestamp":"2026-04-21T09:42:00.000Z"},{"id":"c6b19d34-b678-4145-9023-ffb37c04037d","title":"Physics Notes","url":"https://app.notion.com/p/c6b19d34b67841459023ffb37c04037d?pvs=1","type":"page","highlight":"Physics Notes","timestamp":"2026-04-21T13:07:00.000Z"},{"id":"d84a6f10-b678-41ea-845c-d7cc7c2ad2c4","title":"Docs Outline","url":"https://app.notion.com/p/d84a6f10b67841ea845cd7cc7c2ad2c4?pvs=1","type":"page","highlight":"\uD83D\uDCD8 Getting started — full walkthrough (install, first burst, presets)","timestamp":"2026-06-09T08:44:00.000Z"},{"id":"f2c07b45-b678-402c-a8e7-d897826cf96d","title":"old","url":"https://app.notion.com/p/f2c07b45b678402ca8e7d897826cf96d?pvs=1","type":"page","highlight":"Notes:","timestamp":"2026-03-06T16:31:00.000Z"},{"id":"09d6e2a7-9908-4d54-be46-a974ac5019da","title":"Weekly Update: Jan 28","url":"https://app.notion.com/p/09d6e2a799084d54be46a974ac5019da'},mz={toolCallId:"toolu_fixture_notion_fetch_oss",name:"mcp__notion__notion-fetch",caller:"model",provider:"claude-code",state:"success",input:{id:"55e1c208-1f0f-47cd-9422-bd7dbc54d536"},output:'{"metadata":{"type":"page"},"title":"\uD83D\uDEE5 Open-Source","url":"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536","text":"Here is the result of \\"view\\" for the Page with URL https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536 as of 2026-05-29T13:08:56.275Z:\\n<page url=\\"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536\\" icon=\\"\uD83D\uDEE5\\">\\n<ancestor-path></ancestor-path>\\n<properties>\\n{\\"title\\":\\"Open-Source\\"}\\n</properties>\\n<content>\\n<page url=\\"https://app.notion.com/p/71a2b39c6438406fac456aeef33a046d\\">tinyrouter</page>\\n<page url=\\"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c\\">confetti</page>\\n<page url=\\"https://app.notion.com/p/95c6d7f0210d42e0888168401a40345e\\">mdnav</page>\\n<page url=\\"https://app.notion.com/p/07d8e912111a4df295726341c22decbc\\">pixelpad</page>\\n<page url=\\"https://app.notion.com/p/19e0fb3405c743628f0c0b864b4182ee\\">`use-sparkle`</page>\\n<page url=\\"https://app.notion.com/p/2bf21c561e5d4e888f6cdb86e5adcb9d\\">use-hotkey</page>\\n<empty-block/>\\n<empty-block/>\\n</content>\\n</page>"}'},wz={toolCallId:"toolu_fixture_notion_fetch_confetti",name:"mcp__notion__notion-fetch",caller:"model",provider:"claude-code",state:"success",input:{id:"83b4c5de-45af-40c2-8a19-f635332f9c4c"},output:'{"metadata":{"type":"page"},"title":"confetti","url":"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c","text":"Here is the result of \\"view\\" for the Page with URL https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c as of 2024-04-19T10:05:10.098Z:\\n<page url=\\"https://app.notion.com/p/83b4c5de45af40c28a19f635332f9c4c\\">\\n<ancestor-path>\\n<parent-page url=\\"https://app.notion.com/p/55e1c2081f0f47cd9422bd7dbc54d536\\" title=\\"Open-Source\\"/>\\n</ancestor-path>\\n<properties>\\n{\\"title\\":\\"confetti\\"}\\n</properties>\\n<content>\\n- [x] Split the physics step from the render step\\n- [x] Basic React API\\n\\t- [x] Controlled/uncontrolled\\n\\t- [x] SSR: ok! No canvas until mount\\n\\t- [x] Detach on unmount\\n\\t- [x] `asChild` prop\\n\\t- [x] Block elements and `tagName`\\n\\t- [x] Fire on `click`\\n\\t- [x] Pass particle options\\n\\t- [x] asChild types\\n\\t- [x] Reduced-motion fallback\\n- [x] Pause bursts when the tab is hidden (VisibilityObserver)\\n- [x] Default burst has no trail. Needs a wrapper that disables the selector via `:has` — but then how do block elements animate? And `asChild` breaks.\\n- [x] Dark/light theme, none, auto, accent color\\n- [x] Demo: light/dark theme\\n- [x] `useIsomorphicLayoutEffect`\\n- [x] Particle pooling (no per-frame allocs)\\n- [x] Build and package\\n- [x] Publish a canary and dogfood it on the demo site\\n- [x] Fallback for Safari + Firefox: pre-rendered sprite sheet, three layers offset by primes 3, 5, 7 — loop four frames\\n- [x] data-active\\n- [x] pixelRatio for the fallback\\n- [x] How should styles load? Ship them separately.\\n- [x] Simple README\\n- [x] Get the easing curve right\\n- [ ] Use inline style in SSR\\n<empty-block/>\\n```javascript\\n// Default confetti: uncontrolled, light theme, fires on click, creates an\\n// inline <span> wrapper, no trail, does not follow the pointer\\n\\n/**\\n * Elements \\n */\\n<Confetti>Party!</Confetti> // <span>Party!</span>\\n<Confetti className=\\"custom\\">Party!</Confetti>\\n\\n// block elements \\n<Confetti block><img /></Confetti> // <div><img /></div>\\n<Confetti tagName=\\"div\\"><img /></Confetti> // alias\\n\\n// advanced\\n<Confetti asChild><button aria-label=\\"celebrate\\" /></Confetti>\\n\\n/**\\n * Controlled/uncontrolled component \\n */\\n\\n<Confetti /> // fires on click, uncontrolled\\n<Confetti fireOn=\\"click\\" />\\n<Confetti fireOn=\\"hover\\" />\\n<Confetti defaultActive={false} onChange={(value) => change} />\\n\\n// when `active` is provided, it becomes controlled and\\n// `fireOn` and `defaultActive` have no effect \\n<Confetti active={true}>Always bursting</Confetti> // controlled\\n<Confetti active={value} onClick={() => setValue()}</Confetti> // controlled\\n\\n/** \\n * Theming \\n */\\n\\n<Confetti /> // default theme is `light`\\n<Confetti theme=\\"dark\\" />\\n<Confetti theme=\\"auto\\" /> // system-defined\\n<Confetti theme=\\"dark\\" accentColor=\\"red\\" /> // use `colord` here\\n\\n/**\\n * Particle options\\n */\\n<Confetti count={120} gravity={0.8} spread={60}>Boom</Confetti>\\n<Confetti preset=\\"fireworks\\">Boom</Confetti>\\n\\n/** \\n * Styling \\n */\\n\\nimport { Confetti } from \\"confetti\\"\\n\\nimport { Confetti } from \\"confetti/unstyled\\"\\nimport \\"confetti/styles.css\\"\\n```\\n<empty-block/>\\n<empty-block/>\\n<page url=\\"https://app.notion.com/p/3dc43e781e5d4e888f6cdb86e5adcb00\\">Confetti: website</page>\\n</content>\\n</page>"}'},Vz={toolCallId:"toolu_fixture_bash_pwd",name:"Bash",caller:"model",provider:"claude-code",state:"success",input:{command:'pwd && echo "---" && ls -la && echo "--- git ---" && git rev-parse --is-inside-work-tree 2>/dev/null && git remote -v 2>/dev/null',description:"Show current directory and git info"},output:`/Users/kim/git/confetti
5
+ ---
6
+ total 232
7
+ drwxr-xr-x 19 kim staff 608 Jun 9 19:41 .
8
+ drwxr-xr-x 52 kim staff 1664 Jun 15 10:32 ..
9
+ drwx------ 3 kim staff 96 Nov 17 2025 .claude
10
+ drwxr-xr-x 15 kim staff 480 May 23 09:30 .git
11
+ -rw-r--r-- 1 kim staff 294 May 23 08:52 .gitignore
12
+ drwxr-xr-x@ 3 kim staff 96 Jun 9 19:41 .moi
13
+ -rw-r--r-- 1 kim staff 95 Nov 13 2025 .prettierrc
14
+ -rw-r--r-- 1 kim staff 73126 May 23 09:29 bun.lock
15
+ drwxr-xr-x@ 8 kim staff 256 May 23 09:31 esm
16
+ -rw-r--r-- 1 kim staff 1210 Nov 13 2025 LICENSE
17
+ drwxr-xr-x 160 kim staff 5120 May 23 09:30 node_modules
18
+ -rw-r--r-- 1 kim staff 2072 May 23 08:52 package.json
19
+ -rw-r--r--@ 1 kim staff 4600 May 5 21:49 README.md
20
+ drwxr-xr-x 16 kim staff 512 May 5 21:49 src
21
+ -rw-r--r-- 1 kim staff 605 Nov 13 2025 tsconfig.json
22
+ -rw-r--r-- 1 kim staff 233 Nov 13 2025 tsconfig.node.json
23
+ -rw-r--r-- 1 kim staff 1582 May 23 08:52 vite.config.ts
24
+ drwxr-xr-x 11 kim staff 352 May 5 21:49 web
25
+ --- git ---
26
+ true
27
+ origin git@github.com:acme/confetti.git (fetch)
28
+ origin git@github.com:acme/confetti.git (push)`},jz={toolCallId:"toolu_fixture_read_readme",name:"Read",caller:"model",provider:"claude-code",state:"success",input:{file_path:"/Users/kim/git/confetti/docs/open-source/README.md"},output:` 1 # \uD83D\uDEE5 Open-Source
29
+ 2
30
+ 3 Working notes, specs, and ideas for my open-source projects.
31
+ 4
32
+ 5 | Project | What it is |
33
+ 6 |---------|------------|
34
+ 7 | tinyrouter | Minimalist hooks-based router for React |
35
+ 8 | confetti | <Confetti> burst effect for React |
36
+ `},xz={toolCallId:"toolu_fixture_github_get_me",name:"mcp__github__get_me",caller:"model",provider:"claude-code",state:"success",input:{},output:'{"login":"octocat","id":583231,"profile_url":"https://github.com/octocat","avatar_url":"https://avatars.githubusercontent.com/u/583231?v=4","details":{"name":"The Octocat","blog":"https://github.blog","location":"San Francisco","hireable":true,"twitter_username":"github","public_repos":8,"public_gists":8,"followers":700,"following":9,"created_at":"2011-01-25T18:44:36Z","updated_at":"2026-06-13T09:04:50Z"}}'},Mz={type:"reasoning",text:`The user is greeting me casually with "Hey bro". This is a friendly greeting and they're not asking me to do anything specific yet. I should respond in a friendly, casual way and let them know I'm ready to help with whatever they need.`},dz={toolCallId:"toolu_fixture_skill_widgets",name:"Skill",caller:"model",provider:"claude-code",state:"success",input:{skill:"widgets"},skill:{skillName:"widgets"},output:"Launching skill: widgets"},o=[{type:"tool-call",call:Vz}],t=[Mz,{type:"tool-call",call:Oz},{type:"tool-call",call:dz},{type:"tool-call",call:Uz},{type:"tool-call",call:mz},{type:"tool-call",call:jz},{type:"tool-call",call:Vz},{type:"tool-call",call:wz},{type:"tool-call",call:xz}],uz={toolCallId:"toolu_fixture_running_bash",name:"Bash",caller:"model",provider:"claude-code",state:"running",input:{command:"bun test --coverage",description:"Run the test suite"}},s=[Mz,{type:"tool-call",call:Oz},{type:"tool-call",call:Uz},{type:"tool-call",call:uz},{type:"reasoning",text:"The test run is still going. Once it passes I will write the summary into docs/ and open a PR."}],a={toolCallId:"toolu_fixture_subagent",name:"Agent",caller:"subagent",provider:"claude-code",state:"running",input:{description:"Explore mdnav-demo repo structure and purpose",subagent_type:"Explore",prompt:"Explore the mdnav-demo repository to understand what it is. Look at the repo structure, what mdnav is, example markdown, and the purpose. Give a comprehensive overview citing specific files."},output:"",subagent:{taskId:"task_explore_mdnav",description:"Explore mdnav-demo repo structure and purpose",status:"running",usage:{totalTokens:18407,toolUses:8,durationMs:10725},progress:["Reading ~/git/mdnav-demo","Reading README.md","Reading package.json","Reading CLAUDE.md","Running ls -la /Users/kim/git/mdnav-demo/","Finding **/*.md","Finding **/*.{js,ts,jsx,tsx}","Running head -100 /Users/kim/git/mdnav-demo/moby-dick.md"],transcript:[{id:"sub-1",role:"assistant",origin:{kind:"user-input"},parts:[{type:"reasoning",text:"Let me map the repo: list the markdown files, read the README, then see what the mdnav binary does."},{type:"tool-call",call:{toolCallId:"sub-glob",name:"Glob",caller:"model",provider:"claude-code",state:"success",input:{pattern:"**/*.md"},output:`README.md
37
+ docs/moby-dick.md
38
+ docs/sections/01-introduction.md
39
+ docs/sections/02-findings.md`}},{type:"tool-call",call:{toolCallId:"sub-bash",name:"Bash",caller:"model",provider:"claude-code",state:"success",input:{command:"mdnav --help"},output:`mdnav — navigate large markdown
40
+
41
+ USAGE: mdnav <file> <command>
42
+
43
+ COMMANDS:
44
+ toc print the table of contents
45
+ read read a section (fuzzy/regex/path selector)
46
+ search full-text search`}}]},{id:"sub-2",role:"assistant",origin:{kind:"user-input"},parts:[{type:"text",text:`## Comprehensive Overview of mdnav-demo
47
+
48
+ **mdnav-demo** showcases **mdnav**, a CLI for large markdown documents, using the full text of Moby-Dick as a large-document fixture.`}]}]}},fz={...a,toolCallId:"toolu_fixture_subagent_done",state:"success",output:"mdnav-demo showcases **mdnav**, a CLI for navigating large markdown documents. The repo is a demo harness: a single `moby-dick.md` fixture plus a thin CLI (`toc`/`read`/`search`) that fuzzy-selects sections. README and CLAUDE.md frame it as a worked example, not a library.",subagent:{...a.subagent,taskId:"task_explore_mdnav_done",status:"completed"}},e=[{type:"reasoning",text:"This needs a deeper look — let me spin up an Explore subagent to map the repo while I keep going."},{type:"tool-call",call:a}],zz=[{type:"reasoning",text:"This needs a deeper look — let me spin up an Explore subagent to map the repo while I keep going."},{type:"tool-call",call:fz}];var W=A(D(),1),cz=[{value:"single",label:"Single"},{value:"multiple",label:"Multiple"},{value:"live",label:"Live"},{value:"subagent",label:"Subagent"},{value:"subagent-done",label:"Subagent done"}];function iz({value:_,onChange:Z}){return W.jsx("div",{className:"flex gap-1 rounded-lg bg-accent p-1",children:cz.map((Q)=>W.jsx(H,{type:"button",variant:_===Q.value?"default":"ghost",size:"sm",onClick:()=>Z(Q.value),children:Q.label},Q.value))})}var lz={single:o,multiple:t,live:s,subagent:e,"subagent-done":zz};function Tz(){let[_,Z]=Dz.useState("multiple");return W.jsxs("div",{className:"flex min-h-dvh flex-col items-center gap-6 bg-muted px-4 py-16",children:[W.jsx("span",{className:"text-[11px] font-medium tracking-widest text-muted-foreground uppercase",children:"Playground / Tool calls"}),W.jsx(iz,{value:_,onChange:Z}),W.jsx("div",{className:"w-full max-w-[var(--column-w)] rounded-xl border border-border bg-background p-5 font-sans text-foreground shadow-sm",children:W.jsx(Kz,{parts:lz[_],cwd:r,processing:_==="live"})})]})}var R=A(D(),1);function nz(){return R.jsxs(Wz,{children:[R.jsx(S,{path:"/dev/harness",component:$z}),R.jsx(S,{path:"/dev/tool-calls",component:Tz}),R.jsx(S,{path:"/dev",component:Gz})]})}export{nz as default};
@@ -0,0 +1 @@
1
+ import{Hc as a}from"/chunk-vkvb3hjm.js";if(typeof globalThis.structuredClone==="function")globalThis.structuredClone=globalThis.structuredClone.bind(globalThis);async function e(r){let{mount:t}=await import("/chunk-6c24yndg.js");t(r)}globalThis.__init=e;
@@ -1,2 +1,2 @@
1
1
  var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,s=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var t=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var u=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var v=((a)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});
2
- export{s as Qb,t as Rb,u as Sb,v as Tb};
2
+ export{s as Ec,t as Fc,u as Gc,v as Hc};
@@ -0,0 +1,2 @@
1
+ import{dc as L0,ec as o,fc as r,ga as _0,hc as c,ia as v0,ic as n,kc as I0,lc as N1,mc as z0,nc as b0,oc as H1,pc as y0,qc as U0,rc as f,sc as N0,tc as G0,uc as J0,vc as D0}from"/chunk-4vf1t6v1.js";import{Ec as X0,Fc as A0}from"/chunk-vkvb3hjm.js";var D1=A0((t1,h0)=>{h0.exports=globalThis.__esm["react-dom/client"]});var w0=A0((qG,x0)=>{x0.exports=globalThis.__esm["react-dom"]});var E0=new Map;function e1(G,J){if(J)E0.set(G,J);else E0.delete(G)}function GG(G){return E0.get(G)}var V0=X0(_0(),1);var K0=new Set,t=null,H0=!1;function u0(){if(t||H0)return;H0=!0;let G=new WebSocket(v0("/api/workspaces/ws"));G.onopen=()=>{t=G,H0=!1},G.onmessage=(J)=>{try{let K=JSON.parse(J.data);for(let Q of K0)Q(K)}catch{}},G.onclose=()=>{if(t=null,H0=!1,K0.size>0)setTimeout(u0,2000)},G.onerror=()=>{G.close()}}function QG(G){let J=V0.useRef(G);J.current=G,V0.useEffect(()=>{let K=(Q)=>J.current(Q);return K0.add(K),u0(),()=>{if(K0.delete(K),K0.size===0&&t)t.close(),t=null}},[])}var m0=["top","right","bottom","left"];var{min:p,max:S,round:Z0,floor:q0}=Math,x=(G)=>({x:G,y:G}),b1={left:"right",right:"left",bottom:"top",top:"bottom"};function j0(G,J,K){return S(G,p(J,K))}function m(G,J){return typeof G==="function"?G(J):G}function d(G){return G.split("-")[0]}function i(G){return G.split("-")[1]}function Y0(G){return G==="x"?"y":"x"}function T0(G){return G==="y"?"height":"width"}function w(G){let J=G[0];return J==="t"||J==="b"?"y":"x"}function B0(G){return Y0(w(G))}function d0(G,J,K){if(K===void 0)K=!1;let Q=i(G),Z=B0(G),q=T0(Z),U=Z==="x"?Q===(K?"end":"start")?"right":"left":Q==="start"?"bottom":"top";if(J.reference[q]>J.floating[q])U=Q0(U);return[U,Q0(U)]}function c0(G){let J=Q0(G);return[W0(G),J,W0(J)]}function W0(G){return G.includes("start")?G.replace("start","end"):G.replace("end","start")}var g0=["left","right"],p0=["right","left"],y1=["top","bottom"],S1=["bottom","top"];function O1(G,J,K){switch(G){case"top":case"bottom":if(K)return J?p0:g0;return J?g0:p0;case"left":case"right":return J?y1:S1;default:return[]}}function f0(G,J,K,Q){let Z=i(G),q=O1(d(G),K==="start",Q);if(Z){if(q=q.map((U)=>U+"-"+Z),J)q=q.concat(q.map(W0))}return q}function Q0(G){let J=d(G);return b1[J]+G.slice(J.length)}function P1(G){return{top:0,right:0,bottom:0,left:0,...G}}function $0(G){return typeof G!=="number"?P1(G):{top:G,right:G,bottom:G,left:G}}function s(G){let{x:J,y:K,width:Q,height:Z}=G;return{width:Q,height:Z,top:K,left:J,right:J+Q,bottom:K+Z,x:J,y:K}}function r0(G,J,K){let{reference:Q,floating:Z}=G,q=w(J),U=B0(J),N=T0(U),V=d(J),j=q==="y",H=Q.x+Q.width/2-Z.width/2,W=Q.y+Q.height/2-Z.height/2,Y=Q[N]/2-Z[N]/2,X;switch(V){case"top":X={x:H,y:Q.y-Z.height};break;case"bottom":X={x:H,y:Q.y+Q.height};break;case"right":X={x:Q.x+Q.width,y:W};break;case"left":X={x:Q.x-Z.width,y:W};break;default:X={x:Q.x,y:Q.y}}switch(i(J)){case"start":X[U]-=Y*(K&&j?-1:1);break;case"end":X[U]+=Y*(K&&j?-1:1);break}return X}async function n0(G,J){var K;if(J===void 0)J={};let{x:Q,y:Z,platform:q,rects:U,elements:N,strategy:V}=G,{boundary:j="clippingAncestors",rootBoundary:H="viewport",elementContext:W="floating",altBoundary:Y=!1,padding:X=0}=m(J,G),T=$0(X),I=N[Y?W==="floating"?"reference":"floating":W],L=s(await q.getClippingRect({element:((K=await(q.isElement==null?void 0:q.isElement(I)))!=null?K:!0)?I:I.contextElement||await(q.getDocumentElement==null?void 0:q.getDocumentElement(N.floating)),boundary:j,rootBoundary:H,strategy:V})),M=W==="floating"?{x:Q,y:Z,width:U.floating.width,height:U.floating.height}:U.reference,F=await(q.getOffsetParent==null?void 0:q.getOffsetParent(N.floating)),z=await(q.isElement==null?void 0:q.isElement(F))?await(q.getScale==null?void 0:q.getScale(F))||{x:1,y:1}:{x:1,y:1},k=s(q.convertOffsetParentRelativeRectToViewportRelativeRect?await q.convertOffsetParentRelativeRectToViewportRelativeRect({elements:N,rect:M,offsetParent:F,strategy:V}):M);return{top:(L.top-k.top+T.top)/z.y,bottom:(k.bottom-L.bottom+T.bottom)/z.y,left:(L.left-k.left+T.left)/z.x,right:(k.right-L.right+T.right)/z.x}}var R1=50,i0=async(G,J,K)=>{let{placement:Q="bottom",strategy:Z="absolute",middleware:q=[],platform:U}=K,N=U.detectOverflow?U:{...U,detectOverflow:n0},V=await(U.isRTL==null?void 0:U.isRTL(J)),j=await U.getElementRects({reference:G,floating:J,strategy:Z}),{x:H,y:W}=r0(j,Q,V),Y=Q,X=0,T={};for(let B=0;B<q.length;B++){let I=q[B];if(!I)continue;let{name:L,fn:M}=I,{x:F,y:z,data:k,reset:E}=await M({x:H,y:W,initialPlacement:Q,placement:Y,strategy:Z,middlewareData:T,rects:j,platform:N,elements:{reference:G,floating:J}});if(H=F!=null?F:H,W=z!=null?z:W,T[L]={...T[L],...k},E&&X<R1){if(X++,typeof E==="object"){if(E.placement)Y=E.placement;if(E.rects)j=E.rects===!0?await U.getElementRects({reference:G,floating:J,strategy:Z}):E.rects;({x:H,y:W}=r0(j,Y,V))}B=-1}}return{x:H,y:W,placement:Y,strategy:Z,middlewareData:T}},s0=(G)=>({name:"arrow",options:G,async fn(J){let{x:K,y:Q,placement:Z,rects:q,platform:U,elements:N,middlewareData:V}=J,{element:j,padding:H=0}=m(G,J)||{};if(j==null)return{};let W=$0(H),Y={x:K,y:Q},X=B0(Z),T=T0(X),B=await U.getDimensions(j),I=X==="y",L=I?"top":"left",M=I?"bottom":"right",F=I?"clientHeight":"clientWidth",z=q.reference[T]+q.reference[X]-Y[X]-q.floating[T],k=Y[X]-q.reference[X],E=await(U.getOffsetParent==null?void 0:U.getOffsetParent(j)),$=E?E[F]:0;if(!$||!await(U.isElement==null?void 0:U.isElement(E)))$=N.floating[F]||q.floating[T];let O=z/2-k/2,v=$/2-B[T]/2-1,y=p(W[L],v),u=p(W[M],v),A=y,P=$-B[T]-u,D=$/2-B[T]/2+O,g=j0(A,D,P),b=!V.arrow&&i(Z)!=null&&D!==g&&q.reference[T]/2-(D<A?y:u)-B[T]/2<0,R=b?D<A?D-A:D-P:0;return{[X]:Y[X]+R,data:{[X]:g,centerOffset:D-g-R,...b&&{alignmentOffset:R}},reset:b}}});var a0=function(G){if(G===void 0)G={};return{name:"flip",options:G,async fn(J){var K,Q;let{placement:Z,middlewareData:q,rects:U,initialPlacement:N,platform:V,elements:j}=J,{mainAxis:H=!0,crossAxis:W=!0,fallbackPlacements:Y,fallbackStrategy:X="bestFit",fallbackAxisSideDirection:T="none",flipAlignment:B=!0,...I}=m(G,J);if((K=q.arrow)!=null&&K.alignmentOffset)return{};let L=d(Z),M=w(N),F=d(N)===N,z=await(V.isRTL==null?void 0:V.isRTL(j.floating)),k=Y||(F||!B?[Q0(N)]:c0(N)),E=T!=="none";if(!Y&&E)k.push(...f0(N,B,T,z));let $=[N,...k],O=await V.detectOverflow(J,I),v=[],y=((Q=q.flip)==null?void 0:Q.overflows)||[];if(H)v.push(O[L]);if(W){let D=d0(Z,U,z);v.push(O[D[0]],O[D[1]])}if(y=[...y,{placement:Z,overflows:v}],!v.every((D)=>D<=0)){var u,A;let D=(((u=q.flip)==null?void 0:u.index)||0)+1,g=$[D];if(g){if(!(W==="alignment"?M!==w(g):!1)||y.every((_)=>w(_.placement)===M?_.overflows[0]>0:!0))return{data:{index:D,overflows:y},reset:{placement:g}}}let b=(A=y.filter((R)=>R.overflows[0]<=0).sort((R,_)=>R.overflows[1]-_.overflows[1])[0])==null?void 0:A.placement;if(!b)switch(X){case"bestFit":{var P;let R=(P=y.filter((_)=>{if(E){let h=w(_.placement);return h===M||h==="y"}return!0}).map((_)=>[_.placement,_.overflows.filter((h)=>h>0).reduce((h,l)=>h+l,0)]).sort((_,h)=>_[1]-h[1])[0])==null?void 0:P[0];if(R)b=R;break}case"initialPlacement":b=N;break}if(Z!==b)return{reset:{placement:b}}}return{}}}};function l0(G,J){return{top:G.top-J.height,right:G.right-J.width,bottom:G.bottom-J.height,left:G.left-J.width}}function o0(G){return m0.some((J)=>G[J]>=0)}var t0=function(G){if(G===void 0)G={};return{name:"hide",options:G,async fn(J){let{rects:K,platform:Q}=J,{strategy:Z="referenceHidden",...q}=m(G,J);switch(Z){case"referenceHidden":{let U=await Q.detectOverflow(J,{...q,elementContext:"reference"}),N=l0(U,K.reference);return{data:{referenceHiddenOffsets:N,referenceHidden:o0(N)}}}case"escaped":{let U=await Q.detectOverflow(J,{...q,altBoundary:!0}),N=l0(U,K.floating);return{data:{escapedOffsets:N,escaped:o0(N)}}}default:return{}}}}};var e0=new Set(["left","top"]);async function A1(G,J){let{placement:K,platform:Q,elements:Z}=G,q=await(Q.isRTL==null?void 0:Q.isRTL(Z.floating)),U=d(K),N=i(K),V=w(K)==="y",j=e0.has(U)?-1:1,H=q&&V?-1:1,W=m(J,G),{mainAxis:Y,crossAxis:X,alignmentAxis:T}=typeof W==="number"?{mainAxis:W,crossAxis:0,alignmentAxis:null}:{mainAxis:W.mainAxis||0,crossAxis:W.crossAxis||0,alignmentAxis:W.alignmentAxis};if(N&&typeof T==="number")X=N==="end"?T*-1:T;return V?{x:X*H,y:Y*j}:{x:Y*j,y:X*H}}var G1=function(G){if(G===void 0)G=0;return{name:"offset",options:G,async fn(J){var K,Q;let{x:Z,y:q,placement:U,middlewareData:N}=J,V=await A1(J,G);if(U===((K=N.offset)==null?void 0:K.placement)&&(Q=N.arrow)!=null&&Q.alignmentOffset)return{};return{x:Z+V.x,y:q+V.y,data:{...V,placement:U}}}}},J1=function(G){if(G===void 0)G={};return{name:"shift",options:G,async fn(J){let{x:K,y:Q,placement:Z,platform:q}=J,{mainAxis:U=!0,crossAxis:N=!1,limiter:V={fn:(L)=>{let{x:M,y:F}=L;return{x:M,y:F}}},...j}=m(G,J),H={x:K,y:Q},W=await q.detectOverflow(J,j),Y=w(d(Z)),X=Y0(Y),T=H[X],B=H[Y];if(U){let L=X==="y"?"top":"left",M=X==="y"?"bottom":"right",F=T+W[L],z=T-W[M];T=j0(F,T,z)}if(N){let L=Y==="y"?"top":"left",M=Y==="y"?"bottom":"right",F=B+W[L],z=B-W[M];B=j0(F,B,z)}let I=V.fn({...J,[X]:T,[Y]:B});return{...I,data:{x:I.x-K,y:I.y-Q,enabled:{[X]:U,[Y]:N}}}}}},K1=function(G){if(G===void 0)G={};return{options:G,fn(J){let{x:K,y:Q,placement:Z,rects:q,middlewareData:U}=J,{offset:N=0,mainAxis:V=!0,crossAxis:j=!0}=m(G,J),H={x:K,y:Q},W=w(Z),Y=Y0(W),X=H[Y],T=H[W],B=m(N,J),I=typeof B==="number"?{mainAxis:B,crossAxis:0}:{mainAxis:0,crossAxis:0,...B};if(V){let F=Y==="y"?"height":"width",z=q.reference[Y]-q.floating[F]+I.mainAxis,k=q.reference[Y]+q.reference[F]-I.mainAxis;if(X<z)X=z;else if(X>k)X=k}if(j){var L,M;let F=Y==="y"?"width":"height",z=e0.has(d(Z)),k=q.reference[W]-q.floating[F]+(z?((L=U.offset)==null?void 0:L[W])||0:0)+(z?0:I.crossAxis),E=q.reference[W]+q.reference[F]+(z?0:((M=U.offset)==null?void 0:M[W])||0)-(z?I.crossAxis:0);if(T<k)T=k;else if(T>E)T=E}return{[Y]:X,[W]:T}}}},Q1=function(G){if(G===void 0)G={};return{name:"size",options:G,async fn(J){var K,Q;let{placement:Z,rects:q,platform:U,elements:N}=J,{apply:V=()=>{},...j}=m(G,J),H=await U.detectOverflow(J,j),W=d(Z),Y=i(Z),X=w(Z)==="y",{width:T,height:B}=q.floating,I,L;if(W==="top"||W==="bottom")I=W,L=Y===(await(U.isRTL==null?void 0:U.isRTL(N.floating))?"start":"end")?"left":"right";else L=W,I=Y==="end"?"top":"bottom";let M=B-H.top-H.bottom,F=T-H.left-H.right,z=p(B-H[I],M),k=p(T-H[L],F),E=!J.middlewareData.shift,$=z,O=k;if((K=J.middlewareData.shift)!=null&&K.enabled.x)O=F;if((Q=J.middlewareData.shift)!=null&&Q.enabled.y)$=M;if(E&&!Y){let y=S(H.left,0),u=S(H.right,0),A=S(H.top,0),P=S(H.bottom,0);if(X)O=T-2*(y!==0||u!==0?y+u:S(H.left,H.right));else $=B-2*(A!==0||P!==0?A+P:S(H.top,H.bottom))}await V({...J,availableWidth:O,availableHeight:$});let v=await U.getDimensions(N.floating);if(T!==v.width||B!==v.height)return{reset:{rects:!0}};return{}}}};function X1(G){let J=f(G),K=parseFloat(J.width)||0,Q=parseFloat(J.height)||0,Z=n(G),q=Z?G.offsetWidth:K,U=Z?G.offsetHeight:Q,N=Z0(K)!==q||Z0(Q)!==U;if(N)K=q,Q=U;return{width:K,height:Q,$:N}}function S0(G){return!c(G)?G.contextElement:G}function e(G){let J=S0(G);if(!n(J))return x(1);let K=J.getBoundingClientRect(),{width:Q,height:Z,$:q}=X1(J),U=(q?Z0(K.width):K.width)/Q,N=(q?Z0(K.height):K.height)/Z;if(!U||!Number.isFinite(U))U=1;if(!N||!Number.isFinite(N))N=1;return{x:U,y:N}}var h1=x(0);function V1(G){let J=o(G);if(!y0()||!J.visualViewport)return h1;return{x:J.visualViewport.offsetLeft,y:J.visualViewport.offsetTop}}function v1(G,J,K){if(J===void 0)J=!1;if(!K||J&&K!==o(G))return!1;return J}function a(G,J,K,Q){if(J===void 0)J=!1;if(K===void 0)K=!1;let Z=G.getBoundingClientRect(),q=S0(G),U=x(1);if(J)if(Q){if(c(Q))U=e(Q)}else U=e(G);let N=v1(q,K,Q)?V1(q):x(0),V=(Z.left+N.x)/U.x,j=(Z.top+N.y)/U.y,H=Z.width/U.x,W=Z.height/U.y;if(q){let Y=o(q),X=Q&&c(Q)?o(Q):Q,T=Y,B=D0(T);while(B&&Q&&X!==T){let I=e(B),L=B.getBoundingClientRect(),M=f(B),F=L.left+(B.clientLeft+parseFloat(M.paddingLeft))*I.x,z=L.top+(B.clientTop+parseFloat(M.paddingTop))*I.y;V*=I.x,j*=I.y,H*=I.x,W*=I.y,V+=F,j+=z,T=o(B),B=D0(T)}}return s({width:H,height:W,x:V,y:j})}function F0(G,J){let K=N0(G).scrollLeft;if(!J)return a(r(G)).left+K;return J.left+K}function W1(G,J){let K=G.getBoundingClientRect(),Q=K.left+J.scrollLeft-F0(G,K),Z=K.top+J.scrollTop;return{x:Q,y:Z}}function u1(G){let{elements:J,rect:K,offsetParent:Q,strategy:Z}=G,q=Z==="fixed",U=r(Q),N=J?z0(J.floating):!1;if(Q===U||N&&q)return K;let V={scrollLeft:0,scrollTop:0},j=x(1),H=x(0),W=n(Q);if(W||!W&&!q){if(L0(Q)!=="body"||I0(U))V=N0(Q);if(W){let X=a(Q);j=e(Q),H.x=X.x+Q.clientLeft,H.y=X.y+Q.clientTop}}let Y=U&&!W&&!q?W1(U,V):x(0);return{width:K.width*j.x,height:K.height*j.y,x:K.x*j.x-V.scrollLeft*j.x+H.x+Y.x,y:K.y*j.y-V.scrollTop*j.y+H.y+Y.y}}function x1(G){return Array.from(G.getClientRects())}function w1(G){let J=r(G),K=N0(G),Q=G.ownerDocument.body,Z=S(J.scrollWidth,J.clientWidth,Q.scrollWidth,Q.clientWidth),q=S(J.scrollHeight,J.clientHeight,Q.scrollHeight,Q.clientHeight),U=-K.scrollLeft+F0(G),N=-K.scrollTop;if(f(Q).direction==="rtl")U+=S(J.clientWidth,Q.clientWidth)-Z;return{width:Z,height:q,x:U,y:N}}var Z1=25;function g1(G,J){let K=o(G),Q=r(G),Z=K.visualViewport,q=Q.clientWidth,U=Q.clientHeight,N=0,V=0;if(Z){q=Z.width,U=Z.height;let H=y0();if(!H||H&&J==="fixed")N=Z.offsetLeft,V=Z.offsetTop}let j=F0(Q);if(j<=0){let H=Q.ownerDocument,W=H.body,Y=getComputedStyle(W),X=H.compatMode==="CSS1Compat"?parseFloat(Y.marginLeft)+parseFloat(Y.marginRight)||0:0,T=Math.abs(Q.clientWidth-W.clientWidth-X);if(T<=Z1)q-=T}else if(j<=Z1)q+=j;return{width:q,height:U,x:N,y:V}}function p1(G,J){let K=a(G,!0,J==="fixed"),Q=K.top+G.clientTop,Z=K.left+G.clientLeft,q=n(G)?e(G):x(1),U=G.clientWidth*q.x,N=G.clientHeight*q.y,V=Z*q.x,j=Q*q.y;return{width:U,height:N,x:V,y:j}}function q1(G,J,K){let Q;if(J==="viewport")Q=g1(G,K);else if(J==="document")Q=w1(r(G));else if(c(J))Q=p1(J,K);else{let Z=V1(G);Q={x:J.x-Z.x,y:J.y-Z.y,width:J.width,height:J.height}}return s(Q)}function j1(G,J){let K=G0(G);if(K===J||!c(K)||U0(K))return!1;return f(K).position==="fixed"||j1(K,J)}function m1(G,J){let K=J.get(G);if(K)return K;let Q=J0(G,[],!1).filter((N)=>c(N)&&L0(N)!=="body"),Z=null,q=f(G).position==="fixed",U=q?G0(G):G;while(c(U)&&!U0(U)){let N=f(U),V=b0(U);if(!V&&N.position==="fixed")Z=null;if(q?!V&&!Z:!V&&N.position==="static"&&!!Z&&(Z.position==="absolute"||Z.position==="fixed")||I0(U)&&!V&&j1(G,U))Q=Q.filter((H)=>H!==U);else Z=N;U=G0(U)}return J.set(G,Q),Q}function d1(G){let{element:J,boundary:K,rootBoundary:Q,strategy:Z}=G,U=[...K==="clippingAncestors"?z0(J)?[]:m1(J,this._c):[].concat(K),Q],N=q1(J,U[0],Z),V=N.top,j=N.right,H=N.bottom,W=N.left;for(let Y=1;Y<U.length;Y++){let X=q1(J,U[Y],Z);V=S(X.top,V),j=p(X.right,j),H=p(X.bottom,H),W=S(X.left,W)}return{width:j-W,height:H-V,x:W,y:V}}function c1(G){let{width:J,height:K}=X1(G);return{width:J,height:K}}function f1(G,J,K){let Q=n(J),Z=r(J),q=K==="fixed",U=a(G,!0,q,J),N={scrollLeft:0,scrollTop:0},V=x(0);function j(){V.x=F0(Z)}if(Q||!Q&&!q){if(L0(J)!=="body"||I0(Z))N=N0(J);if(Q){let X=a(J,!0,q,J);V.x=X.x+J.clientLeft,V.y=X.y+J.clientTop}else if(Z)j()}if(q&&!Q&&Z)j();let H=Z&&!Q&&!q?W1(Z,N):x(0),W=U.left+N.scrollLeft-V.x-H.x,Y=U.top+N.scrollTop-V.y-H.y;return{x:W,y:Y,width:U.width,height:U.height}}function C0(G){return f(G).position==="static"}function U1(G,J){if(!n(G)||f(G).position==="fixed")return null;if(J)return J(G);let K=G.offsetParent;if(r(G)===K)K=K.ownerDocument.body;return K}function Y1(G,J){let K=o(G);if(z0(G))return K;if(!n(G)){let Z=G0(G);while(Z&&!U0(Z)){if(c(Z)&&!C0(Z))return Z;Z=G0(Z)}return K}let Q=U1(G,J);while(Q&&N1(Q)&&C0(Q))Q=U1(Q,J);if(Q&&U0(Q)&&C0(Q)&&!b0(Q))return K;return Q||H1(G)||K}var r1=async function(G){let J=this.getOffsetParent||Y1,K=this.getDimensions,Q=await K(G.floating);return{reference:f1(G.reference,await J(G.floating),G.strategy),floating:{x:0,y:0,width:Q.width,height:Q.height}}};function l1(G){return f(G).direction==="rtl"}var T1={convertOffsetParentRelativeRectToViewportRelativeRect:u1,getDocumentElement:r,getClippingRect:d1,getOffsetParent:Y1,getElementRects:r1,getClientRects:x1,getDimensions:c1,getScale:e,isElement:c,isRTL:l1};function B1(G,J){return G.x===J.x&&G.y===J.y&&G.width===J.width&&G.height===J.height}function o1(G,J){let K=null,Q,Z=r(G);function q(){var N;clearTimeout(Q),(N=K)==null||N.disconnect(),K=null}function U(N,V){if(N===void 0)N=!1;if(V===void 0)V=1;q();let j=G.getBoundingClientRect(),{left:H,top:W,width:Y,height:X}=j;if(!N)J();if(!Y||!X)return;let T=q0(W),B=q0(Z.clientWidth-(H+Y)),I=q0(Z.clientHeight-(W+X)),L=q0(H),F={rootMargin:-T+"px "+-B+"px "+-I+"px "+-L+"px",threshold:S(0,p(1,V))||1},z=!0;function k(E){let $=E[0].intersectionRatio;if($!==V){if(!z)return U();if(!$)Q=setTimeout(()=>{U(!1,0.0000001)},1000);else U(!1,$)}if($===1&&!B1(j,G.getBoundingClientRect()))U();z=!1}try{K=new IntersectionObserver(k,{...F,root:Z.ownerDocument})}catch(E){K=new IntersectionObserver(k,F)}K.observe(G)}return U(!0),q}function n1(G,J,K,Q){if(Q===void 0)Q={};let{ancestorScroll:Z=!0,ancestorResize:q=!0,elementResize:U=typeof ResizeObserver==="function",layoutShift:N=typeof IntersectionObserver==="function",animationFrame:V=!1}=Q,j=S0(G),H=Z||q?[...j?J0(j):[],...J?J0(J):[]]:[];H.forEach((L)=>{Z&&L.addEventListener("scroll",K,{passive:!0}),q&&L.addEventListener("resize",K)});let W=j&&N?o1(j,K):null,Y=-1,X=null;if(U){if(X=new ResizeObserver((L)=>{let[M]=L;if(M&&M.target===j&&X&&J)X.unobserve(J),cancelAnimationFrame(Y),Y=requestAnimationFrame(()=>{var F;(F=X)==null||F.observe(J)});K()}),j&&!V)X.observe(j);if(J)X.observe(J)}let T,B=V?a(G):null;if(V)I();function I(){let L=a(G);if(B&&!B1(B,L))K();B=L,T=requestAnimationFrame(I)}return K(),()=>{var L;if(H.forEach((M)=>{Z&&M.removeEventListener("scroll",K),q&&M.removeEventListener("resize",K)}),W==null||W(),(L=X)==null||L.disconnect(),X=null,V)cancelAnimationFrame(T)}}var L1=G1;var I1=J1,z1=a0,F1=Q1,M1=t0,O0=s0;var k1=K1,P0=(G,J,K)=>{let Q=new Map,Z={platform:T1,...K},q={...Z.platform,_c:Q};return i0(G,J,{...Z,platform:q})};var C=X0(_0(),1),_1=X0(_0(),1),$1=X0(w0(),1),i1=typeof document<"u",s1=function(){},M0=i1?_1.useLayoutEffect:s1;function k0(G,J){if(G===J)return!0;if(typeof G!==typeof J)return!1;if(typeof G==="function"&&G.toString()===J.toString())return!0;let K,Q,Z;if(G&&J&&typeof G==="object"){if(Array.isArray(G)){if(K=G.length,K!==J.length)return!1;for(Q=K;Q--!==0;)if(!k0(G[Q],J[Q]))return!1;return!0}if(Z=Object.keys(G),K=Z.length,K!==Object.keys(J).length)return!1;for(Q=K;Q--!==0;)if(!{}.hasOwnProperty.call(J,Z[Q]))return!1;for(Q=K;Q--!==0;){let q=Z[Q];if(q==="_owner"&&G.$$typeof)continue;if(!k0(G[q],J[q]))return!1}return!0}return G!==G&&J!==J}function C1(G){if(typeof window>"u")return 1;return(G.ownerDocument.defaultView||window).devicePixelRatio||1}function E1(G,J){let K=C1(G);return Math.round(J*K)/K}function R0(G){let J=C.useRef(G);return M0(()=>{J.current=G}),J}function EG(G){if(G===void 0)G={};let{placement:J="bottom",strategy:K="absolute",middleware:Q=[],platform:Z,elements:{reference:q,floating:U}={},transform:N=!0,whileElementsMounted:V,open:j}=G,[H,W]=C.useState({x:0,y:0,strategy:K,placement:J,middlewareData:{},isPositioned:!1}),[Y,X]=C.useState(Q);if(!k0(Y,Q))X(Q);let[T,B]=C.useState(null),[I,L]=C.useState(null),M=C.useCallback((_)=>{if(_!==E.current)E.current=_,B(_)},[]),F=C.useCallback((_)=>{if(_!==$.current)$.current=_,L(_)},[]),z=q||T,k=U||I,E=C.useRef(null),$=C.useRef(null),O=C.useRef(H),v=V!=null,y=R0(V),u=R0(Z),A=R0(j),P=C.useCallback(()=>{if(!E.current||!$.current)return;let _={placement:J,strategy:K,middleware:Y};if(u.current)_.platform=u.current;P0(E.current,$.current,_).then((h)=>{let l={...h,isPositioned:A.current!==!1};if(D.current&&!k0(O.current,l))O.current=l,$1.flushSync(()=>{W(l)})})},[Y,J,K,u,A]);M0(()=>{if(j===!1&&O.current.isPositioned)O.current.isPositioned=!1,W((_)=>({..._,isPositioned:!1}))},[j]);let D=C.useRef(!1);M0(()=>{return D.current=!0,()=>{D.current=!1}},[]),M0(()=>{if(z)E.current=z;if(k)$.current=k;if(z&&k){if(y.current)return y.current(z,k,P);P()}},[z,k,P,y,v]);let g=C.useMemo(()=>({reference:E,floating:$,setReference:M,setFloating:F}),[M,F]),b=C.useMemo(()=>({reference:z,floating:k}),[z,k]),R=C.useMemo(()=>{let _={position:K,left:0,top:0};if(!b.floating)return _;let h=E1(b.floating,H.x),l=E1(b.floating,H.y);if(N)return{..._,transform:"translate("+h+"px, "+l+"px)",...C1(b.floating)>=1.5&&{willChange:"transform"}};return{position:K,left:h,top:l}},[K,N,b.floating,H.x,H.y]);return C.useMemo(()=>({...H,update:P,refs:g,elements:b,floatingStyles:R}),[H,P,g,b,R])}var a1=(G)=>{function J(K){return{}.hasOwnProperty.call(K,"current")}return{name:"arrow",options:G,fn(K){let{element:Q,padding:Z}=typeof G==="function"?G(K):G;if(Q&&J(Q)){if(Q.current!=null)return O0({element:Q.current,padding:Z}).fn(K);return{}}if(Q)return O0({element:Q,padding:Z}).fn(K);return{}}}},_G=(G,J)=>{let K=L1(G);return{name:K.name,fn:K.fn,options:[G,J]}},$G=(G,J)=>{let K=I1(G);return{name:K.name,fn:K.fn,options:[G,J]}},CG=(G,J)=>{return{fn:k1(G).fn,options:[G,J]}},DG=(G,J)=>{let K=z1(G);return{name:K.name,fn:K.fn,options:[G,J]}},bG=(G,J)=>{let K=F1(G);return{name:K.name,fn:K.fn,options:[G,J]}};var yG=(G,J)=>{let K=M1(G);return{name:K.name,fn:K.fn,options:[G,J]}};var SG=(G,J)=>{let K=a1(G);return{name:K.name,fn:K.fn,options:[G,J]}};
2
+ export{w0 as b,D1 as c,e1 as d,GG as e,Z0 as f,q0 as g,j0 as h,m as i,d as j,i as k,T0 as l,w as m,B0 as n,$0 as o,n1 as p,EG as q,_G as r,$G as s,CG as t,DG as u,bG as v,yG as w,SG as x,QG as y};
package/dist/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>moi</title>
7
7
  <link rel="icon" type="image/png" href="/favicon-nbmyjfjh.png" />
8
8
  <!-- React is vendored locally (client/vendor/react, generated by
9
- scripts/build-vendor.ts) and served by the /vendor/react route, so Moi
9
+ scripts/build-vendor.ts) and served by the /vendor/react route, so moi
10
10
  runs fully offline — no CDN fetch. The server picks the development or
11
11
  production build per environment behind these stable URLs. -->
12
12
  <script type="importmap">
@@ -21,7 +21,7 @@
21
21
  }
22
22
  </script>
23
23
 
24
- <link rel="stylesheet" crossorigin href="/chunk-23cgr1tz.css"><script type="module" crossorigin src="/chunk-kpe40hm8.js"></script></head>
24
+ <link rel="stylesheet" crossorigin href="/chunk-cwqmay73.css"><script type="module" crossorigin src="/chunk-rq0ar7vp.js"></script></head>
25
25
  <body>
26
26
  <div id="root"></div>
27
27
 
@@ -0,0 +1,3 @@
1
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill="#10A37F" d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.073zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.8956zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997z"/>
3
+ </svg>
package/lib/format.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // Display-only conversation format. Agent-agnostic.
2
- // Source: dev/sdk-message-spec.md §14 (and the research PDF under dev/report).
2
+ // Source: server/harness/README.md (format section; formerly claude-code-messages.md §14) (and the research PDF under dev/report).
3
3
  // Built at ingest time from an agent's raw stream (today: Claude Agent SDK).
4
4
 
5
5
  export type ToolCaller = 'model' | 'server-tool' | 'mcp' | 'subagent'
@@ -36,7 +36,7 @@ export type ToolCall = {
36
36
  // for the same canonical action (`read` vs `Read`, `exec` vs `Bash`).
37
37
  // Adapters are responsible for setting it; UI defaults to a generic
38
38
  // rendering when absent.
39
- provider?: 'claude-code' | 'openclaw'
39
+ provider?: 'claude-code' | 'openclaw' | 'codex'
40
40
  mcpServer?: string
41
41
  state: ToolState
42
42
  input: unknown
package/lib/types.ts CHANGED
@@ -20,6 +20,8 @@ export type WidgetInfo = {
20
20
  export type ViewConfig = {
21
21
  // Nav tab label. Falls back to the file name when unset.
22
22
  title?: string
23
+ // App icon registry id used by workspace tabs.
24
+ icon?: string
23
25
  // Advisory env hints, same semantics as WidgetConfig.requiredEnv.
24
26
  requiredEnv?: string[]
25
27
  }
@@ -29,6 +31,35 @@ export type ViewInfo = {
29
31
  config: ViewConfig
30
32
  }
31
33
 
34
+ export type ViewBuilderStatus = 'draft' | 'building' | 'waiting' | 'ready'
35
+
36
+ // The kind of an applet — a custom UI unit embedded in a workspace. Shared by
37
+ // the bundler pipeline and the build-status records. On a builder record the
38
+ // field is absent for rows written before it existed; treat a missing kind as
39
+ // 'view' (only views surface in the UI — the view builder page is view-only).
40
+ export type AppletKind = 'view' | 'widget'
41
+
42
+ export type ViewBuilderInput = {
43
+ requirements: string
44
+ }
45
+
46
+ export type ViewBuilder = {
47
+ id: string
48
+ kind?: AppletKind
49
+ status: ViewBuilderStatus
50
+ input: ViewBuilderInput
51
+ sessionId: string
52
+ viewId?: string
53
+ title?: string
54
+ icon?: string
55
+ error?: string
56
+ // Wall-clock ms when this builder last entered `building`. Used by reconcile
57
+ // to demote a build that has been running too long (a hung/abandoned turn).
58
+ buildingSince?: number
59
+ createdAt: number
60
+ updatedAt: number
61
+ }
62
+
32
63
  // A Scratchpad draw/view operation issued by `moi scratch`. Mutations run
33
64
  // server-side against a headless tldraw store; `view` relays to a live tab. The
34
65
  // server assigns each add op a `name` (the `--id`, or a generated one) so the
@@ -274,7 +305,7 @@ export type WorkspaceSwitchMessage = {
274
305
  workspaceId: string
275
306
  }
276
307
 
277
- export type WorkspaceType = 'claude-code' | 'openclaw' | 'hermes'
308
+ export type WorkspaceType = 'claude-code' | 'openclaw' | 'codex'
278
309
 
279
310
  // One MCP server's connection status, as surfaced by GET /api/workspaces/:id/mcp
280
311
  // (a subset of the agent SDK's McpServerStatus — only what the UI renders).
@@ -352,7 +383,12 @@ export type LayoutGridItem = { i: string; x: number; y: number }
352
383
  // split — Agent chat as a left column, workspace content on the right
353
384
  export type LayoutMode = 'fullscreen' | 'split'
354
385
 
355
- export type WorkspaceTabId = 'agent' | 'widgets' | 'scratchpad' | `view:${string}`
386
+ export type WorkspaceTabId =
387
+ | 'agent'
388
+ | 'widgets'
389
+ | 'scratchpad'
390
+ | `view:${string}`
391
+ | `view-builder:${string}`
356
392
 
357
393
  export type WorkspaceTabsState = {
358
394
  open: WorkspaceTabId[]
@@ -0,0 +1,35 @@
1
+ const VIEW_BUILDER_OPEN = '<moi>'
2
+ const VIEW_BUILDER_CLOSE = '</moi>'
3
+ const VIEW_BUILDER_MARKER = 'View builder request'
4
+
5
+ export function appendViewBuilderMeta(
6
+ requirements: string,
7
+ builderId: string,
8
+ availableIcons: string[]
9
+ ): string {
10
+ const context = [
11
+ VIEW_BUILDER_OPEN,
12
+ VIEW_BUILDER_MARKER,
13
+ `Builder id: ${builderId}`,
14
+ `Available view icons: ${availableIcons.join(', ')}`,
15
+ 'Your first action must be to infer a stable view id, sentence-case title, and relevant icon from the requirements, then run:',
16
+ `moi builder set <view-id> --builder ${builderId} --kind view --title "<title>" --icon <icon-id>`,
17
+ 'Do this before reading files, planning, or writing code. Choose the icon id from the available view icons above.',
18
+ 'Capitalize only the first word of the title.',
19
+ 'Use the same icon id in the view config.',
20
+ 'After building the view, run `moi bundle --only views`.',
21
+ VIEW_BUILDER_CLOSE
22
+ ].join('\n')
23
+ return `${requirements.trim()}\n\n${context}`
24
+ }
25
+
26
+ export function stripViewBuilderMeta(text: string): string {
27
+ const start = text.lastIndexOf(VIEW_BUILDER_OPEN)
28
+ if (start === -1) return text
29
+ const end = text.indexOf(VIEW_BUILDER_CLOSE, start)
30
+ if (end === -1) return text
31
+ if (!text.slice(start, end).includes(VIEW_BUILDER_MARKER)) return text
32
+ const before = text.slice(0, start)
33
+ const after = text.slice(end + VIEW_BUILDER_CLOSE.length)
34
+ return `${before}${after}`.trim()
35
+ }
@@ -0,0 +1,14 @@
1
+ import type { WorkspaceLayout, WorkspaceTabsState } from './types'
2
+
3
+ export function createDefaultWorkspaceTabs(): WorkspaceTabsState {
4
+ return { open: ['agent', 'widgets'], active: 'agent' }
5
+ }
6
+
7
+ export function createDefaultWorkspaceLayout(): WorkspaceLayout {
8
+ return {
9
+ version: 1,
10
+ widgetGrid: [],
11
+ layoutMode: 'fullscreen',
12
+ tabs: createDefaultWorkspaceTabs()
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moi-computer",
3
- "version": "0.3.0-next.2",
3
+ "version": "0.3.0-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",
@@ -78,6 +78,7 @@
78
78
  "motion": "^12.35.1",
79
79
  "pathe": "^2.0.3",
80
80
  "picocolors": "^1.1.1",
81
+ "postcss": "^8.5.19",
81
82
  "react": "^19",
82
83
  "react-dom": "^19",
83
84
  "react-grid-layout": "^2.2.3",
package/server/AGENTS.md CHANGED
@@ -3,7 +3,7 @@ Bun server on port 13337. Serves the client at `/`, upgrades `/ws` to WebSocket.
3
3
  - `web.ts` owns the Bun fullstack surface only: the SPA HTML shell (dev bundler + HMR / prebuilt `dist/`), the two WebSocket channels (`/ws` chat, `/api/workspaces/ws` live events), and graceful shutdown. Every HTTP API request is delegated to the Hono app via `fetch`.
4
4
  - `api.ts` is the Hono REST API (all `/api/*` routes). `withWorkspace` middleware resolves `:id` → workspace (404 if missing) and stashes it on the context, so handlers read `c.get('ws')`. Its catch-all serves the prebuilt client from `dist/` in prod via Hono's `serveStatic` (cached, traversal-safe).
5
5
  - `static.ts` exposes the `dist/` location (`DIST_DIR`), the `prebuilt` flag, and the prod SPA `distShell`. `events.ts` holds `publishEvent` (server→client live-event broadcast over `/api/workspaces/ws`) decoupled from `web.ts` to avoid an import cycle; `web.ts` wires it via `setEventServer`.
6
- - `state.ts` holds global mutable state (messages, session, connected clients). `record()` appends, persists, and broadcasts.
7
- - `agent.ts` sends prompts to Claude via `query()` from the agent SDK. Streams responses back as typed messages. Sessions are resumable.
6
+ - `state.ts` holds the connected chat clients and `broadcast()` (which also feeds the harness debug tap).
7
+ - `harness/` holds every agent backend (Claude Code, OpenClaw, Codex): per-harness adapter + session + transport + protocol NOTES, colocated. Read `harness/README.md` for the message-type layers, the adapter contract, and the folder conventions before touching agent-backend code.
8
8
  - WebSocket protocol: server sends `ServerMessage`, client sends `ClientMessage` — both defined in `lib/types.ts`.
9
- - Agent runs in `workspace/` with bypass permissions. Chat history persisted to `workspace/messages.json`.
9
+ - Agents run in the workspace directory with bypass permissions; each backend persists its own session history (see `harness/README.md`).