geneseed 6.0.1 → 6.0.3
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 +20 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +53 -10
- package/adapters/opencode/plugins/geneseed-learn.js +11 -4
- package/docs/concepts/agents.md +2 -2
- package/docs/web-ui.md +25 -0
- package/harness.config.json +1 -1
- package/js/README.md +2 -1
- package/js/build/bundle.mjs +2 -11
- package/js/build/emit-claude.mjs +2 -2
- package/js/build/emit-opencode.mjs +4 -2
- package/js/build/fold.mjs +3 -20
- package/js/build/source.mjs +1 -1
- package/js/build/stubs.mjs +42 -5
- package/js/cli-table.json +1 -1
- package/js/hosts/hooks-context.mjs +65 -9
- package/js/hosts/memory-files.mjs +166 -13
- package/js/hosts/native.mjs +48 -27
- package/js/hosts/opencode.mjs +3 -2
- package/js/inspect/checks-build.mjs +2 -2
- package/js/inspect/doctor.mjs +2 -0
- package/js/inspect/status.mjs +4 -1
- package/js/maintain/memory.mjs +2 -2
- package/js/web/agent-models-api.mjs +52 -17
- package/js/web/api.mjs +3 -0
- package/js/web/catalog.mjs +5 -3
- package/js/web/model-catalog.mjs +324 -0
- package/js/web/routes.mjs +5 -3
- package/package.json +1 -1
- package/src/agents/memory-curator.md +1 -1
- package/src/memory/README.md +24 -5
- package/src/skills/rule/approve.md +3 -1
- package/src/skills/rule/consolidate.md +1 -1
- package/web/dist/assets/ActiveLoops-paFbiZyt.js +1 -0
- package/web/dist/assets/Activity-IAxWF2wK.js +1 -0
- package/web/dist/assets/ActivityDetail-CtC2DLvh.js +1 -0
- package/web/dist/assets/{Bonsai-8NtlFrPO.js → Bonsai-BoKo68Kw.js} +1 -1
- package/web/dist/assets/{CopyButton-BHqKgdjJ.js → CopyButton-C0VTiqmb.js} +1 -1
- package/web/dist/assets/Dashboard-CRGCp2cV.js +2 -0
- package/web/dist/assets/{Docs-C1jzrFnD.js → Docs-DwOwzaD6.js} +2 -2
- package/web/dist/assets/Factories-DxHD2T-1.js +1 -0
- package/web/dist/assets/{GreenhouseView-ofAQ-V5h.js → GreenhouseView-D5VOmhmR.js} +1 -1
- package/web/dist/assets/Installs-B5hFSUeN.js +3 -0
- package/web/dist/assets/JournalView-gUSGysTm.js +1 -0
- package/web/dist/assets/{Kits-P4xspDuN.js → Kits-DYQvykZ0.js} +1 -1
- package/web/dist/assets/Laws-UVk0uojS.js +4 -0
- package/web/dist/assets/{LibRows-CGO25X3D.js → LibRows-CwK63kjB.js} +1 -1
- package/web/dist/assets/Library-DdzyrwUK.js +3 -0
- package/web/dist/assets/Loops-yHga7xdr.js +2 -0
- package/web/dist/assets/Models-DAgkQ4CE.js +1 -0
- package/web/dist/assets/{OperatorHudView-Cc8mlViW.js → OperatorHudView-D1lQF-ZY.js} +1 -1
- package/web/dist/assets/Personal-DjhIfa9v.js +2 -0
- package/web/dist/assets/Settings-Brgec4M0.js +1 -0
- package/web/dist/assets/Tabs-BHjxciOL.js +1 -0
- package/web/dist/assets/api-C8nMUU1i.js +1 -0
- package/web/dist/assets/index-BILaKHbH.js +6 -0
- package/web/dist/assets/index-BfyZCNu7.css +1 -0
- package/web/dist/assets/router-1EhRJy1C.js +1 -0
- package/web/dist/assets/useLocalStorage-54tkqXN7.js +1 -0
- package/web/dist/index.html +5 -3
- package/web/dist/assets/ActiveLoops-6p44eD86.js +0 -1
- package/web/dist/assets/Activity-CIgrq5R1.js +0 -1
- package/web/dist/assets/ActivityDetail-Brqv1u4f.js +0 -1
- package/web/dist/assets/Dashboard-CoveJ_-U.js +0 -2
- package/web/dist/assets/Factories-D5pLnt5S.js +0 -1
- package/web/dist/assets/Installs-DpWgyT5j.js +0 -3
- package/web/dist/assets/JournalView-CsuN3_B-.js +0 -1
- package/web/dist/assets/Laws-DK3OwGDl.js +0 -4
- package/web/dist/assets/Library-e-94YED6.js +0 -3
- package/web/dist/assets/Loops-C9DSBj-A.js +0 -2
- package/web/dist/assets/Personal-DVh2jYPO.js +0 -2
- package/web/dist/assets/Settings-CknBI-Fx.js +0 -1
- package/web/dist/assets/Tabs-C30JrkJH.js +0 -1
- package/web/dist/assets/api-DxwG8y94.js +0 -1
- package/web/dist/assets/index-CUJ8AaAF.css +0 -1
- package/web/dist/assets/index-MB7E-va_.js +0 -6
- package/web/dist/assets/usePoll-D5c_qIFZ.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-ofAQ-V5h.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/index-MB7E-va_.js","assets/api-DxwG8y94.js","assets/motion-RlUl1osO.js","assets/sections-CtFz7HFH.js","assets/index-CUJ8AaAF.css","assets/OperatorHudView-Cc8mlViW.js","assets/JournalView-CsuN3_B-.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-DxwG8y94.js";import{n as a,r as o}from"./sections-CtFz7HFH.js";import{$ as s,L as c,Ot as l,R as u,St as d,V as f,X as p,_t as m,a as h,bt as g,et as _,rt as v,t as y,tt as b,vt as x,wt as S,xt as C}from"./index-MB7E-va_.js";import{o as w,t as T}from"./motion-RlUl1osO.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),A={done:`ok`,failed:`bad`},j={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},M=e=>typeof e==`number`&&Number.isFinite(e);function ee(e){let t=[];for(let n of e){let e=c(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(M(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:[M(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=d(e.newest),n=e.oldest?d(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=u(e,t),i=Math.max(0,...r.map(e=>M(e.duration)?e.duration:0))||1,a=ee(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(M),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${A[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:j[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`,unknown:``};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=S(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=x(e.diff),a=e.counts||{},o=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[o.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(T,{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:()=>l(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(T,{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:o.map((t,n)=>{let r=a[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)(m,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(T,{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=u(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[d(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=w(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(f,{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 s=O(e,i?.tone),c=C(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:c}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:s}),(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:[o.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=a[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(`in sync`)?{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=g(e.counts),s=n?.version_verdict||``,c=U(s),l=x(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}),c&&(0,k.jsxs)(`span`,{className:`badge ${c.tone}`,title:s,children:[(0,k.jsx)(`span`,{className:`dot`}),c.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),o.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=o.reduce((t,n)=>t+(e.counts?.[n]??0),0),s=g(e.counts),c=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=x(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:c?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.doctor===null?`checking`:`${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:o.map(t=>{let n=a[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/s*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=S(()=>q(()=>i.fleet()),[e]),r=S(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?h(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)(()=>y(()=>import(`./GreenhouseView-ofAQ-V5h.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>y(()=>import(`./OperatorHudView-Cc8mlViW.js`),__vite__mapDeps([8,1,2,3,4,5,6,7]))),Q=(0,E.lazy)(()=>y(()=>import(`./JournalView-CsuN3_B-.js`),__vite__mapDeps([9,1,2,3,4,5,6,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:c,layout:l=`genome`,dataRev:u}){let d=l,[f,m]=(0,E.useState)(`status`),[h,g]=(0,E.useState)(d);h!==d&&(g(d),m(`status`));let y=e&&r.find(t=>t.name===e.theme)?.sigil||``,x=J({dataRev:u,needDoctor:d===`greenhouse`||d===`hud`}),{data:C}=S(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,u]);if(!e)return t?(0,k.jsx)(_,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(b,{});let w=e.daemon_stale?(0,k.jsx)(s,{}):null;return e.deployed?(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(v,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`readout`,`Readout`]].map(([e,t])=>(0,k.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>m(e),"aria-pressed":f===e,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`genome`&&(0,k.jsx)(V,{overview:e,sigil:y,setup:a,jobs:o,lens:x,dataRev:u}),f===`status`&&d===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(b,{}),children:(0,k.jsx)(X,{overview:e,sigil:y,jobs:o,lens:x,onAction:c})}),f===`status`&&d===`hud`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(b,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:x})}),f===`status`&&d===`journal`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(b,{}),children:(0,k.jsx)(Q,{overview:e,recent:C,lens:x,dataRev:u})}),f===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:y,setup:a,jobs:o,lens:x}),f===`readout`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:x})]},f)]}):(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(p,{onAction:c})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
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-DxwG8y94.js";import{Dt as i,Et as a,J as o,Y as s,et as c,ht as l,mt as u,nt as ee,tt as d,wt as f}from"./index-MB7E-va_.js";import{n as p,t as m}from"./usePoll-D5c_qIFZ.js";import{t as h}from"./EmptyState-CY5Pm2xy.js";import{t as g}from"./CopyButton-BHqKgdjJ.js";import{t as _}from"./DataTable-b9zTShqJ.js";import{a as v,n as y,s as b}from"./ActiveLoops-6p44eD86.js";import{a as x,i as te,n as ne,o as S,s as C}from"./LibRows-CGO25X3D.js";var w=e(t(),1),T=24,E=48,re=16,ie=92,ae=8,oe=16,D=22,O=14,se=14,k=15,ce=4,A=7.2,j={brick:{w:200,h:48},fork:{w:200,h:48},loop:{w:200,h:56},lane:{w:150,h:56},close:{w:96,h:34},stop:{w:76,h:34}},M=`loop:`,le=new Set([`$close`,`$stop`,`$lane`]),N=(e,t)=>{if(!e?.name)return`↺ route back`;let n=t?`${t[e.name]??0} / ${e.max??`?`}`:`max ${e.max??`?`}`;return`↺ ${e.name} · ${n}`};function ue(e,t,n,r){let i=null;for(let a of e)Array.isArray(a?.nodes)&&a.nodes[0]===n&&(a.nodes.includes(t)||a.nodes.includes(`$lane`)&&r.has(t))&&(!i||a.nodes.length<i.nodes.length)&&(i=a);return i}var de=new Set([`pass`,`fail`,`error`,`none`,`needs-info`,`reject`]);function fe(e,t=[]){let n=new Set(Array.isArray(e.stages)?e.stages:[]),r=(e.cycles||[]).filter(e=>Array.isArray(e?.nodes)),i=e=>r.some(t=>t.nodes[0]===e.to&&t.nodes.includes(e.from)),a=new Map((Array.isArray(t)?t:[]).map(e=>[e?.name,e])),o=(e.edges||[]).filter(e=>n.has(e?.from)),s=e=>(a.has(e)?a.get(e)?.outcomes||[]:o.filter(t=>t.from===e).map(e=>e.on)).some(e=>!de.has(e)),c=new Map;for(let e of o)n.has(e.to)&&!i(e)&&!e.from.startsWith(M)&&s(e.from)&&(c.has(e.from)||c.set(e.from,[]),c.get(e.from).includes(e.to)||c.get(e.from).push(e.to));return c}function P(e,t,n=[]){let r=fe(e,n);for(let n of[...Array.isArray(t)?t:[]].reverse()){if(!r.has(n?.stage)||!n.outcome)continue;let t=(e.edges||[]).find(e=>e.from===n.stage&&e.on===n.outcome);if(t&&r.get(n.stage).includes(t.to))return t.to}return null}function F(e,t=[],n={}){let r=n.width>0?Math.floor(n.width):1/0,i=[{rails:!0,stack:!1},{rails:!1,stack:!1},{rails:!0,stack:!0},{rails:!1,stack:!0}];for(let a of i){let o=pe(e,t,a,r,n.lane);if(o.width<=r||a===i.at(-1))return o}}function pe(e,t,n,r,i){let a=Array.isArray(e.stages)?e.stages:[],o=new Set(a),s=(Array.isArray(e.edges)?e.edges:[]).filter(e=>typeof e?.from==`string`&&typeof e?.to==`string`&&o.has(e.from)&&(o.has(e.to)||le.has(e.to))),c=(Array.isArray(e.cycles)?e.cycles:[]).filter(e=>Array.isArray(e?.nodes)),l=new Map(t.map(e=>[e.name,e])),u=fe(e,t),ee=new Set([...u.values()].flat()),d=e=>ue(c,e.from,e.to,ee),f=new Map(o.has(e.start)?[[e.start,0]]:[]),p=s.filter(e=>o.has(e.to)&&!d(e));for(let e=0;e<a.length;e++){let e=!1;for(let t of p){if(!f.has(t.from))continue;let n=f.get(t.from)+1;f.get(t.to)>=n||(f.set(t.to,n),e=!0)}if(!e)break}let m=Math.max(-1,...f.values());for(let e of a)f.has(e)||f.set(e,++m);let h=m+1,g=[];for(let e of a)(g[f.get(e)]||=[]).push(e);let _=e=>g[f.get(e)].length>1,v=n.rails?T:oe,y=n.rails?re:ae,x=r===1/0?1/0:r-2*v,te=()=>Math.max(j.lane.w,Math.min(240,x-28)),ne=e=>n.rails?j.lane.w:Math.max(ie,Math.min(j.lane.w,Math.floor((x-y*(e-1))/e))),S=a.map(e=>{let t=_(e),n=e.startsWith(M)?e.slice(5):null,r=n?`loop`:u.has(e)?`fork`:`brick`;return{id:e,kind:r,...t?{w:ne(g[f.get(e)].length),h:j.lane.h}:{...j[r]||j.brick},rank:f.get(e),lane:t,stacked:!1,loop:n,human:r===`brick`||r===`fork`?b(l.get(e)):null,tags:[]}}),C=new Map(S.map(e=>[e.id,e])),w=s.some(e=>e.to===`$close`);if(w){let e={id:`$close`,kind:`close`,...j.close,rank:h,tags:[]};S.push(e),C.set(`$close`,e),g[h]=[`$close`]}let de=e=>{let t=null;for(let n of u.keys())f.get(n)<f.get(e)&&(!t||f.get(n)>f.get(t))&&(t=n);return t},P=new Map;for(let e of s){let t=`${e.from}\u0000${e.to}`;if(P.has(t))P.get(t).on.push(e.on);else{let n=d(e),r=e.to===`$lane`?u.get(de(e.from))?.[0]:e.to;if(e.to!==`$stop`&&!C.has(r))continue;let i=e.to===`$stop`?0:C.get(r).rank-f.get(e.from),a=e.to===`$stop`?`stop`:n?`back`:i===1?`flow`:`skip`;P.set(t,{from:e.from,to:e.to,target:r,on:[e.on],kind:a,back:!!n,cycle:n?.name??null,cycleDef:n,span:i})}}let F=[...P.values()],pe=F.filter(e=>e.kind===`back`||e.kind===`skip`),I=F.filter(e=>e.kind===`stop`&&_(e.from)),me=n.rails?I:[...pe,...F.filter(e=>e.kind===`stop`&&!_(e.from)),...I];for(let e of me)C.get(e.from).tags.push({kind:e.kind,on:e.on,to:e.to,cycle:e.cycle});let he=(e,t)=>e.kind===`back`?N(t.cycleDef):`${e.on.join(` · `)} → ${e.kind===`stop`?`stop`:e.to}`,ge=e=>Math.max(0,...e.tags.map(t=>he(t,F.find(n=>n.from===e.id&&n.to===t.to)).length*A)),L=g.map(e=>(e||[]).map(e=>C.get(e))),R=e=>e.reduce((e,t)=>e+t.w,0)+y*(e.length-1),z=L.map(e=>n.stack&&e.length>1&&R(e)>x);L.forEach((e,t)=>{if(z[t])for(let t of e)Object.assign(t,{stacked:!0,w:te()})});let B=(e,t)=>z[t]?Math.max(...e.map(e=>e.w))+28:R(e),V=Math.max(j.brick.w,...L.map((e,t)=>e.length?B(e,t):0)),H=T,U=[];L.forEach((e,t)=>{if(!e.length)return;let n=(V-B(e,t))/2;if(z[t]){for(let t of e)Object.assign(t,{x:(V-t.w)/2,y:H}),H+=t.h+t.tags.length*k+D;H-=D}else{for(let t of e)Object.assign(t,{x:n,y:H}),n+=t.w+y;H+=Math.max(...e.map(e=>e.h)),H+=Math.max(0,...e.map(e=>e.tags.length))*k}U[t]=H+E/2,H+=E});let W=H-E,G=n.rails?pe.sort((e,t)=>Math.abs(t.span)-Math.abs(e.span)):[],K=e=>28+e*se,q=e=>e.back?N(e.cycleDef):e.on.join(` · `),J=G.length?K(G.length-1)+12:v;G.forEach((e,t)=>{J=Math.max(J,K(t)+8+q(e).length*A-C.get(e.from).x)});for(let e of S)e.x+=J;let Y=n.rails?F.filter(e=>e.kind===`stop`&&!_(e.from)):[],X=J+V+24;for(let e of Y){let t=C.get(e.from);X=Math.max(X,t.x+t.w+10+e.on.join(` · `).length*A)}let _e=Math.max(0,...S.filter(e=>e.tags.length).map(e=>e.x+e.w/2+6+ge(e))),Z=Math.max(J+V,_e)+v;if(Y.length){X=Math.max(X,_e+10);let e=w?C.get(`$close`).y:W-j.stop.h,t={id:`$stop`,kind:`stop`,...j.stop,x:X-j.stop.w/2,y:e,rank:h,tags:[]};S.push(t),C.set(`$stop`,t),Z=X+j.stop.w/2+T}let Q=e=>e.x+e.w/2,$=e=>e.y+e.h/2,ve=e=>e.y+e.h,ye=e=>e.x-O,be=e=>e.x+e.w+O,xe=new Map;for(let e of F)e.kind===`flow`&&xe.set(e.target,(xe.get(e.target)||0)+1);let Se=e=>e.to===`$lane`&&C.get(i)?.stacked&&u.get(de(e.from))?.includes(i)?C.get(i):C.get(e.target),Ce=new Map;for(let e of G){let t=Se(e).id;Ce.set(t,(Ce.get(t)||0)+1)}let we=new Map,Te=F.map(e=>{let t=C.get(e.from),n=Se(e),r={from:e.from,to:e.to,on:e.on,kind:e.kind,back:e.back,cycle:e.cycle};if(e.kind===`stop`){if(!Y.includes(e))return{...r,path:null};let n=C.get(`$stop`);return{...r,path:`M${t.x+t.w},${$(t)} H${X} V${n.y}`,lx:t.x+t.w+6,ly:$(t)-6,anchor:`start`}}if(e.kind===`back`||e.kind===`skip`){let i=G.indexOf(e);if(i<0)return{...r,path:null};let a=we.get(n.id)||0;we.set(n.id,a+1);let o=Math.ceil((Ce.get(n.id)-1)/2),s=o?Math.min(10,(n.h/2-ce)/o):10,c=$(n)+(a%2?1:-1)*Math.ceil(a/2)*s;return{...r,path:`M${t.x},${$(t)} H${K(i)} V${c} H${n.x}`,lx:K(i)+6,ly:$(t)-6,anchor:`start`}}let i=U[t.rank],a=t.stacked?`M${t.x+t.w},${$(t)} H${be(t)} V${i}`:`M${Q(t)},${ve(t)} V${i}`,o=n.stacked?` H${ye(n)} V${$(n)} H${n.x}`:` H${Q(n)} V${n.y}`,s=e.on.length===1&&e.on[0]===`pass`,c=(xe.get(n.id)||0)>1?{lx:t.stacked?be(t)+4:Q(t)+6,ly:t.stacked?$(t)-4:ve(t)+13}:n.stacked?{lx:n.x,ly:n.y-5}:{lx:Q(n)+6,ly:n.y-8};return{...r,path:a+o,...c,anchor:`start`,plain:s}});return{width:Math.ceil(Z),height:Math.ceil(W+T),mode:n.rails?`rails`:`tags`,stacked:z.some(Boolean),nodes:S,edges:Te}}var I=n(),me=20;function he({factory:e,bricks:t=[],loops:n=[],onSelect:r,highlight:i,child:a,counters:o,lane:s,history:c}){let l=(0,w.useRef)(null),[u,ee]=(0,w.useState)(0);(0,w.useLayoutEffect)(()=>{let e=l.current;if(!e)return;let t=()=>ee(t=>Math.abs(e.clientWidth-t)>me?e.clientWidth:t);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let d=s===void 0?P(e,c,t):s,f=F(e,t,{width:u,lane:d}),p=new Set(n.map(e=>e.name)),m=new Map((e.cycles||[]).map(e=>[e.name,e])),h=new Set(f.nodes.filter(e=>e.kind===`fork`).map(e=>e.id)),g=e=>e.kind===`back`?N(m.get(e.cycle),o):`${e.on.join(` · `)} → ${e.kind===`stop`?`stop`:e.to}`,_=e=>e.kind===`loop`?`${e.id} stage, the ${e.loop} loop`:`${e.id} ${e.kind===`fork`?`fork`:`brick`}${e.human?`, ${e.human.toLowerCase()}`:``}`,y=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r?.(e))},b=e=>{let t=e.id===i,n=`${_(e)}${e.id===d?`, the lane taken`:``}`,o=t&&a&&(e.loop||e.lane)?`, at ${a.node}`:``;return r?{role:`button`,tabIndex:0,"aria-label":`${n}${o}`,onClick:y(e.id),onKeyDown:y(e.id)}:{role:`img`,"aria-label":`${n}${t?`, current stage`:``}${o}`}},x=e=>`fg-node ${e.kind}${e.lane?` lane`:``}${e.id===i?` current`:``}${e.id===d?` taken`:``}`,te=e=>d&&(e.to===d||e.from===d),ne=e=>e.tags.map((t,n)=>(0,I.jsx)(`text`,{x:e.x+e.w/2+6,y:e.y+e.h+12+n*15,className:`fg-lbl fg-tag ${t.kind}`,children:g(t)},`${t.kind}${t.to}`));return(0,I.jsxs)(`div`,{className:`fg-wrap`,ref:l,children:[(0,I.jsxs)(`svg`,{className:`fgraph`,"data-mode":`${f.mode}${f.stacked?` stacked`:``}`,style:{"--fg-w":`${f.width}px`},viewBox:`0 0 ${f.width} ${f.height}`,role:`group`,"aria-label":`${e.name} factory: ${(e.stages||[]).join(`, `)}`,children:[(0,I.jsx)(`defs`,{children:[`flow`,`back`,`stop`].map(e=>(0,I.jsx)(`marker`,{id:`fg-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`fg-head-${e}`})},e))}),f.edges.map(e=>{if(!e.path)return null;let t=e.kind===`skip`?`flow`:e.kind,n=e.back?N(m.get(e.cycle),o):e.kind===`flow`&&e.plain?``:e.on.join(` · `);return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`path`,{d:e.path,className:`fg-edge ${e.kind}${te(e)&&e.kind===`flow`?` taken`:``}`,markerEnd:`url(#fg-arrow-${t})`}),n?(0,I.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`fg-lbl ${e.kind}${e.kind===`flow`&&h.has(e.from)?` fork`:``}`,children:n}):null]},`${e.from}>${e.to}`)}),f.nodes.map(e=>{if(e.kind===`close`||e.kind===`stop`)return(0,I.jsxs)(`g`,{className:`fg-${e.kind}`,role:`img`,"aria-label":e.kind,children:[(0,I.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.h/2}),(0,I.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+4,textAnchor:`middle`,children:e.kind})]},e.id);let t=e.id===i?`step`:void 0,n=a&&e.id===i?a:null,r=n&&(e.loop||e.lane)?`at ${n.node}`:e.loop?p.has(e.loop)?`whole loop`:`not in catalogue`:e.lane?`no loop`:null;return(0,I.jsxs)(`g`,{children:[(0,I.jsxs)(`g`,{className:x(e),"aria-current":t,...b(e),children:[e.lane||e.loop?(0,I.jsx)(`title`,{children:e.id}):null,(0,I.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:`10`}),(0,I.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+(r?-2:4),textAnchor:`middle`,children:e.loop||e.id}),r?(0,I.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+14,textAnchor:`middle`,className:`fg-sub`,children:r}):null,e.human?(0,I.jsx)(v,{x:e.x+e.w-4,y:e.y+4,label:e.human}):null]}),ne(e)]},e.id)})]}),(0,I.jsx)(`ul`,{className:`fg-legend`,"aria-label":`Graph legend`,children:[[`brick`,`brick`],[`loop`,`whole loop (test · fix · verify)`],[`fork`,`fork`],[`back`,`route back, bounded by its max`],[`stop`,`fail → stop`]].map(([e,t])=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`span`,{className:`fg-key ${e}`,"aria-hidden":`true`}),t]},e))})]})}var ge=encodeURIComponent,L=5e3,R=a.factories.map(e=>[e,i[e]]),z={project:`Project`,global:`Global`,shipped:`Shipped`},B={templates:`Origins`,active:`Statuses`},V=[[`wait`,`Waits for you`,[`awaiting`,`unreadable`]],[`run`,`Running`,[`running`]],[`end`,`Ended`,[`stopped`,`done`,`finished`]]],H=V.flatMap(([,e,t])=>t.map(t=>[t,e])),U=e=>!!e.graph,W=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r}))),G=e=>W(e.map(e=>({...e,desc:e.description})),e=>e.origin,Object.entries(z)),K=e=>W(e.map(e=>({...e,name:e.root,desc:e.factory,meta:U(e)?Y(e).join(` · `):void 0})),e=>e.status,H);function q(e){if(e==null)return`unknown`;let t=Math.round(e/1e3);if(t<60)return`${t} s`;let n=Math.round(t/60);return n<60?`${n} min`:`${Math.floor(n/60)} h ${String(n%60).padStart(2,`0`)} min`}var J=e=>`${e.slice(0,16).replace(`T`,` `)} UTC`;function Y(e){if(e.status===`unreadable`)return[`Its FACTORY.md cannot be read.`];if(e.status===`finished`)return[`Its FACTORY.md is gone: the run closed.`];let t=e.tasks,n=e.metrics;return[e.awaiting?`${e.awaiting.stage} · ${e.awaiting.outcome}`:e.status===`stopped`?`stopped: ${e.reason}`:e.status===`done`?`closed`:e.stage,t?`task ${t.index}/${t.count}`:null,n?`work ${q(n.workMs)}`:null,n?.openWaitMs==null?null:`waiting ${q(n.openWaitMs)}`,...(e.graph?.cycles||[]).filter(t=>e.counters?.[t.name]>0).map(t=>`${t.name} ${e.counters[t.name]}/${t.max}`)].filter(Boolean)}function X({runs:e}){return(0,I.jsx)(`section`,{className:`fac-board`,"aria-label":`Runs board`,children:V.map(([t,n,r])=>{let i=e.filter(e=>r.includes(e.status));return(0,I.jsxs)(`div`,{className:`fac-col ${t}`,role:`group`,"aria-label":n,children:[(0,I.jsxs)(`h3`,{className:`loop-kicker`,children:[n,` `,(0,I.jsx)(`span`,{className:`mono dim`,children:i.length})]}),i.length?(0,I.jsx)(`ul`,{children:i.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsxs)(`a`,{className:`fac-card`,href:`#/factories/active/${ge(e.root)}`,children:[(0,I.jsx)(`b`,{children:e.title}),(0,I.jsx)(`span`,{className:`mono`,children:e.factory}),(0,I.jsx)(`span`,{children:Y(e).join(` · `)})]})},e.root))}):(0,I.jsx)(`p`,{className:`panel-note`,children:`None.`})]},t)})})}function _e({run:e}){if(!e.history?.length)return null;let t=e.metrics,n=e.history.map((e,n)=>({i:n,h:e,e:t?.entries?.[n]||{}}));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Timeline`}),(0,I.jsx)(_,{caption:`Run history`,captionHidden:!0,rowKey:e=>e.i,rows:n,columns:[{key:`stage`,label:`Stage`,render:e=>e.h.stage},{key:`result`,label:`Result`,render:e=>e.h.verdict?`you answered ${e.h.verdict}`:(0,I.jsxs)(I.Fragment,{children:[e.h.outcome,` `,e.e.rework?(0,I.jsx)(`span`,{className:`tag warn`,children:`rework`}):null]})},{key:`at`,label:`Time`,render:e=>typeof e.h.at==`string`?(0,I.jsx)(`time`,{dateTime:e.h.at,children:J(e.h.at)}):`unknown`},{key:`ms`,label:`Duration`,render:e=>`${q(e.e.ms)}${e.e.wait?` waiting`:``}`}]}),t?(0,I.jsxs)(`p`,{className:`panel-note fac-totals`,children:[`Work `,q(t.workMs),` · waited `,q(t.waitMs),t.openWaitMs==null?``:` · waiting ${q(t.openWaitMs)}`,` · tokens`,` `,t.tokens??`unknown`]}):null]})}var Z=(e,t)=>(0,I.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),Q={templates:e=>Z(``,e.origin),active:e=>Z(y[e.status],e.status)},$=he;function ve({factory:e,counters:t}){return e.cycles?.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Routes back`}),(0,I.jsx)(`ul`,{className:`fac-cycles`,"aria-label":`Cycles`,children:e.cycles.map(e=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`b`,{children:e.name}),`: `,e.nodes.join(` → `),` —`,` `,t?`lap ${t[e.name]??0} of ${e.max}`:`${e.max} laps at most`]},e.name))})]}):null}function ye({f:e,bricks:t,loops:n}){let r=`Run the ${e.name} factory on <issue URL, file or request>`,i=[`git worktree add ../<repo>-factory-<slug> -b loop/factory-<slug>`,`cd ../<repo>-factory-<slug>`,`geneseed factory init --factory ${e.name} --title "<title>" --requirement "<requirement>" --input "<issue URL, file path or pasted text>"`].join(` && `);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Factory`}),Z(``,e.origin)]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,I.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[`factories/`,e.name,`.json · `,e.origin]}),(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)($,{factory:e.factory,bricks:t,loops:n}),(0,I.jsx)(ve,{factory:e.factory}),(0,I.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`fac-start-h`,children:[(0,I.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,I.jsx)(`h3`,{id:`fac-start-h`,className:`loop-kicker`,children:`Start it: ask the agent`}),(0,I.jsx)(g,{text:r,label:`Copy request`})]}),(0,I.jsx)(`pre`,{className:`mono`,children:r}),(0,I.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,I.jsx)(`h3`,{className:`loop-kicker`,children:`Or by hand, in a new worktree`}),(0,I.jsx)(g,{text:i,label:`Copy command`})]}),(0,I.jsx)(`pre`,{className:`mono`,children:i})]}),(0,I.jsxs)(`p`,{className:`panel-note`,children:[(0,I.jsx)(`code`,{className:`mono`,children:`init`}),` only registers the run: an agent then drives`,` `,(0,I.jsx)(`code`,{className:`mono`,children:`geneseed factory next`}),` and `,(0,I.jsx)(`code`,{className:`mono`,children:`record`}),`.`]}),e.factory.rules?.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,I.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every stage follows`,children:e.factory.rules.map(e=>(0,I.jsx)(`li`,{children:e},e))})]}):null]})}function be({run:e,bricks:t,loops:n,from:r}){let i=e.tasks;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`panel-note`,children:(0,I.jsx)(`a`,{href:`#/factories/active`,children:`← All runs`})}),(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Factory run`}),(0,I.jsx)(`span`,{className:`tag${y[e.status]?` ${y[e.status]}`:``}`,children:e.status})]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.factory,` · `,e.branch,` · `,e.root]}),U(e)?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`reader-lede`,children:[`At `,e.stage,` · `,e.transitions,` transitions`,i?` · task ${i.index} / ${i.count}`:``,e.loop?` · loop at ${e.loop.node}, iteration ${e.loop.iteration}`:``]}),e.awaiting?(0,I.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,I.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind??`you`,e.awaiting.stage?` at ${e.awaiting.stage} (${e.awaiting.outcome})`:``]}),` `,`— Answer in the agent's session.`,e.awaiting.note?(0,I.jsxs)(I.Fragment,{children:[` `,`Its note: `,(0,I.jsx)(`code`,{className:`mono`,children:e.awaiting.note})]}):null]}):null,e.reason?(0,I.jsx)(`p`,{className:`panel-note`,children:e.reason}):null,(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)($,{factory:e.graph,bricks:t,loops:n,highlight:e.stage,child:e.loop,counters:e.counters,lane:e.lane,history:e.history}),(0,I.jsx)(ve,{factory:e.graph,counters:e.counters}),(0,I.jsx)(_e,{run:e}),(0,I.jsxs)(`p`,{className:`panel-note`,children:[`Bricks and loops drawn from the catalogue of `,r||`the default install`,`, which the run’s project may not share.`]})]}):(0,I.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its FACTORY.md cannot be read, so there is no state to show.`:`Its FACTORY.md is gone: the run closed and its state went with it.`})]})}function xe({problems:e}){if(!e?.length)return null;let t=e.length;return(0,I.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,I.jsxs)(`b`,{className:`t-warn`,children:[t,` factory `,t===1?`problem`:`problems`,`: these factories cannot run as they are`]}),(0,I.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,I.jsx)(`li`,{className:`mono`,children:e},e))})]})}var Se={templates:{title:`No factories`,body:(0,I.jsxs)(I.Fragment,{children:[`Add one under `,(0,I.jsx)(`code`,{className:`mono`,children:`.geneseed/factories/`}),` in the repo.`]})},active:{title:`No runs yet`,body:(0,I.jsxs)(I.Fragment,{children:[`Ask the agent to run a factory, or start one by hand in a worktree with`,` `,(0,I.jsx)(`code`,{className:`mono`,children:`geneseed factory init`}),`. It shows up here while it runs.`]})}},Ce={templates:(0,I.jsxs)(I.Fragment,{children:[`A factory carries one work item through bricks and loops to an open PR.`,` `,(0,I.jsx)(`a`,{href:`#/docs/factories`,children:`How factories work →`})]}),active:(0,I.jsxs)(I.Fragment,{children:[`Factory runs registered on this machine, read from their FACTORY.md: the ones that wait for you first. A card opens its timeline. `,(0,I.jsx)(`a`,{href:`#/docs/run-a-factory`,children:`Run a factory →`})]})};function we(){let[e,t]=(0,w.useState)(null),[n,i]=(0,w.useState)(null);return p(e=>r.activeFactories().then(n=>e()&&(t(m(n)),i(null)),t=>e()&&i(t.message)),L,[]),{runs:e?e.factories||[]:null,error:n}}function Te({tab:e=`templates`,item:t,dataRev:n}){let i=s(n),[a,p]=o(`factories`,i),{data:m,error:g}=f(()=>r.factories(l(a)),[n,a?.id??``],`factories`),{runs:_,error:v}=we(),[y,b]=(0,w.useState)(``),[T,E]=(0,w.useState)(`all`),[re,ie]=(0,w.useState)(e);e!==re&&(ie(e),b(``),E(`all`));let ae=m?.bricks||[],oe=m?.loops||[],D=e===`active`?_&&K(_):m&&G(m.factories||[]),O=D||[],se=C(O),k=T===`all`?O:O.filter(e=>e.group===T),ce=y.trim(),A=x(k,ce),j=!!(t&&D&&!O.some(e=>e.name===t)),M=j?null:O.find(e=>e.name===t)||(e===`active`?null:O[0])||null,le={templates:m?.factories?.length,active:_?.length},N=R.find(([t])=>t===e)[1],ue=e===`active`?v:g;return(0,I.jsxs)(`div`,{className:`lib-wrap`,children:[e===`active`?null:(0,I.jsx)(ee,{className:`page-pick`,installs:i,value:a,onChange:p}),(0,I.jsx)(c,{error:ue,style:{margin:`0 0 var(--sp-3)`}}),(0,I.jsx)(xe,{problems:m?.problems}),(0,I.jsxs)(`div`,{className:`library`,children:[(0,I.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Factories sections`,children:[(0,I.jsxs)(`div`,{className:`lib-title`,children:[(0,I.jsx)(`h1`,{className:`h`,children:`Factories`}),(0,I.jsx)(`span`,{className:`dim`,children:`Work items, carried to a PR`})]}),(0,I.jsx)(`p`,{className:`panel-note lib-lede`,children:Ce[e]}),(0,I.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:R.map(([t,n])=>(0,I.jsxs)(w.Fragment,{children:[(0,I.jsxs)(`a`,{href:`#/factories/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,I.jsx)(`span`,{className:`mono dim`,children:le[t]??``})]}),e===t&&(0,I.jsx)(S,{label:B[t],total:O.length,cats:se,cat:T,onChange:E})]},t))})]}),(0,I.jsx)(te,{label:N,count:ce?`${A.length} of ${k.length}`:D?k.length:``,q:y,onQ:b,matched:A.length,inView:[e,t],current:M?M.title||M.name:void 0,sections:R.map(([t,n])=>({key:t,label:n,n:le[t],href:`#/factories/${t}`,on:e===t})),cats:se,cat:T,total:O.length,onCat:E,catLabel:B[e],children:D?O.length===0?(0,I.jsx)(h,{title:Se[e].title,children:Se[e].body}):(0,I.jsx)(ne,{rows:A,activeName:M?.name,hrefOf:t=>`#/factories/${e}/${ge(t.name)}`,pills:Q[e]}):ue?null:(0,I.jsx)(d,{})}),(0,I.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:j?(0,I.jsx)(h,{title:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/factories/${e}`,label:`All ${N.toLowerCase()} →`}}):M?e===`active`?(0,I.jsx)(be,{run:M,bricks:ae,loops:oe,from:a?u(a):null}):(0,I.jsx)(ye,{f:M,bricks:ae,loops:oe},M.name):e===`active`&&D&&O.length?(0,I.jsx)(X,{runs:A}):e===`active`&&D?(0,I.jsx)(h,{title:`What is a factory?`,docs:{href:`#/docs/factories`,label:`How factories work →`},children:`A factory runs stages, bricks and whole loops, until the work is an open PR.`}):null})]})]})}export{V as COLUMNS,Y as cardFacts,Te as default,G as factoryRows,q as fmtMs,K as runRows};
|
|
@@ -1,3 +0,0 @@
|
|
|
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"./Tabs-C30JrkJH.js";import{B as i,G as a,H as o,J as s,K as c,Y as l,_t as u,at as d,et as f,ft as p,gt as m,ht as h,lt as g,nt as _,pt as v,rt as y,tt as b,vt as x,wt as S,yt as C}from"./index-MB7E-va_.js";import{t as w}from"./api-DxwG8y94.js";import{t as T}from"./EmptyState-CY5Pm2xy.js";import{i as E,n as D,r as O,t as k}from"./controls-CK7qHA8H.js";var A=e(t(),1),j=n();function M({host:e,theme:t,options:n,onAction:r,onClose:i,onNote:a}){let[o,s]=(0,A.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[c,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(``),f=(e,t)=>s(n=>({...n,[e]:t})),m=async()=>{l(!0),a(``);try{let e=await w.pickFolder();e.path?(f(`path`,e.path),d(``)):e.error&&a(e.error)}catch(e){a(e.message)}finally{l(!1)}},h=async()=>{let e=o.path.trim();e?(d(``),a(``),await r?.(`deploy`,{host:o.host,path:e,theme:o.theme,footprint:o.footprint,posture:o.posture,mode:o.mode,trust:o.trust})&&i()):d(`Choose or type a folder to deploy into.`)};return(0,j.jsxs)(`div`,{className:`deploy-pop`,children:[(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:o.path,onChange:e=>{f(`path`,e.target.value),d(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":u?!0:void 0,"aria-describedby":u?`dp-path-err`:void 0}),(0,j.jsx)(`button`,{className:`btn ghost sm`,disabled:c,onClick:m,children:c?`Choosing…`:`Browse…`})]}),u?(0,j.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:u}):null,(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsxs)(`label`,{className:`dp-field`,children:[(0,j.jsx)(`span`,{children:`Deploy as`}),(0,j.jsx)(`select`,{className:`sel`,"aria-label":`host for the new install`,value:o.host,onChange:e=>f(`host`,e.target.value),children:g.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,j.jsx)(D,{value:o,options:n,onChange:f,who:`the new install`}),(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Cancel`})]}),(0,j.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,j.jsx)(`code`,{children:p(o.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function N(){let{data:e,error:t,reload:n}=S(()=>w.excludes(),[]),[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)([]),s=async(e,t)=>{i(!0);try{let n=await w.excludeMutate(e,t);o(n.messages||[])}catch(e){o(e.body?.messages||[e.message])}finally{i(!1),n()}};return t||!e?.installs?.length?null:(0,j.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,j.jsx)(`div`,{className:`card-head`,children:(0,j.jsx)(`h3`,{children:`Excluded folders`})}),(0,j.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,j.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,j.jsx)(`code`,{children:e.path}),(0,j.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>p(e).label).join(`, `)}),(0,j.jsx)(`button`,{className:`btn ghost sm`,disabled:r,"aria-label":`Stop excluding ${e.path}`,onClick:()=>s(`remove`,e.path),children:`Remove`})]},e.path)),(0,j.jsxs)(`button`,{className:`btn ghost sm`,disabled:r,onClick:async()=>{i(!0);try{let e=await w.pickFolder();e.path?await s(`add`,e.path):e.error&&o([e.error])}catch(e){o([e.message])}finally{i(!1)}},children:[(0,j.jsx)(u,{name:`folder`}),` Exclude a folder…`]}),a.map((e,t)=>(0,j.jsx)(`p`,{className:`sub`,children:e},t))]})}var P=[[`standard`,`Standard`],[`light`,`Light`]];function F({inst:e,who:t,onRebuild:n}){let r={host:e.host,path:e.path},{data:i,error:a,setData:o}=S(()=>Promise.resolve().then(()=>w.agentModels(r)),[e.host,e.path]),[s,c]=(0,A.useState)({}),[l,u]=(0,A.useState)(``),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(!1);if(a)return(0,j.jsxs)(`p`,{className:`sub`,children:[`The model tiers could not be read: `,a]});if(!i)return null;let h=i.file?.problem,g=e=>Object.hasOwn(i.map,e)?i.map[e]:i.defaults[e]??``,_=e=>s[e]??g(e),v=P.some(([e])=>s[e]!==void 0&&s[e].trim()!==g(e));return(0,j.jsxs)(`div`,{className:`ip-block tiers-editor`,role:`group`,"aria-label":`Model tiers for ${t}`,children:[(0,j.jsx)(`span`,{className:`ip-label`,children:`Models by tier`}),(0,j.jsxs)(`div`,{className:`tiers-row`,children:[(0,j.jsx)(`span`,{className:`dim`,children:`Strong`}),(0,j.jsx)(`span`,{className:`dim`,children:`your session model`})]}),P.map(([e,n])=>(0,j.jsxs)(`label`,{className:`tiers-row`,children:[(0,j.jsx)(`span`,{children:n}),(0,j.jsx)(`input`,{className:`inp`,type:`text`,"aria-label":`${e} tier model for ${t}`,placeholder:`session model`,disabled:!!h||p,value:_(e),onChange:t=>{c(n=>({...n,[e]:t.target.value})),f(!1)}})]},e)),(0,j.jsxs)(`p`,{className:`sub`,children:[`Empty means the agents of that tier use your session model. Defaults: standard`,` `,(0,j.jsx)(`code`,{children:i.defaults.standard}),`, light `,(0,j.jsx)(`code`,{children:i.defaults.light}),`.`]}),h?(0,j.jsxs)(`p`,{className:`sub tiers-warn`,role:`alert`,children:[h,`.`]}):null,i.warnings.map(e=>(0,j.jsx)(`p`,{className:`sub tiers-warn`,role:`note`,children:e},e)),l?(0,j.jsx)(`p`,{className:`sub tiers-warn`,role:`alert`,children:l}):null,(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!v||!!h||p,onClick:async()=>{let e={};for(let[t]of P){if(s[t]===void 0)continue;let n=s[t].trim();n!==g(t)&&(e[t]=n===i.defaults[t]?null:n)}m(!0),u(``);try{let t=await w.agentModelsSave({tiers:e},r);o(t),c({}),f(!0)}catch(e){u(e.message)}finally{m(!1)}},children:`Save models`}),d&&n?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`sub`,children:`Saved. The agent files change at the next rebuild.`}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:n,children:`Rebuild…`})]}):null]})]})}var I=`This project sees your machine-wide rules, profile and memory map, so what you taught one tool or repo applies here too.`,L=`About 1 500 tokens at every session start, growing with your rules. The hook budget is fixed at 9 000 characters, and the tier loads before this project's docs, so a large tier can push them down to a lazy listing.`,R=[`200k`,`1m`],z={"200k":`For a 200k-token model: each skill description is cut to 80 characters and the listing budget is 1.3% of the window, so every skill keeps its description.`,"1m":`For a 1M-token model: each skill description is cut to 120 characters, at the default budget of 1% of the window.`},B=[`off`,`auto`],V={off:`Every agent runs on your session model, unless you pin one.`,auto:`By default standard agents run on sonnet and light ones on haiku; strong ones keep your session model. Your pins in agent-overrides.json win.`};function ee({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,j.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,j.jsxs)(`div`,{className:`mcp-target`,children:[(0,j.jsxs)(`div`,{className:`mt-head`,children:[(0,j.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,j.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,j.jsxs)(`div`,{className:`mcp-row`,children:[(0,j.jsx)(`span`,{className:`mono`,children:e.name}),(0,j.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,j.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,j.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,j.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var H=6;function U({leftovers:e}){let t=e?.kept||[],n=e?.stale||[],r=[...t,...n];return r.length?(0,j.jsxs)(`div`,{className:`ip-block ip-leftovers`,role:`group`,"aria-label":`Files a rebuild keeps`,children:[(0,j.jsxs)(`span`,{className:`ip-label`,children:[`Not Geneseed’s copy `,(0,j.jsx)(`span`,{className:`mono dim`,children:r.length})]}),t.length?(0,j.jsxs)(`p`,{className:`sub`,children:[t.length===1?`This file is yours`:`These files are yours`,` where Geneseed ships its own: you edited a shipped file, or had one under the same name. A rebuild keeps`,` `,t.length===1?`it`:`them`,`.`]}):null,n.length?(0,j.jsxs)(`p`,{className:`sub`,children:[n.length===1?`One retired skill was`:`${n.length} retired skills were`,` `,`left by an older version. A rebuild leaves `,n.length===1?`it`:`them`,` in place.`]}):null,(0,j.jsxs)(`ul`,{className:`ip-files`,children:[r.slice(0,H).map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{title:e,children:e})},e)),r.length>H?(0,j.jsxs)(`li`,{className:`dim`,children:[`and `,r.length-H,` more`]}):null]}),(0,j.jsxs)(`p`,{className:`sub`,children:[(0,j.jsx)(`strong`,{children:`Force rebuild…`}),` below replaces them with Geneseed’s copies. Skills and agents under your own names, memory, notebook, rules and profile are never touched. To keep a file of yours for good, exclude that skill instead.`]})]}):null}function W({stranded:e,canAct:t,busy:n,onPrune:r}){let i=e?.keys||[];return i.length?(0,j.jsxs)(`div`,{className:`ip-block ip-leftovers`,role:`group`,"aria-label":`Stranded permission gates`,children:[(0,j.jsxs)(`span`,{className:`ip-label`,children:[`Stranded gates `,(0,j.jsx)(`span`,{className:`mono dim`,children:i.length})]}),(0,j.jsxs)(`p`,{className:`sub`,children:[`These `,(0,j.jsx)(`code`,{children:`permission.bash`}),` entries in `,(0,j.jsx)(`code`,{children:`opencode.json`}),` still ask, but the rule behind them is off in this install. Geneseed has no record that it wrote them, so a rebuild leaves them.`]}),(0,j.jsxs)(`ul`,{className:`ip-files`,children:[i.slice(0,H).map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{title:e,children:e})},e)),i.length>H?(0,j.jsxs)(`li`,{className:`dim`,children:[`and `,i.length-H,` more`]}):null]}),e.commented?(0,j.jsx)(`p`,{className:`sub`,children:`This file has comments, so Geneseed does not rewrite it: delete these entries by hand.`}):t?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:n,onClick:r,children:`Remove stranded gates…`}):null,(0,j.jsx)(`p`,{className:`sub`,children:`An entry you changed yourself is kept.`})]}):null}var G={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:m,onForce:h,onPrune:g,profileMatches:_,onSaveProfile:y,onRebuild:b}){let x=`${p(e.host).label} · ${e.scope}`,[S,C]=G[e.state]||G.absent,w=e.state===`active`,T=e.state===`absent`;return(0,j.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${x} install`,children:[(0,j.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,j.jsxs)(`div`,{className:`ip-head`,children:[(0,j.jsx)(`h2`,{children:v(e)}),(0,j.jsx)(`span`,{className:`tag ${C}`,children:S})]}),(0,j.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${p(e.host).label}`}),(0,j.jsx)(`code`,{className:`ip-path`,children:e.path}),w&&_?.length?(0,j.jsxs)(`div`,{className:`row gap-8 wrap`,"aria-label":`Profile`,children:[(0,j.jsx)(`span`,{className:`ip-label`,children:`Profile`}),_.map(e=>(0,j.jsxs)(`span`,{className:`tag acc`,children:[`matches `,e]},e))]}):null,T?(0,j.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,j.jsx)(`strong`,{children:p(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(w||T)&&o?(0,j.jsxs)(`div`,{className:`ip-picks`,children:[(0,j.jsx)(D,{value:n,options:i,onChange:a,who:x}),(0,j.jsxs)(`p`,{className:`sub`,children:[n.footprint===`lean`?`Lean footprint: terse rule lines and a pointer to the full file, about 40% smaller.`:`Full footprint: every rule’s complete text inline, the largest context.`,` `,`Every rule stays in force. `,(0,j.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]})]}):null,(w||T)&&o&&e.host===`claude`?(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`label`,{className:`dp-field`,children:[(0,j.jsx)(`span`,{children:`Context window`}),(0,j.jsx)(O,{label:`context window for ${x}`,value:n.contextWindow||`200k`,options:R,onChange:e=>a(`contextWindow`,e)})]}),(0,j.jsx)(`p`,{className:`sub`,children:z[n.contextWindow||`200k`]})]}):null,(w||T)&&o&&e.host===`claude`?(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`label`,{className:`dp-field`,children:[(0,j.jsx)(`span`,{children:`Model tiers`}),(0,j.jsx)(O,{label:`model tiers for ${x}`,value:n.tiers||`off`,options:B,onChange:e=>a(`tiers`,e)})]}),(0,j.jsx)(`p`,{className:`sub`,children:V[n.tiers||`off`]}),w&&n.tiers===`auto`?(0,j.jsx)(F,{inst:e,who:x,onRebuild:b}):null]}):null,(w||T)&&o&&e.scope!==`global`?(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`label`,{className:`ip-switch`,children:[(0,j.jsx)(E,{on:!!n.sharedTier,label:`shared tier for ${x}`,onToggle:()=>a(`sharedTier`,!n.sharedTier)}),(0,j.jsx)(`span`,{children:`Read the machine-wide shared tier`})]}),(0,j.jsxs)(`p`,{className:`sub`,children:[(0,j.jsx)(`strong`,{children:`Benefit:`}),` `,I]}),(0,j.jsxs)(`p`,{className:`sub`,children:[(0,j.jsx)(`strong`,{children:`Cost:`}),` `,L]})]}):null,w?(0,j.jsx)(U,{leftovers:e.leftovers}):null,w?(0,j.jsx)(W,{stranded:e.strandedGates,canAct:o,busy:s,onPrune:g}):null,w&&t.length?(0,j.jsx)(ee,{targets:t,onReveal:m}):null,w&&e.scope===`global`?(0,j.jsx)(N,{}):null,T?null:(0,j.jsxs)(`label`,{className:`ip-switch`,children:[(0,j.jsx)(E,{on:w,disabled:s,label:`activate ${x}`,onToggle:d}),(0,j.jsx)(`span`,{children:w?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,j.jsx)(`div`,{className:`ip-spacer`}),o?(0,j.jsxs)(`div`,{className:`ip-actions`,children:[T?(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):w?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}),y?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:y,children:`Save as profile…`}):null,(0,j.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,disabled:s,onClick:h,children:`Force rebuild…`})]}):null,T?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`label`,{className:`field`,children:[(0,j.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,j.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,j.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,j.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,j.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${x} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var ne={secretsGate:`secrets`,doneGate:`done`,deletionGate:`deletion`,ownershipGate:`ownership`,externalGate:`external`,testNote:`test note`,ownBranchPass:`own-branch pass`},re=e=>ne[e]||e,K=e=>p(e).label,q=e=>`${K(e.host)} · ${e.scope===`global`?`global`:e.path}`,J=e=>e.startsWith(`gates.`)||/-gate$|consent|test-note/.test(e);function Y(e){if(!e)return null;try{let t=JSON.parse(e)?.save;return t&&typeof t.host==`string`&&typeof t.path==`string`?t:null}catch{return null}}var ie=e=>`#/installs/profiles/${encodeURIComponent(JSON.stringify({save:{host:e.host,path:e.path}}))}`;function X(e){let t=(e.gatesOff||[]).map(re);return t.length?t.length===1&&t[0]===`ownership`?{text:`All on, except ownership`,warn:!1}:{text:`Off: ${t.join(`, `)}`,warn:!0}:{text:`All on`,warn:!1}}function ae({p:e,canAct:t,onApply:n}){let r=(0,j.jsxs)(`div`,{className:`panel-head prof-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{children:e.name}),e.description?(0,j.jsx)(`p`,{className:`sub`,children:e.description}):null]}),(0,j.jsx)(`span`,{className:`tag ${e.source===`personal`?`acc`:``}`,children:e.source===`personal`?`Personal`:`Shipped`})]});if(e.error)return(0,j.jsxs)(`article`,{className:`panel prof-card`,"aria-label":`profile ${e.name}`,children:[r,(0,j.jsx)(`p`,{className:`tag bad note`,children:e.error}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`File`}),(0,j.jsx)(`code`,{className:`v`,children:e.file})]})]});let i=e.profile,a=X(e);return(0,j.jsxs)(`article`,{className:`panel prof-card`,"aria-label":`profile ${e.name}`,children:[r,(0,j.jsxs)(`div`,{className:`prof-kv`,children:[(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Hosts`}),(0,j.jsx)(`span`,{className:`v row gap-8 wrap`,children:i.hosts.map(e=>(0,j.jsx)(`span`,{className:`tag human`,children:K(e)},e))})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Settings`}),(0,j.jsx)(`span`,{className:`v`,children:[i.theme,i.footprint,i.posture,i.mode,i.trust].join(` · `)})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Gates`}),(0,j.jsx)(`span`,{className:`v`,children:a.warn?(0,j.jsxs)(`span`,{className:`tag warn note`,children:[`! `,a.text]}):a.text})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Followed by`}),(0,j.jsx)(`span`,{className:`v`,children:e.matches?.length?e.matches.map(q).join(`, `):`No install`})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`File`}),(0,j.jsx)(`code`,{className:`v`,children:e.file})]})]}),t?(0,j.jsx)(`div`,{className:`row gap-8`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>n(e.name),children:`Apply…`})}):null]})}function oe(e,t){if(!e.present)return`not on this machine`;let n=t===`global`?`global install`:`project install`;return e.state===`active`?`${n} · active`:e.state===`disabled`?`${n} · disabled`:t===`global`?`no global install yet`:`no install in this folder`}var Z=e=>e.present&&!e.refused;function se(e){return e.present?e.refused?[{text:e.refused,tone:`warn`}]:e.state===`active`?e.changes.length?e.changes.map(e=>({text:`${e.name} ${e.from} → ${e.to}`,tone:J(e.name)?`warn`:``})):[{text:`Already matches — rebuild only`,tone:`dim`}]:[{text:`New install`,tone:`dim`}]:[{text:`Install ${K(e.host)}, then apply again`,tone:`dim`}]}function ce({name:e,onAction:t,onClose:n}){let[r,i]=(0,A.useState)(`global`),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)({}),[d,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(``),g=r===`project`?s:null,_=JSON.stringify([e,r,g]),{data:v,error:x,loading:C}=S(()=>r===`project`&&!s?Promise.resolve(null):w.profiles(e,g).then(e=>({...e,askedFor:_})),[e,r,s]),T=!C&&v?.askedFor===_?v.preview:null,E=T?.rows||[],D=E.filter(e=>Z(e)&&!l[e.host]),O=T&&!T.error&&T.name===e&&T.scope===r&&(r===`global`||T.project),k=e=>{c(e.trim()),u({})},M=async()=>{p(!0),h(``);try{let e=await w.pickFolder();e.path?(o(e.path),k(e.path)):e.error&&h(e.error)}catch(e){h(e.message)}finally{p(!1)}},N=async()=>{await t?.(`profile-apply`,{name:e,hosts:D.map(e=>e.host),...r===`project`?{project:T.project}:{}})&&n()},P=E.filter(e=>e.layering&&!l[e.host]&&Z(e));return(0,j.jsxs)(`section`,{className:`panel prof-dialog`,"aria-label":`Apply profile`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsxs)(`h2`,{children:[`Apply `,(0,j.jsx)(`span`,{className:`mono`,children:e})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Close`,onClick:n,children:`✕`})]}),(0,j.jsxs)(`fieldset`,{className:`prof-field`,children:[(0,j.jsx)(`legend`,{className:`ip-label`,children:`Where`}),(0,j.jsxs)(y,{"aria-label":`Where to apply`,children:[(0,j.jsx)(`button`,{type:`button`,className:r===`global`?`on`:``,"aria-pressed":r===`global`,onClick:()=>{i(`global`),u({})},children:`Global — every project on this machine`}),(0,j.jsx)(`button`,{type:`button`,className:r===`project`?`on`:``,"aria-pressed":r===`project`,onClick:()=>{i(`project`),u({})},children:`One project`})]}),r===`project`?(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,"aria-label":`Project folder`,value:a,onChange:e=>o(e.target.value),onBlur:()=>k(a),onKeyDown:e=>e.key===`Enter`&&k(a)}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:d,onClick:M,children:d?`Choosing…`:`Browse…`})]}):null]}),m?(0,j.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:m}):null,(0,j.jsx)(f,{error:x}),T?.error?(0,j.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.error}):null,C?(0,j.jsx)(b,{}):null,O?(0,j.jsxs)(`div`,{className:`prof-hosts`,role:`group`,"aria-label":`Hosts`,children:[(0,j.jsx)(`span`,{className:`ip-label`,children:`Hosts — the profile’s hosts are ticked; a host this machine lacks is shown, not offered`}),E.map(e=>(0,j.jsxs)(`div`,{className:`prof-host${e.present?``:` missing`}`,children:[(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:Z(e)&&!l[e.host],disabled:!Z(e),onChange:()=>u(t=>({...t,[e.host]:!t[e.host]}))}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:K(e.host)}),` `,(0,j.jsx)(`span`,{className:`dim`,children:oe(e,r)})]})]}),(0,j.jsx)(`div`,{className:`prof-changes`,children:se(e).map(e=>(0,j.jsx)(`span`,{className:e.tone===`warn`?`warn-text`:e.tone,children:e.text},e.text))})]},e.host))]}):null,O&&r===`project`?(0,j.jsxs)(`p`,{className:`sub`,children:[`Project scope: the build writes into `,(0,j.jsx)(`code`,{children:T.project}),` for each ticked host. The profile’s `,(0,j.jsx)(`code`,{children:`sharedTier`}),` applies here only; a global apply ignores it.`]}):null,O&&P.length?P.map(e=>(0,j.jsxs)(`p`,{className:`tag warn note`,role:`note`,children:[`A global `,K(e.host),` install is active (`,e.layering.root,`): both root files load in this project. Global gates that still run there:`,` `,e.layering.gates.length?e.layering.gates.join(`, `):`none`,`.`,` `,(0,j.jsx)(`a`,{href:`#/docs/exclusions`,children:`Why →`})]},e.host)):null,(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`btn`,disabled:!O||!D.length,onClick:N,children:[`Apply to `,D.length,` `,D.length===1?`host`:`hosts`]}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:n,children:`Cancel`}),(0,j.jsx)(`span`,{className:`dim`,children:`Runs as a background job; its log reports each host.`})]})]})}function Q({data:e,initial:t,onAction:n,onClose:r}){let i=e.installs||[],a=e=>`${e.host}|${e.path}`,o=t?i.find(e=>a(e)===a(t)):i[0],[s,c]=(0,A.useState)(o?a(o):``),[l,u]=(0,A.useState)(``),[d,f]=(0,A.useState)(`personal`),[p,m]=(0,A.useState)(!1),h=i.find(e=>a(e)===s),g=(h?.diff||[]).filter(e=>e.key!==`hosts`);return(0,j.jsxs)(`section`,{className:`panel prof-dialog`,"aria-label":`Save as profile`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsx)(`h2`,{children:`Save an install as profile`}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Close`,onClick:r,children:`✕`})]}),i.length?(0,j.jsxs)(j.Fragment,{children:[t&&!o?(0,j.jsx)(`p`,{className:`tag warn note`,role:`status`,children:`The install you chose is no longer active here. Pick one below.`}):null,(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsxs)(`label`,{className:`field`,children:[(0,j.jsx)(`span`,{children:`From install`}),(0,j.jsxs)(`select`,{className:`sel`,value:s,onChange:e=>c(e.target.value),children:[s?null:(0,j.jsx)(`option`,{value:``,children:`Pick an install…`}),i.map(e=>(0,j.jsx)(`option`,{value:a(e),children:q(e)},a(e)))]})]}),(0,j.jsxs)(`label`,{className:`field`,children:[(0,j.jsx)(`span`,{children:`Name`}),(0,j.jsx)(`input`,{className:`inp`,type:`text`,value:l,placeholder:`my-profile`,onChange:e=>u(e.target.value)})]})]}),(0,j.jsxs)(`fieldset`,{className:`prof-field`,children:[(0,j.jsx)(`legend`,{className:`ip-label`,children:`Save to`}),(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`prof-dest`,checked:d===`personal`,onChange:()=>f(`personal`)}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Personal`}),` — `,(0,j.jsx)(`code`,{children:e.personalDir}),`, beside your memory and rules. Survives updates, never shipped.`]})]}),(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`prof-dest`,checked:d===`shipped`,disabled:!e.shippedWritable,onChange:()=>f(`shipped`)}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Shipped`}),` — `,(0,j.jsx)(`code`,{children:`profiles/`}),` in this clone, for everyone. Commit and open a pull request to share it.`,e.shippedWritable?``:` Disabled: this copy is not a git clone.`]})]}),(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:p,onChange:()=>m(e=>!e)}),(0,j.jsx)(`span`,{children:`Replace a profile of this name in the same place`})]})]}),(0,j.jsxs)(`div`,{className:`prof-changes`,"aria-label":`Differs from ${e.base}`,children:[(0,j.jsxs)(`span`,{children:[`Differs from `,(0,j.jsx)(`strong`,{children:e.base}),g.length?``:`: nothing`]}),g.map(t=>(0,j.jsx)(`span`,{className:J(t.key)?`warn-text`:``,children:J(t.key)?`! gate ${re(t.key.slice(6))}: ${t.now} (${e.base}: ${t.base})`:`${t.key} ${t.now} (${e.base}: ${t.base})`},t.key))]}),(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!h||!l.trim(),onClick:async()=>{await n?.(`profile-save`,{name:l.trim(),from:{host:h.host,path:h.path},...d===`shipped`?{shipped:!0}:{},...p?{force:!0}:{}})&&r()},children:`Save profile`}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:r,children:`Cancel`})]})]}):(0,j.jsx)(T,{children:`No active install to save. Install one on the Hosts tab first.`})]})}function le({onAction:e,dataRev:t,item:n}){let r=Y(n),{data:i,error:a,loading:o,reload:s}=S(()=>w.profiles(),[t],`profiles`),[c,l]=(0,A.useState)(r?{kind:`save`,from:r}:null);if(a)return(0,j.jsx)(f,{error:a,onRetry:s});if(o&&!i)return(0,j.jsx)(b,{});let u=i?.profiles||[],d=!!e;return(0,j.jsxs)(`div`,{className:`profiles`,children:[(0,j.jsxs)(`div`,{className:`inst-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:`Profiles`}),(0,j.jsx)(`p`,{className:`dim`,children:`A profile is a named set of build settings and the hosts it targets. Apply it globally or to one project.`})]}),d?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>l({kind:`save`,from:null}),children:`Save an install as profile…`}):null]}),u.length?(0,j.jsx)(`div`,{className:`prof-grid`,children:u.map(e=>(0,j.jsx)(ae,{p:e,canAct:d,onApply:e=>l({kind:`apply`,name:e})},`${e.source}:${e.name}`))}):(0,j.jsx)(T,{children:`No profile yet. Save an install as one to start.`}),c?.kind===`apply`?(0,j.jsx)(ce,{name:c.name,onAction:e,onClose:()=>l(null)},c.name):null,c?.kind===`save`&&i?(0,j.jsx)(Q,{data:i,initial:c.from,onAction:e,onClose:()=>l(null)}):null]})}function ue({dataRev:e}){let{data:t,error:n,reload:r}=S(()=>w.migratePreview(),[e]);return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`preview-h`,children:[(0,j.jsx)(`div`,{className:`panel-head`,children:(0,j.jsx)(`h2`,{id:`preview-h`,children:`Next rebuild`})}),n?(0,j.jsx)(f,{error:n,onRetry:r}):t?(0,j.jsxs)(j.Fragment,{children:[t.folds.length?(0,j.jsx)(`ul`,{className:`preview-list`,children:t.folds.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`b`,{className:`mono`,children:e.host}),` `,e.summary||`nothing to fold`,e.failed.map(e=>(0,j.jsxs)(`div`,{className:`t-warn`,children:[`The fold would stop at `,e]},e))]},e.host))}):(0,j.jsx)(`p`,{className:`dim`,children:`No global install to fold.`}),t.orphans.length?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h3`,{children:`Orphans`}),(0,j.jsx)(`p`,{className:`dim`,children:`No manifest owns these. An earlier build may have written them, or they may be yours. Nothing moves them: if one is not yours, move it by hand.`}),(0,j.jsx)(`ul`,{className:`preview-list mono`,children:t.orphans.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}):null]}):(0,j.jsx)(b,{})]})}var de=(e,t)=>`${e} ${t}`,fe=[`claude`,`bob`,`openclaude`],pe={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},me=/[\\/]\.claude[\\/]worktrees[\\/]/,he=e=>e.scope===`project`&&me.test(e.path);function ge(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?x(e.drift):0,a=e.diffable?C(e.drift):0;return r+(i?` · ${i} edited`:``)+(a?` · ${a} kept`:``)}function _e({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,j.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,j.jsx)(`span`,{className:`dim`,children:`—`});let a=t.drift?.stale??0,o=t.diffable?x(t.drift):0,s=t.diffable?C(t.drift):0;return(0,j.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&a+o+s>0?(0,j.jsx)(i,{label:`Sync with source of ${v(e)}`,parts:[{key:`stale`,label:`behind source`,n:a,tone:`warn`},{key:`edited`,label:`local edits`,n:o,tone:`bad`},...s?[{key:`kept`,label:`kept edits`,n:s,tone:`muted`}]:[]]}):null,(0,j.jsx)(`span`,{className:`dim`,children:ge(t,n)}),t.diffable?null:(0,j.jsxs)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:[` `,`· not checkable`]}),o||s?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ve({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o,onDefault:s,busyKey:c}){let l=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,j.jsx)(`div`,{className:`tbl-scroll`,children:(0,j.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,j.jsx)(`th`,{scope:`col`,children:`State`}),(0,j.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,j.jsx)(`th`,{scope:`col`,children:(0,j.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,j.jsx)(`tbody`,{children:e.map(e=>{let[i,u]=pe[e.state]||[`Not installed`,``],d=n===e.id,f=e.state===`absent`;return(0,j.jsxs)(`tr`,{className:`pickable${d?` on`:``}${f?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":d,title:e.path,onClick:()=>r(e.id),children:v(e)}),(0,j.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?p(e.host).label:e.path})]}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`span`,{className:`tag ${u}`,children:i}),e.default?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`span`,{className:`tag`,title:`A page that names no install reads this one, and pickers start on it`,children:`Default`})]}):e.state===`active`&&s?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Make ${v(e)} the default install`,disabled:c===e.id,onClick:t=>{t.stopPropagation(),s(e)},children:`Make default`})]}):null,he(e)?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.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,j.jsx)(`td`,{children:(0,j.jsx)(_e,{inst:e,fleet:l(e),version:a?.version,onEdits:o})}),(0,j.jsx)(`td`,{className:`pick-mark`,children:d?`Editing ›`:``})]},e.id)})})]})})}function ye({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,j.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,j.jsxs)(`summary`,{children:[(0,j.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,j.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,j.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,j.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,j.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,j.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function be({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,j.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:n?`in sync`:e.version_verdict})]}),(0,j.jsxs)(`dl`,{className:`kv-grid`,children:[(0,j.jsx)(`dt`,{children:`Source`}),(0,j.jsx)(`dd`,{className:`mono`,children:e.root}),(0,j.jsx)(`dt`,{children:`Version`}),(0,j.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,j.jsx)(`dt`,{children:`Fingerprint`}),(0,j.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function xe({onAction:e,themes:t=[],currentTheme:n,overview:r,setup:i,dataRev:o,onMutated:s}){let l=d(),{data:h,error:g,reload:_}=S(()=>w.installs(),[o]),{data:y,error:x,reload:C}=S(()=>w.mcp(),[o]),{data:E,error:D}=S(()=>w.fleet(),[o]),{data:O}=S(()=>w.profiles(),[o],`profiles`),N=D?null:E??void 0,[P,F]=(0,A.useState)(null),[I,L]=(0,A.useState)(``),[R,z]=(0,A.useState)({}),[B,V]=(0,A.useState)(!1),[ee,H]=(0,A.useState)(!1),[U,W]=(0,A.useState)({id:``,value:`keep`}),G=e=>U.id===e?.id?U.value:`keep`,[ne,re]=(0,A.useState)(()=>c(`hosts`)),K=(0,A.useMemo)(()=>{let e={};for(let t of y?.targets||[]){let n=de(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[y]);if(g||x)return(0,j.jsx)(f,{error:g||x,onRetry:()=>{_(),C()}});if(!h||!y)return(0,j.jsx)(b,{});let q={active:0,disabled:1,absent:2},J=[...h.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(q[e.state]??3)-(q[t.state]??3)),Y=J.find(e=>e.id===ne)||J.find(e=>e.default)||J.find(e=>e.state===`active`)||J[0],X=e=>{let t=R[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`,sharedTier:t.sharedTier??!!e.sharedTier,contextWindow:t.contextWindow||e.contextWindow||`200k`,tiers:t.tiers||e.tiers||`off`}},ae=(e,t,n)=>z(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),oe=e=>{let t=X(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`)&&(e.scope===`global`||t.sharedTier===!!e.sharedTier)&&t.contextWindow===(e.contextWindow||`200k`)&&t.tiers===(e.tiers||`off`)},Z={theme:t.map(e=>e.name),footprint:k,posture:h.postures||[],mode:h.modes||[],trust:h.trusts||[]},se=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o,sharedTier:s,contextWindow:c,tiers:u}=X(t),d=p(t.host).label,f=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust${t.host===`claude`&&(u===`auto`||t.tiers===`auto`)?`, model tiers ${u}`:``}`,m=t.state===`absent`?`Install Geneseed for ${d} into ${t.path} with the “${n}” voice (${f})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${d} install (voice “${n}”, ${f})? It rebuilds in place, non-destructive.`;await l(m,{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,contextWindow:c,tiers:u,...t.scope===`global`?{}:{sharedTier:s}})},ce=(t,n)=>{let{theme:r,footprint:i,posture:a,mode:o,trust:s,sharedTier:c,contextWindow:l,tiers:u}=X(t);e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:r,footprint:i,posture:a,mode:o,trust:s,contextWindow:l,tiers:u,...t.scope===`global`?{}:{sharedTier:c},...n})},Q=e=>e.slice(0,8).join(`, `)+(e.length>8?`, and ${e.length-8} more`:``),le=async e=>{let t=e.leftovers?.kept||[],n=e.leftovers?.stale||[],r=t.length||n.length?(t.length?`Replace with Geneseed’s copy: ${Q(t)}. Your version of each is overwritten. `:``)+(n.length?`Remove: ${Q(n)}. `:``)+`Nothing else is touched.`:`No file of yours is recorded here. A forced rebuild overwrites any file it finds at a path Geneseed ships, and removes retired leftovers. Skills and agents under your own names, memory, notebook, rules and profile are never touched.`;await l(r,{title:`Force rebuild this install?`,confirmLabel:`Force rebuild`,tone:`danger`})&&ce(e,{force:!0})},pe=async e=>{let t=e.strandedGates?.keys||[];await l(`Remove from opencode.json: ${Q(t)}. Their rule is off in this install. An entry you changed yourself is kept; nothing else is touched.`,{title:`Remove stranded gates?`,confirmLabel:`Remove and rebuild`})&&ce(e,{pruneGates:!0})},me=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){L(e.id),F(null);try{let t=await w.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;F({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}s?.()}catch(e){F({text:e.message,tone:`bad`})}finally{L(``)}}},he=async e=>{L(e.id),F(null);try{await w.setDefaultInstall(e.host,e.path),s?.()}catch(e){F({text:e.message,tone:`bad`})}finally{L(``)}},ge=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&fe.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},_e=async e=>{let t=G(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,r=t===`delete`?`, and permanently deletes ${ge(e,`memory`)} and ${ge(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${p(e.host).label} · ${e.scope}? It deletes ${m(e.host,e.scope)}${n}${r}. This can’t be undone.`,{title:e.scope===`project`?`Remove this install?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){L(e.id),F(null);try{let n=await w.installRemove(e.host,e.path,t);if(!n.ok){F({text:n.error||`remove failed`,tone:`bad`});return}W({id:``,value:`keep`}),n.kept?.length&&F({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`}),s?.()}catch(e){F({text:e.message,tone:`bad`})}finally{L(``)}}},xe=async e=>{F(null);try{let t=await w.mcpReveal(e.path);F({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){F({text:e.message,tone:`bad`})}},Se=async()=>{let t=J.filter(e=>e.state===`active`).map(e=>`${v(e)} · ${e.scope}`);await l(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},Ce=J.find(e=>e.default)?.host||J.find(e=>e.state===`active`)?.host||J[0]?.host||`opencode`,we=J.filter(e=>e.scope===`global`),Te=J.filter(e=>e.scope!==`global`),$=e=>{re(e)},Ee=e=>{a(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,j.jsxs)(`div`,{className:`hosts`,children:[(0,j.jsxs)(`div`,{className:`hosts-main`,children:[(0,j.jsxs)(`div`,{className:`toolbar`,children:[(0,j.jsxs)(`span`,{className:`dim`,children:[J.filter(e=>e.state!==`absent`).length,` installed.`]}),(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,"aria-expanded":ee,onClick:()=>H(e=>!e),children:`Preview next rebuild`}),e?(0,j.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:Se,children:[(0,j.jsx)(u,{name:`refresh`}),` Rebuild all`]}):null]})]}),ee?(0,j.jsx)(ue,{dataRev:o}):null,P?.tone===`bad`?(0,j.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:P.text}):P?(0,j.jsx)(`p`,{className:`tag ${P.tone===`ok`?`ok `:``}note`,role:`status`,children:P.text}):null,(0,j.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,j.jsx)(`div`,{className:`inst-head`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,j.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,j.jsx)(ve,{rows:we,currentId:Y?.id,onPick:$,label:`Global installs`,fleet:N,onEdits:Ee,onDefault:e?he:void 0,busyKey:I})]}),(0,j.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,j.jsxs)(`div`,{className:`inst-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,j.jsx)(`p`,{className:`dim`,children:`A repo with its own install. Inside it, only that install loads.`})]}),e?(0,j.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>V(e=>!e),children:[(0,j.jsx)(u,{name:`folder`}),` Deploy to a repo…`]}):null]}),B?(0,j.jsx)(`div`,{className:`inst-deploy`,children:(0,j.jsx)(M,{host:Ce,theme:n||`neutral`,options:Z,onAction:e,onClose:()=>V(!1),onNote:e=>F(e?{text:e,tone:`bad`}:null)})}):null,Te.length?(0,j.jsx)(ve,{rows:Te,project:!0,currentId:Y?.id,onPick:$,label:`Per-project installs`,fleet:N,onEdits:Ee,onDefault:e?he:void 0,busyKey:I}):(0,j.jsx)(T,{children:`No repo has its own install yet. Deploy one to give a project its own rules and voice.`})]}),(0,j.jsx)(be,{setup:i,overview:r}),(0,j.jsx)(ye,{themes:t,current:r?.theme})]}),Y?(0,j.jsx)(te,{inst:Y,targets:K[de(Y.host,Y.path)]||[],choice:X(Y),unchanged:oe(Y),options:Z,onPick:(e,t)=>ae(Y,e,t),canAct:!!e,busy:I===Y.id,memory:G(Y),onMemory:e=>W({id:Y.id,value:e}),onApply:()=>se(Y),onToggleInstall:()=>me(Y),onRemove:()=>_e(Y),onRevealMcp:xe,onForce:()=>le(Y),onPrune:()=>pe(Y),onRebuild:()=>se(Y),profileMatches:O?.installs?.find(e=>e.host===Y.host&&e.path===Y.path)?.matches,onSaveProfile:e?()=>{window.location.hash=ie(Y)}:void 0},Y.id):null]})}function Se(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var Ce=300;function we(e){let t=l(e.dataRev),[n,r]=s(`edits`,t);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,j.jsx)(b,{}):(0,j.jsx)(Te,{install:n,...e},n?.id||``)]})}function Te({install:e,onMutated:t,onAction:n,dataRev:r,overview:i}){let a=d(),{data:o,error:s,reload:c}=S(()=>w.diff(h(e)),[r]),[l,p]=(0,A.useState)(!1),[m,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(()=>new Set),[y,x]=(0,A.useState)(()=>new Set),[C,E]=(0,A.useState)(null);if(o&&o!==C){E(o),v(new Set);let e=o.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=Ce?o.files.map(e=>e.rel):[]))}let D=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),O=()=>v(e=>e.size===N.length?new Set:new Set(N.map(e=>e.rel))),k=()=>n?.(`export`),M=async()=>{let n=[..._],r=n.filter(e=>o.files.find(t=>t.rel===e)?.status===`added`),i=r.length?`Restoring will DELETE ${r.length} deployed-only file(s):\n${r.join(`
|
|
2
|
-
`)}\n\n`:``;if(await a(`${i}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){p(!0);try{let r=await w.restore(n,h(e)),i=r.errors.length?` · ${r.errors.length} error(s): ${r.errors.join(`; `)}`:``;g(`Restored ${r.restored.length}, archived ${r.deleted.length}${i}`),await c(),t?.()}catch(e){g(e.message)}finally{p(!1)}}};if(s)return(0,j.jsx)(f,{error:s,onRetry:c});if(!o)return(0,j.jsx)(b,{});if(!o.deployed)return(0,j.jsx)(T,{title:`Nothing installed here`,children:`Nothing to compare.`});if(!o.diffable)return(0,j.jsx)(T,{title:`No local-edit check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`Local edits are only checked for global installs. Pick a global install above.`});let N=o.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),P=o.files.filter(e=>e.status===`linked`),F=o.files.filter(e=>e.status===`stale`),I=N.filter(e=>e.status===`edited`).length,L=N.filter(e=>e.status===`added`).length,R=N.filter(e=>e.status===`missing`).length,z=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`h`,children:`Local edits`}),o.target?(0,j.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,j.jsx)(`code`,{children:o.target}),o.theme?` (${o.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,I>0?(0,j.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.`}):L+R>0?(0,j.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,j.jsxs)(`div`,{className:`row gap-10`,children:[(0,j.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:l||_.size===0,onClick:M,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,j.jsxs)(`button`,{className:`btn`,disabled:l,onClick:k,children:[(0,j.jsx)(u,{name:`download`}),`Export improvements`]})]})]}),m?(0,j.jsx)(`p`,{className:`sub mb-14`,children:m}):null,P.length?(0,j.jsxs)(`p`,{className:`sub dim mb-14`,title:P.map(e=>e.rel).join(`
|
|
3
|
-
`),children:[P.length,` linked — yours, left alone`]}):null,N.length===0&&F.length===0?(0,j.jsx)(T,{title:`In sync`,children:`This install matches its source.`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between mb-14`,children:[(0,j.jsxs)(`div`,{className:`row gap-10`,children:[(0,j.jsxs)(`span`,{className:`badge warn`,children:[(0,j.jsx)(`span`,{className:`dot`}),I,` edited`]}),(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),L,` added`]}),R>0&&(0,j.jsxs)(`span`,{className:`badge bad`,children:[(0,j.jsx)(`span`,{className:`dot`}),R,` missing`]}),F.length>0&&(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),F.length,` behind`]})]}),(0,j.jsxs)(`div`,{className:`row gap-10`,children:[(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(o.files.map(e=>e.rel))),children:`Expand all`}),(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),N.length?(0,j.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:_.size===N.length,onChange:O}),`Select all`]}):null]})]}),(0,j.jsx)(`div`,{className:`stack gap-12`,children:N.map(e=>B(e,!0))}),F.length?(0,j.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,j.jsx)(`h3`,{children:`Behind source`}),(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`p`,{className:`sub`,children:`This install is built from older source. Rebuild to bring these files in sync.`}),(0,j.jsx)(`button`,{className:`btn ghost`,disabled:l,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),F.map(e=>B(e,!1))]}):null]})]});function B(e,t){let n=y.has(e.rel),r=e.status===`edited`&&e.diverged===!1,i=r&&e.rel.endsWith(`.md`),a=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:i?`warn`:r?``:`warn`,o=r?`source unchanged`:e.status===`stale`?`behind source`:e.status;return(0,j.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,j.jsxs)(`div`,{className:`diff-head`,children:[t?(0,j.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>D(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,j.jsx)(`span`,{className:`fname`,children:e.rel}),(0,j.jsxs)(`span`,{className:`badge ${a}`,children:[(0,j.jsx)(`span`,{className:`dot`}),o]}),(0,j.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,j.jsx)(`button`,{className:`iconbtn`,onClick:()=>z(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,j.jsx)(u,{name:`chevron`})})]}),n&&(0,j.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,j.jsx)(`div`,{className:`diff-line ${Se(e)}`,children:e},t))})]},e.rel)}}function $({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,A.useState)(!n);return(0,j.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,j.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,j.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,j.jsx)(`h3`,{children:e.label}),(0,j.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,j.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,j.jsx)(u,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,j.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,j.jsxs)(`div`,{className:`problem`,children:[(0,j.jsx)(`span`,{className:`x`,children:`✕`}),(0,j.jsx)(`span`,{children:e})]},e))})]})}function Ee({dataRev:e}){let t=l(e),[n,r]=s(`doctor`,t);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,j.jsx)(b,{}):(0,j.jsx)(De,{install:n,dataRev:e},n?.id||``)]})}function De({install:e,dataRev:t}){let n=(0,A.useRef)(!1),{data:r,error:i,reload:a,setData:o}=S(()=>{let t=n.current;return n.current=!1,w.doctor(t,h(e))},[t]),s=()=>{n.current=!0,o(null),a()};if(i)return(0,j.jsx)(f,{error:i,onRetry:a});let c=r?r.groups.filter(e=>e.problems.length):[],l=r?r.groups.filter(e=>!e.problems.length):[];return(0,j.jsxs)(`div`,{className:`page-fill`,children:[(0,j.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,j.jsx)(`p`,{className:`sub`,children:`Builds this install’s voice in a sandbox and validates the result: token resolution, link integrity, and parity.`})]}),(0,j.jsxs)(`button`,{className:`btn`,onClick:s,disabled:!r,children:[(0,j.jsx)(u,{name:`refresh`}),r?`Run doctor`:`Running…`]})]}),r?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,j.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,j.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,j.jsxs)(`span`,{className:`dim mono`,children:[`validated `,r.themes.length,` voice`,r.themes.length===1?``:`s`]}),r.checked_at?(0,j.jsxs)(`span`,{className:`dim mono`,title:r.checked_at,children:[`checked `,r.checked_at.slice(11)]}):null,r.themes.map(e=>(0,j.jsx)(`span`,{className:`badge cap`,children:e},e))]}),r.ok?(0,j.jsxs)(`span`,{className:`badge ok`,children:[(0,j.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,j.jsxs)(`span`,{className:`badge bad`,children:[(0,j.jsx)(`span`,{className:`dot`}),r.problems.length,` problem`,r.problems.length===1?``:`s`]})]})}),(0,j.jsxs)(`div`,{className:`stack gap-12`,children:[c.map((e,t)=>(0,j.jsx)($,{group:e,i:t},e.label)),l.length?(0,j.jsxs)(`details`,{className:`check-fold`,children:[(0,j.jsxs)(`summary`,{children:[l.length,` clean check`,l.length===1?``:`s`]}),(0,j.jsx)(`div`,{className:`stack gap-12`,children:l.map((e,t)=>(0,j.jsx)($,{group:e,i:c.length+t},e.label))})]}):null]})]}):(0,j.jsx)(b,{label:`Running every check (builds this install’s voice in a sandbox)…`})]})}function Oe({tab:e=`hosts`,item:t,overview:n,setup:i,themes:a,onAction:s,onMutated:c,dataRev:l}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,j.jsx)(r,{page:`installs`,current:e,label:`Installs`}),e===`hosts`&&(0,j.jsx)(xe,{onAction:s,themes:a,currentTheme:n?.theme,overview:n,setup:i,dataRev:l,onMutated:c}),e===`profiles`&&(0,j.jsx)(le,{onAction:s,dataRev:l,item:t}),e===`edits`&&(0,j.jsx)(we,{onMutated:c,onAction:s,dataRev:l,overview:n}),e===`doctor`&&(0,j.jsx)(Ee,{dataRev:l})]})}export{Oe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{At as r,C as i,Ct as a,Mt as o,Ot as s,St as c,jt as l,wt as u}from"./index-MB7E-va_.js";import{n as d}from"./sections-CtFz7HFH.js";import{A as f,B as p,C as m,E as h,F as g,H as _,K as v,M as y,N as b,O as x,P as S,U as C,_ as w,a as T,d as ee,f as E,g as D,h as O,i as k,j as A,l as j,n as M,p as N,r as P,u as F,v as I,w as L,x as R}from"./motion-RlUl1osO.js";import{t as z}from"./api-DxwG8y94.js";import{n as B}from"./Dashboard-CoveJ_-U.js";function V(e){return L((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function H(e,t,n,r,i,a){let o=f(e.duration)&&e.duration<=1e-11?n-C:n;t.composition&&I(t,o,1,1,v.AUTO);let s=r?new F(r,e,t,o,!1,i,a):new O(e,t,o);return t.composition&&s.init(!0),m(t,s),h(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=V(t),t}var U=0,W=class extends O{constructor(e={}){super(e,null,0),++U,this.id=b(e.id)?U:e.id,this.duration=0,this.labels={};let t=e.defaults,n=p.defaults;this.defaults=t?S(t,n):n,this.composition=R(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=R(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=A(t),i=A(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=p.editor&&p.editor.addTimelineChild,a=n&&n.type===`Stagger`&&p.editor,s=x(n)?n:null;if(s||a){let t=N(e),a=this.duration,c=this.iterationDuration,l=r.id,u=0,d=t.length,f=i?i(e,r,this.id,n,d):null,m=s||p.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=c,b(l)||(n.id=l+`-`+u);let i=o(this,m(e,u,t,null,this));H(n,this,i,e,u,t),u++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;H(t,this,o(this,a),e)}}else H(e,this,o(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(b(e)||e&&b(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!b(e)&&!b(e.persist)&&(e.persist=!0);let r=p.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return b(t)?this:(t.duration=C,t.composition=_.replace,this.add(e,t,n))}call(e,t){return b(e)||e&&!x(e)?this:(p.editor&&p.editor.addTimelineCall&&(t=p.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return b(e)||e&&!y(e)||(p.editor&&p.editor.addTimelineLabel&&(t=p.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=o(this,t)),this}remove(e,t){return D(N(e),this,t),this}stretch(e){let t=this.duration;if(t===g(e))return this;let n=e/t,r=this.labels;h(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return h(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),h(this,e=>e.revert,!0),w(this)}then(e){return super.then(e)}},G=e=>p.editor?p.editor.addTimeline(e):new W(e).init(),K=e(t(),1),q=n(),J=.62,te=(e,t)=>String(e).length*t*J;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=te(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ne=M[8]+M[7];function $({hash:e,label:t,part:n,children:r}){return(0,q.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>s(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),s(e))},children:r})}function re({overview:e,dataRev:t}){let{data:n}=u(()=>z.catalog(`laws`),[t],`catalog:laws`),o=n?.items??null,s=n?.nouns?.ontology||`Ethos`,c=n?.nouns?.laws||`Dictates`,d=n?.nouns?.doctrines||`Doctrines`,f=(0,K.useRef)(null),p=(0,K.useRef)(!0),m=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=f.current;if(!e||Z||!k())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),i=t(`[data-cm="sat"]`),a=t(`[data-cm="gov"]`),o=t(`.cm-edge-gov`),s=t(`.cm-note, .cm-govern-label`),c=r(t(`.cm-edge`));j([...n,...i,...a],{opacity:0,scale:.7}),j([...o,...s],{opacity:0}),j(c,{draw:`0 0`});let u=G({autoplay:!1,defaults:{ease:P}}).add(n,{opacity:1,scale:1,duration:M[7]},0).add(c,{draw:`0 1`,duration:M[7],delay:l(M[1])},M[3]).add(i,{opacity:1,scale:1,duration:M[7],delay:l(M[1])},M[5]).add(o,{opacity:1,duration:M[6],delay:l(M[1])},M[7]).add(a,{opacity:1,scale:1,duration:M[7],delay:l(M[1])},M[8]).add(s,{opacity:1,duration:M[6]},M[8]);p.current=!1;let d=()=>u.complete(),h=()=>{u.play(),d=T(u,ne),p.current=!0,m.current?.()};if(typeof IntersectionObserver>`u`)return h(),()=>d();let g=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(g.disconnect(),h())},{threshold:.33});return g.observe(e),()=>{g.disconnect(),p.current=!0,d()}},[]);let h=e?.counts||{},g=a(h),_=[];for(let e of(o||[]).filter(e=>e.tier===`doctrine`)){let t=_.find(t=>t.id===e.pack);t||_.push(t={id:e.pack,n:0}),t.n+=1}let v=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,y={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${g} rules`,size:10,dy:8},{t:v,size:8.5,dy:24}],12)},b={x:126,y:95,r:Y([{t:s,size:12.5,dy:-7},{t:`${h.ontology??0} sections`,size:10,dy:10}],11)},x={x:560,y:78,r:Y([{t:c,size:12.5,dy:-6},{t:`${h.laws??0}`,size:13,dy:12}],11)},S={x:560,y:252,r:Y([{t:d,size:12.5,dy:-6},{t:`${h.doctrines?.rules??0}`,size:13,dy:12}],11)},C=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),w=[{...C(812,52,`Skills`,h.skills??0),hash:`#/skills`,from:x},{...C(820,126,`Agents`,h.agents??0),hash:`#/agents`,from:x},{...C(816,232,`Memory`,h.memory??0),hash:`#/personal/memory`,from:S},{...C(812,300,`Wiki`,h.wiki??0),hash:`#/section/wiki`,from:S}],E={rx:122,ry:68,from:212,to:112},D=_.map((e,t)=>{let n=(_.length===1?(E.from+E.to)/2:E.from+(E.to-E.from)*t/(_.length-1))*Math.PI/180;return{...e,x:S.x+E.rx*Math.cos(n),y:S.y+E.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),O=D.length;return(0,K.useLayoutEffect)(()=>{let e=f.current;if(!e||!O||Q||!k())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];j(t,{opacity:0,scale:.5});let n=()=>j(t,{opacity:1,scale:1}),r=()=>{m.current=null;let e=ee(t,{opacity:1,scale:1,duration:M[7],delay:l(M[1],{start:M[7]}),ease:P});n=T(e,M[7]+M[1]*O+M[7])};return p.current?r():m.current=r,()=>{m.current=null,n()}},[O]),(0,q.jsxs)(`svg`,{ref:f,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,q.jsx)(`path`,{d:X(y,b,.05),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(y,x,-.07),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(y,S,.07),className:`cm-edge`}),w.map(e=>(0,q.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,q.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${g} rules`,children:[(0,q.jsx)(`circle`,{cx:y.x,cy:y.y,r:y.r,className:`cm-hub-disc`}),(0,q.jsx)(`text`,{x:y.x,y:y.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,q.jsxs)(`text`,{x:y.x,y:y.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[g,` rules`]}),(0,q.jsx)(`text`,{x:y.x,y:y.y+24,textAnchor:`middle`,className:`cm-note`,children:v})]}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${h.ontology??0} sections`,children:[(0,q.jsx)(`circle`,{cx:b.x,cy:b.y,r:b.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:b.x,y:b.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,q.jsxs)(`text`,{x:b.x,y:b.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[h.ontology??0,` sections`]})]}),(0,q.jsx)(`text`,{x:b.x,y:b.y+b.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${c}: ${h.laws??0}, never broken`,children:[(0,q.jsx)(`circle`,{cx:x.x,cy:x.y,r:x.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:x.x,y:x.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:c}),(0,q.jsx)(`text`,{x:x.x,y:x.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:h.laws??0})]}),(0,q.jsx)(`text`,{x:x.x,y:x.y+x.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${d}: ${h.doctrines?.rules??0} rules`,children:[(0,q.jsx)(`circle`,{cx:S.x,cy:S.y,r:S.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:S.x,y:S.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:d}),(0,q.jsx)(`text`,{x:S.x,y:S.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:h.doctrines?.rules??0})]}),(0,q.jsx)(`text`,{x:S.x+22,y:S.y+S.r+20,className:`cm-note`,children:h.doctrines?`${h.doctrines.active}/${h.doctrines.total} packs built in`:`packs chosen at build`}),(0,q.jsx)(`g`,{className:`cm-mini`,children:D.map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:i(e.id)}}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,q.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:i(e.id)},children:e.n})]},e.id))}),(0,q.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),w.map(e=>(0,q.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,q.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,q.jsx)(`text`,{x:b.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ie({counts:e}){let t=[{label:d.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules`,n:a(e),hash:`#/laws`},{label:d.agents.label,n:e.agents??0,hash:`#/agents`},{label:d.memory.label,n:e.memory??0,hash:`#/personal/memory`},{label:d.notebook.label,n:e.notebook??0,hash:`#/personal/notebook`},{label:d.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:d.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Growth rings`}),(0,q.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,q.jsxs)(`button`,{className:`jr-ring`,onClick:()=>s(e.hash),children:[(0,q.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,q.jsx)(`span`,{className:`jr-ring-track`,children:(0,q.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,q.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ae({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Freshly grown`}),(0,q.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,q.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,q.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>s(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,q.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,q.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,q.jsx)(`span`,{className:`jr-fresh-when`,children:c(e.mtime)})]},`${e.section}:${e.name}`)):(0,q.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,q.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,q.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${c(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>s(`#/activity`),children:`log →`})]})]})}function oe({overview:e,recent:t,lens:n,dataRev:r}){let i=e?.counts||{};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`jr-head`,children:(0,q.jsx)(B,{verdict:n?.verdict})}),(0,q.jsxs)(`div`,{className:`jr-row2`,children:[(0,q.jsx)(ie,{counts:i}),(0,q.jsx)(ae,{recent:t,buildEpoch:e?.build_epoch})]}),(0,q.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,q.jsx)(`button`,{className:`jr-go right`,onClick:()=>s(`#/laws`),children:`open →`})]}),(0,q.jsx)(re,{overview:e,dataRev:r})]})]})}export{oe as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
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-DxwG8y94.js";import{H as i,J as a,Ot as o,Q as s,W as c,Y as l,Z as u,_ as d,at as f,b as p,c as m,d as h,dt as g,et as _,f as v,g as y,h as b,ht as x,l as S,m as ee,mt as C,nt as w,p as T,rt as te,s as ne,tt as re,u as ie,ut as E,v as D,wt as O,y as k,z as A}from"./index-MB7E-va_.js";import{t as ae}from"./EmptyState-CY5Pm2xy.js";import{t as oe}from"./FilterInput-qGKNSlxv.js";import{t as j}from"./Markdown-CxkA7940.js";var M=e(t(),1);function se({items:e,packs:t,install:n,canApply:r,onAction:i,gateArmed:a}){let o=f(),c=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),l=c.join(`,`),d=s(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=u(c),{prune:g}=d,_=e.length>0;(0,M.useEffect)(()=>{_&&g(`rules`,(e,t)=>e===p&&t.base!==m)},[_,p,m,g]);let v=d.get(`rules`,p),y=v&&v.base===m?v:null,b=y?y.value:c,x=d.running(`rules`,p)||!!y?.applied,S=!!y?.failed,w=e=>{x||d.put(`rules`,p,e(b),m)},T=e=>b.includes(e),te=e=>w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),re=e=>e.rules.some(e=>T(e.addr)),ie=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>T(e.addr));w(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},E=e=>{let t=e.rules.filter(e=>T(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`},D=t.flatMap(e=>e.rules.map(e=>e.addr)),O=D.filter(T),k=O.join(`,`)!==l,A=`process.5`,ae=c.includes(A)&&!b.includes(A),oe=(0,M.useRef)(!1),j=async()=>{if(!r||!k||x||oe.current)return;let e=t.filter(e=>e.rules.some(e=>T(e.addr))).map(e=>e.pack),s=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!T(e.addr)).map(e=>e.addr)),l=ae?`
|
|
2
|
-
|
|
3
|
-
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary (Bob still logs its warning). `+(a?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,u={},f=[],m=[];for(let[e,{key:r,label:i}]of Object.entries(h)){if(!e.includes(`.`))continue;let a=t.flatMap(e=>e.rules).find(t=>t.addr===e)?.name||e,o=c.includes(e),s=n?.[r]!==!1;o&&!T(e)&&s&&(u[r]=!1,m.push(`Excluding ${a} also switches the ${i.toLowerCase()} off: its text goes, and its hook stops asking.`)),!o&&T(e)&&!s&&(f.push({key:r,label:i}),m.push(`Including ${a} brings its text back; the ${i.toLowerCase()} stays off unless you tick the box.`))}for(let e of ee){if(e===A||!c.includes(e)||T(e))continue;let n=t.flatMap(e=>e.rules).find(t=>t.addr===e)?.name||e;m.push(`Excluding ${n} also drops its hook: it stops asking on every host.`)}for(let e of ne){if(!c.includes(e)||T(e))continue;let n=t.flatMap(e=>e.rules).find(t=>t.addr===e)?.name||e;m.push(`Excluding ${n} drops its text; its hook still asks (it has no switch yet).`)}let g=O.length?`${O.length} of ${D.length} doctrine rules`:`no doctrine rules`,_=m.length?`\n\n${m.join(`
|
|
4
|
-
`)}`:``,v=f.length?{label:`Also turn the ${f.map(e=>e.label.toLowerCase()).join(` and `)} back on`,checked:!0}:void 0;oe.current=!0;try{let t=!0;if((l||m.length||v)&&(t=await o(`Rebuild ${C(n)} with ${g}? It rebuilds in place, non-destructive.${l}${_}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`,check:v})),!t){d.drop(`rules`,p);return}let r={...u};if(t?.checked!==!1)for(let e of f)r[e.key]=!0;await i(`install`,{...n,doctrines:e,excludeRules:s,...r})?d.startApply(`rules`,p):d.fail(`rules`,p)}finally{oe.current=!1}},se=()=>{x||d.drop(`rules`,p)},N=(0,M.useRef)(j);(0,M.useEffect)(()=>{N.current=j});let P=O.join(`,`),F=!(!r||!k||!y||y.sent||x||S||d.busy);return(0,M.useEffect)(()=>{if(!F)return;let e=setTimeout(()=>N.current(),700);return()=>clearTimeout(e)},[F,P]),{deployedRules:c,isOn:T,toggleRule:te,packOn:re,togglePack:ie,packState:E,allRules:D,pickedRules:O,dirty:k,pending:F,running:x,failed:S,busy:d.busy,losingConsent:ae,applyPacks:j,revert:se}}var N=n();function P({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:c,toggleCol:l=null,renderBody:u,srcLine:d,after:f=null}){let p=(0,M.useId)(),{data:m,error:h,reload:g}=O(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,c],`law-item`),v=t&&(0,N.jsxs)(`div`,{className:`law-expand`,id:p,children:[h?(0,N.jsx)(_,{error:h,onRetry:g}):m?u(m):(0,N.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,N.jsx)(`div`,{className:`law-srcline`,children:d}),f]}),y={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":p,"aria-label":s};return l?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,N.jsx)(`button`,{className:`law-disclosure`,...y,children:o}),(0,N.jsx)(`span`,{className:`toggle-col`,children:l})]}),v]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`button`,{className:i,style:a,"data-addr":e,...y,children:o}),v]})}function F({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null,after:a=null}){let o=e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``,s=(0,N.jsx)(`span`,{className:`law-enf${o}`,"data-col":`enf`,"aria-hidden":i?`true`:void 0,children:e.enf},`enf`),c=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`span`,{className:`law-no`,"data-col":`no`,children:[(0,N.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,N.jsxs)(`span`,{className:`law-name`,children:[(0,N.jsx)(`span`,{children:e.name}),e.ess?(0,N.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,N.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null,e.note?(0,N.jsx)(`span`,{className:`law-note`,children:e.note}):null,e.no?(0,N.jsxs)(`span`,{className:`law-fold law-fold-no`,"aria-hidden":`true`,children:[(0,N.jsx)(`span`,{className:`x`,children:`›`}),e.no]}):null,e.latin?(0,N.jsx)(`span`,{className:`law-fold law-fold-latin`,"aria-hidden":`true`,children:e.latin}):null,(0,N.jsxs)(`span`,{className:`law-fold law-fold-chips`,"aria-hidden":`true`,children:[(0,N.jsx)(`span`,{className:`law-chip-status ${e.statusTone}`,children:e.status}),(0,N.jsx)(`span`,{className:`law-chip-enf${o}`,children:e.enf})]})]}),(0,N.jsx)(`span`,{className:`law-latin`,"data-col":`latin`,children:e.latin}),(0,N.jsx)(`span`,{className:`law-status ${e.statusTone}`,"data-col":`status`,children:e.status}),i?null:s]});return(0,N.jsx)(P,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:c,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i?[i[0],s,i[1]]:null,renderBody:t=>(0,N.jsx)(j,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`,after:a})}var I=[`invariants`,`doctrines`];function ce({tiers:e,current:t,onPick:n}){return(0,N.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`span`,{className:`tier-head`,children:[(0,N.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,N.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,N.jsxs)(`span`,{className:`tier-top`,children:[(0,N.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,N.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,N.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,N.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,N.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,N.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,N.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&I.includes(e.key)?(0,N.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,N.jsx)(`div`,{className:a,children:i},e.key)})})}function le({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1,install:i=null,slot:a=0}){let o=i?C(i):``,s=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(y(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),c=Math.max(1,...s.map(([,e])=>e));return(0,N.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,N.jsxs)(`div`,{className:`panel-head`,children:[(0,N.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,N.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i&&s.some(e=>e[2])&&(0,N.jsx)(`span`,{className:`lib-legend mono`,children:(0,N.jsxs)(`span`,{children:[a>=0&&(0,N.jsx)(`i`,{className:`lr-dot`,style:E(a),"aria-hidden":`true`}),o]})}),s.length?(0,N.jsx)(`ul`,{className:`gate-list`,children:s.map(([e,r,s])=>{let l=y(e),u=t[l]?.name||d(l);return(0,N.jsxs)(`li`,{children:[(0,N.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(l),children:(0,N.jsxs)(`span`,{className:`gate-top`,children:[(0,N.jsx)(`span`,{className:`gate-name${s?` dim`:``}`,children:u}),s&&(0,N.jsxs)(`span`,{className:`mono off`,children:[i&&a>=0&&(0,N.jsx)(`i`,{className:`lr-dot`,style:E(a),"aria-hidden":`true`}),`off`,i&&(0,N.jsxs)(`span`,{className:`sr-only`,children:[` · `,o]})]}),(0,N.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,N.jsx)(A,{value:r,max:c,label:`${u} asks`,tone:s?`accent`:`warn`})]},e)})}):(0,N.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,N.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function ue({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,running:l,failed:u,losingConsent:d}=t,f=Math.max(1,...e.map(e=>e.rules.length));return(0,N.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,N.jsxs)(`div`,{className:`panel-head`,children:[(0,N.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,N.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,N.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,N.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,N.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,N.jsx)(A,{value:t,max:f,label:`${e.title} rules on`}),(0,N.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,N.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,disabled:l,title:l?`Rebuilding…`:void 0,onClick:()=>s(e)}):null]},e.pack)})}):(0,N.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,N.jsxs)(N.Fragment,{children:[d&&(0,N.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,N.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,N.jsx)(`code`,{children:`git commit`}),` and `,(0,N.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,N.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:l?`Rebuilding ${r.host} · ${r.scope}…`:u&&c?`The rebuild did not go through. Retry or Revert below.`:c?`Applying… ${r.host} · ${r.scope} rebuilds once the switches settle.`:`Matches the deployed install. A change rebuilds it automatically.`})]})]})}var de=`ont:ownership`,fe=e=>e===`ownership`?de:e,pe=`process.5`;function me(e,t){let n=[];for(let r of e){if(r.tier!==`doctrine`)continue;let e=n.find(e=>e.pack===r.pack);e||(e={pack:r.pack,title:r.packTitle||r.pack,desc:r.packDesc||``,active:r.packActive!==!1,rules:[]},n.push(e));let i=D(r.title);e.rules.push({addr:r.name,no:`${r.pack} ${r.name.split(`.`)[1]||``}`,name:i.name,latin:i.latin,ess:r.summary||``,enf:b(r.name,t),c:p[r.pack]||`var(--text-3)`,src:`doctrines/${r.pack}.md`})}return n}function he(e){let t=l(e.dataRev),[n,r]=a(`laws`,t);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(w,{className:`page-pick`,installs:t,value:n,onChange:r}),(0,N.jsx)(R,{...e,install:n,listed:t!==null,installSlot:g((t||[]).map(e=>e.id)).indexOf(n?.id)},n?.id??`none`)]})}var L=(e,t)=>e?.install?.host===t.host&&e.install.path===t.path;function R({install:e,listed:t,installSlot:n,...i}){let a=e&&L(i.overview,e)?i.overview:null,{data:o,error:s,loading:c}=O(()=>Promise.resolve().then(()=>e&&!a?r.overview(x(e)):null),[!!a,i.dataRev]),l=a||(e&&L(o,e)?o:null),u=e?l:i.overview,d=!(!e||l||c);return(0,N.jsxs)(N.Fragment,{children:[d?(0,N.jsx)(_,{error:`Could not read this install's gates${s?`: ${s}`:`.`}`}):null,(0,N.jsx)(z,{...i,overview:u,pair:x(e),onAction:t&&(!e||l!==null)?i.onAction:void 0,pending:!t||!!(e&&!l&&c),gatesUnread:d,installSlot:n})]})}function z({selected:e,overview:t,setup:n,onAction:a,dataRev:s,pair:l,pending:u,gatesUnread:d,installSlot:g}){let x=f(),{data:w,error:E}=O(()=>r.catalog(`laws`,l),l?[s,l.host,l.path]:[s],`catalog:laws`),{data:j}=c(s,l),[P,I]=(0,M.useState)(`all`),[he,L]=(0,M.useState)(``),[R,z]=(0,M.useState)(`all`),[ge,_e]=(0,M.useState)(()=>new Set),B=fe(e)||null,ve=e=>o(B===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),V=t?.install,H=!!(V&&a),[ye,be]=(0,M.useState)(0),xe=(0,M.useRef)(null);(0,M.useEffect)(()=>{if(!B)return;let e=requestAnimationFrame(()=>{let e=document.querySelector(`[data-addr="${CSS.escape(B)}"]`);if(!e)return;let t=xe.current===B;xe.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)},[B,ye,w]);let Se=w?.items||[],U=me(Se,t?.install),W=e=>t?.install?.[h[e].key]!==!1,Ce=W(`IV`),G=se({items:Se,packs:U,install:V,canApply:H,onAction:a,gateArmed:Ce}),{deployedRules:K,isOn:q,toggleRule:we,packOn:Te,packState:Ee,allRules:J}=G;if(E)return(0,N.jsx)(_,{error:E});if(!w||u)return(0,N.jsx)(re,{});let Y={ontology:w.nouns?.ontology||`Ethos`,law:w.nouns?.law||`Dictate`,laws:w.nouns?.laws||`Dictates`,doctrines:w.nouns?.doctrines||`Doctrines`},De=(e,t)=>{let n=b(e,t);return d&&h[e]&&n===`Hook gate`?`Unknown`:n},Oe=Se.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:e.name===de&&(V||d)?De(`ownership`,V):`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),X=Se.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&k[e.klass]?e.klass:`craft`,r=D(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`:De(e.name,t?.install),cat:n,c:k[n].c,off:r.retired,src:`laws/universal.md`}}),ke=H?[{addr:`ownership`,name:h.ownership.label,latin:``,ess:``,enf:b(`ownership`,V)}]:[],Ae=e=>q(e)?!1:ne.has(e)?!0:!h[e]||d?!1:W(e)&&!K.includes(e),je=e=>{let t=q(e.addr),n=K.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,enf:d&&h[e.addr]&&e.enf===`Hook gate`?`Unknown`:e.enf,note:Ae(e.addr)?`Text excluded; the hook still asks.`:``,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Me=U.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!K.includes(e.addr)).map(e=>e.addr)),Ne=async e=>{if(!H)return;let{key:t,label:n}=h[e],r=n.toLowerCase(),i=!W(e),o=C(V),s=G.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await x((i?`Re-arm the ${r} on ${o}? ${S[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${o}? ${S[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`})&&a(`install`,{...V,[t]:i})},Pe=(e,t)=>(0,N.jsx)(`button`,{type:`button`,className:`sw-toggle${W(e)?` on`:``}`,role:`switch`,"aria-checked":W(e),"aria-label":t?`${h[e].label}: hook gate of ${t}`:h[e].label,onClick:()=>Ne(e)}),Fe=(e,t)=>(0,N.jsxs)(`span`,{className:`no-gate`,title:t,children:[e,(0,N.jsxs)(`span`,{className:`sr-only`,children:[`: `,t]})]}),Ie=(e,t)=>[(0,N.jsx)(`span`,{className:`toggle-cell`,children:e},`text`),(0,N.jsx)(`span`,{className:`toggle-cell`,children:t},`gate`)],Le=e=>h[e.addr]?Pe(e.addr,e.name):e.addr===pe?Fe(`with text`,`No switch of its own: excluding ${e.name} drops its commit and push ask in the same rebuild (Bob still logs its warning).`):ee.has(e.addr)?Fe(`with text`,`No switch of its own: excluding ${e.name}, or its pack, drops its hook in the same rebuild.`):ne.has(e.addr)?Fe(`always on`,`No switch yet: the hook asks even with ${e.name}'s text excluded.`):null,Re=e=>String(e.addr).includes(`.`)&&q(e.addr)!==K.includes(e.addr),ze=(e,t=R)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(h[e.addr]||ne.has(e.addr)||!String(e.addr).includes(`.`)||K.includes(e.addr)):Re(e)),Z=he.trim().toLowerCase(),Q=e=>ze(e)&&(!Z||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(Z)),Be=e=>{let t=Qe[e];(String(e).includes(`.`)?P===`invariants`:t&&P===`doctrines`)&&I(`all`),t&&!ze(t)&&z(`all`),t&&!Q(t)&&L(``),xe.current=fe(e),be(e=>e+1),o(`#/item/law/${encodeURIComponent(e)}`)},Ve={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))Ve[y(e)]=t;let He=e=>Ve[e.addr]?{...e,asks:`${Ve[e.addr]} ask${Ve[e.addr]===1?``:`s`}`}:e,Ue=X.filter(e=>!e.retired).length,We=K.length,Ge=e=>{if(d)return[`gates unread`,`warn`];let t=e.filter(e=>h[e.addr]&&!W(e.addr)).length;return t?[`${t} gate${t===1?``:`s`} off`,`warn`]:[`always`,`ok`]},Ke=J.length-We,qe=[Ke>0&&`${Ke} excluded`,!d&&!W(`rigor.5`)&&`1 gate off`].filter(Boolean),Je=qe.length?[qe.join(` · `),`warn`]:[`all on`,`ok`],$=j?.stats,Ye={ethos:{name:Y.ontology,n:Oe.length,fill:1,sub:`${Oe.length} sections`,pill:Ge(ke)},invariants:{name:Y.laws,n:X.length,fill:X.length?Ue/X.length:0,sub:X.length>Ue?`${Ue} active · ${X.length-Ue} retired`:`${Ue} active`,pill:Ge(X)},doctrines:{name:Y.doctrines,n:J.length,fill:J.length?We/J.length:0,sub:`${U.length} packs`,pill:Je},yours:{name:`Your rules`,n:$?.rules??``,fill:+!!$?.rules,sub:$?`${$.rules} rule${$.rules===1?``:`s`} · ≈${$.tokens.toLocaleString(`en-US`)} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},Xe=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,Y.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Ze=v.map(e=>({key:e.key,...Ye[e.key],rule:Xe(e.against)})),Qe=Object.fromEntries([...X,...U.flatMap(e=>e.rules)].map(e=>[e.addr,e])),$e=[[`all`,`All`,X.length+J.length],[`invariants`,Y.laws,X.length],[`doctrines`,Y.doctrines,J.length]],et=P===`all`||P===`invariants`,tt=P===`all`||P===`doctrines`,nt=[...ke,...et?X:[],...tt?U.flatMap(e=>e.rules):[]],rt=[[`gated`,`Gated`,d?null:nt.filter(e=>ze(e,`gated`)).length],[`changed`,`Changed`,nt.filter(e=>ze(e,`changed`)).length]],it=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,at=e=>R!==`changed`&&ge.has(e)&&it(B)!==e,ot=e=>{let t=at(e);_e(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&it(B)===e&&o(`#/laws`)},st=U.flatMap(e=>e.rules.filter(Re).map(e=>({...e,plus:q(e.addr)}))),ct=H&&U.length>0&&G.dirty&&G.failed,lt=()=>{z(`changed`),P===`invariants`&&I(`all`),L(``)},ut=(e,t)=>(0,N.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,N.jsx)(`h2`,{className:`tier-h`,children:e}),(0,N.jsx)(`span`,{className:`mono dim`,children:t})]}),dt=e=>(0,N.jsxs)(`div`,{className:`law-rowhead`,"aria-hidden":`true`,children:[(0,N.jsx)(`span`,{"data-col":`no`,children:`No.`}),(0,N.jsx)(`span`,{children:`Rule`}),(0,N.jsx)(`span`,{"data-col":`latin`,children:`Latin name`}),(0,N.jsx)(`span`,{"data-col":`status`,children:`Status`}),e&&(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`span`,{className:`rh-cut`,children:`Rule `}),`text`]}),(0,N.jsx)(`span`,{"data-col":`enf`,children:`Enforced by`}),e&&(0,N.jsxs)(`span`,{children:[(0,N.jsx)(`span`,{className:`rh-cut`,children:`Hook `}),`gate`]})]}),ft=X.filter(Q),pt=(Z||R!==`all`?ke.filter(Q).length:0)+(et?ft.length:0)+(tt?U.reduce((e,t)=>e+t.rules.filter(Q).length,0):0),mt=He(ke[0]||{}).asks,ht=(e,t)=>H?(0,N.jsxs)(`div`,{className:`law-gate`,children:[(0,N.jsxs)(`span`,{className:`law-name`,children:[(0,N.jsx)(`span`,{children:h[e].label}),t?(0,N.jsx)(`span`,{className:`law-asks mono`,children:t}):null,(0,N.jsx)(`span`,{className:`law-princ`,children:S[e].desc})]}),Pe(e)]}):null,gt=t?.install?.[m.key]===!1,_t=async()=>{let e=!gt,t=C(V),n=G.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await x((e?`Switch strict consent on for ${t}? ${m.on} It rebuilds in place, non-destructive.`:`Switch strict consent off on ${t}? ${m.off} It rebuilds in place, non-destructive.`)+n,{title:e?`Switch strict consent on?`:`Switch strict consent off?`,confirmLabel:e?`Switch on`:`Switch off`})&&a(`install`,{...V,[m.key]:!e})},vt=()=>H&&!d&&K.includes(m.addr)?(0,N.jsxs)(`div`,{className:`law-gate`,children:[(0,N.jsxs)(`span`,{className:`law-name`,children:[(0,N.jsx)(`span`,{children:m.label}),(0,N.jsx)(`span`,{className:`law-princ`,children:m.desc})]}),(0,N.jsx)(`button`,{type:`button`,className:`sw-toggle${gt?` on`:``}`,role:`switch`,"aria-checked":gt,"aria-label":m.label,onClick:_t})]}):null,yt=e=>{let t=ie[e];return t?(0,N.jsxs)(`details`,{className:`law-hook`,children:[(0,N.jsx)(`summary`,{children:`What the hook does`}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Triggers on`}),(0,N.jsx)(`dd`,{children:t.on}),(0,N.jsx)(`dt`,{children:`Per host`}),(0,N.jsx)(`dd`,{children:t.hosts}),(0,N.jsx)(`dt`,{children:`Does not see`}),(0,N.jsx)(`dd`,{children:t.blind}),(0,N.jsx)(`dt`,{children:`If switched off`}),(0,N.jsx)(`dd`,{children:t.off})]})]}):null};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(i,{eyebrow:V?[t?.theme,V.footprint&&`${V.footprint} footprint`,C(V)].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,N.jsx)(oe,{className:`law-filter`,value:he,onChange:L,placeholder:`Filter rules`,label:`Filter rules`})}),(0,N.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,N.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,N.jsx)(ce,{tiers:Ze,current:P,onPick:I}),(0,N.jsx)(`div`,{className:`ladder-tail`,children:T.map((e,t)=>(0,N.jsxs)(`span`,{className:`ladder-low`,children:[(0,N.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,v.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,N.jsxs)(`div`,{className:`split`,children:[(0,N.jsxs)(`section`,{className:`panel flush law-wrap${H?` with-toggle`:``}`,"aria-label":`Rules`,children:[Oe.length>0&&(0,N.jsxs)(N.Fragment,{children:[ut(Y.ontology,`ontology/universal.md`),dt(!1),Oe.map(e=>(0,N.jsx)(F,{law:e,rev:s,isOpen:B===e.addr,onToggle:()=>ve(e.addr),after:e.addr===de?(0,N.jsxs)(N.Fragment,{children:[yt(`ownership`),ht(`ownership`,mt)]}):null},e.addr))]}),(0,N.jsxs)(`div`,{className:`law-toolbar`,children:[(0,N.jsx)(te,{"aria-label":`Show`,children:$e.map(([e,t,n])=>(0,N.jsxs)(`button`,{type:`button`,className:P===e?`on`:``,"aria-pressed":P===e,onClick:()=>I(e),children:[t,` `,(0,N.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,N.jsx)(te,{"aria-label":`Narrow`,children:rt.map(([e,t,n])=>(0,N.jsxs)(`button`,{type:`button`,className:R===e?`on`:``,"aria-pressed":R===e,disabled:n===null,onClick:()=>z(R===e?`all`:e),children:[t,` `,n===null?null:(0,N.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),et&&ft.length>0&&(0,N.jsxs)(N.Fragment,{children:[ut(Y.laws,`laws/universal.md`),dt(H),ft.map(e=>(0,N.jsx)(F,{law:He(e),rev:s,isOpen:B===e.addr,onToggle:()=>ve(e.addr),after:yt(e.addr),toggleCol:!H||e.retired?null:Ie(Fe(`locked`,`A ${Y.law} cannot be excluded: its text always binds.`),h[e.addr]?Pe(e.addr,e.name):null)},e.addr))]}),tt&&U.map(e=>{let t=e.rules.filter(Q);if(!t.length)return null;let n=at(e.pack),r=e.rules.filter(e=>q(e.addr)).length;return(0,N.jsxs)(`div`,{className:`pack-wrap${Te(e)?``:` pack-off`}`,children:[(0,N.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,N.jsx)(`h2`,{className:`tier-h`,style:{"--cc":p[e.pack]},children:(0,N.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>ot(e.pack),children:e.title})}),(0,N.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,N.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,N.jsx)(`span`,{className:`pack-fill`,children:(0,N.jsx)(A,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,N.jsx)(`span`,{className:`pack-state mono`,children:Ee(e)})]}),!e.active&&!H&&(0,N.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,U.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Me.length>0&&` --exclude-rules ${Me.join(`,`)}`]}),!n&&dt(H),!n&&t.map(e=>(0,N.jsx)(F,{law:He(je(e)),rev:s,isOpen:B===e.addr,onToggle:()=>ve(e.addr),after:e.addr===m.addr?(0,N.jsxs)(N.Fragment,{children:[yt(e.addr),vt()]}):yt(e.addr),toggleCol:H?Ie((0,N.jsx)(`button`,{type:`button`,className:`sw-toggle${q(e.addr)?` on`:``}`,role:`switch`,"aria-checked":q(e.addr),"aria-label":`${e.name} rule text`,disabled:G.running,title:G.running?`Rebuilding…`:void 0,onClick:()=>we(e.addr)}),Le(e)):null},e.addr))]},e.pack)}),pt===0&&(0,N.jsx)(ae,{title:Z||R!==`all`?`No matching rules`:`Nothing in this tier`,children:Z?(0,N.jsxs)(N.Fragment,{children:[`Nothing matches “`,he.trim(),`”.`]}):R===`all`?(0,N.jsx)(N.Fragment,{children:`This install predates the tier.`}):(0,N.jsxs)(N.Fragment,{children:[`No `,R,` rule in this tier.`]})})]}),(0,N.jsxs)(`aside`,{className:`aside-stack`,children:[(0,N.jsx)(ue,{packs:U,sel:G,canApply:H,install:V,gateArmed:Ce}),(0,N.jsx)(le,{gates:n?.gates,byAddr:Qe,onJump:Be,disarmed:e=>!!h[e]&&!W(e),install:t?.install,slot:g})]})]}),ct&&(0,N.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,N.jsxs)(`span`,{className:`law-bar-n`,children:[`Rebuild failed · `,st.length,` unapplied change`,st.length===1?``:`s`]}),(0,N.jsx)(`span`,{className:`law-bar-list`,children:st.map(e=>(0,N.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,N.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:lt,children:`Review changes`}),(0,N.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{z(`all`),G.revert()},children:`Revert`}),(0,N.jsxs)(`button`,{type:`button`,className:`btn`,onClick:G.applyPacks,disabled:G.busy,title:G.busy?`A job is running`:void 0,children:[`Retry (`,G.pickedRules.length,`/`,J.length,` rules)`]})]})]})}export{he as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Markdown-CxkA7940.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/AgentGlyph-k6o3gCM1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DxwG8y94.js";import{B as i,Ot as a,S as o,U as s,Y as c,_t as l,at as u,dt as ee,et as d,it as f,mt as p,rt as m,t as h,tt as g,ut as _,wt as v,x as y}from"./index-MB7E-va_.js";import{n as b,t as x}from"./sections-CtFz7HFH.js";import{a as te,c as ne,i as re,l as ie,n as ae,o as oe,r as se,t as ce}from"./LibRows-CGO25X3D.js";import{t as le}from"./EmptyState-CY5Pm2xy.js";import{o as S}from"./motion-RlUl1osO.js";var C=e(t(),1),w=n();function ue({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,w.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function T({entries:e}){return e.length?(0,w.jsxs)(`table`,{className:`mf-entries`,children:[(0,w.jsx)(`thead`,{className:`sr-only`,children:(0,w.jsxs)(`tr`,{children:[(0,w.jsx)(`th`,{scope:`col`,children:`Path`}),(0,w.jsx)(`th`,{scope:`col`,children:`Load`}),(0,w.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,w.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,w.jsxs)(`tr`,{children:[(0,w.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,w.jsx)(`td`,{className:`mf-load-cell`,children:(0,w.jsx)(ue,{load:e.load})}),(0,w.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function de({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,w.jsxs)(`div`,{className:`mf-vault`,children:[(0,w.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,w.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,w.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,w.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,w.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,w.jsxs)(`span`,{className:`mf-role`,children:[(0,w.jsx)(l,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,w.jsxs)(`span`,{className:`mf-role`,children:[(0,w.jsx)(l,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,w.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,w.jsx)(l,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,w.jsx)(T,{entries:t})]})}function E({body:e}){let[t,n]=(0,C.useState)(!1),r=(0,C.useId)();return e?(0,w.jsxs)(`div`,{className:`mf-raw`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,w.jsx)(l,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,w.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function fe({manifest:e,body:t,name:n}){if(!e)return(0,w.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,w.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,w.jsx)(de,{wiki:e},e.name||t)),(0,w.jsx)(E,{body:t})]}):(0,w.jsxs)(`div`,{className:`mf-empty`,children:[(0,w.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,w.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,w.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,w.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,w.jsx)(E,{body:t})]})}let r=e.context||[];return r.length?(0,w.jsxs)(`div`,{className:`mf-doc`,children:[(0,w.jsx)(T,{entries:r}),(0,w.jsx)(E,{body:t})]}):(0,w.jsxs)(`div`,{className:`mf-empty`,children:[(0,w.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,w.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,w.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,w.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,w.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,w.jsx)(E,{body:t})]})}var D={strong:`acc`,standard:``,light:`ok`},pe={pin:`your pin`,map:`the tiers map`,default:`the tier default`,inherit:`your session model`};function me({name:e,install:t,installName:n}){let{data:i,error:a,setData:o}=v(()=>Promise.resolve().then(()=>r.agentModels(t)),[e,t?.host,t?.path]),[s,c]=(0,C.useState)(null),[l,u]=(0,C.useState)(``),[ee,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(!1),m=i?.agents?.find(t=>t.name===e);if(a||!m)return null;let h=m.from===`pin`?null:i.warnings?.find(e=>e.includes(`the ${m.tier} tier`)),g=n?` on ${n}`:``,_=m.pin??``,y=s??_,b=async n=>{p(!0),u(``);try{let i=await r.agentModelsSave({agents:{[e]:n}},t);o(i),c(null),d(!0)}catch(e){u(e.message)}finally{p(!1)}};return(0,w.jsxs)(`div`,{className:`agent-model`,role:`group`,"aria-label":`Model of ${e}`,children:[(0,w.jsxs)(`div`,{className:`row gap-8 wrap`,children:[m.tier?(0,w.jsxs)(`span`,{className:`tag ${D[m.tier]??``}`,title:`The tier this agent's source declares`,children:[m.tier,` tier`]}):(0,w.jsx)(`span`,{className:`tag`,title:`No Geneseed source: not tiered`,children:`not tiered`}),i.claude?(0,w.jsxs)(`span`,{className:`sub`,"data-testid":`agent-model-effective`,children:[m.model?(0,w.jsxs)(w.Fragment,{children:[`runs on `,(0,w.jsx)(`code`,{children:m.model}),` (`,pe[m.from],`)`]}):(0,w.jsx)(w.Fragment,{children:`runs on your session model`}),g]}):null]}),i.claude?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`label`,{className:`row gap-8 wrap`,children:[(0,w.jsx)(`span`,{className:`dim`,children:`Pin a model`}),(0,w.jsx)(`input`,{className:`inp`,type:`text`,"aria-label":`pin a model for ${e}`,placeholder:`none: follows the tier`,disabled:!!i.file?.problem||f,value:y,onChange:e=>{c(e.target.value),d(!1)}}),(0,w.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:f||!!i.file?.problem||s===null||s.trim()===_,onClick:()=>b(s.trim()),children:`Save pin`}),_?(0,w.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:f||!!i.file?.problem,onClick:()=>b(null),children:`Clear pin`}):null]}),i.file?.problem?(0,w.jsxs)(`p`,{className:`sub tiers-warn`,role:`alert`,children:[i.file.problem,`.`]}):null,h?(0,w.jsx)(`p`,{className:`sub tiers-warn`,role:`note`,children:h}):null,l?(0,w.jsx)(`p`,{className:`sub tiers-warn`,role:`alert`,children:l}):null,ee?(0,w.jsx)(`p`,{className:`sub`,children:`Saved. The agent file changes at the next rebuild of this install.`}):null]}):null]})}var O=e=>e>=1e3?`${(e/1e3).toFixed(+(e<1e4))}k`:String(e),he=e=>Math.round(e/4),k=[{key:`root`,label:`Constitution`,tone:`accent`,has:e=>e.source===`root`},{key:`catalogue`,label:`Catalogues`,tone:`muted`,has:e=>e.source===`catalogue`},{key:`agent`,label:`This agent`,tone:`warn`,has:e=>e.source!==`root`&&e.source!==`catalogue`}],A=[[`dictate`,`Dictates`],[`doctrine`,`Doctrines`],[`user`,`User rules`]],ge={"not-wired":`not wired, re-emit this install`,"no-event":`not delivered on this host`};function j(e,t){if(!e||!t)return``;let n=(e,t)=>e.blocks.filter(e=>e.chars>0&&!t.blocks.some(t=>t.id===e.id)),r=e=>e.id===`session-files`?`session files`:e.label.replace(/^.* spec$/,`spec`);return[...n(e,t).map(e=>`+ ${r(e)} ${O(e.chars)}`),...n(t,e).map(e=>`− ${r(e)} ${O(e.chars)}`)].join(`, `)}var _e=e=>e.kind===`user`?`#/personal/rules`:`#/item/law/${encodeURIComponent(e.id)}`,ve=e=>`${e.layer??``}${e.id}`;function ye({label:e,n:t,children:n}){return(0,w.jsxs)(`li`,{children:[(0,w.jsx)(`span`,{children:e}),n,(0,w.jsx)(`span`,{className:`mono`,children:O(t)})]})}function be({loadout:e,base:t,error:n,install:r}){let[a,o]=(0,C.useState)(!1),[s,c]=(0,C.useState)(e?.agent);if(e?.agent!==s&&(c(e?.agent),o(!1)),n)return(0,w.jsx)(`p`,{className:`sub`,children:`Loadout not measured for this install.`});if(!e)return null;let l=e=>e.reduce((e,t)=>e+t.chars,0),u=l(e.blocks),ee=j(e,t),d=k.map(t=>{let n=e.blocks.filter(t.has);return{...t,blocks:n,n:l(n)}}),[f,p,m]=d,h=Math.max(1,...f.blocks.map(e=>e.chars)),g=e.blocks.find(e=>e.id===`user-rules`),_=g?ge[g.delivery]:void 0,v=e.rules||[],y=v.filter(e=>!(_&&e.kind===`user`)),b=v.filter(e=>e.citedBySpec),x=[];for(let e of v){let t=e.kind===`dictate`?`Dictates`:e.kind===`user`?`User rules`:e.id.split(`.`)[0],n=x.find(e=>e.name===t);n?n.n+=1:x.push({name:t,n:1,user:e.kind===`user`})}let te=A.map(([e,t])=>[t,y.filter(t=>t.kind===e).length]).filter(([,e])=>e>0);return(0,w.jsxs)(`section`,{className:`loadout`,"aria-label":`Loadout`,children:[(0,w.jsxs)(`header`,{className:`loadout-head`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsxs)(`h3`,{className:`loadout-eyebrow mono`,children:[`Loadout · `,r||e.host]}),(0,w.jsxs)(`p`,{className:`loadout-total`,children:[(0,w.jsx)(`strong`,{children:O(he(u))}),(0,w.jsxs)(`span`,{className:`dim`,children:[`tokens at start · `,O(u),` chars`]})]})]}),ee?(0,w.jsxs)(`div`,{className:`loadout-delta`,children:[(0,w.jsxs)(`span`,{className:`dim`,children:[`Against the `,t?.noun||`Primary agent`]}),(0,w.jsx)(`ul`,{children:ee.split(`, `).map(e=>(0,w.jsx)(`li`,{className:`mono loadout-pill${e.startsWith(`+`)?` is-plus`:``}`,children:e},e))})]}):null]}),(0,w.jsxs)(`div`,{className:`loadout-bar`,children:[(0,w.jsx)(i,{label:`Loadout`,legend:!1,parts:d.map(e=>({key:e.key,label:e.label,n:e.n,tone:e.tone}))}),(0,w.jsx)(`ul`,{className:`loadout-groups`,"aria-hidden":`true`,children:d.map(e=>e.n>0?(0,w.jsxs)(`li`,{style:{flexGrow:e.n},children:[(0,w.jsx)(`span`,{children:e.label}),` `,(0,w.jsxs)(`span`,{className:`mono dim`,children:[O(e.n),` · `,Math.round(e.n/u*100),`%`]})]},e.key):null)})]}),(0,w.jsxs)(`details`,{className:`loadout-card`,open:e.agent===`primary`,children:[(0,w.jsxs)(`summary`,{children:[(0,w.jsx)(`i`,{className:`tone-accent`,"aria-hidden":`true`}),(0,w.jsx)(`strong`,{children:`Constitution`}),(0,w.jsx)(`span`,{className:`dim`,children:`root file, loaded by the host`}),(0,w.jsxs)(`span`,{className:`mono dim loadout-sum`,children:[O(f.n),` · ≈ `,O(he(f.n)),` tok`]})]}),(0,w.jsx)(`ul`,{className:`loadout-root`,children:f.blocks.map(e=>(0,w.jsx)(ye,{label:e.label,n:e.chars,children:(0,w.jsx)(`span`,{className:`loadout-mini`,"aria-hidden":`true`,children:(0,w.jsx)(`span`,{style:{width:`${Math.max(4,e.chars/h*100)}%`}})})},e.id))})]}),(0,w.jsxs)(`div`,{className:`loadout-pair`,children:[(0,w.jsxs)(`div`,{className:`loadout-card`,children:[(0,w.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,w.jsx)(`i`,{className:`tone-muted`,"aria-hidden":`true`}),(0,w.jsx)(`strong`,{children:`Catalogues`}),(0,w.jsx)(`span`,{className:`mono dim loadout-sum`,children:O(p.n)})]}),(0,w.jsx)(`ul`,{className:`loadout-list`,children:p.blocks.map(e=>(0,w.jsx)(ye,{label:e.label,n:e.chars},e.id))}),(0,w.jsx)(`p`,{className:`dim loadout-note`,children:`Listed by the host, not by Geneseed.`})]}),(0,w.jsxs)(`div`,{className:`loadout-card is-own`,children:[(0,w.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,w.jsx)(`i`,{className:`tone-warn`,"aria-hidden":`true`}),(0,w.jsx)(`strong`,{children:`This agent`}),(0,w.jsx)(`span`,{className:`mono dim loadout-sum`,children:O(m.n)})]}),(0,w.jsx)(`ul`,{className:`loadout-list`,children:m.blocks.map(e=>(0,w.jsx)(ye,{label:e.label,n:e.chars,children:e.id===`user-rules`?(0,w.jsx)(`span`,{className:`loadout-pill${_?` is-plus`:``}`,children:_||`injected at sub-agent start`}):null},e.id))})]})]}),(0,w.jsxs)(`section`,{className:`loadout-rules`,"aria-label":`Rules it follows`,children:[(0,w.jsxs)(`div`,{className:`loadout-rules-h`,children:[(0,w.jsxs)(`h4`,{className:`loadout-eyebrow mono`,children:[`Rules it follows · `,y.length]}),(0,w.jsx)(`span`,{className:`dim`,children:te.map(([e,t])=>`${t} ${e}`).join(` · `)})]}),b.length?(0,w.jsxs)(`div`,{className:`loadout-cited`,children:[(0,w.jsx)(`span`,{className:`loadout-cited-h`,children:`Cited by its spec`}),b.map(e=>(0,w.jsxs)(`a`,{href:_e(e),children:[(0,w.jsx)(`span`,{className:`mono`,children:e.id}),` · `,e.title]},ve(e)))]}):null,(0,w.jsx)(`ul`,{className:`loadout-packs`,children:x.map(e=>e.user&&_?(0,w.jsxs)(`li`,{className:`is-muted`,children:[(0,w.jsx)(`span`,{children:`User rules`}),` `,(0,w.jsx)(`span`,{className:`mono`,children:e.n}),` `,(0,w.jsx)(`span`,{className:`dim`,children:_})]},e.name):(0,w.jsx)(`li`,{children:(0,w.jsxs)(`a`,{href:e.user?`#/personal/rules`:`#/laws`,children:[(0,w.jsx)(`span`,{children:e.name}),` `,(0,w.jsx)(`span`,{className:`mono dim`,children:e.n})]})},e.name))}),v.length?(0,w.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":a,onClick:()=>o(e=>!e),children:a?`Show fewer`:`Show all ${v.length}${_?` listed`:``} rules`}):null,a?A.map(([e,t])=>{let n=v.filter(t=>t.kind===e),r=_&&e===`user`;return n.length?(0,w.jsxs)(`div`,{className:r?`is-muted`:void 0,children:[(0,w.jsxs)(`h5`,{className:`reader-when-h`,children:[t,` `,(0,w.jsx)(`span`,{className:`mono dim`,children:n.length}),r?(0,w.jsxs)(`span`,{className:`dim`,children:[` · `,_]}):null]}),(0,w.jsx)(`ul`,{children:n.map(e=>(0,w.jsxs)(`li`,{children:[r?(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}):(0,w.jsxs)(`a`,{href:_e(e),children:[(0,w.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}),e.layer&&e.layer!==`install`?(0,w.jsxs)(`span`,{className:`dim`,children:[` (`,e.layer,`)`]}):null]},ve(e)))})]},e):null}):null]}),(0,w.jsxs)(`p`,{className:`dim loadout-foot`,children:[`Not counted: `,e.notCounted.join(`; `),`. Tokens are chars ÷ 4.`]})]})}function xe({label:e,options:t,value:n,onChange:r}){let[i,a]=(0,C.useState)(!1),o=(0,C.useRef)(null),s=(0,C.useId)(),c=t.find(e=>e.key===n)||t[0],l=()=>a(!1);return(0,C.useEffect)(()=>{i&&document.getElementById(s)?.querySelector(`[aria-pressed="true"]`)?.focus()},[i,s]),(0,w.jsxs)(`span`,{className:`drop-menu`,children:[(0,w.jsxs)(`button`,{ref:o,type:`button`,className:`drop-menu-btn`,"aria-label":`${e}: ${c.label}`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-controls":i?s:void 0,onClick:()=>a(e=>!e),children:[c.label,(0,w.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,w.jsx)(f,{open:i,onClose:l,anchorRef:o,label:e,className:`drop-menu-pop`,children:(0,w.jsx)(`div`,{id:s,className:`drop-menu-list`,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`button`)],n=t.indexOf(document.activeElement);e.preventDefault(),t[(n+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:t.map(e=>(0,w.jsx)(`button`,{type:`button`,"aria-pressed":e.key===c.key,onClick:()=>{r(e.key),l()},children:e.label},e.key))})})]})}function Se({label:e,value:t,delta:n,children:r}){let i=S(Number.isInteger(t)?t:null);return(0,w.jsxs)(`div`,{className:`stat`,children:[(0,w.jsx)(`div`,{className:`stat-label`,children:e}),(0,w.jsx)(`div`,{className:`stat-value mono`,children:i===null?t:Math.round(i)}),n==null?null:(0,w.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var Ce=(0,C.lazy)(()=>h(()=>import(`./Markdown-CxkA7940.js`).then(e=>e.n),__vite__mapDeps([0,1,2]))),we=(0,C.lazy)(()=>h(()=>import(`./AgentGlyph-k6o3gCM1.js`),__vite__mapDeps([3,1,2]))),Te={skills:`skill`,agents:`agent`},Ee=`:primary`,De=(e,t)=>`${t?e/t*100:0}%`,Oe=e=>e.split(`:`).slice(0,2).join(` `),ke=e=>e.split(`/`).map((e,t)=>(0,w.jsxs)(C.Fragment,{children:[t?`/`:null,t?(0,w.jsx)(`wbr`,{}):null,e]},t)),M=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},Ae=e=>p(M(e));function je(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 Me({section:e,source:t}){return(0,w.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,w.jsx)(l,{name:b[e].icon,className:`glyph`}),(0,w.jsxs)(`span`,{children:[`This entry is part of the `,b[e].label.toLowerCase(),` convention; see`,` `,(0,w.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var N=e=>e.replace(/\s+/g,` `).trim(),Ne=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Pe(e,t){let n=e.replace(/\r\n/g,`
|
|
3
|
-
`),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=Ne(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?N(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?N(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=Ne(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function Fe({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,w.jsx)(`div`,{className:`lib-stats`,children:(0,w.jsx)(Se,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(Oe))].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,w.jsx)(`div`,{className:`lib-stats`,children:(0,w.jsx)(Se,{label:`Used`,value:e.n,delta:o,children:(0,w.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,w.jsx)(`i`,{className:t===29?`today`:``,style:{height:De(e,a)}},t))})})})}function Ie(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 Le={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},Re=(e,t)=>t||(e&&x.includes(e)?e:x[0]),ze=encodeURIComponent;function Be(e){let t=e=>y[e.klass]?e.klass:`personal`,n=o.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:y[n].label,groupC:y[n].c})));return{rows:n,cats:o.map(e=>({key:e,label:y[e].label,c:y[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ve(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 He({overview:e,section:t,selected:n,dataRev:i,lock:o,base:l,onRulesChanged:f,onCountsChanged:p}){let h=u(),[S,ue]=(0,C.useState)(()=>Re(t,o)),[T,de]=(0,C.useState)(``),[E,D]=(0,C.useState)(`all`),[pe,O]=(0,C.useState)(`all`),[he,k]=(0,C.useState)(``),[A,ge]=(0,C.useState)(null),[j,_e]=(0,C.useState)(null),[ve,ye]=(0,C.useState)(t);if(t!==ve){ye(t),k(``);let e=Re(t,o);e!==S&&(ue(e),de(``),D(`all`),O(`all`))}let[Se,Oe]=(0,C.useState)(n);n!==Se&&(Oe(n),k(``));let{data:N,error:Ne,reload:He}=v(()=>r.catalog(S),[S,i],`catalog`),Ue=o?null:Te[S]||null,We=Ue!==null,{data:P}=v(()=>We?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[We,i],`usage`,{revalidate:!0}),F=We&&!!P?.enabled&&Array.isArray(P.names),Ge=(0,C.useMemo)(()=>new Map((Array.isArray(P?.names)?P.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[P]),Ke=e=>F&&Ge.get(`${Ue}\u0000${e}`)||null,qe=e=>{let t=Ke(e.name);return!t||t.n===0&&!t.last},Je=P?.since?`No call since ${P.since}`:`No call recorded yet`,I=N?.section===S,L=I&&N?.items||[],Ye=!I&&!Ne,[Xe,...Ze]=I&&N.sharedInstalls||[],R=e=>e===Xe?`shared`:Ae(e),z=S===`skills`,Qe=z?Be(L):null,$e=z?Qe.rows:S===`memory`?Ve(L):L,B=n||$e[0]?.name||null,V=S===`agents`&&!o,H=V&&B===`:primary`,{data:et,error:tt}=v(()=>V?Promise.resolve().then(()=>r.loadout()):Promise.resolve(null),[V,i],`loadout-primary`,{revalidate:!0}),nt=V?{name:Ee,type:`agent`,base:!0,title:!tt&&et?.noun||`Primary agent`,desc:`The main agent of the session. Every agent inherits its root file.`}:null,rt=H?nt:B?L.find(e=>e.name===B):null,it=rt?.type||b[S].type,U=j?.sec===S&&j?.name===B?j.key:null,{data:at,error:ot}=v(()=>!B||H?Promise.resolve(null):U?r.item(it,B,M(U)):r.item(it,B),[S,B,it,U,i,H]),W=ot?null:at,st=W&&W.name===B&&(!U||W.install===U)?W:null,ct=e=>q&&e?.install?` in ${R(e.install)}`:``,G=H?null:U||W?.install||null,lt=V&&B&&!H&&W&&W.name===B,{data:ut,error:dt}=v(()=>lt?Promise.all([r.loadout(B,G?M(G):void 0),r.loadout(void 0,G?M(G):void 0).catch(()=>null)]).then(([e,t])=>({own:e,base:t})):Promise.resolve(null),[lt,B,G,i]),ft=H?{own:tt?null:et,base:null}:ut,pt=H?tt:dt,mt=he||Ne||ot,ht=B?{name:B,title:W?.title||B,desc:W?.desc||``}:null,K=rt||ht,gt=t=>t===S&&I?L.length:e?.counts?.[t]??``,_t=c(i),vt=G||_t?.[0]?.id,yt=vt?Ae(vt):void 0,q=new Set(L.flatMap(e=>e.installs||[])).size>1,bt=ee([...(_t||[]).map(e=>e.id),...L.flatMap(e=>e.installs||[])],Ze),J=z?$e.filter(e=>E===`all`||e.cat===E):$e,xt=F?J.filter(qe).length:0,St=e=>e.status===`experimental`,Ct=J.filter(St).length,Y=[[`all`,`All`,J.length],...F?[[`used`,`Used`,J.length-xt],[`unused`,`Not used yet`,xt,Je]]:[],...Ct?[[`experimental`,`Experimental`,Ct,`Shipped, not yet confirmed by real use`]]:[]],X=Y.some(([e])=>e===pe)?pe:`all`,wt=X===`all`?J:X===`experimental`?J.filter(St):J.filter(e=>qe(e)===(X===`unused`)),Tt=F?Math.max(0,...L.map(e=>Ke(e.name)?.n||0)):0,Et=z?1/0:50,Z=T.trim().toLowerCase(),Q=Z?te(wt,Z):wt.slice(0,Et),Dt=!Z&&E===`all`&&X===`all`&&B&&!Q.some(e=>e.name===B)?[...Q,...$e.filter(e=>e.name===B)]:Q,Ot=nt&&I&&E===`all`&&X===`all`?te([nt],Z):[],kt=Ot.length+Q.length,At=[...Ot,...Dt],jt=e=>l?`${l}/${ze(e.name)}`:`#/item/${e.type||b[S].type}/${ze(e.name)}`,Mt=async()=>{let e=st;if(!e)return;let t=e.name;if(await h(`Forget the memory fact "${t}"${ct(e)}? It leaves the index and moves to memory/archive/ (geneseed memory rm --archived --purge deletes it for good).`,{title:`Forget this fact?`,confirmLabel:`Forget`,tone:`danger`})){k(``);try{await r.memoryDelete(t,e.install?M(e.install):void 0)}catch(e){k(`Could not forget "${t}": ${e.message}`);return}a(l||`#/personal/memory`),He(),p?.()}},Nt=async()=>{let e=st;if(!e)return;let t=e.name;if(await h(`Promote "${t}"${ct(e)} into a standing rule? It is appended to user-rules.md as a trial rule (a month of probation), and the memory fact moves to memory/archive/ so the lesson isn't loaded twice.`,{title:`Promote to a rule?`,confirmLabel:`Promote`})){k(``);try{let n=e.install?M(e.install):void 0,i=await r.rules(n);await r.rulesPromote({name:t,fingerprint:i.fingerprint,delete_memory:!0},n),s(),f?.(),p?.(),a(`#/personal/rules`)}catch(e){k(`Could not promote: ${e.message}`),He()}}},Pt=W?.body?Pe(W.body,W.desc||K?.desc):null,Ft=W?.title||K?.title||K?.name,It=Ft===K?.name&&Pt?.title?Pt.title:Ft,Lt=I&&L.length===0,Rt=W?.status||K?.status,zt=S===`skills`?y[rt?.klass]:null,Bt=b[S].label,{lede:Vt,when:Ht}=Ie(W?.desc||K?.desc||``),$=K&&!H?W?.source||K.source||(ot?null:je(S,K.name)):null;return(0,w.jsxs)(`div`,{className:`lib-wrap`,children:[(0,w.jsx)(d,{error:mt,style:{margin:`0 0 var(--sp-3)`}}),(0,w.jsxs)(`div`,{className:`library lib-dossier${o?` locked`:``}${F?` uses`:``}`,children:[o?null:(0,w.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,w.jsxs)(`div`,{className:`lib-title`,children:[(0,w.jsx)(`h1`,{className:`h`,children:`Library`}),(0,w.jsx)(`span`,{className:`dim`,children:`What the agent knows`}),F&&P.since?(0,w.jsxs)(`span`,{className:`mono dim lib-title-since`,children:[`calls since `,P.since]}):null]}),(0,w.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:x.map(e=>(0,w.jsxs)(C.Fragment,{children:[(0,w.jsxs)(`a`,{href:`#/section/${e}`,className:S===e?`on`:``,"aria-current":S===e?`page`:void 0,children:[b[e].label,(0,w.jsx)(`span`,{className:`mono dim`,children:gt(e)})]}),e===S&&z&&I&&(0,w.jsx)(oe,{label:`Skill types`,total:L.length,cats:Qe.cats,cat:E,onChange:D})]},e))})]}),(0,w.jsxs)(re,{label:Bt,count:I?Z?`${Q.length} of ${wt.length}`:wt.length:``,q:T,onQ:de,matched:kt,inView:[S,n],current:K?It:void 0,sections:o?void 0:x.map(e=>({key:e,label:b[e].label,n:gt(e),href:`#/section/${e}`,on:S===e})),cats:z&&I?Qe.cats:null,cat:E,total:L.length,onCat:D,catLabel:`Skill types`,extra:(0,w.jsxs)(w.Fragment,{children:[F&&P.since?(0,w.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,P.since]}):null,(0,w.jsxs)(`span`,{className:`lib-legend mono`,children:[q?bt.map((e,t)=>(0,w.jsxs)(`span`,{className:`lk-install`,title:M(e).path,children:[(0,w.jsx)(`i`,{className:`lr-dot`,style:_(t),"aria-hidden":`true`}),R(e)]},e)):null,(0,w.jsx)(ie,{items:L})]})]}),toolsCompact:I&&Y.length>1?(0,w.jsx)(xe,{label:`Show`,options:Y.map(([e,t])=>({key:e,label:e===`all`?`All uses`:t})),value:X,onChange:O}):void 0,tools:I&&Y.length>1?(0,w.jsx)(m,{"aria-label":`Show`,children:Y.map(([e,t,n,r])=>(0,w.jsxs)(`button`,{type:`button`,className:X===e?`on`:``,"aria-pressed":X===e,title:r,onClick:()=>O(e),children:[t,` `,(0,w.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[Ye?(0,w.jsx)(g,{}):null,(0,w.jsx)(ae,{rows:At,activeName:K?.name,hrefOf:jt,pills:F||q?e=>{let t=Ke(e.name)?.n||0,n=q?(0,w.jsx)(`span`,{className:`lr-dots`,children:bt.map((t,n)=>e.installs?.includes(t)?(0,w.jsx)(`span`,{className:`lr-dot lr-install`,style:_(n),title:`${R(t)} — ${M(t).path}`,children:(0,w.jsx)(`span`,{className:`sr-only`,children:R(t)})},t):(0,w.jsx)(`span`,{className:`lr-dot off`,"aria-hidden":`true`},t))}):null;return F?(0,w.jsxs)(w.Fragment,{children:[n,(0,w.jsxs)(`span`,{className:`lr-use`,children:[(0,w.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,w.jsx)(`i`,{style:{width:De(t,Tt)}})}),(0,w.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,w.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})]}):n}:void 0}),!Z&&L.length>Et&&(0,w.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,Et,` of `,L.length,`; type to search the rest.`]}),Lt&&(S===`wiki`?(0,w.jsxs)(le,{title:`No wiki entries`,action:(0,w.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,w.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,w.jsx)(le,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,w.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:K?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`reader-tags`,children:[(0,w.jsx)(`span`,{className:`tag acc`,children:Bt.replace(/s$/,``)}),H?(0,w.jsx)(ce,{}):null,zt?(0,w.jsx)(`span`,{className:`tag`,children:zt.label}):null,W?.kit??K.kit?(0,w.jsx)(se,{name:W?.kit??K.kit}):null,(0,w.jsx)(ne,{status:Rt,withHint:!0}),$?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`span`,{className:`mono dim reader-src`,children:ke($)}),(0,w.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText($),ge({src:$,ok:!0})}catch{ge({src:$,ok:!1})}},children:A?.src===$?A.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,w.jsxs)(`div`,{className:`reader-head`,children:[(0,w.jsx)(`h2`,{className:`reader-title`,children:It}),S===`agents`&&!H?(0,w.jsx)(C.Suspense,{fallback:null,children:(0,w.jsx)(we,{name:K.name})}):null]}),(0,w.jsxs)(`div`,{className:`reader-intro${F?` with-stats`:``}`,children:[(0,w.jsxs)(`div`,{className:`reader-intro-text`,children:[Vt?(0,w.jsx)(`p`,{className:`reader-lede`,children:Vt}):null,Ht?(0,w.jsxs)(`section`,{className:`reader-when`,children:[(0,w.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,w.jsx)(`p`,{children:Ht})]}):null]}),F?(0,w.jsx)(Fe,{u:Ke(K.name),usage:P,noCall:Je}):null]}),S===`memory`&&st&&K.name!==`MEMORY`&&K.name!==`README`&&(0,w.jsxs)(`div`,{className:`row gap-8`,children:[(0,w.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Nt,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,w.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Mt,children:`Forget this fact`})]}),W?.installs?.length>1&&W.installs.includes(W.install)?(0,w.jsxs)(`label`,{className:`row gap-8 lib-copy`,children:[(0,w.jsx)(`span`,{className:`dim`,children:`Install:`}),(0,w.jsx)(`select`,{className:`sel`,"aria-label":`Install`,value:U||W.install,onChange:e=>_e({sec:S,name:B,key:e.target.value}),children:W.installs.map(e=>(0,w.jsx)(`option`,{value:e,title:M(e).path,children:R(e)},e))}),(0,w.jsx)(`span`,{className:`dim`,children:`this entry only`})]}):null,(0,w.jsx)(`hr`,{className:`hr`}),lt?(0,w.jsx)(me,{name:B,install:G?M(G):void 0,installName:q?yt:void 0}):null,V?(0,w.jsx)(be,{loadout:ft?.own,base:ft?.base,error:pt,install:yt}):null,H?null:ot?(0,w.jsxs)(`p`,{className:`sub`,children:[`No `,Bt.replace(/s$/,``).toLowerCase(),` named `,(0,w.jsx)(`em`,{children:K.name}),` could be read in this install.`]}):K?.kind===`manifest`||W?.manifest!==void 0?W?(0,w.jsx)(fe,{manifest:W.manifest,body:W.body,name:K.name}):(0,w.jsx)(g,{}):W?.body?(0,w.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,w.jsx)(C.Suspense,{fallback:null,children:(0,w.jsx)(Ce,{body:Pt.body,links:W.links||[]})})}):W===null&&B?(0,w.jsx)(g,{}):(0,w.jsx)(Me,{section:S,source:je(S,K.name)}),Le[S]?(0,w.jsx)(`div`,{className:`reader-links`,children:(0,w.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${Le[S]}`,children:[`About `,Bt.toLowerCase(),` in Docs`]})}):null]}):Ye?(0,w.jsx)(g,{}):null})]})]})}export{Ee as PRIMARY,Pe as bodyHead,He as default,Ve as groupMemory,Ae as installLabel,M as installOfKey,Be as splitSkills,Ie as splitWhen};
|
|
@@ -1,2 +0,0 @@
|
|
|
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-DxwG8y94.js";import{Dt as i,Et as a,J as o,Y as s,et as c,ht as l,nt as u,tt as d,wt as f}from"./index-MB7E-va_.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{t as m}from"./CopyButton-BHqKgdjJ.js";import{c as h,i as g,n as _,o as v,r as y,s as b,t as x}from"./ActiveLoops-6p44eD86.js";import{t as S}from"./Markdown-CxkA7940.js";import{a as ee,i as te,n as ne,o as C,s as w}from"./LibRows-CGO25X3D.js";import{i as T}from"./motion-RlUl1osO.js";var E=e(t(),1),D=n(),O=encodeURIComponent,k=a.loops.map(e=>[e,i[e]]),A={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},j={project:`Project`,global:`Global`,shipped:`Shipped`},M={templates:`Categories`,bricks:`Origins`,active:`Statuses`},N=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function P(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var F=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function I(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return F(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>A[e.graph.category]?e.graph.category:`other`,[...Object.entries(A),[`other`,`Other`]])}function L(e,t){return F(e.map(e=>({...e,desc:e.description,override:P(t,e.name)})),e=>e.origin,Object.entries(j))}function R(e){return F(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,N)}var z=(e,t)=>(0,D.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),B={templates:e=>e.human?z(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?z(`warn`,`mutate`):null,b(e)?z(`human`,`human gate`):null,e.override?z(`acc`,e.override):null,e.available===!1?z(`bad`,`unavailable`):null],active:e=>z(_[e.status],e.status)};function V({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,D.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,D.jsx)(`b`,{children:(0,D.jsx)(`a`,{href:`#/loops/bricks/${O(e)}`,children:e})}),z(t.effect===`mutate`?`warn`:``,t.effect),(0,D.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,D.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),b(t)?z(`human`,b(t).toLowerCase()):null,n?z(`acc`,n):null]}):(0,D.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,D.jsx)(`b`,{children:e}),(0,D.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function H(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 re({t:e,bricks:t,overridden:n,runs:r}){let[i,a]=(0,E.useState)(null),o=new Map(t.map(e=>[e.name,e])),s=H(e.graph),c=h(e.graph,t),l=c.mode===`ring`,u=`geneseed loop init --graph ${e.name} --title "<title>" --requirement "<requirement>"`,d=r?.filter(t=>y(t)&&t.graph.name===e.name).length;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`reader-tags`,children:[(0,D.jsx)(`span`,{className:`tag acc`,children:`Template`}),A[e.graph.category]?z(``,A[e.graph.category]):null,e.human?z(`human`,`human gate`):null]}),(0,D.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,D.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,D.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,D.jsx)(`hr`,{className:`hr`}),(0,D.jsxs)(`figure`,{className:`loop-console`,children:[(0,D.jsx)(`div`,{className:l?`loop-graph`:`loop-graph flow`,style:{"--loop-w":`${c.width}px`},children:(0,D.jsx)(v,{graph:e.graph,bricks:t,onSelect:e=>{a(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:T()?`smooth`:`auto`,block:`nearest`})}})}),(0,D.jsxs)(`figcaption`,{className:`loop-how`,children:[(0,D.jsx)(`span`,{className:`loop-kicker`,children:`How it runs`}),(0,D.jsx)(`ol`,{children:s.map(([e,t])=>(0,D.jsxs)(`li`,{children:[(0,D.jsxs)(`b`,{children:[e,`:`]}),` `,t]},e))}),l?(0,D.jsxs)(`span`,{className:`loop-legend`,children:[(0,D.jsxs)(`span`,{children:[(0,D.jsx)(`i`,{className:`ring`,"aria-hidden":`true`}),`iteration`]}),s.some(([e])=>e===`Retry`)?(0,D.jsxs)(`span`,{children:[(0,D.jsx)(`i`,{className:`inner`,"aria-hidden":`true`}),`retry`]}):null]}):null]})]}),(0,D.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`loop-start-h`,children:[(0,D.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,D.jsx)(`h3`,{id:`loop-start-h`,className:`loop-kicker`,children:`Start it in your project`}),(0,D.jsx)(m,{text:u,label:`Copy command`})]}),(0,D.jsx)(`pre`,{className:`mono`,children:u})]}),r?(0,D.jsxs)(`p`,{className:`panel-note loop-running`,children:[`Running now: `,d?`${d} of this template`:`none`,`.`,` `,d?(0,D.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,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,D.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,D.jsx)(`li`,{children:e},e))})]}):null,(0,D.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,D.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,D.jsx)(V,{name:e,brick:o.get(e),override:P(n,e),on:i===e},e))})]})}function U(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 W({b:e}){let[t,n]=(0,E.useState)(!1),r=[[`effect`,z(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,D.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>z(``,e))],[`gate`,b(e)?z(`human`,b(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,D.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`reader-tags`,children:[(0,D.jsx)(`span`,{className:`tag acc`,children:`Brick`}),B.bricks(e)]}),(0,D.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,D.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,D.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,D.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(`dt`,{children:e}),(0,D.jsx)(`dd`,{children:t})]},e))}),(0,D.jsx)(`hr`,{className:`hr`}),(0,D.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,D.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,D.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:U(e)}):(0,D.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,D.jsx)(S,{body:e.body})})]})}function G({problems:e}){if(!e?.length)return null;let t=e.length;return(0,D.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,D.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,D.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,D.jsx)(`li`,{className:`mono`,children:e},e))})]})}var K={templates:{title:`No templates`,body:(0,D.jsxs)(D.Fragment,{children:[`Add one under `,(0,D.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]})},bricks:{title:`No bricks`,body:(0,D.jsxs)(D.Fragment,{children:[`Add one under `,(0,D.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]})},active:{title:`No loops yet`,body:(0,D.jsxs)(D.Fragment,{children:[`Start one with `,(0,D.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.`]})}},q={templates:(0,D.jsxs)(D.Fragment,{children:[`A template wires bricks into a loop. `,(0,D.jsx)(`a`,{href:`#/docs/loops`,children:`How loops work →`}),` `,(0,D.jsx)(`a`,{href:`#/docs/loop-which-template`,children:`Which template? →`})]}),bricks:(0,D.jsxs)(D.Fragment,{children:[`A brick is one step: a skill or agent and its outcomes.`,` `,(0,D.jsx)(`a`,{href:`#/docs/loop-bricks`,children:`About bricks →`})]}),active:(0,D.jsxs)(D.Fragment,{children:[`Loops registered on this machine, read from their LOOP.md.`,` `,(0,D.jsx)(`a`,{href:`#/docs/loop-running`,children:`Running a loop →`})]})};function J({tab:e=`templates`,item:t,dataRev:n}){let i=s(n),[a,m]=o(`loops`,i),{data:h,error:_}=f(()=>r.loops(l(a)),[n,a?.id??``],`loops`),v=g(),[b,S]=(0,E.useState)(``),[T,A]=(0,E.useState)(`all`),[j,N]=(0,E.useState)(e);e!==j&&(N(e),S(``),A(`all`));let P=h?.bricks||[],F=e===`active`?v.loops&&R(v.loops):h&&(e===`bricks`?L(h.bricks,h.overridden):I(h.templates,h.bricks)),z=F||[],V=w(z),H=T===`all`?z:z.filter(e=>e.group===T),U=b.trim(),J=ee(H,U),Y=!!(t&&F&&!z.some(e=>e.name===t)),X=Y?null:z.find(e=>e.name===t)||e===`active`&&z.find(y)||z[0]||null,Z={templates:h?.templates.length,bricks:h?.bricks.length,active:v.loops?.length},Q=k.find(([t])=>t===e)[1],$=e===`active`?v.error:_;return(0,D.jsxs)(`div`,{className:`lib-wrap`,children:[e===`active`?null:(0,D.jsx)(u,{className:`page-pick`,installs:i,value:a,onChange:m}),(0,D.jsx)(c,{error:$,style:{margin:`0 0 var(--sp-3)`}}),(0,D.jsx)(G,{problems:h?.problems}),(0,D.jsxs)(`div`,{className:`library`,children:[(0,D.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,D.jsxs)(`div`,{className:`lib-title`,children:[(0,D.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,D.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,D.jsx)(`p`,{className:`panel-note lib-lede`,children:q[e]}),(0,D.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:k.map(([t,n])=>(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,D.jsx)(`span`,{className:`mono dim`,children:Z[t]??``})]}),e===t&&(0,D.jsx)(C,{label:M[t],total:z.length,cats:V,cat:T,onChange:A})]},t))})]}),(0,D.jsx)(te,{label:Q,count:U?`${J.length} of ${H.length}`:F?H.length:``,q:b,onQ:S,matched:J.length,inView:[e,t],current:X?.name,sections:k.map(([t,n])=>({key:t,label:n,n:Z[t],href:`#/loops/${t}`,on:e===t})),cats:V,cat:T,total:z.length,onCat:A,catLabel:M[e],children:F?z.length===0?(0,D.jsx)(p,{title:K[e].title,children:K[e].body}):(0,D.jsx)(ne,{rows:J,activeName:X?.name,hrefOf:t=>`#/loops/${e}/${O(t.name)}`,pills:B[e]}):$?null:(0,D.jsx)(d,{})}),(0,D.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:Y?(0,D.jsx)(p,{title:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/loops/${e}`,label:`All ${Q.toLowerCase()} →`}}):X?e===`active`?(0,D.jsx)(x,{loop:X,bricks:P,onPreset:v.onPreset}):e===`bricks`?(0,D.jsx)(W,{b:X}):(0,D.jsx)(re,{t:X,bricks:P,overridden:h.overridden,runs:v.loops},X.name):e===`active`&&F?(0,D.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{R as activeRows,L as brickRows,U as brickSource,J as default,H as howItRuns,I as templateRows};
|
|
@@ -1,2 +0,0 @@
|
|
|
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-DxwG8y94.js";import{H as i,Ot as a,W as o,Y as s,at as c,et as l,ht as u,kt as d,mt as f,nt as p,q as m,rt as h,tt as g,wt as _}from"./index-MB7E-va_.js";import{t as v}from"./Tabs-C30JrkJH.js";import{t as y}from"./EmptyState-CY5Pm2xy.js";import{t as b}from"./Markdown-CxkA7940.js";import x,{installLabel as S}from"./Library-e-94YED6.js";var C=e(t(),1),w=e=>e(`Discard your unsaved edit?`,{title:`Unsaved edit`,confirmLabel:`Discard`,tone:`danger`}),T=`The file changed on disk — reloaded the fresh copy. Your draft is kept.`;function E({data:e,reload:t}){let n=c(),[r,i]=(0,C.useState)(null),[o,s]=(0,C.useState)(null),[l,u]=(0,C.useState)(!1),[f,p]=(0,C.useState)(``),m=e?.fingerprint||``,h=r!==null&&JSON.stringify(r)!==JSON.stringify(o),g=(0,C.useRef)(!1),_=e=>{i(e),s(e)},v=()=>i(null);return(0,C.useEffect)(()=>{if(!h)return;let e=e=>{e.preventDefault(),e.returnValue=``};window.addEventListener(`beforeunload`,e);let t=d(({to:e})=>(g.current||(g.current=!0,w(n).then(n=>{n&&(t(),i(null),a(e))}).finally(()=>{g.current=!1})),!1));return()=>{window.removeEventListener(`beforeunload`,e),t()}},[h,n]),{draft:r,setDraft:i,open:_,close:v,discard:async()=>h&&!await w(n)?!1:(v(),!0),dirty:h,busy:l,notice:f,setNotice:p,save:async(e,{conflict:n}={})=>{u(!0),p(``);try{return await e(m)||!0}catch(e){e.status===409?p(n??T):p(e.message);return}finally{u(!1),t()}}}}var D=n(),O=(e,t)=>`${e} ${t}${e===1?``:`s`}`,k=e=>`≈${e.toLocaleString(`en-US`)} tokens`,ee={title:``,body:``,scope:`project`,trial_until:``},A=[`project`,`global`],j=e=>e===`user`?`global`:e,M=/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/,N=e=>e.startsWith(`## `)||/^##\s+R\d+\s*[—–-]+\s*\S/.test(e),te=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Your draft is kept — Save again.`,ne=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Try again.`;function P({value:e,onChange:t,onCancel:n,onSave:r,busy:i,writeTo:a=null}){let[o]=(0,C.useState)(e.scope),s=n=>r=>t({...e,[n]:r.target.value}),c=e.body.trim().split(M).some(N)?`A line cannot start with “## ” — user-rules.md reads it as a new rule heading. Use ### or plain text.`:``,l=!(e.title.trim()&&e.body.trim()),u=!l&&!c;return(0,D.jsxs)(`div`,{className:`rule-form`,children:[a,(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule title`}),(0,D.jsx)(`input`,{className:`lib-filter`,type:`text`,value:e.title,onChange:s(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,autoFocus:!0})]}),(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule body`}),(0,D.jsx)(`textarea`,{className:`rule-body-input`,value:e.body,onChange:s(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-invalid":c?!0:void 0,"aria-describedby":c?`rule-body-error`:void 0})]}),c?(0,D.jsx)(`p`,{id:`rule-body-error`,className:`sub sub-wide rule-notice`,role:`alert`,children:c}):null,(0,D.jsxs)(`div`,{className:`row wrap`,children:[(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule scope`}),(0,D.jsxs)(`select`,{className:`sel`,value:e.scope,onChange:s(`scope`),children:[(0,D.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,D.jsx)(`option`,{value:`global`,children:`scope: global (every repository)`}),A.includes(o)?null:(0,D.jsxs)(`option`,{value:o,children:[`scope: `,o,` (as written in the file)`]})]})]}),(0,D.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,D.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:e.trial_until,onChange:s(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginLeft:`auto`},children:[(0,D.jsx)(`button`,{className:`btn sm`,disabled:!u||i,onClick:()=>r(e),"aria-describedby":l?`rule-form-hint`:void 0,children:i?`Saving…`:`Save rule`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:i,onClick:n,children:`Cancel`})]})]}),l?(0,D.jsx)(`p`,{id:`rule-form-hint`,className:`panel-note`,children:`A rule needs a title and a body.`}):null]})}function re({rule:e,tag:t,usual:n,isOpen:r,onToggle:i,onEdit:a,onDelete:o,onGraduate:s}){let c=t?` · ${t}`:``;return(0,D.jsxs)(`div`,{className:`rule-row ${r?`on`:``}`,children:[(0,D.jsxs)(`button`,{className:`rule-head`,onClick:i,"aria-expanded":r,"data-rule-head":e.key,children:[(0,D.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),j(e.scope)===n?null:(0,D.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,D.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`}),(0,D.jsx)(`span`,{className:`rule-chip mono`,children:k(e.tokens)})]}),r&&(0,D.jsxs)(`div`,{className:`rule-expand`,children:[(0,D.jsx)(`p`,{children:e.body}),e.source?(0,D.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10},children:[e.status===`trial`&&(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:s,title:`Adopt for good — drop the trial marker`,"aria-label":`Graduate R${e.id}${c}`,children:`Graduate`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:a,"aria-label":`Edit R${e.id}${c}`,children:`Edit`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:o,"aria-label":`Retire R${e.id}${c}`,children:`Retire`})]})]})]})}var F=(e,t)=>({approve:`Approve`,reject:`Reject`,host:`Use the ${e.choice?.host} file`,shared:`Use the shared file`,both:`Keep both`})[t];function I({choice:e}){let t=(e,t,n)=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`rule-src`,title:t,children:e}),(0,D.jsx)(`pre`,{className:`mono`,children:n??`(absent)`})]});return(0,D.jsxs)(`div`,{className:`rule-choice`,children:[t(`Shared file`,e.shared_path,e.shared_text),t(`${e.host} file`,e.host_path,e.host_text)]})}function ie({drafts:e,deciding:t,onDecide:n}){return e.length?(0,D.jsxs)(`section`,{className:`mb-16`,"aria-labelledby":`rules-pending`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`rules-pending`,children:`Pending`}),(0,D.jsx)(`span`,{className:`mono dim`,children:e.length})]}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Waiting in `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.draft.md`}),`. A pending rule still binds on its host, and only there. Decide each one here, or ask the agent to run its rule Rite.`]}),(0,D.jsx)(`div`,{className:`card rules-list`,children:e.map((e,r)=>(0,D.jsxs)(`div`,{className:`rule-row`,children:[(0,D.jsxs)(`div`,{className:`rule-head static`,children:[(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),e.host?(0,D.jsxs)(`span`,{className:`rule-chip mono`,children:[`binds on `,e.host]}):null]}),(0,D.jsxs)(`div`,{className:`rule-expand`,children:[e.body?(0,D.jsx)(`p`,{children:e.body}):null,e.choice?(0,D.jsx)(I,{choice:e.choice}):null,e.held?(0,D.jsx)(`p`,{className:`rule-src`,children:`The shared file already holds this rule. The next rebuild clears it.`}):null,e.decisions?.length?(0,D.jsx)(`div`,{className:`row gap-8`,style:{marginTop:10},children:e.decisions.map(r=>(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:t!==``,"aria-label":`${F(e,r)} · ${e.title}`,onClick:()=>n(e,r),children:F(e,r)},r))}):null]})]},e.key??r))})]}):null}function L({onChanged:e,dataRev:t,onAction:n}){let i=c(),{targets:a,sets:o,failed:s,reason:d,reload:h}=m(r.rules,t),[_,v]=(0,C.useState)(null),b=E({data:null,reload:h}),{draft:x,busy:S,notice:w}=b,[T,A]=(0,C.useState)(``),[M,N]=(0,C.useState)(null),F=(0,C.useRef)(null),[I,L]=(0,C.useState)(0),R=e=>{F.current=e,L(e=>e+1)},z=(0,C.useRef)(null),B=(0,C.useRef)(null);if((0,C.useEffect)(()=>{let e=F.current;if(F.current=null,e===null)return;let t=[...B.current?.querySelectorAll(`[data-rule-head]`)||[]];(e===`add`?z.current:t.find(t=>t.dataset.ruleHead===e))?.focus()},[I]),o&&!o.length&&d)return(0,D.jsx)(l,{error:d,onRetry:h});if(!o)return(0,D.jsx)(g,{});let V=a.length>1,H=e=>e?.id??``,U=e=>e?.shared?`shared`:f(e),W=o.flatMap(({inst:e,data:t})=>(t.rules||[]).map(t=>({...t,inst:e,key:`${H(e)}#${t.id}`}))),G=o.filter(e=>e.data.exists).map(e=>e.inst),K=G.length>0,q=x?.target,J=q!==void 0&&q!==`new`&&!W.some(e=>e.key===q&&e.title===x.title0),Y=q===`new`||J,X=x?.to!==void 0&&!G.some(e=>H(e)===x.to),Z=X?null:G.find(e=>H(e)===x?.to)??G[0]??null,ae=X?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`alert`,children:`The install this draft was for has no user-rules.md now, so it is not saved anywhere else. Cancel it, or copy the text into a new rule.`}):G.length>1?(0,D.jsx)(p,{installs:G,value:Z,onChange:e=>b.setDraft({...x,to:e.id}),tagOf:U}):V&&Z?(0,D.jsxs)(`p`,{className:`install-pick`,children:[(0,D.jsx)(`span`,{className:`dim`,children:`Install:`}),` `,(0,D.jsx)(`span`,{className:`mono`,children:U(Z)})]}):null,Q=async(t,n,i)=>{let a=o.find(e=>H(e.inst)===H(n))?.data.fingerprint||``,s=await b.save(()=>r.rulesMutate({...t,fingerprint:a},u(n)),{conflict:i?te:ne});return s&&i&&b.close(),e?.(),s},$=e=>b.setDraft({...x,form:e}),oe=async(e,t,n)=>{await Q(e,t,!0)&&R(n)},se=async e=>{await b.discard()&&R(e)},ce=async e=>{await i(`Retire rule R${e.id} — “${e.title}”${V?` from ${U(e.inst)}`:``}? It moves to user-rules-retired.md, which is never loaded.`,{title:`Retire this rule?`,confirmLabel:`Retire`,tone:`danger`})&&await Q({op:`delete`,id:e.id},e.inst)&&x===null&&R(`add`)},le=async e=>{await Q({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``},e.inst)&&R(e.key)},ue=(e,t)=>{let n=e.choice?.file;return t===`approve`?i(`Approve “${e.title}”? It moves to the shared file under a new number and binds every host on this machine. A rule may tighten a law, never repeal one: check that it does not.`,{title:`Approve this rule?`,confirmLabel:`Approve`}):t===`host`?i(`Make the ${e.choice.host} file the shared ${n}? The current shared file is replaced, and a copy goes to archived-${n}/ beside it.`,{title:`Replace the shared file?`,confirmLabel:`Replace`,tone:`danger`}):t!==`shared`||i(`Keep the shared ${n}? The ${e.choice.host} file moves to archived-${n}/ beside it, and that host returns to its seed at the next rebuild.`,{title:`Move the host file aside?`,confirmLabel:`Move aside`,tone:`danger`})},de=async(t,n)=>{if(await ue(t,n)){A(t.key),N(null),b.setNotice(``);try{let e=await r.rulesDecide({key:t.key,decision:n,fingerprint:t.fingerprint},u(t.inst));N({rebuild:e.rebuild,cleared:e.cleared??[]})}catch(e){let t=e.body?.cleared?.length?` Cleared: ${e.body.cleared.join(`, `)}.`:``;b.setNotice(e.status===409?`${e.body?.detail??e.message}${t} Reloaded the fresh copy.`:e.message)}finally{A(``),h(),e?.()}}},fe=async()=>{await i(`Rebuild every active install? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&n(`build-all`)},pe=o.flatMap(({inst:e,data:t})=>(t.warnings||[]).map(t=>V?`${U(e)}: ${t}`:t)),me=o.flatMap(({inst:e,data:t})=>(t.drafts||[]).map(n=>({...n,inst:e,fingerprint:t.draft_fingerprint}))),he=o.filter(e=>e.data.exists),ge=e=>e?.scope===`project`?`project`:`global`,_e=e=>!J&&q===e.key?(0,D.jsx)(`div`,{className:`rule-row on`,children:(0,D.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,D.jsx)(P,{value:x.form,onChange:$,busy:S,onCancel:()=>se(e.key),onSave:t=>oe({op:`update`,id:e.id,source:e.source,...t},e.inst,e.key)})})},e.key):(0,D.jsx)(re,{rule:e,tag:V?U(e.inst):null,usual:ge(e.inst),isOpen:_===e.key,onToggle:()=>v(_===e.key?null:e.key),onEdit:()=>{v(e.key),b.open({target:e.key,no:e.id,to:H(e.inst),title0:e.title,form:{title:e.title,body:e.body,scope:j(e.scope),trial_until:e.trial_until}})},onDelete:()=>ce(e),onGraduate:()=>le(e)},e.key);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsxs)(`div`,{className:`head-text`,children:[(0,D.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Your standing rules, from `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`. The agent obeys them in every session, so keep the set small. `,(0,D.jsx)(`a`,{href:`#/docs/rules`,children:`Docs`})]})]}),K&&x===null&&(0,D.jsx)(`button`,{className:`btn`,ref:z,onClick:()=>b.open({target:`new`,title0:``,form:ee}),children:`Add rule`})]}),w?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:w}):null,s.length?(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:[`Could not read user-rules.md of`,` `,s.map(e=>e?f(e):`the default install`).join(`, `),`.`]}):null,pe.map(e=>(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,children:[`format warning: `,e]},e)),M?(0,D.jsxs)(`p`,{className:`sub sub-wide`,role:`status`,children:[`Decided.`,` `,M.rebuild?`A rebuild removes the host copy.`:`The host file stays as it is.`,M.cleared.length?` Cleared: ${M.cleared.join(`, `)}.`:``,` `,M.rebuild&&n?(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:fe,children:`Rebuild all`}):null]}):null,(0,D.jsx)(ie,{drafts:me,deciding:T,onDecide:de}),Y&&(0,D.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,D.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),J?(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:[`Rule R`,x.no,` is no longer in user-rules.md (an agent session removed or renumbered it). Your draft is kept — Save adds it as a new rule.`]}):null,(0,D.jsx)(P,{value:x.form,onChange:$,busy:S,writeTo:ae,onCancel:()=>se(`add`),onSave:e=>!X&&G.length&&oe({op:`add`,...e},Z,`add`)})]}),K?W.length===0&&!Y?(0,D.jsx)(y,{title:`No rules yet`,children:`The file is seeded and loaded every session, and it is empty. Add your first standing rule here, ask the agent for one in a session (the rule skill), or promote a recurring fact from Memory.`}):(0,D.jsx)(`div`,{ref:B,children:he.map(({inst:e,data:t})=>(0,D.jsxs)(`section`,{className:`mb-16`,"aria-label":V?U(e):`Rules`,children:[(0,D.jsxs)(`div`,{className:`rules-file`,children:[V?(0,D.jsx)(`b`,{className:`mono`,children:U(e)}):null,(0,D.jsxs)(`span`,{className:`mono dim`,children:[O(t.rules.length,`rule`),` · `,k(t.stats.tokens),` every turn · scope `,ge(e),` unless marked`]})]}),t.rules.length?(0,D.jsx)(`div`,{className:`card rules-list`,children:W.filter(t=>t.inst===e).map(_e)}):null]},H(e)))}):(0,D.jsxs)(y,{title:`No user-rules.md here yet`,children:[`The build seeds it. Rebuild on the Overview, or run`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`, and it appears, ready for your rules.`]})]})}var R=`PROFILE.md changed on disk since you opened it — reloaded the fresh copy. Your draft is kept — Save again.`,z=e=>e?.id??``;function B({onChanged:e,dataRev:t}){let{targets:n,sets:i,failed:a}=m(r.profile,t);if(!i)return(0,D.jsx)(g,{});let o=new Set(a.map(z)),s=new Set([...i.map(e=>z(e.inst)),...o]),c=n.filter(e=>s.has(z(e))).map(e=>({install:e,tag:n.length<2?null:e?.shared&&!o.has(z(e))?`shared`:f(e)}));return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`mb-16`,children:[(0,D.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Who you are and how you like to work, from `,(0,D.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),`. It guides the agent and never binds it. `,(0,D.jsx)(`a`,{href:`#/docs/collaboration`,children:`Docs`})]})]}),c.map(({install:t,tag:n})=>(0,D.jsx)(V,{install:t,tag:n,onChanged:e},z(t)))]})}function V({install:e,tag:t,onChanged:n}){let{data:i,error:a,loading:o,reload:s,setData:c}=_(()=>r.profile(u(e)),[]),d=E({data:i,reload:s}),{draft:f,dirty:p,busy:m,notice:v}=d,[x,S]=(0,C.useState)(!1);if(i&&!x&&(S(!0),(i.text||``).trim()||d.open(i.text||``)),o&&!i)return(0,D.jsx)(g,{});if(a)return(0,D.jsxs)(`section`,{"aria-label":t?`Profile, ${t}`:void 0,children:[t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null,(0,D.jsx)(l,{error:a,onRetry:s})]});let w=f!==null,T=i?.text||``;return(0,D.jsxs)(`section`,{"aria-label":t?`Profile, ${t}`:void 0,children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsx)(`div`,{children:t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null}),(0,D.jsxs)(`div`,{className:`row`,children:[(0,D.jsxs)(h,{"aria-label":t?`Profile mode, ${t}`:`Profile mode`,children:[(0,D.jsx)(`button`,{className:w?``:`on`,"aria-pressed":!w,onClick:d.discard,children:`View`}),(0,D.jsx)(`button`,{className:w?`on`:``,"aria-pressed":w,onClick:()=>w||d.open(T),children:`Edit`})]}),w&&(0,D.jsx)(`button`,{className:`btn`,disabled:!p||m,onClick:async()=>{let t=await d.save(t=>r.profileSave({text:f,fingerprint:t},u(e)),{conflict:R});t&&(c(e=>({...e,text:f,seeded:!1,fingerprint:t.fingerprint||``})),d.setNotice(`Saved.`),d.close(),n?.())},children:m?`Saving…`:`Save`})]})]}),v?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:v}):null,w?(0,D.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:f,onChange:e=>d.setDraft(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):T.trim()?(0,D.jsxs)(D.Fragment,{children:[i?.seeded?(0,D.jsxs)(y,{title:`This is still the template`,children:[`Ask the agent to run the `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]}):null,(0,D.jsx)(`div`,{className:`card pad-lg`,children:(0,D.jsx)(b,{body:T})})]}):(0,D.jsxs)(y,{title:`No profile yet`,children:[`Switch to Edit to write one, or ask the agent to run the`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})]})}var H=(e,t)=>`${e} ${t}${e===1?``:`s`}`,U=e=>e?(e.items||[]).length:null,W=/^- \[([^\]]*)\]\(topics\/[^)]+\.md\) — (\d+) facts?$/,G=e=>String(e||``).split(`
|
|
2
|
-
`).map(e=>W.exec(e.trim())).filter(Boolean).map(e=>({topic:e[1],n:Number(e[2])}));function K({topics:e,install:t,shared:n}){return e.length?(0,D.jsxs)(`section`,{className:`panel pm-topics`,"aria-labelledby":`pm-topics`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`pm-topics`,children:`Topics`}),t&&!n?(0,D.jsx)(`span`,{className:`mono dim`,children:S(t)}):null,(0,D.jsx)(`span`,{className:`mono dim`,children:H(e.length,`topic`)})]}),(0,D.jsx)(`ul`,{className:`hbars`,children:e.map(e=>(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:`hb-label`,children:e.topic}),(0,D.jsx)(`span`,{className:`mono hb-n`,children:H(e.n,`fact`)})]},e.topic))})]}):null}var q={memory:{title:`No facts yet`,body:(0,D.jsxs)(`div`,{className:`pm-first`,children:[(0,D.jsx)(`p`,{children:`The agent writes a fact when a session teaches it something durable: a decision, a correction, a trap. Say “remember that…” in any session, and it asks whether that belongs here or in your standing rules.`}),(0,D.jsxs)(`ul`,{children:[(0,D.jsx)(`li`,{children:`One fact per file, filed under a topic.`}),(0,D.jsx)(`li`,{children:`Stale facts move to Archived; nothing is deleted without you.`}),(0,D.jsx)(`li`,{children:`The store stays on this machine and out of git.`})]})]}),action:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/docs/memory`,children:`How memory works`}),(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/item/skill/rule`,children:`The rule skill`})]})},notebook:{title:`No notes yet`,body:`The notebook is the agent’s own scratch space: plans and notes it keeps for itself.`}};function J({tab:e=`rules`,item:t,dataRev:n,onCountsChanged:a,onAction:c}){let l=e=>Promise.resolve(e).catch(()=>null),u=s(n),{reload:d}=o(n),{data:f,error:p,reload:m}=_(()=>r.profile(),[n]),{data:h,reload:g}=_(()=>r.catalog(`memory`),[`memory`,n],`catalog`),{data:b}=_(()=>r.catalog(`notebook`),[`notebook`,n],`catalog`),S=U(h),{data:C}=_(()=>e===`memory`?l(r.item(`memory`,`MEMORY`)):Promise.resolve(null),[`memory-map`,e,n,S]),w=U(b),T={memory:S,notebook:w},E={profile:p?`read failed`:f?.seeded?`template`:null,memory:S,notebook:w},O=e===`memory`||e===`notebook`;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(i,{title:`Personal`,sub:`The only files you write. They survive updates, reinstalls and voice changes.`+(u?.some(e=>e.shared)?` Global installs share one copy of the rules, profile and memory; a project install keeps its own.`:``)}),(0,D.jsx)(v,{page:`personal`,current:e,badges:E,label:`Personal files`}),e===`rules`&&(0,D.jsx)(L,{onChanged:d,dataRev:n,onAction:c}),e===`profile`&&(0,D.jsx)(B,{onChanged:m,dataRev:n}),O&&T[e]===0&&!t?(0,D.jsx)(y,{title:q[e].title,action:q[e].action,children:q[e].body}):O?(0,D.jsxs)(D.Fragment,{children:[e===`memory`&&(0,D.jsx)(K,{topics:G(C?.body),install:C?.install,shared:C?.shared}),(0,D.jsx)(x,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:n,onCountsChanged:a,onRulesChanged:()=>{d(),g()}},e)]}):null]})}export{J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{H as r,St as i,Tt as a,_t as o,at as s,et as c,pt as l}from"./index-MB7E-va_.js";import{t as u}from"./api-DxwG8y94.js";import{i as d}from"./motion-RlUl1osO.js";var f=e(t(),1),p=n();function m(){let e=s(),[t,n]=(0,f.useState)(!1),[r,i]=(0,f.useState)(null);return t?(0,p.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,p.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{error:r}),(0,p.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`})){i(null);try{await u.shutdown()}catch(e){if(e.status)return i(e.message)}n(!0)}},children:[(0,p.jsx)(o,{name:`x`}),`Stop server`]})]})}function h(){let e=s(),[t,n]=(0,f.useState)(!1),[r,i]=(0,f.useState)(null);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{error:r}),(0,p.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 a()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,p.jsx)(o,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var g=`https://github.com/Arylmera/Geneseed`,_=`https://github.com/Arylmera`,v=[[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],y=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function b({k:e,help:t,children:n,control:r}){return(0,p.jsxs)(`div`,{className:`sheet-row`,children:[(0,p.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,p.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,p.jsx)(`div`,{className:`sheet-v`,children:n}),(0,p.jsx)(`div`,{className:`sheet-c`,children:r})]})}function x({id:e,title:t,head:n,className:r=``,children:i}){return(0,p.jsxs)(`section`,{id:`set-${e}`,className:`card pad-md sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function S({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:d()?`smooth`:`auto`,block:`start`});return(0,p.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:v.map(([n,r])=>(0,p.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,p.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function C({version:e}){let[t,n]=(0,f.useState)(g),[r,i]=(0,f.useState)(!0);(0,f.useEffect)(()=>{Promise.resolve(u.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),i(!!e.repo_is_github))}).catch(()=>{})},[]);let a=(e,t)=>(0,p.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,p.jsx)(o,{name:`external`})]});return(0,p.jsxs)(x,{id:`about`,title:`About`,children:[(0,p.jsx)(b,{k:`Version`,control:r?a(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,p.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),r?(0,p.jsx)(b,{k:`Credits`,control:a(t+`#-credits`,`Credits`),children:(0,p.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,p.jsx)(b,{k:`Geneseed`,help:`MIT-licensed`,control:(0,p.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,p.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,p.jsx)(o,{name:`github`}),r?`Source on GitHub`:`Source repo`]}),r&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,p.jsx)(o,{name:`external`}),`Issues`]}),(0,p.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,p.jsx)(o,{name:`external`}),`MIT License`]})]})]}),children:(0,p.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,p.jsx)(b,{k:`Creator`,control:(0,p.jsxs)(`a`,{className:`btn ghost`,href:_,target:`_blank`,rel:`noreferrer`,children:[(0,p.jsx)(o,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,p.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,p.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}var w={absent:`Off`,ours:`On · written by Geneseed`,stale:`On · points at another copy or Node`,hand:`On · set up by hand`};function T({initial:e}){let t=s(),[n,r]=(0,f.useState)(void 0),[i,a]=(0,f.useState)(null),[o,l]=(0,f.useState)(!1),d=n===void 0?e:n,m=async e=>{let n=e===`install`;if(await t(n?`Write ${d.file}? It starts the web console from ${d.root} at each login (hidden, no browser).`+(d.file.endsWith(`.plist`)?` It loads at your next login.`:``)+(d.transient?` Warning: that copy is an agent worktree or an npx cache, which can be deleted; the login item then fails.`:``):`Delete ${d.file}? The console no longer starts at login.`,n?{title:`Start at login?`,confirmLabel:d.state===`stale`?`Update`:`Write file`}:{title:`Stop starting at login?`,confirmLabel:`Delete file`,tone:`danger`})){l(!0),a(null);try{r((await u.autostart(e)).autostart)}catch(e){a(e.message),e.body?.autostart&&r(e.body.autostart)}finally{l(!1)}}},h=d?.state,g=h===`absent`||h===`stale`?(0,p.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>m(`install`),children:h===`stale`?`Update`:`Turn on`}):h===`ours`?(0,p.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>m(`remove`),children:`Remove`}):h===`hand`?(0,p.jsx)(`a`,{href:`#/docs/autostart`,children:`Install guide →`}):null;return(0,p.jsx)(b,{k:`Start at login`,help:d?d.file:d===null?`No login launcher on this system`:`A login launcher`,control:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(c,{error:i}),g]}),children:(0,p.jsx)(`span`,{className:`sub`,children:d===null?`not available`:w[h]??`unknown`})})}function E({overview:e,onAction:t}){let n=s(),a=e?.server,c=e?.daemon_stale,[d,g]=(0,f.useState)(null);(0,f.useEffect)(()=>{Promise.resolve(u.update?.()).then(e=>g(e||null)).catch(()=>{})},[]);let _=d?d.install??(d.git?`git`:`npm-global`):null,v=_===`git`?`Update (git pull + rebuild)`:_===`npm-global`?`Update (npm install -g + rebuild)`:`Update`;return(0,p.jsxs)(`div`,{children:[(0,p.jsx)(r,{title:`Settings`,sub:`This copy of Geneseed and the local server.`}),(0,p.jsxs)(`div`,{className:`sheet`,children:[(0,p.jsx)(S,{stale:c}),(0,p.jsxs)(`div`,{className:`sheet-body`,children:[(0,p.jsxs)(x,{id:`machine`,title:`Machine`,children:[(0,p.jsx)(b,{k:`Geneseed`,help:`This copy of the source`,control:_===`other`?d.command?(0,p.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,p.jsx)(`code`,{className:`mono`,children:d.command})]}):null:d?.behind===!1?(0,p.jsx)(`span`,{className:`dim`,children:`This checkout cannot pull: it has local changes, a detached HEAD, no upstream or a diverged branch.`}):(0,p.jsxs)(`button`,{className:`btn`,onClick:async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await u.installs();e=t.filter(e=>e.state===`active`).map(e=>`${l(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await n(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},children:[(0,p.jsx)(o,{name:`download`}),v]}),children:(0,p.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,p.jsx)(b,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,p.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,p.jsx)(o,{name:`external`}),`Add to PATH`]})})]}),(0,p.jsxs)(x,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`span`,{className:`pill good`,children:`running`}),(0,p.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,a?` · pid ${a.pid} · up ${i(a.started)}`:``]})]}),children:[(0,p.jsx)(b,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,p.jsx)(h,{}),children:c?(0,p.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,p.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,p.jsx)(T,{initial:a?.autostart}),(0,p.jsx)(b,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,p.jsx)(`span`,{className:`row wrap gap-8`,children:y.map(e=>(0,p.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,p.jsx)(C,{version:e?.version}),(0,p.jsxs)(x,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,p.jsx)(b,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,p.jsx)(m,{})}),(0,p.jsx)(b,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,p.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,p.jsx)(b,{k:`Uninstall`,children:(0,p.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,p.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{Dt as n,Et as r}from"./index-MB7E-va_.js";e();var i=t();function a({page:e,current:t,badges:a={},label:o}){return(0,i.jsx)(`nav`,{className:`tabs`,"aria-label":o,children:r[e].map(r=>(0,i.jsxs)(`a`,{href:`#/${e}/${r}`,className:t===r?`on`:``,"aria-current":t===r?`page`:void 0,children:[n[r],a[r]==null?null:(0,i.jsx)(`span`,{className:`tab-badge`,children:a[r]})]},r))})}export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=typeof window<`u`?window.__GENESEED_TOKEN__:``;async function t(e){let t=await e.json().catch(()=>({})),n=e.status===403&&t.error===`forbidden`?`the web server restarted since this page loaded — reload the page, then re-apply your edit`:t.error||t.message||e.statusText,r=Error(n);return r.status=e.status,r.body=t,r}var n=2e5;async function r(e){try{let r=await fetch(e,{signal:AbortSignal.timeout(n)});if(!r.ok)throw await t(r);return await r.json()}catch(e){throw e?.name===`TimeoutError`?Error(`the local server did not answer in time`,{cause:e}):e}}async function i(n,r={}){let i=await fetch(n,{method:`POST`,headers:{"X-Geneseed-Token":e||``,"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.ok)throw await t(i);return i.json()}var a=e=>{if(e==null)return!1;if(typeof e.host==`string`&&typeof e.path==`string`)return!0;throw Error(`an install needs both host and path`)},ee=(e,t)=>{if(!a(t))return e;let n=new URLSearchParams({host:t.host,path:t.path});return`${e}${e.includes(`?`)?`&`:`?`}${n}`},o=(e,t)=>{let n=e??{};if(!a(t))return n;if(`host`in n||`path`in n)throw Error(`this body already has host or path`);return{...n,host:t.host,path:t.path}},s=e=>{try{return e()}catch(e){return Promise.reject(e)}},c=(e,t)=>s(()=>r(ee(e,t))),l=(e,t,n)=>s(()=>i(e,o(t,n))),u=e=>c(`/api/overview`,e),d=()=>r(`/api/fleet`),f=()=>r(`/api/migrate/preview`),p=()=>r(`/api/kits`),m=(e,t)=>{if(!e)return r(`/api/profiles`);let n=new URLSearchParams({profile:e});return t!=null&&n.set(`project`,t),r(`/api/profiles?${n}`)},h=()=>r(`/api/usage`),g=()=>r(`/api/gates`),_=()=>r(`/api/update`),v=e=>c(`/api/recent`,e),y=()=>r(`/api/activity`),b=(e,t)=>c(`/api/activity/`+encodeURIComponent(e),t),x=(e,t)=>l(`/api/activity`,{enabled:e},t),S=e=>c(`/api/setup`,e),C=(e=!1,t)=>c(e?`/api/doctor?fresh=1`:`/api/doctor`,t),w=e=>c(`/api/themes`,e),T=(e,t)=>c(`/api/catalog/${e}`,t),E=(e,t,n)=>c(`/api/item/${e}/${encodeURIComponent(t)}`,n),D=(e,t)=>l(`/api/memory/delete`,{name:e},t),O=(e,t)=>c(e?`/api/loadout/${encodeURIComponent(e)}`:`/api/loadout`,t),k=e=>c(`/api/agent-models`,e),te=(e,t)=>l(`/api/agent-models`,e,t),A=e=>c(`/api/diff`,e),j=(e,t)=>l(`/api/actions/restore`,{files:e},t),M=409,N=e=>r(`/api/jobs/${e}`),P=()=>r(`/api/jobs`),F=e=>i(`/api/jobs/${e}/cancel`),I=new Set([`build`,`restore`]);async function L(e,t,n){let r=t||{},a=`/api/actions/${e}`;try{return await(I.has(e)?l(a,r,n):i(a,r))}catch(e){throw e.status===M&&e.body?.error===`busy`?Error(`An action is already running.`,{cause:e}):e}}var R=e=>c(`/api/loops`,e),z=()=>r(`/api/loops/active`),B=(e,t)=>i(`/api/loops/preset`,{root:e,preset:t}),V=e=>c(`/api/factories/catalog`,e),H=()=>r(`/api/factories/active`),U=()=>r(`/api/mcp`),W=e=>i(`/api/reveal`,{path:e}),G=()=>r(`/api/installs`),K=(e,t,n)=>i(`/api/install`,{host:e,path:t,action:n}),q=(e,t,n)=>i(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),J=(e,t)=>i(`/api/default-install`,{host:e,path:t}),Y=()=>i(`/api/pick-folder`,{}),X=()=>r(`/api/ping`),Z=()=>i(`/api/shutdown`),Q=()=>i(`/api/restart`),ne=e=>i(`/api/autostart`,{action:e}),$=e=>e?`?harness=${encodeURIComponent(e)}`:``,re={fleet:d,migratePreview:f,kits:p,usage:h,gates:g,update:_,loops:R,activeLoops:z,factories:V,activeFactories:H,setLoopPreset:B,overview:u,recent:v,activity:y,activityDetail:b,activityToggle:x,setup:S,doctor:C,themes:w,catalog:T,item:E,loadout:O,agentModels:k,agentModelsSave:te,memoryDelete:D,diff:A,restore:j,job:N,jobs:P,cancelJob:F,action:L,mcp:U,mcpReveal:W,installs:G,profiles:m,installToggle:K,installRemove:q,setDefaultInstall:J,pickFolder:Y,ping:X,shutdown:Z,restart:Q,autostart:ne,docs:(e,t)=>c(`/api/docs${$(e)}`,t),docsPage:(e,t,n)=>c(`/api/docs/page/${encodeURIComponent(e)}${$(t)}`,n),rules:e=>c(`/api/rules`,e),rulesMutate:(e,t)=>l(`/api/rules`,e,t),rulesDecide:(e,t)=>l(`/api/rules/decide`,e,t),rulesPromote:(e,t)=>l(`/api/rules/promote`,e,t),profile:e=>c(`/api/profile`,e),profileSave:(e,t)=>l(`/api/profile`,e,t),excludes:()=>r(`/api/excludes`),excludeMutate:(e,t)=>i(`/api/excludes`,{action:e,path:t})};export{re as t};
|