geneseed 4.30.1 → 4.32.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 +34 -0
  2. package/SHIPPED.md +1 -1
  3. package/adapters/opencode/plugins/geneseed-context.js +136 -1
  4. package/adapters/opencode/plugins/geneseed-guard.js +145 -2
  5. package/docs/concepts/exclusions.md +1 -1
  6. package/docs/concepts/footprint.md +1 -1
  7. package/docs/concepts/hook-gates.md +1 -1
  8. package/docs/concepts/hooks.md +6 -4
  9. package/docs/concepts/host-matrix.md +1 -1
  10. package/docs/concepts/loop-bricks.md +1 -1
  11. package/docs/concepts/loop-notes.md +4 -2
  12. package/docs/concepts/loop-templates.md +7 -4
  13. package/docs/concepts/loops.md +3 -0
  14. package/docs/concepts/ownership.md +1 -1
  15. package/docs/guides/run-a-loop.md +1 -1
  16. package/docs/guides/set-up-ownership.md +1 -1
  17. package/docs/reference/loop-actions.md +1 -1
  18. package/docs/reference/plugin-activity.md +1 -1
  19. package/docs/reference/plugin-context.md +4 -0
  20. package/docs/reference/plugin-guard.md +1 -1
  21. package/docs/understand/enforced-vs-asked.md +3 -2
  22. package/docs/understand/machine-bob.md +1 -1
  23. package/docs/web-ui.md +85 -26
  24. package/harness.config.json +1 -1
  25. package/js/README.md +3 -3
  26. package/js/hosts/hooks-context.mjs +22 -1
  27. package/js/hosts/hooks-done.mjs +97 -31
  28. package/js/hosts/hooks-prims.mjs +65 -0
  29. package/js/hosts/hooks.mjs +188 -27
  30. package/js/loop/state.mjs +15 -5
  31. package/js/web/actions.mjs +17 -27
  32. package/js/web/activity.mjs +139 -23
  33. package/js/web/api.mjs +31 -13
  34. package/js/web/catalog.mjs +108 -23
  35. package/js/web/handler.mjs +4 -3
  36. package/js/web/routes.mjs +47 -14
  37. package/js/web/server.mjs +14 -13
  38. package/js/web/state.mjs +36 -15
  39. package/js/web/usage-api.mjs +7 -3
  40. package/package.json +1 -1
  41. package/src/agents/_template.md +3 -0
  42. package/src/agents/developer.md +5 -2
  43. package/src/agents/tester.md +4 -1
  44. package/src/bricks/apply.md +3 -0
  45. package/src/bricks/test.md +6 -4
  46. package/src/loops/bugfix.json +11 -5
  47. package/src/loops/feature.json +7 -4
  48. package/src/skills/loop.md +1 -0
  49. package/src/skills/ship.md +9 -1
  50. package/web/dist/assets/Activity-Bjy64wHC.js +1 -0
  51. package/web/dist/assets/ActivityDetail-B0AaipP8.js +1 -0
  52. package/web/dist/assets/{Bonsai-CN4rRAHc.js → Bonsai-CJniRqaH.js} +1 -1
  53. package/web/dist/assets/{CopyButton-CYljsnLo.js → CopyButton-C5Li6awl.js} +1 -1
  54. package/web/dist/assets/Dashboard-B-6DTmae.js +2 -0
  55. package/web/dist/assets/{DataTable-BWbUx4bY.js → DataTable-b9zTShqJ.js} +1 -1
  56. package/web/dist/assets/{Docs-DE04qOKj.js → Docs-LRc30XL9.js} +2 -2
  57. package/web/dist/assets/{EmptyState-1sPNleqv.js → EmptyState-CY5Pm2xy.js} +1 -1
  58. package/web/dist/assets/FilterInput-qGKNSlxv.js +1 -0
  59. package/web/dist/assets/{GreenhouseView-DPwhFO_j.js → GreenhouseView-CcoYlaWo.js} +1 -1
  60. package/web/dist/assets/Installs-dp1epTcE.js +3 -0
  61. package/web/dist/assets/JournalView-nFP4poCf.js +1 -0
  62. package/web/dist/assets/{KitApply-BN2Az7dc.js → KitApply-DwyZUj57.js} +1 -1
  63. package/web/dist/assets/{Kits-C9qVd466.js → Kits-C0IEdZXe.js} +1 -1
  64. package/web/dist/assets/Laws-CkykmQWu.js +3 -0
  65. package/web/dist/assets/Library-Guh9HBZU.js +2 -0
  66. package/web/dist/assets/Loops-CzitjxGV.js +2 -0
  67. package/web/dist/assets/Markdown-C4S4tTA7.js +69 -0
  68. package/web/dist/assets/{OperatorHudView-CLN6Qn25.js → OperatorHudView-DLGNulIY.js} +1 -1
  69. package/web/dist/assets/Personal-BMtberL8.js +2 -0
  70. package/web/dist/assets/RailCats-D5weYPCS.js +1 -0
  71. package/web/dist/assets/Tabs-uYJqfuQt.js +1 -0
  72. package/web/dist/assets/api-BxjLd7Qd.js +1 -0
  73. package/web/dist/assets/index-DA7BiaE5.js +3 -0
  74. package/web/dist/assets/index-dbbDGFDq.css +1 -0
  75. package/web/dist/assets/{motion-CXaUMNkg.js → motion-Bccx3zE8.js} +1 -1
  76. package/web/dist/assets/react-C1iE8mnY.js +9 -0
  77. package/web/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  78. package/web/dist/assets/{usePoll-bDFN-Hr6.js → usePoll-o8ul-Sog.js} +1 -1
  79. package/web/dist/index.html +6 -6
  80. package/web/dist/assets/Activity-C8pQvnos.js +0 -1
  81. package/web/dist/assets/ActivityDetail-D_8Bx-QO.js +0 -1
  82. package/web/dist/assets/Dashboard-DkUm4XMu.js +0 -2
  83. package/web/dist/assets/FilterInput-CZREvrjX.js +0 -1
  84. package/web/dist/assets/Installs-DmPzD4BW.js +0 -3
  85. package/web/dist/assets/JournalView-DQlDC-7i.js +0 -1
  86. package/web/dist/assets/Laws-T2wbwMmB.js +0 -3
  87. package/web/dist/assets/Library-t3KocV0-.js +0 -2
  88. package/web/dist/assets/Loops-6lNY-9uR.js +0 -2
  89. package/web/dist/assets/Markdown-DpmmtW2Y.js +0 -65
  90. package/web/dist/assets/Personal-xjoSqCzr.js +0 -2
  91. package/web/dist/assets/RailCats-BuJD4Jou.js +0 -1
  92. package/web/dist/assets/Tabs-DaExAgql.js +0 -1
  93. package/web/dist/assets/api-LvBC0CnK.js +0 -1
  94. package/web/dist/assets/index-DhNNxhfg.js +0 -3
  95. package/web/dist/assets/index-XTGBLKQr.css +0 -1
  96. package/web/dist/assets/react-DlYQp10C.js +0 -9
  97. package/web/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,D as s,E as c,I as l,J as u,M as d,N as f,P as p,T as m,W as ee,Y as te,Z as ne,dt as h,j as g,k as re,ot as _,pt as v,u as y,w as b}from"./index-DhNNxhfg.js";import{t as x}from"./EmptyState-1sPNleqv.js";import{a as S,c as C,d as w,i as T,l as E,n as D,o as O,r as k,s as A,t as j,u as M}from"./Bonsai-CN4rRAHc.js";import{t as ie}from"./usePoll-bDFN-Hr6.js";var N=e(t(),1),P=n(),F=4,I=56*F,L=24,R=165,z=188,B=e=>{let t=O(e);return t==null?null:Math.round(t*100)};function V(e,t,n){let r=o[e.status]||o.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),c=B(e);return[`${e.title||s(e.cwd)||e.session_id}, ${e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${c==null?``:`, context ${c} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function H({s:e,t,mine:n}){let r=B(e);return(0,P.jsxs)(`div`,{className:`card gd-card`,children:[(0,P.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`model`}),(0,P.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,P.jsx)(`dt`,{children:`turns`}),(0,P.jsx)(`dd`,{children:e.turns||0}),(0,P.jsx)(`dt`,{children:`context`}),(0,P.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,P.jsx)(`dt`,{children:`compactions`}),(0,P.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,P.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,P.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function U({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let c=w(e,n),l=(0,N.useMemo)(()=>A(e,{sakura:n}),[c]),u=o[e.status]||o.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=e.session_id,m=(0,N.useCallback)(e=>a(p,e),[a,p]);return(0,P.jsxs)(`a`,{className:`gd-tree${g(e)?` gd-needs`:``}`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-label":V(e,l,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,G(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,G(e.currentTarget)),onBlur:()=>a(null,null),children:[(0,P.jsxs)(`div`,{className:`gd-label`,children:[(0,P.jsxs)(`div`,{className:`act-ell`,children:[(0,P.jsx)(`span`,{className:`mono dim`,children:e.host||`?`}),` ·`,` `,e.title||s(e.cwd)||e.session_id]}),(0,P.jsxs)(`div`,{className:`row gap-8 gd-sub`,children:[(0,P.jsx)(`span`,{className:`badge ${u.cls}`,children:u.label}),t&&(0,P.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,P.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,P.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`}),e.phase&&(0,P.jsx)(`span`,{className:`dim act-ell`,children:e.phase})]})]}),(0,P.jsx)(k,{t:l,pad:i,swaying:f,onPad:m,px:F})]})}function W({pairs:e,count:t}){if(!e.length)return null;let n=t*I+(t-1)*L,r=e=>e*(I+L)+I/2;return(0,P.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*F+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,P.jsxs)(`g`,{className:o,children:[(0,P.jsx)(`path`,{d:`M${e} ${R} C${n} 179 ${n} 159 ${t} 169`}),(0,P.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${R}`})]},`${i}-${a}`)}return(0,P.jsx)(`g`,{className:o,children:(0,P.jsx)(`path`,{d:`M${r(i)} ${z} Q${(r(i)+r(a))/2} 222 ${r(a)} ${z}`})},`${i}-${a}`)})})}var G=e=>e.offsetLeft-(e.parentElement?.scrollLeft||0);function ae({sessions:e,collisions:t}){let[n,r]=(0,N.useState)(T),[i,a]=(0,N.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(D,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=S(C(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>E(e,s);return(0,P.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,P.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,P.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · hover a tree, or one of its pads, for its details`]}),(0,P.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Sakura`})]}),l.length>0&&(0,P.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,P.jsx)(K,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function K({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,N.useState)({sid:null,pad:null,x:0}),o=(0,N.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=e.trees.find(e=>e.s.session_id===i.sid)?.s,c=s?A(s,{sakura:t}):null,l=c&&i.pad!=null?c.pads[i.pad]:null;return(0,P.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,children:[(0,P.jsxs)(`h3`,{className:`act-lbl gd-shelf-h`,children:[e.name,` `,(0,P.jsxs)(`span`,{className:`dim`,children:[`· `,e.trees.length]})]}),(0,P.jsxs)(`div`,{className:`gd-row`,children:[e.trees.map(({s:e,worktree:n})=>(0,P.jsx)(U,{s:e,worktree:n,sakura:t,mine:r(e.session_id),pad:e.session_id===i.sid?i.pad:null,onHover:o},e.session_id)),(0,P.jsx)(W,{pairs:M(e.trees,n),count:e.trees.length})]}),s&&(0,P.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:l?(0,P.jsx)(j,{pad:l}):(0,P.jsx)(H,{s,t:c,mine:r(s.session_id)})})]})}var q=e=>e.catch(()=>null);function J({s:e}){let t=(0,N.useId)(),n=e.todos,r=a(e);return(0,P.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,P.jsx)(b,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,P.jsx)(_,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,P.jsx)(`div`,{className:`act-foot`,children:(0,P.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,P.jsx)(c,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,P.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,h(e.updated_at),` ago`]})]})}var Y={blocked:`is blocked`,"waiting-input":`waits for your answer`};function oe(e,t){if(!Array.isArray(t))return``;let n=t.filter(g),r=e.current;return e.current=new Set(n.map(e=>`${e.session_id}:${e.status}`)),r?n.filter(e=>!r.has(`${e.session_id}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${Y[e.status]}`).join(`. `):``}var X=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function se(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:X.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function ce(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function le({enabled:e,onToggle:t}){return(0,P.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,P.jsx)(_,{name:`activity`,className:`glyph act-fixed`}),(0,P.jsxs)(`div`,{className:`act-grow`,children:[(0,P.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,P.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,P.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,P.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,P.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function ue({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=p(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${f(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${f(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,P.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,P.jsxs)(`div`,{className:`act-stat-head`,children:[(0,P.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,P.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,P.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,P.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,P.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,P.jsx)(`i`,{className:`zero`},e.key))}),(0,P.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,P.jsx)(`span`,{children:f(r[0].key)}),(0,P.jsx)(`span`,{children:f(r[7].key)}),(0,P.jsx)(`span`,{children:`today`})]}),c&&(0,P.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,P.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function de({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,P.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,P.jsxs)(`div`,{className:`act-stat-head`,children:[(0,P.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,P.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,P.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,P.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,P.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,P.jsx)(m,{vals:e.per_day,i:t,sweep:!0}),(0,P.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,P.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var Z={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function fe({job:e,longest:t}){let n=l(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=Z[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,P.jsxs)(`li`,{className:`act-row`,children:[(0,P.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,P.jsx)(_,{name:`play`,className:`glyph act-glyph`}),(0,P.jsxs)(`span`,{className:`act-what`,children:[(0,P.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,P.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,P.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,P.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,P.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function pe({gate:e}){return(0,P.jsxs)(`li`,{className:`act-row gate`,children:[(0,P.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,P.jsx)(_,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,P.jsxs)(`span`,{className:`act-what`,children:[(0,P.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,P.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,P.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var Q=5,$=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function me(){let[e,t]=(0,N.useState)(null),[n,a]=(0,N.useState)(``),[o,c]=(0,N.useState)(se),[l,d]=(0,N.useState)(!1),[f,m]=(0,N.useState)(``),h=(0,N.useRef)(null),_=e=>{let t={...o,...e};c(t),ce(t)};ie(e=>r.activity().then(n=>{if(e()){t(n),a(``);let e=oe(h,n?.activity);e&&m(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let b=v(()=>q(r.jobs()),[]),S=v(()=>q(r.gates()),[]),C=v(()=>q(r.catalog(`laws`)),[]),w=!e||e.enabled!==!1,T=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),E=i(),D=w&&e?T.filter(g).length:null,O=new Set(T.map(e=>e.session_id)),k=(e?.ended||[]).filter(e=>!O.has(e.session_id)),A=$([...T,...k].map(e=>e.host),o.host),j=$([...T,...k].map(e=>s(e.cwd)),o.project),M=o.host&&o.project?`host or project`:o.host?`host`:o.project?`project`:``,F=e=>(!o.host||e.host===o.host)&&(!o.project||s(e.cwd)===o.project),I=T.filter(e=>F(e)&&(o.f!==`needs`||g(e))),L=o.f===`all`||o.f===`needs`,R=o.f===`all`&&w?k.filter(F):[],z=l?R:R.slice(0,Q),B=!M&&(o.f===`all`||o.f===`runs`),V=!M&&(o.f===`all`||o.f===`gates`),H=b.data?.jobs||[],U=y(S.data,C.data),W=re(H,U,S.data?.days).map(e=>({...e,runs:B?e.runs:[],gate:V?e.gate:null})).filter(e=>e.runs.length||e.gate),G=Math.max(0,...H.map(e=>e.duration||0)),K=p(W.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),Y=async()=>{let e=!w;try{let n=await r.activityToggle(e);if(n.ok===!1){a(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),a(``)}catch(e){a(e.message)}},Z=(e,t,n)=>(0,P.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,P.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,P.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:o[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>_({[e]:t.target.value}),children:[(0,P.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]})]});return(0,P.jsxs)(`div`,{className:`page-fill`,children:[(0,P.jsx)(ee,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,P.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:f}),n&&(0,P.jsx)(`div`,{className:`act-gap`,children:(0,P.jsx)(u,{error:n})}),e&&(0,P.jsx)(le,{enabled:w,onToggle:Y}),(0,P.jsxs)(`div`,{className:`act-today`,children:[(0,P.jsx)(ue,{jobs:b.data,loading:b.loading}),(0,P.jsx)(de,{rows:U,gates:S.data,loading:S.loading}),(0,P.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,P.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,P.jsxs)(`span`,{className:`act-big act-wait`,children:[D??`—`,` `,(0,P.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,P.jsx)(`p`,{className:`dim act-sm`,children:w?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]})]}),(0,P.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,P.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:X.map(([e,t])=>(0,P.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>_({f:e}),children:[t,e===`needs`&&D>0?(0,P.jsxs)(`span`,{className:`mono`,children:[` `,D]}):null]},e))}),Z(`host`,`Host`,A),Z(`project`,`Project`,j),(0,P.jsx)(ne,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,P.jsx)(`button`,{type:`button`,className:o.v===e?`on`:``,"aria-pressed":o.v===e,onClick:()=>_({v:e}),children:t},e))})]}),M&&o.f!==`needs`&&(0,P.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,M,`; showing sessions only.`]}),L&&(e?!w&&o.f!==`needs`?null:I.length===0?o.f===`needs`?(0,P.jsx)(x,{title:`Nothing waits on you`}):(0,P.jsxs)(x,{title:`No active sessions`,children:[`Run `,(0,P.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):o.v===`garden`?(0,P.jsx)(ae,{sessions:I,collisions:e.collisions}):(0,P.jsx)(`div`,{className:`stack gap-12 act-live`,ref:E,children:I.map(e=>(0,P.jsx)(`div`,{"data-flip":e.session_id,children:(0,P.jsx)(J,{s:e})},e.session_id))}):(0,P.jsx)(te,{label:`Reading live sessions…`})),R.length>0&&(0,P.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,P.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),z.map(e=>(0,P.jsx)(`div`,{children:(0,P.jsx)(J,{s:e})},e.session_id)),R.length>Q&&(0,P.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":l,onClick:()=>d(e=>!e),children:l?`Show fewer`:`Show all ${R.length}`})]}),o.f!==`needs`&&(0,P.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:K,children:W.map(e=>(0,P.jsxs)(`section`,{className:`card act-day`,children:[(0,P.jsxs)(`h3`,{className:`act-day-h`,children:[(0,P.jsx)(`span`,{children:e.title}),(0,P.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,P.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,P.jsx)(fe,{job:e,longest:G},e.id)),e.gate&&(0,P.jsx)(pe,{gate:e.gate})]})]},e.key))})]})}export{me as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.js";import{D as i,J as a,O as o,W as s,Y as c,dt as l,j as u,ot as d,w as f}from"./index-DhNNxhfg.js";import{t as p}from"./EmptyState-1sPNleqv.js";import{d as m,i as h,o as g,r as _,s as v,t as y}from"./Bonsai-CN4rRAHc.js";import{t as b}from"./usePoll-bDFN-Hr6.js";var x=e(t(),1),S=n();function C(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function w({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${o(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,S.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,S.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,S.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,S.jsx)(`span`,{className:`feed-dot act-inline-dot ${C(e)||`acc`}`}),e.kind===`thinking`&&(0,S.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,S.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,S.jsx)(`b`,{children:i}),e.error&&(0,S.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,S.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,S.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${l(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function T({turns:e}){return!e||e.length===0?(0,S.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,S.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,S.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,S.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,S.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var E=5;function D({s:e}){let[t]=(0,x.useState)(h),[n,r]=(0,x.useState)(null),i=!!e.ended,a=i?{...e,status:u(e)?`busy`:e.status,error:null}:e,o=m(a,t),s=(0,x.useMemo)(()=>v(a,{sakura:t}),[o]),c=(0,x.useCallback)(e=>r(e),[]),l=g(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,p=[`${d} turn${d===1?``:`s`}`,`context ${l==null?`unknown`:`${Math.round(l*100)} %`}`,`${f} compaction${f===1?``:`s`}`,`sub-agents: ${s.pads.filter(e=>e.key!=null).length} ${i?`unfinished`:`running`}, ${s.fallen.length} finished`].join(` · `),b=n==null?null:s.pads[n];return(0,S.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!i&&u(e)?` gd-needs`:``}`,children:[(0,S.jsx)(_,{t:s,pad:n,swaying:!i&&e.status!==`idle`,onPad:c,px:E,label:`Bonsai of this session${i?`, ended`:``}: ${p}`}),(0,S.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[i&&(0,S.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,S.jsx)(`div`,{className:`dim act-sm`,children:p}),b?(0,S.jsx)(y,{pad:b}):(0,S.jsx)(`div`,{className:`dim act-xs`,children:`Hover a pad for the files it changed.`})]})]})}function O({sid:e}){let[t,n]=(0,x.useState)(null),[o,u]=(0,x.useState)(``),[m,h]=(0,x.useState)(!1),[g,_]=(0,x.useState)(!1),v=(0,x.useId)();b(t=>m?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),u(``),h(!1))},e=>{t()&&(e.status===404?h(!0):u(e.message))}),2e3,[e,m]);let y=(0,S.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,S.jsx)(d,{name:`arrow`}),` Activity`]});if(m)return(0,S.jsxs)(`div`,{className:`page-fill`,children:[y,(0,S.jsx)(p,{title:`Session ended`,action:(0,S.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,S.jsxs)(`div`,{className:`page-fill`,children:[y,o?(0,S.jsx)(a,{error:o}):(0,S.jsx)(c,{label:`Loading session…`})]});let C=t.session,E=C.files,O=C.todos,k=!!(E&&E.items&&E.items.length>0),A=!!(O&&O.items&&O.items.length>0),j=t.conversation||[],M=t.timeline||[],N=[...j.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...M.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,S.jsxs)(`div`,{className:`page-fill`,children:[y,(0,S.jsx)(s,{title:C.title||i(C.cwd)||C.session_id,sub:C.cwd?(0,S.jsx)(`span`,{className:`mono act-cwd`,title:C.cwd,children:C.cwd}):null}),o&&(0,S.jsx)(`div`,{className:`act-gap`,children:(0,S.jsx)(a,{error:o})}),(0,S.jsxs)(`div`,{className:`card pad-md`,children:[(0,S.jsx)(f,{s:C}),(0,S.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,l(C.updated_at),` ago`]})]}),(0,S.jsx)(D,{s:C}),(k||A)&&(0,S.jsxs)(`div`,{className:`grid gap-12 act-panels${k&&A?` two`:``}`,children:[k&&(0,S.jsxs)(`div`,{className:`card pad-md`,children:[(0,S.jsx)(`div`,{className:`card-head`,children:(0,S.jsxs)(`h2`,{children:[`Files touched `,(0,S.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,S.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,S.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,S.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,S.jsxs)(`span`,{className:`act-fixed`,children:[(0,S.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,S.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),A&&(0,S.jsxs)(`div`,{className:`card pad-md`,children:[(0,S.jsx)(`div`,{className:`card-head`,children:(0,S.jsxs)(`h2`,{children:[`Plan`,` `,(0,S.jsxs)(`span`,{className:`dim`,children:[`(`,O.done,`/`,O.total,`)`]})]})}),(0,S.jsx)(`div`,{className:`stack act-list`,children:O.items.map((e,t)=>(0,S.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,S.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,S.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,S.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,S.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,S.jsx)(`h2`,{children:`Timeline`}),M.length>0&&(0,S.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":g,"aria-controls":v,onClick:()=>_(e=>!e),children:g?`Show conversation`:`Show full stream (${N.length})`})]}),(0,S.jsx)(`div`,{id:v,children:g?(0,S.jsx)(`div`,{className:`stack gap-12`,children:N.map((e,t)=>(0,S.jsx)(w,{rec:e},t))}):(0,S.jsx)(T,{turns:j})})]})]})}export{D as SessionTree,O as default};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-DPwhFO_j.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-DhNNxhfg.js","assets/api-LvBC0CnK.js","assets/index-XTGBLKQr.css","assets/OperatorHudView-CLN6Qn25.js","assets/JournalView-DQlDC-7i.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-LvBC0CnK.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{B as l,I as u,J as d,L as f,U as p,Y as m,Z as h,bt as g,ct as _,dt as v,l as y,lt as b,ot as x,pt as S,q as C,t as w,ut as T}from"./index-DhNNxhfg.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),A={done:`ok`,failed:`bad`},ee={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=u(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];if(i&&i.key===r){i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started);continue}t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=v(e.newest),n=e.oldest?v(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=f(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${A[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:ee[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=S(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>g(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(o,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function R({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,k.jsxs)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(x,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=f(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[v(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(l,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=T(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=b(e.counts),o=n?.version_verdict||``,s=U(o),l=_(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=b(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=S(()=>q(()=>i.fleet()),[e]),r=S(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?y(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>w(()=>import(`./GreenhouseView-DPwhFO_j.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>w(()=>import(`./OperatorHudView-CLN6Qn25.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>w(()=>import(`./JournalView-DQlDC-7i.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:l}){let u=c,[f,g]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,v=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:y}=S(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(d,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(m,{});let b=e.daemon_stale?(0,k.jsx)(C,{}):null;return e.deployed?f===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:[b,(0,k.jsx)(Q,{overview:e,recent:y,lens:v,onDirection:g,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(h,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>g(e),"aria-pressed":f===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:v,dataRev:l}),f===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:v,onAction:s})}),f===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:v})}),f===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:v}),f===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:v})]},f)]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(p,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";e();var n=t();function r({value:e,onChange:t,label:r,placeholder:i,className:a}){return(0,n.jsx)(`input`,{className:a||`lib-filter`,type:`text`,value:e,onChange:e=>t(e.target.value),placeholder:i,"aria-label":r||i})}export{r as t};
@@ -1,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.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-DhNNxhfg.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-DaExAgql.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-BN2Az7dc.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 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.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-DhNNxhfg.js";import{n as z}from"./Dashboard-DkUm4XMu.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,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.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-DhNNxhfg.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 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.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-DhNNxhfg.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};
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.js";import{J as i,Y as a,pt as o,vt as s,yt as c}from"./index-DhNNxhfg.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./usePoll-bDFN-Hr6.js";import{a as d,n as f,o as p,r as m,t as h}from"./RailCats-BuJD4Jou.js";import{t as g}from"./CopyButton-CYljsnLo.js";import{t as _}from"./Markdown-DpmmtW2Y.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b={x:260,y:190},x=110,S=28,C=14,w=44,T=e=>e*Math.PI/180,E=e=>Math.round(e*10)/10,D=(e,t=x,n=b)=>({x:E(n.x+t*Math.cos(T(e))),y:E(n.y+t*Math.sin(T(e)))}),O=e=>e/x*(180/Math.PI)+3,k=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,A=E(D(205).x-6),j=e=>e.length*6.4,M=e=>({x:e.x-j(e.name)/2,y:e.y-7,w:j(e.name),h:14}),N=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,P=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>N(M(n),M(e))));function F(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function I(e,t=[]){let n=L(e,t,0);if(n.mode!==`ring`)return n;let r=Math.min(...n.entry.map(e=>e.y-30),...n.nodes.map(e=>e.y-e.r-12),...n.inner.map(e=>e.cy-e.r-12),...n.exit?[n.exit.y-24]:[]);return r<0?L(e,t,Math.ceil(-r)):n}function L(e,t,n){let r={x:b.x,y:b.y+n},i=(e,t=x)=>D(e,t,r),a=e=>t.find(t=>t.name===e),o=e=>a(e)?.effect??null,s=e=>F(a(e)),c=e.loops||[],l=c.find(e=>e.iteration);if(!l||l.nodes.length>8)return R(e,o,s);let u=Math.max(...e.nodes.map(e=>c.filter(t=>t.nodes.includes(e)).length)),d=c.filter(e=>e!==l);if(u>3||d.some(e=>!e.nodes.every(e=>l.nodes.includes(e))))return R(e,o,s);let f=l.nodes[0],p=new Set(e.edges.filter(e=>e.to===f).map(e=>e.from)),m=new Map;for(let e of[...d].sort((e,t)=>e.nodes.length-t.nodes.length))for(let t of e.nodes.slice(1))t!==f&&!p.has(t)&&!m.has(t)&&m.set(t,e);let h=l.nodes.filter(e=>!m.has(e));if(h.length<2||d.some(e=>m.has(e.nodes[0])))return R(e,o,s);let g=360/h.length,_=h.map((e,t)=>({name:e,a:-90+t*g,r:S})),v=_.findIndex(e=>o(e.name)===`mutate`);v>=0&&_.splice(v,0,{name:`validate`,a:_[v].a-g/2,r:C,gate:!0});let y=_.map(e=>({name:e.name,...i(e.a),r:e.r,effect:e.gate?null:o(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:s(e.name)})),T=_.map((e,t)=>{let n=_[(t+1)%_.length],r=(t+1===_.length?n.a+360:n.a)-O(n.r)-2,a=e.a+O(e.r);return{d:k(x,i(a),i(r),+(r-a>180)),kind:`ring`}}),A=[],M=new Map;for(let e of d)M.set(e.nodes[0],[...M.get(e.nodes[0])||[],e]);for(let[e,t]of M){let n=_.find(t=>t.name===e),r=i(n.a),a=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let c=i(n.a+(a?t?18:-18:0),x+(a?54:44)),l=Math.atan2(c.y-r.y,c.x-r.x)*(180/Math.PI),u=e.nodes.filter(t=>m.get(t)===e),d=e=>u.map((t,n)=>({name:t,...D(l+(n-(u.length-1)/2)*e,w,c)})),f=105;for(;f<150&&P(d(f),y);)f+=5;d(f).forEach(({name:e,...t})=>{y.push({name:e,...t,r:S,effect:o(e),gate:!1,inner:!0,human:s(e)})});let p=l+180;T.push({d:k(w,D(p+42,w,c),D(p+138,w,c)),kind:`inner`}),T.push({d:k(w,D(p+222,w,c),D(p+318,w,c)),kind:`inner`});let h=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,g={lx:c.x,ly:c.y+w+20,anchor:`middle`};if(a){let e=c.x>=b.x,t=Math.max(w,...u.map(e=>{let t=y.find(t=>t.name===e);return Math.abs(t.x-c.x)+S}));g={lx:E(c.x+(e?t+8:-t-8)),ly:E(c.y+4),anchor:e?`start`:`end`}}A.push({loop:e.name,cx:c.x,cy:c.y,r:w,label:h,...g})})}let N=i(205).y,I=e.nodes.filter(e=>!l.nodes.includes(e)),L=I.map((e,t)=>({name:e,x:40,y:E(N-44*(I.length-1-t)),human:s(e)})),z=e.edges.find(e=>e.to===`$close`)?.from,B=y.find(e=>e.name===z),V=B?{from:z,x:B.x+200,y:B.y-30,d:`M${B.x+S},${B.y-6} C${B.x+90},${B.y-40} ${B.x+170},${B.y-40} ${B.x+200},${B.y-30}`}:null,ee=Math.max(540,...y.map(e=>e.x+e.r+8),...V?[V.x+6+j(`close`)+8]:[],...A.map(e=>e.cx+e.r+8),...A.map(e=>e.anchor===`start`?e.lx+j(e.label)+8:e.lx+j(e.label)/2+8)),H=Math.max(300,...y.map(e=>e.y+e.r+12),...A.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(ee),height:Math.ceil(H),center:{x:r.x,y:r.y,r:x},nodes:y,arcs:T,inner:A,entry:L,exit:V}}function R(e,t,n){let r=e.loops||[],i=e=>36+16*r.filter(t=>t!==e&&t.nodes.every(t=>e.nodes.includes(t))).length,a=Math.max(S,...r.map(i))+30,o=new Map(e.nodes.map((e,t)=>[e,60+t*100])),s=e.nodes.map(e=>({name:e,x:o.get(e),y:a,r:S,effect:t(e),gate:!1,inner:!1,human:n(e)})),c=e.nodes.slice(1).map((t,n)=>({d:`M${o.get(e.nodes[n])+S},${a} L${o.get(t)-S-4},${a}`,kind:`flow`})),l=r.map(e=>{let t=i(e),n=Math.min(...e.nodes.map(e=>o.get(e))),r=Math.max(...e.nodes.map(e=>o.get(e))),s={x:n-t,y:a-t,w:r-n+2*t,h:2*t};return c.push({d:`M${r},${s.y+s.h} L${n+4},${s.y+s.h}`,kind:`flow`}),{loop:e.name,label:`${e.name} · max ${e.max}`,box:s}});return{mode:`flow`,width:60+e.nodes.length*100,height:2*a,center:null,nodes:s,arcs:c,inner:l,entry:[],exit:null}}var z=n();function B({x:e,y:t,label:n}){return(0,z.jsxs)(`g`,{className:`lr-human`,children:[(0,z.jsx)(`title`,{children:n}),(0,z.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,z.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,z.jsx)(`path`,{d:`M${e-4.6},${t+5.6} a4.6,4.6 0 0 1 9.2,0 Z`,className:`lr-human-fig`})]})}function V({graph:e,bricks:t,onSelect:n,highlight:r}){let i=I(e,t),a=(e.loops||[]).find(e=>e.iteration),o=e=>`${e.name} brick${e.human?`, ${e.human.toLowerCase()}`:``}`,s=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n?.(e))};return(0,z.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,role:`group`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,z.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,z.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,z.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,z.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.mode===`flow`&&i.inner.map(e=>(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,z.jsx)(`text`,{x:e.box.x+10,y:e.box.y-6,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.arcs.map((e,t)=>(0,z.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${A},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,z.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,z.jsx)(B,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,z.jsxs)(`g`,{className:`lr-gate`,children:[(0,z.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,z.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,z.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,z.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,z.jsxs)(`g`,{className:`lr-node${e.inner?` inner`:``}${e.effect===`mutate`?` mutate`:``}${e.name===r?` current`:``}`,"aria-current":e.name===r?`step`:void 0,...n?{role:`button`,tabIndex:0,"aria-label":o(e),onClick:s(e.name),onKeyDown:s(e.name)}:{role:`img`,"aria-label":`${o(e)}${e.name===r?`, current step`:``}`},children:[(0,z.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,z.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,z.jsx)(B,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,z.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,z.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,z.jsxs)(`g`,{children:[(0,z.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,z.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var ee=5e3,H=[`prudent`,`balanced`,`aggressive`],U={running:`acc`,awaiting:`warn`,unreadable:`bad`},W=e=>!!e.graph;function te(){let[e,t]=(0,y.useState)(null),[n,i]=(0,y.useState)(null),[a,o]=(0,y.useState)(null),[s,c]=(0,y.useState)(0);return u(e=>r.activeLoops().then(n=>e()&&(t(n),i(null)),t=>e()&&i(t.message)),ee,[s]),{loops:e?.loops??null,error:a||n,onPreset:(e,t)=>(o(null),r.setLoopPreset(e,t).then(()=>c(e=>e+1),e=>o(e.message)))}}var G=e=>({key:e,label:e,align:`right`,render:t=>(0,z.jsx)(`span`,{className:`num`,children:t[e]})}),ne=[G(`iteration`),{key:`intent`,label:`intent`},G(`declared`),G(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function re({history:e}){return e.length?(0,z.jsx)(`div`,{className:`loop-history`,children:(0,z.jsx)(v,{caption:`Iterations`,captionHidden:!0,columns:ne,rows:e,rowKey:e=>e.iteration})}):(0,z.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function ie({loop:e,bricks:t,onPreset:n}){let r=W(e)?(e.graph.loops||[]).find(e=>e.iteration):null,[i,a]=(0,y.useState)(!1);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`reader-tags`,children:[(0,z.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,z.jsx)(`span`,{className:`tag${U[e.status]?` ${U[e.status]}`:``}`,children:e.status})]}),(0,z.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,z.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),W(e)?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,z.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,z.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,z.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,z.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,disabled:i,onChange:t=>{a(!0),Promise.resolve(n(e.root,t.target.value)).finally(()=>a(!1))},children:H.map(e=>(0,z.jsx)(`option`,{children:e},e))})]}),(0,z.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,z.jsx)(`hr`,{className:`hr`}),(0,z.jsx)(`div`,{className:`loop-graph`,children:(0,z.jsx)(V,{graph:e.graph,bricks:t,highlight:e.node})}),(0,z.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,z.jsx)(re,{history:e.history})]}):(0,z.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its LOOP.md cannot be read, so there is no state to show.`:`Its LOOP.md is gone: the loop closed and its state went with it.`})]})}var K=encodeURIComponent,q=s.loops.map(e=>[e,c[e]]),J={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},ae={project:`Project`,global:`Global`,shipped:`Shipped`},oe={templates:`Categories`,bricks:`Origins`,active:`Statuses`},se=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function Y(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var X=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function Z(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return X(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>J[e.graph.category]?e.graph.category:`other`,[...Object.entries(J),[`other`,`Other`]])}function Q(e,t){return X(e.map(e=>({...e,desc:e.description,override:Y(t,e.name)})),e=>e.origin,Object.entries(ae))}function ce(e){return X(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,se)}var $=(e,t)=>(0,z.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),le={templates:e=>e.human?$(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?$(`warn`,`mutate`):null,F(e)?$(`human`,`human gate`):null,e.override?$(`acc`,e.override):null,e.available===!1?$(`bad`,`unavailable`):null],active:e=>$(U[e.status],e.status)};function ue({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,z.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,z.jsx)(`b`,{children:(0,z.jsx)(`a`,{href:`#/loops/bricks/${K(e)}`,children:e})}),$(t.effect===`mutate`?`warn`:``,t.effect),(0,z.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,z.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),F(t)?$(`human`,F(t).toLowerCase()):null,n?$(`acc`,n):null]}):(0,z.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,z.jsx)(`b`,{children:e}),(0,z.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function de(e){let t=e.loops||[],n=t.find(e=>e.iteration),r=n?.nodes[0],i=t=>{let n=new Map;for(let r of e.edges.filter(t))n.set(r.from,[...n.get(r.from)||[],r.on]);return[...n].map(([e,t])=>`${e} says ${t.join(` or `)}`).join(`, `)},a=t=>{let i=e.edges.filter(e=>e.to===t);return!!n&&t!==r&&i.length>0&&i.every(e=>e.from===r)&&e.edges.some(e=>e.from===t&&e.to===`$close`)},o=[...new Set(e.edges.filter(e=>e.to===`$close`).map(e=>e.from))].map(e=>a(e)?`${i(t=>t.to===e)} → ${e}; ${i(t=>t.from===e&&t.to===`$close`)} → close`:`${i(t=>t.from===e&&t.to===`$close`)} → close`),s=t.filter(e=>!e.iteration).map(e=>`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)}, max ${e.max}`),c=n?e.nodes.filter(e=>!n.nodes.includes(e)):[],l=i(e=>e.to===`$stop`);return[c.length&&[`Setup`,`${c.join(` → `)}, once.`],n?[`Iteration (max ${n.max})`,`${n.nodes.filter(e=>!a(e)).join(` → `)}.`]:[`Steps`,`${e.nodes.join(` → `)}.`],s.length&&[`Retry`,`${s.join(`; `)}.`],o.length&&[`Exit`,`${o.join(`; `)}.`],[`Stop`,`${l?`${l}, or `:``}any step says error → stop.`]].filter(Boolean)}function fe({t:e,bricks:t,overridden:n,runs:r}){let[i,a]=(0,y.useState)(null),o=new Map(t.map(e=>[e.name,e])),s=de(e.graph),c=I(e.graph,t),l=c.mode===`ring`,u=`geneseed loop init --graph ${e.name} --title "<title>" --requirement "<requirement>"`,d=r?.filter(t=>W(t)&&t.graph.name===e.name).length;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`reader-tags`,children:[(0,z.jsx)(`span`,{className:`tag acc`,children:`Template`}),J[e.graph.category]?$(``,J[e.graph.category]):null,e.human?$(`human`,`human gate`):null]}),(0,z.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,z.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,z.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,z.jsx)(`hr`,{className:`hr`}),(0,z.jsxs)(`figure`,{className:`loop-console`,children:[(0,z.jsx)(`div`,{className:l?`loop-graph`:`loop-graph flow`,style:l?void 0:{"--loop-w":`${c.width}px`},children:(0,z.jsx)(V,{graph:e.graph,bricks:t,onSelect:e=>{a(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:`smooth`,block:`nearest`})}})}),(0,z.jsxs)(`figcaption`,{className:`loop-how`,children:[(0,z.jsx)(`span`,{className:`loop-kicker`,children:`How it runs`}),(0,z.jsx)(`ol`,{children:s.map(([e,t])=>(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`b`,{children:[e,`:`]}),` `,t]},e))}),l?(0,z.jsxs)(`span`,{className:`loop-legend`,children:[(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`i`,{className:`ring`,"aria-hidden":`true`}),`iteration`]}),s.some(([e])=>e===`Retry`)?(0,z.jsxs)(`span`,{children:[(0,z.jsx)(`i`,{className:`inner`,"aria-hidden":`true`}),`retry`]}):null]}):null]})]}),(0,z.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`loop-start-h`,children:[(0,z.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,z.jsx)(`h3`,{id:`loop-start-h`,className:`loop-kicker`,children:`Start it in your project`}),(0,z.jsx)(g,{text:u,label:`Copy command`})]}),(0,z.jsx)(`pre`,{className:`mono`,children:u})]}),r?(0,z.jsxs)(`p`,{className:`panel-note loop-running`,children:[`Running now: `,d?`${d} of this template`:`none`,`.`,` `,d?(0,z.jsx)(`a`,{href:`#/loops/active`,children:`Open Active →`}):`A started loop appears under Active with its iteration and preset.`]}):null,e.graph.rules?.length?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,z.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,z.jsx)(`li`,{children:e},e))})]}):null,(0,z.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,z.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,z.jsx)(ue,{name:e,brick:o.get(e),override:Y(n,e),on:i===e},e))})]})}function pe(e){return`---\n${[[`name`,e.name],[`description`,e.description],[`effect`,e.effect],[e.agent?`agent`:`skill`,e.agent||e.skill],[`gate`,e.gate],[`gateOn`,e.gateOn?.join(`, `)],[`outcomes`,e.outcomes.join(`, `)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(`
2
- `)}\n---\n${e.body}`}function me({b:e}){let[t,n]=(0,y.useState)(!1),r=[[`effect`,$(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,z.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>$(``,e))],[`gate`,F(e)?$(`human`,F(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,z.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`reader-tags`,children:[(0,z.jsx)(`span`,{className:`tag acc`,children:`Brick`}),le.bricks(e)]}),(0,z.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,z.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,z.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,z.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,z.jsxs)(y.Fragment,{children:[(0,z.jsx)(`dt`,{children:e}),(0,z.jsx)(`dd`,{children:t})]},e))}),(0,z.jsx)(`hr`,{className:`hr`}),(0,z.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,z.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,z.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:pe(e)}):(0,z.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,z.jsx)(_,{body:e.body})})]})}function he({problems:e}){if(!e?.length)return null;let t=e.length;return(0,z.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,z.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,z.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,z.jsx)(`li`,{className:`mono`,children:e},e))})]})}var ge={templates:{title:`No templates`,body:(0,z.jsxs)(z.Fragment,{children:[`Add one under `,(0,z.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]})},bricks:{title:`No bricks`,body:(0,z.jsxs)(z.Fragment,{children:[`Add one under `,(0,z.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]})},active:{title:`No loops yet`,body:(0,z.jsxs)(z.Fragment,{children:[`Start one with `,(0,z.jsx)(`code`,{className:`mono`,children:`geneseed loop init`}),` in a worktree, or ask the agent to run a loop. It shows up here while it runs.`]})}},_e={templates:(0,z.jsxs)(z.Fragment,{children:[`A template wires bricks into a loop. `,(0,z.jsx)(`a`,{href:`#/docs/loops`,children:`How loops work →`}),` `,(0,z.jsx)(`a`,{href:`#/docs/loop-which-template`,children:`Which template? →`})]}),bricks:(0,z.jsxs)(z.Fragment,{children:[`A brick is one step: a skill or agent and its outcomes.`,` `,(0,z.jsx)(`a`,{href:`#/docs/loop-bricks`,children:`About bricks →`})]}),active:(0,z.jsxs)(z.Fragment,{children:[`Loops registered on this machine, read from their LOOP.md.`,` `,(0,z.jsx)(`a`,{href:`#/docs/loop-running`,children:`Running a loop →`})]})};function ve({tab:e=`templates`,item:t,dataRev:n}){let{data:s,error:c}=o(()=>r.loops(),[n],`loops`),u=te(),[g,_]=(0,y.useState)(``),[v,b]=(0,y.useState)(`all`),[x,S]=(0,y.useState)(e);e!==x&&(S(e),_(``),b(`all`));let C=s?.bricks||[],w=e===`active`?u.loops&&ce(u.loops):s&&(e===`bricks`?Q(s.bricks,s.overridden):Z(s.templates,s.bricks)),T=w||[],E=f(T),D=v===`all`?T:T.filter(e=>e.group===v),O=g.trim(),k=p(D,O),A=!!(t&&w&&!T.some(e=>e.name===t)),j=A?null:T.find(e=>e.name===t)||e===`active`&&T.find(W)||T[0]||null,M={templates:s?.templates.length,bricks:s?.bricks.length,active:u.loops?.length},N=q.find(([t])=>t===e)[1],P=e===`active`?u.error:c;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(i,{error:P,style:{margin:`0 0 var(--sp-3)`}}),(0,z.jsx)(he,{problems:s?.problems}),(0,z.jsxs)(`div`,{className:`library`,children:[(0,z.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,z.jsxs)(`div`,{className:`lib-title`,children:[(0,z.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,z.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,z.jsx)(`p`,{className:`panel-note lib-lede`,children:_e[e]}),(0,z.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:q.map(([t,n])=>(0,z.jsxs)(y.Fragment,{children:[(0,z.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,z.jsx)(`span`,{className:`mono dim`,children:M[t]??``})]}),e===t&&(0,z.jsx)(h,{label:oe[t],total:T.length,cats:E,cat:v,onChange:b})]},t))})]}),(0,z.jsx)(d,{label:N,count:O?`${k.length} of ${D.length}`:w?D.length:``,q:g,onQ:_,matched:k.length,inView:[e,t],children:w?T.length===0?(0,z.jsx)(l,{title:ge[e].title,children:ge[e].body}):(0,z.jsx)(m,{rows:k,activeName:j?.name,hrefOf:t=>`#/loops/${e}/${K(t.name)}`,pills:le[e]}):P?null:(0,z.jsx)(a,{})}),(0,z.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:A?(0,z.jsx)(l,{title:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/loops/${e}`,label:`All ${N.toLowerCase()} →`}}):j?e===`active`?(0,z.jsx)(ie,{loop:j,bricks:C,onPreset:u.onPreset}):e===`bricks`?(0,z.jsx)(me,{b:j}):(0,z.jsx)(fe,{t:j,bricks:C,overridden:s.overridden,runs:u.loops},j.name):e===`active`&&w?(0,z.jsx)(l,{title:`What is a loop?`,docs:{href:`#/docs/loops`,label:`How loops work →`},children:`A loop runs bricks in a ring until its gate passes.`}):null})]})]})}export{ce as activeRows,Q as brickRows,pe as brickSource,ve as default,de as howItRuns,Z as templateRows};