droidsembly 0.4.0-beta.4 → 0.4.0-beta.6
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.it.md +16 -5
- package/README.md +15 -5
- package/bin/cubefarm.js +2 -296
- package/bin/droidsembly.js +304 -0
- package/bin/environment.d.ts +3 -0
- package/bin/environment.js +48 -0
- package/dist/assets/AccessibilitySettings-BLUQhCir.js +32 -0
- package/dist/assets/{AccessibilitySettings-HrzBDUTN.css → AccessibilitySettings-DGcxiTfe.css} +1 -1
- package/dist/assets/{AppViewer-CqGa1r0z.js → AppViewer-CkRhHzAg.js} +2 -2
- package/dist/assets/{Balloon-dO9J4khp.js → Balloon-CyA9jx7L.js} +1 -1
- package/dist/assets/{Batched-CmXZtCvQ.js → Batched-BnwN-jIb.js} +1 -1
- package/dist/assets/{Birds-D51xGT0l.js → Birds-T-cAlNXa.js} +1 -1
- package/dist/assets/{Blimp-C2c_AKRR.js → Blimp-D5lM1i8g.js} +1 -1
- package/dist/assets/{BufferGeometryUtils-Dcu0heeS.js → BufferGeometryUtils-BQuR3FyE.js} +1 -1
- package/dist/assets/{Duck-CzFiUF6U.js → Duck-Df57hNLp.js} +1 -1
- package/dist/assets/{Effects-DwOi-gSQ.js → Effects-BkJu9eYu.js} +1 -1
- package/dist/assets/{Fireworks-Cc2mGzPJ.js → Fireworks-BB1Mfdb3.js} +1 -1
- package/dist/assets/{Helicopter-ltB-x8hG.js → Helicopter-B5NObfW4.js} +1 -1
- package/dist/assets/{Hurricane-C2qHsRw4.js → Hurricane-CGsnFbNg.js} +1 -1
- package/dist/assets/{Kaiju-DPHVjFjg.js → Kaiju-5SPvHn_6.js} +1 -1
- package/dist/assets/{Meteors-CxcguXTJ.js → Meteors-rA1sR1A3.js} +1 -1
- package/dist/assets/{MissionConsole-BUE2mijT.js → MissionConsole-zJYkK_M1.js} +1 -1
- package/dist/assets/{Office-NV5zlSnK.js → Office-fRdJ34l-.js} +44 -44
- package/dist/assets/{PhotoPanel-CDqgU99Z.js → PhotoPanel-DiplEiL_.js} +1 -1
- package/dist/assets/{PhotoScene-RRXC4_Jv.js → PhotoScene-DG1ui0Av.js} +3 -3
- package/dist/assets/{Plane-BQB72TWZ.js → Plane-CtJDMF4A.js} +1 -1
- package/dist/assets/Pocket-x37KplGU.js +2 -0
- package/dist/assets/{Rainbow-DIpZi5-z.js → Rainbow-Bbqcvhxa.js} +1 -1
- package/dist/assets/{Roof-Cd9I0jtG.js → Roof-DP8gTSp6.js} +1 -1
- package/dist/assets/{Shell-DCqHgrm_.js → Shell-BzhH2Tnv.js} +2 -2
- package/dist/assets/{Skywriting-BH6FCdEl.js → Skywriting-CDweiNEJ.js} +1 -1
- package/dist/assets/TerminalView-CZkLeOi6.js +17 -0
- package/dist/assets/{ToyWorld--k4uqi9k.js → ToyWorld-ZLc2l8lQ.js} +1 -1
- package/dist/assets/{Ufo-C5cYunS9.js → Ufo-CQvPbWUN.js} +1 -1
- package/dist/assets/{Whale-BAXeezd8.js → Whale-Mz6Mfxvb.js} +1 -1
- package/dist/assets/all-AJNOOWx8.js +11 -0
- package/dist/assets/{bloomMarks-JYeAmd4d.js → bloomMarks-CWsszTY1.js} +1 -1
- package/dist/assets/{cheerRules-DvM2z9Qg.js → cheerRules-Bs7u6fhI.js} +1 -1
- package/dist/assets/{cityLayout-VU-ug-r6.js → cityLayout-1I0cF38a.js} +1 -1
- package/dist/assets/{dogState-Bm3YZHwy.js → dogState-DSYyIK7C.js} +1 -1
- package/dist/assets/{doors-D7Z3s-7W.js → doors-BUM4Izj_.js} +1 -1
- package/dist/assets/{gallery-CSWmy4Tf.js → gallery-BntMgHVx.js} +1 -1
- package/dist/assets/gate-B4Yyimy5.js +2 -0
- package/dist/assets/{index-COpmc42S.css → index-0ut5ekje.css} +1 -1
- package/dist/assets/index-BoDJkaEF.js +10 -0
- package/dist/assets/{instantReplay-FXf2kJ7B.js → instantReplay-D8hjR3t4.js} +1 -1
- package/dist/assets/{interact-BatJVhca.js → interact-Bj1zja21.js} +1 -1
- package/dist/assets/{jsx-runtime-CXW0f58S.js → jsx-runtime-CZP6s5wa.js} +1 -1
- package/dist/assets/{kit-D3twk12W.js → kit-iArIGJf-.js} +1 -1
- package/dist/assets/mic-B-UxYaQY.js +1 -0
- package/dist/assets/{photoMode-B8pRCF0O.js → photoMode-CRSRNKrX.js} +1 -1
- package/dist/assets/{pipeline-BgOS9JnJ.js → pipeline-DvDJ46O5.js} +1 -1
- package/dist/assets/{rapier-BvQbKz0M.js → rapier-Dtx9m4Xq.js} +1 -1
- package/dist/assets/{rig-BgSxc8mA.js → rig-Bs_tw8rH.js} +1 -1
- package/dist/assets/{speechLanguage-Cak8tdL0.js → speechLanguage-CSuv5EYa.js} +1 -1
- package/dist/assets/store-D1ymxjG0.js +5 -0
- package/dist/assets/useDayTime-Cn8OOG-d.js +1 -0
- package/dist/assets/useGraphics-CnMUzm0p.js +1 -0
- package/dist/assets/voiceMessages-CvKdLaYv.js +1 -0
- package/dist/assets/{weatherState-BQ3UU4vU.js → weatherState-BGsd5Mzz.js} +1 -1
- package/dist/index.html +4 -4
- package/dist-server/index.js +1668 -730
- package/dist-server/index.js.map +4 -4
- package/dist-server/ptyHost.js +6 -2
- package/dist-server/ptyHost.js.map +2 -2
- package/dist-server/skills/ceo-app-starter.md +53 -0
- package/docs/app-starter-provenance.md +25 -0
- package/docs/app-starter.md +107 -0
- package/package.json +5 -3
- package/dist/assets/AccessibilitySettings-6ZCswq5I.js +0 -30
- package/dist/assets/Pocket-CjK6fv97.js +0 -2
- package/dist/assets/TerminalView-CoH1yh6r.js +0 -17
- package/dist/assets/all-BsJ98bWd.js +0 -11
- package/dist/assets/gate-DwsbbSNS.js +0 -2
- package/dist/assets/index-D_Et7Vx8.js +0 -10
- package/dist/assets/mic-BJ0eYLIj.js +0 -1
- package/dist/assets/store-Buxt6UcJ.js +0 -5
- package/dist/assets/useDayTime-0ms3va3h.js +0 -1
- package/dist/assets/useGraphics-p7LAuvYj.js +0 -1
- package/dist/assets/voiceMessages-hO1SDnOS.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TerminalView-CoH1yh6r.js","assets/rolldown-runtime-XKyaHtl9.js","assets/jsx-runtime-CXW0f58S.js","assets/index-D_Et7Vx8.js","assets/store-Buxt6UcJ.js","assets/index-COpmc42S.css","assets/AccessibilitySettings-6ZCswq5I.js","assets/mic-BJ0eYLIj.js","assets/jukeboxSongs-CUwHJ1cS.js","assets/AccessibilitySettings-HrzBDUTN.css","assets/bloomMarks-JYeAmd4d.js","assets/BufferGeometryUtils-Dcu0heeS.js","assets/Batched-CmXZtCvQ.js","assets/rig-BgSxc8mA.js","assets/TerminalView-BrP-ENHg.css","assets/AppViewer-CqGa1r0z.js","assets/MissionConsole-BUE2mijT.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{O as r,a as i,c as a,l as o,o as s,s as c}from"./index-D_Et7Vx8.js";import{At as l,a as u,d,ds as f,li as p,m,p as h,t as g}from"./store-Buxt6UcJ.js";import{C as _,I as v,N as y,a as b,b as x,c as S,f as C,g as w,i as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M,v as N}from"./AccessibilitySettings-6ZCswq5I.js";var P=e(t(),1),F=n();function I({repo:e,qa:t,ready:n}){let r=c(),i=h(e=>t.devAgentId?e.agents[t.devAgentId]:void 0),l=h(e=>e.settings.language),[u,d]=(0,P.useState)(!1),p=e.pulls.find(e=>e.number===t.prNumber);if(!p)return null;let{note:m,tone:g}=f(t,p,e.autoMerge,l),_=async e=>{d(!0);try{await e()}catch{}finally{d(!1)}},v=async()=>{await o(n?{icon:`🎉`,title:r(`Merge PR #{number}?`,{number:p.number}),body:r(`“{title}” passed QA. It will be squash-merged into {branch}.`,{title:p.title,branch:e.defaultBranch}),confirm:r(`Squash & merge`)}:{tone:`warn`,title:r(`Merge PR #{number} without QA?`,{number:p.number}),body:r(`“{title}” has not passed QA yet. Merge it into {branch} anyway?`,{title:p.title,branch:e.defaultBranch}),confirm:r(`Merge anyway`)})&&await _(()=>a.mergePull(e.id,p.number))},y=async()=>{let t=``;await o({icon:`🔧`,title:r(`Send PR #{number} back for a fix?`,{number:p.number}),body:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`p`,{children:(0,F.jsx)(s,{children:`Its author, or any free agent, fixes it with QA’s findings, then it’s tested once more.`})}),(0,F.jsx)(`input`,{maxLength:1e3,placeholder:r(`Optional note for whoever fixes it`),"aria-label":r(`Note for whoever fixes it`),onChange:e=>t=e.target.value})]}),confirm:r(`Send back`)})&&await _(()=>a.sendBack(e.id,p.number,t.trim()||void 0))},b=async()=>{await o({tone:`danger`,title:r(`Close PR #{number}?`,{number:p.number}),body:r(`“{title}” will be closed without merging. The branch stays on GitHub.`,{title:p.title}),confirm:r(`Close PR`)})&&await _(()=>a.closePull(e.id,p.number))};return(0,F.jsxs)(`div`,{className:`pk-card pk-pr kcard-${g??`plain`}`,style:{"--accent":e.color},children:[(0,F.jsxs)(`div`,{className:`pk-pr-head`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`a`,{href:p.url,target:`_blank`,rel:`noreferrer`,children:(0,F.jsxs)(`b`,{children:[`PR #`,p.number]})}),` `,p.title,(0,F.jsxs)(`div`,{className:`muted small`,children:[e.fullName.split(`/`)[1],i?` · ${r(`by {name}`,{name:i.name})}`:``,` · `,r(`round {number}`,{number:t.round}),` · `,m]})]})]}),t.summary&&(0,F.jsx)(`div`,{className:`small pk-pr-summary`,children:t.summary}),t.commentUrl&&(0,F.jsx)(`a`,{className:`small`,href:t.commentUrl,target:`_blank`,rel:`noreferrer`,children:(0,F.jsx)(s,{children:`QA report ↗`})}),(0,F.jsxs)(`div`,{className:`pk-actions`,children:[!n&&(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:u,onClick:()=>void _(()=>a.sendToQa(e.id,p.number)),children:(0,F.jsx)(s,{children:`Retry QA`})}),!n&&(0,F.jsx)(`button`,{className:`btn btn-small`,disabled:u,onClick:()=>void y(),children:(0,F.jsx)(s,{children:`Send back`})}),(0,F.jsx)(`button`,{className:`btn btn-small ${n?`btn-good`:``}`,disabled:u||p.isDraft,onClick:()=>void v(),children:r(n?`Merge`:`Merge anyway`)}),(0,F.jsx)(`button`,{className:`btn btn-small btn-ghost`,disabled:u,onClick:()=>void b(),children:(0,F.jsx)(s,{children:`Close`})})]})]})}function L(){let e=h(e=>e.repos),t=h(e=>e.qa),n=h(e=>e.requests),r=A(e,t,n),i=r.requests.length+r.stuck.length+r.ready.length===0;return(0,F.jsxs)(`div`,{className:`pk-page`,children:[i&&(0,F.jsx)(`p`,{className:`pk-empty`,children:(0,F.jsx)(s,{children:`Nothing waits on you. The team carries on, and your phone hears when that changes.`})}),r.requests.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(s,{children:`👥 Team changes`})}),r.requests.map(e=>(0,F.jsx)(_,{req:e},e.id)),r.stuck.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(s,{children:`⚠️ Pull requests that need you`})}),r.stuck.map(e=>(0,F.jsx)(I,{repo:e.repo,qa:e.qa},`${e.repo.id}#${e.qa.prNumber}`)),r.ready.length>0&&(0,F.jsx)(`h3`,{className:`pk-h`,children:(0,F.jsx)(s,{children:`✅ Ready to merge`})}),r.ready.map(e=>(0,F.jsx)(I,{repo:e.repo,qa:e.qa,ready:!0},`${e.repo.id}#${e.qa.prNumber}`))]})}var R={idle:`free`,preparing:`setting up`,working:`working`,done:`done`,error:`needs help`,stopped:`stopped`};function z({status:e}){let t=c();return(0,F.jsx)(`span`,{className:`status status-${e}`,children:t(R[e]??e)})}function B(){let[e,t]=(0,P.useState)(!1);return[e,async e=>{t(!0);try{return await e(),!0}catch{return!1}finally{t(!1)}}]}function V({agent:e,repo:t}){let n=c(),r=h(e=>e.agents),i=h(e=>e.qa),o=h(e=>e.settings),d=h(e=>e.clis),f=h(e=>e.openOverlay),p=(0,P.useMemo)(()=>u(t,g(r,t.id),i),[t,r,i]),[m,_]=B(),[y,x]=(0,P.useState)(``),[S,C]=(0,P.useState)(!1),[D,O]=(0,P.useState)(``),k=E(e),A=T(p),j=A.find(e=>e.key===y),M=e.status===`working`||e.status===`preparing`,I=N(e,o),L=async()=>{let t=D.trim();t&&await _(()=>a.message(e.id,t))&&(O(``),C(!1))};return(0,F.jsxs)(`div`,{className:`pk-card pk-agent ${e.status===`error`?`pk-agent-bad`:``}`,children:[(0,F.jsxs)(`div`,{className:`pk-agent-head`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:e.color},children:e.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:e.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:w(e,o,d)}),(0,F.jsxs)(`div`,{className:`small pk-ellipsis`,children:[b(e,o.language),M&&e.currentTool?(0,F.jsxs)(`span`,{className:`muted`,children:[` · `,n(l(e.currentTool)||e.currentTool),`…`]}):null]})]}),(0,F.jsx)(z,{status:e.status})]}),e.lastError&&!M&&(0,F.jsxs)(`div`,{className:`term-error small pk-error`,children:[`⚠️ `,e.lastError]}),I&&(0,F.jsxs)(`div`,{className:`small pk-sign-in`,children:[`🔑 `,n(`Waiting for you to sign {provider} in, in their terminal`,{provider:I}),`.`]}),(0,F.jsxs)(`div`,{className:`pk-actions`,children:[I&&(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>f({kind:`terminal`,agentId:e.id}),children:(0,F.jsx)(s,{children:`🔑 Sign in`})}),k.stop&&(0,F.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:m,onClick:()=>void _(()=>a.stop(e.id)),children:(0,F.jsx)(s,{children:`■ Stop`})}),k.assign&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`select`,{className:`pk-assign`,value:y,"aria-label":n(`Give {name} an issue or a pull request to test`,{name:e.name}),onChange:e=>x(e.target.value),disabled:m||A.length===0,children:[(0,F.jsx)(`option`,{value:``,children:n(A.length?`Pick an issue or a PR…`:`Nothing to pick up`)}),A.map(e=>(0,F.jsxs)(`option`,{value:e.key,children:[e.kind===`qa`?`🔍 PR `:``,`#`,e.number,` `,e.title]},e.key))]}),(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m||!j,onClick:()=>j&&void _(()=>j.kind===`qa`?a.sendToQa(t.id,j.number,e.id):a.assign(e.id,j.number)).then(e=>e&&x(``)),children:n(j?.kind===`qa`?`🔍 Test`:`▶ Start`)})]}),k.clear&&(0,F.jsx)(`button`,{className:`btn btn-small`,disabled:m,onClick:()=>void _(()=>a.reset(e.id)),children:(0,F.jsx)(s,{children:`↺ Clear desk`})}),k.message&&(0,F.jsx)(`button`,{className:`btn btn-small ${S?`btn-ghost`:``}`,"aria-expanded":S,onClick:()=>C(!S),children:(0,F.jsx)(s,{children:`💬 Message`})}),(0,F.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>f({kind:`terminal`,agentId:e.id}),children:(0,F.jsx)(s,{children:`Terminal`})})]}),S&&k.message&&(0,F.jsxs)(`form`,{className:`pk-msg`,onSubmit:e=>{e.preventDefault(),L()},children:[(0,F.jsx)(v,{value:D,onChange:O,autoFocus:!0,"aria-label":n(`Message {name}`,{name:e.name}),placeholder:n(M?`Tell {name} something while they work…`:`Ask {name} for a follow-up…`,{name:e.name})}),(0,F.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:m||!D.trim(),children:(0,F.jsx)(s,{children:`Send`})})]})]})}function H(){let e=c(),t=h(e=>e.agents.ceo),n=h(e=>e.ceo),[r,i]=B();if(!t)return null;let o=t.status===`working`;return(0,F.jsxs)(`div`,{className:`pk-card pk-agent`,children:[(0,F.jsxs)(`div`,{className:`pk-agent-head`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:t.color},children:t.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:t.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,F.jsx)(`div`,{className:`small pk-ellipsis`,children:o?n.job?.label??e(`Working`):n.queue.length?e(`Up next: {jobs}`,{jobs:n.queue.map(e=>e.label).join(` → `)}):e(`Free`)})]}),(0,F.jsx)(z,{status:t.status})]}),o&&(0,F.jsx)(`div`,{className:`pk-actions`,children:(0,F.jsx)(`button`,{className:`btn btn-small btn-bad`,disabled:r,onClick:()=>void i(()=>a.stop(t.id)),children:(0,F.jsx)(s,{children:`■ Stop`})})})]})}function U({focusRepo:e}){let t=c(),n=h(e=>e.repos),r=h(e=>e.agents),i=(0,P.useRef)(null);return(0,P.useEffect)(()=>i.current?.scrollIntoView({block:`start`}),[]),(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(H,{}),n.length===0&&(0,F.jsx)(`p`,{className:`muted`,children:(0,F.jsx)(s,{children:`No floors yet, so no team.`})}),n.map(n=>{let a=g(r,n.id);return(0,F.jsxs)(`section`,{ref:n.id===e?i:void 0,className:`pk-section`,style:{"--accent":n.color},children:[(0,F.jsxs)(`h3`,{className:`pk-h`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:n.floor}),` `,n.fullName.split(`/`)[1],(0,F.jsxs)(`span`,{className:`muted small`,children:[` · `,t(a.length===1?`{count} agent`:`{count} agents`,{count:a.length})]})]}),a.length===0&&(0,F.jsx)(`p`,{className:`muted small`,children:(0,F.jsx)(s,{children:`Nobody works here yet.`})}),a.map(e=>(0,F.jsx)(V,{agent:e,repo:n},e.id))]},n.id)})]})}var W=(0,P.lazy)(()=>m(()=>import(`./TerminalView-CoH1yh6r.js`).then(e=>e.r).then(e=>({default:e.TerminalView})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),G=(0,P.lazy)(()=>m(()=>import(`./AppViewer-CqGa1r0z.js`).then(e=>e.n).then(e=>({default:e.AppViewer})),__vite__mapDeps([15,1,2,3,4,5,6,7,8,9]))),K=(0,P.lazy)(()=>m(()=>import(`./MissionConsole-BUE2mijT.js`).then(e=>e.t).then(e=>({default:e.UsageCard})),__vite__mapDeps([16,1,2,4,3,5]))),q=[`company`,`chat`,`kanban`,`team`,`approvals`];function J(e){let t=e?new URL(e,location.origin).searchParams.get(`tab`):null;return q.includes(t)?t:null}var Y=e=>e.split(`/`)[1]??e;function X(){h.getState().openOverlay(null),r(`office`)}var Z=[[`building`,`🔨`,`Building`],[`qa`,`🔍`,`QA`],[`fixing`,`🔧`,`Fixing`],[`ready`,`✅`,`Ready`],[`needsYou`,`⚠️`,`Needs you`]];function Q(){let e=c(),t=h(e=>e.connected),n=h(e=>e.loaded),r=h(e=>e.usage),i=h(e=>e.restarting?`⟳ The office is restarting…`:p(e.officeUpdate,e.settings.language)),a=r.until?new Date(r.until).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}):null;return(0,F.jsxs)(F.Fragment,{children:[!t&&(0,F.jsx)(`div`,{className:`pk-banner pk-banner-bad`,children:e(n?`📡 Reconnecting to the office…`:`📡 Connecting to the office…`)}),r.state===`paused`&&(0,F.jsxs)(`div`,{className:`pk-banner pk-banner-bad`,children:[(0,F.jsx)(s,{children:`⏸ Claude’s usage limit was reached: no new work starts`}),a?e(` until {time}`,{time:a}):``,`.`]}),r.state===`pacing`&&(0,F.jsxs)(`div`,{className:`pk-banner`,children:[(0,F.jsx)(s,{children:`🐢 Pacing new work after a usage warning`}),a?e(` until {time}`,{time:a}):``,`.`]}),i&&(0,F.jsx)(`div`,{className:`pk-banner`,children:e(i)})]})}function $({go:e}){let t=c(),n=h(e=>e.repos),r=h(e=>e.agents),i=h(e=>e.qa),a=h(e=>e.requests),o=h(e=>e.ceo),l=h(e=>e.demo),d=h(e=>e.version),f=r.ceo,p=(0,P.useMemo)(()=>n.map(e=>{let t=g(r,e.id);return{repo:e,team:t.length,busy:t.filter(e=>e.status===`working`||e.status===`preparing`).length,p:D(u(e,t,i))}}),[n,r,i]),m=k(A(n,i,a));return(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(Q,{}),m>0&&(0,F.jsxs)(`button`,{className:`pk-callout`,onClick:()=>e(`approvals`),children:[(0,F.jsxs)(`span`,{children:[`⚠️ `,t(m===1?`{count} decision waiting on you`:`{count} decisions waiting on you`,{count:m})]}),(0,F.jsx)(`span`,{children:(0,F.jsx)(s,{children:`Approvals →`})})]}),f&&(0,F.jsxs)(`div`,{className:`pk-card pk-ceo`,children:[(0,F.jsx)(`span`,{className:`avatar`,style:{background:f.color},children:f.name[0]}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{children:f.name}),` `,(0,F.jsx)(`span`,{className:`muted small`,children:`CEO`}),(0,F.jsx)(`div`,{className:`small`,children:f.status===`working`?o.job?.label??t(`Working`):o.queue.length?t(`Next: {job}`,{job:o.queue[0].label}):t(`Free`)})]}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`chat`),children:(0,F.jsx)(s,{children:`💬 Chat`})})]}),p.length===0&&(0,F.jsx)(`p`,{className:`muted`,children:(0,F.jsx)(s,{children:`No projects yet. Connect a repo from the manager’s console in the 3D office.`})}),p.map(({repo:n,team:r,busy:i,p:a})=>(0,F.jsxs)(`div`,{className:`pk-card pk-floor`,style:{"--accent":n.color},children:[(0,F.jsxs)(`div`,{className:`pk-floor-head`,children:[(0,F.jsx)(`span`,{className:`floor-badge`,children:n.floor}),(0,F.jsxs)(`div`,{className:`grow`,children:[(0,F.jsx)(`b`,{className:`pk-floor-name`,children:Y(n.fullName)}),(0,F.jsx)(`div`,{className:`muted small pk-ellipsis`,children:n.summary||n.description||n.fullName})]})]}),(0,F.jsx)(`div`,{className:`pk-pipeline`,role:`list`,"aria-label":t(`Floor {floor} pipeline`,{floor:n.floor}),children:Z.map(([e,n,r])=>(0,F.jsxs)(`div`,{role:`listitem`,className:`pk-stage ${a[e]?``:`pk-stage-zero`} ${e===`needsYou`&&a[e]?`pk-stage-hot`:``}`,children:[(0,F.jsxs)(`span`,{className:`pk-stage-n`,children:[(0,F.jsx)(`span`,{className:`pk-stage-icon`,"aria-hidden":!0,children:n}),a[e]]}),(0,F.jsx)(`span`,{className:`pk-stage-label`,children:t(r)})]},e))}),(0,F.jsxs)(`div`,{className:`pk-floor-foot small`,children:[(0,F.jsx)(`span`,{className:`muted`,children:t(`👥 {team} · {busy} busy · 📋 {backlog} in backlog`,{team:r,busy:i,backlog:a.backlog})}),(0,F.jsx)(`span`,{className:`spacer`}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`kanban`,n.id),children:(0,F.jsx)(s,{children:`Board`})}),(0,F.jsx)(`button`,{className:`btn btn-small`,onClick:()=>e(`team`,n.id),children:(0,F.jsx)(s,{children:`Team`})})]})]},n.id)),(0,F.jsx)(`button`,{className:`btn pk-wide`,onClick:X,children:(0,F.jsx)(s,{children:`🏢 Open the 3D office`})}),l&&(0,F.jsx)(`div`,{className:`pk-center small muted`,children:(0,F.jsx)(s,{children:`DEMO MODE: fake repos, fake agents`})}),d&&(0,F.jsxs)(`div`,{className:`pk-center small muted`,children:[`Droidsembly `,d]})]})}function ee({repoId:e,pick:t}){let n=c(),r=h(e=>e.repos),i=r.some(t=>t.id===e)?e:r[0]?.id;return i?(0,F.jsxs)(`div`,{className:`pk-page`,children:[r.length>1&&(0,F.jsx)(`div`,{className:`pk-chips`,role:`tablist`,"aria-label":n(`Floor`),children:r.map(e=>(0,F.jsxs)(`button`,{role:`tab`,"aria-selected":e.id===i,className:`pk-chip ${e.id===i?`pk-chip-on`:``}`,style:{"--accent":e.color},onClick:()=>t(e.id),children:[e.floor,` · `,Y(e.fullName)]},e.id))}),(0,F.jsx)(M,{repoId:i,embedded:!0},i)]}):(0,F.jsx)(`p`,{className:`muted pk-page`,children:(0,F.jsx)(s,{children:`No projects yet.`})})}function te(){let e=h(e=>e.toasts),t=h(e=>e.dismissToast);return(0,F.jsx)(`div`,{className:`toasts`,children:e.slice(-2).map(e=>(0,F.jsx)(`div`,{className:`toast toast-${e.level}`,onClick:()=>t(e.id),children:e.text},e.id))})}function ne(){let e=h(e=>e.overlay);return e?.kind===`terminal`&&e.agentId!==`ceo`?(0,F.jsx)(W,{agentId:e.agentId}):e?.kind===`app`?(0,F.jsx)(G,{repoId:e.repoId}):null}function re({onClose:e}){let t=c();return(0,F.jsxs)(y,{title:t(`⚙️ This device and notifications`),onClose:e,className:`pk-settings`,children:[(0,F.jsx)(`div`,{className:`card`,children:(0,F.jsx)(i,{})}),(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(K,{hot:!1})}),(0,F.jsx)(O,{}),(0,F.jsx)(S,{}),(0,F.jsx)(j,{pocket:!0}),(0,F.jsxs)(`div`,{className:`card`,children:[(0,F.jsx)(`h3`,{children:(0,F.jsx)(s,{children:`📱 Pocket mode`})}),(0,F.jsxs)(`p`,{className:`muted small`,children:[(0,F.jsx)(s,{children:`This is the office without the 3D building, for phones and touch screens. It’s picked on its own on small or touch screens; this device remembers what you last chose. To reach the office from your phone safely, see`}),` `,(0,F.jsx)(`a`,{href:`https://github.com/leonvanzyl/cubefarm/blob/main/docs/pocket.md`,children:`docs/pocket.md`}),`.`]}),(0,F.jsx)(`button`,{className:`btn`,onClick:X,children:(0,F.jsx)(s,{children:`🏢 Open the 3D office`})})]})]})}function ie(){let e=c(),[t,n]=(0,P.useState)(()=>J(location.href)??`company`),[r,i]=(0,P.useState)(null),[a,o]=(0,P.useState)(!1),l=h(e=>e.settings.companyName),u=h(e=>e.loaded),f=h(e=>e.settings.setupDone),p=h(e=>d(e.messages,e.phoneReadAt)),m=h(e=>k(A(e.repos,e.qa,e.requests))),g=h(e=>e.agents.ceo?.name??`CEO`),_=h(e=>e.usage.state),v=h(e=>e.connected),y=(e,t)=>{t&&i(t),n(e)};(0,P.useEffect)(()=>{let e=e=>{let t=J(e.detail);t&&n(t)};return window.addEventListener(`cubefarm:open`,e),()=>window.removeEventListener(`cubefarm:open`,e)},[]),(0,P.useEffect)(()=>{let e=h.getState();t===`chat`?e.openOverlay({kind:`phone`,tab:`chat`}):e.overlay?.kind===`phone`&&e.openOverlay(null)},[t]),(0,P.useEffect)(()=>(document.title=`${l?`${l} · `:``}Droidsembly · pocket`,()=>void(document.title=`Droidsembly`)),[l]);let b=[[`company`,`📊`,`Company`,0],[`chat`,`💬`,g,t===`chat`?0:p],[`kanban`,`📋`,`Kanban`,0],[`team`,`👥`,`Team`,0],[`approvals`,`✋`,`Approvals`,m]];return(0,F.jsxs)(`div`,{className:`pocket`,children:[(0,F.jsxs)(`header`,{className:`pk-head`,children:[(0,F.jsx)(C,{}),(0,F.jsx)(`b`,{className:`pk-title`,children:l||`Droidsembly`}),(0,F.jsx)(`span`,{className:`pk-dot ${v?`pk-dot-on`:``}`,title:e(v?`Connected`:`Not connected`)}),(0,F.jsx)(`span`,{className:`spacer`}),_!==`normal`&&(0,F.jsx)(`span`,{className:`chip chip-warn`,children:e(_===`paused`?`⏸ paused`:`🐢 pacing`)}),(0,F.jsx)(`button`,{className:`pk-icon-btn`,onClick:()=>o(!0),"aria-label":e(`Settings and notifications`),title:e(`Settings and notifications`),children:`⚙️`})]}),(0,F.jsx)(`main`,{className:`pk-main ${t===`chat`?`pk-main-chat`:``}`,children:u&&!f?(0,F.jsxs)(`div`,{className:`pk-page`,children:[(0,F.jsx)(`p`,{children:(0,F.jsx)(s,{children:`The office isn’t set up yet. Finish the setup in the 3D office (on a computer is easiest), then come back.`})}),(0,F.jsx)(`button`,{className:`btn`,onClick:X,children:(0,F.jsx)(s,{children:`🏢 Open the 3D office`})})]}):(0,F.jsxs)(F.Fragment,{children:[t===`company`&&(0,F.jsx)($,{go:y}),t===`chat`&&(0,F.jsx)(x,{autoFocus:!1}),t===`kanban`&&(0,F.jsx)(ee,{repoId:r,pick:i}),t===`team`&&(0,F.jsx)(U,{focusRepo:r}),t===`approvals`&&(0,F.jsx)(L,{})]})}),(0,F.jsx)(`nav`,{className:`pk-tabs`,"aria-label":e(`Pocket office`),children:b.map(([r,i,a,o])=>(0,F.jsxs)(`button`,{className:`pk-tab ${t===r?`pk-tab-on`:``}`,"aria-current":t===r?`page`:void 0,onClick:()=>n(r),children:[(0,F.jsxs)(`span`,{className:`pk-tab-icon`,children:[i,o>0&&(0,F.jsx)(`span`,{className:`badge badge-dot`,children:o})]}),(0,F.jsx)(`span`,{className:`pk-tab-label`,children:r===`chat`?a:e(a)})]},r))}),(0,F.jsx)(te,{}),(0,F.jsx)(P.Suspense,{fallback:null,children:(0,F.jsx)(ne,{})}),a&&(0,F.jsx)(re,{onClose:()=>o(!1)})]})}export{ie as default};
|