geneseed 4.32.0 → 5.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 +101 -0
- package/DESIGN.md +2 -2
- package/README.md +6 -5
- package/SHIPPED.md +4 -3
- package/adapters/bob/README.md +6 -5
- package/adapters/claude-code/README.md +4 -3
- package/adapters/claude-code/skills/geneseed/SKILL.md +1 -1
- package/adapters/openclaude/README.md +4 -3
- package/adapters/opencode/GLOBAL-HARNESS-SPEC.md +3 -1
- package/adapters/opencode/HOW-OPENCODE-LOADS.md +2 -1
- package/adapters/opencode/README.md +18 -18
- package/adapters/opencode/plugins/geneseed-activity.js +57 -1
- package/adapters/opencode/plugins/geneseed-context.js +85 -18
- package/adapters/opencode/plugins/geneseed-guard.js +437 -76
- package/adapters/opencode/plugins/geneseed-learn.js +97 -23
- package/bin/geneseed-cli.mjs +17 -25
- package/bin/geneseed-hook.mjs +23 -8
- package/docs/DESIGN.md +175 -0
- package/docs/PRD.md +111 -0
- package/docs/README.md +3 -2
- package/docs/architecture.md +145 -0
- package/docs/concepts/agents.md +1 -1
- package/docs/concepts/collaboration.md +1 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/exclusions.md +5 -5
- package/docs/concepts/footprint.md +1 -1
- package/docs/concepts/foreman-mode.md +2 -2
- package/docs/concepts/hooks.md +22 -8
- package/docs/concepts/host-matrix.md +2 -2
- package/docs/concepts/hosts.md +1 -1
- package/docs/concepts/kits.md +3 -1
- package/docs/concepts/ownership.md +1 -1
- package/docs/concepts/rules.md +15 -2
- package/docs/concepts/shared-tier.md +73 -0
- package/docs/concepts/skills.md +2 -2
- package/docs/concepts/themes.md +1 -1
- package/docs/extending.md +13 -12
- package/docs/guides/install-claude-code.md +1 -1
- package/docs/guides/install-opencode.md +1 -1
- package/docs/guides/migrate.md +8 -4
- package/docs/guides/project-context.md +2 -2
- package/docs/guides/setup-footprint.md +1 -1
- package/docs/guides/uninstall.md +2 -1
- package/docs/guides/upgrade-to-5.md +118 -0
- package/docs/guides/upgrade.md +21 -9
- package/docs/guides/wiki.md +3 -3
- package/docs/reference/env-context.md +5 -3
- package/docs/reference/environment.md +1 -1
- package/docs/reference/glossary.md +2 -0
- package/docs/reference/opencode-plugins.md +3 -3
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/reference/plugin-context.md +1 -0
- package/docs/reference/plugin-guard.md +14 -6
- package/docs/reference/plugin-learn.md +13 -6
- package/docs/reference/troubleshoot-hooks.md +3 -3
- package/docs/reference/troubleshoot-update.md +14 -0
- package/docs/token-footprint.md +4 -3
- package/docs/understand/a-day.md +2 -2
- package/docs/understand/design-choices-install.md +2 -1
- package/docs/understand/enforced-vs-asked.md +1 -1
- package/docs/understand/machine-bob.md +2 -0
- package/docs/understand/machine-claude.md +7 -5
- package/docs/understand/machine-opencode.md +7 -5
- package/docs/understand/on-your-machine.md +4 -0
- package/docs/understand/take-it-out.md +1 -1
- package/docs/web-ui.md +135 -70
- package/harness.config.json +1 -1
- package/js/README.md +12 -7
- package/js/build/args.mjs +10 -8
- package/js/build/bundle.mjs +11 -13
- package/js/build/driver.mjs +66 -65
- package/js/build/emit-claude.mjs +22 -16
- package/js/build/emit-common.mjs +4 -5
- package/js/build/emit-opencode.mjs +22 -22
- package/js/build/fold.mjs +515 -0
- package/js/build/generate.mjs +41 -52
- package/js/build/render.mjs +115 -29
- package/js/build/rule-decide.mjs +273 -0
- package/js/build/source.mjs +4 -1
- package/js/build/stubs.mjs +70 -9
- package/js/build/version.mjs +10 -10
- package/js/cli-table.json +23 -83
- package/js/hosts/activity.mjs +2 -2
- package/js/hosts/geneseed-dir.mjs +1 -1
- package/js/hosts/hooks-context.mjs +389 -99
- package/js/hosts/hooks-learn.mjs +38 -7
- package/js/hosts/hooks-prims.mjs +4 -2
- package/js/hosts/hooks.mjs +114 -39
- package/js/hosts/hosts.mjs +150 -51
- package/js/hosts/installs.mjs +59 -171
- package/js/hosts/link.mjs +3 -5
- package/js/hosts/mcp.mjs +1 -1
- package/js/hosts/memory-files.mjs +219 -17
- package/js/hosts/ownership-gate.mjs +1 -1
- package/js/hosts/settings.mjs +18 -13
- package/js/hosts/shim.mjs +4 -33
- package/js/hosts/store-watch.mjs +191 -0
- package/js/inspect/checks-authoring.mjs +3 -3
- package/js/inspect/checks-build.mjs +45 -18
- package/js/inspect/checks-counts.mjs +4 -4
- package/js/inspect/checks-repo.mjs +13 -14
- package/js/inspect/cost.mjs +24 -2
- package/js/inspect/diff.mjs +123 -123
- package/js/inspect/doctor.mjs +22 -27
- package/js/inspect/excludes.mjs +181 -62
- package/js/inspect/inventory.mjs +22 -27
- package/js/inspect/registry.mjs +110 -32
- package/js/inspect/scan.mjs +5 -5
- package/js/inspect/status.mjs +141 -119
- package/js/inspect/validate.mjs +22 -24
- package/js/lib/fs.mjs +47 -50
- package/js/lib/json.mjs +10 -17
- package/js/lib/machine-dir.mjs +73 -0
- package/js/lib/paths.mjs +35 -33
- package/js/lib/proc.mjs +1 -1
- package/js/lib/prompt.mjs +19 -27
- package/js/lib/text.mjs +8 -12
- package/js/lib/udiff.mjs +11 -15
- package/js/loop/catalog.mjs +2 -3
- package/js/maintain/memory.mjs +17 -17
- package/js/maintain/migrate.mjs +120 -92
- package/js/maintain/setup.mjs +43 -32
- package/js/maintain/uninstall.mjs +43 -61
- package/js/maintain/update.mjs +200 -93
- package/js/ui/anim.mjs +21 -35
- package/js/ui/cli.mjs +36 -58
- package/js/ui/menu.mjs +22 -45
- package/js/ui/tui.mjs +27 -67
- package/js/web/actions.mjs +34 -34
- package/js/web/api.mjs +142 -79
- package/js/web/catalog.mjs +175 -46
- package/js/web/docs.mjs +33 -12
- package/js/web/doctor-worker.mjs +14 -0
- package/js/web/handler.mjs +16 -5
- package/js/web/routes.mjs +24 -22
- package/js/web/state.mjs +78 -19
- package/js/web/update-check.mjs +27 -12
- package/js/web/user-files.mjs +76 -104
- package/package.json +7 -4
- package/registry.json +48 -55
- package/src/AGENT.md.tmpl +13 -14
- package/src/agents/_self-improvement.md +1 -1
- package/src/agents/_template.md +1 -1
- package/src/agents/advocate.md +1 -1
- package/src/agents/architect.md +1 -1
- package/src/agents/developer.md +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +1 -1
- 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 +1 -1
- package/src/agents/user-advocate.md +1 -1
- package/src/agents/visionary.md +1 -1
- package/src/memory/README.md +1 -1
- package/src/skills/_self-improvement.md +2 -2
- package/src/skills/daydream/SKILL.md +2 -2
- package/src/skills/daydream/instructions.md +1 -1
- package/src/skills/geneseed.md +1 -1
- package/src/skills/learn-mode.md +1 -2
- package/src/skills/profile.md +2 -2
- package/src/skills/rule/approve.md +75 -0
- package/src/skills/rule/consolidate.md +3 -3
- package/src/skills/rule.md +14 -5
- package/src/skills/skill-forge.md +1 -1
- package/src/skills/teach.md +29 -12
- package/src/skills/wiki.md +1 -1
- package/themes/_TEMPLATE.json +1 -2
- package/themes/biker.json +1 -2
- package/themes/commentator.json +1 -2
- package/themes/cyberpunk.json +1 -2
- package/themes/gamer.json +1 -2
- package/themes/imperial.json +1 -2
- package/themes/joker.json +1 -2
- package/themes/marvin.json +1 -2
- package/themes/mean.json +1 -2
- package/themes/military.json +1 -2
- package/themes/neutral.json +1 -2
- package/themes/pirate.json +1 -2
- package/themes/sports.json +1 -2
- package/themes/verstappen.json +1 -2
- package/themes/wizard.json +1 -2
- package/web/dist/assets/Activity-Ci4PZco3.js +1 -0
- package/web/dist/assets/ActivityDetail-C8hroCND.js +1 -0
- package/web/dist/assets/AgentGlyph-k6o3gCM1.js +1 -0
- package/web/dist/assets/Bonsai-C1iBAt4v.js +1 -0
- package/web/dist/assets/{CopyButton-C5Li6awl.js → CopyButton-DJ3a4N88.js} +1 -1
- package/web/dist/assets/Dashboard-C_On4KXw.js +2 -0
- package/web/dist/assets/Docs-Kffdg5uV.js +5 -0
- package/web/dist/assets/GreenhouseView-k56_cBSF.js +1 -0
- package/web/dist/assets/Installs-DtEKLC9h.js +3 -0
- package/web/dist/assets/JournalView-RQnk5l7I.js +1 -0
- package/web/dist/assets/Kits-CXkEBpnf.js +1 -0
- package/web/dist/assets/Laws-DhhIVqmh.js +3 -0
- package/web/dist/assets/Library-CAUiEoJo.js +3 -0
- package/web/dist/assets/{Loops-CzitjxGV.js → Loops-LKD8mF4E.js} +2 -2
- package/web/dist/assets/{Markdown-C4S4tTA7.js → Markdown-0ORz7tAc.js} +21 -21
- package/web/dist/assets/OperatorHudView-CM5jNPwL.js +1 -0
- package/web/dist/assets/Personal-B6Uoly3C.js +2 -0
- package/web/dist/assets/{RailCats-D5weYPCS.js → RailCats-DQxxYBEP.js} +1 -1
- package/web/dist/assets/Settings-BTe6-wda.js +1 -0
- package/web/dist/assets/Tabs-CbdDWTp_.js +1 -0
- package/web/dist/assets/api-D_r0Jtla.js +1 -0
- package/web/dist/assets/controls-D4wmg_pl.js +1 -0
- package/web/dist/assets/index-HfGmYXab.js +3 -0
- package/web/dist/assets/index-ao3M-Fhm.css +1 -0
- package/web/dist/assets/motion-RlUl1osO.js +1 -0
- package/web/dist/assets/{sections-ChwaobfW.js → sections-CtFz7HFH.js} +1 -1
- package/web/dist/index.html +5 -5
- package/src/skills/quiz.md +0 -44
- package/web/dist/assets/Activity-Bjy64wHC.js +0 -1
- package/web/dist/assets/ActivityDetail-B0AaipP8.js +0 -1
- package/web/dist/assets/Bonsai-CJniRqaH.js +0 -1
- package/web/dist/assets/Dashboard-B-6DTmae.js +0 -2
- package/web/dist/assets/Docs-LRc30XL9.js +0 -5
- package/web/dist/assets/GreenhouseView-CcoYlaWo.js +0 -1
- package/web/dist/assets/Installs-dp1epTcE.js +0 -3
- package/web/dist/assets/JournalView-nFP4poCf.js +0 -1
- package/web/dist/assets/KitApply-DwyZUj57.js +0 -1
- package/web/dist/assets/Kits-C0IEdZXe.js +0 -1
- package/web/dist/assets/Laws-CkykmQWu.js +0 -3
- package/web/dist/assets/Library-Guh9HBZU.js +0 -2
- package/web/dist/assets/OperatorHudView-DLGNulIY.js +0 -1
- package/web/dist/assets/Personal-BMtberL8.js +0 -2
- package/web/dist/assets/Tabs-uYJqfuQt.js +0 -1
- package/web/dist/assets/api-BxjLd7Qd.js +0 -1
- package/web/dist/assets/index-DA7BiaE5.js +0 -3
- package/web/dist/assets/index-dbbDGFDq.css +0 -1
- package/web/dist/assets/motion-Bccx3zE8.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";var r=e(t(),1),i=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},a=e=>()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},o=e=>Math.max(0,Math.min(1,e)),s={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},c={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},l={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},u=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],d=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],f=[`#3E8E41`,`#5FB14F`],p=[`#4A4F54`,`#62686E`],m=`#FFF6E0`,h=[`#E3C24A`,`#C9A23A`],g=[`#9BDD6A`,`#D8F59A`],_={"!":`#E8B04A`,x:`#FF6F69`},v=12;function y(e){let t=String(e||``).toLowerCase();return/implement|develop/.test(t)?`developer`:/explor/.test(t)?`explorer`:/review/.test(t)?`reviewer`:/test/.test(t)?`tester`:null}var b=e=>e?.status===`blocked`||e?.status===`waiting-input`;function x(e){return Array.isArray(e.files_all)?e.files_all.filter(e=>e&&typeof e==`object`):(Array.isArray(e.files?.items)?e.files.items:[]).filter(e=>e&&typeof e==`object`).map(e=>({file:e.file??null,path:e.path??null,additions:e.additions??0,deletions:e.deletions??0,by:e.by??null}))}var S=e=>e==null||e===``?NaN:Number(e);function C(e){let t=S(e?.context?.used),n=S(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?o(t/n):null}function w(e){let t=x(e),n=(Array.isArray(e.agents)?e.agents:[]).filter(e=>e&&typeof e==`object`).map((e,t)=>({key:e.id??`#${t}`,id:e.id??null,type:e.type||null,running:e.status!==`done`,files:[]})),r=new Map(n.map(e=>[e.key,e])),i=[],a=e.attribution!==!1;for(let e of t){if(!a||e.by==null){i.push(e);continue}let t=r.get(e.by);t||(t={key:e.by,id:e.by,type:`agent`,running:!0,files:[]},n.push(t),r.set(e.by,t)),t.files.push(e)}let c=C(e),l=c!=null,u=l?S(e.context.used):NaN,d=l?c:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=S(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?o(u/p):0;return{id:String(e.session_id??``),host:s[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:b(e)?`!`:e.error?`x`:null,turns:Math.max(0,Number(e.turns)||0),ctx:d,compactions:f,compacted:f>0&&m<1,regrow:m,crown:i,agents:n}}function T(e,t=!1){let n=w(e);return JSON.stringify([n.id,n.host,n.idle,n.bubble,n.turns,Math.round(n.ctx*100),n.compactions,Math.round(n.regrow*100),n.crown.length,n.agents.map(e=>[e.key,e.type,e.running,e.files.length]),!!t])}function E(e,{sakura:t=!1}={}){let n=w(e),{id:r,idle:o}=n,b=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*b,S=a(i(r)),C=Array.from({length:56},()=>Array(56).fill(null)),T=Array.from({length:56},()=>Array(56).fill(-1)),E=-1,D=(e,t,n)=>{e=Math.round(e),t=Math.round(t),e>=0&&e<56&&t>=0&&t<56&&(C[t][e]=n,T[t][e]=E)},O=o?d:u,k=o?p:f,A=o?c.idle:t?c.sakura:c.live,j=Math.round(41-(9+18*b)),M=1+S()*2+3*b,N=S()*Math.PI*2,P=.9+S()*.6,F=e=>28+M*Math.sin(e*Math.PI*P+N)-M*Math.sin(N);for(let e=41;e>=j;e--){let t=(41-e)/(41-j),n=F(t),r=3+4.5*b-(1.5+3.5*b)*t;for(let t=Math.floor(n-r/2);t<=Math.ceil(n+r/2);t++){let i=(t-(n-r/2))/r;D(t,e,i<.25?O[3]:i>.75?O[0]:S()<.15?O[1]:O[2])}}for(let e=-6;e<=6;e++)D(28+e,41,Math.abs(e)>4?O[1]:O[2]),Math.abs(e)<=5&&D(28+e,40,Math.abs(e)>3?O[1]:O[2]);let I=[],L=(e,t,n,o,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=a(i(`${r}:pad:${c}`)),u=n*.72;t=Math.max(t,u+6);for(let r=0;r<6;r++){let r=-Math.PI*(.15+.7*l()),i=n*(.4+.5*l());for(let n=0;n<i;n++)D(e+Math.cos(r)*n,t+u*.5+Math.sin(r)*n*.8,O[0])}let d=Math.round(10+n*1.6),f=[];for(let r=0;r<d;r++){let r=l()*Math.PI*2,i=Math.sqrt(l());f.push([e+Math.cos(r)*i*n,t+Math.sin(r)*i*u,1.8+l()*2.2])}f.sort((e,t)=>t[1]-e[1]);for(let[e,n,r]of f){let i=Math.max(0,Math.min(4,Math.round(4*(1-(n-(t-u))/(2*u))+(l()-.5))));for(let t=Math.floor(n-r);t<=n+r;t++)for(let a=Math.floor(e-r);a<=e+r;a++){if(((a-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=a-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(a,t,o[Math.max(0,Math.min(4,i+s))])}}let p=a(i(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,v);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,m);return{rx:n,cy:t}},R=a(i(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let s=.25+.55*(t/Math.max(1,n.agents.length-1)),c=Math.round(41-s*(41-j)),u=F(s);if(!e.running){let t=(3+4.5*b-(1.5+3.5*b)*s)/2;E=-1,D(u+R*(t+1),c,O[3]),D(u+R*(t+2),c-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let d=Math.round((12+Math.floor(a(i(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=d;e++){let t=u+R*e,n=c-e*.45;D(t,n,O[e<d/2?1:2]),D(t,n+1,O[0]),e<d*.6&&D(t,n+2,O[0])}let f=o?null:y(e.type),p=f?l[f]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:f,files:e.files,bbox:null}),L(u+R*d,c-d*.45-2,(8+Math.min(e.files.length,6)*.6)*x,p,e.files.length,e.key),R=-R});let B=I.length;I.push({agentId:null,key:null,type:null,family:null,files:n.crown,bbox:null}),E=B;let V=(4+7*n.ctx+Math.min(n.crown.length,6)*.5)*x*1.35,{rx:H,cy:U}=L(F(1),j-3,V,A,n.crown.length,`crown`);if(n.ctx>.8&&!n.compacted){let e=a(i(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)T[t][n]===B&&C[t][n]!==m&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?h[0]:h[1])}if(n.compacted){let e=a(i(`${r}:shoots`)),t=Math.round(U-H*.15-n.regrow*H*.5);for(let e=0;e<Math.max(0,t);e++)for(let t=0;t<56;t++)T[e][t]===B&&(C[e][t]=null,T[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(T[t][r]!==B||e()>=.12+n.regrow*.5)continue;let i=1+Math.floor(e()*(1+n.regrow*3));for(let e=1;e<=i;e++)D(r,t-e,e===i?g[1]:g[0])}}E=-1;let W=a(i(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,c.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,m);let[G,K,q]=s[n.host];for(let e=42;e<=46;e++){let t=e<=43?0:Math.floor((e-43)*.45)+2;for(let n=13+t;n<=42-t;n++){if(e===42&&C[e][n]===m)continue;let r=K;e<=43?r=e===42?q:G:(e===46||n===13+t||n===42-t)&&(r=G),D(n,e,r)}}let J=a(i(`${r}:moss`));for(let e=15;e<=40;e++)D(e,41,J()<.5?k[0]:k[1]),J()<.35&&D(e,40,k[0]);for(let e=16;e<=39;e++)D(e,47,`#00000055`);if(n.bubble){let e=_[n.bubble];for(let t=3;t<10;t++)for(let n=40;n<47;n++)D(n,t,t===3||t===9||n===40||n===46?e:`#14191F`);if(D(41,10,e),n.bubble===`!`){for(let t=5;t<=6;t++)D(43,t,e);D(43,8,e)}else for(let[t,n]of[[2,2],[4,2],[3,3],[2,4],[4,4]])D(40+t,3+n,e)}let Y=[],X=I.map(()=>null);for(let e=0;e<56;e++){let t=0;for(;t<56;){let n=C[e][t],r=T[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&T[e][i+1]===r;)i++;if(Y.push({x:t,y:e,w:i-t+1,c:n,p:r}),r>=0){let n=X[r]||={x0:t,y0:e,x1:i,y1:e};n.x0=Math.min(n.x0,t),n.x1=Math.max(n.x1,i),n.y1=e}t=i+1}}return I.forEach((e,t)=>{let n=X[t];e.bbox=n?{x:n.x0,y:n.y0,w:n.x1-n.x0+1,h:n.y1-n.y0+1}:null}),{width:56,height:56,runs:Y,pads:I,bubble:n.bubble,fallen:z}}var D=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},O=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function k(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?O(e):n.cwd?`cwd:${O(n.cwd)}`:`outside a repo`),i=D(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&O(n.root)!==O(e)?D(n.root):null;t.get(r).trees.push({s:n,worktree:a})}let n=(e,t)=>e<t?-1:+(e>t),r=[...t.values()];for(let e of r)e.trees.sort((e,t)=>n(e.worktree||``,t.worktree||``)||n(String(e.s.session_id),String(t.s.session_id)));return r.sort((e,t)=>n(e.name.toLowerCase(),t.name.toLowerCase())||n(e.key,t.key))}var A=e=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),j=e=>A({key:e.key??void 0,install:e.install,session_id:e.sid}),M=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`);function N(e){let t=e||[],n=e=>n=>t.filter(t=>e(t)===e(n)).length,r=n(e=>e.host),i=n(e=>`${e.host} ${e.scope}`),a=new Map(t.map(e=>[e.install,r(e)<2?e.host:i(e)<2||e.scope===`global`?`${e.host} · ${e.scope}`:`${e.host} · ${D(e.path)}`])),o=()=>t.filter(e=>t.some(t=>t!==e&&a.get(t.install)===a.get(e.install)));for(let e=2,t=o();t.length;e++,t=o()){for(let n of t){let t=String(n.path).split(/[\\/]+/).filter(Boolean).length;a.set(n.install,`${n.host} · ${e>t?n.path:M(n.path,e)}`)}if(e>64)break}return a}var P=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function F(e,t){let n=String(e).indexOf(`?`),r=new URLSearchParams(String(t||``).split(`?`)[1]||``),i=r.get(`host`),a=r.get(`path`);return{sid:n<0?e:String(e).slice(0,n),install:i&&a?{host:i,path:a}:void 0}}function I(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),r=N(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:r.get(e.install)??e.host??null,href:P(e.session_id,t)}})}var L=(e,t)=>new Set((e.writers||[]).filter(e=>j(e)===t).map(e=>O(e.root)));function R(e,t,n){let r=L(e,t);for(let t of L(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var z=e=>[...new Set((e.writers||[]).map(j))];function B(e,t){let n=new Map(e.map((e,t)=>[A(e.s),t])),r=new Map;for(let e of t||[]){let t=z(e).filter(e=>n.has(e));for(let i=0;i<t.length;i++)for(let a=i+1;a<t.length;a++){let o=n.get(t[i]),s=n.get(t[a]),c=o<s?`${o}-${s}`:`${s}-${o}`,l=R(e,t[i],t[a]);r.has(c)&&l!==`same-worktree`||r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function V(e,t){let n=[];for(let r of t||[]){let t=z(r).filter(t=>t!==e);if(!t.length||!z(r).includes(e))continue;let i=t.some(t=>R(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var H=e=>e?.status===`busy`||b(e);function U(e,t=10){let n=e.map(e=>({...e,collapsed:!1})),r=n.reduce((e,t)=>e+t.trees.length,0);if(r<=t)return n;let i=n.length,a=n.filter(e=>!e.trees.some(e=>H(e.s))).sort((e,t)=>t.trees.length-e.trees.length||(e.key<t.key?-1:1));for(let e of a){if(r<=t||i<=1)break;e.collapsed=!0,r-=e.trees.length,i--}return n}var W=n(),G=12,K=`geneseed-garden-sakura`;function q(){try{return window.localStorage.getItem(K)===`1`}catch{return!1}}var J=e=>e.key==null?`the session`:e.type||`agent`,Y=e=>e.path||e.file||`?`;function X({pad:e}){let t=e.files.slice(0,G);return(0,W.jsxs)(`div`,{className:`card gd-card`,children:[(0,W.jsxs)(`div`,{className:`act-lbl`,children:[J(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,W.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`mono act-ell`,children:Y(e)}),(0,W.jsxs)(`span`,{className:`mono act-xs`,children:[(0,W.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,W.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Y(e)}:${t}`))}),e.files.length>t.length&&(0,W.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var Z=(0,r.memo)(function({t:e,pad:t,swaying:n,onPad:i,px:a,label:o}){let s=(0,r.useMemo)(()=>{let t=new Map;for(let n of e.runs)t.has(n.p)||t.set(n.p,[]),t.get(n.p).push(n);return[...t.entries()]},[e]);return(0,W.jsx)(`svg`,{className:`gd-svg${t==null?``:` gd-dimming`}`,viewBox:`0 0 56 56`,width:56*a,height:56*a,shapeRendering:`crispEdges`,"data-bubble":e.bubble||void 0,...o?{role:`img`,"aria-label":o}:{"aria-hidden":`true`},children:s.map(([r,a])=>(0,W.jsx)(`g`,{"data-p":r,className:[r===t&&`gd-hot`,n&&r>=0&&e.pads[r].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:r>=0?()=>i(r):void 0,onMouseLeave:r>=0?()=>i(null):void 0,children:a.map(e=>(0,W.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},r))})});export{A as a,P as c,k as d,N as f,T as g,B as h,q as i,F as l,V as m,K as n,U as o,I as p,Z as r,C as s,X as t,E as u};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-CcoYlaWo.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/motion-Bccx3zE8.js","assets/sections-ChwaobfW.js","assets/index-DA7BiaE5.js","assets/api-BxjLd7Qd.js","assets/index-dbbDGFDq.css","assets/OperatorHudView-DLGNulIY.js","assets/JournalView-nFP4poCf.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-XKyaHtl9.js";import{i as n,t as r}from"./react-C1iE8mnY.js";import{t as i}from"./api-BxjLd7Qd.js";import{i as a,t as o}from"./motion-Bccx3zE8.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{B as l,Dt as u,I as d,J as f,L as p,Q as m,U as h,Y as g,at as _,bt as v,ct as y,l as b,ot as x,q as S,rt as C,st as w,t as T}from"./index-DA7BiaE5.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),ee={done:`ok`,failed:`bad`},A={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=d(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];i&&i.key===r?(i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started)):t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=y(e.newest),n=e.oldest?y(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${ee[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:A[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=v(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>u(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(o,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function R({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,k.jsxs)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(C,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=p(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[y(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(l,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=w(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=x(e.counts),o=n?.version_verdict||``,s=U(o),l=_(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=x(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=v(()=>q(()=>i.fleet()),[e]),r=v(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?b(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>T(()=>import(`./GreenhouseView-CcoYlaWo.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>T(()=>import(`./OperatorHudView-DLGNulIY.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>T(()=>import(`./JournalView-nFP4poCf.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:l}){let u=c,[d,p]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:b}=v(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(f,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(g,{});let x=e.daemon_stale?(0,k.jsx)(S,{}):null;return e.deployed?d===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:[x,(0,k.jsx)(Q,{overview:e,recent:b,lens:y,onDirection:p,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(m,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:d===e?`on`:``,onClick:()=>p(e),"aria-pressed":d===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[d===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:l}),d===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),d===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),d===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),d===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},d)]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(h,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,r as n,t as r}from"./react-C1iE8mnY.js";import{t as i}from"./api-BxjLd7Qd.js";import{n as a}from"./motion-Bccx3zE8.js";import{Dt as o,J as s,Q as c,W as l,Y as u,a as d,bt as f,c as ee,et as p,i as te,n as m,nt as h,o as g,r as _,rt as v,s as ne,tt as re}from"./index-DA7BiaE5.js";import{t as y}from"./EmptyState-CY5Pm2xy.js";import{a as b,n as x,o as S,r as ie,t as ae}from"./RailCats-D5weYPCS.js";import{t as C}from"./CopyButton-C5Li6awl.js";import{i as w,n as T,r as E}from"./Markdown-C4S4tTA7.js";var D=e(t(),1),O=n();function k(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function A(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
|
-
`))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
|
|
3
|
-
`),n.join(`
|
|
4
|
-
`)]}function j(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||k(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function M(e){let t={ids:new Set,idx:0,toc:[]},n=n=>j(T(n,e?.links),t);if(e?.rows){let[r,i]=A(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var N=r(),P={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},F=`you already know this`,I=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function L(e){return e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}e.replaceWith(t),t.append(n,e)}),[...e.querySelectorAll(`figure.docs-code > figcaption`)]}var R=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),z=40,B=e=>{let t=e.split(`
|
|
5
|
-
`)[0].trim();return t?`Copy `+(t.length>z?t.slice(0,39)+`…`:t):`Copy code`};function V({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,D.useRef)(null),[s,c]=(0,D.useState)([]),u=(0,D.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),c(L(e)))},[u]),(0,D.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),o(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[u]),(0,D.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=P[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>k(e.textContent||``)===k(i))),o?.classList.add(`docs-here`)},[u,e.id,t?.emit]);let d=[];return e.id===`install`&&(d.push({label:`Run doctor`,action:`doctor`}),d.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&d.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&d.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:d.length>0&&d.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:u}}),s.map((e,t)=>{let n=R(e);return(0,O.createPortal)((0,N.jsx)(C,{text:n,label:B(n)}),e,t)}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var H=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function U({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function W({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:H(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(C,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(U,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(U,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function G({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(W,{cmd:e,prog:t},e.name))})]})}function K({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var q={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},J=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function oe({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,D.useState)(0),{before:s,after:c}=(0,D.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(V,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(J,{text:e.piece})}),(0,N.jsx)(Y,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(J,{text:e.cost})})]})},t))}),u&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(J,{text:u.piece})}),(0,N.jsx)(Y,{kind:u.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.off})})]})]})]}),c.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}})]})}function se(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ce(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,D.useSyncExternalStore)(ce,e,()=>null),le=5,ue=96,de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Z(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${de(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===le)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,D.useMemo)(()=>Z(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=ue&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(s,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(u,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(V,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,N.jsx)(oe,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,N.jsx)(G,{page:e});case`glossary`:return(0,N.jsx)(K,{page:e});case`about`:return(0,N.jsx)(me,{page:e,overview:n});default:return(0,N.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=se(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=X(ge);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=h(re(t?.emit)),{data:o,error:l}=f(()=>i.docs(r),[r]),v=e||Q(o),{data:y,error:C,loading:w}=f(()=>v?i.docsPage(v,r):Promise.resolve(null),[v,r]),{data:T}=f(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,D.useEffect)(()=>{if(o&&v&&!o.groups.some(e=>e.pages.some(e=>e.id===v))){let e=Q(o);e&&e!==v&&window.location.replace(d(e))}},[o,v]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[v]);let E=ne(o,v),O=E.part||o?.groups?.[0]||null,k=O?.id===_;(0,D.useEffect)(()=>{k&&y?.id===v&&g(v)},[k,y,v]);let A=k?[...ee(),v]:[],[j,M]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(O?.id);O?.id!==I&&(L(O?.id),M(``),F(`all`));let R=$(O),z=x(R),B=P===`all`?R:R.filter(e=>e.group===P),V=S(B,j);return l?(0,N.jsx)(s,{error:l}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(c,{"aria-label":`Harness`,children:p.map(e=>(0,N.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(o?.groups||[]).map(e=>(0,N.jsxs)(D.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:O?.id===e.id?`on`:``,"aria-current":O?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),O?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:R.length,cats:z,cat:P,onChange:F})]},e.id))})]}),(0,N.jsx)(b,{label:O?.label||`Docs`,count:j.trim()?`${V.length} of ${B.length}`:B.length||``,extra:k&&(0,N.jsx)(te,{pages:O.pages,seen:A}),q:j,onQ:M,matched:V.length,inView:[O?.id,v],children:o?(0,N.jsx)(ie,{rows:V,activeName:v,hrefOf:e=>d(e.name),pills:k?e=>A.includes(e.name)&&e.name!==v?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(u,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":E.page?.title||`Page`,children:[(0,N.jsx)(_e,{}),E.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:d(E.part.pages[0].id),children:E.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:d(E.part.pages.find(e=>(e.section||`General`)===E.section).id),children:E.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:E.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(he,{data:w?null:y,error:C,overview:t,onAction:n,place:E},`${v}|${r}`),!w&&(0,N.jsx)(m,{menu:o,pageId:v})]}),!w&&(0,N.jsx)(pe,{page:y,glossaryRows:T?.rows})]})]})]})})}export{ve as default,$ as docRows};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{t as n}from"./motion-Bccx3zE8.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{B as a,F as o,L as s,at as c,rt as l}from"./index-DA7BiaE5.js";import{i as u,n as d,r as f}from"./Dashboard-B-6DTmae.js";e();var p=t(),m=12,h=Array.from({length:7},(e,t)=>`var(--cat-${t})`),g=650;function _({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let o=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(a,{segments:e,size:t,stroke:r,label:i,sweepMs:g}),(0,p.jsxs)(`div`,{className:`ring-center`,children:[(0,p.jsx)(`div`,{className:`donut-c-num`,children:(0,p.jsx)(n,{value:o,duration:g})}),(0,p.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function v(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function y({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=v(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,p.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,p.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,p.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,p.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function b({label:e,value:t,sub:n,color:r,icon:i}){return(0,p.jsxs)(`div`,{className:`b-tile`,children:[(0,p.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,p.jsx)(l,{name:i})}),(0,p.jsxs)(`div`,{className:`b-tile-body`,children:[(0,p.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,p.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,p.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function x({overview:e,sigil:t,jobs:a,lens:g,onAction:v}){let x=e.counts||{},S=g?.doctor?.state||`loading`,C=g?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=u(e,g?.tone),O=s(a,m),k=c(e.diff),A=i.filter(e=>(x[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:x[e]||0,tone:`cat`+t%h.length,color:h[t%h.length]})),j=A.reduce((e,t)=>e+t.n,0),M=o(a||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`b-greet`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,p.jsx)(`h2`,{className:`h b-h`,children:D}),(0,p.jsx)(d,{verdict:g?.verdict}),(0,p.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,p.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,p.jsxs)(`div`,{className:`card b-hero`,children:[(0,p.jsx)(`div`,{className:`b-hero-ring`,children:(0,p.jsx)(_,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,p.jsxs)(`div`,{className:`b-hero-side`,children:[(0,p.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,p.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>v(`doctor`),children:[(0,p.jsx)(l,{name:`doctor`}),`Run doctor`]}),(0,p.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,p.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,p.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,p.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,p.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,p.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,p.jsxs)(`div`,{className:`b-chips`,children:[(0,p.jsxs)(`span`,{className:`b-chip`,children:[(0,p.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,p.jsx)(`span`,{className:`b-chip`,children:(0,p.jsx)(`b`,{children:e.emit})}),(0,p.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,p.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,p.jsxs)(`div`,{className:`b-tiles`,children:[(0,p.jsx)(b,{label:`Agents`,value:x.agents??`—`,sub:`specialists`,color:h[0],icon:`layers`}),(0,p.jsx)(b,{label:`Skills`,value:x.skills??`—`,sub:`workflows`,color:h[1],icon:`skill`}),(0,p.jsx)(b,{label:`Dictates`,value:x.laws??`—`,sub:x.doctrines?`${x.doctrines.active}/${x.doctrines.total} packs · ${x.doctrines.rules} rules`:`all upheld`,color:h[2],icon:`law`}),(0,p.jsx)(b,{label:`Edits`,value:k,sub:`to graft`,color:h[3],icon:`changes`})]})]}),(0,p.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,p.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Capability mix`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,p.jsxs)(`div`,{className:`b-mix`,children:[(0,p.jsx)(_,{segments:A,size:186,stroke:26}),(0,p.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,p.jsxs)(`div`,{className:`b-leg-row`,children:[(0,p.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,p.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,p.jsx)(`span`,{className:`b-leg-bar`,children:(0,p.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,p.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent runs`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`badge ok`,children:[(0,p.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,p.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,p.jsx)(`span`,{className:`b-stat-big`,children:(0,p.jsx)(n,{value:N})}),(0,p.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,p.jsx)(y,{data:M,accent:h[0],height:156})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent activity`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,p.jsx)(f,{jobs:a,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
|
|
@@ -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"./api-BxjLd7Qd.js";import{n as i}from"./motion-Bccx3zE8.js";import{$ as a,Ct as o,Et as s,J as c,Q as l,St as u,W as d,X as f,Y as p,Z as m,_t as h,at as g,bt as _,ct as v,dt as y,ft as b,gt as x,ht as S,it as C,mt as w,pt as T,rt as E,ut as D,vt as O,wt as k,xt as A,yt as j,z as M}from"./index-DA7BiaE5.js";import{t as N}from"./EmptyState-CY5Pm2xy.js";import{t as P}from"./Tabs-uYJqfuQt.js";import{c as F,i as I,l as L,n as R,o as z,s as ee,t as te}from"./KitApply-DwyZUj57.js";var B=e(t(),1),V=n();function ne({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,B.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();e?(f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()):f(`Choose or type a folder to deploy into.`)};return(0,V.jsxs)(`div`,{className:`deploy-pop`,children:[(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,V.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsxs)(`label`,{className:`dp-field`,children:[(0,V.jsx)(`span`,{children:`Deploy as`}),(0,V.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:w.map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,V.jsx)(F,{value:s,options:n,onChange:p,who:`the new harness`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,V.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,V.jsx)(`code`,{children:S(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function re(){let{data:e,error:t,reload:n}=_(()=>r.excludes(),[]),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,V.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,V.jsx)(`div`,{className:`card-head`,children:(0,V.jsx)(`h3`,{children:`Excluded folders`})}),(0,V.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,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsx)(`code`,{children:e.path}),(0,V.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>S(e).label).join(`, `)}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,V.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,V.jsx)(E,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,V.jsx)(`p`,{className:`sub`,children:e},t))]})}function ie({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,V.jsxs)(`div`,{className:`ip-block`,children:[(0,V.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,V.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,V.jsxs)(`div`,{className:`mcp-target`,children:[(0,V.jsxs)(`div`,{className:`mt-head`,children:[(0,V.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,V.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,V.jsxs)(`div`,{className:`mcp-row`,children:[(0,V.jsx)(`span`,{className:`mono`,children:e.name}),(0,V.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,V.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,V.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,V.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ae({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:p}){let m=`${S(e.host).label} · ${e.scope}`,[h,g]=H[e.state]||H.absent,_=e.state===`active`,v=e.state===`absent`;return(0,V.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,V.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,V.jsxs)(`div`,{className:`ip-head`,children:[(0,V.jsx)(`h2`,{children:x(e)}),(0,V.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,V.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${S(e.host).label}`}),(0,V.jsx)(`code`,{className:`ip-path`,children:e.path}),v?(0,V.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,V.jsx)(`strong`,{children:S(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(_||v)&&o?(0,V.jsx)(`div`,{className:`ip-picks`,children:(0,V.jsx)(F,{value:n,options:i,onChange:a,who:m})}):null,_&&t.length?(0,V.jsx)(ie,{targets:t,onReveal:p}):null,_&&e.scope===`global`?(0,V.jsx)(re,{}):null,v?null:(0,V.jsxs)(`label`,{className:`ip-switch`,children:[(0,V.jsx)(L,{on:_,disabled:s,label:`activate ${m}`,onToggle:d}),(0,V.jsx)(`span`,{children:_?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,V.jsx)(`div`,{className:`ip-spacer`}),o?(0,V.jsxs)(`div`,{className:`ip-actions`,children:[v?(0,V.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):_?(0,V.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,v?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`field`,children:[(0,V.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,V.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,V.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,V.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,V.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var oe=(e,t)=>`${e} ${t}`,se=[`claude`,`bob`,`openclaude`],U={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},W=/[\\/]\.claude[\\/]worktrees[\\/]/,G=e=>e.scope===`project`&&W.test(e.path);function ce(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?g(e.drift):0;return i?`${r} · ${i} edited`:r}function le({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,V.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,V.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?g(t.drift):0;return(0,V.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,V.jsx)(M,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,V.jsx)(`span`,{className:`dim`,children:ce(t,n)}),t.diffable?null:(0,V.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ue({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,V.jsx)(`div`,{className:`tbl-scroll`,children:(0,V.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,V.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,V.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,V.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,V.jsx)(`th`,{scope:`col`,children:`State`}),(0,V.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,V.jsx)(`th`,{scope:`col`,children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,V.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=U[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,V.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,V.jsx)(`td`,{children:S(e.host).label}):(0,V.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,V.jsx)(`td`,{children:u?``:e.theme||``}),(0,V.jsx)(`td`,{children:u?``:e.footprint||``}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`tag ${c}`,children:i}),G(e)?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.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,V.jsx)(`td`,{children:(0,V.jsx)(le,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,V.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function de({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,V.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,V.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,V.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,V.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function fe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,V.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,V.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,V.jsxs)(`dl`,{className:`kv-grid`,children:[(0,V.jsx)(`dt`,{children:`Source`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.root}),(0,V.jsx)(`dt`,{children:`Version`}),(0,V.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,V.jsx)(`dt`,{children:`Fingerprint`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function K({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:l}){let u=a(),{data:d,error:f,reload:m}=_(()=>r.installs(),[s]),{data:h,error:g,reload:v}=_(()=>r.mcp(),[s]),{data:b,error:C}=_(()=>r.fleet(),[s]),w=C?null:b??void 0,[T,O]=(0,B.useState)(null),[k,A]=(0,B.useState)(``),[M,P]=(0,B.useState)({}),[F,I]=(0,B.useState)(!1),[L,R]=(0,B.useState)({id:``,value:`keep`}),z=e=>L.id===e?.id?L.value:`keep`,[te,re]=(0,B.useState)(()=>y(`hosts`)),ie=(0,B.useMemo)(()=>{let e={};for(let t of h?.targets||[]){let n=oe(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[h]);if(f||g)return(0,V.jsx)(c,{error:f||g,onRetry:()=>{m(),v()}});if(!d||!h)return(0,V.jsx)(p,{});let H={active:0,disabled:1,absent:2},U=[...d.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(H[e.state]??3)-(H[t.state]??3)),W=U.find(e=>e.id===te)||U.find(e=>e.default)||U.find(e=>e.state===`active`)||U[0],G=e=>{let t=M[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`}},ce=(e,t,n)=>P(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),le=e=>{let t=G(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`)},K={theme:t.map(e=>e.name),footprint:ee,posture:d.postures||[],mode:d.modes||[],trust:d.trusts||[]},pe=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=G(t),s=S(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,l=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await u(l,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},me=async e=>{if(e.state!==`active`||await u(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){A(e.id),O(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;O({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},q=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&se.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},he=async e=>{let t=z(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${q(e,`memory`)} and ${q(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await u(`Uninstall ${S(e.host).label} · ${e.scope}? It deletes ${j(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){A(e.id),O(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){O({text:n.error||`remove failed`,tone:`bad`});return}R({id:``,value:`keep`}),n.kept?.length&&O({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`}),l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},ge=async e=>{O(null);try{let t=await r.mcpReveal(e.path);O({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){O({text:e.message,tone:`bad`})}},J=async()=>{let t=U.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await u(`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`)},_e=U.find(e=>e.default)?.host||U.find(e=>e.state===`active`)?.host||U[0]?.host||`opencode`,ve=U.filter(e=>e.scope===`global`),Y=U.filter(e=>e.scope!==`global`),X=e=>{re(e)},Z=e=>{D(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,V.jsxs)(`div`,{className:`hosts`,children:[(0,V.jsxs)(`div`,{className:`hosts-main`,children:[(0,V.jsxs)(`div`,{className:`toolbar`,children:[(0,V.jsxs)(`span`,{className:`dim`,children:[U.filter(e=>e.state===`active`).length,` active of `,U.length,` `,`detected.`]}),e?(0,V.jsx)(`div`,{className:`row gap-8`,children:(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:J,children:[(0,V.jsx)(E,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,V.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,V.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.text}):null,(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,V.jsx)(`div`,{className:`inst-head`,children:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,V.jsx)(ue,{rows:ve,currentId:W?.id,onPick:X,label:`Global installs`,fleet:w,onEdits:Z})]}),(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>I(e=>!e),children:[(0,V.jsx)(E,{name:`folder`}),` Deploy to a repo…`]}):null]}),F?(0,V.jsx)(`div`,{className:`inst-deploy`,children:(0,V.jsx)(ne,{host:_e,theme:n||`neutral`,options:K,onAction:e,onClose:()=>I(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Y.length?(0,V.jsx)(ue,{rows:Y,project:!0,currentId:W?.id,onPick:X,label:`Per-project installs`,fleet:w,onEdits:Z}):(0,V.jsx)(N,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,V.jsx)(fe,{setup:o,overview:i}),(0,V.jsx)(de,{themes:t,current:i?.theme})]}),W?(0,V.jsx)(ae,{inst:W,targets:ie[oe(W.host,W.path)]||[],choice:G(W),unchanged:le(W),options:K,onPick:(e,t)=>ce(W,e,t),canAct:!!e,busy:k===W.id,memory:z(W),onMemory:e=>R({id:W.id,value:e}),onApply:()=>pe(W),onToggleInstall:()=>me(W),onRemove:()=>he(W),onRevealMcp:ge},W.id):null]})}function pe({onAction:e,dataRev:t}){let{data:n,error:i}=_(()=>r.kits(),[t]),a=z(n,e);return i||n?.error?(0,V.jsx)(c,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,V.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=I(e),r=a.setOf(e),i=`${e.host} · ${e.scope}`;return(0,V.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{children:i}),(0,V.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,V.jsx)(R,{row:e})]}),t&&(0,V.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,V.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,V.jsxs)(`li`,{className:`kit-row`,children:[(0,V.jsxs)(`div`,{className:`kit-main`,children:[(0,V.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,V.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,V.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,V.jsx)(L,{on:r.has(n.name),disabled:t||a.running(e),label:`${n.name} for ${i}`,onToggle:()=>a.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,V.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,V.jsx)(te,{row:e,stage:a})]},e.id)})}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,V.jsx)(p,{})}function me(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var q=300;function he(e){let t=T(e.dataRev),[n,r]=b(`edits`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Local edits of:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ge,{install:n,...e},n?.id||``)]})}function ge({install:e,onMutated:t,onAction:n,dataRev:i,overview:o}){let s=a(),{data:l,error:u,reload:d}=_(()=>r.diff(O(e)),[i]),[f,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(``),[v,y]=(0,B.useState)(()=>new Set),[b,x]=(0,B.useState)(()=>new Set),[S,C]=(0,B.useState)(null);if(l&&l!==S){C(l),y(new Set);let e=l.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=q?l.files.map(e=>e.rel):[]))}let w=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>y(e=>e.size===A.length?new Set:new Set(A.map(e=>e.rel))),D=()=>n?.(`export`),k=async()=>{let n=[...v],i=n.filter(e=>l.files.find(t=>t.rel===e)?.status===`added`),a=i.length?`Restoring will DELETE ${i.length} deployed-only file(s):\n${i.join(`
|
|
2
|
-
`)}\n\n`:``;if(await s(`${a}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let i=await r.restore(n,O(e)),a=i.errors.length?` · ${i.errors.length} error(s): ${i.errors.join(`; `)}`:``;g(`Restored ${i.restored.length}, archived ${i.deleted.length}${a}`),await d(),t?.()}catch(e){g(e.message)}finally{m(!1)}}};if(u)return(0,V.jsx)(c,{error:u,onRetry:d});if(!l)return(0,V.jsx)(p,{});if(!l.deployed)return(0,V.jsx)(N,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!l.diffable)return(0,V.jsx)(N,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`The drift check covers global installs only. Pick a global install above.`});let A=l.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),j=l.files.filter(e=>e.status===`linked`),M=l.files.filter(e=>e.status===`stale`),P=A.filter(e=>e.status===`edited`).length,F=A.filter(e=>e.status===`added`).length,I=A.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Local edits`}),l.target?(0,V.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,V.jsx)(`code`,{children:l.target}),l.theme?` (${l.theme} voice)`:``,` with source`,` `,o?.version||`unknown`,`.`]}):null,P>0?(0,V.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.`}):F+I>0?(0,V.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||v.size===0,onClick:k,children:[`Restore`,v.size?` (${v.size})`:``]}),(0,V.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,V.jsx)(E,{name:`download`}),`Export improvements`]})]})]}),h?(0,V.jsx)(`p`,{className:`sub mb-14`,children:h}):null,j.length?(0,V.jsxs)(`p`,{className:`sub dim mb-14`,title:j.map(e=>e.rel).join(`
|
|
3
|
-
`),children:[j.length,` linked — yours, left alone`]}):null,A.length===0&&M.length===0?(0,V.jsx)(N,{title:`In sync`,children:`Deployed harness matches source.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`row between mb-14`,children:[(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`span`,{className:`badge warn`,children:[(0,V.jsx)(`span`,{className:`dot`}),P,` edited`]}),(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),F,` added`]}),I>0&&(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),I,` missing`]}),M.length>0&&(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),M.length,` behind`]})]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(l.files.map(e=>e.rel))),children:`Expand all`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),A.length?(0,V.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:v.size===A.length,onChange:T}),`Select all`]}):null]})]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:A.map(e=>R(e,!0))}),M.length?(0,V.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,V.jsx)(`h3`,{children:`Behind source`}),(0,V.jsxs)(`div`,{className:`row between`,children:[(0,V.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,V.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),M.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=b.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,V.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,V.jsxs)(`div`,{className:`diff-head`,children:[t?(0,V.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:v.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,V.jsx)(`span`,{className:`fname`,children:e.rel}),(0,V.jsxs)(`span`,{className:`badge ${r}`,children:[(0,V.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,V.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,V.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,V.jsx)(E,{name:`chevron`})})]}),n&&(0,V.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,V.jsx)(`div`,{className:`diff-line ${me(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,B.useState)(!n);return(0,V.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,V.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,V.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,V.jsx)(`h3`,{children:e.label}),(0,V.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,V.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,V.jsx)(E,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,V.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,V.jsxs)(`div`,{className:`problem`,children:[(0,V.jsx)(`span`,{className:`x`,children:`✕`}),(0,V.jsx)(`span`,{children:e})]},e))})]})}function _e({dataRev:e}){let t=T(e),[n,r]=b(`doctor`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Doctor for:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ve,{install:n,dataRev:e},n?.id||``)]})}function ve({install:e,dataRev:t}){let n=(0,B.useRef)(!1),{data:i,error:a,reload:o,setData:s}=_(()=>{let t=n.current;return n.current=!1,r.doctor(t,O(e))},[t]),l=()=>{n.current=!0,s(null),o()};if(a)return(0,V.jsx)(c,{error:a,onRetry:o});let u=i?i.groups.filter(e=>e.problems.length):[],d=i?i.groups.filter(e=>!e.problems.length):[];return(0,V.jsxs)(`div`,{className:`page-fill`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,V.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,V.jsxs)(`button`,{className:`btn`,onClick:l,disabled:!i,children:[(0,V.jsx)(E,{name:`refresh`}),i?`Re-run checks`:`Running…`]})]}),i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`span`,{className:`dim mono`,children:[`validated `,i.themes.length,` theme`,i.themes.length===1?``:`s`]}),i.checked_at?(0,V.jsxs)(`span`,{className:`dim mono`,title:i.checked_at,children:[`checked `,i.checked_at.slice(11)]}):null,i.themes.map(e=>(0,V.jsx)(`span`,{className:`badge cap`,children:e},e))]}),i.ok?(0,V.jsxs)(`span`,{className:`badge ok`,children:[(0,V.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),i.problems.length,` problem`,i.problems.length===1?``:`s`]})]})}),(0,V.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,V.jsx)(J,{group:e,i:t},e.label)),d.length?(0,V.jsxs)(`details`,{className:`check-fold`,children:[(0,V.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,V.jsx)(J,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,V.jsx)(p,{label:`Running every check (builds each theme in a sandbox)…`})]})}function Y(){let e=a(),[t,n]=(0,B.useState)(!1),[i,o]=(0,B.useState)(null);return t?(0,V.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,V.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:i}),(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){o(null);try{await r.shutdown()}catch(e){if(e.status)return o(e.message)}n(!0)}},children:[(0,V.jsx)(E,{name:`x`}),`Stop server`]})]})}function X(){let e=a(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:r}),(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await o()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,V.jsx)(E,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Z=`https://github.com/Arylmera/Geneseed`,ye=`https://github.com/Arylmera`,be=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],xe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function Q({k:e,help:t,children:n,control:r}){return(0,V.jsxs)(`div`,{className:`sheet-row`,children:[(0,V.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,V.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,V.jsx)(`div`,{className:`sheet-v`,children:n}),(0,V.jsx)(`div`,{className:`sheet-c`,children:r})]})}function $({id:e,title:t,head:n,className:r=``,children:i}){return(0,V.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Se({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,V.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:be.map(([n,r])=>(0,V.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,V.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function Ce({version:e}){let[t,n]=(0,B.useState)(Z),[i,a]=(0,B.useState)(!0);(0,B.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,V.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,V.jsx)(E,{name:`external`})]});return(0,V.jsxs)($,{id:`about`,title:`About`,children:[(0,V.jsx)(Q,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,V.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,V.jsx)(Q,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,V.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,V.jsx)(Q,{k:`Geneseed`,help:`MIT-licensed`,control:(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`Issues`]}),(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`MIT License`]})]})]}),children:(0,V.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,V.jsx)(Q,{k:`Creator`,control:(0,V.jsxs)(`a`,{className:`btn ghost`,href:ye,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,V.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function we({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:o,onAccentMode:c,layout:d,onLayout:p,dataRev:h}){let g=a(),_=T(h),[y,C]=b(`server`,_),w=y?.footprint,D=e?.server,O=e?.daemon_stale,[j,M]=(0,B.useState)(null);(0,B.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>M(e||null)).catch(()=>{})},[]);let N=j?j.install??(j.git?`git`:`npm-global`):null,P=N===`git`?`Update (git pull + rebuild)`:N===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,F=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await g(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},I=D?.autostart===!0?`On · login script`:D?.autostart===!1?`Off`:`unknown`;return(0,V.jsxs)(`div`,{className:`narrow-lg`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-18`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:s.server}),(0,V.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]}),(0,V.jsx)(f,{installs:_,value:y,onChange:C,label:`Footprint of:`})]}),(0,V.jsxs)(`div`,{className:`sheet`,children:[(0,V.jsx)(Se,{stale:O}),(0,V.jsxs)(`div`,{className:`sheet-body`,children:[(0,V.jsxs)($,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-skin-label`,children:k.map(e=>(0,V.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>i(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:k.find(e=>e.id===n)?.tagline??``})]}),o&&c&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,V.jsx)(m,{value:o,onChange:c,labelledBy:`dir-accent-label`}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:u(o)})]}),d&&p&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-layout-label`,children:A.map(e=>(0,V.jsx)(`button`,{className:d===e.id?`on`:``,onClick:()=>p(e.id),"aria-pressed":d===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:A.find(e=>e.id===d)?.tagline??``})]})]}),(0,V.jsxs)($,{id:`machine`,title:`Machine`,children:[(0,V.jsx)(Q,{k:`Geneseed`,help:`This copy of the source`,control:N===`other`?j.command?(0,V.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,V.jsx)(`code`,{className:`mono`,children:j.command})]}):null:(0,V.jsxs)(`button`,{className:`btn`,onClick:F,children:[(0,V.jsx)(E,{name:`download`}),P]}),children:(0,V.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,V.jsx)(Q,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,V.jsx)(E,{name:`external`}),`Add to PATH`]})}),y&&w&&(0,V.jsxs)(Q,{k:`Harness footprint`,help:(0,V.jsxs)(V.Fragment,{children:[`For `,S(y.host).label,` · `,y.scope,`; every Rule stays in force.`,` `,(0,V.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,V.jsx)(`span`,{className:`mono`,children:w}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,children:w===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,V.jsxs)($,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`pill good`,children:`running`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,D?` · pid ${D.pid} · up ${v(D.started)}`:``]})]}),children:[(0,V.jsx)(Q,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,V.jsx)(X,{}),children:O?(0,V.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,V.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,V.jsx)(Q,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,V.jsx)(`span`,{className:`sub`,children:I})}),(0,V.jsx)(Q,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,V.jsx)(`span`,{className:`row wrap gap-8`,children:xe.map(e=>(0,V.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,V.jsx)(Ce,{version:e?.version}),(0,V.jsxs)($,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,V.jsx)(Q,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,V.jsx)(Y,{})}),(0,V.jsx)(Q,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,V.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,V.jsx)(Q,{k:`Uninstall a harness`,children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function Te({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:s={}}){let c=t?.doctor,l=t?.diff,u=T(o),f=u?.length>1?h(u[0]):null,p=e=>e==null||!f?e:{v:e,of:f},m={edits:p(l?C(l):null),doctor:p(c?c.ok?`clean`:c.problems.length:null)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,V.jsx)(P,{page:`installs`,current:e,badges:m,label:`Installs`}),e===`hosts`&&(0,V.jsx)(K,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,V.jsx)(pe,{onAction:i,dataRev:o}),e===`edits`&&(0,V.jsx)(he,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,V.jsx)(_e,{dataRev:o}),e===`server`&&(0,V.jsx)(we,{overview:t,onAction:i,dataRev:o,...s})]})}export{Te as default};
|
|
@@ -1 +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"./api-BxjLd7Qd.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-Bccx3zE8.js";import{n as A}from"./sections-ChwaobfW.js";import{At as j,Dt as M,S as N,bt as P,ct as F,jt as I,kt as L,lt as R}from"./index-DA7BiaE5.js";import{n as z}from"./Dashboard-B-6DTmae.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=I(this,p(e,l,t,null,this));V(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,I(this,a),e)}}else V(e,this,I(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)||(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=I(this,t)),this}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>M(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),M(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=P(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:j(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:j(70)},260).add(a,{opacity:1,duration:300,delay:j(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:j(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=R(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:j(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:N(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:N(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:R(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>M(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>M(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:F(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${F(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>M(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>M(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{$ as r,G as i,K as a}from"./index-DA7BiaE5.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=r(),s=a(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
|
|
@@ -1 +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"./api-BxjLd7Qd.js";import{J as i,R as a,W as o,Y as s,bt as c}from"./index-DA7BiaE5.js";import{t as l}from"./EmptyState-CY5Pm2xy.js";import{t as u}from"./Markdown-C4S4tTA7.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-DwyZUj57.js";import{t as v}from"./DataTable-b9zTShqJ.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=c(()=>r.kits(),[n]),d=h(a,t),{data:f}=c(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(s,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(i,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(s,{})]})}export{P as default};
|
|
@@ -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"./api-BxjLd7Qd.js";import{$ as i,Dt as a,G as o,H as s,J as c,K as l,Q as u,R as d,W as f,X as p,Y as m,_ as h,bt as g,d as _,f as v,ft as y,g as b,h as x,m as ee,p as te,pt as S,v as C,vt as w,y as T}from"./index-DA7BiaE5.js";import{t as ne}from"./EmptyState-CY5Pm2xy.js";import{t as re}from"./FilterInput-qGKNSlxv.js";import{t as ie}from"./Markdown-C4S4tTA7.js";var E=e(t(),1);function ae({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:s}){let c=i(),u=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),d=u.join(`,`),f=l(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=o(u),{prune:h}=f,g=e.length>0;(0,E.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===p&&t.base!==m)},[g,p,m,h]);let _=f.get(`rules`,p),v=_&&_.base===m?_.value:u,y=e=>f.put(`rules`,p,e(v),m),b=e=>v.includes(e),x=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),ee=e=>e.rules.some(e=>b(e.addr)),te=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},S=e=>{let t=e.rules.filter(e=>b(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},C=t.flatMap(e=>e.rules.map(e=>e.addr)),w=C.filter(b),T=w.join(`,`)!==d,ne=`process.5`,re=u.includes(ne)&&!v.includes(ne);return{deployedRules:u,isOn:b,toggleRule:x,packOn:ee,togglePack:te,packState:S,allRules:C,pickedRules:w,dirty:T,losingConsent:re,applyPacks:async()=>{if(!r||!T)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),o=re?`
|
|
2
|
-
|
|
3
|
-
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(s?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=w.length?`${w.length} of ${C.length} doctrine rules`:`no doctrine rules`;await c(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${o}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await a(`install`,{...n,doctrines:e,excludeRules:i})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var D=n();function O({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:l,toggleCol:u=null,renderBody:d,srcLine:f,after:p=null}){let m=(0,E.useId)(),{data:h,error:_,reload:v}=g(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,l],`law-item`),y=t&&(0,D.jsxs)(`div`,{className:`law-expand`,id:m,children:[_?(0,D.jsx)(c,{error:_,onRetry:v}):h?d(h):(0,D.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,D.jsx)(`div`,{className:`law-srcline`,children:f}),p]}),b={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":m,"aria-label":s};return u?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,D.jsx)(`button`,{className:`law-disclosure`,...b,children:o}),(0,D.jsx)(`span`,{className:`toggle-col`,children:u})]}),y]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`button`,{className:i,style:a,"data-addr":e,...b,children:o}),y]})}function oe({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null,after:a=null}){let o=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`law-no`,children:[(0,D.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,D.jsxs)(`span`,{className:`law-name`,children:[(0,D.jsx)(`span`,{children:e.name}),e.ess?(0,D.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,D.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,D.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,D.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,D.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,D.jsx)(O,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:o,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,D.jsx)(ie,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`,after:a})}var k=[`invariants`,`doctrines`];function se({tiers:e,current:t,onPick:n}){return(0,D.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`tier-head`,children:[(0,D.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,D.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,D.jsxs)(`span`,{className:`tier-top`,children:[(0,D.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,D.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,D.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,D.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,D.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,D.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,D.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&k.includes(e.key)?(0,D.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,D.jsx)(`div`,{className:a,children:i},e.key)})})}function ce({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1,install:i=null}){let a=i?`off · ${i.host} ${i.scope}`:`off`,o=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(b(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),s=Math.max(1,...o.map(([,e])=>e));return(0,D.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,D.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),o.length?(0,D.jsx)(`ul`,{className:`gate-list`,children:o.map(([e,r,i])=>{let o=b(e),c=t[o]?.name||v[o]?.label||o;return(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,D.jsxs)(`span`,{className:`gate-top`,children:[(0,D.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:c}),(0,D.jsx)(`span`,{className:`mono dim`,children:o}),i&&(0,D.jsx)(`span`,{className:`mono off`,children:a}),(0,D.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,D.jsx)(d,{value:r,max:s,label:`${c} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,D.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,D.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function le({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,losingConsent:l}=t,u=Math.max(1,...e.map(e=>e.rules.length));return(0,D.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,D.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,D.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,D.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,D.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,D.jsx)(d,{value:t,max:u,label:`${e.title} rules on`}),(0,D.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,D.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>s(e)}):null]},e.pack)})}):(0,D.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,D.jsxs)(D.Fragment,{children:[l&&(0,D.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,D.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,D.jsx)(`code`,{children:`git commit`}),` and `,(0,D.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,D.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:c?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}var ue=`ont:ownership`,de=e=>e===`ownership`?ue:e;function fe(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=h(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:x(n.name),c:T[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function A(e){let t=S(e.dataRev),[n,i]=y(`laws`,t),{data:a}=g(()=>n?r.overview(w(n)).catch(()=>null):Promise.resolve(null),[n?.id??``,e.dataRev]),o=n&&a?.install?.host===n.host&&a.install.path===n.path?a:null,s=n?o:e.overview,c=t!==null&&(!n||o!==null);return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(p,{className:`page-pick`,installs:t,value:n,onChange:i,label:`Constitution of:`}),(0,D.jsx)(j,{...e,overview:s,pair:w(n),onAction:c?e.onAction:void 0},n?.id??`none`)]})}function j({selected:e,overview:t,setup:n,onAction:o,dataRev:l,pair:p}){let y=i(),{data:S,error:w}=g(()=>r.catalog(`laws`,p),p?[l,p.host,p.path]:[l],`catalog:laws`),{data:ie}=s(l,p),[O,k]=(0,E.useState)(`all`),[A,j]=(0,E.useState)(``),[M,pe]=(0,E.useState)(`all`),[me,he]=(0,E.useState)(()=>new Set),N=de(e)||null,ge=e=>a(N===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),P=t?.install,F=!!(P&&o),[_e,ve]=(0,E.useState)(0),ye=(0,E.useRef)(null);(0,E.useEffect)(()=>{if(!N)return;let e=requestAnimationFrame(()=>{let e=document.querySelector(`[data-addr="${CSS.escape(N)}"]`);if(!e)return;let t=ye.current===N;ye.current=null;let n=e.getBoundingClientRect();if(t||n.top<80||n.bottom>window.innerHeight){let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView?.({block:`center`,behavior:t?`auto`:`smooth`})}t&&(e.classList.remove(`law-flash`),e.offsetWidth,e.classList.add(`law-flash`))});return()=>cancelAnimationFrame(e)},[N,_e,S]);let I=S?.items||[],L=fe(I),R=e=>t?.install?.[v[e].key]!==!1,be=R(`IV`),z=ae({items:I,packs:L,install:P,canApply:F,onAction:o,gateArmed:be}),{deployedRules:B,isOn:V,toggleRule:xe,packOn:Se,packState:Ce,allRules:H}=z;if(w)return(0,D.jsx)(c,{error:w});if(!S)return(0,D.jsx)(m,{});let U={ontology:S.nouns?.ontology||`Ethos`,law:S.nouns?.law||`Dictate`,laws:S.nouns?.laws||`Dictates`,doctrines:S.nouns?.doctrines||`Doctrines`},W=I.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:e.name===ue&&P?x(`ownership`,P):`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),G=I.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&C[e.klass]?e.klass:`craft`,r=h(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:x(e.name,t?.install),cat:n,c:C[n].c,off:r.retired,src:`laws/universal.md`}}),K=F?[{addr:`ownership`,name:v.ownership.label,latin:``,ess:``,enf:x(`ownership`,P)}]:[],we=e=>{let t=V(e.addr),n=B.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Te=L.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!B.includes(e.addr)).map(e=>e.addr)),Ee=async e=>{if(!F)return;let{key:t,label:n}=v[e],r=n.toLowerCase(),i=!R(e),a=`${P.host} · ${P.scope}`,s=z.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await y((i?`Re-arm the ${r} on ${a}? ${_[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${a}? ${_[e].off} It rebuilds in place, non-destructive.`)+s,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&o(`install`,{...P,[t]:i})},De=e=>(0,D.jsx)(`button`,{type:`button`,className:`sw-toggle${R(e)?` on`:``}`,role:`switch`,"aria-checked":R(e),"aria-label":v[e].label,onClick:()=>Ee(e)}),Oe=e=>String(e.addr).includes(`.`)&&V(e.addr)!==B.includes(e.addr),q=(e,t=M)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||B.includes(e.addr)):Oe(e)),J=A.trim().toLowerCase(),Y=e=>q(e)&&(!J||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(J)),ke=e=>{let t=Ie[e];(String(e).includes(`.`)?O===`invariants`:t&&O===`doctrines`)&&k(`all`),t&&!q(t)&&pe(`all`),t&&!Y(t)&&j(``),ye.current=de(e),ve(e=>e+1),a(`#/item/law/${encodeURIComponent(e)}`)},X={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))X[b(e)]=t;let Ae=e=>X[e.addr]?{...e,asks:`${X[e.addr]} ask${X[e.addr]===1?``:`s`}`}:e,Z=G.filter(e=>!e.retired).length,Q=B.length,je=e=>{let t=e.filter(e=>v[e.addr]&&!R(e.addr)).length;return t?[`${t} gate${t===1?``:`s`} off`,`warn`]:[`always`,`ok`]},Me=H.length-Q,$=ie?.stats,Ne={ethos:{name:U.ontology,n:W.length,fill:1,sub:`${W.length} sections`,pill:je(K)},invariants:{name:U.laws,n:Z,fill:G.length?Z/G.length:0,sub:G.length>Z?`${Z} active · ${G.length-Z} retired`:`${Z} active`,pill:je(G)},doctrines:{name:U.doctrines,n:Q,fill:H.length?Q/H.length:0,sub:`${Q} rules · ${L.filter(e=>e.active).length} of ${L.length} packs`,pill:Me>0?[`${Me} excluded`,`warn`]:[`all on`,`ok`]},yours:{name:`Your rules`,n:$?.rules??0,fill:$?.max_rules?$.rules/$.max_rules:0,sub:$?`${$.rules} of ${$.max_rules} · ${$.tokens}/${$.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},Pe=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,U.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Fe=te.map(e=>({key:e.key,...Ne[e.key],rule:Pe(e.against)})),Ie=Object.fromEntries([...G,...L.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Le=[[`all`,`All`,G.length+H.length],[`invariants`,U.laws,G.length],[`doctrines`,U.doctrines,H.length]],Re=O===`all`||O===`invariants`,ze=O===`all`||O===`doctrines`,Be=[...K,...Re?G:[],...ze?L.flatMap(e=>e.rules):[]],Ve=[[`gated`,`Gated`,Be.filter(e=>q(e,`gated`)).length],[`changed`,`Changed`,Be.filter(e=>q(e,`changed`)).length]],He=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,Ue=e=>M!==`changed`&&me.has(e)&&He(N)!==e,We=e=>{let t=Ue(e);he(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&He(N)===e&&a(`#/laws`)},Ge=L.flatMap(e=>e.rules.filter(Oe).map(e=>({...e,plus:V(e.addr)}))),Ke=F&&L.length>0&&z.dirty,qe=()=>{pe(`changed`),O===`invariants`&&k(`all`),j(``)},Je=(e,t)=>(0,D.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,D.jsx)(`h2`,{className:`tier-h`,children:e}),(0,D.jsx)(`span`,{className:`mono dim`,children:t})]}),Ye=G.filter(Y),Xe=(J||M!==`all`?K.filter(Y).length:0)+(Re?Ye.length:0)+(ze?L.reduce((e,t)=>e+t.rules.filter(Y).length,0):0),Ze=Ae(K[0]||{}).asks,Qe=K.length>0&&(0,D.jsxs)(`div`,{className:`law-gate`,children:[(0,D.jsxs)(`span`,{className:`law-name`,children:[(0,D.jsx)(`span`,{children:v.ownership.label}),Ze?(0,D.jsx)(`span`,{className:`law-asks mono`,children:Ze}):null,(0,D.jsx)(`span`,{className:`law-princ`,children:_.ownership.desc})]}),De(`ownership`)]});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(f,{eyebrow:P?[t?.theme,P.footprint&&`${P.footprint} footprint`,P.host,P.scope].filter(Boolean).join(` · `):null,title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,actions:(0,D.jsx)(re,{className:`law-filter`,value:A,onChange:j,placeholder:`Filter rules`,label:`Filter rules`})}),(0,D.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,D.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,D.jsx)(se,{tiers:Fe,current:O,onPick:k}),(0,D.jsx)(`div`,{className:`ladder-tail`,children:ee.map((e,t)=>(0,D.jsxs)(`span`,{className:`ladder-low`,children:[(0,D.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,te.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,D.jsxs)(`div`,{className:`split`,children:[(0,D.jsxs)(`section`,{className:`panel flush law-wrap${F?` with-toggle`:``}`,"aria-label":`Rules`,children:[W.length>0&&(0,D.jsxs)(D.Fragment,{children:[Je(U.ontology,`ontology/universal.md`),W.map(e=>(0,D.jsx)(oe,{law:e,rev:l,isOpen:N===e.addr,onToggle:()=>ge(e.addr),after:e.addr===ue?Qe:null},e.addr))]}),(0,D.jsxs)(`div`,{className:`law-toolbar`,children:[(0,D.jsx)(u,{"aria-label":`Show`,children:Le.map(([e,t,n])=>(0,D.jsxs)(`button`,{type:`button`,className:O===e?`on`:``,"aria-pressed":O===e,onClick:()=>k(e),children:[t,` `,(0,D.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,D.jsx)(u,{"aria-label":`Narrow`,children:Ve.map(([e,t,n])=>(0,D.jsxs)(`button`,{type:`button`,className:M===e?`on`:``,"aria-pressed":M===e,onClick:()=>pe(M===e?`all`:e),children:[t,` `,(0,D.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,D.jsxs)(`div`,{className:`law-rowhead`,children:[(0,D.jsx)(`span`,{children:`No.`}),(0,D.jsx)(`span`,{children:`Rule`}),(0,D.jsx)(`span`,{children:`Latin name`}),(0,D.jsx)(`span`,{children:`Status`}),(0,D.jsx)(`span`,{children:`Enforced by`})]}),Re&&Ye.length>0&&(0,D.jsxs)(D.Fragment,{children:[Je(U.laws,`laws/universal.md`),Ye.map(e=>(0,D.jsx)(oe,{law:Ae(e),rev:l,isOpen:N===e.addr,onToggle:()=>ge(e.addr),toggleCol:!F||e.retired?null:v[e.addr]?De(e.addr):(0,D.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),ze&&L.map(e=>{let t=e.rules.filter(Y);if(!t.length)return null;let n=Ue(e.pack),r=e.rules.filter(e=>V(e.addr)).length;return(0,D.jsxs)(`div`,{className:`pack-wrap${Se(e)?``:` pack-off`}`,children:[(0,D.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,D.jsx)(`h2`,{className:`tier-h`,style:{"--cc":T[e.pack]},children:(0,D.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>We(e.pack),children:e.title})}),(0,D.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,D.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,D.jsx)(`span`,{className:`pack-fill`,children:(0,D.jsx)(d,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,D.jsx)(`span`,{className:`pack-state mono`,children:Ce(e)})]}),!e.active&&!F&&(0,D.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,L.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Te.length>0&&` --exclude-rules ${Te.join(`,`)}`]}),!n&&t.map(e=>(0,D.jsx)(oe,{law:Ae(we(e)),rev:l,isOpen:N===e.addr,onToggle:()=>ge(e.addr),toggleCol:F?(0,D.jsx)(`button`,{type:`button`,className:`sw-toggle${V(e.addr)?` on`:``}`,role:`switch`,"aria-checked":V(e.addr),"aria-label":`${e.name} rule`,onClick:()=>xe(e.addr)}):null},e.addr))]},e.pack)}),Xe===0&&(0,D.jsx)(ne,{title:J||M!==`all`?`No matching rules`:`Nothing in this tier`,children:J?(0,D.jsxs)(D.Fragment,{children:[`Nothing matches “`,A.trim(),`”.`]}):M===`all`?(0,D.jsx)(D.Fragment,{children:`This install predates the tier.`}):(0,D.jsxs)(D.Fragment,{children:[`No `,M,` rule in this tier.`]})})]}),(0,D.jsxs)(`aside`,{className:`aside-stack`,children:[(0,D.jsx)(le,{packs:L,sel:z,canApply:F,install:P,gateArmed:be}),(0,D.jsx)(ce,{gates:n?.gates,byAddr:Ie,onJump:ke,disarmed:e=>!!v[e]&&!R(e),install:t?.install})]})]}),Ke&&(0,D.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,D.jsxs)(`span`,{className:`law-bar-n`,children:[Ge.length,` unapplied change`,Ge.length===1?``:`s`]}),(0,D.jsx)(`span`,{className:`law-bar-list`,children:Ge.map(e=>(0,D.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,D.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:qe,children:`Review changes`}),(0,D.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{pe(`all`),z.revert()},children:`Revert`}),(0,D.jsxs)(`button`,{type:`button`,className:`btn`,onClick:z.applyPacks,children:[`Apply (`,z.pickedRules.length,`/`,H.length,` rules)`]})]})]})}export{A as default};
|
|
@@ -1,2 +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"./api-BxjLd7Qd.js";import{i}from"./motion-Bccx3zE8.js";import{n as a,t as o}from"./sections-ChwaobfW.js";import{$ as s,Dt as ee,J as te,Q as ne,V as re,_t as ie,b as c,bt as l,pt as ae,rt as u,x as d}from"./index-DA7BiaE5.js";import{t as f}from"./EmptyState-CY5Pm2xy.js";import{a as oe,c as se,i as ce,o as le,r as ue,s as de,t as fe}from"./RailCats-D5weYPCS.js";import{t as pe}from"./Markdown-C4S4tTA7.js";var p=e(t(),1),m=n();function me({load:e}){let t=String(e||`lazy`).toLowerCase();return(0,m.jsx)(`span`,{className:`mf-load mf-load-${t===`eager`?`ok`:t===`exclude`?`warn`:`muted`}`,children:t})}function h({entries:e}){return e.length?(0,m.jsxs)(`table`,{className:`mf-entries`,children:[(0,m.jsx)(`thead`,{className:`sr-only`,children:(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`th`,{scope:`col`,children:`Path`}),(0,m.jsx)(`th`,{scope:`col`,children:`Load`}),(0,m.jsx)(`th`,{scope:`col`,children:`Description`})]})}),(0,m.jsx)(`tbody`,{children:e.map((e,t)=>{let n=String(e.load).toLowerCase()===`exclude`;return(0,m.jsxs)(`tr`,{children:[(0,m.jsx)(`td`,{className:`mf-path mono ${n?`mf-struck`:``}`,children:e.path||`·`}),(0,m.jsx)(`td`,{className:`mf-load-cell`,children:(0,m.jsx)(me,{load:e.load})}),(0,m.jsx)(`td`,{className:`mf-edesc`,children:e.description||``})]},`${e.path||t}-${t}`)})})]}):null}function g({wiki:e}){let t=Array.isArray(e.entries)?e.entries:[],n=Array.isArray(e.protected)?e.protected:[];return(0,m.jsxs)(`div`,{className:`mf-vault`,children:[(0,m.jsxs)(`div`,{className:`mf-vault-head`,children:[(0,m.jsx)(`div`,{className:`mf-vault-name`,children:e.name||`wiki`}),e.path?(0,m.jsx)(`code`,{className:`mf-vault-path mono`,children:e.path}):null]}),e.description?(0,m.jsx)(`p`,{className:`mf-vault-desc`,children:e.description}):null,(0,m.jsxs)(`div`,{className:`mf-roles`,children:[e.conventions?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(u,{name:`skill`,className:`glyph`}),` conventions: `,e.conventions]}):null,e.inbox?(0,m.jsxs)(`span`,{className:`mf-role`,children:[(0,m.jsx)(u,{name:`notebook`,className:`glyph`}),` inbox: `,e.inbox]}):null,n.map(e=>(0,m.jsxs)(`span`,{className:`mf-role mf-role-danger`,children:[(0,m.jsx)(u,{name:`law`,className:`glyph`}),` protected: `,e]},e))]}),(0,m.jsx)(h,{entries:t})]})}function _({body:e}){let[t,n]=(0,p.useState)(!1),r=(0,p.useId)();return e?(0,m.jsxs)(`div`,{className:`mf-raw`,children:[(0,m.jsxs)(`button`,{type:`button`,className:`mf-raw-toggle`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),children:[(0,m.jsx)(u,{name:`chevron`,className:`glyph mf-caret ${t?`on`:``}`}),`Raw source`]}),t?(0,m.jsx)(`pre`,{id:r,className:`mf-raw-pre`,children:e.replace(/^```json\n|\n```$/g,``)}):null]}):null}function he({manifest:e,body:t,name:n}){if(!e)return(0,m.jsx)(`pre`,{className:`mf-raw-pre`,children:(t||``).replace(/^```json\n|\n```$/g,``)});if(e.kind===`wiki`){let n=e.wikis||[];return n.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[n.map((e,t)=>(0,m.jsx)(g,{wiki:e},e.name||t)),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No wiki declared yet`}),(0,m.jsxs)(`p`,{children:[`A wiki is your machine-wide knowledge base — an Obsidian vault or any folder of linked markdown the agent reads from and writes back to. Declare one in`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` to switch it on.`]}),(0,m.jsx)(`a`,{className:`btn ghost sm`,href:`#/docs/wiki`,children:`How to configure a wiki`}),(0,m.jsx)(_,{body:t})]})}let r=e.context||[];return r.length?(0,m.jsxs)(`div`,{className:`mf-doc`,children:[(0,m.jsx)(h,{entries:r}),(0,m.jsx)(_,{body:t})]}):(0,m.jsxs)(`div`,{className:`mf-empty`,children:[(0,m.jsx)(`div`,{className:`mf-empty-title`,children:`No project context declared`}),(0,m.jsxs)(`p`,{children:[`Point the agent at the docs for this project by adding entries to`,` `,(0,m.jsx)(`code`,{className:`mono`,children:n||`context.json`}),` — each with a`,` `,(0,m.jsx)(`code`,{className:`mono`,children:`path`}),`, a `,(0,m.jsx)(`code`,{className:`mono`,children:`load`}),` mode (eager or lazy), and a description.`]}),(0,m.jsx)(_,{body:t})]})}var v={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ge={advocate:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M16 50h14M23 50V14`}),(0,m.jsx)(`path`,{className:`ag-wave ag-f`,d:`M23 15h20l-5 7.5 5 7.5H23z`}),(0,m.jsx)(`path`,{className:`ag-call`,d:`M47 38a6 6 0 0 1 0 8M51 35a11 11 0 0 1 0 14`})]}),architect:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{x:`14`,y:`14`,width:`36`,height:`32`,rx:`2`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M20 40V22h12v9h12v9z`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M32 31v9`}),(0,m.jsx)(`path`,{d:`M14 52h36M14 50v4M50 50v4`,opacity:`.5`})]}),developer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-f`,x:`10`,y:`14`,width:`44`,height:`36`,rx:`4`}),(0,m.jsx)(`path`,{d:`M10 22h44`,opacity:`.5`}),(0,m.jsx)(`circle`,{cx:`15`,cy:`18`,r:`1`}),(0,m.jsx)(`circle`,{cx:`19`,cy:`18`,r:`1`}),(0,m.jsx)(`path`,{className:`ag-nudge-l`,d:`M24 30l-6 6 6 6`}),(0,m.jsx)(`path`,{className:`ag-nudge-r`,d:`M40 30l6 6-6 6`}),(0,m.jsx)(`path`,{className:`ag-blink`,d:`M30 42h5`})]}),"devops-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`,opacity:`.3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 32c-5-9-18-9-18 0s13 9 18 0c5-9 18-9 18 0s-13 9-18 0z`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`3`})]}),"docker-expert":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`14`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`27`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`36`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`20`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`34`,y:`25`,width:`10`,height:`9`}),(0,m.jsx)(`path`,{d:`M8 52c5 0 5-3 10-3s5 3 10 3 5-3 10-3 5 3 10 3 5-3 10-3`,opacity:`.5`})]}),docs:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M16 10h22l8 8v36H16z`}),(0,m.jsx)(`path`,{d:`M38 10v8h8`,opacity:`.5`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M21 26h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-late`,pathLength:`100`,d:`M21 33h18`}),(0,m.jsx)(`path`,{className:`ag-draw ag-later`,pathLength:`100`,d:`M21 40h11`}),(0,m.jsx)(`g`,{className:`ag-write`,children:(0,m.jsx)(`path`,{d:`M40 44l12-20 3 2-12 20-4 1z`})})]}),empiricist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 12v40h40`,opacity:`.5`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`18`,y:`36`,width:`6`,height:`14`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`29`,y:`28`,width:`6`,height:`22`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`40`,y:`20`,width:`6`,height:`30`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M16 34l12-8 10 3 12-14`})]}),explorer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`18`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M32 10v4M32 50v4M10 32h4M50 32h4`}),(0,m.jsxs)(`g`,{className:`ag-search`,children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 18l5 14h-10z`}),(0,m.jsx)(`path`,{d:`M32 18l5 14-5 14-5-14z`})]}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`2`})]}),framer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-frame`,children:(0,m.jsx)(`path`,{d:`M12 22V12h10M42 12h10v10M52 42v10H42M22 52H12V42`})}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`7`,opacity:`.6`}),(0,m.jsx)(`path`,{d:`M32 22v6M32 36v6M22 32h6M36 32h6`,opacity:`.6`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`1.5`})]}),historian:(0,m.jsxs)(`g`,{className:`ag-turn`,children:[(0,m.jsx)(`path`,{d:`M20 12h24M20 52h24`}),(0,m.jsx)(`path`,{d:`M22 12c0 12 20 12 20 20s-20 8-20 20M42 12c0 12-20 12-20 20s20 8 20 20`}),(0,m.jsx)(`path`,{className:`ag-drain ag-f`,d:`M25 17h14c-1 6-5 9-7 11-2-2-6-5-7-11z`}),(0,m.jsx)(`path`,{className:`ag-fill ag-f`,d:`M24 49h16c-1-5-5-8-8-9-3 1-7 4-8 9z`})]}),operator:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 42a20 20 0 0 1 40 0`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M40 24a20 20 0 0 1 12 18`,strokeWidth:`4`,opacity:`.7`}),(0,m.jsx)(`path`,{d:`M16 30l3 2M32 22v4M48 30l-3 2`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-gauge`,children:(0,m.jsx)(`path`,{d:`M32 42l10-13`})}),(0,m.jsx)(`circle`,{cx:`32`,cy:`42`,r:`3`}),(0,m.jsx)(`path`,{d:`M22 50h20`,opacity:`.5`})]}),pragmatist:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M32 14v36M22 50h20`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`14`,r:`2`}),(0,m.jsxs)(`g`,{className:`ag-tilt`,children:[(0,m.jsx)(`path`,{d:`M14 18h36`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M14 18l-5 12h10zM50 18l-5 12h10z`})]})]}),"kubernetes-specialist":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`32`,cy:`32`,r:`16`}),(0,m.jsx)(`path`,{d:`M32 8v13M32 43v13M8 32h13M43 32h13M15 15l9 9M40 40l9 9M49 15l-9 9M24 40l-9 9`,opacity:`.6`}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`5`})]}),"memory-curator":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`rect`,{className:`ag-rise ag-f`,x:`17`,y:`16`,width:`14`,height:`20`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-late ag-f`,x:`25`,y:`12`,width:`14`,height:`24`,rx:`1`}),(0,m.jsx)(`rect`,{className:`ag-rise ag-later ag-f`,x:`33`,y:`18`,width:`14`,height:`18`,rx:`1`}),(0,m.jsx)(`path`,{d:`M12 32h40v16a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2z`}),(0,m.jsx)(`path`,{d:`M26 40h12`,opacity:`.6`})]}),researcher:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`16`}),(0,m.jsx)(`path`,{d:`M14 34h32M30 18c-6 5-6 27 0 32`,opacity:`.5`}),(0,m.jsx)(`ellipse`,{className:`ag-spin`,cx:`30`,cy:`34`,rx:`7`,ry:`16`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`circle`,{cx:`50`,cy:`14`,r:`3`})})]}),reviewer:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h30M12 26h40M12 34h24M12 42h34`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-mark`,d:`M42 30l3 3 6-6`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`22`,cy:`30`,r:`9`}),(0,m.jsx)(`path`,{d:`M29 37l8 8`,strokeWidth:`3`})]})]}),performance:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h8M30 10v6M44 18l3-3`}),(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`34`,r:`18`}),(0,m.jsx)(`path`,{d:`M30 19v3M45 34h-3M30 49v-3M15 34h3`,opacity:`.6`}),(0,m.jsx)(`g`,{className:`ag-orbit`,children:(0,m.jsx)(`path`,{d:`M30 34V22`})}),(0,m.jsx)(`circle`,{cx:`30`,cy:`34`,r:`2`})]}),security:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 8l18 6v13c0 12-8 21-18 26-10-5-18-14-18-26V14z`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M24 31l6 6 11-11`})]}),skeptic:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M12 14h40v28H30l-10 8v-8h-8z`}),(0,m.jsxs)(`g`,{className:`ag-lean`,children:[(0,m.jsx)(`path`,{d:`M27 23a5 5 0 1 1 7 4.5c-1.5.8-2 2-2 3.5v1`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`36`,r:`1.2`})]})]}),"spring-boot-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M22 20a16 16 0 1 0 20 0`}),(0,m.jsx)(`path`,{className:`ag-pulse`,d:`M32 12v18`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 50c0-8 5-12 13-12 0 8-5 12-13 12z`})]}),"spring-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 18h26M12 26h18M12 34h22M12 42h14`,opacity:`.4`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M42 28c0-8 4-12 11-12 0 8-4 12-11 12z`}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`24`,cy:`32`,r:`9`}),(0,m.jsx)(`path`,{d:`M31 39l8 8`,strokeWidth:`3`})]})]}),"spring-security":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-ripple`,d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`path`,{d:`M22 28v-6a10 10 0 0 1 20 0v6`}),(0,m.jsx)(`rect`,{className:`ag-f`,x:`16`,y:`28`,width:`32`,height:`24`,rx:`4`}),(0,m.jsx)(`circle`,{cx:`32`,cy:`38`,r:`3`}),(0,m.jsx)(`path`,{className:`ag-draw`,pathLength:`100`,d:`M32 41v6`})]}),"react-engineer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{className:`ag-spin`,children:[(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(60 32 32)`}),(0,m.jsx)(`ellipse`,{cx:`32`,cy:`32`,rx:`20`,ry:`8`,transform:`rotate(120 32 32)`})]}),(0,m.jsx)(`circle`,{className:`ag-pulse ag-f`,cx:`32`,cy:`32`,r:`4`})]}),"react-reviewer":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`g`,{opacity:`.4`,children:[(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(60 30 30)`}),(0,m.jsx)(`ellipse`,{cx:`30`,cy:`30`,rx:`18`,ry:`7`,transform:`rotate(120 30 30)`})]}),(0,m.jsxs)(`g`,{className:`ag-sweep`,children:[(0,m.jsx)(`circle`,{className:`ag-f`,cx:`30`,cy:`30`,r:`8`}),(0,m.jsx)(`path`,{d:`M36 36l9 9`,strokeWidth:`3`})]})]}),steward:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M12 52h40`,opacity:`.5`}),(0,m.jsx)(`path`,{d:`M22 52c2-3 6-4 10-4s8 1 10 4`,opacity:`.4`}),(0,m.jsxs)(`g`,{className:`ag-grow`,children:[(0,m.jsx)(`path`,{d:`M32 50V26`}),(0,m.jsx)(`path`,{className:`ag-sway ag-f`,d:`M32 32c0-9 6-14 15-14 0 9-6 14-15 14z`}),(0,m.jsx)(`path`,{className:`ag-sway ag-late ag-f`,d:`M32 38c0-7-5-11-12-11 0 7 5 11 12 11z`})]})]}),tester:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{d:`M26 10h12M28 10v14L15 48a3 3 0 0 0 2.6 4.5h28.8A3 3 0 0 0 49 48L36 24V10`}),(0,m.jsx)(`path`,{className:`ag-f ag-slosh`,d:`M20 40h24l4.5 8.5H15.5z`}),(0,m.jsx)(`circle`,{className:`ag-bubble`,cx:`28`,cy:`44`,r:`2`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-late`,cx:`35`,cy:`46`,r:`1.5`}),(0,m.jsx)(`circle`,{className:`ag-bubble ag-later`,cx:`31`,cy:`42`,r:`1`})]}),"user-advocate":(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`circle`,{cx:`24`,cy:`20`,r:`6`}),(0,m.jsx)(`path`,{d:`M12 50c0-9 5-15 12-15 4 0 7 1.5 9 4`}),(0,m.jsx)(`path`,{className:`ag-beat ag-f`,d:`M44 52s-10-6-10-12.5a5 5 0 0 1 10-1.5 5 5 0 0 1 10 1.5C54 46 44 52 44 52z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M48 22v4M46 24h4`})]}),visionary:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`g`,{className:`ag-rays`,opacity:`.5`,children:(0,m.jsx)(`path`,{d:`M32 6v6M32 52v6M6 32h6M52 32h6M13.6 13.6l4.2 4.2M46.2 46.2l4.2 4.2M13.6 50.4l4.2-4.2M46.2 17.8l4.2-4.2`})}),(0,m.jsx)(`path`,{className:`ag-f ag-pulse`,d:`M32 16l4.7 10.4 11.3 1.2-8.5 7.6 2.4 11.1L32 40.6l-9.9 5.7 2.4-11.1-8.5-7.6 11.3-1.2z`}),(0,m.jsx)(`path`,{className:`ag-twinkle`,d:`M50 8v6M47 11h6`})]})},y=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`path`,{className:`ag-f`,d:`M32 12l17 10v20L32 52 15 42V22z`}),(0,m.jsx)(`circle`,{className:`ag-pulse`,cx:`32`,cy:`32`,r:`6`})]});function _e({name:e,size:t=64}){return(0,m.jsxs)(`svg`,{className:`agent-glyph`,viewBox:`0 0 64 64`,width:t,height:t,"aria-hidden":`true`,...v,children:[(0,m.jsx)(`circle`,{className:`ag-disc`,cx:`32`,cy:`32`,r:`31`}),(0,m.jsx)(`circle`,{className:`ag-ring`,cx:`32`,cy:`32`,r:`31`,strokeWidth:`1`,strokeDasharray:`2 7`}),ge[e]||y]})}function b({label:e,value:t,delta:n,children:r}){let a=i(Number.isInteger(t)?t:null);return(0,m.jsxs)(`div`,{className:`stat`,children:[(0,m.jsx)(`div`,{className:`stat-label`,children:e}),(0,m.jsx)(`div`,{className:`stat-value mono`,children:a===null?t:Math.round(a)}),n==null?null:(0,m.jsx)(`div`,{className:`stat-delta`,children:n}),r]})}var ve={skills:`skill`,agents:`agent`},x=[`skills`,`agents`,`memory`,`notebook`],ye=new Set([`MEMORY`,`NOTEBOOK`,`README`]),be=e=>e.filter(e=>!ye.has(String(e.name).toUpperCase())).length,xe=(e,t)=>`${t?e/t*100:0}%`,S=e=>e.split(`:`).slice(0,2).join(` `),C=e=>{let[t,n,...r]=e.split(`:`);return{host:t,scope:n,path:r.join(`:`)}},w=e=>ie(C(e)),Se=e=>({"--cc":`var(--cat-${e*2%7})`});function Ce(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 we({section:e,source:t}){return(0,m.jsxs)(`div`,{className:`lib-doc-empty`,children:[(0,m.jsx)(u,{name:a[e].icon,className:`glyph`}),(0,m.jsxs)(`span`,{children:[`This entry is part of the `,a[e].label.toLowerCase(),` convention; see`,` `,(0,m.jsx)(`code`,{className:`mono`,children:t}),`. It has no standalone per-entry document.`]})]})}var Te=e=>e.replace(/\s+/g,` `).trim(),T=e=>e.replace(/^(?:[ \t]*\n)+/,``);function Ee(e,t){let n=e.replace(/\r\n/g,`
|
|
2
|
-
`),r=/^(?:[ \t]*\n)*[ ]{0,3}#[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*(?:\n|$)/.exec(n);if(!r)return{title:null,body:e};let i=T(n.slice(r[0].length)),a=/^(?:>[^\n]*(?:\n|$))+/.exec(i),o=a?Te(a[0].replace(/^>[ \t]?/gm,``)):``,s=t?Te(t):``;return o&&(s===o||s.startsWith(o+` `))&&(i=T(i.slice(a[0].length))),{title:r[1].trim(),body:i}}function De({u:e,usage:t,noCall:n}){if(!e||e.n===0&&!e.last)return(0,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(b,{label:`Used`,value:0,delta:n})});let r=[...new Set(e.installs.map(S))].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,m.jsx)(`div`,{className:`lib-stats`,children:(0,m.jsx)(b,{label:`Used`,value:e.n,delta:o,children:(0,m.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,m.jsx)(`i`,{className:t===29?`today`:``,style:{height:xe(e,a)}},t))})})})}function Oe(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 ke={skills:`skills`,agents:`agents`,memory:`memory`,notebook:`notebook`,wiki:`wiki`,config:`project-context`},Ae=(e,t)=>t||(e&&o.includes(e)?e:o[0]),je=encodeURIComponent;function Me(e){let t=e=>c[e.klass]?e.klass:`personal`,n=d.flatMap(n=>e.filter(e=>t(e)===n).map(e=>({...e,cat:n,group:c[n].label,groupC:c[n].c})));return{rows:n,cats:d.map(e=>({key:e,label:c[e].label,c:c[e].c,n:n.filter(t=>t.cat===e).length})).filter(e=>e.n>0)}}function Ne(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 E({overview:e,section:t,selected:n,dataRev:i,lock:u,base:d,onRulesChanged:me}){let h=s(),[g,_]=(0,p.useState)(()=>Ae(t,u)),[v,ge]=(0,p.useState)(``),[y,b]=(0,p.useState)(`all`),[ye,S]=(0,p.useState)(`all`),[Te,T]=(0,p.useState)(``),[E,Pe]=(0,p.useState)(null),[D,Fe]=(0,p.useState)(null),[Ie,Le]=(0,p.useState)(t);if(t!==Ie){Le(t),T(``);let e=Ae(t,u);e!==g&&(_(e),ge(``),b(`all`),S(`all`))}let[Re,ze]=(0,p.useState)(n);n!==Re&&(ze(n),T(``));let{data:O,error:Be,reload:Ve}=l(()=>r.catalog(g),[g,i],`catalog`),He=u?null:ve[g]||null,Ue=He!==null||g===`memory`||g===`notebook`,{data:We}=l(()=>u?Promise.resolve(null):Promise.all(x.map(e=>r.catalog(e))).catch(()=>null),[u,i]),k=He!==null,{data:A}=l(()=>k?Promise.resolve().then(()=>r.usage()).catch(()=>null):Promise.resolve(null),[k,i],`usage`,{revalidate:!0}),j=k&&!!A?.enabled&&Array.isArray(A.names),Ge=(0,p.useMemo)(()=>new Map((Array.isArray(A?.names)?A.names:[]).map(e=>[`${e.kind}\u0000${e.name}`,e])),[A]),M=e=>j&&Ge.get(`${He}\u0000${e}`)||null,Ke=e=>{let t=M(e.name);return!t||t.n===0&&!t.last},qe=A?.since?`No call since ${A.since}`:`No call recorded yet`,N=O?.section===g&&O?.items||[],P=g===`skills`,Je=P?Me(N):null,F=P?Je.rows:g===`memory`?Ne(N):N,I=n||F[0]?.name||null,L=I?N.find(e=>e.name===I):null,R=L?.type||a[g].type,z=D?.sec===g&&D?.name===I?D.key:null,{data:Ye,error:B}=l(()=>I?z?r.item(R,I,C(z)):r.item(R,I):Promise.resolve(null),[g,I,R,z,i]),V=B?null:Ye,H=V&&V.name===I&&(!z||V.install===z)?V:null,Xe=e=>G&&e?.install?` in ${w(e.install)}`:``,Ze=Te||Be||B,Qe=I?{name:I,title:V?.title||I,desc:V?.desc||``}:null,U=L||Qe,$e=e?.counts||{},et=e=>{if(!x.includes(e))return $e[e]??``;if(e===g&&O?.section===g)return be(N);let t=We?.find(t=>t?.section===e)?.items;return t?be(t):``},W=ae(i),tt=W?.length>1?`of ${ie(W[0])}`:null,G=Ue&&new Set(N.flatMap(e=>e.installs||[])).size>1,nt=[...new Set([...(W||[]).map(e=>e.id),...N.flatMap(e=>e.installs||[])])],K=P?F.filter(e=>y===`all`||e.cat===y):F,rt=j?K.filter(Ke).length:0,it=e=>e.status===`experimental`,at=K.filter(it).length,q=[[`all`,`All`,K.length],...j?[[`used`,`Used`,K.length-rt],[`unused`,`Not used yet`,rt,qe]]:[],...at?[[`experimental`,`Experimental`,at,`Shipped, not yet confirmed by real use`]]:[]],J=q.some(([e])=>e===ye)?ye:`all`,Y=J===`all`?K:J===`experimental`?K.filter(it):K.filter(e=>Ke(e)===(J===`unused`)),ot=j?Math.max(0,...N.map(e=>M(e.name)?.n||0)):0,st=P?1/0:50,X=v.trim().toLowerCase(),Z=X?le(Y,X):Y.slice(0,st),ct=!X&&y===`all`&&J===`all`&&I&&!Z.some(e=>e.name===I)?[...Z,...F.filter(e=>e.name===I)]:Z,lt=e=>d?`${d}/${je(e.name)}`:`#/item/${e.type||a[g].type}/${je(e.name)}`,ut=async()=>{let e=H;if(!e)return;let t=e.name;if(await h(`Forget the memory fact "${t}"${Xe(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`})){T(``);try{await r.memoryDelete(t,e.install?C(e.install):void 0)}catch(e){T(`Could not forget "${t}": ${e.message}`);return}ee(d||`#/section/memory`),Ve()}},dt=async()=>{let e=H;if(!e)return;let t=e.name;if(await h(`Promote "${t}"${Xe(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`})){T(``);try{let n=e.install?C(e.install):void 0,i=await r.rules(n);await r.rulesPromote({name:t,fingerprint:i.fingerprint,delete_memory:!0},n),re(),me?.(),ee(`#/personal/rules`)}catch(e){T(`Could not promote: ${e.message}`),Ve()}}},ft=V?.body?Ee(V.body,V.desc||U?.desc):null,pt=V?.title||U?.title||U?.name,mt=pt===U?.name&&ft?.title?ft.title:pt,ht=O?.section===g&&N.length===0,gt=V?.status||U?.status,_t=g===`skills`?c[L?.klass]:null,Q=a[g].label,{lede:vt,when:yt}=Oe(V?.desc||U?.desc||``),$=U?V?.source||U.source||(B?null:Ce(g,U.name)):null;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(te,{error:Ze,style:{margin:`0 0 var(--sp-3)`}}),(0,m.jsxs)(`div`,{className:`library lib-dossier${u?` locked`:``}${j?` uses`:``}`,children:[u?null:(0,m.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Library kinds`,children:[(0,m.jsxs)(`div`,{className:`lib-title`,children:[(0,m.jsx)(`h1`,{className:`h`,children:`Library`}),(0,m.jsx)(`span`,{className:`dim`,children:`What the agent knows`})]}),(0,m.jsx)(`nav`,{className:`kind-list`,"aria-label":`Kinds`,children:o.map(e=>(0,m.jsxs)(p.Fragment,{children:[(0,m.jsxs)(`a`,{href:`#/section/${e}`,className:g===e?`on`:``,"aria-current":g===e?`page`:void 0,children:[a[e].label,(0,m.jsx)(`span`,{className:`mono dim`,children:et(e)})]}),e===g&&P&&(0,m.jsx)(fe,{label:`Skill types`,total:N.length,cats:Je.cats,cat:y,onChange:b})]},e))})]}),(0,m.jsxs)(oe,{label:Q,count:X?`${Z.length} of ${Y.length}`:Y.length,q:v,onQ:ge,matched:Z.length,inView:[g,n],extra:(0,m.jsxs)(m.Fragment,{children:[j&&A.since?(0,m.jsxs)(`span`,{className:`mono dim lib-since`,children:[`calls since `,A.since]}):!x.includes(g)&&g!==`laws`&&tt?(0,m.jsx)(`span`,{className:`mono dim lib-since`,children:tt}):null,(0,m.jsxs)(`span`,{className:`lib-legend mono`,children:[G?nt.map((e,t)=>(0,m.jsxs)(`span`,{className:`lk-install`,title:C(e).path,children:[(0,m.jsx)(`i`,{className:`lr-dot`,style:Se(t),"aria-hidden":`true`}),w(e)]},e)):null,(0,m.jsx)(se,{items:N})]})]}),tools:q.length>1?(0,m.jsx)(ne,{"aria-label":`Show`,children:q.map(([e,t,n,r])=>(0,m.jsxs)(`button`,{type:`button`,className:J===e?`on`:``,"aria-pressed":J===e,title:r,onClick:()=>S(e),children:[t,` `,(0,m.jsx)(`span`,{className:`mono`,children:n})]},e))}):null,children:[(0,m.jsx)(ue,{rows:ct,activeName:U?.name,hrefOf:lt,pills:j||G?e=>{let t=M(e.name)?.n||0,n=G?(0,m.jsx)(`span`,{className:`lr-dots`,children:nt.map((t,n)=>e.installs?.includes(t)?(0,m.jsx)(`span`,{className:`lr-dot lr-install`,style:Se(n),title:`${w(t)} — ${C(t).path}`,children:(0,m.jsx)(`span`,{className:`sr-only`,children:w(t)})},t):(0,m.jsx)(`span`,{className:`lr-dot off`,"aria-hidden":`true`},t))}):null;return j?(0,m.jsxs)(m.Fragment,{children:[n,(0,m.jsxs)(`span`,{className:`lr-use`,children:[(0,m.jsx)(`span`,{className:`ub-trk`,"aria-hidden":`true`,children:(0,m.jsx)(`i`,{style:{width:xe(t,ot)}})}),(0,m.jsxs)(`span`,{className:t?`mono`:`mono dim`,children:[t,(0,m.jsx)(`span`,{className:`sr-only`,children:t===1?` call`:` calls`})]})]})]}):n}:void 0}),!X&&N.length>st&&(0,m.jsxs)(`div`,{className:`lib-more`,children:[`Showing `,st,` of `,N.length,`; type to search the rest.`]}),ht&&(g===`wiki`?(0,m.jsxs)(f,{title:`No wiki entries`,action:(0,m.jsx)(`a`,{href:`#/section/config`,children:`Open the setup files`}),docs:{href:`#/docs/wiki`,label:`How to configure a wiki →`},children:[`Declare a wiki in `,(0,m.jsx)(`code`,{className:`mono`,children:`geneseed-wiki.jsonc`}),` and its entries appear here.`]}):(0,m.jsx)(f,{title:`Nothing here yet`,children:`Once the harness produces entries they appear here.`}))]}),(0,m.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:U?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(`div`,{className:`reader-tags`,children:[(0,m.jsx)(`span`,{className:`tag acc`,children:Q.replace(/s$/,``)}),_t?(0,m.jsx)(`span`,{className:`tag`,children:_t.label}):null,V?.kit??U.kit?(0,m.jsx)(ce,{name:V?.kit??U.kit}):null,(0,m.jsx)(de,{status:gt,withHint:!0}),$?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`mono dim reader-src`,children:$}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText($),Pe({src:$,ok:!0})}catch{Pe({src:$,ok:!1})}},children:E?.src===$?E.ok?`Copied`:`Copy failed`:`Copy path`})]}):null]}),(0,m.jsxs)(`div`,{className:`reader-head`,children:[(0,m.jsx)(`h2`,{className:`reader-title`,children:mt}),g===`agents`?(0,m.jsx)(_e,{name:U.name}):null]}),(0,m.jsxs)(`div`,{className:`reader-intro${j?` with-stats`:``}`,children:[(0,m.jsxs)(`div`,{className:`reader-intro-text`,children:[vt?(0,m.jsx)(`p`,{className:`reader-lede`,children:vt}):null,yt?(0,m.jsxs)(`section`,{className:`reader-when`,children:[(0,m.jsx)(`h3`,{className:`reader-when-h`,children:`Use when`}),(0,m.jsx)(`p`,{children:yt})]}):null]}),j?(0,m.jsx)(De,{u:M(U.name),usage:A,noCall:qe}):null]}),g===`memory`&&H&&U.name!==`MEMORY`&&U.name!==`README`&&(0,m.jsxs)(`div`,{className:`row gap-8`,children:[(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:dt,title:`Turn this lesson into a standing trial rule in user-rules.md`,children:`Promote to rule`}),(0,m.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:ut,children:`Forget this fact`})]}),V?.installs?.length>1&&V.installs.includes(V.install)?(0,m.jsxs)(`label`,{className:`row gap-8 lib-copy`,children:[(0,m.jsx)(`span`,{className:`dim`,children:`Viewing copy from:`}),(0,m.jsx)(`select`,{className:`sel`,value:z||V.install,onChange:e=>Fe({sec:g,name:I,key:e.target.value}),children:V.installs.map(e=>(0,m.jsx)(`option`,{value:e,title:C(e).path,children:w(e)},e))}),(0,m.jsx)(`span`,{className:`dim`,children:`this entry only`})]}):null,(0,m.jsx)(`hr`,{className:`hr`}),B?(0,m.jsxs)(`p`,{className:`sub`,children:[`No `,Q.replace(/s$/,``).toLowerCase(),` named `,(0,m.jsx)(`em`,{children:U.name}),` could be read in this install.`]}):U?.kind===`manifest`||V?.manifest!==void 0?V?(0,m.jsx)(he,{manifest:V.manifest,body:V.body,name:U.name}):(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):V?.body?(0,m.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,m.jsx)(pe,{body:ft.body,links:V.links||[]})}):V===null&&I?(0,m.jsx)(`p`,{className:`sub`,children:`Loading…`}):(0,m.jsx)(we,{section:g,source:Ce(g,U.name)}),ke[g]?(0,m.jsx)(`div`,{className:`reader-links`,children:(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/docs/${ke[g]}`,children:[`About `,Q.toLowerCase(),` in Docs`]})}):null]}):ht?null:(0,m.jsx)(f,{title:`Select an entry`,children:`Pick something from the list to read it.`})})]})]})}export{Ee as bodyHead,E as default,Ne as groupMemory,w as installLabel,C as installOfKey,Me as splitSkills,Oe as splitWhen};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,r}from"./sections-ChwaobfW.js";import{F as i,at as a}from"./index-DA7BiaE5.js";import{n as o,r as s}from"./Dashboard-B-6DTmae.js";e();var c=t(),l=14;function u({title:e,right:t,children:n,span:r}){return(0,c.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,c.jsxs)(`div`,{className:`c-mod-head`,children:[(0,c.jsx)(`span`,{className:`c-tab`}),(0,c.jsx)(`h3`,{children:e}),t&&(0,c.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,c.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function d({label:e,value:t}){return(0,c.jsxs)(`div`,{className:`c-kpi`,children:[(0,c.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,c.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function f({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,c.jsx)(`div`,{className:`c-cols`,style:{height:t},children:e.map((e,i)=>{let a=Math.max(e.v/r*(t-6),2);return(0,c.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function p({checks:e}){return(0,c.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,c.jsx)(`span`,{className:`c-band-cell ${e.problems.length===0?`ok`:`bad`}`,title:`${e.label}: ${e.problems.length===0?`pass`:`${e.problems.length} problem(s)`}`},t))})}function m(e){let t={};for(let n of e||[]){let e=n.action||`unknown`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>({label:e,value:t})).sort((e,t)=>t.value-e.value)}function h({overview:e,jobs:t,lens:h}){let g=e.counts||{},_=r.reduce((e,t)=>e+(g[t]||0),0),v=Math.max(...r.map(e=>g[e]||0),1),y=h?.doctor?.state||`loading`,b=h?.doctor?.data?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=i(t||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(t),T=Math.max(...w.map(e=>e.value),1),E=a(e.diff),D=[[`status`,e.deployed?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,c.jsx)(`span`,{className:`t-cap`,children:e.theme})],[`mode`,e.emit],[`doctor`,y===`failed`?(0,c.jsx)(`span`,{className:`c-pill warn`,children:`NO ANSWER`}):y===`ok`?b.length===0?(0,c.jsx)(`span`,{className:`c-pill`,children:`—`}):x===b.length?(0,c.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,c.jsxs)(`span`,{className:`c-pill warn`,children:[b.length-x,` ISSUES`]}):(0,c.jsx)(`span`,{className:`c-pill`,children:`…`})],[`edits`,String(E)],[`built`,e.build_time||`—`],[`target`,(0,c.jsx)(`span`,{className:`c-dim mono`,children:e.target})]];return(0,c.jsxs)(`div`,{className:`c-root`,children:[(0,c.jsx)(`div`,{className:`c-titlebar`,children:(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h2`,{className:`c-h1`,children:`HARNESS // STATUS READOUT`}),(0,c.jsxs)(`div`,{className:`c-sub`,children:[e.target,` · rendered from src/ · inherited everywhere`]}),(0,c.jsx)(o,{verdict:h?.verdict})]})}),(0,c.jsx)(`div`,{className:`c-strip`,children:D.map(([e,t],n)=>(0,c.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,c.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,c.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,c.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,c.jsx)(d,{label:`AGENTS`,value:g.agents??`—`}),(0,c.jsx)(d,{label:`SKILLS`,value:g.skills??`—`}),(0,c.jsx)(d,{label:`DICTATES`,value:g.laws??`—`}),(0,c.jsx)(d,{label:`PACKS`,value:g.doctrines?`${g.doctrines.active}/${g.doctrines.total}`:`—`}),(0,c.jsx)(d,{label:`MEMORY`,value:g.memory??`—`}),(0,c.jsx)(d,{label:`NOTEBOOK`,value:g.notebook??`—`}),(0,c.jsx)(d,{label:`EDITS`,value:E})]}),(0,c.jsxs)(`div`,{className:`c-grid`,children:[(0,c.jsx)(u,{title:`CAPABILITY DISTRIBUTION`,right:`${_} ENTRIES`,span:2,children:(0,c.jsxs)(`table`,{className:`c-tbl`,children:[(0,c.jsx)(`thead`,{children:(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`th`,{children:`SECTION`}),(0,c.jsx)(`th`,{children:`DETAIL`}),(0,c.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,c.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,c.jsx)(`tbody`,{children:r.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,children:n[e].label}),(0,c.jsx)(`td`,{className:`c-dim`,children:n[e].desc}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${(g[e]||0)/v*100}%`,background:e===`agents`||e===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,c.jsx)(`td`,{className:(g[e]||0)>0?`num`:`num c-dim`,children:g[e]??0})]},e))})]})}),(0,c.jsx)(u,{title:`DOCTOR // CHECKS`,right:b.length?`${x}/${b.length}`:`—`,children:b.length>0?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{checks:b}),(0,c.jsx)(`div`,{className:`c-check-list`,children:b.map(e=>{let t=e.problems.length===0;return(0,c.jsxs)(`div`,{className:`c-check-row`,children:[(0,c.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,c.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,c.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:y===`failed`?`Doctor did not answer.`:y===`ok`?`Doctor reported no checks.`:`Checking…`})}),(0,c.jsxs)(u,{title:`RUN RATE // 10D`,right:`${C} RUNS`,span:2,children:[(0,c.jsx)(f,{data:S,height:120,hi:S.length-1}),(0,c.jsx)(`div`,{className:`c-axis`,children:S.map((e,t)=>(0,c.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,c.jsx)(u,{title:`RUN LOG // BY TYPE`,right:`${(t||[]).length} LOGGED`,children:w.length>0?(0,c.jsx)(`table`,{className:`c-tbl`,children:(0,c.jsx)(`tbody`,{children:w.map(e=>(0,c.jsxs)(`tr`,{children:[(0,c.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,c.jsx)(`td`,{children:(0,c.jsx)(`div`,{className:`c-bar`,children:(0,c.jsx)(`i`,{style:{width:`${e.value/T*100}%`,background:`var(--accent)`}})})}),(0,c.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})}),(0,c.jsx)(u,{title:`RECENT // RUN LOG`,span:3,children:(0,c.jsx)(s,{jobs:t,max:l,empty:(0,c.jsx)(`p`,{className:`c-dim mono c-fine`,children:`No runs logged.`})})})]})]})}export{h as default};
|
|
@@ -1,2 +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"./api-BxjLd7Qd.js";import{$ as i,Dt as a,H as o,J as s,Ot as c,Q as l,R as u,W as d,X as f,Y as p,_t as m,bt as h,pt as g,vt as _}from"./index-DA7BiaE5.js";import{t as v}from"./EmptyState-CY5Pm2xy.js";import{t as y}from"./Markdown-C4S4tTA7.js";import{t as b}from"./Tabs-uYJqfuQt.js";import x,{installLabel as S}from"./Library-Guh9HBZU.js";var C=e(t(),1),w=e=>e(`Discard your unsaved edit?`,{title:`Unsaved edit`,confirmLabel:`Discard`,tone:`danger`}),T=`The file changed on disk — reloaded the fresh copy. Your draft is kept.`;function E({data:e,reload:t}){let n=i(),[r,o]=(0,C.useState)(null),[s,l]=(0,C.useState)(null),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(``),m=e?.fingerprint||``,h=r!==null&&JSON.stringify(r)!==JSON.stringify(s),g=(0,C.useRef)(!1),_=e=>{o(e),l(e)},v=()=>o(null);return(0,C.useEffect)(()=>{if(!h)return;let e=e=>{e.preventDefault(),e.returnValue=``};window.addEventListener(`beforeunload`,e);let t=c(({to:e})=>(g.current||(g.current=!0,w(n).then(n=>{n&&(t(),o(null),a(e))}).finally(()=>{g.current=!1})),!1));return()=>{window.removeEventListener(`beforeunload`,e),t()}},[h,n]),{draft:r,setDraft:o,open:_,close:v,discard:async()=>h&&!await w(n)?!1:(v(),!0),dirty:h,busy:u,notice:f,setNotice:p,save:async(e,{conflict:n}={})=>{d(!0),p(``);try{return await e(m)||!0}catch(e){e.status===409?p(n??T):p(e.message);return}finally{d(!1),t()}}}}var D=n(),O={title:``,body:``,scope:`project`,trial_until:``},k=[`project`,`global`],ee=e=>e===`user`?`global`:e,A=/\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029]/,j=e=>e.startsWith(`## `)||/^##\s+R\d+\s*[—–-]+\s*\S/.test(e),M=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Your draft is kept — Save again.`,te=`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy. Try again.`;function N({value:e,onChange:t,onCancel:n,onSave:r,busy:i,writeTo:a=null}){let[o]=(0,C.useState)(e.scope),s=n=>r=>t({...e,[n]:r.target.value}),c=e.body.trim().split(A).some(j)?`A line cannot start with “## ” — user-rules.md reads it as a new rule heading. Use ### or plain text.`:``,l=!(e.title.trim()&&e.body.trim()),u=!l&&!c;return(0,D.jsxs)(`div`,{className:`rule-form`,children:[a,(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule title`}),(0,D.jsx)(`input`,{className:`lib-filter`,type:`text`,value:e.title,onChange:s(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,autoFocus:!0})]}),(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule body`}),(0,D.jsx)(`textarea`,{className:`rule-body-input`,value:e.body,onChange:s(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-invalid":c?!0:void 0,"aria-describedby":c?`rule-body-error`:void 0})]}),c?(0,D.jsx)(`p`,{id:`rule-body-error`,className:`sub rule-notice`,role:`alert`,children:c}):null,(0,D.jsxs)(`div`,{className:`row wrap`,children:[(0,D.jsxs)(`label`,{className:`field`,children:[(0,D.jsx)(`span`,{children:`Rule scope`}),(0,D.jsxs)(`select`,{className:`sel`,value:e.scope,onChange:s(`scope`),children:[(0,D.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,D.jsx)(`option`,{value:`global`,children:`scope: global (every repository)`}),k.includes(o)?null:(0,D.jsxs)(`option`,{value:o,children:[`scope: `,o,` (as written in the file)`]})]})]}),(0,D.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,D.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:e.trial_until,onChange:s(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginLeft:`auto`},children:[(0,D.jsx)(`button`,{className:`btn sm`,disabled:!u||i,onClick:()=>r(e),"aria-describedby":l?`rule-form-hint`:void 0,children:i?`Saving…`:`Save rule`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,disabled:i,onClick:n,children:`Cancel`})]})]}),l?(0,D.jsx)(`p`,{id:`rule-form-hint`,className:`panel-note`,children:`A rule needs a title and a body.`}):null]})}function ne({rule:e,tag:t,isOpen:n,onToggle:r,onEdit:i,onDelete:a,onGraduate:o}){let s=t?` · ${t}`:``;return(0,D.jsxs)(`div`,{className:`rule-row ${n?`on`:``}`,children:[(0,D.jsxs)(`button`,{className:`rule-head`,onClick:r,"aria-expanded":n,"data-rule-head":e.key,children:[(0,D.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,D.jsx)(`span`,{className:`rule-title`,children:e.title}),t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null,(0,D.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,D.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),n&&(0,D.jsxs)(`div`,{className:`rule-expand`,children:[(0,D.jsx)(`p`,{children:e.body}),e.source?(0,D.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,D.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10},children:[e.status===`trial`&&(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:o,title:`Adopt for good — drop the trial marker`,"aria-label":`Graduate R${e.id}${s}`,children:`Graduate`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:i,"aria-label":`Edit R${e.id}${s}`,children:`Edit`}),(0,D.jsx)(`button`,{className:`btn ghost sm`,onClick:a,"aria-label":`Retire R${e.id}${s}`,children:`Retire`})]})]})]})}function P({onChanged:e,dataRev:t}){let n=i(),[a,o]=(0,C.useState)(0),c=g(t),l=c===null?null:c.length?c:[null],u=l?l.map(e=>e?.id??``).join(`|`):null,{data:d,error:y}=h(()=>l?Promise.allSettled(l.map(e=>r.rules(_(e)))).then(e=>{if(e.every(e=>e.status===`rejected`))throw e[0].reason;return{sets:e.flatMap((e,t)=>e.status===`fulfilled`?[{inst:l[t],data:e.value}]:[]),failed:e.flatMap((e,t)=>e.status===`rejected`?[l[t]]:[])}}):Promise.resolve(null),[a,u]),b=d?.sets,[x,S]=(0,C.useState)(null),w=()=>o(e=>e+1),T=E({data:null,reload:w}),{draft:k,busy:A,notice:j}=T,P=(0,C.useRef)(null),[F,I]=(0,C.useState)(0),L=e=>{P.current=e,I(e=>e+1)},R=(0,C.useRef)(null),z=(0,C.useRef)(null);if((0,C.useEffect)(()=>{let e=P.current;if(P.current=null,e===null)return;let t=[...z.current?.querySelectorAll(`[data-rule-head]`)||[]];(e===`add`?R.current:t.find(t=>t.dataset.ruleHead===e))?.focus()},[F]),y)return(0,D.jsx)(s,{error:y,onRetry:w});if(!b)return(0,D.jsx)(p,{});let B=l.length>1,V=e=>e?.id??``,H=b.flatMap(({inst:e,data:t})=>(t.rules||[]).map(t=>({...t,inst:e,key:`${V(e)}#${t.id}`}))),U=b.filter(e=>e.data.exists).map(e=>e.inst),W=U.length>0,G=k?.target,K=G!==void 0&&G!==`new`&&!H.some(e=>e.key===G&&e.title===k.title0),q=G===`new`||K,J=k?.to!==void 0&&!U.some(e=>V(e)===k.to),Y=J?null:U.find(e=>V(e)===k?.to)??U[0]??null,re=J?(0,D.jsx)(`p`,{className:`sub rule-notice`,role:`alert`,children:`The install this draft was for has no user-rules.md now, so it is not saved anywhere else. Cancel it, or copy the text into a new rule.`}):U.length>1?(0,D.jsx)(f,{installs:U,value:Y,onChange:e=>T.setDraft({...k,to:e.id}),label:`Write to:`}):B&&Y?(0,D.jsxs)(`p`,{className:`install-pick`,children:[(0,D.jsx)(`span`,{className:`dim`,children:`Write to:`}),` `,(0,D.jsx)(`span`,{className:`mono`,children:m(Y)})]}):null,X=async(t,n,i)=>{let a=b.find(e=>V(e.inst)===V(n))?.data.fingerprint||``,o=await T.save(()=>r.rulesMutate({...t,fingerprint:a},_(n)),{conflict:i?M:te});return o&&i&&T.close(),e?.(),o},Z=e=>T.setDraft({...k,form:e}),Q=async(e,t,n)=>{await X(e,t,!0)&&L(n)},$=async e=>{await T.discard()&&L(e)},ie=async e=>{await n(`Retire rule R${e.id} — “${e.title}”${B?` from ${m(e.inst)}`:``}? It moves to user-rules-retired.md, which is never loaded.`,{title:`Retire this rule?`,confirmLabel:`Retire`,tone:`danger`})&&await X({op:`delete`,id:e.id},e.inst)&&k===null&&L(`add`)},ae=async e=>{await X({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``},e.inst)&&L(e.key)},oe=b.flatMap(({inst:e,data:t})=>(t.warnings||[]).map(t=>B?`${m(e)}: ${t}`:t));return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,D.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,D.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),` beside the deployed AGENT.md`,B?` of each install, each rule tagged with its install`:``,`. The agent obeys them with the same force as the Laws — they may tighten a Law, never repeal one — and no update ever touches the file. Keep the set small: every rule is loaded every session.`]})]}),W&&k===null&&(0,D.jsx)(`button`,{className:`btn`,ref:R,onClick:()=>T.open({target:`new`,title0:``,form:O}),children:`Add rule`})]}),j?(0,D.jsx)(`p`,{className:`sub rule-notice`,role:`status`,children:j}):null,d.failed.length?(0,D.jsxs)(`p`,{className:`sub rule-notice`,role:`status`,children:[`Could not read user-rules.md of`,` `,d.failed.map(e=>e?m(e):`the default install`).join(`, `),`.`]}):null,oe.map(e=>(0,D.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),q&&(0,D.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,D.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),K?(0,D.jsxs)(`p`,{className:`sub rule-notice`,role:`status`,children:[`Rule R`,k.no,` is no longer in user-rules.md (an agent session removed or renumbered it). Your draft is kept — Save adds it as a new rule.`]}):null,(0,D.jsx)(N,{value:k.form,onChange:Z,busy:A,writeTo:re,onCancel:()=>$(`add`),onSave:e=>!J&&U.length&&Q({op:`add`,...e},Y,`add`)})]}),W?H.length===0&&!q?(0,D.jsx)(v,{title:`No rules yet`,children:`The file is seeded and loaded every session — it is just empty. Add your first standing rule here, ask the agent for one in-session (the rule skill), or promote a recurring memory fact from the Library.`}):(0,D.jsx)(`div`,{className:`card rules-list`,ref:z,children:H.map(e=>!K&&G===e.key?(0,D.jsx)(`div`,{className:`rule-row on`,children:(0,D.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,D.jsx)(N,{value:k.form,onChange:Z,busy:A,onCancel:()=>$(e.key),onSave:t=>Q({op:`update`,id:e.id,source:e.source,...t},e.inst,e.key)})})},e.key):(0,D.jsx)(ne,{rule:e,tag:B?m(e.inst):null,isOpen:x===e.key,onToggle:()=>S(x===e.key?null:e.key),onEdit:()=>{S(e.key),T.open({target:e.key,no:e.id,to:V(e.inst),title0:e.title,form:{title:e.title,body:e.body,scope:ee(e.scope),trial_until:e.trial_until}})},onDelete:()=>ie(e),onGraduate:()=>ae(e)},e.key))}):(0,D.jsxs)(v,{title:`No user-rules.md here yet`,children:[`The build seeds it beside AGENT.md — run a build/update from the Dashboard (or`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}var F=`PROFILE.md changed on disk since you opened it — reloaded the fresh copy. Your draft is kept — Save again.`;function I({onChanged:e,dataRev:t}){let n=g(t);if(n===null)return(0,D.jsx)(p,{});let r=n.length?n:[null],i=r.length>1;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`mb-16`,children:[(0,D.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,D.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,D.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,D.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` beside the deployed AGENT.md`,i?` of each install`:``,`. Unlike`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`, it is identity, not rules — it colours how the agent works but never binds (precedence is Laws, then rules, then this). Seeded once, never overwritten by an update. Prefer not to write it by hand? Ask the agent to run the`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),r.map(t=>(0,D.jsx)(L,{install:t,tag:i?m(t):null,onChanged:e},t?.id??``))]})}function L({install:e,tag:t,onChanged:n}){let{data:i,error:a,loading:o,reload:c,setData:u}=h(()=>r.profile(_(e)),[]),d=E({data:i,reload:c}),{draft:f,dirty:m,busy:g,notice:b}=d,[x,S]=(0,C.useState)(!1);if(i&&!x&&(S(!0),(i.text||``).trim()||d.open(i.text||``)),o&&!i)return(0,D.jsx)(p,{});if(a)return(0,D.jsx)(s,{error:a,onRetry:c});let w=f!==null,T=i?.text||``;return(0,D.jsxs)(`section`,{"aria-label":t?`Profile of ${t}`:void 0,children:[(0,D.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,D.jsx)(`div`,{children:t?(0,D.jsx)(`span`,{className:`rule-chip mono`,children:t}):null}),(0,D.jsxs)(`div`,{className:`row`,children:[(0,D.jsxs)(l,{"aria-label":t?`Profile mode, ${t}`:`Profile mode`,children:[(0,D.jsx)(`button`,{className:w?``:`on`,"aria-pressed":!w,onClick:d.discard,children:`View`}),(0,D.jsx)(`button`,{className:w?`on`:``,"aria-pressed":w,onClick:()=>w||d.open(T),children:`Edit`})]}),w&&(0,D.jsx)(`button`,{className:`btn`,disabled:!m||g,onClick:async()=>{let t=await d.save(t=>r.profileSave({text:f,fingerprint:t},_(e)),{conflict:F});t&&(u(e=>({...e,text:f,seeded:!1,fingerprint:t.fingerprint||``})),d.setNotice(`Saved.`),d.close(),n?.())},children:g?`Saving…`:`Save`})]})]}),b?(0,D.jsx)(`p`,{className:`sub rule-notice`,role:`status`,children:b}):null,w?(0,D.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:f,onChange:e=>d.setDraft(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):T.trim()?(0,D.jsxs)(D.Fragment,{children:[i?.seeded?(0,D.jsxs)(v,{title:`This is still the template`,action:(0,D.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>d.open(T),children:`Edit it here`}),children:[`Ask the agent to run the `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]}):null,(0,D.jsx)(`div`,{className:`card pad-lg`,children:(0,D.jsx)(y,{body:T})})]}):(0,D.jsxs)(v,{title:`No profile yet`,children:[`Switch to Edit to write one, or ask the agent to run the`,` `,(0,D.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})]})}var R=(e,t)=>`${e} ${t}${e===1?``:`s`}`,z=new Set([`MEMORY`,`NOTEBOOK`,`README`]),B=e=>e?(e.items||[]).filter(e=>!z.has(String(e.name).toUpperCase())).length:null;function V({rules:e,profile:t,facts:n,notes:r,tag:i}){let a=e?.exists?e.stats:null;if(!a)return null;let o=Math.round(Math.max(a.rules/a.max_rules,a.tokens/a.max_tokens)*100),[s,c]=o>=100?[`bad`,`over budget: a bloated rule set dilutes the rules that matter`]:o>=70?[`warn`,`getting heavy; consider merging or pruning`]:[`accent`,a.rules?`${a.rules} rules in ${a.lines} lines.`:`All of it is the file’s preamble; no rule text yet.`],l=[{k:`Profile`,v:t?.seeded?`template`:t?.exists?`written`:`missing`,warn:!!t?.seeded},{k:`Rules`,v:`${a.rules}/${a.max_rules}`},{k:`Memory`,v:n==null?`n/a`:R(n,`fact`)},{k:`Notebook`,v:r==null?`n/a`:R(r,`note`)}];return(0,D.jsxs)(`div`,{className:`card-row`,children:[(0,D.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`pc-budget`,children:`Rule budget`}),(0,D.jsxs)(`span`,{className:`mono dim`,children:[a.rules,` of `,a.max_rules,i?` · ${i}`:``]})]}),(0,D.jsx)(`div`,{className:`slots`,style:{"--slots":a.max_rules},role:`img`,"aria-label":`${a.rules} of ${a.max_rules} rule slots used`,children:Array.from({length:a.max_rules},(e,t)=>(0,D.jsx)(`span`,{className:t<a.rules?`used`:``},t))}),(0,D.jsxs)(`p`,{className:`big-num`,children:[(0,D.jsx)(`span`,{className:`mono`,children:a.tokens}),` `,(0,D.jsxs)(`span`,{className:`dim`,children:[`/ `,a.max_tokens.toLocaleString(`en-US`),` tokens, every turn`]})]}),(0,D.jsx)(u,{value:a.tokens,max:a.max_tokens,label:`tokens`,tone:s}),(0,D.jsx)(`p`,{className:`panel-note`,children:c})]}),(0,D.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,D.jsx)(`div`,{className:`panel-head`,children:(0,D.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,D.jsx)(`ul`,{className:`hbars`,children:l.map(e=>(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,D.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))}),i?(0,D.jsxs)(`p`,{className:`panel-note`,children:[`Profile and rules of `,i,`; memory and notebook across every install.`]}):null]})]})}var H=/^- \[([^\]]*)\]\(topics\/[^)]+\.md\) — (\d+) facts?$/,U=e=>String(e||``).split(`
|
|
2
|
-
`).map(e=>H.exec(e.trim())).filter(Boolean).map(e=>({topic:e[1],n:Number(e[2])}));function W({topics:e,install:t}){return e.length?(0,D.jsxs)(`section`,{className:`panel pm-topics`,"aria-labelledby":`pm-topics`,children:[(0,D.jsxs)(`div`,{className:`panel-head`,children:[(0,D.jsx)(`h2`,{id:`pm-topics`,children:`Topics`}),t?(0,D.jsx)(`span`,{className:`mono dim`,children:S(t)}):null,(0,D.jsx)(`span`,{className:`mono dim`,children:R(e.length,`topic`)})]}),(0,D.jsx)(`ul`,{className:`hbars`,children:e.map(e=>(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:`hb-label`,children:e.topic}),(0,D.jsx)(`span`,{className:`mono hb-n`,children:R(e.n,`fact`)})]},e.topic))})]}):null}var G={memory:{title:`No facts yet`,body:(0,D.jsxs)(`div`,{className:`pm-first`,children:[(0,D.jsx)(`p`,{children:`The agent writes a fact when a session teaches it something durable: a decision, a correction, a trap. Say “remember that…” in any session, and it asks whether that belongs here or in your standing rules.`}),(0,D.jsxs)(`ul`,{children:[(0,D.jsx)(`li`,{children:`One fact per file, filed under a topic.`}),(0,D.jsx)(`li`,{children:`Stale facts move to Archived; nothing is deleted without you.`}),(0,D.jsx)(`li`,{children:`The store stays on this machine and out of git.`})]})]}),action:(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/docs/memory`,children:`How memory works`}),(0,D.jsx)(`a`,{className:`btn ghost`,href:`#/item/skill/rule`,children:`The rule skill`})]})},notebook:{title:`No notes yet`,body:`The notebook is the agent’s own scratch space: plans and notes it keeps for itself.`}};function K({tab:e=`rules`,item:t,dataRev:n}){let i=e=>Promise.resolve(e).catch(()=>null),{data:a,reload:s}=o(n),c=g(n),l=c?.length>1?m(c[0]):null,{data:u,reload:f}=h(()=>i(r.profile()),[n]),{data:p,reload:_}=h(()=>r.catalog(`memory`),[`memory`,n],`catalog`),{data:y}=h(()=>r.catalog(`notebook`),[`notebook`,n],`catalog`),S=B(p),{data:C}=h(()=>e===`memory`?i(r.item(`memory`,`MEMORY`)):Promise.resolve(null),[`memory-map`,e,n,S]),w=B(y),T={memory:S,notebook:w},E={rules:a?.stats?.rules,profile:u?.seeded?`template`:null,memory:S,notebook:w},O=e===`memory`||e===`notebook`;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(d,{title:`Personal`,sub:`The only files you write. They survive updates, reinstalls and voice changes.`}),(0,D.jsx)(b,{page:`personal`,current:e,badges:E,label:`Personal files`}),e===`rules`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(V,{rules:a,profile:u,facts:S,notes:w,tag:l}),(0,D.jsx)(P,{onChanged:s,dataRev:n})]}),e===`profile`&&(0,D.jsx)(I,{onChanged:f,dataRev:n}),O&&T[e]===0&&!t?(0,D.jsx)(v,{title:G[e].title,action:G[e].action,children:G[e].body}):O?(0,D.jsxs)(D.Fragment,{children:[e===`memory`&&(0,D.jsx)(W,{topics:U(C?.body),install:C?.install}),(0,D.jsx)(x,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:n,onRulesChanged:()=>{s(),_()}},e)]}):null]})}export{K as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{Et as n,Tt as r}from"./index-DA7BiaE5.js";e();var i=t();function a({page:e,current:t,badges:a={},label:o}){return(0,i.jsx)(`nav`,{className:`tabs`,"aria-label":o,children:r[e].map(r=>(0,i.jsxs)(`a`,{href:`#/${e}/${r}`,className:t===r?`on`:``,"aria-current":t===r?`page`:void 0,children:[n[r],a[r]==null?null:a[r]?.of?(0,i.jsxs)(`span`,{className:`tab-badge`,title:`for ${a[r].of}`,children:[a[r].v,(0,i.jsxs)(`span`,{className:`sr-only`,children:[` for `,a[r].of]})]}):(0,i.jsx)(`span`,{className:`tab-badge`,children:a[r]?.v??a[r]})]},r))})}export{a as t};
|
|
@@ -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}async function n(e){let n=await fetch(e);if(!n.ok)throw await t(n);return n.json()}async function r(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 i=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`)},a=(e,t)=>{if(!i(t))return e;let n=new URLSearchParams({host:t.host,path:t.path});return`${e}${e.includes(`?`)?`&`:`?`}${n}`},o=(e,t)=>{let n=e??{};if(!i(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}},s=e=>{try{return e()}catch(e){return Promise.reject(e)}},c=(e,t)=>s(()=>n(a(e,t))),l=(e,t,n)=>s(()=>r(e,o(t,n))),u=e=>c(`/api/overview`,e),d=()=>n(`/api/fleet`),f=()=>n(`/api/kits`),p=()=>n(`/api/usage`),m=()=>n(`/api/gates`),h=()=>n(`/api/update`),g=e=>c(`/api/recent`,e),_=()=>n(`/api/activity`),v=(e,t)=>c(`/api/activity/`+encodeURIComponent(e),t),y=(e,t)=>l(`/api/activity`,{enabled:e},t),b=e=>c(`/api/setup`,e),x=(e=!1,t)=>c(e?`/api/doctor?fresh=1`:`/api/doctor`,t),S=e=>c(`/api/themes`,e),C=(e,t)=>c(`/api/catalog/${e}`,t),w=(e,t,n)=>c(`/api/item/${e}/${encodeURIComponent(t)}`,n),T=(e,t)=>l(`/api/memory/delete`,{name:e},t),E=e=>c(`/api/diff`,e),D=(e,t)=>l(`/api/actions/restore`,{files:e},t),O=409,k=e=>n(`/api/jobs/${e}`),A=()=>n(`/api/jobs`),j=e=>r(`/api/jobs/${e}/cancel`),M=new Set([`build`,`restore`]);async function N(e,t,n){let i=t||{},a=`/api/actions/${e}`;try{return await(M.has(e)?l(a,i,n):r(a,i))}catch(e){throw e.status===O&&e.body?.error===`busy`?Error(`An action is already running.`,{cause:e}):e}}var P=e=>c(`/api/loops`,e),F=()=>n(`/api/loops/active`),I=(e,t)=>r(`/api/loops/preset`,{root:e,preset:t}),L=()=>n(`/api/mcp`),R=e=>r(`/api/reveal`,{path:e}),z=()=>n(`/api/installs`),B=(e,t,n)=>r(`/api/install`,{host:e,path:t,action:n}),V=(e,t,n)=>r(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),H=()=>r(`/api/pick-folder`,{}),U=()=>n(`/api/ping`),W=()=>r(`/api/shutdown`),G=()=>r(`/api/restart`),K=e=>e?`?harness=${encodeURIComponent(e)}`:``,q={fleet:d,kits:f,usage:p,gates:m,update:h,loops:P,activeLoops:F,setLoopPreset:I,overview:u,recent:g,activity:_,activityDetail:v,activityToggle:y,setup:b,doctor:x,themes:S,catalog:C,item:w,memoryDelete:T,diff:E,restore:D,job:k,jobs:A,cancelJob:j,action:N,mcp:L,mcpReveal:R,installs:z,installToggle:B,installRemove:V,pickFolder:H,ping:U,shutdown:W,restart:G,docs:(e,t)=>c(`/api/docs${K(e)}`,t),docsPage:(e,t,n)=>c(`/api/docs/page/${encodeURIComponent(e)}${K(t)}`,n),rules:e=>c(`/api/rules`,e),rulesMutate:(e,t)=>l(`/api/rules`,e,t),rulesPromote:(e,t)=>l(`/api/rules/promote`,e,t),profile:e=>c(`/api/profile`,e),profileSave:(e,t)=>l(`/api/profile`,e,t),excludes:()=>n(`/api/excludes`),excludeMutate:(e,t)=>r(`/api/excludes`,{action:e,path:t})};export{q as t};
|