geneseed 4.25.1 → 4.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/DESIGN.md +6 -5
  3. package/README.md +10 -6
  4. package/SHIPPED.md +4 -3
  5. package/adapters/bob/README.md +26 -4
  6. package/adapters/claude-code/README.md +6 -2
  7. package/adapters/claude-code/skills/geneseed/SKILL.md +2 -2
  8. package/adapters/opencode/HOW-OPENCODE-LOADS.md +4 -2
  9. package/adapters/opencode/README.md +5 -2
  10. package/adapters/opencode/plugins/geneseed-activity.js +331 -31
  11. package/adapters/opencode/plugins/geneseed-guard.js +79 -4
  12. package/bin/geneseed-hook.mjs +13 -7
  13. package/docs/concepts/enforcement-table.md +12 -0
  14. package/docs/concepts/exclusions.md +15 -1
  15. package/docs/concepts/hook-gates.md +3 -2
  16. package/docs/concepts/hooks.md +12 -1
  17. package/docs/concepts/host-matrix.md +2 -2
  18. package/docs/concepts/ownership.md +79 -0
  19. package/docs/concepts/rules.md +1 -1
  20. package/docs/guides/set-up-ownership.md +77 -0
  21. package/docs/reference/glossary.md +1 -1
  22. package/docs/reference/opencode-plugins.md +1 -1
  23. package/docs/reference/plugin-activity.md +4 -2
  24. package/docs/reference/plugin-guard.md +1 -0
  25. package/docs/reference/troubleshoot-doctor.md +2 -2
  26. package/docs/understand/enforced-vs-asked.md +3 -2
  27. package/docs/understand/machine-bob.md +1 -1
  28. package/docs/understand/machine-claude.md +1 -1
  29. package/docs/understand/machine-opencode.md +2 -2
  30. package/docs/web-ui.md +21 -2
  31. package/harness.config.json +1 -1
  32. package/js/README.md +1 -0
  33. package/js/build/render.mjs +1 -1
  34. package/js/build/source.mjs +5 -1
  35. package/js/cli-table.json +46 -1
  36. package/js/hosts/activity.mjs +175 -30
  37. package/js/hosts/hooks-prims.mjs +2 -2
  38. package/js/hosts/hooks.mjs +45 -5
  39. package/js/hosts/ownership-gate.mjs +105 -0
  40. package/js/hosts/settings.mjs +14 -4
  41. package/js/inspect/cost.mjs +1 -1
  42. package/js/inspect/inventory.mjs +1 -1
  43. package/js/inspect/status.mjs +1 -1
  44. package/js/loop/registry.mjs +17 -0
  45. package/js/web/activity.mjs +116 -5
  46. package/package.json +1 -1
  47. package/registry.json +7 -0
  48. package/src/AGENT.md.tmpl +5 -0
  49. package/src/agents/developer.md +7 -1
  50. package/src/modes/foreman.md +4 -1
  51. package/src/ontology/universal.md +19 -0
  52. package/src/skills/_checkpoints.md +15 -0
  53. package/src/skills/develop.md +4 -0
  54. package/src/skills/document-project.md +2 -1
  55. package/src/skills/learn-mode.md +13 -17
  56. package/src/skills/ownership.md +139 -0
  57. package/src/skills/pipeline.md +1 -1
  58. package/themes/README.md +2 -2
  59. package/themes/_TEMPLATE.json +1 -0
  60. package/themes/biker.json +1 -0
  61. package/themes/commentator.json +1 -0
  62. package/themes/cyberpunk.json +1 -0
  63. package/themes/gamer.json +1 -0
  64. package/themes/imperial.json +1 -0
  65. package/themes/joker.json +1 -0
  66. package/themes/marvin.json +1 -0
  67. package/themes/mean.json +1 -0
  68. package/themes/military.json +1 -0
  69. package/themes/neutral.json +1 -0
  70. package/themes/pirate.json +1 -0
  71. package/themes/sports.json +1 -0
  72. package/themes/verstappen.json +1 -0
  73. package/themes/wizard.json +1 -0
  74. package/web/dist/assets/Activity-DfETiyWm.js +1 -0
  75. package/web/dist/assets/ActivityDetail-CnP3GPAN.js +1 -0
  76. package/web/dist/assets/Bonsai-CN4rRAHc.js +1 -0
  77. package/web/dist/assets/{CopyButton-B6myFV7a.js → CopyButton-CRAUXSG7.js} +1 -1
  78. package/web/dist/assets/{Dashboard-DEQCBcUW.js → Dashboard-CaqOqtkG.js} +2 -2
  79. package/web/dist/assets/Docs-BFxyAVdN.js +5 -0
  80. package/web/dist/assets/{GreenhouseView-CV1squu6.js → GreenhouseView-19roNb5W.js} +1 -1
  81. package/web/dist/assets/{Installs-C4TQVZ_-.js → Installs-BSoQN7w7.js} +3 -3
  82. package/web/dist/assets/{JournalView-CpXsT_JD.js → JournalView-BgU2ybaq.js} +1 -1
  83. package/web/dist/assets/{KitApply-fYh_YjQA.js → KitApply-Ckc0P5kt.js} +1 -1
  84. package/web/dist/assets/{Kits-BMuGOiTg.js → Kits-BZqWGWMu.js} +1 -1
  85. package/web/dist/assets/Laws-CnUWiNIx.js +3 -0
  86. package/web/dist/assets/{Library-DiZqRFL5.js → Library-rYO8owx_.js} +2 -2
  87. package/web/dist/assets/{Loops-DkwWkdPc.js → Loops-CljFhhQV.js} +2 -2
  88. package/web/dist/assets/{OperatorHudView-CLmq0lNh.js → OperatorHudView-xs7SCwCe.js} +1 -1
  89. package/web/dist/assets/{Personal-C70XacpA.js → Personal-CMPwtl36.js} +2 -2
  90. package/web/dist/assets/{Tabs-ChFhPGP6.js → Tabs-CEfSUVQp.js} +1 -1
  91. package/web/dist/assets/{index-DxCqnFPy.js → index-FLVXXvV3.js} +2 -2
  92. package/web/dist/assets/{index-Cqqs-PbJ.css → index-XTGBLKQr.css} +1 -1
  93. package/web/dist/index.html +2 -2
  94. package/web/dist/assets/Activity-BdMwEnFN.js +0 -1
  95. package/web/dist/assets/ActivityDetail-BgUjDuxO.js +0 -1
  96. package/web/dist/assets/Docs-ChBYcQbT.js +0 -5
  97. package/web/dist/assets/Laws-ndHW7Onu.js +0 -3
@@ -1 +1 @@
1
- import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{I as a,P as o,at as s,st as c,z as l}from"./index-DxCqnFPy.js";import{i as u,n as d,r as f}from"./Dashboard-DEQCBcUW.js";e();var p=t(),m=12,h=Array.from({length:7},(e,t)=>`var(--cat-${t})`),g=650;function _({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let a=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(l,{segments:e,size:t,stroke:r,label:i,sweepMs:g}),(0,p.jsxs)(`div`,{className:`ring-center`,children:[(0,p.jsx)(`div`,{className:`donut-c-num`,children:(0,p.jsx)(n,{value:a,duration:g})}),(0,p.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function v(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function y({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=v(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,p.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,p.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,p.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,p.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function b({label:e,value:t,sub:n,color:r,icon:i}){return(0,p.jsxs)(`div`,{className:`b-tile`,children:[(0,p.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,p.jsx)(s,{name:i})}),(0,p.jsxs)(`div`,{className:`b-tile-body`,children:[(0,p.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,p.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,p.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function x({overview:e,sigil:t,jobs:l,lens:g,onAction:v}){let x=e.counts||{},S=g?.doctor?.state||`loading`,C=g?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=u(e,g?.tone),O=a(l,m),k=c(e.diff),A=i.filter(e=>(x[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:x[e]||0,tone:`cat`+t%h.length,color:h[t%h.length]})),j=A.reduce((e,t)=>e+t.n,0),M=o(l||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`b-greet`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,p.jsx)(`h2`,{className:`h b-h`,children:D}),(0,p.jsx)(d,{verdict:g?.verdict}),(0,p.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,p.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,p.jsxs)(`div`,{className:`card b-hero`,children:[(0,p.jsx)(`div`,{className:`b-hero-ring`,children:(0,p.jsx)(_,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,p.jsxs)(`div`,{className:`b-hero-side`,children:[(0,p.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,p.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>v(`doctor`),children:[(0,p.jsx)(s,{name:`doctor`}),`Run doctor`]}),(0,p.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,p.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,p.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,p.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,p.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,p.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,p.jsxs)(`div`,{className:`b-chips`,children:[(0,p.jsxs)(`span`,{className:`b-chip`,children:[(0,p.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,p.jsx)(`span`,{className:`b-chip`,children:(0,p.jsx)(`b`,{children:e.emit})}),(0,p.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,p.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,p.jsxs)(`div`,{className:`b-tiles`,children:[(0,p.jsx)(b,{label:`Agents`,value:x.agents??`—`,sub:`specialists`,color:h[0],icon:`layers`}),(0,p.jsx)(b,{label:`Skills`,value:x.skills??`—`,sub:`workflows`,color:h[1],icon:`skill`}),(0,p.jsx)(b,{label:`Dictates`,value:x.laws??`—`,sub:x.doctrines?`${x.doctrines.active}/${x.doctrines.total} packs · ${x.doctrines.rules} rules`:`all upheld`,color:h[2],icon:`law`}),(0,p.jsx)(b,{label:`Edits`,value:k,sub:`to graft`,color:h[3],icon:`changes`})]})]}),(0,p.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,p.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Capability mix`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,p.jsxs)(`div`,{className:`b-mix`,children:[(0,p.jsx)(_,{segments:A,size:186,stroke:26}),(0,p.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,p.jsxs)(`div`,{className:`b-leg-row`,children:[(0,p.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,p.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,p.jsx)(`span`,{className:`b-leg-bar`,children:(0,p.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,p.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent runs`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`badge ok`,children:[(0,p.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,p.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,p.jsx)(`span`,{className:`b-stat-big`,children:(0,p.jsx)(n,{value:N})}),(0,p.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,p.jsx)(y,{data:M,accent:h[0],height:156})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent activity`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,p.jsx)(f,{jobs:l,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
1
+ import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{B as a,F as o,L as s,ct as c,ot as l}from"./index-FLVXXvV3.js";import{i as u,n as d,r as f}from"./Dashboard-CaqOqtkG.js";e();var p=t(),m=12,h=Array.from({length:7},(e,t)=>`var(--cat-${t})`),g=650;function _({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let o=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(a,{segments:e,size:t,stroke:r,label:i,sweepMs:g}),(0,p.jsxs)(`div`,{className:`ring-center`,children:[(0,p.jsx)(`div`,{className:`donut-c-num`,children:(0,p.jsx)(n,{value:o,duration:g})}),(0,p.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function v(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function y({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=v(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,p.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,p.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,p.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,p.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function b({label:e,value:t,sub:n,color:r,icon:i}){return(0,p.jsxs)(`div`,{className:`b-tile`,children:[(0,p.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,p.jsx)(l,{name:i})}),(0,p.jsxs)(`div`,{className:`b-tile-body`,children:[(0,p.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,p.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,p.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function x({overview:e,sigil:t,jobs:a,lens:g,onAction:v}){let x=e.counts||{},S=g?.doctor?.state||`loading`,C=g?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=u(e,g?.tone),O=s(a,m),k=c(e.diff),A=i.filter(e=>(x[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:x[e]||0,tone:`cat`+t%h.length,color:h[t%h.length]})),j=A.reduce((e,t)=>e+t.n,0),M=o(a||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`b-greet`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,p.jsx)(`h2`,{className:`h b-h`,children:D}),(0,p.jsx)(d,{verdict:g?.verdict}),(0,p.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,p.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,p.jsxs)(`div`,{className:`card b-hero`,children:[(0,p.jsx)(`div`,{className:`b-hero-ring`,children:(0,p.jsx)(_,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,p.jsxs)(`div`,{className:`b-hero-side`,children:[(0,p.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,p.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>v(`doctor`),children:[(0,p.jsx)(l,{name:`doctor`}),`Run doctor`]}),(0,p.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,p.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,p.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,p.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,p.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,p.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,p.jsxs)(`div`,{className:`b-chips`,children:[(0,p.jsxs)(`span`,{className:`b-chip`,children:[(0,p.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,p.jsx)(`span`,{className:`b-chip`,children:(0,p.jsx)(`b`,{children:e.emit})}),(0,p.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,p.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,p.jsxs)(`div`,{className:`b-tiles`,children:[(0,p.jsx)(b,{label:`Agents`,value:x.agents??`—`,sub:`specialists`,color:h[0],icon:`layers`}),(0,p.jsx)(b,{label:`Skills`,value:x.skills??`—`,sub:`workflows`,color:h[1],icon:`skill`}),(0,p.jsx)(b,{label:`Dictates`,value:x.laws??`—`,sub:x.doctrines?`${x.doctrines.active}/${x.doctrines.total} packs · ${x.doctrines.rules} rules`:`all upheld`,color:h[2],icon:`law`}),(0,p.jsx)(b,{label:`Edits`,value:k,sub:`to graft`,color:h[3],icon:`changes`})]})]}),(0,p.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,p.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Capability mix`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,p.jsxs)(`div`,{className:`b-mix`,children:[(0,p.jsx)(_,{segments:A,size:186,stroke:26}),(0,p.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,p.jsxs)(`div`,{className:`b-leg-row`,children:[(0,p.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,p.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,p.jsx)(`span`,{className:`b-leg-bar`,children:(0,p.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,p.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent runs`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`badge ok`,children:[(0,p.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,p.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,p.jsx)(`span`,{className:`b-stat-big`,children:(0,p.jsx)(n,{value:N})}),(0,p.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,p.jsx)(y,{data:M,accent:h[0],height:156})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent activity`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,p.jsx)(f,{jobs:a,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
@@ -1,3 +1,3 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,R as o,U as s,X as c,Y as l,Z as u,at as d,ft as f,gt as p,ht as m,it as h,mt as g,nt as _,ot as v,pt as y,q as b,rt as x,st as S,tt as C,ut as w,vt as T}from"./index-DxCqnFPy.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-ChFhPGP6.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-fYh_YjQA.js";var F=e(t(),1),I=n();function ee({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:C.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function L(){let{data:e,error:t,reload:n}=f(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,I.jsx)(d,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function R({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${_(e.host).label} · ${e.scope}`,[h,g]=z[e.state]||z.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:x(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(R,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(L,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var B=(e,t)=>`${e} ${t}`,ne=[`claude`,`bob`,`openclaude`],V={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},H=/[\\/]\.claude[\\/]worktrees[\\/]/,U=e=>e.scope===`project`&&H.test(e.path);function re(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?S(e.drift):0;return i?`${r} · ${i} edited`:r}function W({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?S(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(o,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,I.jsx)(`span`,{className:`dim`,children:re(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=V[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,I.jsx)(`td`,{children:_(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(`span`,{className:`tag ${c}`,children:i}),U(e)?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`span`,{className:`tag warn`,title:`Inside a .claude/worktrees folder: likely a finished worktree. Remove it from its panel.`,children:`Worktree leftover`})]}):null]}),(0,I.jsx)(`td`,{children:(0,I.jsx)(W,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function G({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:c}){let l=u(),{data:p,error:m,reload:g}=f(()=>r.installs(),[s]),{data:v,error:y,reload:S}=f(()=>r.mcp(),[s]),{data:C,error:w}=f(()=>r.fleet(),[s]),T=w?null:C??void 0,[D,O]=(0,F.useState)(null),[k,A]=(0,F.useState)(``),[j,M]=(0,F.useState)({}),[P,L]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),V=e=>R.id===e?.id?R.value:`keep`,[H,U]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=B(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(m||y)return(0,I.jsx)(b,{error:m||y,onRetry:()=>{g(),S()}});if(!p||!v)return(0,I.jsx)(a,{});let W={active:0,disabled:1,absent:2},G=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(W[e.state]??3)-(W[t.state]??3)),K=G.find(e=>e.id===H)||G.find(e=>e.selected)||G.find(e=>e.state===`active`)||G[0],q=e=>{let t=j[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},se=(e,t,n)=>M(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ce=e=>{let t=q(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=q(t),s=_(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await l(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},ue=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){A(e.id),O(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;O({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&ne.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},de=async e=>{let t=V(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${h(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){A(e.id),O(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){O({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&O({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},fe=async e=>{O(null);try{let t=await r.mcpReveal(e.path);O({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){O({text:e.message,tone:`bad`})}},pe=async()=>{let t=G.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await l(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},me=G.find(e=>e.selected)?.host||G.find(e=>e.state===`active`)?.host||G[0]?.host||`opencode`,X=G.filter(e=>e.scope===`global`),Z=G.filter(e=>e.scope!==`global`),Q=e=>{U(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}c?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[G.filter(e=>e.state===`active`).length,` active of `,G.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:pe,children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),D?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:D.text}):D?(0,I.jsx)(`p`,{className:`tag ${D.tone===`ok`?`ok `:``}note`,role:`status`,children:D.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:K?.id,onPick:Q,label:`Global installs`,fleet:T,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>L(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),P?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(ee,{host:me,theme:n||`neutral`,options:J,onAction:e,onClose:()=>L(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:K?.id,onPick:Q,label:`Per-project installs`,fleet:T,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:o,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),K?(0,I.jsx)(te,{inst:K,targets:re[B(K.host,K.path)]||[],choice:q(K),unchanged:ce(K),options:J,onPick:(e,t)=>se(K,e,t),canAct:!!e,busy:k===K.id,memory:V(K),onMemory:e=>z({id:K.id,value:e}),onApply:()=>le(K),onToggleInstall:()=>ue(K),onRemove:()=>de(K),onRevealMcp:fe},K.id):null]})}function K({onAction:e,dataRev:t}){let{data:n,error:i}=f(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(b,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(a,{})}function q(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var se=300;function ce({onMutated:e,onAction:t,dataRev:n,overview:i}){let o=u(),{data:s,error:c,reload:l}=f(()=>r.diff(),[n]),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,x]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(s&&s!==S){C(s),v(new Set);let e=s.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=se?s.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>s.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
2
- `)}\n\n`:``;if(await o(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;g(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await l(),e?.()}catch(e){g(e.message)}finally{m(!1)}}};if(c)return(0,I.jsx)(b,{error:c,onRetry:l});if(!s)return(0,I.jsx)(a,{});if(!s.deployed)return(0,I.jsx)(E,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!s.diffable)return(0,I.jsx)(E,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=s.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=s.files.filter(e=>e.status===`linked`),j=s.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,ee=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),s.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:s.target}),s.theme?` (${s.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,M>0?(0,I.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:p||_.size===0,onClick:O,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:p,onClick:D,children:[(0,I.jsx)(d,{name:`download`}),`Export improvements`]})]})]}),h?(0,I.jsx)(`p`,{className:`sub mb-14`,children:h}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
3
- `),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(E,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(s.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:_.size===k.length,onChange:T}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>L(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:p,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>L(e,!1))]}):null]})]});function L(e,t){let n=y.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>ee(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(d,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${q(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(d,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function le({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:i,reload:o,setData:s}=f(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),o()};if(i)return(0,I.jsx)(b,{error:i,onRetry:o});let l=n?n.groups.filter(e=>e.problems.length):[],u=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`page-fill`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,I.jsx)(d,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[l.map((e,t)=>(0,I.jsx)(J,{group:e,i:t},e.label)),u.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[u.length,` clean check`,u.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:u.map((e,t)=>(0,I.jsx)(J,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,I.jsx)(a,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ue(){let e=u(),[t,n]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:i}),(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){a(null);try{await r.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,I.jsx)(d,{name:`x`}),`Stop server`]})]})}function Y(){let e=u(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:r}),(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await m()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(d,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var de=`https://github.com/Arylmera/Geneseed`,fe=`https://github.com/Arylmera`,pe=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],me=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:pe.map(([n,r])=>(0,I.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,I.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function $({version:e}){let[t,n]=(0,F.useState)(de),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(d,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`MIT License`]})]})]}),children:(0,I.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:fe,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function he({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:a,onAccentMode:o,layout:s,onLayout:f}){let m=u(),h=e?.install,v=e?.footprint,b=e?.server,S=e?.daemon_stale,[C,E]=(0,F.useState)(null);(0,F.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let D=C?C.install??(C.git?`git`:`npm-global`):null,O=D===`git`?`Update (git pull + rebuild)`:D===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,k=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await m(`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`)},A=b?.autostart===!0?`On · login script`:b?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:T.server}),(0,I.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]})}),(0,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{stale:S}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-skin-label`,children:p.map(e=>(0,I.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>i(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:p.find(e=>e.id===n)?.tagline??``})]}),a&&o&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(l,{value:a,onChange:o,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(a)})]}),s&&f&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-layout-label`,children:y.map(e=>(0,I.jsx)(`button`,{className:s===e.id?`on`:``,onClick:()=>f(e.id),"aria-pressed":s===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:y.find(e=>e.id===s)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:D===`other`?C.command?(0,I.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,I.jsx)(`code`,{className:`mono`,children:C.command})]}):null:(0,I.jsxs)(`button`,{className:`btn`,onClick:k,children:[(0,I.jsx)(d,{name:`download`}),O]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(d,{name:`external`}),`Add to PATH`]})}),h&&v&&(0,I.jsxs)(X,{k:`Harness footprint`,help:(0,I.jsxs)(I.Fragment,{children:[`For `,_(h.host).label,` · `,h.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,I.jsx)(`span`,{className:`mono`,children:v}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,children:v===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,I.jsxs)(Z,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,b?` · pid ${b.pid} · up ${w(b.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(Y,{}),children:S?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:A})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:me.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ue,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function ge({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?v(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(D,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(G,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(K,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(ce,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(le,{dataRev:o}),e===`server`&&(0,I.jsx)(he,{overview:t,onAction:i,...c})]})}export{ge as default};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,Q as o,W as s,X as c,Y as l,Z as u,_t as d,at as f,ct as p,dt as m,gt as h,ht as g,it as _,mt as v,nt as y,ot as b,pt as x,rt as S,st as C,yt as w,z as T}from"./index-FLVXXvV3.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-CEfSUVQp.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-Ckc0P5kt.js";var F=e(t(),1),I=n();function ee({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:y.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:S(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function L(){let{data:e,error:t,reload:n}=x(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>S(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,I.jsx)(b,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function R({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${S(e.host).label} · ${e.scope}`,[h,g]=z[e.state]||z.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:_(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${S(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:S(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(R,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(L,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var B=(e,t)=>`${e} ${t}`,ne=[`claude`,`bob`,`openclaude`],V={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},H=/[\\/]\.claude[\\/]worktrees[\\/]/,U=e=>e.scope===`project`&&H.test(e.path);function re(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?p(e.drift):0;return i?`${r} · ${i} edited`:r}function W({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?p(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(T,{label:`Sync with source of ${_(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,I.jsx)(`span`,{className:`dim`,children:re(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=V[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:_(e)})}),t?(0,I.jsx)(`td`,{children:S(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(`span`,{className:`tag ${c}`,children:i}),U(e)?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`span`,{className:`tag warn`,title:`Inside a .claude/worktrees folder: likely a finished worktree. Remove it from its panel.`,children:`Worktree leftover`})]}):null]}),(0,I.jsx)(`td`,{children:(0,I.jsx)(W,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function G({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:s,dataRev:c,onMutated:u}){let d=o(),{data:p,error:m,reload:h}=x(()=>r.installs(),[c]),{data:g,error:v,reload:y}=x(()=>r.mcp(),[c]),{data:C,error:w}=x(()=>r.fleet(),[c]),T=w?null:C??void 0,[D,O]=(0,F.useState)(null),[k,A]=(0,F.useState)(``),[j,M]=(0,F.useState)({}),[P,L]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),V=e=>R.id===e?.id?R.value:`keep`,[H,U]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of g?.targets||[]){let n=B(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[g]);if(m||v)return(0,I.jsx)(a,{error:m||v,onRetry:()=>{h(),y()}});if(!p||!g)return(0,I.jsx)(l,{});let W={active:0,disabled:1,absent:2},G=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(W[e.state]??3)-(W[t.state]??3)),K=G.find(e=>e.id===H)||G.find(e=>e.selected)||G.find(e=>e.state===`active`)||G[0],q=e=>{let t=j[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},se=(e,t,n)=>M(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ce=e=>{let t=q(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=q(t),s=S(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,l=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await d(l,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},ue=async e=>{if(e.state!==`active`||await d(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){A(e.id),O(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;O({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}u?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&ne.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},de=async e=>{let t=V(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await d(`Uninstall ${S(e.host).label} · ${e.scope}? It deletes ${f(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){A(e.id),O(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){O({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&O({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),u?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},fe=async e=>{O(null);try{let t=await r.mcpReveal(e.path);O({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){O({text:e.message,tone:`bad`})}},pe=async()=>{let t=G.filter(e=>e.state===`active`).map(e=>`${_(e)} · ${e.scope}`);await d(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},me=G.find(e=>e.selected)?.host||G.find(e=>e.state===`active`)?.host||G[0]?.host||`opencode`,X=G.filter(e=>e.scope===`global`),Z=G.filter(e=>e.scope!==`global`),Q=e=>{U(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}u?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[G.filter(e=>e.state===`active`).length,` active of `,G.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:pe,children:[(0,I.jsx)(b,{name:`refresh`}),` Rebuild all`]})}):null]}),D?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:D.text}):D?(0,I.jsx)(`p`,{className:`tag ${D.tone===`ok`?`ok `:``}note`,role:`status`,children:D.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:K?.id,onPick:Q,label:`Global installs`,fleet:T,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>L(e=>!e),children:[(0,I.jsx)(b,{name:`folder`}),` Deploy to a repo…`]}):null]}),P?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(ee,{host:me,theme:n||`neutral`,options:J,onAction:e,onClose:()=>L(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:K?.id,onPick:Q,label:`Per-project installs`,fleet:T,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:s,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),K?(0,I.jsx)(te,{inst:K,targets:re[B(K.host,K.path)]||[],choice:q(K),unchanged:ce(K),options:J,onPick:(e,t)=>se(K,e,t),canAct:!!e,busy:k===K.id,memory:V(K),onMemory:e=>z({id:K.id,value:e}),onApply:()=>le(K),onToggleInstall:()=>ue(K),onRemove:()=>de(K),onRevealMcp:fe},K.id):null]})}function K({onAction:e,dataRev:t}){let{data:n,error:i}=x(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(a,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(l,{})}function q(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var se=300;function ce({onMutated:e,onAction:t,dataRev:n,overview:i}){let s=o(),{data:c,error:u,reload:d}=x(()=>r.diff(),[n]),[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(``),[g,_]=(0,F.useState)(()=>new Set),[v,y]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(c&&c!==S){C(c),_(new Set);let e=c.files.reduce((e,t)=>e+t.diff.length,0);y(new Set(e<=se?c.files.map(e=>e.rel):[]))}let w=e=>_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>_(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[...g],n=t.filter(e=>c.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
2
+ `)}\n\n`:``;if(await s(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){p(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;h(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await d(),e?.()}catch(e){h(e.message)}finally{p(!1)}}};if(u)return(0,I.jsx)(a,{error:u,onRetry:d});if(!c)return(0,I.jsx)(l,{});if(!c.deployed)return(0,I.jsx)(E,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!c.diffable)return(0,I.jsx)(E,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=c.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=c.files.filter(e=>e.status===`linked`),j=c.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,ee=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),c.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:c.target}),c.theme?` (${c.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,M>0?(0,I.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||g.size===0,onClick:O,children:[`Restore`,g.size?` (${g.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,I.jsx)(b,{name:`download`}),`Export improvements`]})]})]}),m?(0,I.jsx)(`p`,{className:`sub mb-14`,children:m}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
3
+ `),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(E,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>y(new Set(c.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>y(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:g.size===k.length,onChange:T}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>L(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>L(e,!1))]}):null]})]});function L(e,t){let n=v.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:g.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>ee(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(b,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${q(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(b,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function le({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:i,reload:o,setData:s}=x(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),o()};if(i)return(0,I.jsx)(a,{error:i,onRetry:o});let u=n?n.groups.filter(e=>e.problems.length):[],d=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`page-fill`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,I.jsx)(b,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,I.jsx)(J,{group:e,i:t},e.label)),d.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,I.jsx)(J,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,I.jsx)(l,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ue(){let e=o(),[t,n]=(0,F.useState)(!1),[i,s]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{error:i}),(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){s(null);try{await r.shutdown()}catch(e){if(e.status)return s(e.message)}n(!0)}},children:[(0,I.jsx)(b,{name:`x`}),`Stop server`]})]})}function Y(){let e=o(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a,{error:r}),(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await h()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(b,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var de=`https://github.com/Arylmera/Geneseed`,fe=`https://github.com/Arylmera`,pe=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],me=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:pe.map(([n,r])=>(0,I.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,I.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function $({version:e}){let[t,n]=(0,F.useState)(de),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(b,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(b,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(b,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(b,{name:`external`}),`MIT License`]})]})]}),children:(0,I.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:fe,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(b,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function he({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:a,onAccentMode:s,layout:l,onLayout:f}){let p=o(),h=e?.install,y=e?.footprint,x=e?.server,C=e?.daemon_stale,[T,E]=(0,F.useState)(null);(0,F.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let D=T?T.install??(T.git?`git`:`npm-global`):null,O=D===`git`?`Update (git pull + rebuild)`:D===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,k=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${_(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await p(`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`)},A=x?.autostart===!0?`On · login script`:x?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:w.server}),(0,I.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]})}),(0,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{stale:C}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,I.jsx)(u,{"aria-labelledby":`dir-skin-label`,children:d.map(e=>(0,I.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>i(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:d.find(e=>e.id===n)?.tagline??``})]}),a&&s&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(c,{value:a,onChange:s,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(a)})]}),l&&f&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(u,{"aria-labelledby":`dir-layout-label`,children:v.map(e=>(0,I.jsx)(`button`,{className:l===e.id?`on`:``,onClick:()=>f(e.id),"aria-pressed":l===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:v.find(e=>e.id===l)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:D===`other`?T.command?(0,I.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,I.jsx)(`code`,{className:`mono`,children:T.command})]}):null:(0,I.jsxs)(`button`,{className:`btn`,onClick:k,children:[(0,I.jsx)(b,{name:`download`}),O]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(b,{name:`external`}),`Add to PATH`]})}),h&&y&&(0,I.jsxs)(X,{k:`Harness footprint`,help:(0,I.jsxs)(I.Fragment,{children:[`For `,S(h.host).label,` · `,h.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,I.jsx)(`span`,{className:`mono`,children:y}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,children:y===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,I.jsxs)(Z,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,x?` · pid ${x.pid} · up ${m(x.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(Y,{}),children:C?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:A})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:me.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ue,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function ge({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?C(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(D,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(G,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(K,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(ce,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(le,{dataRev:o}),e===`server`&&(0,I.jsx)(he,{overview:t,onAction:i,...c})]})}export{ge as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{Ct as j,S as M,St as N,dt as P,ft as F,ut as I,xt as L,yt as R}from"./index-DxCqnFPy.js";import{n as z}from"./Dashboard-DEQCBcUW.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=j(this,p(e,l,t,null,this));V(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;V(t,this,j(this,a),e)}}else V(e,this,j(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.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 v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=j(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>R(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=F(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:N(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:N(70)},260).add(a,{opacity:1,duration:300,delay:N(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:N(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=P(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(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)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:N(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:M(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:M(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:P(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>R(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>R(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:I(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${I(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>R(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>R(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{Ct as j,S as M,St as N,bt as P,dt as F,ft as I,pt as L,wt as R}from"./index-FLVXXvV3.js";import{n as z}from"./Dashboard-CaqOqtkG.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=R(this,p(e,l,t,null,this));V(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;V(t,this,R(this,a),e)}}else V(e,this,R(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.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 v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=R(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>P(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),P(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=L(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=N(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:j(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:j(70)},260).add(a,{opacity:1,duration:300,delay:j(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:j(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=I(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(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)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:j(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:M(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:M(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:I(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>P(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>P(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:F(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${F(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>P(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>P(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{G as r,W as i,Z as a}from"./index-DxCqnFPy.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{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 f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=a(),s=r(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(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 _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{G as r,K as i,Q as a}from"./index-FLVXXvV3.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{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 f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=a(),s=i(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===r(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,r(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,r(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(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 _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{J as i,L as a,U as o,ft as s,q as c}from"./index-DxCqnFPy.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-fYh_YjQA.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(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 P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=s(()=>r.kits(),[n]),d=h(a,t),{data:f}=s(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(i,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{P as default};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{J as i,R as a,W as o,Y as s,pt as c}from"./index-FLVXXvV3.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-Ckc0P5kt.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(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 P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=c(()=>r.kits(),[n]),d=h(a,t),{data:f}=c(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(s,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(s,{})]})}export{P as default};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{G as i,H as a,J as o,K as s,Q as c,R as l,W as u,Y as d,Z as f,_ as p,bt as m,d as h,f as g,g as _,h as v,m as ee,p as y,pt as b,v as te,y as x}from"./index-FLVXXvV3.js";import{t as ne}from"./EmptyState-1sPNleqv.js";import{t as S}from"./FilterInput-CZREvrjX.js";import{t as C}from"./Markdown-DpmmtW2Y.js";var w=e(t(),1);function re({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:o}){let l=c(),u=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),d=u.join(`,`),f=s(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=i(u),{prune:h}=f,g=e.length>0;(0,w.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===p&&t.base!==m)},[g,p,m,h]);let _=f.get(`rules`,p),v=_&&_.base===m?_.value:u,ee=e=>f.put(`rules`,p,e(v),m),y=e=>v.includes(e),b=e=>ee(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),te=e=>e.rules.some(e=>y(e.addr)),x=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>y(e.addr));ee(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},ne=e=>{let t=e.rules.filter(e=>y(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`},S=t.flatMap(e=>e.rules.map(e=>e.addr)),C=S.filter(y),re=C.join(`,`)!==d,T=`process.5`,E=u.includes(T)&&!v.includes(T);return{deployedRules:u,isOn:y,toggleRule:b,packOn:te,togglePack:x,packState:ne,allRules:S,pickedRules:C,dirty:re,losingConsent:E,applyPacks:async()=>{if(!r||!re)return;let e=t.filter(e=>e.rules.some(e=>y(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!y(e.addr)).map(e=>e.addr)),s=E?`
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. `+(o?`(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.)`):``,c=C.length?`${C.length} of ${S.length} doctrine rules`:`no doctrine rules`;await l(`Rebuild ${n.host} · ${n.scope} with ${c}? It rebuilds in place, non-destructive.${s}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await a(`install`,{...n,doctrines:e,excludeRules:i})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var T=n();function E({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:s,label:c,rev:l,toggleCol:u=null,renderBody:d,srcLine:f}){let p=(0,w.useId)(),{data:m,error:h,reload:g}=b(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),_=t&&(0,T.jsxs)(`div`,{className:`law-expand`,id:p,children:[h?(0,T.jsx)(o,{error:h,onRetry:g}):m?d(m):(0,T.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,T.jsx)(`div`,{className:`law-srcline`,children:f})]}),v={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":p,"aria-label":c};return u?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,T.jsx)(`button`,{className:`law-disclosure`,...v,children:s}),(0,T.jsx)(`span`,{className:`toggle-col`,children:u})]}),_]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`button`,{className:i,style:a,"data-addr":e,...v,children:s}),_]})}function D({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null}){let a=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`span`,{className:`law-no`,children:[(0,T.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,T.jsxs)(`span`,{className:`law-name`,children:[(0,T.jsx)(`span`,{children:e.name}),e.ess?(0,T.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,T.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,T.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,T.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,T.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,T.jsx)(E,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:a,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,T.jsx)(C,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`})}var ie=[`invariants`,`doctrines`];function ae({tiers:e,current:t,onPick:n}){return(0,T.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`span`,{className:`tier-head`,children:[(0,T.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,T.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,T.jsxs)(`span`,{className:`tier-top`,children:[(0,T.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,T.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,T.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,T.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,T.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,T.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,T.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&ie.includes(e.key)?(0,T.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,T.jsx)(`div`,{className:a,children:i},e.key)})})}function oe({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1}){let i=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(_(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),a=Math.max(1,...i.map(([,e])=>e));return(0,T.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,T.jsxs)(`div`,{className:`panel-head`,children:[(0,T.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,T.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i.length?(0,T.jsx)(`ul`,{className:`gate-list`,children:i.map(([e,r,i])=>{let o=_(e),s=t[o]?.name||o;return(0,T.jsxs)(`li`,{children:[(0,T.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,T.jsxs)(`span`,{className:`gate-top`,children:[(0,T.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:s}),(0,T.jsx)(`span`,{className:`mono dim`,children:o}),i&&(0,T.jsx)(`span`,{className:`mono off`,children:`off`}),(0,T.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,T.jsx)(l,{value:r,max:a,label:`${s} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,T.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,T.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function se({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,losingConsent:u}=t,d=Math.max(1,...e.map(e=>e.rules.length));return(0,T.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,T.jsxs)(`div`,{className:`panel-head`,children:[(0,T.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,T.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,T.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,T.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,T.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,T.jsx)(l,{value:t,max:d,label:`${e.title} rules on`}),(0,T.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,T.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`,onClick:()=>s(e)}):null]},e.pack)})}):(0,T.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,T.jsxs)(T.Fragment,{children:[u&&(0,T.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,T.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,T.jsx)(`code`,{children:`git commit`}),` and `,(0,T.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,T.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:c?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}function ce(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=p(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:v(n.name),c:x[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function le({selected:e,overview:t,setup:n,onAction:i,dataRev:s}){let C=c(),{data:E,error:ie}=b(()=>r.catalog(`laws`),[s],`catalog:laws`),{data:le}=a(s),[O,k]=(0,w.useState)(`all`),[A,ue]=(0,w.useState)(``),[j,M]=(0,w.useState)(`all`),[de,fe]=(0,w.useState)(()=>new Set),N=e||null,pe=e=>m(N===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),[me,he]=(0,w.useState)(0),P=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>{let t=document.querySelector(`[data-addr="${CSS.escape(e)}"]`);if(!t)return;let n=P.current===e;P.current=null;let r=t.getBoundingClientRect();if(n||r.top<80||r.bottom>window.innerHeight){let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`})}n&&(t.classList.remove(`law-flash`),t.offsetWidth,t.classList.add(`law-flash`))});return()=>cancelAnimationFrame(t)},[e,me,E]);let F=E?.items||[],I=ce(F),L=e=>t?.install?.[g[e].key]!==!1,ge=L(`IV`),R=t?.install,z=!!(R&&i),B=re({items:F,packs:I,install:R,canApply:z,onAction:i,gateArmed:ge}),{deployedRules:V,isOn:H,toggleRule:_e,packOn:ve,packState:ye,allRules:U}=B;if(ie)return(0,T.jsx)(o,{error:ie});if(!E)return(0,T.jsx)(d,{});let W={ontology:E.nouns?.ontology||`Ethos`,law:E.nouns?.law||`Dictate`,laws:E.nouns?.laws||`Dictates`,doctrines:E.nouns?.doctrines||`Doctrines`},G=F.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),K=F.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&te[e.klass]?e.klass:`craft`,r=p(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`:v(e.name,t?.install),cat:n,c:te[n].c,off:r.retired,src:`laws/universal.md`}}),be=e=>{let t=H(e.addr),n=V.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},xe=I.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!V.includes(e.addr)).map(e=>e.addr)),Se=async e=>{if(!z)return;let{key:t,label:n}=g[e],r=n.toLowerCase(),a=!L(e),o=`${R.host} · ${R.scope}`,s=B.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await C((a?`Re-arm the ${r} on ${o}? ${h[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${o}? ${h[e].off} It rebuilds in place, non-destructive.`)+s,{title:a?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:a?`Re-arm`:`Switch off`})&&i(`install`,{...R,[t]:a})},Ce=e=>String(e.addr).includes(`.`)&&H(e.addr)!==V.includes(e.addr),q=(e,t=j)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||V.includes(e.addr)):Ce(e)),J=A.trim().toLowerCase(),Y=e=>q(e)&&(!J||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(J)),we=e=>{let t=je[e],n=String(e).includes(`.`);(n&&O===`invariants`||!n&&O===`doctrines`)&&k(`all`),t&&!q(t)&&M(`all`),t&&!Y(t)&&ue(``),P.current=e,he(e=>e+1),m(`#/item/law/${encodeURIComponent(e)}`)},X={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))X[_(e)]=t;let Te=e=>X[e.addr]?{...e,asks:`${X[e.addr]} ask${X[e.addr]===1?``:`s`}`}:e,Z=K.filter(e=>!e.retired).length,Q=V.length,Ee=Object.keys(g).filter(e=>K.some(t=>t.addr===e)&&!L(e)).length,De=U.length-Q,$=le?.stats,Oe={ethos:{name:W.ontology,n:G.length,fill:1,sub:`${G.length} sections`,pill:[`always`,`ok`]},invariants:{name:W.laws,n:Z,fill:K.length?Z/K.length:0,sub:K.length>Z?`${Z} active · ${K.length-Z} retired`:`${Z} active`,pill:Ee?[`${Ee} gate${Ee===1?``:`s`} off`,`warn`]:[`always`,`ok`]},doctrines:{name:W.doctrines,n:Q,fill:U.length?Q/U.length:0,sub:`${Q} rules · ${I.filter(e=>e.active).length} of ${I.length} packs`,pill:De>0?[`${De} excluded`,`warn`]:[`all on`,`ok`]},yours:{name:`Your rules`,n:$?.rules??0,fill:$?.max_rules?$.rules/$.max_rules:0,sub:$?`${$.rules} of ${$.max_rules} · ${$.tokens}/${$.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},ke=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,W.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Ae=y.map(e=>({key:e.key,...Oe[e.key],rule:ke(e.against)})),je=Object.fromEntries([...K,...I.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Me=[[`all`,`All`,K.length+U.length],[`invariants`,W.laws,K.length],[`doctrines`,W.doctrines,U.length]],Ne=O===`all`||O===`invariants`,Pe=O===`all`||O===`doctrines`,Fe=[...Ne?K:[],...Pe?I.flatMap(e=>e.rules):[]],Ie=[[`gated`,`Gated`,Fe.filter(e=>q(e,`gated`)).length],[`changed`,`Changed`,Fe.filter(e=>q(e,`changed`)).length]],Le=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,Re=e=>j!==`changed`&&de.has(e)&&Le(N)!==e,ze=e=>{let t=Re(e);fe(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&Le(N)===e&&m(`#/laws`)},Be=I.flatMap(e=>e.rules.filter(Ce).map(e=>({...e,plus:H(e.addr)}))),Ve=z&&I.length>0&&B.dirty,He=()=>{M(`changed`),O===`invariants`&&k(`all`),ue(``)},Ue=(e,t)=>(0,T.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,T.jsx)(`h2`,{className:`tier-h`,children:e}),(0,T.jsx)(`span`,{className:`mono dim`,children:t})]}),We=K.filter(Y),Ge=(Ne?We.length:0)+(Pe?I.reduce((e,t)=>e+t.rules.filter(Y).length,0):0);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(u,{eyebrow:R?[t?.theme,R.footprint&&`${R.footprint} footprint`,R.host,R.scope].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,T.jsx)(S,{className:`law-filter`,value:A,onChange:ue,placeholder:`Filter rules`,label:`Filter rules`})}),(0,T.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,T.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,T.jsx)(ae,{tiers:Ae,current:O,onPick:k}),(0,T.jsx)(`div`,{className:`ladder-tail`,children:ee.map((e,t)=>(0,T.jsxs)(`span`,{className:`ladder-low`,children:[(0,T.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,y.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,T.jsxs)(`div`,{className:`split`,children:[(0,T.jsxs)(`section`,{className:`panel flush law-wrap${z?` with-toggle`:``}`,"aria-label":`Rules`,children:[G.length>0&&(0,T.jsxs)(T.Fragment,{children:[Ue(W.ontology,`ontology/universal.md`),G.map(e=>(0,T.jsx)(D,{law:e,rev:s,isOpen:N===e.addr,onToggle:()=>pe(e.addr)},e.addr))]}),(0,T.jsxs)(`div`,{className:`law-toolbar`,children:[(0,T.jsx)(f,{"aria-label":`Show`,children:Me.map(([e,t,n])=>(0,T.jsxs)(`button`,{type:`button`,className:O===e?`on`:``,"aria-pressed":O===e,onClick:()=>k(e),children:[t,` `,(0,T.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,T.jsx)(f,{"aria-label":`Narrow`,children:Ie.map(([e,t,n])=>(0,T.jsxs)(`button`,{type:`button`,className:j===e?`on`:``,"aria-pressed":j===e,onClick:()=>M(j===e?`all`:e),children:[t,` `,(0,T.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,T.jsxs)(`div`,{className:`law-rowhead`,children:[(0,T.jsx)(`span`,{children:`No.`}),(0,T.jsx)(`span`,{children:`Rule`}),(0,T.jsx)(`span`,{children:`Latin name`}),(0,T.jsx)(`span`,{children:`Status`}),(0,T.jsx)(`span`,{children:`Enforced by`})]}),Ne&&We.length>0&&(0,T.jsxs)(T.Fragment,{children:[Ue(W.laws,`laws/universal.md`),We.map(e=>(0,T.jsx)(D,{law:Te(e),rev:s,isOpen:N===e.addr,onToggle:()=>pe(e.addr),toggleCol:!z||e.retired?null:g[e.addr]?(0,T.jsx)(`button`,{type:`button`,className:`sw-toggle${L(e.addr)?` on`:``}`,role:`switch`,"aria-checked":L(e.addr),"aria-label":g[e.addr].label,onClick:()=>Se(e.addr)}):(0,T.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Pe&&I.map(e=>{let t=e.rules.filter(Y);if(!t.length)return null;let n=Re(e.pack),r=e.rules.filter(e=>H(e.addr)).length;return(0,T.jsxs)(`div`,{className:`pack-wrap${ve(e)?``:` pack-off`}`,children:[(0,T.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,T.jsx)(`h2`,{className:`tier-h`,style:{"--cc":x[e.pack]},children:(0,T.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>ze(e.pack),children:e.title})}),(0,T.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,T.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,T.jsx)(`span`,{className:`pack-fill`,children:(0,T.jsx)(l,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,T.jsx)(`span`,{className:`pack-state mono`,children:ye(e)})]}),!e.active&&!z&&(0,T.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,I.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),xe.length>0&&` --exclude-rules ${xe.join(`,`)}`]}),!n&&t.map(e=>(0,T.jsx)(D,{law:Te(be(e)),rev:s,isOpen:N===e.addr,onToggle:()=>pe(e.addr),toggleCol:z?(0,T.jsx)(`button`,{type:`button`,className:`sw-toggle${H(e.addr)?` on`:``}`,role:`switch`,"aria-checked":H(e.addr),"aria-label":`${e.name} rule`,onClick:()=>_e(e.addr)}):null},e.addr))]},e.pack)}),Ge===0&&(0,T.jsx)(ne,{title:J||j!==`all`?`No matching rules`:`Nothing in this tier`,children:J?(0,T.jsxs)(T.Fragment,{children:[`Nothing matches “`,A.trim(),`”.`]}):j===`all`?(0,T.jsx)(T.Fragment,{children:`This install predates the tier.`}):(0,T.jsxs)(T.Fragment,{children:[`No `,j,` rule in this tier.`]})})]}),(0,T.jsxs)(`aside`,{className:`aside-stack`,children:[(0,T.jsx)(se,{packs:I,sel:B,canApply:z,install:R,gateArmed:ge}),(0,T.jsx)(oe,{gates:n?.gates,byAddr:je,onJump:we,disarmed:e=>!!g[e]&&!L(e)})]})]}),Ve&&(0,T.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,T.jsxs)(`span`,{className:`law-bar-n`,children:[Be.length,` unapplied change`,Be.length===1?``:`s`]}),(0,T.jsx)(`span`,{className:`law-bar-list`,children:Be.map(e=>(0,T.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,T.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:He,children:`Review changes`}),(0,T.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{M(`all`),B.revert()},children:`Revert`}),(0,T.jsxs)(`button`,{type:`button`,className:`btn`,onClick:B.applyPacks,children:[`Apply (`,B.pickedRules.length,`/`,U.length,` rules)`]})]})]})}export{le as default};
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{i}from"./motion-CXaUMNkg.js";import{n as a,t as o}from"./sections-ChwaobfW.js";import{B as s,X as ee,Z as te,at as c,b as l,ft as u,q as ne,x as d,yt as re}from"./index-DxCqnFPy.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{a as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./RailCats-BuJD4Jou.js";import{t as ue}from"./Markdown-DpmmtW2Y.js";var p=e(t(),1),m=n();function de({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,m.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function h({entries:e}){return e.length?(0,m.jsxs)(`table`,{className:`mf-entries`,children:[(0,m.jsx)(`thead`,{className:`sr-only`,children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{scope:`col`,children:`Path`}),(0,m.jsx)(`th`,{scope:`col`,children:`Load`}),(0,m.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,m.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,m.jsx)(`td`,{className:`mf-load-cell`,children:(0,m.jsx)(de,{load:e.load})}),(0,m.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function g({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,m.jsxs)(`div`,{className:`mf-vault`,children:[(0,m.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,m.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,m.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,m.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(c,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(c,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,m.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,m.jsx)(c,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,m.jsx)(h,{entries:t})]})}function _({body:e}){let[t,n]=(0,p.useState)(!1),r=(0,p.useId)();return e?(0,m.jsxs)(`div`,{className:`mf-raw`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,m.jsx)(c,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,m.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function fe({manifest:e,body:t,name:n}){if(!e)return(0,m.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,m.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,m.jsx)(g,{wiki:e},e.name||t)),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,m.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,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,m.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,m.jsx)(_,{body:t})]})}let r=e.context||[];return r.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[(0,m.jsx)(h,{entries:r}),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,m.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,m.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,m.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,m.jsx)(_,{body:t})]})}var v={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},y={advocate:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,m.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,m.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,m.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,m.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,m.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,m.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,m.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,m.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,m.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),"devops-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`3`})]}),"docker-expert":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`14`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`27`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`20`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`34`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`path`,{d:`M8 52c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3 5-3 10-3`,opacity:`.5`})]}),docs:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,m.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,m.jsx)(`g`,{className:`ag-write`,children:(0,m.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,m.jsxs)(`g`,{className:`ag-search`,children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,m.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-frame`,children:(0,m.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,m.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,m.jsxs)(`g`,{className:`ag-turn`,children:[(0,m.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,m.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,m.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,m.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,m.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-gauge`,children:(0,m.jsx)(`path`,{d:`M32 42l10-13`})}),(0,m.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,m.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,m.jsxs)(`g`,{className:`ag-tilt`,children:[(0,m.jsx)(`path`,{d:`M14 18h36`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"kubernetes-specialist":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`16`}),(0,m.jsx)(`path`,{d:`M32 8v13M32 43v13M8 32h13M43 32h13M15 15l9 9M40 40l9 9M49 15l-9 9M24 40l-9 9`,opacity:`.6`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`5`})]}),"memory-curator":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,m.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,m.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,m.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,m.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,m.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,m.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`path`,{d:`M30 34V22`})}),(0,m.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,m.jsxs)(`g`,{className:`ag-lean`,children:[(0,m.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),"spring-boot-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M22 20a16 16 0 1 0 20 0`}),(0,m.jsx)(`path`,{className:`ag-pulse`,d:`M32 12v18`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 50c0-8 5-12 13-12 0 8-5 12-13 12z`})]}),"spring-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h26M12 26h18M12 34h22M12 42h14`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M42 28c0-8 4-12 11-12 0 8-4 12-11 12z`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`24`,cy:`32`,r:`9`}),(0,m.jsx)(`path`,{d:`M31 39l8 8`,strokeWidth:`3`})]})]}),"spring-security":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`path`,{d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`rect`,{className:`ag-f`,x:`16`,y:`28`,width:`32`,height:`24`,rx:`4`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`38`,r:`3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 41v6`})]}),"react-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{className:`ag-spin`,children:[(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(60 32 32)`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(120 32 32)`})]}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`4`})]}),"react-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{opacity:`.4`,children:[(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(60 30 30)`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(120 30 30)`})]}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`30`,r:`8`}),(0,m.jsx)(`path`,{d:`M36 36l9 9`,strokeWidth:`3`})]})]}),steward:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,m.jsxs)(`g`,{className:`ag-grow`,children:[(0,m.jsx)(`path`,{d:`M32 50V26`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,m.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,m.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,m.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,m.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,m.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,m.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,m.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},b=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function pe({name:e,size:t=64}){return(0,m.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...v,children:[(0,m.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,m.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),y[e]||b]})}function x({label:e,value:t,delta:n,children:r}){let a=i(Number.isInteger(t)?t:null);return(0,m.jsxs)(`div`,{className:`stat`,children:[(0,m.jsx)(`div`,{className:`stat-label`,children:e}),(0,m.jsx)(`div`,{className:`stat-value mono`,children:a===null?t:Math.round(a)}),n==null?null:(0,m.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var me={skills:`skill`,agents:`agent`},he=(e,t)=>`${t?e/t*100:0}%`,S=e=>e.split(`:`).slice(0,2).join(` `);function C(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 ge({section:e,source:t}){return(0,m.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,m.jsx)(c,{name:a[e].icon,className:`glyph`}),(0,m.jsxs)(`span`,{children:[`This entry is part of the `,a[e].label.toLowerCase(),` convention; see`,` `,(0,m.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var w=e=>e.replace(/\s+/g,` `).trim(),T=e=>e.replace(/^(?:[ \t]*\n)+/,``);function _e(e,t){let n=e.replace(/\r\n/g,`
2
- `),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=T(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?w(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?w(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=T(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function ve({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(x,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(S))].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,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(x,{label:`Used`,value:e.n,delta:o,children:(0,m.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,m.jsx)(`i`,{className:t===29?`today`:``,style:{height:he(e,a)}},t))})})})}function E(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 ye={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},be=(e,t)=>t||(e&&o.includes(e)?e:o[0]),xe=encodeURIComponent;function Se(e){let t=e=>l[e.klass]?e.klass:`personal`,n=d.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:l[n].label,groupC:l[n].c})));return{rows:n,cats:d.map(e=>({key:e,label:l[e].label,c:l[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ce(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 D({overview:e,section:t,selected:n,dataRev:i,lock:c,base:d,onRulesChanged:de}){let h=te(),[g,_]=(0,p.useState)(()=>be(t,c)),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(`all`),[S,w]=(0,p.useState)(`all`),[T,D]=(0,p.useState)(``),[we,Te]=(0,p.useState)(null),[Ee,De]=(0,p.useState)(t);if(t!==Ee){De(t),D(``);let e=be(t,c);e!==g&&(_(e),y(``),x(`all`),w(`all`))}let[Oe,ke]=(0,p.useState)(n);n!==Oe&&(ke(n),D(``));let{data:O,error:Ae,reload:k}=u(()=>r.catalog(g),[g,i],`catalog`),A=c?null:me[g]||null,j=A!==null,{data:M}=u(()=>j?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[j,i],`usage`,{revalidate:!0}),N=j&&!!M?.enabled&&Array.isArray(M.names),je=(0,p.useMemo)(()=>new Map((Array.isArray(M?.names)?M.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[M]),P=e=>N&&je.get(`${A}\u0000${e}`)||null,F=e=>{let t=P(e.name);return!t||t.n===0&&!t.last},Me=M?.since?`No call since ${M.since}`:`No call recorded yet`,I=O?.section===g&&O?.items||[],L=g===`skills`,Ne=L?Se(I):null,R=L?Ne.rows:g===`memory`?Ce(I):I,z=n||R[0]?.name||null,B=z?I.find(e=>e.name===z):null,Pe=B?.type||a[g].type,{data:Fe,error:V}=u(()=>z?r.item(Pe,z):Promise.resolve(null),[g,z,Pe,i]),H=V?null:Fe,Ie=T||Ae||V,Le=z?{name:z,title:H?.title||z,desc:H?.desc||``}:null,U=B||Le,Re=e?.counts||{},W=L?R.filter(e=>b===`all`||e.cat===b):R,ze=N?W.filter(F).length:0,Be=e=>e.status===`experimental`,Ve=W.filter(Be).length,G=[[`all`,`All`,W.length],...N?[[`used`,`Used`,W.length-ze],[`unused`,`Not used yet`,ze,Me]]:[],...Ve?[[`experimental`,`Experimental`,Ve,`Shipped, not yet confirmed by real use`]]:[]],K=G.some(([e])=>e===S)?S:`all`,q=K===`all`?W:K===`experimental`?W.filter(Be):W.filter(e=>F(e)===(K===`unused`)),He=N?Math.max(0,...I.map(e=>P(e.name)?.n||0)):0,J=L?1/0:50,Y=v.trim().toLowerCase(),X=Y?oe(q,Y):q.slice(0,J),Ue=!Y&&b===`all`&&K===`all`&&z&&!X.some(e=>e.name===z)?[...X,...R.filter(e=>e.name===z)]:X,We=e=>d?`${d}/${xe(e.name)}`:`#/item/${e.type||a[g].type}/${xe(e.name)}`,Ge=async()=>{let e=U?.name;if(e&&await h(`Forget the memory fact "${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`})){D(``);try{await r.memoryDelete(e)}catch(t){D(`Could not forget "${e}": ${t.message}`);return}re(d||`#/section/memory`),k()}},Ke=async()=>{let e=U?.name;if(e&&await h(`Promote "${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`})){D(``);try{let t=await r.rules();await r.rulesPromote({name:e,fingerprint:t.fingerprint,delete_memory:!0}),s(),de?.(),re(`#/personal/rules`)}catch(e){D(`Could not promote: ${e.message}`),k()}}},Z=H?.body?_e(H.body,H.desc||U?.desc):null,qe=H?.title||U?.title||U?.name,Je=qe===U?.name&&Z?.title?Z.title:qe,Ye=O?.section===g&&I.length===0,Xe=H?.status||U?.status,Ze=g===`skills`?l[B?.klass]:null,Q=a[g].label,{lede:Qe,when:$e}=E(H?.desc||U?.desc||``),$=U?H?.source||U.source||(V?null:C(g,U.name)):null;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ne,{error:Ie,style:{margin:`0 0 var(--sp-3)`}}),(0,m.jsxs)(`div`,{className:`library lib-dossier${c?` locked`:``}${N?` uses`:``}`,children:[c?null:(0,m.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,m.jsxs)(`div`,{className:`lib-title`,children:[(0,m.jsx)(`h1`,{className:`h`,children:`Library`}),(0,m.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,m.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:o.map(e=>(0,m.jsxs)(p.Fragment,{children:[(0,m.jsxs)(`a`,{href:`#/section/${e}`,className:g===e?`on`:``,"aria-current":g===e?`page`:void 0,children:[a[e].label,(0,m.jsx)(`span`,{className:`mono dim`,children:Re[e]??``})]}),e===g&&L&&(0,m.jsx)(le,{label:`Skill types`,total:I.length,cats:Ne.cats,cat:b,onChange:x})]},e))})]}),(0,m.jsxs)(ie,{label:Q,count:Y?`${X.length} of ${q.length}`:q.length,q:v,onQ:y,matched:X.length,inView:[g,n],extra:N&&M.since?(0,m.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,M.since]}):null,tools:G.length>1?(0,m.jsx)(ee,{"aria-label":`Show`,children:G.map(([e,t,n,r])=>(0,m.jsxs)(`button`,{type:`button`,className:K===e?`on`:``,"aria-pressed":K===e,title:r,onClick:()=>w(e),children:[t,` `,(0,m.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[(0,m.jsx)(se,{rows:Ue,activeName:U?.name,hrefOf:We,pills:N?e=>{let t=P(e.name)?.n||0;return(0,m.jsxs)(`span`,{className:`lr-use`,children:[(0,m.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,m.jsx)(`i`,{style:{width:he(t,He)}})}),(0,m.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,m.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})}:void 0}),!Y&&I.length>J&&(0,m.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,J,` of `,I.length,`; type to search the rest.`]}),Ye&&(g===`wiki`?(0,m.jsxs)(f,{title:`No wiki entries`,action:(0,m.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,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,m.jsx)(f,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,m.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:U?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`reader-tags`,children:[(0,m.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),Ze?(0,m.jsx)(`span`,{className:`tag`,children:Ze.label}):null,H?.kit??U.kit?(0,m.jsx)(ae,{name:H?.kit??U.kit}):null,(0,m.jsx)(ce,{status:Xe,withHint:!0}),$?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`mono dim reader-src`,children:$}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText($),Te({src:$,ok:!0})}catch{Te({src:$,ok:!1})}},children:we?.src===$?we.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,m.jsxs)(`div`,{className:`reader-head`,children:[(0,m.jsx)(`h2`,{className:`reader-title`,children:Je}),g===`agents`?(0,m.jsx)(pe,{name:U.name}):null]}),(0,m.jsxs)(`div`,{className:`reader-intro${N?` with-stats`:``}`,children:[(0,m.jsxs)(`div`,{className:`reader-intro-text`,children:[Qe?(0,m.jsx)(`p`,{className:`reader-lede`,children:Qe}):null,$e?(0,m.jsxs)(`section`,{className:`reader-when`,children:[(0,m.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,m.jsx)(`p`,{children:$e})]}):null]}),N?(0,m.jsx)(ve,{u:P(U.name),usage:M,noCall:Me}):null]}),g===`memory`&&U.name!==`MEMORY`&&U.name!==`README`&&(0,m.jsxs)(`div`,{className:`row gap-8`,children:[(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Ke,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Ge,children:`Forget this fact`})]}),(0,m.jsx)(`hr`,{className:`hr`}),V?(0,m.jsxs)(`p`,{className:`sub`,children:[`No `,Q.replace(/s$/,``).toLowerCase(),` named `,(0,m.jsx)(`em`,{children:U.name}),` could be read in this install.`]}):U?.kind===`manifest`||H?.manifest!==void 0?H?(0,m.jsx)(fe,{manifest:H.manifest,body:H.body,name:U.name}):(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):H?.body?(0,m.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,m.jsx)(ue,{body:Z.body,links:H.links||[]})}):H===null&&z?(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,m.jsx)(ge,{section:g,source:C(g,U.name)}),ye[g]?(0,m.jsx)(`div`,{className:`reader-links`,children:(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${ye[g]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):Ye?null:(0,m.jsx)(f,{title:`Select an entry`,children:`Pick something from the list to read it.`})})]})]})}export{_e as bodyHead,D as default,Ce as groupMemory,Se as splitSkills,E as splitWhen};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{i}from"./motion-CXaUMNkg.js";import{n as a,t as o}from"./sections-ChwaobfW.js";import{J as s,Q as ee,V as te,Z as ne,b as c,bt as re,ot as l,pt as u,x as d}from"./index-FLVXXvV3.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{a as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./RailCats-BuJD4Jou.js";import{t as ue}from"./Markdown-DpmmtW2Y.js";var p=e(t(),1),m=n();function de({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,m.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function h({entries:e}){return e.length?(0,m.jsxs)(`table`,{className:`mf-entries`,children:[(0,m.jsx)(`thead`,{className:`sr-only`,children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{scope:`col`,children:`Path`}),(0,m.jsx)(`th`,{scope:`col`,children:`Load`}),(0,m.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,m.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,m.jsx)(`td`,{className:`mf-load-cell`,children:(0,m.jsx)(de,{load:e.load})}),(0,m.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function g({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,m.jsxs)(`div`,{className:`mf-vault`,children:[(0,m.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,m.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,m.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,m.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(l,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(l,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,m.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,m.jsx)(l,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,m.jsx)(h,{entries:t})]})}function _({body:e}){let[t,n]=(0,p.useState)(!1),r=(0,p.useId)();return e?(0,m.jsxs)(`div`,{className:`mf-raw`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,m.jsx)(l,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,m.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function fe({manifest:e,body:t,name:n}){if(!e)return(0,m.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,m.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,m.jsx)(g,{wiki:e},e.name||t)),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,m.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,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,m.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,m.jsx)(_,{body:t})]})}let r=e.context||[];return r.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[(0,m.jsx)(h,{entries:r}),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,m.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,m.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,m.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,m.jsx)(_,{body:t})]})}var v={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},y={advocate:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,m.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,m.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,m.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,m.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,m.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,m.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,m.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,m.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,m.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),"devops-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`3`})]}),"docker-expert":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`14`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`27`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`20`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`34`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`path`,{d:`M8 52c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3 5-3 10-3`,opacity:`.5`})]}),docs:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,m.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,m.jsx)(`g`,{className:`ag-write`,children:(0,m.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,m.jsxs)(`g`,{className:`ag-search`,children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,m.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-frame`,children:(0,m.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,m.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,m.jsxs)(`g`,{className:`ag-turn`,children:[(0,m.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,m.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,m.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,m.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,m.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-gauge`,children:(0,m.jsx)(`path`,{d:`M32 42l10-13`})}),(0,m.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,m.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,m.jsxs)(`g`,{className:`ag-tilt`,children:[(0,m.jsx)(`path`,{d:`M14 18h36`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"kubernetes-specialist":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`16`}),(0,m.jsx)(`path`,{d:`M32 8v13M32 43v13M8 32h13M43 32h13M15 15l9 9M40 40l9 9M49 15l-9 9M24 40l-9 9`,opacity:`.6`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`5`})]}),"memory-curator":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,m.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,m.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,m.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,m.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,m.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,m.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`path`,{d:`M30 34V22`})}),(0,m.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,m.jsxs)(`g`,{className:`ag-lean`,children:[(0,m.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),"spring-boot-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M22 20a16 16 0 1 0 20 0`}),(0,m.jsx)(`path`,{className:`ag-pulse`,d:`M32 12v18`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 50c0-8 5-12 13-12 0 8-5 12-13 12z`})]}),"spring-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h26M12 26h18M12 34h22M12 42h14`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M42 28c0-8 4-12 11-12 0 8-4 12-11 12z`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`24`,cy:`32`,r:`9`}),(0,m.jsx)(`path`,{d:`M31 39l8 8`,strokeWidth:`3`})]})]}),"spring-security":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`path`,{d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`rect`,{className:`ag-f`,x:`16`,y:`28`,width:`32`,height:`24`,rx:`4`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`38`,r:`3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 41v6`})]}),"react-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{className:`ag-spin`,children:[(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(60 32 32)`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(120 32 32)`})]}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`4`})]}),"react-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{opacity:`.4`,children:[(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(60 30 30)`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(120 30 30)`})]}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`30`,r:`8`}),(0,m.jsx)(`path`,{d:`M36 36l9 9`,strokeWidth:`3`})]})]}),steward:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,m.jsxs)(`g`,{className:`ag-grow`,children:[(0,m.jsx)(`path`,{d:`M32 50V26`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,m.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,m.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,m.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,m.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,m.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,m.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,m.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},b=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function pe({name:e,size:t=64}){return(0,m.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...v,children:[(0,m.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,m.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),y[e]||b]})}function x({label:e,value:t,delta:n,children:r}){let a=i(Number.isInteger(t)?t:null);return(0,m.jsxs)(`div`,{className:`stat`,children:[(0,m.jsx)(`div`,{className:`stat-label`,children:e}),(0,m.jsx)(`div`,{className:`stat-value mono`,children:a===null?t:Math.round(a)}),n==null?null:(0,m.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var me={skills:`skill`,agents:`agent`},he=(e,t)=>`${t?e/t*100:0}%`,S=e=>e.split(`:`).slice(0,2).join(` `);function C(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 ge({section:e,source:t}){return(0,m.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,m.jsx)(l,{name:a[e].icon,className:`glyph`}),(0,m.jsxs)(`span`,{children:[`This entry is part of the `,a[e].label.toLowerCase(),` convention; see`,` `,(0,m.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var w=e=>e.replace(/\s+/g,` `).trim(),T=e=>e.replace(/^(?:[ \t]*\n)+/,``);function _e(e,t){let n=e.replace(/\r\n/g,`
2
+ `),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=T(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?w(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?w(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=T(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function ve({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(x,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(S))].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,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(x,{label:`Used`,value:e.n,delta:o,children:(0,m.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,m.jsx)(`i`,{className:t===29?`today`:``,style:{height:he(e,a)}},t))})})})}function E(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 ye={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},be=(e,t)=>t||(e&&o.includes(e)?e:o[0]),xe=encodeURIComponent;function Se(e){let t=e=>c[e.klass]?e.klass:`personal`,n=d.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:c[n].label,groupC:c[n].c})));return{rows:n,cats:d.map(e=>({key:e,label:c[e].label,c:c[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ce(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 D({overview:e,section:t,selected:n,dataRev:i,lock:l,base:d,onRulesChanged:de}){let h=ee(),[g,_]=(0,p.useState)(()=>be(t,l)),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(`all`),[S,w]=(0,p.useState)(`all`),[T,D]=(0,p.useState)(``),[we,Te]=(0,p.useState)(null),[Ee,De]=(0,p.useState)(t);if(t!==Ee){De(t),D(``);let e=be(t,l);e!==g&&(_(e),y(``),x(`all`),w(`all`))}let[Oe,ke]=(0,p.useState)(n);n!==Oe&&(ke(n),D(``));let{data:O,error:Ae,reload:je}=u(()=>r.catalog(g),[g,i],`catalog`),k=l?null:me[g]||null,A=k!==null,{data:j}=u(()=>A?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[A,i],`usage`,{revalidate:!0}),M=A&&!!j?.enabled&&Array.isArray(j.names),Me=(0,p.useMemo)(()=>new Map((Array.isArray(j?.names)?j.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[j]),N=e=>M&&Me.get(`${k}\u0000${e}`)||null,P=e=>{let t=N(e.name);return!t||t.n===0&&!t.last},Ne=j?.since?`No call since ${j.since}`:`No call recorded yet`,F=O?.section===g&&O?.items||[],I=g===`skills`,Pe=I?Se(F):null,L=I?Pe.rows:g===`memory`?Ce(F):F,R=n||L[0]?.name||null,z=R?F.find(e=>e.name===R):null,Fe=z?.type||a[g].type,{data:Ie,error:B}=u(()=>R?r.item(Fe,R):Promise.resolve(null),[g,R,Fe,i]),V=B?null:Ie,Le=T||Ae||B,Re=R?{name:R,title:V?.title||R,desc:V?.desc||``}:null,H=z||Re,ze=e?.counts||{},U=I?L.filter(e=>b===`all`||e.cat===b):L,Be=M?U.filter(P).length:0,Ve=e=>e.status===`experimental`,W=U.filter(Ve).length,G=[[`all`,`All`,U.length],...M?[[`used`,`Used`,U.length-Be],[`unused`,`Not used yet`,Be,Ne]]:[],...W?[[`experimental`,`Experimental`,W,`Shipped, not yet confirmed by real use`]]:[]],K=G.some(([e])=>e===S)?S:`all`,q=K===`all`?U:K===`experimental`?U.filter(Ve):U.filter(e=>P(e)===(K===`unused`)),He=M?Math.max(0,...F.map(e=>N(e.name)?.n||0)):0,J=I?1/0:50,Y=v.trim().toLowerCase(),X=Y?oe(q,Y):q.slice(0,J),Ue=!Y&&b===`all`&&K===`all`&&R&&!X.some(e=>e.name===R)?[...X,...L.filter(e=>e.name===R)]:X,We=e=>d?`${d}/${xe(e.name)}`:`#/item/${e.type||a[g].type}/${xe(e.name)}`,Ge=async()=>{let e=H?.name;if(e&&await h(`Forget the memory fact "${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`})){D(``);try{await r.memoryDelete(e)}catch(t){D(`Could not forget "${e}": ${t.message}`);return}re(d||`#/section/memory`),je()}},Ke=async()=>{let e=H?.name;if(e&&await h(`Promote "${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`})){D(``);try{let t=await r.rules();await r.rulesPromote({name:e,fingerprint:t.fingerprint,delete_memory:!0}),te(),de?.(),re(`#/personal/rules`)}catch(e){D(`Could not promote: ${e.message}`),je()}}},Z=V?.body?_e(V.body,V.desc||H?.desc):null,qe=V?.title||H?.title||H?.name,Je=qe===H?.name&&Z?.title?Z.title:qe,Ye=O?.section===g&&F.length===0,Xe=V?.status||H?.status,Ze=g===`skills`?c[z?.klass]:null,Q=a[g].label,{lede:Qe,when:$e}=E(V?.desc||H?.desc||``),$=H?V?.source||H.source||(B?null:C(g,H.name)):null;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s,{error:Le,style:{margin:`0 0 var(--sp-3)`}}),(0,m.jsxs)(`div`,{className:`library lib-dossier${l?` locked`:``}${M?` uses`:``}`,children:[l?null:(0,m.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,m.jsxs)(`div`,{className:`lib-title`,children:[(0,m.jsx)(`h1`,{className:`h`,children:`Library`}),(0,m.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,m.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:o.map(e=>(0,m.jsxs)(p.Fragment,{children:[(0,m.jsxs)(`a`,{href:`#/section/${e}`,className:g===e?`on`:``,"aria-current":g===e?`page`:void 0,children:[a[e].label,(0,m.jsx)(`span`,{className:`mono dim`,children:ze[e]??``})]}),e===g&&I&&(0,m.jsx)(le,{label:`Skill types`,total:F.length,cats:Pe.cats,cat:b,onChange:x})]},e))})]}),(0,m.jsxs)(ie,{label:Q,count:Y?`${X.length} of ${q.length}`:q.length,q:v,onQ:y,matched:X.length,inView:[g,n],extra:M&&j.since?(0,m.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,j.since]}):null,tools:G.length>1?(0,m.jsx)(ne,{"aria-label":`Show`,children:G.map(([e,t,n,r])=>(0,m.jsxs)(`button`,{type:`button`,className:K===e?`on`:``,"aria-pressed":K===e,title:r,onClick:()=>w(e),children:[t,` `,(0,m.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[(0,m.jsx)(se,{rows:Ue,activeName:H?.name,hrefOf:We,pills:M?e=>{let t=N(e.name)?.n||0;return(0,m.jsxs)(`span`,{className:`lr-use`,children:[(0,m.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,m.jsx)(`i`,{style:{width:he(t,He)}})}),(0,m.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,m.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})}:void 0}),!Y&&F.length>J&&(0,m.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,J,` of `,F.length,`; type to search the rest.`]}),Ye&&(g===`wiki`?(0,m.jsxs)(f,{title:`No wiki entries`,action:(0,m.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,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,m.jsx)(f,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,m.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:H?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`reader-tags`,children:[(0,m.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),Ze?(0,m.jsx)(`span`,{className:`tag`,children:Ze.label}):null,V?.kit??H.kit?(0,m.jsx)(ae,{name:V?.kit??H.kit}):null,(0,m.jsx)(ce,{status:Xe,withHint:!0}),$?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`mono dim reader-src`,children:$}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText($),Te({src:$,ok:!0})}catch{Te({src:$,ok:!1})}},children:we?.src===$?we.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,m.jsxs)(`div`,{className:`reader-head`,children:[(0,m.jsx)(`h2`,{className:`reader-title`,children:Je}),g===`agents`?(0,m.jsx)(pe,{name:H.name}):null]}),(0,m.jsxs)(`div`,{className:`reader-intro${M?` with-stats`:``}`,children:[(0,m.jsxs)(`div`,{className:`reader-intro-text`,children:[Qe?(0,m.jsx)(`p`,{className:`reader-lede`,children:Qe}):null,$e?(0,m.jsxs)(`section`,{className:`reader-when`,children:[(0,m.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,m.jsx)(`p`,{children:$e})]}):null]}),M?(0,m.jsx)(ve,{u:N(H.name),usage:j,noCall:Ne}):null]}),g===`memory`&&H.name!==`MEMORY`&&H.name!==`README`&&(0,m.jsxs)(`div`,{className:`row gap-8`,children:[(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Ke,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Ge,children:`Forget this fact`})]}),(0,m.jsx)(`hr`,{className:`hr`}),B?(0,m.jsxs)(`p`,{className:`sub`,children:[`No `,Q.replace(/s$/,``).toLowerCase(),` named `,(0,m.jsx)(`em`,{children:H.name}),` could be read in this install.`]}):H?.kind===`manifest`||V?.manifest!==void 0?V?(0,m.jsx)(fe,{manifest:V.manifest,body:V.body,name:H.name}):(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):V?.body?(0,m.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,m.jsx)(ue,{body:Z.body,links:V.links||[]})}):V===null&&R?(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,m.jsx)(ge,{section:g,source:C(g,H.name)}),ye[g]?(0,m.jsx)(`div`,{className:`reader-links`,children:(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${ye[g]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):Ye?null:(0,m.jsx)(f,{title:`Select an entry`,children:`Pick something from the list to read it.`})})]})]})}export{_e as bodyHead,D as default,Ce as groupMemory,Se as splitSkills,E as splitWhen};