geneseed 4.25.1 → 4.27.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 (97) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/DESIGN.md +6 -5
  3. package/README.md +10 -6
  4. package/SHIPPED.md +4 -3
  5. package/adapters/bob/README.md +26 -4
  6. package/adapters/claude-code/README.md +6 -2
  7. package/adapters/claude-code/skills/geneseed/SKILL.md +2 -2
  8. package/adapters/opencode/HOW-OPENCODE-LOADS.md +4 -2
  9. package/adapters/opencode/README.md +5 -2
  10. package/adapters/opencode/plugins/geneseed-activity.js +331 -31
  11. package/adapters/opencode/plugins/geneseed-guard.js +79 -4
  12. package/bin/geneseed-hook.mjs +13 -7
  13. package/docs/concepts/enforcement-table.md +12 -0
  14. package/docs/concepts/exclusions.md +15 -1
  15. package/docs/concepts/hook-gates.md +3 -2
  16. package/docs/concepts/hooks.md +12 -1
  17. package/docs/concepts/host-matrix.md +2 -2
  18. package/docs/concepts/ownership.md +79 -0
  19. package/docs/concepts/rules.md +1 -1
  20. package/docs/guides/set-up-ownership.md +77 -0
  21. package/docs/reference/glossary.md +1 -1
  22. package/docs/reference/opencode-plugins.md +1 -1
  23. package/docs/reference/plugin-activity.md +4 -2
  24. package/docs/reference/plugin-guard.md +1 -0
  25. package/docs/reference/troubleshoot-doctor.md +2 -2
  26. package/docs/understand/enforced-vs-asked.md +3 -2
  27. package/docs/understand/machine-bob.md +1 -1
  28. package/docs/understand/machine-claude.md +1 -1
  29. package/docs/understand/machine-opencode.md +2 -2
  30. package/docs/web-ui.md +21 -2
  31. package/harness.config.json +1 -1
  32. package/js/README.md +1 -0
  33. package/js/build/render.mjs +1 -1
  34. package/js/build/source.mjs +5 -1
  35. package/js/cli-table.json +46 -1
  36. package/js/hosts/activity.mjs +175 -30
  37. package/js/hosts/hooks-prims.mjs +2 -2
  38. package/js/hosts/hooks.mjs +45 -5
  39. package/js/hosts/ownership-gate.mjs +105 -0
  40. package/js/hosts/settings.mjs +14 -4
  41. package/js/inspect/cost.mjs +1 -1
  42. package/js/inspect/inventory.mjs +1 -1
  43. package/js/inspect/status.mjs +1 -1
  44. package/js/loop/registry.mjs +17 -0
  45. package/js/web/activity.mjs +116 -5
  46. package/package.json +1 -1
  47. package/registry.json +7 -0
  48. package/src/AGENT.md.tmpl +5 -0
  49. package/src/agents/developer.md +7 -1
  50. package/src/modes/foreman.md +4 -1
  51. package/src/ontology/universal.md +19 -0
  52. package/src/skills/_checkpoints.md +15 -0
  53. package/src/skills/develop.md +4 -0
  54. package/src/skills/document-project.md +2 -1
  55. package/src/skills/learn-mode.md +13 -17
  56. package/src/skills/ownership.md +139 -0
  57. package/src/skills/pipeline.md +1 -1
  58. package/themes/README.md +2 -2
  59. package/themes/_TEMPLATE.json +1 -0
  60. package/themes/biker.json +1 -0
  61. package/themes/commentator.json +1 -0
  62. package/themes/cyberpunk.json +1 -0
  63. package/themes/gamer.json +1 -0
  64. package/themes/imperial.json +1 -0
  65. package/themes/joker.json +1 -0
  66. package/themes/marvin.json +1 -0
  67. package/themes/mean.json +1 -0
  68. package/themes/military.json +1 -0
  69. package/themes/neutral.json +1 -0
  70. package/themes/pirate.json +1 -0
  71. package/themes/sports.json +1 -0
  72. package/themes/verstappen.json +1 -0
  73. package/themes/wizard.json +1 -0
  74. package/web/dist/assets/Activity-DfETiyWm.js +1 -0
  75. package/web/dist/assets/ActivityDetail-CnP3GPAN.js +1 -0
  76. package/web/dist/assets/Bonsai-CN4rRAHc.js +1 -0
  77. package/web/dist/assets/{CopyButton-B6myFV7a.js → CopyButton-CRAUXSG7.js} +1 -1
  78. package/web/dist/assets/{Dashboard-DEQCBcUW.js → Dashboard-CaqOqtkG.js} +2 -2
  79. package/web/dist/assets/Docs-BFxyAVdN.js +5 -0
  80. package/web/dist/assets/{GreenhouseView-CV1squu6.js → GreenhouseView-19roNb5W.js} +1 -1
  81. package/web/dist/assets/{Installs-C4TQVZ_-.js → Installs-BSoQN7w7.js} +3 -3
  82. package/web/dist/assets/{JournalView-CpXsT_JD.js → JournalView-BgU2ybaq.js} +1 -1
  83. package/web/dist/assets/{KitApply-fYh_YjQA.js → KitApply-Ckc0P5kt.js} +1 -1
  84. package/web/dist/assets/{Kits-BMuGOiTg.js → Kits-BZqWGWMu.js} +1 -1
  85. package/web/dist/assets/Laws-CnUWiNIx.js +3 -0
  86. package/web/dist/assets/{Library-DiZqRFL5.js → Library-rYO8owx_.js} +2 -2
  87. package/web/dist/assets/{Loops-DkwWkdPc.js → Loops-CljFhhQV.js} +2 -2
  88. package/web/dist/assets/{OperatorHudView-CLmq0lNh.js → OperatorHudView-xs7SCwCe.js} +1 -1
  89. package/web/dist/assets/{Personal-C70XacpA.js → Personal-CMPwtl36.js} +2 -2
  90. package/web/dist/assets/{Tabs-ChFhPGP6.js → Tabs-CEfSUVQp.js} +1 -1
  91. package/web/dist/assets/{index-DxCqnFPy.js → index-FLVXXvV3.js} +2 -2
  92. package/web/dist/assets/{index-Cqqs-PbJ.css → index-XTGBLKQr.css} +1 -1
  93. package/web/dist/index.html +2 -2
  94. package/web/dist/assets/Activity-BdMwEnFN.js +0 -1
  95. package/web/dist/assets/ActivityDetail-BgUjDuxO.js +0 -1
  96. package/web/dist/assets/Docs-ChBYcQbT.js +0 -5
  97. package/web/dist/assets/Laws-ndHW7Onu.js +0 -3
@@ -0,0 +1,139 @@
1
+ # {{SKILL}}: ownership
2
+
3
+ > {{DESC_OWNERSHIP}}
4
+
5
+ {{CREDIT:vibe-wise:skills/learn/behavior.md}}
6
+
7
+ **Trigger:** the developer must stay the owner of production code: they decide each part and
8
+ can answer for every line that lands. Phrases: "ownership", "let me decide each file", "I must
9
+ answer for this code", "set up AGENTS.md for the team". Your harness file also sends you here in
10
+ an **application repo** — a git root holding a build manifest (`package.json`, `pom.xml`,
11
+ `build.gradle*`, `pyproject.toml`, `go.mod`, `Cargo.toml`, `*.csproj`, `composer.json`,
12
+ `Gemfile`) — when its root `AGENTS.md` has `## Ownership` with `mode: on`, and before the first
13
+ write when it has no such section. To learn while building, use the
14
+ [learn-mode {{SKILL}}](learn-mode.md); it always comes first (see below).
15
+
16
+ The developer owns the decisions. You propose options, interfaces and placements, and write what
17
+ they approve. An approval without understanding is not ownership.
18
+
19
+ ## Team config — `## Ownership` in the root `AGENTS.md`
20
+
21
+ Committed with the repo, outside any `<!-- BEGIN GENESEED -->` … `<!-- END GENESEED -->` block
22
+ (never write inside that block):
23
+
24
+ ```markdown
25
+ ## Ownership
26
+
27
+ mode: on # on | off — off opts this repo out
28
+ granularity: file # feature | file | function — the team default
29
+ sensitive: # always a checkpoint, whatever the granularity
30
+ - src/main/java/**/payment/**
31
+ - src/main/resources/db/migration/**
32
+ ```
33
+
34
+ The rest of `AGENTS.md` holds the project's coding rules: conventions, commands, project rules.
35
+ They never go in `user-rules.md`, which is for agent behaviour only.
36
+
37
+ ## Personal state — `.geneseed/ownership.md`
38
+
39
+ ```markdown
40
+ Granularity: team # or a level finer than the team default
41
+ ## Pending
42
+ <the one checkpoint awaiting the developer, or "none">
43
+ ## Decisions
44
+ - <date> <decision the developer took, with their reason>
45
+ ```
46
+
47
+ A personal override may only be finer than the team default. A coarser one needs the developer's
48
+ explicit yes, logged under `## Decisions`.
49
+
50
+ <!-- INCLUDE: skills/_checkpoints.md -->
51
+
52
+ Here, interface and sensitive-zone checkpoints are mandatory. Log under `## Decisions` only forks,
53
+ interfaces, sensitive-zone changes and granularity changes — not routine steps.
54
+
55
+ ## Setup
56
+ Run it when the repo has no `## Ownership` section, or when the developer asks. A hand-written
57
+ `AGENTS.md` without the section gets one lighter question first: "add the Ownership section?".
58
+ 1. **Extract.** Use the method of the `AGENTS.md` step of the
59
+ [document-project {{SKILL}}](document-project.md): read the code and propose the conventions
60
+ found — naming, layers, test patterns, build commands. Write nothing yet.
61
+ 2. **Kit.** If the stack matches a kit (`spring-boot`, `react`), propose it.
62
+ 3. **Interview.** About five questions, one at a time, each with a recommended answer: confirm or
63
+ correct the conventions; ownership on for this repo; the default granularity; the sensitive
64
+ zones (for example `payment/`, migrations, security config); free-form project rules.
65
+ 4. **Write** — the only write of the setup: `AGENTS.md` (at most ~60 lines, this section
66
+ included) and `.geneseed/ownership.md`. Show the diff. Commit only on request.
67
+ 5. **Check how diffs reach the developer.** Read the permission mode from the host's settings;
68
+ when the live mode cannot be seen there, ask the developer. If edits are auto-accepted (bypass,
69
+ accept-edits), warn that no native diff will stop for them; if they keep it, use the compact
70
+ diff (see *Each checkpoint*). On OpenCode, propose `permission.edit: "ask"` in the project
71
+ `opencode.json`.
72
+
73
+ "Proceed without" skips the setup for this session only; propose it again in the next one.
74
+
75
+ ## Granularity
76
+ - `feature` — one checkpoint on the plan; then each file is announced as routine, and its Edit is
77
+ the approval.
78
+ - `file` — the default: no plan checkpoint; one checkpoint per file, announced or asked (see
79
+ *Each checkpoint*).
80
+ - `function` — the signature, then the body.
81
+
82
+ Whatever the level, an **interface is always a checkpoint** — a public signature, an API
83
+ contract, a DB schema, a new dependency — and so is every change in a `sensitive:` zone. The
84
+ developer can change the level for the current task at any moment ("go finer here", "do the rest
85
+ in one go"); the file keeps its default.
86
+
87
+ **Adapt to complexity, asymmetrically.** Weigh these signals with judgement, no metric tool:
88
+ business branching, transactions, concurrency, security, a non-obvious algorithm, an effect on
89
+ other modules, a performance trap, deep nesting, long methods, duplication.
90
+ - **Finer** — decide alone, and add 3–6 lines on why the part is complex and what to watch for
91
+ (the detail on request).
92
+ - **Coarser** — propose it ("these 6 DTOs and 2 mappers are trivial — one batch?") and wait for
93
+ the developer's yes. Never coarsen silently.
94
+
95
+ ## Each checkpoint
96
+ Announce, do not ask, except at a real fork.
97
+ - **Routine** (follows the plan and the conventions, no choice) — announce it in 1–3 lines. The
98
+ native Edit is the approval: accepting it answers the checkpoint, refusing it returns to it.
99
+ The Edit prompt is the wait, so write `## Pending` only for a step you ask about.
100
+ - **Real fork** (two or more credible options, an interface, a sensitive zone) — ask, with the
101
+ recommended option first.
102
+ - **Complex** (the signals above) — announce it, plus a 3–6 line explanation.
103
+
104
+ The chat carries what / where / why in 5–10 lines: `file:line`, the changed signature or
105
+ interface, the options at a fork — no code. The native Edit carries the diff. When edits are
106
+ auto-accepted, show a compact diff in the chat first (changed hunks only, ±2 lines); that is an
107
+ asked step: write `## Pending` and wait for the developer's reply.
108
+
109
+ Guardrails:
110
+ 1. Never ask what the code, `AGENTS.md` or an earlier decision of the session already answers.
111
+ 2. Group the decisions of one step into one message.
112
+ 3. Always recommend, so "ok" is an answer.
113
+ 4. "Carry on" switches the rest of the task to routine. "Skip" and "fewer checkpoints" lower the
114
+ cadence the same way. Neither removes a mandatory checkpoint.
115
+
116
+ ## Delegation
117
+ The parent holds every checkpoint. A background worker — a Foreman developer, a pipeline crew, a
118
+ parallel agent — receives only decisions already approved. It never runs the setup and never
119
+ treats its own diff as approved. On a choice no approved decision covers, it stops and returns
120
+ `blocked: decision needed` with the options.
121
+
122
+ ## Refactor in a named zone
123
+ When the developer names a zone (a file, a class, a package), stay inside it. With the signals
124
+ above, propose 2–4 points where a refactor pays (`file:line` and why); they pick, then follow the
125
+ [refactor {{SKILL}}](refactor.md). No repo-wide scan. With no zone named, refactor runs unchanged.
126
+
127
+ ## learn-mode comes first
128
+ While `.geneseed/learn.md` says `Learning mode: active`, learn-mode drives the flow: no project
129
+ can forbid a developer from learning. The team rules in `AGENTS.md` — conventions, and interfaces
130
+ and sensitive zones as checkpoints — still apply on top.
131
+
132
+ ## Done when
133
+ - The root `AGENTS.md` has `## Ownership` outside the Geneseed block, or the developer chose
134
+ "proceed without" or `mode: off`; every interface and sensitive-zone change got its own
135
+ checkpoint; no code landed without an answered checkpoint or an accepted Edit; each fork,
136
+ interface, sensitive-zone change and granularity change is logged in `.geneseed/ownership.md`;
137
+ and the developer can say, for each change, what changed, where and why.
138
+
139
+ <!-- INCLUDE: skills/_self-improvement.md -->
@@ -26,7 +26,7 @@ The minimum roster per task type. The crew lead chooses the crew from the whole
26
26
  ## Procedure
27
27
 
28
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
- 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.
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. Set no timer to watch a crew: where the host re-invokes you when a background agent ends (Claude Code), that notification is the watch; check every crew still out 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.
32
32
  5. **The dev↔tester loop:** the developer implements, the tester validates — runs the tests and lint, produces raw logs. On failure, the findings go back to the developer — two repair rounds at most, then one fresh developer (a higher model tier where the host offers one) carrying the tester's findings ({{DOCTRINE:bound-the-loop}}); if that fails too, stop, do not merge, and report the failure with the branch left in place for inspection. A conflict or ambiguity between the plan, the findings and the code is yours to decide: decide it, record `Ruling: <choice> — <why> — <cost if wrong>` in the worklog, and continue. Stop only for what {{LAW:echo-the-intent}}, {{LAW:deletion-is-deliberate}} or {{DOCTRINE:consent-before-push}} names; every ruling goes in the final report ({{DOCTRINE:declare-the-judgment-calls}}). When the plan names a `Spec:`, the analyst reads it once; the spec outranks the plan.
package/themes/README.md CHANGED
@@ -72,8 +72,8 @@ English); the others range from `imperial` (Warhammer 40k) to community voices.
72
72
  build time and falls back to `secondary`, with a warning, rather than ever
73
73
  reaching emitted frontmatter.
74
74
 
75
- Folder names, file paths, Rule *numerals*, the four Ontology section names
76
- (Telos, Evidence, Decisions, Conduct) and the pack *slugs* used in citations
75
+ Folder names, file paths, Rule *numerals*, the five Ontology section names
76
+ (Telos, Evidence, Decisions, Ownership, Conduct) and the pack *slugs* used in citations
77
77
  (`craft`, `rigor`, `ops`, `process`) are **never** themed — they live in the
78
78
  `STRUCTURE` map in the generator, laid over every render, so tooling never breaks.
79
79
  `PACK_*` themes how a pack is *named* in prose, never how it is *addressed*.
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "<one-line description: teach toward a result — crash course, decode confusing material, or a day-by-day path to a deadline>",
68
68
  "DESC_QUIZ": "<one-line description: test what the user knows instead of explaining — drill, explain-it-back check, or mastery claim stress-tested>",
69
69
  "DESC_LEARN_MODE": "<one-line description: learn while building — the user designs at checkpoints, the agent writes the agreed code, state kept per project>",
70
+ "DESC_OWNERSHIP": "<one-line description: keep the developer the owner of production code — they decide each part at checkpoints of a granularity they set, team rules in the root AGENTS.md>",
70
71
  "DESC_SECURITY_AUDIT": "<one-line description: review a change for how it would be attacked and what it leaks, ending in ship / fix / block>",
71
72
  "DESC_SKILL_FORGE": "<one-line description: author, sharpen, merge, or retire a skill — reuse first, trigger tested, every satellite registered>",
72
73
  "DESC_WORKTREE": "<one-line description: isolate a task in its own git worktree from a clean base, integrate through the normal gate, remove when merged>",
package/themes/biker.json CHANGED
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Get a rider road-ready — a crash course from never-ridden to rolling, a confusing manual decoded till it clicks, or a day-by-day route to a deadline.",
68
68
  "DESC_QUIZ": "Test what they've actually got instead of explaining it — drill a move to reflex, make them talk you through it, or call the bluff on a claimed skill — with a straight readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Learn the build while riding it — they call the line at each checkpoint, you lay down the code they agreed to, and the mode sticks to the project between rides.",
70
+ "DESC_OWNERSHIP": "Keep the rider in charge of the production build — they call each part at checkpoints, as close as they choose to ride, and the club's rules sit in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Ride the change like someone trying to steal it — where it can be forced, what it leaks, what it drags in from outside — and call it: ship, fix, or park it.",
71
72
  "DESC_SKILL_FORGE": "Forge, tune, merge, or scrap a move — reuse what's in the toolbox first, nail the trigger before the steps, test it against the neighbouring moves, register every bolt, doctor green.",
72
73
  "DESC_WORKTREE": "Wrench on a task in its own bay — a fresh worktree off a clean base, nothing shared with the bike already on the lift, back through the normal gate, bay cleared when it's merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Bring a rookie up to speed — a crash course to race-ready, a confusing regulation decoded until it clicks, or a day-by-day programme to the deadline.",
68
68
  "DESC_QUIZ": "Test the driver instead of briefing them — a drill to reflex, an explain-it-back debrief, or a claimed mastery stress-tested — with a frank readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Put the driver in charge of the race plan — they call the strategy at each checkpoint, you execute the agreed laps, and the mode holds for the project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the driver in charge of the production code — they make the call on each part at checkpoints, at the granularity they set, and the team's rulebook sits in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Scrutineer a change for how it would be attacked and what it leaks — trust boundaries, the classic vulnerability classes, secrets, the supply chain — and rule: ship, fix, or black-flag.",
71
72
  "DESC_SKILL_FORGE": "Author, sharpen, merge, or retire a manoeuvre — reuse first, the trigger before the steps, tested against its neighbours, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Run a task in its own garage — a fresh worktree off a clean base, nothing shared with the car already being worked on, back through the normal gate, garage cleared once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Bring a user online — a crash course from zero to operational, confusing data decoded until it clicks, or a day-by-day route to a deadline.",
68
68
  "DESC_QUIZ": "Probe what the user actually knows instead of explaining — drill to reflex, make them run it back, or stress-test a claimed mastery — with a cold readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Jack the user into the build loop — they design at each checkpoint, you write the agreed code, and the mode persists per project across reboots.",
70
+ "DESC_OWNERSHIP": "Keep the runner the owner of production code — they sign off each part at checkpoints of the granularity they set, and the crew's protocols live in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Run the change like ICE would — where it can be breached, what it leaks, what it pulls in from outside the perimeter — and rule: ship, patch, or lock it down.",
71
72
  "DESC_SKILL_FORGE": "Compile, patch, merge, or decommission a program — reuse the library first, trigger before routine, tested against neighbouring programs, every hook registered, diagnostics green.",
72
73
  "DESC_WORKTREE": "Jack a task into its own sandbox — a fresh worktree off a clean base, nothing shared with the live rig, back through the normal gate, sandbox wiped once merged.",
package/themes/gamer.json CHANGED
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Level the player up toward a result — a crash course from tutorial to playable, a confusing mechanic decoded until it clicks, or a day-by-day grind to a deadline.",
68
68
  "DESC_QUIZ": "Test the player instead of explaining — a drill to reflex, an explain-it-back check, or a claimed mastery stress-tested — with an honest readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Turn on tutorial-while-you-play — the player designs at each checkpoint, you write the agreed code, and the save persists per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the player the owner of production code — they make each call at checkpoints of the difficulty the team sets, and the team's rules are saved in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Play the change like a griefer would — where it can be exploited, what it leaks, what it pulls in from outside — and call it: ship, patch, or block.",
71
72
  "DESC_SKILL_FORGE": "Craft, tune, merge, or retire a combo — reuse the inventory first, trigger before inputs, tested against neighbouring combos, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Run a task in its own save slot — a fresh worktree off a clean base, nothing shared with the run in progress, back through the normal gate, slot deleted once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Instruct the supplicant toward a result — a crash course from ignorance to function, a confusing text decoded until it clicks, or a day-by-day path to the appointed hour.",
68
68
  "DESC_QUIZ": "Test what the supplicant knows rather than teach it — a drill to reflex, a recitation caught on every stumble, or a claimed mastery put to the ordeal — with an unsparing readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Make the supplicant the architect of the work — they reason out each design at its checkpoint, you forge only what they sanctioned, and the rite endures per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the artisan sovereign over the code they must answer for — they sanction each part at checkpoints of the granularity they decree, and the chapter's edicts stand in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Scrutinise a change as the enemy would — where it may be breached, what it leaks, what it admits from beyond the walls — and pronounce: ship, purge, or bar it.",
71
72
  "DESC_SKILL_FORGE": "Forge, sharpen, merge, or retire a rite — reuse the canon first, the trigger before the steps, tested against its neighbouring rites, every satellite inscribed, doctor green.",
72
73
  "DESC_WORKTREE": "Wall a task off in its own cell — a fresh worktree from a clean base, nothing shared with the work already at the bench, returned through the proper gate, the cell razed once merged.",
package/themes/joker.json CHANGED
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Get someone functional — a crash course from open-mic nerves to a tight five, confusing material decoded until it clicks, or a day-by-day path to the deadline.",
68
68
  "DESC_QUIZ": "Test what they actually know instead of explaining — drill it to reflex, make them do the bit back, or call the bluff on a claimed mastery — with an honest readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Hand them the pen for the punchlines — they design at each checkpoint, you write only the agreed code, and the act keeps running per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the developer the one who answers for the code — they approve each part at checkpoints, as fine as they like, and the house rules live in the root AGENTS.md. Nobody blames the typist.",
70
71
  "DESC_SECURITY_AUDIT": "Heckle the change before the room does — where it can be attacked, what it leaks, what it drags in from outside — and call it: ship, fix, or pull it.",
71
72
  "DESC_SKILL_FORGE": "Write, tighten, merge, or retire a bit — reuse the notebook first, the trigger before the steps, tested against neighbouring bits, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Work a task in its own green room — a fresh worktree off a clean base, nothing shared with the set in progress, back through the normal gate, room cleared once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Teach the user toward a result — a crash course from nothing to functional, confusing material decoded until it clicks, or a day-by-day path to a deadline. They may even retain some of it.",
68
68
  "DESC_QUIZ": "Test what the user knows instead of explaining it — a drill to reflex, an explain-it-back check, or a claimed mastery stress-tested — with a readout of the gaps. There are always gaps.",
69
69
  "DESC_LEARN_MODE": "Let the user design the thing at each checkpoint while you write only the agreed code, so they understand it afterwards. The mode persists per project. Someone has to understand it.",
70
+ "DESC_OWNERSHIP": "Keep the developer the owner of production code. Someone has to answer for it. They decide each part at the granularity the team sets, in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Review a change for how it would be attacked and what it leaks — trust boundaries, the usual vulnerability classes, secrets, the supply chain — ending in ship, fix, or block. Usually fix.",
71
72
  "DESC_SKILL_FORGE": "Author, sharpen, merge, or retire a routine — reuse first, trigger before procedure, tested against its neighbours, every satellite registered, doctor green. Briefly.",
72
73
  "DESC_WORKTREE": "Isolate a task in its own git worktree from a clean base — look before branching, work only there, integrate through the normal gate, remove it once merged. Something will still conflict.",
package/themes/mean.json CHANGED
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Teach the user toward a result — a crash course from clueless to functional, confusing material decoded until it finally clicks, or a day-by-day path to a deadline they'll probably miss.",
68
68
  "DESC_QUIZ": "Test what the user actually knows instead of explaining it again — drill to reflex, make them explain it back, or call the bluff on a claimed mastery — with a blunt readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Make the user actually design what gets built — they reason it out at each checkpoint, you write only the agreed code, and the mode persists per project across sessions.",
70
+ "DESC_OWNERSHIP": "Make the developer actually own the production code — they decide each part at checkpoints of the granularity they set, and the team's rules sit in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Review a change the way someone hostile would — where it can be attacked, what it leaks, what it drags in from outside — and call it: ship, fix, or block.",
71
72
  "DESC_SKILL_FORGE": "Author, sharpen, merge, or retire a drill — reuse first, trigger before procedure, tested against its neighbours so it doesn't misfire, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Isolate a task in its own git worktree from a clean base — look before branching, work only there, integrate through the normal gate, remove it when merged. Stop touching other people's trees.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Train the recruit toward a result — a crash course to operational, a confusing manual decoded until it clicks, or a day-by-day programme to the deadline.",
68
68
  "DESC_QUIZ": "Test the recruit instead of briefing them — a drill to reflex, an explain-it-back debrief, or a claimed proficiency stress-tested — with a frank readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Put the recruit in command of the plan — they reason out each design at its checkpoint, you execute only the approved code, and the mode holds per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the officer in command of production code — they approve each part at checkpoints of the granularity they set, and the unit's standing orders sit in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Assess a change as the adversary would — where it can be breached, what it leaks, what it admits from outside the perimeter — and rule: ship, fix, or deny.",
71
72
  "DESC_SKILL_FORGE": "Author, sharpen, merge, or retire an SOP — reuse first, trigger before procedure, tested against neighbouring SOPs, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Isolate a task in its own worktree from a clean base — recon before branching, work only there, integrate through the normal gate, strike it once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Teach the user toward a result — a crash course from zero to functional, confusing material decoded until it clicks, or a day-by-day path to a deadline.",
68
68
  "DESC_QUIZ": "Test what the user knows instead of explaining it — a drill to reflex, an explain-it-back check, or a mastery claim stress-tested — with a blunt readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Learn while building — the user designs at each checkpoint, the agent writes only the agreed code and explains it, and the mode persists per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the developer the owner of production code — they decide each part at checkpoints of the granularity they set, and the team's rules live in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Review a change for how it would be attacked and what it leaks — trust boundaries, the classic vulnerability classes, secrets, the supply chain — ending in a ship / fix / block verdict.",
71
72
  "DESC_SKILL_FORGE": "Author, sharpen, merge, or retire a skill — reuse first, trigger before procedure, tested against its neighbours, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Isolate a task in its own git worktree from a clean base — look before branching, work only there, integrate through the normal gate, remove it when merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Get a landlubber seaworthy — a crash course from dock to deck, a confusing chart decoded till it clicks, or a day-by-day course to the deadline.",
68
68
  "DESC_QUIZ": "Test what the crew truly knows instead of telling them — drill a knack to reflex, make them recite it back, or call the bluff on a claimed mastery — with a plain readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Let the crew chart the course — they reason out each design at its checkpoint, you build only what they agreed, and the mode holds per project across voyages.",
70
+ "DESC_OWNERSHIP": "Keep the captain master of the production code — they approve each part at checkpoints, as close as they choose to steer, and the ship's articles hang in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Board the change as a raider would — where she can be breached, what she leaks, what she takes aboard from foreign ports — and rule: sail, mend, or scuttle.",
71
72
  "DESC_SKILL_FORGE": "Forge, sharpen, merge, or retire a knack — reuse the ship's stores first, the trigger before the steps, tested against neighbouring knacks, every satellite logged, doctor green.",
72
73
  "DESC_WORKTREE": "Work a task in its own hold — a fresh worktree off a clean base, nothing shared with the cargo already stowed, back through the normal gate, hold cleared once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Coach the player toward a result — a crash course from bench to game-ready, a confusing playbook decoded until it clicks, or a day-by-day training plan to the deadline.",
68
68
  "DESC_QUIZ": "Test the player instead of coaching — a drill to reflex, an explain-it-back film session, or a claimed mastery stress-tested — with a straight readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Put the player on the playbook — they call each design at its checkpoint, you run only the agreed play, and the mode holds per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the coach in charge of the production code — they call each part at checkpoints of the granularity they set, and the team's playbook sits in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Scout the change like the opposing team would — where it can be attacked, what it leaks, what it pulls in from outside — and call it: play it, fix it, or bench it.",
71
72
  "DESC_SKILL_FORGE": "Draw up, sharpen, merge, or retire a play — reuse the playbook first, trigger before the steps, tested against neighbouring plays, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Run a task on its own practice field — a fresh worktree off a clean base, nothing shared with the game in progress, back through the normal gate, field cleared once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Get the user up to speed — a crash course from zero to functional, confusing material decoded until it clicks, or a day-by-day programme to the deadline. No wasted laps.",
68
68
  "DESC_QUIZ": "Test what they actually know instead of explaining it — a drill to reflex, an explain-it-back debrief, or a claimed mastery stress-tested — with a straight readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Put the driver on strategy — they make each design call at its checkpoint, you execute only the agreed code, and the mode holds per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the driver in charge of the production code — they make every call at checkpoints of the granularity they set, and the team's rules sit in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Attack the change the way a rival would — where it can be forced, what it leaks, what it brings in from outside — and call it: ship, fix, or block.",
71
72
  "DESC_SKILL_FORGE": "Build, tune, merge, or retire a setup — reuse first, trigger before procedure, tested against its neighbours, every satellite registered, doctor green.",
72
73
  "DESC_WORKTREE": "Run a task in its own garage — a fresh worktree off a clean base, nothing shared with the car already on the stand, back through the normal gate, garage cleared once merged.",
@@ -67,6 +67,7 @@
67
67
  "DESC_TEACH": "Tutor the apprentice toward a result — a crash course from novice to working caster, a confusing grimoire decoded until it clicks, or a day-by-day path to the appointed day.",
68
68
  "DESC_QUIZ": "Test the apprentice rather than lecture — a drill to reflex, an explain-it-back examination, or a claimed mastery put to trial — with an unvarnished readout of the gaps.",
69
69
  "DESC_LEARN_MODE": "Take on an apprentice at the forge — they reason out each design at its checkpoint, you cast only the agreed code, and the apprenticeship persists per project across sessions.",
70
+ "DESC_OWNERSHIP": "Keep the mage the keeper of their own code — they bless each part at checkpoints of the granularity they set, and the guild's laws are inscribed in the root AGENTS.md.",
70
71
  "DESC_SECURITY_AUDIT": "Scry a change as a hostile caster would — where the wards can be breached, what it leaks, what it summons from beyond the circle — and pronounce: ship, mend, or bind.",
71
72
  "DESC_SKILL_FORGE": "Inscribe, sharpen, merge, or retire a spell — reuse the spellbook first, the trigger before the incantation, tested against neighbouring spells, every satellite recorded, doctor green.",
72
73
  "DESC_WORKTREE": "Work a task in its own warded circle — a fresh worktree off a clean base, nothing shared with the ritual in progress, back through the normal gate, circle dispelled once merged.",
@@ -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,D as s,E as c,I as l,J as u,M as d,N as f,P as p,T as m,W as ee,Y as te,Z as ne,dt as h,j as g,k as re,ot as _,pt as v,u as y,w as b}from"./index-FLVXXvV3.js";import{t as x}from"./EmptyState-1sPNleqv.js";import{a as S,c as C,d as w,i as T,l as E,n as D,o as O,r as k,s as A,t as j,u as M}from"./Bonsai-CN4rRAHc.js";import{t as ie}from"./usePoll-bDFN-Hr6.js";var N=e(t(),1),P=n(),F=4,I=56*F,L=24,R=165,z=188,B=e=>{let t=O(e);return t==null?null:Math.round(t*100)};function V(e,t,n){let r=o[e.status]||o.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),c=B(e);return[`${e.title||s(e.cwd)||e.session_id}, ${e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${c==null?``:`, context ${c} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function H({s:e,t,mine:n}){let r=B(e);return(0,P.jsxs)(`div`,{className:`card gd-card`,children:[(0,P.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`dt`,{children:`model`}),(0,P.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,P.jsx)(`dt`,{children:`turns`}),(0,P.jsx)(`dd`,{children:e.turns||0}),(0,P.jsx)(`dt`,{children:`context`}),(0,P.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,P.jsx)(`dt`,{children:`compactions`}),(0,P.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,P.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,P.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function U({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let c=w(e,n),l=(0,N.useMemo)(()=>A(e,{sakura:n}),[c]),u=o[e.status]||o.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=e.session_id,m=(0,N.useCallback)(e=>a(p,e),[a,p]);return(0,P.jsxs)(`a`,{className:`gd-tree${g(e)?` gd-needs`:``}`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-label":V(e,l,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,G(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,G(e.currentTarget)),onBlur:()=>a(null,null),children:[(0,P.jsxs)(`div`,{className:`gd-label`,children:[(0,P.jsxs)(`div`,{className:`act-ell`,children:[(0,P.jsx)(`span`,{className:`mono dim`,children:e.host||`?`}),` ·`,` `,e.title||s(e.cwd)||e.session_id]}),(0,P.jsxs)(`div`,{className:`row gap-8 gd-sub`,children:[(0,P.jsx)(`span`,{className:`badge ${u.cls}`,children:u.label}),t&&(0,P.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,P.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,P.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`}),e.phase&&(0,P.jsx)(`span`,{className:`dim act-ell`,children:e.phase})]})]}),(0,P.jsx)(k,{t:l,pad:i,swaying:f,onPad:m,px:F})]})}function W({pairs:e,count:t}){if(!e.length)return null;let n=t*I+(t-1)*L,r=e=>e*(I+L)+I/2;return(0,P.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*F+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,P.jsxs)(`g`,{className:o,children:[(0,P.jsx)(`path`,{d:`M${e} ${R} C${n} 179 ${n} 159 ${t} 169`}),(0,P.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${R}`})]},`${i}-${a}`)}return(0,P.jsx)(`g`,{className:o,children:(0,P.jsx)(`path`,{d:`M${r(i)} ${z} Q${(r(i)+r(a))/2} 222 ${r(a)} ${z}`})},`${i}-${a}`)})})}var G=e=>e.offsetLeft-(e.parentElement?.scrollLeft||0);function ae({sessions:e,collisions:t}){let[n,r]=(0,N.useState)(T),[i,a]=(0,N.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(D,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=S(C(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>E(e,s);return(0,P.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,P.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,P.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · hover a tree, or one of its pads, for its details`]}),(0,P.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Sakura`})]}),l.length>0&&(0,P.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,P.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,P.jsx)(K,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function K({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,N.useState)({sid:null,pad:null,x:0}),o=(0,N.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=e.trees.find(e=>e.s.session_id===i.sid)?.s,c=s?A(s,{sakura:t}):null,l=c&&i.pad!=null?c.pads[i.pad]:null;return(0,P.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,children:[(0,P.jsxs)(`h3`,{className:`act-lbl gd-shelf-h`,children:[e.name,` `,(0,P.jsxs)(`span`,{className:`dim`,children:[`· `,e.trees.length]})]}),(0,P.jsxs)(`div`,{className:`gd-row`,children:[e.trees.map(({s:e,worktree:n})=>(0,P.jsx)(U,{s:e,worktree:n,sakura:t,mine:r(e.session_id),pad:e.session_id===i.sid?i.pad:null,onHover:o},e.session_id)),(0,P.jsx)(W,{pairs:M(e.trees,n),count:e.trees.length})]}),s&&(0,P.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:l?(0,P.jsx)(j,{pad:l}):(0,P.jsx)(H,{s,t:c,mine:r(s.session_id)})})]})}var q=e=>e.catch(()=>null);function J({s:e}){let t=(0,N.useId)(),n=e.todos,r=a(e);return(0,P.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,P.jsx)(b,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,P.jsx)(_,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,P.jsx)(`div`,{className:`act-foot`,children:(0,P.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,P.jsx)(c,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,P.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,h(e.updated_at),` ago`]})]})}var Y={blocked:`is blocked`,"waiting-input":`waits for your answer`};function oe(e,t){if(!Array.isArray(t))return``;let n=t.filter(g),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} ${Y[e.status]}`).join(`. `):``}var X=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function se(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:X.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function ce(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),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 le({enabled:e,onToggle:t}){return(0,P.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,P.jsx)(_,{name:`activity`,className:`glyph act-fixed`}),(0,P.jsxs)(`div`,{className:`act-grow`,children:[(0,P.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,P.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,P.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,P.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,P.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 ue({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=d(e?.jobs,{days:14,cap:n}),i=p(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 ${f(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${f(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,P.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,P.jsxs)(`div`,{className:`act-stat-head`,children:[(0,P.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,P.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,P.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,P.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,P.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,P.jsx)(`i`,{className:`zero`},e.key))}),(0,P.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,P.jsx)(`span`,{children:f(r[0].key)}),(0,P.jsx)(`span`,{children:f(r[7].key)}),(0,P.jsx)(`span`,{children:`today`})]}),c&&(0,P.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,P.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function de({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,P.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,P.jsxs)(`div`,{className:`act-stat-head`,children:[(0,P.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,P.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,P.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,P.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,P.jsxs)(`li`,{children:[(0,P.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,P.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,P.jsx)(m,{vals:e.per_day,i:t,sweep:!0}),(0,P.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,P.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var Z={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function fe({job:e,longest:t}){let n=l(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=Z[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,P.jsxs)(`li`,{className:`act-row`,children:[(0,P.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,P.jsx)(_,{name:`play`,className:`glyph act-glyph`}),(0,P.jsxs)(`span`,{className:`act-what`,children:[(0,P.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,P.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,P.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,P.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,P.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function pe({gate:e}){return(0,P.jsxs)(`li`,{className:`act-row gate`,children:[(0,P.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,P.jsx)(_,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,P.jsxs)(`span`,{className:`act-what`,children:[(0,P.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,P.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,P.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var Q=5,$=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function me(){let[e,t]=(0,N.useState)(null),[n,a]=(0,N.useState)(``),[o,c]=(0,N.useState)(se),[l,d]=(0,N.useState)(!1),[f,m]=(0,N.useState)(``),h=(0,N.useRef)(null),_=e=>{let t={...o,...e};c(t),ce(t)};ie(e=>r.activity().then(n=>{if(e()){t(n),a(``);let e=oe(h,n?.activity);e&&m(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let b=v(()=>q(r.jobs()),[]),S=v(()=>q(r.gates()),[]),C=v(()=>q(r.catalog(`laws`)),[]),w=!e||e.enabled!==!1,T=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),E=i(),D=w&&e?T.filter(g).length:null,O=new Set(T.map(e=>e.session_id)),k=(e?.ended||[]).filter(e=>!O.has(e.session_id)),A=$([...T,...k].map(e=>e.host),o.host),j=$([...T,...k].map(e=>s(e.cwd)),o.project),M=o.host&&o.project?`host or project`:o.host?`host`:o.project?`project`:``,F=e=>(!o.host||e.host===o.host)&&(!o.project||s(e.cwd)===o.project),I=T.filter(e=>F(e)&&(o.f!==`needs`||g(e))),L=o.f===`all`||o.f===`needs`,R=o.f===`all`&&w?k.filter(F):[],z=l?R:R.slice(0,Q),B=!M&&(o.f===`all`||o.f===`runs`),V=!M&&(o.f===`all`||o.f===`gates`),H=b.data?.jobs||[],U=y(S.data,C.data),W=re(H,U,S.data?.days).map(e=>({...e,runs:B?e.runs:[],gate:V?e.gate:null})).filter(e=>e.runs.length||e.gate),G=Math.max(0,...H.map(e=>e.duration||0)),K=p(W.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),Y=async()=>{let e=!w;try{let n=await r.activityToggle(e);if(n.ok===!1){a(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),a(``)}catch(e){a(e.message)}},Z=(e,t,n)=>(0,P.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,P.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,P.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:o[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>_({[e]:t.target.value}),children:[(0,P.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]})]});return(0,P.jsxs)(`div`,{className:`page-fill`,children:[(0,P.jsx)(ee,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,P.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:f}),n&&(0,P.jsx)(`div`,{className:`act-gap`,children:(0,P.jsx)(u,{error:n})}),e&&(0,P.jsx)(le,{enabled:w,onToggle:Y}),(0,P.jsxs)(`div`,{className:`act-today`,children:[(0,P.jsx)(ue,{jobs:b.data,loading:b.loading}),(0,P.jsx)(de,{rows:U,gates:S.data,loading:S.loading}),(0,P.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,P.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,P.jsxs)(`span`,{className:`act-big act-wait`,children:[D??`—`,` `,(0,P.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,P.jsx)(`p`,{className:`dim act-sm`,children:w?`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,P.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,P.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:X.map(([e,t])=>(0,P.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>_({f:e}),children:[t,e===`needs`&&D>0?(0,P.jsxs)(`span`,{className:`mono`,children:[` `,D]}):null]},e))}),Z(`host`,`Host`,A),Z(`project`,`Project`,j),(0,P.jsx)(ne,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,P.jsx)(`button`,{type:`button`,className:o.v===e?`on`:``,"aria-pressed":o.v===e,onClick:()=>_({v:e}),children:t},e))})]}),M&&o.f!==`needs`&&(0,P.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,M,`; showing sessions only.`]}),L&&(e?!w&&o.f!==`needs`?null:I.length===0?o.f===`needs`?(0,P.jsx)(x,{title:`Nothing waits on you`}):(0,P.jsxs)(x,{title:`No active sessions`,children:[`Run `,(0,P.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):o.v===`garden`?(0,P.jsx)(ae,{sessions:I,collisions:e.collisions}):(0,P.jsx)(`div`,{className:`stack gap-12 act-live`,ref:E,children:I.map(e=>(0,P.jsx)(`div`,{"data-flip":e.session_id,children:(0,P.jsx)(J,{s:e})},e.session_id))}):(0,P.jsx)(te,{label:`Reading live sessions…`})),R.length>0&&(0,P.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,P.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),z.map(e=>(0,P.jsx)(`div`,{children:(0,P.jsx)(J,{s:e})},e.session_id)),R.length>Q&&(0,P.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":l,onClick:()=>d(e=>!e),children:l?`Show fewer`:`Show all ${R.length}`})]}),o.f!==`needs`&&(0,P.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:K,children:W.map(e=>(0,P.jsxs)(`section`,{className:`card act-day`,children:[(0,P.jsxs)(`h3`,{className:`act-day-h`,children:[(0,P.jsx)(`span`,{children:e.title}),(0,P.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,P.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,P.jsx)(fe,{job:e,longest:G},e.id)),e.gate&&(0,P.jsx)(pe,{gate:e.gate})]})]},e.key))})]})}export{me 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{t as r}from"./api-BfpZmUMI.js";import{D as i,J as a,O as o,W as s,Y as c,dt as l,j as u,ot as d,w as f}from"./index-FLVXXvV3.js";import{t as p}from"./EmptyState-1sPNleqv.js";import{d as m,i as h,o as g,r as _,s as v,t as y}from"./Bonsai-CN4rRAHc.js";import{t as b}from"./usePoll-bDFN-Hr6.js";var x=e(t(),1),S=n();function C(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 w({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(`${o(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,S.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,S.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,S.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,S.jsx)(`span`,{className:`feed-dot act-inline-dot ${C(e)||`acc`}`}),e.kind===`thinking`&&(0,S.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,S.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,S.jsx)(`b`,{children:i}),e.error&&(0,S.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,S.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,S.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${l(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function T({turns:e}){return!e||e.length===0?(0,S.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,S.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,S.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,S.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,S.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var E=5;function D({s:e}){let[t]=(0,x.useState)(h),[n,r]=(0,x.useState)(null),i=!!e.ended,a=i?{...e,status:u(e)?`busy`:e.status,error:null}:e,o=m(a,t),s=(0,x.useMemo)(()=>v(a,{sakura:t}),[o]),c=(0,x.useCallback)(e=>r(e),[]),l=g(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,p=[`${d} turn${d===1?``:`s`}`,`context ${l==null?`unknown`:`${Math.round(l*100)} %`}`,`${f} compaction${f===1?``:`s`}`,`sub-agents: ${s.pads.filter(e=>e.key!=null).length} ${i?`unfinished`:`running`}, ${s.fallen.length} finished`].join(` · `),b=n==null?null:s.pads[n];return(0,S.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!i&&u(e)?` gd-needs`:``}`,children:[(0,S.jsx)(_,{t:s,pad:n,swaying:!i&&e.status!==`idle`,onPad:c,px:E,label:`Bonsai of this session${i?`, ended`:``}: ${p}`}),(0,S.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[i&&(0,S.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,S.jsx)(`div`,{className:`dim act-sm`,children:p}),b?(0,S.jsx)(y,{pad:b}):(0,S.jsx)(`div`,{className:`dim act-xs`,children:`Hover a pad for the files it changed.`})]})]})}function O({sid:e}){let[t,n]=(0,x.useState)(null),[o,u]=(0,x.useState)(``),[m,h]=(0,x.useState)(!1),[g,_]=(0,x.useState)(!1),v=(0,x.useId)();b(t=>m?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),u(``),h(!1))},e=>{t()&&(e.status===404?h(!0):u(e.message))}),2e3,[e,m]);let y=(0,S.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,S.jsx)(d,{name:`arrow`}),` Activity`]});if(m)return(0,S.jsxs)(`div`,{className:`page-fill`,children:[y,(0,S.jsx)(p,{title:`Session ended`,action:(0,S.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,S.jsxs)(`div`,{className:`page-fill`,children:[y,o?(0,S.jsx)(a,{error:o}):(0,S.jsx)(c,{label:`Loading session…`})]});let C=t.session,E=C.files,O=C.todos,k=!!(E&&E.items&&E.items.length>0),A=!!(O&&O.items&&O.items.length>0),j=t.conversation||[],M=t.timeline||[],N=[...j.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...M.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,S.jsxs)(`div`,{className:`page-fill`,children:[y,(0,S.jsx)(s,{title:C.title||i(C.cwd)||C.session_id,sub:C.cwd?(0,S.jsx)(`span`,{className:`mono act-cwd`,title:C.cwd,children:C.cwd}):null}),o&&(0,S.jsx)(`div`,{className:`act-gap`,children:(0,S.jsx)(a,{error:o})}),(0,S.jsxs)(`div`,{className:`card pad-md`,children:[(0,S.jsx)(f,{s:C}),(0,S.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,l(C.updated_at),` ago`]})]}),(0,S.jsx)(D,{s:C}),(k||A)&&(0,S.jsxs)(`div`,{className:`grid gap-12 act-panels${k&&A?` two`:``}`,children:[k&&(0,S.jsxs)(`div`,{className:`card pad-md`,children:[(0,S.jsx)(`div`,{className:`card-head`,children:(0,S.jsxs)(`h2`,{children:[`Files touched `,(0,S.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,S.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,S.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,S.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,S.jsxs)(`span`,{className:`act-fixed`,children:[(0,S.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,S.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),A&&(0,S.jsxs)(`div`,{className:`card pad-md`,children:[(0,S.jsx)(`div`,{className:`card-head`,children:(0,S.jsxs)(`h2`,{children:[`Plan`,` `,(0,S.jsxs)(`span`,{className:`dim`,children:[`(`,O.done,`/`,O.total,`)`]})]})}),(0,S.jsx)(`div`,{className:`stack act-list`,children:O.items.map((e,t)=>(0,S.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,S.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,S.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,S.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,S.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,S.jsx)(`h2`,{children:`Timeline`}),M.length>0&&(0,S.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":g,"aria-controls":v,onClick:()=>_(e=>!e),children:g?`Show conversation`:`Show full stream (${N.length})`})]}),(0,S.jsx)(`div`,{id:v,children:g?(0,S.jsx)(`div`,{className:`stack gap-12`,children:N.map((e,t)=>(0,S.jsx)(w,{rec:e},t))}):(0,S.jsx)(T,{turns:j})})]})]})}export{D as SessionTree,O 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";var r=e(t(),1),i=e=>{let t=2166136261;for(let n of String(e))t=Math.imul(t^n.charCodeAt(0),16777619);return t>>>0},a=e=>()=>{e|=0,e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},o=e=>Math.max(0,Math.min(1,e)),s={claude:[`#8E4A33`,`#C46A4C`,`#E3906F`],bob:[`#173F8C`,`#2A5CC0`,`#6A96E8`],opencode:[`#5E6670`,`#98A2AD`,`#C8D0D8`],openclaude:[`#2F1F55`,`#4E3484`,`#8A6CC8`]},c={live:[`#16393D`,`#1F5A55`,`#2C7D55`,`#5DA845`,`#A8D23E`],sakura:[`#16393D`,`#6E2A55`,`#B83C80`,`#E9649F`,`#FFB0D2`],done:[`#5A2E14`,`#8A4A1C`,`#B8702A`,`#DB9A3E`,`#F2C46A`],idle:[`#2E3236`,`#44494E`,`#5E646A`,`#7C8288`,`#A2A7AC`]},l={developer:[`#123A3F`,`#1A5A5E`,`#24806F`,`#3FB08A`,`#8EE6C2`],explorer:[`#2C3A12`,`#4A6418`,`#6E9424`,`#9CC23A`,`#DDF07A`],reviewer:[`#16283F`,`#1F3E66`,`#2E5E92`,`#4A86C4`,`#9AC8F0`],tester:[`#3A3012`,`#5E4C18`,`#8A6E22`,`#B8952E`,`#EAD27A`]},u=[`#4E2E1C`,`#7A4A2E`,`#A2683F`,`#C78A5A`],d=[`#34312F`,`#4F4A46`,`#6B6560`,`#8A847E`],f=[`#3E8E41`,`#5FB14F`],p=[`#4A4F54`,`#62686E`],m=`#FFF6E0`,h=[`#E3C24A`,`#C9A23A`],g=[`#9BDD6A`,`#D8F59A`],_={"!":`#E8B04A`,x:`#FF6F69`},v=12;function y(e){let t=String(e||``).toLowerCase();return/implement|develop/.test(t)?`developer`:/explor/.test(t)?`explorer`:/review/.test(t)?`reviewer`:/test/.test(t)?`tester`:null}var b=e=>e?.status===`blocked`||e?.status===`waiting-input`;function x(e){return Array.isArray(e.files_all)?e.files_all.filter(e=>e&&typeof e==`object`):(Array.isArray(e.files?.items)?e.files.items:[]).filter(e=>e&&typeof e==`object`).map(e=>({file:e.file??null,path:e.path??null,additions:e.additions??0,deletions:e.deletions??0,by:e.by??null}))}var S=e=>e==null||e===``?NaN:Number(e);function C(e){let t=S(e?.context?.used),n=S(e?.context?.window);return Number.isFinite(t)&&Number.isFinite(n)&&n>0?o(t/n):null}function w(e){let t=x(e),n=(Array.isArray(e.agents)?e.agents:[]).filter(e=>e&&typeof e==`object`).map((e,t)=>({key:e.id??`#${t}`,id:e.id??null,type:e.type||null,running:e.status!==`done`,files:[]})),r=new Map(n.map(e=>[e.key,e])),i=[],a=e.attribution!==!1;for(let e of t){if(!a||e.by==null){i.push(e);continue}let t=r.get(e.by);t||(t={key:e.by,id:e.by,type:`agent`,running:!0,files:[]},n.push(t),r.set(e.by,t)),t.files.push(e)}let c=C(e),l=c!=null,u=l?S(e.context.used):NaN,d=l?c:.5,f=Math.max(0,Math.floor(Number(e.compactions)||0)),p=S(e.context_at_compaction),m=f===0?1:l&&Number.isFinite(p)&&p>0?o(u/p):0;return{id:String(e.session_id??``),host:s[e.host]?e.host:`claude`,idle:e.status===`idle`,bubble:b(e)?`!`:e.error?`x`:null,turns:Math.max(0,Number(e.turns)||0),ctx:d,compactions:f,compacted:f>0&&m<1,regrow:m,crown:i,agents:n}}function T(e,t=!1){let n=w(e);return JSON.stringify([n.id,n.host,n.idle,n.bubble,n.turns,Math.round(n.ctx*100),n.compactions,Math.round(n.regrow*100),n.crown.length,n.agents.map(e=>[e.key,e.type,e.running,e.files.length]),!!t])}function E(e,{sakura:t=!1}={}){let n=w(e),{id:r,idle:o}=n,b=Math.min(1,Math.log1p(n.turns)/Math.log1p(40)),x=.55+.45*b,S=a(i(r)),C=Array.from({length:56},()=>Array(56).fill(null)),T=Array.from({length:56},()=>Array(56).fill(-1)),E=-1,D=(e,t,n)=>{e=Math.round(e),t=Math.round(t),e>=0&&e<56&&t>=0&&t<56&&(C[t][e]=n,T[t][e]=E)},O=o?d:u,k=o?p:f,A=o?c.idle:t?c.sakura:c.live,j=Math.round(41-(9+18*b)),M=1+S()*2+3*b,N=S()*Math.PI*2,P=.9+S()*.6,F=e=>28+M*Math.sin(e*Math.PI*P+N)-M*Math.sin(N);for(let e=41;e>=j;e--){let t=(41-e)/(41-j),n=F(t),r=3+4.5*b-(1.5+3.5*b)*t;for(let t=Math.floor(n-r/2);t<=Math.ceil(n+r/2);t++){let i=(t-(n-r/2))/r;D(t,e,i<.25?O[3]:i>.75?O[0]:S()<.15?O[1]:O[2])}}for(let e=-6;e<=6;e++)D(28+e,41,Math.abs(e)>4?O[1]:O[2]),Math.abs(e)<=5&&D(28+e,40,Math.abs(e)>3?O[1]:O[2]);let I=[],L=(e,t,n,o,s,c)=>{n*=1.15,e=Math.max(n+2,Math.min(53-n,e));let l=a(i(`${r}:pad:${c}`)),u=n*.72;t=Math.max(t,u+6);for(let r=0;r<6;r++){let r=-Math.PI*(.15+.7*l()),i=n*(.4+.5*l());for(let n=0;n<i;n++)D(e+Math.cos(r)*n,t+u*.5+Math.sin(r)*n*.8,O[0])}let d=Math.round(10+n*1.6),f=[];for(let r=0;r<d;r++){let r=l()*Math.PI*2,i=Math.sqrt(l());f.push([e+Math.cos(r)*i*n,t+Math.sin(r)*i*u,1.8+l()*2.2])}f.sort((e,t)=>t[1]-e[1]);for(let[e,n,r]of f){let i=Math.max(0,Math.min(4,Math.round(4*(1-(n-(t-u))/(2*u))+(l()-.5))));for(let t=Math.floor(n-r);t<=n+r;t++)for(let a=Math.floor(e-r);a<=e+r;a++){if(((a-e)**2+(t-n)**2)/(r*r)>1+(l()-.5)*.5)continue;let s=a-e+(t-n)<-r*.3?1:t-n>r*.5?-1:0;D(a,t,o[Math.max(0,Math.min(4,i+s))])}}let p=a(i(`${r}:bloom:${c}`));for(let r=0;r<Math.min(s,v);r++)D(e+(p()*2-1)*n*.8,t-p()*u*.9,m);return{rx:n,cy:t}},R=a(i(`${r}:side`))()<.5?-1:1,z=[];n.agents.forEach((e,t)=>{let s=.25+.55*(t/Math.max(1,n.agents.length-1)),c=Math.round(41-s*(41-j)),u=F(s);if(!e.running){let t=(3+4.5*b-(1.5+3.5*b)*s)/2;E=-1,D(u+R*(t+1),c,O[3]),D(u+R*(t+2),c-1,O[2]),z.push({agentId:e.id,type:e.type,files:e.files}),R=-R;return}let d=Math.round((12+Math.floor(a(i(`${r}:branch:${e.key}`))()*4))*x);E=-1;for(let e=0;e<=d;e++){let t=u+R*e,n=c-e*.45;D(t,n,O[e<d/2?1:2]),D(t,n+1,O[0]),e<d*.6&&D(t,n+2,O[0])}let f=o?null:y(e.type),p=f?l[f]:A;E=I.length,I.push({agentId:e.id,key:e.key,type:e.type,family:f,files:e.files,bbox:null}),L(u+R*d,c-d*.45-2,(8+Math.min(e.files.length,6)*.6)*x,p,e.files.length,e.key),R=-R});let B=I.length;I.push({agentId:null,key:null,type:null,family:null,files:n.crown,bbox:null}),E=B;let V=(4+7*n.ctx+Math.min(n.crown.length,6)*.5)*x*1.35,{rx:H,cy:U}=L(F(1),j-3,V,A,n.crown.length,`crown`);if(n.ctx>.8&&!n.compacted){let e=a(i(`${r}:yellow`));for(let t=0;t<56;t++)for(let n=0;n<56;n++)T[t][n]===B&&C[t][n]!==m&&t<U-H*.2&&e()<.55&&(C[t][n]=e()<.5?h[0]:h[1])}if(n.compacted){let e=a(i(`${r}:shoots`)),t=Math.round(U-H*.15-n.regrow*H*.5);for(let e=0;e<Math.max(0,t);e++)for(let t=0;t<56;t++)T[e][t]===B&&(C[e][t]=null,T[e][t]=-1);if(t>=0&&t<56)for(let r=0;r<56;r++){if(T[t][r]!==B||e()>=.12+n.regrow*.5)continue;let i=1+Math.floor(e()*(1+n.regrow*3));for(let e=1;e<=i;e++)D(r,t-e,e===i?g[1]:g[0])}}E=-1;let W=a(i(`${r}:fallen`));z.forEach((e,t)=>D(16+(t*7+Math.floor(W()*4))%24,40,c.done[2+t%2]));for(let e=0;e<Math.min(n.compactions,6);e++)D(15+e*2,42,m);let[G,K,q]=s[n.host];for(let e=42;e<=46;e++){let t=e<=43?0:Math.floor((e-43)*.45)+2;for(let n=13+t;n<=42-t;n++){if(e===42&&C[e][n]===m)continue;let r=K;e<=43?r=e===42?q:G:(e===46||n===13+t||n===42-t)&&(r=G),D(n,e,r)}}let J=a(i(`${r}:moss`));for(let e=15;e<=40;e++)D(e,41,J()<.5?k[0]:k[1]),J()<.35&&D(e,40,k[0]);for(let e=16;e<=39;e++)D(e,47,`#00000055`);if(n.bubble){let e=_[n.bubble];for(let t=3;t<10;t++)for(let n=40;n<47;n++)D(n,t,t===3||t===9||n===40||n===46?e:`#14191F`);if(D(41,10,e),n.bubble===`!`){for(let t=5;t<=6;t++)D(43,t,e);D(43,8,e)}else for(let[t,n]of[[2,2],[4,2],[3,3],[2,4],[4,4]])D(40+t,3+n,e)}let Y=[],X=I.map(()=>null);for(let e=0;e<56;e++){let t=0;for(;t<56;){let n=C[e][t],r=T[e][t];if(!n){t++;continue}let i=t;for(;i+1<56&&C[e][i+1]===n&&T[e][i+1]===r;)i++;if(Y.push({x:t,y:e,w:i-t+1,c:n,p:r}),r>=0){let n=X[r]||={x0:t,y0:e,x1:i,y1:e};n.x0=Math.min(n.x0,t),n.x1=Math.max(n.x1,i),n.y1=e}t=i+1}}return I.forEach((e,t)=>{let n=X[t];e.bbox=n?{x:n.x0,y:n.y0,w:n.x1-n.x0+1,h:n.y1-n.y0+1}:null}),{width:56,height:56,runs:Y,pads:I,bubble:n.bubble,fallen:z}}var D=e=>{if(!e)return``;let t=String(e).replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||String(e)},O=e=>e?String(e).replace(/\\/g,`/`).replace(/\/+$/,``).toLowerCase():``;function k(e){let t=new Map;for(let n of e||[]){let e=n.repo||n.root,r=n.repo_key||(e?O(e):n.cwd?`cwd:${O(n.cwd)}`:`outside a repo`),i=D(e||n.cwd)||`outside a repo`;t.has(r)||t.set(r,{key:r,name:i,trees:[]});let a=n.root&&e&&O(n.root)!==O(e)?D(n.root):null;t.get(r).trees.push({s:n,worktree:a})}let n=(e,t)=>e<t?-1:+(e>t),r=[...t.values()];for(let e of r)e.trees.sort((e,t)=>n(e.worktree||``,t.worktree||``)||n(String(e.s.session_id),String(t.s.session_id)));return r.sort((e,t)=>n(e.name.toLowerCase(),t.name.toLowerCase())||n(e.key,t.key))}var A=(e,t)=>new Set((e.writers||[]).filter(e=>e.sid===t).map(e=>O(e.root)));function j(e,t,n){let r=A(e,t);for(let t of A(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var M=e=>[...new Set((e.writers||[]).map(e=>e.sid))];function N(e,t){let n=new Map(e.map((e,t)=>[e.s.session_id,t])),r=new Map;for(let e of t||[]){let t=M(e).filter(e=>n.has(e));for(let i=0;i<t.length;i++)for(let a=i+1;a<t.length;a++){let o=n.get(t[i]),s=n.get(t[a]),c=o<s?`${o}-${s}`:`${s}-${o}`,l=j(e,t[i],t[a]);(!r.has(c)||l===`same-worktree`)&&r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function P(e,t){let n=[];for(let r of t||[]){let t=M(r).filter(t=>t!==e);if(!t.length||!M(r).includes(e))continue;let i=t.some(t=>j(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var F=e=>e?.status===`busy`||b(e);function I(e,t=10){let n=e.map(e=>({...e,collapsed:!1})),r=n.reduce((e,t)=>e+t.trees.length,0);if(r<=t)return n;let i=n.length,a=n.filter(e=>!e.trees.some(e=>F(e.s))).sort((e,t)=>t.trees.length-e.trees.length||(e.key<t.key?-1:1));for(let e of a){if(r<=t||i<=1)break;e.collapsed=!0,r-=e.trees.length,i--}return n}var L=n(),R=12,z=`geneseed-garden-sakura`;function B(){try{return window.localStorage.getItem(z)===`1`}catch{return!1}}var V=e=>e.key==null?`the session`:e.type||`agent`,H=e=>e.path||e.file||`?`;function U({pad:e}){let t=e.files.slice(0,R);return(0,L.jsxs)(`div`,{className:`card gd-card`,children:[(0,L.jsxs)(`div`,{className:`act-lbl`,children:[V(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,L.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`span`,{className:`mono act-ell`,children:H(e)}),(0,L.jsxs)(`span`,{className:`mono act-xs`,children:[(0,L.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,L.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${H(e)}:${t}`))}),e.files.length>t.length&&(0,L.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var W=(0,r.memo)(function({t:e,pad:t,swaying:n,onPad:i,px:a,label:o}){let s=(0,r.useMemo)(()=>{let t=new Map;for(let n of e.runs)t.has(n.p)||t.set(n.p,[]),t.get(n.p).push(n);return[...t.entries()]},[e]);return(0,L.jsx)(`svg`,{className:`gd-svg${t==null?``:` gd-dimming`}`,viewBox:`0 0 56 56`,width:56*a,height:56*a,shapeRendering:`crispEdges`,"data-bubble":e.bubble||void 0,...o?{role:`img`,"aria-label":o}:{"aria-hidden":`true`},children:s.map(([r,a])=>(0,L.jsx)(`g`,{"data-p":r,className:[r===t&&`gd-hot`,n&&r>=0&&e.pads[r].key!=null&&`gd-sway`].filter(Boolean).join(` `)||void 0,onMouseEnter:r>=0?()=>i(r):void 0,onMouseLeave:r>=0?()=>i(null):void 0,children:a.map(e=>(0,L.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},r))})});export{I as a,k as c,T as d,B as i,P as l,z as n,C as o,W as r,E as s,U as t,N as u};
@@ -1 +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-DxCqnFPy.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};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{ot as r}from"./index-FLVXXvV3.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};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-CV1squu6.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-DxCqnFPy.js","assets/api-BfpZmUMI.js","assets/index-Cqqs-PbJ.css","assets/OperatorHudView-CLmq0lNh.js","assets/JournalView-CpXsT_JD.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-DxCqnFPy.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-CV1squu6.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>S(()=>import(`./OperatorHudView-CLmq0lNh.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>S(()=>import(`./JournalView-CpXsT_JD.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};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-19roNb5W.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-FLVXXvV3.js","assets/api-BfpZmUMI.js","assets/index-XTGBLKQr.css","assets/OperatorHudView-xs7SCwCe.js","assets/JournalView-BgU2ybaq.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{B as l,I as u,J as d,L as f,U as p,Y as m,Z as h,bt as g,ct as _,dt as v,l as y,lt as b,ot as x,pt as S,q as C,t as w,ut as T}from"./index-FLVXXvV3.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=u(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=v(e.newest),n=e.oldest?v(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=f(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}=S(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=_(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:()=>g(`#/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)(x,{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=f(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:[v(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)(l,{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=T(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=b(e.counts),o=n?.version_verdict||``,s=U(o),l=_(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=b(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=_(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=S(()=>q(()=>i.fleet()),[e]),r=S(()=>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?y(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)(()=>w(()=>import(`./GreenhouseView-19roNb5W.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>w(()=>import(`./OperatorHudView-xs7SCwCe.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>w(()=>import(`./JournalView-BgU2ybaq.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 u=c,[f,g]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,v=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:y}=S(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(d,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(m,{});let b=e.daemon_stale?(0,k.jsx)(C,{}):null;return e.deployed?f===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:[b,(0,k.jsx)(Q,{overview:e,recent:y,lens:v,onDirection:g,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(`div`,{className:`head-row`,children:(0,k.jsx)(h,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,k.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>g(e),"aria-pressed":f===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:v,dataRev:l}),f===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:v,onAction:s})}),f===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(m,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:v})}),f===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:v}),f===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:v})]},f)]}):(0,k.jsxs)(k.Fragment,{children:[b,(0,k.jsx)(p,{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,W as c,Y as l,Z as u,a as d,bt as f,c as ee,et as p,i as m,n as te,o as ne,ot as h,pt as g,r as _,s as v,tt as re}from"./index-FLVXXvV3.js";import{t as y}from"./EmptyState-1sPNleqv.js";import{a as b,n as x,o as S,r as ie,t as ae}from"./RailCats-BuJD4Jou.js";import{t as C}from"./CopyButton-CRAUXSG7.js";import{i as w,n as T,r as E}from"./Markdown-DpmmtW2Y.js";var D=e(t(),1),O=n();function k(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 A(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 j(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||k(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 M(e){let t={ids:new Set,idx:0,toc:[]},n=n=>j(T(n,e?.links),t);if(e?.rows){let[r,i]=A(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var N=r(),P={"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`]},F=`you already know this`,I=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function L(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 R=e=>(e.parentElement?.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``),z=40,B=e=>{let t=e.split(`
5
+ `)[0].trim();return t?`Copy `+(t.length>z?t.slice(0,39)+`…`:t):`Copy code`};function V({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,D.useRef)(null),[o,s]=(0,D.useState)([]),l=(0,D.useMemo)(()=>M({body:e.body,links:e.links}).html,[e.body,e.links]);(0,D.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(F)&&e.classList.add(`analogy`)}),s(L(e)))},[l]),(0,D.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(),f(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[l]),(0,D.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=P[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=>k(e.textContent||``)===k(i))),o?.classList.add(`docs-here`)},[l,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,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i,actions:u.length>0&&u.map(e=>e.hash?(0,N.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,N.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,N.jsx)(`div`,{className:`doc-meta`,children:(0,N.jsxs)(`span`,{className:`badge`,children:[(0,N.jsx)(`span`,{className:`dot`}),e.source]})}),(0,N.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:l}}),o.map((e,t)=>{let n=R(e);return(0,O.createPortal)((0,N.jsx)(C,{text:n,label:B(n)}),e,t)}),e.link&&(0,N.jsx)(`div`,{className:`doc-link`,children:(0,N.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var H=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`);function U({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,N.jsxs)(`div`,{className:`cli-arg`,children:[(0,N.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,N.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,N.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function W({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,N.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,N.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,N.jsxs)(`div`,{className:`stack gap-4`,children:[(0,N.jsx)(`h2`,{id:H(e.name),children:(0,N.jsx)(`code`,{children:e.name})}),e.help&&(0,N.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,N.jsx)(C,{text:`${t} ${e.name}`,label:`Copy ${t} ${e.name}`,title:`Copy ${t} ${e.name}`})]}),(0,N.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,N.jsx)(U,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,N.jsxs)(`div`,{className:`cli-block`,children:[(0,N.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,N.jsx)(U,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function G({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Every subcommand of `,(0,N.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,N.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,N.jsx)(`div`,{children:n.map(e=>(0,N.jsx)(W,{cmd:e,prog:t},e.name))})]})}function K({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:(0,N.jsxs)(N.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,N.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,N.jsx)(`div`,{className:`card pad-md`,children:(0,N.jsxs)(`table`,{className:`glossary-table`,children:[(0,N.jsx)(`thead`,{children:(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`th`,{children:`Concept`}),(0,N.jsx)(`th`,{children:`Neutral term`}),(0,N.jsxs)(`th`,{children:[`In `,n]}),(0,N.jsx)(`th`,{children:`Meaning`}),(0,N.jsx)(`th`,{children:`In dev terms`})]})}),(0,N.jsx)(`tbody`,{children:t.map(e=>(0,N.jsxs)(`tr`,{children:[(0,N.jsx)(`td`,{children:(0,N.jsx)(`strong`,{children:e.label})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.neutral||`—`})}),(0,N.jsx)(`td`,{children:(0,N.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,N.jsx)(`td`,{className:`dim`,children:e.desc}),(0,N.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var q={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},J=({text:e})=>(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(e||``))}}),Y=({kind:e})=>(0,N.jsx)(`span`,{className:`tag ${q[e]||``}`,children:e});function oe({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,D.useState)(0),{before:s,after:l}=(0,D.useMemo)(()=>M(e),[e]);if(!e.rows)return(0,N.jsx)(V,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{eyebrow:r&&`${r} · ${I(e.body)} min read`,title:e.title,sub:i}),(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:s}}),(0,N.jsxs)(`div`,{className:`docs-map`,children:[(0,N.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,N.jsx)(`li`,{children:(0,N.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,N.jsx)(`span`,{className:`map-piece`,children:(0,N.jsx)(J,{text:e.piece})}),(0,N.jsx)(Y,{kind:e.kind}),(0,N.jsx)(`span`,{className:`mono dim map-cost`,children:(0,N.jsx)(J,{text:e.cost})})]})},t))}),u&&(0,N.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,N.jsx)(`h2`,{children:(0,N.jsx)(J,{text:u.piece})}),(0,N.jsx)(Y,{kind:u.kind}),(0,N.jsxs)(`dl`,{children:[(0,N.jsx)(`dt`,{children:`Does`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.does})}),(0,N.jsx)(`dt`,{children:`Costs`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.cost})}),(0,N.jsx)(`dt`,{children:`Turn it off`}),(0,N.jsx)(`dd`,{children:(0,N.jsx)(J,{text:u.off})})]})]})]}),l.trim()&&(0,N.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function se(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ce(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,D.useSyncExternalStore)(ce,e,()=>null),le=5,ue=96,de=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function Z(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-])${de(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===le)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,D.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:H(e.name),title:e.name,level:2})):M(e).toc,[e]),i=(0,D.useMemo)(()=>Z(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=ue&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,N.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,N.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,N.jsx)(`ul`,{children:r.map(e=>(0,N.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,N.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,N.jsxs)(`div`,{className:`docs-gloss`,children:[(0,N.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,N.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,N.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,N.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,N.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,N.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,N.jsx)(`code`,{children:n.installed_fp||`(none)`},`i`)],[`Source build`,(0,N.jsx)(`code`,{children:n.source_fp||`—`},`s`)],[`Match?`,n.verdict?(0,N.jsx)(`span`,{dangerouslySetInnerHTML:{__html:E(w.parseInline(n.verdict))}},`m`):`—`],[`License`,e.license]];return(0,N.jsxs)(`div`,{className:`detail-doc`,children:[(0,N.jsx)(c,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,N.jsx)(`div`,{className:`card pad-md mb-18`,children:r.map(([e,t])=>(0,N.jsxs)(`div`,{className:`kv`,children:[(0,N.jsx)(`span`,{className:`k`,children:e}),(0,N.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,N.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{name:`external`}),`File an issue`]}),(0,N.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,N.jsx)(h,{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,N.jsx)(s,{error:t,style:{margin:18}});if(!e)return(0,N.jsx)(l,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,N.jsx)(V,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,N.jsx)(oe,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,N.jsx)(G,{page:e});case`glossary`:return(0,N.jsx)(K,{page:e});case`about`:return(0,N.jsx)(me,{page:e,overview:n});default:return(0,N.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function ge(){let e=se(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function _e(){let e=X(ge);return(0,N.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,N.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]=re(p(t?.emit)),{data:c,error:f}=g(()=>i.docs(r),[r]),h=e||Q(c),{data:y,error:C,loading:w}=g(()=>h?i.docsPage(h,r):Promise.resolve(null),[h,r]),{data:T}=g(()=>i.docsPage(`glossary`,r).catch(()=>null),[r],`docs:glossary`);(0,D.useEffect)(()=>{if(c&&h&&!c.groups.some(e=>e.pages.some(e=>e.id===h))){let e=Q(c);e&&e!==h&&window.location.replace(d(e))}},[c,h]),(0,D.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[h]);let E=v(c,h),O=E.part||c?.groups?.[0]||null,k=O?.id===_;(0,D.useEffect)(()=>{k&&y?.id===h&&ne(h)},[k,y,h]);let A=k?[...ee(),h]:[],[j,M]=(0,D.useState)(``),[P,F]=(0,D.useState)(`all`),[I,L]=(0,D.useState)(O?.id);O?.id!==I&&(L(O?.id),M(``),F(`all`));let R=$(O),z=x(R),B=P===`all`?R:R.filter(e=>e.group===P),V=S(B,j);return f?(0,N.jsx)(s,{error:f}):(0,N.jsx)(`div`,{className:`docs-wrap`,children:(0,N.jsxs)(`div`,{className:`library docs-lib`,children:[(0,N.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,N.jsxs)(`div`,{className:`lib-title`,children:[(0,N.jsx)(`p`,{className:`h`,children:`Docs`}),(0,N.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,N.jsx)(u,{"aria-label":`Harness`,children:o.map(e=>(0,N.jsx)(`button`,{className:r===e.id?`on`:``,onClick:()=>a(e.id),"aria-pressed":r===e.id,children:e.label},e.id))}),(0,N.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(c?.groups||[]).map(e=>(0,N.jsxs)(D.Fragment,{children:[(0,N.jsxs)(`a`,{href:e.pages[0]?d(e.pages[0].id):`#/docs`,className:O?.id===e.id?`on`:``,"aria-current":O?.id===e.id?`page`:void 0,children:[e.label,(0,N.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),O?.id===e.id&&(0,N.jsx)(ae,{label:`Sections`,total:R.length,cats:z,cat:P,onChange:F})]},e.id))})]}),(0,N.jsx)(b,{label:O?.label||`Docs`,count:j.trim()?`${V.length} of ${B.length}`:B.length||``,extra:k&&(0,N.jsx)(m,{pages:O.pages,seen:A}),q:j,onQ:M,matched:V.length,inView:[O?.id,h],children:c?(0,N.jsx)(ie,{rows:V,activeName:h,hrefOf:e=>d(e.name),pills:k?e=>A.includes(e.name)&&e.name!==h?(0,N.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,N.jsx)(l,{label:`Loading docs…`})}),(0,N.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":E.page?.title||`Page`,children:[(0,N.jsx)(_e,{}),E.page&&(0,N.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,N.jsx)(`a`,{href:d(E.part.pages[0].id),children:E.part.label}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`a`,{href:d(E.part.pages.find(e=>(e.section||`General`)===E.section).id),children:E.section}),(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,N.jsx)(`span`,{"aria-current":`page`,children:E.page.title})]}),(0,N.jsxs)(`div`,{className:`docs-read`,children:[(0,N.jsxs)(`div`,{className:`docs-article`,children:[(0,N.jsx)(he,{data:w?null:y,error:C,overview:t,onAction:n,place:E},`${h}|${r}`),!w&&(0,N.jsx)(te,{menu:c,pageId:h})]}),!w&&(0,N.jsx)(pe,{page:y,glossaryRows:T?.rows})]})]})]})})}export{ve as default,$ as docRows};