droidsembly 0.4.0-beta.3 → 0.4.0-beta.4
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 +1 -2
- package/README.md +1 -2
- package/dist/assets/{AccessibilitySettings-HB1JfQbh.js → AccessibilitySettings-6ZCswq5I.js} +3 -3
- package/dist/assets/{AppViewer-0Bly3EdB.js → AppViewer-CqGa1r0z.js} +1 -1
- package/dist/assets/{Balloon-B6odnAlm.js → Balloon-dO9J4khp.js} +1 -1
- package/dist/assets/{Batched-CTJWq46z.js → Batched-CmXZtCvQ.js} +1 -1
- package/dist/assets/{Birds-DSS0OIz9.js → Birds-D51xGT0l.js} +1 -1
- package/dist/assets/{Blimp-CZt6dddK.js → Blimp-C2c_AKRR.js} +1 -1
- package/dist/assets/{BufferGeometryUtils-CmpUrBC5.js → BufferGeometryUtils-Dcu0heeS.js} +1 -1
- package/dist/assets/{Duck-BnRLkodp.js → Duck-CzFiUF6U.js} +1 -1
- package/dist/assets/{Effects-Bkewth1L.js → Effects-DwOi-gSQ.js} +1 -1
- package/dist/assets/{Fireworks-Cvn8YKWd.js → Fireworks-Cc2mGzPJ.js} +1 -1
- package/dist/assets/{Helicopter-BDrFQMNX.js → Helicopter-ltB-x8hG.js} +1 -1
- package/dist/assets/{Hurricane-C8hyFXjx.js → Hurricane-C2qHsRw4.js} +1 -1
- package/dist/assets/{Kaiju-Bxxe9DG0.js → Kaiju-DPHVjFjg.js} +1 -1
- package/dist/assets/{Meteors-UdYL0Tbv.js → Meteors-CxcguXTJ.js} +1 -1
- package/dist/assets/{MissionConsole-DJRtojZP.js → MissionConsole-BUE2mijT.js} +1 -1
- package/dist/assets/{Office-9Mank16i.js → Office-NV5zlSnK.js} +8 -8
- package/dist/assets/{PhotoPanel-C_njIXp0.js → PhotoPanel-CDqgU99Z.js} +1 -1
- package/dist/assets/{PhotoScene-DwpeJjGe.js → PhotoScene-RRXC4_Jv.js} +3 -3
- package/dist/assets/{Plane-DzvUAUYE.js → Plane-BQB72TWZ.js} +1 -1
- package/dist/assets/{Pocket-A1iI6Ivy.js → Pocket-CjK6fv97.js} +2 -2
- package/dist/assets/{Rainbow-CV1rD6rW.js → Rainbow-DIpZi5-z.js} +1 -1
- package/dist/assets/{Roof-DSpKcGXK.js → Roof-Cd9I0jtG.js} +1 -1
- package/dist/assets/{Shell-GaQY3zre.js → Shell-DCqHgrm_.js} +1 -1
- package/dist/assets/{Skywriting-D4B2ZvH7.js → Skywriting-BH6FCdEl.js} +1 -1
- package/dist/assets/TerminalView-CoH1yh6r.js +17 -0
- package/dist/assets/{ToyWorld-DeQUxcuy.js → ToyWorld--k4uqi9k.js} +1 -1
- package/dist/assets/{Ufo-CitoxReu.js → Ufo-C5cYunS9.js} +1 -1
- package/dist/assets/{Whale-Btx5ph-T.js → Whale-BAXeezd8.js} +1 -1
- package/dist/assets/{all-gw-szDg1.js → all-BsJ98bWd.js} +1 -1
- package/dist/assets/{bloomMarks-DRhDp19k.js → bloomMarks-JYeAmd4d.js} +1 -1
- package/dist/assets/{cheerRules-DWb8Qwzg.js → cheerRules-DvM2z9Qg.js} +1 -1
- package/dist/assets/{cityLayout-aA2Ktgpu.js → cityLayout-VU-ug-r6.js} +1 -1
- package/dist/assets/{dogState-DY7tJEVD.js → dogState-Bm3YZHwy.js} +1 -1
- package/dist/assets/{doors-BlKvxXVp.js → doors-D7Z3s-7W.js} +1 -1
- package/dist/assets/{gallery-COKuWb9E.js → gallery-CSWmy4Tf.js} +1 -1
- package/dist/assets/{gate-D0uU0wv5.js → gate-DwsbbSNS.js} +2 -2
- package/dist/assets/{index-CDJgPTOC.js → index-D_Et7Vx8.js} +3 -3
- package/dist/assets/{instantReplay-BjoV6jrY.js → instantReplay-FXf2kJ7B.js} +1 -1
- package/dist/assets/{interact-0jqx03Xr.js → interact-BatJVhca.js} +1 -1
- package/dist/assets/{kit-n-eqZ1AT.js → kit-D3twk12W.js} +1 -1
- package/dist/assets/{mic-BnAa4E99.js → mic-BJ0eYLIj.js} +1 -1
- package/dist/assets/{photoMode-BybFMLKC.js → photoMode-B8pRCF0O.js} +1 -1
- package/dist/assets/{pipeline-BGPWXegt.js → pipeline-BgOS9JnJ.js} +1 -1
- package/dist/assets/{rapier-CrXmTSyE.js → rapier-BvQbKz0M.js} +1 -1
- package/dist/assets/{rig-DfdntE8m.js → rig-BgSxc8mA.js} +1 -1
- package/dist/assets/{speechLanguage-DfsQvU9M.js → speechLanguage-Cak8tdL0.js} +1 -1
- package/dist/assets/store-Buxt6UcJ.js +5 -0
- package/dist/assets/{useDayTime-BjBDzh_t.js → useDayTime-0ms3va3h.js} +1 -1
- package/dist/assets/{useGraphics-Bg6L4EdS.js → useGraphics-p7LAuvYj.js} +1 -1
- package/dist/assets/{voiceMessages-CFLyZLZ4.js → voiceMessages-hO1SDnOS.js} +1 -1
- package/dist/assets/{weatherState-BJVm5hU-.js → weatherState-BQ3UU4vU.js} +1 -1
- package/dist/index.html +2 -2
- package/dist-server/index.js +661 -88
- package/dist-server/index.js.map +4 -4
- package/package.json +1 -1
- package/dist/assets/TerminalView-DhmLqjYn.js +0 -17
- package/dist/assets/store-CXLtXw8e.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{a as n,s as r,t as i}from"./jsx-runtime-CXW0f58S.js";import{c as a,o,s}from"./index-
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{a as n,s as r,t as i}from"./jsx-runtime-CXW0f58S.js";import{c as a,o,s}from"./index-D_Et7Vx8.js";import{Bt as c,Gt as l,Ht as u,Jt as d,Kt as f,Rt as p,Vt as m,Wt as h,Xt as g,Yt as _,Zt as v,c as y,p as b,qt as x,zt as S}from"./store-Buxt6UcJ.js";import{L as C,N as w,h as T,m as E,p as D}from"./AccessibilitySettings-6ZCswq5I.js";var O=t(r(),1),k=3e4,A=n(()=>({channels:{}}));function j(e){let t=A(t=>t.channels[e]),n=b(t=>t.repos.find(t=>t.id===e)?.pulls);return l(t,n??[])}function M(e,t){b.getState().replaying?b.getState().pushToast(`info`,`▶ Replaying: the PR theatre is live only. Press Esc to go back to the live office.`):(A.setState(n=>({channels:{...n.channels,[e]:t}})),t==null||b.getState().prPreviews[y(e,t)]||a.startPrPreview(e,t).catch(()=>void 0))}var N=(()=>{try{return crypto.randomUUID()}catch{return`viewer-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`}})();function ee(e,t){(0,O.useEffect)(()=>{let n=()=>void a.watchPreview(N,t==null?null:e,t).catch(()=>void 0);n();let r=setInterval(n,k);return()=>clearInterval(r)},[e,t]),(0,O.useEffect)(()=>()=>void a.watchPreview(N,null,null).catch(()=>void 0),[])}typeof window<`u`&&!Object.getOwnPropertyDescriptor(window,`__swarmPreviews`)&&Object.defineProperty(window,"__swarmPreviews",{configurable:!0,get:()=>{let e=b.getState(),t=A.getState().channels;return{main:e.repos.map(e=>({repoId:e.id,floor:e.floor,status:e.preview.status,url:e.preview.url,ref:e.preview.ref,port:e.preview.port,channel:l(t[e.id],e.pulls)})),prs:Object.values(e.prPreviews).map(e=>({repoId:e.repoId,pr:e.pr,status:e.status,url:e.url,port:e.port,commit:e.commit,watched:e.watched,idleSec:Math.round((Date.now()-e.viewedAt)/1e3),error:e.error}))}}});var P=16e3,F=e=>Object.entries(e).reduce((e,[t,n])=>e+t.length+n.length+2,0);function I(e){let t=F(e);if(t<=16e3)return null;let n=e=>e.toLocaleString(`en-US`);return`The preview env is ${n(t)} characters (${n(Object.keys(e).length)} variables, each counted as KEY=value), over the ${n(P)} a floor's preview may take. Keep only the variables the app needs to run.`}var L=e({AppViewer:()=>oe}),R=i(),z={unconfigured:`not set up`,stopped:`stopped`,preparing:`checking out`,installing:`installing`,starting:`starting`,running:`running`,error:`error`},B=[`preparing`,`installing`,`starting`,`running`],V=[{status:`preparing`,label:`Check out the code`},{status:`installing`,label:`Install dependencies`},{status:`starting`,label:`Start the app`}],H=`desktop`,U=12e3;function W({status:e}){let t=s();return(0,R.jsx)(`span`,{className:`status status-${e}`,children:t(z[e])})}var G=e=>Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
|
|
2
2
|
`);function K(e){let t={},n=e.split(/\r?\n/);for(let e=0;e<n.length;e++){let r=n[e].trim();if(!r||r.startsWith(`#`))continue;let i=r.indexOf(`=`),a=i>0?r.slice(0,i).trim():``;if(!a)return{env:t,error:`Line ${e+1}: write it as KEY=value.`};if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(a))return{env:t,error:`Line ${e+1}: “${a}” is not a valid variable name.`};t[a]=r.slice(i+1).trim()}return{env:t,error:null}}function q({repo:e,saveLabel:t=`Save`,onSaved:n}){let r=s(),i={command:e.previewConfig.command??``,env:G(e.previewConfig.env)},[c,l]=(0,O.useState)(i.command),[u,d]=(0,O.useState)(i.env),[f,p]=(0,O.useState)(!1),[m,h]=(0,O.useState)(null);(0,O.useEffect)(()=>{l(i.command),d(i.env)},[i.command,i.env]);let g=c.trim()!==i.command||u.trim()!==i.env,_=e.preview.status===`unconfigured`,v=F(K(u).env);return(0,R.jsxs)(`form`,{className:`preview-form`,onSubmit:async t=>{t.preventDefault();let r=K(u);if(r.error)return h(r.error);let i=I(r.env);if(i)return h(i);h(null),p(!0);try{await a.updateRepo(e.id,{previewCommand:c.trim()||null,previewEnv:r.env}),n?.()}catch(e){h(e.message)}finally{p(!1)}},children:[(0,R.jsxs)(`label`,{className:`field`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Run command`})}),(0,R.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:r(_?`e.g. python -m http.server {port}`:`Auto-detected: npm run dev, else npm start, else npm run preview`),spellCheck:!1})]}),(0,R.jsxs)(`label`,{className:`field`,children:[(0,R.jsx)(`span`,{children:(0,R.jsx)(o,{children:`Environment (KEY=value, one per line)`})}),(0,R.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:`API_URL=http://localhost:{port}/api
|
|
3
3
|
DATA_DIR={tmp}`,spellCheck:!1})]}),(0,R.jsxs)(`p`,{className:`muted small`,children:[(0,R.jsx)(o,{children:`Runs from the repo root in the floor’s own preview worktree.`}),` `,(0,R.jsx)(`code`,{children:`{port}`}),` `,r(`is this floor’s port ({port}) and`,{port:e.preview.port}),` `,(0,R.jsx)(`code`,{children:`PORT`}),` `,(0,R.jsx)(o,{children:`is always set;`}),` `,(0,R.jsx)(`code`,{children:`{tmp}`}),` `,(0,R.jsx)(o,{children:`is a scratch folder.`}),!_&&r(` Leave the command empty to use the auto-detected npm script.`)]}),v>12800&&(0,R.jsx)(`p`,{className:`muted small`,children:r(`Environment: {count} of {max} characters (each variable counts as KEY=value).`,{count:v.toLocaleString(),max:16e3.toLocaleString()})}),m&&(0,R.jsxs)(`div`,{className:`term-error`,children:[`⚠️ `,m]}),(0,R.jsxs)(`div`,{className:`row`,children:[(0,R.jsx)(`button`,{className:`btn btn-small btn-good`,disabled:f||!g&&!n||_&&!c.trim(),children:r(f?`Saving…`:t)}),g&&(0,R.jsx)(`button`,{type:`button`,className:`btn btn-small btn-ghost`,onClick:()=>{l(i.command),d(i.env),h(null)},children:(0,R.jsx)(o,{children:`Undo changes`})})]})]})}var J=`allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals allow-downloads allow-pointer-lock`;function Y({repo:e,preview:t,label:n,src:r,width:i,reloads:a,busy:c,onStart:l,frameRef:u,compact:d}){let f=s(),[p,m]=(0,O.useState)(!1),[h,g]=(0,O.useState)(!1),[_,v]=(0,O.useState)(!1),y=t.status===`running`&&!!r,b=`${r}|${t.startedAt}|${a}`;if((0,O.useEffect)(()=>{if(m(!1),g(!1),!y)return;let e=setTimeout(()=>g(!0),U);return()=>clearTimeout(e)},[b,y]),y)return(0,R.jsxs)(`div`,{className:`app-stage ${i===`phone`?`app-stage-phone`:``}`,children:[(0,R.jsx)(`iframe`,{ref:u,className:`app-frame`,src:r,title:f(`{repo} app ({label})`,{repo:e.fullName.split(`/`)[1],label:n}),sandbox:J,allow:`clipboard-read; clipboard-write; fullscreen; autoplay`,onLoad:()=>m(!0),onError:()=>g(!0)},b),h&&!p&&(0,R.jsxs)(`div`,{className:`app-frame-hint`,role:`status`,children:[(0,R.jsx)(`b`,{children:(0,R.jsx)(o,{children:`The app isn’t showing up here.`})}),` `,(0,R.jsx)(o,{children:`It may refuse to be shown inside another page (X-Frame-Options or a CSP frame-ancestors rule).`}),` `,(0,R.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,children:(0,R.jsx)(o,{children:`Open it in a new tab ↗`})})]})]});if(B.includes(t.status)){let e=V.findIndex(e=>e.status===t.status);return(0,R.jsxs)(`div`,{className:`app-state ${d?`app-state-compact`:``}`,role:`status`,children:[(0,R.jsx)(`div`,{className:`app-state-icon app-spin`,children:`⚙️`}),(0,R.jsx)(`h3`,{children:f(`Starting {label}…`,{label:n})}),(0,R.jsx)(`ol`,{className:`app-steps`,children:V.map((n,r)=>(0,R.jsxs)(`li`,{className:r<e?`app-step-done`:r===e?`app-step-now`:``,children:[r<e?`✓`:r===e?`●`:`○`,` `,f(n.label),n.status===`starting`&&t.port?f(` on port {port}`,{port:t.port}):``]},n.status))}),t.logTail.length>0&&(0,R.jsx)(`pre`,{className:`term app-log`,children:t.logTail.slice(-8).join(`
|
|
4
4
|
`)})]})}return t.status===`error`?(0,R.jsxs)(`div`,{className:`app-state app-state-left ${d?`app-state-compact`:``}`,children:[(0,R.jsx)(`h3`,{children:f(`⚠️ {label} didn’t run`,{label:n})}),(0,R.jsx)(`div`,{className:`term-error`,children:t.error??f(`The app stopped unexpectedly.`)}),(0,R.jsx)(`pre`,{className:`term app-log`,"aria-label":f(`Last output`),children:t.logTail.length?t.logTail.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-JYeAmd4d.js";import{i,r as a}from"./Office-NV5zlSnK.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d,r as f}from"./kit-D3twk12W.js";var p=e(t(),1),m=n(),h=10,g=[[`#e63946`,`#f1faee`,`#ffb703`],[`#2a9d8f`,`#e9c46a`,`#f4a261`],[`#7209b7`,`#f72585`,`#4cc9f0`]];function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=(0,p.useRef)(null),v=d(e.side),y=(0,p.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:v*(105+n()*35),y:u(t)+18+n()*8,palette:g[Math.floor(n()*g.length)],burns:{next:3+n()*3,until:0}}},[e.seed,v,t]);return r(()=>{let r=e.t,o=n.current;if(!o)return;let l=r/e.seconds,u=y.x+Math.sin(r*.13)*4,d=y.y+l*12+Math.sin(r*.4)*.8,f=s(-y.dir*160,y.dir*160,l);if(o.position.set(u,d,f),o.rotation.z=Math.sin(r*.5)*.04,o.rotation.y=r*.05,r>=y.burns.next){y.burns.until=r+1.4,y.burns.next=r+6+Math.random()*5;let n=a(u,d-t,f,90);i(`burner`,{gain:n.gain*c(r,e.seconds,4),pan:n.pan})}if(_.current){let e=r<y.burns.until;_.current.visible=e,e&&_.current.scale.set(1,.8+Math.sin(r*40)*.25,1)}}),(0,m.jsxs)(`group`,{ref:n,children:[Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:l(y.palette[t%y.palette.length]),position:[0,15,0],scale:[1,1.15,1],children:(0,m.jsx)(`sphereGeometry`,{args:[9,3,14,t*Math.PI*2/h,Math.PI*2/h]})},t)),(0,m.jsx)(`mesh`,{material:l(y.palette[0],{side:2}),position:[0,4.6,0],children:(0,m.jsx)(`cylinderGeometry`,{args:[4.4,1.4,4,16,1,!0]})}),[0,1,2,3].map(e=>{let t=e*Math.PI/2+Math.PI/4;return(0,m.jsx)(`mesh`,{material:l(`#6b4a33`),position:[Math.cos(t)*1.1,1.5,Math.sin(t)*1.1],children:(0,m.jsx)(`cylinderGeometry`,{args:[.04,.04,2.4,4]})},e)}),(0,m.jsx)(`mesh`,{material:l(`#a1683a`),position:[0,-.3,0],children:(0,m.jsx)(`boxGeometry`,{args:[2,1.3,2]})}),(0,m.jsx)(`mesh`,{ref:_,material:f(`#ffb347`,{add:!0}),position:[0,3.1,0],visible:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.5,2.2,10]})})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,Ft as i,G as a,O as o,P as s,Pt as c,Tt as l,U as u,bt as d,et as f,f as p,g as m,j as h,nt as g,q as _,z as v,zt as y}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,Ft as i,G as a,O as o,P as s,Pt as c,Tt as l,U as u,bt as d,et as f,f as p,g as m,j as h,nt as g,q as _,z as v,zt as y}from"./bloomMarks-JYeAmd4d.js";import{n as b}from"./BufferGeometryUtils-Dcu0heeS.js";import{B as x,I as S,L as C,R as w,U as T}from"./rig-BgSxc8mA.js";var E=e(t(),1),D=new Map;function O(e,t={}){let n={geometry:e,shading:t.shading??`toon`,outline:t.outline??0,crease:t.crease??0,castShadow:t.castShadow??!1,receiveShadow:t.receiveShadow??!1,material:t.material},r=`${e.uuid}|${n.shading}|${n.outline}|${n.crease}|${+n.castShadow}${+n.receiveShadow}|${n.material?.uuid??``}`,i=D.get(r);return i||(i={key:r,...n},D.set(r,i)),i}function k(e){let t=e.parent;if(!t)return!1;for(;t;){if(!t.visible)return!1;t=t.parent}return!0}var A=16,j=class{look;set;materials;mesh;outline=null;slots=[];outlineGeometry=null;morphN=-1;constructor(e,t,n){this.look=e,this.set=t,this.materials=n,this.mesh=this.make(A),e.outline&&(this.outlineGeometry=e.crease?b(e.geometry,e.crease):e.geometry,this.outline=this.makeOutline(A))}make(e){let t=new _(this.look.geometry,this.look.material??this.materials[this.look.shading],e);t.instanceMatrix.setUsage(s),t.instanceColor=new a(new Float32Array(e*3),3).setUsage(s),t.count=0,t.castShadow=this.look.castShadow&&this.set.shadows,t.receiveShadow=this.look.receiveShadow,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0;let n=this.look.geometry.morphAttributes.position?.length??0;return n&&(t.morphTexture=new h(new Float32Array((n+1)*e),n+1,e,d,v)),this.set.root.add(t),t}makeOutline(e){let t=new _(this.outlineGeometry,this.materials.outline(this.look.outline),e);return t.instanceMatrix.setUsage(s),t.count=0,t.frustumCulled=!1,t.matrixAutoUpdate=!1,t.raycast=()=>void 0,this.set.root.add(t),t}add(e){this.slots.push(e);let t=this.mesh.instanceMatrix.count;this.slots.length<=t||(this.mesh.removeFromParent(),this.mesh.dispose(),this.mesh=this.make(t*2),this.morphN=-1,this.outline&&=(this.outline.removeFromParent(),this.outline.dispose(),this.makeOutline(t*2)))}remove(e){let t=this.slots.indexOf(e);t<0||(this.slots[t]=this.slots[this.slots.length-1],this.slots.pop())}sync(e,t){let n=this.mesh,r=n.instanceMatrix.array,i=n.instanceColor.array,a=this.outline,o=a?a.instanceMatrix.array:null,s=n.morphTexture?n.morphTexture.image.data:null,c=s?n.morphTexture.image.width:0,l=this.look.geometry.morphTargetsRelative,u=0,d=0,f=!1;for(let n of this.slots){if(!k(n.obj))continue;let a=n.obj.matrixWorld.elements;if(r.set(a,u*16),i[u*3]=n.color.r,i[u*3+1]=n.color.g,i[u*3+2]=n.color.b,s){let e=n.obj.morphTargetInfluences,t=0;for(let n=1;n<c;n++){let r=e?.[n-1]??0;s[u*c+n]!==r&&(f=!0),s[u*c+n]=r,t+=r}s[u*c]=l?1:1-t}if(u++,o){let n=a[12]-(e?.x??a[12]),r=a[13]-(e?.y??a[13]),i=a[14]-(e?.z??a[14]);n*n+r*r+i*i<=t&&o.set(a,d++*16)}}n.count=u,n.instanceMatrix.needsUpdate=!0,n.instanceColor.needsUpdate=!0,n.morphTexture&&(f||u!==this.morphN)&&(n.morphTexture.needsUpdate=!0),this.morphN=u,a&&(a.count=d,a.instanceMatrix.needsUpdate=!0)}dispose(){this.mesh.removeFromParent(),this.mesh.dispose(),this.outline?.removeFromParent(),this.outline?.dispose(),this.outlineGeometry&&this.outlineGeometry!==this.look.geometry&&this.outlineGeometry.dispose()}},M=class{materials;root=new u;camera=null;outlineRange=1/0;shadows=!0;batches=new Map;eye=new r;constructor(e){this.materials=e,this.root.name=`batches`}add(e,t,n){let r=this.batches.get(e.key);r||(r=new j(e,this,this.materials),this.batches.set(e.key,r));let i={obj:t,color:new o(n)};r.add(i);let a=r;return{setColor:e=>void i.color.set(e),remove:()=>a.remove(i)}}sync(){let e=this.camera?this.eye.setFromMatrixPosition(this.camera.matrixWorld):null,t=this.outlineRange*this.outlineRange;for(let n of this.batches.values())n.sync(e,t)}stats(){let e=0,t=0;for(let n of this.batches.values())e+=n.mesh.count,t+=n.outline?.count??0;return{batches:this.batches.size,instances:e,outlined:t}}dispose(){for(let e of this.batches.values())e.dispose();this.batches.clear()}};function N(e,t,n,r){var a=class extends l{constructor(a){super({vertexShader:t,fragmentShader:n,...a});for(let t in e)this.uniforms[t]=new c(e[t]),Object.defineProperty(this,t,{get(){return this.uniforms[t].value},set(e){this.uniforms[t].value=e}});this.uniforms=i.clone(this.uniforms),r?.(this)}};return a.key=f.generateUUID(),a}function P(e,t,n,r){let i=new g(r?b(t.geometry,r):t.geometry,n);return e.add(i),i}function F(e,t){let n=e.children[0];n&&(t&&n.geometry.dispose(),e.remove(n))}var I=n(),L=N({screenspace:!1,color:new o(`black`),opacity:1,thickness:.05,size:new y},`#include <common>
|
|
2
2
|
#include <morphtarget_pars_vertex>
|
|
3
3
|
#include <skinning_pars_vertex>
|
|
4
4
|
#include <clipping_planes_pars_vertex>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,F as i,f as a,gt as o,tt as s}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,F as i,f as a,gt as o,tt as s}from"./bloomMarks-JYeAmd4d.js";import{i as c,n as l,r as u}from"./Office-NV5zlSnK.js";import{ba as d}from"./store-Buxt6UcJ.js";import{a as f}from"./director-CrzFgnoP.js";import{a as p,i as m,l as h,n as g,o as _}from"./kit-D3twk12W.js";var v=e(t(),1),y=n(),b=26,x=new r(1,1,1),S=22;function C({run:e,elevation:t}){let n=(0,v.useRef)(null),C=(0,v.useRef)(null),w=(0,v.useRef)(null),T=_(e.side),E=(0,v.useMemo)(()=>{let n=f(e.seed),r=n()<.5?1:-1,i=Array.from({length:b},()=>({dx:(n()-.5)*5,dy:(n()-.5)*3.5,dz:(n()-.5)*11,phase:n()*6.28,rate:10+n()*4,wob:n()*6.28}));return{dir:r,x:T*(d+7+n()*5),y:g(t)+1+n()*2.5,birds:i}},[e.seed,T,t]),D=(0,v.useMemo)(()=>({body:new s,wing:new s,tmp:new s,q:new o,e:new i,p:new r,shape:new r(1,.85,1.8),chirpAt:1}),[]),O=(0,v.useMemo)(()=>({flap:null}),[]);(0,v.useEffect)(()=>(O.flap=l(`flap`),()=>O.flap?.stop(.6)),[O]),a(()=>{let r=e.t,i=n.current,a=C.current,o=w.current;if(!i||!a||!o)return;let s=Math.min(1,r/S),l=p(-E.dir*95,E.dir*95,s),d=E.y+Math.sin(s*Math.PI*2)*2.5,f=E.x-T*Math.sin(s*Math.PI)*3,h=E.dir>0?0:Math.PI;for(let e=0;e<b;e++){let t=E.birds[e],n=Math.sin(r*1.7+t.wob);D.p.set(f+t.dx+n*.6,d+t.dy+Math.sin(r*2.3+t.wob)*.5,l+t.dz),D.e.set(.08*n,h+.15*n,.2*n),D.q.setFromEuler(D.e),D.body.compose(D.p,D.q,D.shape),i.setMatrixAt(e,D.body),D.body.compose(D.p,D.q,x);let s=.15+Math.sin(r*t.rate+t.phase)*.55;D.wing.makeRotationZ(-s).premultiply(D.body),a.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(-.26,0,0))),D.wing.makeRotationZ(s).premultiply(D.body),o.setMatrixAt(e,D.wing.multiply(D.tmp.makeTranslation(.26,0,0)))}i.instanceMatrix.needsUpdate=!0,a.instanceMatrix.needsUpdate=!0,o.instanceMatrix.needsUpdate=!0;let g=u(f,d-t,l,25),_=m(r,24,2);O.flap?.set(g.gain*_,g.pan),r>=D.chirpAt&&r<S&&(D.chirpAt=r+.7+Math.random()*1.6,c(`chirps`,{gain:g.gain*_,pan:g.pan+(Math.random()-.5)*.4}))});let k=h(`#3d405b`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`instancedMesh`,{ref:n,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`sphereGeometry`,{args:[.1,8,6]})}),(0,y.jsx)(`instancedMesh`,{ref:C,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})}),(0,y.jsx)(`instancedMesh`,{ref:w,args:[void 0,void 0,b],material:k,frustumCulled:!1,children:(0,y.jsx)(`boxGeometry`,{args:[.48,.015,.16]})})]})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Ct as r,f as i,pt as a,st as o,w as s}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Ct as r,f as i,pt as a,st as o,w as s}from"./bloomMarks-JYeAmd4d.js";import{p as c}from"./store-Buxt6UcJ.js";import{n as l,r as u}from"./Office-NV5zlSnK.js";import{a as d}from"./director-CrzFgnoP.js";import{a as f,i as p,l as m,n as h,o as g}from"./kit-D3twk12W.js";import{t as _}from"./news-CrPol-gz.js";var v=e(t(),1),y=n(),b={w:46,h:6,segments:40};function x(e){let t=document.createElement(`canvas`);t.width=2048,t.height=256;let n=t.getContext(`2d`);n.fillStyle=`#fffaf0`,n.fillRect(0,0,t.width,t.height),n.strokeStyle=`#e63946`,n.lineWidth=18,n.strokeRect(9,9,t.width-18,t.height-18),n.fillStyle=`#1f1d2b`,n.textAlign=`center`,n.textBaseline=`middle`;let i=170;do n.font=`bold ${i}px "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", sans-serif`;while(n.measureText(e).width>t.width-120&&(i-=8)>60);n.fillText(e,t.width/2,t.height/2+8);let a=new s(t);return a.colorSpace=r,a.anisotropy=8,a}function S({run:e,elevation:t}){let n=(0,v.useRef)(null),r=(0,v.useRef)(null),s=g(e.side),S=(0,v.useMemo)(()=>{let n=d(e.seed),r=c.getState(),i=_(r.repos,Date.now(),r.settings.companyName,n()),a=n()<.5?1:-1,o=-s*a*Math.PI/2;return{dir:a,x:s*(95+n()*20),y:h(t)+11+n()*5,text:i,turn:o,along:-Math.sin(o)}},[e.seed,s,t]),C=(0,v.useMemo)(()=>{let e=new a(b.w,b.h,b.segments,1),t=Float32Array.from(e.attributes.position.array),n=x(S.text);return{geo:e,base:t,map:n,mat:new o({map:n,side:2,fog:!1})}},[S.text]);(0,v.useEffect)(()=>()=>{C.geo.dispose(),C.map.dispose(),C.mat.dispose()},[C]);let w=(0,v.useMemo)(()=>({engine:null}),[]);(0,v.useEffect)(()=>(w.engine=l(`engine`),()=>w.engine?.stop(1.2)),[w]),i(()=>{let i=e.t,a=n.current;if(!a)return;let o=f(-S.dir*200,S.dir*200,i/e.seconds),s=S.y+Math.sin(i*.35)*.7;a.position.set(S.x,s,o),a.rotation.y=S.dir>0?0:Math.PI,a.rotation.x=Math.sin(i*.3)*.02;let c=r.current?.children;if(c)for(let e=0;e<c.length;e++)c[e].rotation.z=i*14;let l=C.geo.attributes.position,d=l.array;for(let e=0;e<l.count;e++){let t=.5-C.base[e*3]*S.along/b.w;d[e*3+2]=Math.sin(i*3.2-t*7)*t*1.1}l.needsUpdate=!0;let m=u(S.x,s-t,o,110);w.engine?.set(m.gain*p(i,e.seconds,4),m.pan)});let T=m(`#dfe3ea`),E=m(`#e63946`);return(0,y.jsxs)(`group`,{ref:n,children:[(0,y.jsx)(`mesh`,{material:T,scale:[6,6,21],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,16]})}),(0,y.jsx)(`mesh`,{material:E,scale:[6.05,1.1,18],position:[0,.2,0],children:(0,y.jsx)(`sphereGeometry`,{args:[1,24,8]})}),[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:E,position:[0,0,-18],"rotation-z":e*Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[.4,9,4]})},e)),(0,y.jsx)(`mesh`,{material:m(`#495057`),position:[0,-6.4,2],children:(0,y.jsx)(`boxGeometry`,{args:[2.2,1.6,5]})}),(0,y.jsx)(`group`,{ref:r,children:[-1.6,1.6].map(e=>(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[e,-6.4,-.8],children:(0,y.jsx)(`boxGeometry`,{args:[.2,2.6,.12]})},e))}),(0,y.jsx)(`mesh`,{material:m(`#2b2d42`),position:[0,-3,-26],"rotation-x":Math.PI/2-.25,children:(0,y.jsx)(`cylinderGeometry`,{args:[.05,.05,12,4]})}),(0,y.jsx)(`mesh`,{geometry:C.geo,material:C.mat,position:[0,-5,-32-b.w/2],"rotation-y":S.turn})]})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,S as t}from"./bloomMarks-
|
|
1
|
+
import{C as e,S as t}from"./bloomMarks-JYeAmd4d.js";function n(t,n=!1){let i=t[0].index!==null,a=new Set(Object.keys(t[0].attributes)),o=new Set(Object.keys(t[0].morphAttributes)),s={},c={},l=t[0].morphTargetsRelative,u=new e,d=0;for(let e=0;e<t.length;++e){let r=t[e],f=0;if(i!==(r.index!==null))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.`),null;for(let t in r.attributes){if(!a.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. All geometries must have compatible attributes; make sure "`+t+`" attribute exists among all geometries, or in none of them.`),null;s[t]===void 0&&(s[t]=[]),s[t].push(r.attributes[t]),f++}if(f!==a.size)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. Make sure all geometries have the same number of attributes.`),null;if(l!==r.morphTargetsRelative)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphTargetsRelative must be consistent throughout all geometries.`),null;for(let t in r.morphAttributes){if(!o.has(t))return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. .morphAttributes must be consistent throughout all geometries.`),null;c[t]===void 0&&(c[t]=[]),c[t].push(r.morphAttributes[t])}if(n){let t;if(i)t=r.index.count;else if(r.attributes.position!==void 0)t=r.attributes.position.count;else return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index `+e+`. The geometry must have either an index or a position attribute`),null;u.addGroup(d,t,e),d+=t}}if(i){let e=0,n=[];for(let r=0;r<t.length;++r){let i=t[r].index;for(let t=0;t<i.count;++t)n.push(i.getX(t)+e);e+=t[r].attributes.position.count}u.setIndex(n)}for(let e in s){let t=r(s[e]);if(!t)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` attribute.`),null;u.setAttribute(e,t)}for(let e in c){let t=c[e][0].length;if(t!==0){u.morphAttributes=u.morphAttributes||{},u.morphAttributes[e]=[];for(let n=0;n<t;++n){let t=[];for(let r=0;r<c[e].length;++r)t.push(c[e][r][n]);let i=r(t);if(!i)return console.error(`THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the `+e+` morphAttribute.`),null;u.morphAttributes[e].push(i)}}}return u}function r(e){let n,r,i,a=-1,o=0;for(let t=0;t<e.length;++t){let s=e[t];if(n===void 0&&(n=s.array.constructor),n!==s.array.constructor)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes.`),null;if(r===void 0&&(r=s.itemSize),r!==s.itemSize)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes.`),null;if(i===void 0&&(i=s.normalized),i!==s.normalized)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes.`),null;if(a===-1&&(a=s.gpuType),a!==s.gpuType)return console.error(`THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes.`),null;o+=s.count*r}let s=new n(o),c=new t(s,r,i),l=0;for(let t=0;t<e.length;++t){let n=e[t];if(n.isInterleavedBufferAttribute){let e=l/r;for(let t=0,i=n.count;t<i;t++)for(let i=0;i<r;i++){let r=n.getComponent(t,i);c.setComponent(t+e,i,r)}}else s.set(n.array,l);l+=n.count*r}return a!==void 0&&(c.gpuType=a),c}function i(e,n=Math.PI/3){let r=e.index?e.toNonIndexed():e,i=r.attributes.position,a=i.count,o;if(i.isBufferAttribute===!0&&i.itemSize===3&&i.normalized===!1)o=i.array;else{o=new Float64Array(a*3);for(let e=0;e<a;e++)o[3*e+0]=i.getX(e),o[3*e+1]=i.getY(e),o[3*e+2]=i.getZ(e)}let s=Math.cos(n),c=(1+1e-10)*100,l=a/3,u=new Float64Array(l*3);for(let e=0;e<l;e++){let t=9*e,n=o[t+0],r=o[t+1],i=o[t+2],a=o[t+3],s=o[t+4],c=o[t+5],l=o[t+6],d=o[t+7],f=o[t+8],p=l-a,m=d-s,h=f-c,g=n-a,_=r-s,v=i-c,y=m*v-h*_,b=h*g-p*v,x=p*_-m*g,S=1/(Math.sqrt(y*y+b*b+x*x)||1);u[3*e+0]=y*S,u[3*e+1]=b*S,u[3*e+2]=x*S}let d=new Int32Array(a),f=new Float64Array(a*3),p=1;for(;p<a*2;)p<<=1;let m=p-1,h=new Int32Array(p),g=0;for(let e=0;e<a;e++){let t=3*e,n=Math.trunc(o[t+0]*c),r=Math.trunc(o[t+1]*c),i=Math.trunc(o[t+2]*c),a=(Math.imul(n,73856093)^Math.imul(r,19349663)^Math.imul(i,83492791))&m;for(;;){let t=h[a];if(t===0){let t=3*g;f[t+0]=n,f[t+1]=r,f[t+2]=i,h[a]=g+1,d[e]=g++;break}let o=3*(t-1);if(f[o+0]===n&&f[o+1]===r&&f[o+2]===i){d[e]=t-1;break}a=a+1&m}}let _=new Int32Array(g+1);for(let e=0;e<a;e++)_[d[e]+1]++;for(let e=0;e<g;e++)_[e+1]+=_[e];let v=new Int32Array(a),y=_.slice(0,g);for(let e=0;e<l;e++){let t=3*e;v[y[d[t+0]]++]=e,v[y[d[t+1]]++]=e,v[y[d[t+2]]++]=e}let b=new Float32Array(a*3);for(let e=0;e<l;e++){let t=3*e,n=u[t+0],r=u[t+1],i=u[t+2];for(let e=0;e<3;e++){let a=t+e,o=d[a],c=0,l=0,f=0;for(let e=_[o],t=_[o+1];e<t;e++){let t=3*v[e],a=u[t+0],o=u[t+1],d=u[t+2];n*a+r*o+i*d>s&&(c+=a,l+=o,f+=d)}let p=1/(Math.sqrt(c*c+l*l+f*f)||1);b[3*a+0]=c*p,b[3*a+1]=l*p,b[3*a+2]=f*p}}return r.setAttribute(`normal`,new t(b,3,!1)),r}export{i as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-JYeAmd4d.js";import{i,r as a}from"./Office-NV5zlSnK.js";import{a as o}from"./director-CrzFgnoP.js";import{a as s,i as c,l,n as u,o as d}from"./kit-D3twk12W.js";var f=e(t(),1),p=n(),m=22;function h({run:e,elevation:t}){let n=(0,f.useRef)(null),h=d(e.side),g=(0,f.useMemo)(()=>{let n=o(e.seed);return{dir:n()<.5?1:-1,x:h*(115+n()*30),y:u(t)+6+n()*6,next:4+n()*4}},[e.seed,h,t]);r(()=>{let r=e.t,o=n.current;if(!o)return;let l=s(-g.dir*175,g.dir*175,r/e.seconds),u=g.y+Math.sin(r*.8)*1.6;if(o.position.set(g.x+Math.sin(r*.21)*6,u,l),o.rotation.set(Math.sin(r*.9)*.05,(g.dir>0?0:Math.PI)+Math.sin(r*.33)*.5,Math.sin(r*.7)*.06),r>=g.next){g.next=r+7+Math.random()*6;let n=a(o.position.x,u-t,l,110);i(`squeak`,{gain:n.gain*c(r,e.seconds,3),pan:n.pan,pitch:.8+Math.random()*.3})}});let _=l(`#ffd23f`),v=l(`#ff8c1a`),y=l(`#1f1d2b`);return(0,p.jsx)(`group`,{ref:n,children:(0,p.jsxs)(`group`,{scale:m,children:[(0,p.jsx)(`mesh`,{material:_,scale:[1,.78,1.25],children:(0,p.jsx)(`sphereGeometry`,{args:[.5,22,16]})}),(0,p.jsx)(`mesh`,{material:_,position:[0,.18,-.6],"rotation-x":-.9,children:(0,p.jsx)(`coneGeometry`,{args:[.2,.4,14]})}),[-1,1].map(e=>(0,p.jsx)(`mesh`,{material:_,position:[e*.44,.08,-.05],scale:[.35,.6,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.3,14,10]})},e)),(0,p.jsx)(`mesh`,{material:_,position:[0,.58,.36],children:(0,p.jsx)(`sphereGeometry`,{args:[.32,20,14]})}),(0,p.jsx)(`mesh`,{material:v,position:[0,.5,.68],scale:[1.1,.42,1],children:(0,p.jsx)(`sphereGeometry`,{args:[.16,14,10]})}),[-1,1].map(e=>(0,p.jsxs)(`group`,{children:[(0,p.jsx)(`mesh`,{material:y,position:[e*.14,.68,.6],children:(0,p.jsx)(`sphereGeometry`,{args:[.05,10,8]})}),(0,p.jsx)(`mesh`,{material:l(`#ffffff`),position:[e*.13,.7,.645],children:(0,p.jsx)(`sphereGeometry`,{args:[.015,6,4]})})]},e))]})})}export{h as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Ht as r,O as i,Tt as a,f as o,g as s,it as c,pt as l,rt as u,tt as d,ut as f,w as p}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Ht as r,O as i,Tt as a,f as o,g as s,it as c,pt as l,rt as u,tt as d,ut as f,w as p}from"./bloomMarks-JYeAmd4d.js";import{createPipeline as m,t as h}from"./pipeline-BgOS9JnJ.js";import{Jr as g,dn as _}from"./store-Buxt6UcJ.js";import{a as v}from"./gate-DwsbbSNS.js";import{a as y,c as b,n as x}from"./useGraphics-p7LAuvYj.js";var S=e(t(),1),C={name:`HorizontalBlurShader`,uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
|
|
2
2
|
|
|
3
3
|
varying vec2 vUv;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{C as r,O as i,P as a,S as o,Tt as s,et as c,f as l,g as u,i as d,mt as f}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{C as r,O as i,P as a,S as o,Tt as s,et as c,f as l,g as u,i as d,mt as f}from"./bloomMarks-JYeAmd4d.js";import{i as p,r as m}from"./Office-NV5zlSnK.js";import{a as h}from"./director-CrzFgnoP.js";import{n as g,o as _}from"./kit-D3twk12W.js";var v=e(t(),1),y=n(),b=2400,x=-6,S=[`position`,`aVel`,`aColor`,`aTime`,`aSize`],C=[`#ff595e`,`#ffca3a`,`#8ac926`,`#1982c4`,`#ff70a6`,`#ffffff`,`#c77dff`,`#4cc9f0`],w=`
|
|
2
2
|
attribute vec3 aVel;
|
|
3
3
|
attribute vec3 aColor;
|
|
4
4
|
attribute vec2 aTime; // start, life
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,f as i}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,f as i}from"./bloomMarks-JYeAmd4d.js";import{Va as a,Vo as o,p as s}from"./store-Buxt6UcJ.js";import{n as c,r as l}from"./Office-NV5zlSnK.js";import{a as u}from"./director-CrzFgnoP.js";import{a as d,c as f,i as p,l as m,n as h,o as g,s as _}from"./kit-D3twk12W.js";var v=e(t(),1),y=n(),b=8,x=19,S={approach:20,over:27,down:31,lift:42,up:46},C=1.62*1.6;function w({run:e,elevation:t}){let n=(0,v.useRef)(null),w=(0,v.useRef)(null),T=(0,v.useRef)(null),E=g(e.side),D=(0,v.useMemo)(()=>{let n=u(e.seed),i=s.getState(),c=i.repos.reduce((e,t)=>Math.max(e,t.floor),0),l=i.floor===-1||n()<.5,d={x:a.x,y:o(c)+C,z:a.z};return{cx:E*(85+n()*20),cz:(n()-.5)*40,radius:42+n()*10,y:h(t)+9+n()*8,dir:n()<.5?1:-1,phase:n()*Math.PI*2,far:{x:E*420,z:(n()-.5)*500},land:l,pad:d,from:new r,fromSet:!1,heading:0}},[e.seed,E,t]),O=(0,v.useMemo)(()=>({rotor:null,prev:new r,first:!0,spin:0}),[]);(0,v.useEffect)(()=>(O.rotor=c(`rotor`),()=>O.rotor?.stop(1)),[O]),i((r,i)=>{let a=e.t,o=n.current;if(!o)return;let s=D.phase+D.dir*(a*Math.PI*2)/x,c=D.cx+Math.cos(s)*D.radius,u=D.cz+Math.sin(s)*D.radius,m=D.y,h=_(a/b),g=_((a-(e.seconds-b))/b);c=d(D.far.x,c,h),u=d(-D.far.z,u,h),m+=(1-h)*40;let v=0;if(D.land&&a>=S.approach&&a<e.seconds-b){D.fromSet||D.from.set(c,m,u),D.fromSet=!0;let e=D.pad.y+14,t=f(a,S.approach,S.over);c=d(D.from.x,D.pad.x,t),u=d(D.from.z,D.pad.z,t),m=d(D.from.y,e,t),m=d(m,D.pad.y,f(a,S.over,S.down)-f(a,S.lift,S.up)),v=f(a,S.down-.5,S.down)*(1-f(a,S.lift,S.lift+1))}D.land&&a>=e.seconds-b&&(c=D.pad.x,u=D.pad.z,m=D.pad.y+14),c=d(c,D.far.x,g),u=d(u,D.far.z,g),m+=g*40,O.first&&O.prev.set(c,m,u),O.first=!1;let y=c-O.prev.x,C=u-O.prev.z;y*y+C*C>1e-5&&(D.heading=Math.atan2(y,C)),o.rotation.y=D.heading;let E=D.land?1-f(a,S.approach,S.approach+3)+f(a,e.seconds-b,e.seconds-b+2):1;o.rotation.z=-D.dir*.22*h*(1-g)*Math.min(1,E),o.rotation.x=.12*(1-v),o.position.set(c,m,u),O.prev.set(c,m,u),O.spin+=Math.min(i,.1)*(31-22*v),w.current&&(w.current.rotation.y=O.spin),T.current&&(T.current.rotation.x=O.spin*1.3);let k=l(c,m-t,u,60);O.rotor?.set(k.gain*p(a,e.seconds,2)*(1-.6*v),k.pan,1-.35*v)});let k=m(`#d62828`),A=m(`#2b2d42`);return(0,y.jsxs)(`group`,{ref:n,scale:1.6,children:[(0,y.jsx)(`mesh`,{material:k,scale:[1,.95,1.5],children:(0,y.jsx)(`sphereGeometry`,{args:[1.6,14,10]})}),(0,y.jsx)(`mesh`,{material:m(`#8ecae6`),position:[0,.35,1.25],scale:[1,.7,.8],children:(0,y.jsx)(`sphereGeometry`,{args:[1.05,12,8]})}),(0,y.jsx)(`mesh`,{material:k,position:[0,.3,-3.2],"rotation-x":Math.PI/2,children:(0,y.jsx)(`cylinderGeometry`,{args:[.28,.45,4.2,8]})}),(0,y.jsx)(`mesh`,{material:m(`#f1faee`),position:[0,1,-5.1],children:(0,y.jsx)(`boxGeometry`,{args:[.15,1.4,.9]})}),(0,y.jsx)(`mesh`,{ref:T,material:A,position:[.2,.9,-5.2],children:(0,y.jsx)(`boxGeometry`,{args:[.05,1.6,.18]})}),[-.9,.9].map(e=>(0,y.jsx)(`mesh`,{material:A,position:[e,-1.55,0],children:(0,y.jsx)(`boxGeometry`,{args:[.12,.12,3.4]})},e)),(0,y.jsx)(`mesh`,{material:A,position:[0,1.55,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.18,.18,.5,8]})}),(0,y.jsxs)(`group`,{ref:w,position:[0,1.85,0],children:[(0,y.jsx)(`mesh`,{material:A,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})}),(0,y.jsx)(`mesh`,{material:A,"rotation-y":Math.PI/2,children:(0,y.jsx)(`boxGeometry`,{args:[11,.06,.35]})})]})]})}export{w as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,D as i,O as a,Tt as o,f as s,nt as c}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,D as i,O as a,Tt as o,f as s,nt as c}from"./bloomMarks-JYeAmd4d.js";import{n as l,r as u}from"./Office-NV5zlSnK.js";import{n as d}from"./weatherState-BQ3UU4vU.js";import{a as f}from"./director-CrzFgnoP.js";import{i as p,o as m}from"./kit-D3twk12W.js";var h=e(t(),1),g=n(),_=`
|
|
2
2
|
varying vec2 vP;
|
|
3
3
|
void main() {
|
|
4
4
|
vP = position.xy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{f as r}from"./bloomMarks-JYeAmd4d.js";import{v as i,y as a}from"./index-D_Et7Vx8.js";import{dn as o,i as s,r as c,un as l}from"./Office-NV5zlSnK.js";import{Lo as u}from"./store-Buxt6UcJ.js";import{o as d}from"./cityLayout-VU-ug-r6.js";import{n as f}from"./billboardLayout-DSKGXPIM.js";import{a as p}from"./director-CrzFgnoP.js";import{c as m,l as h,o as g,t as _}from"./kit-D3twk12W.js";var v=e(t(),1),y=n(),b=70,x=1.15,S=4.6,C=[9,33,62],w=2.6,T=9e4;function E({run:e,elevation:t}){let n=(0,v.useRef)(null),E=(0,v.useRef)(null),D=(0,v.useRef)(null),O=(0,v.useRef)([]),k=(0,v.useRef)([]),A=(0,v.useRef)(null),j=(0,v.useRef)(null),M=g(e.side),N=(0,v.useMemo)(()=>{let t=p(e.seed),n=t()<.5?1:-1,r=l().map((e,t)=>({...e,i:t})).filter(e=>M*e.x>f.max+10&&M*e.x<260&&Math.abs(e.z)<160),i=e=>Math.abs(M*e.x-175)+Math.abs(e.z)*.8;r.sort((e,t)=>i(e)-i(t));let a=r[0]??null,o=a?d():null,s=a&&o?o.cylinders[a.cylinder]:null;return{dir:n,x:a?a.x+M*19:M*190,z0:(a?a.z:(t()-.5)*60)-n*S*40,tower:a,tankR:s?s.w/2:1.5}},[e.seed,M]),P=(0,v.useMemo)(()=>({shake:0,lastStep:-1,roared:-1,knocked:-1,crashed:!1}),[]);(0,v.useEffect)(()=>{let e=N.tower;return()=>{e&&P.knocked>=0?setTimeout(()=>o(e.i,!1),T):e&&o(e.i,!1)}},[N,P]),r(({camera:r},l)=>{let d=e.t,f=n.current;if(!f)return;let p=N.z0+N.dir*S*d,h=d/x*Math.PI,g=0,v=-1;for(let e=0;e<C.length;e++)g=Math.max(g,m(d,C[e],C[e]+.4)*(1-m(d,C[e]+w-.5,C[e]+w))),d>=C[e]&&d<C[e]+.5&&(v=e);let y=1-g*.8;f.position.set(N.x,Math.abs(Math.sin(h))*.7*y,p),f.rotation.set(0,(N.dir>0?0:Math.PI)-M*N.dir*.35,Math.sin(h)*.04*y);for(let e=0;e<2;e++){let t=O.current[e];t&&(t.rotation.x=Math.sin(h+e*Math.PI)*.45*y);let n=k.current[e];n&&(n.rotation.x=-.6-g*1.2+Math.sin(h*2+e)*.15)}A.current&&(A.current.rotation.y=Math.sin(h*.5)*.35);let T=E.current;if(T){let e=N.tower&&P.knocked>=0?m(d,P.knocked+.6,P.knocked+1.4)*(1-m(d,P.knocked+4,P.knocked+5)):0;T.rotation.set(-g*.55+e*.15,-M*N.dir*.3+Math.sin(d*.4)*.25+e*-M*N.dir*.6,e*.25)}D.current&&(D.current.scale.y=.25+g*1.6);let F=Math.floor(d/x);if(F!==P.lastStep&&y>.5){P.lastStep=F;let e=c(N.x,-t,p,200);s(`stomp`,{gain:e.gain,pan:e.pan,pitch:.9+Math.random()*.2}),P.shake=1}if(v>=0&&P.roared!==v){P.roared=v;let e=c(N.x,b*.9-t,p,200);s(`roar`,{gain:e.gain,pan:e.pan})}P.shake*=Math.exp(-6*Math.min(.1,l)),P.shake>.01&&i().cameraShake&&!a()&&u(r.position.x)&&(r.rotation.x+=P.shake*.0035*Math.sin(d*41),r.rotation.z+=P.shake*.0025*Math.sin(d*33));let I=N.tower,L=j.current;if(I&&L&&(P.knocked<0&&N.dir*(p-I.z)>-7&&(P.knocked=d,o(I.i,!0)),L.visible=P.knocked>=0,P.knocked>=0)){let e=_((d-P.knocked)/1.3);if(L.rotation.z=M*Math.PI*.5*e*e-(e>=1?M*.06*Math.sin((d-P.knocked-1.3)*12)*Math.exp(-(d-P.knocked-1.3)*4):0),e>=1&&!P.crashed){P.crashed=!0;let e=c(I.x,I.y-t,I.z,180);s(`crash`,{gain:e.gain,pan:e.pan})}}});let F=h(`#6abf69`),I=h(`#f6e7a1`),L=h(`#ff9f1c`),R=h(`#1f1d2b`),z=h(`#ffffff`);return(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`group`,{ref:n,children:(0,y.jsxs)(`group`,{scale:b,children:[(0,y.jsx)(`mesh`,{material:F,position:[0,.5,0],scale:[1,1.25,1.1],children:(0,y.jsx)(`sphereGeometry`,{args:[.28,20,14]})}),(0,y.jsx)(`mesh`,{material:I,position:[0,.47,.13],scale:[.85,1.15,.7],children:(0,y.jsx)(`sphereGeometry`,{args:[.22,16,12]})}),[0,1].map(e=>(0,y.jsxs)(`group`,{ref:t=>void(O.current[e]=t),position:[e?.13:-.13,.3,0],children:[(0,y.jsx)(`mesh`,{material:F,position:[0,-.14,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[.085,.1,.3,10]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.29,.04],scale:[1,.5,1.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.1,10,8]})})]},e)),[0,1].map(e=>(0,y.jsx)(`group`,{ref:t=>void(k.current[e]=t),position:[e?.22:-.22,.64,.1],children:(0,y.jsx)(`mesh`,{material:F,position:[0,-.05,.06],"rotation-x":.6,children:(0,y.jsx)(`capsuleGeometry`,{args:[.035,.1,4,8]})})},e)),(0,y.jsx)(`group`,{ref:A,position:[0,.36,-.24],children:[0,1,2,3].map(e=>(0,y.jsx)(`mesh`,{material:F,position:[0,-e*.05,-.1-e*.12],scale:1-e*.2,children:(0,y.jsx)(`sphereGeometry`,{args:[.12,12,8]})},e))}),[0,1,2,3,4].map(e=>(0,y.jsx)(`mesh`,{material:L,position:[0,.84-e*.12,-.1-e*.06],"rotation-x":-.5-e*.12,scale:1-e*.12,children:(0,y.jsx)(`coneGeometry`,{args:[.05,.12,6]})},e)),(0,y.jsxs)(`group`,{ref:E,position:[0,.86,.1],children:[(0,y.jsx)(`mesh`,{material:F,children:(0,y.jsx)(`sphereGeometry`,{args:[.17,18,14]})}),(0,y.jsx)(`mesh`,{material:F,position:[0,-.04,.15],scale:[1,.72,1.15],children:(0,y.jsx)(`sphereGeometry`,{args:[.11,14,10]})}),[-1,1].map(e=>(0,y.jsxs)(`group`,{children:[(0,y.jsx)(`mesh`,{material:z,position:[e*.075,.06,.12],children:(0,y.jsx)(`sphereGeometry`,{args:[.055,12,10]})}),(0,y.jsx)(`mesh`,{material:R,position:[e*.075,.065,.168],children:(0,y.jsx)(`sphereGeometry`,{args:[.027,10,8]})}),(0,y.jsx)(`mesh`,{material:h(`#ff8fab`),position:[e*.11,-.03,.12],scale:[1,.6,.4],children:(0,y.jsx)(`sphereGeometry`,{args:[.03,8,6]})})]},e)),(0,y.jsx)(`mesh`,{ref:D,material:h(`#7a1f3d`),position:[0,-.08,.255],scale:[1,.25,.5],children:(0,y.jsx)(`sphereGeometry`,{args:[.06,12,8]})})]})]})}),N.tower&&(0,y.jsx)(`group`,{ref:j,position:[N.tower.x-M*N.tankR,N.tower.y,N.tower.z],visible:!1,children:(0,y.jsxs)(`group`,{position:[M*N.tankR,0,0],children:[(0,y.jsx)(`mesh`,{material:h(`#5e4a3c`),position:[0,.8,0],children:(0,y.jsx)(`boxGeometry`,{args:[2.6,1.6,2.6]})}),(0,y.jsx)(`mesh`,{material:h(`#a0704a`),position:[0,3.1,0],children:(0,y.jsx)(`cylinderGeometry`,{args:[1.5,1.5,3,12]})}),(0,y.jsx)(`mesh`,{material:h(`#6b4a33`),position:[0,5.3,0],children:(0,y.jsx)(`coneGeometry`,{args:[1.8,1.4,12]})})]})})]})}export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,f as i,gt as a}from"./bloomMarks-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{s as t,t as n}from"./jsx-runtime-CXW0f58S.js";import{Bt as r,f as i,gt as a}from"./bloomMarks-JYeAmd4d.js";import{i as o,r as s}from"./Office-NV5zlSnK.js";import{a as c}from"./director-CrzFgnoP.js";import{i as l,n as u,o as d,r as f}from"./kit-D3twk12W.js";var p=e(t(),1),m=n(),h=14,g=new r(0,1,0);function _({run:e,elevation:t}){let n=(0,p.useRef)(null),_=d(e.side),v=(0,p.useMemo)(()=>({meteors:Array.from({length:h},()=>({born:-10,life:0,x:0,y:0,z:0,dir:new r,speed:0,size:1})),next:1,rnd:c(e.seed),q:new a,back:new r}),[e.seed]);return i(()=>{let r=e.t,i=v.rnd;for(;r>=v.next&&r<e.seconds-3;){let n=v.meteors.find(e=>r-e.born>e.life),a=.9+2.2*Math.exp(-(((r/e.seconds-.55)/.12)**2));if(v.next+=-Math.log(1-i()*.98)/a*1.4,n&&(n.born=r,n.life=.7+i()*.8,n.x=_*(180+i()*140),n.y=u(t)+50+i()*120,n.z=(i()-.5)*420,n.dir.set(-_*i()*.3,-.35-i()*.35,i()<.5?1:-1).normalize(),n.speed=110+i()*80,n.size=.6+i()*.8,i()<.3)){let i=s(n.x,n.y-t,n.z,200);o(`whoosh`,{gain:i.gain*l(r,e.seconds,4),pan:i.pan})}}let a=n.current?.children;if(a)for(let e=0;e<h;e++){let t=v.meteors[e],n=a[e],i=r-t.born;if(n.visible=i>=0&&i<t.life,!n.visible)continue;let o=i/t.life,s=Math.min(i*t.speed,30+t.size*10)*(1-o*.5),c=t.x+t.dir.x*t.speed*i,l=t.y+t.dir.y*t.speed*i,u=t.z+t.dir.z*t.speed*i;n.position.set(c-t.dir.x*s/2,l-t.dir.y*s/2,u-t.dir.z*s/2),n.quaternion.copy(v.q.setFromUnitVectors(g,v.back.copy(t.dir).negate()));let d=t.size*(1-o*o);n.scale.set(d,Math.max(.01,s),d)}}),(0,m.jsx)(`group`,{ref:n,children:Array.from({length:h},(e,t)=>(0,m.jsx)(`mesh`,{material:f(`#dfe9ff`,{opacity:.85,add:!0}),visible:!1,frustumCulled:!1,children:(0,m.jsx)(`coneGeometry`,{args:[.9,1,6,1,!0]})},t))})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{s as n,t as r}from"./jsx-runtime-CXW0f58S.js";import{Xo as i,Yo as a,Zo as o,es as s,hs as c,p as l}from"./store-CXLtXw8e.js";import{c as u,l as d,o as f,s as p}from"./index-CDJgPTOC.js";var m=t(n(),1),h=r();function g(){let e=l(e=>e.usage.observations),t=l(e=>e.agents),n=l(e=>e.settings.language),r=p(),i=e=>e===null?r(`Not available`):e.toLocaleString(n,{maximumFractionDigits:6});return(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Observed AI usage`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Latest 200 observations. Status rows are cumulative session counters, not additional consumption. Reported costs are not subscription charges or remaining quota.`})}),e?.length?[...e].reverse().map(e=>(0,h.jsxs)(`div`,{className:`card`,style:{overflowWrap:`anywhere`},children:[(0,h.jsxs)(`b`,{children:[e.agentId?t[e.agentId]?.name??e.agentId:`—`,` · `,e.tool]}),(0,h.jsxs)(`div`,{children:[e.provider??r(`Not available`),` / `,e.model??r(`Not available`)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Input tokens`}),`: `,i(e.input),` · `,(0,h.jsx)(f,{children:`Output tokens`}),`: `,i(e.output)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reasoning tokens`}),`: `,i(e.reasoning),` · `,(0,h.jsx)(f,{children:`Cache read / write`}),`: `,i(e.cacheRead),` / `,i(e.cacheWrite)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reported cost (USD)`}),`: `,i(e.costUsd),` · `,(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[new Date(e.at).toLocaleString(n),` · `,e.source]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Last observation`}),`: `,e.observedAt?new Date(e.observedAt).toLocaleString(n):r(`Not available`)]})]},JSON.stringify([e.tool,e.sessionId,e.id]))):(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`No usage observations received yet.`})})]})}function _({resume:e}){let t=l(e=>e.usage.resources);return(0,h.jsx)(`div`,{children:t?.map(t=>(0,h.jsx)(v,{resource:t,resume:e},t.key))})}function v({resource:e,resume:t}){let n=p(),r=l(e=>e.agents),i=l(e=>e.settings.language),o=l(e=>e.demo),[s,c]=(0,m.useState)(e.group??``),[g,_]=(0,m.useState)(!1),v={idle:`Idle`,preparing:`Setting up`,working:`Working`,done:`Finished`,error:`Needs help`,stopped:`Stopped`},y=e=>e===null?n(`Not available`):new Date(e).toLocaleString(i),b=async()=>{if(await d({icon:`🔗`,tone:`warn`,title:n(`Confirm shared quota`),body:(0,h.jsx)(`p`,{children:(0,h.jsx)(f,{children:`Use the same label only when these connections share a quota. This does not change provider, model or billing mode.`})}),confirm:n(`Confirm shared quota`)})){_(!0);try{await u.setUsageGroup(e.key,s)}catch{}finally{_(!1)}}};return(0,h.jsxs)(`section`,{className:`card`,style:{overflowWrap:`anywhere`,minWidth:0},"aria-label":`${e.tool} ${e.provider??``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsxs)(`b`,{children:[e.tool,` · `,e.provider??n(`Provider not reported`)]}),(0,h.jsx)(`span`,{className:`pill`,children:n(e.state===`paused`?`Paused`:e.state===`pacing`?`Pacing`:`No active limit signal`)})]}),(0,h.jsxs)(`div`,{children:[e.model??n(`Model not reported`),` · `,n(e.access===`api`?`API`:e.access===`subscription`?`Subscription`:`Access mode not reported`)]}),e.group&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Shared quota`}),`: `,e.group]}),(0,h.jsx)(`div`,{className:`muted small`,children:(0,h.jsx)(f,{children:e.observedAt===null?`Configured selection; awaiting session telemetry`:`Observed connection`})}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Running sessions`}),`: `,e.running,` · `,(0,h.jsx)(f,{children:`Last observation`}),`: `,y(e.observedAt)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Last quota signal`}),`: `,y(e.warning?.at??null),` · `,(0,h.jsx)(f,{children:`Reported reset`}),`: `,y(e.warning?.resetsAt??null)]}),e.until!==null&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Next scheduling check`}),`: `,y(e.until)]}),e.warning?.pct==null?(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}):(0,h.jsxs)(`div`,{children:[(0,h.jsx)(f,{children:`Reported usage`}),`: `,e.warning.pct,`% `,(0,h.jsx)(`meter`,{min:0,max:100,value:e.warning.pct,"aria-label":n(`Reported usage`)})]}),(0,h.jsx)(`ul`,{children:e.agentIds.map(e=>{let t=r[e];return(0,h.jsxs)(`li`,{children:[t?.name??e,` · `,t?.role===`ceo`?`CEO`:t?.repoId||`—`,` · `,t?n(v[t.status]??t.status):`—`,t?.startedAt?` · ${a((t.endedAt??Date.now())-t.startedAt)}`:``]},e)})}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:e.state!==`pacing`,onClick:()=>t(e.key),children:(0,h.jsx)(f,{children:`Resume this quota`})}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`warning`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate a usage warning`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`limit`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate reaching the limit`})})]})]}),(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Quota association`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Without an identified account or confirmed association, limits stay isolated. OAuth alone does not identify a subscription.`})}),(0,h.jsxs)(`label`,{children:[(0,h.jsx)(f,{children:`Confirmed shared quota label`}),(0,h.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),maxLength:64,style:{width:`100%`,boxSizing:`border-box`}})]}),(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:g||s===(e.group??``),onClick:()=>void b(),children:(0,h.jsx)(f,{children:`Save quota association`})})]})]})}function y(e,t,n){if(n!==`it`)return e.text;let r=e.kind===`pr`&&e.prNumber!==null?`PR #${e.prNumber} needs you`:e.kind===`agent`&&t?`${t} is stuck on an error`:null;return!r||!(e.text===r||e.text.startsWith(r+`: `))?e.text:(e.kind===`pr`?c(n,`PR #{number} needs you`,{number:e.prNumber}):c(n,`{name} is stuck on an error`,{name:t}))+e.text.slice(r.length)}function b(e,t,n,r){if(!e.startsWith(t)||!e.endsWith(n))return null;let i=/^(\d+) (minute|minutes|hours)$/.exec(e.slice(t.length,-n.length));return i?c(r,`{count} ${i[2]}`,{count:i[1]}):null}function x(e,t,n){if(n!==`it`)return e.text;let r=t??`Someone`,i={name:t??c(n,`Someone`),task:e.prNumber===null?`#${e.issueNumber}`:`PR #${e.prNumber}`,issue:e.issueNumber??`?`,pr:e.prNumber??`?`},a=(e,t={})=>c(n,e,{...i,...t});if(e.kind===`quiet`){let t=b(e.text,`${r} has been quiet for `,` on ${i.task}, even after a nudge. Stop them, or put the work back in line?`,n);if(t)return a(`{name} has been quiet for {duration} on {task}, even after a nudge. Stop them, or put the work back in line?`,{duration:t})}else if(e.kind===`preparing`){let t=b(e.text,`${r} has been setting up a desk for ${i.task} for `,`. Put the work back in line?`,n);if(t)return a(`{name} has been setting up a desk for {task} for {duration}. Put the work back in line?`,{duration:t})}else if(e.kind===`stale`){if(e.text===`${r}'s last task ${i.task} is already merged. Clear the desk?`)return a(`{name}’s last task {task} is already merged. Clear the desk?`);if(e.text===`${r}'s last task ${i.task} is already closed. Clear the desk?`)return a(`{name}’s last task {task} is already closed. Clear the desk?`)}else if(e.kind===`qa-orphan`){if(e.text===`PR #${e.prNumber} is marked as in QA, but nobody is testing it. Test it again?`)return a(`PR #{pr} is marked as in QA, but nobody is testing it. Test it again?`)}else if(e.kind===`fix-orphan`){if(e.text===`PR #${e.prNumber} is waiting for a fix, but ${e.agentId?`${r} is on something else`:`nobody is on it`}. Hand it to a free agent?`)return a(e.agentId?`PR #{pr} is waiting for a fix, but {name} is on something else. Hand it to a free agent?`:`PR #{pr} is waiting for a fix, but nobody is on it. Hand it to a free agent?`)}else if(e.kind===`unclosed`){let t=b(e.text,`Issue #${e.issueNumber} is still open, but PR #${e.prNumber}, which closes it, was merged `,` ago. Close it?`,n);if(t)return a(`Issue #{issue} is still open, but PR #{pr}, which closes it, was merged {duration} ago. Close it?`,{duration:t})}return e.text}var S=e({UsageCard:()=>T});async function C(e){try{return await e()}catch{return}}async function w(e){let{usage:t,settings:n}=l.getState(),r=(e,t)=>c(n.language,e,t),i=t.resources?.filter(e=>e.state===`pacing`)??[],a=e?i.find(t=>t.key===e):i.length===1?i[0]:void 0;a?(document.pointerLockElement&&document.exitPointerLock(),await d({icon:`⏩`,tone:`warn`,title:r(`Resume full speed?`),body:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`p`,{children:[a.tool,` · `,a.provider??r(`Provider not reported`),` · `,a.group??a.model]}),(0,h.jsx)(`p`,{children:r(`Resume only this quota. Hard limits cannot be cleared early; other quotas are unchanged.`)})]}),confirm:r(`Resume full speed`)})&&await C(()=>u.resumeFullSpeed(a.key))):l.getState().openOverlay({kind:`manager`,tab:`ops`,card:`usage`})}function T({hot:e}){let t=l(e=>e.settings.language),n=l(e=>e.usage),r=s(n,Date.now(),t);return(0,h.jsxs)(`div`,{id:`ops-card-usage`,className:`card usage-card usage-${r.tone} ${e?`ops-card-hot`:``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`b`,{children:(0,h.jsx)(f,{children:`🤖 AI usage`})}),(0,h.jsx)(`span`,{className:`pill usage-pill-${r.tone}`,children:r.state})]}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Limits apply only to the affected quota. Warnings pace new issues; hard limits also hold QA, fixes and CEO jobs. Running sessions continue. Missing data does not mean unlimited usage.`})}),(0,h.jsx)(_,{resume:e=>void w(e)}),(0,h.jsx)(g,{})]})}function E({alarm:e,repo:t,hot:n}){let r=p(),i=l(e=>e.settings.language),a=l(t=>e.agentId?t.agents[e.agentId]?.name:void 0),o=l(e=>e.openOverlay),s=l(e=>e.goToFloor),c=e.prNumber===null?void 0:t?.pulls.find(t=>t.number===e.prNumber);return(0,h.jsxs)(`div`,{id:`ops-card-${e.id}`,className:`card floor-card alarm-card ${n?`ops-card-hot`:``}`,style:{"--accent":t?.color??`#ef476f`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🚨 `,y(e,a,i)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,c?` · ${c.title}`:``,` · `,r(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.kind===`pr`&&e.prNumber!==null?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`kanban`,repoId:e.repoId}),children:(0,h.jsx)(f,{children:`📋 Open the Kanban`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>void C(()=>u.sendToQa(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Retry QA`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,title:r(`Hand it to its author, or any free agent, with QA’s findings`),onClick:()=>void C(()=>u.sendBack(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Send back for a fix`})}),c&&(0,h.jsx)(`a`,{className:`small`,href:c.url,target:`_blank`,rel:`noreferrer`,children:(0,h.jsx)(f,{children:`PR on GitHub ↗`})})]}):e.agentId&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,title:r(`Clear their desk so they take new work`),onClick:()=>void C(()=>u.reset(e.agentId)),children:(0,h.jsx)(f,{children:`Clear desk`})})]}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>s(e.floor),children:r(`Visit floor {floor}`,{floor:e.floor})})]})]})}var D={clear:[`↺ Clear desk`,`Clear their desk so they take new work`],stop:[`■ Stop`,`Stop their session`],requeue:[`↩ Requeue`,`Stop them and put the work back in line, without a strike`],"retry-qa":[`Retry QA`,`Queue the PR for a fresh QA run`],"send-back":[`Send back for a fix`,`Hand the PR to its author, or any free agent`],"close-issue":[`Close issue`,`Close the issue on GitHub as completed`]};async function O(e,t){let n=(e,t)=>c(l.getState().settings.language,e,t);t===`close-issue`&&(document.pointerLockElement&&document.exitPointerLock(),!await d({icon:`🩺`,tone:`warn`,title:n(`Close issue #{number}?`,{number:e.issueNumber??`?`}),body:(0,h.jsx)(`p`,{children:n(`It’s closed on GitHub as completed, with a comment saying PR #{number} resolved it.`,{number:e.prNumber??`?`})}),confirm:n(`Close issue`)}))||await C(()=>u.doctorFix(e.id,t))}function k({finding:e,repo:t}){let n=p(),r=l(e=>e.settings.language),i=l(t=>e.agentId?t.agents[e.agentId]?.name:void 0),a=l(e=>e.openOverlay);return(0,h.jsxs)(`div`,{id:`ops-card-doctor-${e.id}`,className:`card floor-card alarm-card doctor-card`,style:{"--accent":t?.color??`#7c6cf0`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:t?.floor??`?`}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🩺 `,x(e,i,r)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,` · `,n(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.fixes.map((t,r)=>(0,h.jsx)(`button`,{className:`btn btn-small ${r===0?`btn-good`:``}`,title:n(D[t][1]),onClick:()=>void O(e,t),children:n(D[t][0])},t)),e.agentId&&(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>a({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:n(`Hide it until it goes away`),onClick:()=>void C(()=>u.doctorIgnore(e.id)),children:(0,h.jsx)(f,{children:`Ignore`})})]})]})}async function A(e){let t=await C(()=>u.demoDoctor(e));t&&l.getState().pushToast(`info`,t.text)}function j({hot:e}){let t=p(),n=l(e=>e.doctor),r=l(e=>e.repos),i=l(e=>e.demo);return(0,h.jsxs)(`div`,{id:`ops-card-doctor`,className:e?`ops-card-hot`:``,children:[(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🩺 Office doctor`}),` `,n.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:n.length})]}),n.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Nothing stuck. Every minute the watchdog nudges quiet sessions, frees stuck desks and puts orphaned work back in line by itself; what it can’t safely fix shows up here.`})}),n.map(e=>(0,h.jsx)(k,{finding:e,repo:r.find(t=>t.id===e.repoId)},e.id)),i&&(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`span`,{className:`muted small`,children:`Demo:`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Restart with desks gone and work finished on GitHub meanwhile`),onClick:()=>void A(`restart`),children:(0,h.jsx)(f,{children:`Simulate a restart`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Someone’s session goes quiet for 20 minutes`),onClick:()=>void A(`stuck`),children:(0,h.jsx)(f,{children:`Make a session stuck`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Ten more minutes pass for the stuck sessions`),onClick:()=>void A(`later`),children:(0,h.jsx)(f,{children:`10 minutes later`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`A merged PR whose issue was never closed`),onClick:()=>void A(`unclosed`),children:(0,h.jsx)(f,{children:`Leave an issue open`})})]})]})}var M=[[`Ready to start`,e=>String(e.ready),`Backlog issues that can start now`],[`Building`,e=>String(e.building)],[`In QA`,e=>String(e.inQa)],[`Fixing`,e=>String(e.fixing),`Back with an agent: QA findings, checks or a conflict`],[`To merge`,e=>String(e.toMerge)],[`Needs you`,e=>`${e.needsYou}${e.triage?` (+${e.triage} 🧭)`:``}`,`🧭: the CEO is looking first`],[`Merged today`,(e,t)=>t(`{count} ({hour} last hour)`,{count:e.mergedToday,hour:e.mergedHour})],[`Lead time`,e=>a(e.leadMs),`Median issue → merge over the last 24 hours`],[`QA wait`,e=>a(e.qaWaitMs),`Median wait for a free agent over the last 24 hours`],[`CI`,e=>e.ciRuns?`${i(e.ciPass)} · ${a(e.ciMs)}`:`—`,`GitHub’s checks over 7 days: pass rate · median time`],[`Team`,(e,t)=>t(`{busy} busy · {idle} idle`,{busy:e.busy,idle:e.idle})+(e.errors?t(` · errors: {count}`,{count:e.errors}):``)],[`Cost today`,e=>`~${o(e.costToday)}`,`An estimate from finished sessions’ reported cost`]];function N(){let e=p(),t=l(e=>e.ops),n=l(e=>e.repos),r=[...t.floors.map(e=>{let t=n.find(t=>t.id===e.repoId);return[`${e.floor} · ${t?.fullName.split(`/`)[1]??e.repoId}`,t?.color??`#ccc`,e]}),[e(`All floors`),`#1f1d2b`,t.total]];return(0,h.jsxs)(`div`,{className:`ops-table-wrap`,children:[(0,h.jsxs)(`table`,{className:`ops-table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{}),r.map(([e,t])=>(0,h.jsx)(`th`,{style:{"--accent":t},className:`ops-col`,children:e},e))]})}),(0,h.jsx)(`tbody`,{children:M.map(([t,n,i])=>(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{title:i?e(i):void 0,children:e(t)}),r.map(([t,,r])=>(0,h.jsx)(`td`,{children:n(r,e)},t))]},t))})]}),t.ceoCostToday>0&&(0,h.jsx)(`div`,{className:`muted small`,children:e(`The CEO’s sessions today: ~{cost} (in All floors’ cost).`,{cost:o(t.ceoCostToday)})})]})}function P({card:e}){let t=l(e=>e.ops.alarms),n=l(e=>e.repos);return(0,m.useEffect)(()=>{e&&document.getElementById(`ops-card-${e}`)?.scrollIntoView({block:`center`})},[e]),(0,h.jsxs)(`div`,{className:`tab-grid`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(T,{hot:e===`usage`}),(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🚨 Needs you`}),` `,t.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:t.length})]}),t.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`All clear. The beacon on the lobby’s mission control wall spins when a PR needs you or an agent has been stuck on an error for 10 minutes.`})}),t.map(t=>(0,h.jsx)(E,{alarm:t,repo:n.find(e=>e.id===t.repoId),hot:t.id===e},t.id)),(0,h.jsx)(j,{hot:e===`doctor`})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`section`,children:(0,h.jsx)(f,{children:`🛰️ The numbers`})}),(0,h.jsx)(N,{})]})]})}export{P as n,w as r,S as t};
|
|
1
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{s as n,t as r}from"./jsx-runtime-CXW0f58S.js";import{Xo as i,Yo as a,Zo as o,es as s,hs as c,p as l}from"./store-Buxt6UcJ.js";import{c as u,l as d,o as f,s as p}from"./index-D_Et7Vx8.js";var m=t(n(),1),h=r();function g(){let e=l(e=>e.usage.observations),t=l(e=>e.agents),n=l(e=>e.settings.language),r=p(),i=e=>e===null?r(`Not available`):e.toLocaleString(n,{maximumFractionDigits:6});return(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Observed AI usage`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Latest 200 observations. Status rows are cumulative session counters, not additional consumption. Reported costs are not subscription charges or remaining quota.`})}),e?.length?[...e].reverse().map(e=>(0,h.jsxs)(`div`,{className:`card`,style:{overflowWrap:`anywhere`},children:[(0,h.jsxs)(`b`,{children:[e.agentId?t[e.agentId]?.name??e.agentId:`—`,` · `,e.tool]}),(0,h.jsxs)(`div`,{children:[e.provider??r(`Not available`),` / `,e.model??r(`Not available`)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Input tokens`}),`: `,i(e.input),` · `,(0,h.jsx)(f,{children:`Output tokens`}),`: `,i(e.output)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reasoning tokens`}),`: `,i(e.reasoning),` · `,(0,h.jsx)(f,{children:`Cache read / write`}),`: `,i(e.cacheRead),` / `,i(e.cacheWrite)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Reported cost (USD)`}),`: `,i(e.costUsd),` · `,(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[new Date(e.at).toLocaleString(n),` · `,e.source]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Last observation`}),`: `,e.observedAt?new Date(e.observedAt).toLocaleString(n):r(`Not available`)]})]},JSON.stringify([e.tool,e.sessionId,e.id]))):(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`No usage observations received yet.`})})]})}function _({resume:e}){let t=l(e=>e.usage.resources);return(0,h.jsx)(`div`,{children:t?.map(t=>(0,h.jsx)(v,{resource:t,resume:e},t.key))})}function v({resource:e,resume:t}){let n=p(),r=l(e=>e.agents),i=l(e=>e.settings.language),o=l(e=>e.demo),[s,c]=(0,m.useState)(e.group??``),[g,_]=(0,m.useState)(!1),v={idle:`Idle`,preparing:`Setting up`,working:`Working`,done:`Finished`,error:`Needs help`,stopped:`Stopped`},y=e=>e===null?n(`Not available`):new Date(e).toLocaleString(i),b=async()=>{if(await d({icon:`🔗`,tone:`warn`,title:n(`Confirm shared quota`),body:(0,h.jsx)(`p`,{children:(0,h.jsx)(f,{children:`Use the same label only when these connections share a quota. This does not change provider, model or billing mode.`})}),confirm:n(`Confirm shared quota`)})){_(!0);try{await u.setUsageGroup(e.key,s)}catch{}finally{_(!1)}}};return(0,h.jsxs)(`section`,{className:`card`,style:{overflowWrap:`anywhere`,minWidth:0},"aria-label":`${e.tool} ${e.provider??``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsxs)(`b`,{children:[e.tool,` · `,e.provider??n(`Provider not reported`)]}),(0,h.jsx)(`span`,{className:`pill`,children:n(e.state===`paused`?`Paused`:e.state===`pacing`?`Pacing`:`No active limit signal`)})]}),(0,h.jsxs)(`div`,{children:[e.model??n(`Model not reported`),` · `,n(e.access===`api`?`API`:e.access===`subscription`?`Subscription`:`Access mode not reported`)]}),e.group&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Shared quota`}),`: `,e.group]}),(0,h.jsx)(`div`,{className:`muted small`,children:(0,h.jsx)(f,{children:e.observedAt===null?`Configured selection; awaiting session telemetry`:`Observed connection`})}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Running sessions`}),`: `,e.running,` · `,(0,h.jsx)(f,{children:`Last observation`}),`: `,y(e.observedAt)]}),(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Last quota signal`}),`: `,y(e.warning?.at??null),` · `,(0,h.jsx)(f,{children:`Reported reset`}),`: `,y(e.warning?.resetsAt??null)]}),e.until!==null&&(0,h.jsxs)(`div`,{className:`small`,children:[(0,h.jsx)(f,{children:`Next scheduling check`}),`: `,y(e.until)]}),e.warning?.pct==null?(0,h.jsxs)(`div`,{className:`muted small`,children:[(0,h.jsx)(f,{children:`Remaining quota`}),`: `,(0,h.jsx)(f,{children:`Not available`})]}):(0,h.jsxs)(`div`,{children:[(0,h.jsx)(f,{children:`Reported usage`}),`: `,e.warning.pct,`% `,(0,h.jsx)(`meter`,{min:0,max:100,value:e.warning.pct,"aria-label":n(`Reported usage`)})]}),(0,h.jsx)(`ul`,{children:e.agentIds.map(e=>{let t=r[e];return(0,h.jsxs)(`li`,{children:[t?.name??e,` · `,t?.role===`ceo`?`CEO`:t?.repoId||`—`,` · `,t?n(v[t.status]??t.status):`—`,t?.startedAt?` · ${a((t.endedAt??Date.now())-t.startedAt)}`:``]},e)})}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:e.state!==`pacing`,onClick:()=>t(e.key),children:(0,h.jsx)(f,{children:`Resume this quota`})}),o&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`warning`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate a usage warning`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>void u.simulateUsage(`limit`,e.agentIds[0]).catch(()=>void 0),children:(0,h.jsx)(f,{children:`Simulate reaching the limit`})})]})]}),(0,h.jsxs)(`details`,{children:[(0,h.jsx)(`summary`,{children:(0,h.jsx)(f,{children:`Quota association`})}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Without an identified account or confirmed association, limits stay isolated. OAuth alone does not identify a subscription.`})}),(0,h.jsxs)(`label`,{children:[(0,h.jsx)(f,{children:`Confirmed shared quota label`}),(0,h.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),maxLength:64,style:{width:`100%`,boxSizing:`border-box`}})]}),(0,h.jsx)(`button`,{className:`btn btn-small`,disabled:g||s===(e.group??``),onClick:()=>void b(),children:(0,h.jsx)(f,{children:`Save quota association`})})]})]})}function y(e,t,n){if(n!==`it`)return e.text;let r=e.kind===`pr`&&e.prNumber!==null?`PR #${e.prNumber} needs you`:e.kind===`agent`&&t?`${t} is stuck on an error`:null;return!r||!(e.text===r||e.text.startsWith(r+`: `))?e.text:(e.kind===`pr`?c(n,`PR #{number} needs you`,{number:e.prNumber}):c(n,`{name} is stuck on an error`,{name:t}))+e.text.slice(r.length)}function b(e,t,n,r){if(!e.startsWith(t)||!e.endsWith(n))return null;let i=/^(\d+) (minute|minutes|hours)$/.exec(e.slice(t.length,-n.length));return i?c(r,`{count} ${i[2]}`,{count:i[1]}):null}function x(e,t,n){if(n!==`it`)return e.text;let r=t??`Someone`,i={name:t??c(n,`Someone`),task:e.prNumber===null?`#${e.issueNumber}`:`PR #${e.prNumber}`,issue:e.issueNumber??`?`,pr:e.prNumber??`?`},a=(e,t={})=>c(n,e,{...i,...t});if(e.kind===`quiet`){let t=b(e.text,`${r} has been quiet for `,` on ${i.task}, even after a nudge. Stop them, or put the work back in line?`,n);if(t)return a(`{name} has been quiet for {duration} on {task}, even after a nudge. Stop them, or put the work back in line?`,{duration:t})}else if(e.kind===`preparing`){let t=b(e.text,`${r} has been setting up a desk for ${i.task} for `,`. Put the work back in line?`,n);if(t)return a(`{name} has been setting up a desk for {task} for {duration}. Put the work back in line?`,{duration:t})}else if(e.kind===`stale`){if(e.text===`${r}'s last task ${i.task} is already merged. Clear the desk?`)return a(`{name}’s last task {task} is already merged. Clear the desk?`);if(e.text===`${r}'s last task ${i.task} is already closed. Clear the desk?`)return a(`{name}’s last task {task} is already closed. Clear the desk?`)}else if(e.kind===`qa-orphan`){if(e.text===`PR #${e.prNumber} is marked as in QA, but nobody is testing it. Test it again?`)return a(`PR #{pr} is marked as in QA, but nobody is testing it. Test it again?`)}else if(e.kind===`fix-orphan`){if(e.text===`PR #${e.prNumber} is waiting for a fix, but ${e.agentId?`${r} is on something else`:`nobody is on it`}. Hand it to a free agent?`)return a(e.agentId?`PR #{pr} is waiting for a fix, but {name} is on something else. Hand it to a free agent?`:`PR #{pr} is waiting for a fix, but nobody is on it. Hand it to a free agent?`)}else if(e.kind===`unclosed`){let t=b(e.text,`Issue #${e.issueNumber} is still open, but PR #${e.prNumber}, which closes it, was merged `,` ago. Close it?`,n);if(t)return a(`Issue #{issue} is still open, but PR #{pr}, which closes it, was merged {duration} ago. Close it?`,{duration:t})}return e.text}var S=e({UsageCard:()=>T});async function C(e){try{return await e()}catch{return}}async function w(e){let{usage:t,settings:n}=l.getState(),r=(e,t)=>c(n.language,e,t),i=t.resources?.filter(e=>e.state===`pacing`)??[],a=e?i.find(t=>t.key===e):i.length===1?i[0]:void 0;a?(document.pointerLockElement&&document.exitPointerLock(),await d({icon:`⏩`,tone:`warn`,title:r(`Resume full speed?`),body:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`p`,{children:[a.tool,` · `,a.provider??r(`Provider not reported`),` · `,a.group??a.model]}),(0,h.jsx)(`p`,{children:r(`Resume only this quota. Hard limits cannot be cleared early; other quotas are unchanged.`)})]}),confirm:r(`Resume full speed`)})&&await C(()=>u.resumeFullSpeed(a.key))):l.getState().openOverlay({kind:`manager`,tab:`ops`,card:`usage`})}function T({hot:e}){let t=l(e=>e.settings.language),n=l(e=>e.usage),r=s(n,Date.now(),t);return(0,h.jsxs)(`div`,{id:`ops-card-usage`,className:`card usage-card usage-${r.tone} ${e?`ops-card-hot`:``}`,children:[(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`b`,{children:(0,h.jsx)(f,{children:`🤖 AI usage`})}),(0,h.jsx)(`span`,{className:`pill usage-pill-${r.tone}`,children:r.state})]}),(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Limits apply only to the affected quota. Warnings pace new issues; hard limits also hold QA, fixes and CEO jobs. Running sessions continue. Missing data does not mean unlimited usage.`})}),(0,h.jsx)(_,{resume:e=>void w(e)}),(0,h.jsx)(g,{})]})}function E({alarm:e,repo:t,hot:n}){let r=p(),i=l(e=>e.settings.language),a=l(t=>e.agentId?t.agents[e.agentId]?.name:void 0),o=l(e=>e.openOverlay),s=l(e=>e.goToFloor),c=e.prNumber===null?void 0:t?.pulls.find(t=>t.number===e.prNumber);return(0,h.jsxs)(`div`,{id:`ops-card-${e.id}`,className:`card floor-card alarm-card ${n?`ops-card-hot`:``}`,style:{"--accent":t?.color??`#ef476f`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:e.floor}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🚨 `,y(e,a,i)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,c?` · ${c.title}`:``,` · `,r(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.kind===`pr`&&e.prNumber!==null?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`kanban`,repoId:e.repoId}),children:(0,h.jsx)(f,{children:`📋 Open the Kanban`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,onClick:()=>void C(()=>u.sendToQa(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Retry QA`})}),(0,h.jsx)(`button`,{className:`btn btn-small`,title:r(`Hand it to its author, or any free agent, with QA’s findings`),onClick:()=>void C(()=>u.sendBack(e.repoId,e.prNumber)),children:(0,h.jsx)(f,{children:`Send back for a fix`})}),c&&(0,h.jsx)(`a`,{className:`small`,href:c.url,target:`_blank`,rel:`noreferrer`,children:(0,h.jsx)(f,{children:`PR on GitHub ↗`})})]}):e.agentId&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>o({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-good`,title:r(`Clear their desk so they take new work`),onClick:()=>void C(()=>u.reset(e.agentId)),children:(0,h.jsx)(f,{children:`Clear desk`})})]}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,onClick:()=>s(e.floor),children:r(`Visit floor {floor}`,{floor:e.floor})})]})]})}var D={clear:[`↺ Clear desk`,`Clear their desk so they take new work`],stop:[`■ Stop`,`Stop their session`],requeue:[`↩ Requeue`,`Stop them and put the work back in line, without a strike`],"retry-qa":[`Retry QA`,`Queue the PR for a fresh QA run`],"send-back":[`Send back for a fix`,`Hand the PR to its author, or any free agent`],"close-issue":[`Close issue`,`Close the issue on GitHub as completed`]};async function O(e,t){let n=(e,t)=>c(l.getState().settings.language,e,t);t===`close-issue`&&(document.pointerLockElement&&document.exitPointerLock(),!await d({icon:`🩺`,tone:`warn`,title:n(`Close issue #{number}?`,{number:e.issueNumber??`?`}),body:(0,h.jsx)(`p`,{children:n(`It’s closed on GitHub as completed, with a comment saying PR #{number} resolved it.`,{number:e.prNumber??`?`})}),confirm:n(`Close issue`)}))||await C(()=>u.doctorFix(e.id,t))}function k({finding:e,repo:t}){let n=p(),r=l(e=>e.settings.language),i=l(t=>e.agentId?t.agents[e.agentId]?.name:void 0),a=l(e=>e.openOverlay);return(0,h.jsxs)(`div`,{id:`ops-card-doctor-${e.id}`,className:`card floor-card alarm-card doctor-card`,style:{"--accent":t?.color??`#7c6cf0`},children:[(0,h.jsxs)(`div`,{className:`row`,children:[(0,h.jsx)(`span`,{className:`floor-badge`,children:t?.floor??`?`}),(0,h.jsxs)(`div`,{className:`grow`,children:[(0,h.jsxs)(`b`,{children:[`🩺 `,x(e,i,r)]}),(0,h.jsxs)(`div`,{className:`muted small`,children:[t?.fullName??e.repoId,` · `,n(`since {time}`,{time:new Date(e.since).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})})]})]})]}),(0,h.jsxs)(`div`,{className:`row wrap`,children:[e.fixes.map((t,r)=>(0,h.jsx)(`button`,{className:`btn btn-small ${r===0?`btn-good`:``}`,title:n(D[t][1]),onClick:()=>void O(e,t),children:n(D[t][0])},t)),e.agentId&&(0,h.jsx)(`button`,{className:`btn btn-small`,onClick:()=>a({kind:`terminal`,agentId:e.agentId}),children:(0,h.jsx)(f,{children:`Terminal`})}),(0,h.jsx)(`span`,{className:`spacer`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:n(`Hide it until it goes away`),onClick:()=>void C(()=>u.doctorIgnore(e.id)),children:(0,h.jsx)(f,{children:`Ignore`})})]})]})}async function A(e){let t=await C(()=>u.demoDoctor(e));t&&l.getState().pushToast(`info`,t.text)}function j({hot:e}){let t=p(),n=l(e=>e.doctor),r=l(e=>e.repos),i=l(e=>e.demo);return(0,h.jsxs)(`div`,{id:`ops-card-doctor`,className:e?`ops-card-hot`:``,children:[(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🩺 Office doctor`}),` `,n.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:n.length})]}),n.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`Nothing stuck. Every minute the watchdog nudges quiet sessions, frees stuck desks and puts orphaned work back in line by itself; what it can’t safely fix shows up here.`})}),n.map(e=>(0,h.jsx)(k,{finding:e,repo:r.find(t=>t.id===e.repoId)},e.id)),i&&(0,h.jsxs)(`div`,{className:`row wrap`,children:[(0,h.jsx)(`span`,{className:`muted small`,children:`Demo:`}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Restart with desks gone and work finished on GitHub meanwhile`),onClick:()=>void A(`restart`),children:(0,h.jsx)(f,{children:`Simulate a restart`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Someone’s session goes quiet for 20 minutes`),onClick:()=>void A(`stuck`),children:(0,h.jsx)(f,{children:`Make a session stuck`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`Ten more minutes pass for the stuck sessions`),onClick:()=>void A(`later`),children:(0,h.jsx)(f,{children:`10 minutes later`})}),(0,h.jsx)(`button`,{className:`btn btn-small btn-ghost`,title:t(`A merged PR whose issue was never closed`),onClick:()=>void A(`unclosed`),children:(0,h.jsx)(f,{children:`Leave an issue open`})})]})]})}var M=[[`Ready to start`,e=>String(e.ready),`Backlog issues that can start now`],[`Building`,e=>String(e.building)],[`In QA`,e=>String(e.inQa)],[`Fixing`,e=>String(e.fixing),`Back with an agent: QA findings, checks or a conflict`],[`To merge`,e=>String(e.toMerge)],[`Needs you`,e=>`${e.needsYou}${e.triage?` (+${e.triage} 🧭)`:``}`,`🧭: the CEO is looking first`],[`Merged today`,(e,t)=>t(`{count} ({hour} last hour)`,{count:e.mergedToday,hour:e.mergedHour})],[`Lead time`,e=>a(e.leadMs),`Median issue → merge over the last 24 hours`],[`QA wait`,e=>a(e.qaWaitMs),`Median wait for a free agent over the last 24 hours`],[`CI`,e=>e.ciRuns?`${i(e.ciPass)} · ${a(e.ciMs)}`:`—`,`GitHub’s checks over 7 days: pass rate · median time`],[`Team`,(e,t)=>t(`{busy} busy · {idle} idle`,{busy:e.busy,idle:e.idle})+(e.errors?t(` · errors: {count}`,{count:e.errors}):``)],[`Cost today`,e=>`~${o(e.costToday)}`,`An estimate from finished sessions’ reported cost`]];function N(){let e=p(),t=l(e=>e.ops),n=l(e=>e.repos),r=[...t.floors.map(e=>{let t=n.find(t=>t.id===e.repoId);return[`${e.floor} · ${t?.fullName.split(`/`)[1]??e.repoId}`,t?.color??`#ccc`,e]}),[e(`All floors`),`#1f1d2b`,t.total]];return(0,h.jsxs)(`div`,{className:`ops-table-wrap`,children:[(0,h.jsxs)(`table`,{className:`ops-table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{}),r.map(([e,t])=>(0,h.jsx)(`th`,{style:{"--accent":t},className:`ops-col`,children:e},e))]})}),(0,h.jsx)(`tbody`,{children:M.map(([t,n,i])=>(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`th`,{title:i?e(i):void 0,children:e(t)}),r.map(([t,,r])=>(0,h.jsx)(`td`,{children:n(r,e)},t))]},t))})]}),t.ceoCostToday>0&&(0,h.jsx)(`div`,{className:`muted small`,children:e(`The CEO’s sessions today: ~{cost} (in All floors’ cost).`,{cost:o(t.ceoCostToday)})})]})}function P({card:e}){let t=l(e=>e.ops.alarms),n=l(e=>e.repos);return(0,m.useEffect)(()=>{e&&document.getElementById(`ops-card-${e}`)?.scrollIntoView({block:`center`})},[e]),(0,h.jsxs)(`div`,{className:`tab-grid`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(T,{hot:e===`usage`}),(0,h.jsxs)(`h3`,{className:`section`,children:[(0,h.jsx)(f,{children:`🚨 Needs you`}),` `,t.length>0&&(0,h.jsx)(`span`,{className:`badge`,children:t.length})]}),t.length===0&&(0,h.jsx)(`p`,{className:`muted small`,children:(0,h.jsx)(f,{children:`All clear. The beacon on the lobby’s mission control wall spins when a PR needs you or an agent has been stuck on an error for 10 minutes.`})}),t.map(t=>(0,h.jsx)(E,{alarm:t,repo:n.find(e=>e.id===t.repoId),hot:t.id===e},t.id)),(0,h.jsx)(j,{hot:e===`doctor`})]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h3`,{className:`section`,children:(0,h.jsx)(f,{children:`🛰️ The numbers`})}),(0,h.jsx)(N,{})]})]})}export{P as n,w as r,S as t};
|