geneseed 4.20.0 → 4.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/SHIPPED.md +1 -1
  3. package/docs/guides/upgrade.md +1 -1
  4. package/docs/web-ui.md +11 -10
  5. package/harness.config.json +1 -1
  6. package/js/README.md +1 -1
  7. package/js/web/actions.mjs +39 -0
  8. package/js/web/api.mjs +24 -2
  9. package/js/web/handler.mjs +20 -1
  10. package/js/web/jobs.mjs +6 -6
  11. package/js/web/usage-api.mjs +24 -3
  12. package/package.json +1 -1
  13. package/src/skills/rule.md +3 -3
  14. package/web/dist/assets/Activity-DsKkFGhT.js +1 -0
  15. package/web/dist/assets/{ActivityDetail-CMeNtKIN.js → ActivityDetail-BWY-vaiK.js} +1 -1
  16. package/web/dist/assets/Dashboard-BZmw2a7d.js +2 -0
  17. package/web/dist/assets/Docs-CNuRuMin.js +4 -0
  18. package/web/dist/assets/GreenhouseView-BCiZP9f9.js +1 -0
  19. package/web/dist/assets/Installs-xkBX6OjK.js +3 -0
  20. package/web/dist/assets/JournalView-BSR51TKR.js +1 -0
  21. package/web/dist/assets/{KitApply-DZGqaZpV.js → KitApply-BR8AcZ62.js} +1 -1
  22. package/web/dist/assets/{Kits-C1VS-BtR.js → Kits-e0DCj9sT.js} +1 -1
  23. package/web/dist/assets/{Laws-Cu3pj44B.js → Laws-BuG2_HFE.js} +2 -2
  24. package/web/dist/assets/Library-BYfB4mhf.js +2 -0
  25. package/web/dist/assets/Loops-r6L7a1g1.js +2 -0
  26. package/web/dist/assets/OperatorHudView-BLXm0zzn.js +1 -0
  27. package/web/dist/assets/Personal-kEfKCxlh.js +1 -0
  28. package/web/dist/assets/{StackBar-CXARiXzd.js → StackBar-Y_gkoC3t.js} +1 -1
  29. package/web/dist/assets/Tabs-2uMB511T.js +1 -0
  30. package/web/dist/assets/activity-BEWV9er4.js +1 -0
  31. package/web/dist/assets/drawable-ixCquffB.js +1 -0
  32. package/web/dist/assets/{index-BJlfPvpv.css → index-CDSHv_7s.css} +1 -1
  33. package/web/dist/assets/index-Dwo3Gxek.js +2 -0
  34. package/web/dist/assets/jobBuckets-Dpjvbfm1.js +2 -0
  35. package/web/dist/index.html +2 -2
  36. package/web/dist/assets/Activity-nRkdnrgE.js +0 -1
  37. package/web/dist/assets/Dashboard-B5-wUlXC.js +0 -3
  38. package/web/dist/assets/Docs-QmZs08QG.js +0 -4
  39. package/web/dist/assets/GreenhouseView-tHIvpI6U.js +0 -1
  40. package/web/dist/assets/Installs-DDWjgFDY.js +0 -3
  41. package/web/dist/assets/JournalView-DO0pPutM.js +0 -1
  42. package/web/dist/assets/Library-CrTK5XsD.js +0 -2
  43. package/web/dist/assets/Loops-C7DPrKbV.js +0 -2
  44. package/web/dist/assets/OperatorHudView-BN27gXFS.js +0 -1
  45. package/web/dist/assets/Personal-Cz2rcqYw.js +0 -1
  46. package/web/dist/assets/Tabs-ChiCgm2F.js +0 -1
  47. package/web/dist/assets/activity-BGy8Bb_l.js +0 -1
  48. package/web/dist/assets/drawable-r1qCgRMK.js +0 -1
  49. package/web/dist/assets/index-osXUqzdX.js +0 -2
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-BZmw2a7d.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/api-BfpZmUMI.js","assets/drawable-ixCquffB.js","assets/sections-ChwaobfW.js","assets/jobBuckets-Dpjvbfm1.js","assets/Activity-DsKkFGhT.js","assets/activity-BEWV9er4.js","assets/EmptyState-1sPNleqv.js","assets/usePoll-bDFN-Hr6.js","assets/ActivityDetail-BWY-vaiK.js","assets/Library-BYfB4mhf.js","assets/RailCats-DNlJKicm.js","assets/Markdown-OReRRoEV.js","assets/Kits-e0DCj9sT.js","assets/KitApply-BR8AcZ62.js","assets/Loops-r6L7a1g1.js","assets/Laws-BuG2_HFE.js","assets/StackBar-Y_gkoC3t.js","assets/Personal-kEfKCxlh.js","assets/Tabs-2uMB511T.js","assets/Installs-xkBX6OjK.js","assets/Docs-CNuRuMin.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r,t as i}from"./react-DlYQp10C.js";import{t as a}from"./api-BfpZmUMI.js";import{i as o,n as s,r as c}from"./sections-ChwaobfW.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=typeof window<`u`,u=l?window:null,d=l?document:null,f={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},p={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},m={NONE:0,AUTO:1,FORCE:2},h={replace:0,none:1,blend:2},g=Symbol(),_=Symbol(),v=Symbol(),y=Symbol(),b=Symbol(),x=1e-11,S=0xe8d4a51000,C=1e3,w=[],T=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),E=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],D=E.reduce((e,t)=>({...e,[t]:t+`(`}),{}),O=()=>{},k=e=>e,A=/\)\s*[-.\d]/,ee=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,te=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,j=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,ne=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,M=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,N=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,P=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,F=/([a-z])([A-Z])/g,re=/(\*=|\+=|-=)/,ie=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,ae={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:C,delay:0,loopDelay:0,ease:`out(2)`,composition:h.replace,modifier:k,onBegin:O,onBeforeUpdate:O,onUpdate:O,onLoop:O,onPause:O,onComplete:O,onRender:O},oe={current:null,root:d},I={defaults:ae,precision:4,timeScale:1,tickThreshold:200,editor:null},se={version:`4.5.0`,engine:null};l&&(u.AnimeJS||=[],u.AnimeJS.push(se));var ce=e=>e.replace(F,`$1-$2`).toLowerCase(),le=(e,t)=>e.indexOf(t)===0,ue=Date.now,de=Array.isArray,fe=e=>e&&e.constructor===Object,pe=e=>typeof e==`number`&&!isNaN(e),me=e=>typeof e==`string`,he=e=>typeof e==`function`,L=e=>e===void 0,ge=e=>L(e)||e===null,R=e=>l&&e instanceof SVGElement,_e=e=>ee.test(e),ve=e=>le(e,`rgb`),ye=e=>le(e,`hsl`),be=e=>_e(e)||(ve(e)||ye(e))&&(e[e.length-1]===`)`||!A.test(e)),xe=e=>!I.defaults.hasOwnProperty(e),Se=[`opacity`,`rotate`,`overflow`,`color`],z=(e,t)=>{if(Se.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},Ce=e=>me(e)?parseFloat(e):e,we=Math.pow,Te=Math.sqrt,Ee=Math.sin,De=Math.cos,Oe=Math.abs,ke=Math.floor,Ae=Math.asin,je=Math.PI,Me=Math.round,Ne=(e,t,n)=>e<t?t:e>n?n:e,B=(e,t)=>{if(t<0)return e;if(!t)return Me(e);let n=10**t;return Me(e*n)/n},Pe=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,Fe=e=>e===1/0?S:e===-1/0?-S:e,Ie=e=>e<=1e-11?x:Fe(B(e,11)),V=e=>de(e)?[...e]:e,Le=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=L(i)?t[r]:i}return n},H=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},Re=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},ze=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},Be=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[y],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!L(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:le(t,`scale`)?`1`:le(t,`rotate`)||le(t,`skew`)?`0deg`:`0px`},Ve=e=>{let t=``;for(let n=0,r=E.length;n<r;n++){let r=E[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${D[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},He=[];function Ue(e,t){if(!e)return null;let n=He.length;outer:for(let r=0;r<n;r++){let n=He[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=He[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var We=e=>{let t=te.exec(e)||j.exec(e),n=L(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},Ge=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},Ke=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),qe=e=>{let t=ne.exec(e)||M.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=L(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=B(Ke(t,e,n+1/3)*255,0),s=B(Ke(t,e,n)*255,0),c=B(Ke(t,e,n-1/3)*255,0)}return[o,s,c,a]},Je=e=>ve(e)?We(e):_e(e)?Ge(e):ye(e)?qe(e):[0,0,0,1],U=(e,t)=>L(e)?t:e,Ye=(e,t)=>{let n=e.match(ie),r=t[_]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Xe=(e,t,n,r,i,a)=>{if(he(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(me(e)&&le(e,`var(`)){if(!i)return Ye(e,t);let n=()=>Ye(e,t);return i.func=n,n()}return e},Ze=(e,t)=>e[_]?e[v]&&z(e,t)?f.ATTRIBUTE:E.includes(t)||T.get(t)?f.TRANSFORM:le(t,`--`)?f.CSS_VAR:t in e.style?f.CSS:t in e?f.OBJECT:f.ATTRIBUTE:f.OBJECT,Qe=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[b]||e).getPropertyValue(t);return i===`auto`?`0`:i},$e=(e,t,n,r)=>{let i=L(n)?Ze(e,t):n,a=Ue(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===f.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===f.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===f.TRANSFORM?Be(e,t,r):i===f.CSS_VAR?Qe(e,t,r).trimStart():Qe(e,t,r)},et=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,tt=()=>({t:p.NUMBER,n:0,u:null,o:null,d:null,s:null}),W=(e,t)=>{if(t.t=p.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&P.exec(r);if(i)return t.t=p.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(be(r))return t.t=p.COLOR,t.d=Je(r),t;{let e=r.match(N);return t.t=p.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(N)||[],t}},nt=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=V(e._toNumbers),t.s=V(e._strings),t),rt=tt(),it=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(B(Pe(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},at=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,g=e._reversed,_=e._alternate,v=e._hasChildren,b=e._delay,S=e._currentTime,C=b+c,w=t-b,T=Ne(S,-b,o),E=Ne(w,-b,o),D=w-S,O=E>0,k=E>=o,A=o<=x,ee=i===m.FORCE,te=0,j=w,ne=0;if(l>1){let t=c+(k?0:d),n=~~(E/t);e._currentIteration=Ne(n,0,l),k&&e._currentIteration--,te=e._currentIteration%2,j=E-n*t||0}let M=g^(_&&te),N=e._ease,P=k?M?0:o:M?c-j:j;N&&(P=c*N(P/c)||0);let F=(a?a.backwards:w<S)?!M:!!M;if(e._currentTime=w,e._iterationTime=P,e.backwards=F,O&&!e.began?(e.began=!0,!n&&(!a||!F&&a.began)&&e.onBegin(e)):w<=0&&(e.began=!1),!n&&!v&&O&&e._currentIteration!==u&&e.onLoop(e),ee||i===m.AUTO&&(t>=(a&&b>0?0:b)&&t<=C||t<=b&&T>b||t>=C&&T!==o)||P>=C&&T!==o||P<=b&&T>0&&!k||t<=T&&T===o&&s||k&&!s&&A){if(O&&(e.computeDeltaTime(T),n||e.onBeforeUpdate(e)),!v){let t=ee||(F?D*-1:D)>=I.tickThreshold,i=B(e._offset+(a?a._offset:0)+b+P,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,m=o._absoluteStartTime+o._changeDuration,g=o._nextRep,_=o._prevRep,v=e!==h.none,b=_?_._absoluteStartTime+_._changeDuration:0,x=_&&_.parent!==o.parent,S=!g||g._isOverridden?m:g.parent===o.parent?m+g._delay:g._absoluteStartTime<g._absoluteUpdateStartTime?g._absoluteStartTime:g._absoluteUpdateStartTime;if((t||(n!==a||i<=S||_&&!x&&(!g||g.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||x&&!o._hasFromValue&&!_._isOverridden&&i>=b||g&&!g._isOverridden&&g.parent===o.parent&&g._currentTime!==0&&P<g._startTime))&&(!_||x||P>=o._startTime)&&(!v||!o._isOverridden&&(!o._isOverlapped||i<=m)&&(!g||g._isOverridden||i<=S)&&(!_||_._isOverridden||(x?i>=o._absoluteStartTime||!o._hasFromValue&&i>=b:i>=b+o._delay)))){let t=o._currentTime=Ne(P-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,m=o._valueType,g=o._tweenType,_=g===f.OBJECT,b=m===p.NUMBER,x=b&&_||n===0||n===1?-1:I.precision,S,C;if(b)S=C=i(B(Pe(o._fromNumber,o._toNumber,n),x));else if(m===p.UNIT)C=i(B(Pe(o._fromNumber,o._toNumber,n),x)),S=`${C}${o._unit}`;else if(m===p.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(Pe(t[3],a[3],n)),(!o._setter||r)&&(S=`rgba(${B(e[0],0)},${B(e[1],0)},${B(e[2],0)},${e[3]})`)}else m===p.COMPLEX&&(S=it(o,n,x));if(v&&(o._number=C),!r&&e!==h.blend){let e=o.property;s=o.target,o._setter?o._setter(s,C,o):_?s[e]=S:g===f.ATTRIBUTE?s.setAttribute(e,S):(c=s.style,g===f.TRANSFORM?(s!==l&&(l=s,u=s[y]),u[e]=S,d=1):g===f.CSS?c[e]=S:g===f.CSS_VAR&&c.setProperty(e,S)),O&&(ne=1)}else o._value=S}else n&&_&&!x&&P<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=Ve(u),d=0),o=o._next}!n&&ne&&e.onRender(e)}!n&&O&&e.onUpdate(e)}return a&&A?!n&&(a.began&&!F&&w>0&&!s||F&&w<=1e-11&&s)&&(e.onComplete(e),e.completed=!F):O&&k?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!v&&(e.completed=!0,!n&&(!a||!F&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,ne},ot=(e,t,n,r,i)=>{let a=e._currentIteration;if(at(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=ue(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;H(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&at(t,e,n,1,m.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}H(o,e=>{let t=B((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=at(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},st={},ct=(e,t,n)=>{if(n===f.TRANSFORM)return T.get(e)||e;if(n===f.CSS||n===f.ATTRIBUTE&&R(t)&&e in t.style){let t=st[e];if(t)return t;{let t=e&&ce(e);return st[e]=t,t}}return e},lt=(e,t=!1)=>{if(e._hasChildren)H(e,e=>lt(e,t),!0);else{let n=e;n.pause(),H(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=ge(o)||o===``;if(e._setter){if(!t&&!s){if(W(o,rt),rt.d){let t=rt.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=rt.n;e._setter(e.target,e._number,e)}}else if(a===f.OBJECT)!t&&!s&&(i[r]=o);else if(i[_]){if(a===f.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===f.TRANSFORM){let n=i[y];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=Ve(n):t.removeProperty(`transform`))}else s?t.removeProperty(ce(r)):t[r]=o}}i[_]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},ut=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=C/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?x:t,r=C/n;n>ae.frameRate&&(ae.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?x:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?m.NONE:(this._lastTickTime=n>=t?e-n%t:e,m.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},dt={animation:null,update:O},ft=e=>{let t=dt.animation;return t||(t={duration:x,computeDeltaTime:O,_offset:0,_delay:0,_head:null,_tail:null},dt.animation=t,dt.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===p.COMPLEX||e===p.COLOR?V(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),at(t,1,1,0,m.FORCE)}),t},pt=l?requestAnimationFrame:setImmediate,mt=l?cancelAnimationFrame:clearImmediate,ht=class extends ut{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=ae,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=ue();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(Re(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):ot(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):m.AUTO),r=i}dt.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(ue()),this.reqId=pt(gt)),this}pause(){if(this.reqId)return this.paused=!0,_t()}resume(){if(this.paused)return this.paused=!1,H(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(I.timeScale===1?1:C)}set speed(e){let t=e*I.timeScale;this._speed!==t&&(this._speed=t,H(this,e=>e.speed=e._speed))}get timeUnit(){return I.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(I.timeScale!==r){I.timeScale=r,I.tickThreshold=200*r;let e=n?t:C;this.defaults.duration*=e,this._speed*=e}}get precision(){return I.precision}set precision(e){I.precision=e}},G=(()=>{let e=new ht(ue());return l&&(se.engine=e,d.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(d.hidden?e.pause():e.resume())})),e})(),gt=()=>{G._head?(G.reqId=pt(gt),G.update()):G.reqId=0},_t=()=>(mt(G.reqId),G.reqId=0,G),vt={_rep:new WeakMap,_add:new Map},yt=(e,t,n=`_rep`)=>{let r=vt[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},bt=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,xt=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=x,e._currentTime=x},St=(e,t)=>{let n=e._composition;if(n===h.replace){let n=e._absoluteStartTime;ze(t,e,bt,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){xt(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)xt(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=B(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&xt(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(H(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;H(e,e=>{e!==t&&H(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===h.blend){let t=yt(e.target,e.property,`_add`),n=ft(vt._add),r=t._head;r||(r={...e},r._composition=h.replace,r._updateDuration=x,r._startTime=0,r._numbers=V(e._fromNumbers),r._number=0,r._next=null,r._prev=null,ze(t,r),ze(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=V(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=V(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}ze(t,e,null,`_prevAdd`,`_nextAdd`)}return e},Ct=e=>{let t=e._composition;if(t!==h.none){let n=e.target,r=e.property,i=vt._rep.get(n)[r];if(Re(i,e,`_prevRep`,`_nextRep`),t===h.blend){let t=vt._add,i=t.get(n);if(!i)return;let a=i[r],o=dt.animation;Re(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){Re(a,s,`_prevAdd`,`_nextAdd`),Re(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},wt=(e,t,n)=>{let r=!1;return H(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=ct(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===f.TRANSFORM&&i._prev&&i._prev._tweenType===f.TRANSFORM&&(i._prev._renderTransforms=1),Re(t,i),Ct(i),r=!0)}},!0),r},Tt=(e,t,n)=>{let r=t||G,i;if(r._hasChildren){let t=0;H(r,a=>{if(!a._hasChildren){if(i=wt(e,a,n),i&&!a._head)a.cancel(),Re(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?Tt(e,a,n):a._hasChildren=!1},!0),L(r.iterationDuration)||(r.iterationDuration=t)}else i=wt(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},Et=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Dt=e=>e._cancelled?(e._hasChildren?H(e,Dt):H(e,e=>{e._composition!==h.none&&St(e,yt(e.target,e.property))}),e._cancelled=0,e):e,Ot=0,kt=(e,t)=>e._priority>t._priority,At=class extends ut{constructor(e={},t=null,n=0){super(0),++Ot;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;oe.current&&oe.current.register(this);let b=t?0:G._lastTickTime,x=t?t.defaults:I.defaults,S=he(i)||L(i)?x.delay:+i,C=he(a)||L(a)?1/0:+a,w=U(c,x.loop),T=U(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(G.reqId||G.requestTick(ue()),D=(G._lastTickTime-G._startTime)*I.timeScale),this.id=L(r)?Ot:r,this.parent=t,this.duration=Fe((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&U(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=O,this._running=!1,this._reversed=+U(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=U(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=U(d,x.frameRate),this._speed=U(f,x.playbackRate),this._priority=+U(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return Ne(B(this._currentTime,I.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return Ne(B(this._iterationTime,I.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return Ne(B(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return Ne(B(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*Ne(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Dt(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,ot(this,0,1,~~e,m.FORCE),Et(this),this._hasChildren&&H(this,Et),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&ot(this,this.duration,1,~~e,m.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!L(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*G._speed);return this._startTime=ue()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?ot(this,x,0,0,m.FORCE):(this._running||=(ze(G,this,kt),G._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,G.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){Dt(this),this.completed=!1;let r=this.paused;return this.paused=!0,ot(this,e+this._delay,~~t,~~n,m.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?ke(S/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?H(this,e=>e.cancel(),!0):H(this,Ct),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=Ie(e);if(t===n)return this;let r=e/t,i=e<=x;return this.duration=i?x:n,this.iterationDuration=i?x:Ie(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){ot(this,0,1,0,m.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=O){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=O};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function jt(e){let t=me(e)?oe.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function Mt(e){if(ge(e))return[];if(!l)return de(e)&&e.flat(1/0)||[e];if(de(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!ge(r)){let e=jt(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!ge(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=jt(e);return t?Array.from(t):[e]}function Nt(e){let t=Mt(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[g]){n[g]=!0;let e=R(n);(n.nodeType||e)&&(n[_]=!0,n[v]=e,n[y]={})}}return t}var Pt={deg:1,rad:180/je,turn:360},Ft={},It=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===p.UNIT&&i===n)return t;let o=a+i+n,s=Ft[o];if(!L(s)&&!r)t.n=s;else{let r;if(i in Pt)r=a*Pt[i]/Pt[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==d?o:d.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,Ft[o]=r}return t.t,p.UNIT,t.u=n,t},Lt=e=>e,Rt=(e=1.68)=>t=>we(t,+e),zt={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},Bt=je/2,Vt=je*2,Ht={"":Rt,Quad:Rt(2),Cubic:Rt(3),Quart:Rt(4),Quint:Rt(5),Sine:e=>1-De(e*Bt),Circ:e=>1-Te(1-e*e),Expo:e=>e?we(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=we(2,--n))-1)/11;);return 1/we(4,3-n)-7.5625*we((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=Ne(+e,1,10),r=Ne(+t,x,2),i=r/Vt*Ae(1/n),a=Vt/r;return e=>e===0||e===1?e:-n*we(2,-10*(1-e))*Ee((1-e-i)*a)}},Ut=(()=>{let e={linear:Lt,none:Lt};for(let t in zt)for(let n in Ht){let r=Ht[n],i=zt[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),Wt={linear:Lt,none:Lt},Gt=e=>{if(Wt[e])return Wt[e];if(e.indexOf(`(`)<=-1){let t=zt[e]||e.includes(`Back`)||e.includes(`Elastic`)?Ut[e]():Ut[e];return t?Wt[e]=t:Lt}{let t=e.slice(0,-1).split(`(`),n=Ut[t[0]];return n?Wt[e]=n(...t[1].split(`,`)):Lt}},Kt=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],qt=e=>{if(me(e)){for(let t=0,n=Kt.length;t<n;t++)if(le(e,Kt[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),Lt}return he(e)?e:me(e)?Gt(e):Lt},K=tt(),q=tt(),Jt={},Yt={func:null},Xt={func:null},Zt=[null],Qt=[null,null],$t={to:null},en=0,tn=0,nn,rn,an=(e,t)=>{let n={};if(de(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(xe);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];xe(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=U(t.duration,I.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(xe(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},on=class extends At{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++tn;let s=Nt(e),c=s.length,l=t.keyframes,u=l?Le(an(l,t),t):t,{id:d,delay:m,duration:g,ease:_,playbackEase:v,modifier:y,composition:b,onRender:S}=u,C=n?n.defaults:I.defaults,T=U(_,C.ease),E=U(v,C.playbackEase),D=E?qt(E):null,O=!L(T.ease),k=O?T.ease:U(_,D?`linear`:C.ease),A=O?T.settlingDuration:U(g,C.duration),ee=U(m,C.delay),te=y||C.modifier,j=L(b)&&c>=1e3?h.none:L(b)?C.composition:b,ne=this._offset+(n?n._offset:0);O&&(T.parent=this);let M=NaN,N=NaN,P=0,F=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(xe(e)){let a=Ze(t,e),o=Ue(t,e),s=ct(e,t,a),m=u[e],g=de(m);if(i&&!g&&(Qt[0]=m,Qt[1]=m,m=Qt),g){let e=m.length,t=!fe(m[0]);e===2&&t?($t.to=m,Zt[0]=$t,nn=Zt):e>2&&t?(nn=[],m.forEach((e,t)=>{t?t===1?(Qt[1]=e,nn.push(Qt)):nn.push(e):Qt[0]=e})):nn=m}else Zt[0]=m,nn=Zt;let _=null,v=null,y=NaN,b=0,x=0;for(let e=nn.length;x<e;x++){let i=nn[x];fe(i)?rn=i:($t.to=i,rn=$t),Yt.func=null,Xt.func=null;let l=Xe(U(rn.composition,j),t,r,c,null,null),u=pe(l)?l:h[l];!_&&u!==h.none&&(_=yt(t,s));let d=_?_._tail:null,f=n&&d&&d.parent.parent===n?d:v,m=Xe(rn.to,t,r,c,Yt,f),g;fe(m)&&!L(m.to)?(rn=m,g=m.to):g=m;let S=Xe(rn.from,t,r,c,Xt,f),C=rn.ease||k,T=Xe(C,t,r,c,null,f),E=he(T)||me(T)?T:C,D=!L(E)&&!L(E.ease),O=D?E.ease:E,M=D?E.settlingDuration:Xe(U(rn.duration,e>1?Xe(A,t,r,c,null,f)/e:A),t,r,c,null,f),N=Xe(U(rn.delay,x?0:ee),t,r,c,null,f),re=rn.modifier||te,ie=!L(S),ae=!L(g),oe=de(g),I=oe||ie&&ae,se=v?b:0,ce=v?b+N:N,le=B(ne+ce,12),ue=B(ne+se,12);!F&&(ie||oe)&&(F=1);let R=v;if(u!==h.none){let e=_._head;for(;e&&e._absoluteStartTime<=le;)if(e._isOverridden||(R=e),e=e._nextRep,e&&e._absoluteStartTime>=le)for(;e;)xt(e),e=e._nextRep}if(I){W(oe?Xe(g[0],t,r,c,Xt,f):S,K),W(oe?Xe(g[1],t,r,c,Yt,f):g,q);let e=$e(t,s,a,Jt);K.t===p.NUMBER&&(R?R._valueType===p.UNIT&&(K.t=p.UNIT,K.u=R._unit):(W(e,rt),rt.t===p.UNIT&&(K.t=p.UNIT,K.u=rt.u)))}else ae?W(g,q):v?nt(v,q):W(n&&R&&R.parent.parent===n?R._value:$e(t,s,a,Jt),q),ie?W(S,K):v?nt(v,K):W(n&&R&&R.parent.parent===n?R._value:$e(t,s,a,Jt),K);if(K.o&&(K.n=et(R?R._toNumber:W($e(t,s,a,Jt),rt).n,K.n,K.o)),q.o&&(q.n=et(K.n,q.n,q.o)),K.t!==q.t){if(K.t===p.COMPLEX||q.t===p.COMPLEX){let e=K.t===p.COMPLEX?K:q,t=K.t===p.COMPLEX?q:K;t.t=p.COMPLEX,t.s=V(e.s),t.d=e.d.map(()=>t.n)}else if(K.t===p.UNIT||q.t===p.UNIT){let e=K.t===p.UNIT?K:q,t=K.t===p.UNIT?q:K;t.t=p.UNIT,t.u=e.u}else if(K.t===p.COLOR||q.t===p.COLOR){let e=K.t===p.COLOR?K:q,t=K.t===p.COLOR?q:K;t.t=p.COLOR,t.d=e.d.map(()=>0)}}if(K.u!==q.u){let e=q.u?K:q;e=It(t,e,q.u?q.u:K.u,!1)}if(q.d&&K.d&&q.d.length!==K.d.length){let e=K.d.length>q.d.length?K:q,t=e===K?q:K;t.d=e.d.map((e,n)=>L(t.d[n])?0:t.d[n]),t.s=V(e.s)}let _e=B(+M||1e-11,12),ve=Jt[s];ge(ve)||(Jt[s]=null);let ye=o?o.set:null;b=B(ce+_e,12);let be=K.d,xe=q.d,Se=q.s,z={parent:this,id:en++,property:s,target:t,_value:null,_toFunc:Yt.func,_fromFunc:Xt.func,_ease:qt(O),_fromNumbers:be?V(be):w,_toNumbers:xe?V(xe):w,_strings:Se?V(Se):w,_fromNumber:K.n,_toNumber:q.n,_numbers:be?V(be):w,_number:K.n,_unit:q.u,_modifier:re,_currentTime:0,_startTime:ce,_delay:+N,_updateDuration:_e,_changeDuration:_e,_absoluteStartTime:le,_absoluteUpdateStartTime:ue,_absoluteEndTime:B(ne+b,12),_hasFromValue:ie||oe?1:0,_tweenType:a,_setter:ye,_valueType:q.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:ve,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==h.none&&St(z,_);let Ce=z._valueType;if(Ce===p.COMPLEX)z._value=it(z,1,-1);else if(Ce===p.UNIT)z._value=`${re(z._toNumber)}${z._unit}`;else if(Ce===p.COLOR){let e=q.d;z._value=`rgba(${B(e[0],0)},${B(e[1],0)},${B(e[2],0)},${e[3]})`}else z._value=re(z._toNumber);isNaN(y)&&(y=z._startTime),v=z,P++,ze(this,z)}(isNaN(N)||y<N)&&(N=y),(isNaN(M)||b>M)&&(M=b),a===f.TRANSFORM&&(l=P-x,d=P)}if(!isNaN(l)){let e=0;H(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===h.blend&&H(dt.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),N?(H(this,e=>{e._startTime-e._delay||(e._delay-=N),e._startTime-=N}),M-=N):N=0,M||(M=x,this.iterationCount=0),this.targets=s,this.id=L(d)?tn:d,this.duration=M===1e-11?x:Fe((M+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=S||C.onRender,this._ease=D,this._delay=N,this.iterationDuration=M,!this._autoplay&&F&&this.onRender(this)}stretch(e){let t=this.duration;if(t===Ie(e))return this;let n=e/t;return H(this,e=>{e._updateDuration=Ie(e._updateDuration*n),e._changeDuration=Ie(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return H(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(W(n(),K),K.u!==e._unit&&e.target[_]&&It(e.target,K,e._unit,!0),e._fromNumbers=V(K.d),e._fromNumber=K.n):t&&(W($e(e.target,e.property,e._tweenType),rt),e._fromNumbers=V(rt.d),e._fromNumber=rt.n),t&&(W(t(),q),e._toNumbers=V(q.d),e._strings=V(q.s),e._toNumber=q.o?et(e._fromNumber,q.n,q.o):q.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),lt(this)}then(e){return super.then(e)}},sn=(e,t)=>I.editor?I.editor.addAnimation(e,t):new on(e,t,null,0,!1).init(),cn=(e,t)=>{if(le(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},ln=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),L(t))return n;if(pe(+t))return+t;let r=t,i=e?e.labels:null,a=!ge(i),o=cn(e,r),s=!L(o),c=re.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return et(s?o:a?l:n,+t[1],e[0])}return s?o:a?L(i[r])?n:i[r]:n},un=(e,t)=>{if(!L(t))return I.editor&&I.editor.addSet?I.editor.addSet(e,t):(t.duration=x,t.composition=U(t.composition,h.none),new on(e,t,null,0,!0).resume())},dn=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},fn=0,pn=(e,t=0,n=1,r=0)=>{let i=e===void 0?fn++: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}},mn=(e,t=dn)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},hn=(e,t={})=>{let n=[],r=0,i,a=null,o=t.from,s=t.reversed,c=t.ease,l=!L(c),u=l&&!L(c.ease)?c.ease:l?qt(c):null,d=t.grid,f=d===!0,p=t.axis,m=t.total,h=L(o)||o===0||o===`first`,g=o===`center`,_=o===`last`,v=o===`random`,y=de(o),b=de(e),x=t.use,S=Ce(b?e[0]:e),C=b?Ce(e[1]):0,w=P.exec((b?e[1]:e)+``),T=t.start||0+(b?S:0),E=t.seed,D=!L(E)&&E!==!1?pn(E===!0?0:E):dn,O=t.jitter,k=!L(O),A=de(O),ee=A?O[0]:O||0,te=A?O[1]:O||0,j=h?0:pe(o)?o:0;return(e,c,l,h,E)=>{let[O]=Nt(e),A=L(m)?l.length:m,ne=L(x)?!1:he(x)?x(O,c,A):$e(O,x),M=pe(ne)||me(ne)&&pe(+ne)?+ne:c,N=M>=0&&M<A?M:c;if(g&&(j=(A-1)/2),_&&(j=A-1),!n.length){if(f){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,c=-1/0,u=-1/0,d=[],f=[],m=[];for(let n=0;n<A;n++){let o=l[n],p=0,h=0,g=0,_=!1;if(o&&he(o.getBoundingClientRect)){let e=o.getBoundingClientRect();p=e.left+e.width/2,h=e.top+e.height/2,_=!0}else{let e=o;e&&pe(e.x)&&pe(e.y)&&(p=e.x,h=e.y,pe(e.z)&&(g=e.z,t=!0),_=!0)}if(!_){e=!1;break}d.push(p),f.push(h),m.push(g),p<r&&(r=p),h<i&&(i=h),g<a&&(a=g),p>s&&(s=p),h>c&&(c=h),g>u&&(u=g)}if(e){let e=d[0],l=f[0],h=m[0];y?(e=r+o[0]*(s-r),l=i+o[1]*(c-i),h=t?a+(o.length>=3?o[2]:.5)*(u-a):0):g?(e=(r+s)/2,l=(i+c)/2,h=(a+u)/2):_?(e=d[A-1],l=f[A-1],h=m[A-1]):pe(o)&&(e=d[o],l=f[o],h=m[o]);for(let r=0;r<A;r++){let i=e-d[r],a=l-f[r],o=h-m[r],s=Te(i*i+a*a+(t?o*o:0));p===`x`&&(s=-i),p===`y`&&(s=-a),p===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<A;e++){let t=Oe(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<A;e++)n[e]=n[e]/v}else for(let e=0;e<A;e++)n.push(Oe(j-e))}else for(let e=0;e<A;e++)if(!d)n.push(Oe(j-e));else{let t=d.length,r=d[0]*d[1],i,a,s;y?(i=o[0]*(d[0]-1),a=o[1]*(d[1]-1),s=t===3?(o.length>=3?o[2]:.5)*(d[2]-1):0):g?(i=(d[0]-1)/2,a=(d[1]-1)/2,s=t===3?(d[2]-1)/2:0):(i=j%d[0],a=ke(j/d[0])%d[1],s=t===3?ke(j/r):0);let c=e%d[0],l=ke(e/d[0])%d[1],u=t===3?ke(e/r):0,f=i-c,m=a-l,h=s-u,_=Te(f*f+m*m+(t===3?h*h:0));p===`x`&&(_=-f),p===`y`&&(_=-m),p===`z`&&(_=-h),n.push(_)}r=n[0];for(let e=1;e<A;e++)n[e]>r&&(r=n[e]);if(u||s)for(let e=0;e<A;e++){let t=n[e];u&&(t=u(t/r)*r),s&&(t=p?-t:Oe(r-t)),n[e]=t}if(k){a=Array(A);for(let e=0;e<A;e++)a[e]=D(-1,1,4)}v&&(n=mn(n,D))}let P=b?(C-S)/r:S;L(i)&&(i=E?ln(E,L(t.start)?E.iterationDuration:T):T);let F=i+(P*B(n[N],2)||0);if(k){let e=r?n[N]/r:0,t=ee+(te-ee)*e;F+=a[N]*t}return t.modifier&&(F=t.modifier(F)),w&&(F=`${F}${w[2]}`),F}},gn=r(),_n=n(),J=e(t(),1);function vn(){return typeof window>`u`||!window.matchMedia?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function yn(e,t){let n=setTimeout(()=>e.complete(),t+400);return()=>{clearTimeout(n),e.complete()}}function bn(e,t=700){let n=typeof e==`number`&&Number.isFinite(e)?e:null,r=n!==null&&vn(),[i,a]=(0,J.useState)(0),o=(0,J.useRef)(0);return(0,J.useEffect)(()=>{if(!r)return;let e={n:o.current},i=sn(e,{n,duration:t,ease:`outExpo`,onUpdate:()=>{o.current=e.n,a(e.n)},onComplete:()=>{o.current=n,a(n)}}),s=setTimeout(()=>i.complete(),t+400);return()=>{clearTimeout(s),i.pause()}},[n,t,r]),r?i:n}function xn({value:e,duration:t}){let n=bn(e,t);return n===null?e??null:Math.round(n)}function Sn(e){let t=(0,J.useRef)(null),n=(0,J.useRef)(null),r=(0,J.useRef)(()=>{}),i=(0,J.useRef)(null);return(0,J.useLayoutEffect)(()=>{let a=t.current,o=a?.querySelector(`:scope > .glide`);o&&(r.current=t=>{let r=a.querySelector(e);if(!r){o.style.opacity=`0`,n.current=null;return}let s=a.getBoundingClientRect(),c=r.getBoundingClientRect(),l={translateX:c.left-s.left+a.scrollLeft-a.clientLeft,translateY:c.top-s.top+a.scrollTop-a.clientTop,width:c.width,height:c.height},u=n.current;if(n.current={el:r,...l},!(u&&u.el===r&&[`translateX`,`translateY`,`width`,`height`].every(e=>Math.abs(u[e]-l[e])<.5))){if(o.style.opacity=`1`,i.current&&=(clearTimeout(i.current.t),i.current.anim.pause(),null),t&&u&&u.el!==r&&vn()){let e=sn(o,{...l,duration:280,ease:`outExpo`});i.current={anim:e,t:setTimeout(()=>e.complete(),680)}}else un(o,l)}},r.current(!0))}),(0,J.useEffect)(()=>{let e=()=>r.current(!1);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function Cn(){let e=(0,J.useRef)(null),t=(0,J.useRef)(null);return(0,J.useLayoutEffect)(()=>{let n=e.current;if(!n){t.current=null;return}let r=[...n.querySelectorAll(`:scope > [data-flip]`)],i=new Map(r.map(e=>[e.dataset.flip,e.offsetTop])),a=t.current;if(t.current=i,a&&vn())for(let e of r){let t=a.get(e.dataset.flip);t===void 0?yn(sn(e,{opacity:[0,1],translateY:[-12,0],duration:340,ease:`outExpo`}),340):Math.abs(t-i.get(e.dataset.flip))>1&&yn(sn(e,{translateY:[t-i.get(e.dataset.flip),0],duration:340,ease:`outExpo`}),340)}}),e}var wn={overview:`Overview`,laws:`Constitution`,library:`Library`,kits:`Kits`,loops:`Loops`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},Tn={loops:[`templates`,`bricks`,`active`],personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`kits`,`edits`,`doctor`,`server`]},En={templates:`Templates`,bricks:`Bricks`,active:`Active`,rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,kits:`Kits`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},Dn={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},On=(e,t)=>t!==void 0&&Object.hasOwn(e,t),kn=(e,t)=>Tn[e].includes(t)?t:Tn[e][0];function An(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`&&On(o,r)?o[r]:r,t=n===`item`?a(i):void 0;return{page:e===`laws`?`laws`:`library`,section:e,item:t}}if(n===`docs`)return{page:`docs`,item:a(t.slice(1).join(`/`))};if(n===`kits`)return r?{page:`kits`,item:a(r)}:{page:`kits`};if(n===`activity`&&r)return{page:`activity`,item:a(r)};if(n===`skills`||n===`agents`)return{page:`library`,section:n};if(On(Tn,n)){let e=kn(n,r);return i&&e===r?{page:n,tab:e,item:a(i)}:{page:n,tab:e}}if(On(Dn,n)){let[e,t]=Dn[n];return t?{page:e,tab:t}:{page:e}}return{page:On(wn,n)?n:`overview`}}var jn=new Set;function Mn(e){return jn.add(e),()=>jn.delete(e)}function Nn(){let e=()=>An(typeof window<`u`?window.location.hash:``),[t,n]=(0,J.useState)(e);(0,J.useEffect)(()=>{let t=window.location.hash,r=()=>{let r=window.location.hash;if(r!==t){for(let e of jn)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,J.useRef)(!1);return(0,J.useEffect)(()=>{if(document.title=`${wn[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 Pn=e=>{window.location.hash=e},Fn={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},In={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},Ln=e=>Fn[e]||Fn.cyan,Rn={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`};function zn(e,t,n){if(!e)return;let r=n===`light`,i=r?In[t]||In.cyan:Ln(t);r&&t===`white`&&(i=`#566B62`);let a=r?Rn[t]||Rn.cyan:i;rr(e,$n(i,In[t]||In.cyan,Wn,a,r),r)}var Bn={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 Vn(e,t,n){let r=Bn[t];if(!e||!r)return!1;let i=n===`light`,a=i?r.light:r.dark;return rr(e,$n(a,r.light,r.ink,a,i),i),!0}var Hn={dark:{worst:`#232A31`,soft:[`#14181D`,`#1B2026`,`#11151A`,`#171C22`,`#0B1116`,`#121A21`,`#1C1A12`,`#211E15`]},light:{worst:`#EBE6D8`,soft:[`#FBFDFC`,`#F3F6F6`,`#F4F6F8`,`#E9F4ED`,`#FCFAF4`,`#F6F2E7`]}},Un=.13,Wn=`#06100D`,Gn=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},Kn=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),qn=e=>{let[t,n,r]=Gn(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},Jn=(e,t)=>{let[n,r]=[qn(e),qn(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},Yn=(e,t,n)=>{let r=Gn(e),i=Gn(t);return Kn(r.map((e,t)=>e+(i[t]-e)*n))},Xn=(e,t,n,r)=>{let i=e=>Math.min(...[].concat(t).map(t=>Jn(e,t))),a=e;for(let t=.05;i(a)<n&&t<=1.0001;t+=.05)a=Yn(e,r,t);return a},Zn=e=>{let[t,n,r]=Gn(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}},Qn=(e,t)=>{let n=Math.abs(e-t)%360;return n>180?360-n:n};function $n(e,t,n,r,i){let a=i?`#000000`:`#FFFFFF`,o=e=>Jn(e,n)>=Jn(e,`#FFFFFF`)?n:`#FFFFFF`,s=Jn(e,o(e))>=4.5?e:Xn(e,i?`#FFFFFF`:n,4.5,a),c=i?Hn.light:Hn.dark,l=[c.worst,...c.soft.map(e=>Yn(e,s,Un))];return{accent:s,accent2:t,ink:o(s),text:Xn(r,l,4.5,a)}}var er=39,tr={dark:[`#FF8A4C`,`#FF8A4C`],light:[`#B4441F`,`#9B3A1B`]};function nr(e,t,n){let[r,i]=n?tr.light:tr.dark,{h:a,s:o}=Zn(t),s=Qn(a,er);o>=.15&&s<=29&&Qn(a,Zn(r).h)>s?(e.style.setProperty(`--warn`,r),e.style.setProperty(`--warn-text`,i)):(e.style.removeProperty(`--warn`),e.style.removeProperty(`--warn-text`))}function rr(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),nr(e,t.accent,n)}var ir=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function ar(e,t){let n=t===`light`,r=n?Hn.light:Hn.dark,i=n?`#000000`:`#FFFFFF`,a=Xn(e,r.worst,3,i);return $n(a,Xn(a,r.worst,4.5,i),Wn,a,n)}function or(e,t,n){return!e||!ir(t)?!1:(rr(e,ar(t,n),n===`light`),!0)}function sr(e,t){let[n,r]=(0,J.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return[n,(0,J.useCallback)(t=>r(n=>{let r=typeof t==`function`?t(n):t;try{localStorage.setItem(e,r)}catch{}return r}),[e])]}var cr=`geneseed-mode`;function lr(){let[e,t]=sr(cr,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var ur=`geneseed-flavour`,dr=[{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.`}],fr=new Set(dr.map(e=>e.id)),pr={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 mr(){return sr(ur,hr)}function hr(e){return fr.has(e)?e:pr[e]||`cultivar`}var gr=1e3,_r=e=>new Promise(t=>setTimeout(t,e));async function vr(){try{return(await a.ping()).pid??null}catch{return null}}async function yr(e=0,t=null){await _r(e);for(let e=0;e<30;e++){let e=await vr();if(e!==null&&e!==t)break;await _r(gr)}window.location.reload()}async function br(){let e=await vr();try{await a.restart()}catch(e){if(e.status)throw e}await yr(gr,e)}var xr=`geneseed-accent`,Sr=[{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],Cr=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:Ln(e),tagline:`Always ${t.toLowerCase()}, whatever the voice or skin.`})),wr=[...Sr,...Cr],Tr=new Set(wr.map(e=>e.id)),Er=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return ir(t)?t.toUpperCase():null},Dr=e=>e&&(Tr.has(e)||Er(e))?e:`curated`,Or=e=>Cr.find(t=>t.id===e)?.name??null,kr=e=>{let t=Er(e);return t?`Your own colour, ${t}.`:wr.find(t=>t.id===e)?.tagline??``};function Ar(){return sr(xr,Dr)}var jr=`geneseed-layout`,Mr=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],Nr=new Set(Mr.map(e=>e.id));function Pr(e){return e&&Nr.has(e)?e:`overview`}function Fr(){return sr(jr,Pr)}function Ir(e){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null),[o,s]=(0,J.useState)([]),c=()=>a.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,J.useEffect)(()=>{c()},[]),(0,J.useEffect)(()=>{a.themes().then(e=>s(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:o,reload:c}}var Lr=600;function Rr({onFinish:e,onError:t}={}){let[n,r]=(0,J.useState)([]),[i,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1);return(0,J.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,J.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i),s=t?.action===`update`||!!t?.restarts,c=null;s&&vr().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`){yr(2e3,c);return}e?.(t.status)}}catch{if(!s)return;clearInterval(l),yr(0,c)}},Lr);return()=>clearInterval(l)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n)=>{try{let{job_id:t,restarts:i}=await a.action(e,n),s=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:s,status:`running`,output:``,started:Date.now()/1e3,restarts:!!i}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>a.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var zr=new Map,Br=new Map;function Vr(e){for(let t of zr.keys())t.startsWith(`${e}|`)&&zr.delete(t)}function Y(e,t=[],n=null,{revalidate:r=!1}={}){let i=n===null?null:`${n}|${t.join(``)}`,[a,o]=(0,J.useState)(()=>i!==null&&zr.has(i)?zr.get(i):null),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(()=>!(i!==null&&zr.has(i))),d=(0,J.useRef)(e),f=(0,J.useRef)(i);(0,J.useLayoutEffect)(()=>{d.current=e,f.current=i});let p=(0,J.useRef)(0),m=(0,J.useCallback)(()=>{let e=++p.current,t=()=>e===p.current;u(!0),c(``);let n=f.current;return Promise.resolve(d.current()).then(e=>{if(t()&&(o(e),n!==null)){zr.set(n,e);for(let t of Br.get(n)||[])t(e)}}).catch(e=>{t()&&c(e.message)}).finally(()=>{t()&&u(!1)})},t);return(0,J.useEffect)(()=>{let e=f.current;return e!==null&&(Br.has(e)||Br.set(e,new Set),Br.get(e).add(o)),e!==null&&zr.has(e)&&(p.current++,o(zr.get(e)),c(``),u(!1),!r)||m(),()=>Br.get(e)?.delete(o)},[m]),{data:a,error:s,loading:l,reload:m,setData:o}}var Hr=60,Ur=3600,Wr=86400,Gr={seconds:90,minutes:5400,hours:36*Ur};function Kr(e){let t=Math.max(0,Date.now()/1e3-e);return t<Gr.seconds?`${Math.round(t)}s`:t<Gr.minutes?`${Math.round(t/Hr)}m`:t<Gr.hours?`${Math.round(t/Ur)}h`:`${Math.round(t/Wr)}d`}function qr(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var Jr={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15},Yr={warn:Jr.deployed+Jr.doctorClean,bad:Jr.deployed};function Xr(e,t,n){if(!e)return 0;let r=e.doctor?.problems?.length??99,i=e.doctor?.ok?Jr.doctorClean:r<=Jr.doctorMinorMax?Jr.doctorMinor:Jr.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp,o=(e.deployed?Jr.deployed:0)+i+(a?Jr.versionSynced:0)+(e.diff&&e.diff.missing===0?Jr.diskClean:0);return Math.min(o,Yr[n]??1)}var Zr=e=>Math.max(...c.map(t=>e?.[t]??0),1),Qr=e=>(e?.edited??0)+(e?.added??0),$r=e=>Qr(e)+(e?.missing??0),ei=e=>(e?.laws??0)+(e?.doctrines?.rules??0),X=i(),ti={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`,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 Z({name:e,className:t=`glyph`,style:n}){return(0,X.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,X.jsx)(`path`,{d:ti[e]||``})})}function ni({className:e=`sprout`}){return(0,X.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,X.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,X.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,X.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var ri=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/kits`,page:`kits`,label:`Kits`,icon:`kit`},{hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,count:e=>e?.counts?.loops??null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],ii=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function ai({n:e,lit:t,count:n,onNavigate:r}){return(0,X.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,X.jsx)(Z,{name:e.icon}),(0,X.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,X.jsx)(`span`,{className:`sb-count`,children:n})]})}function oi({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=$r(e.diff);return(0,X.jsxs)(`div`,{className:`sb-vitals`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:`doctor`}),(0,X.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:`drift`}),(0,X.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:`built`}),(0,X.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${Kr(e.build_epoch)} ago`:`never`})]}),(0,X.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,children:[(0,X.jsx)(`span`,{children:`voice`}),(0,X.jsxs)(`b`,{children:[e.theme||`none`,(0,X.jsx)(Z,{name:`chevron`})]})]})]})}function si({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,X.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,X.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{Pn(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,X.jsx)(`span`,{className:`sb-mark`,children:(0,X.jsx)(ni,{})}),(0,X.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,X.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,X.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),ri.map(r=>(0,X.jsx)(ai,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page)),(0,X.jsx)(`div`,{className:`sb-spacer`}),ii.map(t=>(0,X.jsx)(ai,{n:t,lit:e.page===t.page,onNavigate:i},t.page)),t?(0,X.jsx)(`button`,{type:`button`,className:`sb-voice-rail`,"aria-label":`Switch voice, now ${t.theme||`none`}`,title:`Switch voice`,onClick:r,children:(0,X.jsx)(Z,{name:`spark`})}):null,(0,X.jsx)(oi,{overview:t,onOpenVoice:r})]})}var ci=[`overview`,`laws`,`library`,`installs`];function li({route:e,navOpen:t,onMore:n}){return(0,X.jsxs)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:[ri.filter(e=>ci.includes(e.page)).map(t=>(0,X.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,X.jsx)(Z,{name:t.icon}),t.label]},t.page)),(0,X.jsxs)(`button`,{type:`button`,className:`tab-more${ci.includes(e.page)?``:` on`}`,"aria-controls":`rail-nav`,"aria-expanded":!!t,onClick:n,children:[(0,X.jsx)(Z,{name:`menu`}),`More`]})]})}var ui=[{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`}],di=e=>ui.find(t=>t.id===e)||ui[0],fi=(e,t)=>t===`project`?di(e).removeProject:di(e).removeGlobal,pi=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,mi=e=>e.scope===`global`?di(e.host).label:pi(e.path),hi=`geneseed-harness`,gi=ui.map(({id:e,label:t})=>({id:e,label:t}));function _i(e=`opencode`){let[t,n]=sr(hi,e=>gi.some(t=>t.id===e)?e:null);return[t??e,n]}function vi(e){let t=String(e||``);return ui.find(e=>t.startsWith(e.id))?.id||`opencode`}var yi=Object.entries(wn).flatMap(([e,t])=>(Tn[e]||[``]).map(n=>{let r=n?t+` / `+En[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}}));function bi(e=0){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(``),o=(0,J.useRef)(null),[l]=_i(),u=`${e}|${l}`,[d,f]=(0,J.useState)(u);return d!==u&&(f(u),n(null)),(0,J.useEffect)(()=>{o.current=null},[u]),{index:t,error:r,prime:(0,J.useCallback)(()=>{if(t||o.current)return o.current;let e=(async()=>{let e=[],t=[`laws`,`skills`,...c],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=s[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(l);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,l])}}function xi({open:e,title:t,children:n,confirmLabel:r,tone:i,onConfirm:a,onClose:o}){let s=(0,J.useRef)(null),c=(0,J.useRef)(null),l=(0,J.useRef)(null),u=(0,J.useId)(),d=i===`danger`;return(0,J.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,X.jsxs)(`dialog`,{ref:s,className:`confirm`,"aria-labelledby":`${u}-title`,"aria-describedby":`${u}-body`,onCancel:o,onClose:o,children:[(0,X.jsx)(`h3`,{className:`confirm-title`,id:`${u}-title`,children:t}),(0,X.jsx)(`div`,{className:`confirm-body`,id:`${u}-body`,children:n}),(0,X.jsxs)(`div`,{className:`confirm-actions`,children:[(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,ref:c,children:`Cancel`}),(0,X.jsx)(`button`,{type:`button`,className:d?`btn danger`:`btn`,onClick:a,ref:l,children:r||`Confirm`})]})]})}var Si=(0,J.createContext)(null),Ci=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function wi(){return(0,J.useContext)(Si)||Ci}function Ti({children:e}){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,J.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,X.jsxs)(Si.Provider,{value:a,children:[e,(0,X.jsx)(xi,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,tone:t?.tone,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}var Ei=24;function Di(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function Oi(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=Di(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,Ei);return i.filter(e=>e.sortKey<0).concat(a)}function ki(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,X.jsxs)(X.Fragment,{children:[e.slice(0,r),(0,X.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function Ai({query:e,index:t,loading:n,error:r,active:i,onActive:a,onPick:o}){let s=(0,J.useMemo)(()=>Oi(t,e),[t,e]),c=(0,J.useRef)(null),l=s.length>0;(0,J.useLayoutEffect)(()=>{let e=c.current?.querySelectorAll(`[data-spot-row]`);return!l||!e?.length||!vn()?void 0:yn(sn(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:hn(18),ease:`outQuart`}),220+18*e.length)},[l]),(0,J.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,J.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,X.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[u.map(t=>(0,X.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,X.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,X.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,X.jsx)(`div`,{className:`spot-title`,children:ki(t.title,e)}),t.desc?(0,X.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route||t.title}-${n}`))]},`${t.kind}-${t.rows[0].index}`)),f&&r&&(0,X.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),f&&n&&!r&&(0,X.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),f&&!n&&!r&&s.length===0&&(0,X.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]})]})}function ji({actions:e=[],dataRev:t}){let n=(0,J.useRef)(null),r=(0,J.useRef)(null),i=(0,J.useRef)(null),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(``),[l,u]=(0,J.useState)(0),{index:d,error:f,prime:p}=bi(t),m=wi(),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,J.useEffect)(()=>{let e=n.current;a&&e&&!e.open&&(typeof e.showModal==`function`?e.showModal():e.setAttribute(`open`,``),r.current?.focus())},[a]),(0,J.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,J.useMemo)(()=>[...e.map(e=>({sortKey:-2,...e})),...yi,...d||[]],[e,d]),v=a?Oi(_,s):[],y=l<v.length?`spot-opt-${l}`:void 0,b=async e=>{if(g(),!e.run)return Pn(e.route);let t=e.confirm;(!t||await m(t.msg,{title:t.title,confirmLabel:t.confirmLabel,tone:t.tone}))&&e.run()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.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,X.jsx)(Z,{name:`search`,className:`mag glyph`}),(0,X.jsx)(`span`,{className:`tb-cmdk-label`,children:`Search or run…`}),(0,X.jsx)(`kbd`,{className:`tb-cmdk-key`,children:`Ctrl K`})]}),(0,X.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,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`palette-head`,children:[(0,X.jsx)(Z,{name:`search`,className:`mag glyph`}),(0,X.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,X.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]}),(0,X.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v.length?`${v.length} results`:`no matches`}),(0,X.jsx)(Ai,{query:s,index:_,loading:!d,error:d?``:f,active:l,onActive:u,onPick:b}),(0,X.jsxs)(`div`,{className:`palette-foot`,children:[(0,X.jsx)(`span`,{children:`↑↓ move`}),(0,X.jsx)(`span`,{children:`↵ open`}),(0,X.jsx)(`span`,{children:`actions that write always ask first`})]})]})})]})}function Mi({installs:e,onSwitch:t}){let n=(e||[]).filter(e=>e.state===`active`);if(n.length<2)return null;let r=n.find(e=>e.selected)||n[0];return(0,X.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:r.id,onChange:async e=>{let r=n.find(t=>t.id===e.target.value);if(r)try{await a.selectView(r.host,r.path),t?.()}catch{}},children:n.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.scope===`global`?`${e.host} · global`:`${mi(e)} · ${e.host}`},e.id))})}var Ni=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function Pi({open:e,onClose:t,anchorRef:n,label:r,className:i,children:a}){let o=(0,J.useRef)(null);return(0,J.useEffect)(()=>{if(!e)return;let r=o.current,i=n?.current;(r.querySelector(Ni)||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,X.jsx)(`div`,{ref:o,className:i?`popover ${i}`:`popover`,role:`dialog`,"aria-label":r,tabIndex:-1,children:a}):null}function Fi({children:e,...t}){let n=Sn(`button.on`);return(0,X.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,X.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function Ii({value:e,onChange:t,labelledBy:n}){let r=Er(e);return(0,X.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[Sr.map(n=>(0,X.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,X.jsxs)(`div`,{className:`accent-swatches`,children:[Cr.map(n=>(0,X.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,X.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,X.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function Li({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o,anchorRef:s}){let c=(e,t,n,r,i)=>(0,X.jsxs)(`div`,{className:`ap-group`,children:[(0,X.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,X.jsx)(Fi,{"aria-labelledby":e,children:n.map(e=>(0,X.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,gn.createPortal)((0,X.jsxs)(Pi,{open:!0,onClose:o,anchorRef:s,label:`Appearance`,className:`appearance-pop`,children:[c(`ap-skin`,`Skin`,dr,e,t),(0,X.jsxs)(`div`,{className:`ap-group`,children:[(0,X.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,X.jsx)(Ii,{value:n,onChange:r,labelledBy:`ap-accent`})]}),c(`ap-view`,`Overview view`,Mr,i,a)]}),document.querySelector(`.app`)||document.body)}function Ri({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,actions:a,mode:o,onToggleMode:s,appearance:c,dataRev:l,onSwitch:u}){let[d,f]=(0,J.useState)(!1),p=(0,J.useRef)(null),m=r?.install,h=m?`${m.host}:${m.scope}`:qr(r?.target),g=e.tab&&En[e.tab];return(0,X.jsxs)(`header`,{className:`topbar`,children:[(0,X.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,X.jsx)(Z,{name:t?`x`:`menu`})}),(0,X.jsx)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:(0,X.jsxs)(`ol`,{children:[(0,X.jsx)(`li`,{className:`crumb-root mono`,children:(0,X.jsx)(`a`,{href:`#/installs`,title:r?.target||void 0,children:h})}),(0,X.jsx)(`li`,{children:g?(0,X.jsx)(`a`,{href:e.page===`overview`?`#/`:`#/${e.page}`,children:wn[e.page]}):(0,X.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:wn[e.page]})}),g?(0,X.jsx)(`li`,{children:(0,X.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:g})}):null]})}),(0,X.jsx)(`div`,{className:`topbar-spacer`}),(0,X.jsx)(Mi,{installs:i,onSwitch:u}),(0,X.jsx)(ji,{actions:a,dataRev:l}),(0,X.jsx)(`button`,{type:`button`,className:`iconbtn`,ref:p,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":d,onClick:()=>f(e=>!e),children:(0,X.jsx)(Z,{name:`themes`})}),d?(0,X.jsx)(Li,{...c,anchorRef:p,onClose:()=>f(!1)}):null,(0,X.jsx)(`button`,{type:`button`,className:`iconbtn`,title:o===`light`?`Switch to dark`:`Switch to light`,"aria-label":o===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:s,children:(0,X.jsx)(Z,{name:o===`light`?`moon`:`sun`})})]})}function zi({themes:e,current:t,onPick:n,onClose:r}){let i=wi(),a=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let e=e=>{a.current&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,J.useEffect)(()=>{a.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,X.jsxs)(`div`,{className:`pop`,ref:a,role:`dialog`,"aria-label":`Switch voice`,children:[(0,X.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,X.jsxs)(`button`,{type:`button`,"aria-pressed":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:async()=>{r(),await i(`Rebuild the deployed harness in the “${e.name}” voice? It rebuilds in place, non-destructive.`,{title:`Switch voice?`,confirmLabel:`Rebuild`})&&n(e.name)},children:[(0,X.jsx)(`span`,{className:`po`,style:{background:Ln(e.accent),boxShadow:`0 0 8px ${Ln(e.accent)}`}}),(0,X.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var Bi=3500;function Vi({toast:e,onClose:t}){let[n,r]=(0,J.useState)(null),i=!!e&&e.kind!==`err`&&n!==e;(0,J.useEffect)(()=>{if(!i)return;let e=setTimeout(t,Bi);return()=>clearTimeout(e)},[e,i]);let a=()=>r(e),o=()=>r(null);return(0,X.jsx)(`div`,{className:`toast-region`,"aria-live":e?.kind===`err`?void 0:`polite`,children:e&&(0,X.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,X.jsx)(`div`,{children:e.msg}),(0,X.jsx)(`div`,{style:{marginTop:8},children:(0,X.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})})}function Hi({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,J.useRef)(null),c=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=c.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let l=e.length?e[e.length-1].output.length:0;return(0,J.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,l,t]),(0,X.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,X.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,X.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,X.jsxs)(`span`,{className:`ttl`,children:[(0,X.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,X.jsx)(`span`,{className:`count`,children:e.length}),(0,X.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,X.jsx)(Z,{name:`clear`})}),(0,X.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,X.jsx)(Z,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,X.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,X.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,X.jsxs)(`div`,{className:`run`,children:[(0,X.jsxs)(`div`,{className:`run-head`,children:[(0,X.jsx)(`span`,{className:`pr`,children:`$`}),(0,X.jsx)(`span`,{className:`act`,children:e.action}),(0,X.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,X.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,X.jsx)(Z,{name:`x`})})]}),e.output&&(0,X.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Ui=550,Wi=`gs-splash-seen`;function Gi(){try{if(window.localStorage.getItem(Wi))return 0;window.localStorage.setItem(Wi,`1`)}catch{}return Ui}function Ki({ready:e,onDone:t}){let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{let e=setTimeout(()=>r(!0),Gi());return()=>clearTimeout(e)},[]),e&&n&&!i&&a(!0),(0,J.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,X.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,X.jsxs)(`div`,{className:`boot-dial`,children:[(0,X.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,X.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,X.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,X.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,X.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,X.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,X.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,X.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,X.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,X.jsxs)(`div`,{className:`boot-status`,children:[(0,X.jsx)(`span`,{children:`germinating harness`}),(0,X.jsx)(`span`,{className:`boot-caret`})]})]})}function qi({label:e=`Loading…`}){return(0,X.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,X.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,X.jsx)(`div`,{className:`skel-bar`}),(0,X.jsx)(`div`,{className:`skel-bar`}),(0,X.jsx)(`div`,{className:`skel-bar`})]})]})}function Ji({error:e,style:t,onRetry:n,role:r=`alert`}){return e?n?(0,X.jsxs)(`div`,{className:`error-state`,role:r,style:t,children:[(0,X.jsx)(`p`,{className:`badge bad`,children:e}),(0,X.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:n,children:`Retry`})]}):(0,X.jsx)(`p`,{className:`badge bad`,role:r,style:t,children:e}):null}function Yi(){let[e,t]=(0,J.useState)(!1),[n,r]=(0,J.useState)(null);return(0,X.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,X.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,X.jsx)(`button`,{className:`btn sm`,onClick:async()=>{t(!0),r(null);try{await br()}catch(e){r(e.message),t(!1)}},disabled:e,children:e?`Restarting…`:`Restart`})]})}var Xi=/dynamically imported module|Importing a module script failed|Unable to preload CSS/i,Zi=e=>Xi.test(e?.message||``),Qi=class extends J.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=Zi(e);return(0,X.jsxs)(`div`,{role:t?void 0:`alert`,children:[(0,X.jsx)(Ji,{error:e.message||String(e),role:null}),t?(0,X.jsx)(Yi,{}):(0,X.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]})}},$i=(0,J.createContext)(null),ea=e=>[...e].sort().join(`,`),ta=e=>[...e.values()].some(e=>!e.applied&&ea(e.value)!==e.base);function na(e,t){let[n,r]=(0,J.useState)(()=>({kits:new Map,rules:new Map})),[i,a]=(0,J.useState)(null),[o,s]=(0,J.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=ta(n.kits)||ta(n.rules);return(0,J.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 ea(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,J.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}}function ra({activeId:e,finish:t,children:n}){let r=na(e,t);return(0,X.jsx)($i.Provider,{value:r,children:n})}function ia(){let e=na(null,null);return(0,J.useContext)($i)||e}function aa({eyebrow:e,title:t,sub:n,primary:r,actions:i,crumbs:a}){return(0,X.jsxs)(`div`,{className:`page-head`,children:[(0,X.jsxs)(`div`,{children:[a?.length?(0,X.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`page-crumbs`,children:(0,X.jsx)(`ol`,{children:a.map((e,t)=>(0,X.jsx)(`li`,{children:t===a.length-1?(0,X.jsx)(`span`,{"aria-current":`page`,children:e.label}):e.href?(0,X.jsx)(`a`,{href:e.href,children:e.label}):e.label},t))})}):null,e?(0,X.jsx)(`div`,{className:`eyebrow`,children:e}):null,(0,X.jsx)(`h1`,{className:`h`,children:t}),n?(0,X.jsx)(`p`,{className:`sub`,children:n}):null]}),r||i?(0,X.jsxs)(`div`,{className:`page-actions`,children:[i,r]}):null]})}var oa=e=>!!e&&!e.endsWith(`-global`);function sa({onAction:e}){let{data:t,error:n}=Y(()=>a.themes(),[]),[r,i]=(0,J.useState)(``),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(``),[u,d]=(0,J.useState)(``),[f,p]=(0,J.useState)(!1);if(n)return(0,X.jsx)(Ji,{error:n});if(!t)return(0,X.jsx)(qi,{});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=oa(_);return(0,X.jsxs)(`div`,{className:`narrow-lg`,children:[(0,X.jsx)(`div`,{className:`head-row mb-18`,children:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,X.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,X.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,X.jsx)(`div`,{className:`card-head`,children:(0,X.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,X.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,X.jsxs)(`button`,{className:`btn ${e.name===m?`soft`:`ghost`}`,onClick:()=>v(e.name),title:e.blurb||e.tagline||e.name,children:[(0,X.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:Ln(e.accent),boxShadow:`0 0 8px ${Ln(e.accent)}`}}),(0,X.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,X.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,X.jsx)(`div`,{className:`card-head`,children:(0,X.jsx)(`h3`,{children:`2 · Install mode`})}),(0,X.jsxs)(`p`,{className:`sub mb-16`,children:[`A `,(0,X.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,X.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,X.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,X.jsx)(`select`,{className:`sel`,value:_,onChange:e=>y(e.target.value),children:h.map(e=>(0,X.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]}),b&&(0,X.jsxs)(`div`,{className:`row gap-10`,style:{maxWidth:560,marginTop:12},children:[(0,X.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,X.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,X.jsx)(`p`,{className:`sub`,style:{marginTop:12},children:u})]}),(0,X.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,X.jsx)(Z,{name:`build`}),`Deploy harness`]})]})}var ca=e=>Y(()=>a.rules().catch(()=>null),[e],`rules`,{revalidate:!0}),la=()=>Vr(`rules`),Q={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)`},ua={security:{label:`Security`,c:Q.security},verify:{label:`Verification`,c:Q.verify},process:{label:`Process`,c:Q.process},craft:{label:`Craft`,c:Q.craft},context:{label:`Context`,c:Q.context},comms:{label:`Communication`,c:Q.comms}},da={craft:Q.craft,rigor:Q.verify,ops:Q.process,process:Q.security,comms:Q.comms},fa=e=>da[e]||`var(--text-3)`,pa={design:{label:`Design`,c:Q.context},build:{label:`Build`,c:Q.craft},review:{label:`Review`,c:Q.security},ship:{label:`Ship`,c:Q.process},understand:{label:`Understand`,c:Q.verify},learn:{label:`Learn`,c:Q.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Personal`,c:`oklch(0.72 0.025 250)`}},ma=Object.keys(pa);function ha(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 ga=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],_a=e=>{let t=``;for(let[n,r]of ga)for(;e>=n;)t+=r,e-=n;return t};function va(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?_a(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var ya=new Set([`I`,`III`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),ba={I:{key:`secretsGate`,label:`Secrets gate`},III:{key:`doneGate`,label:`Done gate`},IV:{key:`deletionGate`,label:`Deletion gate`}},xa={I:{arm:`Writes that would carry a credential-shaped string are refused again.`,off:`A write carrying a credential-shaped string (on OpenCode, also a write to a key file) stops being refused. Rule I’s text still binds the agent; protected checks, real data loss and commit/push consent stay gated.`},III:{arm:`A turn that edited files cannot end before the project’s declared checks pass.`,off:`A turn that edited files may end without the checks in .geneseed/done-checks.txt passing. Rule III’s text still binds the agent; every other gate stays.`},IV:{arm:`Commands that would lose data nothing else holds ask again.`,off:`Commands that would really lose data — discarding uncommitted work, deleting an unpushed branch, removing untracked files — stop asking. Rule IV’s text still binds the agent; secrets, root-wide scans and commit/push consent stay gated.`}},Sa=[{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`}],Ca=(e,t={})=>ba[e]&&t?.[ba[e].key]===!1?`Gate off`:ya.has(e)?`Hook gate`:`Instruction`;function wa(e){let t={};for(let n of e||[]){let e=pa[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:pa[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=ma.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 $=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function Ta({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 ${$(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=$r(l);u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${$(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=va(e),i=(o?.items||[]).find(e=>e.name===r),a=i?ha(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${$(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=wa(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${$(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`library/memory`,verb:`Open`,href:`#/section/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}var Ea=e=>$r(e.drift),Da=e=>e.drift?.stale??0;function Oa(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 ka(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+Ea(t),0),o=n.reduce((e,t)=>e+Da(t),0),s=e?.doctor,c=s&&!s.ok?`bad`:i||a||o?`warn`:`good`,l={good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[c],u=[$(n.length,`active install`)+(r?`, ${r} disabled`:``),s?s.ok?`doctor clean`:`doctor found ${$(s.problems.length,`problem`)}`:`doctor not run yet`,i?`${$(i,`install`)} behind source`:`all in step with source`,a?`${$(a,`file`)} hand-edited`:`no hand edits`];return o&&u.push(`${$(o,`file`)} behind source`),{tone:c,head:l,facts:u}}var Aa=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],ja=e=>e?e.carrier+e.skills+e.agents+e.context:0,Ma=e=>e.state===`active`&&(e.verdict===`behind`||$r(e.drift)>0||(e.drift?.stale??0)>0),Na=e=>`≈${(e/4/1e3).toFixed(1)}k`,Pa=e=>`${e.host} · ${e.scope}`,Fa=e=>({id:e.id,host:e.host,path:e.path,label:Pa(e)});function Ia({fleet:e,usage:t,...n}){let r=[],i=e?.doctor;i&&!i.ok&&r.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${$(i.problems.length,`problem`)}`,detail:i.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});for(let t of(e?.installs||[]).filter(e=>e.state===`active`)){if(t.verdict===`behind`){let e=t.built_epoch?`built ${Kr(t.built_epoch)} ago`:`never built`,n=Da(t);r.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${Pa(t)} is behind its source`,detail:n?`${e} · ${$(n,`file`)} behind`:e,where:t.host,verb:`Rebuild`,act:`rebuild`,installs:[Fa(t)]})}let e=Ea(t);e&&r.push({id:`drift:${t.id}`,tag:`Drift`,tone:`warn`,title:`${Pa(t)}: ${$(e,`file`)} edited by hand`,detail:`${t.drift.edited} edited, ${t.drift.added} added, ${t.drift.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`})}if(t&&t.days_counted>=30&&t.never?.length){let{skills:e,agents:n}=Oa(t);r.push({id:`usage`,tag:`Usage`,tone:``,sugg:!0,title:`${$(e,`skill`)} never fired in 30 days`,detail:`${$(n,`agent`)} too`,where:`library/skills`,verb:`Triage`,href:`#/skills`})}let a=Ta({...n,overview:n.overview&&{...n.overview,doctor:null,diff:null}});for(let e of a)r.push({...e,sugg:!0});return r}function La(e,t){return(e?.rules||[]).map(e=>{let n=va(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?ha(r.title).name:e.rule===`wiki`?`Wiki guard`:n}})}var Ra=e=>e.catch(()=>null),za=(e,t)=>`${t?Math.min(100,e/t*100):0}%`,Ba=36e5;function Va({update:e,onAction:t,canFill:n=!0}){if(!e)return null;let r=e.install??(e.git?`git`:`npm-global`),i=r===`git`&&typeof e.behind==`number`?e.behind:null,a=i===null?e.latest===null?(0,X.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · update check unavailable`]}):e.available?(0,X.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,X.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}):(0,X.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):i>0?(0,X.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current??``,` `,(0,X.jsxs)(`span`,{className:`ver-new`,children:[i,` commit`,i===1?``:`s`,` to pull`]})]}):(0,X.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · up to date`]});if(r===`other`)return!e.available||!e.command?a:(0,X.jsxs)(X.Fragment,{children:[a,(0,X.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,X.jsx)(`code`,{className:`mono`,children:e.command})]})]});if(r!==`git`&&!e.available)return a;let o=i===null?!!e.available:i>0;return(0,X.jsxs)(X.Fragment,{children:[a,(0,X.jsx)(`button`,{type:`button`,className:o&&n?`btn`:`btn ghost`,title:r===`git`?i===0?`Nothing to pull: up to date with upstream. Pulls and rebuilds every install anyway.`:`git pull, then rebuild every install`:`npm install -g geneseed@latest, then rebuild every install`,onClick:()=>t(`update`),children:`Update`})]})}function Ha({fleet:e,error:t}){if(!e)return t?(0,X.jsxs)(`div`,{className:`health`,role:`status`,children:[(0,X.jsx)(`span`,{className:`health-dot`,"aria-hidden":`true`}),(0,X.jsx)(`p`,{className:`verdict-facts`,children:(0,X.jsx)(`b`,{children:`Status unknown`})})]}):(0,X.jsx)(`div`,{className:`health`,"aria-busy":`true`});let n=ka(e);return(0,X.jsxs)(`div`,{className:`health ${n.tone}`,role:`status`,children:[(0,X.jsx)(`span`,{className:`health-dot`,"aria-hidden":`true`}),(0,X.jsxs)(`p`,{className:`verdict-facts`,children:[(0,X.jsx)(`b`,{children:n.head}),n.facts.map(e=>(0,X.jsx)(`span`,{className:`muted`,children:e},e))]})]})}function Ua({chars:e}){let t=bn(e);return(0,X.jsxs)(`span`,{className:`mono`,children:[Na(t??e),` tok`]})}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,X.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,X.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,X.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 Ga({i:e,n:t,onRebuild:n,onOpen:r,busy:i}){let a=`${e.host} · ${e.scope}`,o=(0,X.jsxs)(`td`,{className:`ldg-where`,children:[i?(0,X.jsx)(`span`,{className:`console-progress`,role:`progressbar`,"aria-label":`Rebuilding ${a}`}):null,(0,X.jsx)(`span`,{className:`ldg-host`,children:e.host}),` `,(0,X.jsx)(`span`,{className:`dim`,children:e.scope}),(0,X.jsx)(`div`,{className:`mono dim ldg-path`,children:e.path})]});if(e.state!==`active`)return(0,X.jsxs)(`tr`,{className:`ldg-off`,children:[o,(0,X.jsxs)(`td`,{children:[e.theme,` `,(0,X.jsxs)(`span`,{className:`dim`,children:[`· `,e.footprint]})]}),(0,X.jsx)(`td`,{children:(0,X.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{className:`ldg-act`,children:(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${a}`,onClick:()=>r(e),children:`Open`})})]});let s=$r(e.drift),c=e.drift?.stale??0,l={synced:(0,X.jsx)(`span`,{className:`pill good`,children:`in step`}),behind:(0,X.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,X.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],u=ja(e.cost),d=e.cost?.ceiling?Math.round(e.cost.carrier/e.cost.ceiling*100):null,f=d===null?`no ceiling`:`root file ${d}% of ceiling`;return(0,X.jsxs)(`tr`,{children:[o,(0,X.jsxs)(`td`,{children:[e.theme,` `,(0,X.jsxs)(`span`,{className:`dim`,children:[`· `,e.footprint]})]}),(0,X.jsxs)(`td`,{children:[l,c?(0,X.jsxs)(`div`,{className:`mono dim ldg-sub`,children:[c,` file`,c===1?``:`s`,` behind`]}):null]}),(0,X.jsx)(`td`,{children:e.diffable?s?(0,X.jsxs)(`span`,{className:`mono t-warn`,children:[s,` edited`]}):e.drift?.linked?(0,X.jsxs)(`span`,{className:`mono dim`,title:`Yours: links Geneseed leaves alone`,children:[e.drift.linked,` linked`]}):(0,X.jsx)(`span`,{className:`mono dim`,children:`none`}):(0,X.jsx)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:`not checkable`})}),(0,X.jsx)(`td`,{children:e.cost?(0,X.jsxs)(`div`,{className:`ldg-cost`,title:d===null?`no ceiling`:`root file ${d}% of the ${e.footprint} ceiling`,children:[(0,X.jsx)(Wa,{cost:e.cost,i:t}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(Ua,{chars:u}),(0,X.jsx)(`span`,{className:`dim ldg-sub`,children:f})]})]}):(0,X.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,X.jsx)(`td`,{className:`mono dim`,children:e.built_epoch?`${Kr(e.built_epoch)} ago`:`never`}),(0,X.jsx)(`td`,{className:`ldg-act`,children:Ma(e)?(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Rebuild ${a}`,title:`Rebuilds ${a} only`,onClick:()=>n([Fa(e)]),children:`Rebuild`}):(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${a}`,onClick:()=>r(e),children:`Open`})})]})}function Ka({rows:e,onAction:t,onRebuild:n}){let r=e.filter(e=>!e.sugg).length;return(0,X.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,X.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,X.jsx)(`h2`,{id:`ldg-needs`,children:`Needs attention`}),(0,X.jsxs)(`span`,{className:`mono dim`,children:[r,` problem`,r===1?``:`s`,`, `,e.length-r,` suggestion`,e.length-r===1?``:`s`]})]}),e.length?(0,X.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,X.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,X.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,X.jsxs)(`span`,{className:`needs-what`,children:[(0,X.jsx)(`b`,{children:e.title}),e.detail?(0,X.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,X.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),e.act?(0,X.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,"aria-label":`${e.verb}: ${e.title}`,onClick:()=>e.installs?n(e.installs):t(e.act),children:e.verb}):(0,X.jsx)(`a`,{className:`needs-verb`,href:e.href,"aria-label":`${e.verb}: ${e.title}`,children:e.verb})]},e.id))}):(0,X.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function qa({installs:e}){let t=e.filter(e=>e.state===`active`&&e.cost),n=Math.max(1,...t.map(e=>Math.max(ja(e.cost),e.cost.ceiling||0)));return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-cost`,children:[(0,X.jsxs)(`div`,{className:`panel-head`,children:[(0,X.jsx)(`h2`,{id:`ldg-cost`,children:`Always-on cost`}),(0,X.jsx)(`span`,{className:`mono dim`,children:`≈ tokens per session`})]}),t.length?t.map((e,t)=>(0,X.jsxs)(`div`,{className:`cost-row`,children:[(0,X.jsxs)(`div`,{className:`cost-lab`,children:[(0,X.jsxs)(`span`,{children:[e.host,` `,(0,X.jsx)(`span`,{className:`dim`,children:e.scope})]}),(0,X.jsx)(`span`,{className:`mono`,children:Na(ja(e.cost))})]}),(0,X.jsx)(`div`,{className:`cost-stack`,children:(0,X.jsx)(`span`,{className:`cost-segs`,style:{"--i":t},children:Aa.map(([t])=>(0,X.jsx)(`span`,{className:`cs-${t}`,style:{width:za(e.cost[t],n)}},t))})}),e.cost.ceiling?(0,X.jsxs)(`div`,{className:`cost-stack cost-lane`,title:`root file ${Math.round(e.cost.carrier/e.cost.ceiling*100)}% of ceiling`,children:[(0,X.jsx)(`span`,{className:`cost-segs`,style:{"--i":t},children:(0,X.jsx)(`span`,{className:`cs-carrier`,style:{width:za(e.cost.carrier,n)}})}),(0,X.jsx)(`span`,{className:`cost-ceil`,style:{left:za(e.cost.ceiling,n)}})]}):null]},e.id)):(0,X.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`}),(0,X.jsxs)(`div`,{className:`cost-key`,children:[Aa.map(([e,t])=>(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`i`,{className:`cs-${e}`}),t]},e)),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`i`,{className:`cost-ceil-key`}),`root file ceiling`]})]}),(0,X.jsx)(`p`,{className:`dim chart-foot`,children:`Estimated as characters ÷ 4 from the emitted files.`})]})}function Ja({usage:e}){let t=(0,X.jsxs)(`div`,{className:`panel-head`,children:[(0,X.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,X.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})]});if(!e.enabled)return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsx)(`p`,{className:`muted`,children:e.since?(0,X.jsxs)(X.Fragment,{children:[`Counting since `,(0,X.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,X.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,X.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,X.jsx)(`p`,{className:`dim chart-foot`,children:`Rankings and the never-fired count appear once 30 days are counted, so a new install is not told every skill is unused.`})]});let n=e.rows.slice(0,7),r=Math.max(1,...n.map(e=>e.n)),i=Math.max(1,...e.per_day),a=e.per_day.reduce((e,t)=>e+t,0);return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsxs)(`div`,{className:`cols30-wrap`,children:[(0,X.jsxs)(`div`,{className:`chart-axis mono dim`,children:[(0,X.jsx)(`span`,{children:`calls per day`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(xn,{value:a}),` in 30 d`]})]}),(0,X.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,X.jsx)(`i`,{className:t===29?`today`:``,style:{height:za(e,i),"--i":t}},t))})]}),(0,X.jsx)(`ul`,{className:`ubars`,children:n.map((e,t)=>(0,X.jsxs)(`li`,{className:e.kind,children:[(0,X.jsx)(`span`,{className:`ub-name`,children:e.name}),(0,X.jsx)(`span`,{className:`ub-trk`,children:(0,X.jsx)(`i`,{style:{width:za(e.n,r),"--i":t}})}),(0,X.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,X.jsxs)(`div`,{className:`ub-never`,children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`b`,{children:Oa(e).skills}),` skills never fired`]}),(0,X.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function Ya({vals:e,i:t}){let n=Math.max(1,...e),r=96/(e.length-1),i=e.map((e,t)=>`${(t*r).toFixed(1)},${(20-e/n*17).toFixed(1)}`),[a,o]=i[i.length-1].split(`,`);return(0,X.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,"aria-hidden":`true`,style:{"--i":t},children:[(0,X.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,X.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${i.join(` `)} 96,21`}),(0,X.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:i.join(` `)}),(0,X.jsx)(`circle`,{className:`spk-end`,cx:a,cy:o,r:`2.4`})]})}function Xa({gates:e,laws:t}){let n=La(e,t);return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-gates`,children:[(0,X.jsxs)(`div`,{className:`panel-head`,children:[(0,X.jsx)(`h2`,{id:`ldg-gates`,children:`Gates`}),(0,X.jsx)(`span`,{className:`mono dim`,children:`asks per rule, 30 d`})]}),n.length?(0,X.jsx)(`ul`,{className:`gate-rows`,children:n.slice(0,6).map((e,t)=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(Ya,{vals:e.per_day,i:t}),(0,X.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,X.jsx)(`p`,{className:`dim`,children:e?`No gate asked in 30 days.`:`Gate activity could not be read.`})]})}function Za({overview:e,setup:t,runs:n,onAction:r,onRetry:i,dataRev:o,banner:s,view:c}){let l=wi(),[u,d]=(0,J.useState)({}),{data:f,error:p,reload:m}=Y(()=>a.fleet(),[o]),{data:h}=Y(()=>Ra(a.usage()),[o]),{data:g}=Y(()=>Ra(a.gates()),[o]),_=(0,J.useRef)(null),{data:v,reload:y}=Y(()=>Ra(a.update()).then(e=>(e&&(_.current=e),_.current)),[o]);(0,J.useEffect)(()=>{let e=setInterval(y,Ba),t=()=>{document.visibilityState===`visible`&&y()};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[y]);let{data:b}=ca(o),{data:x}=Y(()=>Ra(a.activity()),[o]),{data:S}=Y(()=>Ra(a.profile()),[o]),{data:C}=Y(()=>Ra(a.catalog(`skills`)),[o],`catalog:skills`),{data:w}=Y(()=>Ra(a.catalog(`laws`)),[o],`catalog:laws`),T=f?.installs||[],E=async e=>{try{await a.selectView(e.host,e.path)}catch{}i?.(),window.location.hash=`#/installs`},D=Ia({fleet:f,usage:h,overview:e,setup:t,rules:b,activity:x,profile:S,skills:C,laws:w}),O=T.filter(Ma).map(Fa),k=async e=>{let t=e.map(e=>e.label);if(!await l(`Rebuild ${t.join(`, `)}? Each is re-rendered from source with its own settings.`,{title:e.length===1?`Rebuild ${t[0]}?`:`Rebuild ${e.length} installs?`,confirmLabel:`Rebuild`}))return;let n=await r(`rebuild`,{installs:e.map(({host:e,path:t})=>({host:e,path:t}))});n&&d(t=>({...t,[n]:e.map(e=>e.id)}))},A=new Set(Object.entries(u).filter(([e])=>n?.find(t=>t.id===e)?.status===`running`).flatMap(([,e])=>e));return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(aa,{title:`Overview`,sub:(0,X.jsx)(`span`,{className:`mono`,children:f?`${T.length} installed · machine-wide`:` `}),primary:O.length?(0,X.jsxs)(`button`,{type:`button`,className:`btn`,title:`Rebuilds ${O.map(e=>e.label).join(`, `)}`,onClick:()=>k(O),children:[`Rebuild all behind (`,O.length,`)`]}):null,actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Va,{update:v,onAction:r,canFill:!O.length}),(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>r(`doctor`),children:`Run doctor`}),c]})}),s,(0,X.jsxs)(`div`,{className:`ov-stack ldg`,children:[(0,X.jsx)(Ha,{fleet:f,error:p}),(0,X.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,X.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,X.jsx)(`h2`,{id:`ldg-fleet`,children:`Installs`}),f?.source_fp?(0,X.jsxs)(`span`,{className:`mono dim`,children:[`source `,f.source_fp]}):null]}),p&&f?(0,X.jsxs)(`p`,{className:`dim`,role:`status`,children:[`Could not refresh the installs — showing the last read.`,` `,(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]}):null,(0,X.jsx)(`div`,{className:`ldg-scroll`,children:(0,X.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,X.jsx)(`caption`,{className:`sr-only`,children:`Installs`}),(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{scope:`col`,children:`Install`}),(0,X.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,X.jsx)(`th`,{scope:`col`,children:`Sync`}),(0,X.jsx)(`th`,{scope:`col`,children:`Hand edits`}),(0,X.jsx)(`th`,{scope:`col`,children:`Always-on`}),(0,X.jsx)(`th`,{scope:`col`,children:`Built`}),(0,X.jsx)(`th`,{scope:`col`,children:(0,X.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,X.jsxs)(`tbody`,{children:[p&&!f?(0,X.jsx)(`tr`,{children:(0,X.jsxs)(`td`,{colSpan:7,children:[(0,X.jsx)(`span`,{className:`dim`,role:`status`,children:`Could not read the installs`}),` `,(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]})}):null,T.map((e,t)=>(0,X.jsx)(Ga,{i:e,n:t,onRebuild:k,onOpen:E,busy:A.has(e.id)},e.id))]})]})})]}),(0,X.jsx)(Ka,{rows:D,onAction:r,onRebuild:k}),(0,X.jsxs)(`div`,{className:`ov-charts`,children:[(0,X.jsx)(qa,{installs:T}),(0,X.jsx)(Ja,{usage:h}),(0,X.jsx)(Xa,{gates:g,laws:w})]})]})]})}var Qa=`geneseed-understand-seen`,$a=`understand`;function eo(){try{let e=JSON.parse(localStorage.getItem(Qa));return Array.isArray(e)?e:[]}catch{return[]}}function to(e){let t=eo();if(t.includes(e))return t;let n=[...t,e];try{localStorage.setItem(Qa,JSON.stringify(n))}catch{}return n}function no(e,t){let n=e?.groups||[],r=n.findIndex(e=>e.id===$a),i=n[r]?.pages||[],a=i.findIndex(e=>e.id===t);if(a<0)return{prev:null,next:null};let o=n.slice(r+1).find(e=>e.pages.length);return{prev:i[a-1]||null,next:i[a+1]||o?.pages[0]||null}}function ro(e,t){for(let n of e?.groups||[]){let e=n.pages.find(e=>e.id===t);if(e)return{part:n,section:e.section||`General`,page:e}}return{part:null,section:null,page:null}}function io(e,t){let{part:n,section:r}=ro(e,t);if(!n)return{prev:null,next:null};if(n.id===`understand`)return no(e,t);let i=n.pages.filter(e=>(e.section||`General`)===r),a=i.findIndex(e=>e.id===t);return{prev:i[a-1]||null,next:i[a+1]||null}}var ao=e=>`#/docs/`+encodeURIComponent(e);function oo({pages:e,seen:t}){let n=e.filter(e=>t.includes(e.id)).length;return(0,X.jsx)(`div`,{className:`track-prog`,role:`progressbar`,"aria-label":`Pages read`,"aria-valuemin":0,"aria-valuemax":e.length,"aria-valuenow":n,children:(0,X.jsx)(`i`,{style:{width:`${n/(e.length||1)*100}%`}})})}function so({menu:e,pageId:t}){let{prev:n,next:r}=io(e,t);return!n&&!r?null:(0,X.jsxs)(`nav`,{className:`track-bar`,"aria-label":`Pages`,children:[n?(0,X.jsxs)(`a`,{className:`btn ghost sm`,href:ao(n.id),children:[`← `,n.title]}):(0,X.jsx)(`span`,{}),r&&(0,X.jsxs)(`a`,{className:`btn sm`,href:ao(r.id),children:[`Next: `,r.title,` →`]})]})}var co=`modulepreload`,lo=function(e){return`/`+e},uo={},fo=function(e){return e.pathname.endsWith(`.css`)},po=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},mo=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=lo(t,n);let r=s(t),i=fo(r);return po(uo,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`:co,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ho=`geneseed-newhere-dismissed`,go=(0,J.lazy)(()=>mo(()=>import(`./Dashboard-BZmw2a7d.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6])));function _o({harness:e}){let[t,n]=(0,J.useState)(()=>!!localStorage.getItem(ho)),{data:r}=Y(()=>t?Promise.resolve(null):a.docs(e).catch(()=>null),[t,e]),i=r?.groups?.find(e=>e.id===`understand`)?.pages||[],o=eo(),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,X.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,X.jsxs)(`div`,{className:`newhere-body`,children:[(0,X.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,X.jsxs)(`p`,{children:[i.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),(0,X.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${c} of ${i.length} read`,children:i.map(e=>(0,X.jsx)(`i`,{className:o.includes(e.id)?`f`:``},e.id))})]}),(0,X.jsx)(`a`,{className:`btn ghost`,href:`#/docs/${encodeURIComponent(i[s].id)}`,children:c?`Continue · step ${s+1}`:`Start`}),(0,X.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(ho,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function vo({layout:e,onLayout:t}){return(0,X.jsx)(Fi,{"aria-label":`View`,children:Mr.map(n=>(0,X.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 yo({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s=`overview`,onLayout:c,dataRev:l}){if(!e)return t?(0,X.jsx)(Ji,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,X.jsx)(qi,{});if(!e.deployed)return(0,X.jsx)(sa,{onAction:o});let u=(0,X.jsx)(_o,{harness:vi(e.emit)}),d=c?(0,X.jsx)(vo,{layout:s,onLayout:c}):null;return s===`overview`?(0,X.jsx)(Za,{overview:e,setup:i,runs:a,onAction:o,onRetry:n,dataRev:l,view:d,banner:(0,X.jsxs)(X.Fragment,{children:[e.daemon_stale?(0,X.jsx)(Yi,{}):null,u]})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(aa,{title:`Overview`,sub:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `),primary:(0,X.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`build-all`),children:`Rebuild`}),actions:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`update`),children:`Update`}),(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`doctor`),children:`Run doctor`}),d]})}),u,(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(qi,{}),children:(0,X.jsx)(go,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s,dataRev:l})})]})}var bo=(0,J.lazy)(()=>mo(()=>import(`./Activity-DsKkFGhT.js`),__vite__mapDeps([7,1,2,3,6,8,9,10]))),xo=(0,J.lazy)(()=>mo(()=>import(`./ActivityDetail-BWY-vaiK.js`),__vite__mapDeps([11,1,2,3,8,6,9,10]))),So=(0,J.lazy)(()=>mo(()=>import(`./Library-BYfB4mhf.js`),__vite__mapDeps([12,1,2,3,5,9,13,14]))),Co=(0,J.lazy)(()=>mo(()=>import(`./Kits-e0DCj9sT.js`),__vite__mapDeps([15,1,2,3,9,13,14,16]))),wo=(0,J.lazy)(()=>mo(()=>import(`./Loops-r6L7a1g1.js`),__vite__mapDeps([17,1,2,3,9,10,13,14]))),To=(0,J.lazy)(()=>mo(()=>import(`./Laws-BuG2_HFE.js`),__vite__mapDeps([18,1,2,3,9,14,19]))),Eo=(0,J.lazy)(()=>mo(()=>import(`./Personal-kEfKCxlh.js`),__vite__mapDeps([20,1,2,3,9,14,21,19,12,5,13]))),Do=(0,J.lazy)(()=>mo(()=>import(`./Installs-xkBX6OjK.js`),__vite__mapDeps([22,1,2,3,9,21,16,19]))),Oo=(0,J.lazy)(()=>mo(()=>import(`./Docs-CNuRuMin.js`),__vite__mapDeps([23,1,2,3,9,13,14])));function ko(){let e=Nn(),[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(!1),[o,s]=lr(),[c,l]=mr(),u=e=>{if(!document.startViewTransition||!vn())return l(e);document.startViewTransition(()=>(0,gn.flushSync)(()=>l(e)))},[d,f]=Ar(),[p,m]=Fr(),[h,g]=(0,J.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[_,v]=(0,J.useState)(!1),y=(0,J.useRef)(null),b=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&v(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]),(0,J.useEffect)(()=>{if(!_)return;let e=b.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[_]);let x=e=>n({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:S,error:C,themes:w,reload:T}=Ir(x),[E,D]=(0,J.useState)(0),O=()=>{T(),D(e=>e+1)},[k,A]=(0,J.useState)(null),{runs:ee,activeId:te,consoleOpen:j,setConsoleOpen:ne,runAction:M,cancelJob:N,clearRuns:P}=Rr({onFinish:e=>{O(),A({status:e,at:Date.now()})},onError:x}),{data:F}=Y(()=>a.setup().catch(()=>null),[E],`setup`),{data:re}=Y(()=>a.installs().catch(()=>null),[E],`installs`),ie=re?.installs||null,ae=ee[ee.length-1],oe=ae?ae.status===`running`?`${ae.action} running`:`${ae.action} ${ae.status}`:``;(0,J.useEffect)(()=>{let e=y.current;if(e){if(!or(e,Er(d),o)){let t=Or(d);t?zn(e,t,o):!Vn(e,c,o)&&S?.accent&&zn(e,S.accent,o)}document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,getComputedStyle(e).getPropertyValue(`--bg`).trim())}},[S,o,d,c]);let I=[{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:()=>br().catch(x),confirm:{msg:`Restart the local Geneseed server? The console reconnects in a moment.`,title:`Restart the server?`,confirmLabel:`Restart`}},{title:o===`light`?`Switch to dark mode`:`Switch to light mode`,desc:`Appearance`,run:s},...dr.filter(e=>e.id!==c).map(e=>({title:`Flavour: ${e.name}`,desc:e.tagline,run:()=>u(e.id)}))].map(e=>({kind:`Actions`,hay:`${e.title} ${e.desc}`.toLowerCase(),...e})),se={flavour:c,onFlavour:u,accentMode:d,onAccentMode:f,layout:p,onLayout:m};return(0,X.jsx)(`div`,{className:`app fl-${c} ${o===`light`?`light`:``}${_?` nav-open`:``}`,ref:y,children:(0,X.jsxs)(Ti,{children:[(0,X.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,X.jsx)(`a`,{className:`skip-link`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:`Skip to content`}),(0,X.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:oe}),_&&(0,X.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>v(!1)}),(0,X.jsx)(si,{route:e,overview:S,installs:ie,onOpenVoice:()=>i(e=>!e),onNavigate:()=>v(!1)}),r&&(0,X.jsx)(zi,{themes:w,current:S?.theme,onPick:e=>{i(!1),M(`build`,{theme:e,emit:S?.emit})},onClose:()=>i(!1)}),(0,X.jsxs)(`div`,{className:`col`,ref:b,children:[(0,X.jsx)(Ri,{route:e,navOpen:_,onToggleNav:()=>v(e=>!e),overview:S,installs:ie,actions:I,mode:o,onToggleMode:s,appearance:se,dataRev:E,onSwitch:O}),(0,X.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,X.jsx)(`div`,{className:[`library`,`kits`,`loops`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:(0,X.jsx)(ra,{activeId:te,finish:k,children:(0,X.jsx)(Qi,{children:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(qi,{}),children:{overview:()=>(0,X.jsx)(yo,{overview:S,overviewError:C,onRetry:T,themes:w,setup:F,runs:ee,onAction:M,layout:p,onLayout:m,dataRev:E}),laws:()=>(0,X.jsx)(To,{selected:e.item,overview:S,setup:F,onAction:M,dataRev:E}),library:()=>(0,X.jsx)(So,{overview:S,section:e.section,selected:e.item,dataRev:E}),kits:()=>(0,X.jsx)(Co,{item:e.item,onAction:M,dataRev:E}),loops:()=>(0,X.jsx)(wo,{tab:e.tab,item:e.item,dataRev:E}),personal:()=>(0,X.jsx)(Eo,{tab:e.tab,item:e.item,setup:F,dataRev:E}),installs:()=>(0,X.jsx)(Do,{tab:e.tab,overview:S,setup:F,themes:w,onAction:M,onMutated:O,dataRev:E,appearance:se}),activity:()=>e.item?(0,X.jsx)(xo,{sid:e.item},e.item):(0,X.jsx)(bo,{}),docs:()=>(0,X.jsx)(Oo,{page:e.item,onAction:M,overview:S})}[e.page]?.()})},e.page)})})}),(0,X.jsx)(li,{route:e,navOpen:_,onMore:()=>v(!0)}),(0,X.jsx)(Hi,{runs:ee,open:j,busy:!!te,finish:k,onToggle:()=>ne(e=>!e),onClear:P,onCancel:N})]}),(0,X.jsx)(Vi,{toast:t,onClose:()=>n(null)}),h&&(0,X.jsx)(Ki,{ready:!!S||!!C,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}g(!1)}})]})})}(0,_n.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(ko,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{Tn as $,qi as A,Te as At,fi as B,ca as C,he as Ct,ia as D,L as Dt,ea as E,me as Et,vi as F,b as Ft,Xr as G,$r as H,_i as I,m as It,Y as J,Kr as K,ui as L,Fi as M,C as Mt,wi as N,h as Nt,Yi as O,Le as Ot,gi as P,x as Pt,dr as Q,di as R,la as S,H as St,aa as T,fe as Tt,Qr as U,Z as V,Zr as W,kr as X,Mr as Y,br as Z,ua as _,lt as _t,ao as a,yn as at,ma as b,ze as bt,eo as c,hn as ct,xa as d,on as dt,En as et,ba as f,sn as ft,ha as g,Tt as gt,va as h,At as ht,oo as i,vn as it,Ii as j,I as jt,Ji as k,Ie as kt,ka as l,un as lt,Ca as m,Mt as mt,so as n,Mn as nt,to as o,bn as ot,Sa as p,qt as pt,ei as q,$a as r,xn as rt,ro as s,Cn as st,mo as t,Pn as tt,La as u,ln as ut,da as v,ot as vt,sa as w,pe as wt,fa as x,Fe as xt,pa as y,U as yt,mi as z};
@@ -0,0 +1,2 @@
1
+ function e(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=Date.now();for(let n of e){let e=n.started||n.finished||n.created||n.ts;if(!e)continue;let a=typeof e==`string`?Date.parse(e):e*1e3;if(!Number.isFinite(a))continue;let o=Math.floor((i-a)/864e5);o<0||o>=t||(r[t-1-o].v+=1)}return r}var t=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),n=[`--emit`,`--theme`,`--scope`],r={done:`✓`,failed:`✗`};function i(e){let t=(e.output||``).split(`
2
+ `).find(e=>e.startsWith(`$ `))||``,i=t.split(/\s+/),a=[];return i.forEach((e,t)=>{let[r,o]=e.split(`=`),s=o||i[t+1];n.includes(r)&&s&&!s.startsWith(`--`)&&a.push(s)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:a.join(` · `),result:r[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}export{i as n,t as r,e as t};
@@ -11,12 +11,12 @@
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-osXUqzdX.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-Dwo3Gxek.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/react-DlYQp10C.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/api-BfpZmUMI.js">
18
18
  <link rel="modulepreload" crossorigin href="/assets/sections-ChwaobfW.js">
19
- <link rel="stylesheet" crossorigin href="/assets/index-BJlfPvpv.css">
19
+ <link rel="stylesheet" crossorigin href="/assets/index-CDSHv_7s.css">
20
20
  </head>
21
21
  <body>
22
22
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{B as i,G as a,O as o,k as s,ot as c,w as l}from"./index-osXUqzdX.js";import{a as u,n as d,r as f,t as p}from"./activity-BGy8Bb_l.js";import{t as m}from"./EmptyState-1sPNleqv.js";import{t as h}from"./usePoll-bDFN-Hr6.js";var g=e(t(),1),_=n();function v({s:e}){let t=(0,g.useId)(),n=e.todos,r=u(e);return(0,_.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,_.jsx)(p,{s:e,id:t,heading:e.title||f(e.cwd)||e.session_id,children:(0,_.jsx)(i,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,_.jsx)(`div`,{className:`act-foot`,children:(0,_.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,_.jsx)(d,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,_.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,a(e.updated_at),` ago`]})]})}function y(){let[e,t]=(0,g.useState)(null),[n,i]=(0,g.useState)(``);h(e=>r.activity().then(n=>{e()&&(t(n),i(``))},t=>{e()&&i(t.message)}),2e3,[]);let a=!e||e.enabled!==!1,u=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),d=c(),f=async()=>{let e=!a;try{let n=await r.activityToggle(e);t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[]})),i(``)}catch(e){i(e.message)}};return(0,_.jsxs)(`div`,{className:`narrow`,children:[(0,_.jsx)(l,{title:`Activity`,sub:`Live OpenCode sessions this harness is running: what each one is doing right now. Refreshes every couple of seconds; sessions drop off when their process exits.`,actions:(0,_.jsxs)(`div`,{className:`row gap-10 act-fixed`,children:[(0,_.jsx)(`span`,{className:`dim mono act-xs`,children:a?`tracking on`:`tracking off`}),(0,_.jsx)(`div`,{className:`sw-toggle${a?` on`:``}`,role:`switch`,"aria-checked":a,"aria-label":`Toggle activity tracking`,tabIndex:0,onClick:f,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),f())}})]})}),n&&(0,_.jsx)(`div`,{className:`act-gap`,children:(0,_.jsx)(o,{error:n})}),e?a?u.length===0?(0,_.jsxs)(m,{title:`No active sessions`,children:[`Run `,(0,_.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,_.jsx)(`div`,{className:`stack gap-12`,ref:d,children:u.map(e=>(0,_.jsx)(`div`,{"data-flip":e.session_id,children:(0,_.jsx)(v,{s:e})},e.session_id))}):(0,_.jsx)(m,{title:`Activity tracking is off`,children:`The plugin isn't recording sessions. Flip the switch to turn it back on.`}):(0,_.jsx)(s,{label:`Reading live sessions…`})]})}export{y as default};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-tHIvpI6U.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/sections-ChwaobfW.js","assets/index-osXUqzdX.js","assets/api-BfpZmUMI.js","assets/index-BJlfPvpv.css","assets/OperatorHudView-BN27gXFS.js","assets/JournalView-DO0pPutM.js","assets/drawable-r1qCgRMK.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{t as a}from"./drawable-r1qCgRMK.js";import{n as o,r as s}from"./sections-ChwaobfW.js";import{B as c,C as l,D as u,G as d,H as f,M as p,O as m,U as h,W as g,at as _,ct as v,dt as y,et as b,it as x,k as S,l as C,nt as w,q as T,rt as E,t as D}from"./index-osXUqzdX.js";var O=t(n(),1),k=r();function A({segments:e,value:t,max:n,size:r=120,stroke:i=12,label:o,sweepMs:s=650}){let c=n>0?n:0,l=e||[{key:`v`,label:o,n:Math.min(Math.max(t||0,0),c),tone:`accent`}],u=e?l.reduce((e,t)=>e+t.n,0):c,d=e?l.map(e=>`${e.label}: ${e.n} of ${u}`).join(`, `):`${l[0].n} of ${u}`,f=r/2-i/2,p=r/2,m=e=>[p+f*Math.cos(e),p+f*Math.sin(e)],h=[],g=0;for(let e of l)h.push(g),g+=e.n;let _=(0,O.useRef)(null),b=l.map(e=>e.n).join(`,`);return(0,O.useLayoutEffect)(()=>{let e=_.current?.querySelectorAll(`path.ring-arc`);if(!s||!e?.length||!E())return;let t=l.map(e=>e.n/u).filter(e=>e>0),n=t.map((e,n)=>t.slice(0,n).reduce((e,t)=>e+t,0)),r=a(e);v(r,{draw:`0 0`});let i=y(r,{draw:[`0 0`,`0 1`],duration:(e,n)=>Math.max(s*t[n],60),delay:(e,t)=>s*n[t],ease:`linear`});return x(i,s)},[b,s]),(0,k.jsxs)(`svg`,{className:`ring`,width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:`img`,"aria-label":o?`${o}: ${d}`:d,children:[(0,k.jsx)(`circle`,{className:`ring-track`,cx:p,cy:p,r:f,fill:`none`,strokeWidth:i}),(0,k.jsx)(`g`,{ref:_,children:u>0?l.map((e,t)=>{let n=e.n/u;if(!(n>0))return null;let r=h[t]/u*2*Math.PI-Math.PI/2,a=r+n*2*Math.PI,[o,s]=m(r),[c,l]=m(a),d=n>=.9999?`M ${o} ${s} A ${f} ${f} 0 1 1 ${2*p-o} ${2*p-s} A ${f} ${f} 0 1 1 ${o} ${s}`:`M ${o} ${s} A ${f} ${f} 0 ${+(n>.5)} 1 ${c} ${l}`;return(0,k.jsx)(`path`,{className:`ring-arc tone-${e.tone||`muted`}`,d,fill:`none`,strokeWidth:i,children:(0,k.jsxs)(`title`,{children:[e.label,`: `,e.n]})},e.key)}):null})]})}var j=864e5;function M(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=Date.now();for(let n of e){let e=n.started||n.finished||n.created||n.ts;if(!e)continue;let a=typeof e==`string`?Date.parse(e):e*1e3;if(!Number.isFinite(a))continue;let o=Math.floor((i-a)/j);o<0||o>=t||(r[t-1-o].v+=1)}return r}var N=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),P=[`--emit`,`--theme`,`--scope`],F={done:`✓`,failed:`✗`};function ee(e){let t=(e.output||``).split(`
3
- `).find(e=>e.startsWith(`$ `))||``,n=t.split(/\s+/),r=[];return n.forEach((e,t)=>{let[i,a]=e.split(`=`),o=a||n[t+1];P.includes(i)&&o&&!o.startsWith(`--`)&&r.push(o)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:r.join(` · `),result:F[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}var I={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.`},L=(e,t)=>e.deployed?t===void 0||t===`good`?I[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,R={good:`ok`,warn:`warn`,bad:`bad`};function z({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${R[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function B({overview:e,dataRev:t}){let{data:n}=T(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=f(e.diff),a=e.counts||{},o=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[o.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(w,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>b(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(w,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function V({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:s.map((t,n)=>{let r=o[t],i=e.counts?.[t];return(0,k.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>b(`#/section/`+t),children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(c,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(w,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function H({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=N(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[d(e.started),` ago`]})]},e.id))})}function U({value:e}){let t=_(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(A,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=L(e,i?.tone),c=g(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(U,{value:c}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(z,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(B,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[s.length,` sections`]})})]}),(0,k.jsx)(V,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(H,{jobs:r})]})]})]})}function G({k:e,overview:t,max:n}){let r=o[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function K(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function q({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=h(e.counts),o=n?.version_verdict||``,c=K(o),l=f(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,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(z,{verdict:i?.verdict}),c&&(0,k.jsxs)(`span`,{className:`badge ${c.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),c.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),s.map(t=>(0,k.jsx)(G,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(H,{jobs:r})]})]})]})}function J({overview:e,setup:t,jobs:n,lens:r}){let i=s.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=h(e.counts),c=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=f(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(z,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:c?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:s.map(t=>{let n=o[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(H,{jobs:n})]})]})]})}var Y=Symbol(`failed`),X=e=>Promise.resolve().then(e).catch(()=>Y);function Z({dataRev:e,needDoctor:t}){let n=T(()=>X(()=>i.fleet()),[e]),r=T(()=>t?X(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===Y?`failed`:`ok`,s=o===`ok`?a:null,c=s?C(s):null,l=r.data,u=t?l==null?`loading`:l===Y?`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 Q=e({default:()=>$}),te=(0,O.lazy)(()=>D(()=>import(`./GreenhouseView-tHIvpI6U.js`),__vite__mapDeps([0,1,2,3,4,5,6]))),ne=(0,O.lazy)(()=>D(()=>import(`./OperatorHudView-BN27gXFS.js`),__vite__mapDeps([7,1,2,3,4,5,6]))),re=(0,O.lazy)(()=>D(()=>import(`./JournalView-DO0pPutM.js`),__vite__mapDeps([8,1,2,5,9,4,3,6])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:d}){let f=c,[h,g]=(0,O.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,v=Z({dataRev:d,needDoctor:f===`greenhouse`||f===`operator`}),{data:y}=T(()=>f===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[f,d]);if(!e)return t?(0,k.jsx)(m,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(S,{});let b=e.daemon_stale?(0,k.jsx)(u,{}):null;return e.deployed?h===`status`&&f===`journal`?(0,k.jsxs)(O.Suspense,{fallback:(0,k.jsx)(S,{}),children:[b,(0,k.jsx)(re,{overview:e,recent:y,lens:v,onDirection:g,dataRev:d})]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(p,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>g(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&f===`cultivar`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:v,dataRev:d}),h===`status`&&f===`greenhouse`&&(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(S,{}),children:(0,k.jsx)(te,{overview:e,sigil:_,jobs:o,lens:v,onAction:s})}),h===`status`&&f===`operator`&&(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(S,{}),children:(0,k.jsx)(ne,{overview:e,jobs:o,lens:v})}),h===`lineage`&&(0,k.jsx)(q,{overview:e,sigil:_,setup:a,jobs:o,lens:v}),h===`operator`&&(0,k.jsx)(J,{overview:e,setup:a,jobs:o,lens:v})]},h)]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(l,{onAction:s})]})}export{ee as a,$ as default,M as i,z as n,N as o,L as r,A as s,Q as t};
@@ -1,4 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{B as i,F as a,M as o,N as s,O as c,P as l,a as u,c as ee,et as d,i as f,k as p,n as m,o as h,q as g,r as _,s as v,w as y}from"./index-osXUqzdX.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{a as x,n as te,o as S,r as C,t as w}from"./RailCats-DNlJKicm.js";import{i as T,n as E,r as D}from"./Markdown-OReRRoEV.js";var O=e(t(),1);function k(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function A(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
2
- `))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
3
- `),n.join(`
4
- `)]}function j(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||k(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function M(e){let t={ids:new Set,idx:0,toc:[]},n=n=>j(E(n,e?.links),t);if(e?.rows){let[r,i]=A(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var N=n(),P={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},F=`you already know this`;function I({page:e,overview:t,onAction:n}){let r=(0,O.useRef)(null),i=(0,O.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,O.useEffect)(()=>{let e=r.current;e&&e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)})},[i]),(0,O.useEffect)(()=>{let e=r.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),d(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[i]),(0,O.useEffect)(()=>{let n=r.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[i,a]=P[t?.emit]||[];if(!i)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${i}"]`)?.closest(`li`):e.id===i&&a&&(o=[...n.querySelectorAll(`h2`)].find(e=>k(e.textContent||``)===k(a))),o?.classList.add(`docs-here`)},[i,e.id,t?.emit]);let a=[];return e.id===`install`&&(a.push({label:`Run doctor`,action:`doctor`}),a.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&a.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&a.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(y,{title:e.title,actions:a.length>0&&a.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:r,dangerouslySetInnerHTML:{__html:i}}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var L=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`),R=1200;function z({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function B({text:e}){let[t,n]=(0,O.useState)(!1);return(0,N.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),R)}catch{}},title:`Copy command`,children:[(0,N.jsx)(i,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function V({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:L(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(B,{text:`${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(z,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(z,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function H({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(y,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(V,{cmd:e,prog:t},e.name))})]})}function U({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(y,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var W={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},G=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:D(T.parseInline(e||``))}}),K=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${W[e]||``}`,children:e});function q({page:e,overview:t,onAction:n}){let[r,i]=(0,O.useState)(0),{before:a,after:o}=(0,O.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(I,{page:e,overview:t,onAction:n});let s=e.rows[r]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(y,{title:e.title}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:a}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===r?`on`:``}`,"aria-pressed":t===r,onClick:()=>i(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(G,{text:e.piece})}),(0,N.jsx)(K,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(G,{text:e.cost})})]})},t))}),s&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(G,{text:s.piece})}),(0,N.jsx)(K,{kind:s.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(G,{text:s.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(G,{text:s.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(G,{text:s.off})})]})]})]}),o.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:o}})]})}var J=5,Y=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function X(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${Y(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===J)break;return r}var Z=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function ne({page:e,glossaryRows:t}){let n=e?.body,r=(0,O.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:L(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,O.useMemo)(()=>X(n,t),[n,t]);return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),Z(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function re({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(y,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:n.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(i,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(i,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(i,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function ie({data:e,error:t,overview:n,onAction:r}){if(t)return(0,N.jsx)(c,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(p,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(I,{page:e,overview:n,onAction:r});case`map`:return(0,N.jsx)(q,{page:e,overview:n,onAction:r});case`cli`:return(0,N.jsx)(H,{page:e});case`glossary`:return(0,N.jsx)(U,{page:e});case`about`:return(0,N.jsx)(re,{page:e});default:return(0,N.jsx)(b,{title:`Unknown page kind`,children:e.kind})}}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ae({page:e,overview:t,onAction:n}){let[i,d]=a(l(t?.emit)),{data:y,error:b}=g(()=>r.docs(i),[i]),T=e||Q(y),{data:E,error:D,loading:k}=g(()=>T?r.docsPage(T,i):Promise.resolve(null),[T,i]),{data:A}=g(()=>r.docsPage(`glossary`,i).catch(()=>null),[i],`docs:glossary`);(0,O.useEffect)(()=>{if(y&&T&&!y.groups.some(e=>e.pages.some(e=>e.id===T))){let e=Q(y);e&&e!==T&&window.location.replace(u(e))}},[y,T]),(0,O.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[T]);let j=v(y,T),M=j.part||y?.groups?.[0]||null,P=M?.id===_;(0,O.useEffect)(()=>{P&&E?.id===T&&h(T)},[P,E,T]);let F=P?[...ee(),T]:[],[I,L]=(0,O.useState)(``),[R,z]=(0,O.useState)(`all`),[B,V]=(0,O.useState)(M?.id);M?.id!==B&&(V(M?.id),L(``),z(`all`));let H=$(M),U=te(H),W=R===`all`?H:H.filter(e=>e.group===R),G=S(W,I);return b?(0,N.jsx)(c,{error:b}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(o,{"aria-label":`Harness`,children:s.map(e=>(0,N.jsx)(`button`,{className:i===e.id?`on`:``,onClick:()=>d(e.id),"aria-pressed":i===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(y?.groups||[]).map(e=>(0,N.jsxs)(O.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?u(e.pages[0].id):`#/docs`,className:M?.id===e.id?`on`:``,"aria-current":M?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),M?.id===e.id&&(0,N.jsx)(w,{label:`Sections`,total:H.length,cats:U,cat:R,onChange:z})]},e.id))})]}),(0,N.jsx)(x,{label:M?.label||`Docs`,count:I.trim()?`${G.length} of ${W.length}`:W.length||``,extra:P&&(0,N.jsx)(f,{pages:M.pages,seen:F}),q:I,onQ:L,matched:G.length,inView:[M?.id,T],children:y?(0,N.jsx)(C,{rows:G,activeName:T,hrefOf:e=>u(e.name),pills:P?e=>F.includes(e.name)&&e.name!==T?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(p,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[j.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:u(j.part.pages[0].id),children:j.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:u(j.part.pages.find(e=>(e.section||`General`)===j.section).id),children:j.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:j.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(ie,{data:k?null:E,error:D,overview:t,onAction:n},`${T}|${i}`),!k&&(0,N.jsx)(m,{menu:y,pageId:T})]}),!k&&(0,N.jsx)(ne,{page:E,glossaryRows:A?.rows})]})]})]})})}export{ae as default,$ as docRows};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{n,r}from"./sections-ChwaobfW.js";import{B as i,G as a,H as o,nt as s}from"./index-osXUqzdX.js";import{a as c,i as l,n as u,o as d,r as f,s as p}from"./Dashboard-B5-wUlXC.js";e();var m=t(),h=12,g=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],_=650;function v({segments:e,size:t=186,stroke:n=26,caption:r=`capabilities`}){let i=e.reduce((e,t)=>e+t.n,0);return(0,m.jsxs)(`div`,{className:`ring-box`,children:[(0,m.jsx)(p,{segments:e,size:t,stroke:n,label:r,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(s,{value:i,duration:_})}),(0,m.jsx)(`div`,{className:`donut-c-cap`,children:r})]})]})}function y(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function b({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=y(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,m.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,m.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function x({label:e,value:t,sub:n,color:r,icon:a}){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)(i,{name:a})}),(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:p,lens:_,onAction:y}){let S=e.counts||{},C=_?.doctor?.state||`loading`,w=_?.doctor?.data?.groups||[],T=C===`ok`,E=w.filter(e=>e.problems.length===0).length,D=w.length,O=f(e,_?.tone),k=d(p,h),A=o(e.diff),j=r.filter(e=>(S[e]||0)>0).map((e,t)=>({key:e,label:n[e].label,n:S[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),M=j.reduce((e,t)=>e+t.n,0),N=l(p||[],10),P=N.reduce((e,t)=>e+t.v,0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`b-greet`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,m.jsx)(`h2`,{className:`h b-h`,children:O}),(0,m.jsx)(u,{verdict:_?.verdict}),(0,m.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,m.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,m.jsxs)(`div`,{className:`card b-hero`,children:[(0,m.jsx)(`div`,{className:`b-hero-ring`,children:(0,m.jsx)(v,{segments:[{key:`pass`,label:`pass`,n:E,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(D-E,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,m.jsxs)(`div`,{className:`b-hero-side`,children:[(0,m.jsx)(`h3`,{className:`b-hero-title`,children:T?`${E} of ${D} checks pass`:C===`failed`?`Doctor did not answer`:`Checking…`}),C===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>y(`doctor`),children:[(0,m.jsx)(i,{name:`doctor`}),`Run doctor`]}),(0,m.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,m.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),T&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:w.map(e=>{let t=e.problems.length===0;return(0,m.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,m.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,m.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,m.jsxs)(`div`,{className:`b-chips`,children:[(0,m.jsxs)(`span`,{className:`b-chip`,children:[(0,m.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,m.jsx)(`span`,{className:`b-chip`,children:(0,m.jsx)(`b`,{children:e.emit})}),(0,m.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,m.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,m.jsxs)(`div`,{className:`b-tiles`,children:[(0,m.jsx)(x,{label:`Agents`,value:S.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:S.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:S.laws??`—`,sub:S.doctrines?`${S.doctrines.active}/${S.doctrines.total} packs · ${S.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Edits`,value:A,sub:`to graft`,color:g[3],icon:`changes`})]})]}),(0,m.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,m.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Capability mix`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[M,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:j,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:j.map(e=>(0,m.jsxs)(`div`,{className:`b-leg-row`,children:[(0,m.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,m.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,m.jsx)(`span`,{className:`b-leg-bar`,children:(0,m.jsx)(`i`,{style:{width:`${e.n/M*100}%`,background:e.color}})}),(0,m.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent runs`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`badge ok`,children:[(0,m.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,m.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,m.jsx)(`span`,{className:`b-stat-big`,children:(0,m.jsx)(s,{value:P})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,T&&D>0&&` · ${E}/${D} checks pass now`]})]}),(0,m.jsx)(b,{data:N,accent:g[0],height:156})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent activity`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[`last `,k.length,` runs`]})})]}),(0,m.jsxs)(`div`,{className:`b-timeline`,children:[k.map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`,r=c(e);return(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,m.jsxs)(`div`,{className:`b-tl-body`,title:r.command||void 0,children:[(0,m.jsx)(`b`,{children:r.verb}),[r.scope,r.result,r.duration].map(e=>e?` · ${e}`:``).join(``)]}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:e.started?`${a(e.started)} ago`:`—`})]},e.id)}),(!p||p.length===0)&&(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node`}),(0,m.jsx)(`div`,{className:`b-tl-body sub`,children:`No runs yet. Trigger an action to populate this.`}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:`—`})]})]})]})]})}export{S as default};
@@ -1,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{$ as i,A as a,B as o,I as s,J as c,L as l,M as u,O as d,R as f,V as p,X as m,Y as h,Z as g,j as _,k as v,q as y,w as b,z as x}from"./index-osXUqzdX.js";import{t as S}from"./EmptyState-1sPNleqv.js";import{t as C}from"./Tabs-ChiCgm2F.js";import{a as w,c as T,n as E,o as D,r as O,s as k,t as A}from"./KitApply-DZGqaZpV.js";var j=e(t(),1),M=n();function N({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[c,u]=(0,j.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[d,f]=(0,j.useState)(!1),[p,m]=(0,j.useState)(``),h=(e,t)=>u(n=>({...n,[e]:t})),g=async()=>{f(!0),o(``);try{let e=await r.pickFolder();e.path?(h(`path`,e.path),m(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{f(!1)}},_=async()=>{let e=c.path.trim();if(!e){m(`Choose or type a folder to deploy into.`);return}m(``),o(``),await i?.(`deploy`,{host:c.host,path:e,theme:c.theme,footprint:c.footprint,posture:c.posture,mode:c.mode,trust:c.trust})&&a()};return(0,M.jsxs)(`div`,{className:`deploy-pop`,children:[(0,M.jsxs)(`div`,{className:`dp-row`,children:[(0,M.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:c.path,onChange:e=>{h(`path`,e.target.value),m(``)},onKeyDown:e=>e.key===`Enter`&&_(),"aria-label":`Folder to deploy into`,"aria-invalid":p?!0:void 0,"aria-describedby":p?`dp-path-err`:void 0}),(0,M.jsx)(`button`,{className:`btn ghost sm`,disabled:d,onClick:g,children:d?`Choosing…`:`Browse…`})]}),p?(0,M.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:p}):null,(0,M.jsxs)(`div`,{className:`dp-row`,children:[(0,M.jsxs)(`label`,{className:`dp-field`,children:[(0,M.jsx)(`span`,{children:`Deploy as`}),(0,M.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:c.host,onChange:e=>h(`host`,e.target.value),children:s.map(e=>(0,M.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,M.jsx)(k,{value:c,options:n,onChange:h,who:`the new harness`}),(0,M.jsx)(`button`,{className:`btn ghost sm`,onClick:_,children:`Deploy`}),(0,M.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,M.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,M.jsx)(`code`,{children:l(c.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function P(){let{data:e,error:t,reload:n}=y(()=>r.excludes(),[]),[i,a]=(0,j.useState)(!1),[s,c]=(0,j.useState)([]),u=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);c(n.messages||[])}catch(e){c(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,M.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`Excluded folders`})}),(0,M.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,M.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,M.jsx)(`code`,{children:e.path}),(0,M.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>l(e).label).join(`, `)}),(0,M.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>u(`remove`,e.path),children:`Remove`})]},e.path)),(0,M.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await u(`add`,e.path):e.error&&c([e.error])}catch(e){c([e.message])}finally{a(!1)}},children:[(0,M.jsx)(o,{name:`folder`}),` Exclude a folder…`]}),s.map((e,t)=>(0,M.jsx)(`p`,{className:`sub`,children:e},t))]})}function F({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,M.jsxs)(`div`,{className:`ip-block`,children:[(0,M.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,M.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,M.jsxs)(`div`,{className:`mcp-target`,children:[(0,M.jsxs)(`div`,{className:`mt-head`,children:[(0,M.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,M.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,M.jsxs)(`div`,{className:`mcp-row`,children:[(0,M.jsx)(`span`,{className:`mono`,children:e.name}),(0,M.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,M.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,M.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,M.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var I={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function L({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:u,onApply:d,onToggleInstall:p,onRemove:m,onRevealMcp:h}){let g=`${l(e.host).label} · ${e.scope}`,[_,v]=I[e.state]||I.absent,y=e.state===`active`,b=e.state===`absent`;return(0,M.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${g} install`,children:[(0,M.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,M.jsxs)(`div`,{className:`ip-head`,children:[(0,M.jsx)(`h2`,{children:f(e)}),(0,M.jsx)(`span`,{className:`tag ${v}`,children:_})]}),(0,M.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${l(e.host).label}`}),(0,M.jsx)(`code`,{className:`ip-path`,children:e.path}),b?(0,M.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,M.jsx)(`strong`,{children:l(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(y||b)&&o?(0,M.jsx)(`div`,{className:`ip-picks`,children:(0,M.jsx)(k,{value:n,options:i,onChange:a,who:g})}):null,y&&t.length?(0,M.jsx)(F,{targets:t,onReveal:h}):null,y&&e.scope===`global`?(0,M.jsx)(P,{}):null,b?null:(0,M.jsxs)(`label`,{className:`ip-switch`,children:[(0,M.jsx)(T,{on:y,disabled:s,label:`activate ${g}`,onToggle:p}),(0,M.jsx)(`span`,{children:y?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,M.jsx)(`div`,{className:`ip-spacer`}),o?(0,M.jsxs)(`div`,{className:`ip-actions`,children:[b?(0,M.jsx)(`button`,{type:`button`,className:`btn`,onClick:d,children:`Install`}):y?(0,M.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:d,children:`Apply and rebuild`}):null,b?null:(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`label`,{className:`field`,children:[(0,M.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,M.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>u(e.target.value),children:[(0,M.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,M.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,M.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,M.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${g} from ${e.path}`,disabled:s,onClick:m,children:`Uninstall…`})]})]}):null]})}var R=(e,t)=>`${e} ${t}`,ee=[`claude`,`bob`,`openclaude`],z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]};function B({rows:e,project:t,currentId:n,onPick:r,label:i}){return(0,M.jsx)(`div`,{className:`tbl-scroll`,children:(0,M.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,M.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,M.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,M.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,M.jsx)(`th`,{scope:`col`,children:`State`}),(0,M.jsx)(`th`,{scope:`col`,children:(0,M.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,M.jsx)(`tbody`,{children:e.map(e=>{let[i,a]=z[e.state]||[`Not installed`,``],o=n===e.id,s=e.state===`absent`;return(0,M.jsxs)(`tr`,{className:`pickable${o?` on`:``}${s?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,M.jsx)(`td`,{children:(0,M.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":o,title:e.path,onClick:()=>r(e.id),children:f(e)})}),t?(0,M.jsx)(`td`,{children:l(e.host).label}):(0,M.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,M.jsx)(`td`,{children:s?``:e.theme||``}),(0,M.jsx)(`td`,{children:s?``:e.footprint||``}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`span`,{className:`tag ${a}`,children:i})}),(0,M.jsx)(`td`,{className:`pick-mark`,children:o?`Editing ›`:``})]},e.id)})})]})})}function te({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,M.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,M.jsxs)(`summary`,{children:[(0,M.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,M.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,M.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,M.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,M.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,M.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function ne({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,M.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,M.jsxs)(`div`,{className:`panel-head`,children:[(0,M.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,M.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,M.jsxs)(`dl`,{className:`kv-grid`,children:[(0,M.jsx)(`dt`,{children:`Source`}),(0,M.jsx)(`dd`,{className:`mono`,children:e.root}),(0,M.jsx)(`dt`,{children:`Version`}),(0,M.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,M.jsx)(`dt`,{children:`Fingerprint`}),(0,M.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function V({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:s,dataRev:c,onMutated:u}){let f=a(),{data:p,error:m,reload:h}=y(()=>r.installs(),[c]),{data:g,error:_,reload:b}=y(()=>r.mcp(),[c]),[C,w]=(0,j.useState)(null),[T,E]=(0,j.useState)(``),[O,k]=(0,j.useState)({}),[A,P]=(0,j.useState)(!1),[F,I]=(0,j.useState)({id:``,value:`keep`}),z=e=>F.id===e?.id?F.value:`keep`,[V,H]=(0,j.useState)(``),U=(0,j.useMemo)(()=>{let e={};for(let t of g?.targets||[]){let n=R(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[g]);if(m||_)return(0,M.jsx)(d,{error:m||_,onRetry:()=>{h(),b()}});if(!p||!g)return(0,M.jsx)(v,{});let W={active:0,disabled:1,absent:2},G=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(W[e.state]??3)-(W[t.state]??3)),K=G.find(e=>e.id===V)||G.find(e=>e.selected)||G.find(e=>e.state===`active`)||G[0],q=e=>{let t=O[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},J=(e,t,n)=>k(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),Y=e=>{let t=q(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},X={theme:t.map(e=>e.name),footprint:D,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},Z=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=q(t),s=l(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await f(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},Q=async e=>{if(e.state!==`active`||await f(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){E(e.id),w(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;w({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}u?.()}catch(e){w({text:e.message,tone:`bad`})}finally{E(``)}}},$=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&ee.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},re=async e=>{let t=z(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${$(e,`memory`)} and ${$(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await f(`Uninstall ${l(e.host).label} · ${e.scope}? It deletes ${x(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){E(e.id),w(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){w({text:n.error||`remove failed`,tone:`bad`});return}I({id:``,value:`keep`}),n.kept?.length&&w({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),u?.()}catch(e){w({text:e.message,tone:`bad`})}finally{E(``)}}},ie=async e=>{w(null);try{let t=await r.mcpReveal(e.path);w({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){w({text:e.message,tone:`bad`})}},ae=G.find(e=>e.selected)?.host||G.find(e=>e.state===`active`)?.host||G[0]?.host||`opencode`,oe=G.filter(e=>e.scope===`global`),se=G.filter(e=>e.scope!==`global`),ce=e=>{H(e)};return(0,M.jsxs)(`div`,{className:`hosts`,children:[(0,M.jsxs)(`div`,{className:`hosts-main`,children:[(0,M.jsxs)(`div`,{className:`toolbar`,children:[(0,M.jsxs)(`span`,{className:`dim`,children:[G.filter(e=>e.state===`active`).length,` active of `,G.length,` `,`detected.`]}),e?(0,M.jsx)(`div`,{className:`row gap-8`,children:(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>e(`build-all`),children:[(0,M.jsx)(o,{name:`refresh`}),` Rebuild all`]})}):null]}),C?.tone===`bad`?(0,M.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:C.text}):C?(0,M.jsx)(`p`,{className:`tag ${C.tone===`ok`?`ok `:``}note`,role:`status`,children:C.text}):null,(0,M.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,M.jsx)(`div`,{className:`inst-head`,children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,M.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,M.jsx)(B,{rows:oe,currentId:K?.id,onPick:ce,label:`Global installs`})]}),(0,M.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,M.jsxs)(`div`,{className:`inst-head`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,M.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,M.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>P(e=>!e),children:[(0,M.jsx)(o,{name:`folder`}),` Deploy to a repo…`]}):null]}),A?(0,M.jsx)(`div`,{className:`inst-deploy`,children:(0,M.jsx)(N,{host:ae,theme:n||`neutral`,options:X,onAction:e,onClose:()=>P(!1),onNote:e=>w(e?{text:e,tone:`bad`}:null)})}):null,se.length?(0,M.jsx)(B,{rows:se,project:!0,currentId:K?.id,onPick:ce,label:`Per-project installs`}):(0,M.jsx)(S,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,M.jsx)(ne,{setup:s,overview:i}),(0,M.jsx)(te,{themes:t,current:i?.theme})]}),K?(0,M.jsx)(L,{inst:K,targets:U[R(K.host,K.path)]||[],choice:q(K),unchanged:Y(K),options:X,onPick:(e,t)=>J(K,e,t),canAct:!!e,busy:T===K.id,memory:z(K),onMemory:e=>I({id:K.id,value:e}),onApply:()=>Z(K),onToggleInstall:()=>Q(K),onRemove:()=>re(K),onRevealMcp:ie},K.id):null]})}function H({onAction:e,dataRev:t}){let{data:n,error:i}=y(()=>r.kits(),[t]),a=w(n,e);return i||n?.error?(0,M.jsx)(d,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,M.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=O(e),r=a.setOf(e),i=`${e.host} · ${e.scope}`;return(0,M.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,M.jsxs)(`div`,{className:`inst-head`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h2`,{children:i}),(0,M.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,M.jsx)(E,{row:e})]}),t&&(0,M.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,M.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,M.jsxs)(`li`,{className:`kit-row`,children:[(0,M.jsxs)(`div`,{className:`kit-main`,children:[(0,M.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,M.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,M.jsxs)(`span`,{className:`mono dim`,children:[n.skills.length,` skills · `,n.agents.length,` agents`]})]}),(0,M.jsx)(T,{on:r.has(n.name),disabled:t||a.running(e),label:`${n.name} for ${i}`,onToggle:()=>a.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,M.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,M.jsx)(A,{row:e,stage:a})]},e.id)})}):(0,M.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,M.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,M.jsx)(v,{})}function U(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var W=300;function G({onMutated:e,onAction:t,dataRev:n,overview:i}){let s=a(),{data:c,error:l,reload:u}=y(()=>r.diff(),[n]),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(()=>new Set),[b,x]=(0,j.useState)(()=>new Set),[C,w]=(0,j.useState)(null);if(c&&c!==C){w(c),_(new Set);let e=c.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=W?c.files.map(e=>e.rel):[]))}let T=e=>_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),E=()=>_(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[...g],n=t.filter(e=>c.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
2
- `)}\n\n`:``;if(await s(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){p(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;h(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await u(),e?.()}catch(e){h(e.message)}finally{p(!1)}}};if(l)return(0,M.jsx)(d,{error:l,onRetry:u});if(!c)return(0,M.jsx)(v,{});if(!c.deployed)return(0,M.jsx)(S,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!c.diffable)return(0,M.jsx)(S,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=c.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=c.files.filter(e=>e.status===`linked`),N=c.files.filter(e=>e.status===`stale`),P=k.filter(e=>e.status===`edited`).length,F=k.filter(e=>e.status===`added`).length,I=k.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h2`,{className:`h`,children:`Local edits`}),c.target?(0,M.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,M.jsx)(`code`,{children:c.target}),c.theme?` (${c.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,P>0?(0,M.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):F+I>0?(0,M.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,M.jsxs)(`div`,{className:`row gap-10`,children:[(0,M.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||g.size===0,onClick:O,children:[`Restore`,g.size?` (${g.size})`:``]}),(0,M.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,M.jsx)(o,{name:`download`}),`Export improvements`]})]})]}),m?(0,M.jsx)(`p`,{className:`sub mb-14`,children:m}):null,A.length?(0,M.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
3
- `),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&N.length===0?(0,M.jsx)(S,{title:`In sync`,children:`Deployed harness matches source.`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`row between mb-14`,children:[(0,M.jsxs)(`div`,{className:`row gap-10`,children:[(0,M.jsxs)(`span`,{className:`badge warn`,children:[(0,M.jsx)(`span`,{className:`dot`}),P,` edited`]}),(0,M.jsxs)(`span`,{className:`badge`,children:[(0,M.jsx)(`span`,{className:`dot`}),F,` added`]}),I>0&&(0,M.jsxs)(`span`,{className:`badge bad`,children:[(0,M.jsx)(`span`,{className:`dot`}),I,` missing`]}),N.length>0&&(0,M.jsxs)(`span`,{className:`badge`,children:[(0,M.jsx)(`span`,{className:`dot`}),N.length,` behind`]})]}),(0,M.jsxs)(`div`,{className:`row gap-10`,children:[(0,M.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(c.files.map(e=>e.rel))),children:`Expand all`}),(0,M.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),k.length?(0,M.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:g.size===k.length,onChange:E}),`Select all`]}):null]})]}),(0,M.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>R(e,!0))}),N.length?(0,M.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,M.jsx)(`h3`,{children:`Behind source`}),(0,M.jsxs)(`div`,{className:`row between`,children:[(0,M.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,M.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),N.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=b.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,M.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,M.jsxs)(`div`,{className:`diff-head`,children:[t?(0,M.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:g.has(e.rel),onChange:()=>T(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,M.jsx)(`span`,{className:`fname`,children:e.rel}),(0,M.jsxs)(`span`,{className:`badge ${r}`,children:[(0,M.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,M.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,M.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,M.jsx)(o,{name:`chevron`})})]}),n&&(0,M.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,M.jsx)(`div`,{className:`diff-line ${U(e)}`,children:e},t))})]},e.rel)}}function K({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,j.useState)(!n);return(0,M.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,M.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,M.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,M.jsx)(`h3`,{children:e.label}),(0,M.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,M.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,M.jsx)(o,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,M.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,M.jsxs)(`div`,{className:`problem`,children:[(0,M.jsx)(`span`,{className:`x`,children:`✕`}),(0,M.jsx)(`span`,{children:e})]},e))})]})}function q({dataRev:e}){let t=(0,j.useRef)(!1),{data:n,error:i,reload:a,setData:s}=y(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),a()};if(i)return(0,M.jsx)(d,{error:i,onRetry:a});let l=n?n.groups.filter(e=>e.problems.length):[],u=n?n.groups.filter(e=>!e.problems.length):[];return(0,M.jsxs)(`div`,{className:`narrow`,children:[(0,M.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,M.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,M.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,M.jsx)(o,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,M.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,M.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,M.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,M.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,M.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,M.jsxs)(`span`,{className:`badge ok`,children:[(0,M.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,M.jsxs)(`span`,{className:`badge bad`,children:[(0,M.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,M.jsxs)(`div`,{className:`stack gap-12`,children:[l.map((e,t)=>(0,M.jsx)(K,{group:e,i:t},e.label)),u.length?(0,M.jsxs)(`details`,{className:`check-fold`,children:[(0,M.jsxs)(`summary`,{children:[u.length,` clean check`,u.length===1?``:`s`]}),(0,M.jsx)(`div`,{className:`stack gap-12`,children:u.map((e,t)=>(0,M.jsx)(K,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,M.jsx)(v,{label:`Running every check (builds each theme in a sandbox)…`})]})}function J(){let e=a(),[t,n]=(0,j.useState)(!1),[i,s]=(0,j.useState)(!1),[l,u]=(0,j.useState)(null);return t?(0,M.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,M.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(d,{error:l}),(0,M.jsxs)(`div`,{className:`row`,children:[(0,M.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){s(!0),u(null);try{await c()}catch(e){u(e.message),s(!1)}}},disabled:i,children:[(0,M.jsx)(o,{name:`refresh`}),i?`Restarting…`:`Restart server`]}),(0,M.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){u(null);try{await r.shutdown()}catch(e){if(e.status)return u(e.message)}n(!0)}},disabled:i,children:[(0,M.jsx)(o,{name:`x`}),`Stop server`]})]})]})}var Y=`https://github.com/Arylmera/Geneseed`,X=`https://github.com/Arylmera`;function Z(){let[e,t]=(0,j.useState)(Y),[n,i]=(0,j.useState)(!0);return(0,j.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(t(e.repo),i(!!e.repo_is_github))}).catch(()=>{})},[]),(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`About`})}),(0,M.jsx)(`p`,{className:`sub mb-16`,children:`Geneseed is a portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices, MIT-licensed.`}),(0,M.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,M.jsxs)(`a`,{className:`btn ghost`,href:e,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(o,{name:`github`}),n?`Source on GitHub`:`Source repo`]}),n&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`a`,{className:`btn ghost`,href:e+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(o,{name:`external`}),`Issues`]}),(0,M.jsxs)(`a`,{className:`btn ghost`,href:e+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(o,{name:`external`}),`MIT License`]})]})]})]}),(0,M.jsxs)(`div`,{className:`card pad-lg`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`Creator`})}),(0,M.jsxs)(`p`,{className:`sub mb-16`,children:[`Geneseed is built by `,(0,M.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. Implant it once, and a disciplined agent grows around the same inherited rules, skills, and memory in every repo it follows you into.`]}),(0,M.jsx)(`p`,{className:`sub mb-16`,children:`If you find this useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`}),(0,M.jsx)(`div`,{className:`row wrap gap-10`,children:(0,M.jsxs)(`a`,{className:`btn ghost`,href:X,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(o,{name:`github`}),`@Arylmera on GitHub`]})})]})]})}function Q({overview:e,onAction:t,flavour:n,onFlavour:r,accentMode:s,onAccentMode:c,layout:d,onLayout:f}){let p=a(),v=e?.install,y=e?.footprint,b=async e=>{v&&e!==y&&await p(`Rebuild ${l(v.host).label} · ${v.scope} with the “${e}” footprint? It rebuilds in place, non-destructive.`,{title:`Change the footprint?`,confirmLabel:`Rebuild`})&&t?.(`install`,{...v,footprint:e})};return(0,M.jsxs)(`div`,{className:`narrow-lg`,children:[(0,M.jsx)(`div`,{className:`head-row mb-18`,children:(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`h2`,{className:`h`,children:i.server}),(0,M.jsx)(`p`,{className:`sub`,children:`Console appearance, the footprint of the install you are viewing, machine maintenance (including the update), server control, and about. Each install is managed on the Hosts tab.`})]})}),n&&r&&(0,M.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`Console direction`})}),(0,M.jsxs)(`p`,{className:`sub mb-16`,children:[g.length,` takes on the same data. Pick a direction; it applies instantly and persists across reloads.`]}),s&&c&&(0,M.jsxs)(`div`,{className:`dir-layout`,children:[(0,M.jsx)(`span`,{className:`tick`,id:`dir-accent-label`,children:`Accent`}),(0,M.jsx)(_,{value:s,onChange:c,labelledBy:`dir-accent-label`}),(0,M.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:m(s)})]}),d&&f&&(0,M.jsxs)(`div`,{className:`dir-layout`,children:[(0,M.jsx)(`span`,{className:`tick`,id:`dir-layout-label`,children:`Overview view`}),(0,M.jsx)(u,{"aria-labelledby":`dir-layout-label`,children:h.map(e=>(0,M.jsx)(`button`,{className:d===e.id?`on`:``,onClick:()=>f(e.id),"aria-pressed":d===e.id,title:e.tagline,children:e.short},e.id))}),(0,M.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:h.find(e=>e.id===d)?.tagline??``})]}),(0,M.jsx)(`div`,{className:`dir-grid`,children:g.map(e=>(0,M.jsxs)(`button`,{className:`dir-tile dir-${e.id} ${n===e.id?`on`:``}`,onClick:()=>r(e.id),"aria-pressed":n===e.id,children:[(0,M.jsxs)(`span`,{className:`dir-thumb`,"aria-hidden":`true`,children:[(0,M.jsx)(`span`,{className:`dir-thumb-rail`}),(0,M.jsx)(`span`,{className:`dir-thumb-bar`}),(0,M.jsx)(`span`,{className:`dir-thumb-bar w70`}),(0,M.jsx)(`span`,{className:`dir-thumb-bar w52`}),(0,M.jsx)(`span`,{className:`dir-thumb-dot`})]}),(0,M.jsxs)(`span`,{className:`dir-meta`,children:[(0,M.jsxs)(`span`,{className:`dir-name`,children:[e.short,n===e.id&&(0,M.jsx)(`span`,{className:`dir-check`,children:`● active`})]}),(0,M.jsx)(`span`,{className:`dir-tag`,children:e.tagline})]})]},e.id))})]}),v&&y&&(0,M.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`Harness footprint`})}),(0,M.jsxs)(`p`,{className:`sub mb-16`,children:[`How much of the Rules `,(0,M.jsx)(`code`,{children:`AGENT.md`}),` carries inline each turn, for the current install (`,(0,M.jsxs)(`code`,{children:[l(v.host).label,` · `,v.scope]}),`). A token-cost dial; every Rule stays in force either way. Changing it rebuilds the install in place. `,(0,M.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),(0,M.jsxs)(`div`,{className:`dir-layout`,children:[(0,M.jsx)(`span`,{className:`tick`,id:`footprint-label`,children:`Footprint`}),(0,M.jsx)(u,{"aria-labelledby":`footprint-label`,children:[`lean`,`full`].map(e=>(0,M.jsx)(`button`,{className:y===e?`on`:``,onClick:()=>b(e),"aria-pressed":y===e,children:e},e))}),(0,M.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:y===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,M.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`Maintenance`})}),(0,M.jsxs)(`p`,{className:`sub mb-16`,children:[`Update this Geneseed copy, or add `,(0,M.jsx)(`code`,{children:`geneseed`}),` to your PATH (or remove it) so it runs from any directory. Each runs live in the console.`]}),(0,M.jsxs)(`p`,{className:`sub mb-16`,children:[`Each install has its own Uninstall in `,(0,M.jsx)(`a`,{href:`#/installs`,children:`Hosts`}),`.`]}),(0,M.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,M.jsxs)(`button`,{className:`btn`,onClick:()=>t(`update`),children:[(0,M.jsx)(o,{name:`download`}),`Update (git pull + rebuild)`]}),(0,M.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,M.jsx)(o,{name:`external`}),`Add to PATH`]}),(0,M.jsx)(`button`,{className:`btn ghost`,onClick:()=>t(`unlink`),children:`Remove from PATH`})]})]}),(0,M.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,M.jsx)(`div`,{className:`card-head`,children:(0,M.jsx)(`h3`,{children:`Server`})}),(0,M.jsx)(`p`,{className:`sub mb-16`,children:`The console runs a small local server. Leave it running in the background and reopen any time, or stop it when you are done.`}),(0,M.jsx)(J,{})]}),(0,M.jsx)(Z,{})]})}function $({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:s={}}){let c=t?.doctor,l=t?.diff,u={edits:l?p(l):null,doctor:c?c.ok?`clean`:c.problems.length:null};return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(b,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,M.jsx)(C,{page:`installs`,current:e,badges:u,label:`Installs`}),e===`hosts`&&(0,M.jsx)(V,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,M.jsx)(H,{onAction:i,dataRev:o}),e===`edits`&&(0,M.jsx)(G,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,M.jsx)(q,{dataRev:o}),e===`server`&&(0,M.jsx)(Q,{overview:t,onAction:i,...s})]})}export{$ as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{t as i}from"./drawable-r1qCgRMK.js";import{n as a}from"./sections-ChwaobfW.js";import{At as o,Ct as s,Dt as c,Et as l,Ft as u,G as d,K as f,Mt as p,Nt as m,Ot as h,St as g,Tt as _,_t as v,b as y,bt as b,ct as x,dt as S,et as C,ft as w,gt as T,ht as E,it as D,lt as O,mt as k,pt as A,q as j,rt as M,st as N,ut as P,vt as F,wt as I,xt as L,yt as R}from"./index-osXUqzdX.js";import{n as z}from"./Dashboard-B5-wUlXC.js";function B(e){return b((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=s(e.duration)&&e.duration<=1e-11?n-m:n;t.composition&&v(t,o,1,1,u.AUTO);let c=r?new P(r,e,t,o,!1,i,a):new k(e,t,o);return t.composition&&c.init(!0),R(t,c),L(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends k{constructor(e={}){super(e,null,0),++H,this.id=l(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=o.defaults;this.defaults=t?c(t,n):n,this.composition=F(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=F(e.playbackEase,n.playbackEase);this._ease=r?w(r):null,this.iterationDuration=0}add(e,t,n){let r=I(t),i=I(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=o.editor&&o.editor.addTimelineChild,a=n&&n.type===`Stagger`&&o.editor,s=g(n)?n:null;if(s||a){let t=A(e),a=this.duration,c=this.iterationDuration,u=r.id,d=0,f=t.length,p=i?i(e,r,this.id,n,f):null,m=s||o.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...p||r};this.duration=a,this.iterationDuration=c,l(u)||(n.id=u+`-`+d);let i=O(this,m(e,d,t,null,this));V(n,this,i,e,d,t),d++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,O(this,a),e)}}else V(e,this,O(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(l(e)||e&&l(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!l(e)&&!l(e.persist)&&(e.persist=!0);let r=o.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return l(t)?this:(t.duration=m,t.composition=p.replace,this.add(e,t,n))}call(e,t){return l(e)||e&&!g(e)?this:(o.editor&&o.editor.addTimelineCall&&(t=o.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return l(e)||e&&!_(e)?this:(o.editor&&o.editor.addTimelineLabel&&(t=o.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=O(this,t),this)}remove(e,t){return E(A(e),this,t),this}stretch(e){let t=this.duration;if(t===h(e))return this;let n=e/t,r=this.labels;L(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return L(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),L(this,e=>e.revert,!0),T(this)}then(e){return super.then(e)}},W=e=>o.editor?o.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(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,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>C(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),C(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=j(()=>r.catalog(`laws`),[t],`catalog:laws`),a=n?.items??null,o=n?.nouns?.ontology||`Ethos`,s=n?.nouns?.laws||`Dictates`,c=n?.nouns?.doctrines||`Doctrines`,l=(0,G.useRef)(null),u=(0,G.useRef)(!0),d=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=l.current;if(!e||Z||!M())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),a=t(`[data-cm="gov"]`),o=t(`.cm-edge-gov`),s=t(`.cm-note, .cm-govern-label`),c=i(t(`.cm-edge`));x([...n,...r,...a],{opacity:0,scale:.7}),x([...o,...s],{opacity:0}),x(c,{draw:`0 0`});let f=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(c,{draw:`0 1`,duration:380,delay:N(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:N(70)},260).add(o,{opacity:1,duration:300,delay:N(50)},420).add(a,{opacity:1,scale:1,duration:380,delay:N(50)},470).add(s,{opacity:1,duration:300},520);u.current=!1;let p=()=>f.complete(),m=()=>{f.play(),p=D(f,ee),u.current=!0,d.current?.()};if(typeof IntersectionObserver>`u`)return m(),()=>p();let h=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(h.disconnect(),m())},{threshold:.33});return h.observe(e),()=>{h.disconnect(),u.current=!0,p()}},[]);let p=e?.counts||{},m=f(p),h=[];for(let e of(a||[]).filter(e=>e.tier===`doctrine`)){let t=h.find(t=>t.id===e.pack);t||h.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let g=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,_={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${m} rules in force`,size:10,dy:8},{t:g,size:8.5,dy:24}],12)},v={x:126,y:95,r:Y([{t:o,size:12.5,dy:-7},{t:`${p.ontology??0} sections`,size:10,dy:10}],11)},b={x:560,y:78,r:Y([{t:s,size:12.5,dy:-6},{t:`${p.laws??0}`,size:13,dy:12}],11)},C={x:560,y:252,r:Y([{t:c,size:12.5,dy:-6},{t:`${p.doctrines?.rules??0}`,size:13,dy:12}],11)},w=(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)}),T=[{...w(812,52,`Skills`,p.skills??0),hash:`#/skills`,from:b},{...w(820,126,`Agents`,p.agents??0),hash:`#/agents`,from:b},{...w(816,232,`Memory`,p.memory??0),hash:`#/section/memory`,from:C},{...w(812,300,`Wiki`,p.wiki??0),hash:`#/section/wiki`,from:C}],E={rx:122,ry:68,from:212,to:112},O=h.map((e,t)=>{let n=(h.length===1?(E.from+E.to)/2:E.from+(E.to-E.from)*t/(h.length-1))*Math.PI/180;return{...e,x:C.x+E.rx*Math.cos(n),y:C.y+E.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),k=O.length;return(0,G.useLayoutEffect)(()=>{let e=l.current;if(!e||!k||Q||!M())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];x(t,{opacity:0,scale:.5});let n=()=>x(t,{opacity:1,scale:1}),r=()=>{d.current=null;let e=S(t,{opacity:1,scale:1,duration:380,delay:N(45,{start:420}),ease:`outExpo`});n=D(e,420+45*k+380)};return u.current?r():d.current=r,()=>{d.current=null,n()}},[k]),(0,K.jsxs)(`svg`,{ref:l,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(_,v,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(_,b,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(_,C,.07),className:`cm-edge`}),T.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${m} rules in force`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:_.x,y:_.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[m,` rules in force`]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+24,textAnchor:`middle`,className:`cm-note`,children:g})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${p.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsxs)(`text`,{x:v.x,y:v.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[p.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:v.x,y:v.y+v.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${p.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:b.x,cy:b.y,r:b.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:b.x,y:b.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:b.x,y:b.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:p.laws??0})]}),(0,K.jsx)(`text`,{x:b.x,y:b.y+b.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${c}: ${p.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:C.x,cy:C.y,r:C.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:C.x,y:C.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:c}),(0,K.jsx)(`text`,{x:C.x,y:C.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:p.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:C.x+22,y:C.y+C.r+20,className:`cm-note`,children:p.doctrines?`chosen at build · ${p.doctrines.active}/${p.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:O.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:y(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:y(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),T.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:v.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:a.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:f(e),hash:`#/laws`},{label:a.agents.label,n:e.agents??0,hash:`#/agents`},{label:a.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:a.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:a.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:a.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>C(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>C(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:d(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${d(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>C(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>C(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};