geneseed 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +1 -1
- package/adapters/opencode/plugins/geneseed-guard.js +1 -1
- package/docs/PRD.md +1 -1
- package/docs/concepts/hooks.md +1 -1
- package/docs/concepts/shared-tier.md +4 -4
- package/docs/guides/migrate.md +4 -2
- package/docs/guides/upgrade-to-5.md +6 -4
- package/docs/web-ui.md +11 -4
- package/harness.config.json +1 -1
- package/js/README.md +2 -1
- package/js/build/fold.mjs +7 -7
- package/js/build/rule-decide.mjs +273 -0
- package/js/cli-table.json +1 -1
- package/js/hosts/hooks-context.mjs +1 -1
- package/js/hosts/installs.mjs +4 -4
- package/js/hosts/memory-files.mjs +2 -2
- package/js/hosts/store-watch.mjs +5 -3
- package/js/inspect/registry.mjs +4 -2
- package/js/lib/paths.mjs +13 -0
- package/js/maintain/migrate.mjs +58 -20
- package/js/web/api.mjs +13 -6
- package/js/web/handler.mjs +2 -0
- package/js/web/routes.mjs +7 -3
- package/js/web/update-check.mjs +2 -2
- package/js/web/user-files.mjs +38 -11
- package/package.json +1 -1
- package/src/skills/rule/approve.md +11 -5
- package/src/skills/rule.md +2 -1
- package/web/dist/assets/{Activity-D8G4eClY.js → Activity-Ci4PZco3.js} +1 -1
- package/web/dist/assets/{ActivityDetail-BtOBYk3M.js → ActivityDetail-C8hroCND.js} +1 -1
- package/web/dist/assets/{Bonsai-B_y20b3i.js → Bonsai-C1iBAt4v.js} +1 -1
- package/web/dist/assets/{CopyButton-CHQte7Ap.js → CopyButton-DJ3a4N88.js} +1 -1
- package/web/dist/assets/{Dashboard-B8uXeJZ_.js → Dashboard-C_On4KXw.js} +2 -2
- package/web/dist/assets/{Docs-Dgv_MWfT.js → Docs-Kffdg5uV.js} +1 -1
- package/web/dist/assets/{GreenhouseView-CSzTMSl_.js → GreenhouseView-k56_cBSF.js} +1 -1
- package/web/dist/assets/{Installs-BDk9lqBI.js → Installs-DtEKLC9h.js} +2 -2
- package/web/dist/assets/{JournalView-CvRk1-m5.js → JournalView-RQnk5l7I.js} +1 -1
- package/web/dist/assets/{Kits-CoITzxWM.js → Kits-CXkEBpnf.js} +1 -1
- package/web/dist/assets/{Laws-Ctf5r9rE.js → Laws-DhhIVqmh.js} +1 -1
- package/web/dist/assets/{Library-DNwHYVXt.js → Library-CAUiEoJo.js} +1 -1
- package/web/dist/assets/{Loops-S85PMQ8m.js → Loops-LKD8mF4E.js} +1 -1
- package/web/dist/assets/{OperatorHudView-DuGz_sTk.js → OperatorHudView-CM5jNPwL.js} +1 -1
- package/web/dist/assets/Personal-B6Uoly3C.js +2 -0
- package/web/dist/assets/{RailCats-AW92uhsX.js → RailCats-DQxxYBEP.js} +1 -1
- package/web/dist/assets/{Settings-CGDFz-6j.js → Settings-BTe6-wda.js} +1 -1
- package/web/dist/assets/{Tabs-1qLrnqmn.js → Tabs-CbdDWTp_.js} +1 -1
- package/web/dist/assets/api-D_r0Jtla.js +1 -0
- package/web/dist/assets/{index-COTd4TRZ.js → index-HfGmYXab.js} +3 -3
- package/web/dist/assets/index-ao3M-Fhm.css +1 -0
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Personal-afJNwvRS.js +0 -2
- package/web/dist/assets/api-C46vAuqp.js +0 -1
- package/web/dist/assets/index-CtorA7uK.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{ht as r}from"./index-COTd4TRZ.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-HfGmYXab.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{rt as r}from"./index-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{rt as r}from"./index-HfGmYXab.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-
|
|
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-C46vAuqp.js";import{o as a,t as o}from"./motion-RlUl1osO.js";import{n as s,r as c}from"./sections-CtFz7HFH.js";import{G as l,J as u,L as d,Q as f,R as p,V as m,X as h,Y as g,at as _,bt as v,it as y,l as b,ot as x,rt as S,st as C,t as w,wt as T}from"./index-COTd4TRZ.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=C(e.newest),n=e.oldest?C(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>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}=v(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=y(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:()=>T(`#/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)(S,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=p(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[C(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)(m,{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=x(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=_(e.counts),o=n?.version_verdict||``,s=U(o),l=y(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=_(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=y(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=v(()=>q(()=>i.fleet()),[e]),r=v(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?b(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>w(()=>import(`./GreenhouseView-CSzTMSl_.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>w(()=>import(`./OperatorHudView-DuGz_sTk.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>w(()=>import(`./JournalView-CvRk1-m5.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:d}){let p=c,[m,_]=(0,E.useState)(`status`),[y,b]=(0,E.useState)(p);y!==p&&(b(p),_(`status`));let x=e&&r.find(t=>t.name===e.theme)?.sigil||``,S=J({dataRev:d,needDoctor:p===`greenhouse`||p===`hud`}),{data:C}=v(()=>p===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[p,d]);if(!e)return t?(0,k.jsx)(g,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(h,{});let w=e.daemon_stale?(0,k.jsx)(u,{}):null;return e.deployed?(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(f,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`readout`,`Readout`]].map(([e,t])=>(0,k.jsx)(`button`,{className:m===e?`on`:``,onClick:()=>_(e),"aria-pressed":m===e,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[m===`status`&&p===`genome`&&(0,k.jsx)(V,{overview:e,sigil:x,setup:a,jobs:o,lens:S,dataRev:d}),m===`status`&&p===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(h,{}),children:(0,k.jsx)(X,{overview:e,sigil:x,jobs:o,lens:S,onAction:s})}),m===`status`&&p===`hud`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(h,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:S})}),m===`status`&&p===`journal`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(h,{}),children:(0,k.jsx)(Q,{overview:e,recent:C,lens:S,dataRev:d})}),m===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:x,setup:a,jobs:o,lens:S}),m===`readout`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:S})]},m)]}):(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
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-k56_cBSF.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/motion-RlUl1osO.js","assets/sections-CtFz7HFH.js","assets/index-HfGmYXab.js","assets/api-D_r0Jtla.js","assets/index-ao3M-Fhm.css","assets/OperatorHudView-CM5jNPwL.js","assets/JournalView-RQnk5l7I.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-D_r0Jtla.js";import{o as a,t as o}from"./motion-RlUl1osO.js";import{n as s,r as c}from"./sections-CtFz7HFH.js";import{G as l,J as u,L as d,Q as f,R as p,V as m,X as h,Y as g,at as _,bt as v,it as y,l as b,ot as x,rt as S,st as C,t as w,wt as T}from"./index-HfGmYXab.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=C(e.newest),n=e.oldest?C(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>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}=v(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=y(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:()=>T(`#/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)(S,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=p(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[C(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)(m,{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=x(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=_(e.counts),o=n?.version_verdict||``,s=U(o),l=y(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=_(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=y(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=v(()=>q(()=>i.fleet()),[e]),r=v(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?b(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>w(()=>import(`./GreenhouseView-k56_cBSF.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>w(()=>import(`./OperatorHudView-CM5jNPwL.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>w(()=>import(`./JournalView-RQnk5l7I.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:d}){let p=c,[m,_]=(0,E.useState)(`status`),[y,b]=(0,E.useState)(p);y!==p&&(b(p),_(`status`));let x=e&&r.find(t=>t.name===e.theme)?.sigil||``,S=J({dataRev:d,needDoctor:p===`greenhouse`||p===`hud`}),{data:C}=v(()=>p===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[p,d]);if(!e)return t?(0,k.jsx)(g,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(h,{});let w=e.daemon_stale?(0,k.jsx)(u,{}):null;return e.deployed?(0,k.jsxs)(k.Fragment,{children:[w,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(f,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`readout`,`Readout`]].map(([e,t])=>(0,k.jsx)(`button`,{className:m===e?`on`:``,onClick:()=>_(e),"aria-pressed":m===e,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[m===`status`&&p===`genome`&&(0,k.jsx)(V,{overview:e,sigil:x,setup:a,jobs:o,lens:S,dataRev:d}),m===`status`&&p===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(h,{}),children:(0,k.jsx)(X,{overview:e,sigil:x,jobs:o,lens:S,onAction:s})}),m===`status`&&p===`hud`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(h,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:S})}),m===`status`&&p===`journal`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(h,{}),children:(0,k.jsx)(Q,{overview:e,recent:C,lens:S,dataRev:d})}),m===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:x,setup:a,jobs:o,lens:S}),m===`readout`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:S})]},m)]}):(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,4 +1,4 @@
|
|
|
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-D_r0Jtla.js";import{i as a}from"./motion-RlUl1osO.js";import{H as o,Q as s,X as c,Y as l,a as u,bt as d,c as ee,et as f,i as te,n as ne,nt as re,o as p,r as m,rt as h,s as ie,tt as g,wt as _}from"./index-HfGmYXab.js";import{a as v,i as y,r as b}from"./Markdown-0ORz7tAc.js";import{t as x}from"./EmptyState-CY5Pm2xy.js";import{a as ae,n as oe,o as S,r as C,t as w}from"./RailCats-DQxxYBEP.js";import{t as T}from"./CopyButton-DJ3a4N88.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(b(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(`
|
|
@@ -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{I as o,R as s,V as c,it as l,rt as u}from"./index-
|
|
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{I as o,R as s,V as c,it as l,rt as u}from"./index-HfGmYXab.js";import{i as d,n as f,r as p}from"./Dashboard-C_On4KXw.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)(c,{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)(u,{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:c,onAction:_}){let y=e.counts||{},S=c?.doctor?.state||`loading`,C=c?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=d(e,c?.tone),O=s(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=o(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:c?.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)(u,{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-C46vAuqp.js";import{$ as i,B as a,H as o,X as s,Y as c,Z as l,bt as u,ft as d,gt as f,ht as p,it as m,lt as h,mt as g,pt as _,rt as v,ut as y,vt as b,yt as x}from"./index-COTd4TRZ.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{t as C}from"./Tabs-1qLrnqmn.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)(``),m=(e,t)=>c(n=>({...n,[e]:t})),h=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(m(`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=>{m(`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=>m(`host`,e.target.value),children:g.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,O.jsx)(w,{value:s,options:n,onChange:m,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:p(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}=u(()=>r.excludes(),[]),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,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=>p(e).label).join(`, `)}),(0,O.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`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 c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,O.jsx)(v,{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:m,onRevealMcp:h}){let g=`${p(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":`${g} 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:f(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 · ${p(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:p(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:g}),(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 ${g}`,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:h}):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 ${g}`,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 ${g} from ${e.path}`,disabled:s,onClick:m,children:`Uninstall…`})]})]}):null]})}var I=(e,t)=>`${e} ${t}`,L=[`claude`,`bob`,`openclaude`],R={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},z=/[\\/]\.claude[\\/]worktrees[\\/]/,B=e=>e.scope===`project`&&z.test(e.path);function V(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?m(e.drift):0;return i?`${r} · ${i} edited`:r}function H({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,o=t.diffable?m(t.drift):0;return(0,O.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+o>0?(0,O.jsx)(a,{label:`Sync with source of ${f(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`local edits`,n:o,tone:`bad`}]}):null,(0,O.jsx)(`span`,{className:`dim`,children:V(t,n)}),t.diffable?null:(0,O.jsxs)(`span`,{className:`dim`,title:`Local edits are only checked for global installs`,children:[` `,`· not checkable`]}),o?(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 ee({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]=R[e.state]||[`Not installed`,``],d=n===e.id,m=e.state===`absent`;return(0,O.jsxs)(`tr`,{className:`pickable${d?` on`:``}${m?` 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:f(e)}),(0,O.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?p(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 ${f(e)} the default install`,disabled:c===e.id,onClick:t=>{t.stopPropagation(),s(e)},children:`Make default`})]}):null,B(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)(H,{inst:e,fleet:l(e),version:a?.version,onEdits:o})}),(0,O.jsx)(`td`,{className:`pick-mark`,children:d?`Editing ›`:``})]},e.id)})})]})})}function te({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 ne({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:o,dataRev:l,onMutated:d}){let m=i(),{data:g,error:_,reload:b}=u(()=>r.installs(),[l]),{data:C,error:w,reload:T}=u(()=>r.mcp(),[l]),{data:A,error:j}=u(()=>r.fleet(),[l]),M=j?null:A??void 0,[N,P]=(0,D.useState)(null),[R,z]=(0,D.useState)(``),[B,V]=(0,D.useState)({}),[H,U]=(0,D.useState)(!1),[W,G]=(0,D.useState)({id:``,value:`keep`}),K=e=>W.id===e?.id?W.value:`keep`,[q,J]=(0,D.useState)(()=>y(`hosts`)),Y=(0,D.useMemo)(()=>{let e={};for(let t of C?.targets||[]){let n=I(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[C]);if(_||w)return(0,O.jsx)(c,{error:_||w,onRetry:()=>{b(),T()}});if(!g||!C)return(0,O.jsx)(s,{});let X={active:0,disabled:1,absent:2},Z=[...g.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(X[e.state]??3)-(X[t.state]??3)),Q=Z.find(e=>e.id===q)||Z.find(e=>e.default)||Z.find(e=>e.state===`active`)||Z[0],$=e=>{let t=B[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}},re=(e,t,n)=>V(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ie=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)},ae={theme:t.map(e=>e.name),footprint:E,posture:g.postures||[],mode:g.modes||[],trust:g.trusts||[]},oe=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o,sharedTier:s}=$(t),c=p(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 m(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}})},se=async e=>{if(e.state!==`active`||await m(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){z(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}d?.()}catch(e){P({text:e.message,tone:`bad`})}finally{z(``)}}},ce=async e=>{z(e.id),P(null);try{await r.setDefaultInstall(e.host,e.path),d?.()}catch(e){P({text:e.message,tone:`bad`})}finally{z(``)}},le=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&L.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ue=async e=>{let t=K(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${le(e,`memory`)} and ${le(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await m(`Uninstall ${p(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`})){z(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}G({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`}),d?.()}catch(e){P({text:e.message,tone:`bad`})}finally{z(``)}}},de=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`})}},fe=async()=>{let t=Z.filter(e=>e.state===`active`).map(e=>`${f(e)} · ${e.scope}`);await m(`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`)},pe=Z.find(e=>e.default)?.host||Z.find(e=>e.state===`active`)?.host||Z[0]?.host||`opencode`,me=Z.filter(e=>e.scope===`global`),he=Z.filter(e=>e.scope!==`global`),ge=e=>{J(e)},_e=e=>{h(`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.`]}),e?(0,O.jsx)(`div`,{className:`row gap-8`,children:(0,O.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:fe,children:[(0,O.jsx)(v,{name:`refresh`}),` Rebuild all`]})}):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)(ee,{rows:me,currentId:Q?.id,onPick:ge,label:`Global installs`,fleet:M,onEdits:_e,onDefault:e?ce:void 0,busyKey:R})]}),(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)(v,{name:`folder`}),` Deploy to a repo…`]}):null]}),H?(0,O.jsx)(`div`,{className:`inst-deploy`,children:(0,O.jsx)(k,{host:pe,theme:n||`neutral`,options:ae,onAction:e,onClose:()=>U(!1),onNote:e=>P(e?{text:e,tone:`bad`}:null)})}):null,he.length?(0,O.jsx)(ee,{rows:he,project:!0,currentId:Q?.id,onPick:ge,label:`Per-project installs`,fleet:M,onEdits:_e,onDefault:e?ce:void 0,busyKey:R}):(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)(ne,{setup:o,overview:a}),(0,O.jsx)(te,{themes:t,current:a?.theme})]}),Q?(0,O.jsx)(F,{inst:Q,targets:Y[I(Q.host,Q.path)]||[],choice:$(Q),unchanged:ie(Q),options:ae,onPick:(e,t)=>re(Q,e,t),canAct:!!e,busy:R===Q.id,memory:K(Q),onMemory:e=>G({id:Q.id,value:e}),onApply:()=>oe(Q),onToggleInstall:()=>se(Q),onRemove:()=>ue(Q),onRevealMcp:de},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=_(e.dataRev),[n,r]=d(`edits`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(s,{}):(0,O.jsx)(q,{install:n,...e},n?.id||``)]})}function q({install:e,onMutated:t,onAction:n,dataRev:a,overview:o}){let l=i(),{data:d,error:f,reload:p}=u(()=>r.diff(b(e)),[a]),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)(``),[y,x]=(0,D.useState)(()=>new Set),[C,w]=(0,D.useState)(()=>new Set),[T,E]=(0,D.useState)(null);if(d&&d!==T){E(d),x(new Set);let e=d.files.reduce((e,t)=>e+t.diff.length,0);w(new Set(e<=G?d.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=[...y],i=n.filter(e=>d.files.find(t=>t.rel===e)?.status===`added`),a=i.length?`Restoring will DELETE ${i.length} deployed-only file(s):\n${i.join(`
|
|
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-D_r0Jtla.js";import{$ as i,B as a,H as o,X as s,Y as c,Z as l,bt as u,ft as d,gt as f,ht as p,it as m,lt as h,mt as g,pt as _,rt as v,ut as y,vt as b,yt as x}from"./index-HfGmYXab.js";import{t as S}from"./EmptyState-CY5Pm2xy.js";import{t as C}from"./Tabs-CbdDWTp_.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)(``),m=(e,t)=>c(n=>({...n,[e]:t})),h=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(m(`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=>{m(`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=>m(`host`,e.target.value),children:g.map(e=>(0,O.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,O.jsx)(w,{value:s,options:n,onChange:m,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:p(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}=u(()=>r.excludes(),[]),[i,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,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=>p(e).label).join(`, `)}),(0,O.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`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 c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,O.jsx)(v,{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:m,onRevealMcp:h}){let g=`${p(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":`${g} 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:f(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 · ${p(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:p(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:g}),(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 ${g}`,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:h}):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 ${g}`,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 ${g} from ${e.path}`,disabled:s,onClick:m,children:`Uninstall…`})]})]}):null]})}function I({dataRev:e}){let{data:t,error:n,reload:i}=u(()=>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)(c,{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)(s,{})]})}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?m(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,o=t.diffable?m(t.drift):0;return(0,O.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+o>0?(0,O.jsx)(a,{label:`Sync with source of ${f(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`local edits`,n:o,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`]}),o?(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,m=e.state===`absent`;return(0,O.jsxs)(`tr`,{className:`pickable${d?` on`:``}${m?` 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:f(e)}),(0,O.jsx)(`div`,{className:`mono path-cell`,title:e.path,children:t?p(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 ${f(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:o,dataRev:l,onMutated:d}){let m=i(),{data:g,error:_,reload:b}=u(()=>r.installs(),[l]),{data:C,error:w,reload:T}=u(()=>r.mcp(),[l]),{data:A,error:j}=u(()=>r.fleet(),[l]),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)(()=>y(`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(_||w)return(0,O.jsx)(c,{error:_||w,onRetry:()=>{b(),T()}});if(!g||!C)return(0,O.jsx)(s,{});let ae={active:0,disabled:1,absent:2},Z=[...g.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:g.postures||[],mode:g.modes||[],trust:g.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o,sharedTier:s}=$(t),c=p(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 m(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 m(`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}d?.()}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),d?.()}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 m(`Uninstall ${p(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`}),d?.()}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=>`${f(e)} · ${e.scope}`);await m(`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=>{h(`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)(v,{name:`refresh`}),` Rebuild all`]}):null]})]}),W?(0,O.jsx)(I,{dataRev:l}):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)(v,{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: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=_(e.dataRev),[n,r]=d(`edits`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(s,{}):(0,O.jsx)(q,{install:n,...e},n?.id||``)]})}function q({install:e,onMutated:t,onAction:n,dataRev:a,overview:o}){let l=i(),{data:d,error:f,reload:p}=u(()=>r.diff(b(e)),[a]),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)(``),[y,x]=(0,D.useState)(()=>new Set),[C,w]=(0,D.useState)(()=>new Set),[T,E]=(0,D.useState)(null);if(d&&d!==T){E(d),x(new Set);let e=d.files.reduce((e,t)=>e+t.diff.length,0);w(new Set(e<=G?d.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=[...y],i=n.filter(e=>d.files.find(t=>t.rel===e)?.status===`added`),a=i.length?`Restoring will DELETE ${i.length} deployed-only file(s):\n${i.join(`
|
|
2
2
|
`)}\n\n`:``;if(await l(`${a}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){h(!0);try{let i=await r.restore(n,b(e)),a=i.errors.length?` · ${i.errors.length} error(s): ${i.errors.join(`; `)}`:``;_(`Restored ${i.restored.length}, archived ${i.deleted.length}${a}`),await p(),t?.()}catch(e){_(e.message)}finally{h(!1)}}};if(f)return(0,O.jsx)(c,{error:f,onRetry:p});if(!d)return(0,O.jsx)(s,{});if(!d.deployed)return(0,O.jsx)(S,{title:`Nothing installed here`,children:`Nothing to compare.`});if(!d.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=d.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),P=d.files.filter(e=>e.status===`linked`),F=d.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`}),d.target?(0,O.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,O.jsx)(`code`,{children:d.target}),d.theme?` (${d.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:m||y.size===0,onClick:M,children:[`Restore`,y.size?` (${y.size})`:``]}),(0,O.jsxs)(`button`,{className:`btn`,disabled:m,onClick:j,children:[(0,O.jsx)(v,{name:`download`}),`Export improvements`]})]})]}),g?(0,O.jsx)(`p`,{className:`sub mb-14`,children:g}):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(d.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:y.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:m,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:y.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)(v,{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)(v,{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=_(e),[n,r]=d(`doctor`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(s,{}):(0,O.jsx)(X,{install:n,dataRev:e},n?.id||``)]})}function X({install:e,dataRev:t}){let n=(0,D.useRef)(!1),{data:i,error:a,reload:o,setData:l}=u(()=>{let t=n.current;return n.current=!1,r.doctor(t,b(e))},[t]),d=()=>{n.current=!0,l(null),o()};if(a)return(0,O.jsx)(c,{error:a,onRetry:o});let f=i?i.groups.filter(e=>e.problems.length):[],p=i?i.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:d,disabled:!i,children:[(0,O.jsx)(v,{name:`refresh`}),i?`Run doctor`:`Running…`]})]}),i?(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 `,i.themes.length,` voice`,i.themes.length===1?``:`s`]}),i.checked_at?(0,O.jsxs)(`span`,{className:`dim mono`,title:i.checked_at,children:[`checked `,i.checked_at.slice(11)]}):null,i.themes.map(e=>(0,O.jsx)(`span`,{className:`badge cap`,children:e},e))]}),i.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`}),i.problems.length,` problem`,i.problems.length===1?``:`s`]})]})}),(0,O.jsxs)(`div`,{className:`stack gap-12`,children:[f.map((e,t)=>(0,O.jsx)(J,{group:e,i:t},e.label)),p.length?(0,O.jsxs)(`details`,{className:`check-fold`,children:[(0,O.jsxs)(`summary`,{children:[p.length,` clean check`,p.length===1?``:`s`]}),(0,O.jsx)(`div`,{className:`stack gap-12`,children:p.map((e,t)=>(0,O.jsx)(J,{group:e,i:f.length+t},e.label))})]}):null]})]}):(0,O.jsx)(s,{label:`Running every check (builds this install’s voice in a sandbox)…`})]})}function
|
|
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(d.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:y.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:m,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:y.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)(v,{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)(v,{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=_(e),[n,r]=d(`doctor`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(l,{className:`page-pick`,installs:t,value:n,onChange:r}),t===null?(0,O.jsx)(s,{}):(0,O.jsx)(X,{install:n,dataRev:e},n?.id||``)]})}function X({install:e,dataRev:t}){let n=(0,D.useRef)(!1),{data:i,error:a,reload:o,setData:l}=u(()=>{let t=n.current;return n.current=!1,r.doctor(t,b(e))},[t]),d=()=>{n.current=!0,l(null),o()};if(a)return(0,O.jsx)(c,{error:a,onRetry:o});let f=i?i.groups.filter(e=>e.problems.length):[],p=i?i.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:d,disabled:!i,children:[(0,O.jsx)(v,{name:`refresh`}),i?`Run doctor`:`Running…`]})]}),i?(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 `,i.themes.length,` voice`,i.themes.length===1?``:`s`]}),i.checked_at?(0,O.jsxs)(`span`,{className:`dim mono`,title:i.checked_at,children:[`checked `,i.checked_at.slice(11)]}):null,i.themes.map(e=>(0,O.jsx)(`span`,{className:`badge cap`,children:e},e))]}),i.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`}),i.problems.length,` problem`,i.problems.length===1?``:`s`]})]})}),(0,O.jsxs)(`div`,{className:`stack gap-12`,children:[f.map((e,t)=>(0,O.jsx)(J,{group:e,i:t},e.label)),p.length?(0,O.jsxs)(`details`,{className:`check-fold`,children:[(0,O.jsxs)(`summary`,{children:[p.length,` clean check`,p.length===1?``:`s`]}),(0,O.jsx)(`div`,{className:`stack gap-12`,children:p.map((e,t)=>(0,O.jsx)(J,{group:e,i:f.length+t},e.label))})]}):null]})]}):(0,O.jsx)(s,{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:a,dataRev:s}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(o,{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:a}),e===`edits`&&(0,O.jsx)(K,{onMutated:a,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-C46vAuqp.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{C as M,Dt as N,Et as P,Ot as F,bt as I,ct as L,st as R,wt as z}from"./index-COTd4TRZ.js";import{n as B}from"./Dashboard-B8uXeJZ_.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:()=>z(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),z(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=P(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:N(w[1])},w[3]).add(r,{opacity:1,scale:1,duration:w[7],delay:N(w[1])},w[5]).add(a,{opacity:1,duration:w[6],delay:N(w[1])},w[7]).add(i,{opacity:1,scale:1,duration:w[7],delay:N(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=L(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:N(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:M(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:M(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:L(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:()=>z(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:()=>z(`#/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:R(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 ✓ ${R(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>z(`#/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:()=>z(`#/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-D_r0Jtla.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{C as M,Dt as N,Et as P,Ot as F,bt as I,ct as L,st as R,wt as z}from"./index-HfGmYXab.js";import{n as B}from"./Dashboard-C_On4KXw.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:()=>z(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),z(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=P(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:N(w[1])},w[3]).add(r,{opacity:1,scale:1,duration:w[7],delay:N(w[1])},w[5]).add(a,{opacity:1,duration:w[6],delay:N(w[1])},w[7]).add(i,{opacity:1,scale:1,duration:w[7],delay:N(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=L(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:N(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:M(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:M(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:L(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:()=>z(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:()=>z(`#/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:R(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 ✓ ${R(t)}`:`Never built here`,` ·`,` `,(0,q.jsx)(`button`,{className:`jr-go`,onClick:()=>z(`#/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:()=>z(`#/laws`),children:`open →`})]}),(0,q.jsx)(re,{overview:e,dataRev:r})]})]})}export{oe 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-C46vAuqp.js";import{$ as i,H as a,K as o,X as s,Y as c,_t as l,bt as u,q as d,z as f}from"./index-COTd4TRZ.js";import{t as p}from"./Markdown-0ORz7tAc.js";import{t as m}from"./EmptyState-CY5Pm2xy.js";import{r as h}from"./controls-D4wmg_pl.js";import{t as g}from"./DataTable-b9zTShqJ.js";var _=e(t(),1),v=e=>e.kits||[],y=e=>!e.editable||e.state===`unreadable`;function b(e,t){let n=i(),r=d(),a=e=>{let t=r.get(`kits`,e.id);return t&&t.base===o(v(e))?t:null},{prune:s}=r;(0,_.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,o(v(e))]));s(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,s]);let c=e=>a(e)?.value??new Set(v(e)),u=(e,t)=>{let n=new Set(c(e));n.delete(t)||n.add(t),r.put(`kits`,e.id,n,o(v(e)))},f=e=>{let t=c(e),n=new Set(v(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},p=e=>r.running(`kits`,e.id)||!!a(e)?.applied;return{setOf:c,toggle:u,change:f,apply:async e=>{let i=[...c(e)],a=`Rebuild ${l(e)} with kits: ${i.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(a,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:i})&&r.startApply(`kits`,e.id)},running:p,failed:e=>!!a(e)?.failed,discard:e=>{p(e)||r.drop(`kits`,e.id)},busy:r.busy}}var x=n();function S(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function C({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,x.jsxs)(`div`,{className:`kit-foot`,children:[(0,x.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:S(e,t)}),(0,x.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${l(e)}`,disabled:y(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var w={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},T=({row:e})=>{let[t,n]=w[e.state]||[e.state||`Unknown`,``];return(0,x.jsx)(`span`,{className:`tag ${n}`,children:t})},E=encodeURIComponent,D=e=>(e||``).split(/\s+/).filter(Boolean).length,O=e=>[...new Set(e.filter(Boolean))],k=e=>(e||``).slice(0,7),A=(e,t)=>e?`On in ${e} of ${N(t,`install`)}`:`Installed when this kit is on`,j=({type:e,names:t,listed:n,offNote:r=A(0)})=>t.length?(0,x.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,x.jsx)(`li`,{children:n?.has(t)?(0,x.jsx)(`a`,{href:`#/item/${e}/${E(t)}`,children:t}):(0,x.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,x.jsx)(`p`,{className:`panel-note`,children:`None.`});function M({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=A(t.filter(t=>v(t).includes(e.name)).length,t.length);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`reader-tags`,children:[(0,x.jsx)(`span`,{className:`tag acc`,children:`Kit`}),O(i.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,x.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,x.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,x.jsx)(`hr`,{className:`hr`}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,x.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=y(t),i=l(t);return(0,x.jsxs)(`li`,{className:`kit-install`,children:[(0,x.jsxs)(`div`,{className:`kit-row`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:i}),(0,x.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,x.jsx)(T,{row:t}),(0,x.jsx)(h,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,x.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,x.jsx)(C,{row:t,stage:n})]},t.id)})}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,x.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,x.jsxs)(_.Fragment,{children:[(0,x.jsx)(`dt`,{children:e.author||e.repo}),(0,x.jsxs)(`dd`,{children:[(0,x.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,x.jsxs)(`span`,{className:`mono dim`,children:[`@ `,k(e.commit)]}):null,e.compareUrl?(0,x.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${k(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,x.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,x.jsx)(j,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,x.jsx)(j,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,x.jsxs)(`span`,{className:`mono dim`,children:[D(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,x.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,x.jsx)(p,{body:e.rules})})]}):null,e.banned?.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,x.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var N=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,P=l;function F(e,t,n){let r=v(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function I({kit:e,installs:t,stage:n,listed:r,max:i}){let a=e.credits||[],o=e.skills||[],s=e.agents||[],c=t.map(t=>({row:t,...F(n,t,e.name)})),l=c.filter(t=>v(t.row).includes(e.name)).length,u=c.filter(e=>e.staged).length,d=A(l,t.length),p=`on in ${l} of ${N(t.length,`install`)}${u?` · ${u} staged`:``}`;return(0,x.jsxs)(`article`,{className:`kit-card${u?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,x.jsxs)(`header`,{className:`kit-card-head`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,x.jsx)(`a`,{className:`kit-name`,href:`#/kits/${E(e.name)}`,children:e.name})}),e.description?(0,x.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),O(a.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsxs)(`div`,{className:`kit-counts`,children:[(0,x.jsx)(`span`,{children:`Skills`}),(0,x.jsx)(f,{value:o.length,max:i,label:`Skills`}),(0,x.jsx)(`span`,{className:`mono`,children:o.length}),(0,x.jsx)(`span`,{children:`Agents`}),(0,x.jsx)(f,{value:s.length,max:i,label:`Agents`}),(0,x.jsx)(`span`,{className:`mono`,children:s.length})]}),o.length?(0,x.jsx)(j,{type:`skill`,names:o,listed:r?.skills,offNote:d}):null,s.length?(0,x.jsx)(j,{type:`agent`,names:s,listed:r?.agents,offNote:d}):null,(0,x.jsxs)(`footer`,{className:`kit-card-foot`,children:[a.length?(0,x.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,a.map((e,t)=>(0,x.jsxs)(_.Fragment,{children:[t?`, `:null,(0,x.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,x.jsx)(`span`,{}),t.length?(0,x.jsxs)(`span`,{className:`kit-where`,children:[(0,x.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":c.map(e=>`${P(e.row)}: ${e.note}`).join(`, `),children:c.map(e=>(0,x.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${P(e.row)}: ${e.note}`},e.row.id))}),(0,x.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function L({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:P(e)}),(0,x.jsx)(`span`,{className:`mono dim`,children:e.path}),y(e)?(0,x.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null,Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,x.jsxs)(`span`,{className:`mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e))]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=F(n,t,e.name);return(0,x.jsxs)(`span`,{className:`kit-cell`,children:[(0,x.jsx)(h,{on:r.now,disabled:y(t)||n.running(t),label:`${e.name} for ${P(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,x.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,x.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,x.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,x.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,x.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,x.jsx)(`span`,{className:`dim`,children:`Each row is one install.`})]}),t.length?(0,x.jsx)(g,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function R({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,x.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,x.jsx)(`b`,{children:a?`${N(a,`change`)} on ${N(r.length,`install`)}`:`No staged changes`}),i?(0,x.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[P(i),`: `,S(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,x.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,x.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${P(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,x.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${P(i)}`:`Apply and rebuild kits`,disabled:!i||y(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function z({item:e,onAction:t,dataRev:n}){let{data:i,error:o}=u(()=>r.kits(),[n]),l=b(i,t),{data:d}=u(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),f=i?.kits||[],p=i?.installs||[],h=o||i?.error;if(e){let t=f.find(t=>t.name===e);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),i?t?(0,x.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,x.jsx)(M,{kit:t,installs:p,stage:l,listed:d})}):(0,x.jsxs)(m,{title:`No such kit`,action:(0,x.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):h?null:(0,x.jsx)(s,{})]})}let g=Math.max(1,...f.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{eyebrow:i?`${N(f.length,`kit`)} · ${N(p.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),i?f.length===0?h?null:(0,x.jsx)(m,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,x.jsxs)(`div`,{className:`kit-page-body`,children:[(0,x.jsx)(`div`,{className:`kit-gallery`,children:f.map(e=>(0,x.jsx)(I,{kit:e,installs:p,stage:l,listed:d,max:g},e.name))}),(0,x.jsx)(L,{kits:f,installs:p,stage:l}),p.length?(0,x.jsx)(R,{installs:p,stage:l}):null]}):h?null:(0,x.jsx)(s,{})]})}export{z 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-D_r0Jtla.js";import{$ as i,H as a,K as o,X as s,Y as c,_t as l,bt as u,q as d,z as f}from"./index-HfGmYXab.js";import{t as p}from"./Markdown-0ORz7tAc.js";import{t as m}from"./EmptyState-CY5Pm2xy.js";import{r as h}from"./controls-D4wmg_pl.js";import{t as g}from"./DataTable-b9zTShqJ.js";var _=e(t(),1),v=e=>e.kits||[],y=e=>!e.editable||e.state===`unreadable`;function b(e,t){let n=i(),r=d(),a=e=>{let t=r.get(`kits`,e.id);return t&&t.base===o(v(e))?t:null},{prune:s}=r;(0,_.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,o(v(e))]));s(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,s]);let c=e=>a(e)?.value??new Set(v(e)),u=(e,t)=>{let n=new Set(c(e));n.delete(t)||n.add(t),r.put(`kits`,e.id,n,o(v(e)))},f=e=>{let t=c(e),n=new Set(v(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},p=e=>r.running(`kits`,e.id)||!!a(e)?.applied;return{setOf:c,toggle:u,change:f,apply:async e=>{let i=[...c(e)],a=`Rebuild ${l(e)} with kits: ${i.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(a,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:i})&&r.startApply(`kits`,e.id)},running:p,failed:e=>!!a(e)?.failed,discard:e=>{p(e)||r.drop(`kits`,e.id)},busy:r.busy}}var x=n();function S(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function C({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,x.jsxs)(`div`,{className:`kit-foot`,children:[(0,x.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:S(e,t)}),(0,x.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${l(e)}`,disabled:y(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var w={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},T=({row:e})=>{let[t,n]=w[e.state]||[e.state||`Unknown`,``];return(0,x.jsx)(`span`,{className:`tag ${n}`,children:t})},E=encodeURIComponent,D=e=>(e||``).split(/\s+/).filter(Boolean).length,O=e=>[...new Set(e.filter(Boolean))],k=e=>(e||``).slice(0,7),A=(e,t)=>e?`On in ${e} of ${N(t,`install`)}`:`Installed when this kit is on`,j=({type:e,names:t,listed:n,offNote:r=A(0)})=>t.length?(0,x.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,x.jsx)(`li`,{children:n?.has(t)?(0,x.jsx)(`a`,{href:`#/item/${e}/${E(t)}`,children:t}):(0,x.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,x.jsx)(`p`,{className:`panel-note`,children:`None.`});function M({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=A(t.filter(t=>v(t).includes(e.name)).length,t.length);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`reader-tags`,children:[(0,x.jsx)(`span`,{className:`tag acc`,children:`Kit`}),O(i.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,x.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,x.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,x.jsx)(`hr`,{className:`hr`}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,x.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=y(t),i=l(t);return(0,x.jsxs)(`li`,{className:`kit-install`,children:[(0,x.jsxs)(`div`,{className:`kit-row`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:i}),(0,x.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,x.jsx)(T,{row:t}),(0,x.jsx)(h,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,x.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,x.jsx)(C,{row:t,stage:n})]},t.id)})}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,x.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,x.jsxs)(_.Fragment,{children:[(0,x.jsx)(`dt`,{children:e.author||e.repo}),(0,x.jsxs)(`dd`,{children:[(0,x.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,x.jsxs)(`span`,{className:`mono dim`,children:[`@ `,k(e.commit)]}):null,e.compareUrl?(0,x.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${k(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,x.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,x.jsx)(j,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,x.jsx)(j,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,x.jsxs)(`span`,{className:`mono dim`,children:[D(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,x.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,x.jsx)(p,{body:e.rules})})]}):null,e.banned?.length?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,x.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,x.jsx)(`li`,{children:(0,x.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var N=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,P=l;function F(e,t,n){let r=v(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function I({kit:e,installs:t,stage:n,listed:r,max:i}){let a=e.credits||[],o=e.skills||[],s=e.agents||[],c=t.map(t=>({row:t,...F(n,t,e.name)})),l=c.filter(t=>v(t.row).includes(e.name)).length,u=c.filter(e=>e.staged).length,d=A(l,t.length),p=`on in ${l} of ${N(t.length,`install`)}${u?` · ${u} staged`:``}`;return(0,x.jsxs)(`article`,{className:`kit-card${u?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,x.jsxs)(`header`,{className:`kit-card-head`,children:[(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,x.jsx)(`a`,{className:`kit-name`,href:`#/kits/${E(e.name)}`,children:e.name})}),e.description?(0,x.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),O(a.map(e=>e.license)).map(e=>(0,x.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,x.jsxs)(`div`,{className:`kit-counts`,children:[(0,x.jsx)(`span`,{children:`Skills`}),(0,x.jsx)(f,{value:o.length,max:i,label:`Skills`}),(0,x.jsx)(`span`,{className:`mono`,children:o.length}),(0,x.jsx)(`span`,{children:`Agents`}),(0,x.jsx)(f,{value:s.length,max:i,label:`Agents`}),(0,x.jsx)(`span`,{className:`mono`,children:s.length})]}),o.length?(0,x.jsx)(j,{type:`skill`,names:o,listed:r?.skills,offNote:d}):null,s.length?(0,x.jsx)(j,{type:`agent`,names:s,listed:r?.agents,offNote:d}):null,(0,x.jsxs)(`footer`,{className:`kit-card-foot`,children:[a.length?(0,x.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,a.map((e,t)=>(0,x.jsxs)(_.Fragment,{children:[t?`, `:null,(0,x.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,x.jsx)(`span`,{}),t.length?(0,x.jsxs)(`span`,{className:`kit-where`,children:[(0,x.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":c.map(e=>`${P(e.row)}: ${e.note}`).join(`, `),children:c.map(e=>(0,x.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${P(e.row)}: ${e.note}`},e.row.id))}),(0,x.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function L({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,x.jsxs)(`div`,{className:`kit-main`,children:[(0,x.jsx)(`b`,{children:P(e)}),(0,x.jsx)(`span`,{className:`mono dim`,children:e.path}),y(e)?(0,x.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null,Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,x.jsxs)(`span`,{className:`mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e))]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=F(n,t,e.name);return(0,x.jsxs)(`span`,{className:`kit-cell`,children:[(0,x.jsx)(h,{on:r.now,disabled:y(t)||n.running(t),label:`${e.name} for ${P(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,x.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,x.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,x.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,x.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,x.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,x.jsx)(`span`,{className:`dim`,children:`Each row is one install.`})]}),t.length?(0,x.jsx)(g,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,x.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function R({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,x.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,x.jsx)(`b`,{children:a?`${N(a,`change`)} on ${N(r.length,`install`)}`:`No staged changes`}),i?(0,x.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[P(i),`: `,S(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,x.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,x.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${P(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,x.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${P(i)}`:`Apply and rebuild kits`,disabled:!i||y(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function z({item:e,onAction:t,dataRev:n}){let{data:i,error:o}=u(()=>r.kits(),[n]),l=b(i,t),{data:d}=u(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),f=i?.kits||[],p=i?.installs||[],h=o||i?.error;if(e){let t=f.find(t=>t.name===e);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),i?t?(0,x.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,x.jsx)(M,{kit:t,installs:p,stage:l,listed:d})}):(0,x.jsxs)(m,{title:`No such kit`,action:(0,x.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):h?null:(0,x.jsx)(s,{})]})}let g=Math.max(1,...f.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(a,{eyebrow:i?`${N(f.length,`kit`)} · ${N(p.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,x.jsx)(c,{error:h,style:{margin:`0 0 var(--sp-3)`}}),i?f.length===0?h?null:(0,x.jsx)(m,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,x.jsxs)(`div`,{className:`kit-page-body`,children:[(0,x.jsx)(`div`,{className:`kit-gallery`,children:f.map(e=>(0,x.jsx)(I,{kit:e,installs:p,stage:l,listed:d,max:g},e.name))}),(0,x.jsx)(L,{kits:f,installs:p,stage:l}),p.length?(0,x.jsx)(R,{installs:p,stage:l}):null]}):h?null:(0,x.jsx)(s,{})]})}export{z 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-
|
|
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-D_r0Jtla.js";import{$ as i,H as a,K as o,Q as s,W as c,X as l,Y as u,Z as d,_ as f,_t as p,b as m,bt as h,d as g,f as _,ft as v,g as y,h as b,m as ee,p as te,pt as x,q as ne,v as re,vt as S,wt as C,y as w,z as T}from"./index-HfGmYXab.js";import{t as E}from"./Markdown-0ORz7tAc.js";import{t as ie}from"./EmptyState-CY5Pm2xy.js";import{t as ae}from"./FilterInput-qGKNSlxv.js";var D=e(t(),1);function oe({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:s}){let c=i(),l=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),u=l.join(`,`),d=ne(),f=n?`${n.host}:${n.scope}:${n.path}`:``,m=o(l),{prune:h}=d,g=e.length>0;(0,D.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===f&&t.base!==m)},[g,f,m,h]);let _=d.get(`rules`,f),v=_&&_.base===m?_.value:l,y=e=>d.put(`rules`,f,e(v),m),b=e=>v.includes(e),ee=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),te=e=>e.rules.some(e=>b(e.addr)),x=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},re=e=>{let t=e.rules.filter(e=>b(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},S=t.flatMap(e=>e.rules.map(e=>e.addr)),C=S.filter(b),w=C.join(`,`)!==u,T=`process.5`,E=l.includes(T)&&!v.includes(T);return{deployedRules:l,isOn:b,toggleRule:ee,packOn:te,togglePack:x,packState:re,allRules:S,pickedRules:C,dirty:w,losingConsent:E,applyPacks:async()=>{if(!r||!w)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),o=E?`
|
|
2
2
|
|
|
3
3
|
process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(s?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=C.length?`${C.length} of ${S.length} doctrine rules`:`no doctrine rules`;await c(`Rebuild ${p(n)} with ${l}? It rebuilds in place, non-destructive.${o}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await a(`install`,{...n,doctrines:e,excludeRules:i})&&d.startApply(`rules`,f)},revert:()=>d.drop(`rules`,f)}}var O=n();function se({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:c,toggleCol:l=null,renderBody:d,srcLine:f,after:p=null}){let m=(0,D.useId)(),{data:g,error:_,reload:v}=h(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,c],`law-item`),y=t&&(0,O.jsxs)(`div`,{className:`law-expand`,id:m,children:[_?(0,O.jsx)(u,{error:_,onRetry:v}):g?d(g):(0,O.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,O.jsx)(`div`,{className:`law-srcline`,children:f}),p]}),b={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":m,"aria-label":s};return l?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,O.jsx)(`button`,{className:`law-disclosure`,...b,children:o}),(0,O.jsx)(`span`,{className:`toggle-col`,children:l})]}),y]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{className:i,style:a,"data-addr":e,...b,children:o}),y]})}function ce({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null,after:a=null}){let o=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`law-no`,children:[(0,O.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,O.jsxs)(`span`,{className:`law-name`,children:[(0,O.jsx)(`span`,{children:e.name}),e.ess?(0,O.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,O.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,O.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,O.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,O.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,O.jsx)(se,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:o,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,O.jsx)(E,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`,after:a})}var k=[`invariants`,`doctrines`];function le({tiers:e,current:t,onPick:n}){return(0,O.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`span`,{className:`tier-head`,children:[(0,O.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,O.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,O.jsxs)(`span`,{className:`tier-top`,children:[(0,O.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,O.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,O.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,O.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,O.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,O.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,O.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&k.includes(e.key)?(0,O.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,O.jsx)(`div`,{className:a,children:i},e.key)})})}function ue({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1,install:i=null}){let a=i?`off · ${p(i)}`:`off`,o=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(y(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),s=Math.max(1,...o.map(([,e])=>e));return(0,O.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,O.jsxs)(`div`,{className:`panel-head`,children:[(0,O.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,O.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),o.length?(0,O.jsx)(`ul`,{className:`gate-list`,children:o.map(([e,r,i])=>{let o=y(e),c=t[o]?.name||f(o);return(0,O.jsxs)(`li`,{children:[(0,O.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(o),children:(0,O.jsxs)(`span`,{className:`gate-top`,children:[(0,O.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:c}),i&&(0,O.jsx)(`span`,{className:`mono off`,children:a}),(0,O.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,O.jsx)(T,{value:r,max:s,label:`${c} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,O.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,O.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function de({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:o,togglePack:s,dirty:c,losingConsent:l}=t,u=Math.max(1,...e.map(e=>e.rules.length));return(0,O.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,O.jsxs)(`div`,{className:`panel-head`,children:[(0,O.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,O.jsxs)(`span`,{className:`mono dim`,children:[e.filter(o).length,`/`,e.length,` on`]})]}),e.length?(0,O.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,O.jsxs)(`li`,{className:o(e)?``:`off`,children:[(0,O.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,O.jsx)(T,{value:t,max:u,label:`${e.title} rules on`}),(0,O.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,O.jsx)(`button`,{type:`button`,className:`sw-toggle${o(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>s(e)}):null]},e.pack)})}):(0,O.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,O.jsxs)(O.Fragment,{children:[l&&(0,O.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,O.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,O.jsx)(`code`,{children:`git commit`}),` and `,(0,O.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,O.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:c?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}var fe=`ont:ownership`,pe=e=>e===`ownership`?fe:e;function me(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=re(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:b(n.name),c:m[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function A(e){let t=x(e.dataRev),[n,r]=v(`laws`,t);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(d,{className:`page-pick`,installs:t,value:n,onChange:r}),(0,O.jsx)(M,{...e,install:n,listed:t!==null},n?.id??`none`)]})}var j=(e,t)=>e?.install?.host===t.host&&e.install.path===t.path;function M({install:e,listed:t,...n}){let i=e&&j(n.overview,e)?n.overview:null,{data:a,error:o,loading:s}=h(()=>Promise.resolve().then(()=>e&&!i?r.overview(S(e)):null),[!!i,n.dataRev]),c=i||(e&&j(a,e)?a:null),l=e?c:n.overview,d=!(!e||c||s);return(0,O.jsxs)(O.Fragment,{children:[d?(0,O.jsx)(u,{error:`Could not read this install's gates${o?`: ${o}`:`.`}`}):null,(0,O.jsx)(N,{...n,overview:l,pair:S(e),onAction:t&&(!e||c!==null)?n.onAction:void 0,pending:!t||!!(e&&!c&&s),gatesUnread:d})]})}function N({selected:e,overview:t,setup:n,onAction:o,dataRev:d,pair:f,pending:v,gatesUnread:x}){let ne=i(),{data:S,error:E}=h(()=>r.catalog(`laws`,f),f?[d,f.host,f.path]:[d],`catalog:laws`),{data:se}=c(d,f),[k,A]=(0,D.useState)(`all`),[j,M]=(0,D.useState)(``),[N,he]=(0,D.useState)(`all`),[ge,_e]=(0,D.useState)(()=>new Set),P=pe(e)||null,ve=e=>C(P===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),F=t?.install,I=!!(F&&o),[ye,be]=(0,D.useState)(0),xe=(0,D.useRef)(null);(0,D.useEffect)(()=>{if(!P)return;let e=requestAnimationFrame(()=>{let e=document.querySelector(`[data-addr="${CSS.escape(P)}"]`);if(!e)return;let t=xe.current===P;xe.current=null;let n=e.getBoundingClientRect();if(t||n.top<80||n.bottom>window.innerHeight){let t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;e.scrollIntoView?.({block:`center`,behavior:t?`auto`:`smooth`})}t&&(e.classList.remove(`law-flash`),e.offsetWidth,e.classList.add(`law-flash`))});return()=>cancelAnimationFrame(e)},[P,ye,S]);let L=S?.items||[],R=me(L),z=e=>t?.install?.[_[e].key]!==!1,Se=z(`IV`),B=oe({items:L,packs:R,install:F,canApply:I,onAction:o,gateArmed:Se}),{deployedRules:V,isOn:H,toggleRule:Ce,packOn:we,packState:Te,allRules:U}=B;if(E)return(0,O.jsx)(u,{error:E});if(!S||v)return(0,O.jsx)(l,{});let W={ontology:S.nouns?.ontology||`Ethos`,law:S.nouns?.law||`Dictate`,laws:S.nouns?.laws||`Dictates`,doctrines:S.nouns?.doctrines||`Doctrines`},Ee=(e,t)=>{let n=b(e,t);return x&&_[e]&&n===`Hook gate`?`Unknown`:n},G=L.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:e.name===fe&&(F||x)?Ee(`ownership`,F):`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),K=L.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&w[e.klass]?e.klass:`craft`,r=re(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:Ee(e.name,t?.install),cat:n,c:w[n].c,off:r.retired,src:`laws/universal.md`}}),q=I?[{addr:`ownership`,name:_.ownership.label,latin:``,ess:``,enf:b(`ownership`,F)}]:[],De=e=>{let t=H(e.addr),n=V.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,enf:x&&_[e.addr]&&e.enf===`Hook gate`?`Unknown`:e.enf,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Oe=R.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!V.includes(e.addr)).map(e=>e.addr)),ke=async e=>{if(!I)return;let{key:t,label:n}=_[e],r=n.toLowerCase(),i=!z(e),a=p(F),s=B.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await ne((i?`Re-arm the ${r} on ${a}? ${g[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${a}? ${g[e].off} It rebuilds in place, non-destructive.`)+s,{title:i?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:i?`Re-arm`:`Switch off`})&&o(`install`,{...F,[t]:i})},Ae=e=>(0,O.jsx)(`button`,{type:`button`,className:`sw-toggle${z(e)?` on`:``}`,role:`switch`,"aria-checked":z(e),"aria-label":_[e].label,onClick:()=>ke(e)}),je=e=>String(e.addr).includes(`.`)&&H(e.addr)!==V.includes(e.addr),J=(e,t=N)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||V.includes(e.addr)):je(e)),Y=j.trim().toLowerCase(),X=e=>J(e)&&(!Y||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(Y)),Me=e=>{let t=Be[e];(String(e).includes(`.`)?k===`invariants`:t&&k===`doctrines`)&&A(`all`),t&&!J(t)&&he(`all`),t&&!X(t)&&M(``),xe.current=pe(e),be(e=>e+1),C(`#/item/law/${encodeURIComponent(e)}`)},Z={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))Z[y(e)]=t;let Ne=e=>Z[e.addr]?{...e,asks:`${Z[e.addr]} ask${Z[e.addr]===1?``:`s`}`}:e,Q=K.filter(e=>!e.retired).length,Pe=V.length,Fe=e=>{if(x)return[`gates unread`,`warn`];let t=e.filter(e=>_[e.addr]&&!z(e.addr)).length;return t?[`${t} gate${t===1?``:`s`} off`,`warn`]:[`always`,`ok`]},Ie=U.length-Pe,$=se?.stats,Le={ethos:{name:W.ontology,n:G.length,fill:1,sub:`${G.length} sections`,pill:Fe(q)},invariants:{name:W.laws,n:K.length,fill:K.length?Q/K.length:0,sub:K.length>Q?`${Q} active · ${K.length-Q} retired`:`${Q} active`,pill:Fe(K)},doctrines:{name:W.doctrines,n:U.length,fill:U.length?Pe/U.length:0,sub:`${R.length} packs`,pill:Ie>0?[`${Ie} excluded`,`warn`]:[`all on`,`ok`]},yours:{name:`Your rules`,n:$?.rules??``,fill:+!!$?.rules,sub:$?`${$.rules} rule${$.rules===1?``:`s`} · ≈${$.tokens.toLocaleString(`en-US`)} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},Re=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,W.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},ze=te.map(e=>({key:e.key,...Le[e.key],rule:Re(e.against)})),Be=Object.fromEntries([...K,...R.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Ve=[[`all`,`All`,K.length+U.length],[`invariants`,W.laws,K.length],[`doctrines`,W.doctrines,U.length]],He=k===`all`||k===`invariants`,Ue=k===`all`||k===`doctrines`,We=[...q,...He?K:[],...Ue?R.flatMap(e=>e.rules):[]],Ge=[[`gated`,`Gated`,x?null:We.filter(e=>J(e,`gated`)).length],[`changed`,`Changed`,We.filter(e=>J(e,`changed`)).length]],Ke=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,qe=e=>N!==`changed`&&ge.has(e)&&Ke(P)!==e,Je=e=>{let t=qe(e);_e(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&Ke(P)===e&&C(`#/laws`)},Ye=R.flatMap(e=>e.rules.filter(je).map(e=>({...e,plus:H(e.addr)}))),Xe=I&&R.length>0&&B.dirty,Ze=()=>{he(`changed`),k===`invariants`&&A(`all`),M(``)},Qe=(e,t)=>(0,O.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,O.jsx)(`h2`,{className:`tier-h`,children:e}),(0,O.jsx)(`span`,{className:`mono dim`,children:t})]}),$e=K.filter(X),et=(Y||N!==`all`?q.filter(X).length:0)+(He?$e.length:0)+(Ue?R.reduce((e,t)=>e+t.rules.filter(X).length,0):0),tt=Ne(q[0]||{}).asks,nt=q.length>0&&(0,O.jsxs)(`div`,{className:`law-gate`,children:[(0,O.jsxs)(`span`,{className:`law-name`,children:[(0,O.jsx)(`span`,{children:_.ownership.label}),tt?(0,O.jsx)(`span`,{className:`law-asks mono`,children:tt}):null,(0,O.jsx)(`span`,{className:`law-princ`,children:g.ownership.desc})]}),Ae(`ownership`)]});return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(a,{eyebrow:F?[t?.theme,F.footprint&&`${F.footprint} footprint`,p(F)].filter(Boolean).join(` · `):null,title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,actions:(0,O.jsx)(ae,{className:`law-filter`,value:j,onChange:M,placeholder:`Filter rules`,label:`Filter rules`})}),(0,O.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,O.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,O.jsx)(le,{tiers:ze,current:k,onPick:A}),(0,O.jsx)(`div`,{className:`ladder-tail`,children:ee.map((e,t)=>(0,O.jsxs)(`span`,{className:`ladder-low`,children:[(0,O.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,te.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,O.jsxs)(`div`,{className:`split`,children:[(0,O.jsxs)(`section`,{className:`panel flush law-wrap${I?` with-toggle`:``}`,"aria-label":`Rules`,children:[G.length>0&&(0,O.jsxs)(O.Fragment,{children:[Qe(W.ontology,`ontology/universal.md`),G.map(e=>(0,O.jsx)(ce,{law:e,rev:d,isOpen:P===e.addr,onToggle:()=>ve(e.addr),after:e.addr===fe?nt:null},e.addr))]}),(0,O.jsxs)(`div`,{className:`law-toolbar`,children:[(0,O.jsx)(s,{"aria-label":`Show`,children:Ve.map(([e,t,n])=>(0,O.jsxs)(`button`,{type:`button`,className:k===e?`on`:``,"aria-pressed":k===e,onClick:()=>A(e),children:[t,` `,(0,O.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,O.jsx)(s,{"aria-label":`Narrow`,children:Ge.map(([e,t,n])=>(0,O.jsxs)(`button`,{type:`button`,className:N===e?`on`:``,"aria-pressed":N===e,disabled:n===null,onClick:()=>he(N===e?`all`:e),children:[t,` `,n===null?null:(0,O.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,O.jsxs)(`div`,{className:`law-rowhead`,children:[(0,O.jsx)(`span`,{children:`No.`}),(0,O.jsx)(`span`,{children:`Rule`}),(0,O.jsx)(`span`,{children:`Latin name`}),(0,O.jsx)(`span`,{children:`Status`}),(0,O.jsx)(`span`,{children:`Enforced by`})]}),He&&$e.length>0&&(0,O.jsxs)(O.Fragment,{children:[Qe(W.laws,`laws/universal.md`),$e.map(e=>(0,O.jsx)(ce,{law:Ne(e),rev:d,isOpen:P===e.addr,onToggle:()=>ve(e.addr),toggleCol:!I||e.retired?null:_[e.addr]?Ae(e.addr):(0,O.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Ue&&R.map(e=>{let t=e.rules.filter(X);if(!t.length)return null;let n=qe(e.pack),r=e.rules.filter(e=>H(e.addr)).length;return(0,O.jsxs)(`div`,{className:`pack-wrap${we(e)?``:` pack-off`}`,children:[(0,O.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,O.jsx)(`h2`,{className:`tier-h`,style:{"--cc":m[e.pack]},children:(0,O.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>Je(e.pack),children:e.title})}),(0,O.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,O.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,O.jsx)(`span`,{className:`pack-fill`,children:(0,O.jsx)(T,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,O.jsx)(`span`,{className:`pack-state mono`,children:Te(e)})]}),!e.active&&!I&&(0,O.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,R.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Oe.length>0&&` --exclude-rules ${Oe.join(`,`)}`]}),!n&&t.map(e=>(0,O.jsx)(ce,{law:Ne(De(e)),rev:d,isOpen:P===e.addr,onToggle:()=>ve(e.addr),toggleCol:I?(0,O.jsx)(`button`,{type:`button`,className:`sw-toggle${H(e.addr)?` on`:``}`,role:`switch`,"aria-checked":H(e.addr),"aria-label":`${e.name} rule`,onClick:()=>Ce(e.addr)}):null},e.addr))]},e.pack)}),et===0&&(0,O.jsx)(ie,{title:Y||N!==`all`?`No matching rules`:`Nothing in this tier`,children:Y?(0,O.jsxs)(O.Fragment,{children:[`Nothing matches “`,j.trim(),`”.`]}):N===`all`?(0,O.jsx)(O.Fragment,{children:`This install predates the tier.`}):(0,O.jsxs)(O.Fragment,{children:[`No `,N,` rule in this tier.`]})})]}),(0,O.jsxs)(`aside`,{className:`aside-stack`,children:[(0,O.jsx)(de,{packs:R,sel:B,canApply:I,install:F,gateArmed:Se}),(0,O.jsx)(ue,{gates:n?.gates,byAddr:Be,onJump:Me,disarmed:e=>!!_[e]&&!z(e),install:t?.install})]})]}),Xe&&(0,O.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,O.jsxs)(`span`,{className:`law-bar-n`,children:[Ye.length,` unapplied change`,Ye.length===1?``:`s`]}),(0,O.jsx)(`span`,{className:`law-bar-list`,children:Ye.map(e=>(0,O.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,O.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:Ze,children:`Review changes`}),(0,O.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{he(`all`),B.revert()},children:`Revert`}),(0,O.jsxs)(`button`,{type:`button`,className:`btn`,onClick:B.applyPacks,children:[`Apply (`,B.pickedRules.length,`/`,U.length,` rules)`]})]})]})}export{A as default};
|