geneseed 3.1.3 → 3.3.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.
Files changed (150) hide show
  1. package/CHANGELOG.md +180 -0
  2. package/README.md +24 -14
  3. package/SETUP.md +38 -7
  4. package/SHIPPED.md +6 -5
  5. package/adapters/bob/README.md +40 -10
  6. package/adapters/claude-code/README.md +5 -0
  7. package/adapters/claude-code/settings.json +8 -1
  8. package/adapters/copilot/README.md +50 -24
  9. package/adapters/opencode/README.md +5 -1
  10. package/adapters/opencode/plugins/geneseed-guard.js +40 -6
  11. package/bin/build-driver.mjs +143 -89
  12. package/bin/geneseed-cli.mjs +63 -106
  13. package/bin/geneseed-hook.mjs +26 -16
  14. package/docs/candidate-hosts.md +74 -0
  15. package/docs/extending.md +6 -5
  16. package/docs/token-footprint.md +32 -21
  17. package/docs/web-ui.md +5 -13
  18. package/harness.config.json +1 -1
  19. package/js/README.md +5 -15
  20. package/js/build/emit-claude.mjs +26 -12
  21. package/js/build/emit-common.mjs +63 -114
  22. package/js/build/emit-opencode.mjs +74 -66
  23. package/js/build/generate.mjs +4 -6
  24. package/js/build/render.mjs +50 -32
  25. package/js/build/source.mjs +29 -8
  26. package/js/build/stubs.mjs +25 -33
  27. package/js/build/themes.mjs +1 -1
  28. package/js/build/version.mjs +1 -3
  29. package/js/cli-table.json +84 -0
  30. package/js/hosts/hooks.mjs +243 -81
  31. package/js/hosts/hosts.mjs +57 -5
  32. package/js/hosts/installs.mjs +35 -28
  33. package/js/hosts/link.mjs +2 -2
  34. package/js/hosts/mcp.mjs +3 -1
  35. package/js/hosts/native.mjs +54 -19
  36. package/js/hosts/opencode.mjs +39 -28
  37. package/js/hosts/settings.mjs +206 -115
  38. package/js/inspect/checks-authoring.mjs +5 -4
  39. package/js/inspect/checks-build.mjs +1 -1
  40. package/js/inspect/diff.mjs +1 -3
  41. package/js/inspect/doctor.mjs +59 -44
  42. package/js/inspect/excludes.mjs +5 -11
  43. package/js/inspect/inventory.mjs +38 -56
  44. package/js/inspect/registry.mjs +4 -7
  45. package/js/inspect/scan.mjs +8 -15
  46. package/js/inspect/status.mjs +51 -3
  47. package/js/lib/fs.mjs +34 -0
  48. package/js/lib/json.mjs +28 -1
  49. package/js/lib/paths.mjs +0 -10
  50. package/js/lib/udiff.mjs +11 -16
  51. package/js/maintain/memory.mjs +2 -4
  52. package/js/maintain/migrate.mjs +3 -3
  53. package/js/maintain/uninstall.mjs +127 -88
  54. package/js/maintain/update.mjs +4 -4
  55. package/js/ui/anim.mjs +1 -1
  56. package/js/ui/menu.mjs +1 -1
  57. package/js/ui/tui.mjs +3 -20
  58. package/js/web/actions.mjs +230 -217
  59. package/js/web/activity.mjs +71 -89
  60. package/js/web/api.mjs +130 -226
  61. package/js/web/daemon.mjs +92 -110
  62. package/js/web/docs.mjs +59 -126
  63. package/js/web/handler.mjs +94 -123
  64. package/js/web/jobs.mjs +116 -178
  65. package/js/web/routes.mjs +47 -192
  66. package/js/web/server.mjs +47 -82
  67. package/package.json +1 -1
  68. package/registry.json +14 -0
  69. package/src/AGENT.md.tmpl +55 -16
  70. package/src/agents/explorer.md +2 -1
  71. package/src/doctrines/README.md +3 -3
  72. package/src/doctrines/process.md +4 -2
  73. package/src/doctrines/rigor.md +13 -0
  74. package/src/laws/universal.md +133 -43
  75. package/src/ontology/universal.md +38 -13
  76. package/src/skills/_template.md +5 -1
  77. package/src/skills/bruno-collection-generator.md +63 -0
  78. package/src/skills/bruno-test-writer.md +62 -0
  79. package/src/skills/clarify.md +1 -1
  80. package/src/skills/crash-course.md +1 -0
  81. package/src/skills/decode.md +1 -0
  82. package/src/skills/drill.md +1 -0
  83. package/src/skills/feynman.md +1 -0
  84. package/src/skills/forge-mcp.md +2 -1
  85. package/src/skills/fresh-eyes.md +1 -1
  86. package/src/skills/herdr.md +1 -0
  87. package/src/skills/ingest.md +2 -1
  88. package/src/skills/learning-path.md +1 -0
  89. package/src/skills/opencode-theme.md +1 -0
  90. package/src/skills/parallel-agents.md +1 -1
  91. package/src/skills/ponytail.md +2 -2
  92. package/src/skills/research.md +4 -2
  93. package/themes/_TEMPLATE.json +5 -0
  94. package/themes/biker.json +5 -0
  95. package/themes/commentator.json +5 -0
  96. package/themes/cyberpunk.json +5 -0
  97. package/themes/gamer.json +5 -0
  98. package/themes/imperial.json +5 -0
  99. package/themes/joker.json +5 -0
  100. package/themes/marvin.json +5 -0
  101. package/themes/mean.json +5 -0
  102. package/themes/military.json +5 -0
  103. package/themes/neutral.json +5 -0
  104. package/themes/pirate.json +5 -0
  105. package/themes/sports.json +5 -0
  106. package/themes/verstappen.json +5 -0
  107. package/themes/wizard.json +5 -0
  108. package/web/dist/assets/Activity-BfVcLrda.js +1 -0
  109. package/web/dist/assets/ActivityDetail-CQXccGPl.js +1 -0
  110. package/web/dist/assets/CatalogRow-DALEQImZ.js +1 -0
  111. package/web/dist/assets/Diff-BIjxXx46.js +5 -0
  112. package/web/dist/assets/Doctor-CJLbgsrw.js +1 -0
  113. package/web/dist/assets/FilterInput-CkUCk_lY.js +1 -0
  114. package/web/dist/assets/GreenhouseView-DfC5IILJ.js +2 -0
  115. package/web/dist/assets/Harness-Dm5CCU-v.js +1 -0
  116. package/web/dist/assets/JournalView-Cpu2eI4s.js +1 -0
  117. package/web/dist/assets/Laws-DDDVFuQz.js +3 -0
  118. package/web/dist/assets/Library-Dao3T9na.js +1 -0
  119. package/web/dist/assets/{marked.esm-JKvyS0Pp.js → Markdown-C__nuWX5.js} +15 -15
  120. package/web/dist/assets/OperatorHudView-DEpCtAjP.js +2 -0
  121. package/web/dist/assets/Profile-BlXtUlh2.js +1 -0
  122. package/web/dist/assets/{Rules-CfsV1EVy.js → Rules-DIre6gxR.js} +1 -1
  123. package/web/dist/assets/Skills-rY13ZPhM.js +1 -0
  124. package/web/dist/assets/{StatusBadge-C9bZOEZk.js → StatusBadge-wW_RS_my.js} +1 -1
  125. package/web/dist/assets/{activity-Cc0n2jwx.js → activity-DpYPKNrA.js} +1 -1
  126. package/web/dist/assets/index-BEZvPvpF.js +1 -0
  127. package/web/dist/assets/index-DNQE5ydy.js +10 -0
  128. package/web/dist/assets/index-DzdQjvM1.css +1 -0
  129. package/web/dist/assets/index-PmQGRS1X.js +2 -0
  130. package/web/dist/assets/jobBuckets-DfTUJUxR.js +1 -0
  131. package/web/dist/assets/lawCats-DUS9UTH4.js +1 -0
  132. package/web/dist/index.html +2 -2
  133. package/web/src/pages/Laws.jsx +119 -130
  134. package/js/web/graph.mjs +0 -0
  135. package/web/dist/assets/Activity-B49fE_ug.js +0 -1
  136. package/web/dist/assets/ActivityDetail-abt7hzD2.js +0 -1
  137. package/web/dist/assets/Diff-D3_bVkih.js +0 -5
  138. package/web/dist/assets/Doctor-hXp7srsx.js +0 -1
  139. package/web/dist/assets/Graph-DvYMtlvl.js +0 -1
  140. package/web/dist/assets/Harness-BIWei7N5.js +0 -1
  141. package/web/dist/assets/Laws-CxmnRdwt.js +0 -3
  142. package/web/dist/assets/Library-MjbOkHIW.js +0 -1
  143. package/web/dist/assets/Markdown-Dx_w0faR.js +0 -1
  144. package/web/dist/assets/Profile-BRFvv2gr.js +0 -1
  145. package/web/dist/assets/Skills-DArA6IHS.js +0 -1
  146. package/web/dist/assets/index-Bx3oxZ1o.css +0 -1
  147. package/web/dist/assets/index-DC3-GlCY.js +0 -1
  148. package/web/dist/assets/index-DP035wPa.js +0 -12
  149. package/web/dist/assets/index-dHi-7M-F.js +0 -2
  150. package/web/dist/assets/roman-DkYN0LX9.js +0 -1
@@ -1,12 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Activity-B49fE_ug.js","assets/react-DOpiTn5v.js","assets/activity-Cc0n2jwx.js","assets/ActivityDetail-abt7hzD2.js","assets/Library-MjbOkHIW.js","assets/Markdown-Dx_w0faR.js","assets/marked.esm-JKvyS0Pp.js","assets/StatusBadge-C9bZOEZk.js","assets/Laws-CxmnRdwt.js","assets/roman-DkYN0LX9.js","assets/Rules-CfsV1EVy.js","assets/Profile-BRFvv2gr.js","assets/Skills-DArA6IHS.js","assets/Diff-D3_bVkih.js","assets/Doctor-hXp7srsx.js","assets/Graph-DvYMtlvl.js","assets/index-DC3-GlCY.js","assets/Harness-BIWei7N5.js","assets/index-dHi-7M-F.js"])))=>i.map(i=>d[i]);
2
- import{r as p,c as Ue}from"./react-DOpiTn5v.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))a(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&a(i)}).observe(document,{childList:!0,subtree:!0});function c(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerPolicy&&(l.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?l.credentials="include":n.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(n){if(n.ep)return;n.ep=!0;const l=c(n);fetch(n.href,l)}})();var ke={exports:{}},oe={};/**
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 Ge=p,Ke=Symbol.for("react.element"),Ze=Symbol.for("react.fragment"),Ye=Object.prototype.hasOwnProperty,qe=Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0};function we(s,t,c){var a,n={},l=null,i=null;c!==void 0&&(l=""+c),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(i=t.ref);for(a in t)Ye.call(t,a)&&!Je.hasOwnProperty(a)&&(n[a]=t[a]);if(s&&s.defaultProps)for(a in t=s.defaultProps,t)n[a]===void 0&&(n[a]=t[a]);return{$$typeof:Ke,type:s,key:l,ref:i,props:n,_owner:qe.current}}oe.Fragment=Ze;oe.jsx=we;oe.jsxs=we;ke.exports=oe;var e=ke.exports;const Xe="modulepreload",Qe=function(s){return"/"+s},je={},P=function(t,c,a){let n=Promise.resolve();if(c&&c.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"));n=Promise.allSettled(c.map(d=>{if(d=Qe(d),d in je)return;je[d]=!0;const g=d.endsWith(".css"),h=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const o=document.createElement("link");if(o.rel=g?"stylesheet":Xe,g||(o.as="script"),o.crossOrigin="",o.href=d,r&&o.setAttribute("nonce",r),document.head.appendChild(o),g)return new Promise((j,u)=>{o.addEventListener("load",j),o.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${d}`)))})}))}function l(i){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=i,window.dispatchEvent(r),!r.defaultPrevented)throw i}return n.then(i=>{for(const r of i||[])r.status==="rejected"&&l(r.reason);return t().catch(l)})},es=typeof window<"u"?window.__GENESEED_TOKEN__:"";async function Me(s){const t=await s.json().catch(()=>({})),c=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,a=new Error(c);return a.status=s.status,a.body=t,a}async function E(s){const t=await fetch(s);if(!t.ok)throw await Me(t);return t.json()}async function A(s,t={}){const c=await fetch(s,{method:"POST",headers:{"X-Geneseed-Token":es||"","Content-Type":"application/json"},body:JSON.stringify(t)});if(!c.ok)throw await Me(c);return c.json()}const ss=()=>E("/api/overview"),ts=()=>E("/api/recent"),as=()=>E("/api/activity"),ns=s=>E("/api/activity/"+encodeURIComponent(s)),cs=s=>A("/api/activity",{enabled:s}),ls=()=>E("/api/setup"),is=()=>E("/api/doctor"),rs=()=>E("/api/themes"),os=()=>E("/api/graph"),ds=Object.freeze(Object.defineProperty({__proto__:null,activity:as,activityDetail:ns,activityToggle:cs,doctor:is,graph:os,overview:ss,recent:ts,setup:ls,themes:rs},Symbol.toStringTag,{value:"Module"})),hs=s=>E(`/api/catalog/${s}`),ms=(s,t)=>E(`/api/item/${s}/${encodeURIComponent(t)}`),us=s=>A("/api/memory/delete",{name:s}),xs=Object.freeze(Object.defineProperty({__proto__:null,catalog:hs,item:ms,memoryDelete:us},Symbol.toStringTag,{value:"Module"})),ps=()=>E("/api/diff"),gs=s=>A("/api/actions/restore",{files:s}),js=Object.freeze(Object.defineProperty({__proto__:null,diff:ps,restore:gs},Symbol.toStringTag,{value:"Module"})),fs=409,ys=s=>E(`/api/jobs/${s}`),bs=()=>E("/api/jobs"),Ns=s=>A(`/api/jobs/${s}/cancel`);async function vs(s,t){try{return await A(`/api/actions/${s}`,t||{})}catch(c){throw c.status===fs?new Error("An action is already running."):c}}const ks=Object.freeze(Object.defineProperty({__proto__:null,action:vs,cancelJob:Ns,job:ys,jobs:bs},Symbol.toStringTag,{value:"Module"})),ws=()=>E("/api/mcp"),Ms=(s,t,c)=>A("/api/mcp",{path:s,name:t,enabled:c}),Ss=s=>A("/api/reveal",{path:s}),Es=Object.freeze(Object.defineProperty({__proto__:null,mcp:ws,mcpReveal:Ss,mcpToggle:Ms},Symbol.toStringTag,{value:"Module"})),_s=()=>E("/api/installs"),Cs=(s,t,c)=>A("/api/install",{host:s,path:t,action:c}),$s=(s,t,c)=>A("/api/install",{host:s,path:t,action:"remove",memory:c}),As=(s,t)=>A("/api/view",{host:s,path:t}),Ts=()=>A("/api/pick-folder",{}),Fs=Object.freeze(Object.defineProperty({__proto__:null,installRemove:$s,installToggle:Cs,installs:_s,pickFolder:Ts,selectView:As},Symbol.toStringTag,{value:"Module"})),Ls=()=>E("/api/ping"),Os=()=>A("/api/shutdown"),Rs=()=>A("/api/restart"),Is=Object.freeze(Object.defineProperty({__proto__:null,ping:Ls,restart:Rs,shutdown:Os},Symbol.toStringTag,{value:"Module"})),Se=s=>s?`?harness=${encodeURIComponent(s)}`:"",Ds=s=>E(`/api/docs${Se(s)}`),Ps=(s,t)=>E(`/api/docs/page/${encodeURIComponent(s)}${Se(t)}`),zs=Object.freeze(Object.defineProperty({__proto__:null,docs:Ds,docsPage:Ps},Symbol.toStringTag,{value:"Module"})),Bs=()=>E("/api/rules"),Vs=s=>A("/api/rules",s),Ws=s=>A("/api/rules/promote",s),Hs=Object.freeze(Object.defineProperty({__proto__:null,rules:Bs,rulesMutate:Vs,rulesPromote:Ws},Symbol.toStringTag,{value:"Module"})),Us=()=>E("/api/profile"),Gs=s=>A("/api/profile",s),Ks=Object.freeze(Object.defineProperty({__proto__:null,profile:Us,profileSave:Gs},Symbol.toStringTag,{value:"Module"})),Zs=()=>E("/api/excludes"),Ys=(s,t)=>A("/api/excludes",{action:s,path:t}),qs=Object.freeze(Object.defineProperty({__proto__:null,excludeMutate:Ys,excludes:Zs},Symbol.toStringTag,{value:"Module"})),_={...ds,...xs,...js,...ks,...Es,...Fs,...Is,...zs,...Hs,...Ks,...qs},Js=new Set(["activity","diff","settings","harness","harnesses","doctor","themes","graph","library","laws","rules","profile","skills","agents","about"]),Xs={themes:"harness",harnesses:"harness",about:"settings"};function Qs(){const s=()=>{const n=((typeof window<"u"?window.location.hash:"")||"#/").slice(2).split("/").filter(Boolean);return n[0]==="section"?{view:"section",section:n[1]}:n[0]==="item"?{view:"item",type:n[1],name:decodeURIComponent(n[2]||"")}:n[0]==="docs"?{view:"docs",page:decodeURIComponent(n.slice(1).join("/")||"")}:n[0]==="activity"&&n[1]?{view:"activity-detail",sid:decodeURIComponent(n[1])}:Js.has(n[0])?{view:Xs[n[0]]||n[0]}:{view:"dashboard"}},[t,c]=p.useState(s);return p.useEffect(()=>{const a=()=>c(s());return window.addEventListener("hashchange",a),()=>window.removeEventListener("hashchange",a)},[]),t}const R=s=>{window.location.hash=s},fe={red:"#FF5C57",green:"#4ED888",yellow:"#E8B53D",blue:"#5B8CFF",magenta:"#C77DFF",cyan:"#3AD4C4",white:"#E9EFEA"},ce={red:"#C53A36",green:"#2FA864",yellow:"#B8862A",blue:"#3C66D8",magenta:"#9A52D6",cyan:"#2BA89B",white:"#AEB8B0"},ne=s=>fe[s]||fe.cyan,et=s=>s==="yellow"||s==="white"||s==="cyan"||s==="green"?"#06100D":"#FFFFFF";function st(s,t,c){if(!s)return;const a=c==="light";let n=a?ce[t]||ce.cyan:ne(t),l=a?"#FFFFFF":et(t);a&&t==="white"&&(n="#566B62",l="#FFFFFF"),s.style.setProperty("--accent",n),s.style.setProperty("--accent-2",ce[t]||ce.cyan),s.style.setProperty("--accent-ink",l)}const tt={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 at(s,t,c){const a=tt[t];if(!s||!a)return!1;const n=c==="light";return s.style.setProperty("--accent",n?a.light:a.dark),s.style.setProperty("--accent-2",a.light),s.style.setProperty("--accent-ink",n?a.inkLight:a.ink),!0}const D={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"}},B=["agents","memory","notebook","wiki","config"],Ha=B.filter(s=>s!=="agents"&&s!=="config"),Ua={config:"wiki"},nt=Object.fromEntries(Object.entries(D).map(([s,t])=>[t.type,s]));function de(s,t){const[c,a]=p.useState(()=>{try{return t(localStorage.getItem(s))}catch{return t(null)}});return p.useEffect(()=>{try{localStorage.setItem(s,c)}catch{}},[s,c]),[c,a]}const ct="geneseed-mode";function lt(){const[s,t]=de(ct,a=>a==="light"?"light":"dark");return[s,()=>t(a=>a==="light"?"dark":"light")]}const it="geneseed-flavour",rt=[{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."}],ot=new Set(rt.map(s=>s.id)),dt={a:"cultivar",b:"greenhouse",c:"operator",d:"heirloom",e:"matrix",f:"aurora",g:"perspective",z:"sequencer",cb:"cobalt",cm:"cosmic"};function ht(){return de(it,s=>ot.has(s)?s:dt[s]||"cultivar")}const mt="geneseed-accent",ut=[{id:"auto",short:"Auto",tagline:"Follows the deployed voice's accent."},{id:"curated",short:"Curated",tagline:"Each theme's own signature colour."}],xt=new Set(ut.map(s=>s.id));function pt(){return de(mt,s=>s&&xt.has(s)?s:"auto")}const gt="geneseed-layout",jt=[{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."}],Ee=new Set(jt.map(s=>s.id));function ft(s){return s==="atlas"||s==="greenhouse"?"journal":s==="cobalt"?"greenhouse":s==="operator"?"operator":"cultivar"}function yt(s,t){return t&&t!=="auto"&&Ee.has(t)?t:ft(s)}function bt(){return de(gt,s=>s&&Ee.has(s)?s:"auto")}function Nt(s){const[t,c]=p.useState(null),[a,n]=p.useState([]),l=()=>_.overview().then(c).catch(i=>s==null?void 0:s(i));return p.useEffect(()=>{l()},[]),p.useEffect(()=>{_.themes().then(i=>n(i.themes)).catch(()=>{})},[]),{overview:t,themes:a,reload:l}}const vt=600,kt=1e3,wt=30;async function ye(s){await new Promise(t=>setTimeout(t,s));for(let t=0;t<wt;t++)try{await _.ping();break}catch{await new Promise(c=>setTimeout(c,kt))}window.location.reload()}function Mt({onFinish:s,onError:t}={}){const[c,a]=p.useState([]),[n,l]=p.useState(null),[i,r]=p.useState(!1);return p.useEffect(()=>{_.jobs().then(({jobs:h})=>{if(!h.length)return;a(h.map(j=>({id:j.id,action:j.action,status:j.status,output:j.output||"",duration:j.duration})));const o=h.find(j=>j.status==="running");o&&(l(o.id),r(!0))}).catch(()=>{})},[]),p.useEffect(()=>{var j;if(!n)return;const h=((j=c.find(u=>u.id===n))==null?void 0:j.action)==="update",o=setInterval(async()=>{try{const u=await _.job(n);if(a(f=>f.map(m=>m.id===n?{...m,output:u.output||"",status:u.status,duration:u.duration}:m)),u.status!=="running"){if(clearInterval(o),l(null),h){ye(2e3);return}s==null||s()}}catch{clearInterval(o),h&&ye(0)}},vt);return()=>clearInterval(o)},[n]),{runs:c,activeId:n,consoleOpen:i,setConsoleOpen:r,runAction:async(h,o)=>{try{const{job_id:j}=await _.action(h,o),u=h==="build"&&(o!=null&&o.theme)?`build (${o.theme} · ${o.emit})`:h;return a(f=>[...f,{id:j,action:u,status:"running",output:""}]),l(j),r(!0),j}catch(j){t==null||t(j)}},cancelJob:h=>_.cancelJob(h).catch(o=>t==null?void 0:t(o)),clearRuns:()=>a([])}}const _e=60,Ce=3600,St=86400,ue={seconds:90,minutes:90*_e,hours:36*Ce};function re(s){const t=Math.max(0,Date.now()/1e3-s);return t<ue.seconds?`${Math.round(t)}s`:t<ue.minutes?`${Math.round(t/_e)}m`:t<ue.hours?`${Math.round(t/Ce)}h`:`${Math.round(t/St)}d`}function Et(s){return s?s.replace(/\\/g,"/").replace(/^\/?(home|Users)\/[^/]+/i,"~").replace(/^[A-Z]:\/Users\/[^/]+/i,"~"):"~"}const G={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function $e(s,t){var l,i,r;if(!s)return 0;const c=((i=(l=s.doctor)==null?void 0:l.problems)==null?void 0:i.length)??99,a=(r=s.doctor)!=null&&r.ok?G.doctorClean:c<=G.doctorMinorMax?G.doctorMinor:G.doctorFail,n=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(s.deployed?G.deployed:0)+a+(n?G.versionSynced:0)+(s.diff&&s.diff.missing===0?G.diskClean:0)}const Ae=s=>Math.max(...B.map(t=>(s==null?void 0:s[t])??0),1),Y=s=>((s==null?void 0:s.edited)??0)+((s==null?void 0:s.added)??0),Te=s=>{var t;return((s==null?void 0:s.laws)??0)+(((t=s==null?void 0:s.doctrines)==null?void 0:t.rules)??0)},_t={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 C({name:s,className:t="glyph",style:c}){return e.jsx("svg",{className:t,style:c,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:_t[s]||""})})}function Ct({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 $t=[{hash:"#/",id:"dashboard",label:"Dashboard",icon:"dashboard",match:s=>s.view==="dashboard",tag:()=>"today"},{group:"Codex"},{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),tag:s=>s!=null&&s.counts?(s.counts.memory??0)+(s.counts.notebook??0)+(s.counts.wiki??0)+(s.counts.config??0):null},{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:"Care"},{hash:"#/activity",id:"activity",label:"Activity",icon:"activity",match:s=>s.view==="activity"||s.view==="activity-detail"},{hash:"#/diff",id:"changes",label:"Changes",icon:"changes",match:s=>s.view==="diff",tag:s=>(s!=null&&s.diff?Y(s.diff):null)||null},{hash:"#/doctor",id:"doctor",label:"Doctor",icon:"doctor",match:s=>s.view==="doctor",tag:s=>s!=null&&s.doctor?s.doctor.ok?"clean":s.doctor.problems.length:null,warn:s=>!!(s!=null&&s.doctor)&&!s.doctor.ok},{group:"Setup"},{hash:"#/harness",id:"harness",label:"Harness",icon:"layers",match:s=>s.view==="harness",tag:s=>(s==null?void 0:s.theme)??null},{hash:"#/settings",id:"settings",label:"Settings",icon:"settings",match:s=>s.view==="settings"}];function At({value:s}){const c=2*Math.PI*30;return e.jsxs("svg",{className:"rv-ring",width:"66",height:"66",viewBox:"0 0 72 72",role:"img","aria-label":`Growth ${Math.round(s*100)} of 100`,children:[e.jsx("circle",{cx:"36",cy:"36",r:30,fill:"none",stroke:"var(--line-2)",strokeWidth:"6"}),e.jsx("circle",{cx:"36",cy:"36",r:30,fill:"none",stroke:"var(--accent)",strokeWidth:"6",strokeLinecap:"round",strokeDasharray:`${c*s} ${c}`,transform:"rotate(-90 36 36)",style:{transition:"stroke-dasharray 1.1s cubic-bezier(.2,.7,.2,1)"}}),e.jsx("text",{className:"rv-ring-num",x:"36",y:"34",textAnchor:"middle",children:Math.round(s*100)}),e.jsx("text",{className:"rv-ring-lbl",x:"36",y:"47",textAnchor:"middle",children:"GROWTH"})]})}function Tt({overview:s,setup:t}){if(!s)return null;const c=s.doctor?s.doctor.ok?"clean":`${s.doctor.problems.length} to fix`:"—";return e.jsxs("div",{className:"rail-vitals",children:[e.jsx(At,{value:$e(s,t)}),e.jsxs("div",{className:"rv-rows",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Drift"}),e.jsx("b",{children:Y(s.diff)})]}),e.jsxs("div",{children:[e.jsx("span",{children:"Doctor"}),e.jsx("b",{children:c})]}),e.jsxs("div",{children:[e.jsx("span",{children:"Built"}),e.jsx("b",{className:"plain",title:s.build_time||void 0,children:s.build_epoch?re(s.build_epoch):"never"})]})]})]})}function Ft({route:s,overview:t,setup:c,onOpenVoice:a,onNavigate:n}){return e.jsxs("aside",{className:"rail",id:"rail-nav","aria-label":"Harness navigation",children:[e.jsxs("button",{className:"rail-brand",onClick:()=>{R("#/"),n==null||n()},title:"Dashboard",children:[e.jsx(Ct,{}),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"})]})]}),e.jsx(Tt,{overview:t,setup:c}),$t.map((l,i)=>{if(l.group)return e.jsx("div",{className:"rail-group",children:l.group},"g"+i);const r=l.tag?l.tag(t):null,d=l.match(s),g=typeof l.warn=="function"?l.warn(t):!!l.warn;return e.jsx("div",{className:"rail-nav",children:e.jsxs("a",{className:`rail-item ${d?"active":""}`,href:l.hash,"aria-current":d?"page":void 0,title:l.label,onClick:()=>n==null?void 0:n(),children:[e.jsx(C,{name:l.icon}),e.jsx("span",{children:l.label}),r?e.jsx("span",{className:"tag",style:g?{color:"var(--warn)"}:null,children:r}):null]})},l.id)}),e.jsx("div",{className:"rail-spacer"}),e.jsx("div",{className:"rail-foot",children:e.jsxs("button",{className:"voice",onClick:a,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(C,{name:"chevron",className:"chev glyph"})]})})]})}function Lt(){const[s,t]=p.useState(null),[c,a]=p.useState(""),n=p.useRef(null),l=p.useCallback(()=>{if(s||n.current)return n.current;const i=(async()=>{const r=[],d=["laws","skills",...B],g=await Promise.all(d.map(async h=>{try{const o=await _.catalog(h);return{sec:h,items:(o==null?void 0:o.items)||[]}}catch{return{sec:h,items:[]}}}));for(const{sec:h,items:o}of g){const j=D[h];for(const u of o){const f=u.title||u.name;r.push({kind:j.label,sortKey:d.indexOf(h),title:f,desc:u.desc||"",hay:`${f} ${u.desc||""} ${u.name||""}`.toLowerCase(),route:`#/item/${j.type}/${encodeURIComponent(u.name)}`})}}try{const h=await _.mcp(),o=new Set;for(const j of(h==null?void 0:h.targets)||[])for(const u of j.servers||[]){if(o.has(u.name))continue;o.add(u.name);const f=u.label||u.name;r.push({kind:"MCP servers",sortKey:100,title:f,desc:u.desc||"",hay:`${f} ${u.desc||""} ${u.name||""} mcp`.toLowerCase(),route:"#/settings"})}}catch{}try{const h=await _.docs();for(const o of(h==null?void 0:h.groups)||[])for(const j of o.pages||[])r.push({kind:"Docs",sortKey:110,title:j.title,desc:o.label,hay:`${j.title||""} ${j.id||""} ${o.label||""}`.toLowerCase(),route:`#/docs/${encodeURIComponent(j.id)}`})}catch{}return t(r),n.current=null,r})().catch(r=>(n.current=null,a(r.message||String(r)),[]));return n.current=i,i},[s]);return{index:s,error:c,prime:l}}const Ot=24;function Rt(s,t){const c=s.title.toLowerCase();return c.startsWith(t)?0:c.includes(t)?1:s.hay.includes(t)?2:-1}function Fe(s,t){const c=t.toLowerCase().trim();if(!c||!s)return[];const a=[];for(const n of s){const l=Rt(n,c);l>=0&&a.push({e:n,s:l})}return a.sort((n,l)=>n.s-l.s||n.e.sortKey-l.e.sortKey||n.e.title.localeCompare(l.e.title)),a.slice(0,Ot).map(n=>n.e)}function It({query:s,index:t,loading:c,active:a,onActive:n,onClose:l}){const i=p.useMemo(()=>Fe(t,s),[t,s]),r=p.useRef(null);p.useEffect(()=>{a>=i.length&&n(0)},[i,a,n]),p.useEffect(()=>{var j;const o=(j=r.current)==null?void 0:j.querySelector(`[data-spot-row="${a}"]`);o==null||o.scrollIntoView({block:"nearest"})},[a]);const d=o=>{o&&(R(o.route),l())},g=[];let h=null;return i.forEach((o,j)=>{(!h||h.kind!==o.kind)&&(h={kind:o.kind,rows:[]},g.push(h)),h.rows.push({entry:o,index:j})}),s.trim()?e.jsxs("div",{className:"spotlight",ref:r,id:"spotlight-list",role:"listbox","aria-label":"Search results",children:[c&&!t&&e.jsx("div",{className:"spot-empty",role:"presentation",children:"Loading…"}),!c&&i.length===0&&t&&e.jsxs("div",{className:"spot-empty",role:"presentation",children:["No matches for “",s,"”."]}),g.map(o=>e.jsxs("div",{className:"spot-group",role:"group","aria-label":o.kind,children:[e.jsx("div",{className:"spot-group-head","aria-hidden":"true",children:o.kind}),o.rows.map(({entry:j,index:u})=>e.jsxs("div",{id:`spot-opt-${u}`,"data-spot-row":u,role:"option","aria-selected":u===a,className:`spot-row ${u===a?"on":""}`,onMouseDown:f=>{f.preventDefault(),d(j)},onMouseEnter:()=>n(u),children:[e.jsx("div",{className:"spot-title",children:j.title}),j.desc?e.jsx("div",{className:"spot-desc",children:j.desc}):null]},`${j.route}-${u}`))]},o.kind))]}):null}function Dt({value:s,onChange:t}){const c=p.useRef(null),a=p.useRef(null),[n,l]=p.useState(!1),[i,r]=p.useState(0),{index:d,prime:g}=Lt();p.useEffect(()=>{const f=m=>{var y;!((m.metaKey||m.ctrlKey)&&!m.altKey&&m.key.toLowerCase()==="k")&&(m.key!=="/"||m.target.closest("input, textarea, select"))||(m.preventDefault(),(y=c.current)==null||y.focus())};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[]),p.useEffect(()=>{if(!n)return;const f=m=>{var x;(x=a.current)!=null&&x.contains(m.target)||l(!1)};return window.addEventListener("mousedown",f),()=>window.removeEventListener("mousedown",f)},[n]);const h=n&&!!s.trim(),o=h&&d?Fe(d,s):[],j=i<o.length?`spot-opt-${i}`:void 0,u=f=>{var m,x;if(h)if(f.key==="ArrowDown")f.preventDefault(),r(y=>Math.min(y+1,Math.max(o.length-1,0)));else if(f.key==="ArrowUp")f.preventDefault(),r(y=>Math.max(y-1,0));else if(f.key==="Enter"){const y=o[i];y&&(f.preventDefault(),R(y.route),l(!1),(m=c.current)==null||m.blur())}else f.key==="Escape"&&(f.preventDefault(),s?t(""):(l(!1),(x=c.current)==null||x.blur()))};return e.jsxs("div",{className:"tb-search",ref:a,children:[e.jsx(C,{name:"search",className:"mag glyph"}),e.jsx("input",{ref:c,role:"combobox","aria-label":"Search the harness","aria-autocomplete":"list","aria-expanded":h,"aria-controls":h?"spotlight-list":void 0,"aria-activedescendant":j,value:s,onChange:f=>{t(f.target.value),r(0)},onFocus:()=>{l(!0),g()},onKeyDown:u,placeholder:"Search the harness…",title:"Press / to jump here, or Ctrl-K / ⌘K from inside any field"}),e.jsx("span",{className:"kbd",children:"/"}),e.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:h?o.length?`${o.length} results`:"no matches":""}),h&&e.jsx(It,{query:s,index:d,loading:!d,active:i,onActive:r,onClose:()=>{var f;l(!1),(f=c.current)==null||f.blur()}})]})}function Le(s,t=[]){const[c,a]=p.useState(null),[n,l]=p.useState(""),[i,r]=p.useState(!0),d=p.useRef(s);d.current=s;const g=p.useCallback(()=>(r(!0),l(""),Promise.resolve(d.current()).then(h=>a(h)).catch(h=>l(h.message)).finally(()=>r(!1))),t);return p.useEffect(()=>{g()},[g]),{data:c,error:n,loading:i,reload:g,setData:a}}function Pt({dataRev:s,onSwitch:t}){const{data:c}=Le(()=>_.installs(),[s]),a=((c==null?void 0:c.installs)||[]).filter(i=>i.state==="active");if(a.length<2)return null;const n=a.find(i=>i.selected)||a[0],l=async i=>{const r=a.find(d=>d.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:n.id,onChange:l,children:a.map(i=>e.jsxs("option",{value:i.id,children:[i.host," · ",i.scope]},i.id))})]})}const zt={dashboard:"overview",diff:"diff",doctor:"doctor",harness:"harness",graph:"graph",settings:"settings"};function Bt(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":zt[s.view]||s.view}function Vt({route:s,navOpen:t,onToggleNav:c,target:a,version:n,query:l,onQuery:i,mode:r,onToggleMode:d,onShutdown:g,dataRev:h,onSwitch:o}){return e.jsxs("header",{className:"topbar",children:[e.jsx("button",{className:"tb-menu",onClick:c,"aria-label":t?"Close navigation":"Open navigation","aria-expanded":!!t,"aria-controls":"rail-nav",children:e.jsx(C,{name:t?"x":"menu"})}),e.jsxs("div",{className:"prompt",children:[e.jsx("span",{className:"path",children:Et(a)}),e.jsx("span",{className:"sep",children:"$"}),e.jsx("span",{className:"cmd",children:"geneseed"})," ",e.jsxs("span",{className:"flag",children:["--tab=",Bt(s)]}),n&&e.jsxs("span",{className:"flag ver",children:[" --version=",n]}),e.jsx("span",{className:"cur"})]}),e.jsx("div",{className:"topbar-spacer"}),e.jsx(Pt,{dataRev:h,onSwitch:o}),e.jsx(Dt,{value:l,onChange:i}),e.jsx("button",{className:"iconbtn",title:r==="light"?"Switch to dark":"Switch to light",onClick:d,children:e.jsx(C,{name:r==="light"?"moon":"sun"})}),e.jsx("button",{className:"iconbtn",title:"Stop server",onClick:g,children:e.jsx(C,{name:"power"})})]})}function Wt({themes:s,current:t,onPick:c,onClose:a}){const n=p.useRef(null);return p.useEffect(()=>{const l=i=>{n.current&&!n.current.contains(i.target)&&a()};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[a]),e.jsxs("div",{className:"pop",ref:n,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:()=>c(l.name),children:[e.jsx("span",{className:"po",style:{background:ne(l.accent),boxShadow:`0 0 8px ${ne(l.accent)}`}}),e.jsx("span",{className:"pn",children:l.name})]},l.name))]})}const Ht=3500;function Ut({toast:s,onClose:t}){return p.useEffect(()=>{const c=setTimeout(t,Ht);return()=>clearTimeout(c)},[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 Gt({runs:s,open:t,onToggle:c,onClear:a,onCancel:n,busy:l}){const i=p.useRef(null),r=s.length?s[s.length-1].output.length:0;return p.useEffect(()=>{const d=i.current;d&&t&&(d.scrollTop=d.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:c,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:d=>d.stopPropagation(),children:[e.jsx("button",{className:"iconbtn",title:"Clear",onClick:a,disabled:!s.length,children:e.jsx(C,{name:"clear"})}),e.jsx("button",{className:"iconbtn",title:t?"Collapse":"Expand","aria-expanded":t,onClick:c,children:e.jsx(C,{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(d=>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:d.action}),e.jsx("span",{className:`st ${d.status}`,children:d.status==="running"?"…running":`${d.status==="done"?"✓ done":"✗ failed"}${d.duration?` · ${d.duration}s`:""}`}),d.status==="running"&&n&&e.jsx("button",{className:"iconbtn run-cancel",title:"Cancel this run",onClick:()=>n(d.id),children:e.jsx(C,{name:"x"})})]}),d.output&&e.jsx("pre",{className:"run-out",children:d.output})]},d.id))]})]})}const Kt=550,be="gs-splash-seen";function Zt(){try{if(window.localStorage.getItem(be))return 0;window.localStorage.setItem(be,"1")}catch{}return Kt}function Yt({ready:s,onDone:t}){const[c,a]=p.useState(!1),[n,l]=p.useState(!1);p.useEffect(()=>{const r=Zt();if(!r){a(!0);return}const d=setTimeout(()=>a(!0),r);return()=>clearTimeout(d)},[]),p.useEffect(()=>{s&&c&&l(!0)},[s,c]),p.useEffect(()=>{if(!n)return;const r=setTimeout(()=>t==null?void 0:t(),700);return()=>clearTimeout(r)},[n]);const i=r=>{r.animationName==="splashOut"&&(t==null||t())};return e.jsxs("div",{className:`boot-splash${n?" 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 Oe({label:s="Loading…"}){return e.jsx("div",{className:"loading",children:s})}function qt({value:s,size:t=232}){const c=t/2-14,a=2*Math.PI*c,n=a*(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:c,fill:"none",stroke:"var(--surface-3)",strokeWidth:"10"}),e.jsx("circle",{cx:t/2,cy:t/2,r:c,fill:"none",stroke:"var(--accent)",strokeWidth:"10",strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:n,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,d=c-18,g=c-24,h=t/2+Math.cos(r)*d,o=t/2+Math.sin(r)*d,j=t/2+Math.cos(r)*g,u=t/2+Math.sin(r)*g;return e.jsx("line",{x1:h,y1:o,x2:j,y2:u,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 Jt({overview:s}){const t=Y(s.diff),c=s.counts||{},a=[{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:[a.map(n=>{const l=c[n.key];return e.jsxs("a",{className:"kseg",href:n.hash,title:`Open ${n.label}`,children:[e.jsx("span",{className:"kseg-n"+(l===0?" zero":""),children:l??"—"}),e.jsx("span",{className:"kseg-l",children:n.label})]},n.key)}),e.jsx("div",{className:"kseg-spacer"}),e.jsxs("button",{className:"kseg"+(t>0?" hot":""),onClick:()=>R("#/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 Xt({overview:s}){return e.jsx("div",{className:"genome",children:B.map((t,c)=>{var l;const a=D[t],n=(l=s.counts)==null?void 0:l[t];return e.jsxs("div",{className:"card gcell rise",style:{animationDelay:`${c*50}ms`},onClick:()=>R("#/section/"+t),children:[e.jsxs("div",{className:"gtop",children:[e.jsx("span",{className:"gname",children:a.label}),e.jsx(C,{name:a.icon,className:"gicon"})]}),e.jsx("div",{className:"gcount"+(n===0?" zero":""),children:n??"—"}),e.jsx("div",{className:"gdesc",children:a.desc})]},t)})})}function xe({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"},c=[...s].sort((a,n)=>n.started-a.started).slice(0,8);return e.jsx("div",{className:"feed",children:c.map(a=>e.jsxs("div",{className:"feed-row",children:[e.jsx("span",{className:`feed-dot ${t[a.status]||"ok"}`}),e.jsx("span",{className:"feed-txt",children:e.jsx("b",{children:a.action})}),e.jsxs("span",{className:"feed-when",children:[re(a.started)," ago"]})]},a.id))})}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,setup:c,jobs:a,onAction:n}){const l=s.deployed?Qt[s.theme]||"Loaded & ready":"Not deployed",i=$e(s,c);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(qt,{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:(c==null?void 0:c.installed_fp)||"—"})]})]}),e.jsxs("div",{className:"row wrap gap-10",children:[e.jsxs("button",{className:"btn",onClick:()=>n("update"),children:[e.jsx(C,{name:"refresh"}),"Update"]}),e.jsxs("button",{className:"btn ghost",onClick:()=>n("build-all"),children:[e.jsx(C,{name:"build"}),"Rebuild"]}),e.jsxs("button",{className:"btn ghost",onClick:()=>n("doctor"),children:[e.jsx(C,{name:"doctor"}),"Run doctor"]})]})]})]})}),e.jsx(Jt,{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:[B.length," sections"]})})]}),e.jsx(Xt,{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(xe,{jobs:a})]})]})]})}function sa({k:s,overview:t,max:c}){var l;const a=D[s],n=((l=t.counts)==null?void 0:l[s])??0;return e.jsxs("div",{className:"strand",onClick:()=>R("#/section/"+s),children:[e.jsxs("span",{className:"strand-name",children:[e.jsx("span",{className:"strand-dot"}),e.jsx("span",{children:a.label})]}),e.jsx("div",{className:"hbar",children:e.jsx("i",{style:{width:`${n/c*100}%`}})}),e.jsx("span",{className:"strand-val",children:n})]})}const L={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 ta({graph:s}){const[a,n]=p.useState(null),{nodes:l,edges:i,pos:r,degrees:d,maxDeg:g}=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(S=>{m.set(S.source,(m.get(S.source)||0)+1),m.set(S.target,(m.get(S.target)||0)+1)});const y=[...s.nodes].sort((S,w)=>(m.get(w.id)||0)-(m.get(S.id)||0)).slice(0,L.maxNodes),b=new Set(y.map(S=>S.id)),N=s.edges.filter(S=>b.has(S.source)&&b.has(S.target)),k=440/2,$=230/2,O=new Map;y.forEach((S,w)=>{if(w===0)O.set(S.id,{x:k,y:$});else{const T=w*L.goldenAngle,F=Math.sqrt(w/y.length);O.set(S.id,{x:k+Math.cos(T)*F*(440*L.seedRadiusScale),y:$+Math.sin(T)*F*(230*L.seedRadiusScale)})}});const V=y.map(S=>O.get(S.id));for(let S=0;S<L.iterations;S++){for(let w=0;w<V.length;w++)for(let T=w+1;T<V.length;T++){const F=V[w],z=V[T],v=F.x-z.x,I=F.y-z.y,W=v*v+I*I||1,H=Math.sqrt(W),q=L.repulsion/W;F.x+=v/H*q,F.y+=I/H*q,z.x-=v/H*q,z.y-=I/H*q}for(const w of N){const T=O.get(w.source),F=O.get(w.target),z=F.x-T.x,v=F.y-T.y,I=Math.sqrt(z*z+v*v)||1,W=(I-L.springLength)*L.springStiffness;T.x+=z/I*W,T.y+=v/I*W,F.x-=z/I*W,F.y-=v/I*W}for(const w of V)w.x+=(k-w.x)*L.centrePull,w.y+=($-w.y)*L.centrePull,w.x=Math.max(L.boundsMargin.x,Math.min(440-L.boundsMargin.x,w.x)),w.y=Math.max(L.boundsMargin.y,Math.min(230-L.boundsMargin.y,w.y))}const ee=Math.max(1,...m.values());return{nodes:y,edges:N,pos:O,degrees:m,maxDeg:ee}},[s]),h=p.useMemo(()=>{if(!a)return null;const f=new Set([a]);return i.forEach(m=>{m.source===a&&f.add(m.target),m.target===a&&f.add(m.source)}),f},[a,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 o=a?r.get(a):null,j=a?l.find(f=>f.id===a):null,u=(j==null?void 0:j.type)==="law"?`Rule ${a}`:a;return e.jsxs("svg",{viewBox:"0 0 440 230",style:{width:"100%",height:"auto",display:"block"},role:"img","aria-label":"Cross-link constellation",onMouseLeave:()=>n(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 x=r.get(f.source),y=r.get(f.target);if(!x||!y)return null;const b=a&&(f.source===a||f.target===a),N=a&&!b,k=y.x-x.x,$=y.y-x.y,O=Math.sqrt(k*k+$*$)||1,V=Math.min(L.edgeCurve.max,O*L.edgeCurve.scale),ee=(x.x+y.x)/2+-$/O*V,S=(x.y+y.y)/2+k/O*V;return e.jsx("path",{d:`M${x.x},${x.y} Q${ee},${S} ${y.x},${y.y}`,fill:"none",stroke:b?"var(--accent)":"var(--line-2)",strokeWidth:b?1.3:.9,opacity:N?.14:b?.95:.55},m)}),l.map(f=>{const m=r.get(f.id);if(!m)return null;const x=d.get(f.id)||0,b=(K.baseRadius[f.type]??K.baseRadius.skill)+Math.min(K.degreeMax,x*K.degreeScale),N=x>=Math.max(K.hub.minDegree,g*K.hub.maxFraction),k=x===0,$=h&&!h.has(f.id),O=f.type==="agent"?"var(--accent)":f.type==="law"?"var(--warn)":"var(--good)";return e.jsxs("g",{opacity:$?.22:1,onMouseEnter:()=>n(f.id),style:{cursor:"pointer"},children:[N&&e.jsx("circle",{cx:m.x,cy:m.y,r:b*K.hubGlowScale,fill:"url(#mg-hub-glow)"}),e.jsx("circle",{cx:m.x,cy:m.y,r:b,fill:O,fillOpacity:k?.55:1,stroke:"var(--bg)",strokeWidth:"1.4"})]},f.id)}),o&&e.jsx("text",{x:o.x+(o.x>350?-10:10),y:o.y-9,textAnchor:o.x>350?"end":"start",fontSize:"11",fill:"var(--text)",style:{paintOrder:"stroke",stroke:"var(--bg)",strokeWidth:3},children:u})]})}function aa({overview:s,sigil:t,setup:c,jobs:a,graph:n}){const l=Ae(s.counts),i=(c==null?void 0:c.version_verdict)||"",r=i.includes("up to date"),d=Y(s.diff),g=[["Source","src/, the canonical genetic material",(c==null?void 0:c.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"}),g.map(([h,o,j,u],f)=>e.jsxs("div",{className:"lineage-step",children:[e.jsx("span",{className:`node ${u?"on":""}`}),e.jsx("div",{className:"lt",children:h}),e.jsx("div",{className:"ld",children:o}),e.jsx("div",{className:"ltag",children:j})]},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"}),d," 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:()=>R("#/graph"),children:["Open graph",e.jsx(C,{name:"arrow"})]})})]}),e.jsx(ta,{graph:n})]})]}),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"})})]}),B.map(h=>e.jsx(sa,{k:h,overview:s,max:l},h))]}),e.jsxs("div",{className:"card pad-lg",children:[e.jsx("div",{className:"card-head",children:e.jsx("h3",{children:"Recent activity"})}),e.jsx(xe,{jobs:a})]})]})]})}function na({overview:s,setup:t,jobs:c}){var d,g,h;const a=B.reduce((o,j)=>{var u;return o+(((u=s.counts)==null?void 0:u[j])??0)},0),n=Ae(s.counts),l=(d=s.doctor)==null?void 0:d.ok,i=((h=(g=s.doctor)==null?void 0:g.problems)==null?void 0:h.length)??0,r=Y(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:[a," 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:B.map(o=>{var f;const j=D[o],u=((f=s.counts)==null?void 0:f[o])??0;return e.jsxs("tr",{className:"clickable",onClick:()=>R("#/section/"+o),children:[e.jsx("td",{className:"name",children:j.label}),e.jsx("td",{className:"muted",children:j.desc}),e.jsx("td",{children:e.jsx("div",{className:"hbar",children:e.jsx("i",{style:{width:`${u/n*100}%`}})})}),e.jsx("td",{className:"num",children:u})]},o)})})]})]}),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(xe,{jobs:c})]})]})]})}const ca=864e5;function Re(s,t=10,c="today"){const a=new Array(t).fill(0).map((l,i)=>({t:i===t-1?c:`${t-1-i}d`,v:0})),n=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 d=Math.floor((n-r)/ca);d<0||d>=t||(a[t-1-d].v+=1)}return a}const la=12,ia=120,U=["#2BB673","#16A6A6","#E8A23B","#E07A5F","#8E7DBE","#5BD08A","#79856E"];function Ne({segments:s,size:t=186,stroke:c=26,caption:a="capabilities"}){const n=s.reduce((g,h)=>g+h.value,0)||1,l=t/2-c/2,i=t/2,r=t/2;let d=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:c}),s.map((g,h)=>{if(g.value/n<=0)return null;const j=d/n*2*Math.PI-Math.PI/2,u=(d+g.value)/n*2*Math.PI-Math.PI/2;d+=g.value;const f=i+l*Math.cos(j),m=r+l*Math.sin(j),x=i+l*Math.cos(u),y=r+l*Math.sin(u),b=u-j>Math.PI?1:0;return e.jsx("path",{d:`M ${f} ${m} A ${l} ${l} 0 ${b} 1 ${x} ${y}`,fill:"none",stroke:g.color,strokeWidth:c,strokeLinecap:"butt",children:e.jsxs("title",{children:[g.label,": ",g.value]})},h)}),e.jsx("text",{x:i,y:r-4,textAnchor:"middle",className:"donut-c-num",children:n}),e.jsx("text",{x:i,y:r+16,textAnchor:"middle",className:"donut-c-cap",children:a})]})}function ra(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 c=0;c<s.length-1;c++){const a=s[c-1]||s[c],n=s[c],l=s[c+1],i=s[c+2]||l,r=n[0]+(l[0]-a[0])/6,d=n[1]+(l[1]-a[1])/6,g=l[0]-(i[0]-n[0])/6,h=l[1]-(i[1]-n[1])/6;t+=` C${r},${d} ${g},${h} ${l[0]},${l[1]}`}return t}function oa({data:s,height:t=156,accent:c}){if(!s.length)return null;const a=600,n=t,l=6,i=14,r=6,d=Math.max(...s.map(x=>x.v),1)+1,g=a-l*2,h=s.length>1?g/(s.length-1):g,o=s.map((x,y)=>{const b=l+y*h,N=n-r-x.v/d*(n-i-r);return[b,N]}),j=ra(o),u=o[o.length-1],f=o[0],m=`${j} L${u[0]},${n} L${f[0]},${n} Z`;return e.jsxs("svg",{viewBox:`0 0 ${a} ${n}`,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:c,stopOpacity:".28"}),e.jsx("stop",{offset:"1",stopColor:c,stopOpacity:"0"})]})}),e.jsx("path",{d:m,fill:"url(#b-grad)"}),e.jsx("path",{d:j,fill:"none",stroke:c,strokeWidth:"2",strokeLinejoin:"round",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}),e.jsx("circle",{cx:u[0],cy:u[1],r:"3.5",fill:c,vectorEffect:"non-scaling-stroke"})]})}function le({label:s,value:t,sub:c,color:a,icon:n}){return e.jsxs("div",{className:"b-tile",children:[e.jsx("span",{className:"b-tile-ic",style:{background:`color-mix(in srgb, ${a} 18%, transparent)`,color:a},children:e.jsx(C,{name:n})}),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:c})]})}const da={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 ha({overview:s,sigil:t,jobs:c,doctor:a,onAction:n}){const l=s.counts||{},i=(a==null?void 0:a.groups)||[],r=i.length>0,d=i.filter(x=>x.problems.length===0).length,g=i.length||1,h=s.deployed?da[s.theme]||"Loaded & ready":"Not deployed",o=Y(s.diff),j=B.filter(x=>(l[x]||0)>0).map((x,y)=>({label:D[x].label,value:l[x]||0,color:U[y%U.length]})),u=j.reduce((x,y)=>x+y.value,0),f=Re(c||[],10),m=f.reduce((x,y)=>x+y.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:h}),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:()=>n("update"),children:[e.jsx(C,{name:"refresh"}),"Update"]}),e.jsxs("button",{className:"btn ghost",onClick:()=>n("build-all"),children:[e.jsx(C,{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(Ne,{segments:[{label:"pass",value:d,color:U[0]},{label:"attention",value:Math.max(g-d,0),color:U[2]}],size:168,stroke:20,caption:"checks"})}),e.jsxs("div",{className:"b-hero-side",children:[e.jsx("h3",{className:"b-hero-title",children:r?`${d} of ${g} 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(x=>{const y=x.problems.length===0;return e.jsxs("li",{className:`b-hcheck ${y?"ok":"bad"}`,title:y?"clean":x.problems.join("; "),children:[e.jsx("span",{className:"b-hcheck-mark",children:y?"✓":"!"}),e.jsx("span",{className:"b-hcheck-label",children:x.label})]},x.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(le,{label:"Agents",value:l.agents??"—",sub:"specialists",color:U[0],icon:"layers"}),e.jsx(le,{label:"Skills",value:l.skills??"—",sub:"workflows",color:U[1],icon:"skill"}),e.jsx(le,{label:"Invariants",value:l.laws??"—",sub:l.doctrines?`${l.doctrines.active}/${l.doctrines.total} packs · ${l.doctrines.rules} rules`:"all upheld",color:U[2],icon:"law"}),e.jsx(le,{label:"Edits",value:o,sub:"to graft",color:U[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:[u," total"]})})]}),e.jsxs("div",{className:"b-mix",children:[e.jsx(Ne,{segments:j,size:186,stroke:26}),e.jsx("div",{className:"b-legend",children:j.map(x=>e.jsxs("div",{className:"b-leg-row",children:[e.jsx("span",{className:"b-leg-dot",style:{background:x.color}}),e.jsx("span",{className:"b-leg-name",children:x.label}),e.jsx("span",{className:"b-leg-bar",children:e.jsx("i",{style:{width:`${x.value/u*100}%`,background:x.color}})}),e.jsx("span",{className:"b-leg-val",children:x.value})]},x.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 · ",d,"/",g," checks pass now"]})]}),e.jsx(oa,{data:f,accent:U[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((c==null?void 0:c.length)||0,12)," runs"]})})]}),e.jsxs("div",{className:"b-timeline",children:[(c||[]).slice(0,la).map(x=>{const y=x.status==="done",N=x.status==="failed"?"warn":y?"ok":"acc";return e.jsxs("div",{className:"b-tl-row",children:[e.jsx("span",{className:`b-tl-node ${N}`}),e.jsxs("div",{className:"b-tl-body",children:[e.jsx("b",{children:x.action}),x.output?`: ${x.output.split(`
11
- `)[0].slice(0,ia)}`:""]}),e.jsx("span",{className:"b-tl-when",children:x.duration?`${x.duration}s`:x.status})]},x.id)}),(!c||c.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 ma=14,ua=120;function te({title:s,right:t,children:c,span:a}){return e.jsxs("div",{className:"c-mod",style:a?{gridColumn:`span ${a}`}: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:c})]})}function Z({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 xa({data:s,height:t=120,hi:c}){if(!s.length)return null;const a=Math.max(...s.map(n=>n.v),1);return e.jsx("div",{className:"c-cols",style:{height:t},children:s.map((n,l)=>{const i=Math.max(n.v/a*(t-6),2);return e.jsx("div",{className:`c-col ${l===c?"hi":""}`,style:{height:i},title:`${n.t}: ${n.v}`},l)})})}function pa({checks:s}){return e.jsx("div",{className:"c-band",children:s.map((t,c)=>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)`}`},c))})}function ga(s){const t={};for(const c of s||[]){const a=c.action||"unknown";t[a]=(t[a]||0)+1}return Object.entries(t).map(([c,a])=>({label:c,value:a})).sort((c,a)=>a.value-c.value)}function ja({overview:s,jobs:t,doctor:c,onAction:a}){const n=s.counts||{},l=B.reduce((m,x)=>m+(n[x]||0),0),i=Math.max(...B.map(m=>n[m]||0),1),r=(c==null?void 0:c.groups)||[],d=r.filter(m=>m.problems.length===0).length,g=Re(t||[],10,"0d"),h=g.reduce((m,x)=>m+x.v,0),o=ga(t),j=Math.max(...o.map(m=>m.value),1),u=Y(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:"—"}):d===r.length?e.jsx("span",{className:"c-pill ok",children:"CLEAN"}):e.jsxs("span",{className:"c-pill warn",children:[r.length-d," ISSUES"]})],["edits",String(u)],["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:()=>a("update"),children:[e.jsx(C,{name:"refresh"}),"UPDATE"]}),e.jsx("button",{className:"btn ghost",onClick:()=>a("build-all"),children:"REBUILD"}),e.jsx("button",{className:"btn ghost",onClick:()=>a("doctor"),children:"DOCTOR"})]})]}),e.jsx("div",{className:"c-strip",children:f.map(([m,x],y)=>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:x})]},y))}),e.jsxs("div",{className:"c-kpi-row",children:[e.jsx(Z,{label:"AGENTS",value:n.agents??"—"}),e.jsx(Z,{label:"SKILLS",value:n.skills??"—"}),e.jsx(Z,{label:"INVARIANTS",value:n.laws??"—"}),e.jsx(Z,{label:"PACKS",value:n.doctrines?`${n.doctrines.active}/${n.doctrines.total}`:"—"}),e.jsx(Z,{label:"MEMORY",value:n.memory??"—"}),e.jsx(Z,{label:"NOTEBOOK",value:n.notebook??"—"}),e.jsx(Z,{label:"EDITS",value:u})]}),e.jsxs("div",{className:"c-grid",children:[e.jsx(te,{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:B.map(m=>e.jsxs("tr",{children:[e.jsx("td",{className:"c-name",children:D[m].label}),e.jsx("td",{className:"c-dim",children:D[m].desc}),e.jsx("td",{children:e.jsx("div",{className:"c-bar",children:e.jsx("i",{style:{width:`${(n[m]||0)/i*100}%`,background:m==="agents"||m==="skills"?"var(--accent)":"var(--line-3)"}})})}),e.jsx("td",{className:(n[m]||0)>0?"num":"num c-dim",children:n[m]??0})]},m))})]})}),e.jsx(te,{title:"DOCTOR // CHECKS",right:r.length?`${d}/${r.length}`:"—",children:r.length>0?e.jsxs(e.Fragment,{children:[e.jsx(pa,{checks:r}),e.jsx("div",{className:"c-check-list",children:r.map(m=>{const x=m.problems.length===0;return e.jsxs("div",{className:"c-check-row",children:[e.jsx("span",{className:`c-dotmark ${x?"ok":"bad"}`}),e.jsx("span",{className:"c-check-name",children:m.label}),e.jsx("span",{className:"c-check-detail",children:x?"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(te,{title:"RUN RATE // 10D",right:`${h} RUNS`,span:2,children:[e.jsx(xa,{data:g,height:120,hi:g.length-1}),e.jsx("div",{className:"c-axis",children:g.map((m,x)=>e.jsx("span",{children:x%2===0?m.t:""},x))})]}),e.jsx(te,{title:"RUN LOG // BY TYPE",right:`${(t||[]).length} LOGGED`,children:o.length>0?e.jsx("table",{className:"c-tbl",children:e.jsx("tbody",{children:o.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/j*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(te,{title:"RECENT // RUN LOG",span:3,children:e.jsx("table",{className:"c-tbl",children:e.jsxs("tbody",{children:[(t||[]).slice(0,ma).map(m=>{const x=m.status==="done",b=m.status==="failed"?"bad":x?"ok":"acc",N=m.output?m.output.split(`
12
- `)[0].slice(0,ua):"—";return e.jsxs("tr",{children:[e.jsxs("td",{style:{width:96},children:[e.jsx("span",{className:`c-dotmark ${b}`})," ",e.jsx("span",{className:"c-dim",children:m.action})]}),e.jsx("td",{className:"c-name",style:{fontWeight:400},children:N}),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."})})]})})})]})]})}const Ga={security:{label:"Security",c:"oklch(0.74 0.085 45)"},verify:{label:"Verification",c:"oklch(0.78 0.075 200)"},process:{label:"Process",c:"oklch(0.76 0.075 150)"},craft:{label:"Craft",c:"oklch(0.78 0.085 95)"},context:{label:"Context",c:"oklch(0.74 0.08 280)"},comms:{label:"Communication",c:"oklch(0.76 0.085 345)"}},Ka=["security","verify","process","craft","context","comms"],fa={craft:"oklch(0.78 0.085 95)",rigor:"oklch(0.78 0.075 200)",ops:"oklch(0.76 0.075 150)",process:"oklch(0.74 0.085 45)"},ve=s=>fa[s]||"var(--text-3)",ya=.62,ba=(s,t)=>String(s).length*t*ya;function Q(s,t){let c=0;for(const a of s){if(a.t===""||a.t==null)continue;const n=ba(a.t,a.size)/2;c=Math.max(c,Math.hypot(n,a.dy-a.size*.75),Math.hypot(n,a.dy+a.size*.25))}return Math.ceil(c+t)}function ie(s,t,c=0){const a=t.x-s.x,n=t.y-s.y,l=Math.hypot(a,n)||1,i=a/l,r=n/l,d=s.x+i*s.r,g=s.y+r*s.r,h=t.x-i*t.r,o=t.y-r*t.r,j=c*l,u=f=>f.toFixed(1);return`M${u(d)} ${u(g)} C${u(d+i*l*.3-r*j)} ${u(g+r*l*.3+i*j)} ${u(h-i*l*.3-r*j)} ${u(o-r*l*.3+i*j)} ${u(h)} ${u(o)}`}function ae({hash:s,label:t,children:c}){return e.jsx("g",{className:"cm-node",role:"button",tabIndex:0,"aria-label":t,onClick:()=>R(s),onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&(a.preventDefault(),R(s))},children:c})}function Na({overview:s}){var m,x,y;const[t,c]=p.useState(null);p.useEffect(()=>{let b=!0;return _.catalog("laws").then(N=>b&&c(N.items||[])).catch(()=>{}),()=>{b=!1}},[]);const a=(s==null?void 0:s.counts)||{},n=Te(a),l=[];for(const b of(t||[]).filter(N=>N.tier==="doctrine")){let N=l.find(k=>k.id===b.pack);N||l.push(N={id:b.pack,on:0}),b.active!==!1&&(N.on+=1)}const i=(s==null?void 0:s.footprint)==="lean"?"lean — first line only":"full text inlined",r={x:330,y:165,r:Q([{t:"Constitution",size:17,dy:-12},{t:`${n} rules in force`,size:10,dy:8},{t:i,size:8.5,dy:24}],12)},d={x:126,y:95,r:Q([{t:"Ontology",size:12.5,dy:-7},{t:`${a.ontology??0} sections`,size:10,dy:10}],11)},g={x:560,y:78,r:Q([{t:"Invariants",size:12.5,dy:-6},{t:`${a.laws??0}`,size:13,dy:12}],11)},h={x:560,y:252,r:Q([{t:"Doctrines",size:12.5,dy:-6},{t:`${((m=a.doctrines)==null?void 0:m.rules)??0}`,size:13,dy:12}],11)},o=(b,N,k,$)=>({x:b,y:N,label:k,count:$,r:Q([{t:k,size:10.5,dy:-2},{t:`${$}`,size:9,dy:10}],9)}),j=[{...o(812,52,"Skills",a.skills??0),hash:"#/skills",from:g},{...o(820,126,"Agents",a.agents??0),hash:"#/agents",from:g},{...o(816,232,"Memory",a.memory??0),hash:"#/section/memory",from:h},{...o(812,300,"Wiki",a.wiki??0),hash:"#/section/wiki",from:h}],u={rx:122,ry:68,from:212,to:112},f=l.map((b,N)=>{const $=(l.length===1?(u.from+u.to)/2:u.from+(u.to-u.from)*N/(l.length-1))*Math.PI/180;return{...b,x:h.x+u.rx*Math.cos($),y:h.y+u.ry*Math.sin($),r:Q([{t:b.id,size:7.5,dy:-2},{t:`${b.on}`,size:7.5,dy:8}],4)}});return e.jsxs("svg",{className:"cmap",viewBox:"0 0 940 350",role:"group","aria-label":"The constitution map",children:[e.jsx("path",{d:ie(r,d,.05),className:"cm-edge"}),e.jsx("path",{d:ie(r,g,-.07),className:"cm-edge"}),e.jsx("path",{d:ie(r,h,.07),className:"cm-edge"}),j.map(b=>e.jsx("path",{d:ie(b.from,b,.03),className:"cm-edge-gov"},`e-${b.label}`)),e.jsxs(ae,{hash:"#/laws",label:`Constitution: ${n} rules in force`,children:[e.jsx("circle",{cx:r.x,cy:r.y,r:r.r,className:"cm-hub-disc"}),e.jsx("text",{x:r.x,y:r.y-12,textAnchor:"middle",className:"cm-hub-name",children:"Constitution"}),e.jsxs("text",{x:r.x,y:r.y+8,textAnchor:"middle",className:"cm-hub-num",children:[n," rules in force"]}),e.jsx("text",{x:r.x,y:r.y+24,textAnchor:"middle",className:"cm-note",children:i})]}),e.jsxs(ae,{hash:"#/laws",label:`Ontology: ${a.ontology??0} sections`,children:[e.jsx("circle",{cx:d.x,cy:d.y,r:d.r,className:"cm-sat-disc"}),e.jsx("text",{x:d.x,y:d.y-7,textAnchor:"middle",className:"cm-sat-name",children:"Ontology"}),e.jsxs("text",{x:d.x,y:d.y+10,textAnchor:"middle",className:"cm-sat-num",children:[a.ontology??0," sections"]})]}),e.jsx("text",{x:d.x,y:d.y+d.r+16,textAnchor:"middle",className:"cm-note",children:"how it thinks, not a rule"}),e.jsxs(ae,{hash:"#/laws",label:`Invariants: ${a.laws??0}, never broken`,children:[e.jsx("circle",{cx:g.x,cy:g.y,r:g.r,className:"cm-sat-disc"}),e.jsx("text",{x:g.x,y:g.y-6,textAnchor:"middle",className:"cm-sat-name",children:"Invariants"}),e.jsx("text",{x:g.x,y:g.y+12,textAnchor:"middle",className:"cm-sat-big",children:a.laws??0})]}),e.jsx("text",{x:g.x,y:g.y+g.r+16,textAnchor:"middle",className:"cm-note",children:"never broken"}),e.jsxs(ae,{hash:"#/laws",label:`Doctrines: ${((x=a.doctrines)==null?void 0:x.rules)??0} rules chosen at build`,children:[e.jsx("circle",{cx:h.x,cy:h.y,r:h.r,className:"cm-sat-disc"}),e.jsx("text",{x:h.x,y:h.y-6,textAnchor:"middle",className:"cm-sat-name",children:"Doctrines"}),e.jsx("text",{x:h.x,y:h.y+12,textAnchor:"middle",className:"cm-sat-big",children:((y=a.doctrines)==null?void 0:y.rules)??0})]}),e.jsx("text",{x:h.x+22,y:h.y+h.r+20,className:"cm-note",children:a.doctrines?`chosen at build · ${a.doctrines.active}/${a.doctrines.total} packs lit`:"chosen at build"}),e.jsx("g",{className:"cm-mini",children:f.map(b=>e.jsxs("g",{children:[e.jsx("circle",{cx:b.x,cy:b.y,r:b.r,className:"cm-pack-disc",style:{stroke:ve(b.id)}}),e.jsx("text",{x:b.x,y:b.y-2,textAnchor:"middle",className:"cm-pack-id",children:b.id}),e.jsx("text",{x:b.x,y:b.y+8,textAnchor:"middle",style:{fill:ve(b.id)},children:b.on})]},b.id))}),e.jsx("text",{x:866,y:16,textAnchor:"middle",className:"cm-govern-label",children:"GOVERNS THE HARNESS"}),j.map(b=>e.jsxs(ae,{hash:b.hash,label:`${b.label}: ${b.count}`,children:[e.jsx("circle",{cx:b.x,cy:b.y,r:b.r,className:"cm-gov-disc"}),e.jsx("text",{x:b.x,y:b.y-2,textAnchor:"middle",className:"cm-gov-name",children:b.label}),e.jsx("text",{x:b.x,y:b.y+10,textAnchor:"middle",className:"cm-gov-num",children:b.count})]},b.label)),e.jsx("text",{x:d.x,y:228,textAnchor:"middle",className:"cm-note",children:"tap any node to open its ledger"})]})}function va(){const s=new Date,t=c=>String(c).padStart(2,"0");return`${s.getFullYear()}-${t(s.getMonth()+1)}-${t(s.getDate())}`}function ka({counts:s}){const t=[{label:D.skills.label,n:s.skills??0,hash:"#/skills"},{label:"Rules in force",n:Te(s),hash:"#/laws"},{label:D.agents.label,n:s.agents??0,hash:"#/agents"},{label:D.memory.label,n:s.memory??0,hash:"#/section/memory"},{label:D.notebook.label,n:s.notebook??0,hash:"#/section/notebook"},{label:D.wiki.label,n:s.wiki??0,hash:"#/section/wiki"},{label:D.config.label,n:s.config??0,hash:"#/section/config"}],c=Math.max(...t.map(a=>a.n),1);return e.jsxs("div",{className:"card pad-lg jr-card",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Growth rings"}),e.jsx("span",{className:"tick right",children:"by section"})]}),t.map(a=>e.jsxs("button",{className:"jr-ring",onClick:()=>R(a.hash),children:[e.jsx("span",{className:"jr-ring-label",children:a.label}),e.jsx("span",{className:"jr-ring-track",children:e.jsx("span",{className:"jr-ring-fill",style:{width:`${a.n/c*100}%`}})}),e.jsx("span",{className:"jr-ring-num",children:a.n})]},a.label))]})}function wa({recent:s,buildEpoch:t}){const c=(s==null?void 0:s.items)||[],a=(s==null?void 0:s.skipped)||[];return e.jsxs("div",{className:"card pad-lg jr-card",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"Freshly grown"}),e.jsx("span",{className:"tick right",children:"newest"})]}),s?c.length===0?e.jsx("p",{className:"sub",children:"Nothing here carries a date yet."}):c.slice(0,5).map(n=>e.jsxs("button",{className:"jr-fresh",onClick:()=>R(`#/item/${n.type}/${encodeURIComponent(n.name)}`),children:[e.jsx("span",{className:"jr-fresh-kind",children:n.section}),e.jsx("span",{className:"jr-fresh-name",children:n.title}),e.jsx("span",{className:"jr-fresh-when",children:re(n.mtime)})]},`${n.section}:${n.name}`)):e.jsx("p",{className:"sub",children:"Reading the shelves…"}),a.length>0&&e.jsxs("p",{className:"sub jr-skipped",children:["Not dated: ",a.join(", ")," — too many files to stat on every load."]}),e.jsxs("p",{className:"jr-care",children:[t?`Last built ✓ ${re(t)}`:"Never built here"," ·"," ",e.jsx("button",{className:"jr-go",onClick:()=>R("#/activity"),children:"log →"})]})]})}function Ma({overview:s,recent:t,onAction:c,onDirection:a}){const n=(s==null?void 0:s.counts)||{};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"head-row jr-head",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"eyebrow",children:["Field journal · ",va()]}),e.jsx("h1",{className:"h",children:"Today in this harness"})]}),e.jsxs("div",{className:"row wrap gap-10",children:[e.jsx("button",{className:"btn primary",onClick:()=>c==null?void 0:c("update"),children:"Update & rebuild"}),e.jsx("button",{className:"btn",onClick:()=>R("#/doctor"),children:"Doctor"})]})]}),e.jsxs("div",{className:"jr-row2",children:[e.jsx(ka,{counts:n}),e.jsx(wa,{recent:t,buildEpoch:s==null?void 0:s.build_epoch})]}),e.jsxs("div",{className:"card pad-lg jr-map",children:[e.jsxs("div",{className:"card-head",children:[e.jsx("h3",{children:"The Constitution — and the harness it governs"}),e.jsx("button",{className:"jr-go right",onClick:()=>R("#/laws"),children:"open →"})]}),e.jsx(Na,{overview:s})]}),e.jsxs("p",{className:"sub jr-others",children:["Other views:"," ",e.jsx("button",{className:"jr-go",onClick:()=>a==null?void 0:a("lineage"),children:"Lineage"})," ","·"," ",e.jsx("button",{className:"jr-go",onClick:()=>a==null?void 0:a("operator"),children:"Operator"})]})]})}function Sa({error:s,style:t}){return s?e.jsx("p",{className:"badge bad",style:t,children:s}):null}function Ea({onAction:s}){var j,u,f,m,x;const{data:t,error:c}=Le(()=>_.themes(),[]),[a,n]=p.useState(""),[l,i]=p.useState("");if(c)return e.jsx(Sa,{error:c});if(!t)return e.jsx(Oe,{});const r=a||((j=t.current)==null?void 0:j.theme)||"neutral",d=(u=t.emits)==null?void 0:u.some(y=>y.name==="opencode-global"),g=l||(d?"opencode-global":((f=t.current)==null?void 0:f.emit)||((x=(m=t.emits)==null?void 0:m[0])==null?void 0:x.name)||""),h=n,o=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(y=>e.jsxs("button",{className:`btn ${y.name===r?"soft":"ghost"}`,onClick:()=>h(y.name),title:y.blurb||y.tagline||y.name,children:[e.jsx("span",{className:"po",style:{width:10,height:10,borderRadius:"50%",background:ne(y.accent),boxShadow:`0 0 8px ${ne(y.accent)}`}}),e.jsx("span",{style:{textTransform:"capitalize"},children:y.name})]},y.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:g,onChange:y=>o(y.target.value),children:t.emits.map(y=>e.jsxs("option",{value:y.name,children:[y.name,y.desc?` · ${y.desc}`:""]},y.name))})]})]}),e.jsxs("button",{className:"btn btn-grid",disabled:!g,onClick:()=>s("build",{theme:r,emit:g}),children:[e.jsx(C,{name:"build"}),"Deploy harness"]})]})}function _a({overview:s,themes:t,setup:c,onAction:a,flavour:n="a",layout:l="auto"}){var b;const i=yt(n,l),[r,d]=p.useState("status"),[g,h]=p.useState([]),[o,j]=p.useState(null),[u,f]=p.useState(null),[m,x]=p.useState(null),y=s&&((b=t.find(N=>N.name===s.theme))==null?void 0:b.sigil)||"";return p.useEffect(()=>{let N=!0;return _.jobs().then(k=>N&&h(k.jobs||[])).catch(()=>{}),_.graph().then(k=>N&&j(k)).catch(()=>{}),(i==="greenhouse"||i==="operator")&&_.doctor().then(k=>N&&f(k)).catch(()=>{}),i==="journal"&&_.recent().then(k=>N&&x(k)).catch(()=>{}),()=>{N=!1}},[i]),s?s.deployed?r==="status"&&i==="journal"?e.jsx(Ma,{overview:s,recent:m,onAction:a,onDirection:d}):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(([N,k])=>e.jsx("button",{className:r===N?"on":"",onClick:()=>d(N),children:k},N))})]}),r==="status"&&i==="cultivar"&&e.jsx(ea,{overview:s,sigil:y,setup:c,jobs:g,onAction:a}),r==="status"&&i==="greenhouse"&&e.jsx(ha,{overview:s,sigil:y,jobs:g,doctor:u,onAction:a}),r==="status"&&i==="operator"&&e.jsx(ja,{overview:s,jobs:g,doctor:u,onAction:a}),r==="lineage"&&e.jsx(aa,{overview:s,sigil:y,setup:c,jobs:g,graph:o}),r==="operator"&&e.jsx(na,{overview:s,setup:c,jobs:g})]}):e.jsx(Ea,{onAction:a}):e.jsx("div",{className:"loading",children:"Loading…"})}const Ca=p.lazy(()=>P(()=>import("./Activity-B49fE_ug.js"),__vite__mapDeps([0,1,2]))),$a=p.lazy(()=>P(()=>import("./ActivityDetail-abt7hzD2.js"),__vite__mapDeps([3,1,2]))),Aa=p.lazy(()=>P(()=>import("./Library-MjbOkHIW.js"),__vite__mapDeps([4,1,5,6,7]))),Ta=p.lazy(()=>P(()=>import("./Laws-CxmnRdwt.js"),__vite__mapDeps([8,1,9]))),Fa=p.lazy(()=>P(()=>import("./Rules-CfsV1EVy.js"),__vite__mapDeps([10,1]))),La=p.lazy(()=>P(()=>import("./Profile-BRFvv2gr.js"),__vite__mapDeps([11,1,5,6]))),Oa=p.lazy(()=>P(()=>import("./Skills-DArA6IHS.js"),__vite__mapDeps([12,1,5,6,7]))),Ra=p.lazy(()=>P(()=>import("./Diff-D3_bVkih.js"),__vite__mapDeps([13,1]))),Ia=p.lazy(()=>P(()=>import("./Doctor-hXp7srsx.js"),__vite__mapDeps([14,1]))),Da=p.lazy(()=>P(()=>import("./Graph-DvYMtlvl.js"),__vite__mapDeps([15,1,9]))),Pa=p.lazy(()=>P(()=>import("./index-DC3-GlCY.js"),__vite__mapDeps([16,1]))),za=p.lazy(()=>P(()=>import("./Harness-BIWei7N5.js"),__vite__mapDeps([17,1]))),Ba=p.lazy(()=>P(()=>import("./index-dHi-7M-F.js"),__vite__mapDeps([18,1,6])));function Va(){const s=Qs(),t=s.view==="section",c=s.view==="item",a=s.view==="laws"||t&&s.section==="laws"||c&&s.type==="law",n=s.view==="skills"||t&&s.section==="skills"||c&&s.type==="skill",l=s.view==="library"||s.view==="agents"||(t||c)&&!a&&!n,i=s.view==="agents"?"agents":t?s.section:c?nt[s.type]||s.type:void 0,r=c?s.name:void 0,[d,g]=p.useState(""),[h,o]=p.useState(null),[j,u]=p.useState(!1),[f,m]=p.useState(!1),[x,y]=lt(),[b,N]=ht(),[k,$]=pt(),[O,V]=bt(),[ee,S]=p.useState(()=>!window.sessionStorage.getItem("gs-booted")),[w,T]=p.useState(!1),F=p.useRef(null);p.useEffect(()=>{if(!w)return;const M=X=>{X.key==="Escape"&&T(!1)};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[w]);const z=M=>{var X,ge;return o({kind:((X=M==null?void 0:M.body)==null?void 0:X.kind)||"err",msg:((ge=M==null?void 0:M.body)==null?void 0:ge.message)||M.message})},{overview:v,themes:I,reload:W}=Nt(z),[H,q]=p.useState(0),he=()=>{W(),q(M=>M+1)},{runs:me,activeId:Ie,consoleOpen:De,setConsoleOpen:Pe,runAction:J,cancelJob:ze,clearRuns:Be}=Mt({onFinish:he,onError:z}),[pe,Ve]=p.useState(null);p.useEffect(()=>{let M=!0;return _.setup().then(X=>M&&Ve(X)).catch(()=>{}),()=>{M=!1}},[H]);const se=me[me.length-1],We=se?se.status==="running"?`${se.action} running`:`${se.action} ${se.status}`:"";p.useEffect(()=>{const M=F.current;M&&(k==="curated"&&at(M,b,x)||v!=null&&v.accent&&st(M,v.accent,x))},[v,x,k,b]);const He=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-${b} ${x==="light"?"light":""}`,ref:F,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-${b} ${x==="light"?"light":""}${w?" nav-open":""}`,ref:F,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:We}),w&&e.jsx("button",{type:"button",className:"nav-scrim","aria-label":"Close navigation",onClick:()=>T(!1)}),e.jsx(Ft,{route:s,overview:v,setup:pe,onOpenVoice:()=>u(M=>!M),onNavigate:()=>T(!1)}),j&&e.jsx(Wt,{themes:I,current:v==null?void 0:v.theme,onPick:M=>{u(!1),J("build",{theme:M,emit:v==null?void 0:v.emit})},onClose:()=>u(!1)}),e.jsxs("div",{className:"col",children:[e.jsx(Vt,{route:s,navOpen:w,onToggleNav:()=>T(M=>!M),target:v==null?void 0:v.target,version:v==null?void 0:v.version,query:d,onQuery:g,mode:x,onToggleMode:y,onShutdown:He,dataRev:H,onSwitch:he}),e.jsx("main",{className:"page",id:"main",tabIndex:-1,children:e.jsx("div",{className:s.view==="harness"?"pad pad-wide":"pad",children:e.jsxs(p.Suspense,{fallback:e.jsx(Oe,{}),children:[s.view==="dashboard"&&e.jsx(_a,{overview:v,themes:I,setup:pe,onAction:J,flavour:b,layout:O}),s.view==="activity"&&e.jsx(Ca,{}),s.view==="activity-detail"&&e.jsx($a,{sid:s.sid},s.sid),a&&e.jsx(Ta,{selected:r,overview:v,onAction:J}),n&&e.jsx(Oa,{selected:r}),l&&e.jsx(Aa,{overview:v,section:i,selected:r,dataRev:H}),s.view==="rules"&&e.jsx(Fa,{}),s.view==="profile"&&e.jsx(La,{}),s.view==="diff"&&e.jsx(Ra,{onMutated:W,dataRev:H}),s.view==="doctor"&&e.jsx(Ia,{}),s.view==="graph"&&e.jsx(Da,{}),s.view==="settings"&&e.jsx(Pa,{overview:v,onAction:J,flavour:b,onFlavour:N,accentMode:k,onAccentMode:$,layout:O,onLayout:V}),s.view==="harness"&&e.jsx(za,{onAction:J,themes:I,currentTheme:v==null?void 0:v.theme,overview:v,dataRev:H,onMutated:he}),s.view==="docs"&&e.jsx(Ba,{page:s.page,query:d,onAction:J,overview:v})]})})}),e.jsx(Gt,{runs:me,open:De,busy:!!Ie,onToggle:()=>Pe(M=>!M),onClear:Be,onCancel:ze})]}),h&&e.jsx(Ut,{toast:h,onClose:()=>o(null)}),ee&&e.jsx(Yt,{ready:!!v,onDone:()=>{window.sessionStorage.setItem("gs-booted","1"),S(!1)}})]})}Ue(document.getElementById("root")).render(e.jsx(Va,{}));"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})});export{ut as A,Sa as E,rt as F,C as I,Oe as L,fa as P,D as S,_ as a,Ha as b,Ua as c,Ga as d,Ka as e,jt as f,R as g,ft as h,de as i,e as j,re as r,Le as u};
@@ -1,2 +0,0 @@
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-DP035wPa.js";import{r as p}from"./react-DOpiTn5v.js";import{m as I}from"./marked.esm-JKvyS0Pp.js";const R="geneseed-harness",P=[{id:"opencode",label:"OpenCode"},{id:"claude",label:"Claude Code"}];function A(){return _(R,s=>s==="claude"||s==="opencode"?s:"opencode")}function $(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 H(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 d=r.match(/^(##|###)\s+(.+?)\s*$/);d&&(l+=1,n.push({level:d[1].length,title:d[2],id:$(d[2],l)}))}return n}function M(s,n){const a=new Map((n||[]).map(r=>[r.label,r])),l=(s||"").replace(/\[\[([^\]]+)\]\]/g,(r,d)=>{const i=a.get(d.trim());return i?`[${i.label}](#/item/${i.type}/${encodeURIComponent(i.name)})`:r});return I.parse(l,{breaks:!1})}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 O({page:s,overview:n,onAction:a}){const l=p.useRef(null),r=p.useMemo(()=>H(s.body),[s.body]),d=p.useMemo(()=>M(s.body,s.links),[s.body,s.links]);p.useEffect(()=>{const t=l.current;if(!t)return;let o=0;t.querySelectorAll("h1, h2, h3").forEach(u=>{if(o+=1,!u.id){const x=$(u.textContent||"",o);x&&(u.id=x)}})},[d]),p.useEffect(()=>{const t=l.current;if(!t)return;const o=u=>{const x=u.target.closest("a[href]");if(!x)return;const f=x.getAttribute("href");f&&f.startsWith("#/")&&(u.preventDefault(),g(f))};return t.addEventListener("click",o),()=>t.removeEventListener("click",o)},[d]),p.useEffect(()=>{const t=s.anchor;if(!t)return;const o=y(l.current,`#${CSS.escape(t)}`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})},[d,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 o=q[n==null?void 0:n.emit];if(!o)return;const u=y(t,`#${CSS.escape(o)}`);u&&u.classList.add("docs-here")},[d,s.id,n==null?void 0:n.emit]);const i=t=>{if(!t)return;const o=y(l.current,`#${CSS.escape(t)}`);o&&o.scrollIntoView({behavior:"smooth",block:"start"})},j=r.length>=3,m=[];return(s.id==="install-paths"||s.id==="install-quick")&&(m.push({label:"Run doctor",action:"doctor"}),m.push({label:"Rebuild",action:"build"})),s.id==="verify"&&m.push({label:"Run doctor",action:"doctor"}),s.id==="self-improve"&&m.push({label:"Open diff",hash:"#/diff"}),s.id==="upgrade"&&m.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]})}),m.length>0&&e.jsx("div",{className:"row wrap gap-10",style:{margin:"10px 0 14px"},children:m.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:o=>{o.preventDefault(),i(t.id)},children:t.title})},t.id))})]}),e.jsx("div",{className:"markdown",ref:l,dangerouslySetInnerHTML:{__html:d}}),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 U=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 D({text:s}){const[n,a]=p.useState(!1),l=async()=>{try{await navigator.clipboard.writeText(s),a(!0),setTimeout(()=>a(!1),U)}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 F({cmd:s,prog:n}){const a=[n,s.name];for(const r of s.positionals||[]){const d=(r.metavar||r.dest||"").toUpperCase();a.push(r.required?d:`[${d}]`)}(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(D,{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 G({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(F,{cmd:l,prog:n},l.name))})]})}function z({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 B({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 V({pageId:s,harness:n,overview:a,onAction:l}){const{data:r,error:d,loading:i}=w(()=>s?T.docsPage(s,n):Promise.resolve(null),[s,n]);if(d)return e.jsx(S,{error:d,style:{margin:18}});if(i||!r)return e.jsx(E,{label:"Loading page…"});switch(r.kind){case"markdown":case"concept":return e.jsx(O,{page:r,overview:a,onAction:l});case"cli":return e.jsx(G,{page:r});case"glossary":return e.jsx(z,{page:r});case"about":return e.jsx(B,{page:r});default:return e.jsxs("div",{className:"empty",children:[e.jsx("div",{className:"big",children:"Unknown page kind"}),r.kind]})}}function Y(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 Q({page:s,query:n,overview:a,onAction:l}){var v;const[r,d]=A(),{data:i,error:j}=w(()=>T.docs(r),[r]),m=s||C(i);p.useEffect(()=>{if(!i||!m)return;if(!i.groups.some(h=>h.pages.some(b=>b.id===m))){const h=C(i);h&&h!==m&&g(`#/docs/${encodeURIComponent(h)}`)}},[i,m]);const t=Y(i,m)||((v=i==null?void 0:i.groups)==null?void 0:v[0]),o=(n||"").toLowerCase().trim(),u=p.useMemo(()=>i?o?i.groups.map(c=>({...c,pages:c.pages.filter(h=>h.title.toLowerCase().includes(o)||c.label.toLowerCase().includes(o)||h.id.toLowerCase().includes(o))})).filter(c=>c.pages.length>0):t?[t]:[]:[],[i,o,t]);if(j)return e.jsx(S,{error:j});const x=(i==null?void 0:i.groups)||[],f=!!o,L=c=>{var b;const h=(b=c.pages[0])==null?void 0:b.id;h&&g(`#/docs/${encodeURIComponent(h)}`)};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:P.map(c=>e.jsx("button",{className:r===c.id?"on":"",onClick:()=>d(c.id),"aria-pressed":r===c.id,children:c.label},c.id))})]}),e.jsx("div",{className:"lib-secbar",children:x.map(c=>e.jsxs("button",{className:`lib-secchip ${(t==null?void 0:t.id)===c.id?"on":""}`,onClick:()=>L(c),children:[e.jsx("span",{children:c.label}),e.jsx("span",{className:"lib-secchip-n",children:c.pages.length})]},c.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:o?"all groups":(t==null?void 0:t.label)||""}),e.jsxs("span",{className:"lib-head-count",children:[u.reduce((c,h)=>c+h.pages.length,0)," pages"]})]}),e.jsxs("div",{className:"lib-rows",children:[u.map(c=>e.jsxs("div",{className:"docs-group",children:[f&&e.jsx("div",{className:"docs-group-head",children:c.label}),c.pages.map(h=>e.jsxs("button",{className:`lib-row ${m===h.id?"on":""}`,onClick:()=>g(`#/docs/${encodeURIComponent(h.id)}`),children:[e.jsx("div",{className:"lr-name",children:h.title}),h.date?e.jsx("div",{className:"lr-desc",children:h.date}):null]},h.id))]},c.id)),u.length===0&&i&&e.jsxs("div",{className:"empty",style:{padding:32},children:[e.jsx("div",{className:"big",children:"No matches"}),"Try another search."]}),!i&&e.jsx(E,{label:"Loading docs…"})]})]}),e.jsx("div",{className:"card lib-detail",children:e.jsx(V,{pageId:m,harness:r,overview:a,onAction:l})})]})]})}export{Q as default};
@@ -1 +0,0 @@
1
- const a={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};function c(o){if(!o)return NaN;const t=String(o).toUpperCase();if(!/^[IVXLCDM]+$/.test(t))return NaN;let r=0;for(let n=0;n<t.length;n++){const e=a[t[n]],s=a[t[n+1]];r+=s&&s>e?-e:e}return r}export{c as r};