geneseed 5.4.0 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +30 -0
- package/SHIPPED.md +1 -1
- package/adapters/bob/README.md +12 -1
- package/adapters/opencode/README.md +2 -1
- package/adapters/opencode/plugins/geneseed-context.js +71 -10
- package/adapters/opencode/plugins/geneseed-guard.js +101 -19
- package/adapters/opencode/plugins/geneseed-learn.js +641 -6
- package/bin/geneseed-cli.mjs +3 -0
- package/bin/geneseed-hook.mjs +2 -1
- package/docs/concepts/agents.md +13 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/foreman-mode.md +22 -3
- package/docs/concepts/hook-gates.md +1 -1
- package/docs/concepts/hooks.md +22 -5
- package/docs/concepts/host-matrix.md +2 -2
- package/docs/concepts/hosts.md +1 -1
- package/docs/concepts/shared-tier.md +1 -1
- package/docs/concepts/skills.md +21 -1
- package/docs/concepts/themes.md +1 -1
- package/docs/extending.md +10 -1
- package/docs/guides/install-clone.md +18 -0
- package/docs/guides/install-scripted.md +8 -2
- package/docs/guides/install.md +19 -1
- package/docs/guides/upgrade.md +1 -1
- package/docs/reference/env-context.md +1 -1
- package/docs/reference/environment.md +1 -1
- package/docs/reference/plugin-learn.md +4 -0
- package/docs/reference/profiles.md +142 -0
- package/docs/token-footprint.md +9 -4
- package/docs/understand/design-choices-engineering.md +1 -1
- package/docs/web-ui.md +3 -1
- package/harness.config.json +1 -1
- package/js/README.md +9 -2
- package/js/build/args.mjs +4 -3
- package/js/build/catalog.mjs +11 -1
- package/js/build/driver.mjs +42 -11
- package/js/build/emit-claude.mjs +24 -1
- package/js/build/emit-opencode.mjs +3 -0
- package/js/build/export.mjs +1 -1
- package/js/build/generate.mjs +2 -1
- package/js/build/notes-migrate.mjs +99 -0
- package/js/build/profile.mjs +14 -6
- package/js/build/render.mjs +34 -10
- package/js/build/source.mjs +85 -2
- package/js/cli-table.json +164 -4
- package/js/hosts/agent-runs.mjs +205 -0
- package/js/hosts/done-checks.mjs +3 -1
- package/js/hosts/hooks-done.mjs +91 -16
- package/js/hosts/hooks-learn.mjs +85 -0
- package/js/hosts/hooks-prims.mjs +39 -1
- package/js/hosts/hooks.mjs +6 -3
- package/js/hosts/hosts.mjs +10 -0
- package/js/hosts/installs.mjs +25 -1
- package/js/hosts/link.mjs +45 -10
- package/js/hosts/native.mjs +42 -5
- package/js/hosts/opencode.mjs +1 -1
- package/js/hosts/settings.mjs +72 -0
- package/js/hosts/spec-feedback.mjs +538 -0
- package/js/hosts/usage.mjs +67 -8
- package/js/inspect/agent-scores.mjs +118 -0
- package/js/inspect/checks-authoring.mjs +2 -1
- package/js/inspect/checks-build.mjs +20 -4
- package/js/inspect/checks-repo.mjs +27 -2
- package/js/inspect/cost.mjs +6 -5
- package/js/inspect/diff.mjs +25 -5
- package/js/inspect/doctor.mjs +4 -0
- package/js/inspect/status.mjs +3 -1
- package/js/inspect/validate.mjs +1 -0
- package/js/lib/machine-dir.mjs +8 -0
- package/js/lib/paths.mjs +4 -1
- package/js/maintain/profile-scope.mjs +145 -0
- package/js/maintain/profiles.mjs +486 -0
- package/js/maintain/setup.mjs +409 -15
- package/js/maintain/uninstall.mjs +4 -1
- package/js/maintain/update.mjs +1 -1
- package/js/web/actions.mjs +28 -38
- package/js/web/api.mjs +7 -2
- package/js/web/handler.mjs +8 -0
- package/js/web/jobs.mjs +5 -4
- package/js/web/profiles-api.mjs +201 -0
- package/js/web/routes.mjs +5 -0
- package/package.json +2 -1
- package/profiles/guillaume-claude-global.json +16 -0
- package/profiles/starter.json +14 -0
- package/src/AGENT.md.tmpl +1 -1
- package/src/agents/_self-improvement.md +15 -7
- package/src/agents/_template.md +4 -2
- package/src/agents/advocate.md +1 -1
- package/src/agents/architect.md +1 -1
- package/src/agents/developer.md +10 -3
- package/src/agents/devops-engineer.md +1 -1
- package/src/agents/docker-expert.md +1 -1
- package/src/agents/docs.md +1 -1
- package/src/agents/empiricist.md +1 -1
- package/src/agents/explorer.md +4 -2
- package/src/agents/framer.md +1 -1
- package/src/agents/historian.md +1 -1
- package/src/agents/kubernetes-specialist.md +1 -1
- package/src/agents/memory-curator.md +1 -1
- package/src/agents/operator.md +1 -1
- package/src/agents/performance.md +1 -1
- package/src/agents/pragmatist.md +1 -1
- package/src/agents/react-engineer.md +1 -1
- package/src/agents/react-reviewer.md +1 -1
- package/src/agents/researcher.md +1 -1
- package/src/agents/reviewer.md +10 -3
- package/src/agents/security.md +1 -1
- package/src/agents/skeptic.md +1 -1
- package/src/agents/spring-boot-engineer.md +1 -1
- package/src/agents/spring-reviewer.md +1 -1
- package/src/agents/spring-security.md +1 -1
- package/src/agents/steward.md +1 -1
- package/src/agents/tester.md +4 -2
- package/src/agents/user-advocate.md +1 -1
- package/src/agents/visionary.md +1 -1
- package/src/memory/README.md +12 -2
- package/src/modes/foreman.md +23 -10
- package/src/skill-descriptions.json +63 -0
- package/src/skills/_self-improvement.md +42 -26
- package/src/skills/_template.md +3 -1
- package/src/skills/brainstorm.md +35 -22
- package/src/skills/daydream/VENDOR.md +6 -0
- package/src/skills/diagram-design/VENDOR.md +4 -0
- package/src/skills/explain-changes/VENDOR.md +5 -1
- package/src/skills/parallel-agents.md +11 -0
- package/src/skills/pipeline.md +3 -3
- package/src/skills/plan.md +5 -4
- package/src/skills/react-view-transitions/VENDOR.md +7 -1
- package/src/skills/release.md +7 -2
- package/src/skills/rule/approve.md +2 -1
- package/src/skills/skill-forge.md +5 -3
- package/src/skills/token-report/VENDOR.md +5 -1
- package/src/upstreams.json +2 -2
- package/themes/README.md +3 -1
- package/web/dist/assets/{ActiveLoops-BJJN3P-V.js → ActiveLoops-DOJCPPPc.js} +1 -1
- package/web/dist/assets/{Activity-D2kOc3yi.js → Activity-LKsDzsnK.js} +1 -1
- package/web/dist/assets/{ActivityDetail-By3xOr21.js → ActivityDetail-DhwTfPm6.js} +1 -1
- package/web/dist/assets/{Bonsai-CBWDTBA4.js → Bonsai-CePMLrpr.js} +1 -1
- package/web/dist/assets/{CopyButton-BVbpriMB.js → CopyButton-CuoaJ6k7.js} +1 -1
- package/web/dist/assets/{Dashboard-CIJLPHM9.js → Dashboard-D1VKuvLe.js} +2 -2
- package/web/dist/assets/{Docs-CiRRIELs.js → Docs-CUrHJKaU.js} +1 -1
- package/web/dist/assets/{Factories-DhyK0O8d.js → Factories-Ci1XfmSy.js} +1 -1
- package/web/dist/assets/{GreenhouseView-DW3PgTPy.js → GreenhouseView-CNfH2lPK.js} +1 -1
- package/web/dist/assets/Installs-ZHQZM1iS.js +3 -0
- package/web/dist/assets/{JournalView-O65qEWfp.js → JournalView-CMsWahkS.js} +1 -1
- package/web/dist/assets/{Kits-C5U-yT6Z.js → Kits-CkliyK0n.js} +1 -1
- package/web/dist/assets/{Laws-CuTw_XNf.js → Laws-hh4O3HZ4.js} +1 -1
- package/web/dist/assets/{LibRows-D6-CVa3K.js → LibRows-Brv0Hmkr.js} +1 -1
- package/web/dist/assets/{Library-CzPlerd6.js → Library-BYmiLjJr.js} +1 -1
- package/web/dist/assets/{Loops-CqNF_-nS.js → Loops-ytm-xJ68.js} +1 -1
- package/web/dist/assets/{OperatorHudView-BNr8K5qj.js → OperatorHudView-KaqCx_HP.js} +1 -1
- package/web/dist/assets/{Personal-DeDb9e8O.js → Personal-CmcnRKYE.js} +1 -1
- package/web/dist/assets/{Settings-B8MPN_AD.js → Settings-tUrpdOfq.js} +1 -1
- package/web/dist/assets/{Tabs-DJzAez4h.js → Tabs-CD7etcGD.js} +1 -1
- package/web/dist/assets/api-CZ-x0iWG.js +1 -0
- package/web/dist/assets/{controls-D4wmg_pl.js → controls-CK7qHA8H.js} +1 -1
- package/web/dist/assets/{index-CRWqKxfY.css → index-Ba_Kg3Af.css} +1 -1
- package/web/dist/assets/{index-BL3P-9Rg.js → index-COKbhFNo.js} +3 -3
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Installs-B6nlo-Ly.js +0 -3
- package/web/dist/assets/api-DLDVY3K-.js +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-DJzAez4h.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,tt as y,vt as b,wt as x,yt as S}from"./index-BL3P-9Rg.js";import{t as C}from"./api-DLDVY3K-.js";import{t as w}from"./EmptyState-CY5Pm2xy.js";import{n as T,r as E,t as D}from"./controls-D4wmg_pl.js";var O=e(t(),1),k=n();function ee({host:e,theme:t,options:n,onAction:r,onClose:i,onNote:a}){let[o,s]=(0,O.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[c,l]=(0,O.useState)(!1),[u,d]=(0,O.useState)(``),f=(e,t)=>s(n=>({...n,[e]:t})),m=async()=>{l(!0),a(``);try{let e=await C.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,k.jsxs)(`div`,{className:`deploy-pop`,children:[(0,k.jsxs)(`div`,{className:`dp-row`,children:[(0,k.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,k.jsx)(`button`,{className:`btn ghost sm`,disabled:c,onClick:m,children:c?`Choosing…`:`Browse…`})]}),u?(0,k.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:u}):null,(0,k.jsxs)(`div`,{className:`dp-row`,children:[(0,k.jsxs)(`label`,{className:`dp-field`,children:[(0,k.jsx)(`span`,{children:`Deploy as`}),(0,k.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,k.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,k.jsx)(T,{value:o,options:n,onChange:f,who:`the new install`}),(0,k.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,k.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Cancel`})]}),(0,k.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,k.jsx)(`code`,{children:p(o.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function A(){let{data:e,error:t,reload:n}=x(()=>C.excludes(),[]),[r,i]=(0,O.useState)(!1),[a,o]=(0,O.useState)([]),s=async(e,t)=>{i(!0);try{let n=await C.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,k.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Excluded folders`})}),(0,k.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,k.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,k.jsx)(`code`,{children:e.path}),(0,k.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>p(e).label).join(`, `)}),(0,k.jsx)(`button`,{className:`btn ghost sm`,disabled:r,"aria-label":`Stop excluding ${e.path}`,onClick:()=>s(`remove`,e.path),children:`Remove`})]},e.path)),(0,k.jsxs)(`button`,{className:`btn ghost sm`,disabled:r,onClick:async()=>{i(!0);try{let e=await C.pickFolder();e.path?await s(`add`,e.path):e.error&&o([e.error])}catch(e){o([e.message])}finally{i(!1)}},children:[(0,k.jsx)(u,{name:`folder`}),` Exclude a folder…`]}),a.map((e,t)=>(0,k.jsx)(`p`,{className:`sub`,children:e},t))]})}var j=`This project sees your machine-wide rules, profile and memory map, so what you taught one tool or repo applies here too.`,M=`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.`;function N({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,k.jsxs)(`div`,{className:`ip-block`,children:[(0,k.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,k.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,k.jsxs)(`div`,{className:`mcp-target`,children:[(0,k.jsxs)(`div`,{className:`mt-head`,children:[(0,k.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,k.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,k.jsxs)(`div`,{className:`mcp-row`,children:[(0,k.jsx)(`span`,{className:`mono`,children:e.name}),(0,k.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,k.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,k.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,k.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var P=6;function F({leftovers:e}){let t=e?.kept||[],n=e?.stale||[],r=[...t,...n];return r.length?(0,k.jsxs)(`div`,{className:`ip-block ip-leftovers`,role:`group`,"aria-label":`Files a rebuild keeps`,children:[(0,k.jsxs)(`span`,{className:`ip-label`,children:[`Not Geneseed’s copy `,(0,k.jsx)(`span`,{className:`mono dim`,children:r.length})]}),t.length?(0,k.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,k.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,k.jsxs)(`ul`,{className:`ip-files`,children:[r.slice(0,P).map(e=>(0,k.jsx)(`li`,{children:(0,k.jsx)(`code`,{title:e,children:e})},e)),r.length>P?(0,k.jsxs)(`li`,{className:`dim`,children:[`and `,r.length-P,` more`]}):null]}),(0,k.jsxs)(`p`,{className:`sub`,children:[(0,k.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 I({stranded:e,canAct:t,busy:n,onPrune:r}){let i=e?.keys||[];return i.length?(0,k.jsxs)(`div`,{className:`ip-block ip-leftovers`,role:`group`,"aria-label":`Stranded permission gates`,children:[(0,k.jsxs)(`span`,{className:`ip-label`,children:[`Stranded gates `,(0,k.jsx)(`span`,{className:`mono dim`,children:i.length})]}),(0,k.jsxs)(`p`,{className:`sub`,children:[`These `,(0,k.jsx)(`code`,{children:`permission.bash`}),` entries in `,(0,k.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,k.jsxs)(`ul`,{className:`ip-files`,children:[i.slice(0,P).map(e=>(0,k.jsx)(`li`,{children:(0,k.jsx)(`code`,{title:e,children:e})},e)),i.length>P?(0,k.jsxs)(`li`,{className:`dim`,children:[`and `,i.length-P,` more`]}):null]}),e.commented?(0,k.jsx)(`p`,{className:`sub`,children:`This file has comments, so Geneseed does not rewrite it: delete these entries by hand.`}):t?(0,k.jsx)(`button`,{type:`button`,className:`btn ghost`,disabled:n,onClick:r,children:`Remove stranded gates…`}):null,(0,k.jsx)(`p`,{className:`sub`,children:`An entry you changed yourself is kept.`})]}):null}var L={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({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}){let _=`${p(e.host).label} · ${e.scope}`,[y,b]=L[e.state]||L.absent,x=e.state===`active`,S=e.state===`absent`;return(0,k.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${_} install`,children:[(0,k.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,k.jsxs)(`div`,{className:`ip-head`,children:[(0,k.jsx)(`h2`,{children:v(e)}),(0,k.jsx)(`span`,{className:`tag ${b}`,children:y})]}),(0,k.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${p(e.host).label}`}),(0,k.jsx)(`code`,{className:`ip-path`,children:e.path}),S?(0,k.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,k.jsx)(`strong`,{children:p(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(x||S)&&o?(0,k.jsxs)(`div`,{className:`ip-picks`,children:[(0,k.jsx)(T,{value:n,options:i,onChange:a,who:_}),(0,k.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,k.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]})]}):null,(x||S)&&o&&e.scope!==`global`?(0,k.jsxs)(`div`,{className:`ip-block`,children:[(0,k.jsxs)(`label`,{className:`ip-switch`,children:[(0,k.jsx)(E,{on:!!n.sharedTier,label:`shared tier for ${_}`,onToggle:()=>a(`sharedTier`,!n.sharedTier)}),(0,k.jsx)(`span`,{children:`Read the machine-wide shared tier`})]}),(0,k.jsxs)(`p`,{className:`sub`,children:[(0,k.jsx)(`strong`,{children:`Benefit:`}),` `,j]}),(0,k.jsxs)(`p`,{className:`sub`,children:[(0,k.jsx)(`strong`,{children:`Cost:`}),` `,M]})]}):null,x?(0,k.jsx)(F,{leftovers:e.leftovers}):null,x?(0,k.jsx)(I,{stranded:e.strandedGates,canAct:o,busy:s,onPrune:g}):null,x&&t.length?(0,k.jsx)(N,{targets:t,onReveal:m}):null,x&&e.scope===`global`?(0,k.jsx)(A,{}):null,S?null:(0,k.jsxs)(`label`,{className:`ip-switch`,children:[(0,k.jsx)(E,{on:x,disabled:s,label:`activate ${_}`,onToggle:d}),(0,k.jsx)(`span`,{children:x?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,k.jsx)(`div`,{className:`ip-spacer`}),o?(0,k.jsxs)(`div`,{className:`ip-actions`,children:[S?(0,k.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):x?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}),(0,k.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,disabled:s,onClick:h,children:`Force rebuild…`})]}):null,S?null:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`label`,{className:`field`,children:[(0,k.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,k.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,k.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,k.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,k.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,k.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${_} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}function R({dataRev:e}){let{data:t,error:n,reload:r}=x(()=>C.migratePreview(),[e]);return(0,k.jsxs)(`section`,{className:`panel`,"aria-labelledby":`preview-h`,children:[(0,k.jsx)(`div`,{className:`panel-head`,children:(0,k.jsx)(`h2`,{id:`preview-h`,children:`Next rebuild`})}),n?(0,k.jsx)(f,{error:n,onRetry:r}):t?(0,k.jsxs)(k.Fragment,{children:[t.folds.length?(0,k.jsx)(`ul`,{className:`preview-list`,children:t.folds.map(e=>(0,k.jsxs)(`li`,{children:[(0,k.jsx)(`b`,{className:`mono`,children:e.host}),` `,e.summary||`nothing to fold`,e.failed.map(e=>(0,k.jsxs)(`div`,{className:`t-warn`,children:[`The fold would stop at `,e]},e))]},e.host))}):(0,k.jsx)(`p`,{className:`dim`,children:`No global install to fold.`}),t.orphans.length?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`h3`,{children:`Orphans`}),(0,k.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,k.jsx)(`ul`,{className:`preview-list mono`,children:t.orphans.map(e=>(0,k.jsx)(`li`,{children:e},e))})]}):null]}):(0,k.jsx)(y,{})]})}var ne=(e,t)=>`${e} ${t}`,re=[`claude`,`bob`,`openclaude`],z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},B=/[\\/]\.claude[\\/]worktrees[\\/]/,V=e=>e.scope===`project`&&B.test(e.path);function H(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?b(e.drift):0,a=e.diffable?S(e.drift):0;return r+(i?` · ${i} edited`:``)+(a?` · ${a} kept`:``)}function U({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,k.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,k.jsx)(`span`,{className:`dim`,children:`—`});let a=t.drift?.stale??0,o=t.diffable?b(t.drift):0,s=t.diffable?S(t.drift):0;return(0,k.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&a+o+s>0?(0,k.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,k.jsx)(`span`,{className:`dim`,children:H(t,n)}),t.diffable?null:(0,k.jsxs)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:[` `,`· not checkable`]}),o||s?(0,k.jsxs)(k.Fragment,{children:[` `,(0,k.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o,onDefault:s,busyKey:c}){let l=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,k.jsx)(`div`,{className:`tbl-scroll`,children:(0,k.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,k.jsx)(`th`,{scope:`col`,children:`State`}),(0,k.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,k.jsx)(`th`,{scope:`col`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,k.jsx)(`tbody`,{children:e.map(e=>{let[i,u]=z[e.state]||[`Not installed`,``],d=n===e.id,f=e.state===`absent`;return(0,k.jsxs)(`tr`,{className:`pickable${d?` on`:``}${f?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,k.jsxs)(`td`,{children:[(0,k.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":d,title:e.path,onClick:()=>r(e.id),children:v(e)}),(0,k.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?p(e.host).label:e.path})]}),(0,k.jsxs)(`td`,{children:[(0,k.jsx)(`span`,{className:`tag ${u}`,children:i}),e.default?(0,k.jsxs)(k.Fragment,{children:[` `,(0,k.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,k.jsxs)(k.Fragment,{children:[` `,(0,k.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,V(e)?(0,k.jsxs)(k.Fragment,{children:[` `,(0,k.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,k.jsx)(`td`,{children:(0,k.jsx)(U,{inst:e,fleet:l(e),version:a?.version,onEdits:o})}),(0,k.jsx)(`td`,{className:`pick-mark`,children:d?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,k.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,k.jsxs)(`summary`,{children:[(0,k.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,k.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,k.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,k.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,k.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,k.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,k.jsxs)(`div`,{className:`panel-head`,children:[(0,k.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,k.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:n?`in sync`:e.version_verdict})]}),(0,k.jsxs)(`dl`,{className:`kv-grid`,children:[(0,k.jsx)(`dt`,{children:`Source`}),(0,k.jsx)(`dd`,{className:`mono`,children:e.root}),(0,k.jsx)(`dt`,{children:`Version`}),(0,k.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,k.jsx)(`dt`,{children:`Fingerprint`}),(0,k.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function W({onAction:e,themes:t=[],currentTheme:n,overview:r,setup:i,dataRev:o,onMutated:s}){let l=d(),{data:h,error:g,reload:_}=x(()=>C.installs(),[o]),{data:b,error:S,reload:T}=x(()=>C.mcp(),[o]),{data:E,error:A}=x(()=>C.fleet(),[o]),j=A?null:E??void 0,[M,N]=(0,O.useState)(null),[P,F]=(0,O.useState)(``),[I,L]=(0,O.useState)({}),[z,B]=(0,O.useState)(!1),[V,H]=(0,O.useState)(!1),[U,W]=(0,O.useState)({id:``,value:`keep`}),G=e=>U.id===e?.id?U.value:`keep`,[K,q]=(0,O.useState)(()=>c(`hosts`)),J=(0,O.useMemo)(()=>{let e={};for(let t of b?.targets||[]){let n=ne(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[b]);if(g||S)return(0,k.jsx)(f,{error:g||S,onRetry:()=>{_(),T()}});if(!h||!b)return(0,k.jsx)(y,{});let Y={active:0,disabled:1,absent:2},X=[...h.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(Y[e.state]??3)-(Y[t.state]??3)),Z=X.find(e=>e.id===K)||X.find(e=>e.default)||X.find(e=>e.state===`active`)||X[0],Q=e=>{let t=I[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}},se=(e,t,n)=>L(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ce=e=>{let t=Q(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)},le={theme:t.map(e=>e.name),footprint:D,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}=Q(t),c=p(t.host).label,u=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,d=t.state===`absent`?`Install Geneseed for ${c} into ${t.path} with the “${n}” voice (${u})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${c} install (voice “${n}”, ${u})? It rebuilds in place, non-destructive.`;await l(d,{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,...t.scope===`global`?{}:{sharedTier:s}})},de=(t,n)=>{let{theme:r,footprint:i,posture:a,mode:o,trust:s,sharedTier:c}=Q(t);e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:r,footprint:i,posture:a,mode:o,trust:s,...t.scope===`global`?{}:{sharedTier:c},...n})},$=e=>e.slice(0,8).join(`, `)+(e.length>8?`, and ${e.length-8} more`:``),fe=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`})&&de(e,{force:!0})},pe=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`})&&de(e,{pruneGates:!0})},me=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`})){F(e.id),N(null);try{let t=await C.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;N({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}s?.()}catch(e){N({text:e.message,tone:`bad`})}finally{F(``)}}},he=async e=>{F(e.id),N(null);try{await C.setDefaultInstall(e.host,e.path),s?.()}catch(e){N({text:e.message,tone:`bad`})}finally{F(``)}},ge=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&re.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},_e=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 ${ge(e,`memory`)} and ${ge(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`})){F(e.id),N(null);try{let n=await C.installRemove(e.host,e.path,t);if(!n.ok){N({text:n.error||`remove failed`,tone:`bad`});return}W({id:``,value:`keep`}),n.kept?.length&&N({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){N({text:e.message,tone:`bad`})}finally{F(``)}}},ve=async e=>{N(null);try{let t=await C.mcpReveal(e.path);N({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){N({text:e.message,tone:`bad`})}},ye=async()=>{let t=X.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`)},be=X.find(e=>e.default)?.host||X.find(e=>e.state===`active`)?.host||X[0]?.host||`opencode`,xe=X.filter(e=>e.scope===`global`),Se=X.filter(e=>e.scope!==`global`),Ce=e=>{q(e)},we=e=>{a(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,k.jsxs)(`div`,{className:`hosts`,children:[(0,k.jsxs)(`div`,{className:`hosts-main`,children:[(0,k.jsxs)(`div`,{className:`toolbar`,children:[(0,k.jsxs)(`span`,{className:`dim`,children:[X.filter(e=>e.state!==`absent`).length,` installed.`]}),(0,k.jsxs)(`div`,{className:`row gap-8`,children:[(0,k.jsx)(`button`,{type:`button`,className:`btn ghost`,"aria-expanded":V,onClick:()=>H(e=>!e),children:`Preview next rebuild`}),e?(0,k.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:ye,children:[(0,k.jsx)(u,{name:`refresh`}),` Rebuild all`]}):null]})]}),V?(0,k.jsx)(R,{dataRev:o}):null,M?.tone===`bad`?(0,k.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:M.text}):M?(0,k.jsx)(`p`,{className:`tag ${M.tone===`ok`?`ok `:``}note`,role:`status`,children:M.text}):null,(0,k.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,k.jsx)(`div`,{className:`inst-head`,children:(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,k.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,k.jsx)(ie,{rows:xe,currentId:Z?.id,onPick:Ce,label:`Global installs`,fleet:j,onEdits:we,onDefault:e?he:void 0,busyKey:P})]}),(0,k.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,k.jsxs)(`div`,{className:`inst-head`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,k.jsx)(`p`,{className:`dim`,children:`A repo with its own install. Inside it, only that install loads.`})]}),e?(0,k.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>B(e=>!e),children:[(0,k.jsx)(u,{name:`folder`}),` Deploy to a repo…`]}):null]}),z?(0,k.jsx)(`div`,{className:`inst-deploy`,children:(0,k.jsx)(ee,{host:be,theme:n||`neutral`,options:le,onAction:e,onClose:()=>B(!1),onNote:e=>N(e?{text:e,tone:`bad`}:null)})}):null,Se.length?(0,k.jsx)(ie,{rows:Se,project:!0,currentId:Z?.id,onPick:Ce,label:`Per-project installs`,fleet:j,onEdits:we,onDefault:e?he:void 0,busyKey:P}):(0,k.jsx)(w,{children:`No repo has its own install yet. Deploy one to give a project its own rules and voice.`})]}),(0,k.jsx)(oe,{setup:i,overview:r}),(0,k.jsx)(ae,{themes:t,current:r?.theme})]}),Z?(0,k.jsx)(te,{inst:Z,targets:J[ne(Z.host,Z.path)]||[],choice:Q(Z),unchanged:ce(Z),options:le,onPick:(e,t)=>se(Z,e,t),canAct:!!e,busy:P===Z.id,memory:G(Z),onMemory:e=>W({id:Z.id,value:e}),onApply:()=>ue(Z),onToggleInstall:()=>me(Z),onRemove:()=>_e(Z),onRevealMcp:ve,onForce:()=>fe(Z),onPrune:()=>pe(Z)},Z.id):null]})}function G(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var K=300;function q(e){let t=l(e.dataRev),[n,r]=s(`edits`,t);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(_,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,k.jsx)(y,{}):(0,k.jsx)(J,{install:n,...e},n?.id||``)]})}function J({install:e,onMutated:t,onAction:n,dataRev:r,overview:i}){let a=d(),{data:o,error:s,reload:c}=x(()=>C.diff(h(e)),[r]),[l,p]=(0,O.useState)(!1),[m,g]=(0,O.useState)(``),[_,v]=(0,O.useState)(()=>new Set),[b,S]=(0,O.useState)(()=>new Set),[T,E]=(0,O.useState)(null);if(o&&o!==T){E(o),v(new Set);let e=o.files.reduce((e,t)=>e+t.diff.length,0);S(new Set(e<=K?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}),ee=()=>v(e=>e.size===M.length?new Set:new Set(M.map(e=>e.rel))),A=()=>n?.(`export`),j=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 C.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,k.jsx)(f,{error:s,onRetry:c});if(!o)return(0,k.jsx)(y,{});if(!o.deployed)return(0,k.jsx)(w,{title:`Nothing installed here`,children:`Nothing to compare.`});if(!o.diffable)return(0,k.jsx)(w,{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 M=o.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),N=o.files.filter(e=>e.status===`linked`),P=o.files.filter(e=>e.status===`stale`),F=M.filter(e=>e.status===`edited`).length,I=M.filter(e=>e.status===`added`).length,L=M.filter(e=>e.status===`missing`).length,te=e=>S(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{className:`h`,children:`Local edits`}),o.target?(0,k.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,k.jsx)(`code`,{children:o.target}),o.theme?` (${o.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,F>0?(0,k.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.`}):I+L>0?(0,k.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,k.jsxs)(`div`,{className:`row gap-10`,children:[(0,k.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:l||_.size===0,onClick:j,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,k.jsxs)(`button`,{className:`btn`,disabled:l,onClick:A,children:[(0,k.jsx)(u,{name:`download`}),`Export improvements`]})]})]}),m?(0,k.jsx)(`p`,{className:`sub mb-14`,children:m}):null,N.length?(0,k.jsxs)(`p`,{className:`sub dim mb-14`,title:N.map(e=>e.rel).join(`
|
|
3
|
-
`),children:[N.length,` linked — yours, left alone`]}):null,M.length===0&&P.length===0?(0,k.jsx)(w,{title:`In sync`,children:`This install matches its source.`}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`row between mb-14`,children:[(0,k.jsxs)(`div`,{className:`row gap-10`,children:[(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),F,` edited`]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),I,` added`]}),L>0&&(0,k.jsxs)(`span`,{className:`badge bad`,children:[(0,k.jsx)(`span`,{className:`dot`}),L,` missing`]}),P.length>0&&(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),P.length,` behind`]})]}),(0,k.jsxs)(`div`,{className:`row gap-10`,children:[(0,k.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>S(new Set(o.files.map(e=>e.rel))),children:`Expand all`}),(0,k.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>S(new Set),children:`Collapse all`}),M.length?(0,k.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:_.size===M.length,onChange:ee}),`Select all`]}):null]})]}),(0,k.jsx)(`div`,{className:`stack gap-12`,children:M.map(e=>R(e,!0))}),P.length?(0,k.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,k.jsx)(`h3`,{children:`Behind source`}),(0,k.jsxs)(`div`,{className:`row between`,children:[(0,k.jsx)(`p`,{className:`sub`,children:`This install is built from older source. Rebuild to bring these files in sync.`}),(0,k.jsx)(`button`,{className:`btn ghost`,disabled:l,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),P.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=b.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,k.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,k.jsxs)(`div`,{className:`diff-head`,children:[t?(0,k.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,k.jsx)(`span`,{className:`fname`,children:e.rel}),(0,k.jsxs)(`span`,{className:`badge ${a}`,children:[(0,k.jsx)(`span`,{className:`dot`}),o]}),(0,k.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,k.jsx)(`button`,{className:`iconbtn`,onClick:()=>te(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,k.jsx)(u,{name:`chevron`})})]}),n&&(0,k.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,k.jsx)(`div`,{className:`diff-line ${G(e)}`,children:e},t))})]},e.rel)}}function Y({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,O.useState)(!n);return(0,k.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,k.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,k.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,k.jsx)(`h3`,{children:e.label}),(0,k.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,k.jsx)(u,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,k.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,k.jsxs)(`div`,{className:`problem`,children:[(0,k.jsx)(`span`,{className:`x`,children:`✕`}),(0,k.jsx)(`span`,{children:e})]},e))})]})}function X({dataRev:e}){let t=l(e),[n,r]=s(`doctor`,t);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(_,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,k.jsx)(y,{}):(0,k.jsx)(Z,{install:n,dataRev:e},n?.id||``)]})}function Z({install:e,dataRev:t}){let n=(0,O.useRef)(!1),{data:r,error:i,reload:a,setData:o}=x(()=>{let t=n.current;return n.current=!1,C.doctor(t,h(e))},[t]),s=()=>{n.current=!0,o(null),a()};if(i)return(0,k.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,k.jsxs)(`div`,{className:`page-fill`,children:[(0,k.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,k.jsx)(`p`,{className:`sub`,children:`Builds this install’s voice in a sandbox and validates the result: token resolution, link integrity, and parity.`})]}),(0,k.jsxs)(`button`,{className:`btn`,onClick:s,disabled:!r,children:[(0,k.jsx)(u,{name:`refresh`}),r?`Run doctor`:`Running…`]})]}),r?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,k.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsxs)(`span`,{className:`dim mono`,children:[`validated `,r.themes.length,` voice`,r.themes.length===1?``:`s`]}),r.checked_at?(0,k.jsxs)(`span`,{className:`dim mono`,title:r.checked_at,children:[`checked `,r.checked_at.slice(11)]}):null,r.themes.map(e=>(0,k.jsx)(`span`,{className:`badge cap`,children:e},e))]}),r.ok?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,k.jsxs)(`span`,{className:`badge bad`,children:[(0,k.jsx)(`span`,{className:`dot`}),r.problems.length,` problem`,r.problems.length===1?``:`s`]})]})}),(0,k.jsxs)(`div`,{className:`stack gap-12`,children:[c.map((e,t)=>(0,k.jsx)(Y,{group:e,i:t},e.label)),l.length?(0,k.jsxs)(`details`,{className:`check-fold`,children:[(0,k.jsxs)(`summary`,{children:[l.length,` clean check`,l.length===1?``:`s`]}),(0,k.jsx)(`div`,{className:`stack gap-12`,children:l.map((e,t)=>(0,k.jsx)(Y,{group:e,i:c.length+t},e.label))})]}):null]})]}):(0,k.jsx)(y,{label:`Running every check (builds this install’s voice in a sandbox)…`})]})}function Q({tab:e=`hosts`,overview:t,setup:n,themes:i,onAction:a,onMutated:s,dataRev:c}){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(o,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,k.jsx)(r,{page:`installs`,current:e,label:`Installs`}),e===`hosts`&&(0,k.jsx)(W,{onAction:a,themes:i,currentTheme:t?.theme,overview:t,setup:n,dataRev:c,onMutated:s}),e===`edits`&&(0,k.jsx)(q,{onMutated:s,onAction:a,dataRev:c,overview:t}),e===`doctor`&&(0,k.jsx)(X,{dataRev:c})]})}export{Q as default};
|
|
@@ -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=()=>r(`/api/usage`),g=()=>r(`/api/gates`),_=()=>r(`/api/update`),v=e=>l(`/api/recent`,e),y=()=>r(`/api/activity`),b=(e,t)=>l(`/api/activity/`+encodeURIComponent(e),t),x=(e,t)=>u(`/api/activity`,{enabled:e},t),S=e=>l(`/api/setup`,e),C=(e=!1,t)=>l(e?`/api/doctor?fresh=1`:`/api/doctor`,t),w=e=>l(`/api/themes`,e),T=(e,t)=>l(`/api/catalog/${e}`,t),E=(e,t,n)=>l(`/api/item/${e}/${encodeURIComponent(t)}`,n),D=(e,t)=>u(`/api/memory/delete`,{name:e},t),O=(e,t)=>l(e?`/api/loadout/${encodeURIComponent(e)}`:`/api/loadout`,t),k=e=>l(`/api/diff`,e),A=(e,t)=>u(`/api/actions/restore`,{files:e},t),ee=409,j=e=>r(`/api/jobs/${e}`),M=()=>r(`/api/jobs`),N=e=>i(`/api/jobs/${e}/cancel`),P=new Set([`build`,`restore`]);async function F(e,t,n){let r=t||{},a=`/api/actions/${e}`;try{return await(P.has(e)?u(a,r,n):i(a,r))}catch(e){throw e.status===ee&&e.body?.error===`busy`?Error(`An action is already running.`,{cause:e}):e}}var I=e=>l(`/api/loops`,e),L=()=>r(`/api/loops/active`),R=(e,t)=>i(`/api/loops/preset`,{root:e,preset:t}),z=e=>l(`/api/factories/catalog`,e),B=()=>r(`/api/factories/active`),V=()=>r(`/api/mcp`),H=e=>i(`/api/reveal`,{path:e}),U=()=>r(`/api/installs`),W=(e,t,n)=>i(`/api/install`,{host:e,path:t,action:n}),G=(e,t,n)=>i(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),K=(e,t)=>i(`/api/default-install`,{host:e,path:t}),q=()=>i(`/api/pick-folder`,{}),J=()=>r(`/api/ping`),Y=()=>i(`/api/shutdown`),X=()=>i(`/api/restart`),Z=e=>i(`/api/autostart`,{action:e}),Q=e=>e?`?harness=${encodeURIComponent(e)}`:``,$={fleet:f,migratePreview:p,kits:m,usage:h,gates:g,update:_,loops:I,activeLoops:L,factories:z,activeFactories:B,setLoopPreset:R,overview:d,recent:v,activity:y,activityDetail:b,activityToggle:x,setup:S,doctor:C,themes:w,catalog:T,item:E,loadout:O,memoryDelete:D,diff:k,restore:A,job:j,jobs:M,cancelJob:N,action:F,mcp:V,mcpReveal:H,installs:U,installToggle:W,installRemove:G,setDefaultInstall:K,pickFolder:q,ping:J,shutdown:Y,restart:X,autostart:Z,docs:(e,t)=>l(`/api/docs${Q(e)}`,t),docsPage:(e,t,n)=>l(`/api/docs/page/${encodeURIComponent(e)}${Q(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{$ as t};
|