geneseed 4.23.0 → 4.24.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 (59) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/SHIPPED.md +1 -1
  3. package/adapters/opencode/plugins/geneseed-context.js +1 -1
  4. package/docs/concepts/footprint.md +2 -2
  5. package/docs/concepts/foreman-mode.md +20 -12
  6. package/docs/guides/choose-your-setup.md +2 -2
  7. package/docs/guides/setup-footprint.md +1 -1
  8. package/docs/reference/glossary.md +1 -1
  9. package/docs/web-ui.md +5 -4
  10. package/harness.config.json +1 -1
  11. package/js/hosts/hooks-context.mjs +1 -1
  12. package/js/maintain/memory.mjs +1 -0
  13. package/js/maintain/setup.mjs +1 -1
  14. package/js/web/actions.mjs +27 -1
  15. package/js/web/catalog.mjs +10 -2
  16. package/js/web/daemon.mjs +27 -8
  17. package/js/web/handler.mjs +29 -9
  18. package/js/web/update-check.mjs +6 -4
  19. package/js/web/user-files.mjs +34 -11
  20. package/package.json +1 -1
  21. package/src/AGENT.md.tmpl +1 -1
  22. package/src/modes/README.md +1 -1
  23. package/src/modes/foreman.md +45 -26
  24. package/src/skills/pipeline.md +2 -2
  25. package/src/skills/rule.md +2 -1
  26. package/web/dist/assets/Activity-DvmB7N8g.js +1 -0
  27. package/web/dist/assets/{ActivityDetail-BsVbLWoA.js → ActivityDetail-Bd1ul_B-.js} +1 -1
  28. package/web/dist/assets/CopyButton-BnPdDHls.js +1 -0
  29. package/web/dist/assets/Dashboard-DtJ0xrcA.js +2 -0
  30. package/web/dist/assets/Docs-Bt9FAScn.js +5 -0
  31. package/web/dist/assets/GreenhouseView-BBCsUAcJ.js +1 -0
  32. package/web/dist/assets/Installs-BHxWO-Ev.js +3 -0
  33. package/web/dist/assets/{JournalView-e6BBAz6i.js → JournalView-CLf3j4Ar.js} +1 -1
  34. package/web/dist/assets/{KitApply-Bz6_5yec.js → KitApply-BaDKgnO8.js} +1 -1
  35. package/web/dist/assets/Kits-DmqZkK4K.js +1 -0
  36. package/web/dist/assets/Laws-BcUWCQvl.js +3 -0
  37. package/web/dist/assets/Library-CuRHfeqT.js +2 -0
  38. package/web/dist/assets/Loops-D7VflI8x.js +2 -0
  39. package/web/dist/assets/OperatorHudView-BxKeM_Lk.js +1 -0
  40. package/web/dist/assets/{Personal-BwZ33bqc.js → Personal-Bpl90lqc.js} +1 -1
  41. package/web/dist/assets/RailCats-BuJD4Jou.js +1 -0
  42. package/web/dist/assets/{Tabs-ByiD3mPQ.js → Tabs-kIqas9Tj.js} +1 -1
  43. package/web/dist/assets/index-IuDNqPEl.css +1 -0
  44. package/web/dist/assets/index-UNxZecs3.js +3 -0
  45. package/web/dist/index.html +2 -2
  46. package/web/dist/sw.js +10 -2
  47. package/web/dist/assets/Activity-GdsfJgQQ.js +0 -1
  48. package/web/dist/assets/Dashboard-CnO_bsfz.js +0 -2
  49. package/web/dist/assets/Docs-DctLhPHX.js +0 -4
  50. package/web/dist/assets/GreenhouseView-CC1wDg4u.js +0 -1
  51. package/web/dist/assets/Installs-D3fE87tF.js +0 -3
  52. package/web/dist/assets/Kits-BtNHZ7_Z.js +0 -1
  53. package/web/dist/assets/Laws-B2X2jIE9.js +0 -3
  54. package/web/dist/assets/Library-BXHx4pFJ.js +0 -2
  55. package/web/dist/assets/Loops-B_wNVFEN.js +0 -2
  56. package/web/dist/assets/OperatorHudView-BcPPpykd.js +0 -1
  57. package/web/dist/assets/RailCats-BtIstKaH.js +0 -1
  58. package/web/dist/assets/index-BX3zc2Yi.css +0 -1
  59. package/web/dist/assets/index-D2VlAlpK.js +0 -3
@@ -16,7 +16,7 @@ any posture and any mode.
16
16
  | Mode | For |
17
17
  |------|-----|
18
18
  | [direct](direct.md) *(default)* | The agent works the task itself, turn by turn. |
19
- | [foreman](foreman.md) | The session triages incoming tasks, spawning isolated pipelines for substantial work while staying responsive to the user. |
19
+ | [foreman](foreman.md) | The session triages incoming tasks, handing each one that would block it to a background task worker it can re-brief, while staying responsive to the user. |
20
20
 
21
21
  Every mode still obeys the ontology and the invariants — a mode changes *how* work
22
22
  proceeds, never the principles.
@@ -1,28 +1,47 @@
1
- **Foreman** — the session becomes the parent: it triages incoming work, spawns
2
- crews for what's substantial, and keeps answering the user without blocking.
1
+ **Foreman** — the session becomes the parent: it triages incoming work, hands each
2
+ task that would block it to one background task worker, and keeps answering the user.
3
3
 
4
- - **Stay responsive.** Answer the user immediately; never let a running pipeline
4
+ - **Stay responsive.** Answer the user immediately; never let a running worker
5
5
  block the conversation.
6
- - **Triage every incoming task by count, not by feel.** A task is *substantial* when
7
- any one of these holds: it will change two or more files; it needs a new or changed
8
- test; it needs about five reads or searches before the first edit; or it asks for a
9
- feature, a fix, a review, an audit or an investigation. Substantial → spawn a
10
- pipeline (the `pipeline` {{SKILL}}) in the background and tell the user it's
11
- running. *Trivial* — none of these holds: a question answered from what is already
12
- in context, a one-file tweak, a single command → do it directly, no pipeline.
13
- **When unsure, delegate.** A host default to do small work yourself does not apply
14
- here: this mode is the user's standing choice to delegate.
15
- - **Dispatch one crew lead, then step away.** The crew lead composes the crew from
16
- the whole agent roster, never below the floor for the task type, and runs the relay
17
- itself. Never run the hand-offs from this session. Floors, roles and per-host
18
- mechanics live in the pipeline {{SKILL}}, not here.
19
- - **Isolate.** Each pipeline works in its own git worktree/branch; falls back to a
20
- single tree, one pipeline at a time, when worktrees are unavailable.
21
- - **Merge on proof you re-ran.** A pipeline hands back its worktree, uncommitted, with
22
- raw test + lint output. The parent re-runs those commands itself — a crew's log is
23
- the crew's account, not the state — shows the user the diff and the green output, and
24
- commits and merges only once the user accepts ({{DOCTRINE:consent-before-push}}). Commit, push and
25
- merge stay the parent's alone.
26
- - **Report.** Surface pipeline completions, failures, and merges to the user as
27
- they happen; a crew that returns no proof, or goes silent, is handled as the
28
- pipeline {{SKILL}}'s step 2 says.
6
+ - **Triage by what would block you, counted, not felt.** Delegate a task when any one
7
+ of these holds: it will run a command longer than about a minute (a test suite, a
8
+ build, a canary); it will change three or more files; or it can run beside work
9
+ already in flight while the user keeps talking. Otherwise do it inline: a question, a
10
+ read-and-explain, an edit to one or two files with a quick check, a short
11
+ investigation. **When unsure, delegate.** A host default to do small work yourself
12
+ does not apply here: this mode is the user's standing choice to delegate.
13
+ - **One worker per task.** Dispatch one developer {{AGENT}} in the background, in its own
14
+ worktree. The brief carries the task as the user stated it, BASE, the write set, the
15
+ proof commands, and the rule that it never commits, pushes or merges. The worker
16
+ explores, implements and tests in its own context, loading {{SKILLS}} as it needs them;
17
+ after two repair rounds on its own red tests it returns red with its findings
18
+ ({{DOCTRINE:bound-the-loop}}). It dispatches no {{AGENTS}}, except a read-only explorer
19
+ when its own context would overflow. Check its write set against every task in flight
20
+ ({{DOCTRINE:one-writer-per-file}}).
21
+ - **Verify non-trivial diffs blind.** When a worker returns green with a diff that touches
22
+ two or more files or changes logic, dispatch a reviewer (a tester for test-heavy work)
23
+ with only the original ask and the diff, never the worker's reasoning. A failing verdict
24
+ goes back to the same worker.
25
+ - **Keep a ledger; route follow-ups to the same worker.** Keep
26
+ `{{DIR_NOTEBOOK}}/foreman-ledger.md`, one line per live task:
27
+ `T3 · <task> · agent <id> · worktree <path> · <state>` (running, green, red, verifying,
28
+ merged, dropped). Update it on every dispatch and return; re-read it after a compaction.
29
+ A correction, follow-up or verifier finding on a task goes to that task's worker
30
+ (`SendMessage` on Claude Code), which resumes with its full context. Start a new worker
31
+ only when the old one cannot be resumed — the host has no resume, or its context is
32
+ spent — and hand it a note: the ask, the diff so far, the findings, what was tried. A
33
+ worker serves one task and retires when that task is merged or dropped.
34
+ - **Isolate.** Each worker works in its own git worktree/branch; falls back to a single
35
+ tree, one worker at a time, when worktrees are unavailable.
36
+ - **Merge on proof you re-ran.** A worker hands back its worktree, uncommitted, with raw
37
+ test + lint output. The parent re-runs those commands itself — a worker's log is the
38
+ worker's account, not the state — shows the user the diff and the green output, and
39
+ commits and merges only once the user accepts ({{DOCTRINE:consent-before-push}}). Commit,
40
+ push and merge stay the parent's alone.
41
+ - **Report and watch.** Surface completions, failures, and merges to the user as they
42
+ happen; a worker that returns no proof, or goes silent, is handled as the pipeline
43
+ {{SKILL}}'s step 2 says for a crew.
44
+ - **Crews are opt-in.** Run the `pipeline` {{SKILL}} only when the user asks for a
45
+ pipeline or a crew, or for a large multi-part task that needs several specialists
46
+ (security, architect, performance). Independent subtasks side by side go to
47
+ parallel-agents.
@@ -4,7 +4,7 @@
4
4
 
5
5
  {{CREDIT:superpowers:skills/subagent-driven-development/SKILL.md}}
6
6
 
7
- **Trigger:** [foreman mode](../modes/foreman.md) routes a triaged *substantial* task here; also directly invocable without that mode whenever the user asks to "run a pipeline" for a development, documentation, research, or review task. The crew is a relay, not a fan-out: its agents take turns in one worktree, each handed what the previous one produced — for independent subtasks run side by side, use [parallel-agents](parallel-agents.md).
7
+ **Trigger:** opt-in. The user asks to "run a pipeline" or for a crew on a development, documentation, research, or review task; or, under [foreman mode](../modes/foreman.md), a large multi-part task needs several specialists. Foreman's default for a delegated task is one task worker, not a crew. The crew is a relay, not a fan-out: its agents take turns in one worktree, each handed what the previous one produced — for independent subtasks run side by side, use [parallel-agents](parallel-agents.md).
8
8
 
9
9
  ## What it is
10
10
 
@@ -25,7 +25,7 @@ The minimum roster per task type. The crew lead chooses the crew from the whole
25
25
 
26
26
  ## Procedure
27
27
 
28
- 1. Take the triage as given. Under foreman mode the task reached you because it met the mode's count; invoked directly, the user's request is the trigger. Do not weigh it again and fall back to doing the work yourself.
28
+ 1. Take the trigger as given: the user's request for a crew, or foreman's judgement that the task needs several specialists. Do not weigh it again and fall back to doing the work yourself.
29
29
  2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}}, and the rule that it never commits, pushes or merges. Tell the user the pipeline is running, then go back to the user. Do not wait on the crew lead. **Then watch what you dispatched.** An envelope without proof, or one that says the crew is still waiting, is a failure: act on it at once — resume the crew lead (`SendMessage` on Claude Code) or take over its worktree — never wait for a notification it promised. A crew member's report that reaches you directly means its crew lead has already ended; act on it the same way. Before you end a turn with a crew still out, set a check where the host offers one (`CronCreate` on Claude Code, top level only); elsewhere, check at the start of every turn. A crew is stalled when its transcript and output have not grown for 15 minutes **and** it has no live child process: ping it once; if the next check shows no change, stop it, then take over from its worktree. A crew whose output still grows, or that runs a child process, is never taken over — a long suite or canary is not a stall.
30
30
  3. **The crew lead composes the crew** from the floor above and adds any {{AGENT}} the task needs. It dispatches each crew member as its own subagent, each handed what the previous one produced. **The crew lead never ends with a member unresolved.** Its last message is its result: once it ends, nothing wakes it, and a member that outlives it reports past it, to the parent. It may run members in parallel, but holds every member's result before it ends — returned, or failed and then redone or named as failed in the envelope. A member that returns nothing has failed. Where the crew lead holds no dispatch tool (see *Hosts* below), it plays each role in turn itself, with the same hand-offs and the same envelope. Steps 4 to 7 are the crew lead's, except where they name the parent.
31
31
  4. Isolate the crew's work in its own git worktree/branch. Where worktrees are unavailable, fall back to a single tree, one pipeline at a time, and say so. The crew writes only inside its write set; shared append files (registries, index tables, lockfiles, generated bundles) are the parent's to apply, never a crew's.
@@ -87,7 +87,8 @@ re-derived. Then take exactly one branch.
87
87
  `source:` to the memory's name and add `trial until:` about a month out — a
88
88
  promoted rule starts on probation.
89
89
  7. Show the exact text to the user and wait for explicit consent ({{LAW:deletion-is-deliberate}}) before
90
- appending it. For a promotion, after the rule lands, archive the source memory into
90
+ appending it to `user-rules.md` (retired rules live in `user-rules-retired.md`, which is
91
+ never loaded — never write a rule there). For a promotion, after the rule lands, archive the source memory into
91
92
  `archive/` (with the same consent) so the lesson is not loaded twice.
92
93
  8. **Keep the set lean.** After writing, if the file holds more than ~15 rules or
93
94
  any rule no longer changes behaviour, say so and propose merges or prunes — every
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,E as s,F as c,J as l,M as u,N as d,O as ee,T as f,U as te,at as p,ft as m,j as h,k as g,q as ne,u as _,ut as v,w as y}from"./index-UNxZecs3.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{t as re}from"./usePoll-bDFN-Hr6.js";var x=e(t(),1),S=n(),C=e=>e.catch(()=>null);function w({s:e}){let t=(0,x.useId)(),n=e.todos,r=g(e);return(0,S.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,S.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,S.jsx)(p,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,S.jsx)(`div`,{className:`act-foot`,children:(0,S.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,S.jsx)(f,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,S.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,v(e.updated_at),` ago`]})]})}var T={blocked:`is blocked`,"waiting-input":`waits for your answer`};function E(e,t){if(!Array.isArray(t))return``;let n=t.filter(a),r=e.current;return e.current=new Set(n.map(e=>`${e.session_id}:${e.status}`)),r?n.filter(e=>!r.has(`${e.session_id}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${T[e.status]}`).join(`. `):``}var D=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function O(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:D.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function k(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function A({enabled:e,onToggle:t}){return(0,S.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,S.jsx)(p,{name:`activity`,className:`glyph act-fixed`}),(0,S.jsxs)(`div`,{className:`act-grow`,children:[(0,S.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,S.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,S.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,S.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,S.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function j({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=h(e?.jobs,{days:14,cap:n}),i=d(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${u(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${u(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,S.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,S.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,S.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,S.jsx)(`i`,{className:`zero`},e.key))}),(0,S.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,S.jsx)(`span`,{children:u(r[0].key)}),(0,S.jsx)(`span`,{children:u(r[7].key)}),(0,S.jsx)(`span`,{children:`today`})]}),c&&(0,S.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function M({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,S.jsxs)(`div`,{className:`act-stat-head`,children:[(0,S.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,S.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,S.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,S.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,S.jsxs)(`li`,{children:[(0,S.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,S.jsx)(y,{vals:e.per_day,i:t,sweep:!0}),(0,S.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,S.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var N={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ie({job:e,longest:t}){let n=c(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=N[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,S.jsxs)(`li`,{className:`act-row`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,S.jsx)(p,{name:`play`,className:`glyph act-glyph`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,S.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,S.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,S.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,S.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function ae({gate:e}){return(0,S.jsxs)(`li`,{className:`act-row gate`,children:[(0,S.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,S.jsx)(p,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,S.jsxs)(`span`,{className:`act-what`,children:[(0,S.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,S.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,S.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,S.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var P=5,F=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function I(){let[e,t]=(0,x.useState)(null),[n,o]=(0,x.useState)(``),[c,u]=(0,x.useState)(O),[f,p]=(0,x.useState)(!1),[h,g]=(0,x.useState)(``),v=(0,x.useRef)(null),y=e=>{let t={...c,...e};u(t),k(t)};re(e=>r.activity().then(n=>{if(e()){t(n),o(``);let e=E(v,n?.activity);e&&g(t=>t===e?e+`\xA0`:e)}},t=>{e()&&o(t.message)}),2e3,[]);let T=m(()=>C(r.jobs()),[]),N=m(()=>C(r.gates()),[]),I=m(()=>C(r.catalog(`laws`)),[]),L=!e||e.enabled!==!1,R=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),z=i(),B=L&&e?R.filter(a).length:null,V=new Set(R.map(e=>e.session_id)),H=(e?.ended||[]).filter(e=>!V.has(e.session_id)),U=F([...R,...H].map(e=>e.host),c.host),W=F([...R,...H].map(e=>s(e.cwd)),c.project),G=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,K=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),q=R.filter(e=>K(e)&&(c.f!==`needs`||a(e))),oe=c.f===`all`||c.f===`needs`,J=c.f===`all`&&L?H.filter(K):[],se=f?J:J.slice(0,P),ce=!G&&(c.f===`all`||c.f===`runs`),le=!G&&(c.f===`all`||c.f===`gates`),Y=T.data?.jobs||[],X=_(N.data,I.data),Z=ee(Y,X,N.data?.days).map(e=>({...e,runs:ce?e.runs:[],gate:le?e.gate:null})).filter(e=>e.runs.length||e.gate),ue=Math.max(0,...Y.map(e=>e.duration||0)),Q=d(Z.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),de=async()=>{let e=!L;try{let n=await r.activityToggle(e);if(n.ok===!1){o(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),o(``)}catch(e){o(e.message)}},$=(e,t,n)=>(0,S.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,S.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,S.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:c[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>y({[e]:t.target.value}),children:[(0,S.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,S.jsx)(`option`,{value:e,children:e},e))]})]});return(0,S.jsxs)(`div`,{className:`narrow`,children:[(0,S.jsx)(te,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,S.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:h}),n&&(0,S.jsx)(`div`,{className:`act-gap`,children:(0,S.jsx)(ne,{error:n})}),e&&(0,S.jsx)(A,{enabled:L,onToggle:de}),(0,S.jsxs)(`div`,{className:`act-today`,children:[(0,S.jsx)(j,{jobs:T.data,loading:T.loading}),(0,S.jsx)(M,{rows:X,gates:N.data,loading:N.loading}),(0,S.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,S.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,S.jsxs)(`span`,{className:`act-big act-wait`,children:[B??`—`,` `,(0,S.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,S.jsx)(`p`,{className:`dim act-sm`,children:L?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]})]}),(0,S.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,S.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:D.map(([e,t])=>(0,S.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&B>0?(0,S.jsxs)(`span`,{className:`mono`,children:[` `,B]}):null]},e))}),$(`host`,`Host`,U),$(`project`,`Project`,W)]}),G&&c.f!==`needs`&&(0,S.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,G,`; showing sessions only.`]}),oe&&(e?!L&&c.f!==`needs`?null:q.length===0?c.f===`needs`?(0,S.jsx)(b,{title:`Nothing waits on you`}):(0,S.jsxs)(b,{title:`No active sessions`,children:[`Run `,(0,S.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,S.jsx)(`div`,{className:`stack gap-12 act-live`,ref:z,children:q.map(e=>(0,S.jsx)(`div`,{"data-flip":e.session_id,children:(0,S.jsx)(w,{s:e})},e.session_id))}):(0,S.jsx)(l,{label:`Reading live sessions…`})),J.length>0&&(0,S.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,S.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),se.map(e=>(0,S.jsx)(`div`,{children:(0,S.jsx)(w,{s:e})},e.session_id)),J.length>P&&(0,S.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":f,onClick:()=>p(e=>!e),children:f?`Show fewer`:`Show all ${J.length}`})]}),c.f!==`needs`&&(0,S.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Q,children:Z.map(e=>(0,S.jsxs)(`section`,{className:`card act-day`,children:[(0,S.jsxs)(`h3`,{className:`act-day-h`,children:[(0,S.jsx)(`span`,{children:e.title}),(0,S.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,S.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,S.jsx)(ie,{job:e,longest:ue},e.id)),e.gate&&(0,S.jsx)(ae,{gate:e.gate})]})]},e.key))})]})}export{I as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{C as i,D as a,E as o,J as s,U as c,at as l,q as u,ut as d}from"./index-D2VlAlpK.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{t as p}from"./usePoll-bDFN-Hr6.js";var m=e(t(),1),h=n();function g(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function _({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${a(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,h.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,h.jsx)(`span`,{className:`feed-dot act-inline-dot ${g(e)||`acc`}`}),e.kind===`thinking`&&(0,h.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,h.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,h.jsx)(`b`,{children:i}),e.error&&(0,h.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,h.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,h.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${d(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function v({turns:e}){return!e||e.length===0?(0,h.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,h.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,h.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}function y({sid:e}){let[t,n]=(0,m.useState)(null),[a,g]=(0,m.useState)(``),[y,b]=(0,m.useState)(!1),[x,S]=(0,m.useState)(!1),C=(0,m.useId)();p(t=>y?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),g(``),b(!1))},e=>{t()&&(e.status===404?b(!0):g(e.message))}),2e3,[e,y]);let w=(0,h.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,h.jsx)(l,{name:`arrow`}),` Activity`]});if(y)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(f,{title:`Session ended`,action:(0,h.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,a?(0,h.jsx)(u,{error:a}):(0,h.jsx)(s,{label:`Loading session…`})]});let T=t.session,E=T.files,D=T.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(c,{title:T.title||o(T.cwd)||T.session_id,sub:T.cwd?(0,h.jsx)(`span`,{className:`mono act-cwd`,title:T.cwd,children:T.cwd}):null}),a&&(0,h.jsx)(`div`,{className:`act-gap`,children:(0,h.jsx)(u,{error:a})}),(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(i,{s:T}),(0,h.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,d(T.updated_at),` ago`]})]}),(O||k)&&(0,h.jsxs)(`div`,{className:`grid gap-12 act-panels${O&&k?` two`:``}`,children:[O&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Files touched `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,h.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,h.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,h.jsxs)(`span`,{className:`act-fixed`,children:[(0,h.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Plan`,` `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:D.items.map((e,t)=>(0,h.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,h.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,h.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,h.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,h.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,h.jsx)(`h2`,{children:`Timeline`}),j.length>0&&(0,h.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":x,"aria-controls":C,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show full stream (${M.length})`})]}),(0,h.jsx)(`div`,{id:C,children:x?(0,h.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,h.jsx)(_,{rec:e},t))}):(0,h.jsx)(v,{turns:A})})]})]})}export{y as default};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{C as i,D as a,E as o,J as s,U as c,at as l,q as u,ut as d}from"./index-UNxZecs3.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{t as p}from"./usePoll-bDFN-Hr6.js";var m=e(t(),1),h=n();function g(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function _({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${a(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,h.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,h.jsx)(`span`,{className:`feed-dot act-inline-dot ${g(e)||`acc`}`}),e.kind===`thinking`&&(0,h.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,h.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,h.jsx)(`b`,{children:i}),e.error&&(0,h.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,h.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,h.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${d(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function v({turns:e}){return!e||e.length===0?(0,h.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,h.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,h.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}function y({sid:e}){let[t,n]=(0,m.useState)(null),[a,g]=(0,m.useState)(``),[y,b]=(0,m.useState)(!1),[x,S]=(0,m.useState)(!1),C=(0,m.useId)();p(t=>y?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),g(``),b(!1))},e=>{t()&&(e.status===404?b(!0):g(e.message))}),2e3,[e,y]);let w=(0,h.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,h.jsx)(l,{name:`arrow`}),` Activity`]});if(y)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(f,{title:`Session ended`,action:(0,h.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,a?(0,h.jsx)(u,{error:a}):(0,h.jsx)(s,{label:`Loading session…`})]});let T=t.session,E=T.files,D=T.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(c,{title:T.title||o(T.cwd)||T.session_id,sub:T.cwd?(0,h.jsx)(`span`,{className:`mono act-cwd`,title:T.cwd,children:T.cwd}):null}),a&&(0,h.jsx)(`div`,{className:`act-gap`,children:(0,h.jsx)(u,{error:a})}),(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(i,{s:T}),(0,h.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,d(T.updated_at),` ago`]})]}),(O||k)&&(0,h.jsxs)(`div`,{className:`grid gap-12 act-panels${O&&k?` two`:``}`,children:[O&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Files touched `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,h.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,h.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,h.jsxs)(`span`,{className:`act-fixed`,children:[(0,h.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Plan`,` `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:D.items.map((e,t)=>(0,h.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,h.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,h.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,h.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,h.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,h.jsx)(`h2`,{children:`Timeline`}),j.length>0&&(0,h.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":x,"aria-controls":C,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show full stream (${M.length})`})]}),(0,h.jsx)(`div`,{id:C,children:x?(0,h.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,h.jsx)(_,{rec:e},t))}):(0,h.jsx)(v,{turns:A})})]})]})}export{y as default};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{at as r}from"./index-UNxZecs3.js";var i=e(t(),1),a=n(),o=1200;function s({text:e,label:t,title:n,className:s=`btn ghost sm`}){let[c,l]=(0,i.useState)(null),u=(0,i.useRef)(null),d=(0,i.useRef)(!1);(0,i.useEffect)(()=>(d.current=!1,()=>{d.current=!0,clearTimeout(u.current)}),[]);let f=e=>{d.current||(l(e),clearTimeout(u.current),u.current=setTimeout(()=>l(null),o))};return(0,a.jsxs)(`button`,{type:`button`,className:s,onClick:async()=>{try{await navigator.clipboard.writeText(e),f(`ok`)}catch{f(`fail`)}},"aria-label":t,title:n,children:[(0,a.jsx)(r,{name:c===`ok`?`check`:c===`fail`?`x`:`copy`}),c===`ok`?`Copied`:c===`fail`?`Copy failed`:`Copy`]})}export{s as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-BBCsUAcJ.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-UNxZecs3.js","assets/api-BfpZmUMI.js","assets/index-IuDNqPEl.css","assets/OperatorHudView-BxKeM_Lk.js","assets/JournalView-CLf3j4Ar.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{F as l,H as u,I as d,J as f,K as p,X as m,at as h,ct as g,ft as _,l as v,lt as y,q as b,st as x,t as S,ut as C,yt as w,z as T}from"./index-UNxZecs3.js";var E=t(n(),1),D={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},O=(e,t)=>e.deployed?t===void 0||t===`good`?D[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,k=r(),A={done:`ok`,failed:`bad`},ee={done:(0,k.jsx)(`path`,{d:`M5 12l5 5L20 7`}),failed:(0,k.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})},j=e=>typeof e==`number`&&Number.isFinite(e);function M(e){let t=[];for(let n of e){let e=l(n),r=`${e.verb}\u0000${e.scope}\u0000${n.status}`,i=t[t.length-1];if(i&&i.key===r){i.jobs.push(n),i.durations.push(j(n.duration)?n.duration:null),n.started&&(i.oldest=n.started);continue}t.push({key:r,id:n.id,verb:e.verb,scope:e.scope,status:n.status,jobs:[n],command:e.command,newest:n.started||null,oldest:n.started||null,durations:[j(n.duration)?n.duration:null]})}return t}function N(e){if(!e.newest)return`—`;let t=C(e.newest),n=e.oldest?C(e.oldest):t;return n===t?`${t} ago`:`${n} – ${t} ago`}function P({jobs:e,max:t,empty:n}){if(!e||e.length===0)return n??null;let r=d(e,t),i=Math.max(0,...r.map(e=>j(e.duration)?e.duration:0))||1,a=M(r),o=Math.max(...a.map(e=>e.jobs.length));return(0,k.jsx)(`ul`,{className:`run-chips`,children:a.map(e=>{let t=e.durations.filter(j),n=e.jobs.length,r=e.status||`running`;return(0,k.jsxs)(`li`,{className:`run-chip ${A[e.status]||`acc`}`,title:e.command||void 0,children:[(0,k.jsx)(`svg`,{className:`run-chip-icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:ee[e.status]||(0,k.jsx)(`circle`,{cx:`12`,cy:`12`,r:`4`,fill:`currentColor`,stroke:`none`})}),(0,k.jsx)(`span`,{className:`sr-only`,children:r}),(0,k.jsxs)(`span`,{className:`run-chip-main`,children:[(0,k.jsxs)(`span`,{className:`run-chip-head`,children:[(0,k.jsx)(`b`,{children:e.verb}),n>1&&(0,k.jsxs)(`span`,{className:`run-chip-times`,children:[`×`,n]})]}),(0,k.jsx)(`span`,{className:`run-chip-sub`,children:[e.scope,N(e)].filter(Boolean).join(` · `)})]}),t.length?(0,k.jsx)(`span`,{className:`run-chip-bars`,role:`img`,"aria-label":`Durations: ${t.join(`, `)} seconds`,children:t.map((e,t)=>(0,k.jsx)(`i`,{style:{width:`${e/i/o*100}%`}},t))}):(0,k.jsx)(`span`,{className:`run-chip-bars`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{className:`run-chip-dur`,children:t.length?n>1?`≤ ${Math.max(...t)} s`:`${t[0]} s`:`—`})]},e.id)})})}var F={good:`ok`,warn:`warn`,bad:`bad`};function I({verdict:e}){return e?(0,k.jsxs)(`span`,{className:`badge ${F[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,k.jsx)(`span`,{className:`dot`}),e.head]}):null}function L({overview:e,dataRev:t}){let{data:n}=_(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=x(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,k.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,k.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,k.jsx)(o,{value:t})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,k.jsx)(`div`,{className:`kseg-spacer`}),(0,k.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>w(`#/diff`),title:`Open changes`,children:[(0,k.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,k.jsx)(o,{value:r})}),(0,k.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,k.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function R({overview:e}){return(0,k.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,k.jsxs)(`a`,{className:`card gcell rise`,style:{"--i":n},href:`#/section/`+t,children:[(0,k.jsxs)(`div`,{className:`gtop`,children:[(0,k.jsx)(`span`,{className:`gname`,children:r.label}),(0,k.jsx)(h,{name:r.icon,className:`gicon`})]}),(0,k.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,k.jsx)(o,{value:i})}),(0,k.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function z({jobs:e}){if(!e||e.length===0)return(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=d(e,8);return(0,k.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,k.jsxs)(`div`,{className:`feed-row`,children:[(0,k.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,k.jsx)(`span`,{className:`feed-txt`,children:(0,k.jsx)(`b`,{children:e.action})}),(0,k.jsxs)(`span`,{className:`feed-when`,children:[C(e.started),` ago`]})]},e.id))})}function B({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,k.jsxs)(`div`,{className:`ring-box`,children:[(0,k.jsx)(T,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,k.jsxs)(`div`,{className:`ring-center`,children:[(0,k.jsxs)(`div`,{className:`pct`,children:[n,(0,k.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,k.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function V({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=O(e,i?.tone),s=y(e,n,i?.tone);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,k.jsxs)(`div`,{className:`hero`,children:[(0,k.jsx)(B,{value:s}),(0,k.jsxs)(`div`,{className:`hero-facts`,children:[(0,k.jsx)(`div`,{className:`ttl`,children:o}),(0,k.jsx)(I,{verdict:i?.verdict}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,k.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,k.jsxs)(`div`,{className:`hero-chips`,children:[(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`voice`}),(0,k.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`mode`}),(0,k.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,k.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`built`}),(0,k.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,k.jsxs)(`span`,{className:`chip`,children:[(0,k.jsx)(`span`,{className:`ck`,children:`fp`}),(0,k.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,k.jsx)(L,{overview:e,dataRev:a}),(0,k.jsxs)(`div`,{className:`grid split-status`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Capability genome`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,k.jsx)(R,{overview:e})]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Recent activity`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`badge acc`,children:[(0,k.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,k.jsx)(z,{jobs:r})]})]})]})}function H({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,k.jsxs)(`div`,{className:`strand`,children:[(0,k.jsxs)(`span`,{className:`strand-name`,children:[(0,k.jsx)(`span`,{className:`strand-dot`}),(0,k.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,k.jsx)(`span`,{className:`strand-val`,children:i})]})}function U(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function W({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=g(e.counts),o=n?.version_verdict||``,s=U(o),l=x(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-16`,children:(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,k.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,k.jsxs)(`div`,{className:`lineage-track`,children:[(0,k.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,k.jsxs)(`div`,{className:`lineage-step`,children:[(0,k.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,k.jsx)(`div`,{className:`lt`,children:e}),(0,k.jsx)(`div`,{className:`ld`,children:t}),(0,k.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,k.jsx)(`hr`,{className:`hr`}),t&&(0,k.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,k.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,k.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,k.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,k.jsx)(I,{verdict:i?.verdict}),s&&(0,k.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,k.jsx)(`span`,{className:`dot`}),s.label]}),(0,k.jsxs)(`span`,{className:`badge`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,k.jsxs)(`div`,{className:`grid split-even`,children:[(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsxs)(`div`,{className:`card-head`,children:[(0,k.jsx)(`h3`,{children:`Genome strand`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,k.jsx)(H,{k:t,overview:e,max:a},t))]}),(0,k.jsxs)(`div`,{className:`card pad-lg`,children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Recent activity`})}),(0,k.jsx)(z,{jobs:r})]})]})]})}function G({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=g(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=x(e.diff);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,k.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,k.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`status`}),(0,k.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,k.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,k.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,k.jsx)(I,{verdict:r?.verdict})]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`voice`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`mode`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,k.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent-text)`},children:t?.installed_fp||`—`})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,k.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,k.jsxs)(`span`,{className:`badge ok`,children:[(0,k.jsx)(`span`,{className:`dot`}),`clean`]}):(0,k.jsxs)(`span`,{className:`badge warn`,children:[(0,k.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`tick`,children:`edits`}),(0,k.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,k.jsxs)(`div`,{className:`grid split-operator`,children:[(0,k.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,k.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,k.jsx)(`h3`,{children:`Sections`}),(0,k.jsx)(`div`,{className:`right`,children:(0,k.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,k.jsxs)(`table`,{className:`tbl`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`th`,{children:`Section`}),(0,k.jsx)(`th`,{children:`Detail`}),(0,k.jsx)(`th`,{style:{width:130},children:`Share`}),(0,k.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,k.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,k.jsxs)(`tr`,{className:`clickable`,children:[(0,k.jsx)(`td`,{className:`name`,children:(0,k.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,k.jsx)(`td`,{className:`muted`,children:n.desc}),(0,k.jsx)(`td`,{children:(0,k.jsx)(`div`,{className:`hbar`,children:(0,k.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,k.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,k.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,k.jsx)(`div`,{className:`card-head`,children:(0,k.jsx)(`h3`,{children:`Run log`})}),(0,k.jsx)(P,{jobs:n,max:8,empty:(0,k.jsx)(`div`,{className:`feed`,children:(0,k.jsxs)(`div`,{className:`empty`,children:[(0,k.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})})})]})]})]})}var K=Symbol(`failed`),q=e=>Promise.resolve().then(e).catch(()=>K);function J({dataRev:e,needDoctor:t}){let n=_(()=>q(()=>i.fleet()),[e]),r=_(()=>t?q(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===K?`failed`:`ok`,s=o===`ok`?a:null,c=s?v(s):null,l=r.data,u=t?l==null?`loading`:l===K?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var Y=e({default:()=>$}),X=(0,E.lazy)(()=>S(()=>import(`./GreenhouseView-BBCsUAcJ.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>S(()=>import(`./OperatorHudView-BxKeM_Lk.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>S(()=>import(`./JournalView-CLf3j4Ar.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function $({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:l}){let d=c,[h,g]=(0,E.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:d===`greenhouse`||d===`operator`}),{data:x}=_(()=>d===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[d,l]);if(!e)return t?(0,k.jsx)(b,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(f,{});let S=e.daemon_stale?(0,k.jsx)(p,{}):null;return e.deployed?h===`status`&&d===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:[S,(0,k.jsx)(Q,{overview:e,recent:x,lens:y,onDirection:g,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[S,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(m,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>g(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&d===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:v,setup:a,jobs:o,lens:y,dataRev:l}),h===`status`&&d===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:(0,k.jsx)(X,{overview:e,sigil:v,jobs:o,lens:y,onAction:s})}),h===`status`&&d===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(f,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),h===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:v,setup:a,jobs:o,lens:y}),h===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},h)]}):(0,k.jsxs)(k.Fragment,{children:[S,(0,k.jsx)(u,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};
@@ -0,0 +1,5 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,r as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{n as a}from"./motion-CXaUMNkg.js";import{$ as o,J as s,Q as c,U as l,X as u,a as d,at as f,c as p,et as m,ft as h,i as ee,n as g,o as _,q as v,r as te,s as ne,yt as y}from"./index-UNxZecs3.js";import{t as b}from"./EmptyState-1sPNleqv.js";import{a as re,n as x,o as S,r as C,t as ie}from"./RailCats-BuJD4Jou.js";import{t as w}from"./CopyButton-BnPdDHls.js";import{i as T,n as E,r as D}from"./Markdown-DpmmtW2Y.js";var O=e(t(),1),k=n();function A(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function j(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
2
+ `))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
3
+ `),n.join(`
4
+ `)]}function M(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||A(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function N(e){let t={ids:new Set,idx:0,toc:[]},n=n=>M(E(n,e?.links),t);if(e?.rows){let[r,i]=j(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var P=r(),F={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},I=`you already know this`,L=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function R(e){return e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}e.replaceWith(t),t.append(n,e)}),[...e.querySelectorAll(`figure.docs-code > figcaption`)]}var z=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),B=40,V=e=>{let t=e.split(`
5
+ `)[0].trim();return t?`Copy `+(t.length>B?t.slice(0,39)+`…`:t):`Copy code`};function H({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,O.useRef)(null),[o,s]=(0,O.useState)([]),c=(0,O.useMemo)(()=>N({body:e.body,links:e.links}).html,[e.body,e.links]);(0,O.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(I)&&e.classList.add(`analogy`)}),s(R(e)))},[c]),(0,O.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),y(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[c]),(0,O.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=F[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>A(e.textContent||``)===A(i))),o?.classList.add(`docs-here`)},[c,e.id,t?.emit]);let u=[];return e.id===`install`&&(u.push({label:`Run doctor`,action:`doctor`}),u.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&u.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&u.push({label:`Update`,action:`update`}),(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{eyebrow:r&&`${r} · ${L(e.body)} min read`,title:e.title,sub:i,actions:u.length>0&&u.map(e=>e.hash?(0,P.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,P.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,P.jsx)(`div`,{className:`doc-meta`,children:(0,P.jsxs)(`span`,{className:`badge`,children:[(0,P.jsx)(`span`,{className:`dot`}),e.source]})}),(0,P.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:c}}),o.map((e,t)=>{let n=z(e);return(0,k.createPortal)((0,P.jsx)(w,{text:n,label:V(n)}),e,t)}),e.link&&(0,P.jsx)(`div`,{className:`doc-link`,children:(0,P.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var U=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function W({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,P.jsxs)(`div`,{className:`cli-arg`,children:[(0,P.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,P.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,P.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function G({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,P.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,P.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,P.jsxs)(`div`,{className:`stack gap-4`,children:[(0,P.jsx)(`h2`,{id:U(e.name),children:(0,P.jsx)(`code`,{children:e.name})}),e.help&&(0,P.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,P.jsx)(w,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,P.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,P.jsxs)(`div`,{className:`cli-block`,children:[(0,P.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,P.jsx)(W,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,P.jsxs)(`div`,{className:`cli-block`,children:[(0,P.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,P.jsx)(W,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function K({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{title:e.title,sub:(0,P.jsxs)(P.Fragment,{children:[`Every subcommand of `,(0,P.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,P.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,P.jsx)(`div`,{children:n.map(e=>(0,P.jsx)(G,{cmd:e,prog:t},e.name))})]})}function q({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{title:e.title,sub:(0,P.jsxs)(P.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,P.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,P.jsx)(`div`,{className:`card pad-md`,children:(0,P.jsxs)(`table`,{className:`glossary-table`,children:[(0,P.jsx)(`thead`,{children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{children:`Concept`}),(0,P.jsx)(`th`,{children:`Neutral term`}),(0,P.jsxs)(`th`,{children:[`In `,n]}),(0,P.jsx)(`th`,{children:`Meaning`}),(0,P.jsx)(`th`,{children:`In dev terms`})]})}),(0,P.jsx)(`tbody`,{children:t.map(e=>(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`td`,{children:(0,P.jsx)(`strong`,{children:e.label})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`code`,{children:e.neutral||`—`})}),(0,P.jsx)(`td`,{children:(0,P.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,P.jsx)(`td`,{className:`dim`,children:e.desc}),(0,P.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var J={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},Y=({text:e})=>(0,P.jsx)(`span`,{dangerouslySetInnerHTML:{__html:D(T.parseInline(e||``))}}),X=({kind:e})=>(0,P.jsx)(`span`,{className:`tag ${J[e]||``}`,children:e});function ae({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,O.useState)(0),{before:s,after:c}=(0,O.useMemo)(()=>N(e),[e]);if(!e.rows)return(0,P.jsx)(H,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{eyebrow:r&&`${r} · ${L(e.body)} min read`,title:e.title,sub:i}),(0,P.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,P.jsxs)(`div`,{className:`docs-map`,children:[(0,P.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,P.jsx)(`li`,{children:(0,P.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,P.jsx)(`span`,{className:`map-piece`,children:(0,P.jsx)(Y,{text:e.piece})}),(0,P.jsx)(X,{kind:e.kind}),(0,P.jsx)(`span`,{className:`mono dim map-cost`,children:(0,P.jsx)(Y,{text:e.cost})})]})},t))}),u&&(0,P.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,P.jsx)(`h2`,{children:(0,P.jsx)(Y,{text:u.piece})}),(0,P.jsx)(X,{kind:u.kind}),(0,P.jsxs)(`dl`,{children:[(0,P.jsx)(`dt`,{children:`Does`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(Y,{text:u.does})}),(0,P.jsx)(`dt`,{children:`Costs`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(Y,{text:u.cost})}),(0,P.jsx)(`dt`,{children:`Turn it off`}),(0,P.jsx)(`dd`,{children:(0,P.jsx)(Y,{text:u.off})})]})]})]}),c.trim()&&(0,P.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}})]})}function oe(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function se(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var Z=e=>(0,O.useSyncExternalStore)(se,e,()=>null),ce=5,le=96,ue=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function de(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${ue(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ce)break;return r}var fe=e=>{let t=document.getElementById(e);t&&(t.setAttribute(`tabindex`,`-1`),t.scrollIntoView({behavior:a()?`smooth`:`auto`}),t.focus({preventScroll:!0}))};function pe({page:e,glossaryRows:t}){let n=e?.body,r=(0,O.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:U(e.name),title:e.name,level:2})):N(e).toc,[e]),i=(0,O.useMemo)(()=>de(n,t),[n,t]),a=Z(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=le&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,P.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,P.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,P.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,P.jsx)(`ul`,{children:r.map(e=>(0,P.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,P.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),fe(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,P.jsxs)(`div`,{className:`docs-gloss`,children:[(0,P.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,P.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,P.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,P.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function me({page:e,overview:t}){let n=e.version||{},r=[...t?[[`Version`,t.version]]:[],[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,P.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,P.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,P.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,P.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,P.jsx)(`span`,{dangerouslySetInnerHTML:{__html:D(T.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,P.jsxs)(`div`,{className:`detail-doc`,children:[(0,P.jsx)(l,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,P.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,P.jsxs)(`div`,{className:`kv`,children:[(0,P.jsx)(`span`,{className:`k`,children:e}),(0,P.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,P.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,P.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(f,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(f,{name:`external`}),`File an issue`]}),(0,P.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,P.jsx)(f,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function he({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,P.jsx)(v,{error:t,style:{margin:18}});if(!e)return(0,P.jsx)(s,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,P.jsx)(H,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,P.jsx)(ae,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,P.jsx)(K,{page:e});case`glossary`:return(0,P.jsx)(q,{page:e});case`about`:return(0,P.jsx)(me,{page:e,overview:n});default:return(0,P.jsx)(b,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=oe(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=Z(ge);return(0,P.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,P.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ve({page:e,overview:t,onAction:n}){let[r,a]=m(o(t?.emit)),{data:l,error:f}=h(()=>i.docs(r),[r]),y=e||Q(l),{data:b,error:w,loading:T}=h(()=>y?i.docsPage(y,r):Promise.resolve(null),[y,r]),{data:E}=h(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,O.useEffect)(()=>{if(l&&y&&!l.groups.some(e=>e.pages.some(e=>e.id===y))){let e=Q(l);e&&e!==y&&window.location.replace(d(e))}},[l,y]),(0,O.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[y]);let D=ne(l,y),k=D.part||l?.groups?.[0]||null,A=k?.id===te;(0,O.useEffect)(()=>{A&&b?.id===y&&_(y)},[A,b,y]);let j=A?[...p(),y]:[],[M,N]=(0,O.useState)(``),[F,I]=(0,O.useState)(`all`),[L,R]=(0,O.useState)(k?.id);k?.id!==L&&(R(k?.id),N(``),I(`all`));let z=$(k),B=x(z),V=F===`all`?z:z.filter(e=>e.group===F),H=S(V,M);return f?(0,P.jsx)(v,{error:f}):(0,P.jsx)(`div`,{className:`docs-wrap`,children:(0,P.jsxs)(`div`,{className:`library docs-lib`,children:[(0,P.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,P.jsxs)(`div`,{className:`lib-title`,children:[(0,P.jsx)(`p`,{className:`h`,children:`Docs`}),(0,P.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,P.jsx)(u,{"aria-label":`Harness`,children:c.map(e=>(0,P.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,P.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(l?.groups||[]).map(e=>(0,P.jsxs)(O.Fragment,{children:[(0,P.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:k?.id===e.id?`on`:``,"aria-current":k?.id===e.id?`page`:void 0,children:[e.label,(0,P.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),k?.id===e.id&&(0,P.jsx)(ie,{label:`Sections`,total:z.length,cats:B,cat:F,onChange:I})]},e.id))})]}),(0,P.jsx)(re,{label:k?.label||`Docs`,count:M.trim()?`${H.length} of ${V.length}`:V.length||``,extra:A&&(0,P.jsx)(ee,{pages:k.pages,seen:j}),q:M,onQ:N,matched:H.length,inView:[k?.id,y],children:l?(0,P.jsx)(C,{rows:H,activeName:y,hrefOf:e=>d(e.name),pills:A?e=>j.includes(e.name)&&e.name!==y?(0,P.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,P.jsx)(s,{label:`Loading docs…`})}),(0,P.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":D.page?.title||`Page`,children:[(0,P.jsx)(_e,{}),D.page&&(0,P.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,P.jsx)(`a`,{href:d(D.part.pages[0].id),children:D.part.label}),(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,P.jsx)(`a`,{href:d(D.part.pages.find(e=>(e.section||`General`)===D.section).id),children:D.section}),(0,P.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,P.jsx)(`span`,{"aria-current":`page`,children:D.page.title})]}),(0,P.jsxs)(`div`,{className:`docs-read`,children:[(0,P.jsxs)(`div`,{className:`docs-article`,children:[(0,P.jsx)(he,{data:T?null:b,error:w,overview:t,onAction:n,place:D},`${y}|${r}`),!T&&(0,P.jsx)(g,{menu:l,pageId:y})]}),!T&&(0,P.jsx)(pe,{page:b,glossaryRows:E?.rows})]})]})]})})}export{ve as default,$ as docRows};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{I as a,P as o,at as s,st as c,z as l}from"./index-UNxZecs3.js";import{i as u,n as d,r as f}from"./Dashboard-DtJ0xrcA.js";e();var p=t(),m=12,h=Array.from({length:7},(e,t)=>`var(--cat-${t})`),g=650;function _({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let a=e.reduce((e,t)=>e+t.n,0);return(0,p.jsxs)(`div`,{className:`ring-box`,children:[(0,p.jsx)(l,{segments:e,size:t,stroke:r,label:i,sweepMs:g}),(0,p.jsxs)(`div`,{className:`ring-center`,children:[(0,p.jsx)(`div`,{className:`donut-c-num`,children:(0,p.jsx)(n,{value:a,duration:g})}),(0,p.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function v(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function y({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=v(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,p.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,p.jsx)(`defs`,{children:(0,p.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,p.jsx)(`stop`,{offset:`0`,style:{stopColor:n},stopOpacity:`.28`}),(0,p.jsx)(`stop`,{offset:`1`,style:{stopColor:n},stopOpacity:`0`})]})}),(0,p.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,p.jsx)(`path`,{d:s,fill:`none`,style:{stroke:n},strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,p.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,style:{fill:n},vectorEffect:`non-scaling-stroke`})]})}function b({label:e,value:t,sub:n,color:r,icon:i}){return(0,p.jsxs)(`div`,{className:`b-tile`,children:[(0,p.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,p.jsx)(s,{name:i})}),(0,p.jsxs)(`div`,{className:`b-tile-body`,children:[(0,p.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,p.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,p.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function x({overview:e,sigil:t,jobs:l,lens:g,onAction:v}){let x=e.counts||{},S=g?.doctor?.state||`loading`,C=g?.doctor?.data?.groups||[],w=S===`ok`,T=C.filter(e=>e.problems.length===0).length,E=C.length,D=u(e,g?.tone),O=a(l,m),k=c(e.diff),A=i.filter(e=>(x[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:x[e]||0,tone:`cat`+t%h.length,color:h[t%h.length]})),j=A.reduce((e,t)=>e+t.n,0),M=o(l||[],10),N=M.reduce((e,t)=>e+t.v,0);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`b-greet`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,p.jsx)(`h2`,{className:`h b-h`,children:D}),(0,p.jsx)(d,{verdict:g?.verdict}),(0,p.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,p.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,p.jsxs)(`div`,{className:`card b-hero`,children:[(0,p.jsx)(`div`,{className:`b-hero-ring`,children:(0,p.jsx)(_,{segments:[{key:`pass`,label:`pass`,n:T,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(E-T,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,p.jsxs)(`div`,{className:`b-hero-side`,children:[(0,p.jsx)(`h3`,{className:`b-hero-title`,children:w?`${T} of ${E} checks pass`:S===`failed`?`Doctor did not answer`:`Checking…`}),S===`failed`&&(0,p.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>v(`doctor`),children:[(0,p.jsx)(s,{name:`doctor`}),`Run doctor`]}),(0,p.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,p.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),w&&(0,p.jsx)(`ul`,{className:`b-hero-checks`,children:C.map(e=>{let t=e.problems.length===0;return(0,p.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,p.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,p.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,p.jsxs)(`div`,{className:`b-chips`,children:[(0,p.jsxs)(`span`,{className:`b-chip`,children:[(0,p.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,p.jsx)(`span`,{className:`b-chip`,children:(0,p.jsx)(`b`,{children:e.emit})}),(0,p.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,p.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,p.jsxs)(`div`,{className:`b-tiles`,children:[(0,p.jsx)(b,{label:`Agents`,value:x.agents??`—`,sub:`specialists`,color:h[0],icon:`layers`}),(0,p.jsx)(b,{label:`Skills`,value:x.skills??`—`,sub:`workflows`,color:h[1],icon:`skill`}),(0,p.jsx)(b,{label:`Dictates`,value:x.laws??`—`,sub:x.doctrines?`${x.doctrines.active}/${x.doctrines.total} packs · ${x.doctrines.rules} rules`:`all upheld`,color:h[2],icon:`law`}),(0,p.jsx)(b,{label:`Edits`,value:k,sub:`to graft`,color:h[3],icon:`changes`})]})]}),(0,p.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,p.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Capability mix`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[j,` total`]})})]}),(0,p.jsxs)(`div`,{className:`b-mix`,children:[(0,p.jsx)(_,{segments:A,size:186,stroke:26}),(0,p.jsx)(`div`,{className:`b-legend`,children:A.map(e=>(0,p.jsxs)(`div`,{className:`b-leg-row`,children:[(0,p.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,p.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,p.jsx)(`span`,{className:`b-leg-bar`,children:(0,p.jsx)(`i`,{style:{width:`${e.n/j*100}%`,background:e.color}})}),(0,p.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent runs`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`badge ok`,children:[(0,p.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,p.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,p.jsx)(`span`,{className:`b-stat-big`,children:(0,p.jsx)(n,{value:N})}),(0,p.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,w&&E>0&&` · ${T}/${E} checks pass now`]})]}),(0,p.jsx)(y,{data:M,accent:h[0],height:156})]})]}),(0,p.jsxs)(`div`,{className:`card pad-lg`,children:[(0,p.jsxs)(`div`,{className:`card-head`,children:[(0,p.jsx)(`h3`,{children:`Recent activity`}),(0,p.jsx)(`div`,{className:`right`,children:(0,p.jsxs)(`span`,{className:`tick`,children:[`last `,O.length,` runs`]})})]}),(0,p.jsx)(f,{jobs:l,max:m,empty:(0,p.jsx)(`p`,{className:`sub`,children:`No runs yet. Trigger an action to populate this.`})})]})]})}export{x as default};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,R as o,U as s,X as c,Y as l,Z as u,at as d,ft as f,gt as p,ht as m,it as h,mt as g,nt as _,ot as v,pt as y,q as b,rt as x,st as S,tt as C,ut as w,vt as T}from"./index-UNxZecs3.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-kIqas9Tj.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-BaDKgnO8.js";var F=e(t(),1),I=n();function ee({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:C.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function L(){let{data:e,error:t,reload:n}=f(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,I.jsx)(d,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function R({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var z={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function te({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${_(e.host).label} · ${e.scope}`,[h,g]=z[e.state]||z.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:x(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(R,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(L,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var B=(e,t)=>`${e} ${t}`,ne=[`claude`,`bob`,`openclaude`],V={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},H=/[\\/]\.claude[\\/]worktrees[\\/]/,U=e=>e.scope===`project`&&H.test(e.path);function re(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?S(e.drift):0;return i?`${r} · ${i} edited`:r}function W({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?S(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(o,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,I.jsx)(`span`,{className:`dim`,children:re(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=V[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,I.jsx)(`td`,{children:_(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(`span`,{className:`tag ${c}`,children:i}),U(e)?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`span`,{className:`tag warn`,title:`Inside a .claude/worktrees folder: likely a finished worktree. Remove it from its panel.`,children:`Worktree leftover`})]}):null]}),(0,I.jsx)(`td`,{children:(0,I.jsx)(W,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function G({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:c}){let l=u(),{data:p,error:m,reload:g}=f(()=>r.installs(),[s]),{data:v,error:y,reload:S}=f(()=>r.mcp(),[s]),{data:C,error:w}=f(()=>r.fleet(),[s]),T=w?null:C??void 0,[D,O]=(0,F.useState)(null),[k,A]=(0,F.useState)(``),[j,M]=(0,F.useState)({}),[P,L]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),V=e=>R.id===e?.id?R.value:`keep`,[H,U]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=B(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(m||y)return(0,I.jsx)(b,{error:m||y,onRetry:()=>{g(),S()}});if(!p||!v)return(0,I.jsx)(a,{});let W={active:0,disabled:1,absent:2},G=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(W[e.state]??3)-(W[t.state]??3)),K=G.find(e=>e.id===H)||G.find(e=>e.selected)||G.find(e=>e.state===`active`)||G[0],q=e=>{let t=j[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},se=(e,t,n)=>M(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),ce=e=>{let t=q(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},le=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=q(t),s=_(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await l(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},ue=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){A(e.id),O(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;O({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&ne.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},de=async e=>{let t=V(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${h(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){A(e.id),O(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){O({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&O({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),c?.()}catch(e){O({text:e.message,tone:`bad`})}finally{A(``)}}},fe=async e=>{O(null);try{let t=await r.mcpReveal(e.path);O({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){O({text:e.message,tone:`bad`})}},pe=async()=>{let t=G.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`);await l(`Rebuild every active install: ${t.join(`, `)||`none`}? Each is rebuilt in place from source with its own settings; files you edited are kept.`,{title:`Rebuild all active installs?`,confirmLabel:`Rebuild all`})&&e(`build-all`)},me=G.find(e=>e.selected)?.host||G.find(e=>e.state===`active`)?.host||G[0]?.host||`opencode`,X=G.filter(e=>e.scope===`global`),Z=G.filter(e=>e.scope!==`global`),Q=e=>{U(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}c?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[G.filter(e=>e.state===`active`).length,` active of `,G.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:pe,children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),D?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:D.text}):D?(0,I.jsx)(`p`,{className:`tag ${D.tone===`ok`?`ok `:``}note`,role:`status`,children:D.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:K?.id,onPick:Q,label:`Global installs`,fleet:T,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>L(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),P?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(ee,{host:me,theme:n||`neutral`,options:J,onAction:e,onClose:()=>L(!1),onNote:e=>O(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:K?.id,onPick:Q,label:`Per-project installs`,fleet:T,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:o,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),K?(0,I.jsx)(te,{inst:K,targets:re[B(K.host,K.path)]||[],choice:q(K),unchanged:ce(K),options:J,onPick:(e,t)=>se(K,e,t),canAct:!!e,busy:k===K.id,memory:V(K),onMemory:e=>z({id:K.id,value:e}),onApply:()=>le(K),onToggleInstall:()=>ue(K),onRemove:()=>de(K),onRevealMcp:fe},K.id):null]})}function K({onAction:e,dataRev:t}){let{data:n,error:i}=f(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(b,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[(n.skills||[]).length,` skills · `,(n.agents||[]).length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(a,{})}function q(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var se=300;function ce({onMutated:e,onAction:t,dataRev:n,overview:i}){let o=u(),{data:s,error:c,reload:l}=f(()=>r.diff(),[n]),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,x]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(s&&s!==S){C(s),v(new Set);let e=s.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=se?s.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>s.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
2
+ `)}\n\n`:``;if(await o(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;g(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await l(),e?.()}catch(e){g(e.message)}finally{m(!1)}}};if(c)return(0,I.jsx)(b,{error:c,onRetry:l});if(!s)return(0,I.jsx)(a,{});if(!s.deployed)return(0,I.jsx)(E,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!s.diffable)return(0,I.jsx)(E,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=s.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=s.files.filter(e=>e.status===`linked`),j=s.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,ee=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),s.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:s.target}),s.theme?` (${s.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,M>0?(0,I.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:p||_.size===0,onClick:O,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:p,onClick:D,children:[(0,I.jsx)(d,{name:`download`}),`Export improvements`]})]})]}),h?(0,I.jsx)(`p`,{className:`sub mb-14`,children:h}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
3
+ `),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(E,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(s.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:_.size===k.length,onChange:T}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>L(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:p,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>L(e,!1))]}):null]})]});function L(e,t){let n=y.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>ee(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(d,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${q(e)}`,children:e},t))})]},e.rel)}}function J({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(d,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function le({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:i,reload:o,setData:s}=f(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),o()};if(i)return(0,I.jsx)(b,{error:i,onRetry:o});let l=n?n.groups.filter(e=>e.problems.length):[],u=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`narrow`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,I.jsx)(d,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[l.map((e,t)=>(0,I.jsx)(J,{group:e,i:t},e.label)),u.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[u.length,` clean check`,u.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:u.map((e,t)=>(0,I.jsx)(J,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,I.jsx)(a,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ue(){let e=u(),[t,n]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:i}),(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){a(null);try{await r.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,I.jsx)(d,{name:`x`}),`Stop server`]})]})}function Y(){let e=u(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:r}),(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await m()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(d,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var de=`https://github.com/Arylmera/Geneseed`,fe=`https://github.com/Arylmera`,pe=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],me=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:pe.map(([n,r])=>(0,I.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,I.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function $({version:e}){let[t,n]=(0,F.useState)(de),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(d,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`MIT License`]})]})]}),children:(0,I.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:fe,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function he({overview:e,onAction:t,flavour:n,onFlavour:i,accentMode:a,onAccentMode:o,layout:s,onLayout:f}){let m=u(),h=e?.install,v=e?.footprint,b=e?.server,S=e?.daemon_stale,[C,E]=(0,F.useState)(null);(0,F.useEffect)(()=>{Promise.resolve(r.update?.()).then(e=>E(e||null)).catch(()=>{})},[]);let D=C?C.install??(C.git?`git`:`npm-global`):null,O=D===`git`?`Update (git pull + rebuild)`:D===`npm-global`?`Update (npm install -g + rebuild)`:`Update`,k=async()=>{let e=`the installs it finds`;try{let{installs:t=[]}=await r.installs();e=t.filter(e=>e.state===`active`).map(e=>`${x(e)} · ${e.scope}`).join(`, `)||`none`}catch{}await m(`Update Geneseed, then rebuild every active install: ${e}? Each is rebuilt in place with its own settings; files you edited are kept.`,{title:`Update and rebuild?`,confirmLabel:`Update`})&&t(`update`)},A=b?.autostart===!0?`On · login script`:b?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:T.server}),(0,I.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]})}),(0,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{stale:S}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&i&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-skin-label`,children:p.map(e=>(0,I.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>i(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:p.find(e=>e.id===n)?.tagline??``})]}),a&&o&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(l,{value:a,onChange:o,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(a)})]}),s&&f&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-layout-label`,children:y.map(e=>(0,I.jsx)(`button`,{className:s===e.id?`on`:``,onClick:()=>f(e.id),"aria-pressed":s===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:y.find(e=>e.id===s)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:D===`other`?C.command?(0,I.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,I.jsx)(`code`,{className:`mono`,children:C.command})]}):null:(0,I.jsxs)(`button`,{className:`btn`,onClick:k,children:[(0,I.jsx)(d,{name:`download`}),O]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(d,{name:`external`}),`Add to PATH`]})}),h&&v&&(0,I.jsxs)(X,{k:`Harness footprint`,help:(0,I.jsxs)(I.Fragment,{children:[`For `,_(h.host).label,` · `,h.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),control:(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Change it on Hosts →`}),children:[(0,I.jsx)(`span`,{className:`mono`,children:v}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,children:v===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,I.jsxs)(Z,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,b?` · pid ${b.pid} · up ${w(b.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(Y,{}),children:S?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:A})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:me.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ue,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function ge({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?v(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(D,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(G,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(K,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(ce,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(le,{dataRev:o}),e===`server`&&(0,I.jsx)(he,{overview:t,onAction:i,...c})]})}export{ge as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{Ct as j,S as M,St as N,dt as P,ft as F,ut as I,xt as L,yt as R}from"./index-D2VlAlpK.js";import{n as z}from"./Dashboard-CnO_bsfz.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=j(this,p(e,l,t,null,this));V(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,j(this,a),e)}}else V(e,this,j(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=j(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>R(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=F(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:N(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:N(70)},260).add(a,{opacity:1,duration:300,delay:N(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:N(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=P(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:N(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:M(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:M(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:P(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>R(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>R(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:I(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${I(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>R(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>R(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{A as i,B as a,E as o,M as s,N as c,O as l,R as u,S as d,V as f,W as p,c as m,d as h,g,h as _,j as v,k as y,l as b,m as x,n as S,p as C,r as w,s as T,u as E,w as D,x as O,y as k}from"./motion-CXaUMNkg.js";import{n as A}from"./sections-ChwaobfW.js";import{Ct as j,S as M,St as N,dt as P,ft as F,ut as I,xt as L,yt as R}from"./index-UNxZecs3.js";import{n as z}from"./Dashboard-DtJ0xrcA.js";function B(e){return d((e.iterationDuration+e._loopDelay)*e.iterationCount-e._loopDelay)||1e-11}function V(e,t,n,r,i,a){let o=l(e.duration)&&e.duration<=1e-11?n-f:n;t.composition&&g(t,o,1,1,p.AUTO);let s=r?new m(r,e,t,o,!1,i,a):new C(e,t,o);return t.composition&&s.init(!0),O(t,s),D(t,e=>{let n=e._offset+e._delay+e.duration;n>t.iterationDuration&&(t.iterationDuration=n)}),t.duration=B(t),t}var H=0,U=class extends C{constructor(e={}){super(e,null,0),++H,this.id=v(e.id)?H:e.id,this.duration=0,this.labels={};let t=e.defaults,n=u.defaults;this.defaults=t?s(t,n):n,this.composition=k(e.composition,!0),this.onRender=e.onRender||n.onRender;let r=k(e.playbackEase,n.playbackEase);this._ease=r?E(r):null,this.iterationDuration=0}add(e,t,n){let r=y(t),i=y(e);if(r||i){if(this._hasChildren=!0,r){let r=t,i=u.editor&&u.editor.addTimelineChild,a=n&&n.type===`Stagger`&&u.editor,s=o(n)?n:null;if(s||a){let t=h(e),a=this.duration,o=this.iterationDuration,c=r.id,l=0,d=t.length,f=i?i(e,r,this.id,n,d):null,p=s||u.editor.resolveStagger(n.defaultValue);t.forEach(e=>{let n={...f||r};this.duration=a,this.iterationDuration=o,v(c)||(n.id=c+`-`+l);let i=j(this,p(e,l,t,null,this));V(n,this,i,e,l,t),l++})}else{let t=i?i(e,r,this.id,n):r,a=n&&n.type?n.defaultValue:n;V(t,this,j(this,a),e)}}else V(e,this,j(this,t));return this.composition&&this.init(!0),this}}sync(e,t){if(v(e)||e&&v(e.pause))return this;e.pause();let n=+(e.effect?e.effect.getTiming().duration:e.duration);!v(e)&&!v(e.persist)&&(e.persist=!0);let r=u.editor,i=r&&r.addTimelineChild;r&&r.addTimelineSync&&(t=r.addTimelineSync(e,t,this.id),r.addTimelineChild=null);let a=this.add(e,{currentTime:[0,n],duration:n,delay:0,ease:`linear`,playbackEase:`linear`},t);return r&&(r.addTimelineChild=i),a}set(e,t,n){return v(t)?this:(t.duration=f,t.composition=a.replace,this.add(e,t,n))}call(e,t){return v(e)||e&&!o(e)?this:(u.editor&&u.editor.addTimelineCall&&(t=u.editor.addTimelineCall(e,t,this.id)),this.add({duration:0,delay:0,onComplete:()=>e(this)},t))}label(e,t){return v(e)||e&&!i(e)?this:(u.editor&&u.editor.addTimelineLabel&&(t=u.editor.addTimelineLabel(e,t,this.id)),this.labels[e]=j(this,t),this)}remove(e,t){return x(h(e),this,t),this}stretch(e){let t=this.duration;if(t===c(e))return this;let n=e/t,r=this.labels;D(this,e=>e.stretch(e.duration*n));for(let e in r)r[e]*=n;return super.stretch(e)}refresh(){return D(this,e=>{e.refresh&&e.refresh()}),this}revert(){return super.revert(),D(this,e=>e.revert,!0),_(this)}then(e){return super.then(e)}},W=e=>u.editor?u.editor.addTimeline(e):new U(e).init(),G=e(t(),1),K=n(),q=.62,J=(e,t)=>String(e).length*t*q;function Y(e,t){let n=0;for(let t of e){if(t.t===``||t.t==null)continue;let e=J(t.t,t.size)/2;n=Math.max(n,Math.hypot(e,t.dy-t.size*.75),Math.hypot(e,t.dy+t.size*.25))}return Math.ceil(n+t)}function X(e,t,n=0){let r=t.x-e.x,i=t.y-e.y,a=Math.hypot(r,i)||1,o=r/a,s=i/a,c=e.x+o*e.r,l=e.y+s*e.r,u=t.x-o*t.r,d=t.y-s*t.r,f=n*a,p=e=>e.toFixed(1);return`M${p(c)} ${p(l)} C${p(c+o*a*.3-s*f)} ${p(l+s*a*.3+o*f)} ${p(u-o*a*.3-s*f)} ${p(d-s*a*.3+o*f)} ${p(u)} ${p(d)}`}var Z=!1,Q=!1,ee=850;function $({hash:e,label:t,part:n,children:r}){return(0,K.jsx)(`g`,{className:`cm-node`,"data-cm":n,role:`button`,tabIndex:0,"aria-label":t,onClick:()=>R(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),R(e))},children:r})}function te({overview:e,dataRev:t}){let{data:n}=F(()=>r.catalog(`laws`),[t],`catalog:laws`),i=n?.items??null,a=n?.nouns?.ontology||`Ethos`,o=n?.nouns?.laws||`Dictates`,s=n?.nouns?.doctrines||`Doctrines`,c=(0,G.useRef)(null),l=(0,G.useRef)(!0),u=(0,G.useRef)(null);(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||Z||!S())return;Z=!0;let t=t=>[...e.querySelectorAll(t)],n=t(`[data-cm="hub"]`),r=t(`[data-cm="sat"]`),i=t(`[data-cm="gov"]`),a=t(`.cm-edge-gov`),o=t(`.cm-note, .cm-govern-label`),s=L(t(`.cm-edge`));T([...n,...r,...i],{opacity:0,scale:.7}),T([...a,...o],{opacity:0}),T(s,{draw:`0 0`});let d=W({autoplay:!1,defaults:{ease:`outExpo`}}).add(n,{opacity:1,scale:1,duration:450},0).add(s,{draw:`0 1`,duration:380,delay:N(70)},140).add(r,{opacity:1,scale:1,duration:420,delay:N(70)},260).add(a,{opacity:1,duration:300,delay:N(50)},420).add(i,{opacity:1,scale:1,duration:380,delay:N(50)},470).add(o,{opacity:1,duration:300},520);l.current=!1;let f=()=>d.complete(),p=()=>{d.play(),f=w(d,ee),l.current=!0,u.current?.()};if(typeof IntersectionObserver>`u`)return p(),()=>f();let m=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(m.disconnect(),p())},{threshold:.33});return m.observe(e),()=>{m.disconnect(),l.current=!0,f()}},[]);let d=e?.counts||{},f=P(d),p=[];for(let e of(i||[]).filter(e=>e.tier===`doctrine`)){let t=p.find(t=>t.id===e.pack);t||p.push(t={id:e.pack,on:0}),e.active!==!1&&(t.on+=1)}let m=e?.footprint===`lean`?`lean — first line only`:`full text inlined`,h={x:330,y:165,r:Y([{t:`Constitution`,size:17,dy:-12},{t:`${f} rules in force`,size:10,dy:8},{t:m,size:8.5,dy:24}],12)},g={x:126,y:95,r:Y([{t:a,size:12.5,dy:-7},{t:`${d.ontology??0} sections`,size:10,dy:10}],11)},_={x:560,y:78,r:Y([{t:o,size:12.5,dy:-6},{t:`${d.laws??0}`,size:13,dy:12}],11)},v={x:560,y:252,r:Y([{t:s,size:12.5,dy:-6},{t:`${d.doctrines?.rules??0}`,size:13,dy:12}],11)},y=(e,t,n,r)=>({x:e,y:t,label:n,count:r,r:Y([{t:n,size:10.5,dy:-2},{t:`${r}`,size:9,dy:10}],9)}),x=[{...y(812,52,`Skills`,d.skills??0),hash:`#/skills`,from:_},{...y(820,126,`Agents`,d.agents??0),hash:`#/agents`,from:_},{...y(816,232,`Memory`,d.memory??0),hash:`#/section/memory`,from:v},{...y(812,300,`Wiki`,d.wiki??0),hash:`#/section/wiki`,from:v}],C={rx:122,ry:68,from:212,to:112},E=p.map((e,t)=>{let n=(p.length===1?(C.from+C.to)/2:C.from+(C.to-C.from)*t/(p.length-1))*Math.PI/180;return{...e,x:v.x+C.rx*Math.cos(n),y:v.y+C.ry*Math.sin(n),r:Y([{t:e.id,size:7.5,dy:-2},{t:`${e.on}`,size:7.5,dy:8}],4)}}),D=E.length;return(0,G.useLayoutEffect)(()=>{let e=c.current;if(!e||!D||Q||!S())return;Q=!0;let t=[...e.querySelectorAll(`.cm-mini > g`)];T(t,{opacity:0,scale:.5});let n=()=>T(t,{opacity:1,scale:1}),r=()=>{u.current=null;let e=b(t,{opacity:1,scale:1,duration:380,delay:N(45,{start:420}),ease:`outExpo`});n=w(e,420+45*D+380)};return l.current?r():u.current=r,()=>{u.current=null,n()}},[D]),(0,K.jsxs)(`svg`,{ref:c,className:`cmap`,viewBox:`0 0 940 350`,role:`group`,"aria-label":`The constitution map`,children:[(0,K.jsx)(`path`,{d:X(h,g,.05),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,_,-.07),className:`cm-edge`}),(0,K.jsx)(`path`,{d:X(h,v,.07),className:`cm-edge`}),x.map(e=>(0,K.jsx)(`path`,{d:X(e.from,e,.03),className:`cm-edge-gov`},`e-${e.label}`)),(0,K.jsxs)($,{hash:`#/laws`,part:`hub`,label:`Constitution: ${f} rules in force`,children:[(0,K.jsx)(`circle`,{cx:h.x,cy:h.y,r:h.r,className:`cm-hub-disc`}),(0,K.jsx)(`text`,{x:h.x,y:h.y-12,textAnchor:`middle`,className:`cm-hub-name`,children:`Constitution`}),(0,K.jsxs)(`text`,{x:h.x,y:h.y+8,textAnchor:`middle`,className:`cm-hub-num`,children:[f,` rules in force`]}),(0,K.jsx)(`text`,{x:h.x,y:h.y+24,textAnchor:`middle`,className:`cm-note`,children:m})]}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${a}: ${d.ontology??0} sections`,children:[(0,K.jsx)(`circle`,{cx:g.x,cy:g.y,r:g.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:g.x,y:g.y-7,textAnchor:`middle`,className:`cm-sat-name`,children:a}),(0,K.jsxs)(`text`,{x:g.x,y:g.y+10,textAnchor:`middle`,className:`cm-sat-num`,children:[d.ontology??0,` sections`]})]}),(0,K.jsx)(`text`,{x:g.x,y:g.y+g.r+16,textAnchor:`middle`,className:`cm-note`,children:`how it thinks, not a rule`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${o}: ${d.laws??0}, never broken`,children:[(0,K.jsx)(`circle`,{cx:_.x,cy:_.y,r:_.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:_.x,y:_.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:o}),(0,K.jsx)(`text`,{x:_.x,y:_.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.laws??0})]}),(0,K.jsx)(`text`,{x:_.x,y:_.y+_.r+16,textAnchor:`middle`,className:`cm-note`,children:`never broken`}),(0,K.jsxs)($,{hash:`#/laws`,part:`sat`,label:`${s}: ${d.doctrines?.rules??0} rules chosen at build`,children:[(0,K.jsx)(`circle`,{cx:v.x,cy:v.y,r:v.r,className:`cm-sat-disc`}),(0,K.jsx)(`text`,{x:v.x,y:v.y-6,textAnchor:`middle`,className:`cm-sat-name`,children:s}),(0,K.jsx)(`text`,{x:v.x,y:v.y+12,textAnchor:`middle`,className:`cm-sat-big`,children:d.doctrines?.rules??0})]}),(0,K.jsx)(`text`,{x:v.x+22,y:v.y+v.r+20,className:`cm-note`,children:d.doctrines?`chosen at build · ${d.doctrines.active}/${d.doctrines.total} packs lit`:`chosen at build`}),(0,K.jsx)(`g`,{className:`cm-mini`,children:E.map(e=>(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-pack-disc`,style:{stroke:M(e.id)}}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-pack-id`,children:e.id}),(0,K.jsx)(`text`,{x:e.x,y:e.y+8,textAnchor:`middle`,style:{fill:M(e.id)},children:e.on})]},e.id))}),(0,K.jsx)(`text`,{x:866,y:16,textAnchor:`middle`,className:`cm-govern-label`,children:`GOVERNS THE HARNESS`}),x.map(e=>(0,K.jsxs)($,{hash:e.hash,part:`gov`,label:`${e.label}: ${e.count}`,children:[(0,K.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r,className:`cm-gov-disc`}),(0,K.jsx)(`text`,{x:e.x,y:e.y-2,textAnchor:`middle`,className:`cm-gov-name`,children:e.label}),(0,K.jsx)(`text`,{x:e.x,y:e.y+10,textAnchor:`middle`,className:`cm-gov-num`,children:e.count})]},e.label)),(0,K.jsx)(`text`,{x:g.x,y:228,textAnchor:`middle`,className:`cm-note`,children:`tap any node to open its ledger`})]})}function ne(){let e=new Date,t=e=>String(e).padStart(2,`0`);return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function re({counts:e}){let t=[{label:A.skills.label,n:e.skills??0,hash:`#/skills`},{label:`Rules in force`,n:P(e),hash:`#/laws`},{label:A.agents.label,n:e.agents??0,hash:`#/agents`},{label:A.memory.label,n:e.memory??0,hash:`#/section/memory`},{label:A.notebook.label,n:e.notebook??0,hash:`#/section/notebook`},{label:A.wiki.label,n:e.wiki??0,hash:`#/section/wiki`},{label:A.config.label,n:e.config??0,hash:`#/section/config`}],n=Math.max(...t.map(e=>e.n),1);return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Growth rings`}),(0,K.jsx)(`span`,{className:`tick right`,children:`by section`})]}),t.map(e=>(0,K.jsxs)(`button`,{className:`jr-ring`,onClick:()=>R(e.hash),children:[(0,K.jsx)(`span`,{className:`jr-ring-label`,children:e.label}),(0,K.jsx)(`span`,{className:`jr-ring-track`,children:(0,K.jsx)(`span`,{className:`jr-ring-fill`,style:{width:`${e.n/n*100}%`}})}),(0,K.jsx)(`span`,{className:`jr-ring-num`,children:e.n})]},e.label))]})}function ie({recent:e,buildEpoch:t}){let n=e?.items||[],r=e?.skipped||[];return(0,K.jsxs)(`div`,{className:`card pad-lg jr-card`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`Freshly grown`}),(0,K.jsx)(`span`,{className:`tick right`,children:`newest`})]}),e?n.length===0?(0,K.jsx)(`p`,{className:`sub`,children:`Nothing here carries a date yet.`}):n.slice(0,5).map(e=>(0,K.jsxs)(`button`,{className:`jr-fresh`,onClick:()=>R(`#/item/${e.type}/${encodeURIComponent(e.name)}`),children:[(0,K.jsx)(`span`,{className:`jr-fresh-kind`,children:e.section}),(0,K.jsx)(`span`,{className:`jr-fresh-name`,children:e.title}),(0,K.jsx)(`span`,{className:`jr-fresh-when`,children:I(e.mtime)})]},`${e.section}:${e.name}`)):(0,K.jsx)(`p`,{className:`sub`,children:`Reading the shelves…`}),r.length>0&&(0,K.jsxs)(`p`,{className:`sub jr-skipped`,children:[`Not dated: `,r.join(`, `),` — too many files to stat on every load.`]}),(0,K.jsxs)(`p`,{className:`jr-care`,children:[t?`Last built ✓ ${I(t)}`:`Never built here`,` ·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>R(`#/activity`),children:`log →`})]})]})}function ae({overview:e,recent:t,lens:n,onDirection:r,dataRev:i}){let a=e?.counts||{};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`head-row jr-head`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`eyebrow`,children:[`Field journal · `,ne()]}),(0,K.jsx)(`h2`,{className:`h`,children:`Today in this harness`}),(0,K.jsx)(z,{verdict:n?.verdict})]})}),(0,K.jsxs)(`div`,{className:`jr-row2`,children:[(0,K.jsx)(re,{counts:a}),(0,K.jsx)(ie,{recent:t,buildEpoch:e?.build_epoch})]}),(0,K.jsxs)(`div`,{className:`card pad-lg jr-map`,children:[(0,K.jsxs)(`div`,{className:`card-head`,children:[(0,K.jsx)(`h3`,{children:`The Constitution — and the harness it governs`}),(0,K.jsx)(`button`,{className:`jr-go right`,onClick:()=>R(`#/laws`),children:`open →`})]}),(0,K.jsx)(te,{overview:e,dataRev:i})]}),(0,K.jsxs)(`p`,{className:`sub jr-others`,children:[`Other views:`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`lineage`),children:`Lineage`}),` `,`·`,` `,(0,K.jsx)(`button`,{className:`jr-go`,onClick:()=>r?.(`operator`),children:`Operator`})]})]})}export{ae as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{G as r,W as i,Z as a}from"./index-D2VlAlpK.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=a(),s=r(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)}}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{G as r,W as i,Z as a}from"./index-UNxZecs3.js";var o=e(t(),1),s=n();function c({label:e,value:t,options:n,onChange:r}){return n.length?(0,s.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,s.jsx)(`option`,{value:e,children:e},e))}):null}var l=[`lean`,`full`];function u({on:e,disabled:t,label:n,onToggle:r}){return(0,s.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var d=[{key:`theme`,name:`voice`,title:`Voice`},{key:`footprint`,name:`footprint`,title:`Footprint`},{key:`posture`,name:`posture`,title:`Posture`},{key:`mode`,name:`mode`,title:`Mode`},{key:`trust`,name:`trust`,title:`Loop trust`}];function f({value:e,options:t,onChange:n,who:r}){return d.map(i=>(0,s.jsxs)(`label`,{className:`dp-field`,children:[(0,s.jsx)(`span`,{children:i.title}),(0,s.jsx)(c,{label:`${i.name} for ${r}`,value:e[i.key],options:t[i.key],onChange:e=>n(i.key,e)})]},i.key))}var p=e=>e.kits||[],m=e=>!e.editable||e.state===`unreadable`;function h(e,t){let n=a(),s=r(),c=e=>{let t=s.get(`kits`,e.id);return t&&t.base===i(p(e))?t:null},{prune:l}=s;(0,o.useEffect)(()=>{if(!e?.installs)return;let t=new Map(e.installs.map(e=>[e.id,i(p(e))]));l(`kits`,(e,n)=>t.has(e)&&t.get(e)!==n.base)},[e,l]);let u=e=>c(e)?.value??new Set(p(e)),d=(e,t)=>{let n=new Set(u(e));n.delete(t)||n.add(t),s.put(`kits`,e.id,n,i(p(e)))},f=e=>{let t=u(e),n=new Set(p(e));return{on:[...t].filter(e=>!n.has(e)),off:[...n].filter(e=>!t.has(e))}},m=e=>s.running(`kits`,e.id)||!!c(e)?.applied;return{setOf:u,toggle:d,change:f,apply:async e=>{let r=[...u(e)],i=`Rebuild ${e.host} · ${e.scope} with kits: ${r.join(`, `)||`none`}? Members of kits turned off are removed; files you edited are kept.`;await n(i,{confirmLabel:`Rebuild`})&&await t(`install`,{host:e.host,path:e.path,kits:r})&&s.startApply(`kits`,e.id)},running:m,failed:e=>!!c(e)?.failed,discard:e=>{m(e)||s.drop(`kits`,e.id)},busy:s.busy}}function g(e,t){let{on:n,off:r}=t.change(e);if(t.running(e))return`Rebuilding…`;let i=[...n.map(e=>`turn on ${e}`),...r.map(e=>`turn off ${e}`)].join(` · `);return[t.failed(e)?`Last rebuild failed — see console`:``,i].filter(Boolean).join(` · `)||`No staged changes`}function _({row:e,stage:t}){let{on:n,off:r}=t.change(e),i=n.length+r.length>0,a=t.running(e);return(0,s.jsxs)(`div`,{className:`kit-foot`,children:[(0,s.jsx)(`span`,{className:`kit-hint${i?` staged`:``}`,role:`status`,children:g(e,t)}),(0,s.jsx)(`button`,{type:`button`,className:`btn soft sm`,"aria-label":`Apply kits for ${e.host} · ${e.scope}`,disabled:m(e)||!i||a||t.busy,title:t.busy&&!a?`A job is running`:void 0,onClick:()=>t.apply(e),children:`Apply`})]})}var v={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]},y=({row:e})=>{let[t,n]=v[e.state]||[e.state||`Unknown`,``];return(0,s.jsx)(`span`,{className:`tag ${n}`,children:t})};export{p as a,f as c,m as i,u as l,y as n,h as o,g as r,l as s,_ as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{J as i,L as a,U as o,ft as s,q as c}from"./index-UNxZecs3.js";import{t as l}from"./EmptyState-1sPNleqv.js";import{t as u}from"./Markdown-DpmmtW2Y.js";import{a as d,i as f,l as p,n as m,o as h,r as g,t as _}from"./KitApply-BaDKgnO8.js";import{t as v}from"./DataTable-BWbUx4bY.js";var y=e(t(),1),b=n(),x=encodeURIComponent,S=e=>(e||``).split(/\s+/).filter(Boolean).length,C=e=>[...new Set(e.filter(Boolean))],w=e=>(e||``).slice(0,7),T=(e,t)=>e?`Not in the install the topbar views; on in ${e} of ${O(t,`install`)}`:`Installed when this kit is on`,E=({type:e,names:t,listed:n,offNote:r=T(0)})=>t.length?(0,b.jsx)(`ul`,{className:`kit-links`,children:t.map(t=>(0,b.jsx)(`li`,{children:n?.has(t)?(0,b.jsx)(`a`,{href:`#/item/${e}/${x(t)}`,children:t}):(0,b.jsx)(`span`,{className:`kit-link-off`,title:r,children:t})},t))}):(0,b.jsx)(`p`,{className:`panel-note`,children:`None.`});function D({kit:e,installs:t,stage:n,listed:r}){let i=e.credits||[],a=T(t.filter(t=>d(t).includes(e.name)).length,t.length);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`div`,{className:`reader-tags`,children:[(0,b.jsx)(`span`,{className:`tag acc`,children:`Kit`}),C(i.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsx)(`h2`,{className:`reader-title`,children:e.name}),e.description?(0,b.jsx)(`p`,{className:`reader-lede`,children:e.description}):null,(0,b.jsxs)(`p`,{className:`mono dim reader-src`,children:[`kits/`,e.name,`/`]}),(0,b.jsx)(`hr`,{className:`hr`}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Installs`}),t.length?(0,b.jsx)(`ul`,{className:`kit-list kit-box`,"aria-label":`Installs for ${e.name}`,children:t.map(t=>{let r=f(t),i=`${t.host} · ${t.scope}`;return(0,b.jsxs)(`li`,{className:`kit-install`,children:[(0,b.jsxs)(`div`,{className:`kit-row`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:i}),(0,b.jsx)(`span`,{className:`mono dim`,children:t.path})]}),(0,b.jsx)(m,{row:t}),(0,b.jsx)(p,{on:n.setOf(t).has(e.name),disabled:r||n.running(t),label:`${e.name} for ${i}`,onToggle:()=>n.toggle(t,e.name)})]}),r&&(0,b.jsx)(`p`,{className:`kit-lock`,children:t.reason||t.error}),(0,b.jsx)(_,{row:t,stage:n})]},t.id)})}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`}),i.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Upstream`}),(0,b.jsx)(`dl`,{className:`loop-facts`,children:i.map(e=>(0,b.jsxs)(y.Fragment,{children:[(0,b.jsx)(`dt`,{children:e.author||e.repo}),(0,b.jsxs)(`dd`,{children:[(0,b.jsx)(`span`,{className:`mono`,children:e.repo}),e.commit?(0,b.jsxs)(`span`,{className:`mono dim`,children:[`@ `,w(e.commit)]}):null,e.compareUrl?(0,b.jsx)(`a`,{href:e.compareUrl,target:`_blank`,rel:`noreferrer`,"aria-label":`Compare ${e.repo} @ ${w(e.commit)} with HEAD`,children:`compare`}):null,e.license?(0,b.jsx)(`span`,{className:`tag`,children:e.license}):null]})]},e.key||e.repo))})]}):null,(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Skills`}),(0,b.jsx)(E,{type:`skill`,names:e.skills||[],listed:r?.skills,offNote:a}),(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Agents`}),(0,b.jsx)(E,{type:`agent`,names:e.agents||[],listed:r?.agents,offNote:a}),e.rules?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(`h3`,{className:`loop-h2`,children:[`Rules`,` `,(0,b.jsxs)(`span`,{className:`mono dim`,children:[S(e.rules),e.rulesWordBudget?` / ${e.rulesWordBudget}`:``,` words`]})]}),(0,b.jsx)(`div`,{className:`lib-doc detail-doc`,children:(0,b.jsx)(u,{body:e.rules})})]}):null,e.banned?.length?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(`h3`,{className:`loop-h2`,children:`Banned APIs`}),(0,b.jsx)(`ul`,{className:`kit-links`,"aria-label":`Banned APIs`,children:e.banned.map(e=>(0,b.jsx)(`li`,{children:(0,b.jsx)(`span`,{className:`kit-link-off`,children:e})},e))})]}):null]})}var O=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,k=e=>`${e.host} · ${e.scope}`;function A(e,t,n){let r=d(t).includes(n),i=e.setOf(t).has(n);return r===i?{now:i,note:i?`on`:`off`,staged:!1}:{now:i,note:i?`staged on`:`staged off`,staged:!0}}function j({kit:e,installs:t,stage:n,listed:r,max:i}){let o=e.credits||[],s=e.skills||[],c=e.agents||[],l=t.map(t=>({row:t,...A(n,t,e.name)})),u=l.filter(t=>d(t.row).includes(e.name)).length,f=l.filter(e=>e.staged).length,p=T(u,t.length),m=`on in ${u} of ${O(t.length,`install`)}${f?` · ${f} staged`:``}`;return(0,b.jsxs)(`article`,{className:`kit-card${f?` staged`:``}`,"aria-labelledby":`kit-${e.name}`,children:[(0,b.jsxs)(`header`,{className:`kit-card-head`,children:[(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`h2`,{className:`kit-card-title`,id:`kit-${e.name}`,children:(0,b.jsx)(`a`,{className:`kit-name`,href:`#/kits/${x(e.name)}`,children:e.name})}),e.description?(0,b.jsx)(`p`,{className:`kit-desc`,children:e.description}):null]}),C(o.map(e=>e.license)).map(e=>(0,b.jsx)(`span`,{className:`tag`,children:e},e))]}),(0,b.jsxs)(`div`,{className:`kit-counts`,children:[(0,b.jsx)(`span`,{children:`Skills`}),(0,b.jsx)(a,{value:s.length,max:i,label:`Skills`}),(0,b.jsx)(`span`,{className:`mono`,children:s.length}),(0,b.jsx)(`span`,{children:`Agents`}),(0,b.jsx)(a,{value:c.length,max:i,label:`Agents`}),(0,b.jsx)(`span`,{className:`mono`,children:c.length})]}),s.length?(0,b.jsx)(E,{type:`skill`,names:s,listed:r?.skills,offNote:p}):null,c.length?(0,b.jsx)(E,{type:`agent`,names:c,listed:r?.agents,offNote:p}):null,(0,b.jsxs)(`footer`,{className:`kit-card-foot`,children:[o.length?(0,b.jsxs)(`span`,{className:`kit-credit`,children:[`Adapted from`,` `,o.map((e,t)=>(0,b.jsxs)(y.Fragment,{children:[t?`, `:null,(0,b.jsx)(`a`,{href:`https://github.com/${e.repo}`,target:`_blank`,rel:`noreferrer`,children:e.repo}),e.author?` · ${e.author}`:null]},e.key||e.repo))]}):(0,b.jsx)(`span`,{}),t.length?(0,b.jsxs)(`span`,{className:`kit-where`,children:[(0,b.jsx)(`span`,{className:`kit-dots`,role:`img`,"aria-label":l.map(e=>`${k(e.row)}: ${e.note}`).join(`, `),children:l.map(e=>(0,b.jsx)(`span`,{className:`kit-dot${e.now?` on`:``}${e.staged?` staged`:``}`,title:`${k(e.row)}: ${e.note}`},e.row.id))}),(0,b.jsx)(`span`,{className:`mono dim`,children:m})]}):null]})]})}function M({kits:e,installs:t,stage:n}){let r=[{key:`install`,label:`Install`,render:e=>(0,b.jsxs)(`div`,{className:`kit-main`,children:[(0,b.jsx)(`b`,{children:k(e)}),(0,b.jsx)(`span`,{className:`mono dim`,children:e.path}),f(e)?(0,b.jsx)(`span`,{className:`kit-lock-note`,children:e.reason||e.error}):null]})},...e.map(e=>({key:`kit:${e.name}`,label:e.name,render:t=>{let r=A(n,t,e.name);return(0,b.jsxs)(`span`,{className:`kit-cell`,children:[(0,b.jsx)(p,{on:r.now,disabled:f(t)||n.running(t),label:`${e.name} for ${k(t)}`,onToggle:()=>n.toggle(t,e.name)}),(0,b.jsx)(`span`,{className:`kit-note${r.staged?` staged`:``}`,children:r.note})]})}})),{key:`change`,label:`Change`,render:e=>{let{on:t,off:r}=n.change(e),i=[...t.map(e=>`+ ${e}`),...r.map(e=>`− ${e}`)];return(0,b.jsx)(`span`,{className:`tag${i.length?` acc`:``}`,children:i.join(`, `)||`none`})}}];return(0,b.jsxs)(`section`,{className:`panel flush kit-matrix`,"aria-labelledby":`kit-mx-h`,children:[(0,b.jsxs)(`div`,{className:`kit-matrix-head`,children:[(0,b.jsx)(`h2`,{id:`kit-mx-h`,children:`On which install`}),(0,b.jsx)(`span`,{className:`dim`,children:`Each row describes that install, not the one selected in the topbar.`})]}),t.length?(0,b.jsx)(v,{caption:`Kits per install`,captionHidden:!0,columns:r,rows:t,rowKey:e=>e.id}):(0,b.jsx)(`p`,{className:`panel-note`,children:`No install yet.`})]})}function N({installs:e,stage:t}){let n=e=>{let{on:n,off:r}=t.change(e);return n.length+r.length},r=e.filter(e=>n(e)>0),i=e.find(e=>t.running(e))||r.find(e=>!t.failed(e))||r[0]||null,a=r.reduce((e,t)=>e+n(t),0),o=!!i&&t.running(i),s=r.filter(e=>e!==i).length;return(0,b.jsxs)(`div`,{className:`kit-bar${i?` staged`:``}`,role:`region`,"aria-label":`Staged changes`,children:[(0,b.jsx)(`b`,{children:a?`${O(a,`change`)} on ${O(r.length,`install`)}`:`No staged changes`}),i?(0,b.jsxs)(`span`,{className:`kit-hint staged`,role:`status`,children:[k(i),`: `,g(i,t),s?` — ${s} more staged, applied one at a time`:``]}):null,(0,b.jsxs)(`span`,{className:`kit-bar-acts`,children:[(0,b.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":i?`Discard staged kits for ${k(i)}`:`Discard staged kits`,disabled:!i||o,onClick:()=>t.discard(i),children:`Discard`}),(0,b.jsx)(`button`,{type:`button`,className:`btn sm`,"aria-label":i?`Apply and rebuild kits for ${k(i)}`:`Apply and rebuild kits`,disabled:!i||f(i)||!n(i)||o||t.busy,title:t.busy&&!o?`A job is running`:void 0,onClick:()=>t.apply(i),children:`Apply and rebuild`})]})]})}function P({item:e,onAction:t,dataRev:n}){let{data:a,error:u}=s(()=>r.kits(),[n]),d=h(a,t),{data:f}=s(()=>Promise.all([r.catalog(`skills`),r.catalog(`agents`)]).then(([e,t])=>({skills:new Set((e.items||[]).map(e=>e.name)),agents:new Set((t.items||[]).map(e=>e.name))})).catch(()=>null),[n]),p=a?.kits||[],m=a?.installs||[],g=u||a?.error;if(e){let t=p.find(t=>t.name===e);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{title:`Kits`,crumbs:[{label:`Kits`,href:`#/kits`},{label:e}]}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?t?(0,b.jsx)(`article`,{className:`panel kit-page`,"aria-label":`Entry`,children:(0,b.jsx)(D,{kit:t,installs:m,stage:d,listed:f})}):(0,b.jsxs)(l,{title:`No such kit`,action:(0,b.jsx)(`a`,{href:`#/kits`,children:`Back to all kits`}),children:[`No kit is named “`,e,`”.`]}):g?null:(0,b.jsx)(i,{})]})}let _=Math.max(1,...p.flatMap(e=>[(e.skills||[]).length,(e.agents||[]).length]));return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(o,{eyebrow:a?`${O(p.length,`kit`)} · ${O(m.length,`install`)}`:null,title:`Kits`,sub:`A kit adds a stack's skills, agents and rules to an install. Turn one on per install, then apply once.`}),(0,b.jsx)(c,{error:g,style:{margin:`0 0 var(--sp-3)`}}),a?p.length===0?g?null:(0,b.jsx)(l,{title:`No kits`,children:`This Geneseed ships no kit.`}):(0,b.jsxs)(`div`,{className:`kit-page-body`,children:[(0,b.jsx)(`div`,{className:`kit-gallery`,children:p.map(e=>(0,b.jsx)(j,{kit:e,installs:m,stage:d,listed:f,max:_},e.name))}),(0,b.jsx)(M,{kits:p,installs:m,stage:d}),m.length?(0,b.jsx)(N,{installs:m,stage:d}):null]}):g?null:(0,b.jsx)(i,{})]})}export{P as default};
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{G as i,J as a,L as o,U as s,V as c,W as l,X as u,Z as d,_ as f,d as p,f as m,ft as h,g,h as _,m as v,p as y,q as b,v as ee,y as te,yt as x}from"./index-UNxZecs3.js";import{t as ne}from"./EmptyState-1sPNleqv.js";import{t as S}from"./FilterInput-CZREvrjX.js";import{t as C}from"./Markdown-DpmmtW2Y.js";var w=e(t(),1);function T({items:e,packs:t,install:n,canApply:r,onAction:a,gateArmed:o}){let s=d(),c=e.filter(e=>e.tier===`doctrine`&&e.active!==!1).map(e=>e.name),u=c.join(`,`),f=i(),p=n?`${n.host}:${n.scope}:${n.path}`:``,m=l(c),{prune:h}=f,g=e.length>0;(0,w.useEffect)(()=>{g&&h(`rules`,(e,t)=>e===p&&t.base!==m)},[g,p,m,h]);let _=f.get(`rules`,p),v=_&&_.base===m?_.value:c,y=e=>f.put(`rules`,p,e(v),m),b=e=>v.includes(e),ee=e=>y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]),te=e=>e.rules.some(e=>b(e.addr)),x=e=>{let t=e.rules.map(e=>e.addr),n=e.rules.every(e=>b(e.addr));y(e=>n?e.filter(e=>!t.includes(e)):[...new Set([...e,...t])])},ne=e=>{let t=e.rules.filter(e=>b(e.addr)).length;return t?e.active?`${t} of ${e.rules.length} active`:`staged on · ${t} of ${e.rules.length}`:e.active?`staged off`:`not built in`},S=t.flatMap(e=>e.rules.map(e=>e.addr)),C=S.filter(b),T=C.join(`,`)!==u,E=`process.5`,D=c.includes(E)&&!v.includes(E);return{deployedRules:c,isOn:b,toggleRule:ee,packOn:te,togglePack:x,packState:ne,allRules:S,pickedRules:C,dirty:T,losingConsent:D,applyPacks:async()=>{if(!r||!T)return;let e=t.filter(e=>e.rules.some(e=>b(e.addr))).map(e=>e.pack),i=t.filter(t=>e.includes(t.pack)).flatMap(e=>e.rules.filter(e=>!b(e.addr)).map(e=>e.addr)),c=D?`
2
+
3
+ process 5 carries commit/push consent. Dropping it also removes the git-gate hook, so commits and pushes stop being confirmed at the tool boundary. `+(o?`(Real data loss stays gated: that is Rule IV’s, not the pack’s.)`:`(Rule IV’s deletion gate is off on this install, so real data loss is not asked about either.)`):``,l=C.length?`${C.length} of ${S.length} doctrine rules`:`no doctrine rules`;await s(`Rebuild ${n.host} · ${n.scope} with ${l}? It rebuilds in place, non-destructive.${c}`,{title:`Rebuild with these rules?`,confirmLabel:`Rebuild`})&&await a(`install`,{...n,doctrines:e,excludeRules:i})&&f.startApply(`rules`,p)},revert:()=>f.drop(`rules`,p)}}var E=n();function D({addr:e,isOpen:t,onToggle:n,className:i,style:a,head:o,label:s,rev:c,toggleCol:l=null,renderBody:u,srcLine:d}){let f=(0,w.useId)(),{data:p,error:m,reload:g}=h(()=>t?r.item(`law`,e):Promise.resolve(null),[t,e,c],`law-item`),_=t&&(0,E.jsxs)(`div`,{className:`law-expand`,id:f,children:[m?(0,E.jsx)(b,{error:m,onRetry:g}):p?u(p):(0,E.jsx)(`p`,{className:`dim`,children:`Loading…`}),(0,E.jsx)(`div`,{className:`law-srcline`,children:d})]}),v={type:`button`,onClick:n,"aria-expanded":t,"aria-controls":f,"aria-label":s};return l?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`div`,{className:i,style:a,"data-addr":e,children:[(0,E.jsx)(`button`,{className:`law-disclosure`,...v,children:o}),(0,E.jsx)(`span`,{className:`toggle-col`,children:l})]}),_]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`button`,{className:i,style:a,"data-addr":e,...v,children:o}),_]})}function re({law:e,isOpen:t,onToggle:n,rev:r,toggleCol:i=null}){let a=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`law-no`,children:[(0,E.jsx)(`span`,{className:`x`,"aria-hidden":`true`,children:`›`}),e.no]}),(0,E.jsxs)(`span`,{className:`law-name`,children:[(0,E.jsx)(`span`,{children:e.name}),e.ess?(0,E.jsx)(`span`,{className:`law-princ`,children:e.ess}):null,e.asks?(0,E.jsx)(`span`,{className:`law-asks mono`,children:e.asks}):null]}),(0,E.jsx)(`span`,{className:`law-latin`,children:e.latin}),(0,E.jsx)(`span`,{className:`law-status ${e.statusTone}`,children:e.status}),(0,E.jsx)(`span`,{className:`law-enf${e.enf===`Hook gate`?` hook`:e.enf===`Gate off`?` gate-off`:``}`,children:e.enf})]});return(0,E.jsx)(D,{addr:e.addr,isOpen:t,onToggle:n,className:`law-row${i?` has-toggle`:``}${t?` on`:``}${e.off?` law-off`:``}`,style:{"--cc":e.c},head:a,label:`${e.no?e.no+` `:``}${e.name}, ${e.status}, ${e.enf}`,rev:r,toggleCol:i,renderBody:t=>(0,E.jsx)(C,{body:t.body||e.ess,links:t.links}),srcLine:`$ geneseed law ${e.addr} · ${e.src}`})}var ie=[`invariants`,`doctrines`];function ae({tiers:e,current:t,onPick:n}){return(0,E.jsx)(`div`,{className:`tier-strip`,children:e.map((e,r)=>{let i=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`span`,{className:`tier-head`,children:[(0,E.jsxs)(`span`,{className:`tier-k mono`,children:[`RANK `,r+1]}),e.pill?(0,E.jsx)(`span`,{className:`badge tier-pill ${e.pill[1]}`,children:e.pill[0]}):null]}),(0,E.jsxs)(`span`,{className:`tier-top`,children:[(0,E.jsx)(`span`,{className:`tier-name`,children:e.name}),(0,E.jsx)(`span`,{className:`tier-n mono`,children:e.n})]}),(0,E.jsx)(`span`,{className:`tier-bar`,"aria-hidden":`true`,children:(0,E.jsx)(`span`,{style:{width:`${Math.round(e.fill*100)}%`}})}),(0,E.jsx)(`span`,{className:`tier-sub`,children:e.sub}),(0,E.jsx)(`span`,{className:`tier-sub tier-rule`,children:e.rule})]}),a=`tier${t===e.key?` on`:``}`;return e.href?(0,E.jsx)(`a`,{className:`tier`,href:e.href,children:i},e.key):n&&ie.includes(e.key)?(0,E.jsx)(`button`,{type:`button`,className:a,"aria-pressed":t===e.key,onClick:()=>n(t===e.key?`all`:e.key),children:i},e.key):(0,E.jsx)(`div`,{className:a,children:i},e.key)})})}function oe({gates:e,byAddr:t,onJump:n,disarmed:r=()=>!1}){let i=Object.entries(e?.asks||{}).map(([e,t])=>[e,t,r(g(e))]).sort((e,t)=>e[2]-t[2]||t[1]-e[1]),a=Math.max(1,...i.map(([,e])=>e));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`gate-asks`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`gate-asks`,children:`Gate asks`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e?.total??0,` in ledger`]})]}),i.length?(0,E.jsx)(`ul`,{className:`gate-list`,children:i.map(([e,r,i])=>{let s=g(e),c=t[s]?.name||s;return(0,E.jsxs)(`li`,{children:[(0,E.jsx)(`button`,{type:`button`,className:`gate-row`,onClick:()=>n(s),children:(0,E.jsxs)(`span`,{className:`gate-top`,children:[(0,E.jsx)(`span`,{className:`gate-name${i?` dim`:``}`,children:c}),(0,E.jsx)(`span`,{className:`mono dim`,children:s}),i&&(0,E.jsx)(`span`,{className:`mono off`,children:`off`}),(0,E.jsx)(`span`,{className:`mono gate-n`,children:r})]})}),(0,E.jsx)(o,{value:r,max:a,label:`${c} asks`,tone:i?`accent`:`warn`})]},e)})}):(0,E.jsx)(`p`,{className:`sub`,children:`No gate has asked yet.`}),(0,E.jsx)(`p`,{className:`panel-note`,children:e?.standing_down?.length?`Standing down: ${e.standing_down.join(`, `)}.`:`None standing down.`})]})}function se({packs:e,sel:t,canApply:n,install:r,gateArmed:i}){let{isOn:a,packOn:s,togglePack:c,dirty:l,losingConsent:u}=t,d=Math.max(1,...e.map(e=>e.rules.length));return(0,E.jsxs)(`section`,{className:`panel`,"aria-labelledby":`doc-packs`,children:[(0,E.jsxs)(`div`,{className:`panel-head`,children:[(0,E.jsx)(`h2`,{id:`doc-packs`,children:`Doctrine packs`}),(0,E.jsxs)(`span`,{className:`mono dim`,children:[e.filter(s).length,`/`,e.length,` on`]})]}),e.length?(0,E.jsx)(`ul`,{className:`pack-list`,children:e.map(e=>{let t=e.rules.filter(e=>a(e.addr)).length;return(0,E.jsxs)(`li`,{className:s(e)?``:`off`,children:[(0,E.jsx)(`span`,{className:`pl-name`,title:e.desc,children:e.title}),(0,E.jsx)(o,{value:t,max:d,label:`${e.title} rules on`}),(0,E.jsx)(`span`,{className:`mono pl-n`,children:t}),n?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${s(e)?` on`:``}${t&&t<e.rules.length?` mixed`:``}`,role:`checkbox`,"aria-checked":e.rules.length&&t===e.rules.length?`true`:t?`mixed`:`false`,"aria-label":`${e.title} pack`,onClick:()=>c(e)}):null]},e.pack)})}):(0,E.jsx)(`p`,{className:`sub`,children:`This install predates the three-tier constitution.`}),n&&e.length>0&&(0,E.jsxs)(E.Fragment,{children:[u&&(0,E.jsxs)(`p`,{className:`pack-warn`,role:`status`,"aria-live":`polite`,children:[`Dropping `,(0,E.jsx)(`b`,{children:`process 5`}),` also removes the commit/push consent gate:`,` `,(0,E.jsx)(`code`,{children:`git commit`}),` and `,(0,E.jsx)(`code`,{children:`git push`}),` stop being confirmed at the tool boundary.`,` `,i?`Real data loss stays gated by Rule IV.`:`Rule IV’s deletion gate is off on this install too.`]}),(0,E.jsx)(`p`,{className:`panel-note`,role:`status`,"aria-live":`polite`,children:l?`Not applied yet. Apply rebuilds ${r.host} · ${r.scope} once, with every change together.`:`Matches the deployed install. Changing a pack rebuilds it.`})]})]})}function ce(e){let t=[];for(let n of e){if(n.tier!==`doctrine`)continue;let e=t.find(e=>e.pack===n.pack);e||(e={pack:n.pack,title:n.packTitle||n.pack,desc:n.packDesc||``,active:n.packActive!==!1,rules:[]},t.push(e));let r=f(n.title);e.rules.push({addr:n.name,no:`${n.pack} ${n.name.split(`.`)[1]||``}`,name:r.name,latin:r.latin,ess:n.summary||``,enf:_(n.name),c:te[n.pack]||`var(--text-3)`,src:`doctrines/${n.pack}.md`})}return t}function le({selected:e,overview:t,setup:n,onAction:i,dataRev:l}){let C=d(),{data:D,error:ie}=h(()=>r.catalog(`laws`),[l],`catalog:laws`),{data:le}=c(l),[O,k]=(0,w.useState)(`all`),[ue,de]=(0,w.useState)(``),[A,j]=(0,w.useState)(`all`),[fe,pe]=(0,w.useState)(()=>new Set),M=e||null,me=e=>x(M===e?`#/laws`:`#/item/law/${encodeURIComponent(e)}`),[he,ge]=(0,w.useState)(0),_e=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!e)return;let t=requestAnimationFrame(()=>{let t=document.querySelector(`[data-addr="${CSS.escape(e)}"]`);if(!t)return;let n=_e.current===e;_e.current=null;let r=t.getBoundingClientRect();if(n||r.top<80||r.bottom>window.innerHeight){let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;t.scrollIntoView?.({block:`center`,behavior:e?`auto`:`smooth`})}n&&(t.classList.remove(`law-flash`),t.offsetWidth,t.classList.add(`law-flash`))});return()=>cancelAnimationFrame(t)},[e,he,D]);let N=D?.items||[],P=ce(N),F=e=>t?.install?.[m[e].key]!==!1,ve=F(`IV`),I=t?.install,L=!!(I&&i),R=T({items:N,packs:P,install:I,canApply:L,onAction:i,gateArmed:ve}),{deployedRules:z,isOn:B,toggleRule:ye,packOn:be,packState:xe,allRules:V}=R;if(ie)return(0,E.jsx)(b,{error:ie});if(!D)return(0,E.jsx)(a,{});let H={ontology:D.nouns?.ontology||`Ethos`,law:D.nouns?.law||`Dictate`,laws:D.nouns?.laws||`Dictates`,doctrines:D.nouns?.doctrines||`Doctrines`},U=N.filter(e=>e.tier===`ontology`).map(e=>({addr:e.name,no:``,name:e.title,latin:``,ess:``,status:`Always`,statusTone:`ok`,enf:`Instruction`,c:`var(--text-3)`,src:`ontology/universal.md`})),W=N.filter(e=>(e.tier??`invariant`)===`invariant`).map(e=>{let n=e.klass&&ee[e.klass]?e.klass:`craft`,r=f(e.title);return{addr:e.name,no:e.name,name:r.name,latin:r.latin,ess:e.summary||``,retired:r.retired,status:r.retired?`Retired`:`Active`,statusTone:r.retired?``:`ok`,enf:r.retired?`None`:_(e.name,t?.install),cat:n,c:ee[n].c,off:r.retired,src:`laws/universal.md`}}),Se=e=>{let t=B(e.addr),n=z.includes(e.addr),r=t===n?t?`Active`:`Off`:t?`Staged on`:`Staged off`;return{...e,off:!t,status:r,statusTone:t?`ok`:t===n?``:`warn`}},Ce=P.filter(e=>e.active).flatMap(e=>e.rules.filter(e=>!z.includes(e.addr)).map(e=>e.addr)),we=async e=>{if(!L)return;let{key:t,label:n}=m[e],r=n.toLowerCase(),a=!F(e),o=`${I.host} · ${I.scope}`,s=R.dirty?` Your staged doctrine changes are not part of this rebuild; they stay staged.`:``;await C((a?`Re-arm the ${r} on ${o}? ${p[e].arm} It rebuilds in place, non-destructive.`:`Switch the ${r} off on ${o}? ${p[e].off} It rebuilds in place, non-destructive.`)+s,{title:a?`Re-arm the ${r}?`:`Switch the ${r} off?`,confirmLabel:a?`Re-arm`:`Switch off`})&&i(`install`,{...I,[t]:a})},Te=e=>String(e.addr).includes(`.`)&&B(e.addr)!==z.includes(e.addr),G=(e,t=A)=>t===`all`||(t===`gated`?e.enf===`Hook gate`&&(!String(e.addr).includes(`.`)||z.includes(e.addr)):Te(e)),K=ue.trim().toLowerCase(),q=e=>G(e)&&(!K||`${e.addr} ${e.name} ${e.latin} ${e.ess}`.toLowerCase().includes(K)),Ee=e=>{let t=Ne[e],n=String(e).includes(`.`);(n&&O===`invariants`||!n&&O===`doctrines`)&&k(`all`),t&&!G(t)&&j(`all`),t&&!q(t)&&de(``),_e.current=e,ge(e=>e+1),x(`#/item/law/${encodeURIComponent(e)}`)},J={};for(let[e,t]of Object.entries(n?.gates?.asks||{}))J[g(e)]=t;let De=e=>J[e.addr]?{...e,asks:`${J[e.addr]} ask${J[e.addr]===1?``:`s`}`}:e,Y=W.filter(e=>!e.retired).length,X=z.length,Oe=Object.keys(m).filter(e=>W.some(t=>t.addr===e)&&!F(e)).length,ke=V.length-X,Z=le?.stats,Ae={ethos:{name:H.ontology,n:U.length,fill:1,sub:`${U.length} sections`,pill:[`always`,`ok`]},invariants:{name:H.laws,n:Y,fill:W.length?Y/W.length:0,sub:W.length>Y?`${Y} active · ${W.length-Y} retired`:`${Y} active`,pill:Oe?[`${Oe} gate${Oe===1?``:`s`} off`,`warn`]:[`always`,`ok`]},doctrines:{name:H.doctrines,n:X,fill:V.length?X/V.length:0,sub:`${X} rules · ${P.filter(e=>e.active).length} of ${P.length} packs`,pill:ke>0?[`${ke} excluded`,`warn`]:[`all on`,`ok`]},yours:{name:`Your rules`,n:Z?.rules??0,fill:Z?.max_rules?Z.rules/Z.max_rules:0,sub:Z?`${Z.rules} of ${Z.max_rules} · ${Z.tokens}/${Z.max_tokens} tok`:`user-rules.md`,href:`#/personal/rules`,pill:[`yours`,``]}},je=e=>{if(e===`—`)return`Nothing outranks them.`;let t=e.replace(`{{LAW}}`,H.law);return`${t[0].toUpperCase()}${t.slice(1)}.`},Me=y.map(e=>({key:e.key,...Ae[e.key],rule:je(e.against)})),Ne=Object.fromEntries([...W,...P.flatMap(e=>e.rules)].map(e=>[e.addr,e])),Pe=[[`all`,`All`,W.length+V.length],[`invariants`,H.laws,W.length],[`doctrines`,H.doctrines,V.length]],Q=O===`all`||O===`invariants`,Fe=O===`all`||O===`doctrines`,Ie=[...Q?W:[],...Fe?P.flatMap(e=>e.rules):[]],Le=[[`gated`,`Gated`,Ie.filter(e=>G(e,`gated`)).length],[`changed`,`Changed`,Ie.filter(e=>G(e,`changed`)).length]],Re=e=>String(e).includes(`.`)?String(e).split(`.`)[0]:null,ze=e=>A!==`changed`&&fe.has(e)&&Re(M)!==e,Be=e=>{let t=ze(e);pe(n=>{let r=new Set(n);return t?r.delete(e):r.add(e),r}),!t&&Re(M)===e&&x(`#/laws`)},Ve=P.flatMap(e=>e.rules.filter(Te).map(e=>({...e,plus:B(e.addr)}))),He=L&&P.length>0&&R.dirty,Ue=()=>{j(`changed`),O===`invariants`&&k(`all`),de(``)},We=(e,t)=>(0,E.jsxs)(`div`,{className:`band-head`,role:`presentation`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,children:e}),(0,E.jsx)(`span`,{className:`mono dim`,children:t})]}),$=W.filter(q),Ge=(Q?$.length:0)+(Fe?P.reduce((e,t)=>e+t.rules.filter(q).length,0):0);return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(s,{eyebrow:I?[t?.theme,I.footprint&&`${I.footprint} footprint`,I.host,I.scope].filter(Boolean).join(` · `):null,title:`Constitution`,sub:`What the agent follows on every turn. Ranked: a lower rank may tighten a higher one, never repeal it. Open any rule to read its canonical text.`,actions:(0,E.jsx)(S,{className:`law-filter`,value:ue,onChange:de,placeholder:`Filter rules`,label:`Filter rules`})}),(0,E.jsxs)(`section`,{className:`ladder`,"aria-labelledby":`ladder-h`,children:[(0,E.jsx)(`h2`,{id:`ladder-h`,className:`eyebrow`,children:`Precedence`}),(0,E.jsx)(ae,{tiers:Me,current:O,onPick:k}),(0,E.jsx)(`div`,{className:`ladder-tail`,children:v.map((e,t)=>(0,E.jsxs)(`span`,{className:`ladder-low`,children:[(0,E.jsxs)(`span`,{className:`mono tier-k`,children:[`RANK `,y.length+t+1]}),` `,e.label,` —`,` `,e.against]},e.source))})]}),(0,E.jsxs)(`div`,{className:`split`,children:[(0,E.jsxs)(`section`,{className:`panel flush law-wrap${L?` with-toggle`:``}`,"aria-label":`Rules`,children:[U.length>0&&(0,E.jsxs)(E.Fragment,{children:[We(H.ontology,`ontology/universal.md`),U.map(e=>(0,E.jsx)(re,{law:e,rev:l,isOpen:M===e.addr,onToggle:()=>me(e.addr)},e.addr))]}),(0,E.jsxs)(`div`,{className:`law-toolbar`,children:[(0,E.jsx)(u,{"aria-label":`Show`,children:Pe.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:O===e?`on`:``,"aria-pressed":O===e,onClick:()=>k(e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))}),(0,E.jsx)(u,{"aria-label":`Narrow`,children:Le.map(([e,t,n])=>(0,E.jsxs)(`button`,{type:`button`,className:A===e?`on`:``,"aria-pressed":A===e,onClick:()=>j(A===e?`all`:e),children:[t,` `,(0,E.jsx)(`span`,{className:`mono`,children:n})]},e))})]}),(0,E.jsxs)(`div`,{className:`law-rowhead`,children:[(0,E.jsx)(`span`,{children:`No.`}),(0,E.jsx)(`span`,{children:`Rule`}),(0,E.jsx)(`span`,{children:`Latin name`}),(0,E.jsx)(`span`,{children:`Status`}),(0,E.jsx)(`span`,{children:`Enforced by`})]}),Q&&$.length>0&&(0,E.jsxs)(E.Fragment,{children:[We(H.laws,`laws/universal.md`),$.map(e=>(0,E.jsx)(re,{law:De(e),rev:l,isOpen:M===e.addr,onToggle:()=>me(e.addr),toggleCol:!L||e.retired?null:m[e.addr]?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${F(e.addr)?` on`:``}`,role:`switch`,"aria-checked":F(e.addr),"aria-label":m[e.addr].label,onClick:()=>we(e.addr)}):(0,E.jsx)(`span`,{className:`no-gate`,title:`Enforced by its text alone: no hook gate`,children:`no gate`})},e.addr))]}),Fe&&P.map(e=>{let t=e.rules.filter(q);if(!t.length)return null;let n=ze(e.pack),r=e.rules.filter(e=>B(e.addr)).length;return(0,E.jsxs)(`div`,{className:`pack-wrap${be(e)?``:` pack-off`}`,children:[(0,E.jsxs)(`div`,{className:`band-head pack-head`,children:[(0,E.jsx)(`h2`,{className:`tier-h`,style:{"--cc":te[e.pack]},children:(0,E.jsx)(`button`,{type:`button`,className:`pack-fold`,"aria-expanded":!n,onClick:()=>Be(e.pack),children:e.title})}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.pack}),(0,E.jsx)(`span`,{className:`pack-desc dim`,children:e.desc}),(0,E.jsx)(`span`,{className:`pack-fill`,children:(0,E.jsx)(o,{value:r,max:e.rules.length,label:`${e.title} rules switched on`})}),(0,E.jsx)(`span`,{className:`pack-state mono`,children:xe(e)})]}),!e.active&&!L&&(0,E.jsxs)(`div`,{className:`pack-enable`,children:[`$ geneseed-build --doctrines`,` `,P.filter(t=>t.active||t.pack===e.pack).map(e=>e.pack).join(`,`),Ce.length>0&&` --exclude-rules ${Ce.join(`,`)}`]}),!n&&t.map(e=>(0,E.jsx)(re,{law:De(Se(e)),rev:l,isOpen:M===e.addr,onToggle:()=>me(e.addr),toggleCol:L?(0,E.jsx)(`button`,{type:`button`,className:`sw-toggle${B(e.addr)?` on`:``}`,role:`switch`,"aria-checked":B(e.addr),"aria-label":`${e.name} rule`,onClick:()=>ye(e.addr)}):null},e.addr))]},e.pack)}),Ge===0&&(0,E.jsx)(ne,{title:K||A!==`all`?`No matching rules`:`Nothing in this tier`,children:K?(0,E.jsxs)(E.Fragment,{children:[`Nothing matches “`,ue.trim(),`”.`]}):A===`all`?(0,E.jsx)(E.Fragment,{children:`This install predates the tier.`}):(0,E.jsxs)(E.Fragment,{children:[`No `,A,` rule in this tier.`]})})]}),(0,E.jsxs)(`aside`,{className:`aside-stack`,children:[(0,E.jsx)(se,{packs:P,sel:R,canApply:L,install:I,gateArmed:ve}),(0,E.jsx)(oe,{gates:n?.gates,byAddr:Ne,onJump:Ee,disarmed:e=>!!m[e]&&!F(e)})]})]}),He&&(0,E.jsxs)(`div`,{className:`law-bar`,role:`region`,"aria-label":`Unapplied changes`,children:[(0,E.jsxs)(`span`,{className:`law-bar-n`,children:[Ve.length,` unapplied change`,Ve.length===1?``:`s`]}),(0,E.jsx)(`span`,{className:`law-bar-list`,children:Ve.map(e=>(0,E.jsxs)(`span`,{className:`badge ${e.plus?`ok`:`warn`}`,children:[e.plus?`+`:`−`,` `,e.no,` `,e.name]},e.addr))}),(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:Ue,children:`Review changes`}),(0,E.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>{j(`all`),R.revert()},children:`Revert`}),(0,E.jsxs)(`button`,{type:`button`,className:`btn`,onClick:R.applyPacks,children:[`Apply (`,R.pickedRules.length,`/`,V.length,` rules)`]})]})]})}export{le as default};