geneseed 4.21.0 → 4.23.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.
- package/CHANGELOG.md +34 -0
- package/DESIGN.md +1 -1
- package/README.md +2 -2
- package/SHIPPED.md +1 -1
- package/adapters/bob/README.md +5 -0
- package/adapters/claude-code/README.md +4 -0
- package/adapters/openclaude/README.md +2 -1
- package/adapters/opencode/plugins/geneseed-activity.js +2 -2
- package/adapters/opencode/plugins/geneseed-guard.js +1 -1
- package/bin/geneseed-cli.mjs +1 -1
- package/bin/geneseed-hook.mjs +44 -3
- package/docs/concepts/hooks.md +4 -0
- package/docs/concepts/host-matrix.md +1 -0
- package/docs/reference/environment.md +1 -0
- package/docs/reference/plugin-activity.md +7 -3
- package/docs/web-ui.md +22 -15
- package/harness.config.json +1 -1
- package/js/README.md +2 -1
- package/js/cli-table.json +39 -0
- package/js/hosts/activity.mjs +429 -0
- package/js/hosts/hooks-prims.mjs +47 -4
- package/js/hosts/hooks.mjs +6 -9
- package/js/hosts/settings.mjs +9 -0
- package/js/web/activity.mjs +76 -108
- package/js/web/api.mjs +3 -0
- package/js/web/server.mjs +6 -0
- package/package.json +1 -1
- package/src/modes/foreman.md +2 -1
- package/src/skills/parallel-agents.md +1 -1
- package/src/skills/pipeline.md +2 -2
- package/web/dist/assets/Activity-GdsfJgQQ.js +1 -0
- package/web/dist/assets/ActivityDetail-BsVbLWoA.js +1 -0
- package/web/dist/assets/Dashboard-CnO_bsfz.js +2 -0
- package/web/dist/assets/DataTable-BWbUx4bY.js +1 -0
- package/web/dist/assets/Docs-DctLhPHX.js +4 -0
- package/web/dist/assets/FilterInput-CZREvrjX.js +1 -0
- package/web/dist/assets/GreenhouseView-CC1wDg4u.js +1 -0
- package/web/dist/assets/Installs-D3fE87tF.js +3 -0
- package/web/dist/assets/JournalView-e6BBAz6i.js +1 -0
- package/web/dist/assets/KitApply-Bz6_5yec.js +1 -0
- package/web/dist/assets/Kits-BtNHZ7_Z.js +1 -0
- package/web/dist/assets/Laws-B2X2jIE9.js +3 -0
- package/web/dist/assets/Library-BXHx4pFJ.js +2 -0
- package/web/dist/assets/Loops-B_wNVFEN.js +2 -0
- package/web/dist/assets/Markdown-DpmmtW2Y.js +65 -0
- package/web/dist/assets/OperatorHudView-BcPPpykd.js +1 -0
- package/web/dist/assets/Personal-BwZ33bqc.js +2 -0
- package/web/dist/assets/RailCats-BtIstKaH.js +1 -0
- package/web/dist/assets/Tabs-ByiD3mPQ.js +1 -0
- package/web/dist/assets/index-BX3zc2Yi.css +1 -0
- package/web/dist/assets/index-D2VlAlpK.js +3 -0
- package/web/dist/assets/motion-CXaUMNkg.js +1 -0
- package/web/dist/index.html +3 -2
- package/web/dist/assets/Activity-DsKkFGhT.js +0 -1
- package/web/dist/assets/ActivityDetail-BWY-vaiK.js +0 -1
- package/web/dist/assets/Dashboard-BZmw2a7d.js +0 -2
- package/web/dist/assets/Docs-CNuRuMin.js +0 -4
- package/web/dist/assets/GreenhouseView-BCiZP9f9.js +0 -1
- package/web/dist/assets/Installs-xkBX6OjK.js +0 -3
- package/web/dist/assets/JournalView-BSR51TKR.js +0 -1
- package/web/dist/assets/KitApply-BR8AcZ62.js +0 -1
- package/web/dist/assets/Kits-e0DCj9sT.js +0 -1
- package/web/dist/assets/Laws-BuG2_HFE.js +0 -3
- package/web/dist/assets/Library-BYfB4mhf.js +0 -2
- package/web/dist/assets/Loops-r6L7a1g1.js +0 -2
- package/web/dist/assets/Markdown-OReRRoEV.js +0 -65
- package/web/dist/assets/OperatorHudView-BLXm0zzn.js +0 -1
- package/web/dist/assets/Personal-kEfKCxlh.js +0 -1
- package/web/dist/assets/RailCats-DNlJKicm.js +0 -1
- package/web/dist/assets/StackBar-Y_gkoC3t.js +0 -1
- package/web/dist/assets/Tabs-2uMB511T.js +0 -1
- package/web/dist/assets/activity-BEWV9er4.js +0 -1
- package/web/dist/assets/drawable-ixCquffB.js +0 -1
- package/web/dist/assets/index-CDSHv_7s.css +0 -1
- package/web/dist/assets/index-Dwo3Gxek.js +0 -2
- package/web/dist/assets/jobBuckets-Dpjvbfm1.js +0 -2
package/js/web/activity.mjs
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The live-activity surface
|
|
3
|
-
* DELETES.
|
|
2
|
+
* The live-activity surface. A GET reads; it never deletes or moves a file.
|
|
4
3
|
*
|
|
5
|
-
* It reads the per-session JSON files
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* It reads the per-session JSON files two writers put into `<cfg>/activity/`: the
|
|
5
|
+
* `geneseed-activity` OpenCode plugin, and the hook-side writer for Claude Code, OpenClaude
|
|
6
|
+
* and Bob (`js/hosts/activity.mjs`). Writers and reader share only that directory: no RPC,
|
|
7
|
+
* crash-isolated, and cross-tool by construction. A live session is in `activity`; a stale,
|
|
8
|
+
* dead or ended one — in the directory still, or already swept into `activity/archive/` — is
|
|
9
|
+
* in `ended`, marked `ended: true`, and the live copy wins a duplicate.
|
|
10
|
+
*
|
|
11
|
+
* WHY THE GET STOPPED PRUNING. It used to unlink every snapshot that failed the liveness test,
|
|
12
|
+
* which made a page view the one web read that deleted, and left nothing to show of a session
|
|
13
|
+
* that had just finished. Moving belongs to `sweepActivity`, which the hook writer runs on
|
|
14
|
+
* SessionStart and SessionEnd and which archives instead of deleting. The OpenCode plugin never
|
|
15
|
+
* sweeps, so its dead snapshots stay in place: `ended` is therefore capped HERE, in what is
|
|
16
|
+
* returned, to the archive's own rule (the newest `ARCHIVE_KEEP`, none older than
|
|
17
|
+
* `ARCHIVE_MAX_AGE_SECONDS`) — without touching a file.
|
|
9
18
|
*
|
|
10
19
|
* `/api/activity` answers a GET through `apiActivity` and a POST through `apiActivityToggle`
|
|
11
20
|
* at the bottom of this file. It is the one POST route whose result is sent at 200 whatever
|
|
12
21
|
* `ok` says, which is why `POST_ROUTES` in `js/web/routes.mjs` carries a 409 COLUMN rather
|
|
13
22
|
* than a rule — and giving this row the 409 treatment is mutation M22.
|
|
14
23
|
*
|
|
15
|
-
* `
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* "no such process" vs "err toward alive".
|
|
19
|
-
*
|
|
20
|
-
* `process.kill` alone cannot tell a truly-dead pid from one that EXITED but whose handle is
|
|
21
|
-
* still held: it reports the latter alive too. The staleness backstop (below) is what prunes
|
|
22
|
-
* it, thirty minutes later — reproducing an exit-code read would need a native binding, not
|
|
23
|
-
* worth it for a best-effort probe that already errs toward "alive" on any inconclusive
|
|
24
|
-
* answer.
|
|
24
|
+
* Liveness (`isLive`) is owned by `js/hosts/activity.mjs`, because the sweep needs the same
|
|
25
|
+
* answer: a hook snapshot carries `pid: null` and is live by staleness alone; a plugin one is
|
|
26
|
+
* also probed with `process.kill(pid, 0)`, which is a core `process` API, not `child_process`.
|
|
25
27
|
*
|
|
26
28
|
* `parseJson`, NOT `JSON.parse` — NOT a style choice. These files are written by a third
|
|
27
29
|
* party and carry `cost` as a float. `JSON.parse` collapses `1.0` to the bare integer `1`,
|
|
@@ -33,28 +35,22 @@
|
|
|
33
35
|
* `0.0` instead of collapsing to the fallback `0`. `isTruthy` is what makes a wrapped zero
|
|
34
36
|
* read as falsy, so a `"cost": 0.0` entry correctly comes back `0`.
|
|
35
37
|
*/
|
|
36
|
-
import { mkdirSync, readdirSync
|
|
38
|
+
import { mkdirSync, readdirSync } from 'node:fs';
|
|
37
39
|
import path from 'node:path';
|
|
38
40
|
|
|
39
41
|
import { readText, writeText, isDir, isFile } from '../lib/fs.mjs';
|
|
40
42
|
import { parseJson, isTruthy } from '../lib/json.mjs';
|
|
41
43
|
import { normcase } from '../lib/paths.mjs';
|
|
42
|
-
import {
|
|
44
|
+
import { stripWhitespace } from '../lib/text.mjs';
|
|
45
|
+
import { ARCHIVE_KEEP, ARCHIVE_MAX_AGE_SECONDS, isLive, safeStem } from '../hosts/activity.mjs';
|
|
43
46
|
import { NotFound, stemOf } from './catalog.mjs';
|
|
44
47
|
|
|
45
|
-
/**
|
|
46
|
-
* A session whose writer is gone, or that has not been touched in this long, is pruned.
|
|
47
|
-
* pid-liveness is the real signal; the staleness backstop covers a reused pid and a
|
|
48
|
-
* platform where the probe cannot tell. Generous on purpose: streaming bumps `updated_at`
|
|
49
|
-
* constantly, so only a genuinely abandoned (process-still-alive) session ages out.
|
|
50
|
-
*/
|
|
51
|
-
const ACTIVITY_STALE_SECONDS = 1800;
|
|
52
|
-
|
|
53
48
|
const nowSeconds = () => Date.now() / 1000;
|
|
54
49
|
|
|
55
50
|
/**
|
|
56
|
-
* `<target>/activity`. `state.target` is ALREADY the
|
|
57
|
-
* append `opencode/` again; that double-join is the
|
|
51
|
+
* `<target>/activity`. `state.target` is ALREADY the viewed install's config dir (OpenCode's, or
|
|
52
|
+
* a Claude-shaped host's), so this must not append `opencode/` again; that double-join is the
|
|
53
|
+
* classic seam bug.
|
|
58
54
|
*/
|
|
59
55
|
const activityDir = (state) => path.join(state.target, 'activity');
|
|
60
56
|
|
|
@@ -76,40 +72,6 @@ function activityEnabled(state) {
|
|
|
76
72
|
return !['off', '0', 'false', 'no'].includes(stripWhitespace(raw).toLowerCase());
|
|
77
73
|
}
|
|
78
74
|
|
|
79
|
-
/**
|
|
80
|
-
* Coerces a raw pid value to an integer, or `null` for anything unusable.
|
|
81
|
-
*
|
|
82
|
-
* The value came out of `parseJson`, so a JSON number may arrive wrapped in `JsonNumber`,
|
|
83
|
-
* which this module cannot import by name (only `parseJson`/`isTruthy`/etc are exported). It
|
|
84
|
-
* is recognised by the only thing the wrapper promises: a numeric `valueOf`. A plain
|
|
85
|
-
* object's `valueOf` returns itself (rejected by the `typeof n !== 'number'` check below)
|
|
86
|
-
* and an array is excluded outright. Also handles a decimal string, a boolean (`true` → 1),
|
|
87
|
-
* and a float (truncated) — whatever a hand-edited snapshot can produce.
|
|
88
|
-
*/
|
|
89
|
-
function toIntOr(raw) {
|
|
90
|
-
if (raw === true) return 1;
|
|
91
|
-
if (raw === false) return 0;
|
|
92
|
-
if (typeof raw === 'string') return parseIntStrict(stripWhitespace(raw));
|
|
93
|
-
const n = (raw !== null && typeof raw === 'object' && !Array.isArray(raw))
|
|
94
|
-
? raw.valueOf() : raw;
|
|
95
|
-
if (typeof n !== 'number' || !Number.isFinite(n)) return null;
|
|
96
|
-
return Math.trunc(n);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/** Best-effort liveness for the writer process. See this file's header. */
|
|
100
|
-
function pidAlive(raw) {
|
|
101
|
-
const pid = toIntOr(raw);
|
|
102
|
-
if (pid === null || pid <= 0) return false;
|
|
103
|
-
try {
|
|
104
|
-
process.kill(pid, 0);
|
|
105
|
-
return true;
|
|
106
|
-
} catch (e) {
|
|
107
|
-
// ESRCH → dead. Anything else (`EPERM`, and whatever a locked-down host answers) →
|
|
108
|
-
// alive, and the staleness backstop decides.
|
|
109
|
-
return !(e && e.code === 'ESRCH');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
75
|
/**
|
|
114
76
|
* One session snapshot normalised into the stable shape the UI consumes. v1 writers omit
|
|
115
77
|
* the enrichment keys, so those default to null/0 and the UI hides what is absent. The KEY
|
|
@@ -148,24 +110,12 @@ function readEntry(p) {
|
|
|
148
110
|
return (entry !== null && typeof entry === 'object' && !Array.isArray(entry)) ? entry : null;
|
|
149
111
|
}
|
|
150
112
|
|
|
151
|
-
/** The writer's pid is alive AND the snapshot is not stale. */
|
|
152
|
-
function isLive(entry, now) {
|
|
153
|
-
const updated = isTruthy(Object.hasOwn(entry, 'updated_at') ? entry.updated_at : null)
|
|
154
|
-
? entry.updated_at : 0;
|
|
155
|
-
return (now - Number(updated)) <= ACTIVITY_STALE_SECONDS && pidAlive(
|
|
156
|
-
Object.hasOwn(entry, 'pid') ? entry.pid : null);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
113
|
/**
|
|
160
|
-
*
|
|
161
|
-
* missing dir is `[]`, a garbage file is skipped
|
|
162
|
-
* failed the liveness test is unlinked), newest first.
|
|
114
|
+
* `[name, entry]` for every snapshot that parses in `d`, sorted by name. Never throws: a
|
|
115
|
+
* missing dir is `[]`, and a garbage file is skipped and left where it is.
|
|
163
116
|
*/
|
|
164
|
-
function
|
|
165
|
-
const d = activityDir(state);
|
|
117
|
+
function snapshots(d) {
|
|
166
118
|
if (!isDir(d)) return [];
|
|
167
|
-
const now = nowSeconds();
|
|
168
|
-
const out = [];
|
|
169
119
|
let names;
|
|
170
120
|
try {
|
|
171
121
|
names = readdirSync(d);
|
|
@@ -175,48 +125,66 @@ function activityEntries(state) {
|
|
|
175
125
|
// Case-INSENSITIVE for the `.json` suffix (matches Windows filesystem behaviour); the
|
|
176
126
|
// `.detail.json` check below is case-SENSITIVE on both platforms. Two different rules,
|
|
177
127
|
// deliberately.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
128
|
+
return names.filter((n) => normcase(n).endsWith('.json') && !n.endsWith('.detail.json')).sort()
|
|
129
|
+
.map((name) => [name, readEntry(path.join(d, name))]).filter(([, e]) => e !== null);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// STABLE sort matters when `updated_at` ties: a `b - a` comparator over ES2019's
|
|
133
|
+
// guaranteed-stable `Array.sort` preserves the original (directory-listing) order for equal keys.
|
|
134
|
+
const newestFirst = (list) => list.sort((a, b) => Number(b.updated_at) - Number(a.updated_at));
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* `{activity, ended}`: the live sessions, and the ones that are not — still in the directory
|
|
138
|
+
* or already archived — each listed once, the live copy and then the directory's winning.
|
|
139
|
+
*/
|
|
140
|
+
function activityEntries(state) {
|
|
141
|
+
const d = activityDir(state);
|
|
142
|
+
const now = nowSeconds();
|
|
143
|
+
const live = [];
|
|
144
|
+
const ended = [];
|
|
145
|
+
const seen = new Set();
|
|
146
|
+
const rest = [];
|
|
147
|
+
for (const [name, entry] of snapshots(d)) {
|
|
148
|
+
const e = normalizeEntry(entry, stemOf(name));
|
|
149
|
+
if (isLive(entry, now)) { live.push(e); seen.add(String(e.session_id)); } else rest.push(e);
|
|
191
150
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
151
|
+
for (const [name, entry] of snapshots(path.join(d, 'archive'))) {
|
|
152
|
+
rest.push(normalizeEntry(entry, stemOf(name)));
|
|
153
|
+
}
|
|
154
|
+
for (const e of rest) {
|
|
155
|
+
if (seen.has(String(e.session_id))) continue;
|
|
156
|
+
seen.add(String(e.session_id));
|
|
157
|
+
if (now - Number(e.updated_at) > ARCHIVE_MAX_AGE_SECONDS) continue;
|
|
158
|
+
ended.push({ ...e, ended: true });
|
|
159
|
+
}
|
|
160
|
+
return { activity: newestFirst(live), ended: newestFirst(ended).slice(0, ARCHIVE_KEEP) };
|
|
197
161
|
}
|
|
198
162
|
|
|
199
163
|
export function apiActivity(state) {
|
|
200
164
|
const enabled = activityEnabled(state);
|
|
201
|
-
return { enabled,
|
|
165
|
+
return { enabled, ...(enabled ? activityEntries(state) : { activity: [], ended: [] }) };
|
|
202
166
|
}
|
|
203
167
|
|
|
204
168
|
/**
|
|
205
|
-
* One session's snapshot plus its step timeline and its UNCAPPED files/todos.
|
|
206
|
-
*
|
|
207
|
-
*
|
|
169
|
+
* One session's snapshot plus its step timeline and its UNCAPPED files/todos. A session that is
|
|
170
|
+
* no longer live — still in the directory, or archived — is returned too, with `ended: true`.
|
|
171
|
+
* 404 only if neither holds it; a missing or garbage detail file degrades to an empty timeline
|
|
172
|
+
* rather than a 500.
|
|
208
173
|
*/
|
|
209
174
|
export function apiActivityDetail(state, sid) {
|
|
210
|
-
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
175
|
+
// Resolve by the writer's safe-name scheme (`safeStem`), which is also what keeps the read
|
|
176
|
+
// inside the directory: every separator, `..` and drive colon becomes `_`, so there is no
|
|
177
|
+
// join to steer.
|
|
178
|
+
const stem = safeStem(sid);
|
|
179
|
+
let d = activityDir(state);
|
|
180
|
+
let entry = isFile(path.join(d, `${stem}.json`)) ? readEntry(path.join(d, `${stem}.json`)) : null;
|
|
181
|
+
if (entry === null) {
|
|
182
|
+
d = path.join(d, 'archive');
|
|
183
|
+
entry = isFile(path.join(d, `${stem}.json`)) ? readEntry(path.join(d, `${stem}.json`)) : null;
|
|
184
|
+
}
|
|
185
|
+
if (entry === null) throw new NotFound(sid);
|
|
219
186
|
const session = normalizeEntry(entry, stem);
|
|
187
|
+
if (!isLive(entry, nowSeconds())) session.ended = true;
|
|
220
188
|
let timeline = [];
|
|
221
189
|
let full = {};
|
|
222
190
|
const det = readEntry(path.join(d, `${stem}.detail.json`));
|
package/js/web/api.mjs
CHANGED
|
@@ -232,6 +232,9 @@ export function apiFleet(state) {
|
|
|
232
232
|
diffable: drift !== null,
|
|
233
233
|
drift,
|
|
234
234
|
built_epoch: built,
|
|
235
|
+
// The install the console is viewing (the topbar picker), as `/api/installs` marks it: the
|
|
236
|
+
// Overview's root-file card follows it rather than the fleet's worst.
|
|
237
|
+
selected: samePath(dir, state.target),
|
|
235
238
|
// What this install injects every session, by part (characters); null when its carrier
|
|
236
239
|
// is missing, so the console says "not measured" rather than drawing an empty bar.
|
|
237
240
|
cost: alwaysOnCost({ host, root, dir, footprint: footprintOfDir(root) }),
|
package/js/web/server.mjs
CHANGED
|
@@ -37,6 +37,7 @@ import { existsSync } from 'node:fs';
|
|
|
37
37
|
import { createServer } from 'node:http';
|
|
38
38
|
import { join, resolve as pathResolve } from 'node:path';
|
|
39
39
|
import { fileURLToPath } from 'node:url';
|
|
40
|
+
import { sweepActivity } from '../hosts/activity.mjs';
|
|
40
41
|
|
|
41
42
|
const ROOT = pathResolve(import.meta.dirname, '..', '..');
|
|
42
43
|
|
|
@@ -153,6 +154,11 @@ export async function serve({ theme = null, port = 4747, openBrowser = true,
|
|
|
153
154
|
// Read by `/api/update`, whose background `git fetch` must not race a running update's pull.
|
|
154
155
|
state.jobBusy = () => jm.busy;
|
|
155
156
|
const srv = createServer(makeHandler(state, jm, token, dist, holder));
|
|
157
|
+
// A GET only reads, and the OpenCode plugin never sweeps: ended sessions are archived here,
|
|
158
|
+
// once at start and every 10 minutes. Best-effort — a sweep failure never stops the console.
|
|
159
|
+
const sweep = () => { try { sweepActivity(join(state.target, 'activity')); } catch { /* best-effort */ } };
|
|
160
|
+
sweep();
|
|
161
|
+
setInterval(sweep, 600_000).unref();
|
|
156
162
|
// A client trickling headers or a body (slowloris) would hold a socket forever otherwise; every
|
|
157
163
|
// real request here is a few KB from the same machine.
|
|
158
164
|
srv.requestTimeout = 30_000;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "Every field here is argued and gated in tests/unit/package_manifest.test.mjs. `files`, `bin` and `engines` each have a test that fails when reality drifts from this file; `version` mirrors harness.config.json and is gated too. Read that docblock before editing this one.",
|
|
3
3
|
"name": "geneseed",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.23.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",
|
package/src/modes/foreman.md
CHANGED
|
@@ -24,4 +24,5 @@ crews for what's substantial, and keeps answering the user without blocking.
|
|
|
24
24
|
commits and merges only once the user accepts ({{DOCTRINE:consent-before-push}}). Commit, push and
|
|
25
25
|
merge stay the parent's alone.
|
|
26
26
|
- **Report.** Surface pipeline completions, failures, and merges to the user as
|
|
27
|
-
they happen
|
|
27
|
+
they happen; a crew that returns no proof, or goes silent, is handled as the
|
|
28
|
+
pipeline {{SKILL}}'s step 2 says.
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
1. Confirm independence: the subtasks must not depend on each other's output or write the same files ({{DOCTRINE:one-writer-per-file}}). Write down each unit's **write set** — the files or globs it may change — and intersect them; an overlap runs in sequence or goes to one owner, and shared append files (registries, index tables, lockfiles, generated bundles) stay with you. If they're sequential or share state, use [plan](plan.md) instead.
|
|
13
13
|
2. Split the work into self-contained units, each with one clear goal and a defined output contract — what it must return. Several small edits of one kind (the same fix, constant or field across files) form ONE unit with the union write set and get one review.
|
|
14
14
|
3. Dispatch each unit to its own subagent in one batch, each under a handoff envelope: the unit's goal, the inputs it needs, its **write set** (edit nothing outside it; return rows for a shared file instead of writing it), the observable check that proves it done, its output contract — naming every file it changed — and the inherited constraints (no commit/push — {{DOCTRINE:consent-before-push}} stays with you; no sub-agents of its own — review comes from you; gaps reported, never invented). Hand each unit only the access its goal needs ({{LAW:least-privilege}}). Prefer the read-only [explorer {{AGENT}}](../{{DIR_AGENTS}}/explorer.md) for investigation so the heavy reading stays out of the main context ({{DOCTRINE:context-economy}}). Where no subagent capability exists, run the units sequentially as personas instead, converging the same way.
|
|
15
|
-
4. Keep the main context lean: collect each subagent's distilled result, not its working transcript.
|
|
15
|
+
4. Keep the main context lean: collect each subagent's distilled result, not its working transcript. Watch every unit you dispatched in the background as the [pipeline {{SKILL}}](pipeline.md)'s step 2 watches a crew: a result without its check, or one that says it is still waiting, is a failure to act on at once — resume the unit or redo it — never a notification to wait for.
|
|
16
16
|
5. Converge: compare each unit's changed files against its write set and against its siblings' — an edit outside the set, a file two units touched, or a file in a batch's set that never changed is a conflict you resolve before anything else — apply the shared-file rows yourself, then verify the combined outcome. A conflict or ambiguity between the plan, the findings and the code is yours to decide: decide it, record `Ruling: <choice> — <why> — <cost if wrong>` in the worklog, and continue. Stop only for what {{LAW:echo-the-intent}}, {{LAW:deletion-is-deliberate}} or {{DOCTRINE:consent-before-push}} names; every ruling goes in the final report ({{DOCTRINE:declare-the-judgment-calls}}).
|
|
17
17
|
6. **A plan with blocking edges.** To build a [plan](plan.md) file's slices — each with its `Blocked by:` line — in one run, dispatch every unblocked slice on its own branch off one integration branch, merge each into it as it returns (each merge is a commit — {{DOCTRINE:consent-before-push}} stays with you), and recompute the unblocked set from the plan after every merge — newly freed slices go out at once. When the plan names a `Spec:`, every slice reads it once; the spec outranks the plan where they conflict. Each slice branches off the integration tip at its own dispatch (its BASE) and merges the current tip back into its branch before returning, so a conflict with a sibling resolves on the slice's branch; before re-running the proof, confirm the branch descends from BASE and the diff is non-empty — an empty diff is a failure, not a clean result. Never diff against `HEAD~1`. When the plan is exhausted, review the integration branch whole with [geneseed-code-review](geneseed-code-review.md) before reporting.
|
|
18
18
|
|
package/src/skills/pipeline.md
CHANGED
|
@@ -26,8 +26,8 @@ The minimum roster per task type. The crew lead chooses the crew from the whole
|
|
|
26
26
|
## Procedure
|
|
27
27
|
|
|
28
28
|
1. Take the triage as given. Under foreman mode the task reached you because it met the mode's count; invoked directly, the user's request is the trigger. Do not weigh it again and fall back to doing the work yourself.
|
|
29
|
-
2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}}, and the rule that it never commits, pushes or merges. Tell the user the pipeline is running, then go back to the user. Do not wait on the crew lead.
|
|
30
|
-
3. **The crew lead composes the crew** from the floor above and adds any {{AGENT}} the task needs. It dispatches each crew member as its own subagent, each handed what the previous one produced. Where the crew lead holds no dispatch tool (see *Hosts* below), it plays each role in turn itself, with the same hand-offs and the same envelope. Steps 4 to 7 are the crew lead's, except where they name the parent.
|
|
29
|
+
2. **Dispatch the crew lead** in the background, using the host's general-purpose {{AGENT}}. Before dispatch, record BASE and set the crew's **write set**; check it against every other pipeline in flight ({{DOCTRINE:one-writer-per-file}}) — two crews whose sets overlap do not run at once. The brief carries: the task as the user stated it, the task type, BASE, the write set, the proof commands, a pointer to this {{SKILL}}, and the rule that it never commits, pushes or merges. Tell the user the pipeline is running, then go back to the user. Do not wait on the crew lead. **Then watch what you dispatched.** An envelope without proof, or one that says the crew is still waiting, is a failure: act on it at once — resume the crew lead (`SendMessage` on Claude Code) or take over its worktree — never wait for a notification it promised. A crew member's report that reaches you directly means its crew lead has already ended; act on it the same way. Before you end a turn with a crew still out, set a check where the host offers one (`CronCreate` on Claude Code, top level only); elsewhere, check at the start of every turn. A crew is stalled when its transcript and output have not grown for 15 minutes **and** it has no live child process: ping it once; if the next check shows no change, stop it, then take over from its worktree. A crew whose output still grows, or that runs a child process, is never taken over — a long suite or canary is not a stall.
|
|
30
|
+
3. **The crew lead composes the crew** from the floor above and adds any {{AGENT}} the task needs. It dispatches each crew member as its own subagent, each handed what the previous one produced. **The crew lead never ends with a member unresolved.** Its last message is its result: once it ends, nothing wakes it, and a member that outlives it reports past it, to the parent. It may run members in parallel, but holds every member's result before it ends — returned, or failed and then redone or named as failed in the envelope. A member that returns nothing has failed. Where the crew lead holds no dispatch tool (see *Hosts* below), it plays each role in turn itself, with the same hand-offs and the same envelope. Steps 4 to 7 are the crew lead's, except where they name the parent.
|
|
31
31
|
4. Isolate the crew's work in its own git worktree/branch. Where worktrees are unavailable, fall back to a single tree, one pipeline at a time, and say so. The crew writes only inside its write set; shared append files (registries, index tables, lockfiles, generated bundles) are the parent's to apply, never a crew's.
|
|
32
32
|
5. **The dev↔tester loop:** the developer implements, the tester validates — runs the tests and lint, produces raw logs. On failure, the findings go back to the developer — two repair rounds at most, then one fresh developer (a higher model tier where the host offers one) carrying the tester's findings ({{DOCTRINE:bound-the-loop}}); if that fails too, stop, do not merge, and report the failure with the branch left in place for inspection. A conflict or ambiguity between the plan, the findings and the code is yours to decide: decide it, record `Ruling: <choice> — <why> — <cost if wrong>` in the worklog, and continue. Stop only for what {{LAW:echo-the-intent}}, {{LAW:deletion-is-deliberate}} or {{DOCTRINE:consent-before-push}} names; every ruling goes in the final report ({{DOCTRINE:declare-the-judgment-calls}}). When the plan names a `Spec:`, the analyst reads it once; the spec outranks the plan.
|
|
33
33
|
6. **Pick the shape by host** (table below). Where the host offers a workflow tool the {{SKILL}} may use without a fresh opt-in, a saved script may stand in for the crew lead: analyst → developer → (tester ⇄ developer)×≤2 → fresh developer → proof ([workflow {{SKILL}}](workflow.md)). Everywhere else the crew lead runs the same stages, with the same hand-offs and the same delivery contract.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{a as i}from"./motion-CXaUMNkg.js";import{A as a,C as o,E as s,F as c,J as l,M as u,N as d,O as f,T as p,U as m,at as h,ft as g,j as _,k as v,q as y,u as b,ut as x,w as S}from"./index-D2VlAlpK.js";import{t as C}from"./EmptyState-1sPNleqv.js";import{t as w}from"./usePoll-bDFN-Hr6.js";var T=e(t(),1),E=n(),D=e=>e.catch(()=>null);function O({s:e}){let t=(0,T.useId)(),n=e.todos,r=v(e);return(0,E.jsxs)(`a`,{className:`card pad-md act-card`,href:`#/activity/${encodeURIComponent(e.session_id)}`,"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,E.jsx)(o,{s:e,id:t,heading:e.title||s(e.cwd)||e.session_id,children:(0,E.jsx)(h,{name:`chevron`,className:`glyph act-chev`})}),n&&n.total>0&&(0,E.jsx)(`div`,{className:`act-foot`,children:(0,E.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,E.jsx)(p,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,E.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,x(e.updated_at),` ago`]})]})}var k=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function ee(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:k.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``}}function te(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function A({enabled:e,onToggle:t}){return(0,E.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,E.jsx)(h,{name:`activity`,className:`glyph act-fixed`}),(0,E.jsxs)(`div`,{className:`act-grow`,children:[(0,E.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,E.jsx)(`p`,{className:`dim act-sm act-track-p`,children:`Runs and gate asks below come from the job log and the gate ledger. Turn tracking on to see what each session is doing now.`})]}),(0,E.jsxs)(`div`,{className:`row gap-10 act-fixed act-sm`,children:[(0,E.jsx)(`span`,{id:`act-track-l`,children:`Track live sessions`}),(0,E.jsx)(`div`,{className:`sw-toggle${e?` on`:``}`,role:`switch`,"aria-checked":e,"aria-labelledby":`act-track-l`,tabIndex:0,onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.key===` `&&e.preventDefault(),t())}})]})]})}function j({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=_(e?.jobs,{days:14,cap:n}),i=d(r.map(e=>e.nodata?`-`:e.n).join(`,`),`scaleY`),a=Math.max(1,...r.map(e=>e.n)),o=r.reduce((e,t)=>e+t.n,0),s=r.find(e=>!e.nodata),c=r.some(e=>e.nodata),l=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${u(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${u(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,E.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the job log…`}):e?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":l,ref:i,children:r.map(e=>e.nodata?(0,E.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,E.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${u(e.key)}: ${e.n}`},e.key):(0,E.jsx)(`i`,{className:`zero`},e.key))}),(0,E.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,E.jsx)(`span`,{children:u(r[0].key)}),(0,E.jsx)(`span`,{children:u(r[7].key)}),(0,E.jsx)(`span`,{children:`today`})]}),c&&(0,E.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,E.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function M({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,E.jsxs)(`div`,{className:`act-stat-head`,children:[(0,E.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,E.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,E.jsx)(`p`,{className:`dim act-sm`,children:`Reading the gate ledger…`}):e.length?(0,E.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,E.jsxs)(`li`,{children:[(0,E.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,E.jsx)(S,{vals:e.per_day,i:t,sweep:!0}),(0,E.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,E.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var N={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function ne({job:e,longest:t}){let n=c(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=N[e.status]||[``,e.status||`…`],o=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,s=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,E.jsxs)(`li`,{className:`act-row`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:s}),(0,E.jsx)(h,{name:`play`,className:`glyph act-glyph`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,E.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,E.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":o,children:(0,E.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,E.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function re({gate:e}){return(0,E.jsxs)(`li`,{className:`act-row gate`,children:[(0,E.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,E.jsx)(h,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,E.jsxs)(`span`,{className:`act-what`,children:[(0,E.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,E.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,E.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,E.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var P=5,F=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function I(){let[e,t]=(0,T.useState)(null),[n,o]=(0,T.useState)(``),[c,u]=(0,T.useState)(ee),[p,h]=(0,T.useState)(!1),_=e=>{let t={...c,...e};u(t),te(t)};w(e=>r.activity().then(n=>{e()&&(t(n),o(``))},t=>{e()&&o(t.message)}),2e3,[]);let v=g(()=>D(r.jobs()),[]),x=g(()=>D(r.gates()),[]),S=g(()=>D(r.catalog(`laws`)),[]),N=!e||e.enabled!==!1,I=[...e?.activity||[]].sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),L=i(),R=N&&e?I.filter(a).length:null,z=new Set(I.map(e=>e.session_id)),B=(e?.ended||[]).filter(e=>!z.has(e.session_id)),V=F([...I,...B].map(e=>e.host),c.host),H=F([...I,...B].map(e=>s(e.cwd)),c.project),U=c.host&&c.project?`host or project`:c.host?`host`:c.project?`project`:``,W=e=>(!c.host||e.host===c.host)&&(!c.project||s(e.cwd)===c.project),G=I.filter(e=>W(e)&&(c.f!==`needs`||a(e))),K=c.f===`all`||c.f===`needs`,q=c.f===`all`&&N?B.filter(W):[],J=p?q:q.slice(0,P),Y=!U&&(c.f===`all`||c.f===`runs`),ie=!U&&(c.f===`all`||c.f===`gates`),X=v.data?.jobs||[],Z=b(x.data,S.data),Q=f(X,Z,x.data?.days).map(e=>({...e,runs:Y?e.runs:[],gate:ie?e.gate:null})).filter(e=>e.runs.length||e.gate),ae=Math.max(0,...X.map(e=>e.duration||0)),oe=d(Q.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),se=async()=>{let e=!N;try{let n=await r.activityToggle(e);if(n.ok===!1){o(n.error||`Could not change tracking`);return}t(e=>({...e||{},enabled:n.enabled,activity:n.enabled&&e?.activity||[],ended:n.enabled&&e?.ended||[]})),o(``)}catch(e){o(e.message)}},$=(e,t,n)=>(0,E.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,E.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,E.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:c[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>_({[e]:t.target.value}),children:[(0,E.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,E.jsx)(`option`,{value:e,children:e},e))]})]});return(0,E.jsxs)(`div`,{className:`narrow`,children:[(0,E.jsx)(m,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),n&&(0,E.jsx)(`div`,{className:`act-gap`,children:(0,E.jsx)(y,{error:n})}),e&&(0,E.jsx)(A,{enabled:N,onToggle:se}),(0,E.jsxs)(`div`,{className:`act-today`,children:[(0,E.jsx)(j,{jobs:v.data,loading:v.loading}),(0,E.jsx)(M,{rows:Z,gates:x.data,loading:x.loading}),(0,E.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,E.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),(0,E.jsxs)(`span`,{className:`act-big act-wait`,children:[R??`—`,` `,(0,E.jsx)(`span`,{className:`dim act-sm`,children:`sessions`})]}),(0,E.jsx)(`p`,{className:`dim act-sm`,children:N?`A session that waits on an approval or on your answer counts here.`:`Turn tracking on to count the sessions that wait on you.`})]})]}),(0,E.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,E.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:k.map(([e,t])=>(0,E.jsxs)(`button`,{type:`button`,className:c.f===e?`chip-f on`:`chip-f`,"aria-pressed":c.f===e,onClick:()=>_({f:e}),children:[t,e===`needs`&&R>0?(0,E.jsxs)(`span`,{className:`mono`,children:[` `,R]}):null]},e))}),$(`host`,`Host`,V),$(`project`,`Project`,H)]}),U&&c.f!==`needs`&&(0,E.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,U,`; showing sessions only.`]}),K&&(e?!N&&c.f!==`needs`?null:G.length===0?c.f===`needs`?(0,E.jsx)(C,{title:`Nothing waits on you`}):(0,E.jsxs)(C,{title:`No active sessions`,children:[`Run `,(0,E.jsx)(`code`,{children:`opencode`}),` and the sessions it spins up appear here.`]}):(0,E.jsx)(`div`,{className:`stack gap-12 act-live`,ref:L,children:G.map(e=>(0,E.jsx)(`div`,{"data-flip":e.session_id,children:(0,E.jsx)(O,{s:e})},e.session_id))}):(0,E.jsx)(l,{label:`Reading live sessions…`})),q.length>0&&(0,E.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,E.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),J.map(e=>(0,E.jsx)(`div`,{children:(0,E.jsx)(O,{s:e})},e.session_id)),q.length>P&&(0,E.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":p,onClick:()=>h(e=>!e),children:p?`Show fewer`:`Show all ${q.length}`})]}),c.f!==`needs`&&(0,E.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:oe,children:Q.map(e=>(0,E.jsxs)(`section`,{className:`card act-day`,children:[(0,E.jsxs)(`h3`,{className:`act-day-h`,children:[(0,E.jsx)(`span`,{children:e.title}),(0,E.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,E.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,E.jsx)(ne,{job:e,longest:ae},e.id)),e.gate&&(0,E.jsx)(re,{gate:e.gate})]})]},e.key))})]})}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{C as i,D as a,E as o,J as s,U as c,at as l,q as u,ut as d}from"./index-D2VlAlpK.js";import{t as f}from"./EmptyState-1sPNleqv.js";import{t as p}from"./usePoll-bDFN-Hr6.js";var m=e(t(),1),h=n();function g(e){return e.kind===`tool`?e.status===`error`?`bad`:e.status===`completed`?`ok`:`acc`:{retry:`warn`,error:`bad`,subtask:`acc`,text:`acc`}[e.kind]||``}function _({rec:e}){let t=e.who===`you`,n=[];t||(e.kind===`tool`&&e.ms!=null&&n.push(`${(e.ms/1e3).toFixed(1)}s`),e.kind===`step`&&(e.tokens&&n.push(`${a(e.tokens)} tok`),e.cost&&n.push(`$${e.cost.toFixed(2)}`)),e.kind===`subtask`&&e.agent&&n.unshift(e.agent));let r=!t&&(e.kind===`text`||e.kind===`thinking`||e.kind===`step`),i=t?e.text:e.label||e.snippet||e.kind;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,h.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,h.jsx)(`span`,{className:`feed-dot act-inline-dot ${g(e)||`acc`}`}),e.kind===`thinking`&&(0,h.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,h.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,h.jsx)(`b`,{children:i}),e.error&&(0,h.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,h.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,h.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${d(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function v({turns:e}){return!e||e.length===0?(0,h.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,h.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,h.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,h.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,h.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}function y({sid:e}){let[t,n]=(0,m.useState)(null),[a,g]=(0,m.useState)(``),[y,b]=(0,m.useState)(!1),[x,S]=(0,m.useState)(!1),C=(0,m.useId)();p(t=>y?void 0:r.activityDetail(e).then(e=>{t()&&(n(e),g(``),b(!1))},e=>{t()&&(e.status===404?b(!0):g(e.message))}),2e3,[e,y]);let w=(0,h.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,h.jsx)(l,{name:`arrow`}),` Activity`]});if(y)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(f,{title:`Session ended`,action:(0,h.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!t)return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,a?(0,h.jsx)(u,{error:a}):(0,h.jsx)(s,{label:`Loading session…`})]});let T=t.session,E=T.files,D=T.todos,O=!!(E&&E.items&&E.items.length>0),k=!!(D&&D.items&&D.items.length>0),A=t.conversation||[],j=t.timeline||[],M=[...A.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...j.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,h.jsxs)(`div`,{className:`narrow`,children:[w,(0,h.jsx)(c,{title:T.title||o(T.cwd)||T.session_id,sub:T.cwd?(0,h.jsx)(`span`,{className:`mono act-cwd`,title:T.cwd,children:T.cwd}):null}),a&&(0,h.jsx)(`div`,{className:`act-gap`,children:(0,h.jsx)(u,{error:a})}),(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(i,{s:T}),(0,h.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,d(T.updated_at),` ago`]})]}),(O||k)&&(0,h.jsxs)(`div`,{className:`grid gap-12 act-panels${O&&k?` two`:``}`,children:[O&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Files touched `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,E.count,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:E.items.map(e=>(0,h.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,h.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,h.jsxs)(`span`,{className:`act-fixed`,children:[(0,h.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,h.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),k&&(0,h.jsxs)(`div`,{className:`card pad-md`,children:[(0,h.jsx)(`div`,{className:`card-head`,children:(0,h.jsxs)(`h2`,{children:[`Plan`,` `,(0,h.jsxs)(`span`,{className:`dim`,children:[`(`,D.done,`/`,D.total,`)`]})]})}),(0,h.jsx)(`div`,{className:`stack act-list`,children:D.items.map((e,t)=>(0,h.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,h.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,h.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,h.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,h.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,h.jsx)(`h2`,{children:`Timeline`}),j.length>0&&(0,h.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":x,"aria-controls":C,onClick:()=>S(e=>!e),children:x?`Show conversation`:`Show full stream (${M.length})`})]}),(0,h.jsx)(`div`,{id:C,children:x?(0,h.jsx)(`div`,{className:`stack gap-12`,children:M.map((e,t)=>(0,h.jsx)(_,{rec:e},t))}):(0,h.jsx)(v,{turns:A})})]})]})}export{y as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-CC1wDg4u.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/index-D2VlAlpK.js","assets/api-BfpZmUMI.js","assets/index-BX3zc2Yi.css","assets/OperatorHudView-BcPPpykd.js","assets/JournalView-e6BBAz6i.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,t as r}from"./react-DlYQp10C.js";import{t as i}from"./api-BfpZmUMI.js";import{i as a,t as o}from"./motion-CXaUMNkg.js";import{n as s,r as c}from"./sections-ChwaobfW.js";import{H as l,I as u,J as d,K as f,X as p,at as m,ct as h,ft as g,l as _,lt as v,q as y,st as b,t as x,ut as S,yt as C,z as w}from"./index-D2VlAlpK.js";var T=t(n(),1),E={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.`},D=(e,t)=>e.deployed?t===void 0||t===`good`?E[e.theme]||`Loaded & ready`:`Deployed`:`Not deployed`,O=r(),k={good:`ok`,warn:`warn`,bad:`bad`};function A({verdict:e}){return e?(0,O.jsxs)(`span`,{className:`badge ${k[e.tone]}`,role:`status`,style:{alignSelf:`flex-start`},children:[(0,O.jsx)(`span`,{className:`dot`}),e.head]}):null}function j({overview:e,dataRev:t}){let{data:n}=g(()=>Promise.resolve().then(()=>i.catalog(`laws`)),[t],`catalog:laws`),r=b(e.diff),a=e.counts||{},s=[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:n?.nouns?.laws||`Dictates`,hash:`#/laws`}];return(0,O.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[s.map(e=>{let t=a[e.key];return(0,O.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,O.jsx)(o,{value:t})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,O.jsx)(`div`,{className:`kseg-spacer`}),(0,O.jsxs)(`button`,{className:`kseg`+(r>0?` hot`:``),onClick:()=>C(`#/diff`),title:`Open changes`,children:[(0,O.jsx)(`span`,{className:`kseg-n`+(r===0?` zero`:``),children:(0,O.jsx)(o,{value:r})}),(0,O.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),r>0&&(0,O.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function M({overview:e}){return(0,O.jsx)(`div`,{className:`genome`,children:c.map((t,n)=>{let r=s[t],i=e.counts?.[t];return(0,O.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>C(`#/section/`+t),children:[(0,O.jsxs)(`div`,{className:`gtop`,children:[(0,O.jsx)(`span`,{className:`gname`,children:r.label}),(0,O.jsx)(m,{name:r.icon,className:`gicon`})]}),(0,O.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,O.jsx)(o,{value:i})}),(0,O.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function N({jobs:e}){if(!e||e.length===0)return(0,O.jsx)(`div`,{className:`feed`,children:(0,O.jsxs)(`div`,{className:`empty`,children:[(0,O.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=u(e,8);return(0,O.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,O.jsxs)(`div`,{className:`feed-row`,children:[(0,O.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,O.jsx)(`span`,{className:`feed-txt`,children:(0,O.jsx)(`b`,{children:e.action})}),(0,O.jsxs)(`span`,{className:`feed-when`,children:[S(e.started),` ago`]})]},e.id))})}function P({value:e}){let t=a(e,1100)??0,n=Math.round(t*100);return(0,O.jsxs)(`div`,{className:`ring-box`,children:[(0,O.jsx)(w,{value:n,max:100,label:`germination`,size:232,stroke:10,sweepMs:0}),(0,O.jsxs)(`div`,{className:`ring-center`,children:[(0,O.jsxs)(`div`,{className:`pct`,children:[n,(0,O.jsx)(`span`,{className:`pct-unit`,children:`%`})]}),(0,O.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function F({overview:e,sigil:t,setup:n,jobs:r,lens:i,dataRev:a}){let o=D(e,i?.tone),s=v(e,n,i?.tone);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,O.jsxs)(`div`,{className:`hero`,children:[(0,O.jsx)(P,{value:s}),(0,O.jsxs)(`div`,{className:`hero-facts`,children:[(0,O.jsx)(`div`,{className:`ttl`,children:o}),(0,O.jsx)(A,{verdict:i?.verdict}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,O.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,O.jsxs)(`div`,{className:`hero-chips`,children:[(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`voice`}),(0,O.jsx)(`span`,{className:`cv t-cap`,children:e.theme})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`mode`}),(0,O.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,O.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`built`}),(0,O.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,O.jsxs)(`span`,{className:`chip`,children:[(0,O.jsx)(`span`,{className:`ck`,children:`fp`}),(0,O.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]})]})]})}),(0,O.jsx)(j,{overview:e,dataRev:a}),(0,O.jsxs)(`div`,{className:`grid split-status`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Capability genome`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[c.length,` sections`]})})]}),(0,O.jsx)(M,{overview:e})]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Recent activity`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`badge acc`,children:[(0,O.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,O.jsx)(N,{jobs:r})]})]})]})}function I({k:e,overview:t,max:n}){let r=s[e],i=t.counts?.[e]??0;return(0,O.jsxs)(`div`,{className:`strand`,children:[(0,O.jsxs)(`span`,{className:`strand-name`,children:[(0,O.jsx)(`span`,{className:`strand-dot`}),(0,O.jsx)(`a`,{href:`#/section/`+e,className:`strand-link stretch-link`,children:r.label})]}),(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,O.jsx)(`span`,{className:`strand-val`,children:i})]})}function L(e){return e?e.includes(`up to date`)?{label:`in sync`,tone:`ok`}:e.includes(`no Geneseed install`)?{label:`not installed`,tone:``}:{label:`behind source`,tone:`warn`}:null}function R({overview:e,sigil:t,setup:n,jobs:r,lens:i}){let a=h(e.counts),o=n?.version_verdict||``,s=L(o),l=b(e.diff),u=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`mb-16`,children:(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,O.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,O.jsxs)(`div`,{className:`lineage-track`,children:[(0,O.jsx)(`div`,{className:`spine`}),u.map(([e,t,n,r],i)=>(0,O.jsxs)(`div`,{className:`lineage-step`,children:[(0,O.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,O.jsx)(`div`,{className:`lt`,children:e}),(0,O.jsx)(`div`,{className:`ld`,children:t}),(0,O.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,O.jsx)(`hr`,{className:`hr`}),t&&(0,O.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,O.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,O.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,O.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,O.jsx)(A,{verdict:i?.verdict}),s&&(0,O.jsxs)(`span`,{className:`badge ${s.tone}`,title:o,children:[(0,O.jsx)(`span`,{className:`dot`}),s.label]}),(0,O.jsxs)(`span`,{className:`badge`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` local edits`]})]})]})}),(0,O.jsxs)(`div`,{className:`grid split-even`,children:[(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsxs)(`div`,{className:`card-head`,children:[(0,O.jsx)(`h3`,{children:`Genome strand`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),c.map(t=>(0,O.jsx)(I,{k:t,overview:e,max:a},t))]}),(0,O.jsxs)(`div`,{className:`card pad-lg`,children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Recent activity`})}),(0,O.jsx)(N,{jobs:r})]})]})]})}function z({overview:e,setup:t,jobs:n,lens:r}){let i=c.reduce((t,n)=>t+(e.counts?.[n]??0),0),a=h(e.counts),o=e.doctor?.ok,l=e.doctor?.problems?.length??0,u=b(e.diff);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,O.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,O.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`status`}),(0,O.jsxs)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:[(0,O.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,O.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]}),(0,O.jsx)(A,{verdict:r?.verdict})]})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`voice`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`mode`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,O.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,O.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:o?(0,O.jsxs)(`span`,{className:`badge ok`,children:[(0,O.jsx)(`span`,{className:`dot`}),`clean`]}):(0,O.jsxs)(`span`,{className:`badge warn`,children:[(0,O.jsx)(`span`,{className:`dot`}),l,` issue`,l===1?``:`s`]})})]}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`tick`,children:`edits`}),(0,O.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:u})]})]})})}),(0,O.jsxs)(`div`,{className:`grid split-operator`,children:[(0,O.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,O.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,O.jsx)(`h3`,{children:`Sections`}),(0,O.jsx)(`div`,{className:`right`,children:(0,O.jsxs)(`span`,{className:`tick`,children:[i,` entries total`]})})]}),(0,O.jsxs)(`table`,{className:`tbl`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`Section`}),(0,O.jsx)(`th`,{children:`Detail`}),(0,O.jsx)(`th`,{style:{width:130},children:`Share`}),(0,O.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,O.jsx)(`tbody`,{children:c.map(t=>{let n=s[t],r=e.counts?.[t]??0;return(0,O.jsxs)(`tr`,{className:`clickable`,children:[(0,O.jsx)(`td`,{className:`name`,children:(0,O.jsx)(`a`,{href:`#/section/`+t,className:`stretch-link`,children:n.label})}),(0,O.jsx)(`td`,{className:`muted`,children:n.desc}),(0,O.jsx)(`td`,{children:(0,O.jsx)(`div`,{className:`hbar`,children:(0,O.jsx)(`i`,{style:{width:`${r/a*100}%`}})})}),(0,O.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,O.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,O.jsx)(`div`,{className:`card-head`,children:(0,O.jsx)(`h3`,{children:`Run log`})}),(0,O.jsx)(N,{jobs:n})]})]})]})}var B=Symbol(`failed`),V=e=>Promise.resolve().then(e).catch(()=>B);function H({dataRev:e,needDoctor:t}){let n=g(()=>V(()=>i.fleet()),[e]),r=g(()=>t?V(()=>i.doctor()):Promise.resolve(null),[t,e]),a=n.data,o=a==null?`loading`:a===B?`failed`:`ok`,s=o===`ok`?a:null,c=s?_(s):null,l=r.data,u=t?l==null?`loading`:l===B?`failed`:`ok`:`idle`;return{fleet:s,fleetState:o,verdict:c,tone:o===`failed`?`failed`:c?.tone,doctor:{state:u,data:u===`ok`?r.data:null}}}var U=e({default:()=>q}),W=(0,T.lazy)(()=>x(()=>import(`./GreenhouseView-CC1wDg4u.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),G=(0,T.lazy)(()=>x(()=>import(`./OperatorHudView-BcPPpykd.js`),__vite__mapDeps([8,1,2,4,5,6,3,7]))),K=(0,T.lazy)(()=>x(()=>import(`./JournalView-e6BBAz6i.js`),__vite__mapDeps([9,1,2,6,3,4,5,7])));function q({overview:e,overviewError:t,onRetry:n,themes:r,setup:a,runs:o,onAction:s,layout:c=`cultivar`,dataRev:u}){let m=c,[h,_]=(0,T.useState)(`status`),v=e&&r.find(t=>t.name===e.theme)?.sigil||``,b=H({dataRev:u,needDoctor:m===`greenhouse`||m===`operator`}),{data:x}=g(()=>m===`journal`?i.recent().catch(()=>null):Promise.resolve(null),[m,u]);if(!e)return t?(0,O.jsx)(y,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,O.jsx)(d,{});let S=e.daemon_stale?(0,O.jsx)(f,{}):null;return e.deployed?h===`status`&&m===`journal`?(0,O.jsxs)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:[S,(0,O.jsx)(K,{overview:e,recent:x,lens:b,onDirection:_,dataRev:u})]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(`div`,{className:`head-row`,children:(0,O.jsx)(p,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`,`Operator data`]].map(([e,t,n])=>(0,O.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>_(e),"aria-pressed":h===e,"aria-label":n,children:t},e))})}),(0,O.jsxs)(`div`,{className:`view-in`,children:[h===`status`&&m===`cultivar`&&(0,O.jsx)(F,{overview:e,sigil:v,setup:a,jobs:o,lens:b,dataRev:u}),h===`status`&&m===`greenhouse`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(W,{overview:e,sigil:v,jobs:o,lens:b,onAction:s})}),h===`status`&&m===`operator`&&(0,O.jsx)(T.Suspense,{fallback:(0,O.jsx)(d,{}),children:(0,O.jsx)(G,{overview:e,jobs:o,lens:b})}),h===`lineage`&&(0,O.jsx)(R,{overview:e,sigil:v,setup:a,jobs:o,lens:b}),h===`operator`&&(0,O.jsx)(z,{overview:e,setup:a,jobs:o,lens:b})]},h)]}):(0,O.jsxs)(O.Fragment,{children:[S,(0,O.jsx)(l,{onAction:s})]})}export{q as default,A as n,D as r,U as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";e();var n=t();function r({caption:e,captionHidden:t,columns:r,rows:i,rowKey:a,rowAction:o}){let s=e=>e.align?{textAlign:e.align}:void 0;return(0,n.jsx)(`div`,{className:`tbl-scroll`,children:(0,n.jsxs)(`table`,{className:`tbl`,children:[(0,n.jsx)(`caption`,{className:t?`sr-only`:`tbl-caption`,children:e}),(0,n.jsx)(`thead`,{children:(0,n.jsxs)(`tr`,{children:[r.map(e=>(0,n.jsx)(`th`,{scope:`col`,style:s(e),children:e.label},e.key)),o?(0,n.jsx)(`th`,{scope:`col`,children:(0,n.jsx)(`span`,{className:`sr-only`,children:`Actions`})}):null]})}),(0,n.jsx)(`tbody`,{children:i.map(e=>(0,n.jsxs)(`tr`,{children:[r.map(t=>(0,n.jsx)(`td`,{style:s(t),children:t.render?t.render(e):e[t.key]},t.key)),o?(0,n.jsx)(`td`,{className:`tbl-act`,children:o(e)}):null]},a(e)))})]})})}export{r as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{$ as i,J as a,Q as o,U as s,X as c,a as l,at as u,c as d,et as f,ft as p,i as m,n as ee,o as te,q as h,r as g,s as _,yt as v}from"./index-D2VlAlpK.js";import{t as y}from"./EmptyState-1sPNleqv.js";import{a as ne,n as re,o as b,r as x,t as S}from"./RailCats-BtIstKaH.js";import{i as C,n as w,r as T}from"./Markdown-DpmmtW2Y.js";var E=e(t(),1);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){let t=[],n=[],r=`before`;for(let i of(e||``).split(`
|
|
2
|
+
`))r===`before`&&/^\|\s*piece\s*\|/i.test(i)?r=`map`:r===`map`&&!i.trimStart().startsWith(`|`)&&(r=`after`),r===`before`?t.push(i):r===`after`&&n.push(i);return[t.join(`
|
|
3
|
+
`),n.join(`
|
|
4
|
+
`)]}function k(e,t){let n=document.createElement(`template`);return n.innerHTML=e,n.content.querySelectorAll(`h1, h2, h3`).forEach(e=>{e.tagName!==`H1`&&(t.idx+=1);let n=e.id||D(e.textContent||``,t.idx),r=n;for(let e=2;t.ids.has(r);e++)r=`${n}-${e}`;t.ids.add(r),e.id=r,e.tagName!==`H1`&&t.toc.push({level:Number(e.tagName[1]),title:(e.textContent||``).trim(),id:r})}),n.content.querySelectorAll(`table`).forEach(e=>{let t=document.createElement(`div`);t.className=`table-scroll`,t.setAttribute(`tabindex`,`0`),t.setAttribute(`role`,`region`),t.setAttribute(`aria-label`,`Table`),e.replaceWith(t),t.appendChild(e)}),n.innerHTML}function A(e){let t={ids:new Set,idx:0,toc:[]},n=n=>k(w(n,e?.links),t);if(e?.rows){let[r,i]=O(e.body);return{before:n(r),after:n(i),toc:t.toc}}return{html:n(e?.body),toc:t.toc}}var j=n(),M={"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`]},N=`you already know this`,P=e=>Math.max(1,Math.ceil((e||``).split(/\s+/).filter(Boolean).length/200));function F(e){e.querySelectorAll(`pre`).forEach(e=>{if(e.parentElement?.classList.contains(`docs-code`))return;let t=document.createElement(`figure`);t.className=`docs-code`;let n=document.createElement(`figcaption`),r=e.querySelector(`code`)?.className.match(/(?:^|\s)language-(\S+)/)?.[1];if(r){let e=document.createElement(`span`);e.className=`mono`,e.textContent=r,n.append(e)}let i=document.createElement(`button`);i.type=`button`,i.className=`btn ghost sm`,i.setAttribute(`aria-label`,`Copy command`),i.textContent=`Copy`,n.append(i),e.replaceWith(t),t.append(n,e)})}function I(e){let t=(e.querySelector(`pre`)?.textContent||``).replace(/\n+$/,``);navigator.clipboard?.writeText?.(t)?.catch?.(()=>{})}function L({page:e,overview:t,onAction:n,section:r,description:i}){let a=(0,E.useRef)(null),o=(0,E.useMemo)(()=>A({body:e.body,links:e.links}).html,[e.body,e.links]);(0,E.useEffect)(()=>{let e=a.current;e&&(e.querySelectorAll(`blockquote`).forEach(e=>{(e.querySelector(`strong`)?.textContent||``).toLowerCase().startsWith(N)&&e.classList.add(`analogy`)}),F(e))},[o]),(0,E.useEffect)(()=>{let e=a.current;if(!e)return;let t=e=>{let t=e.target.closest(`.docs-code figcaption button`);if(t)return I(t.closest(`.docs-code`));let n=e.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`);r&&r.startsWith(`#/`)&&(e.preventDefault(),v(r))};return e.addEventListener(`click`,t),()=>e.removeEventListener(`click`,t)},[o]),(0,E.useEffect)(()=>{let n=a.current;if(!n)return;n.querySelectorAll(`.docs-here`).forEach(e=>e.classList.remove(`docs-here`));let[r,i]=M[t?.emit]||[];if(!r)return;let o=null;e.id===`install`?o=n.querySelector(`a[href="#/docs/${r}"]`)?.closest(`li`):e.id===r&&i&&(o=[...n.querySelectorAll(`h2`)].find(e=>D(e.textContent||``)===D(i))),o?.classList.add(`docs-here`)},[o,e.id,t?.emit]);let c=[];return e.id===`install`&&(c.push({label:`Run doctor`,action:`doctor`}),c.push({label:`Rebuild`,action:`build`})),e.id===`verify`&&c.push({label:`Run doctor`,action:`doctor`}),e.id===`upgrade`&&c.push({label:`Update`,action:`update`}),(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{eyebrow:r&&`${r} · ${P(e.body)} min read`,title:e.title,sub:i,actions:c.length>0&&c.map(e=>e.hash?(0,j.jsx)(`a`,{className:`btn ghost sm`,href:e.hash,children:e.label},e.label):(0,j.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>n&&n(e.action),children:e.label},e.label))}),e.source&&(0,j.jsx)(`div`,{className:`doc-meta`,children:(0,j.jsxs)(`span`,{className:`badge`,children:[(0,j.jsx)(`span`,{className:`dot`}),e.source]})}),(0,j.jsx)(`div`,{className:`markdown`,ref:a,dangerouslySetInnerHTML:{__html:o}}),e.link&&(0,j.jsx)(`div`,{className:`doc-link`,children:(0,j.jsx)(`a`,{className:`btn soft sm`,href:e.link.hash,children:e.link.label})})]})}var R=e=>`cmd-`+String(e).replace(/[^\w-]+/g,`-`),z=1200;function B({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,j.jsxs)(`div`,{className:`cli-arg`,children:[(0,j.jsx)(`code`,{className:`cli-arg-name`,children:n}),r.length>0&&(0,j.jsxs)(`code`,{className:`cli-arg-meta`,children:[` `,r.join(` · `)]}),e.help&&(0,j.jsx)(`div`,{className:`cli-arg-help`,children:e.help})]})}function V({text:e}){let[t,n]=(0,E.useState)(!1);return(0,j.jsxs)(`button`,{className:`btn ghost sm`,onClick:async()=>{try{await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),z)}catch{}},title:`Copy command`,children:[(0,j.jsx)(u,{name:t?`spark`:`copy`}),t?`Copied`:`Copy`]})}function H({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,j.jsxs)(`div`,{className:`card pad-md mb-12 cli-card`,children:[(0,j.jsxs)(`div`,{className:`row wrap between cli-head`,children:[(0,j.jsxs)(`div`,{className:`stack gap-4`,children:[(0,j.jsx)(`h2`,{id:R(e.name),children:(0,j.jsx)(`code`,{children:e.name})}),e.help&&(0,j.jsx)(`p`,{className:`sub`,children:e.help})]}),(0,j.jsx)(V,{text:`${t} ${e.name}`})]}),(0,j.jsx)(`pre`,{className:`cli-syn`,children:r}),(e.positionals||[]).length>0&&(0,j.jsxs)(`div`,{className:`cli-block`,children:[(0,j.jsx)(`div`,{className:`cli-block-head`,children:`Arguments`}),e.positionals.map(e=>(0,j.jsx)(B,{a:e,kind:`positional`},e.dest))]}),(e.options||[]).length>0&&(0,j.jsxs)(`div`,{className:`cli-block`,children:[(0,j.jsx)(`div`,{className:`cli-block-head`,children:`Options`}),e.options.map(e=>(0,j.jsx)(B,{a:e,kind:`option`},e.names.join(`,`)))]})]})}function U({page:e}){let t=e.prog||`geneseed`,n=e.commands||[];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:(0,j.jsxs)(j.Fragment,{children:[`Every subcommand of `,(0,j.jsx)(`code`,{children:t}),`. Generated from the parser at request time (the same one `,(0,j.jsx)(`code`,{children:`geneseed`}),` actually parses), so this page cannot drift.`]})}),(0,j.jsx)(`div`,{children:n.map(e=>(0,j.jsx)(H,{cmd:e,prog:t},e.name))})]})}function W({page:e}){let t=e.rows||[],n=e.theme||`neutral`;return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:(0,j.jsxs)(j.Fragment,{children:[`Geneseed's invented vocabulary, decoded. Left: the neutral, plain-English term. Right: the word your `,(0,j.jsx)(`code`,{className:`cap`,children:n}),` theme actually uses in the agent's voice. Last: the developer idea it maps to.`]})}),(0,j.jsx)(`div`,{className:`card pad-md`,children:(0,j.jsxs)(`table`,{className:`glossary-table`,children:[(0,j.jsx)(`thead`,{children:(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`th`,{children:`Concept`}),(0,j.jsx)(`th`,{children:`Neutral term`}),(0,j.jsxs)(`th`,{children:[`In `,n]}),(0,j.jsx)(`th`,{children:`Meaning`}),(0,j.jsx)(`th`,{children:`In dev terms`})]})}),(0,j.jsx)(`tbody`,{children:t.map(e=>(0,j.jsxs)(`tr`,{children:[(0,j.jsx)(`td`,{children:(0,j.jsx)(`strong`,{children:e.label})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{children:e.neutral||`—`})}),(0,j.jsx)(`td`,{children:(0,j.jsx)(`code`,{children:e.themed||e.neutral||`—`})}),(0,j.jsx)(`td`,{className:`dim`,children:e.desc}),(0,j.jsx)(`td`,{className:`dim`,children:e.analogy||`—`})]},e.label))})]})})]})}var G={enforced:`ok`,automatic:`ok`,asked:`warn`,"on demand":`warn`},K=({text:e})=>(0,j.jsx)(`span`,{dangerouslySetInnerHTML:{__html:T(C.parseInline(e||``))}}),q=({kind:e})=>(0,j.jsx)(`span`,{className:`tag ${G[e]||``}`,children:e});function J({page:e,overview:t,onAction:n,section:r,description:i}){let[a,o]=(0,E.useState)(0),{before:c,after:l}=(0,E.useMemo)(()=>A(e),[e]);if(!e.rows)return(0,j.jsx)(L,{page:e,overview:t,onAction:n,section:r,description:i});let u=e.rows[a]||e.rows[0];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{eyebrow:r&&`${r} · ${P(e.body)} min read`,title:e.title,sub:i}),(0,j.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:c}}),(0,j.jsxs)(`div`,{className:`docs-map`,children:[(0,j.jsx)(`ul`,{className:`map-tree`,"aria-label":`Pieces`,children:e.rows.map((e,t)=>(0,j.jsx)(`li`,{children:(0,j.jsxs)(`button`,{className:`map-node ${t===a?`on`:``}`,"aria-pressed":t===a,onClick:()=>o(t),children:[(0,j.jsx)(`span`,{className:`map-piece`,children:(0,j.jsx)(K,{text:e.piece})}),(0,j.jsx)(q,{kind:e.kind}),(0,j.jsx)(`span`,{className:`mono dim map-cost`,children:(0,j.jsx)(K,{text:e.cost})})]})},t))}),u&&(0,j.jsxs)(`div`,{className:`card pad-md map-detail`,"aria-live":`polite`,children:[(0,j.jsx)(`h2`,{children:(0,j.jsx)(K,{text:u.piece})}),(0,j.jsx)(q,{kind:u.kind}),(0,j.jsxs)(`dl`,{children:[(0,j.jsx)(`dt`,{children:`Does`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.does})}),(0,j.jsx)(`dt`,{children:`Costs`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.cost})}),(0,j.jsx)(`dt`,{children:`Turn it off`}),(0,j.jsx)(`dd`,{children:(0,j.jsx)(K,{text:u.off})})]})]})]}),l.trim()&&(0,j.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:l}})]})}function Y(){let e=document.getElementById(`main`);return e&&e.scrollHeight>e.clientHeight?e:document.scrollingElement||document.documentElement}function ie(e){return document.addEventListener(`scroll`,e,{capture:!0,passive:!0}),()=>document.removeEventListener(`scroll`,e,{capture:!0})}var X=e=>(0,E.useSyncExternalStore)(ie,e,()=>null),ae=5,oe=96,se=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function ce(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-])${se(e)}s?(?![\\w-])`,`i`).test(n))&&r.push(e),r.length===ae)break;return r}var le=e=>document.getElementById(e)?.scrollIntoView({behavior:`smooth`});function Z({page:e,glossaryRows:t}){let n=e?.body,r=(0,E.useMemo)(()=>e?.kind===`cli`?(e.commands||[]).map(e=>({id:R(e.name),title:e.name,level:2})):A(e).toc,[e]),i=(0,E.useMemo)(()=>ce(n,t),[n,t]),a=X(()=>{let e=null;for(let t of r){let n=document.getElementById(t.id)?.getBoundingClientRect().top;n!=null&&n<=oe&&(e=t.id)}return e});return!r.length&&!i.length?null:(0,j.jsxs)(`aside`,{className:`docs-margin`,children:[r.length>0&&(0,j.jsxs)(`nav`,{className:`docs-toc`,"aria-label":`On this page`,children:[(0,j.jsx)(`div`,{className:`docs-toc-head`,children:`On this page`}),(0,j.jsx)(`ul`,{children:r.map(e=>(0,j.jsx)(`li`,{className:`lvl-${e.level}`,children:(0,j.jsx)(`a`,{href:`#${e.id}`,"aria-current":a===e.id?`location`:void 0,onClick:t=>{t.preventDefault(),le(e.id)},children:e.title})},e.id))})]}),i.length>0&&(0,j.jsxs)(`div`,{className:`docs-gloss`,children:[(0,j.jsx)(`div`,{className:`docs-toc-head`,children:`Terms on this page`}),i.map(e=>(0,j.jsxs)(`div`,{className:`docs-gloss-card`,children:[(0,j.jsx)(`b`,{children:e.themed||e.neutral||e.label}),(0,j.jsx)(`p`,{children:e.desc})]},e.label))]})]})}function ue({page:e}){let t=e.version||{},n=[[`Theme`,e.theme],[`Install mode`,e.emit],[`Deployed`,e.deployed?`yes`:`no`],[`Target`,(0,j.jsx)(`code`,{children:e.target},`t`)],[`Source root`,(0,j.jsx)(`code`,{children:e.root},`r`)],[`Installed build`,(0,j.jsx)(`code`,{children:t.installed_fp||`(none)`},`i`)],[`Source build`,(0,j.jsx)(`code`,{children:t.source_fp||`—`},`s`)],[`Match?`,t.verdict||`—`],[`License`,e.license]];return(0,j.jsxs)(`div`,{className:`detail-doc`,children:[(0,j.jsx)(s,{title:e.title,sub:`Live snapshot of the install behind this UI, plus where to go next.`}),(0,j.jsx)(`div`,{className:`card pad-md mb-18`,children:n.map(([e,t])=>(0,j.jsxs)(`div`,{className:`kv`,children:[(0,j.jsx)(`span`,{className:`k`,children:e}),(0,j.jsx)(`span`,{className:`v`,children:t??`—`})]},e))}),(0,j.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,j.jsxs)(`a`,{className:`btn ghost`,href:e.repo,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),e.repo_is_github?`GitHub repo`:`Source repo`]}),e.repo_is_github&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),`File an issue`]}),(0,j.jsxs)(`a`,{className:`btn ghost`,href:`${e.repo}/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,j.jsx)(u,{name:`external`}),`License`]})]})]})]})}function Q(e){return e?.groups?.[0]?.pages?.[0]?.id||``}function de({data:e,error:t,overview:n,onAction:r,place:i}){if(t)return(0,j.jsx)(h,{error:t,style:{margin:18}});if(!e)return(0,j.jsx)(a,{label:`Loading page…`});switch(e.kind){case`markdown`:case`concept`:return(0,j.jsx)(L,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`map`:return(0,j.jsx)(J,{page:e,overview:n,onAction:r,section:i.section,description:i.page?.description});case`cli`:return(0,j.jsx)(U,{page:e});case`glossary`:return(0,j.jsx)(W,{page:e});case`about`:return(0,j.jsx)(ue,{page:e});default:return(0,j.jsx)(y,{title:`Unknown page kind`,children:e.kind})}}function fe(){let e=Y(),t=e.scrollHeight-e.clientHeight;return t>0?Math.min(100,Math.max(0,e.scrollTop/t*100)):0}function pe(){let e=X(fe);return(0,j.jsx)(`div`,{className:`docs-progress`,"aria-hidden":`true`,children:(0,j.jsx)(`i`,{style:{width:`${e}%`}})})}function $(e){return(e?.pages||[]).map(e=>({name:e.id,title:e.title,desc:e.description||``,group:e.section||`General`,groupC:`var(--accent)`}))}function me({page:e,overview:t,onAction:n}){let[s,u]=f(i(t?.emit)),{data:v,error:y}=p(()=>r.docs(s),[s]),C=e||Q(v),{data:w,error:T,loading:D}=p(()=>C?r.docsPage(C,s):Promise.resolve(null),[C,s]),{data:O}=p(()=>r.docsPage(`glossary`,s).catch(()=>null),[s],`docs:glossary`);(0,E.useEffect)(()=>{if(v&&C&&!v.groups.some(e=>e.pages.some(e=>e.id===C))){let e=Q(v);e&&e!==C&&window.location.replace(l(e))}},[v,C]),(0,E.useEffect)(()=>{let e=document.scrollingElement||document.documentElement;for(let t of[document.getElementById(`main`),e])t&&(t.scrollTop=0)},[C]);let k=_(v,C),A=k.part||v?.groups?.[0]||null,M=A?.id===g;(0,E.useEffect)(()=>{M&&w?.id===C&&te(C)},[M,w,C]);let N=M?[...d(),C]:[],[P,F]=(0,E.useState)(``),[I,L]=(0,E.useState)(`all`),[R,z]=(0,E.useState)(A?.id);A?.id!==R&&(z(A?.id),F(``),L(`all`));let B=$(A),V=re(B),H=I===`all`?B:B.filter(e=>e.group===I),U=b(H,P);return y?(0,j.jsx)(h,{error:y}):(0,j.jsx)(`div`,{className:`docs-wrap`,children:(0,j.jsxs)(`div`,{className:`library docs-lib`,children:[(0,j.jsxs)(`aside`,{className:`lib-kinds`,"aria-label":`Docs parts`,children:[(0,j.jsxs)(`div`,{className:`lib-title`,children:[(0,j.jsx)(`p`,{className:`h`,children:`Docs`}),(0,j.jsx)(`span`,{className:`dim`,children:`How it works, and how to use it`})]}),(0,j.jsx)(c,{"aria-label":`Harness`,children:o.map(e=>(0,j.jsx)(`button`,{className:s===e.id?`on`:``,onClick:()=>u(e.id),"aria-pressed":s===e.id,children:e.label},e.id))}),(0,j.jsx)(`nav`,{className:`kind-list`,"aria-label":`Parts`,children:(v?.groups||[]).map(e=>(0,j.jsxs)(E.Fragment,{children:[(0,j.jsxs)(`a`,{href:e.pages[0]?l(e.pages[0].id):`#/docs`,className:A?.id===e.id?`on`:``,"aria-current":A?.id===e.id?`page`:void 0,children:[e.label,(0,j.jsx)(`span`,{className:`mono dim`,children:e.pages.length})]}),A?.id===e.id&&(0,j.jsx)(S,{label:`Sections`,total:B.length,cats:V,cat:I,onChange:L})]},e.id))})]}),(0,j.jsx)(ne,{label:A?.label||`Docs`,count:P.trim()?`${U.length} of ${H.length}`:H.length||``,extra:M&&(0,j.jsx)(m,{pages:A.pages,seen:N}),q:P,onQ:F,matched:U.length,inView:[A?.id,C],children:v?(0,j.jsx)(x,{rows:U,activeName:C,hrefOf:e=>l(e.name),pills:M?e=>N.includes(e.name)&&e.name!==C?(0,j.jsx)(`span`,{className:`docs-read-mark`,role:`img`,"aria-label":`, read`,children:`✓`}):null:void 0}):(0,j.jsx)(a,{label:`Loading docs…`})}),(0,j.jsxs)(`article`,{className:`lib-reader docs-reader`,"aria-label":`Page`,children:[(0,j.jsx)(pe,{}),k.page&&(0,j.jsxs)(`nav`,{className:`docs-crumbs mono`,"aria-label":`Breadcrumb`,children:[(0,j.jsx)(`a`,{href:l(k.part.pages[0].id),children:k.part.label}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`a`,{href:l(k.part.pages.find(e=>(e.section||`General`)===k.section).id),children:k.section}),(0,j.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,j.jsx)(`span`,{"aria-current":`page`,children:k.page.title})]}),(0,j.jsxs)(`div`,{className:`docs-read`,children:[(0,j.jsxs)(`div`,{className:`docs-article`,children:[(0,j.jsx)(de,{data:D?null:w,error:T,overview:t,onAction:n,place:k},`${C}|${s}`),!D&&(0,j.jsx)(ee,{menu:v,pageId:C})]}),!D&&(0,j.jsx)(Z,{page:w,glossaryRows:O?.rows})]})]})]})})}export{me as default,$ as docRows};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";e();var n=t();function r({value:e,onChange:t,label:r,placeholder:i,className:a}){return(0,n.jsx)(`input`,{className:a||`lib-filter`,type:`text`,value:e,onChange:e=>t(e.target.value),placeholder:i,"aria-label":r||i})}export{r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-hePW80VL.js";import{i as e,t}from"./react-DlYQp10C.js";import{t as n}from"./motion-CXaUMNkg.js";import{n as r,r as i}from"./sections-ChwaobfW.js";import{F as a,I as o,P as s,at as c,st as l,ut as u,z as d}from"./index-D2VlAlpK.js";import{n as f,r as p}from"./Dashboard-CnO_bsfz.js";e();var m=t(),h=12,g=[`#2BB673`,`#16A6A6`,`#E8A23B`,`#E07A5F`,`#8E7DBE`,`#5BD08A`,`#79856E`],_=650;function v({segments:e,size:t=186,stroke:r=26,caption:i=`capabilities`}){let a=e.reduce((e,t)=>e+t.n,0);return(0,m.jsxs)(`div`,{className:`ring-box`,children:[(0,m.jsx)(d,{segments:e,size:t,stroke:r,label:i,sweepMs:_}),(0,m.jsxs)(`div`,{className:`ring-center`,children:[(0,m.jsx)(`div`,{className:`donut-c-num`,children:(0,m.jsx)(n,{value:a,duration:_})}),(0,m.jsx)(`div`,{className:`donut-c-cap`,children:i})]})]})}function y(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 b({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=y(o),c=o[o.length-1],l=o[0],u=`${s} L${c[0]},${r} L${l[0]},${r} Z`;return(0,m.jsxs)(`svg`,{viewBox:`0 0 600 ${r}`,preserveAspectRatio:`none`,style:{width:`100%`,height:t,display:`block`,overflow:`visible`},children:[(0,m.jsx)(`defs`,{children:(0,m.jsxs)(`linearGradient`,{id:`b-grad`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,m.jsx)(`stop`,{offset:`0`,stopColor:n,stopOpacity:`.28`}),(0,m.jsx)(`stop`,{offset:`1`,stopColor:n,stopOpacity:`0`})]})}),(0,m.jsx)(`path`,{d:u,fill:`url(#b-grad)`}),(0,m.jsx)(`path`,{d:s,fill:`none`,stroke:n,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`}),(0,m.jsx)(`circle`,{cx:c[0],cy:c[1],r:`3.5`,fill:n,vectorEffect:`non-scaling-stroke`})]})}function x({label:e,value:t,sub:n,color:r,icon:i}){return(0,m.jsxs)(`div`,{className:`b-tile`,children:[(0,m.jsx)(`span`,{className:`b-tile-ic`,style:{background:`color-mix(in srgb, ${r} 18%, transparent)`,color:r},children:(0,m.jsx)(c,{name:i})}),(0,m.jsxs)(`div`,{className:`b-tile-body`,children:[(0,m.jsx)(`div`,{className:`b-tile-val`+(t===0?` zero`:``),children:t}),(0,m.jsx)(`div`,{className:`b-tile-label`,children:e})]}),(0,m.jsx)(`div`,{className:`b-tile-sub`,children:n})]})}function S({overview:e,sigil:t,jobs:d,lens:_,onAction:y}){let S=e.counts||{},C=_?.doctor?.state||`loading`,w=_?.doctor?.data?.groups||[],T=C===`ok`,E=w.filter(e=>e.problems.length===0).length,D=w.length,O=p(e,_?.tone),k=o(d,h),A=l(e.diff),j=i.filter(e=>(S[e]||0)>0).map((e,t)=>({key:e,label:r[e].label,n:S[e]||0,tone:`cat`+t%g.length,color:g[t%g.length]})),M=j.reduce((e,t)=>e+t.n,0),N=s(d||[],10),P=N.reduce((e,t)=>e+t.v,0);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`div`,{className:`b-greet`,children:(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`div`,{className:`eyebrow`,children:`your harness`}),(0,m.jsx)(`h2`,{className:`h b-h`,children:O}),(0,m.jsx)(f,{verdict:_?.verdict}),(0,m.jsx)(`p`,{className:`sub`,children:t||`A friendly read of every layer growing in your harness.`})]})}),(0,m.jsxs)(`div`,{className:`grid b-hero-grid mb-16`,children:[(0,m.jsxs)(`div`,{className:`card b-hero`,children:[(0,m.jsx)(`div`,{className:`b-hero-ring`,children:(0,m.jsx)(v,{segments:[{key:`pass`,label:`pass`,n:E,tone:`good`},{key:`attention`,label:`attention`,n:Math.max(D-E,0),tone:`warn`}],size:168,stroke:20,caption:`checks`})}),(0,m.jsxs)(`div`,{className:`b-hero-side`,children:[(0,m.jsx)(`h3`,{className:`b-hero-title`,children:T?`${E} of ${D} checks pass`:C===`failed`?`Doctor did not answer`:`Checking…`}),C===`failed`&&(0,m.jsxs)(`button`,{className:`btn ghost b-hero-retry`,"aria-label":`Run doctor again`,onClick:()=>y(`doctor`),children:[(0,m.jsx)(c,{name:`doctor`}),`Run doctor`]}),(0,m.jsxs)(`p`,{className:`sub`,children:[`One source, rendered into `,(0,m.jsx)(`code`,{children:e.target}),` and inherited by every repo on this machine.`]}),T&&(0,m.jsx)(`ul`,{className:`b-hero-checks`,children:w.map(e=>{let t=e.problems.length===0;return(0,m.jsxs)(`li`,{className:`b-hcheck ${t?`ok`:`bad`}`,title:t?`clean`:e.problems.join(`; `),children:[(0,m.jsx)(`span`,{className:`b-hcheck-mark`,children:t?`✓`:`!`}),(0,m.jsx)(`span`,{className:`b-hcheck-label`,children:e.label})]},e.label)})}),(0,m.jsxs)(`div`,{className:`b-chips`,children:[(0,m.jsxs)(`span`,{className:`b-chip`,children:[(0,m.jsx)(`b`,{className:`t-cap`,children:e.theme}),` voice`]}),(0,m.jsx)(`span`,{className:`b-chip`,children:(0,m.jsx)(`b`,{children:e.emit})}),(0,m.jsxs)(`span`,{className:`b-chip`,children:[`built `,(0,m.jsx)(`b`,{children:e.build_time||`unknown`})]})]})]})]}),(0,m.jsxs)(`div`,{className:`b-tiles`,children:[(0,m.jsx)(x,{label:`Agents`,value:S.agents??`—`,sub:`specialists`,color:g[0],icon:`layers`}),(0,m.jsx)(x,{label:`Skills`,value:S.skills??`—`,sub:`workflows`,color:g[1],icon:`skill`}),(0,m.jsx)(x,{label:`Dictates`,value:S.laws??`—`,sub:S.doctrines?`${S.doctrines.active}/${S.doctrines.total} packs · ${S.doctrines.rules} rules`:`all upheld`,color:g[2],icon:`law`}),(0,m.jsx)(x,{label:`Edits`,value:A,sub:`to graft`,color:g[3],icon:`changes`})]})]}),(0,m.jsxs)(`div`,{className:`grid split-even mb-16`,children:[(0,m.jsxs)(`div`,{className:`card pad-lg b-mix-card`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Capability mix`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[M,` total`]})})]}),(0,m.jsxs)(`div`,{className:`b-mix`,children:[(0,m.jsx)(v,{segments:j,size:186,stroke:26}),(0,m.jsx)(`div`,{className:`b-legend`,children:j.map(e=>(0,m.jsxs)(`div`,{className:`b-leg-row`,children:[(0,m.jsx)(`span`,{className:`b-leg-dot`,style:{background:e.color}}),(0,m.jsx)(`span`,{className:`b-leg-name`,children:e.label}),(0,m.jsx)(`span`,{className:`b-leg-bar`,children:(0,m.jsx)(`i`,{style:{width:`${e.n/M*100}%`,background:e.color}})}),(0,m.jsx)(`span`,{className:`b-leg-val`,children:e.n})]},e.label))})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent runs`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`badge ok`,children:[(0,m.jsx)(`span`,{className:`dot`}),`job log`]})})]}),(0,m.jsxs)(`div`,{className:`b-stat-lead`,children:[(0,m.jsx)(`span`,{className:`b-stat-big`,children:(0,m.jsx)(n,{value:P})}),(0,m.jsxs)(`span`,{className:`b-stat-cap`,children:[`runs in the last 10 days`,T&&D>0&&` · ${E}/${D} checks pass now`]})]}),(0,m.jsx)(b,{data:N,accent:g[0],height:156})]})]}),(0,m.jsxs)(`div`,{className:`card pad-lg`,children:[(0,m.jsxs)(`div`,{className:`card-head`,children:[(0,m.jsx)(`h3`,{children:`Recent activity`}),(0,m.jsx)(`div`,{className:`right`,children:(0,m.jsxs)(`span`,{className:`tick`,children:[`last `,k.length,` runs`]})})]}),(0,m.jsxs)(`div`,{className:`b-timeline`,children:[k.map(e=>{let t=e.status===`done`,n=e.status===`failed`?`warn`:t?`ok`:`acc`,r=a(e);return(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node ${n}`}),(0,m.jsxs)(`div`,{className:`b-tl-body`,title:r.command||void 0,children:[(0,m.jsx)(`b`,{children:r.verb}),[r.scope,r.result,r.duration].map(e=>e?` · ${e}`:``).join(``)]}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:e.started?`${u(e.started)} ago`:`—`})]},e.id)}),(!d||d.length===0)&&(0,m.jsxs)(`div`,{className:`b-tl-row`,children:[(0,m.jsx)(`span`,{className:`b-tl-node`}),(0,m.jsx)(`div`,{className:`b-tl-body sub`,children:`No runs yet. Trigger an action to populate this.`}),(0,m.jsx)(`span`,{className:`b-tl-when`,children:`—`})]})]})]})]})}export{S as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-DlYQp10C.js";import{t as r}from"./api-BfpZmUMI.js";import{n as i}from"./motion-CXaUMNkg.js";import{J as a,R as o,U as s,X as c,Y as l,Z as u,at as d,ft as f,gt as p,ht as m,it as h,mt as g,nt as _,ot as v,pt as y,q as b,rt as x,st as S,tt as C,ut as w,vt as T}from"./index-D2VlAlpK.js";import{t as E}from"./EmptyState-1sPNleqv.js";import{t as D}from"./Tabs-ByiD3mPQ.js";import{c as O,i as k,l as A,n as j,o as M,s as N,t as P}from"./KitApply-Bz6_5yec.js";var F=e(t(),1),I=n();function L({host:e,theme:t,options:n,onAction:i,onClose:a,onNote:o}){let[s,c]=(0,F.useState)({path:``,host:e,theme:t,footprint:`lean`,posture:`peer`,mode:`direct`,trust:`balanced`}),[l,u]=(0,F.useState)(!1),[d,f]=(0,F.useState)(``),p=(e,t)=>c(n=>({...n,[e]:t})),m=async()=>{u(!0),o(``);try{let e=await r.pickFolder();e.path?(p(`path`,e.path),f(``)):e.error&&o(e.error)}catch(e){o(e.message)}finally{u(!1)}},h=async()=>{let e=s.path.trim();if(!e){f(`Choose or type a folder to deploy into.`);return}f(``),o(``),await i?.(`deploy`,{host:s.host,path:e,theme:s.theme,footprint:s.footprint,posture:s.posture,mode:s.mode,trust:s.trust})&&a()};return(0,I.jsxs)(`div`,{className:`deploy-pop`,children:[(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:s.path,onChange:e=>{p(`path`,e.target.value),f(``)},onKeyDown:e=>e.key===`Enter`&&h(),"aria-label":`Folder to deploy into`,"aria-invalid":d?!0:void 0,"aria-describedby":d?`dp-path-err`:void 0}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:l,onClick:m,children:l?`Choosing…`:`Browse…`})]}),d?(0,I.jsx)(`p`,{id:`dp-path-err`,className:`tag bad note`,role:`alert`,children:d}):null,(0,I.jsxs)(`div`,{className:`dp-row`,children:[(0,I.jsxs)(`label`,{className:`dp-field`,children:[(0,I.jsx)(`span`,{children:`Deploy as`}),(0,I.jsx)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:s.host,onChange:e=>p(`host`,e.target.value),children:C.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsx)(O,{value:s,options:n,onChange:p,who:`the new harness`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:h,children:`Deploy`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:a,children:`Cancel`})]}),(0,I.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,I.jsx)(`code`,{children:_(s.host).deployAdds}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]})}function R(){let{data:e,error:t,reload:n}=f(()=>r.excludes(),[]),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)([]),c=async(e,t)=>{a(!0);try{let n=await r.excludeMutate(e,t);s(n.messages||[])}catch(e){s(e.body?.messages||[e.message])}finally{a(!1),n()}};return t||!e?.installs?.length?null:(0,I.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,I.jsx)(`div`,{className:`card-head`,children:(0,I.jsx)(`h3`,{children:`Excluded folders`})}),(0,I.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsx)(`code`,{children:e.path}),(0,I.jsx)(`span`,{className:`mono muted`,children:e.hosts.map(e=>_(e).label).join(`, `)}),(0,I.jsx)(`button`,{className:`btn ghost sm`,disabled:i,"aria-label":`Stop excluding ${e.path}`,onClick:()=>c(`remove`,e.path),children:`Remove`})]},e.path)),(0,I.jsxs)(`button`,{className:`btn ghost sm`,disabled:i,onClick:async()=>{a(!0);try{let e=await r.pickFolder();e.path?await c(`add`,e.path):e.error&&s([e.error])}catch(e){s([e.message])}finally{a(!1)}},children:[(0,I.jsx)(d,{name:`folder`}),` Exclude a folder…`]}),o.map((e,t)=>(0,I.jsx)(`p`,{className:`sub`,children:e},t))]})}function z({targets:e,onReveal:t}){let n=e.flatMap(e=>e.servers);return(0,I.jsxs)(`div`,{className:`ip-block`,children:[(0,I.jsxs)(`span`,{className:`ip-label`,children:[`MCP servers `,(0,I.jsx)(`span`,{className:`mono dim`,children:n.length})]}),e.map(e=>(0,I.jsxs)(`div`,{className:`mcp-target`,children:[(0,I.jsxs)(`div`,{className:`mt-head`,children:[(0,I.jsx)(`code`,{title:e.path,children:e.label}),e.exists?(0,I.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>t(e),"aria-label":`Open the folder holding ${e.label}`,title:`Open the folder holding ${e.path} to edit it`,children:`Open folder`}):null]}),e.exists?e.servers.length?e.servers.map(e=>(0,I.jsxs)(`div`,{className:`mcp-row`,children:[(0,I.jsx)(`span`,{className:`mono`,children:e.name}),(0,I.jsx)(`span`,{className:`tag ${e.state===`enabled`?`ok`:`warn`}`,children:e.state===`enabled`?`Enabled`:`Disabled`})]},e.name)):(0,I.jsx)(`p`,{className:`sub`,children:`None configured in this file.`}):(0,I.jsxs)(`p`,{className:`sub`,children:[`No MCP file yet (it would be `,(0,I.jsx)(`code`,{children:e.path}),`).`]})]},e.path))]})}var B={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`],absent:[`Not installed`,``]};function ee({inst:e,targets:t,choice:n,unchanged:r,options:i,onPick:a,canAct:o,busy:s,memory:c,onMemory:l,onApply:u,onToggleInstall:d,onRemove:f,onRevealMcp:p}){let m=`${_(e.host).label} · ${e.scope}`,[h,g]=B[e.state]||B.absent,v=e.state===`active`,y=e.state===`absent`;return(0,I.jsxs)(`aside`,{className:`install-panel`,"aria-label":`${m} install`,children:[(0,I.jsx)(`span`,{className:`ip-eyebrow`,children:`Selected install`}),(0,I.jsxs)(`div`,{className:`ip-head`,children:[(0,I.jsx)(`h2`,{children:x(e)}),(0,I.jsx)(`span`,{className:`tag ${g}`,children:h})]}),(0,I.jsx)(`span`,{className:`ip-kind`,children:e.scope===`global`?`Global install`:`Per-project install · ${_(e.host).label}`}),(0,I.jsx)(`code`,{className:`ip-path`,children:e.path}),y?(0,I.jsxs)(`p`,{className:`sub`,children:[`Install Geneseed here as `,(0,I.jsx)(`strong`,{children:_(e.host).label}),`. Files are added non-destructively; deactivate or uninstall later.`]}):null,(v||y)&&o?(0,I.jsx)(`div`,{className:`ip-picks`,children:(0,I.jsx)(O,{value:n,options:i,onChange:a,who:m})}):null,v&&t.length?(0,I.jsx)(z,{targets:t,onReveal:p}):null,v&&e.scope===`global`?(0,I.jsx)(R,{}):null,y?null:(0,I.jsxs)(`label`,{className:`ip-switch`,children:[(0,I.jsx)(A,{on:v,disabled:s,label:`activate ${m}`,onToggle:d}),(0,I.jsx)(`span`,{children:v?`Active: loads in every session`:`Disabled: files moved aside`})]}),(0,I.jsx)(`div`,{className:`ip-spacer`}),o?(0,I.jsxs)(`div`,{className:`ip-actions`,children:[y?(0,I.jsx)(`button`,{type:`button`,className:`btn`,onClick:u,children:`Install`}):v?(0,I.jsx)(`button`,{type:`button`,className:`btn`,disabled:r,onClick:u,children:`Apply and rebuild`}):null,y?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`label`,{className:`field`,children:[(0,I.jsx)(`span`,{children:`On uninstall, memory and notebook`}),(0,I.jsxs)(`select`,{className:`sel`,value:c,onChange:e=>l(e.target.value),children:[(0,I.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,I.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,I.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn ghost danger-line`,"aria-label":`remove ${m} from ${e.path}`,disabled:s,onClick:f,children:`Uninstall…`})]})]}):null]})}var V=(e,t)=>`${e} ${t}`,te=[`claude`,`bob`,`openclaude`],H={active:[`Active`,`ok`],disabled:[`Disabled`,`warn`]};function ne(e,t){let n=e.drift?.stale??0,r={behind:`Behind ${t||`source`}`+(n?` · ${n} file${n===1?``:`s`}`:``),synced:`In sync`,unknown:`Not checked`}[e.verdict],i=e.diffable?S(e.drift):0;return i?`${r} · ${i} edited`:r}function re({inst:e,fleet:t,version:n,onEdits:r}){if(t===void 0)return(0,I.jsx)(`span`,{className:`dim`,children:`…`});if(!t)return(0,I.jsx)(`span`,{className:`dim`,children:`—`});let i=t.drift?.stale??0,a=t.diffable?S(t.drift):0;return(0,I.jsxs)(`div`,{className:`sync-cell`,children:[t.diffable&&i+a>0?(0,I.jsx)(o,{label:`Sync with source of ${x(e)}`,parts:[{key:`stale`,label:`behind source`,n:i,tone:`warn`},{key:`edited`,label:`edited by hand`,n:a,tone:`bad`}]}):null,(0,I.jsx)(`span`,{className:`dim`,children:ne(t,n)}),t.diffable?null:(0,I.jsxs)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:[` `,`· not checkable`]}),a?(0,I.jsxs)(I.Fragment,{children:[` `,(0,I.jsx)(`a`,{href:`#/installs/edits`,onClick:t=>{t.preventDefault(),t.stopPropagation(),r(e)},children:`Local edits`})]}):null]})}function ie({rows:e,project:t,currentId:n,onPick:r,label:i,fleet:a,onEdits:o}){let s=e=>a===void 0?void 0:a?.installs?.find(t=>t.id===e.id)||null;return(0,I.jsx)(`div`,{className:`tbl-scroll`,children:(0,I.jsxs)(`table`,{className:`tbl hosts-tbl`,"aria-label":i,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,children:t?`Project`:`Host`}),(0,I.jsx)(`th`,{scope:`col`,children:t?`Host`:`Path`}),(0,I.jsx)(`th`,{scope:`col`,children:`Voice`}),(0,I.jsx)(`th`,{scope:`col`,children:`Footprint`}),(0,I.jsx)(`th`,{scope:`col`,children:`State`}),(0,I.jsx)(`th`,{scope:`col`,children:`Sync with source`}),(0,I.jsx)(`th`,{scope:`col`,children:(0,I.jsx)(`span`,{className:`sr-only`,children:`Selected`})})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>{let[i,c]=H[e.state]||[`Not installed`,``],l=n===e.id,u=e.state===`absent`;return(0,I.jsxs)(`tr`,{className:`pickable${l?` on`:``}${u?` quiet`:``}`,onClick:()=>r(e.id),children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`button`,{type:`button`,className:`row-pick`,"aria-pressed":l,title:e.path,onClick:()=>r(e.id),children:x(e)})}),t?(0,I.jsx)(`td`,{children:_(e.host).label}):(0,I.jsx)(`td`,{className:`mono path-cell`,title:e.path,children:e.path}),(0,I.jsx)(`td`,{children:u?``:e.theme||``}),(0,I.jsx)(`td`,{children:u?``:e.footprint||``}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`tag ${c}`,children:i})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(re,{inst:e,fleet:s(e),version:a?.version,onEdits:o})}),(0,I.jsx)(`td`,{className:`pick-mark`,children:l?`Editing ›`:``})]},e.id)})})]})})}function ae({themes:e,current:t}){if(!e.length||!t)return null;let n=[...e].sort((e,n)=>e.name===t?-1:+(n.name===t));return(0,I.jsxs)(`details`,{className:`panel voice-ref`,children:[(0,I.jsxs)(`summary`,{children:[(0,I.jsx)(`span`,{className:`vr-title`,children:`Voices`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[e.length,` to choose from, set per install`]})]}),(0,I.jsx)(`div`,{className:`vr-list`,children:n.map(e=>(0,I.jsxs)(`div`,{className:`voice-row${e.name===t?` current`:``}`,children:[(0,I.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,I.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function oe({setup:e,overview:t}){if(!e)return null;let n=e.installed_fp&&e.installed_fp===e.source_fp;return(0,I.jsxs)(`section`,{className:`panel`,"aria-labelledby":`checkout-h`,children:[(0,I.jsxs)(`div`,{className:`panel-head`,children:[(0,I.jsx)(`h2`,{id:`checkout-h`,children:`This checkout`}),(0,I.jsx)(`span`,{className:`mono ${n?`t-good`:`t-warn`}`,children:e.version_verdict})]}),(0,I.jsxs)(`dl`,{className:`kv-grid`,children:[(0,I.jsx)(`dt`,{children:`Source`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.root}),(0,I.jsx)(`dt`,{children:`Version`}),(0,I.jsx)(`dd`,{className:`mono`,children:t?.version||`unknown`}),(0,I.jsx)(`dt`,{children:`Fingerprint`}),(0,I.jsx)(`dd`,{className:`mono`,children:e.source_fp})]})]})}function U({onAction:e,themes:t=[],currentTheme:n,overview:i,setup:o,dataRev:s,onMutated:c}){let l=u(),{data:p,error:m,reload:g}=f(()=>r.installs(),[s]),{data:v,error:y,reload:x}=f(()=>r.mcp(),[s]),{data:S,error:C}=f(()=>r.fleet(),[s]),w=C?null:S??void 0,[T,D]=(0,F.useState)(null),[O,k]=(0,F.useState)(``),[A,j]=(0,F.useState)({}),[M,P]=(0,F.useState)(!1),[R,z]=(0,F.useState)({id:``,value:`keep`}),B=e=>R.id===e?.id?R.value:`keep`,[H,ne]=(0,F.useState)(``),re=(0,F.useMemo)(()=>{let e={};for(let t of v?.targets||[]){let n=V(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[v]);if(m||y)return(0,I.jsx)(b,{error:m||y,onRetry:()=>{g(),x()}});if(!p||!v)return(0,I.jsx)(a,{});let U={active:0,disabled:1,absent:2},W=[...p.installs].sort((e,t)=>(e.scope===`global`?0:1)-(t.scope===`global`?0:1)||(U[e.state]??3)-(U[t.state]??3)),G=W.find(e=>e.id===H)||W.find(e=>e.selected)||W.find(e=>e.state===`active`)||W[0],K=e=>{let t=A[e.id]||{};return{theme:t.theme||e.theme||n||`neutral`,footprint:t.footprint||e.state!==`absent`&&e.footprint||`lean`,posture:t.posture||e.posture||`peer`,mode:t.mode||e.mode||`direct`,trust:t.trust||e.trust||`balanced`}},se=(e,t,n)=>j(r=>({...r,[e.id]:{...r[e.id],[t]:n}})),q=e=>{let t=K(e);return t.theme===e.theme&&t.footprint===(e.footprint||`lean`)&&t.posture===(e.posture||`peer`)&&t.mode===(e.mode||`direct`)&&t.trust===(e.trust||`balanced`)},J={theme:t.map(e=>e.name),footprint:N,posture:p.postures||[],mode:p.modes||[],trust:p.trusts||[]},ce=async t=>{let{theme:n,footprint:r,posture:i,mode:a,trust:o}=K(t),s=_(t.host).label,c=`${r} footprint, ${i} posture, ${a} mode, ${o} loop trust`,u=t.state===`absent`?`Install Geneseed for ${s} into ${t.path} with the “${n}” voice (${c})? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this ${s} install (voice “${n}”, ${c})? It rebuilds in place, non-destructive.`;await l(u,{title:t.state===`absent`?`Install Geneseed?`:`Rebuild this install?`,confirmLabel:t.state===`absent`?`Install`:`Rebuild`})&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a,trust:o})},le=async e=>{if(e.state!==`active`||await l(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`,{title:`Deactivate this install?`,confirmLabel:`Deactivate`})){k(e.id),D(null);try{let t=await r.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;D({text:t.error||e&&`unrestored: ${e}`||`action failed`,tone:`bad`});return}c?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},Y=(e,t)=>{let n=e.path.includes(`\\`)&&!e.path.includes(`/`)?`\\`:`/`,r=e.path.replace(/[\\/]+$/,``);return`${e.scope===`project`&&te.includes(e.host)?`${r}${n}.${e.host}`:r}${n}${t}`},ue=async e=>{let t=B(e),n=e.scope===`project`?` and de-lists it`:`; the row stays, marked “not installed”`,i=t===`delete`?`, and permanently deletes ${Y(e,`memory`)} and ${Y(e,`notebook`)}`:t===`archive`?`; memory and notebook are archived aside`:`; memory and notebook stay in place`;if(await l(`Uninstall ${_(e.host).label} · ${e.scope}? It deletes ${h(e.host,e.scope)}${n}${i}. This can’t be undone.`,{title:e.scope===`project`?`Remove this harness?`:`Remove the global install?`,confirmLabel:t===`delete`?`Remove and delete memory`:`Remove`,tone:`danger`})){k(e.id),D(null);try{let n=await r.installRemove(e.host,e.path,t);if(!n.ok){D({text:n.error||`remove failed`,tone:`bad`});return}z({id:``,value:`keep`}),n.kept?.length&&D({text:`Removed. Kept ${n.kept.length} file(s) you edited: ${n.kept.join(`, `)} — they are yours now (the CLI geneseed uninstall --force deletes edited files too).`,tone:`ok`}),c?.()}catch(e){D({text:e.message,tone:`bad`})}finally{k(``)}}},de=async e=>{D(null);try{let t=await r.mcpReveal(e.path);D({text:`Opening ${t.dir}. If no window appeared, open that folder by hand.`,tone:``})}catch(e){D({text:e.message,tone:`bad`})}},fe=W.find(e=>e.selected)?.host||W.find(e=>e.state===`active`)?.host||W[0]?.host||`opencode`,X=W.filter(e=>e.scope===`global`),Z=W.filter(e=>e.scope!==`global`),Q=e=>{ne(e)},$=async e=>{if(!e.selected){try{await r.selectView(e.host,e.path)}catch{}c?.()}window.location.hash=`#/installs/edits`};return(0,I.jsxs)(`div`,{className:`hosts`,children:[(0,I.jsxs)(`div`,{className:`hosts-main`,children:[(0,I.jsxs)(`div`,{className:`toolbar`,children:[(0,I.jsxs)(`span`,{className:`dim`,children:[W.filter(e=>e.state===`active`).length,` active of `,W.length,` `,`detected.`]}),e?(0,I.jsx)(`div`,{className:`row gap-8`,children:(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>e(`build-all`),children:[(0,I.jsx)(d,{name:`refresh`}),` Rebuild all`]})}):null]}),T?.tone===`bad`?(0,I.jsx)(`p`,{className:`tag bad note`,role:`alert`,children:T.text}):T?(0,I.jsx)(`p`,{className:`tag ${T.tone===`ok`?`ok `:``}note`,role:`status`,children:T.text}):null,(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-global`,children:[(0,I.jsx)(`div`,{className:`inst-head`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-global`,children:`Global installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`One per tool. Loaded in every folder, except excluded ones.`})]})}),(0,I.jsx)(ie,{rows:X,currentId:G?.id,onPick:Q,label:`Global installs`,fleet:w,onEdits:$})]}),(0,I.jsxs)(`section`,{className:`panel flush`,"aria-labelledby":`inst-project`,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{id:`inst-project`,children:`Per-project installs`}),(0,I.jsx)(`p`,{className:`dim`,children:`A repo with its own harness. Inside it, only that harness loads.`})]}),e?(0,I.jsxs)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>P(e=>!e),children:[(0,I.jsx)(d,{name:`folder`}),` Deploy to a repo…`]}):null]}),M?(0,I.jsx)(`div`,{className:`inst-deploy`,children:(0,I.jsx)(L,{host:fe,theme:n||`neutral`,options:J,onAction:e,onClose:()=>P(!1),onNote:e=>D(e?{text:e,tone:`bad`}:null)})}):null,Z.length?(0,I.jsx)(ie,{rows:Z,project:!0,currentId:G?.id,onPick:Q,label:`Per-project installs`,fleet:w,onEdits:$}):(0,I.jsx)(E,{children:`No repo has its own harness yet. Deploy one to give a project its own rules and voice.`})]}),(0,I.jsx)(oe,{setup:o,overview:i}),(0,I.jsx)(ae,{themes:t,current:i?.theme})]}),G?(0,I.jsx)(ee,{inst:G,targets:re[V(G.host,G.path)]||[],choice:K(G),unchanged:q(G),options:J,onPick:(e,t)=>se(G,e,t),canAct:!!e,busy:O===G.id,memory:B(G),onMemory:e=>z({id:G.id,value:e}),onApply:()=>ce(G),onToggleInstall:()=>le(G),onRemove:()=>ue(G),onRevealMcp:de},G.id):null]})}function W({onAction:e,dataRev:t}){let{data:n,error:i}=f(()=>r.kits(),[t]),o=M(n,e);return i||n?.error?(0,I.jsx)(b,{error:i||n.error}):n?n.installs.length?n.kits.length?(0,I.jsx)(`div`,{className:`kits-tab`,children:n.installs.map(e=>{let t=k(e),r=o.setOf(e),i=`${e.host} · ${e.scope}`;return(0,I.jsxs)(`section`,{className:`panel flush`,"aria-label":i,children:[(0,I.jsxs)(`div`,{className:`inst-head`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{children:i}),(0,I.jsx)(`p`,{className:`dim mono`,children:e.path})]}),(0,I.jsx)(j,{row:e})]}),t&&(0,I.jsx)(`p`,{className:`kit-lock`,children:e.reason||e.error}),(0,I.jsx)(`ul`,{className:`kit-list`,children:n.kits.map(n=>(0,I.jsxs)(`li`,{className:`kit-row`,children:[(0,I.jsxs)(`div`,{className:`kit-main`,children:[(0,I.jsx)(`a`,{className:`kit-name`,href:`#/kits/${encodeURIComponent(n.name)}`,children:n.name}),n.description?(0,I.jsx)(`span`,{className:`kit-desc`,children:n.description}):null,(0,I.jsxs)(`span`,{className:`mono dim`,children:[n.skills.length,` skills · `,n.agents.length,` agents`]})]}),(0,I.jsx)(A,{on:r.has(n.name),disabled:t||o.running(e),label:`${n.name} for ${i}`,onToggle:()=>o.toggle(e,n.name)})]},n.name))}),Object.entries(e.keptKitFiles||{}).map(([e,t])=>(0,I.jsxs)(`p`,{className:`kit-kept mono dim`,children:[`kept from inactive kit `,e,`: `,t.join(`, `),` — delete by hand`]},e)),(0,I.jsx)(P,{row:e,stage:o})]},e.id)})}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`This Geneseed ships no kit.`}):(0,I.jsx)(`div`,{className:`empty inst-empty`,children:`No install yet.`}):(0,I.jsx)(a,{})}function G(e){return e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)?`hunk`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`del`:`ctx`}var K=300;function se({onMutated:e,onAction:t,dataRev:n,overview:i}){let o=u(),{data:s,error:c,reload:l}=f(()=>r.diff(),[n]),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(``),[_,v]=(0,F.useState)(()=>new Set),[y,x]=(0,F.useState)(()=>new Set),[S,C]=(0,F.useState)(null);if(s&&s!==S){C(s),v(new Set);let e=s.files.reduce((e,t)=>e+t.diff.length,0);x(new Set(e<=K?s.files.map(e=>e.rel):[]))}let w=e=>v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),T=()=>v(e=>e.size===k.length?new Set:new Set(k.map(e=>e.rel))),D=()=>t?.(`export`),O=async()=>{let t=[..._],n=t.filter(e=>s.files.find(t=>t.rel===e)?.status===`added`),i=n.length?`Restoring will DELETE ${n.length} deployed-only file(s):\n${n.join(`
|
|
2
|
+
`)}\n\n`:``;if(await o(`${i}Discard local edits and restore ${t.length} file(s) from source?`,{title:`Restore from source?`,confirmLabel:`Restore`,tone:`danger`})){m(!0);try{let n=await r.restore(t),i=n.errors.length?` · ${n.errors.length} error(s): ${n.errors.join(`; `)}`:``;g(`Restored ${n.restored.length}, archived ${n.deleted.length}${i}`),await l(),e?.()}catch(e){g(e.message)}finally{m(!1)}}};if(c)return(0,I.jsx)(b,{error:c,onRetry:l});if(!s)return(0,I.jsx)(a,{});if(!s.deployed)return(0,I.jsx)(E,{title:`No deployed harness`,children:`Nothing to diff against.`});if(!s.diffable)return(0,I.jsx)(E,{title:`No drift check for this install`,docs:{href:`#/installs/hosts`,label:`Pick a global install in Hosts`},children:`The drift check covers global installs only.`});let k=s.files.filter(e=>e.status!==`linked`&&e.status!==`stale`),A=s.files.filter(e=>e.status===`linked`),j=s.files.filter(e=>e.status===`stale`),M=k.filter(e=>e.status===`edited`).length,N=k.filter(e=>e.status===`added`).length,P=k.filter(e=>e.status===`missing`).length,L=e=>x(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Local edits`}),s.target?(0,I.jsxs)(`p`,{className:`sub`,children:[`Comparing `,(0,I.jsx)(`code`,{children:s.target}),s.theme?` (${s.theme} voice)`:``,` with source`,` `,i?.version||`unknown`,`.`]}):null,M>0?(0,I.jsx)(`p`,{className:`sub`,children:`The agent refines its own deployed files in place. A rebuild keeps an edited file, which then stops receiving source updates — export it, then Restore to take the new source.`}):N+P>0?(0,I.jsx)(`p`,{className:`sub`,children:`These files differ from the source: added in the install, or missing from it.`}):null]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,disabled:p||_.size===0,onClick:O,children:[`Restore`,_.size?` (${_.size})`:``]}),(0,I.jsxs)(`button`,{className:`btn`,disabled:p,onClick:D,children:[(0,I.jsx)(d,{name:`download`}),`Export improvements`]})]})]}),h?(0,I.jsx)(`p`,{className:`sub mb-14`,children:h}):null,A.length?(0,I.jsxs)(`p`,{className:`sub dim mb-14`,title:A.map(e=>e.rel).join(`
|
|
3
|
+
`),children:[A.length,` linked — yours, left alone`]}):null,k.length===0&&j.length===0?(0,I.jsx)(E,{title:`In sync`,children:`Deployed harness matches source.`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`row between mb-14`,children:[(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsxs)(`span`,{className:`badge warn`,children:[(0,I.jsx)(`span`,{className:`dot`}),M,` edited`]}),(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),N,` added`]}),P>0&&(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),P,` missing`]}),j.length>0&&(0,I.jsxs)(`span`,{className:`badge`,children:[(0,I.jsx)(`span`,{className:`dot`}),j.length,` behind`]})]}),(0,I.jsxs)(`div`,{className:`row gap-10`,children:[(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set(s.files.map(e=>e.rel))),children:`Expand all`}),(0,I.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>x(new Set),children:`Collapse all`}),k.length?(0,I.jsxs)(`label`,{className:`row gap-8 dim sel-all`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:_.size===k.length,onChange:T}),`Select all`]}):null]})]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:k.map(e=>R(e,!0))}),j.length?(0,I.jsxs)(`div`,{className:`stack gap-12 diff-behind`,children:[(0,I.jsx)(`h3`,{children:`Behind source`}),(0,I.jsxs)(`div`,{className:`row between`,children:[(0,I.jsx)(`p`,{className:`sub`,children:`This install is built from older source — rebuild to bring these files up to date.`}),(0,I.jsx)(`button`,{className:`btn ghost`,disabled:p,onClick:()=>t?.(`build-all`),"aria-label":`Rebuild all installs`,children:`Rebuild`})]}),j.map(e=>R(e,!1))]}):null]})]});function R(e,t){let n=y.has(e.rel),r=e.status===`stale`||e.status===`added`?``:e.status===`missing`?`bad`:`warn`;return(0,I.jsxs)(`div`,{className:`card diff-file${n?` open`:``}`,children:[(0,I.jsxs)(`div`,{className:`diff-head`,children:[t?(0,I.jsx)(`input`,{type:`checkbox`,className:`chk`,checked:_.has(e.rel),onChange:()=>w(e.rel),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.rel}`}):null,(0,I.jsx)(`span`,{className:`fname`,children:e.rel}),(0,I.jsxs)(`span`,{className:`badge ${r}`,children:[(0,I.jsx)(`span`,{className:`dot`}),e.status===`stale`?`behind source`:e.status]}),(0,I.jsxs)(`span`,{className:`dim mono diff-lines`,children:[e.diff.length,` lines`]}),(0,I.jsx)(`button`,{className:`iconbtn`,onClick:()=>L(e.rel),"aria-label":n?`Collapse ${e.rel}`:`Expand ${e.rel}`,"aria-expanded":n,children:(0,I.jsx)(d,{name:`chevron`})})]}),n&&(0,I.jsx)(`div`,{className:`diff-body`,children:e.diff.map((e,t)=>(0,I.jsx)(`div`,{className:`diff-line ${G(e)}`,children:e},t))})]},e.rel)}}function q({group:e,i:t}){let n=e.problems.length===0,[r,i]=(0,F.useState)(!n);return(0,I.jsxs)(`div`,{className:`card check rise ${n?``:`bad`} ${r?`open`:``}`,style:{"--i":t*.6},children:[(0,I.jsxs)(`button`,{className:`check-head`,onClick:()=>i(e=>!e),disabled:n,"aria-expanded":n?void 0:r,children:[(0,I.jsx)(`span`,{className:`feed-dot ${n?`ok`:`bad`}`}),(0,I.jsx)(`h3`,{children:e.label}),(0,I.jsxs)(`span`,{className:`badge ${n?`ok`:`bad`}`,children:[(0,I.jsx)(`span`,{className:`dot`}),n?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`]}),!n&&(0,I.jsx)(d,{name:`chevron`,className:`chev glyph`})]}),!n&&r&&(0,I.jsx)(`div`,{className:`check-body`,children:e.problems.map(e=>(0,I.jsxs)(`div`,{className:`problem`,children:[(0,I.jsx)(`span`,{className:`x`,children:`✕`}),(0,I.jsx)(`span`,{children:e})]},e))})]})}function J({dataRev:e}){let t=(0,F.useRef)(!1),{data:n,error:i,reload:o,setData:s}=f(()=>{let e=t.current;return t.current=!1,r.doctor(e)},[e]),c=()=>{t.current=!0,s(null),o()};if(i)return(0,I.jsx)(b,{error:i,onRetry:o});let l=n?n.groups.filter(e=>e.problems.length):[],u=n?n.groups.filter(e=>!e.problems.length):[];return(0,I.jsxs)(`div`,{className:`narrow`,children:[(0,I.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:`Doctor`}),(0,I.jsx)(`p`,{className:`sub`,children:`Every check builds each theme in a sandbox and validates the result: token resolution, link integrity, parity, and drift.`})]}),(0,I.jsxs)(`button`,{className:`btn`,onClick:c,disabled:!n,children:[(0,I.jsx)(d,{name:`refresh`}),n?`Re-run checks`:`Running…`]})]}),n?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`card pad-md mb-16 doc-summary`,children:(0,I.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`span`,{className:`dim mono`,children:[`validated `,n.themes.length,` theme`,n.themes.length===1?``:`s`]}),n.checked_at?(0,I.jsxs)(`span`,{className:`dim mono`,title:n.checked_at,children:[`checked `,n.checked_at.slice(11)]}):null,n.themes.map(e=>(0,I.jsx)(`span`,{className:`badge cap`,children:e},e))]}),n.ok?(0,I.jsxs)(`span`,{className:`badge ok`,children:[(0,I.jsx)(`span`,{className:`dot`}),`all clean`]}):(0,I.jsxs)(`span`,{className:`badge bad`,children:[(0,I.jsx)(`span`,{className:`dot`}),n.problems.length,` problem`,n.problems.length===1?``:`s`]})]})}),(0,I.jsxs)(`div`,{className:`stack gap-12`,children:[l.map((e,t)=>(0,I.jsx)(q,{group:e,i:t},e.label)),u.length?(0,I.jsxs)(`details`,{className:`check-fold`,children:[(0,I.jsxs)(`summary`,{children:[u.length,` clean check`,u.length===1?``:`s`]}),(0,I.jsx)(`div`,{className:`stack gap-12`,children:u.map((e,t)=>(0,I.jsx)(q,{group:e,i:l.length+t},e.label))})]}):null]})]}):(0,I.jsx)(a,{label:`Running every check (builds each theme in a sandbox)…`})]})}function ce(){let e=u(),[t,n]=(0,F.useState)(!1),[i,a]=(0,F.useState)(null);return t?(0,I.jsxs)(`p`,{className:`sub`,children:[`Server stopped. You can close this tab and reopen any time with `,(0,I.jsx)(`code`,{children:`geneseed web`}),`.`]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:i}),(0,I.jsxs)(`button`,{className:`btn ghost danger-line`,onClick:async()=>{if(await e(`Stop the local Geneseed server? The console goes offline until you start it again.`,{title:`Stop the server?`,confirmLabel:`Stop server`,tone:`danger`})){a(null);try{await r.shutdown()}catch(e){if(e.status)return a(e.message)}n(!0)}},children:[(0,I.jsx)(d,{name:`x`}),`Stop server`]})]})}function le(){let e=u(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(null);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(b,{error:r}),(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:async()=>{if(await e(`Restart the local Geneseed server? The console reconnects in a moment.`,{title:`Restart the server?`,confirmLabel:`Restart`})){n(!0),i(null);try{await m()}catch(e){i(e.message),n(!1)}}},disabled:t,children:[(0,I.jsx)(d,{name:`refresh`}),t?`Restarting…`:`Restart server`]})]})}var Y=`https://github.com/Arylmera/Geneseed`,ue=`https://github.com/Arylmera`,de=[[`appearance`,`Appearance`],[`machine`,`Machine`],[`server`,`Server`],[`about`,`About`],[`danger`,`Danger zone`]],fe=[`Host check`,`token on writes`,`framing refused`,`cross-site GET refused`];function X({k:e,help:t,children:n,control:r}){return(0,I.jsxs)(`div`,{className:`sheet-row`,children:[(0,I.jsxs)(`span`,{className:`sheet-k`,children:[e,t?(0,I.jsx)(`span`,{className:`sheet-h sub`,children:t}):null]}),(0,I.jsx)(`div`,{className:`sheet-v`,children:n}),(0,I.jsx)(`div`,{className:`sheet-c`,children:r})]})}function Z({id:e,title:t,head:n,className:r=``,children:i}){return(0,I.jsxs)(`section`,{id:`set-${e}`,className:`card sheet-sec ${r}`,"aria-labelledby":`${e}-h`,children:[(0,I.jsxs)(`div`,{className:`card-head`,children:[(0,I.jsx)(`h3`,{id:`${e}-h`,children:t}),n]}),i]})}function Q({stale:e}){let t=e=>document.getElementById(`set-${e}`)?.scrollIntoView?.({behavior:i()?`smooth`:`auto`,block:`start`});return(0,I.jsx)(`nav`,{className:`sheet-index`,"aria-label":`On this page`,children:de.map(([n,r])=>(0,I.jsxs)(`button`,{type:`button`,className:n===`danger`?`t-bad`:``,onClick:()=>t(n),children:[r,n===`server`&&(0,I.jsx)(`span`,{className:`sheet-dot ${e?`warn`:`good`}`,"aria-hidden":`true`})]},n))})}function $({version:e}){let[t,n]=(0,F.useState)(Y),[i,a]=(0,F.useState)(!0);(0,F.useEffect)(()=>{Promise.resolve(r.docsPage?.(`about`)).then(e=>{e?.repo&&(n(e.repo),a(!!e.repo_is_github))}).catch(()=>{})},[]);let o=(e,t)=>(0,I.jsxs)(`a`,{href:e,target:`_blank`,rel:`noreferrer`,children:[t,` `,(0,I.jsx)(d,{name:`external`})]});return(0,I.jsxs)(Z,{id:`about`,title:`About`,children:[(0,I.jsx)(X,{k:`Version`,control:i?o(t+`/blob/main/CHANGELOG.md`,`Changelog`):null,children:(0,I.jsx)(`span`,{className:`mono`,children:e||`unknown`})}),i?(0,I.jsx)(X,{k:`Credits`,control:o(t+`#-credits`,`Credits`),children:(0,I.jsx)(`span`,{className:`sub`,children:`Skills and agents adapted from other projects, with their licences`})}):null,(0,I.jsx)(X,{k:`Geneseed`,help:`MIT-licensed`,control:(0,I.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),i?`Source on GitHub`:`Source repo`]}),i&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/issues`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`Issues`]}),(0,I.jsxs)(`a`,{className:`btn ghost`,href:t+`/blob/main/LICENSE`,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`external`}),`MIT License`]})]})]}),children:(0,I.jsx)(`span`,{className:`sub`,children:`A portable, theme-able harness you implant once and use everywhere to grow a disciplined AI coding agent. One canonical source, many voices.`})}),(0,I.jsx)(X,{k:`Creator`,control:(0,I.jsxs)(`a`,{className:`btn ghost`,href:ue,target:`_blank`,rel:`noreferrer`,children:[(0,I.jsx)(d,{name:`github`}),`@Arylmera on GitHub`]}),children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Built by `,(0,I.jsx)(`strong`,{children:`Guillaume Lemer`}),`. It started as a personal, Obsidian-vault-grown agent operating system and was distilled into the repo you are running. If you find it useful, a star on the repo or an issue with feedback is the best way to help shape what comes next.`]})})]})}function pe({overview:e,onAction:t,flavour:n,onFlavour:r,accentMode:i,onAccentMode:a,layout:o,onLayout:s}){let f=u(),m=e?.install,h=e?.footprint,v=e?.server,b=e?.daemon_stale,x=async e=>{m&&e!==h&&await f(`Rebuild ${_(m.host).label} · ${m.scope} with the “${e}” footprint? It rebuilds in place, non-destructive.`,{title:`Change the footprint?`,confirmLabel:`Rebuild`})&&t?.(`install`,{...m,footprint:e})},S=v?.autostart===!0?`On · login script`:v?.autostart===!1?`Off`:`unknown`;return(0,I.jsxs)(`div`,{className:`narrow-lg`,children:[(0,I.jsx)(`div`,{className:`head-row mb-18`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`h`,children:T.server}),(0,I.jsx)(`p`,{className:`sub`,children:`Console appearance, this copy of Geneseed, the local server, and about. Each install is managed on the Hosts tab.`})]})}),(0,I.jsxs)(`div`,{className:`sheet`,children:[(0,I.jsx)(Q,{stale:b}),(0,I.jsxs)(`div`,{className:`sheet-body`,children:[(0,I.jsxs)(Z,{id:`appearance`,title:`Appearance`,children:[n&&r&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-skin-label`,children:`Skin`}),help:`Colours and fonts of the console`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-skin-label`,children:p.map(e=>(0,I.jsx)(`button`,{className:n===e.id?`on`:``,onClick:()=>r(e.id),"aria-pressed":n===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:p.find(e=>e.id===n)?.tagline??``})]}),i&&a&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-accent-label`,children:`Accent`}),help:`Live, saved in this browser`,children:[(0,I.jsx)(l,{value:i,onChange:a,labelledBy:`dir-accent-label`}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:g(i)})]}),o&&s&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`dir-layout-label`,children:`Overview view`}),help:`The Overview, or one of the older dashboards`,children:[(0,I.jsx)(c,{"aria-labelledby":`dir-layout-label`,children:y.map(e=>(0,I.jsx)(`button`,{className:o===e.id?`on`:``,onClick:()=>s(e.id),"aria-pressed":o===e.id,title:e.tagline,children:e.short},e.id))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:y.find(e=>e.id===o)?.tagline??``})]})]}),(0,I.jsxs)(Z,{id:`machine`,title:`Machine`,children:[(0,I.jsx)(X,{k:`Geneseed`,help:`This copy of the source`,control:(0,I.jsxs)(`button`,{className:`btn`,onClick:()=>t(`update`),children:[(0,I.jsx)(d,{name:`download`}),`Update (git pull + rebuild)`]}),children:(0,I.jsx)(`span`,{className:`mono`,children:e?.version||`unknown`})}),(0,I.jsx)(X,{k:`Command on PATH`,help:`Run geneseed from any folder`,control:(0,I.jsxs)(`button`,{className:`btn ghost`,onClick:()=>t(`link`),children:[(0,I.jsx)(d,{name:`external`}),`Add to PATH`]})}),m&&h&&(0,I.jsxs)(X,{k:(0,I.jsx)(`span`,{id:`footprint-label`,children:`Harness footprint`}),help:(0,I.jsxs)(I.Fragment,{children:[`For `,_(m.host).label,` · `,m.scope,`; every Rule stays in force.`,` `,(0,I.jsx)(`a`,{href:`#/docs/footprint`,children:`Learn more →`})]}),children:[(0,I.jsx)(c,{"aria-labelledby":`footprint-label`,children:[`lean`,`full`].map(e=>(0,I.jsx)(`button`,{className:h===e?`on`:``,onClick:()=>x(e),"aria-pressed":h===e,children:e},e))}),(0,I.jsx)(`span`,{className:`dir-layout-note sub`,role:`status`,"aria-live":`polite`,children:h===`lean`?`Lean: terse rule lines + a pointer to the full law file (~40% smaller, lighter context per turn).`:`Full: every Rule’s complete text and rationale inlined (maximum guidance, largest context).`})]})]}),(0,I.jsxs)(Z,{id:`server`,title:`Server`,className:`sheet-live`,head:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`pill good`,children:`running`}),(0,I.jsxs)(`span`,{className:`mono dim`,children:[`127.0.0.1:`,window.location.port||`80`,v?` · pid ${v.pid} · up ${w(v.started)}`:``]})]}),children:[(0,I.jsx)(X,{k:`Code`,help:`The page you see matches the build on disk`,control:(0,I.jsx)(le,{}),children:b?(0,I.jsx)(`span`,{className:`pill warn`,children:`disk has newer code → Restart`}):(0,I.jsx)(`span`,{className:`pill good`,children:`matches disk`})}),(0,I.jsx)(X,{k:`Start at login`,help:`A login script you set up by hand (install guide)`,children:(0,I.jsx)(`span`,{className:`sub`,children:S})}),(0,I.jsx)(X,{k:`Guards`,help:`What stops another page from driving the console`,children:(0,I.jsx)(`span`,{className:`row wrap gap-8`,children:fe.map(e=>(0,I.jsx)(`span`,{className:`pill good`,children:e},e))})})]}),(0,I.jsx)($,{version:e?.version}),(0,I.jsxs)(Z,{id:`danger`,title:`Danger zone`,className:`danger-zone`,children:[(0,I.jsx)(X,{k:`Stop the server`,help:`The console goes offline until you run geneseed web`,control:(0,I.jsx)(ce,{})}),(0,I.jsx)(X,{k:`The geneseed command`,help:`Installs keep working; only the command goes`,control:(0,I.jsx)(`button`,{className:`btn ghost danger-line`,onClick:()=>t(`unlink`),children:`Remove from PATH`})}),(0,I.jsx)(X,{k:`Uninstall a harness`,children:(0,I.jsxs)(`span`,{className:`sub`,children:[`Each install has its own Uninstall in `,(0,I.jsx)(`a`,{href:`#/installs/hosts`,children:`Hosts`}),`, bound to its host and path.`]})})]})]})]})]})}function me({tab:e=`hosts`,overview:t,setup:n,themes:r,onAction:i,onMutated:a,dataRev:o,appearance:c={}}){let l=t?.doctor,u=t?.diff,d={edits:u?v(u):null,doctor:l?l.ok?`clean`:l.problems.length:null};return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s,{title:`Installs`,sub:`Where the harness lives on this machine, and how each copy is built.`}),(0,I.jsx)(D,{page:`installs`,current:e,badges:d,label:`Installs`}),e===`hosts`&&(0,I.jsx)(U,{onAction:i,themes:r,currentTheme:t?.theme,overview:t,setup:n,dataRev:o,onMutated:a}),e===`kits`&&(0,I.jsx)(W,{onAction:i,dataRev:o}),e===`edits`&&(0,I.jsx)(se,{onMutated:a,onAction:i,dataRev:o,overview:t}),e===`doctor`&&(0,I.jsx)(J,{dataRev:o}),e===`server`&&(0,I.jsx)(pe,{overview:t,onAction:i,...c})]})}export{me as default};
|