geneseed 5.0.3 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/README.md +3 -3
- package/SHIPPED.md +2 -2
- package/adapters/claude-code/README.md +5 -1
- package/adapters/openclaude/README.md +3 -1
- package/adapters/opencode/plugins/geneseed-workflow.js +1 -1
- package/adapters/opencode/workflows/_runtime.js +1 -1
- package/bin/geneseed-cli.mjs +3 -0
- package/bin/geneseed-hook.mjs +10 -2
- package/docs/PRD.md +1 -1
- package/docs/README.md +4 -1
- package/docs/concepts/enforcement-table.md +1 -1
- package/docs/concepts/exclusions.md +1 -1
- package/docs/concepts/factories.md +151 -0
- package/docs/concepts/hooks.md +1 -1
- package/docs/concepts/host-matrix.md +1 -0
- package/docs/concepts/loop-gates.md +3 -0
- package/docs/concepts/loops.md +1 -0
- package/docs/concepts/rules.md +1 -1
- package/docs/extending.md +5 -1
- package/docs/guides/autostart.md +2 -0
- package/docs/guides/run-a-factory.md +88 -0
- package/docs/guides/set-up-ownership.md +1 -0
- package/docs/reference/factory-actions.md +22 -0
- package/docs/reference/loop-actions.md +1 -1
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/web-ui.md +35 -2
- package/harness.config.json +1 -1
- package/js/README.md +20 -2
- package/js/build/args.mjs +14 -2
- package/js/build/source.mjs +19 -0
- package/js/cli-table.json +166 -2
- package/js/factory/cli.mjs +153 -0
- package/js/factory/graph.mjs +245 -0
- package/js/factory/registry.mjs +71 -0
- package/js/factory/state.mjs +429 -0
- package/js/hosts/activity.mjs +3 -3
- package/js/hosts/geneseed-dir.mjs +1 -1
- package/js/hosts/gitref.mjs +21 -0
- package/js/hosts/hooks-context.mjs +63 -9
- package/js/hosts/hooks-prims.mjs +1 -1
- package/js/hosts/settings.mjs +5 -4
- package/js/inspect/checks-authoring.mjs +11 -1
- package/js/inspect/cost.mjs +91 -5
- package/js/inspect/doctor.mjs +2 -1
- package/js/inspect/inventory.mjs +1 -1
- package/js/loop/catalog.mjs +24 -12
- package/js/loop/cli.mjs +21 -15
- package/js/loop/graph.mjs +13 -4
- package/js/loop/registry.mjs +65 -28
- package/js/loop/state.mjs +18 -8
- package/js/web/api.mjs +43 -1
- package/js/web/catalog.mjs +38 -2
- package/js/web/daemon.mjs +136 -6
- package/js/web/handler.mjs +14 -5
- package/js/web/routes.mjs +10 -3
- package/js/web/server.mjs +4 -1
- package/package.json +1 -1
- package/registry.json +14 -0
- package/src/AGENT.md.tmpl +5 -7
- package/src/bricks/docs-update.md +5 -0
- package/src/bricks/holdout-write.md +23 -0
- package/src/bricks/holdout.md +25 -0
- package/src/bricks/intake.md +18 -0
- package/src/bricks/merge-gate.md +22 -0
- package/src/bricks/pr-open.md +21 -0
- package/src/bricks/retro.md +17 -0
- package/src/bricks/test.md +4 -1
- package/src/bricks/triage.md +19 -0
- package/src/doctrines/comms.md +29 -41
- package/src/doctrines/craft.md +3 -10
- package/src/doctrines/ops.md +4 -15
- package/src/doctrines/rigor.md +1 -5
- package/src/factories/analysis-to-build.json +34 -0
- package/src/factories/bug-report-to-fix.json +32 -0
- package/src/factories/issue-to-pr.json +49 -0
- package/src/skills/_checkpoints.md +1 -0
- package/src/skills/adhd.md +1 -1
- package/src/skills/factory-forge.md +97 -0
- package/src/skills/factory.md +126 -0
- package/src/skills/parallel-agents.md +1 -1
- package/src/skills/workflow.md +2 -1
- package/themes/_TEMPLATE.json +4 -2
- package/themes/biker.json +4 -2
- package/themes/commentator.json +4 -2
- package/themes/cyberpunk.json +4 -2
- package/themes/gamer.json +4 -2
- package/themes/imperial.json +4 -2
- package/themes/joker.json +4 -2
- package/themes/marvin.json +4 -2
- package/themes/mean.json +4 -2
- package/themes/military.json +4 -2
- package/themes/neutral.json +4 -2
- package/themes/pirate.json +4 -2
- package/themes/sports.json +4 -2
- package/themes/verstappen.json +4 -2
- package/themes/wizard.json +4 -2
- package/web/dist/assets/ActiveLoops-BTHIaRhn.js +1 -0
- package/web/dist/assets/{Activity-Ck_Xffpo.js → Activity-BaoxwVFH.js} +1 -1
- package/web/dist/assets/{ActivityDetail-CBxVS4mU.js → ActivityDetail-C_bFD0rW.js} +1 -1
- package/web/dist/assets/{Bonsai-BlOwsvW6.js → Bonsai-B01lLf0m.js} +1 -1
- package/web/dist/assets/{CopyButton-DFMOIGbe.js → CopyButton-Bc66KPyA.js} +1 -1
- package/web/dist/assets/Dashboard-X7GZzGJp.js +2 -0
- package/web/dist/assets/{Docs-D_2Jt6gU.js → Docs-LRYVnGLG.js} +2 -2
- package/web/dist/assets/Factories-ARenKBiP.js +1 -0
- package/web/dist/assets/{GreenhouseView-WalcX5bp.js → GreenhouseView-CfWR2-sX.js} +1 -1
- package/web/dist/assets/{Installs-UGiPDMDt.js → Installs-nfFHnovH.js} +3 -3
- package/web/dist/assets/{JournalView-CZtXQz-v.js → JournalView-lpOHcHKK.js} +1 -1
- package/web/dist/assets/{Kits-XQHsazCN.js → Kits-Bw5EQl_i.js} +1 -1
- package/web/dist/assets/Laws-CnZJ0wjZ.js +4 -0
- package/web/dist/assets/LibRows-Hqvf1beK.js +1 -0
- package/web/dist/assets/Library-JaSsp6Yr.js +3 -0
- package/web/dist/assets/Loops-ZaHC5MVl.js +2 -0
- package/web/dist/assets/{OperatorHudView-CeDw5qMB.js → OperatorHudView-CggG0_sK.js} +1 -1
- package/web/dist/assets/{Personal-PVmGA2-M.js → Personal-BObvlb70.js} +2 -2
- package/web/dist/assets/{Settings-DWuxwh4i.js → Settings-BFfPMPc9.js} +1 -1
- package/web/dist/assets/{Tabs-d2RIRAKT.js → Tabs-B594Pad_.js} +1 -1
- package/web/dist/assets/api-DLDVY3K-.js +1 -0
- package/web/dist/assets/{index-BNttaGQb.js → index-DsLmKHw0.js} +3 -3
- package/web/dist/assets/index-DvPjphz0.css +1 -0
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Dashboard-BUdUTjbB.js +0 -2
- package/web/dist/assets/Laws-B6A55S-2.js +0 -4
- package/web/dist/assets/Library-D7L0Wdbh.js +0 -3
- package/web/dist/assets/Loops-C0loS73u.js +0 -2
- package/web/dist/assets/RailCats-BGZnJ6fa.js +0 -1
- package/web/dist/assets/api-BMFDSXoB.js +0 -1
- package/web/dist/assets/index-BEI5ugYQ.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-
|
|
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-DLDVY3K-.js";import{F as i,G as a,M as o,O as s,bt as c,it as l,j as u,rt as d,wt as f}from"./index-DsLmKHw0.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{a as m,d as h,f as g,i as _,l as v,o as y,r as b,t as x,v as S}from"./Bonsai-B01lLf0m.js";import{t as C}from"./usePoll-o8ul-Sog.js";var w=e(t(),1),T=n();function E(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function D({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${o(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,T.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,T.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,T.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,T.jsx)(`span`,{className:`feed-dot act-inline-dot ${E(e)||`acc`}`}),e.kind===`thinking`&&(0,T.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,T.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,T.jsx)(`b`,{children:i}),e.error&&(0,T.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,T.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,T.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${f(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function O({turns:e}){return!e||e.length===0?(0,T.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,T.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,T.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,T.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,T.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var k=5;function A({s:e}){let[t]=(0,w.useState)(y),[n,r]=(0,w.useState)(null),a=!!e.ended,o=a?{...e,status:i(e)?`busy`:e.status,error:null}:e,s=S(o,t),c=(0,w.useMemo)(()=>g(o,{sakura:t}),[s]),l=(0,w.useCallback)(e=>r(e),[]),u=v(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,p=[`${d} turn${d===1?``:`s`}`,`context ${u==null?`unknown`:`${Math.round(u*100)} %`}`,`${f} compaction${f===1?``:`s`}`,`sub-agents: ${c.pads.filter(e=>e.key!=null).length} ${a?`unfinished`:`running`}, ${c.fallen.length} finished`].join(` · `),h=n==null?null:c.pads[n];return(0,T.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!a&&i(e)?` gd-needs`:``}`,children:[(0,T.jsx)(`div`,{role:`group`,tabIndex:0,"aria-label":`Bonsai pads, arrow keys walk them`,onKeyDown:e=>_(e,c.pads.length,n,l),children:(0,T.jsx)(b,{t:c,pad:n,swaying:!a&&e.status!==`idle`,onPad:l,px:k,label:`Bonsai of this session${a?`, ended`:``}: ${p}`})}),(0,T.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[a&&(0,T.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,T.jsx)(`div`,{className:`dim act-sm`,children:p}),(0,T.jsx)(`span`,{className:`sr-only`,role:`status`,children:m(h)}),h?(0,T.jsx)(x,{pad:h}):(0,T.jsx)(`div`,{className:`dim act-xs`,children:`Hover or tap a pad, or use the arrow keys, for its files.`})]})]})}function j({sid:e}){let{sid:t,install:n}=h(e,window.location.hash),[i,o]=(0,w.useState)(null),[m,g]=(0,w.useState)(``),[_,v]=(0,w.useState)(!1),[y,b]=(0,w.useState)(!1),x=(0,w.useId)();C(e=>_?void 0:r.activityDetail(t,n).then(t=>{e()&&(o(t),g(``),v(!1))},t=>{e()&&(t.status===404?v(!0):g(t.message))}),2e3,[t,_]);let S=(0,T.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,T.jsx)(c,{name:`arrow`}),` Activity`]});if(_)return(0,T.jsxs)(`div`,{className:`page-fill`,children:[S,(0,T.jsx)(p,{title:`Session ended`,action:(0,T.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!i)return(0,T.jsxs)(`div`,{className:`page-fill`,children:[S,m?(0,T.jsx)(d,{error:m}):(0,T.jsx)(l,{label:`Loading session…`})]});let E=i.session,k=E.files,j=E.todos,M=!!(k&&k.items&&k.items.length>0),N=!!(j&&j.items&&j.items.length>0),P=i.conversation||[],F=i.timeline||[],I=[...P.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...F.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,T.jsxs)(`div`,{className:`page-fill`,children:[S,(0,T.jsx)(a,{title:E.title||u(E.cwd)||E.session_id,sub:E.cwd?(0,T.jsx)(`span`,{className:`mono act-cwd`,title:E.cwd,children:E.cwd}):null}),m&&(0,T.jsx)(`div`,{className:`act-gap`,children:(0,T.jsx)(d,{error:m})}),(0,T.jsxs)(`div`,{className:`card pad-md`,children:[(0,T.jsx)(s,{s:E}),(0,T.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,f(E.updated_at),` ago`]})]}),(0,T.jsx)(A,{s:E}),(M||N)&&(0,T.jsxs)(`div`,{className:`grid gap-12 act-panels${M&&N?` two`:``}`,children:[M&&(0,T.jsxs)(`div`,{className:`card pad-md`,children:[(0,T.jsx)(`div`,{className:`card-head`,children:(0,T.jsxs)(`h2`,{children:[`Files touched `,(0,T.jsxs)(`span`,{className:`dim`,children:[`(`,k.count,`)`]})]})}),(0,T.jsx)(`div`,{className:`stack act-list`,children:k.items.map(e=>(0,T.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,T.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,T.jsxs)(`span`,{className:`act-fixed`,children:[(0,T.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,T.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),N&&(0,T.jsxs)(`div`,{className:`card pad-md`,children:[(0,T.jsx)(`div`,{className:`card-head`,children:(0,T.jsxs)(`h2`,{children:[`Plan`,` `,(0,T.jsxs)(`span`,{className:`dim`,children:[`(`,j.done,`/`,j.total,`)`]})]})}),(0,T.jsx)(`div`,{className:`stack act-list`,children:j.items.map((e,t)=>(0,T.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,T.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,T.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,T.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,T.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,T.jsx)(`h2`,{children:`Timeline`}),F.length>0&&(0,T.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":y,"aria-controls":x,onClick:()=>b(e=>!e),children:y?`Show conversation`:`Show full stream (${I.length})`})]}),(0,T.jsx)(`div`,{id:x,children:y?(0,T.jsx)(`div`,{className:`stack gap-12`,children:I.map((e,t)=>(0,T.jsx)(D,{rec:e},t))}):(0,T.jsx)(O,{turns:P})})]})]})}export{A as SessionTree,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{mt as r}from"./index-BNttaGQb.js";var i=e(t(),1),a=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},o=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},s=e=>Math.max(0,Math.min(1,e)),c={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},l={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},u={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},d=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],f=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],p=[`#3E8E41`,`#5FB14F`],m=[`#4A4F54`,`#62686E`],h=`#FFF6E0`,g=[`#E3C24A`,`#C9A23A`],_=[`#9BDD6A`,`#D8F59A`],v={"!":`#E8B04A`,x:`#FF6F69`},y=12;function b(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 x=e=>e?.status===`blocked`||e?.status===`waiting-input`;function S(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 C=e=>e==null||e===``?NaN:Number(e);function w(e){let t=C(e?.context?.used),n=C(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?s(t/n):null}function T(e){let t=S(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 o=w(e),l=o!=null,u=l?C(e.context.used):NaN,d=l?o:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=C(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?s(u/p):0;return{id:String(e.session_id??``),host:c[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:x(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 E(e,t=!1){let n=T(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 D(e,{sakura:t=!1}={}){let n=T(e),{id:r,idle:i}=n,s=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*s,S=o(a(r)),C=Array.from({length:56},()=>Array(56).fill(null)),w=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,w[t][e]=E)},O=i?f:d,k=i?m:p,A=i?l.idle:t?l.sakura:l.live,j=Math.round(41-(9+18*s)),M=1+S()*2+3*s,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*s-(1.5+3.5*s)*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,i,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=o(a(`${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 a=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 o=Math.floor(e-r);o<=e+r;o++){if(((o-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=o-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(o,t,i[Math.max(0,Math.min(4,a+s))])}}let p=o(a(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,y);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,h);return{rx:n,cy:t}},R=o(a(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let c=.25+.55*(t/Math.max(1,n.agents.length-1)),l=Math.round(41-c*(41-j)),d=F(c);if(!e.running){let t=(3+4.5*s-(1.5+3.5*s)*c)/2;E=-1,D(d+R*(t+1),l,O[3]),D(d+R*(t+2),l-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let f=Math.round((12+Math.floor(o(a(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=f;e++){let t=d+R*e,n=l-e*.45;D(t,n,O[e<f/2?1:2]),D(t,n+1,O[0]),e<f*.6&&D(t,n+2,O[0])}let p=i?null:b(e.type),m=p?u[p]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:p,files:e.files,bbox:null}),L(d+R*f,l-f*.45-2,(8+Math.min(e.files.length,6)*.6)*x,m,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=o(a(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)w[t][n]===B&&C[t][n]!==h&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?g[0]:g[1])}if(n.compacted){let e=o(a(`${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++)w[e][t]===B&&(C[e][t]=null,w[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(w[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?_[1]:_[0])}}E=-1;let W=o(a(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,l.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,h);let[G,K,q]=c[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]===h)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=o(a(`${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=v[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=w[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&w[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 O=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},k=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function A(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?k(e):n.cwd?`cwd:${k(n.cwd)}`:`outside a repo`),i=O(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&k(n.root)!==k(e)?O(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 j=e=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),M=e=>j({key:e.key??void 0,install:e.install,session_id:e.sid}),N=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`),P=e=>r(e.host).label;function F(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?P(e):i(e)<2||e.scope===`global`?`${P(e)} · ${e.scope}`:`${P(e)} · ${O(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,`${P(n)} · ${e>t?n.path:N(n.path,e)}`)}if(e>64)break}return a}var I=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function L(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 R(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),i=F(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:i.get(e.install)??(e.host?r(e.host).label:null),href:I(e.session_id,t)}})}var z=(e,t)=>new Set((e.writers||[]).filter(e=>M(e)===t).map(e=>k(e.root)));function B(e,t,n){let r=z(e,t);for(let t of z(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var V=e=>[...new Set((e.writers||[]).map(M))];function H(e,t){let n=new Map(e.map((e,t)=>[j(e.s),t])),r=new Map;for(let e of t||[]){let t=V(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=B(e,t[i],t[a]);r.has(c)&&l!==`same-worktree`||r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function U(e,t){let n=[];for(let r of t||[]){let t=V(r).filter(t=>t!==e);if(!t.length||!V(r).includes(e))continue;let i=t.some(t=>B(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var W=e=>e?.status===`busy`||x(e);function G(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=>W(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 K=n(),q=12,J=10,Y=`geneseed-garden-sakura`;function X(){try{return window.localStorage.getItem(Y)===`1`}catch{return!1}}var Z=e=>e.key==null?`the session`:e.type||`agent`,Q=e=>e.path||e.file||`?`;function $({pad:e}){let t=e.files.slice(0,q);return(0,K.jsxs)(`div`,{className:`card gd-card`,children:[(0,K.jsxs)(`div`,{className:`act-lbl`,children:[Z(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,K.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`mono act-ell`,children:Q(e)}),(0,K.jsxs)(`span`,{className:`mono act-xs`,children:[(0,K.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,K.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Q(e)}:${t}`))}),e.files.length>t.length&&(0,K.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var ee=e=>e?`${Z(e)}: ${e.files.length} file${e.files.length===1?``:`s`}`:``;function te(e,t,n,r){let i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];e.key===`Escape`&&n!=null&&r(null),i&&t&&(e.preventDefault(),r(n==null?i>0?0:t-1:(n+i+t)%t))}var ne=(0,i.memo)(function({t:e,pad:t,swaying:n,onPad:r,px:a,label:o}){let s=(0,i.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]),c=(0,i.useRef)(null),l=e=>{let[t,n]=[c.current,e.changedTouches?.[0]];return!!t&&!!n&&Math.hypot(n.clientX-t.x,n.clientY-t.y)>J};return(0,K.jsx)(`svg`,{onTouchStart:e=>{let t=e.touches?.[0];c.current=t?{x:t.clientX,y:t.clientY}:null},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(([i,a])=>(0,K.jsx)(`g`,{"data-p":i,className:[i===t&&`gd-hot`,n&&i>=0&&e.pads[i].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:i>=0?()=>r(i):void 0,onMouseLeave:i>=0?()=>r(null):void 0,onTouchEnd:i>=0?e=>{l(e)||(e.cancelable&&e.preventDefault(),r(i===t?null:i))}:void 0,children:a.map(e=>(0,K.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},i))})});export{H as _,ee as a,G as c,L as d,D as f,U as g,R as h,te as i,w as l,F as m,Y as n,X as o,A as p,ne as r,j as s,$ as t,I as u,E as v};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{ht as r}from"./index-DsLmKHw0.js";var i=e(t(),1),a=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},o=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},s=e=>Math.max(0,Math.min(1,e)),c={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},l={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},u={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},d=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],f=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],p=[`#3E8E41`,`#5FB14F`],m=[`#4A4F54`,`#62686E`],h=`#FFF6E0`,g=[`#E3C24A`,`#C9A23A`],_=[`#9BDD6A`,`#D8F59A`],v={"!":`#E8B04A`,x:`#FF6F69`},y=12;function b(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 x=e=>e?.status===`blocked`||e?.status===`waiting-input`;function S(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 C=e=>e==null||e===``?NaN:Number(e);function w(e){let t=C(e?.context?.used),n=C(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?s(t/n):null}function T(e){let t=S(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 o=w(e),l=o!=null,u=l?C(e.context.used):NaN,d=l?o:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=C(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?s(u/p):0;return{id:String(e.session_id??``),host:c[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:x(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 E(e,t=!1){let n=T(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 D(e,{sakura:t=!1}={}){let n=T(e),{id:r,idle:i}=n,s=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*s,S=o(a(r)),C=Array.from({length:56},()=>Array(56).fill(null)),w=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,w[t][e]=E)},O=i?f:d,k=i?m:p,A=i?l.idle:t?l.sakura:l.live,j=Math.round(41-(9+18*s)),M=1+S()*2+3*s,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*s-(1.5+3.5*s)*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,i,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=o(a(`${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 a=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 o=Math.floor(e-r);o<=e+r;o++){if(((o-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=o-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(o,t,i[Math.max(0,Math.min(4,a+s))])}}let p=o(a(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,y);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,h);return{rx:n,cy:t}},R=o(a(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let c=.25+.55*(t/Math.max(1,n.agents.length-1)),l=Math.round(41-c*(41-j)),d=F(c);if(!e.running){let t=(3+4.5*s-(1.5+3.5*s)*c)/2;E=-1,D(d+R*(t+1),l,O[3]),D(d+R*(t+2),l-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let f=Math.round((12+Math.floor(o(a(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=f;e++){let t=d+R*e,n=l-e*.45;D(t,n,O[e<f/2?1:2]),D(t,n+1,O[0]),e<f*.6&&D(t,n+2,O[0])}let p=i?null:b(e.type),m=p?u[p]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:p,files:e.files,bbox:null}),L(d+R*f,l-f*.45-2,(8+Math.min(e.files.length,6)*.6)*x,m,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=o(a(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)w[t][n]===B&&C[t][n]!==h&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?g[0]:g[1])}if(n.compacted){let e=o(a(`${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++)w[e][t]===B&&(C[e][t]=null,w[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(w[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?_[1]:_[0])}}E=-1;let W=o(a(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,l.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,h);let[G,K,q]=c[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]===h)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=o(a(`${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=v[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=w[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&w[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 O=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},k=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function A(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?k(e):n.cwd?`cwd:${k(n.cwd)}`:`outside a repo`),i=O(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&k(n.root)!==k(e)?O(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 j=e=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),M=e=>j({key:e.key??void 0,install:e.install,session_id:e.sid}),N=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`),P=e=>r(e.host).label;function F(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?P(e):i(e)<2||e.scope===`global`?`${P(e)} · ${e.scope}`:`${P(e)} · ${O(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,`${P(n)} · ${e>t?n.path:N(n.path,e)}`)}if(e>64)break}return a}var I=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function L(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 R(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),i=F(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:i.get(e.install)??(e.host?r(e.host).label:null),href:I(e.session_id,t)}})}var z=(e,t)=>new Set((e.writers||[]).filter(e=>M(e)===t).map(e=>k(e.root)));function B(e,t,n){let r=z(e,t);for(let t of z(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var V=e=>[...new Set((e.writers||[]).map(M))];function H(e,t){let n=new Map(e.map((e,t)=>[j(e.s),t])),r=new Map;for(let e of t||[]){let t=V(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=B(e,t[i],t[a]);r.has(c)&&l!==`same-worktree`||r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function U(e,t){let n=[];for(let r of t||[]){let t=V(r).filter(t=>t!==e);if(!t.length||!V(r).includes(e))continue;let i=t.some(t=>B(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var W=e=>e?.status===`busy`||x(e);function G(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=>W(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 K=n(),q=12,J=10,Y=`geneseed-garden-sakura`;function X(){try{return window.localStorage.getItem(Y)===`1`}catch{return!1}}var Z=e=>e.key==null?`the session`:e.type||`agent`,Q=e=>e.path||e.file||`?`;function $({pad:e}){let t=e.files.slice(0,q);return(0,K.jsxs)(`div`,{className:`card gd-card`,children:[(0,K.jsxs)(`div`,{className:`act-lbl`,children:[Z(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,K.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`span`,{className:`mono act-ell`,children:Q(e)}),(0,K.jsxs)(`span`,{className:`mono act-xs`,children:[(0,K.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,K.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Q(e)}:${t}`))}),e.files.length>t.length&&(0,K.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var ee=e=>e?`${Z(e)}: ${e.files.length} file${e.files.length===1?``:`s`}`:``;function te(e,t,n,r){let i={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];e.key===`Escape`&&n!=null&&r(null),i&&t&&(e.preventDefault(),r(n==null?i>0?0:t-1:(n+i+t)%t))}var ne=(0,i.memo)(function({t:e,pad:t,swaying:n,onPad:r,px:a,label:o}){let s=(0,i.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]),c=(0,i.useRef)(null),l=e=>{let[t,n]=[c.current,e.changedTouches?.[0]];return!!t&&!!n&&Math.hypot(n.clientX-t.x,n.clientY-t.y)>J};return(0,K.jsx)(`svg`,{onTouchStart:e=>{let t=e.touches?.[0];c.current=t?{x:t.clientX,y:t.clientY}:null},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(([i,a])=>(0,K.jsx)(`g`,{"data-p":i,className:[i===t&&`gd-hot`,n&&i>=0&&e.pads[i].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:i>=0?()=>r(i):void 0,onMouseLeave:i>=0?()=>r(null):void 0,onTouchEnd:i>=0?e=>{l(e)||(e.cancelable&&e.preventDefault(),r(i===t?null:i))}:void 0,children:a.map(e=>(0,K.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},i))})});export{H as _,ee as a,G as c,L as d,D as f,U as g,R as h,te as i,w as l,F as m,Y as n,X as o,A as p,ne as r,j as s,$ as t,I as u,E as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{bt as r}from"./index-DsLmKHw0.js";var i=e(t(),1),a=n(),o=1200;function s({text:e,label:t,title:n,className:s=`btn ghost sm`}){let[c,l]=(0,i.useState)(null),u=(0,i.useRef)(null),d=(0,i.useRef)(!1);(0,i.useEffect)(()=>(d.current=!1,()=>{d.current=!0,clearTimeout(u.current)}),[]);let f=e=>{d.current||(l(e),clearTimeout(u.current),u.current=setTimeout(()=>l(null),o))};return(0,a.jsxs)(`button`,{type:`button`,className:s,onClick:async()=>{try{await navigator.clipboard.writeText(e),f(`ok`)}catch{f(`fail`)}},"aria-label":t,title:n,children:[(0,a.jsx)(r,{name:c===`ok`?`check`:c===`fail`?`x`:`copy`}),c===`ok`?`Copied`:c===`fail`?`Copy failed`:`Copy`]})}export{s as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-CfWR2-sX.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/motion-RlUl1osO.js","assets/sections-CtFz7HFH.js","assets/index-DsLmKHw0.js","assets/api-DLDVY3K-.js","assets/index-DvPjphz0.css","assets/OperatorHudView-CggG0_sK.js","assets/JournalView-lpOHcHKK.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-DLDVY3K-.js";import{o as a,t as o}from"./motion-RlUl1osO.js";import{n as s,r as c}from"./sections-CtFz7HFH.js";import{$ as l,At as u,B as d,Ct as f,Et as p,St as m,V as h,W as g,bt as _,it as v,l as y,nt as b,ot as x,rt as S,t as C,wt as w,xt as T}from"./index-DsLmKHw0.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(),A={done:`ok`,failed:`bad`},j={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},M=e=>typeof e==`number`&&Number.isFinite(e);function ee(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(M(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:[M(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=w(e.newest),n=e.oldest?w(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=h(e,t),i=Math.max(0,...r.map(e=>M(e.duration)?e.duration:0))||1,a=ee(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(M),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${A[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:j[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`,unknown:``};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}=p(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=T(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)(_,{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=h(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:[w(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)(g,{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=f(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(`in sync`)?{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=m(e.counts),o=n?.version_verdict||``,s=U(o),l=T(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=m(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=T(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`}),e.doctor===null?`checking`:`${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=p(()=>q(()=>i.fleet()),[e]),r=p(()=>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?y(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)(()=>C(()=>import(`./GreenhouseView-CfWR2-sX.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>C(()=>import(`./OperatorHudView-CggG0_sK.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>C(()=>import(`./JournalView-lpOHcHKK.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=`genome`,dataRev:u}){let d=c,[f,m]=(0,E.useState)(`status`),[h,g]=(0,E.useState)(d);h!==d&&(g(d),m(`status`));let _=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:u,needDoctor:d===`greenhouse`||d===`hud`}),{data:C}=p(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,u]);if(!e)return t?(0,k.jsx)(S,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(v,{});let w=e.daemon_stale?(0,k.jsx)(b,{}):null;return e.deployed?(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(x,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`readout`,`Readout`]].map(([e,t])=>(0,k.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>m(e),"aria-pressed":f===e,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`genome`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:u}),f===`status`&&d===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(v,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),f===`status`&&d===`hud`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(v,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),f===`status`&&d===`journal`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(v,{}),children:(0,k.jsx)(Q,{overview:e,recent:C,lens:y,dataRev:u})}),f===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),f===`readout`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},f)]}):(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(l,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-DLDVY3K-.js";import{i as a}from"./motion-RlUl1osO.js";import{At as o,Et as s,G as c,a as l,bt as u,c as d,dt as f,i as ee,it as p,lt as te,n as ne,o as m,ot as h,r as g,rt as _,s as v,ut as re}from"./index-DsLmKHw0.js";import{a as y,i as b,r as x}from"./Markdown-0ORz7tAc.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{a as ie,i as C,n as w,o as ae,s as oe}from"./LibRows-Hqvf1beK.js";import{t as T}from"./CopyButton-Bc66KPyA.js";var E=e(t(),1),D=n();function O(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function k(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
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
3
|
`),n.join(`
|
|
4
4
|
`)]}function A(e){let t=[...e.querySelectorAll(`h2, h3, h4, h5, h6`)],n=e=>Number(e.tagName[1]),r=t.length?Math.min(...t.map(n))-2:0;if(!(r<=0))for(let e of t){let t=document.createElement(`h${n(e)-r}`);for(let n of e.attributes)t.setAttribute(n.name,n.value);t.append(...e.childNodes),e.replaceWith(t)}}function j(e,t){let n=document.createElement(`template`);return n.innerHTML=e,A(n.content),n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||O(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function M(e){let t={ids:new Set,idx:0,toc:[]},n=n=>j(x(n,e?.links),t);if(e?.rows){let[r,i]=k(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var 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,E.useRef)(null),[s,c]=(0,E.useState)([]),l=(0,E.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,E.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)))},[l]),(0,E.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(),f(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[l]),(0,E.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=>O(e.textContent||``)===O(i))),o?.classList.add(`docs-here`)},[l,e.id,t?.emit]);let u=[];return e.id===`install`&&(u.push({label:`Run doctor`,action:`doctor`}),u.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&u.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&u.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(o,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:u.length>0&&u.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:l}}),s.map((e,t)=>{let n=R(e);return(0,D.createPortal)((0,N.jsx)(T,{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)(T,{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)(o,{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 fall behind.`]})}),(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)(o,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word the `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` voice actually uses. 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:b(y.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function se({page:e,overview:t,onAction:n,section:r,description:i}){let[a,s]=(0,E.useState)(0),{before:c,after:l}=(0,E.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)(o,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}}),(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:()=>s(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})})]})]})]}),l.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function ce(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function le(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,E.useSyncExternalStore)(le,e,()=>null),ue=5,de=96,fe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function pe(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-])${fe(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ue)break;return r}var me=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function he({page:e,glossaryRows:t}){let n=e?.body,r=(0,E.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,E.useMemo)(()=>pe(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<=de&&(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(),me(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 ge({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Voice`,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:b(y.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(o,{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 Z(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function _e({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(_,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(d,{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)(se,{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)(ge,{page:e,overview:n});default:return(0,N.jsx)(S,{title:`Unknown page kind`,children:e.kind})}}function ve(){let e=ce(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function ye(){let e=X(ve);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function Q(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}var $=`(max-width: 720px)`;function be(){return(0,E.useSyncExternalStore)(e=>{let t=window.matchMedia?.($);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},()=>!!window.matchMedia?.($).matches)}function xe({page:e,overview:t,onAction:n}){let r=be(),[a,o]=re(p(t?.emit)),{data:f,error:v}=s(()=>i.docs(`all`),[]),y=e||Z(f),b=ne(f,y),x=b.page?.hosts,S=!x?.length||x.includes(a)?a:x[0],T=u.filter(e=>!x||x.includes(e.id)),{data:D,error:O,loading:k}=s(()=>y&&(f||v)?i.docsPage(y,S):Promise.resolve(null),[y,S,!!(f||v)]),{data:A}=s(()=>i.docsPage(`glossary`,S).catch(()=>null),[S],`docs:glossary`);(0,E.useEffect)(()=>{if(f&&y&&!f.groups.some(e=>e.pages.some(e=>e.id===y))){let e=Z(f);e&&e!==y&&window.location.replace(c(e))}},[f,y]),(0,E.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[y]);let j=b.part||f?.groups?.[0]||null,M=j?.id===g;(0,E.useEffect)(()=>{M&&D?.id===y&&m(y)},[M,D,y]);let P=M?[...l(),y]:[],[F,I]=(0,E.useState)(``),[L,R]=(0,E.useState)(`all`),[z,B]=(0,E.useState)(j?.id);j?.id!==z&&(B(j?.id),I(``),R(`all`));let V=Q(j),H=ie(V),U=L===`all`?V:V.filter(e=>e.group===L),W=w(U,F);if(v)return(0,N.jsx)(_,{error:v});let G=(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`})]}),b.page?.varies&&T.length>1?(0,N.jsx)(h,{"aria-label":`Host`,children:T.map(e=>(0,N.jsx)(`button`,{className:S===e.id?`on`:``,onClick:()=>o(e.id),"aria-pressed":S===e.id,children:e.label},e.id))}):null,(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(f?.groups||[]).map(e=>(0,N.jsxs)(E.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?c(e.pages[0].id):`#/docs`,className:j?.id===e.id?`on`:``,"aria-current":j?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),j?.id===e.id&&(0,N.jsx)(oe,{label:`Sections`,total:V.length,cats:H,cat:L,onChange:R})]},e.id))})]},`kinds`),K=(0,N.jsx)(C,{label:j?.label||`Docs`,count:F.trim()?`${W.length} of ${U.length}`:U.length||``,extra:M&&(0,N.jsx)(ee,{pages:j.pages,seen:P}),q:F,onQ:I,matched:W.length,inView:[j?.id,y],children:f?(0,N.jsx)(ae,{rows:W,activeName:y,hrefOf:e=>c(e.name),pills:M?e=>P.includes(e.name)&&e.name!==y?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(d,{label:`Loading docs…`})},`list`),q=!k&&(0,N.jsx)(he,{page:D,glossaryRows:A?.rows}),J=(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":b.page?.title||`Page`,children:[(0,N.jsx)(ye,{}),b.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:c(b.part.pages[0].id),children:b.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:c(b.part.pages.find(e=>(e.section||`General`)===b.section).id),children:b.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:b.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[r?q:null,(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(_e,{data:k?null:D,error:O,overview:t,onAction:n,place:b},`${y}|${S}`),!k&&(0,N.jsx)(te,{menu:f,pageId:y})]}),r?null:q]})]},`reader`);return(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsx)(`div`,{className:`library docs-lib`,children:r?[J,G,K]:[G,K,J]})})}export{xe as default,Q as docRows};
|
|
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,E.useRef)(null),[s,l]=(0,E.useState)([]),u=(0,E.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,E.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),l(L(e)))},[u]),(0,E.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,E.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=>O(e.textContent||``)===O(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)(c,{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,D.createPortal)((0,N.jsx)(T,{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)(T,{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)(c,{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 fall behind.`]})}),(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)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word the `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` voice actually uses. 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:b(y.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function se({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,E.useState)(0),{before:s,after:l}=(0,E.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)(c,{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})})]})]})]}),l.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function ce(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function le(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,E.useSyncExternalStore)(le,e,()=>null),ue=5,de=96,fe=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function pe(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-])${fe(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ue)break;return r}var me=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function he({page:e,glossaryRows:t}){let n=e?.body,r=(0,E.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,E.useMemo)(()=>pe(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<=de&&(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(),me(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 ge({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Voice`,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:b(y.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{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)(u,{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)(u,{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)(u,{name:`external`}),`License`]})]})]})]})}function Z(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function _e({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(_,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(p,{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)(se,{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)(ge,{page:e,overview:n});default:return(0,N.jsx)(S,{title:`Unknown page kind`,children:e.kind})}}function ve(){let e=ce(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function ye(){let e=X(ve);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function Q(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}var $=`(max-width: 720px)`;function be(){return(0,E.useSyncExternalStore)(e=>{let t=window.matchMedia?.($);return t?.addEventListener(`change`,e),()=>t?.removeEventListener(`change`,e)},()=>!!window.matchMedia?.($).matches)}function xe({page:e,overview:t,onAction:n}){let r=be(),[a,o]=f(re(t?.emit)),{data:c,error:u}=s(()=>i.docs(`all`),[]),y=e||Z(c),b=v(c,y),x=b.page?.hosts,S=!x?.length||x.includes(a)?a:x[0],T=te.filter(e=>!x||x.includes(e.id)),{data:D,error:O,loading:k}=s(()=>y&&(c||u)?i.docsPage(y,S):Promise.resolve(null),[y,S,!!(c||u)]),{data:A}=s(()=>i.docsPage(`glossary`,S).catch(()=>null),[S],`docs:glossary`);(0,E.useEffect)(()=>{if(c&&y&&!c.groups.some(e=>e.pages.some(e=>e.id===y))){let e=Z(c);e&&e!==y&&window.location.replace(l(e))}},[c,y]),(0,E.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[y]);let j=b.part||c?.groups?.[0]||null,M=j?.id===g;(0,E.useEffect)(()=>{M&&D?.id===y&&m(y)},[M,D,y]);let P=M?[...d(),y]:[],[F,I]=(0,E.useState)(``),[L,R]=(0,E.useState)(`all`),[z,B]=(0,E.useState)(j?.id);j?.id!==z&&(B(j?.id),I(``),R(`all`));let V=Q(j),H=oe(V),U=L===`all`?V:V.filter(e=>e.group===L),W=ie(U,F);if(u)return(0,N.jsx)(_,{error:u});let G=(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`})]}),b.page?.varies&&T.length>1?(0,N.jsx)(h,{"aria-label":`Host`,children:T.map(e=>(0,N.jsx)(`button`,{className:S===e.id?`on`:``,onClick:()=>o(e.id),"aria-pressed":S===e.id,children:e.label},e.id))}):null,(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(c?.groups||[]).map(e=>(0,N.jsxs)(E.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?l(e.pages[0].id):`#/docs`,className:j?.id===e.id?`on`:``,"aria-current":j?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),j?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:V.length,cats:H,cat:L,onChange:R})]},e.id))})]},`kinds`),K=(0,N.jsx)(C,{label:j?.label||`Docs`,count:F.trim()?`${W.length} of ${U.length}`:U.length||``,extra:M&&(0,N.jsx)(ee,{pages:j.pages,seen:P}),q:F,onQ:I,matched:W.length,inView:[j?.id,y],children:c?(0,N.jsx)(w,{rows:W,activeName:y,hrefOf:e=>l(e.name),pills:M?e=>P.includes(e.name)&&e.name!==y?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(p,{label:`Loading docs…`})},`list`),q=!k&&(0,N.jsx)(he,{page:D,glossaryRows:A?.rows}),J=(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":b.page?.title||`Page`,children:[(0,N.jsx)(ye,{}),b.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:l(b.part.pages[0].id),children:b.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:l(b.part.pages.find(e=>(e.section||`General`)===b.section).id),children:b.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:b.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[r?q:null,(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(_e,{data:k?null:D,error:O,overview:t,onAction:n,place:b},`${y}|${S}`),!k&&(0,N.jsx)(ne,{menu:c,pageId:y})]}),r?null:q]})]},`reader`);return(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsx)(`div`,{className:`library docs-lib`,children:r?[J,G,K]:[G,K,J]})})}export{xe as default,Q as docRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-DLDVY3K-.js";import{Et as i,Ot as a,Q as o,Z as s,at as c,it as l,kt as u,rt as d,vt as f}from"./index-DsLmKHw0.js";import{t as p}from"./EmptyState-CY5Pm2xy.js";import{t as m}from"./usePoll-o8ul-Sog.js";import{a as h,i as ee,n as g,o as _,s as v}from"./LibRows-Hqvf1beK.js";import{t as y}from"./CopyButton-Bc66KPyA.js";import{a as b,c as x,n as S,o as C,s as w}from"./ActiveLoops-BTHIaRhn.js";var T=e(t(),1),E=24,D=48,te=16,ne=92,re=8,ie=16,O=22,k=14,ae=14,A=15,j=7.2,M=440,N={brick:{w:200,h:48},fork:{w:200,h:48},lane:{w:150,h:56},close:{w:96,h:34},stop:{w:76,h:34}},P=`loop:`,oe=new Set([`$close`,`$stop`,`$lane`]),F=(e,t)=>{if(!e?.name)return`↺ route back`;let n=t?`${t[e.name]??0} / ${e.max??`?`}`:`max ${e.max??`?`}`;return`↺ ${e.name} · ${n}`};function se(e,t,n,r){let i=null;for(let a of e)Array.isArray(a?.nodes)&&a.nodes[0]===n&&(a.nodes.includes(t)||a.nodes.includes(`$lane`)&&r.has(t))&&(!i||a.nodes.length<i.nodes.length)&&(i=a);return i}function ce(e){let t=new Set(Array.isArray(e.stages)?e.stages:[]),n=(e.cycles||[]).filter(e=>Array.isArray(e?.nodes)),r=e=>n.some(t=>t.nodes[0]===e.to&&t.nodes.includes(e.from)),i=new Map;for(let n of e.edges||[])t.has(n?.from)&&t.has(n?.to)&&!r(n)&&(i.has(n.from)||i.set(n.from,[]),i.get(n.from).includes(n.to)||i.get(n.from).push(n.to));return new Map([...i].filter(([,e])=>e.length>1))}function le(e,t){let n=ce(e);for(let r of[...Array.isArray(t)?t:[]].reverse()){if(!n.has(r?.stage)||!r.outcome)continue;let t=(e.edges||[]).find(e=>e.from===r.stage&&e.on===r.outcome);if(t&&n.get(r.stage).includes(t.to))return t.to}return null}function ue(e,t=[],n={}){let r=n.width>0?Math.floor(n.width):1/0,i=[{rails:!0,stack:!1},{rails:!1,stack:!1},{rails:!0,stack:!0},{rails:!1,stack:!0}];for(let a of i){let o=I(e,t,n.loops||[],a,r,n.lane);if(o.width<=r||a===i.at(-1))return o}}function I(e,t,n,r,i,a){let o=Array.isArray(e.stages)?e.stages:[],s=new Set(o),c=(Array.isArray(e.edges)?e.edges:[]).filter(e=>typeof e?.from==`string`&&typeof e?.to==`string`&&s.has(e.from)&&(s.has(e.to)||oe.has(e.to))),l=(Array.isArray(e.cycles)?e.cycles:[]).filter(e=>Array.isArray(e?.nodes)),u=new Map(t.map(e=>[e.name,e])),d=new Map(n.map(e=>[e.name,e.graph])),f=ce(e),p=new Set([...f.values()].flat()),m=e=>se(l,e.from,e.to,p),h=new Map(s.has(e.start)?[[e.start,0]]:[]),ee=c.filter(e=>s.has(e.to)&&!m(e));for(let e=0;e<o.length;e++){let e=!1;for(let t of ee){if(!h.has(t.from))continue;let n=h.get(t.from)+1;h.get(t.to)>=n||(h.set(t.to,n),e=!0)}if(!e)break}let g=Math.max(-1,...h.values());for(let e of o)h.has(e)||h.set(e,++g);let _=g+1,v=[];for(let e of o)(v[h.get(e)]||=[]).push(e);let y=e=>v[h.get(e)].length>1,b=r.rails?E:ie,S=r.rails?te:re,C=i===1/0?1/0:i-2*b,T=Math.max(N.brick.w,Math.min(M,C)),le=()=>Math.max(N.lane.w,Math.min(240,C-28)),ue=e=>r.rails?N.lane.w:Math.max(ne,Math.min(N.lane.w,Math.floor((C-S*(e-1))/e))),I=o.map(e=>{let n=y(e),r=e.startsWith(P)?e.slice(5):null,i=r?`loop`:f.has(e)?`fork`:`brick`,a=n?{w:ue(v[h.get(e)].length),h:N.lane.h}:{...N[i]||N.brick};if(i===`loop`&&!n){let e=d.get(r)?x(d.get(r),t):null,n=e?e.height/e.width:.8;a={w:T,h:Math.round(36+(T-16)*n)}}return{id:e,kind:i,...a,rank:h.get(e),lane:n,stacked:!1,loop:r,human:i===`brick`||i===`fork`?w(u.get(e)):null,tags:[]}}),L=new Map(I.map(e=>[e.id,e])),de=c.some(e=>e.to===`$close`);if(de){let e={id:`$close`,kind:`close`,...N.close,rank:_,tags:[]};I.push(e),L.set(`$close`,e),v[_]=[`$close`]}let fe=e=>{let t=null;for(let n of f.keys())h.get(n)<h.get(e)&&(!t||h.get(n)>h.get(t))&&(t=n);return t},R=new Map;for(let e of c){let t=`${e.from}\u0000${e.to}`;if(R.has(t))R.get(t).on.push(e.on);else{let n=m(e),r=e.to===`$lane`?f.get(fe(e.from))?.[0]:e.to;if(e.to!==`$stop`&&!L.has(r))continue;let i=e.to===`$stop`?0:L.get(r).rank-h.get(e.from),a=e.to===`$stop`?`stop`:n?`back`:i===1?`flow`:`skip`;R.set(t,{from:e.from,to:e.to,target:r,on:[e.on],kind:a,back:!!n,cycle:n?.name??null,cycleDef:n,span:i})}}let z=[...R.values()],B=z.filter(e=>e.kind===`back`||e.kind===`skip`),pe=z.filter(e=>e.kind===`stop`&&y(e.from)),me=r.rails?pe:[...B,...z.filter(e=>e.kind===`stop`&&!y(e.from)),...pe];for(let e of me)L.get(e.from).tags.push({kind:e.kind,on:e.on,to:e.to,cycle:e.cycle});let he=(e,t)=>e.kind===`back`?F(t.cycleDef):`${e.on.join(` · `)} → ${e.kind===`stop`?`stop`:e.to}`,ge=e=>Math.max(0,...e.tags.map(t=>he(t,z.find(n=>n.from===e.id&&n.to===t.to)).length*j)),V=v.map(e=>(e||[]).map(e=>L.get(e))),H=e=>e.reduce((e,t)=>e+t.w,0)+S*(e.length-1),U=V.map(e=>r.stack&&e.length>1&&H(e)>C);V.forEach((e,t)=>{if(U[t])for(let t of e)Object.assign(t,{stacked:!0,w:le()})});let W=(e,t)=>U[t]?Math.max(...e.map(e=>e.w))+28:H(e),G=Math.max(N.brick.w,...V.map((e,t)=>e.length?W(e,t):0)),K=E,q=[];V.forEach((e,t)=>{if(!e.length)return;let n=(G-W(e,t))/2;if(U[t]){for(let t of e)Object.assign(t,{x:(G-t.w)/2,y:K}),K+=t.h+t.tags.length*A+O;K-=O}else{for(let t of e)Object.assign(t,{x:n,y:K}),n+=t.w+S;K+=Math.max(...e.map(e=>e.h)),K+=Math.max(0,...e.map(e=>e.tags.length))*A}q[t]=K+D/2,K+=D});let _e=K-D,J=r.rails?B.sort((e,t)=>Math.abs(t.span)-Math.abs(e.span)):[],Y=e=>28+e*ae,ve=e=>e.back?F(e.cycleDef):e.on.join(` · `),X=J.length?Y(J.length-1)+12:b;J.forEach((e,t)=>{X=Math.max(X,Y(t)+8+ve(e).length*j-L.get(e.from).x)});for(let e of I)e.x+=X;let Z=r.rails?z.filter(e=>e.kind===`stop`&&!y(e.from)):[],Q=X+G+24;for(let e of Z){let t=L.get(e.from);Q=Math.max(Q,t.x+t.w+10+e.on.join(` · `).length*j)}let ye=Math.max(0,...I.filter(e=>e.tags.length).map(e=>e.x+e.w/2+6+ge(e))),be=Math.max(X+G,ye)+b;if(Z.length){Q=Math.max(Q,ye+10);let e=de?L.get(`$close`).y:_e-N.stop.h,t={id:`$stop`,kind:`stop`,...N.stop,x:Q-N.stop.w/2,y:e,rank:_,tags:[]};I.push(t),L.set(`$stop`,t),be=Q+N.stop.w/2+E}let xe=e=>e.x+e.w/2,$=e=>e.y+e.h/2,Se=e=>e.y+e.h,Ce=e=>e.x-k,we=e=>e.x+e.w+k,Te=new Map;for(let e of z)e.kind===`flow`&&Te.set(e.target,(Te.get(e.target)||0)+1);let Ee=new Map,De=z.map(e=>{let t=L.get(e.from),n=e.to===`$lane`&&L.get(a)?.stacked&&f.get(fe(e.from))?.includes(a)?L.get(a):L.get(e.target),r={from:e.from,to:e.to,on:e.on,kind:e.kind,back:e.back,cycle:e.cycle};if(e.kind===`stop`){if(!Z.includes(e))return{...r,path:null};let n=L.get(`$stop`);return{...r,path:`M${t.x+t.w},${$(t)} H${Q} V${n.y}`,lx:t.x+t.w+6,ly:$(t)-6,anchor:`start`}}if(e.kind===`back`||e.kind===`skip`){let i=J.indexOf(e);if(i<0)return{...r,path:null};let a=Ee.get(n.id)||0;Ee.set(n.id,a+1);let o=$(n)+(a%2?1:-1)*Math.ceil(a/2)*10;return{...r,path:`M${t.x},${$(t)} H${Y(i)} V${o} H${n.x}`,lx:Y(i)+6,ly:$(t)-6,anchor:`start`}}let i=q[t.rank],o=t.stacked?`M${t.x+t.w},${$(t)} H${we(t)} V${i}`:`M${xe(t)},${Se(t)} V${i}`,s=n.stacked?` H${Ce(n)} V${$(n)} H${n.x}`:` H${xe(n)} V${n.y}`,c=e.on.length===1&&e.on[0]===`pass`,l=(Te.get(n.id)||0)>1?{lx:t.stacked?we(t)+4:xe(t)+6,ly:t.stacked?$(t)-4:Se(t)+13}:n.stacked?{lx:n.x,ly:n.y-5}:{lx:xe(n)+6,ly:n.y-8};return{...r,path:o+s,...l,anchor:`start`,plain:c}});return{width:Math.ceil(be),height:Math.ceil(_e+E),mode:r.rails?`rails`:`tags`,stacked:U.some(Boolean),nodes:I,edges:De}}var L=n(),de=20;function fe({factory:e,bricks:t=[],loops:n=[],onSelect:r,highlight:i,child:a,counters:o,lane:s,history:c}){let l=(0,T.useRef)(null),[u,d]=(0,T.useState)(0);(0,T.useLayoutEffect)(()=>{let e=l.current;if(!e)return;let t=()=>d(t=>Math.abs(e.clientWidth-t)>de?e.clientWidth:t);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let f=s===void 0?le(e,c):s,p=ue(e,t,{width:u,loops:n,lane:f}),m=new Map(n.map(e=>[e.name,e.graph])),h=new Map((e.cycles||[]).map(e=>[e.name,e])),ee=new Set(p.nodes.filter(e=>e.kind===`fork`).map(e=>e.id)),g=e=>e.kind===`back`?F(h.get(e.cycle),o):`${e.on.join(` · `)} → ${e.kind===`stop`?`stop`:e.to}`,_=e=>e.kind===`loop`?`${e.id} stage, the ${e.loop} loop`:`${e.id} ${e.kind===`fork`?`fork`:`brick`}${e.human?`, ${e.human.toLowerCase()}`:``}`,v=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),r?.(e))},y=e=>{let t=e.id===i,n=`${_(e)}${e.id===f?`, the lane taken`:``}`;return r?{role:`button`,tabIndex:0,"aria-label":n,onClick:v(e.id),onKeyDown:v(e.id)}:{role:`img`,"aria-label":`${n}${t?`, current stage`:``}`}},x=e=>`fg-node ${e.kind}${e.lane?` lane`:``}${e.id===i?` current`:``}${e.id===f?` taken`:``}`,S=e=>f&&(e.to===f||e.from===f),w=e=>e.tags.map((t,n)=>(0,L.jsx)(`text`,{x:e.x+e.w/2+6,y:e.y+e.h+12+n*15,className:`fg-lbl fg-tag ${t.kind}`,children:g(t)},`${t.kind}${t.to}`));return(0,L.jsxs)(`div`,{className:`fg-wrap`,ref:l,children:[(0,L.jsxs)(`svg`,{className:`fgraph`,"data-mode":`${p.mode}${p.stacked?` stacked`:``}`,style:{"--fg-w":`${p.width}px`},viewBox:`0 0 ${p.width} ${p.height}`,role:`group`,"aria-label":`${e.name} factory: ${(e.stages||[]).join(`, `)}`,children:[(0,L.jsx)(`defs`,{children:[`flow`,`back`,`stop`].map(e=>(0,L.jsx)(`marker`,{id:`fg-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,L.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`fg-head-${e}`})},e))}),p.edges.map(e=>{if(!e.path)return null;let t=e.kind===`skip`?`flow`:e.kind,n=e.back?F(h.get(e.cycle),o):e.kind===`flow`&&e.plain?``:e.on.join(` · `);return(0,L.jsxs)(`g`,{children:[(0,L.jsx)(`path`,{d:e.path,className:`fg-edge ${e.kind}${S(e)&&e.kind===`flow`?` taken`:``}`,markerEnd:`url(#fg-arrow-${t})`}),n?(0,L.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`fg-lbl ${e.kind}${e.kind===`flow`&&ee.has(e.from)?` fork`:``}`,children:n}):null]},`${e.from}>${e.to}`)}),p.nodes.map(e=>{if(e.kind===`close`||e.kind===`stop`)return(0,L.jsxs)(`g`,{className:`fg-${e.kind}`,role:`img`,"aria-label":e.kind,children:[(0,L.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:e.h/2}),(0,L.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+4,textAnchor:`middle`,children:e.kind})]},e.id);let n=e.id===i?`step`:void 0;if(e.lane||e.kind===`brick`||e.kind===`fork`){let t=a&&e.id===i?a:null,r=e.lane?t?`at ${t.node}`:e.kind===`loop`?`whole loop`:`no loop`:null;return(0,L.jsxs)(`g`,{children:[(0,L.jsxs)(`g`,{className:x(e),"aria-current":n,...y(e),children:[e.lane?(0,L.jsx)(`title`,{children:e.id}):null,(0,L.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:`10`}),(0,L.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+(r?-2:4),textAnchor:`middle`,children:e.lane&&e.loop?e.loop:e.id}),r?(0,L.jsx)(`text`,{x:e.x+e.w/2,y:e.y+e.h/2+14,textAnchor:`middle`,className:`fg-sub`,children:r}):null,e.human?(0,L.jsx)(b,{x:e.x+e.w-4,y:e.y+4,label:e.human}):null]}),w(e)]},e.id)}let r=a&&e.id===i?a:null,o=r?.graph||(e.loop?m.get(e.loop):null);return(0,L.jsxs)(`g`,{children:[(0,L.jsxs)(`g`,{className:x(e),"aria-current":n,...y(e),children:[(0,L.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:e.h,rx:`14`}),(0,L.jsx)(`text`,{x:e.x+12,y:e.y+20,className:`fg-title`,children:e.id})]}),o?(0,L.jsx)(`foreignObject`,{x:e.x+8,y:e.y+28,width:e.w-16,height:e.h-34,children:(0,L.jsx)(`div`,{className:`fg-ring`,children:(0,L.jsx)(C,{graph:o,bricks:t,highlight:r?.node})})}):(0,L.jsx)(`text`,{x:e.x+12,y:e.y+48,className:`fg-sub`,children:`not in this install's catalogue`}),w(e)]},e.id)})]}),(0,L.jsx)(`ul`,{className:`fg-legend`,"aria-label":`Graph legend`,children:[[`brick`,`brick`],[`loop`,`whole loop (test · fix · verify)`],[`fork`,`fork`],[`back`,`route back, bounded by its max`],[`stop`,`fail → stop`]].map(([e,t])=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`span`,{className:`fg-key ${e}`,"aria-hidden":`true`}),t]},e))})]})}var R=encodeURIComponent,z=5e3,B=a.factories.map(e=>[e,u[e]]),pe={project:`Project`,global:`Global`,shipped:`Shipped`},me={templates:`Origins`,active:`Statuses`},he=[[`awaiting`,`Awaiting`],[`running`,`Running`],[`done`,`Done · stopped`],[`stopped`,`Done · stopped`],[`finished`,`Finished · unreadable`],[`unreadable`,`Finished · unreadable`]],ge=e=>!!e.graph,V=(e,t,n)=>n.flatMap(([n,r])=>e.filter(e=>t(e)===n).map(e=>({...e,group:r}))),H=e=>V(e.map(e=>({...e,desc:e.description})),e=>e.origin,Object.entries(pe)),U=e=>V(e.map(e=>({...e,name:e.root,desc:e.factory})),e=>e.status,he),W=(e,t)=>(0,L.jsx)(`span`,{className:`tag${e?` ${e}`:``}`,children:t},t),G={templates:e=>W(``,e.origin),active:e=>W(S[e.status],e.status)},K=fe;function q({factory:e,counters:t}){return e.cycles?.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h3`,{className:`loop-h2`,children:`Routes back`}),(0,L.jsx)(`ul`,{className:`fac-cycles`,"aria-label":`Cycles`,children:e.cycles.map(e=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`b`,{children:e.name}),`: `,e.nodes.join(` → `),` —`,` `,t?`lap ${t[e.name]??0} of ${e.max}`:`${e.max} laps at most`]},e.name))})]}):null}function _e({f:e,bricks:t,loops:n}){let r=`geneseed factory init --factory ${e.name} --title "<title>" --requirement "<requirement>"`;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`reader-tags`,children:[(0,L.jsx)(`span`,{className:`tag acc`,children:`Factory`}),W(``,e.origin)]}),(0,L.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,L.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,L.jsxs)(`p`,{className:`mono dim reader-src`,children:[`factories/`,e.name,`.json · `,e.origin]}),(0,L.jsx)(`hr`,{className:`hr`}),(0,L.jsx)(K,{factory:e.factory,bricks:t,loops:n}),(0,L.jsx)(q,{factory:e.factory}),(0,L.jsxs)(`section`,{className:`loop-start`,"aria-labelledby":`fac-start-h`,children:[(0,L.jsxs)(`div`,{className:`loop-start-bar`,children:[(0,L.jsx)(`h3`,{id:`fac-start-h`,className:`loop-kicker`,children:`Start it in a worktree`}),(0,L.jsx)(y,{text:r,label:`Copy command`})]}),(0,L.jsx)(`pre`,{className:`mono`,children:r})]}),e.factory.rules?.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`h3`,{className:`loop-h2`,children:`Rules`}),(0,L.jsx)(`ul`,{className:`loop-rules`,"aria-label":`Rules every stage follows`,children:e.factory.rules.map(e=>(0,L.jsx)(`li`,{children:e},e))})]}):null]})}function J({run:e,bricks:t,loops:n}){let r=e.tasks;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`reader-tags`,children:[(0,L.jsx)(`span`,{className:`tag acc`,children:`Factory run`}),(0,L.jsx)(`span`,{className:`tag${S[e.status]?` ${S[e.status]}`:``}`,children:e.status})]}),(0,L.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,L.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.factory,` · `,e.branch,` · `,e.root]}),ge(e)?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`p`,{className:`reader-lede`,children:[`At `,e.stage,` · `,e.transitions,` transitions`,r?` · task ${r.index} / ${r.count}`:``,e.loop?` · loop at ${e.loop.node}, iteration ${e.loop.iteration}`:``]}),e.awaiting?(0,L.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,L.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind??`you`,e.awaiting.stage?` at ${e.awaiting.stage} (${e.awaiting.outcome})`:``]}),` `,`— Answer in the agent's session.`]}):null,e.reason?(0,L.jsx)(`p`,{className:`panel-note`,children:e.reason}):null,(0,L.jsx)(`hr`,{className:`hr`}),(0,L.jsx)(K,{factory:e.graph,bricks:t,loops:n,highlight:e.stage,child:e.loop,counters:e.counters,lane:e.lane,history:e.history}),(0,L.jsx)(q,{factory:e.graph,counters:e.counters})]}):(0,L.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its FACTORY.md cannot be read, so there is no state to show.`:`Its FACTORY.md is gone: the run closed and its state went with it.`})]})}function Y({problems:e}){if(!e?.length)return null;let t=e.length;return(0,L.jsxs)(`div`,{className:`panel loop-problems`,role:`status`,"aria-label":`Catalogue files skipped`,children:[(0,L.jsxs)(`b`,{className:`t-warn`,children:[t,` factory `,t===1?`problem`:`problems`,`: these factories cannot run as they are`]}),(0,L.jsx)(`ul`,{className:`panel-note`,children:e.map(e=>(0,L.jsx)(`li`,{className:`mono`,children:e},e))})]})}var ve={templates:{title:`No factories`,body:(0,L.jsxs)(L.Fragment,{children:[`Add one under `,(0,L.jsx)(`code`,{className:`mono`,children:`.geneseed/factories/`}),` in the repo.`]})},active:{title:`No runs yet`,body:(0,L.jsxs)(L.Fragment,{children:[`Start one with `,(0,L.jsx)(`code`,{className:`mono`,children:`geneseed factory init`}),` in a worktree, or ask the agent to run a factory. It shows up here while it runs.`]})}},X={templates:(0,L.jsxs)(L.Fragment,{children:[`A factory carries one work item through bricks and loops to an open PR.`,` `,(0,L.jsx)(`a`,{href:`#/docs/factories`,children:`How factories work →`})]}),active:(0,L.jsxs)(L.Fragment,{children:[`Factory runs registered on this machine, read from their FACTORY.md.`,` `,(0,L.jsx)(`a`,{href:`#/docs/run-a-factory`,children:`Run a factory →`})]})};function Z(){let[e,t]=(0,T.useState)(null),[n,i]=(0,T.useState)(null);return m(e=>r.activeFactories().then(n=>e()&&(t(n),i(null)),t=>e()&&i(t.message)),z,[]),{runs:e?.factories??null,error:n}}function Q({tab:e=`templates`,item:t,dataRev:n}){let a=o(n),[u,m]=s(`factories`,a),{data:y,error:b}=i(()=>r.factories(f(u)),[n,u?.id??``],`factories`),{runs:x,error:S}=Z(),[C,w]=(0,T.useState)(``),[E,D]=(0,T.useState)(`all`),[te,ne]=(0,T.useState)(e);e!==te&&(ne(e),w(``),D(`all`));let re=y?.bricks||[],ie=y?.loops||[],O=e===`active`?x&&U(x):y&&H(y.factories),k=O||[],ae=v(k),A=E===`all`?k:k.filter(e=>e.group===E),j=C.trim(),M=h(A,j),N=!!(t&&O&&!k.some(e=>e.name===t)),P=N?null:k.find(e=>e.name===t)||e===`active`&&k.find(ge)||k[0]||null,oe={templates:y?.factories.length,active:x?.length},F=B.find(([t])=>t===e)[1],se=e===`active`?S:b;return(0,L.jsxs)(`div`,{className:`lib-wrap`,children:[e===`active`?null:(0,L.jsx)(c,{className:`page-pick`,installs:a,value:u,onChange:m}),(0,L.jsx)(d,{error:se,style:{margin:`0 0 var(--sp-3)`}}),(0,L.jsx)(Y,{problems:y?.problems}),(0,L.jsxs)(`div`,{className:`library`,children:[(0,L.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Factories sections`,children:[(0,L.jsxs)(`div`,{className:`lib-title`,children:[(0,L.jsx)(`h1`,{className:`h`,children:`Factories`}),(0,L.jsx)(`span`,{className:`dim`,children:`Work items, carried to a PR`})]}),(0,L.jsx)(`p`,{className:`panel-note lib-lede`,children:X[e]}),(0,L.jsx)(`nav`,{className:`kind-list`,"aria-label":`Sections`,children:B.map(([t,n])=>(0,L.jsxs)(T.Fragment,{children:[(0,L.jsxs)(`a`,{href:`#/factories/${t}`,className:e===t?`on`:``,"aria-current":e===t?`page`:void 0,children:[n,(0,L.jsx)(`span`,{className:`mono dim`,children:oe[t]??``})]}),e===t&&(0,L.jsx)(_,{label:me[t],total:k.length,cats:ae,cat:E,onChange:D})]},t))})]}),(0,L.jsx)(ee,{label:F,count:j?`${M.length} of ${A.length}`:O?A.length:``,q:C,onQ:w,matched:M.length,inView:[e,t],current:P?.name,sections:B.map(([t,n])=>({key:t,label:n,n:oe[t],href:`#/factories/${t}`,on:e===t})),cats:ae,cat:E,total:k.length,onCat:D,catLabel:me[e],children:O?k.length===0?(0,L.jsx)(p,{title:ve[e].title,children:ve[e].body}):(0,L.jsx)(g,{rows:M,activeName:P?.name,hrefOf:t=>`#/factories/${e}/${R(t.name)}`,pills:G[e]}):se?null:(0,L.jsx)(l,{})}),(0,L.jsx)(`article`,{className:`lib-reader`,"aria-label":`Entry`,children:N?(0,L.jsx)(p,{title:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`code`,{className:`mono`,children:t}),` is not registered any more.`]}),docs:{href:`#/factories/${e}`,label:`All ${F.toLowerCase()} →`}}):P?e===`active`?(0,L.jsx)(J,{run:P,bricks:re,loops:ie}):(0,L.jsx)(_e,{f:P,bricks:re,loops:ie},P.name):e===`active`&&O?(0,L.jsx)(p,{title:`What is a factory?`,docs:{href:`#/docs/factories`,label:`How factories work →`},children:`A factory runs stages, bricks and whole loops, until the work is an open PR.`}):null})]})]})}export{Q as default,H as factoryRows,U as runRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,t as r}from"./motion-RlUl1osO.js";import{n as i,r as a}from"./sections-CtFz7HFH.js";import{V as o,W as s,bt as c,
|
|
1
|
+
import"./rolldown-runtime-XKyaHtl9.js";import{i as e,t}from"./react-C1iE8mnY.js";import{n,t as r}from"./motion-RlUl1osO.js";import{n as i,r as a}from"./sections-CtFz7HFH.js";import{V as o,W as s,bt as c,xt as l,z as u}from"./index-DsLmKHw0.js";import{i as d,n as f,r as p}from"./Dashboard-X7GZzGJp.js";e();var m=t(),h=12,g=Array.from({length:7},(e,t)=>`var(--cat-${t})`),_=n[9];function v({segments:e,size:t=186,stroke:n=26,caption:i=`capabilities`}){let a=e.reduce((e,t)=>e+t.n,0);return(0,m.jsxs)(`div`,{className:`ring-box`,children:[(0,m.jsx)(s,{segments:e,size:t,stroke:n,label:i,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(r,{value:a,duration:_})}),(0,m.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function y(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function b({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=y(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,m.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,m.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function x({label:e,value:t,sub:n,color:r,icon:i}){return(0,m.jsxs)(`div`,{className:`b-tile`,children:[(0,m.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,m.jsx)(c,{name:i})}),(0,m.jsxs)(`div`,{className:`b-tile-body`,children:[(0,m.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,m.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,m.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function S({overview:e,sigil:t,jobs:n,lens:s,onAction:_}){let y=e.counts||{},S=s?.doctor?.state||`loading`,C=s?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=d(e,s?.tone),O=o(n,h),k=l(e.diff),A=a.filter(e=>(y[e]||0)>0).map((e,t)=>({key:e,label:i[e].label,n:y[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),j=A.reduce((e,t)=>e+t.n,0),M=u(n||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`b-greet`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,m.jsx)(`h2`,{className:`h b-h`,children:D}),(0,m.jsx)(f,{verdict:s?.verdict}),(0,m.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,m.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,m.jsxs)(`div`,{className:`card b-hero`,children:[(0,m.jsx)(`div`,{className:`b-hero-ring`,children:(0,m.jsx)(v,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,m.jsxs)(`div`,{className:`b-hero-side`,children:[(0,m.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,onClick:()=>_(`doctor`),children:[(0,m.jsx)(c,{name:`doctor`}),`Retry doctor`]}),(0,m.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,m.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,m.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,m.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,m.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,m.jsxs)(`div`,{className:`b-chips`,children:[(0,m.jsxs)(`span`,{className:`b-chip`,children:[(0,m.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,m.jsx)(`span`,{className:`b-chip`,children:(0,m.jsx)(`b`,{children:e.emit})}),(0,m.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,m.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,m.jsxs)(`div`,{className:`b-tiles`,children:[(0,m.jsx)(x,{label:`Agents`,value:y.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:y.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:y.laws??`—`,sub:y.doctrines?`${y.doctrines.active}/${y.doctrines.total} packs · ${y.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Local edits`,value:k,sub:`files`,color:g[3],icon:`changes`})]})]}),(0,m.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,m.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Capability mix`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:A,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,m.jsxs)(`div`,{className:`b-leg-row`,children:[(0,m.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,m.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,m.jsx)(`span`,{className:`b-leg-bar`,children:(0,m.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,m.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent runs`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`badge ok`,children:[(0,m.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,m.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,m.jsx)(`span`,{className:`b-stat-big`,children:(0,m.jsx)(r,{value:N})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,m.jsx)(b,{data:M,accent:g[0],height:156})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent activity`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,m.jsx)(p,{jobs:n,max:h,empty:(0,m.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{S as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
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-BMFDSXoB.js";import{G as i,J as a,Q as o,Tt as s,U as c,Y as l,Z as u,_t as d,at as f,bt as p,dt as m,ht as h,it as g,mt as _,rt as v,st as y,vt as b,yt as x}from"./index-BNttaGQb.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{t as C}from"./Tabs-d2RIRAKT.js";import{n as w,r as T,t as E}from"./controls-D4wmg_pl.js";var D=e(t(),1),O=n();function k({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,D.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),h=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)}},g=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,O.jsxs)(`div`,{className:`deploy-pop`,children:[(0,O.jsxs)(`div`,{className:`dp-row`,children:[(0,O.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`&&g(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,O.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:h,children:l?`Choosing…`:`Browse…`})]}),d?(0,O.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,O.jsxs)(`div`,{className:`dp-row`,children:[(0,O.jsxs)(`label`,{className:`dp-field`,children:[(0,O.jsx)(`span`,{children:`Deploy as`}),(0,O.jsx)(`select`,{className:`sel`,"aria-label":`host for the new install`,value:s.host,onChange:e=>p(`host`,e.target.value),children:m.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,O.jsx)(w,{value:s,options:n,onChange:p,who:`the new install`}),(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:g,children:`Deploy`}),(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,O.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,O.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function A(){let{data:e,error:t,reload:n}=s(()=>r.excludes(),[]),[i,a]=(0,D.useState)(!1),[o,c]=(0,D.useState)([]),l=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);c(n.messages||[])}catch(e){c(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,O.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Excluded folders`})}),(0,O.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,O.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,O.jsx)(`code`,{children:e.path}),(0,O.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,O.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>l(`remove`,e.path),children:`Remove`})]},e.path)),(0,O.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await l(`add`,e.path):e.error&&c([e.error])}catch(e){c([e.message])}finally{a(!1)}},children:[(0,O.jsx)(x,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,O.jsx)(`p`,{className:`sub`,children:e},t))]})}var j=`This project sees your machine-wide rules, profile and memory map, so what you taught one tool or repo applies here too.`,M=`About 1 500 tokens at every session start, growing with your rules. The hook budget is fixed at 9 000 characters, and the tier loads before this project's docs, so a large tier can push them down to a lazy listing.`;function N({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,O.jsxs)(`div`,{className:`ip-block`,children:[(0,O.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,O.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,O.jsxs)(`div`,{className:`mcp-target`,children:[(0,O.jsxs)(`div`,{className:`mt-head`,children:[(0,O.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,O.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,O.jsxs)(`div`,{className:`mcp-row`,children:[(0,O.jsx)(`span`,{className:`mono`,children:e.name}),(0,O.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,O.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,O.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,O.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var P={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function F({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=`${_(e.host).label} · ${e.scope}`,[g,v]=P[e.state]||P.absent,y=e.state===`active`,b=e.state===`absent`;return(0,O.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,O.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,O.jsxs)(`div`,{className:`ip-head`,children:[(0,O.jsx)(`h2`,{children:h(e)}),(0,O.jsx)(`span`,{className:`tag ${v}`,children:g})]}),(0,O.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,O.jsx)(`code`,{className:`ip-path`,children:e.path}),b?(0,O.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,O.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(y||b)&&o?(0,O.jsxs)(`div`,{className:`ip-picks`,children:[(0,O.jsx)(w,{value:n,options:i,onChange:a,who:m}),(0,O.jsxs)(`p`,{className:`sub`,children:[n.footprint===`lean`?`Lean footprint: terse rule lines and a pointer to the full file, about 40% smaller.`:`Full footprint: every rule’s complete text inline, the largest context.`,` `,`Every rule stays in force. `,(0,O.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]})]}):null,(y||b)&&o&&e.scope!==`global`?(0,O.jsxs)(`div`,{className:`ip-block`,children:[(0,O.jsxs)(`label`,{className:`ip-switch`,children:[(0,O.jsx)(T,{on:!!n.sharedTier,label:`shared tier for ${m}`,onToggle:()=>a(`sharedTier`,!n.sharedTier)}),(0,O.jsx)(`span`,{children:`Read the machine-wide shared tier`})]}),(0,O.jsxs)(`p`,{className:`sub`,children:[(0,O.jsx)(`strong`,{children:`Benefit:`}),` `,j]}),(0,O.jsxs)(`p`,{className:`sub`,children:[(0,O.jsx)(`strong`,{children:`Cost:`}),` `,M]})]}):null,y&&t.length?(0,O.jsx)(N,{targets:t,onReveal:p}):null,y&&e.scope===`global`?(0,O.jsx)(A,{}):null,b?null:(0,O.jsxs)(`label`,{className:`ip-switch`,children:[(0,O.jsx)(T,{on:y,disabled:s,label:`activate ${m}`,onToggle:d}),(0,O.jsx)(`span`,{children:y?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,O.jsx)(`div`,{className:`ip-spacer`}),o?(0,O.jsxs)(`div`,{className:`ip-actions`,children:[b?(0,O.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):y?(0,O.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,b?null:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`label`,{className:`field`,children:[(0,O.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,O.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,O.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,O.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,O.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,O.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}function I({dataRev:e}){let{data:t,error:n,reload:i}=s(()=>r.migratePreview(),[e]);return(0,O.jsxs)(`section`,{className:`panel`,"aria-labelledby":`preview-h`,children:[(0,O.jsx)(`div`,{className:`panel-head`,children:(0,O.jsx)(`h2`,{id:`preview-h`,children:`Next rebuild`})}),n?(0,O.jsx)(v,{error:n,onRetry:i}):t?(0,O.jsxs)(O.Fragment,{children:[t.folds.length?(0,O.jsx)(`ul`,{className:`preview-list`,children:t.folds.map(e=>(0,O.jsxs)(`li`,{children:[(0,O.jsx)(`b`,{className:`mono`,children:e.host}),` `,e.summary||`nothing to fold`,e.failed.map(e=>(0,O.jsxs)(`div`,{className:`t-warn`,children:[`The fold would stop at `,e]},e))]},e.host))}):(0,O.jsx)(`p`,{className:`dim`,children:`No global install to fold.`}),t.orphans.length?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{children:`Orphans`}),(0,O.jsx)(`p`,{className:`dim`,children:`No manifest owns these. An earlier build may have written them, or they may be yours. Nothing moves them: if one is not yours, move it by hand.`}),(0,O.jsx)(`ul`,{className:`preview-list mono`,children:t.orphans.map(e=>(0,O.jsx)(`li`,{children:e},e))})]}):null]}):(0,O.jsx)(g,{})]})}var L=(e,t)=>`${e} ${t}`,R=[`claude`,`bob`,`openclaude`],z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},B=/[\\/]\.claude[\\/]worktrees[\\/]/,V=e=>e.scope===`project`&&B.test(e.path);function ee(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?p(e.drift):0;return i?`${r} · ${i} edited`:r}function te({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,O.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,O.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?p(t.drift):0;return(0,O.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,O.jsx)(c,{label:`Sync with source of ${h(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`local edits`,n:a,tone:`bad`}]}):null,(0,O.jsx)(`span`,{className:`dim`,children:ee(t,n)}),t.diffable?null:(0,O.jsxs)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function H({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o,onDefault:s,busyKey:c}){let l=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,O.jsx)(`div`,{className:`tbl-scroll`,children:(0,O.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,O.jsx)(`th`,{scope:`col`,children:`State`}),(0,O.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,O.jsx)(`th`,{scope:`col`,children:(0,O.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,O.jsx)(`tbody`,{children:e.map(e=>{let[i,u]=z[e.state]||[`Not installed`,``],d=n===e.id,f=e.state===`absent`;return(0,O.jsxs)(`tr`,{className:`pickable${d?` on`:``}${f?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,O.jsxs)(`td`,{children:[(0,O.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":d,title:e.path,onClick:()=>r(e.id),children:h(e)}),(0,O.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?_(e.host).label:e.path})]}),(0,O.jsxs)(`td`,{children:[(0,O.jsx)(`span`,{className:`tag ${u}`,children:i}),e.default?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.jsx)(`span`,{className:`tag`,title:`A page that names no install reads this one, and pickers start on it`,children:`Default`})]}):e.state===`active`&&s?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Make ${h(e)} the default install`,disabled:c===e.id,onClick:t=>{t.stopPropagation(),s(e)},children:`Make default`})]}):null,V(e)?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.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,O.jsx)(`td`,{children:(0,O.jsx)(te,{inst:e,fleet:l(e),version:a?.version,onEdits:o})}),(0,O.jsx)(`td`,{className:`pick-mark`,children:d?`Editing ›`:``})]},e.id)})})]})})}function ne({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,O.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,O.jsxs)(`summary`,{children:[(0,O.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,O.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,O.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,O.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,O.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,O.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function re({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,O.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,O.jsxs)(`div`,{className:`panel-head`,children:[(0,O.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,O.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:n?`in sync`:e.version_verdict})]}),(0,O.jsxs)(`dl`,{className:`kv-grid`,children:[(0,O.jsx)(`dt`,{children:`Source`}),(0,O.jsx)(`dd`,{className:`mono`,children:e.root}),(0,O.jsx)(`dt`,{children:`Version`}),(0,O.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,O.jsx)(`dt`,{children:`Fingerprint`}),(0,O.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function U({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:c,onMutated:u}){let d=y(),{data:f,error:p,reload:m}=s(()=>r.installs(),[c]),{data:C,error:w,reload:T}=s(()=>r.mcp(),[c]),{data:A,error:j}=s(()=>r.fleet(),[c]),M=j?null:A??void 0,[N,P]=(0,D.useState)(null),[z,B]=(0,D.useState)(``),[V,ee]=(0,D.useState)({}),[te,U]=(0,D.useState)(!1),[W,G]=(0,D.useState)(!1),[K,q]=(0,D.useState)({id:``,value:`keep`}),J=e=>K.id===e?.id?K.value:`keep`,[Y,X]=(0,D.useState)(()=>l(`hosts`)),ie=(0,D.useMemo)(()=>{let e={};for(let t of C?.targets||[]){let n=L(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[C]);if(p||w)return(0,O.jsx)(v,{error:p||w,onRetry:()=>{m(),T()}});if(!f||!C)return(0,O.jsx)(g,{});let ae={active:0,disabled:1,absent:2},Z=[...f.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(ae[e.state]??3)-(ae[t.state]??3)),Q=Z.find(e=>e.id===Y)||Z.find(e=>e.default)||Z.find(e=>e.state===`active`)||Z[0],$=e=>{let t=V[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`,sharedTier:t.sharedTier??!!e.sharedTier}},oe=(e,t,n)=>ee(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),se=e=>{let t=$(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)&&(e.scope===`global`||t.sharedTier===!!e.sharedTier)},ce={theme:t.map(e=>e.name),footprint:E,posture:f.postures||[],mode:f.modes||[],trust:f.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o,sharedTier:s}=$(t),c=_(t.host).label,l=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${c} into ${t.path} with the “${n}” voice (${l})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${c} install (voice “${n}”, ${l})? It rebuilds in place, non-destructive.`;await d(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o,...t.scope===`global`?{}:{sharedTier:s}})},ue=async e=>{if(e.state!==`active`||await d(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){B(e.id),P(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(`, `):``;P({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}u?.()}catch(e){P({text:e.message,tone:`bad`})}finally{B(``)}}},de=async e=>{B(e.id),P(null);try{await r.setDefaultInstall(e.host,e.path),u?.()}catch(e){P({text:e.message,tone:`bad`})}finally{B(``)}},fe=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&R.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},pe=async e=>{let t=J(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${fe(e,`memory`)} and ${fe(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await d(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${b(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this install?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){B(e.id),P(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){P({text:n.error||`remove failed`,tone:`bad`});return}q({id:``,value:`keep`}),n.kept?.length&&P({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),u?.()}catch(e){P({text:e.message,tone:`bad`})}finally{B(``)}}},me=async e=>{P(null);try{let t=await r.mcpReveal(e.path);P({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){P({text:e.message,tone:`bad`})}},he=async()=>{let t=Z.filter(e=>e.state===`active`).map(e=>`${h(e)} · ${e.scope}`);await d(`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`)},ge=Z.find(e=>e.default)?.host||Z.find(e=>e.state===`active`)?.host||Z[0]?.host||`opencode`,_e=Z.filter(e=>e.scope===`global`),ve=Z.filter(e=>e.scope!==`global`),ye=e=>{X(e)},be=e=>{a(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,O.jsxs)(`div`,{className:`hosts`,children:[(0,O.jsxs)(`div`,{className:`hosts-main`,children:[(0,O.jsxs)(`div`,{className:`toolbar`,children:[(0,O.jsxs)(`span`,{className:`dim`,children:[Z.filter(e=>e.state!==`absent`).length,` installed.`]}),(0,O.jsxs)(`div`,{className:`row gap-8`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn ghost`,"aria-expanded":W,onClick:()=>G(e=>!e),children:`Preview next rebuild`}),e?(0,O.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:he,children:[(0,O.jsx)(x,{name:`refresh`}),` Rebuild all`]}):null]})]}),W?(0,O.jsx)(I,{dataRev:c}):null,N?.tone===`bad`?(0,O.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:N.text}):N?(0,O.jsx)(`p`,{className:`tag ${N.tone===`ok`?`ok `:``}note`,role:`status`,children:N.text}):null,(0,O.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,O.jsx)(`div`,{className:`inst-head`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,O.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,O.jsx)(H,{rows:_e,currentId:Q?.id,onPick:ye,label:`Global installs`,fleet:M,onEdits:be,onDefault:e?de:void 0,busyKey:z})]}),(0,O.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,O.jsxs)(`div`,{className:`inst-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,O.jsx)(`p`,{className:`dim`,children:`A repo with its own install. Inside it, only that install loads.`})]}),e?(0,O.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>U(e=>!e),children:[(0,O.jsx)(x,{name:`folder`}),` Deploy to a repo…`]}):null]}),te?(0,O.jsx)(`div`,{className:`inst-deploy`,children:(0,O.jsx)(k,{host:ge,theme:n||`neutral`,options:ce,onAction:e,onClose:()=>U(!1),onNote:e=>P(e?{text:e,tone:`bad`}:null)})}):null,ve.length?(0,O.jsx)(H,{rows:ve,project:!0,currentId:Q?.id,onPick:ye,label:`Per-project installs`,fleet:M,onEdits:be,onDefault:e?de:void 0,busyKey:z}):(0,O.jsx)(S,{children:`No repo has its own install yet. Deploy one to give a project its own rules and voice.`})]}),(0,O.jsx)(re,{setup:o,overview:i}),(0,O.jsx)(ne,{themes:t,current:i?.theme})]}),Q?(0,O.jsx)(F,{inst:Q,targets:ie[L(Q.host,Q.path)]||[],choice:$(Q),unchanged:se(Q),options:ce,onPick:(e,t)=>oe(Q,e,t),canAct:!!e,busy:z===Q.id,memory:J(Q),onMemory:e=>q({id:Q.id,value:e}),onApply:()=>le(Q),onToggleInstall:()=>ue(Q),onRemove:()=>pe(Q),onRevealMcp:me},Q.id):null]})}function W(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var G=300;function K(e){let t=o(e.dataRev),[n,r]=u(`edits`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(g,{}):(0,O.jsx)(q,{install:n,...e},n?.id||``)]})}function q({install:e,onMutated:t,onAction:n,dataRev:i,overview:a}){let o=y(),{data:c,error:l,reload:u}=s(()=>r.diff(d(e)),[i]),[f,p]=(0,D.useState)(!1),[m,h]=(0,D.useState)(``),[_,b]=(0,D.useState)(()=>new Set),[C,w]=(0,D.useState)(()=>new Set),[T,E]=(0,D.useState)(null);if(c&&c!==T){E(c),b(new Set);let e=c.files.reduce((e,t)=>e+t.diff.length,0);w(new Set(e<=G?c.files.map(e=>e.rel):[]))}let k=e=>b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),A=()=>b(e=>e.size===N.length?new Set:new Set(N.map(e=>e.rel))),j=()=>n?.(`export`),M=async()=>{let n=[..._],i=n.filter(e=>c.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
|
|
3
|
-
`),children:[P.length,` linked — yours, left alone`]}):null,N.length===0&&F.length===0?(0,O.jsx)(S,{title:`In sync`,children:`This install matches its source.`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`row between mb-14`,children:[(0,O.jsxs)(`div`,{className:`row gap-10`,children:[(0,O.jsxs)(`span`,{className:`badge warn`,children:[(0,O.jsx)(`span`,{className:`dot`}),I,` edited`]}),(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),L,` added`]}),R>0&&(0,O.jsxs)(`span`,{className:`badge bad`,children:[(0,O.jsx)(`span`,{className:`dot`}),R,` missing`]}),F.length>0&&(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),F.length,` behind`]})]}),(0,O.jsxs)(`div`,{className:`row gap-10`,children:[(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>w(new Set(c.files.map(e=>e.rel))),children:`Expand all`}),(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>w(new Set),children:`Collapse all`}),N.length?(0,O.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:
|
|
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-DLDVY3K-.js";import{Et as i,G as a,J as o,Q as s,U as c,Y as l,Z as u,at as d,bt as f,ct as p,ft as m,gt as h,ht as g,it as _,rt as v,vt as y,xt as b,yt as x}from"./index-DsLmKHw0.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{t as C}from"./Tabs-B594Pad_.js";import{n as w,r as T,t as E}from"./controls-D4wmg_pl.js";var D=e(t(),1),O=n();function k({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,D.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,D.useState)(!1),[d,f]=(0,D.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),h=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)}},_=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,O.jsxs)(`div`,{className:`deploy-pop`,children:[(0,O.jsxs)(`div`,{className:`dp-row`,children:[(0,O.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`&&_(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,O.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:h,children:l?`Choosing…`:`Browse…`})]}),d?(0,O.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,O.jsxs)(`div`,{className:`dp-row`,children:[(0,O.jsxs)(`label`,{className:`dp-field`,children:[(0,O.jsx)(`span`,{children:`Deploy as`}),(0,O.jsx)(`select`,{className:`sel`,"aria-label":`host for the new install`,value:s.host,onChange:e=>p(`host`,e.target.value),children:m.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,O.jsx)(w,{value:s,options:n,onChange:p,who:`the new install`}),(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:_,children:`Deploy`}),(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,O.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,O.jsx)(`code`,{children:g(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function A(){let{data:e,error:t,reload:n}=i(()=>r.excludes(),[]),[a,o]=(0,D.useState)(!1),[s,c]=(0,D.useState)([]),l=async(e,t)=>{o(!0);try{let n=await r.excludeMutate(e,t);c(n.messages||[])}catch(e){c(e.body?.messages||[e.message])}finally{o(!1),n()}};return t||!e?.installs?.length?null:(0,O.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Excluded folders`})}),(0,O.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,O.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,O.jsx)(`code`,{children:e.path}),(0,O.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>g(e).label).join(`, `)}),(0,O.jsx)(`button`,{className:`btn ghost sm`,disabled:a,"aria-label":`Stop excluding ${e.path}`,onClick:()=>l(`remove`,e.path),children:`Remove`})]},e.path)),(0,O.jsxs)(`button`,{className:`btn ghost sm`,disabled:a,onClick:async()=>{o(!0);try{let e=await r.pickFolder();e.path?await l(`add`,e.path):e.error&&c([e.error])}catch(e){c([e.message])}finally{o(!1)}},children:[(0,O.jsx)(f,{name:`folder`}),` Exclude a folder…`]}),s.map((e,t)=>(0,O.jsx)(`p`,{className:`sub`,children:e},t))]})}var j=`This project sees your machine-wide rules, profile and memory map, so what you taught one tool or repo applies here too.`,M=`About 1 500 tokens at every session start, growing with your rules. The hook budget is fixed at 9 000 characters, and the tier loads before this project's docs, so a large tier can push them down to a lazy listing.`;function N({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,O.jsxs)(`div`,{className:`ip-block`,children:[(0,O.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,O.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,O.jsxs)(`div`,{className:`mcp-target`,children:[(0,O.jsxs)(`div`,{className:`mt-head`,children:[(0,O.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,O.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,O.jsxs)(`div`,{className:`mcp-row`,children:[(0,O.jsx)(`span`,{className:`mono`,children:e.name}),(0,O.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,O.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,O.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,O.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var P={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function F({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=`${g(e.host).label} · ${e.scope}`,[_,v]=P[e.state]||P.absent,y=e.state===`active`,b=e.state===`absent`;return(0,O.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,O.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,O.jsxs)(`div`,{className:`ip-head`,children:[(0,O.jsx)(`h2`,{children:h(e)}),(0,O.jsx)(`span`,{className:`tag ${v}`,children:_})]}),(0,O.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${g(e.host).label}`}),(0,O.jsx)(`code`,{className:`ip-path`,children:e.path}),b?(0,O.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,O.jsx)(`strong`,{children:g(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(y||b)&&o?(0,O.jsxs)(`div`,{className:`ip-picks`,children:[(0,O.jsx)(w,{value:n,options:i,onChange:a,who:m}),(0,O.jsxs)(`p`,{className:`sub`,children:[n.footprint===`lean`?`Lean footprint: terse rule lines and a pointer to the full file, about 40% smaller.`:`Full footprint: every rule’s complete text inline, the largest context.`,` `,`Every rule stays in force. `,(0,O.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]})]}):null,(y||b)&&o&&e.scope!==`global`?(0,O.jsxs)(`div`,{className:`ip-block`,children:[(0,O.jsxs)(`label`,{className:`ip-switch`,children:[(0,O.jsx)(T,{on:!!n.sharedTier,label:`shared tier for ${m}`,onToggle:()=>a(`sharedTier`,!n.sharedTier)}),(0,O.jsx)(`span`,{children:`Read the machine-wide shared tier`})]}),(0,O.jsxs)(`p`,{className:`sub`,children:[(0,O.jsx)(`strong`,{children:`Benefit:`}),` `,j]}),(0,O.jsxs)(`p`,{className:`sub`,children:[(0,O.jsx)(`strong`,{children:`Cost:`}),` `,M]})]}):null,y&&t.length?(0,O.jsx)(N,{targets:t,onReveal:p}):null,y&&e.scope===`global`?(0,O.jsx)(A,{}):null,b?null:(0,O.jsxs)(`label`,{className:`ip-switch`,children:[(0,O.jsx)(T,{on:y,disabled:s,label:`activate ${m}`,onToggle:d}),(0,O.jsx)(`span`,{children:y?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,O.jsx)(`div`,{className:`ip-spacer`}),o?(0,O.jsxs)(`div`,{className:`ip-actions`,children:[b?(0,O.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):y?(0,O.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,b?null:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`label`,{className:`field`,children:[(0,O.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,O.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,O.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,O.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,O.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,O.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}function I({dataRev:e}){let{data:t,error:n,reload:a}=i(()=>r.migratePreview(),[e]);return(0,O.jsxs)(`section`,{className:`panel`,"aria-labelledby":`preview-h`,children:[(0,O.jsx)(`div`,{className:`panel-head`,children:(0,O.jsx)(`h2`,{id:`preview-h`,children:`Next rebuild`})}),n?(0,O.jsx)(v,{error:n,onRetry:a}):t?(0,O.jsxs)(O.Fragment,{children:[t.folds.length?(0,O.jsx)(`ul`,{className:`preview-list`,children:t.folds.map(e=>(0,O.jsxs)(`li`,{children:[(0,O.jsx)(`b`,{className:`mono`,children:e.host}),` `,e.summary||`nothing to fold`,e.failed.map(e=>(0,O.jsxs)(`div`,{className:`t-warn`,children:[`The fold would stop at `,e]},e))]},e.host))}):(0,O.jsx)(`p`,{className:`dim`,children:`No global install to fold.`}),t.orphans.length?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`h3`,{children:`Orphans`}),(0,O.jsx)(`p`,{className:`dim`,children:`No manifest owns these. An earlier build may have written them, or they may be yours. Nothing moves them: if one is not yours, move it by hand.`}),(0,O.jsx)(`ul`,{className:`preview-list mono`,children:t.orphans.map(e=>(0,O.jsx)(`li`,{children:e},e))})]}):null]}):(0,O.jsx)(_,{})]})}var L=(e,t)=>`${e} ${t}`,R=[`claude`,`bob`,`openclaude`],z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},B=/[\\/]\.claude[\\/]worktrees[\\/]/,V=e=>e.scope===`project`&&B.test(e.path);function ee(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?b(e.drift):0;return i?`${r} · ${i} edited`:r}function te({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,O.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,O.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?b(t.drift):0;return(0,O.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,O.jsx)(c,{label:`Sync with source of ${h(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`local edits`,n:a,tone:`bad`}]}):null,(0,O.jsx)(`span`,{className:`dim`,children:ee(t,n)}),t.diffable?null:(0,O.jsxs)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function H({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o,onDefault:s,busyKey:c}){let l=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,O.jsx)(`div`,{className:`tbl-scroll`,children:(0,O.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,O.jsx)(`th`,{scope:`col`,children:`State`}),(0,O.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,O.jsx)(`th`,{scope:`col`,children:(0,O.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,O.jsx)(`tbody`,{children:e.map(e=>{let[i,u]=z[e.state]||[`Not installed`,``],d=n===e.id,f=e.state===`absent`;return(0,O.jsxs)(`tr`,{className:`pickable${d?` on`:``}${f?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,O.jsxs)(`td`,{children:[(0,O.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":d,title:e.path,onClick:()=>r(e.id),children:h(e)}),(0,O.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?g(e.host).label:e.path})]}),(0,O.jsxs)(`td`,{children:[(0,O.jsx)(`span`,{className:`tag ${u}`,children:i}),e.default?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.jsx)(`span`,{className:`tag`,title:`A page that names no install reads this one, and pickers start on it`,children:`Default`})]}):e.state===`active`&&s?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Make ${h(e)} the default install`,disabled:c===e.id,onClick:t=>{t.stopPropagation(),s(e)},children:`Make default`})]}):null,V(e)?(0,O.jsxs)(O.Fragment,{children:[` `,(0,O.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,O.jsx)(`td`,{children:(0,O.jsx)(te,{inst:e,fleet:l(e),version:a?.version,onEdits:o})}),(0,O.jsx)(`td`,{className:`pick-mark`,children:d?`Editing ›`:``})]},e.id)})})]})})}function ne({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,O.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,O.jsxs)(`summary`,{children:[(0,O.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,O.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,O.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,O.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,O.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,O.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function re({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,O.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,O.jsxs)(`div`,{className:`panel-head`,children:[(0,O.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,O.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:n?`in sync`:e.version_verdict})]}),(0,O.jsxs)(`dl`,{className:`kv-grid`,children:[(0,O.jsx)(`dt`,{children:`Source`}),(0,O.jsx)(`dd`,{className:`mono`,children:e.root}),(0,O.jsx)(`dt`,{children:`Version`}),(0,O.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,O.jsx)(`dt`,{children:`Fingerprint`}),(0,O.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function U({onAction:e,themes:t=[],currentTheme:n,overview:a,setup:s,dataRev:c,onMutated:u}){let d=p(),{data:m,error:y,reload:b}=i(()=>r.installs(),[c]),{data:C,error:w,reload:T}=i(()=>r.mcp(),[c]),{data:A,error:j}=i(()=>r.fleet(),[c]),M=j?null:A??void 0,[N,P]=(0,D.useState)(null),[z,B]=(0,D.useState)(``),[V,ee]=(0,D.useState)({}),[te,U]=(0,D.useState)(!1),[W,G]=(0,D.useState)(!1),[K,q]=(0,D.useState)({id:``,value:`keep`}),J=e=>K.id===e?.id?K.value:`keep`,[Y,X]=(0,D.useState)(()=>l(`hosts`)),ie=(0,D.useMemo)(()=>{let e={};for(let t of C?.targets||[]){let n=L(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[C]);if(y||w)return(0,O.jsx)(v,{error:y||w,onRetry:()=>{b(),T()}});if(!m||!C)return(0,O.jsx)(_,{});let ae={active:0,disabled:1,absent:2},Z=[...m.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(ae[e.state]??3)-(ae[t.state]??3)),Q=Z.find(e=>e.id===Y)||Z.find(e=>e.default)||Z.find(e=>e.state===`active`)||Z[0],$=e=>{let t=V[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`,sharedTier:t.sharedTier??!!e.sharedTier}},oe=(e,t,n)=>ee(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),se=e=>{let t=$(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)&&(e.scope===`global`||t.sharedTier===!!e.sharedTier)},ce={theme:t.map(e=>e.name),footprint:E,posture:m.postures||[],mode:m.modes||[],trust:m.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o,sharedTier:s}=$(t),c=g(t.host).label,l=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${c} into ${t.path} with the “${n}” voice (${l})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${c} install (voice “${n}”, ${l})? It rebuilds in place, non-destructive.`;await d(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o,...t.scope===`global`?{}:{sharedTier:s}})},ue=async e=>{if(e.state!==`active`||await d(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){B(e.id),P(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(`, `):``;P({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}u?.()}catch(e){P({text:e.message,tone:`bad`})}finally{B(``)}}},de=async e=>{B(e.id),P(null);try{await r.setDefaultInstall(e.host,e.path),u?.()}catch(e){P({text:e.message,tone:`bad`})}finally{B(``)}},fe=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&R.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},pe=async e=>{let t=J(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${fe(e,`memory`)} and ${fe(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await d(`Uninstall ${g(e.host).label} · ${e.scope}? It deletes ${x(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this install?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){B(e.id),P(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){P({text:n.error||`remove failed`,tone:`bad`});return}q({id:``,value:`keep`}),n.kept?.length&&P({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),u?.()}catch(e){P({text:e.message,tone:`bad`})}finally{B(``)}}},me=async e=>{P(null);try{let t=await r.mcpReveal(e.path);P({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){P({text:e.message,tone:`bad`})}},he=async()=>{let t=Z.filter(e=>e.state===`active`).map(e=>`${h(e)} · ${e.scope}`);await d(`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`)},ge=Z.find(e=>e.default)?.host||Z.find(e=>e.state===`active`)?.host||Z[0]?.host||`opencode`,_e=Z.filter(e=>e.scope===`global`),ve=Z.filter(e=>e.scope!==`global`),ye=e=>{X(e)},be=e=>{o(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,O.jsxs)(`div`,{className:`hosts`,children:[(0,O.jsxs)(`div`,{className:`hosts-main`,children:[(0,O.jsxs)(`div`,{className:`toolbar`,children:[(0,O.jsxs)(`span`,{className:`dim`,children:[Z.filter(e=>e.state!==`absent`).length,` installed.`]}),(0,O.jsxs)(`div`,{className:`row gap-8`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn ghost`,"aria-expanded":W,onClick:()=>G(e=>!e),children:`Preview next rebuild`}),e?(0,O.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:he,children:[(0,O.jsx)(f,{name:`refresh`}),` Rebuild all`]}):null]})]}),W?(0,O.jsx)(I,{dataRev:c}):null,N?.tone===`bad`?(0,O.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:N.text}):N?(0,O.jsx)(`p`,{className:`tag ${N.tone===`ok`?`ok `:``}note`,role:`status`,children:N.text}):null,(0,O.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,O.jsx)(`div`,{className:`inst-head`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,O.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,O.jsx)(H,{rows:_e,currentId:Q?.id,onPick:ye,label:`Global installs`,fleet:M,onEdits:be,onDefault:e?de:void 0,busyKey:z})]}),(0,O.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,O.jsxs)(`div`,{className:`inst-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,O.jsx)(`p`,{className:`dim`,children:`A repo with its own install. Inside it, only that install loads.`})]}),e?(0,O.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>U(e=>!e),children:[(0,O.jsx)(f,{name:`folder`}),` Deploy to a repo…`]}):null]}),te?(0,O.jsx)(`div`,{className:`inst-deploy`,children:(0,O.jsx)(k,{host:ge,theme:n||`neutral`,options:ce,onAction:e,onClose:()=>U(!1),onNote:e=>P(e?{text:e,tone:`bad`}:null)})}):null,ve.length?(0,O.jsx)(H,{rows:ve,project:!0,currentId:Q?.id,onPick:ye,label:`Per-project installs`,fleet:M,onEdits:be,onDefault:e?de:void 0,busyKey:z}):(0,O.jsx)(S,{children:`No repo has its own install yet. Deploy one to give a project its own rules and voice.`})]}),(0,O.jsx)(re,{setup:s,overview:a}),(0,O.jsx)(ne,{themes:t,current:a?.theme})]}),Q?(0,O.jsx)(F,{inst:Q,targets:ie[L(Q.host,Q.path)]||[],choice:$(Q),unchanged:se(Q),options:ce,onPick:(e,t)=>oe(Q,e,t),canAct:!!e,busy:z===Q.id,memory:J(Q),onMemory:e=>q({id:Q.id,value:e}),onApply:()=>le(Q),onToggleInstall:()=>ue(Q),onRemove:()=>pe(Q),onRevealMcp:me},Q.id):null]})}function W(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var G=300;function K(e){let t=s(e.dataRev),[n,r]=u(`edits`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(d,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(_,{}):(0,O.jsx)(q,{install:n,...e},n?.id||``)]})}function q({install:e,onMutated:t,onAction:n,dataRev:a,overview:o}){let s=p(),{data:c,error:l,reload:u}=i(()=>r.diff(y(e)),[a]),[d,m]=(0,D.useState)(!1),[h,g]=(0,D.useState)(``),[b,x]=(0,D.useState)(()=>new Set),[C,w]=(0,D.useState)(()=>new Set),[T,E]=(0,D.useState)(null);if(c&&c!==T){E(c),x(new Set);let e=c.files.reduce((e,t)=>e+t.diff.length,0);w(new Set(e<=G?c.files.map(e=>e.rel):[]))}let k=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),A=()=>x(e=>e.size===N.length?new Set:new Set(N.map(e=>e.rel))),j=()=>n?.(`export`),M=async()=>{let n=[...b],i=n.filter(e=>c.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,y(e)),a=i.errors.length?` · ${i.errors.length} error(s): ${i.errors.join(`; `)}`:``;g(`Restored ${i.restored.length}, archived ${i.deleted.length}${a}`),await u(),t?.()}catch(e){g(e.message)}finally{m(!1)}}};if(l)return(0,O.jsx)(v,{error:l,onRetry:u});if(!c)return(0,O.jsx)(_,{});if(!c.deployed)return(0,O.jsx)(S,{title:`Nothing installed here`,children:`Nothing to compare.`});if(!c.diffable)return(0,O.jsx)(S,{title:`No local-edit check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`Local edits are only checked for global installs. Pick a global install above.`});let N=c.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),P=c.files.filter(e=>e.status===`linked`),F=c.files.filter(e=>e.status===`stale`),I=N.filter(e=>e.status===`edited`).length,L=N.filter(e=>e.status===`added`).length,R=N.filter(e=>e.status===`missing`).length,z=e=>w(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`h`,children:`Local edits`}),c.target?(0,O.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,O.jsx)(`code`,{children:c.target}),c.theme?` (${c.theme} voice)`:``,` with source`,` `,o?.version||`unknown`,`.`]}):null,I>0?(0,O.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):L+R>0?(0,O.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,O.jsxs)(`div`,{className:`row gap-10`,children:[(0,O.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:d||b.size===0,onClick:M,children:[`Restore`,b.size?` (${b.size})`:``]}),(0,O.jsxs)(`button`,{className:`btn`,disabled:d,onClick:j,children:[(0,O.jsx)(f,{name:`download`}),`Export improvements`]})]})]}),h?(0,O.jsx)(`p`,{className:`sub mb-14`,children:h}):null,P.length?(0,O.jsxs)(`p`,{className:`sub dim mb-14`,title:P.map(e=>e.rel).join(`
|
|
3
|
+
`),children:[P.length,` linked — yours, left alone`]}):null,N.length===0&&F.length===0?(0,O.jsx)(S,{title:`In sync`,children:`This install matches its source.`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`row between mb-14`,children:[(0,O.jsxs)(`div`,{className:`row gap-10`,children:[(0,O.jsxs)(`span`,{className:`badge warn`,children:[(0,O.jsx)(`span`,{className:`dot`}),I,` edited`]}),(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),L,` added`]}),R>0&&(0,O.jsxs)(`span`,{className:`badge bad`,children:[(0,O.jsx)(`span`,{className:`dot`}),R,` missing`]}),F.length>0&&(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),F.length,` behind`]})]}),(0,O.jsxs)(`div`,{className:`row gap-10`,children:[(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>w(new Set(c.files.map(e=>e.rel))),children:`Expand all`}),(0,O.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>w(new Set),children:`Collapse all`}),N.length?(0,O.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:b.size===N.length,onChange:A}),`Select all`]}):null]})]}),(0,O.jsx)(`div`,{className:`stack gap-12`,children:N.map(e=>B(e,!0))}),F.length?(0,O.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,O.jsx)(`h3`,{children:`Behind source`}),(0,O.jsxs)(`div`,{className:`row between`,children:[(0,O.jsx)(`p`,{className:`sub`,children:`This install is built from older source. Rebuild to bring these files in sync.`}),(0,O.jsx)(`button`,{className:`btn ghost`,disabled:d,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),F.map(e=>B(e,!1))]}):null]})]});function B(e,t){let n=C.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,O.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,O.jsxs)(`div`,{className:`diff-head`,children:[t?(0,O.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:b.has(e.rel),onChange:()=>k(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,O.jsx)(`span`,{className:`fname`,children:e.rel}),(0,O.jsxs)(`span`,{className:`badge ${r}`,children:[(0,O.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,O.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,O.jsx)(`button`,{className:`iconbtn`,onClick:()=>z(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,O.jsx)(f,{name:`chevron`})})]}),n&&(0,O.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,O.jsx)(`div`,{className:`diff-line ${W(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,D.useState)(!n);return(0,O.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,O.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,O.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,O.jsx)(`h3`,{children:e.label}),(0,O.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,O.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,O.jsx)(f,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,O.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,O.jsxs)(`div`,{className:`problem`,children:[(0,O.jsx)(`span`,{className:`x`,children:`✕`}),(0,O.jsx)(`span`,{children:e})]},e))})]})}function Y({dataRev:e}){let t=s(e),[n,r]=u(`doctor`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(d,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(_,{}):(0,O.jsx)(X,{install:n,dataRev:e},n?.id||``)]})}function X({install:e,dataRev:t}){let n=(0,D.useRef)(!1),{data:a,error:o,reload:s,setData:c}=i(()=>{let t=n.current;return n.current=!1,r.doctor(t,y(e))},[t]),l=()=>{n.current=!0,c(null),s()};if(o)return(0,O.jsx)(v,{error:o,onRetry:s});let u=a?a.groups.filter(e=>e.problems.length):[],d=a?a.groups.filter(e=>!e.problems.length):[];return(0,O.jsxs)(`div`,{className:`page-fill`,children:[(0,O.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,O.jsx)(`p`,{className:`sub`,children:`Builds this install’s voice in a sandbox and validates the result: token resolution, link integrity, parity, and local edits.`})]}),(0,O.jsxs)(`button`,{className:`btn`,onClick:l,disabled:!a,children:[(0,O.jsx)(f,{name:`refresh`}),a?`Run doctor`:`Running…`]})]}),a?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,O.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,O.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,O.jsxs)(`span`,{className:`dim mono`,children:[`validated `,a.themes.length,` voice`,a.themes.length===1?``:`s`]}),a.checked_at?(0,O.jsxs)(`span`,{className:`dim mono`,title:a.checked_at,children:[`checked `,a.checked_at.slice(11)]}):null,a.themes.map(e=>(0,O.jsx)(`span`,{className:`badge cap`,children:e},e))]}),a.ok?(0,O.jsxs)(`span`,{className:`badge ok`,children:[(0,O.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,O.jsxs)(`span`,{className:`badge bad`,children:[(0,O.jsx)(`span`,{className:`dot`}),a.problems.length,` problem`,a.problems.length===1?``:`s`]})]})}),(0,O.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,O.jsx)(J,{group:e,i:t},e.label)),d.length?(0,O.jsxs)(`details`,{className:`check-fold`,children:[(0,O.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,O.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,O.jsx)(J,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,O.jsx)(_,{label:`Running every check (builds this install’s voice in a sandbox)…`})]})}function ie({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:o,dataRev:s}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(a,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,O.jsx)(C,{page:`installs`,current:e,label:`Installs`}),e===`hosts`&&(0,O.jsx)(U,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:s,onMutated:o}),e===`edits`&&(0,O.jsx)(K,{onMutated:o,onAction:i,dataRev:s,overview:t}),e===`doctor`&&(0,O.jsx)(Y,{dataRev:s})]})}export{ie as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-BMFDSXoB.js";import{A as i,B as a,C as o,E as s,F as c,H as l,K as u,M as d,N as f,O as p,P as m,U as h,_ as g,a as _,d as ee,f as v,g as y,h as b,i as x,j as S,l as C,n as w,p as T,r as E,u as D,v as O,w as k,x as A}from"./motion-RlUl1osO.js";import{n as j}from"./sections-CtFz7HFH.js";import{Ct as M,E as N,Mt as P,Nt as F,Tt as I,jt as L,kt as R,wt as z}from"./index-BNttaGQb.js";import{n as B}from"./Dashboard-BUdUTjbB.js";function V(e){return k((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function H(e,t,n,r,a,c){let l=i(e.duration)&&e.duration<=1e-11?n-h:n;t.composition&&O(t,l,1,1,u.AUTO);let d=r?new D(r,e,t,l,!1,a,c):new b(e,t,l);return t.composition&&d.init(!0),o(t,d),s(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=V(t),t}var U=0,W=class extends b{constructor(e={}){super(e,null,0),++U,this.id=f(e.id)?U:e.id,this.duration=0,this.labels={};let t=e.defaults,n=a.defaults;this.defaults=t?m(t,n):n,this.composition=A(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=A(e.playbackEase,n.playbackEase);this._ease=r?v(r):null,this.iterationDuration=0}add(e,t,n){let r=S(t),i=S(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=a.editor&&a.editor.addTimelineChild,o=n&&n.type===`Stagger`&&a.editor,s=p(n)?n:null;if(s||o){let t=T(e),o=this.duration,c=this.iterationDuration,l=r.id,u=0,d=t.length,p=i?i(e,r,this.id,n,d):null,m=s||a.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...p||r};this.duration=o,this.iterationDuration=c,f(l)||(n.id=l+`-`+u);let i=F(this,m(e,u,t,null,this));H(n,this,i,e,u,t),u++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;H(t,this,F(this,a),e)}}else H(e,this,F(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(f(e)||e&&f(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!f(e)&&!f(e.persist)&&(e.persist=!0);let r=a.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let o=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),o}set(e,t,n){return f(t)?this:(t.duration=h,t.composition=l.replace,this.add(e,t,n))}call(e,t){return f(e)||e&&!p(e)?this:(a.editor&&a.editor.addTimelineCall&&(t=a.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return f(e)||e&&!d(e)||(a.editor&&a.editor.addTimelineLabel&&(t=a.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=F(this,t)),this}remove(e,t){return y(T(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;s(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return s(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),s(this,e=>e.revert,!0),g(this)}then(e){return super.then(e)}},G=e=>a.editor?a.editor.addTimeline(e):new W(e).init(),K=e(t(),1),q=n(),J=.62,te=(e,t)=>String(e).length*t*J;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=te(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,ne=w[8]+w[7];function $({hash:e,label:t,part:n,children:r}){return(0,q.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>R(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e))},children:r})}function re({overview:e,dataRev:t}){let{data:n}=I(()=>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,K.useRef)(null),l=(0,K.useRef)(!0),u=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!x())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`));C([...n,...r,...i],{opacity:0,scale:.7}),C([...a,...o],{opacity:0}),C(s,{draw:`0 0`});let d=G({autoplay:!1,defaults:{ease:E}}).add(n,{opacity:1,scale:1,duration:w[7]},0).add(s,{draw:`0 1`,duration:w[7],delay:P(w[1])},w[3]).add(r,{opacity:1,scale:1,duration:w[7],delay:P(w[1])},w[5]).add(a,{opacity:1,duration:w[6],delay:P(w[1])},w[7]).add(i,{opacity:1,scale:1,duration:w[7],delay:P(w[1])},w[8]).add(o,{opacity:1,duration:w[6]},w[8]);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=_(d,ne),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=z(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,n:0}),t.n+=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`,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)},v={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},y={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},b=(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)}),S=[{...b(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:v},{...b(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:v},{...b(816,232,`Memory`,d.memory??0),hash:`#/personal/memory`,from:y},{...b(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:y}],T={rx:122,ry:68,from:212,to:112},D=p.map((e,t)=>{let n=(p.length===1?(T.from+T.to)/2:T.from+(T.to-T.from)*t/(p.length-1))*Math.PI/180;return{...e,x:y.x+T.rx*Math.cos(n),y:y.y+T.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),O=D.length;return(0,K.useLayoutEffect)(()=>{let e=c.current;if(!e||!O||Q||!x())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];C(t,{opacity:0,scale:.5});let n=()=>C(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=ee(t,{opacity:1,scale:1,duration:w[7],delay:P(w[1],{start:w[7]}),ease:E});n=_(e,w[7]+w[1]*O+w[7])};return l.current?r():u.current=r,()=>{u.current=null,n()}},[O]),(0,q.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,q.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(h,v,-.07),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(h,y,.07),className:`cm-edge`}),S.map(e=>(0,q.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,q.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules`,children:[(0,q.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,q.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,q.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules`]}),(0,q.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,q.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,q.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,q.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,q.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,q.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,q.jsx)(`text`,{x:v.x,y:v.y+v.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules`,children:[(0,q.jsx)(`circle`,{cx:y.x,cy:y.y,r:y.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:y.x,y:y.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,q.jsx)(`text`,{x:y.x,y:y.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,q.jsx)(`text`,{x:y.x+22,y:y.y+y.r+20,className:`cm-note`,children:d.doctrines?`${d.doctrines.active}/${d.doctrines.total} packs built in`:`packs chosen at build`}),(0,q.jsx)(`g`,{className:`cm-mini`,children:D.map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:N(e.id)}}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,q.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:N(e.id)},children:e.n})]},e.id))}),(0,q.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),S.map(e=>(0,q.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,q.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,q.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ie({counts:e}){let t=[{label:j.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules`,n:z(e),hash:`#/laws`},{label:j.agents.label,n:e.agents??0,hash:`#/agents`},{label:j.memory.label,n:e.memory??0,hash:`#/personal/memory`},{label:j.notebook.label,n:e.notebook??0,hash:`#/personal/notebook`},{label:j.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:j.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Growth rings`}),(0,q.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,q.jsxs)(`button`,{className:`jr-ring`,onClick:()=>R(e.hash),children:[(0,q.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,q.jsx)(`span`,{className:`jr-ring-track`,children:(0,q.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,q.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ae({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Freshly grown`}),(0,q.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,q.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,q.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>R(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,q.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,q.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,q.jsx)(`span`,{className:`jr-fresh-when`,children:M(e.mtime)})]},`${e.section}:${e.name}`)):(0,q.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,q.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,q.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${M(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>R(`#/activity`),children:`log →`})]})]})}function oe({overview:e,recent:t,lens:n,dataRev:r}){let i=e?.counts||{};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`jr-head`,children:(0,q.jsx)(B,{verdict:n?.verdict})}),(0,q.jsxs)(`div`,{className:`jr-row2`,children:[(0,q.jsx)(ie,{counts:i}),(0,q.jsx)(ae,{recent:t,buildEpoch:e?.build_epoch})]}),(0,q.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,q.jsx)(`button`,{className:`jr-go right`,onClick:()=>R(`#/laws`),children:`open →`})]}),(0,q.jsx)(re,{overview:e,dataRev:r})]})]})}export{oe as default};
|
|
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-DLDVY3K-.js";import{A as i,B as a,C as o,E as s,F as c,H as l,K as u,M as d,N as f,O as p,P as m,U as h,_ as g,a as _,d as ee,f as v,g as y,h as b,i as x,j as S,l as C,n as w,p as T,r as E,u as D,v as O,w as k,x as A}from"./motion-RlUl1osO.js";import{n as j}from"./sections-CtFz7HFH.js";import{At as M,E as N,Et as P,Mt as F,Nt as I,Pt as L,Tt as R,wt as z}from"./index-DsLmKHw0.js";import{n as B}from"./Dashboard-X7GZzGJp.js";function V(e){return k((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function H(e,t,n,r,a,c){let l=i(e.duration)&&e.duration<=1e-11?n-h:n;t.composition&&O(t,l,1,1,u.AUTO);let d=r?new D(r,e,t,l,!1,a,c):new b(e,t,l);return t.composition&&d.init(!0),o(t,d),s(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=V(t),t}var U=0,W=class extends b{constructor(e={}){super(e,null,0),++U,this.id=f(e.id)?U:e.id,this.duration=0,this.labels={};let t=e.defaults,n=a.defaults;this.defaults=t?m(t,n):n,this.composition=A(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=A(e.playbackEase,n.playbackEase);this._ease=r?v(r):null,this.iterationDuration=0}add(e,t,n){let r=S(t),i=S(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=a.editor&&a.editor.addTimelineChild,o=n&&n.type===`Stagger`&&a.editor,s=p(n)?n:null;if(s||o){let t=T(e),o=this.duration,c=this.iterationDuration,l=r.id,u=0,d=t.length,p=i?i(e,r,this.id,n,d):null,m=s||a.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...p||r};this.duration=o,this.iterationDuration=c,f(l)||(n.id=l+`-`+u);let i=L(this,m(e,u,t,null,this));H(n,this,i,e,u,t),u++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;H(t,this,L(this,a),e)}}else H(e,this,L(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(f(e)||e&&f(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!f(e)&&!f(e.persist)&&(e.persist=!0);let r=a.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let o=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),o}set(e,t,n){return f(t)?this:(t.duration=h,t.composition=l.replace,this.add(e,t,n))}call(e,t){return f(e)||e&&!p(e)?this:(a.editor&&a.editor.addTimelineCall&&(t=a.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return f(e)||e&&!d(e)||(a.editor&&a.editor.addTimelineLabel&&(t=a.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=L(this,t)),this}remove(e,t){return y(T(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;s(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return s(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),s(this,e=>e.revert,!0),g(this)}then(e){return super.then(e)}},G=e=>a.editor?a.editor.addTimeline(e):new W(e).init(),K=e(t(),1),q=n(),J=.62,te=(e,t)=>String(e).length*t*J;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=te(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,ne=w[8]+w[7];function $({hash:e,label:t,part:n,children:r}){return(0,q.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 re({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,K.useRef)(null),l=(0,K.useRef)(!0),u=(0,K.useRef)(null);(0,K.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!x())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=F(t(`.cm-edge`));C([...n,...r,...i],{opacity:0,scale:.7}),C([...a,...o],{opacity:0}),C(s,{draw:`0 0`});let d=G({autoplay:!1,defaults:{ease:E}}).add(n,{opacity:1,scale:1,duration:w[7]},0).add(s,{draw:`0 1`,duration:w[7],delay:I(w[1])},w[3]).add(r,{opacity:1,scale:1,duration:w[7],delay:I(w[1])},w[5]).add(a,{opacity:1,duration:w[6],delay:I(w[1])},w[7]).add(i,{opacity:1,scale:1,duration:w[7],delay:I(w[1])},w[8]).add(o,{opacity:1,duration:w[6]},w[8]);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=_(d,ne),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,n:0}),t.n+=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`,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)},v={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},y={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},b=(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)}),S=[{...b(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:v},{...b(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:v},{...b(816,232,`Memory`,d.memory??0),hash:`#/personal/memory`,from:y},{...b(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:y}],T={rx:122,ry:68,from:212,to:112},D=p.map((e,t)=>{let n=(p.length===1?(T.from+T.to)/2:T.from+(T.to-T.from)*t/(p.length-1))*Math.PI/180;return{...e,x:y.x+T.rx*Math.cos(n),y:y.y+T.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),O=D.length;return(0,K.useLayoutEffect)(()=>{let e=c.current;if(!e||!O||Q||!x())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];C(t,{opacity:0,scale:.5});let n=()=>C(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=ee(t,{opacity:1,scale:1,duration:w[7],delay:I(w[1],{start:w[7]}),ease:E});n=_(e,w[7]+w[1]*O+w[7])};return l.current?r():u.current=r,()=>{u.current=null,n()}},[O]),(0,q.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,q.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(h,v,-.07),className:`cm-edge`}),(0,q.jsx)(`path`,{d:X(h,y,.07),className:`cm-edge`}),S.map(e=>(0,q.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,q.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules`,children:[(0,q.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,q.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,q.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules`]}),(0,q.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,q.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,q.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,q.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,q.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,q.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,q.jsx)(`text`,{x:v.x,y:v.y+v.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,q.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules`,children:[(0,q.jsx)(`circle`,{cx:y.x,cy:y.y,r:y.r,className:`cm-sat-disc`}),(0,q.jsx)(`text`,{x:y.x,y:y.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,q.jsx)(`text`,{x:y.x,y:y.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,q.jsx)(`text`,{x:y.x+22,y:y.y+y.r+20,className:`cm-note`,children:d.doctrines?`${d.doctrines.active}/${d.doctrines.total} packs built in`:`packs chosen at build`}),(0,q.jsx)(`g`,{className:`cm-mini`,children:D.map(e=>(0,q.jsxs)(`g`,{children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:N(e.id)}}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,q.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:N(e.id)},children:e.n})]},e.id))}),(0,q.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),S.map(e=>(0,q.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,q.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,q.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,q.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,q.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ie({counts:e}){let t=[{label:j.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules`,n:R(e),hash:`#/laws`},{label:j.agents.label,n:e.agents??0,hash:`#/agents`},{label:j.memory.label,n:e.memory??0,hash:`#/personal/memory`},{label:j.notebook.label,n:e.notebook??0,hash:`#/personal/notebook`},{label:j.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:j.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Growth rings`}),(0,q.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,q.jsxs)(`button`,{className:`jr-ring`,onClick:()=>M(e.hash),children:[(0,q.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,q.jsx)(`span`,{className:`jr-ring-track`,children:(0,q.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,q.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ae({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,q.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`Freshly grown`}),(0,q.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,q.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,q.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>M(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,q.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,q.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,q.jsx)(`span`,{className:`jr-fresh-when`,children:z(e.mtime)})]},`${e.section}:${e.name}`)):(0,q.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,q.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,q.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${z(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>M(`#/activity`),children:`log →`})]})]})}function oe({overview:e,recent:t,lens:n,dataRev:r}){let i=e?.counts||{};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`div`,{className:`jr-head`,children:(0,q.jsx)(B,{verdict:n?.verdict})}),(0,q.jsxs)(`div`,{className:`jr-row2`,children:[(0,q.jsx)(ie,{counts:i}),(0,q.jsx)(ae,{recent:t,buildEpoch:e?.build_epoch})]}),(0,q.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,q.jsxs)(`div`,{className:`card-head`,children:[(0,q.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,q.jsx)(`button`,{className:`jr-go right`,onClick:()=>M(`#/laws`),children:`open →`})]}),(0,q.jsx)(re,{overview:e,dataRev:r})]})]})}export{oe as default};
|