agentbox-app 0.1.6 → 0.1.7

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 CHANGED
@@ -1,11 +1,11 @@
1
- # agentbox
1
+ # Agentbox
2
2
 
3
3
  **An inbox for your coding agents.** You file the work, each item gets its own
4
4
  agent in its own thread, and they come back to you with a summary of what they
5
5
  did and what they need. You read, you approve or redirect, you move on.
6
6
 
7
7
  Today the number of agents you can run is limited by how many windows you can
8
- keep track of at once. agentbox drops the chat window entirely and gives your
8
+ keep track of at once. Agentbox drops the chat window entirely and gives your
9
9
  agents an inbox instead, so you can run far more of them than you could ever
10
10
  watch and only deal with one when it actually needs you.
11
11
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "agentbox-app",
3
3
  "productName": "agentbox",
4
- "version": "0.1.6",
4
+ "version": "0.1.7",
5
5
  "description": "An inbox for managing dozens of Claude Code and Codex agents.",
6
6
  "author": "Savannah Feder",
7
7
  "repository": {
@@ -347,7 +347,7 @@ ${t}`}function lne(e,t,n){return e.find(r=>r.slug===n)??t[0]??e[0]??null}functio
347
347
  ${f.body}`))},26);return()=>clearInterval(Qe)},[f==null?void 0:f.title]),w.useEffect(()=>{f!=null&&f.product&&b(f.product)},[f==null?void 0:f.product]),w.useEffect(()=>{const X=SI({text:A,attachments:we,priority:$,when:{runAt:ve.runAt,repeat:ve.repeat},dropped:0});ct(X.dropped)},[A,we,$,ve.runAt,ve.repeat]),w.useEffect(()=>{if(!Ae)return;const X=Ke=>{var Qe;(Qe=Je.current)!=null&&Qe.contains(Ke.target)||We(!1)};return document.addEventListener("pointerdown",X),()=>document.removeEventListener("pointerdown",X)},[Ae]);const be=yne(E,{scripted:!!f}),Ye=async()=>{var En;const X=A.trim();if(!X&&!we.length||!E||be)return;const{title:Ke,body:Qe}=uv(X||`Attached: ${(En=we[0])==null?void 0:En.name}`),Qt=await dI(E.slug,we),Ni=[Qe,Qt].filter(Boolean).join(`
348
348
 
349
349
  `);localStorage.setItem(iw,E.slug),await n({product:E.slug,title:Ke,body:Ni||void 0,kind:"directive",priority:$?zI($):5,...tt?{repeat:tt}:{},...ve.runAt&&!tt?{runAt:ve.runAt}:{},...F==="codex"?OF(F,G,u??null)?{model:G}:{}:{model:G??$0},...j.length>1?{engine:F??Ft}:{},...C?{effort:C}:{}})!==!1&&y9()},rt=X=>Ke=>{if(Ke.button!==0)return;const Qe=Ke.currentTarget,Qt=ee.current;if(!Qt)return;const Ar=[...Qt.querySelectorAll(".compose-product")].map(Bt=>Bt.getBoundingClientRect()),En=Qt.getBoundingClientRect(),Ti={x:Ke.clientX,y:Ke.clientY};let qr=!1,jr=X;Qe.setPointerCapture(Ke.pointerId);const Ai=Bt=>{const Ht=Bt<Ar.length?Ar[Bt]:Ar[Ar.length-1];return{x:(Bt<Ar.length?Ht.left-3:Ht.right+3)-En.left,y:Ht.top-En.top,h:Ht.height}},ji=Bt=>{const Ht=Bt.clientX-Ti.x,pe=Bt.clientY-Ti.y;!qr&&Math.hypot(Ht,pe)<kne||(qr=!0,jr=r3(Ar,Bt.clientX,Bt.clientY),he({from:X,to:jr,dx:Ht,dy:pe,caret:Ai(jr)}))},Ps=()=>{var pe,ft;if(Qe.removeEventListener("pointermove",ji),Qe.removeEventListener("pointerup",Ps),Qe.removeEventListener("pointercancel",Ps),he(null),!qr){const ut=x[X];ut&&N(ut.slug),We(!1),(pe=P.current)==null||pe.focus();return}const Bt=x[X],Ht=jr<x.length?x[jr]:null;if(Bt&&(Ht==null?void 0:Ht.slug)!==Bt.slug){const ut=e.map(Me=>Me.slug).filter(Me=>Me!==Bt.slug),Un=Ht?ut.indexOf(Ht.slug):ut.length;ut.splice(Un<0?ut.length:Un,0,Bt.slug),r(ut)}(ft=P.current)==null||ft.focus()};Qe.addEventListener("pointermove",ji),Qe.addEventListener("pointerup",Ps),Qe.addEventListener("pointercancel",Ps)},Jt=d.jsxs("span",{className:"proj-menu",children:[d.jsx("span",{className:"proj-head",children:"Which project"}),d.jsxs("span",{className:"compose-to",ref:ee,children:[x.map((X,Ke)=>d.jsxs("button",{className:["compose-product",X.slug===(E==null?void 0:E.slug)?"active":"",(se==null?void 0:se.from)===Ke?"dragging":"",p.has(X.slug)?"is-hidden":""].filter(Boolean).join(" "),style:(se==null?void 0:se.from)===Ke?{transform:`translate(${se.dx}px, ${se.dy}px)`}:void 0,onPointerDown:rt(Ke),children:[d.jsxs("span",{className:"chip-grip","aria-hidden":"true",children:[d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{}),d.jsx("i",{})]}),X.name,d.jsx("span",{className:"chip-hide",role:"button","aria-label":p.has(X.slug)?`Show ${X.name}`:`Hide ${X.name}`,title:p.has(X.slug)?"Show in this list":"Hide from this list",onPointerDown:Qe=>Qe.stopPropagation(),onClick:Qe=>{Qe.stopPropagation(),s(X.slug,!p.has(X.slug))},children:p.has(X.slug)?"+":"×"})]},X.slug)),k>0&&d.jsx("button",{className:`compose-reveal ${m?"on":""}`,onClick:()=>y(X=>!X),children:m?"done":`${k} hidden`}),o&&d.jsx("button",{className:"compose-reveal np-chip-new",onClick:o,children:"+ New project"}),(se==null?void 0:se.caret)&&d.jsx("span",{className:"compose-caret",style:{left:se.caret.x,top:se.caret.y,height:se.caret.h}})]})]}),Kr=(!!A.trim()||we.length>0)&&!be,Ls=x.length>1||!!(E!=null&&E.practice),fr={hovered:W,menuOpen:Ae||Se||De||le||me,priorityChanged:$!==re.current.prio,whenSet:!!(ve.runAt||ve.repeat),modelChanged:G!==re.current.model||F!==re.current.engine,effortChanged:J!==re.current.effort,hasProjectClause:Ls};return d.jsx("div",{className:"modal-backdrop compose-backdrop",onClick:h,children:d.jsxs("div",{className:"modal compose",onClick:X=>X.stopPropagation(),children:[d.jsx("textarea",{ref:P,className:"compose-text",value:A,onChange:X=>R(X.target.value),placeholder:"What do you need done?",onKeyDown:X=>{if(X.key==="Escape"&&h(),(X.metaKey||X.ctrlKey)&&X.key==="Enter"&&Ye(),X.key==="Tab"){X.preventDefault();const Ke=ane(x,(E==null?void 0:E.slug)??"",X.shiftKey?-1:1);Ke&&N(Ke.slug)}},onPaste:async X=>{const Ke=await uI(X);Ke.length&&(X.preventDefault(),Oe(Qe=>[...Qe,...Ke]))},onDragOver:X=>X.preventDefault(),onDrop:async X=>{X.preventDefault();const Ke=await pb(X.dataTransfer.files);Ke.length&&Oe(Qe=>[...Qe,...Ke])}}),d.jsx(OI,{attachments:we,onRemove:X=>Oe(Ke=>Ke.filter((Qe,Qt)=>Qt!==X))}),be&&d.jsx("div",{className:"compose-note refuses",children:be}),tt&&d.jsx("div",{className:"compose-note",children:"The first run is now."}),Ct&&"unreadable"in Ct&&d.jsx("div",{className:"compose-note",children:"Not understood, so this runs once, now."}),Ie>0&&d.jsx("div",{className:"compose-note",children:Ie===1?"One pasted image is too big to save. Closing the card loses it.":`${Ie} pasted images are too big to save. Closing the card loses them.`}),d.jsxs("div",{className:["compose-sentence",pne(fr)?"open":"quiet",`rest-${mne(fr)}`].filter(Boolean).join(" "),onPointerEnter:()=>V(!0),onPointerLeave:()=>V(!1),children:[d.jsxs("span",{className:"compose-clauses",children:[Ls&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"clause clause-project",children:["For ",d.jsxs("span",{className:"compose-word-wrap",ref:Je,children:[Ae&&Jt,d.jsxs("button",{type:"button",ref:wt,className:`compose-word ${Ae?"open":""} ${un?"cut":""}`,"aria-haspopup":"dialog","aria-expanded":Ae,onClick:()=>We(X=>!X),title:(E==null?void 0:E.name)??"Which project this is for",children:[(E==null?void 0:E.name)??"a project",d.jsx("span",{className:"compose-word-stop",children:"."})]})]})]})," "]}),d.jsxs("span",{className:"clause clause-priority",children:[d.jsx(HI,{variant:"word",value:$??rc(5),set:!!$,onChange:_,onOpenChange:ye,title:"Priority"})," priority."]})," ",d.jsxs("span",{className:"clause clause-when",children:[d.jsx(sI,{value:ve,onChange:He,onOpenChange:Te}),"."]})," ",j.length>1&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"clause clause-engine",children:["With ",d.jsx(une,{value:F,choices:j,onChange:B,onOpenChange:U}),"."]})," "]}),d.jsxs("span",{className:"clause clause-model",children:["On ",d.jsx(cI,{value:G,onChange:ne,onOpenChange:K,engine:F,codexModels:c??[],codexDefault:u??null,effort:C,onEffortChange:Q}),"."]})]}),d.jsxs("button",{className:"dock-send",onClick:Ye,disabled:!Kr,title:be??"Start it · ⌘↵",children:["Start it ",d.jsx("kbd",{children:"⌘↵"})]})]})]})})}const bne=["Desktop","Documents","Downloads","Movies","Music","Pictures","Library","Public"],vne=["/","/Applications","/Library","/System","/Users","/Volumes","/private","/tmp","/var","/etc","/usr","/bin","/sbin","/opt","/net","/cores"];function _p(e){const t=String(e??"").trim();return t?t.length>1?t.replace(/\/+$/,""):t:""}function Sne(e,t){const n=_p(t);return n?e===n?"":e.startsWith(`${n}/`)?e.slice(n.length+1):null:null}function Cne(e,{home:t=""}={}){const n=_p(e);if(!n)return{ok:!0};const r=n==="~"||n==="~/"?"":n.startsWith("~/")?n.slice(2):Sne(n,t);return r===""?{ok:!1,reason:"home",say:"That is your whole home folder. Agents would work across everything on this Mac, and macOS will ask you about Downloads, Music and every app you have. Pick the folder your project’s code is in."}:r!==null&&bne.includes(r)?{ok:!1,reason:"guarded",say:`${r} holds a lot more than one project, and macOS guards it, so choosing it means a run of permission panels. Pick the folder inside it that your project’s code is in.`}:vne.includes(n)?{ok:!1,reason:"system",say:`${n} is part of macOS rather than one of your projects. Pick the folder your project’s code is in.`}:/^\/Volumes\/[^/]+$/.test(n)?{ok:!1,reason:"volume",say:`${n} is a whole disk rather than one project. Pick the folder your project’s code is in.`}:{ok:!0}}function Ene(e=[],{home:t="~"}={}){const n=new Map;for(const o of e){const i=_p(o);if(!i)continue;const l=i.lastIndexOf("/");if(l<=0)continue;const a=i.slice(0,l);Cne(a,{home:t}).ok&&n.set(a,(n.get(a)??0)+1)}let r=null,s=0;for(const[o,i]of n)(i>s||i===s&&r&&o.length<r.length)&&(r=o,s=i);return r??`${_p(t)||"~"}/dev`}function Nne(e,t){return!t||!e.startsWith(t)?e:e===t?"~":`~${e.slice(t.length)}`}function dP({startIn:e,onPick:t,onClose:n}){const[r,s]=w.useState(null),[o,i]=w.useState(""),[l,a]=w.useState(!0),c=w.useRef(0),u=w.useCallback(async y=>{const x=++c.current;a(!0);const k=await q.listFolders(y);x===c.current&&(s(k),i(k.at),a(!1))},[]);w.useEffect(()=>{u(e??null)},[u,e]);const f=(r==null?void 0:r.at)??"",h=(r==null?void 0:r.home)??"",p=!!f&&!(r!=null&&r.refused)&&!(r!=null&&r.unreadable),m=()=>{p&&t(f)};return d.jsx("div",{className:"modal-backdrop fp-backdrop",onClick:n,children:d.jsxs("div",{className:"modal fp-card",onClick:y=>y.stopPropagation(),role:"dialog","aria-label":"Choose a folder",onKeyDown:y=>{y.key==="Escape"&&(y.stopPropagation(),n()),(y.metaKey||y.ctrlKey)&&y.key==="Enter"&&m()},children:[d.jsxs("div",{className:"fp-head",children:[d.jsx("button",{className:"fp-up",onClick:()=>(r==null?void 0:r.parent)&&u(r.parent),disabled:!(r!=null&&r.parent)||l,title:"Up one folder",children:"Up"}),d.jsx("div",{className:"fp-field",children:d.jsx("input",{className:"fp-path",value:o,spellCheck:!1,onChange:y=>i(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),u(o))},"aria-label":"Folder path"})})]}),d.jsxs("div",{className:"fp-list",role:"listbox","aria-busy":l,children:[(r==null?void 0:r.unreadable)&&d.jsx("p",{className:"fp-note",children:r.unreadable}),r&&!r.unreadable&&r.folders.length===0&&d.jsx("p",{className:"fp-note",children:"No folders in here."}),r==null?void 0:r.folders.map(y=>d.jsx("button",{className:"fp-row",onClick:()=>void u(y.path),onDoubleClick:()=>t(y.path),children:y.name},y.path))]}),(r==null?void 0:r.refused)&&d.jsx("p",{className:"fp-refused",children:r.refused}),d.jsxs("div",{className:"fp-foot",children:[d.jsx("span",{className:"fp-where",children:f?Nne(f,h):""}),d.jsx("button",{className:"fp-cancel",onClick:n,children:"Cancel"}),d.jsx("button",{className:"fp-use",onClick:m,disabled:!p,children:"Use this folder"})]})]})})}function Tne(e,t="~/dev"){const n=Ane(e);return n?`${t.replace(/\/+$/,"")}/${n}`:null}function Ane(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40)}function jne(e){return e.replace(/^\/Users\/[^/]+/,"~")}function Mne({onCreate:e,onClose:t,parent:n="~/dev"}){const[r,s]=w.useState(""),[o,i]=w.useState(null),[l,a]=w.useState(!1),[c,u]=w.useState(!1),[f,h]=w.useState(!1),[p,m]=w.useState(null),[y,x]=w.useState(!1),k=w.useRef(null);w.useEffect(()=>{var A;return(A=k.current)==null?void 0:A.focus()},[]);const v=l?null:o??Tne(r,n);w.useEffect(()=>{if(!v){u(!1);return}if(o){u(!0);return}let A=!0;const R=setTimeout(()=>{q.folderExists(v).then($=>{A&&u($)})},160);return()=>{A=!1,clearTimeout(R)}},[v,o]);const b=w.useMemo(()=>v?d.jsxs(d.Fragment,{children:["Its code is in ",d.jsx("span",{className:"np-word",children:jne(v)}),c?".":", a new folder."]}):d.jsxs(d.Fragment,{children:["Its code is in ",d.jsx("span",{className:"np-word",children:"a folder you choose"}),"."]}),[v,c]),E=A=>{m(null),i(A),a(!1),x(!1)},N=async()=>{const{path:A,refused:R,browse:$}=await q.chooseFolder(o??void 0);if($){x(!0);return}if(R){m(R);return}A&&E(A)},T=()=>{!r.trim()||f||(h(!0),Promise.resolve(e({name:r.trim(),repoPath:v})).finally(()=>h(!1)))};return y?d.jsx(dP,{startIn:o??v,onPick:E,onClose:()=>x(!1)}):d.jsx("div",{className:"modal-backdrop compose-backdrop",onClick:t,children:d.jsxs("div",{className:"modal compose np-card",onClick:A=>A.stopPropagation(),children:[d.jsx("input",{ref:k,className:"np-name",value:r,onChange:A=>{s(A.target.value),a(!1),m(null)},placeholder:"What is the project called?",onKeyDown:A=>{A.key==="Escape"&&t(),(A.metaKey||A.ctrlKey)&&A.key==="Enter"&&T(),A.key==="Enter"&&!A.metaKey&&!A.ctrlKey&&(A.preventDefault(),T())}}),d.jsxs("div",{className:"np-sentence",children:[d.jsx("button",{type:"button",className:"np-clauses",onClick:N,title:"Choose the folder",onKeyDown:A=>{(A.key==="Backspace"||A.key==="Delete")&&(A.preventDefault(),i(null),a(!0))},children:b}),d.jsxs("button",{className:"dock-send",disabled:!r.trim()||f,onClick:T,children:["Make it ",d.jsx("kbd",{children:"⌘↵"})]})]}),p&&d.jsx("p",{className:"np-refused",children:p})]})})}const Dx="Practice",Rne="practice",dv={title:"Add a sign-out button to the Practice app.",body:`Practice is a pretend project, not your code and not ${Le}. This one is written for you already.`},Qa=[{kind:"task",title:"Added the sign-in route. Tests green.",body:"Add a sign-in route at /sign-in. Reuse whatever we already have for sessions.",trace:["Reading how auth works here before I touch anything.","[Read] src/server/auth.ts","[Read] src/server/routes.ts","[Grep] createSession","There is already a signed session cookie in here, seven days, refreshed on use. I will reuse it rather than adding tokens, because two ways to be signed in is the bug that follows.","[Write] src/server/routes/sign-in.ts","[Edit] src/server/routes.ts","[Edit] src/server/auth.ts","[Bash] npm test -- auth","Fourteen tests, all green, and nothing else in the suite moved."],result:"I reused the session cookie rather than tokens. Say if you disagree.",agoMs:6*6e4},{kind:"task",title:"Fixed the flaky checkout test.",body:"checkout.spec.ts fails about one run in five on CI and passes every time on my Mac. Find out why.",trace:["[Bash] npx vitest run checkout.spec.ts --repeat 20","Three failures in twenty, every one of them on the same assertion, so it is a race and not the assertion.","[Read] tests/checkout.spec.ts","[Read] tests/fixtures/cart.ts","The fixture writes the cart and returns before the write lands. The test reads it straight away, so on a slow machine it reads an empty cart.","[Edit] tests/fixtures/cart.ts","[Bash] npx vitest run checkout.spec.ts --repeat 40","Forty for forty. I changed the fixture and nothing in the test itself."],result:"It was a race on the fixture. It awaits now. Nothing else changed.",agoMs:14*6e4},{kind:"task",later:!0,title:"The check runs are 40 seconds slower than Monday.",body:"CI got slower this week and nobody changed the workflow. Find out what did it.",trace:["[Bash] gh run list --limit 40 --json databaseId,createdAt,conclusion","Monday it was 2m14s and today it is 2m54s, and the step that grew is the type check rather than the tests.","[Read] .github/workflows/ci.yml","[Read] tsconfig.json","[Bash] npx tsc --noEmit --extendedDiagnostics","The type check now runs over every package instead of the ones that changed, because the project references came out of tsconfig in the pnpm move.","Putting them back means splitting the config per package and re-pointing the workflow. It is about half a day and nothing is broken while it waits."],result:"It is the type check running over every package. The fix is half a day of config, and nothing breaks while it waits.",agoMs:22*6e4},{kind:"question",waiting:!0,title:"Delete 340 lines of dead code?",body:"Have a look for anything in src/ that nothing imports.",trace:["[Bash] npx knip --include files,exports","[Read] src/lib/legacy-client.ts","[Grep] legacy-client","[Read] src/lib/format-old.ts","[Grep] formatOld","Three files, 340 lines. Nothing in src/ imports any of them and nothing in tests/ does either.","The legacy client is the one I would ask about: it is the only thing left that speaks to the v1 API, so if anything outside this repository still calls that, deleting it is the end of it."],result:["Nothing imports any of the three, so this is safe on my side, but the legacy client is the last thing that speaks v1 and I would rather you said so.","","## Options","1. Delete all three (recommended)","2. Keep the legacy client, delete the other two","3. Leave all of it alone"].join(`
350
- `),agoMs:31*6e4}],Ma={step:"welcome",folder:null,name:"",product:null,practice:null,item:null,sentAt:null,examples:[]};function One(e){return{...Ma,tutorial:!0,step:"hand",product:e}}function Ine(e){return e!=null&&e.tutorial?"end":"done"}function Dne(e,t){switch(t.t){case"start":return e.step==="welcome"?{...e,step:"folder"}:e;case"folder":return{...e,folder:t.path,name:!e.name||e.folder&&e.name===tA(e.folder)?tA(t.path):e.name};case"name":return{...e,name:t.name};case"made":return{...e,product:t.product,step:"inbox"};case"practice":return{...e,practice:t.product,examples:t.examples,step:"make"};case"sent":return{...e,item:t.item,sentAt:t.at,step:"working"};case"answered":return e.step==="working"?{...e,step:"open"}:e;case"staged":return{...e,examples:t.examples,step:"clear"};case"finish":return{...e,step:"landed"}}}function Vs(e,t){return{...e,step:t}}function Lne(e){return e==="folder"?"welcome":e==="name"?"folder":null}function tA(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[-_.]+/g," ").trim().replace(/\s+/g," ").split(" ").map(n=>n&&n[0].toUpperCase()+n.slice(1)).join(" ")}function Pne(e,{home:t="",max:n=6}={}){const r=new Map,s=t.replace(/\/+$/,"");for(const o of e){const i=String(o.folder??"").replace(/\/+$/,"");if(!i||i===s||i==="/")continue;const l=o.source==="codex"?"codex":"claude",a=r.get(i);if(a){a.when=Math.max(a.when,o.when??0),a.via.includes(l)||a.via.push(l);continue}r.set(i,{folder:i,name:i.split("/").pop()??i,short:o.short||fP(i,t),when:o.when??0,via:[l]})}return[...r.values()].sort((o,i)=>i.when-o.when).slice(0,n)}function fP(e,t){const n=(t??"").replace(/\/+$/,"");return n&&e.startsWith(n+"/")?"~"+e.slice(n.length):e}function nA(e){return e.forced?!0:!e.done&&e.products===0}const $ne=dv.title,zne=dv.body,_ne=15e3,Fne="first-run",Bne=2e3;function rA(e,t){if(!t||t.step==="landed")return e;if(t.step==="done")return[];if(t.step==="clear"||t.step==="snooze"||t.step==="unblock"){const n=new Set(t.examples);return e.filter(r=>n.has(r.id))}if(t.step==="where"){const n=new Set([...t.examples,t.item].filter(Boolean));return e.filter(r=>n.has(r.id))}return e.filter(n=>n.id===t.item)}function Hne(e){return e.findIndex(t=>t.waiting)}function Wne(e){return e.findIndex(t=>t.later)}function Une(e,t,n,r){if(!t||!t.examples.length)return!1;const s=new Set(e.map(o=>o.id));return!t.examples.some((o,i)=>i!==n&&i!==r&&s.has(o))}function Vne(e,t,n,r){if(!t)return[];const s=new Set(e.map(o=>o.id));return t.examples.filter((o,i)=>i!==n&&i!==r&&s.has(o))}function Bm(e,t){return!e||t<0?null:e.examples[t]??null}function Kne(e,t,n){const r=Bm(t,n);return r?!e.some(s=>s.id===r):!1}function Hm(e,t){return!e||t<0?null:e.examples[t]??null}const hP="That one is an agent stopped, waiting on you. Open it and answer it.";function lw(e,t,n,r){return!e||e.step==="landed"?null:t===Hm(e,n)?hP:t===Bm(e,r)?"That one is not finished. Press S to deal with it later.":null}function qne(e,t,n){return!e||e.step==="landed"?null:t===Hm(e,n)?hP:null}function Yne(e,t,n,r,s,o={}){if(!t)return[];const i=new Set(n.map(a=>a.id)),l=a=>a&&i.has(a)?[a]:[];return e==="clear"?Vne(n,t,r,s):e==="snooze"?o.picking?[]:l(Bm(t,s)):e==="unblock"?o.opened?[]:l(Hm(t,r)):[]}function Gne(e,t){return!e.length||!t?!1:!e.includes(t)}function Jne(e,t){if(!t||!t.examples.length)return!1;const n=new Set(e.map(r=>r.id));return!t.examples.some(r=>n.has(r))}const Ee={head:"Run dozens of coding agents from one inbox.",headSub:"Works with Claude Code and Codex.",terms:"Get started means you agree to the terms and the privacy policy.",getStarted:"Get started",page:"Set up your first project.",folderQ:"Where is your code?",folderPick:"Choose a folder on this Mac",folderClause:"This is the folder the agents will run in.",folderAgain:"Choose a different one",folderHead:"Which project should your agents work on first?",folderLede:"Pick its folder. Your agents run inside it.",folderRecent:"Where you have run agents recently",folderOther:"Choose another folder",folderFirst:"Choose a folder",folderVia:{claude:"Claude Code",codex:"Codex"},nameIn:"Agents will work in",nameChange:"Change",nameGo:"Continue",missing:`${Pn} could not find Claude Code on this Mac, and your agents run on it.`,missingLink:"Get Claude Code",nameQ:"What is this project called?",nameClause:"Taken from the folder. Change it to anything you like.",next:"Next",takenName:e=>`You already have a project called ${e}. Give this one another name.`,emptyName:"A project needs a name with letters or numbers in it.",notMade:e=>`${Pn} could not make the project. ${e}`,submit:"Submit",back:"Back",lookQ:`Pick how ${Le} looks.`,lookMore:"Randomize my theme",lookClause:"Press ⌘K and type theme to change it later.",lookGo:"Next",intro:[{head:"All your Claude Code and Codex agents report to one inbox",line:"Each agent writes back here the moment it finishes or gets stuck",piece:"list"},{head:"You only see an agent when it needs you",line:"The rest keep working in In progress until they finish or have a question",piece:"progress"},{head:"So one person can run dozens of agents at once",line:"No terminals to watch and no tabs to check",piece:"empty"}],pieceEmpty:"Nothing is waiting on you.",pieceAgents:"Active agents",introOn:(e,t)=>`${e} of ${t}`,introNext:"Next",handHead:"This is the tutorial.",handLine:"Nothing in here is your code and nothing you do in here is saved. Your own project is made already and it is waiting behind this.",handGo:"Start the tutorial",leave:"Skip",leaveHead:"Stay for the walk?",leaveLine:`It is the quickest way to pick up the few keys ${Le} runs on, and it is the only place they are shown to you. You can leave now and start it again whenever you like from ⌘K.`,leaveStay:"Keep going",leaveGo:"Skip it",offerHead:"Take the tutorial first?",offerLine:`A pretend project with pretend work in it, and the few keys ${Le} runs on. Nothing in it is your code and nothing in it is kept.`,offerGo:"Start the tutorial",offerNot:"Not now",offerLater:"Any time: press ⌘K and type tutorial.",bandTag:"Tutorial",band:"Nothing in here is yours and nothing is saved.",bandLine:"nothing in here is real",bringHead:"Add the agents already on this Mac.",agentsOffer:`${Pn} watches them and puts what they send you in your inbox.`,agentsFrom:e=>`Read from ${e}`,agentsAll:"Every project",agentsHere:"Only this project",agentsNoneAll:"No agents in your home folder yet. Anything you put there works in every project.",agentsNoneHere:"No agents in this project folder yet. Anything you put there works here only.",agentsRead:`Each one you keep lands in your inbox. ${Pn} never moves the file.`,finishHead:"You are ready to get started.",finishLine:"Your inbox is empty and no agent is waiting on you.",finishLineAgents:"Getting your inbox back to empty is the goal.",finishGo:"Open my inbox",gateHead:`${Pn} needs Claude Code.`,gateDo:`Install it, then check again. Your inbox opens as soon as ${Le} can see it.`,gateCheck:"Check again",gateChecking:"Looking",gateStill:"Still nothing here. A fresh install can take a moment to appear."};function Qne(e,t){return e.missing?{show:!0,blocked:!0,go:!1,head:Ee.gateHead,line:Ee.missing}:t.read?{show:!0,blocked:!1,go:!0,head:Ee.bringHead,line:Ee.agentsOffer}:{show:!1,blocked:!1,go:!1,head:"",line:""}}function sA(e){return!e.missing}const pn=(e,t,n=null,r="",s={})=>({quiet:e,lead:t,key:n,tail:r,...s}),Xne=["inbox","progress","done"];function Lx(e,t){const n=e!=null&&e.length?e:Xne;return n[(n.indexOf(t??"inbox")+1)%n.length]}const Zne={inbox:" to come back.",snoozed:" for the one you put off.",progress:" for the agent you answered.",done:" for everything you closed."};function pP(e,t,n={}){switch(e){case"make":return pn("A task is a job you hand to an agent.","Press ","N"," to write your first one.");case"task":return pn("","Press ","⌘↵"," to start it.");case"working":return t>=_ne?pn("Your agent is running.","Still reading. A bigger project takes longer than this one, and the answer will be here when it comes."):pn("Your agent is running.","It comes back in a few seconds.");case"open":return pn("Your agent worked on its own, and this row is what it sent back.","Press ","↵"," to open it.");case"answer":return pn("Every task ends one of two ways.","Reply to it, or press ","E"," to close it.");case"clear":return pn(n.left===1?"This one is finished too.":"This one is finished. Z brings back anything you close.","Press ","E"," to close it.",{caps:2});case"snooze":return n.picking?pn("Pick when it should come back.","It leaves your inbox until then and comes back on its own."):pn("Real work, but not for today. An empty inbox is the goal.","Press ","S"," to deal with it later.");case"unblock":return n.opened?pn("Your agent gave you three answers to pick from.","Press ","1"," to send the one it recommends."):pn("An agent is stopped here. Closing it leaves it stopped for good.","Press ","↵"," to open it.");case"where":{const r=tre(n.tabs??[],Lx(n.tabs,n.view)),s=Zne[Lx(n.tabs,n.view)]??" for the next one.";return n.view==="snoozed"?pn("The one you put off is here, and it comes back on its own.","Press ",r,s):n.view==="progress"?pn("The agent you answered is here, working without you.","Press ",r,s):n.view==="done"?pn("Everything you finished is kept here.","Press ",r,s):pn("Great! Your inbox is now empty. That is inbox zero, and it is the goal.","Press ",r," to see where it all went.")}case"command":return n.palette?pn(`Every command in ${Le} is in this list.`,"Press ","esc"," to close it."):pn("Everything you just did is one key away. So is this: type tutorial.","Press ","⌘K"," then make your first real task.");default:return null}}const oA=4e3;function Fp(e){const t=e.key??"";if(e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&/^[1-4]$/.test(t))return`⌘${t}`;const n=!!e.metaKey||!!e.ctrlKey;return n&&t==="Enter"?"⌘↵":n&&t.toLowerCase()==="k"?"⌘K":n?null:t==="Enter"?"↵":t==="Tab"?"⇥":t.length===1&&/[a-z0-9]/i.test(t)?t.toUpperCase():null}const ere={"⇥":"Tab","⌘1":"Command–1","⌘2":"Command–2","⌘3":"Command–3","⌘4":"Command–4","↵":"Return"};function tre(e,t){const n=e.indexOf(t);return n>=0&&n<4?`⌘${n+1}`:"⌘1"}function nre(e){return e?ere[e]??null:null}function mP(e,t){if(!e)return!1;const n=Fp(t);return n!==null&&n!==e}const rre='input, textarea, [contenteditable="true"], [contenteditable=""], .fr-stay-scrim';function Bp(e){const t=e;return!t||typeof t.closest!="function"?!0:!t.closest(rre)}const sre="⇥";function ore(e,t,n){return!Bp(n)||!mP(e,t)?!1:Fp(t)!==sre}const ire=".fr-tether, .fr-ring, .fr-veil, .fr-band, .fr-out",lre={unblock:[".focus-dock"]};function are(e,t){const n=e;if(!n||typeof n.closest!="function"||!Bp(n)||n.closest(ire))return!1;const r=t.filter(s=>!!s);return r.length?!r.some(s=>s===n||typeof s.contains=="function"&&s.contains(n)):!1}const iA=["pointerdown","mousedown","mouseup","click","dblclick"],gP=["make","task","working","open","answer","clear","snooze","unblock","where","command"],Ql={make:['button[aria-label="New task"]'],task:[".modal.compose .dock-send"],working:[".list-pane .row"],open:[".list-pane .row"],answer:[".focus-dock .dock-card",".focus-dock"],clear:[".list-pane .row"],snooze:[".modal.snooze .palette-list",".list-pane .row"],unblock:[".opt-strip",".list-pane .row"],where:[".workspace-navigation .workspace-tabs",".tabs"],command:[".modal.palette",'button[aria-label="Commands"]']},lA={clear:".list-pane .row:last-of-type",snooze:".list-pane .row:last-of-type"};function cre(e,t){const n=t.filter(o=>o.w>0&&o.h>0&&o.position!=="absolute"&&o.position!=="fixed");if(!n.length)return e;const r=Math.min(...n.map(o=>o.x)),s=Math.min(...n.map(o=>o.y));return{x:r,y:s,w:Math.max(...n.map(o=>o.x+o.w))-r,h:Math.max(...n.map(o=>o.y+o.h))-s}}const yP=6,ure=14,dre=.34;function wP(e){const t=Math.min(e.w,e.h);return Math.max(yP,Math.min(ure,Math.round(t*dre)))}function fre(e,t){let n=1/0;for(const r of t){const s=Math.max(e.x-(r.x+r.w),r.x-(e.x+e.w)),o=Math.max(e.y-(r.y+r.h),r.y-(e.y+e.h)),i=Math.max(s,o);i<0||(n=Math.min(n,i/2))}return n}const hre=12,pre=6,mre=.26;function gre(e){const t=Math.min(e.w,e.h);return Math.max(pre,Math.min(hre,Math.round(t*mre)))}const Hp=18,yre=360,wre=180,kre=220,Wp=22;function xre(e,t,n,r=1/0){const s=Math.max(yP,Math.min(wP(e),Math.floor(r))),o=Math.round(e.x-s),i=Math.round(e.y-s),l=Math.round(e.w+s*2),a=Math.round(e.h+s*2),c=e.x+e.w>n.w-kre,u=Math.round(e.x),f=Math.min(t.right,n.w),h=c?e.x+e.w:f-u-32,p=Math.max(wre,Math.min(yre,h)),m=i+a+Hp,y=m+Wp*2+16<=n.h,x=y?m:Math.round(i-Hp-Wp);return{ring:{x:o,y:i,w:l,h:a,r:gre({w:l,h:a})},text:{x:u,y:x,w:p,right:c?Math.round(n.w-(e.x+e.w)):null},below:y}}function bre(e,t,n,r){const s=n.filter(i=>i.bottom>e&&i.top<e+t);if(!s.length)return e;const o=Math.round(Math.max(...s.map(i=>i.bottom))+10);return o+t>r.h?e:o}const vre={task:"body",working:".list-pane",open:".list-pane",clear:".list-pane",snooze:".list-pane",answer:".focus-pane"},Up=10,Sre=".list-pane .row, .dock-card, .modal, .focus-actions",Wm="zero.firstRun",fv="zero.firstRun.done";function Cre(e,t){return typeof e=="string"&&fl.includes(e)?e:e==="note"?"clear":t?"landed":"welcome"}function Ere(e){try{const t=e.getItem(Wm);if(!t)return Ma;const n=JSON.parse(t);return{...Ma,...n,step:Cre(n.step,!!n.product)}}catch{return Ma}}function Nre(e,t){try{e.setItem(Wm,JSON.stringify(t))}catch{}}function Tre(e){try{e.setItem(fv,"1"),e.removeItem(Wm)}catch{}}function aA(e){try{return e.getItem(fv)==="1"}catch{return!1}}function Are(e){try{e.removeItem(fv),e.removeItem(Wm)}catch{}}const fl=["welcome","folder","name","inbox","away","goal","look","hand","make","task","working","open","answer","clear","snooze","unblock","where","command","done","landed"];function jre(e){const t=fl.indexOf(e);return t<0||t+1>=fl.length?null:fl[t+1]}function Mre(e){const t=fl.indexOf(e),n=fl.indexOf("look");return t>=0&&n>=0&&t<n}const Rre={inbox:0,away:1,goal:2},Ore=["make","task","working","open","answer","clear","snooze","unblock","where","command"];function hv(e){return!!e&&!!e.practice&&Ore.includes(e.step)}function Ire(e){return e?e==="1"?"welcome":fl.includes(e)?e:null:null}function Um(e){return e.user.length+e.project.length>0}function Dre(e){return!e||!Um(e)}function Lre(e,t){return t||e&&Um(e)?e:null}function Pre(e,t){return!e||Um(t)}function $re(e,t){return t||e&&e.some(n=>n.count>0)?e:null}function cA(e,t){const n=String(e??"").trim();if(/already exists/i.test(n))return Ee.takenName(t);if(/needs a name/i.test(n))return Ee.emptyName;const r=n.replace(/^Error invoking remote method '[^']*':\s*/i,"").replace(/^Error:\s*/i,"");return Ee.notMade(r?/[.!?]$/.test(r)?r:`${r}.`:"It did not say why.")}function uA(e,{filter:t=null,last:n=null}={}){var s;const r=o=>!!o&&e.some(i=>i.slug===o);return r(t)?t:r(n)?n:((s=e[0])==null?void 0:s.slug)??null}function kP(e,t){var n;return((n=e.find(r=>r.slug===t))==null?void 0:n.repoPath)??null}function Px(e,t){var n;return((n=e.find(r=>r.slug===t))==null?void 0:n.name)??""}function zre(e){return(e??"").replace(/^\/Users\/[^/]+/,"~")}const _re=["no","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"],es=e=>e>=0&&e<=10?_re[e]:String(e),ks={head:"Add the agents already on this Mac.",noProject:"Make a project first, and your agents can land in its inbox.",newProject:"New project…",headNone:"No agents to bring across yet.",noneWhere:e=>`Nothing in ${e}, and nothing in any folder you work in.`,noneLater:"When you have some, press ⌘K and type import.",lookAgain:"Look again",looking:"Looking",foot:"Each one you keep lands in your inbox, and your agent files stay where they are.",go:"Add them",reading:"Reading this Mac…"};function go(e){return[...e.items.map(t=>t.path),...(e.threads??[]).map(t=>t.path)]}function Vm(e,t){const n=t?new Set(t):null;let r=0,s=0;for(const o of e)r+=o.items.filter(i=>!n||n.has(i.path)).length,s+=(o.threads??[]).filter(i=>!n||n.has(i.path)).length;return{agents:r,threads:s}}function pv({agents:e,threads:t}){const n=(r,s)=>`${es(r).toLowerCase()} ${s}${r===1?"":"s"}`;return e&&t?`${n(e,"agent")} and ${n(t,"thread")}`:t?n(t,"thread"):n(e,"agent")}function Fre({found:e,folders:t=[],products:n=[],project:r=null,threads:s=[]}){const o=[],i=Px(n,r),l=kP(n,r);e!=null&&e.user.length&&o.push({key:"everywhere",kind:"everywhere",name:i,slug:r,folder:null,where:Js.homeFolder,items:e.user,threads:[]}),e!=null&&e.project.length&&r&&o.push({key:`project:${r}`,kind:"project",name:i,slug:r,folder:l,where:zre(l),items:e.project,threads:[]});const a=n.map(f=>f.name);for(const f of Hre(t,n)){const h=hA(f,a);a.push(h),o.push({key:`new:${f.folder}`,kind:"new",name:h,slug:null,folder:f.folder,where:f.short,items:f.agents??[],threads:[]})}const c=new Map(o.filter(f=>f.folder).map(f=>[aw(f.folder),f])),u=new Map(n.filter(f=>f.repoPath).map(f=>[aw(f.repoPath),f]));for(const f of s){const h=aw(f.folder);if(!h)continue;let p=c.get(h);if(!p){const m=u.get(h),y=m?{key:`project:${m.slug}`,kind:"project",name:m.name,slug:m.slug,folder:f.folder,where:f.short,items:[],threads:[]}:{key:`new:${f.folder}`,kind:"new",name:hA({name:f.folderName},a),slug:null,folder:f.folder,where:f.short,items:[],threads:[]};m||a.push(y.name),o.push(y),c.set(h,y),p=y}p.threads.push(f)}return o}const aw=e=>String(e??"").replace(/\/+$/,""),Js={everywhere:"Every project",homeFolder:"~/.claude/agents",landBefore:"They work everywhere, so their rows go to",landAfter:".",landNowhere:"They work everywhere. Make a project and they have an inbox.",newBadge:"New project",n:e=>String(e.length)};function dA({added:e=0,already:t=0,name:n="",inboxes:r=1,made:s=[],noun:o="agent"}){if(e===0&&t===0)return"Nothing was ticked, so nothing was filed.";const i=r>1,l=n?` ${n}`:"";if(e===0)return i?t===1?`That ${o} already has a row.`:`${es(t)} of them already have rows.`:t===1?`That ${o} already has a row in${l}.`:`${es(t)} of them already have rows in${l}.`;const a=e===1?"One row is":`${es(e)} rows are`,c=i?`${a} in ${es(r).toLowerCase()} inboxes.`:`${a} in your ${s.length===1?"new ":""}${n} inbox.`,u=i&&s.length?s.length===1?` ${s[0]} is new.`:` ${es(s.length)} of them are new.`:"";if(t===0)return`${c}${u}`;const f=t===1?" One already had one.":` ${es(t)} already had rows.`;return`${c}${f}${u}`}function Bre({read:e,picked:t,dests:n}){if(!e||t.length===0)return!1;const r=new Set(t);for(const s of n)if(go(s).some(o=>r.has(o))&&s.kind!=="new"&&!s.slug)return!1;return!0}function fA(e,t,n){const r=new Set(t);return r.has(n)?r.delete(n):r.add(n),e.flatMap(go).filter(s=>r.has(s))}function hA(e,t=[]){const n=((e==null?void 0:e.name)??"").trim();if(!n)return"";const r=/[A-Z\s]/.test(n)?n:n.replace(/[-_.]+/g," ").split(" ").filter(Boolean).map(o=>o.replace(/^\w/,i=>i.toUpperCase())).join(" "),s=new Set(t.map(cw));if(!s.has(cw(r)))return r;for(let o=2;o<100;o+=1)if(!s.has(cw(`${r} ${o}`)))return`${r} ${o}`;return r}function cw(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40)}function Hre(e,t){const n=new Set(t.map(r=>(r.repoPath??"").replace(/\/+$/,"")).filter(Boolean));return e.filter(r=>!n.has(r.folder.replace(/\/+$/,"")))}const Mf={pick:"Choose which ones",pickWhy:"Pick a whole project, or single agents inside it.",never:`${Pn} never moves your agent files.`};function Wre(e){const t=Vm(e);return t.agents+t.threads===1?`Add the one ${t.threads?"thread":"agent"}`:`Add all ${pv(t)}`}function Ure(e,t){const n=go(e);if(n.length===0)return"none";const r=new Set(t),s=n.filter(o=>r.has(o)).length;return s===0?"none":s===n.length?"all":"some"}function Vre(e,t,n){const r=e.find(l=>l.key===n);if(!r)return t;const s=new Set(t),o=go(r),i=o.some(l=>s.has(l));for(const l of o)i?s.delete(l):s.add(l);return e.flatMap(go).filter(l=>s.has(l))}function pA(e){return e.flatMap(go)}function Kre(e){const t=Vm(e),n=e.length;if(t.agents+t.threads===0)return"";const r=pv(t),s=`${es(n).toLowerCase()} folder${n===1?"":"s"}`;return`${r[0].toUpperCase()}${r.slice(1)} in ${s}.`}function qre(e,t){return t.length===0?"Nothing ticked":`Add ${pv(Vm(e,t))}`}function Yre(e,t){const n=new Set(t);return e.filter(r=>r.kind==="new"&&go(r).some(s=>n.has(s))).map(r=>r.name)}function mA(e,t){const n=new Set(t),r=e.filter(l=>go(l).some(a=>n.has(a))).length,s=Yre(e,t);if(r===0)return"";const o=r===1?"":`${Pn} files them under ${es(r).toLowerCase()} projects.`,i=s.length===0?"":s.length===1?`${s[0]} becomes a new project.`:`${es(s.length)} of them become new projects.`;return[o,i].filter(Boolean).join(" ")}function Gre(e,t=Date.now()){const n=new Date(Number(e)||0);if(!Number.isFinite(n.getTime())||!e)return"";const r=o=>new Date(o.getFullYear(),o.getMonth(),o.getDate()).getTime(),s=Math.round((r(new Date(t))-r(n))/864e5);return s<=0?"today":s===1?"yesterday":s<7?`on ${n.toLocaleDateString("en-US",{weekday:"long"})}`:""}function Jre(e){return e==="codex"?"in Codex":e==="desktop"?"in the Claude Code desktop app":"in a terminal"}function Qre(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M4 12.5 9.5 18 20 6.5"})})}function Xre(){return d.jsx("svg",{className:"ia-caret",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M9 5.5 16.5 12 9 18.5"})})}function xP({products:e,filter:t,walk:n,onDone:r,onNewProject:s,onProjectMade:o,onClose:i}){const l=(()=>{try{return localStorage.getItem("zero.lastProduct")}catch{return null}})(),[a,c]=w.useState(()=>uA(e,{filter:t,last:l})),[u,f]=w.useState(null),[h,p]=w.useState([]),[m,y]=w.useState(!1),[x,k]=w.useState(!1),[v,b]=w.useState(n?n.folders:null),[E,N]=w.useState(null),[T,A]=w.useState([]),[R,$]=w.useState("door"),[L,_]=w.useState([]),j=w.useMemo(()=>[...e,...T.filter(oe=>!e.some(P=>P.slug===oe.slug))],[e,T]),F=kP(j,a),ae=Px(j,a);w.useEffect(()=>{if(a&&j.some(P=>P.slug===a))return;const oe=uA(j,{filter:t,last:l});oe&&oe!==a&&c(oe)},[j,t,l,a]);const G=n==null?void 0:n.folders;w.useEffect(()=>{if(n){b(G??null);return}let oe=!0;return(async()=>{const P=await q.agentFolders();oe&&b(P)})(),()=>{oe=!1}},[n,G]),w.useEffect(()=>{let oe=!0;return(async()=>{const P=await q.agentThreads();oe&&N(P)})(),()=>{oe=!1}},[]),w.useEffect(()=>{let oe=!0;return f(null),(async()=>{const P=await q.agentFiles({folder:F,product:a});oe&&f({user:P.user,project:P.project})})(),()=>{oe=!1}},[F,a]);const I=w.useMemo(()=>Fre({found:u,folders:v??[],products:j,project:a,threads:E??[]}),[u,v,j,a,E]),ne=w.useMemo(()=>new Set(h),[h]),B=I.length>0,J=!!u&&!!v&&E!==null,M=Bre({read:J,picked:h,dests:I}),[Q,ce]=w.useState(!1),C=w.useCallback(async()=>{if(!Q){ce(!0);try{const[oe,P]=await Promise.all([q.agentFiles({folder:F,product:a}),q.agentFolders()]);f({user:oe.user,project:oe.project}),b(P)}finally{ce(!1)}}},[Q,F,a]),re=w.useCallback(async oe=>{if(!(m||oe.length===0)){y(!0);try{const P=new Set(oe),ee=new Map,Ae=[];for(const be of I){const Ye=be.items.filter(Jt=>P.has(Jt.path)).map(Jt=>Jt.name),rt=(be.threads??[]).filter(Jt=>P.has(Jt.path)).map(Jt=>Jt.id);if(!(!Ye.length&&!rt.length)){if(be.kind==="new"&&be.folder)Ae.push({folder:be.folder,name:be.name,load:{names:Ye,ids:rt}});else if(be.slug){const Jt=ee.get(be.slug)??{names:[],ids:[]};ee.set(be.slug,{names:[...Jt.names,...Ye],ids:[...Jt.ids,...rt]})}}}let We=0,Je=0,wt=0,un="";const dt=[],Cn=async(be,Ye)=>{if(Ye.names.length){const rt=await q.importAgents({product:be,agents:Ye.names});We+=rt.added,Je+=rt.already}if(Ye.ids.length){const rt=await q.importThreads({product:be,threads:Ye.ids});We+=rt.added,Je+=rt.already}wt+=1};for(const[be,Ye]of ee)await Cn(be,Ye),un=Px(j,be);for(const be of Ae){let Ye=null;try{const rt=await q.createProduct({name:be.name,repoPath:be.folder});Ye=(rt==null?void 0:rt.slug)??null}catch{Ye=null}Ye&&(dt.push(be.name),A(rt=>[...rt,{slug:Ye,name:be.name,repoPath:be.folder}]),o==null||o(Ye),await Cn(Ye,be.load),un=be.name)}const Ut=Vm(I,oe);r({added:We,already:Je,name:wt===1?un:"",inboxes:wt,made:dt,noun:Ut.agents?"agent":"thread"})}finally{y(!1)}}},[m,I,j,r,o]),W=w.useCallback(()=>re(pA(I)),[re,I]);w.useEffect(()=>{const oe=P=>{if(P.key==="Escape"){if(P.preventDefault(),x){k(!1);return}if(R==="pick"){$("door");return}if(n)return;i();return}if(P.key==="Enter"&&(P.metaKey||P.ctrlKey)){if(P.preventDefault(),n&&!B){n.onSkip();return}R==="door"?W():M&&re(h)}};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[re,W,h,x,M,R,B,n,i]);const V=w.useRef(null),[Se,ye]=w.useState(0),De=w.useCallback(()=>{const oe=V.current;if(!oe){ye(0);return}const P=oe.getBoundingClientRect(),ee=[...oe.querySelectorAll("[data-sec]")];ye(ee.filter(Ae=>Ae.getBoundingClientRect().top+10>P.bottom).length)},[]);w.useEffect(()=>{De()});const Te=Se>0&&d.jsxs("button",{className:"ia-more",onClick:()=>{const oe=V.current;oe&&oe.scrollBy({top:oe.clientHeight-44,behavior:"smooth"})},children:[es(Se)," more below"]}),le=Kre(I),K=oe=>Ure(oe,h),me=oe=>p(Vre(I,h,oe.key)),U=oe=>L.includes(oe),we=oe=>_(P=>P.includes(oe)?P.filter(ee=>ee!==oe):[...P,oe]),Oe=oe=>oe.kind==="everywhere"?Js.everywhere:oe.name,Ie=mA(I,h),ct=({s:oe})=>d.jsxs("span",{className:`ia-box is-${oe}`,"aria-hidden":"true",children:[oe==="all"&&d.jsx(Qre,{}),oe==="some"&&d.jsx("span",{className:"ia-half"})]}),se=oe=>{const P=ne.has(oe.path);return d.jsxs("button",{className:P?"ia-agent on":"ia-agent","aria-pressed":P,onClick:()=>p(fA(I,h,oe.path)),children:[d.jsx(ct,{s:P?"all":"none"}),d.jsxs("span",{className:"ia-agent-text",children:[d.jsx("span",{className:"ia-agent-name",children:oe.title}),oe.line&&d.jsx("span",{className:"ia-agent-line",children:oe.line})]})]},oe.path)},he=oe=>{const P=ne.has(oe.path),ee=Gre(oe.when),Ae=`${Jre(oe.source)}${ee?`, ${ee}`:""}`;return d.jsxs("button",{className:P?"ia-agent on":"ia-agent","aria-pressed":P,onClick:()=>p(fA(I,h,oe.path)),children:[d.jsx(ct,{s:P?"all":"none"}),d.jsxs("span",{className:"ia-agent-text",children:[d.jsx("span",{className:"ia-agent-name",children:oe.title}),d.jsx("span",{className:"ia-agent-line",children:`${Ae[0].toUpperCase()}${Ae.slice(1)}`})]})]},oe.path)},ve=oe=>d.jsxs("span",{className:"ia-goes",children:[j.length>0?d.jsxs(d.Fragment,{children:[Js.landBefore," ",d.jsx("button",{type:"button",className:"ia-word","aria-expanded":x,onClick:P=>{P.stopPropagation(),j.length>1&&k(ee=>!ee)},children:ae}),Js.landAfter]}):Js.landNowhere,x&&j.length>1&&d.jsx("span",{className:"ia-projects",role:"listbox",children:j.map(P=>d.jsx("button",{role:"option","aria-selected":P.slug===a,className:P.slug===a?"ia-project on":"ia-project",onClick:ee=>{ee.stopPropagation(),k(!1),c(P.slug)},children:P.name},P.slug))})]}),He=d.jsxs("div",{className:"ia-doors",children:[d.jsxs("button",{className:"ia-door is-first",onClick:W,disabled:m,children:[d.jsxs("span",{className:"ia-door-name",children:[Wre(I),d.jsx("kbd",{children:"⌘↵"})]}),d.jsx("span",{className:"ia-door-why",children:mA(I,pA(I))||ks.foot})]}),d.jsxs("button",{className:"ia-door",onClick:()=>$("pick"),children:[d.jsx("span",{className:"ia-door-name",children:Mf.pick}),d.jsx("span",{className:"ia-door-why",children:Mf.pickWhy})]}),d.jsx("p",{className:"ia-read",children:Mf.never})]}),tt=d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Se>0?"ia-scroll ia-stack ia-fading":"ia-scroll ia-stack",ref:V,onScroll:De,children:I.map(oe=>d.jsxs("div",{className:U(oe.key)?"ia-blk open":"ia-blk","data-sec":"",children:[d.jsxs("div",{className:"ia-blk-head",children:[d.jsx("button",{className:"ia-pick",onClick:()=>me(oe),"aria-label":`Keep everything in ${Oe(oe)}`,children:d.jsx(ct,{s:K(oe)})}),d.jsxs("button",{className:"ia-blk-main",onClick:()=>we(oe.key),"aria-expanded":U(oe.key),children:[d.jsxs("span",{className:"ia-blk-line",children:[d.jsx("span",{className:"ia-blk-name",children:Oe(oe)}),oe.kind==="new"&&d.jsx("span",{className:"ia-tag",children:Js.newBadge}),d.jsx("span",{className:"ia-blk-n",children:Js.n(go(oe))}),d.jsx(Xre,{})]}),d.jsx("span",{className:"ia-blk-where",children:oe.kind==="everywhere"?d.jsxs(d.Fragment,{children:[Js.homeFolder,". ",ve()]}):oe.where})]})]}),U(oe.key)&&d.jsxs("div",{className:"ia-blk-list",children:[oe.items.map(se),(oe.threads??[]).map(he)]})]},oe.key))}),Te]}),Ct=R==="pick"?tt:He;return d.jsx("div",{className:"modal-backdrop compose-backdrop",onClick:n?void 0:i,children:d.jsxs("div",{className:`modal ia-card on-${R}${n?" in-walk":""}`,onClick:oe=>oe.stopPropagation(),children:[d.jsxs("div",{className:"ia-top",children:[R==="pick"?d.jsx("button",{className:"ia-back",onClick:()=>$("door"),children:Mf.pick}):d.jsx("h1",{className:"ia-head",children:J&&!B?ks.headNone:ks.head}),J&&B&&d.jsx("div",{className:"ia-top-right",children:d.jsx("span",{className:"ia-total",children:le})})]}),n&&R==="door"&&B&&d.jsx("p",{className:"ia-offer",children:n.line}),!J&&d.jsx("div",{className:"ia-empty",children:ks.reading}),J&&!B&&d.jsxs("div",{className:"ia-none",children:[d.jsx("p",{className:"ia-none-where",children:ks.noneWhere(Js.homeFolder)}),d.jsx("p",{className:"ia-none-later",children:ks.noneLater}),d.jsx("button",{type:"button",className:"ia-look-again",onClick:C,disabled:Q,children:Q?ks.looking:ks.lookAgain})]}),J&&B&&Ct,J&&B&&j.length===0&&!I.some(oe=>oe.kind==="new")&&d.jsxs("p",{className:"ia-line",children:[ks.noProject," ",d.jsx("button",{type:"button",className:"ia-word",onClick:s,children:ks.newProject})]}),J&&B&&R==="pick"&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"ia-read",children:[Ee.agentsRead,Ie&&d.jsxs(d.Fragment,{children:[" ",Ie]})]}),d.jsx("div",{className:"ia-foot",children:d.jsxs("button",{className:"dock-send",disabled:!M||m,onClick:()=>re(h),children:[qre(I,h)," ",d.jsx("kbd",{children:"⌘↵"})]})})]}),n&&R==="door"&&d.jsx("button",{type:"button",className:"ia-walk-on",onClick:n.onSkip,disabled:m,children:n.skip})]})})}function Zre(e,t,n=Date.now()){return t.filter(r=>um(r)===e.id).sort((r,s)=>s.createdAt-r.createdAt).map(r=>{const s=dm(r),o=r.status==="open"||r.status==="claimed";return{id:r.id,when:_h(r.createdAt,n),what:o?"running":s?"clean":r.result||"finished without saying anything",news:!o&&!s,late:ese(e,r)}})}function ese(e,t,n){const r=v4(e,t.createdAt);if(!r)return null;const[s,o,i]=r.split("-").map(Number),[l,a]=e.at.split(":").map(Number),c=new Date(s,o-1,i,l,a,0,0).getTime();return t.createdAt-c<15*6e4?null:`ran ${Yo(c,t.createdAt)} late`}function tse(e){return`${new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})} ${fm(e).toLowerCase()}`}function nse({rule:e,items:t,editing:n,onClose:r,onEdit:s,onEditClose:o,onSave:i,onEnd:l}){const a=Zre(e,t),c=kR(e),u=new Date(`2026-01-01T${e.at}:00`).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),f=ine(e);return d.jsxs("div",{className:"focus-pane",children:[d.jsx("div",{className:"focus-scroll",children:d.jsxs("div",{className:"focus",children:[d.jsxs("div",{className:"focus-head",children:[d.jsxs("button",{className:"back-esc in-head",onClick:r,"aria-label":"Back",children:[d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M10 3.5L5.5 8l4.5 4.5"})}),d.jsx("span",{children:"esc"})]}),d.jsxs("div",{children:[d.jsx("div",{className:"focus-title",children:e.title}),d.jsxs("div",{className:"focus-meta",children:[d.jsx("span",{children:e.productName}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["daily at ",u]}),c&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"·"}),d.jsxs("span",{children:["next ",tse(c)]})]})]})]})]}),e.body&&d.jsx("div",{className:"focus-body",children:d.jsx("div",{className:"markdown",children:d.jsx(Lc,{remarkPlugins:[ru],children:e.body})})}),d.jsxs("div",{className:"runs",children:[a.length===0&&d.jsx("div",{className:"run",children:d.jsx("span",{className:"run-what",children:"It has not run yet."})}),a.map(h=>d.jsxs("div",{className:"run",children:[d.jsx("span",{className:"run-when",children:h.when}),d.jsxs("span",{className:h.news?"run-what news":"run-what",children:[h.what,h.late?` · ${h.late}`:""]})]},h.id))]}),d.jsx("div",{className:"runs-note",children:"The runs still on file."})]})}),d.jsx("div",{className:"focus-dock",children:d.jsxs("div",{className:"focus-dock-inner",children:[d.jsx("div",{className:"dock-card",children:n?d.jsx(rse,{message:f,onSave:i,onClose:o}):d.jsxs("button",{className:"dock-pill",onClick:s,children:[d.jsx("span",{className:"dock-pill-text",children:"Change what it does…"}),d.jsx("span",{className:"dock-pill-key",children:d.jsx("kbd",{children:"R"})})]})}),d.jsx("button",{className:"rule-end",onClick:l,children:"End this repeating task"})]})})]})}function rse({message:e,onSave:t,onClose:n}){const[r,s]=w.useState(e),o=w.useRef(null);w.useEffect(()=>{const a=o.current;a&&(a.focus(),a.setSelectionRange(a.value.length,a.value.length),a.scrollTop=a.scrollHeight)},[]);const i=r.trim()!==e.trim(),l=()=>{i&&r.trim()&&t(r.trim())};return d.jsxs(d.Fragment,{children:[d.jsx("textarea",{className:"dock-input rule-input",ref:o,value:r,onChange:a=>s(a.target.value),placeholder:"What should it do every time?",onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&l(),a.key==="Escape"&&(a.stopPropagation(),n())}}),d.jsxs("div",{className:"compose-sentence",children:[d.jsx("span",{className:"compose-clauses",children:d.jsx("span",{className:"dim",children:"Every run after this one reads this."})}),d.jsxs("button",{className:"dock-send",onClick:l,disabled:!i||!r.trim(),title:"Save · ⌘↵",children:["Save ",d.jsx("kbd",{children:"⌘↵"})]})]})]})}function sse(e){const t=new Map;return e.map(n=>{const r=t.get(n.id)??0;return t.set(n.id,r+1),r?`${n.id}#${r}`:n.id})}function ose(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ise(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>e(t.matches?"dark":"light");return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}function Ra(e){return e==="light"||e==="dark"?e:e==="match"?ose():"dark"}function lse(e){return e==="light"||e==="dark"||e==="match"?e:"dark"}const Qo="zero.theme";function Bc(e,t=document.documentElement){t.setAttribute("data-theme",e)}const tn=[{id:"valley-haze",name:"Valley Haze",note:"The gouache valley, thrown out of focus. A blurred warm wash, edge to edge."},{id:"frost-haze",name:"Frost Haze",note:"Paper cooled toward blue. Light, with a cold edge to it.",light:!0},{id:"slate-haze",name:"Slate Haze",note:"A cool mid ground with a pale card on it. Between the two ends.",light:!0},{id:"lake",name:"Lake",note:"The landing page’s photograph, in dark mode."},{id:"ice",name:"Ice",note:"Blue daylight entering a glacier cave from the right."},{id:"pixel-ridge",name:"Pixel Ridge",note:"Pixel art. Flat ridges into a low sun, pixel conifers on the near cliff."},{id:"peach-haze-2",name:"Peach Haze",note:"A diagonal peach glow across a sage and mauve wash.",light:!0},{id:"orbital-glass",name:"Orbital Glass",note:"A ringed planet through clear glass, with quiet gray text."},{id:"pixel-orbit",name:"Pixel Orbit",note:"Pixel art. A ringed planet low over a dark plain."},{id:"woodblock-sea",name:"Woodblock Sea",note:"A Japanese woodblock print. Pines on a headland, the sun on the water."},{id:"riso-hills",name:"Riso Hills",note:"A two colour risograph print in blue and coral ink."},{id:"gouache-valley",name:"Gouache Valley",note:"A painted animation background in gouache. A valley and a still river."},{id:"watercolour-mist",name:"Watercolor Mist",note:"A wet on wet watercolour. Five washes of mountain into mist."},{id:"ember-grid",name:"Ember Grid",note:"The launch film’s look. A warm dark grey, a faint dot grid, square corners and one orange."}],zr="zero.skin";function ba(e){return tn.some(t=>t.id===e)?e:"none"}function ase(e){var t;return((t=tn.find(n=>n.id===e))==null?void 0:t.name)??"None"}function cse(e,t){return t==="none"?e:t}const Ns=[...tn.map(e=>({id:e.id,name:e.name})),{id:"light",name:"Light"},{id:"dark",name:"Dark"}];function use(e,t=Ra("match")){const n=e.getItem(Qo),r=e.getItem(zr);if(r==="peach-haze"){e.setItem(Qo,"light"),e.setItem(zr,"peach-haze-2");return}if(n===null&&r===null){const o=as(ed);e.setItem(Qo,o.theme),e.setItem(zr,String(o.skin));return}if(n==="match"||r===null||["ice-river","lake-harbour","moon-pines","cel-dusk","pixel-harbour","vector-dunes","lino-coast"].includes(r)){const o=n==="match"?t:Ra(n),i=r&&ba(r)!=="none"?as(r):as(o==="light"?"frost-haze":"valley-haze");e.setItem(Qo,i.theme),e.setItem(zr,i.skin)}}function as(e){var t;return e==="light"?{theme:"light",skin:"none"}:e==="dark"?{theme:"dark",skin:"none"}:e==="match"?{theme:"match",skin:"none"}:{theme:(t=tn.find(n=>n.id===e))!=null&&t.light?"light":"dark",skin:e}}function Hc(e,t=document.documentElement){e==="none"?t.removeAttribute("data-skin"):t.setAttribute("data-skin",e)}function gA(e,t=document.documentElement){e==="soft"?t.setAttribute("data-skin-detail","soft"):t.removeAttribute("data-skin-detail")}function yA(e){return e==="soft"?"soft":"sharp"}const Lo="zero.skin.tune",Fr={panelOpacity:{min:0,max:1,step:.01},backgroundBlur:{min:0,max:80,step:1},blur:{min:0,max:80,step:1},dim:{min:0,max:.85,step:.01}},On={lake:{blur:8,backgroundBlur:5,dim:.63},ice:{blur:2,dim:.85},"ice-river":{blur:2,dim:.735},"lake-harbour":{blur:2,dim:.68},"pixel-ridge":{blur:4,backgroundBlur:6,dim:.77},"pixel-orbit":{blur:0,backgroundBlur:5,dim:.2},"woodblock-sea":{blur:4,backgroundBlur:12,dim:.84},"riso-hills":{blur:2,backgroundBlur:3,dim:.85},"gouache-valley":{blur:4,backgroundBlur:5,dim:.75},"vector-dunes":{blur:2,dim:.775},"watercolour-mist":{blur:2,backgroundBlur:4,dim:.85},"orbit-rings":{blur:2,dim:0},"moon-pines":{blur:2,dim:0},"cel-dusk":{blur:2,dim:0},"pixel-harbour":{blur:2,dim:0},"lino-coast":{blur:2,dim:.85},"valley-haze":{blur:2,dim:0},"frost-haze":{blur:2,dim:0},"slate-haze":{blur:2,dim:0},"orbital-glass":{blur:30,dim:.3,backgroundBlur:24,panelOpacity:.16},"peach-haze-2":{blur:0,dim:.35,backgroundBlur:0,panelOpacity:.2},"ember-grid":{blur:0,dim:0}},dse=(e,t,n)=>e<t?t:e>n?n:e;function na(e,t){const n=On[t]??On.lake;let r;try{r=e?JSON.parse(e):null}catch{return n}const s=r==null?void 0:r[t];if(!s||typeof s!="object")return n;const o=(i,l,a)=>typeof i=="number"&&Number.isFinite(i)?dse(i,a.min,a.max):l;return{...s.backgroundBlur!==void 0||n.backgroundBlur!==void 0?{backgroundBlur:s.backgroundBlur===void 0?n.backgroundBlur:o(s.backgroundBlur,0,Fr.backgroundBlur)}:{},...n.panelOpacity!==void 0?{panelOpacity:o(s.panelOpacity,n.panelOpacity,Fr.panelOpacity)}:{},blur:o(s.blur,n.blur,Fr.blur),dim:o(s.dim,n.dim,Fr.dim)}}function fse(e,t,n){let r={};try{const s=e?JSON.parse(e):null;s&&typeof s=="object"&&(r=s)}catch{}return JSON.stringify({...r,[t]:n})}function ra(e,t=document.documentElement){t.style.setProperty("--skin-panel-opacity",e.panelOpacity===void 0?"":String(e.panelOpacity)),t.style.setProperty("--skin-background-blur",`${e.backgroundBlur??0}px`),t.style.setProperty("--skin-blur",`${e.blur}px`),t.style.setProperty("--skin-dim",String(e.dim))}const ed="ember-grid";function bP(e){return e==="none"||e===ed?$x:e}const $x="gouache-valley";function hse(e,t){if(e.getItem(t)!==null||e.getItem(zr)!==null)return null;const n=as(ed);return e.setItem(t,n.theme),e.setItem(zr,String(n.skin)),n}function pse(e,t){const n=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=`${t.label} ${t.keywords??""}`.toLowerCase();return n.every(s=>r.includes(s))}const mse=["snooze"];function gse(e,t){if(!e.trim())return t;const n=r=>mse.includes(r.id)?0:1;return[...t].sort((r,s)=>n(r)-n(s))}const yse="light mode dark mode appearance colours colors";function wse(e){const t=[],n=e!=="light"&&e!=="dark"&&e!=="match";t.push({id:"theme-picker",label:"Themes…",hint:"all of them at once, without leaving this screen",keywords:"theme themes background picture photo wallpaper appearance skin look",opens:"themes"});const r=as(e).theme==="light"?"valley-haze":"frost-haze";return t.push({id:"theme",label:r==="valley-haze"?"Switch to dark":"Switch to light",hint:"themes",keywords:yse,to:r}),n&&t.push({id:"theme-off",label:`Turn off ${ase(e)}`,hint:"back to plain dark, no picture",keywords:"theme background picture photo wallpaper appearance",to:"dark"}),t}const wA=32;function kse(e){const t=e.trim();let n=t;if(t.length>wA){const r=t.slice(0,wA),s=r.lastIndexOf(" ");n=`${(s>0?r.slice(0,s):r).trimEnd()}…`}return`Nothing matches “${n}”.`}function xse({products:e,supervisorPaused:t,itemCommands:n=[],batch:r=!1,order:s=[],look:o,onSetLook:i,onThemes:l,staleFiles:a=[],updateReady:c=null,onInstallUpdate:u,filtering:f=!1,onOpenFilter:h,onClearFilter:p,onView:m,onPause:y,onResume:x,onRankFirst:k,onNewProject:v,onStanding:b,onSettings:E,onShortcuts:N,panelUp:T,onTogglePanel:A,keyHints:R,onSetKeyHints:$,onSearch:L,onFirstRun:_,onTutorial:j,onImportAgents:F,onFreshUser:ae,onDemo:G,onClose:I}){const[ne,B]=w.useState(""),[J,M]=w.useState(0),Q=w.useRef(null);w.useEffect(()=>{var W;return(W=Q.current)==null?void 0:W.focus()},[]);const ce=w.useMemo(()=>[{id:"new-project",label:"New project…",hint:"name it, and it is yours",run:v},...n,{id:"filter",label:"Filter…",hint:"Project, priority or agent",run:h},...f?[{id:"clear-filter",label:"Clear filter",run:p}]:[],...e.map((W,V)=>({id:`rank-${W.slug}`,label:`Rank ${W.name} first`,hint:s.includes(W.slug)?`now #${V+1} of ${e.length}`:"not ranked yet",run:()=>k(W.slug)})),{id:"search",label:"Search tasks",keyHint:"/",run:L},{id:"view-inbox",label:"Inbox",run:()=>m("inbox")},{id:"view-progress",label:"In progress",run:()=>m("progress")},{id:"view-done",label:"Closed",run:()=>m("done")},...wse(o).map(W=>({id:W.id,label:W.label,hint:W.hint,keywords:W.keywords,run:W.opens==="themes"?l:()=>i(W.to)})),...c?[{id:"update",label:`Restart to update ${Le}`,hint:`version ${c} has downloaded · restarting puts you back where you were`,keywords:"update upgrade new version restart",run:()=>u==null?void 0:u()}]:[],...a.length?[{id:"stale",label:`Restart ${Le} to pick up main-process changes`,hint:`${a.length} file${a.length===1?"":"s"} changed since this one started · ⌘R will not pick them up`,run:()=>{}}]:[],{id:"pause",label:t?"Unpause agents":"Pause agents",hint:t?"sessions will spawn again":"no new sessions spawn",run:()=>y(!t)},...r?[]:[{id:"resume-stopped",label:"Resume interrupted agents",hint:"respawn work stranded by a usage limit or crash",run:x}],{id:"standing",label:"General agent instructions…",hint:"every agent, every task",keywords:"standing instructions rules your my brief guidelines preferences every agent every session tell agents dont do",run:b},{id:"settings",label:"Settings…",hint:"the workspace, and every project",run:E},{id:"shortcuts",label:"Keyboard shortcuts",hint:`every key ${Le} has`,keywords:"keys keyboard shortcut hotkeys commands cheatsheet help what does press bindings",run:N},{id:"panel",label:T?"Collapse sidebar":"Expand sidebar",hint:"what this product is, and what else is open on it",keyHint:"\\",run:A},{id:"import-agents",label:"Import your Claude Code agents",hint:"the ones already on this Mac · they land in your inbox",keywords:"import agents claude code subagents existing mine bring across add my",run:F},{id:"tutorial",label:"Take the tutorial",hint:"a pretend project · nothing is kept",keywords:"tutorial practice practise walkthrough walk tour again show me around teach learn training how does this work sandbox lesson",run:j},{id:"first-run",label:`Set ${Le} up again`,hint:"from the welcome screen · makes a project",keywords:"onboarding first run new user welcome intro setup start over from scratch install fresh",run:_},{id:"demo",label:"Open a demo inbox",hint:"invented work · yours keeps running",keywords:"demo demonstration present presentation pitch investor customer screen share screenshare record video sample fake example stage not mine hide my work",run:G},{id:"fresh-user",label:`Open ${Le} as a new user`,hint:"nothing set up · yours keeps running",keywords:"new user fresh install stranger onboarding first run clean empty blank test website download nothing of mine agents claude code sessions",run:()=>ae(!1)},{id:"keyhints",label:R?"Turn off keyboard shortcut hints":"Turn on keyboard shortcut hints",hint:"the keys a row and the tabs offer, drawn when you point at them",run:()=>$(!R)}],[n,r,e,t,s,v,f,h,p,m,y,x,k,b,E,N,o,i,l,a,c,u,T,A,R,$,L,_,j,F,ae,G]),C=w.useMemo(()=>{const W=ne.trim().toLowerCase();return W?gse(W,ce.filter(V=>pse(W,V))):ce},[ce,ne]),re=w.useMemo(()=>sse(C),[C]);return w.useEffect(()=>M(0),[ne]),d.jsx("div",{className:"modal-backdrop palette-backdrop",onClick:I,children:d.jsxs("div",{className:"modal palette",onClick:W=>W.stopPropagation(),children:[d.jsx("input",{ref:Q,className:"palette-input",value:ne,onChange:W=>B(W.target.value),placeholder:"Type a command…",onKeyDown:W=>{W.key==="Escape"&&I(),W.key==="ArrowDown"&&(W.preventDefault(),M(V=>Math.max(0,Math.min(V+1,C.length-1)))),W.key==="ArrowUp"&&(W.preventDefault(),M(V=>Math.max(0,V-1))),W.key==="Enter"&&C[J]&&C[J].run()}}),d.jsxs("div",{className:"palette-list",children:[C.length===0&&d.jsx("div",{className:"palette-empty",children:kse(ne)}),C.map((W,V)=>d.jsxs("div",{className:`palette-item ${V===J?"selected":""}`,onClick:W.run,onMouseEnter:()=>M(V),children:[d.jsx("span",{children:W.label}),W.keyHint?d.jsx("span",{className:"palette-key",children:W.keyHint}):W.hint&&d.jsx("span",{className:"palette-hint",children:W.hint})]},re[V]))]})]})})}const uw=`quit and reopen ${Le} to edit these`,bse=e=>/No handler registered/i.test(e),vP={sentence:"General agent instructions. Every agent reads them before your task, on every project.",placeholder:"Don't hand me summary .md files. Put the answer on the work item.",reader:()=>{var e;return(e=window.zero)==null?void 0:e.standingRead},writer:()=>{var e;return(e=window.zero)==null?void 0:e.standingWrite}};function vse({kind:e=vP,onClose:t}){const[n,r]=w.useState(null),[s,o]=w.useState("idle"),[i,l]=w.useState(null),a=w.useRef(null),c=w.useRef(null),u=w.useRef(null);w.useEffect(()=>{const y=e.reader();if(!y){r(""),o("failed"),l(uw);return}y().then(x=>{r((x==null?void 0:x.text)??""),x!=null&&x.error&&(o("failed"),l(x.error))}).catch(()=>{r(""),o("failed"),l(uw)})},[]),w.useEffect(()=>{if(n===null)return;const y=a.current;y&&(y.focus(),y.setSelectionRange(0,0),y.scrollTop=0)},[n!==null]);const f=async y=>{o("saving");try{const x=e.writer();if(!x)throw new Error("this window cannot reach the instructions file");const k=await x({text:y});if(k&&k.ok===!1)throw new Error(k.error||"could not save");u.current=null,o("saved"),l(null)}catch(x){const k=String((x==null?void 0:x.message)??x);o("failed"),l(bse(k)?uw:k)}},h=y=>{r(y),u.current=y,o("saving"),c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>f(y),400)},p=()=>{c.current&&window.clearTimeout(c.current),u.current!==null?f(u.current).finally(t):t()},m=s==="failed"?i??"not saved":s==="saving"?"saving…":s==="saved"?"saved":e.sentence;return d.jsx("div",{className:"modal-backdrop compose-backdrop",onClick:p,children:d.jsxs("div",{className:"modal compose rules-card",onClick:y=>y.stopPropagation(),children:[d.jsx("textarea",{ref:a,className:"rules-text",spellCheck:!1,value:n??"",placeholder:n===null?"loading…":e.placeholder,disabled:n===null,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),p()),y.stopPropagation()}}),d.jsxs("div",{className:"rules-sentence",children:[d.jsx("span",{className:"rules-clauses",children:m}),d.jsxs("button",{type:"button",className:"dock-send",onClick:p,children:["Done ",d.jsx("kbd",{children:"esc"})]})]})]})})}const Sse=`This is about the LAST message you send, the one that ends your run. Whoever
350
+ `),agoMs:31*6e4}],Ma={step:"welcome",folder:null,name:"",product:null,practice:null,item:null,sentAt:null,examples:[]};function One(e){return{...Ma,tutorial:!0,step:"hand",product:e}}function Ine(e){return e!=null&&e.tutorial?"end":"done"}function Dne(e,t){switch(t.t){case"start":return e.step==="welcome"?{...e,step:"folder"}:e;case"folder":return{...e,folder:t.path,name:!e.name||e.folder&&e.name===tA(e.folder)?tA(t.path):e.name};case"name":return{...e,name:t.name};case"made":return{...e,product:t.product,step:"inbox"};case"practice":return{...e,practice:t.product,examples:t.examples,step:"make"};case"sent":return{...e,item:t.item,sentAt:t.at,step:"working"};case"answered":return e.step==="working"?{...e,step:"open"}:e;case"staged":return{...e,examples:t.examples,step:"clear"};case"finish":return{...e,step:"landed"}}}function Vs(e,t){return{...e,step:t}}function Lne(e){return e==="folder"?"welcome":e==="name"?"folder":null}function tA(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[-_.]+/g," ").trim().replace(/\s+/g," ").split(" ").map(n=>n&&n[0].toUpperCase()+n.slice(1)).join(" ")}function Pne(e,{home:t="",max:n=6}={}){const r=new Map,s=t.replace(/\/+$/,"");for(const o of e){const i=String(o.folder??"").replace(/\/+$/,"");if(!i||i===s||i==="/")continue;const l=o.source==="codex"?"codex":"claude",a=r.get(i);if(a){a.when=Math.max(a.when,o.when??0),a.via.includes(l)||a.via.push(l);continue}r.set(i,{folder:i,name:i.split("/").pop()??i,short:o.short||fP(i,t),when:o.when??0,via:[l]})}return[...r.values()].sort((o,i)=>i.when-o.when).slice(0,n)}function fP(e,t){const n=(t??"").replace(/\/+$/,"");return n&&e.startsWith(n+"/")?"~"+e.slice(n.length):e}function nA(e){return e.forced?!0:!e.done&&e.products===0}const $ne=dv.title,zne=dv.body,_ne=15e3,Fne="first-run",Bne=2e3;function rA(e,t){if(!t||t.step==="landed")return e;if(t.step==="done")return[];if(t.step==="clear"||t.step==="snooze"||t.step==="unblock"){const n=new Set(t.examples);return e.filter(r=>n.has(r.id))}if(t.step==="where"){const n=new Set([...t.examples,t.item].filter(Boolean));return e.filter(r=>n.has(r.id))}return e.filter(n=>n.id===t.item)}function Hne(e){return e.findIndex(t=>t.waiting)}function Wne(e){return e.findIndex(t=>t.later)}function Une(e,t,n,r){if(!t||!t.examples.length)return!1;const s=new Set(e.map(o=>o.id));return!t.examples.some((o,i)=>i!==n&&i!==r&&s.has(o))}function Vne(e,t,n,r){if(!t)return[];const s=new Set(e.map(o=>o.id));return t.examples.filter((o,i)=>i!==n&&i!==r&&s.has(o))}function Bm(e,t){return!e||t<0?null:e.examples[t]??null}function Kne(e,t,n){const r=Bm(t,n);return r?!e.some(s=>s.id===r):!1}function Hm(e,t){return!e||t<0?null:e.examples[t]??null}const hP="That one is an agent stopped, waiting on you. Open it and answer it.";function lw(e,t,n,r){return!e||e.step==="landed"?null:t===Hm(e,n)?hP:t===Bm(e,r)?"That one is not finished. Press S to deal with it later.":null}function qne(e,t,n){return!e||e.step==="landed"?null:t===Hm(e,n)?hP:null}function Yne(e,t,n,r,s,o={}){if(!t)return[];const i=new Set(n.map(a=>a.id)),l=a=>a&&i.has(a)?[a]:[];return e==="clear"?Vne(n,t,r,s):e==="snooze"?o.picking?[]:l(Bm(t,s)):e==="unblock"?o.opened?[]:l(Hm(t,r)):[]}function Gne(e,t){return!e.length||!t?!1:!e.includes(t)}function Jne(e,t){if(!t||!t.examples.length)return!1;const n=new Set(e.map(r=>r.id));return!t.examples.some(r=>n.has(r))}const Ee={head:"Run dozens of coding agents from one inbox.",headSub:"Works with Claude Code and Codex.",terms:"Get started means you agree to the terms and the privacy policy.",getStarted:"Get started",page:"Set up your first project.",folderQ:"Where is your code?",folderPick:"Choose a folder on this Mac",folderClause:"This is the folder the agents will run in.",folderAgain:"Choose a different one",folderHead:"Which project should your agents work on first?",folderLede:"Pick its folder. Your agents run inside it.",folderRecent:"Where you have run agents recently",folderOther:"Choose another folder",folderFirst:"Choose a folder",folderVia:{claude:"Claude Code",codex:"Codex"},nameIn:"Agents will work in",nameChange:"Change",nameGo:"Continue",missing:`${Pn} could not find Claude Code on this Mac, and your agents run on it.`,missingLink:"Get Claude Code",nameQ:"What is this project called?",nameClause:"Taken from the folder. Change it to anything you like.",next:"Next",takenName:e=>`You already have a project called ${e}. Give this one another name.`,emptyName:"A project needs a name with letters or numbers in it.",notMade:e=>`${Pn} could not make the project. ${e}`,submit:"Submit",back:"Back",lookQ:`Pick how ${Le} looks.`,lookMore:"Randomize my theme",lookClause:"Press ⌘K and type theme to change it later.",lookGo:"Next",intro:[{head:"All your Claude Code and Codex agents report to one inbox",line:"Each agent writes back here the moment it finishes or gets stuck",piece:"list"},{head:"You only see an agent when it needs you",line:"The rest keep working in In progress until they finish or have a question",piece:"progress"},{head:"So one person can run dozens of agents at once",line:"No terminals to watch and no tabs to check",piece:"empty"}],pieceEmpty:"Nothing is waiting on you.",pieceAgents:"Active agents",introOn:(e,t)=>`${e} of ${t}`,introNext:"Next",handHead:"This is the tutorial.",handLine:"Nothing in here is your code and nothing you do in here is saved. Your own project is made already and it is waiting behind this.",handGo:"Start the tutorial",leave:"Skip",leaveHead:"Stay for the walk?",leaveLine:`It is the quickest way to pick up the few keys ${Le} runs on, and it is the only place they are shown to you. You can leave now and start it again whenever you like from ⌘K.`,leaveStay:"Keep going",leaveGo:"Skip it",offerHead:"Take the tutorial first?",offerLine:`A pretend project with pretend work in it, and the few keys ${Le} runs on. Nothing in it is your code and nothing in it is kept.`,offerGo:"Start the tutorial",offerNot:"Not now",offerLater:"Any time: press ⌘K and type tutorial.",bandTag:"Tutorial",band:"Nothing in here is yours and nothing is saved.",bandLine:"nothing in here is real",bringHead:"Add the agents already on this Mac.",agentsOffer:`${Pn} watches them and puts what they send you in your inbox.`,agentsFrom:e=>`Read from ${e}`,agentsAll:"Every project",agentsHere:"Only this project",agentsNoneAll:"No agents in your home folder yet. Anything you put there works in every project.",agentsNoneHere:"No agents in this project folder yet. Anything you put there works here only.",agentsRead:`Each one you keep lands in your inbox. ${Pn} never moves the file.`,finishHead:"You are ready to get started.",finishLine:"Your inbox is empty and no agent is waiting on you.",finishLineAgents:"Getting your inbox back to empty is the goal.",finishGo:"Open my inbox",gateHead:`${Pn} needs Claude Code.`,gateDo:`Install it, then check again. Your inbox opens as soon as ${Le} can see it.`,gateCheck:"Check again",gateChecking:"Looking",gateStill:"Still nothing here. A fresh install can take a moment to appear."};function Qne(e,t){return e.missing?{show:!0,blocked:!0,go:!1,head:Ee.gateHead,line:Ee.missing}:t.read?{show:!0,blocked:!1,go:!0,head:Ee.bringHead,line:Ee.agentsOffer}:{show:!1,blocked:!1,go:!1,head:"",line:""}}function sA(e){return!e.missing}const pn=(e,t,n=null,r="",s={})=>({quiet:e,lead:t,key:n,tail:r,...s}),Xne=["inbox","progress","done"];function Lx(e,t){const n=e!=null&&e.length?e:Xne;return n[(n.indexOf(t??"inbox")+1)%n.length]}const Zne={inbox:" to come back.",snoozed:" for the one you put off.",progress:" for the agent you answered.",done:" for everything you closed."};function pP(e,t,n={}){switch(e){case"make":return pn("A task is a job you hand to an agent.","Press ","N"," to write your first one.");case"task":return pn("","Press ","⌘↵"," to start it.");case"working":return t>=_ne?pn("Your agent is running.","Still reading. A bigger project takes longer than this one, and the answer will be here when it comes."):pn("Your agent is running.","It comes back in a few seconds.");case"open":return pn("Your agent worked on its own, and this row is what it sent back.","Press ","↵"," to open it.");case"answer":return pn("Every task ends one of two ways.","Reply to it, or press ","E"," to close it.");case"clear":return pn(n.left===1?"This one is finished too.":"This one is finished. Z brings back anything you close.","Press ","E"," to close it.",{caps:2});case"snooze":return n.picking?pn("Pick when it should come back.","It leaves your inbox until then and comes back on its own."):pn("Real work, but not for today. An empty inbox is the goal.","Press ","S"," to deal with it later.");case"unblock":return n.opened?pn("Your agent gave you three answers to pick from.","Press ","1"," to send the one it recommends."):pn("An agent is stopped here. Closing it leaves it stopped for good.","Press ","↵"," to open it.");case"where":{const r=tre(n.tabs??[],Lx(n.tabs,n.view)),s=Zne[Lx(n.tabs,n.view)]??" for the next one.";return n.view==="snoozed"?pn("The one you put off is here, and it comes back on its own.","Press ",r,s):n.view==="progress"?pn("The agent you answered is here, working without you.","Press ",r,s):n.view==="done"?pn("Everything you finished is kept here.","Press ",r,s):pn("Great! Your inbox is now empty. That is inbox zero, and it is the goal.","Press ",r," to see where it all went.")}case"command":return n.palette?pn(`Every command in ${Le} is in this list.`,"Press ","esc"," to close it."):pn("Everything you just did is one key away. So is this: type tutorial.","Press ","⌘K"," then make your first real task.");default:return null}}const oA=4e3;function Fp(e){const t=e.key??"";if(e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&/^[1-4]$/.test(t))return`⌘${t}`;const n=!!e.metaKey||!!e.ctrlKey;return n&&t==="Enter"?"⌘↵":n&&t.toLowerCase()==="k"?"⌘K":n?null:t==="Enter"?"↵":t==="Tab"?"⇥":t.length===1&&/[a-z0-9]/i.test(t)?t.toUpperCase():null}const ere={"⇥":"Tab","⌘1":"Command–1","⌘2":"Command–2","⌘3":"Command–3","⌘4":"Command–4","↵":"Return"};function tre(e,t){const n=e.indexOf(t);return n>=0&&n<4?`⌘${n+1}`:"⌘1"}function nre(e){return e?ere[e]??null:null}function mP(e,t){if(!e)return!1;const n=Fp(t);return n!==null&&n!==e}const rre='input, textarea, [contenteditable="true"], [contenteditable=""], .fr-stay-scrim';function Bp(e){const t=e;return!t||typeof t.closest!="function"?!0:!t.closest(rre)}const sre="⇥";function ore(e,t,n){return!Bp(n)||!mP(e,t)?!1:Fp(t)!==sre}const ire=".fr-tether, .fr-ring, .fr-veil, .fr-band, .fr-out",lre={unblock:[".focus-dock"]};function are(e,t){const n=e;if(!n||typeof n.closest!="function"||!Bp(n)||n.closest(ire))return!1;const r=t.filter(s=>!!s);return r.length?!r.some(s=>s===n||typeof s.contains=="function"&&s.contains(n)):!1}const iA=["pointerdown","mousedown","mouseup","click","dblclick"],gP=["make","task","working","open","answer","clear","snooze","unblock","where","command"],Ql={make:['button[aria-label="New task"]'],task:[".modal.compose .dock-send"],working:[".list-pane .row"],open:[".list-pane .row"],answer:[".focus-dock .dock-card",".focus-dock"],clear:[".list-pane .row"],snooze:[".modal.snooze .palette-list",".list-pane .row"],unblock:[".opt-strip",".list-pane .row"],where:[".workspace-navigation .workspace-tabs",".tabs"],command:[".modal.palette",'button[aria-label="Commands"]']},lA={clear:".list-pane .row:last-of-type",snooze:".list-pane .row:last-of-type"};function cre(e,t){const n=t.filter(o=>o.w>0&&o.h>0&&o.position!=="absolute"&&o.position!=="fixed");if(!n.length)return e;const r=Math.min(...n.map(o=>o.x)),s=Math.min(...n.map(o=>o.y));return{x:r,y:s,w:Math.max(...n.map(o=>o.x+o.w))-r,h:Math.max(...n.map(o=>o.y+o.h))-s}}const yP=6,ure=14,dre=.34;function wP(e){const t=Math.min(e.w,e.h);return Math.max(yP,Math.min(ure,Math.round(t*dre)))}function fre(e,t){let n=1/0;for(const r of t){const s=Math.max(e.x-(r.x+r.w),r.x-(e.x+e.w)),o=Math.max(e.y-(r.y+r.h),r.y-(e.y+e.h)),i=Math.max(s,o);i<0||(n=Math.min(n,i/2))}return n}const hre=12,pre=6,mre=.26;function gre(e){const t=Math.min(e.w,e.h);return Math.max(pre,Math.min(hre,Math.round(t*mre)))}const Hp=18,yre=360,wre=180,kre=220,Wp=22;function xre(e,t,n,r=1/0){const s=Math.max(yP,Math.min(wP(e),Math.floor(r))),o=Math.round(e.x-s),i=Math.round(e.y-s),l=Math.round(e.w+s*2),a=Math.round(e.h+s*2),c=e.x+e.w>n.w-kre,u=Math.round(e.x),f=Math.min(t.right,n.w),h=c?e.x+e.w:f-u-32,p=Math.max(wre,Math.min(yre,h)),m=i+a+Hp,y=m+Wp*2+16<=n.h,x=y?m:Math.round(i-Hp-Wp);return{ring:{x:o,y:i,w:l,h:a,r:gre({w:l,h:a})},text:{x:u,y:x,w:p,right:c?Math.round(n.w-(e.x+e.w)):null},below:y}}function bre(e,t,n,r){const s=n.filter(i=>i.bottom>e&&i.top<e+t);if(!s.length)return e;const o=Math.round(Math.max(...s.map(i=>i.bottom))+10);return o+t>r.h?e:o}const vre={task:"body",working:".list-pane",open:".list-pane",clear:".list-pane",snooze:".list-pane",answer:".focus-pane"},Up=10,Sre=".list-pane .row, .dock-card, .modal, .focus-actions",Wm="zero.firstRun",fv="zero.firstRun.done";function Cre(e,t){return typeof e=="string"&&fl.includes(e)?e:e==="note"?"clear":t?"landed":"welcome"}function Ere(e){try{const t=e.getItem(Wm);if(!t)return Ma;const n=JSON.parse(t);return{...Ma,...n,step:Cre(n.step,!!n.product)}}catch{return Ma}}function Nre(e,t){try{e.setItem(Wm,JSON.stringify(t))}catch{}}function Tre(e){try{e.setItem(fv,"1"),e.removeItem(Wm)}catch{}}function aA(e){try{return e.getItem(fv)==="1"}catch{return!1}}function Are(e){try{e.removeItem(fv),e.removeItem(Wm)}catch{}}const fl=["welcome","folder","name","inbox","away","goal","look","hand","make","task","working","open","answer","clear","snooze","unblock","where","command","done","landed"];function jre(e){const t=fl.indexOf(e);return t<0||t+1>=fl.length?null:fl[t+1]}function Mre(e){const t=fl.indexOf(e),n=fl.indexOf("look");return t>=0&&n>=0&&t<n}const Rre={inbox:0,away:1,goal:2},Ore=["make","task","working","open","answer","clear","snooze","unblock","where","command"];function hv(e){return!!e&&!!e.practice&&Ore.includes(e.step)}function Ire(e){return e?e==="1"?"welcome":fl.includes(e)?e:null:null}function Um(e){return e.user.length+e.project.length>0}function Dre(e){return!e||!Um(e)}function Lre(e,t){return t||e&&Um(e)?e:null}function Pre(e,t){return!e||Um(t)}function $re(e,t){return t||e&&e.some(n=>n.count>0)?e:null}function cA(e,t){const n=String(e??"").trim();if(/already exists/i.test(n))return Ee.takenName(t);if(/needs a name/i.test(n))return Ee.emptyName;const r=n.replace(/^Error invoking remote method '[^']*':\s*/i,"").replace(/^Error:\s*/i,"");return Ee.notMade(r?/[.!?]$/.test(r)?r:`${r}.`:"It did not say why.")}function uA(e,{filter:t=null,last:n=null}={}){var s;const r=o=>!!o&&e.some(i=>i.slug===o);return r(t)?t:r(n)?n:((s=e[0])==null?void 0:s.slug)??null}function kP(e,t){var n;return((n=e.find(r=>r.slug===t))==null?void 0:n.repoPath)??null}function Px(e,t){var n;return((n=e.find(r=>r.slug===t))==null?void 0:n.name)??""}function zre(e){return(e??"").replace(/^\/Users\/[^/]+/,"~")}const _re=["no","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"],es=e=>e>=0&&e<=10?_re[e]:String(e),ks={head:"Add the agents already on this Mac.",noProject:"Make a project first, and your agents can land in its inbox.",newProject:"New project…",headNone:"No agents to bring across yet.",noneWhere:e=>`Nothing in ${e}, and nothing in any folder you work in.`,noneLater:"When you have some, press ⌘K and type import.",lookAgain:"Look again",looking:"Looking",foot:"Each one you keep lands in your inbox, and your agent files stay where they are.",go:"Add them",reading:"Reading this Mac…"};function go(e){return[...e.items.map(t=>t.path),...(e.threads??[]).map(t=>t.path)]}function Vm(e,t){const n=t?new Set(t):null;let r=0,s=0;for(const o of e)r+=o.items.filter(i=>!n||n.has(i.path)).length,s+=(o.threads??[]).filter(i=>!n||n.has(i.path)).length;return{agents:r,threads:s}}function pv({agents:e,threads:t}){const n=(r,s)=>`${es(r).toLowerCase()} ${s}${r===1?"":"s"}`;return e&&t?`${n(e,"agent")} and ${n(t,"thread")}`:t?n(t,"thread"):n(e,"agent")}function Fre({found:e,folders:t=[],products:n=[],project:r=null,threads:s=[]}){const o=[],i=Px(n,r),l=kP(n,r);e!=null&&e.user.length&&o.push({key:"everywhere",kind:"everywhere",name:i,slug:r,folder:null,where:Js.homeFolder,items:e.user,threads:[]}),e!=null&&e.project.length&&r&&o.push({key:`project:${r}`,kind:"project",name:i,slug:r,folder:l,where:zre(l),items:e.project,threads:[]});const a=n.map(f=>f.name);for(const f of Hre(t,n)){const h=hA(f,a);a.push(h),o.push({key:`new:${f.folder}`,kind:"new",name:h,slug:null,folder:f.folder,where:f.short,items:f.agents??[],threads:[]})}const c=new Map(o.filter(f=>f.folder).map(f=>[aw(f.folder),f])),u=new Map(n.filter(f=>f.repoPath).map(f=>[aw(f.repoPath),f]));for(const f of s){const h=aw(f.folder);if(!h)continue;let p=c.get(h);if(!p){const m=u.get(h),y=m?{key:`project:${m.slug}`,kind:"project",name:m.name,slug:m.slug,folder:f.folder,where:f.short,items:[],threads:[]}:{key:`new:${f.folder}`,kind:"new",name:hA({name:f.folderName},a),slug:null,folder:f.folder,where:f.short,items:[],threads:[]};m||a.push(y.name),o.push(y),c.set(h,y),p=y}p.threads.push(f)}return o}const aw=e=>String(e??"").replace(/\/+$/,""),Js={everywhere:"Every project",homeFolder:"~/.claude/agents",landBefore:"They work everywhere, so their rows go to",landAfter:".",landNowhere:"They work everywhere. Make a project and they have an inbox.",newBadge:"New project",n:e=>String(e.length)};function dA({added:e=0,already:t=0,name:n="",inboxes:r=1,made:s=[],noun:o="agent"}){if(e===0&&t===0)return"Nothing was ticked, so nothing was filed.";const i=r>1,l=n?` ${n}`:"";if(e===0)return i?t===1?`That ${o} already has a row.`:`${es(t)} of them already have rows.`:t===1?`That ${o} already has a row in${l}.`:`${es(t)} of them already have rows in${l}.`;const a=e===1?"One row is":`${es(e)} rows are`,c=i?`${a} in ${es(r).toLowerCase()} inboxes.`:`${a} in your ${s.length===1?"new ":""}${n} inbox.`,u=i&&s.length?s.length===1?` ${s[0]} is new.`:` ${es(s.length)} of them are new.`:"";if(t===0)return`${c}${u}`;const f=t===1?" One already had one.":` ${es(t)} already had rows.`;return`${c}${f}${u}`}function Bre({read:e,picked:t,dests:n}){if(!e||t.length===0)return!1;const r=new Set(t);for(const s of n)if(go(s).some(o=>r.has(o))&&s.kind!=="new"&&!s.slug)return!1;return!0}function fA(e,t,n){const r=new Set(t);return r.has(n)?r.delete(n):r.add(n),e.flatMap(go).filter(s=>r.has(s))}function hA(e,t=[]){const n=((e==null?void 0:e.name)??"").trim();if(!n)return"";const r=/[A-Z\s]/.test(n)?n:n.replace(/[-_.]+/g," ").split(" ").filter(Boolean).map(o=>o.replace(/^\w/,i=>i.toUpperCase())).join(" "),s=new Set(t.map(cw));if(!s.has(cw(r)))return r;for(let o=2;o<100;o+=1)if(!s.has(cw(`${r} ${o}`)))return`${r} ${o}`;return r}function cw(e){return(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,40)}function Hre(e,t){const n=new Set(t.map(r=>(r.repoPath??"").replace(/\/+$/,"")).filter(Boolean));return e.filter(r=>!n.has(r.folder.replace(/\/+$/,"")))}const Mf={pick:"Choose which ones",pickWhy:"Pick a whole project, or single agents inside it.",never:`${Pn} never moves your agent files.`};function Wre(e){const t=Vm(e);return t.agents+t.threads===1?`Add the one ${t.threads?"thread":"agent"}`:`Add all ${pv(t)}`}function Ure(e,t){const n=go(e);if(n.length===0)return"none";const r=new Set(t),s=n.filter(o=>r.has(o)).length;return s===0?"none":s===n.length?"all":"some"}function Vre(e,t,n){const r=e.find(l=>l.key===n);if(!r)return t;const s=new Set(t),o=go(r),i=o.some(l=>s.has(l));for(const l of o)i?s.delete(l):s.add(l);return e.flatMap(go).filter(l=>s.has(l))}function pA(e){return e.flatMap(go)}function Kre(e){const t=Vm(e),n=e.length;if(t.agents+t.threads===0)return"";const r=pv(t),s=`${es(n).toLowerCase()} folder${n===1?"":"s"}`;return`${r[0].toUpperCase()}${r.slice(1)} in ${s}.`}function qre(e,t){return t.length===0?"Nothing ticked":`Add ${pv(Vm(e,t))}`}function Yre(e,t){const n=new Set(t);return e.filter(r=>r.kind==="new"&&go(r).some(s=>n.has(s))).map(r=>r.name)}function mA(e,t){const n=new Set(t),r=e.filter(l=>go(l).some(a=>n.has(a))).length,s=Yre(e,t);if(r===0)return"";const o=r===1?"":`${Pn} files them under ${es(r).toLowerCase()} projects.`,i=s.length===0?"":s.length===1?`${s[0]} becomes a new project.`:`${es(s.length)} of them become new projects.`;return[o,i].filter(Boolean).join(" ")}function Gre(e,t=Date.now()){const n=new Date(Number(e)||0);if(!Number.isFinite(n.getTime())||!e)return"";const r=o=>new Date(o.getFullYear(),o.getMonth(),o.getDate()).getTime(),s=Math.round((r(new Date(t))-r(n))/864e5);return s<=0?"today":s===1?"yesterday":s<7?`on ${n.toLocaleDateString("en-US",{weekday:"long"})}`:""}function Jre(e){return e==="codex"?"in Codex":e==="desktop"?"in the Claude Code desktop app":"in a terminal"}function Qre(){return d.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M4 12.5 9.5 18 20 6.5"})})}function Xre(){return d.jsx("svg",{className:"ia-caret",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"M9 5.5 16.5 12 9 18.5"})})}function xP({products:e,filter:t,walk:n,onDone:r,onNewProject:s,onProjectMade:o,onClose:i}){const l=(()=>{try{return localStorage.getItem("zero.lastProduct")}catch{return null}})(),[a,c]=w.useState(()=>uA(e,{filter:t,last:l})),[u,f]=w.useState(null),[h,p]=w.useState([]),[m,y]=w.useState(!1),[x,k]=w.useState(!1),[v,b]=w.useState(n?n.folders:null),[E,N]=w.useState(null),[T,A]=w.useState([]),[R,$]=w.useState("door"),[L,_]=w.useState([]),j=w.useMemo(()=>[...e,...T.filter(oe=>!e.some(P=>P.slug===oe.slug))],[e,T]),F=kP(j,a),ae=Px(j,a);w.useEffect(()=>{if(a&&j.some(P=>P.slug===a))return;const oe=uA(j,{filter:t,last:l});oe&&oe!==a&&c(oe)},[j,t,l,a]);const G=n==null?void 0:n.folders;w.useEffect(()=>{if(n){b(G??null);return}let oe=!0;return(async()=>{const P=await q.agentFolders();oe&&b(P)})(),()=>{oe=!1}},[n,G]),w.useEffect(()=>{let oe=!0;return(async()=>{const P=await q.agentThreads();oe&&N(P)})(),()=>{oe=!1}},[]),w.useEffect(()=>{let oe=!0;return f(null),(async()=>{const P=await q.agentFiles({folder:F,product:a});oe&&f({user:P.user,project:P.project})})(),()=>{oe=!1}},[F,a]);const I=w.useMemo(()=>Fre({found:u,folders:v??[],products:j,project:a,threads:E??[]}),[u,v,j,a,E]),ne=w.useMemo(()=>new Set(h),[h]),B=I.length>0,J=!!u&&!!v&&E!==null,M=Bre({read:J,picked:h,dests:I}),[Q,ce]=w.useState(!1),C=w.useCallback(async()=>{if(!Q){ce(!0);try{const[oe,P]=await Promise.all([q.agentFiles({folder:F,product:a}),q.agentFolders()]);f({user:oe.user,project:oe.project}),b(P)}finally{ce(!1)}}},[Q,F,a]),re=w.useCallback(async oe=>{if(!(m||oe.length===0)){y(!0);try{const P=new Set(oe),ee=new Map,Ae=[];for(const be of I){const Ye=be.items.filter(Jt=>P.has(Jt.path)).map(Jt=>Jt.name),rt=(be.threads??[]).filter(Jt=>P.has(Jt.path)).map(Jt=>Jt.id);if(!(!Ye.length&&!rt.length)){if(be.kind==="new"&&be.folder)Ae.push({folder:be.folder,name:be.name,load:{names:Ye,ids:rt}});else if(be.slug){const Jt=ee.get(be.slug)??{names:[],ids:[]};ee.set(be.slug,{names:[...Jt.names,...Ye],ids:[...Jt.ids,...rt]})}}}let We=0,Je=0,wt=0,un="";const dt=[],Cn=async(be,Ye)=>{if(Ye.names.length){const rt=await q.importAgents({product:be,agents:Ye.names});We+=rt.added,Je+=rt.already}if(Ye.ids.length){const rt=await q.importThreads({product:be,threads:Ye.ids});We+=rt.added,Je+=rt.already}wt+=1};for(const[be,Ye]of ee)await Cn(be,Ye),un=Px(j,be);for(const be of Ae){let Ye=null;try{const rt=await q.createProduct({name:be.name,repoPath:be.folder});Ye=(rt==null?void 0:rt.slug)??null}catch{Ye=null}Ye&&(dt.push(be.name),A(rt=>[...rt,{slug:Ye,name:be.name,repoPath:be.folder}]),o==null||o(Ye),await Cn(Ye,be.load),un=be.name)}const Ut=Vm(I,oe);r({added:We,already:Je,name:wt===1?un:"",inboxes:wt,made:dt,noun:Ut.agents?"agent":"thread"})}finally{y(!1)}}},[m,I,j,r,o]),W=w.useCallback(()=>re(pA(I)),[re,I]);w.useEffect(()=>{const oe=P=>{if(P.key==="Escape"){if(P.preventDefault(),x){k(!1);return}if(R==="pick"){$("door");return}if(n)return;i();return}if(P.key==="Enter"&&(P.metaKey||P.ctrlKey)){if(P.preventDefault(),n&&!B){n.onSkip();return}R==="door"?W():M&&re(h)}};return window.addEventListener("keydown",oe),()=>window.removeEventListener("keydown",oe)},[re,W,h,x,M,R,B,n,i]);const V=w.useRef(null),[Se,ye]=w.useState(0),De=w.useCallback(()=>{const oe=V.current;if(!oe){ye(0);return}const P=oe.getBoundingClientRect(),ee=[...oe.querySelectorAll("[data-sec]")];ye(ee.filter(Ae=>Ae.getBoundingClientRect().top+10>P.bottom).length)},[]);w.useEffect(()=>{De()});const Te=Se>0&&d.jsxs("button",{className:"ia-more",onClick:()=>{const oe=V.current;oe&&oe.scrollBy({top:oe.clientHeight-44,behavior:"smooth"})},children:[es(Se)," more below"]}),le=Kre(I),K=oe=>Ure(oe,h),me=oe=>p(Vre(I,h,oe.key)),U=oe=>L.includes(oe),we=oe=>_(P=>P.includes(oe)?P.filter(ee=>ee!==oe):[...P,oe]),Oe=oe=>oe.kind==="everywhere"?Js.everywhere:oe.name,Ie=mA(I,h),ct=({s:oe})=>d.jsxs("span",{className:`ia-box is-${oe}`,"aria-hidden":"true",children:[oe==="all"&&d.jsx(Qre,{}),oe==="some"&&d.jsx("span",{className:"ia-half"})]}),se=oe=>{const P=ne.has(oe.path);return d.jsxs("button",{className:P?"ia-agent on":"ia-agent","aria-pressed":P,onClick:()=>p(fA(I,h,oe.path)),children:[d.jsx(ct,{s:P?"all":"none"}),d.jsxs("span",{className:"ia-agent-text",children:[d.jsx("span",{className:"ia-agent-name",children:oe.title}),oe.line&&d.jsx("span",{className:"ia-agent-line",children:oe.line})]})]},oe.path)},he=oe=>{const P=ne.has(oe.path),ee=Gre(oe.when),Ae=`${Jre(oe.source)}${ee?`, ${ee}`:""}`;return d.jsxs("button",{className:P?"ia-agent on":"ia-agent","aria-pressed":P,onClick:()=>p(fA(I,h,oe.path)),children:[d.jsx(ct,{s:P?"all":"none"}),d.jsxs("span",{className:"ia-agent-text",children:[d.jsx("span",{className:"ia-agent-name",children:oe.title}),d.jsx("span",{className:"ia-agent-line",children:`${Ae[0].toUpperCase()}${Ae.slice(1)}`})]})]},oe.path)},ve=oe=>d.jsxs("span",{className:"ia-goes",children:[j.length>0?d.jsxs(d.Fragment,{children:[Js.landBefore," ",d.jsx("button",{type:"button",className:"ia-word","aria-expanded":x,onClick:P=>{P.stopPropagation(),j.length>1&&k(ee=>!ee)},children:ae}),Js.landAfter]}):Js.landNowhere,x&&j.length>1&&d.jsx("span",{className:"ia-projects",role:"listbox",children:j.map(P=>d.jsx("button",{role:"option","aria-selected":P.slug===a,className:P.slug===a?"ia-project on":"ia-project",onClick:ee=>{ee.stopPropagation(),k(!1),c(P.slug)},children:P.name},P.slug))})]}),He=d.jsxs("div",{className:"ia-doors",children:[d.jsxs("button",{className:"ia-door is-first",onClick:W,disabled:m,children:[d.jsxs("span",{className:"ia-door-name",children:[Wre(I),d.jsx("kbd",{children:"⌘↵"})]}),d.jsx("span",{className:"ia-door-why",children:mA(I,pA(I))||ks.foot})]}),d.jsxs("button",{className:"ia-door",onClick:()=>$("pick"),children:[d.jsx("span",{className:"ia-door-name",children:Mf.pick}),d.jsx("span",{className:"ia-door-why",children:Mf.pickWhy})]}),d.jsx("p",{className:"ia-read",children:Mf.never})]}),tt=d.jsxs(d.Fragment,{children:[d.jsx("div",{className:Se>0?"ia-scroll ia-stack ia-fading":"ia-scroll ia-stack",ref:V,onScroll:De,children:I.map(oe=>d.jsxs("div",{className:U(oe.key)?"ia-blk open":"ia-blk","data-sec":"",children:[d.jsxs("div",{className:"ia-blk-head",children:[d.jsx("button",{className:"ia-pick",onClick:()=>me(oe),"aria-label":`Keep everything in ${Oe(oe)}`,children:d.jsx(ct,{s:K(oe)})}),d.jsxs("button",{className:"ia-blk-main",onClick:()=>we(oe.key),"aria-expanded":U(oe.key),children:[d.jsxs("span",{className:"ia-blk-line",children:[d.jsx("span",{className:"ia-blk-name",children:Oe(oe)}),oe.kind==="new"&&d.jsx("span",{className:"ia-tag",children:Js.newBadge}),d.jsx("span",{className:"ia-blk-n",children:Js.n(go(oe))}),d.jsx(Xre,{})]}),d.jsx("span",{className:"ia-blk-where",children:oe.kind==="everywhere"?d.jsxs(d.Fragment,{children:[Js.homeFolder,". ",ve()]}):oe.where})]})]}),U(oe.key)&&d.jsxs("div",{className:"ia-blk-list",children:[oe.items.map(se),(oe.threads??[]).map(he)]})]},oe.key))}),Te]}),Ct=R==="pick"?tt:He;return d.jsx("div",{className:"modal-backdrop compose-backdrop",onClick:n?void 0:i,children:d.jsxs("div",{className:`modal ia-card on-${R}${n?" in-walk":""}`,onClick:oe=>oe.stopPropagation(),children:[d.jsxs("div",{className:"ia-top",children:[R==="pick"?d.jsx("button",{className:"ia-back",onClick:()=>$("door"),children:Mf.pick}):d.jsx("h1",{className:"ia-head",children:J&&!B?ks.headNone:ks.head}),J&&B&&d.jsx("div",{className:"ia-top-right",children:d.jsx("span",{className:"ia-total",children:le})})]}),n&&R==="door"&&B&&d.jsx("p",{className:"ia-offer",children:n.line}),!J&&d.jsx("div",{className:"ia-empty",children:ks.reading}),J&&!B&&d.jsxs("div",{className:"ia-none",children:[d.jsx("p",{className:"ia-none-where",children:ks.noneWhere(Js.homeFolder)}),d.jsx("p",{className:"ia-none-later",children:ks.noneLater}),d.jsx("button",{type:"button",className:"ia-look-again",onClick:C,disabled:Q,children:Q?ks.looking:ks.lookAgain})]}),J&&B&&Ct,J&&B&&j.length===0&&!I.some(oe=>oe.kind==="new")&&d.jsxs("p",{className:"ia-line",children:[ks.noProject," ",d.jsx("button",{type:"button",className:"ia-word",onClick:s,children:ks.newProject})]}),J&&B&&R==="pick"&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"ia-read",children:[Ee.agentsRead,Ie&&d.jsxs(d.Fragment,{children:[" ",Ie]})]}),d.jsx("div",{className:"ia-foot",children:d.jsxs("button",{className:"dock-send",disabled:!M||m,onClick:()=>re(h),children:[qre(I,h)," ",d.jsx("kbd",{children:"⌘↵"})]})})]}),n&&R==="door"&&d.jsx("button",{type:"button",className:"ia-walk-on",onClick:n.onSkip,disabled:m,children:n.skip})]})})}function Zre(e,t,n=Date.now()){return t.filter(r=>um(r)===e.id).sort((r,s)=>s.createdAt-r.createdAt).map(r=>{const s=dm(r),o=r.status==="open"||r.status==="claimed";return{id:r.id,when:_h(r.createdAt,n),what:o?"running":s?"clean":r.result||"finished without saying anything",news:!o&&!s,late:ese(e,r)}})}function ese(e,t,n){const r=v4(e,t.createdAt);if(!r)return null;const[s,o,i]=r.split("-").map(Number),[l,a]=e.at.split(":").map(Number),c=new Date(s,o-1,i,l,a,0,0).getTime();return t.createdAt-c<15*6e4?null:`ran ${Yo(c,t.createdAt)} late`}function tse(e){return`${new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})} ${fm(e).toLowerCase()}`}function nse({rule:e,items:t,editing:n,onClose:r,onEdit:s,onEditClose:o,onSave:i,onEnd:l}){const a=Zre(e,t),c=kR(e),u=new Date(`2026-01-01T${e.at}:00`).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),f=ine(e);return d.jsxs("div",{className:"focus-pane",children:[d.jsx("div",{className:"focus-scroll",children:d.jsxs("div",{className:"focus",children:[d.jsxs("div",{className:"focus-head",children:[d.jsxs("button",{className:"back-esc in-head",onClick:r,"aria-label":"Back",children:[d.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:d.jsx("path",{d:"M10 3.5L5.5 8l4.5 4.5"})}),d.jsx("span",{children:"esc"})]}),d.jsxs("div",{children:[d.jsx("div",{className:"focus-title",children:e.title}),d.jsxs("div",{className:"focus-meta",children:[d.jsx("span",{children:e.productName}),d.jsx("span",{children:"·"}),d.jsxs("span",{children:["daily at ",u]}),c&&d.jsxs(d.Fragment,{children:[d.jsx("span",{children:"·"}),d.jsxs("span",{children:["next ",tse(c)]})]})]})]})]}),e.body&&d.jsx("div",{className:"focus-body",children:d.jsx("div",{className:"markdown",children:d.jsx(Lc,{remarkPlugins:[ru],children:e.body})})}),d.jsxs("div",{className:"runs",children:[a.length===0&&d.jsx("div",{className:"run",children:d.jsx("span",{className:"run-what",children:"It has not run yet."})}),a.map(h=>d.jsxs("div",{className:"run",children:[d.jsx("span",{className:"run-when",children:h.when}),d.jsxs("span",{className:h.news?"run-what news":"run-what",children:[h.what,h.late?` · ${h.late}`:""]})]},h.id))]}),d.jsx("div",{className:"runs-note",children:"The runs still on file."})]})}),d.jsx("div",{className:"focus-dock",children:d.jsxs("div",{className:"focus-dock-inner",children:[d.jsx("div",{className:"dock-card",children:n?d.jsx(rse,{message:f,onSave:i,onClose:o}):d.jsxs("button",{className:"dock-pill",onClick:s,children:[d.jsx("span",{className:"dock-pill-text",children:"Change what it does…"}),d.jsx("span",{className:"dock-pill-key",children:d.jsx("kbd",{children:"R"})})]})}),d.jsx("button",{className:"rule-end",onClick:l,children:"End this repeating task"})]})})]})}function rse({message:e,onSave:t,onClose:n}){const[r,s]=w.useState(e),o=w.useRef(null);w.useEffect(()=>{const a=o.current;a&&(a.focus(),a.setSelectionRange(a.value.length,a.value.length),a.scrollTop=a.scrollHeight)},[]);const i=r.trim()!==e.trim(),l=()=>{i&&r.trim()&&t(r.trim())};return d.jsxs(d.Fragment,{children:[d.jsx("textarea",{className:"dock-input rule-input",ref:o,value:r,onChange:a=>s(a.target.value),placeholder:"What should it do every time?",onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&l(),a.key==="Escape"&&(a.stopPropagation(),n())}}),d.jsxs("div",{className:"compose-sentence",children:[d.jsx("span",{className:"compose-clauses",children:d.jsx("span",{className:"dim",children:"Every run after this one reads this."})}),d.jsxs("button",{className:"dock-send",onClick:l,disabled:!i||!r.trim(),title:"Save · ⌘↵",children:["Save ",d.jsx("kbd",{children:"⌘↵"})]})]})]})}function sse(e){const t=new Map;return e.map(n=>{const r=t.get(n.id)??0;return t.set(n.id,r+1),r?`${n.id}#${r}`:n.id})}function ose(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ise(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const t=window.matchMedia("(prefers-color-scheme: dark)"),n=()=>e(t.matches?"dark":"light");return t.addEventListener("change",n),()=>t.removeEventListener("change",n)}function Ra(e){return e==="light"||e==="dark"?e:e==="match"?ose():"dark"}function lse(e){return e==="light"||e==="dark"||e==="match"?e:"dark"}const Qo="zero.theme";function Bc(e,t=document.documentElement){t.setAttribute("data-theme",e)}const tn=[{id:"ember-grid",name:"Ember Grid",note:"The launch film’s look. A warm dark grey, a faint dot grid, square corners and one orange."},{id:"valley-haze",name:"Valley Haze",note:"The gouache valley, thrown out of focus. A blurred warm wash, edge to edge."},{id:"frost-haze",name:"Frost Haze",note:"Paper cooled toward blue. Light, with a cold edge to it.",light:!0},{id:"slate-haze",name:"Slate Haze",note:"A cool mid ground with a pale card on it. Between the two ends.",light:!0},{id:"lake",name:"Lake",note:"The landing page’s photograph, in dark mode."},{id:"ice",name:"Ice",note:"Blue daylight entering a glacier cave from the right."},{id:"pixel-ridge",name:"Pixel Ridge",note:"Pixel art. Flat ridges into a low sun, pixel conifers on the near cliff."},{id:"peach-haze-2",name:"Peach Haze",note:"A diagonal peach glow across a sage and mauve wash.",light:!0},{id:"orbital-glass",name:"Orbital Glass",note:"A ringed planet through clear glass, with quiet gray text."},{id:"pixel-orbit",name:"Pixel Orbit",note:"Pixel art. A ringed planet low over a dark plain."},{id:"woodblock-sea",name:"Woodblock Sea",note:"A Japanese woodblock print. Pines on a headland, the sun on the water."},{id:"riso-hills",name:"Riso Hills",note:"A two colour risograph print in blue and coral ink."},{id:"gouache-valley",name:"Gouache Valley",note:"A painted animation background in gouache. A valley and a still river."},{id:"watercolour-mist",name:"Watercolor Mist",note:"A wet on wet watercolour. Five washes of mountain into mist."}],zr="zero.skin";function ba(e){return tn.some(t=>t.id===e)?e:"none"}function ase(e){var t;return((t=tn.find(n=>n.id===e))==null?void 0:t.name)??"None"}function cse(e,t){return t==="none"?e:t}const Ns=[...tn.map(e=>({id:e.id,name:e.name})),{id:"light",name:"Light"},{id:"dark",name:"Dark"}];function use(e,t=Ra("match")){const n=e.getItem(Qo),r=e.getItem(zr);if(r==="peach-haze"){e.setItem(Qo,"light"),e.setItem(zr,"peach-haze-2");return}if(n===null&&r===null){const o=as(ed);e.setItem(Qo,o.theme),e.setItem(zr,String(o.skin));return}if(n==="match"||r===null||["ice-river","lake-harbour","moon-pines","cel-dusk","pixel-harbour","vector-dunes","lino-coast"].includes(r)){const o=n==="match"?t:Ra(n),i=r&&ba(r)!=="none"?as(r):as(o==="light"?"frost-haze":"valley-haze");e.setItem(Qo,i.theme),e.setItem(zr,i.skin)}}function as(e){var t;return e==="light"?{theme:"light",skin:"none"}:e==="dark"?{theme:"dark",skin:"none"}:e==="match"?{theme:"match",skin:"none"}:{theme:(t=tn.find(n=>n.id===e))!=null&&t.light?"light":"dark",skin:e}}function Hc(e,t=document.documentElement){e==="none"?t.removeAttribute("data-skin"):t.setAttribute("data-skin",e)}function gA(e,t=document.documentElement){e==="soft"?t.setAttribute("data-skin-detail","soft"):t.removeAttribute("data-skin-detail")}function yA(e){return e==="soft"?"soft":"sharp"}const Lo="zero.skin.tune",Fr={panelOpacity:{min:0,max:1,step:.01},backgroundBlur:{min:0,max:80,step:1},blur:{min:0,max:80,step:1},dim:{min:0,max:.85,step:.01}},On={lake:{blur:8,backgroundBlur:5,dim:.63},ice:{blur:2,dim:.85},"ice-river":{blur:2,dim:.735},"lake-harbour":{blur:2,dim:.68},"pixel-ridge":{blur:4,backgroundBlur:6,dim:.77},"pixel-orbit":{blur:0,backgroundBlur:5,dim:.2},"woodblock-sea":{blur:4,backgroundBlur:12,dim:.84},"riso-hills":{blur:2,backgroundBlur:3,dim:.85},"gouache-valley":{blur:4,backgroundBlur:5,dim:.75},"vector-dunes":{blur:2,dim:.775},"watercolour-mist":{blur:2,backgroundBlur:4,dim:.85},"orbit-rings":{blur:2,dim:0},"moon-pines":{blur:2,dim:0},"cel-dusk":{blur:2,dim:0},"pixel-harbour":{blur:2,dim:0},"lino-coast":{blur:2,dim:.85},"valley-haze":{blur:2,dim:0},"frost-haze":{blur:2,dim:0},"slate-haze":{blur:2,dim:0},"orbital-glass":{blur:30,dim:.3,backgroundBlur:24,panelOpacity:.16},"peach-haze-2":{blur:0,dim:.35,backgroundBlur:0,panelOpacity:.2},"ember-grid":{blur:0,dim:0}},dse=(e,t,n)=>e<t?t:e>n?n:e;function na(e,t){const n=On[t]??On.lake;let r;try{r=e?JSON.parse(e):null}catch{return n}const s=r==null?void 0:r[t];if(!s||typeof s!="object")return n;const o=(i,l,a)=>typeof i=="number"&&Number.isFinite(i)?dse(i,a.min,a.max):l;return{...s.backgroundBlur!==void 0||n.backgroundBlur!==void 0?{backgroundBlur:s.backgroundBlur===void 0?n.backgroundBlur:o(s.backgroundBlur,0,Fr.backgroundBlur)}:{},...n.panelOpacity!==void 0?{panelOpacity:o(s.panelOpacity,n.panelOpacity,Fr.panelOpacity)}:{},blur:o(s.blur,n.blur,Fr.blur),dim:o(s.dim,n.dim,Fr.dim)}}function fse(e,t,n){let r={};try{const s=e?JSON.parse(e):null;s&&typeof s=="object"&&(r=s)}catch{}return JSON.stringify({...r,[t]:n})}function ra(e,t=document.documentElement){t.style.setProperty("--skin-panel-opacity",e.panelOpacity===void 0?"":String(e.panelOpacity)),t.style.setProperty("--skin-background-blur",`${e.backgroundBlur??0}px`),t.style.setProperty("--skin-blur",`${e.blur}px`),t.style.setProperty("--skin-dim",String(e.dim))}const ed="ember-grid";function bP(e){return e==="none"||e===ed?$x:e}const $x="gouache-valley";function hse(e,t){if(e.getItem(t)!==null||e.getItem(zr)!==null)return null;const n=as(ed);return e.setItem(t,n.theme),e.setItem(zr,String(n.skin)),n}function pse(e,t){const n=e.trim().toLowerCase().split(/\s+/).filter(Boolean);if(!n.length)return!0;const r=`${t.label} ${t.keywords??""}`.toLowerCase();return n.every(s=>r.includes(s))}const mse=["snooze"];function gse(e,t){if(!e.trim())return t;const n=r=>mse.includes(r.id)?0:1;return[...t].sort((r,s)=>n(r)-n(s))}const yse="light mode dark mode appearance colours colors";function wse(e){const t=[],n=e!=="light"&&e!=="dark"&&e!=="match";t.push({id:"theme-picker",label:"Themes…",hint:"all of them at once, without leaving this screen",keywords:"theme themes background picture photo wallpaper appearance skin look",opens:"themes"});const r=as(e).theme==="light"?"valley-haze":"frost-haze";return t.push({id:"theme",label:r==="valley-haze"?"Switch to dark":"Switch to light",hint:"themes",keywords:yse,to:r}),n&&t.push({id:"theme-off",label:`Turn off ${ase(e)}`,hint:"back to plain dark, no picture",keywords:"theme background picture photo wallpaper appearance",to:"dark"}),t}const wA=32;function kse(e){const t=e.trim();let n=t;if(t.length>wA){const r=t.slice(0,wA),s=r.lastIndexOf(" ");n=`${(s>0?r.slice(0,s):r).trimEnd()}…`}return`Nothing matches “${n}”.`}function xse({products:e,supervisorPaused:t,itemCommands:n=[],batch:r=!1,order:s=[],look:o,onSetLook:i,onThemes:l,staleFiles:a=[],updateReady:c=null,onInstallUpdate:u,filtering:f=!1,onOpenFilter:h,onClearFilter:p,onView:m,onPause:y,onResume:x,onRankFirst:k,onNewProject:v,onStanding:b,onSettings:E,onShortcuts:N,panelUp:T,onTogglePanel:A,keyHints:R,onSetKeyHints:$,onSearch:L,onFirstRun:_,onTutorial:j,onImportAgents:F,onFreshUser:ae,onDemo:G,onClose:I}){const[ne,B]=w.useState(""),[J,M]=w.useState(0),Q=w.useRef(null);w.useEffect(()=>{var W;return(W=Q.current)==null?void 0:W.focus()},[]);const ce=w.useMemo(()=>[{id:"new-project",label:"New project…",hint:"name it, and it is yours",run:v},...n,{id:"filter",label:"Filter…",hint:"Project, priority or agent",run:h},...f?[{id:"clear-filter",label:"Clear filter",run:p}]:[],...e.map((W,V)=>({id:`rank-${W.slug}`,label:`Rank ${W.name} first`,hint:s.includes(W.slug)?`now #${V+1} of ${e.length}`:"not ranked yet",run:()=>k(W.slug)})),{id:"search",label:"Search tasks",keyHint:"/",run:L},{id:"view-inbox",label:"Inbox",run:()=>m("inbox")},{id:"view-progress",label:"In progress",run:()=>m("progress")},{id:"view-done",label:"Closed",run:()=>m("done")},...wse(o).map(W=>({id:W.id,label:W.label,hint:W.hint,keywords:W.keywords,run:W.opens==="themes"?l:()=>i(W.to)})),...c?[{id:"update",label:`Restart to update ${Le}`,hint:`version ${c} has downloaded · restarting puts you back where you were`,keywords:"update upgrade new version restart",run:()=>u==null?void 0:u()}]:[],...a.length?[{id:"stale",label:`Restart ${Le} to pick up main-process changes`,hint:`${a.length} file${a.length===1?"":"s"} changed since this one started · ⌘R will not pick them up`,run:()=>{}}]:[],{id:"pause",label:t?"Unpause agents":"Pause agents",hint:t?"sessions will spawn again":"no new sessions spawn",run:()=>y(!t)},...r?[]:[{id:"resume-stopped",label:"Resume interrupted agents",hint:"respawn work stranded by a usage limit or crash",run:x}],{id:"standing",label:"General agent instructions…",hint:"every agent, every task",keywords:"standing instructions rules your my brief guidelines preferences every agent every session tell agents dont do",run:b},{id:"settings",label:"Settings…",hint:"the workspace, and every project",run:E},{id:"shortcuts",label:"Keyboard shortcuts",hint:`every key ${Le} has`,keywords:"keys keyboard shortcut hotkeys commands cheatsheet help what does press bindings",run:N},{id:"panel",label:T?"Collapse sidebar":"Expand sidebar",hint:"what this product is, and what else is open on it",keyHint:"\\",run:A},{id:"import-agents",label:"Import your Claude Code agents",hint:"the ones already on this Mac · they land in your inbox",keywords:"import agents claude code subagents existing mine bring across add my",run:F},{id:"tutorial",label:"Take the tutorial",hint:"a pretend project · nothing is kept",keywords:"tutorial practice practise walkthrough walk tour again show me around teach learn training how does this work sandbox lesson",run:j},{id:"first-run",label:`Set ${Le} up again`,hint:"from the welcome screen · makes a project",keywords:"onboarding first run new user welcome intro setup start over from scratch install fresh",run:_},{id:"demo",label:"Open a demo inbox",hint:"invented work · yours keeps running",keywords:"demo demonstration present presentation pitch investor customer screen share screenshare record video sample fake example stage not mine hide my work",run:G},{id:"fresh-user",label:`Open ${Le} as a new user`,hint:"nothing set up · yours keeps running",keywords:"new user fresh install stranger onboarding first run clean empty blank test website download nothing of mine agents claude code sessions",run:()=>ae(!1)},{id:"keyhints",label:R?"Turn off keyboard shortcut hints":"Turn on keyboard shortcut hints",hint:"the keys a row and the tabs offer, drawn when you point at them",run:()=>$(!R)}],[n,r,e,t,s,v,f,h,p,m,y,x,k,b,E,N,o,i,l,a,c,u,T,A,R,$,L,_,j,F,ae,G]),C=w.useMemo(()=>{const W=ne.trim().toLowerCase();return W?gse(W,ce.filter(V=>pse(W,V))):ce},[ce,ne]),re=w.useMemo(()=>sse(C),[C]);return w.useEffect(()=>M(0),[ne]),d.jsx("div",{className:"modal-backdrop palette-backdrop",onClick:I,children:d.jsxs("div",{className:"modal palette",onClick:W=>W.stopPropagation(),children:[d.jsx("input",{ref:Q,className:"palette-input",value:ne,onChange:W=>B(W.target.value),placeholder:"Type a command…",onKeyDown:W=>{W.key==="Escape"&&I(),W.key==="ArrowDown"&&(W.preventDefault(),M(V=>Math.max(0,Math.min(V+1,C.length-1)))),W.key==="ArrowUp"&&(W.preventDefault(),M(V=>Math.max(0,V-1))),W.key==="Enter"&&C[J]&&C[J].run()}}),d.jsxs("div",{className:"palette-list",children:[C.length===0&&d.jsx("div",{className:"palette-empty",children:kse(ne)}),C.map((W,V)=>d.jsxs("div",{className:`palette-item ${V===J?"selected":""}`,onClick:W.run,onMouseEnter:()=>M(V),children:[d.jsx("span",{children:W.label}),W.keyHint?d.jsx("span",{className:"palette-key",children:W.keyHint}):W.hint&&d.jsx("span",{className:"palette-hint",children:W.hint})]},re[V]))]})]})})}const uw=`quit and reopen ${Le} to edit these`,bse=e=>/No handler registered/i.test(e),vP={sentence:"General agent instructions. Every agent reads them before your task, on every project.",placeholder:"Don't hand me summary .md files. Put the answer on the work item.",reader:()=>{var e;return(e=window.zero)==null?void 0:e.standingRead},writer:()=>{var e;return(e=window.zero)==null?void 0:e.standingWrite}};function vse({kind:e=vP,onClose:t}){const[n,r]=w.useState(null),[s,o]=w.useState("idle"),[i,l]=w.useState(null),a=w.useRef(null),c=w.useRef(null),u=w.useRef(null);w.useEffect(()=>{const y=e.reader();if(!y){r(""),o("failed"),l(uw);return}y().then(x=>{r((x==null?void 0:x.text)??""),x!=null&&x.error&&(o("failed"),l(x.error))}).catch(()=>{r(""),o("failed"),l(uw)})},[]),w.useEffect(()=>{if(n===null)return;const y=a.current;y&&(y.focus(),y.setSelectionRange(0,0),y.scrollTop=0)},[n!==null]);const f=async y=>{o("saving");try{const x=e.writer();if(!x)throw new Error("this window cannot reach the instructions file");const k=await x({text:y});if(k&&k.ok===!1)throw new Error(k.error||"could not save");u.current=null,o("saved"),l(null)}catch(x){const k=String((x==null?void 0:x.message)??x);o("failed"),l(bse(k)?uw:k)}},h=y=>{r(y),u.current=y,o("saving"),c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>f(y),400)},p=()=>{c.current&&window.clearTimeout(c.current),u.current!==null?f(u.current).finally(t):t()},m=s==="failed"?i??"not saved":s==="saving"?"saving…":s==="saved"?"saved":e.sentence;return d.jsx("div",{className:"modal-backdrop compose-backdrop",onClick:p,children:d.jsxs("div",{className:"modal compose rules-card",onClick:y=>y.stopPropagation(),children:[d.jsx("textarea",{ref:a,className:"rules-text",spellCheck:!1,value:n??"",placeholder:n===null?"loading…":e.placeholder,disabled:n===null,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),p()),y.stopPropagation()}}),d.jsxs("div",{className:"rules-sentence",children:[d.jsx("span",{className:"rules-clauses",children:m}),d.jsxs("button",{type:"button",className:"dock-send",onClick:p,children:["Done ",d.jsx("kbd",{children:"esc"})]})]})]})})}const Sse=`This is about the LAST message you send, the one that ends your run. Whoever
351
351
  asked for it reads it in a list beside twenty others and usually decides what to
352
352
  do next without opening anything. Ten seconds is the real budget.
353
353
 
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Agentbox</title>
7
- <script type="module" crossorigin src="./assets/index-D9hCAVPl.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-B7hhfHrT.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="./assets/index-CwiDv5bL.css">
9
9
  </head>
10
10
  <body>