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.
- package/CHANGELOG.md +34 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +136 -1
- package/adapters/opencode/plugins/geneseed-guard.js +145 -2
- package/docs/concepts/exclusions.md +1 -1
- package/docs/concepts/footprint.md +1 -1
- package/docs/concepts/hook-gates.md +1 -1
- package/docs/concepts/hooks.md +6 -4
- package/docs/concepts/host-matrix.md +1 -1
- package/docs/concepts/loop-bricks.md +1 -1
- package/docs/concepts/loop-notes.md +4 -2
- package/docs/concepts/loop-templates.md +7 -4
- package/docs/concepts/loops.md +3 -0
- package/docs/concepts/ownership.md +1 -1
- package/docs/guides/run-a-loop.md +1 -1
- package/docs/guides/set-up-ownership.md +1 -1
- package/docs/reference/loop-actions.md +1 -1
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/reference/plugin-context.md +4 -0
- package/docs/reference/plugin-guard.md +1 -1
- package/docs/understand/enforced-vs-asked.md +3 -2
- package/docs/understand/machine-bob.md +1 -1
- package/docs/web-ui.md +85 -26
- package/harness.config.json +1 -1
- package/js/README.md +3 -3
- package/js/hosts/hooks-context.mjs +22 -1
- package/js/hosts/hooks-done.mjs +97 -31
- package/js/hosts/hooks-prims.mjs +65 -0
- package/js/hosts/hooks.mjs +188 -27
- package/js/loop/state.mjs +15 -5
- package/js/web/actions.mjs +17 -27
- package/js/web/activity.mjs +139 -23
- package/js/web/api.mjs +31 -13
- package/js/web/catalog.mjs +108 -23
- package/js/web/handler.mjs +4 -3
- package/js/web/routes.mjs +47 -14
- package/js/web/server.mjs +14 -13
- package/js/web/state.mjs +36 -15
- package/js/web/usage-api.mjs +7 -3
- package/package.json +1 -1
- package/src/agents/_template.md +3 -0
- package/src/agents/developer.md +5 -2
- package/src/agents/tester.md +4 -1
- package/src/bricks/apply.md +3 -0
- package/src/bricks/test.md +6 -4
- package/src/loops/bugfix.json +11 -5
- package/src/loops/feature.json +7 -4
- package/src/skills/loop.md +1 -0
- package/src/skills/ship.md +9 -1
- package/web/dist/assets/Activity-Bjy64wHC.js +1 -0
- package/web/dist/assets/ActivityDetail-B0AaipP8.js +1 -0
- package/web/dist/assets/{Bonsai-CN4rRAHc.js → Bonsai-CJniRqaH.js} +1 -1
- package/web/dist/assets/{CopyButton-CYljsnLo.js → CopyButton-C5Li6awl.js} +1 -1
- package/web/dist/assets/Dashboard-B-6DTmae.js +2 -0
- package/web/dist/assets/{DataTable-BWbUx4bY.js → DataTable-b9zTShqJ.js} +1 -1
- package/web/dist/assets/{Docs-DE04qOKj.js → Docs-LRc30XL9.js} +2 -2
- package/web/dist/assets/{EmptyState-1sPNleqv.js → EmptyState-CY5Pm2xy.js} +1 -1
- package/web/dist/assets/FilterInput-qGKNSlxv.js +1 -0
- package/web/dist/assets/{GreenhouseView-DPwhFO_j.js → GreenhouseView-CcoYlaWo.js} +1 -1
- package/web/dist/assets/Installs-dp1epTcE.js +3 -0
- package/web/dist/assets/JournalView-nFP4poCf.js +1 -0
- package/web/dist/assets/{KitApply-BN2Az7dc.js → KitApply-DwyZUj57.js} +1 -1
- package/web/dist/assets/{Kits-C9qVd466.js → Kits-C0IEdZXe.js} +1 -1
- package/web/dist/assets/Laws-CkykmQWu.js +3 -0
- package/web/dist/assets/Library-Guh9HBZU.js +2 -0
- package/web/dist/assets/Loops-CzitjxGV.js +2 -0
- package/web/dist/assets/Markdown-C4S4tTA7.js +69 -0
- package/web/dist/assets/{OperatorHudView-CLN6Qn25.js → OperatorHudView-DLGNulIY.js} +1 -1
- package/web/dist/assets/Personal-BMtberL8.js +2 -0
- package/web/dist/assets/RailCats-D5weYPCS.js +1 -0
- package/web/dist/assets/Tabs-uYJqfuQt.js +1 -0
- package/web/dist/assets/api-BxjLd7Qd.js +1 -0
- package/web/dist/assets/index-DA7BiaE5.js +3 -0
- package/web/dist/assets/index-dbbDGFDq.css +1 -0
- package/web/dist/assets/{motion-CXaUMNkg.js → motion-Bccx3zE8.js} +1 -1
- package/web/dist/assets/react-C1iE8mnY.js +9 -0
- package/web/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/web/dist/assets/{usePoll-bDFN-Hr6.js → usePoll-o8ul-Sog.js} +1 -1
- package/web/dist/index.html +6 -6
- package/web/dist/assets/Activity-C8pQvnos.js +0 -1
- package/web/dist/assets/ActivityDetail-D_8Bx-QO.js +0 -1
- package/web/dist/assets/Dashboard-DkUm4XMu.js +0 -2
- package/web/dist/assets/FilterInput-CZREvrjX.js +0 -1
- package/web/dist/assets/Installs-DmPzD4BW.js +0 -3
- package/web/dist/assets/JournalView-DQlDC-7i.js +0 -1
- package/web/dist/assets/Laws-T2wbwMmB.js +0 -3
- package/web/dist/assets/Library-t3KocV0-.js +0 -2
- package/web/dist/assets/Loops-6lNY-9uR.js +0 -2
- package/web/dist/assets/Markdown-DpmmtW2Y.js +0 -65
- package/web/dist/assets/Personal-xjoSqCzr.js +0 -2
- package/web/dist/assets/RailCats-BuJD4Jou.js +0 -1
- package/web/dist/assets/Tabs-DaExAgql.js +0 -1
- package/web/dist/assets/api-LvBC0CnK.js +0 -1
- package/web/dist/assets/index-DhNNxhfg.js +0 -3
- package/web/dist/assets/index-XTGBLKQr.css +0 -1
- package/web/dist/assets/react-DlYQp10C.js +0 -9
- package/web/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-CcoYlaWo.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/motion-Bccx3zE8.js","assets/sections-ChwaobfW.js","assets/index-DA7BiaE5.js","assets/api-BxjLd7Qd.js","assets/index-dbbDGFDq.css","assets/OperatorHudView-DLGNulIY.js","assets/JournalView-nFP4poCf.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n,t as r}from"./react-C1iE8mnY.js";import{t as i}from"./api-BxjLd7Qd.js";import{i as a,t as o}from"./motion-Bccx3zE8.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{B as l,Dt as u,I as d,J as f,L as p,Q as m,U as h,Y as g,at as _,bt as v,ct as y,l as b,ot as x,q as S,rt as C,st as w,t as T}from"./index-DA7BiaE5.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(),ee={done:`ok`,failed:`bad`},A={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=d(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];i&&i.key===r?(i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started)):t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=y(e.newest),n=e.oldest?y(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,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 ${ee[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:A[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}=v(()=>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:()=>u(`#/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)(C,{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=p(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:[y(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=w(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=x(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=x(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=v(()=>q(()=>i.fleet()),[e]),r=v(()=>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?b(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)(()=>T(()=>import(`./GreenhouseView-CcoYlaWo.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>T(()=>import(`./OperatorHudView-DLGNulIY.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>T(()=>import(`./JournalView-nFP4poCf.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,[d,p]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:b}=v(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(f,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(g,{});let x=e.daemon_stale?(0,k.jsx)(S,{}):null;return e.deployed?d===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:[x,(0,k.jsx)(Q,{overview:e,recent:b,lens:y,onDirection:p,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(m,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:d===e?`on`:``,onClick:()=>p(e),"aria-pressed":d===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[d===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:l}),d===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),d===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),d===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),d===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},d)]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(h,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";e();var n=t();function r({caption:e,captionHidden:t,columns:r,rows:i,rowKey:a,rowAction:o}){let s=e=>e.align?{textAlign:e.align}:void 0;return(0,n.jsx)(`div`,{className:`tbl-scroll`,children:(0,n.jsxs)(`table`,{className:`tbl`,children:[(0,n.jsx)(`caption`,{className:t?`sr-only`:`tbl-caption`,children:e}),(0,n.jsx)(`thead`,{children:(0,n.jsxs)(`tr`,{children:[r.map(e=>(0,n.jsx)(`th`,{scope:`col`,style:s(e),children:e.label},e.key)),o?(0,n.jsx)(`th`,{scope:`col`,children:(0,n.jsx)(`span`,{className:`sr-only`,children:`Actions`})}):null]})}),(0,n.jsx)(`tbody`,{children:i.map(e=>(0,n.jsxs)(`tr`,{children:[r.map(t=>(0,n.jsx)(`td`,{style:s(t),children:t.render?t.render(e):e[t.key]},t.key)),o?(0,n.jsx)(`td`,{className:`tbl-act`,children:o(e)}):null]},a(e)))})]})})}export{r as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-C1iE8mnY.js";import{t as i}from"./api-BxjLd7Qd.js";import{n as a}from"./motion-Bccx3zE8.js";import{Dt as o,J as s,Q as c,W as l,Y as u,a as d,bt as f,c as ee,et as p,i as te,n as m,nt as h,o as g,r as _,rt as v,s as ne,tt as re}from"./index-DA7BiaE5.js";import{t as y}from"./EmptyState-CY5Pm2xy.js";import{a as b,n as x,o as S,r as ie,t as ae}from"./RailCats-D5weYPCS.js";import{t as C}from"./CopyButton-C5Li6awl.js";import{i as w,n as T,r as E}from"./Markdown-C4S4tTA7.js";var D=e(t(),1),O=n();function k(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function A(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
2
|
`))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
|
|
3
3
|
`),n.join(`
|
|
4
4
|
`)]}function j(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||k(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function M(e){let t={ids:new Set,idx:0,toc:[]},n=n=>j(T(n,e?.links),t);if(e?.rows){let[r,i]=A(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var N=r(),P={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},F=`you already know this`,I=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function L(e){return e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}e.replaceWith(t),t.append(n,e)}),[...e.querySelectorAll(`figure.docs-code > figcaption`)]}var R=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),z=40,B=e=>{let t=e.split(`
|
|
5
|
-
`)[0].trim();return t?`Copy `+(t.length>z?t.slice(0,39)+`…`:t):`Copy code`};function V({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,D.useRef)(null),[o,s]=(0,D.useState)([]),l=(0,D.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),s(L(e)))},[l]),(0,D.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),f(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[l]),(0,D.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=P[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>k(e.textContent||``)===k(i))),o?.classList.add(`docs-here`)},[l,e.id,t?.emit]);let u=[];return e.id===`install`&&(u.push({label:`Run doctor`,action:`doctor`}),u.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&u.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&u.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:u.length>0&&u.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:l}}),o.map((e,t)=>{let n=R(e);return(0,O.createPortal)((0,N.jsx)(C,{text:n,label:B(n)}),e,t)}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var H=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function U({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function W({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:H(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(C,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(U,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(U,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function G({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(W,{cmd:e,prog:t},e.name))})]})}function K({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var q={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},J=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function oe({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,D.useState)(0),{before:s,after:l}=(0,D.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(V,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(J,{text:e.piece})}),(0,N.jsx)(Y,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(J,{text:e.cost})})]})},t))}),u&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(J,{text:u.piece})}),(0,N.jsx)(Y,{kind:u.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.off})})]})]})]}),l.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function se(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ce(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,D.useSyncExternalStore)(ce,e,()=>null),le=5,ue=96,de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Z(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${de(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===le)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,D.useMemo)(()=>Z(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=ue&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(s,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(l,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(V,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,N.jsx)(oe,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,N.jsx)(G,{page:e});case`glossary`:return(0,N.jsx)(K,{page:e});case`about`:return(0,N.jsx)(me,{page:e,overview:n});default:return(0,N.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=se(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=X(ge);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=re(p(t?.emit)),{data:c,error:f}=g(()=>i.docs(r),[r]),h=e||Q(c),{data:y,error:C,loading:w}=g(()=>h?i.docsPage(h,r):Promise.resolve(null),[h,r]),{data:T}=g(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,D.useEffect)(()=>{if(c&&h&&!c.groups.some(e=>e.pages.some(e=>e.id===h))){let e=Q(c);e&&e!==h&&window.location.replace(d(e))}},[c,h]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[h]);let E=v(c,h),O=E.part||c?.groups?.[0]||null,k=O?.id===_;(0,D.useEffect)(()=>{k&&y?.id===h&&ne(h)},[k,y,h]);let A=k?[...ee(),h]:[],[j,M]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(O?.id);O?.id!==I&&(L(O?.id),M(``),F(`all`));let R=$(O),z=x(R),B=P===`all`?R:R.filter(e=>e.group===P),V=S(B,j);return f?(0,N.jsx)(s,{error:f}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(u,{"aria-label":`Harness`,children:o.map(e=>(0,N.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(c?.groups||[]).map(e=>(0,N.jsxs)(D.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:O?.id===e.id?`on`:``,"aria-current":O?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),O?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:R.length,cats:z,cat:P,onChange:F})]},e.id))})]}),(0,N.jsx)(b,{label:O?.label||`Docs`,count:j.trim()?`${V.length} of ${B.length}`:B.length||``,extra:k&&(0,N.jsx)(m,{pages:O.pages,seen:A}),q:j,onQ:M,matched:V.length,inView:[O?.id,h],children:c?(0,N.jsx)(ie,{rows:V,activeName:h,hrefOf:e=>d(e.name),pills:k?e=>A.includes(e.name)&&e.name!==h?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(l,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":E.page?.title||`Page`,children:[(0,N.jsx)(_e,{}),E.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:d(E.part.pages[0].id),children:E.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:d(E.part.pages.find(e=>(e.section||`General`)===E.section).id),children:E.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:E.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(he,{data:w?null:y,error:C,overview:t,onAction:n,place:E},`${h}|${r}`),!w&&(0,N.jsx)(te,{menu:c,pageId:h})]}),!w&&(0,N.jsx)(pe,{page:y,glossaryRows:T?.rows})]})]})]})})}export{ve as default,$ as docRows};
|
|
5
|
+
`)[0].trim();return t?`Copy `+(t.length>z?t.slice(0,39)+`…`:t):`Copy code`};function V({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,D.useRef)(null),[s,c]=(0,D.useState)([]),u=(0,D.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),c(L(e)))},[u]),(0,D.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),o(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[u]),(0,D.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=P[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>k(e.textContent||``)===k(i))),o?.classList.add(`docs-here`)},[u,e.id,t?.emit]);let d=[];return e.id===`install`&&(d.push({label:`Run doctor`,action:`doctor`}),d.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&d.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&d.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:d.length>0&&d.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:u}}),s.map((e,t)=>{let n=R(e);return(0,O.createPortal)((0,N.jsx)(C,{text:n,label:B(n)}),e,t)}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var H=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function U({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function W({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:H(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(C,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(U,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(U,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function G({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(W,{cmd:e,prog:t},e.name))})]})}function K({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var q={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},J=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function oe({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,D.useState)(0),{before:s,after:c}=(0,D.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(V,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(J,{text:e.piece})}),(0,N.jsx)(Y,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(J,{text:e.cost})})]})},t))}),u&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(J,{text:u.piece})}),(0,N.jsx)(Y,{kind:u.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.off})})]})]})]}),c.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}})]})}function se(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ce(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,D.useSyncExternalStore)(ce,e,()=>null),le=5,ue=96,de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Z(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${de(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===le)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,D.useMemo)(()=>Z(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=ue&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(s,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(u,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(V,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,N.jsx)(oe,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,N.jsx)(G,{page:e});case`glossary`:return(0,N.jsx)(K,{page:e});case`about`:return(0,N.jsx)(me,{page:e,overview:n});default:return(0,N.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=se(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=X(ge);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=h(re(t?.emit)),{data:o,error:l}=f(()=>i.docs(r),[r]),v=e||Q(o),{data:y,error:C,loading:w}=f(()=>v?i.docsPage(v,r):Promise.resolve(null),[v,r]),{data:T}=f(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,D.useEffect)(()=>{if(o&&v&&!o.groups.some(e=>e.pages.some(e=>e.id===v))){let e=Q(o);e&&e!==v&&window.location.replace(d(e))}},[o,v]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[v]);let E=ne(o,v),O=E.part||o?.groups?.[0]||null,k=O?.id===_;(0,D.useEffect)(()=>{k&&y?.id===v&&g(v)},[k,y,v]);let A=k?[...ee(),v]:[],[j,M]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(O?.id);O?.id!==I&&(L(O?.id),M(``),F(`all`));let R=$(O),z=x(R),B=P===`all`?R:R.filter(e=>e.group===P),V=S(B,j);return l?(0,N.jsx)(s,{error:l}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(c,{"aria-label":`Harness`,children:p.map(e=>(0,N.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(o?.groups||[]).map(e=>(0,N.jsxs)(D.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:O?.id===e.id?`on`:``,"aria-current":O?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),O?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:R.length,cats:z,cat:P,onChange:F})]},e.id))})]}),(0,N.jsx)(b,{label:O?.label||`Docs`,count:j.trim()?`${V.length} of ${B.length}`:B.length||``,extra:k&&(0,N.jsx)(te,{pages:O.pages,seen:A}),q:j,onQ:M,matched:V.length,inView:[O?.id,v],children:o?(0,N.jsx)(ie,{rows:V,activeName:v,hrefOf:e=>d(e.name),pills:k?e=>A.includes(e.name)&&e.name!==v?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(u,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":E.page?.title||`Page`,children:[(0,N.jsx)(_e,{}),E.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:d(E.part.pages[0].id),children:E.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:d(E.part.pages.find(e=>(e.section||`General`)===E.section).id),children:E.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:E.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(he,{data:w?null:y,error:C,overview:t,onAction:n,place:E},`${v}|${r}`),!w&&(0,N.jsx)(m,{menu:o,pageId:v})]}),!w&&(0,N.jsx)(pe,{page:y,glossaryRows:T?.rows})]})]})]})})}export{ve as default,$ as docRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";e();var n=t();function r({title:e,children:t,action:r,docs:i}){return(0,n.jsxs)(`div`,{className:`empty`,children:[e?(0,n.jsx)(`div`,{className:`big`,children:e}):null,t?(0,n.jsx)(`div`,{children:t}):null,r||i?(0,n.jsxs)(`div`,{className:`empty-actions`,children:[r,i?(0,n.jsx)(`a`,{href:i.href,children:i.label}):null]}):null]})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.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 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{t as n}from"./motion-Bccx3zE8.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{B as a,F as o,L as s,at as c,rt as l}from"./index-DA7BiaE5.js";import{i as u,n as d,r as f}from"./Dashboard-B-6DTmae.js";e();var p=t(),m=12,h=Array.from({length:7},(e,t)=>`var(--cat-${t})`),g=650;function _({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let o=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(a,{segments:e,size:t,stroke:r,label:i,sweepMs:g}),(0,p.jsxs)(`div`,{className:`ring-center`,children:[(0,p.jsx)(`div`,{className:`donut-c-num`,children:(0,p.jsx)(n,{value:o,duration:g})}),(0,p.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function v(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function y({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=v(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,p.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,p.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,p.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,p.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function b({label:e,value:t,sub:n,color:r,icon:i}){return(0,p.jsxs)(`div`,{className:`b-tile`,children:[(0,p.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,p.jsx)(l,{name:i})}),(0,p.jsxs)(`div`,{className:`b-tile-body`,children:[(0,p.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,p.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,p.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function x({overview:e,sigil:t,jobs:a,lens:g,onAction:v}){let x=e.counts||{},S=g?.doctor?.state||`loading`,C=g?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=u(e,g?.tone),O=s(a,m),k=c(e.diff),A=i.filter(e=>(x[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:x[e]||0,tone:`cat`+t%h.length,color:h[t%h.length]})),j=A.reduce((e,t)=>e+t.n,0),M=o(a||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`b-greet`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,p.jsx)(`h2`,{className:`h b-h`,children:D}),(0,p.jsx)(d,{verdict:g?.verdict}),(0,p.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,p.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,p.jsxs)(`div`,{className:`card b-hero`,children:[(0,p.jsx)(`div`,{className:`b-hero-ring`,children:(0,p.jsx)(_,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,p.jsxs)(`div`,{className:`b-hero-side`,children:[(0,p.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,p.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>v(`doctor`),children:[(0,p.jsx)(l,{name:`doctor`}),`Run doctor`]}),(0,p.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,p.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,p.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,p.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,p.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,p.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,p.jsxs)(`div`,{className:`b-chips`,children:[(0,p.jsxs)(`span`,{className:`b-chip`,children:[(0,p.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,p.jsx)(`span`,{className:`b-chip`,children:(0,p.jsx)(`b`,{children:e.emit})}),(0,p.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,p.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,p.jsxs)(`div`,{className:`b-tiles`,children:[(0,p.jsx)(b,{label:`Agents`,value:x.agents??`—`,sub:`specialists`,color:h[0],icon:`layers`}),(0,p.jsx)(b,{label:`Skills`,value:x.skills??`—`,sub:`workflows`,color:h[1],icon:`skill`}),(0,p.jsx)(b,{label:`Dictates`,value:x.laws??`—`,sub:x.doctrines?`${x.doctrines.active}/${x.doctrines.total} packs · ${x.doctrines.rules} rules`:`all upheld`,color:h[2],icon:`law`}),(0,p.jsx)(b,{label:`Edits`,value:k,sub:`to graft`,color:h[3],icon:`changes`})]})]}),(0,p.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,p.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Capability mix`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,p.jsxs)(`div`,{className:`b-mix`,children:[(0,p.jsx)(_,{segments:A,size:186,stroke:26}),(0,p.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,p.jsxs)(`div`,{className:`b-leg-row`,children:[(0,p.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,p.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,p.jsx)(`span`,{className:`b-leg-bar`,children:(0,p.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,p.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent runs`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`badge ok`,children:[(0,p.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,p.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,p.jsx)(`span`,{className:`b-stat-big`,children:(0,p.jsx)(n,{value:N})}),(0,p.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,p.jsx)(y,{data:M,accent:h[0],height:156})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent activity`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,p.jsx)(f,{jobs:a,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BxjLd7Qd.js";import{n as i}from"./motion-Bccx3zE8.js";import{$ as a,Ct as o,Et as s,J as c,Q as l,St as u,W as d,X as f,Y as p,Z as m,_t as h,at as g,bt as _,ct as v,dt as y,ft as b,gt as x,ht as S,it as C,mt as w,pt as T,rt as E,ut as D,vt as O,wt as k,xt as A,yt as j,z as M}from"./index-DA7BiaE5.js";import{t as N}from"./EmptyState-CY5Pm2xy.js";import{t as P}from"./Tabs-uYJqfuQt.js";import{c as F,i as I,l as L,n as R,o as z,s as ee,t as te}from"./KitApply-DwyZUj57.js";var B=e(t(),1),V=n();function ne({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,B.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.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();e?(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()):f(`Choose or type a folder to deploy into.`)};return(0,V.jsxs)(`div`,{className:`deploy-pop`,children:[(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.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,V.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,V.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsxs)(`label`,{className:`dp-field`,children:[(0,V.jsx)(`span`,{children:`Deploy as`}),(0,V.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:w.map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,V.jsx)(F,{value:s,options:n,onChange:p,who:`the new harness`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,V.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,V.jsx)(`code`,{children:S(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function re(){let{data:e,error:t,reload:n}=_(()=>r.excludes(),[]),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.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,V.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,V.jsx)(`div`,{className:`card-head`,children:(0,V.jsx)(`h3`,{children:`Excluded folders`})}),(0,V.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,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsx)(`code`,{children:e.path}),(0,V.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>S(e).label).join(`, `)}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,V.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,V.jsx)(E,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,V.jsx)(`p`,{className:`sub`,children:e},t))]})}function ie({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,V.jsxs)(`div`,{className:`ip-block`,children:[(0,V.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,V.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,V.jsxs)(`div`,{className:`mcp-target`,children:[(0,V.jsxs)(`div`,{className:`mt-head`,children:[(0,V.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,V.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,V.jsxs)(`div`,{className:`mcp-row`,children:[(0,V.jsx)(`span`,{className:`mono`,children:e.name}),(0,V.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,V.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,V.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,V.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ae({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]=H[e.state]||H.absent,_=e.state===`active`,v=e.state===`absent`;return(0,V.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,V.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,V.jsxs)(`div`,{className:`ip-head`,children:[(0,V.jsx)(`h2`,{children:x(e)}),(0,V.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,V.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${S(e.host).label}`}),(0,V.jsx)(`code`,{className:`ip-path`,children:e.path}),v?(0,V.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,V.jsx)(`strong`,{children:S(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(_||v)&&o?(0,V.jsx)(`div`,{className:`ip-picks`,children:(0,V.jsx)(F,{value:n,options:i,onChange:a,who:m})}):null,_&&t.length?(0,V.jsx)(ie,{targets:t,onReveal:p}):null,_&&e.scope===`global`?(0,V.jsx)(re,{}):null,v?null:(0,V.jsxs)(`label`,{className:`ip-switch`,children:[(0,V.jsx)(L,{on:_,disabled:s,label:`activate ${m}`,onToggle:d}),(0,V.jsx)(`span`,{children:_?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,V.jsx)(`div`,{className:`ip-spacer`}),o?(0,V.jsxs)(`div`,{className:`ip-actions`,children:[v?(0,V.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):_?(0,V.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,v?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`field`,children:[(0,V.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,V.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,V.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,V.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,V.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var oe=(e,t)=>`${e} ${t}`,se=[`claude`,`bob`,`openclaude`],U={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},W=/[\\/]\.claude[\\/]worktrees[\\/]/,G=e=>e.scope===`project`&&W.test(e.path);function ce(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?g(e.drift):0;return i?`${r} · ${i} edited`:r}function le({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,V.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,V.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?g(t.drift):0;return(0,V.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,V.jsx)(M,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,V.jsx)(`span`,{className:`dim`,children:ce(t,n)}),t.diffable?null:(0,V.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ue({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,V.jsx)(`div`,{className:`tbl-scroll`,children:(0,V.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,V.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,V.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,V.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,V.jsx)(`th`,{scope:`col`,children:`State`}),(0,V.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,V.jsx)(`th`,{scope:`col`,children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,V.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=U[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,V.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,V.jsx)(`td`,{children:S(e.host).label}):(0,V.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,V.jsx)(`td`,{children:u?``:e.theme||``}),(0,V.jsx)(`td`,{children:u?``:e.footprint||``}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`tag ${c}`,children:i}),G(e)?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.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,V.jsx)(`td`,{children:(0,V.jsx)(le,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,V.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function de({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,V.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,V.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,V.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,V.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function fe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,V.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,V.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,V.jsxs)(`dl`,{className:`kv-grid`,children:[(0,V.jsx)(`dt`,{children:`Source`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.root}),(0,V.jsx)(`dt`,{children:`Version`}),(0,V.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,V.jsx)(`dt`,{children:`Fingerprint`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function K({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:l}){let u=a(),{data:d,error:f,reload:m}=_(()=>r.installs(),[s]),{data:h,error:g,reload:v}=_(()=>r.mcp(),[s]),{data:b,error:C}=_(()=>r.fleet(),[s]),w=C?null:b??void 0,[T,O]=(0,B.useState)(null),[k,A]=(0,B.useState)(``),[M,P]=(0,B.useState)({}),[F,I]=(0,B.useState)(!1),[L,R]=(0,B.useState)({id:``,value:`keep`}),z=e=>L.id===e?.id?L.value:`keep`,[te,re]=(0,B.useState)(()=>y(`hosts`)),ie=(0,B.useMemo)(()=>{let e={};for(let t of h?.targets||[]){let n=oe(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[h]);if(f||g)return(0,V.jsx)(c,{error:f||g,onRetry:()=>{m(),v()}});if(!d||!h)return(0,V.jsx)(p,{});let H={active:0,disabled:1,absent:2},U=[...d.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(H[e.state]??3)-(H[t.state]??3)),W=U.find(e=>e.id===te)||U.find(e=>e.default)||U.find(e=>e.state===`active`)||U[0],G=e=>{let t=M[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`}},ce=(e,t,n)=>P(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),le=e=>{let t=G(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`)},K={theme:t.map(e=>e.name),footprint:ee,posture:d.postures||[],mode:d.modes||[],trust:d.trusts||[]},pe=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=G(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 u(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})},me=async e=>{if(e.state!==`active`||await u(`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}l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},q=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&se.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},he=async e=>{let t=z(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${q(e,`memory`)} and ${q(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await u(`Uninstall ${S(e.host).label} · ${e.scope}? It deletes ${j(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}R({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`}),l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},ge=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`})}},J=async()=>{let t=U.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await u(`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`)},_e=U.find(e=>e.default)?.host||U.find(e=>e.state===`active`)?.host||U[0]?.host||`opencode`,ve=U.filter(e=>e.scope===`global`),Y=U.filter(e=>e.scope!==`global`),X=e=>{re(e)},Z=e=>{D(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,V.jsxs)(`div`,{className:`hosts`,children:[(0,V.jsxs)(`div`,{className:`hosts-main`,children:[(0,V.jsxs)(`div`,{className:`toolbar`,children:[(0,V.jsxs)(`span`,{className:`dim`,children:[U.filter(e=>e.state===`active`).length,` active of `,U.length,` `,`detected.`]}),e?(0,V.jsx)(`div`,{className:`row gap-8`,children:(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:J,children:[(0,V.jsx)(E,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,V.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,V.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.text}):null,(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,V.jsx)(`div`,{className:`inst-head`,children:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,V.jsx)(ue,{rows:ve,currentId:W?.id,onPick:X,label:`Global installs`,fleet:w,onEdits:Z})]}),(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>I(e=>!e),children:[(0,V.jsx)(E,{name:`folder`}),` Deploy to a repo…`]}):null]}),F?(0,V.jsx)(`div`,{className:`inst-deploy`,children:(0,V.jsx)(ne,{host:_e,theme:n||`neutral`,options:K,onAction:e,onClose:()=>I(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Y.length?(0,V.jsx)(ue,{rows:Y,project:!0,currentId:W?.id,onPick:X,label:`Per-project installs`,fleet:w,onEdits:Z}):(0,V.jsx)(N,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,V.jsx)(fe,{setup:o,overview:i}),(0,V.jsx)(de,{themes:t,current:i?.theme})]}),W?(0,V.jsx)(ae,{inst:W,targets:ie[oe(W.host,W.path)]||[],choice:G(W),unchanged:le(W),options:K,onPick:(e,t)=>ce(W,e,t),canAct:!!e,busy:k===W.id,memory:z(W),onMemory:e=>R({id:W.id,value:e}),onApply:()=>pe(W),onToggleInstall:()=>me(W),onRemove:()=>he(W),onRevealMcp:ge},W.id):null]})}function pe({onAction:e,dataRev:t}){let{data:n,error:i}=_(()=>r.kits(),[t]),a=z(n,e);return i||n?.error?(0,V.jsx)(c,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,V.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=I(e),r=a.setOf(e),i=`${e.host} · ${e.scope}`;return(0,V.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{children:i}),(0,V.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,V.jsx)(R,{row:e})]}),t&&(0,V.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,V.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,V.jsxs)(`li`,{className:`kit-row`,children:[(0,V.jsxs)(`div`,{className:`kit-main`,children:[(0,V.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,V.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,V.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,V.jsx)(L,{on:r.has(n.name),disabled:t||a.running(e),label:`${n.name} for ${i}`,onToggle:()=>a.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,V.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,V.jsx)(te,{row:e,stage:a})]},e.id)})}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,V.jsx)(p,{})}function me(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var q=300;function he(e){let t=T(e.dataRev),[n,r]=b(`edits`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Local edits of:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ge,{install:n,...e},n?.id||``)]})}function ge({install:e,onMutated:t,onAction:n,dataRev:i,overview:o}){let s=a(),{data:l,error:u,reload:d}=_(()=>r.diff(O(e)),[i]),[f,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(``),[v,y]=(0,B.useState)(()=>new Set),[b,x]=(0,B.useState)(()=>new Set),[S,C]=(0,B.useState)(null);if(l&&l!==S){C(l),y(new Set);let e=l.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=q?l.files.map(e=>e.rel):[]))}let w=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>y(e=>e.size===A.length?new Set:new Set(A.map(e=>e.rel))),D=()=>n?.(`export`),k=async()=>{let n=[...v],i=n.filter(e=>l.files.find(t=>t.rel===e)?.status===`added`),a=i.length?`Restoring will DELETE ${i.length} deployed-only file(s):\n${i.join(`
|
|
2
|
+
`)}\n\n`:``;if(await s(`${a}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let i=await r.restore(n,O(e)),a=i.errors.length?` · ${i.errors.length} error(s): ${i.errors.join(`; `)}`:``;g(`Restored ${i.restored.length}, archived ${i.deleted.length}${a}`),await d(),t?.()}catch(e){g(e.message)}finally{m(!1)}}};if(u)return(0,V.jsx)(c,{error:u,onRetry:d});if(!l)return(0,V.jsx)(p,{});if(!l.deployed)return(0,V.jsx)(N,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!l.diffable)return(0,V.jsx)(N,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`The drift check covers global installs only. Pick a global install above.`});let A=l.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),j=l.files.filter(e=>e.status===`linked`),M=l.files.filter(e=>e.status===`stale`),P=A.filter(e=>e.status===`edited`).length,F=A.filter(e=>e.status===`added`).length,I=A.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Local edits`}),l.target?(0,V.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,V.jsx)(`code`,{children:l.target}),l.theme?` (${l.theme} voice)`:``,` with source`,` `,o?.version||`unknown`,`.`]}):null,P>0?(0,V.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):F+I>0?(0,V.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||v.size===0,onClick:k,children:[`Restore`,v.size?` (${v.size})`:``]}),(0,V.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,V.jsx)(E,{name:`download`}),`Export improvements`]})]})]}),h?(0,V.jsx)(`p`,{className:`sub mb-14`,children:h}):null,j.length?(0,V.jsxs)(`p`,{className:`sub dim mb-14`,title:j.map(e=>e.rel).join(`
|
|
3
|
+
`),children:[j.length,` linked — yours, left alone`]}):null,A.length===0&&M.length===0?(0,V.jsx)(N,{title:`In sync`,children:`Deployed harness matches source.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`row between mb-14`,children:[(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`span`,{className:`badge warn`,children:[(0,V.jsx)(`span`,{className:`dot`}),P,` edited`]}),(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),F,` added`]}),I>0&&(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),I,` missing`]}),M.length>0&&(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),M.length,` behind`]})]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(l.files.map(e=>e.rel))),children:`Expand all`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),A.length?(0,V.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:v.size===A.length,onChange:T}),`Select all`]}):null]})]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:A.map(e=>R(e,!0))}),M.length?(0,V.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,V.jsx)(`h3`,{children:`Behind source`}),(0,V.jsxs)(`div`,{className:`row between`,children:[(0,V.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,V.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),M.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=b.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,V.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,V.jsxs)(`div`,{className:`diff-head`,children:[t?(0,V.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:v.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,V.jsx)(`span`,{className:`fname`,children:e.rel}),(0,V.jsxs)(`span`,{className:`badge ${r}`,children:[(0,V.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,V.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,V.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,V.jsx)(E,{name:`chevron`})})]}),n&&(0,V.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,V.jsx)(`div`,{className:`diff-line ${me(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,B.useState)(!n);return(0,V.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,V.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,V.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,V.jsx)(`h3`,{children:e.label}),(0,V.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,V.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,V.jsx)(E,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,V.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,V.jsxs)(`div`,{className:`problem`,children:[(0,V.jsx)(`span`,{className:`x`,children:`✕`}),(0,V.jsx)(`span`,{children:e})]},e))})]})}function _e({dataRev:e}){let t=T(e),[n,r]=b(`doctor`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Doctor for:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ve,{install:n,dataRev:e},n?.id||``)]})}function ve({install:e,dataRev:t}){let n=(0,B.useRef)(!1),{data:i,error:a,reload:o,setData:s}=_(()=>{let t=n.current;return n.current=!1,r.doctor(t,O(e))},[t]),l=()=>{n.current=!0,s(null),o()};if(a)return(0,V.jsx)(c,{error:a,onRetry:o});let u=i?i.groups.filter(e=>e.problems.length):[],d=i?i.groups.filter(e=>!e.problems.length):[];return(0,V.jsxs)(`div`,{className:`page-fill`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,V.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,V.jsxs)(`button`,{className:`btn`,onClick:l,disabled:!i,children:[(0,V.jsx)(E,{name:`refresh`}),i?`Re-run checks`:`Running…`]})]}),i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`span`,{className:`dim mono`,children:[`validated `,i.themes.length,` theme`,i.themes.length===1?``:`s`]}),i.checked_at?(0,V.jsxs)(`span`,{className:`dim mono`,title:i.checked_at,children:[`checked `,i.checked_at.slice(11)]}):null,i.themes.map(e=>(0,V.jsx)(`span`,{className:`badge cap`,children:e},e))]}),i.ok?(0,V.jsxs)(`span`,{className:`badge ok`,children:[(0,V.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),i.problems.length,` problem`,i.problems.length===1?``:`s`]})]})}),(0,V.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,V.jsx)(J,{group:e,i:t},e.label)),d.length?(0,V.jsxs)(`details`,{className:`check-fold`,children:[(0,V.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,V.jsx)(J,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,V.jsx)(p,{label:`Running every check (builds each theme in a sandbox)…`})]})}function Y(){let e=a(),[t,n]=(0,B.useState)(!1),[i,o]=(0,B.useState)(null);return t?(0,V.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,V.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:i}),(0,V.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`})){o(null);try{await r.shutdown()}catch(e){if(e.status)return o(e.message)}n(!0)}},children:[(0,V.jsx)(E,{name:`x`}),`Stop server`]})]})}function X(){let e=a(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:r}),(0,V.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 o()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,V.jsx)(E,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Z=`https://github.com/Arylmera/Geneseed`,ye=`https://github.com/Arylmera`,be=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],xe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function Q({k:e,help:t,children:n,control:r}){return(0,V.jsxs)(`div`,{className:`sheet-row`,children:[(0,V.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,V.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,V.jsx)(`div`,{className:`sheet-v`,children:n}),(0,V.jsx)(`div`,{className:`sheet-c`,children:r})]})}function $({id:e,title:t,head:n,className:r=``,children:i}){return(0,V.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Se({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,V.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:be.map(([n,r])=>(0,V.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,V.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function Ce({version:e}){let[t,n]=(0,B.useState)(Z),[i,a]=(0,B.useState)(!0);(0,B.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,V.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,V.jsx)(E,{name:`external`})]});return(0,V.jsxs)($,{id:`about`,title:`About`,children:[(0,V.jsx)(Q,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,V.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,V.jsx)(Q,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,V.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,V.jsx)(Q,{k:`Geneseed`,help:`MIT-licensed`,control:(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`Issues`]}),(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`MIT License`]})]})]}),children:(0,V.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,V.jsx)(Q,{k:`Creator`,control:(0,V.jsxs)(`a`,{className:`btn ghost`,href:ye,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,V.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 we({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:o,onAccentMode:c,layout:d,onLayout:p,dataRev:h}){let g=a(),_=T(h),[y,C]=b(`server`,_),w=y?.footprint,D=e?.server,O=e?.daemon_stale,[j,M]=(0,B.useState)(null);(0,B.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>M(e||null)).catch(()=>{})},[]);let N=j?j.install??(j.git?`git`:`npm-global`):null,P=N===`git`?`Update (git pull + rebuild)`:N===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,F=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await g(`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`)},I=D?.autostart===!0?`On · login script`:D?.autostart===!1?`Off`:`unknown`;return(0,V.jsxs)(`div`,{className:`narrow-lg`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-18`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:s.server}),(0,V.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,V.jsx)(f,{installs:_,value:y,onChange:C,label:`Footprint of:`})]}),(0,V.jsxs)(`div`,{className:`sheet`,children:[(0,V.jsx)(Se,{stale:O}),(0,V.jsxs)(`div`,{className:`sheet-body`,children:[(0,V.jsxs)($,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-skin-label`,children:k.map(e=>(0,V.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,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:k.find(e=>e.id===n)?.tagline??``})]}),o&&c&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,V.jsx)(m,{value:o,onChange:c,labelledBy:`dir-accent-label`}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:u(o)})]}),d&&p&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-layout-label`,children:A.map(e=>(0,V.jsx)(`button`,{className:d===e.id?`on`:``,onClick:()=>p(e.id),"aria-pressed":d===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:A.find(e=>e.id===d)?.tagline??``})]})]}),(0,V.jsxs)($,{id:`machine`,title:`Machine`,children:[(0,V.jsx)(Q,{k:`Geneseed`,help:`This copy of the source`,control:N===`other`?j.command?(0,V.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,V.jsx)(`code`,{className:`mono`,children:j.command})]}):null:(0,V.jsxs)(`button`,{className:`btn`,onClick:F,children:[(0,V.jsx)(E,{name:`download`}),P]}),children:(0,V.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,V.jsx)(Q,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,V.jsx)(E,{name:`external`}),`Add to PATH`]})}),y&&w&&(0,V.jsxs)(Q,{k:`Harness footprint`,help:(0,V.jsxs)(V.Fragment,{children:[`For `,S(y.host).label,` · `,y.scope,`; every Rule stays in force.`,` `,(0,V.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,V.jsx)(`span`,{className:`mono`,children:w}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,children:w===`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,V.jsxs)($,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`pill good`,children:`running`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,D?` · pid ${D.pid} · up ${v(D.started)}`:``]})]}),children:[(0,V.jsx)(Q,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,V.jsx)(X,{}),children:O?(0,V.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,V.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,V.jsx)(Q,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,V.jsx)(`span`,{className:`sub`,children:I})}),(0,V.jsx)(Q,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,V.jsx)(`span`,{className:`row wrap gap-8`,children:xe.map(e=>(0,V.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,V.jsx)(Ce,{version:e?.version}),(0,V.jsxs)($,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,V.jsx)(Q,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,V.jsx)(Y,{})}),(0,V.jsx)(Q,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,V.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,V.jsx)(Q,{k:`Uninstall a harness`,children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function Te({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:s={}}){let c=t?.doctor,l=t?.diff,u=T(o),f=u?.length>1?h(u[0]):null,p=e=>e==null||!f?e:{v:e,of:f},m={edits:p(l?C(l):null),doctor:p(c?c.ok?`clean`:c.problems.length:null)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,V.jsx)(P,{page:`installs`,current:e,badges:m,label:`Installs`}),e===`hosts`&&(0,V.jsx)(K,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,V.jsx)(pe,{onAction:i,dataRev:o}),e===`edits`&&(0,V.jsx)(he,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,V.jsx)(_e,{dataRev:o}),e===`server`&&(0,V.jsx)(we,{overview:t,onAction:i,dataRev:o,...s})]})}export{Te as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BxjLd7Qd.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-Bccx3zE8.js";import{n as A}from"./sections-ChwaobfW.js";import{At as j,Dt as M,S as N,bt as P,ct as F,jt as I,kt as L,lt as R}from"./index-DA7BiaE5.js";import{n as z}from"./Dashboard-B-6DTmae.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=I(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,I(this,a),e)}}else V(e,this,I(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)||(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=I(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:()=>M(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),M(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=P(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay: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=R(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:N(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:N(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:R(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:()=>M(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:()=>M(`#/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:()=>M(`#/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:()=>M(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{$ as r,G as i,K as a}from"./index-DA7BiaE5.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=r(),s=a(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.js";import{J as i,R as a,W as o,Y as s,pt as c}from"./index-DhNNxhfg.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-BN2Az7dc.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=c(()=>r.kits(),[n]),d=h(a,t),{data:f}=c(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(s,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(s,{})]})}export{P as default};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BxjLd7Qd.js";import{J as i,R as a,W as o,Y as s,bt as c}from"./index-DA7BiaE5.js";import{t as l}from"./EmptyState-CY5Pm2xy.js";import{t as u}from"./Markdown-C4S4tTA7.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-DwyZUj57.js";import{t as v}from"./DataTable-b9zTShqJ.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=c(()=>r.kits(),[n]),d=h(a,t),{data:f}=c(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(s,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(s,{})]})}export{P as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BxjLd7Qd.js";import{$ as i,Dt as a,G as o,H as s,J as c,K as l,Q as u,R as d,W as f,X as p,Y as m,_ as h,bt as g,d as _,f as v,ft as y,g as b,h as x,m as ee,p as te,pt as S,v as C,vt as w,y as T}from"./index-DA7BiaE5.js";import{t as ne}from"./EmptyState-CY5Pm2xy.js";import{t as re}from"./FilterInput-qGKNSlxv.js";import{t as ie}from"./Markdown-C4S4tTA7.js";var E=e(t(),1);function ae({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:s}){let c=i(),u=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),d=u.join(`,`),f=l(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=o(u),{prune:h}=f,g=e.length>0;(0,E.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,y=e=>f.put(`rules`,p,e(v),m),b=e=>v.includes(e),x=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),ee=e=>e.rules.some(e=>b(e.addr)),te=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},S=e=>{let t=e.rules.filter(e=>b(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`},C=t.flatMap(e=>e.rules.map(e=>e.addr)),w=C.filter(b),T=w.join(`,`)!==d,ne=`process.5`,re=u.includes(ne)&&!v.includes(ne);return{deployedRules:u,isOn:b,toggleRule:x,packOn:ee,togglePack:te,packState:S,allRules:C,pickedRules:w,dirty:T,losingConsent:re,applyPacks:async()=>{if(!r||!T)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),o=re?`
|
|
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. `+(s?`(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.)`):``,l=w.length?`${w.length} of ${C.length} doctrine rules`:`no doctrine rules`;await c(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${o}`,{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 D=n();function O({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:l,toggleCol:u=null,renderBody:d,srcLine:f,after:p=null}){let m=(0,E.useId)(),{data:h,error:_,reload:v}=g(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),y=t&&(0,D.jsxs)(`div`,{className:`law-expand`,id:m,children:[_?(0,D.jsx)(c,{error:_,onRetry:v}):h?d(h):(0,D.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,D.jsx)(`div`,{className:`law-srcline`,children:f}),p]}),b={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":m,"aria-label":s};return u?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,D.jsx)(`button`,{className:`law-disclosure`,...b,children:o}),(0,D.jsx)(`span`,{className:`toggle-col`,children:u})]}),y]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{className:i,style:a,"data-addr":e,...b,children:o}),y]})}function oe({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null,after:a=null}){let o=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`law-no`,children:[(0,D.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,D.jsxs)(`span`,{className:`law-name`,children:[(0,D.jsx)(`span`,{children:e.name}),e.ess?(0,D.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,D.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,D.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,D.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,D.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,D.jsx)(O,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:o,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,D.jsx)(ie,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`,after:a})}var k=[`invariants`,`doctrines`];function se({tiers:e,current:t,onPick:n}){return(0,D.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`tier-head`,children:[(0,D.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,D.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,D.jsxs)(`span`,{className:`tier-top`,children:[(0,D.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,D.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,D.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,D.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,D.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,D.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,D.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&k.includes(e.key)?(0,D.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,D.jsx)(`div`,{className:a,children:i},e.key)})})}function ce({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1,install:i=null}){let a=i?`off · ${i.host} ${i.scope}`:`off`,o=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(b(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),s=Math.max(1,...o.map(([,e])=>e));return(0,D.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,D.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),o.length?(0,D.jsx)(`ul`,{className:`gate-list`,children:o.map(([e,r,i])=>{let o=b(e),c=t[o]?.name||v[o]?.label||o;return(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,D.jsxs)(`span`,{className:`gate-top`,children:[(0,D.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:c}),(0,D.jsx)(`span`,{className:`mono dim`,children:o}),i&&(0,D.jsx)(`span`,{className:`mono off`,children:a}),(0,D.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,D.jsx)(d,{value:r,max:s,label:`${c} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,D.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,D.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function le({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,losingConsent:l}=t,u=Math.max(1,...e.map(e=>e.rules.length));return(0,D.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,D.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,D.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,D.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,D.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,D.jsx)(d,{value:t,max:u,label:`${e.title} rules on`}),(0,D.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,D.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,D.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,D.jsxs)(D.Fragment,{children:[l&&(0,D.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,D.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,D.jsx)(`code`,{children:`git commit`}),` and `,(0,D.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,D.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.`})]})]})}var ue=`ont:ownership`,de=e=>e===`ownership`?ue:e;function fe(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=h(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:x(n.name),c:T[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function A(e){let t=S(e.dataRev),[n,i]=y(`laws`,t),{data:a}=g(()=>n?r.overview(w(n)).catch(()=>null):Promise.resolve(null),[n?.id??``,e.dataRev]),o=n&&a?.install?.host===n.host&&a.install.path===n.path?a:null,s=n?o:e.overview,c=t!==null&&(!n||o!==null);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(p,{className:`page-pick`,installs:t,value:n,onChange:i,label:`Constitution of:`}),(0,D.jsx)(j,{...e,overview:s,pair:w(n),onAction:c?e.onAction:void 0},n?.id??`none`)]})}function j({selected:e,overview:t,setup:n,onAction:o,dataRev:l,pair:p}){let y=i(),{data:S,error:w}=g(()=>r.catalog(`laws`,p),p?[l,p.host,p.path]:[l],`catalog:laws`),{data:ie}=s(l,p),[O,k]=(0,E.useState)(`all`),[A,j]=(0,E.useState)(``),[M,pe]=(0,E.useState)(`all`),[me,he]=(0,E.useState)(()=>new Set),N=de(e)||null,ge=e=>a(N===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),P=t?.install,F=!!(P&&o),[_e,ve]=(0,E.useState)(0),ye=(0,E.useRef)(null);(0,E.useEffect)(()=>{if(!N)return;let e=requestAnimationFrame(()=>{let e=document.querySelector(`[data-addr="${CSS.escape(N)}"]`);if(!e)return;let t=ye.current===N;ye.current=null;let n=e.getBoundingClientRect();if(t||n.top<80||n.bottom>window.innerHeight){let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView?.({block:`center`,behavior:t?`auto`:`smooth`})}t&&(e.classList.remove(`law-flash`),e.offsetWidth,e.classList.add(`law-flash`))});return()=>cancelAnimationFrame(e)},[N,_e,S]);let I=S?.items||[],L=fe(I),R=e=>t?.install?.[v[e].key]!==!1,be=R(`IV`),z=ae({items:I,packs:L,install:P,canApply:F,onAction:o,gateArmed:be}),{deployedRules:B,isOn:V,toggleRule:xe,packOn:Se,packState:Ce,allRules:H}=z;if(w)return(0,D.jsx)(c,{error:w});if(!S)return(0,D.jsx)(m,{});let U={ontology:S.nouns?.ontology||`Ethos`,law:S.nouns?.law||`Dictate`,laws:S.nouns?.laws||`Dictates`,doctrines:S.nouns?.doctrines||`Doctrines`},W=I.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:e.name===ue&&P?x(`ownership`,P):`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),G=I.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&C[e.klass]?e.klass:`craft`,r=h(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`:x(e.name,t?.install),cat:n,c:C[n].c,off:r.retired,src:`laws/universal.md`}}),K=F?[{addr:`ownership`,name:v.ownership.label,latin:``,ess:``,enf:x(`ownership`,P)}]:[],we=e=>{let t=V(e.addr),n=B.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`}},Te=L.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!B.includes(e.addr)).map(e=>e.addr)),Ee=async e=>{if(!F)return;let{key:t,label:n}=v[e],r=n.toLowerCase(),i=!R(e),a=`${P.host} · ${P.scope}`,s=z.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await y((i?`Re-arm the ${r} on ${a}? ${_[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${a}? ${_[e].off} It rebuilds in place, non-destructive.`)+s,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&o(`install`,{...P,[t]:i})},De=e=>(0,D.jsx)(`button`,{type:`button`,className:`sw-toggle${R(e)?` on`:``}`,role:`switch`,"aria-checked":R(e),"aria-label":v[e].label,onClick:()=>Ee(e)}),Oe=e=>String(e.addr).includes(`.`)&&V(e.addr)!==B.includes(e.addr),q=(e,t=M)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||B.includes(e.addr)):Oe(e)),J=A.trim().toLowerCase(),Y=e=>q(e)&&(!J||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(J)),ke=e=>{let t=Ie[e];(String(e).includes(`.`)?O===`invariants`:t&&O===`doctrines`)&&k(`all`),t&&!q(t)&&pe(`all`),t&&!Y(t)&&j(``),ye.current=de(e),ve(e=>e+1),a(`#/item/law/${encodeURIComponent(e)}`)},X={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))X[b(e)]=t;let Ae=e=>X[e.addr]?{...e,asks:`${X[e.addr]} ask${X[e.addr]===1?``:`s`}`}:e,Z=G.filter(e=>!e.retired).length,Q=B.length,je=e=>{let t=e.filter(e=>v[e.addr]&&!R(e.addr)).length;return t?[`${t} gate${t===1?``:`s`} off`,`warn`]:[`always`,`ok`]},Me=H.length-Q,$=ie?.stats,Ne={ethos:{name:U.ontology,n:W.length,fill:1,sub:`${W.length} sections`,pill:je(K)},invariants:{name:U.laws,n:Z,fill:G.length?Z/G.length:0,sub:G.length>Z?`${Z} active · ${G.length-Z} retired`:`${Z} active`,pill:je(G)},doctrines:{name:U.doctrines,n:Q,fill:H.length?Q/H.length:0,sub:`${Q} rules · ${L.filter(e=>e.active).length} of ${L.length} packs`,pill:Me>0?[`${Me} 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`,``]}},Pe=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,U.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Fe=te.map(e=>({key:e.key,...Ne[e.key],rule:Pe(e.against)})),Ie=Object.fromEntries([...G,...L.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Le=[[`all`,`All`,G.length+H.length],[`invariants`,U.laws,G.length],[`doctrines`,U.doctrines,H.length]],Re=O===`all`||O===`invariants`,ze=O===`all`||O===`doctrines`,Be=[...K,...Re?G:[],...ze?L.flatMap(e=>e.rules):[]],Ve=[[`gated`,`Gated`,Be.filter(e=>q(e,`gated`)).length],[`changed`,`Changed`,Be.filter(e=>q(e,`changed`)).length]],He=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,Ue=e=>M!==`changed`&&me.has(e)&&He(N)!==e,We=e=>{let t=Ue(e);he(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&He(N)===e&&a(`#/laws`)},Ge=L.flatMap(e=>e.rules.filter(Oe).map(e=>({...e,plus:V(e.addr)}))),Ke=F&&L.length>0&&z.dirty,qe=()=>{pe(`changed`),O===`invariants`&&k(`all`),j(``)},Je=(e,t)=>(0,D.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,D.jsx)(`h2`,{className:`tier-h`,children:e}),(0,D.jsx)(`span`,{className:`mono dim`,children:t})]}),Ye=G.filter(Y),Xe=(J||M!==`all`?K.filter(Y).length:0)+(Re?Ye.length:0)+(ze?L.reduce((e,t)=>e+t.rules.filter(Y).length,0):0),Ze=Ae(K[0]||{}).asks,Qe=K.length>0&&(0,D.jsxs)(`div`,{className:`law-gate`,children:[(0,D.jsxs)(`span`,{className:`law-name`,children:[(0,D.jsx)(`span`,{children:v.ownership.label}),Ze?(0,D.jsx)(`span`,{className:`law-asks mono`,children:Ze}):null,(0,D.jsx)(`span`,{className:`law-princ`,children:_.ownership.desc})]}),De(`ownership`)]});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(f,{eyebrow:P?[t?.theme,P.footprint&&`${P.footprint} footprint`,P.host,P.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,D.jsx)(re,{className:`law-filter`,value:A,onChange:j,placeholder:`Filter rules`,label:`Filter rules`})}),(0,D.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,D.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,D.jsx)(se,{tiers:Fe,current:O,onPick:k}),(0,D.jsx)(`div`,{className:`ladder-tail`,children:ee.map((e,t)=>(0,D.jsxs)(`span`,{className:`ladder-low`,children:[(0,D.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,te.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,D.jsxs)(`div`,{className:`split`,children:[(0,D.jsxs)(`section`,{className:`panel flush law-wrap${F?` with-toggle`:``}`,"aria-label":`Rules`,children:[W.length>0&&(0,D.jsxs)(D.Fragment,{children:[Je(U.ontology,`ontology/universal.md`),W.map(e=>(0,D.jsx)(oe,{law:e,rev:l,isOpen:N===e.addr,onToggle:()=>ge(e.addr),after:e.addr===ue?Qe:null},e.addr))]}),(0,D.jsxs)(`div`,{className:`law-toolbar`,children:[(0,D.jsx)(u,{"aria-label":`Show`,children:Le.map(([e,t,n])=>(0,D.jsxs)(`button`,{type:`button`,className:O===e?`on`:``,"aria-pressed":O===e,onClick:()=>k(e),children:[t,` `,(0,D.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,D.jsx)(u,{"aria-label":`Narrow`,children:Ve.map(([e,t,n])=>(0,D.jsxs)(`button`,{type:`button`,className:M===e?`on`:``,"aria-pressed":M===e,onClick:()=>pe(M===e?`all`:e),children:[t,` `,(0,D.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,D.jsxs)(`div`,{className:`law-rowhead`,children:[(0,D.jsx)(`span`,{children:`No.`}),(0,D.jsx)(`span`,{children:`Rule`}),(0,D.jsx)(`span`,{children:`Latin name`}),(0,D.jsx)(`span`,{children:`Status`}),(0,D.jsx)(`span`,{children:`Enforced by`})]}),Re&&Ye.length>0&&(0,D.jsxs)(D.Fragment,{children:[Je(U.laws,`laws/universal.md`),Ye.map(e=>(0,D.jsx)(oe,{law:Ae(e),rev:l,isOpen:N===e.addr,onToggle:()=>ge(e.addr),toggleCol:!F||e.retired?null:v[e.addr]?De(e.addr):(0,D.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),ze&&L.map(e=>{let t=e.rules.filter(Y);if(!t.length)return null;let n=Ue(e.pack),r=e.rules.filter(e=>V(e.addr)).length;return(0,D.jsxs)(`div`,{className:`pack-wrap${Se(e)?``:` pack-off`}`,children:[(0,D.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,D.jsx)(`h2`,{className:`tier-h`,style:{"--cc":T[e.pack]},children:(0,D.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>We(e.pack),children:e.title})}),(0,D.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,D.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,D.jsx)(`span`,{className:`pack-fill`,children:(0,D.jsx)(d,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,D.jsx)(`span`,{className:`pack-state mono`,children:Ce(e)})]}),!e.active&&!F&&(0,D.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,L.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Te.length>0&&` --exclude-rules ${Te.join(`,`)}`]}),!n&&t.map(e=>(0,D.jsx)(oe,{law:Ae(we(e)),rev:l,isOpen:N===e.addr,onToggle:()=>ge(e.addr),toggleCol:F?(0,D.jsx)(`button`,{type:`button`,className:`sw-toggle${V(e.addr)?` on`:``}`,role:`switch`,"aria-checked":V(e.addr),"aria-label":`${e.name} rule`,onClick:()=>xe(e.addr)}):null},e.addr))]},e.pack)}),Xe===0&&(0,D.jsx)(ne,{title:J||M!==`all`?`No matching rules`:`Nothing in this tier`,children:J?(0,D.jsxs)(D.Fragment,{children:[`Nothing matches “`,A.trim(),`”.`]}):M===`all`?(0,D.jsx)(D.Fragment,{children:`This install predates the tier.`}):(0,D.jsxs)(D.Fragment,{children:[`No `,M,` rule in this tier.`]})})]}),(0,D.jsxs)(`aside`,{className:`aside-stack`,children:[(0,D.jsx)(le,{packs:L,sel:z,canApply:F,install:P,gateArmed:be}),(0,D.jsx)(ce,{gates:n?.gates,byAddr:Ie,onJump:ke,disarmed:e=>!!v[e]&&!R(e),install:t?.install})]})]}),Ke&&(0,D.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,D.jsxs)(`span`,{className:`law-bar-n`,children:[Ge.length,` unapplied change`,Ge.length===1?``:`s`]}),(0,D.jsx)(`span`,{className:`law-bar-list`,children:Ge.map(e=>(0,D.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,D.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:qe,children:`Review changes`}),(0,D.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{pe(`all`),z.revert()},children:`Revert`}),(0,D.jsxs)(`button`,{type:`button`,className:`btn`,onClick:z.applyPacks,children:[`Apply (`,z.pickedRules.length,`/`,H.length,` rules)`]})]})]})}export{A as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BxjLd7Qd.js";import{i}from"./motion-Bccx3zE8.js";import{n as a,t as o}from"./sections-ChwaobfW.js";import{$ as s,Dt as ee,J as te,Q as ne,V as re,_t as ie,b as c,bt as l,pt as ae,rt as u,x as d}from"./index-DA7BiaE5.js";import{t as f}from"./EmptyState-CY5Pm2xy.js";import{a as oe,c as se,i as ce,o as le,r as ue,s as de,t as fe}from"./RailCats-D5weYPCS.js";import{t as pe}from"./Markdown-C4S4tTA7.js";var p=e(t(),1),m=n();function me({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)(me,{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)(u,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(u,{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)(u,{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)(u,{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 he({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`},ge={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`})]})},y=(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 _e({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`}),ge[e]||y]})}function b({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 ve={skills:`skill`,agents:`agent`},x=[`skills`,`agents`,`memory`,`notebook`],ye=new Set([`MEMORY`,`NOTEBOOK`,`README`]),be=e=>e.filter(e=>!ye.has(String(e.name).toUpperCase())).length,xe=(e,t)=>`${t?e/t*100:0}%`,S=e=>e.split(`:`).slice(0,2).join(` `),C=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},w=e=>ie(C(e)),Se=e=>({"--cc":`var(--cat-${e*2%7})`});function Ce(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 we({section:e,source:t}){return(0,m.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,m.jsx)(u,{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 Te=e=>e.replace(/\s+/g,` `).trim(),T=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ee(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?Te(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?Te(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=T(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function De({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)(b,{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)(b,{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:xe(e,a)}},t))})})})}function Oe(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 ke={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},Ae=(e,t)=>t||(e&&o.includes(e)?e:o[0]),je=encodeURIComponent;function Me(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 Ne(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 E({overview:e,section:t,selected:n,dataRev:i,lock:u,base:d,onRulesChanged:me}){let h=s(),[g,_]=(0,p.useState)(()=>Ae(t,u)),[v,ge]=(0,p.useState)(``),[y,b]=(0,p.useState)(`all`),[ye,S]=(0,p.useState)(`all`),[Te,T]=(0,p.useState)(``),[E,Pe]=(0,p.useState)(null),[D,Fe]=(0,p.useState)(null),[Ie,Le]=(0,p.useState)(t);if(t!==Ie){Le(t),T(``);let e=Ae(t,u);e!==g&&(_(e),ge(``),b(`all`),S(`all`))}let[Re,ze]=(0,p.useState)(n);n!==Re&&(ze(n),T(``));let{data:O,error:Be,reload:Ve}=l(()=>r.catalog(g),[g,i],`catalog`),He=u?null:ve[g]||null,Ue=He!==null||g===`memory`||g===`notebook`,{data:We}=l(()=>u?Promise.resolve(null):Promise.all(x.map(e=>r.catalog(e))).catch(()=>null),[u,i]),k=He!==null,{data:A}=l(()=>k?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[k,i],`usage`,{revalidate:!0}),j=k&&!!A?.enabled&&Array.isArray(A.names),Ge=(0,p.useMemo)(()=>new Map((Array.isArray(A?.names)?A.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[A]),M=e=>j&&Ge.get(`${He}\u0000${e}`)||null,Ke=e=>{let t=M(e.name);return!t||t.n===0&&!t.last},qe=A?.since?`No call since ${A.since}`:`No call recorded yet`,N=O?.section===g&&O?.items||[],P=g===`skills`,Je=P?Me(N):null,F=P?Je.rows:g===`memory`?Ne(N):N,I=n||F[0]?.name||null,L=I?N.find(e=>e.name===I):null,R=L?.type||a[g].type,z=D?.sec===g&&D?.name===I?D.key:null,{data:Ye,error:B}=l(()=>I?z?r.item(R,I,C(z)):r.item(R,I):Promise.resolve(null),[g,I,R,z,i]),V=B?null:Ye,H=V&&V.name===I&&(!z||V.install===z)?V:null,Xe=e=>G&&e?.install?` in ${w(e.install)}`:``,Ze=Te||Be||B,Qe=I?{name:I,title:V?.title||I,desc:V?.desc||``}:null,U=L||Qe,$e=e?.counts||{},et=e=>{if(!x.includes(e))return $e[e]??``;if(e===g&&O?.section===g)return be(N);let t=We?.find(t=>t?.section===e)?.items;return t?be(t):``},W=ae(i),tt=W?.length>1?`of ${ie(W[0])}`:null,G=Ue&&new Set(N.flatMap(e=>e.installs||[])).size>1,nt=[...new Set([...(W||[]).map(e=>e.id),...N.flatMap(e=>e.installs||[])])],K=P?F.filter(e=>y===`all`||e.cat===y):F,rt=j?K.filter(Ke).length:0,it=e=>e.status===`experimental`,at=K.filter(it).length,q=[[`all`,`All`,K.length],...j?[[`used`,`Used`,K.length-rt],[`unused`,`Not used yet`,rt,qe]]:[],...at?[[`experimental`,`Experimental`,at,`Shipped, not yet confirmed by real use`]]:[]],J=q.some(([e])=>e===ye)?ye:`all`,Y=J===`all`?K:J===`experimental`?K.filter(it):K.filter(e=>Ke(e)===(J===`unused`)),ot=j?Math.max(0,...N.map(e=>M(e.name)?.n||0)):0,st=P?1/0:50,X=v.trim().toLowerCase(),Z=X?le(Y,X):Y.slice(0,st),ct=!X&&y===`all`&&J===`all`&&I&&!Z.some(e=>e.name===I)?[...Z,...F.filter(e=>e.name===I)]:Z,lt=e=>d?`${d}/${je(e.name)}`:`#/item/${e.type||a[g].type}/${je(e.name)}`,ut=async()=>{let e=H;if(!e)return;let t=e.name;if(await h(`Forget the memory fact "${t}"${Xe(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`})){T(``);try{await r.memoryDelete(t,e.install?C(e.install):void 0)}catch(e){T(`Could not forget "${t}": ${e.message}`);return}ee(d||`#/section/memory`),Ve()}},dt=async()=>{let e=H;if(!e)return;let t=e.name;if(await h(`Promote "${t}"${Xe(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`})){T(``);try{let n=e.install?C(e.install):void 0,i=await r.rules(n);await r.rulesPromote({name:t,fingerprint:i.fingerprint,delete_memory:!0},n),re(),me?.(),ee(`#/personal/rules`)}catch(e){T(`Could not promote: ${e.message}`),Ve()}}},ft=V?.body?Ee(V.body,V.desc||U?.desc):null,pt=V?.title||U?.title||U?.name,mt=pt===U?.name&&ft?.title?ft.title:pt,ht=O?.section===g&&N.length===0,gt=V?.status||U?.status,_t=g===`skills`?c[L?.klass]:null,Q=a[g].label,{lede:vt,when:yt}=Oe(V?.desc||U?.desc||``),$=U?V?.source||U.source||(B?null:Ce(g,U.name)):null;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(te,{error:Ze,style:{margin:`0 0 var(--sp-3)`}}),(0,m.jsxs)(`div`,{className:`library lib-dossier${u?` locked`:``}${j?` uses`:``}`,children:[u?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:et(e)})]}),e===g&&P&&(0,m.jsx)(fe,{label:`Skill types`,total:N.length,cats:Je.cats,cat:y,onChange:b})]},e))})]}),(0,m.jsxs)(oe,{label:Q,count:X?`${Z.length} of ${Y.length}`:Y.length,q:v,onQ:ge,matched:Z.length,inView:[g,n],extra:(0,m.jsxs)(m.Fragment,{children:[j&&A.since?(0,m.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,A.since]}):!x.includes(g)&&g!==`laws`&&tt?(0,m.jsx)(`span`,{className:`mono dim lib-since`,children:tt}):null,(0,m.jsxs)(`span`,{className:`lib-legend mono`,children:[G?nt.map((e,t)=>(0,m.jsxs)(`span`,{className:`lk-install`,title:C(e).path,children:[(0,m.jsx)(`i`,{className:`lr-dot`,style:Se(t),"aria-hidden":`true`}),w(e)]},e)):null,(0,m.jsx)(se,{items:N})]})]}),tools:q.length>1?(0,m.jsx)(ne,{"aria-label":`Show`,children:q.map(([e,t,n,r])=>(0,m.jsxs)(`button`,{type:`button`,className:J===e?`on`:``,"aria-pressed":J===e,title:r,onClick:()=>S(e),children:[t,` `,(0,m.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[(0,m.jsx)(ue,{rows:ct,activeName:U?.name,hrefOf:lt,pills:j||G?e=>{let t=M(e.name)?.n||0,n=G?(0,m.jsx)(`span`,{className:`lr-dots`,children:nt.map((t,n)=>e.installs?.includes(t)?(0,m.jsx)(`span`,{className:`lr-dot lr-install`,style:Se(n),title:`${w(t)} — ${C(t).path}`,children:(0,m.jsx)(`span`,{className:`sr-only`,children:w(t)})},t):(0,m.jsx)(`span`,{className:`lr-dot off`,"aria-hidden":`true`},t))}):null;return j?(0,m.jsxs)(m.Fragment,{children:[n,(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:xe(t,ot)}})}),(0,m.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,m.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})]}):n}:void 0}),!X&&N.length>st&&(0,m.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,st,` of `,N.length,`; type to search the rest.`]}),ht&&(g===`wiki`?(0,m.jsxs)(f,{title:`No wiki entries`,action:(0,m.jsx)(`a`,{href:`#/section/config`,children:`Open the setup files`}),docs:{href:`#/docs/wiki`,label:`How to configure a wiki →`},children:[`Declare a wiki in `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,m.jsx)(f,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,m.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:U?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`reader-tags`,children:[(0,m.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),_t?(0,m.jsx)(`span`,{className:`tag`,children:_t.label}):null,V?.kit??U.kit?(0,m.jsx)(ce,{name:V?.kit??U.kit}):null,(0,m.jsx)(de,{status:gt,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($),Pe({src:$,ok:!0})}catch{Pe({src:$,ok:!1})}},children:E?.src===$?E.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,m.jsxs)(`div`,{className:`reader-head`,children:[(0,m.jsx)(`h2`,{className:`reader-title`,children:mt}),g===`agents`?(0,m.jsx)(_e,{name:U.name}):null]}),(0,m.jsxs)(`div`,{className:`reader-intro${j?` with-stats`:``}`,children:[(0,m.jsxs)(`div`,{className:`reader-intro-text`,children:[vt?(0,m.jsx)(`p`,{className:`reader-lede`,children:vt}):null,yt?(0,m.jsxs)(`section`,{className:`reader-when`,children:[(0,m.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,m.jsx)(`p`,{children:yt})]}):null]}),j?(0,m.jsx)(De,{u:M(U.name),usage:A,noCall:qe}):null]}),g===`memory`&&H&&U.name!==`MEMORY`&&U.name!==`README`&&(0,m.jsxs)(`div`,{className:`row gap-8`,children:[(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:dt,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:ut,children:`Forget this fact`})]}),V?.installs?.length>1&&V.installs.includes(V.install)?(0,m.jsxs)(`label`,{className:`row gap-8 lib-copy`,children:[(0,m.jsx)(`span`,{className:`dim`,children:`Viewing copy from:`}),(0,m.jsx)(`select`,{className:`sel`,value:z||V.install,onChange:e=>Fe({sec:g,name:I,key:e.target.value}),children:V.installs.map(e=>(0,m.jsx)(`option`,{value:e,title:C(e).path,children:w(e)},e))}),(0,m.jsx)(`span`,{className:`dim`,children:`this entry only`})]}):null,(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:U.name}),` could be read in this install.`]}):U?.kind===`manifest`||V?.manifest!==void 0?V?(0,m.jsx)(he,{manifest:V.manifest,body:V.body,name:U.name}):(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):V?.body?(0,m.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,m.jsx)(pe,{body:ft.body,links:V.links||[]})}):V===null&&I?(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,m.jsx)(we,{section:g,source:Ce(g,U.name)}),ke[g]?(0,m.jsx)(`div`,{className:`reader-links`,children:(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${ke[g]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):ht?null:(0,m.jsx)(f,{title:`Select an entry`,children:`Pick something from the list to read it.`})})]})]})}export{Ee as bodyHead,E as default,Ne as groupMemory,w as installLabel,C as installOfKey,Me as splitSkills,Oe as splitWhen};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BxjLd7Qd.js";import{Et as i,J as a,Tt as o,X as s,Y as c,bt as l,ft as u,pt as d,vt as f}from"./index-DA7BiaE5.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{t as m}from"./usePoll-o8ul-Sog.js";import{a as h,n as g,o as _,r as v,t as y}from"./RailCats-D5weYPCS.js";import{t as b}from"./CopyButton-C5Li6awl.js";import{t as x}from"./Markdown-C4S4tTA7.js";import{t as S}from"./DataTable-b9zTShqJ.js";var C=e(t(),1),w={x:260,y:190},T=110,E=28,D=14,O=44,k=e=>e*Math.PI/180,A=e=>Math.round(e*10)/10,j=(e,t=T,n=w)=>({x:A(n.x+t*Math.cos(k(e))),y:A(n.y+t*Math.sin(k(e)))}),M=e=>e/T*(180/Math.PI)+3,N=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,P=A(j(205).x-6),F=e=>e.length*6.4,I=e=>({x:e.x-F(e.name)/2,y:e.y-7,w:F(e.name),h:14}),L=(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,R=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>L(I(n),I(e))));function z(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function B(e,t=[]){let n=V(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?V(e,t,Math.ceil(-r)):n}function V(e,t,n){let r={x:w.x,y:w.y+n},i=(e,t=T)=>j(e,t,r),a=e=>t.find(t=>t.name===e),o=e=>a(e)?.effect??null,s=e=>z(a(e)),c=e.loops||[],l=c.find(e=>e.iteration);if(!l||l.nodes.length>8)return H(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 H(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 H(e,o,s);let g=360/h.length,_=h.map((e,t)=>({name:e,a:-90+t*g,r:E})),v=_.findIndex(e=>o(e.name)===`mutate`);v>=0&&_.splice(v,0,{name:`validate`,a:_[v].a-g/2,r:D,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)})),b=_.map((e,t)=>{let n=_[(t+1)%_.length],r=(t+1===_.length?n.a+360:n.a)-M(n.r)-2,a=e.a+M(e.r);return{d:N(T,i(a),i(r),+(r-a>180)),kind:`ring`}}),x=[],S=new Map;for(let e of d)S.set(e.nodes[0],[...S.get(e.nodes[0])||[],e]);for(let[e,t]of S){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),T+(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,...j(l+(n-(u.length-1)/2)*e,O,c)})),f=105;for(;f<150&&R(d(f),y);)f+=5;d(f).forEach(({name:e,...t})=>{y.push({name:e,...t,r:E,effect:o(e),gate:!1,inner:!0,human:s(e)})});let p=l+180;b.push({d:N(O,j(p+42,O,c),j(p+138,O,c)),kind:`inner`}),b.push({d:N(O,j(p+222,O,c),j(p+318,O,c)),kind:`inner`});let h=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,g={lx:c.x,ly:c.y+O+20,anchor:`middle`};if(a){let e=c.x>=w.x,t=Math.max(O,...u.map(e=>{let t=y.find(t=>t.name===e);return Math.abs(t.x-c.x)+E}));g={lx:A(c.x+(e?t+8:-t-8)),ly:A(c.y+4),anchor:e?`start`:`end`}}x.push({loop:e.name,cx:c.x,cy:c.y,r:O,label:h,...g})})}let C=i(205).y,k=e.nodes.filter(e=>!l.nodes.includes(e)),P=k.map((e,t)=>({name:e,x:40,y:A(C-44*(k.length-1-t)),human:s(e)})),I=e.edges.find(e=>e.to===`$close`)?.from,L=y.find(e=>e.name===I),B=L?{from:I,x:L.x+200,y:L.y-30,d:`M${L.x+E},${L.y-6} C${L.x+90},${L.y-40} ${L.x+170},${L.y-40} ${L.x+200},${L.y-30}`}:null,V=Math.max(540,...y.map(e=>e.x+e.r+8),...B?[B.x+6+F(`close`)+8]:[],...x.map(e=>e.cx+e.r+8),...x.map(e=>e.anchor===`start`?e.lx+F(e.label)+8:e.lx+F(e.label)/2+8)),U=Math.max(300,...y.map(e=>e.y+e.r+12),...x.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(V),height:Math.ceil(U),center:{x:r.x,y:r.y,r:T},nodes:y,arcs:b,inner:x,entry:P,exit:B}}function H(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(E,...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:E,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])+E},${a} L${o.get(t)-E-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 U=n();function W({x:e,y:t,label:n}){return(0,U.jsxs)(`g`,{className:`lr-human`,children:[(0,U.jsx)(`title`,{children:n}),(0,U.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,U.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,U.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 ee({graph:e,bricks:t,onSelect:n,highlight:r}){let i=B(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,U.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,role:`group`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,U.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,U.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,U.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,U.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,U.jsxs)(`g`,{children:[(0,U.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,U.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,U.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${P},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,U.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,U.jsx)(W,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,U.jsxs)(`g`,{className:`lr-gate`,children:[(0,U.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,U.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,U.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,U.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,U.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,U.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,U.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,U.jsx)(W,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,U.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,U.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,U.jsxs)(`g`,{children:[(0,U.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,U.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var te=5e3,ne=[`prudent`,`balanced`,`aggressive`],G={running:`acc`,awaiting:`warn`,unreadable:`bad`},K=e=>!!e.graph;function re(){let[e,t]=(0,C.useState)(null),[n,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),[s,c]=(0,C.useState)(0);return m(e=>r.activeLoops().then(n=>e()&&(t(n),i(null)),t=>e()&&i(t.message)),te,[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 q=e=>({key:e,label:e,align:`right`,render:t=>(0,U.jsx)(`span`,{className:`num`,children:t[e]})}),ie=[q(`iteration`),{key:`intent`,label:`intent`},q(`declared`),q(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function ae({history:e}){return e.length?(0,U.jsx)(`div`,{className:`loop-history`,children:(0,U.jsx)(S,{caption:`Iterations`,captionHidden:!0,columns:ie,rows:e,rowKey:e=>e.iteration})}):(0,U.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function oe({loop:e,bricks:t,onPreset:n}){let r=K(e)?(e.graph.loops||[]).find(e=>e.iteration):null,[i,a]=(0,C.useState)(!1);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`reader-tags`,children:[(0,U.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,U.jsx)(`span`,{className:`tag${G[e.status]?` ${G[e.status]}`:``}`,children:e.status})]}),(0,U.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,U.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),K(e)?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,U.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,U.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,U.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,U.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:ne.map(e=>(0,U.jsx)(`option`,{children:e},e))})]}),(0,U.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,U.jsx)(`hr`,{className:`hr`}),(0,U.jsx)(`div`,{className:`loop-graph`,children:(0,U.jsx)(ee,{graph:e.graph,bricks:t,highlight:e.node})}),(0,U.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,U.jsx)(ae,{history:e.history})]}):(0,U.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 J=encodeURIComponent,Y=o.loops.map(e=>[e,i[e]]),X={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},se={project:`Project`,global:`Global`,shipped:`Shipped`},ce={templates:`Categories`,bricks:`Origins`,active:`Statuses`},le=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function Z(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var Q=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function ue(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return Q(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>X[e.graph.category]?e.graph.category:`other`,[...Object.entries(X),[`other`,`Other`]])}function de(e,t){return Q(e.map(e=>({...e,desc:e.description,override:Z(t,e.name)})),e=>e.origin,Object.entries(se))}function fe(e){return Q(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,le)}var $=(e,t)=>(0,U.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),pe={templates:e=>e.human?$(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?$(`warn`,`mutate`):null,z(e)?$(`human`,`human gate`):null,e.override?$(`acc`,e.override):null,e.available===!1?$(`bad`,`unavailable`):null],active:e=>$(G[e.status],e.status)};function me({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,U.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,U.jsx)(`b`,{children:(0,U.jsx)(`a`,{href:`#/loops/bricks/${J(e)}`,children:e})}),$(t.effect===`mutate`?`warn`:``,t.effect),(0,U.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,U.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),z(t)?$(`human`,z(t).toLowerCase()):null,n?$(`acc`,n):null]}):(0,U.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,U.jsx)(`b`,{children:e}),(0,U.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function he(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 ge({t:e,bricks:t,overridden:n,runs:r}){let[i,a]=(0,C.useState)(null),o=new Map(t.map(e=>[e.name,e])),s=he(e.graph),c=B(e.graph,t),l=c.mode===`ring`,u=`geneseed loop init --graph ${e.name} --title "<title>" --requirement "<requirement>"`,d=r?.filter(t=>K(t)&&t.graph.name===e.name).length;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`reader-tags`,children:[(0,U.jsx)(`span`,{className:`tag acc`,children:`Template`}),X[e.graph.category]?$(``,X[e.graph.category]):null,e.human?$(`human`,`human gate`):null]}),(0,U.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,U.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,U.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,U.jsx)(`hr`,{className:`hr`}),(0,U.jsxs)(`figure`,{className:`loop-console`,children:[(0,U.jsx)(`div`,{className:l?`loop-graph`:`loop-graph flow`,style:l?void 0:{"--loop-w":`${c.width}px`},children:(0,U.jsx)(ee,{graph:e.graph,bricks:t,onSelect:e=>{a(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:`smooth`,block:`nearest`})}})}),(0,U.jsxs)(`figcaption`,{className:`loop-how`,children:[(0,U.jsx)(`span`,{className:`loop-kicker`,children:`How it runs`}),(0,U.jsx)(`ol`,{children:s.map(([e,t])=>(0,U.jsxs)(`li`,{children:[(0,U.jsxs)(`b`,{children:[e,`:`]}),` `,t]},e))}),l?(0,U.jsxs)(`span`,{className:`loop-legend`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`i`,{className:`ring`,"aria-hidden":`true`}),`iteration`]}),s.some(([e])=>e===`Retry`)?(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`i`,{className:`inner`,"aria-hidden":`true`}),`retry`]}):null]}):null]})]}),(0,U.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`loop-start-h`,children:[(0,U.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,U.jsx)(`h3`,{id:`loop-start-h`,className:`loop-kicker`,children:`Start it in your project`}),(0,U.jsx)(b,{text:u,label:`Copy command`})]}),(0,U.jsx)(`pre`,{className:`mono`,children:u})]}),r?(0,U.jsxs)(`p`,{className:`panel-note loop-running`,children:[`Running now: `,d?`${d} of this template`:`none`,`.`,` `,d?(0,U.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,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,U.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,U.jsx)(`li`,{children:e},e))})]}):null,(0,U.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,U.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,U.jsx)(me,{name:e,brick:o.get(e),override:Z(n,e),on:i===e},e))})]})}function _e(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 ve({b:e}){let[t,n]=(0,C.useState)(!1),r=[[`effect`,$(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,U.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>$(``,e))],[`gate`,z(e)?$(`human`,z(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,U.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`reader-tags`,children:[(0,U.jsx)(`span`,{className:`tag acc`,children:`Brick`}),pe.bricks(e)]}),(0,U.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,U.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,U.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,U.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,U.jsxs)(C.Fragment,{children:[(0,U.jsx)(`dt`,{children:e}),(0,U.jsx)(`dd`,{children:t})]},e))}),(0,U.jsx)(`hr`,{className:`hr`}),(0,U.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,U.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,U.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:_e(e)}):(0,U.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,U.jsx)(x,{body:e.body})})]})}function ye({problems:e}){if(!e?.length)return null;let t=e.length;return(0,U.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,U.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,U.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,U.jsx)(`li`,{className:`mono`,children:e},e))})]})}var be={templates:{title:`No templates`,body:(0,U.jsxs)(U.Fragment,{children:[`Add one under `,(0,U.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]})},bricks:{title:`No bricks`,body:(0,U.jsxs)(U.Fragment,{children:[`Add one under `,(0,U.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]})},active:{title:`No loops yet`,body:(0,U.jsxs)(U.Fragment,{children:[`Start one with `,(0,U.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.`]})}},xe={templates:(0,U.jsxs)(U.Fragment,{children:[`A template wires bricks into a loop. `,(0,U.jsx)(`a`,{href:`#/docs/loops`,children:`How loops work →`}),` `,(0,U.jsx)(`a`,{href:`#/docs/loop-which-template`,children:`Which template? →`})]}),bricks:(0,U.jsxs)(U.Fragment,{children:[`A brick is one step: a skill or agent and its outcomes.`,` `,(0,U.jsx)(`a`,{href:`#/docs/loop-bricks`,children:`About bricks →`})]}),active:(0,U.jsxs)(U.Fragment,{children:[`Loops registered on this machine, read from their LOOP.md.`,` `,(0,U.jsx)(`a`,{href:`#/docs/loop-running`,children:`Running a loop →`})]})};function Se({tab:e=`templates`,item:t,dataRev:n}){let i=d(n),[o,m]=u(`loops`,i),{data:b,error:x}=l(()=>r.loops(f(o)),[n,o?.id??``],`loops`),S=re(),[w,T]=(0,C.useState)(``),[E,D]=(0,C.useState)(`all`),[O,k]=(0,C.useState)(e);e!==O&&(k(e),T(``),D(`all`));let A=b?.bricks||[],j=e===`active`?S.loops&&fe(S.loops):b&&(e===`bricks`?de(b.bricks,b.overridden):ue(b.templates,b.bricks)),M=j||[],N=g(M),P=E===`all`?M:M.filter(e=>e.group===E),F=w.trim(),I=_(P,F),L=!!(t&&j&&!M.some(e=>e.name===t)),R=L?null:M.find(e=>e.name===t)||e===`active`&&M.find(K)||M[0]||null,z={templates:b?.templates.length,bricks:b?.bricks.length,active:S.loops?.length},B=Y.find(([t])=>t===e)[1],V=e===`active`?S.error:x;return(0,U.jsxs)(U.Fragment,{children:[e===`active`?null:(0,U.jsx)(s,{className:`page-pick`,installs:i,value:o,onChange:m,label:`Templates and bricks of:`}),(0,U.jsx)(a,{error:V,style:{margin:`0 0 var(--sp-3)`}}),(0,U.jsx)(ye,{problems:b?.problems}),(0,U.jsxs)(`div`,{className:`library`,children:[(0,U.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,U.jsxs)(`div`,{className:`lib-title`,children:[(0,U.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,U.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,U.jsx)(`p`,{className:`panel-note lib-lede`,children:xe[e]}),(0,U.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:Y.map(([t,n])=>(0,U.jsxs)(C.Fragment,{children:[(0,U.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,U.jsx)(`span`,{className:`mono dim`,children:z[t]??``})]}),e===t&&(0,U.jsx)(y,{label:ce[t],total:M.length,cats:N,cat:E,onChange:D})]},t))})]}),(0,U.jsx)(h,{label:B,count:F?`${I.length} of ${P.length}`:j?P.length:``,q:w,onQ:T,matched:I.length,inView:[e,t],children:j?M.length===0?(0,U.jsx)(p,{title:be[e].title,children:be[e].body}):(0,U.jsx)(v,{rows:I,activeName:R?.name,hrefOf:t=>`#/loops/${e}/${J(t.name)}`,pills:pe[e]}):V?null:(0,U.jsx)(c,{})}),(0,U.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:L?(0,U.jsx)(p,{title:(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/loops/${e}`,label:`All ${B.toLowerCase()} →`}}):R?e===`active`?(0,U.jsx)(oe,{loop:R,bricks:A,onPreset:S.onPreset}):e===`bricks`?(0,U.jsx)(ve,{b:R}):(0,U.jsx)(ge,{t:R,bricks:A,overridden:b.overridden,runs:S.loops},R.name):e===`active`&&j?(0,U.jsx)(p,{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{fe as activeRows,de as brickRows,_e as brickSource,Se as default,he as howItRuns,ue as templateRows};
|