geneseed 4.10.0 → 4.15.1
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 +106 -0
- package/README.md +5 -4
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-guard.js +16 -1
- package/adapters/opencode/plugins/geneseed-learn.js +28 -12
- package/adapters/opencode/plugins/geneseed-workflow.js +19 -2
- package/docs/concepts/kits.md +14 -2
- package/docs/concepts/skills.md +1 -1
- package/docs/extending.md +3 -4
- package/docs/guides/install-bob.md +3 -1
- package/docs/guides/run-anywhere.md +2 -2
- package/docs/guides/upgrade.md +2 -2
- package/docs/reference/troubleshoot-install.md +1 -1
- package/docs/web-ui.md +6 -1
- package/harness.config.json +1 -1
- package/js/build/emit-claude.mjs +4 -2
- package/js/build/stubs.mjs +13 -0
- package/js/hosts/link.mjs +88 -1
- package/js/inspect/checks-build.mjs +8 -2
- package/js/inspect/cost.mjs +1 -1
- package/js/inspect/diff.mjs +53 -7
- package/js/inspect/inventory.mjs +1 -0
- package/js/lib/prompt.mjs +19 -2
- package/js/maintain/setup.mjs +92 -28
- package/js/maintain/update.mjs +2 -2
- package/js/web/actions.mjs +8 -0
- package/js/web/api.mjs +39 -17
- package/js/web/catalog.mjs +17 -2
- package/js/web/handler.mjs +1 -0
- package/js/web/server.mjs +11 -5
- package/js/web/state.mjs +38 -3
- package/package.json +1 -1
- package/registry.json +28 -0
- package/src/AGENT.md.tmpl +5 -5
- package/src/agents/_self-improvement.md +11 -0
- package/src/agents/_template.md +1 -8
- package/src/agents/advocate.md +1 -8
- package/src/agents/architect.md +1 -8
- package/src/agents/developer.md +1 -8
- package/src/agents/devops-engineer.md +1 -9
- package/src/agents/docker-expert.md +1 -9
- package/src/agents/docs.md +1 -8
- package/src/agents/empiricist.md +1 -8
- package/src/agents/explorer.md +1 -8
- package/src/agents/framer.md +1 -8
- package/src/agents/historian.md +1 -8
- package/src/agents/kubernetes-specialist.md +1 -9
- package/src/agents/memory-curator.md +1 -8
- package/src/agents/operator.md +1 -8
- package/src/agents/performance.md +1 -8
- package/src/agents/pragmatist.md +1 -8
- package/src/agents/react-engineer.md +38 -0
- package/src/agents/react-reviewer.md +42 -0
- package/src/agents/researcher.md +5 -10
- package/src/agents/reviewer.md +1 -8
- package/src/agents/security.md +1 -8
- package/src/agents/skeptic.md +1 -8
- package/src/agents/spring-boot-engineer.md +1 -9
- package/src/agents/spring-reviewer.md +1 -9
- package/src/agents/spring-security.md +1 -9
- package/src/agents/steward.md +1 -8
- package/src/agents/tester.md +1 -8
- package/src/agents/user-advocate.md +1 -8
- package/src/agents/visionary.md +1 -8
- package/src/doctrines/comms.md +21 -0
- package/src/kits/react/rules.md +13 -0
- package/src/kits/react.json +18 -0
- package/src/licenses/everything-claude-code.txt +21 -0
- package/src/skills/_self-improvement.md +22 -5
- package/src/skills/brainstorm.md +7 -2
- package/src/skills/codebase-design.md +6 -2
- package/src/skills/debug.md +1 -1
- package/src/skills/develop.md +4 -2
- package/src/skills/handoff.md +1 -1
- package/src/skills/parallel-agents.md +3 -1
- package/src/skills/plan.md +5 -2
- package/src/skills/prototype.md +4 -2
- package/src/skills/react/a11y.md +33 -0
- package/src/skills/react/vite.md +35 -0
- package/src/skills/react/webpack.md +40 -0
- package/src/skills/react-testing.md +68 -0
- package/src/skills/react.md +63 -0
- package/src/skills/research.md +4 -2
- package/src/skills/rule.md +4 -2
- package/src/skills/ship.md +6 -4
- package/src/skills/skill-forge.md +10 -5
- package/src/skills/wayfinder.md +6 -2
- package/src/skills/wiki.md +18 -5
- package/src/upstreams.json +7 -0
- package/themes/_TEMPLATE.json +5 -0
- package/themes/biker.json +5 -0
- package/themes/commentator.json +5 -0
- package/themes/cyberpunk.json +5 -0
- package/themes/gamer.json +5 -0
- package/themes/imperial.json +5 -0
- package/themes/joker.json +5 -0
- package/themes/marvin.json +5 -0
- package/themes/mean.json +5 -0
- package/themes/military.json +5 -0
- package/themes/neutral.json +5 -0
- package/themes/pirate.json +5 -0
- package/themes/sports.json +5 -0
- package/themes/verstappen.json +5 -0
- package/themes/wizard.json +5 -0
- package/web/dist/assets/Activity-M5qj6CxJ.js +1 -0
- package/web/dist/assets/ActivityDetail-DVCdNy73.js +1 -0
- package/web/dist/assets/Dashboard-B1rpgTz-.js +2 -0
- package/web/dist/assets/{Docs-DLVckkew.js → Docs-D-EixVuX.js} +3 -3
- package/web/dist/assets/FilterInput-CZREvrjX.js +1 -0
- package/web/dist/assets/GreenhouseView-BvA4t12P.js +2 -0
- package/web/dist/assets/Installs-DP4WjTpD.js +3 -0
- package/web/dist/assets/JournalView-hf2eO133.js +1 -0
- package/web/dist/assets/KitApply-aORiqjFC.js +1 -0
- package/web/dist/assets/Kits-DpIEozdv.js +1 -0
- package/web/dist/assets/{Laws-BkKnZOBI.js → Laws-cM_4CG9i.js} +2 -2
- package/web/dist/assets/Library-I1zEH3UW.js +1 -0
- package/web/dist/assets/Loops-CDa_mxP9.js +2 -0
- package/web/dist/assets/{Markdown-iHvBrpRN.js → Markdown-zaXXXHz9.js} +13 -13
- package/web/dist/assets/OperatorHudView-CMf1DQMB.js +2 -0
- package/web/dist/assets/Personal-BqU9Pzt1.js +1 -0
- package/web/dist/assets/Tabs-JZ2FQBcz.js +1 -0
- package/web/dist/assets/activity-Jw8XcPiP.js +1 -0
- package/web/dist/assets/{drawable-CgYi0Dtg.js → drawable-svc6-2Gp.js} +1 -1
- package/web/dist/assets/index-CZFrNe4N.js +2 -0
- package/web/dist/assets/{index-BCJz4_8C.css → index-jYlWihN-.css} +1 -1
- package/web/dist/assets/{react-BOF6yL40.js → react-DlYQp10C.js} +1 -1
- package/web/dist/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/web/dist/assets/sections-ChwaobfW.js +1 -0
- package/web/dist/assets/usePoll-bDFN-Hr6.js +1 -0
- package/web/dist/index.html +5 -4
- package/web/src/pages/Laws.jsx +5 -0
- package/web/dist/assets/Activity-BjyJaf8e.js +0 -1
- package/web/dist/assets/ActivityDetail-Bo9nRDNV.js +0 -1
- package/web/dist/assets/Dashboard-BQJGU7vE.js +0 -2
- package/web/dist/assets/FilterInput-zLFXoSt6.js +0 -1
- package/web/dist/assets/GreenhouseView--DML7CW3.js +0 -2
- package/web/dist/assets/Installs-CxCiln1F.js +0 -3
- package/web/dist/assets/JournalView-ymgZleHi.js +0 -1
- package/web/dist/assets/Library-C8ercIZv.js +0 -1
- package/web/dist/assets/Loops-C95zhbFl.js +0 -2
- package/web/dist/assets/OperatorHudView-B9qwc3w3.js +0 -2
- package/web/dist/assets/Personal-DyR72AF-.js +0 -1
- package/web/dist/assets/Tabs-ChCr_HqV.js +0 -1
- package/web/dist/assets/activity-DvPxoS4Y.js +0 -1
- package/web/dist/assets/index-B32EvfDT.js +0 -2
- package/web/dist/assets/sections-BET3c1WT.js +0 -1
- package/web/dist/assets/usePoll-NSTzLOF4.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{B as i,C as a,G as o,K as s,x as c}from"./index-CZFrNe4N.js";import{t as l}from"./usePoll-bDFN-Hr6.js";import{a as u,l as d,o as f,s as p,t as m,u as h}from"./Markdown-zaXXXHz9.js";var g=e(t(),1),_={x:260,y:190},v=110,y=28,b=14,x=44,S=e=>e*Math.PI/180,C=e=>Math.round(e*10)/10,w=(e,t=v,n=_)=>({x:C(n.x+t*Math.cos(S(e))),y:C(n.y+t*Math.sin(S(e)))}),T=e=>e/v*(180/Math.PI)+3,E=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,D=C(w(205).x-6),O=e=>e.length*6.4,k=e=>({x:e.x-O(e.name)/2,y:e.y-7,w:O(e.name),h:14}),A=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,j=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>A(k(n),k(e))));function M(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function N(e,t=[]){let n=e=>t.find(t=>t.name===e),r=e=>n(e)?.effect??null,i=e=>M(n(e)),a=e.loops||[],o=a.find(e=>e.iteration);if(!o||o.nodes.length>8)return P(e,r,i);let s=Math.max(...e.nodes.map(e=>a.filter(t=>t.nodes.includes(e)).length)),c=a.filter(e=>e!==o);if(s>3||c.some(e=>!e.nodes.every(e=>o.nodes.includes(e))))return P(e,r,i);let l=o.nodes[0],u=new Set(e.edges.filter(e=>e.to===l).map(e=>e.from)),d=new Map;for(let e of[...c].sort((e,t)=>e.nodes.length-t.nodes.length))for(let t of e.nodes.slice(1))t!==l&&!u.has(t)&&!d.has(t)&&d.set(t,e);let f=o.nodes.filter(e=>!d.has(e));if(f.length<2||c.some(e=>d.has(e.nodes[0])))return P(e,r,i);let p=360/f.length,m=f.map((e,t)=>({name:e,a:-90+t*p,r:y})),h=m.findIndex(e=>r(e.name)===`mutate`);h>=0&&m.splice(h,0,{name:`validate`,a:m[h].a-p/2,r:b,gate:!0});let g=m.map(e=>({name:e.name,...w(e.a),r:e.r,effect:e.gate?null:r(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:i(e.name)})),S=m.map((e,t)=>{let n=m[(t+1)%m.length],r=(t+1===m.length?n.a+360:n.a)-T(n.r)-2,i=e.a+T(e.r);return{d:E(v,w(i),w(r),+(r-i>180)),kind:`ring`}}),D=[],k=new Map;for(let e of c)k.set(e.nodes[0],[...k.get(e.nodes[0])||[],e]);for(let[e,t]of k){let n=m.find(t=>t.name===e),a=w(n.a),o=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let s=w(n.a+(o?t?18:-18:0),v+(o?54:44)),c=Math.atan2(s.y-a.y,s.x-a.x)*(180/Math.PI),l=e.nodes.filter(t=>d.get(t)===e),u=e=>l.map((t,n)=>({name:t,...w(c+(n-(l.length-1)/2)*e,x,s)})),f=105;for(;f<150&&j(u(f),g);)f+=5;u(f).forEach(({name:e,...t})=>{g.push({name:e,...t,r:y,effect:r(e),gate:!1,inner:!0,human:i(e)})});let p=c+180;S.push({d:E(x,w(p+42,x,s),w(p+138,x,s)),kind:`inner`}),S.push({d:E(x,w(p+222,x,s),w(p+318,x,s)),kind:`inner`});let m=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,h={lx:s.x,ly:s.y+x+20,anchor:`middle`};if(o){let e=s.x>=_.x,t=Math.max(x,...l.map(e=>{let t=g.find(t=>t.name===e);return Math.abs(t.x-s.x)+y}));h={lx:C(s.x+(e?t+8:-t-8)),ly:C(s.y+4),anchor:e?`start`:`end`}}D.push({loop:e.name,cx:s.x,cy:s.y,r:x,label:m,...h})})}let A=w(205).y,N=e.nodes.filter(e=>!o.nodes.includes(e)),F=N.map((e,t)=>({name:e,x:40,y:C(A-44*(N.length-1-t)),human:i(e)})),I=e.edges.find(e=>e.to===`$close`)?.from,L=g.find(e=>e.name===I),R=L?{from:I,x:L.x+200,y:L.y-30,d:`M${L.x+y},${L.y-6} C${L.x+90},${L.y-40} ${L.x+170},${L.y-40} ${L.x+200},${L.y-30}`}:null,z=Math.max(540,...g.map(e=>e.x+e.r+8),...D.map(e=>e.cx+e.r+8),...D.map(e=>e.anchor===`start`?e.lx+O(e.label)+8:e.lx+O(e.label)/2+8)),B=Math.max(300,...g.map(e=>e.y+e.r+12),...D.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(z),height:Math.ceil(B),center:{x:_.x,y:_.y,r:v},nodes:g,arcs:S,inner:D,entry:F,exit:R}}function P(e,t,n){let r=e.loops||[],i=e=>36+16*r.filter(t=>t!==e&&t.nodes.every(t=>e.nodes.includes(t))).length,a=Math.max(y,...r.map(i))+30,o=new Map(e.nodes.map((e,t)=>[e,60+t*100])),s=e.nodes.map(e=>({name:e,x:o.get(e),y:a,r:y,effect:t(e),gate:!1,inner:!1,human:n(e)})),c=e.nodes.slice(1).map((t,n)=>({d:`M${o.get(e.nodes[n])+y},${a} L${o.get(t)-y-4},${a}`,kind:`flow`})),l=r.map(e=>{let t=i(e),n=Math.min(...e.nodes.map(e=>o.get(e))),r=Math.max(...e.nodes.map(e=>o.get(e))),s={x:n-t,y:a-t,w:r-n+2*t,h:2*t};return c.push({d:`M${r},${s.y+s.h} L${n+4},${s.y+s.h}`,kind:`flow`}),{loop:e.name,label:`${e.name} · max ${e.max}`,box:s}});return{mode:`flow`,width:60+e.nodes.length*100,height:2*a,center:null,nodes:s,arcs:c,inner:l,entry:[],exit:null}}var F=n();function I({x:e,y:t,label:n}){return(0,F.jsxs)(`g`,{className:`lr-human`,children:[(0,F.jsx)(`title`,{children:n}),(0,F.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,F.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,F.jsx)(`path`,{d:`M${e-4.6},${t+5.6} a4.6,4.6 0 0 1 9.2,0 Z`,className:`lr-human-fig`})]})}function L({graph:e,bricks:t,onSelect:n,highlight:r}){let i=N(e,t),a=(e.loops||[]).find(e=>e.iteration),o=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n?.(e))};return(0,F.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,role:`img`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,F.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,F.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,F.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,F.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.mode===`flow`&&i.inner.map(e=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,F.jsx)(`text`,{x:e.box.x+10,y:e.box.y-6,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.arcs.map((e,t)=>(0,F.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${D},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,F.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,F.jsx)(I,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,F.jsxs)(`g`,{className:`lr-gate`,children:[(0,F.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,F.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,F.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,F.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,F.jsxs)(`g`,{className:`lr-node${e.inner?` inner`:``}${e.effect===`mutate`?` mutate`:``}${e.name===r?` current`:``}`,"aria-current":e.name===r?`step`:void 0,role:`button`,tabIndex:0,"aria-label":`${e.name} brick${e.human?`, ${e.human.toLowerCase()}`:``}`,onClick:o(e.name),onKeyDown:o(e.name),children:[(0,F.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,F.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,F.jsx)(I,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,F.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,F.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,F.jsxs)(`g`,{children:[(0,F.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,F.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var R=5e3,z=[`prudent`,`balanced`,`aggressive`],B={running:`acc`,awaiting:`warn`,unreadable:`bad`},V=e=>!!e.graph;function H(){let[e,t]=(0,g.useState)(null),[n,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(0);return l(e=>r.activeLoops().then(n=>e()&&(t(n),i(null)),t=>e()&&i(t.message)),R,[a]),{loops:e?.loops??null,error:n,onPreset:(e,t)=>r.setLoopPreset(e,t).then(()=>o(e=>e+1),e=>i(e.message))}}function ee({history:e}){return e.length?(0,F.jsx)(`div`,{className:`loop-history`,children:(0,F.jsxs)(`table`,{className:`tbl`,children:[(0,F.jsx)(`thead`,{children:(0,F.jsx)(`tr`,{children:[`iteration`,`intent`,`declared`,`actual`,`decision`,`tests`].map(e=>(0,F.jsx)(`th`,{children:e},e))})}),(0,F.jsx)(`tbody`,{children:e.map(e=>(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(`td`,{className:`num`,children:e.iteration}),(0,F.jsx)(`td`,{children:e.intent}),(0,F.jsx)(`td`,{className:`num`,children:e.declared}),(0,F.jsx)(`td`,{className:`num`,children:e.actual}),(0,F.jsx)(`td`,{children:e.decision}),(0,F.jsx)(`td`,{children:e.tests})]},e.iteration))})]})}):(0,F.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function te({loop:e,bricks:t,onPreset:n}){let r=V(e)?(e.graph.loops||[]).find(e=>e.iteration):null;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`reader-tags`,children:[(0,F.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,F.jsx)(`span`,{className:`tag${B[e.status]?` ${B[e.status]}`:``}`,children:e.status})]}),(0,F.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,F.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),V(e)?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,F.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,F.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,F.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,F.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,onChange:t=>n(e.root,t.target.value),children:z.map(e=>(0,F.jsx)(`option`,{children:e},e))})]}),(0,F.jsx)(`hr`,{className:`hr`}),(0,F.jsx)(`div`,{className:`loop-graph`,children:(0,F.jsx)(L,{graph:e.graph,bricks:t,highlight:e.node})}),(0,F.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,F.jsx)(ee,{history:e.history})]}):(0,F.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its LOOP.md cannot be read, so there is no state to show.`:`Its LOOP.md is gone: the loop closed and its state went with it.`})]})}var U=encodeURIComponent,W=o.loops.map(e=>[e,s[e]]),G={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},ne={project:`Project`,global:`Global`,shipped:`Shipped`},re={templates:`Categories`,bricks:`Origins`,active:`Statuses`},ie=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function K(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var q=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function J(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return q(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>G[e.graph.category]?e.graph.category:`other`,[...Object.entries(G),[`other`,`Other`]])}function Y(e,t){return q(e.map(e=>({...e,desc:e.description,override:K(t,e.name)})),e=>e.origin,Object.entries(ne))}function X(e){return q(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,ie)}var Z=(e,t)=>(0,F.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),Q={templates:e=>e.human?Z(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?Z(`warn`,`mutate`):null,M(e)?Z(`human`,`human gate`):null,e.override?Z(`acc`,e.override):null,e.available===!1?Z(`bad`,`unavailable`):null],active:e=>Z(B[e.status],e.status)};function ae({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,F.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,F.jsx)(`b`,{children:(0,F.jsx)(`a`,{href:`#/loops/bricks/${U(e)}`,children:e})}),Z(t.effect===`mutate`?`warn`:``,t.effect),(0,F.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,F.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),M(t)?Z(`human`,M(t).toLowerCase()):null,n?Z(`acc`,n):null]}):(0,F.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,F.jsx)(`b`,{children:e}),(0,F.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function oe({t:e,bricks:t,overridden:n}){let[r,i]=(0,g.useState)(null),a=new Map(t.map(e=>[e.name,e]));return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`reader-tags`,children:[(0,F.jsx)(`span`,{className:`tag acc`,children:`Template`}),G[e.graph.category]?Z(``,G[e.graph.category]):null,e.human?Z(`human`,`human gate`):null]}),(0,F.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,F.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,F.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,F.jsx)(`hr`,{className:`hr`}),(0,F.jsx)(`div`,{className:`loop-graph`,children:(0,F.jsx)(L,{graph:e.graph,bricks:t,onSelect:e=>{i(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:`smooth`,block:`nearest`})}})}),e.graph.rules?.length?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,F.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,F.jsx)(`li`,{children:e},e))})]}):null,(0,F.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,F.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,F.jsx)(ae,{name:e,brick:a.get(e),override:K(n,e),on:r===e},e))})]})}function $(e){return`---\n${[[`name`,e.name],[`description`,e.description],[`effect`,e.effect],[e.agent?`agent`:`skill`,e.agent||e.skill],[`gate`,e.gate],[`gateOn`,e.gateOn?.join(`, `)],[`outcomes`,e.outcomes.join(`, `)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
2
|
+
`)}\n---\n${e.body}`}function se({b:e}){let[t,n]=(0,g.useState)(!1),r=[[`effect`,Z(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,F.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>Z(``,e))],[`gate`,M(e)?Z(`human`,M(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,F.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`reader-tags`,children:[(0,F.jsx)(`span`,{className:`tag acc`,children:`Brick`}),Q.bricks(e)]}),(0,F.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,F.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,F.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,F.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,F.jsxs)(g.Fragment,{children:[(0,F.jsx)(`dt`,{children:e}),(0,F.jsx)(`dd`,{children:t})]},e))}),(0,F.jsx)(`hr`,{className:`hr`}),(0,F.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,F.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,F.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:$(e)}):(0,F.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,F.jsx)(m,{body:e.body})})]})}function ce({problems:e}){if(!e?.length)return null;let t=e.length;return(0,F.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,F.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,F.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,F.jsx)(`li`,{className:`mono`,children:e},e))})]})}var le={templates:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`big`,children:`No templates`}),`Add one under `,(0,F.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]}),bricks:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`big`,children:`No bricks`}),`Add one under `,(0,F.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]}),active:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`big`,children:`No loops yet`}),`Start one with `,(0,F.jsx)(`code`,{className:`mono`,children:`geneseed loop init`}),` in a worktree, or ask the agent to run a loop. It shows up here while it runs.`]})};function ue({tab:e=`templates`,item:t,dataRev:n}){let{data:o,error:s}=i(()=>r.loops(),[n],`loops`),l=H(),[m,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[b,x]=(0,g.useState)(e);e!==b&&(x(e),_(``),y(`all`));let S=o?.bricks||[],C=e===`active`?l.loops&&X(l.loops):o&&(e===`bricks`?Y(o.bricks,o.overridden):J(o.templates,o.bricks)),w=C||[],T=f(w),E=v===`all`?w:w.filter(e=>e.group===v),D=m.trim(),O=h(E,D),k=w.find(e=>e.name===t)||e===`active`&&w.find(V)||w[0]||null,A={templates:o?.templates.length,bricks:o?.bricks.length,active:l.loops?.length},j=(A.templates??0)+(A.bricks??0)+(A.active??0),M=e=>`${j?(e??0)/j*100:0}%`,N=W.find(([t])=>t===e)[1],P=e===`active`?l.error:s;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(c,{error:P,style:{margin:`0 0 12px`}}),(0,F.jsx)(ce,{problems:o?.problems}),(0,F.jsxs)(`div`,{className:`library`,children:[(0,F.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,F.jsxs)(`div`,{className:`lib-title`,children:[(0,F.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,F.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,F.jsxs)(`div`,{className:`stackbar thin`,"aria-hidden":`true`,children:[(0,F.jsx)(`span`,{className:`sb-invariants`,style:{width:M(A.templates)}}),(0,F.jsx)(`span`,{className:`sb-doctrines`,style:{width:M(A.bricks)}}),(0,F.jsx)(`span`,{className:`sb-rest`,style:{width:M(A.active)}})]}),(0,F.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:W.map(([t,n])=>(0,F.jsxs)(g.Fragment,{children:[(0,F.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,F.jsx)(`span`,{className:`mono dim`,children:A[t]??``})]}),e===t&&(0,F.jsx)(u,{label:re[t],total:w.length,cats:T,cat:v,onChange:y})]},t))})]}),(0,F.jsx)(d,{label:N,count:D?`${O.length} of ${E.length}`:C?E.length:``,q:m,onQ:_,matched:O.length,inView:[e,t],children:C?w.length===0?(0,F.jsx)(`div`,{className:`empty`,style:{padding:32},children:le[e]}):(0,F.jsx)(p,{rows:O,activeName:k?.name,hrefOf:t=>`#/loops/${e}/${U(t.name)}`,pills:Q[e]}):P?null:(0,F.jsx)(a,{})}),(0,F.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:k?e===`active`?(0,F.jsx)(te,{loop:k,bricks:S,onPreset:l.onPreset}):e===`bricks`?(0,F.jsx)(se,{b:k}):(0,F.jsx)(oe,{t:k,bricks:S,overridden:o.overridden},k.name):null})]})]})}export{X as activeRows,Y as brickRows,$ as brickSource,ue as default,J as templateRows};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{s as e}from"./sections-BET3c1WT.js";import{i as t,t as n}from"./react-BOF6yL40.js";import{t as r}from"./FilterInput-zLFXoSt6.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}){let t=o[e];return t?(0,a.jsxs)(`span`,{className:`badge ${t.cls}`,title:t.hint,children:[(0,a.jsx)(`span`,{className:`dot`}),t.label]}):null}function c(e,t){let n=(t||``).trim().toLowerCase();return n?e.filter(e=>`${e.title||``} ${e.name||``} ${e.desc||``}`.toLowerCase().includes(n)):e}function l({label:e,count:t,extra:n,q:i,onQ:o,matched:s,inView:c,children:l}){let u=p(c);return(0,a.jsxs)(`section`,{className:`lib-list`,"aria-label":e,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:i,onChange:o,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),(0,a.jsxs)(`div`,{className:`lib-rows`,ref:u,onKeyDown:f,children:[l,i.trim()&&s===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 “`,i.trim(),`”.`]})]})]})}function u({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,children:[(0,a.jsxs)(`span`,{className:`lr-name`,children:[e.title||e.name,(0,a.jsx)(s,{status:e.status}),r]}),e.desc?(0,a.jsx)(`span`,{className:`lr-desc`,children:e.desc}):null]})}function d({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)(u,{item:s,isOpen:t===s.name,href:n(s),children:r?.(s)},s.name));return o}function f(e){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);n!==-1&&(e.preventDefault(),t[e.key===`ArrowDown`?Math.min(n+1,t.length-1):Math.max(n-1,0)]?.focus())}function p(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 m({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 h(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)`}))}function g(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _=g();function v(e){_=e}var y={exec:()=>null};function b(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 x(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(S.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ee=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),S={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:b(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:b(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:b(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:b(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:b(e=>RegExp(`^ {0,${e}}(?:</?(?:${D})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:b(e=>RegExp(`^ {0,${e}}>`))},te=/^(?:[ \t]*(?:\n|$))+/,ne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ie=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,w=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ae=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=x(ae).replace(/bull/g,w).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(),se=x(ae).replace(/bull/g,w).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(),T=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ce=/^[^\n]+/,E=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,le=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,E).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ue=x(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,w).getRegex(),D=`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`,O=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,de=x(`^ {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`,O).replace(`tag`,D).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fe=e=>x(T).replace(`hr`,C).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`,D).getRegex(),pe=fe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),me=fe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),k={blockquote:x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,me).getRegex(),code:ne,def:le,fences:re,heading:ie,hr:C,html:de,lheading:oe,list:ue,newline:te,paragraph:pe,table:y,text:ce},he=x(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,C).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`,D).getRegex(),ge={...k,lheading:se,table:he,paragraph:x(T).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,he).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`,D).getRegex()},_e={...k,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,O).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:y,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(T).replace(`hr`,C).replace(`heading`,` *#{1,6} *[^
|
|
2
|
-
]`).replace(`lheading`,
|
|
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}){let t=o[e];return t?(0,a.jsxs)(`span`,{className:`badge ${t.cls}`,title:t.hint,children:[(0,a.jsx)(`span`,{className:`dot`}),t.label]}):null}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,q:i,onQ:o,matched:s,inView:c,children:l}){let u=m(c);return(0,a.jsxs)(`section`,{className:`lib-list`,"aria-label":e,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:i,onChange:o,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),(0,a.jsxs)(`div`,{className:`lib-rows`,ref:u,onKeyDown:p,children:[l,i.trim()&&s===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 “`,i.trim(),`”.`]})]})]})}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,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){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);n!==-1&&(e.preventDefault(),t[e.key===`ArrowDown`?Math.min(n+1,t.length-1):Math.max(n-1,0)]?.focus())}function m(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 h({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 g(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)`}))}function _(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var v=_();function ee(e){v=e}var y={exec:()=>null};function b(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 x(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(S.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var te=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),S={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:b(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:b(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:b(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:b(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:b(e=>RegExp(`^ {0,${e}}(?:</?(?:${D})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:b(e=>RegExp(`^ {0,${e}}>`))},ne=/^(?:[ \t]*(?:\n|$))+/,re=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ie=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ae=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,w=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,oe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,se=x(oe).replace(/bull/g,w).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(),ce=x(oe).replace(/bull/g,w).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(),T=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,le=/^[^\n]+/,E=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ue=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,E).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),de=x(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,w).getRegex(),D=`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`,O=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,fe=x(`^ {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`,O).replace(`tag`,D).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),k=e=>x(T).replace(`hr`,C).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`,D).getRegex(),pe=k(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),me=k(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),A={blockquote:x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,me).getRegex(),code:re,def:ue,fences:ie,heading:ae,hr:C,html:fe,lheading:se,list:de,newline:ne,paragraph:pe,table:y,text:le},j=x(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,C).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`,D).getRegex(),he={...A,lheading:ce,table:j,paragraph:x(T).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,j).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`,D).getRegex()},ge={...A,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,O).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:y,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(T).replace(`hr`,C).replace(`heading`,` *#{1,6} *[^
|
|
2
|
+
]`).replace(`lheading`,se).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},_e=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ve=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,M=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ye=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,N=/[\p{P}\p{S}]/u,P=/[\s\p{P}\p{S}]/u,F=/[^\s\p{P}\p{S}]/u,be=x(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,P).getRegex(),xe=/[\p{Pi}\p{Ps}"']/u,Se=/(?!~)[\p{P}\p{S}]/u,Ce=/(?!~)[\s\p{P}\p{S}]/u,we=/(?:[^\s\p{P}\p{S}]|~)/u,Te=x(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,te?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ee=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,De=x(Ee,`u`).replace(/punct/g,N).getRegex(),Oe=x(Ee,`u`).replace(/punct/g,Se).getRegex(),ke=x(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,xe).replace(/punct/g,N).getRegex(),Ae=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,je=x(Ae,`gu`).replace(/notPunctSpace/g,F).replace(/punctSpace/g,P).replace(/punct/g,N).getRegex(),Me=x(Ae,`gu`).replace(/notPunctSpace/g,we).replace(/punctSpace/g,Ce).replace(/punct/g,Se).getRegex(),Ne=x(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,F).replace(/punctSpace/g,P).replace(/punct/g,N).getRegex(),Pe=x(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,F).replace(/punctSpace/g,P).replace(/punct/g,N).getRegex(),Fe=x(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,F).replace(/punctSpace/g,P).replace(/punct/g,N).getRegex(),Ie=x(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,N).getRegex(),Le=x(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,F).replace(/punctSpace/g,P).replace(/punct/g,N).getRegex(),Re=x(/\\(punct)/,`gu`).replace(/punct/g,N).getRegex(),ze=x(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,N).getRegex(),Be=x(/^<(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(),Ve=x(O).replace(`(?:-->|$)`,`-->`).getRegex(),He=x(`^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`,Ve).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ue=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,I=x(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Ue).getRegex(),We=x(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,I).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ge=x(/^!?\[(label)\]\[(ref)\]/).replace(`label`,I).replace(`ref`,E).getRegex(),Ke=x(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,E).getRegex(),qe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Je=x(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Ue).getRegex(),Ye=x(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,x(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Je).replace(`ref`,qe).getRegex()).replace(`nolink`,x(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,qe).getRegex()).getRegex(),Xe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ze=x(/(?: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(),L={_backpedal:y,anyPunctuation:Re,anyPunctuationOutsideCode:ze,autolink:Be,blockSkip:Te,br:M,code:ve,del:y,delLDelim:y,delRDelim:y,emStrongLDelim:De,emStrongRDelimAst:je,emStrongRDelimUnd:Pe,escape:_e,link:We,nolink:Ke,punctuation:be,reflink:Ge,reflinkSearch:Ye,tag:He,text:ye,url:y},Qe={...L,emStrongLDelim:ke,emStrongRDelimAst:Ne,emStrongRDelimUnd:Fe,link:x(/^!?\[(label)\]\((.*?)\)/).replace(`label`,I).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,I).getRegex()},R={...L,emStrongRDelimAst:Me,emStrongLDelim:Oe,delLDelim:Ie,delRDelim:Le,url:x(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Ze).replace(`protocol`,Xe).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:x(/^(?:[^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`,Xe).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},$e={...R,br:x(M).replace(`{2,}`,`*`).getRegex(),text:x(R.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},z={normal:A,gfm:he,pedantic:ge},B={normal:L,gfm:R,breaks:$e,pedantic:Qe},et={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},tt=e=>et[e];function V(e,t){if(t){if(S.escapeTest.test(e))return e.replace(S.escapeReplace,tt)}else if(S.escapeTestNoEncode.test(e))return e.replace(S.escapeReplaceNoEncode,tt);return e}function nt(e){return S.numericCharacterReference.test(e)?e.replace(S.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 rt(e){try{e=encodeURI(e).replace(S.percentDecode,`%`)}catch{return null}return e}function it(e,t){let n=e.replace(S.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(S.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(S.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 at(e){let t=e.split(`
|
|
3
3
|
`),n=t.length-1;for(;n>=0&&S.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
|
|
4
|
+
`)}function U(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function ot(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 st(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 ct(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
5
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
|
|
6
|
+
`)}function lt(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||v}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]:at(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=ct(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
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
8
|
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=H(t[0],`
|
|
9
9
|
`).split(`
|
|
@@ -24,12 +24,12 @@ ${d.join(`
|
|
|
24
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
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
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=
|
|
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=
|
|
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=at(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])&&ot(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=it(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
29
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(
|
|
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(it(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
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&&
|
|
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&<(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=ot(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)),st(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&<(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 st(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]:nt(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||v,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:S,block:z.normal,inline:B.normal};this.options.pedantic?(t.block=z.pedantic,t.inline=B.pedantic):this.options.gfm&&(t.block=z.gfm,t.inline=this.options.breaks?B.breaks:B.gfm),this.tokenizer.rules=t}static get rules(){return{block:z,inline:B}}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(S.carriageReturn,`
|
|
33
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(S.tabCharGlobal,` `).replace(S.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
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
35
|
`)?``:`
|
|
@@ -43,9 +43,9 @@ ${d.join(`
|
|
|
43
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
44
|
`)?``:`
|
|
45
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||
|
|
47
|
-
`:``;return r?`<pre><code class="language-`+
|
|
48
|
-
`:`<pre><code>`+(n?i:
|
|
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||v}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(S.notSpaceStart)?.[0],i=e?e.replace(S.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
49
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
50
50
|
${this.parser.parse(e)}</blockquote>
|
|
51
51
|
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
@@ -61,5 +61,5 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
61
61
|
`}tablerow({text:e}){return`<tr>
|
|
62
62
|
${e}</tr>
|
|
63
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>${
|
|
65
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+
|
|
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=rt(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=rt(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||v,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||v}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=_();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,ee($.defaults),$},$.getDefaults=_,$.defaults=v;function ut(...e){return Q.use(...e),$.defaults=Q.defaults,ee($.defaults),$}$.use=ut,$.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 dt=`script,style,iframe,frame,frameset,object,embed,link,meta,base,form`,ft=new Set([`href`,`src`,`xlink:href`,`action`,`formaction`,`poster`,`background`]),pt=new Set([`http`,`https`,`mailto`]);function mt(e){let t=/^([a-z][a-z0-9+.-]*):/.exec(e.replace(/[\u0000- ]/g,``).toLowerCase());return!t||pt.has(t[1])}function ht(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.querySelectorAll(dt).forEach(e=>e.remove()),t.content.querySelectorAll(`*`).forEach(e=>{for(let{name:t,value:n}of[...e.attributes]){let r=t.toLowerCase();(r.startsWith(`on`)||r===`srcdoc`||ft.has(r)&&!mt(n))&&e.removeAttribute(t)}}),t.innerHTML}function gt(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 ht($.parse(r,{breaks:!1}))}var _t=[];function vt({body:e,links:t=_t}){let n=(0,i.useMemo)(()=>gt(e,t),[e,t]);return(0,a.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:n}})}export{h as a,c,s as d,$ as i,u as l,gt as n,g as o,ht as r,f as s,vt as t,l as u};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{n,r}from"./sections-ChwaobfW.js";import{F as i,N as a}from"./index-CZFrNe4N.js";import{t as o}from"./jobBuckets-Dbq8ZlWW.js";e();var s=t(),c=14,l=120;function u({title:e,right:t,children:n,span:r}){return(0,s.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,s.jsxs)(`div`,{className:`c-mod-head`,children:[(0,s.jsx)(`span`,{className:`c-tab`}),(0,s.jsx)(`h3`,{children:e}),t&&(0,s.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,s.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function d({label:e,value:t}){return(0,s.jsxs)(`div`,{className:`c-kpi`,children:[(0,s.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,s.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function f({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,s.jsx)(`div`,{className:`c-cols`,style:{height:t},children:e.map((e,i)=>{let a=Math.max(e.v/r*(t-6),2);return(0,s.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function p({checks:e}){return(0,s.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,s.jsx)(`span`,{className:`c-band-cell ${e.problems.length===0?`ok`:`bad`}`,title:`${e.label}: ${e.problems.length===0?`pass`:`${e.problems.length} problem(s)`}`},t))})}function m(e){let t={};for(let n of e||[]){let e=n.action||`unknown`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>({label:e,value:t})).sort((e,t)=>t.value-e.value)}function h({overview:e,jobs:t,doctor:h,onAction:g}){let _=e.counts||{},v=r.reduce((e,t)=>e+(_[t]||0),0),y=Math.max(...r.map(e=>_[e]||0),1),b=h?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=o(t||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(t),T=Math.max(...w.map(e=>e.value),1),E=i(e.diff),D=[[`status`,e.deployed?(0,s.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,s.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,s.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.theme})],[`mode`,e.emit],[`doctor`,b.length===0?(0,s.jsx)(`span`,{className:`c-pill`,children:`—`}):x===b.length?(0,s.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,s.jsxs)(`span`,{className:`c-pill warn`,children:[b.length-x,` ISSUES`]})],[`edits`,String(E)],[`built`,e.build_time||`—`],[`target`,(0,s.jsx)(`span`,{className:`c-dim mono`,children:e.target})]];return(0,s.jsxs)(`div`,{className:`c-root`,children:[(0,s.jsxs)(`div`,{className:`c-titlebar`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{className:`c-h1`,children:`HARNESS // STATUS READOUT`}),(0,s.jsxs)(`div`,{className:`c-sub`,children:[e.target,` · rendered from src/ · inherited everywhere`]})]}),(0,s.jsxs)(`div`,{className:`row gap-8`,children:[(0,s.jsxs)(`button`,{className:`btn`,onClick:()=>g(`update`),children:[(0,s.jsx)(a,{name:`refresh`}),`UPDATE`]}),(0,s.jsx)(`button`,{className:`btn ghost`,onClick:()=>g(`build-all`),children:`REBUILD`}),(0,s.jsx)(`button`,{className:`btn ghost`,onClick:()=>g(`doctor`),children:`DOCTOR`})]})]}),(0,s.jsx)(`div`,{className:`c-strip`,children:D.map(([e,t],n)=>(0,s.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,s.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,s.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,s.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,s.jsx)(d,{label:`AGENTS`,value:_.agents??`—`}),(0,s.jsx)(d,{label:`SKILLS`,value:_.skills??`—`}),(0,s.jsx)(d,{label:`DICTATES`,value:_.laws??`—`}),(0,s.jsx)(d,{label:`PACKS`,value:_.doctrines?`${_.doctrines.active}/${_.doctrines.total}`:`—`}),(0,s.jsx)(d,{label:`MEMORY`,value:_.memory??`—`}),(0,s.jsx)(d,{label:`NOTEBOOK`,value:_.notebook??`—`}),(0,s.jsx)(d,{label:`EDITS`,value:E})]}),(0,s.jsxs)(`div`,{className:`c-grid`,children:[(0,s.jsx)(u,{title:`CAPABILITY DISTRIBUTION`,right:`${v} ENTRIES`,span:2,children:(0,s.jsxs)(`table`,{className:`c-tbl`,children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{children:`SECTION`}),(0,s.jsx)(`th`,{children:`DETAIL`}),(0,s.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,s.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,s.jsx)(`tbody`,{children:r.map(e=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{className:`c-name`,children:n[e].label}),(0,s.jsx)(`td`,{className:`c-dim`,children:n[e].desc}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`div`,{className:`c-bar`,children:(0,s.jsx)(`i`,{style:{width:`${(_[e]||0)/y*100}%`,background:e===`agents`||e===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,s.jsx)(`td`,{className:(_[e]||0)>0?`num`:`num c-dim`,children:_[e]??0})]},e))})]})}),(0,s.jsx)(u,{title:`DOCTOR // CHECKS`,right:b.length?`${x}/${b.length}`:`—`,children:b.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{checks:b}),(0,s.jsx)(`div`,{className:`c-check-list`,children:b.map(e=>{let t=e.problems.length===0;return(0,s.jsxs)(`div`,{className:`c-check-row`,children:[(0,s.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,s.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,s.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,s.jsx)(`p`,{className:`c-dim mono`,style:{fontSize:11},children:`No doctor run loaded yet.`})}),(0,s.jsxs)(u,{title:`RUN RATE // 10D`,right:`${C} RUNS`,span:2,children:[(0,s.jsx)(f,{data:S,height:120,hi:S.length-1}),(0,s.jsx)(`div`,{className:`c-axis`,children:S.map((e,t)=>(0,s.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,s.jsx)(u,{title:`RUN LOG // BY TYPE`,right:`${(t||[]).length} LOGGED`,children:w.length>0?(0,s.jsx)(`table`,{className:`c-tbl`,children:(0,s.jsx)(`tbody`,{children:w.map(e=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`div`,{className:`c-bar`,children:(0,s.jsx)(`i`,{style:{width:`${e.value/T*100}%`,background:`var(--accent)`}})})}),(0,s.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,s.jsx)(`p`,{className:`c-dim mono`,style:{fontSize:11},children:`No runs logged.`})}),(0,s.jsx)(u,{title:`RECENT // RUN LOG`,span:3,children:(0,s.jsx)(`table`,{className:`c-tbl`,children:(0,s.jsxs)(`tbody`,{children:[(t||[]).slice(0,c).map(e=>{let t=e.status===`done`,n=e.status===`failed`?`bad`:t?`ok`:`acc`,r=e.output?e.output.split(`
|
|
2
|
+
`)[0].slice(0,l):`—`;return(0,s.jsxs)(`tr`,{children:[(0,s.jsxs)(`td`,{style:{width:96},children:[(0,s.jsx)(`span`,{className:`c-dotmark ${n}`}),` `,(0,s.jsx)(`span`,{className:`c-dim`,children:e.action})]}),(0,s.jsx)(`td`,{className:`c-name`,style:{fontWeight:400},children:r}),(0,s.jsx)(`td`,{className:`num c-dim`,children:e.duration?`${e.duration}s`:e.status})]},e.id)}),(!t||t.length===0)&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:`3`,className:`c-dim`,style:{fontSize:11},children:`No runs logged.`})})]})})})]})]})}export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{B as i,C as a,S as o,T as s,x as c,y as l}from"./index-CZFrNe4N.js";import{t as u}from"./Markdown-zaXXXHz9.js";import{t as d}from"./Tabs-JZ2FQBcz.js";import f from"./Library-I1zEH3UW.js";var p=e(t(),1),m=n(),h={title:``,body:``,scope:`project`,trial_until:``};function g({initial:e,onCancel:t,onSave:n,busy:r}){let[i,a]=(0,p.useState)(e),o=e=>t=>a({...i,[e]:t.target.value}),s=i.title.trim()&&i.body.trim();return(0,m.jsxs)(`div`,{className:`rule-form`,children:[(0,m.jsx)(`input`,{className:`lib-filter`,type:`text`,value:i.title,onChange:o(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,"aria-label":`Rule title`}),(0,m.jsx)(`textarea`,{className:`rule-body-input`,value:i.body,onChange:o(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-label":`Rule body`}),(0,m.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,m.jsxs)(`select`,{className:`sel`,value:i.scope,onChange:o(`scope`),"aria-label":`Rule scope`,children:[(0,m.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,m.jsx)(`option`,{value:`user`,children:`scope: user (personal)`})]}),(0,m.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,m.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:i.trial_until,onChange:o(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,m.jsxs)(`div`,{style:{marginLeft:`auto`,display:`flex`,gap:8},children:[(0,m.jsx)(`button`,{className:`btn sm`,disabled:!s||r,onClick:()=>n(i),children:r?`Saving…`:`Save rule`}),(0,m.jsx)(`button`,{className:`btn ghost sm`,disabled:r,onClick:t,children:`Cancel`})]})]})]})}function _({rule:e,isOpen:t,onToggle:n,onEdit:r,onDelete:i,onGraduate:a}){return(0,m.jsxs)(`div`,{className:`rule-row ${t?`on`:``}`,children:[(0,m.jsxs)(`button`,{className:`rule-head`,onClick:n,"aria-expanded":t,children:[(0,m.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,m.jsx)(`span`,{className:`rule-title`,children:e.title}),(0,m.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,m.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),t&&(0,m.jsxs)(`div`,{className:`rule-expand`,children:[(0,m.jsx)(`p`,{children:e.body}),e.source?(0,m.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,m.jsxs)(`div`,{className:`row`,style:{marginTop:10,gap:8},children:[e.status===`trial`&&(0,m.jsx)(`button`,{className:`btn sm`,onClick:a,title:`Adopt for good — drop the trial marker`,children:`Graduate`}),(0,m.jsx)(`button`,{className:`btn ghost sm`,onClick:r,children:`Edit`}),(0,m.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Retire`})]})]})]})}function v({onChanged:e}){let t=o(),[n,s]=(0,p.useState)(0),{data:l,error:u}=i(()=>r.rules(),[n]),[d,f]=(0,p.useState)(null),[v,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(!1),[S,C]=(0,p.useState)(``),w=()=>s(e=>e+1);if(u)return(0,m.jsx)(c,{error:u});if(!l)return(0,m.jsx)(a,{});let T=l.rules||[],{stats:E}=l,D=Math.round(Math.max(E.rules/E.max_rules,E.tokens/E.max_tokens)*100),O=D>=100?`over`:D>=70?`warn`:``,k=async t=>{x(!0),C(``);try{await r.rulesMutate({...t,fingerprint:l.fingerprint}),y(null)}catch(e){C(e.status===409?`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy; re-apply your edit.`:e.message)}finally{x(!1),w(),e?.()}},A=async e=>{await t(`Retire rule R${e.id} — “${e.title}”? It is removed from user-rules.md.`,{title:`Retire this rule?`,confirmLabel:`Retire`})&&k({op:`delete`,id:e.id})},j=e=>k({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,m.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,m.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,m.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),` beside the deployed AGENT.md. The agent obeys them with the same force as the Laws — they may tighten a Law, never repeal one — and no update ever touches the file. Keep the set small: every rule is loaded every session.`]})]}),l.exists&&v===null&&(0,m.jsx)(`button`,{className:`btn`,onClick:()=>y(`new`),children:`Add rule`})]}),l.exists&&(0,m.jsxs)(`div`,{className:`rules-meter ${O}`,children:[(0,m.jsx)(`div`,{className:`rules-meter-bar`,children:(0,m.jsx)(`div`,{className:`rules-meter-fill`,style:{width:`${Math.min(D,100)}%`}})}),(0,m.jsxs)(`span`,{className:`rules-meter-label`,children:[E.rules,`/`,E.max_rules,` rules · ~`,E.tokens,` tokens`,D>=100?` — over budget: a bloated rule set dilutes the rules that matter`:D>=70?` — getting heavy; consider merging or pruning`:``]})]}),S?(0,m.jsx)(`p`,{className:`sub rule-notice`,children:S}):null,(l.warnings||[]).map(e=>(0,m.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),v===`new`&&(0,m.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,m.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),(0,m.jsx)(g,{initial:h,busy:b,onCancel:()=>y(null),onSave:e=>k({op:`add`,...e})})]}),l.exists?T.length===0&&v!==`new`?(0,m.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,m.jsx)(`div`,{className:`big`,children:`No rules yet`}),`The file is seeded and loaded every session — it is just empty. Add your first standing rule here, ask the agent for one in-session (the rule skill), or promote a recurring memory fact from the Library.`]}):(0,m.jsx)(`div`,{className:`card rules-list`,children:T.map(e=>v===e.id?(0,m.jsx)(`div`,{className:`rule-row on`,children:(0,m.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,m.jsx)(g,{initial:{title:e.title,body:e.body,scope:e.scope,trial_until:e.trial_until},busy:b,onCancel:()=>y(null),onSave:t=>k({op:`update`,id:e.id,source:e.source,...t})})})},e.id):(0,m.jsx)(_,{rule:e,isOpen:d===e.id,onToggle:()=>f(d===e.id?null:e.id),onEdit:()=>{f(e.id),y(e.id)},onDelete:()=>A(e),onGraduate:()=>j(e)},e.id))}):(0,m.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,m.jsx)(`div`,{className:`big`,children:`No user-rules.md here yet`}),`The build seeds it beside AGENT.md — run a build/update from the Dashboard (or`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}function y({onChanged:e}){let{data:t,error:n,loading:o,reload:l}=i(()=>r.profile(),[]),[d,f]=(0,p.useState)(``),[h,g]=(0,p.useState)(``),[_,v]=(0,p.useState)(!1),[y,b]=(0,p.useState)(``),[x,S]=(0,p.useState)(null),[C,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(null);t&&t!==T&&(E(t),g(t.fingerprint||``),C?w(!1):f(t.text||``),S(e=>e||((t.text||``).trim()?`view`:`edit`)));let D=!!t&&d!==(t.text||``);return(0,p.useEffect)(()=>{if(!D)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[D]),o&&!t?(0,m.jsx)(a,{}):n?(0,m.jsx)(c,{error:n}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,m.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,m.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,m.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` `,`beside the deployed AGENT.md. Unlike `,(0,m.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`, it is identity, not rules — it colours how the agent works but never binds (precedence is Laws, then rules, then this). Seeded once, never overwritten by an update. Prefer not to write it by hand? Ask the agent to run the `,(0,m.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),(0,m.jsxs)(`div`,{className:`row`,style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,m.jsx)(s,{"aria-label":`Profile mode`,children:[[`view`,`View`],[`edit`,`Edit`]].map(([e,t])=>(0,m.jsx)(`button`,{className:x===e?`on`:``,onClick:()=>S(e),children:t},e))}),x===`edit`&&(0,m.jsx)(`button`,{className:`btn`,disabled:!D||_,onClick:async()=>{v(!0),b(``);try{let t=await r.profileSave({text:d,fingerprint:h});t.ok?(g(t.fingerprint||``),b(`Saved.`),S(`view`),l(),e?.()):(w(!0),b(`${t.detail||`PROFILE.md changed on disk since you opened it.`} Your edit is kept — Save again to replace the newer version with it.`),l())}catch(e){b(e.message)}finally{v(!1)}},children:_?`Saving…`:`Save`})]})]}),y?(0,m.jsx)(`p`,{className:`sub rule-notice`,children:y}):null,x===`edit`?(0,m.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:d,onChange:e=>f(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):d.trim()?(0,m.jsx)(`div`,{className:`card pad-lg`,children:(0,m.jsx)(u,{body:d})}):(0,m.jsx)(`div`,{className:`card pad-lg`,children:(0,m.jsxs)(`p`,{className:`sub`,style:{margin:0},children:[`No profile yet — switch to Edit to write one, or ask the agent to run the`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})})]})}var b=(e,t)=>`${t?Math.min(100,e/t*100):0}%`;function x({rules:e,profile:t,facts:n,notes:r}){let i=e?.exists?e.stats:null;if(!i)return null;let a=[{k:`Profile`,v:t?.seeded?`template`:t?.exists?`written`:`missing`,fill:t?.exists&&!t.seeded?1:0,warn:!!t?.seeded},{k:`Rules`,v:`${i.rules}/${i.max_rules}`,fill:i.rules/i.max_rules},{k:`Memory`,v:n==null?`n/a`:`${n} facts`,fill:+!!n},{k:`Notebook`,v:r==null?`n/a`:`${r} notes`,fill:+!!r}];return(0,m.jsxs)(`div`,{className:`card-row`,children:[(0,m.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,m.jsxs)(`div`,{className:`panel-head`,children:[(0,m.jsx)(`h2`,{id:`pc-budget`,children:`Token budget`}),(0,m.jsx)(`span`,{className:`mono dim`,children:`loaded every turn`})]}),(0,m.jsxs)(`p`,{className:`big-num`,children:[(0,m.jsx)(`span`,{className:`mono`,children:i.tokens}),` `,(0,m.jsxs)(`span`,{className:`dim`,children:[`/ `,i.max_tokens.toLocaleString(`en-US`),` tokens`]})]}),(0,m.jsx)(`span`,{className:`hbar${i.tokens>i.max_tokens?` bad`:``}`,"aria-hidden":`true`,children:(0,m.jsx)(`span`,{style:{width:b(i.tokens,i.max_tokens)}})}),(0,m.jsx)(`p`,{className:`panel-note`,children:i.rules?`${i.rules} rules in ${i.lines} lines.`:`All of it is the file’s preamble; no rule text yet.`})]}),(0,m.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-slots`,children:[(0,m.jsxs)(`div`,{className:`panel-head`,children:[(0,m.jsx)(`h2`,{id:`pc-slots`,children:`Rule slots`}),(0,m.jsxs)(`span`,{className:`mono dim`,children:[i.rules,` of `,i.max_rules]})]}),(0,m.jsx)(`div`,{className:`slots`,style:{"--slots":i.max_rules},role:`img`,"aria-label":`${i.rules} of ${i.max_rules} rule slots used`,children:Array.from({length:i.max_rules},(e,t)=>(0,m.jsx)(`span`,{className:t<i.rules?`used`:``},t))}),(0,m.jsx)(`p`,{className:`panel-note`,children:`Trial rules graduate once they have held.`})]}),(0,m.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,m.jsx)(`div`,{className:`panel-head`,children:(0,m.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,m.jsx)(`ul`,{className:`hbars`,children:a.map(e=>(0,m.jsxs)(`li`,{children:[(0,m.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,m.jsx)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:(0,m.jsx)(`span`,{className:`hb-ok`,style:{width:b(e.fill,1)}})}),(0,m.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))})]})]})}function S({tab:e=`rules`,item:t,setup:n,dataRev:a}){let o=e=>Promise.resolve(e).catch(()=>null),{data:s,reload:c}=l(a),{data:u,reload:p}=i(()=>o(r.profile()),[a]),{data:h}=i(()=>o(r.catalog(`notebook`)),[a],`catalog`),g=h?(h.items||[]).filter(e=>e.name!==`NOTEBOOK`&&e.name!==`README`).length:null,_=n?.facts??null,b={rules:s?.stats?.rules,profile:u?.seeded?`●`:null,memory:_,notebook:g};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`page-head`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`h`,children:`Personal`}),(0,m.jsx)(`p`,{className:`sub`,children:`The only files you write. They survive updates, reinstalls and voice changes.`})]})}),(0,m.jsx)(d,{page:`personal`,current:e,badges:b,label:`Personal files`}),e===`rules`&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(x,{rules:s,profile:u,facts:_,notes:g}),(0,m.jsx)(v,{onChanged:c})]}),e===`profile`&&(0,m.jsx)(y,{onChanged:p}),(e===`memory`||e===`notebook`)&&(0,m.jsx)(f,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:a,onRulesChanged:c},e)]})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{G as n,K as r}from"./index-CZFrNe4N.js";e();var i=t();function a({page:e,current:t,badges:a={},label:o}){return(0,i.jsx)(`nav`,{className:`tabs`,"aria-label":o,children:n[e].map(n=>(0,i.jsxs)(`a`,{href:`#/${e}/${n}`,className:t===n?`on`:``,"aria-current":t===n?`page`:void 0,children:[r[n],a[n]==null?null:(0,i.jsx)(`span`,{className:`tab-badge`,children:a[n]})]},n))})}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
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),i=n(),a={busy:{cls:`acc`,label:`working`,accent:`var(--accent)`},"waiting-input":{cls:`warn`,label:`your move`,accent:`var(--warn)`},blocked:{cls:`bad`,label:`blocked`,accent:`var(--bad)`},idle:{cls:``,label:`idle`,accent:`var(--line)`}},o={overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`};function s(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var c=e=>e?e<1e3?String(e):e<1e5?(e/1e3).toFixed(1)+`k`:e<1e6?(e/1e3).toFixed(0)+`k`:(e/1e6).toFixed(1)+`M`:`0`;function l(e){if(e=Math.max(0,Math.floor(e)),e<60)return`${e}s`;let t=Math.floor(e/60);return t<60?`${t}m ${e%60}s`:`${Math.floor(t/60)}h ${t%60}m`}function u({startedAt:e}){let[t,n]=(0,r.useState)(()=>Date.now()/1e3);return(0,r.useEffect)(()=>{let e=setInterval(()=>n(Date.now()/1e3),1e3);return()=>clearInterval(e)},[]),l(t-e)}function d({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,i.jsxs)(`span`,{style:{letterSpacing:2},children:[(0,i.jsx)(`span`,{style:{color:`var(--accent)`},children:`●`.repeat(r)}),(0,i.jsx)(`span`,{style:{color:`var(--text-3)`},children:`○`.repeat(n-r)})]})}export{s as a,d as i,u as n,c as o,a as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ct as e,Et as t,at as n,mt as r,xt as i}from"./index-
|
|
1
|
+
import{Ct as e,Et as t,at as n,mt as r,xt as i}from"./index-CZFrNe4N.js";var a=e=>{let t=1;if(e&&e.getCTM){let n=e.getCTM();n&&(t=(i(n.a*n.a+n.b*n.b)+i(n.c*n.c+n.d*n.d))/2)}return t},o=(n,i,o)=>{let s=e,c=getComputedStyle(n),l=c.strokeLinecap,u=c.vectorEffect===`non-scaling-stroke`?n:null,d=l,f=new Proxy(n,{get(e,n){let i=e[n];return n===t?e:n===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),r=+n[0],i=+n[1],o=a(u),c=r*-s*o,f=i*s*o+c,p=s*o+(r===0&&i===1||r===1&&i===0?0:10*o)-f;if(l!==`butt`){let t=r===i?`butt`:l;d!==t&&(e.style.strokeLinecap=`${t}`,d=t)}e.setAttribute(`stroke-dashoffset`,`${c}`),e.setAttribute(`stroke-dasharray`,`${f} ${p}`)}return Reflect.apply(i,e,t)}:r(i)?(...t)=>Reflect.apply(i,e,t):i}});return n.getAttribute(`pathLength`)!==`${s}`&&(n.setAttribute(`pathLength`,`${s}`),f.setAttribute(`draw`,`${i} ${o}`)),f},s=(e,t=0,r=0)=>n(e).map(e=>o(e,t,r));export{s as t};
|