geneseed 4.20.0 → 4.22.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 +27 -0
- package/DESIGN.md +1 -1
- package/README.md +2 -2
- package/SHIPPED.md +1 -1
- package/adapters/bob/README.md +5 -0
- package/adapters/claude-code/README.md +4 -0
- package/adapters/openclaude/README.md +2 -1
- package/adapters/opencode/plugins/geneseed-activity.js +2 -2
- package/adapters/opencode/plugins/geneseed-guard.js +1 -1
- package/bin/geneseed-cli.mjs +1 -1
- package/bin/geneseed-hook.mjs +44 -3
- package/docs/concepts/hooks.md +4 -0
- package/docs/concepts/host-matrix.md +1 -0
- package/docs/guides/upgrade.md +1 -1
- package/docs/reference/environment.md +1 -0
- package/docs/reference/plugin-activity.md +7 -3
- package/docs/web-ui.md +13 -11
- package/harness.config.json +1 -1
- package/js/README.md +3 -2
- package/js/cli-table.json +39 -0
- package/js/hosts/activity.mjs +429 -0
- package/js/hosts/hooks-prims.mjs +47 -4
- package/js/hosts/hooks.mjs +6 -9
- package/js/hosts/settings.mjs +9 -0
- package/js/web/actions.mjs +39 -0
- package/js/web/activity.mjs +76 -108
- package/js/web/api.mjs +24 -2
- package/js/web/handler.mjs +20 -1
- package/js/web/jobs.mjs +6 -6
- package/js/web/server.mjs +6 -0
- package/js/web/usage-api.mjs +24 -3
- package/package.json +1 -1
- package/src/modes/foreman.md +2 -1
- package/src/skills/pipeline.md +2 -2
- package/src/skills/rule.md +3 -3
- package/web/dist/assets/Activity-DsKkFGhT.js +1 -0
- package/web/dist/assets/{ActivityDetail-CMeNtKIN.js → ActivityDetail-BWY-vaiK.js} +1 -1
- package/web/dist/assets/Dashboard-BZmw2a7d.js +2 -0
- package/web/dist/assets/Docs-CNuRuMin.js +4 -0
- package/web/dist/assets/GreenhouseView-BCiZP9f9.js +1 -0
- package/web/dist/assets/Installs-xkBX6OjK.js +3 -0
- package/web/dist/assets/JournalView-BSR51TKR.js +1 -0
- package/web/dist/assets/{KitApply-DZGqaZpV.js → KitApply-BR8AcZ62.js} +1 -1
- package/web/dist/assets/{Kits-C1VS-BtR.js → Kits-e0DCj9sT.js} +1 -1
- package/web/dist/assets/{Laws-Cu3pj44B.js → Laws-BuG2_HFE.js} +2 -2
- package/web/dist/assets/Library-BYfB4mhf.js +2 -0
- package/web/dist/assets/Loops-r6L7a1g1.js +2 -0
- package/web/dist/assets/OperatorHudView-BLXm0zzn.js +1 -0
- package/web/dist/assets/Personal-kEfKCxlh.js +1 -0
- package/web/dist/assets/{StackBar-CXARiXzd.js → StackBar-Y_gkoC3t.js} +1 -1
- package/web/dist/assets/Tabs-2uMB511T.js +1 -0
- package/web/dist/assets/activity-BEWV9er4.js +1 -0
- package/web/dist/assets/drawable-ixCquffB.js +1 -0
- package/web/dist/assets/{index-BJlfPvpv.css → index-CDSHv_7s.css} +1 -1
- package/web/dist/assets/index-Dwo3Gxek.js +2 -0
- package/web/dist/assets/jobBuckets-Dpjvbfm1.js +2 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/Activity-nRkdnrgE.js +0 -1
- package/web/dist/assets/Dashboard-B5-wUlXC.js +0 -3
- package/web/dist/assets/Docs-QmZs08QG.js +0 -4
- package/web/dist/assets/GreenhouseView-tHIvpI6U.js +0 -1
- package/web/dist/assets/Installs-DDWjgFDY.js +0 -3
- package/web/dist/assets/JournalView-DO0pPutM.js +0 -1
- package/web/dist/assets/Library-CrTK5XsD.js +0 -2
- package/web/dist/assets/Loops-C7DPrKbV.js +0 -2
- package/web/dist/assets/OperatorHudView-BN27gXFS.js +0 -1
- package/web/dist/assets/Personal-Cz2rcqYw.js +0 -1
- package/web/dist/assets/Tabs-ChiCgm2F.js +0 -1
- package/web/dist/assets/activity-BGy8Bb_l.js +0 -1
- package/web/dist/assets/drawable-r1qCgRMK.js +0 -1
- package/web/dist/assets/index-osXUqzdX.js +0 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,F as a,I as o,J as s,M as c,P as l,T as u,V as d,a as f,c as p,i as m,k as h,n as g,o as _,r as v,s as ee,tt as y}from"./index-Dwo3Gxek.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{a as te,n as ne,o as x,r as S,t as C}from"./RailCats-DNlJKicm.js";import{i as w,n as T,r as E}from"./Markdown-OReRRoEV.js";var D=e(t(),1);function O(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function k(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
|
+
`))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
|
|
3
|
+
`),n.join(`
|
|
4
|
+
`)]}function A(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||O(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function j(e){let t={ids:new Set,idx:0,toc:[]},n=n=>A(T(n,e?.links),t);if(e?.rows){let[r,i]=k(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var M=n(),N={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},P=`you already know this`;function F({page:e,overview:t,onAction:n}){let r=(0,D.useRef)(null),i=(0,D.useMemo)(()=>j({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=r.current;e&&e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(P)&&e.classList.add(`analogy`)})},[i]),(0,D.useEffect)(()=>{let e=r.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),y(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[i]),(0,D.useEffect)(()=>{let n=r.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[i,a]=N[t?.emit]||[];if(!i)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${i}"]`)?.closest(`li`):e.id===i&&a&&(o=[...n.querySelectorAll(`h2`)].find(e=>O(e.textContent||``)===O(a))),o?.classList.add(`docs-here`)},[i,e.id,t?.emit]);let a=[];return e.id===`install`&&(a.push({label:`Run doctor`,action:`doctor`}),a.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&a.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&a.push({label:`Update`,action:`update`}),(0,M.jsxs)(`div`,{className:`detail-doc`,children:[(0,M.jsx)(u,{title:e.title,actions:a.length>0&&a.map(e=>e.hash?(0,M.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,M.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,M.jsx)(`div`,{className:`doc-meta`,children:(0,M.jsxs)(`span`,{className:`badge`,children:[(0,M.jsx)(`span`,{className:`dot`}),e.source]})}),(0,M.jsx)(`div`,{className:`markdown`,ref:r,dangerouslySetInnerHTML:{__html:i}}),e.link&&(0,M.jsx)(`div`,{className:`doc-link`,children:(0,M.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var I=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`),L=1200;function R({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,M.jsxs)(`div`,{className:`cli-arg`,children:[(0,M.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,M.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,M.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function z({text:e}){let[t,n]=(0,D.useState)(!1);return(0,M.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),L)}catch{}},title:`Copy command`,children:[(0,M.jsx)(d,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function B({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,M.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,M.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,M.jsxs)(`div`,{className:`stack gap-4`,children:[(0,M.jsx)(`h2`,{id:I(e.name),children:(0,M.jsx)(`code`,{children:e.name})}),e.help&&(0,M.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,M.jsx)(z,{text:`${t} ${e.name}`})]}),(0,M.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,M.jsxs)(`div`,{className:`cli-block`,children:[(0,M.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,M.jsx)(R,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,M.jsxs)(`div`,{className:`cli-block`,children:[(0,M.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,M.jsx)(R,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function V({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,M.jsxs)(`div`,{className:`detail-doc`,children:[(0,M.jsx)(u,{title:e.title,sub:(0,M.jsxs)(M.Fragment,{children:[`Every subcommand of `,(0,M.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,M.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,M.jsx)(`div`,{children:n.map(e=>(0,M.jsx)(B,{cmd:e,prog:t},e.name))})]})}function H({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,M.jsxs)(`div`,{className:`detail-doc`,children:[(0,M.jsx)(u,{title:e.title,sub:(0,M.jsxs)(M.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,M.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,M.jsx)(`div`,{className:`card pad-md`,children:(0,M.jsxs)(`table`,{className:`glossary-table`,children:[(0,M.jsx)(`thead`,{children:(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`th`,{children:`Concept`}),(0,M.jsx)(`th`,{children:`Neutral term`}),(0,M.jsxs)(`th`,{children:[`In `,n]}),(0,M.jsx)(`th`,{children:`Meaning`}),(0,M.jsx)(`th`,{children:`In dev terms`})]})}),(0,M.jsx)(`tbody`,{children:t.map(e=>(0,M.jsxs)(`tr`,{children:[(0,M.jsx)(`td`,{children:(0,M.jsx)(`strong`,{children:e.label})}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{children:e.neutral||`—`})}),(0,M.jsx)(`td`,{children:(0,M.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,M.jsx)(`td`,{className:`dim`,children:e.desc}),(0,M.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var U={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},W=({text:e})=>(0,M.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),G=({kind:e})=>(0,M.jsx)(`span`,{className:`tag ${U[e]||``}`,children:e});function K({page:e,overview:t,onAction:n}){let[r,i]=(0,D.useState)(0),{before:a,after:o}=(0,D.useMemo)(()=>j(e),[e]);if(!e.rows)return(0,M.jsx)(F,{page:e,overview:t,onAction:n});let s=e.rows[r]||e.rows[0];return(0,M.jsxs)(`div`,{className:`detail-doc`,children:[(0,M.jsx)(u,{title:e.title}),(0,M.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:a}}),(0,M.jsxs)(`div`,{className:`docs-map`,children:[(0,M.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,M.jsx)(`li`,{children:(0,M.jsxs)(`button`,{className:`map-node ${t===r?`on`:``}`,"aria-pressed":t===r,onClick:()=>i(t),children:[(0,M.jsx)(`span`,{className:`map-piece`,children:(0,M.jsx)(W,{text:e.piece})}),(0,M.jsx)(G,{kind:e.kind}),(0,M.jsx)(`span`,{className:`mono dim map-cost`,children:(0,M.jsx)(W,{text:e.cost})})]})},t))}),s&&(0,M.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,M.jsx)(`h2`,{children:(0,M.jsx)(W,{text:s.piece})}),(0,M.jsx)(G,{kind:s.kind}),(0,M.jsxs)(`dl`,{children:[(0,M.jsx)(`dt`,{children:`Does`}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(W,{text:s.does})}),(0,M.jsx)(`dt`,{children:`Costs`}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(W,{text:s.cost})}),(0,M.jsx)(`dt`,{children:`Turn it off`}),(0,M.jsx)(`dd`,{children:(0,M.jsx)(W,{text:s.off})})]})]})]}),o.trim()&&(0,M.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:o}})]})}var q=5,J=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Y(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${J(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===q)break;return r}var X=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function Z({page:e,glossaryRows:t}){let n=e?.body,r=(0,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:I(e.name),title:e.name,level:2})):j(e).toc,[e]),i=(0,D.useMemo)(()=>Y(n,t),[n,t]);return!r.length&&!i.length?null:(0,M.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,M.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,M.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,M.jsx)(`ul`,{children:r.map(e=>(0,M.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,M.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),X(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,M.jsxs)(`div`,{className:`docs-gloss`,children:[(0,M.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,M.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,M.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,M.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function re({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,M.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,M.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,M.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,M.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,M.jsxs)(`div`,{className:`detail-doc`,children:[(0,M.jsx)(u,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,M.jsx)(`div`,{className:`card pad-md mb-18`,children:n.map(([e,t])=>(0,M.jsxs)(`div`,{className:`kv`,children:[(0,M.jsx)(`span`,{className:`k`,children:e}),(0,M.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,M.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,M.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(d,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(d,{name:`external`}),`File an issue`]}),(0,M.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,M.jsx)(d,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function ie({data:e,error:t,overview:n,onAction:r}){if(t)return(0,M.jsx)(h,{error:t,style:{margin:18}});if(!e)return(0,M.jsx)(i,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,M.jsx)(F,{page:e,overview:n,onAction:r});case`map`:return(0,M.jsx)(K,{page:e,overview:n,onAction:r});case`cli`:return(0,M.jsx)(V,{page:e});case`glossary`:return(0,M.jsx)(H,{page:e});case`about`:return(0,M.jsx)(re,{page:e});default:return(0,M.jsx)(b,{title:`Unknown page kind`,children:e.kind})}}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ae({page:e,overview:t,onAction:n}){let[u,d]=o(a(t?.emit)),{data:y,error:b}=s(()=>r.docs(u),[u]),w=e||Q(y),{data:T,error:E,loading:O}=s(()=>w?r.docsPage(w,u):Promise.resolve(null),[w,u]),{data:k}=s(()=>r.docsPage(`glossary`,u).catch(()=>null),[u],`docs:glossary`);(0,D.useEffect)(()=>{if(y&&w&&!y.groups.some(e=>e.pages.some(e=>e.id===w))){let e=Q(y);e&&e!==w&&window.location.replace(f(e))}},[y,w]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[w]);let A=ee(y,w),j=A.part||y?.groups?.[0]||null,N=j?.id===v;(0,D.useEffect)(()=>{N&&T?.id===w&&_(w)},[N,T,w]);let P=N?[...p(),w]:[],[F,I]=(0,D.useState)(``),[L,R]=(0,D.useState)(`all`),[z,B]=(0,D.useState)(j?.id);j?.id!==z&&(B(j?.id),I(``),R(`all`));let V=$(j),H=ne(V),U=L===`all`?V:V.filter(e=>e.group===L),W=x(U,F);return b?(0,M.jsx)(h,{error:b}):(0,M.jsx)(`div`,{className:`docs-wrap`,children:(0,M.jsxs)(`div`,{className:`library docs-lib`,children:[(0,M.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,M.jsxs)(`div`,{className:`lib-title`,children:[(0,M.jsx)(`p`,{className:`h`,children:`Docs`}),(0,M.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,M.jsx)(c,{"aria-label":`Harness`,children:l.map(e=>(0,M.jsx)(`button`,{className:u===e.id?`on`:``,onClick:()=>d(e.id),"aria-pressed":u===e.id,children:e.label},e.id))}),(0,M.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(y?.groups||[]).map(e=>(0,M.jsxs)(D.Fragment,{children:[(0,M.jsxs)(`a`,{href:e.pages[0]?f(e.pages[0].id):`#/docs`,className:j?.id===e.id?`on`:``,"aria-current":j?.id===e.id?`page`:void 0,children:[e.label,(0,M.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),j?.id===e.id&&(0,M.jsx)(C,{label:`Sections`,total:V.length,cats:H,cat:L,onChange:R})]},e.id))})]}),(0,M.jsx)(te,{label:j?.label||`Docs`,count:F.trim()?`${W.length} of ${U.length}`:U.length||``,extra:N&&(0,M.jsx)(m,{pages:j.pages,seen:P}),q:F,onQ:I,matched:W.length,inView:[j?.id,w],children:y?(0,M.jsx)(S,{rows:W,activeName:w,hrefOf:e=>f(e.name),pills:N?e=>P.includes(e.name)&&e.name!==w?(0,M.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,M.jsx)(i,{label:`Loading docs…`})}),(0,M.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[A.page&&(0,M.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,M.jsx)(`a`,{href:f(A.part.pages[0].id),children:A.part.label}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,M.jsx)(`a`,{href:f(A.part.pages.find(e=>(e.section||`General`)===A.section).id),children:A.section}),(0,M.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,M.jsx)(`span`,{"aria-current":`page`,children:A.page.title})]}),(0,M.jsxs)(`div`,{className:`docs-read`,children:[(0,M.jsxs)(`div`,{className:`docs-article`,children:[(0,M.jsx)(ie,{data:O?null:T,error:E,overview:t,onAction:n},`${w}|${u}`),!O&&(0,M.jsx)(g,{menu:y,pageId:w})]}),!O&&(0,M.jsx)(Z,{page:T,glossaryRows:k?.rows})]})]})]})})}export{ae as default,$ as docRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{n,r}from"./sections-ChwaobfW.js";import{K as i,U as a,V as o,rt as s}from"./index-Dwo3Gxek.js";import{n as c,r as l,t as u}from"./jobBuckets-Dpjvbfm1.js";import{i as d,n as f,r as p}from"./Dashboard-BZmw2a7d.js";e();var m=t(),h=12,g=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],_=650;function v({segments:e,size:t=186,stroke:n=26,caption:r=`capabilities`}){let i=e.reduce((e,t)=>e+t.n,0);return(0,m.jsxs)(`div`,{className:`ring-box`,children:[(0,m.jsx)(d,{segments:e,size:t,stroke:n,label:r,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(s,{value:i,duration:_})}),(0,m.jsx)(`div`,{className:`donut-c-cap`,children:r})]})]})}function y(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function b({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=y(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,m.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,m.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function x({label:e,value:t,sub:n,color:r,icon:i}){return(0,m.jsxs)(`div`,{className:`b-tile`,children:[(0,m.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,m.jsx)(o,{name:i})}),(0,m.jsxs)(`div`,{className:`b-tile-body`,children:[(0,m.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,m.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,m.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function S({overview:e,sigil:t,jobs:d,lens:_,onAction:y}){let S=e.counts||{},C=_?.doctor?.state||`loading`,w=_?.doctor?.data?.groups||[],T=C===`ok`,E=w.filter(e=>e.problems.length===0).length,D=w.length,O=p(e,_?.tone),k=l(d,h),A=a(e.diff),j=r.filter(e=>(S[e]||0)>0).map((e,t)=>({key:e,label:n[e].label,n:S[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),M=j.reduce((e,t)=>e+t.n,0),N=u(d||[],10),P=N.reduce((e,t)=>e+t.v,0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`b-greet`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,m.jsx)(`h2`,{className:`h b-h`,children:O}),(0,m.jsx)(f,{verdict:_?.verdict}),(0,m.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,m.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,m.jsxs)(`div`,{className:`card b-hero`,children:[(0,m.jsx)(`div`,{className:`b-hero-ring`,children:(0,m.jsx)(v,{segments:[{key:`pass`,label:`pass`,n:E,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(D-E,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,m.jsxs)(`div`,{className:`b-hero-side`,children:[(0,m.jsx)(`h3`,{className:`b-hero-title`,children:T?`${E} of ${D} checks pass`:C===`failed`?`Doctor did not answer`:`Checking…`}),C===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>y(`doctor`),children:[(0,m.jsx)(o,{name:`doctor`}),`Run doctor`]}),(0,m.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,m.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),T&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:w.map(e=>{let t=e.problems.length===0;return(0,m.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,m.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,m.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,m.jsxs)(`div`,{className:`b-chips`,children:[(0,m.jsxs)(`span`,{className:`b-chip`,children:[(0,m.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,m.jsx)(`span`,{className:`b-chip`,children:(0,m.jsx)(`b`,{children:e.emit})}),(0,m.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,m.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,m.jsxs)(`div`,{className:`b-tiles`,children:[(0,m.jsx)(x,{label:`Agents`,value:S.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:S.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:S.laws??`—`,sub:S.doctrines?`${S.doctrines.active}/${S.doctrines.total} packs · ${S.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Edits`,value:A,sub:`to graft`,color:g[3],icon:`changes`})]})]}),(0,m.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,m.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Capability mix`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[M,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:j,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:j.map(e=>(0,m.jsxs)(`div`,{className:`b-leg-row`,children:[(0,m.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,m.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,m.jsx)(`span`,{className:`b-leg-bar`,children:(0,m.jsx)(`i`,{style:{width:`${e.n/M*100}%`,background:e.color}})}),(0,m.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent runs`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`badge ok`,children:[(0,m.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,m.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,m.jsx)(`span`,{className:`b-stat-big`,children:(0,m.jsx)(s,{value:P})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,T&&D>0&&` · ${E}/${D} checks pass now`]})]}),(0,m.jsx)(b,{data:N,accent:g[0],height:156})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent activity`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[`last `,k.length,` runs`]})})]}),(0,m.jsxs)(`div`,{className:`b-timeline`,children:[k.map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`,r=c(e);return(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,m.jsxs)(`div`,{className:`b-tl-body`,title:r.command||void 0,children:[(0,m.jsx)(`b`,{children:r.verb}),[r.scope,r.result,r.duration].map(e=>e?` · ${e}`:``).join(``)]}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:e.started?`${i(e.started)} ago`:`—`})]},e.id)}),(!d||d.length===0)&&(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node`}),(0,m.jsx)(`div`,{className:`b-tl-body sub`,children:`No runs yet. Trigger an action to populate this.`}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:`—`})]})]})]})]})}export{S as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,B as a,H as o,J as s,K as c,L as l,M as u,N as d,Q as f,R as p,T as m,U as h,V as g,X as _,Y as v,Z as y,et as b,it as x,j as S,k as C,z as w}from"./index-Dwo3Gxek.js";import{t as T}from"./EmptyState-1sPNleqv.js";import{t as E}from"./Tabs-2uMB511T.js";import{a as D,c as O,n as k,o as A,r as j,s as M,t as N}from"./KitApply-BR8AcZ62.js";import{n as P}from"./StackBar-Y_gkoC3t.js";var F=e(t(),1),I=n();function L({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[u,d]=(0,F.useState)(!1),[f,m]=(0,F.useState)(``),h=(e,t)=>c(n=>({...n,[e]:t})),g=async()=>{d(!0),o(``);try{let e=await r.pickFolder();e.path?(h(`path`,e.path),m(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{d(!1)}},_=async()=>{let e=s.path.trim();if(!e){m(`Choose or type a folder to deploy into.`);return}m(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{h(`path`,e.target.value),m(``)},onKeyDown:e=>e.key===`Enter`&&_(),"aria-label":`Folder to deploy into`,"aria-invalid":f?!0:void 0,"aria-describedby":f?`dp-path-err`:void 0}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:u,onClick:g,children:u?`Choosing…`:`Browse…`})]}),f?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:f}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>h(`host`,e.target.value),children:l.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(M,{value:s,options:n,onChange:h,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:_,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:p(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function R(){let{data:e,error:t,reload:n}=s(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,c]=(0,F.useState)([]),l=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);c(n.messages||[])}catch(e){c(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>p(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>l(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await l(`add`,e.path):e.error&&c([e.error])}catch(e){c([e.message])}finally{a(!1)}},children:[(0,I.jsx)(g,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function z({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var B={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ee({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:m}){let h=`${p(e.host).label} · ${e.scope}`,[g,_]=B[e.state]||B.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${h} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:w(e)}),(0,I.jsx)(`span`,{className:`tag ${_}`,children:g})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${p(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:p(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(M,{value:n,options:i,onChange:a,who:h})}):null,v&&t.length?(0,I.jsx)(z,{targets:t,onReveal:m}):null,v&&e.scope===`global`?(0,I.jsx)(R,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(O,{on:v,disabled:s,label:`activate ${h}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${h} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var V=(e,t)=>`${e} ${t}`,te=[`claude`,`bob`,`openclaude`],H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]};function ne(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?h(e.drift):0;return i?`${r} · ${i} edited`:r}function re({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?h(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(P,{label:`Sync with source of ${w(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,I.jsx)(`span`,{className:`dim`,children:ne(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=H[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:w(e)})}),t?(0,I.jsx)(`td`,{children:p(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`tag ${c}`,children:i})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(re,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function U({onAction:e,themes:t=[],currentTheme:n,overview:o,setup:c,dataRev:l,onMutated:u}){let f=d(),{data:m,error:h,reload:_}=s(()=>r.installs(),[l]),{data:v,error:y,reload:b}=s(()=>r.mcp(),[l]),{data:x,error:S}=s(()=>r.fleet(),[l]),w=S?null:x??void 0,[E,D]=(0,F.useState)(null),[O,k]=(0,F.useState)(``),[j,M]=(0,F.useState)({}),[N,P]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),B=e=>R.id===e?.id?R.value:`keep`,[H,ne]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=V(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(h||y)return(0,I.jsx)(C,{error:h||y,onRetry:()=>{_(),b()}});if(!m||!v)return(0,I.jsx)(i,{});let U={active:0,disabled:1,absent:2},W=[...m.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(U[e.state]??3)-(U[t.state]??3)),G=W.find(e=>e.id===H)||W.find(e=>e.selected)||W.find(e=>e.state===`active`)||W[0],K=e=>{let t=j[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},se=(e,t,n)=>M(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),q=e=>{let t=K(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:A,posture:m.postures||[],mode:m.modes||[],trust:m.trusts||[]},ce=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=K(t),s=p(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,l=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await f(l,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},le=async e=>{if(e.state!==`active`||await f(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){k(e.id),D(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;D({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}u?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&te.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ue=async e=>{let t=B(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await f(`Uninstall ${p(e.host).label} · ${e.scope}? It deletes ${a(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){k(e.id),D(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){D({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&D({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),u?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},de=async e=>{D(null);try{let t=await r.mcpReveal(e.path);D({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){D({text:e.message,tone:`bad`})}},fe=W.find(e=>e.selected)?.host||W.find(e=>e.state===`active`)?.host||W[0]?.host||`opencode`,X=W.filter(e=>e.scope===`global`),Z=W.filter(e=>e.scope!==`global`),Q=e=>{ne(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}u?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[W.filter(e=>e.state===`active`).length,` active of `,W.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>e(`build-all`),children:[(0,I.jsx)(g,{name:`refresh`}),` Rebuild all`]})}):null]}),E?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:E.text}):E?(0,I.jsx)(`p`,{className:`tag ${E.tone===`ok`?`ok `:``}note`,role:`status`,children:E.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:G?.id,onPick:Q,label:`Global installs`,fleet:w,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>P(e=>!e),children:[(0,I.jsx)(g,{name:`folder`}),` Deploy to a repo…`]}):null]}),N?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(L,{host:fe,theme:n||`neutral`,options:J,onAction:e,onClose:()=>P(!1),onNote:e=>D(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:G?.id,onPick:Q,label:`Per-project installs`,fleet:w,onEdits:$}):(0,I.jsx)(T,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:c,overview:o}),(0,I.jsx)(ae,{themes:t,current:o?.theme})]}),G?(0,I.jsx)(ee,{inst:G,targets:re[V(G.host,G.path)]||[],choice:K(G),unchanged:q(G),options:J,onPick:(e,t)=>se(G,e,t),canAct:!!e,busy:O===G.id,memory:B(G),onMemory:e=>z({id:G.id,value:e}),onApply:()=>ce(G),onToggleInstall:()=>le(G),onRemove:()=>ue(G),onRevealMcp:de},G.id):null]})}function W({onAction:e,dataRev:t}){let{data:n,error:a}=s(()=>r.kits(),[t]),o=D(n,e);return a||n?.error?(0,I.jsx)(C,{error:a||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=j(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(k,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[n.skills.length,` skills · `,n.agents.length,` agents`]})]}),(0,I.jsx)(O,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(N,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(i,{})}function G(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var K=300;function se({onMutated:e,onAction:t,dataRev:n,overview:a}){let o=d(),{data:c,error:l,reload:u}=s(()=>r.diff(),[n]),[f,p]=(0,F.useState)(!1),[m,h]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,b]=(0,F.useState)(()=>new Set),[x,S]=(0,F.useState)(null);if(c&&c!==x){S(c),v(new Set);let e=c.files.reduce((e,t)=>e+t.diff.length,0);b(new Set(e<=K?c.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),E=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>c.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
|
|
2
|
+
`)}\n\n`:``;if(await o(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){p(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;h(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await u(),e?.()}catch(e){h(e.message)}finally{p(!1)}}};if(l)return(0,I.jsx)(C,{error:l,onRetry:u});if(!c)return(0,I.jsx)(i,{});if(!c.deployed)return(0,I.jsx)(T,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!c.diffable)return(0,I.jsx)(T,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=c.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=c.files.filter(e=>e.status===`linked`),j=c.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,L=e=>b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),c.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:c.target}),c.theme?` (${c.theme} voice)`:``,` with source`,` `,a?.version||`unknown`,`.`]}):null,M>0?(0,I.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||_.size===0,onClick:O,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,I.jsx)(g,{name:`download`}),`Export improvements`]})]})]}),m?(0,I.jsx)(`p`,{className:`sub mb-14`,children:m}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
|
|
3
|
+
`),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(T,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>b(new Set(c.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>b(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:_.size===k.length,onChange:E}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>R(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=y.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(g,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${G(e)}`,children:e},t))})]},e.rel)}}function q({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(g,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function J({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:a,reload:o,setData:c}=s(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),l=()=>{t.current=!0,c(null),o()};if(a)return(0,I.jsx)(C,{error:a,onRetry:o});let u=n?n.groups.filter(e=>e.problems.length):[],d=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`narrow`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:l,disabled:!n,children:[(0,I.jsx)(g,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,I.jsx)(q,{group:e,i:t},e.label)),d.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,I.jsx)(q,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,I.jsx)(i,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ce(){let e=d(),[t,n]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(C,{error:i}),(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){a(null);try{await r.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,I.jsx)(g,{name:`x`}),`Stop server`]})]})}function le(){let e=d(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(C,{error:r}),(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await y()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(g,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Y=`https://github.com/Arylmera/Geneseed`,ue=`https://github.com/Arylmera`,de=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],fe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q(){let e=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:x()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:de.map(([t,n])=>(0,I.jsx)(`button`,{type:`button`,className:t===`danger`?`t-bad`:``,onClick:()=>e(t),children:n},t))})}function $({version:e}){let[t,n]=(0,F.useState)(Y),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(g,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(g,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(g,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(g,{name:`external`}),`MIT License`]})]})]}),children:(0,I.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:ue,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(g,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function pe({overview:e,onAction:t,flavour:n,onFlavour:r,accentMode:i,onAccentMode:a,layout:o,onLayout:s}){let l=d(),m=e?.install,h=e?.footprint,y=e?.server,x=e?.daemon_stale,C=async e=>{m&&e!==h&&await l(`Rebuild ${p(m.host).label} · ${m.scope} with the “${e}” footprint? It rebuilds in place, non-destructive.`,{title:`Change the footprint?`,confirmLabel:`Rebuild`})&&t?.(`install`,{...m,footprint:e})},w=y?.autostart===!0?`On · login script`:y?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:b.server}),(0,I.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]})}),(0,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[i&&a&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(S,{value:i,onChange:a,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:_(i)})]}),o&&s&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(u,{"aria-labelledby":`dir-layout-label`,children:v.map(e=>(0,I.jsx)(`button`,{className:o===e.id?`on`:``,onClick:()=>s(e.id),"aria-pressed":o===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:v.find(e=>e.id===o)?.tagline??``})]}),n&&r&&(0,I.jsx)(X,{k:`Console direction`,help:`${f.length} takes on the same data; applies instantly`,children:(0,I.jsx)(`div`,{className:`dir-grid`,children:f.map(e=>(0,I.jsxs)(`button`,{className:`dir-tile dir-${e.id} ${n===e.id?`on`:``}`,onClick:()=>r(e.id),"aria-pressed":n===e.id,children:[(0,I.jsxs)(`span`,{className:`dir-thumb`,"aria-hidden":`true`,children:[(0,I.jsx)(`span`,{className:`dir-thumb-rail`}),(0,I.jsx)(`span`,{className:`dir-thumb-bar`}),(0,I.jsx)(`span`,{className:`dir-thumb-bar w70`}),(0,I.jsx)(`span`,{className:`dir-thumb-bar w52`}),(0,I.jsx)(`span`,{className:`dir-thumb-dot`})]}),(0,I.jsxs)(`span`,{className:`dir-meta`,children:[(0,I.jsxs)(`span`,{className:`dir-name`,children:[e.short,n===e.id&&(0,I.jsx)(`span`,{className:`dir-check`,children:`● active`})]}),(0,I.jsx)(`span`,{className:`dir-tag`,children:e.tagline})]})]},e.id))})})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:(0,I.jsxs)(`button`,{className:`btn`,onClick:()=>t(`update`),children:[(0,I.jsx)(g,{name:`download`}),`Update (git pull + rebuild)`]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(g,{name:`external`}),`Add to PATH`]})}),m&&h&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`footprint-label`,children:`Harness footprint`}),help:(0,I.jsxs)(I.Fragment,{children:[`For `,p(m.host).label,` · `,m.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),children:[(0,I.jsx)(u,{"aria-labelledby":`footprint-label`,children:[`lean`,`full`].map(e=>(0,I.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>C(e),"aria-pressed":h===e,children:e},e))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:h===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,I.jsxs)(Z,{id:`server`,title:`Server`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,y?` · pid ${y.pid} · up ${c(y.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(le,{}),children:x?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:w})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:fe.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ce,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function me({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:s,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?o(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(m,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(E,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(U,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:s,onMutated:a}),e===`kits`&&(0,I.jsx)(W,{onAction:i,dataRev:s}),e===`edits`&&(0,I.jsx)(se,{onMutated:a,onAction:i,dataRev:s,overview:t}),e===`doctor`&&(0,I.jsx)(J,{dataRev:s}),e===`server`&&(0,I.jsx)(pe,{overview:t,onAction:i,...c})]})}export{me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{t as i}from"./drawable-ixCquffB.js";import{n as a}from"./sections-ChwaobfW.js";import{Ct as o,Dt as s,Et as c,It as l,J as u,K as d,Nt as f,Ot as p,Pt as m,St as h,Tt as g,_t as _,at as v,bt as y,ct as b,dt as x,ft as S,gt as C,ht as w,it as T,jt as E,kt as D,lt as O,mt as k,pt as A,q as j,tt as M,ut as N,vt as P,wt as F,x as I,xt as ee,yt as L}from"./index-Dwo3Gxek.js";import{n as R}from"./Dashboard-BZmw2a7d.js";function z(e){return ee((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function B(e,t,n,r,i,a){let o=F(e.duration)&&e.duration<=1e-11?n-m:n;t.composition&&P(t,o,1,1,l.AUTO);let s=r?new x(r,e,t,o,!1,i,a):new w(e,t,o);return t.composition&&s.init(!0),y(t,s),h(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=z(t),t}var V=0,H=class extends w{constructor(e={}){super(e,null,0),++V,this.id=s(e.id)?V:e.id,this.duration=0,this.labels={};let t=e.defaults,n=E.defaults;this.defaults=t?p(t,n):n,this.composition=L(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=L(e.playbackEase,n.playbackEase);this._ease=r?A(r):null,this.iterationDuration=0}add(e,t,n){let r=g(t),i=g(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=E.editor&&E.editor.addTimelineChild,a=n&&n.type===`Stagger`&&E.editor,c=o(n)?n:null;if(c||a){let t=k(e),a=this.duration,o=this.iterationDuration,l=r.id,u=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=c||E.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,s(l)||(n.id=l+`-`+u);let i=N(this,p(e,u,t,null,this));B(n,this,i,e,u,t),u++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;B(t,this,N(this,a),e)}}else B(e,this,N(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(s(e)||e&&s(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!s(e)&&!s(e.persist)&&(e.persist=!0);let r=E.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return s(t)?this:(t.duration=m,t.composition=f.replace,this.add(e,t,n))}call(e,t){return s(e)||e&&!o(e)?this:(E.editor&&E.editor.addTimelineCall&&(t=E.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return s(e)||e&&!c(e)?this:(E.editor&&E.editor.addTimelineLabel&&(t=E.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=N(this,t),this)}remove(e,t){return C(k(e),this,t),this}stretch(e){let t=this.duration;if(t===D(e))return this;let n=e/t,r=this.labels;h(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return h(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),h(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},U=e=>E.editor?E.editor.addTimeline(e):new H(e).init(),W=e(t(),1),G=n(),K=.62,q=(e,t)=>String(e).length*t*K;function J(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=q(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function Y(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var X=!1,Z=!1,Q=850;function $({hash:e,label:t,part:n,children:r}){return(0,G.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>M(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),M(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=u(()=>r.catalog(`laws`),[t],`catalog:laws`),a=n?.items??null,o=n?.nouns?.ontology||`Ethos`,s=n?.nouns?.laws||`Dictates`,c=n?.nouns?.doctrines||`Doctrines`,l=(0,W.useRef)(null),d=(0,W.useRef)(!0),f=(0,W.useRef)(null);(0,W.useLayoutEffect)(()=>{let e=l.current;if(!e||X||!T())return;X=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),a=t(`[data-cm="gov"]`),o=t(`.cm-edge-gov`),s=t(`.cm-note, .cm-govern-label`),c=i(t(`.cm-edge`));O([...n,...r,...a],{opacity:0,scale:.7}),O([...o,...s],{opacity:0}),O(c,{draw:`0 0`});let u=U({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(c,{draw:`0 1`,duration:380,delay:b(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:b(70)},260).add(o,{opacity:1,duration:300,delay:b(50)},420).add(a,{opacity:1,scale:1,duration:380,delay:b(50)},470).add(s,{opacity:1,duration:300},520);d.current=!1;let p=()=>u.complete(),m=()=>{u.play(),p=v(u,Q),d.current=!0,f.current?.()};if(typeof IntersectionObserver>`u`)return m(),()=>p();let h=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(h.disconnect(),m())},{threshold:.33});return h.observe(e),()=>{h.disconnect(),d.current=!0,p()}},[]);let p=e?.counts||{},m=j(p),h=[];for(let e of(a||[]).filter(e=>e.tier===`doctrine`)){let t=h.find(t=>t.id===e.pack);t||h.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let g=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,_={x:330,y:165,r:J([{t:`Constitution`,size:17,dy:-12},{t:`${m} rules in force`,size:10,dy:8},{t:g,size:8.5,dy:24}],12)},y={x:126,y:95,r:J([{t:o,size:12.5,dy:-7},{t:`${p.ontology??0} sections`,size:10,dy:10}],11)},x={x:560,y:78,r:J([{t:s,size:12.5,dy:-6},{t:`${p.laws??0}`,size:13,dy:12}],11)},C={x:560,y:252,r:J([{t:c,size:12.5,dy:-6},{t:`${p.doctrines?.rules??0}`,size:13,dy:12}],11)},w=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:J([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),E=[{...w(812,52,`Skills`,p.skills??0),hash:`#/skills`,from:x},{...w(820,126,`Agents`,p.agents??0),hash:`#/agents`,from:x},{...w(816,232,`Memory`,p.memory??0),hash:`#/section/memory`,from:C},{...w(812,300,`Wiki`,p.wiki??0),hash:`#/section/wiki`,from:C}],D={rx:122,ry:68,from:212,to:112},k=h.map((e,t)=>{let n=(h.length===1?(D.from+D.to)/2:D.from+(D.to-D.from)*t/(h.length-1))*Math.PI/180;return{...e,x:C.x+D.rx*Math.cos(n),y:C.y+D.ry*Math.sin(n),r:J([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),A=k.length;return(0,W.useLayoutEffect)(()=>{let e=l.current;if(!e||!A||Z||!T())return;Z=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];O(t,{opacity:0,scale:.5});let n=()=>O(t,{opacity:1,scale:1}),r=()=>{f.current=null;let e=S(t,{opacity:1,scale:1,duration:380,delay:b(45,{start:420}),ease:`outExpo`});n=v(e,420+45*A+380)};return d.current?r():f.current=r,()=>{f.current=null,n()}},[A]),(0,G.jsxs)(`svg`,{ref:l,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,G.jsx)(`path`,{d:Y(_,y,.05),className:`cm-edge`}),(0,G.jsx)(`path`,{d:Y(_,x,-.07),className:`cm-edge`}),(0,G.jsx)(`path`,{d:Y(_,C,.07),className:`cm-edge`}),E.map(e=>(0,G.jsx)(`path`,{d:Y(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,G.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${m} rules in force`,children:[(0,G.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-hub-disc`}),(0,G.jsx)(`text`,{x:_.x,y:_.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,G.jsxs)(`text`,{x:_.x,y:_.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[m,` rules in force`]}),(0,G.jsx)(`text`,{x:_.x,y:_.y+24,textAnchor:`middle`,className:`cm-note`,children:g})]}),(0,G.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${p.ontology??0} sections`,children:[(0,G.jsx)(`circle`,{cx:y.x,cy:y.y,r:y.r,className:`cm-sat-disc`}),(0,G.jsx)(`text`,{x:y.x,y:y.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,G.jsxs)(`text`,{x:y.x,y:y.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[p.ontology??0,` sections`]})]}),(0,G.jsx)(`text`,{x:y.x,y:y.y+y.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,G.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${p.laws??0}, never broken`,children:[(0,G.jsx)(`circle`,{cx:x.x,cy:x.y,r:x.r,className:`cm-sat-disc`}),(0,G.jsx)(`text`,{x:x.x,y:x.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,G.jsx)(`text`,{x:x.x,y:x.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:p.laws??0})]}),(0,G.jsx)(`text`,{x:x.x,y:x.y+x.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,G.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${c}: ${p.doctrines?.rules??0} rules chosen at build`,children:[(0,G.jsx)(`circle`,{cx:C.x,cy:C.y,r:C.r,className:`cm-sat-disc`}),(0,G.jsx)(`text`,{x:C.x,y:C.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:c}),(0,G.jsx)(`text`,{x:C.x,y:C.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:p.doctrines?.rules??0})]}),(0,G.jsx)(`text`,{x:C.x+22,y:C.y+C.r+20,className:`cm-note`,children:p.doctrines?`chosen at build · ${p.doctrines.active}/${p.doctrines.total} packs lit`:`chosen at build`}),(0,G.jsx)(`g`,{className:`cm-mini`,children:k.map(e=>(0,G.jsxs)(`g`,{children:[(0,G.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:I(e.id)}}),(0,G.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,G.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:I(e.id)},children:e.on})]},e.id))}),(0,G.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),E.map(e=>(0,G.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,G.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,G.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,G.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,G.jsx)(`text`,{x:y.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:a.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:j(e),hash:`#/laws`},{label:a.agents.label,n:e.agents??0,hash:`#/agents`},{label:a.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:a.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:a.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:a.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,G.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,G.jsxs)(`div`,{className:`card-head`,children:[(0,G.jsx)(`h3`,{children:`Growth rings`}),(0,G.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,G.jsxs)(`button`,{className:`jr-ring`,onClick:()=>M(e.hash),children:[(0,G.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,G.jsx)(`span`,{className:`jr-ring-track`,children:(0,G.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,G.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,G.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,G.jsxs)(`div`,{className:`card-head`,children:[(0,G.jsx)(`h3`,{children:`Freshly grown`}),(0,G.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,G.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,G.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>M(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,G.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,G.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,G.jsx)(`span`,{className:`jr-fresh-when`,children:d(e.mtime)})]},`${e.section}:${e.name}`)):(0,G.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,G.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,G.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${d(t)}`:`Never built here`,` ·`,` `,(0,G.jsx)(`button`,{className:`jr-go`,onClick:()=>M(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{className:`head-row jr-head`,children:(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,G.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,G.jsx)(R,{verdict:n?.verdict})]})}),(0,G.jsxs)(`div`,{className:`jr-row2`,children:[(0,G.jsx)(re,{counts:a}),(0,G.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,G.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,G.jsxs)(`div`,{className:`card-head`,children:[(0,G.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,G.jsx)(`button`,{className:`jr-go right`,onClick:()=>M(`#/laws`),children:`open →`})]}),(0,G.jsx)(te,{overview:e,dataRev:i})]}),(0,G.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,G.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,G.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{D as r,E as i,N as a}from"./index-Dwo3Gxek.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=a(),s=r(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e));return{setOf:u,toggle:(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},change:e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:e=>s.running(`kits`,e.id)||!!c(e)?.applied,failed:e=>!!c(e)?.failed}}function g({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e),o=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `),c=t.failed(e)?`Last rebuild failed — see console`:``,l=a?`Rebuilding…`:[c,o].filter(Boolean).join(` · `)||`No staged changes`;return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:l}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a,onClick:()=>t.apply(e),children:`Apply`})]})}var _={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},v=({row:e})=>{let[t,n]=_[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{h as a,u as c,p as i,v as n,l as o,m as r,f as s,g as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,J as a,k as o}from"./index-Dwo3Gxek.js";import{t as s}from"./EmptyState-1sPNleqv.js";import{a as c,n as l,o as u,r as d,t as f}from"./RailCats-DNlJKicm.js";import{t as p}from"./Markdown-OReRRoEV.js";import{a as m,c as h,i as g,n as _,r as v,t as y}from"./KitApply-BR8AcZ62.js";var b=e(t(),1),x=n(),S=encodeURIComponent,C=`Enabled`,w=`Not enabled`,T=e=>(e||``).split(/\s+/).filter(Boolean).length,E=e=>[...new Set(e.filter(Boolean))],D=e=>(e||``).slice(0,7);function O(e,t){return[C,w].flatMap(n=>e.map(e=>({k:e,on:t.filter(t=>g(t).includes(e.name))})).filter(({on:e})=>e.length>0==(n===C)).map(({k:e,on:t})=>{let r=e.credits||[],i=E(r.map(e=>e.author||e.repo)).join(`, `),a=E(r.map(e=>e.license)).join(`, `);return{name:e.name,desc:e.description,group:n,def:e,meta:[`${(e.skills||[]).length} skills · ${(e.agents||[]).length} agents · ${T(e.rules)} rule words`,t.length?`on in ${t.map(e=>`${e.host} · ${e.scope}`).join(`, `)}`:null,i?`from ${i}${a?` (${a})`:``}`:null].filter(Boolean).join(` — `)}}))}var k=({type:e,names:t,listed:n})=>t.length?(0,x.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,x.jsx)(`li`,{children:n?.has(t)?(0,x.jsx)(`a`,{href:`#/item/${e}/${S(t)}`,children:t}):(0,x.jsx)(`span`,{className:`kit-link-off`,title:`Installed when this kit is on`,children:t})},t))}):(0,x.jsx)(`p`,{className:`panel-note`,children:`None.`});function A({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`reader-tags`,children:[(0,x.jsx)(`span`,{className:`tag acc`,children:`Kit`}),E(i.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,x.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,x.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,x.jsx)(`hr`,{className:`hr`}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,x.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=v(t),i=`${t.host} · ${t.scope}`;return(0,x.jsxs)(`li`,{className:`kit-install`,children:[(0,x.jsxs)(`div`,{className:`kit-row`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:i}),(0,x.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,x.jsx)(_,{row:t}),(0,x.jsx)(h,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,x.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,x.jsx)(y,{row:t,stage:n})]},t.id)})}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,x.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`dt`,{children:e.author||e.repo}),(0,x.jsxs)(`dd`,{children:[(0,x.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,x.jsxs)(`span`,{className:`mono dim`,children:[`@ `,D(e.commit)]}):null,e.compareUrl?(0,x.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${D(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,x.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,x.jsx)(k,{type:`skill`,names:e.skills||[],listed:r?.skills}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,x.jsx)(k,{type:`agent`,names:e.agents||[],listed:r?.agents}),e.rules?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,x.jsxs)(`span`,{className:`mono dim`,children:[T(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,x.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,x.jsx)(p,{body:e.rules})})]}):null,e.banned?.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,x.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}function j({item:e,onAction:t,dataRev:n}){let{data:p,error:h}=a(()=>r.kits(),[n]),g=m(p,t),[_,v]=(0,b.useState)(``),[y,C]=(0,b.useState)(`all`),w=p?.kits||[],T=p?.installs||[],E=O(w,T),D=y===`all`?E:E.filter(e=>e.group===y),k=u(D,_),j=!!e&&!!p&&!E.some(t=>t.name===e),M=j?null:E.find(t=>t.name===e)||E[0]||null,{data:N}=a(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),P=h||p?.error,F=E.length>=8?l(E):[];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(o,{error:P,style:{margin:`0 0 var(--sp-3)`}}),(0,x.jsxs)(`div`,{className:`library`,children:[(0,x.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Kits sections`,children:[(0,x.jsxs)(`div`,{className:`lib-title`,children:[(0,x.jsx)(`h1`,{className:`h`,children:`Kits`}),(0,x.jsx)(`span`,{className:`dim`,children:`Optional bundles`})]}),F.length>1?(0,x.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:(0,x.jsx)(f,{label:`Status`,total:E.length,cats:F,cat:y,onChange:C})}):null]}),(0,x.jsx)(c,{label:`Kits`,count:_.trim()?`${k.length} of ${D.length}`:p?D.length:``,q:_,onQ:v,matched:k.length,inView:[e],children:p?E.length===0?P?null:(0,x.jsx)(s,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,x.jsx)(d,{rows:k,activeName:M?.name,hrefOf:e=>`#/kits/${S(e.name)}`}):P?null:(0,x.jsx)(i,{})}),(0,x.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:j?(0,x.jsxs)(s,{title:`No such kit`,action:(0,x.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):M?(0,x.jsx)(A,{kit:M.def,installs:T,stage:g,listed:N},M.name):null})]})]})}export{j as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,C as a,D as o,E as s,J as c,M as l,N as u,T as d,_ as f,d as p,f as m,g as h,h as g,k as _,m as v,p as y,tt as b,v as x}from"./index-Dwo3Gxek.js";import{t as ee}from"./EmptyState-1sPNleqv.js";import{a as te,t as S}from"./Markdown-OReRRoEV.js";import{t as C}from"./StackBar-Y_gkoC3t.js";var w=e(t(),1);function T({items:e,packs:t,install:n,canApply:r,onAction:i,gateArmed:a}){let c=u(),l=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),d=l.join(`,`),f=o(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=s(l),{prune:h}=f,g=e.length>0;(0,w.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===p&&t.base!==m)},[g,p,m,h]);let _=f.get(`rules`,p),v=_&&_.base===m?_.value:l,y=e=>f.put(`rules`,p,e(v),m),b=e=>v.includes(e),x=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),ee=e=>e.rules.some(e=>b(e.addr)),te=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},S=e=>{let t=e.rules.filter(e=>b(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},C=t.flatMap(e=>e.rules.map(e=>e.addr)),T=C.filter(b),E=T.join(`,`)!==d,D=`process.5`,O=l.includes(D)&&!v.includes(D);return{deployedRules:l,isOn:b,toggleRule:x,packOn:ee,togglePack:te,packState:S,allRules:C,pickedRules:T,dirty:E,losingConsent:O,applyPacks:async()=>{if(!r||!E)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),o=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),s=O?`
|
|
2
2
|
|
|
3
|
-
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(s?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=T.length?`${T.length} of ${C.length} doctrine rules`:`no doctrine rules`;await c(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${a}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await o(`install`,{...n,doctrines:e,excludeRules:i})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var E=n();function D({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:c,rev:l,toggleCol:u=null,renderBody:d,srcLine:f}){let p=(0,w.useId)(),{data:m,error:h,reload:g}=y(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),_=t&&(0,E.jsxs)(`div`,{className:`law-expand`,id:p,children:[h?(0,E.jsx)(s,{error:h,onRetry:g}):m?d(m):(0,E.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,E.jsx)(`div`,{className:`law-srcline`,children:f})]}),v={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":p,"aria-label":c};return u?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,E.jsx)(`button`,{className:`law-disclosure`,...v,children:o}),(0,E.jsx)(`span`,{className:`toggle-col`,children:u})]}),_]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:i,style:a,"data-addr":e,...v,children:o}),_]})}function O({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null}){let a=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`law-no`,children:[(0,E.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,E.jsxs)(`span`,{className:`law-name`,children:[(0,E.jsx)(`span`,{children:e.name}),e.ess?(0,E.jsx)(`span`,{className:`law-princ`,children:e.ess}):null]}),(0,E.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,E.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,E.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,E.jsx)(D,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:a,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,E.jsx)(S,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`})}var k=[`invariants`,`doctrines`];function ne({tiers:e,current:t,onPick:n}){return(0,E.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),(0,E.jsxs)(`span`,{className:`tier-top`,children:[(0,E.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,E.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,E.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,E.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,E.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,E.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,E.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&k.includes(e.key)?(0,E.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,E.jsx)(`div`,{className:a,children:i},e.key)})})}function re({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1}){let i=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(_(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),a=Math.max(1,...i.map(([,e])=>e));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i.length?(0,E.jsx)(`ul`,{className:`gate-list`,children:i.map(([e,r,i])=>{let o=_(e),s=t[o]?.name||o;return(0,E.jsxs)(`li`,{children:[(0,E.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,E.jsxs)(`span`,{className:`gate-top`,children:[(0,E.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:s}),(0,E.jsx)(`span`,{className:`mono dim`,children:o}),i&&(0,E.jsx)(`span`,{className:`mono off`,children:`off`}),(0,E.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,E.jsx)(C,{value:r,max:a,label:`${s} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,E.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,E.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function ie({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,losingConsent:l,revert:u}=t,d=Math.max(1,...e.map(e=>e.rules.length));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,E.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,E.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,E.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,E.jsx)(C,{value:t,max:d,label:`${e.title} rules on`}),(0,E.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>s(e)}):null]},e.pack)})}):(0,E.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,E.jsxs)(E.Fragment,{children:[l&&(0,E.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,E.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,E.jsx)(`code`,{children:`git commit`}),` and `,(0,E.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,E.jsx)(`div`,{className:`pack-apply`,children:(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:u,disabled:!c,children:`Revert`})}),(0,E.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:c?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}function ae(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=h(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:v(n.name),c:u[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function A({selected:e,overview:t,setup:n,onAction:a,dataRev:l}){let _=i(),{data:S,error:C}=y(()=>r.catalog(`laws`),[l],`catalog:laws`),{data:D}=c(l),[k,A]=(0,w.useState)(`all`),[j,oe]=(0,w.useState)(``),M=e||null,N=e=>f(M===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),[se,ce]=(0,w.useState)(0),P=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>{let t=document.querySelector(`[data-addr="${e}"]`);if(!t)return;let n=P.current===e;P.current=null;let r=t.getBoundingClientRect();if(n||r.top<80||r.bottom>window.innerHeight){let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`})}n&&(t.classList.remove(`law-flash`),t.offsetWidth,t.classList.add(`law-flash`))});return()=>cancelAnimationFrame(t)},[e,se,S]);let F=S?.items||[],I=ae(F),L=e=>t?.install?.[d[e].key]!==!1,R=L(`IV`),z=t?.install,B=!!(z&&a),V=T({items:F,packs:I,install:z,canApply:B,onAction:a,gateArmed:R}),{deployedRules:H,isOn:U,toggleRule:le,packOn:ue,packState:de,allRules:W}=V;if(C)return(0,E.jsx)(s,{error:C});if(!S)return(0,E.jsx)(g,{});let G={ontology:S.nouns?.ontology||`Ethos`,law:S.nouns?.law||`Dictate`,laws:S.nouns?.laws||`Dictates`,doctrines:S.nouns?.doctrines||`Doctrines`},K=F.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),q=F.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&m[e.klass]?e.klass:`craft`,r=h(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:v(e.name,t?.install),cat:n,c:m[n].c,off:r.retired,src:`laws/universal.md`}}),fe=e=>{let t=U(e.addr),n=H.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},pe=I.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!H.includes(e.addr)).map(e=>e.addr)),me=async e=>{if(!B)return;let{key:t,label:n}=d[e],r=n.toLowerCase(),i=!L(e),o=`${z.host} · ${z.scope}`,s=V.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await _((i?`Re-arm the ${r} on ${o}? ${b[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${o}? ${b[e].off} It rebuilds in place, non-destructive.`)+s,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&a(`install`,{...z,[t]:i})},J=j.trim().toLowerCase(),Y=e=>!J||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(J),he=e=>{let t=ye[e],n=String(e).includes(`.`);(n&&k===`invariants`||!n&&k===`doctrines`)&&A(`all`),t&&!Y(t)&&oe(``),P.current=e,ce(e=>e+1),f(`#/item/law/${encodeURIComponent(e)}`)},X=q.filter(e=>!e.retired).length,Z=H.length,Q=D?.stats,ge={ethos:{name:G.ontology,n:K.length,fill:1,sub:`${K.length} sections`},invariants:{name:G.laws,n:X,fill:q.length?X/q.length:0,sub:q.length>X?`${X} active · ${q.length-X} retired`:`${X} active`},doctrines:{name:G.doctrines,n:Z,fill:W.length?Z/W.length:0,sub:`${Z} rules · ${I.filter(e=>e.active).length} of ${I.length} packs`},yours:{name:`Your rules`,n:Q?.rules??0,fill:Q?Q.rules/Q.max_rules:0,sub:Q?`${Q.rules} of ${Q.max_rules} · ${Q.tokens}/${Q.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`}},_e=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,G.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},ve=p.map(e=>({key:e.key,...ge[e.key],rule:_e(e.against)})),ye=Object.fromEntries([...q,...I.flatMap(e=>e.rules)].map(e=>[e.addr,e])),be=[[`all`,`All`,q.length+W.length],[`invariants`,G.laws,q.length],[`doctrines`,G.doctrines,W.length]],xe=k===`all`||k===`invariants`,Se=k===`all`||k===`doctrines`,Ce=(e,t)=>(0,E.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,children:e}),(0,E.jsx)(`span`,{className:`mono dim`,children:t})]}),$=q.filter(Y),we=(xe?$.length:0)+(Se?I.reduce((e,t)=>e+t.rules.filter(Y).length,0):0);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(ee,{title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,primary:B&&I.length>0&&V.dirty?(0,E.jsxs)(`button`,{type:`button`,className:`btn`,onClick:V.applyPacks,children:[`Apply (`,V.pickedRules.length,`/`,W.length,` rules)`]}):null}),(0,E.jsx)(ne,{tiers:ve,current:k,onPick:A}),(0,E.jsxs)(`div`,{className:`split`,children:[(0,E.jsxs)(`section`,{className:`panel flush law-wrap${B?` with-toggle`:``}`,"aria-label":`Rules`,children:[K.length>0&&(0,E.jsxs)(E.Fragment,{children:[Ce(G.ontology,`ontology/universal.md`),K.map(e=>(0,E.jsx)(O,{law:e,rev:l,isOpen:M===e.addr,onToggle:()=>N(e.addr)},e.addr))]}),(0,E.jsxs)(`div`,{className:`law-toolbar`,children:[(0,E.jsx)(o,{"aria-label":`Show`,children:be.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:k===e?`on`:``,"aria-pressed":k===e,onClick:()=>A(e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,E.jsx)(x,{className:`law-filter`,value:j,onChange:oe,placeholder:`Filter rules`,label:`Filter rules`})]}),(0,E.jsxs)(`div`,{className:`law-rowhead`,children:[(0,E.jsx)(`span`,{children:`No.`}),(0,E.jsx)(`span`,{children:`Rule`}),(0,E.jsx)(`span`,{children:`Latin name`}),(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(`span`,{children:`Enforced by`})]}),xe&&$.length>0&&(0,E.jsxs)(E.Fragment,{children:[Ce(G.laws,`laws/universal.md`),$.map(e=>(0,E.jsx)(O,{law:e,rev:l,isOpen:M===e.addr,onToggle:()=>N(e.addr),toggleCol:!B||e.retired?null:d[e.addr]?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${L(e.addr)?` on`:``}`,role:`switch`,"aria-checked":L(e.addr),"aria-label":d[e.addr].label,onClick:()=>me(e.addr)}):(0,E.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Se&&I.map(e=>{let t=e.rules.filter(Y);return t.length?(0,E.jsxs)(`div`,{className:`pack-wrap${ue(e)?``:` pack-off`}`,children:[(0,E.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,style:{"--cc":u[e.pack]},children:e.title}),(0,E.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,E.jsx)(`span`,{className:`pack-state mono`,children:de(e)})]}),!e.active&&!B&&(0,E.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,I.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),pe.length>0&&` --exclude-rules ${pe.join(`,`)}`]}),t.map(e=>(0,E.jsx)(O,{law:fe(e),rev:l,isOpen:M===e.addr,onToggle:()=>N(e.addr),toggleCol:B?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${U(e.addr)?` on`:``}`,role:`switch`,"aria-checked":U(e.addr),"aria-label":`${e.name} rule`,onClick:()=>le(e.addr)}):null},e.addr))]},e.pack):null}),we===0&&(0,E.jsx)(te,{title:J?`No matching rules`:`Nothing in this tier`,children:J?(0,E.jsxs)(E.Fragment,{children:[`Nothing matches “`,j.trim(),`”.`]}):(0,E.jsx)(E.Fragment,{children:`This install predates the tier.`})})]}),(0,E.jsxs)(`aside`,{className:`aside-stack`,children:[(0,E.jsx)(ie,{packs:I,sel:V,canApply:B,install:z,gateArmed:R}),(0,E.jsx)(re,{gates:n?.gates,byAddr:ye,onJump:he,disarmed:e=>!!d[e]&&!L(e)})]})]})]})}export{A as default};
|
|
3
|
+
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(a?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=T.length?`${T.length} of ${C.length} doctrine rules`:`no doctrine rules`;await c(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${s}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await i(`install`,{...n,doctrines:e,excludeRules:o})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var E=n();function D({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:l,toggleCol:u=null,renderBody:d,srcLine:f}){let p=(0,w.useId)(),{data:m,error:h,reload:g}=c(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),v=t&&(0,E.jsxs)(`div`,{className:`law-expand`,id:p,children:[h?(0,E.jsx)(_,{error:h,onRetry:g}):m?d(m):(0,E.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,E.jsx)(`div`,{className:`law-srcline`,children:f})]}),y={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":p,"aria-label":s};return u?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,E.jsx)(`button`,{className:`law-disclosure`,...y,children:o}),(0,E.jsx)(`span`,{className:`toggle-col`,children:u})]}),v]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:i,style:a,"data-addr":e,...y,children:o}),v]})}function O({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null}){let a=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`law-no`,children:[(0,E.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,E.jsxs)(`span`,{className:`law-name`,children:[(0,E.jsx)(`span`,{children:e.name}),e.ess?(0,E.jsx)(`span`,{className:`law-princ`,children:e.ess}):null]}),(0,E.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,E.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,E.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,E.jsx)(D,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:a,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,E.jsx)(S,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`})}var k=[`invariants`,`doctrines`];function ne({tiers:e,current:t,onPick:n}){return(0,E.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),(0,E.jsxs)(`span`,{className:`tier-top`,children:[(0,E.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,E.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,E.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,E.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,E.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,E.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,E.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&k.includes(e.key)?(0,E.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,E.jsx)(`div`,{className:a,children:i},e.key)})})}function re({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1}){let i=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(g(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),a=Math.max(1,...i.map(([,e])=>e));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i.length?(0,E.jsx)(`ul`,{className:`gate-list`,children:i.map(([e,r,i])=>{let o=g(e),s=t[o]?.name||o;return(0,E.jsxs)(`li`,{children:[(0,E.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,E.jsxs)(`span`,{className:`gate-top`,children:[(0,E.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:s}),(0,E.jsx)(`span`,{className:`mono dim`,children:o}),i&&(0,E.jsx)(`span`,{className:`mono off`,children:`off`}),(0,E.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,E.jsx)(C,{value:r,max:a,label:`${s} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,E.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,E.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function ie({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,losingConsent:l,revert:u}=t,d=Math.max(1,...e.map(e=>e.rules.length));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,E.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,E.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,E.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,E.jsx)(C,{value:t,max:d,label:`${e.title} rules on`}),(0,E.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>s(e)}):null]},e.pack)})}):(0,E.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,E.jsxs)(E.Fragment,{children:[l&&(0,E.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,E.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,E.jsx)(`code`,{children:`git commit`}),` and `,(0,E.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,E.jsx)(`div`,{className:`pack-apply`,children:(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:u,disabled:!c,children:`Revert`})}),(0,E.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:c?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}function ae(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=h(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:v(n.name),c:x[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function A({selected:e,overview:t,setup:n,onAction:o,dataRev:s}){let g=u(),{data:S,error:C}=c(()=>r.catalog(`laws`),[s],`catalog:laws`),{data:D}=a(s),[k,A]=(0,w.useState)(`all`),[j,oe]=(0,w.useState)(``),M=e||null,N=e=>b(M===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),[se,ce]=(0,w.useState)(0),P=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>{let t=document.querySelector(`[data-addr="${e}"]`);if(!t)return;let n=P.current===e;P.current=null;let r=t.getBoundingClientRect();if(n||r.top<80||r.bottom>window.innerHeight){let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`})}n&&(t.classList.remove(`law-flash`),t.offsetWidth,t.classList.add(`law-flash`))});return()=>cancelAnimationFrame(t)},[e,se,S]);let F=S?.items||[],I=ae(F),L=e=>t?.install?.[m[e].key]!==!1,R=L(`IV`),z=t?.install,B=!!(z&&o),V=T({items:F,packs:I,install:z,canApply:B,onAction:o,gateArmed:R}),{deployedRules:H,isOn:U,toggleRule:le,packOn:ue,packState:de,allRules:W}=V;if(C)return(0,E.jsx)(_,{error:C});if(!S)return(0,E.jsx)(i,{});let G={ontology:S.nouns?.ontology||`Ethos`,law:S.nouns?.law||`Dictate`,laws:S.nouns?.laws||`Dictates`,doctrines:S.nouns?.doctrines||`Doctrines`},K=F.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),q=F.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&f[e.klass]?e.klass:`craft`,r=h(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:v(e.name,t?.install),cat:n,c:f[n].c,off:r.retired,src:`laws/universal.md`}}),fe=e=>{let t=U(e.addr),n=H.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},pe=I.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!H.includes(e.addr)).map(e=>e.addr)),me=async e=>{if(!B)return;let{key:t,label:n}=m[e],r=n.toLowerCase(),i=!L(e),a=`${z.host} · ${z.scope}`,s=V.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await g((i?`Re-arm the ${r} on ${a}? ${p[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${a}? ${p[e].off} It rebuilds in place, non-destructive.`)+s,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&o(`install`,{...z,[t]:i})},J=j.trim().toLowerCase(),Y=e=>!J||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(J),he=e=>{let t=ye[e],n=String(e).includes(`.`);(n&&k===`invariants`||!n&&k===`doctrines`)&&A(`all`),t&&!Y(t)&&oe(``),P.current=e,ce(e=>e+1),b(`#/item/law/${encodeURIComponent(e)}`)},X=q.filter(e=>!e.retired).length,Z=H.length,Q=D?.stats,ge={ethos:{name:G.ontology,n:K.length,fill:1,sub:`${K.length} sections`},invariants:{name:G.laws,n:X,fill:q.length?X/q.length:0,sub:q.length>X?`${X} active · ${q.length-X} retired`:`${X} active`},doctrines:{name:G.doctrines,n:Z,fill:W.length?Z/W.length:0,sub:`${Z} rules · ${I.filter(e=>e.active).length} of ${I.length} packs`},yours:{name:`Your rules`,n:Q?.rules??0,fill:Q?Q.rules/Q.max_rules:0,sub:Q?`${Q.rules} of ${Q.max_rules} · ${Q.tokens}/${Q.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`}},_e=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,G.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},ve=y.map(e=>({key:e.key,...ge[e.key],rule:_e(e.against)})),ye=Object.fromEntries([...q,...I.flatMap(e=>e.rules)].map(e=>[e.addr,e])),be=[[`all`,`All`,q.length+W.length],[`invariants`,G.laws,q.length],[`doctrines`,G.doctrines,W.length]],xe=k===`all`||k===`invariants`,Se=k===`all`||k===`doctrines`,Ce=(e,t)=>(0,E.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,children:e}),(0,E.jsx)(`span`,{className:`mono dim`,children:t})]}),$=q.filter(Y),we=(xe?$.length:0)+(Se?I.reduce((e,t)=>e+t.rules.filter(Y).length,0):0);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(d,{title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,primary:B&&I.length>0&&V.dirty?(0,E.jsxs)(`button`,{type:`button`,className:`btn`,onClick:V.applyPacks,children:[`Apply (`,V.pickedRules.length,`/`,W.length,` rules)`]}):null}),(0,E.jsx)(ne,{tiers:ve,current:k,onPick:A}),(0,E.jsxs)(`div`,{className:`split`,children:[(0,E.jsxs)(`section`,{className:`panel flush law-wrap${B?` with-toggle`:``}`,"aria-label":`Rules`,children:[K.length>0&&(0,E.jsxs)(E.Fragment,{children:[Ce(G.ontology,`ontology/universal.md`),K.map(e=>(0,E.jsx)(O,{law:e,rev:s,isOpen:M===e.addr,onToggle:()=>N(e.addr)},e.addr))]}),(0,E.jsxs)(`div`,{className:`law-toolbar`,children:[(0,E.jsx)(l,{"aria-label":`Show`,children:be.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:k===e?`on`:``,"aria-pressed":k===e,onClick:()=>A(e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,E.jsx)(te,{className:`law-filter`,value:j,onChange:oe,placeholder:`Filter rules`,label:`Filter rules`})]}),(0,E.jsxs)(`div`,{className:`law-rowhead`,children:[(0,E.jsx)(`span`,{children:`No.`}),(0,E.jsx)(`span`,{children:`Rule`}),(0,E.jsx)(`span`,{children:`Latin name`}),(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(`span`,{children:`Enforced by`})]}),xe&&$.length>0&&(0,E.jsxs)(E.Fragment,{children:[Ce(G.laws,`laws/universal.md`),$.map(e=>(0,E.jsx)(O,{law:e,rev:s,isOpen:M===e.addr,onToggle:()=>N(e.addr),toggleCol:!B||e.retired?null:m[e.addr]?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${L(e.addr)?` on`:``}`,role:`switch`,"aria-checked":L(e.addr),"aria-label":m[e.addr].label,onClick:()=>me(e.addr)}):(0,E.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Se&&I.map(e=>{let t=e.rules.filter(Y);return t.length?(0,E.jsxs)(`div`,{className:`pack-wrap${ue(e)?``:` pack-off`}`,children:[(0,E.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,style:{"--cc":x[e.pack]},children:e.title}),(0,E.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,E.jsx)(`span`,{className:`pack-state mono`,children:de(e)})]}),!e.active&&!B&&(0,E.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,I.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),pe.length>0&&` --exclude-rules ${pe.join(`,`)}`]}),t.map(e=>(0,E.jsx)(O,{law:fe(e),rev:s,isOpen:M===e.addr,onToggle:()=>N(e.addr),toggleCol:B?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${U(e.addr)?` on`:``}`,role:`switch`,"aria-checked":U(e.addr),"aria-label":`${e.name} rule`,onClick:()=>le(e.addr)}):null},e.addr))]},e.pack):null}),we===0&&(0,E.jsx)(ee,{title:J?`No matching rules`:`Nothing in this tier`,children:J?(0,E.jsxs)(E.Fragment,{children:[`Nothing matches “`,j.trim(),`”.`]}):(0,E.jsx)(E.Fragment,{children:`This install predates the tier.`})})]}),(0,E.jsxs)(`aside`,{className:`aside-stack`,children:[(0,E.jsx)(ie,{packs:I,sel:V,canApply:B,install:z,gateArmed:R}),(0,E.jsx)(re,{gates:n?.gates,byAddr:ye,onJump:he,disarmed:e=>!!m[e]&&!L(e)})]})]})]})}export{A as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{n as i,t as a}from"./sections-ChwaobfW.js";import{J as o,M as s,N as ee,S as te,V as c,b as l,k as ne,ot as u,tt as re,y as d}from"./index-Dwo3Gxek.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{a as ie,i as ae,o as oe,r as se,s as ce,t as le}from"./RailCats-DNlJKicm.js";import{t as ue}from"./Markdown-OReRRoEV.js";var p=e(t(),1),m=n();function de({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,m.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function h({entries:e}){return e.length?(0,m.jsxs)(`table`,{className:`mf-entries`,children:[(0,m.jsx)(`thead`,{className:`sr-only`,children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{scope:`col`,children:`Path`}),(0,m.jsx)(`th`,{scope:`col`,children:`Load`}),(0,m.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,m.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,m.jsx)(`td`,{className:`mf-load-cell`,children:(0,m.jsx)(de,{load:e.load})}),(0,m.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function g({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,m.jsxs)(`div`,{className:`mf-vault`,children:[(0,m.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,m.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,m.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,m.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(c,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(c,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,m.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,m.jsx)(c,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,m.jsx)(h,{entries:t})]})}function _({body:e}){let[t,n]=(0,p.useState)(!1),r=(0,p.useId)();return e?(0,m.jsxs)(`div`,{className:`mf-raw`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,m.jsx)(c,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,m.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function fe({manifest:e,body:t,name:n}){if(!e)return(0,m.jsx)(`pre`,{className:`mf-raw-pre`,children:(t||``).replace(/^```json\n|\n```$/g,``)});if(e.kind===`wiki`){let n=e.wikis||[];return n.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,m.jsx)(g,{wiki:e},e.name||t)),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,m.jsxs)(`p`,{children:[`A wiki is your machine-wide knowledge base — an Obsidian vault or any folder of linked markdown the agent reads from and writes back to. Declare one in`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,m.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,m.jsx)(_,{body:t})]})}let r=e.context||[];return r.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[(0,m.jsx)(h,{entries:r}),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,m.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,m.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,m.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,m.jsx)(_,{body:t})]})}var v={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},y={advocate:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,m.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,m.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,m.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,m.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,m.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,m.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,m.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,m.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,m.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),"devops-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`3`})]}),"docker-expert":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`14`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`27`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`20`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`34`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`path`,{d:`M8 52c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3 5-3 10-3`,opacity:`.5`})]}),docs:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,m.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,m.jsx)(`g`,{className:`ag-write`,children:(0,m.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,m.jsxs)(`g`,{className:`ag-search`,children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,m.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-frame`,children:(0,m.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,m.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,m.jsxs)(`g`,{className:`ag-turn`,children:[(0,m.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,m.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,m.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,m.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,m.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-gauge`,children:(0,m.jsx)(`path`,{d:`M32 42l10-13`})}),(0,m.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,m.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,m.jsxs)(`g`,{className:`ag-tilt`,children:[(0,m.jsx)(`path`,{d:`M14 18h36`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"kubernetes-specialist":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`16`}),(0,m.jsx)(`path`,{d:`M32 8v13M32 43v13M8 32h13M43 32h13M15 15l9 9M40 40l9 9M49 15l-9 9M24 40l-9 9`,opacity:`.6`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`5`})]}),"memory-curator":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,m.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,m.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,m.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,m.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,m.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,m.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`path`,{d:`M30 34V22`})}),(0,m.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,m.jsxs)(`g`,{className:`ag-lean`,children:[(0,m.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),"spring-boot-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M22 20a16 16 0 1 0 20 0`}),(0,m.jsx)(`path`,{className:`ag-pulse`,d:`M32 12v18`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 50c0-8 5-12 13-12 0 8-5 12-13 12z`})]}),"spring-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h26M12 26h18M12 34h22M12 42h14`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M42 28c0-8 4-12 11-12 0 8-4 12-11 12z`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`24`,cy:`32`,r:`9`}),(0,m.jsx)(`path`,{d:`M31 39l8 8`,strokeWidth:`3`})]})]}),"spring-security":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`path`,{d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`rect`,{className:`ag-f`,x:`16`,y:`28`,width:`32`,height:`24`,rx:`4`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`38`,r:`3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 41v6`})]}),"react-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{className:`ag-spin`,children:[(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(60 32 32)`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(120 32 32)`})]}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`4`})]}),"react-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{opacity:`.4`,children:[(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(60 30 30)`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(120 30 30)`})]}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`30`,r:`8`}),(0,m.jsx)(`path`,{d:`M36 36l9 9`,strokeWidth:`3`})]})]}),steward:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,m.jsxs)(`g`,{className:`ag-grow`,children:[(0,m.jsx)(`path`,{d:`M32 50V26`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,m.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,m.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,m.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,m.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,m.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,m.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,m.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},b=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function pe({name:e,size:t=64}){return(0,m.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...v,children:[(0,m.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,m.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),y[e]||b]})}function x({label:e,value:t,delta:n,children:r}){let i=u(Number.isInteger(t)?t:null);return(0,m.jsxs)(`div`,{className:`stat`,children:[(0,m.jsx)(`div`,{className:`stat-label`,children:e}),(0,m.jsx)(`div`,{className:`stat-value mono`,children:i===null?t:Math.round(i)}),n==null?null:(0,m.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var me={skills:`skill`,agents:`agent`},S=(e,t)=>`${t?e/t*100:0}%`,C=e=>e.split(`:`).slice(0,2).join(` `);function w(e,t){return e===`memory`?`memory/${t}`:e===`notebook`?`notebook/${t}`:e===`wiki`?`geneseed-wiki.jsonc`:e===`config`?t:`${e}/${t}.md`}function he({section:e,source:t}){return(0,m.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,m.jsx)(c,{name:i[e].icon,className:`glyph`}),(0,m.jsxs)(`span`,{children:[`This entry is part of the `,i[e].label.toLowerCase(),` convention; see`,` `,(0,m.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var T=e=>e.replace(/\s+/g,` `).trim(),E=e=>e.replace(/^(?:[ \t]*\n)+/,``);function D(e,t){let n=e.replace(/\r\n/g,`
|
|
2
|
+
`),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=E(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?T(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?T(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=E(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function ge({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(x,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(C))].join(`, `),i=t.days_counted>=30?`in the last 30 days`:`since ${t.since}`,a=Math.max(1,...e.per_day);return(0,m.jsxs)(`div`,{className:`lib-stats`,children:[(0,m.jsx)(x,{label:`Used`,value:e.n,delta:r?`${i} · on ${r}`:i,children:(0,m.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,m.jsx)(`i`,{className:t===29?`today`:``,style:{height:S(e,a)}},t))})}),e.last?(0,m.jsx)(x,{label:`Last used`,value:e.last}):null]})}var O=(e,t)=>t||(e&&a.includes(e)?e:a[0]),k=encodeURIComponent;function A(e){let t=e=>d[e.klass]?e.klass:`personal`,n=l.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:l.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 j({overview:e,section:t,selected:n,dataRev:c,lock:l,base:u,onRulesChanged:de}){let h=ee(),[g,_]=(0,p.useState)(()=>O(t,l)),[v,y]=(0,p.useState)(``),[b,x]=(0,p.useState)(`all`),[C,T]=(0,p.useState)(`all`),[E,j]=(0,p.useState)(``),[_e,ve]=(0,p.useState)(t);if(t!==_e){ve(t);let e=O(t,l);e!==g&&(_(e),y(``),x(`all`),T(`all`))}let{data:M,error:ye,reload:N}=o(()=>r.catalog(g),[g,c],`catalog`),be=l?null:me[g]||null,P=be!==null,{data:F}=o(()=>P?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[P,c],`usage`,{revalidate:!0}),I=P&&!!F?.enabled&&Array.isArray(F.names),xe=(0,p.useMemo)(()=>new Map((Array.isArray(F?.names)?F.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[F]),L=e=>I&&xe.get(`${be}\u0000${e}`)||null,Se=e=>{let t=L(e.name);return!t||t.n===0&&!t.last},Ce=F?.since?`No call since ${F.since}`:`No call recorded yet`,R=M?.section===g&&M?.items||[],z=g===`skills`,B=z?A(R):null,V=n||(z?B.rows[0]:R[0])?.name||null,H=V?R.find(e=>e.name===V):null,we=H?.type||i[g].type,{data:Te,error:U}=o(()=>V?r.item(we,V):Promise.resolve(null),[g,V,we,c]),W=U?null:Te,Ee=E||ye||U,De=V?{name:V,title:W?.title||V,desc:W?.desc||``}:null,G=H||De,Oe=e?.counts||{},K=z?B.rows.filter(e=>b===`all`||e.cat===b):R,ke=I?K.filter(Se).length:0,q=I?C:`all`,J=q===`all`?K:K.filter(e=>Se(e)===(q===`unused`)),Ae=I?Math.max(0,...R.map(e=>L(e.name)?.n||0)):0,Y=z?1/0:50,X=v.trim().toLowerCase(),Z=X?oe(J,X):J.slice(0,Y),je=!X&&b===`all`&&q===`all`&&V&&!Z.some(e=>e.name===V)?[...Z,...R.filter(e=>e.name===V)]:Z,Me=e=>u?`${u}/${k(e.name)}`:`#/item/${e.type||i[g].type}/${k(e.name)}`,Ne=async()=>{let e=G?.name;if(e&&await h(`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`,tone:`danger`})){j(``);try{await r.memoryDelete(e)}catch(t){j(`Could not forget "${e}": ${t.message}`);return}re(u||`#/section/memory`),N()}},Pe=async()=>{let e=G?.name;if(e&&await h(`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`})){j(``);try{let t=await r.rules();await r.rulesPromote({name:e,fingerprint:t.fingerprint,delete_memory:!0}),te(),de?.(),re(`#/personal/rules`)}catch(e){j(`Could not promote: ${e.message}`),N()}}},Q=W?.body?D(W.body,W.desc||G?.desc):null,Fe=W?.title||G?.title||G?.name,Ie=Fe===G?.name&&Q?.title?Q.title:Fe,Le=M?.section===g&&R.length===0,Re=W?.status||G?.status,ze=g===`skills`?d[H?.klass]:null,$=i[g].label;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ne,{error:Ee,style:{margin:`0 0 var(--sp-3)`}}),(0,m.jsxs)(`div`,{className:`library${l?` locked`:``}`,children:[l?null:(0,m.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,m.jsxs)(`div`,{className:`lib-title`,children:[(0,m.jsx)(`h1`,{className:`h`,children:`Library`}),(0,m.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,m.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:a.map(e=>(0,m.jsxs)(p.Fragment,{children:[(0,m.jsxs)(`a`,{href:`#/section/${e}`,className:g===e?`on`:``,"aria-current":g===e?`page`:void 0,children:[i[e].label,(0,m.jsx)(`span`,{className:`mono dim`,children:Oe[e]??``})]}),e===g&&z&&(0,m.jsx)(le,{label:`Skill types`,total:R.length,cats:B.cats,cat:b,onChange:x})]},e))})]}),(0,m.jsxs)(ie,{label:$,count:X?`${Z.length} of ${J.length}`:J.length,q:v,onQ:y,matched:Z.length,inView:[g,n],extra:I?(0,m.jsx)(s,{"aria-label":`Show`,children:[[`all`,`All`,K.length,void 0],[`used`,`Used`,K.length-ke,void 0],[`unused`,`Not used yet`,ke,Ce]].map(([e,t,n,r])=>(0,m.jsxs)(`button`,{type:`button`,className:C===e?`on`:``,"aria-pressed":C===e,title:r,onClick:()=>T(e),children:[t,` `,(0,m.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[(0,m.jsx)(se,{rows:je,activeName:G?.name,hrefOf:Me,pills:I?e=>{let t=L(e.name)?.n||0;return(0,m.jsxs)(`span`,{className:`lr-use`,children:[(0,m.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,m.jsx)(`i`,{style:{width:S(t,Ae)}})}),(0,m.jsxs)(`span`,{className:`mono`,children:[t,(0,m.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})}:void 0}),!X&&R.length>Y&&(0,m.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,Y,` of `,R.length,`; type to search the rest.`]}),Le&&(g===`wiki`?(0,m.jsxs)(f,{title:`No wiki entries`,action:(0,m.jsx)(`a`,{href:`#/section/config`,children:`Open the setup files`}),docs:{href:`#/docs/wiki`,label:`How to configure a wiki →`},children:[`Declare a wiki in `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,m.jsx)(f,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,m.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:G?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`reader-tags`,children:[(0,m.jsx)(`span`,{className:`tag acc`,children:$.replace(/s$/,``)}),ze?(0,m.jsx)(`span`,{className:`tag`,children:ze.label}):null,W?.kit??G.kit?(0,m.jsx)(ae,{name:W?.kit??G.kit}):null,(0,m.jsx)(ce,{status:Re})]}),(0,m.jsxs)(`div`,{className:`reader-head`,children:[(0,m.jsx)(`h2`,{className:`reader-title`,children:Ie}),g===`agents`?(0,m.jsx)(pe,{name:G.name}):null]}),(W?.desc||G.desc)&&(0,m.jsx)(`p`,{className:`reader-lede`,children:W?.desc||G.desc}),(0,m.jsx)(`p`,{className:`mono dim reader-src`,children:W?.source||G.source||(U?null:w(g,G.name))}),I?(0,m.jsx)(ge,{u:L(G.name),usage:F,noCall:Ce}):null,g===`memory`&&G.name!==`MEMORY`&&G.name!==`README`&&(0,m.jsxs)(`div`,{className:`row gap-8`,children:[(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Pe,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Ne,children:`Forget this fact`})]}),(0,m.jsx)(`hr`,{className:`hr`}),U?(0,m.jsxs)(`p`,{className:`sub`,children:[`No `,$.replace(/s$/,``).toLowerCase(),` named `,(0,m.jsx)(`em`,{children:G.name}),` could be read in this install.`]}):G?.kind===`manifest`||W?.manifest!==void 0?W?(0,m.jsx)(fe,{manifest:W.manifest,body:W.body,name:G.name}):(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):W?.body?(0,m.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,m.jsx)(ue,{body:Q.body,links:W.links||[]})}):W===null&&V?(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,m.jsx)(he,{section:g,source:w(g,G.name)})]}):Le?null:(0,m.jsx)(f,{title:`Select an entry`,children:`Pick something from the list to read it.`})})]})]})}export{D as bodyHead,j as default,A as splitSkills};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{$ as i,A as a,J as o,et as s,k as c}from"./index-Dwo3Gxek.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./usePoll-bDFN-Hr6.js";import{a as d,n as f,o as p,r as m,t as h}from"./RailCats-DNlJKicm.js";import{t as g}from"./Markdown-OReRRoEV.js";var _=e(t(),1),v={x:260,y:190},y=110,b=28,x=14,S=44,C=e=>e*Math.PI/180,w=e=>Math.round(e*10)/10,T=(e,t=y,n=v)=>({x:w(n.x+t*Math.cos(C(e))),y:w(n.y+t*Math.sin(C(e)))}),E=e=>e/y*(180/Math.PI)+3,D=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,O=w(T(205).x-6),k=e=>e.length*6.4,A=e=>({x:e.x-k(e.name)/2,y:e.y-7,w:k(e.name),h:14}),j=(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,M=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>j(A(n),A(e))));function N(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function P(e,t=[]){let n=e=>t.find(t=>t.name===e),r=e=>n(e)?.effect??null,i=e=>N(n(e)),a=e.loops||[],o=a.find(e=>e.iteration);if(!o||o.nodes.length>8)return F(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 F(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 F(e,r,i);let p=360/f.length,m=f.map((e,t)=>({name:e,a:-90+t*p,r:b})),h=m.findIndex(e=>r(e.name)===`mutate`);h>=0&&m.splice(h,0,{name:`validate`,a:m[h].a-p/2,r:x,gate:!0});let g=m.map(e=>({name:e.name,...T(e.a),r:e.r,effect:e.gate?null:r(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:i(e.name)})),_=m.map((e,t)=>{let n=m[(t+1)%m.length],r=(t+1===m.length?n.a+360:n.a)-E(n.r)-2,i=e.a+E(e.r);return{d:D(y,T(i),T(r),+(r-i>180)),kind:`ring`}}),C=[],O=new Map;for(let e of c)O.set(e.nodes[0],[...O.get(e.nodes[0])||[],e]);for(let[e,t]of O){let n=m.find(t=>t.name===e),a=T(n.a),o=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let s=T(n.a+(o?t?18:-18:0),y+(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,...T(c+(n-(l.length-1)/2)*e,S,s)})),f=105;for(;f<150&&M(u(f),g);)f+=5;u(f).forEach(({name:e,...t})=>{g.push({name:e,...t,r:b,effect:r(e),gate:!1,inner:!0,human:i(e)})});let p=c+180;_.push({d:D(S,T(p+42,S,s),T(p+138,S,s)),kind:`inner`}),_.push({d:D(S,T(p+222,S,s),T(p+318,S,s)),kind:`inner`});let m=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,h={lx:s.x,ly:s.y+S+20,anchor:`middle`};if(o){let e=s.x>=v.x,t=Math.max(S,...l.map(e=>{let t=g.find(t=>t.name===e);return Math.abs(t.x-s.x)+b}));h={lx:w(s.x+(e?t+8:-t-8)),ly:w(s.y+4),anchor:e?`start`:`end`}}C.push({loop:e.name,cx:s.x,cy:s.y,r:S,label:m,...h})})}let A=T(205).y,j=e.nodes.filter(e=>!o.nodes.includes(e)),P=j.map((e,t)=>({name:e,x:40,y:w(A-44*(j.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+b},${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),...C.map(e=>e.cx+e.r+8),...C.map(e=>e.anchor===`start`?e.lx+k(e.label)+8:e.lx+k(e.label)/2+8)),B=Math.max(300,...g.map(e=>e.y+e.r+12),...C.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(z),height:Math.ceil(B),center:{x:v.x,y:v.y,r:y},nodes:g,arcs:_,inner:C,entry:P,exit:R}}function F(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(b,...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:b,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])+b},${a} L${o.get(t)-b-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 I=n();function L({x:e,y:t,label:n}){return(0,I.jsxs)(`g`,{className:`lr-human`,children:[(0,I.jsx)(`title`,{children:n}),(0,I.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,I.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,I.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 R({graph:e,bricks:t,onSelect:n,highlight:r}){let i=P(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,I.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,role:`img`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,I.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,I.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,I.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,I.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,I.jsxs)(`g`,{children:[(0,I.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,I.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,I.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${O},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,I.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,I.jsx)(L,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,I.jsxs)(`g`,{className:`lr-gate`,children:[(0,I.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,I.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,I.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,I.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,I.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,I.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,I.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,I.jsx)(L,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,I.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,I.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,I.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}function z({caption:e,captionHidden:t,columns:n,rows:r,rowKey:i,rowAction:a}){let o=e=>e.align?{textAlign:e.align}:void 0;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl`,children:[(0,I.jsx)(`caption`,{className:t?`sr-only`:`tbl-caption`,children:e}),(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[n.map(e=>(0,I.jsx)(`th`,{scope:`col`,style:o(e),children:e.label},e.key)),a?(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Actions`})}):null]})}),(0,I.jsx)(`tbody`,{children:r.map(e=>(0,I.jsxs)(`tr`,{children:[n.map(t=>(0,I.jsx)(`td`,{style:o(t),children:t.render?t.render(e):e[t.key]},t.key)),a?(0,I.jsx)(`td`,{className:`tbl-act`,children:a(e)}):null]},i(e)))})]})})}var B=5e3,ee=[`prudent`,`balanced`,`aggressive`],V={running:`acc`,awaiting:`warn`,unreadable:`bad`},H=e=>!!e.graph;function te(){let[e,t]=(0,_.useState)(null),[n,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(0);return u(e=>r.activeLoops().then(n=>e()&&(t(n),i(null)),t=>e()&&i(t.message)),B,[a]),{loops:e?.loops??null,error:n,onPreset:(e,t)=>r.setLoopPreset(e,t).then(()=>o(e=>e+1),e=>i(e.message))}}var U=e=>({key:e,label:e,align:`right`,render:t=>(0,I.jsx)(`span`,{className:`num`,children:t[e]})}),ne=[U(`iteration`),{key:`intent`,label:`intent`},U(`declared`),U(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function re({history:e}){return e.length?(0,I.jsx)(`div`,{className:`loop-history`,children:(0,I.jsx)(z,{caption:`Iterations`,captionHidden:!0,columns:ne,rows:e,rowKey:e=>e.iteration})}):(0,I.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function ie({loop:e,bricks:t,onPreset:n}){let r=H(e)?(e.graph.loops||[]).find(e=>e.iteration):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,I.jsx)(`span`,{className:`tag${V[e.status]?` ${V[e.status]}`:``}`,children:e.status})]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),H(e)?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,I.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,I.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,I.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,I.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,onChange:t=>n(e.root,t.target.value),children:ee.map(e=>(0,I.jsx)(`option`,{children:e},e))})]}),(0,I.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)(`div`,{className:`loop-graph`,children:(0,I.jsx)(R,{graph:e.graph,bricks:t,highlight:e.node})}),(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,I.jsx)(re,{history:e.history})]}):(0,I.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 W=encodeURIComponent,G=i.loops.map(e=>[e,s[e]]),K={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},ae={project:`Project`,global:`Global`,shipped:`Shipped`},oe={templates:`Categories`,bricks:`Origins`,active:`Statuses`},se=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function q(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var J=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function Y(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return J(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>K[e.graph.category]?e.graph.category:`other`,[...Object.entries(K),[`other`,`Other`]])}function X(e,t){return J(e.map(e=>({...e,desc:e.description,override:q(t,e.name)})),e=>e.origin,Object.entries(ae))}function Z(e){return J(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,se)}var Q=(e,t)=>(0,I.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),$={templates:e=>e.human?Q(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?Q(`warn`,`mutate`):null,N(e)?Q(`human`,`human gate`):null,e.override?Q(`acc`,e.override):null,e.available===!1?Q(`bad`,`unavailable`):null],active:e=>Q(V[e.status],e.status)};function ce({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,I.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,I.jsx)(`b`,{children:(0,I.jsx)(`a`,{href:`#/loops/bricks/${W(e)}`,children:e})}),Q(t.effect===`mutate`?`warn`:``,t.effect),(0,I.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,I.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),N(t)?Q(`human`,N(t).toLowerCase()):null,n?Q(`acc`,n):null]}):(0,I.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,I.jsx)(`b`,{children:e}),(0,I.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function le({t:e,bricks:t,overridden:n}){let[r,i]=(0,_.useState)(null),a=new Map(t.map(e=>[e.name,e]));return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Template`}),K[e.graph.category]?Q(``,K[e.graph.category]):null,e.human?Q(`human`,`human gate`):null]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,I.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)(`div`,{className:`loop-graph`,children:(0,I.jsx)(R,{graph:e.graph,bricks:t,onSelect:e=>{i(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:`smooth`,block:`nearest`})}})}),e.graph.rules?.length?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,I.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,I.jsx)(`li`,{children:e},e))})]}):null,(0,I.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,I.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,I.jsx)(ce,{name:e,brick:a.get(e),override:q(n,e),on:r===e},e))})]})}function ue(e){return`---\n${[[`name`,e.name],[`description`,e.description],[`effect`,e.effect],[e.agent?`agent`:`skill`,e.agent||e.skill],[`gate`,e.gate],[`gateOn`,e.gateOn?.join(`, `)],[`outcomes`,e.outcomes.join(`, `)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
2
|
+
`)}\n---\n${e.body}`}function de({b:e}){let[t,n]=(0,_.useState)(!1),r=[[`effect`,Q(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,I.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>Q(``,e))],[`gate`,N(e)?Q(`human`,N(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,I.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`reader-tags`,children:[(0,I.jsx)(`span`,{className:`tag acc`,children:`Brick`}),$.bricks(e)]}),(0,I.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,I.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,I.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,I.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,I.jsxs)(_.Fragment,{children:[(0,I.jsx)(`dt`,{children:e}),(0,I.jsx)(`dd`,{children:t})]},e))}),(0,I.jsx)(`hr`,{className:`hr`}),(0,I.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,I.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:ue(e)}):(0,I.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,I.jsx)(g,{body:e.body})})]})}function fe({problems:e}){if(!e?.length)return null;let t=e.length;return(0,I.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,I.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,I.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,I.jsx)(`li`,{className:`mono`,children:e},e))})]})}var pe={templates:{title:`No templates`,body:(0,I.jsxs)(I.Fragment,{children:[`Add one under `,(0,I.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]})},bricks:{title:`No bricks`,body:(0,I.jsxs)(I.Fragment,{children:[`Add one under `,(0,I.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]})},active:{title:`No loops yet`,body:(0,I.jsxs)(I.Fragment,{children:[`Start one with `,(0,I.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.`]})}},me={templates:(0,I.jsxs)(I.Fragment,{children:[`A template wires bricks into a loop. `,(0,I.jsx)(`a`,{href:`#/docs/loops`,children:`How loops work →`}),` `,(0,I.jsx)(`a`,{href:`#/docs/loop-which-template`,children:`Which template? →`})]}),bricks:(0,I.jsxs)(I.Fragment,{children:[`A brick is one step: a skill or agent and its outcomes.`,` `,(0,I.jsx)(`a`,{href:`#/docs/loop-bricks`,children:`About bricks →`})]}),active:(0,I.jsxs)(I.Fragment,{children:[`Loops registered on this machine, read from their LOOP.md.`,` `,(0,I.jsx)(`a`,{href:`#/docs/loop-running`,children:`Running a loop →`})]})};function he({tab:e=`templates`,item:t,dataRev:n}){let{data:i,error:s}=o(()=>r.loops(),[n],`loops`),u=te(),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(`all`),[x,S]=(0,_.useState)(e);e!==x&&(S(e),v(``),b(`all`));let C=i?.bricks||[],w=e===`active`?u.loops&&Z(u.loops):i&&(e===`bricks`?X(i.bricks,i.overridden):Y(i.templates,i.bricks)),T=w||[],E=f(T),D=y===`all`?T:T.filter(e=>e.group===y),O=g.trim(),k=p(D,O),A=T.find(e=>e.name===t)||e===`active`&&T.find(H)||T[0]||null,j={templates:i?.templates.length,bricks:i?.bricks.length,active:u.loops?.length},M=G.find(([t])=>t===e)[1],N=e===`active`?u.error:s;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(c,{error:N,style:{margin:`0 0 var(--sp-3)`}}),(0,I.jsx)(fe,{problems:i?.problems}),(0,I.jsxs)(`div`,{className:`library`,children:[(0,I.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,I.jsxs)(`div`,{className:`lib-title`,children:[(0,I.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,I.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,I.jsx)(`p`,{className:`panel-note lib-lede`,children:me[e]}),(0,I.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:G.map(([t,n])=>(0,I.jsxs)(_.Fragment,{children:[(0,I.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,I.jsx)(`span`,{className:`mono dim`,children:j[t]??``})]}),e===t&&(0,I.jsx)(h,{label:oe[t],total:T.length,cats:E,cat:y,onChange:b})]},t))})]}),(0,I.jsx)(d,{label:M,count:O?`${k.length} of ${D.length}`:w?D.length:``,q:g,onQ:v,matched:k.length,inView:[e,t],children:w?T.length===0?(0,I.jsx)(l,{title:pe[e].title,children:pe[e].body}):(0,I.jsx)(m,{rows:k,activeName:A?.name,hrefOf:t=>`#/loops/${e}/${W(t.name)}`,pills:$[e]}):N?null:(0,I.jsx)(a,{})}),(0,I.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:A?e===`active`?(0,I.jsx)(ie,{loop:A,bricks:C,onPreset:u.onPreset}):e===`bricks`?(0,I.jsx)(de,{b:A}):(0,I.jsx)(le,{t:A,bricks:C,overridden:i.overridden},A.name):e===`active`&&w?(0,I.jsx)(l,{title:`What is a loop?`,docs:{href:`#/docs/loops`,label:`How loops work →`},children:`A loop runs bricks in a ring until its gate passes.`}):null})]})]})}export{Z as activeRows,X as brickRows,ue as brickSource,he as default,Y as templateRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{n,r}from"./sections-ChwaobfW.js";import{K as i,U as a}from"./index-Dwo3Gxek.js";import{n as o,r as s,t as c}from"./jobBuckets-Dpjvbfm1.js";import{n as l}from"./Dashboard-BZmw2a7d.js";e();var u=t(),d=14;function f({title:e,right:t,children:n,span:r}){return(0,u.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,u.jsxs)(`div`,{className:`c-mod-head`,children:[(0,u.jsx)(`span`,{className:`c-tab`}),(0,u.jsx)(`h3`,{children:e}),t&&(0,u.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,u.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function p({label:e,value:t}){return(0,u.jsxs)(`div`,{className:`c-kpi`,children:[(0,u.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,u.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function m({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,u.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,u.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function h({checks:e}){return(0,u.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,u.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 g(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 _({overview:e,jobs:t,lens:_}){let v=e.counts||{},y=r.reduce((e,t)=>e+(v[t]||0),0),b=Math.max(...r.map(e=>v[e]||0),1),x=_?.doctor?.state||`loading`,S=_?.doctor?.data?.groups||[],C=S.filter(e=>e.problems.length===0).length,w=c(t||[],10,`0d`),T=w.reduce((e,t)=>e+t.v,0),E=g(t),D=Math.max(...E.map(e=>e.value),1),O=a(e.diff),k=[[`status`,e.deployed?(0,u.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,u.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,u.jsx)(`span`,{className:`t-cap`,children:e.theme})],[`mode`,e.emit],[`doctor`,x===`failed`?(0,u.jsx)(`span`,{className:`c-pill warn`,children:`NO ANSWER`}):x===`ok`?S.length===0?(0,u.jsx)(`span`,{className:`c-pill`,children:`—`}):C===S.length?(0,u.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,u.jsxs)(`span`,{className:`c-pill warn`,children:[S.length-C,` ISSUES`]}):(0,u.jsx)(`span`,{className:`c-pill`,children:`…`})],[`edits`,String(O)],[`built`,e.build_time||`—`],[`target`,(0,u.jsx)(`span`,{className:`c-dim mono`,children:e.target})]];return(0,u.jsxs)(`div`,{className:`c-root`,children:[(0,u.jsx)(`div`,{className:`c-titlebar`,children:(0,u.jsxs)(`div`,{children:[(0,u.jsx)(`h2`,{className:`c-h1`,children:`HARNESS // STATUS READOUT`}),(0,u.jsxs)(`div`,{className:`c-sub`,children:[e.target,` · rendered from src/ · inherited everywhere`]}),(0,u.jsx)(l,{verdict:_?.verdict})]})}),(0,u.jsx)(`div`,{className:`c-strip`,children:k.map(([e,t],n)=>(0,u.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,u.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,u.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,u.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,u.jsx)(p,{label:`AGENTS`,value:v.agents??`—`}),(0,u.jsx)(p,{label:`SKILLS`,value:v.skills??`—`}),(0,u.jsx)(p,{label:`DICTATES`,value:v.laws??`—`}),(0,u.jsx)(p,{label:`PACKS`,value:v.doctrines?`${v.doctrines.active}/${v.doctrines.total}`:`—`}),(0,u.jsx)(p,{label:`MEMORY`,value:v.memory??`—`}),(0,u.jsx)(p,{label:`NOTEBOOK`,value:v.notebook??`—`}),(0,u.jsx)(p,{label:`EDITS`,value:O})]}),(0,u.jsxs)(`div`,{className:`c-grid`,children:[(0,u.jsx)(f,{title:`CAPABILITY DISTRIBUTION`,right:`${y} ENTRIES`,span:2,children:(0,u.jsxs)(`table`,{className:`c-tbl`,children:[(0,u.jsx)(`thead`,{children:(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`th`,{children:`SECTION`}),(0,u.jsx)(`th`,{children:`DETAIL`}),(0,u.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,u.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,u.jsx)(`tbody`,{children:r.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{className:`c-name`,children:n[e].label}),(0,u.jsx)(`td`,{className:`c-dim`,children:n[e].desc}),(0,u.jsx)(`td`,{children:(0,u.jsx)(`div`,{className:`c-bar`,children:(0,u.jsx)(`i`,{style:{width:`${(v[e]||0)/b*100}%`,background:e===`agents`||e===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,u.jsx)(`td`,{className:(v[e]||0)>0?`num`:`num c-dim`,children:v[e]??0})]},e))})]})}),(0,u.jsx)(f,{title:`DOCTOR // CHECKS`,right:S.length?`${C}/${S.length}`:`—`,children:S.length>0?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(h,{checks:S}),(0,u.jsx)(`div`,{className:`c-check-list`,children:S.map(e=>{let t=e.problems.length===0;return(0,u.jsxs)(`div`,{className:`c-check-row`,children:[(0,u.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,u.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,u.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,u.jsx)(`p`,{className:`c-dim mono c-fine`,children:x===`failed`?`Doctor did not answer.`:x===`ok`?`Doctor reported no checks.`:`Checking…`})}),(0,u.jsxs)(f,{title:`RUN RATE // 10D`,right:`${T} RUNS`,span:2,children:[(0,u.jsx)(m,{data:w,height:120,hi:w.length-1}),(0,u.jsx)(`div`,{className:`c-axis`,children:w.map((e,t)=>(0,u.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,u.jsx)(f,{title:`RUN LOG // BY TYPE`,right:`${(t||[]).length} LOGGED`,children:E.length>0?(0,u.jsx)(`table`,{className:`c-tbl`,children:(0,u.jsx)(`tbody`,{children:E.map(e=>(0,u.jsxs)(`tr`,{children:[(0,u.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,u.jsx)(`td`,{children:(0,u.jsx)(`div`,{className:`c-bar`,children:(0,u.jsx)(`i`,{style:{width:`${e.value/D*100}%`,background:`var(--accent)`}})})}),(0,u.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,u.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})}),(0,u.jsx)(f,{title:`RECENT // RUN LOG`,span:3,children:(0,u.jsx)(`table`,{className:`c-tbl`,children:(0,u.jsxs)(`tbody`,{children:[s(t,d).map(e=>{let t=e.status===`done`,n=e.status===`failed`?`bad`:t?`ok`:`acc`,r=o(e);return(0,u.jsxs)(`tr`,{children:[(0,u.jsxs)(`td`,{style:{width:96},children:[(0,u.jsx)(`span`,{className:`c-dotmark ${n}`}),` `,(0,u.jsx)(`span`,{className:`c-dim`,children:e.action})]}),(0,u.jsx)(`td`,{className:`c-name`,style:{fontWeight:400},title:r.command||void 0,children:[r.scope,r.result,r.duration].filter(Boolean).join(` · `)}),(0,u.jsx)(`td`,{className:`num c-dim`,children:e.started?`${i(e.started)} ago`:`—`})]},e.id)}),(!t||t.length===0)&&(0,u.jsx)(`tr`,{children:(0,u.jsx)(`td`,{colSpan:`3`,className:`c-dim c-fine`,children:`No runs logged.`})})]})})})]})]})}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,C as a,J as o,M as s,N as c,T as l,k as u,nt as d,tt as f}from"./index-Dwo3Gxek.js";import{t as p}from"./EmptyState-1sPNleqv.js";import{t as m}from"./Markdown-OReRRoEV.js";import{t as h}from"./Tabs-2uMB511T.js";import{t as g}from"./StackBar-Y_gkoC3t.js";import _ from"./Library-BYfB4mhf.js";var v=e(t(),1),y=e=>e(`Discard your unsaved edit?`,{title:`Unsaved edit`,confirmLabel:`Discard`,tone:`danger`}),b=`The file changed on disk — reloaded the fresh copy. Your draft is kept.`;function x({data:e,reload:t}){let n=c(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,l]=(0,v.useState)(!1),[u,p]=(0,v.useState)(``),m=e?.fingerprint||``,h=r!==null&&JSON.stringify(r)!==JSON.stringify(a),g=(0,v.useRef)(!1),_=e=>{i(e),o(e)},x=()=>i(null);return(0,v.useEffect)(()=>{if(!h)return;let e=e=>{e.preventDefault(),e.returnValue=``};window.addEventListener(`beforeunload`,e);let t=d(({to:e})=>(g.current||(g.current=!0,y(n).then(n=>{n&&(t(),i(null),f(e))}).finally(()=>{g.current=!1})),!1));return()=>{window.removeEventListener(`beforeunload`,e),t()}},[h,n]),{draft:r,setDraft:i,open:_,close:x,discard:async()=>h&&!await y(n)?!1:(x(),!0),dirty:h,busy:s,notice:u,setNotice:p,save:async(e,{conflict:n}={})=>{l(!0),p(``);try{return await e(m)||!0}catch(e){e.status===409?p(n??b):p(e.message);return}finally{l(!1),t()}}}}var S=n(),C={title:``,body:``,scope:`project`,trial_until:``},w=[`project`,`global`],T=e=>e===`user`?`global`:e,E=/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/,D=e=>e.startsWith(`## `)||/^##\s+R\d+\s*[—–-]+\s*\S/.test(e),O=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Your draft is kept — Save again.`,k=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Try again.`;function A({value:e,onChange:t,onCancel:n,onSave:r,busy:i}){let[a]=(0,v.useState)(e.scope),o=n=>r=>t({...e,[n]:r.target.value}),s=e.body.trim().split(E).some(D)?`A line cannot start with “## ” — user-rules.md reads it as a new rule heading. Use ### or plain text.`:``,c=!(e.title.trim()&&e.body.trim()),l=!c&&!s;return(0,S.jsxs)(`div`,{className:`rule-form`,children:[(0,S.jsxs)(`label`,{className:`field`,children:[(0,S.jsx)(`span`,{children:`Rule title`}),(0,S.jsx)(`input`,{className:`lib-filter`,type:`text`,value:e.title,onChange:o(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,autoFocus:!0})]}),(0,S.jsxs)(`label`,{className:`field`,children:[(0,S.jsx)(`span`,{children:`Rule body`}),(0,S.jsx)(`textarea`,{className:`rule-body-input`,value:e.body,onChange:o(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`rule-body-error`:void 0})]}),s?(0,S.jsx)(`p`,{id:`rule-body-error`,className:`sub rule-notice`,role:`alert`,children:s}):null,(0,S.jsxs)(`div`,{className:`row wrap`,children:[(0,S.jsxs)(`label`,{className:`field`,children:[(0,S.jsx)(`span`,{children:`Rule scope`}),(0,S.jsxs)(`select`,{className:`sel`,value:e.scope,onChange:o(`scope`),children:[(0,S.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,S.jsx)(`option`,{value:`global`,children:`scope: global (every repository)`}),w.includes(a)?null:(0,S.jsxs)(`option`,{value:a,children:[`scope: `,a,` (as written in the file)`]})]})]}),(0,S.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,S.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:e.trial_until,onChange:o(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,S.jsxs)(`div`,{className:`row gap-8`,style:{marginLeft:`auto`},children:[(0,S.jsx)(`button`,{className:`btn sm`,disabled:!l||i,onClick:()=>r(e),"aria-describedby":c?`rule-form-hint`:void 0,children:i?`Saving…`:`Save rule`}),(0,S.jsx)(`button`,{className:`btn ghost sm`,disabled:i,onClick:n,children:`Cancel`})]})]}),c?(0,S.jsx)(`p`,{id:`rule-form-hint`,className:`panel-note`,children:`A rule needs a title and a body.`}):null]})}function j({rule:e,isOpen:t,onToggle:n,onEdit:r,onDelete:i,onGraduate:a}){return(0,S.jsxs)(`div`,{className:`rule-row ${t?`on`:``}`,children:[(0,S.jsxs)(`button`,{className:`rule-head`,onClick:n,"aria-expanded":t,"data-rule-head":e.id,children:[(0,S.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,S.jsx)(`span`,{className:`rule-title`,children:e.title}),(0,S.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,S.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),t&&(0,S.jsxs)(`div`,{className:`rule-expand`,children:[(0,S.jsx)(`p`,{children:e.body}),e.source?(0,S.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,S.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10},children:[e.status===`trial`&&(0,S.jsx)(`button`,{className:`btn ghost sm`,onClick:a,title:`Adopt for good — drop the trial marker`,"aria-label":`Graduate R${e.id}`,children:`Graduate`}),(0,S.jsx)(`button`,{className:`btn ghost sm`,onClick:r,"aria-label":`Edit R${e.id}`,children:`Edit`}),(0,S.jsx)(`button`,{className:`btn ghost sm`,onClick:i,"aria-label":`Retire R${e.id}`,children:`Retire`})]})]})]})}function M({onChanged:e}){let t=c(),[n,a]=(0,v.useState)(0),{data:s,error:l}=o(()=>r.rules(),[n]),[d,f]=(0,v.useState)(null),m=()=>a(e=>e+1),h=x({data:s,reload:m}),{draft:g,busy:_,notice:y}=h,b=(0,v.useRef)(null),[w,E]=(0,v.useState)(0),D=e=>{b.current=e,E(e=>e+1)},M=(0,v.useRef)(null),N=(0,v.useRef)(null);if((0,v.useEffect)(()=>{let e=b.current;b.current=null,e!==null&&(e===`add`?M.current:N.current?.querySelector(`[data-rule-head="${e}"]`))?.focus()},[w]),l)return(0,S.jsx)(u,{error:l,onRetry:m});if(!s)return(0,S.jsx)(i,{});let P=s.rules||[],F=g?.target,I=F!==void 0&&F!==`new`&&!P.some(e=>e.id===F&&e.title===g.title0),L=F===`new`||I,R=async(t,n)=>{let i=await h.save(e=>r.rulesMutate({...t,fingerprint:e}),{conflict:n?O:k});return i&&n&&h.close(),e?.(),i},z=e=>h.setDraft({...g,form:e}),B=async(e,t)=>{await R(e,!0)&&D(t)},V=async e=>{await h.discard()&&D(e)},H=async e=>{await t(`Retire rule R${e.id} — “${e.title}”? It is removed from user-rules.md.`,{title:`Retire this rule?`,confirmLabel:`Retire`,tone:`danger`})&&await R({op:`delete`,id:e.id})&&g===null&&D(`add`)},U=async e=>{await R({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``})&&D(e.id)};return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,S.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,S.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,S.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.`]})]}),s.exists&&g===null&&(0,S.jsx)(`button`,{className:`btn`,ref:M,onClick:()=>h.open({target:`new`,title0:``,form:C}),children:`Add rule`})]}),y?(0,S.jsx)(`p`,{className:`sub rule-notice`,role:`status`,children:y}):null,(s.warnings||[]).map(e=>(0,S.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),L&&(0,S.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,S.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),I?(0,S.jsxs)(`p`,{className:`sub rule-notice`,role:`status`,children:[`Rule R`,F,` is no longer in user-rules.md (an agent session removed or renumbered it). Your draft is kept — Save adds it as a new rule.`]}):null,(0,S.jsx)(A,{value:g.form,onChange:z,busy:_,onCancel:()=>V(`add`),onSave:e=>B({op:`add`,...e},`add`)})]}),s.exists?P.length===0&&!L?(0,S.jsx)(p,{title:`No rules yet`,children:`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,S.jsx)(`div`,{className:`card rules-list`,ref:N,children:P.map(e=>!I&&F===e.id?(0,S.jsx)(`div`,{className:`rule-row on`,children:(0,S.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,S.jsx)(A,{value:g.form,onChange:z,busy:_,onCancel:()=>V(e.id),onSave:t=>B({op:`update`,id:e.id,source:e.source,...t},e.id)})})},e.id):(0,S.jsx)(j,{rule:e,isOpen:d===e.id,onToggle:()=>f(d===e.id?null:e.id),onEdit:()=>{f(e.id),h.open({target:e.id,title0:e.title,form:{title:e.title,body:e.body,scope:T(e.scope),trial_until:e.trial_until}})},onDelete:()=>H(e),onGraduate:()=>U(e)},e.id))}):(0,S.jsxs)(p,{title:`No user-rules.md here yet`,children:[`The build seeds it beside AGENT.md — run a build/update from the Dashboard (or`,` `,(0,S.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}var N=`PROFILE.md changed on disk since you opened it — reloaded the fresh copy. Your draft is kept — Save again.`;function P({onChanged:e}){let{data:t,error:n,loading:a,reload:c,setData:l}=o(()=>r.profile(),[]),d=x({data:t,reload:c}),{draft:f,dirty:h,busy:g,notice:_}=d,[y,b]=(0,v.useState)(!1);if(t&&!y&&(b(!0),(t.text||``).trim()||d.open(t.text||``)),a&&!t)return(0,S.jsx)(i,{});if(n)return(0,S.jsx)(u,{error:n,onRetry:c});let C=f!==null,w=t?.text||``;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,S.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,S.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,S.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` `,`beside the deployed AGENT.md. Unlike `,(0,S.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,S.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),(0,S.jsxs)(`div`,{className:`row`,children:[(0,S.jsxs)(s,{"aria-label":`Profile mode`,children:[(0,S.jsx)(`button`,{className:C?``:`on`,"aria-pressed":!C,onClick:d.discard,children:`View`}),(0,S.jsx)(`button`,{className:C?`on`:``,"aria-pressed":C,onClick:()=>C||d.open(w),children:`Edit`})]}),C&&(0,S.jsx)(`button`,{className:`btn`,disabled:!h||g,onClick:async()=>{let t=await d.save(e=>r.profileSave({text:f,fingerprint:e}),{conflict:N});t&&(l(e=>({...e,text:f,seeded:!1,fingerprint:t.fingerprint||``})),d.setNotice(`Saved.`),d.close(),e?.())},children:g?`Saving…`:`Save`})]})]}),_?(0,S.jsx)(`p`,{className:`sub rule-notice`,role:`status`,children:_}):null,C?(0,S.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:f,onChange:e=>d.setDraft(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):w.trim()?(0,S.jsxs)(S.Fragment,{children:[t?.seeded?(0,S.jsxs)(p,{title:`This is still the template`,action:(0,S.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>d.open(w),children:`Edit it here`}),children:[`Ask the agent to run the `,(0,S.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]}):null,(0,S.jsx)(`div`,{className:`card pad-lg`,children:(0,S.jsx)(m,{body:w})})]}):(0,S.jsxs)(p,{title:`No profile yet`,children:[`Switch to Edit to write one, or ask the agent to run the`,` `,(0,S.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})]})}var F=(e,t)=>`${e} ${t}${e===1?``:`s`}`,I=new Set([`MEMORY`,`NOTEBOOK`,`README`]),L=e=>e?(e.items||[]).filter(e=>!I.has(String(e.name).toUpperCase())).length:null;function R({rules:e,profile:t,facts:n,notes:r}){let i=e?.exists?e.stats:null;if(!i)return null;let a=Math.round(Math.max(i.rules/i.max_rules,i.tokens/i.max_tokens)*100),[o,s]=a>=100?[`bad`,`over budget: a bloated rule set dilutes the rules that matter`]:a>=70?[`warn`,`getting heavy; consider merging or pruning`]:[`accent`,i.rules?`${i.rules} rules in ${i.lines} lines.`:`All of it is the file’s preamble; no rule text yet.`],c=[{k:`Profile`,v:t?.seeded?`template`:t?.exists?`written`:`missing`,warn:!!t?.seeded},{k:`Rules`,v:`${i.rules}/${i.max_rules}`},{k:`Memory`,v:n==null?`n/a`:F(n,`fact`)},{k:`Notebook`,v:r==null?`n/a`:F(r,`note`)}];return(0,S.jsxs)(`div`,{className:`card-row`,children:[(0,S.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`h2`,{id:`pc-budget`,children:`Rule budget`}),(0,S.jsxs)(`span`,{className:`mono dim`,children:[i.rules,` of `,i.max_rules]})]}),(0,S.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,S.jsx)(`span`,{className:t<i.rules?`used`:``},t))}),(0,S.jsxs)(`p`,{className:`big-num`,children:[(0,S.jsx)(`span`,{className:`mono`,children:i.tokens}),` `,(0,S.jsxs)(`span`,{className:`dim`,children:[`/ `,i.max_tokens.toLocaleString(`en-US`),` tokens, every turn`]})]}),(0,S.jsx)(g,{value:i.tokens,max:i.max_tokens,label:`tokens`,tone:o}),(0,S.jsx)(`p`,{className:`panel-note`,children:s})]}),(0,S.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,S.jsx)(`ul`,{className:`hbars`,children:c.map(e=>(0,S.jsxs)(`li`,{children:[(0,S.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,S.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))})]})]})}var z={memory:{title:`No facts yet`,body:`The agent writes facts through the rule skill — say “remember that…” in a session.`},notebook:{title:`No notes yet`,body:`The notebook is the agent’s own scratch space: plans and notes it keeps for itself.`}};function B({tab:e=`rules`,item:t,dataRev:n}){let i=e=>Promise.resolve(e).catch(()=>null),{data:s,reload:c}=a(n),{data:u,reload:d}=o(()=>i(r.profile()),[n]),{data:f,reload:m}=o(()=>r.catalog(`memory`),[`memory`,n],`catalog`),{data:g}=o(()=>r.catalog(`notebook`),[`notebook`,n],`catalog`),v=L(f),y=L(g),b={memory:v,notebook:y},x={rules:s?.stats?.rules,profile:u?.seeded?`template`:null,memory:v,notebook:y},C=e===`memory`||e===`notebook`;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(l,{title:`Personal`,sub:`The only files you write. They survive updates, reinstalls and voice changes.`}),(0,S.jsx)(h,{page:`personal`,current:e,badges:x,label:`Personal files`}),e===`rules`&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(R,{rules:s,profile:u,facts:v,notes:y}),(0,S.jsx)(M,{onChanged:c})]}),e===`profile`&&(0,S.jsx)(P,{onChanged:d}),C&&b[e]===0&&!t?(0,S.jsx)(p,{title:z[e].title,children:z[e].body}):C?(0,S.jsx)(_,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:n,onRulesChanged:()=>{c(),m()}},e):null]})}export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{at as r,ft as i,it as a,lt as o}from"./index-Dwo3Gxek.js";var s=e(t(),1),c=n(),l=500;function u({parts:e,total:t,label:n}){let u=e.reduce((e,t)=>e+t.n,0),d=t??u,f=e=>d>0?`${e/d*100}%`:`0%`,p=e.map(e=>`${e.label}: ${e.n} of ${d}`).join(`, `),m=(0,s.useRef)(null),h=e.map(e=>e.n).join(`,`)+`/${d}`;return(0,s.useLayoutEffect)(()=>{if(m.current&&a())return o(m.current,{scaleX:0}),r(i(m.current,{scaleX:[0,1],duration:l,ease:`outExpo`}),l)},[h]),(0,c.jsxs)(`div`,{className:`stackbar-box`,children:[(0,c.jsx)(`div`,{className:`stackbar sweep`,role:`img`,"aria-label":n?`${n}: ${p}`:p,ref:m,children:e.map(e=>e.n>0?(0,c.jsx)(`span`,{className:`tone-${e.tone||`muted`}`,style:{width:f(e.n)},title:`${e.label}: ${e.n}`},e.key):null)}),(0,c.jsx)(`ul`,{className:`stackbar-legend`,"aria-hidden":`true`,children:e.map(e=>(0,c.jsxs)(`li`,{children:[(0,c.jsx)(`i`,{className:`tone-${e.tone||`muted`}`}),e.label,` `,(0,c.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function d({value:e,max:t,label:n=`value`,tone:r=`accent`}){let i=t>0?t:0;return(0,c.jsx)(u,{parts:[{key:`v`,label:n,n:Math.min(Math.max(e||0,0),i),tone:r}],total:i})}export{u as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{$ as n,et as r}from"./index-Dwo3Gxek.js";e();var i=t();function a({page:e,current:t,badges:a={},label:o}){return(0,i.jsx)(`nav`,{className:`tabs`,"aria-label":o,children:n[e].map(n=>(0,i.jsxs)(`a`,{href:`#/${e}/${n}`,className:t===n?`on`:``,"aria-current":t===n?`page`:void 0,children:[r[n],a[n]==null?null:(0,i.jsx)(`span`,{className:`tab-badge`,children:a[n]})]},n))})}export{a as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{V as r,at as i,ft as a,it as o,lt as s}from"./index-Dwo3Gxek.js";import{r as c}from"./jobBuckets-Dpjvbfm1.js";var l=e(t(),1),u=n(),d={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)`}};function f(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var p=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 m(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 h({startedAt:e}){let[t,n]=(0,l.useState)(()=>Date.now()/1e3);return(0,l.useEffect)(()=>{let e=setInterval(()=>n(Date.now()/1e3),1e3);return()=>clearInterval(e)},[]),m(t-e)}function g({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,u.jsxs)(`span`,{className:`act-todo`,children:[(0,u.jsx)(`span`,{className:`on`,children:`●`.repeat(r)}),(0,u.jsx)(`span`,{className:`dim`,children:`○`.repeat(n-r)})]})}var _=e=>!!(e.tokens>0||e.cost>0||e.turn_started_at||e.files?.count>0);function v({s:e,heading:t,id:n,children:i}){let a=d[e.status]||d.idle,o=e.files,s=_(e),c=e=>n?`${n}-${e}`:void 0;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`row between wrap gap-12`,children:[t?(0,u.jsxs)(`div`,{className:`row gap-10 act-min`,children:[(0,u.jsx)(`span`,{className:`feed-dot act-dot ${a.cls||`acc`}`}),(0,u.jsxs)(`div`,{className:`act-min`,children:[(0,u.jsx)(`h2`,{className:`act-title`,id:c(`t`),children:t}),e.cwd&&(0,u.jsx)(`div`,{className:`dim mono act-cwd`,title:e.cwd,children:e.cwd})]})]}):null,(0,u.jsxs)(`div`,{className:`row gap-8 act-fixed`,children:[e.model&&(0,u.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,u.jsx)(`span`,{className:`badge`,children:e.agent}),(0,u.jsxs)(`span`,{className:`badge ${a.cls}`,id:c(`st`),children:[(0,u.jsx)(`span`,{className:`dot`}),a.label]}),i]})]}),e.phase&&(0,u.jsxs)(`div`,{className:`row gap-8 act-phase`,children:[(0,u.jsx)(r,{name:`activity`}),(0,u.jsx)(`span`,{className:`act-ell`,children:e.phase})]}),s&&(0,u.jsxs)(`div`,{className:`row wrap act-counters`,id:c(`c`),children:[e.tokens>0&&(0,u.jsxs)(`span`,{children:[p(e.tokens),` tok`]}),e.cost>0&&(0,u.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),e.turn_started_at?(0,u.jsx)(`span`,{children:(0,u.jsx)(h,{startedAt:e.turn_started_at})}):null,o&&o.count>0&&(0,u.jsxs)(`span`,{children:[o.count,` file`,o.count===1?``:`s`,` `,(0,u.jsxs)(`span`,{className:`t-good`,children:[`+`,o.additions]}),` `,(0,u.jsxs)(`span`,{className:`t-bad`,children:[`−`,o.deletions]})]})]}),(e.error||e.blocked_on)&&(0,u.jsx)(`div`,{className:`act-err-row`,children:(0,u.jsx)(`span`,{className:`badge bad act-ell`,title:e.error||e.blocked_on,children:e.error||e.blocked_on})})]})}var y=e=>e?.status===`blocked`||e?.status===`waiting-input`,b=864e5,x=e=>new Date(e).toISOString().slice(0,10),S=(e,t)=>new Date(`${e}T00:00:00Z`).toLocaleDateString(`en-GB`,{...t,timeZone:`UTC`}),C=e=>S(e,{day:`numeric`,month:`short`});function w(e,t=Date.now()){let n=S(e,{weekday:`long`,day:`numeric`,month:`long`}),r=e===x(t)?`Today`:e===x(t-b)?`Yesterday`:``;return r?`${r} · ${n}`:n}function T(e,{now:t=Date.now(),days:n=14,cap:r}={}){let i=(e||[]).filter(e=>Number.isFinite(e.started)),a={};for(let e of i){let t=x(e.started*1e3);a[t]=(a[t]||0)+1}let o=i.length?x(Math.min(...i.map(e=>e.started))*1e3):null,s=i.filter(e=>e.status!==`running`).length,c=typeof r!=`number`||s>=r;return Array.from({length:n},(e,r)=>{let i=x(t-(n-1-r)*b);return{key:i,n:a[i]||0,nodata:c&&(o===null||i<o)}})}var E=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function D(e,t,n,r=Date.now()){let i={},a=e=>i[e]||={key:e,runs:[],asks:[]};for(let t of c(e,(e||[]).length))Number.isFinite(t.started)&&a(x(t.started*1e3)).runs.push(t);return(n||[]).forEach((e,n)=>{for(let r of t||[])r.per_day?.[n]>0&&a(e).asks.push([r.name,r.per_day[n]])}),Object.values(i).sort((e,t)=>e.key<t.key?1:-1).map(({key:e,runs:t,asks:n})=>{n.sort((e,t)=>t[1]-e[1]);let i=n.reduce((e,t)=>e+t[1],0),a=n.map(([e,t],n)=>`${e}${n?``:` asked`} ${t}×`).join(`, `),o=[t.length&&E(t.length,`run`),i&&E(i,`gate ask`)];return{key:e,title:w(e,r),sum:o.filter(Boolean).join(` · `),runs:t,gate:i?{title:a,n:i}:null}})}var O=500;function k({vals:e,i:t,sweep:n=!1}){let r=(0,l.useRef)(null),c=e.join(`,`);(0,l.useLayoutEffect)(()=>{if(n&&r.current&&o())return s(r.current,{strokeDasharray:1,strokeDashoffset:1}),i(a(r.current,{strokeDashoffset:[1,0],duration:O,ease:`outExpo`}),O)},[c,n]);let d=Math.max(1,...e),f=96/(e.length-1),p=e.map((e,t)=>`${(t*f).toFixed(1)},${(20-e/d*17).toFixed(1)}`),[m,h]=p[p.length-1].split(`,`);return(0,u.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,"aria-hidden":`true`,style:{"--i":t},children:[(0,u.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,u.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${p.join(` `)} 96,21`}),(0,u.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:p.join(` `),ref:r}),(0,u.jsx)(`circle`,{className:`spk-end`,cx:m,cy:h,r:`2.4`})]})}function A(e,t){let n=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{let e=n.current?[...n.current.querySelectorAll(`[data-sweep]`)]:[];if(e.length&&o())return s(e,{[t]:0}),i(a(e,{[t]:[0,1],duration:O,ease:`outExpo`}),O)},[e,t]),n}export{p as a,y as c,A as d,f as i,T as l,k as n,D as o,g as r,_ as s,v as t,C as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{At as e,Ct as t,Ft as n,Mt as r,mt as i}from"./index-Dwo3Gxek.js";var a=t=>{let n=1;if(t&&t.getCTM){let r=t.getCTM();r&&(n=(e(r.a*r.a+r.b*r.b)+e(r.c*r.c+r.d*r.d))/2)}return n},o=(e,i,o)=>{let s=r,c=getComputedStyle(e),l=c.strokeLinecap,u=c.vectorEffect===`non-scaling-stroke`?e:null,d=l,f=new Proxy(e,{get(e,r){let i=e[r];return r===n?e:r===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),r=+n[0],i=+n[1],o=a(u),c=r*-s*o,f=i*s*o+c,p=s*o+(r===0&&i===1||r===1&&i===0?0:10*o)-f;if(l!==`butt`){let t=r===i?`butt`:l;d!==t&&(e.style.strokeLinecap=`${t}`,d=t)}e.setAttribute(`stroke-dashoffset`,`${c}`),e.setAttribute(`stroke-dasharray`,`${f} ${p}`)}return Reflect.apply(i,e,t)}:t(i)?(...t)=>Reflect.apply(i,e,t):i}});return e.getAttribute(`pathLength`)!==`${s}`&&(e.setAttribute(`pathLength`,`${s}`),f.setAttribute(`draw`,`${i} ${o}`)),f},s=(e,t=0,n=0)=>i(e).map(e=>o(e,t,n));export{s as t};
|