geneseed 4.7.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +1 -1
- package/SHIPPED.md +1 -1
- package/adapters/claude-code/README.md +3 -1
- package/adapters/opencode/HOW-OPENCODE-LOADS.md +1 -1
- package/adapters/opencode/README.md +5 -4
- package/adapters/opencode/plugins/geneseed-guard.js +565 -36
- package/bin/geneseed-hook.mjs +9 -3
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/exclusions.md +20 -1
- package/docs/concepts/hooks.md +11 -3
- package/docs/concepts/host-matrix.md +3 -3
- package/docs/reference/plugin-guard.md +3 -3
- package/docs/reference/troubleshoot-doctor.md +4 -2
- package/docs/understand/a-day.md +6 -6
- package/docs/understand/design-choices-gates.md +2 -2
- package/docs/understand/enforced-vs-asked.md +4 -4
- package/docs/understand/harness.md +1 -1
- package/docs/understand/machine-claude.md +1 -1
- package/docs/understand/machine-opencode.md +2 -2
- package/docs/web-ui.md +3 -1
- package/harness.config.json +1 -1
- package/js/README.md +2 -1
- package/js/build/args.mjs +4 -1
- package/js/build/driver.mjs +11 -7
- package/js/build/emit-claude.mjs +4 -3
- package/js/build/emit-opencode.mjs +2 -1
- package/js/build/generate.mjs +13 -4
- package/js/build/render.mjs +4 -0
- package/js/build/source.mjs +4 -1
- package/js/cli-table.json +45 -0
- package/js/hosts/gitref.mjs +47 -1
- package/js/hosts/hooks.mjs +19 -42
- package/js/hosts/installs.mjs +20 -0
- package/js/hosts/loss.mjs +522 -0
- package/js/hosts/settings.mjs +78 -77
- package/js/inspect/checks-probe.mjs +18 -6
- package/js/inspect/diff.mjs +4 -1
- package/js/inspect/status.mjs +3 -1
- package/js/inspect/validate.mjs +6 -4
- package/js/maintain/uninstall.mjs +5 -2
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +20 -3
- package/js/web/api.mjs +4 -2
- package/package.json +1 -1
- package/src/AGENT.md.tmpl +1 -1
- package/src/laws/universal.md +17 -17
- package/src/skills/worktree.md +1 -1
- package/web/dist/assets/{Activity-Dj0izJwj.js → Activity-B-XbKlzu.js} +1 -1
- package/web/dist/assets/{ActivityDetail-wjq5W02K.js → ActivityDetail-8oq0fycD.js} +1 -1
- package/web/dist/assets/{Dashboard-UMbgHbzF.js → Dashboard-C4EMz5mf.js} +2 -2
- package/web/dist/assets/{Docs-D3ABE_ds.js → Docs-mq4XDQK_.js} +1 -1
- package/web/dist/assets/FilterInput-Ikvi-pS9.js +1 -0
- package/web/dist/assets/{GreenhouseView-C238LWBD.js → GreenhouseView-D1WOtq3n.js} +1 -1
- package/web/dist/assets/{Installs-XSm0a_zQ.js → Installs-DrqPaLDM.js} +1 -1
- package/web/dist/assets/{JournalView-BUj4Ff-6.js → JournalView-BYpASU-L.js} +1 -1
- package/web/dist/assets/Laws-A3PFwiPD.js +3 -0
- package/web/dist/assets/{Library-CkaPVUYU.js → Library-BCaqPf61.js} +1 -1
- package/web/dist/assets/{Loops-CexwOARr.js → Loops-Bx3HnlUA.js} +1 -1
- package/web/dist/assets/{Markdown-DrXLM6TA.js → Markdown-BK38dn4x.js} +1 -1
- package/web/dist/assets/{OperatorHudView-D5qTQat0.js → OperatorHudView-ChQPM8JE.js} +1 -1
- package/web/dist/assets/{Personal-B_Vx9a7a.js → Personal-DELm61DF.js} +1 -1
- package/web/dist/assets/{Tabs-YZbGqWPW.js → Tabs-DcMq5IvC.js} +1 -1
- package/web/dist/assets/{activity-dcg5vF9j.js → activity-D4w9t8fE.js} +1 -1
- package/web/dist/assets/{drawable-BoQnwVpr.js → drawable-BI2_tF3o.js} +1 -1
- package/web/dist/assets/{index-BoG1M8Xy.css → index-CHpydQJg.css} +1 -1
- package/web/dist/assets/{index-BmbWeoTM.js → index-r2jRgf6l.js} +2 -2
- package/web/dist/assets/{react-DRhoX0kS.js → react-Ci4wQD4a.js} +2 -2
- package/web/dist/assets/{usePoll-BmR631BB.js → usePoll-BcywUo55.js} +1 -1
- package/web/dist/index.html +3 -3
- package/web/src/pages/Laws.jsx +53 -5
- package/web/dist/assets/FilterInput-BSfpStOZ.js +0 -1
- package/web/dist/assets/Laws-yGBJFKgY.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,s as t,t as n}from"./sections-GalMS0Zv.js";import{i as r,t as i}from"./react-DRhoX0kS.js";import{t as a}from"./api-Bp5eW_6m.js";import{I as o,U as s,_ as c,k as l,m as u,p as d,v as ee}from"./index-BmbWeoTM.js";import{a as te,c as ne,l as re,s as f,t as p,u as ie}from"./Markdown-DrXLM6TA.js";var m=t(r(),1),h=i();function g({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,h.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function _({entries:e}){return e.length?(0,h.jsx)(`table`,{className:`mf-entries`,children:(0,h.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,h.jsx)(`td`,{className:`mf-load-cell`,children:(0,h.jsx)(g,{load:e.load})}),(0,h.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})}):null}function v({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,h.jsxs)(`div`,{className:`mf-vault`,children:[(0,h.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,h.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,h.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,h.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,h.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,h.jsxs)(`span`,{className:`mf-role`,children:[(0,h.jsx)(l,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,h.jsxs)(`span`,{className:`mf-role`,children:[(0,h.jsx)(l,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,h.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,h.jsx)(l,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,h.jsx)(_,{entries:t})]})}function y({body:e}){let[t,n]=(0,m.useState)(!1);return e?(0,h.jsxs)(`div`,{className:`mf-raw`,children:[(0,h.jsxs)(`button`,{className:`mf-raw-toggle`,onClick:()=>n(e=>!e),children:[(0,h.jsx)(l,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,h.jsx)(`pre`,{className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function ae({manifest:e,body:t,name:n}){if(!e)return(0,h.jsx)(`pre`,{className:`mf-raw-pre`,children:(t||``).replace(/^```json\n|\n```$/g,``)});if(e.kind===`wiki`){let n=e.wikis||[];return n.length?(0,h.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,h.jsx)(v,{wiki:e},e.name||t)),(0,h.jsx)(y,{body:t})]}):(0,h.jsxs)(`div`,{className:`mf-empty`,children:[(0,h.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,h.jsxs)(`p`,{children:[`A wiki is your machine-wide knowledge base — an Obsidian vault or any folder of linked markdown the agent reads from and writes back to. Declare one in`,` `,(0,h.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,h.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,h.jsx)(y,{body:t})]})}let r=e.context||[];return r.length?(0,h.jsxs)(`div`,{className:`mf-doc`,children:[(0,h.jsx)(_,{entries:r}),(0,h.jsx)(y,{body:t})]}):(0,h.jsxs)(`div`,{className:`mf-empty`,children:[(0,h.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,h.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,h.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,h.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,h.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,h.jsx)(y,{body:t})]})}var b={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},x={advocate:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,h.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,h.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,h.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,h.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,h.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,h.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,h.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,h.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,h.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,h.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),docs:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,h.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,h.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,h.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,h.jsx)(`g`,{className:`ag-write`,children:(0,h.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,h.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,h.jsxs)(`g`,{className:`ag-search`,children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,h.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,h.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`g`,{className:`ag-frame`,children:(0,h.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,h.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,h.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,h.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,h.jsxs)(`g`,{className:`ag-turn`,children:[(0,h.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,h.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,h.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,h.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,h.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,h.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,h.jsx)(`g`,{className:`ag-gauge`,children:(0,h.jsx)(`path`,{d:`M32 42l10-13`})}),(0,h.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,h.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,h.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,h.jsxs)(`g`,{className:`ag-tilt`,children:[(0,h.jsx)(`path`,{d:`M14 18h36`}),(0,h.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"memory-curator":(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,h.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,h.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,h.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,h.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,h.jsx)(`g`,{className:`ag-orbit`,children:(0,h.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,h.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,h.jsxs)(`g`,{className:`ag-sweep`,children:[(0,h.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,h.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,h.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,h.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,h.jsx)(`g`,{className:`ag-orbit`,children:(0,h.jsx)(`path`,{d:`M30 34V22`})}),(0,h.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,h.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,h.jsxs)(`g`,{className:`ag-lean`,children:[(0,h.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,h.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),steward:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,h.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,h.jsxs)(`g`,{className:`ag-grow`,children:[(0,h.jsx)(`path`,{d:`M32 50V26`}),(0,h.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,h.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,h.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,h.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,h.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,h.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,h.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,h.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,h.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,h.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,h.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,h.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},S=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,h.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function oe({name:e,size:t=64}){return(0,h.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...b,children:[(0,h.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,h.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),x[e]||S]})}function C(e,t){return e===`memory`?`memory/${t}`:e===`notebook`?`notebook/${t}`:e===`wiki`?`geneseed-wiki.jsonc`:e===`config`?t:`${e}/${t}.md`}function se({section:t,source:n}){return(0,h.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,h.jsx)(l,{name:e[t].icon,className:`glyph`}),(0,h.jsxs)(`span`,{children:[`This entry is part of the `,e[t].label.toLowerCase(),` convention; see`,` `,(0,h.jsx)(`code`,{className:`mono`,children:n}),`. It has no standalone per-entry document.`]})]})}var w=(e,t)=>t||(e&&n.includes(e)?e:n[0]),T=encodeURIComponent;function E(e){let t=e=>d[e.klass]?e.klass:`personal`,n=u.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:d[n].label,groupC:d[n].c})));return{rows:n,cats:u.map(e=>({key:e,label:d[e].label,c:d[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function D({overview:t,section:r,selected:i,dataRev:l,lock:u,base:g}){let _=ee(),[v,y]=(0,m.useState)(()=>w(r,u)),[b,x]=(0,m.useState)(``),[S,D]=(0,m.useState)(`all`),[O,k]=(0,m.useState)(``),[A,ce]=(0,m.useState)(r);if(r!==A){ce(r);let e=w(r,u);e!==v&&(y(e),x(``),D(`all`))}let{data:j,error:M,reload:N}=o(()=>a.catalog(v),[v,l],`catalog`),P=j?.section===v&&j?.items||[],F=v===`skills`,I=F?E(P):null,L=i||(F?I.rows[0]:P[0])?.name||null,R=L?P.find(e=>e.name===L):null,z=R?.type||e[v].type,{data:B,error:V}=o(()=>L?a.item(z,L):Promise.resolve(null),[v,L,z,l]),H=O||M||V,U=L?{name:L,title:B?.title||L,desc:B?.desc||``}:null,W=R||U,G=t?.counts||{},K=F?I.rows.filter(e=>S===`all`||e.cat===S):P,q=F?1/0:50,J=b.trim().toLowerCase(),Y=J?re(K,J):K.slice(0,q),le=!J&&S===`all`&&L&&!Y.some(e=>e.name===L)?[...Y,...P.filter(e=>e.name===L)]:Y,ue=t=>g?`${g}/${T(t.name)}`:`#/item/${t.type||e[v].type}/${T(t.name)}`,de=async()=>{let e=W?.name;if(e&&await _(`Forget the memory fact "${e}"? It leaves the index and moves to memory/archive/ (geneseed memory rm --archived --purge deletes it for good).`,{title:`Forget this fact?`,confirmLabel:`Forget`})){k(``);try{await a.memoryDelete(e)}catch(t){k(`Could not forget "${e}": ${t.message}`);return}s(g||`#/section/memory`),N()}},fe=async()=>{let e=W?.name;if(e&&await _(`Promote "${e}" into a standing rule? It is appended to user-rules.md as a trial rule (a month of probation), and the memory fact moves to memory/archive/ so the lesson isn't loaded twice.`,{title:`Promote to a rule?`,confirmLabel:`Promote`})){k(``);try{let t=await a.rules();await a.rulesPromote({name:e,fingerprint:t.fingerprint,delete_memory:!0}),s(`#/personal/rules`)}catch(e){k(`Could not promote: ${e.message}`),N()}}},X=n.reduce((e,t)=>e+(G[t]??0),0),pe=X-(G.skills??0)-(G.agents??0),Z=e=>`${X?e/X*100:0}%`,me=B?.status||W?.status,Q=v===`skills`?d[R?.klass]:null,$=e[v].label;return(0,h.jsxs)(h.Fragment,{children:[H?(0,h.jsx)(c,{error:H,style:{margin:`0 0 12px`}}):null,(0,h.jsxs)(`div`,{className:`library${u?` locked`:``}`,children:[u?null:(0,h.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,h.jsxs)(`div`,{className:`lib-title`,children:[(0,h.jsx)(`h1`,{className:`h`,children:`Library`}),(0,h.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,h.jsxs)(`div`,{className:`stackbar thin`,"aria-hidden":`true`,children:[(0,h.jsx)(`span`,{className:`sb-invariants`,style:{width:Z(G.skills??0)}}),(0,h.jsx)(`span`,{className:`sb-doctrines`,style:{width:Z(G.agents??0)}}),(0,h.jsx)(`span`,{className:`sb-rest`,style:{width:Z(pe)}})]}),(0,h.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:n.map(t=>(0,h.jsxs)(m.Fragment,{children:[(0,h.jsxs)(`a`,{href:`#/section/${t}`,className:v===t?`on`:``,"aria-current":v===t?`page`:void 0,children:[e[t].label,(0,h.jsx)(`span`,{className:`mono dim`,children:G[t]??``})]}),t===v&&F&&(0,h.jsx)(te,{label:`Skill types`,total:P.length,cats:I.cats,cat:S,onChange:D})]},t))})]}),(0,h.jsxs)(ne,{label:$,count:J?`${Y.length} of ${K.length}`:K.length,q:b,onQ:x,matched:Y.length,inView:[v,i],children:[(0,h.jsx)(f,{rows:le,activeName:W?.name,hrefOf:ue}),!J&&P.length>q&&(0,h.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,q,` of `,P.length,`; type to search the rest.`]}),j?.section===v&&P.length===0&&(0,h.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,h.jsx)(`div`,{className:`big`,children:`Nothing here yet`}),`Once the harness produces entries they appear here.`]})]}),(0,h.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:W?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`reader-tags`,children:[(0,h.jsx)(`span`,{className:`tag acc`,children:$.replace(/s$/,``)}),Q?(0,h.jsx)(`span`,{className:`tag`,children:Q.label}):null,(0,h.jsx)(ie,{status:me})]}),(0,h.jsxs)(`div`,{className:`reader-head`,children:[(0,h.jsx)(`h2`,{className:`reader-title`,children:B?.title||W.title||W.name}),v===`agents`?(0,h.jsx)(oe,{name:W.name}):null]}),(B?.desc||W.desc)&&(0,h.jsx)(`p`,{className:`reader-lede`,children:B?.desc||W.desc}),(0,h.jsx)(`p`,{className:`mono dim reader-src`,children:B?.source||W.source||C(v,W.name)}),v===`memory`&&W.name!==`MEMORY`&&W.name!==`README`&&(0,h.jsxs)(`div`,{className:`row gap-8`,children:[(0,h.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:fe,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,h.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:de,children:`Forget this fact`})]}),(0,h.jsx)(`hr`,{className:`hr`}),W?.kind===`manifest`||B?.manifest!==void 0?B?(0,h.jsx)(ae,{manifest:B.manifest,body:B.body,name:W.name}):(0,h.jsx)(`p`,{className:`sub`,children:`Loading…`}):B?.body?(0,h.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,h.jsx)(p,{body:B.body,links:B.links||[]})}):B===null&&L?(0,h.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,h.jsx)(se,{section:v,source:C(v,W.name)})]}):(0,h.jsxs)(`div`,{className:`empty`,children:[(0,h.jsx)(`div`,{className:`big`,children:`Select an entry`}),`Pick something from the list to read it.`]})})]})]})}export{D as default,E as splitSkills};
|
|
1
|
+
import{n as e,s as t,t as n}from"./sections-GalMS0Zv.js";import{i as r,t as i}from"./react-Ci4wQD4a.js";import{t as a}from"./api-Bp5eW_6m.js";import{I as o,U as s,_ as c,k as l,m as u,p as d,v as ee}from"./index-r2jRgf6l.js";import{a as te,c as ne,l as re,s as f,t as p,u as ie}from"./Markdown-BK38dn4x.js";var m=t(r(),1),h=i();function g({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,h.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function _({entries:e}){return e.length?(0,h.jsx)(`table`,{className:`mf-entries`,children:(0,h.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,h.jsxs)(`tr`,{children:[(0,h.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,h.jsx)(`td`,{className:`mf-load-cell`,children:(0,h.jsx)(g,{load:e.load})}),(0,h.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})}):null}function v({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,h.jsxs)(`div`,{className:`mf-vault`,children:[(0,h.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,h.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,h.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,h.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,h.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,h.jsxs)(`span`,{className:`mf-role`,children:[(0,h.jsx)(l,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,h.jsxs)(`span`,{className:`mf-role`,children:[(0,h.jsx)(l,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,h.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,h.jsx)(l,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,h.jsx)(_,{entries:t})]})}function y({body:e}){let[t,n]=(0,m.useState)(!1);return e?(0,h.jsxs)(`div`,{className:`mf-raw`,children:[(0,h.jsxs)(`button`,{className:`mf-raw-toggle`,onClick:()=>n(e=>!e),children:[(0,h.jsx)(l,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,h.jsx)(`pre`,{className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function ae({manifest:e,body:t,name:n}){if(!e)return(0,h.jsx)(`pre`,{className:`mf-raw-pre`,children:(t||``).replace(/^```json\n|\n```$/g,``)});if(e.kind===`wiki`){let n=e.wikis||[];return n.length?(0,h.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,h.jsx)(v,{wiki:e},e.name||t)),(0,h.jsx)(y,{body:t})]}):(0,h.jsxs)(`div`,{className:`mf-empty`,children:[(0,h.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,h.jsxs)(`p`,{children:[`A wiki is your machine-wide knowledge base — an Obsidian vault or any folder of linked markdown the agent reads from and writes back to. Declare one in`,` `,(0,h.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,h.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,h.jsx)(y,{body:t})]})}let r=e.context||[];return r.length?(0,h.jsxs)(`div`,{className:`mf-doc`,children:[(0,h.jsx)(_,{entries:r}),(0,h.jsx)(y,{body:t})]}):(0,h.jsxs)(`div`,{className:`mf-empty`,children:[(0,h.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,h.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,h.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,h.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,h.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,h.jsx)(y,{body:t})]})}var b={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},x={advocate:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,h.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,h.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,h.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,h.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,h.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,h.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,h.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,h.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,h.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,h.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),docs:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,h.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,h.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,h.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,h.jsx)(`g`,{className:`ag-write`,children:(0,h.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,h.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,h.jsxs)(`g`,{className:`ag-search`,children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,h.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,h.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`g`,{className:`ag-frame`,children:(0,h.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,h.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,h.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,h.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,h.jsxs)(`g`,{className:`ag-turn`,children:[(0,h.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,h.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,h.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,h.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,h.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,h.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,h.jsx)(`g`,{className:`ag-gauge`,children:(0,h.jsx)(`path`,{d:`M32 42l10-13`})}),(0,h.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,h.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,h.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,h.jsxs)(`g`,{className:`ag-tilt`,children:[(0,h.jsx)(`path`,{d:`M14 18h36`}),(0,h.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"memory-curator":(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,h.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,h.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,h.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,h.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,h.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,h.jsx)(`g`,{className:`ag-orbit`,children:(0,h.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,h.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,h.jsxs)(`g`,{className:`ag-sweep`,children:[(0,h.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,h.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,h.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,h.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,h.jsx)(`g`,{className:`ag-orbit`,children:(0,h.jsx)(`path`,{d:`M30 34V22`})}),(0,h.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,h.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,h.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,h.jsxs)(`g`,{className:`ag-lean`,children:[(0,h.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,h.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),steward:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,h.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,h.jsxs)(`g`,{className:`ag-grow`,children:[(0,h.jsx)(`path`,{d:`M32 50V26`}),(0,h.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,h.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,h.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,h.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,h.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,h.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,h.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,h.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,h.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,h.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,h.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,h.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},S=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,h.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function oe({name:e,size:t=64}){return(0,h.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...b,children:[(0,h.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,h.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),x[e]||S]})}function C(e,t){return e===`memory`?`memory/${t}`:e===`notebook`?`notebook/${t}`:e===`wiki`?`geneseed-wiki.jsonc`:e===`config`?t:`${e}/${t}.md`}function se({section:t,source:n}){return(0,h.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,h.jsx)(l,{name:e[t].icon,className:`glyph`}),(0,h.jsxs)(`span`,{children:[`This entry is part of the `,e[t].label.toLowerCase(),` convention; see`,` `,(0,h.jsx)(`code`,{className:`mono`,children:n}),`. It has no standalone per-entry document.`]})]})}var w=(e,t)=>t||(e&&n.includes(e)?e:n[0]),T=encodeURIComponent;function E(e){let t=e=>d[e.klass]?e.klass:`personal`,n=u.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:d[n].label,groupC:d[n].c})));return{rows:n,cats:u.map(e=>({key:e,label:d[e].label,c:d[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function D({overview:t,section:r,selected:i,dataRev:l,lock:u,base:g}){let _=ee(),[v,y]=(0,m.useState)(()=>w(r,u)),[b,x]=(0,m.useState)(``),[S,D]=(0,m.useState)(`all`),[O,k]=(0,m.useState)(``),[A,ce]=(0,m.useState)(r);if(r!==A){ce(r);let e=w(r,u);e!==v&&(y(e),x(``),D(`all`))}let{data:j,error:M,reload:N}=o(()=>a.catalog(v),[v,l],`catalog`),P=j?.section===v&&j?.items||[],F=v===`skills`,I=F?E(P):null,L=i||(F?I.rows[0]:P[0])?.name||null,R=L?P.find(e=>e.name===L):null,z=R?.type||e[v].type,{data:B,error:V}=o(()=>L?a.item(z,L):Promise.resolve(null),[v,L,z,l]),H=O||M||V,U=L?{name:L,title:B?.title||L,desc:B?.desc||``}:null,W=R||U,G=t?.counts||{},K=F?I.rows.filter(e=>S===`all`||e.cat===S):P,q=F?1/0:50,J=b.trim().toLowerCase(),Y=J?re(K,J):K.slice(0,q),le=!J&&S===`all`&&L&&!Y.some(e=>e.name===L)?[...Y,...P.filter(e=>e.name===L)]:Y,ue=t=>g?`${g}/${T(t.name)}`:`#/item/${t.type||e[v].type}/${T(t.name)}`,de=async()=>{let e=W?.name;if(e&&await _(`Forget the memory fact "${e}"? It leaves the index and moves to memory/archive/ (geneseed memory rm --archived --purge deletes it for good).`,{title:`Forget this fact?`,confirmLabel:`Forget`})){k(``);try{await a.memoryDelete(e)}catch(t){k(`Could not forget "${e}": ${t.message}`);return}s(g||`#/section/memory`),N()}},fe=async()=>{let e=W?.name;if(e&&await _(`Promote "${e}" into a standing rule? It is appended to user-rules.md as a trial rule (a month of probation), and the memory fact moves to memory/archive/ so the lesson isn't loaded twice.`,{title:`Promote to a rule?`,confirmLabel:`Promote`})){k(``);try{let t=await a.rules();await a.rulesPromote({name:e,fingerprint:t.fingerprint,delete_memory:!0}),s(`#/personal/rules`)}catch(e){k(`Could not promote: ${e.message}`),N()}}},X=n.reduce((e,t)=>e+(G[t]??0),0),pe=X-(G.skills??0)-(G.agents??0),Z=e=>`${X?e/X*100:0}%`,me=B?.status||W?.status,Q=v===`skills`?d[R?.klass]:null,$=e[v].label;return(0,h.jsxs)(h.Fragment,{children:[H?(0,h.jsx)(c,{error:H,style:{margin:`0 0 12px`}}):null,(0,h.jsxs)(`div`,{className:`library${u?` locked`:``}`,children:[u?null:(0,h.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,h.jsxs)(`div`,{className:`lib-title`,children:[(0,h.jsx)(`h1`,{className:`h`,children:`Library`}),(0,h.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,h.jsxs)(`div`,{className:`stackbar thin`,"aria-hidden":`true`,children:[(0,h.jsx)(`span`,{className:`sb-invariants`,style:{width:Z(G.skills??0)}}),(0,h.jsx)(`span`,{className:`sb-doctrines`,style:{width:Z(G.agents??0)}}),(0,h.jsx)(`span`,{className:`sb-rest`,style:{width:Z(pe)}})]}),(0,h.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:n.map(t=>(0,h.jsxs)(m.Fragment,{children:[(0,h.jsxs)(`a`,{href:`#/section/${t}`,className:v===t?`on`:``,"aria-current":v===t?`page`:void 0,children:[e[t].label,(0,h.jsx)(`span`,{className:`mono dim`,children:G[t]??``})]}),t===v&&F&&(0,h.jsx)(te,{label:`Skill types`,total:P.length,cats:I.cats,cat:S,onChange:D})]},t))})]}),(0,h.jsxs)(ne,{label:$,count:J?`${Y.length} of ${K.length}`:K.length,q:b,onQ:x,matched:Y.length,inView:[v,i],children:[(0,h.jsx)(f,{rows:le,activeName:W?.name,hrefOf:ue}),!J&&P.length>q&&(0,h.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,q,` of `,P.length,`; type to search the rest.`]}),j?.section===v&&P.length===0&&(0,h.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,h.jsx)(`div`,{className:`big`,children:`Nothing here yet`}),`Once the harness produces entries they appear here.`]})]}),(0,h.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:W?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`reader-tags`,children:[(0,h.jsx)(`span`,{className:`tag acc`,children:$.replace(/s$/,``)}),Q?(0,h.jsx)(`span`,{className:`tag`,children:Q.label}):null,(0,h.jsx)(ie,{status:me})]}),(0,h.jsxs)(`div`,{className:`reader-head`,children:[(0,h.jsx)(`h2`,{className:`reader-title`,children:B?.title||W.title||W.name}),v===`agents`?(0,h.jsx)(oe,{name:W.name}):null]}),(B?.desc||W.desc)&&(0,h.jsx)(`p`,{className:`reader-lede`,children:B?.desc||W.desc}),(0,h.jsx)(`p`,{className:`mono dim reader-src`,children:B?.source||W.source||C(v,W.name)}),v===`memory`&&W.name!==`MEMORY`&&W.name!==`README`&&(0,h.jsxs)(`div`,{className:`row gap-8`,children:[(0,h.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:fe,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,h.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:de,children:`Forget this fact`})]}),(0,h.jsx)(`hr`,{className:`hr`}),W?.kind===`manifest`||B?.manifest!==void 0?B?(0,h.jsx)(ae,{manifest:B.manifest,body:B.body,name:W.name}):(0,h.jsx)(`p`,{className:`sub`,children:`Loading…`}):B?.body?(0,h.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,h.jsx)(p,{body:B.body,links:B.links||[]})}):B===null&&L?(0,h.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,h.jsx)(se,{section:v,source:C(v,W.name)})]}):(0,h.jsxs)(`div`,{className:`empty`,children:[(0,h.jsx)(`div`,{className:`big`,children:`Select an entry`}),`Pick something from the list to read it.`]})})]})]})}export{D as default,E as splitSkills};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-DRhoX0kS.js";import{t as r}from"./api-Bp5eW_6m.js";import{H as i,I as a,V as o,_ as s,y as c}from"./index-BmbWeoTM.js";import{t as l}from"./usePoll-BmR631BB.js";import{a as u,c as d,l as f,o as p,s as m,t as h}from"./Markdown-DrXLM6TA.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,i[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(`
|
|
1
|
+
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-Ci4wQD4a.js";import{t as r}from"./api-Bp5eW_6m.js";import{H as i,I as a,V as o,_ as s,y as c}from"./index-r2jRgf6l.js";import{t as l}from"./usePoll-BcywUo55.js";import{a as u,c as d,l as f,o as p,s as m,t as h}from"./Markdown-BK38dn4x.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,i[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
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)(h,{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:i,error:o}=a(()=>r.loops(),[n],`loops`),l=H(),[h,_]=(0,g.useState)(``),[v,y]=(0,g.useState)(`all`),[b,x]=(0,g.useState)(e);e!==b&&(x(e),_(``),y(`all`));let S=i?.bricks||[],C=e===`active`?l.loops&&X(l.loops):i&&(e===`bricks`?Y(i.bricks,i.overridden):J(i.templates,i.bricks)),w=C||[],T=p(w),E=v===`all`?w:w.filter(e=>e.group===v),D=h.trim(),O=f(E,D),k=w.find(e=>e.name===t)||e===`active`&&w.find(V)||w[0]||null,A={templates:i?.templates.length,bricks:i?.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:o;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(s,{error:P,style:{margin:`0 0 12px`}}),(0,F.jsx)(ce,{problems:i?.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:h,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)(m,{rows:O,activeName:k?.name,hrefOf:t=>`#/loops/${e}/${U(t.name)}`,pills:Q[e]}):P?null:(0,F.jsx)(c,{})}),(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:i.overridden},k.name):null})]})]})}export{X as activeRows,Y as brickRows,$ as brickSource,ue as default,J as templateRows};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-DRhoX0kS.js";import{t as r}from"./FilterInput-BSfpStOZ.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} *[^
|
|
1
|
+
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-Ci4wQD4a.js";import{t as r}from"./FilterInput-Ikvi-pS9.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
2
|
]`).replace(`lheading`,oe).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ye=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,A=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,be=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,j=/[\p{P}\p{S}]/u,M=/[\s\p{P}\p{S}]/u,N=/[^\s\p{P}\p{S}]/u,xe=x(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,M).getRegex(),Se=/[\p{Pi}\p{Ps}"']/u,Ce=/(?!~)[\p{P}\p{S}]/u,we=/(?!~)[\s\p{P}\p{S}]/u,Te=/(?:[^\s\p{P}\p{S}]|~)/u,Ee=x(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ee?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),P=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,De=x(P,`u`).replace(/punct/g,j).getRegex(),Oe=x(P,`u`).replace(/punct/g,Ce).getRegex(),ke=x(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Se).replace(/punct/g,j).getRegex(),Ae=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,je=x(Ae,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Me=x(Ae,`gu`).replace(/notPunctSpace/g,Te).replace(/punctSpace/g,we).replace(/punct/g,Ce).getRegex(),Ne=x(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Pe=x(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Fe=x(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Ie=x(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,j).getRegex(),Le=x(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Re=x(/\\(punct)/,`gu`).replace(/punct/g,j).getRegex(),ze=x(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,j).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]|[^\[\]\\])*\]/,F=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`,F).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ge=x(/^!?\[(label)\]\[(ref)\]/).replace(`label`,F).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(),I={_backpedal:y,anyPunctuation:Re,anyPunctuationOutsideCode:ze,autolink:Be,blockSkip:Ee,br:A,code:ye,del:y,delLDelim:y,delRDelim:y,emStrongLDelim:De,emStrongRDelimAst:je,emStrongRDelimUnd:Pe,escape:ve,link:We,nolink:Ke,punctuation:xe,reflink:Ge,reflinkSearch:Ye,tag:He,text:be,url:y},Qe={...I,emStrongLDelim:ke,emStrongRDelimAst:Ne,emStrongRDelimUnd:Fe,link:x(/^!?\[(label)\]\((.*?)\)/).replace(`label`,F).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,F).getRegex()},L={...I,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={...L,br:x(A).replace(`{2,}`,`*`).getRegex(),text:x(L.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R={normal:k,gfm:ge,pedantic:_e},z={normal:I,gfm:L,breaks:$e,pedantic:Qe},et={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},tt=e=>et[e];function B(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 V(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 it(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
4
|
`)}function U(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function at(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 ot(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 st(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,r as t}from"./sections-GalMS0Zv.js";import{i as n,t as r}from"./react-
|
|
1
|
+
import{n as e,r as t}from"./sections-GalMS0Zv.js";import{i as n,t as r}from"./react-Ci4wQD4a.js";import{j as i,k as a}from"./index-r2jRgf6l.js";import{t as o}from"./jobBuckets-Dbq8ZlWW.js";n();var s=r(),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:n,jobs:r,doctor:h,onAction:g}){let _=n.counts||{},v=t.reduce((e,t)=>e+(_[t]||0),0),y=Math.max(...t.map(e=>_[e]||0),1),b=h?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=o(r||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(r),T=Math.max(...w.map(e=>e.value),1),E=i(n.diff),D=[[`status`,n.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:n.theme})],[`mode`,n.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`,n.build_time||`—`],[`target`,(0,s.jsx)(`span`,{className:`c-dim mono`,children:n.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:[n.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:`INVARIANTS`,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:t.map(t=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{className:`c-name`,children:e[t].label}),(0,s.jsx)(`td`,{className:`c-dim`,children:e[t].desc}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`div`,{className:`c-bar`,children:(0,s.jsx)(`i`,{style:{width:`${(_[t]||0)/y*100}%`,background:t===`agents`||t===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,s.jsx)(`td`,{className:(_[t]||0)>0?`num`:`num c-dim`,children:_[t]??0})]},t))})]})}),(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:`${(r||[]).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:[(r||[]).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
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)}),(!r||r.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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-DRhoX0kS.js";import{t as r}from"./api-Bp5eW_6m.js";import{I as i,_ as a,v as o,x as s,y as c}from"./index-BmbWeoTM.js";import{t as l}from"./Markdown-DrXLM6TA.js";import{t as u}from"./Tabs-YZbGqWPW.js";import d from"./Library-CkaPVUYU.js";var f=e(t(),1),p=n(),m={title:``,body:``,scope:`project`,trial_until:``};function h({initial:e,onCancel:t,onSave:n,busy:r}){let[i,a]=(0,f.useState)(e),o=e=>t=>a({...i,[e]:t.target.value}),s=i.title.trim()&&i.body.trim();return(0,p.jsxs)(`div`,{className:`rule-form`,children:[(0,p.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,p.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,p.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,p.jsxs)(`select`,{className:`sel`,value:i.scope,onChange:o(`scope`),"aria-label":`Rule scope`,children:[(0,p.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,p.jsx)(`option`,{value:`user`,children:`scope: user (personal)`})]}),(0,p.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,p.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:i.trial_until,onChange:o(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,p.jsxs)(`div`,{style:{marginLeft:`auto`,display:`flex`,gap:8},children:[(0,p.jsx)(`button`,{className:`btn sm`,disabled:!s||r,onClick:()=>n(i),children:r?`Saving…`:`Save rule`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,disabled:r,onClick:t,children:`Cancel`})]})]})]})}function g({rule:e,isOpen:t,onToggle:n,onEdit:r,onDelete:i,onGraduate:a}){return(0,p.jsxs)(`div`,{className:`rule-row ${t?`on`:``}`,children:[(0,p.jsxs)(`button`,{className:`rule-head`,onClick:n,"aria-expanded":t,children:[(0,p.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,p.jsx)(`span`,{className:`rule-title`,children:e.title}),(0,p.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,p.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),t&&(0,p.jsxs)(`div`,{className:`rule-expand`,children:[(0,p.jsx)(`p`,{children:e.body}),e.source?(0,p.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,p.jsxs)(`div`,{className:`row`,style:{marginTop:10,gap:8},children:[e.status===`trial`&&(0,p.jsx)(`button`,{className:`btn sm`,onClick:a,title:`Adopt for good — drop the trial marker`,children:`Graduate`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:r,children:`Edit`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Retire`})]})]})]})}function _({onChanged:e}){let t=o(),[n,s]=(0,f.useState)(0),{data:l,error:u}=i(()=>r.rules(),[n]),[d,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(``),w=()=>s(e=>e+1);if(u)return(0,p.jsx)(a,{error:u});if(!l)return(0,p.jsx)(c,{});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,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,p.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,p.jsx)(`button`,{className:`btn`,onClick:()=>y(`new`),children:`Add rule`})]}),l.exists&&(0,p.jsxs)(`div`,{className:`rules-meter ${O}`,children:[(0,p.jsx)(`div`,{className:`rules-meter-bar`,children:(0,p.jsx)(`div`,{className:`rules-meter-fill`,style:{width:`${Math.min(D,100)}%`}})}),(0,p.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,p.jsx)(`p`,{className:`sub rule-notice`,children:S}):null,(l.warnings||[]).map(e=>(0,p.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),v===`new`&&(0,p.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,p.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),(0,p.jsx)(h,{initial:m,busy:b,onCancel:()=>y(null),onSave:e=>k({op:`add`,...e})})]}),l.exists?T.length===0&&v!==`new`?(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.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,p.jsx)(`div`,{className:`card rules-list`,children:T.map(e=>v===e.id?(0,p.jsx)(`div`,{className:`rule-row on`,children:(0,p.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,p.jsx)(h,{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,p.jsx)(g,{rule:e,isOpen:d===e.id,onToggle:()=>_(d===e.id?null:e.id),onEdit:()=>{_(e.id),y(e.id)},onDelete:()=>A(e),onGraduate:()=>j(e)},e.id))}):(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.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,p.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}function v({onChanged:e}){let{data:t,error:n,loading:o,reload:u}=i(()=>r.profile(),[]),[d,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(null),[C,w]=(0,f.useState)(!1),[T,E]=(0,f.useState)(null);t&&t!==T&&(E(t),g(t.fingerprint||``),C?w(!1):m(t.text||``),S(e=>e||((t.text||``).trim()?`view`:`edit`)));let D=!!t&&d!==(t.text||``);return(0,f.useEffect)(()=>{if(!D)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[D]),o&&!t?(0,p.jsx)(c,{}):n?(0,p.jsx)(a,{error:n}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,p.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` `,`beside the deployed AGENT.md. Unlike `,(0,p.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,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),(0,p.jsxs)(`div`,{className:`row`,style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,p.jsx)(s,{"aria-label":`Profile mode`,children:[[`view`,`View`],[`edit`,`Edit`]].map(([e,t])=>(0,p.jsx)(`button`,{className:x===e?`on`:``,onClick:()=>S(e),children:t},e))}),x===`edit`&&(0,p.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`),u(),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.`),u())}catch(e){b(e.message)}finally{v(!1)}},children:_?`Saving…`:`Save`})]})]}),y?(0,p.jsx)(`p`,{className:`sub rule-notice`,children:y}):null,x===`edit`?(0,p.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:d,onChange:e=>m(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):d.trim()?(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.jsx)(l,{body:d})}):(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.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,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})})]})}var y=(e,t)=>`${t?Math.min(100,e/t*100):0}%`;function b({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,p.jsxs)(`div`,{className:`card-row`,children:[(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-budget`,children:`Token budget`}),(0,p.jsx)(`span`,{className:`mono dim`,children:`loaded every turn`})]}),(0,p.jsxs)(`p`,{className:`big-num`,children:[(0,p.jsx)(`span`,{className:`mono`,children:i.tokens}),` `,(0,p.jsxs)(`span`,{className:`dim`,children:[`/ `,i.max_tokens.toLocaleString(`en-US`),` tokens`]})]}),(0,p.jsx)(`span`,{className:`hbar${i.tokens>i.max_tokens?` bad`:``}`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{style:{width:y(i.tokens,i.max_tokens)}})}),(0,p.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,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-slots`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-slots`,children:`Rule slots`}),(0,p.jsxs)(`span`,{className:`mono dim`,children:[i.rules,` of `,i.max_rules]})]}),(0,p.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,p.jsx)(`span`,{className:t<i.rules?`used`:``},t))}),(0,p.jsx)(`p`,{className:`panel-note`,children:`Trial rules graduate once they have held.`})]}),(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,p.jsx)(`div`,{className:`panel-head`,children:(0,p.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,p.jsx)(`ul`,{className:`hbars`,children:a.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,p.jsx)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{className:`hb-ok`,style:{width:y(e.fill,1)}})}),(0,p.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))})]})]})}function x({tab:e=`rules`,item:t,setup:n,dataRev:a}){let[o,s]=(0,f.useState)(0),c=e=>Promise.resolve(e).catch(()=>null),{data:l}=i(()=>c(r.rules()),[a,o]),{data:m}=i(()=>c(r.profile()),[a,o]),{data:h}=i(()=>c(r.catalog(`notebook`)),[a],`catalog`),g=h?(h.items||[]).filter(e=>e.name!==`NOTEBOOK`&&e.name!==`README`).length:null,y=n?.facts??null,x={rules:l?.stats?.rules,profile:m?.seeded?`●`:null,memory:y,notebook:g};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`page-head`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h1`,{className:`h`,children:`Personal`}),(0,p.jsx)(`p`,{className:`sub`,children:`The only files you write. They survive updates, reinstalls and voice changes.`})]})}),(0,p.jsx)(u,{page:`personal`,current:e,badges:x,label:`Personal files`}),e===`rules`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(b,{rules:l,profile:m,facts:y,notes:g}),(0,p.jsx)(_,{onChanged:()=>s(e=>e+1)})]}),e===`profile`&&(0,p.jsx)(v,{onChanged:()=>s(e=>e+1)}),(e===`memory`||e===`notebook`)&&(0,p.jsx)(d,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:a},e)]})}export{x as default};
|
|
1
|
+
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-Ci4wQD4a.js";import{t as r}from"./api-Bp5eW_6m.js";import{I as i,_ as a,v as o,x as s,y as c}from"./index-r2jRgf6l.js";import{t as l}from"./Markdown-BK38dn4x.js";import{t as u}from"./Tabs-DcMq5IvC.js";import d from"./Library-BCaqPf61.js";var f=e(t(),1),p=n(),m={title:``,body:``,scope:`project`,trial_until:``};function h({initial:e,onCancel:t,onSave:n,busy:r}){let[i,a]=(0,f.useState)(e),o=e=>t=>a({...i,[e]:t.target.value}),s=i.title.trim()&&i.body.trim();return(0,p.jsxs)(`div`,{className:`rule-form`,children:[(0,p.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,p.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,p.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,p.jsxs)(`select`,{className:`sel`,value:i.scope,onChange:o(`scope`),"aria-label":`Rule scope`,children:[(0,p.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,p.jsx)(`option`,{value:`user`,children:`scope: user (personal)`})]}),(0,p.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,p.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:i.trial_until,onChange:o(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,p.jsxs)(`div`,{style:{marginLeft:`auto`,display:`flex`,gap:8},children:[(0,p.jsx)(`button`,{className:`btn sm`,disabled:!s||r,onClick:()=>n(i),children:r?`Saving…`:`Save rule`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,disabled:r,onClick:t,children:`Cancel`})]})]})]})}function g({rule:e,isOpen:t,onToggle:n,onEdit:r,onDelete:i,onGraduate:a}){return(0,p.jsxs)(`div`,{className:`rule-row ${t?`on`:``}`,children:[(0,p.jsxs)(`button`,{className:`rule-head`,onClick:n,"aria-expanded":t,children:[(0,p.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,p.jsx)(`span`,{className:`rule-title`,children:e.title}),(0,p.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,p.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),t&&(0,p.jsxs)(`div`,{className:`rule-expand`,children:[(0,p.jsx)(`p`,{children:e.body}),e.source?(0,p.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,p.jsxs)(`div`,{className:`row`,style:{marginTop:10,gap:8},children:[e.status===`trial`&&(0,p.jsx)(`button`,{className:`btn sm`,onClick:a,title:`Adopt for good — drop the trial marker`,children:`Graduate`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:r,children:`Edit`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Retire`})]})]})]})}function _({onChanged:e}){let t=o(),[n,s]=(0,f.useState)(0),{data:l,error:u}=i(()=>r.rules(),[n]),[d,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(``),w=()=>s(e=>e+1);if(u)return(0,p.jsx)(a,{error:u});if(!l)return(0,p.jsx)(c,{});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,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,p.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,p.jsx)(`button`,{className:`btn`,onClick:()=>y(`new`),children:`Add rule`})]}),l.exists&&(0,p.jsxs)(`div`,{className:`rules-meter ${O}`,children:[(0,p.jsx)(`div`,{className:`rules-meter-bar`,children:(0,p.jsx)(`div`,{className:`rules-meter-fill`,style:{width:`${Math.min(D,100)}%`}})}),(0,p.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,p.jsx)(`p`,{className:`sub rule-notice`,children:S}):null,(l.warnings||[]).map(e=>(0,p.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),v===`new`&&(0,p.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,p.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),(0,p.jsx)(h,{initial:m,busy:b,onCancel:()=>y(null),onSave:e=>k({op:`add`,...e})})]}),l.exists?T.length===0&&v!==`new`?(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.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,p.jsx)(`div`,{className:`card rules-list`,children:T.map(e=>v===e.id?(0,p.jsx)(`div`,{className:`rule-row on`,children:(0,p.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,p.jsx)(h,{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,p.jsx)(g,{rule:e,isOpen:d===e.id,onToggle:()=>_(d===e.id?null:e.id),onEdit:()=>{_(e.id),y(e.id)},onDelete:()=>A(e),onGraduate:()=>j(e)},e.id))}):(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.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,p.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}function v({onChanged:e}){let{data:t,error:n,loading:o,reload:u}=i(()=>r.profile(),[]),[d,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(null),[C,w]=(0,f.useState)(!1),[T,E]=(0,f.useState)(null);t&&t!==T&&(E(t),g(t.fingerprint||``),C?w(!1):m(t.text||``),S(e=>e||((t.text||``).trim()?`view`:`edit`)));let D=!!t&&d!==(t.text||``);return(0,f.useEffect)(()=>{if(!D)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[D]),o&&!t?(0,p.jsx)(c,{}):n?(0,p.jsx)(a,{error:n}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,p.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` `,`beside the deployed AGENT.md. Unlike `,(0,p.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,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),(0,p.jsxs)(`div`,{className:`row`,style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,p.jsx)(s,{"aria-label":`Profile mode`,children:[[`view`,`View`],[`edit`,`Edit`]].map(([e,t])=>(0,p.jsx)(`button`,{className:x===e?`on`:``,onClick:()=>S(e),children:t},e))}),x===`edit`&&(0,p.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`),u(),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.`),u())}catch(e){b(e.message)}finally{v(!1)}},children:_?`Saving…`:`Save`})]})]}),y?(0,p.jsx)(`p`,{className:`sub rule-notice`,children:y}):null,x===`edit`?(0,p.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:d,onChange:e=>m(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):d.trim()?(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.jsx)(l,{body:d})}):(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.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,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})})]})}var y=(e,t)=>`${t?Math.min(100,e/t*100):0}%`;function b({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,p.jsxs)(`div`,{className:`card-row`,children:[(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-budget`,children:`Token budget`}),(0,p.jsx)(`span`,{className:`mono dim`,children:`loaded every turn`})]}),(0,p.jsxs)(`p`,{className:`big-num`,children:[(0,p.jsx)(`span`,{className:`mono`,children:i.tokens}),` `,(0,p.jsxs)(`span`,{className:`dim`,children:[`/ `,i.max_tokens.toLocaleString(`en-US`),` tokens`]})]}),(0,p.jsx)(`span`,{className:`hbar${i.tokens>i.max_tokens?` bad`:``}`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{style:{width:y(i.tokens,i.max_tokens)}})}),(0,p.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,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-slots`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-slots`,children:`Rule slots`}),(0,p.jsxs)(`span`,{className:`mono dim`,children:[i.rules,` of `,i.max_rules]})]}),(0,p.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,p.jsx)(`span`,{className:t<i.rules?`used`:``},t))}),(0,p.jsx)(`p`,{className:`panel-note`,children:`Trial rules graduate once they have held.`})]}),(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,p.jsx)(`div`,{className:`panel-head`,children:(0,p.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,p.jsx)(`ul`,{className:`hbars`,children:a.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,p.jsx)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{className:`hb-ok`,style:{width:y(e.fill,1)}})}),(0,p.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))})]})]})}function x({tab:e=`rules`,item:t,setup:n,dataRev:a}){let[o,s]=(0,f.useState)(0),c=e=>Promise.resolve(e).catch(()=>null),{data:l}=i(()=>c(r.rules()),[a,o]),{data:m}=i(()=>c(r.profile()),[a,o]),{data:h}=i(()=>c(r.catalog(`notebook`)),[a],`catalog`),g=h?(h.items||[]).filter(e=>e.name!==`NOTEBOOK`&&e.name!==`README`).length:null,y=n?.facts??null,x={rules:l?.stats?.rules,profile:m?.seeded?`●`:null,memory:y,notebook:g};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`page-head`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h1`,{className:`h`,children:`Personal`}),(0,p.jsx)(`p`,{className:`sub`,children:`The only files you write. They survive updates, reinstalls and voice changes.`})]})}),(0,p.jsx)(u,{page:`personal`,current:e,badges:x,label:`Personal files`}),e===`rules`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(b,{rules:l,profile:m,facts:y,notes:g}),(0,p.jsx)(_,{onChanged:()=>s(e=>e+1)})]}),e===`profile`&&(0,p.jsx)(v,{onChanged:()=>s(e=>e+1)}),(e===`memory`||e===`notebook`)&&(0,p.jsx)(d,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:a},e)]})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./sections-GalMS0Zv.js";import{i as e,t}from"./react-
|
|
1
|
+
import"./sections-GalMS0Zv.js";import{i as e,t}from"./react-Ci4wQD4a.js";import{H as n,V as r}from"./index-r2jRgf6l.js";e();var i=t();function a({page:e,current:t,badges:a={},label:o}){return(0,i.jsx)(`nav`,{className:`tabs`,"aria-label":o,children:r[e].map(r=>(0,i.jsxs)(`a`,{href:`#/${e}/${r}`,className:t===r?`on`:``,"aria-current":t===r?`page`:void 0,children:[n[r],a[r]==null?null:(0,i.jsx)(`span`,{className:`tab-badge`,children:a[r]})]},r))})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-
|
|
1
|
+
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-Ci4wQD4a.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{St as e,_t as t,tt as n,ut as r,yt as i}from"./index-
|
|
1
|
+
import{St as e,_t as t,tt as n,ut as r,yt as i}from"./index-r2jRgf6l.js";var a=e=>{let n=1;if(e&&e.getCTM){let r=e.getCTM();r&&(n=(t(r.a*r.a+r.b*r.b)+t(r.c*r.c+r.d*r.d))/2)}return n},o=(t,n,o)=>{let s=i,c=getComputedStyle(t),l=c.strokeLinecap,u=c.vectorEffect===`non-scaling-stroke`?t:null,d=l,f=new Proxy(t,{get(t,n){let i=t[n];return n===e?t:n===`setAttribute`?(...e)=>{if(e[0]===`draw`){let n=e[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 e=r===i?`butt`:l;d!==e&&(t.style.strokeLinecap=`${e}`,d=e)}t.setAttribute(`stroke-dashoffset`,`${c}`),t.setAttribute(`stroke-dasharray`,`${f} ${p}`)}return Reflect.apply(i,t,e)}:r(i)?(...e)=>Reflect.apply(i,t,e):i}});return t.getAttribute(`pathLength`)!==`${s}`&&(t.setAttribute(`pathLength`,`${s}`),f.setAttribute(`draw`,`${n} ${o}`)),f},s=(e,t=0,r=0)=>n(e).map(e=>o(e,t,r));export{s as t};
|