geneseed 4.30.0 → 4.31.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 (50) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/SHIPPED.md +1 -1
  3. package/docs/concepts/footprint.md +1 -1
  4. package/docs/reference/plugin-activity.md +1 -1
  5. package/docs/web-ui.md +86 -16
  6. package/harness.config.json +1 -1
  7. package/js/README.md +5 -5
  8. package/js/hosts/hooks.mjs +6 -4
  9. package/js/web/actions.mjs +41 -20
  10. package/js/web/activity.mjs +139 -23
  11. package/js/web/api.mjs +29 -11
  12. package/js/web/catalog.mjs +108 -23
  13. package/js/web/handler.mjs +37 -12
  14. package/js/web/routes.mjs +69 -15
  15. package/js/web/server.mjs +14 -13
  16. package/js/web/state.mjs +57 -16
  17. package/js/web/usage-api.mjs +7 -3
  18. package/package.json +1 -1
  19. package/web/dist/assets/Activity-B7cFtS00.js +1 -0
  20. package/web/dist/assets/ActivityDetail-C-GbMmuW.js +1 -0
  21. package/web/dist/assets/{Bonsai-CN4rRAHc.js → Bonsai-_YyexVC5.js} +1 -1
  22. package/web/dist/assets/{CopyButton-CRAUXSG7.js → CopyButton-IXnXzH4Y.js} +1 -1
  23. package/web/dist/assets/{Dashboard-CaqOqtkG.js → Dashboard-sCfEjowQ.js} +2 -2
  24. package/web/dist/assets/{Docs-BFxyAVdN.js → Docs-w3Y7M5Ts.js} +2 -2
  25. package/web/dist/assets/{GreenhouseView-19roNb5W.js → GreenhouseView-BWWbMKmg.js} +1 -1
  26. package/web/dist/assets/Installs-CnkdJ-VA.js +3 -0
  27. package/web/dist/assets/{JournalView-BgU2ybaq.js → JournalView-C7bPD3fZ.js} +1 -1
  28. package/web/dist/assets/{KitApply-Ckc0P5kt.js → KitApply-CQQbnThf.js} +1 -1
  29. package/web/dist/assets/{Kits-BZqWGWMu.js → Kits-aj07N7mT.js} +1 -1
  30. package/web/dist/assets/Laws-DZ38nl_H.js +3 -0
  31. package/web/dist/assets/Library-QCGXPV5h.js +2 -0
  32. package/web/dist/assets/Loops-C5u7fQOR.js +2 -0
  33. package/web/dist/assets/{OperatorHudView-xs7SCwCe.js → OperatorHudView-Blu1lqiZ.js} +1 -1
  34. package/web/dist/assets/Personal-ox_MktWO.js +2 -0
  35. package/web/dist/assets/Tabs-CIPyMAX-.js +1 -0
  36. package/web/dist/assets/api-BxjLd7Qd.js +1 -0
  37. package/web/dist/assets/index-0GCxkY7m.css +1 -0
  38. package/web/dist/assets/index-CzDi9JpF.js +3 -0
  39. package/web/dist/index.html +3 -3
  40. package/web/dist/assets/Activity-DfETiyWm.js +0 -1
  41. package/web/dist/assets/ActivityDetail-CnP3GPAN.js +0 -1
  42. package/web/dist/assets/Installs-BSoQN7w7.js +0 -3
  43. package/web/dist/assets/Laws-CnUWiNIx.js +0 -3
  44. package/web/dist/assets/Library-rYO8owx_.js +0 -2
  45. package/web/dist/assets/Loops-CljFhhQV.js +0 -2
  46. package/web/dist/assets/Personal-CMPwtl36.js +0 -2
  47. package/web/dist/assets/Tabs-CEfSUVQp.js +0 -1
  48. package/web/dist/assets/api-BfpZmUMI.js +0 -1
  49. package/web/dist/assets/index-FLVXXvV3.js +0 -3
  50. package/web/dist/assets/index-XTGBLKQr.css +0 -1
package/js/web/routes.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * WHAT THE WEB API ANSWERS — as a declaration, separate from the dispatcher that honours it.
3
3
  *
4
- * Four tables and two inline lists. The two GET tables (`STATE_ROUTES`, `PREFIX_ROUTES`) used
5
- * to live in `api.mjs`, which made it import every route module that also imported it. None of
6
- * this is documentation: `tests/unit/web_server.test.mjs` holds their union against a surface
7
- * list written out in the test, and probes the real handler, because a declaration is not a
8
- * dispatcher — a route can be declared here and missing from the dispatch, and nothing but a
9
- * probe notices.
4
+ * Four tables, two inline lists, and the two install-scope sets (`VIEW_POSTS`, `MACHINE_GETS`).
5
+ * The two GET tables (`STATE_ROUTES`, `PREFIX_ROUTES`) used to live in `api.mjs`, which made it
6
+ * import every route module that also imported it. None of this is documentation:
7
+ * `tests/unit/web_server.test.mjs` holds their union against a surface list written out in the
8
+ * test, and probes the real handler, because a declaration is not a dispatcher — a route can be
9
+ * declared here and missing from the dispatch, and nothing but a probe notices.
10
10
  *
11
11
  * This file used to also carry the Python→Node port's NOT_PORTED / DECLINED partition — five
12
12
  * sets, all empty once the port finished. They were deleted when the port bookkeeping retired
@@ -16,16 +16,18 @@
16
16
  * Split out of `server.mjs` because it is the half a reader consults to answer "does the console
17
17
  * expose X?", which has nothing to do with sockets, daemons or gzip.
18
18
  */
19
+ import { installTargets } from '../hosts/installs.mjs';
19
20
  import { formatValue, isTruthy, parseJson } from '../lib/json.mjs';
20
21
  import { percentDecode } from '../lib/text.mjs';
21
- import { apiExcludesMutate, apiInstallToggle, apiLoopsPresetMutate, apiMcp, apiMemoryDelete, apiSelectView } from './actions.mjs';
22
+ import { apiExcludesMutate, apiInstallToggle, apiLoopsPresetMutate, apiMcp, apiMemoryDelete, targetView } from './actions.mjs';
22
23
  import { apiActivity, apiActivityDetail, apiActivityToggle } from './activity.mjs';
23
24
  import {
24
25
  apiDiff, apiDoctor, apiExcludes, apiFleet, apiInstalls, apiKits, apiLoops, apiLoopsActive, apiOverview,
25
- apiRecent, apiSetup, apiThemes, apiUpdate,
26
+ apiRecent, apiSetup, apiThemes, activeInstalls, apiUpdate,
26
27
  } from './api.mjs';
27
- import { NotFound, apiCatalog, apiItem } from './catalog.mjs';
28
+ import { FLEET_SECTIONS, NotFound, apiCatalog, apiItem } from './catalog.mjs';
28
29
  import { apiUsage } from './usage-api.mjs';
30
+ import { fleetSort } from './state.mjs';
29
31
  import { apiGates } from './gates-api.mjs';
30
32
  import { apiProfile, apiProfileSave, apiRules, apiRulesMutate, apiRulesPromote } from './user-files.mjs';
31
33
 
@@ -47,7 +49,6 @@ import { apiProfile, apiProfileSave, apiRules, apiRulesMutate, apiRulesPromote }
47
49
  export const POST_ROUTES = new Map([
48
50
  ['/api/install', [apiInstallToggle, true]],
49
51
  ['/api/excludes', [apiExcludesMutate, true]],
50
- ['/api/view', [apiSelectView, true]],
51
52
  ['/api/activity', [apiActivityToggle, false]],
52
53
  // The dispatch wrapper resolves `name` from the body itself; `apiMemoryDelete` takes a bare
53
54
  // slug string, not the body object, unlike the other routes here.
@@ -62,6 +63,34 @@ export const POST_ROUTES = new Map([
62
63
  ['/api/loops/preset', [apiLoopsPresetMutate, false]],
63
64
  ]);
64
65
 
66
+ /**
67
+ * The POSTs whose body `{host, path}` names the install they act on (`installView`), opt-in
68
+ * rather than every POST: in `/api/install` and `/api/actions/install` the pair is
69
+ * the target the route resolves itself, and in `/api/actions/deploy`, `/api/excludes` and
70
+ * `/api/reveal` a `path` is a folder or a config file, not an install. The two `actions/` rows
71
+ * are the only actions that read the request's install.
72
+ */
73
+ export const VIEW_POSTS = new Set(['/api/activity', '/api/memory/delete', '/api/rules',
74
+ '/api/rules/promote', '/api/profile', '/api/actions/restore', '/api/actions/build']);
75
+
76
+ /**
77
+ * The GETs that answer for the whole machine, not one install: they IGNORE a `?host=&path=`
78
+ * pair (it is neither checked nor used) and always read the daemon's state. Ignored rather
79
+ * than refused, so a client may send its install on every read. On the daemon's state, not a
80
+ * view, because `/api/update` keeps its daily check and the `.git`-lock guard
81
+ * (`_behind.inflight`) there, and the update job checks only that one. `/api/activity` merges
82
+ * every active install's sessions; its detail (`/api/activity/<sid>`, a prefix route) and its
83
+ * toggle (a `VIEW_POSTS` write) still take the pair. Every other `/api/*` GET, ping and jobs
84
+ * aside, takes the pair and refuses an unknown one.
85
+ *
86
+ * The Library's fleet lists (`/api/catalog/skills|agents|memory|notebook`) are here because they
87
+ * read every active install (`fleetOf`), which caches one view per install on the daemon state;
88
+ * the other catalog sections, and `/api/item/`, stay install-scoped (`PREFIX_ROUTES`).
89
+ */
90
+ export const MACHINE_GETS = new Set(['/api/update', '/api/installs', '/api/fleet', '/api/kits',
91
+ '/api/usage', '/api/gates', '/api/excludes', '/api/mcp', '/api/loops/active', '/api/activity',
92
+ '/api/catalog/skills', '/api/catalog/agents', '/api/catalog/memory', '/api/catalog/notebook']);
93
+
65
94
  /**
66
95
  * The 409 column, exported so a test can assert it directly. Giving `/api/activity` the 409
67
96
  * treatment is the invisible mutation: nothing in normal use can force the `ok: false` arm
@@ -114,20 +143,45 @@ export function readJsonBody(buf) {
114
143
  }
115
144
 
116
145
  /**
117
- * The prefix routes — path in, response out.
146
+ * Every ACTIVE install as `{install, state}`, the Library's fleet lists' source (skills, agents,
147
+ * memory, notebook: `FLEET_SECTIONS`): `install`
148
+ * is the usage ledger's `host:scope:root` key, `state` the install's cached view off the daemon
149
+ * state `base` (`targetView`), so each install keeps its own inventory cache. ONE
150
+ * `installTargets()` scan: the targets it yields are the allowlist, so no view re-checks its
151
+ * pair the way a request-named one must (`installView`). In the console's install order
152
+ * (`fleetSort`), not as `installTargets` yields, which puts the cwd's projects first. No active
153
+ * install leaves `base` alone, keyless, as one install answered.
154
+ */
155
+ function fleetOf(base) {
156
+ const views = fleetSort([...activeInstalls(installTargets())], (t) => [t[0], t[1]])
157
+ .map(([host, scope, root]) => ({ install: `${host}:${scope}:${root}`,
158
+ state: targetView(base, [host, scope, root]) }));
159
+ return views.length ? views : [{ install: null, state: base }];
160
+ }
161
+
162
+ /**
163
+ * The prefix routes — path in, response out. `base` is the daemon's own state, which `state`
164
+ * is when the request named no install: the fleet's views are cached there, never on a view.
118
165
  *
119
166
  * `percentDecode` and not `decodeURIComponent`: the JS builtin throws a `URIError` on a `%`
120
167
  * that is not an escape, where this shell instead answers a 404 naming the literal text.
121
168
  */
122
- /** @type {Array<[string, (state: any, path: string) => any]>} */
169
+ /** @type {Array<[string, (state: any, path: string, base: any) => any]>} */
123
170
  export const PREFIX_ROUTES = [
124
- ['/api/catalog/', (state, p) => apiCatalog(state, p.split('/').pop())],
171
+ // The `FLEET_SECTIONS` list every install (`MACHINE_GETS`); the other sections the named one.
172
+ ['/api/catalog/', (state, p, base) => {
173
+ const sec = p.split('/').pop();
174
+ return apiCatalog(state, sec, FLEET_SECTIONS.includes(sec) ? fleetOf(base) : undefined);
175
+ }],
125
176
  // /api/item/<type>/<name> — TYPE has no slash, the NAME keeps its slashes so a wiki
126
177
  // page's relpath survives. A missing name is a 404 here rather than a 500 two frames down.
127
- ['/api/item/', (state, p) => {
178
+ // Install-scoped: a skill, agent, memory or notebook entry is the named install's copy, else
179
+ // the fleet's first.
180
+ ['/api/item/', (state, p, base) => {
128
181
  const m = /^\/api\/item\/([^/]+)\/(.+)$/.exec(p);
129
182
  if (!m) throw new NotFound(p);
130
- return apiItem(state, m[1], percentDecode(m[2]));
183
+ const fleet = ['skill', 'agent', 'memory', 'notebook'].includes(m[1]) ? fleetOf(base) : undefined;
184
+ return apiItem(state, m[1], percentDecode(m[2]), fleet);
131
185
  }],
132
186
  // The sid is passed through unquoted — `apiActivityDetail`'s safe-name scheme is what
133
187
  // makes the lookup safe, rather than a check out here.
package/js/web/server.mjs CHANGED
@@ -22,22 +22,22 @@
22
22
  * port's NOT_PORTED / DECLINED partition emptied for good and was retired — the declared
23
23
  * surface now lives in `js/web/routes.mjs` and `tests/unit/web_server.test.mjs`.
24
24
  */
25
- import { GLOBAL_MANIFEST, resolvePath } from '../hosts/hosts.mjs';
25
+ import { resolvePath } from '../hosts/hosts.mjs';
26
26
  import { isFile, printOut } from '../lib/fs.mjs';
27
27
  import { which } from '../lib/paths.mjs';
28
28
  import { parseIntStrict } from '../lib/text.mjs';
29
29
  import { promptLine } from '../lib/prompt.mjs';
30
- import { fallbackView, warmDoctor, webState } from './state.mjs';
30
+ import { deployed } from './catalog.mjs';
31
+ import { defaultView, warmDoctor, webState } from './state.mjs';
31
32
  import { clearDaemon, codeStamp, openUrl, readDaemon, restartDaemon, startDaemon, statusDaemon, stopDaemon, writeDaemon } from './daemon.mjs';
32
33
  import { makeHandler } from './handler.mjs';
33
34
  import { JobManager } from './jobs.mjs';
34
35
  import { spawnSync } from 'node:child_process';
35
36
  import { randomBytes } from 'node:crypto';
36
- import { existsSync } from 'node:fs';
37
37
  import { createServer } from 'node:http';
38
38
  import { join, resolve as pathResolve } from 'node:path';
39
39
  import { fileURLToPath } from 'node:url';
40
- import { sweepActivity } from '../hosts/activity.mjs';
40
+ import { sweepInstalls } from './activity.mjs';
41
41
 
42
42
  const ROOT = pathResolve(import.meta.dirname, '..', '..');
43
43
 
@@ -133,13 +133,13 @@ export async function serve({ theme = null, port = 4747, openBrowser = true,
133
133
  }
134
134
  }
135
135
  const state = webState(theme);
136
- // The daemon record and the job file stay at the DEFAULT target, captured before the view
137
- // moves: `geneseed web stop`/`status` find them through `webState(theme).target`, which never
138
- // moves, and a view that followed a Bob-only install into ~/.bob would hide the record.
136
+ // The daemon record and the job file stay at the FIRST target, captured before the state
137
+ // moves to the default install: `geneseed web stop`/`status` find them through
138
+ // `webState(theme).target`, which never moves, and a state on a Bob-only ~/.bob would hide it.
139
139
  const home = state.target;
140
- const fallback = fallbackView(home);
141
- if (fallback) state.selectView(...fallback);
142
- if (!existsSync(join(state.target, GLOBAL_MANIFEST))) {
140
+ const def = defaultView();
141
+ if (def) state.selectView(...def);
142
+ if (!deployed(state)) {
143
143
  printOut(`[web] no deployed harness at ${state.target}.\n`);
144
144
  printOut(' Run `geneseed setup` first — serving anyway (read-only UI).\n');
145
145
  }
@@ -154,9 +154,10 @@ export async function serve({ theme = null, port = 4747, openBrowser = true,
154
154
  // Read by `/api/update`, whose background `git fetch` must not race a running update's pull.
155
155
  state.jobBusy = () => jm.busy;
156
156
  const srv = createServer(makeHandler(state, jm, token, dist, holder));
157
- // A GET only reads, and the OpenCode plugin never sweeps: ended sessions are archived here,
158
- // once at start and every 10 minutes. Best-effort — a sweep failure never stops the console.
159
- const sweep = () => { try { sweepActivity(join(state.target, 'activity')); } catch { /* best-effort */ } };
157
+ // A GET only reads, and the OpenCode plugin never sweeps: ended sessions are archived here, in
158
+ // every active install, once at start and every 10 minutes. Best-effort — a sweep failure never
159
+ // stops the console.
160
+ const sweep = () => { try { sweepInstalls(); } catch { /* best-effort */ } };
160
161
  sweep();
161
162
  setInterval(sweep, 600_000).unref();
162
163
  // A client trickling headers or a body (slowloris) would hold a socket forever otherwise; every
package/js/web/state.mjs CHANGED
@@ -8,7 +8,8 @@
8
8
  import { existsSync } from 'node:fs';
9
9
  import path from 'node:path';
10
10
 
11
- import { CLAUDE_STYLE, GLOBAL_MANIFEST, HOSTS, opencodeConfigDir } from '../hosts/hosts.mjs';
11
+ import { CLAUDE_STYLE, HOSTS, opencodeConfigDir, resolvePath } from '../hosts/hosts.mjs';
12
+ import { normcase } from '../lib/paths.mjs';
12
13
  import {
13
14
  EMIT_HOST_SCOPE, footprintOfDir, installState, installTargets, installedDefaults, modeOfDir,
14
15
  postureOfDir, themeOfDir, trustOfDir,
@@ -30,22 +31,42 @@ export function viewCfg(host, scope, root) {
30
31
  return root;
31
32
  }
32
33
 
34
+ /** Two paths name the same folder: resolved, and case-folded where the filesystem folds case. */
35
+ export const samePath = (a, b) => normcase(resolvePath(a)) === normcase(resolvePath(b));
36
+
37
+ /**
38
+ * The console's ONE install order, for every fleet-wide answer (the Library's lists, the Activity
39
+ * garden): host order (`HOSTS`), then global before project, then the input's own order — the
40
+ * sort is stable. `of(item)` gives `[host, scope]`. Sorts `list` in place and returns it. Here
41
+ * beside `viewCfg`, the other per-install rule both callers use, because `activity.mjs` and
42
+ * `routes.mjs` both import this module and it imports neither.
43
+ */
44
+ export function fleetSort(list, of) {
45
+ const rank = (it) => {
46
+ const [host, scope] = of(it);
47
+ return HOSTS.findIndex((h) => h.host === host) * 2 + (scope === 'global' ? 0 : 1);
48
+ };
49
+ return list.sort((a, b) => rank(a) - rank(b));
50
+ }
51
+
33
52
  /**
34
- * `[target, root]` for the install the console should show when nothing picked one, or null
35
- * when the current target is already deployed or nothing is.
53
+ * `[target, root]` of THE DEFAULT INSTALL — the one a request that names no install reads — or
54
+ * null when no install is active.
36
55
  *
37
- * The console used to open on the OpenCode global dir unconditionally. On a machine with only
38
- * IBM Bob (reported 2026-10) nothing is deployed there, so Overview showed the onboarding form
39
- * over a perfectly good `~/.bob`, and the selector that could re-point it hides itself below two
40
- * installs. So when `current` holds no manifest, the first ACTIVE install `installTargets`
41
- * finds is shown instead — a global before a project, in its host order.
56
+ * It is the first ACTIVE install in the console's one install order (`fleetSort`): host order
57
+ * (opencode, claude, bob, openclaude), then global before project, then the order
58
+ * `installTargets` found them.
59
+ * There is no viewed install to pick any more (the topbar selector and `POST /api/view` are
60
+ * gone): a page that wants another install names it on the request. The console once opened
61
+ * on the OpenCode global dir unconditionally, and on a Bob-only machine (reported 2026-10) it
62
+ * showed the onboarding form over a working `~/.bob`; this order cannot. The console's own
63
+ * pickers take their default from the row `/api/installs` marks `default`, which is this one.
42
64
  */
43
- export function fallbackView(current, targets = installTargets()) {
44
- if (existsSync(path.join(current, GLOBAL_MANIFEST))) return null;
65
+ export function defaultView(targets = installTargets()) {
45
66
  const active = targets.filter(([host, scope, root]) => {
46
67
  try { return installState(root, host, scope) === 'active'; } catch { return false; }
47
68
  });
48
- const pick = active.find(([, scope]) => scope === 'global') || active[0];
69
+ const pick = fleetSort(active, ([host, scope]) => [host, scope])[0];
49
70
  return pick ? [viewCfg(...pick), pick[2]] : null;
50
71
  }
51
72
 
@@ -74,6 +95,10 @@ export function stampMinute(ms) {
74
95
  * the hook shim, the hook shell, the OpenCode config dirs, the deployed install): a memory
75
96
  * delete passes `{ doctor: false }` and keeps the ~3.6 s verdict. Rule and profile writes do not
76
97
  * call `refresh()` at all. Every other caller keeps the default, so a new one is slow, never stale.
98
+ *
99
+ * A request may name another install (`installView` in actions.mjs): that one gets its OWN
100
+ * state, made by this factory, cached in `_views` and `pinned`, so the caching above holds per
101
+ * install. `refresh()` on the daemon's state reaches every view.
77
102
  */
78
103
  export function webState(theme = null, target = null) {
79
104
  const st = {
@@ -96,6 +121,12 @@ export function webState(theme = null, target = null) {
96
121
  // `diffCollect`'s memo of `expected` renders, made on first use by `api.mjs` (`memoOf`);
97
122
  // it re-renders on its own key change, so `refresh()` leaves it alone.
98
123
  renderMemo: null,
124
+ // True for a per-install view (`installView` in actions.mjs): `refresh` must never re-point
125
+ // it at another install, since the request named THIS one.
126
+ pinned: false,
127
+ // The per-install views made off this daemon's state, keyed `[host, root]` — see
128
+ // `installView`. Kept here, not at module level, so each handler (each test's) has its own.
129
+ _views: new Map(),
99
130
  };
100
131
  // The INSTALL ROOT (== build --out). For globals it IS the data dir; a claude/bob/openclaude
101
132
  // PROJECT install keeps its data under <repo>/.claude|.bob|.openclaude while the markers
@@ -183,12 +214,14 @@ export function webState(theme = null, target = null) {
183
214
  st._inv = null;
184
215
  st._doctor = null;
185
216
  };
186
- st.refresh = ({ doctor = true } = {}) => {
187
- // A job may have deployed the first install while the view still points at an empty
188
- // default (the onboarding Build), or removed the one in view: follow it to one that exists.
217
+ /** This state alone. `refresh` below is what callers use: it also reaches every view. */
218
+ st.refreshOwn = ({ doctor = true } = {}) => {
219
+ // A job may have deployed the first install, or switched off or removed the default, so
220
+ // the daemon's own state moves to whatever the default install is now (`defaultView`).
189
221
  // Only on a full refresh: `{ doctor: false }` marks a mutation that cannot change installs.
190
- const fallback = doctor ? fallbackView(st.target) : null;
191
- if (fallback) { st.selectView(...fallback); return; }
222
+ // Never for a pinned view: it answers for the install its request named, or is refused.
223
+ const def = doctor && !st.pinned ? defaultView() : null;
224
+ if (def && !samePath(def[0], st.target)) { st.selectView(...def); return; }
192
225
  st._inv = null;
193
226
  if (doctor) st._doctor = null;
194
227
  st.emit = st.detectEmit() || st.emit;
@@ -196,6 +229,14 @@ export function webState(theme = null, target = null) {
196
229
  st.theme = themeOfDir(st.root, host) || themeOfDir(st.target, host) || st.theme;
197
230
  readMarkers(host);
198
231
  };
232
+ /**
233
+ * After a mutation, this state AND every per-install view made off it: a job or a write
234
+ * through one view can change what any other one reads (the same install, seen twice).
235
+ */
236
+ st.refresh = (opts = {}) => {
237
+ st.refreshOwn(opts);
238
+ for (const v of st._views.values()) v.refreshOwn(opts);
239
+ };
199
240
  return st;
200
241
  }
201
242
 
@@ -28,6 +28,7 @@ import path from 'node:path';
28
28
  import { USAGE_LEDGER, USAGE_OFF } from '../hosts/usage.mjs';
29
29
  import { installTargets } from '../hosts/installs.mjs';
30
30
  import { activeInstalls, lastDays } from './api.mjs';
31
+ import { deployedLayer } from './catalog.mjs';
31
32
 
32
33
  const DAY_MS = 24 * 60 * 60 * 1000;
33
34
  const WINDOW = 30;
@@ -88,12 +89,15 @@ export function usageSummary({ now = Date.now(), targets = installTargets() } =
88
89
  counts.set(key, (counts.get(key) || 0) + 1);
89
90
  fired.add(`${e.kind}\u0000${e.name}`);
90
91
  }
91
- for (const name of listOr(path.join(dir, 'skills'))) {
92
- if (existsSync(path.join(dir, 'skills', name, 'SKILL.md')) && !fired.has(`skill\u0000${name}`)) {
92
+ // The specs the host loads: for an OpenCode project install that is `<repo>/.opencode`, not
93
+ // the root's flat bundle (the ledger above stays in the root's notebook/).
94
+ const layer = deployedLayer({ target: dir }) ?? dir;
95
+ for (const name of listOr(path.join(layer, 'skills'))) {
96
+ if (existsSync(path.join(layer, 'skills', name, 'SKILL.md')) && !fired.has(`skill\u0000${name}`)) {
93
97
  never.push({ install, kind: 'skill', name });
94
98
  }
95
99
  }
96
- for (const f of listOr(path.join(dir, 'agents'))) {
100
+ for (const f of listOr(path.join(layer, 'agents'))) {
97
101
  const name = f.endsWith('.md') ? f.slice(0, -3) : null;
98
102
  if (name && !fired.has(`agent\u0000${name}`)) never.push({ install, kind: 'agent', name });
99
103
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "Every field here is argued and gated in tests/unit/package_manifest.test.mjs. `files`, `bin` and `engines` each have a test that fails when reality drifts from this file; `version` mirrors harness.config.json and is gated too. Read that docblock before editing this one.",
3
3
  "name": "geneseed",
4
- "version": "4.30.0",
4
+ "version": "4.31.0",
5
5
  "description": "A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent.",
6
6
  "keywords": [
7
7
  "ai",
@@ -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-BxjLd7Qd.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,Q as m,T as h,W as ee,Y as te,bt as g,ct as _,j as v,k as ne,rt as y,u as re,w as b}from"./index-CzDi9JpF.js";import{t as x}from"./EmptyState-1sPNleqv.js";import{a as S,c as C,d as w,f as T,g as E,h as D,i as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F,u as I}from"./Bonsai-_YyexVC5.js";import{t as ie}from"./usePoll-bDFN-Hr6.js";var L=e(t(),1),R=n(),z=4,B=56*z,V=24,H=165,U=188,W=e=>{let t=P(e);return t==null?null:Math.round(t*100)};function G(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=W(e);return[`${e.title||s(e.cwd)||e.session_id}, ${e.chip||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 K({s:e,t,mine:n}){let r=W(e);return(0,R.jsxs)(`div`,{className:`card gd-card`,children:[(0,R.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`dt`,{children:`model`}),(0,R.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,R.jsx)(`dt`,{children:`turns`}),(0,R.jsx)(`dd`,{children:e.turns||0}),(0,R.jsx)(`dt`,{children:`context`}),(0,R.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,R.jsx)(`dt`,{children:`compactions`}),(0,R.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,R.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,R.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 q({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let c=E(e,n),l=(0,L.useMemo)(()=>I(e,{sakura:n}),[c]),u=o[e.status]||o.idle,d=Array.isArray(e.loops)?e.loops[0]:null,f=e.status!==`idle`,p=S(e),m=(0,L.useCallback)(e=>a(p,e),[a,p]);return(0,R.jsxs)(`a`,{className:`gd-tree${v(e)?` gd-needs`:``}`,href:e.href||C(e.session_id),"aria-label":G(e,l,r),"data-sid":e.session_id,onMouseEnter:e=>a(p,null,Y(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(p,null,Y(e.currentTarget)),onBlur:()=>a(null,null),children:[(0,R.jsxs)(`div`,{className:`gd-label`,children:[(0,R.jsxs)(`div`,{className:`act-ell`,children:[(0,R.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip||e.host||`?`}),` `,e.title||s(e.cwd)||e.session_id]}),(0,R.jsxs)(`div`,{className:`row gap-8 gd-sub`,children:[(0,R.jsx)(`span`,{className:`badge ${u.cls}`,children:u.label}),t&&(0,R.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),d&&(0,R.jsxs)(`span`,{className:`badge`,children:[`↻ `,d.title,d.iteration==null?``:` ${d.iteration}`]}),e.attribution===!1&&(0,R.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`}),e.phase&&(0,R.jsx)(`span`,{className:`dim act-ell`,children:e.phase})]})]}),(0,R.jsx)(N,{t:l,pad:i,swaying:f,onPad:m,px:z})]})}function J({pairs:e,count:t}){if(!e.length)return null;let n=t*B+(t-1)*V,r=e=>e*(B+V)+B/2;return(0,R.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*z+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,R.jsxs)(`g`,{className:o,children:[(0,R.jsx)(`path`,{d:`M${e} ${H} C${n} 179 ${n} 159 ${t} 169`}),(0,R.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${H}`})]},`${i}-${a}`)}return(0,R.jsx)(`g`,{className:o,children:(0,R.jsx)(`path`,{d:`M${r(i)} ${U} Q${(r(i)+r(a))/2} 222 ${r(a)} ${U}`})},`${i}-${a}`)})})}var Y=e=>e.offsetLeft-(e.parentElement?.scrollLeft||0);function ae({sessions:e,collisions:t}){let[n,r]=(0,L.useState)(O),[i,a]=(0,L.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(A,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=j(w(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>k(e,s);return(0,R.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,R.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,R.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,R.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Sakura`})]}),l.length>0&&(0,R.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,R.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,R.jsx)(X,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function X({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,L.useState)({sid:null,pad:null,x:0}),o=(0,L.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=e.trees.find(e=>S(e.s)===i.sid)?.s,c=s?I(s,{sakura:t}):null,l=c&&i.pad!=null?c.pads[i.pad]:null;return(0,R.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,children:[(0,R.jsxs)(`h3`,{className:`act-lbl gd-shelf-h`,children:[e.name,` `,(0,R.jsxs)(`span`,{className:`dim`,children:[`· `,e.trees.length]})]}),(0,R.jsxs)(`div`,{className:`gd-row`,children:[e.trees.map(({s:e,worktree:n})=>(0,R.jsx)(q,{s:e,worktree:n,sakura:t,mine:r(S(e)),pad:S(e)===i.sid?i.pad:null,onHover:o},S(e))),(0,R.jsx)(J,{pairs:D(e.trees,n),count:e.trees.length})]}),s&&(0,R.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:l?(0,R.jsx)(F,{pad:l}):(0,R.jsx)(K,{s,t:c,mine:r(S(s))})})]})}var Z=e=>e.catch(()=>null);function Q({s:e}){let t=(0,L.useId)(),n=e.todos,r=a(e);return(0,R.jsxs)(`a`,{className:`card pad-md act-card`,href:e.href||C(e.session_id),"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,R.jsxs)(b,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:[e.chip&&(0,R.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip}),(0,R.jsx)(y,{name:`chevron`,className:`glyph act-chev`})]}),n&&n.total>0&&(0,R.jsx)(`div`,{className:`act-foot`,children:(0,R.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,R.jsx)(c,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,R.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,_(e.updated_at),` ago`]})]})}var $={blocked:`is blocked`,"waiting-input":`waits for your answer`};function oe(e,t){if(!Array.isArray(t))return``;let n=t.filter(v),r=e.current;return e.current=new Set(n.map(e=>`${S(e)}:${e.status}`)),r?n.filter(e=>!r.has(`${S(e)}:${e.status}`)).map(e=>`${e.title||s(e.cwd)||e.session_id} ${$[e.status]}`).join(`. `):``}var se=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function ce(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:se.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function le(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 ue({enabled:e,installs:t,onToggle:n}){let r=T(t);return(0,R.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,R.jsx)(y,{name:`activity`,className:`glyph act-fixed`}),(0,R.jsxs)(`div`,{className:`act-grow`,children:[(0,R.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,R.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,R.jsxs)(`ul`,{className:`stack gap-8 act-fixed act-sm`,"aria-label":`Tracking per install`,children:[t.length===0&&(0,R.jsx)(`li`,{className:`dim`,children:`No active install to track.`}),t.map((e,t)=>(0,R.jsxs)(`li`,{className:`row gap-10`,children:[(0,R.jsxs)(`span`,{id:`act-track-l${t}`,title:e.path,children:[`Track live sessions in `,(0,R.jsx)(`span`,{className:`mono`,children:r.get(e.install)})]}),(0,R.jsx)(`div`,{className:`sw-toggle${e.enabled?` on`:``}`,role:`switch`,"aria-checked":e.enabled,"aria-labelledby":`act-track-l${t}`,tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.key===` `&&t.preventDefault(),n(e))}})]},e.install))]})]})}function de({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,R.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,R.jsxs)(`div`,{className:`act-stat-head`,children:[(0,R.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,R.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,R.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,R.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,R.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${f(e.key)}: ${e.n}`},e.key):(0,R.jsx)(`i`,{className:`zero`},e.key))}),(0,R.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{children:f(r[0].key)}),(0,R.jsx)(`span`,{children:f(r[7].key)}),(0,R.jsx)(`span`,{children:`today`})]}),c&&(0,R.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,R.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function fe({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,R.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,R.jsxs)(`div`,{className:`act-stat-head`,children:[(0,R.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,R.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,R.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,R.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,R.jsxs)(`li`,{children:[(0,R.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,R.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,R.jsx)(h,{vals:e.per_day,i:t,sweep:!0}),(0,R.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,R.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var pe={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function me({job:e,longest:t}){let n=l(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=pe[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,R.jsxs)(`li`,{className:`act-row`,children:[(0,R.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,R.jsx)(y,{name:`play`,className:`glyph act-glyph`}),(0,R.jsxs)(`span`,{className:`act-what`,children:[(0,R.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,R.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,R.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,R.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,R.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function he({gate:e}){return(0,R.jsxs)(`li`,{className:`act-row gate`,children:[(0,R.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,R.jsx)(y,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,R.jsxs)(`span`,{className:`act-what`,children:[(0,R.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,R.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,R.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var ge=5,_e=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function ve(){let[e,t]=(0,L.useState)(null),[n,a]=(0,L.useState)(``),[o,c]=(0,L.useState)(ce),[l,d]=(0,L.useState)(!1),[f,h]=(0,L.useState)(``),_=(0,L.useRef)(null),y=e=>{let t={...o,...e};c(t),le(t)};ie(e=>r.activity().then(n=>{if(e()){t(n),a(``);let e=oe(_,n?.activity);e&&h(t=>t===e?e+`\xA0`:e)}},t=>{e()&&a(t.message)}),2e3,[]);let b=g(()=>Z(r.jobs()),[]),C=g(()=>Z(r.gates()),[]),w=g(()=>Z(r.catalog(`laws`)),[]),T=!e||e.enabled!==!1,E=Array.isArray(e?.installs)?e.installs:[],D=M(e?.activity,E).sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),O=i(),k=T&&e?D.filter(v).length:null,A=new Set(D.map(S)),j=M(e?.ended,E).filter(e=>!A.has(S(e))),N=_e([...D,...j].map(e=>e.host),o.host),P=_e([...D,...j].map(e=>s(e.cwd)),o.project),F=o.host&&o.project?`host or project`:o.host?`host`:o.project?`project`:``,I=e=>(!o.host||e.host===o.host)&&(!o.project||s(e.cwd)===o.project),z=D.filter(e=>I(e)&&(o.f!==`needs`||v(e))),B=o.f===`all`||o.f===`needs`,V=o.f===`all`&&T?j.filter(I):[],H=l?V:V.slice(0,ge),U=!F&&(o.f===`all`||o.f===`runs`),W=!F&&(o.f===`all`||o.f===`gates`),G=b.data?.jobs||[],K=re(C.data,w.data),q=ne(G,K,C.data?.days).map(e=>({...e,runs:U?e.runs:[],gate:W?e.gate:null})).filter(e=>e.runs.length||e.gate),J=Math.max(0,...G.map(e=>e.duration||0)),Y=p(q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),X=async e=>{let n=!e.enabled;try{let i=await r.activityToggle(n,{host:e.host,path:e.path});if(i.ok===!1){a(i.error||`Could not change tracking`);return}let o=t=>i.enabled?t||[]:(t||[]).flatMap(t=>{let n=(t.installs||[t.install]).filter(t=>t!==e.install);return n.length?[{...t,install:n[0],installs:n}]:[]});t(t=>{let n=(t?.installs||[]).map(t=>t.install===e.install?{...t,enabled:i.enabled}:t);return{...t||{},installs:n,enabled:n.length===0||n.some(e=>e.enabled),activity:o(t?.activity),ended:o(t?.ended)}}),a(``)}catch(e){a(e.message)}},$=(e,t,n)=>(0,R.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,R.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,R.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=>y({[e]:t.target.value}),children:[(0,R.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,R.jsx)(`option`,{value:e,children:e},e))]})]});return(0,R.jsxs)(`div`,{className:`page-fill`,children:[(0,R.jsx)(ee,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,R.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:f}),n&&(0,R.jsx)(`div`,{className:`act-gap`,children:(0,R.jsx)(u,{error:n})}),e&&(0,R.jsx)(ue,{enabled:T,installs:E,onToggle:X}),(0,R.jsxs)(`div`,{className:`act-today`,children:[(0,R.jsx)(de,{jobs:b.data,loading:b.loading}),(0,R.jsx)(fe,{rows:K,gates:C.data,loading:C.loading}),(0,R.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,R.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,R.jsxs)(`span`,{className:`act-big act-wait`,children:[k??`—`,` `,(0,R.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,R.jsx)(`p`,{className:`dim act-sm`,children:T?`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,R.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,R.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:se.map(([e,t])=>(0,R.jsxs)(`button`,{type:`button`,className:o.f===e?`chip-f on`:`chip-f`,"aria-pressed":o.f===e,onClick:()=>y({f:e}),children:[t,e===`needs`&&k>0?(0,R.jsxs)(`span`,{className:`mono`,children:[` `,k]}):null]},e))}),$(`host`,`Host`,N),$(`project`,`Project`,P),(0,R.jsx)(m,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,R.jsx)(`button`,{type:`button`,className:o.v===e?`on`:``,"aria-pressed":o.v===e,onClick:()=>y({v:e}),children:t},e))})]}),F&&o.f!==`needs`&&(0,R.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,F,`; showing sessions only.`]}),B&&(e?!T&&o.f!==`needs`?null:z.length===0?o.f===`needs`?(0,R.jsx)(x,{title:`Nothing waits on you`}):(0,R.jsxs)(x,{title:`No active sessions`,children:[`Run `,(0,R.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):o.v===`garden`?(0,R.jsx)(ae,{sessions:z,collisions:e.collisions}):(0,R.jsx)(`div`,{className:`stack gap-12 act-live`,ref:O,children:z.map(e=>(0,R.jsx)(`div`,{"data-flip":S(e),children:(0,R.jsx)(Q,{s:e})},S(e)))}):(0,R.jsx)(te,{label:`Reading live sessions…`})),V.length>0&&(0,R.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,R.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),H.map(e=>(0,R.jsx)(`div`,{children:(0,R.jsx)(Q,{s:e})},S(e))),V.length>ge&&(0,R.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":l,onClick:()=>d(e=>!e),children:l?`Show fewer`:`Show all ${V.length}`})]}),o.f!==`needs`&&(0,R.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:Y,children:q.map(e=>(0,R.jsxs)(`section`,{className:`card act-day`,children:[(0,R.jsxs)(`h3`,{className:`act-day-h`,children:[(0,R.jsx)(`span`,{children:e.title}),(0,R.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,R.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,R.jsx)(me,{job:e,longest:J},e.id)),e.gate&&(0,R.jsx)(he,{gate:e.gate})]})]},e.key))})]})}export{ve 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-BxjLd7Qd.js";import{D as i,J as a,O as o,W as s,Y as c,ct as l,j as u,rt as d,w as f}from"./index-CzDi9JpF.js";import{t as p}from"./EmptyState-1sPNleqv.js";import{g as m,i as h,l as g,r as _,s as v,t as y,u as b}from"./Bonsai-_YyexVC5.js";import{t as x}from"./usePoll-bDFN-Hr6.js";var S=e(t(),1),C=n();function w(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 T({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,C.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,C.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,C.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,C.jsx)(`span`,{className:`feed-dot act-inline-dot ${w(e)||`acc`}`}),e.kind===`thinking`&&(0,C.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,C.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,C.jsx)(`b`,{children:i}),e.error&&(0,C.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,C.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,C.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 E({turns:e}){return!e||e.length===0?(0,C.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,C.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,C.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,C.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,C.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var D=5;function O({s:e}){let[t]=(0,S.useState)(h),[n,r]=(0,S.useState)(null),i=!!e.ended,a=i?{...e,status:u(e)?`busy`:e.status,error:null}:e,o=m(a,t),s=(0,S.useMemo)(()=>b(a,{sakura:t}),[o]),c=(0,S.useCallback)(e=>r(e),[]),l=v(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(` · `),g=n==null?null:s.pads[n];return(0,C.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!i&&u(e)?` gd-needs`:``}`,children:[(0,C.jsx)(_,{t:s,pad:n,swaying:!i&&e.status!==`idle`,onPad:c,px:D,label:`Bonsai of this session${i?`, ended`:``}: ${p}`}),(0,C.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[i&&(0,C.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,C.jsx)(`div`,{className:`dim act-sm`,children:p}),g?(0,C.jsx)(y,{pad:g}):(0,C.jsx)(`div`,{className:`dim act-xs`,children:`Hover a pad for the files it changed.`})]})]})}function k({sid:e}){let{sid:t,install:n}=g(e,window.location.hash),[o,u]=(0,S.useState)(null),[m,h]=(0,S.useState)(``),[_,v]=(0,S.useState)(!1),[y,b]=(0,S.useState)(!1),w=(0,S.useId)();x(e=>_?void 0:r.activityDetail(t,n).then(t=>{e()&&(u(t),h(``),v(!1))},t=>{e()&&(t.status===404?v(!0):h(t.message))}),2e3,[t,_]);let D=(0,C.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,C.jsx)(d,{name:`arrow`}),` Activity`]});if(_)return(0,C.jsxs)(`div`,{className:`page-fill`,children:[D,(0,C.jsx)(p,{title:`Session ended`,action:(0,C.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!o)return(0,C.jsxs)(`div`,{className:`page-fill`,children:[D,m?(0,C.jsx)(a,{error:m}):(0,C.jsx)(c,{label:`Loading session…`})]});let k=o.session,A=k.files,j=k.todos,M=!!(A&&A.items&&A.items.length>0),N=!!(j&&j.items&&j.items.length>0),P=o.conversation||[],F=o.timeline||[],I=[...P.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...F.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,C.jsxs)(`div`,{className:`page-fill`,children:[D,(0,C.jsx)(s,{title:k.title||i(k.cwd)||k.session_id,sub:k.cwd?(0,C.jsx)(`span`,{className:`mono act-cwd`,title:k.cwd,children:k.cwd}):null}),m&&(0,C.jsx)(`div`,{className:`act-gap`,children:(0,C.jsx)(a,{error:m})}),(0,C.jsxs)(`div`,{className:`card pad-md`,children:[(0,C.jsx)(f,{s:k}),(0,C.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,l(k.updated_at),` ago`]})]}),(0,C.jsx)(O,{s:k}),(M||N)&&(0,C.jsxs)(`div`,{className:`grid gap-12 act-panels${M&&N?` two`:``}`,children:[M&&(0,C.jsxs)(`div`,{className:`card pad-md`,children:[(0,C.jsx)(`div`,{className:`card-head`,children:(0,C.jsxs)(`h2`,{children:[`Files touched `,(0,C.jsxs)(`span`,{className:`dim`,children:[`(`,A.count,`)`]})]})}),(0,C.jsx)(`div`,{className:`stack act-list`,children:A.items.map(e=>(0,C.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,C.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,C.jsxs)(`span`,{className:`act-fixed`,children:[(0,C.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,C.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),N&&(0,C.jsxs)(`div`,{className:`card pad-md`,children:[(0,C.jsx)(`div`,{className:`card-head`,children:(0,C.jsxs)(`h2`,{children:[`Plan`,` `,(0,C.jsxs)(`span`,{className:`dim`,children:[`(`,j.done,`/`,j.total,`)`]})]})}),(0,C.jsx)(`div`,{className:`stack act-list`,children:j.items.map((e,t)=>(0,C.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,C.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,C.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,C.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,C.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,C.jsx)(`h2`,{children:`Timeline`}),F.length>0&&(0,C.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":y,"aria-controls":w,onClick:()=>b(e=>!e),children:y?`Show conversation`:`Show full stream (${I.length})`})]}),(0,C.jsx)(`div`,{id:w,children:y?(0,C.jsx)(`div`,{className:`stack gap-12`,children:I.map((e,t)=>(0,C.jsx)(T,{rec:e},t))}):(0,C.jsx)(E,{turns:P})})]})]})}export{O as SessionTree,k as default};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";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
+ 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=>e.key??(e.install?`${e.install}\0${e.session_id}`:String(e.session_id)),j=e=>A({key:e.key??void 0,install:e.install,session_id:e.sid}),M=(e,t)=>String(e).split(/[\\/]+/).filter(Boolean).slice(-t).join(`/`);function N(e){let t=e||[],n=e=>n=>t.filter(t=>e(t)===e(n)).length,r=n(e=>e.host),i=n(e=>`${e.host} ${e.scope}`),a=new Map(t.map(e=>[e.install,r(e)<2?e.host:i(e)<2||e.scope===`global`?`${e.host} · ${e.scope}`:`${e.host} · ${D(e.path)}`])),o=()=>t.filter(e=>t.some(t=>t!==e&&a.get(t.install)===a.get(e.install)));for(let e=2,t=o();t.length;e++,t=o()){for(let n of t){let t=String(n.path).split(/[\\/]+/).filter(Boolean).length;a.set(n.install,`${n.host} · ${e>t?n.path:M(n.path,e)}`)}if(e>64)break}return a}var P=(e,t)=>`#/activity/${encodeURIComponent(e)}`+(t?`?${new URLSearchParams({host:t.host,path:t.path})}`:``);function F(e,t){let n=String(e).indexOf(`?`),r=new URLSearchParams(String(t||``).split(`?`)[1]||``),i=r.get(`host`),a=r.get(`path`);return{sid:n<0?e:String(e).slice(0,n),install:i&&a?{host:i,path:a}:void 0}}function I(e,t){let n=new Map((t||[]).map(e=>[e.install,e])),r=N(t);return(e||[]).map(e=>{let t=n.get(e.install);return{...e,host:t?.host??e.host,chip:r.get(e.install)??e.host??null,href:P(e.session_id,t)}})}var L=(e,t)=>new Set((e.writers||[]).filter(e=>j(e)===t).map(e=>O(e.root)));function R(e,t,n){let r=L(e,t);for(let t of L(e,n))if(r.has(t))return`same-worktree`;return`cross-worktree`}var z=e=>[...new Set((e.writers||[]).map(j))];function B(e,t){let n=new Map(e.map((e,t)=>[A(e.s),t])),r=new Map;for(let e of t||[]){let t=z(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=R(e,t[i],t[a]);(!r.has(c)||l===`same-worktree`)&&r.set(c,{a:o,b:s,kind:l})}}return[...r.values()]}function V(e,t){let n=[];for(let r of t||[]){let t=z(r).filter(t=>t!==e);if(!t.length||!z(r).includes(e))continue;let i=t.some(t=>R(r,e,t)===`same-worktree`);n.push({path:r.path,kind:i?`same-worktree`:`cross-worktree`})}return n}var H=e=>e?.status===`busy`||b(e);function U(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=>H(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 W=n(),G=12,K=`geneseed-garden-sakura`;function q(){try{return window.localStorage.getItem(K)===`1`}catch{return!1}}var J=e=>e.key==null?`the session`:e.type||`agent`,Y=e=>e.path||e.file||`?`;function X({pad:e}){let t=e.files.slice(0,G);return(0,W.jsxs)(`div`,{className:`card gd-card`,children:[(0,W.jsxs)(`div`,{className:`act-lbl`,children:[J(e),` · `,e.files.length,` file`,e.files.length===1?``:`s`]}),(0,W.jsx)(`ul`,{className:`gd-files`,children:t.map((e,t)=>(0,W.jsxs)(`li`,{children:[(0,W.jsx)(`span`,{className:`mono act-ell`,children:Y(e)}),(0,W.jsxs)(`span`,{className:`mono act-xs`,children:[(0,W.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions??0]}),` `,(0,W.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions??0]})]})]},`${Y(e)}:${t}`))}),e.files.length>t.length&&(0,W.jsxs)(`div`,{className:`dim act-xs`,children:[`+`,e.files.length-t.length,` more`]})]})}var Z=(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,W.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,W.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,W.jsx)(`rect`,{x:e.x,y:e.y,width:e.w,height:1,fill:e.c},`${e.x},${e.y}`))},r))})});export{A as a,P as c,k as d,N as f,T as g,B as h,q as i,F as l,V as m,K as n,U as o,I as p,Z as r,C as s,X as t,E 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{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
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{rt as r}from"./index-CzDi9JpF.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-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};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-BWWbMKmg.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-CzDi9JpF.js","assets/api-BxjLd7Qd.js","assets/index-0GCxkY7m.css","assets/OperatorHudView-Blu1lqiZ.js","assets/JournalView-C7bPD3fZ.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-BxjLd7Qd.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,Dt as u,I as d,J as f,L as p,Q as m,U as h,Y as g,at as _,bt as v,ct as y,l as b,ot as x,q as S,rt as C,st as w,t as T}from"./index-CzDi9JpF.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(),ee={done:`ok`,failed:`bad`},A={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=d(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=y(e.newest),n=e.oldest?y(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=p(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 ${ee[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:A[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}=v(()=>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:()=>u(`#/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)(C,{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=p(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:[y(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=w(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=x(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=x(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=v(()=>q(()=>i.fleet()),[e]),r=v(()=>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?b(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)(()=>T(()=>import(`./GreenhouseView-BWWbMKmg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Z=(0,E.lazy)(()=>T(()=>import(`./OperatorHudView-Blu1lqiZ.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),Q=(0,E.lazy)(()=>T(()=>import(`./JournalView-C7bPD3fZ.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,[d,p]=(0,E.useState)(`status`),_=e&&r.find(t=>t.name===e.theme)?.sigil||``,y=J({dataRev:l,needDoctor:u===`greenhouse`||u===`operator`}),{data:b}=v(()=>u===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[u,l]);if(!e)return t?(0,k.jsx)(f,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,k.jsx)(g,{});let x=e.daemon_stale?(0,k.jsx)(S,{}):null;return e.deployed?d===`status`&&u===`journal`?(0,k.jsxs)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:[x,(0,k.jsx)(Q,{overview:e,recent:b,lens:y,onDirection:p,dataRev:l})]}):(0,k.jsxs)(k.Fragment,{children:[x,(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:d===e?`on`:``,onClick:()=>p(e),"aria-pressed":d===e,"aria-label":n,children:t},e))})}),(0,k.jsxs)(`div`,{className:`view-in`,children:[d===`status`&&u===`cultivar`&&(0,k.jsx)(V,{overview:e,sigil:_,setup:a,jobs:o,lens:y,dataRev:l}),d===`status`&&u===`greenhouse`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(X,{overview:e,sigil:_,jobs:o,lens:y,onAction:s})}),d===`status`&&u===`operator`&&(0,k.jsx)(E.Suspense,{fallback:(0,k.jsx)(g,{}),children:(0,k.jsx)(Z,{overview:e,jobs:o,lens:y})}),d===`lineage`&&(0,k.jsx)(W,{overview:e,sigil:_,setup:a,jobs:o,lens:y}),d===`operator`&&(0,k.jsx)(G,{overview:e,setup:a,jobs:o,lens:y})]},d)]}):(0,k.jsxs)(k.Fragment,{children:[x,(0,k.jsx)(h,{onAction:s})]})}export{$ as default,O as i,I as n,P as r,Y as t};