geneseed 4.23.1 → 4.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/SHIPPED.md +1 -1
  3. package/adapters/opencode/plugins/geneseed-context.js +1 -1
  4. package/docs/concepts/footprint.md +2 -2
  5. package/docs/concepts/foreman-mode.md +20 -12
  6. package/docs/guides/choose-your-setup.md +2 -2
  7. package/docs/guides/setup-footprint.md +1 -1
  8. package/docs/reference/glossary.md +1 -1
  9. package/docs/web-ui.md +5 -4
  10. package/harness.config.json +1 -1
  11. package/js/hosts/hooks-context.mjs +1 -1
  12. package/js/maintain/memory.mjs +1 -0
  13. package/js/maintain/setup.mjs +1 -1
  14. package/js/web/actions.mjs +27 -1
  15. package/js/web/catalog.mjs +10 -2
  16. package/js/web/daemon.mjs +27 -8
  17. package/js/web/handler.mjs +29 -9
  18. package/js/web/update-check.mjs +6 -4
  19. package/js/web/user-files.mjs +34 -11
  20. package/package.json +1 -1
  21. package/src/AGENT.md.tmpl +1 -1
  22. package/src/modes/README.md +1 -1
  23. package/src/modes/foreman.md +45 -26
  24. package/src/skills/pipeline.md +2 -2
  25. package/src/skills/rule.md +2 -1
  26. package/web/dist/assets/Activity-DvmB7N8g.js +1 -0
  27. package/web/dist/assets/{ActivityDetail-Bf5sBm8_.js → ActivityDetail-Bd1ul_B-.js} +1 -1
  28. package/web/dist/assets/CopyButton-BnPdDHls.js +1 -0
  29. package/web/dist/assets/Dashboard-DtJ0xrcA.js +2 -0
  30. package/web/dist/assets/Docs-Bt9FAScn.js +5 -0
  31. package/web/dist/assets/GreenhouseView-BBCsUAcJ.js +1 -0
  32. package/web/dist/assets/Installs-BHxWO-Ev.js +3 -0
  33. package/web/dist/assets/{JournalView-DKqMrN35.js → JournalView-CLf3j4Ar.js} +1 -1
  34. package/web/dist/assets/{KitApply-DCBS0ZWz.js → KitApply-BaDKgnO8.js} +1 -1
  35. package/web/dist/assets/Kits-DmqZkK4K.js +1 -0
  36. package/web/dist/assets/Laws-BcUWCQvl.js +3 -0
  37. package/web/dist/assets/Library-CuRHfeqT.js +2 -0
  38. package/web/dist/assets/Loops-D7VflI8x.js +2 -0
  39. package/web/dist/assets/OperatorHudView-BxKeM_Lk.js +1 -0
  40. package/web/dist/assets/{Personal-d5Ssk-SW.js → Personal-Bpl90lqc.js} +1 -1
  41. package/web/dist/assets/RailCats-BuJD4Jou.js +1 -0
  42. package/web/dist/assets/{Tabs-DQLuylEi.js → Tabs-kIqas9Tj.js} +1 -1
  43. package/web/dist/assets/index-IuDNqPEl.css +1 -0
  44. package/web/dist/assets/index-UNxZecs3.js +3 -0
  45. package/web/dist/index.html +2 -2
  46. package/web/dist/sw.js +10 -2
  47. package/web/dist/assets/Activity-D0GfEonq.js +0 -1
  48. package/web/dist/assets/Dashboard-gYZLE4r3.js +0 -2
  49. package/web/dist/assets/Docs-CQifoJkX.js +0 -4
  50. package/web/dist/assets/GreenhouseView-R6epl1PY.js +0 -1
  51. package/web/dist/assets/Installs-DBH3NEOC.js +0 -3
  52. package/web/dist/assets/Kits-BpUFbYHr.js +0 -1
  53. package/web/dist/assets/Laws-Qnzc5Lp7.js +0 -3
  54. package/web/dist/assets/Library-CWjWbVwS.js +0 -2
  55. package/web/dist/assets/Loops-BRuz2YFL.js +0 -2
  56. package/web/dist/assets/OperatorHudView-NW_xAOj1.js +0 -1
  57. package/web/dist/assets/RailCats-BtIstKaH.js +0 -1
  58. package/web/dist/assets/index-BX3zc2Yi.css +0 -1
  59. package/web/dist/assets/index-DMDF5Y3Y.js +0 -3
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DtJ0xrcA.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/api-BfpZmUMI.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/Activity-DvmB7N8g.js","assets/EmptyState-1sPNleqv.js","assets/usePoll-bDFN-Hr6.js","assets/ActivityDetail-Bd1ul_B-.js","assets/Library-CuRHfeqT.js","assets/RailCats-BuJD4Jou.js","assets/FilterInput-CZREvrjX.js","assets/Markdown-DpmmtW2Y.js","assets/Kits-DmqZkK4K.js","assets/KitApply-BaDKgnO8.js","assets/DataTable-BWbUx4bY.js","assets/Loops-D7VflI8x.js","assets/CopyButton-BnPdDHls.js","assets/Laws-BcUWCQvl.js","assets/Personal-Bpl90lqc.js","assets/Tabs-kIqas9Tj.js","assets/Installs-BHxWO-Ev.js","assets/Docs-Bt9FAScn.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r,t as i}from"./react-DlYQp10C.js";import{t as a}from"./api-BfpZmUMI.js";import{A as o,C as s,D as c,E as l,F as u,G as d,H as f,I as p,L as m,O as h,P as g,T as _,U as v,_ as y,b,d as x,f as S,i as C,j as w,l as T,n as E,o as D,r as O,s as k,t as A,u as j,v as M,z as N}from"./motion-CXaUMNkg.js";import{i as P,n as F,r as I}from"./sections-ChwaobfW.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 ee=(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}},te=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),w(t))return n;if(h(+t))return+t;let r=t,i=e?e.labels:null,a=!c(i),o=ee(e,r),s=!w(o),l=v.exec(r);if(l){let e=l[0],t=r.split(e),c=a&&t[0]?i[t[0]]:n,u=s?o:a?c:n,d=+t[1];return M(u,d,e[0])}return s?o:a?w(i[r])?n:i[r]:n},L=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},ne=0,re=(e,t=0,n=1,r=0)=>{let i=e===void 0?ne++: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}},ie=(e,t=L)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},ae=(e,t={})=>{let n=[],r=0,i,a=null,c=t.from,f=t.reversed,m=t.ease,v=!w(m),x=v&&!w(m.ease)?m.ease:v?j(m):null,C=t.grid,T=C===!0,E=t.axis,D=t.total,O=w(c)||c===0||c===`first`,k=c===`center`,A=c===`last`,M=c===`random`,N=_(c),P=_(e),F=t.use,I=g(P?e[0]:e),ee=P?g(e[1]):0,ne=d.exec((P?e[1]:e)+``),ae=t.start||0+(P?I:0),R=t.seed,oe=!w(R)&&R!==!1?re(R===!0?0:R):L,z=t.jitter,se=!w(z),ce=_(z),B=ce?z[0]:z||0,V=ce?z[1]:z||0,H=O?0:h(c)?c:0;return(e,d,m,g,_)=>{let[v]=S(e),O=w(D)?m.length:D,j=w(F)?!1:l(F)?F(v,d,O):y(v,F),L=h(j)||o(j)&&h(+j)?+j:d,re=L>=0&&L<O?L:d;if(k&&(H=(O-1)/2),A&&(H=O-1),!n.length){if(T){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,o=-1/0,s=-1/0,u=-1/0,d=[],f=[],g=[];for(let n=0;n<O;n++){let c=m[n],p=0,_=0,v=0,y=!1;if(c&&l(c.getBoundingClientRect)){let e=c.getBoundingClientRect();p=e.left+e.width/2,_=e.top+e.height/2,y=!0}else{let e=c;e&&h(e.x)&&h(e.y)&&(p=e.x,_=e.y,h(e.z)&&(v=e.z,t=!0),y=!0)}if(!y){e=!1;break}d.push(p),f.push(_),g.push(v),p<r&&(r=p),_<i&&(i=_),v<a&&(a=v),p>o&&(o=p),_>s&&(s=_),v>u&&(u=v)}if(e){let e=d[0],l=f[0],m=g[0];N?(e=r+c[0]*(o-r),l=i+c[1]*(s-i),m=t?a+(c.length>=3?c[2]:.5)*(u-a):0):k?(e=(r+o)/2,l=(i+s)/2,m=(a+u)/2):A?(e=d[O-1],l=f[O-1],m=g[O-1]):h(c)&&(e=d[c],l=f[c],m=g[c]);for(let r=0;r<O;r++){let i=e-d[r],a=l-f[r],o=m-g[r],s=p(i*i+a*a+(t?o*o:0));E===`x`&&(s=-i),E===`y`&&(s=-a),E===`z`&&(s=-o),n.push(s)}let _=1/0;for(let e=0;e<O;e++){let t=b(n[e]);t>0&&t<_&&(_=t)}if(_>0&&_<1/0)for(let e=0;e<O;e++)n[e]=n[e]/_}else for(let e=0;e<O;e++)n.push(b(H-e))}else for(let e=0;e<O;e++)if(!C)n.push(b(H-e));else{let t=C.length,r=C[0]*C[1],i,a,o;N?(i=c[0]*(C[0]-1),a=c[1]*(C[1]-1),o=t===3?(c.length>=3?c[2]:.5)*(C[2]-1):0):k?(i=(C[0]-1)/2,a=(C[1]-1)/2,o=t===3?(C[2]-1)/2:0):(i=H%C[0],a=s(H/C[0])%C[1],o=t===3?s(H/r):0);let l=e%C[0],u=s(e/C[0])%C[1],d=t===3?s(e/r):0,f=i-l,m=a-u,h=o-d,g=p(f*f+m*m+(t===3?h*h:0));E===`x`&&(g=-f),E===`y`&&(g=-m),E===`z`&&(g=-h),n.push(g)}r=n[0];for(let e=1;e<O;e++)n[e]>r&&(r=n[e]);if(x||f)for(let e=0;e<O;e++){let t=n[e];x&&(t=x(t/r)*r),f&&(t=E?-t:b(r-t)),n[e]=t}if(se){a=Array(O);for(let e=0;e<O;e++)a[e]=oe(-1,1,4)}M&&(n=ie(n,oe))}let R=P?(ee-I)/r:I;w(i)&&(i=_?te(_,w(t.start)?_.iterationDuration:ae):ae);let z=i+(R*u(n[re],2)||0);if(se){let e=r?n[re]/r:0,t=B+(V-B)*e;z+=a[re]*t}return t.modifier&&(z=t.modifier(z)),ne&&(z=`${z}${ne[2]}`),z}},R=e=>{let t=1;if(e&&e.getCTM){let n=e.getCTM();n&&(t=(p(n.a*n.a+n.b*n.b)+p(n.c*n.c+n.d*n.d))/2)}return t},oe=(e,t,n)=>{let r=N,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===f?e:t===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),i=+n[0],c=+n[1],l=R(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)}:l(n)?(...t)=>Reflect.apply(n,e,t):n}});return e.getAttribute(`pathLength`)!==`${r}`&&(e.setAttribute(`pathLength`,`${r}`),c.setAttribute(`draw`,`${t} ${n}`)),c},z=(e,t=0,n=0)=>x(e).map(e=>oe(e,t,n)),se=r(),ce=n(),B=e(t(),1),V={overview:`Overview`,laws:`Constitution`,library:`Library`,kits:`Kits`,loops:`Loops`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},H={loops:[`templates`,`bricks`,`active`],personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`kits`,`edits`,`doctor`,`server`]},le={templates:`Templates`,bricks:`Bricks`,active:`Active`,rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,kits:`Kits`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},ue={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},de=(e,t)=>t!==void 0&&Object.hasOwn(e,t),fe=(e,t)=>H[e].includes(t)?t:H[e][0];function pe(e){let t=(e||`#/`).slice(2).split(`/`).filter(Boolean),[n,r,i]=t,a=e=>{try{return decodeURIComponent(e||``)}catch{return e||``}};if(n===`section`||n===`item`){let e=n===`item`&&de(P,r)?P[r]:r,t=n===`item`?a(i):void 0;return{page:e===`laws`?`laws`:`library`,section:e,item:t}}if(n===`docs`)return{page:`docs`,item:a(t.slice(1).join(`/`))};if(n===`kits`)return r?{page:`kits`,item:a(r)}:{page:`kits`};if(n===`activity`&&r)return{page:`activity`,item:a(r)};if(n===`skills`||n===`agents`)return{page:`library`,section:n};if(de(H,n)){let e=fe(n,r);return i&&e===r?{page:n,tab:e,item:a(i)}:{page:n,tab:e}}if(de(ue,n)){let[e,t]=ue[n];return t?{page:e,tab:t}:{page:e}}return{page:de(V,n)?n:`overview`}}var me=new Set;function he(e){return me.add(e),()=>me.delete(e)}function ge(){let e=()=>pe(typeof window<`u`?window.location.hash:``),[t,n]=(0,B.useState)(e);(0,B.useEffect)(()=>{let t=window.location.hash,r=()=>{let r=window.location.hash;if(r!==t){for(let e of me)if(e({from:t,to:r})===!1){window.history.replaceState(window.history.state,``,t||`#/`);return}t=r,n(e())}};return window.addEventListener(`hashchange`,r),()=>window.removeEventListener(`hashchange`,r)},[]);let r=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{if(document.title=`${V[t.page]} · Geneseed`,!r.current){r.current=!0;return}let e=document.getElementById(`main`);e?.focus();for(let t of[e,document.scrollingElement||document.documentElement])t&&(t.scrollTop=0)},[t.page]),t}var _e=e=>{window.location.hash=e},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)}function We(e,t){let[n,r]=(0,B.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return[n,(0,B.useCallback)(t=>r(n=>{let r=typeof t==`function`?t(n):t;try{localStorage.setItem(e,r)}catch{}return r}),[e])]}var Ge=`geneseed-mode`;function Ke(){let[e,t]=We(Ge,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var qe=`geneseed-flavour`,Je=[{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.`}],Ye=new Set(Je.map(e=>e.id)),Xe={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 Ze(){return We(qe,Qe)}function Qe(e){return Ye.has(e)?e:Xe[e]||`cultivar`}var $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)}window.location.reload()}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 theme'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 We(it,ut)}var mt=`geneseed-layout`,ht=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],gt=new Set(ht.map(e=>e.id));function _t(e){return e&&gt.has(e)?e:`overview`}function vt(){return We(mt,_t)}function yt(e){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(null),[o,s]=(0,B.useState)([]),c=()=>a.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,B.useEffect)(()=>{c()},[]),(0,B.useEffect)(()=>{a.themes().then(e=>s(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:o,reload:c}}var bt=600;function xt({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)}},bt);return()=>clearInterval(l)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n)=>{try{let{job_id:t,restarts:i}=await a.action(e,n),s=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:s,status:`running`,output:``,started:Date.now()/1e3,restarts:!!i}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>a.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var U=new Map,St=new Map;function Ct(e){for(let t of U.keys())t.startsWith(`${e}|`)&&U.delete(t)}function W(e,t=[],n=null,{revalidate:r=!1}={}){let i=n===null?null:`${n}|${t.join(``)}`,[a,o]=(0,B.useState)(()=>i!==null&&U.has(i)?U.get(i):null),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(()=>!(i!==null&&U.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)(()=>{let e=++p.current,t=()=>e===p.current;u(!0),c(``);let n=f.current;return Promise.resolve(d.current()).then(e=>{if(t()&&(o(e),n!==null)){U.set(n,e);for(let t of St.get(n)||[])t(e)}}).catch(e=>{t()&&c(e.message)}).finally(()=>{t()&&u(!1)})},t);return(0,B.useEffect)(()=>{let e=f.current;return e!==null&&(St.has(e)||St.set(e,new Set),St.get(e).add(o)),e!==null&&U.has(e)&&(p.current++,o(U.get(e)),c(``),u(!1),!r)||m(),()=>St.get(e)?.delete(o)},[m]),{data:a,error:s,loading:l,reload:m,setData:o}}var wt=60,Tt=3600,Et=86400,Dt={seconds:90,minutes:5400,hours:36*Tt};function Ot(e){let t=Math.max(0,Date.now()/1e3-e);return t<Dt.seconds?`${Math.round(t)}s`:t<Dt.minutes?`${Math.round(t/wt)}m`:t<Dt.hours?`${Math.round(t/Tt)}h`:`${Math.round(t/Et)}d`}function kt(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var G={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15},At={warn:G.deployed+G.doctorClean,bad:G.deployed};function jt(e,t,n){if(!e)return 0;let r=e.doctor?.problems?.length??99,i=e.doctor?.ok?G.doctorClean:r<=G.doctorMinorMax?G.doctorMinor:G.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp,o=(e.deployed?G.deployed:0)+i+(a?G.versionSynced:0)+(e.diff&&e.diff.missing===0?G.diskClean:0);return Math.min(o,At[n]??1)}var Mt=e=>Math.max(...I.map(t=>e?.[t]??0),1),Nt=e=>(e?.edited??0)+(e?.added??0),K=e=>Nt(e)+(e?.missing??0),Pt=e=>(e?.laws??0)+(e?.doctrines?.rules??0),q=i(),Ft={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`,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 J({name:e,className:t=`glyph`,style:n}){return(0,q.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,q.jsx)(`path`,{d:Ft[e]||``})})}function It({className:e=`sprout`}){return(0,q.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,q.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,q.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,q.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,q.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var Lt=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/kits`,page:`kits`,label:`Kits`,icon:`kit`},{hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,count:e=>e?.counts?.loops??null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],Rt=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function zt({n:e,lit:t,count:n,onNavigate:r}){return(0,q.jsx)(`li`,{children:(0,q.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,q.jsx)(J,{name:e.icon}),(0,q.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,q.jsx)(`span`,{className:`sb-count`,children:n})]})})}function Bt({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=K(e.diff);return(0,q.jsxs)(`section`,{className:`sb-vitals`,"aria-label":`Install vitals`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{children:`doctor`}),(0,q.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{children:`drift`}),(0,q.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`span`,{children:`built`}),(0,q.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${Ot(e.build_epoch)} ago`:`never`})]}),(0,q.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,"aria-haspopup":`dialog`,children:[(0,q.jsxs)(`span`,{className:`sb-voice-name`,children:[(0,q.jsx)(`i`,{className:`sb-voice-swatch`,"aria-hidden":`true`}),`Voice · `,e.theme||`none`]}),(0,q.jsx)(J,{name:`chevron`})]})]})}function Vt({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,q.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,q.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{_e(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,q.jsx)(`span`,{className:`sb-mark`,children:(0,q.jsx)(It,{})}),(0,q.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,q.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,q.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),(0,q.jsx)(`ul`,{className:`sb-list`,children:[...Lt,...Rt].map(r=>(0,q.jsx)(zt,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page))}),(0,q.jsx)(`div`,{className:`sb-spacer`}),t?(0,q.jsx)(`button`,{type:`button`,className:`sb-voice-rail`,"aria-label":`Switch voice, now ${t.theme||`none`}`,title:`Switch voice`,onClick:r,children:(0,q.jsx)(J,{name:`spark`})}):null,(0,q.jsx)(Bt,{overview:t,onOpenVoice:r})]})}var Ht=[`overview`,`laws`,`library`,`installs`];function Ut({route:e,navOpen:t,onMore:n}){return(0,q.jsxs)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:[Lt.filter(e=>Ht.includes(e.page)).map(t=>(0,q.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,q.jsx)(J,{name:t.icon}),t.label]},t.page)),(0,q.jsxs)(`button`,{type:`button`,className:`tab-more${Ht.includes(e.page)?``:` on`}`,"aria-controls":`rail-nav`,"aria-expanded":!!t,onClick:n,children:[(0,q.jsx)(J,{name:`menu`}),`More`]})]})}var Wt=[{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`}],Gt=e=>Wt.find(t=>t.id===e)||Wt[0],Kt=(e,t)=>t===`project`?Gt(e).removeProject:Gt(e).removeGlobal,qt=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,Jt=e=>e.scope===`global`?Gt(e.host).label:qt(e.path),Yt=`geneseed-harness`,Xt=Wt.map(({id:e,label:t})=>({id:e,label:t}));function Zt(e=`opencode`){let[t,n]=We(Yt,e=>Xt.some(t=>t.id===e)?e:null);return[t??e,n]}function Qt(e){let t=String(e||``);return Wt.find(e=>t.startsWith(e.id))?.id||`opencode`}var $t=Object.entries(V).flatMap(([e,t])=>(H[e]||[``]).map(n=>{let r=n?t+` / `+le[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}}));function en(e=0){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),o=(0,B.useRef)(null),[s]=Zt(),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`,...I],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=F[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 tn({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,q.jsxs)(`dialog`,{ref:s,className:`confirm`,"aria-labelledby":`${u}-title`,"aria-describedby":`${u}-body`,onCancel:o,onClose:o,children:[(0,q.jsx)(`h3`,{className:`confirm-title`,id:`${u}-title`,children:t}),(0,q.jsx)(`div`,{className:`confirm-body`,id:`${u}-body`,children:n}),(0,q.jsxs)(`div`,{className:`confirm-actions`,children:[(0,q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,ref:c,children:`Cancel`}),(0,q.jsx)(`button`,{type:`button`,className:d?`btn danger`:`btn`,onClick:a,ref:l,children:r||`Confirm`})]})]})}var nn=(0,B.createContext)(null),rn=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function an(){return(0,B.useContext)(nn)||rn}function on({children:e}){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,B.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,q.jsxs)(nn.Provider,{value:a,children:[e,(0,q.jsx)(tn,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,tone:t?.tone,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}var sn=24;function cn(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function ln(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=cn(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,sn);return i.filter(e=>e.sortKey<0).concat(a)}function un(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,q.jsxs)(q.Fragment,{children:[e.slice(0,r),(0,q.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function dn({query:e,index:t,loading:n,error:r,active:i,onActive:a,onPick:o}){let s=(0,B.useMemo)(()=>ln(t,e),[t,e]),c=(0,B.useRef)(null),l=s.length>0;(0,B.useLayoutEffect)(()=>{let e=c.current?.querySelectorAll(`[data-spot-row]`);if(!l||!e?.length||!E())return;let t=T(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:ae(18),ease:`outQuart`});return O(t,220+18*e.length)},[l]),(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 u=[],d=null;s.forEach((e,t)=>{(!d||d.kind!==e.kind)&&(d={kind:e.kind,rows:[]},u.push(d)),d.rows.push({entry:e,index:t})});let f=!!e.trim();return(0,q.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[u.map(t=>(0,q.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,q.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,q.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,q.jsx)(`div`,{className:`spot-title`,children:un(t.title,e)}),t.desc?(0,q.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route||t.title}-${n}`))]},`${t.kind}-${t.rows[0].index}`)),f&&r&&(0,q.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),f&&n&&!r&&(0,q.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),f&&!n&&!r&&s.length===0&&(0,q.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]})]})}function fn({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}=en(t),m=an(),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})),...$t,...d||[]],[e,d]),v=a?ln(_,s):[],y=l<v.length?`spot-opt-${l}`:void 0,b=async e=>{if(g(),!e.run)return _e(e.route);let t=e.confirm;(!t||await m(t.msg,{title:t.title,confirmLabel:t.confirmLabel,tone:t.tone}))&&e.run()};return(0,q.jsxs)(q.Fragment,{children:[(0,q.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,q.jsx)(J,{name:`search`,className:`mag glyph`}),(0,q.jsx)(`span`,{className:`tb-cmdk-label`,children:`Search or run…`}),(0,q.jsx)(`kbd`,{className:`tb-cmdk-key`,children:`Ctrl K`})]}),(0,q.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,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`palette-head`,children:[(0,q.jsx)(J,{name:`search`,className:`mag glyph`}),(0,q.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,q.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]}),(0,q.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v.length?`${v.length} results`:`no matches`}),(0,q.jsx)(dn,{query:s,index:_,loading:!d,error:d?``:f,active:l,onActive:u,onPick:b}),(0,q.jsxs)(`div`,{className:`palette-foot`,children:[(0,q.jsx)(`span`,{children:`↑↓ move`}),(0,q.jsx)(`span`,{children:`↵ open`}),(0,q.jsx)(`span`,{children:`actions that write always ask first`})]})]})})]})}function pn({installs:e,onSwitch:t,fallback:n=null}){let[r,i]=(0,B.useState)(null),o=(e||[]).filter(e=>e.state===`active`);if(o.length<2)return n;let s=o.find(e=>e.selected)||o[0];return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:s.id,onChange:async e=>{let n=o.find(t=>t.id===e.target.value);if(n){i(null);try{await a.selectView(n.host,n.path),t?.()}catch(e){i(e?.body?.message||e.message)}}},children:o.map(e=>(0,q.jsx)(`option`,{value:e.id,children:e.scope===`global`?`${e.host} · global`:`${Jt(e)} · ${e.host}`},e.id))}),r&&(0,q.jsxs)(`span`,{className:`t-bad`,role:`alert`,children:[` `,`Switch failed: `,r]})]})}var mn=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function hn({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(mn)||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,q.jsx)(`div`,{ref:o,className:i?`popover ${i}`:`popover`,role:`dialog`,"aria-label":r,tabIndex:-1,children:a}):null}function gn({children:e,...t}){let n=D(`button.on`);return(0,q.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,q.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function _n({value:e,onChange:t,labelledBy:n}){let r=lt(e);return(0,q.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[at.map(n=>(0,q.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,q.jsxs)(`div`,{className:`accent-swatches`,children:[ot.map(n=>(0,q.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,q.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,q.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function vn({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o,anchorRef:s}){let c=(e,t,n,r,i)=>(0,q.jsxs)(`div`,{className:`ap-group`,children:[(0,q.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,q.jsx)(gn,{"aria-labelledby":e,children:n.map(e=>(0,q.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,se.createPortal)((0,q.jsxs)(hn,{open:!0,onClose:o,anchorRef:s,label:`Appearance`,className:`appearance-pop`,children:[c(`ap-skin`,`Skin`,Je,e,t),(0,q.jsxs)(`div`,{className:`ap-group`,children:[(0,q.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,q.jsx)(_n,{value:n,onChange:r,labelledBy:`ap-accent`})]}),c(`ap-view`,`Overview view`,ht,i,a)]}),document.querySelector(`.app`)||document.body)}function yn({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,actions:a,mode:o,onToggleMode:s,appearance:c,dataRev:l,onSwitch:u}){let[d,f]=(0,B.useState)(!1),p=(0,B.useRef)(null),m=r?.install,h=m?`${m.host}:${m.scope}`:kt(r?.target),g=e.tab&&le[e.tab];return(0,q.jsxs)(`header`,{className:`topbar`,children:[(0,q.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,q.jsx)(J,{name:t?`x`:`menu`})}),(0,q.jsx)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:(0,q.jsxs)(`ol`,{children:[(0,q.jsx)(`li`,{className:`crumb-root mono`,children:(0,q.jsx)(pn,{installs:i,onSwitch:u,fallback:(0,q.jsx)(`a`,{href:`#/installs`,title:r?.target||void 0,children:h})})}),(0,q.jsx)(`li`,{children:g?(0,q.jsx)(`a`,{href:e.page===`overview`?`#/`:`#/${e.page}`,children:V[e.page]}):(0,q.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:V[e.page]})}),g?(0,q.jsx)(`li`,{children:(0,q.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:g})}):null]})}),(0,q.jsx)(`div`,{className:`topbar-spacer`}),(0,q.jsx)(fn,{actions:a,dataRev:l}),(0,q.jsx)(`button`,{type:`button`,className:`iconbtn`,ref:p,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":d,onClick:()=>f(e=>!e),children:(0,q.jsx)(J,{name:`themes`})}),d?(0,q.jsx)(vn,{...c,anchorRef:p,onClose:()=>f(!1)}):null,(0,q.jsx)(`button`,{type:`button`,className:`iconbtn`,title:o===`light`?`Switch to dark`:`Switch to light`,"aria-label":o===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:s,children:(0,q.jsx)(J,{name:o===`light`?`moon`:`sun`})})]})}function bn({themes:e,current:t,onPick:n,onClose:r}){let i=an(),a=(0,B.useRef)(null);return(0,B.useEffect)(()=>{let e=e=>{a.current&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,B.useEffect)(()=>{a.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,q.jsxs)(`div`,{className:`pop`,ref:a,role:`dialog`,"aria-label":`Switch voice`,children:[(0,q.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,q.jsx)(`button`,{type:`button`,"aria-pressed":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:async()=>{r(),await i(`Rebuild the deployed harness in the “${e.name}” voice? It rebuilds in place, non-destructive.`,{title:`Switch voice?`,confirmLabel:`Rebuild`})&&n(e.name)},children:(0,q.jsx)(`span`,{className:`pn`,children:e.name})},e.name))]})}var xn=3500;function Sn({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,xn);return()=>clearTimeout(e)},[e,i]);let a=()=>r(e),o=()=>r(null);return(0,q.jsx)(`div`,{className:`toast-region`,"aria-live":e?.kind===`err`?void 0:`polite`,children:e&&(0,q.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,q.jsx)(`div`,{children:e.msg}),(0,q.jsx)(`div`,{style:{marginTop:8},children:(0,q.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})})}function Cn({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);(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 l=e.length?e[e.length-1].output.length:0;return(0,B.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,l,t]),(0,q.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,q.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,q.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,q.jsxs)(`span`,{className:`ttl`,children:[(0,q.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,q.jsx)(`span`,{className:`count`,children:e.length}),(0,q.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,q.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,q.jsx)(J,{name:`clear`})}),(0,q.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,q.jsx)(J,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,q.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,q.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,q.jsxs)(`div`,{className:`run`,children:[(0,q.jsxs)(`div`,{className:`run-head`,children:[(0,q.jsx)(`span`,{className:`pr`,children:`$`}),(0,q.jsx)(`span`,{className:`act`,children:e.action}),(0,q.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,q.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,q.jsx)(J,{name:`x`})})]}),e.output&&(0,q.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var wn=550,Tn=`gs-splash-seen`,En=8e3;function Dn(){try{if(window.localStorage.getItem(Tn))return 0;window.localStorage.setItem(Tn,`1`)}catch{}return wn}function On({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),Dn());return()=>clearTimeout(e)},[]);let[o,s]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(e)return;let t=setTimeout(()=>s(!0),En);return()=>clearTimeout(t)},[e]),e&&n&&!i&&a(!0),(0,B.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]);let c=o&&!i;return(0,q.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":c?void 0:`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,q.jsxs)(`div`,{className:`boot-dial`,"aria-hidden":`true`,children:[(0,q.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,q.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,q.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,q.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,q.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,q.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,q.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,q.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,q.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),c?(0,q.jsxs)(`div`,{className:`boot-status`,role:`alert`,children:[(0,q.jsx)(`span`,{children:`The server is not answering.`}),` `,(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>window.location.reload(),children:`Retry`})]}):(0,q.jsxs)(`div`,{className:`boot-status`,children:[(0,q.jsx)(`span`,{children:`germinating harness`}),(0,q.jsx)(`span`,{className:`boot-caret`})]})]})}function kn({label:e=`Loading…`}){return(0,q.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,q.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,q.jsx)(`div`,{className:`skel-bar`}),(0,q.jsx)(`div`,{className:`skel-bar`}),(0,q.jsx)(`div`,{className:`skel-bar`})]})]})}function An({error:e,style:t,onRetry:n,role:r=`alert`}){return e?n?(0,q.jsxs)(`div`,{className:`error-state`,role:r,style:t,children:[(0,q.jsx)(`p`,{className:`badge bad`,children:e}),(0,q.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:n,children:`Retry`})]}):(0,q.jsx)(`p`,{className:`badge bad`,role:r,style:t,children:e}):null}function jn(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(null);return(0,q.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,q.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,q.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 Mn=/dynamically imported module|Importing a module script failed|Unable to preload CSS/i,Nn=e=>Mn.test(e?.message||``),Pn=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=Nn(e);return(0,q.jsxs)(`div`,{role:t?void 0:`alert`,children:[(0,q.jsx)(An,{error:e.message||String(e),role:null}),t?(0,q.jsx)(jn,{}):(0,q.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]})}},Fn=(0,B.createContext)(null),In=e=>[...e].sort().join(`,`),Ln=e=>[...e.values()].some(e=>!e.applied&&In(e.value)!==e.base);function Rn(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=Ln(n.kits)||Ln(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 In(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?.failed?{...n,[e]:new Map(n[e]).set(t,{value:r.value,base:r.base})}:n})},running:(t,n)=>!!e&&i?.kind===t&&i?.key===n,busy:!!e}}function zn({activeId:e,finish:t,children:n}){let r=Rn(e,t);return(0,q.jsx)(Fn.Provider,{value:r,children:n})}function Bn(){let e=Rn(null,null);return(0,B.useContext)(Fn)||e}function Vn({eyebrow:e,title:t,sub:n,primary:r,actions:i,crumbs:a}){return(0,q.jsxs)(`div`,{className:`page-head`,children:[(0,q.jsxs)(`div`,{children:[a?.length?(0,q.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`page-crumbs`,children:(0,q.jsx)(`ol`,{children:a.map((e,t)=>(0,q.jsx)(`li`,{children:t===a.length-1?(0,q.jsx)(`span`,{"aria-current":`page`,children:e.label}):e.href?(0,q.jsx)(`a`,{href:e.href,children:e.label}):e.label},t))})}):null,e?(0,q.jsx)(`div`,{className:`eyebrow`,children:e}):null,(0,q.jsx)(`h1`,{className:`h`,children:t}),n?(0,q.jsx)(`p`,{className:`sub`,children:n}):null]}),r||i?(0,q.jsxs)(`div`,{className:`page-actions`,children:[i,r]}):null]})}var Hn=e=>!!e&&!e.endsWith(`-global`);function Un({onAction:e}){let{data:t,error:n}=W(()=>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,q.jsx)(An,{error:n});if(!t)return(0,q.jsx)(kn,{});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=Hn(_);return(0,q.jsxs)(`div`,{className:`narrow-lg`,children:[(0,q.jsx)(`div`,{className:`head-row mb-18`,children:(0,q.jsxs)(`div`,{children:[(0,q.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,q.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,q.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,q.jsx)(`div`,{className:`card-head`,children:(0,q.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,q.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,q.jsx)(`button`,{className:`btn ${e.name===m?`soft`:`ghost`}`,onClick:()=>v(e.name),title:e.blurb||e.tagline||e.name,children:(0,q.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})},e.name))})]}),(0,q.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,q.jsx)(`div`,{className:`card-head`,children:(0,q.jsx)(`h3`,{children:`2 · Install mode`})}),(0,q.jsxs)(`p`,{className:`sub mb-16`,children:[`A `,(0,q.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,q.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,q.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,q.jsx)(`select`,{className:`sel`,value:_,onChange:e=>y(e.target.value),children:h.map(e=>(0,q.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]}),b&&(0,q.jsxs)(`div`,{className:`row gap-10`,style:{maxWidth:560,marginTop:12},children:[(0,q.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,q.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,q.jsx)(`p`,{className:`sub`,style:{marginTop:12},children:u})]}),(0,q.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,q.jsx)(J,{name:`build`}),`Deploy harness`]})]})}var Wn=e=>W(()=>a.rules().catch(()=>null),[e],`rules`,{revalidate:!0}),Gn=()=>Ct(`rules`);function Kn({segments:e,value:t,max:n,size:r=120,stroke:i=12,label:a,sweepMs:o=650}){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||!E())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=z(e);k(r,{draw:`0 0`});let i=T(r,{draw:[`0 0`,`0 1`],duration:(e,n)=>Math.max(o*t[n],60),delay:(e,t)=>o*n[t],ease:`linear`});return O(i,o)},[_,o]),(0,q.jsxs)(`svg`,{className:`ring`,width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:`img`,"aria-label":a?`${a}: ${u}`:u,children:[(0,q.jsx)(`circle`,{className:`ring-track`,cx:f,cy:f,r:d,fill:`none`,strokeWidth:i}),(0,q.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,q.jsx)(`path`,{className:`ring-arc tone-${e.tone||`muted`}`,d:h,fill:`none`,strokeWidth:i,children:(0,q.jsxs)(`title`,{children:[e.label,`: `,e.n]})},e.key)}):null})]})}var qn=500;function Jn({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&&E())return k(c.current,{scaleX:0}),O(T(c.current,{scaleX:[0,1],duration:qn,ease:`outExpo`}),qn)},[l]),(0,q.jsxs)(`div`,{className:`stackbar-box`,children:[(0,q.jsx)(`div`,{className:`stackbar sweep`,role:`img`,"aria-label":n?`${n}: ${s}`:s,ref:c,children:e.map(e=>e.n>0?(0,q.jsx)(`span`,{className:`tone-${e.tone||`muted`}`,style:{width:o(e.n)},title:`${e.label}: ${e.n}`},e.key):null)}),r&&(0,q.jsx)(`ul`,{className:`stackbar-legend`,"aria-hidden":`true`,children:e.map(e=>(0,q.jsxs)(`li`,{children:[(0,q.jsx)(`i`,{className:`tone-${e.tone||`muted`}`}),e.label,` `,(0,q.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function Yn({value:e,max:t,label:n=`value`,tone:r=`accent`}){let i=t>0?t:0;return(0,q.jsx)(Jn,{parts:[{key:`v`,label:n,n:Math.min(Math.max(e||0,0),i),tone:r}],total:i,legend:!1})}var Xn=864e5;function Zn(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))/Xn);s<0||s>=t||(r[t-1-s].v+=1)}return r}var Qn=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),$n=[`--emit`,`--theme`,`--scope`],er={done:`✓`,failed:`✗`};function tr(e){let t=(e.output||``).split(`
3
+ `).find(e=>e.startsWith(`$ `))||``,n=t.split(/\s+/),r=[];return n.forEach((e,t)=>{let[i,a]=e.split(`=`),o=a||n[t+1];$n.includes(i)&&o&&!o.startsWith(`--`)&&r.push(o)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:r.join(` · `),result:er[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}var nr={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)`}},rr={cls:``,label:`ended`};function ir(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var ar=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 or(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 sr({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)},[]),or(t-e)}function cr({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,q.jsxs)(`span`,{className:`act-todo`,children:[(0,q.jsx)(`span`,{className:`on`,children:`●`.repeat(r)}),(0,q.jsx)(`span`,{className:`dim`,children:`○`.repeat(n-r)})]})}var lr=e=>e.ended?null:e.turn_started_at,ur=e=>!!(e.tokens>0||e.cost>0||lr(e)||e.files?.count>0);function dr({s:e,heading:t,id:n,children:r}){let i=e.ended?rr:nr[e.status]||nr.idle,a=e.files,o=ur(e),s=e=>n?`${n}-${e}`:void 0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`row between wrap gap-12`,children:[t?(0,q.jsxs)(`div`,{className:`row gap-10 act-min`,children:[(0,q.jsx)(`span`,{className:`feed-dot act-dot ${e.ended?``:i.cls||`acc`}`}),(0,q.jsxs)(`div`,{className:`act-min`,children:[(0,q.jsx)(`h2`,{className:`act-title`,id:s(`t`),children:t}),e.cwd&&(0,q.jsx)(`div`,{className:`dim mono act-cwd`,title:e.cwd,children:e.cwd})]})]}):null,(0,q.jsxs)(`div`,{className:`row gap-8 act-fixed`,children:[e.model&&(0,q.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,q.jsx)(`span`,{className:`badge`,children:e.agent}),(0,q.jsxs)(`span`,{className:`badge ${i.cls}`,id:s(`st`),children:[(0,q.jsx)(`span`,{className:`dot`}),i.label]}),r]})]}),e.phase&&(0,q.jsxs)(`div`,{className:`row gap-8 act-phase`,children:[(0,q.jsx)(J,{name:`activity`}),(0,q.jsx)(`span`,{className:`act-ell`,children:e.phase})]}),o&&(0,q.jsxs)(`div`,{className:`row wrap act-counters`,id:s(`c`),children:[e.tokens>0&&(0,q.jsxs)(`span`,{children:[ar(e.tokens),` tok`]}),e.cost>0&&(0,q.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),lr(e)?(0,q.jsx)(`span`,{children:(0,q.jsx)(sr,{startedAt:e.turn_started_at})}):null,a&&a.count>0&&(0,q.jsxs)(`span`,{children:[a.count,` file`,a.count===1?``:`s`,` `,(0,q.jsxs)(`span`,{className:`t-good`,children:[`+`,a.additions]}),` `,(0,q.jsxs)(`span`,{className:`t-bad`,children:[`−`,a.deletions]})]})]}),(e.error||e.blocked_on)&&(0,q.jsx)(`div`,{className:`act-err-row`,children:(0,q.jsx)(`span`,{className:`badge bad act-ell`,title:e.error||e.blocked_on,children:e.error||e.blocked_on})})]})}var fr=e=>e?.status===`blocked`||e?.status===`waiting-input`,pr=864e5,mr=e=>new Date(e).toISOString().slice(0,10),hr=(e,t)=>new Date(`${e}T00:00:00Z`).toLocaleDateString(`en-GB`,{...t,timeZone:`UTC`}),gr=e=>hr(e,{day:`numeric`,month:`short`});function _r(e,t=Date.now()){let n=hr(e,{weekday:`long`,day:`numeric`,month:`long`}),r=e===mr(t)?`Today`:e===mr(t-pr)?`Yesterday`:``;return r?`${r} · ${n}`:n}function vr(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=mr(e.started*1e3);a[t]=(a[t]||0)+1}let o=i.length?mr(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=mr(t-(n-1-r)*pr);return{key:i,n:a[i]||0,nodata:c&&(o===null||i<o)}})}var yr=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function br(e,t,n,r=Date.now()){let i={},a=e=>i[e]||={key:e,runs:[],asks:[]};for(let t of Qn(e,(e||[]).length))Number.isFinite(t.started)&&a(mr(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&&yr(t.length,`run`),i&&yr(i,`gate ask`)];return{key:e,title:_r(e,r),sum:o.filter(Boolean).join(` · `),runs:t,gate:i?{title:a,n:i}:null}})}var xr=500;function Sr({vals:e,i:t,sweep:n=!1}){let r=(0,B.useRef)(null),i=e.join(`,`);(0,B.useLayoutEffect)(()=>{if(n&&r.current&&E())return k(r.current,{strokeDasharray:1,strokeDashoffset:1}),O(T(r.current,{strokeDashoffset:[1,0],duration:xr,ease:`outExpo`}),xr)},[i,n]);let a=Math.max(1,...e),o=96/(e.length-1),s=e.map((e,t)=>`${(t*o).toFixed(1)},${(20-e/a*17).toFixed(1)}`),[c,l]=s[s.length-1].split(`,`);return(0,q.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,"aria-hidden":`true`,style:{"--i":t},children:[(0,q.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,q.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${s.join(` `)} 96,21`}),(0,q.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:s.join(` `),ref:r}),(0,q.jsx)(`circle`,{className:`spk-end`,cx:c,cy:l,r:`2.4`})]})}function Cr(e,t){let n=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{let e=n.current?[...n.current.querySelectorAll(`[data-sweep]`)]:[];if(e.length&&E())return k(e,{[t]:0}),O(T(e,{[t]:[0,1],duration:xr,ease:`outExpo`}),xr)},[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)`},wr={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}},Tr={craft:Y.craft,rigor:Y.verify,ops:Y.process,process:Y.security,comms:Y.comms},Er=e=>Tr[e]||`var(--text-3)`,Dr={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:`Personal`,c:`oklch(0.72 0.025 250)`}},Or=Object.keys(Dr);function kr(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 Ar=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],jr=e=>{let t=``;for(let[n,r]of Ar)for(;e>=n;)t+=r,e-=n;return t};function Mr(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?jr(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var Nr=new Set([`I`,`III`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),Pr={I:{key:`secretsGate`,label:`Secrets gate`},III:{key:`doneGate`,label:`Done gate`},IV:{key:`deletionGate`,label:`Deletion gate`}},Fr={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 project’s declared checks pass.`,off:`A turn that edited files may end without the checks in .geneseed/done-checks.txt passing. 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.`}},Ir=[{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`}],Lr=[{source:`mode`,label:`Mode`,against:`binds how work runs`},{source:`PROFILE.md, posture, theme`,label:`Profile, posture, theme`,against:`inform only; never bind`}],Rr=(e,t={})=>Pr[e]&&t?.[Pr[e].key]===!1?`Gate off`:Nr.has(e)?`Hook gate`:`Instruction`;function zr(e){let t={};for(let n of e||[]){let e=Dr[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:Dr[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=Or.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 Br({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=K(l);u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${X(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),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:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,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=Mr(e),i=(o?.items||[]).find(e=>e.name===r),a=i?kr(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${X(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=zr(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:`library/memory`,verb:`Open`,href:`#/section/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 Vr=e=>K(e.drift),Hr=e=>e.drift?.stale??0;function Ur(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 Wr(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+Vr(t),0),o=n.reduce((e,t)=>e+Hr(t),0),s=e?.doctor,c=s&&!s.ok?`bad`:i||a||o?`warn`:`good`,l={good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[c],u=[X(n.length,`active install`)+(r?`, ${r} disabled`:``),s?s.ok?`doctor clean`:`doctor found ${X(s.problems.length,`problem`)}`:`doctor not run yet`,i?`${X(i,`install`)} behind source`:`all in step with source`,a?`${X(a,`file`)} hand-edited`:`no hand edits`];return o&&u.push(`${X(o,`file`)} behind source`),{tone:c,head:l,facts:u}}var Gr=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],Kr=e=>e?e.carrier+e.skills+e.agents+e.context:0,qr=e=>e.state===`active`&&(e.verdict===`behind`||K(e.drift)>0||(e.drift?.stale??0)>0),Z=e=>`≈${(e/4/1e3).toFixed(1)}k`,Jr=e=>`${e.host} · ${e.scope}`,Yr=e=>({id:e.id,host:e.host,path:e.path,label:Jr(e)});function Xr({fleet:e,usage:t,...n}){let r=[],i=e?.doctor;i&&!i.ok&&r.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(i.problems.length,`problem`)}`,detail:i.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 ${Ot(t.built_epoch)} ago`:`never built`,n=Hr(t);r.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${Jr(t)} is behind its source`,detail:n?`${e} · ${X(n,`file`)} behind`:e,where:t.host,verb:`Rebuild`,act:`rebuild`,installs:[Yr(t)]})}let e=Vr(t);e&&r.push({id:`drift:${t.id}`,tag:`Drift`,tone:`warn`,title:`${Jr(t)}: ${X(e,`file`)} edited by hand`,detail:`${t.drift.edited} edited, ${t.drift.added} added, ${t.drift.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`})}if(t&&t.days_counted>=30&&t.never?.length){let{skills:e,agents:n}=Ur(t);r.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 a=Br({...n,overview:n.overview&&{...n.overview,doctor:null,diff:null}});for(let e of a)r.push({...e,sugg:!0});return r}function Zr(e,t){return(e?.rules||[]).map(e=>{let n=Mr(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?kr(r.title).name:e.rule===`wiki`?`Wiki guard`:n}})}var Qr=e=>(e||[]).filter(e=>e.state===`active`&&e.cost);function $r(e){let t=Qr(e).filter(e=>e.cost.ceiling>0&&Number.isFinite(e.cost.carrier)),n=e=>e.cost.carrier/e.cost.ceiling,r=t.find(e=>e.selected)||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:`${r.host} · ${r.scope}`,carrier:i,ceiling:a,pct:Math.round(n(r)*100),selected:!!r.selected}}function ei(e){let t=Qr(e);if(!t.length)return null;let n=t.reduce((e,t)=>Kr(t.cost)>Kr(e.cost)?t:e),r=t.map(e=>Kr(e.cost)),i=t.find(e=>e.selected)||n;return{min:Math.min(...r),max:Math.max(...r),top:n,shown:i}}var ti=e=>(e?.per_day||[]).reduce((e,t)=>e+t,0);function ni(e,t){let n=Zr(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 Q=e=>e.catch(()=>null),ri=(e,t)=>`${t?Math.min(100,e/t*100):0}%`,ii=36e5,ai=5e3;function oi({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=i===null?e.latest===null?(0,q.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · `,e.checking?`checking…`:`update check unavailable`]}):e.available?(0,q.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,q.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}):(0,q.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):i>0?(0,q.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current??``,` `,(0,q.jsxs)(`span`,{className:`ver-new`,children:[i,` commit`,i===1?``:`s`,` to pull`]})]}):(0,q.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · up to date`]});if(r===`other`)return!e.available||!e.command?a:(0,q.jsxs)(q.Fragment,{children:[a,(0,q.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,q.jsx)(`code`,{className:`mono`,children:e.command})]})]});if(r!==`git`&&!e.available)return a;let o=i===null?!!e.available:i>0;return(0,q.jsxs)(q.Fragment,{children:[a,(0,q.jsx)(`button`,{type:`button`,className:o&&n?`btn`:`btn ghost`,title:r===`git`?i===0?`Nothing to pull: up to date with upstream. 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 si={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`};function ci({tone:e}){return(0,q.jsx)(`svg`,{className:`health-ico`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:si[e]||si.warn})})}function li({fleet:e,error:t,behind:n,onAction:r,onRebuild:i}){let a=(0,q.jsx)(`button`,{type:`button`,className:`btn ghost ldg-doctor`,onClick:()=>r(`doctor`),children:`Run doctor`});if(!e)return t?(0,q.jsxs)(`section`,{className:`health unknown`,"aria-labelledby":`ldg-health`,children:[(0,q.jsx)(ci,{tone:`warn`}),(0,q.jsx)(`div`,{className:`health-text`,role:`status`,children:(0,q.jsx)(`h2`,{id:`ldg-health`,children:`Status unknown`})}),(0,q.jsx)(`div`,{className:`health-acts`,children:a})]}):(0,q.jsx)(`div`,{className:`health unknown`,"aria-busy":`true`});let o=Wr(e),s=[...o.facts,...e.version?[`Source is ${e.version}`]:[]];return(0,q.jsxs)(`section`,{className:`health ${o.tone}`,"aria-labelledby":`ldg-health`,children:[(0,q.jsx)(ci,{tone:o.tone}),(0,q.jsxs)(`div`,{className:`health-text`,role:`status`,children:[(0,q.jsx)(`h2`,{id:`ldg-health`,children:o.head}),(0,q.jsxs)(`p`,{className:`health-facts`,children:[s.join(` · `),`.`]})]}),(0,q.jsxs)(`div`,{className:`health-acts`,children:[a,n.length?(0,q.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 ui({chars:e}){let t=C(e);return(0,q.jsxs)(`span`,{className:`mono`,children:[Z(t??e),` tok`]})}var di=e=>Math.round(e/4),fi={carrier:`accent`,skills:`skill`,agents:`agent`,context:`context`},pi=e=>Gr.map(([t,n])=>({key:t,label:n,n:di(e[t]),tone:fi[t]})),mi=e=>`${e.host} · ${e.scope}`;function hi({cost:e,i:t}){let n=2*Math.PI*14,r=e.ceiling?Math.min(1,e.carrier/e.ceiling):0;return(0,q.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,q.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,q.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 gi({id:e,title:t,aside:n,className:r=``,children:i}){return(0,q.jsxs)(`section`,{className:`panel ldg-kpi ${r}`,"aria-labelledby":e,children:[(0,q.jsxs)(`div`,{className:`ldg-kpi-head`,children:[(0,q.jsx)(`h3`,{id:e,children:t}),n]}),i]})}function _i({installs:e}){let t=$r(e);return(0,q.jsx)(gi,{id:`ldg-k-root`,title:`Root file vs ceiling`,className:`ldg-kpi-root`,children:t?(0,q.jsxs)(`div`,{className:`ldg-kpi-ring`,children:[(0,q.jsxs)(`span`,{className:`ldg-ringbox`,children:[(0,q.jsx)(Kn,{value:di(t.carrier),max:di(t.ceiling),segments:t.pct>100?[{key:`v`,label:`root file`,n:di(t.carrier),tone:`bad`}]:void 0,size:64,stroke:7,label:`${t.selected?`Root file`:`Worst root file`}: ${t.label}, ${t.pct} percent of its ceiling`}),(0,q.jsxs)(`span`,{className:`mono ldg-ring-pct`,"aria-hidden":`true`,children:[t.pct,`%`]})]}),(0,q.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,q.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(t.carrier)} / ${Z(t.ceiling)} tokens`}),(0,q.jsx)(`span`,{className:`dim`,children:t.label})]})]}):(0,q.jsx)(`p`,{className:`dim`,children:`No root file to measure.`})})}function vi({installs:e}){let t=ei(e),n=t&&(Z(t.min)===Z(t.max)?Z(t.max):`${Z(t.min)} – ${Z(t.max)}`);return(0,q.jsx)(gi,{id:`ldg-k-cost`,title:`Loaded every turn`,className:`ldg-kpi-cost`,children:t?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,q.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(Kr(t.shown.cost))} tokens`}),(0,q.jsx)(`span`,{className:`dim`,children:mi(t.shown)})]}),(0,q.jsx)(Jn,{parts:pi(t.shown.cost),label:`Loaded every turn, ${mi(t.shown)}`}),(0,q.jsx)(`span`,{className:`dim ldg-kpi-cap`,children:`All installs: ${n} tokens`})]}):(0,q.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`})})}function yi({usage:e}){let t=e?.enabled?e.days_counted<30&&e.since?`since ${e.since}`:`30 days`:null;return(0,q.jsx)(gi,{id:`ldg-k-calls`,title:`Skill and agent calls`,className:`ldg-kpi-calls`,aside:t?(0,q.jsx)(`span`,{className:`mono dim ldg-kpi-aside`,children:t}):null,children:e?e.enabled?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:(0,q.jsx)(A,{value:ti(e)})}),e.per_day?.length>1?(0,q.jsx)(Sr,{vals:e.per_day,i:0}):null]}):(0,q.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`}):(0,q.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})})}function bi({gates:e,laws:t}){let n=ni(e,t);return(0,q.jsx)(gi,{id:`ldg-k-gates`,title:`Gate asks · 30 days`,className:`ldg-kpi-gates`,aside:(0,q.jsx)(`a`,{className:`ldg-kpi-aside`,href:`#/laws`,"aria-label":`Open the Constitution`,children:`Constitution →`}),children:e?n.total?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`span`,{className:`ldg-kpi-line`,children:[(0,q.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:n.total}),` `,(0,q.jsx)(`span`,{className:`dim`,children:`· ${n.top.name} ${n.top.n}`})]}),n.perDay.length>1?(0,q.jsx)(Sr,{vals:n.perDay,i:1}):null]}):(0,q.jsx)(`p`,{className:`dim`,children:`No gate asked in 30 days.`}):(0,q.jsx)(`p`,{className:`dim`,children:`Gate activity could not be read.`})})}var xi=6;function Si({i:e}){if(!e.diffable)return(0,q.jsx)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:`not checkable`});let t=K(e.drift),n=e.drift?.stale??0;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ldg-syncbar`,children:(0,q.jsx)(Jn,{parts:[{key:`stale`,label:`Behind source`,n,tone:`warn`},{key:`edited`,label:`Edited by hand`,n:t,tone:`bad`}],label:`Sync with source, ${mi(e)}`,legend:!1})}),t?(0,q.jsxs)(`span`,{className:`mono t-bad`,children:[t,` edited`]}):e.drift?.linked?(0,q.jsxs)(`span`,{className:`mono dim`,title:`Yours: links Geneseed leaves alone`,children:[e.drift.linked,` linked`]}):(0,q.jsx)(`span`,{className:`mono dim`,children:`none`}),n?(0,q.jsxs)(`div`,{className:`mono dim ldg-sub`,children:[n,` file`,n===1?``:`s`,` behind`]}):null]})}function Ci(e){if(!e.diffable)return`Not checkable: drift is only checked for global installs.`;let t=e.drift||{},n=[t.stale?`${t.stale} behind`:null,t.edited?`${t.edited} edited`: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 wi({i:e,n:t,onRebuild:n,onOpen:r,busy:i}){let[a,o]=(0,B.useState)(!1),s=mi(e),c=(0,q.jsxs)(`td`,{className:`ldg-where`,children:[i?(0,q.jsx)(`span`,{className:`console-progress`,role:`progressbar`,"aria-label":`Rebuilding ${s}`}):null,(0,q.jsxs)(`div`,{className:`ldg-who`,children:[qr(e)?(0,q.jsx)(`svg`,{className:`ldg-glyph ${K(e.drift)?`bad`:`warn`}`,viewBox:`0 0 10 10`,role:`img`,"aria-label":K(e.drift)?`edited by hand`:`needs a rebuild`,children:(0,q.jsx)(`path`,{d:`M5 1 9 9H1z`,fill:`currentColor`})}):null,e.state===`active`&&e.cost?(0,q.jsx)(`span`,{className:`ldg-phone-ring`,"aria-hidden":`true`,children:(0,q.jsx)(hi,{cost:e.cost,i:t})}):null,(0,q.jsxs)(`div`,{className:`ldg-name`,children:[(0,q.jsx)(`span`,{className:`ldg-host`,children:e.host}),` `,(0,q.jsx)(`span`,{className:`dim`,children:e.scope}),(0,q.jsx)(`div`,{className:`mono dim ldg-path`,children:e.path})]})]})]});if(e.state!==`active`)return(0,q.jsxs)(`tr`,{className:`ldg-off`,children:[c,(0,q.jsx)(`td`,{className:`ldg-build`,children:(0,q.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,q.jsx)(`td`,{className:`ldg-sync`}),(0,q.jsx)(`td`,{className:`ldg-root`}),(0,q.jsx)(`td`,{className:`ldg-total`}),(0,q.jsx)(`td`,{className:`ldg-act`,children:(0,q.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`})})]});let l={synced:(0,q.jsx)(`span`,{className:`pill good`,children:`in step`}),behind:(0,q.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,q.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],u=Kr(e.cost),d=e.cost?.ceiling?Math.round(e.cost.carrier/e.cost.ceiling*100):null;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`tr`,{className:a?`ldg-open`:``,children:[c,(0,q.jsxs)(`td`,{className:`ldg-build`,children:[l,(0,q.jsx)(`div`,{className:`mono dim ldg-sub`,children:e.built_epoch?`built ${Ot(e.built_epoch)} ago`:`never built`})]}),(0,q.jsx)(`td`,{className:`ldg-sync`,children:(0,q.jsx)(Si,{i:e})}),(0,q.jsx)(`td`,{className:`ldg-root`,children:e.cost?d===null?(0,q.jsx)(`span`,{className:`dim`,children:`no ceiling`}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ldg-rootbar`,children:(0,q.jsx)(Yn,{value:di(e.cost.carrier),max:di(e.cost.ceiling),label:`Root file, ${s}`,tone:d>100?`bad`:`accent`})}),(0,q.jsx)(`span`,{className:`mono dim ldg-sub`,children:`${Z(e.cost.carrier)} / ${Z(e.cost.ceiling)} · ${d}%`})]}):(0,q.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,q.jsx)(`td`,{className:`ldg-total`,children:e.cost?(0,q.jsx)(ui,{chars:u}):null}),(0,q.jsxs)(`td`,{className:`ldg-act`,children:[qr(e)?(0,q.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Rebuild ${s}`,title:`Rebuilds ${s} only`,onClick:()=>n([Yr(e)]),children:`Rebuild`}):(0,q.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`}),(0,q.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,q.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,q.jsx)(`path`,{d:a?`M6 15l6-6 6 6`:`M6 9l6 6 6-6`})})})]})]}),a?(0,q.jsx)(`tr`,{className:`ldg-detail`,id:`ldg-detail-${e.id}`,children:(0,q.jsx)(`td`,{colSpan:xi,children:(0,q.jsxs)(`div`,{className:`ldg-detail-grid`,children:[(0,q.jsxs)(`div`,{className:`ldg-detail-col`,children:[e.cost?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`ldg-lbl`,children:`What rides every turn · ${Z(u)} tokens`}),(0,q.jsx)(Jn,{parts:pi(e.cost),label:s})]}):(0,q.jsx)(`span`,{className:`dim`,children:`Always-on cost not measured.`}),(0,q.jsx)(`span`,{className:`dim`,children:`Voice ${e.theme} · ${e.footprint} footprint`})]}),(0,q.jsxs)(`div`,{className:`ldg-detail-col`,children:[(0,q.jsx)(`span`,{className:`ldg-lbl`,children:`Differs from source`}),(0,q.jsx)(`span`,{className:`muted`,children:Ci(e)}),e.diffable?(0,q.jsx)(`span`,{children:(0,q.jsx)(`a`,{className:`btn ghost sm`,href:`#/installs/edits`,"aria-label":`View diff for ${s}`,children:`View diff`})}):null]})]})})}):null]})}function Ti({rows:e,onAction:t,onRebuild:n}){let r=e.filter(e=>!e.sugg).length;return(0,q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,q.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,q.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`}),(0,q.jsxs)(`span`,{className:`mono dim`,children:[r,` problem`,r===1?``:`s`,`, `,e.length-r,` suggestion`,e.length-r===1?``:`s`]})]}),e.length?(0,q.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,q.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,q.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,q.jsxs)(`span`,{className:`needs-what`,children:[(0,q.jsx)(`b`,{children:e.title}),e.detail?(0,q.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,q.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),e.act?(0,q.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,"aria-label":`${e.verb}: ${e.title}`,onClick:()=>e.installs?n(e.installs):t(e.act),children:e.verb}):(0,q.jsx)(`a`,{className:`needs-verb`,href:e.href,"aria-label":`${e.verb}: ${e.title}`,children:e.verb})]},e.id))}):(0,q.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function Ei({usage:e}){let t=(0,q.jsxs)(`div`,{className:`panel-head`,children:[(0,q.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,q.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,q.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})]});if(!e.enabled)return(0,q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,q.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,q.jsx)(`p`,{className:`muted`,children:e.since?(0,q.jsxs)(q.Fragment,{children:[`Counting since `,(0,q.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,q.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,q.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,q.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 n=e.rows.slice(0,7),r=Math.max(1,...n.map(e=>e.n));return(0,q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,q.jsx)(`ul`,{className:`ubars`,children:n.map((e,t)=>(0,q.jsxs)(`li`,{className:e.kind,children:[(0,q.jsxs)(`span`,{className:`ub-name`,children:[e.name,` `,(0,q.jsx)(`span`,{className:`dim`,children:e.kind})]}),(0,q.jsx)(`span`,{className:`ub-trk`,children:(0,q.jsx)(`i`,{style:{width:ri(e.n,r),"--i":t}})}),(0,q.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,q.jsxs)(`div`,{className:`ub-never`,children:[(0,q.jsxs)(`span`,{children:[(0,q.jsx)(`b`,{children:Ur(e).skills}),` skills never fired`]}),(0,q.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function Di({overview:e,setup:t,runs:n,onAction:r,onRetry:i,dataRev:o,banner:s,view:c}){let l=an(),[u,d]=(0,B.useState)({}),{data:f,error:p,reload:m}=W(()=>a.fleet(),[o]),{data:h}=W(()=>Q(a.usage()),[o]),{data:g}=W(()=>Q(a.gates()),[o]),_=(0,B.useRef)(null),{data:v,reload:y}=W(()=>Q(a.update()).then(e=>(e?_.current=e:_.current?.checking&&(_.current={..._.current,checking:!1}),_.current)),[o]);(0,B.useEffect)(()=>{let e=setInterval(y,ii),t=()=>{document.visibilityState===`visible`&&y()};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[y]);let b=!!v?.checking;(0,B.useEffect)(()=>{if(!b)return;let e=setTimeout(y,ai);return()=>clearTimeout(e)},[b,v,y]);let{data:x}=Wn(o),{data:S}=W(()=>Q(a.activity()),[o]),{data:C}=W(()=>Q(a.profile()),[o]),{data:w}=W(()=>Q(a.catalog(`skills`)),[o],`catalog:skills`),{data:T}=W(()=>Q(a.catalog(`laws`)),[o],`catalog:laws`),E=f?.installs||[],[D,O]=(0,B.useState)(``),k=async e=>{O(``);try{await a.selectView(e.host,e.path)}catch(t){O(`Could not open ${mi(e)}: ${t?.message||t}`);return}i?.(),window.location.hash=`#/installs/hosts`},A=Xr({fleet:f,usage:h,overview:e,setup:t,rules:x,activity:S,profile:C,skills:w,laws:T}),j=E.filter(qr).map(Yr),M=async e=>{let t=e.map(e=>e.label);if(!await l(`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&&d(t=>({...t,[n]:e.map(e=>e.id)}))},N=new Set(Object.entries(u).filter(([e])=>n?.find(t=>t.id===e)?.status===`running`).flatMap(([,e])=>e));return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Vn,{eyebrow:f?`${E.length} harness${E.length===1?``:`es`} installed on this machine`:null,title:`Overview`,actions:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(oi,{update:v,onAction:r,canFill:!j.length}),c]})}),s,(0,q.jsxs)(`div`,{className:`ov-stack ldg`,children:[(0,q.jsx)(li,{fleet:f,error:p,behind:j,onAction:r,onRebuild:M}),(0,q.jsxs)(`div`,{className:`ldg-kpis`,role:`group`,"aria-labelledby":`ldg-kpis-h`,children:[(0,q.jsx)(`h2`,{id:`ldg-kpis-h`,className:`sr-only`,children:`Key figures`}),(0,q.jsx)(_i,{installs:E}),(0,q.jsx)(vi,{installs:E}),(0,q.jsx)(yi,{usage:h}),(0,q.jsx)(bi,{gates:g,laws:T})]}),(0,q.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,q.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,q.jsx)(`h2`,{id:`ldg-fleet`,children:`Installed harnesses`}),f?.source_fp?(0,q.jsxs)(`span`,{className:`mono dim`,children:[`source `,f.source_fp]}):null]}),D?(0,q.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:D}):null,p&&f?(0,q.jsxs)(`p`,{className:`dim`,role:`status`,children:[`Could not refresh the installs — showing the last read.`,` `,(0,q.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]}):null,(0,q.jsx)(`div`,{className:`ldg-scroll`,children:(0,q.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,q.jsx)(`caption`,{className:`sr-only`,children:`Installs`}),(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{scope:`col`,children:`Install`}),(0,q.jsx)(`th`,{scope:`col`,className:`ldg-build`,children:`Build`}),(0,q.jsx)(`th`,{scope:`col`,className:`ldg-sync`,children:`Sync with source`}),(0,q.jsx)(`th`,{scope:`col`,className:`ldg-root`,children:`Root file · ceiling`}),(0,q.jsx)(`th`,{scope:`col`,className:`ldg-total`,children:`Always-on`}),(0,q.jsx)(`th`,{scope:`col`,children:(0,q.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,q.jsxs)(`tbody`,{children:[p&&!f?(0,q.jsx)(`tr`,{children:(0,q.jsxs)(`td`,{colSpan:xi,children:[(0,q.jsx)(`span`,{className:`dim`,role:`status`,children:`Could not read the installs`}),` `,(0,q.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]})}):null,E.map((e,t)=>(0,q.jsx)(wi,{i:e,n:t,onRebuild:M,onOpen:k,busy:N.has(e.id)},e.id))]})]})})]}),(0,q.jsxs)(`div`,{className:`ldg-bottom`,children:[(0,q.jsx)(Ti,{rows:A,onAction:r,onRebuild:M}),(0,q.jsx)(Ei,{usage:h})]})]})]})}var Oi=`geneseed-understand-seen`,ki=`understand`;function Ai(){try{let e=JSON.parse(localStorage.getItem(Oi));return Array.isArray(e)?e:[]}catch{return[]}}function ji(e){let t=Ai();if(t.includes(e))return t;let n=[...t,e];try{localStorage.setItem(Oi,JSON.stringify(n))}catch{}return n}function Mi(e,t){let n=e?.groups||[],r=n.findIndex(e=>e.id===ki),i=n[r]?.pages||[],a=i.findIndex(e=>e.id===t);if(a<0)return{prev:null,next:null};let o=n.slice(r+1).find(e=>e.pages.length);return{prev:i[a-1]||null,next:i[a+1]||o?.pages[0]||null}}function Ni(e,t){for(let n of e?.groups||[]){let e=n.pages.find(e=>e.id===t);if(e)return{part:n,section:e.section||`General`,page:e}}return{part:null,section:null,page:null}}function Pi(e,t){let{part:n,section:r}=Ni(e,t);if(!n)return{prev:null,next:null};if(n.id===`understand`)return Mi(e,t);let i=n.pages.filter(e=>(e.section||`General`)===r),a=i.findIndex(e=>e.id===t);return{prev:i[a-1]||null,next:i[a+1]||null}}var Fi=e=>`#/docs/`+encodeURIComponent(e);function Ii({pages:e,seen:t}){let n=e.filter(e=>t.includes(e.id)).length;return(0,q.jsx)(`div`,{className:`track-prog`,role:`progressbar`,"aria-label":`Pages read`,"aria-valuemin":0,"aria-valuemax":e.length,"aria-valuenow":n,children:(0,q.jsx)(`i`,{style:{width:`${n/(e.length||1)*100}%`}})})}function Li({menu:e,pageId:t}){let{prev:n,next:r}=Pi(e,t);return!n&&!r?null:(0,q.jsxs)(`nav`,{className:`track-bar`,"aria-label":`Pages`,children:[n?(0,q.jsxs)(`a`,{className:`track-card`,href:Fi(n.id),children:[(0,q.jsx)(`span`,{className:`track-card-lbl`,"aria-hidden":`true`,children:`Previous`}),(0,q.jsxs)(`span`,{className:`track-card-title`,children:[`← `,n.title]})]}):(0,q.jsx)(`span`,{}),r&&(0,q.jsxs)(`a`,{className:`track-card next`,href:Fi(r.id),children:[(0,q.jsx)(`span`,{className:`track-card-lbl`,"aria-hidden":`true`,children:`Next`}),(0,q.jsxs)(`span`,{className:`track-card-title`,children:[`Next: `,r.title,` →`]})]})]})}var Ri=`modulepreload`,zi=function(e){return`/`+e},Bi={},Vi=function(e){return e.pathname.endsWith(`.css`)},Hi=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=zi(t,n);let r=s(t),i=Vi(r);return Hi(Bi,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`:Ri,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)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).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)})},Ui=`geneseed-newhere-dismissed`,Wi=(0,B.lazy)(()=>$(()=>import(`./Dashboard-DtJ0xrcA.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5])));function Gi({harness:e}){let[t,n]=(0,B.useState)(()=>!!localStorage.getItem(Ui)),{data:r}=W(()=>t?Promise.resolve(null):a.docs(e).catch(()=>null),[t,e]),i=r?.groups?.find(e=>e.id===`understand`)?.pages||[],o=Ai(),s=i.findIndex(e=>!o.includes(e.id));if(t||!i.length||s<0)return null;let c=i.filter(e=>o.includes(e.id)).length;return(0,q.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,q.jsxs)(`div`,{className:`newhere-body`,children:[(0,q.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,q.jsxs)(`p`,{children:[i.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),(0,q.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${c} of ${i.length} read`,children:i.map(e=>(0,q.jsx)(`i`,{className:o.includes(e.id)?`f`:``},e.id))})]}),(0,q.jsx)(`a`,{className:`btn ghost`,href:`#/docs/${encodeURIComponent(i[s].id)}`,children:c?`Continue · step ${s+1}`:`Start`}),(0,q.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(Ui,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function Ki({layout:e,onLayout:t}){return(0,q.jsx)(gn,{"aria-label":`View`,children:ht.map(n=>(0,q.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 qi({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}=W(()=>Promise.resolve().then(()=>a.installs()).catch(()=>null),[u],`installs`);if(!e)return t?(0,q.jsx)(An,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,q.jsx)(kn,{});if(!e.deployed){if(f&&!d)return(0,q.jsx)(kn,{});if(!d?.installs?.some(e=>e.state===`active`))return(0,q.jsx)(Un,{onAction:s})}let p=(0,q.jsx)(Gi,{harness:Qt(e.emit)}),m=l?(0,q.jsx)(Ki,{layout:c,onLayout:l}):null;return c===`overview`?(0,q.jsx)(Di,{overview:e,setup:i,runs:o,onAction:s,onRetry:n,dataRev:u,view:m,banner:(0,q.jsxs)(q.Fragment,{children:[e.daemon_stale?(0,q.jsx)(jn,{}):null,p]})}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(Vn,{title:`Overview`,sub:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `),primary:(0,q.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(`build-all`),children:`Rebuild`}),actions:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>s(`update`),children:`Update`}),(0,q.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>s(`doctor`),children:`Run doctor`}),m]})}),p,(0,q.jsx)(B.Suspense,{fallback:(0,q.jsx)(kn,{}),children:(0,q.jsx)(Wi,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:o,onAction:s,layout:c,dataRev:u})})]})}var Ji=(0,B.lazy)(()=>$(()=>import(`./Activity-DvmB7N8g.js`),__vite__mapDeps([6,1,2,3,4,7,8]))),Yi=(0,B.lazy)(()=>$(()=>import(`./ActivityDetail-Bd1ul_B-.js`),__vite__mapDeps([9,1,2,3,7,8]))),Xi=(0,B.lazy)(()=>$(()=>import(`./Library-CuRHfeqT.js`),__vite__mapDeps([10,1,2,3,4,5,7,11,12,13]))),Zi=(0,B.lazy)(()=>$(()=>import(`./Kits-DmqZkK4K.js`),__vite__mapDeps([14,1,2,3,7,13,15,16]))),Qi=(0,B.lazy)(()=>$(()=>import(`./Loops-D7VflI8x.js`),__vite__mapDeps([17,1,2,3,7,8,11,12,18,13,16]))),$i=(0,B.lazy)(()=>$(()=>import(`./Laws-BcUWCQvl.js`),__vite__mapDeps([19,1,2,3,7,12,13]))),ea=(0,B.lazy)(()=>$(()=>import(`./Personal-Bpl90lqc.js`),__vite__mapDeps([20,1,2,3,7,13,21,10,4,5,11,12]))),ta=(0,B.lazy)(()=>$(()=>import(`./Installs-BHxWO-Ev.js`),__vite__mapDeps([22,1,2,3,4,7,21,15]))),na=(0,B.lazy)(()=>$(()=>import(`./Docs-Bt9FAScn.js`),__vite__mapDeps([23,1,2,3,4,7,11,12,18,13])));function ra(){let e=ge(),[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(!1),[o,s]=Ke(),[c,l]=Ze(),[u,d]=pt(),f=e=>{if(e===c)return;let t=()=>{l(e),d(`curated`)};if(!document.startViewTransition||!E())return t();document.startViewTransition(()=>(0,se.flushSync)(t))},[p,m]=vt(),[h,g]=(0,B.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[_,v]=(0,B.useState)(!1),y=(0,B.useRef)(null),b=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&v(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]),(0,B.useEffect)(()=>{if(!_)return;let e=b.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[_]);let x=e=>n({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:S,error:C,themes:w,reload:T}=yt(x),[D,O]=(0,B.useState)(0),k=()=>{T(),O(e=>e+1)},[A,j]=(0,B.useState)(null),{runs:M,activeId:N,consoleOpen:P,setConsoleOpen:F,runAction:I,cancelJob:ee,clearRuns:te}=xt({onFinish:e=>{k(),j({status:e,at:Date.now()})},onError:x}),{data:L}=W(()=>a.setup().catch(()=>null),[D],`setup`),{data:ne}=W(()=>a.installs().catch(()=>null),[D],`installs`),re=ne?.installs||null,ie=M[M.length-1],ae=ie?ie.status===`running`?`${ie.action} running`:`${ie.action} ${ie.status}`:``;(0,B.useEffect)(()=>{let e=y.current;if(e){if(!Ue(e,lt(u),o)){let t=dt(u);t?Se(e,t,o):we(e,c,o)}document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,getComputedStyle(e).getPropertyValue(`--bg`).trim())}},[o,u,c]);let R=[{title:`Rebuild all`,desc:`Re-emit every install`,run:()=>I(`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:()=>I(`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:()=>I(`doctor`)},{title:`Restart server`,desc:`Restart the local Geneseed server`,run:()=>rt().catch(x),confirm:{msg:`Restart the local Geneseed server? The console reconnects in a moment.`,title:`Restart the server?`,confirmLabel:`Restart`}},{title:o===`light`?`Switch to dark mode`:`Switch to light mode`,desc:`Appearance`,run:s},...Je.filter(e=>e.id!==c).map(e=>({title:`Flavour: ${e.name}`,desc:e.tagline,run:()=>f(e.id)}))].map(e=>({kind:`Actions`,hay:`${e.title} ${e.desc}`.toLowerCase(),...e})),oe={flavour:c,onFlavour:f,accentMode:u,onAccentMode:d,layout:p,onLayout:m};return(0,q.jsx)(`div`,{className:`app fl-${c} ${o===`light`?`light`:``}${_?` nav-open`:``}`,ref:y,children:(0,q.jsxs)(on,{children:[(0,q.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,q.jsx)(`a`,{className:`skip-link`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:`Skip to content`}),(0,q.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:ae}),_&&(0,q.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>v(!1)}),(0,q.jsx)(Vt,{route:e,overview:S,installs:re,onOpenVoice:()=>i(e=>!e),onNavigate:()=>v(!1)}),r&&(0,q.jsx)(bn,{themes:w,current:S?.theme,onPick:e=>{i(!1),I(`build`,{theme:e,emit:S?.emit})},onClose:()=>i(!1)}),(0,q.jsxs)(`div`,{className:`col`,ref:b,children:[(0,q.jsx)(yn,{route:e,navOpen:_,onToggleNav:()=>v(e=>!e),overview:S,installs:re,actions:R,mode:o,onToggleMode:s,appearance:oe,dataRev:D,onSwitch:k}),(0,q.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,q.jsx)(`div`,{className:[`library`,`kits`,`loops`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:(0,q.jsx)(zn,{activeId:N,finish:A,children:(0,q.jsx)(Pn,{children:(0,q.jsx)(B.Suspense,{fallback:(0,q.jsx)(kn,{}),children:{overview:()=>(0,q.jsx)(qi,{overview:S,overviewError:C,onRetry:T,themes:w,setup:L,runs:M,onAction:I,layout:p,onLayout:m,dataRev:D}),laws:()=>(0,q.jsx)($i,{selected:e.item,overview:S,setup:L,onAction:I,dataRev:D}),library:()=>(0,q.jsx)(Xi,{overview:S,section:e.section,selected:e.item,dataRev:D}),kits:()=>(0,q.jsx)(Zi,{item:e.item,onAction:I,dataRev:D}),loops:()=>(0,q.jsx)(Qi,{tab:e.tab,item:e.item,dataRev:D}),personal:()=>(0,q.jsx)(ea,{tab:e.tab,item:e.item,setup:L,dataRev:D}),installs:()=>(0,q.jsx)(ta,{tab:e.tab,overview:S,setup:L,themes:w,onAction:I,onMutated:k,dataRev:D,appearance:oe}),activity:()=>e.item?(0,q.jsx)(Yi,{sid:e.item},e.item):(0,q.jsx)(Ji,{}),docs:()=>(0,q.jsx)(na,{page:e.item,onAction:I,overview:S})}[e.page]?.()})},e.page)})})}),(0,q.jsx)(Ut,{route:e,navOpen:_,onMore:()=>v(!0)}),(0,q.jsx)(Cn,{runs:M,open:P,busy:!!N,finish:A,onToggle:()=>F(e=>!e),onClear:te,onCancel:ee})]}),(0,q.jsx)(Sn,{toast:t,onClose:()=>n(null)}),h&&(0,q.jsx)(On,{ready:!!S||!!C,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}g(!1)}})]})})}(0,ce.createRoot)(document.getElementById(`root`)).render((0,q.jsx)(ra,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{Qt as $,fr as A,Gn as B,dr as C,te as Ct,ar as D,ir as E,tr as F,Bn as G,Un as H,Qn as I,kn as J,jn as K,Yn as L,gr as M,Cr as N,br as O,Zn as P,Xt as Q,Jn as R,Er as S,ae as St,cr as T,Vn as U,Wn as V,In as W,gn as X,_n as Y,an as Z,kr as _,H as _t,Fi as a,J as at,Dr as b,he as bt,Ai as c,Mt as ct,Fr as d,Pt as dt,Zt as et,Pr as f,W as ft,Mr as g,Je as gt,Rr as h,rt as ht,Ii as i,Kt as it,vr as j,ur as k,Wr as l,jt as lt,Lr as m,ft as mt,Li as n,Gt as nt,ji as o,K as ot,Ir as p,ht as pt,An as q,ki as r,Jt as rt,Ni as s,Nt as st,$ as t,Wt as tt,Zr as u,Ot as ut,wr as v,le as vt,Sr as w,Or as x,z as xt,Tr as y,_e as yt,Kn as z};
@@ -11,13 +11,13 @@
11
11
  <!-- The brand sprout as an inline SVG favicon (no extra asset to serve). -->
12
12
  <link rel="icon" type="image/svg+xml"
13
13
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5v-9' stroke='%233AD4C4' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath 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='%233AD4C4'/%3E%3Cpath d='M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z' fill='%233AD4C4' opacity='.42'/%3E%3C/svg%3E" />
14
- <script type="module" crossorigin src="/assets/index-DMDF5Y3Y.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-UNxZecs3.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/react-DlYQp10C.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/api-BfpZmUMI.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/motion-CXaUMNkg.js">
19
19
  <link rel="modulepreload" crossorigin href="/assets/sections-ChwaobfW.js">
20
- <link rel="stylesheet" crossorigin href="/assets/index-BX3zc2Yi.css">
20
+ <link rel="stylesheet" crossorigin href="/assets/index-IuDNqPEl.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
package/web/dist/sw.js CHANGED
@@ -3,7 +3,10 @@
3
3
  // and Windows) and so Vite's content-hashed, immutable assets load instantly
4
4
  // from a cache. HTML navigations and /api/* always hit the network, so the
5
5
  // per-session CSRF token and live data are never served stale.
6
- const CACHE = 'geneseed-assets-v1'
6
+ // v2: v1 may hold index.html cached under a chunk URL (see below); the new name makes
7
+ // activate drop it. shortcut: one name for every build, so old hashed assets pile up
8
+ // until the name changes; stamp a build id into dist/sw.js from vite.config.js to prune per build.
9
+ const CACHE = 'geneseed-assets-v2'
7
10
 
8
11
  self.addEventListener('install', () => self.skipWaiting())
9
12
 
@@ -30,7 +33,12 @@ self.addEventListener('fetch', (event) => {
30
33
  (hit) =>
31
34
  hit ||
32
35
  fetch(request).then((res) => {
33
- if (res.ok) cache.put(request, res.clone())
36
+ // A missing file (mid-rebuild, web/dist emptied) comes back as the index.html
37
+ // fallback at 200: cached under the chunk URL, it broke every later import().
38
+ // A 206 is not the whole asset either. Only a full, non-HTML answer is kept.
39
+ const type = res.headers.get('Content-Type') || ''
40
+ if (res.status === 200 && !type.startsWith('text/html'))
41
+ cache.put(request, res.clone())
34
42
  return res
35
43
  }),
36
44
  ),
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,E as s,F as c,J as l,M as u,N as d,O as f,T as p,U as m,at as h,ft as g,j as _,k as v,q as y,u as b,ut as x,w as S}from"./index-DMDF5Y3Y.js";import{t as C}from"./EmptyState-1sPNleqv.js";import{t as w}from"./usePoll-bDFN-Hr6.js";var T=e(t(),1),E=n(),D=e=>e.catch(()=>null);function O({s:e}){let t=(0,T.useId)(),n=e.todos,r=v(e);return(0,E.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,E.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,E.jsx)(h,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,E.jsx)(`div`,{className:`act-foot`,children:(0,E.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,E.jsx)(p,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,E.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,x(e.updated_at),` ago`]})]})}var k=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function ee(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:k.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function te(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function A({enabled:e,onToggle:t}){return(0,E.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,E.jsx)(h,{name:`activity`,className:`glyph act-fixed`}),(0,E.jsxs)(`div`,{className:`act-grow`,children:[(0,E.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,E.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,E.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,E.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,E.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function j({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=_(e?.jobs,{days:14,cap:n}),i=d(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${u(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${u(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,E.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,E.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,E.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,E.jsx)(`i`,{className:`zero`},e.key))}),(0,E.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,E.jsx)(`span`,{children:u(r[0].key)}),(0,E.jsx)(`span`,{children:u(r[7].key)}),(0,E.jsx)(`span`,{children:`today`})]}),c&&(0,E.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,E.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function M({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,E.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,E.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,E.jsxs)(`li`,{children:[(0,E.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,E.jsx)(S,{vals:e.per_day,i:t,sweep:!0}),(0,E.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,E.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var N={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ne({job:e,longest:t}){let n=c(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=N[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,E.jsxs)(`li`,{className:`act-row`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,E.jsx)(h,{name:`play`,className:`glyph act-glyph`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,E.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,E.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,E.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,E.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function re({gate:e}){return(0,E.jsxs)(`li`,{className:`act-row gate`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,E.jsx)(h,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,E.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,E.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,E.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var P=5,F=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function I(){let[e,t]=(0,T.useState)(null),[n,o]=(0,T.useState)(``),[c,u]=(0,T.useState)(ee),[p,h]=(0,T.useState)(!1),_=e=>{let t={...c,...e};u(t),te(t)};w(e=>r.activity().then(n=>{e()&&(t(n),o(``))},t=>{e()&&o(t.message)}),2e3,[]);let v=g(()=>D(r.jobs()),[]),x=g(()=>D(r.gates()),[]),S=g(()=>D(r.catalog(`laws`)),[]),N=!e||e.enabled!==!1,I=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),L=i(),R=N&&e?I.filter(a).length:null,z=new Set(I.map(e=>e.session_id)),B=(e?.ended||[]).filter(e=>!z.has(e.session_id)),V=F([...I,...B].map(e=>e.host),c.host),H=F([...I,...B].map(e=>s(e.cwd)),c.project),U=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,W=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),G=I.filter(e=>W(e)&&(c.f!==`needs`||a(e))),K=c.f===`all`||c.f===`needs`,q=c.f===`all`&&N?B.filter(W):[],J=p?q:q.slice(0,P),Y=!U&&(c.f===`all`||c.f===`runs`),ie=!U&&(c.f===`all`||c.f===`gates`),X=v.data?.jobs||[],Z=b(x.data,S.data),Q=f(X,Z,x.data?.days).map(e=>({...e,runs:Y?e.runs:[],gate:ie?e.gate:null})).filter(e=>e.runs.length||e.gate),ae=Math.max(0,...X.map(e=>e.duration||0)),oe=d(Q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),se=async()=>{let e=!N;try{let n=await r.activityToggle(e);if(n.ok===!1){o(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),o(``)}catch(e){o(e.message)}},$=(e,t,n)=>(0,E.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,E.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,E.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:c[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>_({[e]:t.target.value}),children:[(0,E.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})]});return(0,E.jsxs)(`div`,{className:`narrow`,children:[(0,E.jsx)(m,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),n&&(0,E.jsx)(`div`,{className:`act-gap`,children:(0,E.jsx)(y,{error:n})}),e&&(0,E.jsx)(A,{enabled:N,onToggle:se}),(0,E.jsxs)(`div`,{className:`act-today`,children:[(0,E.jsx)(j,{jobs:v.data,loading:v.loading}),(0,E.jsx)(M,{rows:Z,gates:x.data,loading:x.loading}),(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,E.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,E.jsxs)(`span`,{className:`act-big act-wait`,children:[R??`—`,` `,(0,E.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,E.jsx)(`p`,{className:`dim act-sm`,children:N?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]})]}),(0,E.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,E.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:k.map(([e,t])=>(0,E.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>_({f:e}),children:[t,e===`needs`&&R>0?(0,E.jsxs)(`span`,{className:`mono`,children:[` `,R]}):null]},e))}),$(`host`,`Host`,V),$(`project`,`Project`,H)]}),U&&c.f!==`needs`&&(0,E.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,U,`; showing sessions only.`]}),K&&(e?!N&&c.f!==`needs`?null:G.length===0?c.f===`needs`?(0,E.jsx)(C,{title:`Nothing waits on you`}):(0,E.jsxs)(C,{title:`No active sessions`,children:[`Run `,(0,E.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,E.jsx)(`div`,{className:`stack gap-12 act-live`,ref:L,children:G.map(e=>(0,E.jsx)(`div`,{"data-flip":e.session_id,children:(0,E.jsx)(O,{s:e})},e.session_id))}):(0,E.jsx)(l,{label:`Reading live sessions…`})),q.length>0&&(0,E.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,E.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),J.map(e=>(0,E.jsx)(`div`,{children:(0,E.jsx)(O,{s:e})},e.session_id)),q.length>P&&(0,E.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":p,onClick:()=>h(e=>!e),children:p?`Show fewer`:`Show all ${q.length}`})]}),c.f!==`needs`&&(0,E.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:oe,children:Q.map(e=>(0,E.jsxs)(`section`,{className:`card act-day`,children:[(0,E.jsxs)(`h3`,{className:`act-day-h`,children:[(0,E.jsx)(`span`,{children:e.title}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,E.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,E.jsx)(ne,{job:e,longest:ae},e.id)),e.gate&&(0,E.jsx)(re,{gate:e.gate})]})]},e.key))})]})}export{I as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-R6epl1PY.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-DMDF5Y3Y.js","assets/api-BfpZmUMI.js","assets/index-BX3zc2Yi.css","assets/OperatorHudView-NW_xAOj1.js","assets/JournalView-DKqMrN35.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{H as l,I as u,J as d,K as f,X as p,at as m,ct as h,ft as g,l as _,lt as v,q as y,st as b,t as x,ut as S,yt as C,z as w}from"./index-DMDF5Y3Y.js";var T=t(n(),1),E={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},D=(e,t)=>e.deployed?t===void 0||t===`good`?E[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,O=r(),k={good:`ok`,warn:`warn`,bad:`bad`};function A({verdict:e}){return e?(0,O.jsxs)(`span`,{className:`badge ${k[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,O.jsx)(`span`,{className:`dot`}),e.head]}):null}function j({overview:e,dataRev:t}){let{data:n}=g(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=b(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,O.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,O.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,O.jsx)(o,{value:t})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,O.jsx)(`div`,{className:`kseg-spacer`}),(0,O.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>C(`#/diff`),title:`Open changes`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,O.jsx)(o,{value:r})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,O.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function M({overview:e}){return(0,O.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,O.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>C(`#/section/`+t),children:[(0,O.jsxs)(`div`,{className:`gtop`,children:[(0,O.jsx)(`span`,{className:`gname`,children:r.label}),(0,O.jsx)(m,{name:r.icon,className:`gicon`})]}),(0,O.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,O.jsx)(o,{value:i})}),(0,O.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function N({jobs:e}){if(!e||e.length===0)return(0,O.jsx)(`div`,{className:`feed`,children:(0,O.jsxs)(`div`,{className:`empty`,children:[(0,O.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=u(e,8);return(0,O.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,O.jsxs)(`div`,{className:`feed-row`,children:[(0,O.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,O.jsx)(`span`,{className:`feed-txt`,children:(0,O.jsx)(`b`,{children:e.action})}),(0,O.jsxs)(`span`,{className:`feed-when`,children:[S(e.started),` ago`]})]},e.id))})}function P({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,O.jsxs)(`div`,{className:`ring-box`,children:[(0,O.jsx)(w,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,O.jsxs)(`div`,{className:`ring-center`,children:[(0,O.jsxs)(`div`,{className:`pct`,children:[n,(0,O.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,O.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function F({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=D(e,i?.tone),s=v(e,n,i?.tone);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,O.jsxs)(`div`,{className:`hero`,children:[(0,O.jsx)(P,{value:s}),(0,O.jsxs)(`div`,{className:`hero-facts`,children:[(0,O.jsx)(`div`,{className:`ttl`,children:o}),(0,O.jsx)(A,{verdict:i?.verdict}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,O.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,O.jsxs)(`div`,{className:`hero-chips`,children:[(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`voice`}),(0,O.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`mode`}),(0,O.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,O.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`built`}),(0,O.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`fp`}),(0,O.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,O.jsx)(j,{overview:e,dataRev:a}),(0,O.jsxs)(`div`,{className:`grid split-status`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Capability genome`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,O.jsx)(M,{overview:e})]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Recent activity`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`badge acc`,children:[(0,O.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,O.jsx)(N,{jobs:r})]})]})]})}function I({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,O.jsxs)(`div`,{className:`strand`,children:[(0,O.jsxs)(`span`,{className:`strand-name`,children:[(0,O.jsx)(`span`,{className:`strand-dot`}),(0,O.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,O.jsx)(`span`,{className:`strand-val`,children:i})]})}function L(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function R({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=h(e.counts),o=n?.version_verdict||``,s=L(o),l=b(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`mb-16`,children:(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,O.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,O.jsxs)(`div`,{className:`lineage-track`,children:[(0,O.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,O.jsxs)(`div`,{className:`lineage-step`,children:[(0,O.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,O.jsx)(`div`,{className:`lt`,children:e}),(0,O.jsx)(`div`,{className:`ld`,children:t}),(0,O.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,O.jsx)(`hr`,{className:`hr`}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,O.jsx)(A,{verdict:i?.verdict}),s&&(0,O.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,O.jsx)(`span`,{className:`dot`}),s.label]}),(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,O.jsxs)(`div`,{className:`grid split-even`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Genome strand`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,O.jsx)(I,{k:t,overview:e,max:a},t))]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Recent activity`})}),(0,O.jsx)(N,{jobs:r})]})]})]})}function z({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=h(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=b(e.diff);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,O.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,O.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`status`}),(0,O.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,O.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,O.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,O.jsx)(A,{verdict:r?.verdict})]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`voice`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`mode`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,O.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,O.jsxs)(`span`,{className:`badge ok`,children:[(0,O.jsx)(`span`,{className:`dot`}),`clean`]}):(0,O.jsxs)(`span`,{className:`badge warn`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`edits`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,O.jsxs)(`div`,{className:`grid split-operator`,children:[(0,O.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,O.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,O.jsx)(`h3`,{children:`Sections`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,O.jsxs)(`table`,{className:`tbl`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`Section`}),(0,O.jsx)(`th`,{children:`Detail`}),(0,O.jsx)(`th`,{style:{width:130},children:`Share`}),(0,O.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,O.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,O.jsxs)(`tr`,{className:`clickable`,children:[(0,O.jsx)(`td`,{className:`name`,children:(0,O.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,O.jsx)(`td`,{className:`muted`,children:n.desc}),(0,O.jsx)(`td`,{children:(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,O.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Run log`})}),(0,O.jsx)(N,{jobs:n})]})]})]})}var B=Symbol(`failed`),V=e=>Promise.resolve().then(e).catch(()=>B);function H({dataRev:e,needDoctor:t}){let n=g(()=>V(()=>i.fleet()),[e]),r=g(()=>t?V(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===B?`failed`:`ok`,s=o===`ok`?a:null,c=s?_(s):null,l=r.data,u=t?l==null?`loading`:l===B?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var U=e({default:()=>q}),W=(0,T.lazy)(()=>x(()=>import(`./GreenhouseView-R6epl1PY.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),G=(0,T.lazy)(()=>x(()=>import(`./OperatorHudView-NW_xAOj1.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),K=(0,T.lazy)(()=>x(()=>import(`./JournalView-DKqMrN35.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function q({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:u}){let m=c,[h,_]=(0,T.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,b=H({dataRev:u,needDoctor:m===`greenhouse`||m===`operator`}),{data:x}=g(()=>m===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[m,u]);if(!e)return t?(0,O.jsx)(y,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,O.jsx)(d,{});let S=e.daemon_stale?(0,O.jsx)(f,{}):null;return e.deployed?h===`status`&&m===`journal`?(0,O.jsxs)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:[S,(0,O.jsx)(K,{overview:e,recent:x,lens:b,onDirection:_,dataRev:u})]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(`div`,{className:`head-row`,children:(0,O.jsx)(p,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,O.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>_(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,O.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&m===`cultivar`&&(0,O.jsx)(F,{overview:e,sigil:v,setup:a,jobs:o,lens:b,dataRev:u}),h===`status`&&m===`greenhouse`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(W,{overview:e,sigil:v,jobs:o,lens:b,onAction:s})}),h===`status`&&m===`operator`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(G,{overview:e,jobs:o,lens:b})}),h===`lineage`&&(0,O.jsx)(R,{overview:e,sigil:v,setup:a,jobs:o,lens:b}),h===`operator`&&(0,O.jsx)(z,{overview:e,setup:a,jobs:o,lens:b})]},h)]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(l,{onAction:s})]})}export{q as default,A as n,D as r,U as t};
@@ -1,4 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{$ as i,J as a,Q as o,U as s,X as c,a as l,at as u,c as d,et as f,ft as p,i as m,n as ee,o as te,q as h,r as g,s as _,yt as v}from"./index-DMDF5Y3Y.js";import{t as y}from"./EmptyState-1sPNleqv.js";import{a as ne,n as re,o as b,r as x,t as S}from"./RailCats-BtIstKaH.js";import{i as C,n as w,r as T}from"./Markdown-DpmmtW2Y.js";var E=e(t(),1);function D(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function O(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
2
- `))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
3
- `),n.join(`
4
- `)]}function k(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||D(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function A(e){let t={ids:new Set,idx:0,toc:[]},n=n=>k(w(n,e?.links),t);if(e?.rows){let[r,i]=O(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var j=n(),M={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},N=`you already know this`,P=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function F(e){e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}let i=document.createElement(`button`);i.type=`button`,i.className=`btn ghost sm`,i.setAttribute(`aria-label`,`Copy command`),i.textContent=`Copy`,n.append(i),e.replaceWith(t),t.append(n,e)})}function I(e){let t=(e.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``);navigator.clipboard?.writeText?.(t)?.catch?.(()=>{})}function L({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,E.useRef)(null),o=(0,E.useMemo)(()=>A({body:e.body,links:e.links}).html,[e.body,e.links]);(0,E.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(N)&&e.classList.add(`analogy`)}),F(e))},[o]),(0,E.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`.docs-code figcaption button`);if(t)return I(t.closest(`.docs-code`));let n=e.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`);r&&r.startsWith(`#/`)&&(e.preventDefault(),v(r))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[o]),(0,E.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=M[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>D(e.textContent||``)===D(i))),o?.classList.add(`docs-here`)},[o,e.id,t?.emit]);let c=[];return e.id===`install`&&(c.push({label:`Run doctor`,action:`doctor`}),c.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&c.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&c.push({label:`Update`,action:`update`}),(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{eyebrow:r&&`${r} · ${P(e.body)} min read`,title:e.title,sub:i,actions:c.length>0&&c.map(e=>e.hash?(0,j.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,j.jsx)(`div`,{className:`doc-meta`,children:(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),e.source]})}),(0,j.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:o}}),e.link&&(0,j.jsx)(`div`,{className:`doc-link`,children:(0,j.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var R=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`),z=1200;function B({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,j.jsxs)(`div`,{className:`cli-arg`,children:[(0,j.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,j.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,j.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function V({text:e}){let[t,n]=(0,E.useState)(!1);return(0,j.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),z)}catch{}},title:`Copy command`,children:[(0,j.jsx)(u,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function H({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,j.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,j.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,j.jsxs)(`div`,{className:`stack gap-4`,children:[(0,j.jsx)(`h2`,{id:R(e.name),children:(0,j.jsx)(`code`,{children:e.name})}),e.help&&(0,j.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,j.jsx)(V,{text:`${t} ${e.name}`})]}),(0,j.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,j.jsxs)(`div`,{className:`cli-block`,children:[(0,j.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,j.jsx)(B,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,j.jsxs)(`div`,{className:`cli-block`,children:[(0,j.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,j.jsx)(B,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function U({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:(0,j.jsxs)(j.Fragment,{children:[`Every subcommand of `,(0,j.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,j.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,j.jsx)(`div`,{children:n.map(e=>(0,j.jsx)(H,{cmd:e,prog:t},e.name))})]})}function W({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:(0,j.jsxs)(j.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,j.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,j.jsx)(`div`,{className:`card pad-md`,children:(0,j.jsxs)(`table`,{className:`glossary-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:`Concept`}),(0,j.jsx)(`th`,{children:`Neutral term`}),(0,j.jsxs)(`th`,{children:[`In `,n]}),(0,j.jsx)(`th`,{children:`Meaning`}),(0,j.jsx)(`th`,{children:`In dev terms`})]})}),(0,j.jsx)(`tbody`,{children:t.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:(0,j.jsx)(`strong`,{children:e.label})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{children:e.neutral||`—`})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,j.jsx)(`td`,{className:`dim`,children:e.desc}),(0,j.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var G={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},K=({text:e})=>(0,j.jsx)(`span`,{dangerouslySetInnerHTML:{__html:T(C.parseInline(e||``))}}),q=({kind:e})=>(0,j.jsx)(`span`,{className:`tag ${G[e]||``}`,children:e});function J({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,E.useState)(0),{before:c,after:l}=(0,E.useMemo)(()=>A(e),[e]);if(!e.rows)return(0,j.jsx)(L,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{eyebrow:r&&`${r} · ${P(e.body)} min read`,title:e.title,sub:i}),(0,j.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}}),(0,j.jsxs)(`div`,{className:`docs-map`,children:[(0,j.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,j.jsx)(`span`,{className:`map-piece`,children:(0,j.jsx)(K,{text:e.piece})}),(0,j.jsx)(q,{kind:e.kind}),(0,j.jsx)(`span`,{className:`mono dim map-cost`,children:(0,j.jsx)(K,{text:e.cost})})]})},t))}),u&&(0,j.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,j.jsx)(`h2`,{children:(0,j.jsx)(K,{text:u.piece})}),(0,j.jsx)(q,{kind:u.kind}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Does`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.does})}),(0,j.jsx)(`dt`,{children:`Costs`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.cost})}),(0,j.jsx)(`dt`,{children:`Turn it off`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.off})})]})]})]}),l.trim()&&(0,j.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function Y(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ie(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,E.useSyncExternalStore)(ie,e,()=>null),ae=5,oe=96,se=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ce(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${se(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ae)break;return r}var le=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function Z({page:e,glossaryRows:t}){let n=e?.body,r=(0,E.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:R(e.name),title:e.name,level:2})):A(e).toc,[e]),i=(0,E.useMemo)(()=>ce(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=oe&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,j.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,j.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,j.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,j.jsx)(`ul`,{children:r.map(e=>(0,j.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,j.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),le(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,j.jsxs)(`div`,{className:`docs-gloss`,children:[(0,j.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,j.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,j.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,j.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function ue({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,j.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,j.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,j.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,j.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,j.jsx)(`div`,{className:`card pad-md mb-18`,children:n.map(([e,t])=>(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:e}),(0,j.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,j.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,j.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),`File an issue`]}),(0,j.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function de({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,j.jsx)(h,{error:t,style:{margin:18}});if(!e)return(0,j.jsx)(a,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,j.jsx)(L,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,j.jsx)(J,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,j.jsx)(U,{page:e});case`glossary`:return(0,j.jsx)(W,{page:e});case`about`:return(0,j.jsx)(ue,{page:e});default:return(0,j.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function fe(){let e=Y(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function pe(){let e=X(fe);return(0,j.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,j.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function me({page:e,overview:t,onAction:n}){let[s,u]=f(i(t?.emit)),{data:v,error:y}=p(()=>r.docs(s),[s]),C=e||Q(v),{data:w,error:T,loading:D}=p(()=>C?r.docsPage(C,s):Promise.resolve(null),[C,s]),{data:O}=p(()=>r.docsPage(`glossary`,s).catch(()=>null),[s],`docs:glossary`);(0,E.useEffect)(()=>{if(v&&C&&!v.groups.some(e=>e.pages.some(e=>e.id===C))){let e=Q(v);e&&e!==C&&window.location.replace(l(e))}},[v,C]),(0,E.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[C]);let k=_(v,C),A=k.part||v?.groups?.[0]||null,M=A?.id===g;(0,E.useEffect)(()=>{M&&w?.id===C&&te(C)},[M,w,C]);let N=M?[...d(),C]:[],[P,F]=(0,E.useState)(``),[I,L]=(0,E.useState)(`all`),[R,z]=(0,E.useState)(A?.id);A?.id!==R&&(z(A?.id),F(``),L(`all`));let B=$(A),V=re(B),H=I===`all`?B:B.filter(e=>e.group===I),U=b(H,P);return y?(0,j.jsx)(h,{error:y}):(0,j.jsx)(`div`,{className:`docs-wrap`,children:(0,j.jsxs)(`div`,{className:`library docs-lib`,children:[(0,j.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,j.jsxs)(`div`,{className:`lib-title`,children:[(0,j.jsx)(`p`,{className:`h`,children:`Docs`}),(0,j.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,j.jsx)(c,{"aria-label":`Harness`,children:o.map(e=>(0,j.jsx)(`button`,{className:s===e.id?`on`:``,onClick:()=>u(e.id),"aria-pressed":s===e.id,children:e.label},e.id))}),(0,j.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(v?.groups||[]).map(e=>(0,j.jsxs)(E.Fragment,{children:[(0,j.jsxs)(`a`,{href:e.pages[0]?l(e.pages[0].id):`#/docs`,className:A?.id===e.id?`on`:``,"aria-current":A?.id===e.id?`page`:void 0,children:[e.label,(0,j.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),A?.id===e.id&&(0,j.jsx)(S,{label:`Sections`,total:B.length,cats:V,cat:I,onChange:L})]},e.id))})]}),(0,j.jsx)(ne,{label:A?.label||`Docs`,count:P.trim()?`${U.length} of ${H.length}`:H.length||``,extra:M&&(0,j.jsx)(m,{pages:A.pages,seen:N}),q:P,onQ:F,matched:U.length,inView:[A?.id,C],children:v?(0,j.jsx)(x,{rows:U,activeName:C,hrefOf:e=>l(e.name),pills:M?e=>N.includes(e.name)&&e.name!==C?(0,j.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,j.jsx)(a,{label:`Loading docs…`})}),(0,j.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[(0,j.jsx)(pe,{}),k.page&&(0,j.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,j.jsx)(`a`,{href:l(k.part.pages[0].id),children:k.part.label}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`a`,{href:l(k.part.pages.find(e=>(e.section||`General`)===k.section).id),children:k.section}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`span`,{"aria-current":`page`,children:k.page.title})]}),(0,j.jsxs)(`div`,{className:`docs-read`,children:[(0,j.jsxs)(`div`,{className:`docs-article`,children:[(0,j.jsx)(de,{data:D?null:w,error:T,overview:t,onAction:n,place:k},`${C}|${s}`),!D&&(0,j.jsx)(ee,{menu:v,pageId:C})]}),!D&&(0,j.jsx)(Z,{page:w,glossaryRows:O?.rows})]})]})]})})}export{me as default,$ as docRows};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{F as a,I as o,P as s,at as c,st as l,ut as u,z as d}from"./index-DMDF5Y3Y.js";import{n as f,r as p}from"./Dashboard-gYZLE4r3.js";e();var m=t(),h=12,g=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],_=650;function v({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let a=e.reduce((e,t)=>e+t.n,0);return(0,m.jsxs)(`div`,{className:`ring-box`,children:[(0,m.jsx)(d,{segments:e,size:t,stroke:r,label:i,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(n,{value:a,duration:_})}),(0,m.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function y(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function b({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=y(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,m.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,m.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function x({label:e,value:t,sub:n,color:r,icon:i}){return(0,m.jsxs)(`div`,{className:`b-tile`,children:[(0,m.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,m.jsx)(c,{name:i})}),(0,m.jsxs)(`div`,{className:`b-tile-body`,children:[(0,m.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,m.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,m.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function S({overview:e,sigil:t,jobs:d,lens:_,onAction:y}){let S=e.counts||{},C=_?.doctor?.state||`loading`,w=_?.doctor?.data?.groups||[],T=C===`ok`,E=w.filter(e=>e.problems.length===0).length,D=w.length,O=p(e,_?.tone),k=o(d,h),A=l(e.diff),j=i.filter(e=>(S[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:S[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),M=j.reduce((e,t)=>e+t.n,0),N=s(d||[],10),P=N.reduce((e,t)=>e+t.v,0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`b-greet`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,m.jsx)(`h2`,{className:`h b-h`,children:O}),(0,m.jsx)(f,{verdict:_?.verdict}),(0,m.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,m.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,m.jsxs)(`div`,{className:`card b-hero`,children:[(0,m.jsx)(`div`,{className:`b-hero-ring`,children:(0,m.jsx)(v,{segments:[{key:`pass`,label:`pass`,n:E,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(D-E,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,m.jsxs)(`div`,{className:`b-hero-side`,children:[(0,m.jsx)(`h3`,{className:`b-hero-title`,children:T?`${E} of ${D} checks pass`:C===`failed`?`Doctor did not answer`:`Checking…`}),C===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>y(`doctor`),children:[(0,m.jsx)(c,{name:`doctor`}),`Run doctor`]}),(0,m.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,m.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),T&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:w.map(e=>{let t=e.problems.length===0;return(0,m.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,m.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,m.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,m.jsxs)(`div`,{className:`b-chips`,children:[(0,m.jsxs)(`span`,{className:`b-chip`,children:[(0,m.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,m.jsx)(`span`,{className:`b-chip`,children:(0,m.jsx)(`b`,{children:e.emit})}),(0,m.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,m.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,m.jsxs)(`div`,{className:`b-tiles`,children:[(0,m.jsx)(x,{label:`Agents`,value:S.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:S.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:S.laws??`—`,sub:S.doctrines?`${S.doctrines.active}/${S.doctrines.total} packs · ${S.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Edits`,value:A,sub:`to graft`,color:g[3],icon:`changes`})]})]}),(0,m.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,m.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Capability mix`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[M,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:j,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:j.map(e=>(0,m.jsxs)(`div`,{className:`b-leg-row`,children:[(0,m.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,m.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,m.jsx)(`span`,{className:`b-leg-bar`,children:(0,m.jsx)(`i`,{style:{width:`${e.n/M*100}%`,background:e.color}})}),(0,m.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent runs`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`badge ok`,children:[(0,m.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,m.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,m.jsx)(`span`,{className:`b-stat-big`,children:(0,m.jsx)(n,{value:P})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,T&&D>0&&` · ${E}/${D} checks pass now`]})]}),(0,m.jsx)(b,{data:N,accent:g[0],height:156})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent activity`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[`last `,k.length,` runs`]})})]}),(0,m.jsxs)(`div`,{className:`b-timeline`,children:[k.map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`,r=a(e);return(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,m.jsxs)(`div`,{className:`b-tl-body`,title:r.command||void 0,children:[(0,m.jsx)(`b`,{children:r.verb}),[r.scope,r.result,r.duration].map(e=>e?` · ${e}`:``).join(``)]}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:e.started?`${u(e.started)} ago`:`—`})]},e.id)}),(!d||d.length===0)&&(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node`}),(0,m.jsx)(`div`,{className:`b-tl-body sub`,children:`No runs yet. Trigger an action to populate this.`}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:`—`})]})]})]})]})}export{S as default};
@@ -1,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,R as o,U as s,X as c,Y as l,Z as u,at as d,ft as f,gt as p,ht as m,it as h,mt as g,nt as _,ot as v,pt as y,q as b,rt as x,st as S,tt as C,ut as w,vt as T}from"./index-DMDF5Y3Y.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-DQLuylEi.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-DCBS0ZWz.js";var F=e(t(),1),I=n();function L({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:C.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function R(){let{data:e,error:t,reload:n}=f(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,I.jsx)(d,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function z({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var B={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ee({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${_(e.host).label} · ${e.scope}`,[h,g]=B[e.state]||B.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:x(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(z,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(R,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var V=(e,t)=>`${e} ${t}`,te=[`claude`,`bob`,`openclaude`],H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]};function ne(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?S(e.drift):0;return i?`${r} · ${i} edited`:r}function re({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?S(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(o,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,I.jsx)(`span`,{className:`dim`,children:ne(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=H[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,I.jsx)(`td`,{children:_(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`tag ${c}`,children:i})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(re,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function U({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:c}){let l=u(),{data:p,error:m,reload:g}=f(()=>r.installs(),[s]),{data:v,error:y,reload:x}=f(()=>r.mcp(),[s]),{data:S,error:C}=f(()=>r.fleet(),[s]),w=C?null:S??void 0,[T,D]=(0,F.useState)(null),[O,k]=(0,F.useState)(``),[A,j]=(0,F.useState)({}),[M,P]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),B=e=>R.id===e?.id?R.value:`keep`,[H,ne]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=V(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(m||y)return(0,I.jsx)(b,{error:m||y,onRetry:()=>{g(),x()}});if(!p||!v)return(0,I.jsx)(a,{});let U={active:0,disabled:1,absent:2},W=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(U[e.state]??3)-(U[t.state]??3)),G=W.find(e=>e.id===H)||W.find(e=>e.selected)||W.find(e=>e.state===`active`)||W[0],K=e=>{let t=A[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},se=(e,t,n)=>j(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),q=e=>{let t=K(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},ce=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=K(t),s=_(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await l(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},le=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){k(e.id),D(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;D({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}c?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&te.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ue=async e=>{let t=B(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${h(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){k(e.id),D(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){D({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&D({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),c?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},de=async e=>{D(null);try{let t=await r.mcpReveal(e.path);D({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){D({text:e.message,tone:`bad`})}},fe=W.find(e=>e.selected)?.host||W.find(e=>e.state===`active`)?.host||W[0]?.host||`opencode`,X=W.filter(e=>e.scope===`global`),Z=W.filter(e=>e.scope!==`global`),Q=e=>{ne(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}c?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[W.filter(e=>e.state===`active`).length,` active of `,W.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>e(`build-all`),children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,I.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:G?.id,onPick:Q,label:`Global installs`,fleet:w,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>P(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),M?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(L,{host:fe,theme:n||`neutral`,options:J,onAction:e,onClose:()=>P(!1),onNote:e=>D(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:G?.id,onPick:Q,label:`Per-project installs`,fleet:w,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:o,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),G?(0,I.jsx)(ee,{inst:G,targets:re[V(G.host,G.path)]||[],choice:K(G),unchanged:q(G),options:J,onPick:(e,t)=>se(G,e,t),canAct:!!e,busy:O===G.id,memory:B(G),onMemory:e=>z({id:G.id,value:e}),onApply:()=>ce(G),onToggleInstall:()=>le(G),onRemove:()=>ue(G),onRevealMcp:de},G.id):null]})}function W({onAction:e,dataRev:t}){let{data:n,error:i}=f(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(b,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[n.skills.length,` skills · `,n.agents.length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(a,{})}function G(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var K=300;function se({onMutated:e,onAction:t,dataRev:n,overview:i}){let o=u(),{data:s,error:c,reload:l}=f(()=>r.diff(),[n]),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,x]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(s&&s!==S){C(s),v(new Set);let e=s.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=K?s.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>s.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
2
- `)}\n\n`:``;if(await o(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;g(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await l(),e?.()}catch(e){g(e.message)}finally{m(!1)}}};if(c)return(0,I.jsx)(b,{error:c,onRetry:l});if(!s)return(0,I.jsx)(a,{});if(!s.deployed)return(0,I.jsx)(E,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!s.diffable)return(0,I.jsx)(E,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=s.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=s.files.filter(e=>e.status===`linked`),j=s.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),s.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:s.target}),s.theme?` (${s.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,M>0?(0,I.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:p||_.size===0,onClick:O,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:p,onClick:D,children:[(0,I.jsx)(d,{name:`download`}),`Export improvements`]})]})]}),h?(0,I.jsx)(`p`,{className:`sub mb-14`,children:h}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
3
- `),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(E,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(s.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:_.size===k.length,onChange:T}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>R(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:p,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=y.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(d,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${G(e)}`,children:e},t))})]},e.rel)}}function q({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(d,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function J({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:i,reload:o,setData:s}=f(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),o()};if(i)return(0,I.jsx)(b,{error:i,onRetry:o});let l=n?n.groups.filter(e=>e.problems.length):[],u=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`narrow`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,I.jsx)(d,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[l.map((e,t)=>(0,I.jsx)(q,{group:e,i:t},e.label)),u.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[u.length,` clean check`,u.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:u.map((e,t)=>(0,I.jsx)(q,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,I.jsx)(a,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ce(){let e=u(),[t,n]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:i}),(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){a(null);try{await r.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,I.jsx)(d,{name:`x`}),`Stop server`]})]})}function le(){let e=u(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:r}),(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await m()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(d,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Y=`https://github.com/Arylmera/Geneseed`,ue=`https://github.com/Arylmera`,de=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],fe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:de.map(([n,r])=>(0,I.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,I.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function $({version:e}){let[t,n]=(0,F.useState)(Y),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(d,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`MIT License`]})]})]}),children:(0,I.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:ue,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function pe({overview:e,onAction:t,flavour:n,onFlavour:r,accentMode:i,onAccentMode:a,layout:o,onLayout:s}){let f=u(),m=e?.install,h=e?.footprint,v=e?.server,b=e?.daemon_stale,x=async e=>{m&&e!==h&&await f(`Rebuild ${_(m.host).label} · ${m.scope} with the “${e}” footprint? It rebuilds in place, non-destructive.`,{title:`Change the footprint?`,confirmLabel:`Rebuild`})&&t?.(`install`,{...m,footprint:e})},S=v?.autostart===!0?`On · login script`:v?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:T.server}),(0,I.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]})}),(0,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{stale:b}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&r&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-skin-label`,children:p.map(e=>(0,I.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>r(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:p.find(e=>e.id===n)?.tagline??``})]}),i&&a&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(l,{value:i,onChange:a,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(i)})]}),o&&s&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-layout-label`,children:y.map(e=>(0,I.jsx)(`button`,{className:o===e.id?`on`:``,onClick:()=>s(e.id),"aria-pressed":o===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:y.find(e=>e.id===o)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:(0,I.jsxs)(`button`,{className:`btn`,onClick:()=>t(`update`),children:[(0,I.jsx)(d,{name:`download`}),`Update (git pull + rebuild)`]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(d,{name:`external`}),`Add to PATH`]})}),m&&h&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`footprint-label`,children:`Harness footprint`}),help:(0,I.jsxs)(I.Fragment,{children:[`For `,_(m.host).label,` · `,m.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),children:[(0,I.jsx)(c,{"aria-labelledby":`footprint-label`,children:[`lean`,`full`].map(e=>(0,I.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>x(e),"aria-pressed":h===e,children:e},e))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:h===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,I.jsxs)(Z,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,v?` · pid ${v.pid} · up ${w(v.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(le,{}),children:b?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:S})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:fe.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ce,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function me({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?v(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(D,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(U,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(W,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(se,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(J,{dataRev:o}),e===`server`&&(0,I.jsx)(pe,{overview:t,onAction:i,...c})]})}export{me as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{J as i,L as a,U as o,ft as s,q as c}from"./index-DMDF5Y3Y.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-DCBS0ZWz.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=({type:e,names:t,listed:n})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:`Installed when this kit is on`,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function E({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[];return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(T,{type:`skill`,names:e.skills||[],listed:r?.skills}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(T,{type:`agent`,names:e.agents||[],listed:r?.agents}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var D=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,O=e=>`${e.host} · ${e.scope}`;function k(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function A({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...k(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=`on in ${u} of ${D(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(T,{type:`skill`,names:s,listed:r?.skills}):null,c.length?(0,b.jsx)(T,{type:`agent`,names:c,listed:r?.agents}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${O(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${O(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function j({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:O(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=k(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${O(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function M({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${D(a,`change`)} on ${D(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[O(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${O(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${O(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function N({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=s(()=>r.kits(),[n]),d=h(a,t),{data:f}=s(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(E,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(i,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${D(p.length,`kit`)} · ${D(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(A,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(j,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(M,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{N as default};