geneseed 3.14.0 → 3.15.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 (88) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/SHIPPED.md +1 -1
  3. package/adapters/opencode/plugins/geneseed-context.js +23 -9
  4. package/adapters/opencode/plugins/geneseed-guard.js +16 -4
  5. package/adapters/opencode/plugins/geneseed-learn.js +37 -11
  6. package/adapters/opencode/plugins/geneseed-notify.js +37 -19
  7. package/adapters/opencode/plugins/geneseed-workflow.js +3 -1
  8. package/adapters/opencode/workflows/_runtime.js +16 -3
  9. package/bin/geneseed-cli.mjs +22 -20
  10. package/bin/geneseed-hook.mjs +6 -3
  11. package/harness.config.json +1 -1
  12. package/js/README.md +9 -5
  13. package/js/build/args.mjs +4 -3
  14. package/js/build/bundle.mjs +10 -10
  15. package/js/build/driver.mjs +8 -7
  16. package/js/build/emit-claude.mjs +3 -2
  17. package/js/build/emit-common.mjs +2 -14
  18. package/js/build/emit-opencode.mjs +12 -8
  19. package/js/build/generate.mjs +15 -11
  20. package/js/build/render.mjs +1 -1
  21. package/js/build/source.mjs +6 -6
  22. package/js/build/stubs.mjs +6 -5
  23. package/js/build/version.mjs +21 -2
  24. package/js/hosts/hooks-context.mjs +2 -1
  25. package/js/hosts/hooks-prims.mjs +2 -2
  26. package/js/hosts/hosts.mjs +24 -26
  27. package/js/hosts/installs.mjs +33 -14
  28. package/js/hosts/link.mjs +75 -26
  29. package/js/hosts/memory-files.mjs +13 -4
  30. package/js/hosts/native.mjs +106 -48
  31. package/js/hosts/opencode.mjs +44 -36
  32. package/js/hosts/shim.mjs +4 -2
  33. package/js/inspect/diff.mjs +5 -6
  34. package/js/inspect/excludes.mjs +10 -5
  35. package/js/inspect/status.mjs +18 -21
  36. package/js/inspect/validate.mjs +2 -2
  37. package/js/lib/fs.mjs +12 -11
  38. package/js/lib/json.mjs +4 -4
  39. package/js/lib/paths.mjs +27 -33
  40. package/js/lib/proc.mjs +3 -3
  41. package/js/lib/prompt.mjs +132 -0
  42. package/js/lib/text.mjs +18 -4
  43. package/js/lib/udiff.mjs +3 -2
  44. package/js/maintain/memory.mjs +5 -6
  45. package/js/maintain/migrate.mjs +4 -3
  46. package/js/maintain/setup.mjs +9 -131
  47. package/js/maintain/uninstall.mjs +10 -9
  48. package/js/maintain/update.mjs +115 -34
  49. package/js/ui/anim.mjs +8 -12
  50. package/js/ui/cli.mjs +29 -35
  51. package/js/ui/menu.mjs +7 -13
  52. package/js/ui/tui.mjs +14 -123
  53. package/js/web/actions.mjs +82 -386
  54. package/js/web/activity.mjs +1 -1
  55. package/js/web/api.mjs +33 -717
  56. package/js/web/catalog.mjs +527 -0
  57. package/js/web/daemon.mjs +21 -3
  58. package/js/web/handler.mjs +51 -27
  59. package/js/web/jobs.mjs +24 -2
  60. package/js/web/routes.mjs +61 -6
  61. package/js/web/server.mjs +4 -4
  62. package/js/web/state.mjs +138 -0
  63. package/js/web/user-files.mjs +339 -0
  64. package/package.json +1 -1
  65. package/web/dist/assets/{Activity-CjRqZnr-.js → Activity-kpWxd70F.js} +1 -1
  66. package/web/dist/assets/{ActivityDetail-OQTxKBj2.js → ActivityDetail-Ccr942VL.js} +1 -1
  67. package/web/dist/assets/Dashboard-D1lE7jcg.js +2 -0
  68. package/web/dist/assets/{Docs-CvOZ8akL.js → Docs-BHyaggFy.js} +3 -3
  69. package/web/dist/assets/{GreenhouseView-6KDjX8da.js → GreenhouseView-Sc_UDMOE.js} +1 -1
  70. package/web/dist/assets/Installs-Gw-pJ3Zi.js +2 -0
  71. package/web/dist/assets/JournalView-_gxpsxXi.js +1 -0
  72. package/web/dist/assets/{Laws-Du0-Zyp2.js → Laws-S9fq1r9T.js} +1 -1
  73. package/web/dist/assets/{Library-DOkO0TtB.js → Library-MBxadRzn.js} +1 -1
  74. package/web/dist/assets/{Loops-Dv_aLByJ.js → Loops-Da_JhlzM.js} +2 -2
  75. package/web/dist/assets/{OperatorHudView-BPP1dtLz.js → OperatorHudView--TkvDybH.js} +1 -1
  76. package/web/dist/assets/{Personal-26VPYkK0.js → Personal-CTXKHVbV.js} +1 -1
  77. package/web/dist/assets/Tabs-B0cdf8k6.js +1 -0
  78. package/web/dist/assets/api-CxgfYu18.js +1 -0
  79. package/web/dist/assets/drawable-BbWQxe82.js +1 -0
  80. package/web/dist/assets/index-ujKG1ZNf.js +2 -0
  81. package/web/dist/index.html +2 -2
  82. package/web/dist/assets/Dashboard-J-xCe_Gk.js +0 -2
  83. package/web/dist/assets/Installs-MWuhNjSm.js +0 -2
  84. package/web/dist/assets/JournalView-C8MrOz2c.js +0 -1
  85. package/web/dist/assets/Tabs-BzKuFskD.js +0 -1
  86. package/web/dist/assets/api-D_ixdyEY.js +0 -1
  87. package/web/dist/assets/drawable-zVVDbsyw.js +0 -1
  88. package/web/dist/assets/index-KHt3wE_K.js +0 -2
@@ -0,0 +1,339 @@
1
+ /**
2
+ * The two hand-written files the console EDITS — `user-rules.md` and `PROFILE.md` — read and
3
+ * written under one rule: every write carries the fingerprint of the content the client last
4
+ * read, and a stale one is refused (`ok: false`, which `routes.mjs` answers 409) rather than
5
+ * clobbering whatever an agent session wrote in between.
6
+ *
7
+ * Split out of `actions.mjs`/`api.mjs` because the fingerprint protocol is one thing with a
8
+ * reader half and a writer half, and the two halves had ended up in different files.
9
+ */
10
+ import { createHash } from 'node:crypto';
11
+ import path from 'node:path';
12
+
13
+ import { PROFILE_STUB } from '../build/stubs.mjs';
14
+ import { readMaybe } from '../hosts/installs.mjs';
15
+ import { frontmatter } from '../hosts/memory-files.mjs';
16
+ import { writeText, isFile, isDir } from '../lib/fs.mjs';
17
+ import { formatRepr, isTruthy } from '../lib/json.mjs';
18
+ import { WHITESPACE, codePointLength, stripWhitespace } from '../lib/text.mjs';
19
+ import { splitLines } from '../lib/udiff.mjs';
20
+ import { isFactName } from '../maintain/memory.mjs';
21
+ import { apiMemoryDelete, bget, strOr } from './actions.mjs';
22
+ import { NotFound, memoryDir } from './catalog.mjs';
23
+
24
+ /** Splits on runs of `WHITESPACE` (not `\s`), dropping empty strings. */
25
+ const splitWords = (s) => s.split(new RegExp(`[${WHITESPACE}]+`)).filter(Boolean);
26
+
27
+ /** Today's date, LOCAL (not UTC) — this is a user-facing date, not a wire timestamp. */
28
+ function todayIso(d = new Date()) {
29
+ const p2 = (n) => String(n).padStart(2, '0');
30
+ return `${d.getFullYear()}-${p2(d.getMonth() + 1)}-${p2(d.getDate())}`;
31
+ }
32
+
33
+ /**
34
+ * `today` and `today + n days`, from ONE sample of the clock.
35
+ *
36
+ * Two separate `new Date()` calls would let the provenance line and the expiry land on
37
+ * either side of a midnight that fell between them — a one-run-in-86400 disagreement, which
38
+ * is the worst kind to debug.
39
+ */
40
+ function promoteDates(days) {
41
+ const d = new Date();
42
+ const today = todayIso(d);
43
+ d.setDate(d.getDate() + days);
44
+ return [today, todayIso(d)];
45
+ }
46
+
47
+ /** SHA-256 hex, first 16 chars — `""` for an empty file. */
48
+ export function fingerprint(text) {
49
+ return text ? createHash('sha256').update(text, 'utf-8').digest('hex').slice(0, 16) : '';
50
+ }
51
+
52
+ /**
53
+ * Strict equality on the RAW body value, not run through `strOr` first. `strOr(0)` folds to
54
+ * `''` (0 is falsy), which would wrongly equal an absent file's `''` fingerprint and let a
55
+ * client send `"fingerprint": 0` and overwrite regardless of what is actually on disk.
56
+ */
57
+ const fpMatches = (got, want) => typeof got === 'string' && got === want;
58
+
59
+ // ---- user rules (user-rules.md) ----------------------------------------------------------
60
+
61
+ export const RULES_FILE = 'user-rules.md';
62
+ const rulesPath = (state) => path.join(state.target, RULES_FILE);
63
+
64
+ /**
65
+ * `## R<n> — Title`, anchored at column 0 so a rule body's fenced code and the stub's
66
+ * indented format example never parse as rules.
67
+ *
68
+ * The whitespace classes are `WHITESPACE`, not `\s`: this pattern runs over a HAND-EDITED
69
+ * file, which is where a non-breaking space actually turns up. `\S` is its complement for
70
+ * the same reason.
71
+ *
72
+ * `\d` IS LEFT ASCII, and that is a declared divergence rather than an oversight, unlike
73
+ * `ruleFields` below which uses `\p{Nd}`. No theme seeds a non-ASCII rule id, no build
74
+ * writes one, and the web editor cannot produce one either — it writes `R<n>` itself from
75
+ * `max(ids) + 1`. Widening this to match would only move the gap one line down, to whatever
76
+ * parses the captured digits back into a number.
77
+ */
78
+ const RULE_HEAD_RE = new RegExp(
79
+ `^##[${WHITESPACE}]+R(\\d+)[${WHITESPACE}]*[—–-]+[${WHITESPACE}]*`
80
+ + `([^${WHITESPACE}].*?)[${WHITESPACE}]*$`,
81
+ );
82
+
83
+ /** Advisory only; nothing blocks past it. */
84
+ const RULES_BUDGET = { max_rules: 15, max_tokens: 1500 };
85
+
86
+ const META_RE = new RegExp(`^\\((.+)\\)[${WHITESPACE}]*$`);
87
+
88
+ /** `{}` when the line is body rather than metadata. */
89
+ function parseRuleMeta(line) {
90
+ const m = META_RE.exec(stripWhitespace(line));
91
+ if (!m) return {};
92
+ const meta = {};
93
+ for (const part of m[1].split('|')) {
94
+ const at = part.indexOf(':');
95
+ if (at < 0) continue; // `partition` with no separator — not a pair
96
+ const key = stripWhitespace(part.slice(0, at)).toLowerCase().replaceAll(' ', '_');
97
+ if (['scope', 'source', 'trial_until'].includes(key)) {
98
+ meta[key] = stripWhitespace(part.slice(at + 1));
99
+ }
100
+ }
101
+ return meta;
102
+ }
103
+
104
+ /**
105
+ * `user-rules.md` parsed to `[rules, warnings]`.
106
+ *
107
+ * Every rule carries its `start`/`end` LINE INDICES, which is what lets `apiRulesMutate`
108
+ * splice exactly one block and leave every other byte of the user's file — prose,
109
+ * formatting, hand-written sections — untouched.
110
+ */
111
+ export function parseRules(text) {
112
+ const lines = splitLines(text);
113
+ const rules = [];
114
+ const warnings = [];
115
+ const seen = new Set();
116
+ for (let idx = 0; idx < lines.length; idx += 1) {
117
+ const m = RULE_HEAD_RE.exec(lines[idx]);
118
+ if (!m) continue;
119
+ let end = lines.length;
120
+ for (let j = idx + 1; j < lines.length; j += 1) {
121
+ if (lines[j].startsWith('## ')) { end = j; break; }
122
+ }
123
+ const rid = Number(m[1]);
124
+ if (seen.has(rid)) warnings.push(`duplicate rule id R${rid}`);
125
+ seen.add(rid);
126
+ let k = idx + 1;
127
+ while (k < end && !stripWhitespace(lines[k])) k += 1;
128
+ const meta = k < end ? parseRuleMeta(lines[k]) : {};
129
+ if (Object.keys(meta).length) k += 1;
130
+ rules.push({
131
+ id: rid,
132
+ title: m[2],
133
+ scope: Object.hasOwn(meta, 'scope') ? meta.scope : 'project',
134
+ source: Object.hasOwn(meta, 'source') ? meta.source : '',
135
+ trial_until: Object.hasOwn(meta, 'trial_until') ? meta.trial_until : '',
136
+ body: stripWhitespace(lines.slice(k, end).join('\n')),
137
+ start: idx,
138
+ end,
139
+ });
140
+ }
141
+ return [rules, warnings];
142
+ }
143
+
144
+ export function apiRules(state) {
145
+ const p = rulesPath(state);
146
+ if (!isFile(p)) {
147
+ return { exists: false, path: p, rules: [], warnings: [], fingerprint: '',
148
+ stats: { rules: 0, lines: 0, tokens: 0, ...RULES_BUDGET } };
149
+ }
150
+ const text = readMaybe(p) ?? '';
151
+ const [rules, warnings] = parseRules(text);
152
+ const today = todayIso();
153
+ const out = rules.map((r) => ({
154
+ id: r.id, title: r.title, scope: r.scope, source: r.source,
155
+ trial_until: r.trial_until,
156
+ status: r.trial_until ? 'trial' : 'active',
157
+ overdue: Boolean(r.trial_until) && r.trial_until < today,
158
+ body: r.body,
159
+ }));
160
+ return { exists: true, path: p, rules: out, warnings, fingerprint: fingerprint(text),
161
+ // CODE POINTS, not `String.length` (UTF-16 units) — an emoji in a rule body would
162
+ // otherwise put the token estimate off.
163
+ stats: { rules: rules.length, lines: splitLines(text).length,
164
+ tokens: Math.floor(codePointLength(text) / 4), ...RULES_BUDGET } };
165
+ }
166
+
167
+ function rulesRead(state) {
168
+ const p = rulesPath(state);
169
+ return [p, isFile(p) ? (readMaybe(p) ?? '') : ''];
170
+ }
171
+
172
+ function ruleBlock(rid, title, scope, source, trialUntil, body) {
173
+ const meta = [`scope: ${scope}`];
174
+ if (source) meta.push(`source: ${source}`);
175
+ if (trialUntil) meta.push(`trial until: ${trialUntil}`);
176
+ return `## R${rid} — ${title}\n(${meta.join(' | ')})\n${stripWhitespace(body)}\n`;
177
+ }
178
+
179
+ /**
180
+ * Validate and normalise a rule's writable fields. Throws (→ the shell's JSON 500 carrying
181
+ * the message) on an unusable rule.
182
+ *
183
+ * `\p{Nd}` here and not `\d`, unlike `RULE_HEAD_RE` above: this is a pure predicate over a
184
+ * string that stays a string, so accepting any Unicode decimal digit costs nothing and
185
+ * needs no numeric parse afterward.
186
+ */
187
+ function ruleFields(body) {
188
+ const title = splitWords(strOr(bget(body, 'title'))).join(' ');
189
+ const text = stripWhitespace(strOr(bget(body, 'body')));
190
+ if (!title) throw new Error('a rule needs a title');
191
+ if (!text) throw new Error('a rule needs body text');
192
+ let scope = bget(body, 'scope');
193
+ if (scope !== 'user' && scope !== 'project') scope = 'project';
194
+ const source = splitWords(strOr(bget(body, 'source'))).join(' ');
195
+ const trial = stripWhitespace(strOr(bget(body, 'trial_until')));
196
+ if (trial && !/^\p{Nd}{4}-\p{Nd}{2}-\p{Nd}{2}$/u.test(trial)) {
197
+ throw new Error('trial until must be YYYY-MM-DD');
198
+ }
199
+ return [title, text, scope, source, trial];
200
+ }
201
+
202
+ /**
203
+ * Coerces whatever `id` came out of the parsed body into an integer, or throws
204
+ * `NotFound('rule id')`. Handles a decimal string (surrounding whitespace stripped), a
205
+ * boolean, a bare number (truncated), and a `JsonNumber`-shaped value via its `valueOf()` —
206
+ * whatever `parseJson` could have produced for this field.
207
+ */
208
+ function ruleId(v) {
209
+ if (typeof v === 'string') {
210
+ const s = stripWhitespace(v);
211
+ if (!/^[+-]?\d+$/.test(s)) throw new NotFound('rule id');
212
+ return Number(s);
213
+ }
214
+ if (typeof v === 'boolean') return v ? 1 : 0;
215
+ if (typeof v === 'number') return Math.trunc(v);
216
+ if (v !== null && v !== undefined && typeof v.valueOf === 'function'
217
+ && typeof v.valueOf() === 'number') {
218
+ return Math.trunc(v.valueOf());
219
+ }
220
+ throw new NotFound('rule id');
221
+ }
222
+
223
+ /**
224
+ * Add / update / delete on user-rules.md.
225
+ *
226
+ * EVERY MUTATION REQUIRES THE FINGERPRINT OF THE CONTENT THE CLIENT LAST READ. An agent
227
+ * session may be editing the same file mid-flight, so a stale write returns `ok: false`
228
+ * (which the shell maps to 409) and the client re-fetches — it never clobbers. The fresh
229
+ * fingerprint comes back in the response so a client can chain edits without a re-fetch.
230
+ */
231
+ export function apiRulesMutate(state, body) {
232
+ const op = bget(body, 'op');
233
+ if (op !== 'add' && op !== 'update' && op !== 'delete') {
234
+ throw new NotFound(`rules op ${formatRepr(op)}`);
235
+ }
236
+ const [p, original] = rulesRead(state);
237
+ let text = original;
238
+ if (!fpMatches(bget(body, 'fingerprint', ''), fingerprint(text))) {
239
+ return { ok: false, error: 'conflict',
240
+ detail: 'user-rules.md changed since you loaded it — reloading' };
241
+ }
242
+ const [rules] = parseRules(text);
243
+ let rid;
244
+ let next;
245
+ if (op === 'add') {
246
+ const [title, rtext, scope, source, trial] = ruleFields(body);
247
+ rid = rules.reduce((mx, r) => (r.id > mx ? r.id : mx), 0) + 1;
248
+ if (!text) text = '# User rules\n';
249
+ next = `${text.replace(/\n+$/, '')}\n\n${ruleBlock(rid, title, scope, source, trial, rtext)}`;
250
+ } else {
251
+ rid = ruleId(bget(body, 'id'));
252
+ const target = rules.find((r) => r.id === rid);
253
+ if (target === undefined) throw new NotFound(`rule R${rid}`);
254
+ const lines = splitLines(text);
255
+ if (op === 'update') {
256
+ const [title, rtext, scope, source, trial] = ruleFields(body);
257
+ const block = ruleBlock(rid, title, scope, source, trial, rtext);
258
+ lines.splice(target.start, target.end - target.start,
259
+ ...splitLines(block.replace(/\n+$/, '')));
260
+ } else {
261
+ // delete — also swallow ONE preceding blank separator line, or repeated deletes leave
262
+ // a growing run of blank lines in the user's file.
263
+ let start = target.start;
264
+ if (start > 0 && !stripWhitespace(lines[start - 1])) start -= 1;
265
+ lines.splice(start, target.end - start);
266
+ }
267
+ next = `${lines.join('\n').replace(/\n+$/, '')}\n`;
268
+ }
269
+ writeText(p, next);
270
+ return { ok: true, op, id: rid, fingerprint: fingerprint(next) };
271
+ }
272
+
273
+ /**
274
+ * One memory fact promoted into a trial rule. The provenance line and the month of
275
+ * probation are the rule this endpoint owns, and both are DATES read from the real clock —
276
+ * not destamped, since destamping would erase exactly the thing being recorded.
277
+ */
278
+ export function apiRulesPromote(state, body) {
279
+ const name = strOr(bget(body, 'name'));
280
+ const d = memoryDir(state);
281
+ if (!isDir(d)) throw new NotFound('memory store');
282
+ // `isFactName`, the `geneseed memory` verb's rule: CASE-FOLDED, because on Windows and macOS
283
+ // `memory` opens MEMORY.md — and `delete_memory` below would then delete the index.
284
+ if (!isFactName(name)) throw new NotFound(name);
285
+ const src = path.join(d, `${name}.md`);
286
+ if (!isFile(src)) throw new NotFound(name);
287
+ const [fm, memBody] = frontmatter(readMaybe(src) ?? '');
288
+ const fmName = fm.has('name') ? fm.get('name') : name;
289
+ const fmDesc = fm.has('description') ? fm.get('description') : '';
290
+ const [today, trial] = promoteDates(30);
291
+ const res = apiRulesMutate(state, {
292
+ op: 'add',
293
+ fingerprint: bget(body, 'fingerprint', ''),
294
+ title: isTruthy(bget(body, 'title')) ? bget(body, 'title') : fmName,
295
+ body: isTruthy(bget(body, 'body')) ? bget(body, 'body')
296
+ : (stripWhitespace(memBody) || fmDesc),
297
+ scope: bget(body, 'scope'),
298
+ source: `memory ${name}, promoted ${today}`,
299
+ trial_until: trial,
300
+ });
301
+ if (isTruthy(res.ok) && isTruthy(bget(body, 'delete_memory'))) {
302
+ apiMemoryDelete(state, name);
303
+ res.deleted_memory = name;
304
+ }
305
+ return res;
306
+ }
307
+
308
+ // ---- PROFILE.md --------------------------------------------------------------------------
309
+
310
+ /** Beside the deployed AGENT.md. */
311
+ export const PROFILE_FILE = 'PROFILE.md';
312
+ const profilePath = (state) => path.join(state.target, PROFILE_FILE);
313
+
314
+ export function apiProfile(state) {
315
+ const p = profilePath(state);
316
+ if (!isFile(p)) return { exists: false, path: p, text: '', fingerprint: '' };
317
+ const text = readMaybe(p) ?? '';
318
+ // `seeded`: the file is still the template the build wrote once and never touched since.
319
+ // `readMaybe` normalises line endings, so a CRLF copy (the emit writes the platform's, and
320
+ // an editor may re-save either way) still compares equal to the LF literal.
321
+ const seeded = text === PROFILE_STUB;
322
+ return { exists: true, path: p, text, fingerprint: fingerprint(text), seeded };
323
+ }
324
+
325
+ /** The whole file, fingerprint-guarded like the rules above. */
326
+ export function apiProfileSave(state, body) {
327
+ const p = profilePath(state);
328
+ const cur = isFile(p) ? (readMaybe(p) ?? '') : '';
329
+ if (!fpMatches(bget(body, 'fingerprint', ''), fingerprint(cur))) {
330
+ return { ok: false, error: 'conflict',
331
+ detail: 'PROFILE.md changed since you loaded it — reloading' };
332
+ }
333
+ let next = strOr(bget(body, 'text'));
334
+ if (next && !next.endsWith('\n')) next += '\n';
335
+ writeText(p, next);
336
+ // The fingerprint of what is ON DISK, which is not the fingerprint of what was SENT once
337
+ // the newline has been appended — and the client chains its next save off this value.
338
+ return { ok: true, path: p, fingerprint: fingerprint(next) };
339
+ }
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": "3.14.0",
4
+ "version": "3.15.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",
@@ -1 +1 @@
1
- import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-B9Z_tXRV.js";import{t as r}from"./api-D_ixdyEY.js";import{J as i,N as a,k as o,l as s,y as c}from"./index-KHt3wE_K.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./activity-Dr7ZMBI3.js";import{t as h}from"./usePoll-DD8VjtSg.js";var g=e(t(),1),_=n();function v({s:e}){let t=p[e.status]||p.idle,n=e.files,r=e.todos,i=r&&r.total>0||e.error||e.blocked_on;return(0,_.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,children:[(0,_.jsxs)(`div`,{className:`row between wrap gap-12`,children:[(0,_.jsxs)(`div`,{className:`row gap-10`,style:{minWidth:0},children:[(0,_.jsx)(`span`,{className:`feed-dot ${t.cls||`acc`}`,style:{width:9,height:9}}),(0,_.jsxs)(`div`,{style:{minWidth:0},children:[(0,_.jsx)(`h3`,{style:{margin:0},children:e.title||l(e.cwd)||e.session_id}),e.cwd&&(0,_.jsx)(`div`,{className:`dim mono`,style:{fontSize:12,...m},title:e.cwd,children:e.cwd})]})]}),(0,_.jsxs)(`div`,{className:`row gap-8`,style:{flexShrink:0},children:[e.model&&(0,_.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,_.jsx)(`span`,{className:`badge`,children:e.agent}),(0,_.jsxs)(`span`,{className:`badge ${t.cls}`,children:[(0,_.jsx)(`span`,{className:`dot`}),t.label]}),(0,_.jsx)(o,{name:`chevron`,className:`glyph act-chev`})]})]}),e.phase&&(0,_.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10,fontSize:14},children:[(0,_.jsx)(o,{name:`activity`}),(0,_.jsx)(`span`,{style:m,children:e.phase})]}),(e.tokens>0||e.cost>0||e.turn_started_at||n&&n.count>0)&&(0,_.jsxs)(`div`,{className:`row wrap`,style:{gap:16,marginTop:12,fontSize:13,color:`var(--text-2)`},children:[e.tokens>0&&(0,_.jsxs)(`span`,{children:[f(e.tokens),` tok`]}),e.cost>0&&(0,_.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),e.turn_started_at?(0,_.jsx)(`span`,{children:(0,_.jsx)(d,{startedAt:e.turn_started_at})}):null,n&&n.count>0&&(0,_.jsxs)(`span`,{children:[n.count,` file`,n.count===1?``:`s`,` `,(0,_.jsxs)(`span`,{style:{color:`var(--good)`},children:[`+`,n.additions]}),` `,(0,_.jsxs)(`span`,{style:{color:`var(--bad)`},children:[`−`,n.deletions]})]})]}),i&&(0,_.jsxs)(`div`,{className:`row between wrap gap-12`,style:{marginTop:12,paddingTop:10,borderTop:`1px solid var(--line)`},children:[r&&r.total>0?(0,_.jsxs)(`span`,{className:`row gap-8 dim`,style:{fontSize:13},children:[(0,_.jsx)(u,{done:r.done,total:r.total}),`plan `,r.done,`/`,r.total]}):(0,_.jsx)(`span`,{}),e.error?(0,_.jsx)(`span`,{className:`badge bad`,title:e.error,style:{maxWidth:300,...m},children:e.error}):e.blocked_on?(0,_.jsx)(`span`,{className:`badge bad`,title:e.blocked_on,style:{maxWidth:300,...m},children:e.blocked_on}):null]}),(0,_.jsxs)(`div`,{className:`dim mono`,style:{fontSize:11,marginTop:8},children:[`updated `,a(e.updated_at),` ago`]})]})}function y(){let[e,t]=(0,g.useState)(null),[n,a]=(0,g.useState)(``);h(e=>r.activity().then(n=>{e()&&(t(n),a(``))},t=>{e()&&a(t.message)}),2e3,[]);let o=!e||e.enabled!==!1,l=e?.activity||[],u=i(),d=async()=>{let e=!o;try{let n=await r.activityToggle(e);t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[]})),a(``)}catch(e){a(e.message)}};return(0,_.jsxs)(`div`,{className:`narrow`,children:[(0,_.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h1`,{className:`h`,children:`Activity`}),(0,_.jsx)(`p`,{className:`sub`,children:`Live OpenCode sessions this harness is running: what each one is doing right now. Refreshes every couple of seconds; sessions drop off when their process exits.`})]}),(0,_.jsxs)(`div`,{className:`row gap-10`,style:{alignItems:`center`,flexShrink:0},children:[(0,_.jsx)(`span`,{className:`dim mono`,style:{fontSize:12},children:o?`tracking on`:`tracking off`}),(0,_.jsx)(`div`,{className:`sw-toggle${o?` on`:``}`,role:`switch`,"aria-checked":o,"aria-label":`Toggle activity tracking`,tabIndex:0,onClick:d,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),d())}})]})]}),(0,_.jsx)(s,{error:n,style:{marginBottom:12}}),e?o?l.length===0?(0,_.jsxs)(`div`,{className:`empty`,children:[(0,_.jsx)(`div`,{className:`big`,children:`No active sessions`}),`Run `,(0,_.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,_.jsx)(`div`,{className:`stack gap-12`,ref:u,children:l.map(e=>(0,_.jsx)(`div`,{"data-flip":e.session_id,children:(0,_.jsx)(v,{s:e})},e.session_id))}):(0,_.jsxs)(`div`,{className:`empty`,children:[(0,_.jsx)(`div`,{className:`big`,children:`Activity tracking is off`}),`The plugin isn't recording sessions. Flip the switch to turn it back on.`]}):(0,_.jsx)(c,{label:`Reading live sessions…`})]})}export{y as default};
1
+ import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-B9Z_tXRV.js";import{t as r}from"./api-CxgfYu18.js";import{N as i,k as a,l as o,q as s,y as c}from"./index-ujKG1ZNf.js";import{a as l,i as u,n as d,o as f,r as p,t as m}from"./activity-Dr7ZMBI3.js";import{t as h}from"./usePoll-DD8VjtSg.js";var g=e(t(),1),_=n();function v({s:e}){let t=p[e.status]||p.idle,n=e.files,r=e.todos,o=r&&r.total>0||e.error||e.blocked_on;return(0,_.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,children:[(0,_.jsxs)(`div`,{className:`row between wrap gap-12`,children:[(0,_.jsxs)(`div`,{className:`row gap-10`,style:{minWidth:0},children:[(0,_.jsx)(`span`,{className:`feed-dot ${t.cls||`acc`}`,style:{width:9,height:9}}),(0,_.jsxs)(`div`,{style:{minWidth:0},children:[(0,_.jsx)(`h3`,{style:{margin:0},children:e.title||l(e.cwd)||e.session_id}),e.cwd&&(0,_.jsx)(`div`,{className:`dim mono`,style:{fontSize:12,...m},title:e.cwd,children:e.cwd})]})]}),(0,_.jsxs)(`div`,{className:`row gap-8`,style:{flexShrink:0},children:[e.model&&(0,_.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,_.jsx)(`span`,{className:`badge`,children:e.agent}),(0,_.jsxs)(`span`,{className:`badge ${t.cls}`,children:[(0,_.jsx)(`span`,{className:`dot`}),t.label]}),(0,_.jsx)(a,{name:`chevron`,className:`glyph act-chev`})]})]}),e.phase&&(0,_.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10,fontSize:14},children:[(0,_.jsx)(a,{name:`activity`}),(0,_.jsx)(`span`,{style:m,children:e.phase})]}),(e.tokens>0||e.cost>0||e.turn_started_at||n&&n.count>0)&&(0,_.jsxs)(`div`,{className:`row wrap`,style:{gap:16,marginTop:12,fontSize:13,color:`var(--text-2)`},children:[e.tokens>0&&(0,_.jsxs)(`span`,{children:[f(e.tokens),` tok`]}),e.cost>0&&(0,_.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),e.turn_started_at?(0,_.jsx)(`span`,{children:(0,_.jsx)(d,{startedAt:e.turn_started_at})}):null,n&&n.count>0&&(0,_.jsxs)(`span`,{children:[n.count,` file`,n.count===1?``:`s`,` `,(0,_.jsxs)(`span`,{style:{color:`var(--good)`},children:[`+`,n.additions]}),` `,(0,_.jsxs)(`span`,{style:{color:`var(--bad)`},children:[`−`,n.deletions]})]})]}),o&&(0,_.jsxs)(`div`,{className:`row between wrap gap-12`,style:{marginTop:12,paddingTop:10,borderTop:`1px solid var(--line)`},children:[r&&r.total>0?(0,_.jsxs)(`span`,{className:`row gap-8 dim`,style:{fontSize:13},children:[(0,_.jsx)(u,{done:r.done,total:r.total}),`plan `,r.done,`/`,r.total]}):(0,_.jsx)(`span`,{}),e.error?(0,_.jsx)(`span`,{className:`badge bad`,title:e.error,style:{maxWidth:300,...m},children:e.error}):e.blocked_on?(0,_.jsx)(`span`,{className:`badge bad`,title:e.blocked_on,style:{maxWidth:300,...m},children:e.blocked_on}):null]}),(0,_.jsxs)(`div`,{className:`dim mono`,style:{fontSize:11,marginTop:8},children:[`updated `,i(e.updated_at),` ago`]})]})}function y(){let[e,t]=(0,g.useState)(null),[n,i]=(0,g.useState)(``);h(e=>r.activity().then(n=>{e()&&(t(n),i(``))},t=>{e()&&i(t.message)}),2e3,[]);let a=!e||e.enabled!==!1,l=e?.activity||[],u=s(),d=async()=>{let e=!a;try{let n=await r.activityToggle(e);t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[]})),i(``)}catch(e){i(e.message)}};return(0,_.jsxs)(`div`,{className:`narrow`,children:[(0,_.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h1`,{className:`h`,children:`Activity`}),(0,_.jsx)(`p`,{className:`sub`,children:`Live OpenCode sessions this harness is running: what each one is doing right now. Refreshes every couple of seconds; sessions drop off when their process exits.`})]}),(0,_.jsxs)(`div`,{className:`row gap-10`,style:{alignItems:`center`,flexShrink:0},children:[(0,_.jsx)(`span`,{className:`dim mono`,style:{fontSize:12},children:a?`tracking on`:`tracking off`}),(0,_.jsx)(`div`,{className:`sw-toggle${a?` on`:``}`,role:`switch`,"aria-checked":a,"aria-label":`Toggle activity tracking`,tabIndex:0,onClick:d,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),d())}})]})]}),(0,_.jsx)(o,{error:n,style:{marginBottom:12}}),e?a?l.length===0?(0,_.jsxs)(`div`,{className:`empty`,children:[(0,_.jsx)(`div`,{className:`big`,children:`No active sessions`}),`Run `,(0,_.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,_.jsx)(`div`,{className:`stack gap-12`,ref:u,children:l.map(e=>(0,_.jsx)(`div`,{"data-flip":e.session_id,children:(0,_.jsx)(v,{s:e})},e.session_id))}):(0,_.jsxs)(`div`,{className:`empty`,children:[(0,_.jsx)(`div`,{className:`big`,children:`Activity tracking is off`}),`The plugin isn't recording sessions. Flip the switch to turn it back on.`]}):(0,_.jsx)(c,{label:`Reading live sessions…`})]})}export{y as default};
@@ -1 +1 @@
1
- import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-B9Z_tXRV.js";import{t as r}from"./api-D_ixdyEY.js";import{N as i,k as a,y as o}from"./index-KHt3wE_K.js";import{a as s,n as c,o as l,r as u,t as d}from"./activity-Dr7ZMBI3.js";import{t as f}from"./usePoll-DD8VjtSg.js";var p=e(t(),1),m=n();function h(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 g({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(`${l(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,m.jsxs)(`div`,{className:`row gap-10`,style:{alignItems:`baseline`},children:[(0,m.jsx)(`span`,{className:`badge ${t?``:`acc`}`,style:{flexShrink:0,minWidth:52,justifyContent:`center`},children:t?`you`:`agent`}),(0,m.jsxs)(`div`,{style:{minWidth:0,flex:1,fontSize:13},children:[!t&&(0,m.jsx)(`span`,{className:`feed-dot ${h(e)||`acc`}`,style:{display:`inline-block`,marginRight:8,verticalAlign:`middle`}}),e.kind===`thinking`&&(0,m.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,m.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,m.jsx)(`b`,{children:i}),e.error&&(0,m.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,m.jsx)(`span`,{className:`dim mono`,style:{flexShrink:0,fontSize:12},children:n.join(` · `)})]})}function _({turns:e}){return!e||e.length===0?(0,m.jsx)(`div`,{className:`dim`,style:{fontSize:13},children:`No conversation captured yet.`}):(0,m.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,m.jsxs)(`div`,{className:`row gap-10`,style:{alignItems:`baseline`},children:[(0,m.jsx)(`span`,{className:`badge ${n?``:`acc`}`,style:{flexShrink:0,minWidth:52,justifyContent:`center`},children:n?`you`:`agent`}),(0,m.jsx)(`div`,{style:{minWidth:0,fontSize:13,color:n?`inherit`:`var(--text-2)`},children:e.text})]},t)})})}function v({sid:e}){let[t,n]=(0,p.useState)(null),[h,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(!1),[x,S]=(0,p.useState)(!1);f(t=>r.activityDetail(e).then(e=>{t()&&(n(e),v(``),b(!1))},e=>{t()&&(e.status===404?b(!0):v(e.message))}),2e3,[e]);let C=(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/activity`,style:{marginBottom:12,display:`inline-flex`,gap:6},children:[(0,m.jsx)(a,{name:`arrow`,style:{transform:`rotate(180deg)`}}),` Activity`]});if(y)return(0,m.jsxs)(`div`,{className:`narrow`,children:[C,(0,m.jsxs)(`div`,{className:`empty`,children:[(0,m.jsx)(`div`,{className:`big`,children:`Session ended`}),`It's no longer live. `,(0,m.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),`.`]})]});if(!t)return(0,m.jsxs)(`div`,{className:`narrow`,children:[C,(0,m.jsx)(o,{label:`Loading session…`})]});let w=t.session,T=u[w.status]||u.idle,E=w.files,D=w.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,m.jsxs)(`div`,{className:`narrow`,children:[C,h&&(0,m.jsx)(`p`,{className:`badge bad`,style:{marginBottom:12},children:h}),(0,m.jsxs)(`div`,{className:`card pad-md`,children:[(0,m.jsxs)(`div`,{className:`row between wrap gap-12`,children:[(0,m.jsxs)(`div`,{style:{minWidth:0},children:[(0,m.jsx)(`h1`,{className:`h`,style:{margin:0},children:w.title||s(w.cwd)||w.session_id}),w.cwd&&(0,m.jsx)(`div`,{className:`dim mono`,style:{fontSize:12,...d},title:w.cwd,children:w.cwd})]}),(0,m.jsxs)(`div`,{className:`row gap-8`,style:{flexShrink:0},children:[w.model&&(0,m.jsx)(`span`,{className:`badge mono`,children:w.model}),w.agent&&(0,m.jsx)(`span`,{className:`badge`,children:w.agent}),(0,m.jsxs)(`span`,{className:`badge ${T.cls}`,children:[(0,m.jsx)(`span`,{className:`dot`}),T.label]})]})]}),w.phase&&(0,m.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10,fontSize:14},children:[(0,m.jsx)(a,{name:`activity`}),(0,m.jsx)(`span`,{style:d,children:w.phase})]}),(0,m.jsxs)(`div`,{className:`row wrap`,style:{gap:16,marginTop:12,fontSize:13,color:`var(--text-2)`},children:[w.tokens>0&&(0,m.jsxs)(`span`,{children:[l(w.tokens),` tok`]}),w.cost>0&&(0,m.jsxs)(`span`,{children:[`$`,w.cost.toFixed(2)]}),w.turn_started_at?(0,m.jsx)(`span`,{children:(0,m.jsx)(c,{startedAt:w.turn_started_at})}):null,(0,m.jsxs)(`span`,{className:`dim`,children:[`updated `,i(w.updated_at),` ago`]})]}),(w.error||w.blocked_on)&&(0,m.jsx)(`div`,{style:{marginTop:10},children:(0,m.jsx)(`span`,{className:`badge bad`,style:{maxWidth:`100%`,...d},children:w.error||w.blocked_on})})]}),(O||k)&&(0,m.jsxs)(`div`,{className:`grid gap-12`,style:{marginTop:12,gridTemplateColumns:O&&k?`minmax(0, 1fr) minmax(0, 1fr)`:`1fr`},children:[O&&(0,m.jsxs)(`div`,{className:`card pad-md`,children:[(0,m.jsx)(`div`,{className:`card-head`,children:(0,m.jsxs)(`h3`,{children:[`Files touched `,(0,m.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,m.jsx)(`div`,{className:`stack`,style:{gap:6,marginTop:8},children:E.items.map(e=>(0,m.jsxs)(`div`,{className:`row between gap-12`,style:{fontSize:13},children:[(0,m.jsx)(`span`,{className:`mono`,style:{...d,minWidth:0,flex:1},title:e.file,children:e.file}),(0,m.jsxs)(`span`,{style:{flexShrink:0},children:[(0,m.jsxs)(`span`,{style:{color:`var(--good)`},children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{style:{color:`var(--bad)`},children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,m.jsxs)(`div`,{className:`card pad-md`,children:[(0,m.jsx)(`div`,{className:`card-head`,children:(0,m.jsxs)(`h3`,{children:[`Plan`,` `,(0,m.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,m.jsx)(`div`,{className:`stack`,style:{gap:6,marginTop:8},children:D.items.map((e,t)=>(0,m.jsxs)(`div`,{className:`row gap-8`,style:{fontSize:13},children:[(0,m.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,m.jsx)(`span`,{style:{textDecoration:e.status===`completed`?`line-through`:`none`,color:e.status===`completed`?`var(--text-3)`:`inherit`},children:e.content})]},t))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-md`,style:{marginTop:12},children:[(0,m.jsxs)(`div`,{className:`card-head`,style:{justifyContent:`space-between`,marginBottom:12},children:[(0,m.jsx)(`h3`,{children:`Timeline`}),j.length>0&&(0,m.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show all ${j.length} steps`})]}),x?(0,m.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,m.jsx)(g,{rec:e},t))}):(0,m.jsx)(_,{turns:A})]})]})}export{v as default};
1
+ import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-B9Z_tXRV.js";import{t as r}from"./api-CxgfYu18.js";import{N as i,k as a,y as o}from"./index-ujKG1ZNf.js";import{a as s,n as c,o as l,r as u,t as d}from"./activity-Dr7ZMBI3.js";import{t as f}from"./usePoll-DD8VjtSg.js";var p=e(t(),1),m=n();function h(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 g({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(`${l(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,m.jsxs)(`div`,{className:`row gap-10`,style:{alignItems:`baseline`},children:[(0,m.jsx)(`span`,{className:`badge ${t?``:`acc`}`,style:{flexShrink:0,minWidth:52,justifyContent:`center`},children:t?`you`:`agent`}),(0,m.jsxs)(`div`,{style:{minWidth:0,flex:1,fontSize:13},children:[!t&&(0,m.jsx)(`span`,{className:`feed-dot ${h(e)||`acc`}`,style:{display:`inline-block`,marginRight:8,verticalAlign:`middle`}}),e.kind===`thinking`&&(0,m.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,m.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,m.jsx)(`b`,{children:i}),e.error&&(0,m.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,m.jsx)(`span`,{className:`dim mono`,style:{flexShrink:0,fontSize:12},children:n.join(` · `)})]})}function _({turns:e}){return!e||e.length===0?(0,m.jsx)(`div`,{className:`dim`,style:{fontSize:13},children:`No conversation captured yet.`}):(0,m.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,m.jsxs)(`div`,{className:`row gap-10`,style:{alignItems:`baseline`},children:[(0,m.jsx)(`span`,{className:`badge ${n?``:`acc`}`,style:{flexShrink:0,minWidth:52,justifyContent:`center`},children:n?`you`:`agent`}),(0,m.jsx)(`div`,{style:{minWidth:0,fontSize:13,color:n?`inherit`:`var(--text-2)`},children:e.text})]},t)})})}function v({sid:e}){let[t,n]=(0,p.useState)(null),[h,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(!1),[x,S]=(0,p.useState)(!1);f(t=>r.activityDetail(e).then(e=>{t()&&(n(e),v(``),b(!1))},e=>{t()&&(e.status===404?b(!0):v(e.message))}),2e3,[e]);let C=(0,m.jsxs)(`a`,{className:`btn ghost sm`,href:`#/activity`,style:{marginBottom:12,display:`inline-flex`,gap:6},children:[(0,m.jsx)(a,{name:`arrow`,style:{transform:`rotate(180deg)`}}),` Activity`]});if(y)return(0,m.jsxs)(`div`,{className:`narrow`,children:[C,(0,m.jsxs)(`div`,{className:`empty`,children:[(0,m.jsx)(`div`,{className:`big`,children:`Session ended`}),`It's no longer live. `,(0,m.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),`.`]})]});if(!t)return(0,m.jsxs)(`div`,{className:`narrow`,children:[C,(0,m.jsx)(o,{label:`Loading session…`})]});let w=t.session,T=u[w.status]||u.idle,E=w.files,D=w.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,m.jsxs)(`div`,{className:`narrow`,children:[C,h&&(0,m.jsx)(`p`,{className:`badge bad`,style:{marginBottom:12},children:h}),(0,m.jsxs)(`div`,{className:`card pad-md`,children:[(0,m.jsxs)(`div`,{className:`row between wrap gap-12`,children:[(0,m.jsxs)(`div`,{style:{minWidth:0},children:[(0,m.jsx)(`h1`,{className:`h`,style:{margin:0},children:w.title||s(w.cwd)||w.session_id}),w.cwd&&(0,m.jsx)(`div`,{className:`dim mono`,style:{fontSize:12,...d},title:w.cwd,children:w.cwd})]}),(0,m.jsxs)(`div`,{className:`row gap-8`,style:{flexShrink:0},children:[w.model&&(0,m.jsx)(`span`,{className:`badge mono`,children:w.model}),w.agent&&(0,m.jsx)(`span`,{className:`badge`,children:w.agent}),(0,m.jsxs)(`span`,{className:`badge ${T.cls}`,children:[(0,m.jsx)(`span`,{className:`dot`}),T.label]})]})]}),w.phase&&(0,m.jsxs)(`div`,{className:`row gap-8`,style:{marginTop:10,fontSize:14},children:[(0,m.jsx)(a,{name:`activity`}),(0,m.jsx)(`span`,{style:d,children:w.phase})]}),(0,m.jsxs)(`div`,{className:`row wrap`,style:{gap:16,marginTop:12,fontSize:13,color:`var(--text-2)`},children:[w.tokens>0&&(0,m.jsxs)(`span`,{children:[l(w.tokens),` tok`]}),w.cost>0&&(0,m.jsxs)(`span`,{children:[`$`,w.cost.toFixed(2)]}),w.turn_started_at?(0,m.jsx)(`span`,{children:(0,m.jsx)(c,{startedAt:w.turn_started_at})}):null,(0,m.jsxs)(`span`,{className:`dim`,children:[`updated `,i(w.updated_at),` ago`]})]}),(w.error||w.blocked_on)&&(0,m.jsx)(`div`,{style:{marginTop:10},children:(0,m.jsx)(`span`,{className:`badge bad`,style:{maxWidth:`100%`,...d},children:w.error||w.blocked_on})})]}),(O||k)&&(0,m.jsxs)(`div`,{className:`grid gap-12`,style:{marginTop:12,gridTemplateColumns:O&&k?`minmax(0, 1fr) minmax(0, 1fr)`:`1fr`},children:[O&&(0,m.jsxs)(`div`,{className:`card pad-md`,children:[(0,m.jsx)(`div`,{className:`card-head`,children:(0,m.jsxs)(`h3`,{children:[`Files touched `,(0,m.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,m.jsx)(`div`,{className:`stack`,style:{gap:6,marginTop:8},children:E.items.map(e=>(0,m.jsxs)(`div`,{className:`row between gap-12`,style:{fontSize:13},children:[(0,m.jsx)(`span`,{className:`mono`,style:{...d,minWidth:0,flex:1},title:e.file,children:e.file}),(0,m.jsxs)(`span`,{style:{flexShrink:0},children:[(0,m.jsxs)(`span`,{style:{color:`var(--good)`},children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{style:{color:`var(--bad)`},children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,m.jsxs)(`div`,{className:`card pad-md`,children:[(0,m.jsx)(`div`,{className:`card-head`,children:(0,m.jsxs)(`h3`,{children:[`Plan`,` `,(0,m.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,m.jsx)(`div`,{className:`stack`,style:{gap:6,marginTop:8},children:D.items.map((e,t)=>(0,m.jsxs)(`div`,{className:`row gap-8`,style:{fontSize:13},children:[(0,m.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,m.jsx)(`span`,{style:{textDecoration:e.status===`completed`?`line-through`:`none`,color:e.status===`completed`?`var(--text-3)`:`inherit`},children:e.content})]},t))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-md`,style:{marginTop:12},children:[(0,m.jsxs)(`div`,{className:`card-head`,style:{justifyContent:`space-between`,marginBottom:12},children:[(0,m.jsx)(`h3`,{children:`Timeline`}),j.length>0&&(0,m.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show all ${j.length} steps`})]}),x?(0,m.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,m.jsx)(g,{rec:e},t))}):(0,m.jsx)(_,{turns:A})]})]})}export{v as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-Sc_UDMOE.js","assets/sections-GalMS0Zv.js","assets/react-B9Z_tXRV.js","assets/drawable-BbWQxe82.js","assets/index-ujKG1ZNf.js","assets/api-CxgfYu18.js","assets/index-Ctp-4poP.css","assets/jobBuckets-Dbq8ZlWW.js","assets/OperatorHudView--TkvDybH.js","assets/JournalView-_gxpsxXi.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,o as t,r as n,s as r}from"./sections-GalMS0Zv.js";import{i,t as a}from"./react-B9Z_tXRV.js";import{t as o}from"./api-CxgfYu18.js";import{A as s,F as c,H as l,I as u,K as d,M as f,N as p,U as m,c as h,j as g,k as _,l as v,t as y,x as b,y as x}from"./index-ujKG1ZNf.js";var S=r(i(),1),C={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.`},w=e=>e.deployed?C[e.theme]||`Loaded & ready`:`Not deployed`,T=a();function E({value:e,size:t=232}){let n=d(e,1100)??0,r=t/2-14,i=2*Math.PI*r,a=i*(1-n);return(0,T.jsxs)(`div`,{className:`ring-wrap`,style:{width:t,height:t},children:[(0,T.jsxs)(`svg`,{viewBox:`0 0 ${t} ${t}`,children:[(0,T.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`10`}),(0,T.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`var(--accent)`,strokeWidth:`10`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:a}),Array.from({length:48}).map((e,i)=>{let a=i/48*2*Math.PI,o=r-18,s=r-24,c=t/2+Math.cos(a)*o,l=t/2+Math.sin(a)*o,u=t/2+Math.cos(a)*s,d=t/2+Math.sin(a)*s;return(0,T.jsx)(`line`,{x1:c,y1:l,x2:u,y2:d,stroke:`var(--line-2)`,strokeWidth:`1`,opacity:i/48<n?.9:.25},i)})]}),(0,T.jsxs)(`div`,{className:`ring-center`,children:[(0,T.jsxs)(`div`,{className:`pct`,children:[Math.round(n*100),(0,T.jsx)(`span`,{style:{fontSize:20,color:`var(--text-3)`},children:`%`})]}),(0,T.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function D({overview:e}){let t=s(e.diff),n=e.counts||{};return(0,T.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:`Invariants`,hash:`#/laws`}].map(e=>{let t=n[e.key];return(0,T.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,T.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,T.jsx)(m,{value:t})}),(0,T.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,T.jsx)(`div`,{className:`kseg-spacer`}),(0,T.jsxs)(`button`,{className:`kseg`+(t>0?` hot`:``),onClick:()=>l(`#/diff`),title:`Open changes`,children:[(0,T.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:(0,T.jsx)(m,{value:t})}),(0,T.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),t>0&&(0,T.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function O({overview:t}){return(0,T.jsx)(`div`,{className:`genome`,children:n.map((n,r)=>{let i=e[n],a=t.counts?.[n];return(0,T.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":r},onClick:()=>l(`#/section/`+n),children:[(0,T.jsxs)(`div`,{className:`gtop`,children:[(0,T.jsx)(`span`,{className:`gname`,children:i.label}),(0,T.jsx)(_,{name:i.icon,className:`gicon`})]}),(0,T.jsx)(`div`,{className:`gcount`+(a===0?` zero`:``),children:a==null?`—`:(0,T.jsx)(m,{value:a})}),(0,T.jsx)(`div`,{className:`gdesc`,children:i.desc})]},n)})})}function k({jobs:e}){if(!e||e.length===0)return(0,T.jsx)(`div`,{className:`feed`,children:(0,T.jsxs)(`div`,{className:`empty`,children:[(0,T.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=[...e].sort((e,t)=>t.started-e.started).slice(0,8);return(0,T.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,T.jsxs)(`div`,{className:`feed-row`,children:[(0,T.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,T.jsx)(`span`,{className:`feed-txt`,children:(0,T.jsx)(`b`,{children:e.action})}),(0,T.jsxs)(`span`,{className:`feed-when`,children:[p(e.started),` ago`]})]},e.id))})}function A({overview:e,sigil:t,setup:r,jobs:i,onAction:a}){let o=w(e),s=f(e,r);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,T.jsxs)(`div`,{className:`hero`,children:[(0,T.jsx)(E,{value:s}),(0,T.jsxs)(`div`,{className:`hero-facts`,children:[(0,T.jsx)(`div`,{className:`ttl`,children:o}),t&&(0,T.jsxs)(`div`,{className:`voice-readout`,children:[(0,T.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,T.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,T.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,T.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,T.jsxs)(`div`,{className:`hero-chips`,children:[(0,T.jsxs)(`span`,{className:`chip`,children:[(0,T.jsx)(`span`,{className:`ck`,children:`voice`}),(0,T.jsx)(`span`,{className:`cv`,style:{textTransform:`capitalize`},children:e.theme})]}),(0,T.jsxs)(`span`,{className:`chip`,children:[(0,T.jsx)(`span`,{className:`ck`,children:`mode`}),(0,T.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,T.jsxs)(`span`,{className:`chip`,children:[(0,T.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,T.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,T.jsxs)(`span`,{className:`chip`,children:[(0,T.jsx)(`span`,{className:`ck`,children:`built`}),(0,T.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,T.jsxs)(`span`,{className:`chip`,children:[(0,T.jsx)(`span`,{className:`ck`,children:`fp`}),(0,T.jsx)(`span`,{className:`cv`,children:r?.installed_fp||`—`})]})]}),(0,T.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,T.jsxs)(`button`,{className:`btn`,onClick:()=>a(`update`),children:[(0,T.jsx)(_,{name:`refresh`}),`Update`]}),(0,T.jsxs)(`button`,{className:`btn ghost`,onClick:()=>a(`build-all`),children:[(0,T.jsx)(_,{name:`build`}),`Rebuild`]}),(0,T.jsxs)(`button`,{className:`btn ghost`,onClick:()=>a(`doctor`),children:[(0,T.jsx)(_,{name:`doctor`}),`Run doctor`]})]})]})]})}),(0,T.jsx)(D,{overview:e}),(0,T.jsxs)(`div`,{className:`grid split-status`,children:[(0,T.jsxs)(`div`,{className:`card pad-lg`,children:[(0,T.jsxs)(`div`,{className:`card-head`,children:[(0,T.jsx)(`h3`,{children:`Capability genome`}),(0,T.jsx)(`div`,{className:`right`,children:(0,T.jsxs)(`span`,{className:`tick`,children:[n.length,` sections`]})})]}),(0,T.jsx)(O,{overview:e})]}),(0,T.jsxs)(`div`,{className:`card pad-lg`,children:[(0,T.jsxs)(`div`,{className:`card-head`,children:[(0,T.jsx)(`h3`,{children:`Recent activity`}),(0,T.jsx)(`div`,{className:`right`,children:(0,T.jsxs)(`span`,{className:`badge acc`,children:[(0,T.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,T.jsx)(k,{jobs:i})]})]})]})}function j({k:t,overview:n,max:r}){let i=e[t],a=n.counts?.[t]??0;return(0,T.jsxs)(`div`,{className:`strand`,children:[(0,T.jsxs)(`span`,{className:`strand-name`,children:[(0,T.jsx)(`span`,{className:`strand-dot`}),(0,T.jsx)(`a`,{href:`#/section/`+t,className:`strand-link stretch-link`,children:i.label})]}),(0,T.jsx)(`div`,{className:`hbar`,children:(0,T.jsx)(`i`,{style:{width:`${a/r*100}%`}})}),(0,T.jsx)(`span`,{className:`strand-val`,children:a})]})}function M({overview:e,sigil:t,setup:r,jobs:i}){let a=g(e.counts),o=r?.version_verdict||``,c=o.includes(`up to date`),l=s(e.diff),u=[[`Source`,`src/, the canonical genetic material`,r?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`mb-16`,children:(0,T.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,T.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,T.jsxs)(`div`,{className:`lineage-track`,children:[(0,T.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,T.jsxs)(`div`,{className:`lineage-step`,children:[(0,T.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,T.jsx)(`div`,{className:`lt`,children:e}),(0,T.jsx)(`div`,{className:`ld`,children:t}),(0,T.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,T.jsx)(`hr`,{className:`hr`}),t&&(0,T.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,T.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,T.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,T.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,T.jsxs)(`span`,{className:`badge ${c?`ok`:`warn`}`,children:[(0,T.jsx)(`span`,{className:`dot`}),`in sync · `,o]}),(0,T.jsxs)(`span`,{className:`badge`,children:[(0,T.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,T.jsxs)(`div`,{className:`grid split-even`,children:[(0,T.jsxs)(`div`,{className:`card pad-lg`,children:[(0,T.jsxs)(`div`,{className:`card-head`,children:[(0,T.jsx)(`h3`,{children:`Genome strand`}),(0,T.jsx)(`div`,{className:`right`,children:(0,T.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),n.map(t=>(0,T.jsx)(j,{k:t,overview:e,max:a},t))]}),(0,T.jsxs)(`div`,{className:`card pad-lg`,children:[(0,T.jsx)(`div`,{className:`card-head`,children:(0,T.jsx)(`h3`,{children:`Recent activity`})}),(0,T.jsx)(k,{jobs:i})]})]})]})}function N({overview:t,setup:r,jobs:i}){let a=n.reduce((e,n)=>e+(t.counts?.[n]??0),0),o=g(t.counts),c=t.doctor?.ok,l=t.doctor?.problems?.length??0,u=s(t.diff);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,T.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,T.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`tick`,children:`status`}),(0,T.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:(0,T.jsxs)(`span`,{className:`badge ${t.deployed?`ok`:`warn`}`,children:[(0,T.jsx)(`span`,{className:`dot`}),t.deployed?`deployed`:`not deployed`]})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`tick`,children:`voice`}),(0,T.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:t.theme})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`tick`,children:`mode`}),(0,T.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:t.emit})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,T.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:r?.installed_fp||`—`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,T.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:c?(0,T.jsxs)(`span`,{className:`badge ok`,children:[(0,T.jsx)(`span`,{className:`dot`}),`clean`]}):(0,T.jsxs)(`span`,{className:`badge warn`,children:[(0,T.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`div`,{className:`tick`,children:`edits`}),(0,T.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,T.jsxs)(`div`,{className:`grid split-operator`,children:[(0,T.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,T.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,T.jsx)(`h3`,{children:`Sections`}),(0,T.jsx)(`div`,{className:`right`,children:(0,T.jsxs)(`span`,{className:`tick`,children:[a,` entries total`]})})]}),(0,T.jsxs)(`table`,{className:`tbl`,children:[(0,T.jsx)(`thead`,{children:(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`th`,{children:`Section`}),(0,T.jsx)(`th`,{children:`Detail`}),(0,T.jsx)(`th`,{style:{width:130},children:`Share`}),(0,T.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,T.jsx)(`tbody`,{children:n.map(n=>{let r=e[n],i=t.counts?.[n]??0;return(0,T.jsxs)(`tr`,{className:`clickable`,children:[(0,T.jsx)(`td`,{className:`name`,children:(0,T.jsx)(`a`,{href:`#/section/`+n,className:`stretch-link`,children:r.label})}),(0,T.jsx)(`td`,{className:`muted`,children:r.desc}),(0,T.jsx)(`td`,{children:(0,T.jsx)(`div`,{className:`hbar`,children:(0,T.jsx)(`i`,{style:{width:`${i/o*100}%`}})})}),(0,T.jsx)(`td`,{className:`num`,children:i})]},n)})})]})]}),(0,T.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,T.jsx)(`div`,{className:`card-head`,children:(0,T.jsx)(`h3`,{children:`Run log`})}),(0,T.jsx)(k,{jobs:i})]})]})]})}function P(){let[e,t]=(0,S.useState)(!1),[n,r]=(0,S.useState)(null);return(0,T.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,T.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,T.jsx)(`button`,{className:`btn sm`,onClick:async()=>{t(!0),r(null);try{await u()}catch(e){r(e.message),t(!1)}},disabled:e,children:e?`Restarting…`:`Restart`})]})}var F=t({default:()=>z}),I=(0,S.lazy)(()=>y(()=>import(`./GreenhouseView-Sc_UDMOE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),L=(0,S.lazy)(()=>y(()=>import(`./OperatorHudView--TkvDybH.js`),__vite__mapDeps([8,1,2,4,5,6,7]))),R=(0,S.lazy)(()=>y(()=>import(`./JournalView-_gxpsxXi.js`),__vite__mapDeps([9,1,2,5,3,4,6])));function z({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:s,layout:l=`cultivar`,dataRev:u}){let d=l,[f,p]=(0,S.useState)(`status`),m=e&&r.find(t=>t.name===e.theme)?.sigil||``,{data:g}=c(()=>d===`greenhouse`||d===`operator`?o.doctor().catch(()=>null):Promise.resolve(null),[d,u]),{data:_}=c(()=>d===`journal`?o.recent().catch(()=>null):Promise.resolve(null),[d,u]);if(!e)return t?(0,T.jsxs)(`div`,{children:[(0,T.jsx)(v,{error:`Could not load the harness overview: ${t}`}),(0,T.jsx)(`button`,{className:`btn`,onClick:n,children:`Retry`})]}):(0,T.jsx)(x,{});let y=e.daemon_stale?(0,T.jsx)(P,{}):null;return e.deployed?f===`status`&&d===`journal`?(0,T.jsxs)(S.Suspense,{fallback:(0,T.jsx)(x,{}),children:[y,(0,T.jsx)(R,{overview:e,recent:_,onAction:s,onDirection:p,dataRev:u})]}):(0,T.jsxs)(T.Fragment,{children:[y,(0,T.jsx)(`div`,{className:`head-row`,children:(0,T.jsx)(b,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`]].map(([e,t])=>(0,T.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>p(e),"aria-pressed":f===e,children:t},e))})}),(0,T.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`cultivar`&&(0,T.jsx)(A,{overview:e,sigil:m,setup:i,jobs:a,onAction:s}),f===`status`&&d===`greenhouse`&&(0,T.jsx)(S.Suspense,{fallback:(0,T.jsx)(x,{}),children:(0,T.jsx)(I,{overview:e,sigil:m,jobs:a,doctor:g,onAction:s})}),f===`status`&&d===`operator`&&(0,T.jsx)(S.Suspense,{fallback:(0,T.jsx)(x,{}),children:(0,T.jsx)(L,{overview:e,jobs:a,doctor:g,onAction:s})}),f===`lineage`&&(0,T.jsx)(M,{overview:e,sigil:m,setup:i,jobs:a}),f===`operator`&&(0,T.jsx)(N,{overview:e,setup:i,jobs:a})]},f)]}):(0,T.jsxs)(T.Fragment,{children:[y,(0,T.jsx)(h,{onAction:s})]})}export{z as default,w as n,F as t};
@@ -1,5 +1,5 @@
1
- import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-B9Z_tXRV.js";import{t as r}from"./api-D_ixdyEY.js";import{C as i,F as a,S as o,U as s,a as c,i as l,k as u,l as d,n as f,o as p,r as m,s as h,w as ee,x as te,y as g}from"./index-KHt3wE_K.js";import{a as _,c as v,i as y,l as b,n as x,o as S,r as C,s as ne,t as w}from"./Markdown-X2a3qvOh.js";var T=e(t(),1),E=n();function D(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function O(e){return e.replace(/!?\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[\[([^\]]+)\]\]/g,`$1`).replace(/`([^`]*)`/g,`$1`).replace(/\*\*|__/g,``).replace(/\*([^*\s][^*]*)\*/g,`$1`)}function k(e){let t=[],n=!1,r=0;for(let i of(e||``).split(`
2
- `)){if(i.startsWith("```")){n=!n;continue}if(n)continue;let e=i.match(/^(##|###)\s+(.+?)\s*$/);e&&(r+=1,t.push({level:e[1].length,title:O(e[2]),id:D(e[2],r)}))}return t}var A={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},j=`you already know this`;function M({page:e,overview:t,onAction:n}){let r=(0,T.useRef)(null),i=(0,T.useMemo)(()=>x(e.body,e.links),[e.body,e.links]);(0,T.useEffect)(()=>{let e=r.current;if(!e)return;let t=0;e.querySelectorAll(`h1, h2, h3`).forEach(e=>{if(e.tagName!==`H1`&&(t+=1),!e.id){let n=D(e.textContent||``,t);n&&(e.id=n)}}),e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(j)&&e.classList.add(`analogy`)})},[i]),(0,T.useEffect)(()=>{let e=r.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),s(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[i]),(0,T.useEffect)(()=>{let n=r.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[i,a]=A[t?.emit]||[];if(!i)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${i}"]`)?.closest(`li`):e.id===i&&a&&(o=[...n.querySelectorAll(`h2`)].find(e=>D(e.textContent||``)===D(a))),o?.classList.add(`docs-here`)},[i,e.id,t?.emit]);let a=[];return e.id===`install`&&(a.push({label:`Run doctor`,action:`doctor`}),a.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&a.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&a.push({label:`Update`,action:`update`}),(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),e.source&&(0,E.jsx)(`div`,{className:`doc-meta`,children:(0,E.jsxs)(`span`,{className:`badge`,children:[(0,E.jsx)(`span`,{className:`dot`}),e.source]})}),a.length>0&&(0,E.jsx)(`div`,{className:`row wrap gap-10`,style:{margin:`10px 0 14px`},children:a.map(e=>e.hash?(0,E.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,E.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),(0,E.jsx)(`div`,{className:`markdown`,ref:r,dangerouslySetInnerHTML:{__html:i}}),e.link&&(0,E.jsx)(`div`,{style:{marginTop:24},children:(0,E.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var N=1200;function P({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,E.jsxs)(`div`,{className:`cli-arg`,children:[(0,E.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,E.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,E.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function F({text:e}){let[t,n]=(0,T.useState)(!1);return(0,E.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),N)}catch{}},title:`Copy command`,children:[(0,E.jsx)(u,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function I({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,E.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,E.jsxs)(`div`,{className:`row wrap between`,style:{alignItems:`flex-start`},children:[(0,E.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,E.jsx)(`h3`,{style:{margin:0},children:(0,E.jsx)(`code`,{children:e.name})}),e.help&&(0,E.jsx)(`p`,{className:`sub`,style:{margin:0},children:e.help})]}),(0,E.jsx)(F,{text:`${t} ${e.name}`})]}),(0,E.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,E.jsxs)(`div`,{className:`cli-block`,children:[(0,E.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,E.jsx)(P,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,E.jsxs)(`div`,{className:`cli-block`,children:[(0,E.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,E.jsx)(P,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function L({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsxs)(`p`,{className:`sub`,style:{marginTop:4},children:[`Every subcommand of `,(0,E.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,E.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]}),(0,E.jsx)(`div`,{style:{marginTop:18},children:n.map(e=>(0,E.jsx)(I,{cmd:e,prog:t},e.name))})]})}function R({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsxs)(`p`,{className:`sub`,style:{marginTop:4},children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,E.jsx)(`code`,{style:{textTransform:`capitalize`},children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]}),(0,E.jsx)(`div`,{className:`card pad-md`,style:{marginTop:18},children:(0,E.jsxs)(`table`,{className:`glossary-table`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`th`,{children:`Concept`}),(0,E.jsx)(`th`,{children:`Neutral term`}),(0,E.jsxs)(`th`,{children:[`In `,n]}),(0,E.jsx)(`th`,{children:`Meaning`}),(0,E.jsx)(`th`,{children:`In dev terms`})]})}),(0,E.jsx)(`tbody`,{children:t.map(e=>(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`td`,{children:(0,E.jsx)(`strong`,{children:e.label})}),(0,E.jsx)(`td`,{children:(0,E.jsx)(`code`,{children:e.neutral||`—`})}),(0,E.jsx)(`td`,{children:(0,E.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,E.jsx)(`td`,{className:`dim`,children:e.desc}),(0,E.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var z={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`};function B(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
1
+ import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-B9Z_tXRV.js";import{t as r}from"./api-CxgfYu18.js";import{C as i,F as a,H as o,S as s,a as c,i as l,k as u,l as d,n as f,o as p,r as m,s as h,w as ee,x as te,y as g}from"./index-ujKG1ZNf.js";import{a as _,c as v,i as y,l as b,n as x,o as S,r as C,s as ne,t as w}from"./Markdown-X2a3qvOh.js";var T=e(t(),1),E=n();function D(e,t=0){let n=String(e).toLowerCase().trim().replace(/[^a-z0-9\s-]/g,``).replace(/\s+/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n&&/^[a-z]/.test(n)?n:`h-${t}-${n||`section`}`}function O(e){return e.replace(/!?\[([^\]]*)\]\([^)]*\)/g,`$1`).replace(/\[\[([^\]]+)\]\]/g,`$1`).replace(/`([^`]*)`/g,`$1`).replace(/\*\*|__/g,``).replace(/\*([^*\s][^*]*)\*/g,`$1`)}function k(e){let t=[],n=!1,r=0;for(let i of(e||``).split(`
2
+ `)){if(i.startsWith("```")){n=!n;continue}if(n)continue;let e=i.match(/^(##|###)\s+(.+?)\s*$/);e&&(r+=1,t.push({level:e[1].length,title:O(e[2]),id:D(e[2],r)}))}return t}var A={"opencode-global":[`install-opencode`,`Global (recommended)`],opencode:[`install-opencode`,`Per repo`],"claude-global":[`install-claude-code`],claude:[`install-claude-code`],"openclaude-global":[`install-openclaude`],openclaude:[`install-openclaude`],"bob-global":[`install-bob`],bob:[`install-bob`],files:[`install-agent-md`]},j=`you already know this`;function M({page:e,overview:t,onAction:n}){let r=(0,T.useRef)(null),i=(0,T.useMemo)(()=>x(e.body,e.links),[e.body,e.links]);(0,T.useEffect)(()=>{let e=r.current;if(!e)return;let t=0;e.querySelectorAll(`h1, h2, h3`).forEach(e=>{if(e.tagName!==`H1`&&(t+=1),!e.id){let n=D(e.textContent||``,t);n&&(e.id=n)}}),e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(j)&&e.classList.add(`analogy`)})},[i]),(0,T.useEffect)(()=>{let e=r.current;if(!e)return;let t=e=>{let t=e.target.closest(`a[href]`);if(!t)return;let n=t.getAttribute(`href`);n&&n.startsWith(`#/`)&&(e.preventDefault(),o(n))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[i]),(0,T.useEffect)(()=>{let n=r.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[i,a]=A[t?.emit]||[];if(!i)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${i}"]`)?.closest(`li`):e.id===i&&a&&(o=[...n.querySelectorAll(`h2`)].find(e=>D(e.textContent||``)===D(a))),o?.classList.add(`docs-here`)},[i,e.id,t?.emit]);let a=[];return e.id===`install`&&(a.push({label:`Run doctor`,action:`doctor`}),a.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&a.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&a.push({label:`Update`,action:`update`}),(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),e.source&&(0,E.jsx)(`div`,{className:`doc-meta`,children:(0,E.jsxs)(`span`,{className:`badge`,children:[(0,E.jsx)(`span`,{className:`dot`}),e.source]})}),a.length>0&&(0,E.jsx)(`div`,{className:`row wrap gap-10`,style:{margin:`10px 0 14px`},children:a.map(e=>e.hash?(0,E.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,E.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),(0,E.jsx)(`div`,{className:`markdown`,ref:r,dangerouslySetInnerHTML:{__html:i}}),e.link&&(0,E.jsx)(`div`,{style:{marginTop:24},children:(0,E.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var N=1200;function P({a:e,kind:t}){let n=t===`positional`?e.dest:e.names.join(`, `),r=[];return e.metavar&&r.push(e.metavar),e.choices&&r.push(`{${e.choices.join(`|`)}}`),e.default!==null&&e.default!==void 0&&e.default!==``&&!e.is_flag&&r.push(`default: ${e.default}`),e.required&&r.push(`required`),(0,E.jsxs)(`div`,{className:`cli-arg`,children:[(0,E.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,E.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,E.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function F({text:e}){let[t,n]=(0,T.useState)(!1);return(0,E.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),N)}catch{}},title:`Copy command`,children:[(0,E.jsx)(u,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function I({cmd:e,prog:t}){let n=[t,e.name];for(let t of e.positionals||[]){let e=(t.metavar||t.dest||``).toUpperCase();n.push(t.required?e:`[${e}]`)}(e.options||[]).length&&n.push(`[OPTIONS]`);let r=n.join(` `);return(0,E.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,E.jsxs)(`div`,{className:`row wrap between`,style:{alignItems:`flex-start`},children:[(0,E.jsxs)(`div`,{className:`stack`,style:{gap:4},children:[(0,E.jsx)(`h3`,{style:{margin:0},children:(0,E.jsx)(`code`,{children:e.name})}),e.help&&(0,E.jsx)(`p`,{className:`sub`,style:{margin:0},children:e.help})]}),(0,E.jsx)(F,{text:`${t} ${e.name}`})]}),(0,E.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,E.jsxs)(`div`,{className:`cli-block`,children:[(0,E.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,E.jsx)(P,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,E.jsxs)(`div`,{className:`cli-block`,children:[(0,E.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,E.jsx)(P,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function L({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsxs)(`p`,{className:`sub`,style:{marginTop:4},children:[`Every subcommand of `,(0,E.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,E.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]}),(0,E.jsx)(`div`,{style:{marginTop:18},children:n.map(e=>(0,E.jsx)(I,{cmd:e,prog:t},e.name))})]})}function R({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsxs)(`p`,{className:`sub`,style:{marginTop:4},children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,E.jsx)(`code`,{style:{textTransform:`capitalize`},children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]}),(0,E.jsx)(`div`,{className:`card pad-md`,style:{marginTop:18},children:(0,E.jsxs)(`table`,{className:`glossary-table`,children:[(0,E.jsx)(`thead`,{children:(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`th`,{children:`Concept`}),(0,E.jsx)(`th`,{children:`Neutral term`}),(0,E.jsxs)(`th`,{children:[`In `,n]}),(0,E.jsx)(`th`,{children:`Meaning`}),(0,E.jsx)(`th`,{children:`In dev terms`})]})}),(0,E.jsx)(`tbody`,{children:t.map(e=>(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`td`,{children:(0,E.jsx)(`strong`,{children:e.label})}),(0,E.jsx)(`td`,{children:(0,E.jsx)(`code`,{children:e.neutral||`—`})}),(0,E.jsx)(`td`,{children:(0,E.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,E.jsx)(`td`,{className:`dim`,children:e.desc}),(0,E.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var z={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`};function B(e){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
3
3
  `))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
4
4
  `),n.join(`
5
- `)]}var V=({text:e})=>(0,E.jsx)(`span`,{dangerouslySetInnerHTML:{__html:C(y.parseInline(e||``))}}),H=({kind:e})=>(0,E.jsx)(`span`,{className:`tag ${z[e]||``}`,children:e});function U({page:e,overview:t,onAction:n}){let[r,i]=(0,T.useState)(0);if(!e.rows)return(0,E.jsx)(M,{page:e,overview:t,onAction:n});let a=e.rows[r]||e.rows[0],[o,s]=B(e.body);return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsx)(w,{body:o,links:e.links}),(0,E.jsxs)(`div`,{className:`docs-map`,children:[(0,E.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{className:`map-node ${t===r?`on`:``}`,"aria-pressed":t===r,onClick:()=>i(t),children:[(0,E.jsx)(`span`,{className:`map-piece`,children:(0,E.jsx)(V,{text:e.piece})}),(0,E.jsx)(H,{kind:e.kind}),(0,E.jsx)(`span`,{className:`mono dim map-cost`,children:(0,E.jsx)(V,{text:e.cost})})]})},t))}),a&&(0,E.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,E.jsx)(`h3`,{style:{margin:`0 0 8px`},children:(0,E.jsx)(V,{text:a.piece})}),(0,E.jsx)(H,{kind:a.kind}),(0,E.jsxs)(`dl`,{children:[(0,E.jsx)(`dt`,{children:`Does`}),(0,E.jsx)(`dd`,{children:(0,E.jsx)(V,{text:a.does})}),(0,E.jsx)(`dt`,{children:`Costs`}),(0,E.jsx)(`dd`,{children:(0,E.jsx)(V,{text:a.cost})}),(0,E.jsx)(`dt`,{children:`Turn it off`}),(0,E.jsx)(`dd`,{children:(0,E.jsx)(V,{text:a.off})})]})]})]}),s.trim()&&(0,E.jsx)(w,{body:s,links:e.links})]})}var W=5,G=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function K(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${G(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===W)break;return r}var q=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function J({body:e,glossaryRows:t}){let n=(0,T.useMemo)(()=>k(e),[e]),r=(0,T.useMemo)(()=>K(e,t),[e,t]);return!n.length&&!r.length?null:(0,E.jsxs)(`aside`,{className:`docs-margin`,children:[n.length>0&&(0,E.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,E.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,E.jsx)(`ul`,{children:n.map(e=>(0,E.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,E.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),q(e.id)},children:e.title})},e.id))})]}),r.length>0&&(0,E.jsxs)(`div`,{className:`docs-gloss`,children:[(0,E.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),r.map(e=>(0,E.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,E.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,E.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function Y({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,E.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,E.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,E.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,E.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsx)(`p`,{className:`sub`,style:{marginTop:4},children:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,E.jsx)(`div`,{className:`card pad-md`,style:{marginTop:18},children:n.map(([e,t])=>(0,E.jsxs)(`div`,{className:`kv`,children:[(0,E.jsx)(`span`,{className:`k`,children:e}),(0,E.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,E.jsxs)(`div`,{className:`row wrap gap-10`,style:{marginTop:18},children:[(0,E.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,E.jsx)(u,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,E.jsx)(u,{name:`external`}),`File an issue`]}),(0,E.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,E.jsx)(u,{name:`external`}),`License`]})]})]})]})}var X=encodeURIComponent,Z=e=>`#/docs/${X(e)}`;function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function re({data:e,error:t,overview:n,onAction:r}){if(t)return(0,E.jsx)(d,{error:t,style:{margin:18}});if(!e)return(0,E.jsx)(g,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,E.jsx)(M,{page:e,overview:n,onAction:r});case`map`:return(0,E.jsx)(U,{page:e,overview:n,onAction:r});case`cli`:return(0,E.jsx)(L,{page:e});case`glossary`:return(0,E.jsx)(R,{page:e});case`about`:return(0,E.jsx)(Y,{page:e});default:return(0,E.jsxs)(`div`,{className:`empty`,children:[(0,E.jsx)(`div`,{className:`big`,children:`Unknown page kind`}),e.kind]})}}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ie({page:e,overview:t,onAction:n}){let[u,y]=ee(i(t?.emit)),{data:x,error:C}=a(()=>r.docs(u),[u]),w=e||Q(x),{data:D,error:O,loading:k}=a(()=>w?r.docsPage(w,u):Promise.resolve(null),[w,u]),{data:A}=a(()=>r.docsPage(`glossary`,u).catch(()=>null),[u],`docs:glossary`);(0,T.useEffect)(()=>{if(x&&w&&!x.groups.some(e=>e.pages.some(e=>e.id===w))){let e=Q(x);e&&e!==w&&s(Z(e))}},[x,w]),(0,T.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[w]);let j=p(x,w),M=j.part||x?.groups?.[0]||null,N=M?.id===m;(0,T.useEffect)(()=>{N&&D?.id===w&&c(w)},[N,D,w]);let P=N?[...h(),w]:[],[F,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(`all`),[z,B]=(0,T.useState)(M?.id);M?.id!==z&&(B(M?.id),I(``),R(`all`));let V=$(M),H=S(V),U=L===`all`?V:V.filter(e=>e.group===L),W=b(U,F);return C?(0,E.jsx)(d,{error:C}):(0,E.jsx)(`div`,{className:`docs-wrap`,children:(0,E.jsxs)(`div`,{className:`library docs-lib`,children:[(0,E.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,E.jsxs)(`div`,{className:`lib-title`,children:[(0,E.jsx)(`h1`,{className:`h`,children:`Docs`}),(0,E.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,E.jsx)(te,{"aria-label":`Harness`,children:o.map(e=>(0,E.jsx)(`button`,{className:u===e.id?`on`:``,onClick:()=>y(e.id),"aria-pressed":u===e.id,children:e.label},e.id))}),(0,E.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(x?.groups||[]).map(e=>(0,E.jsxs)(T.Fragment,{children:[(0,E.jsxs)(`a`,{href:e.pages[0]?Z(e.pages[0].id):`#/docs`,className:M?.id===e.id?`on`:``,"aria-current":M?.id===e.id?`page`:void 0,children:[e.label,(0,E.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),M?.id===e.id&&(0,E.jsx)(_,{label:`Sections`,total:V.length,cats:H,cat:L,onChange:R})]},e.id))})]}),(0,E.jsx)(v,{label:M?.label||`Docs`,count:F.trim()?`${W.length} of ${U.length}`:U.length||``,extra:N&&(0,E.jsx)(l,{pages:M.pages,seen:P}),q:F,onQ:I,matched:W.length,inView:[M?.id,w],children:x?(0,E.jsx)(ne,{rows:W,activeName:w,hrefOf:e=>Z(e.name),pills:N?e=>P.includes(e.name)&&e.name!==w?(0,E.jsxs)(`span`,{className:`docs-read-mark`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`✓`}),(0,E.jsx)(`span`,{className:`sr-only`,children:`read`})]}):null:void 0}):(0,E.jsx)(g,{label:`Loading docs…`})}),(0,E.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[j.page&&(0,E.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,E.jsx)(`a`,{href:Z(j.part.pages[0].id),children:j.part.label}),(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,E.jsx)(`a`,{href:Z(j.part.pages.find(e=>(e.section||`General`)===j.section).id),children:j.section}),(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,E.jsx)(`span`,{"aria-current":`page`,children:j.page.title})]}),(0,E.jsxs)(`div`,{className:`docs-read`,children:[(0,E.jsxs)(`div`,{className:`docs-article`,children:[(0,E.jsx)(re,{data:k?null:D,error:O,overview:t,onAction:n},`${w}|${u}`),!k&&(0,E.jsx)(f,{menu:x,pageId:w})]}),!k&&(0,E.jsx)(J,{body:D?.body,glossaryRows:A?.rows})]})]})]})})}export{ie as default,$ as docRows};
5
+ `)]}var V=({text:e})=>(0,E.jsx)(`span`,{dangerouslySetInnerHTML:{__html:C(y.parseInline(e||``))}}),H=({kind:e})=>(0,E.jsx)(`span`,{className:`tag ${z[e]||``}`,children:e});function U({page:e,overview:t,onAction:n}){let[r,i]=(0,T.useState)(0);if(!e.rows)return(0,E.jsx)(M,{page:e,overview:t,onAction:n});let a=e.rows[r]||e.rows[0],[o,s]=B(e.body);return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsx)(w,{body:o,links:e.links}),(0,E.jsxs)(`div`,{className:`docs-map`,children:[(0,E.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,E.jsx)(`li`,{children:(0,E.jsxs)(`button`,{className:`map-node ${t===r?`on`:``}`,"aria-pressed":t===r,onClick:()=>i(t),children:[(0,E.jsx)(`span`,{className:`map-piece`,children:(0,E.jsx)(V,{text:e.piece})}),(0,E.jsx)(H,{kind:e.kind}),(0,E.jsx)(`span`,{className:`mono dim map-cost`,children:(0,E.jsx)(V,{text:e.cost})})]})},t))}),a&&(0,E.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,E.jsx)(`h3`,{style:{margin:`0 0 8px`},children:(0,E.jsx)(V,{text:a.piece})}),(0,E.jsx)(H,{kind:a.kind}),(0,E.jsxs)(`dl`,{children:[(0,E.jsx)(`dt`,{children:`Does`}),(0,E.jsx)(`dd`,{children:(0,E.jsx)(V,{text:a.does})}),(0,E.jsx)(`dt`,{children:`Costs`}),(0,E.jsx)(`dd`,{children:(0,E.jsx)(V,{text:a.cost})}),(0,E.jsx)(`dt`,{children:`Turn it off`}),(0,E.jsx)(`dd`,{children:(0,E.jsx)(V,{text:a.off})})]})]})]}),s.trim()&&(0,E.jsx)(w,{body:s,links:e.links})]})}var W=5,G=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function K(e,t){let n=e||``,r=[];for(let e of t||[])if([...new Set([e.themed,e.neutral,e.label].filter(Boolean))].some(e=>RegExp(`(?<![\\w-])${G(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===W)break;return r}var q=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function J({body:e,glossaryRows:t}){let n=(0,T.useMemo)(()=>k(e),[e]),r=(0,T.useMemo)(()=>K(e,t),[e,t]);return!n.length&&!r.length?null:(0,E.jsxs)(`aside`,{className:`docs-margin`,children:[n.length>0&&(0,E.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,E.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,E.jsx)(`ul`,{children:n.map(e=>(0,E.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,E.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),q(e.id)},children:e.title})},e.id))})]}),r.length>0&&(0,E.jsxs)(`div`,{className:`docs-gloss`,children:[(0,E.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),r.map(e=>(0,E.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,E.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,E.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function Y({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,E.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,E.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,E.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,E.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,E.jsxs)(`div`,{className:`detail-doc`,children:[(0,E.jsx)(`h1`,{style:{marginTop:0},children:e.title}),(0,E.jsx)(`p`,{className:`sub`,style:{marginTop:4},children:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,E.jsx)(`div`,{className:`card pad-md`,style:{marginTop:18},children:n.map(([e,t])=>(0,E.jsxs)(`div`,{className:`kv`,children:[(0,E.jsx)(`span`,{className:`k`,children:e}),(0,E.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,E.jsxs)(`div`,{className:`row wrap gap-10`,style:{marginTop:18},children:[(0,E.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,E.jsx)(u,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,E.jsx)(u,{name:`external`}),`File an issue`]}),(0,E.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,E.jsx)(u,{name:`external`}),`License`]})]})]})]})}var X=encodeURIComponent,Z=e=>`#/docs/${X(e)}`;function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function re({data:e,error:t,overview:n,onAction:r}){if(t)return(0,E.jsx)(d,{error:t,style:{margin:18}});if(!e)return(0,E.jsx)(g,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,E.jsx)(M,{page:e,overview:n,onAction:r});case`map`:return(0,E.jsx)(U,{page:e,overview:n,onAction:r});case`cli`:return(0,E.jsx)(L,{page:e});case`glossary`:return(0,E.jsx)(R,{page:e});case`about`:return(0,E.jsx)(Y,{page:e});default:return(0,E.jsxs)(`div`,{className:`empty`,children:[(0,E.jsx)(`div`,{className:`big`,children:`Unknown page kind`}),e.kind]})}}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function ie({page:e,overview:t,onAction:n}){let[u,y]=ee(i(t?.emit)),{data:x,error:C}=a(()=>r.docs(u),[u]),w=e||Q(x),{data:D,error:O,loading:k}=a(()=>w?r.docsPage(w,u):Promise.resolve(null),[w,u]),{data:A}=a(()=>r.docsPage(`glossary`,u).catch(()=>null),[u],`docs:glossary`);(0,T.useEffect)(()=>{if(x&&w&&!x.groups.some(e=>e.pages.some(e=>e.id===w))){let e=Q(x);e&&e!==w&&o(Z(e))}},[x,w]),(0,T.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[w]);let j=p(x,w),M=j.part||x?.groups?.[0]||null,N=M?.id===m;(0,T.useEffect)(()=>{N&&D?.id===w&&c(w)},[N,D,w]);let P=N?[...h(),w]:[],[F,I]=(0,T.useState)(``),[L,R]=(0,T.useState)(`all`),[z,B]=(0,T.useState)(M?.id);M?.id!==z&&(B(M?.id),I(``),R(`all`));let V=$(M),H=S(V),U=L===`all`?V:V.filter(e=>e.group===L),W=b(U,F);return C?(0,E.jsx)(d,{error:C}):(0,E.jsx)(`div`,{className:`docs-wrap`,children:(0,E.jsxs)(`div`,{className:`library docs-lib`,children:[(0,E.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,E.jsxs)(`div`,{className:`lib-title`,children:[(0,E.jsx)(`h1`,{className:`h`,children:`Docs`}),(0,E.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,E.jsx)(te,{"aria-label":`Harness`,children:s.map(e=>(0,E.jsx)(`button`,{className:u===e.id?`on`:``,onClick:()=>y(e.id),"aria-pressed":u===e.id,children:e.label},e.id))}),(0,E.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(x?.groups||[]).map(e=>(0,E.jsxs)(T.Fragment,{children:[(0,E.jsxs)(`a`,{href:e.pages[0]?Z(e.pages[0].id):`#/docs`,className:M?.id===e.id?`on`:``,"aria-current":M?.id===e.id?`page`:void 0,children:[e.label,(0,E.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),M?.id===e.id&&(0,E.jsx)(_,{label:`Sections`,total:V.length,cats:H,cat:L,onChange:R})]},e.id))})]}),(0,E.jsx)(v,{label:M?.label||`Docs`,count:F.trim()?`${W.length} of ${U.length}`:U.length||``,extra:N&&(0,E.jsx)(l,{pages:M.pages,seen:P}),q:F,onQ:I,matched:W.length,inView:[M?.id,w],children:x?(0,E.jsx)(ne,{rows:W,activeName:w,hrefOf:e=>Z(e.name),pills:N?e=>P.includes(e.name)&&e.name!==w?(0,E.jsxs)(`span`,{className:`docs-read-mark`,children:[(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`✓`}),(0,E.jsx)(`span`,{className:`sr-only`,children:`read`})]}):null:void 0}):(0,E.jsx)(g,{label:`Loading docs…`})}),(0,E.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[j.page&&(0,E.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,E.jsx)(`a`,{href:Z(j.part.pages[0].id),children:j.part.label}),(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,E.jsx)(`a`,{href:Z(j.part.pages.find(e=>(e.section||`General`)===j.section).id),children:j.section}),(0,E.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,E.jsx)(`span`,{"aria-current":`page`,children:j.page.title})]}),(0,E.jsxs)(`div`,{className:`docs-read`,children:[(0,E.jsxs)(`div`,{className:`docs-article`,children:[(0,E.jsx)(re,{data:k?null:D,error:O,overview:t,onAction:n},`${w}|${u}`),!k&&(0,E.jsx)(f,{menu:x,pageId:w})]}),!k&&(0,E.jsx)(J,{body:D?.body,glossaryRows:A?.rows})]})]})]})})}export{ie as default,$ as docRows};
@@ -1,2 +1,2 @@
1
- import{n as e,r as t,s as n}from"./sections-GalMS0Zv.js";import{i as r,t as i}from"./react-B9Z_tXRV.js";import{t as a}from"./drawable-zVVDbsyw.js";import{$ as o,A as s,G as c,K as l,W as u,X as d,k as f}from"./index-KHt3wE_K.js";import{t as p}from"./jobBuckets-Dbq8ZlWW.js";import{n as m}from"./Dashboard-J-xCe_Gk.js";var h=n(r(),1),g=i(),_=12,v=120,y=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],b=650;function x({segments:e,size:t=186,stroke:n=26,caption:r=`capabilities`}){let i=e.reduce((e,t)=>e+t.value,0)||1,s=(0,h.useRef)(null),f=e.map(e=>e.value).join(`,`);(0,h.useLayoutEffect)(()=>{let t=s.current?.querySelectorAll(`path`);if(!t?.length||!c())return;let n=e.filter(e=>e.value>0).map(e=>e.value/i),r=n.map((e,t)=>n.slice(0,t).reduce((e,t)=>e+t,0)),u=a(t);d(u,{draw:`0 0`});let f=o(u,{draw:[`0 0`,`0 1`],duration:(e,t)=>Math.max(b*n[t],60),delay:(e,t)=>b*r[t],ease:`linear`});return l(f,b)},[f]);let p=t/2-n/2,m=t/2,_=t/2,v=[],y=0;for(let t of e)v.push(y),y+=t.value;return(0,g.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[(0,g.jsx)(`circle`,{cx:m,cy:_,r:p,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:n}),(0,g.jsx)(`g`,{ref:s,children:e.map((e,t)=>{if(e.value/i<=0)return null;let r=v[t]/i*2*Math.PI-Math.PI/2,a=(v[t]+e.value)/i*2*Math.PI-Math.PI/2,o=m+p*Math.cos(r),s=_+p*Math.sin(r),c=m+p*Math.cos(a),l=_+p*Math.sin(a),u=+(a-r>Math.PI);return(0,g.jsx)(`path`,{d:`M ${o} ${s} A ${p} ${p} 0 ${u} 1 ${c} ${l}`,fill:`none`,stroke:e.color,strokeWidth:n,strokeLinecap:`butt`,children:(0,g.jsxs)(`title`,{children:[e.label,`: `,e.value]})},t)})}),(0,g.jsx)(`text`,{x:m,y:_-4,textAnchor:`middle`,className:`donut-c-num`,children:(0,g.jsx)(u,{value:i,duration:b})}),(0,g.jsx)(`text`,{x:m,y:_+16,textAnchor:`middle`,className:`donut-c-cap`,children:r})]})}function S(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function C({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=S(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,g.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,g.jsx)(`defs`,{children:(0,g.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,g.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,g.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,g.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,g.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,g.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function w({label:e,value:t,sub:n,color:r,icon:i}){return(0,g.jsxs)(`div`,{className:`b-tile`,children:[(0,g.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,g.jsx)(f,{name:i})}),(0,g.jsxs)(`div`,{className:`b-tile-body`,children:[(0,g.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,g.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,g.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function T({overview:n,sigil:r,jobs:i,doctor:a,onAction:o}){let c=n.counts||{},l=a?.groups||[],d=l.length>0,h=l.filter(e=>e.problems.length===0).length,b=l.length||1,S=m(n),T=s(n.diff),E=t.filter(e=>(c[e]||0)>0).map((t,n)=>({label:e[t].label,value:c[t]||0,color:y[n%y.length]})),D=E.reduce((e,t)=>e+t.value,0),O=p(i||[],10),k=O.reduce((e,t)=>e+t.v,0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{className:`b-greet`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,g.jsx)(`h1`,{className:`h b-h`,children:S}),(0,g.jsx)(`p`,{className:`sub`,children:r||`A friendly read of every layer growing in your harness.`})]}),(0,g.jsxs)(`div`,{className:`row gap-8`,children:[(0,g.jsxs)(`button`,{className:`btn`,onClick:()=>o(`update`),children:[(0,g.jsx)(f,{name:`refresh`}),`Update`]}),(0,g.jsxs)(`button`,{className:`btn ghost`,onClick:()=>o(`build-all`),children:[(0,g.jsx)(f,{name:`build`}),`Rebuild`]})]})]}),(0,g.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,g.jsxs)(`div`,{className:`card b-hero`,children:[(0,g.jsx)(`div`,{className:`b-hero-ring`,children:(0,g.jsx)(x,{segments:[{label:`pass`,value:h,color:y[0]},{label:`attention`,value:Math.max(b-h,0),color:y[2]}],size:168,stroke:20,caption:`checks`})}),(0,g.jsxs)(`div`,{className:`b-hero-side`,children:[(0,g.jsx)(`h3`,{className:`b-hero-title`,children:d?`${h} of ${b} checks pass`:`Running checks…`}),(0,g.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,g.jsx)(`code`,{children:n.target}),` and inherited by every repo on this machine.`]}),d&&(0,g.jsx)(`ul`,{className:`b-hero-checks`,children:l.map(e=>{let t=e.problems.length===0;return(0,g.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,g.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,g.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,g.jsxs)(`div`,{className:`b-chips`,children:[(0,g.jsxs)(`span`,{className:`b-chip`,children:[(0,g.jsx)(`b`,{style:{textTransform:`capitalize`},children:n.theme}),` voice`]}),(0,g.jsx)(`span`,{className:`b-chip`,children:(0,g.jsx)(`b`,{children:n.emit})}),(0,g.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,g.jsx)(`b`,{children:n.build_time||`unknown`})]})]})]})]}),(0,g.jsxs)(`div`,{className:`b-tiles`,children:[(0,g.jsx)(w,{label:`Agents`,value:c.agents??`—`,sub:`specialists`,color:y[0],icon:`layers`}),(0,g.jsx)(w,{label:`Skills`,value:c.skills??`—`,sub:`workflows`,color:y[1],icon:`skill`}),(0,g.jsx)(w,{label:`Invariants`,value:c.laws??`—`,sub:c.doctrines?`${c.doctrines.active}/${c.doctrines.total} packs · ${c.doctrines.rules} rules`:`all upheld`,color:y[2],icon:`law`}),(0,g.jsx)(w,{label:`Edits`,value:T,sub:`to graft`,color:y[3],icon:`changes`})]})]}),(0,g.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,g.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,g.jsxs)(`div`,{className:`card-head`,children:[(0,g.jsx)(`h3`,{children:`Capability mix`}),(0,g.jsx)(`div`,{className:`right`,children:(0,g.jsxs)(`span`,{className:`tick`,children:[D,` total`]})})]}),(0,g.jsxs)(`div`,{className:`b-mix`,children:[(0,g.jsx)(x,{segments:E,size:186,stroke:26}),(0,g.jsx)(`div`,{className:`b-legend`,children:E.map(e=>(0,g.jsxs)(`div`,{className:`b-leg-row`,children:[(0,g.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,g.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,g.jsx)(`span`,{className:`b-leg-bar`,children:(0,g.jsx)(`i`,{style:{width:`${e.value/D*100}%`,background:e.color}})}),(0,g.jsx)(`span`,{className:`b-leg-val`,children:e.value})]},e.label))})]})]}),(0,g.jsxs)(`div`,{className:`card pad-lg`,children:[(0,g.jsxs)(`div`,{className:`card-head`,children:[(0,g.jsx)(`h3`,{children:`Recent runs`}),(0,g.jsx)(`div`,{className:`right`,children:(0,g.jsxs)(`span`,{className:`badge ok`,children:[(0,g.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,g.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,g.jsx)(`span`,{className:`b-stat-big`,children:(0,g.jsx)(u,{value:k})}),(0,g.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days · `,h,`/`,b,` checks pass now`]})]}),(0,g.jsx)(C,{data:O,accent:y[0],height:156})]})]}),(0,g.jsxs)(`div`,{className:`card pad-lg`,children:[(0,g.jsxs)(`div`,{className:`card-head`,children:[(0,g.jsx)(`h3`,{children:`Recent activity`}),(0,g.jsx)(`div`,{className:`right`,children:(0,g.jsxs)(`span`,{className:`tick`,children:[`last `,Math.min(i?.length||0,12),` runs`]})})]}),(0,g.jsxs)(`div`,{className:`b-timeline`,children:[(i||[]).slice(0,_).map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`;return(0,g.jsxs)(`div`,{className:`b-tl-row`,children:[(0,g.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,g.jsxs)(`div`,{className:`b-tl-body`,children:[(0,g.jsx)(`b`,{children:e.action}),e.output?`: ${e.output.split(`
1
+ import{n as e,r as t,s as n}from"./sections-GalMS0Zv.js";import{i as r,t as i}from"./react-B9Z_tXRV.js";import{t as a}from"./drawable-BbWQxe82.js";import{A as o,G as s,Q as c,U as l,W as u,Y as d,k as f}from"./index-ujKG1ZNf.js";import{t as p}from"./jobBuckets-Dbq8ZlWW.js";import{n as m}from"./Dashboard-D1lE7jcg.js";var h=n(r(),1),g=i(),_=12,v=120,y=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],b=650;function x({segments:e,size:t=186,stroke:n=26,caption:r=`capabilities`}){let i=e.reduce((e,t)=>e+t.value,0)||1,o=(0,h.useRef)(null),f=e.map(e=>e.value).join(`,`);(0,h.useLayoutEffect)(()=>{let t=o.current?.querySelectorAll(`path`);if(!t?.length||!u())return;let n=e.filter(e=>e.value>0).map(e=>e.value/i),r=n.map((e,t)=>n.slice(0,t).reduce((e,t)=>e+t,0)),l=a(t);d(l,{draw:`0 0`});let f=c(l,{draw:[`0 0`,`0 1`],duration:(e,t)=>Math.max(b*n[t],60),delay:(e,t)=>b*r[t],ease:`linear`});return s(f,b)},[f]);let p=t/2-n/2,m=t/2,_=t/2,v=[],y=0;for(let t of e)v.push(y),y+=t.value;return(0,g.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,children:[(0,g.jsx)(`circle`,{cx:m,cy:_,r:p,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:n}),(0,g.jsx)(`g`,{ref:o,children:e.map((e,t)=>{if(e.value/i<=0)return null;let r=v[t]/i*2*Math.PI-Math.PI/2,a=(v[t]+e.value)/i*2*Math.PI-Math.PI/2,o=m+p*Math.cos(r),s=_+p*Math.sin(r),c=m+p*Math.cos(a),l=_+p*Math.sin(a),u=+(a-r>Math.PI);return(0,g.jsx)(`path`,{d:`M ${o} ${s} A ${p} ${p} 0 ${u} 1 ${c} ${l}`,fill:`none`,stroke:e.color,strokeWidth:n,strokeLinecap:`butt`,children:(0,g.jsxs)(`title`,{children:[e.label,`: `,e.value]})},t)})}),(0,g.jsx)(`text`,{x:m,y:_-4,textAnchor:`middle`,className:`donut-c-num`,children:(0,g.jsx)(l,{value:i,duration:b})}),(0,g.jsx)(`text`,{x:m,y:_+16,textAnchor:`middle`,className:`donut-c-cap`,children:r})]})}function S(e){if(e.length<2)return e.length?`M${e[0][0]},${e[0][1]}`:``;let t=`M${e[0][0]},${e[0][1]}`;for(let n=0;n<e.length-1;n++){let r=e[n-1]||e[n],i=e[n],a=e[n+1],o=e[n+2]||a,s=i[0]+(a[0]-r[0])/6,c=i[1]+(a[1]-r[1])/6,l=a[0]-(o[0]-i[0])/6,u=a[1]-(o[1]-i[1])/6;t+=` C${s},${c} ${l},${u} ${a[0]},${a[1]}`}return t}function C({data:e,height:t=156,accent:n}){if(!e.length)return null;let r=t,i=Math.max(...e.map(e=>e.v),1)+1,a=e.length>1?588/(e.length-1):588,o=e.map((e,t)=>[6+t*a,r-6-e.v/i*(r-14-6)]),s=S(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,g.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,g.jsx)(`defs`,{children:(0,g.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,g.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,g.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,g.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,g.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,g.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function w({label:e,value:t,sub:n,color:r,icon:i}){return(0,g.jsxs)(`div`,{className:`b-tile`,children:[(0,g.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,g.jsx)(f,{name:i})}),(0,g.jsxs)(`div`,{className:`b-tile-body`,children:[(0,g.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,g.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,g.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function T({overview:n,sigil:r,jobs:i,doctor:a,onAction:s}){let c=n.counts||{},u=a?.groups||[],d=u.length>0,h=u.filter(e=>e.problems.length===0).length,b=u.length||1,S=m(n),T=o(n.diff),E=t.filter(e=>(c[e]||0)>0).map((t,n)=>({label:e[t].label,value:c[t]||0,color:y[n%y.length]})),D=E.reduce((e,t)=>e+t.value,0),O=p(i||[],10),k=O.reduce((e,t)=>e+t.v,0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{className:`b-greet`,children:[(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,g.jsx)(`h1`,{className:`h b-h`,children:S}),(0,g.jsx)(`p`,{className:`sub`,children:r||`A friendly read of every layer growing in your harness.`})]}),(0,g.jsxs)(`div`,{className:`row gap-8`,children:[(0,g.jsxs)(`button`,{className:`btn`,onClick:()=>s(`update`),children:[(0,g.jsx)(f,{name:`refresh`}),`Update`]}),(0,g.jsxs)(`button`,{className:`btn ghost`,onClick:()=>s(`build-all`),children:[(0,g.jsx)(f,{name:`build`}),`Rebuild`]})]})]}),(0,g.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,g.jsxs)(`div`,{className:`card b-hero`,children:[(0,g.jsx)(`div`,{className:`b-hero-ring`,children:(0,g.jsx)(x,{segments:[{label:`pass`,value:h,color:y[0]},{label:`attention`,value:Math.max(b-h,0),color:y[2]}],size:168,stroke:20,caption:`checks`})}),(0,g.jsxs)(`div`,{className:`b-hero-side`,children:[(0,g.jsx)(`h3`,{className:`b-hero-title`,children:d?`${h} of ${b} checks pass`:`Running checks…`}),(0,g.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,g.jsx)(`code`,{children:n.target}),` and inherited by every repo on this machine.`]}),d&&(0,g.jsx)(`ul`,{className:`b-hero-checks`,children:u.map(e=>{let t=e.problems.length===0;return(0,g.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,g.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,g.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,g.jsxs)(`div`,{className:`b-chips`,children:[(0,g.jsxs)(`span`,{className:`b-chip`,children:[(0,g.jsx)(`b`,{style:{textTransform:`capitalize`},children:n.theme}),` voice`]}),(0,g.jsx)(`span`,{className:`b-chip`,children:(0,g.jsx)(`b`,{children:n.emit})}),(0,g.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,g.jsx)(`b`,{children:n.build_time||`unknown`})]})]})]})]}),(0,g.jsxs)(`div`,{className:`b-tiles`,children:[(0,g.jsx)(w,{label:`Agents`,value:c.agents??`—`,sub:`specialists`,color:y[0],icon:`layers`}),(0,g.jsx)(w,{label:`Skills`,value:c.skills??`—`,sub:`workflows`,color:y[1],icon:`skill`}),(0,g.jsx)(w,{label:`Invariants`,value:c.laws??`—`,sub:c.doctrines?`${c.doctrines.active}/${c.doctrines.total} packs · ${c.doctrines.rules} rules`:`all upheld`,color:y[2],icon:`law`}),(0,g.jsx)(w,{label:`Edits`,value:T,sub:`to graft`,color:y[3],icon:`changes`})]})]}),(0,g.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,g.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,g.jsxs)(`div`,{className:`card-head`,children:[(0,g.jsx)(`h3`,{children:`Capability mix`}),(0,g.jsx)(`div`,{className:`right`,children:(0,g.jsxs)(`span`,{className:`tick`,children:[D,` total`]})})]}),(0,g.jsxs)(`div`,{className:`b-mix`,children:[(0,g.jsx)(x,{segments:E,size:186,stroke:26}),(0,g.jsx)(`div`,{className:`b-legend`,children:E.map(e=>(0,g.jsxs)(`div`,{className:`b-leg-row`,children:[(0,g.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,g.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,g.jsx)(`span`,{className:`b-leg-bar`,children:(0,g.jsx)(`i`,{style:{width:`${e.value/D*100}%`,background:e.color}})}),(0,g.jsx)(`span`,{className:`b-leg-val`,children:e.value})]},e.label))})]})]}),(0,g.jsxs)(`div`,{className:`card pad-lg`,children:[(0,g.jsxs)(`div`,{className:`card-head`,children:[(0,g.jsx)(`h3`,{children:`Recent runs`}),(0,g.jsx)(`div`,{className:`right`,children:(0,g.jsxs)(`span`,{className:`badge ok`,children:[(0,g.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,g.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,g.jsx)(`span`,{className:`b-stat-big`,children:(0,g.jsx)(l,{value:k})}),(0,g.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days · `,h,`/`,b,` checks pass now`]})]}),(0,g.jsx)(C,{data:O,accent:y[0],height:156})]})]}),(0,g.jsxs)(`div`,{className:`card pad-lg`,children:[(0,g.jsxs)(`div`,{className:`card-head`,children:[(0,g.jsx)(`h3`,{children:`Recent activity`}),(0,g.jsx)(`div`,{className:`right`,children:(0,g.jsxs)(`span`,{className:`tick`,children:[`last `,Math.min(i?.length||0,12),` runs`]})})]}),(0,g.jsxs)(`div`,{className:`b-timeline`,children:[(i||[]).slice(0,_).map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`;return(0,g.jsxs)(`div`,{className:`b-tl-row`,children:[(0,g.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,g.jsxs)(`div`,{className:`b-tl-body`,children:[(0,g.jsx)(`b`,{children:e.action}),e.output?`: ${e.output.split(`
2
2
  `)[0].slice(0,v)}`:``]}),(0,g.jsx)(`span`,{className:`b-tl-when`,children:e.duration?`${e.duration}s`:e.status})]},e.id)}),(!i||i.length===0)&&(0,g.jsxs)(`div`,{className:`b-tl-row`,children:[(0,g.jsx)(`span`,{className:`b-tl-node`}),(0,g.jsx)(`div`,{className:`b-tl-body sub`,children:`No runs yet. Trigger an action to populate this.`}),(0,g.jsx)(`span`,{className:`b-tl-when`,children:`—`})]})]})]})]})}export{T as default};