geneseed 4.30.1 → 4.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/SHIPPED.md +1 -1
- package/docs/concepts/footprint.md +1 -1
- package/docs/reference/plugin-activity.md +1 -1
- package/docs/web-ui.md +70 -21
- package/harness.config.json +1 -1
- package/js/README.md +3 -3
- package/js/web/actions.mjs +13 -23
- package/js/web/activity.mjs +139 -23
- package/js/web/api.mjs +29 -11
- package/js/web/catalog.mjs +108 -23
- package/js/web/handler.mjs +4 -3
- package/js/web/routes.mjs +47 -14
- package/js/web/server.mjs +14 -13
- package/js/web/state.mjs +36 -15
- package/js/web/usage-api.mjs +7 -3
- package/package.json +1 -1
- package/web/dist/assets/Activity-B7cFtS00.js +1 -0
- package/web/dist/assets/ActivityDetail-C-GbMmuW.js +1 -0
- package/web/dist/assets/{Bonsai-CN4rRAHc.js → Bonsai-_YyexVC5.js} +1 -1
- package/web/dist/assets/{CopyButton-CYljsnLo.js → CopyButton-IXnXzH4Y.js} +1 -1
- package/web/dist/assets/{Dashboard-DkUm4XMu.js → Dashboard-sCfEjowQ.js} +2 -2
- package/web/dist/assets/{Docs-DE04qOKj.js → Docs-w3Y7M5Ts.js} +2 -2
- package/web/dist/assets/{GreenhouseView-DPwhFO_j.js → GreenhouseView-BWWbMKmg.js} +1 -1
- package/web/dist/assets/Installs-CnkdJ-VA.js +3 -0
- package/web/dist/assets/{JournalView-DQlDC-7i.js → JournalView-C7bPD3fZ.js} +1 -1
- package/web/dist/assets/{KitApply-BN2Az7dc.js → KitApply-CQQbnThf.js} +1 -1
- package/web/dist/assets/{Kits-C9qVd466.js → Kits-aj07N7mT.js} +1 -1
- package/web/dist/assets/Laws-DZ38nl_H.js +3 -0
- package/web/dist/assets/Library-QCGXPV5h.js +2 -0
- package/web/dist/assets/Loops-C5u7fQOR.js +2 -0
- package/web/dist/assets/{OperatorHudView-CLN6Qn25.js → OperatorHudView-Blu1lqiZ.js} +1 -1
- package/web/dist/assets/Personal-ox_MktWO.js +2 -0
- package/web/dist/assets/Tabs-CIPyMAX-.js +1 -0
- package/web/dist/assets/api-BxjLd7Qd.js +1 -0
- package/web/dist/assets/index-0GCxkY7m.css +1 -0
- package/web/dist/assets/index-CzDi9JpF.js +3 -0
- package/web/dist/index.html +3 -3
- package/web/dist/assets/Activity-C8pQvnos.js +0 -1
- package/web/dist/assets/ActivityDetail-D_8Bx-QO.js +0 -1
- package/web/dist/assets/Installs-DmPzD4BW.js +0 -3
- package/web/dist/assets/Laws-T2wbwMmB.js +0 -3
- package/web/dist/assets/Library-t3KocV0-.js +0 -2
- package/web/dist/assets/Loops-6lNY-9uR.js +0 -2
- package/web/dist/assets/Personal-xjoSqCzr.js +0 -2
- package/web/dist/assets/Tabs-DaExAgql.js +0 -1
- package/web/dist/assets/api-LvBC0CnK.js +0 -1
- package/web/dist/assets/index-DhNNxhfg.js +0 -3
- package/web/dist/assets/index-XTGBLKQr.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,D as s,E as c,I as l,J as u,M as d,N as f,P as p,Q as m,T as h,W as ee,Y as te,bt as g,ct as _,j as v,k as ne,rt as y,u as re,w as b}from"./index-CzDi9JpF.js";import{t as x}from"./EmptyState-1sPNleqv.js";import{a as S,c as C,d as w,f as T,g as E,h as D,i as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F,u as I}from"./Bonsai-_YyexVC5.js";import{t as ie}from"./usePoll-bDFN-Hr6.js";var L=e(t(),1),R=n(),z=4,B=56*z,V=24,H=165,U=188,W=e=>{let t=P(e);return t==null?null:Math.round(t*100)};function G(e,t,n){let r=o[e.status]||o.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),c=W(e);return[`${e.title||s(e.cwd)||e.session_id}, ${e.chip||e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${c==null?``:`, context ${c} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function K({s:e,t,mine:n}){let r=W(e);return(0,R.jsxs)(`div`,{className:`card gd-card`,children:[(0,R.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{children:`model`}),(0,R.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,R.jsx)(`dt`,{children:`turns`}),(0,R.jsx)(`dd`,{children:e.turns||0}),(0,R.jsx)(`dt`,{children:`context`}),(0,R.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,R.jsx)(`dt`,{children:`compactions`}),(0,R.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,R.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,R.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function q({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let c=E(e,n),l=(0,L.useMemo)(()=>I(e,{sakura:n}),[c]),u=o[e.status]||o.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=S(e),m=(0,L.useCallback)(e=>a(p,e),[a,p]);return(0,R.jsxs)(`a`,{className:`gd-tree${v(e)?` gd-needs`:``}`,href:e.href||C(e.session_id),"aria-label":G(e,l,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,Y(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,Y(e.currentTarget)),onBlur:()=>a(null,null),children:[(0,R.jsxs)(`div`,{className:`gd-label`,children:[(0,R.jsxs)(`div`,{className:`act-ell`,children:[(0,R.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip||e.host||`?`}),` `,e.title||s(e.cwd)||e.session_id]}),(0,R.jsxs)(`div`,{className:`row gap-8 gd-sub`,children:[(0,R.jsx)(`span`,{className:`badge ${u.cls}`,children:u.label}),t&&(0,R.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,R.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,R.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`}),e.phase&&(0,R.jsx)(`span`,{className:`dim act-ell`,children:e.phase})]})]}),(0,R.jsx)(N,{t:l,pad:i,swaying:f,onPad:m,px:z})]})}function J({pairs:e,count:t}){if(!e.length)return null;let n=t*B+(t-1)*V,r=e=>e*(B+V)+B/2;return(0,R.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*z+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,R.jsxs)(`g`,{className:o,children:[(0,R.jsx)(`path`,{d:`M${e} ${H} C${n} 179 ${n} 159 ${t} 169`}),(0,R.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${H}`})]},`${i}-${a}`)}return(0,R.jsx)(`g`,{className:o,children:(0,R.jsx)(`path`,{d:`M${r(i)} ${U} Q${(r(i)+r(a))/2} 222 ${r(a)} ${U}`})},`${i}-${a}`)})})}var Y=e=>e.offsetLeft-(e.parentElement?.scrollLeft||0);function ae({sessions:e,collisions:t}){let[n,r]=(0,L.useState)(O),[i,a]=(0,L.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(A,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=j(w(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>k(e,s);return(0,R.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,R.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,R.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · hover a tree, or one of its pads, for its details`]}),(0,R.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Sakura`})]}),l.length>0&&(0,R.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,R.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,R.jsx)(X,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function X({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,L.useState)({sid:null,pad:null,x:0}),o=(0,L.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=e.trees.find(e=>S(e.s)===i.sid)?.s,c=s?I(s,{sakura:t}):null,l=c&&i.pad!=null?c.pads[i.pad]:null;return(0,R.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,children:[(0,R.jsxs)(`h3`,{className:`act-lbl gd-shelf-h`,children:[e.name,` `,(0,R.jsxs)(`span`,{className:`dim`,children:[`· `,e.trees.length]})]}),(0,R.jsxs)(`div`,{className:`gd-row`,children:[e.trees.map(({s:e,worktree:n})=>(0,R.jsx)(q,{s:e,worktree:n,sakura:t,mine:r(S(e)),pad:S(e)===i.sid?i.pad:null,onHover:o},S(e))),(0,R.jsx)(J,{pairs:D(e.trees,n),count:e.trees.length})]}),s&&(0,R.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:l?(0,R.jsx)(F,{pad:l}):(0,R.jsx)(K,{s,t:c,mine:r(S(s))})})]})}var Z=e=>e.catch(()=>null);function Q({s:e}){let t=(0,L.useId)(),n=e.todos,r=a(e);return(0,R.jsxs)(`a`,{className:`card pad-md act-card`,href:e.href||C(e.session_id),"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,R.jsxs)(b,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:[e.chip&&(0,R.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip}),(0,R.jsx)(y,{name:`chevron`,className:`glyph act-chev`})]}),n&&n.total>0&&(0,R.jsx)(`div`,{className:`act-foot`,children:(0,R.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,R.jsx)(c,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,R.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,_(e.updated_at),` ago`]})]})}var $={blocked:`is blocked`,"waiting-input":`waits for your answer`};function oe(e,t){if(!Array.isArray(t))return``;let n=t.filter(v),r=e.current;return e.current=new Set(n.map(e=>`${S(e)}:${e.status}`)),r?n.filter(e=>!r.has(`${S(e)}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${$[e.status]}`).join(`. `):``}var se=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function ce(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:se.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function le(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function ue({enabled:e,installs:t,onToggle:n}){let r=T(t);return(0,R.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,R.jsx)(y,{name:`activity`,className:`glyph act-fixed`}),(0,R.jsxs)(`div`,{className:`act-grow`,children:[(0,R.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,R.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,R.jsxs)(`ul`,{className:`stack gap-8 act-fixed act-sm`,"aria-label":`Tracking per install`,children:[t.length===0&&(0,R.jsx)(`li`,{className:`dim`,children:`No active install to track.`}),t.map((e,t)=>(0,R.jsxs)(`li`,{className:`row gap-10`,children:[(0,R.jsxs)(`span`,{id:`act-track-l${t}`,title:e.path,children:[`Track live sessions in `,(0,R.jsx)(`span`,{className:`mono`,children:r.get(e.install)})]}),(0,R.jsx)(`div`,{className:`sw-toggle${e.enabled?` on`:``}`,role:`switch`,"aria-checked":e.enabled,"aria-labelledby":`act-track-l${t}`,tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.key===` `&&t.preventDefault(),n(e))}})]},e.install))]})]})}function de({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=p(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${f(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${f(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,R.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,R.jsxs)(`div`,{className:`act-stat-head`,children:[(0,R.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,R.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,R.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,R.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,R.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,R.jsx)(`i`,{className:`zero`},e.key))}),(0,R.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{children:f(r[0].key)}),(0,R.jsx)(`span`,{children:f(r[7].key)}),(0,R.jsx)(`span`,{children:`today`})]}),c&&(0,R.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,R.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function fe({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,R.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,R.jsxs)(`div`,{className:`act-stat-head`,children:[(0,R.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,R.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,R.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,R.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,R.jsxs)(`li`,{children:[(0,R.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,R.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,R.jsx)(h,{vals:e.per_day,i:t,sweep:!0}),(0,R.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,R.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var pe={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function me({job:e,longest:t}){let n=l(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=pe[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,R.jsxs)(`li`,{className:`act-row`,children:[(0,R.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,R.jsx)(y,{name:`play`,className:`glyph act-glyph`}),(0,R.jsxs)(`span`,{className:`act-what`,children:[(0,R.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,R.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,R.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,R.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,R.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function he({gate:e}){return(0,R.jsxs)(`li`,{className:`act-row gate`,children:[(0,R.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,R.jsx)(y,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,R.jsxs)(`span`,{className:`act-what`,children:[(0,R.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,R.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,R.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var ge=5,_e=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function ve(){let[e,t]=(0,L.useState)(null),[n,a]=(0,L.useState)(``),[o,c]=(0,L.useState)(ce),[l,d]=(0,L.useState)(!1),[f,h]=(0,L.useState)(``),_=(0,L.useRef)(null),y=e=>{let t={...o,...e};c(t),le(t)};ie(e=>r.activity().then(n=>{if(e()){t(n),a(``);let e=oe(_,n?.activity);e&&h(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let b=g(()=>Z(r.jobs()),[]),C=g(()=>Z(r.gates()),[]),w=g(()=>Z(r.catalog(`laws`)),[]),T=!e||e.enabled!==!1,E=Array.isArray(e?.installs)?e.installs:[],D=M(e?.activity,E).sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),O=i(),k=T&&e?D.filter(v).length:null,A=new Set(D.map(S)),j=M(e?.ended,E).filter(e=>!A.has(S(e))),N=_e([...D,...j].map(e=>e.host),o.host),P=_e([...D,...j].map(e=>s(e.cwd)),o.project),F=o.host&&o.project?`host or project`:o.host?`host`:o.project?`project`:``,I=e=>(!o.host||e.host===o.host)&&(!o.project||s(e.cwd)===o.project),z=D.filter(e=>I(e)&&(o.f!==`needs`||v(e))),B=o.f===`all`||o.f===`needs`,V=o.f===`all`&&T?j.filter(I):[],H=l?V:V.slice(0,ge),U=!F&&(o.f===`all`||o.f===`runs`),W=!F&&(o.f===`all`||o.f===`gates`),G=b.data?.jobs||[],K=re(C.data,w.data),q=ne(G,K,C.data?.days).map(e=>({...e,runs:U?e.runs:[],gate:W?e.gate:null})).filter(e=>e.runs.length||e.gate),J=Math.max(0,...G.map(e=>e.duration||0)),Y=p(q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),X=async e=>{let n=!e.enabled;try{let i=await r.activityToggle(n,{host:e.host,path:e.path});if(i.ok===!1){a(i.error||`Could not change tracking`);return}let o=t=>i.enabled?t||[]:(t||[]).flatMap(t=>{let n=(t.installs||[t.install]).filter(t=>t!==e.install);return n.length?[{...t,install:n[0],installs:n}]:[]});t(t=>{let n=(t?.installs||[]).map(t=>t.install===e.install?{...t,enabled:i.enabled}:t);return{...t||{},installs:n,enabled:n.length===0||n.some(e=>e.enabled),activity:o(t?.activity),ended:o(t?.ended)}}),a(``)}catch(e){a(e.message)}},$=(e,t,n)=>(0,R.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,R.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,R.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:o[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>y({[e]:t.target.value}),children:[(0,R.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]});return(0,R.jsxs)(`div`,{className:`page-fill`,children:[(0,R.jsx)(ee,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,R.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:f}),n&&(0,R.jsx)(`div`,{className:`act-gap`,children:(0,R.jsx)(u,{error:n})}),e&&(0,R.jsx)(ue,{enabled:T,installs:E,onToggle:X}),(0,R.jsxs)(`div`,{className:`act-today`,children:[(0,R.jsx)(de,{jobs:b.data,loading:b.loading}),(0,R.jsx)(fe,{rows:K,gates:C.data,loading:C.loading}),(0,R.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,R.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,R.jsxs)(`span`,{className:`act-big act-wait`,children:[k??`—`,` `,(0,R.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,R.jsx)(`p`,{className:`dim act-sm`,children:T?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]})]}),(0,R.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,R.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:se.map(([e,t])=>(0,R.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&k>0?(0,R.jsxs)(`span`,{className:`mono`,children:[` `,k]}):null]},e))}),$(`host`,`Host`,N),$(`project`,`Project`,P),(0,R.jsx)(m,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,R.jsx)(`button`,{type:`button`,className:o.v===e?`on`:``,"aria-pressed":o.v===e,onClick:()=>y({v:e}),children:t},e))})]}),F&&o.f!==`needs`&&(0,R.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,F,`; showing sessions only.`]}),B&&(e?!T&&o.f!==`needs`?null:z.length===0?o.f===`needs`?(0,R.jsx)(x,{title:`Nothing waits on you`}):(0,R.jsxs)(x,{title:`No active sessions`,children:[`Run `,(0,R.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):o.v===`garden`?(0,R.jsx)(ae,{sessions:z,collisions:e.collisions}):(0,R.jsx)(`div`,{className:`stack gap-12 act-live`,ref:O,children:z.map(e=>(0,R.jsx)(`div`,{"data-flip":S(e),children:(0,R.jsx)(Q,{s:e})},S(e)))}):(0,R.jsx)(te,{label:`Reading live sessions…`})),V.length>0&&(0,R.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,R.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),H.map(e=>(0,R.jsx)(`div`,{children:(0,R.jsx)(Q,{s:e})},S(e))),V.length>ge&&(0,R.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":l,onClick:()=>d(e=>!e),children:l?`Show fewer`:`Show all ${V.length}`})]}),o.f!==`needs`&&(0,R.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Y,children:q.map(e=>(0,R.jsxs)(`section`,{className:`card act-day`,children:[(0,R.jsxs)(`h3`,{className:`act-day-h`,children:[(0,R.jsx)(`span`,{children:e.title}),(0,R.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,R.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,R.jsx)(me,{job:e,longest:J},e.id)),e.gate&&(0,R.jsx)(he,{gate:e.gate})]})]},e.key))})]})}export{ve as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{D as i,J as a,O as o,W as s,Y as c,ct as l,j as u,rt as d,w as f}from"./index-CzDi9JpF.js";import{t as p}from"./EmptyState-1sPNleqv.js";import{g as m,i as h,l as g,r as _,s as v,t as y,u as b}from"./Bonsai-_YyexVC5.js";import{t as x}from"./usePoll-bDFN-Hr6.js";var S=e(t(),1),C=n();function w(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function T({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${o(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,C.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,C.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,C.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,C.jsx)(`span`,{className:`feed-dot act-inline-dot ${w(e)||`acc`}`}),e.kind===`thinking`&&(0,C.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,C.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,C.jsx)(`b`,{children:i}),e.error&&(0,C.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,C.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,C.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${l(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function E({turns:e}){return!e||e.length===0?(0,C.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,C.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,C.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,C.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,C.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var D=5;function O({s:e}){let[t]=(0,S.useState)(h),[n,r]=(0,S.useState)(null),i=!!e.ended,a=i?{...e,status:u(e)?`busy`:e.status,error:null}:e,o=m(a,t),s=(0,S.useMemo)(()=>b(a,{sakura:t}),[o]),c=(0,S.useCallback)(e=>r(e),[]),l=v(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,p=[`${d} turn${d===1?``:`s`}`,`context ${l==null?`unknown`:`${Math.round(l*100)} %`}`,`${f} compaction${f===1?``:`s`}`,`sub-agents: ${s.pads.filter(e=>e.key!=null).length} ${i?`unfinished`:`running`}, ${s.fallen.length} finished`].join(` · `),g=n==null?null:s.pads[n];return(0,C.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!i&&u(e)?` gd-needs`:``}`,children:[(0,C.jsx)(_,{t:s,pad:n,swaying:!i&&e.status!==`idle`,onPad:c,px:D,label:`Bonsai of this session${i?`, ended`:``}: ${p}`}),(0,C.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[i&&(0,C.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,C.jsx)(`div`,{className:`dim act-sm`,children:p}),g?(0,C.jsx)(y,{pad:g}):(0,C.jsx)(`div`,{className:`dim act-xs`,children:`Hover a pad for the files it changed.`})]})]})}function k({sid:e}){let{sid:t,install:n}=g(e,window.location.hash),[o,u]=(0,S.useState)(null),[m,h]=(0,S.useState)(``),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(!1),w=(0,S.useId)();x(e=>_?void 0:r.activityDetail(t,n).then(t=>{e()&&(u(t),h(``),v(!1))},t=>{e()&&(t.status===404?v(!0):h(t.message))}),2e3,[t,_]);let D=(0,C.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,C.jsx)(d,{name:`arrow`}),` Activity`]});if(_)return(0,C.jsxs)(`div`,{className:`page-fill`,children:[D,(0,C.jsx)(p,{title:`Session ended`,action:(0,C.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!o)return(0,C.jsxs)(`div`,{className:`page-fill`,children:[D,m?(0,C.jsx)(a,{error:m}):(0,C.jsx)(c,{label:`Loading session…`})]});let k=o.session,A=k.files,j=k.todos,M=!!(A&&A.items&&A.items.length>0),N=!!(j&&j.items&&j.items.length>0),P=o.conversation||[],F=o.timeline||[],I=[...P.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...F.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,C.jsxs)(`div`,{className:`page-fill`,children:[D,(0,C.jsx)(s,{title:k.title||i(k.cwd)||k.session_id,sub:k.cwd?(0,C.jsx)(`span`,{className:`mono act-cwd`,title:k.cwd,children:k.cwd}):null}),m&&(0,C.jsx)(`div`,{className:`act-gap`,children:(0,C.jsx)(a,{error:m})}),(0,C.jsxs)(`div`,{className:`card pad-md`,children:[(0,C.jsx)(f,{s:k}),(0,C.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,l(k.updated_at),` ago`]})]}),(0,C.jsx)(O,{s:k}),(M||N)&&(0,C.jsxs)(`div`,{className:`grid gap-12 act-panels${M&&N?` two`:``}`,children:[M&&(0,C.jsxs)(`div`,{className:`card pad-md`,children:[(0,C.jsx)(`div`,{className:`card-head`,children:(0,C.jsxs)(`h2`,{children:[`Files touched `,(0,C.jsxs)(`span`,{className:`dim`,children:[`(`,A.count,`)`]})]})}),(0,C.jsx)(`div`,{className:`stack act-list`,children:A.items.map(e=>(0,C.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,C.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,C.jsxs)(`span`,{className:`act-fixed`,children:[(0,C.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,C.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),N&&(0,C.jsxs)(`div`,{className:`card pad-md`,children:[(0,C.jsx)(`div`,{className:`card-head`,children:(0,C.jsxs)(`h2`,{children:[`Plan`,` `,(0,C.jsxs)(`span`,{className:`dim`,children:[`(`,j.done,`/`,j.total,`)`]})]})}),(0,C.jsx)(`div`,{className:`stack act-list`,children:j.items.map((e,t)=>(0,C.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,C.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,C.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,C.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,C.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,C.jsx)(`h2`,{children:`Timeline`}),F.length>0&&(0,C.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":y,"aria-controls":w,onClick:()=>b(e=>!e),children:y?`Show conversation`:`Show full stream (${I.length})`})]}),(0,C.jsx)(`div`,{id:w,children:y?(0,C.jsx)(`div`,{className:`stack gap-12`,children:I.map((e,t)=>(0,C.jsx)(T,{rec:e},t))}):(0,C.jsx)(E,{turns:P})})]})]})}export{O as SessionTree,k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";var r=e(t(),1),i=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},a=e=>()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},o=e=>Math.max(0,Math.min(1,e)),s={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},c={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},l={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},u=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],d=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],f=[`#3E8E41`,`#5FB14F`],p=[`#4A4F54`,`#62686E`],m=`#FFF6E0`,h=[`#E3C24A`,`#C9A23A`],g=[`#9BDD6A`,`#D8F59A`],_={"!":`#E8B04A`,x:`#FF6F69`},v=12;function y(e){let t=String(e||``).toLowerCase();return/implement|develop/.test(t)?`developer`:/explor/.test(t)?`explorer`:/review/.test(t)?`reviewer`:/test/.test(t)?`tester`:null}var b=e=>e?.status===`blocked`||e?.status===`waiting-input`;function x(e){return Array.isArray(e.files_all)?e.files_all.filter(e=>e&&typeof e==`object`):(Array.isArray(e.files?.items)?e.files.items:[]).filter(e=>e&&typeof e==`object`).map(e=>({file:e.file??null,path:e.path??null,additions:e.additions??0,deletions:e.deletions??0,by:e.by??null}))}var S=e=>e==null||e===``?NaN:Number(e);function C(e){let t=S(e?.context?.used),n=S(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?o(t/n):null}function w(e){let t=x(e),n=(Array.isArray(e.agents)?e.agents:[]).filter(e=>e&&typeof e==`object`).map((e,t)=>({key:e.id??`#${t}`,id:e.id??null,type:e.type||null,running:e.status!==`done`,files:[]})),r=new Map(n.map(e=>[e.key,e])),i=[],a=e.attribution!==!1;for(let e of t){if(!a||e.by==null){i.push(e);continue}let t=r.get(e.by);t||(t={key:e.by,id:e.by,type:`agent`,running:!0,files:[]},n.push(t),r.set(e.by,t)),t.files.push(e)}let c=C(e),l=c!=null,u=l?S(e.context.used):NaN,d=l?c:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=S(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?o(u/p):0;return{id:String(e.session_id??``),host:s[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:b(e)?`!`:e.error?`x`:null,turns:Math.max(0,Number(e.turns)||0),ctx:d,compactions:f,compacted:f>0&&m<1,regrow:m,crown:i,agents:n}}function T(e,t=!1){let n=w(e);return JSON.stringify([n.id,n.host,n.idle,n.bubble,n.turns,Math.round(n.ctx*100),n.compactions,Math.round(n.regrow*100),n.crown.length,n.agents.map(e=>[e.key,e.type,e.running,e.files.length]),!!t])}function E(e,{sakura:t=!1}={}){let n=w(e),{id:r,idle:o}=n,b=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*b,S=a(i(r)),C=Array.from({length:56},()=>Array(56).fill(null)),T=Array.from({length:56},()=>Array(56).fill(-1)),E=-1,D=(e,t,n)=>{e=Math.round(e),t=Math.round(t),e>=0&&e<56&&t>=0&&t<56&&(C[t][e]=n,T[t][e]=E)},O=o?d:u,k=o?p:f,A=o?c.idle:t?c.sakura:c.live,j=Math.round(41-(9+18*b)),M=1+S()*2+3*b,N=S()*Math.PI*2,P=.9+S()*.6,F=e=>28+M*Math.sin(e*Math.PI*P+N)-M*Math.sin(N);for(let e=41;e>=j;e--){let t=(41-e)/(41-j),n=F(t),r=3+4.5*b-(1.5+3.5*b)*t;for(let t=Math.floor(n-r/2);t<=Math.ceil(n+r/2);t++){let i=(t-(n-r/2))/r;D(t,e,i<.25?O[3]:i>.75?O[0]:S()<.15?O[1]:O[2])}}for(let e=-6;e<=6;e++)D(28+e,41,Math.abs(e)>4?O[1]:O[2]),Math.abs(e)<=5&&D(28+e,40,Math.abs(e)>3?O[1]:O[2]);let I=[],L=(e,t,n,o,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=a(i(`${r}:pad:${c}`)),u=n*.72;t=Math.max(t,u+6);for(let r=0;r<6;r++){let r=-Math.PI*(.15+.7*l()),i=n*(.4+.5*l());for(let n=0;n<i;n++)D(e+Math.cos(r)*n,t+u*.5+Math.sin(r)*n*.8,O[0])}let d=Math.round(10+n*1.6),f=[];for(let r=0;r<d;r++){let r=l()*Math.PI*2,i=Math.sqrt(l());f.push([e+Math.cos(r)*i*n,t+Math.sin(r)*i*u,1.8+l()*2.2])}f.sort((e,t)=>t[1]-e[1]);for(let[e,n,r]of f){let i=Math.max(0,Math.min(4,Math.round(4*(1-(n-(t-u))/(2*u))+(l()-.5))));for(let t=Math.floor(n-r);t<=n+r;t++)for(let a=Math.floor(e-r);a<=e+r;a++){if(((a-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=a-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(a,t,o[Math.max(0,Math.min(4,i+s))])}}let p=a(i(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,v);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,m);return{rx:n,cy:t}},R=a(i(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let s=.25+.55*(t/Math.max(1,n.agents.length-1)),c=Math.round(41-s*(41-j)),u=F(s);if(!e.running){let t=(3+4.5*b-(1.5+3.5*b)*s)/2;E=-1,D(u+R*(t+1),c,O[3]),D(u+R*(t+2),c-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let d=Math.round((12+Math.floor(a(i(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=d;e++){let t=u+R*e,n=c-e*.45;D(t,n,O[e<d/2?1:2]),D(t,n+1,O[0]),e<d*.6&&D(t,n+2,O[0])}let f=o?null:y(e.type),p=f?l[f]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:f,files:e.files,bbox:null}),L(u+R*d,c-d*.45-2,(8+Math.min(e.files.length,6)*.6)*x,p,e.files.length,e.key),R=-R});let B=I.length;I.push({agentId:null,key:null,type:null,family:null,files:n.crown,bbox:null}),E=B;let V=(4+7*n.ctx+Math.min(n.crown.length,6)*.5)*x*1.35,{rx:H,cy:U}=L(F(1),j-3,V,A,n.crown.length,`crown`);if(n.ctx>.8&&!n.compacted){let e=a(i(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)T[t][n]===B&&C[t][n]!==m&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?h[0]:h[1])}if(n.compacted){let e=a(i(`${r}:shoots`)),t=Math.round(U-H*.15-n.regrow*H*.5);for(let e=0;e<Math.max(0,t);e++)for(let t=0;t<56;t++)T[e][t]===B&&(C[e][t]=null,T[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(T[t][r]!==B||e()>=.12+n.regrow*.5)continue;let i=1+Math.floor(e()*(1+n.regrow*3));for(let e=1;e<=i;e++)D(r,t-e,e===i?g[1]:g[0])}}E=-1;let W=a(i(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,c.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,m);let[G,K,q]=s[n.host];for(let e=42;e<=46;e++){let t=e<=43?0:Math.floor((e-43)*.45)+2;for(let n=13+t;n<=42-t;n++){if(e===42&&C[e][n]===m)continue;let r=K;e<=43?r=e===42?q:G:(e===46||n===13+t||n===42-t)&&(r=G),D(n,e,r)}}let J=a(i(`${r}:moss`));for(let e=15;e<=40;e++)D(e,41,J()<.5?k[0]:k[1]),J()<.35&&D(e,40,k[0]);for(let e=16;e<=39;e++)D(e,47,`#00000055`);if(n.bubble){let e=_[n.bubble];for(let t=3;t<10;t++)for(let n=40;n<47;n++)D(n,t,t===3||t===9||n===40||n===46?e:`#14191F`);if(D(41,10,e),n.bubble===`!`){for(let t=5;t<=6;t++)D(43,t,e);D(43,8,e)}else for(let[t,n]of[[2,2],[4,2],[3,3],[2,4],[4,4]])D(40+t,3+n,e)}let Y=[],X=I.map(()=>null);for(let e=0;e<56;e++){let t=0;for(;t<56;){let n=C[e][t],r=T[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&T[e][i+1]===r;)i++;if(Y.push({x:t,y:e,w:i-t+1,c:n,p:r}),r>=0){let n=X[r]||={x0:t,y0:e,x1:i,y1:e};n.x0=Math.min(n.x0,t),n.x1=Math.max(n.x1,i),n.y1=e}t=i+1}}return I.forEach((e,t)=>{let n=X[t];e.bbox=n?{x:n.x0,y:n.y0,w:n.x1-n.x0+1,h:n.y1-n.y0+1}:null}),{width:56,height:56,runs:Y,pads:I,bubble:n.bubble,fallen:z}}var D=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},O=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function k(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?O(e):n.cwd?`cwd:${O(n.cwd)}`:`outside a repo`),i=D(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&O(n.root)!==O(e)?D(n.root):null;t.get(r).trees.push({s:n,worktree:a})}let n=(e,t)=>e<t?-1:+(e>t),r=[...t.values()];for(let e of r)e.trees.sort((e,t)=>n(e.worktree||``,t.worktree||``)||n(String(e.s.session_id),String(t.s.session_id)));return r.sort((e,t)=>n(e.name.toLowerCase(),t.name.toLowerCase())||n(e.key,t.key))}var A=(e,t)=>new Set((e.writers||[]).filter(e=>e.sid===t).map(e=>O(e.root)));function j(e,t,n){let r=A(e,t);for(let t of A(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var M=e=>[...new Set((e.writers||[]).map(e=>e.sid))];function N(e,t){let n=new Map(e.map((e,t)=>[e.s.session_id,t])),r=new Map;for(let e of t||[]){let t=M(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=j(e,t[i],t[a]);(!r.has(c)||l===`same-worktree`)&&r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function P(e,t){let n=[];for(let r of t||[]){let t=M(r).filter(t=>t!==e);if(!t.length||!M(r).includes(e))continue;let i=t.some(t=>j(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var F=e=>e?.status===`busy`||b(e);function I(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=>F(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 L=n(),R=12,z=`geneseed-garden-sakura`;function B(){try{return window.localStorage.getItem(z)===`1`}catch{return!1}}var V=e=>e.key==null?`the session`:e.type||`agent`,H=e=>e.path||e.file||`?`;function U({pad:e}){let t=e.files.slice(0,R);return(0,L.jsxs)(`div`,{className:`card gd-card`,children:[(0,L.jsxs)(`div`,{className:`act-lbl`,children:[V(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,L.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`span`,{className:`mono act-ell`,children:H(e)}),(0,L.jsxs)(`span`,{className:`mono act-xs`,children:[(0,L.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,L.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${H(e)}:${t}`))}),e.files.length>t.length&&(0,L.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var W=(0,r.memo)(function({t:e,pad:t,swaying:n,onPad:i,px:a,label:o}){let s=(0,r.useMemo)(()=>{let t=new Map;for(let n of e.runs)t.has(n.p)||t.set(n.p,[]),t.get(n.p).push(n);return[...t.entries()]},[e]);return(0,L.jsx)(`svg`,{className:`gd-svg${t==null?``:` gd-dimming`}`,viewBox:`0 0 56 56`,width:56*a,height:56*a,shapeRendering:`crispEdges`,"data-bubble":e.bubble||void 0,...o?{role:`img`,"aria-label":o}:{"aria-hidden":`true`},children:s.map(([r,a])=>(0,L.jsx)(`g`,{"data-p":r,className:[r===t&&`gd-hot`,n&&r>=0&&e.pads[r].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:r>=0?()=>i(r):void 0,onMouseLeave:r>=0?()=>i(null):void 0,children:a.map(e=>(0,L.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},r))})});export{I as a,k as c,T as d,B as i,P as l,z as n,C as o,W as r,E as s,U as t,N as u};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";var r=e(t(),1),i=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},a=e=>()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},o=e=>Math.max(0,Math.min(1,e)),s={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},c={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},l={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},u=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],d=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],f=[`#3E8E41`,`#5FB14F`],p=[`#4A4F54`,`#62686E`],m=`#FFF6E0`,h=[`#E3C24A`,`#C9A23A`],g=[`#9BDD6A`,`#D8F59A`],_={"!":`#E8B04A`,x:`#FF6F69`},v=12;function y(e){let t=String(e||``).toLowerCase();return/implement|develop/.test(t)?`developer`:/explor/.test(t)?`explorer`:/review/.test(t)?`reviewer`:/test/.test(t)?`tester`:null}var b=e=>e?.status===`blocked`||e?.status===`waiting-input`;function x(e){return Array.isArray(e.files_all)?e.files_all.filter(e=>e&&typeof e==`object`):(Array.isArray(e.files?.items)?e.files.items:[]).filter(e=>e&&typeof e==`object`).map(e=>({file:e.file??null,path:e.path??null,additions:e.additions??0,deletions:e.deletions??0,by:e.by??null}))}var S=e=>e==null||e===``?NaN:Number(e);function C(e){let t=S(e?.context?.used),n=S(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?o(t/n):null}function w(e){let t=x(e),n=(Array.isArray(e.agents)?e.agents:[]).filter(e=>e&&typeof e==`object`).map((e,t)=>({key:e.id??`#${t}`,id:e.id??null,type:e.type||null,running:e.status!==`done`,files:[]})),r=new Map(n.map(e=>[e.key,e])),i=[],a=e.attribution!==!1;for(let e of t){if(!a||e.by==null){i.push(e);continue}let t=r.get(e.by);t||(t={key:e.by,id:e.by,type:`agent`,running:!0,files:[]},n.push(t),r.set(e.by,t)),t.files.push(e)}let c=C(e),l=c!=null,u=l?S(e.context.used):NaN,d=l?c:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=S(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?o(u/p):0;return{id:String(e.session_id??``),host:s[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:b(e)?`!`:e.error?`x`:null,turns:Math.max(0,Number(e.turns)||0),ctx:d,compactions:f,compacted:f>0&&m<1,regrow:m,crown:i,agents:n}}function T(e,t=!1){let n=w(e);return JSON.stringify([n.id,n.host,n.idle,n.bubble,n.turns,Math.round(n.ctx*100),n.compactions,Math.round(n.regrow*100),n.crown.length,n.agents.map(e=>[e.key,e.type,e.running,e.files.length]),!!t])}function E(e,{sakura:t=!1}={}){let n=w(e),{id:r,idle:o}=n,b=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*b,S=a(i(r)),C=Array.from({length:56},()=>Array(56).fill(null)),T=Array.from({length:56},()=>Array(56).fill(-1)),E=-1,D=(e,t,n)=>{e=Math.round(e),t=Math.round(t),e>=0&&e<56&&t>=0&&t<56&&(C[t][e]=n,T[t][e]=E)},O=o?d:u,k=o?p:f,A=o?c.idle:t?c.sakura:c.live,j=Math.round(41-(9+18*b)),M=1+S()*2+3*b,N=S()*Math.PI*2,P=.9+S()*.6,F=e=>28+M*Math.sin(e*Math.PI*P+N)-M*Math.sin(N);for(let e=41;e>=j;e--){let t=(41-e)/(41-j),n=F(t),r=3+4.5*b-(1.5+3.5*b)*t;for(let t=Math.floor(n-r/2);t<=Math.ceil(n+r/2);t++){let i=(t-(n-r/2))/r;D(t,e,i<.25?O[3]:i>.75?O[0]:S()<.15?O[1]:O[2])}}for(let e=-6;e<=6;e++)D(28+e,41,Math.abs(e)>4?O[1]:O[2]),Math.abs(e)<=5&&D(28+e,40,Math.abs(e)>3?O[1]:O[2]);let I=[],L=(e,t,n,o,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=a(i(`${r}:pad:${c}`)),u=n*.72;t=Math.max(t,u+6);for(let r=0;r<6;r++){let r=-Math.PI*(.15+.7*l()),i=n*(.4+.5*l());for(let n=0;n<i;n++)D(e+Math.cos(r)*n,t+u*.5+Math.sin(r)*n*.8,O[0])}let d=Math.round(10+n*1.6),f=[];for(let r=0;r<d;r++){let r=l()*Math.PI*2,i=Math.sqrt(l());f.push([e+Math.cos(r)*i*n,t+Math.sin(r)*i*u,1.8+l()*2.2])}f.sort((e,t)=>t[1]-e[1]);for(let[e,n,r]of f){let i=Math.max(0,Math.min(4,Math.round(4*(1-(n-(t-u))/(2*u))+(l()-.5))));for(let t=Math.floor(n-r);t<=n+r;t++)for(let a=Math.floor(e-r);a<=e+r;a++){if(((a-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=a-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(a,t,o[Math.max(0,Math.min(4,i+s))])}}let p=a(i(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,v);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,m);return{rx:n,cy:t}},R=a(i(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let s=.25+.55*(t/Math.max(1,n.agents.length-1)),c=Math.round(41-s*(41-j)),u=F(s);if(!e.running){let t=(3+4.5*b-(1.5+3.5*b)*s)/2;E=-1,D(u+R*(t+1),c,O[3]),D(u+R*(t+2),c-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let d=Math.round((12+Math.floor(a(i(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=d;e++){let t=u+R*e,n=c-e*.45;D(t,n,O[e<d/2?1:2]),D(t,n+1,O[0]),e<d*.6&&D(t,n+2,O[0])}let f=o?null:y(e.type),p=f?l[f]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:f,files:e.files,bbox:null}),L(u+R*d,c-d*.45-2,(8+Math.min(e.files.length,6)*.6)*x,p,e.files.length,e.key),R=-R});let B=I.length;I.push({agentId:null,key:null,type:null,family:null,files:n.crown,bbox:null}),E=B;let V=(4+7*n.ctx+Math.min(n.crown.length,6)*.5)*x*1.35,{rx:H,cy:U}=L(F(1),j-3,V,A,n.crown.length,`crown`);if(n.ctx>.8&&!n.compacted){let e=a(i(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)T[t][n]===B&&C[t][n]!==m&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?h[0]:h[1])}if(n.compacted){let e=a(i(`${r}:shoots`)),t=Math.round(U-H*.15-n.regrow*H*.5);for(let e=0;e<Math.max(0,t);e++)for(let t=0;t<56;t++)T[e][t]===B&&(C[e][t]=null,T[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(T[t][r]!==B||e()>=.12+n.regrow*.5)continue;let i=1+Math.floor(e()*(1+n.regrow*3));for(let e=1;e<=i;e++)D(r,t-e,e===i?g[1]:g[0])}}E=-1;let W=a(i(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,c.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,m);let[G,K,q]=s[n.host];for(let e=42;e<=46;e++){let t=e<=43?0:Math.floor((e-43)*.45)+2;for(let n=13+t;n<=42-t;n++){if(e===42&&C[e][n]===m)continue;let r=K;e<=43?r=e===42?q:G:(e===46||n===13+t||n===42-t)&&(r=G),D(n,e,r)}}let J=a(i(`${r}:moss`));for(let e=15;e<=40;e++)D(e,41,J()<.5?k[0]:k[1]),J()<.35&&D(e,40,k[0]);for(let e=16;e<=39;e++)D(e,47,`#00000055`);if(n.bubble){let e=_[n.bubble];for(let t=3;t<10;t++)for(let n=40;n<47;n++)D(n,t,t===3||t===9||n===40||n===46?e:`#14191F`);if(D(41,10,e),n.bubble===`!`){for(let t=5;t<=6;t++)D(43,t,e);D(43,8,e)}else for(let[t,n]of[[2,2],[4,2],[3,3],[2,4],[4,4]])D(40+t,3+n,e)}let Y=[],X=I.map(()=>null);for(let e=0;e<56;e++){let t=0;for(;t<56;){let n=C[e][t],r=T[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&T[e][i+1]===r;)i++;if(Y.push({x:t,y:e,w:i-t+1,c:n,p:r}),r>=0){let n=X[r]||={x0:t,y0:e,x1:i,y1:e};n.x0=Math.min(n.x0,t),n.x1=Math.max(n.x1,i),n.y1=e}t=i+1}}return I.forEach((e,t)=>{let n=X[t];e.bbox=n?{x:n.x0,y:n.y0,w:n.x1-n.x0+1,h:n.y1-n.y0+1}:null}),{width:56,height:56,runs:Y,pads:I,bubble:n.bubble,fallen:z}}var D=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},O=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function k(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?O(e):n.cwd?`cwd:${O(n.cwd)}`:`outside a repo`),i=D(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&O(n.root)!==O(e)?D(n.root):null;t.get(r).trees.push({s:n,worktree:a})}let n=(e,t)=>e<t?-1:+(e>t),r=[...t.values()];for(let e of r)e.trees.sort((e,t)=>n(e.worktree||``,t.worktree||``)||n(String(e.s.session_id),String(t.s.session_id)));return r.sort((e,t)=>n(e.name.toLowerCase(),t.name.toLowerCase())||n(e.key,t.key))}var A=e=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),j=e=>A({key:e.key??void 0,install:e.install,session_id:e.sid}),M=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`);function N(e){let t=e||[],n=e=>n=>t.filter(t=>e(t)===e(n)).length,r=n(e=>e.host),i=n(e=>`${e.host} ${e.scope}`),a=new Map(t.map(e=>[e.install,r(e)<2?e.host:i(e)<2||e.scope===`global`?`${e.host} · ${e.scope}`:`${e.host} · ${D(e.path)}`])),o=()=>t.filter(e=>t.some(t=>t!==e&&a.get(t.install)===a.get(e.install)));for(let e=2,t=o();t.length;e++,t=o()){for(let n of t){let t=String(n.path).split(/[\\/]+/).filter(Boolean).length;a.set(n.install,`${n.host} · ${e>t?n.path:M(n.path,e)}`)}if(e>64)break}return a}var P=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function F(e,t){let n=String(e).indexOf(`?`),r=new URLSearchParams(String(t||``).split(`?`)[1]||``),i=r.get(`host`),a=r.get(`path`);return{sid:n<0?e:String(e).slice(0,n),install:i&&a?{host:i,path:a}:void 0}}function I(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),r=N(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:r.get(e.install)??e.host??null,href:P(e.session_id,t)}})}var L=(e,t)=>new Set((e.writers||[]).filter(e=>j(e)===t).map(e=>O(e.root)));function R(e,t,n){let r=L(e,t);for(let t of L(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var z=e=>[...new Set((e.writers||[]).map(j))];function B(e,t){let n=new Map(e.map((e,t)=>[A(e.s),t])),r=new Map;for(let e of t||[]){let t=z(e).filter(e=>n.has(e));for(let i=0;i<t.length;i++)for(let a=i+1;a<t.length;a++){let o=n.get(t[i]),s=n.get(t[a]),c=o<s?`${o}-${s}`:`${s}-${o}`,l=R(e,t[i],t[a]);(!r.has(c)||l===`same-worktree`)&&r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function V(e,t){let n=[];for(let r of t||[]){let t=z(r).filter(t=>t!==e);if(!t.length||!z(r).includes(e))continue;let i=t.some(t=>R(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var H=e=>e?.status===`busy`||b(e);function U(e,t=10){let n=e.map(e=>({...e,collapsed:!1})),r=n.reduce((e,t)=>e+t.trees.length,0);if(r<=t)return n;let i=n.length,a=n.filter(e=>!e.trees.some(e=>H(e.s))).sort((e,t)=>t.trees.length-e.trees.length||(e.key<t.key?-1:1));for(let e of a){if(r<=t||i<=1)break;e.collapsed=!0,r-=e.trees.length,i--}return n}var W=n(),G=12,K=`geneseed-garden-sakura`;function q(){try{return window.localStorage.getItem(K)===`1`}catch{return!1}}var J=e=>e.key==null?`the session`:e.type||`agent`,Y=e=>e.path||e.file||`?`;function X({pad:e}){let t=e.files.slice(0,G);return(0,W.jsxs)(`div`,{className:`card gd-card`,children:[(0,W.jsxs)(`div`,{className:`act-lbl`,children:[J(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,W.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`mono act-ell`,children:Y(e)}),(0,W.jsxs)(`span`,{className:`mono act-xs`,children:[(0,W.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,W.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Y(e)}:${t}`))}),e.files.length>t.length&&(0,W.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var Z=(0,r.memo)(function({t:e,pad:t,swaying:n,onPad:i,px:a,label:o}){let s=(0,r.useMemo)(()=>{let t=new Map;for(let n of e.runs)t.has(n.p)||t.set(n.p,[]),t.get(n.p).push(n);return[...t.entries()]},[e]);return(0,W.jsx)(`svg`,{className:`gd-svg${t==null?``:` gd-dimming`}`,viewBox:`0 0 56 56`,width:56*a,height:56*a,shapeRendering:`crispEdges`,"data-bubble":e.bubble||void 0,...o?{role:`img`,"aria-label":o}:{"aria-hidden":`true`},children:s.map(([r,a])=>(0,W.jsx)(`g`,{"data-p":r,className:[r===t&&`gd-hot`,n&&r>=0&&e.pads[r].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:r>=0?()=>i(r):void 0,onMouseLeave:r>=0?()=>i(null):void 0,children:a.map(e=>(0,W.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},r))})});export{A as a,P as c,k as d,N as f,T as g,B as h,q as i,F as l,V as m,K as n,U as o,I as p,Z as r,C as s,X as t,E as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{rt as r}from"./index-CzDi9JpF.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-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-LvBC0CnK.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{B as l,I as u,J as d,L as f,U as p,Y as m,Z as h,bt as g,ct as _,dt as v,l as y,lt as b,ot as x,pt as S,q as C,t as w,ut as T}from"./index-DhNNxhfg.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`},ee={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=u(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];if(i&&i.key===r){i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started);continue}t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=v(e.newest),n=e.oldest?v(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=f(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${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:ee[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=S(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>g(`#/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)(x,{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=f(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:[v(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(l,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=T(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=b(e.counts),o=n?.version_verdict||``,s=U(o),l=_(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=b(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=S(()=>q(()=>i.fleet()),[e]),r=S(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?y(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>w(()=>import(`./GreenhouseView-DPwhFO_j.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>w(()=>import(`./OperatorHudView-CLN6Qn25.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>w(()=>import(`./JournalView-DQlDC-7i.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:l}){let u=c,[f,g]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,v=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:y}=S(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(d,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(m,{});let b=e.daemon_stale?(0,k.jsx)(C,{}):null;return e.deployed?f===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:[b,(0,k.jsx)(Q,{overview:e,recent:y,lens:v,onDirection:g,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(h,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>g(e),"aria-pressed":f===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:v,dataRev:l}),f===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:v,onAction:s})}),f===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:v})}),f===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:v}),f===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:v})]},f)]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(p,{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-BWWbMKmg.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-CzDi9JpF.js","assets/api-BxjLd7Qd.js","assets/index-0GCxkY7m.css","assets/OperatorHudView-Blu1lqiZ.js","assets/JournalView-C7bPD3fZ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BxjLd7Qd.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{B as l,Dt as u,I as d,J as f,L as p,Q as m,U as h,Y as g,at as _,bt as v,ct as y,l as b,ot as x,q as S,rt as C,st as w,t as T}from"./index-CzDi9JpF.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),ee={done:`ok`,failed:`bad`},A={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=d(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];if(i&&i.key===r){i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started);continue}t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=y(e.newest),n=e.oldest?y(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=p(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${ee[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:A[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=v(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>u(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(o,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function R({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,k.jsxs)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(C,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=p(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[y(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(l,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=w(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=x(e.counts),o=n?.version_verdict||``,s=U(o),l=_(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=x(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=v(()=>q(()=>i.fleet()),[e]),r=v(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?b(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>T(()=>import(`./GreenhouseView-BWWbMKmg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>T(()=>import(`./OperatorHudView-Blu1lqiZ.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>T(()=>import(`./JournalView-C7bPD3fZ.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:l}){let u=c,[d,p]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:b}=v(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(f,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(g,{});let x=e.daemon_stale?(0,k.jsx)(S,{}):null;return e.deployed?d===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:[x,(0,k.jsx)(Q,{overview:e,recent:b,lens:y,onDirection:p,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(m,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:d===e?`on`:``,onClick:()=>p(e),"aria-pressed":d===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[d===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:l}),d===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),d===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),d===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),d===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},d)]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(h,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BxjLd7Qd.js";import{n as a}from"./motion-CXaUMNkg.js";import{Dt as o,J as s,Q as c,W as l,Y as u,a as d,bt as f,c as ee,et as p,i as te,n as m,nt as h,o as g,r as _,rt as v,s as ne,tt as re}from"./index-CzDi9JpF.js";import{t as y}from"./EmptyState-1sPNleqv.js";import{a as b,n as x,o as S,r as ie,t as ae}from"./RailCats-BuJD4Jou.js";import{t as C}from"./CopyButton-IXnXzH4Y.js";import{i as w,n as T,r as E}from"./Markdown-DpmmtW2Y.js";var D=e(t(),1),O=n();function k(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function A(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
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 j(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||k(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function M(e){let t={ids:new Set,idx:0,toc:[]},n=n=>j(T(n,e?.links),t);if(e?.rows){let[r,i]=A(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var N=r(),P={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},F=`you already know this`,I=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function L(e){return e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}e.replaceWith(t),t.append(n,e)}),[...e.querySelectorAll(`figure.docs-code > figcaption`)]}var R=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),z=40,B=e=>{let t=e.split(`
|
|
5
|
-
`)[0].trim();return t?`Copy `+(t.length>z?t.slice(0,39)+`…`:t):`Copy code`};function V({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,D.useRef)(null),[o,s]=(0,D.useState)([]),l=(0,D.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),s(L(e)))},[l]),(0,D.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),f(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[l]),(0,D.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=P[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>k(e.textContent||``)===k(i))),o?.classList.add(`docs-here`)},[l,e.id,t?.emit]);let u=[];return e.id===`install`&&(u.push({label:`Run doctor`,action:`doctor`}),u.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&u.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&u.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:u.length>0&&u.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:l}}),o.map((e,t)=>{let n=R(e);return(0,O.createPortal)((0,N.jsx)(C,{text:n,label:B(n)}),e,t)}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var H=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function U({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function W({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:H(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(C,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(U,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(U,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function G({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(W,{cmd:e,prog:t},e.name))})]})}function K({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var q={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},J=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function oe({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,D.useState)(0),{before:s,after:l}=(0,D.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(V,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(J,{text:e.piece})}),(0,N.jsx)(Y,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(J,{text:e.cost})})]})},t))}),u&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(J,{text:u.piece})}),(0,N.jsx)(Y,{kind:u.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.off})})]})]})]}),l.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function se(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ce(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,D.useSyncExternalStore)(ce,e,()=>null),le=5,ue=96,de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Z(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${de(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===le)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,D.useMemo)(()=>Z(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=ue&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(s,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(l,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(V,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,N.jsx)(oe,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,N.jsx)(G,{page:e});case`glossary`:return(0,N.jsx)(K,{page:e});case`about`:return(0,N.jsx)(me,{page:e,overview:n});default:return(0,N.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=se(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=X(ge);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=re(p(t?.emit)),{data:c,error:f}=g(()=>i.docs(r),[r]),h=e||Q(c),{data:y,error:C,loading:w}=g(()=>h?i.docsPage(h,r):Promise.resolve(null),[h,r]),{data:T}=g(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,D.useEffect)(()=>{if(c&&h&&!c.groups.some(e=>e.pages.some(e=>e.id===h))){let e=Q(c);e&&e!==h&&window.location.replace(d(e))}},[c,h]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[h]);let E=v(c,h),O=E.part||c?.groups?.[0]||null,k=O?.id===_;(0,D.useEffect)(()=>{k&&y?.id===h&&ne(h)},[k,y,h]);let A=k?[...ee(),h]:[],[j,M]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(O?.id);O?.id!==I&&(L(O?.id),M(``),F(`all`));let R=$(O),z=x(R),B=P===`all`?R:R.filter(e=>e.group===P),V=S(B,j);return f?(0,N.jsx)(s,{error:f}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(u,{"aria-label":`Harness`,children:o.map(e=>(0,N.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(c?.groups||[]).map(e=>(0,N.jsxs)(D.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:O?.id===e.id?`on`:``,"aria-current":O?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),O?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:R.length,cats:z,cat:P,onChange:F})]},e.id))})]}),(0,N.jsx)(b,{label:O?.label||`Docs`,count:j.trim()?`${V.length} of ${B.length}`:B.length||``,extra:k&&(0,N.jsx)(m,{pages:O.pages,seen:A}),q:j,onQ:M,matched:V.length,inView:[O?.id,h],children:c?(0,N.jsx)(ie,{rows:V,activeName:h,hrefOf:e=>d(e.name),pills:k?e=>A.includes(e.name)&&e.name!==h?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(l,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":E.page?.title||`Page`,children:[(0,N.jsx)(_e,{}),E.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:d(E.part.pages[0].id),children:E.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:d(E.part.pages.find(e=>(e.section||`General`)===E.section).id),children:E.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:E.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(he,{data:w?null:y,error:C,overview:t,onAction:n,place:E},`${h}|${r}`),!w&&(0,N.jsx)(te,{menu:c,pageId:h})]}),!w&&(0,N.jsx)(pe,{page:y,glossaryRows:T?.rows})]})]})]})})}export{ve as default,$ as docRows};
|
|
5
|
+
`)[0].trim();return t?`Copy `+(t.length>z?t.slice(0,39)+`…`:t):`Copy code`};function V({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,D.useRef)(null),[s,c]=(0,D.useState)([]),u=(0,D.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),c(L(e)))},[u]),(0,D.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),o(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[u]),(0,D.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=P[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>k(e.textContent||``)===k(i))),o?.classList.add(`docs-here`)},[u,e.id,t?.emit]);let d=[];return e.id===`install`&&(d.push({label:`Run doctor`,action:`doctor`}),d.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&d.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&d.push({label:`Update`,action:`update`}),(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:d.length>0&&d.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:u}}),s.map((e,t)=>{let n=R(e);return(0,O.createPortal)((0,N.jsx)(C,{text:n,label:B(n)}),e,t)}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var H=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function U({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function W({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:H(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(C,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(U,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(U,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function G({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(W,{cmd:e,prog:t},e.name))})]})}function K({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var q={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},J=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function oe({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,D.useState)(0),{before:s,after:c}=(0,D.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(V,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(J,{text:e.piece})}),(0,N.jsx)(Y,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(J,{text:e.cost})})]})},t))}),u&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(J,{text:u.piece})}),(0,N.jsx)(Y,{kind:u.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.off})})]})]})]}),c.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}})]})}function se(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ce(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,D.useSyncExternalStore)(ce,e,()=>null),le=5,ue=96,de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Z(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${de(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===le)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,D.useMemo)(()=>Z(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=ue&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(l,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(v,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,N.jsx)(s,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(u,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(V,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,N.jsx)(oe,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,N.jsx)(G,{page:e});case`glossary`:return(0,N.jsx)(K,{page:e});case`about`:return(0,N.jsx)(me,{page:e,overview:n});default:return(0,N.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=se(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=X(ge);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=h(re(t?.emit)),{data:o,error:l}=f(()=>i.docs(r),[r]),v=e||Q(o),{data:y,error:C,loading:w}=f(()=>v?i.docsPage(v,r):Promise.resolve(null),[v,r]),{data:T}=f(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,D.useEffect)(()=>{if(o&&v&&!o.groups.some(e=>e.pages.some(e=>e.id===v))){let e=Q(o);e&&e!==v&&window.location.replace(d(e))}},[o,v]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[v]);let E=ne(o,v),O=E.part||o?.groups?.[0]||null,k=O?.id===_;(0,D.useEffect)(()=>{k&&y?.id===v&&g(v)},[k,y,v]);let A=k?[...ee(),v]:[],[j,M]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(O?.id);O?.id!==I&&(L(O?.id),M(``),F(`all`));let R=$(O),z=x(R),B=P===`all`?R:R.filter(e=>e.group===P),V=S(B,j);return l?(0,N.jsx)(s,{error:l}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(c,{"aria-label":`Harness`,children:p.map(e=>(0,N.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(o?.groups||[]).map(e=>(0,N.jsxs)(D.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:O?.id===e.id?`on`:``,"aria-current":O?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),O?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:R.length,cats:z,cat:P,onChange:F})]},e.id))})]}),(0,N.jsx)(b,{label:O?.label||`Docs`,count:j.trim()?`${V.length} of ${B.length}`:B.length||``,extra:k&&(0,N.jsx)(te,{pages:O.pages,seen:A}),q:j,onQ:M,matched:V.length,inView:[O?.id,v],children:o?(0,N.jsx)(ie,{rows:V,activeName:v,hrefOf:e=>d(e.name),pills:k?e=>A.includes(e.name)&&e.name!==v?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(u,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":E.page?.title||`Page`,children:[(0,N.jsx)(_e,{}),E.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:d(E.part.pages[0].id),children:E.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:d(E.part.pages.find(e=>(e.section||`General`)===E.section).id),children:E.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:E.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(he,{data:w?null:y,error:C,overview:t,onAction:n,place:E},`${v}|${r}`),!w&&(0,N.jsx)(m,{menu:o,pageId:v})]}),!w&&(0,N.jsx)(pe,{page:y,glossaryRows:T?.rows})]})]})]})})}export{ve as default,$ as docRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{B as a,F as o,L as s,
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{B as a,F as o,L as s,at as c,rt as l}from"./index-CzDi9JpF.js";import{i as u,n as d,r as f}from"./Dashboard-sCfEjowQ.js";e();var p=t(),m=12,h=Array.from({length:7},(e,t)=>`var(--cat-${t})`),g=650;function _({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let o=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(a,{segments:e,size:t,stroke:r,label:i,sweepMs:g}),(0,p.jsxs)(`div`,{className:`ring-center`,children:[(0,p.jsx)(`div`,{className:`donut-c-num`,children:(0,p.jsx)(n,{value:o,duration:g})}),(0,p.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function v(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function y({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=v(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,p.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,p.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,p.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,p.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function b({label:e,value:t,sub:n,color:r,icon:i}){return(0,p.jsxs)(`div`,{className:`b-tile`,children:[(0,p.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,p.jsx)(l,{name:i})}),(0,p.jsxs)(`div`,{className:`b-tile-body`,children:[(0,p.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,p.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,p.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function x({overview:e,sigil:t,jobs:a,lens:g,onAction:v}){let x=e.counts||{},S=g?.doctor?.state||`loading`,C=g?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=u(e,g?.tone),O=s(a,m),k=c(e.diff),A=i.filter(e=>(x[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:x[e]||0,tone:`cat`+t%h.length,color:h[t%h.length]})),j=A.reduce((e,t)=>e+t.n,0),M=o(a||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`b-greet`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,p.jsx)(`h2`,{className:`h b-h`,children:D}),(0,p.jsx)(d,{verdict:g?.verdict}),(0,p.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,p.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,p.jsxs)(`div`,{className:`card b-hero`,children:[(0,p.jsx)(`div`,{className:`b-hero-ring`,children:(0,p.jsx)(_,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,p.jsxs)(`div`,{className:`b-hero-side`,children:[(0,p.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,p.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>v(`doctor`),children:[(0,p.jsx)(l,{name:`doctor`}),`Run doctor`]}),(0,p.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,p.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,p.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,p.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,p.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,p.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,p.jsxs)(`div`,{className:`b-chips`,children:[(0,p.jsxs)(`span`,{className:`b-chip`,children:[(0,p.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,p.jsx)(`span`,{className:`b-chip`,children:(0,p.jsx)(`b`,{children:e.emit})}),(0,p.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,p.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,p.jsxs)(`div`,{className:`b-tiles`,children:[(0,p.jsx)(b,{label:`Agents`,value:x.agents??`—`,sub:`specialists`,color:h[0],icon:`layers`}),(0,p.jsx)(b,{label:`Skills`,value:x.skills??`—`,sub:`workflows`,color:h[1],icon:`skill`}),(0,p.jsx)(b,{label:`Dictates`,value:x.laws??`—`,sub:x.doctrines?`${x.doctrines.active}/${x.doctrines.total} packs · ${x.doctrines.rules} rules`:`all upheld`,color:h[2],icon:`law`}),(0,p.jsx)(b,{label:`Edits`,value:k,sub:`to graft`,color:h[3],icon:`changes`})]})]}),(0,p.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,p.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Capability mix`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,p.jsxs)(`div`,{className:`b-mix`,children:[(0,p.jsx)(_,{segments:A,size:186,stroke:26}),(0,p.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,p.jsxs)(`div`,{className:`b-leg-row`,children:[(0,p.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,p.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,p.jsx)(`span`,{className:`b-leg-bar`,children:(0,p.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,p.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent runs`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`badge ok`,children:[(0,p.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,p.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,p.jsx)(`span`,{className:`b-stat-big`,children:(0,p.jsx)(n,{value:N})}),(0,p.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,p.jsx)(y,{data:M,accent:h[0],height:156})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent activity`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,p.jsx)(f,{jobs:a,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{n as i}from"./motion-CXaUMNkg.js";import{$ as a,Ct as o,Et as s,J as c,Q as l,St as u,W as d,X as f,Y as p,Z as m,_t as h,at as g,bt as _,ct as v,dt as y,ft as b,gt as x,ht as S,it as C,mt as w,pt as T,rt as E,ut as D,vt as O,wt as k,xt as A,yt as j,z as M}from"./index-CzDi9JpF.js";import{t as N}from"./EmptyState-1sPNleqv.js";import{t as P}from"./Tabs-CIPyMAX-.js";import{c as F,i as I,l as L,n as R,o as z,s as ee,t as te}from"./KitApply-CQQbnThf.js";var B=e(t(),1),V=n();function ne({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,B.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,B.useState)(!1),[d,f]=(0,B.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}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()};return(0,V.jsxs)(`div`,{className:`deploy-pop`,children:[(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,V.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,V.jsxs)(`div`,{className:`dp-row`,children:[(0,V.jsxs)(`label`,{className:`dp-field`,children:[(0,V.jsx)(`span`,{children:`Deploy as`}),(0,V.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:w.map(e=>(0,V.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,V.jsx)(F,{value:s,options:n,onChange:p,who:`the new harness`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,V.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,V.jsx)(`code`,{children:S(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function re(){let{data:e,error:t,reload:n}=_(()=>r.excludes(),[]),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,V.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,V.jsx)(`div`,{className:`card-head`,children:(0,V.jsx)(`h3`,{children:`Excluded folders`})}),(0,V.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsx)(`code`,{children:e.path}),(0,V.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>S(e).label).join(`, `)}),(0,V.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,V.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,V.jsx)(E,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,V.jsx)(`p`,{className:`sub`,children:e},t))]})}function ie({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,V.jsxs)(`div`,{className:`ip-block`,children:[(0,V.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,V.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,V.jsxs)(`div`,{className:`mcp-target`,children:[(0,V.jsxs)(`div`,{className:`mt-head`,children:[(0,V.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,V.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,V.jsxs)(`div`,{className:`mcp-row`,children:[(0,V.jsx)(`span`,{className:`mono`,children:e.name}),(0,V.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,V.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,V.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,V.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ae({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${S(e.host).label} · ${e.scope}`,[h,g]=H[e.state]||H.absent,_=e.state===`active`,v=e.state===`absent`;return(0,V.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,V.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,V.jsxs)(`div`,{className:`ip-head`,children:[(0,V.jsx)(`h2`,{children:x(e)}),(0,V.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,V.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${S(e.host).label}`}),(0,V.jsx)(`code`,{className:`ip-path`,children:e.path}),v?(0,V.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,V.jsx)(`strong`,{children:S(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(_||v)&&o?(0,V.jsx)(`div`,{className:`ip-picks`,children:(0,V.jsx)(F,{value:n,options:i,onChange:a,who:m})}):null,_&&t.length?(0,V.jsx)(ie,{targets:t,onReveal:p}):null,_&&e.scope===`global`?(0,V.jsx)(re,{}):null,v?null:(0,V.jsxs)(`label`,{className:`ip-switch`,children:[(0,V.jsx)(L,{on:_,disabled:s,label:`activate ${m}`,onToggle:d}),(0,V.jsx)(`span`,{children:_?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,V.jsx)(`div`,{className:`ip-spacer`}),o?(0,V.jsxs)(`div`,{className:`ip-actions`,children:[v?(0,V.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):_?(0,V.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,v?null:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`field`,children:[(0,V.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,V.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,V.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,V.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,V.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,V.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var oe=(e,t)=>`${e} ${t}`,se=[`claude`,`bob`,`openclaude`],U={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},W=/[\\/]\.claude[\\/]worktrees[\\/]/,G=e=>e.scope===`project`&&W.test(e.path);function ce(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?g(e.drift):0;return i?`${r} · ${i} edited`:r}function le({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,V.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,V.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?g(t.drift):0;return(0,V.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,V.jsx)(M,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,V.jsx)(`span`,{className:`dim`,children:ce(t,n)}),t.diffable?null:(0,V.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ue({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,V.jsx)(`div`,{className:`tbl-scroll`,children:(0,V.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,V.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,V.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,V.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,V.jsx)(`th`,{scope:`col`,children:`State`}),(0,V.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,V.jsx)(`th`,{scope:`col`,children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,V.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=U[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,V.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,V.jsx)(`td`,{children:S(e.host).label}):(0,V.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,V.jsx)(`td`,{children:u?``:e.theme||``}),(0,V.jsx)(`td`,{children:u?``:e.footprint||``}),(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`tag ${c}`,children:i}),G(e)?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`tag warn`,title:`Inside a .claude/worktrees folder: likely a finished worktree. Remove it from its panel.`,children:`Worktree leftover`})]}):null]}),(0,V.jsx)(`td`,{children:(0,V.jsx)(le,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,V.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function de({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,V.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,V.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,V.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,V.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,V.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function fe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,V.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,V.jsxs)(`div`,{className:`panel-head`,children:[(0,V.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,V.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,V.jsxs)(`dl`,{className:`kv-grid`,children:[(0,V.jsx)(`dt`,{children:`Source`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.root}),(0,V.jsx)(`dt`,{children:`Version`}),(0,V.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,V.jsx)(`dt`,{children:`Fingerprint`}),(0,V.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function K({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:l}){let u=a(),{data:d,error:f,reload:m}=_(()=>r.installs(),[s]),{data:h,error:g,reload:v}=_(()=>r.mcp(),[s]),{data:b,error:C}=_(()=>r.fleet(),[s]),w=C?null:b??void 0,[T,O]=(0,B.useState)(null),[k,A]=(0,B.useState)(``),[M,P]=(0,B.useState)({}),[F,I]=(0,B.useState)(!1),[L,R]=(0,B.useState)({id:``,value:`keep`}),z=e=>L.id===e?.id?L.value:`keep`,[te,re]=(0,B.useState)(()=>y(`hosts`)),ie=(0,B.useMemo)(()=>{let e={};for(let t of h?.targets||[]){let n=oe(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[h]);if(f||g)return(0,V.jsx)(c,{error:f||g,onRetry:()=>{m(),v()}});if(!d||!h)return(0,V.jsx)(p,{});let H={active:0,disabled:1,absent:2},U=[...d.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(H[e.state]??3)-(H[t.state]??3)),W=U.find(e=>e.id===te)||U.find(e=>e.default)||U.find(e=>e.state===`active`)||U[0],G=e=>{let t=M[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},ce=(e,t,n)=>P(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),le=e=>{let t=G(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},K={theme:t.map(e=>e.name),footprint:ee,posture:d.postures||[],mode:d.modes||[],trust:d.trusts||[]},pe=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=G(t),s=S(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,l=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await u(l,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},me=async e=>{if(e.state!==`active`||await u(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){A(e.id),O(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;O({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},q=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&se.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},he=async e=>{let t=z(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${q(e,`memory`)} and ${q(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await u(`Uninstall ${S(e.host).label} · ${e.scope}? It deletes ${j(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){A(e.id),O(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){O({text:n.error||`remove failed`,tone:`bad`});return}R({id:``,value:`keep`}),n.kept?.length&&O({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),l?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},ge=async e=>{O(null);try{let t=await r.mcpReveal(e.path);O({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){O({text:e.message,tone:`bad`})}},J=async()=>{let t=U.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await u(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},_e=U.find(e=>e.default)?.host||U.find(e=>e.state===`active`)?.host||U[0]?.host||`opencode`,ve=U.filter(e=>e.scope===`global`),Y=U.filter(e=>e.scope!==`global`),X=e=>{re(e)},Z=e=>{D(`edits`,e.id),window.location.hash=`#/installs/edits`};return(0,V.jsxs)(`div`,{className:`hosts`,children:[(0,V.jsxs)(`div`,{className:`hosts-main`,children:[(0,V.jsxs)(`div`,{className:`toolbar`,children:[(0,V.jsxs)(`span`,{className:`dim`,children:[U.filter(e=>e.state===`active`).length,` active of `,U.length,` `,`detected.`]}),e?(0,V.jsx)(`div`,{className:`row gap-8`,children:(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:J,children:[(0,V.jsx)(E,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,V.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,V.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.text}):null,(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,V.jsx)(`div`,{className:`inst-head`,children:(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,V.jsx)(ue,{rows:ve,currentId:W?.id,onPick:X,label:`Global installs`,fleet:w,onEdits:Z})]}),(0,V.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,V.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,V.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>I(e=>!e),children:[(0,V.jsx)(E,{name:`folder`}),` Deploy to a repo…`]}):null]}),F?(0,V.jsx)(`div`,{className:`inst-deploy`,children:(0,V.jsx)(ne,{host:_e,theme:n||`neutral`,options:K,onAction:e,onClose:()=>I(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Y.length?(0,V.jsx)(ue,{rows:Y,project:!0,currentId:W?.id,onPick:X,label:`Per-project installs`,fleet:w,onEdits:Z}):(0,V.jsx)(N,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,V.jsx)(fe,{setup:o,overview:i}),(0,V.jsx)(de,{themes:t,current:i?.theme})]}),W?(0,V.jsx)(ae,{inst:W,targets:ie[oe(W.host,W.path)]||[],choice:G(W),unchanged:le(W),options:K,onPick:(e,t)=>ce(W,e,t),canAct:!!e,busy:k===W.id,memory:z(W),onMemory:e=>R({id:W.id,value:e}),onApply:()=>pe(W),onToggleInstall:()=>me(W),onRemove:()=>he(W),onRevealMcp:ge},W.id):null]})}function pe({onAction:e,dataRev:t}){let{data:n,error:i}=_(()=>r.kits(),[t]),a=z(n,e);return i||n?.error?(0,V.jsx)(c,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,V.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=I(e),r=a.setOf(e),i=`${e.host} · ${e.scope}`;return(0,V.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,V.jsxs)(`div`,{className:`inst-head`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{children:i}),(0,V.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,V.jsx)(R,{row:e})]}),t&&(0,V.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,V.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,V.jsxs)(`li`,{className:`kit-row`,children:[(0,V.jsxs)(`div`,{className:`kit-main`,children:[(0,V.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,V.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,V.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,V.jsx)(L,{on:r.has(n.name),disabled:t||a.running(e),label:`${n.name} for ${i}`,onToggle:()=>a.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,V.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,V.jsx)(te,{row:e,stage:a})]},e.id)})}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,V.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,V.jsx)(p,{})}function me(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var q=300;function he(e){let t=T(e.dataRev),[n,r]=b(`edits`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Local edits of:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ge,{install:n,...e},n?.id||``)]})}function ge({install:e,onMutated:t,onAction:n,dataRev:i,overview:o}){let s=a(),{data:l,error:u,reload:d}=_(()=>r.diff(O(e)),[i]),[f,m]=(0,B.useState)(!1),[h,g]=(0,B.useState)(``),[v,y]=(0,B.useState)(()=>new Set),[b,x]=(0,B.useState)(()=>new Set),[S,C]=(0,B.useState)(null);if(l&&l!==S){C(l),y(new Set);let e=l.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=q?l.files.map(e=>e.rel):[]))}let w=e=>y(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>y(e=>e.size===A.length?new Set:new Set(A.map(e=>e.rel))),D=()=>n?.(`export`),k=async()=>{let n=[...v],i=n.filter(e=>l.files.find(t=>t.rel===e)?.status===`added`),a=i.length?`Restoring will DELETE ${i.length} deployed-only file(s):\n${i.join(`
|
|
2
|
+
`)}\n\n`:``;if(await s(`${a}Discard local edits and restore ${n.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let i=await r.restore(n,O(e)),a=i.errors.length?` · ${i.errors.length} error(s): ${i.errors.join(`; `)}`:``;g(`Restored ${i.restored.length}, archived ${i.deleted.length}${a}`),await d(),t?.()}catch(e){g(e.message)}finally{m(!1)}}};if(u)return(0,V.jsx)(c,{error:u,onRetry:d});if(!l)return(0,V.jsx)(p,{});if(!l.deployed)return(0,V.jsx)(N,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!l.diffable)return(0,V.jsx)(N,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`See every install in Hosts`},children:`The drift check covers global installs only. Pick a global install above.`});let A=l.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),j=l.files.filter(e=>e.status===`linked`),M=l.files.filter(e=>e.status===`stale`),P=A.filter(e=>e.status===`edited`).length,F=A.filter(e=>e.status===`added`).length,I=A.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Local edits`}),l.target?(0,V.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,V.jsx)(`code`,{children:l.target}),l.theme?` (${l.theme} voice)`:``,` with source`,` `,o?.version||`unknown`,`.`]}):null,P>0?(0,V.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):F+I>0?(0,V.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:f||v.size===0,onClick:k,children:[`Restore`,v.size?` (${v.size})`:``]}),(0,V.jsxs)(`button`,{className:`btn`,disabled:f,onClick:D,children:[(0,V.jsx)(E,{name:`download`}),`Export improvements`]})]})]}),h?(0,V.jsx)(`p`,{className:`sub mb-14`,children:h}):null,j.length?(0,V.jsxs)(`p`,{className:`sub dim mb-14`,title:j.map(e=>e.rel).join(`
|
|
3
|
+
`),children:[j.length,` linked — yours, left alone`]}):null,A.length===0&&M.length===0?(0,V.jsx)(N,{title:`In sync`,children:`Deployed harness matches source.`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`row between mb-14`,children:[(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsxs)(`span`,{className:`badge warn`,children:[(0,V.jsx)(`span`,{className:`dot`}),P,` edited`]}),(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),F,` added`]}),I>0&&(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),I,` missing`]}),M.length>0&&(0,V.jsxs)(`span`,{className:`badge`,children:[(0,V.jsx)(`span`,{className:`dot`}),M.length,` behind`]})]}),(0,V.jsxs)(`div`,{className:`row gap-10`,children:[(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(l.files.map(e=>e.rel))),children:`Expand all`}),(0,V.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),A.length?(0,V.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:v.size===A.length,onChange:T}),`Select all`]}):null]})]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:A.map(e=>R(e,!0))}),M.length?(0,V.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,V.jsx)(`h3`,{children:`Behind source`}),(0,V.jsxs)(`div`,{className:`row between`,children:[(0,V.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,V.jsx)(`button`,{className:`btn ghost`,disabled:f,onClick:()=>n?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),M.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=b.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,V.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,V.jsxs)(`div`,{className:`diff-head`,children:[t?(0,V.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:v.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,V.jsx)(`span`,{className:`fname`,children:e.rel}),(0,V.jsxs)(`span`,{className:`badge ${r}`,children:[(0,V.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,V.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,V.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,V.jsx)(E,{name:`chevron`})})]}),n&&(0,V.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,V.jsx)(`div`,{className:`diff-line ${me(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,B.useState)(!n);return(0,V.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,V.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,V.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,V.jsx)(`h3`,{children:e.label}),(0,V.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,V.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,V.jsx)(E,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,V.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,V.jsxs)(`div`,{className:`problem`,children:[(0,V.jsx)(`span`,{className:`x`,children:`✕`}),(0,V.jsx)(`span`,{children:e})]},e))})]})}function _e({dataRev:e}){let t=T(e),[n,r]=b(`doctor`,t);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(f,{className:`page-pick`,installs:t,value:n,onChange:r,label:`Doctor for:`}),t===null?(0,V.jsx)(p,{}):(0,V.jsx)(ve,{install:n,dataRev:e},n?.id||``)]})}function ve({install:e,dataRev:t}){let n=(0,B.useRef)(!1),{data:i,error:a,reload:o,setData:s}=_(()=>{let t=n.current;return n.current=!1,r.doctor(t,O(e))},[t]),l=()=>{n.current=!0,s(null),o()};if(a)return(0,V.jsx)(c,{error:a,onRetry:o});let u=i?i.groups.filter(e=>e.problems.length):[],d=i?i.groups.filter(e=>!e.problems.length):[];return(0,V.jsxs)(`div`,{className:`page-fill`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,V.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,V.jsxs)(`button`,{className:`btn`,onClick:l,disabled:!i,children:[(0,V.jsx)(E,{name:`refresh`}),i?`Re-run checks`:`Running…`]})]}),i?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,V.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`span`,{className:`dim mono`,children:[`validated `,i.themes.length,` theme`,i.themes.length===1?``:`s`]}),i.checked_at?(0,V.jsxs)(`span`,{className:`dim mono`,title:i.checked_at,children:[`checked `,i.checked_at.slice(11)]}):null,i.themes.map(e=>(0,V.jsx)(`span`,{className:`badge cap`,children:e},e))]}),i.ok?(0,V.jsxs)(`span`,{className:`badge ok`,children:[(0,V.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,V.jsxs)(`span`,{className:`badge bad`,children:[(0,V.jsx)(`span`,{className:`dot`}),i.problems.length,` problem`,i.problems.length===1?``:`s`]})]})}),(0,V.jsxs)(`div`,{className:`stack gap-12`,children:[u.map((e,t)=>(0,V.jsx)(J,{group:e,i:t},e.label)),d.length?(0,V.jsxs)(`details`,{className:`check-fold`,children:[(0,V.jsxs)(`summary`,{children:[d.length,` clean check`,d.length===1?``:`s`]}),(0,V.jsx)(`div`,{className:`stack gap-12`,children:d.map((e,t)=>(0,V.jsx)(J,{group:e,i:u.length+t},e.label))})]}):null]})]}):(0,V.jsx)(p,{label:`Running every check (builds each theme in a sandbox)…`})]})}function Y(){let e=a(),[t,n]=(0,B.useState)(!1),[i,o]=(0,B.useState)(null);return t?(0,V.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,V.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:i}),(0,V.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){o(null);try{await r.shutdown()}catch(e){if(e.status)return o(e.message)}n(!0)}},children:[(0,V.jsx)(E,{name:`x`}),`Stop server`]})]})}function X(){let e=a(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(c,{error:r}),(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await o()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,V.jsx)(E,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Z=`https://github.com/Arylmera/Geneseed`,ye=`https://github.com/Arylmera`,be=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],xe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function Q({k:e,help:t,children:n,control:r}){return(0,V.jsxs)(`div`,{className:`sheet-row`,children:[(0,V.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,V.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,V.jsx)(`div`,{className:`sheet-v`,children:n}),(0,V.jsx)(`div`,{className:`sheet-c`,children:r})]})}function $({id:e,title:t,head:n,className:r=``,children:i}){return(0,V.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Se({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,V.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:be.map(([n,r])=>(0,V.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,V.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function Ce({version:e}){let[t,n]=(0,B.useState)(Z),[i,a]=(0,B.useState)(!0);(0,B.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,V.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,V.jsx)(E,{name:`external`})]});return(0,V.jsxs)($,{id:`about`,title:`About`,children:[(0,V.jsx)(Q,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,V.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,V.jsx)(Q,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,V.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,V.jsx)(Q,{k:`Geneseed`,help:`MIT-licensed`,control:(0,V.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`Issues`]}),(0,V.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`external`}),`MIT License`]})]})]}),children:(0,V.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,V.jsx)(Q,{k:`Creator`,control:(0,V.jsxs)(`a`,{className:`btn ghost`,href:ye,target:`_blank`,rel:`noreferrer`,children:[(0,V.jsx)(E,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,V.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function we({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:o,onAccentMode:c,layout:d,onLayout:p,dataRev:h}){let g=a(),_=T(h),[y,C]=b(`server`,_),w=y?.footprint,D=e?.server,O=e?.daemon_stale,[j,M]=(0,B.useState)(null);(0,B.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>M(e||null)).catch(()=>{})},[]);let N=j?j.install??(j.git?`git`:`npm-global`):null,P=N===`git`?`Update (git pull + rebuild)`:N===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,F=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await g(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},I=D?.autostart===!0?`On · login script`:D?.autostart===!1?`Off`:`unknown`;return(0,V.jsxs)(`div`,{className:`narrow-lg`,children:[(0,V.jsxs)(`div`,{className:`head-row mb-18`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h2`,{className:`h`,children:s.server}),(0,V.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]}),(0,V.jsx)(f,{installs:_,value:y,onChange:C,label:`Footprint of:`})]}),(0,V.jsxs)(`div`,{className:`sheet`,children:[(0,V.jsx)(Se,{stale:O}),(0,V.jsxs)(`div`,{className:`sheet-body`,children:[(0,V.jsxs)($,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-skin-label`,children:k.map(e=>(0,V.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>i(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:k.find(e=>e.id===n)?.tagline??``})]}),o&&c&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,V.jsx)(m,{value:o,onChange:c,labelledBy:`dir-accent-label`}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:u(o)})]}),d&&p&&(0,V.jsxs)(Q,{k:(0,V.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,V.jsx)(l,{"aria-labelledby":`dir-layout-label`,children:A.map(e=>(0,V.jsx)(`button`,{className:d===e.id?`on`:``,onClick:()=>p(e.id),"aria-pressed":d===e.id,title:e.tagline,children:e.short},e.id))}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:A.find(e=>e.id===d)?.tagline??``})]})]}),(0,V.jsxs)($,{id:`machine`,title:`Machine`,children:[(0,V.jsx)(Q,{k:`Geneseed`,help:`This copy of the source`,control:N===`other`?j.command?(0,V.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,V.jsx)(`code`,{className:`mono`,children:j.command})]}):null:(0,V.jsxs)(`button`,{className:`btn`,onClick:F,children:[(0,V.jsx)(E,{name:`download`}),P]}),children:(0,V.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,V.jsx)(Q,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,V.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,V.jsx)(E,{name:`external`}),`Add to PATH`]})}),y&&w&&(0,V.jsxs)(Q,{k:`Harness footprint`,help:(0,V.jsxs)(V.Fragment,{children:[`For `,S(y.host).label,` · `,y.scope,`; every Rule stays in force.`,` `,(0,V.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,V.jsx)(`span`,{className:`mono`,children:w}),(0,V.jsx)(`span`,{className:`dir-layout-note sub`,children:w===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,V.jsxs)($,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`pill good`,children:`running`}),(0,V.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,D?` · pid ${D.pid} · up ${v(D.started)}`:``]})]}),children:[(0,V.jsx)(Q,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,V.jsx)(X,{}),children:O?(0,V.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,V.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,V.jsx)(Q,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,V.jsx)(`span`,{className:`sub`,children:I})}),(0,V.jsx)(Q,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,V.jsx)(`span`,{className:`row wrap gap-8`,children:xe.map(e=>(0,V.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,V.jsx)(Ce,{version:e?.version}),(0,V.jsxs)($,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,V.jsx)(Q,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,V.jsx)(Y,{})}),(0,V.jsx)(Q,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,V.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,V.jsx)(Q,{k:`Uninstall a harness`,children:(0,V.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,V.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function Te({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:s={}}){let c=t?.doctor,l=t?.diff,u=T(o),f=u?.length>1?h(u[0]):null,p=e=>e==null||!f?e:{v:e,of:f},m={edits:p(l?C(l):null),doctor:p(c?c.ok?`clean`:c.problems.length:null)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,V.jsx)(P,{page:`installs`,current:e,badges:m,label:`Installs`}),e===`hosts`&&(0,V.jsx)(K,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,V.jsx)(pe,{onAction:i,dataRev:o}),e===`edits`&&(0,V.jsx)(he,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,V.jsx)(_e,{dataRev:o}),e===`server`&&(0,V.jsx)(we,{overview:t,onAction:i,dataRev:o,...s})]})}export{Te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-LvBC0CnK.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{Ct as j,S as M,St as N,bt as P,dt as F,ft as I,pt as L,wt as R}from"./index-DhNNxhfg.js";import{n as z}from"./Dashboard-DkUm4XMu.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=R(this,p(e,l,t,null,this));V(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,R(this,a),e)}}else V(e,this,R(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=R(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>P(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),P(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=L(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=N(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:j(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:j(70)},260).add(a,{opacity:1,duration:300,delay:j(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:j(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=I(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:j(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:M(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:M(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:I(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>P(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>P(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:F(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${F(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>P(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>P(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BxjLd7Qd.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{At as j,Dt as M,S as N,bt as P,ct as F,jt as I,kt as L,lt as R}from"./index-CzDi9JpF.js";import{n as z}from"./Dashboard-sCfEjowQ.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=I(this,p(e,l,t,null,this));V(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,I(this,a),e)}}else V(e,this,I(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=I(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>M(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),M(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=P(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:j(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:j(70)},260).add(a,{opacity:1,duration:300,delay:j(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:j(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=R(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:j(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:N(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:N(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:R(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>M(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>M(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:F(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${F(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>M(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>M(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{$ as r,G as i,K as a}from"./index-CzDi9JpF.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=r(),s=a(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
|