geneseed 5.6.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +2 -2
- package/SHIPPED.md +2 -2
- package/adapters/opencode/README.md +7 -4
- package/docs/concepts/agents.md +10 -0
- package/docs/concepts/exclusions.md +1 -1
- package/docs/concepts/foreman-mode.md +4 -2
- package/docs/concepts/kits.md +20 -2
- package/docs/concepts/loops.md +5 -0
- package/docs/concepts/skills.md +1 -1
- package/docs/concepts/superpowers-kit.md +79 -0
- package/docs/extending.md +11 -4
- package/docs/guides/install-scripted.md +1 -1
- package/docs/reference/cli.md +2 -0
- package/docs/reference/profiles.md +10 -5
- package/harness.config.json +1 -1
- package/js/README.md +3 -0
- package/js/build/args.mjs +4 -2
- package/js/build/driver.mjs +8 -8
- package/js/build/emit-claude.mjs +5 -3
- package/js/build/emit-opencode.mjs +2 -2
- package/js/build/generate.mjs +1 -1
- package/js/build/profile.mjs +15 -7
- package/js/build/render.mjs +81 -10
- package/js/build/source.mjs +75 -1
- package/js/cli-table.json +17 -2
- package/js/hosts/installs.mjs +50 -4
- package/js/hosts/native.mjs +125 -9
- package/js/hosts/opencode.mjs +13 -15
- package/js/inspect/checks-authoring.mjs +24 -1
- package/js/inspect/checks-build.mjs +43 -2
- package/js/inspect/checks-counts.mjs +72 -1
- package/js/inspect/diff.mjs +17 -3
- package/js/inspect/doctor.mjs +23 -2
- package/js/inspect/status.mjs +5 -1
- package/js/inspect/validate.mjs +1 -1
- package/js/loop/catalog.mjs +10 -0
- package/js/maintain/kit-migration.mjs +109 -0
- package/js/maintain/plugin-detect.mjs +150 -0
- package/js/maintain/profiles.mjs +46 -5
- package/js/maintain/setup.mjs +45 -11
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +28 -7
- package/js/web/agent-models-api.mjs +172 -0
- package/js/web/api.mjs +3 -1
- package/js/web/profiles-api.mjs +11 -7
- package/js/web/routes.mjs +5 -1
- package/package.json +1 -1
- package/profiles/autonomous.json +1 -0
- package/profiles/corporate.json +1 -1
- package/profiles/mentor.json +1 -0
- package/profiles/minimal.json +2 -1
- package/profiles/starter.json +1 -1
- package/src/AGENT.md.tmpl +1 -6
- package/src/agents/_template.md +4 -0
- package/src/agents/advocate.md +1 -0
- package/src/agents/architect.md +1 -0
- package/src/agents/developer.md +12 -4
- package/src/agents/empiricist.md +1 -0
- package/src/agents/explorer.md +1 -0
- package/src/agents/framer.md +1 -0
- package/src/agents/historian.md +1 -0
- package/src/agents/operator.md +1 -0
- package/src/agents/performance.md +2 -1
- package/src/agents/pragmatist.md +1 -0
- package/src/agents/react-reviewer.md +1 -0
- package/src/agents/researcher.md +1 -0
- package/src/agents/reviewer.md +1 -0
- package/src/agents/security.md +1 -0
- package/src/agents/skeptic.md +1 -0
- package/src/agents/spring-reviewer.md +1 -0
- package/src/agents/spring-security.md +1 -0
- package/src/agents/steward.md +1 -0
- package/src/agents/user-advocate.md +1 -0
- package/src/agents/visionary.md +1 -0
- package/src/bricks/ci-fix.md +12 -2
- package/src/kits/superpowers/missing.md +3 -0
- package/src/kits/superpowers/provider.md +7 -0
- package/src/kits/superpowers/rules.md +6 -0
- package/src/kits/superpowers.json +45 -0
- package/src/modes/foreman.md +18 -12
- package/src/skills/parallel-agents.md +2 -2
- package/src/skills/spring-boot/cloud.md +8 -2
- package/src/skills/spring-boot.md +3 -1
- package/src/skills/spring-testing.md +3 -3
- package/src/upstreams.json +1 -1
- package/web/dist/assets/{ActiveLoops-DOJCPPPc.js → ActiveLoops-6p44eD86.js} +1 -1
- package/web/dist/assets/{Activity-bUSPM3Dl.js → Activity-CIgrq5R1.js} +1 -1
- package/web/dist/assets/{ActivityDetail-AHRoXeFN.js → ActivityDetail-Brqv1u4f.js} +1 -1
- package/web/dist/assets/{Bonsai-B5XY9pid.js → Bonsai-8NtlFrPO.js} +1 -1
- package/web/dist/assets/{CopyButton-C0wwRR9H.js → CopyButton-BHqKgdjJ.js} +1 -1
- package/web/dist/assets/{Dashboard-DPAA96EI.js → Dashboard-CoveJ_-U.js} +2 -2
- package/web/dist/assets/{Docs-CpGDq165.js → Docs-C1jzrFnD.js} +1 -1
- package/web/dist/assets/{Factories-cNhETa5Q.js → Factories-D5pLnt5S.js} +1 -1
- package/web/dist/assets/{GreenhouseView-DO3ADmT9.js → GreenhouseView-ofAQ-V5h.js} +1 -1
- package/web/dist/assets/Installs-DpWgyT5j.js +3 -0
- package/web/dist/assets/{JournalView--W-Lw_V9.js → JournalView-CsuN3_B-.js} +1 -1
- package/web/dist/assets/{Kits-ChfehxY6.js → Kits-P4xspDuN.js} +1 -1
- package/web/dist/assets/{Laws-CNxYmV36.js → Laws-DK3OwGDl.js} +1 -1
- package/web/dist/assets/{LibRows-CiPvsRYB.js → LibRows-CGO25X3D.js} +1 -1
- package/web/dist/assets/Library-e-94YED6.js +3 -0
- package/web/dist/assets/{Loops-DAblKkyq.js → Loops-C9DSBj-A.js} +1 -1
- package/web/dist/assets/{OperatorHudView-QtSaSyYm.js → OperatorHudView-Cc8mlViW.js} +1 -1
- package/web/dist/assets/{Personal-DxSGv638.js → Personal-DVh2jYPO.js} +1 -1
- package/web/dist/assets/{Settings-CgTbhvRv.js → Settings-CknBI-Fx.js} +1 -1
- package/web/dist/assets/{Tabs-Cf4X1hdz.js → Tabs-C30JrkJH.js} +1 -1
- package/web/dist/assets/api-DxwG8y94.js +1 -0
- package/web/dist/assets/index-CUJ8AaAF.css +1 -0
- package/web/dist/assets/{index-B_pTwZra.js → index-MB7E-va_.js} +3 -3
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Installs-D3dDyq10.js +0 -3
- package/web/dist/assets/Library-BxQvbwVU.js +0 -3
- package/web/dist/assets/api-CZ-x0iWG.js +0 -1
- package/web/dist/assets/index-CzfImiYb.css +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
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"./Tabs-Cf4X1hdz.js";import{B as i,G as a,H as o,J as s,K as c,Y as l,_t as u,at as d,et as f,ft as p,gt as m,ht as h,lt as g,nt as _,pt as v,rt as y,tt as b,vt as x,wt as S,yt as C}from"./index-B_pTwZra.js";import{t as w}from"./api-CZ-x0iWG.js";import{t as T}from"./EmptyState-CY5Pm2xy.js";import{i as E,n as D,r as O,t as k}from"./controls-CK7qHA8H.js";var A=e(t(),1),j=n();function M({host:e,theme:t,options:n,onAction:r,onClose:i,onNote:a}){let[o,s]=(0,A.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[c,l]=(0,A.useState)(!1),[u,d]=(0,A.useState)(``),f=(e,t)=>s(n=>({...n,[e]:t})),m=async()=>{l(!0),a(``);try{let e=await w.pickFolder();e.path?(f(`path`,e.path),d(``)):e.error&&a(e.error)}catch(e){a(e.message)}finally{l(!1)}},h=async()=>{let e=o.path.trim();e?(d(``),a(``),await r?.(`deploy`,{host:o.host,path:e,theme:o.theme,footprint:o.footprint,posture:o.posture,mode:o.mode,trust:o.trust})&&i()):d(`Choose or type a folder to deploy into.`)};return(0,j.jsxs)(`div`,{className:`deploy-pop`,children:[(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:o.path,onChange:e=>{f(`path`,e.target.value),d(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":u?!0:void 0,"aria-describedby":u?`dp-path-err`:void 0}),(0,j.jsx)(`button`,{className:`btn ghost sm`,disabled:c,onClick:m,children:c?`Choosing…`:`Browse…`})]}),u?(0,j.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:u}):null,(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsxs)(`label`,{className:`dp-field`,children:[(0,j.jsx)(`span`,{children:`Deploy as`}),(0,j.jsx)(`select`,{className:`sel`,"aria-label":`host for the new install`,value:o.host,onChange:e=>f(`host`,e.target.value),children:g.map(e=>(0,j.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,j.jsx)(D,{value:o,options:n,onChange:f,who:`the new install`}),(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Cancel`})]}),(0,j.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,j.jsx)(`code`,{children:p(o.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function N(){let{data:e,error:t,reload:n}=S(()=>w.excludes(),[]),[r,i]=(0,A.useState)(!1),[a,o]=(0,A.useState)([]),s=async(e,t)=>{i(!0);try{let n=await w.excludeMutate(e,t);o(n.messages||[])}catch(e){o(e.body?.messages||[e.message])}finally{i(!1),n()}};return t||!e?.installs?.length?null:(0,j.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,j.jsx)(`div`,{className:`card-head`,children:(0,j.jsx)(`h3`,{children:`Excluded folders`})}),(0,j.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,j.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,j.jsx)(`code`,{children:e.path}),(0,j.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>p(e).label).join(`, `)}),(0,j.jsx)(`button`,{className:`btn ghost sm`,disabled:r,"aria-label":`Stop excluding ${e.path}`,onClick:()=>s(`remove`,e.path),children:`Remove`})]},e.path)),(0,j.jsxs)(`button`,{className:`btn ghost sm`,disabled:r,onClick:async()=>{i(!0);try{let e=await w.pickFolder();e.path?await s(`add`,e.path):e.error&&o([e.error])}catch(e){o([e.message])}finally{i(!1)}},children:[(0,j.jsx)(u,{name:`folder`}),` Exclude a folder…`]}),a.map((e,t)=>(0,j.jsx)(`p`,{className:`sub`,children:e},t))]})}var P=`This project sees your machine-wide rules, profile and memory map, so what you taught one tool or repo applies here too.`,F=`About 1 500 tokens at every session start, growing with your rules. The hook budget is fixed at 9 000 characters, and the tier loads before this project's docs, so a large tier can push them down to a lazy listing.`,I=[`200k`,`1m`],L={"200k":`For a 200k-token model: each skill description is cut to 80 characters and the listing budget is 1.3% of the window, so every skill keeps its description.`,"1m":`For a 1M-token model: each skill description is cut to 120 characters, at the default budget of 1% of the window.`};function R({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,j.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,j.jsxs)(`div`,{className:`mcp-target`,children:[(0,j.jsxs)(`div`,{className:`mt-head`,children:[(0,j.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,j.jsxs)(`div`,{className:`mcp-row`,children:[(0,j.jsx)(`span`,{className:`mono`,children:e.name}),(0,j.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,j.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,j.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,j.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var z=6;function B({leftovers:e}){let t=e?.kept||[],n=e?.stale||[],r=[...t,...n];return r.length?(0,j.jsxs)(`div`,{className:`ip-block ip-leftovers`,role:`group`,"aria-label":`Files a rebuild keeps`,children:[(0,j.jsxs)(`span`,{className:`ip-label`,children:[`Not Geneseed’s copy `,(0,j.jsx)(`span`,{className:`mono dim`,children:r.length})]}),t.length?(0,j.jsxs)(`p`,{className:`sub`,children:[t.length===1?`This file is yours`:`These files are yours`,` where Geneseed ships its own: you edited a shipped file, or had one under the same name. A rebuild keeps`,` `,t.length===1?`it`:`them`,`.`]}):null,n.length?(0,j.jsxs)(`p`,{className:`sub`,children:[n.length===1?`One retired skill was`:`${n.length} retired skills were`,` `,`left by an older version. A rebuild leaves `,n.length===1?`it`:`them`,` in place.`]}):null,(0,j.jsxs)(`ul`,{className:`ip-files`,children:[r.slice(0,z).map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{title:e,children:e})},e)),r.length>z?(0,j.jsxs)(`li`,{className:`dim`,children:[`and `,r.length-z,` more`]}):null]}),(0,j.jsxs)(`p`,{className:`sub`,children:[(0,j.jsx)(`strong`,{children:`Force rebuild…`}),` below replaces them with Geneseed’s copies. Skills and agents under your own names, memory, notebook, rules and profile are never touched. To keep a file of yours for good, exclude that skill instead.`]})]}):null}function V({stranded:e,canAct:t,busy:n,onPrune:r}){let i=e?.keys||[];return i.length?(0,j.jsxs)(`div`,{className:`ip-block ip-leftovers`,role:`group`,"aria-label":`Stranded permission gates`,children:[(0,j.jsxs)(`span`,{className:`ip-label`,children:[`Stranded gates `,(0,j.jsx)(`span`,{className:`mono dim`,children:i.length})]}),(0,j.jsxs)(`p`,{className:`sub`,children:[`These `,(0,j.jsx)(`code`,{children:`permission.bash`}),` entries in `,(0,j.jsx)(`code`,{children:`opencode.json`}),` still ask, but the rule behind them is off in this install. Geneseed has no record that it wrote them, so a rebuild leaves them.`]}),(0,j.jsxs)(`ul`,{className:`ip-files`,children:[i.slice(0,z).map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(`code`,{title:e,children:e})},e)),i.length>z?(0,j.jsxs)(`li`,{className:`dim`,children:[`and `,i.length-z,` more`]}):null]}),e.commented?(0,j.jsx)(`p`,{className:`sub`,children:`This file has comments, so Geneseed does not rewrite it: delete these entries by hand.`}):t?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:n,onClick:r,children:`Remove stranded gates…`}):null,(0,j.jsx)(`p`,{className:`sub`,children:`An entry you changed yourself is kept.`})]}):null}var H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ee({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:m,onForce:h,onPrune:g,profileMatches:_,onSaveProfile:y}){let b=`${p(e.host).label} · ${e.scope}`,[x,S]=H[e.state]||H.absent,C=e.state===`active`,w=e.state===`absent`;return(0,j.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${b} install`,children:[(0,j.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,j.jsxs)(`div`,{className:`ip-head`,children:[(0,j.jsx)(`h2`,{children:v(e)}),(0,j.jsx)(`span`,{className:`tag ${S}`,children:x})]}),(0,j.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${p(e.host).label}`}),(0,j.jsx)(`code`,{className:`ip-path`,children:e.path}),C&&_?.length?(0,j.jsxs)(`div`,{className:`row gap-8 wrap`,"aria-label":`Profile`,children:[(0,j.jsx)(`span`,{className:`ip-label`,children:`Profile`}),_.map(e=>(0,j.jsxs)(`span`,{className:`tag acc`,children:[`matches `,e]},e))]}):null,w?(0,j.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,j.jsx)(`strong`,{children:p(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(C||w)&&o?(0,j.jsxs)(`div`,{className:`ip-picks`,children:[(0,j.jsx)(D,{value:n,options:i,onChange:a,who:b}),(0,j.jsxs)(`p`,{className:`sub`,children:[n.footprint===`lean`?`Lean footprint: terse rule lines and a pointer to the full file, about 40% smaller.`:`Full footprint: every rule’s complete text inline, the largest context.`,` `,`Every rule stays in force. `,(0,j.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]})]}):null,(C||w)&&o&&e.host===`claude`?(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`label`,{className:`dp-field`,children:[(0,j.jsx)(`span`,{children:`Context window`}),(0,j.jsx)(O,{label:`context window for ${b}`,value:n.contextWindow||`200k`,options:I,onChange:e=>a(`contextWindow`,e)})]}),(0,j.jsx)(`p`,{className:`sub`,children:L[n.contextWindow||`200k`]})]}):null,(C||w)&&o&&e.scope!==`global`?(0,j.jsxs)(`div`,{className:`ip-block`,children:[(0,j.jsxs)(`label`,{className:`ip-switch`,children:[(0,j.jsx)(E,{on:!!n.sharedTier,label:`shared tier for ${b}`,onToggle:()=>a(`sharedTier`,!n.sharedTier)}),(0,j.jsx)(`span`,{children:`Read the machine-wide shared tier`})]}),(0,j.jsxs)(`p`,{className:`sub`,children:[(0,j.jsx)(`strong`,{children:`Benefit:`}),` `,P]}),(0,j.jsxs)(`p`,{className:`sub`,children:[(0,j.jsx)(`strong`,{children:`Cost:`}),` `,F]})]}):null,C?(0,j.jsx)(B,{leftovers:e.leftovers}):null,C?(0,j.jsx)(V,{stranded:e.strandedGates,canAct:o,busy:s,onPrune:g}):null,C&&t.length?(0,j.jsx)(R,{targets:t,onReveal:m}):null,C&&e.scope===`global`?(0,j.jsx)(N,{}):null,w?null:(0,j.jsxs)(`label`,{className:`ip-switch`,children:[(0,j.jsx)(E,{on:C,disabled:s,label:`activate ${b}`,onToggle:d}),(0,j.jsx)(`span`,{children:C?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,j.jsx)(`div`,{className:`ip-spacer`}),o?(0,j.jsxs)(`div`,{className:`ip-actions`,children:[w?(0,j.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):C?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}),y?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:y,children:`Save as profile…`}):null,(0,j.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,disabled:s,onClick:h,children:`Force rebuild…`})]}):null,w?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`label`,{className:`field`,children:[(0,j.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,j.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,j.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,j.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,j.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${b} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var te={secretsGate:`secrets`,doneGate:`done`,deletionGate:`deletion`,ownershipGate:`ownership`,externalGate:`external`,testNote:`test note`,ownBranchPass:`own-branch pass`},U=e=>te[e]||e,W=e=>p(e).label,G=e=>`${W(e.host)} · ${e.scope===`global`?`global`:e.path}`,K=e=>e.startsWith(`gates.`)||/-gate$|consent|test-note/.test(e);function ne(e){if(!e)return null;try{let t=JSON.parse(e)?.save;return t&&typeof t.host==`string`&&typeof t.path==`string`?t:null}catch{return null}}var re=e=>`#/installs/profiles/${encodeURIComponent(JSON.stringify({save:{host:e.host,path:e.path}}))}`;function ie(e){let t=(e.gatesOff||[]).map(U);return t.length?t.length===1&&t[0]===`ownership`?{text:`All on, except ownership`,warn:!1}:{text:`Off: ${t.join(`, `)}`,warn:!0}:{text:`All on`,warn:!1}}function q({p:e,canAct:t,onApply:n}){let r=(0,j.jsxs)(`div`,{className:`panel-head prof-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h3`,{children:e.name}),e.description?(0,j.jsx)(`p`,{className:`sub`,children:e.description}):null]}),(0,j.jsx)(`span`,{className:`tag ${e.source===`personal`?`acc`:``}`,children:e.source===`personal`?`Personal`:`Shipped`})]});if(e.error)return(0,j.jsxs)(`article`,{className:`panel prof-card`,"aria-label":`profile ${e.name}`,children:[r,(0,j.jsx)(`p`,{className:`tag bad note`,children:e.error}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`File`}),(0,j.jsx)(`code`,{className:`v`,children:e.file})]})]});let i=e.profile,a=ie(e);return(0,j.jsxs)(`article`,{className:`panel prof-card`,"aria-label":`profile ${e.name}`,children:[r,(0,j.jsxs)(`div`,{className:`prof-kv`,children:[(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Hosts`}),(0,j.jsx)(`span`,{className:`v row gap-8 wrap`,children:i.hosts.map(e=>(0,j.jsx)(`span`,{className:`tag human`,children:W(e)},e))})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Settings`}),(0,j.jsx)(`span`,{className:`v`,children:[i.theme,i.footprint,i.posture,i.mode,i.trust].join(` · `)})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Gates`}),(0,j.jsx)(`span`,{className:`v`,children:a.warn?(0,j.jsxs)(`span`,{className:`tag warn note`,children:[`! `,a.text]}):a.text})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`Followed by`}),(0,j.jsx)(`span`,{className:`v`,children:e.matches?.length?e.matches.map(G).join(`, `):`No install`})]}),(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:`File`}),(0,j.jsx)(`code`,{className:`v`,children:e.file})]})]}),t?(0,j.jsx)(`div`,{className:`row gap-8`,children:(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>n(e.name),children:`Apply…`})}):null]})}function J(e,t){if(!e.present)return`not on this machine`;let n=t===`global`?`global install`:`project install`;return e.state===`active`?`${n} · active`:e.state===`disabled`?`${n} · disabled`:t===`global`?`no global install yet`:`no install in this folder`}var Y=e=>e.present&&!e.refused;function X(e){return e.present?e.refused?[{text:e.refused,tone:`warn`}]:e.state===`active`?e.changes.length?e.changes.map(e=>({text:`${e.name} ${e.from} → ${e.to}`,tone:K(e.name)?`warn`:``})):[{text:`Already matches — rebuild only`,tone:`dim`}]:[{text:`New install`,tone:`dim`}]:[{text:`Install ${W(e.host)}, then apply again`,tone:`dim`}]}function ae({name:e,onAction:t,onClose:n}){let[r,i]=(0,A.useState)(`global`),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)({}),[d,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(``),g=r===`project`?s:null,_=JSON.stringify([e,r,g]),{data:v,error:x,loading:C}=S(()=>r===`project`&&!s?Promise.resolve(null):w.profiles(e,g).then(e=>({...e,askedFor:_})),[e,r,s]),T=!C&&v?.askedFor===_?v.preview:null,E=T?.rows||[],D=E.filter(e=>Y(e)&&!l[e.host]),O=T&&!T.error&&T.name===e&&T.scope===r&&(r===`global`||T.project),k=e=>{c(e.trim()),u({})},M=async()=>{p(!0),h(``);try{let e=await w.pickFolder();e.path?(o(e.path),k(e.path)):e.error&&h(e.error)}catch(e){h(e.message)}finally{p(!1)}},N=async()=>{await t?.(`profile-apply`,{name:e,hosts:D.map(e=>e.host),...r===`project`?{project:T.project}:{}})&&n()},P=E.filter(e=>e.layering&&!l[e.host]&&Y(e));return(0,j.jsxs)(`section`,{className:`panel prof-dialog`,"aria-label":`Apply profile`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsxs)(`h2`,{children:[`Apply `,(0,j.jsx)(`span`,{className:`mono`,children:e})]}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Close`,onClick:n,children:`✕`})]}),(0,j.jsxs)(`fieldset`,{className:`prof-field`,children:[(0,j.jsx)(`legend`,{className:`ip-label`,children:`Where`}),(0,j.jsxs)(y,{"aria-label":`Where to apply`,children:[(0,j.jsx)(`button`,{type:`button`,className:r===`global`?`on`:``,"aria-pressed":r===`global`,onClick:()=>{i(`global`),u({})},children:`Global — every project on this machine`}),(0,j.jsx)(`button`,{type:`button`,className:r===`project`?`on`:``,"aria-pressed":r===`project`,onClick:()=>{i(`project`),u({})},children:`One project`})]}),r===`project`?(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,"aria-label":`Project folder`,value:a,onChange:e=>o(e.target.value),onBlur:()=>k(a),onKeyDown:e=>e.key===`Enter`&&k(a)}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,disabled:d,onClick:M,children:d?`Choosing…`:`Browse…`})]}):null]}),m?(0,j.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:m}):null,(0,j.jsx)(f,{error:x}),T?.error?(0,j.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.error}):null,C?(0,j.jsx)(b,{}):null,O?(0,j.jsxs)(`div`,{className:`prof-hosts`,role:`group`,"aria-label":`Hosts`,children:[(0,j.jsx)(`span`,{className:`ip-label`,children:`Hosts — the profile’s hosts are ticked; a host this machine lacks is shown, not offered`}),E.map(e=>(0,j.jsxs)(`div`,{className:`prof-host${e.present?``:` missing`}`,children:[(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:Y(e)&&!l[e.host],disabled:!Y(e),onChange:()=>u(t=>({...t,[e.host]:!t[e.host]}))}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:W(e.host)}),` `,(0,j.jsx)(`span`,{className:`dim`,children:J(e,r)})]})]}),(0,j.jsx)(`div`,{className:`prof-changes`,children:X(e).map(e=>(0,j.jsx)(`span`,{className:e.tone===`warn`?`warn-text`:e.tone,children:e.text},e.text))})]},e.host))]}):null,O&&r===`project`?(0,j.jsxs)(`p`,{className:`sub`,children:[`Project scope: the build writes into `,(0,j.jsx)(`code`,{children:T.project}),` for each ticked host. The profile’s `,(0,j.jsx)(`code`,{children:`sharedTier`}),` applies here only; a global apply ignores it.`]}):null,O&&P.length?P.map(e=>(0,j.jsxs)(`p`,{className:`tag warn note`,role:`note`,children:[`A global `,W(e.host),` install is active (`,e.layering.root,`): both root files load in this project. Global gates that still run there:`,` `,e.layering.gates.length?e.layering.gates.join(`, `):`none`,`.`,` `,(0,j.jsx)(`a`,{href:`#/docs/exclusions`,children:`Why →`})]},e.host)):null,(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`btn`,disabled:!O||!D.length,onClick:N,children:[`Apply to `,D.length,` `,D.length===1?`host`:`hosts`]}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:n,children:`Cancel`}),(0,j.jsx)(`span`,{className:`dim`,children:`Runs as a background job; its log reports each host.`})]})]})}function oe({data:e,initial:t,onAction:n,onClose:r}){let i=e.installs||[],a=e=>`${e.host}|${e.path}`,o=t?i.find(e=>a(e)===a(t)):i[0],[s,c]=(0,A.useState)(o?a(o):``),[l,u]=(0,A.useState)(``),[d,f]=(0,A.useState)(`personal`),[p,m]=(0,A.useState)(!1),h=i.find(e=>a(e)===s),g=(h?.diff||[]).filter(e=>e.key!==`hosts`);return(0,j.jsxs)(`section`,{className:`panel prof-dialog`,"aria-label":`Save as profile`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsx)(`h2`,{children:`Save an install as profile`}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Close`,onClick:r,children:`✕`})]}),i.length?(0,j.jsxs)(j.Fragment,{children:[t&&!o?(0,j.jsx)(`p`,{className:`tag warn note`,role:`status`,children:`The install you chose is no longer active here. Pick one below.`}):null,(0,j.jsxs)(`div`,{className:`dp-row`,children:[(0,j.jsxs)(`label`,{className:`field`,children:[(0,j.jsx)(`span`,{children:`From install`}),(0,j.jsxs)(`select`,{className:`sel`,value:s,onChange:e=>c(e.target.value),children:[s?null:(0,j.jsx)(`option`,{value:``,children:`Pick an install…`}),i.map(e=>(0,j.jsx)(`option`,{value:a(e),children:G(e)},a(e)))]})]}),(0,j.jsxs)(`label`,{className:`field`,children:[(0,j.jsx)(`span`,{children:`Name`}),(0,j.jsx)(`input`,{className:`inp`,type:`text`,value:l,placeholder:`my-profile`,onChange:e=>u(e.target.value)})]})]}),(0,j.jsxs)(`fieldset`,{className:`prof-field`,children:[(0,j.jsx)(`legend`,{className:`ip-label`,children:`Save to`}),(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`prof-dest`,checked:d===`personal`,onChange:()=>f(`personal`)}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Personal`}),` — `,(0,j.jsx)(`code`,{children:e.personalDir}),`, beside your memory and rules. Survives updates, never shipped.`]})]}),(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`radio`,name:`prof-dest`,checked:d===`shipped`,disabled:!e.shippedWritable,onChange:()=>f(`shipped`)}),(0,j.jsxs)(`span`,{children:[(0,j.jsx)(`strong`,{children:`Shipped`}),` — `,(0,j.jsx)(`code`,{children:`profiles/`}),` in this clone, for everyone. Commit and open a pull request to share it.`,e.shippedWritable?``:` Disabled: this copy is not a git clone.`]})]}),(0,j.jsxs)(`label`,{className:`row gap-8`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:p,onChange:()=>m(e=>!e)}),(0,j.jsx)(`span`,{children:`Replace a profile of this name in the same place`})]})]}),(0,j.jsxs)(`div`,{className:`prof-changes`,"aria-label":`Differs from ${e.base}`,children:[(0,j.jsxs)(`span`,{children:[`Differs from `,(0,j.jsx)(`strong`,{children:e.base}),g.length?``:`: nothing`]}),g.map(t=>(0,j.jsx)(`span`,{className:K(t.key)?`warn-text`:``,children:K(t.key)?`! gate ${U(t.key.slice(6))}: ${t.now} (${e.base}: ${t.base})`:`${t.key} ${t.now} (${e.base}: ${t.base})`},t.key))]}),(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn`,disabled:!h||!l.trim(),onClick:async()=>{await n?.(`profile-save`,{name:l.trim(),from:{host:h.host,path:h.path},...d===`shipped`?{shipped:!0}:{},...p?{force:!0}:{}})&&r()},children:`Save profile`}),(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:r,children:`Cancel`})]})]}):(0,j.jsx)(T,{children:`No active install to save. Install one on the Hosts tab first.`})]})}function Z({onAction:e,dataRev:t,item:n}){let r=ne(n),{data:i,error:a,loading:o,reload:s}=S(()=>w.profiles(),[t],`profiles`),[c,l]=(0,A.useState)(r?{kind:`save`,from:r}:null);if(a)return(0,j.jsx)(f,{error:a,onRetry:s});if(o&&!i)return(0,j.jsx)(b,{});let u=i?.profiles||[],d=!!e;return(0,j.jsxs)(`div`,{className:`profiles`,children:[(0,j.jsxs)(`div`,{className:`inst-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:`Profiles`}),(0,j.jsx)(`p`,{className:`dim`,children:`A profile is a named set of build settings and the hosts it targets. Apply it globally or to one project.`})]}),d?(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>l({kind:`save`,from:null}),children:`Save an install as profile…`}):null]}),u.length?(0,j.jsx)(`div`,{className:`prof-grid`,children:u.map(e=>(0,j.jsx)(q,{p:e,canAct:d,onApply:e=>l({kind:`apply`,name:e})},`${e.source}:${e.name}`))}):(0,j.jsx)(T,{children:`No profile yet. Save an install as one to start.`}),c?.kind===`apply`?(0,j.jsx)(ae,{name:c.name,onAction:e,onClose:()=>l(null)},c.name):null,c?.kind===`save`&&i?(0,j.jsx)(oe,{data:i,initial:c.from,onAction:e,onClose:()=>l(null)}):null]})}function se({dataRev:e}){let{data:t,error:n,reload:r}=S(()=>w.migratePreview(),[e]);return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`preview-h`,children:[(0,j.jsx)(`div`,{className:`panel-head`,children:(0,j.jsx)(`h2`,{id:`preview-h`,children:`Next rebuild`})}),n?(0,j.jsx)(f,{error:n,onRetry:r}):t?(0,j.jsxs)(j.Fragment,{children:[t.folds.length?(0,j.jsx)(`ul`,{className:`preview-list`,children:t.folds.map(e=>(0,j.jsxs)(`li`,{children:[(0,j.jsx)(`b`,{className:`mono`,children:e.host}),` `,e.summary||`nothing to fold`,e.failed.map(e=>(0,j.jsxs)(`div`,{className:`t-warn`,children:[`The fold would stop at `,e]},e))]},e.host))}):(0,j.jsx)(`p`,{className:`dim`,children:`No global install to fold.`}),t.orphans.length?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`h3`,{children:`Orphans`}),(0,j.jsx)(`p`,{className:`dim`,children:`No manifest owns these. An earlier build may have written them, or they may be yours. Nothing moves them: if one is not yours, move it by hand.`}),(0,j.jsx)(`ul`,{className:`preview-list mono`,children:t.orphans.map(e=>(0,j.jsx)(`li`,{children:e},e))})]}):null]}):(0,j.jsx)(b,{})]})}var ce=(e,t)=>`${e} ${t}`,le=[`claude`,`bob`,`openclaude`],ue={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},Q=/[\\/]\.claude[\\/]worktrees[\\/]/,$=e=>e.scope===`project`&&Q.test(e.path);function de(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?x(e.drift):0,a=e.diffable?C(e.drift):0;return r+(i?` · ${i} edited`:``)+(a?` · ${a} kept`:``)}function fe({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,j.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,j.jsx)(`span`,{className:`dim`,children:`—`});let a=t.drift?.stale??0,o=t.diffable?x(t.drift):0,s=t.diffable?C(t.drift):0;return(0,j.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&a+o+s>0?(0,j.jsx)(i,{label:`Sync with source of ${v(e)}`,parts:[{key:`stale`,label:`behind source`,n:a,tone:`warn`},{key:`edited`,label:`local edits`,n:o,tone:`bad`},...s?[{key:`kept`,label:`kept edits`,n:s,tone:`muted`}]:[]]}):null,(0,j.jsx)(`span`,{className:`dim`,children:de(t,n)}),t.diffable?null:(0,j.jsxs)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:[` `,`· not checkable`]}),o||s?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function pe({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o,onDefault:s,busyKey:c}){let l=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,j.jsx)(`div`,{className:`tbl-scroll`,children:(0,j.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,j.jsx)(`th`,{scope:`col`,children:`State`}),(0,j.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,j.jsx)(`th`,{scope:`col`,children:(0,j.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,j.jsx)(`tbody`,{children:e.map(e=>{let[i,u]=ue[e.state]||[`Not installed`,``],d=n===e.id,f=e.state===`absent`;return(0,j.jsxs)(`tr`,{className:`pickable${d?` on`:``}${f?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":d,title:e.path,onClick:()=>r(e.id),children:v(e)}),(0,j.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?p(e.host).label:e.path})]}),(0,j.jsxs)(`td`,{children:[(0,j.jsx)(`span`,{className:`tag ${u}`,children:i}),e.default?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`span`,{className:`tag`,title:`A page that names no install reads this one, and pickers start on it`,children:`Default`})]}):e.state===`active`&&s?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Make ${v(e)} the default install`,disabled:c===e.id,onClick:t=>{t.stopPropagation(),s(e)},children:`Make default`})]}):null,$(e)?(0,j.jsxs)(j.Fragment,{children:[` `,(0,j.jsx)(`span`,{className:`tag warn`,title:`Inside a .claude/worktrees folder: likely a finished worktree. Remove it from its panel.`,children:`Worktree leftover`})]}):null]}),(0,j.jsx)(`td`,{children:(0,j.jsx)(fe,{inst:e,fleet:l(e),version:a?.version,onEdits:o})}),(0,j.jsx)(`td`,{className:`pick-mark`,children:d?`Editing ›`:``})]},e.id)})})]})})}function me({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,j.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,j.jsxs)(`summary`,{children:[(0,j.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,j.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,j.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,j.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,j.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,j.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function he({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,j.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,j.jsxs)(`div`,{className:`panel-head`,children:[(0,j.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,j.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:n?`in sync`:e.version_verdict})]}),(0,j.jsxs)(`dl`,{className:`kv-grid`,children:[(0,j.jsx)(`dt`,{children:`Source`}),(0,j.jsx)(`dd`,{className:`mono`,children:e.root}),(0,j.jsx)(`dt`,{children:`Version`}),(0,j.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,j.jsx)(`dt`,{children:`Fingerprint`}),(0,j.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function ge({onAction:e,themes:t=[],currentTheme:n,overview:r,setup:i,dataRev:o,onMutated:s}){let l=d(),{data:h,error:g,reload:_}=S(()=>w.installs(),[o]),{data:y,error:x,reload:C}=S(()=>w.mcp(),[o]),{data:E,error:D}=S(()=>w.fleet(),[o]),{data:O}=S(()=>w.profiles(),[o],`profiles`),N=D?null:E??void 0,[P,F]=(0,A.useState)(null),[I,L]=(0,A.useState)(``),[R,z]=(0,A.useState)({}),[B,V]=(0,A.useState)(!1),[H,te]=(0,A.useState)(!1),[U,W]=(0,A.useState)({id:``,value:`keep`}),G=e=>U.id===e?.id?U.value:`keep`,[K,ne]=(0,A.useState)(()=>c(`hosts`)),ie=(0,A.useMemo)(()=>{let e={};for(let t of y?.targets||[]){let n=ce(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[y]);if(g||x)return(0,j.jsx)(f,{error:g||x,onRetry:()=>{_(),C()}});if(!h||!y)return(0,j.jsx)(b,{});let q={active:0,disabled:1,absent:2},J=[...h.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(q[e.state]??3)-(q[t.state]??3)),Y=J.find(e=>e.id===K)||J.find(e=>e.default)||J.find(e=>e.state===`active`)||J[0],X=e=>{let t=R[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`,sharedTier:t.sharedTier??!!e.sharedTier,contextWindow:t.contextWindow||e.contextWindow||`200k`}},ae=(e,t,n)=>z(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),oe=e=>{let t=X(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)&&(e.scope===`global`||t.sharedTier===!!e.sharedTier)&&t.contextWindow===(e.contextWindow||`200k`)},Z={theme:t.map(e=>e.name),footprint:k,posture:h.postures||[],mode:h.modes||[],trust:h.trusts||[]},ue=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o,sharedTier:s,contextWindow:c}=X(t),u=p(t.host).label,d=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,f=t.state===`absent`?`Install Geneseed for ${u} into ${t.path} with the “${n}” voice (${d})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${u} install (voice “${n}”, ${d})? It rebuilds in place, non-destructive.`;await l(f,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o,contextWindow:c,...t.scope===`global`?{}:{sharedTier:s}})},Q=(t,n)=>{let{theme:r,footprint:i,posture:a,mode:o,trust:s,sharedTier:c,contextWindow:l}=X(t);e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:r,footprint:i,posture:a,mode:o,trust:s,contextWindow:l,...t.scope===`global`?{}:{sharedTier:c},...n})},$=e=>e.slice(0,8).join(`, `)+(e.length>8?`, and ${e.length-8} more`:``),de=async e=>{let t=e.leftovers?.kept||[],n=e.leftovers?.stale||[],r=t.length||n.length?(t.length?`Replace with Geneseed’s copy: ${$(t)}. Your version of each is overwritten. `:``)+(n.length?`Remove: ${$(n)}. `:``)+`Nothing else is touched.`:`No file of yours is recorded here. A forced rebuild overwrites any file it finds at a path Geneseed ships, and removes retired leftovers. Skills and agents under your own names, memory, notebook, rules and profile are never touched.`;await l(r,{title:`Force rebuild this install?`,confirmLabel:`Force rebuild`,tone:`danger`})&&Q(e,{force:!0})},fe=async e=>{let t=e.strandedGates?.keys||[];await l(`Remove from opencode.json: ${$(t)}. Their rule is off in this install. An entry you changed yourself is kept; nothing else is touched.`,{title:`Remove stranded gates?`,confirmLabel:`Remove and rebuild`})&&Q(e,{pruneGates:!0})},ge=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){L(e.id),F(null);try{let t=await w.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;F({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}s?.()}catch(e){F({text:e.message,tone:`bad`})}finally{L(``)}}},_e=async e=>{L(e.id),F(null);try{await w.setDefaultInstall(e.host,e.path),s?.()}catch(e){F({text:e.message,tone:`bad`})}finally{L(``)}},ve=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&le.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ye=async e=>{let t=G(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,r=t===`delete`?`, and permanently deletes ${ve(e,`memory`)} and ${ve(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${p(e.host).label} · ${e.scope}? It deletes ${m(e.host,e.scope)}${n}${r}. This can’t be undone.`,{title:e.scope===`project`?`Remove this install?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){L(e.id),F(null);try{let n=await w.installRemove(e.host,e.path,t);if(!n.ok){F({text:n.error||`remove failed`,tone:`bad`});return}W({id:``,value:`keep`}),n.kept?.length&&F({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),s?.()}catch(e){F({text:e.message,tone:`bad`})}finally{L(``)}}},be=async e=>{F(null);try{let t=await w.mcpReveal(e.path);F({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){F({text:e.message,tone:`bad`})}},xe=async()=>{let t=J.filter(e=>e.state===`active`).map(e=>`${v(e)} · ${e.scope}`);await l(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},Se=J.find(e=>e.default)?.host||J.find(e=>e.state===`active`)?.host||J[0]?.host||`opencode`,Ce=J.filter(e=>e.scope===`global`),we=J.filter(e=>e.scope!==`global`),Te=e=>{ne(e)},Ee=e=>{a(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,j.jsxs)(`div`,{className:`hosts`,children:[(0,j.jsxs)(`div`,{className:`hosts-main`,children:[(0,j.jsxs)(`div`,{className:`toolbar`,children:[(0,j.jsxs)(`span`,{className:`dim`,children:[J.filter(e=>e.state!==`absent`).length,` installed.`]}),(0,j.jsxs)(`div`,{className:`row gap-8`,children:[(0,j.jsx)(`button`,{type:`button`,className:`btn ghost`,"aria-expanded":H,onClick:()=>te(e=>!e),children:`Preview next rebuild`}),e?(0,j.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:xe,children:[(0,j.jsx)(u,{name:`refresh`}),` Rebuild all`]}):null]})]}),H?(0,j.jsx)(se,{dataRev:o}):null,P?.tone===`bad`?(0,j.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:P.text}):P?(0,j.jsx)(`p`,{className:`tag ${P.tone===`ok`?`ok `:``}note`,role:`status`,children:P.text}):null,(0,j.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,j.jsx)(`div`,{className:`inst-head`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,j.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,j.jsx)(pe,{rows:Ce,currentId:Y?.id,onPick:Te,label:`Global installs`,fleet:N,onEdits:Ee,onDefault:e?_e:void 0,busyKey:I})]}),(0,j.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,j.jsxs)(`div`,{className:`inst-head`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,j.jsx)(`p`,{className:`dim`,children:`A repo with its own install. Inside it, only that install loads.`})]}),e?(0,j.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>V(e=>!e),children:[(0,j.jsx)(u,{name:`folder`}),` Deploy to a repo…`]}):null]}),B?(0,j.jsx)(`div`,{className:`inst-deploy`,children:(0,j.jsx)(M,{host:Se,theme:n||`neutral`,options:Z,onAction:e,onClose:()=>V(!1),onNote:e=>F(e?{text:e,tone:`bad`}:null)})}):null,we.length?(0,j.jsx)(pe,{rows:we,project:!0,currentId:Y?.id,onPick:Te,label:`Per-project installs`,fleet:N,onEdits:Ee,onDefault:e?_e:void 0,busyKey:I}):(0,j.jsx)(T,{children:`No repo has its own install yet. Deploy one to give a project its own rules and voice.`})]}),(0,j.jsx)(he,{setup:i,overview:r}),(0,j.jsx)(me,{themes:t,current:r?.theme})]}),Y?(0,j.jsx)(ee,{inst:Y,targets:ie[ce(Y.host,Y.path)]||[],choice:X(Y),unchanged:oe(Y),options:Z,onPick:(e,t)=>ae(Y,e,t),canAct:!!e,busy:I===Y.id,memory:G(Y),onMemory:e=>W({id:Y.id,value:e}),onApply:()=>ue(Y),onToggleInstall:()=>ge(Y),onRemove:()=>ye(Y),onRevealMcp:be,onForce:()=>de(Y),onPrune:()=>fe(Y),profileMatches:O?.installs?.find(e=>e.host===Y.host&&e.path===Y.path)?.matches,onSaveProfile:e?()=>{window.location.hash=re(Y)}:void 0},Y.id):null]})}function _e(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var ve=300;function ye(e){let t=l(e.dataRev),[n,r]=s(`edits`,t);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,j.jsx)(b,{}):(0,j.jsx)(be,{install:n,...e},n?.id||``)]})}function be({install:e,onMutated:t,onAction:n,dataRev:r,overview:i}){let a=d(),{data:o,error:s,reload:c}=S(()=>w.diff(h(e)),[r]),[l,p]=(0,A.useState)(!1),[m,g]=(0,A.useState)(``),[_,v]=(0,A.useState)(()=>new Set),[y,x]=(0,A.useState)(()=>new Set),[C,E]=(0,A.useState)(null);if(o&&o!==C){E(o),v(new Set);let e=o.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=ve?o.files.map(e=>e.rel):[]))}let D=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),O=()=>v(e=>e.size===N.length?new Set:new Set(N.map(e=>e.rel))),k=()=>n?.(`export`),M=async()=>{let n=[..._],r=n.filter(e=>o.files.find(t=>t.rel===e)?.status===`added`),i=r.length?`Restoring will DELETE ${r.length} deployed-only file(s):\n${r.join(`
|
|
2
|
-
`)}\n\n`:``;if(await a(`${i}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){p(!0);try{let r=await w.restore(n,h(e)),i=r.errors.length?` · ${r.errors.length} error(s): ${r.errors.join(`; `)}`:``;g(`Restored ${r.restored.length}, archived ${r.deleted.length}${i}`),await c(),t?.()}catch(e){g(e.message)}finally{p(!1)}}};if(s)return(0,j.jsx)(f,{error:s,onRetry:c});if(!o)return(0,j.jsx)(b,{});if(!o.deployed)return(0,j.jsx)(T,{title:`Nothing installed here`,children:`Nothing to compare.`});if(!o.diffable)return(0,j.jsx)(T,{title:`No local-edit check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`Local edits are only checked for global installs. Pick a global install above.`});let N=o.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),P=o.files.filter(e=>e.status===`linked`),F=o.files.filter(e=>e.status===`stale`),I=N.filter(e=>e.status===`edited`).length,L=N.filter(e=>e.status===`added`).length,R=N.filter(e=>e.status===`missing`).length,z=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`h`,children:`Local edits`}),o.target?(0,j.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,j.jsx)(`code`,{children:o.target}),o.theme?` (${o.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,I>0?(0,j.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):L+R>0?(0,j.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,j.jsxs)(`div`,{className:`row gap-10`,children:[(0,j.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:l||_.size===0,onClick:M,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,j.jsxs)(`button`,{className:`btn`,disabled:l,onClick:k,children:[(0,j.jsx)(u,{name:`download`}),`Export improvements`]})]})]}),m?(0,j.jsx)(`p`,{className:`sub mb-14`,children:m}):null,P.length?(0,j.jsxs)(`p`,{className:`sub dim mb-14`,title:P.map(e=>e.rel).join(`
|
|
3
|
-
`),children:[P.length,` linked — yours, left alone`]}):null,N.length===0&&F.length===0?(0,j.jsx)(T,{title:`In sync`,children:`This install matches its source.`}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`row between mb-14`,children:[(0,j.jsxs)(`div`,{className:`row gap-10`,children:[(0,j.jsxs)(`span`,{className:`badge warn`,children:[(0,j.jsx)(`span`,{className:`dot`}),I,` edited`]}),(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),L,` added`]}),R>0&&(0,j.jsxs)(`span`,{className:`badge bad`,children:[(0,j.jsx)(`span`,{className:`dot`}),R,` missing`]}),F.length>0&&(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),F.length,` behind`]})]}),(0,j.jsxs)(`div`,{className:`row gap-10`,children:[(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(o.files.map(e=>e.rel))),children:`Expand all`}),(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),N.length?(0,j.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,j.jsx)(`input`,{type:`checkbox`,checked:_.size===N.length,onChange:O}),`Select all`]}):null]})]}),(0,j.jsx)(`div`,{className:`stack gap-12`,children:N.map(e=>B(e,!0))}),F.length?(0,j.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,j.jsx)(`h3`,{children:`Behind source`}),(0,j.jsxs)(`div`,{className:`row between`,children:[(0,j.jsx)(`p`,{className:`sub`,children:`This install is built from older source. Rebuild to bring these files in sync.`}),(0,j.jsx)(`button`,{className:`btn ghost`,disabled:l,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),F.map(e=>B(e,!1))]}):null]})]});function B(e,t){let n=y.has(e.rel),r=e.status===`edited`&&e.diverged===!1,i=r&&e.rel.endsWith(`.md`),a=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:i?`warn`:r?``:`warn`,o=r?`source unchanged`:e.status===`stale`?`behind source`:e.status;return(0,j.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,j.jsxs)(`div`,{className:`diff-head`,children:[t?(0,j.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>D(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,j.jsx)(`span`,{className:`fname`,children:e.rel}),(0,j.jsxs)(`span`,{className:`badge ${a}`,children:[(0,j.jsx)(`span`,{className:`dot`}),o]}),(0,j.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,j.jsx)(`button`,{className:`iconbtn`,onClick:()=>z(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,j.jsx)(u,{name:`chevron`})})]}),n&&(0,j.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,j.jsx)(`div`,{className:`diff-line ${_e(e)}`,children:e},t))})]},e.rel)}}function xe({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,A.useState)(!n);return(0,j.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,j.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,j.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,j.jsx)(`h3`,{children:e.label}),(0,j.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,j.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,j.jsx)(u,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,j.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,j.jsxs)(`div`,{className:`problem`,children:[(0,j.jsx)(`span`,{className:`x`,children:`✕`}),(0,j.jsx)(`span`,{children:e})]},e))})]})}function Se({dataRev:e}){let t=l(e),[n,r]=s(`doctor`,t);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(_,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,j.jsx)(b,{}):(0,j.jsx)(Ce,{install:n,dataRev:e},n?.id||``)]})}function Ce({install:e,dataRev:t}){let n=(0,A.useRef)(!1),{data:r,error:i,reload:a,setData:o}=S(()=>{let t=n.current;return n.current=!1,w.doctor(t,h(e))},[t]),s=()=>{n.current=!0,o(null),a()};if(i)return(0,j.jsx)(f,{error:i,onRetry:a});let c=r?r.groups.filter(e=>e.problems.length):[],l=r?r.groups.filter(e=>!e.problems.length):[];return(0,j.jsxs)(`div`,{className:`page-fill`,children:[(0,j.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,j.jsx)(`p`,{className:`sub`,children:`Builds this install’s voice in a sandbox and validates the result: token resolution, link integrity, and parity.`})]}),(0,j.jsxs)(`button`,{className:`btn`,onClick:s,disabled:!r,children:[(0,j.jsx)(u,{name:`refresh`}),r?`Run doctor`:`Running…`]})]}),r?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,j.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,j.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,j.jsxs)(`span`,{className:`dim mono`,children:[`validated `,r.themes.length,` voice`,r.themes.length===1?``:`s`]}),r.checked_at?(0,j.jsxs)(`span`,{className:`dim mono`,title:r.checked_at,children:[`checked `,r.checked_at.slice(11)]}):null,r.themes.map(e=>(0,j.jsx)(`span`,{className:`badge cap`,children:e},e))]}),r.ok?(0,j.jsxs)(`span`,{className:`badge ok`,children:[(0,j.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,j.jsxs)(`span`,{className:`badge bad`,children:[(0,j.jsx)(`span`,{className:`dot`}),r.problems.length,` problem`,r.problems.length===1?``:`s`]})]})}),(0,j.jsxs)(`div`,{className:`stack gap-12`,children:[c.map((e,t)=>(0,j.jsx)(xe,{group:e,i:t},e.label)),l.length?(0,j.jsxs)(`details`,{className:`check-fold`,children:[(0,j.jsxs)(`summary`,{children:[l.length,` clean check`,l.length===1?``:`s`]}),(0,j.jsx)(`div`,{className:`stack gap-12`,children:l.map((e,t)=>(0,j.jsx)(xe,{group:e,i:c.length+t},e.label))})]}):null]})]}):(0,j.jsx)(b,{label:`Running every check (builds this install’s voice in a sandbox)…`})]})}function we({tab:e=`hosts`,item:t,overview:n,setup:i,themes:a,onAction:s,onMutated:c,dataRev:l}){return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(o,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,j.jsx)(r,{page:`installs`,current:e,label:`Installs`}),e===`hosts`&&(0,j.jsx)(ge,{onAction:s,themes:a,currentTheme:n?.theme,overview:n,setup:i,dataRev:l,onMutated:c}),e===`profiles`&&(0,j.jsx)(Z,{onAction:s,dataRev:l,item:t}),e===`edits`&&(0,j.jsx)(ye,{onMutated:c,onAction:s,dataRev:l,overview:n}),e===`doctor`&&(0,j.jsx)(Se,{dataRev:l})]})}export{we as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
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-CZ-x0iWG.js";import{B as i,Ot as a,S as o,U as s,Y as c,_t as l,at as u,dt as ee,et as d,it as f,mt as p,rt as te,t as m,tt as h,ut as g,wt as _,x as v}from"./index-B_pTwZra.js";import{n as y,t as b}from"./sections-CtFz7HFH.js";import{a as ne,c as re,i as ie,l as ae,n as oe,o as se,r as ce,t as le}from"./LibRows-CiPvsRYB.js";import{t as ue}from"./EmptyState-CY5Pm2xy.js";import{o as x}from"./motion-RlUl1osO.js";var S=e(t(),1),C=n();function de({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 w({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)(de,{load:e.load})}),(0,C.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function fe({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)(l,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,C.jsxs)(`span`,{className:`mf-role`,children:[(0,C.jsx)(l,{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)(l,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,C.jsx)(w,{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)(l,{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 pe({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)(fe,{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)(w,{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})]})}var E=e=>e>=1e3?`${(e/1e3).toFixed(+(e<1e4))}k`:String(e),me=e=>Math.round(e/4),D=[{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`}],he=[[`dictate`,`Dictates`],[`doctrine`,`Doctrines`],[`user`,`User rules`]],O={"not-wired":`not wired, re-emit this install`,"no-event":`not delivered on this host`};function ge(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 k=e=>e.kind===`user`?`#/personal/rules`:`#/item/law/${encodeURIComponent(e.id)}`,A=e=>`${e.layer??``}${e.id}`;function _e({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 ve({loadout:e,base:t,error:n,install:r}){let[a,o]=(0,S.useState)(!1),[s,c]=(0,S.useState)(e?.agent);if(e?.agent!==s&&(c(e?.agent),o(!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),u=l(e.blocks),ee=ge(e,t),d=D.map(t=>{let n=e.blocks.filter(t.has);return{...t,blocks:n,n:l(n)}}),[f,p,te]=d,m=Math.max(1,...f.blocks.map(e=>e.chars)),h=e.blocks.find(e=>e.id===`user-rules`),g=h?O[h.delivery]:void 0,_=e.rules||[],v=_.filter(e=>!(g&&e.kind===`user`)),y=_.filter(e=>e.citedBySpec),b=[];for(let e of _){let t=e.kind===`dictate`?`Dictates`:e.kind===`user`?`User rules`:e.id.split(`.`)[0],n=b.find(e=>e.name===t);n?n.n+=1:b.push({name:t,n:1,user:e.kind===`user`})}let ne=he.map(([e,t])=>[t,v.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(me(u))}),(0,C.jsxs)(`span`,{className:`dim`,children:[`tokens at start · `,E(u),` chars`]})]})]}),ee?(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:ee.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)(i,{label:`Loadout`,legend:!1,parts:d.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:d.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/u*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(f.n),` · ≈ `,E(me(f.n)),` tok`]})]}),(0,C.jsx)(`ul`,{className:`loadout-root`,children:f.blocks.map(e=>(0,C.jsx)(_e,{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/m*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(p.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:p.blocks.map(e=>(0,C.jsx)(_e,{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(te.n)})]}),(0,C.jsx)(`ul`,{className:`loadout-list`,children:te.blocks.map(e=>(0,C.jsx)(_e,{label:e.label,n:e.chars,children:e.id===`user-rules`?(0,C.jsx)(`span`,{className:`loadout-pill${g?` is-plus`:``}`,children:g||`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 · `,v.length]}),(0,C.jsx)(`span`,{className:`dim`,children:ne.map(([e,t])=>`${t} ${e}`).join(` · `)})]}),y.length?(0,C.jsxs)(`div`,{className:`loadout-cited`,children:[(0,C.jsx)(`span`,{className:`loadout-cited-h`,children:`Cited by its spec`}),y.map(e=>(0,C.jsxs)(`a`,{href:k(e),children:[(0,C.jsx)(`span`,{className:`mono`,children:e.id}),` · `,e.title]},A(e)))]}):null,(0,C.jsx)(`ul`,{className:`loadout-packs`,children:b.map(e=>e.user&&g?(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:g})]},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))}),_.length?(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":a,onClick:()=>o(e=>!e),children:a?`Show fewer`:`Show all ${_.length}${g?` listed`:``} rules`}):null,a?he.map(([e,t])=>{let n=_.filter(t=>t.kind===e),r=g&&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:[` · `,g]}):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:k(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]},A(e)))})]},e):null}):null]}),(0,C.jsxs)(`p`,{className:`dim loadout-foot`,children:[`Not counted: `,e.notCounted.join(`; `),`. Tokens are chars ÷ 4.`]})]})}function ye({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)(f,{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 be({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 xe=(0,S.lazy)(()=>m(()=>import(`./Markdown-CxkA7940.js`).then(e=>e.n),__vite__mapDeps([0,1,2]))),Se=(0,S.lazy)(()=>m(()=>import(`./AgentGlyph-k6o3gCM1.js`),__vite__mapDeps([3,1,2]))),Ce={skills:`skill`,agents:`agent`},we=`:primary`,Te=(e,t)=>`${t?e/t*100:0}%`,Ee=e=>e.split(`:`).slice(0,2).join(` `),De=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(`:`)}},Oe=e=>p(j(e));function ke(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 Ae({section:e,source:t}){return(0,C.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,C.jsx)(l,{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 je=e=>e.replace(/\s+/g,` `).trim(),Me=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ne(e,t){let n=e.replace(/\r\n/g,`
|
|
3
|
-
`),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=Me(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?je(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?je(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=Me(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function Pe({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)(be,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(Ee))].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)(be,{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:Te(e,a)}},t))})})})}function Fe(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 Ie={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},Le=(e,t)=>t||(e&&b.includes(e)?e:b[0]),Re=encodeURIComponent;function ze(e){let t=e=>v[e.klass]?e.klass:`personal`,n=o.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:o.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 Be(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 M({overview:e,section:t,selected:n,dataRev:i,lock:o,base:l,onRulesChanged:f,onCountsChanged:p}){let m=u(),[x,de]=(0,S.useState)(()=>Le(t,o)),[w,fe]=(0,S.useState)(``),[T,E]=(0,S.useState)(`all`),[me,D]=(0,S.useState)(`all`),[he,O]=(0,S.useState)(``),[ge,k]=(0,S.useState)(null),[A,_e]=(0,S.useState)(null),[be,Ee]=(0,S.useState)(t);if(t!==be){Ee(t),O(``);let e=Le(t,o);e!==x&&(de(e),fe(``),E(`all`),D(`all`))}let[je,Me]=(0,S.useState)(n);n!==je&&(Me(n),O(``));let{data:M,error:Ve,reload:He}=_(()=>r.catalog(x),[x,i],`catalog`),Ue=o?null:Ce[x]||null,We=Ue!==null,{data:N}=_(()=>We?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[We,i],`usage`,{revalidate:!0}),P=We&&!!N?.enabled&&Array.isArray(N.names),Ge=(0,S.useMemo)(()=>new Map((Array.isArray(N?.names)?N.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[N]),Ke=e=>P&&Ge.get(`${Ue}\u0000${e}`)||null,qe=e=>{let t=Ke(e.name);return!t||t.n===0&&!t.last},Je=N?.since?`No call since ${N.since}`:`No call recorded yet`,F=M?.section===x,I=F&&M?.items||[],Ye=!F&&!Ve,[Xe,...Ze]=F&&M.sharedInstalls||[],L=e=>e===Xe?`shared`:Oe(e),R=x===`skills`,Qe=R?ze(I):null,z=R?Qe.rows:x===`memory`?Be(I):I,B=n||z[0]?.name||null,V=x===`agents`&&!o,H=V&&B===`:primary`,{data:$e,error:et}=_(()=>V?Promise.resolve().then(()=>r.loadout()):Promise.resolve(null),[V,i],`loadout-primary`,{revalidate:!0}),tt=V?{name:we,type:`agent`,base:!0,title:!et&&$e?.noun||`Primary agent`,desc:`The main agent of the session. Every agent inherits its root file.`}:null,nt=H?tt:B?I.find(e=>e.name===B):null,rt=nt?.type||y[x].type,U=A?.sec===x&&A?.name===B?A.key:null,{data:it,error:at}=_(()=>!B||H?Promise.resolve(null):U?r.item(rt,B,j(U)):r.item(rt,B),[x,B,rt,U,i,H]),W=at?null:it,ot=W&&W.name===B&&(!U||W.install===U)?W:null,st=e=>q&&e?.install?` in ${L(e.install)}`:``,G=H?null:U||W?.install||null,ct=V&&B&&!H&&W&&W.name===B,{data:lt,error:ut}=_(()=>ct?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),[ct,B,G,i]),dt=H?{own:et?null:$e,base:null}:lt,ft=H?et:ut,pt=he||Ve||at,mt=B?{name:B,title:W?.title||B,desc:W?.desc||``}:null,K=nt||mt,ht=t=>t===x&&F?I.length:e?.counts?.[t]??``,gt=c(i),_t=G||gt?.[0]?.id,vt=_t?Oe(_t):void 0,q=new Set(I.flatMap(e=>e.installs||[])).size>1,yt=ee([...(gt||[]).map(e=>e.id),...I.flatMap(e=>e.installs||[])],Ze),J=R?z.filter(e=>T===`all`||e.cat===T):z,bt=P?J.filter(qe).length:0,xt=e=>e.status===`experimental`,St=J.filter(xt).length,Y=[[`all`,`All`,J.length],...P?[[`used`,`Used`,J.length-bt],[`unused`,`Not used yet`,bt,Je]]:[],...St?[[`experimental`,`Experimental`,St,`Shipped, not yet confirmed by real use`]]:[]],X=Y.some(([e])=>e===me)?me:`all`,Ct=X===`all`?J:X===`experimental`?J.filter(xt):J.filter(e=>qe(e)===(X===`unused`)),wt=P?Math.max(0,...I.map(e=>Ke(e.name)?.n||0)):0,Tt=R?1/0:50,Z=w.trim().toLowerCase(),Q=Z?ne(Ct,Z):Ct.slice(0,Tt),Et=!Z&&T===`all`&&X===`all`&&B&&!Q.some(e=>e.name===B)?[...Q,...z.filter(e=>e.name===B)]:Q,Dt=tt&&F&&T===`all`&&X===`all`?ne([tt],Z):[],Ot=Dt.length+Q.length,kt=[...Dt,...Et],At=e=>l?`${l}/${Re(e.name)}`:`#/item/${e.type||y[x].type}/${Re(e.name)}`,jt=async()=>{let e=ot;if(!e)return;let t=e.name;if(await m(`Forget the memory fact "${t}"${st(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`})){O(``);try{await r.memoryDelete(t,e.install?j(e.install):void 0)}catch(e){O(`Could not forget "${t}": ${e.message}`);return}a(l||`#/personal/memory`),He(),p?.()}},Mt=async()=>{let e=ot;if(!e)return;let t=e.name;if(await m(`Promote "${t}"${st(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`})){O(``);try{let n=e.install?j(e.install):void 0,i=await r.rules(n);await r.rulesPromote({name:t,fingerprint:i.fingerprint,delete_memory:!0},n),s(),f?.(),p?.(),a(`#/personal/rules`)}catch(e){O(`Could not promote: ${e.message}`),He()}}},Nt=W?.body?Ne(W.body,W.desc||K?.desc):null,Pt=W?.title||K?.title||K?.name,Ft=Pt===K?.name&&Nt?.title?Nt.title:Pt,It=F&&I.length===0,Lt=W?.status||K?.status,Rt=x===`skills`?v[nt?.klass]:null,zt=y[x].label,{lede:Bt,when:Vt}=Fe(W?.desc||K?.desc||``),$=K&&!H?W?.source||K.source||(at?null:ke(x,K.name)):null;return(0,C.jsxs)(`div`,{className:`lib-wrap`,children:[(0,C.jsx)(d,{error:pt,style:{margin:`0 0 var(--sp-3)`}}),(0,C.jsxs)(`div`,{className:`library lib-dossier${o?` locked`:``}${P?` uses`:``}`,children:[o?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`}),P&&N.since?(0,C.jsxs)(`span`,{className:`mono dim lib-title-since`,children:[`calls since `,N.since]}):null]}),(0,C.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:b.map(e=>(0,C.jsxs)(S.Fragment,{children:[(0,C.jsxs)(`a`,{href:`#/section/${e}`,className:x===e?`on`:``,"aria-current":x===e?`page`:void 0,children:[y[e].label,(0,C.jsx)(`span`,{className:`mono dim`,children:ht(e)})]}),e===x&&R&&F&&(0,C.jsx)(se,{label:`Skill types`,total:I.length,cats:Qe.cats,cat:T,onChange:E})]},e))})]}),(0,C.jsxs)(ie,{label:zt,count:F?Z?`${Q.length} of ${Ct.length}`:Ct.length:``,q:w,onQ:fe,matched:Ot,inView:[x,n],current:K?Ft:void 0,sections:o?void 0:b.map(e=>({key:e,label:y[e].label,n:ht(e),href:`#/section/${e}`,on:x===e})),cats:R&&F?Qe.cats:null,cat:T,total:I.length,onCat:E,catLabel:`Skill types`,extra:(0,C.jsxs)(C.Fragment,{children:[P&&N.since?(0,C.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,N.since]}):null,(0,C.jsxs)(`span`,{className:`lib-legend mono`,children:[q?yt.map((e,t)=>(0,C.jsxs)(`span`,{className:`lk-install`,title:j(e).path,children:[(0,C.jsx)(`i`,{className:`lr-dot`,style:g(t),"aria-hidden":`true`}),L(e)]},e)):null,(0,C.jsx)(ae,{items:I})]})]}),toolsCompact:F&&Y.length>1?(0,C.jsx)(ye,{label:`Show`,options:Y.map(([e,t])=>({key:e,label:e===`all`?`All uses`:t})),value:X,onChange:D}):void 0,tools:F&&Y.length>1?(0,C.jsx)(te,{"aria-label":`Show`,children:Y.map(([e,t,n,r])=>(0,C.jsxs)(`button`,{type:`button`,className:X===e?`on`:``,"aria-pressed":X===e,title:r,onClick:()=>D(e),children:[t,` `,(0,C.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[Ye?(0,C.jsx)(h,{}):null,(0,C.jsx)(oe,{rows:kt,activeName:K?.name,hrefOf:At,pills:P||q?e=>{let t=Ke(e.name)?.n||0,n=q?(0,C.jsx)(`span`,{className:`lr-dots`,children:yt.map((t,n)=>e.installs?.includes(t)?(0,C.jsx)(`span`,{className:`lr-dot lr-install`,style:g(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 P?(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:Te(t,wt)}})}),(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}),!Z&&I.length>Tt&&(0,C.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,Tt,` of `,I.length,`; type to search the rest.`]}),It&&(x===`wiki`?(0,C.jsxs)(ue,{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)(ue,{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:zt.replace(/s$/,``)}),H?(0,C.jsx)(le,{}):null,Rt?(0,C.jsx)(`span`,{className:`tag`,children:Rt.label}):null,W?.kit??K.kit?(0,C.jsx)(ce,{name:W?.kit??K.kit}):null,(0,C.jsx)(re,{status:Lt,withHint:!0}),$?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`mono dim reader-src`,children:De($)}),(0,C.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText($),k({src:$,ok:!0})}catch{k({src:$,ok:!1})}},children:ge?.src===$?ge.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,C.jsxs)(`div`,{className:`reader-head`,children:[(0,C.jsx)(`h2`,{className:`reader-title`,children:Ft}),x===`agents`&&!H?(0,C.jsx)(S.Suspense,{fallback:null,children:(0,C.jsx)(Se,{name:K.name})}):null]}),(0,C.jsxs)(`div`,{className:`reader-intro${P?` with-stats`:``}`,children:[(0,C.jsxs)(`div`,{className:`reader-intro-text`,children:[Bt?(0,C.jsx)(`p`,{className:`reader-lede`,children:Bt}):null,Vt?(0,C.jsxs)(`section`,{className:`reader-when`,children:[(0,C.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,C.jsx)(`p`,{children:Vt})]}):null]}),P?(0,C.jsx)(Pe,{u:Ke(K.name),usage:N,noCall:Je}):null]}),x===`memory`&&ot&&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:Mt,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:jt,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=>_e({sec:x,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`}),V?(0,C.jsx)(ve,{loadout:dt?.own,base:dt?.base,error:ft,install:vt}):null,H?null:at?(0,C.jsxs)(`p`,{className:`sub`,children:[`No `,zt.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)(pe,{manifest:W.manifest,body:W.body,name:K.name}):(0,C.jsx)(h,{}):W?.body?(0,C.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,C.jsx)(S.Suspense,{fallback:null,children:(0,C.jsx)(xe,{body:Nt.body,links:W.links||[]})})}):W===null&&B?(0,C.jsx)(h,{}):(0,C.jsx)(Ae,{section:x,source:ke(x,K.name)}),Ie[x]?(0,C.jsx)(`div`,{className:`reader-links`,children:(0,C.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${Ie[x]}`,children:[`About `,zt.toLowerCase(),` in Docs`]})}):null]}):Ye?(0,C.jsx)(h,{}):null})]})]})}export{we as PRIMARY,Ne as bodyHead,M as default,Be as groupMemory,Oe as installLabel,j as installOfKey,ze as splitSkills,Fe as splitWhen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=typeof window<`u`?window.__GENESEED_TOKEN__:``;async function t(e){let t=await e.json().catch(()=>({})),n=e.status===403&&t.error===`forbidden`?`the web server restarted since this page loaded — reload the page, then re-apply your edit`:t.error||t.message||e.statusText,r=Error(n);return r.status=e.status,r.body=t,r}var n=2e5;async function r(e){try{let r=await fetch(e,{signal:AbortSignal.timeout(n)});if(!r.ok)throw await t(r);return await r.json()}catch(e){throw e?.name===`TimeoutError`?Error(`the local server did not answer in time`,{cause:e}):e}}async function i(n,r={}){let i=await fetch(n,{method:`POST`,headers:{"X-Geneseed-Token":e||``,"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.ok)throw await t(i);return i.json()}var a=e=>{if(e==null)return!1;if(typeof e.host==`string`&&typeof e.path==`string`)return!0;throw Error(`an install needs both host and path`)},o=(e,t)=>{if(!a(t))return e;let n=new URLSearchParams({host:t.host,path:t.path});return`${e}${e.includes(`?`)?`&`:`?`}${n}`},s=(e,t)=>{let n=e??{};if(!a(t))return n;if(`host`in n||`path`in n)throw Error(`this body already has host or path`);return{...n,host:t.host,path:t.path}},c=e=>{try{return e()}catch(e){return Promise.reject(e)}},l=(e,t)=>c(()=>r(o(e,t))),u=(e,t,n)=>c(()=>i(e,s(t,n))),d=e=>l(`/api/overview`,e),f=()=>r(`/api/fleet`),p=()=>r(`/api/migrate/preview`),m=()=>r(`/api/kits`),h=(e,t)=>{if(!e)return r(`/api/profiles`);let n=new URLSearchParams({profile:e});return t!=null&&n.set(`project`,t),r(`/api/profiles?${n}`)},g=()=>r(`/api/usage`),_=()=>r(`/api/gates`),v=()=>r(`/api/update`),y=e=>l(`/api/recent`,e),b=()=>r(`/api/activity`),x=(e,t)=>l(`/api/activity/`+encodeURIComponent(e),t),S=(e,t)=>u(`/api/activity`,{enabled:e},t),C=e=>l(`/api/setup`,e),w=(e=!1,t)=>l(e?`/api/doctor?fresh=1`:`/api/doctor`,t),T=e=>l(`/api/themes`,e),E=(e,t)=>l(`/api/catalog/${e}`,t),D=(e,t,n)=>l(`/api/item/${e}/${encodeURIComponent(t)}`,n),O=(e,t)=>u(`/api/memory/delete`,{name:e},t),k=(e,t)=>l(e?`/api/loadout/${encodeURIComponent(e)}`:`/api/loadout`,t),A=e=>l(`/api/diff`,e),ee=(e,t)=>u(`/api/actions/restore`,{files:e},t),j=409,M=e=>r(`/api/jobs/${e}`),N=()=>r(`/api/jobs`),P=e=>i(`/api/jobs/${e}/cancel`),F=new Set([`build`,`restore`]);async function I(e,t,n){let r=t||{},a=`/api/actions/${e}`;try{return await(F.has(e)?u(a,r,n):i(a,r))}catch(e){throw e.status===j&&e.body?.error===`busy`?Error(`An action is already running.`,{cause:e}):e}}var L=e=>l(`/api/loops`,e),R=()=>r(`/api/loops/active`),z=(e,t)=>i(`/api/loops/preset`,{root:e,preset:t}),B=e=>l(`/api/factories/catalog`,e),V=()=>r(`/api/factories/active`),H=()=>r(`/api/mcp`),U=e=>i(`/api/reveal`,{path:e}),W=()=>r(`/api/installs`),G=(e,t,n)=>i(`/api/install`,{host:e,path:t,action:n}),K=(e,t,n)=>i(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),q=(e,t)=>i(`/api/default-install`,{host:e,path:t}),J=()=>i(`/api/pick-folder`,{}),Y=()=>r(`/api/ping`),X=()=>i(`/api/shutdown`),Z=()=>i(`/api/restart`),Q=e=>i(`/api/autostart`,{action:e}),$=e=>e?`?harness=${encodeURIComponent(e)}`:``,te={fleet:f,migratePreview:p,kits:m,usage:g,gates:_,update:v,loops:L,activeLoops:R,factories:B,activeFactories:V,setLoopPreset:z,overview:d,recent:y,activity:b,activityDetail:x,activityToggle:S,setup:C,doctor:w,themes:T,catalog:E,item:D,loadout:k,memoryDelete:O,diff:A,restore:ee,job:M,jobs:N,cancelJob:P,action:I,mcp:H,mcpReveal:U,installs:W,profiles:h,installToggle:G,installRemove:K,setDefaultInstall:q,pickFolder:J,ping:Y,shutdown:X,restart:Z,autostart:Q,docs:(e,t)=>l(`/api/docs${$(e)}`,t),docsPage:(e,t,n)=>l(`/api/docs/page/${encodeURIComponent(e)}${$(t)}`,n),rules:e=>l(`/api/rules`,e),rulesMutate:(e,t)=>u(`/api/rules`,e,t),rulesDecide:(e,t)=>u(`/api/rules/decide`,e,t),rulesPromote:(e,t)=>u(`/api/rules/promote`,e,t),profile:e=>l(`/api/profile`,e),profileSave:(e,t)=>u(`/api/profile`,e,t),excludes:()=>r(`/api/excludes`),excludeMutate:(e,t)=>i(`/api/excludes`,{action:e,path:t})};export{te as t};
|