geneseed 4.24.0 → 4.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/SHIPPED.md +1 -1
  3. package/harness.config.json +1 -1
  4. package/package.json +1 -1
  5. package/web/dist/assets/{Activity-DvmB7N8g.js → Activity-BcwX4Zj2.js} +1 -1
  6. package/web/dist/assets/{ActivityDetail-Bd1ul_B-.js → ActivityDetail-CDD7EM_5.js} +1 -1
  7. package/web/dist/assets/{CopyButton-BnPdDHls.js → CopyButton-BHxw2k1Z.js} +1 -1
  8. package/web/dist/assets/{Dashboard-DtJ0xrcA.js → Dashboard-DmKR3TQg.js} +2 -2
  9. package/web/dist/assets/{Docs-Bt9FAScn.js → Docs-CuwD_7Yq.js} +1 -1
  10. package/web/dist/assets/{GreenhouseView-BBCsUAcJ.js → GreenhouseView-50jF3dvM.js} +1 -1
  11. package/web/dist/assets/{Installs-BHxWO-Ev.js → Installs-DlxyaW98.js} +1 -1
  12. package/web/dist/assets/{JournalView-CLf3j4Ar.js → JournalView-DhjSU8nT.js} +1 -1
  13. package/web/dist/assets/{KitApply-BaDKgnO8.js → KitApply-DvryZjTL.js} +1 -1
  14. package/web/dist/assets/{Kits-DmqZkK4K.js → Kits-Dl-wrVqw.js} +1 -1
  15. package/web/dist/assets/{Laws-BcUWCQvl.js → Laws-BD3DVthD.js} +1 -1
  16. package/web/dist/assets/{Library-CuRHfeqT.js → Library-dMx4l6kg.js} +1 -1
  17. package/web/dist/assets/{Loops-D7VflI8x.js → Loops-BfoE72d9.js} +1 -1
  18. package/web/dist/assets/{OperatorHudView-BxKeM_Lk.js → OperatorHudView-DJ_Wb0on.js} +1 -1
  19. package/web/dist/assets/{Personal-Bpl90lqc.js → Personal-Be0vEjUH.js} +1 -1
  20. package/web/dist/assets/{Tabs-kIqas9Tj.js → Tabs-D1tN4jA9.js} +1 -1
  21. package/web/dist/assets/{index-UNxZecs3.js → index-BUdl0KdD.js} +2 -2
  22. package/web/dist/assets/index-BVxqp3vf.css +1 -0
  23. package/web/dist/index.html +2 -2
  24. package/web/dist/assets/index-IuDNqPEl.css +0 -1
package/CHANGELOG.md CHANGED
@@ -8,10 +8,17 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [4.24.1] — 2026-10-25
12
+
13
+ Patch: pages use the whole window width.
14
+
11
15
  ## [4.24.0] — 2026-10-25
12
16
 
13
17
  Minor: wave V7 — the audit's open findings: server hardening (generic 500s, one folder dialog, safe Reveal, 404 for missing assets), retired rules in a never-loaded file, a service worker that caches real assets only, confirms before Update and Rebuild all, an accessibility pass and a design pass; plus memory topics and run chips.
14
18
 
19
+ ### Fixed
20
+ - **Pages use the whole window**: no content width cap and a gutter that scales with the window, so wide screens lose their empty sides and the Installs table no longer scrolls beside its panel.
21
+
15
22
  ### Fixed
16
23
  - **Accessibility**: Genome cells are links; loop rings are labelled groups with no dead tab stops; off-pack rule rows keep full contrast and an unclipped focus ring; the command palette shows focus; accent and chart colours use text tokens in every mode; touch targets reach 44 px on coarse pointers; the docs outline moves focus; docs pages, Copy buttons and status hints have real names; a blocked session is announced.
17
24
  - **Console design pass**: voice accent dots removed (they promised a tint that never applied); a skin change resets a custom accent; Update is labelled by install kind; the Settings footprint is read-only with a link to Hosts; Docs article first, constitution map and loop flows legible on phones; Activity panels fold to one column; dead CSS removed.
package/SHIPPED.md CHANGED
@@ -20,7 +20,7 @@ historical references, not files distributed with the repo.
20
20
  > **On version numbers.** [`harness.config.json`](harness.config.json)'s `version` is a
21
21
  > human-readable label only. The canonical identity of an installed harness is the
22
22
  > **source fingerprint** stamped in `.geneseed-version` (see `geneseed version`), not the
23
- > string. Current label: **4.24.0**.
23
+ > string. Current label: **4.24.1**.
24
24
 
25
25
  ## Capabilities
26
26
 
@@ -2,5 +2,5 @@
2
2
  "_comment": "version is a human-readable release label only; the canonical identity of an installed harness is the source fingerprint stamped in .geneseed-version (see `harness version`), not this string.",
3
3
  "theme": "neutral",
4
4
  "product": "Geneseed",
5
- "version": "4.24.0"
5
+ "version": "4.24.1"
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "Every field here is argued and gated in tests/unit/package_manifest.test.mjs. `files`, `bin` and `engines` each have a test that fails when reality drifts from this file; `version` mirrors harness.config.json and is gated too. Read that docblock before editing this one.",
3
3
  "name": "geneseed",
4
- "version": "4.24.0",
4
+ "version": "4.24.1",
5
5
  "description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
6
6
  "keywords": [
7
7
  "ai",
@@ -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-BfpZmUMI.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,E as s,F as c,J as l,M as u,N as d,O as ee,T as f,U as te,at as p,ft as m,j as h,k as g,q as ne,u as _,ut as v,w as y}from"./index-UNxZecs3.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{t as re}from"./usePoll-bDFN-Hr6.js";var x=e(t(),1),S=n(),C=e=>e.catch(()=>null);function w({s:e}){let t=(0,x.useId)(),n=e.todos,r=g(e);return(0,S.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,S.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,S.jsx)(p,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,S.jsx)(`div`,{className:`act-foot`,children:(0,S.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,S.jsx)(f,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,S.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,v(e.updated_at),` ago`]})]})}var T={blocked:`is blocked`,"waiting-input":`waits for your answer`};function E(e,t){if(!Array.isArray(t))return``;let n=t.filter(a),r=e.current;return e.current=new Set(n.map(e=>`${e.session_id}:${e.status}`)),r?n.filter(e=>!r.has(`${e.session_id}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${T[e.status]}`).join(`. `):``}var D=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function O(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:D.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function k(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),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 A({enabled:e,onToggle:t}){return(0,S.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,S.jsx)(p,{name:`activity`,className:`glyph act-fixed`}),(0,S.jsxs)(`div`,{className:`act-grow`,children:[(0,S.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,S.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,S.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,S.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,S.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function j({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=h(e?.jobs,{days:14,cap:n}),i=d(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 ${u(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${u(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,S.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,S.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,S.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,S.jsx)(`i`,{className:`zero`},e.key))}),(0,S.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,S.jsx)(`span`,{children:u(r[0].key)}),(0,S.jsx)(`span`,{children:u(r[7].key)}),(0,S.jsx)(`span`,{children:`today`})]}),c&&(0,S.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function M({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,S.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,S.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,S.jsx)(y,{vals:e.per_day,i:t,sweep:!0}),(0,S.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var N={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ie({job:e,longest:t}){let n=c(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=N[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,S.jsxs)(`li`,{className:`act-row`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,S.jsx)(p,{name:`play`,className:`glyph act-glyph`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,S.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,S.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,S.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,S.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function ae({gate:e}){return(0,S.jsxs)(`li`,{className:`act-row gate`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,S.jsx)(p,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,S.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,S.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,S.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var P=5,F=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function I(){let[e,t]=(0,x.useState)(null),[n,o]=(0,x.useState)(``),[c,u]=(0,x.useState)(O),[f,p]=(0,x.useState)(!1),[h,g]=(0,x.useState)(``),v=(0,x.useRef)(null),y=e=>{let t={...c,...e};u(t),k(t)};re(e=>r.activity().then(n=>{if(e()){t(n),o(``);let e=E(v,n?.activity);e&&g(t=>t===e?e+`\xA0`:e)}},t=>{e()&&o(t.message)}),2e3,[]);let T=m(()=>C(r.jobs()),[]),N=m(()=>C(r.gates()),[]),I=m(()=>C(r.catalog(`laws`)),[]),L=!e||e.enabled!==!1,R=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),z=i(),B=L&&e?R.filter(a).length:null,V=new Set(R.map(e=>e.session_id)),H=(e?.ended||[]).filter(e=>!V.has(e.session_id)),U=F([...R,...H].map(e=>e.host),c.host),W=F([...R,...H].map(e=>s(e.cwd)),c.project),G=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,K=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),q=R.filter(e=>K(e)&&(c.f!==`needs`||a(e))),oe=c.f===`all`||c.f===`needs`,J=c.f===`all`&&L?H.filter(K):[],se=f?J:J.slice(0,P),ce=!G&&(c.f===`all`||c.f===`runs`),le=!G&&(c.f===`all`||c.f===`gates`),Y=T.data?.jobs||[],X=_(N.data,I.data),Z=ee(Y,X,N.data?.days).map(e=>({...e,runs:ce?e.runs:[],gate:le?e.gate:null})).filter(e=>e.runs.length||e.gate),ue=Math.max(0,...Y.map(e=>e.duration||0)),Q=d(Z.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),de=async()=>{let e=!L;try{let n=await r.activityToggle(e);if(n.ok===!1){o(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),o(``)}catch(e){o(e.message)}},$=(e,t,n)=>(0,S.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,S.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,S.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:c[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,S.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))]})]});return(0,S.jsxs)(`div`,{className:`narrow`,children:[(0,S.jsx)(te,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,S.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:h}),n&&(0,S.jsx)(`div`,{className:`act-gap`,children:(0,S.jsx)(ne,{error:n})}),e&&(0,S.jsx)(A,{enabled:L,onToggle:de}),(0,S.jsxs)(`div`,{className:`act-today`,children:[(0,S.jsx)(j,{jobs:T.data,loading:T.loading}),(0,S.jsx)(M,{rows:X,gates:N.data,loading:N.loading}),(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,S.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,S.jsxs)(`span`,{className:`act-big act-wait`,children:[B??`—`,` `,(0,S.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,S.jsx)(`p`,{className:`dim act-sm`,children:L?`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,S.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,S.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:D.map(([e,t])=>(0,S.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&B>0?(0,S.jsxs)(`span`,{className:`mono`,children:[` `,B]}):null]},e))}),$(`host`,`Host`,U),$(`project`,`Project`,W)]}),G&&c.f!==`needs`&&(0,S.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,G,`; showing sessions only.`]}),oe&&(e?!L&&c.f!==`needs`?null:q.length===0?c.f===`needs`?(0,S.jsx)(b,{title:`Nothing waits on you`}):(0,S.jsxs)(b,{title:`No active sessions`,children:[`Run `,(0,S.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,S.jsx)(`div`,{className:`stack gap-12 act-live`,ref:z,children:q.map(e=>(0,S.jsx)(`div`,{"data-flip":e.session_id,children:(0,S.jsx)(w,{s:e})},e.session_id))}):(0,S.jsx)(l,{label:`Reading live sessions…`})),J.length>0&&(0,S.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,S.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),se.map(e=>(0,S.jsx)(`div`,{children:(0,S.jsx)(w,{s:e})},e.session_id)),J.length>P&&(0,S.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":f,onClick:()=>p(e=>!e),children:f?`Show fewer`:`Show all ${J.length}`})]}),c.f!==`needs`&&(0,S.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Q,children:Z.map(e=>(0,S.jsxs)(`section`,{className:`card act-day`,children:[(0,S.jsxs)(`h3`,{className:`act-day-h`,children:[(0,S.jsx)(`span`,{children:e.title}),(0,S.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,S.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,S.jsx)(ie,{job:e,longest:ue},e.id)),e.gate&&(0,S.jsx)(ae,{gate:e.gate})]})]},e.key))})]})}export{I 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-BfpZmUMI.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,E as s,F as c,J as l,M as u,N as d,O as ee,T as f,U as te,at as p,ft as m,j as h,k as g,q as ne,u as _,ut as v,w as y}from"./index-BUdl0KdD.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{t as re}from"./usePoll-bDFN-Hr6.js";var x=e(t(),1),S=n(),C=e=>e.catch(()=>null);function w({s:e}){let t=(0,x.useId)(),n=e.todos,r=g(e);return(0,S.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,S.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,S.jsx)(p,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,S.jsx)(`div`,{className:`act-foot`,children:(0,S.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,S.jsx)(f,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,S.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,v(e.updated_at),` ago`]})]})}var T={blocked:`is blocked`,"waiting-input":`waits for your answer`};function E(e,t){if(!Array.isArray(t))return``;let n=t.filter(a),r=e.current;return e.current=new Set(n.map(e=>`${e.session_id}:${e.status}`)),r?n.filter(e=>!r.has(`${e.session_id}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${T[e.status]}`).join(`. `):``}var D=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function O(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:D.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function k(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),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 A({enabled:e,onToggle:t}){return(0,S.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,S.jsx)(p,{name:`activity`,className:`glyph act-fixed`}),(0,S.jsxs)(`div`,{className:`act-grow`,children:[(0,S.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,S.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,S.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,S.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,S.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function j({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=h(e?.jobs,{days:14,cap:n}),i=d(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 ${u(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${u(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,S.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,S.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,S.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,S.jsx)(`i`,{className:`zero`},e.key))}),(0,S.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,S.jsx)(`span`,{children:u(r[0].key)}),(0,S.jsx)(`span`,{children:u(r[7].key)}),(0,S.jsx)(`span`,{children:`today`})]}),c&&(0,S.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function M({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,S.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,S.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,S.jsx)(y,{vals:e.per_day,i:t,sweep:!0}),(0,S.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var N={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ie({job:e,longest:t}){let n=c(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=N[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,S.jsxs)(`li`,{className:`act-row`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,S.jsx)(p,{name:`play`,className:`glyph act-glyph`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,S.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,S.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,S.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,S.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function ae({gate:e}){return(0,S.jsxs)(`li`,{className:`act-row gate`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,S.jsx)(p,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,S.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,S.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,S.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var P=5,F=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function I(){let[e,t]=(0,x.useState)(null),[n,o]=(0,x.useState)(``),[c,u]=(0,x.useState)(O),[f,p]=(0,x.useState)(!1),[h,g]=(0,x.useState)(``),v=(0,x.useRef)(null),y=e=>{let t={...c,...e};u(t),k(t)};re(e=>r.activity().then(n=>{if(e()){t(n),o(``);let e=E(v,n?.activity);e&&g(t=>t===e?e+`\xA0`:e)}},t=>{e()&&o(t.message)}),2e3,[]);let T=m(()=>C(r.jobs()),[]),N=m(()=>C(r.gates()),[]),I=m(()=>C(r.catalog(`laws`)),[]),L=!e||e.enabled!==!1,R=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),z=i(),B=L&&e?R.filter(a).length:null,V=new Set(R.map(e=>e.session_id)),H=(e?.ended||[]).filter(e=>!V.has(e.session_id)),U=F([...R,...H].map(e=>e.host),c.host),W=F([...R,...H].map(e=>s(e.cwd)),c.project),G=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,K=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),q=R.filter(e=>K(e)&&(c.f!==`needs`||a(e))),oe=c.f===`all`||c.f===`needs`,J=c.f===`all`&&L?H.filter(K):[],se=f?J:J.slice(0,P),ce=!G&&(c.f===`all`||c.f===`runs`),le=!G&&(c.f===`all`||c.f===`gates`),Y=T.data?.jobs||[],X=_(N.data,I.data),Z=ee(Y,X,N.data?.days).map(e=>({...e,runs:ce?e.runs:[],gate:le?e.gate:null})).filter(e=>e.runs.length||e.gate),ue=Math.max(0,...Y.map(e=>e.duration||0)),Q=d(Z.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),de=async()=>{let e=!L;try{let n=await r.activityToggle(e);if(n.ok===!1){o(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),o(``)}catch(e){o(e.message)}},$=(e,t,n)=>(0,S.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,S.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,S.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:c[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,S.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))]})]});return(0,S.jsxs)(`div`,{className:`narrow`,children:[(0,S.jsx)(te,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,S.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:h}),n&&(0,S.jsx)(`div`,{className:`act-gap`,children:(0,S.jsx)(ne,{error:n})}),e&&(0,S.jsx)(A,{enabled:L,onToggle:de}),(0,S.jsxs)(`div`,{className:`act-today`,children:[(0,S.jsx)(j,{jobs:T.data,loading:T.loading}),(0,S.jsx)(M,{rows:X,gates:N.data,loading:N.loading}),(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,S.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,S.jsxs)(`span`,{className:`act-big act-wait`,children:[B??`—`,` `,(0,S.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,S.jsx)(`p`,{className:`dim act-sm`,children:L?`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,S.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,S.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:D.map(([e,t])=>(0,S.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&B>0?(0,S.jsxs)(`span`,{className:`mono`,children:[` `,B]}):null]},e))}),$(`host`,`Host`,U),$(`project`,`Project`,W)]}),G&&c.f!==`needs`&&(0,S.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,G,`; showing sessions only.`]}),oe&&(e?!L&&c.f!==`needs`?null:q.length===0?c.f===`needs`?(0,S.jsx)(b,{title:`Nothing waits on you`}):(0,S.jsxs)(b,{title:`No active sessions`,children:[`Run `,(0,S.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,S.jsx)(`div`,{className:`stack gap-12 act-live`,ref:z,children:q.map(e=>(0,S.jsx)(`div`,{"data-flip":e.session_id,children:(0,S.jsx)(w,{s:e})},e.session_id))}):(0,S.jsx)(l,{label:`Reading live sessions…`})),J.length>0&&(0,S.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,S.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),se.map(e=>(0,S.jsx)(`div`,{children:(0,S.jsx)(w,{s:e})},e.session_id)),J.length>P&&(0,S.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":f,onClick:()=>p(e=>!e),children:f?`Show fewer`:`Show all ${J.length}`})]}),c.f!==`needs`&&(0,S.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Q,children:Z.map(e=>(0,S.jsxs)(`section`,{className:`card act-day`,children:[(0,S.jsxs)(`h3`,{className:`act-day-h`,children:[(0,S.jsx)(`span`,{children:e.title}),(0,S.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,S.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,S.jsx)(ie,{job:e,longest:ue},e.id)),e.gate&&(0,S.jsx)(ae,{gate:e.gate})]})]},e.key))})]})}export{I 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-BfpZmUMI.js";import{C as i,D as a,E as o,J as s,U as c,at as l,q as u,ut as d}from"./index-UNxZecs3.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{t as p}from"./usePoll-bDFN-Hr6.js";var m=e(t(),1),h=n();function g(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 _({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(`${a(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,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,h.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,h.jsx)(`span`,{className:`feed-dot act-inline-dot ${g(e)||`acc`}`}),e.kind===`thinking`&&(0,h.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,h.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,h.jsx)(`b`,{children:i}),e.error&&(0,h.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,h.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,h.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${d(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function v({turns:e}){return!e||e.length===0?(0,h.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,h.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,h.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}function y({sid:e}){let[t,n]=(0,m.useState)(null),[a,g]=(0,m.useState)(``),[y,b]=(0,m.useState)(!1),[x,S]=(0,m.useState)(!1),C=(0,m.useId)();p(t=>y?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),g(``),b(!1))},e=>{t()&&(e.status===404?b(!0):g(e.message))}),2e3,[e,y]);let w=(0,h.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,h.jsx)(l,{name:`arrow`}),` Activity`]});if(y)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(f,{title:`Session ended`,action:(0,h.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,a?(0,h.jsx)(u,{error:a}):(0,h.jsx)(s,{label:`Loading session…`})]});let T=t.session,E=T.files,D=T.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(c,{title:T.title||o(T.cwd)||T.session_id,sub:T.cwd?(0,h.jsx)(`span`,{className:`mono act-cwd`,title:T.cwd,children:T.cwd}):null}),a&&(0,h.jsx)(`div`,{className:`act-gap`,children:(0,h.jsx)(u,{error:a})}),(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(i,{s:T}),(0,h.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,d(T.updated_at),` ago`]})]}),(O||k)&&(0,h.jsxs)(`div`,{className:`grid gap-12 act-panels${O&&k?` two`:``}`,children:[O&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Files touched `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,h.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,h.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,h.jsxs)(`span`,{className:`act-fixed`,children:[(0,h.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Plan`,` `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:D.items.map((e,t)=>(0,h.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,h.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,h.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,h.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,h.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,h.jsx)(`h2`,{children:`Timeline`}),j.length>0&&(0,h.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":x,"aria-controls":C,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show full stream (${M.length})`})]}),(0,h.jsx)(`div`,{id:C,children:x?(0,h.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,h.jsx)(_,{rec:e},t))}):(0,h.jsx)(v,{turns:A})})]})]})}export{y 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-BfpZmUMI.js";import{C as i,D as a,E as o,J as s,U as c,at as l,q as u,ut as d}from"./index-BUdl0KdD.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{t as p}from"./usePoll-bDFN-Hr6.js";var m=e(t(),1),h=n();function g(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 _({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(`${a(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,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,h.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,h.jsx)(`span`,{className:`feed-dot act-inline-dot ${g(e)||`acc`}`}),e.kind===`thinking`&&(0,h.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,h.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,h.jsx)(`b`,{children:i}),e.error&&(0,h.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,h.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,h.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${d(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function v({turns:e}){return!e||e.length===0?(0,h.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,h.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,h.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}function y({sid:e}){let[t,n]=(0,m.useState)(null),[a,g]=(0,m.useState)(``),[y,b]=(0,m.useState)(!1),[x,S]=(0,m.useState)(!1),C=(0,m.useId)();p(t=>y?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),g(``),b(!1))},e=>{t()&&(e.status===404?b(!0):g(e.message))}),2e3,[e,y]);let w=(0,h.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,h.jsx)(l,{name:`arrow`}),` Activity`]});if(y)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(f,{title:`Session ended`,action:(0,h.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,a?(0,h.jsx)(u,{error:a}):(0,h.jsx)(s,{label:`Loading session…`})]});let T=t.session,E=T.files,D=T.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(c,{title:T.title||o(T.cwd)||T.session_id,sub:T.cwd?(0,h.jsx)(`span`,{className:`mono act-cwd`,title:T.cwd,children:T.cwd}):null}),a&&(0,h.jsx)(`div`,{className:`act-gap`,children:(0,h.jsx)(u,{error:a})}),(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(i,{s:T}),(0,h.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,d(T.updated_at),` ago`]})]}),(O||k)&&(0,h.jsxs)(`div`,{className:`grid gap-12 act-panels${O&&k?` two`:``}`,children:[O&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Files touched `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,h.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,h.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,h.jsxs)(`span`,{className:`act-fixed`,children:[(0,h.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Plan`,` `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:D.items.map((e,t)=>(0,h.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,h.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,h.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,h.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,h.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,h.jsx)(`h2`,{children:`Timeline`}),j.length>0&&(0,h.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":x,"aria-controls":C,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show full stream (${M.length})`})]}),(0,h.jsx)(`div`,{id:C,children:x?(0,h.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,h.jsx)(_,{rec:e},t))}):(0,h.jsx)(v,{turns:A})})]})]})}export{y 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{at as r}from"./index-UNxZecs3.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
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{at as r}from"./index-BUdl0KdD.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-BBCsUAcJ.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-UNxZecs3.js","assets/api-BfpZmUMI.js","assets/index-IuDNqPEl.css","assets/OperatorHudView-BxKeM_Lk.js","assets/JournalView-CLf3j4Ar.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-BfpZmUMI.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{F as l,H as u,I as d,J as f,K as p,X as m,at as h,ct as g,ft as _,l as v,lt as y,q as b,st as x,t as S,ut as C,yt as w,z as T}from"./index-UNxZecs3.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=l(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=C(e.newest),n=e.oldest?C(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=d(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}=_(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=x(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:()=>w(`#/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)(h,{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=d(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[C(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(T,{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=y(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=g(e.counts),o=n?.version_verdict||``,s=U(o),l=x(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=g(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=x(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=_(()=>q(()=>i.fleet()),[e]),r=_(()=>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?v(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)(()=>S(()=>import(`./GreenhouseView-BBCsUAcJ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>S(()=>import(`./OperatorHudView-BxKeM_Lk.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>S(()=>import(`./JournalView-CLf3j4Ar.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 d=c,[h,g]=(0,E.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:d===`greenhouse`||d===`operator`}),{data:x}=_(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,l]);if(!e)return t?(0,k.jsx)(b,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(f,{});let S=e.daemon_stale?(0,k.jsx)(p,{}):null;return e.deployed?h===`status`&&d===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:[S,(0,k.jsx)(Q,{overview:e,recent:x,lens:y,onDirection:g,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[S,(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:h===e?`on`:``,onClick:()=>g(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&d===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:v,setup:a,jobs:o,lens:y,dataRev:l}),h===`status`&&d===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:(0,k.jsx)(X,{overview:e,sigil:v,jobs:o,lens:y,onAction:s})}),h===`status`&&d===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),h===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:v,setup:a,jobs:o,lens:y}),h===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},h)]}):(0,k.jsxs)(k.Fragment,{children:[S,(0,k.jsx)(u,{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-50jF3dvM.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-BUdl0KdD.js","assets/api-BfpZmUMI.js","assets/index-BVxqp3vf.css","assets/OperatorHudView-DJ_Wb0on.js","assets/JournalView-DhjSU8nT.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-BfpZmUMI.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{F as l,H as u,I as d,J as f,K as p,X as m,at as h,ct as g,ft as _,l as v,lt as y,q as b,st as x,t as S,ut as C,yt as w,z as T}from"./index-BUdl0KdD.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=l(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=C(e.newest),n=e.oldest?C(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=d(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}=_(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=x(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:()=>w(`#/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)(h,{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=d(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[C(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(T,{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=y(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=g(e.counts),o=n?.version_verdict||``,s=U(o),l=x(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=g(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=x(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=_(()=>q(()=>i.fleet()),[e]),r=_(()=>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?v(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)(()=>S(()=>import(`./GreenhouseView-50jF3dvM.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>S(()=>import(`./OperatorHudView-DJ_Wb0on.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>S(()=>import(`./JournalView-DhjSU8nT.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 d=c,[h,g]=(0,E.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:d===`greenhouse`||d===`operator`}),{data:x}=_(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,l]);if(!e)return t?(0,k.jsx)(b,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(f,{});let S=e.daemon_stale?(0,k.jsx)(p,{}):null;return e.deployed?h===`status`&&d===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:[S,(0,k.jsx)(Q,{overview:e,recent:x,lens:y,onDirection:g,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[S,(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:h===e?`on`:``,onClick:()=>g(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&d===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:v,setup:a,jobs:o,lens:y,dataRev:l}),h===`status`&&d===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:(0,k.jsx)(X,{overview:e,sigil:v,jobs:o,lens:y,onAction:s})}),h===`status`&&d===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),h===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:v,setup:a,jobs:o,lens:y}),h===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},h)]}):(0,k.jsxs)(k.Fragment,{children:[S,(0,k.jsx)(u,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{n as a}from"./motion-CXaUMNkg.js";import{$ as o,J as s,Q as c,U as l,X as u,a as d,at as f,c as p,et as m,ft as h,i as ee,n as g,o as _,q as v,r as te,s as ne,yt as y}from"./index-UNxZecs3.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{a as re,n as x,o as S,r as C,t as ie}from"./RailCats-BuJD4Jou.js";import{t as w}from"./CopyButton-BnPdDHls.js";import{i as T,n as E,r as D}from"./Markdown-DpmmtW2Y.js";var O=e(t(),1),k=n();function A(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 j(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
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-BfpZmUMI.js";import{n as a}from"./motion-CXaUMNkg.js";import{$ as o,J as s,Q as c,U as l,X as u,a as d,at as f,c as p,et as m,ft as h,i as ee,n as g,o as _,q as v,r as te,s as ne,yt as y}from"./index-BUdl0KdD.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{a as re,n as x,o as S,r as C,t as ie}from"./RailCats-BuJD4Jou.js";import{t as w}from"./CopyButton-BHxw2k1Z.js";import{i as T,n as E,r as D}from"./Markdown-DpmmtW2Y.js";var O=e(t(),1),k=n();function A(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 j(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 M(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||A(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 N(e){let t={ids:new Set,idx:0,toc:[]},n=n=>M(E(n,e?.links),t);if(e?.rows){let[r,i]=j(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var P=r(),F={"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`]},I=`you already know this`,L=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function R(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 z=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),B=40,V=e=>{let t=e.split(`
@@ -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{I as a,P as o,at as s,st as c,z as l}from"./index-UNxZecs3.js";import{i as u,n as d,r as f}from"./Dashboard-DtJ0xrcA.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 a=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(l,{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:a,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)(s,{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:l,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=a(l,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(l||[],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)(s,{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:l,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
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{I as a,P as o,at as s,st as c,z as l}from"./index-BUdl0KdD.js";import{i as u,n as d,r as f}from"./Dashboard-DmKR3TQg.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 a=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(l,{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:a,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)(s,{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:l,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=a(l,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(l||[],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)(s,{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:l,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
@@ -1,3 +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-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,R as o,U as s,X as c,Y as l,Z as u,at as d,ft as f,gt as p,ht as m,it as h,mt as g,nt as _,ot as v,pt as y,q as b,rt as x,st as S,tt as C,ut as w,vt as T}from"./index-UNxZecs3.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-kIqas9Tj.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-BaDKgnO8.js";var F=e(t(),1),I=n();function ee({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.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,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.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,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:C.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function L(){let{data:e,error:t,reload:n}=f(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.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,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.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,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.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,I.jsx)(d,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function R({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.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,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${_(e.host).label} · ${e.scope}`,[h,g]=z[e.state]||z.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:x(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(R,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(L,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var B=(e,t)=>`${e} ${t}`,ne=[`claude`,`bob`,`openclaude`],V={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},H=/[\\/]\.claude[\\/]worktrees[\\/]/,U=e=>e.scope===`project`&&H.test(e.path);function re(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?S(e.drift):0;return i?`${r} · ${i} edited`:r}function W({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?S(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(o,{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,I.jsx)(`span`,{className:`dim`,children:re(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=V[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,I.jsx)(`td`,{children:_(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(`span`,{className:`tag ${c}`,children:i}),U(e)?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.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,I.jsx)(`td`,{children:(0,I.jsx)(W,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function G({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:c}){let l=u(),{data:p,error:m,reload:g}=f(()=>r.installs(),[s]),{data:v,error:y,reload:S}=f(()=>r.mcp(),[s]),{data:C,error:w}=f(()=>r.fleet(),[s]),T=w?null:C??void 0,[D,O]=(0,F.useState)(null),[k,A]=(0,F.useState)(``),[j,M]=(0,F.useState)({}),[P,L]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),V=e=>R.id===e?.id?R.value:`keep`,[H,U]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=B(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(m||y)return(0,I.jsx)(b,{error:m||y,onRetry:()=>{g(),S()}});if(!p||!v)return(0,I.jsx)(a,{});let W={active:0,disabled:1,absent:2},G=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(W[e.state]??3)-(W[t.state]??3)),K=G.find(e=>e.id===H)||G.find(e=>e.selected)||G.find(e=>e.state===`active`)||G[0],q=e=>{let t=j[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`}},se=(e,t,n)=>M(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ce=e=>{let t=q(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=q(t),s=_(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=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 l(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},ue=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){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}c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&ne.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},de=async e=>{let t=V(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${h(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}z({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`}),c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},fe=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`})}},pe=async()=>{let t=G.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await l(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},me=G.find(e=>e.selected)?.host||G.find(e=>e.state===`active`)?.host||G[0]?.host||`opencode`,X=G.filter(e=>e.scope===`global`),Z=G.filter(e=>e.scope!==`global`),Q=e=>{U(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}c?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[G.filter(e=>e.state===`active`).length,` active of `,G.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:pe,children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),D?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:D.text}):D?(0,I.jsx)(`p`,{className:`tag ${D.tone===`ok`?`ok `:``}note`,role:`status`,children:D.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:K?.id,onPick:Q,label:`Global installs`,fleet:T,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>L(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),P?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(ee,{host:me,theme:n||`neutral`,options:J,onAction:e,onClose:()=>L(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:K?.id,onPick:Q,label:`Per-project installs`,fleet:T,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:o,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),K?(0,I.jsx)(te,{inst:K,targets:re[B(K.host,K.path)]||[],choice:q(K),unchanged:ce(K),options:J,onPick:(e,t)=>se(K,e,t),canAct:!!e,busy:k===K.id,memory:V(K),onMemory:e=>z({id:K.id,value:e}),onApply:()=>le(K),onToggleInstall:()=>ue(K),onRemove:()=>de(K),onRevealMcp:fe},K.id):null]})}function K({onAction:e,dataRev:t}){let{data:n,error:i}=f(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(b,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(a,{})}function q(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var se=300;function ce({onMutated:e,onAction:t,dataRev:n,overview:i}){let o=u(),{data:s,error:c,reload:l}=f(()=>r.diff(),[n]),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,x]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(s&&s!==S){C(s),v(new Set);let e=s.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=se?s.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>s.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
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-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,R as o,U as s,X as c,Y as l,Z as u,at as d,ft as f,gt as p,ht as m,it as h,mt as g,nt as _,ot as v,pt as y,q as b,rt as x,st as S,tt as C,ut as w,vt as T}from"./index-BUdl0KdD.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-D1tN4jA9.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-DvryZjTL.js";var F=e(t(),1),I=n();function ee({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.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,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.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,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:C.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function L(){let{data:e,error:t,reload:n}=f(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.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,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.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,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.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,I.jsx)(d,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function R({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.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,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${_(e.host).label} · ${e.scope}`,[h,g]=z[e.state]||z.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:x(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(R,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(L,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var B=(e,t)=>`${e} ${t}`,ne=[`claude`,`bob`,`openclaude`],V={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},H=/[\\/]\.claude[\\/]worktrees[\\/]/,U=e=>e.scope===`project`&&H.test(e.path);function re(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?S(e.drift):0;return i?`${r} · ${i} edited`:r}function W({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?S(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(o,{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,I.jsx)(`span`,{className:`dim`,children:re(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=V[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,I.jsx)(`td`,{children:_(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(`span`,{className:`tag ${c}`,children:i}),U(e)?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.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,I.jsx)(`td`,{children:(0,I.jsx)(W,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function G({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:c}){let l=u(),{data:p,error:m,reload:g}=f(()=>r.installs(),[s]),{data:v,error:y,reload:S}=f(()=>r.mcp(),[s]),{data:C,error:w}=f(()=>r.fleet(),[s]),T=w?null:C??void 0,[D,O]=(0,F.useState)(null),[k,A]=(0,F.useState)(``),[j,M]=(0,F.useState)({}),[P,L]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),V=e=>R.id===e?.id?R.value:`keep`,[H,U]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=B(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(m||y)return(0,I.jsx)(b,{error:m||y,onRetry:()=>{g(),S()}});if(!p||!v)return(0,I.jsx)(a,{});let W={active:0,disabled:1,absent:2},G=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(W[e.state]??3)-(W[t.state]??3)),K=G.find(e=>e.id===H)||G.find(e=>e.selected)||G.find(e=>e.state===`active`)||G[0],q=e=>{let t=j[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`}},se=(e,t,n)=>M(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ce=e=>{let t=q(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=q(t),s=_(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=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 l(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},ue=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){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}c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&ne.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},de=async e=>{let t=V(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${h(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}z({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`}),c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},fe=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`})}},pe=async()=>{let t=G.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await l(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},me=G.find(e=>e.selected)?.host||G.find(e=>e.state===`active`)?.host||G[0]?.host||`opencode`,X=G.filter(e=>e.scope===`global`),Z=G.filter(e=>e.scope!==`global`),Q=e=>{U(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}c?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[G.filter(e=>e.state===`active`).length,` active of `,G.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:pe,children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),D?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:D.text}):D?(0,I.jsx)(`p`,{className:`tag ${D.tone===`ok`?`ok `:``}note`,role:`status`,children:D.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:K?.id,onPick:Q,label:`Global installs`,fleet:T,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>L(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),P?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(ee,{host:me,theme:n||`neutral`,options:J,onAction:e,onClose:()=>L(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:K?.id,onPick:Q,label:`Per-project installs`,fleet:T,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:o,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),K?(0,I.jsx)(te,{inst:K,targets:re[B(K.host,K.path)]||[],choice:q(K),unchanged:ce(K),options:J,onPick:(e,t)=>se(K,e,t),canAct:!!e,busy:k===K.id,memory:V(K),onMemory:e=>z({id:K.id,value:e}),onApply:()=>le(K),onToggleInstall:()=>ue(K),onRemove:()=>de(K),onRevealMcp:fe},K.id):null]})}function K({onAction:e,dataRev:t}){let{data:n,error:i}=f(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(b,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(a,{})}function q(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var se=300;function ce({onMutated:e,onAction:t,dataRev:n,overview:i}){let o=u(),{data:s,error:c,reload:l}=f(()=>r.diff(),[n]),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,x]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(s&&s!==S){C(s),v(new Set);let e=s.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=se?s.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>s.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
2
2
  `)}\n\n`:``;if(await o(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;g(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await l(),e?.()}catch(e){g(e.message)}finally{m(!1)}}};if(c)return(0,I.jsx)(b,{error:c,onRetry:l});if(!s)return(0,I.jsx)(a,{});if(!s.deployed)return(0,I.jsx)(E,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!s.diffable)return(0,I.jsx)(E,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=s.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=s.files.filter(e=>e.status===`linked`),j=s.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,ee=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),s.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:s.target}),s.theme?` (${s.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,M>0?(0,I.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.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:p||_.size===0,onClick:O,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:p,onClick:D,children:[(0,I.jsx)(d,{name:`download`}),`Export improvements`]})]})]}),h?(0,I.jsx)(`p`,{className:`sub mb-14`,children:h}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
3
3
  `),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(E,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(s.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:_.size===k.length,onChange:T}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>L(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:p,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>L(e,!1))]}):null]})]});function L(e,t){let n=y.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>ee(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(d,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${q(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(d,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function le({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:i,reload:o,setData:s}=f(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),o()};if(i)return(0,I.jsx)(b,{error:i,onRetry:o});let l=n?n.groups.filter(e=>e.problems.length):[],u=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`narrow`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.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,I.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,I.jsx)(d,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[l.map((e,t)=>(0,I.jsx)(J,{group:e,i:t},e.label)),u.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[u.length,` clean check`,u.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:u.map((e,t)=>(0,I.jsx)(J,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,I.jsx)(a,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ue(){let e=u(),[t,n]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:i}),(0,I.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`})){a(null);try{await r.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,I.jsx)(d,{name:`x`}),`Stop server`]})]})}function Y(){let e=u(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:r}),(0,I.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 m()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(d,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var de=`https://github.com/Arylmera/Geneseed`,fe=`https://github.com/Arylmera`,pe=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],me=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:pe.map(([n,r])=>(0,I.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,I.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function $({version:e}){let[t,n]=(0,F.useState)(de),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(d,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`MIT License`]})]})]}),children:(0,I.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,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:fe,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.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 he({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:a,onAccentMode:o,layout:s,onLayout:f}){let m=u(),h=e?.install,v=e?.footprint,b=e?.server,S=e?.daemon_stale,[C,E]=(0,F.useState)(null);(0,F.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let D=C?C.install??(C.git?`git`:`npm-global`):null,O=D===`git`?`Update (git pull + rebuild)`:D===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,k=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 m(`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`)},A=b?.autostart===!0?`On · login script`:b?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:T.server}),(0,I.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,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{stale:S}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-skin-label`,children:p.map(e=>(0,I.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,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:p.find(e=>e.id===n)?.tagline??``})]}),a&&o&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(l,{value:a,onChange:o,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(a)})]}),s&&f&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-layout-label`,children:y.map(e=>(0,I.jsx)(`button`,{className:s===e.id?`on`:``,onClick:()=>f(e.id),"aria-pressed":s===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:y.find(e=>e.id===s)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:D===`other`?C.command?(0,I.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,I.jsx)(`code`,{className:`mono`,children:C.command})]}):null:(0,I.jsxs)(`button`,{className:`btn`,onClick:k,children:[(0,I.jsx)(d,{name:`download`}),O]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(d,{name:`external`}),`Add to PATH`]})}),h&&v&&(0,I.jsxs)(X,{k:`Harness footprint`,help:(0,I.jsxs)(I.Fragment,{children:[`For `,_(h.host).label,` · `,h.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,I.jsx)(`span`,{className:`mono`,children:v}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,children:v===`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,I.jsxs)(Z,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,b?` · pid ${b.pid} · up ${w(b.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(Y,{}),children:S?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:A})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:me.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ue,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function ge({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?v(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(D,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(G,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(K,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(ce,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(le,{dataRev:o}),e===`server`&&(0,I.jsx)(he,{overview:t,onAction:i,...c})]})}export{ge 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-BfpZmUMI.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,dt as P,ft as F,ut as I,xt as L,yt as R}from"./index-UNxZecs3.js";import{n as z}from"./Dashboard-DtJ0xrcA.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=j(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,j(this,a),e)}}else V(e,this,j(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]=j(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:()=>R(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=F(()=>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:N(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:N(70)},260).add(a,{opacity:1,duration:300,delay:N(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:N(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=P(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:N(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:P(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:()=>R(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:()=>R(`#/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:I(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 ✓ ${I(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>R(`#/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:()=>R(`#/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-BfpZmUMI.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,dt as P,ft as F,ut as I,xt as L,yt as R}from"./index-BUdl0KdD.js";import{n as z}from"./Dashboard-DmKR3TQg.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=j(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,j(this,a),e)}}else V(e,this,j(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]=j(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:()=>R(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=F(()=>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:N(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:N(70)},260).add(a,{opacity:1,duration:300,delay:N(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:N(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=P(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:N(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:P(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:()=>R(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:()=>R(`#/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:I(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 ✓ ${I(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>R(`#/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:()=>R(`#/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{G as r,W as i,Z as a}from"./index-UNxZecs3.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=a(),s=r(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{G as r,W as i,Z as a}from"./index-BUdl0KdD.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=a(),s=r(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
@@ -1 +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-BfpZmUMI.js";import{J as i,L as a,U as o,ft as s,q as c}from"./index-UNxZecs3.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-BaDKgnO8.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=s(()=>r.kits(),[n]),d=h(a,t),{data:f}=s(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(i,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{P 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-BfpZmUMI.js";import{J as i,L as a,U as o,ft as s,q as c}from"./index-BUdl0KdD.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-DvryZjTL.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=s(()=>r.kits(),[n]),d=h(a,t),{data:f}=s(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(i,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{P as default};