geneseed 4.31.0 → 4.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +136 -1
- package/adapters/opencode/plugins/geneseed-guard.js +145 -2
- package/docs/concepts/exclusions.md +1 -1
- package/docs/concepts/hook-gates.md +1 -1
- package/docs/concepts/hooks.md +6 -4
- package/docs/concepts/host-matrix.md +1 -1
- package/docs/concepts/loop-bricks.md +1 -1
- package/docs/concepts/loop-notes.md +4 -2
- package/docs/concepts/loop-templates.md +7 -4
- package/docs/concepts/loops.md +3 -0
- package/docs/concepts/ownership.md +1 -1
- package/docs/guides/run-a-loop.md +1 -1
- package/docs/guides/set-up-ownership.md +1 -1
- package/docs/reference/loop-actions.md +1 -1
- package/docs/reference/plugin-context.md +4 -0
- package/docs/reference/plugin-guard.md +1 -1
- package/docs/understand/enforced-vs-asked.md +3 -2
- package/docs/understand/machine-bob.md +1 -1
- package/docs/web-ui.md +15 -5
- package/harness.config.json +1 -1
- package/js/hosts/hooks-context.mjs +22 -1
- package/js/hosts/hooks-done.mjs +97 -31
- package/js/hosts/hooks-prims.mjs +65 -0
- package/js/hosts/hooks.mjs +188 -27
- package/js/loop/state.mjs +15 -5
- package/js/web/actions.mjs +4 -4
- package/js/web/api.mjs +2 -2
- package/package.json +1 -1
- package/src/agents/_template.md +3 -0
- package/src/agents/developer.md +5 -2
- package/src/agents/tester.md +4 -1
- package/src/bricks/apply.md +3 -0
- package/src/bricks/test.md +6 -4
- package/src/loops/bugfix.json +11 -5
- package/src/loops/feature.json +7 -4
- package/src/skills/loop.md +1 -0
- package/src/skills/ship.md +9 -1
- package/web/dist/assets/{Activity-B7cFtS00.js → Activity-Bjy64wHC.js} +1 -1
- package/web/dist/assets/{ActivityDetail-C-GbMmuW.js → ActivityDetail-B0AaipP8.js} +1 -1
- package/web/dist/assets/{Bonsai-_YyexVC5.js → Bonsai-CJniRqaH.js} +1 -1
- package/web/dist/assets/{CopyButton-IXnXzH4Y.js → CopyButton-C5Li6awl.js} +1 -1
- package/web/dist/assets/Dashboard-B-6DTmae.js +2 -0
- package/web/dist/assets/{DataTable-BWbUx4bY.js → DataTable-b9zTShqJ.js} +1 -1
- package/web/dist/assets/{Docs-w3Y7M5Ts.js → Docs-LRc30XL9.js} +1 -1
- package/web/dist/assets/{EmptyState-1sPNleqv.js → EmptyState-CY5Pm2xy.js} +1 -1
- package/web/dist/assets/FilterInput-qGKNSlxv.js +1 -0
- package/web/dist/assets/{GreenhouseView-BWWbMKmg.js → GreenhouseView-CcoYlaWo.js} +1 -1
- package/web/dist/assets/Installs-dp1epTcE.js +3 -0
- package/web/dist/assets/JournalView-nFP4poCf.js +1 -0
- package/web/dist/assets/{KitApply-CQQbnThf.js → KitApply-DwyZUj57.js} +1 -1
- package/web/dist/assets/{Kits-aj07N7mT.js → Kits-C0IEdZXe.js} +1 -1
- package/web/dist/assets/Laws-CkykmQWu.js +3 -0
- package/web/dist/assets/Library-Guh9HBZU.js +2 -0
- package/web/dist/assets/{Loops-C5u7fQOR.js → Loops-CzitjxGV.js} +1 -1
- package/web/dist/assets/Markdown-C4S4tTA7.js +69 -0
- package/web/dist/assets/{OperatorHudView-Blu1lqiZ.js → OperatorHudView-DLGNulIY.js} +1 -1
- package/web/dist/assets/{Personal-ox_MktWO.js → Personal-BMtberL8.js} +1 -1
- package/web/dist/assets/RailCats-D5weYPCS.js +1 -0
- package/web/dist/assets/{Tabs-CIPyMAX-.js → Tabs-uYJqfuQt.js} +1 -1
- package/web/dist/assets/index-DA7BiaE5.js +3 -0
- package/web/dist/assets/index-dbbDGFDq.css +1 -0
- package/web/dist/assets/{motion-CXaUMNkg.js → motion-Bccx3zE8.js} +1 -1
- package/web/dist/assets/react-C1iE8mnY.js +9 -0
- package/web/dist/assets/rolldown-runtime-XKyaHtl9.js +1 -0
- package/web/dist/assets/{usePoll-bDFN-Hr6.js → usePoll-o8ul-Sog.js} +1 -1
- package/web/dist/index.html +5 -5
- package/web/dist/assets/Dashboard-sCfEjowQ.js +0 -2
- package/web/dist/assets/FilterInput-CZREvrjX.js +0 -1
- package/web/dist/assets/Installs-CnkdJ-VA.js +0 -3
- package/web/dist/assets/JournalView-C7bPD3fZ.js +0 -1
- package/web/dist/assets/Laws-DZ38nl_H.js +0 -3
- package/web/dist/assets/Library-QCGXPV5h.js +0 -2
- package/web/dist/assets/Markdown-DpmmtW2Y.js +0 -65
- package/web/dist/assets/RailCats-BuJD4Jou.js +0 -1
- package/web/dist/assets/index-0GCxkY7m.css +0 -1
- package/web/dist/assets/index-CzDi9JpF.js +0 -3
- package/web/dist/assets/react-DlYQp10C.js +0 -9
- package/web/dist/assets/rolldown-runtime-hePW80VL.js +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-BWWbMKmg.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-CzDi9JpF.js","assets/api-BxjLd7Qd.js","assets/index-0GCxkY7m.css","assets/OperatorHudView-Blu1lqiZ.js","assets/JournalView-C7bPD3fZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BxjLd7Qd.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{B as l,Dt as u,I as d,J as f,L as p,Q as m,U as h,Y as g,at as _,bt as v,ct as y,l as b,ot as x,q as S,rt as C,st as w,t as T}from"./index-CzDi9JpF.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),ee={done:`ok`,failed:`bad`},A={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=d(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];if(i&&i.key===r){i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started);continue}t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=y(e.newest),n=e.oldest?y(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${ee[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:A[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=v(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>u(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(o,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function R({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,k.jsxs)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(C,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=p(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[y(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(l,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=w(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=x(e.counts),o=n?.version_verdict||``,s=U(o),l=_(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=x(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=v(()=>q(()=>i.fleet()),[e]),r=v(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?b(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>T(()=>import(`./GreenhouseView-BWWbMKmg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>T(()=>import(`./OperatorHudView-Blu1lqiZ.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>T(()=>import(`./JournalView-C7bPD3fZ.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:l}){let u=c,[d,p]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:b}=v(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(f,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(g,{});let x=e.daemon_stale?(0,k.jsx)(S,{}):null;return e.deployed?d===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:[x,(0,k.jsx)(Q,{overview:e,recent:b,lens:y,onDirection:p,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(m,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:d===e?`on`:``,onClick:()=>p(e),"aria-pressed":d===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[d===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:l}),d===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),d===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),d===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),d===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},d)]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(h,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";e();var n=t();function r({value:e,onChange:t,label:r,placeholder:i,className:a}){return(0,n.jsx)(`input`,{className:a||`lib-filter`,type:`text`,value:e,onChange:e=>t(e.target.value),placeholder:i,"aria-label":r||i})}export{r as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{n as i}from"./motion-CXaUMNkg.js";import{$ as a,Ct as o,Et as s,J as c,Q as l,St as u,W as d,X as f,Y as p,Z as m,_t as h,at as g,bt as _,ct as v,dt as y,ft as b,gt as x,ht as S,it as C,mt as w,pt as T,rt as E,ut as D,vt as O,wt as k,xt as A,yt as j,z as M}from"./index-CzDi9JpF.js";import{t as N}from"./EmptyState-1sPNleqv.js";import{t as P}from"./Tabs-CIPyMAX-.js";import{c as F,i as I,l as L,n as R,o as z,s as ee,t as te}from"./KitApply-CQQbnThf.js";var B=e(t(),1),V=n();function ne({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,B.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,V.jsxs)(`div`,{className:`deploy-pop`,children:[(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,V.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsxs)(`label`,{className:`dp-field`,children:[(0,V.jsx)(`span`,{children:`Deploy as`}),(0,V.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:w.map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,V.jsx)(F,{value:s,options:n,onChange:p,who:`the new harness`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,V.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,V.jsx)(`code`,{children:S(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function re(){let{data:e,error:t,reload:n}=_(()=>r.excludes(),[]),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,V.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,V.jsx)(`div`,{className:`card-head`,children:(0,V.jsx)(`h3`,{children:`Excluded folders`})}),(0,V.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsx)(`code`,{children:e.path}),(0,V.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>S(e).label).join(`, `)}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,V.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,V.jsx)(E,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,V.jsx)(`p`,{className:`sub`,children:e},t))]})}function ie({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,V.jsxs)(`div`,{className:`ip-block`,children:[(0,V.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,V.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,V.jsxs)(`div`,{className:`mcp-target`,children:[(0,V.jsxs)(`div`,{className:`mt-head`,children:[(0,V.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,V.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,V.jsxs)(`div`,{className:`mcp-row`,children:[(0,V.jsx)(`span`,{className:`mono`,children:e.name}),(0,V.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,V.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,V.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,V.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ae({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${S(e.host).label} · ${e.scope}`,[h,g]=H[e.state]||H.absent,_=e.state===`active`,v=e.state===`absent`;return(0,V.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,V.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,V.jsxs)(`div`,{className:`ip-head`,children:[(0,V.jsx)(`h2`,{children:x(e)}),(0,V.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,V.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${S(e.host).label}`}),(0,V.jsx)(`code`,{className:`ip-path`,children:e.path}),v?(0,V.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,V.jsx)(`strong`,{children:S(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(_||v)&&o?(0,V.jsx)(`div`,{className:`ip-picks`,children:(0,V.jsx)(F,{value:n,options:i,onChange:a,who:m})}):null,_&&t.length?(0,V.jsx)(ie,{targets:t,onReveal:p}):null,_&&e.scope===`global`?(0,V.jsx)(re,{}):null,v?null:(0,V.jsxs)(`label`,{className:`ip-switch`,children:[(0,V.jsx)(L,{on:_,disabled:s,label:`activate ${m}`,onToggle:d}),(0,V.jsx)(`span`,{children:_?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,V.jsx)(`div`,{className:`ip-spacer`}),o?(0,V.jsxs)(`div`,{className:`ip-actions`,children:[v?(0,V.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):_?(0,V.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,v?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`field`,children:[(0,V.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,V.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,V.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,V.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,V.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var oe=(e,t)=>`${e} ${t}`,se=[`claude`,`bob`,`openclaude`],U={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},W=/[\\/]\.claude[\\/]worktrees[\\/]/,G=e=>e.scope===`project`&&W.test(e.path);function ce(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?g(e.drift):0;return i?`${r} · ${i} edited`:r}function le({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,V.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,V.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?g(t.drift):0;return(0,V.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,V.jsx)(M,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,V.jsx)(`span`,{className:`dim`,children:ce(t,n)}),t.diffable?null:(0,V.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ue({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,V.jsx)(`div`,{className:`tbl-scroll`,children:(0,V.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,V.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,V.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,V.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,V.jsx)(`th`,{scope:`col`,children:`State`}),(0,V.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,V.jsx)(`th`,{scope:`col`,children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,V.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=U[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,V.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,V.jsx)(`td`,{children:S(e.host).label}):(0,V.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,V.jsx)(`td`,{children:u?``:e.theme||``}),(0,V.jsx)(`td`,{children:u?``:e.footprint||``}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`tag ${c}`,children:i}),G(e)?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`tag warn`,title:`Inside a .claude/worktrees folder: likely a finished worktree. Remove it from its panel.`,children:`Worktree leftover`})]}):null]}),(0,V.jsx)(`td`,{children:(0,V.jsx)(le,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,V.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function de({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,V.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,V.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,V.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,V.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function fe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,V.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,V.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,V.jsxs)(`dl`,{className:`kv-grid`,children:[(0,V.jsx)(`dt`,{children:`Source`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.root}),(0,V.jsx)(`dt`,{children:`Version`}),(0,V.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,V.jsx)(`dt`,{children:`Fingerprint`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function K({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:l}){let u=a(),{data:d,error:f,reload:m}=_(()=>r.installs(),[s]),{data:h,error:g,reload:v}=_(()=>r.mcp(),[s]),{data:b,error:C}=_(()=>r.fleet(),[s]),w=C?null:b??void 0,[T,O]=(0,B.useState)(null),[k,A]=(0,B.useState)(``),[M,P]=(0,B.useState)({}),[F,I]=(0,B.useState)(!1),[L,R]=(0,B.useState)({id:``,value:`keep`}),z=e=>L.id===e?.id?L.value:`keep`,[te,re]=(0,B.useState)(()=>y(`hosts`)),ie=(0,B.useMemo)(()=>{let e={};for(let t of h?.targets||[]){let n=oe(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[h]);if(f||g)return(0,V.jsx)(c,{error:f||g,onRetry:()=>{m(),v()}});if(!d||!h)return(0,V.jsx)(p,{});let H={active:0,disabled:1,absent:2},U=[...d.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(H[e.state]??3)-(H[t.state]??3)),W=U.find(e=>e.id===te)||U.find(e=>e.default)||U.find(e=>e.state===`active`)||U[0],G=e=>{let t=M[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},ce=(e,t,n)=>P(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),le=e=>{let t=G(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},K={theme:t.map(e=>e.name),footprint:ee,posture:d.postures||[],mode:d.modes||[],trust:d.trusts||[]},pe=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=G(t),s=S(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,l=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await u(l,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},me=async e=>{if(e.state!==`active`||await u(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){A(e.id),O(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;O({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},q=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&se.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},he=async e=>{let t=z(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${q(e,`memory`)} and ${q(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await u(`Uninstall ${S(e.host).label} · ${e.scope}? It deletes ${j(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){A(e.id),O(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){O({text:n.error||`remove failed`,tone:`bad`});return}R({id:``,value:`keep`}),n.kept?.length&&O({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},ge=async e=>{O(null);try{let t=await r.mcpReveal(e.path);O({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){O({text:e.message,tone:`bad`})}},J=async()=>{let t=U.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await u(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},_e=U.find(e=>e.default)?.host||U.find(e=>e.state===`active`)?.host||U[0]?.host||`opencode`,ve=U.filter(e=>e.scope===`global`),Y=U.filter(e=>e.scope!==`global`),X=e=>{re(e)},Z=e=>{D(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,V.jsxs)(`div`,{className:`hosts`,children:[(0,V.jsxs)(`div`,{className:`hosts-main`,children:[(0,V.jsxs)(`div`,{className:`toolbar`,children:[(0,V.jsxs)(`span`,{className:`dim`,children:[U.filter(e=>e.state===`active`).length,` active of `,U.length,` `,`detected.`]}),e?(0,V.jsx)(`div`,{className:`row gap-8`,children:(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:J,children:[(0,V.jsx)(E,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,V.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,V.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.text}):null,(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,V.jsx)(`div`,{className:`inst-head`,children:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,V.jsx)(ue,{rows:ve,currentId:W?.id,onPick:X,label:`Global installs`,fleet:w,onEdits:Z})]}),(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>I(e=>!e),children:[(0,V.jsx)(E,{name:`folder`}),` Deploy to a repo…`]}):null]}),F?(0,V.jsx)(`div`,{className:`inst-deploy`,children:(0,V.jsx)(ne,{host:_e,theme:n||`neutral`,options:K,onAction:e,onClose:()=>I(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Y.length?(0,V.jsx)(ue,{rows:Y,project:!0,currentId:W?.id,onPick:X,label:`Per-project installs`,fleet:w,onEdits:Z}):(0,V.jsx)(N,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,V.jsx)(fe,{setup:o,overview:i}),(0,V.jsx)(de,{themes:t,current:i?.theme})]}),W?(0,V.jsx)(ae,{inst:W,targets:ie[oe(W.host,W.path)]||[],choice:G(W),unchanged:le(W),options:K,onPick:(e,t)=>ce(W,e,t),canAct:!!e,busy:k===W.id,memory:z(W),onMemory:e=>R({id:W.id,value:e}),onApply:()=>pe(W),onToggleInstall:()=>me(W),onRemove:()=>he(W),onRevealMcp:ge},W.id):null]})}function pe({onAction:e,dataRev:t}){let{data:n,error:i}=_(()=>r.kits(),[t]),a=z(n,e);return i||n?.error?(0,V.jsx)(c,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,V.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=I(e),r=a.setOf(e),i=`${e.host} · ${e.scope}`;return(0,V.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{children:i}),(0,V.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,V.jsx)(R,{row:e})]}),t&&(0,V.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,V.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,V.jsxs)(`li`,{className:`kit-row`,children:[(0,V.jsxs)(`div`,{className:`kit-main`,children:[(0,V.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,V.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,V.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,V.jsx)(L,{on:r.has(n.name),disabled:t||a.running(e),label:`${n.name} for ${i}`,onToggle:()=>a.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,V.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,V.jsx)(te,{row:e,stage:a})]},e.id)})}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,V.jsx)(p,{})}function me(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var q=300;function he(e){let t=T(e.dataRev),[n,r]=b(`edits`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Local edits of:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ge,{install:n,...e},n?.id||``)]})}function ge({install:e,onMutated:t,onAction:n,dataRev:i,overview:o}){let s=a(),{data:l,error:u,reload:d}=_(()=>r.diff(O(e)),[i]),[f,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(``),[v,y]=(0,B.useState)(()=>new Set),[b,x]=(0,B.useState)(()=>new Set),[S,C]=(0,B.useState)(null);if(l&&l!==S){C(l),y(new Set);let e=l.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=q?l.files.map(e=>e.rel):[]))}let w=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>y(e=>e.size===A.length?new Set:new Set(A.map(e=>e.rel))),D=()=>n?.(`export`),k=async()=>{let n=[...v],i=n.filter(e=>l.files.find(t=>t.rel===e)?.status===`added`),a=i.length?`Restoring will DELETE ${i.length} deployed-only file(s):\n${i.join(`
|
|
2
|
-
`)}\n\n`:``;if(await s(`${a}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let i=await r.restore(n,O(e)),a=i.errors.length?` · ${i.errors.length} error(s): ${i.errors.join(`; `)}`:``;g(`Restored ${i.restored.length}, archived ${i.deleted.length}${a}`),await d(),t?.()}catch(e){g(e.message)}finally{m(!1)}}};if(u)return(0,V.jsx)(c,{error:u,onRetry:d});if(!l)return(0,V.jsx)(p,{});if(!l.deployed)return(0,V.jsx)(N,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!l.diffable)return(0,V.jsx)(N,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`The drift check covers global installs only. Pick a global install above.`});let A=l.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),j=l.files.filter(e=>e.status===`linked`),M=l.files.filter(e=>e.status===`stale`),P=A.filter(e=>e.status===`edited`).length,F=A.filter(e=>e.status===`added`).length,I=A.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Local edits`}),l.target?(0,V.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,V.jsx)(`code`,{children:l.target}),l.theme?` (${l.theme} voice)`:``,` with source`,` `,o?.version||`unknown`,`.`]}):null,P>0?(0,V.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):F+I>0?(0,V.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||v.size===0,onClick:k,children:[`Restore`,v.size?` (${v.size})`:``]}),(0,V.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,V.jsx)(E,{name:`download`}),`Export improvements`]})]})]}),h?(0,V.jsx)(`p`,{className:`sub mb-14`,children:h}):null,j.length?(0,V.jsxs)(`p`,{className:`sub dim mb-14`,title:j.map(e=>e.rel).join(`
|
|
3
|
-
`),children:[j.length,` linked — yours, left alone`]}):null,A.length===0&&M.length===0?(0,V.jsx)(N,{title:`In sync`,children:`Deployed harness matches source.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`row between mb-14`,children:[(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`span`,{className:`badge warn`,children:[(0,V.jsx)(`span`,{className:`dot`}),P,` edited`]}),(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),F,` added`]}),I>0&&(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),I,` missing`]}),M.length>0&&(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),M.length,` behind`]})]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(l.files.map(e=>e.rel))),children:`Expand all`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),A.length?(0,V.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:v.size===A.length,onChange:T}),`Select all`]}):null]})]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:A.map(e=>R(e,!0))}),M.length?(0,V.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,V.jsx)(`h3`,{children:`Behind source`}),(0,V.jsxs)(`div`,{className:`row between`,children:[(0,V.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,V.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),M.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=b.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,V.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,V.jsxs)(`div`,{className:`diff-head`,children:[t?(0,V.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:v.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,V.jsx)(`span`,{className:`fname`,children:e.rel}),(0,V.jsxs)(`span`,{className:`badge ${r}`,children:[(0,V.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,V.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,V.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,V.jsx)(E,{name:`chevron`})})]}),n&&(0,V.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,V.jsx)(`div`,{className:`diff-line ${me(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,B.useState)(!n);return(0,V.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,V.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,V.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,V.jsx)(`h3`,{children:e.label}),(0,V.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,V.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,V.jsx)(E,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,V.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,V.jsxs)(`div`,{className:`problem`,children:[(0,V.jsx)(`span`,{className:`x`,children:`✕`}),(0,V.jsx)(`span`,{children:e})]},e))})]})}function _e({dataRev:e}){let t=T(e),[n,r]=b(`doctor`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Doctor for:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ve,{install:n,dataRev:e},n?.id||``)]})}function ve({install:e,dataRev:t}){let n=(0,B.useRef)(!1),{data:i,error:a,reload:o,setData:s}=_(()=>{let t=n.current;return n.current=!1,r.doctor(t,O(e))},[t]),l=()=>{n.current=!0,s(null),o()};if(a)return(0,V.jsx)(c,{error:a,onRetry:o});let u=i?i.groups.filter(e=>e.problems.length):[],d=i?i.groups.filter(e=>!e.problems.length):[];return(0,V.jsxs)(`div`,{className:`page-fill`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,V.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,V.jsxs)(`button`,{className:`btn`,onClick:l,disabled:!i,children:[(0,V.jsx)(E,{name:`refresh`}),i?`Re-run checks`:`Running…`]})]}),i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`span`,{className:`dim mono`,children:[`validated `,i.themes.length,` theme`,i.themes.length===1?``:`s`]}),i.checked_at?(0,V.jsxs)(`span`,{className:`dim mono`,title:i.checked_at,children:[`checked `,i.checked_at.slice(11)]}):null,i.themes.map(e=>(0,V.jsx)(`span`,{className:`badge cap`,children:e},e))]}),i.ok?(0,V.jsxs)(`span`,{className:`badge ok`,children:[(0,V.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),i.problems.length,` problem`,i.problems.length===1?``:`s`]})]})}),(0,V.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,V.jsx)(J,{group:e,i:t},e.label)),d.length?(0,V.jsxs)(`details`,{className:`check-fold`,children:[(0,V.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,V.jsx)(J,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,V.jsx)(p,{label:`Running every check (builds each theme in a sandbox)…`})]})}function Y(){let e=a(),[t,n]=(0,B.useState)(!1),[i,o]=(0,B.useState)(null);return t?(0,V.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,V.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:i}),(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){o(null);try{await r.shutdown()}catch(e){if(e.status)return o(e.message)}n(!0)}},children:[(0,V.jsx)(E,{name:`x`}),`Stop server`]})]})}function X(){let e=a(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:r}),(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await o()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,V.jsx)(E,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Z=`https://github.com/Arylmera/Geneseed`,ye=`https://github.com/Arylmera`,be=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],xe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function Q({k:e,help:t,children:n,control:r}){return(0,V.jsxs)(`div`,{className:`sheet-row`,children:[(0,V.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,V.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,V.jsx)(`div`,{className:`sheet-v`,children:n}),(0,V.jsx)(`div`,{className:`sheet-c`,children:r})]})}function $({id:e,title:t,head:n,className:r=``,children:i}){return(0,V.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Se({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,V.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:be.map(([n,r])=>(0,V.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,V.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function Ce({version:e}){let[t,n]=(0,B.useState)(Z),[i,a]=(0,B.useState)(!0);(0,B.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,V.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,V.jsx)(E,{name:`external`})]});return(0,V.jsxs)($,{id:`about`,title:`About`,children:[(0,V.jsx)(Q,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,V.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,V.jsx)(Q,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,V.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,V.jsx)(Q,{k:`Geneseed`,help:`MIT-licensed`,control:(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`Issues`]}),(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`MIT License`]})]})]}),children:(0,V.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,V.jsx)(Q,{k:`Creator`,control:(0,V.jsxs)(`a`,{className:`btn ghost`,href:ye,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,V.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function we({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:o,onAccentMode:c,layout:d,onLayout:p,dataRev:h}){let g=a(),_=T(h),[y,C]=b(`server`,_),w=y?.footprint,D=e?.server,O=e?.daemon_stale,[j,M]=(0,B.useState)(null);(0,B.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>M(e||null)).catch(()=>{})},[]);let N=j?j.install??(j.git?`git`:`npm-global`):null,P=N===`git`?`Update (git pull + rebuild)`:N===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,F=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await g(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},I=D?.autostart===!0?`On · login script`:D?.autostart===!1?`Off`:`unknown`;return(0,V.jsxs)(`div`,{className:`narrow-lg`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-18`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:s.server}),(0,V.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]}),(0,V.jsx)(f,{installs:_,value:y,onChange:C,label:`Footprint of:`})]}),(0,V.jsxs)(`div`,{className:`sheet`,children:[(0,V.jsx)(Se,{stale:O}),(0,V.jsxs)(`div`,{className:`sheet-body`,children:[(0,V.jsxs)($,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-skin-label`,children:k.map(e=>(0,V.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>i(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:k.find(e=>e.id===n)?.tagline??``})]}),o&&c&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,V.jsx)(m,{value:o,onChange:c,labelledBy:`dir-accent-label`}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:u(o)})]}),d&&p&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-layout-label`,children:A.map(e=>(0,V.jsx)(`button`,{className:d===e.id?`on`:``,onClick:()=>p(e.id),"aria-pressed":d===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:A.find(e=>e.id===d)?.tagline??``})]})]}),(0,V.jsxs)($,{id:`machine`,title:`Machine`,children:[(0,V.jsx)(Q,{k:`Geneseed`,help:`This copy of the source`,control:N===`other`?j.command?(0,V.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,V.jsx)(`code`,{className:`mono`,children:j.command})]}):null:(0,V.jsxs)(`button`,{className:`btn`,onClick:F,children:[(0,V.jsx)(E,{name:`download`}),P]}),children:(0,V.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,V.jsx)(Q,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,V.jsx)(E,{name:`external`}),`Add to PATH`]})}),y&&w&&(0,V.jsxs)(Q,{k:`Harness footprint`,help:(0,V.jsxs)(V.Fragment,{children:[`For `,S(y.host).label,` · `,y.scope,`; every Rule stays in force.`,` `,(0,V.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,V.jsx)(`span`,{className:`mono`,children:w}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,children:w===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,V.jsxs)($,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`pill good`,children:`running`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,D?` · pid ${D.pid} · up ${v(D.started)}`:``]})]}),children:[(0,V.jsx)(Q,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,V.jsx)(X,{}),children:O?(0,V.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,V.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,V.jsx)(Q,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,V.jsx)(`span`,{className:`sub`,children:I})}),(0,V.jsx)(Q,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,V.jsx)(`span`,{className:`row wrap gap-8`,children:xe.map(e=>(0,V.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,V.jsx)(Ce,{version:e?.version}),(0,V.jsxs)($,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,V.jsx)(Q,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,V.jsx)(Y,{})}),(0,V.jsx)(Q,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,V.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,V.jsx)(Q,{k:`Uninstall a harness`,children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function Te({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:s={}}){let c=t?.doctor,l=t?.diff,u=T(o),f=u?.length>1?h(u[0]):null,p=e=>e==null||!f?e:{v:e,of:f},m={edits:p(l?C(l):null),doctor:p(c?c.ok?`clean`:c.problems.length:null)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,V.jsx)(P,{page:`installs`,current:e,badges:m,label:`Installs`}),e===`hosts`&&(0,V.jsx)(K,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,V.jsx)(pe,{onAction:i,dataRev:o}),e===`edits`&&(0,V.jsx)(he,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,V.jsx)(_e,{dataRev:o}),e===`server`&&(0,V.jsx)(we,{overview:t,onAction:i,dataRev:o,...s})]})}export{Te as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{At as j,Dt as M,S as N,bt as P,ct as F,jt as I,kt as L,lt as R}from"./index-CzDi9JpF.js";import{n as z}from"./Dashboard-sCfEjowQ.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=I(this,p(e,l,t,null,this));V(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,I(this,a),e)}}else V(e,this,I(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=I(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>M(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),M(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=P(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:j(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:j(70)},260).add(a,{opacity:1,duration:300,delay:j(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:j(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=R(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:j(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:N(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:N(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:R(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>M(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>M(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:F(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${F(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>M(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>M(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{$ as i,Dt as a,G as o,H as s,J as c,K as l,Q as u,R as d,W as f,X as p,Y as m,_ as h,bt as g,d as _,f as v,ft as y,g as b,h as ee,m as te,p as ne,pt as x,v as S,vt as C,y as w}from"./index-CzDi9JpF.js";import{t as re}from"./EmptyState-1sPNleqv.js";import{t as ie}from"./FilterInput-CZREvrjX.js";import{t as ae}from"./Markdown-DpmmtW2Y.js";var T=e(t(),1);function oe({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:s}){let c=i(),u=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),d=u.join(`,`),f=l(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=o(u),{prune:h}=f,g=e.length>0;(0,T.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===p&&t.base!==m)},[g,p,m,h]);let _=f.get(`rules`,p),v=_&&_.base===m?_.value:u,y=e=>f.put(`rules`,p,e(v),m),b=e=>v.includes(e),ee=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),te=e=>e.rules.some(e=>b(e.addr)),ne=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},x=e=>{let t=e.rules.filter(e=>b(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},S=t.flatMap(e=>e.rules.map(e=>e.addr)),C=S.filter(b),w=C.join(`,`)!==d,re=`process.5`,ie=u.includes(re)&&!v.includes(re);return{deployedRules:u,isOn:b,toggleRule:ee,packOn:te,togglePack:ne,packState:x,allRules:S,pickedRules:C,dirty:w,losingConsent:ie,applyPacks:async()=>{if(!r||!w)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),o=ie?`
|
|
2
|
-
|
|
3
|
-
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(s?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=C.length?`${C.length} of ${S.length} doctrine rules`:`no doctrine rules`;await c(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${o}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await a(`install`,{...n,doctrines:e,excludeRules:i})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var E=n();function D({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:l,toggleCol:u=null,renderBody:d,srcLine:f}){let p=(0,T.useId)(),{data:m,error:h,reload:_}=g(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),v=t&&(0,E.jsxs)(`div`,{className:`law-expand`,id:p,children:[h?(0,E.jsx)(c,{error:h,onRetry:_}):m?d(m):(0,E.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,E.jsx)(`div`,{className:`law-srcline`,children:f})]}),y={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":p,"aria-label":s};return u?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,E.jsx)(`button`,{className:`law-disclosure`,...y,children:o}),(0,E.jsx)(`span`,{className:`toggle-col`,children:u})]}),v]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:i,style:a,"data-addr":e,...y,children:o}),v]})}function se({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null}){let a=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`law-no`,children:[(0,E.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,E.jsxs)(`span`,{className:`law-name`,children:[(0,E.jsx)(`span`,{children:e.name}),e.ess?(0,E.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,E.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,E.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,E.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,E.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,E.jsx)(D,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:a,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,E.jsx)(ae,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`})}var O=[`invariants`,`doctrines`];function ce({tiers:e,current:t,onPick:n}){return(0,E.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`tier-head`,children:[(0,E.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,E.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,E.jsxs)(`span`,{className:`tier-top`,children:[(0,E.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,E.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,E.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,E.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,E.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,E.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,E.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&O.includes(e.key)?(0,E.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,E.jsx)(`div`,{className:a,children:i},e.key)})})}function le({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1,install:i=null}){let a=i?`off · ${i.host} ${i.scope}`:`off`,o=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(b(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),s=Math.max(1,...o.map(([,e])=>e));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),o.length?(0,E.jsx)(`ul`,{className:`gate-list`,children:o.map(([e,r,i])=>{let o=b(e),c=t[o]?.name||o;return(0,E.jsxs)(`li`,{children:[(0,E.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,E.jsxs)(`span`,{className:`gate-top`,children:[(0,E.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:c}),(0,E.jsx)(`span`,{className:`mono dim`,children:o}),i&&(0,E.jsx)(`span`,{className:`mono off`,children:a}),(0,E.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,E.jsx)(d,{value:r,max:s,label:`${c} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,E.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,E.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,losingConsent:l}=t,u=Math.max(1,...e.map(e=>e.rules.length));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,E.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,E.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,E.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,E.jsx)(d,{value:t,max:u,label:`${e.title} rules on`}),(0,E.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>s(e)}):null]},e.pack)})}):(0,E.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,E.jsxs)(E.Fragment,{children:[l&&(0,E.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,E.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,E.jsx)(`code`,{children:`git commit`}),` and `,(0,E.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,E.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:c?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}function de(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=h(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:ee(n.name),c:w[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function k(e){let t=x(e.dataRev),[n,i]=y(`laws`,t),{data:a}=g(()=>n?r.overview(C(n)).catch(()=>null):Promise.resolve(null),[n?.id??``,e.dataRev]),o=n&&a?.install?.host===n.host&&a.install.path===n.path?a:null,s=n?o:e.overview,c=t!==null&&(!n||o!==null);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(p,{className:`page-pick`,installs:t,value:n,onChange:i,label:`Constitution of:`}),(0,E.jsx)(A,{...e,overview:s,pair:C(n),onAction:c?e.onAction:void 0},n?.id??`none`)]})}function A({selected:e,overview:t,setup:n,onAction:o,dataRev:l,pair:p}){let y=i(),{data:x,error:C}=g(()=>r.catalog(`laws`,p),p?[l,p.host,p.path]:[l],`catalog:laws`),{data:ae}=s(l,p),[D,O]=(0,T.useState)(`all`),[k,A]=(0,T.useState)(``),[j,M]=(0,T.useState)(`all`),[fe,pe]=(0,T.useState)(()=>new Set),N=e||null,P=e=>a(N===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),[me,he]=(0,T.useState)(0),ge=(0,T.useRef)(null);(0,T.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>{let t=document.querySelector(`[data-addr="${CSS.escape(e)}"]`);if(!t)return;let n=ge.current===e;ge.current=null;let r=t.getBoundingClientRect();if(n||r.top<80||r.bottom>window.innerHeight){let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`})}n&&(t.classList.remove(`law-flash`),t.offsetWidth,t.classList.add(`law-flash`))});return()=>cancelAnimationFrame(t)},[e,me,x]);let F=x?.items||[],I=de(F),L=e=>t?.install?.[v[e].key]!==!1,_e=L(`IV`),R=t?.install,z=!!(R&&o),B=oe({items:F,packs:I,install:R,canApply:z,onAction:o,gateArmed:_e}),{deployedRules:V,isOn:H,toggleRule:ve,packOn:ye,packState:be,allRules:U}=B;if(C)return(0,E.jsx)(c,{error:C});if(!x)return(0,E.jsx)(m,{});let W={ontology:x.nouns?.ontology||`Ethos`,law:x.nouns?.law||`Dictate`,laws:x.nouns?.laws||`Dictates`,doctrines:x.nouns?.doctrines||`Doctrines`},G=F.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),K=F.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&S[e.klass]?e.klass:`craft`,r=h(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:ee(e.name,t?.install),cat:n,c:S[n].c,off:r.retired,src:`laws/universal.md`}}),xe=e=>{let t=H(e.addr),n=V.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Se=I.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!V.includes(e.addr)).map(e=>e.addr)),Ce=async e=>{if(!z)return;let{key:t,label:n}=v[e],r=n.toLowerCase(),i=!L(e),a=`${R.host} · ${R.scope}`,s=B.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await y((i?`Re-arm the ${r} on ${a}? ${_[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${a}? ${_[e].off} It rebuilds in place, non-destructive.`)+s,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&o(`install`,{...R,[t]:i})},we=e=>String(e.addr).includes(`.`)&&H(e.addr)!==V.includes(e.addr),q=(e,t=j)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||V.includes(e.addr)):we(e)),J=k.trim().toLowerCase(),Y=e=>q(e)&&(!J||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(J)),Te=e=>{let t=Me[e],n=String(e).includes(`.`);(n&&D===`invariants`||!n&&D===`doctrines`)&&O(`all`),t&&!q(t)&&M(`all`),t&&!Y(t)&&A(``),ge.current=e,he(e=>e+1),a(`#/item/law/${encodeURIComponent(e)}`)},X={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))X[b(e)]=t;let Ee=e=>X[e.addr]?{...e,asks:`${X[e.addr]} ask${X[e.addr]===1?``:`s`}`}:e,Z=K.filter(e=>!e.retired).length,Q=V.length,De=Object.keys(v).filter(e=>K.some(t=>t.addr===e)&&!L(e)).length,Oe=U.length-Q,$=ae?.stats,ke={ethos:{name:W.ontology,n:G.length,fill:1,sub:`${G.length} sections`,pill:[`always`,`ok`]},invariants:{name:W.laws,n:Z,fill:K.length?Z/K.length:0,sub:K.length>Z?`${Z} active · ${K.length-Z} retired`:`${Z} active`,pill:De?[`${De} gate${De===1?``:`s`} off`,`warn`]:[`always`,`ok`]},doctrines:{name:W.doctrines,n:Q,fill:U.length?Q/U.length:0,sub:`${Q} rules · ${I.filter(e=>e.active).length} of ${I.length} packs`,pill:Oe>0?[`${Oe} excluded`,`warn`]:[`all on`,`ok`]},yours:{name:`Your rules`,n:$?.rules??0,fill:$?.max_rules?$.rules/$.max_rules:0,sub:$?`${$.rules} of ${$.max_rules} · ${$.tokens}/${$.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},Ae=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,W.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},je=ne.map(e=>({key:e.key,...ke[e.key],rule:Ae(e.against)})),Me=Object.fromEntries([...K,...I.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Ne=[[`all`,`All`,K.length+U.length],[`invariants`,W.laws,K.length],[`doctrines`,W.doctrines,U.length]],Pe=D===`all`||D===`invariants`,Fe=D===`all`||D===`doctrines`,Ie=[...Pe?K:[],...Fe?I.flatMap(e=>e.rules):[]],Le=[[`gated`,`Gated`,Ie.filter(e=>q(e,`gated`)).length],[`changed`,`Changed`,Ie.filter(e=>q(e,`changed`)).length]],Re=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,ze=e=>j!==`changed`&&fe.has(e)&&Re(N)!==e,Be=e=>{let t=ze(e);pe(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&Re(N)===e&&a(`#/laws`)},Ve=I.flatMap(e=>e.rules.filter(we).map(e=>({...e,plus:H(e.addr)}))),He=z&&I.length>0&&B.dirty,Ue=()=>{M(`changed`),D===`invariants`&&O(`all`),A(``)},We=(e,t)=>(0,E.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,children:e}),(0,E.jsx)(`span`,{className:`mono dim`,children:t})]}),Ge=K.filter(Y),Ke=(Pe?Ge.length:0)+(Fe?I.reduce((e,t)=>e+t.rules.filter(Y).length,0):0);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(f,{eyebrow:R?[t?.theme,R.footprint&&`${R.footprint} footprint`,R.host,R.scope].filter(Boolean).join(` · `):null,title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,actions:(0,E.jsx)(ie,{className:`law-filter`,value:k,onChange:A,placeholder:`Filter rules`,label:`Filter rules`})}),(0,E.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,E.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,E.jsx)(ce,{tiers:je,current:D,onPick:O}),(0,E.jsx)(`div`,{className:`ladder-tail`,children:te.map((e,t)=>(0,E.jsxs)(`span`,{className:`ladder-low`,children:[(0,E.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,ne.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,E.jsxs)(`div`,{className:`split`,children:[(0,E.jsxs)(`section`,{className:`panel flush law-wrap${z?` with-toggle`:``}`,"aria-label":`Rules`,children:[G.length>0&&(0,E.jsxs)(E.Fragment,{children:[We(W.ontology,`ontology/universal.md`),G.map(e=>(0,E.jsx)(se,{law:e,rev:l,isOpen:N===e.addr,onToggle:()=>P(e.addr)},e.addr))]}),(0,E.jsxs)(`div`,{className:`law-toolbar`,children:[(0,E.jsx)(u,{"aria-label":`Show`,children:Ne.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:D===e?`on`:``,"aria-pressed":D===e,onClick:()=>O(e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,E.jsx)(u,{"aria-label":`Narrow`,children:Le.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:j===e?`on`:``,"aria-pressed":j===e,onClick:()=>M(j===e?`all`:e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,E.jsxs)(`div`,{className:`law-rowhead`,children:[(0,E.jsx)(`span`,{children:`No.`}),(0,E.jsx)(`span`,{children:`Rule`}),(0,E.jsx)(`span`,{children:`Latin name`}),(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(`span`,{children:`Enforced by`})]}),Pe&&Ge.length>0&&(0,E.jsxs)(E.Fragment,{children:[We(W.laws,`laws/universal.md`),Ge.map(e=>(0,E.jsx)(se,{law:Ee(e),rev:l,isOpen:N===e.addr,onToggle:()=>P(e.addr),toggleCol:!z||e.retired?null:v[e.addr]?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${L(e.addr)?` on`:``}`,role:`switch`,"aria-checked":L(e.addr),"aria-label":v[e.addr].label,onClick:()=>Ce(e.addr)}):(0,E.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Fe&&I.map(e=>{let t=e.rules.filter(Y);if(!t.length)return null;let n=ze(e.pack),r=e.rules.filter(e=>H(e.addr)).length;return(0,E.jsxs)(`div`,{className:`pack-wrap${ye(e)?``:` pack-off`}`,children:[(0,E.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,style:{"--cc":w[e.pack]},children:(0,E.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>Be(e.pack),children:e.title})}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,E.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,E.jsx)(`span`,{className:`pack-fill`,children:(0,E.jsx)(d,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,E.jsx)(`span`,{className:`pack-state mono`,children:be(e)})]}),!e.active&&!z&&(0,E.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,I.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Se.length>0&&` --exclude-rules ${Se.join(`,`)}`]}),!n&&t.map(e=>(0,E.jsx)(se,{law:Ee(xe(e)),rev:l,isOpen:N===e.addr,onToggle:()=>P(e.addr),toggleCol:z?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${H(e.addr)?` on`:``}`,role:`switch`,"aria-checked":H(e.addr),"aria-label":`${e.name} rule`,onClick:()=>ve(e.addr)}):null},e.addr))]},e.pack)}),Ke===0&&(0,E.jsx)(re,{title:J||j!==`all`?`No matching rules`:`Nothing in this tier`,children:J?(0,E.jsxs)(E.Fragment,{children:[`Nothing matches “`,k.trim(),`”.`]}):j===`all`?(0,E.jsx)(E.Fragment,{children:`This install predates the tier.`}):(0,E.jsxs)(E.Fragment,{children:[`No `,j,` rule in this tier.`]})})]}),(0,E.jsxs)(`aside`,{className:`aside-stack`,children:[(0,E.jsx)(ue,{packs:I,sel:B,canApply:z,install:R,gateArmed:_e}),(0,E.jsx)(le,{gates:n?.gates,byAddr:Me,onJump:Te,disarmed:e=>!!v[e]&&!L(e),install:t?.install})]})]}),He&&(0,E.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,E.jsxs)(`span`,{className:`law-bar-n`,children:[Ve.length,` unapplied change`,Ve.length===1?``:`s`]}),(0,E.jsx)(`span`,{className:`law-bar-list`,children:Ve.map(e=>(0,E.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:Ue,children:`Review changes`}),(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{M(`all`),B.revert()},children:`Revert`}),(0,E.jsxs)(`button`,{type:`button`,className:`btn`,onClick:B.applyPacks,children:[`Apply (`,B.pickedRules.length,`/`,U.length,` rules)`]})]})]})}export{k as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{i}from"./motion-CXaUMNkg.js";import{n as a,t as o}from"./sections-ChwaobfW.js";import{$ as s,Dt as ee,J as te,Q as ne,V as re,_t as ie,b as c,bt as l,pt as ae,rt as u,x as d}from"./index-CzDi9JpF.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{a as oe,i as se,o as ce,r as le,s as ue,t as de}from"./RailCats-BuJD4Jou.js";import{t as fe}from"./Markdown-DpmmtW2Y.js";var p=e(t(),1),m=n();function pe({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,m.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function h({entries:e}){return e.length?(0,m.jsxs)(`table`,{className:`mf-entries`,children:[(0,m.jsx)(`thead`,{className:`sr-only`,children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{scope:`col`,children:`Path`}),(0,m.jsx)(`th`,{scope:`col`,children:`Load`}),(0,m.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,m.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,m.jsx)(`td`,{className:`mf-load-cell`,children:(0,m.jsx)(pe,{load:e.load})}),(0,m.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function g({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,m.jsxs)(`div`,{className:`mf-vault`,children:[(0,m.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,m.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,m.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,m.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(u,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(u,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,m.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,m.jsx)(u,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,m.jsx)(h,{entries:t})]})}function _({body:e}){let[t,n]=(0,p.useState)(!1),r=(0,p.useId)();return e?(0,m.jsxs)(`div`,{className:`mf-raw`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,m.jsx)(u,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,m.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function me({manifest:e,body:t,name:n}){if(!e)return(0,m.jsx)(`pre`,{className:`mf-raw-pre`,children:(t||``).replace(/^```json\n|\n```$/g,``)});if(e.kind===`wiki`){let n=e.wikis||[];return n.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,m.jsx)(g,{wiki:e},e.name||t)),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,m.jsxs)(`p`,{children:[`A wiki is your machine-wide knowledge base — an Obsidian vault or any folder of linked markdown the agent reads from and writes back to. Declare one in`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,m.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,m.jsx)(_,{body:t})]})}let r=e.context||[];return r.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[(0,m.jsx)(h,{entries:r}),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,m.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,m.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,m.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,m.jsx)(_,{body:t})]})}var he={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},v={advocate:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,m.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,m.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,m.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,m.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,m.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,m.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,m.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,m.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,m.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),"devops-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`3`})]}),"docker-expert":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`14`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`27`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`20`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`34`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`path`,{d:`M8 52c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3 5-3 10-3`,opacity:`.5`})]}),docs:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,m.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,m.jsx)(`g`,{className:`ag-write`,children:(0,m.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,m.jsxs)(`g`,{className:`ag-search`,children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,m.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-frame`,children:(0,m.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,m.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,m.jsxs)(`g`,{className:`ag-turn`,children:[(0,m.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,m.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,m.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,m.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,m.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-gauge`,children:(0,m.jsx)(`path`,{d:`M32 42l10-13`})}),(0,m.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,m.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,m.jsxs)(`g`,{className:`ag-tilt`,children:[(0,m.jsx)(`path`,{d:`M14 18h36`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"kubernetes-specialist":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`16`}),(0,m.jsx)(`path`,{d:`M32 8v13M32 43v13M8 32h13M43 32h13M15 15l9 9M40 40l9 9M49 15l-9 9M24 40l-9 9`,opacity:`.6`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`5`})]}),"memory-curator":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,m.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,m.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,m.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,m.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,m.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,m.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`path`,{d:`M30 34V22`})}),(0,m.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,m.jsxs)(`g`,{className:`ag-lean`,children:[(0,m.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),"spring-boot-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M22 20a16 16 0 1 0 20 0`}),(0,m.jsx)(`path`,{className:`ag-pulse`,d:`M32 12v18`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 50c0-8 5-12 13-12 0 8-5 12-13 12z`})]}),"spring-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h26M12 26h18M12 34h22M12 42h14`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M42 28c0-8 4-12 11-12 0 8-4 12-11 12z`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`24`,cy:`32`,r:`9`}),(0,m.jsx)(`path`,{d:`M31 39l8 8`,strokeWidth:`3`})]})]}),"spring-security":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`path`,{d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`rect`,{className:`ag-f`,x:`16`,y:`28`,width:`32`,height:`24`,rx:`4`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`38`,r:`3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 41v6`})]}),"react-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{className:`ag-spin`,children:[(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(60 32 32)`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(120 32 32)`})]}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`4`})]}),"react-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{opacity:`.4`,children:[(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(60 30 30)`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(120 30 30)`})]}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`30`,r:`8`}),(0,m.jsx)(`path`,{d:`M36 36l9 9`,strokeWidth:`3`})]})]}),steward:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,m.jsxs)(`g`,{className:`ag-grow`,children:[(0,m.jsx)(`path`,{d:`M32 50V26`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,m.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,m.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,m.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,m.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,m.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,m.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,m.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},y=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function ge({name:e,size:t=64}){return(0,m.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...he,children:[(0,m.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,m.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),v[e]||y]})}function b({label:e,value:t,delta:n,children:r}){let a=i(Number.isInteger(t)?t:null);return(0,m.jsxs)(`div`,{className:`stat`,children:[(0,m.jsx)(`div`,{className:`stat-label`,children:e}),(0,m.jsx)(`div`,{className:`stat-value mono`,children:a===null?t:Math.round(a)}),n==null?null:(0,m.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var _e={skills:`skill`,agents:`agent`},x=[`skills`,`agents`,`memory`,`notebook`],S=new Set([`MEMORY`,`NOTEBOOK`,`README`]),ve=e=>e.filter(e=>!S.has(String(e.name).toUpperCase())).length,ye=(e,t)=>`${t?e/t*100:0}%`,C=e=>e.split(`:`).slice(0,2).join(` `),w=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},T=e=>ie(w(e));function be(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 xe({section:e,source:t}){return(0,m.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,m.jsx)(u,{name:a[e].icon,className:`glyph`}),(0,m.jsxs)(`span`,{children:[`This entry is part of the `,a[e].label.toLowerCase(),` convention; see`,` `,(0,m.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var Se=e=>e.replace(/\s+/g,` `).trim(),E=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ce(e,t){let n=e.replace(/\r\n/g,`
|
|
2
|
-
`),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=E(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?Se(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?Se(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=E(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function we({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(b,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(C))].join(`, `),i=t.days_counted>=30?`in the last 30 days`:`since ${t.since}`,a=Math.max(1,...e.per_day),o=[e.last?`last used ${e.last}`:null,i,r?`on ${r}`:null].filter(Boolean).join(` · `);return(0,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(b,{label:`Used`,value:e.n,delta:o,children:(0,m.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,m.jsx)(`i`,{className:t===29?`today`:``,style:{height:ye(e,a)}},t))})})})}function Te(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 Ee={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},De=(e,t)=>t||(e&&o.includes(e)?e:o[0]),Oe=encodeURIComponent;function ke(e){let t=e=>c[e.klass]?e.klass:`personal`,n=d.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:c[n].label,groupC:c[n].c})));return{rows:n,cats:d.map(e=>({key:e,label:c[e].label,c:c[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ae(e){let t=e.filter(e=>e.topic).map(e=>({...e,group:e.topic}));return t.sort((e,t)=>e.group<t.group?-1:+(e.group>t.group)),[...e.filter(e=>!e.topic),...t]}function D({overview:e,section:t,selected:n,dataRev:i,lock:u,base:d,onRulesChanged:pe}){let h=s(),[g,_]=(0,p.useState)(()=>De(t,u)),[he,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(`all`),[S,C]=(0,p.useState)(`all`),[Se,E]=(0,p.useState)(``),[D,je]=(0,p.useState)(null),[O,Me]=(0,p.useState)(null),[Ne,Pe]=(0,p.useState)(t);if(t!==Ne){Pe(t),E(``);let e=De(t,u);e!==g&&(_(e),v(``),b(`all`),C(`all`))}let[Fe,Ie]=(0,p.useState)(n);n!==Fe&&(Ie(n),E(``));let{data:k,error:Le,reload:Re}=l(()=>r.catalog(g),[g,i],`catalog`),A=u?null:_e[g]||null,ze=A!==null||g===`memory`||g===`notebook`,{data:Be}=l(()=>u?Promise.resolve(null):Promise.all(x.map(e=>r.catalog(e))).catch(()=>null),[u,i]),j=A!==null,{data:M}=l(()=>j?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[j,i],`usage`,{revalidate:!0}),N=j&&!!M?.enabled&&Array.isArray(M.names),Ve=(0,p.useMemo)(()=>new Map((Array.isArray(M?.names)?M.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[M]),P=e=>N&&Ve.get(`${A}\u0000${e}`)||null,He=e=>{let t=P(e.name);return!t||t.n===0&&!t.last},Ue=M?.since?`No call since ${M.since}`:`No call recorded yet`,F=k?.section===g&&k?.items||[],I=g===`skills`,We=I?ke(F):null,L=I?We.rows:g===`memory`?Ae(F):F,R=n||L[0]?.name||null,z=R?F.find(e=>e.name===R):null,B=z?.type||a[g].type,V=O?.sec===g&&O?.name===R?O.key:null,{data:Ge,error:H}=l(()=>R?V?r.item(B,R,w(V)):r.item(B,R):Promise.resolve(null),[g,R,B,V,i]),U=H?null:Ge,W=U&&U.name===R&&(!V||U.install===V)?U:null,Ke=e=>K&&e?.install?` in ${T(e.install)}`:``,qe=Se||Le||H,Je=R?{name:R,title:U?.title||R,desc:U?.desc||``}:null,G=z||Je,Ye=e?.counts||{},Xe=e=>{if(!x.includes(e))return Ye[e]??``;if(e===g&&k?.section===g)return ve(F);let t=Be?.find(t=>t?.section===e)?.items;return t?ve(t):``},Ze=ae(i),Qe=Ze?.length>1?`of ${ie(Ze[0])}`:null,K=ze&&new Set(F.flatMap(e=>e.installs||[])).size>1,q=I?L.filter(e=>y===`all`||e.cat===y):L,$e=N?q.filter(He).length:0,et=e=>e.status===`experimental`,tt=q.filter(et).length,nt=[[`all`,`All`,q.length],...N?[[`used`,`Used`,q.length-$e],[`unused`,`Not used yet`,$e,Ue]]:[],...tt?[[`experimental`,`Experimental`,tt,`Shipped, not yet confirmed by real use`]]:[]],J=nt.some(([e])=>e===S)?S:`all`,Y=J===`all`?q:J===`experimental`?q.filter(et):q.filter(e=>He(e)===(J===`unused`)),rt=N?Math.max(0,...F.map(e=>P(e.name)?.n||0)):0,it=I?1/0:50,X=he.trim().toLowerCase(),Z=X?ce(Y,X):Y.slice(0,it),at=!X&&y===`all`&&J===`all`&&R&&!Z.some(e=>e.name===R)?[...Z,...L.filter(e=>e.name===R)]:Z,ot=e=>d?`${d}/${Oe(e.name)}`:`#/item/${e.type||a[g].type}/${Oe(e.name)}`,st=async()=>{let e=W;if(!e)return;let t=e.name;if(await h(`Forget the memory fact "${t}"${Ke(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`})){E(``);try{await r.memoryDelete(t,e.install?w(e.install):void 0)}catch(e){E(`Could not forget "${t}": ${e.message}`);return}ee(d||`#/section/memory`),Re()}},ct=async()=>{let e=W;if(!e)return;let t=e.name;if(await h(`Promote "${t}"${Ke(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`})){E(``);try{let n=e.install?w(e.install):void 0,i=await r.rules(n);await r.rulesPromote({name:t,fingerprint:i.fingerprint,delete_memory:!0},n),re(),pe?.(),ee(`#/personal/rules`)}catch(e){E(`Could not promote: ${e.message}`),Re()}}},lt=U?.body?Ce(U.body,U.desc||G?.desc):null,ut=U?.title||G?.title||G?.name,dt=ut===G?.name&<?.title?lt.title:ut,ft=k?.section===g&&F.length===0,pt=U?.status||G?.status,mt=g===`skills`?c[z?.klass]:null,Q=a[g].label,{lede:ht,when:gt}=Te(U?.desc||G?.desc||``),$=G?U?.source||G.source||(H?null:be(g,G.name)):null;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(te,{error:qe,style:{margin:`0 0 var(--sp-3)`}}),(0,m.jsxs)(`div`,{className:`library lib-dossier${u?` locked`:``}${N?` uses`:``}`,children:[u?null:(0,m.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,m.jsxs)(`div`,{className:`lib-title`,children:[(0,m.jsx)(`h1`,{className:`h`,children:`Library`}),(0,m.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,m.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:o.map(e=>(0,m.jsxs)(p.Fragment,{children:[(0,m.jsxs)(`a`,{href:`#/section/${e}`,className:g===e?`on`:``,"aria-current":g===e?`page`:void 0,children:[a[e].label,(0,m.jsx)(`span`,{className:`mono dim`,children:Xe(e)})]}),e===g&&I&&(0,m.jsx)(de,{label:`Skill types`,total:F.length,cats:We.cats,cat:y,onChange:b})]},e))})]}),(0,m.jsxs)(oe,{label:Q,count:X?`${Z.length} of ${Y.length}`:Y.length,q:he,onQ:v,matched:Z.length,inView:[g,n],extra:N&&M.since?(0,m.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,M.since]}):!x.includes(g)&&g!==`laws`&&Qe?(0,m.jsx)(`span`,{className:`mono dim lib-since`,children:Qe}):null,tools:nt.length>1?(0,m.jsx)(ne,{"aria-label":`Show`,children:nt.map(([e,t,n,r])=>(0,m.jsxs)(`button`,{type:`button`,className:J===e?`on`:``,"aria-pressed":J===e,title:r,onClick:()=>C(e),children:[t,` `,(0,m.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[(0,m.jsx)(le,{rows:at,activeName:G?.name,hrefOf:ot,pills:N||K?e=>{let t=P(e.name)?.n||0,n=K?(e.installs||[]).map(e=>(0,m.jsx)(`span`,{className:`tag mono lr-install`,title:w(e).path,children:T(e)},e)):null;return N?(0,m.jsxs)(m.Fragment,{children:[n,(0,m.jsxs)(`span`,{className:`lr-use`,children:[(0,m.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,m.jsx)(`i`,{style:{width:ye(t,rt)}})}),(0,m.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,m.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})]}):n}:void 0}),!X&&F.length>it&&(0,m.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,it,` of `,F.length,`; type to search the rest.`]}),ft&&(g===`wiki`?(0,m.jsxs)(f,{title:`No wiki entries`,action:(0,m.jsx)(`a`,{href:`#/section/config`,children:`Open the setup files`}),docs:{href:`#/docs/wiki`,label:`How to configure a wiki →`},children:[`Declare a wiki in `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,m.jsx)(f,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,m.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:G?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`reader-tags`,children:[(0,m.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),mt?(0,m.jsx)(`span`,{className:`tag`,children:mt.label}):null,U?.kit??G.kit?(0,m.jsx)(se,{name:U?.kit??G.kit}):null,(0,m.jsx)(ue,{status:pt,withHint:!0}),$?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`mono dim reader-src`,children:$}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText($),je({src:$,ok:!0})}catch{je({src:$,ok:!1})}},children:D?.src===$?D.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,m.jsxs)(`div`,{className:`reader-head`,children:[(0,m.jsx)(`h2`,{className:`reader-title`,children:dt}),g===`agents`?(0,m.jsx)(ge,{name:G.name}):null]}),(0,m.jsxs)(`div`,{className:`reader-intro${N?` with-stats`:``}`,children:[(0,m.jsxs)(`div`,{className:`reader-intro-text`,children:[ht?(0,m.jsx)(`p`,{className:`reader-lede`,children:ht}):null,gt?(0,m.jsxs)(`section`,{className:`reader-when`,children:[(0,m.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,m.jsx)(`p`,{children:gt})]}):null]}),N?(0,m.jsx)(we,{u:P(G.name),usage:M,noCall:Ue}):null]}),g===`memory`&&W&&G.name!==`MEMORY`&&G.name!==`README`&&(0,m.jsxs)(`div`,{className:`row gap-8`,children:[(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:ct,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:st,children:`Forget this fact`})]}),U?.installs?.length>1&&U.installs.includes(U.install)?(0,m.jsxs)(`label`,{className:`row gap-8 lib-copy`,children:[(0,m.jsx)(`span`,{className:`dim`,children:`Viewing copy from:`}),(0,m.jsx)(`select`,{className:`sel`,value:V||U.install,onChange:e=>Me({sec:g,name:R,key:e.target.value}),children:U.installs.map(e=>(0,m.jsx)(`option`,{value:e,title:w(e).path,children:T(e)},e))}),(0,m.jsx)(`span`,{className:`dim`,children:`this entry only`})]}):null,(0,m.jsx)(`hr`,{className:`hr`}),H?(0,m.jsxs)(`p`,{className:`sub`,children:[`No `,Q.replace(/s$/,``).toLowerCase(),` named `,(0,m.jsx)(`em`,{children:G.name}),` could be read in this install.`]}):G?.kind===`manifest`||U?.manifest!==void 0?U?(0,m.jsx)(me,{manifest:U.manifest,body:U.body,name:G.name}):(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):U?.body?(0,m.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,m.jsx)(fe,{body:lt.body,links:U.links||[]})}):U===null&&R?(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,m.jsx)(xe,{section:g,source:be(g,G.name)}),Ee[g]?(0,m.jsx)(`div`,{className:`reader-links`,children:(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${Ee[g]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):ft?null:(0,m.jsx)(f,{title:`Select an entry`,children:`Pick something from the list to read it.`})})]})]})}export{Ce as bodyHead,D as default,Ae as groupMemory,T as installLabel,w as installOfKey,ke as splitSkills,Te as splitWhen};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";var r=e(t(),1);function i(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var a=i();function o(e){a=e}var s={exec:()=>null};function c(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function l(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(d.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var u=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),d={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:c(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:c(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:c(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:c(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:c(e=>RegExp(`^ {0,${e}}(?:</?(?:${x})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:c(e=>RegExp(`^ {0,${e}}>`))},f=/^(?:[ \t]*(?:\n|$))+/,p=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,m=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,h=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,g=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ee=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,v=l(ee).replace(/bull/g,_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),te=l(ee).replace(/bull/g,_).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),y=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ne=/^[^\n]+/,b=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,re=l(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,b).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ie=l(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_).getRegex(),x=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,S=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ae=l(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,S).replace(`tag`,x).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oe=e=>l(y).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,x).getRegex(),se=oe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ce=oe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),C={blockquote:l(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,ce).getRegex(),code:p,def:re,fences:m,heading:g,hr:h,html:ae,lheading:v,list:ie,newline:f,paragraph:se,table:s,text:ne},w=l(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,x).getRegex(),le={...C,lheading:te,table:w,paragraph:l(y).replace(`hr`,h).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,w).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,x).getRegex()},ue={...C,html:l(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,S).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:s,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:l(y).replace(`hr`,h).replace(`heading`,` *#{1,6} *[^
|
|
2
|
-
]`).replace(`lheading`,v).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},de=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,T=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,pe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,E=/[\p{P}\p{S}]/u,D=/[\s\p{P}\p{S}]/u,O=/[^\s\p{P}\p{S}]/u,me=l(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,D).getRegex(),he=/[\p{Pi}\p{Ps}"']/u,k=/(?!~)[\p{P}\p{S}]/u,ge=/(?!~)[\s\p{P}\p{S}]/u,_e=/(?:[^\s\p{P}\p{S}]|~)/u,ve=l(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,u?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),A=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ye=l(A,`u`).replace(/punct/g,E).getRegex(),be=l(A,`u`).replace(/punct/g,k).getRegex(),xe=l(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,he).replace(/punct/g,E).getRegex(),j=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Se=l(j,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),Ce=l(j,`gu`).replace(/notPunctSpace/g,_e).replace(/punctSpace/g,ge).replace(/punct/g,k).getRegex(),we=l(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),Te=l(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),Ee=l(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),De=l(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,E).getRegex(),Oe=l(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,O).replace(/punctSpace/g,D).replace(/punct/g,E).getRegex(),ke=l(/\\(punct)/,`gu`).replace(/punct/g,E).getRegex(),Ae=l(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,E).getRegex(),je=l(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Me=l(S).replace(`(?:-->|$)`,`-->`).getRegex(),Ne=l(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Me).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,N=l(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,M).getRegex(),Pe=l(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,N).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Fe=l(/^!?\[(label)\]\[(ref)\]/).replace(`label`,N).replace(`ref`,b).getRegex(),Ie=l(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,b).getRegex(),P=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Le=l(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,M).getRegex(),Re=l(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,l(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Le).replace(`ref`,P).getRegex()).replace(`nolink`,l(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,P).getRegex()).getRegex(),F=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ze=l(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),I={_backpedal:s,anyPunctuation:ke,anyPunctuationOutsideCode:Ae,autolink:je,blockSkip:ve,br:T,code:fe,del:s,delLDelim:s,delRDelim:s,emStrongLDelim:ye,emStrongRDelimAst:Se,emStrongRDelimUnd:Te,escape:de,link:Pe,nolink:Ie,punctuation:me,reflink:Fe,reflinkSearch:Re,tag:Ne,text:pe,url:s},Be={...I,emStrongLDelim:xe,emStrongRDelimAst:we,emStrongRDelimUnd:Ee,link:l(/^!?\[(label)\]\((.*?)\)/).replace(`label`,N).getRegex(),reflink:l(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,N).getRegex()},L={...I,emStrongRDelimAst:Ce,emStrongLDelim:be,delLDelim:De,delRDelim:Oe,url:l(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,ze).replace(`protocol`,F).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:l(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,F).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},Ve={...L,br:l(T).replace(`{2,}`,`*`).getRegex(),text:l(L.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R={normal:C,gfm:le,pedantic:ue},z={normal:I,gfm:L,breaks:Ve,pedantic:Be},He={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},B=e=>He[e];function V(e,t){if(t){if(d.escapeTest.test(e))return e.replace(d.escapeReplace,B)}else if(d.escapeTestNoEncode.test(e))return e.replace(d.escapeReplaceNoEncode,B);return e}function Ue(e){return d.numericCharacterReference.test(e)?e.replace(d.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function We(e){try{e=encodeURI(e).replace(d.percentDecode,`%`)}catch{return null}return e}function Ge(e,t){let n=e.replace(d.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(d.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(d.slashPipe,`|`);return n}function H(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Ke(e){let t=e.split(`
|
|
3
|
-
`),n=t.length-1;for(;n>=0&&d.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
4
|
-
`)}function U(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function qe(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function W(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Je(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function Ye(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
5
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
6
|
-
`)}function Xe(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var G=class{options;rules;lexer;constructor(e){this.options=e||a}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Ke(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Ye(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=H(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:H(t[0],`
|
|
7
|
-
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:H(t[0],`
|
|
8
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=H(t[0],`
|
|
9
|
-
`).split(`
|
|
10
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
11
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
12
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
13
|
-
${s}`:s,r=r?`${r}
|
|
14
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
15
|
-
`),o=t.raw+`
|
|
16
|
-
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
|
17
|
-
`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
|
|
18
|
-
${d.join(`
|
|
19
|
-
`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
20
|
-
`+e.join(`
|
|
21
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
22
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
|
|
23
|
-
`,1)[0],d=t[1].length,f=this.options.pedantic?W(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>W(e,d)),p=e.split(`
|
|
24
|
-
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
|
|
25
|
-
`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>W(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
|
|
26
|
-
`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
|
|
27
|
-
`+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Ke(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&qe(t[2],`()`)!==-1)return;let e=U(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:H(t[0],`
|
|
28
|
-
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ge(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
29
|
-
`):[],a={type:`table`,raw:H(t[0],`
|
|
30
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Ge(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:H(t[0],`
|
|
31
|
-
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
32
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Xe(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=H(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=qe(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),Je(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&Xe(e,n[1],r,this.rules))return;let i=t[U((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Je(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Ue(t[0]),escaped:e}}}},K=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||a,this.options.tokenizer=this.options.tokenizer||new G,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:d,block:R.normal,inline:z.normal};this.options.pedantic?(t.block=R.pedantic,t.inline=z.pedantic):this.options.gfm&&(t.block=R.gfm,t.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=t}static get rules(){return{block:R,inline:z}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(d.carriageReturn,`
|
|
33
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(d.tabCharGlobal,` `).replace(d.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
34
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
35
|
-
`)?``:`
|
|
36
|
-
`)+i.raw,n.text+=`
|
|
37
|
-
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
38
|
-
`)?``:`
|
|
39
|
-
`)+i.raw,n.text+=`
|
|
40
|
-
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
41
|
-
`)?``:`
|
|
42
|
-
`)+i.raw,r.text+=`
|
|
43
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
44
|
-
`)?``:`
|
|
45
|
-
`)+i.raw,n.text+=`
|
|
46
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,U(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,U(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},q=class{options;parser;constructor(e){this.options=e||a}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(d.notSpaceStart)?.[0],i=e?e.replace(d.endingNewline,``)+`
|
|
47
|
-
`:``;return r?`<pre><code class="language-`+V(r)+`">`+(n?i:V(i,!0))+`</code></pre>
|
|
48
|
-
`:`<pre><code>`+(n?i:V(i,!0))+`</code></pre>
|
|
49
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
50
|
-
${this.parser.parse(e)}</blockquote>
|
|
51
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
52
|
-
`}hr(e){return`<hr>
|
|
53
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
54
|
-
`+r+`</`+i+`>
|
|
55
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
56
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
57
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
58
|
-
<thead>
|
|
59
|
-
`+t+`</thead>
|
|
60
|
-
`+r+`</table>
|
|
61
|
-
`}tablerow({text:e}){return`<tr>
|
|
62
|
-
${e}</tr>
|
|
63
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
64
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${V(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?V(n,!0):this.parser.parseInline(r),o=We(e);if(o===null)return a;e=V(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+V(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=We(e);if(i===null)return V(n);e=i;let a=`<img src="${V(e)}" alt="${V(n)}"`;return t&&(a+=` title="${V(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:V(e.text)}},J=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Y=class e{options;renderer;textRenderer;constructor(e){this.options=e||a,this.options.renderer=this.options.renderer||new q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},X=class{options;block;constructor(e){this.options=e||a}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?K.lex:K.lexInline}provideParser(e=this.block){return e?Y.parse:Y.parseInline}};function Z(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var Q=new class{defaults=i();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=q;TextRenderer=J;Lexer=K;Tokenizer=G;Hooks=X;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(Z(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)Z(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)Z(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;Z(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);Z(n,this.walkTokens(i,t))}):e.tokens&&Z(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new q(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new G(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new X;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=X.passThroughHooks.has(n)?e=>{if(this.defaults.async&&X.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&Z(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return K.lex(e,t??this.defaults)}parser(e,t){return Y.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?K.lex:K.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?K.lex:K.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
65
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+V(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,o($.defaults),$},$.getDefaults=i,$.defaults=a;function Ze(...e){return Q.use(...e),$.defaults=Q.defaults,o($.defaults),$}$.use=Ze,$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=Y,$.parser=Y.parse,$.Renderer=q,$.TextRenderer=J,$.Lexer=K,$.lexer=K.lex,$.Tokenizer=G,$.Hooks=X,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,Y.parse,K.lex;var Qe=n(),$e=new Set([`script`,`style`,`iframe`,`frame`,`frameset`,`object`,`embed`,`link`,`meta`,`base`,`form`,`template`,`animate`,`set`,`animatemotion`,`animatetransform`,`discard`,`animatecolor`,`xmp`,`noembed`,`noframes`,`noscript`,`plaintext`]),et=new Set([`href`,`src`,`xlink:href`,`action`,`formaction`,`poster`,`background`]),tt=new Set([`http`,`https`,`mailto`]);function nt(e){let t=/^([a-z][a-z0-9+.-]*):/.exec(e.replace(/[\u0000- ]/g,``).toLowerCase());return!t||tt.has(t[1])}function rt(e){for(let t=0;t<4;t++){let t=it(e);if(t===e)return t;e=t}return``}function it(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.querySelectorAll(`*`).forEach(e=>{if($e.has(e.localName.toLowerCase()))return e.remove();for(let{name:t,value:n}of[...e.attributes]){let r=t.toLowerCase();(r.startsWith(`on`)||r===`srcdoc`||r===`style`||et.has(r)&&!nt(n))&&e.removeAttribute(t)}}),t.innerHTML}function at(e,t=[]){let n=new Map(t.map(e=>[e.label,e])),r=(e||``).replace(/\[\[([^\]]+)\]\]/g,(e,t)=>{let r=n.get(t.trim());return r?`[${r.label}](#/item/${r.type}/${encodeURIComponent(r.name)})`:e});return rt($.parse(r,{breaks:!1}))}var ot=[];function st({body:e,links:t=ot}){let n=(0,r.useMemo)(()=>at(e,t),[e,t]);return(0,Qe.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:n}})}export{$ as i,at as n,rt as r,st as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./FilterInput-CZREvrjX.js";var i=e(t(),1),a=n(),o={experimental:{label:`experimental`,cls:`warn`,hint:`Shipped, but not yet confirmed by real use.`},deprecated:{label:`deprecated`,cls:`bad`,hint:`On its way out — look for the replacement before building on it.`},personal:{label:`personal`,cls:``,hint:`Yours — present in this install, not shipped or versioned by Geneseed.`},unknown:{label:`no status`,cls:``,hint:`Not listed in registry.json.`}};function s({status:e,withHint:t=!1}){let n=o[e];if(!n)return null;let r=(0,a.jsxs)(`span`,{className:`badge ${n.cls}`,title:t?void 0:n.hint,children:[(0,a.jsx)(`span`,{className:`dot`}),n.label]});return t?(0,a.jsxs)(a.Fragment,{children:[r,(0,a.jsx)(`span`,{className:`dim`,children:n.hint})]}):r}var c=({name:e})=>(0,a.jsxs)(`span`,{className:`tag acc`,title:`Ships with the ${e} kit`,children:[`kit: `,e]});function l(e,t){let n=(t||``).trim().toLowerCase();return n?e.filter(e=>`${e.title||``} ${e.name||``} ${e.desc||``}`.toLowerCase().includes(n)):e}function u({label:e,count:t,extra:n,tools:o,q:s,onQ:c,matched:l,inView:u,children:d}){let f=h(u);(0,i.useLayoutEffect)(()=>m(f.current));let[g,_]=(0,i.useState)(``),v=(0,i.useRef)(!0);return(0,i.useEffect)(()=>{if(v.current){v.current=!1;return}_(f.current?.querySelector(`.lib-row.on`)?.dataset.title||``)},u),(0,a.jsxs)(`section`,{className:`lib-list`,"aria-label":e,onKeyDown:e=>{e.key===`ArrowDown`&&e.target.classList?.contains(`lib-filter`)&&(e.preventDefault(),f.current?.querySelector(`.lib-row`)?.focus())},children:[(0,a.jsxs)(`div`,{className:`lib-list-head`,children:[(0,a.jsxs)(`b`,{children:[e,` `,(0,a.jsx)(`span`,{className:`mono dim`,children:t})]}),n]}),(0,a.jsx)(r,{value:s,onChange:c,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),o?(0,a.jsx)(`div`,{className:`lib-tools`,children:o}):null,(0,a.jsxs)(`div`,{className:`lib-rows`,ref:f,onKeyDown:p,onFocus:e=>m(e.currentTarget),children:[d,s.trim()&&l===0&&(0,a.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,a.jsx)(`div`,{className:`big`,children:`No matches`}),`Nothing in `,e.toLowerCase(),` matches “`,s.trim(),`”.`]})]}),(0,a.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:g?`${g} opened`:``})]})}function d({item:e,isOpen:t,href:n,children:r}){return(0,a.jsxs)(`a`,{className:`lib-row${t?` on`:``}`,href:n,"aria-current":t?`true`:void 0,"data-title":e.title||e.name,children:[(0,a.jsxs)(`span`,{className:`lr-name`,children:[e.title||e.name,(0,a.jsx)(s,{status:e.status}),e.kit?(0,a.jsx)(c,{name:e.kit}):null,r]}),e.desc?(0,a.jsx)(`span`,{className:`lr-desc`,children:e.desc}):null,e.meta?(0,a.jsx)(`span`,{className:`lr-meta mono`,children:e.meta}):null]})}function f({rows:e,activeName:t,hrefOf:n,pills:r}){let i=null,o=[];for(let s of e)s.group&&s.group!==i&&(i=s.group,o.push((0,a.jsxs)(`div`,{className:`lib-group`,children:[s.groupC?(0,a.jsx)(`span`,{className:`cdot`,style:{"--cc":s.groupC},"aria-hidden":`true`}):null,s.group]},`g-${s.group}`))),o.push((0,a.jsx)(d,{item:s,isOpen:t===s.name,href:n(s),children:r?.(s)},s.name));return o}function p(e){let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);if(n===-1)return;let r={ArrowDown:Math.min(n+1,t.length-1),ArrowUp:Math.max(n-1,0),Home:0,End:t.length-1}[e.key];r!==void 0&&(e.preventDefault(),t[r].focus())}function m(e){if(!e)return;let t=[...e.querySelectorAll(`.lib-row`)],n=t.find(e=>e===document.activeElement)||e.querySelector(`.lib-row.on`)||t[0];for(let e of t)e.tabIndex=e===n?0:-1}function h(e){let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=t.current,n=e?.querySelector(`.lib-row.on`);if(!n||!e)return;let r=n.offsetTop;r>=e.scrollTop&&r+n.clientHeight<=e.scrollTop+e.clientHeight||(e.scrollTop=Math.max(0,r-e.clientHeight/2+n.clientHeight/2))},e),t}function g({label:e,total:t,cats:n,cat:r,onChange:i}){if(n.length<=1)return null;let o=[{key:`all`,label:`All`,n:t,c:`var(--text-3)`},...n];return(0,a.jsxs)(`div`,{className:`rail-cats`,children:[(0,a.jsx)(`ul`,{"aria-label":e,children:o.map(({key:e,label:t,n,c:o})=>(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,className:r===e?`on`:``,"aria-pressed":r===e,style:{"--cc":o},onClick:()=>i(e),children:[(0,a.jsx)(`span`,{className:`cdot`,"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:`rc-name`,children:t}),(0,a.jsx)(`span`,{className:`mono dim`,children:n})]})},e))}),(0,a.jsx)(`div`,{className:`rail-mix`,"aria-hidden":`true`,children:n.map(({key:e,n:t,c:n})=>(0,a.jsx)(`span`,{className:r===`all`||r===e?``:`dim`,style:{"--cc":n,flexGrow:t}},e))})]})}function _(e){let t=[],n=new Map;for(let r of e)n.has(r.group)||t.push(r.group),n.set(r.group,(n.get(r.group)||0)+1);return t.map(e=>({key:e,label:e,n:n.get(e),c:`var(--accent)`}))}export{u as a,c as i,_ as n,l as o,f as r,s,g as t};
|