geneseed 3.1.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/README.md +2 -2
- package/SHIPPED.md +3 -3
- package/bin/build-driver.mjs +127 -79
- package/bin/geneseed-cli.mjs +42 -84
- package/bin/geneseed-hook.mjs +5 -2
- package/harness.config.json +1 -1
- package/js/README.md +1 -10
- package/js/build/emit-claude.mjs +4 -5
- package/js/build/emit-common.mjs +63 -114
- package/js/build/emit-opencode.mjs +74 -66
- package/js/build/generate.mjs +4 -6
- package/js/build/render.mjs +13 -13
- package/js/build/source.mjs +7 -6
- package/js/build/stubs.mjs +25 -33
- package/js/build/themes.mjs +1 -1
- package/js/build/version.mjs +1 -3
- package/js/hosts/hooks.mjs +3 -3
- package/js/hosts/hosts.mjs +2 -4
- package/js/hosts/installs.mjs +35 -28
- package/js/hosts/link.mjs +1 -1
- package/js/hosts/native.mjs +37 -19
- package/js/hosts/opencode.mjs +39 -28
- package/js/hosts/settings.mjs +33 -110
- package/js/inspect/checks-authoring.mjs +5 -4
- package/js/inspect/checks-build.mjs +1 -1
- package/js/inspect/diff.mjs +1 -3
- package/js/inspect/doctor.mjs +59 -44
- package/js/inspect/excludes.mjs +4 -10
- package/js/inspect/inventory.mjs +37 -55
- package/js/inspect/registry.mjs +4 -7
- package/js/inspect/scan.mjs +8 -15
- package/js/inspect/status.mjs +1 -1
- package/js/lib/fs.mjs +34 -0
- package/js/lib/json.mjs +28 -1
- package/js/lib/paths.mjs +0 -10
- package/js/lib/udiff.mjs +11 -16
- package/js/maintain/memory.mjs +2 -4
- package/js/maintain/migrate.mjs +3 -3
- package/js/maintain/uninstall.mjs +90 -78
- package/js/maintain/update.mjs +2 -2
- package/js/ui/anim.mjs +1 -1
- package/js/ui/menu.mjs +1 -1
- package/js/ui/tui.mjs +3 -20
- package/js/web/actions.mjs +230 -217
- package/js/web/activity.mjs +71 -89
- package/js/web/api.mjs +133 -224
- package/js/web/daemon.mjs +92 -110
- package/js/web/docs.mjs +66 -111
- package/js/web/graph.mjs +0 -0
- package/js/web/handler.mjs +78 -97
- package/js/web/jobs.mjs +124 -165
- package/js/web/routes.mjs +73 -152
- package/js/web/server.mjs +47 -82
- package/package.json +1 -1
- package/src/agents/explorer.md +2 -1
- package/src/doctrines/process.md +4 -2
- package/src/laws/universal.md +55 -43
- package/src/skills/clarify.md +1 -1
- package/src/skills/forge-mcp.md +2 -1
- package/src/skills/fresh-eyes.md +1 -1
- package/src/skills/ingest.md +2 -1
- package/src/skills/parallel-agents.md +1 -1
- package/src/skills/ponytail.md +2 -2
- package/src/skills/research.md +4 -2
- package/themes/_TEMPLATE.json +2 -0
- package/themes/biker.json +2 -0
- package/themes/commentator.json +2 -0
- package/themes/cyberpunk.json +2 -0
- package/themes/gamer.json +2 -0
- package/themes/imperial.json +2 -0
- package/themes/joker.json +2 -0
- package/themes/marvin.json +2 -0
- package/themes/mean.json +2 -0
- package/themes/military.json +2 -0
- package/themes/neutral.json +2 -0
- package/themes/pirate.json +2 -0
- package/themes/sports.json +2 -0
- package/themes/verstappen.json +2 -0
- package/themes/wizard.json +2 -0
- package/web/dist/assets/{Activity-B49fE_ug.js → Activity-BTCG2gMl.js} +1 -1
- package/web/dist/assets/{ActivityDetail-abt7hzD2.js → ActivityDetail-julsmPDB.js} +1 -1
- package/web/dist/assets/CatalogRow-DqS4e5XM.js +1 -0
- package/web/dist/assets/Diff-CIrGbiqm.js +5 -0
- package/web/dist/assets/Doctor-CpI53oHY.js +1 -0
- package/web/dist/assets/{Graph-DvYMtlvl.js → Graph-CS4tA7YS.js} +1 -1
- package/web/dist/assets/Harness-vRYs11kX.js +1 -0
- package/web/dist/assets/Laws-BjbHJrJt.js +3 -0
- package/web/dist/assets/Library-CjC7BAWN.js +1 -0
- package/web/dist/assets/{marked.esm-JKvyS0Pp.js → Markdown-kgpg9EQM.js} +15 -15
- package/web/dist/assets/Profile-CHr-PPf6.js +1 -0
- package/web/dist/assets/{Rules-CfsV1EVy.js → Rules-CsC6hfqk.js} +1 -1
- package/web/dist/assets/Skills-BvatJGfe.js +1 -0
- package/web/dist/assets/{StatusBadge-C9bZOEZk.js → StatusBadge-gRrak0nO.js} +1 -1
- package/web/dist/assets/{activity-Cc0n2jwx.js → activity-B0-FXZCj.js} +1 -1
- package/web/dist/assets/index-BnRWQbZb.js +12 -0
- package/web/dist/assets/index-Bx3I7cRW.js +2 -0
- package/web/dist/assets/index-D0f9tJlA.css +1 -0
- package/web/dist/assets/index-DJOhOwwR.js +1 -0
- package/web/dist/index.html +2 -2
- package/web/src/pages/Laws.jsx +42 -71
- package/web/dist/assets/Diff-D3_bVkih.js +0 -5
- package/web/dist/assets/Doctor-hXp7srsx.js +0 -1
- package/web/dist/assets/Harness-BIWei7N5.js +0 -1
- package/web/dist/assets/Laws-CxmnRdwt.js +0 -3
- package/web/dist/assets/Library-MjbOkHIW.js +0 -1
- package/web/dist/assets/Markdown-Dx_w0faR.js +0 -1
- package/web/dist/assets/Profile-BRFvv2gr.js +0 -1
- package/web/dist/assets/Skills-DArA6IHS.js +0 -1
- package/web/dist/assets/index-Bx3oxZ1o.css +0 -1
- package/web/dist/assets/index-DC3-GlCY.js +0 -1
- package/web/dist/assets/index-DP035wPa.js +0 -12
- package/web/dist/assets/index-dHi-7M-F.js +0 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Activity-BTCG2gMl.js","assets/react-DOpiTn5v.js","assets/activity-B0-FXZCj.js","assets/ActivityDetail-julsmPDB.js","assets/Library-CjC7BAWN.js","assets/Markdown-kgpg9EQM.js","assets/StatusBadge-gRrak0nO.js","assets/Laws-BjbHJrJt.js","assets/roman-DkYN0LX9.js","assets/CatalogRow-DqS4e5XM.js","assets/Rules-CsC6hfqk.js","assets/Profile-CHr-PPf6.js","assets/Skills-BvatJGfe.js","assets/Diff-CIrGbiqm.js","assets/Doctor-CpI53oHY.js","assets/Graph-CS4tA7YS.js","assets/index-DJOhOwwR.js","assets/Harness-vRYs11kX.js","assets/index-Bx3I7cRW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as b,c as vs}from"./react-DOpiTn5v.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&a(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(i){if(i.ep)return;i.ep=!0;const r=n(i);fetch(i.href,r)}})();var Ge={exports:{}},ye={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var bs=b,Ns=Symbol.for("react.element"),ws=Symbol.for("react.fragment"),ks=Object.prototype.hasOwnProperty,_s=bs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ms={key:!0,ref:!0,__self:!0,__source:!0};function Ke(e,t,n){var a,i={},r=null,l=null;n!==void 0&&(r=""+n),t.key!==void 0&&(r=""+t.key),t.ref!==void 0&&(l=t.ref);for(a in t)ks.call(t,a)&&!Ms.hasOwnProperty(a)&&(i[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps,t)i[a]===void 0&&(i[a]=t[a]);return{$$typeof:Ns,type:e,key:r,ref:l,props:i,_owner:_s.current}}ye.Fragment=ws;ye.jsx=Ke;ye.jsxs=Ke;Ge.exports=ye;var s=Ge.exports;const Ss="modulepreload",Es=function(e){return"/"+e},Le={},P=function(t,n,a){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(u=>{if(u=Es(u),u in Le)return;Le[u]=!0;const m=u.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${g}`))return;const j=document.createElement("link");if(j.rel=m?"stylesheet":Ss,m||(j.as="script"),j.crossOrigin="",j.href=u,c&&j.setAttribute("nonce",c),document.head.appendChild(j),m)return new Promise((f,h)=>{j.addEventListener("load",f),j.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${u}`)))})}))}function r(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return i.then(l=>{for(const c of l||[])c.status==="rejected"&&r(c.reason);return t().catch(r)})},As=typeof window<"u"?window.__GENESEED_TOKEN__:"";async function Ze(e){const t=await e.json().catch(()=>({})),n=e.status===403&&(t.error||"").startsWith("forbidden")?"the web server restarted since this page loaded — reload the page, then re-apply your edit":t.error||t.message||e.statusText,a=new Error(n);return a.status=e.status,a.body=t,a}async function E(e){const t=await fetch(e);if(!t.ok)throw await Ze(t);return t.json()}async function T(e,t={}){const n=await fetch(e,{method:"POST",headers:{"X-Geneseed-Token":As||"","Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await Ze(n);return n.json()}const Cs=()=>E("/api/overview"),$s=()=>E("/api/recent"),Ts=()=>E("/api/activity"),Fs=e=>E("/api/activity/"+encodeURIComponent(e)),Os=e=>T("/api/activity",{enabled:e}),Ls=()=>E("/api/setup"),Rs=()=>E("/api/doctor"),Is=()=>E("/api/themes"),Ds=()=>E("/api/graph"),Ps=Object.freeze(Object.defineProperty({__proto__:null,activity:Ts,activityDetail:Fs,activityToggle:Os,doctor:Rs,graph:Ds,overview:Cs,recent:$s,setup:Ls,themes:Is},Symbol.toStringTag,{value:"Module"})),zs=e=>E(`/api/catalog/${e}`),Bs=(e,t)=>E(`/api/item/${e}/${encodeURIComponent(t)}`),Vs=e=>T("/api/memory/delete",{name:e}),Hs=Object.freeze(Object.defineProperty({__proto__:null,catalog:zs,item:Bs,memoryDelete:Vs},Symbol.toStringTag,{value:"Module"})),Us=()=>E("/api/diff"),Ws=e=>T("/api/actions/restore",{files:e}),Gs=Object.freeze(Object.defineProperty({__proto__:null,diff:Us,restore:Ws},Symbol.toStringTag,{value:"Module"})),Ks=409,Zs=e=>E(`/api/jobs/${e}`),Ys=()=>E("/api/jobs"),qs=e=>T(`/api/jobs/${e}/cancel`);async function Js(e,t){try{return await T(`/api/actions/${e}`,t||{})}catch(n){throw n.status===Ks?new Error("An action is already running."):n}}const Xs=Object.freeze(Object.defineProperty({__proto__:null,action:Js,cancelJob:qs,job:Zs,jobs:Ys},Symbol.toStringTag,{value:"Module"})),Qs=()=>E("/api/mcp"),et=(e,t,n)=>T("/api/mcp",{path:e,name:t,enabled:n}),st=e=>T("/api/reveal",{path:e}),tt=Object.freeze(Object.defineProperty({__proto__:null,mcp:Qs,mcpReveal:st,mcpToggle:et},Symbol.toStringTag,{value:"Module"})),nt=()=>E("/api/installs"),at=(e,t,n)=>T("/api/install",{host:e,path:t,action:n}),it=(e,t,n)=>T("/api/install",{host:e,path:t,action:"remove",memory:n}),rt=(e,t)=>T("/api/view",{host:e,path:t}),ct=()=>T("/api/pick-folder",{}),lt=Object.freeze(Object.defineProperty({__proto__:null,installRemove:it,installToggle:at,installs:nt,pickFolder:ct,selectView:rt},Symbol.toStringTag,{value:"Module"})),ot=()=>E("/api/ping"),dt=()=>T("/api/shutdown"),ht=()=>T("/api/restart"),ut=Object.freeze(Object.defineProperty({__proto__:null,ping:ot,restart:ht,shutdown:dt},Symbol.toStringTag,{value:"Module"})),Ye=e=>e?`?harness=${encodeURIComponent(e)}`:"",mt=e=>E(`/api/docs${Ye(e)}`),xt=(e,t)=>E(`/api/docs/page/${encodeURIComponent(e)}${Ye(t)}`),pt=Object.freeze(Object.defineProperty({__proto__:null,docs:mt,docsPage:xt},Symbol.toStringTag,{value:"Module"})),ft=()=>E("/api/rules"),gt=e=>T("/api/rules",e),jt=e=>T("/api/rules/promote",e),yt=Object.freeze(Object.defineProperty({__proto__:null,rules:ft,rulesMutate:gt,rulesPromote:jt},Symbol.toStringTag,{value:"Module"})),vt=()=>E("/api/profile"),bt=e=>T("/api/profile",e),Nt=Object.freeze(Object.defineProperty({__proto__:null,profile:vt,profileSave:bt},Symbol.toStringTag,{value:"Module"})),wt=()=>E("/api/excludes"),kt=(e,t)=>T("/api/excludes",{action:e,path:t}),_t=Object.freeze(Object.defineProperty({__proto__:null,excludeMutate:kt,excludes:wt},Symbol.toStringTag,{value:"Module"})),C={...Ps,...Hs,...Gs,...Xs,...tt,...lt,...ut,...pt,...yt,...Nt,..._t},Mt=new Set(["activity","diff","settings","harness","harnesses","doctor","themes","graph","library","laws","rules","profile","skills","agents","about"]),St={themes:"harness",harnesses:"harness",about:"settings"};function Et(){const e=()=>{const i=((typeof window<"u"?window.location.hash:"")||"#/").slice(2).split("/").filter(Boolean);return i[0]==="section"?{view:"section",section:i[1]}:i[0]==="item"?{view:"item",type:i[1],name:decodeURIComponent(i[2]||"")}:i[0]==="docs"?{view:"docs",page:decodeURIComponent(i.slice(1).join("/")||"")}:i[0]==="activity"&&i[1]?{view:"activity-detail",sid:decodeURIComponent(i[1])}:Mt.has(i[0])?{view:St[i[0]]||i[0]}:{view:"dashboard"}},[t,n]=b.useState(e);return b.useEffect(()=>{const a=()=>n(e());return window.addEventListener("hashchange",a),()=>window.removeEventListener("hashchange",a)},[]),t}const L=e=>{window.location.hash=e},Re={red:"#FF5C57",green:"#4ED888",yellow:"#E8B53D",blue:"#5B8CFF",magenta:"#C77DFF",cyan:"#3AD4C4",white:"#E9EFEA"},ue={red:"#C53A36",green:"#2FA864",yellow:"#B8862A",blue:"#3C66D8",magenta:"#9A52D6",cyan:"#2BA89B",white:"#AEB8B0"},ce=e=>Re[e]||Re.cyan,At=e=>e==="yellow"||e==="white"||e==="cyan"||e==="green"?"#06100D":"#FFFFFF";function Ct(e,t,n){if(!e)return;const a=n==="light";let i=a?ue[t]||ue.cyan:ce(t),r=a?"#FFFFFF":At(t);a&&t==="white"&&(i="#566B62",r="#FFFFFF"),e.style.setProperty("--accent",i),e.style.setProperty("--accent-2",ue[t]||ue.cyan),e.style.setProperty("--accent-ink",r)}const $t={cultivar:{dark:"#3AD4C4",light:"#127E73",ink:"#06100D",inkLight:"#FFFFFF"},greenhouse:{dark:"#74CE86",light:"#1C8450",ink:"#06140C",inkLight:"#FFFFFF"},operator:{dark:"#E8A23B",light:"#8F5E10",ink:"#1A1306",inkLight:"#FFFFFF"},heirloom:{dark:"#B9A6C6",light:"#6E5A7C",ink:"#1B1622",inkLight:"#FFFFFF"},matrix:{dark:"#19E37C",light:"#0B7A47",ink:"#04140C",inkLight:"#FFFFFF"},aurora:{dark:"#2DE0B8",light:"#0B7D62",ink:"#04231A",inkLight:"#FFFFFF"},perspective:{dark:"#FF7A59",light:"#C24A2C",ink:"#2A0E04",inkLight:"#FFFFFF"},sequencer:{dark:"#5B57E8",light:"#4F46E5",ink:"#FFFFFF",inkLight:"#FFFFFF"},cobalt:{dark:"#2BA8FF",light:"#1668A8",ink:"#021018",inkLight:"#FFFFFF"},cosmic:{dark:"#C081FF",light:"#7A33CC",ink:"#1A0833",inkLight:"#FFFFFF"},neon:{dark:"#DB245C",light:"#D81E5B",ink:"#FFFFFF",inkLight:"#FFFFFF"},atlas:{dark:"#8FD694",light:"#1C8450",ink:"#14200F",inkLight:"#FFFFFF"}};function Tt(e,t,n){const a=$t[t];if(!e||!a)return!1;const i=n==="light";return e.style.setProperty("--accent",i?a.light:a.dark),e.style.setProperty("--accent-2",a.light),e.style.setProperty("--accent-ink",i?a.inkLight:a.ink),!0}const I={agents:{label:"Agents",type:"agent",desc:"capability specialists",icon:"agent"},skills:{label:"Skills",type:"skill",desc:"repeatable workflows",icon:"skill"},laws:{label:"Constitution",type:"law",desc:"ontology, invariants, doctrines",icon:"law"},memory:{label:"Memory",type:"memory",desc:"durable facts",icon:"library"},notebook:{label:"Notebook",type:"notebook",desc:"sovereign space",icon:"notebook"},wiki:{label:"Knowledge",type:"wiki",desc:"knowledge base + setup",icon:"graph"},config:{label:"Config",type:"config",desc:"install metadata",icon:"settings"}},z=["agents","memory","notebook","wiki","config"],si=z.filter(e=>e!=="agents"&&e!=="config"),ti={config:"wiki"},Ft=Object.fromEntries(Object.entries(I).map(([e,t])=>[t.type,e]));function ve(e,t){const[n,a]=b.useState(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return b.useEffect(()=>{try{localStorage.setItem(e,n)}catch{}},[e,n]),[n,a]}const Ot="geneseed-mode";function Lt(){const[e,t]=ve(Ot,a=>a==="light"?"light":"dark");return[e,()=>t(a=>a==="light"?"dark":"light")]}const Rt="geneseed-flavour",It=[{id:"cultivar",short:"Cultivar",name:"Cultivar Evolved",tagline:"The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow."},{id:"greenhouse",short:"Greenhouse",name:"Greenhouse",tagline:"Warm loam dark, fresh sage green, rounded humanist type — the softest, friendliest skin."},{id:"operator",short:"Operator",name:"Operator HUD",tagline:"Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout."},{id:"heirloom",short:"Heirloom",name:"Heirloom",tagline:"Aubergine plum and serif display — the one luxe, calm, editorial skin."},{id:"matrix",short:"Matrix",name:"Matrix",tagline:"Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid."},{id:"aurora",short:"Aurora",name:"Aurora Glass",tagline:"The glass skin — frosted navy panels lit by a cyan-to-violet aurora, airy and weightless."},{id:"perspective",short:"Perspective",name:"Perspective",tagline:"Coral on cool slate, condensed-architectural headings, cards that physically lift off the page."},{id:"sequencer",short:"Sequencer",name:"Sequencer",tagline:"A quant terminal in daylight — indigo on white, Inter, lining numerals on a fine ruled grid."},{id:"cobalt",short:"Cobalt",name:"Cobalt Terminal",tagline:"Electric-blue hacker terminal — all-mono, 2px corners, CRT scanlines on near-black."},{id:"cosmic",short:"Cosmic",name:"Cosmic",tagline:"Violet-magenta nebula on near-black — wide Audiowide wordmark, chamfered sci-fi instrumentation."},{id:"neon",short:"Neon",name:"Neon",tagline:"Neon-noir: hot-pink edge-glow on near-black, all-mono Geist, frosted glass."},{id:"atlas",short:"Atlas",name:"Atlas",tagline:"The field journal — loam dark, sage ink, the codex as a living map."}],Dt=new Set(It.map(e=>e.id)),Pt={a:"cultivar",b:"greenhouse",c:"operator",d:"heirloom",e:"matrix",f:"aurora",g:"perspective",z:"sequencer",cb:"cobalt",cm:"cosmic"};function zt(){return ve(Rt,e=>Dt.has(e)?e:Pt[e]||"cultivar")}const Bt="geneseed-accent",Vt=[{id:"auto",short:"Auto",tagline:"Follows the deployed voice's accent."},{id:"curated",short:"Curated",tagline:"Each theme's own signature colour."}],Ht=new Set(Vt.map(e=>e.id));function Ut(){return ve(Bt,e=>e&&Ht.has(e)?e:"auto")}const Wt="geneseed-layout",Gt=[{id:"auto",short:"Auto",tagline:"Follows the theme."},{id:"cultivar",short:"Cultivar",tagline:"Hero, KPIs & genome grid."},{id:"greenhouse",short:"Greenhouse",tagline:"Ring, tiles & mix donut."},{id:"operator",short:"Operator",tagline:"Dense terminal readout."},{id:"journal",short:"Journal",tagline:"Growth rings & the constitution map."}],qe=new Set(Gt.map(e=>e.id));function Kt(e){return e==="atlas"||e==="greenhouse"?"journal":e==="cobalt"?"greenhouse":e==="operator"?"operator":"cultivar"}function Zt(e,t){return t&&t!=="auto"&&qe.has(t)?t:Kt(e)}function Yt(){return ve(Wt,e=>e&&qe.has(e)?e:"auto")}function qt(e){const[t,n]=b.useState(null),[a,i]=b.useState([]),r=()=>C.overview().then(n).catch(l=>e==null?void 0:e(l));return b.useEffect(()=>{r()},[]),b.useEffect(()=>{C.themes().then(l=>i(l.themes)).catch(()=>{})},[]),{overview:t,themes:a,reload:r}}const Jt=1e3,Xt=30;async function Ie(e=0){await new Promise(t=>setTimeout(t,e));for(let t=0;t<Xt;t++)try{await C.ping();break}catch{await new Promise(n=>setTimeout(n,Jt))}window.location.reload()}const Qt=600;function en({onFinish:e,onError:t}={}){const[n,a]=b.useState([]),[i,r]=b.useState(null),[l,c]=b.useState(!1);return b.useEffect(()=>{C.jobs().then(({jobs:g})=>{if(!g.length)return;a(g.map(f=>({id:f.id,action:f.action,status:f.status,output:f.output||"",duration:f.duration,started:f.started})));const j=g.find(f=>f.status==="running");j&&(r(j.id),c(!0))}).catch(()=>{})},[]),b.useEffect(()=>{var f;if(!i)return;const g=((f=n.find(h=>h.id===i))==null?void 0:f.action)==="update",j=setInterval(async()=>{try{const h=await C.job(i);if(a(y=>{const d=y.findIndex(N=>N.id===i);if(d===-1)return y;const o=y[d],x=h.output||"";if(o.output===x&&o.status===h.status&&o.duration===h.duration)return y;const p=y.slice();return p[d]={...o,output:x,status:h.status,duration:h.duration},p}),h.status!=="running"){if(clearInterval(j),r(null),g){Ie(2e3);return}e==null||e()}}catch{clearInterval(j),g&&Ie(0)}},Qt);return()=>clearInterval(j)},[i]),{runs:n,activeId:i,consoleOpen:l,setConsoleOpen:c,runAction:async(g,j)=>{try{const{job_id:f}=await C.action(g,j),h=g==="build"&&(j!=null&&j.theme)?`build (${j.theme} · ${j.emit})`:g;return a(y=>[...y,{id:f,action:h,status:"running",output:"",started:Date.now()/1e3}]),r(f),c(!0),f}catch(f){t==null||t(f)}},cancelJob:g=>C.cancelJob(g).catch(j=>t==null?void 0:t(j)),clearRuns:()=>a([])}}function Ee(e,t=[]){const[n,a]=b.useState(null),[i,r]=b.useState(""),[l,c]=b.useState(!0),u=b.useRef(e);u.current=e;const m=b.useCallback(()=>(c(!0),r(""),Promise.resolve(u.current()).then(g=>a(g)).catch(g=>r(g.message)).finally(()=>c(!1))),t);return b.useEffect(()=>{m()},[m]),{data:n,error:i,loading:l,reload:m,setData:a}}const Je=60,Xe=3600,sn=86400,_e={seconds:90,minutes:90*Je,hours:36*Xe};function fe(e){const t=Math.max(0,Date.now()/1e3-e);return t<_e.seconds?`${Math.round(t)}s`:t<_e.minutes?`${Math.round(t/Je)}m`:t<_e.hours?`${Math.round(t/Xe)}h`:`${Math.round(t/sn)}d`}function tn(e){return e?e.replace(/\\/g,"/").replace(/^\/?(home|Users)\/[^/]+/i,"~").replace(/^[A-Z]:\/Users\/[^/]+/i,"~"):"~"}const W={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function Qe(e,t){var r,l,c;if(!e)return 0;const n=((l=(r=e.doctor)==null?void 0:r.problems)==null?void 0:l.length)??99,a=(c=e.doctor)!=null&&c.ok?W.doctorClean:n<=W.doctorMinorMax?W.doctorMinor:W.doctorFail,i=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(e.deployed?W.deployed:0)+a+(i?W.versionSynced:0)+(e.diff&&e.diff.missing===0?W.diskClean:0)}const es=e=>Math.max(...z.map(t=>(e==null?void 0:e[t])??0),1),Y=e=>((e==null?void 0:e.edited)??0)+((e==null?void 0:e.added)??0),ss=e=>{var t;return((e==null?void 0:e.laws)??0)+(((t=e==null?void 0:e.doctrines)==null?void 0:t.rules)??0)},nn={dashboard:"M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z",library:"M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4",graph:"M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6",changes:"M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6",doctor:"M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01",themes:"M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3",chevron:"M9 6l6 6-6 6",x:"M6 6l12 12M18 6L6 18",menu:"M4 7h16M4 12h16M4 17h16",play:"M7 5v14l11-7L7 5Z",clear:"M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14",download:"M12 3v12m0 0l-4-4m4 4l4-4M4 19h16",refresh:"M21 12a9 9 0 1 1-3-6.7M21 4v5h-5",folder:"M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z",build:"M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z",arrow:"M5 12h14M13 6l6 6-6 6",external:"M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6",copy:"M9 9h11v11H9zM5 15H4V4h11v1",spark:"M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2",activity:"M3 12h4l2.5-7 5 14 2.5-7H21",agent:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8",layers:"M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5",sun:"M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z",moon:"M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z",power:"M12 3v9M7.5 6.5a7 7 0 1 0 9 0",docs:"M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7",skill:"M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z",law:"M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0",rule:"M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6",profile:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0",notebook:"M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3",about:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01",github:"M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z"};function $({name:e,className:t="glyph",style:n}){return s.jsx("svg",{className:t,style:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("path",{d:nn[e]||""})})}function an({className:e="sprout"}){return s.jsxs("svg",{className:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[s.jsx("path",{d:"M12 21.5v-9",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),s.jsx("path",{d:"M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z",fill:"var(--accent)"}),s.jsx("path",{d:"M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z",fill:"var(--accent)",opacity:".42"}),s.jsx("circle",{cx:"12",cy:"12.4",r:"1.1",fill:"var(--bg)"})]})}const rn=[{hash:"#/",id:"dashboard",label:"Dashboard",icon:"dashboard",match:e=>e.view==="dashboard",tag:()=>"today"},{group:"Codex"},{hash:"#/laws",id:"laws",label:"Constitution",icon:"law",match:e=>e.view==="laws"||e.view==="section"&&e.section==="laws"||e.view==="item"&&e.type==="law",tag:e=>{var t;return((t=e==null?void 0:e.counts)==null?void 0:t.laws)??null}},{hash:"#/rules",id:"rules",label:"Rules",icon:"rule",match:e=>e.view==="rules"},{hash:"#/profile",id:"profile",label:"Profile",icon:"profile",match:e=>e.view==="profile"},{hash:"#/skills",id:"skills",label:"Skills",icon:"skill",match:e=>e.view==="skills"||e.view==="section"&&e.section==="skills"||e.view==="item"&&e.type==="skill",tag:e=>{var t;return((t=e==null?void 0:e.counts)==null?void 0:t.skills)??null}},{hash:"#/agents",id:"agents",label:"Agents",icon:"agent",match:e=>e.view==="agents"||e.view==="section"&&e.section==="agents"||e.view==="item"&&e.type==="agent",tag:e=>{var t;return((t=e==null?void 0:e.counts)==null?void 0:t.agents)??null}},{hash:"#/library",id:"library",label:"Library",icon:"library",match:e=>e.view==="library"||e.view==="section"&&!["laws","skills","agents"].includes(e.section)||e.view==="item"&&!["law","skill","agent"].includes(e.type),tag:e=>e!=null&&e.counts?(e.counts.memory??0)+(e.counts.notebook??0)+(e.counts.wiki??0)+(e.counts.config??0):null},{hash:"#/docs",id:"docs",label:"Docs",icon:"docs",match:e=>e.view==="docs"},{hash:"#/graph",id:"graph",label:"Graph",icon:"graph",match:e=>e.view==="graph"},{group:"Care"},{hash:"#/activity",id:"activity",label:"Activity",icon:"activity",match:e=>e.view==="activity"||e.view==="activity-detail"},{hash:"#/diff",id:"changes",label:"Changes",icon:"changes",match:e=>e.view==="diff",tag:e=>(e!=null&&e.diff?Y(e.diff):null)||null},{hash:"#/doctor",id:"doctor",label:"Doctor",icon:"doctor",match:e=>e.view==="doctor",tag:e=>e!=null&&e.doctor?e.doctor.ok?"clean":e.doctor.problems.length:null,warn:e=>!!(e!=null&&e.doctor)&&!e.doctor.ok},{group:"Setup"},{hash:"#/harness",id:"harness",label:"Harness",icon:"layers",match:e=>e.view==="harness",tag:e=>(e==null?void 0:e.theme)??null},{hash:"#/settings",id:"settings",label:"Settings",icon:"settings",match:e=>e.view==="settings"}];function cn({value:e}){const n=2*Math.PI*30;return s.jsxs("svg",{className:"rv-ring",width:"66",height:"66",viewBox:"0 0 72 72",role:"img","aria-label":`Growth ${Math.round(e*100)} of 100`,children:[s.jsx("circle",{cx:"36",cy:"36",r:30,fill:"none",stroke:"var(--line-2)",strokeWidth:"6"}),s.jsx("circle",{cx:"36",cy:"36",r:30,fill:"none",stroke:"var(--accent)",strokeWidth:"6",strokeLinecap:"round",strokeDasharray:`${n*e} ${n}`,transform:"rotate(-90 36 36)",style:{transition:"stroke-dasharray 1.1s cubic-bezier(.2,.7,.2,1)"}}),s.jsx("text",{className:"rv-ring-num",x:"36",y:"34",textAnchor:"middle",children:Math.round(e*100)}),s.jsx("text",{className:"rv-ring-lbl",x:"36",y:"47",textAnchor:"middle",children:"GROWTH"})]})}function ln({overview:e,setup:t}){if(!e)return null;const n=e.doctor?e.doctor.ok?"clean":`${e.doctor.problems.length} to fix`:"—";return s.jsxs("div",{className:"rail-vitals",children:[s.jsx(cn,{value:Qe(e,t)}),s.jsxs("div",{className:"rv-rows",children:[s.jsxs("div",{children:[s.jsx("span",{children:"Drift"}),s.jsx("b",{children:Y(e.diff)})]}),s.jsxs("div",{children:[s.jsx("span",{children:"Doctor"}),s.jsx("b",{children:n})]}),s.jsxs("div",{children:[s.jsx("span",{children:"Built"}),s.jsx("b",{className:"plain",title:e.build_time||void 0,children:e.build_epoch?fe(e.build_epoch):"never"})]})]})]})}function on({route:e,overview:t,setup:n,onOpenVoice:a,onNavigate:i}){return s.jsxs("aside",{className:"rail",id:"rail-nav","aria-label":"Harness navigation",children:[s.jsxs("button",{className:"rail-brand",onClick:()=>{L("#/"),i==null||i()},title:"Dashboard",children:[s.jsx(an,{}),s.jsxs("div",{className:"brand-text",children:[s.jsxs("span",{className:"brand-name",children:["Gene",s.jsx("b",{children:"seed"})]}),s.jsx("span",{className:"brand-sub",children:"harness console"})]})]}),s.jsx(ln,{overview:t,setup:n}),rn.map((r,l)=>{if(r.group)return s.jsx("div",{className:"rail-group",children:r.group},"g"+l);const c=r.tag?r.tag(t):null,u=r.match(e),m=typeof r.warn=="function"?r.warn(t):!!r.warn;return s.jsx("div",{className:"rail-nav",children:s.jsxs("a",{className:`rail-item ${u?"active":""}`,href:r.hash,"aria-current":u?"page":void 0,title:r.label,onClick:()=>i==null?void 0:i(),children:[s.jsx($,{name:r.icon}),s.jsx("span",{children:r.label}),c?s.jsx("span",{className:"tag",style:m?{color:"var(--warn)"}:null,children:c}):null]})},r.id)}),s.jsx("div",{className:"rail-spacer"}),s.jsx("div",{className:"rail-foot",children:s.jsxs("button",{className:"voice",onClick:a,title:"Switch deployed voice",children:[s.jsx("span",{className:"voice-orb"}),s.jsxs("div",{className:"voice-meta",children:[s.jsx("div",{className:"vk",children:"deployed voice"}),s.jsx("div",{className:"vv",children:(t==null?void 0:t.theme)||"—"})]}),s.jsx($,{name:"chevron",className:"chev glyph"})]})})]})}function dn(){const[e,t]=b.useState(null),[n,a]=b.useState(""),i=b.useRef(null),r=b.useCallback(()=>{if(e||i.current)return i.current;const l=(async()=>{const c=[],u=["laws","skills",...z],m=await Promise.all(u.map(async g=>{try{const j=await C.catalog(g);return{sec:g,items:(j==null?void 0:j.items)||[]}}catch{return{sec:g,items:[]}}}));for(const{sec:g,items:j}of m){const f=I[g];for(const h of j){const y=h.title||h.name;c.push({kind:f.label,sortKey:u.indexOf(g),title:y,desc:h.desc||"",hay:`${y} ${h.desc||""} ${h.name||""}`.toLowerCase(),route:`#/item/${f.type}/${encodeURIComponent(h.name)}`})}}try{const g=await C.mcp(),j=new Set;for(const f of(g==null?void 0:g.targets)||[])for(const h of f.servers||[]){if(j.has(h.name))continue;j.add(h.name);const y=h.label||h.name;c.push({kind:"MCP servers",sortKey:100,title:y,desc:h.desc||"",hay:`${y} ${h.desc||""} ${h.name||""} mcp`.toLowerCase(),route:"#/settings"})}}catch{}try{const g=await C.docs();for(const j of(g==null?void 0:g.groups)||[])for(const f of j.pages||[])c.push({kind:"Docs",sortKey:110,title:f.title,desc:j.label,hay:`${f.title||""} ${f.id||""} ${j.label||""}`.toLowerCase(),route:`#/docs/${encodeURIComponent(f.id)}`})}catch{}return t(c),i.current=null,c})().catch(c=>(i.current=null,a(c.message||String(c)),[]));return i.current=l,l},[e]);return{index:e,error:n,prime:r}}const hn=24;function un(e,t){const n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function ts(e,t){const n=t.toLowerCase().trim();if(!n||!e)return[];const a=[];for(const i of e){const r=un(i,n);r>=0&&a.push({e:i,s:r})}return a.sort((i,r)=>i.s-r.s||i.e.sortKey-r.e.sortKey||i.e.title.localeCompare(r.e.title)),a.slice(0,hn).map(i=>i.e)}function mn({query:e,index:t,loading:n,error:a,active:i,onActive:r,onClose:l}){const c=b.useMemo(()=>ts(t,e),[t,e]),u=b.useRef(null);b.useEffect(()=>{i>=c.length&&r(0)},[c,i,r]),b.useEffect(()=>{var h;const f=(h=u.current)==null?void 0:h.querySelector(`[data-spot-row="${i}"]`);f==null||f.scrollIntoView({block:"nearest"})},[i]);const m=f=>{f&&(L(f.route),l())},g=[];let j=null;return c.forEach((f,h)=>{(!j||j.kind!==f.kind)&&(j={kind:f.kind,rows:[]},g.push(j)),j.rows.push({entry:f,index:h})}),e.trim()?s.jsxs("div",{className:"spotlight",ref:u,id:"spotlight-list",role:"listbox","aria-label":"Search results",children:[a&&!t&&s.jsxs("div",{className:"spot-empty",role:"presentation",children:["Could not load the search index — ",a]}),n&&!t&&!a&&s.jsx("div",{className:"spot-empty",role:"presentation",children:"Loading…"}),!n&&c.length===0&&t&&s.jsxs("div",{className:"spot-empty",role:"presentation",children:["No matches for “",e,"”."]}),g.map(f=>s.jsxs("div",{className:"spot-group",role:"group","aria-label":f.kind,children:[s.jsx("div",{className:"spot-group-head","aria-hidden":"true",children:f.kind}),f.rows.map(({entry:h,index:y})=>s.jsxs("div",{id:`spot-opt-${y}`,"data-spot-row":y,role:"option","aria-selected":y===i,className:`spot-row ${y===i?"on":""}`,onMouseDown:d=>{d.preventDefault(),m(h)},onMouseEnter:()=>r(y),children:[s.jsx("div",{className:"spot-title",children:h.title}),h.desc?s.jsx("div",{className:"spot-desc",children:h.desc}):null]},`${h.route}-${y}`))]},f.kind))]}):null}function xn({value:e,onChange:t}){const n=b.useRef(null),a=b.useRef(null),[i,r]=b.useState(!1),[l,c]=b.useState(0),{index:u,error:m,prime:g}=dn();b.useEffect(()=>{const d=o=>{var p;!((o.metaKey||o.ctrlKey)&&!o.altKey&&o.key.toLowerCase()==="k")&&(o.key!=="/"||o.target.closest("input, textarea, select"))||(o.preventDefault(),(p=n.current)==null||p.focus())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[]),b.useEffect(()=>{if(!i)return;const d=o=>{var x;(x=a.current)!=null&&x.contains(o.target)||r(!1)};return window.addEventListener("mousedown",d),()=>window.removeEventListener("mousedown",d)},[i]);const j=i&&!!e.trim(),f=j&&u?ts(u,e):[],h=l<f.length?`spot-opt-${l}`:void 0,y=d=>{var o,x;if(j)if(d.key==="ArrowDown")d.preventDefault(),c(p=>Math.min(p+1,Math.max(f.length-1,0)));else if(d.key==="ArrowUp")d.preventDefault(),c(p=>Math.max(p-1,0));else if(d.key==="Enter"){const p=f[l];p&&(d.preventDefault(),L(p.route),r(!1),(o=n.current)==null||o.blur())}else d.key==="Escape"&&(d.preventDefault(),e?t(""):(r(!1),(x=n.current)==null||x.blur()))};return s.jsxs("div",{className:"tb-search",ref:a,children:[s.jsx($,{name:"search",className:"mag glyph"}),s.jsx("input",{ref:n,role:"combobox","aria-label":"Search the harness","aria-autocomplete":"list","aria-expanded":j,"aria-controls":j?"spotlight-list":void 0,"aria-activedescendant":h,value:e,onChange:d=>{t(d.target.value),c(0)},onFocus:()=>{r(!0),g()},onKeyDown:y,placeholder:"Search the harness…",title:"Press / to jump here, or Ctrl-K / ⌘K from inside any field"}),s.jsx("span",{className:"kbd",children:"/"}),s.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:j?f.length?`${f.length} results`:"no matches":""}),j&&s.jsx(mn,{query:e,index:u,loading:!u,error:m,active:l,onActive:c,onClose:()=>{var d;r(!1),(d=n.current)==null||d.blur()}})]})}function pn({dataRev:e,onSwitch:t}){const{data:n}=Ee(()=>C.installs(),[e]),a=((n==null?void 0:n.installs)||[]).filter(l=>l.state==="active");if(a.length<2)return null;const i=a.find(l=>l.selected)||a[0],r=async l=>{const c=a.find(u=>u.id===l.target.value);if(c)try{await C.selectView(c.host,c.path),t==null||t()}catch{}};return s.jsxs("div",{className:"row gap-8",style:{alignItems:"center"},title:"Harness the console is viewing",children:[s.jsx("span",{style:{fontSize:12,color:"var(--text-3)"},children:"harness"}),s.jsx("select",{className:"sel","aria-label":"harness to view",value:i.id,onChange:r,children:a.map(l=>s.jsxs("option",{value:l.id,children:[l.host," · ",l.scope]},l.id))})]})}const fn={dashboard:"overview",diff:"diff",doctor:"doctor",harness:"harness",graph:"graph",settings:"settings"};function gn(e){return e.view==="section"?["laws","skills"].includes(e.section)?e.section:"library":e.view==="item"?e.type==="law"?"laws":e.type==="skill"?"skills":"library":fn[e.view]||e.view}function jn({route:e,navOpen:t,onToggleNav:n,target:a,version:i,query:r,onQuery:l,mode:c,onToggleMode:u,onShutdown:m,dataRev:g,onSwitch:j}){return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"tb-menu",onClick:n,"aria-label":t?"Close navigation":"Open navigation","aria-expanded":!!t,"aria-controls":"rail-nav",children:s.jsx($,{name:t?"x":"menu"})}),s.jsxs("div",{className:"prompt",children:[s.jsx("span",{className:"path",children:tn(a)}),s.jsx("span",{className:"sep",children:"$"}),s.jsx("span",{className:"cmd",children:"geneseed"})," ",s.jsxs("span",{className:"flag",children:["--tab=",gn(e)]}),i&&s.jsxs("span",{className:"flag ver",children:[" --version=",i]}),s.jsx("span",{className:"cur"})]}),s.jsx("div",{className:"topbar-spacer"}),s.jsx(pn,{dataRev:g,onSwitch:j}),s.jsx(xn,{value:r,onChange:l}),s.jsx("button",{className:"iconbtn",title:c==="light"?"Switch to dark":"Switch to light",onClick:u,children:s.jsx($,{name:c==="light"?"moon":"sun"})}),s.jsx("button",{className:"iconbtn",title:"Stop server",onClick:m,children:s.jsx($,{name:"power"})})]})}function yn({themes:e,current:t,onPick:n,onClose:a}){const i=b.useRef(null);return b.useEffect(()=>{const r=l=>{i.current&&!i.current.contains(l.target)&&a()};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[a]),s.jsxs("div",{className:"pop",ref:i,children:[s.jsx("div",{className:"tick",style:{padding:"4px 10px 8px"},children:"Switch voice"}),e.map(r=>s.jsxs("div",{className:`pop-item ${r.name===t?"on":""}`,onClick:()=>n(r.name),children:[s.jsx("span",{className:"po",style:{background:ce(r.accent),boxShadow:`0 0 8px ${ce(r.accent)}`}}),s.jsx("span",{className:"pn",children:r.name})]},r.name))]})}const vn=3500;function bn({toast:e,onClose:t}){return b.useEffect(()=>{const n=setTimeout(t,vn);return()=>clearTimeout(n)},[e]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="err"?"alert":"status","aria-live":e.kind==="err"?void 0:"polite",children:[s.jsx("div",{children:e.msg}),s.jsx("div",{style:{marginTop:8},children:s.jsx("button",{className:"btn ghost",onClick:t,children:"Dismiss"})})]})}function Nn({runs:e,open:t,onToggle:n,onClear:a,onCancel:i,busy:r}){const l=b.useRef(null),c=e.length?e[e.length-1].output.length:0;return b.useEffect(()=>{const u=l.current;u&&t&&(u.scrollTop=u.scrollHeight)},[e.length,c,t]),s.jsxs("div",{className:"console",style:{height:"42vh",transform:t?"none":"translateY(calc(42vh - 42px))"},children:[s.jsxs("div",{className:"console-head",onClick:n,children:[s.jsxs("span",{className:"ttl",children:[s.jsx("span",{className:`live ${r?"on":""}`}),"terminal"]}),s.jsx("span",{className:"count",children:e.length}),s.jsxs("div",{className:"right",onClick:u=>u.stopPropagation(),children:[s.jsx("button",{className:"iconbtn",title:"Clear",onClick:a,disabled:!e.length,children:s.jsx($,{name:"clear"})}),s.jsx("button",{className:"iconbtn",title:t?"Collapse":"Expand","aria-expanded":t,onClick:n,children:s.jsx($,{name:"chevron",className:"glyph",style:{transform:t?"rotate(90deg)":"rotate(-90deg)"}})})]})]}),t&&s.jsxs("div",{className:"console-body",ref:l,children:[e.length===0&&s.jsx("div",{className:"console-empty",children:"No commands run yet. Actions you trigger stream here."}),e.map(u=>s.jsxs("div",{className:"run",children:[s.jsxs("div",{className:"run-head",children:[s.jsx("span",{className:"pr",children:"$"}),s.jsx("span",{className:"act",children:u.action}),s.jsx("span",{className:`st ${u.status}`,children:u.status==="running"?"…running":`${u.status==="done"?"✓ done":"✗ failed"}${u.duration?` · ${u.duration}s`:""}`}),u.status==="running"&&i&&s.jsx("button",{className:"iconbtn run-cancel",title:"Cancel this run",onClick:()=>i(u.id),children:s.jsx($,{name:"x"})})]}),u.output&&s.jsx("pre",{className:"run-out",children:u.output})]},u.id))]})]})}const wn=550,De="gs-splash-seen";function kn(){try{if(window.localStorage.getItem(De))return 0;window.localStorage.setItem(De,"1")}catch{}return wn}function _n({ready:e,onDone:t}){const[n,a]=b.useState(!1),[i,r]=b.useState(!1);b.useEffect(()=>{const c=kn();if(!c){a(!0);return}const u=setTimeout(()=>a(!0),c);return()=>clearTimeout(u)},[]),b.useEffect(()=>{e&&n&&r(!0)},[e,n]),b.useEffect(()=>{if(!i)return;const c=setTimeout(()=>t==null?void 0:t(),700);return()=>clearTimeout(c)},[i]);const l=c=>{c.animationName==="splashOut"&&(t==null||t())};return s.jsxs("div",{className:`boot-splash${i?" fading":""}`,"aria-hidden":"true",onAnimationEnd:l,children:[s.jsxs("div",{className:"boot-dial",children:[s.jsxs("svg",{className:"boot-ring",viewBox:"0 0 172 172",children:[s.jsx("circle",{cx:"86",cy:"86",r:"72",fill:"none",stroke:"var(--surface-3)",strokeWidth:"9"}),s.jsx("circle",{cx:"86",cy:"86",r:"50",fill:"none",stroke:"var(--line-2)",strokeWidth:"8",strokeDasharray:"1.2 5.3",opacity:".7"}),s.jsx("circle",{className:"boot-progress",cx:"86",cy:"86",r:"72",fill:"none",stroke:"var(--accent)",strokeWidth:"9",strokeLinecap:"round"})]}),s.jsxs("svg",{className:"boot-sprout",viewBox:"0 0 24 24",children:[s.jsx("path",{className:"bs-stem",d:"M12 21.5v-9",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),s.jsx("path",{className:"bs-leaf bs-leaf-main",d:"M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z",fill:"var(--accent)"}),s.jsx("path",{className:"bs-leaf bs-leaf-back",d:"M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z",fill:"var(--accent)",opacity:".42"}),s.jsx("circle",{cx:"12",cy:"12.4",r:"1.1",fill:"var(--bg)"})]})]}),s.jsxs("div",{className:"boot-status",children:[s.jsx("span",{children:"germinating harness"}),s.jsx("span",{className:"boot-caret"})]})]})}function ns({label:e="Loading…"}){return s.jsx("div",{className:"loading",children:e})}function Mn({value:e,size:t=232}){const n=t/2-14,a=2*Math.PI*n,i=a*(1-e);return s.jsxs("div",{className:"ring-wrap",style:{width:t,height:t},children:[s.jsxs("svg",{viewBox:`0 0 ${t} ${t}`,children:[s.jsx("circle",{cx:t/2,cy:t/2,r:n,fill:"none",stroke:"var(--surface-3)",strokeWidth:"10"}),s.jsx("circle",{cx:t/2,cy:t/2,r:n,fill:"none",stroke:"var(--accent)",strokeWidth:"10",strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:i,style:{transition:"stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1)"}}),Array.from({length:48}).map((r,l)=>{const c=l/48*2*Math.PI,u=n-18,m=n-24,g=t/2+Math.cos(c)*u,j=t/2+Math.sin(c)*u,f=t/2+Math.cos(c)*m,h=t/2+Math.sin(c)*m;return s.jsx("line",{x1:g,y1:j,x2:f,y2:h,stroke:"var(--line-2)",strokeWidth:"1",opacity:l/48<e?.9:.25},l)})]}),s.jsxs("div",{className:"ring-center",children:[s.jsxs("div",{className:"pct",children:[Math.round(e*100),s.jsx("span",{style:{fontSize:20,color:"var(--text-3)"},children:"%"})]}),s.jsx("div",{className:"lbl",children:"germination"})]})]})}function Sn({overview:e}){const t=Y(e.diff),n=e.counts||{},a=[{key:"agents",label:"Agents",hash:"#/agents"},{key:"skills",label:"Skills",hash:"#/skills"},{key:"laws",label:"Invariants",hash:"#/laws"}];return s.jsxs("div",{className:"card kpiband rise mb-16",children:[a.map(i=>{const r=n[i.key];return s.jsxs("a",{className:"kseg",href:i.hash,title:`Open ${i.label}`,children:[s.jsx("span",{className:"kseg-n"+(r===0?" zero":""),children:r??"—"}),s.jsx("span",{className:"kseg-l",children:i.label})]},i.key)}),s.jsx("div",{className:"kseg-spacer"}),s.jsxs("button",{className:"kseg"+(t>0?" hot":""),onClick:()=>L("#/diff"),title:"Open changes",children:[s.jsx("span",{className:"kseg-n"+(t===0?" zero":""),children:t}),s.jsx("span",{className:"kseg-l",children:"Local edits"}),t>0&&s.jsx("span",{className:"delta up",children:"▲"})]})]})}function En({overview:e}){return s.jsx("div",{className:"genome",children:z.map((t,n)=>{var r;const a=I[t],i=(r=e.counts)==null?void 0:r[t];return s.jsxs("div",{className:"card gcell rise",style:{animationDelay:`${n*50}ms`},onClick:()=>L("#/section/"+t),children:[s.jsxs("div",{className:"gtop",children:[s.jsx("span",{className:"gname",children:a.label}),s.jsx($,{name:a.icon,className:"gicon"})]}),s.jsx("div",{className:"gcount"+(i===0?" zero":""),children:i??"—"}),s.jsx("div",{className:"gdesc",children:a.desc})]},t)})})}function Ae({jobs:e}){if(!e||e.length===0)return s.jsx("div",{className:"feed",children:s.jsxs("div",{className:"empty",children:[s.jsx("div",{className:"big",children:"No activity yet"}),"Actions you run appear here."]})});const t={done:"ok",running:"acc",failed:"bad"},n=[...e].sort((a,i)=>i.started-a.started).slice(0,8);return s.jsx("div",{className:"feed",children:n.map(a=>s.jsxs("div",{className:"feed-row",children:[s.jsx("span",{className:`feed-dot ${t[a.status]||"ok"}`}),s.jsx("span",{className:"feed-txt",children:s.jsx("b",{children:a.action})}),s.jsxs("span",{className:"feed-when",children:[fe(a.started)," ago"]})]},a.id))})}const An={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."};function Cn({overview:e,sigil:t,setup:n,jobs:a,onAction:i}){const r=e.deployed?An[e.theme]||"Loaded & ready":"Not deployed",l=Qe(e,n);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"card pad-lg rise mb-16",children:s.jsxs("div",{className:"hero",children:[s.jsx(Mn,{value:l}),s.jsxs("div",{className:"hero-facts",children:[s.jsx("div",{className:"ttl",children:r}),t&&s.jsxs("div",{className:"voice-readout",children:[s.jsx("span",{className:"vr-cur",children:"▕"}),s.jsx("span",{className:"vr-txt",children:t})]},e.theme),s.jsxs("p",{className:"sub",children:["One source rendered into ",s.jsx("code",{children:e.target}),". Every repo on this machine inherits it."]}),s.jsxs("div",{className:"hero-chips",children:[s.jsxs("span",{className:"chip",children:[s.jsx("span",{className:"ck",children:"voice"}),s.jsx("span",{className:"cv",style:{textTransform:"capitalize"},children:e.theme})]}),s.jsxs("span",{className:"chip",children:[s.jsx("span",{className:"ck",children:"mode"}),s.jsx("span",{className:"cv",children:e.emit})]}),s.jsxs("span",{className:"chip",children:[s.jsx("span",{className:"ck",children:"footprint"}),s.jsx("span",{className:"cv",children:e.footprint})]}),s.jsxs("span",{className:"chip",children:[s.jsx("span",{className:"ck",children:"built"}),s.jsx("span",{className:"cv",children:e.build_time||"unknown"})]}),s.jsxs("span",{className:"chip",children:[s.jsx("span",{className:"ck",children:"fp"}),s.jsx("span",{className:"cv",children:(n==null?void 0:n.installed_fp)||"—"})]})]}),s.jsxs("div",{className:"row wrap gap-10",children:[s.jsxs("button",{className:"btn",onClick:()=>i("update"),children:[s.jsx($,{name:"refresh"}),"Update"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>i("build-all"),children:[s.jsx($,{name:"build"}),"Rebuild"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>i("doctor"),children:[s.jsx($,{name:"doctor"}),"Run doctor"]})]})]})]})}),s.jsx(Sn,{overview:e}),s.jsxs("div",{className:"grid split-status",children:[s.jsxs("div",{className:"card pad-lg",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Capability genome"}),s.jsx("div",{className:"right",children:s.jsxs("span",{className:"tick",children:[z.length," sections"]})})]}),s.jsx(En,{overview:e})]}),s.jsxs("div",{className:"card pad-lg",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent activity"}),s.jsx("div",{className:"right",children:s.jsxs("span",{className:"badge acc",children:[s.jsx("span",{className:"dot"}),"live"]})})]}),s.jsx(Ae,{jobs:a})]})]})]})}function $n({k:e,overview:t,max:n}){var r;const a=I[e],i=((r=t.counts)==null?void 0:r[e])??0;return s.jsxs("div",{className:"strand",onClick:()=>L("#/section/"+e),children:[s.jsxs("span",{className:"strand-name",children:[s.jsx("span",{className:"strand-dot"}),s.jsx("span",{children:a.label})]}),s.jsx("div",{className:"hbar",children:s.jsx("i",{style:{width:`${i/n*100}%`}})}),s.jsx("span",{className:"strand-val",children:i})]})}function Tn(e,t){var n,a=1;e==null&&(e=0),t==null&&(t=0);function i(){var r,l=n.length,c,u=0,m=0;for(r=0;r<l;++r)c=n[r],u+=c.x,m+=c.y;for(u=(u/l-e)*a,m=(m/l-t)*a,r=0;r<l;++r)c=n[r],c.x-=u,c.y-=m}return i.initialize=function(r){n=r},i.x=function(r){return arguments.length?(e=+r,i):e},i.y=function(r){return arguments.length?(t=+r,i):t},i.strength=function(r){return arguments.length?(a=+r,i):a},i}function Fn(e){const t=+this._x.call(null,e),n=+this._y.call(null,e);return as(this.cover(t,n),t,n,e)}function as(e,t,n,a){if(isNaN(t)||isNaN(n))return e;var i,r=e._root,l={data:a},c=e._x0,u=e._y0,m=e._x1,g=e._y1,j,f,h,y,d,o,x,p;if(!r)return e._root=l,e;for(;r.length;)if((d=t>=(j=(c+m)/2))?c=j:m=j,(o=n>=(f=(u+g)/2))?u=f:g=f,i=r,!(r=r[x=o<<1|d]))return i[x]=l,e;if(h=+e._x.call(null,r.data),y=+e._y.call(null,r.data),t===h&&n===y)return l.next=r,i?i[x]=l:e._root=l,e;do i=i?i[x]=new Array(4):e._root=new Array(4),(d=t>=(j=(c+m)/2))?c=j:m=j,(o=n>=(f=(u+g)/2))?u=f:g=f;while((x=o<<1|d)===(p=(y>=f)<<1|h>=j));return i[p]=r,i[x]=l,e}function On(e){var t,n,a=e.length,i,r,l=new Array(a),c=new Array(a),u=1/0,m=1/0,g=-1/0,j=-1/0;for(n=0;n<a;++n)isNaN(i=+this._x.call(null,t=e[n]))||isNaN(r=+this._y.call(null,t))||(l[n]=i,c[n]=r,i<u&&(u=i),i>g&&(g=i),r<m&&(m=r),r>j&&(j=r));if(u>g||m>j)return this;for(this.cover(u,m).cover(g,j),n=0;n<a;++n)as(this,l[n],c[n],e[n]);return this}function Ln(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var n=this._x0,a=this._y0,i=this._x1,r=this._y1;if(isNaN(n))i=(n=Math.floor(e))+1,r=(a=Math.floor(t))+1;else{for(var l=i-n||1,c=this._root,u,m;n>e||e>=i||a>t||t>=r;)switch(m=(t<a)<<1|e<n,u=new Array(4),u[m]=c,c=u,l*=2,m){case 0:i=n+l,r=a+l;break;case 1:n=i-l,r=a+l;break;case 2:i=n+l,a=r-l;break;case 3:n=i-l,a=r-l;break}this._root&&this._root.length&&(this._root=c)}return this._x0=n,this._y0=a,this._x1=i,this._y1=r,this}function Rn(){var e=[];return this.visit(function(t){if(!t.length)do e.push(t.data);while(t=t.next)}),e}function In(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function O(e,t,n,a,i){this.node=e,this.x0=t,this.y0=n,this.x1=a,this.y1=i}function Dn(e,t,n){var a,i=this._x0,r=this._y0,l,c,u,m,g=this._x1,j=this._y1,f=[],h=this._root,y,d;for(h&&f.push(new O(h,i,r,g,j)),n==null?n=1/0:(i=e-n,r=t-n,g=e+n,j=t+n,n*=n);y=f.pop();)if(!(!(h=y.node)||(l=y.x0)>g||(c=y.y0)>j||(u=y.x1)<i||(m=y.y1)<r))if(h.length){var o=(l+u)/2,x=(c+m)/2;f.push(new O(h[3],o,x,u,m),new O(h[2],l,x,o,m),new O(h[1],o,c,u,x),new O(h[0],l,c,o,x)),(d=(t>=x)<<1|e>=o)&&(y=f[f.length-1],f[f.length-1]=f[f.length-1-d],f[f.length-1-d]=y)}else{var p=e-+this._x.call(null,h.data),N=t-+this._y.call(null,h.data),v=p*p+N*N;if(v<n){var w=Math.sqrt(n=v);i=e-w,r=t-w,g=e+w,j=t+w,a=h.data}}return a}function Pn(e){if(isNaN(g=+this._x.call(null,e))||isNaN(j=+this._y.call(null,e)))return this;var t,n=this._root,a,i,r,l=this._x0,c=this._y0,u=this._x1,m=this._y1,g,j,f,h,y,d,o,x;if(!n)return this;if(n.length)for(;;){if((y=g>=(f=(l+u)/2))?l=f:u=f,(d=j>=(h=(c+m)/2))?c=h:m=h,t=n,!(n=n[o=d<<1|y]))return this;if(!n.length)break;(t[o+1&3]||t[o+2&3]||t[o+3&3])&&(a=t,x=o)}for(;n.data!==e;)if(i=n,!(n=n.next))return this;return(r=n.next)&&delete n.next,i?(r?i.next=r:delete i.next,this):t?(r?t[o]=r:delete t[o],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(a?a[x]=n:this._root=n),this):(this._root=r,this)}function zn(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this}function Bn(){return this._root}function Vn(){var e=0;return this.visit(function(t){if(!t.length)do++e;while(t=t.next)}),e}function Hn(e){var t=[],n,a=this._root,i,r,l,c,u;for(a&&t.push(new O(a,this._x0,this._y0,this._x1,this._y1));n=t.pop();)if(!e(a=n.node,r=n.x0,l=n.y0,c=n.x1,u=n.y1)&&a.length){var m=(r+c)/2,g=(l+u)/2;(i=a[3])&&t.push(new O(i,m,g,c,u)),(i=a[2])&&t.push(new O(i,r,g,m,u)),(i=a[1])&&t.push(new O(i,m,l,c,g)),(i=a[0])&&t.push(new O(i,r,l,m,g))}return this}function Un(e){var t=[],n=[],a;for(this._root&&t.push(new O(this._root,this._x0,this._y0,this._x1,this._y1));a=t.pop();){var i=a.node;if(i.length){var r,l=a.x0,c=a.y0,u=a.x1,m=a.y1,g=(l+u)/2,j=(c+m)/2;(r=i[0])&&t.push(new O(r,l,c,g,j)),(r=i[1])&&t.push(new O(r,g,c,u,j)),(r=i[2])&&t.push(new O(r,l,j,g,m)),(r=i[3])&&t.push(new O(r,g,j,u,m))}n.push(a)}for(;a=n.pop();)e(a.node,a.x0,a.y0,a.x1,a.y1);return this}function Wn(e){return e[0]}function Gn(e){return arguments.length?(this._x=e,this):this._x}function Kn(e){return e[1]}function Zn(e){return arguments.length?(this._y=e,this):this._y}function is(e,t,n){var a=new Ce(t??Wn,n??Kn,NaN,NaN,NaN,NaN);return e==null?a:a.addAll(e)}function Ce(e,t,n,a,i,r){this._x=e,this._y=t,this._x0=n,this._y0=a,this._x1=i,this._y1=r,this._root=void 0}function Pe(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var R=is.prototype=Ce.prototype;R.copy=function(){var e=new Ce(this._x,this._y,this._x0,this._y0,this._x1,this._y1),t=this._root,n,a;if(!t)return e;if(!t.length)return e._root=Pe(t),e;for(n=[{source:t,target:e._root=new Array(4)}];t=n.pop();)for(var i=0;i<4;++i)(a=t.source[i])&&(a.length?n.push({source:a,target:t.target[i]=new Array(4)}):t.target[i]=Pe(a));return e};R.add=Fn;R.addAll=On;R.cover=Ln;R.data=Rn;R.extent=In;R.find=Dn;R.remove=Pn;R.removeAll=zn;R.root=Bn;R.size=Vn;R.visit=Hn;R.visitAfter=Un;R.x=Gn;R.y=Zn;function re(e){return function(){return e}}function X(e){return(e()-.5)*1e-6}function Yn(e){return e.index}function ze(e,t){var n=e.get(t);if(!n)throw new Error("node not found: "+t);return n}function qn(e){var t=Yn,n=j,a,i=re(30),r,l,c,u,m,g=1;e==null&&(e=[]);function j(o){return 1/Math.min(c[o.source.index],c[o.target.index])}function f(o){for(var x=0,p=e.length;x<g;++x)for(var N=0,v,w,M,A,F,k,D;N<p;++N)v=e[N],w=v.source,M=v.target,A=M.x+M.vx-w.x-w.vx||X(m),F=M.y+M.vy-w.y-w.vy||X(m),k=Math.sqrt(A*A+F*F),k=(k-r[N])/k*o*a[N],A*=k,F*=k,M.vx-=A*(D=u[N]),M.vy-=F*D,w.vx+=A*(D=1-D),w.vy+=F*D}function h(){if(l){var o,x=l.length,p=e.length,N=new Map(l.map((w,M)=>[t(w,M,l),w])),v;for(o=0,c=new Array(x);o<p;++o)v=e[o],v.index=o,typeof v.source!="object"&&(v.source=ze(N,v.source)),typeof v.target!="object"&&(v.target=ze(N,v.target)),c[v.source.index]=(c[v.source.index]||0)+1,c[v.target.index]=(c[v.target.index]||0)+1;for(o=0,u=new Array(p);o<p;++o)v=e[o],u[o]=c[v.source.index]/(c[v.source.index]+c[v.target.index]);a=new Array(p),y(),r=new Array(p),d()}}function y(){if(l)for(var o=0,x=e.length;o<x;++o)a[o]=+n(e[o],o,e)}function d(){if(l)for(var o=0,x=e.length;o<x;++o)r[o]=+i(e[o],o,e)}return f.initialize=function(o,x){l=o,m=x,h()},f.links=function(o){return arguments.length?(e=o,h(),f):e},f.id=function(o){return arguments.length?(t=o,f):t},f.iterations=function(o){return arguments.length?(g=+o,f):g},f.strength=function(o){return arguments.length?(n=typeof o=="function"?o:re(+o),y(),f):n},f.distance=function(o){return arguments.length?(i=typeof o=="function"?o:re(+o),d(),f):i},f}var Jn={value:()=>{}};function rs(){for(var e=0,t=arguments.length,n={},a;e<t;++e){if(!(a=arguments[e]+"")||a in n||/[\s.]/.test(a))throw new Error("illegal type: "+a);n[a]=[]}return new pe(n)}function pe(e){this._=e}function Xn(e,t){return e.trim().split(/^|\s+/).map(function(n){var a="",i=n.indexOf(".");if(i>=0&&(a=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:a}})}pe.prototype=rs.prototype={constructor:pe,on:function(e,t){var n=this._,a=Xn(e+"",n),i,r=-1,l=a.length;if(arguments.length<2){for(;++r<l;)if((i=(e=a[r]).type)&&(i=Qn(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(i=(e=a[r]).type)n[i]=Be(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Be(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pe(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),a=0,i,r;a<i;++a)n[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],i=0,r=a.length;i<r;++i)a[i].value.apply(t,n)}};function Qn(e,t){for(var n=0,a=e.length,i;n<a;++n)if((i=e[n]).name===t)return i.value}function Be(e,t,n){for(var a=0,i=e.length;a<i;++a)if(e[a].name===t){e[a]=Jn,e=e.slice(0,a).concat(e.slice(a+1));break}return n!=null&&e.push({name:t,value:n}),e}var Q=0,ae=0,se=0,cs=1e3,ge,ie,je=0,Z=0,be=0,le=typeof performance=="object"&&performance.now?performance:Date,ls=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function os(){return Z||(ls(ea),Z=le.now()+be)}function ea(){Z=0}function Me(){this._call=this._time=this._next=null}Me.prototype=ds.prototype={constructor:Me,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?os():+n)+(t==null?0:+t),!this._next&&ie!==this&&(ie?ie._next=this:ge=this,ie=this),this._call=e,this._time=n,Se()},stop:function(){this._call&&(this._call=null,this._time=1/0,Se())}};function ds(e,t,n){var a=new Me;return a.restart(e,t,n),a}function sa(){os(),++Q;for(var e=ge,t;e;)(t=Z-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Q}function Ve(){Z=(je=le.now())+be,Q=ae=0;try{sa()}finally{Q=0,na(),Z=0}}function ta(){var e=le.now(),t=e-je;t>cs&&(be-=t,je=e)}function na(){for(var e,t=ge,n,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:ge=n);ie=e,Se(a)}function Se(e){if(!Q){ae&&(ae=clearTimeout(ae));var t=e-Z;t>24?(e<1/0&&(ae=setTimeout(Ve,e-le.now()-be)),se&&(se=clearInterval(se))):(se||(je=le.now(),se=setInterval(ta,cs)),Q=1,ls(Ve))}}const aa=1664525,ia=1013904223,He=4294967296;function ra(){let e=1;return()=>(e=(aa*e+ia)%He)/He}function ca(e){return e.x}function la(e){return e.y}var oa=10,da=Math.PI*(3-Math.sqrt(5));function ha(e){var t,n=1,a=.001,i=1-Math.pow(a,1/300),r=0,l=.6,c=new Map,u=ds(j),m=rs("tick","end"),g=ra();e==null&&(e=[]);function j(){f(),m.call("tick",t),n<a&&(u.stop(),m.call("end",t))}function f(d){var o,x=e.length,p;d===void 0&&(d=1);for(var N=0;N<d;++N)for(n+=(r-n)*i,c.forEach(function(v){v(n)}),o=0;o<x;++o)p=e[o],p.fx==null?p.x+=p.vx*=l:(p.x=p.fx,p.vx=0),p.fy==null?p.y+=p.vy*=l:(p.y=p.fy,p.vy=0);return t}function h(){for(var d=0,o=e.length,x;d<o;++d){if(x=e[d],x.index=d,x.fx!=null&&(x.x=x.fx),x.fy!=null&&(x.y=x.fy),isNaN(x.x)||isNaN(x.y)){var p=oa*Math.sqrt(.5+d),N=d*da;x.x=p*Math.cos(N),x.y=p*Math.sin(N)}(isNaN(x.vx)||isNaN(x.vy))&&(x.vx=x.vy=0)}}function y(d){return d.initialize&&d.initialize(e,g),d}return h(),t={tick:f,restart:function(){return u.restart(j),t},stop:function(){return u.stop(),t},nodes:function(d){return arguments.length?(e=d,h(),c.forEach(y),t):e},alpha:function(d){return arguments.length?(n=+d,t):n},alphaMin:function(d){return arguments.length?(a=+d,t):a},alphaDecay:function(d){return arguments.length?(i=+d,t):+i},alphaTarget:function(d){return arguments.length?(r=+d,t):r},velocityDecay:function(d){return arguments.length?(l=1-d,t):1-l},randomSource:function(d){return arguments.length?(g=d,c.forEach(y),t):g},force:function(d,o){return arguments.length>1?(o==null?c.delete(d):c.set(d,y(o)),t):c.get(d)},find:function(d,o,x){var p=0,N=e.length,v,w,M,A,F;for(x==null?x=1/0:x*=x,p=0;p<N;++p)A=e[p],v=d-A.x,w=o-A.y,M=v*v+w*w,M<x&&(F=A,x=M);return F},on:function(d,o){return arguments.length>1?(m.on(d,o),t):m.on(d)}}}function ua(){var e,t,n,a,i=re(-30),r,l=1,c=1/0,u=.81;function m(h){var y,d=e.length,o=is(e,ca,la).visitAfter(j);for(a=h,y=0;y<d;++y)t=e[y],o.visit(f)}function g(){if(e){var h,y=e.length,d;for(r=new Array(y),h=0;h<y;++h)d=e[h],r[d.index]=+i(d,h,e)}}function j(h){var y=0,d,o,x=0,p,N,v;if(h.length){for(p=N=v=0;v<4;++v)(d=h[v])&&(o=Math.abs(d.value))&&(y+=d.value,x+=o,p+=o*d.x,N+=o*d.y);h.x=p/x,h.y=N/x}else{d=h,d.x=d.data.x,d.y=d.data.y;do y+=r[d.data.index];while(d=d.next)}h.value=y}function f(h,y,d,o){if(!h.value)return!0;var x=h.x-t.x,p=h.y-t.y,N=o-y,v=x*x+p*p;if(N*N/u<v)return v<c&&(x===0&&(x=X(n),v+=x*x),p===0&&(p=X(n),v+=p*p),v<l&&(v=Math.sqrt(l*v)),t.vx+=x*h.value*a/v,t.vy+=p*h.value*a/v),!0;if(h.length||v>=c)return;(h.data!==t||h.next)&&(x===0&&(x=X(n),v+=x*x),p===0&&(p=X(n),v+=p*p),v<l&&(v=Math.sqrt(l*v)));do h.data!==t&&(N=r[h.data.index]*a/v,t.vx+=x*N,t.vy+=p*N);while(h=h.next)}return m.initialize=function(h,y){e=h,n=y,g()},m.strength=function(h){return arguments.length?(i=typeof h=="function"?h:re(+h),g(),m):i},m.distanceMin=function(h){return arguments.length?(l=h*h,m):Math.sqrt(l)},m.distanceMax=function(h){return arguments.length?(c=h*h,m):Math.sqrt(c)},m.theta=function(h){return arguments.length?(u=h*h,m):Math.sqrt(u)},m}const B={maxNodes:28,iterations:150,chargeStrength:-220,linkDistance:46,boundsMargin:{x:16,y:14},edgeCurve:{max:20,scale:.14}},G={baseRadius:{agent:4,law:3,skill:3.2},degreeScale:.45,degreeMax:3.6,hubGlowScale:3.2,hub:{minDegree:3,maxFraction:.55}};function ma({graph:e}){const[a,i]=b.useState(null),{nodes:r,edges:l,pos:c,degrees:u,maxDeg:m}=b.useMemo(()=>{const y={nodes:[],edges:[],pos:new Map,degrees:new Map,maxDeg:0};if(!e||!e.nodes.length)return y;const d=new Map;e.edges.forEach(k=>{d.set(k.source,(d.get(k.source)||0)+1),d.set(k.target,(d.get(k.target)||0)+1)});const x=[...e.nodes].sort((k,D)=>(d.get(D.id)||0)-(d.get(k.id)||0)).slice(0,B.maxNodes),p=new Set(x.map(k=>k.id)),N=e.edges.filter(k=>p.has(k.source)&&p.has(k.target)),v=440/2,w=230/2,M=ha(x.map(k=>({id:k.id}))).force("charge",ua().strength(B.chargeStrength)).force("link",qn(N.map(k=>({source:k.source,target:k.target}))).id(k=>k.id).distance(B.linkDistance)).force("center",Tn(v,w)).stop();for(let k=0;k<B.iterations;k++)M.tick();const A=new Map;M.nodes().forEach(k=>{A.set(k.id,{x:Math.max(B.boundsMargin.x,Math.min(440-B.boundsMargin.x,k.x)),y:Math.max(B.boundsMargin.y,Math.min(230-B.boundsMargin.y,k.y))})});const F=Math.max(1,...d.values());return{nodes:x,edges:N,pos:A,degrees:d,maxDeg:F}},[e]),g=b.useMemo(()=>{if(!a)return null;const y=new Set([a]);return l.forEach(d=>{d.source===a&&y.add(d.target),d.target===a&&y.add(d.source)}),y},[a,l]);if(!r.length)return s.jsx("div",{style:{height:200,display:"grid",placeItems:"center",color:"var(--text-3)",fontSize:13},children:"no cross-links yet"});const j=a?c.get(a):null,f=a?r.find(y=>y.id===a):null,h=(f==null?void 0:f.type)==="law"?`Rule ${a}`:a;return s.jsxs("svg",{viewBox:"0 0 440 230",style:{width:"100%",height:"auto",display:"block"},role:"img","aria-label":"Cross-link constellation",onMouseLeave:()=>i(null),children:[s.jsx("defs",{children:s.jsxs("radialGradient",{id:"mg-hub-glow",cx:"50%",cy:"50%",r:"50%",children:[s.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.42"}),s.jsx("stop",{offset:"60%",stopColor:"var(--accent)",stopOpacity:"0.08"}),s.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0"})]})}),l.map((y,d)=>{const o=c.get(y.source),x=c.get(y.target);if(!o||!x)return null;const p=a&&(y.source===a||y.target===a),N=a&&!p,v=x.x-o.x,w=x.y-o.y,M=Math.sqrt(v*v+w*w)||1,A=Math.min(B.edgeCurve.max,M*B.edgeCurve.scale),F=(o.x+x.x)/2+-w/M*A,k=(o.y+x.y)/2+v/M*A;return s.jsx("path",{d:`M${o.x},${o.y} Q${F},${k} ${x.x},${x.y}`,fill:"none",stroke:p?"var(--accent)":"var(--line-2)",strokeWidth:p?1.3:.9,opacity:N?.14:p?.95:.55},d)}),r.map(y=>{const d=c.get(y.id);if(!d)return null;const o=u.get(y.id)||0,p=(G.baseRadius[y.type]??G.baseRadius.skill)+Math.min(G.degreeMax,o*G.degreeScale),N=o>=Math.max(G.hub.minDegree,m*G.hub.maxFraction),v=o===0,w=g&&!g.has(y.id),M=y.type==="agent"?"var(--accent)":y.type==="law"?"var(--warn)":"var(--good)";return s.jsxs("g",{opacity:w?.22:1,onMouseEnter:()=>i(y.id),style:{cursor:"pointer"},children:[N&&s.jsx("circle",{cx:d.x,cy:d.y,r:p*G.hubGlowScale,fill:"url(#mg-hub-glow)"}),s.jsx("circle",{cx:d.x,cy:d.y,r:p,fill:M,fillOpacity:v?.55:1,stroke:"var(--bg)",strokeWidth:"1.4"})]},y.id)}),j&&s.jsx("text",{x:j.x+(j.x>350?-10:10),y:j.y-9,textAnchor:j.x>350?"end":"start",fontSize:"11",fill:"var(--text)",style:{paintOrder:"stroke",stroke:"var(--bg)",strokeWidth:3},children:h})]})}function xa({overview:e,sigil:t,setup:n,jobs:a,graph:i}){const r=es(e.counts),l=(n==null?void 0:n.version_verdict)||"",c=l.includes("up to date"),u=Y(e.diff),m=[["Source","src/, the canonical genetic material",(n==null?void 0:n.source_fp)||"—",!0],["Render",`geneseed build → ${e.emit}`,e.theme+" voice",!0],["Deployed",e.target,"inherited by every repo",!1]];return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid split-lineage mb-16",children:[s.jsxs("div",{className:"card pad-lg rise",style:{position:"relative",overflow:"hidden"},children:[s.jsx("h2",{className:"h",style:{fontSize:22,margin:"0 0 18px"},children:"Gene-seed lineage"}),s.jsxs("div",{className:"lineage-track",children:[s.jsx("div",{className:"spine"}),m.map(([g,j,f,h],y)=>s.jsxs("div",{className:"lineage-step",children:[s.jsx("span",{className:`node ${h?"on":""}`}),s.jsx("div",{className:"lt",children:g}),s.jsx("div",{className:"ld",children:j}),s.jsx("div",{className:"ltag",children:f})]},y))]}),s.jsx("hr",{className:"hr"}),t&&s.jsxs("div",{className:"voice-readout",style:{marginBottom:14},children:[s.jsx("span",{className:"vr-cur",children:"▕"}),s.jsx("span",{className:"vr-txt",children:t})]},e.theme),s.jsxs("div",{className:"row wrap gap-10",children:[s.jsxs("span",{className:`badge ${c?"ok":"warn"}`,children:[s.jsx("span",{className:"dot"}),"in sync · ",l]}),s.jsxs("span",{className:"badge",children:[s.jsx("span",{className:"dot"}),u," local edits"]})]})]}),s.jsxs("div",{className:"card pad-lg rise",style:{animationDelay:"80ms"},children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Cross-link constellation"}),s.jsx("div",{className:"right",children:s.jsxs("button",{className:"btn soft sm",onClick:()=>L("#/graph"),children:["Open graph",s.jsx($,{name:"arrow"})]})})]}),s.jsx(ma,{graph:i})]})]}),s.jsxs("div",{className:"grid split-even",children:[s.jsxs("div",{className:"card pad-lg",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Genome strand"}),s.jsx("div",{className:"right",children:s.jsx("span",{className:"tick",children:"by volume"})})]}),z.map(g=>s.jsx($n,{k:g,overview:e,max:r},g))]}),s.jsxs("div",{className:"card pad-lg",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Recent activity"})}),s.jsx(Ae,{jobs:a})]})]})]})}function pa({overview:e,setup:t,jobs:n}){var u,m,g;const a=z.reduce((j,f)=>{var h;return j+(((h=e.counts)==null?void 0:h[f])??0)},0),i=es(e.counts),r=(u=e.doctor)==null?void 0:u.ok,l=((g=(m=e.doctor)==null?void 0:m.problems)==null?void 0:g.length)??0,c=Y(e.diff);return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"card pad-md rise mb-16",children:s.jsx("div",{className:"row wrap between gap-16",children:s.jsxs("div",{className:"row",style:{gap:20,flexWrap:"wrap"},children:[s.jsxs("div",{children:[s.jsx("div",{className:"tick",children:"status"}),s.jsx("div",{className:"row",style:{gap:8,marginTop:4},children:s.jsxs("span",{className:`badge ${e.deployed?"ok":"warn"}`,children:[s.jsx("span",{className:"dot"}),e.deployed?"deployed":"not deployed"]})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"tick",children:"voice"}),s.jsx("div",{className:"metric",style:{fontSize:18,marginTop:6,textTransform:"capitalize"},children:e.theme})]}),s.jsxs("div",{children:[s.jsx("div",{className:"tick",children:"mode"}),s.jsx("div",{className:"mono",style:{fontSize:14,marginTop:6},children:e.emit})]}),s.jsxs("div",{children:[s.jsx("div",{className:"tick",children:"fingerprint"}),s.jsx("div",{className:"mono",style:{fontSize:14,marginTop:6,color:"var(--accent)"},children:(t==null?void 0:t.installed_fp)||"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"tick",children:"doctor"}),s.jsx("div",{className:"row",style:{gap:8,marginTop:4},children:r?s.jsxs("span",{className:"badge ok",children:[s.jsx("span",{className:"dot"}),"clean"]}):s.jsxs("span",{className:"badge warn",children:[s.jsx("span",{className:"dot"}),l," issue",l!==1?"s":""]})})]}),s.jsxs("div",{children:[s.jsx("div",{className:"tick",children:"edits"}),s.jsx("div",{className:"metric",style:{fontSize:18,marginTop:6},children:c})]})]})})}),s.jsxs("div",{className:"grid split-operator",children:[s.jsxs("div",{className:"card rise",style:{animationDelay:"60ms"},children:[s.jsxs("div",{className:"card-head pad-lg",style:{padding:"18px 20px 0",marginBottom:14},children:[s.jsx("h3",{children:"Sections"}),s.jsx("div",{className:"right",children:s.jsxs("span",{className:"tick",children:[a," entries total"]})})]}),s.jsxs("table",{className:"tbl",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Section"}),s.jsx("th",{children:"Detail"}),s.jsx("th",{style:{width:130},children:"Share"}),s.jsx("th",{className:"num",children:"Count"})]})}),s.jsx("tbody",{children:z.map(j=>{var y;const f=I[j],h=((y=e.counts)==null?void 0:y[j])??0;return s.jsxs("tr",{className:"clickable",onClick:()=>L("#/section/"+j),children:[s.jsx("td",{className:"name",children:f.label}),s.jsx("td",{className:"muted",children:f.desc}),s.jsx("td",{children:s.jsx("div",{className:"hbar",children:s.jsx("i",{style:{width:`${h/i*100}%`}})})}),s.jsx("td",{className:"num",children:h})]},j)})})]})]}),s.jsxs("div",{className:"card pad-lg rise",style:{animationDelay:"120ms"},children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Run log"})}),s.jsx(Ae,{jobs:n})]})]})]})}const fa=864e5;function hs(e,t=10,n="today"){const a=new Array(t).fill(0).map((r,l)=>({t:l===t-1?n:`${t-1-l}d`,v:0})),i=Date.now();for(const r of e){const l=r.started||r.finished||r.created||r.ts;if(!l)continue;const c=typeof l=="string"?Date.parse(l):l*1e3;if(!Number.isFinite(c))continue;const u=Math.floor((i-c)/fa);u<0||u>=t||(a[t-1-u].v+=1)}return a}const ga=12,ja=120,H=["#2BB673","#16A6A6","#E8A23B","#E07A5F","#8E7DBE","#5BD08A","#79856E"];function Ue({segments:e,size:t=186,stroke:n=26,caption:a="capabilities"}){const i=e.reduce((m,g)=>m+g.value,0)||1,r=t/2-n/2,l=t/2,c=t/2;let u=0;return s.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[s.jsx("circle",{cx:l,cy:c,r,fill:"none",stroke:"var(--surface-3)",strokeWidth:n}),e.map((m,g)=>{if(m.value/i<=0)return null;const f=u/i*2*Math.PI-Math.PI/2,h=(u+m.value)/i*2*Math.PI-Math.PI/2;u+=m.value;const y=l+r*Math.cos(f),d=c+r*Math.sin(f),o=l+r*Math.cos(h),x=c+r*Math.sin(h),p=h-f>Math.PI?1:0;return s.jsx("path",{d:`M ${y} ${d} A ${r} ${r} 0 ${p} 1 ${o} ${x}`,fill:"none",stroke:m.color,strokeWidth:n,strokeLinecap:"butt",children:s.jsxs("title",{children:[m.label,": ",m.value]})},g)}),s.jsx("text",{x:l,y:c-4,textAnchor:"middle",className:"donut-c-num",children:i}),s.jsx("text",{x:l,y:c+16,textAnchor:"middle",className:"donut-c-cap",children:a})]})}function ya(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++){const a=e[n-1]||e[n],i=e[n],r=e[n+1],l=e[n+2]||r,c=i[0]+(r[0]-a[0])/6,u=i[1]+(r[1]-a[1])/6,m=r[0]-(l[0]-i[0])/6,g=r[1]-(l[1]-i[1])/6;t+=` C${c},${u} ${m},${g} ${r[0]},${r[1]}`}return t}function va({data:e,height:t=156,accent:n}){if(!e.length)return null;const a=600,i=t,r=6,l=14,c=6,u=Math.max(...e.map(o=>o.v),1)+1,m=a-r*2,g=e.length>1?m/(e.length-1):m,j=e.map((o,x)=>{const p=r+x*g,N=i-c-o.v/u*(i-l-c);return[p,N]}),f=ya(j),h=j[j.length-1],y=j[0],d=`${f} L${h[0]},${i} L${y[0]},${i} Z`;return s.jsxs("svg",{viewBox:`0 0 ${a} ${i}`,preserveAspectRatio:"none",style:{width:"100%",height:t,display:"block",overflow:"visible"},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"b-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0",stopColor:n,stopOpacity:".28"}),s.jsx("stop",{offset:"1",stopColor:n,stopOpacity:"0"})]})}),s.jsx("path",{d,fill:"url(#b-grad)"}),s.jsx("path",{d:f,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),s.jsx("circle",{cx:h[0],cy:h[1],r:"3.5",fill:n,vectorEffect:"non-scaling-stroke"})]})}function me({label:e,value:t,sub:n,color:a,icon:i}){return s.jsxs("div",{className:"b-tile",children:[s.jsx("span",{className:"b-tile-ic",style:{background:`color-mix(in srgb, ${a} 18%, transparent)`,color:a},children:s.jsx($,{name:i})}),s.jsxs("div",{className:"b-tile-body",children:[s.jsx("div",{className:"b-tile-val"+(t===0?" zero":""),children:t}),s.jsx("div",{className:"b-tile-label",children:e})]}),s.jsx("div",{className:"b-tile-sub",children:n})]})}const ba={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."};function Na({overview:e,sigil:t,jobs:n,doctor:a,onAction:i}){const r=e.counts||{},l=(a==null?void 0:a.groups)||[],c=l.length>0,u=l.filter(o=>o.problems.length===0).length,m=l.length||1,g=e.deployed?ba[e.theme]||"Loaded & ready":"Not deployed",j=Y(e.diff),f=z.filter(o=>(r[o]||0)>0).map((o,x)=>({label:I[o].label,value:r[o]||0,color:H[x%H.length]})),h=f.reduce((o,x)=>o+x.value,0),y=hs(n||[],10),d=y.reduce((o,x)=>o+x.v,0);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"b-greet",children:[s.jsxs("div",{children:[s.jsx("div",{className:"eyebrow",children:"your harness"}),s.jsx("h1",{className:"h b-h",children:g}),s.jsx("p",{className:"sub",children:t||"A friendly read of every layer growing in your harness."})]}),s.jsxs("div",{className:"row gap-8",children:[s.jsxs("button",{className:"btn",onClick:()=>i("update"),children:[s.jsx($,{name:"refresh"}),"Update"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>i("build-all"),children:[s.jsx($,{name:"build"}),"Rebuild"]})]})]}),s.jsxs("div",{className:"grid b-hero-grid mb-16",children:[s.jsxs("div",{className:"card b-hero",children:[s.jsx("div",{className:"b-hero-ring",children:s.jsx(Ue,{segments:[{label:"pass",value:u,color:H[0]},{label:"attention",value:Math.max(m-u,0),color:H[2]}],size:168,stroke:20,caption:"checks"})}),s.jsxs("div",{className:"b-hero-side",children:[s.jsx("h3",{className:"b-hero-title",children:c?`${u} of ${m} checks pass`:"Running checks…"}),s.jsxs("p",{className:"sub",children:["One source, rendered into ",s.jsx("code",{children:e.target})," and inherited by every repo on this machine."]}),c&&s.jsx("ul",{className:"b-hero-checks",children:l.map(o=>{const x=o.problems.length===0;return s.jsxs("li",{className:`b-hcheck ${x?"ok":"bad"}`,title:x?"clean":o.problems.join("; "),children:[s.jsx("span",{className:"b-hcheck-mark",children:x?"✓":"!"}),s.jsx("span",{className:"b-hcheck-label",children:o.label})]},o.label)})}),s.jsxs("div",{className:"b-chips",children:[s.jsxs("span",{className:"b-chip",children:[s.jsx("b",{style:{textTransform:"capitalize"},children:e.theme})," voice"]}),s.jsx("span",{className:"b-chip",children:s.jsx("b",{children:e.emit})}),s.jsxs("span",{className:"b-chip",children:["built ",s.jsx("b",{children:e.build_time||"unknown"})]})]})]})]}),s.jsxs("div",{className:"b-tiles",children:[s.jsx(me,{label:"Agents",value:r.agents??"—",sub:"specialists",color:H[0],icon:"layers"}),s.jsx(me,{label:"Skills",value:r.skills??"—",sub:"workflows",color:H[1],icon:"skill"}),s.jsx(me,{label:"Invariants",value:r.laws??"—",sub:r.doctrines?`${r.doctrines.active}/${r.doctrines.total} packs · ${r.doctrines.rules} rules`:"all upheld",color:H[2],icon:"law"}),s.jsx(me,{label:"Edits",value:j,sub:"to graft",color:H[3],icon:"changes"})]})]}),s.jsxs("div",{className:"grid split-even mb-16",children:[s.jsxs("div",{className:"card pad-lg b-mix-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Capability mix"}),s.jsx("div",{className:"right",children:s.jsxs("span",{className:"tick",children:[h," total"]})})]}),s.jsxs("div",{className:"b-mix",children:[s.jsx(Ue,{segments:f,size:186,stroke:26}),s.jsx("div",{className:"b-legend",children:f.map(o=>s.jsxs("div",{className:"b-leg-row",children:[s.jsx("span",{className:"b-leg-dot",style:{background:o.color}}),s.jsx("span",{className:"b-leg-name",children:o.label}),s.jsx("span",{className:"b-leg-bar",children:s.jsx("i",{style:{width:`${o.value/h*100}%`,background:o.color}})}),s.jsx("span",{className:"b-leg-val",children:o.value})]},o.label))})]})]}),s.jsxs("div",{className:"card pad-lg",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent runs"}),s.jsx("div",{className:"right",children:s.jsxs("span",{className:"badge ok",children:[s.jsx("span",{className:"dot"}),"job log"]})})]}),s.jsxs("div",{className:"b-stat-lead",children:[s.jsx("span",{className:"b-stat-big",children:d}),s.jsxs("span",{className:"b-stat-cap",children:["runs in the last 10 days · ",u,"/",m," checks pass now"]})]}),s.jsx(va,{data:y,accent:H[0],height:156})]})]}),s.jsxs("div",{className:"card pad-lg",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Recent activity"}),s.jsx("div",{className:"right",children:s.jsxs("span",{className:"tick",children:["last ",Math.min((n==null?void 0:n.length)||0,12)," runs"]})})]}),s.jsxs("div",{className:"b-timeline",children:[(n||[]).slice(0,ga).map(o=>{const x=o.status==="done",N=o.status==="failed"?"warn":x?"ok":"acc";return s.jsxs("div",{className:"b-tl-row",children:[s.jsx("span",{className:`b-tl-node ${N}`}),s.jsxs("div",{className:"b-tl-body",children:[s.jsx("b",{children:o.action}),o.output?`: ${o.output.split(`
|
|
11
|
+
`)[0].slice(0,ja)}`:""]}),s.jsx("span",{className:"b-tl-when",children:o.duration?`${o.duration}s`:o.status})]},o.id)}),(!n||n.length===0)&&s.jsxs("div",{className:"b-tl-row",children:[s.jsx("span",{className:"b-tl-node"}),s.jsx("div",{className:"b-tl-body sub",children:"No runs yet. Trigger an action to populate this."}),s.jsx("span",{className:"b-tl-when",children:"—"})]})]})]})]})}const wa=14,ka=120;function te({title:e,right:t,children:n,span:a}){return s.jsxs("div",{className:"c-mod",style:a?{gridColumn:`span ${a}`}:null,children:[s.jsxs("div",{className:"c-mod-head",children:[s.jsx("span",{className:"c-tab"}),s.jsx("h3",{children:e}),t&&s.jsx("span",{className:"c-mod-right",children:t})]}),s.jsx("div",{className:"c-mod-body",children:n})]})}function K({label:e,value:t}){return s.jsxs("div",{className:"c-kpi",children:[s.jsx("div",{className:"c-kpi-label",children:e}),s.jsx("div",{className:"c-kpi-val"+(t===0?" zero":""),children:t})]})}function _a({data:e,height:t=120,hi:n}){if(!e.length)return null;const a=Math.max(...e.map(i=>i.v),1);return s.jsx("div",{className:"c-cols",style:{height:t},children:e.map((i,r)=>{const l=Math.max(i.v/a*(t-6),2);return s.jsx("div",{className:`c-col ${r===n?"hi":""}`,style:{height:l},title:`${i.t}: ${i.v}`},r)})})}function Ma({checks:e}){return s.jsx("div",{className:"c-band",children:e.map((t,n)=>s.jsx("span",{className:`c-band-cell ${t.problems.length===0?"ok":"bad"}`,title:`${t.label}: ${t.problems.length===0?"pass":`${t.problems.length} problem(s)`}`},n))})}function Sa(e){const t={};for(const n of e||[]){const a=n.action||"unknown";t[a]=(t[a]||0)+1}return Object.entries(t).map(([n,a])=>({label:n,value:a})).sort((n,a)=>a.value-n.value)}function Ea({overview:e,jobs:t,doctor:n,onAction:a}){const i=e.counts||{},r=z.reduce((d,o)=>d+(i[o]||0),0),l=Math.max(...z.map(d=>i[d]||0),1),c=(n==null?void 0:n.groups)||[],u=c.filter(d=>d.problems.length===0).length,m=hs(t||[],10,"0d"),g=m.reduce((d,o)=>d+o.v,0),j=Sa(t),f=Math.max(...j.map(d=>d.value),1),h=Y(e.diff),y=[["status",e.deployed?s.jsx("span",{className:"c-pill ok",children:"DEPLOYED"}):s.jsx("span",{className:"c-pill warn",children:"NOT DEPLOYED"})],["voice",s.jsx("span",{style:{textTransform:"capitalize"},children:e.theme})],["mode",e.emit],["doctor",c.length===0?s.jsx("span",{className:"c-pill",children:"—"}):u===c.length?s.jsx("span",{className:"c-pill ok",children:"CLEAN"}):s.jsxs("span",{className:"c-pill warn",children:[c.length-u," ISSUES"]})],["edits",String(h)],["built",e.build_time||"—"],["target",s.jsx("span",{className:"c-dim mono",children:e.target})]];return s.jsxs("div",{className:"c-root",children:[s.jsxs("div",{className:"c-titlebar",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"c-h1",children:"HARNESS // STATUS READOUT"}),s.jsxs("div",{className:"c-sub",children:[e.target," · rendered from src/ · inherited everywhere"]})]}),s.jsxs("div",{className:"row gap-8",children:[s.jsxs("button",{className:"btn",onClick:()=>a("update"),children:[s.jsx($,{name:"refresh"}),"UPDATE"]}),s.jsx("button",{className:"btn ghost",onClick:()=>a("build-all"),children:"REBUILD"}),s.jsx("button",{className:"btn ghost",onClick:()=>a("doctor"),children:"DOCTOR"})]})]}),s.jsx("div",{className:"c-strip",children:y.map(([d,o],x)=>s.jsxs("div",{className:"c-strip-cell",children:[s.jsx("div",{className:"c-strip-k",children:d}),s.jsx("div",{className:"c-strip-v",children:o})]},x))}),s.jsxs("div",{className:"c-kpi-row",children:[s.jsx(K,{label:"AGENTS",value:i.agents??"—"}),s.jsx(K,{label:"SKILLS",value:i.skills??"—"}),s.jsx(K,{label:"INVARIANTS",value:i.laws??"—"}),s.jsx(K,{label:"PACKS",value:i.doctrines?`${i.doctrines.active}/${i.doctrines.total}`:"—"}),s.jsx(K,{label:"MEMORY",value:i.memory??"—"}),s.jsx(K,{label:"NOTEBOOK",value:i.notebook??"—"}),s.jsx(K,{label:"EDITS",value:h})]}),s.jsxs("div",{className:"c-grid",children:[s.jsx(te,{title:"CAPABILITY DISTRIBUTION",right:`${r} ENTRIES`,span:2,children:s.jsxs("table",{className:"c-tbl",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"SECTION"}),s.jsx("th",{children:"DETAIL"}),s.jsx("th",{style:{width:150},children:"SHARE"}),s.jsx("th",{className:"num",children:"N"})]})}),s.jsx("tbody",{children:z.map(d=>s.jsxs("tr",{children:[s.jsx("td",{className:"c-name",children:I[d].label}),s.jsx("td",{className:"c-dim",children:I[d].desc}),s.jsx("td",{children:s.jsx("div",{className:"c-bar",children:s.jsx("i",{style:{width:`${(i[d]||0)/l*100}%`,background:d==="agents"||d==="skills"?"var(--accent)":"var(--line-3)"}})})}),s.jsx("td",{className:(i[d]||0)>0?"num":"num c-dim",children:i[d]??0})]},d))})]})}),s.jsx(te,{title:"DOCTOR // CHECKS",right:c.length?`${u}/${c.length}`:"—",children:c.length>0?s.jsxs(s.Fragment,{children:[s.jsx(Ma,{checks:c}),s.jsx("div",{className:"c-check-list",children:c.map(d=>{const o=d.problems.length===0;return s.jsxs("div",{className:"c-check-row",children:[s.jsx("span",{className:`c-dotmark ${o?"ok":"bad"}`}),s.jsx("span",{className:"c-check-name",children:d.label}),s.jsx("span",{className:"c-check-detail",children:o?"clean":`${d.problems.length} problem${d.problems.length===1?"":"s"}`})]},d.label)})})]}):s.jsx("p",{className:"c-dim mono",style:{fontSize:11},children:"No doctor run loaded yet."})}),s.jsxs(te,{title:"RUN RATE // 10D",right:`${g} RUNS`,span:2,children:[s.jsx(_a,{data:m,height:120,hi:m.length-1}),s.jsx("div",{className:"c-axis",children:m.map((d,o)=>s.jsx("span",{children:o%2===0?d.t:""},o))})]}),s.jsx(te,{title:"RUN LOG // BY TYPE",right:`${(t||[]).length} LOGGED`,children:j.length>0?s.jsx("table",{className:"c-tbl",children:s.jsx("tbody",{children:j.map(d=>s.jsxs("tr",{children:[s.jsx("td",{className:"c-name",style:{textTransform:"uppercase",fontWeight:400},children:d.label}),s.jsx("td",{children:s.jsx("div",{className:"c-bar",children:s.jsx("i",{style:{width:`${d.value/f*100}%`,background:"var(--accent)"}})})}),s.jsx("td",{className:"num",children:d.value})]},d.label))})}):s.jsx("p",{className:"c-dim mono",style:{fontSize:11},children:"No runs logged."})}),s.jsx(te,{title:"RECENT // RUN LOG",span:3,children:s.jsx("table",{className:"c-tbl",children:s.jsxs("tbody",{children:[(t||[]).slice(0,wa).map(d=>{const o=d.status==="done",p=d.status==="failed"?"bad":o?"ok":"acc",N=d.output?d.output.split(`
|
|
12
|
+
`)[0].slice(0,ka):"—";return s.jsxs("tr",{children:[s.jsxs("td",{style:{width:96},children:[s.jsx("span",{className:`c-dotmark ${p}`})," ",s.jsx("span",{className:"c-dim",children:d.action})]}),s.jsx("td",{className:"c-name",style:{fontWeight:400},children:N}),s.jsx("td",{className:"num c-dim",children:d.duration?`${d.duration}s`:d.status})]},d.id)}),(!t||t.length===0)&&s.jsx("tr",{children:s.jsx("td",{colSpan:"3",className:"c-dim",style:{fontSize:11},children:"No runs logged."})})]})})})]})]})}const V={security:"oklch(0.74 0.085 45)",verify:"oklch(0.78 0.075 200)",process:"oklch(0.76 0.075 150)",craft:"oklch(0.78 0.085 95)",context:"oklch(0.74 0.08 280)",comms:"oklch(0.76 0.085 345)"},ni={security:{label:"Security",c:V.security},verify:{label:"Verification",c:V.verify},process:{label:"Process",c:V.process},craft:{label:"Craft",c:V.craft},context:{label:"Context",c:V.context},comms:{label:"Communication",c:V.comms}},ai=["security","verify","process","craft","context","comms"],Aa={craft:V.craft,rigor:V.verify,ops:V.process,process:V.security},We=e=>Aa[e]||"var(--text-3)",Ca=.62,$a=(e,t)=>String(e).length*t*Ca;function J(e,t){let n=0;for(const a of e){if(a.t===""||a.t==null)continue;const i=$a(a.t,a.size)/2;n=Math.max(n,Math.hypot(i,a.dy-a.size*.75),Math.hypot(i,a.dy+a.size*.25))}return Math.ceil(n+t)}function xe(e,t,n=0){const a=t.x-e.x,i=t.y-e.y,r=Math.hypot(a,i)||1,l=a/r,c=i/r,u=e.x+l*e.r,m=e.y+c*e.r,g=t.x-l*t.r,j=t.y-c*t.r,f=n*r,h=y=>y.toFixed(1);return`M${h(u)} ${h(m)} C${h(u+l*r*.3-c*f)} ${h(m+c*r*.3+l*f)} ${h(g-l*r*.3-c*f)} ${h(j-c*r*.3+l*f)} ${h(g)} ${h(j)}`}function ne({hash:e,label:t,children:n}){return s.jsx("g",{className:"cm-node",role:"button",tabIndex:0,"aria-label":t,onClick:()=>L(e),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),L(e))},children:n})}function Ta({overview:e}){var d,o,x;const[t,n]=b.useState(null);b.useEffect(()=>{let p=!0;return C.catalog("laws").then(N=>p&&n(N.items||[])).catch(()=>{}),()=>{p=!1}},[]);const a=(e==null?void 0:e.counts)||{},i=ss(a),r=[];for(const p of(t||[]).filter(N=>N.tier==="doctrine")){let N=r.find(v=>v.id===p.pack);N||r.push(N={id:p.pack,on:0}),p.active!==!1&&(N.on+=1)}const l=(e==null?void 0:e.footprint)==="lean"?"lean — first line only":"full text inlined",c={x:330,y:165,r:J([{t:"Constitution",size:17,dy:-12},{t:`${i} rules in force`,size:10,dy:8},{t:l,size:8.5,dy:24}],12)},u={x:126,y:95,r:J([{t:"Ontology",size:12.5,dy:-7},{t:`${a.ontology??0} sections`,size:10,dy:10}],11)},m={x:560,y:78,r:J([{t:"Invariants",size:12.5,dy:-6},{t:`${a.laws??0}`,size:13,dy:12}],11)},g={x:560,y:252,r:J([{t:"Doctrines",size:12.5,dy:-6},{t:`${((d=a.doctrines)==null?void 0:d.rules)??0}`,size:13,dy:12}],11)},j=(p,N,v,w)=>({x:p,y:N,label:v,count:w,r:J([{t:v,size:10.5,dy:-2},{t:`${w}`,size:9,dy:10}],9)}),f=[{...j(812,52,"Skills",a.skills??0),hash:"#/skills",from:m},{...j(820,126,"Agents",a.agents??0),hash:"#/agents",from:m},{...j(816,232,"Memory",a.memory??0),hash:"#/section/memory",from:g},{...j(812,300,"Wiki",a.wiki??0),hash:"#/section/wiki",from:g}],h={rx:122,ry:68,from:212,to:112},y=r.map((p,N)=>{const w=(r.length===1?(h.from+h.to)/2:h.from+(h.to-h.from)*N/(r.length-1))*Math.PI/180;return{...p,x:g.x+h.rx*Math.cos(w),y:g.y+h.ry*Math.sin(w),r:J([{t:p.id,size:7.5,dy:-2},{t:`${p.on}`,size:7.5,dy:8}],4)}});return s.jsxs("svg",{className:"cmap",viewBox:"0 0 940 350",role:"group","aria-label":"The constitution map",children:[s.jsx("path",{d:xe(c,u,.05),className:"cm-edge"}),s.jsx("path",{d:xe(c,m,-.07),className:"cm-edge"}),s.jsx("path",{d:xe(c,g,.07),className:"cm-edge"}),f.map(p=>s.jsx("path",{d:xe(p.from,p,.03),className:"cm-edge-gov"},`e-${p.label}`)),s.jsxs(ne,{hash:"#/laws",label:`Constitution: ${i} rules in force`,children:[s.jsx("circle",{cx:c.x,cy:c.y,r:c.r,className:"cm-hub-disc"}),s.jsx("text",{x:c.x,y:c.y-12,textAnchor:"middle",className:"cm-hub-name",children:"Constitution"}),s.jsxs("text",{x:c.x,y:c.y+8,textAnchor:"middle",className:"cm-hub-num",children:[i," rules in force"]}),s.jsx("text",{x:c.x,y:c.y+24,textAnchor:"middle",className:"cm-note",children:l})]}),s.jsxs(ne,{hash:"#/laws",label:`Ontology: ${a.ontology??0} sections`,children:[s.jsx("circle",{cx:u.x,cy:u.y,r:u.r,className:"cm-sat-disc"}),s.jsx("text",{x:u.x,y:u.y-7,textAnchor:"middle",className:"cm-sat-name",children:"Ontology"}),s.jsxs("text",{x:u.x,y:u.y+10,textAnchor:"middle",className:"cm-sat-num",children:[a.ontology??0," sections"]})]}),s.jsx("text",{x:u.x,y:u.y+u.r+16,textAnchor:"middle",className:"cm-note",children:"how it thinks, not a rule"}),s.jsxs(ne,{hash:"#/laws",label:`Invariants: ${a.laws??0}, never broken`,children:[s.jsx("circle",{cx:m.x,cy:m.y,r:m.r,className:"cm-sat-disc"}),s.jsx("text",{x:m.x,y:m.y-6,textAnchor:"middle",className:"cm-sat-name",children:"Invariants"}),s.jsx("text",{x:m.x,y:m.y+12,textAnchor:"middle",className:"cm-sat-big",children:a.laws??0})]}),s.jsx("text",{x:m.x,y:m.y+m.r+16,textAnchor:"middle",className:"cm-note",children:"never broken"}),s.jsxs(ne,{hash:"#/laws",label:`Doctrines: ${((o=a.doctrines)==null?void 0:o.rules)??0} rules chosen at build`,children:[s.jsx("circle",{cx:g.x,cy:g.y,r:g.r,className:"cm-sat-disc"}),s.jsx("text",{x:g.x,y:g.y-6,textAnchor:"middle",className:"cm-sat-name",children:"Doctrines"}),s.jsx("text",{x:g.x,y:g.y+12,textAnchor:"middle",className:"cm-sat-big",children:((x=a.doctrines)==null?void 0:x.rules)??0})]}),s.jsx("text",{x:g.x+22,y:g.y+g.r+20,className:"cm-note",children:a.doctrines?`chosen at build · ${a.doctrines.active}/${a.doctrines.total} packs lit`:"chosen at build"}),s.jsx("g",{className:"cm-mini",children:y.map(p=>s.jsxs("g",{children:[s.jsx("circle",{cx:p.x,cy:p.y,r:p.r,className:"cm-pack-disc",style:{stroke:We(p.id)}}),s.jsx("text",{x:p.x,y:p.y-2,textAnchor:"middle",className:"cm-pack-id",children:p.id}),s.jsx("text",{x:p.x,y:p.y+8,textAnchor:"middle",style:{fill:We(p.id)},children:p.on})]},p.id))}),s.jsx("text",{x:866,y:16,textAnchor:"middle",className:"cm-govern-label",children:"GOVERNS THE HARNESS"}),f.map(p=>s.jsxs(ne,{hash:p.hash,label:`${p.label}: ${p.count}`,children:[s.jsx("circle",{cx:p.x,cy:p.y,r:p.r,className:"cm-gov-disc"}),s.jsx("text",{x:p.x,y:p.y-2,textAnchor:"middle",className:"cm-gov-name",children:p.label}),s.jsx("text",{x:p.x,y:p.y+10,textAnchor:"middle",className:"cm-gov-num",children:p.count})]},p.label)),s.jsx("text",{x:u.x,y:228,textAnchor:"middle",className:"cm-note",children:"tap any node to open its ledger"})]})}function Fa(){const e=new Date,t=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function Oa({counts:e}){const t=[{label:I.skills.label,n:e.skills??0,hash:"#/skills"},{label:"Rules in force",n:ss(e),hash:"#/laws"},{label:I.agents.label,n:e.agents??0,hash:"#/agents"},{label:I.memory.label,n:e.memory??0,hash:"#/section/memory"},{label:I.notebook.label,n:e.notebook??0,hash:"#/section/notebook"},{label:I.wiki.label,n:e.wiki??0,hash:"#/section/wiki"},{label:I.config.label,n:e.config??0,hash:"#/section/config"}],n=Math.max(...t.map(a=>a.n),1);return s.jsxs("div",{className:"card pad-lg jr-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Growth rings"}),s.jsx("span",{className:"tick right",children:"by section"})]}),t.map(a=>s.jsxs("button",{className:"jr-ring",onClick:()=>L(a.hash),children:[s.jsx("span",{className:"jr-ring-label",children:a.label}),s.jsx("span",{className:"jr-ring-track",children:s.jsx("span",{className:"jr-ring-fill",style:{width:`${a.n/n*100}%`}})}),s.jsx("span",{className:"jr-ring-num",children:a.n})]},a.label))]})}function La({recent:e,buildEpoch:t}){const n=(e==null?void 0:e.items)||[],a=(e==null?void 0:e.skipped)||[];return s.jsxs("div",{className:"card pad-lg jr-card",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"Freshly grown"}),s.jsx("span",{className:"tick right",children:"newest"})]}),e?n.length===0?s.jsx("p",{className:"sub",children:"Nothing here carries a date yet."}):n.slice(0,5).map(i=>s.jsxs("button",{className:"jr-fresh",onClick:()=>L(`#/item/${i.type}/${encodeURIComponent(i.name)}`),children:[s.jsx("span",{className:"jr-fresh-kind",children:i.section}),s.jsx("span",{className:"jr-fresh-name",children:i.title}),s.jsx("span",{className:"jr-fresh-when",children:fe(i.mtime)})]},`${i.section}:${i.name}`)):s.jsx("p",{className:"sub",children:"Reading the shelves…"}),a.length>0&&s.jsxs("p",{className:"sub jr-skipped",children:["Not dated: ",a.join(", ")," — too many files to stat on every load."]}),s.jsxs("p",{className:"jr-care",children:[t?`Last built ✓ ${fe(t)}`:"Never built here"," ·"," ",s.jsx("button",{className:"jr-go",onClick:()=>L("#/activity"),children:"log →"})]})]})}function Ra({overview:e,recent:t,onAction:n,onDirection:a}){const i=(e==null?void 0:e.counts)||{};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"head-row jr-head",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"eyebrow",children:["Field journal · ",Fa()]}),s.jsx("h1",{className:"h",children:"Today in this harness"})]}),s.jsxs("div",{className:"row wrap gap-10",children:[s.jsx("button",{className:"btn primary",onClick:()=>n==null?void 0:n("update"),children:"Update & rebuild"}),s.jsx("button",{className:"btn",onClick:()=>L("#/doctor"),children:"Doctor"})]})]}),s.jsxs("div",{className:"jr-row2",children:[s.jsx(Oa,{counts:i}),s.jsx(La,{recent:t,buildEpoch:e==null?void 0:e.build_epoch})]}),s.jsxs("div",{className:"card pad-lg jr-map",children:[s.jsxs("div",{className:"card-head",children:[s.jsx("h3",{children:"The Constitution — and the harness it governs"}),s.jsx("button",{className:"jr-go right",onClick:()=>L("#/laws"),children:"open →"})]}),s.jsx(Ta,{overview:e})]}),s.jsxs("p",{className:"sub jr-others",children:["Other views:"," ",s.jsx("button",{className:"jr-go",onClick:()=>a==null?void 0:a("lineage"),children:"Lineage"})," ","·"," ",s.jsx("button",{className:"jr-go",onClick:()=>a==null?void 0:a("operator"),children:"Operator"})]})]})}function Ia({error:e,style:t}){return e?s.jsx("p",{className:"badge bad",style:t,children:e}):null}function Da({onAction:e}){var f,h,y,d,o;const{data:t,error:n}=Ee(()=>C.themes(),[]),[a,i]=b.useState(""),[r,l]=b.useState("");if(n)return s.jsx(Ia,{error:n});if(!t)return s.jsx(ns,{});const c=a||((f=t.current)==null?void 0:f.theme)||"neutral",u=(h=t.emits)==null?void 0:h.some(x=>x.name==="opencode-global"),m=r||(u?"opencode-global":((y=t.current)==null?void 0:y.emit)||((o=(d=t.emits)==null?void 0:d[0])==null?void 0:o.name)||""),g=i,j=l;return s.jsxs("div",{className:"narrow-lg",children:[s.jsx("div",{className:"head-row mb-18",children:s.jsxs("div",{children:[s.jsx("h1",{className:"h",children:"Deploy your harness"}),s.jsx("p",{className:"sub",children:"Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands."})]})}),s.jsxs("div",{className:"card pad-lg mb-16",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"1 · Choose a voice"})}),s.jsx("div",{className:"row wrap gap-10",children:t.themes.map(x=>s.jsxs("button",{className:`btn ${x.name===c?"soft":"ghost"}`,onClick:()=>g(x.name),title:x.blurb||x.tagline||x.name,children:[s.jsx("span",{className:"po",style:{width:10,height:10,borderRadius:"50%",background:ce(x.accent),boxShadow:`0 0 8px ${ce(x.accent)}`}}),s.jsx("span",{style:{textTransform:"capitalize"},children:x.name})]},x.name))})]}),s.jsxs("div",{className:"card pad-lg mb-16",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"2 · Install mode"})}),s.jsxs("p",{className:"sub mb-16",children:[s.jsx("code",{children:"opencode-global"})," deploys once to your global config so every repo on this machine inherits the harness (recommended). Other modes render into a chosen directory."]}),s.jsxs("label",{className:"stack",style:{gap:6,maxWidth:360},children:[s.jsx("span",{className:"tick",children:"Mode"}),s.jsx("select",{className:"sel",value:m,onChange:x=>j(x.target.value),children:t.emits.map(x=>s.jsxs("option",{value:x.name,children:[x.name,x.desc?` · ${x.desc}`:""]},x.name))})]})]}),s.jsxs("button",{className:"btn btn-grid",disabled:!m,onClick:()=>e("build",{theme:c,emit:m}),children:[s.jsx($,{name:"build"}),"Deploy harness"]})]})}function Pa({overview:e,themes:t,setup:n,runs:a,onAction:i,flavour:r="a",layout:l="auto",dataRev:c}){var N;const u=Zt(r,l),[m,g]=b.useState("status"),[j,f]=b.useState(null),[h,y]=b.useState(null),[d,o]=b.useState(null),x=e&&((N=t.find(v=>v.name===e.theme))==null?void 0:N.sigil)||"";b.useEffect(()=>{let v=!0;return(u==="greenhouse"||u==="operator")&&C.doctor().then(w=>v&&y(w)).catch(()=>{}),u==="journal"&&C.recent().then(w=>v&&o(w)).catch(()=>{}),()=>{v=!1}},[u,c]);const p=b.useRef(null);return b.useEffect(()=>{if(m!=="lineage"||p.current===c)return;let v=!0;return C.graph().then(w=>{v&&(f(w),p.current=c)}).catch(()=>{}),()=>{v=!1}},[m,c]),e?e.deployed?m==="status"&&u==="journal"?s.jsx(Ra,{overview:e,recent:d,onAction:i,onDirection:g}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"head-row",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"h",children:"Harness console"}),s.jsx("p",{className:"sub",children:"A live readout of the harness this machine carries. Its voice, its capabilities, its drift from source."})]}),s.jsx("div",{className:"seg",role:"group","aria-label":"Dashboard view",children:[["status","Status"],["lineage","Lineage"],["operator","Operator"]].map(([v,w])=>s.jsx("button",{className:m===v?"on":"",onClick:()=>g(v),"aria-pressed":m===v,children:w},v))})]}),m==="status"&&u==="cultivar"&&s.jsx(Cn,{overview:e,sigil:x,setup:n,jobs:a,onAction:i}),m==="status"&&u==="greenhouse"&&s.jsx(Na,{overview:e,sigil:x,jobs:a,doctor:h,onAction:i}),m==="status"&&u==="operator"&&s.jsx(Ea,{overview:e,jobs:a,doctor:h,onAction:i}),m==="lineage"&&s.jsx(xa,{overview:e,sigil:x,setup:n,jobs:a,graph:j}),m==="operator"&&s.jsx(pa,{overview:e,setup:n,jobs:a})]}):s.jsx(Da,{onAction:i}):s.jsx("div",{className:"loading",children:"Loading…"})}const za=b.lazy(()=>P(()=>import("./Activity-BTCG2gMl.js"),__vite__mapDeps([0,1,2]))),Ba=b.lazy(()=>P(()=>import("./ActivityDetail-julsmPDB.js"),__vite__mapDeps([3,1,2]))),Va=b.lazy(()=>P(()=>import("./Library-CjC7BAWN.js"),__vite__mapDeps([4,1,5,6]))),Ha=b.lazy(()=>P(()=>import("./Laws-BjbHJrJt.js"),__vite__mapDeps([7,1,8,9]))),Ua=b.lazy(()=>P(()=>import("./Rules-CsC6hfqk.js"),__vite__mapDeps([10,1]))),Wa=b.lazy(()=>P(()=>import("./Profile-CHr-PPf6.js"),__vite__mapDeps([11,1,5]))),Ga=b.lazy(()=>P(()=>import("./Skills-BvatJGfe.js"),__vite__mapDeps([12,1,5,6,9]))),Ka=b.lazy(()=>P(()=>import("./Diff-CIrGbiqm.js"),__vite__mapDeps([13,1]))),Za=b.lazy(()=>P(()=>import("./Doctor-CpI53oHY.js"),__vite__mapDeps([14,1]))),Ya=b.lazy(()=>P(()=>import("./Graph-CS4tA7YS.js"),__vite__mapDeps([15,1,8]))),qa=b.lazy(()=>P(()=>import("./index-DJOhOwwR.js"),__vite__mapDeps([16,1]))),Ja=b.lazy(()=>P(()=>import("./Harness-vRYs11kX.js"),__vite__mapDeps([17,1]))),Xa=b.lazy(()=>P(()=>import("./index-Bx3I7cRW.js"),__vite__mapDeps([18,1,5])));function Qa(){const e=Et(),t=e.view==="section",n=e.view==="item",a=e.view==="laws"||t&&e.section==="laws"||n&&e.type==="law",i=e.view==="skills"||t&&e.section==="skills"||n&&e.type==="skill",r=e.view==="library"||e.view==="agents"||(t||n)&&!a&&!i,l=e.view==="agents"?"agents":t?e.section:n?Ft[e.type]||e.type:void 0,c=n?e.name:void 0,[u,m]=b.useState(""),[g,j]=b.useState(null),[f,h]=b.useState(!1),[y,d]=b.useState(!1),[o,x]=Lt(),[p,N]=zt(),[v,w]=Ut(),[M,A]=Yt(),[F,k]=b.useState(()=>!window.sessionStorage.getItem("gs-booted")),[D,oe]=b.useState(!1),Ne=b.useRef(null);b.useEffect(()=>{if(!D)return;const S=he=>{he.key==="Escape"&&oe(!1)};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[D]);const $e=S=>{var he,Oe;return j({kind:((he=S==null?void 0:S.body)==null?void 0:he.kind)||"err",msg:((Oe=S==null?void 0:S.body)==null?void 0:Oe.message)||S.message})},{overview:_,themes:we,reload:Te}=qt($e),[U,us]=b.useState(0),ke=()=>{Te(),us(S=>S+1)},{runs:de,activeId:ms,consoleOpen:xs,setConsoleOpen:ps,runAction:q,cancelJob:fs,clearRuns:gs}=en({onFinish:ke,onError:$e}),{data:Fe}=Ee(()=>C.setup().catch(()=>null),[U]),ee=de[de.length-1],js=ee?ee.status==="running"?`${ee.action} running`:`${ee.action} ${ee.status}`:"";b.useEffect(()=>{const S=Ne.current;S&&(v==="curated"&&Tt(S,p,o)||_!=null&&_.accent&&Ct(S,_.accent,o))},[_,o,v,p]);const ys=async()=>{if(window.confirm("Stop the local Geneseed server? The console goes offline until you start it again.")){try{await C.shutdown()}catch{}d(!0)}};return y?s.jsxs("div",{className:`app fl-${p} ${o==="light"?"light":""}`,ref:Ne,children:[s.jsx("div",{className:"atmos","aria-hidden":"true"}),s.jsx("div",{className:"page",style:{display:"grid",placeItems:"center"},children:s.jsxs("p",{className:"sub",style:{textAlign:"center",maxWidth:480},children:["Server stopped. You can close this tab and reopen any time with"," ",s.jsx("code",{children:"geneseed web"}),"."]})})]}):s.jsxs("div",{className:`app fl-${p} ${o==="light"?"light":""}${D?" nav-open":""}`,ref:Ne,children:[s.jsx("div",{className:"atmos","aria-hidden":"true"}),s.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),s.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:js}),D&&s.jsx("button",{type:"button",className:"nav-scrim","aria-label":"Close navigation",onClick:()=>oe(!1)}),s.jsx(on,{route:e,overview:_,setup:Fe,onOpenVoice:()=>h(S=>!S),onNavigate:()=>oe(!1)}),f&&s.jsx(yn,{themes:we,current:_==null?void 0:_.theme,onPick:S=>{h(!1),q("build",{theme:S,emit:_==null?void 0:_.emit})},onClose:()=>h(!1)}),s.jsxs("div",{className:"col",children:[s.jsx(jn,{route:e,navOpen:D,onToggleNav:()=>oe(S=>!S),target:_==null?void 0:_.target,version:_==null?void 0:_.version,query:u,onQuery:m,mode:o,onToggleMode:x,onShutdown:ys,dataRev:U,onSwitch:ke}),s.jsx("main",{className:"page",id:"main",tabIndex:-1,children:s.jsx("div",{className:e.view==="harness"?"pad pad-wide":"pad",children:s.jsxs(b.Suspense,{fallback:s.jsx(ns,{}),children:[e.view==="dashboard"&&s.jsx(Pa,{overview:_,themes:we,setup:Fe,runs:de,onAction:q,flavour:p,layout:M,dataRev:U}),e.view==="activity"&&s.jsx(za,{}),e.view==="activity-detail"&&s.jsx(Ba,{sid:e.sid},e.sid),a&&s.jsx(Ha,{selected:c,overview:_,onAction:q,dataRev:U}),i&&s.jsx(Ga,{selected:c,dataRev:U}),r&&s.jsx(Va,{overview:_,section:l,selected:c,dataRev:U}),e.view==="rules"&&s.jsx(Ua,{}),e.view==="profile"&&s.jsx(Wa,{}),e.view==="diff"&&s.jsx(Ka,{onMutated:Te,dataRev:U}),e.view==="doctor"&&s.jsx(Za,{}),e.view==="graph"&&s.jsx(Ya,{}),e.view==="settings"&&s.jsx(qa,{overview:_,onAction:q,flavour:p,onFlavour:N,accentMode:v,onAccentMode:w,layout:M,onLayout:A}),e.view==="harness"&&s.jsx(Ja,{onAction:q,themes:we,currentTheme:_==null?void 0:_.theme,overview:_,dataRev:U,onMutated:ke}),e.view==="docs"&&s.jsx(Xa,{page:e.page,query:u,onAction:q,overview:_})]})})}),s.jsx(Nn,{runs:de,open:xs,busy:!!ms,onToggle:()=>ps(S=>!S),onClear:gs,onCancel:fs})]}),g&&s.jsx(bn,{toast:g,onClose:()=>j(null)}),F&&s.jsx(_n,{ready:!!_,onDone:()=>{window.sessionStorage.setItem("gs-booted","1"),k(!1)}})]})}vs(document.getElementById("root")).render(s.jsx(Qa,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});export{Vt as A,V as C,Ia as E,It as F,$ as I,ns as L,Aa as P,Jt as R,I as S,C as a,si as b,ti as c,ni as d,ai as e,Gt as f,L as g,Kt as h,ve as i,s as j,fe as r,Ee as u,Ie as w};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as _,j as e,g,I as N,u as w,E as S,L as E,a as T}from"./index-BnRWQbZb.js";import{r as p}from"./react-DOpiTn5v.js";import{r as I}from"./Markdown-kgpg9EQM.js";const P="geneseed-harness",R=[{id:"opencode",label:"OpenCode"},{id:"claude",label:"Claude Code"}];function A(){return _(P,s=>s==="claude"||s==="opencode"?s:"opencode")}function L(s,n=0){const a=String(s).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return a&&/^[a-z]/.test(a)?a:`h-${n}-${a||"section"}`}function y(s,n){if(!s||!n)return null;try{return s.querySelector(n)}catch{return null}}function M(s){const n=[];let a=!1,l=0;for(const r of(s||"").split(`
|
|
2
|
+
`)){if(r.startsWith("```")){a=!a;continue}if(a)continue;const h=r.match(/^(##|###)\s+(.+?)\s*$/);h&&(l+=1,n.push({level:h[1].length,title:h[2],id:L(h[2],l)}))}return n}const q={"opencode-global":"path-a-opencode-global-recommended","opencode-per-repo":"path-b-opencode-per-repo","claude-code":"path-c-claude-code","agent-md":"path-d-any-agentmd-tool",bundle:"path-d-any-agentmd-tool"};function H({page:s,overview:n,onAction:a}){const l=p.useRef(null),r=p.useMemo(()=>M(s.body),[s.body]),h=p.useMemo(()=>I(s.body,s.links),[s.body,s.links]);p.useEffect(()=>{const t=l.current;if(!t)return;let c=0;t.querySelectorAll("h1, h2, h3").forEach(m=>{if(c+=1,!m.id){const x=L(m.textContent||"",c);x&&(m.id=x)}})},[h]),p.useEffect(()=>{const t=l.current;if(!t)return;const c=m=>{const x=m.target.closest("a[href]");if(!x)return;const f=x.getAttribute("href");f&&f.startsWith("#/")&&(m.preventDefault(),g(f))};return t.addEventListener("click",c),()=>t.removeEventListener("click",c)},[h]),p.useEffect(()=>{const t=s.anchor;if(!t)return;const c=y(l.current,`#${CSS.escape(t)}`);c&&c.scrollIntoView({behavior:"smooth",block:"start"})},[h,s.anchor]),p.useEffect(()=>{const t=l.current;if(!t||s.id!=="install-paths")return;t.querySelectorAll(".docs-here").forEach(x=>x.classList.remove("docs-here"));const c=q[n==null?void 0:n.emit];if(!c)return;const m=y(t,`#${CSS.escape(c)}`);m&&m.classList.add("docs-here")},[h,s.id,n==null?void 0:n.emit]);const o=t=>{if(!t)return;const c=y(l.current,`#${CSS.escape(t)}`);c&&c.scrollIntoView({behavior:"smooth",block:"start"})},j=r.length>=3,u=[];return(s.id==="install-paths"||s.id==="install-quick")&&(u.push({label:"Run doctor",action:"doctor"}),u.push({label:"Rebuild",action:"build"})),s.id==="verify"&&u.push({label:"Run doctor",action:"doctor"}),s.id==="self-improve"&&u.push({label:"Open diff",hash:"#/diff"}),s.id==="upgrade"&&u.push({label:"Update",action:"update"}),e.jsxs("div",{className:"detail-doc",children:[e.jsx("h1",{style:{marginTop:0},children:s.title}),s.source&&e.jsx("div",{className:"doc-meta",children:e.jsxs("span",{className:"badge",children:[e.jsx("span",{className:"dot"}),s.source]})}),u.length>0&&e.jsx("div",{className:"row wrap gap-10",style:{margin:"10px 0 14px"},children:u.map(t=>t.hash?e.jsx("a",{className:"btn ghost sm",href:t.hash,children:t.label},t.label):e.jsx("button",{className:"btn ghost sm",onClick:()=>a&&a(t.action),children:t.label},t.label))}),j&&e.jsxs("div",{className:"docs-toc",children:[e.jsx("div",{className:"docs-toc-head",children:"On this page"}),e.jsx("ul",{children:r.map(t=>e.jsx("li",{className:`lvl-${t.level}`,children:e.jsx("a",{href:`#${t.id}`,onClick:c=>{c.preventDefault(),o(t.id)},children:t.title})},t.id))})]}),e.jsx("div",{className:"markdown",ref:l,dangerouslySetInnerHTML:{__html:h}}),s.link&&e.jsx("div",{style:{marginTop:24},children:e.jsx("a",{className:"btn soft sm",href:s.link.hash,children:s.link.label})})]})}const O=1200;function k({a:s,kind:n}){const a=n==="positional"?s.dest:s.names.join(", "),l=[];return s.metavar&&l.push(s.metavar),s.choices&&l.push(`{${s.choices.join("|")}}`),s.default!==null&&s.default!==void 0&&s.default!==""&&!s.is_flag&&l.push(`default: ${s.default}`),s.required&&l.push("required"),e.jsxs("div",{className:"cli-arg",children:[e.jsx("code",{className:"cli-arg-name",children:a}),l.length>0&&e.jsxs("code",{className:"cli-arg-meta",children:[" ",l.join(" · ")]}),s.help&&e.jsx("div",{className:"cli-arg-help",children:s.help})]})}function U({text:s}){const[n,a]=p.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(s),a(!0),setTimeout(()=>a(!1),O)}catch{}};return e.jsxs("button",{className:"btn ghost sm",onClick:l,title:"Copy command",children:[e.jsx(N,{name:n?"spark":"copy"}),n?"Copied":"Copy"]})}function D({cmd:s,prog:n}){const a=[n,s.name];for(const r of s.positionals||[]){const h=(r.metavar||r.dest||"").toUpperCase();a.push(r.required?h:`[${h}]`)}(s.options||[]).length&&a.push("[OPTIONS]");const l=a.join(" ");return e.jsxs("div",{className:"card pad-md mb-12 cli-card",children:[e.jsxs("div",{className:"row wrap between",style:{alignItems:"flex-start"},children:[e.jsxs("div",{className:"stack",style:{gap:4},children:[e.jsx("h3",{style:{margin:0},children:e.jsx("code",{children:s.name})}),s.help&&e.jsx("p",{className:"sub",style:{margin:0},children:s.help})]}),e.jsx(U,{text:`${n} ${s.name}`})]}),e.jsx("pre",{className:"cli-syn",children:l}),(s.positionals||[]).length>0&&e.jsxs("div",{className:"cli-block",children:[e.jsx("div",{className:"cli-block-head",children:"Arguments"}),s.positionals.map(r=>e.jsx(k,{a:r,kind:"positional"},r.dest))]}),(s.options||[]).length>0&&e.jsxs("div",{className:"cli-block",children:[e.jsx("div",{className:"cli-block-head",children:"Options"}),s.options.map(r=>e.jsx(k,{a:r,kind:"option"},r.names.join(",")))]})]})}function F({page:s}){const n=s.prog||"geneseed",a=s.commands||[];return e.jsxs("div",{className:"detail-doc",children:[e.jsx("h1",{style:{marginTop:0},children:s.title}),e.jsxs("p",{className:"sub",style:{marginTop:4},children:["Every subcommand of ",e.jsx("code",{children:n}),". Generated from the parser at request time (the same one ",e.jsx("code",{children:"geneseed"})," actually parses), so this page cannot drift."]}),e.jsx("div",{style:{marginTop:18},children:a.map(l=>e.jsx(D,{cmd:l,prog:n},l.name))})]})}function G({page:s}){const n=s.rows||[],a=s.theme||"neutral";return e.jsxs("div",{className:"detail-doc",children:[e.jsx("h1",{style:{marginTop:0},children:s.title}),e.jsxs("p",{className:"sub",style:{marginTop:4},children:["Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your ",e.jsx("code",{style:{textTransform:"capitalize"},children:a})," theme actually uses in the agent's voice."]}),e.jsx("div",{className:"card pad-md",style:{marginTop:18},children:e.jsxs("table",{className:"glossary-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Concept"}),e.jsx("th",{children:"Neutral term"}),e.jsxs("th",{children:["In ",a]}),e.jsx("th",{children:"Meaning"})]})}),e.jsx("tbody",{children:n.map(l=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("strong",{children:l.label})}),e.jsx("td",{children:e.jsx("code",{children:l.neutral||"—"})}),e.jsx("td",{children:e.jsx("code",{children:l.themed||l.neutral||"—"})}),e.jsx("td",{className:"dim",children:l.desc})]},l.label))})]})})]})}function z({page:s}){const n=s.version||{},a=[["Theme",s.theme],["Install mode",s.emit],["Deployed",s.deployed?"yes":"no"],["Target",e.jsx("code",{children:s.target},"t")],["Source root",e.jsx("code",{children:s.root},"r")],["Installed build",e.jsx("code",{children:n.installed_fp||"(none)"},"i")],["Source build",e.jsx("code",{children:n.source_fp||"—"},"s")],["Match?",n.verdict||"—"],["License",s.license]];return e.jsxs("div",{className:"detail-doc",children:[e.jsx("h1",{style:{marginTop:0},children:s.title}),e.jsx("p",{className:"sub",style:{marginTop:4},children:"Live snapshot of the install behind this UI, plus where to go next."}),e.jsx("div",{className:"card pad-md",style:{marginTop:18},children:a.map(([l,r])=>e.jsxs("div",{className:"kv",children:[e.jsx("span",{className:"k",children:l}),e.jsx("span",{className:"v",children:r??"—"})]},l))}),e.jsxs("div",{className:"row wrap gap-10",style:{marginTop:18},children:[e.jsxs("a",{className:"btn ghost",href:s.repo,target:"_blank",rel:"noreferrer",children:[e.jsx(N,{name:"external"}),s.repo_is_github?"GitHub repo":"Source repo"]}),s.repo_is_github&&e.jsxs(e.Fragment,{children:[e.jsxs("a",{className:"btn ghost",href:`${s.repo}/issues`,target:"_blank",rel:"noreferrer",children:[e.jsx(N,{name:"external"}),"File an issue"]}),e.jsxs("a",{className:"btn ghost",href:`${s.repo}/blob/main/LICENSE`,target:"_blank",rel:"noreferrer",children:[e.jsx(N,{name:"external"}),"License"]})]})]})]})}function C(s){var a,l,r;const n=(r=(l=(a=s==null?void 0:s.groups)==null?void 0:a[0])==null?void 0:l.pages)==null?void 0:r[0];return(n==null?void 0:n.id)||""}function B({pageId:s,harness:n,overview:a,onAction:l}){const{data:r,error:h,loading:o}=w(()=>s?T.docsPage(s,n):Promise.resolve(null),[s,n]);if(h)return e.jsx(S,{error:h,style:{margin:18}});if(o||!r)return e.jsx(E,{label:"Loading page…"});switch(r.kind){case"markdown":case"concept":return e.jsx(H,{page:r,overview:a,onAction:l});case"cli":return e.jsx(F,{page:r});case"glossary":return e.jsx(G,{page:r});case"about":return e.jsx(z,{page:r});default:return e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"big",children:"Unknown page kind"}),r.kind]})}}function V(s,n){if(!s||!n)return null;for(const a of s.groups)if(a.pages.some(l=>l.id===n))return a;return null}function J({page:s,query:n,overview:a,onAction:l}){var v;const[r,h]=A(),{data:o,error:j}=w(()=>T.docs(r),[r]),u=s||C(o);p.useEffect(()=>{if(!o||!u)return;if(!o.groups.some(d=>d.pages.some(b=>b.id===u))){const d=C(o);d&&d!==u&&g(`#/docs/${encodeURIComponent(d)}`)}},[o,u]);const t=V(o,u)||((v=o==null?void 0:o.groups)==null?void 0:v[0]),c=(n||"").toLowerCase().trim(),m=p.useMemo(()=>o?c?o.groups.map(i=>({...i,pages:i.pages.filter(d=>d.title.toLowerCase().includes(c)||i.label.toLowerCase().includes(c)||d.id.toLowerCase().includes(c))})).filter(i=>i.pages.length>0):t?[t]:[]:[],[o,c,t]);if(j)return e.jsx(S,{error:j});const x=(o==null?void 0:o.groups)||[],f=!!c,$=i=>{var b;const d=(b=i.pages[0])==null?void 0:b.id;d&&g(`#/docs/${encodeURIComponent(d)}`)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"head-row mb-16",children:[e.jsxs("div",{children:[e.jsx("div",{className:"eyebrow",children:"documentation"}),e.jsx("h1",{className:"h",children:"Docs"}),e.jsx("p",{className:"sub",children:"Concept pages, a generated CLI reference, and a glossary. Pages and config that differ by host are filtered to your selected harness."})]}),e.jsx("div",{className:"seg",role:"group","aria-label":"Harness",children:R.map(i=>e.jsx("button",{className:r===i.id?"on":"",onClick:()=>h(i.id),"aria-pressed":r===i.id,children:i.label},i.id))})]}),e.jsx("div",{className:"lib-secbar",children:x.map(i=>e.jsxs("button",{className:`lib-secchip ${(t==null?void 0:t.id)===i.id?"on":""}`,onClick:()=>$(i),children:[e.jsx("span",{children:i.label}),e.jsx("span",{className:"lib-secchip-n",children:i.pages.length})]},i.id))}),e.jsxs("div",{className:"lib lib-2",children:[e.jsxs("div",{className:"card lib-main",children:[e.jsxs("div",{className:"lib-head",children:[e.jsx("span",{className:"lib-head-label",children:c?"all groups":(t==null?void 0:t.label)||""}),e.jsxs("span",{className:"lib-head-count",children:[m.reduce((i,d)=>i+d.pages.length,0)," pages"]})]}),e.jsxs("div",{className:"lib-rows",children:[m.map(i=>e.jsxs("div",{className:"docs-group",children:[f&&e.jsx("div",{className:"docs-group-head",children:i.label}),i.pages.map(d=>e.jsxs("button",{className:`lib-row ${u===d.id?"on":""}`,onClick:()=>g(`#/docs/${encodeURIComponent(d.id)}`),children:[e.jsx("div",{className:"lr-name",children:d.title}),d.date?e.jsx("div",{className:"lr-desc",children:d.date}):null]},d.id))]},i.id)),m.length===0&&o&&e.jsxs("div",{className:"empty",style:{padding:32},children:[e.jsx("div",{className:"big",children:"No matches"}),"Try another search."]}),!o&&e.jsx(E,{label:"Loading docs…"})]})]}),e.jsx("div",{className:"card lib-detail",children:e.jsx(B,{pageId:u,harness:r,overview:a,onAction:l})})]})]})}export{J as default};
|