geneseed 5.3.0 → 5.3.1

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 (96) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +2 -2
  3. package/SHIPPED.md +1 -1
  4. package/adapters/bob/README.md +31 -18
  5. package/adapters/claude-code/README.md +27 -22
  6. package/adapters/openclaude/README.md +18 -8
  7. package/adapters/opencode/HOW-OPENCODE-LOADS.md +8 -3
  8. package/adapters/opencode/plugins/geneseed-activity.js +20 -21
  9. package/adapters/opencode/plugins/geneseed-context.js +169 -62
  10. package/adapters/opencode/plugins/geneseed-guard.js +414 -202
  11. package/adapters/opencode/plugins/geneseed-workflow.js +3 -2
  12. package/adapters/opencode/workflows/_runtime.js +3 -2
  13. package/bin/geneseed-hook.mjs +57 -9
  14. package/docs/concepts/enforcement-table.md +1 -1
  15. package/docs/concepts/exclusions.md +2 -2
  16. package/docs/concepts/footprint.md +10 -0
  17. package/docs/concepts/hook-gates.md +3 -3
  18. package/docs/concepts/host-matrix.md +22 -4
  19. package/docs/design-history.md +8 -0
  20. package/docs/extending.md +49 -7
  21. package/docs/guides/install-bob.md +2 -2
  22. package/docs/guides/install-openclaude.md +1 -1
  23. package/docs/guides/verify.md +12 -0
  24. package/docs/reference/environment.md +1 -0
  25. package/docs/reference/troubleshoot-doctor.md +1 -1
  26. package/docs/token-footprint.md +66 -2
  27. package/docs/understand/design-choices-hosts.md +1 -1
  28. package/docs/understand/design-choices-shape.md +1 -0
  29. package/docs/understand/enforced-vs-asked.md +1 -1
  30. package/docs/understand/machine-bob.md +1 -1
  31. package/docs/web-ui.md +5 -0
  32. package/harness.config.json +1 -1
  33. package/js/README.md +3 -2
  34. package/js/build/args.mjs +1 -1
  35. package/js/build/driver.mjs +1 -1
  36. package/js/build/emit-claude.mjs +1 -1
  37. package/js/build/generate.mjs +5 -14
  38. package/js/hosts/done-checks.mjs +6 -0
  39. package/js/hosts/geneseed-dir.mjs +3 -2
  40. package/js/hosts/gitref.mjs +5 -3
  41. package/js/hosts/hook-tap.mjs +104 -0
  42. package/js/hosts/hooks-context.mjs +4 -2
  43. package/js/hosts/hooks-learn.mjs +47 -16
  44. package/js/hosts/hooks.mjs +19 -13
  45. package/js/hosts/hosts.mjs +80 -12
  46. package/js/hosts/installs.mjs +7 -0
  47. package/js/hosts/native.mjs +14 -5
  48. package/js/hosts/owned.mjs +7 -6
  49. package/js/hosts/ownership-gate.mjs +14 -1
  50. package/js/hosts/settings.mjs +245 -103
  51. package/js/hosts/shim.mjs +4 -4
  52. package/js/hosts/usage.mjs +9 -3
  53. package/js/inspect/checks-probe.mjs +66 -5
  54. package/js/inspect/checks-repo.mjs +196 -2
  55. package/js/inspect/cost.mjs +34 -2
  56. package/js/inspect/doctor.mjs +6 -1
  57. package/js/lib/machine-dir.mjs +1 -1
  58. package/js/lib/node-floor.mjs +46 -6
  59. package/js/maintain/uninstall.mjs +42 -16
  60. package/js/web/actions.mjs +1 -9
  61. package/package.json +1 -1
  62. package/web/dist/assets/Activity-WQ3ykgxU.js +1 -0
  63. package/web/dist/assets/{ActivityDetail-BSzevynX.js → ActivityDetail-7rt04SkS.js} +1 -1
  64. package/web/dist/assets/{Bonsai-Bfpb6W-1.js → Bonsai-BBl4XXqs.js} +1 -1
  65. package/web/dist/assets/{CopyButton-ByIntFtB.js → CopyButton-Beven8yn.js} +1 -1
  66. package/web/dist/assets/Dashboard-BgLArtgu.js +2 -0
  67. package/web/dist/assets/{Docs-DvlMJhpu.js → Docs-B5aHp86J.js} +3 -3
  68. package/web/dist/assets/Factories-BjqzXAw8.js +1 -0
  69. package/web/dist/assets/GreenhouseView-Bce212qd.js +1 -0
  70. package/web/dist/assets/{Installs-BlGmVrFK.js → Installs-B1OsrHXF.js} +3 -3
  71. package/web/dist/assets/JournalView-CV4omyww.js +1 -0
  72. package/web/dist/assets/{Kits-DRwpxC-J.js → Kits-CW1e7xNa.js} +1 -1
  73. package/web/dist/assets/{Laws-CZkiNOWQ.js → Laws-1Ckf1lbs.js} +2 -2
  74. package/web/dist/assets/{LibRows-DEHjIoD-.js → LibRows-Dag1s0ZX.js} +1 -1
  75. package/web/dist/assets/Library-B3FuFLel.js +3 -0
  76. package/web/dist/assets/Loops-CwqgnLNw.js +2 -0
  77. package/web/dist/assets/Markdown-CxkA7940.js +71 -0
  78. package/web/dist/assets/OperatorHudView-JmYY1pBR.js +1 -0
  79. package/web/dist/assets/{Personal-Bp9nV4GR.js → Personal-DKLgLa7Z.js} +2 -2
  80. package/web/dist/assets/Settings-BwErnh-R.js +1 -0
  81. package/web/dist/assets/{Tabs-CWeQTADL.js → Tabs-8zsyEPSK.js} +1 -1
  82. package/web/dist/assets/{index-CsAZq0BQ.css → index-CRWqKxfY.css} +1 -1
  83. package/web/dist/assets/index-Ce6qF2nG.js +6 -0
  84. package/web/dist/index.html +2 -2
  85. package/adapters/claude-code/settings.json +0 -52
  86. package/web/dist/assets/Activity-CqJiquEq.js +0 -1
  87. package/web/dist/assets/Dashboard-DBOEi9lQ.js +0 -2
  88. package/web/dist/assets/Factories-Bpvv7L2H.js +0 -1
  89. package/web/dist/assets/GreenhouseView-GpBsYn50.js +0 -1
  90. package/web/dist/assets/JournalView-iLuLrOxE.js +0 -1
  91. package/web/dist/assets/Library-B4K-1iNF.js +0 -3
  92. package/web/dist/assets/Loops-BWSzaW8E.js +0 -2
  93. package/web/dist/assets/Markdown-0ORz7tAc.js +0 -69
  94. package/web/dist/assets/OperatorHudView-BAXwCEvY.js +0 -1
  95. package/web/dist/assets/Settings-CWWuaIp-.js +0 -1
  96. package/web/dist/assets/index-How7SzDZ.js +0 -6
@@ -0,0 +1,6 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-BgLArtgu.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/api-DLDVY3K-.js","assets/sections-CtFz7HFH.js","assets/motion-RlUl1osO.js","assets/Activity-WQ3ykgxU.js","assets/EmptyState-CY5Pm2xy.js","assets/Bonsai-BBl4XXqs.js","assets/usePoll-D5c_qIFZ.js","assets/ActivityDetail-7rt04SkS.js","assets/Library-B3FuFLel.js","assets/LibRows-Dag1s0ZX.js","assets/FilterInput-qGKNSlxv.js","assets/Kits-CW1e7xNa.js","assets/Markdown-CxkA7940.js","assets/DataTable-b9zTShqJ.js","assets/controls-D4wmg_pl.js","assets/Loops-CwqgnLNw.js","assets/CopyButton-Beven8yn.js","assets/ActiveLoops-BJJN3P-V.js","assets/Factories-BjqzXAw8.js","assets/Laws-1Ckf1lbs.js","assets/Personal-DKLgLa7Z.js","assets/Tabs-8zsyEPSK.js","assets/Installs-B1OsrHXF.js","assets/Settings-BwErnh-R.js","assets/Docs-B5aHp86J.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,n,r,t as i}from"./react-C1iE8mnY.js";import{t as a}from"./api-DLDVY3K-.js";import{A as o,D as s,G as c,I as l,L as u,M as d,N as f,O as p,R as m,S as h,T as g,V as _,W as v,a as y,b,c as x,d as S,f as C,i as w,k as ee,l as T,m as te,n as E,o as D,p as O,q as k,r as A,t as j,y as M,z as N}from"./motion-RlUl1osO.js";import{i as P,n as F,r as I,t as ne}from"./sections-CtFz7HFH.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var L=(e,t)=>{if(N(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},re=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),f(t))return n;if(o(+t))return+t;let r=t,i=e?e.labels:null,a=!ee(i),s=L(e,r),l=!f(s),u=c.exec(r);if(u){let e=u[0],t=r.split(e),o=a&&t[0]?i[t[0]]:n,c=l?s:a?o:n,d=+t[1];return b(c,d,e[0])}return l?s:a?f(i[r])?n:i[r]:n},ie=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},ae=0,oe=(e,t=0,n=1,r=0)=>{let i=e===void 0?ae++: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}},se=(e,t=ie)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},R=(e,t={})=>{let n=[],r=0,i,a=null,c=t.from,_=t.reversed,v=t.ease,y=!f(v),b=y&&!f(v.ease)?v.ease:y?C(v):null,x=t.grid,S=x===!0,w=t.axis,ee=t.total,T=f(c)||c===0||c===`first`,E=c===`center`,D=c===`last`,O=c===`random`,A=s(c),j=s(e),N=t.use,P=l(j?e[0]:e),F=j?l(e[1]):0,I=k.exec((j?e[1]:e)+``),ne=t.start||0+(j?P:0),L=t.seed,ae=!f(L)&&L!==!1?oe(L===!0?0:L):ie,R=t.jitter,ce=!f(R),le=s(R),ue=le?R[0]:R||0,de=le?R[1]:R||0,z=T?0:o(c)?c:0;return(e,s,l,v,y)=>{let[C]=te(e),T=f(ee)?l.length:ee,k=f(N)?!1:p(N)?N(C,s,T):M(C,N),L=o(k)||d(k)&&o(+k)?+k:s,ie=L>=0&&L<T?L:s;if(E&&(z=(T-1)/2),D&&(z=T-1),!n.length){if(S){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,u=-1/0,d=-1/0,f=[],g=[],_=[];for(let n=0;n<T;n++){let c=l[n],m=0,h=0,v=0,y=!1;if(c&&p(c.getBoundingClientRect)){let e=c.getBoundingClientRect();m=e.left+e.width/2,h=e.top+e.height/2,y=!0}else{let e=c;e&&o(e.x)&&o(e.y)&&(m=e.x,h=e.y,o(e.z)&&(v=e.z,t=!0),y=!0)}if(!y){e=!1;break}f.push(m),g.push(h),_.push(v),m<r&&(r=m),h<i&&(i=h),v<a&&(a=v),m>s&&(s=m),h>u&&(u=h),v>d&&(d=v)}if(e){let e=f[0],l=g[0],p=_[0];A?(e=r+c[0]*(s-r),l=i+c[1]*(u-i),p=t?a+(c.length>=3?c[2]:.5)*(d-a):0):E?(e=(r+s)/2,l=(i+u)/2,p=(a+d)/2):D?(e=f[T-1],l=g[T-1],p=_[T-1]):o(c)&&(e=f[c],l=g[c],p=_[c]);for(let r=0;r<T;r++){let i=e-f[r],a=l-g[r],o=p-_[r],s=m(i*i+a*a+(t?o*o:0));w===`x`&&(s=-i),w===`y`&&(s=-a),w===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<T;e++){let t=h(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<T;e++)n[e]=n[e]/v}else for(let e=0;e<T;e++)n.push(h(z-e))}else for(let e=0;e<T;e++)if(!x)n.push(h(z-e));else{let t=x.length,r=x[0]*x[1],i,a,o;A?(i=c[0]*(x[0]-1),a=c[1]*(x[1]-1),o=t===3?(c.length>=3?c[2]:.5)*(x[2]-1):0):E?(i=(x[0]-1)/2,a=(x[1]-1)/2,o=t===3?(x[2]-1)/2:0):(i=z%x[0],a=g(z/x[0])%x[1],o=t===3?g(z/r):0);let s=e%x[0],l=g(e/x[0])%x[1],u=t===3?g(e/r):0,d=i-s,f=a-l,p=o-u,h=m(d*d+f*f+(t===3?p*p:0));w===`x`&&(h=-d),w===`y`&&(h=-f),w===`z`&&(h=-p),n.push(h)}r=n[0];for(let e=1;e<T;e++)n[e]>r&&(r=n[e]);if(b||_)for(let e=0;e<T;e++){let t=n[e];b&&(t=b(t/r)*r),_&&(t=w?-t:h(r-t)),n[e]=t}if(ce){a=Array(T);for(let e=0;e<T;e++)a[e]=ae(-1,1,4)}O&&(n=se(n,ae))}let oe=j?(F-P)/r:P;f(i)&&(i=y?re(y,f(t.start)?y.iterationDuration:ne):ne);let R=i+(oe*u(n[ie],2)||0);if(ce){let e=r?n[ie]/r:0,t=ue+(de-ue)*e;R+=a[ie]*t}return t.modifier&&(R=t.modifier(R)),I&&(R=`${R}${I[2]}`),R}},ce=e=>{let t=1;if(e&&e.getCTM){let n=e.getCTM();n&&(t=(m(n.a*n.a+n.b*n.b)+m(n.c*n.c+n.d*n.d))/2)}return t},le=(e,t,n)=>{let r=_,i=getComputedStyle(e),a=i.strokeLinecap,o=i.vectorEffect===`non-scaling-stroke`?e:null,s=a,c=new Proxy(e,{get(e,t){let n=e[t];return t===v?e:t===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),i=+n[0],c=+n[1],l=ce(o),u=i*-r*l,d=c*r*l+u,f=r*l+(i===0&&c===1||i===1&&c===0?0:10*l)-d;if(a!==`butt`){let t=i===c?`butt`:a;s!==t&&(e.style.strokeLinecap=`${t}`,s=t)}e.setAttribute(`stroke-dashoffset`,`${u}`),e.setAttribute(`stroke-dasharray`,`${d} ${f}`)}return Reflect.apply(n,e,t)}:p(n)?(...t)=>Reflect.apply(n,e,t):n}});return e.getAttribute(`pathLength`)!==`${r}`&&(e.setAttribute(`pathLength`,`${r}`),c.setAttribute(`draw`,`${t} ${n}`)),c},ue=(e,t=0,n=0)=>O(e).map(e=>le(e,t,n)),de=r(),z=n(),B=e(t(),1),fe={overview:`Overview`,laws:`Constitution`,library:`Library`,kits:`Kits`,loops:`Loops`,factories:`Factories`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`,settings:`Settings`},pe={loops:[`templates`,`bricks`,`active`],factories:[`templates`,`active`],personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`edits`,`doctor`]},me={templates:`Templates`,bricks:`Bricks`,active:`Active`,rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,edits:`Local edits`,doctor:`Doctor`},he={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`],about:[`settings`]},ge={kits:`kits`,server:`settings`},_e=(e,t)=>t!==void 0&&Object.hasOwn(e,t),ve=(e,t)=>pe[e].includes(t)?t:pe[e][0];function ye(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`&&_e(P,r)?P[r]:r,t=n===`item`?a(i):void 0;return e===`memory`||e===`notebook`?t?{page:`personal`,tab:e,item:t}:{page:`personal`,tab:e}:{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(n===`installs`&&_e(ge,r))return{page:ge[r]};if(_e(pe,n)){let e=ve(n,r);return i&&e===r?{page:n,tab:e,item:a(i)}:{page:n,tab:e}}if(_e(he,n)){let[e,t]=he[n];return t?{page:e,tab:t}:{page:e}}return{page:_e(fe,n)?n:`overview`}}var be=new Set;function xe(e){return be.add(e),()=>be.delete(e)}function Se(){let e=()=>ye(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 be)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=`${fe[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 Ce=e=>{window.location.hash=e},we={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},Te={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},Ee=e=>we[e]||we.cyan,De={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`};function Oe(e,t,n){if(!e)return;let r=n===`light`,i=r?Te[t]||Te.cyan:Ee(t);r&&t===`white`&&(i=`#566B62`);let a=r?De[t]||De.cyan:i;Ke(e,He(i,Te[t]||Te.cyan,Ne,a,r),r)}var ke={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 Ae(e,t,n){let r=ke[t];if(!e||!r)return!1;let i=n===`light`,a=i?r.light:r.dark;return Ke(e,He(a,r.light,r.ink,a,i),i),!0}var je={dark:{worst:`#232A31`,soft:[`#14181D`,`#1B2026`,`#11151A`,`#171C22`,`#0B1116`,`#121A21`,`#1C1A12`,`#211E15`]},light:{worst:`#EBE6D8`,soft:[`#FBFDFC`,`#F3F6F6`,`#F4F6F8`,`#E9F4ED`,`#FCFAF4`,`#F6F2E7`]}},Me=.13,Ne=`#06100D`,Pe=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},Fe=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),Ie=e=>{let[t,n,r]=Pe(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},Le=(e,t)=>{let[n,r]=[Ie(e),Ie(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},Re=(e,t,n)=>{let r=Pe(e),i=Pe(t);return Fe(r.map((e,t)=>e+(i[t]-e)*n))},ze=(e,t,n,r)=>{let i=e=>Math.min(...[].concat(t).map(t=>Le(e,t))),a=e;for(let t=.05;i(a)<n&&t<=1.0001;t+=.05)a=Re(e,r,t);return a},Be=e=>{let[t,n,r]=Pe(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}},Ve=(e,t)=>{let n=Math.abs(e-t)%360;return n>180?360-n:n};function He(e,t,n,r,i){let a=i?`#000000`:`#FFFFFF`,o=e=>Le(e,n)>=Le(e,`#FFFFFF`)?n:`#FFFFFF`,s=Le(e,o(e))>=4.5?e:ze(e,i?`#FFFFFF`:n,4.5,a),c=i?je.light:je.dark,l=[c.worst,...c.soft.map(e=>Re(e,s,Me))];return{accent:s,accent2:t,ink:o(s),text:ze(r,l,4.5,a)}}var Ue=39,We={dark:[`#FF8A4C`,`#FF8A4C`],light:[`#B4441F`,`#9B3A1B`]};function Ge(e,t,n){let[r,i]=n?We.light:We.dark,{h:a,s:o}=Be(t),s=Ve(a,Ue);o>=.15&&s<=29&&Ve(a,Be(r).h)>s?(e.style.setProperty(`--warn`,r),e.style.setProperty(`--warn-text`,i)):(e.style.removeProperty(`--warn`),e.style.removeProperty(`--warn-text`))}function Ke(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),Ge(e,t.accent,n)}var qe=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function Je(e,t){let n=t===`light`,r=n?je.light:je.dark,i=n?`#000000`:`#FFFFFF`,a=ze(e,r.worst,3,i);return He(a,ze(a,r.worst,4.5,i),Ne,a,n)}function Ye(e,t,n){return!e||!qe(t)?!1:(Ke(e,Je(t,n),n===`light`),!0)}function V(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 Xe=`geneseed-mode`;function Ze(){let[e,t]=V(Xe,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var Qe=`geneseed-flavour`,$e=[{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.`}],et=new Set($e.map(e=>e.id)),tt={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 nt(){return V(Qe,rt)}function rt(e){return et.has(e)?e:tt[e]||`cultivar`}var it=()=>window.location.reload(),at=1e3,ot=e=>new Promise(t=>setTimeout(t,e));async function st(){try{return(await a.ping()).pid??null}catch{return null}}async function ct(e=0,t=null){await ot(e);for(let e=0;e<30;e++){let e=await st();if(e!==null&&e!==t)break;await ot(at)}it()}async function lt(){let e=await st();try{await a.restart()}catch(e){if(e.status)throw e}await ct(at,e)}var ut=`geneseed-accent`,dt=[{id:`curated`,short:`Curated`,tagline:`Each skin's own signature colour.`}],ft=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:Ee(e),tagline:`${t}, whatever the voice, until the skin changes.`})),pt=[...dt,...ft],mt=new Set(pt.map(e=>e.id)),ht=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return qe(t)?t.toUpperCase():null},gt=e=>e&&(mt.has(e)||ht(e))?e:`curated`,_t=e=>ft.find(t=>t.id===e)?.name??null,vt=e=>{let t=ht(e);return t?`Your own colour, ${t}.`:pt.find(t=>t.id===e)?.tagline??``};function yt(){return V(ut,gt)}var bt=`geneseed-layout`,xt=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`genome`,short:`Genome`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`hud`,short:`HUD`,tagline:`Dense instrument panel & check matrix.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],St=new Set(xt.map(e=>e.id)),Ct={cultivar:`genome`,operator:`hud`};function wt(e){return Object.hasOwn(Ct,e??``)?Ct[e]:e&&St.has(e)?e:`overview`}function Tt(){return V(bt,wt)}var Et=1500;function Dt(e,t){let[n,r]=(0,B.useState)(null),[i,o]=(0,B.useState)(null),[s,c]=(0,B.useState)([]),[l,u]=(0,B.useState)(0),d=()=>a.overview().then(e=>{r(e),o(null)}),f=()=>d().catch(t=>{o(t?.body?.message||t?.message||String(t)),e?.(t)}),p=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{if(n?.doctor===null){p.current=!0;let e=setTimeout(()=>d().catch(()=>u(e=>e+1)),Et);return()=>clearTimeout(e)}p.current&&(p.current=!1,t?.())},[n,l]),(0,B.useEffect)(()=>{f()},[]),(0,B.useEffect)(()=>{a.themes().then(e=>c(e.themes)).catch(()=>{})},[]),{overview:n,error:i,themes:s,reload:f}}var Ot=600;function kt({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&&st().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`){ct(2e3,c);return}e?.(t.status)}}catch{if(!s)return;clearInterval(l),ct(0,c)}},Ot);return()=>clearInterval(l)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n,i)=>{try{let{job_id:t,restarts:s}=await a.action(e,n,i),l=n?.emit||i?.host,u=e===`build`&&n?.theme?`build (${n.theme}${l?` · ${l}`:``})`:e;return r(e=>[...e,{id:t,action:u,status:`running`,output:``,started:Date.now()/1e3,restarts:!!s}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>a.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var H=new Map,At=new Map,jt=new Map;function Mt(e){for(let t of[H,jt])for(let n of t.keys())n.startsWith(`${e}|`)&&t.delete(n)}function U(e,t=[],n=null,{revalidate:r=!1}={}){let i=n===null?null:`${n}|${t.join(``)}`,[a,o]=(0,B.useState)(()=>i!==null&&H.has(i)?H.get(i):null),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(()=>!(i!==null&&H.has(i))),d=(0,B.useRef)(e),f=(0,B.useRef)(i);(0,B.useLayoutEffect)(()=>{d.current=e,f.current=i});let p=(0,B.useRef)(0),m=(0,B.useCallback)(e=>{let t=++p.current,n=()=>t===p.current;u(!0),c(``);let r=f.current,i=e?jt.get(r):void 0;if(!i&&(i=Promise.resolve(d.current()),r!==null)){let e=i,t=()=>{jt.get(r)===e&&jt.delete(r)};jt.set(r,e),e.then(t,t)}return i.then(e=>{if(n()&&(o(e),r!==null)){H.set(r,e);for(let t of At.get(r)||[])t(e)}}).catch(e=>{n()&&c(e.message)}).finally(()=>{n()&&u(!1)})},t),h=(0,B.useCallback)(()=>m(!1),[m]);return(0,B.useEffect)(()=>{let e=f.current;return e!==null&&(At.has(e)||At.set(e,new Set),At.get(e).add(o)),e!==null&&H.has(e)&&(p.current++,o(H.get(e)),c(``),u(!1),!r)||m(!0),()=>At.get(e)?.delete(o)},[m]),{data:a,error:s,loading:l,reload:h,setData:o}}var Nt=60,Pt=3600,Ft=86400,It={seconds:90,minutes:5400,hours:36*Pt};function Lt(e){let t=Math.max(0,Date.now()/1e3-e);return t<It.seconds?`${Math.round(t)}s`:t<It.minutes?`${Math.round(t/Nt)}m`:t<It.hours?`${Math.round(t/Pt)}h`:`${Math.round(t/Ft)}d`}var W={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15},Rt={warn:W.deployed+W.doctorClean,bad:W.deployed};function zt(e,t,n){if(!e)return 0;let r=e.doctor?.problems?.length??(e.doctor===null?0:99),i=e.doctor?.ok?W.doctorClean:r<=W.doctorMinorMax?W.doctorMinor:W.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp,o=(e.deployed?W.deployed:0)+i+(a?W.versionSynced:0)+(e.diff&&e.diff.missing===0?W.diskClean:0);return Math.min(o,Rt[n]??1)}var Bt=e=>Math.max(...I.map(t=>e?.[t]??0),1),Vt=e=>(e?.edited??0)+(e?.added??0),Ht=e=>Vt(e)+(e?.missing??0),Ut=e=>(e?.laws??0)+(e?.doctrines?.rules??0),Wt=e=>ne.reduce((t,n)=>t+(e?.[n]??0),0),G=i(),Gt={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,loop:`M19.5 9A8 8 0 1 1 15 4.6M15 1.5l.2 3.3-3.2.8`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,check:`M5 12.5l4.5 4.5L19 7`,flask:`M9 3h6M10 3v6l-5.4 9.2A1.9 1.9 0 0 0 6.2 21h11.6a1.9 1.9 0 0 0 1.6-2.8L14 9V3M7.5 15h9`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,kit:`M21 8l-9-5-9 5v8l9 5 9-5V8ZM3 8l9 5 9-5M12 13v8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function K({name:e,className:t=`glyph`,style:n}){return(0,G.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,G.jsx)(`path`,{d:Gt[e]||``})})}function Kt({className:e=`sprout`}){return(0,G.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,G.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,G.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,G.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,G.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var qt=[{group:`core`,hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{group:`govern`,hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?Ut(e.counts):null},{group:`build`,hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?Wt(e.counts):null},{group:`build`,hash:`#/kits`,page:`kits`,label:`Kits`,icon:`kit`},{group:`build`,hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,countTitle:`Templates across every install`,count:e=>e?.counts?.loops??null},{group:`build`,hash:`#/factories`,page:`factories`,label:`Factories`,icon:`build`},{group:`govern`,hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{group:`run`,hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?t.filter(e=>e.state!==`absent`).length:null}],Jt=[{group:`help`,hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{group:`run`,hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`},{group:`help`,hash:`#/settings`,page:`settings`,label:`Settings`,icon:`settings`}],Yt=[{id:`core`,title:null},{id:`govern`,title:`Govern`},{id:`build`,title:`Build`},{id:`run`,title:`Run`},{id:`help`,title:`Help`}],Xt=[...qt,...Jt],Zt=`geneseed-rail`;function Qt({n:e,lit:t,count:n,collapsed:r,onNavigate:i}){return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,title:r?e.label:void 0,"aria-label":r?n==null?e.label:`${e.label}, ${n}`:void 0,onClick:()=>i?.(),children:[(0,G.jsx)(`span`,{className:`sb-chip`,"aria-hidden":`true`,children:(0,G.jsx)(K,{name:e.icon})}),(0,G.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,G.jsx)(`span`,{className:`sb-count`,title:e.countTitle,children:n})]})})}function $t({route:e,overview:t,installs:n,onNavigate:r}){let[i,a]=V(Zt,e=>e===`collapsed`?`collapsed`:`open`),o=i===`collapsed`,s=()=>a(o?`open`:`collapsed`),c=o?`Expand the sidebar`:`Collapse the sidebar`;return(0,G.jsxs)(`nav`,{className:`sidebar${o?` collapsed`:``}`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,G.jsxs)(`div`,{className:`sb-head`,children:[(0,G.jsx)(`button`,{type:`button`,className:`sb-collapse`,onClick:s,"aria-label":c,title:c,"aria-expanded":!o,children:(0,G.jsx)(K,{name:`chevron`})}),(0,G.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{Ce(`#/`),r?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,G.jsx)(`span`,{className:`sb-mark`,children:(0,G.jsx)(Kt,{})}),(0,G.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,G.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,G.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]})]}),Yt.map(i=>(0,G.jsxs)(`div`,{className:`sb-group sb-${i.id}`,role:`group`,"aria-labelledby":i.title?`sb-g-${i.id}`:void 0,"aria-label":i.title?void 0:`Overview`,children:[i.title?(0,G.jsxs)(`div`,{className:`sb-group-title`,id:`sb-g-${i.id}`,children:[(0,G.jsx)(`i`,{"aria-hidden":`true`}),i.title]}):null,(0,G.jsx)(`ul`,{className:`sb-list`,children:Xt.filter(e=>e.group===i.id).map(i=>(0,G.jsx)(Qt,{n:i,lit:e.page===i.page,count:i.count?.(t,n),collapsed:o,onNavigate:r},i.page))})]},i.id))]})}var en=[`overview`,`laws`,`library`,`installs`];function tn({route:e,navOpen:t,onMore:n}){return(0,G.jsxs)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:[qt.filter(e=>en.includes(e.page)).map(t=>(0,G.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,G.jsx)(K,{name:t.icon}),t.label]},t.page)),(0,G.jsxs)(`button`,{type:`button`,className:`tab-more${en.includes(e.page)?``:` on`}`,"aria-controls":`rail-nav`,"aria-expanded":!!t,onClick:n,children:[(0,G.jsx)(K,{name:`menu`}),`More`]})]})}var nn=[{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`}],q=e=>nn.find(t=>t.id===e)||nn[0],rn=(e,t)=>t===`project`?q(e).removeProject:q(e).removeGlobal,an=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,on=e=>e.scope===`global`?q(e.host).label:an(e.path),sn=e=>{let t=q(e.host).label;return e.scope===`global`?`${t} · global`:`${an(e.path)} · ${t}`},cn=e=>({"--cc":`var(--cat-${e*2%7})`}),ln=(e,t=[])=>[...new Set(e)].filter(e=>!t.includes(e)),un=e=>{let t=(e||[]).filter(e=>e.state===`active`);return[...t.filter(e=>e.default),...t.filter(e=>!e.default)]},dn=e=>e?{host:e.host,path:e.path}:void 0,fn=`geneseed-harness`,pn=nn.map(({id:e,label:t})=>({id:e,label:t}));function mn(e=`opencode`){let[t,n]=V(fn,e=>pn.some(t=>t.id===e)?e:null);return[t??e,n]}function hn(e){let t=String(e||``);return nn.find(e=>t.startsWith(e.id))?.id||`opencode`}var gn=Object.entries(fe).flatMap(([e,t])=>(pe[e]||[``]).map(n=>{let r=n?t+` / `+me[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}}));function _n(e=0){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),o=(0,B.useRef)(null),[s]=mn(),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 vn({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,G.jsxs)(`dialog`,{ref:s,className:`confirm`,"aria-labelledby":`${u}-title`,"aria-describedby":`${u}-body`,onCancel:o,onClose:o,children:[(0,G.jsx)(`h3`,{className:`confirm-title`,id:`${u}-title`,children:t}),(0,G.jsx)(`div`,{className:`confirm-body`,id:`${u}-body`,children:n}),(0,G.jsxs)(`div`,{className:`confirm-actions`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,ref:c,children:`Cancel`}),(0,G.jsx)(`button`,{type:`button`,className:d?`btn danger`:`btn`,onClick:a,ref:l,children:r||`Confirm`})]})]})}var yn=(0,B.createContext)(null),bn=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function xn(){return(0,B.useContext)(yn)||bn}function Sn({children:e}){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(!1),a=(0,B.useRef)(null),o=e=>{let t=a.current;a.current=null,n(null),t?.(e)},s=(0,B.useCallback)((e,t={})=>new Promise(r=>{a.current?.(!1),a.current=r,i(!!t.check?.checked),n({msg:e,...t})}),[]);return(0,G.jsxs)(yn.Provider,{value:s,children:[e,(0,G.jsxs)(vn,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,tone:t?.tone,onConfirm:()=>o(!t?.check||{checked:r}),onClose:()=>o(!1),children:[t?.msg,t?.check?(0,G.jsxs)(`label`,{className:`confirm-check`,children:[(0,G.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),t.check.label]}):null]})]})}var Cn=24;function wn(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function Tn(e,t){let n=t.toLowerCase().trim();if(!e)return[];if(!n)return e.filter(e=>e.sortKey<0).sort((e,t)=>e.sortKey-t.sortKey);let r=[];for(let t of e){let e=wn(t,n);e>=0&&r.push({e:t,s:e})}r.sort((e,t)=>e.e.sortKey-t.e.sortKey||e.s-t.s||e.e.title.localeCompare(t.e.title));let i=r.map(e=>e.e),a=i.filter(e=>e.sortKey>=0).slice(0,Cn);return i.filter(e=>e.sortKey<0).concat(a)}function En(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,G.jsxs)(G.Fragment,{children:[e.slice(0,r),(0,G.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)(()=>Tn(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||!w())return;let t=S(e,{opacity:[0,1],translateY:[-4,0],duration:E[4],delay:R(E[0]),ease:A});return y(t,E[4]+E[0]*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,G.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[u.map(t=>(0,G.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,G.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,G.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,G.jsx)(`div`,{className:`spot-title`,children:En(t.title,e)}),t.desc?(0,G.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route||t.title}-${n}`))]},`${t.kind}-${t.rows[0].index}`)),f&&r&&(0,G.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),f&&n&&!r&&(0,G.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),f&&!n&&!r&&s.length===0&&(0,G.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]})]})}function On({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}=_n(t),m=xn(),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})),...gn,...d||[]],[e,d]),v=a?Tn(_,s):[],y=l<v.length?`spot-opt-${l}`:void 0,b=async e=>{if(g(),!e.run)return Ce(e.route);let t=e.confirm;(!t||await m(t.msg,{title:t.title,confirmLabel:t.confirmLabel,tone:t.tone}))&&e.run()};return(0,G.jsxs)(G.Fragment,{children:[(0,G.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,G.jsx)(K,{name:`search`,className:`mag glyph`}),(0,G.jsx)(`span`,{className:`tb-cmdk-label`,children:`Search or run…`}),(0,G.jsx)(`kbd`,{className:`tb-cmdk-key`,children:`Ctrl K`})]}),(0,G.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,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`palette-head`,children:[(0,G.jsx)(K,{name:`search`,className:`mag glyph`}),(0,G.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,G.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]}),(0,G.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v.length?`${v.length} results`:`no matches`}),(0,G.jsx)(Dn,{query:s,index:_,loading:!d,error:d?``:f,active:l,onActive:u,onPick:b}),(0,G.jsxs)(`div`,{className:`palette-foot`,children:[(0,G.jsx)(`span`,{children:`↑↓ move`}),(0,G.jsx)(`span`,{children:`↵ open`}),(0,G.jsx)(`span`,{children:`actions that write always ask first`})]})]})})]})}var kn=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function An({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(kn)||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,G.jsx)(`div`,{ref:o,className:i?`popover ${i}`:`popover`,role:`dialog`,"aria-label":r,tabIndex:-1,onBlur:e=>{let r=e.relatedTarget;!r||o.current?.contains(r)||n?.current?.contains(r)||t()},children:a}):null}function jn({children:e,...t}){let n=x(`button.on`);return(0,G.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,G.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function Mn({value:e,onChange:t,labelledBy:n}){let r=ht(e);return(0,G.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[dt.map(n=>(0,G.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,G.jsxs)(`div`,{className:`accent-swatches`,children:[ft.map(n=>(0,G.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,G.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,G.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function Nn({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,onClose:i,anchorRef:a}){return(0,de.createPortal)((0,G.jsxs)(An,{open:!0,onClose:i,anchorRef:a,label:`Appearance`,className:`appearance-pop`,children:[(0,G.jsxs)(`div`,{className:`ap-group`,children:[(0,G.jsx)(`span`,{className:`ap-label`,id:`ap-skin`,children:`Skin`}),(0,G.jsx)(jn,{"aria-labelledby":`ap-skin`,children:$e.map(n=>(0,G.jsx)(`button`,{type:`button`,className:e===n.id?`on`:``,"aria-pressed":e===n.id,onClick:()=>t(n.id),children:n.short},n.id))}),(0,G.jsx)(`span`,{className:`ap-note`,role:`status`,"aria-live":`polite`,children:$e.find(t=>t.id===e)?.tagline})]}),(0,G.jsxs)(`div`,{className:`ap-group`,children:[(0,G.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,G.jsx)(Mn,{value:n,onChange:r,labelledBy:`ap-accent`}),(0,G.jsx)(`span`,{className:`ap-note`,role:`status`,"aria-live":`polite`,children:vt(n)})]})]}),document.querySelector(`.app`)||document.body)}function Pn({route:e,navOpen:t,onToggleNav:n,actions:r,mode:i,onToggleMode:a,appearance:o,dataRev:s}){let[c,l]=(0,B.useState)(!1),u=(0,B.useRef)(null),d=e.tab&&me[e.tab];return(0,G.jsxs)(`header`,{className:`topbar`,children:[(0,G.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,G.jsx)(K,{name:t?`x`:`menu`})}),(0,G.jsx)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:(0,G.jsxs)(`ol`,{children:[(0,G.jsx)(`li`,{children:d?(0,G.jsx)(`a`,{href:e.page===`overview`?`#/`:`#/${e.page}`,children:fe[e.page]}):(0,G.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:fe[e.page]})}),d?(0,G.jsx)(`li`,{children:(0,G.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:d})}):null]})}),(0,G.jsx)(`div`,{className:`topbar-spacer`}),(0,G.jsx)(On,{actions:r,dataRev:s}),(0,G.jsx)(`button`,{type:`button`,className:`iconbtn`,ref:u,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":c,onClick:()=>l(e=>!e),children:(0,G.jsx)(K,{name:`themes`})}),c?(0,G.jsx)(Nn,{...o,anchorRef:u,onClose:()=>l(!1)}):null,(0,G.jsx)(`button`,{type:`button`,className:`iconbtn`,title:i===`light`?`Switch to dark`:`Switch to light`,"aria-label":i===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:a,children:(0,G.jsx)(K,{name:i===`light`?`moon`:`sun`})})]})}function Fn({installs:e,value:t,onChange:n,className:r=``,tagOf:i=sn,label:a=`Install`}){return!t||!e||e.length<2?null:(0,G.jsxs)(`label`,{className:`install-pick ${r}`.trim(),children:[(0,G.jsx)(`span`,{className:`dim`,children:`Install:`}),(0,G.jsx)(`select`,{className:`sel mono`,"aria-label":a,value:t.id,onChange:t=>n(e.find(e=>e.id===t.target.value)),children:e.map(e=>(0,G.jsx)(`option`,{value:e.id,children:i(e)},e.id))})]})}function In({unreadable:e}){return e?(0,G.jsx)(`p`,{className:`sub rule-notice`,role:`status`,children:`Install list unreadable — showing the default install.`}):null}var Ln=3500;function Rn({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,Ln);return()=>clearTimeout(e)},[e,i]);let a=()=>r(e),o=()=>r(null);return(0,G.jsx)(`div`,{className:`toast-region`,"aria-live":e?.kind===`err`?void 0:`polite`,children:e&&(0,G.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,G.jsx)(`div`,{children:e.msg}),(0,G.jsx)(`div`,{style:{marginTop:8},children:(0,G.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})})}var zn=e=>nn.find(t=>t.id===e)?.label??e;function Bn(e){let t=/^([a-z]+?)(?:-(global))?$/.exec(e);return t?`${zn(t[1])} · ${t[2]||`project`}`:e}var Vn={upgrade:`Update the source`,"rebuild-all":`Rebuild every install`,doctor:`Run the doctor`,diff:`Export local edits`,link:`Link the CLI`,unlink:`Unlink the CLI`};function Hn(e){let t;return(t=/geneseed-cli\.mjs\s+(\S+)/.exec(e))?{title:Vn[t[1]]||`Run ${t[1]}`,container:t[1]===`rebuild-all`}:/build-driver\.mjs\b/.test(e)?(t=/--emit\s+(\S+)/.exec(e),{title:t?`Build ${Bn(t[1])}`:`Build the bundle`}):/npm(\.cmd)?\s+install\b/i.test(e)?{title:`Install the npm package`}:{title:`Run a step`}}var Un=/^\[(?:geneseed|rebuild-all|upgrade)\]\s*(?:WARN\b:?|⚠️)\s*/u,Wn=/^(?:\[rebuild-all\] FAILED |\[rebuild-all\] \d+\/\d+ install\(s\) failed|\[rebuild-all\] not started:|\[web\] ✗ |\[web\] job crashed|\[web\] cancelled by user|\[geneseed\]\[E-[A-Z]+\] ✗|\[geneseed\] ✗)/,Gn=/^\[geneseed\] (refused \S+: it is a link)/,Kn=/^\[rebuild-all\] ([a-z]+):([a-z]+) \((.*)\): theme=/,qn=/^\[geneseed\] ([a-z]+(?:-global)?) -> .+?: (\d+ subagents, \d+ skills)/,Jn=/^\[geneseed\] (\d+) new commit\(s\) upstream/,Yn=/^\[geneseed\] already up to date\./,Xn=/^\[rebuild-all\] rebuilt (\d+) install\(s\)\./,Zn=/^\[rebuild-all\] WARN /,Qn=/restarts? itself after this job/,$n=/^\[geneseed\] ✓ (?:upgrade|update) complete\./,er=/skipping the (\d+) remaining step\(s\)/;function tr(e){let t=e.replace(Un,``),n=t.replace(/"[^"]*"(?:,\s*"[^"]*")+/g,e=>`${e.match(/"[^"]*"/g).length} entries`),r=n.indexOf(` — `),i=r===-1?n:n.slice(0,r),a=r===-1?``:n.slice(r+3),o=a.search(/\.(\s|$)/);return o!==-1&&(a=a.slice(0,o+1)),i.length>96&&(i=`${i.slice(0,95).replace(/\s+\S*$/,``)}…`),a&&=a[0].toUpperCase()+a.slice(1),{title:i,body:a,text:t}}function nr(e,t,n={}){return{title:e,detail:``,raw:t==null?[]:[t],lines:[],warnings:[],notices:[],errors:[],...n}}var rr=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function ir(e=``,t=`done`){let n=e?e.replace(/\n$/,``).split(`
3
+ `):[],r=[],i=[],a=null,o=null,s=!1,c=null,l=null,u=!1,d=[],f=e=>{a&&a.container&&a.raw.length===1&&!a.lines.length&&(r.pop(),e.raw.unshift(...a.raw)),r.push(e),a=e};for(let e of n){let t;if(t=/^\$ (.+)$/.exec(e)){let{title:n,container:r}=Hn(t[1]);f(nr(n,e,{container:!!r}))}else(t=Kn.exec(e))?f(nr(`Rebuild ${zn(t[1])} · ${t[2]}`,e)):a?(a.raw.push(e),Zn.test(e)?d.push(tr(e)):Un.test(e)?a.warnings.push(tr(e)):Wn.test(e)?(a.errors.push(e),(t=er.exec(e))&&(a.skippedSteps=Number(t[1]))):(t=Gn.exec(e))?a.notices.push({title:t[1],text:e}):(t=qn.exec(e))?(a.detail=a.detail||t[2],l||=t[1]):(t=Jn.exec(e))?(o=Number(t[1]),a.detail=rr(o,`new commit`)):Yn.test(e)?(s=!0,a.detail=`already up to date`):(t=Xn.exec(e))?c=Number(t[1]):Qn.test(e)?u=!0:$n.test(e)||e.trim()&&a.lines.push(e)):i.push(e)}if(t===`failed`&&!r.some(e=>e.errors.length)){r.length||r.push(nr(`Run`,null));let e=[...n].reverse().find(e=>e.trim())||`the job failed without output`;r[r.length-1].failLine=e}r.forEach((e,n)=>{e.state=e.errors.length||e.failLine?`failed`:t===`running`&&n===r.length-1?`running`:e.warnings.length?`warn`:e.notices.length?`skipped`:`done`,e.stateText={failed:`Failed`,running:`Running`,warn:rr(e.warnings.length,`warning`),skipped:`${e.notices.length} skipped`,done:`Done`}[e.state],delete e.container}),u&&r.length&&(r[r.length-1].title+=`, restart web`);let p=[];return o===null?s&&p.push(`up to date`):p.push(rr(o,`new commit`)),c===null?l&&p.push(l):p.push(rr(c,`install`)),{phases:r,other:i,runWarnings:d,failed:r.some(e=>e.state===`failed`),warnings:r.reduce((e,t)=>e+t.warnings.length,d.length),notices:r.reduce((e,t)=>e+t.notices.length,0),detail:p.join(` · `),restart:u}}function ar(e){if(e==null)return``;if(e<60)return`${e}s`;let t=Math.floor(e/60);return`${t}m ${Math.round(e-t*60)}s`}function or(e,t){return e===`running`?`running`:e===`failed`||t.failed?`failed`:t.warnings?`warn`:`done`}var sr={running:`Running`,failed:`Failed`,done:`Done`,warn:`Done`},cr={running:`running`,failed:`✗`,warn:`⚠`},lr=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function ur({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),[l,u]=(0,B.useState)({id:null,at:0}),[d,f]=(0,B.useState)(null);(0,B.useEffect)(()=>{let e=c.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let p=(0,B.useMemo)(()=>e.map(e=>ir(e.output,e.status)),[e]),m=l.at===e.length?l.id:null,h=m===null?-1:e.findIndex(e=>e.id===m),g=h===-1?e.length-1:h,_=e[g],v=p[g],y=_?_.output.length:0;return(0,B.useEffect)(()=>{s.current&&(s.current.scrollTop=0)},[_?.id]),(0,B.useEffect)(()=>{let e=s.current;e&&t&&_?.status===`running`&&(e.scrollTop=e.scrollHeight)},[y,t,_?.status]),(0,G.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,G.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,G.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{className:`ttl`,children:[(0,G.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,G.jsx)(`span`,{className:`count`,children:e.length}),(0,G.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,G.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,G.jsx)(K,{name:`clear`})}),(0,G.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,G.jsx)(K,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(e.length===0?(0,G.jsx)(`div`,{className:`console-body`,children:(0,G.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`})}):(0,G.jsxs)(`div`,{className:`console-body cx`,children:[(0,G.jsx)(`ul`,{className:`cx-runs`,"aria-label":`Runs`,children:e.map((t,n)=>{let r=or(t.status,p[n]);return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{className:`cx-run${n===g?` on`:``}`,"aria-current":n===g?`true`:void 0,onClick:()=>u({id:t.id,at:e.length}),children:[(0,G.jsx)(`span`,{className:`cx-dot ${r}`,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{className:`cx-run-main`,children:[(0,G.jsx)(`span`,{className:`cx-run-act`,children:t.action}),p[n].detail&&(0,G.jsx)(`span`,{className:`cx-run-sub`,title:p[n].detail,children:p[n].detail})]}),(0,G.jsxs)(`span`,{className:`cx-run-dur`,children:[cr[r]&&(0,G.jsx)(`span`,{className:`cx-mark ${r}`,"aria-hidden":`true`,children:cr[r]}),t.status===`running`?``:ar(t.duration)]}),(0,G.jsxs)(`span`,{className:`sr-only`,children:[sr[r],r===`warn`?` with warnings`:``]})]})},t.id)}).reverse()}),(0,G.jsx)(`section`,{className:`cx-detail`,ref:s,"aria-label":`Run ${_.action}`,children:(0,G.jsx)(dr,{run:_,view:v,showLog:d===_.id,onLog:()=>f(e=>e===_.id?null:_.id),onCancel:i})})]}))]})}function dr({run:e,view:t,showLog:n,onLog:r,onCancel:i}){let a=or(e.status,t),o=[e.status===`running`?`running`:ar(e.duration),lr(t.warnings,`warning`),lr(t.notices,`notice`)].filter(Boolean);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:`cx-head`,children:[(0,G.jsx)(`h3`,{className:`cx-title`,children:e.action}),(0,G.jsx)(`span`,{className:`cx-pill ${a}`,children:sr[a]}),e.status===`running`&&i&&(0,G.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,G.jsx)(K,{name:`x`})}),(0,G.jsx)(`button`,{className:`cx-logbtn`,"aria-pressed":n,onClick:r,children:`Full log`})]}),(0,G.jsx)(`p`,{className:`cx-sum`,children:o.join(` · `)}),n?(0,G.jsx)(`pre`,{className:`run-out`,children:e.output}):(0,G.jsxs)(G.Fragment,{children:[t.phases.length===0&&!t.other.length&&(0,G.jsx)(`div`,{className:`console-empty`,children:e.status===`running`?`Waiting for output…`:`No output`}),(0,G.jsx)(`ol`,{className:`cx-phases`,children:t.phases.map((e,t)=>(0,G.jsx)(pr,{n:t+1,p:e},t))}),t.runWarnings.length>0&&(0,G.jsxs)(`div`,{className:`cx-other`,children:[(0,G.jsx)(`div`,{className:`cx-ph-title`,children:`Run warnings`}),t.runWarnings.map((e,t)=>(0,G.jsx)(fr,{w:e},t))]}),t.other.length>0&&(0,G.jsx)(mr,{lines:t.other})]})]})}function fr({w:e}){return(0,G.jsxs)(`div`,{className:`cx-warn`,children:[(0,G.jsx)(`b`,{children:e.title}),e.body&&(0,G.jsx)(`p`,{children:e.body}),e.text!==e.title&&(0,G.jsxs)(`details`,{children:[(0,G.jsx)(`summary`,{children:`Full text`}),(0,G.jsx)(`p`,{className:`cx-warn-full`,children:e.text})]})]})}function pr({n:e,p:t}){return(0,G.jsxs)(`li`,{className:`cx-phase ${t.state}`,children:[(0,G.jsx)(`span`,{className:`cx-num`,"aria-hidden":`true`,children:e}),(0,G.jsxs)(`div`,{className:`cx-ph`,children:[(0,G.jsxs)(`div`,{className:`cx-ph-head`,children:[(0,G.jsx)(`span`,{className:`cx-ph-title`,children:t.title}),(0,G.jsx)(`span`,{className:`cx-ph-state`,children:t.stateText})]}),t.detail&&(0,G.jsx)(`div`,{className:`cx-ph-detail`,children:t.detail}),t.errors.map((e,t)=>(0,G.jsx)(`div`,{className:`cx-err`,children:e},`e${t}`)),t.failLine&&(0,G.jsx)(`div`,{className:`cx-err`,children:t.failLine}),t.warnings.map((e,t)=>(0,G.jsx)(fr,{w:e},`w${t}`)),t.notices.map((e,t)=>(0,G.jsx)(`div`,{className:`cx-note`,title:e.text,children:e.title},`n${t}`)),t.lines.length>0&&(0,G.jsx)(`pre`,{className:`cx-lines`,children:t.lines.join(`
4
+ `)})]})]})}function mr({lines:e}){return(0,G.jsxs)(`div`,{className:`cx-other`,children:[(0,G.jsx)(`div`,{className:`cx-ph-title`,children:`Other output`}),(0,G.jsx)(`pre`,{className:`cx-lines`,children:e.join(`
5
+ `)})]})}var hr=550,gr=`gs-splash-seen`,_r=8e3;function vr(){try{if(window.localStorage.getItem(gr))return 0;window.localStorage.setItem(gr,`1`)}catch{}return hr}function yr({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),vr());return()=>clearTimeout(e)},[]);let[o,s]=(0,B.useState)(!1);(0,B.useEffect)(()=>{if(e)return;let t=setTimeout(()=>s(!0),_r);return()=>clearTimeout(t)},[e]),e&&n&&!i&&a(!0),(0,B.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),E[9]);return()=>clearTimeout(e)},[i]);let c=o&&!i;return(0,G.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":c?void 0:`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,G.jsxs)(`div`,{className:`boot-dial`,"aria-hidden":`true`,children:[(0,G.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,G.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,G.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,G.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,G.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,G.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,G.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,G.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,G.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),c?(0,G.jsxs)(`div`,{className:`boot-status`,role:`alert`,children:[(0,G.jsx)(`span`,{children:`The server is not answering.`}),` `,(0,G.jsx)(`button`,{type:`button`,className:`btn`,onClick:it,children:`Retry`})]}):(0,G.jsxs)(`div`,{className:`boot-status`,children:[(0,G.jsx)(`span`,{children:`germinating harness`}),(0,G.jsx)(`span`,{className:`boot-caret`})]})]})}function J({label:e=`Loading…`}){return(0,G.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,G.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,G.jsx)(`div`,{className:`skel-bar`}),(0,G.jsx)(`div`,{className:`skel-bar`}),(0,G.jsx)(`div`,{className:`skel-bar`})]})]})}function br({error:e,style:t,onRetry:n,role:r=`alert`}){return e?n?(0,G.jsxs)(`div`,{className:`error-state`,role:r,style:t,children:[(0,G.jsx)(`p`,{className:`badge bad`,children:e}),(0,G.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:n,children:`Retry`})]}):(0,G.jsx)(`p`,{className:`badge bad`,role:r,style:t,children:e}):null}function xr(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(null);return(0,G.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,G.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,G.jsx)(`button`,{className:`btn sm`,onClick:async()=>{t(!0),r(null);try{await lt()}catch(e){r(e.message),t(!1)}},disabled:e,children:e?`Restarting…`:`Restart`})]})}var Sr=/dynamically imported module|Importing a module script failed|Unable to preload CSS/i,Cr=e=>Sr.test(e?.message||``),wr=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=Cr(e);return(0,G.jsxs)(`div`,{role:t?void 0:`alert`,children:[(0,G.jsx)(br,{error:e.message||String(e),role:null}),t?(0,G.jsx)(xr,{}):(0,G.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]})}},Tr=(0,B.createContext)(null),Er=e=>[...e].sort().join(`,`),Dr=e=>[...e.values()].some(e=>!e.applied&&Er(e.value)!==e.base);function Or(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=Dr(n.kits)||Dr(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 Er(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 kr({activeId:e,finish:t,children:n}){let r=Or(e,t);return(0,G.jsx)(Tr.Provider,{value:r,children:n})}function Ar(){let e=Or(null,null);return(0,B.useContext)(Tr)||e}var jr=e=>!!e&&!e.endsWith(`-global`);function Mr({onAction:e}){let{data:t,error:n}=U(()=>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,G.jsx)(br,{error:n});if(!t)return(0,G.jsx)(J,{});let m=r||t.current?.theme||`neutral`,h=(t.emits||[]).filter(e=>e.name!==`files`),g=t.emits?.some(e=>e.name===`opencode-global`),_=o||(g?`opencode-global`:t.current?.emit||h[0]?.name||``),v=i,y=s,b=jr(_);return(0,G.jsxs)(`div`,{className:`narrow-lg`,children:[(0,G.jsx)(`div`,{className:`head-row mb-18`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,G.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,G.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,G.jsx)(`div`,{className:`card-head`,children:(0,G.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,G.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,G.jsx)(`button`,{className:`btn ${e.name===m?`soft`:`ghost`}`,onClick:()=>v(e.name),title:e.blurb||e.tagline||e.name,children:(0,G.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})},e.name))})]}),(0,G.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,G.jsx)(`div`,{className:`card-head`,children:(0,G.jsx)(`h3`,{children:`2 · Install mode`})}),(0,G.jsxs)(`p`,{className:`sub mb-16`,children:[`A `,(0,G.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,G.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,G.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,G.jsx)(`select`,{className:`sel`,value:_,onChange:e=>y(e.target.value),children:h.map(e=>(0,G.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]}),b&&(0,G.jsxs)(`div`,{className:`row gap-10`,style:{maxWidth:560,marginTop:12},children:[(0,G.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,G.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,G.jsx)(`p`,{className:`sub`,style:{marginTop:12},children:u})]}),(0,G.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,G.jsx)(K,{name:`build`}),`Deploy harness`]})]})}function Nr(e){return U(()=>Promise.resolve().then(()=>a.installs()).catch(()=>null),[e],`installs`)}function Pr(e){let{data:t,loading:n}=Nr(e);return n&&!t?null:un(t?.installs)}var Fr=e=>`geneseed-install-${e}`;function Ir(e,t){try{localStorage.setItem(Fr(e),t)}catch{}}function Lr(e){try{let t=localStorage.getItem(Fr(e))||``;return localStorage.removeItem(Fr(e)),t}catch{return``}}function Rr(e,t){let[n,r]=V(Fr(e),e=>e||null);return[(t||[]).find(e=>e.id===n)||t?.[0]||null,e=>r(e.id)]}function zr(e,t){let{data:n,loading:r}=Nr(t),[i,a]=(0,B.useState)(null);n&&n!==i&&a(n);let o=n??i,s=r&&!o?null:un(o?.installs),c=s===null?null:s.length?s:[null],{data:l,reload:u}=U(()=>c?Promise.allSettled(c.map(t=>e(dn(t)))).then(e=>{let t=e.flatMap((e,t)=>e.status===`fulfilled`?[{inst:c[t],data:e.value}]:[]),n=t.map(e=>e.data.path);return{sets:t.filter((e,t)=>n.indexOf(e.data.path)===t),failed:c.filter((t,n)=>e[n].status===`rejected`),reason:e.find(e=>e.status===`rejected`)?.reason??null}}):Promise.resolve(null),[t,c?c.map(e=>e?.id??``).join(`|`):null]);return{targets:c,sets:l?.sets??null,failed:l?.failed??[],reason:l?.reason,reload:u}}var Br=(e,t)=>U(()=>a.rules(t).catch(()=>null),t?[e,t.host,t.path]:[e],`rules`,{revalidate:!0}),Vr=()=>Mt(`rules`);function Hr({eyebrow:e,title:t,sub:n,primary:r,actions:i,crumbs:a}){return(0,G.jsxs)(`div`,{className:`page-head`,children:[(0,G.jsxs)(`div`,{children:[a?.length?(0,G.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`page-crumbs`,children:(0,G.jsx)(`ol`,{children:a.map((e,t)=>(0,G.jsx)(`li`,{children:t===a.length-1?(0,G.jsx)(`span`,{"aria-current":`page`,children:e.label}):e.href?(0,G.jsx)(`a`,{href:e.href,children:e.label}):e.label},t))})}):null,e?(0,G.jsx)(`div`,{className:`eyebrow`,children:e}):null,(0,G.jsx)(`h1`,{className:`h`,children:t}),n?(0,G.jsx)(`p`,{className:`sub`,children:n}):null]}),r||i?(0,G.jsxs)(`div`,{className:`page-actions`,children:[i,r]}):null]})}function Ur({segments:e,value:t,max:n,size:r=120,stroke:i=12,label:a,sweepMs:o=E[9]}){let s=n>0?n:0,c=e||[{key:`v`,label:a,n:Math.min(Math.max(t||0,0),s),tone:`accent`}],l=e?c.reduce((e,t)=>e+t.n,0):s,u=e?c.map(e=>`${e.label}: ${e.n} of ${l}`).join(`, `):`${c[0].n} of ${l}`,d=r/2-i/2,f=r/2,p=e=>[f+d*Math.cos(e),f+d*Math.sin(e)],m=[],h=0;for(let e of c)m.push(h),h+=e.n;let g=(0,B.useRef)(null),_=c.map(e=>e.n).join(`,`);return(0,B.useLayoutEffect)(()=>{let e=g.current?.querySelectorAll(`path.ring-arc`);if(!o||!e?.length||!w())return;let t=c.map(e=>e.n/l).filter(e=>e>0),n=t.map((e,n)=>t.slice(0,n).reduce((e,t)=>e+t,0)),r=ue(e);T(r,{draw:`0 0`});let i=S(r,{draw:[`0 0`,`0 1`],duration:(e,n)=>Math.max(o*t[n],E[1]),delay:(e,t)=>o*n[t],ease:`linear`});return y(i,o)},[_,o]),(0,G.jsxs)(`svg`,{className:`ring`,width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:`img`,"aria-label":a?`${a}: ${u}`:u,children:[(0,G.jsx)(`circle`,{className:`ring-track`,cx:f,cy:f,r:d,fill:`none`,strokeWidth:i}),(0,G.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,G.jsx)(`path`,{className:`ring-arc tone-${e.tone||`muted`}`,d:h,fill:`none`,strokeWidth:i,children:(0,G.jsxs)(`title`,{children:[e.label,`: `,e.n]})},e.key)}):null})]})}var Wr=E[8];function Gr({parts:e,total:t,label:n,legend:r=!0}){let i=e.reduce((e,t)=>e+t.n,0),a=t??i,o=e=>a>0?`${e/a*100}%`:`0%`,s=e.map(e=>`${e.label}: ${e.n} of ${a}`).join(`, `),c=(0,B.useRef)(null),l=e.map(e=>e.n).join(`,`)+`/${a}`;return(0,B.useLayoutEffect)(()=>{if(c.current&&w())return T(c.current,{scaleX:0}),y(S(c.current,{scaleX:[0,1],duration:Wr,ease:A}),Wr)},[l]),(0,G.jsxs)(`div`,{className:`stackbar-box`,children:[(0,G.jsx)(`div`,{className:`stackbar sweep`,role:`img`,"aria-label":n?`${n}: ${s}`:s,ref:c,children:e.map(e=>e.n>0?(0,G.jsx)(`span`,{className:`tone-${e.tone||`muted`}`,style:{width:o(e.n)},title:`${e.label}: ${e.n}`},e.key):null)}),r&&(0,G.jsx)(`ul`,{className:`stackbar-legend`,"aria-hidden":`true`,children:e.map(e=>(0,G.jsxs)(`li`,{children:[(0,G.jsx)(`i`,{className:`tone-${e.tone||`muted`}`}),e.label,` `,(0,G.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function Kr({value:e,max:t,label:n=`value`,tone:r=`accent`}){let i=t>0?t:0;return(0,G.jsx)(Gr,{parts:[{key:`v`,label:n,n:Math.min(Math.max(e||0,0),i),tone:r}],total:i,legend:!1})}var qr=864e5;function Jr(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))/qr);s<0||s>=t||(r[t-1-s].v+=1)}return r}var Yr=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),Xr=[`--emit`,`--theme`,`--scope`],Zr={done:`✓`,failed:`✗`};function Qr(e){let t=(e.output||``).split(`
6
+ `).find(e=>e.startsWith(`$ `))||``,n=t.split(/\s+/),r=[];return n.forEach((e,t)=>{let[i,a]=e.split(`=`),o=a||n[t+1];Xr.includes(i)&&o&&!o.startsWith(`--`)&&r.push(o)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:r.join(` · `),result:Zr[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}var $r={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)`}},ei={cls:``,label:`ended`};function ti(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var ni=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 ri(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 ii({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)},[]),ri(t-e)}function ai({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,G.jsxs)(`span`,{className:`act-todo`,children:[(0,G.jsx)(`span`,{className:`on`,children:`●`.repeat(r)}),(0,G.jsx)(`span`,{className:`dim`,children:`○`.repeat(n-r)})]})}var oi=e=>e.ended?null:e.turn_started_at,si=e=>!!(e.tokens>0||e.cost>0||oi(e)||e.files?.count>0);function ci({s:e,heading:t,id:n,children:r}){let i=e.ended?ei:$r[e.status]||$r.idle,a=e.files,o=si(e),s=e=>n?`${n}-${e}`:void 0;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`row between wrap gap-12`,children:[t?(0,G.jsxs)(`div`,{className:`row gap-10 act-min`,children:[(0,G.jsx)(`span`,{className:`feed-dot act-dot ${e.ended?``:i.cls||`acc`}`}),(0,G.jsxs)(`div`,{className:`act-min`,children:[(0,G.jsx)(`h2`,{className:`act-title`,id:s(`t`),children:t}),e.cwd&&(0,G.jsx)(`div`,{className:`dim mono act-cwd`,title:e.cwd,children:e.cwd})]})]}):null,(0,G.jsxs)(`div`,{className:`row gap-8 act-fixed`,children:[e.model&&(0,G.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,G.jsx)(`span`,{className:`badge`,children:e.agent}),(0,G.jsxs)(`span`,{className:`badge ${i.cls}`,id:s(`st`),children:[(0,G.jsx)(`span`,{className:`dot`}),i.label]}),r]})]}),e.phase&&(0,G.jsxs)(`div`,{className:`row gap-8 act-phase`,children:[(0,G.jsx)(K,{name:`activity`}),(0,G.jsx)(`span`,{className:`act-ell`,title:e.phase,children:e.phase})]}),o&&(0,G.jsxs)(`div`,{className:`row wrap act-counters`,id:s(`c`),children:[e.tokens>0&&(0,G.jsxs)(`span`,{children:[ni(e.tokens),` tok`]}),e.cost>0&&(0,G.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),oi(e)?(0,G.jsx)(`span`,{children:(0,G.jsx)(ii,{startedAt:e.turn_started_at})}):null,a&&a.count>0&&(0,G.jsxs)(`span`,{children:[a.count,` file`,a.count===1?``:`s`,` `,(0,G.jsxs)(`span`,{className:`t-good`,children:[`+`,a.additions]}),` `,(0,G.jsxs)(`span`,{className:`t-bad`,children:[`−`,a.deletions]})]})]}),(e.error||e.blocked_on)&&(0,G.jsx)(`div`,{className:`act-err-row`,children:(0,G.jsx)(`span`,{className:`badge bad act-ell`,title:e.error||e.blocked_on,children:e.error||e.blocked_on})})]})}var li=e=>e?.status===`blocked`||e?.status===`waiting-input`,ui=864e5,di=e=>new Date(e).toISOString().slice(0,10),fi=(e,t)=>new Date(`${e}T00:00:00Z`).toLocaleDateString(`en-GB`,{...t,timeZone:`UTC`}),pi=e=>fi(e,{day:`numeric`,month:`short`});function mi(e,t=Date.now()){let n=fi(e,{weekday:`long`,day:`numeric`,month:`long`}),r=e===di(t)?`Today`:e===di(t-ui)?`Yesterday`:``;return r?`${r} · ${n}`:n}function hi(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=di(e.started*1e3);a[t]=(a[t]||0)+1}let o=i.length?di(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=di(t-(n-1-r)*ui);return{key:i,n:a[i]||0,nodata:c&&(o===null||i<o)}})}var gi=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function _i(e,t,n,r=Date.now()){let i={},a=e=>i[e]||={key:e,runs:[],asks:[]};for(let t of Yr(e,(e||[]).length))Number.isFinite(t.started)&&a(di(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&&gi(t.length,`run`),i&&gi(i,`gate ask`)];return{key:e,title:mi(e,r),sum:o.filter(Boolean).join(` · `),runs:t,gate:i?{title:a,n:i}:null}})}var vi=E[8];function yi({vals:e,i:t,sweep:n=!1,fill:r=!1}){let i=(0,B.useRef)(null),a=e.join(`,`);(0,B.useLayoutEffect)(()=>{if(n&&i.current&&w())return T(i.current,{strokeDasharray:1,strokeDashoffset:1}),y(S(i.current,{strokeDashoffset:[1,0],duration:vi,ease:A}),vi)},[a,n]);let o=Math.max(1,...e),s=96/(e.length-1),c=e.map((e,t)=>`${(t*s).toFixed(1)},${(20-e/o*17).toFixed(1)}`),[l,u]=c[c.length-1].split(`,`),d=(0,G.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,preserveAspectRatio:r?`none`:void 0,"aria-hidden":`true`,style:{"--i":t},children:[(0,G.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,G.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${c.join(` `)} 96,21`}),(0,G.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:c.join(` `),ref:i}),r?null:(0,G.jsx)(`circle`,{className:`spk-end`,cx:l,cy:u,r:`2.4`})]});return r?(0,G.jsxs)(`span`,{className:`spark-fill`,style:{"--i":t},children:[d,(0,G.jsx)(`i`,{className:`spk-end`,"aria-hidden":`true`,style:{top:`${u/22*100}%`}})]}):d}function bi(e,t){let n=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{let e=n.current?[...n.current.querySelectorAll(`[data-sweep]`)]:[];if(e.length&&w())return T(e,{[t]:0}),y(S(e,{[t]:[0,1],duration:vi,ease:A}),vi)},[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)`},xi={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}},Si={craft:Y.craft,rigor:Y.verify,ops:Y.process,process:Y.security,comms:Y.comms},Ci=e=>Si[e]||`var(--text-3)`,wi={design:{label:`Design`,c:Y.context},build:{label:`Build`,c:Y.craft},review:{label:`Review`,c:Y.security},ship:{label:`Ship`,c:Y.process},understand:{label:`Understand`,c:Y.verify},learn:{label:`Learn`,c:Y.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Custom`,c:`oklch(0.72 0.025 250)`}},Ti=Object.keys(wi);function Ei(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 Di=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],Oi=e=>{let t=``;for(let[n,r]of Di)for(;e>=n;)t+=r,e-=n;return t};function ki(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?Oi(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}function Ai(e){if(Mi[e])return Mi[e].label;let t=/^([a-z]+)\.(\d+)$/.exec(e);return t?`${t[1][0].toUpperCase()}${t[1].slice(1)} rule ${t[2]}`:/^[IVXLC]+$/.test(e)?`Rule ${e}`:e}var ji=new Set([`I`,`III`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),Mi={I:{key:`secretsGate`,label:`Secrets gate`},III:{key:`doneGate`,label:`Done gate`},IV:{key:`deletionGate`,label:`Deletion gate`},VIII:{key:`testNote`,label:`Test note`},ownership:{key:`ownershipGate`,label:`Ownership gate`},"rigor.5":{key:`externalGate`,label:`External gate`}},Ni=new Set([`process.1`,`process.5`,`ops.2`]),Pi=new Set([...ji].filter(e=>e.includes(`.`)&&!Ni.has(e)&&!Mi[e])),Fi={I:{arm:`Writes that would carry a credential-shaped string are refused again.`,off:`A write carrying a credential-shaped string (on OpenCode, also a write to a key file) stops being refused. Rule I’s text still binds the agent; protected checks, real data loss and commit/push consent stay gated.`},III:{arm:`A turn that edited files cannot end before the checks in a non-empty .geneseed/done-checks.txt pass. With no such file, inferred checks only warn.`,off:`A turn that edited files may end without its checks passing, listed or inferred, and the session’s done-gate line goes. Rule III’s text still binds the agent; every other gate stays.`},IV:{arm:`Commands that would lose data nothing else holds ask again.`,off:`Commands that would really lose data — discarding uncommitted work, deleting an unpushed branch, removing untracked files — stop asking. Rule IV’s text still binds the agent; secrets, root-wide scans and commit/push consent stay gated.`},VIII:{arm:`A write that weakens a test gets a note again, when it happens and when the turn ends.`,off:`A write that adds a skip marker or drops an assertion gets no note, when it happens or when the turn ends. Rule VIII’s text still binds the agent; the done checks and every other gate stay. Run geneseed rebuild-all first: an older hook shim refuses the new flag, and every gate on that hook goes silent.`},ownership:{desc:`Stops the first write in an undecided application, once per session.`,arm:`The first write in an undecided application stops once again.`,off:`The first write in an undecided application is no longer stopped, the setup proposal leaves the install’s AGENT.md, and no decline reminder prints. A repo with mode: on still runs its checkpoints, and the Credo section still binds.`},"rigor.5":{arm:`Writes to a protected check or a gate’s own configuration ask again.`,off:`Writes to a protected check or a gate’s own configuration stop asking. The agent can then edit hook settings and AGENT.md gate markers unasked, so every other gate holds only while it leaves its wiring alone. OpenCode’s own permission.edit keys still ask. The rule’s text is not touched: excluding it is the rule’s own switch. Run geneseed rebuild-all first: an older hook shim refuses the new flag, and every gate on that hook goes silent.`}},Ii={I:{on:`A file write (Write, Edit, NotebookEdit) whose new text holds a credential-shaped string: an AWS access key, a GitHub, Anthropic or Slack token, a private-key block. Files named .env* are exempt.`,hosts:`Claude Code and OpenClaude ask you. Bob refuses the write. OpenCode refuses it, and also refuses a write to a key file, such as *.pem, *.key, id_rsa, .ssh/ or .npmrc; on .env* it only warns.`,blind:`Text written by a shell command is not scanned, and other token formats pass.`,off:`The scan stops on every host, OpenCode’s key-file block too. Rule I’s text still binds.`},III:{on:`The end of a turn that edited files under the git root with a file-write tool. It reads the turn’s shell calls in the transcript and never runs a check itself.`,hosts:`Claude Code and OpenClaude: with checks listed in .geneseed/done-checks.txt, the turn cannot end until each one ran unpiped and passed after the last edit (one block per turn). With no list, checks are inferred from the manifests and only warn. OpenCode 1: a reminder on the next request. OpenCode 2 and Bob: not judged.`,blind:`A shell edit (sed -i, a redirect) is no edit here. A check that is piped, masked (|| true) or spelled another way (npx vitest) reads as not run.`,off:`No check at turn end, no done-gate line at start, and no weakened-test line at turn end; learning still runs. Rule III’s text still binds.`},IV:{on:`A shell command that would lose data nothing else holds, judged against the repo’s state: a protected branch deleted or force-pushed, an unpushed branch deleted, reset --hard over unpushed commits, uncommitted work discarded, a stash dropped, the reflog pruned, files git cannot restore removed. Also rm -rf of /, a drive or ~, mkfs, dd over a disk, format, a fork bomb.`,hosts:`Claude Code and OpenClaude ask you. Bob and OpenCode’s guard refuse. OpenCode’s own prompt also asks on git reflog expire, git gc --prune, and a force push or delete of main or master.`,blind:`It reads git, the rm family, find -delete, mkfs, dd and format: a script that deletes files itself passes. When it cannot tell (a glob, a $variable, sh -c, xargs), it asks rather than passes.`,off:`The real-loss check and OpenCode’s Rule IV prompt keys stop. The rm -rf / class still asks (refused on Bob and OpenCode). Rule IV’s text still binds.`},VIII:{on:`A file write to a test file that adds a skip marker (.skip(, xit(, xfail, @Disabled, @Ignore, pytest.mark.skip, t.Skip() or removes an assertion line and adds no other.`,hosts:`Advisory on every host: it asks nothing and blocks nothing. Claude Code and OpenClaude: a note to the agent at the edit, and a line to you at turn end. Bob: a hook-log line. OpenCode: one reminder on the next request, which the done gate’s switch also silences.`,blind:`Shell edits, and an assertion that is loosened in place rather than removed.`,off:`No note at the edit or at turn end. Rule VIII’s text still binds; the done checks stay.`},ownership:{on:`The first file write of a session in an application repo (a git root with a build manifest) whose root AGENTS.md has no ## Ownership section. Writes to AGENTS.md or .geneseed/ pass.`,hosts:`Every host refuses that write once and gives the reason to the agent, which asks you to set ownership up or skip; the next write passes. Bob uses exit 2. On Claude Code, OpenClaude and OpenCode a sub-agent never triggers it.`,blind:`Shell writes.`,off:`No first-write stop and no setup proposal. A repo with mode: on still runs its checkpoints, and the Credo section still binds.`},"process.1":{on:`A write to a rule store, user-rules.md or user-rules.draft.md, by a file tool or a parsed shell write. A hardlinked file always asks. Memory writes (MEMORY.md, memory/) pass.`,hosts:`Claude Code and OpenClaude ask you. Bob refuses a file-tool write and only warns on a shell write. OpenCode asks with its own prompt; the guard refuses what the host cannot prompt for, and OpenCode 1 refuses a parsed shell write.`,blind:`bash -c, interpreters, scripts and variables. The change report at turn end still lists store changes made outside an approved write, memory writes included.`,off:`Excluding this rule, or the process pack, is the switch: its hook goes with its text on every host, OpenCode’s permission.edit keys on the rule files too. The change report still lists rule-file changes.`},"process.5":{on:`A shell command whose text holds git, then commit or push (so git log --grep push asks too).`,hosts:`Claude Code and OpenClaude ask you; a loop’s own commits and pushes on its loop/* branch pass. OpenCode asks with its own prompt, and allows a push of HEAD to loop/*. Bob only logs a warning; the command runs.`,blind:`A commit or push made by another program, a script or an alias.`,off:`Excluding this rule, or the process pack, is the switch: commits and pushes stop asking (Bob still logs its warning). The data-loss checks stay.`},"rigor.5":{on:`A write to a path in the project’s .geneseed/protected-checks.txt, to .geneseed/done-checks.txt, or to a gate’s own configuration: hook settings, excludes.json, AGENT.md gate markers, the manifest, any opencode.json(c), the hook shim. Parsed shell writes too (>, tee, sed -i, cp, mv, rm, the PowerShell writers).`,hosts:`Claude Code and OpenClaude ask you. Bob refuses the write; a hook settings.json only when it changes Geneseed’s own entries. OpenCode asks through its permission.edit keys; its guard refuses a protected check, the other hosts’ Geneseed files, and a shell write to any of them.`,blind:`bash -c, pwsh -c, interpreters, scripts, variables and globs: run the same checks in CI.`,off:`Every ask and refusal above stops, except OpenCode’s own permission.edit keys. Excluding the text on this page switches this gate off too; --exclude-rules rigor.5 alone leaves the hook asking.`},"ops.2":{on:`A recursive scan rooted at a filesystem root: find /, du /, grep -r or rg at /, /c or C:\\, Get-ChildItem C:\\ -Recurse.`,hosts:`Claude Code and OpenClaude ask you. Bob and OpenCode refuse it.`,blind:`A deeper path, ls / without -R, a quoted argument, the remote half of ssh, and a scan made by any other program.`,off:`Excluding this rule, or the ops pack, is the switch: a root scan stops asking on every host. The data-loss checks stay.`}},Li=[{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`}],Ri=[{source:`mode`,label:`Mode`,against:`binds how work runs`},{source:`PROFILE.md, posture, theme`,label:`Profile, posture, voice`,against:`inform only; never bind`}],zi=(e,t={})=>Mi[e]?t?.[Mi[e].key]===!1?`Gate off`:`Hook gate`:ji.has(e)?`Hook gate`:`Instruction`;function Bi(e){let t={};for(let n of e||[]){let e=wi[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:wi[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=Ti.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 Vi({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=Ht(l);u&&s.push({id:`drift`,tag:`Local edits`,tone:`warn`,title:X(u,`local edit`),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:`≈${d.tokens.toLocaleString(`en-US`)} tokens, the file's header alone`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=ki(e),i=(o?.items||[]).find(e=>e.name===r),a=i?Ei(i.title).name:Ai(r);s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${X(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:`constitution`,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=Bi(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${X(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`personal/memory`,verb:`Open`,href:`#/personal/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}var Hi=e=>Ht(e.drift),Ui=e=>e.drift?.stale??0;function Wi(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 Gi(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+Hi(t),0),o=n.reduce((e,t)=>e+Ui(t),0),s=e?.doctor,c=s&&!s.ok?`bad`:i||a||o?`warn`:s?`good`:`unknown`,l={good:`Installs healthy.`,unknown:`Checking the installs.`,warn:`Installs need a look.`,bad:`Installs have problems.`}[c],u=[X(n.length,`active install`)+(r?`, ${r} disabled`:``),s?s.ok?`doctor clean`:`doctor found ${X(s.problems.length,`problem`)}`:`doctor still running`,i?`${X(i,`install`)} behind source`:`all in sync with source`,a?X(a,`local edit`):`no local edits`];return o&&u.push(`${X(o,`file`)} behind source`),{tone:c,head:l,facts:u}}var Ki=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],qi=e=>e?e.carrier+e.skills+e.agents+e.context:0,Ji=e=>e.state===`active`&&(e.verdict===`behind`||Ht(e.drift)>0||(e.drift?.stale??0)>0),Z=e=>`≈${(e/4/1e3).toFixed(1)}k`,Yi=sn,Xi=.85;function Zi(e){let t=({chars:e,budget:t,cut:n})=>e+(n?t:0),n=(e||[]).filter(e=>e.session_start).reduce((e,n)=>!e||t(n.session_start)>t(e.session_start)?n:e,null);if(!n)return null;let{chars:r,budget:i,cut:a}=n.session_start;return{install:n,size:`${(r/1e3).toFixed(1)} / ${i/1e3} KB`,cut:a,near:a||r/i>=Xi}}var Qi=e=>({id:e.id,host:e.host,path:e.path,label:Yi(e)});function $i({fleet:e,usage:t,defaultLabel:n=null,...r}){let i=[],a=e?.doctor;a&&!a.ok&&i.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(a.problems.length,`problem`)}`,detail:a.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});for(let t of(e?.installs||[]).filter(e=>e.state===`active`)){if(t.verdict===`behind`){let e=t.built_epoch?`built ${Lt(t.built_epoch)} ago`:`never built`,n=Ui(t);i.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${Yi(t)} is behind its source`,detail:n?`${e} · ${X(n,`file`)} behind`:e,where:q(t.host).label,verb:`Rebuild`,act:`rebuild`,installs:[Qi(t)]})}let e=Hi(t);e&&i.push({id:`drift:${t.id}`,tag:`Local edits`,tone:`warn`,title:`${Yi(t)}: ${X(e,`local edit`)}`,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}=Wi(t);i.push({id:`usage`,tag:`Usage`,tone:``,sugg:!0,title:`${X(e,`skill`)} never fired in 30 days`,detail:`${X(n,`agent`)} too`,where:`library/skills`,verb:`Triage`,href:`#/skills`})}let o=Zi(e?.installs);if(o?.near){let e=o.cut?`were cut to fit the session-start budget`:`are near the session-start budget`;i.push({id:`session-start`,tag:`Session`,tone:`warn`,sugg:!0,title:o.install.shared?`Session files ${e}`:`${Yi(o.install)}: session files ${e}`,detail:`${o.size} · without project context`,where:`personal`,verb:`Trim`,href:`#/personal`})}let s=(e?.installs||[]).filter(e=>e.state===`active`);s.some(e=>e.shared&&e.facts===0)&&i.push({id:`memory:shared`,tag:`Memory`,tone:``,sugg:!0,title:`Memory holds no facts`,detail:`no durable lesson recorded yet`,where:`personal/memory`,verb:`Open`,href:`#/personal/memory`});for(let e of s.filter(e=>!e.shared&&e.facts===0))i.push({id:`memory:${e.id}`,tag:`Memory`,tone:``,sugg:!0,title:`${Yi(e)}: memory holds no facts`,detail:`no durable lesson recorded yet`,where:`personal/memory`,verb:`Open`,href:`#/personal/memory`});let c=Vi({...r,overview:r.overview&&{...r.overview,doctor:null,diff:null},setup:s.some(e=>e.facts!=null)&&r.setup?{...r.setup,facts:null}:r.setup}),l=new Set([`profile`,`rules`]);for(let e of c){let t=n&&l.has(e.id)&&!r[e.id]?.shared?{title:`${n}: ${e.title}`}:{};i.push({...e,...t,sugg:!0})}return i}function ea(e,t){return(e?.rules||[]).map(e=>{let n=ki(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?Ei(r.title).name:e.rule===`wiki`?`Wiki guard`:Ai(n)}})}var ta=e=>(e||[]).filter(e=>e.state===`active`&&e.cost);function na(e){let t=ta(e).filter(e=>e.cost.ceiling>0&&Number.isFinite(e.cost.carrier)),n=e=>e.cost.carrier/e.cost.ceiling,r=t.reduce((e,t)=>!e||n(t)>n(e)?t:e,null);if(!r)return null;let{carrier:i,ceiling:a}=r.cost;return{label:sn(r),carrier:i,ceiling:a,pct:Math.round(n(r)*100)}}function ra(e){let t=ta(e);if(!t.length)return null;let n=t.reduce((e,t)=>qi(t.cost)>qi(e.cost)?t:e),r=t.map(e=>qi(e.cost));return{min:Math.min(...r),max:Math.max(...r),top:n}}var ia=e=>(e?.per_day||[]).reduce((e,t)=>e+t,0);function aa(e,t){let n=ea(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 oa=e=>e.catch(()=>null),sa=e=>e.loading&&!e.data,ca=e=>!e.loading&&!e.data,la=e=>{let t=e.currentTarget.closest(`section`);t&&(t.setAttribute(`tabindex`,`-1`),t.focus())};function ua({what:e,read:t,retry:n=!0}){let r=t.error?`${e} could not be read: ${t.error}`:`${e} could not be read.`;return n?(0,G.jsxs)(`div`,{className:`error-state`,children:[(0,G.jsx)(br,{error:r}),(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Retry: ${e.toLowerCase()}`,onClick:e=>{la(e),t.reload()},children:`Retry`})]}):(0,G.jsx)(br,{error:r,role:null})}var da=e=>Promise.resolve().then(e),fa=(e,t)=>`${t?Math.min(100,e/t*100):0}%`,pa=36e5,ma=5e3,ha=`This checkout cannot pull: it has local changes, a detached HEAD, no upstream or a diverged branch.`;function ga({update:e,onAction:t,canFill:n=!0}){if(!e)return null;let r=e.install??(e.git?`git`:`npm-global`),i=r===`git`&&typeof e.behind==`number`?e.behind:null,a=r===`git`&&e.behind===null&&e.checking,o=i===null?e.latest===null||a?(0,G.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · `,e.checking?`checking…`:`update check unavailable`]}):e.available?(0,G.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,G.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}):(0,G.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):i>0?(0,G.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current??``,` `,(0,G.jsxs)(`span`,{className:`ver-new`,children:[i,` commit`,i===1?``:`s`,` to pull`]})]}):(0,G.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · latest`]});if(r===`other`)return!e.available||!e.command?o:(0,G.jsxs)(G.Fragment,{children:[o,(0,G.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,G.jsx)(`code`,{className:`mono`,children:e.command})]})]});if(e.behind===!1&&e.available)return(0,G.jsx)(`span`,{title:ha,children:o});if(a||e.behind===!1||r!==`git`&&!e.available)return o;let s=i===null?!!e.available:i>0;return(0,G.jsxs)(G.Fragment,{children:[o,(0,G.jsx)(`button`,{type:`button`,className:s&&n?`btn`:`btn ghost`,title:r===`git`?i===0?`Nothing to pull: this is the latest. Pulls and rebuilds every install anyway.`:`git pull, then rebuild every install`:`npm install -g geneseed@latest, then rebuild every install`,onClick:()=>t(`update`),children:`Update`})]})}var _a={good:`M8 12.5l2.7 2.7L16 9.5M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`,warn:`M12 3 22 20H2zM12 10v4M12 17v.5`,bad:`M9 9l6 6M15 9l-6 6M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`,unknown:`M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`};function va({tone:e}){return(0,G.jsx)(`svg`,{className:`health-ico`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:_a[e]||_a.warn})})}function ya({fleet:e,error:t,behind:n,onAction:r,onRebuild:i}){let a=(0,G.jsx)(`button`,{type:`button`,className:`btn ghost ldg-doctor`,onClick:()=>r(`doctor`),children:`Run doctor`});if(!e)return t?(0,G.jsxs)(`section`,{className:`health unknown`,"aria-labelledby":`ldg-health`,children:[(0,G.jsx)(va,{tone:`warn`}),(0,G.jsx)(`div`,{className:`health-text`,role:`status`,children:(0,G.jsx)(`h2`,{id:`ldg-health`,children:`Status unknown`})}),(0,G.jsx)(`div`,{className:`health-acts`,children:a})]}):(0,G.jsx)(`div`,{className:`health unknown`,"aria-busy":`true`,children:(0,G.jsx)(J,{label:`Reading the installs…`})});let o=Gi(e),s=[...o.facts,...e.version?[`Source is ${e.version}`]:[]];return(0,G.jsxs)(`section`,{className:`health ${o.tone}`,"aria-labelledby":`ldg-health`,children:[(0,G.jsx)(va,{tone:o.tone}),(0,G.jsxs)(`div`,{className:`health-text`,role:`status`,children:[(0,G.jsx)(`h2`,{id:`ldg-health`,children:o.head}),(0,G.jsxs)(`p`,{className:`health-facts`,children:[s.join(` · `),`.`]})]}),(0,G.jsxs)(`div`,{className:`health-acts`,children:[a,n.length?(0,G.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 ba({chars:e}){let t=D(e);return(0,G.jsxs)(`span`,{className:`mono`,children:[Z(t??e),` tok`]})}var Q=e=>Math.round(e/4),xa={carrier:`accent`,skills:`skill`,agents:`agent`,context:`context`},Sa=e=>Ki.map(([t,n])=>({key:t,label:n,n:Q(e[t]),tone:xa[t]})),Ca=sn;function wa({cost:e,i:t}){let n=2*Math.PI*14,r=e.ceiling?Math.min(1,e.carrier/e.ceiling):0;return(0,G.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,G.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,G.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 Ta({id:e,title:t,aside:n,className:r=``,children:i}){return(0,G.jsxs)(`section`,{className:`panel ldg-kpi ${r}`,"aria-labelledby":e,children:[(0,G.jsxs)(`div`,{className:`ldg-kpi-head`,children:[(0,G.jsx)(`h3`,{id:e,children:t}),n]}),i]})}var Ea=(0,G.jsx)(`p`,{className:`dim`,children:`The installs could not be read.`});function Da({installs:e,pending:t,failed:n}){let r=na(e);return(0,G.jsx)(Ta,{id:`ldg-k-root`,title:`Root file vs ceiling`,className:`ldg-kpi-root`,children:t?(0,G.jsx)(J,{}):n?Ea:r?(0,G.jsxs)(`div`,{className:`ldg-kpi-ring`,children:[(0,G.jsxs)(`span`,{className:`ldg-ringbox`,children:[(0,G.jsx)(Ur,{value:Q(r.carrier),max:Q(r.ceiling),segments:r.pct>100?[{key:`v`,label:`root file`,n:Q(r.carrier),tone:`bad`}]:void 0,size:104,stroke:10,label:`Worst root file: ${r.label}, ${r.pct} percent of its ceiling`}),(0,G.jsxs)(`span`,{className:`mono ldg-ring-pct`,"aria-hidden":`true`,children:[r.pct,`%`]})]}),(0,G.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,G.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(r.carrier)} tokens`}),(0,G.jsx)(`span`,{className:`dim`,children:`of ${Z(r.ceiling)} ceiling`}),(0,G.jsx)(`span`,{className:`dim`,title:r.label,children:`Highest install`})]})]}):(0,G.jsx)(`p`,{className:`dim`,children:`No root file to measure.`})})}function Oa({installs:e,pending:t,failed:n}){let r=ra(e),i=Zi(e),a=r&&(Z(r.min)===Z(r.max)?Z(r.max):`${Z(r.min)} – ${Z(r.max)}`);return(0,G.jsx)(Ta,{id:`ldg-k-cost`,title:`Loaded every turn`,className:`ldg-kpi-cost`,children:t?(0,G.jsx)(J,{}):n?Ea:r?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,G.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(qi(r.top.cost))} tokens`}),(0,G.jsx)(`span`,{className:`dim`,title:Ca(r.top),children:`Highest install`})]}),(0,G.jsx)(Gr,{parts:Sa(r.top.cost),label:`Loaded every turn, ${Ca(r.top)}`}),(0,G.jsx)(`span`,{className:`dim ldg-kpi-cap`,children:`All installs: ${a} tokens`}),i?(0,G.jsx)(`span`,{className:`ldg-kpi-cap ${i.near?`t-warn`:`dim`}`,children:`Session start · ${i.size} · without project context`}):null]}):(0,G.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`})})}function ka({usage:e,read:t,pending:n}){let r=e?.enabled?e.days_counted<30&&e.since?`since ${e.since}`:`30 days`:null;return(0,G.jsx)(Ta,{id:`ldg-k-calls`,title:`Skill and agent calls`,className:`ldg-kpi-calls`,aside:r?(0,G.jsx)(`span`,{className:`mono dim ldg-kpi-aside`,children:r}):null,children:n?(0,G.jsx)(J,{}):e?e.enabled?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:(0,G.jsx)(j,{value:ia(e)})}),e.per_day?.length>1?(0,G.jsx)(yi,{vals:e.per_day,i:0,fill:!0}):null]}):(0,G.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`}):(0,G.jsx)(ua,{what:`Usage`,read:t})})}function Aa({gates:e,laws:t,read:n,pending:r}){let i=aa(e,t);return(0,G.jsx)(Ta,{id:`ldg-k-gates`,title:`Gate asks · 30 days`,className:`ldg-kpi-gates`,aside:(0,G.jsx)(`a`,{className:`ldg-kpi-aside`,href:`#/laws`,"aria-label":`Open the Constitution`,children:`Constitution →`}),children:r?(0,G.jsx)(J,{}):e?i.total?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`span`,{className:`ldg-kpi-line`,children:[(0,G.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:i.total}),` `,(0,G.jsx)(`span`,{className:`dim`,children:`· ${i.top.name} ${i.top.n}`})]}),i.perDay.length>1?(0,G.jsx)(yi,{vals:i.perDay,i:1,fill:!0}):null]}):(0,G.jsx)(`p`,{className:`dim`,children:`No gate asked in 30 days.`}):(0,G.jsx)(ua,{what:`Gate activity`,read:n})})}var ja=6;function Ma({i:e}){if(!e.diffable)return(0,G.jsx)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:`not checkable`});let t=Ht(e.drift),n=e.drift?.stale??0;return(0,G.jsxs)(G.Fragment,{children:[n||t?(0,G.jsx)(`span`,{className:`ldg-syncbar`,children:(0,G.jsx)(Gr,{parts:[{key:`stale`,label:`Behind source`,n,tone:`warn`},{key:`edited`,label:`Local edits`,n:t,tone:`bad`}],label:`Sync with source, ${Ca(e)}`,legend:!1})}):null,t?(0,G.jsxs)(`span`,{className:`mono t-bad`,children:[t,` edited`]}):e.drift?.linked?(0,G.jsxs)(`span`,{className:`mono dim`,title:`Yours: links Geneseed leaves alone`,children:[e.drift.linked,` linked by you`]}):n?null:(0,G.jsx)(`span`,{className:`mono dim`,children:`No edits`}),n?(0,G.jsxs)(`div`,{className:`mono dim ldg-sub`,children:[n,` file`,n===1?``:`s`,` behind`]}):null]})}function Na(e){if(!e.diffable)return`Not checkable: local edits are only checked for global installs.`;let t=e.drift||{},n=[t.stale?`${t.stale} behind`:null,t.edited?`${t.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 Pa({i:e,n:t,onRebuild:n,onOpen:r,busy:i}){let[a,o]=(0,B.useState)(!1),s=Ca(e),c=(0,G.jsxs)(`td`,{className:`ldg-where`,children:[i?(0,G.jsx)(`span`,{className:`console-progress`,role:`progressbar`,"aria-label":`Rebuilding ${s}`}):null,(0,G.jsxs)(`div`,{className:`ldg-who`,children:[Ji(e)?(0,G.jsx)(`svg`,{className:`ldg-glyph ${Ht(e.drift)?`bad`:`warn`}`,viewBox:`0 0 10 10`,role:`img`,"aria-label":Ht(e.drift)?`local edits`:`needs a rebuild`,children:(0,G.jsx)(`path`,{d:`M5 1 9 9H1z`,fill:`currentColor`})}):null,e.state===`active`&&e.cost?(0,G.jsx)(`span`,{className:`ldg-phone-ring`,"aria-hidden":`true`,children:(0,G.jsx)(wa,{cost:e.cost,i:t})}):null,(0,G.jsxs)(`div`,{className:`ldg-name`,children:[(0,G.jsx)(`span`,{className:`ldg-host`,children:q(e.host).label}),` `,(0,G.jsx)(`span`,{className:`dim`,children:e.scope}),(0,G.jsx)(`div`,{className:`mono dim ldg-path`,title:e.path,children:e.path})]})]})]});if(e.state!==`active`)return(0,G.jsxs)(`tr`,{className:`ldg-off`,children:[c,(0,G.jsx)(`td`,{className:`ldg-build`,children:(0,G.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,G.jsx)(`td`,{className:`ldg-sync`}),(0,G.jsx)(`td`,{className:`ldg-root`}),(0,G.jsx)(`td`,{className:`ldg-total`}),(0,G.jsx)(`td`,{className:`ldg-act`,children:(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`})})]});let l={synced:(0,G.jsx)(`span`,{className:`pill good`,children:`in sync`}),behind:(0,G.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,G.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],u=qi(e.cost),d=e.cost?.ceiling?Math.round(e.cost.carrier/e.cost.ceiling*100):null,f=e.cost?.skillCeiling?Math.round(e.cost.skills/e.cost.skillCeiling*100):null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`tr`,{className:a?`ldg-open`:``,children:[c,(0,G.jsxs)(`td`,{className:`ldg-build`,children:[l,(0,G.jsx)(`div`,{className:`mono dim ldg-sub`,children:e.built_epoch?`built ${Lt(e.built_epoch)} ago`:`never built`})]}),(0,G.jsx)(`td`,{className:`ldg-sync`,children:(0,G.jsx)(Ma,{i:e})}),(0,G.jsx)(`td`,{className:`ldg-root`,children:e.cost?d===null?(0,G.jsx)(`span`,{className:`dim`,children:`no ceiling`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`ldg-rootbar`,children:(0,G.jsx)(Kr,{value:Q(e.cost.carrier),max:Q(e.cost.ceiling),label:`Root file, ${s}`,tone:d>100?`bad`:`accent`})}),(0,G.jsx)(`span`,{className:`mono dim ldg-sub`,children:`${Z(e.cost.carrier)} / ${Z(e.cost.ceiling)} · ${d}%`})]}):(0,G.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,G.jsx)(`td`,{className:`ldg-total`,children:e.cost?(0,G.jsx)(ba,{chars:u}):null}),(0,G.jsxs)(`td`,{className:`ldg-act`,children:[Ji(e)?(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Rebuild ${s}`,title:`Rebuilds ${s} only`,onClick:()=>n([Qi(e)]),children:`Rebuild`}):(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`}),(0,G.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,G.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,G.jsx)(`path`,{d:a?`M6 15l6-6 6 6`:`M6 9l6 6 6-6`})})})]})]}),a?(0,G.jsx)(`tr`,{className:`ldg-detail`,id:`ldg-detail-${e.id}`,children:(0,G.jsx)(`td`,{colSpan:ja,children:(0,G.jsxs)(`div`,{className:`ldg-detail-grid`,children:[(0,G.jsxs)(`div`,{className:`ldg-detail-col`,children:[e.cost?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`ldg-lbl`,children:`What rides every turn · ${Z(u)} tokens`}),(0,G.jsx)(Gr,{parts:Sa(e.cost),label:s}),f===null?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`ldg-rootbar`,children:(0,G.jsx)(Kr,{value:Q(e.cost.skills),max:Q(e.cost.skillCeiling),label:`Skill list, ${s}`,tone:f>100?`bad`:`skill`})}),(0,G.jsx)(`span`,{className:`mono dim ldg-sub`,children:`Skill list · ${Z(e.cost.skills)} / ${Z(e.cost.skillCeiling)} ceiling · ${f}%`})]})]}):(0,G.jsx)(`span`,{className:`dim`,children:`Always-on cost not measured.`}),(0,G.jsx)(`span`,{className:`dim`,children:[`Voice ${e.theme}`,`${e.footprint} footprint`,e.posture&&`${e.posture} posture`,e.mode&&`${e.mode} mode`].filter(Boolean).join(` · `)})]}),(0,G.jsxs)(`div`,{className:`ldg-detail-col`,children:[(0,G.jsx)(`span`,{className:`ldg-lbl`,children:`Differs from source`}),(0,G.jsx)(`span`,{className:`muted`,children:Na(e)}),e.diffable?(0,G.jsx)(`span`,{children:(0,G.jsx)(`a`,{className:`btn ghost sm`,href:`#/installs/edits`,"aria-label":`View diff for ${s}`,onClick:()=>Ir(`edits`,e.id),children:`View diff`})}):null]})]})})}):null]})}function Fa({rows:e,pending:t,partial:n,onRetry:r,onAction:i,onRebuild:a}){let o=e.filter(e=>!e.sugg).length;return t?(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,G.jsx)(`div`,{className:`panel-head panel-head-rule`,children:(0,G.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`})}),(0,G.jsx)(J,{})]}):(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,G.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,G.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`}),(0,G.jsxs)(`span`,{className:`mono dim`,children:[o,` problem`,o===1?``:`s`,`, `,e.length-o,` suggestion`,e.length-o===1?``:`s`]})]}),e.length?(0,G.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,G.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,G.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,G.jsxs)(`span`,{className:`needs-what`,children:[(0,G.jsx)(`b`,{children:e.title}),e.detail?(0,G.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,G.jsx)(`span`,{className:`mono dim needs-where`,title:e.where,children:e.where}),e.act?(0,G.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,"aria-label":`${e.verb}: ${e.title}`,onClick:()=>e.installs?a(e.installs):i(e.act),children:e.verb}):(0,G.jsx)(`a`,{className:`needs-verb`,href:e.href,"aria-label":`${e.verb}: ${e.title}`,children:e.verb})]},e.id))}):n?null:(0,G.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`}),n?(0,G.jsxs)(`p`,{className:`dim`,children:[`Some reads failed, so this list may be incomplete.`,` `,(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Retry: the failed reads`,onClick:e=>{la(e),r()},children:`Retry`})]}):null]})}function Ia({usage:e,read:t,pending:n}){let r=(0,G.jsxs)(`div`,{className:`panel-head`,children:[(0,G.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,G.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,n?(0,G.jsx)(J,{}):(0,G.jsx)(ua,{what:`Usage`,read:t,retry:!1})]});if(!e.enabled)return(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,(0,G.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,(0,G.jsx)(`p`,{className:`muted`,children:e.since?(0,G.jsxs)(G.Fragment,{children:[`Counting since `,(0,G.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,G.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,G.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,G.jsx)(`p`,{className:`dim chart-foot`,children:`Rankings and the never-fired count appear once 30 days are counted, so a new install is not told every skill is unused.`})]});let i=e.rows.slice(0,7),a=Math.max(1,...i.map(e=>e.n));return(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[r,(0,G.jsx)(`ul`,{className:`ubars`,children:i.map((e,t)=>(0,G.jsxs)(`li`,{className:e.kind,children:[(0,G.jsxs)(`span`,{className:`ub-name`,title:`${e.name} ${e.kind}`,children:[e.name,` `,(0,G.jsx)(`span`,{className:`dim`,children:e.kind})]}),(0,G.jsx)(`span`,{className:`ub-trk`,children:(0,G.jsx)(`i`,{style:{width:fa(e.n,a),"--i":t}})}),(0,G.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,G.jsxs)(`div`,{className:`ub-never`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`b`,{children:Wi(e).skills}),` skills never fired`]}),(0,G.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function La({count:e,canFill:t,onAction:n,view:r,dataRev:i}){let o=(0,B.useRef)(null),{data:s,reload:c}=U(()=>oa(a.update()).then(e=>(e?o.current=e:o.current?.checking&&(o.current={...o.current,checking:!1}),o.current)),[i]);(0,B.useEffect)(()=>{let e=setInterval(c,pa),t=()=>{document.visibilityState===`visible`&&c()};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[c]);let l=!!s?.checking;return(0,B.useEffect)(()=>{if(!l)return;let e=setTimeout(c,ma);return()=>clearTimeout(e)},[l,s,c]),(0,G.jsx)(Hr,{title:`Overview`,sub:e===null?null:`${e} install${e===1?``:`s`} on this machine`,actions:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ga,{update:s,onAction:n,canFill:t}),r]})})}function Ra({overview:e,setup:t,runs:n,onAction:r,dataRev:i,banner:o,view:s}){let c=xn(),[l,u]=(0,B.useState)({}),d=U(()=>a.fleet(),[i]),{data:f,error:p,reload:m}=d,h=U(()=>a.usage(),[i]),g=U(()=>a.gates(),[i]),{data:_}=h,{data:v}=g,y=Br(i),b=U(()=>a.activity(),[i]),x=U(()=>a.profile(),[i]),S=U(()=>da(()=>a.catalog(`skills`)),[i],`catalog:skills`),C=U(()=>da(()=>a.catalog(`laws`)),[i],`catalog:laws`),{data:w}=y,{data:ee}=b,{data:T}=x,{data:te}=S,{data:E}=C,D=sa(d),O=[d,h,y,b,x,S,C],k=O.some(sa),A=ca(d),j=f?.installs||[],M=e=>{Ir(`hosts`,e.id),window.location.hash=`#/installs/hosts`},N=Pr(i),P=$i({defaultLabel:N?.length>1?Ca(N[0]):null,fleet:f,usage:_,overview:e,setup:t,rules:w,activity:ee,profile:T,skills:te,laws:E}),F=j.filter(Ji).map(Qi),I=async e=>{let t=e.map(e=>e.label);if(!await c(`Rebuild ${t.join(`, `)}? Each is re-rendered from source with its own settings.`,{title:e.length===1?`Rebuild ${t[0]}?`:`Rebuild ${e.length} installs?`,confirmLabel:`Rebuild`}))return;let n=await r(`rebuild`,{installs:e.map(({host:e,path:t})=>({host:e,path:t}))});n&&u(t=>({...t,[n]:e.map(e=>e.id)}))},ne=new Set(Object.entries(l).filter(([e])=>n?.find(t=>t.id===e)?.status===`running`).flatMap(([,e])=>e));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(La,{count:f?j.length:null,canFill:!F.length,onAction:r,view:s,dataRev:i}),o,(0,G.jsxs)(`div`,{className:`ov-stack ldg`,children:[(0,G.jsx)(ya,{fleet:f,error:p,behind:F,onAction:r,onRebuild:I}),(0,G.jsxs)(`div`,{className:`ldg-kpis`,role:`group`,"aria-labelledby":`ldg-kpis-h`,children:[(0,G.jsx)(`h2`,{id:`ldg-kpis-h`,className:`sr-only`,children:`Key figures`}),(0,G.jsx)(Da,{installs:j,pending:D,failed:A}),(0,G.jsx)(Oa,{installs:j,pending:D,failed:A}),(0,G.jsx)(ka,{usage:_,read:h,pending:sa(h)}),(0,G.jsx)(Aa,{gates:v,laws:E,read:g,pending:sa(g)})]}),(0,G.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,G.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,G.jsx)(`h2`,{id:`ldg-fleet`,children:`Installs`}),f?.source_fp?(0,G.jsxs)(`span`,{className:`mono dim`,children:[`source `,f.source_fp]}):null]}),p&&f?(0,G.jsxs)(`p`,{className:`dim`,role:`status`,children:[`Could not refresh the installs — showing the last read.`,` `,(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]}):null,(0,G.jsx)(`div`,{className:`ldg-scroll`,children:(0,G.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,G.jsx)(`caption`,{className:`sr-only`,children:`Installs`}),(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`th`,{scope:`col`,children:`Install`}),(0,G.jsx)(`th`,{scope:`col`,className:`ldg-build`,children:`Build`}),(0,G.jsx)(`th`,{scope:`col`,className:`ldg-sync`,children:`Sync with source`}),(0,G.jsx)(`th`,{scope:`col`,className:`ldg-root`,children:`Root file · ceiling`}),(0,G.jsx)(`th`,{scope:`col`,className:`ldg-total`,children:`Always-on`}),(0,G.jsx)(`th`,{scope:`col`,children:(0,G.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,G.jsxs)(`tbody`,{children:[p&&!f?(0,G.jsx)(`tr`,{children:(0,G.jsxs)(`td`,{colSpan:ja,children:[(0,G.jsx)(`span`,{className:`dim`,role:`status`,children:`Could not read the installs`}),` `,(0,G.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]})}):null,D?(0,G.jsx)(`tr`,{children:(0,G.jsx)(`td`,{colSpan:ja,children:(0,G.jsx)(J,{})})}):null,j.map((e,t)=>(0,G.jsx)(Pa,{i:e,n:t,onRebuild:I,onOpen:M,busy:ne.has(e.id)},e.id))]})]})})]}),(0,G.jsxs)(`div`,{className:`ldg-bottom`,children:[(0,G.jsx)(Fa,{rows:P,pending:k,partial:O.some(ca),onRetry:()=>O.filter(ca).forEach(e=>e.reload()),onAction:r,onRebuild:I}),(0,G.jsx)(Ia,{usage:_,read:h,pending:sa(h)})]})]})]})}var za=`geneseed-understand-seen`,Ba=`understand`;function Va(){try{let e=JSON.parse(localStorage.getItem(za));return Array.isArray(e)?e:[]}catch{return[]}}var Ha=`modulepreload`,Ua=function(e){return`/`+e},Wa={},Ga=function(e){return e.pathname.endsWith(`.css`)},Ka=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=Ua(t,n);let r=s(t),i=Ga(r);return Ka(Wa,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`:Ha,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},qa=`geneseed-newhere-dismissed`,Ja=(0,B.lazy)(()=>$(()=>import(`./Dashboard-BgLArtgu.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5])));function Ya({harness:e}){let[t,n]=(0,B.useState)(()=>!!localStorage.getItem(qa)),{data:r}=U(()=>t?Promise.resolve(null):a.docs(e).catch(()=>null),[t,e]),i=r?.groups?.find(e=>e.id===`understand`)?.pages||[],o=Va(),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,G.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,G.jsxs)(`div`,{className:`newhere-body`,children:[(0,G.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,G.jsxs)(`p`,{children:[i.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),c?(0,G.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${c} of ${i.length} read`,children:i.map(e=>(0,G.jsx)(`i`,{className:o.includes(e.id)?`f`:``},e.id))}):null]}),(0,G.jsx)(`a`,{className:`btn ghost`,href:`#/docs/${encodeURIComponent(i[s].id)}`,children:c?`Continue · step ${s+1}`:`Start`}),(0,G.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(qa,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function Xa({layout:e,onLayout:t}){return(0,G.jsx)(jn,{"aria-label":`View`,children:xt.map(n=>(0,G.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 Za({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}=U(()=>Promise.resolve().then(()=>a.installs()).catch(()=>null),[u],`installs`);if(!e)return t?(0,G.jsx)(br,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,G.jsx)(J,{});if(!(d?d.installs?.some(e=>e.state===`active`):e.deployed))return f&&!d?(0,G.jsx)(J,{}):(0,G.jsx)(Mr,{onAction:s});let p=(0,G.jsx)(Ya,{harness:hn(e.emit)}),m=l?(0,G.jsx)(Xa,{layout:c,onLayout:l}):null;return c===`overview`?(0,G.jsx)(Ra,{overview:e,setup:i,runs:o,onAction:s,onRetry:n,dataRev:u,view:m,banner:(0,G.jsxs)(G.Fragment,{children:[e.daemon_stale?(0,G.jsx)(xr,{}):null,p]})}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(La,{count:d?d.installs.filter(e=>e.state!==`absent`).length:null,canFill:!1,onAction:s,view:m,dataRev:u}),p,(0,G.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,G.jsx)(`p`,{className:`sub`,children:[e.install&&sn(e.install),e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target,`counts cover every install`].filter(Boolean).join(` · `)}),(0,G.jsxs)(`div`,{className:`row gap-10`,children:[(0,G.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>s(`doctor`),children:`Run doctor`}),(0,G.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>s(`build-all`),children:`Rebuild`})]})]}),(0,G.jsx)(B.Suspense,{fallback:(0,G.jsx)(J,{}),children:(0,G.jsx)(Ja,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:o,onAction:s,layout:c,dataRev:u})})]})}var Qa=(0,B.lazy)(()=>$(()=>import(`./Activity-WQ3ykgxU.js`),__vite__mapDeps([6,1,2,3,7,8,5,9]))),$a=(0,B.lazy)(()=>$(()=>import(`./ActivityDetail-7rt04SkS.js`),__vite__mapDeps([10,1,2,3,8,7,9]))),eo=(0,B.lazy)(()=>$(()=>import(`./Library-B3FuFLel.js`),__vite__mapDeps([11,1,2,3,4,12,13,7,5]))),to=(0,B.lazy)(()=>$(()=>import(`./Kits-CW1e7xNa.js`),__vite__mapDeps([14,1,2,3,7,15,16,17]))),no=(0,B.lazy)(()=>$(()=>import(`./Loops-CwqgnLNw.js`),__vite__mapDeps([18,1,2,3,7,19,20,9,16,15,12,13,5]))),ro=(0,B.lazy)(()=>$(()=>import(`./Factories-BjqzXAw8.js`),__vite__mapDeps([21,1,2,3,9,7,19,16,20,12,13]))),io=(0,B.lazy)(()=>$(()=>import(`./Laws-1Ckf1lbs.js`),__vite__mapDeps([22,1,2,3,7,13,15]))),ao=(0,B.lazy)(()=>$(()=>import(`./Personal-DKLgLa7Z.js`),__vite__mapDeps([23,1,2,3,24,7,15,11,4,12,13,5]))),oo=(0,B.lazy)(()=>$(()=>import(`./Installs-B1OsrHXF.js`),__vite__mapDeps([25,1,2,24,3,7,17]))),so=(0,B.lazy)(()=>$(()=>import(`./Settings-BwErnh-R.js`),__vite__mapDeps([26,1,2,3,5]))),co=(0,B.lazy)(()=>$(()=>import(`./Docs-B5aHp86J.js`),__vite__mapDeps([27,1,2,3,7,12,13,19,15,5])));function lo(){let e=Se(),[t,n]=(0,B.useState)(null),[r,i]=Ze(),[o,s]=nt(),[c,l]=yt(),u=e=>{if(e===o)return;let t=()=>{s(e),l(`curated`)};if(!document.startViewTransition||!w())return t();document.startViewTransition(()=>(0,de.flushSync)(t))},[d,f]=Tt(),[p,m]=(0,B.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[h,g]=(0,B.useState)(!1),_=(0,B.useRef)(null),v=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!h)return;let e=e=>{e.key===`Escape`&&g(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]),(0,B.useEffect)(()=>{if(!h)return;let e=v.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[h]);let y=e=>n({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),[b,x]=(0,B.useState)(0),{overview:S,error:C,themes:ee,reload:T}=Dt(y,()=>x(e=>e+1)),te=()=>{T(),x(e=>e+1)},[E,D]=(0,B.useState)(null),{runs:O,activeId:k,consoleOpen:A,setConsoleOpen:j,runAction:M,cancelJob:N,clearRuns:P}=kt({onFinish:e=>{te(),D({status:e,at:Date.now()})},onError:y}),{data:F}=U(()=>a.setup().catch(()=>null),[b],`setup`),{data:I,loading:ne}=U(()=>a.installs().catch(()=>null),[b],`installs`),L=I?.installs||null,re=O[O.length-1],ie=re?re.status===`running`?`${re.action} running`:`${re.action} ${re.status}`:``;(0,B.useEffect)(()=>{let e=_.current;if(e){if(!Ye(e,ht(c),r)){let t=_t(c);t?Oe(e,t,r):Ae(e,o,r)}document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,getComputedStyle(e).getPropertyValue(`--bg`).trim())}},[r,c,o]);let ae=[{title:`Rebuild all`,desc:`Re-emit every install`,run:()=>M(`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:()=>M(`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:()=>M(`doctor`)},{title:`Restart server`,desc:`Restart the local Geneseed server`,run:()=>lt().catch(y),confirm:{msg:`Restart the local Geneseed server? The console reconnects in a moment.`,title:`Restart the server?`,confirmLabel:`Restart`}},{title:r===`light`?`Switch to dark mode`:`Switch to light mode`,desc:`Appearance`,run:i},...$e.filter(e=>e.id!==o).map(e=>({title:`Skin: ${e.name}`,desc:e.tagline,run:()=>u(e.id)}))].map(e=>({kind:`Actions`,hay:`${e.title} ${e.desc}`.toLowerCase(),...e})),oe={flavour:o,onFlavour:u,accentMode:c,onAccentMode:l};return(0,G.jsx)(`div`,{className:`app fl-${o} ${r===`light`?`light`:``}${h?` nav-open`:``}`,ref:_,children:(0,G.jsxs)(Sn,{children:[(0,G.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,G.jsx)(`a`,{className:`skip-link`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:`Skip to content`}),(0,G.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:ie}),h&&(0,G.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>g(!1)}),(0,G.jsx)($t,{route:e,overview:S,installs:L,onNavigate:()=>g(!1)}),(0,G.jsxs)(`div`,{className:`col`,ref:v,children:[(0,G.jsx)(Pn,{route:e,navOpen:h,onToggleNav:()=>g(e=>!e),actions:ae,mode:r,onToggleMode:i,appearance:oe,dataRev:b}),(0,G.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,G.jsxs)(`div`,{className:[`library`,`kits`,`loops`,`factories`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:[(0,G.jsx)(In,{unreadable:!ne&&!I}),(0,G.jsx)(kr,{activeId:k,finish:E,children:(0,G.jsx)(wr,{children:(0,G.jsx)(B.Suspense,{fallback:(0,G.jsx)(J,{}),children:{overview:()=>(0,G.jsx)(Za,{overview:S,overviewError:C,onRetry:T,themes:ee,setup:F,runs:O,onAction:M,layout:d,onLayout:f,dataRev:b}),laws:()=>(0,G.jsx)(io,{selected:e.item,overview:S,setup:F,onAction:M,dataRev:b}),library:()=>(0,G.jsx)(eo,{overview:S,section:e.section,selected:e.item,dataRev:b,onCountsChanged:T}),kits:()=>(0,G.jsx)(to,{item:e.item,onAction:M,dataRev:b}),loops:()=>(0,G.jsx)(no,{tab:e.tab,item:e.item,dataRev:b}),factories:()=>(0,G.jsx)(ro,{tab:e.tab,item:e.item,dataRev:b}),personal:()=>(0,G.jsx)(ao,{tab:e.tab,item:e.item,setup:F,dataRev:b,onAction:M,onCountsChanged:T}),installs:()=>(0,G.jsx)(oo,{tab:e.tab,overview:S,setup:F,themes:ee,onAction:M,onMutated:te,dataRev:b}),settings:()=>(0,G.jsx)(so,{overview:S,onAction:M}),activity:()=>e.item?(0,G.jsx)($a,{sid:e.item},e.item):(0,G.jsx)(Qa,{}),docs:()=>(0,G.jsx)(co,{page:e.item,onAction:M,overview:S})}[e.page]?.()})},e.page)})]})}),(0,G.jsx)(tn,{route:e,navOpen:h,onMore:()=>g(!0)}),(0,G.jsx)(ur,{runs:O,open:A,busy:!!k,finish:E,onToggle:()=>j(e=>!e),onClear:P,onCancel:N})]}),(0,G.jsx)(Rn,{toast:t,onClose:()=>n(null)}),p&&(0,G.jsx)(yr,{ready:!!S||!!C,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}m(!1)}})]})})}(0,z.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(lo,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{br as $,si as A,re as At,Ur as B,$r as C,lt as Ct,ti as D,xe as Dt,ai as E,Ce as Et,Jr as F,Lr as G,Vr as H,Qr as I,Pr as J,zr as K,Yr as L,hi as M,pi as N,ni as O,ue as Ot,bi as P,xr as Q,Kr as R,Ci as S,U as St,yi as T,me as Tt,Br as U,Hr as V,Ir as W,Er as X,Mr as Y,Ar as Z,Ei as _,Vt as _t,Gi as a,pn as at,wi as b,Lt as bt,Fi as c,nn as ct,Li as d,q as dt,J as et,Ri as f,on as ft,Ai as g,K as gt,ki as h,rn as ht,Va as i,xn as it,li as j,_i as k,R as kt,Ii as l,cn as lt,zi as m,dn as mt,za as n,jn as nt,ea as o,hn as ot,Ni as p,sn as pt,Rr as q,Ba as r,An as rt,Pi as s,mn as st,$ as t,Fn as tt,Mi as u,ln as ut,xi as v,Bt as vt,ci as w,pe as wt,Ti as x,Ut as xt,Si as y,zt as yt,Gr 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-How7SzDZ.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-Ce6qF2nG.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-XKyaHtl9.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/react-C1iE8mnY.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/api-DLDVY3K-.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/motion-RlUl1osO.js">
19
19
  <link rel="modulepreload" crossorigin href="/assets/sections-CtFz7HFH.js">
20
- <link rel="stylesheet" crossorigin href="/assets/index-CsAZq0BQ.css">
20
+ <link rel="stylesheet" crossorigin href="/assets/index-CRWqKxfY.css">
21
21
  </head>
22
22
  <body>
23
23
  <div id="root"></div>
@@ -1,52 +0,0 @@
1
- {
2
- "hooks": {
3
- "PreToolUse": [
4
- {
5
- "matcher": "Bash|PowerShell",
6
- "hooks": [
7
- { "type": "command", "command": "node bin/geneseed-hook.mjs git-gate" }
8
- ]
9
- },
10
- {
11
- "matcher": "Write|Edit|NotebookEdit",
12
- "hooks": [
13
- { "type": "command", "command": "node bin/geneseed-hook.mjs rule-gate" }
14
- ]
15
- }
16
- ],
17
- "SessionStart": [
18
- {
19
- "hooks": [
20
- { "type": "command", "command": "node bin/geneseed-hook.mjs context" }
21
- ]
22
- },
23
- {
24
- "matcher": "startup|clear",
25
- "hooks": [
26
- { "type": "command", "command": "node -e \"process.stdout.write(require('fs').readFileSync('AGENT.md','utf8'))\"" }
27
- ]
28
- }
29
- ],
30
- "Stop": [
31
- {
32
- "hooks": [
33
- { "type": "command", "command": "node bin/geneseed-hook.mjs learn || exit 0" }
34
- ]
35
- }
36
- ],
37
- "SubagentStop": [
38
- {
39
- "hooks": [
40
- { "type": "command", "command": "node bin/geneseed-hook.mjs learn || exit 0" }
41
- ]
42
- }
43
- ],
44
- "PreCompact": [
45
- {
46
- "hooks": [
47
- { "type": "command", "command": "node bin/geneseed-hook.mjs learn || exit 0" }
48
- ]
49
- }
50
- ]
51
- }
52
- }
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{s as i}from"./motion-RlUl1osO.js";import{$ as a,A as o,C as s,D as c,E as l,I as u,M as d,N as f,P as p,St as m,T as h,V as g,bt as _,et as v,gt as y,j as b,k as ee,nt as te,o as ne,w as x}from"./index-How7SzDZ.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{_ as C,a as w,c as T,f as E,g as D,h as O,i as k,l as A,m as j,n as M,o as N,p as P,r as F,s as I,t as L,u as R,v as z}from"./Bonsai-Bfpb6W-1.js";import{n as re,t as ie}from"./usePoll-D5c_qIFZ.js";var B=e(t(),1),V=n(),H=4,U=56*H,W=24,G=165,K=188,q=(e,t)=>e>0?Math.max(1,Math.floor((e-32+W)/(U+W))):Math.max(1,t),J=e=>e.status===`blocked`?`bad`:b(e)?`warn`:e.status===`busy`?`ok`:``,Y=e=>{let t=A(e);return t==null?null:Math.round(t*100)};function X(e,t,n){let r=s[e.status]||s.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),o=Y(e);return[`${e.title||c(e.cwd)||e.session_id}, ${e.chip||e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${o==null?``:`, context ${o} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function ae({s:e,t,mine:n}){let r=Y(e);return(0,V.jsxs)(`div`,{className:`card gd-card`,children:[(0,V.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`dt`,{children:`model`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,V.jsx)(`dt`,{children:`turns`}),(0,V.jsx)(`dd`,{children:e.turns||0}),(0,V.jsx)(`dt`,{children:`context`}),(0,V.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,V.jsx)(`dt`,{children:`compactions`}),(0,V.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,V.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,V.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function Z({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let o=z(e,n),l=(0,B.useMemo)(()=>E(e,{sakura:n}),[o]),u=s[e.status]||s.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=I(e),m=e.title||c(e.cwd)||e.session_id,h=Y(e),g=(0,B.useRef)(null),_=(0,B.useCallback)(e=>a(p,e,Q(g.current)),[a,p]);return(0,V.jsxs)(`a`,{ref:g,className:`gd-tree${b(e)?` gd-needs`:``}`,href:e.href||R(e.session_id),"aria-label":X(e,l,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,Q(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,Q(e.currentTarget)),onBlur:()=>a(null,null),onKeyDown:e=>k(e,l.pads.length,i,_),children:[(0,V.jsx)(F,{t:l,pad:i,swaying:f,onPad:_,px:H}),(0,V.jsxs)(`div`,{className:`gd-cap`,children:[(0,V.jsx)(`div`,{className:`gd-title`,title:m,children:m}),(0,V.jsxs)(`div`,{className:`row wrap gd-pills`,children:[(0,V.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip||e.host||`?`}),(0,V.jsx)(`span`,{className:`badge ${J(e)}`,children:u.label}),t&&(0,V.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,V.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,V.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`})]}),(0,V.jsxs)(`div`,{className:`mono gd-meta`,children:[e.turns||0,` turns`,h==null?``:` · ${h}%`]})]})]})}function oe({pairs:e,count:t}){if(!e.length)return null;let n=t*U+(t-1)*W,r=e=>e*(U+W)+U/2;return(0,V.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*H+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,V.jsxs)(`g`,{className:o,children:[(0,V.jsx)(`path`,{d:`M${e} ${G} C${n} 179 ${n} 159 ${t} 169`}),(0,V.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${G}`})]},`${i}-${a}`)}return(0,V.jsx)(`g`,{className:o,children:(0,V.jsx)(`path`,{d:`M${r(i)} ${K} Q${(r(i)+r(a))/2} 222 ${r(a)} ${K}`})},`${i}-${a}`)})})}var Q=e=>e.offsetLeft;function se({sessions:e,collisions:t}){let[n,r]=(0,B.useState)(N),[i,a]=(0,B.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(M,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=T(P(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>D(e,s);return(0,V.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,V.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,V.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · a tree opens its session; hover or focus shows its details, and a tap or the arrow keys walk its pads`]}),(0,V.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Pink blossom`})]}),l.length>0&&(0,V.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,V.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,V.jsx)(ce,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function ce({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,B.useState)({sid:null,pad:null,x:0}),o=(0,B.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=(0,B.useRef)(null),[c,l]=(0,B.useState)(0);(0,B.useLayoutEffect)(()=>{let e=s.current,t=()=>l(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let u=q(c,e.trees.length),d=C(e.trees,n),f=[];for(let t=0;t<e.trees.length;t+=u)f.push(t);let p=e.trees.findIndex(e=>I(e.s)===i.sid),m=p<0?null:e.trees[p].s,h=m?E(m,{sakura:t}):null,g=h&&i.pad!=null?h.pads[i.pad]:null,_=e.trees.length;return(0,V.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,ref:s,children:[f.map(n=>{let a=e.trees.slice(n,n+u),s=n+a.length,c=d.filter(e=>e.a>=n&&e.a<s&&e.b>=n&&e.b<s).map(e=>({...e,a:e.a-n,b:e.b-n}));return(0,V.jsxs)(`div`,{className:`gd-row`,children:[(0,V.jsx)(`div`,{className:`gd-plank`,children:n===0&&(0,V.jsxs)(`h3`,{className:`gd-plate`,children:[e.name,` · `,_,` session`,_===1?``:`s`]})}),a.map(({s:e,worktree:n})=>(0,V.jsx)(Z,{s:e,worktree:n,sakura:t,mine:r(I(e)),pad:I(e)===i.sid?i.pad:null,onHover:o},I(e))),(0,V.jsx)(oe,{pairs:c,count:a.length}),m&&p>=n&&p<s&&(0,V.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:g?(0,V.jsx)(L,{pad:g}):(0,V.jsx)(ae,{s:m,t:h,mine:r(I(m))})})]},n)}),(0,V.jsx)(`span`,{className:`sr-only`,role:`status`,children:w(g)})]})}var $=e=>e.catch(()=>null);function le({s:e}){let t=(0,B.useId)(),n=e.todos,r=o(e);return(0,V.jsxs)(`a`,{className:`card pad-md act-card`,href:e.href||R(e.session_id),"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,V.jsxs)(x,{s:e,id:t,heading:e.title||c(e.cwd)||e.session_id,children:[e.chip&&(0,V.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip}),(0,V.jsx)(y,{name:`chevron`,className:`glyph act-chev`})]}),n&&n.total>0&&(0,V.jsx)(`div`,{className:`act-foot`,children:(0,V.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,V.jsx)(l,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,V.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,_(e.updated_at),` ago`]})]})}var ue={blocked:`is blocked`,"waiting-input":`waits for your answer`};function de(e,t){if(!Array.isArray(t))return``;let n=t.filter(b),r=e.current;return e.current=new Set(n.map(e=>`${I(e)}:${e.status}`)),r?n.filter(e=>!r.has(`${I(e)}:${e.status}`)).map(e=>`${e.title||c(e.cwd)||e.session_id} ${ue[e.status]}`).join(`. `):``}var fe=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function pe(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:fe.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function me(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),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 he({enabled:e,installs:t,onToggle:n}){let r=j(t);return(0,V.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,V.jsx)(y,{name:`activity`,className:`glyph act-fixed`}),(0,V.jsxs)(`div`,{className:`act-grow`,children:[(0,V.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,V.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,V.jsxs)(`ul`,{className:`stack gap-8 act-fixed act-sm`,"aria-label":`Tracking per install`,children:[t.length===0&&(0,V.jsx)(`li`,{className:`dim`,children:`No active install to track.`}),t.map((e,t)=>(0,V.jsxs)(`li`,{className:`row gap-10`,children:[(0,V.jsxs)(`span`,{id:`act-track-l${t}`,title:e.path,children:[`Track live sessions in `,(0,V.jsx)(`span`,{className:`mono`,children:r.get(e.install)})]}),(0,V.jsx)(`div`,{className:`sw-toggle${e.enabled?` on`:``}`,role:`switch`,"aria-checked":e.enabled,"aria-labelledby":`act-track-l${t}`,tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.key===` `&&t.preventDefault(),n(e))}})]},e.install))]})]})}function ge({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=p(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 ${f(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${f(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,V.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,V.jsxs)(`div`,{className:`act-stat-head`,children:[(0,V.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,V.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,V.jsx)(v,{label:`Reading the job log…`}):e?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,V.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,V.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,V.jsx)(`i`,{className:`zero`},e.key))}),(0,V.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,V.jsx)(`span`,{children:f(r[0].key)}),(0,V.jsx)(`span`,{children:f(r[7].key)}),(0,V.jsx)(`span`,{children:`today`})]}),c&&(0,V.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,V.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function _e({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,V.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,V.jsxs)(`div`,{className:`act-stat-head`,children:[(0,V.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,V.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,V.jsx)(v,{label:`Reading the gate ledger…`}):e.length?(0,V.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,V.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,V.jsx)(h,{vals:e.per_day,i:t,sweep:!0}),(0,V.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,V.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var ve={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ye({job:e,longest:t}){let n=u(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=ve[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,V.jsxs)(`li`,{className:`act-row`,children:[(0,V.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,V.jsx)(y,{name:`play`,className:`glyph act-glyph`}),(0,V.jsxs)(`span`,{className:`act-what`,children:[(0,V.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,V.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,V.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,V.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,V.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function be({gate:e}){return(0,V.jsxs)(`li`,{className:`act-row gate`,children:[(0,V.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,V.jsx)(y,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,V.jsxs)(`span`,{className:`act-what`,children:[(0,V.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,V.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,V.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var xe=5,Se=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function Ce(){let[e,t]=(0,B.useState)(null),[n,o]=(0,B.useState)(``),[s,l]=(0,B.useState)(pe),[u,d]=(0,B.useState)(!1),[f,h]=(0,B.useState)(``),_=(0,B.useRef)(null),y=e=>{let t={...s,...e};l(t),me(t)};re(e=>r.activity().then(n=>{if(e()){t(ie(n)),o(``);let e=de(_,n?.activity);e&&h(t=>t===e?e+`\xA0`:e)}},t=>{e()&&o(t.message)}),2e3,[]);let x=m(()=>$(r.jobs()),[]),C=m(()=>$(r.gates()),[]),w=m(()=>$(r.catalog(`laws`)),[]),T=!e||e.enabled!==!1,E=Array.isArray(e?.installs)?e.installs:[],D=O(e?.activity,E).sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),k=i(),A=T&&e?D.filter(b).length:null,j=new Set(D.map(I)),M=s.v===`list`?O(e?.ended,E).filter(e=>!j.has(I(e))):[],N=Se([...D,...M].map(e=>e.host),s.host),P=Se([...D,...M].map(e=>c(e.cwd)),s.project),F=s.host&&s.project?`host or project`:s.host?`host`:s.project?`project`:``,L=e=>(!s.host||e.host===s.host)&&(!s.project||c(e.cwd)===s.project),R=D.filter(e=>L(e)&&(s.f!==`needs`||b(e))),z=s.f===`all`||s.f===`needs`,H=s.f===`all`&&T?M.filter(L):[],U=u?H:H.slice(0,xe),W=!F&&(s.f===`all`||s.f===`runs`),G=!F&&(s.f===`all`||s.f===`gates`),K=x.data?.jobs||[],q=ne(C.data,w.data),J=ee(K,q,C.data?.days).map(e=>({...e,runs:W?e.runs:[],gate:G?e.gate:null})).filter(e=>e.runs.length||e.gate),Y=Math.max(0,...K.map(e=>e.duration||0)),X=p(J.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),ae=async e=>{let n=!e.enabled;try{let i=await r.activityToggle(n,{host:e.host,path:e.path});if(i.ok===!1){o(i.error||`Could not change tracking`);return}let a=t=>i.enabled?t||[]:(t||[]).flatMap(t=>{let n=(t.installs||[t.install]).filter(t=>t!==e.install);return n.length?[{...t,install:n[0],installs:n}]:[]});t(t=>{let n=(t?.installs||[]).map(t=>t.install===e.install?{...t,enabled:i.enabled}:t);return{...t||{},installs:n,enabled:n.length===0||n.some(e=>e.enabled),activity:a(t?.activity),ended:a(t?.ended)}}),o(``)}catch(e){o(e.message)}},Z=(e,t,n)=>(0,V.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,V.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,V.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:s[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>y({[e]:t.target.value}),children:[(0,V.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]});return(0,V.jsxs)(`div`,{className:`page-fill`,children:[(0,V.jsx)(g,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,V.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:f}),n&&(0,V.jsx)(`div`,{className:`act-gap`,children:(0,V.jsx)(a,{error:n})}),e&&(0,V.jsx)(he,{enabled:T,installs:E,onToggle:ae}),(0,V.jsxs)(`div`,{className:`act-today`,children:[(0,V.jsx)(ge,{jobs:x.data,loading:x.loading}),(0,V.jsx)(_e,{rows:q,gates:C.data,loading:C.loading}),(0,V.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,V.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),!e&&!n?(0,V.jsx)(v,{}):e?(0,V.jsxs)(V.Fragment,{children:[T?(0,V.jsxs)(`span`,{className:`act-big act-wait`,children:[A,` `,(0,V.jsx)(`span`,{className:`dim act-sm`,children:A===1?`session`:`sessions`})]}):null,(0,V.jsx)(`p`,{className:`dim act-sm`,children:T?`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,V.jsx)(`p`,{className:`dim act-sm`,children:`The sessions could not be read.`})]})]}),(0,V.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,V.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:fe.map(([e,t])=>(0,V.jsxs)(`button`,{type:`button`,className:s.f===e?`chip-f on`:`chip-f`,"aria-pressed":s.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&A>0?(0,V.jsxs)(`span`,{className:`mono`,children:[` `,A]}):null]},e))}),Z(`host`,`Host`,N),Z(`project`,`Project`,P),(0,V.jsx)(te,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,V.jsx)(`button`,{type:`button`,className:s.v===e?`on`:``,"aria-pressed":s.v===e,onClick:()=>y({v:e}),children:t},e))})]}),F&&s.f!==`needs`&&(0,V.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,F,`; showing sessions only.`]}),z&&(e?!T&&s.f!==`needs`?null:R.length===0?s.f===`needs`?(0,V.jsx)(S,{title:`Nothing waits on you`}):(0,V.jsx)(S,{title:`No active sessions`,children:`Start an agent session and it appears here.`}):s.v===`garden`?(0,V.jsx)(se,{sessions:R,collisions:e.collisions}):(0,V.jsx)(`div`,{className:`stack gap-12 act-live`,ref:k,children:R.map(e=>(0,V.jsx)(`div`,{"data-flip":I(e),children:(0,V.jsx)(le,{s:e})},I(e)))}):(0,V.jsx)(v,{label:`Reading live sessions…`})),H.length>0&&(0,V.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,V.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),U.map(e=>(0,V.jsx)(`div`,{children:(0,V.jsx)(le,{s:e})},I(e))),H.length>xe&&(0,V.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":u,onClick:()=>d(e=>!e),children:u?`Show fewer`:`Show all ${H.length}`})]}),s.f!==`needs`&&(0,V.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:X,children:J.map(e=>(0,V.jsxs)(`section`,{className:`card act-day`,children:[(0,V.jsxs)(`h3`,{className:`act-day-h`,children:[(0,V.jsx)(`span`,{children:e.title}),(0,V.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,V.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,V.jsx)(ye,{job:e,longest:Y},e.id)),e.gate&&(0,V.jsx)(be,{gate:e.gate})]})]},e.key))})]})}export{Ce as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-GpBsYn50.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/motion-RlUl1osO.js","assets/sections-CtFz7HFH.js","assets/index-How7SzDZ.js","assets/api-DLDVY3K-.js","assets/index-CsAZq0BQ.css","assets/OperatorHudView-BAXwCEvY.js","assets/JournalView-iLuLrOxE.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n,t as r}from"./react-C1iE8mnY.js";import{t as i}from"./api-DLDVY3K-.js";import{o as a,t as o}from"./motion-RlUl1osO.js";import{n as s,r as c}from"./sections-CtFz7HFH.js";import{$ as l,B as u,Et as d,I as f,L as p,Q as m,St as h,Y as g,_t as _,a as v,bt as y,et as b,gt as x,nt as S,t as C,vt as w,yt as ee}from"./index-How7SzDZ.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={done:`ok`,failed:`bad`},A={done:(0,O.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,O.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=f(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];i&&i.key===r?(i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started)):t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=y(e.newest),n=e.oldest?y(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,O.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,O.jsxs)(`li`,{className:`run-chip ${k[e.status]||`acc`}`,title:e.command||void 0,children:[(0,O.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:A[e.status]||(0,O.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,O.jsx)(`span`,{className:`sr-only`,children:r}),(0,O.jsxs)(`span`,{className:`run-chip-main`,children:[(0,O.jsxs)(`span`,{className:`run-chip-head`,children:[(0,O.jsx)(`b`,{children:e.verb}),n>1&&(0,O.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,O.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,O.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,O.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,O.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,O.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`,unknown:``};function I({verdict:e}){return e?(0,O.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,O.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=h(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(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:()=>d(`#/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 R({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)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,O.jsxs)(`div`,{className:`gtop`,children:[(0,O.jsx)(`span`,{className:`gname`,children:r.label}),(0,O.jsx)(x,{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 z({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=p(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:[y(e.started),` ago`]})]},e.id))})}function B({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)(u,{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 V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=D(e,i?.tone),s=ee(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)(B,{value:s}),(0,O.jsxs)(`div`,{className:`hero-facts`,children:[(0,O.jsx)(`div`,{className:`ttl`,children:o}),(0,O.jsx)(I,{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)(L,{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)(R,{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)(z,{jobs:r})]})]})]})}function H({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 U(e){return e?e.includes(`in sync`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=w(e.counts),o=n?.version_verdict||``,s=U(o),l=_(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)(I,{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)(H,{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)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=w(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(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)(I,{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-text)`},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`}),e.doctor===null?`checking`:`${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)(P,{jobs:n,max:8,empty:(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.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=h(()=>q(()=>i.fleet()),[e]),r=h(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?v(s):null,l=r.data,u=t?l==null?`loading`:l===K?`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 Y=e({default:()=>$}),X=(0,T.lazy)(()=>C(()=>import(`./GreenhouseView-GpBsYn50.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,T.lazy)(()=>C(()=>import(`./OperatorHudView-BAXwCEvY.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,T.lazy)(()=>C(()=>import(`./JournalView-iLuLrOxE.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`genome`,dataRev:u}){let d=c,[f,p]=(0,T.useState)(`status`),[_,v]=(0,T.useState)(d);_!==d&&(v(d),p(`status`));let y=e&&r.find(t=>t.name===e.theme)?.sigil||``,x=J({dataRev:u,needDoctor:d===`greenhouse`||d===`hud`}),{data:C}=h(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,u]);if(!e)return t?(0,O.jsx)(l,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,O.jsx)(b,{});let w=e.daemon_stale?(0,O.jsx)(m,{}):null;return e.deployed?(0,O.jsxs)(O.Fragment,{children:[w,(0,O.jsx)(`div`,{className:`head-row`,children:(0,O.jsx)(S,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`readout`,`Readout`]].map(([e,t])=>(0,O.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>p(e),"aria-pressed":f===e,children:t},e))})}),(0,O.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`genome`&&(0,O.jsx)(V,{overview:e,sigil:y,setup:a,jobs:o,lens:x,dataRev:u}),f===`status`&&d===`greenhouse`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(b,{}),children:(0,O.jsx)(X,{overview:e,sigil:y,jobs:o,lens:x,onAction:s})}),f===`status`&&d===`hud`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(b,{}),children:(0,O.jsx)(Z,{overview:e,jobs:o,lens:x})}),f===`status`&&d===`journal`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(b,{}),children:(0,O.jsx)(Q,{overview:e,recent:C,lens:x,dataRev:u})}),f===`lineage`&&(0,O.jsx)(W,{overview:e,sigil:y,setup:a,jobs:o,lens:x}),f===`readout`&&(0,O.jsx)(G,{overview:e,setup:a,jobs:o,lens:x})]},f)]}):(0,O.jsxs)(O.Fragment,{children:[w,(0,O.jsx)(g,{onAction:s})]})}export{$ as default,D as i,I as n,P as r,Y as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{$ as i,J as a,St as o,Tt as s,et as c,mt as ee,pt as l,q as te,tt as u,wt as d}from"./index-How7SzDZ.js";import{t as f}from"./EmptyState-CY5Pm2xy.js";import{n as p,t as m}from"./usePoll-D5c_qIFZ.js";import{a as h,i as g,n as _,o as v,s as y}from"./LibRows-DEHjIoD-.js";import{t as b}from"./CopyButton-ByIntFtB.js";import{t as x}from"./DataTable-b9zTShqJ.js";import{a as S,n as C,s as ne}from"./ActiveLoops-BJJN3P-V.js";var w=e(t(),1),T=24,E=48,re=16,ie=92,ae=8,oe=16,D=22,O=14,se=14,k=15,ce=4,A=7.2,j={brick:{w:200,h:48},fork:{w:200,h:48},loop:{w:200,h:56},lane:{w:150,h:56},close:{w:96,h:34},stop:{w:76,h:34}},M=`loop:`,le=new Set([`$close`,`$stop`,`$lane`]),N=(e,t)=>{if(!e?.name)return`↺ route back`;let n=t?`${t[e.name]??0} / ${e.max??`?`}`:`max ${e.max??`?`}`;return`↺ ${e.name} · ${n}`};function ue(e,t,n,r){let i=null;for(let a of e)Array.isArray(a?.nodes)&&a.nodes[0]===n&&(a.nodes.includes(t)||a.nodes.includes(`$lane`)&&r.has(t))&&(!i||a.nodes.length<i.nodes.length)&&(i=a);return i}var de=new Set([`pass`,`fail`,`error`,`none`,`needs-info`,`reject`]);function fe(e,t=[]){let n=new Set(Array.isArray(e.stages)?e.stages:[]),r=(e.cycles||[]).filter(e=>Array.isArray(e?.nodes)),i=e=>r.some(t=>t.nodes[0]===e.to&&t.nodes.includes(e.from)),a=new Map((Array.isArray(t)?t:[]).map(e=>[e?.name,e])),o=(e.edges||[]).filter(e=>n.has(e?.from)),s=e=>(a.has(e)?a.get(e)?.outcomes||[]:o.filter(t=>t.from===e).map(e=>e.on)).some(e=>!de.has(e)),c=new Map;for(let e of o)n.has(e.to)&&!i(e)&&!e.from.startsWith(M)&&s(e.from)&&(c.has(e.from)||c.set(e.from,[]),c.get(e.from).includes(e.to)||c.get(e.from).push(e.to));return c}function P(e,t,n=[]){let r=fe(e,n);for(let n of[...Array.isArray(t)?t:[]].reverse()){if(!r.has(n?.stage)||!n.outcome)continue;let t=(e.edges||[]).find(e=>e.from===n.stage&&e.on===n.outcome);if(t&&r.get(n.stage).includes(t.to))return t.to}return null}function F(e,t=[],n={}){let r=n.width>0?Math.floor(n.width):1/0,i=[{rails:!0,stack:!1},{rails:!1,stack:!1},{rails:!0,stack:!0},{rails:!1,stack:!0}];for(let a of i){let o=pe(e,t,a,r,n.lane);if(o.width<=r||a===i.at(-1))return o}}function pe(e,t,n,r,i){let a=Array.isArray(e.stages)?e.stages:[],o=new Set(a),s=(Array.isArray(e.edges)?e.edges:[]).filter(e=>typeof e?.from==`string`&&typeof e?.to==`string`&&o.has(e.from)&&(o.has(e.to)||le.has(e.to))),c=(Array.isArray(e.cycles)?e.cycles:[]).filter(e=>Array.isArray(e?.nodes)),ee=new Map(t.map(e=>[e.name,e])),l=fe(e,t),te=new Set([...l.values()].flat()),u=e=>ue(c,e.from,e.to,te),d=new Map(o.has(e.start)?[[e.start,0]]:[]),f=s.filter(e=>o.has(e.to)&&!u(e));for(let e=0;e<a.length;e++){let e=!1;for(let t of f){if(!d.has(t.from))continue;let n=d.get(t.from)+1;d.get(t.to)>=n||(d.set(t.to,n),e=!0)}if(!e)break}let p=Math.max(-1,...d.values());for(let e of a)d.has(e)||d.set(e,++p);let m=p+1,h=[];for(let e of a)(h[d.get(e)]||=[]).push(e);let g=e=>h[d.get(e)].length>1,_=n.rails?T:oe,v=n.rails?re:ae,y=r===1/0?1/0:r-2*_,b=()=>Math.max(j.lane.w,Math.min(240,y-28)),x=e=>n.rails?j.lane.w:Math.max(ie,Math.min(j.lane.w,Math.floor((y-v*(e-1))/e))),S=a.map(e=>{let t=g(e),n=e.startsWith(M)?e.slice(5):null,r=n?`loop`:l.has(e)?`fork`:`brick`;return{id:e,kind:r,...t?{w:x(h[d.get(e)].length),h:j.lane.h}:{...j[r]||j.brick},rank:d.get(e),lane:t,stacked:!1,loop:n,human:r===`brick`||r===`fork`?ne(ee.get(e)):null,tags:[]}}),C=new Map(S.map(e=>[e.id,e])),w=s.some(e=>e.to===`$close`);if(w){let e={id:`$close`,kind:`close`,...j.close,rank:m,tags:[]};S.push(e),C.set(`$close`,e),h[m]=[`$close`]}let de=e=>{let t=null;for(let n of l.keys())d.get(n)<d.get(e)&&(!t||d.get(n)>d.get(t))&&(t=n);return t},P=new Map;for(let e of s){let t=`${e.from}\u0000${e.to}`;if(P.has(t))P.get(t).on.push(e.on);else{let n=u(e),r=e.to===`$lane`?l.get(de(e.from))?.[0]:e.to;if(e.to!==`$stop`&&!C.has(r))continue;let i=e.to===`$stop`?0:C.get(r).rank-d.get(e.from),a=e.to===`$stop`?`stop`:n?`back`:i===1?`flow`:`skip`;P.set(t,{from:e.from,to:e.to,target:r,on:[e.on],kind:a,back:!!n,cycle:n?.name??null,cycleDef:n,span:i})}}let F=[...P.values()],pe=F.filter(e=>e.kind===`back`||e.kind===`skip`),I=F.filter(e=>e.kind===`stop`&&g(e.from)),me=n.rails?I:[...pe,...F.filter(e=>e.kind===`stop`&&!g(e.from)),...I];for(let e of me)C.get(e.from).tags.push({kind:e.kind,on:e.on,to:e.to,cycle:e.cycle});let he=(e,t)=>e.kind===`back`?N(t.cycleDef):`${e.on.join(` · `)} → ${e.kind===`stop`?`stop`:e.to}`,ge=e=>Math.max(0,...e.tags.map(t=>he(t,F.find(n=>n.from===e.id&&n.to===t.to)).length*A)),L=h.map(e=>(e||[]).map(e=>C.get(e))),R=e=>e.reduce((e,t)=>e+t.w,0)+v*(e.length-1),z=L.map(e=>n.stack&&e.length>1&&R(e)>y);L.forEach((e,t)=>{if(z[t])for(let t of e)Object.assign(t,{stacked:!0,w:b()})});let B=(e,t)=>z[t]?Math.max(...e.map(e=>e.w))+28:R(e),V=Math.max(j.brick.w,...L.map((e,t)=>e.length?B(e,t):0)),H=T,U=[];L.forEach((e,t)=>{if(!e.length)return;let n=(V-B(e,t))/2;if(z[t]){for(let t of e)Object.assign(t,{x:(V-t.w)/2,y:H}),H+=t.h+t.tags.length*k+D;H-=D}else{for(let t of e)Object.assign(t,{x:n,y:H}),n+=t.w+v;H+=Math.max(...e.map(e=>e.h)),H+=Math.max(0,...e.map(e=>e.tags.length))*k}U[t]=H+E/2,H+=E});let W=H-E,G=n.rails?pe.sort((e,t)=>Math.abs(t.span)-Math.abs(e.span)):[],K=e=>28+e*se,q=e=>e.back?N(e.cycleDef):e.on.join(` · `),J=G.length?K(G.length-1)+12:_;G.forEach((e,t)=>{J=Math.max(J,K(t)+8+q(e).length*A-C.get(e.from).x)});for(let e of S)e.x+=J;let Y=n.rails?F.filter(e=>e.kind===`stop`&&!g(e.from)):[],X=J+V+24;for(let e of Y){let t=C.get(e.from);X=Math.max(X,t.x+t.w+10+e.on.join(` · `).length*A)}let _e=Math.max(0,...S.filter(e=>e.tags.length).map(e=>e.x+e.w/2+6+ge(e))),Z=Math.max(J+V,_e)+_;if(Y.length){X=Math.max(X,_e+10);let e=w?C.get(`$close`).y:W-j.stop.h,t={id:`$stop`,kind:`stop`,...j.stop,x:X-j.stop.w/2,y:e,rank:m,tags:[]};S.push(t),C.set(`$stop`,t),Z=X+j.stop.w/2+T}let Q=e=>e.x+e.w/2,$=e=>e.y+e.h/2,ve=e=>e.y+e.h,ye=e=>e.x-O,be=e=>e.x+e.w+O,xe=new Map;for(let e of F)e.kind===`flow`&&xe.set(e.target,(xe.get(e.target)||0)+1);let Se=e=>e.to===`$lane`&&C.get(i)?.stacked&&l.get(de(e.from))?.includes(i)?C.get(i):C.get(e.target),Ce=new Map;for(let e of G){let t=Se(e).id;Ce.set(t,(Ce.get(t)||0)+1)}let we=new Map,Te=F.map(e=>{let t=C.get(e.from),n=Se(e),r={from:e.from,to:e.to,on:e.on,kind:e.kind,back:e.back,cycle:e.cycle};if(e.kind===`stop`){if(!Y.includes(e))return{...r,path:null};let n=C.get(`$stop`);return{...r,path:`M${t.x+t.w},${$(t)} H${X} V${n.y}`,lx:t.x+t.w+6,ly:$(t)-6,anchor:`start`}}if(e.kind===`back`||e.kind===`skip`){let i=G.indexOf(e);if(i<0)return{...r,path:null};let a=we.get(n.id)||0;we.set(n.id,a+1);let o=Math.ceil((Ce.get(n.id)-1)/2),s=o?Math.min(10,(n.h/2-ce)/o):10,c=$(n)+(a%2?1:-1)*Math.ceil(a/2)*s;return{...r,path:`M${t.x},${$(t)} H${K(i)} V${c} H${n.x}`,lx:K(i)+6,ly:$(t)-6,anchor:`start`}}let i=U[t.rank],a=t.stacked?`M${t.x+t.w},${$(t)} H${be(t)} V${i}`:`M${Q(t)},${ve(t)} V${i}`,o=n.stacked?` H${ye(n)} V${$(n)} H${n.x}`:` H${Q(n)} V${n.y}`,s=e.on.length===1&&e.on[0]===`pass`,c=(xe.get(n.id)||0)>1?{lx:t.stacked?be(t)+4:Q(t)+6,ly:t.stacked?$(t)-4:ve(t)+13}:n.stacked?{lx:n.x,ly:n.y-5}:{lx:Q(n)+6,ly:n.y-8};return{...r,path:a+o,...c,anchor:`start`,plain:s}});return{width:Math.ceil(Z),height:Math.ceil(W+T),mode:n.rails?`rails`:`tags`,stacked:z.some(Boolean),nodes:S,edges:Te}}var I=n(),me=20;function he({factory:e,bricks:t=[],loops:n=[],onSelect:r,highlight:i,child:a,counters:o,lane:s,history:c}){let ee=(0,w.useRef)(null),[l,te]=(0,w.useState)(0);(0,w.useLayoutEffect)(()=>{let e=ee.current;if(!e)return;let t=()=>te(t=>Math.abs(e.clientWidth-t)>me?e.clientWidth:t);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let u=s===void 0?P(e,c,t):s,d=F(e,t,{width:l,lane:u}),f=new Set(n.map(e=>e.name)),p=new Map((e.cycles||[]).map(e=>[e.name,e])),m=new Set(d.nodes.filter(e=>e.kind===`fork`).map(e=>e.id)),h=e=>e.kind===`back`?N(p.get(e.cycle),o):`${e.on.join(` · `)} → ${e.kind===`stop`?`stop`:e.to}`,g=e=>e.kind===`loop`?`${e.id} stage, the ${e.loop} loop`:`${e.id} ${e.kind===`fork`?`fork`:`brick`}${e.human?`, ${e.human.toLowerCase()}`:``}`,_=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r?.(e))},v=e=>{let t=e.id===i,n=`${g(e)}${e.id===u?`, the lane taken`:``}`,o=t&&a&&(e.loop||e.lane)?`, at ${a.node}`:``;return r?{role:`button`,tabIndex:0,"aria-label":`${n}${o}`,onClick:_(e.id),onKeyDown:_(e.id)}:{role:`img`,"aria-label":`${n}${t?`, current stage`:``}${o}`}},y=e=>`fg-node ${e.kind}${e.lane?` lane`:``}${e.id===i?` current`:``}${e.id===u?` taken`:``}`,b=e=>u&&(e.to===u||e.from===u),x=e=>e.tags.map((t,n)=>(0,I.jsx)(`text`,{x:e.x+e.w/2+6,y:e.y+e.h+12+n*15,className:`fg-lbl fg-tag ${t.kind}`,children:h(t)},`${t.kind}${t.to}`));return(0,I.jsxs)(`div`,{className:`fg-wrap`,ref:ee,children:[(0,I.jsxs)(`svg`,{className:`fgraph`,"data-mode":`${d.mode}${d.stacked?` stacked`:``}`,style:{"--fg-w":`${d.width}px`},viewBox:`0 0 ${d.width} ${d.height}`,role:`group`,"aria-label":`${e.name} factory: ${(e.stages||[]).join(`, `)}`,children:[(0,I.jsx)(`defs`,{children:[`flow`,`back`,`stop`].map(e=>(0,I.jsx)(`marker`,{id:`fg-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`fg-head-${e}`})},e))}),d.edges.map(e=>{if(!e.path)return null;let t=e.kind===`skip`?`flow`:e.kind,n=e.back?N(p.get(e.cycle),o):e.kind===`flow`&&e.plain?``:e.on.join(` · `);return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`path`,{d:e.path,className:`fg-edge ${e.kind}${b(e)&&e.kind===`flow`?` taken`:``}`,markerEnd:`url(#fg-arrow-${t})`}),n?(0,I.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`fg-lbl ${e.kind}${e.kind===`flow`&&m.has(e.from)?` fork`:``}`,children:n}):null]},`${e.from}>${e.to}`)}),d.nodes.map(e=>{if(e.kind===`close`||e.kind===`stop`)return(0,I.jsxs)(`g`,{className:`fg-${e.kind}`,role:`img`,"aria-label":e.kind,children:[(0,I.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.h/2}),(0,I.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+4,textAnchor:`middle`,children:e.kind})]},e.id);let t=e.id===i?`step`:void 0,n=a&&e.id===i?a:null,r=n&&(e.loop||e.lane)?`at ${n.node}`:e.loop?f.has(e.loop)?`whole loop`:`not in catalogue`:e.lane?`no loop`:null;return(0,I.jsxs)(`g`,{children:[(0,I.jsxs)(`g`,{className:y(e),"aria-current":t,...v(e),children:[e.lane||e.loop?(0,I.jsx)(`title`,{children:e.id}):null,(0,I.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:`10`}),(0,I.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+(r?-2:4),textAnchor:`middle`,children:e.loop||e.id}),r?(0,I.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+14,textAnchor:`middle`,className:`fg-sub`,children:r}):null,e.human?(0,I.jsx)(S,{x:e.x+e.w-4,y:e.y+4,label:e.human}):null]}),x(e)]},e.id)})]}),(0,I.jsx)(`ul`,{className:`fg-legend`,"aria-label":`Graph legend`,children:[[`brick`,`brick`],[`loop`,`whole loop (test · fix · verify)`],[`fork`,`fork`],[`back`,`route back, bounded by its max`],[`stop`,`fail → stop`]].map(([e,t])=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`span`,{className:`fg-key ${e}`,"aria-hidden":`true`}),t]},e))})]})}var ge=encodeURIComponent,L=5e3,R=d.factories.map(e=>[e,s[e]]),z={project:`Project`,global:`Global`,shipped:`Shipped`},B={templates:`Origins`,active:`Statuses`},V=[[`wait`,`Waits for you`,[`awaiting`,`unreadable`]],[`run`,`Running`,[`running`]],[`end`,`Ended`,[`stopped`,`done`,`finished`]]],H=V.flatMap(([,e,t])=>t.map(t=>[t,e])),U=e=>!!e.graph,W=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r}))),G=e=>W(e.map(e=>({...e,desc:e.description})),e=>e.origin,Object.entries(z)),K=e=>W(e.map(e=>({...e,name:e.root,desc:e.factory,meta:U(e)?Y(e).join(` · `):void 0})),e=>e.status,H);function q(e){if(e==null)return`unknown`;let t=Math.round(e/1e3);if(t<60)return`${t} s`;let n=Math.round(t/60);return n<60?`${n} min`:`${Math.floor(n/60)} h ${String(n%60).padStart(2,`0`)} min`}var J=e=>`${e.slice(0,16).replace(`T`,` `)} UTC`;function Y(e){if(e.status===`unreadable`)return[`Its FACTORY.md cannot be read.`];if(e.status===`finished`)return[`Its FACTORY.md is gone: the run closed.`];let t=e.tasks,n=e.metrics;return[e.awaiting?`${e.awaiting.stage} · ${e.awaiting.outcome}`:e.status===`stopped`?`stopped: ${e.reason}`:e.status===`done`?`closed`:e.stage,t?`task ${t.index}/${t.count}`:null,n?`work ${q(n.workMs)}`:null,n?.openWaitMs==null?null:`waiting ${q(n.openWaitMs)}`,...(e.graph?.cycles||[]).filter(t=>e.counters?.[t.name]>0).map(t=>`${t.name} ${e.counters[t.name]}/${t.max}`)].filter(Boolean)}function X({runs:e}){return(0,I.jsx)(`section`,{className:`fac-board`,"aria-label":`Runs board`,children:V.map(([t,n,r])=>{let i=e.filter(e=>r.includes(e.status));return(0,I.jsxs)(`div`,{className:`fac-col ${t}`,role:`group`,"aria-label":n,children:[(0,I.jsxs)(`h3`,{className:`loop-kicker`,children:[n,` `,(0,I.jsx)(`span`,{className:`mono dim`,children:i.length})]}),i.length?(0,I.jsx)(`ul`,{children:i.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`a`,{className:`fac-card`,href:`#/factories/active/${ge(e.root)}`,children:[(0,I.jsx)(`b`,{children:e.title}),(0,I.jsx)(`span`,{className:`mono`,children:e.factory}),(0,I.jsx)(`span`,{children:Y(e).join(` · `)})]})},e.root))}):(0,I.jsx)(`p`,{className:`panel-note`,children:`None.`})]},t)})})}function _e({run:e}){if(!e.history?.length)return null;let t=e.metrics,n=e.history.map((e,n)=>({i:n,h:e,e:t?.entries?.[n]||{}}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Timeline`}),(0,I.jsx)(x,{caption:`Run history`,captionHidden:!0,rowKey:e=>e.i,rows:n,columns:[{key:`stage`,label:`Stage`,render:e=>e.h.stage},{key:`result`,label:`Result`,render:e=>e.h.verdict?`you answered ${e.h.verdict}`:(0,I.jsxs)(I.Fragment,{children:[e.h.outcome,` `,e.e.rework?(0,I.jsx)(`span`,{className:`tag warn`,children:`rework`}):null]})},{key:`at`,label:`Time`,render:e=>typeof e.h.at==`string`?(0,I.jsx)(`time`,{dateTime:e.h.at,children:J(e.h.at)}):`unknown`},{key:`ms`,label:`Duration`,render:e=>`${q(e.e.ms)}${e.e.wait?` waiting`:``}`}]}),t?(0,I.jsxs)(`p`,{className:`panel-note fac-totals`,children:[`Work `,q(t.workMs),` · waited `,q(t.waitMs),t.openWaitMs==null?``:` · waiting ${q(t.openWaitMs)}`,` · tokens`,` `,t.tokens??`unknown`]}):null]})}var Z=(e,t)=>(0,I.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),Q={templates:e=>Z(``,e.origin),active:e=>Z(C[e.status],e.status)},$=he;function ve({factory:e,counters:t}){return e.cycles?.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Routes back`}),(0,I.jsx)(`ul`,{className:`fac-cycles`,"aria-label":`Cycles`,children:e.cycles.map(e=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`b`,{children:e.name}),`: `,e.nodes.join(` → `),` —`,` `,t?`lap ${t[e.name]??0} of ${e.max}`:`${e.max} laps at most`]},e.name))})]}):null}function ye({f:e,bricks:t,loops:n}){let r=`Run the ${e.name} factory on <issue URL, file or request>`,i=[`git worktree add ../<repo>-factory-<slug> -b loop/factory-<slug>`,`cd ../<repo>-factory-<slug>`,`geneseed factory init --factory ${e.name} --title "<title>" --requirement "<requirement>" --input "<issue URL, file path or pasted text>"`].join(` && `);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Factory`}),Z(``,e.origin)]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,I.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[`factories/`,e.name,`.json · `,e.origin]}),(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)($,{factory:e.factory,bricks:t,loops:n}),(0,I.jsx)(ve,{factory:e.factory}),(0,I.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`fac-start-h`,children:[(0,I.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,I.jsx)(`h3`,{id:`fac-start-h`,className:`loop-kicker`,children:`Start it: ask the agent`}),(0,I.jsx)(b,{text:r,label:`Copy request`})]}),(0,I.jsx)(`pre`,{className:`mono`,children:r}),(0,I.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,I.jsx)(`h3`,{className:`loop-kicker`,children:`Or by hand, in a new worktree`}),(0,I.jsx)(b,{text:i,label:`Copy command`})]}),(0,I.jsx)(`pre`,{className:`mono`,children:i})]}),(0,I.jsxs)(`p`,{className:`panel-note`,children:[(0,I.jsx)(`code`,{className:`mono`,children:`init`}),` only registers the run: an agent then drives`,` `,(0,I.jsx)(`code`,{className:`mono`,children:`geneseed factory next`}),` and `,(0,I.jsx)(`code`,{className:`mono`,children:`record`}),`.`]}),e.factory.rules?.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,I.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every stage follows`,children:e.factory.rules.map(e=>(0,I.jsx)(`li`,{children:e},e))})]}):null]})}function be({run:e,bricks:t,loops:n,from:r}){let i=e.tasks;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`panel-note`,children:(0,I.jsx)(`a`,{href:`#/factories/active`,children:`← All runs`})}),(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Factory run`}),(0,I.jsx)(`span`,{className:`tag${C[e.status]?` ${C[e.status]}`:``}`,children:e.status})]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.factory,` · `,e.branch,` · `,e.root]}),U(e)?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`reader-lede`,children:[`At `,e.stage,` · `,e.transitions,` transitions`,i?` · task ${i.index} / ${i.count}`:``,e.loop?` · loop at ${e.loop.node}, iteration ${e.loop.iteration}`:``]}),e.awaiting?(0,I.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,I.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind??`you`,e.awaiting.stage?` at ${e.awaiting.stage} (${e.awaiting.outcome})`:``]}),` `,`— Answer in the agent's session.`,e.awaiting.note?(0,I.jsxs)(I.Fragment,{children:[` `,`Its note: `,(0,I.jsx)(`code`,{className:`mono`,children:e.awaiting.note})]}):null]}):null,e.reason?(0,I.jsx)(`p`,{className:`panel-note`,children:e.reason}):null,(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)($,{factory:e.graph,bricks:t,loops:n,highlight:e.stage,child:e.loop,counters:e.counters,lane:e.lane,history:e.history}),(0,I.jsx)(ve,{factory:e.graph,counters:e.counters}),(0,I.jsx)(_e,{run:e}),(0,I.jsxs)(`p`,{className:`panel-note`,children:[`Bricks and loops drawn from the catalogue of `,r||`the default install`,`, which the run’s project may not share.`]})]}):(0,I.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its FACTORY.md cannot be read, so there is no state to show.`:`Its FACTORY.md is gone: the run closed and its state went with it.`})]})}function xe({problems:e}){if(!e?.length)return null;let t=e.length;return(0,I.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,I.jsxs)(`b`,{className:`t-warn`,children:[t,` factory `,t===1?`problem`:`problems`,`: these factories cannot run as they are`]}),(0,I.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,I.jsx)(`li`,{className:`mono`,children:e},e))})]})}var Se={templates:{title:`No factories`,body:(0,I.jsxs)(I.Fragment,{children:[`Add one under `,(0,I.jsx)(`code`,{className:`mono`,children:`.geneseed/factories/`}),` in the repo.`]})},active:{title:`No runs yet`,body:(0,I.jsxs)(I.Fragment,{children:[`Ask the agent to run a factory, or start one by hand in a worktree with`,` `,(0,I.jsx)(`code`,{className:`mono`,children:`geneseed factory init`}),`. It shows up here while it runs.`]})}},Ce={templates:(0,I.jsxs)(I.Fragment,{children:[`A factory carries one work item through bricks and loops to an open PR.`,` `,(0,I.jsx)(`a`,{href:`#/docs/factories`,children:`How factories work →`})]}),active:(0,I.jsxs)(I.Fragment,{children:[`Factory runs registered on this machine, read from their FACTORY.md: the ones that wait for you first. A card opens its timeline. `,(0,I.jsx)(`a`,{href:`#/docs/run-a-factory`,children:`Run a factory →`})]})};function we(){let[e,t]=(0,w.useState)(null),[n,i]=(0,w.useState)(null);return p(e=>r.activeFactories().then(n=>e()&&(t(m(n)),i(null)),t=>e()&&i(t.message)),L,[]),{runs:e?e.factories||[]:null,error:n}}function Te({tab:e=`templates`,item:t,dataRev:n}){let s=a(n),[d,p]=te(`factories`,s),{data:m,error:b}=o(()=>r.factories(ee(d)),[n,d?.id??``],`factories`),{runs:x,error:S}=we(),[C,ne]=(0,w.useState)(``),[T,E]=(0,w.useState)(`all`),[re,ie]=(0,w.useState)(e);e!==re&&(ie(e),ne(``),E(`all`));let ae=m?.bricks||[],oe=m?.loops||[],D=e===`active`?x&&K(x):m&&G(m.factories||[]),O=D||[],se=y(O),k=T===`all`?O:O.filter(e=>e.group===T),ce=C.trim(),A=h(k,ce),j=!!(t&&D&&!O.some(e=>e.name===t)),M=j?null:O.find(e=>e.name===t)||(e===`active`?null:O[0])||null,le={templates:m?.factories?.length,active:x?.length},N=R.find(([t])=>t===e)[1],ue=e===`active`?S:b;return(0,I.jsxs)(`div`,{className:`lib-wrap`,children:[e===`active`?null:(0,I.jsx)(u,{className:`page-pick`,installs:s,value:d,onChange:p}),(0,I.jsx)(i,{error:ue,style:{margin:`0 0 var(--sp-3)`}}),(0,I.jsx)(xe,{problems:m?.problems}),(0,I.jsxs)(`div`,{className:`library`,children:[(0,I.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Factories sections`,children:[(0,I.jsxs)(`div`,{className:`lib-title`,children:[(0,I.jsx)(`h1`,{className:`h`,children:`Factories`}),(0,I.jsx)(`span`,{className:`dim`,children:`Work items, carried to a PR`})]}),(0,I.jsx)(`p`,{className:`panel-note lib-lede`,children:Ce[e]}),(0,I.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:R.map(([t,n])=>(0,I.jsxs)(w.Fragment,{children:[(0,I.jsxs)(`a`,{href:`#/factories/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,I.jsx)(`span`,{className:`mono dim`,children:le[t]??``})]}),e===t&&(0,I.jsx)(v,{label:B[t],total:O.length,cats:se,cat:T,onChange:E})]},t))})]}),(0,I.jsx)(g,{label:N,count:ce?`${A.length} of ${k.length}`:D?k.length:``,q:C,onQ:ne,matched:A.length,inView:[e,t],current:M?M.title||M.name:void 0,sections:R.map(([t,n])=>({key:t,label:n,n:le[t],href:`#/factories/${t}`,on:e===t})),cats:se,cat:T,total:O.length,onCat:E,catLabel:B[e],children:D?O.length===0?(0,I.jsx)(f,{title:Se[e].title,children:Se[e].body}):(0,I.jsx)(_,{rows:A,activeName:M?.name,hrefOf:t=>`#/factories/${e}/${ge(t.name)}`,pills:Q[e]}):ue?null:(0,I.jsx)(c,{})}),(0,I.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:j?(0,I.jsx)(f,{title:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/factories/${e}`,label:`All ${N.toLowerCase()} →`}}):M?e===`active`?(0,I.jsx)(be,{run:M,bricks:ae,loops:oe,from:d?l(d):null}):(0,I.jsx)(ye,{f:M,bricks:ae,loops:oe},M.name):e===`active`&&D&&O.length?(0,I.jsx)(X,{runs:A}):e===`active`&&D?(0,I.jsx)(f,{title:`What is a factory?`,docs:{href:`#/docs/factories`,label:`How factories work →`},children:`A factory runs stages, bricks and whole loops, until the work is an open PR.`}):null})]})]})}export{V as COLUMNS,Y as cardFacts,Te as default,G as factoryRows,q as fmtMs,K as runRows};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,t as r}from"./motion-RlUl1osO.js";import{n as i,r as a}from"./sections-CtFz7HFH.js";import{B as o,F as s,L as c,_t as l,gt as u}from"./index-How7SzDZ.js";import{i as d,n as f,r as p}from"./Dashboard-DBOEi9lQ.js";e();var m=t(),h=12,g=Array.from({length:7},(e,t)=>`var(--cat-${t})`),_=n[9];function v({segments:e,size:t=186,stroke:n=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)(o,{segments:e,size:t,stroke:n,label:i,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(r,{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`,style:{stopColor:n},stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,style:{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`,style:{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)(u,{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:n,lens:o,onAction:_}){let y=e.counts||{},S=o?.doctor?.state||`loading`,C=o?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=d(e,o?.tone),O=c(n,h),k=l(e.diff),A=a.filter(e=>(y[e]||0)>0).map((e,t)=>({key:e,label:i[e].label,n:y[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),j=A.reduce((e,t)=>e+t.n,0),M=s(n||[],10),N=M.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:D}),(0,m.jsx)(f,{verdict:o?.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:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,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:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,onClick:()=>_(`doctor`),children:[(0,m.jsx)(u,{name:`doctor`}),`Retry 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.`]}),w&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:C.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:y.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:y.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:y.laws??`—`,sub:y.doctrines?`${y.doctrines.active}/${y.doctrines.total} packs · ${y.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Local edits`,value:k,sub:`files`,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:[j,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:A,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:A.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/j*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)(r,{value:N})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,m.jsx)(b,{data:M,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 `,O.length,` runs`]})})]}),(0,m.jsx)(p,{jobs:n,max:h,empty:(0,m.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{S as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{A as i,B as a,C as o,E as s,F as c,H as l,K as u,M as d,N as f,O as p,P as m,U as h,_ as g,a as _,d as ee,f as v,g as y,h as b,i as x,j as S,l as C,n as w,p as T,r as E,u as D,v as O,w as k,x as A}from"./motion-RlUl1osO.js";import{n as j}from"./sections-CtFz7HFH.js";import{At as M,Et as N,Ot as P,S as F,St as I,bt as L,kt as R,xt as z}from"./index-How7SzDZ.js";import{n as B}from"./Dashboard-DBOEi9lQ.js";function V(e){return k((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function H(e,t,n,r,a,c){let l=i(e.duration)&&e.duration<=1e-11?n-h:n;t.composition&&O(t,l,1,1,u.AUTO);let d=r?new D(r,e,t,l,!1,a,c):new b(e,t,l);return t.composition&&d.init(!0),o(t,d),s(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=V(t),t}var U=0,W=class extends b{constructor(e={}){super(e,null,0),++U,this.id=f(e.id)?U:e.id,this.duration=0,this.labels={};let t=e.defaults,n=a.defaults;this.defaults=t?m(t,n):n,this.composition=A(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=A(e.playbackEase,n.playbackEase);this._ease=r?v(r):null,this.iterationDuration=0}add(e,t,n){let r=S(t),i=S(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=a.editor&&a.editor.addTimelineChild,o=n&&n.type===`Stagger`&&a.editor,s=p(n)?n:null;if(s||o){let t=T(e),o=this.duration,c=this.iterationDuration,l=r.id,u=0,d=t.length,p=i?i(e,r,this.id,n,d):null,m=s||a.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...p||r};this.duration=o,this.iterationDuration=c,f(l)||(n.id=l+`-`+u);let i=M(this,m(e,u,t,null,this));H(n,this,i,e,u,t),u++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;H(t,this,M(this,a),e)}}else H(e,this,M(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(f(e)||e&&f(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!f(e)&&!f(e.persist)&&(e.persist=!0);let r=a.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let o=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),o}set(e,t,n){return f(t)?this:(t.duration=h,t.composition=l.replace,this.add(e,t,n))}call(e,t){return f(e)||e&&!p(e)?this:(a.editor&&a.editor.addTimelineCall&&(t=a.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return f(e)||e&&!d(e)||(a.editor&&a.editor.addTimelineLabel&&(t=a.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=M(this,t)),this}remove(e,t){return y(T(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;s(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return s(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),s(this,e=>e.revert,!0),g(this)}then(e){return super.then(e)}},G=e=>a.editor?a.editor.addTimeline(e):new W(e).init(),K=e(t(),1),q=n(),J=.62,te=(e,t)=>String(e).length*t*J;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=te(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ne=w[8]+w[7];function $({hash:e,label:t,part:n,children:r}){return(0,q.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>N(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),N(e))},children:r})}function re({overview:e,dataRev:t}){let{data:n}=I(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,K.useRef)(null),l=(0,K.useRef)(!0),u=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!x())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=P(t(`.cm-edge`));C([...n,...r,...i],{opacity:0,scale:.7}),C([...a,...o],{opacity:0}),C(s,{draw:`0 0`});let d=G({autoplay:!1,defaults:{ease:E}}).add(n,{opacity:1,scale:1,duration:w[7]},0).add(s,{draw:`0 1`,duration:w[7],delay:R(w[1])},w[3]).add(r,{opacity:1,scale:1,duration:w[7],delay:R(w[1])},w[5]).add(a,{opacity:1,duration:w[6],delay:R(w[1])},w[7]).add(i,{opacity:1,scale:1,duration:w[7],delay:R(w[1])},w[8]).add(o,{opacity:1,duration:w[6]},w[8]);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=_(d,ne),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=z(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,n:0}),t.n+=1}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},v={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},y={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},b=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),S=[{...b(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:v},{...b(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:v},{...b(816,232,`Memory`,d.memory??0),hash:`#/personal/memory`,from:y},{...b(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:y}],T={rx:122,ry:68,from:212,to:112},D=p.map((e,t)=>{let n=(p.length===1?(T.from+T.to)/2:T.from+(T.to-T.from)*t/(p.length-1))*Math.PI/180;return{...e,x:y.x+T.rx*Math.cos(n),y:y.y+T.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),O=D.length;return(0,K.useLayoutEffect)(()=>{let e=c.current;if(!e||!O||Q||!x())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];C(t,{opacity:0,scale:.5});let n=()=>C(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=ee(t,{opacity:1,scale:1,duration:w[7],delay:R(w[1],{start:w[7]}),ease:E});n=_(e,w[7]+w[1]*O+w[7])};return l.current?r():u.current=r,()=>{u.current=null,n()}},[O]),(0,q.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,q.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(h,v,-.07),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(h,y,.07),className:`cm-edge`}),S.map(e=>(0,q.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,q.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules`,children:[(0,q.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,q.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,q.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules`]}),(0,q.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,q.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,q.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,q.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,q.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,q.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,q.jsx)(`text`,{x:v.x,y:v.y+v.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules`,children:[(0,q.jsx)(`circle`,{cx:y.x,cy:y.y,r:y.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:y.x,y:y.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,q.jsx)(`text`,{x:y.x,y:y.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,q.jsx)(`text`,{x:y.x+22,y:y.y+y.r+20,className:`cm-note`,children:d.doctrines?`${d.doctrines.active}/${d.doctrines.total} packs built in`:`packs chosen at build`}),(0,q.jsx)(`g`,{className:`cm-mini`,children:D.map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:F(e.id)}}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,q.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:F(e.id)},children:e.n})]},e.id))}),(0,q.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),S.map(e=>(0,q.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,q.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,q.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ie({counts:e}){let t=[{label:j.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules`,n:z(e),hash:`#/laws`},{label:j.agents.label,n:e.agents??0,hash:`#/agents`},{label:j.memory.label,n:e.memory??0,hash:`#/personal/memory`},{label:j.notebook.label,n:e.notebook??0,hash:`#/personal/notebook`},{label:j.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:j.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Growth rings`}),(0,q.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,q.jsxs)(`button`,{className:`jr-ring`,onClick:()=>N(e.hash),children:[(0,q.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,q.jsx)(`span`,{className:`jr-ring-track`,children:(0,q.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,q.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ae({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Freshly grown`}),(0,q.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,q.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,q.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>N(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,q.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,q.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,q.jsx)(`span`,{className:`jr-fresh-when`,children:L(e.mtime)})]},`${e.section}:${e.name}`)):(0,q.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,q.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,q.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${L(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>N(`#/activity`),children:`log →`})]})]})}function oe({overview:e,recent:t,lens:n,dataRev:r}){let i=e?.counts||{};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`jr-head`,children:(0,q.jsx)(B,{verdict:n?.verdict})}),(0,q.jsxs)(`div`,{className:`jr-row2`,children:[(0,q.jsx)(ie,{counts:i}),(0,q.jsx)(ae,{recent:t,buildEpoch:e?.build_epoch})]}),(0,q.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,q.jsx)(`button`,{className:`jr-go right`,onClick:()=>N(`#/laws`),children:`open →`})]}),(0,q.jsx)(re,{overview:e,dataRev:r})]})]})}export{oe as default};