geneseed 6.0.2 → 6.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/DESIGN.md +1 -1
  3. package/SHIPPED.md +1 -1
  4. package/adapters/opencode/plugins/geneseed-context.js +11 -10
  5. package/adapters/opencode/plugins/geneseed-learn.js +24 -8
  6. package/bin/geneseed-hook.mjs +5 -0
  7. package/docs/concepts/hooks.md +6 -6
  8. package/docs/guides/install-scripted.md +1 -1
  9. package/docs/reference/env-context.md +2 -1
  10. package/docs/reference/plugin-activity.md +1 -1
  11. package/docs/reference/profiles.md +1 -0
  12. package/docs/understand/a-day.md +1 -1
  13. package/docs/understand/machine-claude.md +1 -1
  14. package/docs/web-ui.md +27 -2
  15. package/harness.config.json +1 -1
  16. package/js/build/args.mjs +4 -3
  17. package/js/build/bundle.mjs +2 -11
  18. package/js/build/driver.mjs +8 -8
  19. package/js/build/emit-claude.mjs +59 -4
  20. package/js/build/fold.mjs +3 -20
  21. package/js/build/generate.mjs +11 -2
  22. package/js/build/profile.mjs +10 -5
  23. package/js/build/render.mjs +3 -1
  24. package/js/build/source.mjs +12 -1
  25. package/js/build/stubs.mjs +42 -5
  26. package/js/cli-table.json +37 -0
  27. package/js/hosts/hooks-context.mjs +9 -8
  28. package/js/hosts/hooks-learn.mjs +435 -55
  29. package/js/hosts/installs.mjs +22 -2
  30. package/js/hosts/memory-files.mjs +249 -13
  31. package/js/hosts/native.mjs +23 -1
  32. package/js/hosts/settings.mjs +77 -4
  33. package/js/inspect/diff.mjs +3 -1
  34. package/js/inspect/doctor.mjs +37 -1
  35. package/js/inspect/status.mjs +40 -4
  36. package/js/inspect/validate.mjs +1 -1
  37. package/js/lib/proc.mjs +36 -0
  38. package/js/maintain/memory.mjs +2 -2
  39. package/js/maintain/profiles.mjs +15 -4
  40. package/js/maintain/setup.mjs +31 -7
  41. package/js/maintain/update.mjs +1 -1
  42. package/js/web/actions.mjs +5 -3
  43. package/js/web/api.mjs +2 -2
  44. package/js/web/catalog.mjs +5 -3
  45. package/js/web/profiles-api.mjs +2 -2
  46. package/js/web/state.mjs +13 -2
  47. package/package.json +1 -1
  48. package/src/AGENT.md.tmpl +1 -1
  49. package/src/agents/memory-curator.md +4 -1
  50. package/src/doctrines/process.md +2 -2
  51. package/src/memory/README.md +45 -6
  52. package/src/skills/rule/approve.md +3 -1
  53. package/src/skills/rule/consolidate.md +1 -1
  54. package/src/skills/rule.md +9 -5
  55. package/web/dist/assets/ActiveLoops-paFbiZyt.js +1 -0
  56. package/web/dist/assets/Activity-BsMFA5Aa.js +1 -0
  57. package/web/dist/assets/ActivityDetail-C66n3oul.js +1 -0
  58. package/web/dist/assets/{Bonsai-Bry-kOFb.js → Bonsai-BCd-qt7W.js} +1 -1
  59. package/web/dist/assets/{CopyButton-Cnnvjgkg.js → CopyButton-Dpl0PFja.js} +1 -1
  60. package/web/dist/assets/Dashboard-CQxdiv7F.js +2 -0
  61. package/web/dist/assets/{Docs-BJ23-fIx.js → Docs-D0XlXuiA.js} +2 -2
  62. package/web/dist/assets/Factories-CPVBoWoA.js +1 -0
  63. package/web/dist/assets/{GreenhouseView-VL_ZKJUR.js → GreenhouseView-C_2auUA8.js} +1 -1
  64. package/web/dist/assets/Installs-CXqjmqms.js +3 -0
  65. package/web/dist/assets/JournalView-S-igd-Nv.js +1 -0
  66. package/web/dist/assets/{Kits-DDSerkJk.js → Kits-K6mu91rm.js} +1 -1
  67. package/web/dist/assets/Laws-j5vKNwLT.js +4 -0
  68. package/web/dist/assets/{LibRows-QsUBjOF7.js → LibRows-1yTY0Kwn.js} +1 -1
  69. package/web/dist/assets/Library-BQZnFdWs.js +3 -0
  70. package/web/dist/assets/Loops-B5DgxpLm.js +2 -0
  71. package/web/dist/assets/Models-C-4Y4jvx.js +1 -0
  72. package/web/dist/assets/{OperatorHudView-Bdupodlc.js → OperatorHudView-_8NBAvkd.js} +1 -1
  73. package/web/dist/assets/Personal-Bf7zHDc6.js +2 -0
  74. package/web/dist/assets/Settings-BTrA6MXv.js +1 -0
  75. package/web/dist/assets/Tabs-BDhZImxa.js +1 -0
  76. package/web/dist/assets/controls-CREglcUF.js +1 -0
  77. package/web/dist/assets/index-9iBqq7i2.css +1 -0
  78. package/web/dist/assets/index-BiKWWv7Z.js +6 -0
  79. package/web/dist/assets/router-1EhRJy1C.js +1 -0
  80. package/web/dist/assets/useLocalStorage-54tkqXN7.js +1 -0
  81. package/web/dist/index.html +4 -2
  82. package/web/dist/assets/ActiveLoops-BWkImeYa.js +0 -1
  83. package/web/dist/assets/Activity-DJlPhk8q.js +0 -1
  84. package/web/dist/assets/ActivityDetail-Dk7UPnE_.js +0 -1
  85. package/web/dist/assets/Dashboard-CWhh_GSc.js +0 -2
  86. package/web/dist/assets/Factories-CjsIACyi.js +0 -1
  87. package/web/dist/assets/Installs-qcfOZNzF.js +0 -3
  88. package/web/dist/assets/JournalView-KrmFUC-X.js +0 -1
  89. package/web/dist/assets/Laws-DDffPs6O.js +0 -4
  90. package/web/dist/assets/Library-DzT3Mebh.js +0 -3
  91. package/web/dist/assets/Loops-CjsX3brz.js +0 -2
  92. package/web/dist/assets/Models-DPrAv3FG.js +0 -1
  93. package/web/dist/assets/Personal-D-dpCUU5.js +0 -2
  94. package/web/dist/assets/Settings-Dz33_Sys.js +0 -1
  95. package/web/dist/assets/Tabs-qY40S34V.js +0 -1
  96. package/web/dist/assets/controls-CK7qHA8H.js +0 -1
  97. package/web/dist/assets/index-BhT94v2q.js +0 -6
  98. package/web/dist/assets/index-DcusoHzF.css +0 -1
  99. package/web/dist/assets/usePoll-D5c_qIFZ.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{i as r}from"./router-1EhRJy1C.js";import{n as i}from"./sections-CtFz7HFH.js";import{At as a,C as o,Mt as s,Nt as c,Ot as l,Pt as u,kt as d}from"./index-BiKWWv7Z.js";import{A as f,B as p,C as m,E as h,F as g,H as _,K as v,M as y,N as b,O as x,P as S,U as C,_ as w,a as T,d as ee,f as E,g as D,h as O,i as k,j as A,l as j,n as M,p as N,r as P,u as F,v as I,w as L,x as R}from"./motion-RlUl1osO.js";import{t as z}from"./api-C8nMUU1i.js";import{n as B}from"./Dashboard-CQxdiv7F.js";function V(e){return L((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function H(e,t,n,r,i,a){let o=f(e.duration)&&e.duration<=1e-11?n-C:n;t.composition&&I(t,o,1,1,v.AUTO);let s=r?new F(r,e,t,o,!1,i,a):new O(e,t,o);return t.composition&&s.init(!0),m(t,s),h(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=V(t),t}var U=0,W=class extends O{constructor(e={}){super(e,null,0),++U,this.id=b(e.id)?U:e.id,this.duration=0,this.labels={};let t=e.defaults,n=p.defaults;this.defaults=t?S(t,n):n,this.composition=R(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=R(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=A(t),i=A(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=p.editor&&p.editor.addTimelineChild,a=n&&n.type===`Stagger`&&p.editor,o=x(n)?n:null;if(o||a){let t=N(e),a=this.duration,s=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,m=o||p.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=s,b(c)||(n.id=c+`-`+l);let i=u(this,m(e,l,t,null,this));H(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;H(t,this,u(this,a),e)}}else H(e,this,u(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(b(e)||e&&b(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!b(e)&&!b(e.persist)&&(e.persist=!0);let r=p.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 b(t)?this:(t.duration=C,t.composition=_.replace,this.add(e,t,n))}call(e,t){return b(e)||e&&!x(e)?this:(p.editor&&p.editor.addTimelineCall&&(t=p.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return b(e)||e&&!y(e)||(p.editor&&p.editor.addTimelineLabel&&(t=p.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=u(this,t)),this}remove(e,t){return D(N(e),this,t),this}stretch(e){let t=this.duration;if(t===g(e))return this;let n=e/t,r=this.labels;h(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return h(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),h(this,e=>e.revert,!0),w(this)}then(e){return super.then(e)}},G=e=>p.editor?p.editor.addTimeline(e):new W(e).init(),K=e(t(),1),q=n(),J=.62,te=(e,t)=>String(e).length*t*J;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=te(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ne=M[8]+M[7];function $({hash:e,label:t,part:n,children:i}){return(0,q.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>r(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r(e))},children:i})}function re({overview:e,dataRev:t}){let{data:n}=a(()=>z.catalog(`laws`),[t],`catalog:laws`),r=n?.items??null,i=n?.nouns?.ontology||`Ethos`,l=n?.nouns?.laws||`Dictates`,u=n?.nouns?.doctrines||`Doctrines`,f=(0,K.useRef)(null),p=(0,K.useRef)(!0),m=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=f.current;if(!e||Z||!k())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),l=s(t(`.cm-edge`));j([...n,...r,...i],{opacity:0,scale:.7}),j([...a,...o],{opacity:0}),j(l,{draw:`0 0`});let u=G({autoplay:!1,defaults:{ease:P}}).add(n,{opacity:1,scale:1,duration:M[7]},0).add(l,{draw:`0 1`,duration:M[7],delay:c(M[1])},M[3]).add(r,{opacity:1,scale:1,duration:M[7],delay:c(M[1])},M[5]).add(a,{opacity:1,duration:M[6],delay:c(M[1])},M[7]).add(i,{opacity:1,scale:1,duration:M[7],delay:c(M[1])},M[8]).add(o,{opacity:1,duration:M[6]},M[8]);p.current=!1;let d=()=>u.complete(),h=()=>{u.play(),d=T(u,ne),p.current=!0,m.current?.()};if(typeof IntersectionObserver>`u`)return h(),()=>d();let g=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(g.disconnect(),h())},{threshold:.33});return g.observe(e),()=>{g.disconnect(),p.current=!0,d()}},[]);let h=e?.counts||{},g=d(h),_=[];for(let e of(r||[]).filter(e=>e.tier===`doctrine`)){let t=_.find(t=>t.id===e.pack);t||_.push(t={id:e.pack,n:0}),t.n+=1}let v=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,y={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${g} rules`,size:10,dy:8},{t:v,size:8.5,dy:24}],12)},b={x:126,y:95,r:Y([{t:i,size:12.5,dy:-7},{t:`${h.ontology??0} sections`,size:10,dy:10}],11)},x={x:560,y:78,r:Y([{t:l,size:12.5,dy:-6},{t:`${h.laws??0}`,size:13,dy:12}],11)},S={x:560,y:252,r:Y([{t:u,size:12.5,dy:-6},{t:`${h.doctrines?.rules??0}`,size:13,dy:12}],11)},C=(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)}),w=[{...C(812,52,`Skills`,h.skills??0),hash:`#/skills`,from:x},{...C(820,126,`Agents`,h.agents??0),hash:`#/agents`,from:x},{...C(816,232,`Memory`,h.memory??0),hash:`#/personal/memory`,from:S},{...C(812,300,`Wiki`,h.wiki??0),hash:`#/section/wiki`,from:S}],E={rx:122,ry:68,from:212,to:112},D=_.map((e,t)=>{let n=(_.length===1?(E.from+E.to)/2:E.from+(E.to-E.from)*t/(_.length-1))*Math.PI/180;return{...e,x:S.x+E.rx*Math.cos(n),y:S.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)}}),O=D.length;return(0,K.useLayoutEffect)(()=>{let e=f.current;if(!e||!O||Q||!k())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];j(t,{opacity:0,scale:.5});let n=()=>j(t,{opacity:1,scale:1}),r=()=>{m.current=null;let e=ee(t,{opacity:1,scale:1,duration:M[7],delay:c(M[1],{start:M[7]}),ease:P});n=T(e,M[7]+M[1]*O+M[7])};return p.current?r():m.current=r,()=>{m.current=null,n()}},[O]),(0,q.jsxs)(`svg`,{ref:f,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,q.jsx)(`path`,{d:X(y,b,.05),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(y,x,-.07),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(y,S,.07),className:`cm-edge`}),w.map(e=>(0,q.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,q.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${g} rules`,children:[(0,q.jsx)(`circle`,{cx:y.x,cy:y.y,r:y.r,className:`cm-hub-disc`}),(0,q.jsx)(`text`,{x:y.x,y:y.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,q.jsxs)(`text`,{x:y.x,y:y.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[g,` rules`]}),(0,q.jsx)(`text`,{x:y.x,y:y.y+24,textAnchor:`middle`,className:`cm-note`,children:v})]}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${i}: ${h.ontology??0} sections`,children:[(0,q.jsx)(`circle`,{cx:b.x,cy:b.y,r:b.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:b.x,y:b.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:i}),(0,q.jsxs)(`text`,{x:b.x,y:b.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[h.ontology??0,` sections`]})]}),(0,q.jsx)(`text`,{x:b.x,y:b.y+b.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${l}: ${h.laws??0}, never broken`,children:[(0,q.jsx)(`circle`,{cx:x.x,cy:x.y,r:x.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:x.x,y:x.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:l}),(0,q.jsx)(`text`,{x:x.x,y:x.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:h.laws??0})]}),(0,q.jsx)(`text`,{x:x.x,y:x.y+x.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${u}: ${h.doctrines?.rules??0} rules`,children:[(0,q.jsx)(`circle`,{cx:S.x,cy:S.y,r:S.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:S.x,y:S.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:u}),(0,q.jsx)(`text`,{x:S.x,y:S.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:h.doctrines?.rules??0})]}),(0,q.jsx)(`text`,{x:S.x+22,y:S.y+S.r+20,className:`cm-note`,children:h.doctrines?`${h.doctrines.active}/${h.doctrines.total} packs built in`:`packs chosen at build`}),(0,q.jsx)(`g`,{className:`cm-mini`,children:D.map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:o(e.id)}}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,q.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:o(e.id)},children:e.n})]},e.id))}),(0,q.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),w.map(e=>(0,q.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,q.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,q.jsx)(`text`,{x:b.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ie({counts:e}){let t=[{label:i.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules`,n:d(e),hash:`#/laws`},{label:i.agents.label,n:e.agents??0,hash:`#/agents`},{label:i.memory.label,n:e.memory??0,hash:`#/personal/memory`},{label:i.notebook.label,n:e.notebook??0,hash:`#/personal/notebook`},{label:i.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:i.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Growth rings`}),(0,q.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,q.jsxs)(`button`,{className:`jr-ring`,onClick:()=>r(e.hash),children:[(0,q.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,q.jsx)(`span`,{className:`jr-ring-track`,children:(0,q.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,q.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ae({recent:e,buildEpoch:t}){let n=e?.items||[],i=e?.skipped||[];return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Freshly grown`}),(0,q.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,q.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,q.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>r(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,q.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,q.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,q.jsx)(`span`,{className:`jr-fresh-when`,children:l(e.mtime)})]},`${e.section}:${e.name}`)):(0,q.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),i.length>0&&(0,q.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,i.join(`, `),` — too many files to stat on every load.`]}),(0,q.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${l(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>r(`#/activity`),children:`log →`})]})]})}function oe({overview:e,recent:t,lens:n,dataRev:i}){let a=e?.counts||{};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`jr-head`,children:(0,q.jsx)(B,{verdict:n?.verdict})}),(0,q.jsxs)(`div`,{className:`jr-row2`,children:[(0,q.jsx)(ie,{counts:a}),(0,q.jsx)(ae,{recent:t,buildEpoch:e?.build_epoch})]}),(0,q.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,q.jsx)(`button`,{className:`jr-go right`,onClick:()=>r(`#/laws`),children:`open →`})]}),(0,q.jsx)(re,{overview:e,dataRev:i})]})]})}export{oe as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{H as i,Q as a,Z as o,at as s,et as c,mt as l,tt as u,wt as d,z as f}from"./index-BhT94v2q.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{t as m}from"./Markdown-CxkA7940.js";import{t as h}from"./DataTable-b9zTShqJ.js";import{i as g}from"./controls-CK7qHA8H.js";var _=e(t(),1),v=e=>e.kits||[],y=e=>!e.editable||e.state===`unreadable`;function b(e,t){let n=s(),r=a(),i=e=>{let t=r.get(`kits`,e.id);return t&&t.base===o(v(e))?t:null},{prune:c}=r;(0,_.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,o(v(e))]));c(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,c]);let u=e=>i(e)?.value??new Set(v(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),r.put(`kits`,e.id,n,o(v(e)))},f=e=>{let t=u(e),n=new Set(v(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},p=e=>r.running(`kits`,e.id)||!!i(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let i=[...u(e)],a=`Rebuild ${l(e)} with kits: ${i.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(a,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:i})&&r.startApply(`kits`,e.id)},running:p,failed:e=>!!i(e)?.failed,discard:e=>{p(e)||r.drop(`kits`,e.id)},busy:r.busy}}var x=n();function S(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function C({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,x.jsxs)(`div`,{className:`kit-foot`,children:[(0,x.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:S(e,t)}),(0,x.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${l(e)}`,disabled:y(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var w={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},T=({row:e})=>{let[t,n]=w[e.state]||[e.state||`Unknown`,``];return(0,x.jsx)(`span`,{className:`tag ${n}`,children:t})},E=encodeURIComponent,D=e=>(e||``).split(/\s+/).filter(Boolean).length,O=e=>[...new Set(e.filter(Boolean))],k=e=>(e||``).slice(0,7),A=(e,t)=>e?`On in ${e} of ${N(t,`install`)}`:`Installed when this kit is on`,j=({type:e,names:t,listed:n,offNote:r=A(0)})=>t.length?(0,x.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,x.jsx)(`li`,{children:n?.has(t)?(0,x.jsx)(`a`,{href:`#/item/${e}/${E(t)}`,children:t}):(0,x.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,x.jsx)(`p`,{className:`panel-note`,children:`None.`});function M({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=A(t.filter(t=>v(t).includes(e.name)).length,t.length);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`reader-tags`,children:[(0,x.jsx)(`span`,{className:`tag acc`,children:`Kit`}),O(i.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,x.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,x.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,x.jsx)(`hr`,{className:`hr`}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,x.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=y(t),i=l(t);return(0,x.jsxs)(`li`,{className:`kit-install`,children:[(0,x.jsxs)(`div`,{className:`kit-row`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:i}),(0,x.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,x.jsx)(T,{row:t}),(0,x.jsx)(g,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,x.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,x.jsx)(C,{row:t,stage:n})]},t.id)})}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,x.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,x.jsxs)(_.Fragment,{children:[(0,x.jsx)(`dt`,{children:e.author||e.repo}),(0,x.jsxs)(`dd`,{children:[(0,x.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,x.jsxs)(`span`,{className:`mono dim`,children:[`@ `,k(e.commit)]}):null,e.compareUrl?(0,x.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${k(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,x.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,x.jsx)(j,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,x.jsx)(j,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,x.jsxs)(`span`,{className:`mono dim`,children:[D(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,x.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,x.jsx)(m,{body:e.rules})})]}):null,e.banned?.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,x.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var N=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,P=l;function F(e,t,n){let r=v(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function I({kit:e,installs:t,stage:n,listed:r,max:i}){let a=e.credits||[],o=e.skills||[],s=e.agents||[],c=t.map(t=>({row:t,...F(n,t,e.name)})),l=c.filter(t=>v(t.row).includes(e.name)).length,u=c.filter(e=>e.staged).length,d=A(l,t.length),p=`on in ${l} of ${N(t.length,`install`)}${u?` · ${u} staged`:``}`;return(0,x.jsxs)(`article`,{className:`kit-card${u?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,x.jsxs)(`header`,{className:`kit-card-head`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,x.jsx)(`a`,{className:`kit-name`,href:`#/kits/${E(e.name)}`,children:e.name})}),e.description?(0,x.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),O(a.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsxs)(`div`,{className:`kit-counts`,children:[(0,x.jsx)(`span`,{children:`Skills`}),(0,x.jsx)(f,{value:o.length,max:i,label:`Skills`}),(0,x.jsx)(`span`,{className:`mono`,children:o.length}),(0,x.jsx)(`span`,{children:`Agents`}),(0,x.jsx)(f,{value:s.length,max:i,label:`Agents`}),(0,x.jsx)(`span`,{className:`mono`,children:s.length})]}),o.length?(0,x.jsx)(j,{type:`skill`,names:o,listed:r?.skills,offNote:d}):null,s.length?(0,x.jsx)(j,{type:`agent`,names:s,listed:r?.agents,offNote:d}):null,(0,x.jsxs)(`footer`,{className:`kit-card-foot`,children:[a.length?(0,x.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,a.map((e,t)=>(0,x.jsxs)(_.Fragment,{children:[t?`, `:null,(0,x.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,x.jsx)(`span`,{}),t.length?(0,x.jsxs)(`span`,{className:`kit-where`,children:[(0,x.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":c.map(e=>`${P(e.row)}: ${e.note}`).join(`, `),children:c.map(e=>(0,x.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${P(e.row)}: ${e.note}`},e.row.id))}),(0,x.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function L({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:P(e)}),(0,x.jsx)(`span`,{className:`mono dim`,children:e.path}),y(e)?(0,x.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null,Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,x.jsxs)(`span`,{className:`mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e))]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=F(n,t,e.name);return(0,x.jsxs)(`span`,{className:`kit-cell`,children:[(0,x.jsx)(g,{on:r.now,disabled:y(t)||n.running(t),label:`${e.name} for ${P(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,x.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,x.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,x.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,x.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,x.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,x.jsx)(`span`,{className:`dim`,children:`Each row is one install.`})]}),t.length?(0,x.jsx)(h,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function R({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,x.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,x.jsx)(`b`,{children:a?`${N(a,`change`)} on ${N(r.length,`install`)}`:`No staged changes`}),i?(0,x.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[P(i),`: `,S(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,x.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,x.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${P(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,x.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${P(i)}`:`Apply and rebuild kits`,disabled:!i||y(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function z({item:e,onAction:t,dataRev:n}){let{data:a,error:o}=d(()=>r.kits(),[n]),s=b(a,t),{data:l}=d(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),f=a?.kits||[],m=a?.installs||[],h=o||a?.error;if(e){let t=f.find(t=>t.name===e);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,x.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,x.jsx)(M,{kit:t,installs:m,stage:s,listed:l})}):(0,x.jsxs)(p,{title:`No such kit`,action:(0,x.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):h?null:(0,x.jsx)(u,{})]})}let g=Math.max(1,...f.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(i,{eyebrow:a?`${N(f.length,`kit`)} · ${N(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),a?f.length===0?h?null:(0,x.jsx)(p,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,x.jsxs)(`div`,{className:`kit-page-body`,children:[(0,x.jsx)(`div`,{className:`kit-gallery`,children:f.map(e=>(0,x.jsx)(I,{kit:e,installs:m,stage:s,listed:l,max:g},e.name))}),(0,x.jsx)(L,{kits:f,installs:m,stage:s}),m.length?(0,x.jsx)(R,{installs:m,stage:s}):null]}):h?null:(0,x.jsx)(u,{})]})}export{z as default};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,H as a,Q as o,Z as s,et as c,ht as l,ot as u,tt as d,z as f}from"./index-BiKWWv7Z.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{t as m}from"./Markdown-CxkA7940.js";import{t as h}from"./DataTable-b9zTShqJ.js";import{i as g}from"./controls-CREglcUF.js";var _=e(t(),1),v=e=>e.kits||[],y=e=>!e.editable||e.state===`unreadable`;function b(e,t){let n=u(),r=o(),i=e=>{let t=r.get(`kits`,e.id);return t&&t.base===s(v(e))?t:null},{prune:a}=r;(0,_.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,s(v(e))]));a(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,a]);let c=e=>i(e)?.value??new Set(v(e)),d=(e,t)=>{let n=new Set(c(e));n.delete(t)||n.add(t),r.put(`kits`,e.id,n,s(v(e)))},f=e=>{let t=c(e),n=new Set(v(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},p=e=>r.running(`kits`,e.id)||!!i(e)?.applied;return{setOf:c,toggle:d,change:f,apply:async e=>{let i=[...c(e)],a=`Rebuild ${l(e)} with kits: ${i.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(a,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:i})&&r.startApply(`kits`,e.id)},running:p,failed:e=>!!i(e)?.failed,discard:e=>{p(e)||r.drop(`kits`,e.id)},busy:r.busy}}var x=n();function S(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function C({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,x.jsxs)(`div`,{className:`kit-foot`,children:[(0,x.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:S(e,t)}),(0,x.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${l(e)}`,disabled:y(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var w={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},T=({row:e})=>{let[t,n]=w[e.state]||[e.state||`Unknown`,``];return(0,x.jsx)(`span`,{className:`tag ${n}`,children:t})},E=encodeURIComponent,D=e=>(e||``).split(/\s+/).filter(Boolean).length,O=e=>[...new Set(e.filter(Boolean))],k=e=>(e||``).slice(0,7),A=(e,t)=>e?`On in ${e} of ${N(t,`install`)}`:`Installed when this kit is on`,j=({type:e,names:t,listed:n,offNote:r=A(0)})=>t.length?(0,x.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,x.jsx)(`li`,{children:n?.has(t)?(0,x.jsx)(`a`,{href:`#/item/${e}/${E(t)}`,children:t}):(0,x.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,x.jsx)(`p`,{className:`panel-note`,children:`None.`});function M({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=A(t.filter(t=>v(t).includes(e.name)).length,t.length);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`reader-tags`,children:[(0,x.jsx)(`span`,{className:`tag acc`,children:`Kit`}),O(i.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,x.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,x.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,x.jsx)(`hr`,{className:`hr`}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,x.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=y(t),i=l(t);return(0,x.jsxs)(`li`,{className:`kit-install`,children:[(0,x.jsxs)(`div`,{className:`kit-row`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:i}),(0,x.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,x.jsx)(T,{row:t}),(0,x.jsx)(g,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,x.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,x.jsx)(C,{row:t,stage:n})]},t.id)})}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,x.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,x.jsxs)(_.Fragment,{children:[(0,x.jsx)(`dt`,{children:e.author||e.repo}),(0,x.jsxs)(`dd`,{children:[(0,x.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,x.jsxs)(`span`,{className:`mono dim`,children:[`@ `,k(e.commit)]}):null,e.compareUrl?(0,x.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${k(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,x.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,x.jsx)(j,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,x.jsx)(j,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,x.jsxs)(`span`,{className:`mono dim`,children:[D(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,x.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,x.jsx)(m,{body:e.rules})})]}):null,e.banned?.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,x.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var N=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,P=l;function F(e,t,n){let r=v(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function I({kit:e,installs:t,stage:n,listed:r,max:i}){let a=e.credits||[],o=e.skills||[],s=e.agents||[],c=t.map(t=>({row:t,...F(n,t,e.name)})),l=c.filter(t=>v(t.row).includes(e.name)).length,u=c.filter(e=>e.staged).length,d=A(l,t.length),p=`on in ${l} of ${N(t.length,`install`)}${u?` · ${u} staged`:``}`;return(0,x.jsxs)(`article`,{className:`kit-card${u?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,x.jsxs)(`header`,{className:`kit-card-head`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,x.jsx)(`a`,{className:`kit-name`,href:`#/kits/${E(e.name)}`,children:e.name})}),e.description?(0,x.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),O(a.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsxs)(`div`,{className:`kit-counts`,children:[(0,x.jsx)(`span`,{children:`Skills`}),(0,x.jsx)(f,{value:o.length,max:i,label:`Skills`}),(0,x.jsx)(`span`,{className:`mono`,children:o.length}),(0,x.jsx)(`span`,{children:`Agents`}),(0,x.jsx)(f,{value:s.length,max:i,label:`Agents`}),(0,x.jsx)(`span`,{className:`mono`,children:s.length})]}),o.length?(0,x.jsx)(j,{type:`skill`,names:o,listed:r?.skills,offNote:d}):null,s.length?(0,x.jsx)(j,{type:`agent`,names:s,listed:r?.agents,offNote:d}):null,(0,x.jsxs)(`footer`,{className:`kit-card-foot`,children:[a.length?(0,x.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,a.map((e,t)=>(0,x.jsxs)(_.Fragment,{children:[t?`, `:null,(0,x.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,x.jsx)(`span`,{}),t.length?(0,x.jsxs)(`span`,{className:`kit-where`,children:[(0,x.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":c.map(e=>`${P(e.row)}: ${e.note}`).join(`, `),children:c.map(e=>(0,x.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${P(e.row)}: ${e.note}`},e.row.id))}),(0,x.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function L({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:P(e)}),(0,x.jsx)(`span`,{className:`mono dim`,children:e.path}),y(e)?(0,x.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null,Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,x.jsxs)(`span`,{className:`mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e))]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=F(n,t,e.name);return(0,x.jsxs)(`span`,{className:`kit-cell`,children:[(0,x.jsx)(g,{on:r.now,disabled:y(t)||n.running(t),label:`${e.name} for ${P(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,x.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,x.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,x.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,x.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,x.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,x.jsx)(`span`,{className:`dim`,children:`Each row is one install.`})]}),t.length?(0,x.jsx)(h,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function R({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,x.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,x.jsx)(`b`,{children:a?`${N(a,`change`)} on ${N(r.length,`install`)}`:`No staged changes`}),i?(0,x.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[P(i),`: `,S(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,x.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,x.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${P(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,x.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${P(i)}`:`Apply and rebuild kits`,disabled:!i||y(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function z({item:e,onAction:t,dataRev:n}){let{data:o,error:s}=i(()=>r.kits(),[n]),l=b(o,t),{data:u}=i(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),f=o?.kits||[],m=o?.installs||[],h=s||o?.error;if(e){let t=f.find(t=>t.name===e);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),o?t?(0,x.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,x.jsx)(M,{kit:t,installs:m,stage:l,listed:u})}):(0,x.jsxs)(p,{title:`No such kit`,action:(0,x.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):h?null:(0,x.jsx)(d,{})]})}let g=Math.max(1,...f.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{eyebrow:o?`${N(f.length,`kit`)} · ${N(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),o?f.length===0?h?null:(0,x.jsx)(p,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,x.jsxs)(`div`,{className:`kit-page-body`,children:[(0,x.jsx)(`div`,{className:`kit-gallery`,children:f.map(e=>(0,x.jsx)(I,{kit:e,installs:m,stage:l,listed:u,max:g},e.name))}),(0,x.jsx)(L,{kits:f,installs:m,stage:l}),m.length?(0,x.jsx)(R,{installs:m,stage:l}):null]}):h?null:(0,x.jsx)(d,{})]})}export{z as default};
@@ -0,0 +1,4 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{i}from"./router-1EhRJy1C.js";import{At as a,H as o,J as s,Q as c,W as l,Y as u,Z as d,_ as f,b as p,c as m,d as h,dt as g,et as _,f as v,ft as y,g as b,gt as x,h as S,ht as C,it as w,l as ee,m as te,nt as ne,ot as re,p as ie,s as ae,tt as oe,u as se,v as T,y as E,z as D}from"./index-BiKWWv7Z.js";import{t as ce}from"./EmptyState-CY5Pm2xy.js";import{t as O}from"./FilterInput-qGKNSlxv.js";import{t as k}from"./Markdown-CxkA7940.js";var A=e(t(),1);function le({items:e,packs:t,install:n,canApply:r,onAction:i,gateArmed:a}){let o=re(),s=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),l=s.join(`,`),u=c(),f=n?`${n.host}:${n.scope}:${n.path}`:``,p=d(s),{prune:m}=u,g=e.length>0;(0,A.useEffect)(()=>{g&&m(`rules`,(e,t)=>e===f&&t.base!==p)},[g,f,p,m]);let _=u.get(`rules`,f),v=_&&_.base===p?_:null,y=v?v.value:s,b=u.running(`rules`,f)||!!v?.applied,x=!!v?.failed,S=e=>{b||u.put(`rules`,f,e(y),p)},w=e=>y.includes(e),ee=e=>S(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),ne=e=>e.rules.some(e=>w(e.addr)),ie=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>w(e.addr));S(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},oe=e=>{let t=e.rules.filter(e=>w(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},se=t.flatMap(e=>e.rules.map(e=>e.addr)),T=se.filter(w),E=T.join(`,`)!==l,D=`process.5`,ce=s.includes(D)&&!y.includes(D),O=(0,A.useRef)(!1),k=async()=>{if(!r||!E||b||O.current)return;let e=t.filter(e=>e.rules.some(e=>w(e.addr))).map(e=>e.pack),c=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!w(e.addr)).map(e=>e.addr)),l=ce?`
2
+
3
+ process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary (Bob still logs its warning). `+(a?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,d={},p=[],m=[];for(let[e,{key:r,label:i}]of Object.entries(h)){if(!e.includes(`.`))continue;let a=t.flatMap(e=>e.rules).find(t=>t.addr===e)?.name||e,o=s.includes(e),c=n?.[r]!==!1;o&&!w(e)&&c&&(d[r]=!1,m.push(`Excluding ${a} also switches the ${i.toLowerCase()} off: its text goes, and its hook stops asking.`)),!o&&w(e)&&!c&&(p.push({key:r,label:i}),m.push(`Including ${a} brings its text back; the ${i.toLowerCase()} stays off unless you tick the box.`))}for(let e of te){if(e===D||!s.includes(e)||w(e))continue;let n=t.flatMap(e=>e.rules).find(t=>t.addr===e)?.name||e;m.push(`Excluding ${n} also drops its hook: it stops asking on every host.`)}for(let e of ae){if(!s.includes(e)||w(e))continue;let n=t.flatMap(e=>e.rules).find(t=>t.addr===e)?.name||e;m.push(`Excluding ${n} drops its text; its hook still asks (it has no switch yet).`)}let g=T.length?`${T.length} of ${se.length} doctrine rules`:`no doctrine rules`,_=m.length?`\n\n${m.join(`
4
+ `)}`:``,v=p.length?{label:`Also turn the ${p.map(e=>e.label.toLowerCase()).join(` and `)} back on`,checked:!0}:void 0;O.current=!0;try{let t=!0;if((l||m.length||v)&&(t=await o(`Rebuild ${C(n)} with ${g}? It rebuilds in place, non-destructive.${l}${_}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`,check:v})),!t){u.drop(`rules`,f);return}let r={...d};if(t?.checked!==!1)for(let e of p)r[e.key]=!0;await i(`install`,{...n,doctrines:e,excludeRules:c,...r})?u.startApply(`rules`,f):u.fail(`rules`,f)}finally{O.current=!1}},le=()=>{b||u.drop(`rules`,f)},j=(0,A.useRef)(k);(0,A.useEffect)(()=>{j.current=k});let M=T.join(`,`),N=!(!r||!E||!v||v.sent||b||x||u.busy);return(0,A.useEffect)(()=>{if(!N)return;let e=setTimeout(()=>j.current(),700);return()=>clearTimeout(e)},[N,M]),{deployedRules:s,isOn:w,toggleRule:ee,packOn:ne,togglePack:ie,packState:oe,allRules:se,pickedRules:T,dirty:E,pending:N,running:b,failed:x,busy:u.busy,losingConsent:ce,applyPacks:k,revert:le}}var j=n();function M({addr:e,isOpen:t,onToggle:n,className:i,style:o,head:s,label:c,rev:l,toggleCol:u=null,renderBody:d,srcLine:f,after:p=null}){let m=(0,A.useId)(),{data:h,error:g,reload:v}=a(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),y=t&&(0,j.jsxs)(`div`,{className:`law-expand`,id:m,children:[g?(0,j.jsx)(_,{error:g,onRetry:v}):h?d(h):(0,j.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,j.jsx)(`div`,{className:`law-srcline`,children:f}),p]}),b={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":m,"aria-label":c};return u?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:i,style:o,"data-addr":e,children:[(0,j.jsx)(`button`,{className:`law-disclosure`,...b,children:s}),(0,j.jsx)(`span`,{className:`toggle-col`,children:u})]}),y]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{className:i,style:o,"data-addr":e,...b,children:s}),y]})}function N({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null,after:a=null}){let o=e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``,s=(0,j.jsx)(`span`,{className:`law-enf${o}`,"data-col":`enf`,"aria-hidden":i?`true`:void 0,children:e.enf},`enf`),c=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`law-no`,"data-col":`no`,children:[(0,j.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,j.jsxs)(`span`,{className:`law-name`,children:[(0,j.jsx)(`span`,{children:e.name}),e.ess?(0,j.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,j.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null,e.note?(0,j.jsx)(`span`,{className:`law-note`,children:e.note}):null,e.no?(0,j.jsxs)(`span`,{className:`law-fold law-fold-no`,"aria-hidden":`true`,children:[(0,j.jsx)(`span`,{className:`x`,children:`›`}),e.no]}):null,e.latin?(0,j.jsx)(`span`,{className:`law-fold law-fold-latin`,"aria-hidden":`true`,children:e.latin}):null,(0,j.jsxs)(`span`,{className:`law-fold law-fold-chips`,"aria-hidden":`true`,children:[(0,j.jsx)(`span`,{className:`law-chip-status ${e.statusTone}`,children:e.status}),(0,j.jsx)(`span`,{className:`law-chip-enf${o}`,children:e.enf})]})]}),(0,j.jsx)(`span`,{className:`law-latin`,"data-col":`latin`,children:e.latin}),(0,j.jsx)(`span`,{className:`law-status ${e.statusTone}`,"data-col":`status`,children:e.status}),i?null:s]});return(0,j.jsx)(M,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:c,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i?[i[0],s,i[1]]:null,renderBody:t=>(0,j.jsx)(k,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`,after:a})}var P=[`invariants`,`doctrines`];function ue({tiers:e,current:t,onPick:n}){return(0,j.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`span`,{className:`tier-head`,children:[(0,j.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,j.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,j.jsxs)(`span`,{className:`tier-top`,children:[(0,j.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,j.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,j.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,j.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,j.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,j.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,j.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&P.includes(e.key)?(0,j.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,j.jsx)(`div`,{className:a,children:i},e.key)})})}function de({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1,install:i=null,slot:a=0}){let o=i?C(i):``,s=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(b(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),c=Math.max(1,...s.map(([,e])=>e));return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,j.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i&&s.some(e=>e[2])&&(0,j.jsx)(`span`,{className:`lib-legend mono`,children:(0,j.jsxs)(`span`,{children:[a>=0&&(0,j.jsx)(`i`,{className:`lr-dot`,style:g(a),"aria-hidden":`true`}),o]})}),s.length?(0,j.jsx)(`ul`,{className:`gate-list`,children:s.map(([e,r,s])=>{let l=b(e),u=t[l]?.name||f(l);return(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(l),children:(0,j.jsxs)(`span`,{className:`gate-top`,children:[(0,j.jsx)(`span`,{className:`gate-name${s?` dim`:``}`,children:u}),s&&(0,j.jsxs)(`span`,{className:`mono off`,children:[i&&a>=0&&(0,j.jsx)(`i`,{className:`lr-dot`,style:g(a),"aria-hidden":`true`}),`off`,i&&(0,j.jsxs)(`span`,{className:`sr-only`,children:[` · `,o]})]}),(0,j.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,j.jsx)(D,{value:r,max:c,label:`${u} asks`,tone:s?`accent`:`warn`})]},e)})}):(0,j.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,j.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function fe({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,running:l,failed:u,losingConsent:d}=t,f=Math.max(1,...e.map(e=>e.rules.length));return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,j.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,j.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,j.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,j.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,j.jsx)(D,{value:t,max:f,label:`${e.title} rules on`}),(0,j.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,j.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,disabled:l,title:l?`Rebuilding…`:void 0,onClick:()=>s(e)}):null]},e.pack)})}):(0,j.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,j.jsxs)(j.Fragment,{children:[d&&(0,j.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,j.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,j.jsx)(`code`,{children:`git commit`}),` and `,(0,j.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,j.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:l?`Rebuilding ${r.host} · ${r.scope}…`:u&&c?`The rebuild did not go through. Retry or Revert below.`:c?`Applying… ${r.host} · ${r.scope} rebuilds once the switches settle.`:`Matches the deployed install. A change rebuilds it automatically.`})]})]})}var pe=`ont:ownership`,me=e=>e===`ownership`?pe:e,he=`process.5`;function ge(e,t){let n=[];for(let r of e){if(r.tier!==`doctrine`)continue;let e=n.find(e=>e.pack===r.pack);e||(e={pack:r.pack,title:r.packTitle||r.pack,desc:r.packDesc||``,active:r.packActive!==!1,rules:[]},n.push(e));let i=T(r.title);e.rules.push({addr:r.name,no:`${r.pack} ${r.name.split(`.`)[1]||``}`,name:i.name,latin:i.latin,ess:r.summary||``,enf:S(r.name,t),c:p[r.pack]||`var(--text-3)`,src:`doctrines/${r.pack}.md`})}return n}function _e(e){let t=u(e.dataRev),[n,r]=s(`laws`,t);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ne,{className:`page-pick`,installs:t,value:n,onChange:r}),(0,j.jsx)(I,{...e,install:n,listed:t!==null,installSlot:y((t||[]).map(e=>e.id)).indexOf(n?.id)},n?.id??`none`)]})}var F=(e,t)=>e?.install?.host===t.host&&e.install.path===t.path;function I({install:e,listed:t,installSlot:n,...i}){let o=e&&F(i.overview,e)?i.overview:null,{data:s,error:c,loading:l}=a(()=>Promise.resolve().then(()=>e&&!o?r.overview(x(e)):null),[!!o,i.dataRev]),u=o||(e&&F(s,e)?s:null),d=e?u:i.overview,f=!(!e||u||l);return(0,j.jsxs)(j.Fragment,{children:[f?(0,j.jsx)(_,{error:`Could not read this install's gates${c?`: ${c}`:`.`}`}):null,(0,j.jsx)(L,{...i,overview:d,pair:x(e),onAction:t&&(!e||u!==null)?i.onAction:void 0,pending:!t||!!(e&&!u&&l),gatesUnread:f,installSlot:n})]})}function L({selected:e,overview:t,setup:n,onAction:s,dataRev:c,pair:u,pending:d,gatesUnread:f,installSlot:g}){let y=re(),{data:x,error:ne}=a(()=>r.catalog(`laws`,u),u?[c,u.host,u.path]:[c],`catalog:laws`),{data:k}=l(c,u),[M,P]=(0,A.useState)(`all`),[_e,F]=(0,A.useState)(``),[I,L]=(0,A.useState)(`all`),[ve,ye]=(0,A.useState)(()=>new Set),R=me(e)||null,be=e=>i(R===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),z=t?.install,B=!!(z&&s),[xe,Se]=(0,A.useState)(0),Ce=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!R)return;let e=requestAnimationFrame(()=>{let e=document.querySelector(`[data-addr="${CSS.escape(R)}"]`);if(!e)return;let t=Ce.current===R;Ce.current=null;let n=e.getBoundingClientRect();if(t||n.top<80||n.bottom>window.innerHeight){let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView?.({block:`center`,behavior:t?`auto`:`smooth`})}t&&(e.classList.remove(`law-flash`),e.offsetWidth,e.classList.add(`law-flash`))});return()=>cancelAnimationFrame(e)},[R,xe,x]);let V=x?.items||[],H=ge(V,t?.install),U=e=>t?.install?.[h[e].key]!==!1,we=U(`IV`),W=le({items:V,packs:H,install:z,canApply:B,onAction:s,gateArmed:we}),{deployedRules:G,isOn:K,toggleRule:Te,packOn:Ee,packState:De,allRules:q}=W;if(ne)return(0,j.jsx)(_,{error:ne});if(!x||d)return(0,j.jsx)(oe,{});let J={ontology:x.nouns?.ontology||`Ethos`,law:x.nouns?.law||`Dictate`,laws:x.nouns?.laws||`Dictates`,doctrines:x.nouns?.doctrines||`Doctrines`},Oe=(e,t)=>{let n=S(e,t);return f&&h[e]&&n===`Hook gate`?`Unknown`:n},ke=V.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:e.name===pe&&(z||f)?Oe(`ownership`,z):`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),Y=V.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&E[e.klass]?e.klass:`craft`,r=T(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:Oe(e.name,t?.install),cat:n,c:E[n].c,off:r.retired,src:`laws/universal.md`}}),Ae=B?[{addr:`ownership`,name:h.ownership.label,latin:``,ess:``,enf:S(`ownership`,z)}]:[],je=e=>K(e)?!1:ae.has(e)?!0:!h[e]||f?!1:U(e)&&!G.includes(e),Me=e=>{let t=K(e.addr),n=G.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,enf:f&&h[e.addr]&&e.enf===`Hook gate`?`Unknown`:e.enf,note:je(e.addr)?`Text excluded; the hook still asks.`:``,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Ne=H.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!G.includes(e.addr)).map(e=>e.addr)),Pe=async e=>{if(!B)return;let{key:t,label:n}=h[e],r=n.toLowerCase(),i=!U(e),a=C(z),o=W.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await y((i?`Re-arm the ${r} on ${a}? ${ee[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${a}? ${ee[e].off} It rebuilds in place, non-destructive.`)+o,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&s(`install`,{...z,[t]:i})},Fe=(e,t)=>(0,j.jsx)(`button`,{type:`button`,className:`sw-toggle${U(e)?` on`:``}`,role:`switch`,"aria-checked":U(e),"aria-label":t?`${h[e].label}: hook gate of ${t}`:h[e].label,onClick:()=>Pe(e)}),Ie=(e,t)=>(0,j.jsxs)(`span`,{className:`no-gate`,title:t,children:[e,(0,j.jsxs)(`span`,{className:`sr-only`,children:[`: `,t]})]}),Le=(e,t)=>[(0,j.jsx)(`span`,{className:`toggle-cell`,children:e},`text`),(0,j.jsx)(`span`,{className:`toggle-cell`,children:t},`gate`)],Re=e=>h[e.addr]?Fe(e.addr,e.name):e.addr===he?Ie(`with text`,`No switch of its own: excluding ${e.name} drops its commit and push ask in the same rebuild (Bob still logs its warning).`):te.has(e.addr)?Ie(`with text`,`No switch of its own: excluding ${e.name}, or its pack, drops its hook in the same rebuild.`):ae.has(e.addr)?Ie(`always on`,`No switch yet: the hook asks even with ${e.name}'s text excluded.`):null,ze=e=>String(e.addr).includes(`.`)&&K(e.addr)!==G.includes(e.addr),Be=(e,t=I)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(h[e.addr]||ae.has(e.addr)||!String(e.addr).includes(`.`)||G.includes(e.addr)):ze(e)),X=_e.trim().toLowerCase(),Z=e=>Be(e)&&(!X||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(X)),Ve=e=>{let t=Qe[e];(String(e).includes(`.`)?M===`invariants`:t&&M===`doctrines`)&&P(`all`),t&&!Be(t)&&L(`all`),t&&!Z(t)&&F(``),Ce.current=me(e),Se(e=>e+1),i(`#/item/law/${encodeURIComponent(e)}`)},He={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))He[b(e)]=t;let Ue=e=>He[e.addr]?{...e,asks:`${He[e.addr]} ask${He[e.addr]===1?``:`s`}`}:e,Q=Y.filter(e=>!e.retired).length,We=G.length,Ge=e=>{if(f)return[`gates unread`,`warn`];let t=e.filter(e=>h[e.addr]&&!U(e.addr)).length;return t?[`${t} gate${t===1?``:`s`} off`,`warn`]:[`always`,`ok`]},Ke=q.length-We,qe=[Ke>0&&`${Ke} excluded`,!f&&!U(`rigor.5`)&&`1 gate off`].filter(Boolean),Je=qe.length?[qe.join(` · `),`warn`]:[`all on`,`ok`],$=k?.stats,Ye={ethos:{name:J.ontology,n:ke.length,fill:1,sub:`${ke.length} sections`,pill:Ge(Ae)},invariants:{name:J.laws,n:Y.length,fill:Y.length?Q/Y.length:0,sub:Y.length>Q?`${Q} active · ${Y.length-Q} retired`:`${Q} active`,pill:Ge(Y)},doctrines:{name:J.doctrines,n:q.length,fill:q.length?We/q.length:0,sub:`${H.length} packs`,pill:Je},yours:{name:`Your rules`,n:$?.rules??``,fill:+!!$?.rules,sub:$?`${$.rules} rule${$.rules===1?``:`s`} · ≈${$.tokens.toLocaleString(`en-US`)} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},Xe=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,J.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Ze=v.map(e=>({key:e.key,...Ye[e.key],rule:Xe(e.against)})),Qe=Object.fromEntries([...Y,...H.flatMap(e=>e.rules)].map(e=>[e.addr,e])),$e=[[`all`,`All`,Y.length+q.length],[`invariants`,J.laws,Y.length],[`doctrines`,J.doctrines,q.length]],et=M===`all`||M===`invariants`,tt=M===`all`||M===`doctrines`,nt=[...Ae,...et?Y:[],...tt?H.flatMap(e=>e.rules):[]],rt=[[`gated`,`Gated`,f?null:nt.filter(e=>Be(e,`gated`)).length],[`changed`,`Changed`,nt.filter(e=>Be(e,`changed`)).length]],it=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,at=e=>I!==`changed`&&ve.has(e)&&it(R)!==e,ot=e=>{let t=at(e);ye(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&it(R)===e&&i(`#/laws`)},st=H.flatMap(e=>e.rules.filter(ze).map(e=>({...e,plus:K(e.addr)}))),ct=B&&H.length>0&&W.dirty&&W.failed,lt=()=>{L(`changed`),M===`invariants`&&P(`all`),F(``)},ut=(e,t)=>(0,j.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,j.jsx)(`h2`,{className:`tier-h`,children:e}),(0,j.jsx)(`span`,{className:`mono dim`,children:t})]}),dt=e=>(0,j.jsxs)(`div`,{className:`law-rowhead`,"aria-hidden":`true`,children:[(0,j.jsx)(`span`,{"data-col":`no`,children:`No.`}),(0,j.jsx)(`span`,{children:`Rule`}),(0,j.jsx)(`span`,{"data-col":`latin`,children:`Latin name`}),(0,j.jsx)(`span`,{"data-col":`status`,children:`Status`}),e&&(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`span`,{className:`rh-cut`,children:`Rule `}),`text`]}),(0,j.jsx)(`span`,{"data-col":`enf`,children:`Enforced by`}),e&&(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`span`,{className:`rh-cut`,children:`Hook `}),`gate`]})]}),ft=Y.filter(Z),pt=(X||I!==`all`?Ae.filter(Z).length:0)+(et?ft.length:0)+(tt?H.reduce((e,t)=>e+t.rules.filter(Z).length,0):0),mt=Ue(Ae[0]||{}).asks,ht=(e,t)=>B?(0,j.jsxs)(`div`,{className:`law-gate`,children:[(0,j.jsxs)(`span`,{className:`law-name`,children:[(0,j.jsx)(`span`,{children:h[e].label}),t?(0,j.jsx)(`span`,{className:`law-asks mono`,children:t}):null,(0,j.jsx)(`span`,{className:`law-princ`,children:ee[e].desc})]}),Fe(e)]}):null,gt=t?.install?.[m.key]===!1,_t=async()=>{let e=!gt,t=C(z),n=W.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await y((e?`Switch strict consent on for ${t}? ${m.on} It rebuilds in place, non-destructive.`:`Switch strict consent off on ${t}? ${m.off} It rebuilds in place, non-destructive.`)+n,{title:e?`Switch strict consent on?`:`Switch strict consent off?`,confirmLabel:e?`Switch on`:`Switch off`})&&s(`install`,{...z,[m.key]:!e})},vt=()=>B&&!f&&G.includes(m.addr)?(0,j.jsxs)(`div`,{className:`law-gate`,children:[(0,j.jsxs)(`span`,{className:`law-name`,children:[(0,j.jsx)(`span`,{children:m.label}),(0,j.jsx)(`span`,{className:`law-princ`,children:m.desc})]}),(0,j.jsx)(`button`,{type:`button`,className:`sw-toggle${gt?` on`:``}`,role:`switch`,"aria-checked":gt,"aria-label":m.label,onClick:_t})]}):null,yt=e=>{let t=se[e];return t?(0,j.jsxs)(`details`,{className:`law-hook`,children:[(0,j.jsx)(`summary`,{children:`What the hook does`}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Triggers on`}),(0,j.jsx)(`dd`,{children:t.on}),(0,j.jsx)(`dt`,{children:`Per host`}),(0,j.jsx)(`dd`,{children:t.hosts}),(0,j.jsx)(`dt`,{children:`Does not see`}),(0,j.jsx)(`dd`,{children:t.blind}),(0,j.jsx)(`dt`,{children:`If switched off`}),(0,j.jsx)(`dd`,{children:t.off})]})]}):null};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o,{eyebrow:z?[t?.theme,z.footprint&&`${z.footprint} footprint`,C(z)].filter(Boolean).join(` · `):null,title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,actions:(0,j.jsx)(O,{className:`law-filter`,value:_e,onChange:F,placeholder:`Filter rules`,label:`Filter rules`})}),(0,j.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,j.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,j.jsx)(ue,{tiers:Ze,current:M,onPick:P}),(0,j.jsx)(`div`,{className:`ladder-tail`,children:ie.map((e,t)=>(0,j.jsxs)(`span`,{className:`ladder-low`,children:[(0,j.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,v.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,j.jsxs)(`div`,{className:`split`,children:[(0,j.jsxs)(`section`,{className:`panel flush law-wrap${B?` with-toggle`:``}`,"aria-label":`Rules`,children:[ke.length>0&&(0,j.jsxs)(j.Fragment,{children:[ut(J.ontology,`ontology/universal.md`),dt(!1),ke.map(e=>(0,j.jsx)(N,{law:e,rev:c,isOpen:R===e.addr,onToggle:()=>be(e.addr),after:e.addr===pe?(0,j.jsxs)(j.Fragment,{children:[yt(`ownership`),ht(`ownership`,mt)]}):null},e.addr))]}),(0,j.jsxs)(`div`,{className:`law-toolbar`,children:[(0,j.jsx)(w,{"aria-label":`Show`,children:$e.map(([e,t,n])=>(0,j.jsxs)(`button`,{type:`button`,className:M===e?`on`:``,"aria-pressed":M===e,onClick:()=>P(e),children:[t,` `,(0,j.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,j.jsx)(w,{"aria-label":`Narrow`,children:rt.map(([e,t,n])=>(0,j.jsxs)(`button`,{type:`button`,className:I===e?`on`:``,"aria-pressed":I===e,disabled:n===null,onClick:()=>L(I===e?`all`:e),children:[t,` `,n===null?null:(0,j.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),et&&ft.length>0&&(0,j.jsxs)(j.Fragment,{children:[ut(J.laws,`laws/universal.md`),dt(B),ft.map(e=>(0,j.jsx)(N,{law:Ue(e),rev:c,isOpen:R===e.addr,onToggle:()=>be(e.addr),after:yt(e.addr),toggleCol:!B||e.retired?null:Le(Ie(`locked`,`A ${J.law} cannot be excluded: its text always binds.`),h[e.addr]?Fe(e.addr,e.name):null)},e.addr))]}),tt&&H.map(e=>{let t=e.rules.filter(Z);if(!t.length)return null;let n=at(e.pack),r=e.rules.filter(e=>K(e.addr)).length;return(0,j.jsxs)(`div`,{className:`pack-wrap${Ee(e)?``:` pack-off`}`,children:[(0,j.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,j.jsx)(`h2`,{className:`tier-h`,style:{"--cc":p[e.pack]},children:(0,j.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>ot(e.pack),children:e.title})}),(0,j.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,j.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,j.jsx)(`span`,{className:`pack-fill`,children:(0,j.jsx)(D,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,j.jsx)(`span`,{className:`pack-state mono`,children:De(e)})]}),!e.active&&!B&&(0,j.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,H.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Ne.length>0&&` --exclude-rules ${Ne.join(`,`)}`]}),!n&&dt(B),!n&&t.map(e=>(0,j.jsx)(N,{law:Ue(Me(e)),rev:c,isOpen:R===e.addr,onToggle:()=>be(e.addr),after:e.addr===m.addr?(0,j.jsxs)(j.Fragment,{children:[yt(e.addr),vt()]}):yt(e.addr),toggleCol:B?Le((0,j.jsx)(`button`,{type:`button`,className:`sw-toggle${K(e.addr)?` on`:``}`,role:`switch`,"aria-checked":K(e.addr),"aria-label":`${e.name} rule text`,disabled:W.running,title:W.running?`Rebuilding…`:void 0,onClick:()=>Te(e.addr)}),Re(e)):null},e.addr))]},e.pack)}),pt===0&&(0,j.jsx)(ce,{title:X||I!==`all`?`No matching rules`:`Nothing in this tier`,children:X?(0,j.jsxs)(j.Fragment,{children:[`Nothing matches “`,_e.trim(),`”.`]}):I===`all`?(0,j.jsx)(j.Fragment,{children:`This install predates the tier.`}):(0,j.jsxs)(j.Fragment,{children:[`No `,I,` rule in this tier.`]})})]}),(0,j.jsxs)(`aside`,{className:`aside-stack`,children:[(0,j.jsx)(fe,{packs:H,sel:W,canApply:B,install:z,gateArmed:we}),(0,j.jsx)(de,{gates:n?.gates,byAddr:Qe,onJump:Ve,disarmed:e=>!!h[e]&&!U(e),install:t?.install,slot:g})]})]}),ct&&(0,j.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,j.jsxs)(`span`,{className:`law-bar-n`,children:[`Rebuild failed · `,st.length,` unapplied change`,st.length===1?``:`s`]}),(0,j.jsx)(`span`,{className:`law-bar-list`,children:st.map(e=>(0,j.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:lt,children:`Review changes`}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{L(`all`),W.revert()},children:`Revert`}),(0,j.jsxs)(`button`,{type:`button`,className:`btn`,onClick:W.applyPacks,disabled:W.busy,title:W.busy?`A job is running`:void 0,children:[`Retry (`,W.pickedRules.length,`/`,q.length,` rules)`]})]})]})}export{_e as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-C1iE8mnY.js";import{_t as i}from"./index-BhT94v2q.js";import{t as a}from"./FilterInput-qGKNSlxv.js";var o=n(),s=e(t(),1),c=r(),l={experimental:{label:`experimental`,cls:`warn`,icon:`flask`,hint:`Shipped, but not yet confirmed by real use.`},deprecated:{label:`deprecated`,cls:`bad`,icon:`clear`,hint:`On its way out — look for the replacement before building on it.`},personal:{label:`personal`,cls:``,icon:`profile`,hint:`Yours — present in this install, not shipped or versioned by Geneseed.`},unknown:{label:`no status`,cls:``,icon:`about`,hint:`Not listed in registry.json.`}};function u({status:e,withHint:t=!1,compact:n=!1}){let r=l[e];if(!r)return null;if(n)return(0,c.jsxs)(`span`,{className:`badge status-icon ${r.cls}`,title:`${r.label}: ${r.hint}`,children:[(0,c.jsx)(i,{name:r.icon}),(0,c.jsx)(`span`,{className:`sr-only`,children:r.label})]});let a=(0,c.jsxs)(`span`,{className:`badge ${r.cls}`,title:t?void 0:r.hint,children:[(0,c.jsx)(`span`,{className:`dot`}),r.label]});return t?(0,c.jsxs)(c.Fragment,{children:[a,(0,c.jsx)(`span`,{className:`dim`,children:r.hint})]}):a}function d({items:e}){return Object.keys(l).filter(t=>e.some(e=>e.status===t)).map(e=>(0,c.jsxs)(`span`,{title:l[e].hint,children:[(0,c.jsx)(`span`,{className:`badge status-icon ${l[e].cls}`,"aria-hidden":`true`,children:(0,c.jsx)(i,{name:l[e].icon})}),l[e].label]},e))}function f({label:e,total:t,cats:n,cat:r,onChange:i}){if(n.length<=1)return null;let a=[{key:`all`,label:`All`,n:t,c:`var(--text-3)`},...n];return(0,c.jsxs)(`div`,{className:`rail-cats`,children:[(0,c.jsx)(`ul`,{"aria-label":e,children:a.map(({key:e,label:t,n,c:a})=>(0,c.jsx)(`li`,{children:(0,c.jsxs)(`button`,{type:`button`,className:r===e?`on`:``,"aria-pressed":r===e,style:{"--cc":a},onClick:()=>i(e),children:[(0,c.jsx)(`span`,{className:`cdot`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`rc-name`,title:t,children:t}),(0,c.jsx)(`span`,{className:`mono dim`,children:n})]})},e))}),(0,c.jsx)(`div`,{className:`rail-mix`,"aria-hidden":`true`,children:n.map(({key:e,n:t,c:n})=>(0,c.jsx)(`span`,{className:r===`all`||r===e?``:`dim`,style:{"--cc":n,flexGrow:t}},e))})]})}function p(e){let t=[],n=new Map;for(let r of e)n.has(r.group)||t.push(r.group),n.set(r.group,(n.get(r.group)||0)+1);return t.map(e=>({key:e,label:e,n:n.get(e),c:`var(--accent)`}))}var m=({name:e})=>(0,c.jsxs)(`span`,{className:`tag acc`,title:`Ships with the ${e} kit`,children:[`kit: `,e]}),h=()=>(0,c.jsx)(`span`,{className:`tag acc`,title:`Every agent inherits this agent's root file`,children:`base`});function g(e,t){let n=(t||``).trim().toLowerCase();return n?e.filter(e=>`${e.title||``} ${e.name||``} ${e.desc||``}`.toLowerCase().includes(n)):e}function _({label:e,count:t,extra:n,tools:r,toolsCompact:i,q:l,onQ:u,matched:d,inView:p,current:m,sections:h,cats:g,cat:_,onCat:v,total:y,catLabel:w,children:T}){let E=C(p),D=E.list,O=S([...p,D]),k=(0,s.useId)(),A=(0,s.useRef)(null);(0,s.useLayoutEffect)(()=>x(O.current));let[j,M]=(0,s.useState)(``),N=(0,s.useRef)(!0);return(0,s.useEffect)(()=>{N.current?N.current=!1:M(O.current?.querySelector(`.lib-row.on`)?.dataset.title||``)},p),(0,c.jsxs)(`section`,{className:`lib-list`,"aria-label":e,onKeyDown:e=>{e.key===`ArrowDown`&&e.target.classList?.contains(`lib-filter`)&&(e.preventDefault(),D||(0,o.flushSync)(()=>E.setList(!0)),O.current?.querySelector(`.lib-row`)?.focus())},"data-open":D,children:[(0,c.jsxs)(`div`,{className:`lib-list-head`,children:[(0,c.jsxs)(`b`,{children:[e,` `,(0,c.jsx)(`span`,{className:`mono dim`,children:t})]}),n]}),(0,c.jsxs)(`div`,{className:`lib-toolbar`,children:[h?(0,c.jsx)(`nav`,{className:`lib-seg`,"aria-label":`Sections`,children:h.map(e=>(0,c.jsxs)(`a`,{href:e.href,className:e.on?`on`:``,"aria-current":e.on?`page`:void 0,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0||E.setList(!0)},children:[e.label,(0,c.jsx)(`span`,{className:`mono`,children:e.n??``})]},e.key))}):null,(0,c.jsxs)(`div`,{className:`lib-toolbar-filter`,children:[(0,c.jsx)(a,{value:l,onChange:u,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),r?(0,c.jsx)(`div`,{className:`lib-tools`,children:r}):null,i?(0,c.jsx)(`div`,{className:`lib-tools-compact`,children:i}):null]}),g?.length>1?(0,c.jsx)(`div`,{className:`lib-chips`,children:(0,c.jsx)(f,{label:w,total:y,cats:g,cat:_,onChange:v})}):null]}),(0,c.jsxs)(`div`,{className:`lib-picker`,children:[(0,c.jsxs)(`button`,{ref:A,type:`button`,className:`lib-list-toggle`,"aria-expanded":D,"aria-controls":k,onClick:()=>E.setList(e=>!e),children:[(0,c.jsx)(`span`,{className:`dim lib-pick-n`,children:d===void 0?``:`${d} ${e.toLowerCase()}`}),(0,c.jsx)(`b`,{children:m}),(0,c.jsx)(`span`,{className:`dim lib-pick-hint`,children:D?`close`:`change`}),(0,c.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,c.jsxs)(`div`,{className:`lib-rows`,id:k,ref:O,onKeyDown:b,onFocus:e=>x(e.currentTarget),onClick:e=>{if(e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0)return;let t=e.target.closest?.(`.lib-row`);t&&!(p[1]&&t.classList.contains(`on`))&&E.pick()},children:[T,l.trim()&&d===0&&(0,c.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,c.jsx)(`div`,{className:`big`,children:`No matches`}),`Nothing in `,e.toLowerCase(),` matches “`,l.trim(),`”.`]})]})]}),(0,c.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:j?`${j} opened`:``})]})}function v({item:e,isOpen:t,href:n,children:r}){return(0,c.jsxs)(`a`,{className:`lib-row${t?` on`:``}`,href:n,"aria-current":t?`true`:void 0,"data-title":e.title||e.name,"data-pinned":e.base?`true`:void 0,children:[(0,c.jsxs)(`span`,{className:`lr-name`,children:[e.title||e.name,(0,c.jsx)(u,{status:e.status,compact:!0}),e.kit?(0,c.jsx)(m,{name:e.kit}):null,e.base?(0,c.jsx)(h,{}):null,r]}),e.desc?(0,c.jsx)(`span`,{className:`lr-desc`,children:e.desc}):null,e.meta?(0,c.jsx)(`span`,{className:`lr-meta mono`,children:e.meta}):null]})}function y({rows:e,activeName:t,hrefOf:n,pills:r}){let i=null,a=[];for(let o of e)o.group&&o.group!==i&&(i=o.group,a.push((0,c.jsxs)(`div`,{className:`lib-group`,children:[o.groupC?(0,c.jsx)(`span`,{className:`cdot`,style:{"--cc":o.groupC},"aria-hidden":`true`}):null,o.group]},`g-${o.group}`))),a.push((0,c.jsx)(v,{item:o,isOpen:t===o.name,href:n(o),children:r?.(o)},o.name));return a}function b(e){let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);if(n===-1)return;let r={ArrowDown:Math.min(n+1,t.length-1),ArrowUp:Math.max(n-1,0),Home:0,End:t.length-1}[e.key];r!==void 0&&(e.preventDefault(),t[r].focus())}function x(e){if(!e)return;let t=[...e.querySelectorAll(`.lib-row`)],n=t.find(e=>e===document.activeElement)||e.querySelector(`.lib-row.on`)||t[0];for(let e of t)e.tabIndex=e===n?0:-1}function S(e){let t=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=t.current,n=e?.querySelector(`.lib-row.on`);if(!n||!e)return;let r=n.offsetTop;r>=e.scrollTop&&r+n.clientHeight<=e.scrollTop+e.clientHeight||(e.scrollTop=Math.max(0,r-e.clientHeight/2+n.clientHeight/2))},e),t}function C([e,t]){let[n,r]=(0,s.useState)(!t),[i,a]=(0,s.useState)([e,t]),[o,c]=(0,s.useState)(!1);return(i[0]!==e||i[1]!==t)&&(a([e,t]),r(o||!t),c(!1)),{list:n,setList:r,pick:()=>c(!0)}}export{g as a,u as c,_ as i,d as l,y as n,f as o,m as r,p as s,h as t};
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-C1iE8mnY.js";import{Ct as i}from"./index-BiKWWv7Z.js";import{t as a}from"./FilterInput-qGKNSlxv.js";var o=n(),s=e(t(),1),c=r(),l={experimental:{label:`experimental`,cls:`warn`,icon:`flask`,hint:`Shipped, but not yet confirmed by real use.`},deprecated:{label:`deprecated`,cls:`bad`,icon:`clear`,hint:`On its way out — look for the replacement before building on it.`},personal:{label:`personal`,cls:``,icon:`profile`,hint:`Yours — present in this install, not shipped or versioned by Geneseed.`},unknown:{label:`no status`,cls:``,icon:`about`,hint:`Not listed in registry.json.`}};function u({status:e,withHint:t=!1,compact:n=!1}){let r=l[e];if(!r)return null;if(n)return(0,c.jsxs)(`span`,{className:`badge status-icon ${r.cls}`,title:`${r.label}: ${r.hint}`,children:[(0,c.jsx)(i,{name:r.icon}),(0,c.jsx)(`span`,{className:`sr-only`,children:r.label})]});let a=(0,c.jsxs)(`span`,{className:`badge ${r.cls}`,title:t?void 0:r.hint,children:[(0,c.jsx)(`span`,{className:`dot`}),r.label]});return t?(0,c.jsxs)(c.Fragment,{children:[a,(0,c.jsx)(`span`,{className:`dim`,children:r.hint})]}):a}function d({items:e}){return Object.keys(l).filter(t=>e.some(e=>e.status===t)).map(e=>(0,c.jsxs)(`span`,{title:l[e].hint,children:[(0,c.jsx)(`span`,{className:`badge status-icon ${l[e].cls}`,"aria-hidden":`true`,children:(0,c.jsx)(i,{name:l[e].icon})}),l[e].label]},e))}function f({label:e,total:t,cats:n,cat:r,onChange:i}){if(n.length<=1)return null;let a=[{key:`all`,label:`All`,n:t,c:`var(--text-3)`},...n];return(0,c.jsxs)(`div`,{className:`rail-cats`,children:[(0,c.jsx)(`ul`,{"aria-label":e,children:a.map(({key:e,label:t,n,c:a})=>(0,c.jsx)(`li`,{children:(0,c.jsxs)(`button`,{type:`button`,className:r===e?`on`:``,"aria-pressed":r===e,style:{"--cc":a},onClick:()=>i(e),children:[(0,c.jsx)(`span`,{className:`cdot`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`rc-name`,title:t,children:t}),(0,c.jsx)(`span`,{className:`mono dim`,children:n})]})},e))}),(0,c.jsx)(`div`,{className:`rail-mix`,"aria-hidden":`true`,children:n.map(({key:e,n:t,c:n})=>(0,c.jsx)(`span`,{className:r===`all`||r===e?``:`dim`,style:{"--cc":n,flexGrow:t}},e))})]})}function p(e){let t=[],n=new Map;for(let r of e)n.has(r.group)||t.push(r.group),n.set(r.group,(n.get(r.group)||0)+1);return t.map(e=>({key:e,label:e,n:n.get(e),c:`var(--accent)`}))}var m=({name:e})=>(0,c.jsxs)(`span`,{className:`tag acc`,title:`Ships with the ${e} kit`,children:[`kit: `,e]}),h=()=>(0,c.jsx)(`span`,{className:`tag acc`,title:`Every agent inherits this agent's root file`,children:`base`});function g(e,t){let n=(t||``).trim().toLowerCase();return n?e.filter(e=>`${e.title||``} ${e.name||``} ${e.desc||``}`.toLowerCase().includes(n)):e}function _({label:e,count:t,extra:n,tools:r,toolsCompact:i,q:l,onQ:u,matched:d,inView:p,current:m,sections:h,cats:g,cat:_,onCat:v,total:y,catLabel:w,children:T}){let E=C(p),D=E.list,O=S([...p,D]),k=(0,s.useId)(),A=(0,s.useRef)(null);(0,s.useLayoutEffect)(()=>x(O.current));let[j,M]=(0,s.useState)(``),N=(0,s.useRef)(!0);return(0,s.useEffect)(()=>{N.current?N.current=!1:M(O.current?.querySelector(`.lib-row.on`)?.dataset.title||``)},p),(0,c.jsxs)(`section`,{className:`lib-list`,"aria-label":e,onKeyDown:e=>{e.key===`ArrowDown`&&e.target.classList?.contains(`lib-filter`)&&(e.preventDefault(),D||(0,o.flushSync)(()=>E.setList(!0)),O.current?.querySelector(`.lib-row`)?.focus())},"data-open":D,children:[(0,c.jsxs)(`div`,{className:`lib-list-head`,children:[(0,c.jsxs)(`b`,{children:[e,` `,(0,c.jsx)(`span`,{className:`mono dim`,children:t})]}),n]}),(0,c.jsxs)(`div`,{className:`lib-toolbar`,children:[h?(0,c.jsx)(`nav`,{className:`lib-seg`,"aria-label":`Sections`,children:h.map(e=>(0,c.jsxs)(`a`,{href:e.href,className:e.on?`on`:``,"aria-current":e.on?`page`:void 0,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0||E.setList(!0)},children:[e.label,(0,c.jsx)(`span`,{className:`mono`,children:e.n??``})]},e.key))}):null,(0,c.jsxs)(`div`,{className:`lib-toolbar-filter`,children:[(0,c.jsx)(a,{value:l,onChange:u,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),r?(0,c.jsx)(`div`,{className:`lib-tools`,children:r}):null,i?(0,c.jsx)(`div`,{className:`lib-tools-compact`,children:i}):null]}),g?.length>1?(0,c.jsx)(`div`,{className:`lib-chips`,children:(0,c.jsx)(f,{label:w,total:y,cats:g,cat:_,onChange:v})}):null]}),(0,c.jsxs)(`div`,{className:`lib-picker`,children:[(0,c.jsxs)(`button`,{ref:A,type:`button`,className:`lib-list-toggle`,"aria-expanded":D,"aria-controls":k,onClick:()=>E.setList(e=>!e),children:[(0,c.jsx)(`span`,{className:`dim lib-pick-n`,children:d===void 0?``:`${d} ${e.toLowerCase()}`}),(0,c.jsx)(`b`,{children:m}),(0,c.jsx)(`span`,{className:`dim lib-pick-hint`,children:D?`close`:`change`}),(0,c.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,c.jsxs)(`div`,{className:`lib-rows`,id:k,ref:O,onKeyDown:b,onFocus:e=>x(e.currentTarget),onClick:e=>{if(e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0)return;let t=e.target.closest?.(`.lib-row`);t&&!(p[1]&&t.classList.contains(`on`))&&E.pick()},children:[T,l.trim()&&d===0&&(0,c.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,c.jsx)(`div`,{className:`big`,children:`No matches`}),`Nothing in `,e.toLowerCase(),` matches “`,l.trim(),`”.`]})]})]}),(0,c.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:j?`${j} opened`:``})]})}function v({item:e,isOpen:t,href:n,children:r}){return(0,c.jsxs)(`a`,{className:`lib-row${t?` on`:``}`,href:n,"aria-current":t?`true`:void 0,"data-title":e.title||e.name,"data-pinned":e.base?`true`:void 0,children:[(0,c.jsxs)(`span`,{className:`lr-name`,children:[e.title||e.name,(0,c.jsx)(u,{status:e.status,compact:!0}),e.kit?(0,c.jsx)(m,{name:e.kit}):null,e.base?(0,c.jsx)(h,{}):null,r]}),e.desc?(0,c.jsx)(`span`,{className:`lr-desc`,children:e.desc}):null,e.meta?(0,c.jsx)(`span`,{className:`lr-meta mono`,children:e.meta}):null]})}function y({rows:e,activeName:t,hrefOf:n,pills:r}){let i=null,a=[];for(let o of e)o.group&&o.group!==i&&(i=o.group,a.push((0,c.jsxs)(`div`,{className:`lib-group`,children:[o.groupC?(0,c.jsx)(`span`,{className:`cdot`,style:{"--cc":o.groupC},"aria-hidden":`true`}):null,o.group]},`g-${o.group}`))),a.push((0,c.jsx)(v,{item:o,isOpen:t===o.name,href:n(o),children:r?.(o)},o.name));return a}function b(e){let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);if(n===-1)return;let r={ArrowDown:Math.min(n+1,t.length-1),ArrowUp:Math.max(n-1,0),Home:0,End:t.length-1}[e.key];r!==void 0&&(e.preventDefault(),t[r].focus())}function x(e){if(!e)return;let t=[...e.querySelectorAll(`.lib-row`)],n=t.find(e=>e===document.activeElement)||e.querySelector(`.lib-row.on`)||t[0];for(let e of t)e.tabIndex=e===n?0:-1}function S(e){let t=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=t.current,n=e?.querySelector(`.lib-row.on`);if(!n||!e)return;let r=n.offsetTop;r>=e.scrollTop&&r+n.clientHeight<=e.scrollTop+e.clientHeight||(e.scrollTop=Math.max(0,r-e.clientHeight/2+n.clientHeight/2))},e),t}function C([e,t]){let[n,r]=(0,s.useState)(!t),[i,a]=(0,s.useState)([e,t]),[o,c]=(0,s.useState)(!1);return(i[0]!==e||i[1]!==t)&&(a([e,t]),r(o||!t),c(!1)),{list:n,setList:r,pick:()=>c(!0)}}export{g as a,u as c,_ as i,d as l,y as n,f as o,m as r,p as s,h as t};
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Markdown-CxkA7940.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/AgentGlyph-k6o3gCM1.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{i}from"./router-1EhRJy1C.js";import{At as a,B as o,Ct as s,G as c,S as l,St as ee,U as te,Y as u,at as d,dt as f,et as ne,ft as re,ht as p,it as m,ot as h,t as g,tt as _,x as v}from"./index-BiKWWv7Z.js";import{n as y,t as b}from"./sections-CtFz7HFH.js";import{a as ie,c as ae,i as oe,l as se,n as ce,o as le,r as ue,t as de}from"./LibRows-1yTY0Kwn.js";import{t as fe}from"./EmptyState-CY5Pm2xy.js";import{o as x}from"./motion-RlUl1osO.js";var S=e(t(),1),C=n();function w({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,C.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function pe({entries:e}){return e.length?(0,C.jsxs)(`table`,{className:`mf-entries`,children:[(0,C.jsx)(`thead`,{className:`sr-only`,children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{scope:`col`,children:`Path`}),(0,C.jsx)(`th`,{scope:`col`,children:`Load`}),(0,C.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,C.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,C.jsx)(`td`,{className:`mf-load-cell`,children:(0,C.jsx)(w,{load:e.load})}),(0,C.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function me({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,C.jsxs)(`div`,{className:`mf-vault`,children:[(0,C.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,C.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,C.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,C.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,C.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(s,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(s,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,C.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,C.jsx)(s,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,C.jsx)(pe,{entries:t})]})}function T({body:e}){let[t,n]=(0,S.useState)(!1),r=(0,S.useId)();return e?(0,C.jsxs)(`div`,{className:`mf-raw`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,C.jsx)(s,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,C.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function he({manifest:e,body:t,name:n}){if(!e)return(0,C.jsx)(`pre`,{className:`mf-raw-pre`,children:(t||``).replace(/^```json\n|\n```$/g,``)});if(e.kind===`wiki`){let n=e.wikis||[];return n.length?(0,C.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,C.jsx)(me,{wiki:e},e.name||t)),(0,C.jsx)(T,{body:t})]}):(0,C.jsxs)(`div`,{className:`mf-empty`,children:[(0,C.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,C.jsxs)(`p`,{children:[`A wiki is your machine-wide knowledge base — an Obsidian vault or any folder of linked markdown the agent reads from and writes back to. Declare one in`,` `,(0,C.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,C.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,C.jsx)(T,{body:t})]})}let r=e.context||[];return r.length?(0,C.jsxs)(`div`,{className:`mf-doc`,children:[(0,C.jsx)(pe,{entries:r}),(0,C.jsx)(T,{body:t})]}):(0,C.jsxs)(`div`,{className:`mf-empty`,children:[(0,C.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,C.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,C.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,C.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,C.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,C.jsx)(T,{body:t})]})}function ge({name:e,install:t,installId:n}){let{data:i,error:o}=a(()=>Promise.resolve().then(()=>r.agentModels(t,{light:!0})),[e,t?.host,t?.path]),s=i?.agents?.find(t=>t.name===e);return o||!i?.claude||!s?null:(0,C.jsxs)(`p`,{className:`sub agent-model`,"data-testid":`agent-model-line`,children:[s.tier?`${s.tier} tier`:`not tiered`,` · runs on `,s.model?(0,C.jsx)(`code`,{children:s.model}):`your session model`,` — `,(0,C.jsx)(`a`,{href:`#/models`,onClick:()=>n&&c(`models`,n),children:`Change on Models →`})]})}var E=e=>e>=1e3?`${(e/1e3).toFixed(+(e<1e4))}k`:String(e),D=e=>Math.round(e/4),_e=[{key:`root`,label:`Constitution`,tone:`accent`,has:e=>e.source===`root`},{key:`catalogue`,label:`Catalogues`,tone:`muted`,has:e=>e.source===`catalogue`},{key:`agent`,label:`This agent`,tone:`warn`,has:e=>e.source!==`root`&&e.source!==`catalogue`}],O=[[`dictate`,`Dictates`],[`doctrine`,`Doctrines`],[`user`,`User rules`]],ve={"not-wired":`not wired, re-emit this install`,"no-event":`not delivered on this host`};function k(e,t){if(!e||!t)return``;let n=(e,t)=>e.blocks.filter(e=>e.chars>0&&!t.blocks.some(t=>t.id===e.id)),r=e=>e.id===`session-files`?`session files`:e.label.replace(/^.* spec$/,`spec`);return[...n(e,t).map(e=>`+ ${r(e)} ${E(e.chars)}`),...n(t,e).map(e=>`− ${r(e)} ${E(e.chars)}`)].join(`, `)}var ye=e=>e.kind===`user`?`#/personal/rules`:`#/item/law/${encodeURIComponent(e.id)}`,be=e=>`${e.layer??``}${e.id}`;function A({label:e,n:t,children:n}){return(0,C.jsxs)(`li`,{children:[(0,C.jsx)(`span`,{children:e}),n,(0,C.jsx)(`span`,{className:`mono`,children:E(t)})]})}function xe({loadout:e,base:t,error:n,install:r}){let[i,a]=(0,S.useState)(!1),[s,c]=(0,S.useState)(e?.agent);if(e?.agent!==s&&(c(e?.agent),a(!1)),n)return(0,C.jsx)(`p`,{className:`sub`,children:`Loadout not measured for this install.`});if(!e)return null;let l=e=>e.reduce((e,t)=>e+t.chars,0),ee=l(e.blocks),te=k(e,t),u=_e.map(t=>{let n=e.blocks.filter(t.has);return{...t,blocks:n,n:l(n)}}),[d,f,ne]=u,re=Math.max(1,...d.blocks.map(e=>e.chars)),p=e.blocks.find(e=>e.id===`user-rules`),m=p?ve[p.delivery]:void 0,h=e.rules||[],g=h.filter(e=>!(m&&e.kind===`user`)),_=h.filter(e=>e.citedBySpec),v=[];for(let e of h){let t=e.kind===`dictate`?`Dictates`:e.kind===`user`?`User rules`:e.id.split(`.`)[0],n=v.find(e=>e.name===t);n?n.n+=1:v.push({name:t,n:1,user:e.kind===`user`})}let y=O.map(([e,t])=>[t,g.filter(t=>t.kind===e).length]).filter(([,e])=>e>0);return(0,C.jsxs)(`section`,{className:`loadout`,"aria-label":`Loadout`,children:[(0,C.jsxs)(`header`,{className:`loadout-head`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`h3`,{className:`loadout-eyebrow mono`,children:[`Loadout · `,r||e.host]}),(0,C.jsxs)(`p`,{className:`loadout-total`,children:[(0,C.jsx)(`strong`,{children:E(D(ee))}),(0,C.jsxs)(`span`,{className:`dim`,children:[`tokens at start · `,E(ee),` chars`]})]})]}),te?(0,C.jsxs)(`div`,{className:`loadout-delta`,children:[(0,C.jsxs)(`span`,{className:`dim`,children:[`Against the `,t?.noun||`Primary agent`]}),(0,C.jsx)(`ul`,{children:te.split(`, `).map(e=>(0,C.jsx)(`li`,{className:`mono loadout-pill${e.startsWith(`+`)?` is-plus`:``}`,children:e},e))})]}):null]}),(0,C.jsxs)(`div`,{className:`loadout-bar`,children:[(0,C.jsx)(o,{label:`Loadout`,legend:!1,parts:u.map(e=>({key:e.key,label:e.label,n:e.n,tone:e.tone}))}),(0,C.jsx)(`ul`,{className:`loadout-groups`,"aria-hidden":`true`,children:u.map(e=>e.n>0?(0,C.jsxs)(`li`,{style:{flexGrow:e.n},children:[(0,C.jsx)(`span`,{children:e.label}),` `,(0,C.jsxs)(`span`,{className:`mono dim`,children:[E(e.n),` · `,Math.round(e.n/ee*100),`%`]})]},e.key):null)})]}),(0,C.jsxs)(`details`,{className:`loadout-card`,open:e.agent===`primary`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(`i`,{className:`tone-accent`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`Constitution`}),(0,C.jsx)(`span`,{className:`dim`,children:`root file, loaded by the host`}),(0,C.jsxs)(`span`,{className:`mono dim loadout-sum`,children:[E(d.n),` · ≈ `,E(D(d.n)),` tok`]})]}),(0,C.jsx)(`ul`,{className:`loadout-root`,children:d.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars,children:(0,C.jsx)(`span`,{className:`loadout-mini`,"aria-hidden":`true`,children:(0,C.jsx)(`span`,{style:{width:`${Math.max(4,e.chars/re*100)}%`}})})},e.id))})]}),(0,C.jsxs)(`div`,{className:`loadout-pair`,children:[(0,C.jsxs)(`div`,{className:`loadout-card`,children:[(0,C.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,C.jsx)(`i`,{className:`tone-muted`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`Catalogues`}),(0,C.jsx)(`span`,{className:`mono dim loadout-sum`,children:E(f.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:f.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars},e.id))}),(0,C.jsx)(`p`,{className:`dim loadout-note`,children:`Listed by the host, not by Geneseed.`})]}),(0,C.jsxs)(`div`,{className:`loadout-card is-own`,children:[(0,C.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,C.jsx)(`i`,{className:`tone-warn`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`This agent`}),(0,C.jsx)(`span`,{className:`mono dim loadout-sum`,children:E(ne.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:ne.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars,children:e.id===`user-rules`?(0,C.jsx)(`span`,{className:`loadout-pill${m?` is-plus`:``}`,children:m||`injected at sub-agent start`}):null},e.id))})]})]}),(0,C.jsxs)(`section`,{className:`loadout-rules`,"aria-label":`Rules it follows`,children:[(0,C.jsxs)(`div`,{className:`loadout-rules-h`,children:[(0,C.jsxs)(`h4`,{className:`loadout-eyebrow mono`,children:[`Rules it follows · `,g.length]}),(0,C.jsx)(`span`,{className:`dim`,children:y.map(([e,t])=>`${t} ${e}`).join(` · `)})]}),_.length?(0,C.jsxs)(`div`,{className:`loadout-cited`,children:[(0,C.jsx)(`span`,{className:`loadout-cited-h`,children:`Cited by its spec`}),_.map(e=>(0,C.jsxs)(`a`,{href:ye(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` · `,e.title]},be(e)))]}):null,(0,C.jsx)(`ul`,{className:`loadout-packs`,children:v.map(e=>e.user&&m?(0,C.jsxs)(`li`,{className:`is-muted`,children:[(0,C.jsx)(`span`,{children:`User rules`}),` `,(0,C.jsx)(`span`,{className:`mono`,children:e.n}),` `,(0,C.jsx)(`span`,{className:`dim`,children:m})]},e.name):(0,C.jsx)(`li`,{children:(0,C.jsxs)(`a`,{href:e.user?`#/personal/rules`:`#/laws`,children:[(0,C.jsx)(`span`,{children:e.name}),` `,(0,C.jsx)(`span`,{className:`mono dim`,children:e.n})]})},e.name))}),h.length?(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?`Show fewer`:`Show all ${h.length}${m?` listed`:``} rules`}):null,i?O.map(([e,t])=>{let n=h.filter(t=>t.kind===e),r=m&&e===`user`;return n.length?(0,C.jsxs)(`div`,{className:r?`is-muted`:void 0,children:[(0,C.jsxs)(`h5`,{className:`reader-when-h`,children:[t,` `,(0,C.jsx)(`span`,{className:`mono dim`,children:n.length}),r?(0,C.jsxs)(`span`,{className:`dim`,children:[` · `,m]}):null]}),(0,C.jsx)(`ul`,{children:n.map(e=>(0,C.jsxs)(`li`,{children:[r?(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}):(0,C.jsxs)(`a`,{href:ye(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}),e.layer&&e.layer!==`install`?(0,C.jsxs)(`span`,{className:`dim`,children:[` (`,e.layer,`)`]}):null]},be(e)))})]},e):null}):null]}),(0,C.jsxs)(`p`,{className:`dim loadout-foot`,children:[`Not counted: `,e.notCounted.join(`; `),`. Tokens are chars ÷ 4.`]})]})}function Se({label:e,options:t,value:n,onChange:r}){let[i,a]=(0,S.useState)(!1),o=(0,S.useRef)(null),s=(0,S.useId)(),c=t.find(e=>e.key===n)||t[0],l=()=>a(!1);return(0,S.useEffect)(()=>{i&&document.getElementById(s)?.querySelector(`[aria-pressed="true"]`)?.focus()},[i,s]),(0,C.jsxs)(`span`,{className:`drop-menu`,children:[(0,C.jsxs)(`button`,{ref:o,type:`button`,className:`drop-menu-btn`,"aria-label":`${e}: ${c.label}`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-controls":i?s:void 0,onClick:()=>a(e=>!e),children:[c.label,(0,C.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,C.jsx)(d,{open:i,onClose:l,anchorRef:o,label:e,className:`drop-menu-pop`,children:(0,C.jsx)(`div`,{id:s,className:`drop-menu-list`,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`button`)],n=t.indexOf(document.activeElement);e.preventDefault(),t[(n+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:t.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-pressed":e.key===c.key,onClick:()=>{r(e.key),l()},children:e.label},e.key))})})]})}function Ce({label:e,value:t,delta:n,children:r}){let i=x(Number.isInteger(t)?t:null);return(0,C.jsxs)(`div`,{className:`stat`,children:[(0,C.jsx)(`div`,{className:`stat-label`,children:e}),(0,C.jsx)(`div`,{className:`stat-value mono`,children:i===null?t:Math.round(i)}),n==null?null:(0,C.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var we=(0,S.lazy)(()=>g(()=>import(`./Markdown-CxkA7940.js`).then(e=>e.n),__vite__mapDeps([0,1,2]))),Te=(0,S.lazy)(()=>g(()=>import(`./AgentGlyph-k6o3gCM1.js`),__vite__mapDeps([3,1,2]))),Ee={skills:`skill`,agents:`agent`},De=`:primary`,Oe=(e,t)=>`${t?e/t*100:0}%`,ke=e=>e.split(`:`).slice(0,2).join(` `),Ae=e=>e.split(`/`).map((e,t)=>(0,C.jsxs)(S.Fragment,{children:[t?`/`:null,t?(0,C.jsx)(`wbr`,{}):null,e]},t)),j=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},je=e=>p(j(e));function Me(e,t){return e===`memory`?`memory/${t}`:e===`notebook`?`notebook/${t}`:e===`wiki`?`geneseed-wiki.jsonc`:e===`config`?t:e===`skills`?`skills/${t}/SKILL.md`:`${e}/${t}.md`}function Ne({section:e,source:t}){return(0,C.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,C.jsx)(s,{name:y[e].icon,className:`glyph`}),(0,C.jsxs)(`span`,{children:[`This entry is part of the `,y[e].label.toLowerCase(),` convention; see`,` `,(0,C.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var Pe=e=>e.replace(/\s+/g,` `).trim(),Fe=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ie(e,t){let n=e.replace(/\r\n/g,`
3
+ `),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=Fe(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?Pe(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?Pe(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=Fe(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function Le({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,C.jsx)(`div`,{className:`lib-stats`,children:(0,C.jsx)(Ce,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(ke))].join(`, `),i=t.days_counted>=30?`in the last 30 days`:`since ${t.since}`,a=Math.max(1,...e.per_day),o=[e.last?`last used ${e.last}`:null,i,r?`on ${r}`:null].filter(Boolean).join(` · `);return(0,C.jsx)(`div`,{className:`lib-stats`,children:(0,C.jsx)(Ce,{label:`Used`,value:e.n,delta:o,children:(0,C.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,C.jsx)(`i`,{className:t===29?`today`:``,style:{height:Oe(e,a)}},t))})})})}function Re(e){let t=/\s*\bUse when:\s*/i.exec(e||``);if(!t)return{lede:e||``,when:``};let n=e.slice(t.index+t[0].length).trim();return{lede:e.slice(0,t.index).trim(),when:n&&n[0].toUpperCase()+n.slice(1)}}var ze={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},Be=(e,t,n=b)=>t||(e&&b.includes(e)?e:n[0]??b[0]),Ve=encodeURIComponent;function He(e){let t=e=>v[e.klass]?e.klass:`personal`,n=l.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:v[n].label,groupC:v[n].c})));return{rows:n,cats:l.map(e=>({key:e,label:v[e].label,c:v[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ue(e){let t=e.filter(e=>e.topic).map(e=>({...e,group:e.topic}));return t.sort((e,t)=>e.group<t.group?-1:+(e.group>t.group)),[...e.filter(e=>!e.topic),...t]}function We({overview:e,section:t,selected:n,dataRev:o,lock:s,base:c,onRulesChanged:l,onCountsChanged:d}){let p=h(),{canSee:g}=ee(),x=b.filter(e=>g(`section:library/${e}`)),[w,pe]=(0,S.useState)(()=>Be(t,s,x)),[me,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(`all`),[_e,O]=(0,S.useState)(`all`),[ve,k]=(0,S.useState)(``),[ye,be]=(0,S.useState)(null),[A,Ce]=(0,S.useState)(null),[ke,Pe]=(0,S.useState)(t);if(t!==ke){Pe(t),k(``);let e=Be(t,s,x);e!==w&&(pe(e),T(``),D(`all`),O(`all`))}let[Fe,We]=(0,S.useState)(n);n!==Fe&&(We(n),k(``));let{data:Ge,error:Ke,reload:qe}=a(()=>r.catalog(w),[w,o],`catalog`),Je=s?null:Ee[w]||null,Ye=Je!==null,{data:M}=a(()=>Ye?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[Ye,o],`usage`,{revalidate:!0}),N=Ye&&!!M?.enabled&&Array.isArray(M.names),Xe=(0,S.useMemo)(()=>new Map((Array.isArray(M?.names)?M.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[M]),P=e=>N&&Xe.get(`${Je}\u0000${e}`)||null,Ze=e=>{let t=P(e.name);return!t||t.n===0&&!t.last},Qe=M?.since?`No call since ${M.since}`:`No call recorded yet`,F=Ge?.section===w,I=F&&Ge?.items||[],$e=!F&&!Ke,[et,...tt]=F&&Ge.sharedInstalls||[],L=e=>e===et?`shared`:je(e),R=w===`skills`,nt=R?He(I):null,z=R?nt.rows:w===`memory`?Ue(I):I,B=n||z[0]?.name||null,V=w===`agents`&&!s,H=V&&B===`:primary`,{data:rt,error:it}=a(()=>V?Promise.resolve().then(()=>r.loadout()):Promise.resolve(null),[V,o],`loadout-primary`,{revalidate:!0}),at=V?{name:De,type:`agent`,base:!0,title:!it&&rt?.noun||`Primary agent`,desc:`The main agent of the session. Every agent inherits its root file.`}:null,ot=H?at:B?I.find(e=>e.name===B):null,st=ot?.type||y[w].type,U=A?.sec===w&&A?.name===B?A.key:null,{data:ct,error:lt}=a(()=>!B||H?Promise.resolve(null):U?r.item(st,B,j(U)):r.item(st,B),[w,B,st,U,o,H]),W=lt?null:ct,ut=W&&W.name===B&&(!U||W.install===U)?W:null,dt=e=>Ct&&e?.install?` in ${L(e.install)}`:``,G=H?null:U||W?.install||null,ft=V&&B&&!H&&W&&W.name===B,{data:pt,error:mt}=a(()=>ft?Promise.all([r.loadout(B,G?j(G):void 0),r.loadout(void 0,G?j(G):void 0).catch(()=>null)]).then(([e,t])=>({own:e,base:t})):Promise.resolve(null),[ft,B,G,o]),ht=H?{own:it?null:rt,base:null}:pt,gt=H?it:mt,_t=ve||Ke||lt,vt=B?{name:B,title:W?.title||B,desc:W?.desc||``}:null,K=ot||vt,yt=t=>t===w&&F?I.length:e?.counts?.[t]??``,bt=u(o),xt=G||bt?.[0]?.id,St=xt?je(xt):void 0,Ct=new Set(I.flatMap(e=>e.installs||[])).size>1,wt=re([...(bt||[]).map(e=>e.id),...I.flatMap(e=>e.installs||[])],tt),q=R?z.filter(e=>E===`all`||e.cat===E):z,Tt=N?q.filter(Ze).length:0,Et=e=>e.status===`experimental`,Dt=q.filter(Et).length,J=[[`all`,`All`,q.length],...N?[[`used`,`Used`,q.length-Tt],[`unused`,`Not used yet`,Tt,Qe]]:[],...Dt?[[`experimental`,`Experimental`,Dt,`Shipped, not yet confirmed by real use`]]:[]],Y=J.some(([e])=>e===_e)?_e:`all`,Ot=Y===`all`?q:Y===`experimental`?q.filter(Et):q.filter(e=>Ze(e)===(Y===`unused`)),kt=N?Math.max(0,...I.map(e=>P(e.name)?.n||0)):0,At=R?1/0:50,X=me.trim().toLowerCase(),Z=X?ie(Ot,X):Ot.slice(0,At),jt=!X&&E===`all`&&Y===`all`&&B&&!Z.some(e=>e.name===B)?[...Z,...z.filter(e=>e.name===B)]:Z,Mt=at&&F&&E===`all`&&Y===`all`?ie([at],X):[],Nt=Mt.length+Z.length,Pt=[...Mt,...jt],Ft=e=>c?`${c}/${Ve(e.name)}`:`#/item/${e.type||y[w].type}/${Ve(e.name)}`,It=async()=>{let e=ut;if(!e)return;let t=e.name;if(await p(`Forget the memory fact "${t}"${dt(e)}? It leaves the index and moves to memory/archive/ (geneseed memory rm --archived --purge deletes it for good).`,{title:`Forget this fact?`,confirmLabel:`Forget`,tone:`danger`})){k(``);try{await r.memoryDelete(t,e.install?j(e.install):void 0)}catch(e){k(`Could not forget "${t}": ${e.message}`);return}i(c||`#/personal/memory`),qe(),d?.()}},Lt=async()=>{let e=ut;if(!e)return;let t=e.name;if(await p(`Promote "${t}"${dt(e)} into a standing rule? It is appended to user-rules.md as a trial rule (a month of probation), and the memory fact moves to memory/archive/ so the lesson isn't loaded twice.`,{title:`Promote to a rule?`,confirmLabel:`Promote`})){k(``);try{let n=e.install?j(e.install):void 0,a=await r.rules(n);await r.rulesPromote({name:t,fingerprint:a.fingerprint,delete_memory:!0},n),te(),l?.(),d?.(),i(`#/personal/rules`)}catch(e){k(`Could not promote: ${e.message}`),qe()}}},Rt=W?.body?Ie(W.body,W.desc||K?.desc):null,zt=W?.title||K?.title||K?.name,Bt=zt===K?.name&&Rt?.title?Rt.title:zt,Vt=F&&I.length===0,Ht=W?.status||K?.status,Ut=w===`skills`?v[ot?.klass]:null,Q=y[w].label,{lede:Wt,when:Gt}=Re(W?.desc||K?.desc||``),$=K&&!H?W?.source||K.source||(lt?null:Me(w,K.name)):null,Kt=async()=>{try{await navigator.clipboard.writeText($),be({src:$,ok:!0})}catch{be({src:$,ok:!1})}},qt=b.filter(e=>e===w||x.includes(e));return(0,C.jsxs)(`div`,{className:`lib-wrap`,children:[(0,C.jsx)(ne,{error:_t,style:{margin:`0 0 var(--sp-3)`}}),(0,C.jsxs)(`div`,{className:`library lib-dossier${s?` locked`:``}${N?` uses`:``}`,children:[s?null:(0,C.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,C.jsxs)(`div`,{className:`lib-title`,children:[(0,C.jsx)(`h1`,{className:`h`,children:`Library`}),(0,C.jsx)(`span`,{className:`dim`,children:`What the agent knows`}),N&&M.since?(0,C.jsxs)(`span`,{className:`mono dim lib-title-since`,children:[`calls since `,M.since]}):null]}),(0,C.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:qt.map(e=>(0,C.jsxs)(S.Fragment,{children:[(0,C.jsxs)(`a`,{href:`#/section/${e}`,className:w===e?`on`:``,"aria-current":w===e?`page`:void 0,children:[y[e].label,(0,C.jsx)(`span`,{className:`mono dim`,children:yt(e)})]}),e===w&&R&&F&&(0,C.jsx)(le,{label:`Skill types`,total:I.length,cats:nt.cats,cat:E,onChange:D})]},e))})]}),(0,C.jsxs)(oe,{label:Q,count:F?X?`${Z.length} of ${Ot.length}`:Ot.length:``,q:me,onQ:T,matched:Nt,inView:[w,n],current:K?Bt:void 0,sections:s?void 0:qt.map(e=>({key:e,label:y[e].label,n:yt(e),href:`#/section/${e}`,on:w===e})),cats:R&&F?nt.cats:null,cat:E,total:I.length,onCat:D,catLabel:`Skill types`,extra:(0,C.jsxs)(C.Fragment,{children:[N&&M.since?(0,C.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,M.since]}):null,(0,C.jsxs)(`span`,{className:`lib-legend mono`,children:[Ct?wt.map((e,t)=>(0,C.jsxs)(`span`,{className:`lk-install`,title:j(e).path,children:[(0,C.jsx)(`i`,{className:`lr-dot`,style:f(t),"aria-hidden":`true`}),L(e)]},e)):null,(0,C.jsx)(se,{items:I})]})]}),toolsCompact:F&&J.length>1?(0,C.jsx)(Se,{label:`Show`,options:J.map(([e,t])=>({key:e,label:e===`all`?`All uses`:t})),value:Y,onChange:O}):void 0,tools:F&&J.length>1?(0,C.jsx)(m,{"aria-label":`Show`,children:J.map(([e,t,n,r])=>(0,C.jsxs)(`button`,{type:`button`,className:Y===e?`on`:``,"aria-pressed":Y===e,title:r,onClick:()=>O(e),children:[t,` `,(0,C.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[$e?(0,C.jsx)(_,{}):null,(0,C.jsx)(ce,{rows:Pt,activeName:K?.name,hrefOf:Ft,pills:N||Ct?e=>{let t=P(e.name)?.n||0,n=Ct?(0,C.jsx)(`span`,{className:`lr-dots`,children:wt.map((t,n)=>e.installs?.includes(t)?(0,C.jsx)(`span`,{className:`lr-dot lr-install`,style:f(n),title:`${L(t)} — ${j(t).path}`,children:(0,C.jsx)(`span`,{className:`sr-only`,children:L(t)})},t):(0,C.jsx)(`span`,{className:`lr-dot off`,"aria-hidden":`true`},t))}):null;return N?(0,C.jsxs)(C.Fragment,{children:[n,(0,C.jsxs)(`span`,{className:`lr-use`,children:[(0,C.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,C.jsx)(`i`,{style:{width:Oe(t,kt)}})}),(0,C.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,C.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})]}):n}:void 0}),!X&&I.length>At&&(0,C.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,At,` of `,I.length,`; type to search the rest.`]}),Vt&&(w===`wiki`?(0,C.jsxs)(fe,{title:`No wiki entries`,action:(0,C.jsx)(`a`,{href:`#/section/config`,children:`Open the setup files`}),docs:{href:`#/docs/wiki`,label:`How to configure a wiki →`},children:[`Declare a wiki in `,(0,C.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,C.jsx)(fe,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,C.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:K?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`reader-tags`,children:[(0,C.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),H?(0,C.jsx)(de,{}):null,Ut?(0,C.jsx)(`span`,{className:`tag`,children:Ut.label}):null,W?.kit??K.kit?(0,C.jsx)(ue,{name:W?.kit??K.kit}):null,(0,C.jsx)(ae,{status:Ht,withHint:!0}),$?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`mono dim reader-src`,children:Ae($)}),(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Kt,children:ye?.src===$?ye.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,C.jsxs)(`div`,{className:`reader-head`,children:[(0,C.jsx)(`h2`,{className:`reader-title`,children:Bt}),w===`agents`&&!H?(0,C.jsx)(S.Suspense,{fallback:null,children:(0,C.jsx)(Te,{name:K.name})}):null]}),(0,C.jsxs)(`div`,{className:`reader-intro${N?` with-stats`:``}`,children:[(0,C.jsxs)(`div`,{className:`reader-intro-text`,children:[Wt?(0,C.jsx)(`p`,{className:`reader-lede`,children:Wt}):null,Gt?(0,C.jsxs)(`section`,{className:`reader-when`,children:[(0,C.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,C.jsx)(`p`,{children:Gt})]}):null]}),N?(0,C.jsx)(Le,{u:P(K.name),usage:M,noCall:Qe}):null]}),w===`memory`&&ut&&K.name!==`MEMORY`&&K.name!==`README`&&(0,C.jsxs)(`div`,{className:`row gap-8`,children:[(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Lt,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:It,children:`Forget this fact`})]}),W?.installs?.length>1&&W.installs.includes(W.install)?(0,C.jsxs)(`label`,{className:`row gap-8 lib-copy`,children:[(0,C.jsx)(`span`,{className:`dim`,children:`Install:`}),(0,C.jsx)(`select`,{className:`sel`,"aria-label":`Install`,value:U||W.install,onChange:e=>Ce({sec:w,name:B,key:e.target.value}),children:W.installs.map(e=>(0,C.jsx)(`option`,{value:e,title:j(e).path,children:L(e)},e))}),(0,C.jsx)(`span`,{className:`dim`,children:`this entry only`})]}):null,(0,C.jsx)(`hr`,{className:`hr`}),ft?(0,C.jsx)(ge,{name:B,install:G?j(G):void 0,installId:xt}):null,V?(0,C.jsx)(xe,{loadout:ht?.own,base:ht?.base,error:gt,install:St}):null,H?null:lt?(0,C.jsxs)(`p`,{className:`sub`,children:[`No `,Q.replace(/s$/,``).toLowerCase(),` named `,(0,C.jsx)(`em`,{children:K.name}),` could be read in this install.`]}):K?.kind===`manifest`||W?.manifest!==void 0?W?(0,C.jsx)(he,{manifest:W.manifest,body:W.body,name:K.name}):(0,C.jsx)(_,{}):W?.body?(0,C.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,C.jsx)(S.Suspense,{fallback:null,children:(0,C.jsx)(we,{body:Rt.body,links:W.links||[]})})}):W===null&&B?(0,C.jsx)(_,{}):(0,C.jsx)(Ne,{section:w,source:Me(w,K.name)}),ze[w]?(0,C.jsx)(`div`,{className:`reader-links`,children:(0,C.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${ze[w]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):$e?(0,C.jsx)(_,{}):null})]})]})}export{De as PRIMARY,Ie as bodyHead,We as default,Ue as groupMemory,je as installLabel,j as installOfKey,Be as resolveSec,He as splitSkills,Re as splitWhen};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,J as a,Y as o,et as s,gt as c,nt as l,tt as u,yt as d}from"./index-BiKWWv7Z.js";import{t as f}from"./EmptyState-CY5Pm2xy.js";import{t as p}from"./CopyButton-Dpl0PFja.js";import{a as m,n as h,o as g,r as _,s as v,t as y}from"./ActiveLoops-paFbiZyt.js";import{t as b}from"./Markdown-CxkA7940.js";import{a as x,i as S,n as ee,o as te,s as C}from"./LibRows-1yTY0Kwn.js";import{i as w}from"./motion-RlUl1osO.js";import{n as T,r as E}from"./router-1EhRJy1C.js";var D=e(t(),1),O=n(),k=encodeURIComponent,A=T.loops.map(e=>[e,E[e]]),j={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},M={project:`Project`,global:`Global`,shipped:`Shipped`},N={templates:`Categories`,bricks:`Origins`,active:`Statuses`},P=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function F(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var I=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function L(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return I(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>j[e.graph.category]?e.graph.category:`other`,[...Object.entries(j),[`other`,`Other`]])}function R(e,t){return I(e.map(e=>({...e,desc:e.description,override:F(t,e.name)})),e=>e.origin,Object.entries(M))}function z(e){return I(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,P)}var B=(e,t)=>(0,O.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),V={templates:e=>e.human?B(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?B(`warn`,`mutate`):null,g(e)?B(`human`,`human gate`):null,e.override?B(`acc`,e.override):null,e.available===!1?B(`bad`,`unavailable`):null],active:e=>B(h[e.status],e.status)};function H({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,O.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,O.jsx)(`b`,{children:(0,O.jsx)(`a`,{href:`#/loops/bricks/${k(e)}`,children:e})}),B(t.effect===`mutate`?`warn`:``,t.effect),(0,O.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,O.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),g(t)?B(`human`,g(t).toLowerCase()):null,n?B(`acc`,n):null]}):(0,O.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,O.jsx)(`b`,{children:e}),(0,O.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function U(e){let t=e.loops||[],n=t.find(e=>e.iteration),r=n?.nodes[0],i=t=>{let n=new Map;for(let r of e.edges.filter(t))n.set(r.from,[...n.get(r.from)||[],r.on]);return[...n].map(([e,t])=>`${e} says ${t.join(` or `)}`).join(`, `)},a=t=>{let i=e.edges.filter(e=>e.to===t);return!!n&&t!==r&&i.length>0&&i.every(e=>e.from===r)&&e.edges.some(e=>e.from===t&&e.to===`$close`)},o=[...new Set(e.edges.filter(e=>e.to===`$close`).map(e=>e.from))].map(e=>a(e)?`${i(t=>t.to===e)} → ${e}; ${i(t=>t.from===e&&t.to===`$close`)} → close`:`${i(t=>t.from===e&&t.to===`$close`)} → close`),s=t.filter(e=>!e.iteration).map(e=>`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)}, max ${e.max}`),c=n?e.nodes.filter(e=>!n.nodes.includes(e)):[],l=i(e=>e.to===`$stop`);return[c.length&&[`Setup`,`${c.join(` → `)}, once.`],n?[`Iteration (max ${n.max})`,`${n.nodes.filter(e=>!a(e)).join(` → `)}.`]:[`Steps`,`${e.nodes.join(` → `)}.`],s.length&&[`Retry`,`${s.join(`; `)}.`],o.length&&[`Exit`,`${o.join(`; `)}.`],[`Stop`,`${l?`${l}, or `:``}any step says error → stop.`]].filter(Boolean)}function W({t:e,bricks:t,overridden:n,runs:r}){let[i,a]=(0,D.useState)(null),o=new Map(t.map(e=>[e.name,e])),s=U(e.graph),c=v(e.graph,t),l=c.mode===`ring`,u=`geneseed loop init --graph ${e.name} --title "<title>" --requirement "<requirement>"`,d=r?.filter(t=>_(t)&&t.graph.name===e.name).length;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`reader-tags`,children:[(0,O.jsx)(`span`,{className:`tag acc`,children:`Template`}),j[e.graph.category]?B(``,j[e.graph.category]):null,e.human?B(`human`,`human gate`):null]}),(0,O.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,O.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,O.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,O.jsx)(`hr`,{className:`hr`}),(0,O.jsxs)(`figure`,{className:`loop-console`,children:[(0,O.jsx)(`div`,{className:l?`loop-graph`:`loop-graph flow`,style:{"--loop-w":`${c.width}px`},children:(0,O.jsx)(m,{graph:e.graph,bricks:t,onSelect:e=>{a(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:w()?`smooth`:`auto`,block:`nearest`})}})}),(0,O.jsxs)(`figcaption`,{className:`loop-how`,children:[(0,O.jsx)(`span`,{className:`loop-kicker`,children:`How it runs`}),(0,O.jsx)(`ol`,{children:s.map(([e,t])=>(0,O.jsxs)(`li`,{children:[(0,O.jsxs)(`b`,{children:[e,`:`]}),` `,t]},e))}),l?(0,O.jsxs)(`span`,{className:`loop-legend`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`i`,{className:`ring`,"aria-hidden":`true`}),`iteration`]}),s.some(([e])=>e===`Retry`)?(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`i`,{className:`inner`,"aria-hidden":`true`}),`retry`]}):null]}):null]})]}),(0,O.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`loop-start-h`,children:[(0,O.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,O.jsx)(`h3`,{id:`loop-start-h`,className:`loop-kicker`,children:`Start it in your project`}),(0,O.jsx)(p,{text:u,label:`Copy command`})]}),(0,O.jsx)(`pre`,{className:`mono`,children:u})]}),r?(0,O.jsxs)(`p`,{className:`panel-note loop-running`,children:[`Running now: `,d?`${d} of this template`:`none`,`.`,` `,d?(0,O.jsx)(`a`,{href:`#/loops/active`,children:`Open Active →`}):`A started loop appears under Active with its iteration and preset.`]}):null,e.graph.rules?.length?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,O.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,O.jsx)(`li`,{children:e},e))})]}):null,(0,O.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,O.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,O.jsx)(H,{name:e,brick:o.get(e),override:F(n,e),on:i===e},e))})]})}function G(e){return`---\n${[[`name`,e.name],[`description`,e.description],[`effect`,e.effect],[e.agent?`agent`:`skill`,e.agent||e.skill],[`gate`,e.gate],[`gateOn`,e.gateOn?.join(`, `)],[`outcomes`,e.outcomes.join(`, `)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(`
2
+ `)}\n---\n${e.body}`}function K({b:e}){let[t,n]=(0,D.useState)(!1),r=[[`effect`,B(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,O.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>B(``,e))],[`gate`,g(e)?B(`human`,g(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,O.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`reader-tags`,children:[(0,O.jsx)(`span`,{className:`tag acc`,children:`Brick`}),V.bricks(e)]}),(0,O.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,O.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,O.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,O.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,O.jsxs)(D.Fragment,{children:[(0,O.jsx)(`dt`,{children:e}),(0,O.jsx)(`dd`,{children:t})]},e))}),(0,O.jsx)(`hr`,{className:`hr`}),(0,O.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,O.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,O.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:G(e)}):(0,O.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,O.jsx)(b,{body:e.body})})]})}function ne({problems:e}){if(!e?.length)return null;let t=e.length;return(0,O.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,O.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,O.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,O.jsx)(`li`,{className:`mono`,children:e},e))})]})}var q={templates:{title:`No templates`,body:(0,O.jsxs)(O.Fragment,{children:[`Add one under `,(0,O.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]})},bricks:{title:`No bricks`,body:(0,O.jsxs)(O.Fragment,{children:[`Add one under `,(0,O.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]})},active:{title:`No loops yet`,body:(0,O.jsxs)(O.Fragment,{children:[`Start one with `,(0,O.jsx)(`code`,{className:`mono`,children:`geneseed loop init`}),` in a worktree, or ask the agent to run a loop. It shows up here while it runs.`]})}},re={templates:(0,O.jsxs)(O.Fragment,{children:[`A template wires bricks into a loop. `,(0,O.jsx)(`a`,{href:`#/docs/loops`,children:`How loops work →`}),` `,(0,O.jsx)(`a`,{href:`#/docs/loop-which-template`,children:`Which template? →`})]}),bricks:(0,O.jsxs)(O.Fragment,{children:[`A brick is one step: a skill or agent and its outcomes.`,` `,(0,O.jsx)(`a`,{href:`#/docs/loop-bricks`,children:`About bricks →`})]}),active:(0,O.jsxs)(O.Fragment,{children:[`Loops registered on this machine, read from their LOOP.md.`,` `,(0,O.jsx)(`a`,{href:`#/docs/loop-running`,children:`Running a loop →`})]})};function J({tab:e=`templates`,item:t,dataRev:n}){let p=o(n),[m,h]=a(`loops`,p),{data:g,error:v}=i(()=>r.loops(c(m)),[n,m?.id??``],`loops`),b=d(),[w,T]=(0,D.useState)(``),[E,j]=(0,D.useState)(`all`),[M,P]=(0,D.useState)(e);e!==M&&(P(e),T(``),j(`all`));let F=g?.bricks||[],I=e===`active`?b.loops&&z(b.loops):g&&(e===`bricks`?R(g.bricks,g.overridden):L(g.templates,g.bricks)),B=I||[],H=C(B),U=E===`all`?B:B.filter(e=>e.group===E),G=w.trim(),J=x(U,G),Y=!!(t&&I&&!B.some(e=>e.name===t)),X=Y?null:B.find(e=>e.name===t)||e===`active`&&B.find(_)||B[0]||null,Z={templates:g?.templates.length,bricks:g?.bricks.length,active:b.loops?.length},Q=A.find(([t])=>t===e)[1],$=e===`active`?b.error:v;return(0,O.jsxs)(`div`,{className:`lib-wrap`,children:[e===`active`?null:(0,O.jsx)(l,{className:`page-pick`,installs:p,value:m,onChange:h}),(0,O.jsx)(s,{error:$,style:{margin:`0 0 var(--sp-3)`}}),(0,O.jsx)(ne,{problems:g?.problems}),(0,O.jsxs)(`div`,{className:`library`,children:[(0,O.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,O.jsxs)(`div`,{className:`lib-title`,children:[(0,O.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,O.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,O.jsx)(`p`,{className:`panel-note lib-lede`,children:re[e]}),(0,O.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:A.map(([t,n])=>(0,O.jsxs)(D.Fragment,{children:[(0,O.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,O.jsx)(`span`,{className:`mono dim`,children:Z[t]??``})]}),e===t&&(0,O.jsx)(te,{label:N[t],total:B.length,cats:H,cat:E,onChange:j})]},t))})]}),(0,O.jsx)(S,{label:Q,count:G?`${J.length} of ${U.length}`:I?U.length:``,q:w,onQ:T,matched:J.length,inView:[e,t],current:X?.name,sections:A.map(([t,n])=>({key:t,label:n,n:Z[t],href:`#/loops/${t}`,on:e===t})),cats:H,cat:E,total:B.length,onCat:j,catLabel:N[e],children:I?B.length===0?(0,O.jsx)(f,{title:q[e].title,children:q[e].body}):(0,O.jsx)(ee,{rows:J,activeName:X?.name,hrefOf:t=>`#/loops/${e}/${k(t.name)}`,pills:V[e]}):$?null:(0,O.jsx)(u,{})}),(0,O.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:Y?(0,O.jsx)(f,{title:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/loops/${e}`,label:`All ${Q.toLowerCase()} →`}}):X?e===`active`?(0,O.jsx)(y,{loop:X,bricks:F,onPreset:b.onPreset}):e===`bricks`?(0,O.jsx)(K,{b:X}):(0,O.jsx)(W,{t:X,bricks:F,overridden:g.overridden,runs:b.loops},X.name):e===`active`&&I?(0,O.jsx)(f,{title:`What is a loop?`,docs:{href:`#/docs/loops`,label:`How loops work →`},children:`A loop runs bricks in a ring until its gate passes.`}):null})]})]})}export{z as activeRows,R as brickRows,G as brickSource,J as default,U as howItRuns,L as templateRows};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,H as a,J as o,Y as s,et as c,gt as l,ht as u,it as d,nt as f,ot as p,pt as m,tt as ee}from"./index-BiKWWv7Z.js";var h=e(t(),1);function te(e,t){return e===`pin`?`pin`:e===`map`?`tiers map`:e==="default"?`tier default`:t===`auto`?`session model`:`routing off`}var ne=(e,t)=>!t||t===`inherit`||e.some(e=>e.id===t&&e.provider!==`in-use`);function re(e,t){return Object.hasOwn(e.map||{},t)?e.map[t]:e.defaults?.[t]??``}var g=e=>`${e.id} ${e.name} ${e.providerName} ${e.note||``}`.toLowerCase();function _(e,t){let n=(t||``).trim().toLowerCase(),r=[];for(let t of e.groups||[]){let i=(e.models||[]).filter(e=>e.provider===t.provider&&e.source===t.source),a=n?i.filter(e=>g(e).includes(n)):i;(!n||a.length)&&r.push({...t,rows:a})}return r}function v(e){return typeof e==`number`?e>=1e6?`${+(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e):``}function y(e){if(!e)return``;let t=e=>e==null?`?`:`$${+e.toFixed(2)}`;return`${t(e.input)} in / ${t(e.output)} out per 1M`}var b=n();function x({open:e,title:t,data:n,current:r,onPick:i,onClose:a}){let o=(0,h.useRef)(null),s=(0,h.useId)(),[c,l]=(0,h.useState)(``),[u,d]=(0,h.useState)(r&&r!==`inherit`?r:``);(0,h.useEffect)(()=>{let t=o.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]);let f=(e,t)=>t.id===r&&!(e.provider===`in-use`&&t.detected),p=e?_(n,c):[],m=u.trim();return(0,b.jsxs)(`dialog`,{ref:o,className:`confirm model-picker`,"aria-labelledby":`${s}-title`,onCancel:a,onClose:a,children:[(0,b.jsx)(`h3`,{className:`confirm-title`,id:`${s}-title`,children:t}),(0,b.jsx)(`input`,{className:`inp mp-search`,type:`search`,"aria-label":`Search models`,placeholder:`Search models`,value:c,onChange:e=>l(e.target.value)}),(0,b.jsxs)(`div`,{className:`mp-list`,children:[p.map(e=>(0,b.jsxs)(`section`,{className:`mp-group`,"aria-label":e.providerName,children:[(0,b.jsxs)(`header`,{className:`mp-head`,children:[(0,b.jsx)(`span`,{className:`mp-name`,children:e.providerName}),(0,b.jsx)(`span`,{className:`dim`,children:e.note}),e.available===!1?(0,b.jsx)(`span`,{className:`tag warn`,children:e.reason||`unavailable`}):null]}),e.rows.map(t=>(0,b.jsxs)(`button`,{type:`button`,className:`mp-row${f(e,t)?` on`:``}`,disabled:t.available===!1,"aria-pressed":f(e,t),onClick:()=>i(t.id),title:t.available===!1?t.reason:void 0,children:[(0,b.jsxs)(`span`,{className:`mp-id`,children:[t.id===`inherit`?`Session model (inherit)`:t.name===t.id?t.id:t.name,t.id!==`inherit`&&t.name!==t.id?(0,b.jsxs)(`span`,{className:`dim mono`,children:[` `,t.id]}):null]}),(0,b.jsxs)(`span`,{className:`mp-meta`,children:[t.id===`inherit`?null:(0,b.jsx)(`span`,{className:`tag ${t.local?`ok`:``}`,children:t.local?`local`:`remote`}),t.context?(0,b.jsxs)(`span`,{className:`tag`,children:[v(t.context),` ctx`]}):null,t.cost?(0,b.jsx)(`span`,{className:`tag`,children:y(t.cost)}):null,t.reasoning?(0,b.jsx)(`span`,{className:`tag acc`,children:`reasoning`}):null,t.variants?.length?(0,b.jsxs)(`span`,{className:`tag`,children:[`variants: `,t.variants.join(`, `)]}):null,t.detected===!1?(0,b.jsx)(`span`,{className:`tag warn`,children:`not detected`}):null,t.available===!1?(0,b.jsx)(`span`,{className:`tag warn`,children:t.reason||`unavailable`}):null]})]},`${e.provider}|${t.id}`))]},`${e.provider}|${e.source}|${e.note}`)),e&&!p.some(e=>e.rows.length)&&c?(0,b.jsxs)(`p`,{className:`sub`,children:[`No model matches “`,c,`”.`]}):null]}),(0,b.jsxs)(`form`,{className:`mp-custom`,onSubmit:e=>{e.preventDefault(),m&&i(m)},children:[(0,b.jsxs)(`label`,{className:`mp-custom-label`,children:[(0,b.jsx)(`span`,{className:`dim`,children:`Custom…`}),(0,b.jsx)(`input`,{className:`inp`,type:`text`,"aria-label":`Custom model id`,placeholder:`provider/model, or the id as the host knows it`,value:u,onChange:e=>d(e.target.value)})]}),(0,b.jsx)(`button`,{type:`submit`,className:`btn ghost sm`,disabled:!m,children:`Use this id`})]}),(0,b.jsx)(`div`,{className:`confirm-actions`,children:(0,b.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:a,children:`Cancel`})})]})}var ie=[[`standard`,`Standard`],[`light`,`Light`]],ae={strong:`acc`,standard:``,light:`ok`},S={strong:0,standard:1,light:2},oe=[`off`,`auto`];function C({dataRev:e,onAction:t}){let n=p(),g=s(e),[_,v]=o(`models`,g),{data:y,error:C,setData:w,reload:T}=i(()=>Promise.resolve().then(()=>r.agentModels(l(_))),[e,_?.id??``]),[E,D]=(0,h.useState)({}),[O,k]=(0,h.useState)({}),[A,j]=(0,h.useState)(null),[M,N]=(0,h.useState)(null),[P,F]=(0,h.useState)(!1),[I,L]=(0,h.useState)(``),[R,z]=(0,h.useState)(!1),[se,B]=(0,h.useState)(!1),[ce,le]=(0,h.useState)(_?.id);_?.id!==ce&&(le(_?.id),D({}),k({}),j(null),B(!1),L(``));let V=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f,{className:`page-pick`,installs:g,value:_,onChange:v}),(0,b.jsx)(a,{title:`Models`,sub:`The model each sub-agent runs on, per install. Strong agents always use your session model.`})]});if(g!==null&&g.length===0)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsxs)(`p`,{className:`sub`,"data-testid":`models-no-install`,children:[`No Geneseed install is active, so there is no agent model to set.`,` `,(0,b.jsx)(`a`,{href:`#/installs`,children:`Install one on Installs →`})]})]});if(C)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsx)(c,{error:C})]});if(!y||!_)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsx)(ee,{})]});let H=m(y.host).label;if(!y.claude)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsxs)(`p`,{className:`sub`,children:[H,` takes no per-agent model, so there is nothing to set here for`,` `,u(_),`.`]})]});let U=y.file?.problem,W=A??y.tiers,G=y.models||[],K=e=>E[e]!==void 0,q=e=>K(e)?E[e]===null?y.defaults?.[e]??``:E[e]:re(y,e),ue=e=>O[e.name]===void 0?e.pin:O[e.name],J=Object.keys(E).length+Object.keys(O).length,Y=A!==null&&A!==y.tiers,X=J+ +!!Y,de=P?[...y.agents].sort((e,t)=>(S[e.tier]??9)-(S[t.tier]??9)||e.name.localeCompare(t.name)):y.agents,Z=e=>{if(!e)return`Session model`;let t=G.find(t=>t.id===e&&t.provider!==`in-use`);return t&&t.name!==t.id?`${t.name} (${e})`:e},Q=e=>ne(G,e)?null:(0,b.jsx)(`span`,{className:`tag warn`,children:`not detected`}),fe=e=>{let{kind:t,key:n}=M;if(N(null),B(!1),t===`tier`){let t=e===`inherit`?``:e;D(e=>({...e,[n]:t===(y.defaults?.[n]??void 0)?null:t}))}else k(t=>({...t,[n]:e===`inherit`?null:e}))},pe=async()=>{if(J){z(!0),L(``);try{let e=await r.agentModelsSave({tiers:E,agents:O},l(_));w({...y,...e}),T(),D({}),k({}),B(!0)}catch(e){L(e.message);return}finally{z(!1)}}Y&&await $()},$=async()=>{await n(`Rebuild this ${H} install with model routing ${W}? The models are written into the agent files; it rebuilds in place, non-destructive.`,{title:`Rebuild this install?`,confirmLabel:`Rebuild`})&&t?.(`install`,{host:_.host,scope:_.scope,path:_.path,tiers:W})},me=M?M.kind===`tier`?q(M.key)||`inherit`:(O[M.key]===void 0?y.agents.find(e=>e.name===M.key)?.pin:O[M.key])||`inherit`:null;return(0,b.jsxs)(`div`,{className:`lib-wrap models-page`,children:[V,(0,b.jsx)(c,{error:I,style:{margin:`0 0 var(--sp-3)`}}),U?(0,b.jsxs)(`p`,{className:`sub tiers-warn`,role:`alert`,children:[U,`.`]}):null,y.warnings.map(e=>(0,b.jsx)(`p`,{className:`sub tiers-warn`,role:`note`,children:e},e)),(0,b.jsxs)(`div`,{className:`panel models-routing`,children:[(0,b.jsxs)(`div`,{className:`panel-head`,children:[(0,b.jsx)(`h2`,{children:`Routing`}),(0,b.jsx)(d,{"aria-label":`Model routing for ${u(_)}`,children:oe.map(e=>(0,b.jsx)(`button`,{type:`button`,className:W===e?`on`:``,"aria-pressed":W===e,onClick:()=>{j(e===y.tiers?null:e),B(!1)},children:e},e))})]}),(0,b.jsxs)(`p`,{className:`panel-note`,children:[W===`auto`?`Agents run on the model of their tier, unless you pin one. Applied at the next rebuild.`:`Every agent runs on your session model, unless you pin one.`,Y?` Not rebuilt yet: Save rebuilds this install.`:``]})]}),(0,b.jsxs)(`div`,{className:`panel models-tiers`,role:`group`,"aria-label":`Models by tier`,children:[(0,b.jsx)(`div`,{className:`panel-head`,children:(0,b.jsx)(`h2`,{children:`Tiers`})}),(0,b.jsxs)(`div`,{className:`models-tier-row`,children:[(0,b.jsx)(`span`,{children:`Strong`}),(0,b.jsx)(`span`,{className:`dim`,children:`session model, always`})]}),ie.map(([e,t])=>{let n=q(e);return(0,b.jsxs)(`div`,{className:`models-tier-row`,children:[(0,b.jsx)(`span`,{children:t}),(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm models-model`,disabled:!!U||R,"aria-label":`${t} tier model: ${Z(n)}. Change`,onClick:()=>N({kind:`tier`,key:e}),children:Z(n)}),Q(n),K(e)?(0,b.jsx)(`span`,{className:`tag acc`,children:`unsaved`}):null]},e)}),(0,b.jsx)(`p`,{className:`panel-note`,children:Object.keys(y.defaults||{}).length?`Host defaults: ${Object.entries(y.defaults).map(([e,t])=>`${e} ${t}`).join(`, `)}.`:`${H} has no default model for a tier: a tier routes once you pick one.`})]}),(0,b.jsx)(`div`,{className:`panel flush models-agents`,children:(0,b.jsxs)(`table`,{className:`ldg`,"aria-label":`Agents`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{scope:`col`,children:`Agent`}),(0,b.jsx)(`th`,{scope:`col`,"aria-sort":P?`ascending`:`none`,children:(0,b.jsxs)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>F(e=>!e),children:[`Tier`,P?` ▲`:``]})}),(0,b.jsx)(`th`,{scope:`col`,children:`Runs on`}),(0,b.jsx)(`th`,{scope:`col`,children:`Because`}),(0,b.jsx)(`th`,{scope:`col`,children:`Pin`})]})}),(0,b.jsx)(`tbody`,{children:de.map(e=>{let t=ue(e);return(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{className:`mono`,children:e.name}),(0,b.jsx)(`td`,{children:e.tier?(0,b.jsx)(`span`,{className:`tag ${ae[e.tier]??``}`,children:e.tier}):(0,b.jsx)(`span`,{className:`tag`,title:`No Geneseed source: not tiered`,children:`not tiered`})}),(0,b.jsx)(`td`,{className:`mono`,children:e.model?Z(e.model):(0,b.jsx)(`span`,{className:`dim`,children:`session model`})}),(0,b.jsx)(`td`,{className:`dim`,children:te(e.from,y.tiers)}),(0,b.jsx)(`td`,{children:(0,b.jsxs)(`span`,{className:`row gap-8 wrap`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm models-model`,disabled:!!U||R,"aria-label":`Pin a model for ${e.name}`,onClick:()=>N({kind:`pin`,key:e.name}),children:t?Z(t):`No pin`}),t?Q(t):null,O[e.name]===void 0?null:(0,b.jsx)(`span`,{className:`tag acc`,children:`unsaved`}),t?(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!!U||R,"aria-label":`Clear the pin of ${e.name}`,onClick:()=>{k(t=>({...t,[e.name]:null})),B(!1)},children:`Clear`}):null]})})]},e.name)})})]})}),(0,b.jsxs)(`div`,{className:`models-foot row gap-8 wrap`,children:[(0,b.jsx)(`span`,{className:`sub`,role:`status`,children:X?`${X} unsaved change${X===1?``:`s`}`:se?`Saved. The agent files change at the next rebuild.`:`No unsaved changes.`}),(0,b.jsx)(`button`,{type:`button`,className:`btn`,disabled:!X||J>0&&!!U||R,onClick:pe,children:Y?`Save and rebuild…`:`Save`}),(0,b.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:X>0||R,onClick:$,children:`Rebuild…`})]}),(0,b.jsx)(x,{open:!!M,title:M?M.kind===`tier`?`${M.key} tier model`:`Model for ${M.key}`:``,data:y,current:me,onPick:fe,onClose:()=>N(null)},M?`${M.kind}:${M.key}`:`closed`)]})}export{C as default};
@@ -1 +1 @@
1
- import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{I as n,vt as r}from"./index-BhT94v2q.js";import{n as i,r as a}from"./sections-CtFz7HFH.js";import{n as o,r as s}from"./Dashboard-CWhh_GSc.js";e();var c=t(),l=14;function u({title:e,right:t,children:n,span:r}){return(0,c.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,c.jsxs)(`div`,{className:`c-mod-head`,children:[(0,c.jsx)(`span`,{className:`c-tab`}),(0,c.jsx)(`h3`,{children:e}),t&&(0,c.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,c.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function d({label:e,value:t}){return(0,c.jsxs)(`div`,{className:`c-kpi`,children:[(0,c.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,c.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function f({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,c.jsx)(`div`,{className:`c-cols`,style:{height:t},children:e.map((e,i)=>{let a=Math.max(e.v/r*(t-6),2);return(0,c.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function p({checks:e}){return(0,c.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,c.jsx)(`span`,{className:`c-band-cell ${e.problems.length===0?`ok`:`bad`}`,title:`${e.label}: ${e.problems.length===0?`pass`:`${e.problems.length} problem(s)`}`},t))})}function m(e){let t={};for(let n of e||[]){let e=n.action||`unknown`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>({label:e,value:t})).sort((e,t)=>t.value-e.value)}function h({overview:e,jobs:t,lens:h}){let g=e.counts||{},_=a.reduce((e,t)=>e+(g[t]||0),0),v=Math.max(...a.map(e=>g[e]||0),1),y=h?.doctor?.state||`loading`,b=h?.doctor?.data?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=n(t||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(t),T=Math.max(...w.map(e=>e.value),1),E=r(e.diff),D=[[`status`,e.deployed?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,c.jsx)(`span`,{className:`t-cap`,children:e.theme})],[`mode`,e.emit],[`doctor`,y===`failed`?(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NO ANSWER`}):y===`ok`?b.length===0?(0,c.jsx)(`span`,{className:`c-pill`,children:`—`}):x===b.length?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,c.jsxs)(`span`,{className:`c-pill warn`,children:[b.length-x,` ISSUES`]}):(0,c.jsx)(`span`,{className:`c-pill`,children:`…`})],[`edits`,String(E)],[`built`,e.build_time||`—`],[`target`,(0,c.jsx)(`span`,{className:`c-dim mono`,children:e.target})]];return(0,c.jsxs)(`div`,{className:`c-root`,children:[(0,c.jsx)(`div`,{className:`c-titlebar`,children:(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h2`,{className:`c-h1`,children:`HARNESS // STATUS`}),(0,c.jsxs)(`div`,{className:`c-sub`,children:[e.target,` · rendered from src/ · inherited everywhere`]}),(0,c.jsx)(o,{verdict:h?.verdict})]})}),(0,c.jsx)(`div`,{className:`c-strip`,children:D.map(([e,t],n)=>(0,c.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,c.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,c.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,c.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,c.jsx)(d,{label:`AGENTS`,value:g.agents??`—`}),(0,c.jsx)(d,{label:`SKILLS`,value:g.skills??`—`}),(0,c.jsx)(d,{label:`DICTATES`,value:g.laws??`—`}),(0,c.jsx)(d,{label:`PACKS`,value:g.doctrines?`${g.doctrines.active}/${g.doctrines.total}`:`—`}),(0,c.jsx)(d,{label:`MEMORY`,value:g.memory??`—`}),(0,c.jsx)(d,{label:`NOTEBOOK`,value:g.notebook??`—`}),(0,c.jsx)(d,{label:`EDITS`,value:E})]}),(0,c.jsxs)(`div`,{className:`c-grid`,children:[(0,c.jsx)(u,{title:`CAPABILITY DISTRIBUTION`,right:`${_} ENTRIES`,span:2,children:(0,c.jsxs)(`table`,{className:`c-tbl`,children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`th`,{children:`SECTION`}),(0,c.jsx)(`th`,{children:`DETAIL`}),(0,c.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,c.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,c.jsx)(`tbody`,{children:a.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,children:i[e].label}),(0,c.jsx)(`td`,{className:`c-dim`,children:i[e].desc}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${(g[e]||0)/v*100}%`,background:e===`agents`||e===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,c.jsx)(`td`,{className:(g[e]||0)>0?`num`:`num c-dim`,children:g[e]??0})]},e))})]})}),(0,c.jsx)(u,{title:`DOCTOR // CHECKS`,right:b.length?`${x}/${b.length}`:`—`,children:b.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{checks:b}),(0,c.jsx)(`div`,{className:`c-check-list`,children:b.map(e=>{let t=e.problems.length===0;return(0,c.jsxs)(`div`,{className:`c-check-row`,children:[(0,c.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,c.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,c.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:y===`failed`?`Doctor did not answer.`:y===`ok`?`Doctor reported no checks.`:`Checking…`})}),(0,c.jsxs)(u,{title:`RUN RATE // 10D`,right:`${C} RUNS`,span:2,children:[(0,c.jsx)(f,{data:S,height:120,hi:S.length-1}),(0,c.jsx)(`div`,{className:`c-axis`,children:S.map((e,t)=>(0,c.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,c.jsx)(u,{title:`RUN LOG // BY TYPE`,right:`${(t||[]).length} LOGGED`,children:w.length>0?(0,c.jsx)(`table`,{className:`c-tbl`,children:(0,c.jsx)(`tbody`,{children:w.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${e.value/T*100}%`,background:`var(--accent)`}})})}),(0,c.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})}),(0,c.jsx)(u,{title:`RECENT // RUN LOG`,span:3,children:(0,c.jsx)(s,{jobs:t,max:l,empty:(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})})})]})]})}export{h as default};
1
+ import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{I as n,wt as r}from"./index-BiKWWv7Z.js";import{n as i,r as a}from"./sections-CtFz7HFH.js";import{n as o,r as s}from"./Dashboard-CQxdiv7F.js";e();var c=t(),l=14;function u({title:e,right:t,children:n,span:r}){return(0,c.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,c.jsxs)(`div`,{className:`c-mod-head`,children:[(0,c.jsx)(`span`,{className:`c-tab`}),(0,c.jsx)(`h3`,{children:e}),t&&(0,c.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,c.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function d({label:e,value:t}){return(0,c.jsxs)(`div`,{className:`c-kpi`,children:[(0,c.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,c.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function f({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,c.jsx)(`div`,{className:`c-cols`,style:{height:t},children:e.map((e,i)=>{let a=Math.max(e.v/r*(t-6),2);return(0,c.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function p({checks:e}){return(0,c.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,c.jsx)(`span`,{className:`c-band-cell ${e.problems.length===0?`ok`:`bad`}`,title:`${e.label}: ${e.problems.length===0?`pass`:`${e.problems.length} problem(s)`}`},t))})}function m(e){let t={};for(let n of e||[]){let e=n.action||`unknown`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>({label:e,value:t})).sort((e,t)=>t.value-e.value)}function h({overview:e,jobs:t,lens:h}){let g=e.counts||{},_=a.reduce((e,t)=>e+(g[t]||0),0),v=Math.max(...a.map(e=>g[e]||0),1),y=h?.doctor?.state||`loading`,b=h?.doctor?.data?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=n(t||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(t),T=Math.max(...w.map(e=>e.value),1),E=r(e.diff),D=[[`status`,e.deployed?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,c.jsx)(`span`,{className:`t-cap`,children:e.theme})],[`mode`,e.emit],[`doctor`,y===`failed`?(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NO ANSWER`}):y===`ok`?b.length===0?(0,c.jsx)(`span`,{className:`c-pill`,children:`—`}):x===b.length?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,c.jsxs)(`span`,{className:`c-pill warn`,children:[b.length-x,` ISSUES`]}):(0,c.jsx)(`span`,{className:`c-pill`,children:`…`})],[`edits`,String(E)],[`built`,e.build_time||`—`],[`target`,(0,c.jsx)(`span`,{className:`c-dim mono`,children:e.target})]];return(0,c.jsxs)(`div`,{className:`c-root`,children:[(0,c.jsx)(`div`,{className:`c-titlebar`,children:(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h2`,{className:`c-h1`,children:`HARNESS // STATUS`}),(0,c.jsxs)(`div`,{className:`c-sub`,children:[e.target,` · rendered from src/ · inherited everywhere`]}),(0,c.jsx)(o,{verdict:h?.verdict})]})}),(0,c.jsx)(`div`,{className:`c-strip`,children:D.map(([e,t],n)=>(0,c.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,c.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,c.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,c.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,c.jsx)(d,{label:`AGENTS`,value:g.agents??`—`}),(0,c.jsx)(d,{label:`SKILLS`,value:g.skills??`—`}),(0,c.jsx)(d,{label:`DICTATES`,value:g.laws??`—`}),(0,c.jsx)(d,{label:`PACKS`,value:g.doctrines?`${g.doctrines.active}/${g.doctrines.total}`:`—`}),(0,c.jsx)(d,{label:`MEMORY`,value:g.memory??`—`}),(0,c.jsx)(d,{label:`NOTEBOOK`,value:g.notebook??`—`}),(0,c.jsx)(d,{label:`EDITS`,value:E})]}),(0,c.jsxs)(`div`,{className:`c-grid`,children:[(0,c.jsx)(u,{title:`CAPABILITY DISTRIBUTION`,right:`${_} ENTRIES`,span:2,children:(0,c.jsxs)(`table`,{className:`c-tbl`,children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`th`,{children:`SECTION`}),(0,c.jsx)(`th`,{children:`DETAIL`}),(0,c.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,c.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,c.jsx)(`tbody`,{children:a.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,children:i[e].label}),(0,c.jsx)(`td`,{className:`c-dim`,children:i[e].desc}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${(g[e]||0)/v*100}%`,background:e===`agents`||e===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,c.jsx)(`td`,{className:(g[e]||0)>0?`num`:`num c-dim`,children:g[e]??0})]},e))})]})}),(0,c.jsx)(u,{title:`DOCTOR // CHECKS`,right:b.length?`${x}/${b.length}`:`—`,children:b.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{checks:b}),(0,c.jsx)(`div`,{className:`c-check-list`,children:b.map(e=>{let t=e.problems.length===0;return(0,c.jsxs)(`div`,{className:`c-check-row`,children:[(0,c.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,c.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,c.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:y===`failed`?`Doctor did not answer.`:y===`ok`?`Doctor reported no checks.`:`Checking…`})}),(0,c.jsxs)(u,{title:`RUN RATE // 10D`,right:`${C} RUNS`,span:2,children:[(0,c.jsx)(f,{data:S,height:120,hi:S.length-1}),(0,c.jsx)(`div`,{className:`c-axis`,children:S.map((e,t)=>(0,c.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,c.jsx)(u,{title:`RUN LOG // BY TYPE`,right:`${(t||[]).length} LOGGED`,children:w.length>0?(0,c.jsx)(`table`,{className:`c-tbl`,children:(0,c.jsx)(`tbody`,{children:w.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${e.value/T*100}%`,background:`var(--accent)`}})})}),(0,c.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})}),(0,c.jsx)(u,{title:`RECENT // RUN LOG`,span:3,children:(0,c.jsx)(s,{jobs:t,max:l,empty:(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})})})]})]})}export{h as default};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,H as a,W as o,Y as s,et as c,gt as l,ht as u,it as d,nt as f,ot as p,q as m,tt as h}from"./index-BiKWWv7Z.js";import{t as g}from"./Tabs-BDhZImxa.js";import{t as _}from"./EmptyState-CY5Pm2xy.js";import{a as v,i as y}from"./router-1EhRJy1C.js";import{t as b}from"./Markdown-CxkA7940.js";import x,{installLabel as S}from"./Library-BQZnFdWs.js";var C=e(t(),1),w=e=>e(`Discard your unsaved edit?`,{title:`Unsaved edit`,confirmLabel:`Discard`,tone:`danger`}),T=`The file changed on disk — reloaded the fresh copy. Your draft is kept.`;function E({data:e,reload:t}){let n=p(),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(``),d=e?.fingerprint||``,f=r!==null&&JSON.stringify(r)!==JSON.stringify(a),m=(0,C.useRef)(!1),h=e=>{i(e),o(e)},g=()=>i(null);return(0,C.useEffect)(()=>{if(!f)return;let e=e=>{e.preventDefault(),e.returnValue=``};window.addEventListener(`beforeunload`,e);let t=v(({to:e})=>(m.current||(m.current=!0,w(n).then(n=>{n&&(t(),i(null),y(e))}).finally(()=>{m.current=!1})),!1));return()=>{window.removeEventListener(`beforeunload`,e),t()}},[f,n]),{draft:r,setDraft:i,open:h,close:g,discard:async()=>f&&!await w(n)?!1:(g(),!0),dirty:f,busy:s,notice:l,setNotice:u,save:async(e,{conflict:n}={})=>{c(!0),u(``);try{return await e(d)||!0}catch(e){e.status===409?u(n??T):u(e.message);return}finally{c(!1),t()}}}}var D=n(),O=(e,t)=>`${e} ${t}${e===1?``:`s`}`,k=e=>`≈${e.toLocaleString(`en-US`)} tokens`,ee={title:``,body:``,scope:`project`,trial_until:``},A=[`project`,`global`],j=e=>e===`user`?`global`:e,M=/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/,N=e=>e.startsWith(`## `)||/^##\s+R\d+\s*[—–-]+\s*\S/.test(e),te=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Your draft is kept — Save again.`,ne=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Try again.`;function P({value:e,onChange:t,onCancel:n,onSave:r,busy:i,writeTo:a=null}){let[o]=(0,C.useState)(e.scope),s=n=>r=>t({...e,[n]:r.target.value}),c=e.body.trim().split(M).some(N)?`A line cannot start with “## ” — user-rules.md reads it as a new rule heading. Use ### or plain text.`:``,l=!(e.title.trim()&&e.body.trim()),u=!l&&!c;return(0,D.jsxs)(`div`,{className:`rule-form`,children:[a,(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule title`}),(0,D.jsx)(`input`,{className:`lib-filter`,type:`text`,value:e.title,onChange:s(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,autoFocus:!0})]}),(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule body`}),(0,D.jsx)(`textarea`,{className:`rule-body-input`,value:e.body,onChange:s(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-invalid":c?!0:void 0,"aria-describedby":c?`rule-body-error`:void 0})]}),c?(0,D.jsx)(`p`,{id:`rule-body-error`,className:`sub sub-wide rule-notice`,role:`alert`,children:c}):null,(0,D.jsxs)(`div`,{className:`row wrap`,children:[(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule scope`}),(0,D.jsxs)(`select`,{className:`sel`,value:e.scope,onChange:s(`scope`),children:[(0,D.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,D.jsx)(`option`,{value:`global`,children:`scope: global (every repository)`}),A.includes(o)?null:(0,D.jsxs)(`option`,{value:o,children:[`scope: `,o,` (as written in the file)`]})]})]}),(0,D.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,D.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:e.trial_until,onChange:s(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginLeft:`auto`},children:[(0,D.jsx)(`button`,{className:`btn sm`,disabled:!u||i,onClick:()=>r(e),"aria-describedby":l?`rule-form-hint`:void 0,children:i?`Saving…`:`Save rule`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:i,onClick:n,children:`Cancel`})]})]}),l?(0,D.jsx)(`p`,{id:`rule-form-hint`,className:`panel-note`,children:`A rule needs a title and a body.`}):null]})}function re({rule:e,tag:t,usual:n,isOpen:r,onToggle:i,onEdit:a,onDelete:o,onGraduate:s}){let c=t?` · ${t}`:``;return(0,D.jsxs)(`div`,{className:`rule-row ${r?`on`:``}`,children:[(0,D.jsxs)(`button`,{className:`rule-head`,onClick:i,"aria-expanded":r,"data-rule-head":e.key,children:[(0,D.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),j(e.scope)===n?null:(0,D.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,D.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`}),(0,D.jsx)(`span`,{className:`rule-chip mono`,children:k(e.tokens)})]}),r&&(0,D.jsxs)(`div`,{className:`rule-expand`,children:[(0,D.jsx)(`p`,{children:e.body}),e.source?(0,D.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10},children:[e.status===`trial`&&(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:s,title:`Adopt for good — drop the trial marker`,"aria-label":`Graduate R${e.id}${c}`,children:`Graduate`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:a,"aria-label":`Edit R${e.id}${c}`,children:`Edit`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:o,"aria-label":`Retire R${e.id}${c}`,children:`Retire`})]})]})]})}var F=(e,t)=>({approve:`Approve`,reject:`Reject`,host:`Use the ${e.choice?.host} file`,shared:`Use the shared file`,both:`Keep both`})[t];function I({choice:e}){let t=(e,t,n)=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`rule-src`,title:t,children:e}),(0,D.jsx)(`pre`,{className:`mono`,children:n??`(absent)`})]});return(0,D.jsxs)(`div`,{className:`rule-choice`,children:[t(`Shared file`,e.shared_path,e.shared_text),t(`${e.host} file`,e.host_path,e.host_text)]})}function ie({drafts:e,deciding:t,onDecide:n}){return e.length?(0,D.jsxs)(`section`,{className:`mb-16`,"aria-labelledby":`rules-pending`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`rules-pending`,children:`Pending`}),(0,D.jsx)(`span`,{className:`mono dim`,children:e.length})]}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Waiting in `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.draft.md`}),`. A pending rule for a host file still binds on its host, and only there. One drafted from your memory index is not loaded until you approve it. Decide each one here, or ask the agent to run its rule Rite.`]}),(0,D.jsx)(`div`,{className:`card rules-list`,children:e.map((e,r)=>(0,D.jsxs)(`div`,{className:`rule-row`,children:[(0,D.jsxs)(`div`,{className:`rule-head static`,children:[(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),e.host?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:e.host===`memory`?`not loaded until approved`:`binds on ${e.host}`}):null]}),(0,D.jsxs)(`div`,{className:`rule-expand`,children:[e.body?(0,D.jsx)(`p`,{children:e.body}):null,e.choice?(0,D.jsx)(I,{choice:e.choice}):null,e.held?(0,D.jsx)(`p`,{className:`rule-src`,children:`The shared file already holds this rule. The next rebuild clears it.`}):null,e.decisions?.length?(0,D.jsx)(`div`,{className:`row gap-8`,style:{marginTop:10},children:e.decisions.map(r=>(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:t!==``,"aria-label":`${F(e,r)} · ${e.title}`,onClick:()=>n(e,r),children:F(e,r)},r))}):null]})]},e.key??r))})]}):null}function L({onChanged:e,dataRev:t,onAction:n}){let i=p(),{targets:a,sets:o,failed:s,reason:d,reload:g}=m(r.rules,t),[v,y]=(0,C.useState)(null),b=E({data:null,reload:g}),{draft:x,busy:S,notice:w}=b,[T,A]=(0,C.useState)(``),[M,N]=(0,C.useState)(null),F=(0,C.useRef)(null),[I,L]=(0,C.useState)(0),R=e=>{F.current=e,L(e=>e+1)},z=(0,C.useRef)(null),B=(0,C.useRef)(null);if((0,C.useEffect)(()=>{let e=F.current;if(F.current=null,e===null)return;let t=[...B.current?.querySelectorAll(`[data-rule-head]`)||[]];(e===`add`?z.current:t.find(t=>t.dataset.ruleHead===e))?.focus()},[I]),o&&!o.length&&d)return(0,D.jsx)(c,{error:d,onRetry:g});if(!o)return(0,D.jsx)(h,{});let V=a.length>1,H=e=>e?.id??``,U=e=>e?.shared?`shared`:u(e),W=o.flatMap(({inst:e,data:t})=>(t.rules||[]).map(t=>({...t,inst:e,key:`${H(e)}#${t.id}`}))),G=o.filter(e=>e.data.exists).map(e=>e.inst),K=G.length>0,q=x?.target,J=q!==void 0&&q!==`new`&&!W.some(e=>e.key===q&&e.title===x.title0),Y=q===`new`||J,X=x?.to!==void 0&&!G.some(e=>H(e)===x.to),Z=X?null:G.find(e=>H(e)===x?.to)??G[0]??null,ae=X?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`alert`,children:`The install this draft was for has no user-rules.md now, so it is not saved anywhere else. Cancel it, or copy the text into a new rule.`}):G.length>1?(0,D.jsx)(f,{installs:G,value:Z,onChange:e=>b.setDraft({...x,to:e.id}),tagOf:U}):V&&Z?(0,D.jsxs)(`p`,{className:`install-pick`,children:[(0,D.jsx)(`span`,{className:`dim`,children:`Install:`}),` `,(0,D.jsx)(`span`,{className:`mono`,children:U(Z)})]}):null,Q=async(t,n,i)=>{let a=o.find(e=>H(e.inst)===H(n))?.data.fingerprint||``,s=await b.save(()=>r.rulesMutate({...t,fingerprint:a},l(n)),{conflict:i?te:ne});return s&&i&&b.close(),e?.(),s},$=e=>b.setDraft({...x,form:e}),oe=async(e,t,n)=>{await Q(e,t,!0)&&R(n)},se=async e=>{await b.discard()&&R(e)},ce=async e=>{await i(`Retire rule R${e.id} — “${e.title}”${V?` from ${U(e.inst)}`:``}? It moves to user-rules-retired.md, which is never loaded.`,{title:`Retire this rule?`,confirmLabel:`Retire`,tone:`danger`})&&await Q({op:`delete`,id:e.id},e.inst)&&x===null&&R(`add`)},le=async e=>{await Q({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``},e.inst)&&R(e.key)},ue=(e,t)=>{let n=e.choice?.file;return t===`approve`?i(`Approve “${e.title}”? It moves to the shared file under a new number and binds every host on this machine. A rule may tighten a law, never repeal one: check that it does not.`,{title:`Approve this rule?`,confirmLabel:`Approve`}):t===`host`?i(`Make the ${e.choice.host} file the shared ${n}? The current shared file is replaced, and a copy goes to archived-${n}/ beside it.`,{title:`Replace the shared file?`,confirmLabel:`Replace`,tone:`danger`}):t!==`shared`||i(`Keep the shared ${n}? The ${e.choice.host} file moves to archived-${n}/ beside it, and that host returns to its seed at the next rebuild.`,{title:`Move the host file aside?`,confirmLabel:`Move aside`,tone:`danger`})},de=async(t,n)=>{if(await ue(t,n)){A(t.key),N(null),b.setNotice(``);try{let e=await r.rulesDecide({key:t.key,decision:n,fingerprint:t.fingerprint},l(t.inst));N({rebuild:e.rebuild,cleared:e.cleared??[]})}catch(e){let t=e.body?.cleared?.length?` Cleared: ${e.body.cleared.join(`, `)}.`:``;b.setNotice(e.status===409?`${e.body?.detail??e.message}${t} Reloaded the fresh copy.`:e.message)}finally{A(``),g(),e?.()}}},fe=async()=>{await i(`Rebuild every active install? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&n(`build-all`)},pe=o.flatMap(({inst:e,data:t})=>(t.warnings||[]).map(t=>V?`${U(e)}: ${t}`:t)),me=o.flatMap(({inst:e,data:t})=>(t.drafts||[]).map(n=>({...n,inst:e,fingerprint:t.draft_fingerprint}))),he=o.filter(e=>e.data.exists),ge=e=>e?.scope===`project`?`project`:`global`,_e=e=>!J&&q===e.key?(0,D.jsx)(`div`,{className:`rule-row on`,children:(0,D.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,D.jsx)(P,{value:x.form,onChange:$,busy:S,onCancel:()=>se(e.key),onSave:t=>oe({op:`update`,id:e.id,source:e.source,...t},e.inst,e.key)})})},e.key):(0,D.jsx)(re,{rule:e,tag:V?U(e.inst):null,usual:ge(e.inst),isOpen:v===e.key,onToggle:()=>y(v===e.key?null:e.key),onEdit:()=>{y(e.key),b.open({target:e.key,no:e.id,to:H(e.inst),title0:e.title,form:{title:e.title,body:e.body,scope:j(e.scope),trial_until:e.trial_until}})},onDelete:()=>ce(e),onGraduate:()=>le(e)},e.key);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsxs)(`div`,{className:`head-text`,children:[(0,D.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Your standing rules, from `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`. The agent obeys them in every session, so keep the set small. `,(0,D.jsx)(`a`,{href:`#/docs/rules`,children:`Docs`})]})]}),K&&x===null&&(0,D.jsx)(`button`,{className:`btn`,ref:z,onClick:()=>b.open({target:`new`,title0:``,form:ee}),children:`Add rule`})]}),w?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:w}):null,s.length?(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:[`Could not read user-rules.md of`,` `,s.map(e=>e?u(e):`the default install`).join(`, `),`.`]}):null,pe.map(e=>(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,children:[`format warning: `,e]},e)),M?(0,D.jsxs)(`p`,{className:`sub sub-wide`,role:`status`,children:[`Decided.`,` `,M.rebuild?`A rebuild removes the host copy.`:`The host file stays as it is.`,M.cleared.length?` Cleared: ${M.cleared.join(`, `)}.`:``,` `,M.rebuild&&n?(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:fe,children:`Rebuild all`}):null]}):null,(0,D.jsx)(ie,{drafts:me,deciding:T,onDecide:de}),Y&&(0,D.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,D.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),J?(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:[`Rule R`,x.no,` is no longer in user-rules.md (an agent session removed or renumbered it). Your draft is kept — Save adds it as a new rule.`]}):null,(0,D.jsx)(P,{value:x.form,onChange:$,busy:S,writeTo:ae,onCancel:()=>se(`add`),onSave:e=>!X&&G.length&&oe({op:`add`,...e},Z,`add`)})]}),K?W.length===0&&!Y?(0,D.jsx)(_,{title:`No rules yet`,children:`The file is seeded and loaded every session, and it is empty. Add your first standing rule here, ask the agent for one in a session (the rule skill), or promote a recurring fact from Memory.`}):(0,D.jsx)(`div`,{ref:B,children:he.map(({inst:e,data:t})=>(0,D.jsxs)(`section`,{className:`mb-16`,"aria-label":V?U(e):`Rules`,children:[(0,D.jsxs)(`div`,{className:`rules-file`,children:[V?(0,D.jsx)(`b`,{className:`mono`,children:U(e)}):null,(0,D.jsxs)(`span`,{className:`mono dim`,children:[O(t.rules.length,`rule`),` · `,k(t.stats.tokens),` every turn · scope `,ge(e),` unless marked`]})]}),t.rules.length?(0,D.jsx)(`div`,{className:`card rules-list`,children:W.filter(t=>t.inst===e).map(_e)}):null]},H(e)))}):(0,D.jsxs)(_,{title:`No user-rules.md here yet`,children:[`The build seeds it. Rebuild on the Overview, or run`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`, and it appears, ready for your rules.`]})]})}var R=`PROFILE.md changed on disk since you opened it — reloaded the fresh copy. Your draft is kept — Save again.`,z=e=>e?.id??``;function B({onChanged:e,dataRev:t}){let{targets:n,sets:i,failed:a}=m(r.profile,t);if(!i)return(0,D.jsx)(h,{});let o=new Set(a.map(z)),s=new Set([...i.map(e=>z(e.inst)),...o]),c=n.filter(e=>s.has(z(e))).map(e=>({install:e,tag:n.length<2?null:e?.shared&&!o.has(z(e))?`shared`:u(e)}));return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`mb-16`,children:[(0,D.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Who you are and how you like to work, from `,(0,D.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),`. It guides the agent and never binds it. `,(0,D.jsx)(`a`,{href:`#/docs/collaboration`,children:`Docs`})]})]}),c.map(({install:t,tag:n})=>(0,D.jsx)(V,{install:t,tag:n,onChanged:e},z(t)))]})}function V({install:e,tag:t,onChanged:n}){let{data:a,error:o,loading:s,reload:u,setData:f}=i(()=>r.profile(l(e)),[]),p=E({data:a,reload:u}),{draft:m,dirty:g,busy:v,notice:y}=p,[x,S]=(0,C.useState)(!1);if(a&&!x&&(S(!0),(a.text||``).trim()||p.open(a.text||``)),s&&!a)return(0,D.jsx)(h,{});if(o)return(0,D.jsxs)(`section`,{"aria-label":t?`Profile, ${t}`:void 0,children:[t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null,(0,D.jsx)(c,{error:o,onRetry:u})]});let w=m!==null,T=a?.text||``;return(0,D.jsxs)(`section`,{"aria-label":t?`Profile, ${t}`:void 0,children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsx)(`div`,{children:t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null}),(0,D.jsxs)(`div`,{className:`row`,children:[(0,D.jsxs)(d,{"aria-label":t?`Profile mode, ${t}`:`Profile mode`,children:[(0,D.jsx)(`button`,{className:w?``:`on`,"aria-pressed":!w,onClick:p.discard,children:`View`}),(0,D.jsx)(`button`,{className:w?`on`:``,"aria-pressed":w,onClick:()=>w||p.open(T),children:`Edit`})]}),w&&(0,D.jsx)(`button`,{className:`btn`,disabled:!g||v,onClick:async()=>{let t=await p.save(t=>r.profileSave({text:m,fingerprint:t},l(e)),{conflict:R});t&&(f(e=>({...e,text:m,seeded:!1,fingerprint:t.fingerprint||``})),p.setNotice(`Saved.`),p.close(),n?.())},children:v?`Saving…`:`Save`})]})]}),y?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:y}):null,w?(0,D.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:m,onChange:e=>p.setDraft(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):T.trim()?(0,D.jsxs)(D.Fragment,{children:[a?.seeded?(0,D.jsxs)(_,{title:`This is still the template`,children:[`Ask the agent to run the `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]}):null,(0,D.jsx)(`div`,{className:`card pad-lg`,children:(0,D.jsx)(b,{body:T})})]}):(0,D.jsxs)(_,{title:`No profile yet`,children:[`Switch to Edit to write one, or ask the agent to run the`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})]})}var H=(e,t)=>`${e} ${t}${e===1?``:`s`}`,U=e=>e?(e.items||[]).length:null,W=/^- \[([^\]]*)\]\(topics\/[^)]+\.md\) — (\d+) facts?$/,G=e=>String(e||``).split(`
2
+ `).map(e=>W.exec(e.trim())).filter(Boolean).map(e=>({topic:e[1],n:Number(e[2])}));function K({topics:e,install:t,shared:n}){return e.length?(0,D.jsxs)(`section`,{className:`panel pm-topics`,"aria-labelledby":`pm-topics`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`pm-topics`,children:`Topics`}),t&&!n?(0,D.jsx)(`span`,{className:`mono dim`,children:S(t)}):null,(0,D.jsx)(`span`,{className:`mono dim`,children:H(e.length,`topic`)})]}),(0,D.jsx)(`ul`,{className:`hbars`,children:e.map(e=>(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:`hb-label`,children:e.topic}),(0,D.jsx)(`span`,{className:`mono hb-n`,children:H(e.n,`fact`)})]},e.topic))})]}):null}var q={memory:{title:`No facts yet`,body:(0,D.jsxs)(`div`,{className:`pm-first`,children:[(0,D.jsx)(`p`,{children:`The agent writes a fact when a session teaches it something durable: a decision, a correction, a trap. Say “remember that…” in any session, and it asks whether that belongs here or in your standing rules.`}),(0,D.jsxs)(`ul`,{children:[(0,D.jsx)(`li`,{children:`One fact per file, filed under a topic.`}),(0,D.jsx)(`li`,{children:`Stale facts move to Archived; nothing is deleted without you.`}),(0,D.jsx)(`li`,{children:`The store stays on this machine and out of git.`})]})]}),action:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/docs/memory`,children:`How memory works`}),(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/item/skill/rule`,children:`The rule skill`})]})},notebook:{title:`No notes yet`,body:`The notebook is the agent’s own scratch space: plans and notes it keeps for itself.`}};function J({tab:e=`rules`,item:t,dataRev:n,onCountsChanged:c,onAction:l}){let u=e=>Promise.resolve(e).catch(()=>null),d=s(n),{reload:f}=o(n),{data:p,error:m,reload:h}=i(()=>r.profile(),[n]),{data:v,reload:y}=i(()=>r.catalog(`memory`),[`memory`,n],`catalog`),{data:b}=i(()=>r.catalog(`notebook`),[`notebook`,n],`catalog`),S=U(v),{data:C}=i(()=>e===`memory`?u(r.item(`memory`,`MEMORY`)):Promise.resolve(null),[`memory-map`,e,n,S]),w=U(b),T={memory:S,notebook:w},E={profile:m?`read failed`:p?.seeded?`template`:null,memory:S,notebook:w},O=e===`memory`||e===`notebook`;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(a,{title:`Personal`,sub:`The only files you write. They survive updates, reinstalls and voice changes.`+(d?.some(e=>e.shared)?` Global installs share one copy of the rules, profile and memory; a project install keeps its own.`:``)}),(0,D.jsx)(g,{page:`personal`,current:e,badges:E,label:`Personal files`}),e===`rules`&&(0,D.jsx)(L,{onChanged:f,dataRev:n,onAction:l}),e===`profile`&&(0,D.jsx)(B,{onChanged:h,dataRev:n}),O&&T[e]===0&&!t?(0,D.jsx)(_,{title:q[e].title,action:q[e].action,children:q[e].body}):O?(0,D.jsxs)(D.Fragment,{children:[e===`memory`&&(0,D.jsx)(K,{topics:G(C?.body),install:C?.install,shared:C?.shared}),(0,D.jsx)(x,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:n,onCountsChanged:c,onRulesChanged:()=>{f(),y()}},e)]}):null]})}export{J as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{Ct as r,H as i,Ot as a,St as o,et as s,jt as c,mt as l,ot as u,rt as d}from"./index-BiKWWv7Z.js";import{t as f}from"./api-C8nMUU1i.js";import{i as p}from"./motion-RlUl1osO.js";var m=e(t(),1),h=n();function g(){let e=u(),[t,n]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null);return t?(0,h.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,h.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),(0,h.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){a(null);try{await f.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,h.jsx)(r,{name:`x`}),`Stop server`]})]})}function _(){let e=u(),[t,n]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),(0,h.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),a(null);try{await c()}catch(e){a(e.message),n(!1)}}},disabled:t,children:[(0,h.jsx)(r,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var v=`https://github.com/Arylmera/Geneseed`,y=`https://github.com/Arylmera`,b=[[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],x=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function S({k:e,kid:t,help:n,children:r,control:i}){return(0,h.jsxs)(`div`,{className:`sheet-row`,children:[(0,h.jsxs)(`span`,{className:`sheet-k`,children:[t?(0,h.jsx)(`span`,{id:t,children:e}):e,n?(0,h.jsx)(`span`,{className:`sheet-h sub`,children:n}):null]}),(0,h.jsx)(`div`,{className:`sheet-v`,children:r}),(0,h.jsx)(`div`,{className:`sheet-c`,children:i})]})}function C({id:e,title:t,head:n,className:r=``,children:i}){return(0,h.jsxs)(`section`,{id:`set-${e}`,className:`card pad-md sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,h.jsxs)(`div`,{className:`card-head`,children:[(0,h.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function w({stale:e,ids:t}){let n=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:p()?`smooth`:`auto`,block:`start`});return(0,h.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:b.filter(([e])=>t.includes(e)).map(([t,r])=>(0,h.jsxs)(`button`,{type:`button`,className:t===`danger`?`t-bad`:``,onClick:()=>n(t),children:[r,t===`server`&&(0,h.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},t))})}function T({version:e}){let[t,n]=(0,m.useState)(v),[i,a]=(0,m.useState)(!0);(0,m.useEffect)(()=>{Promise.resolve(f.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,h.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,h.jsx)(r,{name:`external`})]});return(0,h.jsxs)(C,{id:`about`,title:`About`,children:[(0,h.jsx)(S,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,h.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,h.jsx)(S,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,h.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,h.jsx)(S,{k:`Geneseed`,help:`MIT-licensed`,control:(0,h.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,h.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`external`}),`Issues`]}),(0,h.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`external`}),`MIT License`]})]})]}),children:(0,h.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,h.jsx)(S,{k:`Creator`,control:(0,h.jsxs)(`a`,{className:`btn ghost`,href:y,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,h.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,h.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}var E={absent:`Off`,ours:`On · written by Geneseed`,stale:`On · points at another copy or Node`,hand:`On · set up by hand`};function D({initial:e}){let t=u(),[n,r]=(0,m.useState)(void 0),[i,a]=(0,m.useState)(null),[o,c]=(0,m.useState)(!1),l=n===void 0?e:n,d=async e=>{let n=e===`install`;if(await t(n?`Write ${l.file}? It starts the web console from ${l.root} at each login (hidden, no browser).`+(l.file.endsWith(`.plist`)?` It loads at your next login.`:``)+(l.transient?` Warning: that copy is an agent worktree or an npx cache, which can be deleted; the login item then fails.`:``):`Delete ${l.file}? The console no longer starts at login.`,n?{title:`Start at login?`,confirmLabel:l.state===`stale`?`Update`:`Write file`}:{title:`Stop starting at login?`,confirmLabel:`Delete file`,tone:`danger`})){c(!0),a(null);try{r((await f.autostart(e)).autostart)}catch(e){a(e.message),e.body?.autostart&&r(e.body.autostart)}finally{c(!1)}}},p=l?.state,g=p===`absent`||p===`stale`?(0,h.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>d(`install`),children:p===`stale`?`Update`:`Turn on`}):p===`ours`?(0,h.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>d(`remove`),children:`Remove`}):p===`hand`?(0,h.jsx)(`a`,{href:`#/docs/autostart`,children:`Install guide →`}):null;return(0,h.jsx)(S,{k:`Start at login`,help:l?l.file:l===null?`No login launcher on this system`:`A login launcher`,control:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),g]}),children:(0,h.jsx)(`span`,{className:`sub`,children:l===null?`not available`:E[p]??`unknown`})})}function O({overview:e,onAction:t}){let n=u(),{canSee:s}=o(),c=b.map(([e])=>e).filter(e=>s(`section:settings/${e}`)),p=e?.server,v=e?.daemon_stale,[y,E]=(0,m.useState)(null);(0,m.useEffect)(()=>{Promise.resolve(f.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let O=y?y.install??(y.git?`git`:`npm-global`):null,k=O===`git`?`Update (git pull + rebuild)`:O===`npm-global`?`Update (npm install -g + rebuild)`:`Update`;return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(i,{title:`Settings`,sub:`This copy of Geneseed and the local server.`}),(0,h.jsxs)(`div`,{className:`sheet`,children:[(0,h.jsx)(w,{stale:v,ids:c}),(0,h.jsxs)(`div`,{className:`sheet-body`,children:[(0,h.jsxs)(C,{id:`machine`,title:`Machine`,children:[(0,h.jsx)(S,{k:`Geneseed`,help:`This copy of the source`,control:O===`other`?y.command?(0,h.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,h.jsx)(`code`,{className:`mono`,children:y.command})]}):null:y?.behind===!1?(0,h.jsx)(`span`,{className:`dim`,children:`This checkout cannot pull: it has local changes, a detached HEAD, no upstream or a diverged branch.`}):(0,h.jsxs)(`button`,{className:`btn`,onClick:async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await f.installs();e=t.filter(e=>e.state===`active`).map(e=>`${l(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await n(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},children:[(0,h.jsx)(r,{name:`download`}),k]}),children:(0,h.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,h.jsx)(S,{k:`View level`,kid:`set-view-level`,help:`How much of the console to show. Hidden parts keep working.`,control:(0,h.jsx)(d,{labelledBy:`set-view-level`})}),(0,h.jsx)(S,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,h.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,h.jsx)(r,{name:`external`}),`Add to PATH`]})})]}),(0,h.jsxs)(C,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`pill good`,children:`running`}),(0,h.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,p?` · pid ${p.pid} · up ${a(p.started)}`:``]})]}),children:[(0,h.jsx)(S,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,h.jsx)(_,{}),children:v?(0,h.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,h.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,h.jsx)(D,{initial:p?.autostart}),(0,h.jsx)(S,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,h.jsx)(`span`,{className:`row wrap gap-8`,children:x.map(e=>(0,h.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,h.jsx)(T,{version:e?.version}),c.includes(`danger`)&&(0,h.jsxs)(C,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,h.jsx)(S,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,h.jsx)(g,{})}),(0,h.jsx)(S,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,h.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,h.jsx)(S,{k:`Uninstall`,children:(0,h.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,h.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}export{b as SECTIONS,O as default};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,r}from"./router-1EhRJy1C.js";import{St as i}from"./index-BiKWWv7Z.js";e();var a=t();function o({page:e,current:t,badges:o={},label:s}){let{canSee:c}=i();return(0,a.jsx)(`nav`,{className:`tabs`,"aria-label":s,children:n[e].filter(n=>n===t||c(`tab:${e}/${n}`)).map(n=>(0,a.jsxs)(`a`,{href:`#/${e}/${n}`,className:t===n?`on`:``,"aria-current":t===n?`page`:void 0,children:[r[n],o[n]==null?null:(0,a.jsx)(`span`,{className:`tab-badge`,children:o[n]})]},n))})}export{o as t};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{St as n}from"./index-BiKWWv7Z.js";e();var r=t();function i({label:e,value:t,options:n,onChange:i}){return n.length?(0,r.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>i(e.target.value),children:n.map(e=>(0,r.jsx)(`option`,{value:e,children:e},e))}):null}var a=[`lean`,`full`];function o({on:e,disabled:t,label:n,onToggle:i}){return(0,r.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:i,onKeyDown:e=>{e.key===`Enter`&&!t&&i()}})}var s=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function c({value:e,options:t,onChange:a,who:o}){let{canSee:c}=n();return s.filter(e=>c(`field:install/${e.name}`)).map(n=>(0,r.jsxs)(`label`,{className:`dp-field`,"data-pick":n.name,children:[(0,r.jsx)(`span`,{children:n.title}),(0,r.jsx)(i,{label:`${n.name} for ${o}`,value:e[n.key],options:t[n.key],onChange:e=>a(n.key,e)})]},n.key))}export{o as i,c as n,i as r,a as t};