geneseed 6.0.1 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +53 -10
- package/adapters/opencode/plugins/geneseed-learn.js +11 -4
- package/docs/concepts/agents.md +2 -2
- package/docs/web-ui.md +25 -0
- package/harness.config.json +1 -1
- package/js/README.md +2 -1
- package/js/build/bundle.mjs +2 -11
- package/js/build/emit-claude.mjs +2 -2
- package/js/build/emit-opencode.mjs +4 -2
- package/js/build/fold.mjs +3 -20
- package/js/build/source.mjs +1 -1
- package/js/build/stubs.mjs +42 -5
- package/js/cli-table.json +1 -1
- package/js/hosts/hooks-context.mjs +65 -9
- package/js/hosts/memory-files.mjs +166 -13
- package/js/hosts/native.mjs +48 -27
- package/js/hosts/opencode.mjs +3 -2
- package/js/inspect/checks-build.mjs +2 -2
- package/js/inspect/doctor.mjs +2 -0
- package/js/inspect/status.mjs +4 -1
- package/js/maintain/memory.mjs +2 -2
- package/js/web/agent-models-api.mjs +52 -17
- package/js/web/api.mjs +3 -0
- package/js/web/catalog.mjs +5 -3
- package/js/web/model-catalog.mjs +324 -0
- package/js/web/routes.mjs +5 -3
- package/package.json +1 -1
- package/src/agents/memory-curator.md +1 -1
- package/src/memory/README.md +24 -5
- package/src/skills/rule/approve.md +3 -1
- package/src/skills/rule/consolidate.md +1 -1
- package/web/dist/assets/ActiveLoops-paFbiZyt.js +1 -0
- package/web/dist/assets/Activity-IAxWF2wK.js +1 -0
- package/web/dist/assets/ActivityDetail-CtC2DLvh.js +1 -0
- package/web/dist/assets/{Bonsai-8NtlFrPO.js → Bonsai-BoKo68Kw.js} +1 -1
- package/web/dist/assets/{CopyButton-BHqKgdjJ.js → CopyButton-C0VTiqmb.js} +1 -1
- package/web/dist/assets/Dashboard-CRGCp2cV.js +2 -0
- package/web/dist/assets/{Docs-C1jzrFnD.js → Docs-DwOwzaD6.js} +2 -2
- package/web/dist/assets/Factories-DxHD2T-1.js +1 -0
- package/web/dist/assets/{GreenhouseView-ofAQ-V5h.js → GreenhouseView-D5VOmhmR.js} +1 -1
- package/web/dist/assets/Installs-B5hFSUeN.js +3 -0
- package/web/dist/assets/JournalView-gUSGysTm.js +1 -0
- package/web/dist/assets/{Kits-P4xspDuN.js → Kits-DYQvykZ0.js} +1 -1
- package/web/dist/assets/Laws-UVk0uojS.js +4 -0
- package/web/dist/assets/{LibRows-CGO25X3D.js → LibRows-CwK63kjB.js} +1 -1
- package/web/dist/assets/Library-DdzyrwUK.js +3 -0
- package/web/dist/assets/Loops-yHga7xdr.js +2 -0
- package/web/dist/assets/Models-DAgkQ4CE.js +1 -0
- package/web/dist/assets/{OperatorHudView-Cc8mlViW.js → OperatorHudView-D1lQF-ZY.js} +1 -1
- package/web/dist/assets/Personal-DjhIfa9v.js +2 -0
- package/web/dist/assets/Settings-Brgec4M0.js +1 -0
- package/web/dist/assets/Tabs-BHjxciOL.js +1 -0
- package/web/dist/assets/api-C8nMUU1i.js +1 -0
- package/web/dist/assets/index-BILaKHbH.js +6 -0
- package/web/dist/assets/index-BfyZCNu7.css +1 -0
- package/web/dist/assets/router-1EhRJy1C.js +1 -0
- package/web/dist/assets/useLocalStorage-54tkqXN7.js +1 -0
- package/web/dist/index.html +5 -3
- package/web/dist/assets/ActiveLoops-6p44eD86.js +0 -1
- package/web/dist/assets/Activity-CIgrq5R1.js +0 -1
- package/web/dist/assets/ActivityDetail-Brqv1u4f.js +0 -1
- package/web/dist/assets/Dashboard-CoveJ_-U.js +0 -2
- package/web/dist/assets/Factories-D5pLnt5S.js +0 -1
- package/web/dist/assets/Installs-DpWgyT5j.js +0 -3
- package/web/dist/assets/JournalView-CsuN3_B-.js +0 -1
- package/web/dist/assets/Laws-DK3OwGDl.js +0 -4
- package/web/dist/assets/Library-e-94YED6.js +0 -3
- package/web/dist/assets/Loops-C9DSBj-A.js +0 -2
- package/web/dist/assets/Personal-DVh2jYPO.js +0 -2
- package/web/dist/assets/Settings-CknBI-Fx.js +0 -1
- package/web/dist/assets/Tabs-C30JrkJH.js +0 -1
- package/web/dist/assets/api-DxwG8y94.js +0 -1
- package/web/dist/assets/index-CUJ8AaAF.css +0 -1
- package/web/dist/assets/index-MB7E-va_.js +0 -6
- package/web/dist/assets/usePoll-D5c_qIFZ.js +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-CRGCp2cV.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/api-C8nMUU1i.js","assets/sections-CtFz7HFH.js","assets/motion-RlUl1osO.js","assets/router-1EhRJy1C.js","assets/Activity-IAxWF2wK.js","assets/EmptyState-CY5Pm2xy.js","assets/Bonsai-BoKo68Kw.js","assets/ActivityDetail-CtC2DLvh.js","assets/Library-DdzyrwUK.js","assets/LibRows-CwK63kjB.js","assets/FilterInput-qGKNSlxv.js","assets/Models-DAgkQ4CE.js","assets/Kits-DYQvykZ0.js","assets/Markdown-CxkA7940.js","assets/DataTable-b9zTShqJ.js","assets/controls-CK7qHA8H.js","assets/Loops-yHga7xdr.js","assets/CopyButton-C0VTiqmb.js","assets/ActiveLoops-paFbiZyt.js","assets/Factories-DxHD2T-1.js","assets/Laws-UVk0uojS.js","assets/Personal-DjhIfa9v.js","assets/Tabs-BHjxciOL.js","assets/Installs-B5hFSUeN.js","assets/Settings-Brgec4M0.js","assets/Docs-DwOwzaD6.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,n,r,t as i}from"./react-C1iE8mnY.js";import{t as a}from"./api-C8nMUU1i.js";import{A as o,D as s,G as c,I as l,L as u,M as d,N as f,O as p,R as m,S as h,T as g,V as _,W as v,a as y,b,c as x,d as S,f as C,i as w,k as ee,l as T,m as te,n as E,o as ne,p as D,q as O,r as k,t as A,y as j,z as M}from"./motion-RlUl1osO.js";import{i as N,n as P,o as F,r as re,s as I,t as ie}from"./router-1EhRJy1C.js";import{t as L}from"./useLocalStorage-54tkqXN7.js";import{n as ae,r as oe,t as se}from"./sections-CtFz7HFH.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ce=(e,t)=>{if(M(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},le=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),f(t))return n;if(o(+t))return+t;let r=t,i=e?e.labels:null,a=!ee(i),s=ce(e,r),l=!f(s),u=c.exec(r);if(u){let e=u[0],t=r.split(e),o=a&&t[0]?i[t[0]]:n,c=l?s:a?o:n,d=+t[1];return b(c,d,e[0])}return l?s:a?f(i[r])?n:i[r]:n},R=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},z=0,ue=(e,t=0,n=1,r=0)=>{let i=e===void 0?z++:e;return(e=t,a=n,o=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let s=10**o;return Math.floor((((i^i>>>14)>>>0)/4294967296*(a-e+1/s)+e)*s)/s}},de=(e,t=R)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},fe=(e,t={})=>{let n=[],r=0,i,a=null,c=t.from,_=t.reversed,v=t.ease,y=!f(v),b=y&&!f(v.ease)?v.ease:y?C(v):null,x=t.grid,S=x===!0,w=t.axis,ee=t.total,T=f(c)||c===0||c===`first`,E=c===`center`,ne=c===`last`,D=c===`random`,k=s(c),A=s(e),M=t.use,N=l(A?e[0]:e),P=A?l(e[1]):0,F=O.exec((A?e[1]:e)+``),re=t.start||0+(A?N:0),I=t.seed,ie=!f(I)&&I!==!1?ue(I===!0?0:I):R,L=t.jitter,ae=!f(L),oe=s(L),se=oe?L[0]:L||0,ce=oe?L[1]:L||0,z=T?0:o(c)?c:0;return(e,s,l,v,y)=>{let[C]=te(e),T=f(ee)?l.length:ee,O=f(M)?!1:p(M)?M(C,s,T):j(C,M),I=o(O)||d(O)&&o(+O)?+O:s,L=I>=0&&I<T?I:s;if(E&&(z=(T-1)/2),ne&&(z=T-1),!n.length){if(S){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,u=-1/0,d=-1/0,f=[],g=[],_=[];for(let n=0;n<T;n++){let c=l[n],m=0,h=0,v=0,y=!1;if(c&&p(c.getBoundingClientRect)){let e=c.getBoundingClientRect();m=e.left+e.width/2,h=e.top+e.height/2,y=!0}else{let e=c;e&&o(e.x)&&o(e.y)&&(m=e.x,h=e.y,o(e.z)&&(v=e.z,t=!0),y=!0)}if(!y){e=!1;break}f.push(m),g.push(h),_.push(v),m<r&&(r=m),h<i&&(i=h),v<a&&(a=v),m>s&&(s=m),h>u&&(u=h),v>d&&(d=v)}if(e){let e=f[0],l=g[0],p=_[0];k?(e=r+c[0]*(s-r),l=i+c[1]*(u-i),p=t?a+(c.length>=3?c[2]:.5)*(d-a):0):E?(e=(r+s)/2,l=(i+u)/2,p=(a+d)/2):ne?(e=f[T-1],l=g[T-1],p=_[T-1]):o(c)&&(e=f[c],l=g[c],p=_[c]);for(let r=0;r<T;r++){let i=e-f[r],a=l-g[r],o=p-_[r],s=m(i*i+a*a+(t?o*o:0));w===`x`&&(s=-i),w===`y`&&(s=-a),w===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<T;e++){let t=h(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<T;e++)n[e]=n[e]/v}else for(let e=0;e<T;e++)n.push(h(z-e))}else for(let e=0;e<T;e++)if(!x)n.push(h(z-e));else{let t=x.length,r=x[0]*x[1],i,a,o;k?(i=c[0]*(x[0]-1),a=c[1]*(x[1]-1),o=t===3?(c.length>=3?c[2]:.5)*(x[2]-1):0):E?(i=(x[0]-1)/2,a=(x[1]-1)/2,o=t===3?(x[2]-1)/2:0):(i=z%x[0],a=g(z/x[0])%x[1],o=t===3?g(z/r):0);let s=e%x[0],l=g(e/x[0])%x[1],u=t===3?g(e/r):0,d=i-s,f=a-l,p=o-u,h=m(d*d+f*f+(t===3?p*p:0));w===`x`&&(h=-d),w===`y`&&(h=-f),w===`z`&&(h=-p),n.push(h)}r=n[0];for(let e=1;e<T;e++)n[e]>r&&(r=n[e]);if(b||_)for(let e=0;e<T;e++){let t=n[e];b&&(t=b(t/r)*r),_&&(t=w?-t:h(r-t)),n[e]=t}if(ae){a=Array(T);for(let e=0;e<T;e++)a[e]=ie(-1,1,4)}D&&(n=de(n,ie))}let oe=A?(P-N)/r:N;f(i)&&(i=y?le(y,f(t.start)?y.iterationDuration:re):re);let R=i+(oe*u(n[L],2)||0);if(ae){let e=r?n[L]/r:0,t=se+(ce-se)*e;R+=a[L]*t}return t.modifier&&(R=t.modifier(R)),F&&(R=`${R}${F[2]}`),R}},pe=e=>{let t=1;if(e&&e.getCTM){let n=e.getCTM();n&&(t=(m(n.a*n.a+n.b*n.b)+m(n.c*n.c+n.d*n.d))/2)}return t},me=(e,t,n)=>{let r=_,i=getComputedStyle(e),a=i.strokeLinecap,o=i.vectorEffect===`non-scaling-stroke`?e:null,s=a,c=new Proxy(e,{get(e,t){let n=e[t];return t===v?e:t===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),i=+n[0],c=+n[1],l=pe(o),u=i*-r*l,d=c*r*l+u,f=r*l+(i===0&&c===1||i===1&&c===0?0:10*l)-d;if(a!==`butt`){let t=i===c?`butt`:a;s!==t&&(e.style.strokeLinecap=`${t}`,s=t)}e.setAttribute(`stroke-dashoffset`,`${u}`),e.setAttribute(`stroke-dasharray`,`${d} ${f}`)}return Reflect.apply(n,e,t)}:p(n)?(...t)=>Reflect.apply(n,e,t):n}});return e.getAttribute(`pathLength`)!==`${r}`&&(e.setAttribute(`pathLength`,`${r}`),c.setAttribute(`draw`,`${t} ${n}`)),c},he=(e,t=0,n=0)=>D(e).map(e=>me(e,t,n)),B=e(t(),1),ge=r(),_e=n(),ve={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},ye={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},be=e=>ve[e]||ve.cyan,xe={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`};function Se(e,t,n){if(!e)return;let r=n===`light`,i=r?ye[t]||ye.cyan:be(t);r&&t===`white`&&(i=`#566B62`);let a=r?xe[t]||xe.cyan:i;Be(e,Ie(i,ye[t]||ye.cyan,De,a,r),r)}var Ce={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`}};function we(e,t,n){let r=Ce[t];if(!e||!r)return!1;let i=n===`light`,a=i?r.light:r.dark;return Be(e,Ie(a,r.light,r.ink,a,i),i),!0}var Te={dark:{worst:`#232A31`,soft:[`#14181D`,`#1B2026`,`#11151A`,`#171C22`,`#0B1116`,`#121A21`,`#1C1A12`,`#211E15`]},light:{worst:`#EBE6D8`,soft:[`#FBFDFC`,`#F3F6F6`,`#F4F6F8`,`#E9F4ED`,`#FCFAF4`,`#F6F2E7`]}},Ee=.13,De=`#06100D`,Oe=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},ke=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),Ae=e=>{let[t,n,r]=Oe(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},je=(e,t)=>{let[n,r]=[Ae(e),Ae(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},Me=(e,t,n)=>{let r=Oe(e),i=Oe(t);return ke(r.map((e,t)=>e+(i[t]-e)*n))},Ne=(e,t,n,r)=>{let i=e=>Math.min(...[].concat(t).map(t=>je(e,t))),a=e;for(let t=.05;i(a)<n&&t<=1.0001;t+=.05)a=Me(e,r,t);return a},Pe=e=>{let[t,n,r]=Oe(e).map(e=>e/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a;if(o===0)return{h:0,s:0};let s=o/(1-Math.abs(i+a-1));return{h:((i===t?(n-r)/o%6:i===n?(r-t)/o+2:(t-n)/o+4)*60+360)%360,s}},Fe=(e,t)=>{let n=Math.abs(e-t)%360;return n>180?360-n:n};function Ie(e,t,n,r,i){let a=i?`#000000`:`#FFFFFF`,o=e=>je(e,n)>=je(e,`#FFFFFF`)?n:`#FFFFFF`,s=je(e,o(e))>=4.5?e:Ne(e,i?`#FFFFFF`:n,4.5,a),c=i?Te.light:Te.dark,l=[c.worst,...c.soft.map(e=>Me(e,s,Ee))];return{accent:s,accent2:t,ink:o(s),text:Ne(r,l,4.5,a)}}var Le=39,Re={dark:[`#FF8A4C`,`#FF8A4C`],light:[`#B4441F`,`#9B3A1B`]};function ze(e,t,n){let[r,i]=n?Re.light:Re.dark,{h:a,s:o}=Pe(t),s=Fe(a,Le);o>=.15&&s<=29&&Fe(a,Pe(r).h)>s?(e.style.setProperty(`--warn`,r),e.style.setProperty(`--warn-text`,i)):(e.style.removeProperty(`--warn`),e.style.removeProperty(`--warn-text`))}function Be(e,t,n){e.style.setProperty(`--accent`,t.accent),e.style.setProperty(`--accent-2`,t.accent2),e.style.setProperty(`--accent-ink`,t.ink),e.style.setProperty(`--accent-text`,t.text),ze(e,t.accent,n)}var Ve=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function He(e,t){let n=t===`light`,r=n?Te.light:Te.dark,i=n?`#000000`:`#FFFFFF`,a=Ne(e,r.worst,3,i);return Ie(a,Ne(a,r.worst,4.5,i),De,a,n)}function Ue(e,t,n){return!e||!Ve(t)?!1:(Be(e,He(t,n),n===`light`),!0)}var We=`geneseed-mode`;function Ge(){let[e,t]=L(We,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var Ke=`geneseed-flavour`,qe=[{id:`cultivar`,short:`Cultivar`,name:`Cultivar Evolved`,tagline:`The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`matrix`,short:`Matrix`,name:`Matrix`,tagline:`Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],Je=new Set(qe.map(e=>e.id)),Ye={a:`cultivar`,b:`atlas`,c:`operator`,d:`cultivar`,e:`matrix`,f:`cultivar`,g:`cultivar`,z:`cultivar`,cb:`matrix`,cm:`cultivar`,greenhouse:`atlas`,heirloom:`cultivar`,aurora:`cultivar`,perspective:`cultivar`,sequencer:`cultivar`,cobalt:`matrix`,cosmic:`cultivar`,neon:`matrix`};function Xe(){return L(Ke,Ze)}function Ze(e){return Je.has(e)?e:Ye[e]||`cultivar`}var Qe=()=>window.location.reload(),$e=1e3,et=e=>new Promise(t=>setTimeout(t,e));async function tt(){try{return(await a.ping()).pid??null}catch{return null}}async function nt(e=0,t=null){await et(e);for(let e=0;e<30;e++){let e=await tt();if(e!==null&&e!==t)break;await et($e)}Qe()}async function rt(){let e=await tt();try{await a.restart()}catch(e){if(e.status)throw e}await nt($e,e)}var it=`geneseed-accent`,at=[{id:`curated`,short:`Curated`,tagline:`Each skin's own signature colour.`}],ot=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:be(e),tagline:`${t}, whatever the voice, until the skin changes.`})),st=[...at,...ot],ct=new Set(st.map(e=>e.id)),lt=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return Ve(t)?t.toUpperCase():null},ut=e=>e&&(ct.has(e)||lt(e))?e:`curated`,dt=e=>ot.find(t=>t.id===e)?.name??null,ft=e=>{let t=lt(e);return t?`Your own colour, ${t}.`:st.find(t=>t.id===e)?.tagline??``};function pt(){return L(it,ut)}var mt=`geneseed-layout`,ht=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`genome`,short:`Genome`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`hud`,short:`HUD`,tagline:`Dense instrument panel & check matrix.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],gt=new Set(ht.map(e=>e.id)),_t={cultivar:`genome`,operator:`hud`};function vt(e){return Object.hasOwn(_t,e??``)?_t[e]:e&>.has(e)?e:`overview`}function yt(){return L(mt,vt)}var bt=1500;function xt(e,t){let[n,r]=(0,B.useState)(null),[i,o]=(0,B.useState)(null),[s,c]=(0,B.useState)([]),[l,u]=(0,B.useState)(0),d=()=>a.overview().then(e=>{r(e),o(null)}),f=()=>d().catch(t=>{o(t?.body?.message||t?.message||String(t)),e?.(t)}),p=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{if(n?.doctor===null){p.current=!0;let e=setTimeout(()=>d().catch(()=>u(e=>e+1)),bt);return()=>clearTimeout(e)}p.current&&(p.current=!1,t?.())},[n,l]),(0,B.useEffect)(()=>{f()},[]),(0,B.useEffect)(()=>{a.themes().then(e=>c(e.themes)).catch(()=>{})},[]),{overview:n,error:i,themes:s,reload:f}}var St=600;function Ct({onFinish:e,onError:t}={}){let[n,r]=(0,B.useState)([]),[i,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{a.jobs().then(({jobs:e})=>{if(!e.length)return;r(e.map(e=>({id:e.id,action:e.action,status:e.status,output:e.output||``,duration:e.duration,started:e.started})));let t=e.find(e=>e.status===`running`);t&&(o(t.id),c(!0))}).catch(()=>{})},[]),(0,B.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i),s=t?.action===`update`||!!t?.restarts,c=null;s&&tt().then(e=>c=e);let l=setInterval(async()=>{if(!document.hidden)try{let t=await a.job(i);if(r(e=>{let n=e.findIndex(e=>e.id===i);if(n===-1)return e;let r=e[n],a=t.output||``;if(r.output===a&&r.status===t.status&&r.duration===t.duration)return e;let o=e.slice();return o[n]={...r,output:a,status:t.status,duration:t.duration},o}),t.status!==`running`){if(clearInterval(l),o(null),s&&t.status===`done`){nt(2e3,c);return}e?.(t.status)}}catch{if(!s)return;clearInterval(l),nt(0,c)}},St);return()=>clearInterval(l)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n,i)=>{try{let{job_id:t,restarts:s}=await a.action(e,n,i),l=n?.emit||i?.host,u=e===`build`&&n?.theme?`build (${n.theme}${l?` · ${l}`:``})`:e;return r(e=>[...e,{id:t,action:u,status:`running`,output:``,started:Date.now()/1e3,restarts:!!s}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>a.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var V=new Map,wt=new Map,Tt=new Map;function Et(e){for(let t of[V,Tt])for(let n of t.keys())n.startsWith(`${e}|`)&&t.delete(n)}function H(e,t=[],n=null,{revalidate:r=!1}={}){let i=n===null?null:`${n}|${t.join(``)}`,[a,o]=(0,B.useState)(()=>i!==null&&V.has(i)?V.get(i):null),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(()=>!(i!==null&&V.has(i))),d=(0,B.useRef)(e),f=(0,B.useRef)(i);(0,B.useLayoutEffect)(()=>{d.current=e,f.current=i});let p=(0,B.useRef)(0),m=(0,B.useCallback)(e=>{let t=++p.current,n=()=>t===p.current;u(!0),c(``);let r=f.current,i=e?Tt.get(r):void 0;if(!i&&(i=Promise.resolve(d.current()),r!==null)){let e=i,t=()=>{Tt.get(r)===e&&Tt.delete(r)};Tt.set(r,e),e.then(t,t)}return i.then(e=>{if(n()&&(o(e),r!==null)){V.set(r,e);for(let t of wt.get(r)||[])t(e)}}).catch(e=>{n()&&c(e.message)}).finally(()=>{n()&&u(!1)})},t),h=(0,B.useCallback)(()=>m(!1),[m]);return(0,B.useEffect)(()=>{let e=f.current;return e!==null&&(wt.has(e)||wt.set(e,new Set),wt.get(e).add(o)),e!==null&&V.has(e)&&(p.current++,o(V.get(e)),c(``),u(!1),!r)||m(!0),()=>wt.get(e)?.delete(o)},[m]),{data:a,error:s,loading:l,reload:h,setData:o}}var Dt=60,Ot=3600,kt=86400,At={seconds:90,minutes:5400,hours:36*Ot};function jt(e){let t=Math.max(0,Date.now()/1e3-e);return t<At.seconds?`${Math.round(t)}s`:t<At.minutes?`${Math.round(t/Dt)}m`:t<At.hours?`${Math.round(t/Ot)}h`:`${Math.round(t/kt)}d`}var U={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15},Mt={warn:U.deployed+U.doctorClean,bad:U.deployed};function Nt(e,t,n){if(!e)return 0;let r=e.doctor?.problems?.length??(e.doctor===null?0:99),i=e.doctor?.ok?U.doctorClean:r<=U.doctorMinorMax?U.doctorMinor:U.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp,o=(e.deployed?U.deployed:0)+i+(a?U.versionSynced:0)+(e.diff&&e.diff.missing===0?U.diskClean:0);return Math.min(o,Mt[n]??1)}var Pt=e=>Math.max(...oe.map(t=>e?.[t]??0),1),Ft=e=>e?.kept??0,It=e=>(e?.edited??0)+(e?.added??0)-Ft(e),Lt=e=>It(e)+(e?.missing??0),Rt=e=>(e?.laws??0)+(e?.doctrines?.rules??0),zt=e=>se.reduce((t,n)=>t+(e?.[n]??0),0),W=i(),Bt={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,loop:`M19.5 9A8 8 0 1 1 15 4.6M15 1.5l.2 3.3-3.2.8`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,check:`M5 12.5l4.5 4.5L19 7`,flask:`M9 3h6M10 3v6l-5.4 9.2A1.9 1.9 0 0 0 6.2 21h11.6a1.9 1.9 0 0 0 1.6-2.8L14 9V3M7.5 15h9`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,kit:`M21 8l-9-5-9 5v8l9 5 9-5V8ZM3 8l9 5 9-5M12 13v8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function G({name:e,className:t=`glyph`,style:n}){return(0,W.jsx)(`svg`,{className:t,style:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:Bt[e]||``})})}function Vt({className:e=`sprout`}){return(0,W.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,W.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,W.jsx)(`path`,{d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,W.jsx)(`path`,{d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var K=[{id:`essentials`,label:`Essentials`,rank:1},{id:`standard`,label:`Standard`,rank:2},{id:`power`,label:`Power`,rank:3}],Ht=Object.fromEntries(K.map(e=>[e.id,e.rank])),Ut=e=>Object.hasOwn(Ht,e)?Ht[e]:1,Wt=(e,t)=>t.map(t=>[t,e]),Gt=Object.fromEntries([...Wt(`essentials`,[`page:overview`,`page:library`,`page:installs`,`page:personal`,`page:docs`,`page:settings`,`tab:personal/rules`,`tab:personal/profile`,`tab:installs/hosts`,`tab:installs/doctor`,`section:library/skills`,`section:library/agents`,`section:settings/machine`,`section:settings/server`,`section:settings/about`]),...Wt(`standard`,[`page:kits`,`page:activity`,`page:laws`,`tab:personal/memory`,`tab:installs/profiles`]),...Wt(`power`,[`page:models`,`page:loops`,`page:factories`,`tab:loops/templates`,`tab:loops/bricks`,`tab:loops/active`,`tab:factories/templates`,`tab:factories/active`,`tab:personal/notebook`,`tab:installs/edits`,`section:library/wiki`,`section:library/config`,`section:settings/danger`])]);function Kt(e,t){return!Object.hasOwn(Gt,e)||Ut(Gt[e])<=Ut(t)}function qt({page:e,tab:t,section:n}={}){let r=[`page:${e}`];t&&r.push(`tab:${e}/${t}`),e===`library`&&n&&r.push(`section:library/${n}`);let i=K[0];for(let e of r){let t=K.find(t=>t.id===Gt[e]);t&&t.rank>i.rank&&(i=t)}return i.id}var Jt=e=>qt(F(e)),Yt=e=>K.some(t=>t.id===e)?e:`essentials`,Xt=(0,B.createContext)({level:`power`,setLevel:()=>{},canSee:e=>Kt(e,`power`),rank:3});function Zt({children:e}){let[t,n]=L(`geneseed-view-level`,Yt),r=(0,B.useMemo)(()=>({level:t,setLevel:n,canSee:e=>Kt(e,t),rank:Ut(t)}),[t,n]);return(0,W.jsx)(Xt.Provider,{value:r,children:e})}var q=()=>(0,B.useContext)(Xt),Qt=new WeakMap,$t=e=>t=>{let n=JSON.stringify(e);return typeof t==`object`&&t&&Qt.get(t)===n?t:(typeof e==`object`&&e&&Qt.set(e,n),e)};function en(e,t,n){(0,B.useEffect)(()=>{let n=!0,r=()=>n,i=()=>{document.hidden||e(r)};e(r);let a=setInterval(i,t);return document.addEventListener(`visibilitychange`,i),()=>{n=!1,clearInterval(a),document.removeEventListener(`visibilitychange`,i)}},n)}var tn=5e3;function nn(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(null),[i,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(0);return en(e=>a.activeLoops().then(n=>e()&&(t($t(n)),r(null)),t=>e()&&r(t.message)),tn,[s]),{loops:e?.loops??null,error:i||n,onPreset:(e,t)=>(o(null),a.setLoopPreset(e,t).then(()=>c(e=>e+1),e=>o(e.message)))}}var rn=5e3;function an(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(null);return en(e=>a.activeFactories().then(n=>e()&&(t($t(n)),r(null)),t=>e()&&r(t.message)),rn,[]),{runs:e?e.factories||[]:null,error:n}}var on=e=>e.status===`running`||e.status===`awaiting`,sn=e=>e?e.filter(on).length:0,cn=e=>K.find(t=>t.id===qt({page:e})).label;function ln({n:e,noun:t,href:n,page:r}){return e?(0,W.jsx)(`a`,{className:`sb-live`,href:n,children:`${e} ${t}${e===1?``:`s`} running · ${cn(r)}`}):null}function un(){let{loops:e}=nn();return(0,W.jsx)(ln,{n:sn(e),noun:`loop`,href:`#/loops/active`,page:`loops`})}function dn(){let{runs:e}=an();return(0,W.jsx)(ln,{n:sn(e),noun:`factory run`,href:`#/factories/active`,page:`factories`})}function fn(){let{canSee:e}=q(),t=!e(`page:loops`),n=!e(`page:factories`);return!t&&!n?null:(0,W.jsxs)(`div`,{className:`sb-live-foot`,role:`status`,children:[t?(0,W.jsx)(un,{}):null,n?(0,W.jsx)(dn,{}):null]})}var pn=[{group:`core`,hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{group:`govern`,hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?Rt(e.counts):null},{group:`build`,hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?zt(e.counts):null},{group:`build`,hash:`#/models`,page:`models`,label:`Models`,icon:`agent`},{group:`build`,hash:`#/kits`,page:`kits`,label:`Kits`,icon:`kit`},{group:`build`,hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,countTitle:`Templates across every install`,count:e=>e?.counts?.loops??null},{group:`build`,hash:`#/factories`,page:`factories`,label:`Factories`,icon:`build`},{group:`govern`,hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{group:`run`,hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?t.filter(e=>e.state!==`absent`).length:null}],mn=[{group:`help`,hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{group:`run`,hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`},{group:`help`,hash:`#/settings`,page:`settings`,label:`Settings`,icon:`settings`}],hn=[{id:`core`,title:null},{id:`govern`,title:`Govern`},{id:`build`,title:`Build`},{id:`run`,title:`Run`},{id:`help`,title:`Help`}],gn=[...pn,...mn],_n=`geneseed-rail`;function vn({n:e,lit:t,count:n,collapsed:r,onNavigate:i}){return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,title:r?e.label:void 0,"aria-label":r?n==null?e.label:`${e.label}, ${n}`:void 0,onClick:()=>i?.(),children:[(0,W.jsx)(`span`,{className:`sb-chip`,"aria-hidden":`true`,children:(0,W.jsx)(G,{name:e.icon})}),(0,W.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,W.jsx)(`span`,{className:`sb-count`,title:e.countTitle,children:n})]})})}function yn({route:e,overview:t,installs:n,onNavigate:r}){let[i,a]=L(_n,e=>e===`collapsed`?`collapsed`:`open`),o=i===`collapsed`,{canSee:s}=q(),c=t=>s(`page:${t.page}`)||e.page===t.page,l=()=>a(o?`open`:`collapsed`),u=o?`Expand the sidebar`:`Collapse the sidebar`;return(0,W.jsxs)(`nav`,{className:`sidebar${o?` collapsed`:``}`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,W.jsxs)(`div`,{className:`sb-head`,children:[(0,W.jsx)(`button`,{type:`button`,className:`sb-collapse`,onClick:l,"aria-label":u,title:u,"aria-expanded":!o,children:(0,W.jsx)(G,{name:`chevron`})}),(0,W.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{N(`#/`),r?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,W.jsx)(`span`,{className:`sb-mark`,children:(0,W.jsx)(Vt,{})}),(0,W.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,W.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,W.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]})]}),hn.filter(e=>gn.some(t=>t.group===e.id&&c(t))).map(i=>(0,W.jsxs)(`div`,{className:`sb-group sb-${i.id}`,role:`group`,"aria-labelledby":i.title?`sb-g-${i.id}`:void 0,"aria-label":i.title?void 0:`Overview`,children:[i.title?(0,W.jsxs)(`div`,{className:`sb-group-title`,id:`sb-g-${i.id}`,children:[(0,W.jsx)(`i`,{"aria-hidden":`true`}),i.title]}):null,(0,W.jsx)(`ul`,{className:`sb-list`,children:gn.filter(e=>e.group===i.id&&c(e)).map(i=>(0,W.jsx)(vn,{n:i,lit:e.page===i.page,count:i.count?.(t,n),collapsed:o,onNavigate:r},i.page))})]},i.id)),(0,W.jsx)(fn,{})]})}var bn=[`overview`,`laws`,`library`,`installs`];function xn({route:e,navOpen:t,onMore:n}){let{canSee:r}=q();return(0,W.jsxs)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:[pn.filter(t=>bn.includes(t.page)&&(r(`page:${t.page}`)||e.page===t.page)).map(t=>(0,W.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,W.jsx)(G,{name:t.icon}),t.label]},t.page)),(0,W.jsxs)(`button`,{type:`button`,className:`tab-more${bn.includes(e.page)?``:` on`}`,"aria-controls":`rail-nav`,"aria-expanded":!!t,onClick:n,children:[(0,W.jsx)(G,{name:`menu`}),`More`]})]})}var Sn=[{id:`opencode`,label:`OpenCode`,deployAdds:`.opencode/ + AGENT.md`,removeProject:`.opencode/ + AGENT.md + the bundle`,removeGlobal:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`},{id:`claude`,label:`Claude Code`,deployAdds:`.claude/ + CLAUDE.md`,removeProject:`.claude/ + the CLAUDE.md block`,removeGlobal:`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`},{id:`bob`,label:`BOB (IBM)`,deployAdds:`.bob/ + AGENTS.md`,removeProject:`.bob/ + the AGENTS.md block`,removeGlobal:`~/.bob's agents/skills + the AGENTS.md block + settings hooks`},{id:`openclaude`,label:`OpenClaude`,deployAdds:`.openclaude/ + its CLAUDE.md`,removeProject:`.openclaude/ + its CLAUDE.md block`,removeGlobal:`~/.openclaude's agents/skills + the CLAUDE.md block + settings hooks`}],Cn=e=>Sn.find(t=>t.id===e)||Sn[0],wn=(e,t)=>t===`project`?Cn(e).removeProject:Cn(e).removeGlobal,Tn=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,En=e=>e.scope===`global`?Cn(e.host).label:Tn(e.path),Dn=e=>{let t=Cn(e.host).label;return e.scope===`global`?`${t} · global`:`${Tn(e.path)} · ${t}`},On=e=>({"--cc":`var(--cat-${e*2%7})`}),kn=(e,t=[])=>[...new Set(e)].filter(e=>!t.includes(e)),An=e=>{let t=(e||[]).filter(e=>e.state===`active`);return[...t.filter(e=>e.default),...t.filter(e=>!e.default)]},jn=e=>e?{host:e.host,path:e.path}:void 0,Mn=`geneseed-harness`,Nn=Sn.map(({id:e,label:t})=>({id:e,label:t}));function Pn(e=`opencode`){let[t,n]=L(Mn,e=>Nn.some(t=>t.id===e)?e:null);return[t??e,n]}function Fn(e){let t=String(e||``);return Sn.find(e=>t.startsWith(e.id))?.id||`opencode`}var In=Object.entries(ie).flatMap(([e,t])=>(P[e]||[``]).map(n=>{let r=n?t+` / `+re[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}}));function Ln(e=0){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),o=(0,B.useRef)(null),[s]=Pn(),c=`${e}|${s}`,[l,u]=(0,B.useState)(c);return l!==c&&(u(c),n(null)),(0,B.useEffect)(()=>{o.current=null},[c]),{index:t,error:r,prime:(0,B.useCallback)(()=>{if(t||o.current)return o.current;let e=(async()=>{let e=[],t=[`laws`,`skills`,...oe],r=await Promise.all(t.map(async e=>{try{return{sec:e,items:(await a.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of r){let r=ae[n];for(let a of i){let i=a.title||a.name;e.push({kind:r.label,sortKey:t.indexOf(n),title:i,desc:a.desc||``,hay:`${i} ${a.desc||``} ${a.name||``}`.toLowerCase(),route:`#/item/${r.type}/${encodeURIComponent(a.name)}`})}}try{let t=await a.mcp(),n=new Set;for(let r of t?.targets||[])for(let t of r.servers||[]){if(n.has(t.name))continue;n.add(t.name);let r=t.label||t.name;e.push({kind:`MCP servers`,sortKey:100,title:r,desc:t.desc||``,hay:`${r} ${t.desc||``} ${t.name||``} mcp`.toLowerCase(),route:`#/installs/hosts`})}}catch{}try{let t=await a.docs(s);for(let n of t?.groups||[])for(let t of n.pages||[])e.push({kind:`Docs`,sortKey:110,title:t.title,desc:n.label,hay:`${t.title||``} ${t.id||``} ${n.label||``} ${t.section||``} ${t.description||``}`.toLowerCase(),route:`#/docs/${encodeURIComponent(t.id)}`})}catch{}return n(e),o.current=null,e})().catch(e=>(o.current=null,i(e.message||String(e)),[]));return o.current=e,e},[t,s])}}function Rn({open:e,title:t,children:n,confirmLabel:r,tone:i,onConfirm:a,onClose:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(null),u=(0,B.useId)(),d=i===`danger`;return(0,B.useEffect)(()=>{let t=s.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),e&&(d?c:l).current?.focus(),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e,d]),(0,W.jsxs)(`dialog`,{ref:s,className:`confirm`,"aria-labelledby":`${u}-title`,"aria-describedby":`${u}-body`,onCancel:o,onClose:o,children:[(0,W.jsx)(`h3`,{className:`confirm-title`,id:`${u}-title`,children:t}),(0,W.jsx)(`div`,{className:`confirm-body`,id:`${u}-body`,children:n}),(0,W.jsxs)(`div`,{className:`confirm-actions`,children:[(0,W.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,ref:c,children:`Cancel`}),(0,W.jsx)(`button`,{type:`button`,className:d?`btn danger`:`btn`,onClick:a,ref:l,children:r||`Confirm`})]})]})}var zn=(0,B.createContext)(null),Bn=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function Vn(){return(0,B.useContext)(zn)||Bn}function Hn({children:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(!1),a=(0,B.useRef)(null),o=e=>{let t=a.current;a.current=null,n(null),t?.(e)},s=(0,B.useCallback)((e,t={})=>new Promise(r=>{a.current?.(!1),a.current=r,i(!!t.check?.checked),n({msg:e,...t})}),[]);return(0,W.jsxs)(zn.Provider,{value:s,children:[e,(0,W.jsxs)(Rn,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,tone:t?.tone,onConfirm:()=>o(!t?.check||{checked:r}),onClose:()=>o(!1),children:[t?.msg,t?.check?(0,W.jsxs)(`label`,{className:`confirm-check`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),t.check.label]}):null]})]})}var Un=24;function Wn(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function Gn(e,t){let n=t.toLowerCase().trim();if(!e)return[];if(!n)return e.filter(e=>e.sortKey<0).sort((e,t)=>e.sortKey-t.sortKey);let r=[];for(let t of e){let e=Wn(t,n);e>=0&&r.push({e:t,s:e})}r.sort((e,t)=>e.e.sortKey-t.e.sortKey||e.s-t.s||e.e.title.localeCompare(t.e.title));let i=r.map(e=>e.e),a=i.filter(e=>e.sortKey>=0).slice(0,Un);return i.filter(e=>e.sortKey<0).concat(a)}function Kn(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,W.jsxs)(W.Fragment,{children:[e.slice(0,r),(0,W.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function qn({query:e,index:t,loading:n,error:r,active:i,onActive:a,onPick:o}){let s=(0,B.useMemo)(()=>Gn(t,e),[t,e]),c=(0,B.useRef)(null),{rank:l}=q(),u=e=>{if(!e.route)return null;let t=Jt(e.route);return Ut(t)>l?K.find(e=>e.id===t).label:null},d=s.length>0;(0,B.useLayoutEffect)(()=>{let e=c.current?.querySelectorAll(`[data-spot-row]`);if(!d||!e?.length||!w())return;let t=S(e,{opacity:[0,1],translateY:[-4,0],duration:E[4],delay:fe(E[0]),ease:k});return y(t,E[4]+E[0]*e.length)},[d]),(0,B.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,B.useEffect)(()=>{(c.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let f=[],p=null;s.forEach((e,t)=>{p&&p.kind===e.kind||(p={kind:e.kind,rows:[]},f.push(p)),p.rows.push({entry:e,index:t})});let m=!!e.trim();return(0,W.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[f.map(t=>(0,W.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,W.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,W.jsxs)(`div`,{id:`spot-opt-${n}`,"data-spot-row":n,role:`option`,"aria-selected":n===i,className:`spot-row ${n===i?`on`:``}`,onMouseDown:e=>{e.preventDefault(),o(t)},onMouseEnter:()=>a(n),children:[(0,W.jsxs)(`div`,{className:`spot-title`,children:[Kn(t.title,e),u(t)?(0,W.jsx)(`span`,{className:`tag spot-level`,children:u(t)}):null]}),t.desc?(0,W.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route||t.title}-${n}`))]},`${t.kind}-${t.rows[0].index}`)),m&&r&&(0,W.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),m&&n&&!r&&(0,W.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),m&&!n&&!r&&s.length===0&&(0,W.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]})]})}function Jn({actions:e=[],dataRev:t}){let n=(0,B.useRef)(null),r=(0,B.useRef)(null),i=(0,B.useRef)(null),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(0),{index:d,error:f,prime:p}=Ln(t),m=Vn(),h=()=>{o(!0),p()},g=()=>{let e=n.current;e?.open&&(typeof e.close==`function`?e.close():e.removeAttribute(`open`)),o(!1),c(``),u(0),i.current?.focus()};(0,B.useEffect)(()=>{let e=n.current;a&&e&&!e.open&&(typeof e.showModal==`function`?e.showModal():e.setAttribute(`open`,``),r.current?.focus())},[a]),(0,B.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),o(!0),p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]);let _=(0,B.useMemo)(()=>[...e.map(e=>({sortKey:-2,...e})),...In,...d||[]],[e,d]),v=a?Gn(_,s):[],y=l<v.length?`spot-opt-${l}`:void 0,b=async e=>{if(g(),!e.run)return N(e.route);let t=e.confirm;(!t||await m(t.msg,{title:t.title,confirmLabel:t.confirmLabel,tone:t.tone}))&&e.run()};return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,className:`tb-cmdk`,ref:i,"aria-haspopup":`dialog`,onClick:h,title:`Press / to open, or Ctrl-K / ⌘K from inside any field`,children:[(0,W.jsx)(G,{name:`search`,className:`mag glyph`}),(0,W.jsx)(`span`,{className:`tb-cmdk-label`,children:`Search or run…`}),(0,W.jsx)(`kbd`,{className:`tb-cmdk-key`,children:`Ctrl K`})]}),(0,W.jsx)(`dialog`,{ref:n,className:`palette`,"aria-label":`Search or run`,onCancel:e=>{e.preventDefault(),g()},onClose:()=>a&&g(),onClick:e=>e.target===n.current&&g(),children:a&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`palette-head`,children:[(0,W.jsx)(G,{name:`search`,className:`mag glyph`}),(0,W.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search or run`,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":`spotlight-list`,"aria-activedescendant":y,value:s,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,Math.max(v.length-1,0)));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){let t=v[l];t&&(e.preventDefault(),b(t))}else e.key===`Escape`&&(e.preventDefault(),s?(c(``),u(0)):g())},placeholder:`Search or run…`}),(0,W.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]}),(0,W.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v.length?`${v.length} results`:`no matches`}),(0,W.jsx)(qn,{query:s,index:_,loading:!d,error:d?``:f,active:l,onActive:u,onPick:b}),(0,W.jsxs)(`div`,{className:`palette-foot`,children:[(0,W.jsx)(`span`,{children:`↑↓ move`}),(0,W.jsx)(`span`,{children:`↵ open`}),(0,W.jsx)(`span`,{children:`actions that write always ask first`})]})]})})]})}var Yn=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function Xn({open:e,onClose:t,anchorRef:n,label:r,className:i,children:a}){let o=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!e)return;let r=o.current,i=n?.current;(r.querySelector(Yn)||r).focus();let a=e=>{e.key===`Escape`&&t()},s=e=>{r.contains(e.target)||i?.contains(e.target)||t()};return document.addEventListener(`keydown`,a),document.addEventListener(`mousedown`,s),()=>{document.removeEventListener(`keydown`,a),document.removeEventListener(`mousedown`,s);let e=document.activeElement;(!e||e===document.body||r.contains(e))&&i?.focus()}},[e]),e?(0,W.jsx)(`div`,{ref:o,className:i?`popover ${i}`:`popover`,role:`dialog`,"aria-label":r,tabIndex:-1,onBlur:e=>{let r=e.relatedTarget;!r||o.current?.contains(r)||n?.current?.contains(r)||t()},children:a}):null}function Zn({children:e,...t}){let n=x(`button.on`);return(0,W.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,W.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function Qn({value:e,onChange:t,labelledBy:n}){let r=lt(e);return(0,W.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[at.map(n=>(0,W.jsx)(`button`,{type:`button`,className:`accent-src${e===n.id?` on`:``}`,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id)),(0,W.jsxs)(`div`,{className:`accent-swatches`,children:[ot.map(n=>(0,W.jsx)(`button`,{type:`button`,className:`accent-swatch${e===n.id?` on`:``}`,style:{"--sw":n.hex},"aria-pressed":e===n.id,"aria-label":`${n.short} accent`,title:n.short,onClick:()=>t(n.id)},n.id)),(0,W.jsx)(`label`,{className:`accent-swatch accent-custom${r?` on picked`:``}`,style:r?{"--sw":r}:void 0,title:r?`Your colour, ${r}`:`Pick any colour`,children:(0,W.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function $n({labelledBy:e}){let{level:t,setLevel:n}=q();return(0,W.jsx)(Zn,{"aria-labelledby":e,children:K.map(e=>(0,W.jsx)(`button`,{type:`button`,className:t===e.id?`on`:``,"aria-pressed":t===e.id,onClick:()=>n(e.id),children:e.label},e.id))})}function er({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,onClose:i,anchorRef:a}){return(0,ge.createPortal)((0,W.jsxs)(Xn,{open:!0,onClose:i,anchorRef:a,label:`Appearance`,className:`appearance-pop`,children:[(0,W.jsxs)(`div`,{className:`ap-group`,children:[(0,W.jsx)(`span`,{className:`ap-label`,id:`ap-skin`,children:`Skin`}),(0,W.jsx)(Zn,{"aria-labelledby":`ap-skin`,children:qe.map(n=>(0,W.jsx)(`button`,{type:`button`,className:e===n.id?`on`:``,"aria-pressed":e===n.id,onClick:()=>t(n.id),children:n.short},n.id))}),(0,W.jsx)(`span`,{className:`ap-note`,role:`status`,"aria-live":`polite`,children:qe.find(t=>t.id===e)?.tagline})]}),(0,W.jsxs)(`div`,{className:`ap-group`,children:[(0,W.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,W.jsx)(Qn,{value:n,onChange:r,labelledBy:`ap-accent`}),(0,W.jsx)(`span`,{className:`ap-note`,role:`status`,"aria-live":`polite`,children:ft(n)})]}),(0,W.jsxs)(`div`,{className:`ap-group`,children:[(0,W.jsx)(`span`,{className:`ap-label`,id:`ap-view`,children:`View`}),(0,W.jsx)($n,{labelledBy:`ap-view`}),(0,W.jsx)(`span`,{className:`ap-note`,role:`status`,"aria-live":`polite`,children:`Hidden parts keep working.`})]})]}),document.querySelector(`.app`)||document.body)}function tr({route:e,navOpen:t,onToggleNav:n,actions:r,mode:i,onToggleMode:a,appearance:o,dataRev:s}){let[c,l]=(0,B.useState)(!1),u=(0,B.useRef)(null),d=e.tab&&re[e.tab];return(0,W.jsxs)(`header`,{className:`topbar`,children:[(0,W.jsx)(`button`,{type:`button`,className:`tb-menu iconbtn`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,W.jsx)(G,{name:t?`x`:`menu`})}),(0,W.jsx)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:(0,W.jsxs)(`ol`,{children:[(0,W.jsx)(`li`,{children:d?(0,W.jsx)(`a`,{href:e.page===`overview`?`#/`:`#/${e.page}`,children:ie[e.page]}):(0,W.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:ie[e.page]})}),d?(0,W.jsx)(`li`,{children:(0,W.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:d})}):null]})}),(0,W.jsx)(`div`,{className:`topbar-spacer`}),(0,W.jsx)(Jn,{actions:r,dataRev:s}),(0,W.jsx)(`button`,{type:`button`,className:`iconbtn`,ref:u,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":c,onClick:()=>l(e=>!e),children:(0,W.jsx)(G,{name:`themes`})}),c?(0,W.jsx)(er,{...o,anchorRef:u,onClose:()=>l(!1)}):null,(0,W.jsx)(`button`,{type:`button`,className:`iconbtn`,title:i===`light`?`Switch to dark`:`Switch to light`,"aria-label":i===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:a,children:(0,W.jsx)(G,{name:i===`light`?`moon`:`sun`})})]})}function nr({installs:e,value:t,onChange:n,className:r=``,tagOf:i=Dn,label:a=`Install`}){return!t||!e||e.length<2?null:(0,W.jsxs)(`label`,{className:`install-pick ${r}`.trim(),children:[(0,W.jsx)(`span`,{className:`dim`,children:`Install:`}),(0,W.jsx)(`select`,{className:`sel mono`,"aria-label":a,value:t.id,onChange:t=>n(e.find(e=>e.id===t.target.value)),children:e.map(e=>(0,W.jsx)(`option`,{value:e.id,children:i(e)},e.id))})]})}function rr({unreadable:e}){return e?(0,W.jsx)(`p`,{className:`sub rule-notice`,role:`status`,children:`Install list unreadable — showing the default install.`}):null}var ir=3500;function ar({toast:e,onClose:t}){let[n,r]=(0,B.useState)(null),i=!!e&&e.kind!==`err`&&n!==e;(0,B.useEffect)(()=>{if(!i)return;let e=setTimeout(t,ir);return()=>clearTimeout(e)},[e,i]);let a=()=>r(e),o=()=>r(null);return(0,W.jsx)(`div`,{className:`toast-region`,"aria-live":e?.kind===`err`?void 0:`polite`,children:e&&(0,W.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:void 0,onMouseEnter:a,onMouseLeave:e=>{e.currentTarget.contains(document.activeElement)||o()},onFocus:a,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o()},children:[(0,W.jsx)(`div`,{children:e.msg}),(0,W.jsx)(`div`,{style:{marginTop:8},children:(0,W.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})})}var or=e=>Sn.find(t=>t.id===e)?.label??e;function sr(e){let t=/^([a-z]+?)(?:-(global))?$/.exec(e);return t?`${or(t[1])} · ${t[2]||`project`}`:e}var cr={upgrade:`Update the source`,"rebuild-all":`Rebuild every install`,doctor:`Run the doctor`,diff:`Export local edits`,link:`Link the CLI`,unlink:`Unlink the CLI`};function lr(e){let t;return(t=/geneseed-cli\.mjs\s+(\S+)/.exec(e))?{title:cr[t[1]]||`Run ${t[1]}`,container:t[1]===`rebuild-all`}:/build-driver\.mjs\b/.test(e)?(t=/--emit\s+(\S+)/.exec(e),{title:t?`Build ${sr(t[1])}`:`Build the bundle`}):/npm(\.cmd)?\s+install\b/i.test(e)?{title:`Install the npm package`}:{title:`Run a step`}}var ur=/^\[(?:geneseed|rebuild-all|upgrade)\]\s*(?:WARN\b:?|⚠️)\s*/u,dr=/^(?:\[rebuild-all\] FAILED |\[rebuild-all\] \d+\/\d+ install\(s\) failed|\[rebuild-all\] not started:|\[web\] ✗ |\[web\] job crashed|\[web\] cancelled by user|\[geneseed\]\[E-[A-Z]+\] ✗|\[geneseed\] ✗)/,fr=/^\[geneseed\] (refused \S+: it is a link)/,pr=/^\[rebuild-all\] ([a-z]+):([a-z]+) \((.*)\): theme=/,mr=/^\[geneseed\] ([a-z]+(?:-global)?) -> .+?: (\d+ subagents, \d+ skills)/,hr=/^\[geneseed\] (\d+) new commit\(s\) upstream/,gr=/^\[geneseed\] already up to date\./,_r=/^\[rebuild-all\] rebuilt (\d+) install\(s\)\./,vr=/^\[rebuild-all\] WARN /,yr=/restarts? itself after this job/,br=/^\[geneseed\] ✓ (?:upgrade|update) complete\./,xr=/skipping the (\d+) remaining step\(s\)/;function Sr(e){let t=e.replace(ur,``),n=t.replace(/"[^"]*"(?:,\s*"[^"]*")+/g,e=>`${e.match(/"[^"]*"/g).length} entries`),r=n.indexOf(` — `),i=r===-1?n:n.slice(0,r),a=r===-1?``:n.slice(r+3),o=a.search(/\.(\s|$)/);return o!==-1&&(a=a.slice(0,o+1)),i.length>96&&(i=`${i.slice(0,95).replace(/\s+\S*$/,``)}…`),a&&=a[0].toUpperCase()+a.slice(1),{title:i,body:a,text:t}}function Cr(e,t,n={}){return{title:e,detail:``,raw:t==null?[]:[t],lines:[],warnings:[],notices:[],errors:[],...n}}var wr=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Tr(e=``,t=`done`){let n=e?e.replace(/\n$/,``).split(`
|
|
3
|
+
`):[],r=[],i=[],a=null,o=null,s=!1,c=null,l=null,u=!1,d=[],f=e=>{a&&a.container&&a.raw.length===1&&!a.lines.length&&(r.pop(),e.raw.unshift(...a.raw)),r.push(e),a=e};for(let e of n){let t;if(t=/^\$ (.+)$/.exec(e)){let{title:n,container:r}=lr(t[1]);f(Cr(n,e,{container:!!r}))}else(t=pr.exec(e))?f(Cr(`Rebuild ${or(t[1])} · ${t[2]}`,e)):a?(a.raw.push(e),vr.test(e)?d.push(Sr(e)):ur.test(e)?a.warnings.push(Sr(e)):dr.test(e)?(a.errors.push(e),(t=xr.exec(e))&&(a.skippedSteps=Number(t[1]))):(t=fr.exec(e))?a.notices.push({title:t[1],text:e}):(t=mr.exec(e))?(a.detail=a.detail||t[2],l||=t[1]):(t=hr.exec(e))?(o=Number(t[1]),a.detail=wr(o,`new commit`)):gr.test(e)?(s=!0,a.detail=`already up to date`):(t=_r.exec(e))?c=Number(t[1]):yr.test(e)?u=!0:br.test(e)||e.trim()&&a.lines.push(e)):i.push(e)}if(t===`failed`&&!r.some(e=>e.errors.length)){r.length||r.push(Cr(`Run`,null));let e=[...n].reverse().find(e=>e.trim())||`the job failed without output`;r[r.length-1].failLine=e}r.forEach((e,n)=>{e.state=e.errors.length||e.failLine?`failed`:t===`running`&&n===r.length-1?`running`:e.warnings.length?`warn`:e.notices.length?`skipped`:`done`,e.stateText={failed:`Failed`,running:`Running`,warn:wr(e.warnings.length,`warning`),skipped:`${e.notices.length} skipped`,done:`Done`}[e.state],delete e.container}),u&&r.length&&(r[r.length-1].title+=`, restart web`);let p=[];return o===null?s&&p.push(`up to date`):p.push(wr(o,`new commit`)),c===null?l&&p.push(l):p.push(wr(c,`install`)),{phases:r,other:i,runWarnings:d,failed:r.some(e=>e.state===`failed`),warnings:r.reduce((e,t)=>e+t.warnings.length,d.length),notices:r.reduce((e,t)=>e+t.notices.length,0),detail:p.join(` · `),restart:u}}function Er(e){if(e==null)return``;if(e<60)return`${e}s`;let t=Math.floor(e/60);return`${t}m ${Math.round(e-t*60)}s`}function Dr(e,t){return e===`running`?`running`:e===`failed`||t.failed?`failed`:t.warnings?`warn`:`done`}var Or={running:`Running`,failed:`Failed`,done:`Done`,warn:`Done`},kr={running:`running`,failed:`✗`,warn:`⚠`},Ar=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function jr({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),[l,u]=(0,B.useState)({id:null,at:0}),[d,f]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=c.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let p=(0,B.useMemo)(()=>e.map(e=>Tr(e.output,e.status)),[e]),m=l.at===e.length?l.id:null,h=m===null?-1:e.findIndex(e=>e.id===m),g=h===-1?e.length-1:h,_=e[g],v=p[g],y=_?_.output.length:0;return(0,B.useEffect)(()=>{s.current&&(s.current.scrollTop=0)},[_?.id]),(0,B.useEffect)(()=>{let e=s.current;e&&t&&_?.status===`running`&&(e.scrollTop=e.scrollHeight)},[y,t,_?.status]),(0,W.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,W.jsxs)(`div`,{className:`console-head`,ref:c,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[a&&(0,W.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,W.jsxs)(`span`,{className:`ttl`,children:[(0,W.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,W.jsx)(`span`,{className:`count`,children:e.length}),(0,W.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,W.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,W.jsx)(G,{name:`clear`})}),(0,W.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,W.jsx)(G,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(e.length===0?(0,W.jsx)(`div`,{className:`console-body`,children:(0,W.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`})}):(0,W.jsxs)(`div`,{className:`console-body cx`,children:[(0,W.jsx)(`ul`,{className:`cx-runs`,"aria-label":`Runs`,children:e.map((t,n)=>{let r=Dr(t.status,p[n]);return(0,W.jsx)(`li`,{children:(0,W.jsxs)(`button`,{className:`cx-run${n===g?` on`:``}`,"aria-current":n===g?`true`:void 0,onClick:()=>u({id:t.id,at:e.length}),children:[(0,W.jsx)(`span`,{className:`cx-dot ${r}`,"aria-hidden":`true`}),(0,W.jsxs)(`span`,{className:`cx-run-main`,children:[(0,W.jsx)(`span`,{className:`cx-run-act`,children:t.action}),p[n].detail&&(0,W.jsx)(`span`,{className:`cx-run-sub`,title:p[n].detail,children:p[n].detail})]}),(0,W.jsxs)(`span`,{className:`cx-run-dur`,children:[kr[r]&&(0,W.jsx)(`span`,{className:`cx-mark ${r}`,"aria-hidden":`true`,children:kr[r]}),t.status===`running`?``:Er(t.duration)]}),(0,W.jsxs)(`span`,{className:`sr-only`,children:[Or[r],r===`warn`?` with warnings`:``]})]})},t.id)}).reverse()}),(0,W.jsx)(`section`,{className:`cx-detail`,ref:s,"aria-label":`Run ${_.action}`,children:(0,W.jsx)(Mr,{run:_,view:v,showLog:d===_.id,onLog:()=>f(e=>e===_.id?null:_.id),onCancel:i})})]}))]})}function Mr({run:e,view:t,showLog:n,onLog:r,onCancel:i}){let a=Dr(e.status,t),o=[e.status===`running`?`running`:Er(e.duration),Ar(t.warnings,`warning`),Ar(t.notices,`notice`)].filter(Boolean);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`header`,{className:`cx-head`,children:[(0,W.jsx)(`h3`,{className:`cx-title`,children:e.action}),(0,W.jsx)(`span`,{className:`cx-pill ${a}`,children:Or[a]}),e.status===`running`&&i&&(0,W.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,W.jsx)(G,{name:`x`})}),(0,W.jsx)(`button`,{className:`cx-logbtn`,"aria-pressed":n,onClick:r,children:`Full log`})]}),(0,W.jsx)(`p`,{className:`cx-sum`,children:o.join(` · `)}),n?(0,W.jsx)(`pre`,{className:`run-out`,children:e.output}):(0,W.jsxs)(W.Fragment,{children:[t.phases.length===0&&!t.other.length&&(0,W.jsx)(`div`,{className:`console-empty`,children:e.status===`running`?`Waiting for output…`:`No output`}),(0,W.jsx)(`ol`,{className:`cx-phases`,children:t.phases.map((e,t)=>(0,W.jsx)(Pr,{n:t+1,p:e},t))}),t.runWarnings.length>0&&(0,W.jsxs)(`div`,{className:`cx-other`,children:[(0,W.jsx)(`div`,{className:`cx-ph-title`,children:`Run warnings`}),t.runWarnings.map((e,t)=>(0,W.jsx)(Nr,{w:e},t))]}),t.other.length>0&&(0,W.jsx)(Fr,{lines:t.other})]})]})}function Nr({w:e}){return(0,W.jsxs)(`div`,{className:`cx-warn`,children:[(0,W.jsx)(`b`,{children:e.title}),e.body&&(0,W.jsx)(`p`,{children:e.body}),e.text!==e.title&&(0,W.jsxs)(`details`,{children:[(0,W.jsx)(`summary`,{children:`Full text`}),(0,W.jsx)(`p`,{className:`cx-warn-full`,children:e.text})]})]})}function Pr({n:e,p:t}){return(0,W.jsxs)(`li`,{className:`cx-phase ${t.state}`,children:[(0,W.jsx)(`span`,{className:`cx-num`,"aria-hidden":`true`,children:e}),(0,W.jsxs)(`div`,{className:`cx-ph`,children:[(0,W.jsxs)(`div`,{className:`cx-ph-head`,children:[(0,W.jsx)(`span`,{className:`cx-ph-title`,children:t.title}),(0,W.jsx)(`span`,{className:`cx-ph-state`,children:t.stateText})]}),t.detail&&(0,W.jsx)(`div`,{className:`cx-ph-detail`,children:t.detail}),t.errors.map((e,t)=>(0,W.jsx)(`div`,{className:`cx-err`,children:e},`e${t}`)),t.failLine&&(0,W.jsx)(`div`,{className:`cx-err`,children:t.failLine}),t.warnings.map((e,t)=>(0,W.jsx)(Nr,{w:e},`w${t}`)),t.notices.map((e,t)=>(0,W.jsx)(`div`,{className:`cx-note`,title:e.text,children:e.title},`n${t}`)),t.lines.length>0&&(0,W.jsx)(`pre`,{className:`cx-lines`,children:t.lines.join(`
|
|
4
|
+
`)})]})]})}function Fr({lines:e}){return(0,W.jsxs)(`div`,{className:`cx-other`,children:[(0,W.jsx)(`div`,{className:`cx-ph-title`,children:`Other output`}),(0,W.jsx)(`pre`,{className:`cx-lines`,children:e.join(`
|
|
5
|
+
`)})]})}var Ir=550,Lr=`gs-splash-seen`,Rr=8e3;function zr(){try{if(window.localStorage.getItem(Lr))return 0;window.localStorage.setItem(Lr,`1`)}catch{}return Ir}function Br({ready:e,onDone:t}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let e=setTimeout(()=>r(!0),zr());return()=>clearTimeout(e)},[]);let[o,s]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(e)return;let t=setTimeout(()=>s(!0),Rr);return()=>clearTimeout(t)},[e]),e&&n&&!i&&a(!0),(0,B.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),E[9]);return()=>clearTimeout(e)},[i]);let c=o&&!i;return(0,W.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":c?void 0:`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,W.jsxs)(`div`,{className:`boot-dial`,"aria-hidden":`true`,children:[(0,W.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,W.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,W.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,W.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,W.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,W.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,W.jsx)(`path`,{className:`bs-leaf bs-leaf-main`,d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,W.jsx)(`path`,{className:`bs-leaf bs-leaf-back`,d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,W.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),c?(0,W.jsxs)(`div`,{className:`boot-status`,role:`alert`,children:[(0,W.jsx)(`span`,{children:`The server is not answering.`}),` `,(0,W.jsx)(`button`,{type:`button`,className:`btn`,onClick:Qe,children:`Retry`})]}):(0,W.jsxs)(`div`,{className:`boot-status`,children:[(0,W.jsx)(`span`,{children:`germinating harness`}),(0,W.jsx)(`span`,{className:`boot-caret`})]})]})}function J({label:e=`Loading…`}){return(0,W.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,W.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,W.jsx)(`div`,{className:`skel-bar`}),(0,W.jsx)(`div`,{className:`skel-bar`}),(0,W.jsx)(`div`,{className:`skel-bar`})]})]})}function Vr({error:e,style:t,onRetry:n,role:r=`alert`}){return e?n?(0,W.jsxs)(`div`,{className:`error-state`,role:r,style:t,children:[(0,W.jsx)(`p`,{className:`badge bad`,children:e}),(0,W.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:n,children:`Retry`})]}):(0,W.jsx)(`p`,{className:`badge bad`,role:r,style:t,children:e}):null}function Hr(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(null);return(0,W.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,W.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,W.jsx)(`button`,{className:`btn sm`,onClick:async()=>{t(!0),r(null);try{await rt()}catch(e){r(e.message),t(!1)}},disabled:e,children:e?`Restarting…`:`Restart`})]})}var Ur=/dynamically imported module|Importing a module script failed|Unable to preload CSS/i,Wr=e=>Ur.test(e?.message||``),Gr=class extends B.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=Wr(e);return(0,W.jsxs)(`div`,{role:t?void 0:`alert`,children:[(0,W.jsx)(Vr,{error:e.message||String(e),role:null}),t?(0,W.jsx)(Hr,{}):(0,W.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]})}};function Kr({route:e}){let{rank:t,setLevel:n}=q(),r=qt(e);if(Ut(r)<=t)return null;let{label:i}=K.find(e=>e.id===r);return(0,W.jsxs)(`div`,{className:`level-banner`,role:`status`,children:[(0,W.jsxs)(`span`,{children:[`This is a `,i,` view.`]}),(0,W.jsxs)(`button`,{className:`btn sm`,onClick:()=>n(r),children:[`Show `,i,` views always`]})]})}var qr=(0,B.createContext)(null),Jr=e=>[...e].sort().join(`,`),Yr=e=>[...e.values()].some(e=>!e.applied&&Jr(e.value)!==e.base);function Xr(e,t){let[n,r]=(0,B.useState)(()=>({kits:new Map,rules:new Map})),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(t);if(o!==t&&(s(t),i&&t)){let e=t.status===`done`?{applied:!0}:{failed:!0};r(t=>{let n=t[i.kind].get(i.key);return n?{...t,[i.kind]:new Map(t[i.kind]).set(i.key,{...n,...e})}:t}),a(null)}let c=Yr(n.kits)||Yr(n.rules);return(0,B.useEffect)(()=>{if(!c)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[c]),{get:(e,t)=>n[e].get(t),put:(e,t,n,i)=>r(r=>{let a=new Map(r[e]);return Jr(n)===i?a.delete(t):a.set(t,{value:n,base:i}),{...r,[e]:a}}),drop:(e,t)=>r(n=>{let r=new Map(n[e]);return r.delete(t),{...n,[e]:r}}),prune:(0,B.useCallback)((e,t)=>r(n=>{let r=[...n[e]].filter(([e,n])=>t(e,n)).map(([e])=>e);if(!r.length)return n;let i=new Map(n[e]);return r.forEach(e=>i.delete(e)),{...n,[e]:i}}),[]),startApply:(e,t)=>{a({kind:e,key:t}),r(n=>{let r=n[e].get(t);return r?{...n,[e]:new Map(n[e]).set(t,{value:r.value,base:r.base,sent:!0})}:n})},fail:(e,t)=>r(n=>{let r=n[e].get(t);return r?{...n,[e]:new Map(n[e]).set(t,{value:r.value,base:r.base,failed:!0})}:n}),running:(t,n)=>!!e&&i?.kind===t&&i?.key===n,busy:!!e}}function Zr({activeId:e,finish:t,children:n}){let r=Xr(e,t);return(0,W.jsx)(qr.Provider,{value:r,children:n})}function Qr(){let e=Xr(null,null);return(0,B.useContext)(qr)||e}var $r=e=>!!e&&!e.endsWith(`-global`);function ei({onAction:e}){let{data:t,error:n}=H(()=>a.themes(),[]),[r,i]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1);if(n)return(0,W.jsx)(Vr,{error:n});if(!t)return(0,W.jsx)(J,{});let m=r||t.current?.theme||`neutral`,h=(t.emits||[]).filter(e=>e.name!==`files`),g=t.emits?.some(e=>e.name===`opencode-global`),_=o||(g?`opencode-global`:t.current?.emit||h[0]?.name||``),v=i,y=s,b=$r(_);return(0,W.jsxs)(`div`,{className:`narrow-lg`,children:[(0,W.jsx)(`div`,{className:`head-row mb-18`,children:(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,W.jsx)(`p`,{className:`sub`,children:`Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands.`})]})}),(0,W.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,W.jsx)(`div`,{className:`card-head`,children:(0,W.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,W.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,W.jsx)(`button`,{className:`btn ${e.name===m?`soft`:`ghost`}`,onClick:()=>v(e.name),title:e.blurb||e.tagline||e.name,children:(0,W.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})},e.name))})]}),(0,W.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,W.jsx)(`div`,{className:`card-head`,children:(0,W.jsx)(`h3`,{children:`2 · Install mode`})}),(0,W.jsxs)(`p`,{className:`sub mb-16`,children:[`A `,(0,W.jsx)(`code`,{children:`-global`}),` mode deploys once to that tool's global config, so every repo on this machine inherits the harness (recommended). A project mode installs into the repository folder you choose.`]}),(0,W.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,W.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,W.jsx)(`select`,{className:`sel`,value:_,onChange:e=>y(e.target.value),children:h.map(e=>(0,W.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]}),b&&(0,W.jsxs)(`div`,{className:`row gap-10`,style:{maxWidth:560,marginTop:12},children:[(0,W.jsx)(`input`,{className:`inp`,style:{flex:1},type:`text`,placeholder:`/path/to/project, or click Browse…`,value:c,onChange:e=>l(e.target.value),"aria-label":`Project folder to install into`}),(0,W.jsx)(`button`,{className:`btn ghost sm`,disabled:f,onClick:async()=>{p(!0),d(``);try{let e=await a.pickFolder();e.path?l(e.path):e.error&&d(e.error)}catch(e){d(e.message)}finally{p(!1)}},children:f?`Choosing…`:`Browse…`})]}),u&&(0,W.jsx)(`p`,{className:`sub`,style:{marginTop:12},children:u})]}),(0,W.jsxs)(`button`,{className:`btn btn-grid`,disabled:!m||!_||b&&!c.trim(),onClick:()=>{if(!b)return e(`build`,{theme:m,emit:_});let t=c.trim();return t?(d(``),e(`deploy`,{host:_,path:t,theme:m})):d(`Choose or type the project folder to install into.`)},children:[(0,W.jsx)(G,{name:`build`}),`Deploy harness`]})]})}function ti(e){return H(()=>Promise.resolve().then(()=>a.installs()).catch(()=>null),[e],`installs`)}function ni(e){let{data:t,loading:n}=ti(e);return n&&!t?null:An(t?.installs)}var ri=e=>`geneseed-install-${e}`;function ii(e,t){try{localStorage.setItem(ri(e),t)}catch{}}function ai(e){try{let t=localStorage.getItem(ri(e))||``;return localStorage.removeItem(ri(e)),t}catch{return``}}function oi(e,t){let[n,r]=L(ri(e),e=>e||null);return[(t||[]).find(e=>e.id===n)||t?.[0]||null,e=>r(e.id)]}function si(e,t){let{data:n,loading:r}=ti(t),[i,a]=(0,B.useState)(null);n&&n!==i&&a(n);let o=n??i,s=r&&!o?null:An(o?.installs),c=s===null?null:s.length?s:[null],{data:l,reload:u}=H(()=>c?Promise.allSettled(c.map(t=>e(jn(t)))).then(e=>{let t=e.flatMap((e,t)=>e.status===`fulfilled`?[{inst:c[t],data:e.value}]:[]),n=t.map(e=>e.data.path);return{sets:t.filter((e,t)=>n.indexOf(e.data.path)===t),failed:c.filter((t,n)=>e[n].status===`rejected`),reason:e.find(e=>e.status===`rejected`)?.reason??null}}):Promise.resolve(null),[t,c?c.map(e=>e?.id??``).join(`|`):null]);return{targets:c,sets:l?.sets??null,failed:l?.failed??[],reason:l?.reason,reload:u}}var ci=(e,t)=>H(()=>a.rules(t).catch(()=>null),t?[e,t.host,t.path]:[e],`rules`,{revalidate:!0}),li=()=>Et(`rules`);function ui({eyebrow:e,title:t,sub:n,primary:r,actions:i,crumbs:a}){return(0,W.jsxs)(`div`,{className:`page-head`,children:[(0,W.jsxs)(`div`,{children:[a?.length?(0,W.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`page-crumbs`,children:(0,W.jsx)(`ol`,{children:a.map((e,t)=>(0,W.jsx)(`li`,{children:t===a.length-1?(0,W.jsx)(`span`,{"aria-current":`page`,children:e.label}):e.href?(0,W.jsx)(`a`,{href:e.href,children:e.label}):e.label},t))})}):null,e?(0,W.jsx)(`div`,{className:`eyebrow`,children:e}):null,(0,W.jsx)(`h1`,{className:`h`,children:t}),n?(0,W.jsx)(`p`,{className:`sub`,children:n}):null]}),r||i?(0,W.jsxs)(`div`,{className:`page-actions`,children:[i,r]}):null]})}function di({segments:e,value:t,max:n,size:r=120,stroke:i=12,label:a,sweepMs:o=E[9]}){let s=n>0?n:0,c=e||[{key:`v`,label:a,n:Math.min(Math.max(t||0,0),s),tone:`accent`}],l=e?c.reduce((e,t)=>e+t.n,0):s,u=e?c.map(e=>`${e.label}: ${e.n} of ${l}`).join(`, `):`${c[0].n} of ${l}`,d=r/2-i/2,f=r/2,p=e=>[f+d*Math.cos(e),f+d*Math.sin(e)],m=[],h=0;for(let e of c)m.push(h),h+=e.n;let g=(0,B.useRef)(null),_=c.map(e=>e.n).join(`,`);return(0,B.useLayoutEffect)(()=>{let e=g.current?.querySelectorAll(`path.ring-arc`);if(!o||!e?.length||!w())return;let t=c.map(e=>e.n/l).filter(e=>e>0),n=t.map((e,n)=>t.slice(0,n).reduce((e,t)=>e+t,0)),r=he(e);T(r,{draw:`0 0`});let i=S(r,{draw:[`0 0`,`0 1`],duration:(e,n)=>Math.max(o*t[n],E[1]),delay:(e,t)=>o*n[t],ease:`linear`});return y(i,o)},[_,o]),(0,W.jsxs)(`svg`,{className:`ring`,width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:`img`,"aria-label":a?`${a}: ${u}`:u,children:[(0,W.jsx)(`circle`,{className:`ring-track`,cx:f,cy:f,r:d,fill:`none`,strokeWidth:i}),(0,W.jsx)(`g`,{ref:g,children:l>0?c.map((e,t)=>{let n=e.n/l;if(!(n>0))return null;let r=m[t]/l*2*Math.PI-Math.PI/2,a=r+n*2*Math.PI,[o,s]=p(r),[c,u]=p(a),h=n>=.9999?`M ${o} ${s} A ${d} ${d} 0 1 1 ${2*f-o} ${2*f-s} A ${d} ${d} 0 1 1 ${o} ${s}`:`M ${o} ${s} A ${d} ${d} 0 ${+(n>.5)} 1 ${c} ${u}`;return(0,W.jsx)(`path`,{className:`ring-arc tone-${e.tone||`muted`}`,d:h,fill:`none`,strokeWidth:i,children:(0,W.jsxs)(`title`,{children:[e.label,`: `,e.n]})},e.key)}):null})]})}var fi=E[8];function pi({parts:e,total:t,label:n,legend:r=!0}){let i=e.reduce((e,t)=>e+t.n,0),a=t??i,o=e=>a>0?`${e/a*100}%`:`0%`,s=e.map(e=>`${e.label}: ${e.n} of ${a}`).join(`, `),c=(0,B.useRef)(null),l=e.map(e=>e.n).join(`,`)+`/${a}`;return(0,B.useLayoutEffect)(()=>{if(c.current&&w())return T(c.current,{scaleX:0}),y(S(c.current,{scaleX:[0,1],duration:fi,ease:k}),fi)},[l]),(0,W.jsxs)(`div`,{className:`stackbar-box`,children:[(0,W.jsx)(`div`,{className:`stackbar sweep`,role:`img`,"aria-label":n?`${n}: ${s}`:s,ref:c,children:e.map(e=>e.n>0?(0,W.jsx)(`span`,{className:`tone-${e.tone||`muted`}`,style:{width:o(e.n)},title:`${e.label}: ${e.n}`},e.key):null)}),r&&(0,W.jsx)(`ul`,{className:`stackbar-legend`,"aria-hidden":`true`,children:e.map(e=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`i`,{className:`tone-${e.tone||`muted`}`}),e.label,` `,(0,W.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function mi({value:e,max:t,label:n=`value`,tone:r=`accent`}){let i=t>0?t:0;return(0,W.jsx)(pi,{parts:[{key:`v`,label:n,n:Math.min(Math.max(e||0,0),i),tone:r}],total:i,legend:!1})}var hi=864e5;function gi(e,t=10,n=`today`){let r=Array(t).fill(0).map((e,r)=>({t:r===t-1?n:`${t-1-r}d`,v:0})),i=e=>new Date(e).setHours(0,0,0,0),a=i(Date.now());for(let n of e){let e=n.started||n.finished||n.created||n.ts;if(!e)continue;let o=typeof e==`string`?Date.parse(e):e*1e3;if(!Number.isFinite(o))continue;let s=Math.round((a-i(o))/hi);s<0||s>=t||(r[t-1-s].v+=1)}return r}var _i=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),vi=[`--emit`,`--theme`,`--scope`],yi={done:`✓`,failed:`✗`};function bi(e){let t=(e.output||``).split(`
|
|
6
|
+
`).find(e=>e.startsWith(`$ `))||``,n=t.split(/\s+/),r=[];return n.forEach((e,t)=>{let[i,a]=e.split(`=`),o=a||n[t+1];vi.includes(i)&&o&&!o.startsWith(`--`)&&r.push(o)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:r.join(` · `),result:yi[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}var xi={busy:{cls:`acc`,label:`working`,accent:`var(--accent)`},"waiting-input":{cls:`warn`,label:`your move`,accent:`var(--warn)`},blocked:{cls:`bad`,label:`blocked`,accent:`var(--bad)`},idle:{cls:``,label:`idle`,accent:`var(--line)`}},Si={cls:``,label:`ended`};function Ci(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var wi=e=>e?e<1e3?String(e):e<1e5?(e/1e3).toFixed(1)+`k`:e<1e6?(e/1e3).toFixed(0)+`k`:(e/1e6).toFixed(1)+`M`:`0`;function Ti(e){if(e=Math.max(0,Math.floor(e)),e<60)return`${e}s`;let t=Math.floor(e/60);return t<60?`${t}m ${e%60}s`:`${Math.floor(t/60)}h ${t%60}m`}function Ei({startedAt:e}){let[t,n]=(0,B.useState)(()=>Date.now()/1e3);return(0,B.useEffect)(()=>{let e=setInterval(()=>n(Date.now()/1e3),1e3);return()=>clearInterval(e)},[]),Ti(t-e)}function Di({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,W.jsxs)(`span`,{className:`act-todo`,children:[(0,W.jsx)(`span`,{className:`on`,children:`●`.repeat(r)}),(0,W.jsx)(`span`,{className:`dim`,children:`○`.repeat(n-r)})]})}var Oi=e=>e.ended?null:e.turn_started_at,ki=e=>!!(e.tokens>0||e.cost>0||Oi(e)||e.files?.count>0);function Ai({s:e,heading:t,id:n,children:r}){let i=e.ended?Si:xi[e.status]||xi.idle,a=e.files,o=ki(e),s=e=>n?`${n}-${e}`:void 0;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:`row between wrap gap-12`,children:[t?(0,W.jsxs)(`div`,{className:`row gap-10 act-min`,children:[(0,W.jsx)(`span`,{className:`feed-dot act-dot ${e.ended?``:i.cls||`acc`}`}),(0,W.jsxs)(`div`,{className:`act-min`,children:[(0,W.jsx)(`h2`,{className:`act-title`,id:s(`t`),children:t}),e.cwd&&(0,W.jsx)(`div`,{className:`dim mono act-cwd`,title:e.cwd,children:e.cwd})]})]}):null,(0,W.jsxs)(`div`,{className:`row gap-8 act-fixed`,children:[e.model&&(0,W.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,W.jsx)(`span`,{className:`badge`,children:e.agent}),(0,W.jsxs)(`span`,{className:`badge ${i.cls}`,id:s(`st`),children:[(0,W.jsx)(`span`,{className:`dot`}),i.label]}),r]})]}),e.phase&&(0,W.jsxs)(`div`,{className:`row gap-8 act-phase`,children:[(0,W.jsx)(G,{name:`activity`}),(0,W.jsx)(`span`,{className:`act-ell`,title:e.phase,children:e.phase})]}),o&&(0,W.jsxs)(`div`,{className:`row wrap act-counters`,id:s(`c`),children:[e.tokens>0&&(0,W.jsxs)(`span`,{children:[wi(e.tokens),` tok`]}),e.cost>0&&(0,W.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),Oi(e)?(0,W.jsx)(`span`,{children:(0,W.jsx)(Ei,{startedAt:e.turn_started_at})}):null,a&&a.count>0&&(0,W.jsxs)(`span`,{children:[a.count,` file`,a.count===1?``:`s`,` `,(0,W.jsxs)(`span`,{className:`t-good`,children:[`+`,a.additions]}),` `,(0,W.jsxs)(`span`,{className:`t-bad`,children:[`−`,a.deletions]})]})]}),(e.error||e.blocked_on)&&(0,W.jsx)(`div`,{className:`act-err-row`,children:(0,W.jsx)(`span`,{className:`badge bad act-ell`,title:e.error||e.blocked_on,children:e.error||e.blocked_on})})]})}var ji=e=>e?.status===`blocked`||e?.status===`waiting-input`,Mi=864e5,Ni=e=>new Date(e).toISOString().slice(0,10),Pi=(e,t)=>new Date(`${e}T00:00:00Z`).toLocaleDateString(`en-GB`,{...t,timeZone:`UTC`}),Fi=e=>Pi(e,{day:`numeric`,month:`short`});function Ii(e,t=Date.now()){let n=Pi(e,{weekday:`long`,day:`numeric`,month:`long`}),r=e===Ni(t)?`Today`:e===Ni(t-Mi)?`Yesterday`:``;return r?`${r} · ${n}`:n}function Li(e,{now:t=Date.now(),days:n=14,cap:r}={}){let i=(e||[]).filter(e=>Number.isFinite(e.started)),a={};for(let e of i){let t=Ni(e.started*1e3);a[t]=(a[t]||0)+1}let o=i.length?Ni(Math.min(...i.map(e=>e.started))*1e3):null,s=i.filter(e=>e.status!==`running`).length,c=typeof r!=`number`||s>=r;return Array.from({length:n},(e,r)=>{let i=Ni(t-(n-1-r)*Mi);return{key:i,n:a[i]||0,nodata:c&&(o===null||i<o)}})}var Ri=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function zi(e,t,n,r=Date.now()){let i={},a=e=>i[e]||={key:e,runs:[],asks:[]};for(let t of _i(e,(e||[]).length))Number.isFinite(t.started)&&a(Ni(t.started*1e3)).runs.push(t);return(n||[]).forEach((e,n)=>{for(let r of t||[])r.per_day?.[n]>0&&a(e).asks.push([r.name,r.per_day[n]])}),Object.values(i).sort((e,t)=>e.key<t.key?1:-1).map(({key:e,runs:t,asks:n})=>{n.sort((e,t)=>t[1]-e[1]);let i=n.reduce((e,t)=>e+t[1],0),a=n.map(([e,t],n)=>`${e}${n?``:` asked`} ${t}×`).join(`, `),o=[t.length&&Ri(t.length,`run`),i&&Ri(i,`gate ask`)];return{key:e,title:Ii(e,r),sum:o.filter(Boolean).join(` · `),runs:t,gate:i?{title:a,n:i}:null}})}var Bi=E[8];function Vi({vals:e,i:t,sweep:n=!1,fill:r=!1}){let i=(0,B.useRef)(null),a=e.join(`,`);(0,B.useLayoutEffect)(()=>{if(n&&i.current&&w())return T(i.current,{strokeDasharray:1,strokeDashoffset:1}),y(S(i.current,{strokeDashoffset:[1,0],duration:Bi,ease:k}),Bi)},[a,n]);let o=Math.max(1,...e),s=96/(e.length-1),c=e.map((e,t)=>`${(t*s).toFixed(1)},${(20-e/o*17).toFixed(1)}`),[l,u]=c[c.length-1].split(`,`),d=(0,W.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,preserveAspectRatio:r?`none`:void 0,"aria-hidden":`true`,style:{"--i":t},children:[(0,W.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,W.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${c.join(` `)} 96,21`}),(0,W.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:c.join(` `),ref:i}),r?null:(0,W.jsx)(`circle`,{className:`spk-end`,cx:l,cy:u,r:`2.4`})]});return r?(0,W.jsxs)(`span`,{className:`spark-fill`,style:{"--i":t},children:[d,(0,W.jsx)(`i`,{className:`spk-end`,"aria-hidden":`true`,style:{top:`${u/22*100}%`}})]}):d}function Hi(e,t){let n=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{let e=n.current?[...n.current.querySelectorAll(`[data-sweep]`)]:[];if(e.length&&w())return T(e,{[t]:0}),y(S(e,{[t]:[0,1],duration:Bi,ease:k}),Bi)},[e,t]),n}var Y={security:`oklch(0.74 0.085 45)`,verify:`oklch(0.78 0.075 200)`,process:`oklch(0.76 0.075 150)`,craft:`oklch(0.78 0.085 95)`,context:`oklch(0.74 0.08 280)`,comms:`oklch(0.76 0.085 345)`},Ui={security:{label:`Security`,c:Y.security},verify:{label:`Verification`,c:Y.verify},process:{label:`Process`,c:Y.process},craft:{label:`Craft`,c:Y.craft},context:{label:`Context`,c:Y.context},comms:{label:`Communication`,c:Y.comms}},Wi={craft:Y.craft,rigor:Y.verify,ops:Y.process,process:Y.security,comms:Y.comms},Gi=e=>Wi[e]||`var(--text-3)`,Ki={design:{label:`Design`,c:Y.context},build:{label:`Build`,c:Y.craft},review:{label:`Review`,c:Y.security},ship:{label:`Ship`,c:Y.process},understand:{label:`Understand`,c:Y.verify},learn:{label:`Learn`,c:Y.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Custom`,c:`oklch(0.72 0.025 250)`}},qi=Object.keys(Ki);function Ji(e){let t=String(e||``),n=/\(retired\)\s*$/i.test(t);t=t.replace(/\s*\(retired\)\s*$/i,``),t=t.replace(/^(?:Rule\s+[IVXLCDM\d]+|Doctrine\s+[a-z]+\s+\d+)\s*[—-]\s*/i,``);let r=t.indexOf(` · `);return r===-1?{latin:``,name:t.trim(),retired:n}:{latin:t.slice(0,r).trim(),name:t.slice(r+3).trim(),retired:n}}var Yi=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],Xi=e=>{let t=``;for(let[n,r]of Yi)for(;e>=n;)t+=r,e-=n;return t};function Zi(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?Xi(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}function Qi(e){if(ea[e])return ea[e].label;let t=/^([a-z]+)\.(\d+)$/.exec(e);return t?`${t[1][0].toUpperCase()}${t[1].slice(1)} rule ${t[2]}`:/^[IVXLC]+$/.test(e)?`Rule ${e}`:e}var $i=new Set([`I`,`III`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),ea={I:{key:`secretsGate`,label:`Secrets gate`},III:{key:`doneGate`,label:`Done gate`},IV:{key:`deletionGate`,label:`Deletion gate`},VIII:{key:`testNote`,label:`Test note`},ownership:{key:`ownershipGate`,label:`Ownership gate`},"rigor.5":{key:`externalGate`,label:`External gate`}},ta=new Set([`process.1`,`process.5`,`ops.2`]),na={addr:`process.5`,key:`ownBranchPass`,label:`Strict consent`,desc:`Ask before every commit and push, your own branch included.`,on:`Every commit and push asks again, on your own branch too.`,off:`Commits and pushes on your own branch pass again; the main branch still asks.`},ra=new Set([...$i].filter(e=>e.includes(`.`)&&!ta.has(e)&&!ea[e])),ia={I:{arm:`Writes that would carry a credential-shaped string are refused again.`,off:`A write carrying a credential-shaped string (on OpenCode, also a write to a key file) stops being refused. Rule I’s text still binds the agent; protected checks, real data loss and commit/push consent stay gated.`},III:{arm:`A turn that edited files cannot end before the checks in a non-empty .geneseed/done-checks.txt pass. With no such file, inferred checks only warn.`,off:`A turn that edited files may end without its checks passing, listed or inferred, and the session’s done-gate line goes. Rule III’s text still binds the agent; every other gate stays.`},IV:{arm:`Commands that would lose data nothing else holds ask again.`,off:`Commands that would really lose data — discarding uncommitted work, deleting an unpushed branch, removing untracked files — stop asking. Rule IV’s text still binds the agent; secrets, root-wide scans and commit/push consent stay gated.`},VIII:{arm:`A write that weakens a test gets a note again, when it happens and when the turn ends.`,off:`A write that adds a skip marker or drops an assertion gets no note, when it happens or when the turn ends. Rule VIII’s text still binds the agent; the done checks and every other gate stay. Run geneseed rebuild-all first: an older hook shim refuses the new flag, and every gate on that hook goes silent.`},ownership:{desc:`Stops the first write in an undecided application, once per session.`,arm:`The first write in an undecided application stops once again.`,off:`The first write in an undecided application is no longer stopped, the setup proposal leaves the install’s AGENT.md, and no decline reminder prints. A repo with mode: on still runs its checkpoints, and the Credo section still binds.`},"rigor.5":{arm:`Writes to a protected check or a gate’s own configuration ask again.`,off:`Writes to a protected check or a gate’s own configuration stop asking. The agent can then edit hook settings and AGENT.md gate markers unasked, so every other gate holds only while it leaves its wiring alone. OpenCode’s own permission.edit keys still ask. The rule’s text is not touched: excluding it is the rule’s own switch. Run geneseed rebuild-all first: an older hook shim refuses the new flag, and every gate on that hook goes silent.`}},aa={I:{on:`A file write (Write, Edit, NotebookEdit) whose new text holds a credential-shaped string: an AWS access key, a GitHub, Anthropic or Slack token, a private-key block. Files named .env* are exempt.`,hosts:`Claude Code and OpenClaude ask you. Bob refuses the write. OpenCode refuses it, and also refuses a write to a key file, such as *.pem, *.key, id_rsa, .ssh/ or .npmrc; on .env* it only warns.`,blind:`Text written by a shell command is not scanned, and other token formats pass.`,off:`The scan stops on every host, OpenCode’s key-file block too. Rule I’s text still binds.`},III:{on:`The end of a turn that edited files under the git root with a file-write tool. It reads the turn’s shell calls in the transcript and never runs a check itself.`,hosts:`Claude Code and OpenClaude: with checks listed in .geneseed/done-checks.txt, the turn cannot end until each one ran unpiped and passed after the last edit (one block per turn). With no list, checks are inferred from the manifests and only warn. OpenCode 1: a reminder on the next request. OpenCode 2 and Bob: not judged.`,blind:`A shell edit (sed -i, a redirect) is no edit here. A check that is piped, masked (|| true) or spelled another way (npx vitest) reads as not run.`,off:`No check at turn end, no done-gate line at start, and no weakened-test line at turn end; learning still runs. Rule III’s text still binds.`},IV:{on:`A shell command that would lose data nothing else holds, judged against the repo’s state: a protected branch deleted or force-pushed, an unpushed branch deleted, reset --hard over unpushed commits, uncommitted work discarded, a stash dropped, the reflog pruned, files git cannot restore removed. Also rm -rf of /, a drive or ~, mkfs, dd over a disk, format, a fork bomb.`,hosts:`Claude Code and OpenClaude ask you. Bob and OpenCode’s guard refuse. OpenCode’s own prompt also asks on git reflog expire, git gc --prune, and a force push or delete of main or master.`,blind:`It reads git, the rm family, find -delete, mkfs, dd and format: a script that deletes files itself passes. When it cannot tell (a glob, a $variable, sh -c, xargs), it asks rather than passes.`,off:`The real-loss check and OpenCode’s Rule IV prompt keys stop. The rm -rf / class still asks (refused on Bob and OpenCode). Rule IV’s text still binds.`},VIII:{on:`A file write to a test file that adds a skip marker (.skip(, xit(, xfail, @Disabled, @Ignore, pytest.mark.skip, t.Skip() or removes an assertion line and adds no other.`,hosts:`Advisory on every host: it asks nothing and blocks nothing. Claude Code and OpenClaude: a note to the agent at the edit, and a line to you at turn end. Bob: a hook-log line. OpenCode: one reminder on the next request, which the done gate’s switch also silences.`,blind:`Shell edits, and an assertion that is loosened in place rather than removed.`,off:`No note at the edit or at turn end. Rule VIII’s text still binds; the done checks stay.`},ownership:{on:`The first file write of a session in an application repo (a git root with a build manifest) whose root AGENTS.md has no ## Ownership section. Writes to AGENTS.md or .geneseed/ pass.`,hosts:`Every host refuses that write once and gives the reason to the agent, which asks you to set ownership up or skip; the next write passes. Bob uses exit 2. On Claude Code, OpenClaude and OpenCode a sub-agent never triggers it.`,blind:`Shell writes.`,off:`No first-write stop and no setup proposal. A repo with mode: on still runs its checkpoints, and the Credo section still binds.`},"process.1":{on:`A write to a rule store, user-rules.md or user-rules.draft.md, by a file tool or a parsed shell write. A hardlinked file always asks. Memory writes (MEMORY.md, memory/) pass.`,hosts:`Claude Code and OpenClaude ask you. Bob refuses a file-tool write and only warns on a shell write. OpenCode asks with its own prompt; the guard refuses what the host cannot prompt for, and OpenCode 1 refuses a parsed shell write.`,blind:`bash -c, interpreters, scripts and variables. The change report at turn end still lists store changes made outside an approved write, memory writes included.`,off:`Excluding this rule, or the process pack, is the switch: its hook goes with its text on every host, OpenCode’s permission.edit keys on the rule files too. The change report still lists rule-file changes.`},"process.5":{on:`A git commit or push onto the main branch (main, master, the remote’s default), a forced push, a bare git push, or a form the gate cannot read. Under strict consent, every commit and push.`,hosts:`Claude Code and OpenClaude ask you; commits and plain pushes on your own branch pass. OpenCode asks for every commit and push with its own prompt (its globs cannot see the branch), and allows a push of HEAD to loop/*. Bob only logs a warning; the command runs.`,blind:`A commit or push made by another program, a script or an alias.`,off:`Excluding this rule, or the process pack, is the switch: commits and pushes stop asking (Bob still logs its warning). The data-loss checks stay.`},"rigor.5":{on:`A write to a path in the project’s .geneseed/protected-checks.txt, to .geneseed/done-checks.txt, or to a gate’s own configuration: hook settings, excludes.json, AGENT.md gate markers, the manifest, any opencode.json(c), the hook shim. Parsed shell writes too (>, tee, sed -i, cp, mv, rm, the PowerShell writers).`,hosts:`Claude Code and OpenClaude ask you. Bob refuses the write; a hook settings.json only when it changes Geneseed’s own entries. OpenCode asks through its permission.edit keys; its guard refuses a protected check, the other hosts’ Geneseed files, and a shell write to any of them.`,blind:`bash -c, pwsh -c, interpreters, scripts, variables and globs: run the same checks in CI.`,off:`Every ask and refusal above stops, except OpenCode’s own permission.edit keys. Excluding the text on this page switches this gate off too; --exclude-rules rigor.5 alone leaves the hook asking.`},"ops.2":{on:`A recursive scan rooted at a filesystem root: find /, du /, grep -r or rg at /, /c or C:\\, Get-ChildItem C:\\ -Recurse.`,hosts:`Claude Code and OpenClaude ask you. Bob and OpenCode refuse it.`,blind:`A deeper path, ls / without -R, a quoted argument, the remote half of ssh, and a scan made by any other program.`,off:`Excluding this rule, or the ops pack, is the switch: a root scan stops asking on every host. The data-loss checks stay.`}},oa=[{key:`invariants`,source:`{{LAWS}}`,against:`—`},{key:`yours`,source:`user-rules.md`,against:`may tighten a {{LAW}}, never repeal one`},{key:`ethos`,source:`{{ONTOLOGY}}`,against:`never against a user rule`},{key:`doctrines`,source:`{{DOCTRINES}}`,against:`may tighten, never repeal`}],sa=[{source:`mode`,label:`Mode`,against:`binds how work runs`},{source:`PROFILE.md, posture, theme`,label:`Profile, posture, voice`,against:`inform only; never bind`}],ca=(e,t={})=>ea[e]?t?.[ea[e].key]===!1?`Gate off`:`Hook gate`:$i.has(e)?`Hook gate`:`Instruction`;function la(e){let t={};for(let n of e||[]){let e=Ki[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:Ki[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=qi.filter(e=>t[e]).map(e=>({...t[e],n:t[e].ok+t[e].exp}));return{rows:n,total:n.reduce((e,t)=>e+t.n,0),experimental:n.reduce((e,t)=>e+t.exp,0),max:Math.max(1,...n.map(e=>e.n))}}var X=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function ua({overview:e,setup:t,rules:n,activity:r,profile:i,skills:a,laws:o}){let s=[],c=e?.doctor;c&&!c.ok&&s.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=pa(`drift`,l,``);u&&s.push(u),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`≈${d.tokens.toLocaleString(`en-US`)} tokens, the file's header alone`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=Zi(e),i=(o?.items||[]).find(e=>e.name===r),a=i?Ji(i.title).name:Qi(r);s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${X(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:`constitution`,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=la(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${X(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`personal/memory`,verb:`Open`,href:`#/personal/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}var da=e=>Lt(e.drift),fa=e=>Ft(e.drift);function pa(e,t,n){let r=Lt(t),i=Ft(t),a={id:e,tag:`Local edits`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`};return r?{...a,tone:`warn`,title:`${n}${X(r,`local edit`)}`,detail:`${t.edited-i} edited, ${t.added} added, ${t.missing} missing`+(i?`, ${i} kept`:``)}:i?{...a,tone:``,sugg:!0,title:`${n}${X(i,`kept edit`)}`,detail:`edited in place, source unchanged — nothing missed`}:null}var ma=e=>e.drift?.stale??0;function ha(e){let t=t=>new Set((e?.never||[]).filter(e=>e.kind===t).map(e=>e.name)).size;return{skills:t(`skill`),agents:t(`agent`)}}function ga(e){let t=e?.installs||[],n=t.filter(e=>e.state===`active`),r=t.length-n.length,i=n.filter(e=>e.verdict===`behind`).length,a=n.reduce((e,t)=>e+da(t),0),o=n.reduce((e,t)=>e+ma(t),0),s=n.reduce((e,t)=>e+fa(t),0),c=e?.doctor,l=c&&!c.ok?`bad`:i||a||o?`warn`:c?`good`:`unknown`,u={good:`Installs healthy.`,unknown:`Checking the installs.`,warn:`Installs need a look.`,bad:`Installs have problems.`}[l],d=[X(n.length,`active install`)+(r?`, ${r} disabled`:``),c?c.ok?`doctor clean`:`doctor found ${X(c.problems.length,`problem`)}`:`doctor still running`,i?`${X(i,`install`)} behind source`:`all in sync with source`,(a?X(a,`local edit`):`no local edits`)+(s?`, ${X(s,`kept edit`)}`:``)];return o&&d.push(`${X(o,`file`)} behind source`),{tone:l,head:u,facts:d}}var _a=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],va=e=>e?e.carrier+e.skills+e.agents+e.context:0,ya=e=>e.state===`active`&&(e.verdict===`behind`||Lt(e.drift)>0||(e.drift?.stale??0)>0),Z=e=>`≈${(e/4/1e3).toFixed(1)}k`,ba=Dn,xa=.85;function Sa(e){let t=({chars:e,budget:t,cut:n})=>e+(n?t:0),n=(e||[]).filter(e=>e.session_start).reduce((e,n)=>!e||t(n.session_start)>t(e.session_start)?n:e,null);if(!n)return null;let{chars:r,budget:i,cut:a}=n.session_start;return{install:n,size:`${(r/1e3).toFixed(1)} / ${i/1e3} KB`,cut:a,near:a||r/i>=xa}}var Ca=e=>({id:e.id,host:e.host,path:e.path,label:ba(e)});function wa({fleet:e,usage:t,defaultLabel:n=null,...r}){let i=[],a=e?.doctor;a&&!a.ok&&i.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(a.problems.length,`problem`)}`,detail:a.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});for(let t of(e?.installs||[]).filter(e=>e.state===`active`)){if(t.verdict===`behind`){let e=t.built_epoch?`built ${jt(t.built_epoch)} ago`:`never built`,n=ma(t);i.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${ba(t)} is behind its source`,detail:n?`${e} · ${X(n,`file`)} behind`:e,where:Cn(t.host).label,verb:`Rebuild`,act:`rebuild`,installs:[Ca(t)]})}let e=pa(`drift:${t.id}`,t.drift,`${ba(t)}: `);e&&i.push(e)}if(t&&t.days_counted>=30&&t.never?.length){let{skills:e,agents:n}=ha(t);i.push({id:`usage`,tag:`Usage`,tone:``,sugg:!0,title:`${X(e,`skill`)} never fired in 30 days`,detail:`${X(n,`agent`)} too`,where:`library/skills`,verb:`Triage`,href:`#/skills`})}let o=Sa(e?.installs);if(o?.near){let e=o.cut?`were cut to fit the session-start budget`:`are near the session-start budget`;i.push({id:`session-start`,tag:`Session`,tone:`warn`,sugg:!0,title:o.install.shared?`Session files ${e}`:`${ba(o.install)}: session files ${e}`,detail:`${o.size} · without project context`,where:`personal`,verb:`Trim`,href:`#/personal`})}let s=(e?.installs||[]).filter(e=>e.state===`active`);s.some(e=>e.shared&&e.facts===0)&&i.push({id:`memory:shared`,tag:`Memory`,tone:``,sugg:!0,title:`Memory holds no facts`,detail:`no durable lesson recorded yet`,where:`personal/memory`,verb:`Open`,href:`#/personal/memory`});for(let e of s.filter(e=>!e.shared&&e.facts===0))i.push({id:`memory:${e.id}`,tag:`Memory`,tone:``,sugg:!0,title:`${ba(e)}: memory holds no facts`,detail:`no durable lesson recorded yet`,where:`personal/memory`,verb:`Open`,href:`#/personal/memory`});let c=ua({...r,overview:r.overview&&{...r.overview,doctor:null,diff:null},setup:s.some(e=>e.facts!=null)&&r.setup?{...r.setup,facts:null}:r.setup}),l=new Set([`profile`,`rules`]);for(let e of c){let t=n&&l.has(e.id)&&!r[e.id]?.shared?{title:`${n}: ${e.title}`}:{};i.push({...e,...t,sugg:!0})}return i}function Ta(e,t){return(e?.rules||[]).map(e=>{let n=Zi(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?Ji(r.title).name:e.rule===`wiki`?`Wiki guard`:Qi(n)}})}var Ea=e=>(e||[]).filter(e=>e.state===`active`&&e.cost);function Da(e){let t=Ea(e).filter(e=>e.cost.ceiling>0&&Number.isFinite(e.cost.carrier)),n=e=>e.cost.carrier/e.cost.ceiling,r=t.reduce((e,t)=>!e||n(t)>n(e)?t:e,null);if(!r)return null;let{carrier:i,ceiling:a}=r.cost;return{label:Dn(r),carrier:i,ceiling:a,pct:Math.round(n(r)*100)}}function Oa(e){let t=Ea(e);if(!t.length)return null;let n=t.reduce((e,t)=>va(t.cost)>va(e.cost)?t:e),r=t.map(e=>va(e.cost));return{min:Math.min(...r),max:Math.max(...r),top:n}}var ka=e=>(e?.per_day||[]).reduce((e,t)=>e+t,0);function Aa(e,t){let n=Ta(e,t),r=n.reduce((e,t)=>e+t.n,0),i=n.reduce((e,t)=>!e||t.n>e.n?t:e,null),a=[];for(let e of n)(e.per_day||[]).forEach((e,t)=>{a[t]=(a[t]||0)+e});return{total:r,top:i?{name:i.name,n:i.n}:null,perDay:a}}var ja=e=>e.catch(()=>null),Ma=e=>e.loading&&!e.data,Na=e=>!e.loading&&!e.data,Pa=e=>{let t=e.currentTarget.closest(`section`);t&&(t.setAttribute(`tabindex`,`-1`),t.focus())};function Fa({what:e,read:t,retry:n=!0}){let r=t.error?`${e} could not be read: ${t.error}`:`${e} could not be read.`;return n?(0,W.jsxs)(`div`,{className:`error-state`,children:[(0,W.jsx)(Vr,{error:r}),(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Retry: ${e.toLowerCase()}`,onClick:e=>{Pa(e),t.reload()},children:`Retry`})]}):(0,W.jsx)(Vr,{error:r,role:null})}var Ia=e=>Promise.resolve().then(e),La=(e,t)=>`${t?Math.min(100,e/t*100):0}%`,Ra=36e5,za=5e3,Ba=`This checkout cannot pull: it has local changes, a detached HEAD, no upstream or a diverged branch.`;function Va({update:e,onAction:t,canFill:n=!0}){if(!e)return null;let r=e.install??(e.git?`git`:`npm-global`),i=r===`git`&&typeof e.behind==`number`?e.behind:null,a=r===`git`&&e.behind===null&&e.checking,o=i===null?e.latest===null||a?(0,W.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · `,e.checking?`checking…`:`update check unavailable`]}):e.available?(0,W.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,W.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}):(0,W.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):i>0?(0,W.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current??``,` `,(0,W.jsxs)(`span`,{className:`ver-new`,children:[i,` commit`,i===1?``:`s`,` to pull`]})]}):(0,W.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · latest`]});if(r===`other`)return!e.available||!e.command?o:(0,W.jsxs)(W.Fragment,{children:[o,(0,W.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,W.jsx)(`code`,{className:`mono`,children:e.command})]})]});if(e.behind===!1&&e.available)return(0,W.jsx)(`span`,{title:Ba,children:o});if(a||e.behind===!1||r!==`git`&&!e.available)return o;let s=i===null?!!e.available:i>0;return(0,W.jsxs)(W.Fragment,{children:[o,(0,W.jsx)(`button`,{type:`button`,className:s&&n?`btn`:`btn ghost`,title:r===`git`?i===0?`Nothing to pull: this is the latest. Pulls and rebuilds every install anyway.`:`git pull, then rebuild every install`:`npm install -g geneseed@latest, then rebuild every install`,onClick:()=>t(`update`),children:`Update`})]})}var Ha={good:`M8 12.5l2.7 2.7L16 9.5M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`,warn:`M12 3 22 20H2zM12 10v4M12 17v.5`,bad:`M9 9l6 6M15 9l-6 6M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`,unknown:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`};function Ua({tone:e}){return(0,W.jsx)(`svg`,{className:`health-ico`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:Ha[e]||Ha.warn})})}function Wa({fleet:e,error:t,behind:n,onAction:r,onRebuild:i}){let a=(0,W.jsx)(`button`,{type:`button`,className:`btn ghost ldg-doctor`,onClick:()=>r(`doctor`),children:`Run doctor`});if(!e)return t?(0,W.jsxs)(`section`,{className:`health unknown`,"aria-labelledby":`ldg-health`,children:[(0,W.jsx)(Ua,{tone:`warn`}),(0,W.jsx)(`div`,{className:`health-text`,role:`status`,children:(0,W.jsx)(`h2`,{id:`ldg-health`,children:`Status unknown`})}),(0,W.jsx)(`div`,{className:`health-acts`,children:a})]}):(0,W.jsx)(`div`,{className:`health unknown`,"aria-busy":`true`,children:(0,W.jsx)(J,{label:`Reading the installs…`})});let o=ga(e),s=[...o.facts,...e.version?[`Source is ${e.version}`]:[]];return(0,W.jsxs)(`section`,{className:`health ${o.tone}`,"aria-labelledby":`ldg-health`,children:[(0,W.jsx)(Ua,{tone:o.tone}),(0,W.jsxs)(`div`,{className:`health-text`,role:`status`,children:[(0,W.jsx)(`h2`,{id:`ldg-health`,children:o.head}),(0,W.jsxs)(`p`,{className:`health-facts`,children:[s.join(` · `),`.`]})]}),(0,W.jsxs)(`div`,{className:`health-acts`,children:[a,n.length?(0,W.jsxs)(`button`,{type:`button`,className:`btn`,title:`Rebuilds ${n.map(e=>e.label).join(`, `)}`,onClick:()=>i(n),children:[`Rebuild all behind (`,n.length,`)`]}):null]})]})}function Ga({chars:e}){let t=ne(e);return(0,W.jsxs)(`span`,{className:`mono`,children:[Z(t??e),` tok`]})}var Q=e=>Math.round(e/4),Ka={carrier:`accent`,skills:`skill`,agents:`agent`,context:`context`},qa=e=>_a.map(([t,n])=>({key:t,label:n,n:Q(e[t]),tone:Ka[t]})),Ja=Dn;function Ya({cost:e,i:t}){let n=2*Math.PI*14,r=e.ceiling?Math.min(1,e.carrier/e.ceiling):0;return(0,W.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,W.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,W.jsx)(`circle`,{className:`fg`+(e.ceiling&&e.carrier>e.ceiling?` over`:``),cx:`18`,cy:`18`,r:14,strokeDasharray:n.toFixed(2),strokeDashoffset:(n*(1-r)).toFixed(2),style:{"--circ":n.toFixed(2),"--i":t}})]})}function Xa({id:e,title:t,aside:n,className:r=``,children:i}){return(0,W.jsxs)(`section`,{className:`panel ldg-kpi ${r}`,"aria-labelledby":e,children:[(0,W.jsxs)(`div`,{className:`ldg-kpi-head`,children:[(0,W.jsx)(`h3`,{id:e,children:t}),n]}),i]})}var Za=(0,W.jsx)(`p`,{className:`dim`,children:`The installs could not be read.`});function Qa({installs:e,pending:t,failed:n}){let r=Da(e);return(0,W.jsx)(Xa,{id:`ldg-k-root`,title:`Root file vs ceiling`,className:`ldg-kpi-root`,children:t?(0,W.jsx)(J,{}):n?Za:r?(0,W.jsxs)(`div`,{className:`ldg-kpi-ring`,children:[(0,W.jsxs)(`span`,{className:`ldg-ringbox`,children:[(0,W.jsx)(di,{value:Q(r.carrier),max:Q(r.ceiling),segments:r.pct>100?[{key:`v`,label:`root file`,n:Q(r.carrier),tone:`bad`}]:void 0,size:104,stroke:10,label:`Worst root file: ${r.label}, ${r.pct} percent of its ceiling`}),(0,W.jsxs)(`span`,{className:`mono ldg-ring-pct`,"aria-hidden":`true`,children:[r.pct,`%`]})]}),(0,W.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,W.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(r.carrier)} tokens`}),(0,W.jsx)(`span`,{className:`dim`,children:`of ${Z(r.ceiling)} ceiling`}),(0,W.jsx)(`span`,{className:`dim`,title:r.label,children:`Highest install`})]})]}):(0,W.jsx)(`p`,{className:`dim`,children:`No root file to measure.`})})}function $a({installs:e,pending:t,failed:n}){let r=Oa(e),i=Sa(e),a=r&&(Z(r.min)===Z(r.max)?Z(r.max):`${Z(r.min)} – ${Z(r.max)}`);return(0,W.jsx)(Xa,{id:`ldg-k-cost`,title:`Loaded every turn`,className:`ldg-kpi-cost`,children:t?(0,W.jsx)(J,{}):n?Za:r?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,W.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(va(r.top.cost))} tokens`}),(0,W.jsx)(`span`,{className:`dim`,title:Ja(r.top),children:`Highest install`})]}),(0,W.jsx)(pi,{parts:qa(r.top.cost),label:`Loaded every turn, ${Ja(r.top)}`}),(0,W.jsx)(`span`,{className:`dim ldg-kpi-cap`,children:`All installs: ${a} tokens`}),i?(0,W.jsx)(`span`,{className:`ldg-kpi-cap ${i.near?`t-warn`:`dim`}`,children:`Session start · ${i.size} · without project context`}):null]}):(0,W.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`})})}function eo({usage:e,read:t,pending:n}){let r=e?.enabled?e.days_counted<30&&e.since?`since ${e.since}`:`30 days`:null;return(0,W.jsx)(Xa,{id:`ldg-k-calls`,title:`Skill and agent calls`,className:`ldg-kpi-calls`,aside:r?(0,W.jsx)(`span`,{className:`mono dim ldg-kpi-aside`,children:r}):null,children:n?(0,W.jsx)(J,{}):e?e.enabled?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:(0,W.jsx)(A,{value:ka(e)})}),e.per_day?.length>1?(0,W.jsx)(Vi,{vals:e.per_day,i:0,fill:!0}):null]}):(0,W.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`}):(0,W.jsx)(Fa,{what:`Usage`,read:t})})}function to({gates:e,laws:t,read:n,pending:r}){let i=Aa(e,t);return(0,W.jsx)(Xa,{id:`ldg-k-gates`,title:`Gate asks · 30 days`,className:`ldg-kpi-gates`,aside:(0,W.jsx)(`a`,{className:`ldg-kpi-aside`,href:`#/laws`,"aria-label":`Open the Constitution`,children:`Constitution →`}),children:r?(0,W.jsx)(J,{}):e?i.total?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`span`,{className:`ldg-kpi-line`,children:[(0,W.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:i.total}),` `,(0,W.jsx)(`span`,{className:`dim`,children:`· ${i.top.name} ${i.top.n}`})]}),i.perDay.length>1?(0,W.jsx)(Vi,{vals:i.perDay,i:1,fill:!0}):null]}):(0,W.jsx)(`p`,{className:`dim`,children:`No gate asked in 30 days.`}):(0,W.jsx)(Fa,{what:`Gate activity`,read:n})})}var no=6;function ro({i:e}){if(!e.diffable)return(0,W.jsx)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:`not checkable`});let t=Lt(e.drift),n=e.drift?.stale??0,r=Ft(e.drift);return(0,W.jsxs)(W.Fragment,{children:[n||t||r?(0,W.jsx)(`span`,{className:`ldg-syncbar`,children:(0,W.jsx)(pi,{parts:[{key:`stale`,label:`Behind source`,n,tone:`warn`},{key:`edited`,label:`Local edits`,n:t,tone:`bad`},...r?[{key:`kept`,label:`Kept edits`,n:r,tone:`muted`}]:[]],label:`Sync with source, ${Ja(e)}`,legend:!1})}):null,t?(0,W.jsxs)(`span`,{className:`mono t-bad`,children:[t,` edited`]}):r?(0,W.jsxs)(`span`,{className:`mono dim`,title:`Edited in place; the source is unchanged, so nothing is missed`,children:[r,` kept`]}):e.drift?.linked?(0,W.jsxs)(`span`,{className:`mono dim`,title:`Yours: links Geneseed leaves alone`,children:[e.drift.linked,` linked by you`]}):n?null:(0,W.jsx)(`span`,{className:`mono dim`,children:`No edits`}),n?(0,W.jsxs)(`div`,{className:`mono dim ldg-sub`,children:[n,` file`,n===1?``:`s`,` behind`]}):null]})}function io(e){if(!e.diffable)return`Not checkable: local edits are only checked for global installs.`;let t=e.drift||{},n=[t.stale?`${t.stale} behind`:null,t.edited-(t.kept??0)?`${t.edited-(t.kept??0)} edited`:null,t.kept?`${t.kept} kept (source unchanged)`:null,t.added?`${t.added} added`:null,t.missing?`${t.missing} missing`:null,t.linked?`${t.linked} linked (yours)`:null].filter(Boolean);return n.length?n.join(` · `):`Nothing differs.`}function ao({i:e,n:t,onRebuild:n,onOpen:r,busy:i}){let[a,o]=(0,B.useState)(!1),s=Ja(e),c=(0,W.jsxs)(`td`,{className:`ldg-where`,children:[i?(0,W.jsx)(`span`,{className:`console-progress`,role:`progressbar`,"aria-label":`Rebuilding ${s}`}):null,(0,W.jsxs)(`div`,{className:`ldg-who`,children:[ya(e)?(0,W.jsx)(`svg`,{className:`ldg-glyph ${Lt(e.drift)?`bad`:`warn`}`,viewBox:`0 0 10 10`,role:`img`,"aria-label":Lt(e.drift)?`local edits`:`needs a rebuild`,children:(0,W.jsx)(`path`,{d:`M5 1 9 9H1z`,fill:`currentColor`})}):null,e.state===`active`&&e.cost?(0,W.jsx)(`span`,{className:`ldg-phone-ring`,"aria-hidden":`true`,children:(0,W.jsx)(Ya,{cost:e.cost,i:t})}):null,(0,W.jsxs)(`div`,{className:`ldg-name`,children:[(0,W.jsx)(`span`,{className:`ldg-host`,children:Cn(e.host).label}),` `,(0,W.jsx)(`span`,{className:`dim`,children:e.scope}),(0,W.jsx)(`div`,{className:`mono dim ldg-path`,title:e.path,children:e.path})]})]})]});if(e.state!==`active`)return(0,W.jsxs)(`tr`,{className:`ldg-off`,children:[c,(0,W.jsx)(`td`,{className:`ldg-build`,children:(0,W.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,W.jsx)(`td`,{className:`ldg-sync`}),(0,W.jsx)(`td`,{className:`ldg-root`}),(0,W.jsx)(`td`,{className:`ldg-total`}),(0,W.jsx)(`td`,{className:`ldg-act`,children:(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`})})]});let l={synced:(0,W.jsx)(`span`,{className:`pill good`,children:`in sync`}),behind:(0,W.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,W.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],u=va(e.cost),d=e.cost?.ceiling?Math.round(e.cost.carrier/e.cost.ceiling*100):null,f=e.cost?.skillCeiling?Math.round(e.cost.skills/e.cost.skillCeiling*100):null;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`tr`,{className:a?`ldg-open`:``,children:[c,(0,W.jsxs)(`td`,{className:`ldg-build`,children:[l,(0,W.jsx)(`div`,{className:`mono dim ldg-sub`,children:e.built_epoch?`built ${jt(e.built_epoch)} ago`:`never built`})]}),(0,W.jsx)(`td`,{className:`ldg-sync`,children:(0,W.jsx)(ro,{i:e})}),(0,W.jsx)(`td`,{className:`ldg-root`,children:e.cost?d===null?(0,W.jsx)(`span`,{className:`dim`,children:`no ceiling`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`ldg-rootbar`,children:(0,W.jsx)(mi,{value:Q(e.cost.carrier),max:Q(e.cost.ceiling),label:`Root file, ${s}`,tone:d>100?`bad`:`accent`})}),(0,W.jsx)(`span`,{className:`mono dim ldg-sub`,children:`${Z(e.cost.carrier)} / ${Z(e.cost.ceiling)} · ${d}%`})]}):(0,W.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,W.jsx)(`td`,{className:`ldg-total`,children:e.cost?(0,W.jsx)(Ga,{chars:u}):null}),(0,W.jsxs)(`td`,{className:`ldg-act`,children:[ya(e)?(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Rebuild ${s}`,title:`Rebuilds ${s} only`,onClick:()=>n([Ca(e)]),children:`Rebuild`}):(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`}),(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm ldg-toggle`,"aria-label":`Details for ${s}`,"aria-expanded":a,"aria-controls":a?`ldg-detail-${e.id}`:void 0,onClick:()=>o(e=>!e),children:(0,W.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,W.jsx)(`path`,{d:a?`M6 15l6-6 6 6`:`M6 9l6 6 6-6`})})})]})]}),a?(0,W.jsx)(`tr`,{className:`ldg-detail`,id:`ldg-detail-${e.id}`,children:(0,W.jsx)(`td`,{colSpan:no,children:(0,W.jsxs)(`div`,{className:`ldg-detail-grid`,children:[(0,W.jsxs)(`div`,{className:`ldg-detail-col`,children:[e.cost?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`ldg-lbl`,children:`What rides every turn · ${Z(u)} tokens`}),(0,W.jsx)(pi,{parts:qa(e.cost),label:s}),f===null?null:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`ldg-rootbar`,children:(0,W.jsx)(mi,{value:Q(e.cost.skills),max:Q(e.cost.skillCeiling),label:`Skill list, ${s}`,tone:f>100?`bad`:`skill`})}),(0,W.jsx)(`span`,{className:`mono dim ldg-sub`,children:`Skill list · ${Z(e.cost.skills)} / ${Z(e.cost.skillCeiling)} ceiling · ${f}%`})]})]}):(0,W.jsx)(`span`,{className:`dim`,children:`Always-on cost not measured.`}),(0,W.jsx)(`span`,{className:`dim`,children:[`Voice ${e.theme}`,`${e.footprint} footprint`,e.posture&&`${e.posture} posture`,e.mode&&`${e.mode} mode`].filter(Boolean).join(` · `)})]}),(0,W.jsxs)(`div`,{className:`ldg-detail-col`,children:[(0,W.jsx)(`span`,{className:`ldg-lbl`,children:`Differs from source`}),(0,W.jsx)(`span`,{className:`muted`,children:io(e)}),e.diffable?(0,W.jsx)(`span`,{children:(0,W.jsx)(`a`,{className:`btn ghost sm`,href:`#/installs/edits`,"aria-label":`View diff for ${s}`,onClick:()=>ii(`edits`,e.id),children:`View diff`})}):null]})]})})}):null]})}function oo({rows:e,pending:t,partial:n,onRetry:r,onAction:i,onRebuild:a}){let o=e.filter(e=>!e.sugg).length;return t?(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,W.jsx)(`div`,{className:`panel-head panel-head-rule`,children:(0,W.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`})}),(0,W.jsx)(J,{})]}):(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,W.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,W.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`}),(0,W.jsxs)(`span`,{className:`mono dim`,children:[o,` problem`,o===1?``:`s`,`, `,e.length-o,` suggestion`,e.length-o===1?``:`s`]})]}),e.length?(0,W.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,W.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,W.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,W.jsxs)(`span`,{className:`needs-what`,children:[(0,W.jsx)(`b`,{children:e.title}),e.detail?(0,W.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,W.jsx)(`span`,{className:`mono dim needs-where`,title:e.where,children:e.where}),e.act?(0,W.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,"aria-label":`${e.verb}: ${e.title}`,onClick:()=>e.installs?a(e.installs):i(e.act),children:e.verb}):(0,W.jsx)(`a`,{className:`needs-verb`,href:e.href,"aria-label":`${e.verb}: ${e.title}`,children:e.verb})]},e.id))}):n?null:(0,W.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`}),n?(0,W.jsxs)(`p`,{className:`dim`,children:[`Some reads failed, so this list may be incomplete.`,` `,(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Retry: the failed reads`,onClick:e=>{Pa(e),r()},children:`Retry`})]}):null]})}function so({usage:e,read:t,pending:n}){let r=(0,W.jsxs)(`div`,{className:`panel-head`,children:[(0,W.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,W.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,n?(0,W.jsx)(J,{}):(0,W.jsx)(Fa,{what:`Usage`,read:t,retry:!1})]});if(!e.enabled)return(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,(0,W.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,(0,W.jsx)(`p`,{className:`muted`,children:e.since?(0,W.jsxs)(W.Fragment,{children:[`Counting since `,(0,W.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,W.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,W.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,W.jsx)(`p`,{className:`dim chart-foot`,children:`Rankings and the never-fired count appear once 30 days are counted, so a new install is not told every skill is unused.`})]});let i=e.rows.slice(0,7),a=Math.max(1,...i.map(e=>e.n));return(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,(0,W.jsx)(`ul`,{className:`ubars`,children:i.map((e,t)=>(0,W.jsxs)(`li`,{className:e.kind,children:[(0,W.jsxs)(`span`,{className:`ub-name`,title:`${e.name} ${e.kind}`,children:[e.name,` `,(0,W.jsx)(`span`,{className:`dim`,children:e.kind})]}),(0,W.jsx)(`span`,{className:`ub-trk`,children:(0,W.jsx)(`i`,{style:{width:La(e.n,a),"--i":t}})}),(0,W.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,W.jsxs)(`div`,{className:`ub-never`,children:[(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`b`,{children:ha(e).skills}),` skills never fired`]}),(0,W.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function co({count:e,canFill:t,onAction:n,view:r,dataRev:i}){let o=(0,B.useRef)(null),{data:s,reload:c}=H(()=>ja(a.update()).then(e=>(e?o.current=e:o.current?.checking&&(o.current={...o.current,checking:!1}),o.current)),[i]);(0,B.useEffect)(()=>{let e=setInterval(c,Ra),t=()=>{document.visibilityState===`visible`&&c()};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[c]);let l=!!s?.checking;return(0,B.useEffect)(()=>{if(!l)return;let e=setTimeout(c,za);return()=>clearTimeout(e)},[l,s,c]),(0,W.jsx)(ui,{title:`Overview`,sub:e===null?null:`${e} install${e===1?``:`s`} on this machine`,actions:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Va,{update:s,onAction:n,canFill:t}),r]})})}function lo({overview:e,setup:t,runs:n,onAction:r,dataRev:i,banner:o,view:s}){let c=Vn(),[l,u]=(0,B.useState)({}),d=H(()=>a.fleet(),[i]),{data:f,error:p,reload:m}=d,h=H(()=>a.usage(),[i]),g=H(()=>a.gates(),[i]),{data:_}=h,{data:v}=g,y=ci(i),b=H(()=>a.activity(),[i]),x=H(()=>a.profile(),[i]),S=H(()=>Ia(()=>a.catalog(`skills`)),[i],`catalog:skills`),C=H(()=>Ia(()=>a.catalog(`laws`)),[i],`catalog:laws`),{data:w}=y,{data:ee}=b,{data:T}=x,{data:te}=S,{data:E}=C,ne=Ma(d),D=[d,h,y,b,x,S,C],O=D.some(Ma),k=Na(d),A=f?.installs||[],j=e=>{ii(`hosts`,e.id),window.location.hash=`#/installs/hosts`},M=ni(i),N=wa({defaultLabel:M?.length>1?Ja(M[0]):null,fleet:f,usage:_,overview:e,setup:t,rules:w,activity:ee,profile:T,skills:te,laws:E}),P=A.filter(ya).map(Ca),F=async e=>{let t=e.map(e=>e.label);if(!await c(`Rebuild ${t.join(`, `)}? Each is re-rendered from source with its own settings.`,{title:e.length===1?`Rebuild ${t[0]}?`:`Rebuild ${e.length} installs?`,confirmLabel:`Rebuild`}))return;let n=await r(`rebuild`,{installs:e.map(({host:e,path:t})=>({host:e,path:t}))});n&&u(t=>({...t,[n]:e.map(e=>e.id)}))},re=new Set(Object.entries(l).filter(([e])=>n?.find(t=>t.id===e)?.status===`running`).flatMap(([,e])=>e));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(co,{count:f?A.length:null,canFill:!P.length,onAction:r,view:s,dataRev:i}),o,(0,W.jsxs)(`div`,{className:`ov-stack ldg`,children:[(0,W.jsx)(Wa,{fleet:f,error:p,behind:P,onAction:r,onRebuild:F}),(0,W.jsxs)(`div`,{className:`ldg-kpis`,role:`group`,"aria-labelledby":`ldg-kpis-h`,children:[(0,W.jsx)(`h2`,{id:`ldg-kpis-h`,className:`sr-only`,children:`Key figures`}),(0,W.jsx)(Qa,{installs:A,pending:ne,failed:k}),(0,W.jsx)($a,{installs:A,pending:ne,failed:k}),(0,W.jsx)(eo,{usage:_,read:h,pending:Ma(h)}),(0,W.jsx)(to,{gates:v,laws:E,read:g,pending:Ma(g)})]}),(0,W.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,W.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,W.jsx)(`h2`,{id:`ldg-fleet`,children:`Installs`}),f?.source_fp?(0,W.jsxs)(`span`,{className:`mono dim`,children:[`source `,f.source_fp]}):null]}),p&&f?(0,W.jsxs)(`p`,{className:`dim`,role:`status`,children:[`Could not refresh the installs — showing the last read.`,` `,(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]}):null,(0,W.jsx)(`div`,{className:`ldg-scroll`,children:(0,W.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,W.jsx)(`caption`,{className:`sr-only`,children:`Installs`}),(0,W.jsx)(`thead`,{children:(0,W.jsxs)(`tr`,{children:[(0,W.jsx)(`th`,{scope:`col`,children:`Install`}),(0,W.jsx)(`th`,{scope:`col`,className:`ldg-build`,children:`Build`}),(0,W.jsx)(`th`,{scope:`col`,className:`ldg-sync`,children:`Sync with source`}),(0,W.jsx)(`th`,{scope:`col`,className:`ldg-root`,children:`Root file · ceiling`}),(0,W.jsx)(`th`,{scope:`col`,className:`ldg-total`,children:`Always-on`}),(0,W.jsx)(`th`,{scope:`col`,children:(0,W.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,W.jsxs)(`tbody`,{children:[p&&!f?(0,W.jsx)(`tr`,{children:(0,W.jsxs)(`td`,{colSpan:no,children:[(0,W.jsx)(`span`,{className:`dim`,role:`status`,children:`Could not read the installs`}),` `,(0,W.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]})}):null,ne?(0,W.jsx)(`tr`,{children:(0,W.jsx)(`td`,{colSpan:no,children:(0,W.jsx)(J,{})})}):null,A.map((e,t)=>(0,W.jsx)(ao,{i:e,n:t,onRebuild:F,onOpen:j,busy:re.has(e.id)},e.id))]})]})})]}),(0,W.jsxs)(`div`,{className:`ldg-bottom`,children:[(0,W.jsx)(oo,{rows:N,pending:O,partial:D.some(Na),onRetry:()=>D.filter(Na).forEach(e=>e.reload()),onAction:r,onRebuild:F}),(0,W.jsx)(so,{usage:_,read:h,pending:Ma(h)})]})]})]})}var uo=`geneseed-understand-seen`,fo=`understand`;function po(){try{let e=JSON.parse(localStorage.getItem(uo));return Array.isArray(e)?e:[]}catch{return[]}}var mo=`modulepreload`,ho=function(e){return`/`+e},go={},_o=function(e){return e.pathname.endsWith(`.css`)},vo=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=ho(t,n);let r=s(t),i=_o(r);return vo(go,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:mo,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},yo=`geneseed-newhere-dismissed`,bo=(0,B.lazy)(()=>$(()=>import(`./Dashboard-CRGCp2cV.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6])));function xo({harness:e}){let[t,n]=(0,B.useState)(()=>!!localStorage.getItem(yo)),{data:r}=H(()=>t?Promise.resolve(null):a.docs(e).catch(()=>null),[t,e]),{level:i}=q(),o=r?.groups?.find(e=>e.id===`understand`)?.pages||[],s=po(),c=o.findIndex(e=>!s.includes(e.id));if(t||!o.length||c<0)return null;let l=o.filter(e=>s.includes(e.id)).length;return(0,W.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,W.jsxs)(`div`,{className:`newhere-body`,children:[(0,W.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,W.jsxs)(`p`,{children:[o.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),i===`power`?null:(0,W.jsxs)(`p`,{className:`newhere-level`,children:[`Showing the `,K.find(e=>e.id===i)?.label,` view — more in Appearance.`]}),l?(0,W.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${l} of ${o.length} read`,children:o.map(e=>(0,W.jsx)(`i`,{className:s.includes(e.id)?`f`:``},e.id))}):null]}),(0,W.jsx)(`a`,{className:`btn ghost`,href:`#/docs/${encodeURIComponent(o[c].id)}`,children:l?`Continue · step ${c+1}`:`Start`}),(0,W.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(yo,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function So({layout:e,onLayout:t}){return(0,W.jsx)(Zn,{"aria-label":`View`,children:ht.map(n=>(0,W.jsx)(`button`,{type:`button`,className:e===n.id?`on`:``,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id))})}function Co({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:o,onAction:s,layout:c=`overview`,onLayout:l,dataRev:u}){let{data:d,loading:f}=H(()=>Promise.resolve().then(()=>a.installs()).catch(()=>null),[u],`installs`);if(!e)return t?(0,W.jsx)(Vr,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,W.jsx)(J,{});if(!(d?d.installs?.some(e=>e.state===`active`):e.deployed))return f&&!d?(0,W.jsx)(J,{}):(0,W.jsx)(ei,{onAction:s});let p=(0,W.jsx)(xo,{harness:Fn(e.emit)}),m=l?(0,W.jsx)(So,{layout:c,onLayout:l}):null;return c===`overview`?(0,W.jsx)(lo,{overview:e,setup:i,runs:o,onAction:s,onRetry:n,dataRev:u,view:m,banner:(0,W.jsxs)(W.Fragment,{children:[e.daemon_stale?(0,W.jsx)(Hr,{}):null,p]})}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(co,{count:d?d.installs.filter(e=>e.state!==`absent`).length:null,canFill:!1,onAction:s,view:m,dataRev:u}),p,(0,W.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,W.jsx)(`p`,{className:`sub`,children:[e.install&&Dn(e.install),e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target,`counts cover every install`].filter(Boolean).join(` · `)}),(0,W.jsxs)(`div`,{className:`row gap-10`,children:[(0,W.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>s(`doctor`),children:`Run doctor`}),(0,W.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(`build-all`),children:`Rebuild`})]})]}),(0,W.jsx)(B.Suspense,{fallback:(0,W.jsx)(J,{}),children:(0,W.jsx)(bo,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:o,onAction:s,layout:c,dataRev:u})})]})}var wo=(0,B.lazy)(()=>$(()=>import(`./Activity-IAxWF2wK.js`),__vite__mapDeps([7,1,2,3,8,9,5]))),To=(0,B.lazy)(()=>$(()=>import(`./ActivityDetail-CtC2DLvh.js`),__vite__mapDeps([10,1,2,3,9,8]))),Eo=(0,B.lazy)(()=>$(()=>import(`./Library-DdzyrwUK.js`),__vite__mapDeps([11,1,2,3,6,4,12,13,8,5]))),Do=(0,B.lazy)(()=>$(()=>import(`./Models-DAgkQ4CE.js`),__vite__mapDeps([14,1,2,3]))),Oo=(0,B.lazy)(()=>$(()=>import(`./Kits-DYQvykZ0.js`),__vite__mapDeps([15,1,2,3,8,16,17,18]))),ko=(0,B.lazy)(()=>$(()=>import(`./Loops-yHga7xdr.js`),__vite__mapDeps([19,1,2,3,8,20,21,17,16,12,13,5,6,4]))),Ao=(0,B.lazy)(()=>$(()=>import(`./Factories-DxHD2T-1.js`),__vite__mapDeps([22,1,2,3,8,20,17,21,12,13,6,4]))),jo=(0,B.lazy)(()=>$(()=>import(`./Laws-UVk0uojS.js`),__vite__mapDeps([23,1,2,3,6,4,8,13,16]))),Mo=(0,B.lazy)(()=>$(()=>import(`./Personal-DjhIfa9v.js`),__vite__mapDeps([24,1,2,3,25,6,4,8,16,11,12,13,5]))),No=(0,B.lazy)(()=>$(()=>import(`./Installs-B5hFSUeN.js`),__vite__mapDeps([26,1,2,25,6,4,3,8,18]))),Po=(0,B.lazy)(()=>$(()=>import(`./Settings-Brgec4M0.js`),__vite__mapDeps([27,1,2,3,5]))),Fo=(0,B.lazy)(()=>$(()=>import(`./Docs-DwOwzaD6.js`),__vite__mapDeps([28,1,2,3,8,12,13,6,4,20,16,5])));function Io(){let e=I(),[t,n]=(0,B.useState)(null),[r,i]=Ge(),[o,s]=Xe(),[c,l]=pt(),u=e=>{if(e===o)return;let t=()=>{s(e),l(`curated`)};if(!document.startViewTransition||!w())return t();document.startViewTransition(()=>(0,ge.flushSync)(t))},[d,f]=yt(),[p,m]=(0,B.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[h,g]=(0,B.useState)(!1),_=(0,B.useRef)(null),v=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!h)return;let e=e=>{e.key===`Escape`&&g(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]),(0,B.useEffect)(()=>{if(!h)return;let e=v.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[h]);let y=e=>n({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),[b,x]=(0,B.useState)(0),{overview:S,error:C,themes:ee,reload:T}=xt(y,()=>x(e=>e+1)),te=()=>{T(),x(e=>e+1)},[E,ne]=(0,B.useState)(null),{runs:D,activeId:O,consoleOpen:k,setConsoleOpen:A,runAction:j,cancelJob:M,clearRuns:N}=Ct({onFinish:e=>{te(),ne({status:e,at:Date.now()})},onError:y}),{data:P}=H(()=>a.setup().catch(()=>null),[b],`setup`),{data:F,loading:re}=H(()=>a.installs().catch(()=>null),[b],`installs`),ie=F?.installs||null,L=D[D.length-1],ae=L?L.status===`running`?`${L.action} running`:`${L.action} ${L.status}`:``;(0,B.useEffect)(()=>{let e=_.current;if(e){if(!Ue(e,lt(c),r)){let t=dt(c);t?Se(e,t,r):we(e,o,r)}document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,getComputedStyle(e).getPropertyValue(`--bg`).trim())}},[r,c,o]);let oe=[{title:`Rebuild all`,desc:`Re-emit every install`,run:()=>j(`build-all`),confirm:{msg:`Rebuild every install from the current sources?`,title:`Rebuild all?`,confirmLabel:`Rebuild all`}},{title:`Update`,desc:`Pull the latest Geneseed; the server restarts after`,run:()=>j(`update`),confirm:{msg:`Update Geneseed? The server restarts when the update ends.`,title:`Update Geneseed?`,confirmLabel:`Update`}},{title:`Run doctor`,desc:`Read-only health check`,run:()=>j(`doctor`)},{title:`Restart server`,desc:`Restart the local Geneseed server`,run:()=>rt().catch(y),confirm:{msg:`Restart the local Geneseed server? The console reconnects in a moment.`,title:`Restart the server?`,confirmLabel:`Restart`}},{title:r===`light`?`Switch to dark mode`:`Switch to light mode`,desc:`Appearance`,run:i},...qe.filter(e=>e.id!==o).map(e=>({title:`Skin: ${e.name}`,desc:e.tagline,run:()=>u(e.id)}))].map(e=>({kind:`Actions`,hay:`${e.title} ${e.desc}`.toLowerCase(),...e})),se={flavour:o,onFlavour:u,accentMode:c,onAccentMode:l};return(0,W.jsx)(`div`,{className:`app fl-${o} ${r===`light`?`light`:``}${h?` nav-open`:``}`,ref:_,children:(0,W.jsxs)(Hn,{children:[(0,W.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,W.jsx)(`a`,{className:`skip-link`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:`Skip to content`}),(0,W.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:ae}),h&&(0,W.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>g(!1)}),(0,W.jsx)(yn,{route:e,overview:S,installs:ie,onNavigate:()=>g(!1)}),(0,W.jsxs)(`div`,{className:`col`,ref:v,children:[(0,W.jsx)(tr,{route:e,navOpen:h,onToggleNav:()=>g(e=>!e),actions:oe,mode:r,onToggleMode:i,appearance:se,dataRev:b}),(0,W.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,W.jsxs)(`div`,{className:[`library`,`kits`,`loops`,`factories`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:[(0,W.jsx)(rr,{unreadable:!re&&!F}),(0,W.jsxs)(Zr,{activeId:O,finish:E,children:[(0,W.jsx)(Kr,{route:e}),(0,W.jsx)(Gr,{children:(0,W.jsx)(B.Suspense,{fallback:(0,W.jsx)(J,{}),children:{overview:()=>(0,W.jsx)(Co,{overview:S,overviewError:C,onRetry:T,themes:ee,setup:P,runs:D,onAction:j,layout:d,onLayout:f,dataRev:b}),laws:()=>(0,W.jsx)(jo,{selected:e.item,overview:S,setup:P,onAction:j,dataRev:b}),library:()=>(0,W.jsx)(Eo,{overview:S,section:e.section,selected:e.item,dataRev:b,onCountsChanged:T}),models:()=>(0,W.jsx)(Do,{dataRev:b,onAction:j}),kits:()=>(0,W.jsx)(Oo,{item:e.item,onAction:j,dataRev:b}),loops:()=>(0,W.jsx)(ko,{tab:e.tab,item:e.item,dataRev:b}),factories:()=>(0,W.jsx)(Ao,{tab:e.tab,item:e.item,dataRev:b}),personal:()=>(0,W.jsx)(Mo,{tab:e.tab,item:e.item,setup:P,dataRev:b,onAction:j,onCountsChanged:T}),installs:()=>(0,W.jsx)(No,{tab:e.tab,item:e.item,overview:S,setup:P,themes:ee,onAction:j,onMutated:te,dataRev:b}),settings:()=>(0,W.jsx)(Po,{overview:S,onAction:j}),activity:()=>e.item?(0,W.jsx)(To,{sid:e.item},e.item):(0,W.jsx)(wo,{}),docs:()=>(0,W.jsx)(Fo,{page:e.item,onAction:j,overview:S})}[e.page]?.()})},e.page)]})]})}),(0,W.jsx)(xn,{route:e,navOpen:h,onMore:()=>g(!0)}),(0,W.jsx)(jr,{runs:D,open:k,busy:!!O,finish:E,onToggle:()=>A(e=>!e),onClear:N,onCancel:M})]}),(0,W.jsx)(ar,{toast:t,onClose:()=>n(null)}),p&&(0,W.jsx)(Br,{ready:!!S||!!C,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}m(!1)}})]})})}(0,_e.createRoot)(document.getElementById(`root`)).render((0,W.jsx)(Zt,{children:(0,W.jsx)(Io,{})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{Hr as $,zi as A,H as At,pi as B,Gi as C,G as Ct,Di as D,Nt as Dt,Vi as E,Pt as Et,Hi as F,ii as G,ui as H,gi as I,oi as J,ai as K,bi as L,ji as M,he as Mt,Li as N,fe as Nt,Ci as O,jt as Ot,Fi as P,le as Pt,Qr as Q,_i as R,qi as S,q as St,Ai as T,Ft as Tt,li as U,di as V,ci as W,ei as X,ni as Y,Jr as Z,Qi as _,wn as _t,ga as a,Xn as at,Wi as b,$t as bt,na as c,Fn as ct,ea as d,On as dt,Vr as et,oa as f,kn as ft,Zi as g,jn as gt,ca as h,Dn as ht,po as i,Zn as it,ki as j,rt as jt,wi as k,Rt as kt,ia as l,Pn as lt,ta as m,En as mt,uo as n,nr as nt,Ta as o,Vn as ot,sa as p,Cn as pt,si as q,fo as r,$n as rt,ra as s,Nn as st,$ as t,J as tt,aa as u,Sn as ut,Ji as v,an as vt,xi as w,It as wt,Ki as x,en as xt,Ui as y,nn as yt,mi as z};
|