geneseed 3.1.1 → 3.1.3
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 +123 -1
- package/DESIGN.md +15 -15
- package/README.md +1 -1
- package/SETUP.md +1 -1
- package/SHIPPED.md +1 -1
- package/bin/{geneseed.mjs → build-driver.mjs} +39 -42
- package/bin/geneseed-cli.mjs +33 -32
- package/bin/geneseed-hook.mjs +7 -7
- package/docs/design-history.md +40 -40
- package/docs/extending.md +111 -83
- package/docs/web/exclusions.md +1 -1
- package/docs/web/footprint.md +1 -1
- package/docs/web/foreman-mode.md +2 -2
- package/docs/web/themes-author.md +1 -1
- package/docs/web-ui.md +41 -29
- package/harness.config.json +1 -1
- package/js/README.md +203 -0
- package/js/build/bundle.mjs +231 -0
- package/js/{catalog.mjs → build/catalog.mjs} +7 -7
- package/js/build/emit-claude.mjs +287 -0
- package/js/build/emit-common.mjs +255 -0
- package/js/build/emit-opencode.mjs +214 -0
- package/js/{generate.mjs → build/generate.mjs} +27 -28
- package/js/{render.mjs → build/render.mjs} +13 -9
- package/js/{checkout.mjs → build/source.mjs} +9 -9
- package/js/build/stubs.mjs +256 -0
- package/js/{themes.mjs → build/themes.mjs} +24 -24
- package/js/build/version.mjs +155 -0
- package/js/{hooks.mjs → hosts/hooks.mjs} +47 -44
- package/js/{hosts.mjs → hosts/hosts.mjs} +30 -28
- package/js/{installs.mjs → hosts/installs.mjs} +18 -16
- package/js/{link.mjs → hosts/link.mjs} +29 -28
- package/js/{mcp.mjs → hosts/mcp.mjs} +10 -9
- package/js/{native.mjs → hosts/native.mjs} +24 -22
- package/js/{opencode.mjs → hosts/opencode.mjs} +12 -7
- package/js/{settings.mjs → hosts/settings.mjs} +63 -55
- package/js/inspect/checks-authoring.mjs +761 -0
- package/js/inspect/checks-build.mjs +231 -0
- package/js/inspect/checks-repo.mjs +308 -0
- package/js/{diff.mjs → inspect/diff.mjs} +34 -31
- package/js/inspect/doctor.mjs +286 -0
- package/js/{excludes.mjs → inspect/excludes.mjs} +30 -33
- package/js/{inventory.mjs → inspect/inventory.mjs} +20 -17
- package/js/{registry.mjs → inspect/registry.mjs} +12 -10
- package/js/inspect/scan.mjs +125 -0
- package/js/{status.mjs → inspect/status.mjs} +27 -25
- package/js/inspect/validate.mjs +199 -0
- package/js/lib/fs.mjs +37 -759
- package/js/lib/json.mjs +344 -0
- package/js/lib/paths.mjs +242 -0
- package/js/lib/proc.mjs +3 -3
- package/js/lib/text.mjs +181 -0
- package/js/lib/udiff.mjs +1 -1
- package/js/{memory.mjs → maintain/memory.mjs} +10 -10
- package/js/{migrate.mjs → maintain/migrate.mjs} +28 -26
- package/js/{setup.mjs → maintain/setup.mjs} +34 -32
- package/js/{uninstall.mjs → maintain/uninstall.mjs} +55 -56
- package/js/{update.mjs → maintain/update.mjs} +51 -51
- package/js/{anim.mjs → ui/anim.mjs} +30 -28
- package/js/{cli.mjs → ui/cli.mjs} +10 -10
- package/js/{menu.mjs → ui/menu.mjs} +10 -9
- package/js/{tui.mjs → ui/tui.mjs} +36 -34
- package/js/web/actions.mjs +84 -85
- package/js/web/activity.mjs +22 -21
- package/js/web/api.mjs +154 -51
- package/js/web/daemon.mjs +319 -0
- package/js/web/docs.mjs +24 -21
- package/js/web/graph.mjs +0 -0
- package/js/web/handler.mjs +442 -0
- package/js/web/jobs.mjs +21 -19
- package/js/web/routes.mjs +245 -0
- package/js/web/server.mjs +56 -987
- package/package.json +11 -3
- package/src/doctrines/README.md +1 -1
- package/themes/opencode/README.md +1 -1
- package/web/dist/assets/{Activity-D_sYBlW-.js → Activity-B49fE_ug.js} +1 -1
- package/web/dist/assets/{ActivityDetail-BomKcMhy.js → ActivityDetail-abt7hzD2.js} +1 -1
- package/web/dist/assets/{Diff-BSvi1WUg.js → Diff-D3_bVkih.js} +1 -1
- package/web/dist/assets/{Doctor-Cz1s-y1n.js → Doctor-hXp7srsx.js} +1 -1
- package/web/dist/assets/{Graph-CuntzFJ0.js → Graph-DvYMtlvl.js} +1 -1
- package/web/dist/assets/Harness-BIWei7N5.js +1 -0
- package/web/dist/assets/Laws-CxmnRdwt.js +3 -0
- package/web/dist/assets/{Library-DXhTN9ju.js → Library-MjbOkHIW.js} +1 -1
- package/web/dist/assets/{Markdown-BoiZcdUl.js → Markdown-Dx_w0faR.js} +1 -1
- package/web/dist/assets/{Profile-DfCHlZ03.js → Profile-BRFvv2gr.js} +1 -1
- package/web/dist/assets/{Rules-eND7hJv9.js → Rules-CfsV1EVy.js} +1 -1
- package/web/dist/assets/{Skills-CDl9opZO.js → Skills-DArA6IHS.js} +1 -1
- package/web/dist/assets/{StatusBadge-DSDtcArX.js → StatusBadge-C9bZOEZk.js} +1 -1
- package/web/dist/assets/{activity-Dmb0FTAx.js → activity-Cc0n2jwx.js} +1 -1
- package/web/dist/assets/index-Bx3oxZ1o.css +1 -0
- package/web/dist/assets/index-DC3-GlCY.js +1 -0
- package/web/dist/assets/index-DP035wPa.js +12 -0
- package/web/dist/assets/{index-Dg58ScBe.js → index-dHi-7M-F.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/src/pages/Laws.jsx +5 -19
- package/docs/declined.md +0 -200
- package/docs/limits.md +0 -329
- package/js/doctor.mjs +0 -1750
- package/js/emit.mjs +0 -1411
- package/web/dist/assets/About-DyK7yRy7.js +0 -1
- package/web/dist/assets/Harnesses-DgRyOviS.js +0 -1
- package/web/dist/assets/Laws-CWk3Mpri.js +0 -3
- package/web/dist/assets/Themes-CoAWuIeM.js +0 -2
- package/web/dist/assets/index-B-mXquBZ.css +0 -1
- package/web/dist/assets/index-CH_Z725C.js +0 -12
- package/web/dist/assets/index-jrY4m9jP.js +0 -1
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Activity-D_sYBlW-.js","assets/react-DOpiTn5v.js","assets/activity-Dmb0FTAx.js","assets/ActivityDetail-BomKcMhy.js","assets/Library-DXhTN9ju.js","assets/Markdown-BoiZcdUl.js","assets/marked.esm-JKvyS0Pp.js","assets/StatusBadge-DSDtcArX.js","assets/Laws-CWk3Mpri.js","assets/roman-DkYN0LX9.js","assets/Rules-eND7hJv9.js","assets/Profile-DfCHlZ03.js","assets/Skills-CDl9opZO.js","assets/Diff-BSvi1WUg.js","assets/Doctor-Cz1s-y1n.js","assets/Themes-CoAWuIeM.js","assets/Graph-CuntzFJ0.js","assets/index-jrY4m9jP.js","assets/Harnesses-DgRyOviS.js","assets/index-Dg58ScBe.js","assets/About-DyK7yRy7.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as p,c as Re}from"./react-DOpiTn5v.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))c(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&c(i)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function c(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();var fe={exports:{}},ce={};/**
|
|
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 De=p,Ie=Symbol.for("react.element"),Pe=Symbol.for("react.fragment"),Be=Object.prototype.hasOwnProperty,Ve=De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ze={key:!0,ref:!0,__self:!0,__source:!0};function je(s,t,n){var c,a={},l=null,i=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(i=t.ref);for(c in t)Be.call(t,c)&&!ze.hasOwnProperty(c)&&(a[c]=t[c]);if(s&&s.defaultProps)for(c in t=s.defaultProps,t)a[c]===void 0&&(a[c]=t[c]);return{$$typeof:Ie,type:s,key:l,ref:i,props:a,_owner:Ve.current}}ce.Fragment=Pe;ce.jsx=je;ce.jsxs=je;fe.exports=ce;var e=fe.exports;const He="modulepreload",Ue=function(s){return"/"+s},ue={},O=function(t,n,c){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),r=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));a=Promise.allSettled(n.map(u=>{if(u=Ue(u),u in ue)return;ue[u]=!0;const j=u.endsWith(".css"),x=j?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${x}`))return;const d=document.createElement("link");if(d.rel=j?"stylesheet":He,j||(d.as="script"),d.crossOrigin="",d.href=u,r&&d.setAttribute("nonce",r),document.head.appendChild(d),j)return new Promise((o,g)=>{d.addEventListener("load",o),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function l(i){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=i,window.dispatchEvent(r),!r.defaultPrevented)throw i}return a.then(i=>{for(const r of i||[])r.status==="rejected"&&l(r.reason);return t().catch(l)})},We=typeof window<"u"?window.__GENESEED_TOKEN__:"";async function be(s){const t=await s.json().catch(()=>({})),n=s.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||s.statusText,c=new Error(n);return c.status=s.status,c.body=t,c}async function S(s){const t=await fetch(s);if(!t.ok)throw await be(t);return t.json()}async function C(s,t={}){const n=await fetch(s,{method:"POST",headers:{"X-Geneseed-Token":We||"","Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await be(n);return n.json()}const Ge=()=>S("/api/overview"),Ze=()=>S("/api/activity"),Ke=s=>S("/api/activity/"+encodeURIComponent(s)),Ye=s=>C("/api/activity",{enabled:s}),qe=()=>S("/api/setup"),Je=()=>S("/api/doctor"),Xe=()=>S("/api/themes"),Qe=()=>S("/api/graph"),es=Object.freeze(Object.defineProperty({__proto__:null,activity:Ze,activityDetail:Ke,activityToggle:Ye,doctor:Je,graph:Qe,overview:Ge,setup:qe,themes:Xe},Symbol.toStringTag,{value:"Module"})),ss=s=>S(`/api/catalog/${s}`),ts=(s,t)=>S(`/api/item/${s}/${encodeURIComponent(t)}`),as=s=>C("/api/memory/delete",{name:s}),ns=Object.freeze(Object.defineProperty({__proto__:null,catalog:ss,item:ts,memoryDelete:as},Symbol.toStringTag,{value:"Module"})),cs=()=>S("/api/diff"),ls=s=>C("/api/actions/restore",{files:s}),is=Object.freeze(Object.defineProperty({__proto__:null,diff:cs,restore:ls},Symbol.toStringTag,{value:"Module"})),rs=409,os=s=>S(`/api/jobs/${s}`),ds=()=>S("/api/jobs"),hs=s=>C(`/api/jobs/${s}/cancel`);async function us(s,t){try{return await C(`/api/actions/${s}`,t||{})}catch(n){throw n.status===rs?new Error("An action is already running."):n}}const ms=Object.freeze(Object.defineProperty({__proto__:null,action:us,cancelJob:hs,job:os,jobs:ds},Symbol.toStringTag,{value:"Module"})),ps=()=>S("/api/mcp"),xs=(s,t,n)=>C("/api/mcp",{path:s,name:t,enabled:n}),gs=s=>C("/api/reveal",{path:s}),fs=Object.freeze(Object.defineProperty({__proto__:null,mcp:ps,mcpReveal:gs,mcpToggle:xs},Symbol.toStringTag,{value:"Module"})),js=()=>S("/api/installs"),bs=(s,t,n)=>C("/api/install",{host:s,path:t,action:n}),vs=(s,t,n)=>C("/api/install",{host:s,path:t,action:"remove",memory:n}),ys=(s,t)=>C("/api/view",{host:s,path:t}),Ns=()=>C("/api/pick-folder",{}),ks=Object.freeze(Object.defineProperty({__proto__:null,installRemove:vs,installToggle:bs,installs:js,pickFolder:Ns,selectView:ys},Symbol.toStringTag,{value:"Module"})),ws=()=>S("/api/ping"),Ms=()=>C("/api/shutdown"),Ss=()=>C("/api/restart"),Es=Object.freeze(Object.defineProperty({__proto__:null,ping:ws,restart:Ss,shutdown:Ms},Symbol.toStringTag,{value:"Module"})),ve=s=>s?`?harness=${encodeURIComponent(s)}`:"",_s=s=>S(`/api/docs${ve(s)}`),Cs=(s,t)=>S(`/api/docs/page/${encodeURIComponent(s)}${ve(t)}`),As=Object.freeze(Object.defineProperty({__proto__:null,docs:_s,docsPage:Cs},Symbol.toStringTag,{value:"Module"})),Ts=()=>S("/api/rules"),$s=s=>C("/api/rules",s),Fs=s=>C("/api/rules/promote",s),Os=Object.freeze(Object.defineProperty({__proto__:null,rules:Ts,rulesMutate:$s,rulesPromote:Fs},Symbol.toStringTag,{value:"Module"})),Ls=()=>S("/api/profile"),Rs=s=>C("/api/profile",s),Ds=Object.freeze(Object.defineProperty({__proto__:null,profile:Ls,profileSave:Rs},Symbol.toStringTag,{value:"Module"})),Is=()=>S("/api/excludes"),Ps=(s,t)=>C("/api/excludes",{action:s,path:t}),Bs=Object.freeze(Object.defineProperty({__proto__:null,excludeMutate:Ps,excludes:Is},Symbol.toStringTag,{value:"Module"})),_={...es,...ns,...is,...ms,...fs,...ks,...Es,...As,...Os,...Ds,...Bs},Vs=new Set(["activity","diff","settings","harnesses","doctor","themes","graph","library","laws","rules","profile","skills","agents","about"]);function zs(){const s=()=>{const a=((typeof window<"u"?window.location.hash:"")||"#/").slice(2).split("/").filter(Boolean);return a[0]==="section"?{view:"section",section:a[1]}:a[0]==="item"?{view:"item",type:a[1],name:decodeURIComponent(a[2]||"")}:a[0]==="docs"?{view:"docs",page:decodeURIComponent(a.slice(1).join("/")||"")}:a[0]==="activity"&&a[1]?{view:"activity-detail",sid:decodeURIComponent(a[1])}:Vs.has(a[0])?{view:a[0]}:{view:"dashboard"}},[t,n]=p.useState(s);return p.useEffect(()=>{const c=()=>n(s());return window.addEventListener("hashchange",c),()=>window.removeEventListener("hashchange",c)},[]),t}const W=s=>{window.location.hash=s},me={red:"#FF5C57",green:"#4ED888",yellow:"#E8B53D",blue:"#5B8CFF",magenta:"#C77DFF",cyan:"#3AD4C4",white:"#E9EFEA"},ae={red:"#C53A36",green:"#2FA864",yellow:"#B8862A",blue:"#3C66D8",magenta:"#9A52D6",cyan:"#2BA89B",white:"#AEB8B0"},ee=s=>me[s]||me.cyan,Hs=s=>s==="yellow"||s==="white"||s==="cyan"||s==="green"?"#06100D":"#FFFFFF";function Us(s,t,n){if(!s)return;const c=n==="light";let a=c?ae[t]||ae.cyan:ee(t),l=c?"#FFFFFF":Hs(t);c&&t==="white"&&(a="#566B62",l="#FFFFFF"),s.style.setProperty("--accent",a),s.style.setProperty("--accent-2",ae[t]||ae.cyan),s.style.setProperty("--accent-ink",l)}const Ws={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"}};function Gs(s,t,n){const c=Ws[t];if(!s||!c)return!1;const a=n==="light";return s.style.setProperty("--accent",a?c.light:c.dark),s.style.setProperty("--accent-2",c.light),s.style.setProperty("--accent-ink",a?c.inkLight:c.ink),!0}const U={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"}},I=["agents","memory","notebook","wiki","config"],Ea=I.filter(s=>s!=="agents"&&s!=="config"),_a={config:"wiki"},Zs=Object.fromEntries(Object.entries(U).map(([s,t])=>[t.type,s]));function le(s,t){const[n,c]=p.useState(()=>{try{return t(localStorage.getItem(s))}catch{return t(null)}});return p.useEffect(()=>{try{localStorage.setItem(s,n)}catch{}},[s,n]),[n,c]}const Ks="geneseed-mode";function Ys(){const[s,t]=le(Ks,c=>c==="light"?"light":"dark");return[s,()=>t(c=>c==="light"?"dark":"light")]}const qs="geneseed-flavour",Js=[{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."}],Xs=new Set(Js.map(s=>s.id)),Qs={a:"cultivar",b:"greenhouse",c:"operator",d:"heirloom",e:"matrix",f:"aurora",g:"perspective",z:"sequencer",cb:"cobalt",cm:"cosmic"};function et(){return le(qs,s=>Xs.has(s)?s:Qs[s]||"cultivar")}const st="geneseed-accent",tt=[{id:"auto",short:"Auto",tagline:"Follows the deployed voice's accent."},{id:"curated",short:"Curated",tagline:"Each theme's own signature colour."}],at=new Set(tt.map(s=>s.id));function nt(){return le(st,s=>s&&at.has(s)?s:"auto")}const ct="geneseed-layout",lt=[{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."}],ye=new Set(lt.map(s=>s.id));function it(s){return s==="greenhouse"||s==="cobalt"?"greenhouse":s==="operator"?"operator":"cultivar"}function rt(s,t){return t&&t!=="auto"&&ye.has(t)?t:it(s)}function ot(){return le(ct,s=>s&&ye.has(s)?s:"auto")}function dt(s){const[t,n]=p.useState(null),[c,a]=p.useState([]),l=()=>_.overview().then(n).catch(i=>s==null?void 0:s(i));return p.useEffect(()=>{l()},[]),p.useEffect(()=>{_.themes().then(i=>a(i.themes)).catch(()=>{})},[]),{overview:t,themes:c,reload:l}}const ht=600,ut=1e3,mt=30;async function pe(s){await new Promise(t=>setTimeout(t,s));for(let t=0;t<mt;t++)try{await _.ping();break}catch{await new Promise(n=>setTimeout(n,ut))}window.location.reload()}function pt({onFinish:s,onError:t}={}){const[n,c]=p.useState([]),[a,l]=p.useState(null),[i,r]=p.useState(!1);return p.useEffect(()=>{_.jobs().then(({jobs:x})=>{if(!x.length)return;c(x.map(o=>({id:o.id,action:o.action,status:o.status,output:o.output||"",duration:o.duration})));const d=x.find(o=>o.status==="running");d&&(l(d.id),r(!0))}).catch(()=>{})},[]),p.useEffect(()=>{var o;if(!a)return;const x=((o=n.find(g=>g.id===a))==null?void 0:o.action)==="update",d=setInterval(async()=>{try{const g=await _.job(a);if(c(f=>f.map(m=>m.id===a?{...m,output:g.output||"",status:g.status,duration:g.duration}:m)),g.status!=="running"){if(clearInterval(d),l(null),x){pe(2e3);return}s==null||s()}}catch{clearInterval(d),x&&pe(0)}},ht);return()=>clearInterval(d)},[a]),{runs:n,activeId:a,consoleOpen:i,setConsoleOpen:r,runAction:async(x,d)=>{try{const{job_id:o}=await _.action(x,d),g=x==="build"&&(d!=null&&d.theme)?`build (${d.theme} · ${d.emit})`:x;return c(f=>[...f,{id:o,action:g,status:"running",output:""}]),l(o),r(!0),o}catch(o){t==null||t(o)}},cancelJob:x=>_.cancelJob(x).catch(d=>t==null?void 0:t(d)),clearRuns:()=>c([])}}const xt={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 E({name:s,className:t="glyph",style:n}){return e.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:e.jsx("path",{d:xt[s]||""})})}function gt({className:s="sprout"}){return e.jsxs("svg",{className:s,viewBox:"0 0 24 24","aria-hidden":"true",children:[e.jsx("path",{d:"M12 21.5v-9",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),e.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)"}),e.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"}),e.jsx("circle",{cx:"12",cy:"12.4",r:"1.1",fill:"var(--bg)"})]})}const ft=[{group:"Harness"},{hash:"#/",id:"dashboard",label:"Dashboard",icon:"dashboard",match:s=>s.view==="dashboard"},{hash:"#/activity",id:"activity",label:"Activity",icon:"activity",match:s=>s.view==="activity"},{hash:"#/laws",id:"laws",label:"Constitution",icon:"law",match:s=>s.view==="laws"||s.view==="section"&&s.section==="laws"||s.view==="item"&&s.type==="law",tag:s=>{var t;return((t=s==null?void 0:s.counts)==null?void 0:t.laws)??null}},{hash:"#/rules",id:"rules",label:"Rules",icon:"rule",match:s=>s.view==="rules"},{hash:"#/profile",id:"profile",label:"Profile",icon:"profile",match:s=>s.view==="profile"},{hash:"#/skills",id:"skills",label:"Skills",icon:"skill",match:s=>s.view==="skills"||s.view==="section"&&s.section==="skills"||s.view==="item"&&s.type==="skill",tag:s=>{var t;return((t=s==null?void 0:s.counts)==null?void 0:t.skills)??null}},{hash:"#/agents",id:"agents",label:"Agents",icon:"agent",match:s=>s.view==="agents"||s.view==="section"&&s.section==="agents"||s.view==="item"&&s.type==="agent",tag:s=>{var t;return((t=s==null?void 0:s.counts)==null?void 0:t.agents)??null}},{hash:"#/library",id:"library",label:"Library",icon:"library",match:s=>s.view==="library"||s.view==="section"&&!["laws","skills","agents"].includes(s.section)||s.view==="item"&&!["law","skill","agent"].includes(s.type)},{hash:"#/docs",id:"docs",label:"Docs",icon:"docs",match:s=>s.view==="docs"},{hash:"#/graph",id:"graph",label:"Graph",icon:"graph",match:s=>s.view==="graph"},{group:"Maintain"},{hash:"#/diff",id:"changes",label:"Changes",icon:"changes",match:s=>s.view==="diff",tag:s=>(s!=null&&s.diff?s.diff.edited+s.diff.added:null)||null},{hash:"#/doctor",id:"doctor",label:"Doctor",icon:"doctor",match:s=>s.view==="doctor",tag:s=>s!=null&&s.doctor&&!s.doctor.ok?s.doctor.problems.length:null,warn:!0},{group:"Configure"},{hash:"#/harnesses",id:"harnesses",label:"Harnesses",icon:"layers",match:s=>s.view==="harnesses"},{hash:"#/themes",id:"themes",label:"Themes",icon:"themes",match:s=>s.view==="themes"},{hash:"#/settings",id:"settings",label:"Settings",icon:"settings",match:s=>s.view==="settings"},{group:"About"},{hash:"#/about",id:"about",label:"About",icon:"about",match:s=>s.view==="about"}];function jt({route:s,overview:t,onOpenVoice:n,onNavigate:c}){return e.jsxs("aside",{className:"rail",id:"rail-nav","aria-label":"Harness navigation",children:[e.jsxs("button",{className:"rail-brand",onClick:()=>{W("#/"),c==null||c()},title:"Dashboard",children:[e.jsx(gt,{}),e.jsxs("div",{className:"brand-text",children:[e.jsxs("span",{className:"brand-name",children:["Gene",e.jsx("b",{children:"seed"})]}),e.jsx("span",{className:"brand-sub",children:"harness console"})]})]}),ft.map((a,l)=>{if(a.group)return e.jsx("div",{className:"rail-group",children:a.group},"g"+l);const i=a.tag?a.tag(t):null,r=a.match(s);return e.jsx("div",{className:"rail-nav",children:e.jsxs("a",{className:`rail-item ${r?"active":""}`,href:a.hash,"aria-current":r?"page":void 0,title:a.label,onClick:()=>c==null?void 0:c(),children:[e.jsx(E,{name:a.icon}),e.jsx("span",{children:a.label}),i?e.jsx("span",{className:"tag",style:a.warn?{color:"var(--warn)"}:null,children:i}):null]})},a.id)}),e.jsx("div",{className:"rail-spacer"}),e.jsx("div",{className:"rail-foot",children:e.jsxs("button",{className:"voice",onClick:n,title:"Switch deployed voice",children:[e.jsx("span",{className:"voice-orb"}),e.jsxs("div",{className:"voice-meta",children:[e.jsx("div",{className:"vk",children:"deployed voice"}),e.jsx("div",{className:"vv",children:(t==null?void 0:t.theme)||"—"})]}),e.jsx(E,{name:"chevron",className:"chev glyph"})]})})]})}const Ne=60,ke=3600,bt=86400,oe={seconds:90,minutes:90*Ne,hours:36*ke};function vt(s){const t=Math.max(0,Date.now()/1e3-s);return t<oe.seconds?`${Math.round(t)}s`:t<oe.minutes?`${Math.round(t/Ne)}m`:t<oe.hours?`${Math.round(t/ke)}h`:`${Math.round(t/bt)}d`}function yt(s){return s?s.replace(/\\/g,"/").replace(/^\/?(home|Users)\/[^/]+/i,"~").replace(/^[A-Z]:\/Users\/[^/]+/i,"~"):"~"}const Z={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function Nt(s,t){var l,i,r;if(!s)return 0;const n=((i=(l=s.doctor)==null?void 0:l.problems)==null?void 0:i.length)??99,c=(r=s.doctor)!=null&&r.ok?Z.doctorClean:n<=Z.doctorMinorMax?Z.doctorMinor:Z.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(s.deployed?Z.deployed:0)+c+(a?Z.versionSynced:0)+(s.diff&&s.diff.missing===0?Z.diskClean:0)}const we=s=>Math.max(...I.map(t=>(s==null?void 0:s[t])??0),1),se=s=>((s==null?void 0:s.edited)??0)+((s==null?void 0:s.added)??0);function kt(){const[s,t]=p.useState(null),[n,c]=p.useState(""),a=p.useRef(null),l=p.useCallback(()=>{if(s||a.current)return a.current;const i=(async()=>{const r=[],u=["laws","skills",...I],j=await Promise.all(u.map(async x=>{try{const d=await _.catalog(x);return{sec:x,items:(d==null?void 0:d.items)||[]}}catch{return{sec:x,items:[]}}}));for(const{sec:x,items:d}of j){const o=U[x];for(const g of d){const f=g.title||g.name;r.push({kind:o.label,sortKey:u.indexOf(x),title:f,desc:g.desc||"",hay:`${f} ${g.desc||""} ${g.name||""}`.toLowerCase(),route:`#/item/${o.type}/${encodeURIComponent(g.name)}`})}}try{const x=await _.mcp(),d=new Set;for(const o of(x==null?void 0:x.targets)||[])for(const g of o.servers||[]){if(d.has(g.name))continue;d.add(g.name);const f=g.label||g.name;r.push({kind:"MCP servers",sortKey:100,title:f,desc:g.desc||"",hay:`${f} ${g.desc||""} ${g.name||""} mcp`.toLowerCase(),route:"#/settings"})}}catch{}try{const x=await _.docs();for(const d of(x==null?void 0:x.groups)||[])for(const o of d.pages||[])r.push({kind:"Docs",sortKey:110,title:o.title,desc:d.label,hay:`${o.title||""} ${o.id||""} ${d.label||""}`.toLowerCase(),route:`#/docs/${encodeURIComponent(o.id)}`})}catch{}return t(r),a.current=null,r})().catch(r=>(a.current=null,c(r.message||String(r)),[]));return a.current=i,i},[s]);return{index:s,error:n,prime:l}}const wt=24;function Mt(s,t){const n=s.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:s.hay.includes(t)?2:-1}function Me(s,t){const n=t.toLowerCase().trim();if(!n||!s)return[];const c=[];for(const a of s){const l=Mt(a,n);l>=0&&c.push({e:a,s:l})}return c.sort((a,l)=>a.s-l.s||a.e.sortKey-l.e.sortKey||a.e.title.localeCompare(l.e.title)),c.slice(0,wt).map(a=>a.e)}function St({query:s,index:t,loading:n,active:c,onActive:a,onClose:l}){const i=p.useMemo(()=>Me(t,s),[t,s]),r=p.useRef(null);p.useEffect(()=>{c>=i.length&&a(0)},[i,c,a]),p.useEffect(()=>{var o;const d=(o=r.current)==null?void 0:o.querySelector(`[data-spot-row="${c}"]`);d==null||d.scrollIntoView({block:"nearest"})},[c]);const u=d=>{d&&(W(d.route),l())},j=[];let x=null;return i.forEach((d,o)=>{(!x||x.kind!==d.kind)&&(x={kind:d.kind,rows:[]},j.push(x)),x.rows.push({entry:d,index:o})}),s.trim()?e.jsxs("div",{className:"spotlight",ref:r,role:"listbox",children:[n&&!t&&e.jsx("div",{className:"spot-empty",children:"Loading…"}),!n&&i.length===0&&t&&e.jsxs("div",{className:"spot-empty",children:["No matches for “",s,"”."]}),j.map(d=>e.jsxs("div",{className:"spot-group",children:[e.jsx("div",{className:"spot-group-head",children:d.kind}),d.rows.map(({entry:o,index:g})=>e.jsxs("div",{"data-spot-row":g,role:"option","aria-selected":g===c,className:`spot-row ${g===c?"on":""}`,onMouseDown:f=>{f.preventDefault(),u(o)},onMouseEnter:()=>a(g),children:[e.jsx("div",{className:"spot-title",children:o.title}),o.desc?e.jsx("div",{className:"spot-desc",children:o.desc}):null]},`${o.route}-${g}`))]},d.kind))]}):null}function Et({value:s,onChange:t}){const n=p.useRef(null),c=p.useRef(null),[a,l]=p.useState(!1),[i,r]=p.useState(0),{index:u,prime:j}=kt();p.useEffect(()=>{const o=g=>{var f;g.key!=="/"||g.target.closest("input, textarea, select")||(g.preventDefault(),(f=n.current)==null||f.focus())};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[]),p.useEffect(()=>{if(!a)return;const o=g=>{var f;(f=c.current)!=null&&f.contains(g.target)||l(!1)};return window.addEventListener("mousedown",o),()=>window.removeEventListener("mousedown",o)},[a]);const x=a&&!!s.trim(),d=o=>{var f,m;if(!x)return;const g=Me(u,s);if(o.key==="ArrowDown")o.preventDefault(),r(h=>Math.min(h+1,Math.max(g.length-1,0)));else if(o.key==="ArrowUp")o.preventDefault(),r(h=>Math.max(h-1,0));else if(o.key==="Enter"){const h=g[i];h&&(o.preventDefault(),W(h.route),l(!1),(f=n.current)==null||f.blur())}else o.key==="Escape"&&(o.preventDefault(),s?t(""):(l(!1),(m=n.current)==null||m.blur()))};return e.jsxs("div",{className:"tb-search",ref:c,children:[e.jsx(E,{name:"search",className:"mag glyph"}),e.jsx("input",{ref:n,value:s,onChange:o=>{t(o.target.value),r(0)},onFocus:()=>{l(!0),j()},onKeyDown:d,placeholder:"Search the harness…"}),e.jsx("span",{className:"kbd",children:"/"}),x&&e.jsx(St,{query:s,index:u,loading:!u,active:i,onActive:r,onClose:()=>{var o;l(!1),(o=n.current)==null||o.blur()}})]})}function Se(s,t=[]){const[n,c]=p.useState(null),[a,l]=p.useState(""),[i,r]=p.useState(!0),u=p.useRef(s);u.current=s;const j=p.useCallback(()=>(r(!0),l(""),Promise.resolve(u.current()).then(x=>c(x)).catch(x=>l(x.message)).finally(()=>r(!1))),t);return p.useEffect(()=>{j()},[j]),{data:n,error:a,loading:i,reload:j,setData:c}}function _t({dataRev:s,onSwitch:t}){const{data:n}=Se(()=>_.installs(),[s]),c=((n==null?void 0:n.installs)||[]).filter(i=>i.state==="active");if(c.length<2)return null;const a=c.find(i=>i.selected)||c[0],l=async i=>{const r=c.find(u=>u.id===i.target.value);if(r)try{await _.selectView(r.host,r.path),t==null||t()}catch{}};return e.jsxs("div",{className:"row gap-8",style:{alignItems:"center"},title:"Harness the console is viewing",children:[e.jsx("span",{style:{fontSize:12,color:"var(--text-3)"},children:"harness"}),e.jsx("select",{className:"sel","aria-label":"harness to view",value:a.id,onChange:l,children:c.map(i=>e.jsxs("option",{value:i.id,children:[i.host," · ",i.scope]},i.id))})]})}const Ct={dashboard:"overview",diff:"diff",doctor:"doctor",themes:"themes",graph:"graph",settings:"settings"};function At(s){return s.view==="section"?["laws","skills"].includes(s.section)?s.section:"library":s.view==="item"?s.type==="law"?"laws":s.type==="skill"?"skills":"library":Ct[s.view]||s.view}function Tt({route:s,navOpen:t,onToggleNav:n,target:c,query:a,onQuery:l,mode:i,onToggleMode:r,onShutdown:u,dataRev:j,onSwitch:x}){return e.jsxs("header",{className:"topbar",children:[e.jsx("button",{className:"tb-menu",onClick:n,"aria-label":t?"Close navigation":"Open navigation","aria-expanded":!!t,"aria-controls":"rail-nav",children:e.jsx(E,{name:t?"x":"menu"})}),e.jsxs("div",{className:"prompt",children:[e.jsx("span",{className:"path",children:yt(c)}),e.jsx("span",{className:"sep",children:"$"}),e.jsx("span",{className:"cmd",children:"geneseed"})," ",e.jsxs("span",{className:"flag",children:["--tab=",At(s)]}),e.jsx("span",{className:"cur"})]}),e.jsx("div",{className:"topbar-spacer"}),e.jsx(_t,{dataRev:j,onSwitch:x}),e.jsx(Et,{value:a,onChange:l}),e.jsx("button",{className:"iconbtn",title:i==="light"?"Switch to dark":"Switch to light",onClick:r,children:e.jsx(E,{name:i==="light"?"moon":"sun"})}),e.jsx("button",{className:"iconbtn",title:"Stop server",onClick:u,children:e.jsx(E,{name:"power"})})]})}function $t({themes:s,current:t,onPick:n,onClose:c}){const a=p.useRef(null);return p.useEffect(()=>{const l=i=>{a.current&&!a.current.contains(i.target)&&c()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[c]),e.jsxs("div",{className:"pop",ref:a,children:[e.jsx("div",{className:"tick",style:{padding:"4px 10px 8px"},children:"Switch voice"}),s.map(l=>e.jsxs("div",{className:`pop-item ${l.name===t?"on":""}`,onClick:()=>n(l.name),children:[e.jsx("span",{className:"po",style:{background:ee(l.accent),boxShadow:`0 0 8px ${ee(l.accent)}`}}),e.jsx("span",{className:"pn",children:l.name})]},l.name))]})}const Ft=3500;function Ot({toast:s,onClose:t}){return p.useEffect(()=>{const n=setTimeout(t,Ft);return()=>clearTimeout(n)},[s]),e.jsxs("div",{className:`toast ${s.kind}`,children:[e.jsx("div",{children:s.msg}),e.jsx("div",{style:{marginTop:8},children:e.jsx("button",{className:"btn ghost",onClick:t,children:"Dismiss"})})]})}function Lt({runs:s,open:t,onToggle:n,onClear:c,onCancel:a,busy:l}){const i=p.useRef(null),r=s.length?s[s.length-1].output.length:0;return p.useEffect(()=>{const u=i.current;u&&t&&(u.scrollTop=u.scrollHeight)},[s.length,r,t]),e.jsxs("div",{className:"console",style:{height:"42vh",transform:t?"none":"translateY(calc(42vh - 42px))"},children:[e.jsxs("div",{className:"console-head",onClick:n,children:[e.jsxs("span",{className:"ttl",children:[e.jsx("span",{className:`live ${l?"on":""}`}),"terminal"]}),e.jsx("span",{className:"count",children:s.length}),e.jsxs("div",{className:"right",onClick:u=>u.stopPropagation(),children:[e.jsx("button",{className:"iconbtn",title:"Clear",onClick:c,disabled:!s.length,children:e.jsx(E,{name:"clear"})}),e.jsx("button",{className:"iconbtn",title:t?"Collapse":"Expand","aria-expanded":t,onClick:n,children:e.jsx(E,{name:"chevron",className:"glyph",style:{transform:t?"rotate(90deg)":"rotate(-90deg)"}})})]})]}),t&&e.jsxs("div",{className:"console-body",ref:i,children:[s.length===0&&e.jsx("div",{className:"console-empty",children:"No commands run yet. Actions you trigger stream here."}),s.map(u=>e.jsxs("div",{className:"run",children:[e.jsxs("div",{className:"run-head",children:[e.jsx("span",{className:"pr",children:"$"}),e.jsx("span",{className:"act",children:u.action}),e.jsx("span",{className:`st ${u.status}`,children:u.status==="running"?"…running":`${u.status==="done"?"✓ done":"✗ failed"}${u.duration?` · ${u.duration}s`:""}`}),u.status==="running"&&a&&e.jsx("button",{className:"iconbtn run-cancel",title:"Cancel this run",onClick:()=>a(u.id),children:e.jsx(E,{name:"x"})})]}),u.output&&e.jsx("pre",{className:"run-out",children:u.output})]},u.id))]})]})}const Rt=550,xe="gs-splash-seen";function Dt(){try{if(window.localStorage.getItem(xe))return 0;window.localStorage.setItem(xe,"1")}catch{}return Rt}function It({ready:s,onDone:t}){const[n,c]=p.useState(!1),[a,l]=p.useState(!1);p.useEffect(()=>{const r=Dt();if(!r){c(!0);return}const u=setTimeout(()=>c(!0),r);return()=>clearTimeout(u)},[]),p.useEffect(()=>{s&&n&&l(!0)},[s,n]),p.useEffect(()=>{if(!a)return;const r=setTimeout(()=>t==null?void 0:t(),700);return()=>clearTimeout(r)},[a]);const i=r=>{r.animationName==="splashOut"&&(t==null||t())};return e.jsxs("div",{className:`boot-splash${a?" fading":""}`,"aria-hidden":"true",onAnimationEnd:i,children:[e.jsxs("div",{className:"boot-dial",children:[e.jsxs("svg",{className:"boot-ring",viewBox:"0 0 172 172",children:[e.jsx("circle",{cx:"86",cy:"86",r:"72",fill:"none",stroke:"var(--surface-3)",strokeWidth:"9"}),e.jsx("circle",{cx:"86",cy:"86",r:"50",fill:"none",stroke:"var(--line-2)",strokeWidth:"8",strokeDasharray:"1.2 5.3",opacity:".7"}),e.jsx("circle",{className:"boot-progress",cx:"86",cy:"86",r:"72",fill:"none",stroke:"var(--accent)",strokeWidth:"9",strokeLinecap:"round"})]}),e.jsxs("svg",{className:"boot-sprout",viewBox:"0 0 24 24",children:[e.jsx("path",{className:"bs-stem",d:"M12 21.5v-9",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",fill:"none"}),e.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)"}),e.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"}),e.jsx("circle",{cx:"12",cy:"12.4",r:"1.1",fill:"var(--bg)"})]})]}),e.jsxs("div",{className:"boot-status",children:[e.jsx("span",{children:"germinating harness"}),e.jsx("span",{className:"boot-caret"})]})]})}function Ee({label:s="Loading…"}){return e.jsx("div",{className:"loading",children:s})}function Pt({value:s,size:t=232}){const n=t/2-14,c=2*Math.PI*n,a=c*(1-s);return e.jsxs("div",{className:"ring-wrap",style:{width:t,height:t},children:[e.jsxs("svg",{viewBox:`0 0 ${t} ${t}`,children:[e.jsx("circle",{cx:t/2,cy:t/2,r:n,fill:"none",stroke:"var(--surface-3)",strokeWidth:"10"}),e.jsx("circle",{cx:t/2,cy:t/2,r:n,fill:"none",stroke:"var(--accent)",strokeWidth:"10",strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:a,style:{transition:"stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1)"}}),Array.from({length:48}).map((l,i)=>{const r=i/48*2*Math.PI,u=n-18,j=n-24,x=t/2+Math.cos(r)*u,d=t/2+Math.sin(r)*u,o=t/2+Math.cos(r)*j,g=t/2+Math.sin(r)*j;return e.jsx("line",{x1:x,y1:d,x2:o,y2:g,stroke:"var(--line-2)",strokeWidth:"1",opacity:i/48<s?.9:.25},i)})]}),e.jsxs("div",{className:"ring-center",children:[e.jsxs("div",{className:"pct",children:[Math.round(s*100),e.jsx("span",{style:{fontSize:20,color:"var(--text-3)"},children:"%"})]}),e.jsx("div",{className:"lbl",children:"germination"})]})]})}function Bt({overview:s}){const t=se(s.diff),n=s.counts||{},c=[{key:"agents",label:"Agents",hash:"#/agents"},{key:"skills",label:"Skills",hash:"#/skills"},{key:"laws",label:"Invariants",hash:"#/laws"}];return e.jsxs("div",{className:"card kpiband rise mb-16",children:[c.map(a=>{const l=n[a.key];return e.jsxs("a",{className:"kseg",href:a.hash,title:`Open ${a.label}`,children:[e.jsx("span",{className:"kseg-n"+(l===0?" zero":""),children:l??"—"}),e.jsx("span",{className:"kseg-l",children:a.label})]},a.key)}),e.jsx("div",{className:"kseg-spacer"}),e.jsxs("button",{className:"kseg"+(t>0?" hot":""),onClick:()=>W("#/diff"),title:"Open changes",children:[e.jsx("span",{className:"kseg-n"+(t===0?" zero":""),children:t}),e.jsx("span",{className:"kseg-l",children:"Local edits"}),t>0&&e.jsx("span",{className:"delta up",children:"▲"})]})]})}function Vt({overview:s}){return e.jsx("div",{className:"genome",children:I.map((t,n)=>{var l;const c=U[t],a=(l=s.counts)==null?void 0:l[t];return e.jsxs("div",{className:"card gcell rise",style:{animationDelay:`${n*50}ms`},onClick:()=>W("#/section/"+t),children:[e.jsxs("div",{className:"gtop",children:[e.jsx("span",{className:"gname",children:c.label}),e.jsx(E,{name:c.icon,className:"gicon"})]}),e.jsx("div",{className:"gcount"+(a===0?" zero":""),children:a??"—"}),e.jsx("div",{className:"gdesc",children:c.desc})]},t)})})}function de({jobs:s}){if(!s||s.length===0)return e.jsx("div",{className:"feed",children:e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"big",children:"No activity yet"}),"Actions you run appear here."]})});const t={done:"ok",running:"acc",failed:"bad"},n=[...s].sort((c,a)=>a.started-c.started).slice(0,8);return e.jsx("div",{className:"feed",children:n.map(c=>e.jsxs("div",{className:"feed-row",children:[e.jsx("span",{className:`feed-dot ${t[c.status]||"ok"}`}),e.jsx("span",{className:"feed-txt",children:e.jsx("b",{children:c.action})}),e.jsxs("span",{className:"feed-when",children:[vt(c.started)," ago"]})]},c.id))})}const zt={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 Ht({overview:s,sigil:t,setup:n,jobs:c,onAction:a}){const l=s.deployed?zt[s.theme]||"Loaded & ready":"Not deployed",i=Nt(s,n);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"card pad-lg rise mb-16",children:e.jsxs("div",{className:"hero",children:[e.jsx(Pt,{value:i}),e.jsxs("div",{className:"hero-facts",children:[e.jsx("div",{className:"ttl",children:l}),t&&e.jsxs("div",{className:"voice-readout",children:[e.jsx("span",{className:"vr-cur",children:"▕"}),e.jsx("span",{className:"vr-txt",children:t})]},s.theme),e.jsxs("p",{className:"sub",children:["One source rendered into ",e.jsx("code",{children:s.target}),". Every repo on this machine inherits it."]}),e.jsxs("div",{className:"hero-chips",children:[e.jsxs("span",{className:"chip",children:[e.jsx("span",{className:"ck",children:"voice"}),e.jsx("span",{className:"cv",style:{textTransform:"capitalize"},children:s.theme})]}),e.jsxs("span",{className:"chip",children:[e.jsx("span",{className:"ck",children:"mode"}),e.jsx("span",{className:"cv",children:s.emit})]}),e.jsxs("span",{className:"chip",children:[e.jsx("span",{className:"ck",children:"footprint"}),e.jsx("span",{className:"cv",children:s.footprint})]}),e.jsxs("span",{className:"chip",children:[e.jsx("span",{className:"ck",children:"built"}),e.jsx("span",{className:"cv",children:s.build_time||"unknown"})]}),e.jsxs("span",{className:"chip",children:[e.jsx("span",{className:"ck",children:"fp"}),e.jsx("span",{className:"cv",children:(n==null?void 0:n.installed_fp)||"—"})]})]}),e.jsxs("div",{className:"row wrap gap-10",children:[e.jsxs("button",{className:"btn",onClick:()=>a("update"),children:[e.jsx(E,{name:"refresh"}),"Update"]}),e.jsxs("button",{className:"btn ghost",onClick:()=>a("build-all"),children:[e.jsx(E,{name:"build"}),"Rebuild"]}),e.jsxs("button",{className:"btn ghost",onClick:()=>a("doctor"),children:[e.jsx(E,{name:"doctor"}),"Run doctor"]})]})]})]})}),e.jsx(Bt,{overview:s}),e.jsxs("div",{className:"grid split-status",children:[e.jsxs("div",{className:"card pad-lg",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Capability genome"}),e.jsx("div",{className:"right",children:e.jsxs("span",{className:"tick",children:[I.length," sections"]})})]}),e.jsx(Vt,{overview:s})]}),e.jsxs("div",{className:"card pad-lg",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Recent activity"}),e.jsx("div",{className:"right",children:e.jsxs("span",{className:"badge acc",children:[e.jsx("span",{className:"dot"}),"live"]})})]}),e.jsx(de,{jobs:c})]})]})]})}function Ut({k:s,overview:t,max:n}){var l;const c=U[s],a=((l=t.counts)==null?void 0:l[s])??0;return e.jsxs("div",{className:"strand",onClick:()=>W("#/section/"+s),children:[e.jsxs("span",{className:"strand-name",children:[e.jsx("span",{className:"strand-dot"}),e.jsx("span",{children:c.label})]}),e.jsx("div",{className:"hbar",children:e.jsx("i",{style:{width:`${a/n*100}%`}})}),e.jsx("span",{className:"strand-val",children:a})]})}const $={maxNodes:28,goldenAngle:2.39996,seedRadiusScale:.42,iterations:90,repulsion:480,springLength:46,springStiffness:.05,centrePull:.005,boundsMargin:{x:16,y:14},edgeCurve:{max:20,scale:.14}},K={baseRadius:{agent:4,law:3,skill:3.2},degreeScale:.45,degreeMax:3.6,hubGlowScale:3.2,hub:{minDegree:3,maxFraction:.55}};function Wt({graph:s}){const[c,a]=p.useState(null),{nodes:l,edges:i,pos:r,degrees:u,maxDeg:j}=p.useMemo(()=>{const f={nodes:[],edges:[],pos:new Map,degrees:new Map,maxDeg:0};if(!s||!s.nodes.length)return f;const m=new Map;s.edges.forEach(M=>{m.set(M.source,(m.get(M.source)||0)+1),m.set(M.target,(m.get(M.target)||0)+1)});const b=[...s.nodes].sort((M,N)=>(m.get(N.id)||0)-(m.get(M.id)||0)).slice(0,$.maxNodes),v=new Set(b.map(M=>M.id)),k=s.edges.filter(M=>v.has(M.source)&&v.has(M.target)),R=440/2,P=230/2,F=new Map;b.forEach((M,N)=>{if(N===0)F.set(M.id,{x:R,y:P});else{const A=N*$.goldenAngle,T=Math.sqrt(N/b.length);F.set(M.id,{x:R+Math.cos(A)*T*(440*$.seedRadiusScale),y:P+Math.sin(A)*T*(230*$.seedRadiusScale)})}});const B=b.map(M=>F.get(M.id));for(let M=0;M<$.iterations;M++){for(let N=0;N<B.length;N++)for(let A=N+1;A<B.length;A++){const T=B[N],D=B[A],y=T.x-D.x,L=T.y-D.y,V=y*y+L*L||1,z=Math.sqrt(V),q=$.repulsion/V;T.x+=y/z*q,T.y+=L/z*q,D.x-=y/z*q,D.y-=L/z*q}for(const N of k){const A=F.get(N.source),T=F.get(N.target),D=T.x-A.x,y=T.y-A.y,L=Math.sqrt(D*D+y*y)||1,V=(L-$.springLength)*$.springStiffness;A.x+=D/L*V,A.y+=y/L*V,T.x-=D/L*V,T.y-=y/L*V}for(const N of B)N.x+=(R-N.x)*$.centrePull,N.y+=(P-N.y)*$.centrePull,N.x=Math.max($.boundsMargin.x,Math.min(440-$.boundsMargin.x,N.x)),N.y=Math.max($.boundsMargin.y,Math.min(230-$.boundsMargin.y,N.y))}const J=Math.max(1,...m.values());return{nodes:b,edges:k,pos:F,degrees:m,maxDeg:J}},[s]),x=p.useMemo(()=>{if(!c)return null;const f=new Set([c]);return i.forEach(m=>{m.source===c&&f.add(m.target),m.target===c&&f.add(m.source)}),f},[c,i]);if(!l.length)return e.jsx("div",{style:{height:200,display:"grid",placeItems:"center",color:"var(--text-3)",fontSize:13},children:"no cross-links yet"});const d=c?r.get(c):null,o=c?l.find(f=>f.id===c):null,g=(o==null?void 0:o.type)==="law"?`Rule ${c}`:c;return e.jsxs("svg",{viewBox:"0 0 440 230",style:{width:"100%",height:"auto",display:"block"},role:"img","aria-label":"Cross-link constellation",onMouseLeave:()=>a(null),children:[e.jsx("defs",{children:e.jsxs("radialGradient",{id:"mg-hub-glow",cx:"50%",cy:"50%",r:"50%",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--accent)",stopOpacity:"0.42"}),e.jsx("stop",{offset:"60%",stopColor:"var(--accent)",stopOpacity:"0.08"}),e.jsx("stop",{offset:"100%",stopColor:"var(--accent)",stopOpacity:"0"})]})}),i.map((f,m)=>{const h=r.get(f.source),b=r.get(f.target);if(!h||!b)return null;const v=c&&(f.source===c||f.target===c),k=c&&!v,R=b.x-h.x,P=b.y-h.y,F=Math.sqrt(R*R+P*P)||1,B=Math.min($.edgeCurve.max,F*$.edgeCurve.scale),J=(h.x+b.x)/2+-P/F*B,M=(h.y+b.y)/2+R/F*B;return e.jsx("path",{d:`M${h.x},${h.y} Q${J},${M} ${b.x},${b.y}`,fill:"none",stroke:v?"var(--accent)":"var(--line-2)",strokeWidth:v?1.3:.9,opacity:k?.14:v?.95:.55},m)}),l.map(f=>{const m=r.get(f.id);if(!m)return null;const h=u.get(f.id)||0,v=(K.baseRadius[f.type]??K.baseRadius.skill)+Math.min(K.degreeMax,h*K.degreeScale),k=h>=Math.max(K.hub.minDegree,j*K.hub.maxFraction),R=h===0,P=x&&!x.has(f.id),F=f.type==="agent"?"var(--accent)":f.type==="law"?"var(--warn)":"var(--good)";return e.jsxs("g",{opacity:P?.22:1,onMouseEnter:()=>a(f.id),style:{cursor:"pointer"},children:[k&&e.jsx("circle",{cx:m.x,cy:m.y,r:v*K.hubGlowScale,fill:"url(#mg-hub-glow)"}),e.jsx("circle",{cx:m.x,cy:m.y,r:v,fill:F,fillOpacity:R?.55:1,stroke:"var(--bg)",strokeWidth:"1.4"})]},f.id)}),d&&e.jsx("text",{x:d.x+(d.x>350?-10:10),y:d.y-9,textAnchor:d.x>350?"end":"start",fontSize:"11",fill:"var(--text)",style:{paintOrder:"stroke",stroke:"var(--bg)",strokeWidth:3},children:g})]})}function Gt({overview:s,sigil:t,setup:n,jobs:c,graph:a}){const l=we(s.counts),i=(n==null?void 0:n.version_verdict)||"",r=i.includes("up to date"),u=se(s.diff),j=[["Source","src/, the canonical genetic material",(n==null?void 0:n.source_fp)||"—",!0],["Render",`geneseed build → ${s.emit}`,s.theme+" voice",!0],["Deployed",s.target,"inherited by every repo",!1]];return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid split-lineage mb-16",children:[e.jsxs("div",{className:"card pad-lg rise",style:{position:"relative",overflow:"hidden"},children:[e.jsx("h2",{className:"h",style:{fontSize:22,margin:"0 0 18px"},children:"Gene-seed lineage"}),e.jsxs("div",{className:"lineage-track",children:[e.jsx("div",{className:"spine"}),j.map(([x,d,o,g],f)=>e.jsxs("div",{className:"lineage-step",children:[e.jsx("span",{className:`node ${g?"on":""}`}),e.jsx("div",{className:"lt",children:x}),e.jsx("div",{className:"ld",children:d}),e.jsx("div",{className:"ltag",children:o})]},f))]}),e.jsx("hr",{className:"hr"}),t&&e.jsxs("div",{className:"voice-readout",style:{marginBottom:14},children:[e.jsx("span",{className:"vr-cur",children:"▕"}),e.jsx("span",{className:"vr-txt",children:t})]},s.theme),e.jsxs("div",{className:"row wrap gap-10",children:[e.jsxs("span",{className:`badge ${r?"ok":"warn"}`,children:[e.jsx("span",{className:"dot"}),"in sync · ",i]}),e.jsxs("span",{className:"badge",children:[e.jsx("span",{className:"dot"}),u," local edits"]})]})]}),e.jsxs("div",{className:"card pad-lg rise",style:{animationDelay:"80ms"},children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Cross-link constellation"}),e.jsx("div",{className:"right",children:e.jsxs("button",{className:"btn soft sm",onClick:()=>W("#/graph"),children:["Open graph",e.jsx(E,{name:"arrow"})]})})]}),e.jsx(Wt,{graph:a})]})]}),e.jsxs("div",{className:"grid split-even",children:[e.jsxs("div",{className:"card pad-lg",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Genome strand"}),e.jsx("div",{className:"right",children:e.jsx("span",{className:"tick",children:"by volume"})})]}),I.map(x=>e.jsx(Ut,{k:x,overview:s,max:l},x))]}),e.jsxs("div",{className:"card pad-lg",children:[e.jsx("div",{className:"card-head",children:e.jsx("h3",{children:"Recent activity"})}),e.jsx(de,{jobs:c})]})]})]})}function Zt({overview:s,setup:t,jobs:n}){var u,j,x;const c=I.reduce((d,o)=>{var g;return d+(((g=s.counts)==null?void 0:g[o])??0)},0),a=we(s.counts),l=(u=s.doctor)==null?void 0:u.ok,i=((x=(j=s.doctor)==null?void 0:j.problems)==null?void 0:x.length)??0,r=se(s.diff);return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"card pad-md rise mb-16",children:e.jsx("div",{className:"row wrap between gap-16",children:e.jsxs("div",{className:"row",style:{gap:20,flexWrap:"wrap"},children:[e.jsxs("div",{children:[e.jsx("div",{className:"tick",children:"status"}),e.jsx("div",{className:"row",style:{gap:8,marginTop:4},children:e.jsxs("span",{className:`badge ${s.deployed?"ok":"warn"}`,children:[e.jsx("span",{className:"dot"}),s.deployed?"deployed":"not deployed"]})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"tick",children:"voice"}),e.jsx("div",{className:"metric",style:{fontSize:18,marginTop:6,textTransform:"capitalize"},children:s.theme})]}),e.jsxs("div",{children:[e.jsx("div",{className:"tick",children:"mode"}),e.jsx("div",{className:"mono",style:{fontSize:14,marginTop:6},children:s.emit})]}),e.jsxs("div",{children:[e.jsx("div",{className:"tick",children:"fingerprint"}),e.jsx("div",{className:"mono",style:{fontSize:14,marginTop:6,color:"var(--accent)"},children:(t==null?void 0:t.installed_fp)||"—"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"tick",children:"doctor"}),e.jsx("div",{className:"row",style:{gap:8,marginTop:4},children:l?e.jsxs("span",{className:"badge ok",children:[e.jsx("span",{className:"dot"}),"clean"]}):e.jsxs("span",{className:"badge warn",children:[e.jsx("span",{className:"dot"}),i," issue",i!==1?"s":""]})})]}),e.jsxs("div",{children:[e.jsx("div",{className:"tick",children:"edits"}),e.jsx("div",{className:"metric",style:{fontSize:18,marginTop:6},children:r})]})]})})}),e.jsxs("div",{className:"grid split-operator",children:[e.jsxs("div",{className:"card rise",style:{animationDelay:"60ms"},children:[e.jsxs("div",{className:"card-head pad-lg",style:{padding:"18px 20px 0",marginBottom:14},children:[e.jsx("h3",{children:"Sections"}),e.jsx("div",{className:"right",children:e.jsxs("span",{className:"tick",children:[c," entries total"]})})]}),e.jsxs("table",{className:"tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Section"}),e.jsx("th",{children:"Detail"}),e.jsx("th",{style:{width:130},children:"Share"}),e.jsx("th",{className:"num",children:"Count"})]})}),e.jsx("tbody",{children:I.map(d=>{var f;const o=U[d],g=((f=s.counts)==null?void 0:f[d])??0;return e.jsxs("tr",{className:"clickable",onClick:()=>W("#/section/"+d),children:[e.jsx("td",{className:"name",children:o.label}),e.jsx("td",{className:"muted",children:o.desc}),e.jsx("td",{children:e.jsx("div",{className:"hbar",children:e.jsx("i",{style:{width:`${g/a*100}%`}})})}),e.jsx("td",{className:"num",children:g})]},d)})})]})]}),e.jsxs("div",{className:"card pad-lg rise",style:{animationDelay:"120ms"},children:[e.jsx("div",{className:"card-head",children:e.jsx("h3",{children:"Run log"})}),e.jsx(de,{jobs:n})]})]})]})}const Kt=864e5;function _e(s,t=10,n="today"){const c=new Array(t).fill(0).map((l,i)=>({t:i===t-1?n:`${t-1-i}d`,v:0})),a=Date.now();for(const l of s){const i=l.started||l.finished||l.created||l.ts;if(!i)continue;const r=typeof i=="string"?Date.parse(i):i*1e3;if(!Number.isFinite(r))continue;const u=Math.floor((a-r)/Kt);u<0||u>=t||(c[t-1-u].v+=1)}return c}const Yt=12,qt=120,H=["#2BB673","#16A6A6","#E8A23B","#E07A5F","#8E7DBE","#5BD08A","#79856E"];function ge({segments:s,size:t=186,stroke:n=26,caption:c="capabilities"}){const a=s.reduce((j,x)=>j+x.value,0)||1,l=t/2-n/2,i=t/2,r=t/2;let u=0;return e.jsxs("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[e.jsx("circle",{cx:i,cy:r,r:l,fill:"none",stroke:"var(--surface-3)",strokeWidth:n}),s.map((j,x)=>{if(j.value/a<=0)return null;const o=u/a*2*Math.PI-Math.PI/2,g=(u+j.value)/a*2*Math.PI-Math.PI/2;u+=j.value;const f=i+l*Math.cos(o),m=r+l*Math.sin(o),h=i+l*Math.cos(g),b=r+l*Math.sin(g),v=g-o>Math.PI?1:0;return e.jsx("path",{d:`M ${f} ${m} A ${l} ${l} 0 ${v} 1 ${h} ${b}`,fill:"none",stroke:j.color,strokeWidth:n,strokeLinecap:"butt",children:e.jsxs("title",{children:[j.label,": ",j.value]})},x)}),e.jsx("text",{x:i,y:r-4,textAnchor:"middle",className:"donut-c-num",children:a}),e.jsx("text",{x:i,y:r+16,textAnchor:"middle",className:"donut-c-cap",children:c})]})}function Jt(s){if(s.length<2)return s.length?`M${s[0][0]},${s[0][1]}`:"";let t=`M${s[0][0]},${s[0][1]}`;for(let n=0;n<s.length-1;n++){const c=s[n-1]||s[n],a=s[n],l=s[n+1],i=s[n+2]||l,r=a[0]+(l[0]-c[0])/6,u=a[1]+(l[1]-c[1])/6,j=l[0]-(i[0]-a[0])/6,x=l[1]-(i[1]-a[1])/6;t+=` C${r},${u} ${j},${x} ${l[0]},${l[1]}`}return t}function Xt({data:s,height:t=156,accent:n}){if(!s.length)return null;const c=600,a=t,l=6,i=14,r=6,u=Math.max(...s.map(h=>h.v),1)+1,j=c-l*2,x=s.length>1?j/(s.length-1):j,d=s.map((h,b)=>{const v=l+b*x,k=a-r-h.v/u*(a-i-r);return[v,k]}),o=Jt(d),g=d[d.length-1],f=d[0],m=`${o} L${g[0]},${a} L${f[0]},${a} Z`;return e.jsxs("svg",{viewBox:`0 0 ${c} ${a}`,preserveAspectRatio:"none",style:{width:"100%",height:t,display:"block",overflow:"visible"},children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"b-grad",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0",stopColor:n,stopOpacity:".28"}),e.jsx("stop",{offset:"1",stopColor:n,stopOpacity:"0"})]})}),e.jsx("path",{d:m,fill:"url(#b-grad)"}),e.jsx("path",{d:o,fill:"none",stroke:n,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),e.jsx("circle",{cx:g[0],cy:g[1],r:"3.5",fill:n,vectorEffect:"non-scaling-stroke"})]})}function ne({label:s,value:t,sub:n,color:c,icon:a}){return e.jsxs("div",{className:"b-tile",children:[e.jsx("span",{className:"b-tile-ic",style:{background:`color-mix(in srgb, ${c} 18%, transparent)`,color:c},children:e.jsx(E,{name:a})}),e.jsxs("div",{className:"b-tile-body",children:[e.jsx("div",{className:"b-tile-val"+(t===0?" zero":""),children:t}),e.jsx("div",{className:"b-tile-label",children:s})]}),e.jsx("div",{className:"b-tile-sub",children:n})]})}const Qt={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 ea({overview:s,sigil:t,jobs:n,doctor:c,onAction:a}){const l=s.counts||{},i=(c==null?void 0:c.groups)||[],r=i.length>0,u=i.filter(h=>h.problems.length===0).length,j=i.length||1,x=s.deployed?Qt[s.theme]||"Loaded & ready":"Not deployed",d=se(s.diff),o=I.filter(h=>(l[h]||0)>0).map((h,b)=>({label:U[h].label,value:l[h]||0,color:H[b%H.length]})),g=o.reduce((h,b)=>h+b.value,0),f=_e(n||[],10),m=f.reduce((h,b)=>h+b.v,0);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"b-greet",children:[e.jsxs("div",{children:[e.jsx("div",{className:"eyebrow",children:"your harness"}),e.jsx("h1",{className:"h b-h",children:x}),e.jsx("p",{className:"sub",children:t||"A friendly read of every layer growing in your harness."})]}),e.jsxs("div",{className:"row gap-8",children:[e.jsxs("button",{className:"btn",onClick:()=>a("update"),children:[e.jsx(E,{name:"refresh"}),"Update"]}),e.jsxs("button",{className:"btn ghost",onClick:()=>a("build-all"),children:[e.jsx(E,{name:"build"}),"Rebuild"]})]})]}),e.jsxs("div",{className:"grid b-hero-grid mb-16",children:[e.jsxs("div",{className:"card b-hero",children:[e.jsx("div",{className:"b-hero-ring",children:e.jsx(ge,{segments:[{label:"pass",value:u,color:H[0]},{label:"attention",value:Math.max(j-u,0),color:H[2]}],size:168,stroke:20,caption:"checks"})}),e.jsxs("div",{className:"b-hero-side",children:[e.jsx("h3",{className:"b-hero-title",children:r?`${u} of ${j} checks pass`:"Running checks…"}),e.jsxs("p",{className:"sub",children:["One source, rendered into ",e.jsx("code",{children:s.target})," and inherited by every repo on this machine."]}),r&&e.jsx("ul",{className:"b-hero-checks",children:i.map(h=>{const b=h.problems.length===0;return e.jsxs("li",{className:`b-hcheck ${b?"ok":"bad"}`,title:b?"clean":h.problems.join("; "),children:[e.jsx("span",{className:"b-hcheck-mark",children:b?"✓":"!"}),e.jsx("span",{className:"b-hcheck-label",children:h.label})]},h.label)})}),e.jsxs("div",{className:"b-chips",children:[e.jsxs("span",{className:"b-chip",children:[e.jsx("b",{style:{textTransform:"capitalize"},children:s.theme})," voice"]}),e.jsx("span",{className:"b-chip",children:e.jsx("b",{children:s.emit})}),e.jsxs("span",{className:"b-chip",children:["built ",e.jsx("b",{children:s.build_time||"unknown"})]})]})]})]}),e.jsxs("div",{className:"b-tiles",children:[e.jsx(ne,{label:"Agents",value:l.agents??"—",sub:"specialists",color:H[0],icon:"layers"}),e.jsx(ne,{label:"Skills",value:l.skills??"—",sub:"workflows",color:H[1],icon:"skill"}),e.jsx(ne,{label:"Invariants",value:l.laws??"—",sub:l.doctrines?`${l.doctrines.active}/${l.doctrines.total} packs · ${l.doctrines.rules} rules`:"all upheld",color:H[2],icon:"law"}),e.jsx(ne,{label:"Edits",value:d,sub:"to graft",color:H[3],icon:"changes"})]})]}),e.jsxs("div",{className:"grid split-even mb-16",children:[e.jsxs("div",{className:"card pad-lg b-mix-card",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Capability mix"}),e.jsx("div",{className:"right",children:e.jsxs("span",{className:"tick",children:[g," total"]})})]}),e.jsxs("div",{className:"b-mix",children:[e.jsx(ge,{segments:o,size:186,stroke:26}),e.jsx("div",{className:"b-legend",children:o.map(h=>e.jsxs("div",{className:"b-leg-row",children:[e.jsx("span",{className:"b-leg-dot",style:{background:h.color}}),e.jsx("span",{className:"b-leg-name",children:h.label}),e.jsx("span",{className:"b-leg-bar",children:e.jsx("i",{style:{width:`${h.value/g*100}%`,background:h.color}})}),e.jsx("span",{className:"b-leg-val",children:h.value})]},h.label))})]})]}),e.jsxs("div",{className:"card pad-lg",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Recent runs"}),e.jsx("div",{className:"right",children:e.jsxs("span",{className:"badge ok",children:[e.jsx("span",{className:"dot"}),"job log"]})})]}),e.jsxs("div",{className:"b-stat-lead",children:[e.jsx("span",{className:"b-stat-big",children:m}),e.jsxs("span",{className:"b-stat-cap",children:["runs in the last 10 days · ",u,"/",j," checks pass now"]})]}),e.jsx(Xt,{data:f,accent:H[0],height:156})]})]}),e.jsxs("div",{className:"card pad-lg",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Recent activity"}),e.jsx("div",{className:"right",children:e.jsxs("span",{className:"tick",children:["last ",Math.min((n==null?void 0:n.length)||0,12)," runs"]})})]}),e.jsxs("div",{className:"b-timeline",children:[(n||[]).slice(0,Yt).map(h=>{const b=h.status==="done",k=h.status==="failed"?"warn":b?"ok":"acc";return e.jsxs("div",{className:"b-tl-row",children:[e.jsx("span",{className:`b-tl-node ${k}`}),e.jsxs("div",{className:"b-tl-body",children:[e.jsx("b",{children:h.action}),h.output?`: ${h.output.split(`
|
|
11
|
-
`)[0].slice(0,qt)}`:""]}),e.jsx("span",{className:"b-tl-when",children:h.duration?`${h.duration}s`:h.status})]},h.id)}),(!n||n.length===0)&&e.jsxs("div",{className:"b-tl-row",children:[e.jsx("span",{className:"b-tl-node"}),e.jsx("div",{className:"b-tl-body sub",children:"No runs yet. Trigger an action to populate this."}),e.jsx("span",{className:"b-tl-when",children:"—"})]})]})]})]})}const sa=14,ta=120;function Q({title:s,right:t,children:n,span:c}){return e.jsxs("div",{className:"c-mod",style:c?{gridColumn:`span ${c}`}:null,children:[e.jsxs("div",{className:"c-mod-head",children:[e.jsx("span",{className:"c-tab"}),e.jsx("h3",{children:s}),t&&e.jsx("span",{className:"c-mod-right",children:t})]}),e.jsx("div",{className:"c-mod-body",children:n})]})}function Y({label:s,value:t}){return e.jsxs("div",{className:"c-kpi",children:[e.jsx("div",{className:"c-kpi-label",children:s}),e.jsx("div",{className:"c-kpi-val"+(t===0?" zero":""),children:t})]})}function aa({data:s,height:t=120,hi:n}){if(!s.length)return null;const c=Math.max(...s.map(a=>a.v),1);return e.jsx("div",{className:"c-cols",style:{height:t},children:s.map((a,l)=>{const i=Math.max(a.v/c*(t-6),2);return e.jsx("div",{className:`c-col ${l===n?"hi":""}`,style:{height:i},title:`${a.t}: ${a.v}`},l)})})}function na({checks:s}){return e.jsx("div",{className:"c-band",children:s.map((t,n)=>e.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 ca(s){const t={};for(const n of s||[]){const c=n.action||"unknown";t[c]=(t[c]||0)+1}return Object.entries(t).map(([n,c])=>({label:n,value:c})).sort((n,c)=>c.value-n.value)}function la({overview:s,jobs:t,doctor:n,onAction:c}){const a=s.counts||{},l=I.reduce((m,h)=>m+(a[h]||0),0),i=Math.max(...I.map(m=>a[m]||0),1),r=(n==null?void 0:n.groups)||[],u=r.filter(m=>m.problems.length===0).length,j=_e(t||[],10,"0d"),x=j.reduce((m,h)=>m+h.v,0),d=ca(t),o=Math.max(...d.map(m=>m.value),1),g=se(s.diff),f=[["status",s.deployed?e.jsx("span",{className:"c-pill ok",children:"DEPLOYED"}):e.jsx("span",{className:"c-pill warn",children:"NOT DEPLOYED"})],["voice",e.jsx("span",{style:{textTransform:"capitalize"},children:s.theme})],["mode",s.emit],["doctor",r.length===0?e.jsx("span",{className:"c-pill",children:"—"}):u===r.length?e.jsx("span",{className:"c-pill ok",children:"CLEAN"}):e.jsxs("span",{className:"c-pill warn",children:[r.length-u," ISSUES"]})],["edits",String(g)],["built",s.build_time||"—"],["target",e.jsx("span",{className:"c-dim mono",children:s.target})]];return e.jsxs("div",{className:"c-root",children:[e.jsxs("div",{className:"c-titlebar",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"c-h1",children:"HARNESS // STATUS READOUT"}),e.jsxs("div",{className:"c-sub",children:[s.target," · rendered from src/ · inherited everywhere"]})]}),e.jsxs("div",{className:"row gap-8",children:[e.jsxs("button",{className:"btn",onClick:()=>c("update"),children:[e.jsx(E,{name:"refresh"}),"UPDATE"]}),e.jsx("button",{className:"btn ghost",onClick:()=>c("build-all"),children:"REBUILD"}),e.jsx("button",{className:"btn ghost",onClick:()=>c("doctor"),children:"DOCTOR"})]})]}),e.jsx("div",{className:"c-strip",children:f.map(([m,h],b)=>e.jsxs("div",{className:"c-strip-cell",children:[e.jsx("div",{className:"c-strip-k",children:m}),e.jsx("div",{className:"c-strip-v",children:h})]},b))}),e.jsxs("div",{className:"c-kpi-row",children:[e.jsx(Y,{label:"AGENTS",value:a.agents??"—"}),e.jsx(Y,{label:"SKILLS",value:a.skills??"—"}),e.jsx(Y,{label:"INVARIANTS",value:a.laws??"—"}),e.jsx(Y,{label:"PACKS",value:a.doctrines?`${a.doctrines.active}/${a.doctrines.total}`:"—"}),e.jsx(Y,{label:"MEMORY",value:a.memory??"—"}),e.jsx(Y,{label:"NOTEBOOK",value:a.notebook??"—"}),e.jsx(Y,{label:"EDITS",value:g})]}),e.jsxs("div",{className:"c-grid",children:[e.jsx(Q,{title:"CAPABILITY DISTRIBUTION",right:`${l} ENTRIES`,span:2,children:e.jsxs("table",{className:"c-tbl",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"SECTION"}),e.jsx("th",{children:"DETAIL"}),e.jsx("th",{style:{width:150},children:"SHARE"}),e.jsx("th",{className:"num",children:"N"})]})}),e.jsx("tbody",{children:I.map(m=>e.jsxs("tr",{children:[e.jsx("td",{className:"c-name",children:U[m].label}),e.jsx("td",{className:"c-dim",children:U[m].desc}),e.jsx("td",{children:e.jsx("div",{className:"c-bar",children:e.jsx("i",{style:{width:`${(a[m]||0)/i*100}%`,background:m==="agents"||m==="skills"?"var(--accent)":"var(--line-3)"}})})}),e.jsx("td",{className:(a[m]||0)>0?"num":"num c-dim",children:a[m]??0})]},m))})]})}),e.jsx(Q,{title:"DOCTOR // CHECKS",right:r.length?`${u}/${r.length}`:"—",children:r.length>0?e.jsxs(e.Fragment,{children:[e.jsx(na,{checks:r}),e.jsx("div",{className:"c-check-list",children:r.map(m=>{const h=m.problems.length===0;return e.jsxs("div",{className:"c-check-row",children:[e.jsx("span",{className:`c-dotmark ${h?"ok":"bad"}`}),e.jsx("span",{className:"c-check-name",children:m.label}),e.jsx("span",{className:"c-check-detail",children:h?"clean":`${m.problems.length} problem${m.problems.length===1?"":"s"}`})]},m.label)})})]}):e.jsx("p",{className:"c-dim mono",style:{fontSize:11},children:"No doctor run loaded yet."})}),e.jsxs(Q,{title:"RUN RATE // 10D",right:`${x} RUNS`,span:2,children:[e.jsx(aa,{data:j,height:120,hi:j.length-1}),e.jsx("div",{className:"c-axis",children:j.map((m,h)=>e.jsx("span",{children:h%2===0?m.t:""},h))})]}),e.jsx(Q,{title:"RUN LOG // BY TYPE",right:`${(t||[]).length} LOGGED`,children:d.length>0?e.jsx("table",{className:"c-tbl",children:e.jsx("tbody",{children:d.map(m=>e.jsxs("tr",{children:[e.jsx("td",{className:"c-name",style:{textTransform:"uppercase",fontWeight:400},children:m.label}),e.jsx("td",{children:e.jsx("div",{className:"c-bar",children:e.jsx("i",{style:{width:`${m.value/o*100}%`,background:"var(--accent)"}})})}),e.jsx("td",{className:"num",children:m.value})]},m.label))})}):e.jsx("p",{className:"c-dim mono",style:{fontSize:11},children:"No runs logged."})}),e.jsx(Q,{title:"RECENT // RUN LOG",span:3,children:e.jsx("table",{className:"c-tbl",children:e.jsxs("tbody",{children:[(t||[]).slice(0,sa).map(m=>{const h=m.status==="done",v=m.status==="failed"?"bad":h?"ok":"acc",k=m.output?m.output.split(`
|
|
12
|
-
`)[0].slice(0,ta):"—";return e.jsxs("tr",{children:[e.jsxs("td",{style:{width:96},children:[e.jsx("span",{className:`c-dotmark ${v}`})," ",e.jsx("span",{className:"c-dim",children:m.action})]}),e.jsx("td",{className:"c-name",style:{fontWeight:400},children:k}),e.jsx("td",{className:"num c-dim",children:m.duration?`${m.duration}s`:m.status})]},m.id)}),(!t||t.length===0)&&e.jsx("tr",{children:e.jsx("td",{colSpan:"3",className:"c-dim",style:{fontSize:11},children:"No runs logged."})})]})})})]})]})}function ia({error:s,style:t}){return s?e.jsx("p",{className:"badge bad",style:t,children:s}):null}function ra({onAction:s}){var o,g,f,m,h;const{data:t,error:n}=Se(()=>_.themes(),[]),[c,a]=p.useState(""),[l,i]=p.useState("");if(n)return e.jsx(ia,{error:n});if(!t)return e.jsx(Ee,{});const r=c||((o=t.current)==null?void 0:o.theme)||"neutral",u=(g=t.emits)==null?void 0:g.some(b=>b.name==="opencode-global"),j=l||(u?"opencode-global":((f=t.current)==null?void 0:f.emit)||((h=(m=t.emits)==null?void 0:m[0])==null?void 0:h.name)||""),x=a,d=i;return e.jsxs("div",{className:"narrow-lg",children:[e.jsx("div",{className:"head-row mb-18",children:e.jsxs("div",{children:[e.jsx("h1",{className:"h",children:"Deploy your harness"}),e.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."})]})}),e.jsxs("div",{className:"card pad-lg mb-16",children:[e.jsx("div",{className:"card-head",children:e.jsx("h3",{children:"1 · Choose a voice"})}),e.jsx("div",{className:"row wrap gap-10",children:t.themes.map(b=>e.jsxs("button",{className:`btn ${b.name===r?"soft":"ghost"}`,onClick:()=>x(b.name),title:b.blurb||b.tagline||b.name,children:[e.jsx("span",{className:"po",style:{width:10,height:10,borderRadius:"50%",background:ee(b.accent),boxShadow:`0 0 8px ${ee(b.accent)}`}}),e.jsx("span",{style:{textTransform:"capitalize"},children:b.name})]},b.name))})]}),e.jsxs("div",{className:"card pad-lg mb-16",children:[e.jsx("div",{className:"card-head",children:e.jsx("h3",{children:"2 · Install mode"})}),e.jsxs("p",{className:"sub mb-16",children:[e.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."]}),e.jsxs("label",{className:"stack",style:{gap:6,maxWidth:360},children:[e.jsx("span",{className:"tick",children:"Mode"}),e.jsx("select",{className:"sel",value:j,onChange:b=>d(b.target.value),children:t.emits.map(b=>e.jsxs("option",{value:b.name,children:[b.name,b.desc?` · ${b.desc}`:""]},b.name))})]})]}),e.jsxs("button",{className:"btn btn-grid",disabled:!j,onClick:()=>s("build",{theme:r,emit:j}),children:[e.jsx(E,{name:"build"}),"Deploy harness"]})]})}function oa({overview:s,themes:t,onAction:n,flavour:c="a",layout:a="auto"}){var b;const l=rt(c,a),[i,r]=p.useState("status"),[u,j]=p.useState(null),[x,d]=p.useState([]),[o,g]=p.useState(null),[f,m]=p.useState(null),h=s&&((b=t.find(v=>v.name===s.theme))==null?void 0:b.sigil)||"";return p.useEffect(()=>{let v=!0;return _.setup().then(k=>v&&j(k)).catch(()=>{}),_.jobs().then(k=>v&&d(k.jobs||[])).catch(()=>{}),_.graph().then(k=>v&&g(k)).catch(()=>{}),(l==="greenhouse"||l==="operator")&&_.doctor().then(k=>v&&m(k)).catch(()=>{}),()=>{v=!1}},[l]),s?s.deployed?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"head-row",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"h",children:"Harness console"}),e.jsx("p",{className:"sub",children:"A live readout of the harness this machine carries. Its voice, its capabilities, its drift from source."})]}),e.jsx("div",{className:"seg",children:[["status","Status"],["lineage","Lineage"],["operator","Operator"]].map(([v,k])=>e.jsx("button",{className:i===v?"on":"",onClick:()=>r(v),children:k},v))})]}),i==="status"&&l==="cultivar"&&e.jsx(Ht,{overview:s,sigil:h,setup:u,jobs:x,onAction:n}),i==="status"&&l==="greenhouse"&&e.jsx(ea,{overview:s,sigil:h,jobs:x,doctor:f,onAction:n}),i==="status"&&l==="operator"&&e.jsx(la,{overview:s,jobs:x,doctor:f,onAction:n}),i==="lineage"&&e.jsx(Gt,{overview:s,sigil:h,setup:u,jobs:x,graph:o}),i==="operator"&&e.jsx(Zt,{overview:s,setup:u,jobs:x})]}):e.jsx(ra,{onAction:n}):e.jsx("div",{className:"loading",children:"Loading…"})}const da=p.lazy(()=>O(()=>import("./Activity-D_sYBlW-.js"),__vite__mapDeps([0,1,2]))),ha=p.lazy(()=>O(()=>import("./ActivityDetail-BomKcMhy.js"),__vite__mapDeps([3,1,2]))),ua=p.lazy(()=>O(()=>import("./Library-DXhTN9ju.js"),__vite__mapDeps([4,1,5,6,7]))),ma=p.lazy(()=>O(()=>import("./Laws-CWk3Mpri.js"),__vite__mapDeps([8,1,9]))),pa=p.lazy(()=>O(()=>import("./Rules-eND7hJv9.js"),__vite__mapDeps([10,1]))),xa=p.lazy(()=>O(()=>import("./Profile-DfCHlZ03.js"),__vite__mapDeps([11,1,5,6]))),ga=p.lazy(()=>O(()=>import("./Skills-CDl9opZO.js"),__vite__mapDeps([12,1,5,6,7]))),fa=p.lazy(()=>O(()=>import("./Diff-BSvi1WUg.js"),__vite__mapDeps([13,1]))),ja=p.lazy(()=>O(()=>import("./Doctor-Cz1s-y1n.js"),__vite__mapDeps([14,1]))),ba=p.lazy(()=>O(()=>import("./Themes-CoAWuIeM.js"),__vite__mapDeps([15,1]))),va=p.lazy(()=>O(()=>import("./Graph-CuntzFJ0.js"),__vite__mapDeps([16,1,9]))),ya=p.lazy(()=>O(()=>import("./index-jrY4m9jP.js"),__vite__mapDeps([17,1]))),Na=p.lazy(()=>O(()=>import("./Harnesses-DgRyOviS.js"),__vite__mapDeps([18,1]))),ka=p.lazy(()=>O(()=>import("./index-Dg58ScBe.js"),__vite__mapDeps([19,1,6]))),wa=p.lazy(()=>O(()=>import("./About-DyK7yRy7.js"),__vite__mapDeps([20,1])));function Ma(){const s=zs(),t=s.view==="section",n=s.view==="item",c=s.view==="laws"||t&&s.section==="laws"||n&&s.type==="law",a=s.view==="skills"||t&&s.section==="skills"||n&&s.type==="skill",l=s.view==="library"||s.view==="agents"||(t||n)&&!c&&!a,i=s.view==="agents"?"agents":t?s.section:n?Zs[s.type]||s.type:void 0,r=n?s.name:void 0,[u,j]=p.useState(""),[x,d]=p.useState(null),[o,g]=p.useState(!1),[f,m]=p.useState(!1),[h,b]=Ys(),[v,k]=et(),[R,P]=nt(),[F,B]=ot(),[J,M]=p.useState(()=>!window.sessionStorage.getItem("gs-booted")),[N,A]=p.useState(!1),T=p.useRef(null);p.useEffect(()=>{if(!N)return;const w=te=>{te.key==="Escape"&&A(!1)};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[N]);const D=w=>{var te,he;return d({kind:((te=w==null?void 0:w.body)==null?void 0:te.kind)||"err",msg:((he=w==null?void 0:w.body)==null?void 0:he.message)||w.message})},{overview:y,themes:L,reload:V}=dt(D),[z,q]=p.useState(0),ie=()=>{V(),q(w=>w+1)},{runs:re,activeId:Ce,consoleOpen:Ae,setConsoleOpen:Te,runAction:G,cancelJob:$e,clearRuns:Fe}=pt({onFinish:ie,onError:D}),X=re[re.length-1],Oe=X?X.status==="running"?`${X.action} running`:`${X.action} ${X.status}`:"";p.useEffect(()=>{const w=T.current;w&&(R==="curated"&&Gs(w,v,h)||y!=null&&y.accent&&Us(w,y.accent,h))},[y,h,R,v]);const Le=async()=>{if(window.confirm("Stop the local Geneseed server? The console goes offline until you start it again.")){try{await _.shutdown()}catch{}m(!0)}};return f?e.jsxs("div",{className:`app fl-${v} ${h==="light"?"light":""}`,ref:T,children:[e.jsx("div",{className:"atmos","aria-hidden":"true"}),e.jsx("div",{className:"page",style:{display:"grid",placeItems:"center"},children:e.jsxs("p",{className:"sub",style:{textAlign:"center",maxWidth:480},children:["Server stopped. You can close this tab and reopen any time with"," ",e.jsx("code",{children:"geneseed web"}),"."]})})]}):e.jsxs("div",{className:`app fl-${v} ${h==="light"?"light":""}${N?" nav-open":""}`,ref:T,children:[e.jsx("div",{className:"atmos","aria-hidden":"true"}),e.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),e.jsx("p",{className:"sr-only",role:"status","aria-live":"polite",children:Oe}),N&&e.jsx("button",{type:"button",className:"nav-scrim","aria-label":"Close navigation",onClick:()=>A(!1)}),e.jsx(jt,{route:s,overview:y,onOpenVoice:()=>g(w=>!w),onNavigate:()=>A(!1)}),o&&e.jsx($t,{themes:L,current:y==null?void 0:y.theme,onPick:w=>{g(!1),G("build",{theme:w,emit:y==null?void 0:y.emit})},onClose:()=>g(!1)}),e.jsxs("div",{className:"col",children:[e.jsx(Tt,{route:s,navOpen:N,onToggleNav:()=>A(w=>!w),target:y==null?void 0:y.target,query:u,onQuery:j,mode:h,onToggleMode:b,onShutdown:Le,dataRev:z,onSwitch:ie}),e.jsx("main",{className:"page",id:"main",tabIndex:-1,children:e.jsx("div",{className:s.view==="harnesses"?"pad pad-wide":"pad",children:e.jsxs(p.Suspense,{fallback:e.jsx(Ee,{}),children:[s.view==="dashboard"&&e.jsx(oa,{overview:y,themes:L,onAction:G,flavour:v,layout:F}),s.view==="activity"&&e.jsx(da,{}),s.view==="activity-detail"&&e.jsx(ha,{sid:s.sid},s.sid),c&&e.jsx(ma,{selected:r,overview:y,onAction:G}),a&&e.jsx(ga,{selected:r}),l&&e.jsx(ua,{overview:y,section:i,selected:r,dataRev:z}),s.view==="rules"&&e.jsx(pa,{}),s.view==="profile"&&e.jsx(xa,{}),s.view==="diff"&&e.jsx(fa,{onMutated:V,dataRev:z}),s.view==="doctor"&&e.jsx(ja,{}),s.view==="themes"&&e.jsx(ba,{onAction:G}),s.view==="graph"&&e.jsx(va,{}),s.view==="settings"&&e.jsx(ya,{overview:y,onAction:G,flavour:v,onFlavour:k,accentMode:R,onAccentMode:P,layout:F,onLayout:B}),s.view==="harnesses"&&e.jsx(Na,{onAction:G,themes:L,currentTheme:y==null?void 0:y.theme,dataRev:z,onMutated:ie}),s.view==="docs"&&e.jsx(ka,{page:s.page,query:u,onAction:G,overview:y}),s.view==="about"&&e.jsx(wa,{})]})})}),e.jsx(Lt,{runs:re,open:Ae,busy:!!Ce,onToggle:()=>Te(w=>!w),onClear:Fe,onCancel:$e})]}),x&&e.jsx(Ot,{toast:x,onClose:()=>d(null)}),J&&e.jsx(It,{ready:!!y,onDone:()=>{window.sessionStorage.setItem("gs-booted","1"),M(!1)}})]})}Re(document.getElementById("root")).render(e.jsx(Ma,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});export{tt as A,ia as E,Js as F,E as I,Ee as L,U as S,_ as a,Ea as b,_a as c,ee as d,lt as e,it as f,W as g,le as h,e as j,vt as r,Se as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,I as c,a as u,F as N,A as g,e as p,f as w}from"./index-CH_Z725C.js";import{r as y}from"./react-DOpiTn5v.js";const k=30,v=1e3;function S(){const[l,i]=y.useState(!1),[t,o]=y.useState(!1),r=async()=>{if(window.confirm("Stop the local Geneseed server? The console goes offline until you start it again.")){try{await u.shutdown()}catch{}i(!0)}},h=async()=>{if(!window.confirm("Restart the local Geneseed server? The console reconnects in a moment."))return;o(!0);try{await u.restart()}catch{}(async(m=k)=>{for(let a=0;a<m;a++){await new Promise(n=>setTimeout(n,v));try{await u.ping(),window.location.reload();return}catch{}}window.location.reload()})()};return l?s.jsxs("p",{className:"sub",children:["Server stopped. You can close this tab and reopen any time with ",s.jsx("code",{children:"geneseed web"}),"."]}):s.jsxs("div",{className:"row",children:[s.jsxs("button",{className:"btn ghost",onClick:h,disabled:t,children:[s.jsx(c,{name:"refresh"}),t?"Restarting…":"Restart server"]}),s.jsxs("button",{className:"btn ghost",onClick:r,disabled:t,children:[s.jsx(c,{name:"x"}),"Stop server"]})]})}function T({overview:l,onAction:i,flavour:t,onFlavour:o,accentMode:r,onAccentMode:h,layout:d,onLayout:m}){var x,j,b;const a=l==null?void 0:l.install,n=l==null?void 0:l.footprint,f=e=>{!a||e===n||window.confirm(`Rebuild ${a.host} · ${a.scope} with the “${e}” footprint? It rebuilds in place, non-destructive.`)&&(i==null||i("install",{...a,footprint:e}))};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:"Settings"}),s.jsx("p",{className:"sub",children:"Console direction, harness footprint, machine maintenance (incl. git-pull update), and server control. See per-install detail in the Harnesses tab; build from there and the Dashboard."})]})}),t&&o&&s.jsxs("div",{className:"card pad-lg mb-16",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Console direction"})}),s.jsxs("p",{className:"sub mb-16",children:[N.length," takes on the same data. Pick a direction; it applies instantly and persists across reloads."]}),r&&h&&s.jsxs("div",{className:"dir-layout",children:[s.jsx("span",{className:"tick",id:"dir-accent-label",children:"Accent"}),s.jsx("div",{className:"seg",role:"group","aria-labelledby":"dir-accent-label",children:g.map(e=>s.jsx("button",{className:r===e.id?"on":"",onClick:()=>h(e.id),"aria-pressed":r===e.id,title:e.tagline,children:e.short},e.id))}),s.jsx("span",{className:"dir-layout-note sub",role:"status","aria-live":"polite",children:((x=g.find(e=>e.id===r))==null?void 0:x.tagline)??""})]}),d&&m&&s.jsxs("div",{className:"dir-layout",children:[s.jsx("span",{className:"tick",id:"dir-layout-label",children:"Dashboard layout"}),s.jsx("div",{className:"seg",role:"group","aria-labelledby":"dir-layout-label",children:p.map(e=>s.jsx("button",{className:d===e.id?"on":"",onClick:()=>m(e.id),"aria-pressed":d===e.id,title:e.tagline,children:e.short},e.id))}),s.jsx("span",{className:"dir-layout-note sub",role:"status","aria-live":"polite",children:d==="auto"?`Following the theme: ${((j=p.find(e=>e.id===w(t)))==null?void 0:j.short)??""}.`:((b=p.find(e=>e.id===d))==null?void 0:b.tagline)??""})]}),s.jsx("div",{className:"dir-grid",children:N.map(e=>s.jsxs("button",{className:`dir-tile dir-${e.id} ${t===e.id?"on":""}`,onClick:()=>o(e.id),"aria-pressed":t===e.id,children:[s.jsxs("span",{className:"dir-thumb","aria-hidden":"true",children:[s.jsx("span",{className:"dir-thumb-rail"}),s.jsx("span",{className:"dir-thumb-bar"}),s.jsx("span",{className:"dir-thumb-bar",style:{width:"70%"}}),s.jsx("span",{className:"dir-thumb-bar",style:{width:"52%"}}),s.jsx("span",{className:"dir-thumb-dot"})]}),s.jsxs("span",{className:"dir-meta",children:[s.jsxs("span",{className:"dir-name",children:[e.short,t===e.id&&s.jsx("span",{className:"dir-check",children:"● active"})]}),s.jsx("span",{className:"dir-tag",children:e.tagline})]})]},e.id))})]}),a&&n&&s.jsxs("div",{className:"card pad-lg mb-16",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Harness footprint"})}),s.jsxs("p",{className:"sub mb-16",children:["How much of the Rules ",s.jsx("code",{children:"AGENT.md"})," carries inline each turn, for the current install (",s.jsxs("code",{children:[a.host," · ",a.scope]}),"). A token-cost dial; every Rule stays in force either way. Changing it rebuilds the install in place. ",s.jsx("a",{href:"#/docs/footprint",children:"Learn more →"})]}),s.jsxs("div",{className:"dir-layout",children:[s.jsx("span",{className:"tick",id:"footprint-label",children:"Footprint"}),s.jsx("div",{className:"seg",role:"group","aria-labelledby":"footprint-label",children:["full","lean"].map(e=>s.jsx("button",{className:n===e?"on":"",onClick:()=>f(e),"aria-pressed":n===e,children:e},e))}),s.jsx("span",{className:"dir-layout-note sub",role:"status","aria-live":"polite",children:n==="lean"?"Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).":"Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context)."})]})]}),s.jsxs("div",{className:"card pad-lg mb-16",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Maintenance"})}),s.jsxs("p",{className:"sub mb-16",children:["Put ",s.jsx("code",{children:"geneseed"})," on your PATH so it runs from any directory, or remove a global install. Your memory store is always kept. Each runs live in the console."]}),s.jsxs("div",{className:"row wrap gap-10",children:[s.jsxs("button",{className:"btn ghost",onClick:()=>i("update"),children:[s.jsx(c,{name:"download"}),"Update (git pull + rebuild)"]}),s.jsxs("button",{className:"btn ghost",onClick:()=>i("link"),children:[s.jsx(c,{name:"external"}),"Add to PATH"]}),s.jsx("button",{className:"btn ghost",onClick:()=>i("unlink"),children:"Remove from PATH"}),s.jsxs("button",{className:"btn ghost",onClick:()=>{window.confirm("Uninstall the global Geneseed harness? Your memory store is kept; everything else this install added is removed.")&&i("uninstall")},children:[s.jsx(c,{name:"clear"}),"Uninstall"]})]})]}),s.jsxs("div",{className:"card pad-lg",children:[s.jsx("div",{className:"card-head",children:s.jsx("h3",{children:"Server"})}),s.jsx("p",{className:"sub mb-16",children:"The console runs a small local server. Leave it running in the background and reopen any time, or stop it when you are done."}),s.jsx(S,{})]})]})}export{T as default};
|