geneseed 6.0.3 → 6.0.4
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 +18 -0
- package/DESIGN.md +1 -1
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +0 -42
- package/adapters/opencode/plugins/geneseed-learn.js +13 -4
- package/bin/geneseed-hook.mjs +5 -0
- package/docs/concepts/hooks.md +6 -6
- package/docs/guides/install-scripted.md +1 -1
- package/docs/reference/env-context.md +2 -1
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/reference/profiles.md +1 -0
- package/docs/understand/a-day.md +1 -1
- package/docs/understand/machine-claude.md +1 -1
- package/docs/web-ui.md +2 -2
- package/harness.config.json +1 -1
- package/js/build/args.mjs +4 -3
- package/js/build/driver.mjs +8 -8
- package/js/build/emit-claude.mjs +59 -4
- package/js/build/generate.mjs +11 -2
- package/js/build/profile.mjs +10 -5
- package/js/build/render.mjs +3 -1
- package/js/build/source.mjs +12 -1
- package/js/cli-table.json +37 -0
- package/js/hosts/hooks-context.mjs +1 -56
- package/js/hosts/hooks-learn.mjs +435 -55
- package/js/hosts/installs.mjs +22 -2
- package/js/hosts/memory-files.mjs +89 -6
- package/js/hosts/native.mjs +23 -1
- package/js/hosts/settings.mjs +77 -4
- package/js/inspect/diff.mjs +3 -1
- package/js/inspect/doctor.mjs +37 -3
- package/js/inspect/status.mjs +38 -5
- package/js/inspect/validate.mjs +1 -1
- package/js/lib/proc.mjs +36 -0
- package/js/maintain/profiles.mjs +15 -4
- package/js/maintain/setup.mjs +31 -7
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +5 -3
- package/js/web/api.mjs +2 -2
- package/js/web/profiles-api.mjs +2 -2
- package/js/web/state.mjs +13 -2
- package/package.json +1 -1
- package/src/AGENT.md.tmpl +1 -1
- package/src/agents/memory-curator.md +3 -0
- package/src/doctrines/process.md +2 -2
- package/src/memory/README.md +24 -4
- package/src/skills/rule.md +9 -5
- package/web/dist/assets/{Activity-IAxWF2wK.js → Activity-BsMFA5Aa.js} +1 -1
- package/web/dist/assets/{ActivityDetail-CtC2DLvh.js → ActivityDetail-C66n3oul.js} +1 -1
- package/web/dist/assets/{Bonsai-BoKo68Kw.js → Bonsai-BCd-qt7W.js} +1 -1
- package/web/dist/assets/{CopyButton-C0VTiqmb.js → CopyButton-Dpl0PFja.js} +1 -1
- package/web/dist/assets/{Dashboard-CRGCp2cV.js → Dashboard-CQxdiv7F.js} +2 -2
- package/web/dist/assets/{Docs-DwOwzaD6.js → Docs-D0XlXuiA.js} +1 -1
- package/web/dist/assets/{Factories-DxHD2T-1.js → Factories-CPVBoWoA.js} +1 -1
- package/web/dist/assets/{GreenhouseView-D5VOmhmR.js → GreenhouseView-C_2auUA8.js} +1 -1
- package/web/dist/assets/Installs-CXqjmqms.js +3 -0
- package/web/dist/assets/{JournalView-gUSGysTm.js → JournalView-S-igd-Nv.js} +1 -1
- package/web/dist/assets/{Kits-DYQvykZ0.js → Kits-K6mu91rm.js} +1 -1
- package/web/dist/assets/{Laws-UVk0uojS.js → Laws-j5vKNwLT.js} +1 -1
- package/web/dist/assets/{LibRows-CwK63kjB.js → LibRows-1yTY0Kwn.js} +1 -1
- package/web/dist/assets/{Library-DdzyrwUK.js → Library-BQZnFdWs.js} +1 -1
- package/web/dist/assets/{Loops-yHga7xdr.js → Loops-B5DgxpLm.js} +1 -1
- package/web/dist/assets/Models-C-4Y4jvx.js +1 -0
- package/web/dist/assets/{OperatorHudView-D1lQF-ZY.js → OperatorHudView-_8NBAvkd.js} +1 -1
- package/web/dist/assets/Personal-Bf7zHDc6.js +2 -0
- package/web/dist/assets/{Settings-Brgec4M0.js → Settings-BTrA6MXv.js} +1 -1
- package/web/dist/assets/{Tabs-BHjxciOL.js → Tabs-BDhZImxa.js} +1 -1
- package/web/dist/assets/controls-CREglcUF.js +1 -0
- package/web/dist/assets/{index-BfyZCNu7.css → index-9iBqq7i2.css} +1 -1
- package/web/dist/assets/{index-BILaKHbH.js → index-BiKWWv7Z.js} +3 -3
- package/web/dist/index.html +2 -2
- package/web/dist/assets/Installs-B5hFSUeN.js +0 -3
- package/web/dist/assets/Models-DAgkQ4CE.js +0 -1
- package/web/dist/assets/Personal-DjhIfa9v.js +0 -2
- package/web/dist/assets/controls-CK7qHA8H.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-C1iE8mnY.js";import{Ct as i}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-C1iE8mnY.js";import{Ct as i}from"./index-BiKWWv7Z.js";import{t as a}from"./FilterInput-qGKNSlxv.js";var o=n(),s=e(t(),1),c=r(),l={experimental:{label:`experimental`,cls:`warn`,icon:`flask`,hint:`Shipped, but not yet confirmed by real use.`},deprecated:{label:`deprecated`,cls:`bad`,icon:`clear`,hint:`On its way out — look for the replacement before building on it.`},personal:{label:`personal`,cls:``,icon:`profile`,hint:`Yours — present in this install, not shipped or versioned by Geneseed.`},unknown:{label:`no status`,cls:``,icon:`about`,hint:`Not listed in registry.json.`}};function u({status:e,withHint:t=!1,compact:n=!1}){let r=l[e];if(!r)return null;if(n)return(0,c.jsxs)(`span`,{className:`badge status-icon ${r.cls}`,title:`${r.label}: ${r.hint}`,children:[(0,c.jsx)(i,{name:r.icon}),(0,c.jsx)(`span`,{className:`sr-only`,children:r.label})]});let a=(0,c.jsxs)(`span`,{className:`badge ${r.cls}`,title:t?void 0:r.hint,children:[(0,c.jsx)(`span`,{className:`dot`}),r.label]});return t?(0,c.jsxs)(c.Fragment,{children:[a,(0,c.jsx)(`span`,{className:`dim`,children:r.hint})]}):a}function d({items:e}){return Object.keys(l).filter(t=>e.some(e=>e.status===t)).map(e=>(0,c.jsxs)(`span`,{title:l[e].hint,children:[(0,c.jsx)(`span`,{className:`badge status-icon ${l[e].cls}`,"aria-hidden":`true`,children:(0,c.jsx)(i,{name:l[e].icon})}),l[e].label]},e))}function f({label:e,total:t,cats:n,cat:r,onChange:i}){if(n.length<=1)return null;let a=[{key:`all`,label:`All`,n:t,c:`var(--text-3)`},...n];return(0,c.jsxs)(`div`,{className:`rail-cats`,children:[(0,c.jsx)(`ul`,{"aria-label":e,children:a.map(({key:e,label:t,n,c:a})=>(0,c.jsx)(`li`,{children:(0,c.jsxs)(`button`,{type:`button`,className:r===e?`on`:``,"aria-pressed":r===e,style:{"--cc":a},onClick:()=>i(e),children:[(0,c.jsx)(`span`,{className:`cdot`,"aria-hidden":`true`}),(0,c.jsx)(`span`,{className:`rc-name`,title:t,children:t}),(0,c.jsx)(`span`,{className:`mono dim`,children:n})]})},e))}),(0,c.jsx)(`div`,{className:`rail-mix`,"aria-hidden":`true`,children:n.map(({key:e,n:t,c:n})=>(0,c.jsx)(`span`,{className:r===`all`||r===e?``:`dim`,style:{"--cc":n,flexGrow:t}},e))})]})}function p(e){let t=[],n=new Map;for(let r of e)n.has(r.group)||t.push(r.group),n.set(r.group,(n.get(r.group)||0)+1);return t.map(e=>({key:e,label:e,n:n.get(e),c:`var(--accent)`}))}var m=({name:e})=>(0,c.jsxs)(`span`,{className:`tag acc`,title:`Ships with the ${e} kit`,children:[`kit: `,e]}),h=()=>(0,c.jsx)(`span`,{className:`tag acc`,title:`Every agent inherits this agent's root file`,children:`base`});function g(e,t){let n=(t||``).trim().toLowerCase();return n?e.filter(e=>`${e.title||``} ${e.name||``} ${e.desc||``}`.toLowerCase().includes(n)):e}function _({label:e,count:t,extra:n,tools:r,toolsCompact:i,q:l,onQ:u,matched:d,inView:p,current:m,sections:h,cats:g,cat:_,onCat:v,total:y,catLabel:w,children:T}){let E=C(p),D=E.list,O=S([...p,D]),k=(0,s.useId)(),A=(0,s.useRef)(null);(0,s.useLayoutEffect)(()=>x(O.current));let[j,M]=(0,s.useState)(``),N=(0,s.useRef)(!0);return(0,s.useEffect)(()=>{N.current?N.current=!1:M(O.current?.querySelector(`.lib-row.on`)?.dataset.title||``)},p),(0,c.jsxs)(`section`,{className:`lib-list`,"aria-label":e,onKeyDown:e=>{e.key===`ArrowDown`&&e.target.classList?.contains(`lib-filter`)&&(e.preventDefault(),D||(0,o.flushSync)(()=>E.setList(!0)),O.current?.querySelector(`.lib-row`)?.focus())},"data-open":D,children:[(0,c.jsxs)(`div`,{className:`lib-list-head`,children:[(0,c.jsxs)(`b`,{children:[e,` `,(0,c.jsx)(`span`,{className:`mono dim`,children:t})]}),n]}),(0,c.jsxs)(`div`,{className:`lib-toolbar`,children:[h?(0,c.jsx)(`nav`,{className:`lib-seg`,"aria-label":`Sections`,children:h.map(e=>(0,c.jsxs)(`a`,{href:e.href,className:e.on?`on`:``,"aria-current":e.on?`page`:void 0,onClick:e=>{e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0||E.setList(!0)},children:[e.label,(0,c.jsx)(`span`,{className:`mono`,children:e.n??``})]},e.key))}):null,(0,c.jsxs)(`div`,{className:`lib-toolbar-filter`,children:[(0,c.jsx)(a,{value:l,onChange:u,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),r?(0,c.jsx)(`div`,{className:`lib-tools`,children:r}):null,i?(0,c.jsx)(`div`,{className:`lib-tools-compact`,children:i}):null]}),g?.length>1?(0,c.jsx)(`div`,{className:`lib-chips`,children:(0,c.jsx)(f,{label:w,total:y,cats:g,cat:_,onChange:v})}):null]}),(0,c.jsxs)(`div`,{className:`lib-picker`,children:[(0,c.jsxs)(`button`,{ref:A,type:`button`,className:`lib-list-toggle`,"aria-expanded":D,"aria-controls":k,onClick:()=>E.setList(e=>!e),children:[(0,c.jsx)(`span`,{className:`dim lib-pick-n`,children:d===void 0?``:`${d} ${e.toLowerCase()}`}),(0,c.jsx)(`b`,{children:m}),(0,c.jsx)(`span`,{className:`dim lib-pick-hint`,children:D?`close`:`change`}),(0,c.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,c.jsxs)(`div`,{className:`lib-rows`,id:k,ref:O,onKeyDown:b,onFocus:e=>x(e.currentTarget),onClick:e=>{if(e.metaKey||e.ctrlKey||e.shiftKey||e.button!==0)return;let t=e.target.closest?.(`.lib-row`);t&&!(p[1]&&t.classList.contains(`on`))&&E.pick()},children:[T,l.trim()&&d===0&&(0,c.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,c.jsx)(`div`,{className:`big`,children:`No matches`}),`Nothing in `,e.toLowerCase(),` matches “`,l.trim(),`”.`]})]})]}),(0,c.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:j?`${j} opened`:``})]})}function v({item:e,isOpen:t,href:n,children:r}){return(0,c.jsxs)(`a`,{className:`lib-row${t?` on`:``}`,href:n,"aria-current":t?`true`:void 0,"data-title":e.title||e.name,"data-pinned":e.base?`true`:void 0,children:[(0,c.jsxs)(`span`,{className:`lr-name`,children:[e.title||e.name,(0,c.jsx)(u,{status:e.status,compact:!0}),e.kit?(0,c.jsx)(m,{name:e.kit}):null,e.base?(0,c.jsx)(h,{}):null,r]}),e.desc?(0,c.jsx)(`span`,{className:`lr-desc`,children:e.desc}):null,e.meta?(0,c.jsx)(`span`,{className:`lr-meta mono`,children:e.meta}):null]})}function y({rows:e,activeName:t,hrefOf:n,pills:r}){let i=null,a=[];for(let o of e)o.group&&o.group!==i&&(i=o.group,a.push((0,c.jsxs)(`div`,{className:`lib-group`,children:[o.groupC?(0,c.jsx)(`span`,{className:`cdot`,style:{"--cc":o.groupC},"aria-hidden":`true`}):null,o.group]},`g-${o.group}`))),a.push((0,c.jsx)(v,{item:o,isOpen:t===o.name,href:n(o),children:r?.(o)},o.name));return a}function b(e){let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);if(n===-1)return;let r={ArrowDown:Math.min(n+1,t.length-1),ArrowUp:Math.max(n-1,0),Home:0,End:t.length-1}[e.key];r!==void 0&&(e.preventDefault(),t[r].focus())}function x(e){if(!e)return;let t=[...e.querySelectorAll(`.lib-row`)],n=t.find(e=>e===document.activeElement)||e.querySelector(`.lib-row.on`)||t[0];for(let e of t)e.tabIndex=e===n?0:-1}function S(e){let t=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=t.current,n=e?.querySelector(`.lib-row.on`);if(!n||!e)return;let r=n.offsetTop;r>=e.scrollTop&&r+n.clientHeight<=e.scrollTop+e.clientHeight||(e.scrollTop=Math.max(0,r-e.clientHeight/2+n.clientHeight/2))},e),t}function C([e,t]){let[n,r]=(0,s.useState)(!t),[i,a]=(0,s.useState)([e,t]),[o,c]=(0,s.useState)(!1);return(i[0]!==e||i[1]!==t)&&(a([e,t]),r(o||!t),c(!1)),{list:n,setList:r,pick:()=>c(!0)}}export{g as a,u as c,_ as i,d as l,y as n,f as o,m as r,p as s,h as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Markdown-CxkA7940.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/AgentGlyph-k6o3gCM1.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{i}from"./router-1EhRJy1C.js";import{At as a,B as o,Ct as s,G as c,S as l,St as ee,U as te,Y as u,at as d,dt as f,et as ne,ft as re,ht as p,it as m,ot as h,t as g,tt as _,x as v}from"./index-BILaKHbH.js";import{n as y,t as b}from"./sections-CtFz7HFH.js";import{a as ie,c as ae,i as oe,l as se,n as ce,o as le,r as ue,t as de}from"./LibRows-CwK63kjB.js";import{t as fe}from"./EmptyState-CY5Pm2xy.js";import{o as x}from"./motion-RlUl1osO.js";var S=e(t(),1),C=n();function w({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,C.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function pe({entries:e}){return e.length?(0,C.jsxs)(`table`,{className:`mf-entries`,children:[(0,C.jsx)(`thead`,{className:`sr-only`,children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{scope:`col`,children:`Path`}),(0,C.jsx)(`th`,{scope:`col`,children:`Load`}),(0,C.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,C.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,C.jsx)(`td`,{className:`mf-load-cell`,children:(0,C.jsx)(w,{load:e.load})}),(0,C.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function me({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,C.jsxs)(`div`,{className:`mf-vault`,children:[(0,C.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,C.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,C.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,C.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,C.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(s,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(s,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,C.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,C.jsx)(s,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,C.jsx)(pe,{entries:t})]})}function T({body:e}){let[t,n]=(0,S.useState)(!1),r=(0,S.useId)();return e?(0,C.jsxs)(`div`,{className:`mf-raw`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,C.jsx)(s,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,C.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function he({manifest:e,body:t,name:n}){if(!e)return(0,C.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,C.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,C.jsx)(me,{wiki:e},e.name||t)),(0,C.jsx)(T,{body:t})]}):(0,C.jsxs)(`div`,{className:`mf-empty`,children:[(0,C.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,C.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,C.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,C.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,C.jsx)(T,{body:t})]})}let r=e.context||[];return r.length?(0,C.jsxs)(`div`,{className:`mf-doc`,children:[(0,C.jsx)(pe,{entries:r}),(0,C.jsx)(T,{body:t})]}):(0,C.jsxs)(`div`,{className:`mf-empty`,children:[(0,C.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,C.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,C.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,C.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,C.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,C.jsx)(T,{body:t})]})}function ge({name:e,install:t,installId:n}){let{data:i,error:o}=a(()=>Promise.resolve().then(()=>r.agentModels(t,{light:!0})),[e,t?.host,t?.path]),s=i?.agents?.find(t=>t.name===e);return o||!i?.claude||!s?null:(0,C.jsxs)(`p`,{className:`sub agent-model`,"data-testid":`agent-model-line`,children:[s.tier?`${s.tier} tier`:`not tiered`,` · runs on `,s.model?(0,C.jsx)(`code`,{children:s.model}):`your session model`,` — `,(0,C.jsx)(`a`,{href:`#/models`,onClick:()=>n&&c(`models`,n),children:`Change on Models →`})]})}var E=e=>e>=1e3?`${(e/1e3).toFixed(+(e<1e4))}k`:String(e),D=e=>Math.round(e/4),_e=[{key:`root`,label:`Constitution`,tone:`accent`,has:e=>e.source===`root`},{key:`catalogue`,label:`Catalogues`,tone:`muted`,has:e=>e.source===`catalogue`},{key:`agent`,label:`This agent`,tone:`warn`,has:e=>e.source!==`root`&&e.source!==`catalogue`}],O=[[`dictate`,`Dictates`],[`doctrine`,`Doctrines`],[`user`,`User rules`]],ve={"not-wired":`not wired, re-emit this install`,"no-event":`not delivered on this host`};function k(e,t){if(!e||!t)return``;let n=(e,t)=>e.blocks.filter(e=>e.chars>0&&!t.blocks.some(t=>t.id===e.id)),r=e=>e.id===`session-files`?`session files`:e.label.replace(/^.* spec$/,`spec`);return[...n(e,t).map(e=>`+ ${r(e)} ${E(e.chars)}`),...n(t,e).map(e=>`− ${r(e)} ${E(e.chars)}`)].join(`, `)}var ye=e=>e.kind===`user`?`#/personal/rules`:`#/item/law/${encodeURIComponent(e.id)}`,be=e=>`${e.layer??``}${e.id}`;function A({label:e,n:t,children:n}){return(0,C.jsxs)(`li`,{children:[(0,C.jsx)(`span`,{children:e}),n,(0,C.jsx)(`span`,{className:`mono`,children:E(t)})]})}function xe({loadout:e,base:t,error:n,install:r}){let[i,a]=(0,S.useState)(!1),[s,c]=(0,S.useState)(e?.agent);if(e?.agent!==s&&(c(e?.agent),a(!1)),n)return(0,C.jsx)(`p`,{className:`sub`,children:`Loadout not measured for this install.`});if(!e)return null;let l=e=>e.reduce((e,t)=>e+t.chars,0),ee=l(e.blocks),te=k(e,t),u=_e.map(t=>{let n=e.blocks.filter(t.has);return{...t,blocks:n,n:l(n)}}),[d,f,ne]=u,re=Math.max(1,...d.blocks.map(e=>e.chars)),p=e.blocks.find(e=>e.id===`user-rules`),m=p?ve[p.delivery]:void 0,h=e.rules||[],g=h.filter(e=>!(m&&e.kind===`user`)),_=h.filter(e=>e.citedBySpec),v=[];for(let e of h){let t=e.kind===`dictate`?`Dictates`:e.kind===`user`?`User rules`:e.id.split(`.`)[0],n=v.find(e=>e.name===t);n?n.n+=1:v.push({name:t,n:1,user:e.kind===`user`})}let y=O.map(([e,t])=>[t,g.filter(t=>t.kind===e).length]).filter(([,e])=>e>0);return(0,C.jsxs)(`section`,{className:`loadout`,"aria-label":`Loadout`,children:[(0,C.jsxs)(`header`,{className:`loadout-head`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`h3`,{className:`loadout-eyebrow mono`,children:[`Loadout · `,r||e.host]}),(0,C.jsxs)(`p`,{className:`loadout-total`,children:[(0,C.jsx)(`strong`,{children:E(D(ee))}),(0,C.jsxs)(`span`,{className:`dim`,children:[`tokens at start · `,E(ee),` chars`]})]})]}),te?(0,C.jsxs)(`div`,{className:`loadout-delta`,children:[(0,C.jsxs)(`span`,{className:`dim`,children:[`Against the `,t?.noun||`Primary agent`]}),(0,C.jsx)(`ul`,{children:te.split(`, `).map(e=>(0,C.jsx)(`li`,{className:`mono loadout-pill${e.startsWith(`+`)?` is-plus`:``}`,children:e},e))})]}):null]}),(0,C.jsxs)(`div`,{className:`loadout-bar`,children:[(0,C.jsx)(o,{label:`Loadout`,legend:!1,parts:u.map(e=>({key:e.key,label:e.label,n:e.n,tone:e.tone}))}),(0,C.jsx)(`ul`,{className:`loadout-groups`,"aria-hidden":`true`,children:u.map(e=>e.n>0?(0,C.jsxs)(`li`,{style:{flexGrow:e.n},children:[(0,C.jsx)(`span`,{children:e.label}),` `,(0,C.jsxs)(`span`,{className:`mono dim`,children:[E(e.n),` · `,Math.round(e.n/ee*100),`%`]})]},e.key):null)})]}),(0,C.jsxs)(`details`,{className:`loadout-card`,open:e.agent===`primary`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(`i`,{className:`tone-accent`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`Constitution`}),(0,C.jsx)(`span`,{className:`dim`,children:`root file, loaded by the host`}),(0,C.jsxs)(`span`,{className:`mono dim loadout-sum`,children:[E(d.n),` · ≈ `,E(D(d.n)),` tok`]})]}),(0,C.jsx)(`ul`,{className:`loadout-root`,children:d.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars,children:(0,C.jsx)(`span`,{className:`loadout-mini`,"aria-hidden":`true`,children:(0,C.jsx)(`span`,{style:{width:`${Math.max(4,e.chars/re*100)}%`}})})},e.id))})]}),(0,C.jsxs)(`div`,{className:`loadout-pair`,children:[(0,C.jsxs)(`div`,{className:`loadout-card`,children:[(0,C.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,C.jsx)(`i`,{className:`tone-muted`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`Catalogues`}),(0,C.jsx)(`span`,{className:`mono dim loadout-sum`,children:E(f.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:f.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars},e.id))}),(0,C.jsx)(`p`,{className:`dim loadout-note`,children:`Listed by the host, not by Geneseed.`})]}),(0,C.jsxs)(`div`,{className:`loadout-card is-own`,children:[(0,C.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,C.jsx)(`i`,{className:`tone-warn`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`This agent`}),(0,C.jsx)(`span`,{className:`mono dim loadout-sum`,children:E(ne.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:ne.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars,children:e.id===`user-rules`?(0,C.jsx)(`span`,{className:`loadout-pill${m?` is-plus`:``}`,children:m||`injected at sub-agent start`}):null},e.id))})]})]}),(0,C.jsxs)(`section`,{className:`loadout-rules`,"aria-label":`Rules it follows`,children:[(0,C.jsxs)(`div`,{className:`loadout-rules-h`,children:[(0,C.jsxs)(`h4`,{className:`loadout-eyebrow mono`,children:[`Rules it follows · `,g.length]}),(0,C.jsx)(`span`,{className:`dim`,children:y.map(([e,t])=>`${t} ${e}`).join(` · `)})]}),_.length?(0,C.jsxs)(`div`,{className:`loadout-cited`,children:[(0,C.jsx)(`span`,{className:`loadout-cited-h`,children:`Cited by its spec`}),_.map(e=>(0,C.jsxs)(`a`,{href:ye(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` · `,e.title]},be(e)))]}):null,(0,C.jsx)(`ul`,{className:`loadout-packs`,children:v.map(e=>e.user&&m?(0,C.jsxs)(`li`,{className:`is-muted`,children:[(0,C.jsx)(`span`,{children:`User rules`}),` `,(0,C.jsx)(`span`,{className:`mono`,children:e.n}),` `,(0,C.jsx)(`span`,{className:`dim`,children:m})]},e.name):(0,C.jsx)(`li`,{children:(0,C.jsxs)(`a`,{href:e.user?`#/personal/rules`:`#/laws`,children:[(0,C.jsx)(`span`,{children:e.name}),` `,(0,C.jsx)(`span`,{className:`mono dim`,children:e.n})]})},e.name))}),h.length?(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?`Show fewer`:`Show all ${h.length}${m?` listed`:``} rules`}):null,i?O.map(([e,t])=>{let n=h.filter(t=>t.kind===e),r=m&&e===`user`;return n.length?(0,C.jsxs)(`div`,{className:r?`is-muted`:void 0,children:[(0,C.jsxs)(`h5`,{className:`reader-when-h`,children:[t,` `,(0,C.jsx)(`span`,{className:`mono dim`,children:n.length}),r?(0,C.jsxs)(`span`,{className:`dim`,children:[` · `,m]}):null]}),(0,C.jsx)(`ul`,{children:n.map(e=>(0,C.jsxs)(`li`,{children:[r?(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}):(0,C.jsxs)(`a`,{href:ye(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}),e.layer&&e.layer!==`install`?(0,C.jsxs)(`span`,{className:`dim`,children:[` (`,e.layer,`)`]}):null]},be(e)))})]},e):null}):null]}),(0,C.jsxs)(`p`,{className:`dim loadout-foot`,children:[`Not counted: `,e.notCounted.join(`; `),`. Tokens are chars ÷ 4.`]})]})}function Se({label:e,options:t,value:n,onChange:r}){let[i,a]=(0,S.useState)(!1),o=(0,S.useRef)(null),s=(0,S.useId)(),c=t.find(e=>e.key===n)||t[0],l=()=>a(!1);return(0,S.useEffect)(()=>{i&&document.getElementById(s)?.querySelector(`[aria-pressed="true"]`)?.focus()},[i,s]),(0,C.jsxs)(`span`,{className:`drop-menu`,children:[(0,C.jsxs)(`button`,{ref:o,type:`button`,className:`drop-menu-btn`,"aria-label":`${e}: ${c.label}`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-controls":i?s:void 0,onClick:()=>a(e=>!e),children:[c.label,(0,C.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,C.jsx)(d,{open:i,onClose:l,anchorRef:o,label:e,className:`drop-menu-pop`,children:(0,C.jsx)(`div`,{id:s,className:`drop-menu-list`,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`button`)],n=t.indexOf(document.activeElement);e.preventDefault(),t[(n+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:t.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-pressed":e.key===c.key,onClick:()=>{r(e.key),l()},children:e.label},e.key))})})]})}function Ce({label:e,value:t,delta:n,children:r}){let i=x(Number.isInteger(t)?t:null);return(0,C.jsxs)(`div`,{className:`stat`,children:[(0,C.jsx)(`div`,{className:`stat-label`,children:e}),(0,C.jsx)(`div`,{className:`stat-value mono`,children:i===null?t:Math.round(i)}),n==null?null:(0,C.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var we=(0,S.lazy)(()=>g(()=>import(`./Markdown-CxkA7940.js`).then(e=>e.n),__vite__mapDeps([0,1,2]))),Te=(0,S.lazy)(()=>g(()=>import(`./AgentGlyph-k6o3gCM1.js`),__vite__mapDeps([3,1,2]))),Ee={skills:`skill`,agents:`agent`},De=`:primary`,Oe=(e,t)=>`${t?e/t*100:0}%`,ke=e=>e.split(`:`).slice(0,2).join(` `),Ae=e=>e.split(`/`).map((e,t)=>(0,C.jsxs)(S.Fragment,{children:[t?`/`:null,t?(0,C.jsx)(`wbr`,{}):null,e]},t)),j=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},je=e=>p(j(e));function Me(e,t){return e===`memory`?`memory/${t}`:e===`notebook`?`notebook/${t}`:e===`wiki`?`geneseed-wiki.jsonc`:e===`config`?t:e===`skills`?`skills/${t}/SKILL.md`:`${e}/${t}.md`}function Ne({section:e,source:t}){return(0,C.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,C.jsx)(s,{name:y[e].icon,className:`glyph`}),(0,C.jsxs)(`span`,{children:[`This entry is part of the `,y[e].label.toLowerCase(),` convention; see`,` `,(0,C.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var Pe=e=>e.replace(/\s+/g,` `).trim(),Fe=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ie(e,t){let n=e.replace(/\r\n/g,`
|
|
2
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{i}from"./router-1EhRJy1C.js";import{At as a,B as o,Ct as s,G as c,S as l,St as ee,U as te,Y as u,at as d,dt as f,et as ne,ft as re,ht as p,it as m,ot as h,t as g,tt as _,x as v}from"./index-BiKWWv7Z.js";import{n as y,t as b}from"./sections-CtFz7HFH.js";import{a as ie,c as ae,i as oe,l as se,n as ce,o as le,r as ue,t as de}from"./LibRows-1yTY0Kwn.js";import{t as fe}from"./EmptyState-CY5Pm2xy.js";import{o as x}from"./motion-RlUl1osO.js";var S=e(t(),1),C=n();function w({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,C.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function pe({entries:e}){return e.length?(0,C.jsxs)(`table`,{className:`mf-entries`,children:[(0,C.jsx)(`thead`,{className:`sr-only`,children:(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`th`,{scope:`col`,children:`Path`}),(0,C.jsx)(`th`,{scope:`col`,children:`Load`}),(0,C.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,C.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,C.jsxs)(`tr`,{children:[(0,C.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,C.jsx)(`td`,{className:`mf-load-cell`,children:(0,C.jsx)(w,{load:e.load})}),(0,C.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function me({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,C.jsxs)(`div`,{className:`mf-vault`,children:[(0,C.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,C.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,C.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,C.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,C.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(s,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(s,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,C.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,C.jsx)(s,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,C.jsx)(pe,{entries:t})]})}function T({body:e}){let[t,n]=(0,S.useState)(!1),r=(0,S.useId)();return e?(0,C.jsxs)(`div`,{className:`mf-raw`,children:[(0,C.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,C.jsx)(s,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,C.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function he({manifest:e,body:t,name:n}){if(!e)return(0,C.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,C.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,C.jsx)(me,{wiki:e},e.name||t)),(0,C.jsx)(T,{body:t})]}):(0,C.jsxs)(`div`,{className:`mf-empty`,children:[(0,C.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,C.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,C.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,C.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,C.jsx)(T,{body:t})]})}let r=e.context||[];return r.length?(0,C.jsxs)(`div`,{className:`mf-doc`,children:[(0,C.jsx)(pe,{entries:r}),(0,C.jsx)(T,{body:t})]}):(0,C.jsxs)(`div`,{className:`mf-empty`,children:[(0,C.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,C.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,C.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,C.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,C.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,C.jsx)(T,{body:t})]})}function ge({name:e,install:t,installId:n}){let{data:i,error:o}=a(()=>Promise.resolve().then(()=>r.agentModels(t,{light:!0})),[e,t?.host,t?.path]),s=i?.agents?.find(t=>t.name===e);return o||!i?.claude||!s?null:(0,C.jsxs)(`p`,{className:`sub agent-model`,"data-testid":`agent-model-line`,children:[s.tier?`${s.tier} tier`:`not tiered`,` · runs on `,s.model?(0,C.jsx)(`code`,{children:s.model}):`your session model`,` — `,(0,C.jsx)(`a`,{href:`#/models`,onClick:()=>n&&c(`models`,n),children:`Change on Models →`})]})}var E=e=>e>=1e3?`${(e/1e3).toFixed(+(e<1e4))}k`:String(e),D=e=>Math.round(e/4),_e=[{key:`root`,label:`Constitution`,tone:`accent`,has:e=>e.source===`root`},{key:`catalogue`,label:`Catalogues`,tone:`muted`,has:e=>e.source===`catalogue`},{key:`agent`,label:`This agent`,tone:`warn`,has:e=>e.source!==`root`&&e.source!==`catalogue`}],O=[[`dictate`,`Dictates`],[`doctrine`,`Doctrines`],[`user`,`User rules`]],ve={"not-wired":`not wired, re-emit this install`,"no-event":`not delivered on this host`};function k(e,t){if(!e||!t)return``;let n=(e,t)=>e.blocks.filter(e=>e.chars>0&&!t.blocks.some(t=>t.id===e.id)),r=e=>e.id===`session-files`?`session files`:e.label.replace(/^.* spec$/,`spec`);return[...n(e,t).map(e=>`+ ${r(e)} ${E(e.chars)}`),...n(t,e).map(e=>`− ${r(e)} ${E(e.chars)}`)].join(`, `)}var ye=e=>e.kind===`user`?`#/personal/rules`:`#/item/law/${encodeURIComponent(e.id)}`,be=e=>`${e.layer??``}${e.id}`;function A({label:e,n:t,children:n}){return(0,C.jsxs)(`li`,{children:[(0,C.jsx)(`span`,{children:e}),n,(0,C.jsx)(`span`,{className:`mono`,children:E(t)})]})}function xe({loadout:e,base:t,error:n,install:r}){let[i,a]=(0,S.useState)(!1),[s,c]=(0,S.useState)(e?.agent);if(e?.agent!==s&&(c(e?.agent),a(!1)),n)return(0,C.jsx)(`p`,{className:`sub`,children:`Loadout not measured for this install.`});if(!e)return null;let l=e=>e.reduce((e,t)=>e+t.chars,0),ee=l(e.blocks),te=k(e,t),u=_e.map(t=>{let n=e.blocks.filter(t.has);return{...t,blocks:n,n:l(n)}}),[d,f,ne]=u,re=Math.max(1,...d.blocks.map(e=>e.chars)),p=e.blocks.find(e=>e.id===`user-rules`),m=p?ve[p.delivery]:void 0,h=e.rules||[],g=h.filter(e=>!(m&&e.kind===`user`)),_=h.filter(e=>e.citedBySpec),v=[];for(let e of h){let t=e.kind===`dictate`?`Dictates`:e.kind===`user`?`User rules`:e.id.split(`.`)[0],n=v.find(e=>e.name===t);n?n.n+=1:v.push({name:t,n:1,user:e.kind===`user`})}let y=O.map(([e,t])=>[t,g.filter(t=>t.kind===e).length]).filter(([,e])=>e>0);return(0,C.jsxs)(`section`,{className:`loadout`,"aria-label":`Loadout`,children:[(0,C.jsxs)(`header`,{className:`loadout-head`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`h3`,{className:`loadout-eyebrow mono`,children:[`Loadout · `,r||e.host]}),(0,C.jsxs)(`p`,{className:`loadout-total`,children:[(0,C.jsx)(`strong`,{children:E(D(ee))}),(0,C.jsxs)(`span`,{className:`dim`,children:[`tokens at start · `,E(ee),` chars`]})]})]}),te?(0,C.jsxs)(`div`,{className:`loadout-delta`,children:[(0,C.jsxs)(`span`,{className:`dim`,children:[`Against the `,t?.noun||`Primary agent`]}),(0,C.jsx)(`ul`,{children:te.split(`, `).map(e=>(0,C.jsx)(`li`,{className:`mono loadout-pill${e.startsWith(`+`)?` is-plus`:``}`,children:e},e))})]}):null]}),(0,C.jsxs)(`div`,{className:`loadout-bar`,children:[(0,C.jsx)(o,{label:`Loadout`,legend:!1,parts:u.map(e=>({key:e.key,label:e.label,n:e.n,tone:e.tone}))}),(0,C.jsx)(`ul`,{className:`loadout-groups`,"aria-hidden":`true`,children:u.map(e=>e.n>0?(0,C.jsxs)(`li`,{style:{flexGrow:e.n},children:[(0,C.jsx)(`span`,{children:e.label}),` `,(0,C.jsxs)(`span`,{className:`mono dim`,children:[E(e.n),` · `,Math.round(e.n/ee*100),`%`]})]},e.key):null)})]}),(0,C.jsxs)(`details`,{className:`loadout-card`,open:e.agent===`primary`,children:[(0,C.jsxs)(`summary`,{children:[(0,C.jsx)(`i`,{className:`tone-accent`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`Constitution`}),(0,C.jsx)(`span`,{className:`dim`,children:`root file, loaded by the host`}),(0,C.jsxs)(`span`,{className:`mono dim loadout-sum`,children:[E(d.n),` · ≈ `,E(D(d.n)),` tok`]})]}),(0,C.jsx)(`ul`,{className:`loadout-root`,children:d.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars,children:(0,C.jsx)(`span`,{className:`loadout-mini`,"aria-hidden":`true`,children:(0,C.jsx)(`span`,{style:{width:`${Math.max(4,e.chars/re*100)}%`}})})},e.id))})]}),(0,C.jsxs)(`div`,{className:`loadout-pair`,children:[(0,C.jsxs)(`div`,{className:`loadout-card`,children:[(0,C.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,C.jsx)(`i`,{className:`tone-muted`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`Catalogues`}),(0,C.jsx)(`span`,{className:`mono dim loadout-sum`,children:E(f.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:f.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars},e.id))}),(0,C.jsx)(`p`,{className:`dim loadout-note`,children:`Listed by the host, not by Geneseed.`})]}),(0,C.jsxs)(`div`,{className:`loadout-card is-own`,children:[(0,C.jsxs)(`p`,{className:`loadout-card-h`,children:[(0,C.jsx)(`i`,{className:`tone-warn`,"aria-hidden":`true`}),(0,C.jsx)(`strong`,{children:`This agent`}),(0,C.jsx)(`span`,{className:`mono dim loadout-sum`,children:E(ne.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:ne.blocks.map(e=>(0,C.jsx)(A,{label:e.label,n:e.chars,children:e.id===`user-rules`?(0,C.jsx)(`span`,{className:`loadout-pill${m?` is-plus`:``}`,children:m||`injected at sub-agent start`}):null},e.id))})]})]}),(0,C.jsxs)(`section`,{className:`loadout-rules`,"aria-label":`Rules it follows`,children:[(0,C.jsxs)(`div`,{className:`loadout-rules-h`,children:[(0,C.jsxs)(`h4`,{className:`loadout-eyebrow mono`,children:[`Rules it follows · `,g.length]}),(0,C.jsx)(`span`,{className:`dim`,children:y.map(([e,t])=>`${t} ${e}`).join(` · `)})]}),_.length?(0,C.jsxs)(`div`,{className:`loadout-cited`,children:[(0,C.jsx)(`span`,{className:`loadout-cited-h`,children:`Cited by its spec`}),_.map(e=>(0,C.jsxs)(`a`,{href:ye(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` · `,e.title]},be(e)))]}):null,(0,C.jsx)(`ul`,{className:`loadout-packs`,children:v.map(e=>e.user&&m?(0,C.jsxs)(`li`,{className:`is-muted`,children:[(0,C.jsx)(`span`,{children:`User rules`}),` `,(0,C.jsx)(`span`,{className:`mono`,children:e.n}),` `,(0,C.jsx)(`span`,{className:`dim`,children:m})]},e.name):(0,C.jsx)(`li`,{children:(0,C.jsxs)(`a`,{href:e.user?`#/personal/rules`:`#/laws`,children:[(0,C.jsx)(`span`,{children:e.name}),` `,(0,C.jsx)(`span`,{className:`mono dim`,children:e.n})]})},e.name))}),h.length?(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":i,onClick:()=>a(e=>!e),children:i?`Show fewer`:`Show all ${h.length}${m?` listed`:``} rules`}):null,i?O.map(([e,t])=>{let n=h.filter(t=>t.kind===e),r=m&&e===`user`;return n.length?(0,C.jsxs)(`div`,{className:r?`is-muted`:void 0,children:[(0,C.jsxs)(`h5`,{className:`reader-when-h`,children:[t,` `,(0,C.jsx)(`span`,{className:`mono dim`,children:n.length}),r?(0,C.jsxs)(`span`,{className:`dim`,children:[` · `,m]}):null]}),(0,C.jsx)(`ul`,{children:n.map(e=>(0,C.jsxs)(`li`,{children:[r?(0,C.jsxs)(`span`,{children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}):(0,C.jsxs)(`a`,{href:ye(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` `,e.title]}),e.layer&&e.layer!==`install`?(0,C.jsxs)(`span`,{className:`dim`,children:[` (`,e.layer,`)`]}):null]},be(e)))})]},e):null}):null]}),(0,C.jsxs)(`p`,{className:`dim loadout-foot`,children:[`Not counted: `,e.notCounted.join(`; `),`. Tokens are chars ÷ 4.`]})]})}function Se({label:e,options:t,value:n,onChange:r}){let[i,a]=(0,S.useState)(!1),o=(0,S.useRef)(null),s=(0,S.useId)(),c=t.find(e=>e.key===n)||t[0],l=()=>a(!1);return(0,S.useEffect)(()=>{i&&document.getElementById(s)?.querySelector(`[aria-pressed="true"]`)?.focus()},[i,s]),(0,C.jsxs)(`span`,{className:`drop-menu`,children:[(0,C.jsxs)(`button`,{ref:o,type:`button`,className:`drop-menu-btn`,"aria-label":`${e}: ${c.label}`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-controls":i?s:void 0,onClick:()=>a(e=>!e),children:[c.label,(0,C.jsx)(`span`,{className:`lib-caret`,"aria-hidden":`true`,children:`▾`})]}),(0,C.jsx)(d,{open:i,onClose:l,anchorRef:o,label:e,className:`drop-menu-pop`,children:(0,C.jsx)(`div`,{id:s,className:`drop-menu-list`,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`button`)],n=t.indexOf(document.activeElement);e.preventDefault(),t[(n+(e.key===`ArrowDown`?1:t.length-1))%t.length]?.focus()},children:t.map(e=>(0,C.jsx)(`button`,{type:`button`,"aria-pressed":e.key===c.key,onClick:()=>{r(e.key),l()},children:e.label},e.key))})})]})}function Ce({label:e,value:t,delta:n,children:r}){let i=x(Number.isInteger(t)?t:null);return(0,C.jsxs)(`div`,{className:`stat`,children:[(0,C.jsx)(`div`,{className:`stat-label`,children:e}),(0,C.jsx)(`div`,{className:`stat-value mono`,children:i===null?t:Math.round(i)}),n==null?null:(0,C.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var we=(0,S.lazy)(()=>g(()=>import(`./Markdown-CxkA7940.js`).then(e=>e.n),__vite__mapDeps([0,1,2]))),Te=(0,S.lazy)(()=>g(()=>import(`./AgentGlyph-k6o3gCM1.js`),__vite__mapDeps([3,1,2]))),Ee={skills:`skill`,agents:`agent`},De=`:primary`,Oe=(e,t)=>`${t?e/t*100:0}%`,ke=e=>e.split(`:`).slice(0,2).join(` `),Ae=e=>e.split(`/`).map((e,t)=>(0,C.jsxs)(S.Fragment,{children:[t?`/`:null,t?(0,C.jsx)(`wbr`,{}):null,e]},t)),j=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},je=e=>p(j(e));function Me(e,t){return e===`memory`?`memory/${t}`:e===`notebook`?`notebook/${t}`:e===`wiki`?`geneseed-wiki.jsonc`:e===`config`?t:e===`skills`?`skills/${t}/SKILL.md`:`${e}/${t}.md`}function Ne({section:e,source:t}){return(0,C.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,C.jsx)(s,{name:y[e].icon,className:`glyph`}),(0,C.jsxs)(`span`,{children:[`This entry is part of the `,y[e].label.toLowerCase(),` convention; see`,` `,(0,C.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var Pe=e=>e.replace(/\s+/g,` `).trim(),Fe=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ie(e,t){let n=e.replace(/\r\n/g,`
|
|
3
3
|
`),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=Fe(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?Pe(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?Pe(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=Fe(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function Le({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,C.jsx)(`div`,{className:`lib-stats`,children:(0,C.jsx)(Ce,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(ke))].join(`, `),i=t.days_counted>=30?`in the last 30 days`:`since ${t.since}`,a=Math.max(1,...e.per_day),o=[e.last?`last used ${e.last}`:null,i,r?`on ${r}`:null].filter(Boolean).join(` · `);return(0,C.jsx)(`div`,{className:`lib-stats`,children:(0,C.jsx)(Ce,{label:`Used`,value:e.n,delta:o,children:(0,C.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,C.jsx)(`i`,{className:t===29?`today`:``,style:{height:Oe(e,a)}},t))})})})}function Re(e){let t=/\s*\bUse when:\s*/i.exec(e||``);if(!t)return{lede:e||``,when:``};let n=e.slice(t.index+t[0].length).trim();return{lede:e.slice(0,t.index).trim(),when:n&&n[0].toUpperCase()+n.slice(1)}}var ze={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},Be=(e,t,n=b)=>t||(e&&b.includes(e)?e:n[0]??b[0]),Ve=encodeURIComponent;function He(e){let t=e=>v[e.klass]?e.klass:`personal`,n=l.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:v[n].label,groupC:v[n].c})));return{rows:n,cats:l.map(e=>({key:e,label:v[e].label,c:v[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ue(e){let t=e.filter(e=>e.topic).map(e=>({...e,group:e.topic}));return t.sort((e,t)=>e.group<t.group?-1:+(e.group>t.group)),[...e.filter(e=>!e.topic),...t]}function We({overview:e,section:t,selected:n,dataRev:o,lock:s,base:c,onRulesChanged:l,onCountsChanged:d}){let p=h(),{canSee:g}=ee(),x=b.filter(e=>g(`section:library/${e}`)),[w,pe]=(0,S.useState)(()=>Be(t,s,x)),[me,T]=(0,S.useState)(``),[E,D]=(0,S.useState)(`all`),[_e,O]=(0,S.useState)(`all`),[ve,k]=(0,S.useState)(``),[ye,be]=(0,S.useState)(null),[A,Ce]=(0,S.useState)(null),[ke,Pe]=(0,S.useState)(t);if(t!==ke){Pe(t),k(``);let e=Be(t,s,x);e!==w&&(pe(e),T(``),D(`all`),O(`all`))}let[Fe,We]=(0,S.useState)(n);n!==Fe&&(We(n),k(``));let{data:Ge,error:Ke,reload:qe}=a(()=>r.catalog(w),[w,o],`catalog`),Je=s?null:Ee[w]||null,Ye=Je!==null,{data:M}=a(()=>Ye?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[Ye,o],`usage`,{revalidate:!0}),N=Ye&&!!M?.enabled&&Array.isArray(M.names),Xe=(0,S.useMemo)(()=>new Map((Array.isArray(M?.names)?M.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[M]),P=e=>N&&Xe.get(`${Je}\u0000${e}`)||null,Ze=e=>{let t=P(e.name);return!t||t.n===0&&!t.last},Qe=M?.since?`No call since ${M.since}`:`No call recorded yet`,F=Ge?.section===w,I=F&&Ge?.items||[],$e=!F&&!Ke,[et,...tt]=F&&Ge.sharedInstalls||[],L=e=>e===et?`shared`:je(e),R=w===`skills`,nt=R?He(I):null,z=R?nt.rows:w===`memory`?Ue(I):I,B=n||z[0]?.name||null,V=w===`agents`&&!s,H=V&&B===`:primary`,{data:rt,error:it}=a(()=>V?Promise.resolve().then(()=>r.loadout()):Promise.resolve(null),[V,o],`loadout-primary`,{revalidate:!0}),at=V?{name:De,type:`agent`,base:!0,title:!it&&rt?.noun||`Primary agent`,desc:`The main agent of the session. Every agent inherits its root file.`}:null,ot=H?at:B?I.find(e=>e.name===B):null,st=ot?.type||y[w].type,U=A?.sec===w&&A?.name===B?A.key:null,{data:ct,error:lt}=a(()=>!B||H?Promise.resolve(null):U?r.item(st,B,j(U)):r.item(st,B),[w,B,st,U,o,H]),W=lt?null:ct,ut=W&&W.name===B&&(!U||W.install===U)?W:null,dt=e=>Ct&&e?.install?` in ${L(e.install)}`:``,G=H?null:U||W?.install||null,ft=V&&B&&!H&&W&&W.name===B,{data:pt,error:mt}=a(()=>ft?Promise.all([r.loadout(B,G?j(G):void 0),r.loadout(void 0,G?j(G):void 0).catch(()=>null)]).then(([e,t])=>({own:e,base:t})):Promise.resolve(null),[ft,B,G,o]),ht=H?{own:it?null:rt,base:null}:pt,gt=H?it:mt,_t=ve||Ke||lt,vt=B?{name:B,title:W?.title||B,desc:W?.desc||``}:null,K=ot||vt,yt=t=>t===w&&F?I.length:e?.counts?.[t]??``,bt=u(o),xt=G||bt?.[0]?.id,St=xt?je(xt):void 0,Ct=new Set(I.flatMap(e=>e.installs||[])).size>1,wt=re([...(bt||[]).map(e=>e.id),...I.flatMap(e=>e.installs||[])],tt),q=R?z.filter(e=>E===`all`||e.cat===E):z,Tt=N?q.filter(Ze).length:0,Et=e=>e.status===`experimental`,Dt=q.filter(Et).length,J=[[`all`,`All`,q.length],...N?[[`used`,`Used`,q.length-Tt],[`unused`,`Not used yet`,Tt,Qe]]:[],...Dt?[[`experimental`,`Experimental`,Dt,`Shipped, not yet confirmed by real use`]]:[]],Y=J.some(([e])=>e===_e)?_e:`all`,Ot=Y===`all`?q:Y===`experimental`?q.filter(Et):q.filter(e=>Ze(e)===(Y===`unused`)),kt=N?Math.max(0,...I.map(e=>P(e.name)?.n||0)):0,At=R?1/0:50,X=me.trim().toLowerCase(),Z=X?ie(Ot,X):Ot.slice(0,At),jt=!X&&E===`all`&&Y===`all`&&B&&!Z.some(e=>e.name===B)?[...Z,...z.filter(e=>e.name===B)]:Z,Mt=at&&F&&E===`all`&&Y===`all`?ie([at],X):[],Nt=Mt.length+Z.length,Pt=[...Mt,...jt],Ft=e=>c?`${c}/${Ve(e.name)}`:`#/item/${e.type||y[w].type}/${Ve(e.name)}`,It=async()=>{let e=ut;if(!e)return;let t=e.name;if(await p(`Forget the memory fact "${t}"${dt(e)}? It leaves the index and moves to memory/archive/ (geneseed memory rm --archived --purge deletes it for good).`,{title:`Forget this fact?`,confirmLabel:`Forget`,tone:`danger`})){k(``);try{await r.memoryDelete(t,e.install?j(e.install):void 0)}catch(e){k(`Could not forget "${t}": ${e.message}`);return}i(c||`#/personal/memory`),qe(),d?.()}},Lt=async()=>{let e=ut;if(!e)return;let t=e.name;if(await p(`Promote "${t}"${dt(e)} into a standing rule? It is appended to user-rules.md as a trial rule (a month of probation), and the memory fact moves to memory/archive/ so the lesson isn't loaded twice.`,{title:`Promote to a rule?`,confirmLabel:`Promote`})){k(``);try{let n=e.install?j(e.install):void 0,a=await r.rules(n);await r.rulesPromote({name:t,fingerprint:a.fingerprint,delete_memory:!0},n),te(),l?.(),d?.(),i(`#/personal/rules`)}catch(e){k(`Could not promote: ${e.message}`),qe()}}},Rt=W?.body?Ie(W.body,W.desc||K?.desc):null,zt=W?.title||K?.title||K?.name,Bt=zt===K?.name&&Rt?.title?Rt.title:zt,Vt=F&&I.length===0,Ht=W?.status||K?.status,Ut=w===`skills`?v[ot?.klass]:null,Q=y[w].label,{lede:Wt,when:Gt}=Re(W?.desc||K?.desc||``),$=K&&!H?W?.source||K.source||(lt?null:Me(w,K.name)):null,Kt=async()=>{try{await navigator.clipboard.writeText($),be({src:$,ok:!0})}catch{be({src:$,ok:!1})}},qt=b.filter(e=>e===w||x.includes(e));return(0,C.jsxs)(`div`,{className:`lib-wrap`,children:[(0,C.jsx)(ne,{error:_t,style:{margin:`0 0 var(--sp-3)`}}),(0,C.jsxs)(`div`,{className:`library lib-dossier${s?` locked`:``}${N?` uses`:``}`,children:[s?null:(0,C.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,C.jsxs)(`div`,{className:`lib-title`,children:[(0,C.jsx)(`h1`,{className:`h`,children:`Library`}),(0,C.jsx)(`span`,{className:`dim`,children:`What the agent knows`}),N&&M.since?(0,C.jsxs)(`span`,{className:`mono dim lib-title-since`,children:[`calls since `,M.since]}):null]}),(0,C.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:qt.map(e=>(0,C.jsxs)(S.Fragment,{children:[(0,C.jsxs)(`a`,{href:`#/section/${e}`,className:w===e?`on`:``,"aria-current":w===e?`page`:void 0,children:[y[e].label,(0,C.jsx)(`span`,{className:`mono dim`,children:yt(e)})]}),e===w&&R&&F&&(0,C.jsx)(le,{label:`Skill types`,total:I.length,cats:nt.cats,cat:E,onChange:D})]},e))})]}),(0,C.jsxs)(oe,{label:Q,count:F?X?`${Z.length} of ${Ot.length}`:Ot.length:``,q:me,onQ:T,matched:Nt,inView:[w,n],current:K?Bt:void 0,sections:s?void 0:qt.map(e=>({key:e,label:y[e].label,n:yt(e),href:`#/section/${e}`,on:w===e})),cats:R&&F?nt.cats:null,cat:E,total:I.length,onCat:D,catLabel:`Skill types`,extra:(0,C.jsxs)(C.Fragment,{children:[N&&M.since?(0,C.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,M.since]}):null,(0,C.jsxs)(`span`,{className:`lib-legend mono`,children:[Ct?wt.map((e,t)=>(0,C.jsxs)(`span`,{className:`lk-install`,title:j(e).path,children:[(0,C.jsx)(`i`,{className:`lr-dot`,style:f(t),"aria-hidden":`true`}),L(e)]},e)):null,(0,C.jsx)(se,{items:I})]})]}),toolsCompact:F&&J.length>1?(0,C.jsx)(Se,{label:`Show`,options:J.map(([e,t])=>({key:e,label:e===`all`?`All uses`:t})),value:Y,onChange:O}):void 0,tools:F&&J.length>1?(0,C.jsx)(m,{"aria-label":`Show`,children:J.map(([e,t,n,r])=>(0,C.jsxs)(`button`,{type:`button`,className:Y===e?`on`:``,"aria-pressed":Y===e,title:r,onClick:()=>O(e),children:[t,` `,(0,C.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[$e?(0,C.jsx)(_,{}):null,(0,C.jsx)(ce,{rows:Pt,activeName:K?.name,hrefOf:Ft,pills:N||Ct?e=>{let t=P(e.name)?.n||0,n=Ct?(0,C.jsx)(`span`,{className:`lr-dots`,children:wt.map((t,n)=>e.installs?.includes(t)?(0,C.jsx)(`span`,{className:`lr-dot lr-install`,style:f(n),title:`${L(t)} — ${j(t).path}`,children:(0,C.jsx)(`span`,{className:`sr-only`,children:L(t)})},t):(0,C.jsx)(`span`,{className:`lr-dot off`,"aria-hidden":`true`},t))}):null;return N?(0,C.jsxs)(C.Fragment,{children:[n,(0,C.jsxs)(`span`,{className:`lr-use`,children:[(0,C.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,C.jsx)(`i`,{style:{width:Oe(t,kt)}})}),(0,C.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,C.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})]}):n}:void 0}),!X&&I.length>At&&(0,C.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,At,` of `,I.length,`; type to search the rest.`]}),Vt&&(w===`wiki`?(0,C.jsxs)(fe,{title:`No wiki entries`,action:(0,C.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,C.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,C.jsx)(fe,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,C.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:K?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`div`,{className:`reader-tags`,children:[(0,C.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),H?(0,C.jsx)(de,{}):null,Ut?(0,C.jsx)(`span`,{className:`tag`,children:Ut.label}):null,W?.kit??K.kit?(0,C.jsx)(ue,{name:W?.kit??K.kit}):null,(0,C.jsx)(ae,{status:Ht,withHint:!0}),$?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`mono dim reader-src`,children:Ae($)}),(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Kt,children:ye?.src===$?ye.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,C.jsxs)(`div`,{className:`reader-head`,children:[(0,C.jsx)(`h2`,{className:`reader-title`,children:Bt}),w===`agents`&&!H?(0,C.jsx)(S.Suspense,{fallback:null,children:(0,C.jsx)(Te,{name:K.name})}):null]}),(0,C.jsxs)(`div`,{className:`reader-intro${N?` with-stats`:``}`,children:[(0,C.jsxs)(`div`,{className:`reader-intro-text`,children:[Wt?(0,C.jsx)(`p`,{className:`reader-lede`,children:Wt}):null,Gt?(0,C.jsxs)(`section`,{className:`reader-when`,children:[(0,C.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,C.jsx)(`p`,{children:Gt})]}):null]}),N?(0,C.jsx)(Le,{u:P(K.name),usage:M,noCall:Qe}):null]}),w===`memory`&&ut&&K.name!==`MEMORY`&&K.name!==`README`&&(0,C.jsxs)(`div`,{className:`row gap-8`,children:[(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:Lt,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:It,children:`Forget this fact`})]}),W?.installs?.length>1&&W.installs.includes(W.install)?(0,C.jsxs)(`label`,{className:`row gap-8 lib-copy`,children:[(0,C.jsx)(`span`,{className:`dim`,children:`Install:`}),(0,C.jsx)(`select`,{className:`sel`,"aria-label":`Install`,value:U||W.install,onChange:e=>Ce({sec:w,name:B,key:e.target.value}),children:W.installs.map(e=>(0,C.jsx)(`option`,{value:e,title:j(e).path,children:L(e)},e))}),(0,C.jsx)(`span`,{className:`dim`,children:`this entry only`})]}):null,(0,C.jsx)(`hr`,{className:`hr`}),ft?(0,C.jsx)(ge,{name:B,install:G?j(G):void 0,installId:xt}):null,V?(0,C.jsx)(xe,{loadout:ht?.own,base:ht?.base,error:gt,install:St}):null,H?null:lt?(0,C.jsxs)(`p`,{className:`sub`,children:[`No `,Q.replace(/s$/,``).toLowerCase(),` named `,(0,C.jsx)(`em`,{children:K.name}),` could be read in this install.`]}):K?.kind===`manifest`||W?.manifest!==void 0?W?(0,C.jsx)(he,{manifest:W.manifest,body:W.body,name:K.name}):(0,C.jsx)(_,{}):W?.body?(0,C.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,C.jsx)(S.Suspense,{fallback:null,children:(0,C.jsx)(we,{body:Rt.body,links:W.links||[]})})}):W===null&&B?(0,C.jsx)(_,{}):(0,C.jsx)(Ne,{section:w,source:Me(w,K.name)}),ze[w]?(0,C.jsx)(`div`,{className:`reader-links`,children:(0,C.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${ze[w]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):$e?(0,C.jsx)(_,{}):null})]})]})}export{De as PRIMARY,Ie as bodyHead,We as default,Ue as groupMemory,je as installLabel,j as installOfKey,Be as resolveSec,He as splitSkills,Re as splitWhen};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,J as a,Y as o,et as s,gt as c,nt as l,tt as u,yt as d}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,J as a,Y as o,et as s,gt as c,nt as l,tt as u,yt as d}from"./index-BiKWWv7Z.js";import{t as f}from"./EmptyState-CY5Pm2xy.js";import{t as p}from"./CopyButton-Dpl0PFja.js";import{a as m,n as h,o as g,r as _,s as v,t as y}from"./ActiveLoops-paFbiZyt.js";import{t as b}from"./Markdown-CxkA7940.js";import{a as x,i as S,n as ee,o as te,s as C}from"./LibRows-1yTY0Kwn.js";import{i as w}from"./motion-RlUl1osO.js";import{n as T,r as E}from"./router-1EhRJy1C.js";var D=e(t(),1),O=n(),k=encodeURIComponent,A=T.loops.map(e=>[e,E[e]]),j={architecture:`Architecture`,tests:`Tests`,development:`Development`,refactoring:`Refactoring`,"day-to-day":`Day-to-day`},M={project:`Project`,global:`Global`,shipped:`Shipped`},N={templates:`Categories`,bricks:`Origins`,active:`Statuses`},P=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]];function F(e,t){let n=e.filter(e=>e.startsWith(`${t} (`)).at(-1);return n?/(overrides \w+)\)$/.exec(n)?.[1]:null}var I=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r})));function L(e,t){let n=new Set(t.filter(e=>e.gate===`human`).map(e=>e.name));return I(e.map(e=>({...e,desc:e.description,human:e.graph.nodes.some(e=>n.has(e))})),e=>j[e.graph.category]?e.graph.category:`other`,[...Object.entries(j),[`other`,`Other`]])}function R(e,t){return I(e.map(e=>({...e,desc:e.description,override:F(t,e.name)})),e=>e.origin,Object.entries(M))}function z(e){return I(e.map(e=>({...e,name:e.root,desc:e.branch})),e=>e.status,P)}var B=(e,t)=>(0,O.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),V={templates:e=>e.human?B(`human`,`human gate`):null,bricks:e=>[e.effect===`mutate`?B(`warn`,`mutate`):null,g(e)?B(`human`,`human gate`):null,e.override?B(`acc`,e.override):null,e.available===!1?B(`bad`,`unavailable`):null],active:e=>B(h[e.status],e.status)};function H({name:e,brick:t,override:n,on:r}){let i=`loop-brick${r?` on`:``}${!t||t.available===!1?` dimmed`:``}`;return t?(0,O.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,O.jsx)(`b`,{children:(0,O.jsx)(`a`,{href:`#/loops/bricks/${k(e)}`,children:e})}),B(t.effect===`mutate`?`warn`:``,t.effect),(0,O.jsx)(`span`,{className:`mono dim`,children:t.agent||t.skill}),(0,O.jsx)(`span`,{className:`panel-note`,children:t.outcomes.join(` · `)}),g(t)?B(`human`,g(t).toLowerCase()):null,n?B(`acc`,n):null]}):(0,O.jsxs)(`li`,{className:i,id:`brick-${e}`,children:[(0,O.jsx)(`b`,{children:e}),(0,O.jsx)(`span`,{className:`panel-note`,children:`Not in the catalogue: this template cannot run as is.`})]})}function U(e){let t=e.loops||[],n=t.find(e=>e.iteration),r=n?.nodes[0],i=t=>{let n=new Map;for(let r of e.edges.filter(t))n.set(r.from,[...n.get(r.from)||[],r.on]);return[...n].map(([e,t])=>`${e} says ${t.join(` or `)}`).join(`, `)},a=t=>{let i=e.edges.filter(e=>e.to===t);return!!n&&t!==r&&i.length>0&&i.every(e=>e.from===r)&&e.edges.some(e=>e.from===t&&e.to===`$close`)},o=[...new Set(e.edges.filter(e=>e.to===`$close`).map(e=>e.from))].map(e=>a(e)?`${i(t=>t.to===e)} → ${e}; ${i(t=>t.from===e&&t.to===`$close`)} → close`:`${i(t=>t.from===e&&t.to===`$close`)} → close`),s=t.filter(e=>!e.iteration).map(e=>`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)}, max ${e.max}`),c=n?e.nodes.filter(e=>!n.nodes.includes(e)):[],l=i(e=>e.to===`$stop`);return[c.length&&[`Setup`,`${c.join(` → `)}, once.`],n?[`Iteration (max ${n.max})`,`${n.nodes.filter(e=>!a(e)).join(` → `)}.`]:[`Steps`,`${e.nodes.join(` → `)}.`],s.length&&[`Retry`,`${s.join(`; `)}.`],o.length&&[`Exit`,`${o.join(`; `)}.`],[`Stop`,`${l?`${l}, or `:``}any step says error → stop.`]].filter(Boolean)}function W({t:e,bricks:t,overridden:n,runs:r}){let[i,a]=(0,D.useState)(null),o=new Map(t.map(e=>[e.name,e])),s=U(e.graph),c=v(e.graph,t),l=c.mode===`ring`,u=`geneseed loop init --graph ${e.name} --title "<title>" --requirement "<requirement>"`,d=r?.filter(t=>_(t)&&t.graph.name===e.name).length;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`reader-tags`,children:[(0,O.jsx)(`span`,{className:`tag acc`,children:`Template`}),j[e.graph.category]?B(``,j[e.graph.category]):null,e.human?B(`human`,`human gate`):null]}),(0,O.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,O.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,O.jsxs)(`p`,{className:`mono dim reader-src`,children:[`loops/`,e.name,`.json · `,e.origin]}),(0,O.jsx)(`hr`,{className:`hr`}),(0,O.jsxs)(`figure`,{className:`loop-console`,children:[(0,O.jsx)(`div`,{className:l?`loop-graph`:`loop-graph flow`,style:{"--loop-w":`${c.width}px`},children:(0,O.jsx)(m,{graph:e.graph,bricks:t,onSelect:e=>{a(e),document.getElementById(`brick-${e}`)?.scrollIntoView?.({behavior:w()?`smooth`:`auto`,block:`nearest`})}})}),(0,O.jsxs)(`figcaption`,{className:`loop-how`,children:[(0,O.jsx)(`span`,{className:`loop-kicker`,children:`How it runs`}),(0,O.jsx)(`ol`,{children:s.map(([e,t])=>(0,O.jsxs)(`li`,{children:[(0,O.jsxs)(`b`,{children:[e,`:`]}),` `,t]},e))}),l?(0,O.jsxs)(`span`,{className:`loop-legend`,children:[(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`i`,{className:`ring`,"aria-hidden":`true`}),`iteration`]}),s.some(([e])=>e===`Retry`)?(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`i`,{className:`inner`,"aria-hidden":`true`}),`retry`]}):null]}):null]})]}),(0,O.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`loop-start-h`,children:[(0,O.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,O.jsx)(`h3`,{id:`loop-start-h`,className:`loop-kicker`,children:`Start it in your project`}),(0,O.jsx)(p,{text:u,label:`Copy command`})]}),(0,O.jsx)(`pre`,{className:`mono`,children:u})]}),r?(0,O.jsxs)(`p`,{className:`panel-note loop-running`,children:[`Running now: `,d?`${d} of this template`:`none`,`.`,` `,d?(0,O.jsx)(`a`,{href:`#/loops/active`,children:`Open Active →`}):`A started loop appears under Active with its iteration and preset.`]}):null,e.graph.rules?.length?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,O.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every brick follows`,children:e.graph.rules.map(e=>(0,O.jsx)(`li`,{children:e},e))})]}):null,(0,O.jsx)(`h3`,{className:`loop-h2`,children:`Bricks`}),(0,O.jsx)(`ul`,{className:`loop-brick-list`,"aria-label":`Bricks in ${e.name}`,children:e.graph.nodes.map(e=>(0,O.jsx)(H,{name:e,brick:o.get(e),override:F(n,e),on:i===e},e))})]})}function G(e){return`---\n${[[`name`,e.name],[`description`,e.description],[`effect`,e.effect],[e.agent?`agent`:`skill`,e.agent||e.skill],[`gate`,e.gate],[`gateOn`,e.gateOn?.join(`, `)],[`outcomes`,e.outcomes.join(`, `)]].filter(([,e])=>e).map(([e,t])=>`${e}: ${t}`).join(`
|
|
2
2
|
`)}\n---\n${e.body}`}function K({b:e}){let[t,n]=(0,D.useState)(!1),r=[[`effect`,B(e.effect===`mutate`?`warn`:``,e.effect)],[e.agent?`agent`:`skill`,(0,O.jsx)(`span`,{className:`mono`,children:e.agent||e.skill},`who`)],[`outcomes`,e.outcomes.map(e=>B(``,e))],[`gate`,g(e)?B(`human`,g(e).toLowerCase()):`none`],[`origin`,e.override?`${e.origin}, ${e.override}`:e.origin],[`available`,e.available===!1?(0,O.jsxs)(`span`,{className:`t-warn`,children:[`no — `,e.reason]},`why`):`yes`]];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`reader-tags`,children:[(0,O.jsx)(`span`,{className:`tag acc`,children:`Brick`}),V.bricks(e)]}),(0,O.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,O.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,O.jsxs)(`p`,{className:`mono dim reader-src`,children:[`bricks/`,e.name,`.md`]}),(0,O.jsx)(`dl`,{className:`loop-facts`,children:r.map(([e,t])=>(0,O.jsxs)(D.Fragment,{children:[(0,O.jsx)(`dt`,{children:e}),(0,O.jsx)(`dd`,{children:t})]},e))}),(0,O.jsx)(`hr`,{className:`hr`}),(0,O.jsx)(`div`,{className:`row gap-8 loop-src-bar`,children:(0,O.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":t,onClick:()=>n(!t),children:t?`Hide source`:`View source`})}),t?(0,O.jsx)(`pre`,{className:`loop-brick-src`,"aria-label":`Source`,children:G(e)}):(0,O.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,O.jsx)(b,{body:e.body})})]})}function ne({problems:e}){if(!e?.length)return null;let t=e.length;return(0,O.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,O.jsxs)(`b`,{className:`t-warn`,children:[t,` catalogue `,t===1?`problem`:`problems`,`: these files were skipped`]}),(0,O.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,O.jsx)(`li`,{className:`mono`,children:e},e))})]})}var q={templates:{title:`No templates`,body:(0,O.jsxs)(O.Fragment,{children:[`Add one under `,(0,O.jsx)(`code`,{className:`mono`,children:`.geneseed/loops/`}),` in the repo.`]})},bricks:{title:`No bricks`,body:(0,O.jsxs)(O.Fragment,{children:[`Add one under `,(0,O.jsx)(`code`,{className:`mono`,children:`.geneseed/bricks/`}),` in the repo.`]})},active:{title:`No loops yet`,body:(0,O.jsxs)(O.Fragment,{children:[`Start one with `,(0,O.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.`]})}},re={templates:(0,O.jsxs)(O.Fragment,{children:[`A template wires bricks into a loop. `,(0,O.jsx)(`a`,{href:`#/docs/loops`,children:`How loops work →`}),` `,(0,O.jsx)(`a`,{href:`#/docs/loop-which-template`,children:`Which template? →`})]}),bricks:(0,O.jsxs)(O.Fragment,{children:[`A brick is one step: a skill or agent and its outcomes.`,` `,(0,O.jsx)(`a`,{href:`#/docs/loop-bricks`,children:`About bricks →`})]}),active:(0,O.jsxs)(O.Fragment,{children:[`Loops registered on this machine, read from their LOOP.md.`,` `,(0,O.jsx)(`a`,{href:`#/docs/loop-running`,children:`Running a loop →`})]})};function J({tab:e=`templates`,item:t,dataRev:n}){let p=o(n),[m,h]=a(`loops`,p),{data:g,error:v}=i(()=>r.loops(c(m)),[n,m?.id??``],`loops`),b=d(),[w,T]=(0,D.useState)(``),[E,j]=(0,D.useState)(`all`),[M,P]=(0,D.useState)(e);e!==M&&(P(e),T(``),j(`all`));let F=g?.bricks||[],I=e===`active`?b.loops&&z(b.loops):g&&(e===`bricks`?R(g.bricks,g.overridden):L(g.templates,g.bricks)),B=I||[],H=C(B),U=E===`all`?B:B.filter(e=>e.group===E),G=w.trim(),J=x(U,G),Y=!!(t&&I&&!B.some(e=>e.name===t)),X=Y?null:B.find(e=>e.name===t)||e===`active`&&B.find(_)||B[0]||null,Z={templates:g?.templates.length,bricks:g?.bricks.length,active:b.loops?.length},Q=A.find(([t])=>t===e)[1],$=e===`active`?b.error:v;return(0,O.jsxs)(`div`,{className:`lib-wrap`,children:[e===`active`?null:(0,O.jsx)(l,{className:`page-pick`,installs:p,value:m,onChange:h}),(0,O.jsx)(s,{error:$,style:{margin:`0 0 var(--sp-3)`}}),(0,O.jsx)(ne,{problems:g?.problems}),(0,O.jsxs)(`div`,{className:`library`,children:[(0,O.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Loops sections`,children:[(0,O.jsxs)(`div`,{className:`lib-title`,children:[(0,O.jsx)(`h1`,{className:`h`,children:`Loops`}),(0,O.jsx)(`span`,{className:`dim`,children:`What the engine runs`})]}),(0,O.jsx)(`p`,{className:`panel-note lib-lede`,children:re[e]}),(0,O.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:A.map(([t,n])=>(0,O.jsxs)(D.Fragment,{children:[(0,O.jsxs)(`a`,{href:`#/loops/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,O.jsx)(`span`,{className:`mono dim`,children:Z[t]??``})]}),e===t&&(0,O.jsx)(te,{label:N[t],total:B.length,cats:H,cat:E,onChange:j})]},t))})]}),(0,O.jsx)(S,{label:Q,count:G?`${J.length} of ${U.length}`:I?U.length:``,q:w,onQ:T,matched:J.length,inView:[e,t],current:X?.name,sections:A.map(([t,n])=>({key:t,label:n,n:Z[t],href:`#/loops/${t}`,on:e===t})),cats:H,cat:E,total:B.length,onCat:j,catLabel:N[e],children:I?B.length===0?(0,O.jsx)(f,{title:q[e].title,children:q[e].body}):(0,O.jsx)(ee,{rows:J,activeName:X?.name,hrefOf:t=>`#/loops/${e}/${k(t.name)}`,pills:V[e]}):$?null:(0,O.jsx)(u,{})}),(0,O.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:Y?(0,O.jsx)(f,{title:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/loops/${e}`,label:`All ${Q.toLowerCase()} →`}}):X?e===`active`?(0,O.jsx)(y,{loop:X,bricks:F,onPreset:b.onPreset}):e===`bricks`?(0,O.jsx)(K,{b:X}):(0,O.jsx)(W,{t:X,bricks:F,overridden:g.overridden,runs:b.loops},X.name):e===`active`&&I?(0,O.jsx)(f,{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,R as brickRows,G as brickSource,J as default,U as howItRuns,L as templateRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,H as a,J as o,Y as s,et as c,gt as l,ht as u,it as d,nt as f,ot as p,pt as m,tt as ee}from"./index-BiKWWv7Z.js";var h=e(t(),1);function te(e,t){return e===`pin`?`pin`:e===`map`?`tiers map`:e==="default"?`tier default`:t===`auto`?`session model`:`routing off`}var ne=(e,t)=>!t||t===`inherit`||e.some(e=>e.id===t&&e.provider!==`in-use`);function re(e,t){return Object.hasOwn(e.map||{},t)?e.map[t]:e.defaults?.[t]??``}var g=e=>`${e.id} ${e.name} ${e.providerName} ${e.note||``}`.toLowerCase();function _(e,t){let n=(t||``).trim().toLowerCase(),r=[];for(let t of e.groups||[]){let i=(e.models||[]).filter(e=>e.provider===t.provider&&e.source===t.source),a=n?i.filter(e=>g(e).includes(n)):i;(!n||a.length)&&r.push({...t,rows:a})}return r}function v(e){return typeof e==`number`?e>=1e6?`${+(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e):``}function y(e){if(!e)return``;let t=e=>e==null?`?`:`$${+e.toFixed(2)}`;return`${t(e.input)} in / ${t(e.output)} out per 1M`}var b=n();function x({open:e,title:t,data:n,current:r,onPick:i,onClose:a}){let o=(0,h.useRef)(null),s=(0,h.useId)(),[c,l]=(0,h.useState)(``),[u,d]=(0,h.useState)(r&&r!==`inherit`?r:``);(0,h.useEffect)(()=>{let t=o.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]);let f=(e,t)=>t.id===r&&!(e.provider===`in-use`&&t.detected),p=e?_(n,c):[],m=u.trim();return(0,b.jsxs)(`dialog`,{ref:o,className:`confirm model-picker`,"aria-labelledby":`${s}-title`,onCancel:a,onClose:a,children:[(0,b.jsx)(`h3`,{className:`confirm-title`,id:`${s}-title`,children:t}),(0,b.jsx)(`input`,{className:`inp mp-search`,type:`search`,"aria-label":`Search models`,placeholder:`Search models`,value:c,onChange:e=>l(e.target.value)}),(0,b.jsxs)(`div`,{className:`mp-list`,children:[p.map(e=>(0,b.jsxs)(`section`,{className:`mp-group`,"aria-label":e.providerName,children:[(0,b.jsxs)(`header`,{className:`mp-head`,children:[(0,b.jsx)(`span`,{className:`mp-name`,children:e.providerName}),(0,b.jsx)(`span`,{className:`dim`,children:e.note}),e.available===!1?(0,b.jsx)(`span`,{className:`tag warn`,children:e.reason||`unavailable`}):null]}),e.rows.map(t=>(0,b.jsxs)(`button`,{type:`button`,className:`mp-row${f(e,t)?` on`:``}`,disabled:t.available===!1,"aria-pressed":f(e,t),onClick:()=>i(t.id),title:t.available===!1?t.reason:void 0,children:[(0,b.jsxs)(`span`,{className:`mp-id`,children:[t.id===`inherit`?`Session model (inherit)`:t.name===t.id?t.id:t.name,t.id!==`inherit`&&t.name!==t.id?(0,b.jsxs)(`span`,{className:`dim mono`,children:[` `,t.id]}):null]}),(0,b.jsxs)(`span`,{className:`mp-meta`,children:[t.id===`inherit`?null:(0,b.jsx)(`span`,{className:`tag ${t.local?`ok`:``}`,children:t.local?`local`:`remote`}),t.context?(0,b.jsxs)(`span`,{className:`tag`,children:[v(t.context),` ctx`]}):null,t.cost?(0,b.jsx)(`span`,{className:`tag`,children:y(t.cost)}):null,t.reasoning?(0,b.jsx)(`span`,{className:`tag acc`,children:`reasoning`}):null,t.variants?.length?(0,b.jsxs)(`span`,{className:`tag`,children:[`variants: `,t.variants.join(`, `)]}):null,t.detected===!1?(0,b.jsx)(`span`,{className:`tag warn`,children:`not detected`}):null,t.available===!1?(0,b.jsx)(`span`,{className:`tag warn`,children:t.reason||`unavailable`}):null]})]},`${e.provider}|${t.id}`))]},`${e.provider}|${e.source}|${e.note}`)),e&&!p.some(e=>e.rows.length)&&c?(0,b.jsxs)(`p`,{className:`sub`,children:[`No model matches “`,c,`”.`]}):null]}),(0,b.jsxs)(`form`,{className:`mp-custom`,onSubmit:e=>{e.preventDefault(),m&&i(m)},children:[(0,b.jsxs)(`label`,{className:`mp-custom-label`,children:[(0,b.jsx)(`span`,{className:`dim`,children:`Custom…`}),(0,b.jsx)(`input`,{className:`inp`,type:`text`,"aria-label":`Custom model id`,placeholder:`provider/model, or the id as the host knows it`,value:u,onChange:e=>d(e.target.value)})]}),(0,b.jsx)(`button`,{type:`submit`,className:`btn ghost sm`,disabled:!m,children:`Use this id`})]}),(0,b.jsx)(`div`,{className:`confirm-actions`,children:(0,b.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:a,children:`Cancel`})})]})}var ie=[[`standard`,`Standard`],[`light`,`Light`]],ae={strong:`acc`,standard:``,light:`ok`},S={strong:0,standard:1,light:2},oe=[`off`,`auto`];function C({dataRev:e,onAction:t}){let n=p(),g=s(e),[_,v]=o(`models`,g),{data:y,error:C,setData:w,reload:T}=i(()=>Promise.resolve().then(()=>r.agentModels(l(_))),[e,_?.id??``]),[E,D]=(0,h.useState)({}),[O,k]=(0,h.useState)({}),[A,j]=(0,h.useState)(null),[M,N]=(0,h.useState)(null),[P,F]=(0,h.useState)(!1),[I,L]=(0,h.useState)(``),[R,z]=(0,h.useState)(!1),[se,B]=(0,h.useState)(!1),[ce,le]=(0,h.useState)(_?.id);_?.id!==ce&&(le(_?.id),D({}),k({}),j(null),B(!1),L(``));let V=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f,{className:`page-pick`,installs:g,value:_,onChange:v}),(0,b.jsx)(a,{title:`Models`,sub:`The model each sub-agent runs on, per install. Strong agents always use your session model.`})]});if(g!==null&&g.length===0)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsxs)(`p`,{className:`sub`,"data-testid":`models-no-install`,children:[`No Geneseed install is active, so there is no agent model to set.`,` `,(0,b.jsx)(`a`,{href:`#/installs`,children:`Install one on Installs →`})]})]});if(C)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsx)(c,{error:C})]});if(!y||!_)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsx)(ee,{})]});let H=m(y.host).label;if(!y.claude)return(0,b.jsxs)(`div`,{className:`lib-wrap`,children:[V,(0,b.jsxs)(`p`,{className:`sub`,children:[H,` takes no per-agent model, so there is nothing to set here for`,` `,u(_),`.`]})]});let U=y.file?.problem,W=A??y.tiers,G=y.models||[],K=e=>E[e]!==void 0,q=e=>K(e)?E[e]===null?y.defaults?.[e]??``:E[e]:re(y,e),ue=e=>O[e.name]===void 0?e.pin:O[e.name],J=Object.keys(E).length+Object.keys(O).length,Y=A!==null&&A!==y.tiers,X=J+ +!!Y,de=P?[...y.agents].sort((e,t)=>(S[e.tier]??9)-(S[t.tier]??9)||e.name.localeCompare(t.name)):y.agents,Z=e=>{if(!e)return`Session model`;let t=G.find(t=>t.id===e&&t.provider!==`in-use`);return t&&t.name!==t.id?`${t.name} (${e})`:e},Q=e=>ne(G,e)?null:(0,b.jsx)(`span`,{className:`tag warn`,children:`not detected`}),fe=e=>{let{kind:t,key:n}=M;if(N(null),B(!1),t===`tier`){let t=e===`inherit`?``:e;D(e=>({...e,[n]:t===(y.defaults?.[n]??void 0)?null:t}))}else k(t=>({...t,[n]:e===`inherit`?null:e}))},pe=async()=>{if(J){z(!0),L(``);try{let e=await r.agentModelsSave({tiers:E,agents:O},l(_));w({...y,...e}),T(),D({}),k({}),B(!0)}catch(e){L(e.message);return}finally{z(!1)}}Y&&await $()},$=async()=>{await n(`Rebuild this ${H} install with model routing ${W}? The models are written into the agent files; it rebuilds in place, non-destructive.`,{title:`Rebuild this install?`,confirmLabel:`Rebuild`})&&t?.(`install`,{host:_.host,scope:_.scope,path:_.path,tiers:W})},me=M?M.kind===`tier`?q(M.key)||`inherit`:(O[M.key]===void 0?y.agents.find(e=>e.name===M.key)?.pin:O[M.key])||`inherit`:null;return(0,b.jsxs)(`div`,{className:`lib-wrap models-page`,children:[V,(0,b.jsx)(c,{error:I,style:{margin:`0 0 var(--sp-3)`}}),U?(0,b.jsxs)(`p`,{className:`sub tiers-warn`,role:`alert`,children:[U,`.`]}):null,y.warnings.map(e=>(0,b.jsx)(`p`,{className:`sub tiers-warn`,role:`note`,children:e},e)),(0,b.jsxs)(`div`,{className:`panel models-routing`,children:[(0,b.jsxs)(`div`,{className:`panel-head`,children:[(0,b.jsx)(`h2`,{children:`Routing`}),(0,b.jsx)(d,{"aria-label":`Model routing for ${u(_)}`,children:oe.map(e=>(0,b.jsx)(`button`,{type:`button`,className:W===e?`on`:``,"aria-pressed":W===e,onClick:()=>{j(e===y.tiers?null:e),B(!1)},children:e},e))})]}),(0,b.jsxs)(`p`,{className:`panel-note`,children:[W===`auto`?`Agents run on the model of their tier, unless you pin one. Applied at the next rebuild.`:`Every agent runs on your session model, unless you pin one.`,Y?` Not rebuilt yet: Save rebuilds this install.`:``]})]}),(0,b.jsxs)(`div`,{className:`panel models-tiers`,role:`group`,"aria-label":`Models by tier`,children:[(0,b.jsx)(`div`,{className:`panel-head`,children:(0,b.jsx)(`h2`,{children:`Tiers`})}),(0,b.jsxs)(`div`,{className:`models-tier-row`,children:[(0,b.jsx)(`span`,{children:`Strong`}),(0,b.jsx)(`span`,{className:`dim`,children:`session model, always`})]}),ie.map(([e,t])=>{let n=q(e);return(0,b.jsxs)(`div`,{className:`models-tier-row`,children:[(0,b.jsx)(`span`,{children:t}),(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm models-model`,disabled:!!U||R,"aria-label":`${t} tier model: ${Z(n)}. Change`,onClick:()=>N({kind:`tier`,key:e}),children:Z(n)}),Q(n),K(e)?(0,b.jsx)(`span`,{className:`tag acc`,children:`unsaved`}):null]},e)}),(0,b.jsx)(`p`,{className:`panel-note`,children:Object.keys(y.defaults||{}).length?`Host defaults: ${Object.entries(y.defaults).map(([e,t])=>`${e} ${t}`).join(`, `)}.`:`${H} has no default model for a tier: a tier routes once you pick one.`})]}),(0,b.jsx)(`div`,{className:`panel flush models-agents`,children:(0,b.jsxs)(`table`,{className:`ldg`,"aria-label":`Agents`,children:[(0,b.jsx)(`thead`,{children:(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`th`,{scope:`col`,children:`Agent`}),(0,b.jsx)(`th`,{scope:`col`,"aria-sort":P?`ascending`:`none`,children:(0,b.jsxs)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>F(e=>!e),children:[`Tier`,P?` ▲`:``]})}),(0,b.jsx)(`th`,{scope:`col`,children:`Runs on`}),(0,b.jsx)(`th`,{scope:`col`,children:`Because`}),(0,b.jsx)(`th`,{scope:`col`,children:`Pin`})]})}),(0,b.jsx)(`tbody`,{children:de.map(e=>{let t=ue(e);return(0,b.jsxs)(`tr`,{children:[(0,b.jsx)(`td`,{className:`mono`,children:e.name}),(0,b.jsx)(`td`,{children:e.tier?(0,b.jsx)(`span`,{className:`tag ${ae[e.tier]??``}`,children:e.tier}):(0,b.jsx)(`span`,{className:`tag`,title:`No Geneseed source: not tiered`,children:`not tiered`})}),(0,b.jsx)(`td`,{className:`mono`,children:e.model?Z(e.model):(0,b.jsx)(`span`,{className:`dim`,children:`session model`})}),(0,b.jsx)(`td`,{className:`dim`,children:te(e.from,y.tiers)}),(0,b.jsx)(`td`,{children:(0,b.jsxs)(`span`,{className:`row gap-8 wrap`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm models-model`,disabled:!!U||R,"aria-label":`Pin a model for ${e.name}`,onClick:()=>N({kind:`pin`,key:e.name}),children:t?Z(t):`No pin`}),t?Q(t):null,O[e.name]===void 0?null:(0,b.jsx)(`span`,{className:`tag acc`,children:`unsaved`}),t?(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:!!U||R,"aria-label":`Clear the pin of ${e.name}`,onClick:()=>{k(t=>({...t,[e.name]:null})),B(!1)},children:`Clear`}):null]})})]},e.name)})})]})}),(0,b.jsxs)(`div`,{className:`models-foot row gap-8 wrap`,children:[(0,b.jsx)(`span`,{className:`sub`,role:`status`,children:X?`${X} unsaved change${X===1?``:`s`}`:se?`Saved. The agent files change at the next rebuild.`:`No unsaved changes.`}),(0,b.jsx)(`button`,{type:`button`,className:`btn`,disabled:!X||J>0&&!!U||R,onClick:pe,children:Y?`Save and rebuild…`:`Save`}),(0,b.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:X>0||R,onClick:$,children:`Rebuild…`})]}),(0,b.jsx)(x,{open:!!M,title:M?M.kind===`tier`?`${M.key} tier model`:`Model for ${M.key}`:``,data:y,current:me,onPick:fe,onClose:()=>N(null)},M?`${M.kind}:${M.key}`:`closed`)]})}export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{I as n,wt as r}from"./index-
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{I as n,wt as r}from"./index-BiKWWv7Z.js";import{n as i,r as a}from"./sections-CtFz7HFH.js";import{n as o,r as s}from"./Dashboard-CQxdiv7F.js";e();var c=t(),l=14;function u({title:e,right:t,children:n,span:r}){return(0,c.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,c.jsxs)(`div`,{className:`c-mod-head`,children:[(0,c.jsx)(`span`,{className:`c-tab`}),(0,c.jsx)(`h3`,{children:e}),t&&(0,c.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,c.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function d({label:e,value:t}){return(0,c.jsxs)(`div`,{className:`c-kpi`,children:[(0,c.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,c.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function f({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,c.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,c.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function p({checks:e}){return(0,c.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,c.jsx)(`span`,{className:`c-band-cell ${e.problems.length===0?`ok`:`bad`}`,title:`${e.label}: ${e.problems.length===0?`pass`:`${e.problems.length} problem(s)`}`},t))})}function m(e){let t={};for(let n of e||[]){let e=n.action||`unknown`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>({label:e,value:t})).sort((e,t)=>t.value-e.value)}function h({overview:e,jobs:t,lens:h}){let g=e.counts||{},_=a.reduce((e,t)=>e+(g[t]||0),0),v=Math.max(...a.map(e=>g[e]||0),1),y=h?.doctor?.state||`loading`,b=h?.doctor?.data?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=n(t||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(t),T=Math.max(...w.map(e=>e.value),1),E=r(e.diff),D=[[`status`,e.deployed?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,c.jsx)(`span`,{className:`t-cap`,children:e.theme})],[`mode`,e.emit],[`doctor`,y===`failed`?(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NO ANSWER`}):y===`ok`?b.length===0?(0,c.jsx)(`span`,{className:`c-pill`,children:`—`}):x===b.length?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,c.jsxs)(`span`,{className:`c-pill warn`,children:[b.length-x,` ISSUES`]}):(0,c.jsx)(`span`,{className:`c-pill`,children:`…`})],[`edits`,String(E)],[`built`,e.build_time||`—`],[`target`,(0,c.jsx)(`span`,{className:`c-dim mono`,children:e.target})]];return(0,c.jsxs)(`div`,{className:`c-root`,children:[(0,c.jsx)(`div`,{className:`c-titlebar`,children:(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h2`,{className:`c-h1`,children:`HARNESS // STATUS`}),(0,c.jsxs)(`div`,{className:`c-sub`,children:[e.target,` · rendered from src/ · inherited everywhere`]}),(0,c.jsx)(o,{verdict:h?.verdict})]})}),(0,c.jsx)(`div`,{className:`c-strip`,children:D.map(([e,t],n)=>(0,c.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,c.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,c.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,c.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,c.jsx)(d,{label:`AGENTS`,value:g.agents??`—`}),(0,c.jsx)(d,{label:`SKILLS`,value:g.skills??`—`}),(0,c.jsx)(d,{label:`DICTATES`,value:g.laws??`—`}),(0,c.jsx)(d,{label:`PACKS`,value:g.doctrines?`${g.doctrines.active}/${g.doctrines.total}`:`—`}),(0,c.jsx)(d,{label:`MEMORY`,value:g.memory??`—`}),(0,c.jsx)(d,{label:`NOTEBOOK`,value:g.notebook??`—`}),(0,c.jsx)(d,{label:`EDITS`,value:E})]}),(0,c.jsxs)(`div`,{className:`c-grid`,children:[(0,c.jsx)(u,{title:`CAPABILITY DISTRIBUTION`,right:`${_} ENTRIES`,span:2,children:(0,c.jsxs)(`table`,{className:`c-tbl`,children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`th`,{children:`SECTION`}),(0,c.jsx)(`th`,{children:`DETAIL`}),(0,c.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,c.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,c.jsx)(`tbody`,{children:a.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,children:i[e].label}),(0,c.jsx)(`td`,{className:`c-dim`,children:i[e].desc}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${(g[e]||0)/v*100}%`,background:e===`agents`||e===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,c.jsx)(`td`,{className:(g[e]||0)>0?`num`:`num c-dim`,children:g[e]??0})]},e))})]})}),(0,c.jsx)(u,{title:`DOCTOR // CHECKS`,right:b.length?`${x}/${b.length}`:`—`,children:b.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{checks:b}),(0,c.jsx)(`div`,{className:`c-check-list`,children:b.map(e=>{let t=e.problems.length===0;return(0,c.jsxs)(`div`,{className:`c-check-row`,children:[(0,c.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,c.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,c.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:y===`failed`?`Doctor did not answer.`:y===`ok`?`Doctor reported no checks.`:`Checking…`})}),(0,c.jsxs)(u,{title:`RUN RATE // 10D`,right:`${C} RUNS`,span:2,children:[(0,c.jsx)(f,{data:S,height:120,hi:S.length-1}),(0,c.jsx)(`div`,{className:`c-axis`,children:S.map((e,t)=>(0,c.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,c.jsx)(u,{title:`RUN LOG // BY TYPE`,right:`${(t||[]).length} LOGGED`,children:w.length>0?(0,c.jsx)(`table`,{className:`c-tbl`,children:(0,c.jsx)(`tbody`,{children:w.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${e.value/T*100}%`,background:`var(--accent)`}})})}),(0,c.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})}),(0,c.jsx)(u,{title:`RECENT // RUN LOG`,span:3,children:(0,c.jsx)(s,{jobs:t,max:l,empty:(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})})})]})]})}export{h as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{At as i,H as a,W as o,Y as s,et as c,gt as l,ht as u,it as d,nt as f,ot as p,q as m,tt as h}from"./index-BiKWWv7Z.js";import{t as g}from"./Tabs-BDhZImxa.js";import{t as _}from"./EmptyState-CY5Pm2xy.js";import{a as v,i as y}from"./router-1EhRJy1C.js";import{t as b}from"./Markdown-CxkA7940.js";import x,{installLabel as S}from"./Library-BQZnFdWs.js";var C=e(t(),1),w=e=>e(`Discard your unsaved edit?`,{title:`Unsaved edit`,confirmLabel:`Discard`,tone:`danger`}),T=`The file changed on disk — reloaded the fresh copy. Your draft is kept.`;function E({data:e,reload:t}){let n=p(),[r,i]=(0,C.useState)(null),[a,o]=(0,C.useState)(null),[s,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(``),d=e?.fingerprint||``,f=r!==null&&JSON.stringify(r)!==JSON.stringify(a),m=(0,C.useRef)(!1),h=e=>{i(e),o(e)},g=()=>i(null);return(0,C.useEffect)(()=>{if(!f)return;let e=e=>{e.preventDefault(),e.returnValue=``};window.addEventListener(`beforeunload`,e);let t=v(({to:e})=>(m.current||(m.current=!0,w(n).then(n=>{n&&(t(),i(null),y(e))}).finally(()=>{m.current=!1})),!1));return()=>{window.removeEventListener(`beforeunload`,e),t()}},[f,n]),{draft:r,setDraft:i,open:h,close:g,discard:async()=>f&&!await w(n)?!1:(g(),!0),dirty:f,busy:s,notice:l,setNotice:u,save:async(e,{conflict:n}={})=>{c(!0),u(``);try{return await e(d)||!0}catch(e){e.status===409?u(n??T):u(e.message);return}finally{c(!1),t()}}}}var D=n(),O=(e,t)=>`${e} ${t}${e===1?``:`s`}`,k=e=>`≈${e.toLocaleString(`en-US`)} tokens`,ee={title:``,body:``,scope:`project`,trial_until:``},A=[`project`,`global`],j=e=>e===`user`?`global`:e,M=/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/,N=e=>e.startsWith(`## `)||/^##\s+R\d+\s*[—–-]+\s*\S/.test(e),te=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Your draft is kept — Save again.`,ne=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Try again.`;function P({value:e,onChange:t,onCancel:n,onSave:r,busy:i,writeTo:a=null}){let[o]=(0,C.useState)(e.scope),s=n=>r=>t({...e,[n]:r.target.value}),c=e.body.trim().split(M).some(N)?`A line cannot start with “## ” — user-rules.md reads it as a new rule heading. Use ### or plain text.`:``,l=!(e.title.trim()&&e.body.trim()),u=!l&&!c;return(0,D.jsxs)(`div`,{className:`rule-form`,children:[a,(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule title`}),(0,D.jsx)(`input`,{className:`lib-filter`,type:`text`,value:e.title,onChange:s(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,autoFocus:!0})]}),(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule body`}),(0,D.jsx)(`textarea`,{className:`rule-body-input`,value:e.body,onChange:s(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-invalid":c?!0:void 0,"aria-describedby":c?`rule-body-error`:void 0})]}),c?(0,D.jsx)(`p`,{id:`rule-body-error`,className:`sub sub-wide rule-notice`,role:`alert`,children:c}):null,(0,D.jsxs)(`div`,{className:`row wrap`,children:[(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule scope`}),(0,D.jsxs)(`select`,{className:`sel`,value:e.scope,onChange:s(`scope`),children:[(0,D.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,D.jsx)(`option`,{value:`global`,children:`scope: global (every repository)`}),A.includes(o)?null:(0,D.jsxs)(`option`,{value:o,children:[`scope: `,o,` (as written in the file)`]})]})]}),(0,D.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,D.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:e.trial_until,onChange:s(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginLeft:`auto`},children:[(0,D.jsx)(`button`,{className:`btn sm`,disabled:!u||i,onClick:()=>r(e),"aria-describedby":l?`rule-form-hint`:void 0,children:i?`Saving…`:`Save rule`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:i,onClick:n,children:`Cancel`})]})]}),l?(0,D.jsx)(`p`,{id:`rule-form-hint`,className:`panel-note`,children:`A rule needs a title and a body.`}):null]})}function re({rule:e,tag:t,usual:n,isOpen:r,onToggle:i,onEdit:a,onDelete:o,onGraduate:s}){let c=t?` · ${t}`:``;return(0,D.jsxs)(`div`,{className:`rule-row ${r?`on`:``}`,children:[(0,D.jsxs)(`button`,{className:`rule-head`,onClick:i,"aria-expanded":r,"data-rule-head":e.key,children:[(0,D.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),j(e.scope)===n?null:(0,D.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,D.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`}),(0,D.jsx)(`span`,{className:`rule-chip mono`,children:k(e.tokens)})]}),r&&(0,D.jsxs)(`div`,{className:`rule-expand`,children:[(0,D.jsx)(`p`,{children:e.body}),e.source?(0,D.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10},children:[e.status===`trial`&&(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:s,title:`Adopt for good — drop the trial marker`,"aria-label":`Graduate R${e.id}${c}`,children:`Graduate`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:a,"aria-label":`Edit R${e.id}${c}`,children:`Edit`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:o,"aria-label":`Retire R${e.id}${c}`,children:`Retire`})]})]})]})}var F=(e,t)=>({approve:`Approve`,reject:`Reject`,host:`Use the ${e.choice?.host} file`,shared:`Use the shared file`,both:`Keep both`})[t];function I({choice:e}){let t=(e,t,n)=>(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`rule-src`,title:t,children:e}),(0,D.jsx)(`pre`,{className:`mono`,children:n??`(absent)`})]});return(0,D.jsxs)(`div`,{className:`rule-choice`,children:[t(`Shared file`,e.shared_path,e.shared_text),t(`${e.host} file`,e.host_path,e.host_text)]})}function ie({drafts:e,deciding:t,onDecide:n}){return e.length?(0,D.jsxs)(`section`,{className:`mb-16`,"aria-labelledby":`rules-pending`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`rules-pending`,children:`Pending`}),(0,D.jsx)(`span`,{className:`mono dim`,children:e.length})]}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Waiting in `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.draft.md`}),`. A pending rule for a host file still binds on its host, and only there. One drafted from your memory index is not loaded until you approve it. Decide each one here, or ask the agent to run its rule Rite.`]}),(0,D.jsx)(`div`,{className:`card rules-list`,children:e.map((e,r)=>(0,D.jsxs)(`div`,{className:`rule-row`,children:[(0,D.jsxs)(`div`,{className:`rule-head static`,children:[(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),e.host?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:e.host===`memory`?`not loaded until approved`:`binds on ${e.host}`}):null]}),(0,D.jsxs)(`div`,{className:`rule-expand`,children:[e.body?(0,D.jsx)(`p`,{children:e.body}):null,e.choice?(0,D.jsx)(I,{choice:e.choice}):null,e.held?(0,D.jsx)(`p`,{className:`rule-src`,children:`The shared file already holds this rule. The next rebuild clears it.`}):null,e.decisions?.length?(0,D.jsx)(`div`,{className:`row gap-8`,style:{marginTop:10},children:e.decisions.map(r=>(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:t!==``,"aria-label":`${F(e,r)} · ${e.title}`,onClick:()=>n(e,r),children:F(e,r)},r))}):null]})]},e.key??r))})]}):null}function L({onChanged:e,dataRev:t,onAction:n}){let i=p(),{targets:a,sets:o,failed:s,reason:d,reload:g}=m(r.rules,t),[v,y]=(0,C.useState)(null),b=E({data:null,reload:g}),{draft:x,busy:S,notice:w}=b,[T,A]=(0,C.useState)(``),[M,N]=(0,C.useState)(null),F=(0,C.useRef)(null),[I,L]=(0,C.useState)(0),R=e=>{F.current=e,L(e=>e+1)},z=(0,C.useRef)(null),B=(0,C.useRef)(null);if((0,C.useEffect)(()=>{let e=F.current;if(F.current=null,e===null)return;let t=[...B.current?.querySelectorAll(`[data-rule-head]`)||[]];(e===`add`?z.current:t.find(t=>t.dataset.ruleHead===e))?.focus()},[I]),o&&!o.length&&d)return(0,D.jsx)(c,{error:d,onRetry:g});if(!o)return(0,D.jsx)(h,{});let V=a.length>1,H=e=>e?.id??``,U=e=>e?.shared?`shared`:u(e),W=o.flatMap(({inst:e,data:t})=>(t.rules||[]).map(t=>({...t,inst:e,key:`${H(e)}#${t.id}`}))),G=o.filter(e=>e.data.exists).map(e=>e.inst),K=G.length>0,q=x?.target,J=q!==void 0&&q!==`new`&&!W.some(e=>e.key===q&&e.title===x.title0),Y=q===`new`||J,X=x?.to!==void 0&&!G.some(e=>H(e)===x.to),Z=X?null:G.find(e=>H(e)===x?.to)??G[0]??null,ae=X?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`alert`,children:`The install this draft was for has no user-rules.md now, so it is not saved anywhere else. Cancel it, or copy the text into a new rule.`}):G.length>1?(0,D.jsx)(f,{installs:G,value:Z,onChange:e=>b.setDraft({...x,to:e.id}),tagOf:U}):V&&Z?(0,D.jsxs)(`p`,{className:`install-pick`,children:[(0,D.jsx)(`span`,{className:`dim`,children:`Install:`}),` `,(0,D.jsx)(`span`,{className:`mono`,children:U(Z)})]}):null,Q=async(t,n,i)=>{let a=o.find(e=>H(e.inst)===H(n))?.data.fingerprint||``,s=await b.save(()=>r.rulesMutate({...t,fingerprint:a},l(n)),{conflict:i?te:ne});return s&&i&&b.close(),e?.(),s},$=e=>b.setDraft({...x,form:e}),oe=async(e,t,n)=>{await Q(e,t,!0)&&R(n)},se=async e=>{await b.discard()&&R(e)},ce=async e=>{await i(`Retire rule R${e.id} — “${e.title}”${V?` from ${U(e.inst)}`:``}? It moves to user-rules-retired.md, which is never loaded.`,{title:`Retire this rule?`,confirmLabel:`Retire`,tone:`danger`})&&await Q({op:`delete`,id:e.id},e.inst)&&x===null&&R(`add`)},le=async e=>{await Q({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``},e.inst)&&R(e.key)},ue=(e,t)=>{let n=e.choice?.file;return t===`approve`?i(`Approve “${e.title}”? It moves to the shared file under a new number and binds every host on this machine. A rule may tighten a law, never repeal one: check that it does not.`,{title:`Approve this rule?`,confirmLabel:`Approve`}):t===`host`?i(`Make the ${e.choice.host} file the shared ${n}? The current shared file is replaced, and a copy goes to archived-${n}/ beside it.`,{title:`Replace the shared file?`,confirmLabel:`Replace`,tone:`danger`}):t!==`shared`||i(`Keep the shared ${n}? The ${e.choice.host} file moves to archived-${n}/ beside it, and that host returns to its seed at the next rebuild.`,{title:`Move the host file aside?`,confirmLabel:`Move aside`,tone:`danger`})},de=async(t,n)=>{if(await ue(t,n)){A(t.key),N(null),b.setNotice(``);try{let e=await r.rulesDecide({key:t.key,decision:n,fingerprint:t.fingerprint},l(t.inst));N({rebuild:e.rebuild,cleared:e.cleared??[]})}catch(e){let t=e.body?.cleared?.length?` Cleared: ${e.body.cleared.join(`, `)}.`:``;b.setNotice(e.status===409?`${e.body?.detail??e.message}${t} Reloaded the fresh copy.`:e.message)}finally{A(``),g(),e?.()}}},fe=async()=>{await i(`Rebuild every active install? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&n(`build-all`)},pe=o.flatMap(({inst:e,data:t})=>(t.warnings||[]).map(t=>V?`${U(e)}: ${t}`:t)),me=o.flatMap(({inst:e,data:t})=>(t.drafts||[]).map(n=>({...n,inst:e,fingerprint:t.draft_fingerprint}))),he=o.filter(e=>e.data.exists),ge=e=>e?.scope===`project`?`project`:`global`,_e=e=>!J&&q===e.key?(0,D.jsx)(`div`,{className:`rule-row on`,children:(0,D.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,D.jsx)(P,{value:x.form,onChange:$,busy:S,onCancel:()=>se(e.key),onSave:t=>oe({op:`update`,id:e.id,source:e.source,...t},e.inst,e.key)})})},e.key):(0,D.jsx)(re,{rule:e,tag:V?U(e.inst):null,usual:ge(e.inst),isOpen:v===e.key,onToggle:()=>y(v===e.key?null:e.key),onEdit:()=>{y(e.key),b.open({target:e.key,no:e.id,to:H(e.inst),title0:e.title,form:{title:e.title,body:e.body,scope:j(e.scope),trial_until:e.trial_until}})},onDelete:()=>ce(e),onGraduate:()=>le(e)},e.key);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsxs)(`div`,{className:`head-text`,children:[(0,D.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Your standing rules, from `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`. The agent obeys them in every session, so keep the set small. `,(0,D.jsx)(`a`,{href:`#/docs/rules`,children:`Docs`})]})]}),K&&x===null&&(0,D.jsx)(`button`,{className:`btn`,ref:z,onClick:()=>b.open({target:`new`,title0:``,form:ee}),children:`Add rule`})]}),w?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:w}):null,s.length?(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:[`Could not read user-rules.md of`,` `,s.map(e=>e?u(e):`the default install`).join(`, `),`.`]}):null,pe.map(e=>(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,children:[`format warning: `,e]},e)),M?(0,D.jsxs)(`p`,{className:`sub sub-wide`,role:`status`,children:[`Decided.`,` `,M.rebuild?`A rebuild removes the host copy.`:`The host file stays as it is.`,M.cleared.length?` Cleared: ${M.cleared.join(`, `)}.`:``,` `,M.rebuild&&n?(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:fe,children:`Rebuild all`}):null]}):null,(0,D.jsx)(ie,{drafts:me,deciding:T,onDecide:de}),Y&&(0,D.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,D.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),J?(0,D.jsxs)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:[`Rule R`,x.no,` is no longer in user-rules.md (an agent session removed or renumbered it). Your draft is kept — Save adds it as a new rule.`]}):null,(0,D.jsx)(P,{value:x.form,onChange:$,busy:S,writeTo:ae,onCancel:()=>se(`add`),onSave:e=>!X&&G.length&&oe({op:`add`,...e},Z,`add`)})]}),K?W.length===0&&!Y?(0,D.jsx)(_,{title:`No rules yet`,children:`The file is seeded and loaded every session, and it is empty. Add your first standing rule here, ask the agent for one in a session (the rule skill), or promote a recurring fact from Memory.`}):(0,D.jsx)(`div`,{ref:B,children:he.map(({inst:e,data:t})=>(0,D.jsxs)(`section`,{className:`mb-16`,"aria-label":V?U(e):`Rules`,children:[(0,D.jsxs)(`div`,{className:`rules-file`,children:[V?(0,D.jsx)(`b`,{className:`mono`,children:U(e)}):null,(0,D.jsxs)(`span`,{className:`mono dim`,children:[O(t.rules.length,`rule`),` · `,k(t.stats.tokens),` every turn · scope `,ge(e),` unless marked`]})]}),t.rules.length?(0,D.jsx)(`div`,{className:`card rules-list`,children:W.filter(t=>t.inst===e).map(_e)}):null]},H(e)))}):(0,D.jsxs)(_,{title:`No user-rules.md here yet`,children:[`The build seeds it. Rebuild on the Overview, or run`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`, and it appears, ready for your rules.`]})]})}var R=`PROFILE.md changed on disk since you opened it — reloaded the fresh copy. Your draft is kept — Save again.`,z=e=>e?.id??``;function B({onChanged:e,dataRev:t}){let{targets:n,sets:i,failed:a}=m(r.profile,t);if(!i)return(0,D.jsx)(h,{});let o=new Set(a.map(z)),s=new Set([...i.map(e=>z(e.inst)),...o]),c=n.filter(e=>s.has(z(e))).map(e=>({install:e,tag:n.length<2?null:e?.shared&&!o.has(z(e))?`shared`:u(e)}));return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`mb-16`,children:[(0,D.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,D.jsxs)(`p`,{className:`sub sub-wide`,children:[`Who you are and how you like to work, from `,(0,D.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),`. It guides the agent and never binds it. `,(0,D.jsx)(`a`,{href:`#/docs/collaboration`,children:`Docs`})]})]}),c.map(({install:t,tag:n})=>(0,D.jsx)(V,{install:t,tag:n,onChanged:e},z(t)))]})}function V({install:e,tag:t,onChanged:n}){let{data:a,error:o,loading:s,reload:u,setData:f}=i(()=>r.profile(l(e)),[]),p=E({data:a,reload:u}),{draft:m,dirty:g,busy:v,notice:y}=p,[x,S]=(0,C.useState)(!1);if(a&&!x&&(S(!0),(a.text||``).trim()||p.open(a.text||``)),s&&!a)return(0,D.jsx)(h,{});if(o)return(0,D.jsxs)(`section`,{"aria-label":t?`Profile, ${t}`:void 0,children:[t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null,(0,D.jsx)(c,{error:o,onRetry:u})]});let w=m!==null,T=a?.text||``;return(0,D.jsxs)(`section`,{"aria-label":t?`Profile, ${t}`:void 0,children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsx)(`div`,{children:t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null}),(0,D.jsxs)(`div`,{className:`row`,children:[(0,D.jsxs)(d,{"aria-label":t?`Profile mode, ${t}`:`Profile mode`,children:[(0,D.jsx)(`button`,{className:w?``:`on`,"aria-pressed":!w,onClick:p.discard,children:`View`}),(0,D.jsx)(`button`,{className:w?`on`:``,"aria-pressed":w,onClick:()=>w||p.open(T),children:`Edit`})]}),w&&(0,D.jsx)(`button`,{className:`btn`,disabled:!g||v,onClick:async()=>{let t=await p.save(t=>r.profileSave({text:m,fingerprint:t},l(e)),{conflict:R});t&&(f(e=>({...e,text:m,seeded:!1,fingerprint:t.fingerprint||``})),p.setNotice(`Saved.`),p.close(),n?.())},children:v?`Saving…`:`Save`})]})]}),y?(0,D.jsx)(`p`,{className:`sub sub-wide rule-notice`,role:`status`,children:y}):null,w?(0,D.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:m,onChange:e=>p.setDraft(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):T.trim()?(0,D.jsxs)(D.Fragment,{children:[a?.seeded?(0,D.jsxs)(_,{title:`This is still the template`,children:[`Ask the agent to run the `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]}):null,(0,D.jsx)(`div`,{className:`card pad-lg`,children:(0,D.jsx)(b,{body:T})})]}):(0,D.jsxs)(_,{title:`No profile yet`,children:[`Switch to Edit to write one, or ask the agent to run the`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})]})}var H=(e,t)=>`${e} ${t}${e===1?``:`s`}`,U=e=>e?(e.items||[]).length:null,W=/^- \[([^\]]*)\]\(topics\/[^)]+\.md\) — (\d+) facts?$/,G=e=>String(e||``).split(`
|
|
2
|
+
`).map(e=>W.exec(e.trim())).filter(Boolean).map(e=>({topic:e[1],n:Number(e[2])}));function K({topics:e,install:t,shared:n}){return e.length?(0,D.jsxs)(`section`,{className:`panel pm-topics`,"aria-labelledby":`pm-topics`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`pm-topics`,children:`Topics`}),t&&!n?(0,D.jsx)(`span`,{className:`mono dim`,children:S(t)}):null,(0,D.jsx)(`span`,{className:`mono dim`,children:H(e.length,`topic`)})]}),(0,D.jsx)(`ul`,{className:`hbars`,children:e.map(e=>(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:`hb-label`,children:e.topic}),(0,D.jsx)(`span`,{className:`mono hb-n`,children:H(e.n,`fact`)})]},e.topic))})]}):null}var q={memory:{title:`No facts yet`,body:(0,D.jsxs)(`div`,{className:`pm-first`,children:[(0,D.jsx)(`p`,{children:`The agent writes a fact when a session teaches it something durable: a decision, a correction, a trap. Say “remember that…” in any session, and it asks whether that belongs here or in your standing rules.`}),(0,D.jsxs)(`ul`,{children:[(0,D.jsx)(`li`,{children:`One fact per file, filed under a topic.`}),(0,D.jsx)(`li`,{children:`Stale facts move to Archived; nothing is deleted without you.`}),(0,D.jsx)(`li`,{children:`The store stays on this machine and out of git.`})]})]}),action:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/docs/memory`,children:`How memory works`}),(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/item/skill/rule`,children:`The rule skill`})]})},notebook:{title:`No notes yet`,body:`The notebook is the agent’s own scratch space: plans and notes it keeps for itself.`}};function J({tab:e=`rules`,item:t,dataRev:n,onCountsChanged:c,onAction:l}){let u=e=>Promise.resolve(e).catch(()=>null),d=s(n),{reload:f}=o(n),{data:p,error:m,reload:h}=i(()=>r.profile(),[n]),{data:v,reload:y}=i(()=>r.catalog(`memory`),[`memory`,n],`catalog`),{data:b}=i(()=>r.catalog(`notebook`),[`notebook`,n],`catalog`),S=U(v),{data:C}=i(()=>e===`memory`?u(r.item(`memory`,`MEMORY`)):Promise.resolve(null),[`memory-map`,e,n,S]),w=U(b),T={memory:S,notebook:w},E={profile:m?`read failed`:p?.seeded?`template`:null,memory:S,notebook:w},O=e===`memory`||e===`notebook`;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(a,{title:`Personal`,sub:`The only files you write. They survive updates, reinstalls and voice changes.`+(d?.some(e=>e.shared)?` Global installs share one copy of the rules, profile and memory; a project install keeps its own.`:``)}),(0,D.jsx)(g,{page:`personal`,current:e,badges:E,label:`Personal files`}),e===`rules`&&(0,D.jsx)(L,{onChanged:f,dataRev:n,onAction:l}),e===`profile`&&(0,D.jsx)(B,{onChanged:h,dataRev:n}),O&&T[e]===0&&!t?(0,D.jsx)(_,{title:q[e].title,action:q[e].action,children:q[e].body}):O?(0,D.jsxs)(D.Fragment,{children:[e===`memory`&&(0,D.jsx)(K,{topics:G(C?.body),install:C?.install,shared:C?.shared}),(0,D.jsx)(x,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:n,onCountsChanged:c,onRulesChanged:()=>{f(),y()}},e)]}):null]})}export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{Ct as r,H as i,Ot as a,St as o,et as s,jt as c,mt as l,ot as u,rt as d}from"./index-BILaKHbH.js";import{t as f}from"./api-C8nMUU1i.js";import{i as p}from"./motion-RlUl1osO.js";var m=e(t(),1),h=n();function g(){let e=u(),[t,n]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null);return t?(0,h.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,h.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),(0,h.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 f.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,h.jsx)(r,{name:`x`}),`Stop server`]})]})}function _(){let e=u(),[t,n]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),(0,h.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),a(null);try{await c()}catch(e){a(e.message),n(!1)}}},disabled:t,children:[(0,h.jsx)(r,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var v=`https://github.com/Arylmera/Geneseed`,y=`https://github.com/Arylmera`,b=[[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],x=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function S({k:e,kid:t,help:n,children:r,control:i}){return(0,h.jsxs)(`div`,{className:`sheet-row`,children:[(0,h.jsxs)(`span`,{className:`sheet-k`,children:[t?(0,h.jsx)(`span`,{id:t,children:e}):e,n?(0,h.jsx)(`span`,{className:`sheet-h sub`,children:n}):null]}),(0,h.jsx)(`div`,{className:`sheet-v`,children:r}),(0,h.jsx)(`div`,{className:`sheet-c`,children:i})]})}function C({id:e,title:t,head:n,className:r=``,children:i}){return(0,h.jsxs)(`section`,{id:`set-${e}`,className:`card pad-md sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,h.jsxs)(`div`,{className:`card-head`,children:[(0,h.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function w({stale:e,ids:t}){let n=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:p()?`smooth`:`auto`,block:`start`});return(0,h.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:b.filter(([e])=>t.includes(e)).map(([t,r])=>(0,h.jsxs)(`button`,{type:`button`,className:t===`danger`?`t-bad`:``,onClick:()=>n(t),children:[r,t===`server`&&(0,h.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},t))})}function T({version:e}){let[t,n]=(0,m.useState)(v),[i,a]=(0,m.useState)(!0);(0,m.useEffect)(()=>{Promise.resolve(f.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,h.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,h.jsx)(r,{name:`external`})]});return(0,h.jsxs)(C,{id:`about`,title:`About`,children:[(0,h.jsx)(S,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,h.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,h.jsx)(S,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,h.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,h.jsx)(S,{k:`Geneseed`,help:`MIT-licensed`,control:(0,h.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,h.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`external`}),`Issues`]}),(0,h.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`external`}),`MIT License`]})]})]}),children:(0,h.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,h.jsx)(S,{k:`Creator`,control:(0,h.jsxs)(`a`,{className:`btn ghost`,href:y,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,h.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,h.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}var E={absent:`Off`,ours:`On · written by Geneseed`,stale:`On · points at another copy or Node`,hand:`On · set up by hand`};function D({initial:e}){let t=u(),[n,r]=(0,m.useState)(void 0),[i,a]=(0,m.useState)(null),[o,c]=(0,m.useState)(!1),l=n===void 0?e:n,d=async e=>{let n=e===`install`;if(await t(n?`Write ${l.file}? It starts the web console from ${l.root} at each login (hidden, no browser).`+(l.file.endsWith(`.plist`)?` It loads at your next login.`:``)+(l.transient?` Warning: that copy is an agent worktree or an npx cache, which can be deleted; the login item then fails.`:``):`Delete ${l.file}? The console no longer starts at login.`,n?{title:`Start at login?`,confirmLabel:l.state===`stale`?`Update`:`Write file`}:{title:`Stop starting at login?`,confirmLabel:`Delete file`,tone:`danger`})){c(!0),a(null);try{r((await f.autostart(e)).autostart)}catch(e){a(e.message),e.body?.autostart&&r(e.body.autostart)}finally{c(!1)}}},p=l?.state,g=p===`absent`||p===`stale`?(0,h.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>d(`install`),children:p===`stale`?`Update`:`Turn on`}):p===`ours`?(0,h.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>d(`remove`),children:`Remove`}):p===`hand`?(0,h.jsx)(`a`,{href:`#/docs/autostart`,children:`Install guide →`}):null;return(0,h.jsx)(S,{k:`Start at login`,help:l?l.file:l===null?`No login launcher on this system`:`A login launcher`,control:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),g]}),children:(0,h.jsx)(`span`,{className:`sub`,children:l===null?`not available`:E[p]??`unknown`})})}function O({overview:e,onAction:t}){let n=u(),{canSee:s}=o(),c=b.map(([e])=>e).filter(e=>s(`section:settings/${e}`)),p=e?.server,v=e?.daemon_stale,[y,E]=(0,m.useState)(null);(0,m.useEffect)(()=>{Promise.resolve(f.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let O=y?y.install??(y.git?`git`:`npm-global`):null,k=O===`git`?`Update (git pull + rebuild)`:O===`npm-global`?`Update (npm install -g + rebuild)`:`Update`;return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(i,{title:`Settings`,sub:`This copy of Geneseed and the local server.`}),(0,h.jsxs)(`div`,{className:`sheet`,children:[(0,h.jsx)(w,{stale:v,ids:c}),(0,h.jsxs)(`div`,{className:`sheet-body`,children:[(0,h.jsxs)(C,{id:`machine`,title:`Machine`,children:[(0,h.jsx)(S,{k:`Geneseed`,help:`This copy of the source`,control:O===`other`?y.command?(0,h.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,h.jsx)(`code`,{className:`mono`,children:y.command})]}):null:y?.behind===!1?(0,h.jsx)(`span`,{className:`dim`,children:`This checkout cannot pull: it has local changes, a detached HEAD, no upstream or a diverged branch.`}):(0,h.jsxs)(`button`,{className:`btn`,onClick:async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await f.installs();e=t.filter(e=>e.state===`active`).map(e=>`${l(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await n(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},children:[(0,h.jsx)(r,{name:`download`}),k]}),children:(0,h.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,h.jsx)(S,{k:`View level`,kid:`set-view-level`,help:`How much of the console to show. Hidden parts keep working.`,control:(0,h.jsx)(d,{labelledBy:`set-view-level`})}),(0,h.jsx)(S,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,h.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,h.jsx)(r,{name:`external`}),`Add to PATH`]})})]}),(0,h.jsxs)(C,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`pill good`,children:`running`}),(0,h.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,p?` · pid ${p.pid} · up ${a(p.started)}`:``]})]}),children:[(0,h.jsx)(S,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,h.jsx)(_,{}),children:v?(0,h.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,h.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,h.jsx)(D,{initial:p?.autostart}),(0,h.jsx)(S,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,h.jsx)(`span`,{className:`row wrap gap-8`,children:x.map(e=>(0,h.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,h.jsx)(T,{version:e?.version}),c.includes(`danger`)&&(0,h.jsxs)(C,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,h.jsx)(S,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,h.jsx)(g,{})}),(0,h.jsx)(S,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,h.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,h.jsx)(S,{k:`Uninstall`,children:(0,h.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,h.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}export{b as SECTIONS,O as default};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{Ct as r,H as i,Ot as a,St as o,et as s,jt as c,mt as l,ot as u,rt as d}from"./index-BiKWWv7Z.js";import{t as f}from"./api-C8nMUU1i.js";import{i as p}from"./motion-RlUl1osO.js";var m=e(t(),1),h=n();function g(){let e=u(),[t,n]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null);return t?(0,h.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,h.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),(0,h.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 f.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,h.jsx)(r,{name:`x`}),`Stop server`]})]})}function _(){let e=u(),[t,n]=(0,m.useState)(!1),[i,a]=(0,m.useState)(null);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),(0,h.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),a(null);try{await c()}catch(e){a(e.message),n(!1)}}},disabled:t,children:[(0,h.jsx)(r,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var v=`https://github.com/Arylmera/Geneseed`,y=`https://github.com/Arylmera`,b=[[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],x=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function S({k:e,kid:t,help:n,children:r,control:i}){return(0,h.jsxs)(`div`,{className:`sheet-row`,children:[(0,h.jsxs)(`span`,{className:`sheet-k`,children:[t?(0,h.jsx)(`span`,{id:t,children:e}):e,n?(0,h.jsx)(`span`,{className:`sheet-h sub`,children:n}):null]}),(0,h.jsx)(`div`,{className:`sheet-v`,children:r}),(0,h.jsx)(`div`,{className:`sheet-c`,children:i})]})}function C({id:e,title:t,head:n,className:r=``,children:i}){return(0,h.jsxs)(`section`,{id:`set-${e}`,className:`card pad-md sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,h.jsxs)(`div`,{className:`card-head`,children:[(0,h.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function w({stale:e,ids:t}){let n=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:p()?`smooth`:`auto`,block:`start`});return(0,h.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:b.filter(([e])=>t.includes(e)).map(([t,r])=>(0,h.jsxs)(`button`,{type:`button`,className:t===`danger`?`t-bad`:``,onClick:()=>n(t),children:[r,t===`server`&&(0,h.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},t))})}function T({version:e}){let[t,n]=(0,m.useState)(v),[i,a]=(0,m.useState)(!0);(0,m.useEffect)(()=>{Promise.resolve(f.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,h.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,h.jsx)(r,{name:`external`})]});return(0,h.jsxs)(C,{id:`about`,title:`About`,children:[(0,h.jsx)(S,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,h.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,h.jsx)(S,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,h.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,h.jsx)(S,{k:`Geneseed`,help:`MIT-licensed`,control:(0,h.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,h.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`external`}),`Issues`]}),(0,h.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`external`}),`MIT License`]})]})]}),children:(0,h.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,h.jsx)(S,{k:`Creator`,control:(0,h.jsxs)(`a`,{className:`btn ghost`,href:y,target:`_blank`,rel:`noreferrer`,children:[(0,h.jsx)(r,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,h.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,h.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}var E={absent:`Off`,ours:`On · written by Geneseed`,stale:`On · points at another copy or Node`,hand:`On · set up by hand`};function D({initial:e}){let t=u(),[n,r]=(0,m.useState)(void 0),[i,a]=(0,m.useState)(null),[o,c]=(0,m.useState)(!1),l=n===void 0?e:n,d=async e=>{let n=e===`install`;if(await t(n?`Write ${l.file}? It starts the web console from ${l.root} at each login (hidden, no browser).`+(l.file.endsWith(`.plist`)?` It loads at your next login.`:``)+(l.transient?` Warning: that copy is an agent worktree or an npx cache, which can be deleted; the login item then fails.`:``):`Delete ${l.file}? The console no longer starts at login.`,n?{title:`Start at login?`,confirmLabel:l.state===`stale`?`Update`:`Write file`}:{title:`Stop starting at login?`,confirmLabel:`Delete file`,tone:`danger`})){c(!0),a(null);try{r((await f.autostart(e)).autostart)}catch(e){a(e.message),e.body?.autostart&&r(e.body.autostart)}finally{c(!1)}}},p=l?.state,g=p===`absent`||p===`stale`?(0,h.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>d(`install`),children:p===`stale`?`Update`:`Turn on`}):p===`ours`?(0,h.jsx)(`button`,{className:`btn ghost`,disabled:o,onClick:()=>d(`remove`),children:`Remove`}):p===`hand`?(0,h.jsx)(`a`,{href:`#/docs/autostart`,children:`Install guide →`}):null;return(0,h.jsx)(S,{k:`Start at login`,help:l?l.file:l===null?`No login launcher on this system`:`A login launcher`,control:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s,{error:i}),g]}),children:(0,h.jsx)(`span`,{className:`sub`,children:l===null?`not available`:E[p]??`unknown`})})}function O({overview:e,onAction:t}){let n=u(),{canSee:s}=o(),c=b.map(([e])=>e).filter(e=>s(`section:settings/${e}`)),p=e?.server,v=e?.daemon_stale,[y,E]=(0,m.useState)(null);(0,m.useEffect)(()=>{Promise.resolve(f.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let O=y?y.install??(y.git?`git`:`npm-global`):null,k=O===`git`?`Update (git pull + rebuild)`:O===`npm-global`?`Update (npm install -g + rebuild)`:`Update`;return(0,h.jsxs)(`div`,{children:[(0,h.jsx)(i,{title:`Settings`,sub:`This copy of Geneseed and the local server.`}),(0,h.jsxs)(`div`,{className:`sheet`,children:[(0,h.jsx)(w,{stale:v,ids:c}),(0,h.jsxs)(`div`,{className:`sheet-body`,children:[(0,h.jsxs)(C,{id:`machine`,title:`Machine`,children:[(0,h.jsx)(S,{k:`Geneseed`,help:`This copy of the source`,control:O===`other`?y.command?(0,h.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,h.jsx)(`code`,{className:`mono`,children:y.command})]}):null:y?.behind===!1?(0,h.jsx)(`span`,{className:`dim`,children:`This checkout cannot pull: it has local changes, a detached HEAD, no upstream or a diverged branch.`}):(0,h.jsxs)(`button`,{className:`btn`,onClick:async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await f.installs();e=t.filter(e=>e.state===`active`).map(e=>`${l(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await n(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},children:[(0,h.jsx)(r,{name:`download`}),k]}),children:(0,h.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,h.jsx)(S,{k:`View level`,kid:`set-view-level`,help:`How much of the console to show. Hidden parts keep working.`,control:(0,h.jsx)(d,{labelledBy:`set-view-level`})}),(0,h.jsx)(S,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,h.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,h.jsx)(r,{name:`external`}),`Add to PATH`]})})]}),(0,h.jsxs)(C,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`pill good`,children:`running`}),(0,h.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,p?` · pid ${p.pid} · up ${a(p.started)}`:``]})]}),children:[(0,h.jsx)(S,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,h.jsx)(_,{}),children:v?(0,h.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,h.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,h.jsx)(D,{initial:p?.autostart}),(0,h.jsx)(S,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,h.jsx)(`span`,{className:`row wrap gap-8`,children:x.map(e=>(0,h.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,h.jsx)(T,{version:e?.version}),c.includes(`danger`)&&(0,h.jsxs)(C,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,h.jsx)(S,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,h.jsx)(g,{})}),(0,h.jsx)(S,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,h.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,h.jsx)(S,{k:`Uninstall`,children:(0,h.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,h.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}export{b as SECTIONS,O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,r}from"./router-1EhRJy1C.js";import{St as i}from"./index-
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,r}from"./router-1EhRJy1C.js";import{St as i}from"./index-BiKWWv7Z.js";e();var a=t();function o({page:e,current:t,badges:o={},label:s}){let{canSee:c}=i();return(0,a.jsx)(`nav`,{className:`tabs`,"aria-label":s,children:n[e].filter(n=>n===t||c(`tab:${e}/${n}`)).map(n=>(0,a.jsxs)(`a`,{href:`#/${e}/${n}`,className:t===n?`on`:``,"aria-current":t===n?`page`:void 0,children:[r[n],o[n]==null?null:(0,a.jsx)(`span`,{className:`tab-badge`,children:o[n]})]},n))})}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{St as n}from"./index-BiKWWv7Z.js";e();var r=t();function i({label:e,value:t,options:n,onChange:i}){return n.length?(0,r.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>i(e.target.value),children:n.map(e=>(0,r.jsx)(`option`,{value:e,children:e},e))}):null}var a=[`lean`,`full`];function o({on:e,disabled:t,label:n,onToggle:i}){return(0,r.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:i,onKeyDown:e=>{e.key===`Enter`&&!t&&i()}})}var s=[{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 c({value:e,options:t,onChange:a,who:o}){let{canSee:c}=n();return s.filter(e=>c(`field:install/${e.name}`)).map(n=>(0,r.jsxs)(`label`,{className:`dp-field`,"data-pick":n.name,children:[(0,r.jsx)(`span`,{children:n.title}),(0,r.jsx)(i,{label:`${n.name} for ${o}`,value:e[n.key],options:t[n.key],onChange:e=>a(n.key,e)})]},n.key))}export{o as i,c as n,i as r,a as t};
|