geneseed 4.23.0 → 4.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/SHIPPED.md +1 -1
- package/harness.config.json +1 -1
- package/package.json +1 -1
- package/web/dist/assets/{Activity-GdsfJgQQ.js → Activity-D0GfEonq.js} +1 -1
- package/web/dist/assets/{ActivityDetail-BsVbLWoA.js → ActivityDetail-Bf5sBm8_.js} +1 -1
- package/web/dist/assets/{Dashboard-CnO_bsfz.js → Dashboard-gYZLE4r3.js} +2 -2
- package/web/dist/assets/{Docs-DctLhPHX.js → Docs-CQifoJkX.js} +1 -1
- package/web/dist/assets/{GreenhouseView-CC1wDg4u.js → GreenhouseView-R6epl1PY.js} +1 -1
- package/web/dist/assets/{Installs-D3fE87tF.js → Installs-DBH3NEOC.js} +1 -1
- package/web/dist/assets/{JournalView-e6BBAz6i.js → JournalView-DKqMrN35.js} +1 -1
- package/web/dist/assets/{KitApply-Bz6_5yec.js → KitApply-DCBS0ZWz.js} +1 -1
- package/web/dist/assets/{Kits-BtNHZ7_Z.js → Kits-BpUFbYHr.js} +1 -1
- package/web/dist/assets/{Laws-B2X2jIE9.js → Laws-Qnzc5Lp7.js} +1 -1
- package/web/dist/assets/{Library-BXHx4pFJ.js → Library-CWjWbVwS.js} +1 -1
- package/web/dist/assets/{Loops-B_wNVFEN.js → Loops-BRuz2YFL.js} +1 -1
- package/web/dist/assets/{OperatorHudView-BcPPpykd.js → OperatorHudView-NW_xAOj1.js} +1 -1
- package/web/dist/assets/{Personal-BwZ33bqc.js → Personal-d5Ssk-SW.js} +1 -1
- package/web/dist/assets/{Tabs-ByiD3mPQ.js → Tabs-DQLuylEi.js} +1 -1
- package/web/dist/assets/index-DMDF5Y3Y.js +3 -0
- package/web/dist/index.html +1 -1
- package/web/dist/assets/index-D2VlAlpK.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,10 @@ label. For the capability ↔ spec map, see [SHIPPED.md](SHIPPED.md).
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [4.23.1] — 2026-10-25
|
|
12
|
+
|
|
13
|
+
Patch: the Overview cost card follows the viewed install and names its parts.
|
|
14
|
+
|
|
11
15
|
## [4.23.0] — 2026-10-25
|
|
12
16
|
|
|
13
17
|
Minor: the web console redesign (wave V6b) — every page rebuilt from the approved mockups, the reader at full width, recently ended sessions in Activity, and parallel-agents watching its units.
|
|
@@ -28,6 +32,7 @@ Minor: the web console redesign (wave V6b) — every page rebuilt from the appro
|
|
|
28
32
|
- **parallel-agents watches its units** the way the pipeline watches a crew: a result without its check, or one still waiting, is acted on at once, never waited on.
|
|
29
33
|
|
|
30
34
|
### Fixed
|
|
35
|
+
- **The Overview's cost card follows the install you view** and says what it measures: "Loaded every turn", that install's total, its parts with their tokens, and the range across all installs on one line.
|
|
31
36
|
- **The Overview's root-file card follows the install you view** (the topbar picker) instead of always showing the fleet's worst; `/api/fleet` rows carry `selected`.
|
|
32
37
|
- **The Library reader's text takes the full width** of the reader instead of stopping at 76 characters, and usage is one card: the count, then the last day, window and hosts on one line, over a sparkline that spans the card.
|
|
33
38
|
- **Console bars say each number once.** Gate asks, Doctrine packs and the context budget no longer print a legend under the bar repeating the name and count beside it; pack rows line up in one grid; the Library reader shows usage to the right of the description when wide enough, under it otherwise.
|
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.23.
|
|
23
|
+
> string. Current label: **4.23.1**.
|
|
24
24
|
|
|
25
25
|
## Capabilities
|
|
26
26
|
|
package/harness.config.json
CHANGED
|
@@ -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.23.
|
|
5
|
+
"version": "4.23.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.23.
|
|
4
|
+
"version": "4.23.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 f,T as p,U as m,at as h,ft as g,j as _,k as v,q as y,u as b,ut as x,w as S}from"./index-D2VlAlpK.js";import{t as C}from"./EmptyState-1sPNleqv.js";import{t as w}from"./usePoll-bDFN-Hr6.js";var T=e(t(),1),E=n(),D=e=>e.catch(()=>null);function O({s:e}){let t=(0,T.useId)(),n=e.todos,r=v(e);return(0,E.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,E.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,E.jsx)(h,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,E.jsx)(`div`,{className:`act-foot`,children:(0,E.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,E.jsx)(p,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,E.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,x(e.updated_at),` ago`]})]})}var k=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function ee(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:k.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function te(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,E.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,E.jsx)(h,{name:`activity`,className:`glyph act-fixed`}),(0,E.jsxs)(`div`,{className:`act-grow`,children:[(0,E.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,E.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,E.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,E.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,E.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=_(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,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,E.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,E.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,E.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,E.jsx)(`i`,{className:`zero`},e.key))}),(0,E.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,E.jsx)(`span`,{children:u(r[0].key)}),(0,E.jsx)(`span`,{children:u(r[7].key)}),(0,E.jsx)(`span`,{children:`today`})]}),c&&(0,E.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,E.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,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,E.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,E.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,E.jsxs)(`li`,{children:[(0,E.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,E.jsx)(S,{vals:e.per_day,i:t,sweep:!0}),(0,E.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,E.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 ne({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,E.jsxs)(`li`,{className:`act-row`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,E.jsx)(h,{name:`play`,className:`glyph act-glyph`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,E.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,E.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,E.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,E.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function re({gate:e}){return(0,E.jsxs)(`li`,{className:`act-row gate`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,E.jsx)(h,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,E.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,E.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,E.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,T.useState)(null),[n,o]=(0,T.useState)(``),[c,u]=(0,T.useState)(ee),[p,h]=(0,T.useState)(!1),_=e=>{let t={...c,...e};u(t),te(t)};w(e=>r.activity().then(n=>{e()&&(t(n),o(``))},t=>{e()&&o(t.message)}),2e3,[]);let v=g(()=>D(r.jobs()),[]),x=g(()=>D(r.gates()),[]),S=g(()=>D(r.catalog(`laws`)),[]),N=!e||e.enabled!==!1,I=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),L=i(),R=N&&e?I.filter(a).length:null,z=new Set(I.map(e=>e.session_id)),B=(e?.ended||[]).filter(e=>!z.has(e.session_id)),V=F([...I,...B].map(e=>e.host),c.host),H=F([...I,...B].map(e=>s(e.cwd)),c.project),U=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,W=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),G=I.filter(e=>W(e)&&(c.f!==`needs`||a(e))),K=c.f===`all`||c.f===`needs`,q=c.f===`all`&&N?B.filter(W):[],J=p?q:q.slice(0,P),Y=!U&&(c.f===`all`||c.f===`runs`),ie=!U&&(c.f===`all`||c.f===`gates`),X=v.data?.jobs||[],Z=b(x.data,S.data),Q=f(X,Z,x.data?.days).map(e=>({...e,runs:Y?e.runs:[],gate:ie?e.gate:null})).filter(e=>e.runs.length||e.gate),ae=Math.max(0,...X.map(e=>e.duration||0)),oe=d(Q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),se=async()=>{let e=!N;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,E.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,E.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,E.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=>_({[e]:t.target.value}),children:[(0,E.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})]});return(0,E.jsxs)(`div`,{className:`narrow`,children:[(0,E.jsx)(m,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),n&&(0,E.jsx)(`div`,{className:`act-gap`,children:(0,E.jsx)(y,{error:n})}),e&&(0,E.jsx)(A,{enabled:N,onToggle:se}),(0,E.jsxs)(`div`,{className:`act-today`,children:[(0,E.jsx)(j,{jobs:v.data,loading:v.loading}),(0,E.jsx)(M,{rows:Z,gates:x.data,loading:x.loading}),(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,E.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,E.jsxs)(`span`,{className:`act-big act-wait`,children:[R??`—`,` `,(0,E.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,E.jsx)(`p`,{className:`dim act-sm`,children:N?`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,E.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,E.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:k.map(([e,t])=>(0,E.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>_({f:e}),children:[t,e===`needs`&&R>0?(0,E.jsxs)(`span`,{className:`mono`,children:[` `,R]}):null]},e))}),$(`host`,`Host`,V),$(`project`,`Project`,H)]}),U&&c.f!==`needs`&&(0,E.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,U,`; showing sessions only.`]}),K&&(e?!N&&c.f!==`needs`?null:G.length===0?c.f===`needs`?(0,E.jsx)(C,{title:`Nothing waits on you`}):(0,E.jsxs)(C,{title:`No active sessions`,children:[`Run `,(0,E.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,E.jsx)(`div`,{className:`stack gap-12 act-live`,ref:L,children:G.map(e=>(0,E.jsx)(`div`,{"data-flip":e.session_id,children:(0,E.jsx)(O,{s:e})},e.session_id))}):(0,E.jsx)(l,{label:`Reading live sessions…`})),q.length>0&&(0,E.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,E.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),J.map(e=>(0,E.jsx)(`div`,{children:(0,E.jsx)(O,{s:e})},e.session_id)),q.length>P&&(0,E.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":p,onClick:()=>h(e=>!e),children:p?`Show fewer`:`Show all ${q.length}`})]}),c.f!==`needs`&&(0,E.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:oe,children:Q.map(e=>(0,E.jsxs)(`section`,{className:`card act-day`,children:[(0,E.jsxs)(`h3`,{className:`act-day-h`,children:[(0,E.jsx)(`span`,{children:e.title}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,E.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,E.jsx)(ne,{job:e,longest:ae},e.id)),e.gate&&(0,E.jsx)(re,{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 f,T as p,U as m,at as h,ft as g,j as _,k as v,q as y,u as b,ut as x,w as S}from"./index-DMDF5Y3Y.js";import{t as C}from"./EmptyState-1sPNleqv.js";import{t as w}from"./usePoll-bDFN-Hr6.js";var T=e(t(),1),E=n(),D=e=>e.catch(()=>null);function O({s:e}){let t=(0,T.useId)(),n=e.todos,r=v(e);return(0,E.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,E.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,E.jsx)(h,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,E.jsx)(`div`,{className:`act-foot`,children:(0,E.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,E.jsx)(p,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,E.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,x(e.updated_at),` ago`]})]})}var k=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function ee(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:k.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function te(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,E.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,E.jsx)(h,{name:`activity`,className:`glyph act-fixed`}),(0,E.jsxs)(`div`,{className:`act-grow`,children:[(0,E.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,E.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,E.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,E.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,E.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=_(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,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,E.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,E.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,E.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,E.jsx)(`i`,{className:`zero`},e.key))}),(0,E.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,E.jsx)(`span`,{children:u(r[0].key)}),(0,E.jsx)(`span`,{children:u(r[7].key)}),(0,E.jsx)(`span`,{children:`today`})]}),c&&(0,E.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,E.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,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,E.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,E.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,E.jsxs)(`li`,{children:[(0,E.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,E.jsx)(S,{vals:e.per_day,i:t,sweep:!0}),(0,E.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,E.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 ne({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,E.jsxs)(`li`,{className:`act-row`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,E.jsx)(h,{name:`play`,className:`glyph act-glyph`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,E.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,E.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,E.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,E.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function re({gate:e}){return(0,E.jsxs)(`li`,{className:`act-row gate`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,E.jsx)(h,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,E.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,E.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,E.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,T.useState)(null),[n,o]=(0,T.useState)(``),[c,u]=(0,T.useState)(ee),[p,h]=(0,T.useState)(!1),_=e=>{let t={...c,...e};u(t),te(t)};w(e=>r.activity().then(n=>{e()&&(t(n),o(``))},t=>{e()&&o(t.message)}),2e3,[]);let v=g(()=>D(r.jobs()),[]),x=g(()=>D(r.gates()),[]),S=g(()=>D(r.catalog(`laws`)),[]),N=!e||e.enabled!==!1,I=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),L=i(),R=N&&e?I.filter(a).length:null,z=new Set(I.map(e=>e.session_id)),B=(e?.ended||[]).filter(e=>!z.has(e.session_id)),V=F([...I,...B].map(e=>e.host),c.host),H=F([...I,...B].map(e=>s(e.cwd)),c.project),U=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,W=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),G=I.filter(e=>W(e)&&(c.f!==`needs`||a(e))),K=c.f===`all`||c.f===`needs`,q=c.f===`all`&&N?B.filter(W):[],J=p?q:q.slice(0,P),Y=!U&&(c.f===`all`||c.f===`runs`),ie=!U&&(c.f===`all`||c.f===`gates`),X=v.data?.jobs||[],Z=b(x.data,S.data),Q=f(X,Z,x.data?.days).map(e=>({...e,runs:Y?e.runs:[],gate:ie?e.gate:null})).filter(e=>e.runs.length||e.gate),ae=Math.max(0,...X.map(e=>e.duration||0)),oe=d(Q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),se=async()=>{let e=!N;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,E.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,E.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,E.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=>_({[e]:t.target.value}),children:[(0,E.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})]});return(0,E.jsxs)(`div`,{className:`narrow`,children:[(0,E.jsx)(m,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),n&&(0,E.jsx)(`div`,{className:`act-gap`,children:(0,E.jsx)(y,{error:n})}),e&&(0,E.jsx)(A,{enabled:N,onToggle:se}),(0,E.jsxs)(`div`,{className:`act-today`,children:[(0,E.jsx)(j,{jobs:v.data,loading:v.loading}),(0,E.jsx)(M,{rows:Z,gates:x.data,loading:x.loading}),(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,E.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,E.jsxs)(`span`,{className:`act-big act-wait`,children:[R??`—`,` `,(0,E.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,E.jsx)(`p`,{className:`dim act-sm`,children:N?`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,E.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,E.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:k.map(([e,t])=>(0,E.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>_({f:e}),children:[t,e===`needs`&&R>0?(0,E.jsxs)(`span`,{className:`mono`,children:[` `,R]}):null]},e))}),$(`host`,`Host`,V),$(`project`,`Project`,H)]}),U&&c.f!==`needs`&&(0,E.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,U,`; showing sessions only.`]}),K&&(e?!N&&c.f!==`needs`?null:G.length===0?c.f===`needs`?(0,E.jsx)(C,{title:`Nothing waits on you`}):(0,E.jsxs)(C,{title:`No active sessions`,children:[`Run `,(0,E.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,E.jsx)(`div`,{className:`stack gap-12 act-live`,ref:L,children:G.map(e=>(0,E.jsx)(`div`,{"data-flip":e.session_id,children:(0,E.jsx)(O,{s:e})},e.session_id))}):(0,E.jsx)(l,{label:`Reading live sessions…`})),q.length>0&&(0,E.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,E.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),J.map(e=>(0,E.jsx)(`div`,{children:(0,E.jsx)(O,{s:e})},e.session_id)),q.length>P&&(0,E.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":p,onClick:()=>h(e=>!e),children:p?`Show fewer`:`Show all ${q.length}`})]}),c.f!==`needs`&&(0,E.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:oe,children:Q.map(e=>(0,E.jsxs)(`section`,{className:`card act-day`,children:[(0,E.jsxs)(`h3`,{className:`act-day-h`,children:[(0,E.jsx)(`span`,{children:e.title}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,E.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,E.jsx)(ne,{job:e,longest:ae},e.id)),e.gate&&(0,E.jsx)(re,{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-
|
|
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-DMDF5Y3Y.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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-
|
|
2
|
-
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-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{H as l,I as u,J as d,K as f,X as p,at as m,ct as h,ft as g,l as _,lt as v,q as y,st as b,t as x,ut as S,yt as C,z as w}from"./index-D2VlAlpK.js";var T=t(n(),1),E={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.`},D=(e,t)=>e.deployed?t===void 0||t===`good`?E[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,O=r(),k={good:`ok`,warn:`warn`,bad:`bad`};function A({verdict:e}){return e?(0,O.jsxs)(`span`,{className:`badge ${k[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,O.jsx)(`span`,{className:`dot`}),e.head]}):null}function j({overview:e,dataRev:t}){let{data:n}=g(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=b(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,O.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,O.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,O.jsx)(o,{value:t})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,O.jsx)(`div`,{className:`kseg-spacer`}),(0,O.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>C(`#/diff`),title:`Open changes`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,O.jsx)(o,{value:r})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,O.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function M({overview:e}){return(0,O.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,O.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>C(`#/section/`+t),children:[(0,O.jsxs)(`div`,{className:`gtop`,children:[(0,O.jsx)(`span`,{className:`gname`,children:r.label}),(0,O.jsx)(m,{name:r.icon,className:`gicon`})]}),(0,O.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,O.jsx)(o,{value:i})}),(0,O.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function N({jobs:e}){if(!e||e.length===0)return(0,O.jsx)(`div`,{className:`feed`,children:(0,O.jsxs)(`div`,{className:`empty`,children:[(0,O.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=u(e,8);return(0,O.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,O.jsxs)(`div`,{className:`feed-row`,children:[(0,O.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,O.jsx)(`span`,{className:`feed-txt`,children:(0,O.jsx)(`b`,{children:e.action})}),(0,O.jsxs)(`span`,{className:`feed-when`,children:[S(e.started),` ago`]})]},e.id))})}function P({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,O.jsxs)(`div`,{className:`ring-box`,children:[(0,O.jsx)(w,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,O.jsxs)(`div`,{className:`ring-center`,children:[(0,O.jsxs)(`div`,{className:`pct`,children:[n,(0,O.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,O.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function F({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=D(e,i?.tone),s=v(e,n,i?.tone);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,O.jsxs)(`div`,{className:`hero`,children:[(0,O.jsx)(P,{value:s}),(0,O.jsxs)(`div`,{className:`hero-facts`,children:[(0,O.jsx)(`div`,{className:`ttl`,children:o}),(0,O.jsx)(A,{verdict:i?.verdict}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,O.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,O.jsxs)(`div`,{className:`hero-chips`,children:[(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`voice`}),(0,O.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`mode`}),(0,O.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,O.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`built`}),(0,O.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`fp`}),(0,O.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,O.jsx)(j,{overview:e,dataRev:a}),(0,O.jsxs)(`div`,{className:`grid split-status`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Capability genome`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,O.jsx)(M,{overview:e})]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Recent activity`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`badge acc`,children:[(0,O.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,O.jsx)(N,{jobs:r})]})]})]})}function I({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,O.jsxs)(`div`,{className:`strand`,children:[(0,O.jsxs)(`span`,{className:`strand-name`,children:[(0,O.jsx)(`span`,{className:`strand-dot`}),(0,O.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,O.jsx)(`span`,{className:`strand-val`,children:i})]})}function L(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 R({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=h(e.counts),o=n?.version_verdict||``,s=L(o),l=b(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,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`mb-16`,children:(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,O.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,O.jsxs)(`div`,{className:`lineage-track`,children:[(0,O.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,O.jsxs)(`div`,{className:`lineage-step`,children:[(0,O.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,O.jsx)(`div`,{className:`lt`,children:e}),(0,O.jsx)(`div`,{className:`ld`,children:t}),(0,O.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,O.jsx)(`hr`,{className:`hr`}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,O.jsx)(A,{verdict:i?.verdict}),s&&(0,O.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,O.jsx)(`span`,{className:`dot`}),s.label]}),(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,O.jsxs)(`div`,{className:`grid split-even`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Genome strand`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,O.jsx)(I,{k:t,overview:e,max:a},t))]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Recent activity`})}),(0,O.jsx)(N,{jobs:r})]})]})]})}function z({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=h(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=b(e.diff);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,O.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,O.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`status`}),(0,O.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,O.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,O.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,O.jsx)(A,{verdict:r?.verdict})]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`voice`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`mode`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,O.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,O.jsxs)(`span`,{className:`badge ok`,children:[(0,O.jsx)(`span`,{className:`dot`}),`clean`]}):(0,O.jsxs)(`span`,{className:`badge warn`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`edits`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,O.jsxs)(`div`,{className:`grid split-operator`,children:[(0,O.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,O.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,O.jsx)(`h3`,{children:`Sections`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,O.jsxs)(`table`,{className:`tbl`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`Section`}),(0,O.jsx)(`th`,{children:`Detail`}),(0,O.jsx)(`th`,{style:{width:130},children:`Share`}),(0,O.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,O.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,O.jsxs)(`tr`,{className:`clickable`,children:[(0,O.jsx)(`td`,{className:`name`,children:(0,O.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,O.jsx)(`td`,{className:`muted`,children:n.desc}),(0,O.jsx)(`td`,{children:(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,O.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Run log`})}),(0,O.jsx)(N,{jobs:n})]})]})]})}var B=Symbol(`failed`),V=e=>Promise.resolve().then(e).catch(()=>B);function H({dataRev:e,needDoctor:t}){let n=g(()=>V(()=>i.fleet()),[e]),r=g(()=>t?V(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===B?`failed`:`ok`,s=o===`ok`?a:null,c=s?_(s):null,l=r.data,u=t?l==null?`loading`:l===B?`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 U=e({default:()=>q}),W=(0,T.lazy)(()=>x(()=>import(`./GreenhouseView-CC1wDg4u.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),G=(0,T.lazy)(()=>x(()=>import(`./OperatorHudView-BcPPpykd.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),K=(0,T.lazy)(()=>x(()=>import(`./JournalView-e6BBAz6i.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function q({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:u}){let m=c,[h,_]=(0,T.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,b=H({dataRev:u,needDoctor:m===`greenhouse`||m===`operator`}),{data:x}=g(()=>m===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[m,u]);if(!e)return t?(0,O.jsx)(y,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,O.jsx)(d,{});let S=e.daemon_stale?(0,O.jsx)(f,{}):null;return e.deployed?h===`status`&&m===`journal`?(0,O.jsxs)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:[S,(0,O.jsx)(K,{overview:e,recent:x,lens:b,onDirection:_,dataRev:u})]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(`div`,{className:`head-row`,children:(0,O.jsx)(p,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,O.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>_(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,O.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&m===`cultivar`&&(0,O.jsx)(F,{overview:e,sigil:v,setup:a,jobs:o,lens:b,dataRev:u}),h===`status`&&m===`greenhouse`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(W,{overview:e,sigil:v,jobs:o,lens:b,onAction:s})}),h===`status`&&m===`operator`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(G,{overview:e,jobs:o,lens:b})}),h===`lineage`&&(0,O.jsx)(R,{overview:e,sigil:v,setup:a,jobs:o,lens:b}),h===`operator`&&(0,O.jsx)(z,{overview:e,setup:a,jobs:o,lens:b})]},h)]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(l,{onAction:s})]})}export{q as default,A as n,D as r,U as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-R6epl1PY.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-DMDF5Y3Y.js","assets/api-BfpZmUMI.js","assets/index-BX3zc2Yi.css","assets/OperatorHudView-NW_xAOj1.js","assets/JournalView-DKqMrN35.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{H as l,I as u,J as d,K as f,X as p,at as m,ct as h,ft as g,l as _,lt as v,q as y,st as b,t as x,ut as S,yt as C,z as w}from"./index-DMDF5Y3Y.js";var T=t(n(),1),E={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.`},D=(e,t)=>e.deployed?t===void 0||t===`good`?E[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,O=r(),k={good:`ok`,warn:`warn`,bad:`bad`};function A({verdict:e}){return e?(0,O.jsxs)(`span`,{className:`badge ${k[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,O.jsx)(`span`,{className:`dot`}),e.head]}):null}function j({overview:e,dataRev:t}){let{data:n}=g(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=b(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,O.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,O.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,O.jsx)(o,{value:t})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,O.jsx)(`div`,{className:`kseg-spacer`}),(0,O.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>C(`#/diff`),title:`Open changes`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,O.jsx)(o,{value:r})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,O.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function M({overview:e}){return(0,O.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,O.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>C(`#/section/`+t),children:[(0,O.jsxs)(`div`,{className:`gtop`,children:[(0,O.jsx)(`span`,{className:`gname`,children:r.label}),(0,O.jsx)(m,{name:r.icon,className:`gicon`})]}),(0,O.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,O.jsx)(o,{value:i})}),(0,O.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function N({jobs:e}){if(!e||e.length===0)return(0,O.jsx)(`div`,{className:`feed`,children:(0,O.jsxs)(`div`,{className:`empty`,children:[(0,O.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=u(e,8);return(0,O.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,O.jsxs)(`div`,{className:`feed-row`,children:[(0,O.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,O.jsx)(`span`,{className:`feed-txt`,children:(0,O.jsx)(`b`,{children:e.action})}),(0,O.jsxs)(`span`,{className:`feed-when`,children:[S(e.started),` ago`]})]},e.id))})}function P({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,O.jsxs)(`div`,{className:`ring-box`,children:[(0,O.jsx)(w,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,O.jsxs)(`div`,{className:`ring-center`,children:[(0,O.jsxs)(`div`,{className:`pct`,children:[n,(0,O.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,O.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function F({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=D(e,i?.tone),s=v(e,n,i?.tone);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,O.jsxs)(`div`,{className:`hero`,children:[(0,O.jsx)(P,{value:s}),(0,O.jsxs)(`div`,{className:`hero-facts`,children:[(0,O.jsx)(`div`,{className:`ttl`,children:o}),(0,O.jsx)(A,{verdict:i?.verdict}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,O.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,O.jsxs)(`div`,{className:`hero-chips`,children:[(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`voice`}),(0,O.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`mode`}),(0,O.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,O.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`built`}),(0,O.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`fp`}),(0,O.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,O.jsx)(j,{overview:e,dataRev:a}),(0,O.jsxs)(`div`,{className:`grid split-status`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Capability genome`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,O.jsx)(M,{overview:e})]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Recent activity`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`badge acc`,children:[(0,O.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,O.jsx)(N,{jobs:r})]})]})]})}function I({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,O.jsxs)(`div`,{className:`strand`,children:[(0,O.jsxs)(`span`,{className:`strand-name`,children:[(0,O.jsx)(`span`,{className:`strand-dot`}),(0,O.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,O.jsx)(`span`,{className:`strand-val`,children:i})]})}function L(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 R({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=h(e.counts),o=n?.version_verdict||``,s=L(o),l=b(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,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`mb-16`,children:(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,O.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,O.jsxs)(`div`,{className:`lineage-track`,children:[(0,O.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,O.jsxs)(`div`,{className:`lineage-step`,children:[(0,O.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,O.jsx)(`div`,{className:`lt`,children:e}),(0,O.jsx)(`div`,{className:`ld`,children:t}),(0,O.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,O.jsx)(`hr`,{className:`hr`}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,O.jsx)(A,{verdict:i?.verdict}),s&&(0,O.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,O.jsx)(`span`,{className:`dot`}),s.label]}),(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,O.jsxs)(`div`,{className:`grid split-even`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Genome strand`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,O.jsx)(I,{k:t,overview:e,max:a},t))]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Recent activity`})}),(0,O.jsx)(N,{jobs:r})]})]})]})}function z({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=h(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=b(e.diff);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,O.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,O.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`status`}),(0,O.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,O.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,O.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,O.jsx)(A,{verdict:r?.verdict})]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`voice`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`mode`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,O.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,O.jsxs)(`span`,{className:`badge ok`,children:[(0,O.jsx)(`span`,{className:`dot`}),`clean`]}):(0,O.jsxs)(`span`,{className:`badge warn`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`edits`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,O.jsxs)(`div`,{className:`grid split-operator`,children:[(0,O.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,O.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,O.jsx)(`h3`,{children:`Sections`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,O.jsxs)(`table`,{className:`tbl`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`Section`}),(0,O.jsx)(`th`,{children:`Detail`}),(0,O.jsx)(`th`,{style:{width:130},children:`Share`}),(0,O.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,O.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,O.jsxs)(`tr`,{className:`clickable`,children:[(0,O.jsx)(`td`,{className:`name`,children:(0,O.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,O.jsx)(`td`,{className:`muted`,children:n.desc}),(0,O.jsx)(`td`,{children:(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,O.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Run log`})}),(0,O.jsx)(N,{jobs:n})]})]})]})}var B=Symbol(`failed`),V=e=>Promise.resolve().then(e).catch(()=>B);function H({dataRev:e,needDoctor:t}){let n=g(()=>V(()=>i.fleet()),[e]),r=g(()=>t?V(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===B?`failed`:`ok`,s=o===`ok`?a:null,c=s?_(s):null,l=r.data,u=t?l==null?`loading`:l===B?`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 U=e({default:()=>q}),W=(0,T.lazy)(()=>x(()=>import(`./GreenhouseView-R6epl1PY.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),G=(0,T.lazy)(()=>x(()=>import(`./OperatorHudView-NW_xAOj1.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),K=(0,T.lazy)(()=>x(()=>import(`./JournalView-DKqMrN35.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function q({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:u}){let m=c,[h,_]=(0,T.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,b=H({dataRev:u,needDoctor:m===`greenhouse`||m===`operator`}),{data:x}=g(()=>m===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[m,u]);if(!e)return t?(0,O.jsx)(y,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,O.jsx)(d,{});let S=e.daemon_stale?(0,O.jsx)(f,{}):null;return e.deployed?h===`status`&&m===`journal`?(0,O.jsxs)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:[S,(0,O.jsx)(K,{overview:e,recent:x,lens:b,onDirection:_,dataRev:u})]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(`div`,{className:`head-row`,children:(0,O.jsx)(p,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,O.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>_(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,O.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&m===`cultivar`&&(0,O.jsx)(F,{overview:e,sigil:v,setup:a,jobs:o,lens:b,dataRev:u}),h===`status`&&m===`greenhouse`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(W,{overview:e,sigil:v,jobs:o,lens:b,onAction:s})}),h===`status`&&m===`operator`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(G,{overview:e,jobs:o,lens:b})}),h===`lineage`&&(0,O.jsx)(R,{overview:e,sigil:v,setup:a,jobs:o,lens:b}),h===`operator`&&(0,O.jsx)(z,{overview:e,setup:a,jobs:o,lens:b})]},h)]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(l,{onAction:s})]})}export{q as default,A as n,D as r,U as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
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{$ as i,J as a,Q as o,U as s,X as c,a as l,at as u,c as d,et as f,ft as p,i as m,n as ee,o as te,q as h,r as g,s as _,yt as v}from"./index-
|
|
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{$ as i,J as a,Q as o,U as s,X as c,a as l,at as u,c as d,et as f,ft as p,i as m,n as ee,o as te,q as h,r as g,s as _,yt as v}from"./index-DMDF5Y3Y.js";import{t as y}from"./EmptyState-1sPNleqv.js";import{a as ne,n as re,o as b,r as x,t as S}from"./RailCats-BtIstKaH.js";import{i as C,n as w,r as T}from"./Markdown-DpmmtW2Y.js";var E=e(t(),1);function D(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 O(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 k(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||D(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 A(e){let t={ids:new Set,idx:0,toc:[]},n=n=>k(w(n,e?.links),t);if(e?.rows){let[r,i]=O(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var j=n(),M={"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`]},N=`you already know this`,P=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function F(e){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)}let i=document.createElement(`button`);i.type=`button`,i.className=`btn ghost sm`,i.setAttribute(`aria-label`,`Copy command`),i.textContent=`Copy`,n.append(i),e.replaceWith(t),t.append(n,e)})}function I(e){let t=(e.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``);navigator.clipboard?.writeText?.(t)?.catch?.(()=>{})}function L({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,E.useRef)(null),o=(0,E.useMemo)(()=>A({body:e.body,links:e.links}).html,[e.body,e.links]);(0,E.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(N)&&e.classList.add(`analogy`)}),F(e))},[o]),(0,E.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`.docs-code figcaption button`);if(t)return I(t.closest(`.docs-code`));let n=e.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`);r&&r.startsWith(`#/`)&&(e.preventDefault(),v(r))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[o]),(0,E.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=M[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>D(e.textContent||``)===D(i))),o?.classList.add(`docs-here`)},[o,e.id,t?.emit]);let c=[];return e.id===`install`&&(c.push({label:`Run doctor`,action:`doctor`}),c.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&c.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&c.push({label:`Update`,action:`update`}),(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{eyebrow:r&&`${r} · ${P(e.body)} min read`,title:e.title,sub:i,actions:c.length>0&&c.map(e=>e.hash?(0,j.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,j.jsx)(`div`,{className:`doc-meta`,children:(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),e.source]})}),(0,j.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:o}}),e.link&&(0,j.jsx)(`div`,{className:`doc-link`,children:(0,j.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var R=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`),z=1200;function B({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,j.jsxs)(`div`,{className:`cli-arg`,children:[(0,j.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,j.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,j.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function V({text:e}){let[t,n]=(0,E.useState)(!1);return(0,j.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),z)}catch{}},title:`Copy command`,children:[(0,j.jsx)(u,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function H({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,j.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,j.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,j.jsxs)(`div`,{className:`stack gap-4`,children:[(0,j.jsx)(`h2`,{id:R(e.name),children:(0,j.jsx)(`code`,{children:e.name})}),e.help&&(0,j.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,j.jsx)(V,{text:`${t} ${e.name}`})]}),(0,j.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,j.jsxs)(`div`,{className:`cli-block`,children:[(0,j.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,j.jsx)(B,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,j.jsxs)(`div`,{className:`cli-block`,children:[(0,j.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,j.jsx)(B,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function U({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:(0,j.jsxs)(j.Fragment,{children:[`Every subcommand of `,(0,j.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,j.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,j.jsx)(`div`,{children:n.map(e=>(0,j.jsx)(H,{cmd:e,prog:t},e.name))})]})}function W({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:(0,j.jsxs)(j.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,j.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,j.jsx)(`div`,{className:`card pad-md`,children:(0,j.jsxs)(`table`,{className:`glossary-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:`Concept`}),(0,j.jsx)(`th`,{children:`Neutral term`}),(0,j.jsxs)(`th`,{children:[`In `,n]}),(0,j.jsx)(`th`,{children:`Meaning`}),(0,j.jsx)(`th`,{children:`In dev terms`})]})}),(0,j.jsx)(`tbody`,{children:t.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:(0,j.jsx)(`strong`,{children:e.label})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{children:e.neutral||`—`})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,j.jsx)(`td`,{className:`dim`,children:e.desc}),(0,j.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var G={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},K=({text:e})=>(0,j.jsx)(`span`,{dangerouslySetInnerHTML:{__html:T(C.parseInline(e||``))}}),q=({kind:e})=>(0,j.jsx)(`span`,{className:`tag ${G[e]||``}`,children:e});function J({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,E.useState)(0),{before:c,after:l}=(0,E.useMemo)(()=>A(e),[e]);if(!e.rows)return(0,j.jsx)(L,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{eyebrow:r&&`${r} · ${P(e.body)} min read`,title:e.title,sub:i}),(0,j.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}}),(0,j.jsxs)(`div`,{className:`docs-map`,children:[(0,j.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,j.jsx)(`span`,{className:`map-piece`,children:(0,j.jsx)(K,{text:e.piece})}),(0,j.jsx)(q,{kind:e.kind}),(0,j.jsx)(`span`,{className:`mono dim map-cost`,children:(0,j.jsx)(K,{text:e.cost})})]})},t))}),u&&(0,j.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,j.jsx)(`h2`,{children:(0,j.jsx)(K,{text:u.piece})}),(0,j.jsx)(q,{kind:u.kind}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Does`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.does})}),(0,j.jsx)(`dt`,{children:`Costs`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.cost})}),(0,j.jsx)(`dt`,{children:`Turn it off`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.off})})]})]})]}),l.trim()&&(0,j.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function Y(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ie(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,E.useSyncExternalStore)(ie,e,()=>null),ae=5,oe=96,se=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ce(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${se(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ae)break;return r}var le=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function Z({page:e,glossaryRows:t}){let n=e?.body,r=(0,E.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:R(e.name),title:e.name,level:2})):A(e).toc,[e]),i=(0,E.useMemo)(()=>ce(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=oe&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,j.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,j.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,j.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,j.jsx)(`ul`,{children:r.map(e=>(0,j.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,j.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),le(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,j.jsxs)(`div`,{className:`docs-gloss`,children:[(0,j.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,j.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,j.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,j.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function ue({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,j.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,j.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,j.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,j.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,j.jsx)(`div`,{className:`card pad-md mb-18`,children:n.map(([e,t])=>(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:e}),(0,j.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,j.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,j.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),`File an issue`]}),(0,j.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function de({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,j.jsx)(h,{error:t,style:{margin:18}});if(!e)return(0,j.jsx)(a,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,j.jsx)(L,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,j.jsx)(J,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,j.jsx)(U,{page:e});case`glossary`:return(0,j.jsx)(W,{page:e});case`about`:return(0,j.jsx)(ue,{page:e});default:return(0,j.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function fe(){let e=Y(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function pe(){let e=X(fe);return(0,j.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,j.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function me({page:e,overview:t,onAction:n}){let[s,u]=f(i(t?.emit)),{data:v,error:y}=p(()=>r.docs(s),[s]),C=e||Q(v),{data:w,error:T,loading:D}=p(()=>C?r.docsPage(C,s):Promise.resolve(null),[C,s]),{data:O}=p(()=>r.docsPage(`glossary`,s).catch(()=>null),[s],`docs:glossary`);(0,E.useEffect)(()=>{if(v&&C&&!v.groups.some(e=>e.pages.some(e=>e.id===C))){let e=Q(v);e&&e!==C&&window.location.replace(l(e))}},[v,C]),(0,E.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[C]);let k=_(v,C),A=k.part||v?.groups?.[0]||null,M=A?.id===g;(0,E.useEffect)(()=>{M&&w?.id===C&&te(C)},[M,w,C]);let N=M?[...d(),C]:[],[P,F]=(0,E.useState)(``),[I,L]=(0,E.useState)(`all`),[R,z]=(0,E.useState)(A?.id);A?.id!==R&&(z(A?.id),F(``),L(`all`));let B=$(A),V=re(B),H=I===`all`?B:B.filter(e=>e.group===I),U=b(H,P);return y?(0,j.jsx)(h,{error:y}):(0,j.jsx)(`div`,{className:`docs-wrap`,children:(0,j.jsxs)(`div`,{className:`library docs-lib`,children:[(0,j.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,j.jsxs)(`div`,{className:`lib-title`,children:[(0,j.jsx)(`p`,{className:`h`,children:`Docs`}),(0,j.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,j.jsx)(c,{"aria-label":`Harness`,children:o.map(e=>(0,j.jsx)(`button`,{className:s===e.id?`on`:``,onClick:()=>u(e.id),"aria-pressed":s===e.id,children:e.label},e.id))}),(0,j.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(v?.groups||[]).map(e=>(0,j.jsxs)(E.Fragment,{children:[(0,j.jsxs)(`a`,{href:e.pages[0]?l(e.pages[0].id):`#/docs`,className:A?.id===e.id?`on`:``,"aria-current":A?.id===e.id?`page`:void 0,children:[e.label,(0,j.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),A?.id===e.id&&(0,j.jsx)(S,{label:`Sections`,total:B.length,cats:V,cat:I,onChange:L})]},e.id))})]}),(0,j.jsx)(ne,{label:A?.label||`Docs`,count:P.trim()?`${U.length} of ${H.length}`:H.length||``,extra:M&&(0,j.jsx)(m,{pages:A.pages,seen:N}),q:P,onQ:F,matched:U.length,inView:[A?.id,C],children:v?(0,j.jsx)(x,{rows:U,activeName:C,hrefOf:e=>l(e.name),pills:M?e=>N.includes(e.name)&&e.name!==C?(0,j.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,j.jsx)(a,{label:`Loading docs…`})}),(0,j.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[(0,j.jsx)(pe,{}),k.page&&(0,j.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,j.jsx)(`a`,{href:l(k.part.pages[0].id),children:k.part.label}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`a`,{href:l(k.part.pages.find(e=>(e.section||`General`)===k.section).id),children:k.section}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`span`,{"aria-current":`page`,children:k.page.title})]}),(0,j.jsxs)(`div`,{className:`docs-read`,children:[(0,j.jsxs)(`div`,{className:`docs-article`,children:[(0,j.jsx)(de,{data:D?null:w,error:T,overview:t,onAction:n,place:k},`${C}|${s}`),!D&&(0,j.jsx)(ee,{menu:v,pageId:C})]}),!D&&(0,j.jsx)(Z,{page:w,glossaryRows:O?.rows})]})]})]})})}export{me as default,$ as docRows};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{F as a,I as o,P as s,at as c,st as l,ut as u,z as d}from"./index-
|
|
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{F as a,I as o,P as s,at as c,st as l,ut as u,z as d}from"./index-DMDF5Y3Y.js";import{n as f,r as p}from"./Dashboard-gYZLE4r3.js";e();var m=t(),h=12,g=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],_=650;function v({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let a=e.reduce((e,t)=>e+t.n,0);return(0,m.jsxs)(`div`,{className:`ring-box`,children:[(0,m.jsx)(d,{segments:e,size:t,stroke:r,label:i,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(n,{value:a,duration:_})}),(0,m.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function y(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function b({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=y(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,m.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,m.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function x({label:e,value:t,sub:n,color:r,icon:i}){return(0,m.jsxs)(`div`,{className:`b-tile`,children:[(0,m.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,m.jsx)(c,{name:i})}),(0,m.jsxs)(`div`,{className:`b-tile-body`,children:[(0,m.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,m.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,m.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function S({overview:e,sigil:t,jobs:d,lens:_,onAction:y}){let S=e.counts||{},C=_?.doctor?.state||`loading`,w=_?.doctor?.data?.groups||[],T=C===`ok`,E=w.filter(e=>e.problems.length===0).length,D=w.length,O=p(e,_?.tone),k=o(d,h),A=l(e.diff),j=i.filter(e=>(S[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:S[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),M=j.reduce((e,t)=>e+t.n,0),N=s(d||[],10),P=N.reduce((e,t)=>e+t.v,0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`b-greet`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,m.jsx)(`h2`,{className:`h b-h`,children:O}),(0,m.jsx)(f,{verdict:_?.verdict}),(0,m.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,m.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,m.jsxs)(`div`,{className:`card b-hero`,children:[(0,m.jsx)(`div`,{className:`b-hero-ring`,children:(0,m.jsx)(v,{segments:[{key:`pass`,label:`pass`,n:E,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(D-E,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,m.jsxs)(`div`,{className:`b-hero-side`,children:[(0,m.jsx)(`h3`,{className:`b-hero-title`,children:T?`${E} of ${D} checks pass`:C===`failed`?`Doctor did not answer`:`Checking…`}),C===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>y(`doctor`),children:[(0,m.jsx)(c,{name:`doctor`}),`Run doctor`]}),(0,m.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,m.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),T&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:w.map(e=>{let t=e.problems.length===0;return(0,m.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,m.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,m.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,m.jsxs)(`div`,{className:`b-chips`,children:[(0,m.jsxs)(`span`,{className:`b-chip`,children:[(0,m.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,m.jsx)(`span`,{className:`b-chip`,children:(0,m.jsx)(`b`,{children:e.emit})}),(0,m.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,m.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,m.jsxs)(`div`,{className:`b-tiles`,children:[(0,m.jsx)(x,{label:`Agents`,value:S.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:S.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:S.laws??`—`,sub:S.doctrines?`${S.doctrines.active}/${S.doctrines.total} packs · ${S.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Edits`,value:A,sub:`to graft`,color:g[3],icon:`changes`})]})]}),(0,m.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,m.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Capability mix`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[M,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:j,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:j.map(e=>(0,m.jsxs)(`div`,{className:`b-leg-row`,children:[(0,m.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,m.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,m.jsx)(`span`,{className:`b-leg-bar`,children:(0,m.jsx)(`i`,{style:{width:`${e.n/M*100}%`,background:e.color}})}),(0,m.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent runs`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`badge ok`,children:[(0,m.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,m.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,m.jsx)(`span`,{className:`b-stat-big`,children:(0,m.jsx)(n,{value:P})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,T&&D>0&&` · ${E}/${D} checks pass now`]})]}),(0,m.jsx)(b,{data:N,accent:g[0],height:156})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent activity`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[`last `,k.length,` runs`]})})]}),(0,m.jsxs)(`div`,{className:`b-timeline`,children:[k.map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`,r=a(e);return(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,m.jsxs)(`div`,{className:`b-tl-body`,title:r.command||void 0,children:[(0,m.jsx)(`b`,{children:r.verb}),[r.scope,r.result,r.duration].map(e=>e?` · ${e}`:``).join(``)]}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:e.started?`${u(e.started)} ago`:`—`})]},e.id)}),(!d||d.length===0)&&(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node`}),(0,m.jsx)(`div`,{className:`b-tl-body sub`,children:`No runs yet. Trigger an action to populate this.`}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:`—`})]})]})]})]})}export{S 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-D2VlAlpK.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-ByiD3mPQ.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-Bz6_5yec.js";var F=e(t(),1),I=n();function L({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 R(){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 z({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 B={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ee({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]=B[e.state]||B.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)(z,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(R,{}):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 V=(e,t)=>`${e} ${t}`,te=[`claude`,`bob`,`openclaude`],H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]};function ne(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 re({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:ne(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]=H[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.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`tag ${c}`,children:i})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(re,{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 U({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:x}=f(()=>r.mcp(),[s]),{data:S,error:C}=f(()=>r.fleet(),[s]),w=C?null:S??void 0,[T,D]=(0,F.useState)(null),[O,k]=(0,F.useState)(``),[A,j]=(0,F.useState)({}),[M,P]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),B=e=>R.id===e?.id?R.value:`keep`,[H,ne]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=V(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(),x()}});if(!p||!v)return(0,I.jsx)(a,{});let U={active:0,disabled:1,absent:2},W=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(U[e.state]??3)-(U[t.state]??3)),G=W.find(e=>e.id===H)||W.find(e=>e.selected)||W.find(e=>e.state===`active`)||W[0],K=e=>{let t=A[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)=>j(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),q=e=>{let t=K(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||[]},ce=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=K(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})},le=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`})){k(e.id),D(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(`, `):``;D({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}c?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&te.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ue=async e=>{let t=B(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`})){k(e.id),D(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){D({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&D({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){D({text:e.message,tone:`bad`})}finally{k(``)}}},de=async e=>{D(null);try{let t=await r.mcpReveal(e.path);D({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){D({text:e.message,tone:`bad`})}},fe=W.find(e=>e.selected)?.host||W.find(e=>e.state===`active`)?.host||W[0]?.host||`opencode`,X=W.filter(e=>e.scope===`global`),Z=W.filter(e=>e.scope!==`global`),Q=e=>{ne(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:[W.filter(e=>e.state===`active`).length,` active of `,W.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>e(`build-all`),children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,I.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.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:G?.id,onPick:Q,label:`Global installs`,fleet:w,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:()=>P(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),M?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(L,{host:fe,theme:n||`neutral`,options:J,onAction:e,onClose:()=>P(!1),onNote:e=>D(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:G?.id,onPick:Q,label:`Per-project installs`,fleet:w,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})]}),G?(0,I.jsx)(ee,{inst:G,targets:re[V(G.host,G.path)]||[],choice:K(G),unchanged:q(G),options:J,onPick:(e,t)=>se(G,e,t),canAct:!!e,busy:O===G.id,memory:B(G),onMemory:e=>z({id:G.id,value:e}),onApply:()=>ce(G),onToggleInstall:()=>le(G),onRemove:()=>ue(G),onRevealMcp:de},G.id):null]})}function W({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 G(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var K=300;function se({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<=K?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-DMDF5Y3Y.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-DQLuylEi.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-DCBS0ZWz.js";var F=e(t(),1),I=n();function L({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 R(){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 z({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 B={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ee({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]=B[e.state]||B.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)(z,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(R,{}):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 V=(e,t)=>`${e} ${t}`,te=[`claude`,`bob`,`openclaude`],H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]};function ne(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 re({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:ne(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]=H[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.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`tag ${c}`,children:i})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(re,{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 U({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:x}=f(()=>r.mcp(),[s]),{data:S,error:C}=f(()=>r.fleet(),[s]),w=C?null:S??void 0,[T,D]=(0,F.useState)(null),[O,k]=(0,F.useState)(``),[A,j]=(0,F.useState)({}),[M,P]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),B=e=>R.id===e?.id?R.value:`keep`,[H,ne]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=V(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(),x()}});if(!p||!v)return(0,I.jsx)(a,{});let U={active:0,disabled:1,absent:2},W=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(U[e.state]??3)-(U[t.state]??3)),G=W.find(e=>e.id===H)||W.find(e=>e.selected)||W.find(e=>e.state===`active`)||W[0],K=e=>{let t=A[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)=>j(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),q=e=>{let t=K(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||[]},ce=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=K(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})},le=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`})){k(e.id),D(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(`, `):``;D({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}c?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&te.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ue=async e=>{let t=B(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`})){k(e.id),D(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){D({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&D({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){D({text:e.message,tone:`bad`})}finally{k(``)}}},de=async e=>{D(null);try{let t=await r.mcpReveal(e.path);D({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){D({text:e.message,tone:`bad`})}},fe=W.find(e=>e.selected)?.host||W.find(e=>e.state===`active`)?.host||W[0]?.host||`opencode`,X=W.filter(e=>e.scope===`global`),Z=W.filter(e=>e.scope!==`global`),Q=e=>{ne(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:[W.filter(e=>e.state===`active`).length,` active of `,W.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>e(`build-all`),children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,I.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.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:G?.id,onPick:Q,label:`Global installs`,fleet:w,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:()=>P(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),M?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(L,{host:fe,theme:n||`neutral`,options:J,onAction:e,onClose:()=>P(!1),onNote:e=>D(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:G?.id,onPick:Q,label:`Per-project installs`,fleet:w,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})]}),G?(0,I.jsx)(ee,{inst:G,targets:re[V(G.host,G.path)]||[],choice:K(G),unchanged:q(G),options:J,onPick:(e,t)=>se(G,e,t),canAct:!!e,busy:O===G.id,memory:B(G),onMemory:e=>z({id:G.id,value:e}),onApply:()=>ce(G),onToggleInstall:()=>le(G),onRemove:()=>ue(G),onRevealMcp:de},G.id):null]})}function W({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 G(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var K=300;function se({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<=K?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,L=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=>R(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=>R(e,!1))]}):null]})]});function R(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:()=>L(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 ${G(e)}`,children:e},t))})]},e.rel)}}function q({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 J({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)(q,{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)(q,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,I.jsx)(a,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ce(){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 le(){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 Y=`https://github.com/Arylmera/Geneseed`,ue=`https://github.com/Arylmera`,de=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],fe=[`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:de.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)(Y),[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:ue,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 pe({overview:e,onAction:t,flavour:n,onFlavour:r,accentMode:i,onAccentMode:a,layout:o,onLayout:s}){let f=u(),m=e?.install,h=e?.footprint,v=e?.server,b=e?.daemon_stale,x=async e=>{m&&e!==h&&await f(`Rebuild ${_(m.host).label} · ${m.scope} with the “${e}” footprint? It rebuilds in place, non-destructive.`,{title:`Change the footprint?`,confirmLabel:`Rebuild`})&&t?.(`install`,{...m,footprint:e})},S=v?.autostart===!0?`On · login script`:v?.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:b}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&r&&(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:()=>r(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??``})]}),i&&a&&(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:i,onChange:a,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(i)})]}),o&&s&&(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:o===e.id?`on`:``,onClick:()=>s(e.id),"aria-pressed":o===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===o)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:(0,I.jsxs)(`button`,{className:`btn`,onClick:()=>t(`update`),children:[(0,I.jsx)(d,{name:`download`}),`Update (git pull + rebuild)`]}),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`]})}),m&&h&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`footprint-label`,children:`Harness footprint`}),help:(0,I.jsxs)(I.Fragment,{children:[`For `,_(m.host).label,` · `,m.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),children:[(0,I.jsx)(c,{"aria-labelledby":`footprint-label`,children:[`lean`,`full`].map(e=>(0,I.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>x(e),"aria-pressed":h===e,children:e},e))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:h===`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`,v?` · pid ${v.pid} · up ${w(v.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(le,{}),children:b?(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:S})}),(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:fe.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)(ce,{})}),(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 me({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)(U,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(W,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(se,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(J,{dataRev:o}),e===`server`&&(0,I.jsx)(pe,{overview:t,onAction:i,...c})]})}export{me 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-D2VlAlpK.js";import{n as z}from"./Dashboard-CnO_bsfz.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-DMDF5Y3Y.js";import{n as z}from"./Dashboard-gYZLE4r3.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-
|
|
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-DMDF5Y3Y.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)}}}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,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-D2VlAlpK.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-Bz6_5yec.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=({type:e,names:t,listed:n})=>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:`Installed when this kit is on`,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function E({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[];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)(T,{type:`skill`,names:e.skills||[],listed:r?.skills}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(T,{type:`agent`,names:e.agents||[],listed:r?.agents}),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 D=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,O=e=>`${e.host} · ${e.scope}`;function k(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 A({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,...k(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=`on in ${u} of ${D(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)(T,{type:`skill`,names:s,listed:r?.skills}):null,c.length?(0,b.jsx)(T,{type:`agent`,names:c,listed:r?.agents}):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=>`${O(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${O(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function j({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:O(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=k(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 ${O(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 M({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?`${D(a,`change`)} on ${D(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[O(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 ${O(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 ${O(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function N({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)(E,{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?`${D(p.length,`kit`)} · ${D(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)(A,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(j,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(M,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{N 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-DMDF5Y3Y.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-DCBS0ZWz.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=({type:e,names:t,listed:n})=>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:`Installed when this kit is on`,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function E({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[];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)(T,{type:`skill`,names:e.skills||[],listed:r?.skills}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(T,{type:`agent`,names:e.agents||[],listed:r?.agents}),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 D=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,O=e=>`${e.host} · ${e.scope}`;function k(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 A({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,...k(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=`on in ${u} of ${D(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)(T,{type:`skill`,names:s,listed:r?.skills}):null,c.length?(0,b.jsx)(T,{type:`agent`,names:c,listed:r?.agents}):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=>`${O(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${O(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:p})]}):null]})]})}function j({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:O(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=k(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 ${O(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 M({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?`${D(a,`change`)} on ${D(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[O(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 ${O(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 ${O(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function N({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)(E,{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?`${D(p.length,`kit`)} · ${D(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)(A,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(j,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(M,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{N as default};
|