geneseed 6.0.1 → 6.0.3
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 +20 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +53 -10
- package/adapters/opencode/plugins/geneseed-learn.js +11 -4
- package/docs/concepts/agents.md +2 -2
- package/docs/web-ui.md +25 -0
- package/harness.config.json +1 -1
- package/js/README.md +2 -1
- package/js/build/bundle.mjs +2 -11
- package/js/build/emit-claude.mjs +2 -2
- package/js/build/emit-opencode.mjs +4 -2
- package/js/build/fold.mjs +3 -20
- package/js/build/source.mjs +1 -1
- package/js/build/stubs.mjs +42 -5
- package/js/cli-table.json +1 -1
- package/js/hosts/hooks-context.mjs +65 -9
- package/js/hosts/memory-files.mjs +166 -13
- package/js/hosts/native.mjs +48 -27
- package/js/hosts/opencode.mjs +3 -2
- package/js/inspect/checks-build.mjs +2 -2
- package/js/inspect/doctor.mjs +2 -0
- package/js/inspect/status.mjs +4 -1
- package/js/maintain/memory.mjs +2 -2
- package/js/web/agent-models-api.mjs +52 -17
- package/js/web/api.mjs +3 -0
- package/js/web/catalog.mjs +5 -3
- package/js/web/model-catalog.mjs +324 -0
- package/js/web/routes.mjs +5 -3
- package/package.json +1 -1
- package/src/agents/memory-curator.md +1 -1
- package/src/memory/README.md +24 -5
- package/src/skills/rule/approve.md +3 -1
- package/src/skills/rule/consolidate.md +1 -1
- package/web/dist/assets/ActiveLoops-paFbiZyt.js +1 -0
- package/web/dist/assets/Activity-IAxWF2wK.js +1 -0
- package/web/dist/assets/ActivityDetail-CtC2DLvh.js +1 -0
- package/web/dist/assets/{Bonsai-8NtlFrPO.js → Bonsai-BoKo68Kw.js} +1 -1
- package/web/dist/assets/{CopyButton-BHqKgdjJ.js → CopyButton-C0VTiqmb.js} +1 -1
- package/web/dist/assets/Dashboard-CRGCp2cV.js +2 -0
- package/web/dist/assets/{Docs-C1jzrFnD.js → Docs-DwOwzaD6.js} +2 -2
- package/web/dist/assets/Factories-DxHD2T-1.js +1 -0
- package/web/dist/assets/{GreenhouseView-ofAQ-V5h.js → GreenhouseView-D5VOmhmR.js} +1 -1
- package/web/dist/assets/Installs-B5hFSUeN.js +3 -0
- package/web/dist/assets/JournalView-gUSGysTm.js +1 -0
- package/web/dist/assets/{Kits-P4xspDuN.js → Kits-DYQvykZ0.js} +1 -1
- package/web/dist/assets/Laws-UVk0uojS.js +4 -0
- package/web/dist/assets/{LibRows-CGO25X3D.js → LibRows-CwK63kjB.js} +1 -1
- package/web/dist/assets/Library-DdzyrwUK.js +3 -0
- package/web/dist/assets/Loops-yHga7xdr.js +2 -0
- package/web/dist/assets/Models-DAgkQ4CE.js +1 -0
- package/web/dist/assets/{OperatorHudView-Cc8mlViW.js → OperatorHudView-D1lQF-ZY.js} +1 -1
- package/web/dist/assets/Personal-DjhIfa9v.js +2 -0
- package/web/dist/assets/Settings-Brgec4M0.js +1 -0
- package/web/dist/assets/Tabs-BHjxciOL.js +1 -0
- package/web/dist/assets/api-C8nMUU1i.js +1 -0
- package/web/dist/assets/index-BILaKHbH.js +6 -0
- package/web/dist/assets/index-BfyZCNu7.css +1 -0
- package/web/dist/assets/router-1EhRJy1C.js +1 -0
- package/web/dist/assets/useLocalStorage-54tkqXN7.js +1 -0
- package/web/dist/index.html +5 -3
- package/web/dist/assets/ActiveLoops-6p44eD86.js +0 -1
- package/web/dist/assets/Activity-CIgrq5R1.js +0 -1
- package/web/dist/assets/ActivityDetail-Brqv1u4f.js +0 -1
- package/web/dist/assets/Dashboard-CoveJ_-U.js +0 -2
- package/web/dist/assets/Factories-D5pLnt5S.js +0 -1
- package/web/dist/assets/Installs-DpWgyT5j.js +0 -3
- package/web/dist/assets/JournalView-CsuN3_B-.js +0 -1
- package/web/dist/assets/Laws-DK3OwGDl.js +0 -4
- package/web/dist/assets/Library-e-94YED6.js +0 -3
- package/web/dist/assets/Loops-C9DSBj-A.js +0 -2
- package/web/dist/assets/Personal-DVh2jYPO.js +0 -2
- package/web/dist/assets/Settings-CknBI-Fx.js +0 -1
- package/web/dist/assets/Tabs-C30JrkJH.js +0 -1
- package/web/dist/assets/api-DxwG8y94.js +0 -1
- package/web/dist/assets/index-CUJ8AaAF.css +0 -1
- package/web/dist/assets/index-MB7E-va_.js +0 -6
- package/web/dist/assets/usePoll-D5c_qIFZ.js +0 -1
package/js/web/api.mjs
CHANGED
|
@@ -37,6 +37,7 @@ import { accentFor, keptKitFiles, statusData } from '../inspect/status.mjs';
|
|
|
37
37
|
import { writeTextAtomic } from '../lib/fs.mjs';
|
|
38
38
|
import { sharedPaths } from '../lib/machine-dir.mjs';
|
|
39
39
|
import { comparePaths } from '../lib/paths.mjs';
|
|
40
|
+
import { pinCountOf } from './model-catalog.mjs';
|
|
40
41
|
import {
|
|
41
42
|
configItems, deployed, dget, fleetCounts, memoryDir, memoryItems, notebookItems, orSkip, tierOf, wikiItems,
|
|
42
43
|
} from './catalog.mjs';
|
|
@@ -252,6 +253,8 @@ export function apiInstalls(state) {
|
|
|
252
253
|
// Files here that are the user's where Geneseed ships one, and retired leftovers: what a
|
|
253
254
|
// forced rebuild would replace or remove (`leftoversOf`). Read off the emit's own record.
|
|
254
255
|
leftovers: leftoversOf(root, host, scope),
|
|
256
|
+
// The agents of this install that carry their own model pin: the Installs panel's line to the Models page.
|
|
257
|
+
pins: installState(root, host, scope) === 'absent' ? 0 : pinCountOf(viewCfg(host, scope, root)),
|
|
255
258
|
// OpenCode only: the bash gates a `--prune-gates` rebuild would take out (`strandedGatesOf`).
|
|
256
259
|
strandedGates: strandedGatesOf(root, host, scope),
|
|
257
260
|
// The install a request naming none reads (`defaultView`): the console's pickers start on it.
|
package/js/web/catalog.mjs
CHANGED
|
@@ -30,7 +30,7 @@ import { comparePaths, normcase, within } from '../lib/paths.mjs';
|
|
|
30
30
|
import { stripWhitespace } from '../lib/text.mjs';
|
|
31
31
|
import { readJsonc } from '../hosts/settings.mjs';
|
|
32
32
|
import { SRC, loadKits, makeCfg, ruleCanon, ruleSummaries } from '../build/source.mjs';
|
|
33
|
-
import { RESERVED_STEMS } from '../hosts/memory-files.mjs';
|
|
33
|
+
import { RESERVED_STEMS, isReservedStem } from '../hosts/memory-files.mjs';
|
|
34
34
|
import { loadTheme } from '../build/render.mjs';
|
|
35
35
|
|
|
36
36
|
/** A requested catalog section or item that does not exist. */
|
|
@@ -213,8 +213,10 @@ export const stemOf = (name) => name.slice(0, name.length - path.extname(name).l
|
|
|
213
213
|
* map) but no list holds them, so a list and its count cannot disagree.
|
|
214
214
|
*/
|
|
215
215
|
export const isFurniture = (file, index) => {
|
|
216
|
-
const
|
|
217
|
-
|
|
216
|
+
const raw = stemOf(file);
|
|
217
|
+
const stem = raw.toLowerCase();
|
|
218
|
+
// The memory store also treats a stem in capitals alone as a document (`ARCHIVE-INDEX`, D2).
|
|
219
|
+
return stem === index || (index === 'memory' ? isReservedStem(raw) : stem !== 'memory' && RESERVED_STEMS.has(stem));
|
|
218
220
|
};
|
|
219
221
|
|
|
220
222
|
/**
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The models one install can run a sub-agent on — what `GET /api/agent-models` lists as `models`.
|
|
3
|
+
*
|
|
4
|
+
* ONE READER PER HOST, files and local probes only, and NEVER A SECRET (spec D3): an API key is
|
|
5
|
+
* never returned, logged or sent. Only its presence is a boolean, and only where a catalogue
|
|
6
|
+
* provider's `env` names it or `auth.json` holds an entry for it; a custom provider's `options`
|
|
7
|
+
* (`apiKey`, headers, `{env:X}`) is never looked at, and no remote or private `/v1/models` is ever
|
|
8
|
+
* called. The one network use is `GET` on `127.0.0.1` (Ollama 11434, LM Studio 1234), no header,
|
|
9
|
+
* one second. Whitelist the fields you copy; a row is built from named fields, never spread.
|
|
10
|
+
*
|
|
11
|
+
* A COMPANY SETUP COMES FIRST. A private URL, a private key and in-house model names are known to
|
|
12
|
+
* no catalogue, so a custom provider's own `models` map is the primary source (with the `name`,
|
|
13
|
+
* `limit`, `cost`, `variants` the config itself gives) and `models.dev` is enrichment only, for an
|
|
14
|
+
* id that matches. A missing catalogue, `auth.json` or runtime is not an error and says nothing.
|
|
15
|
+
* OpenClaude, whose profile names a base URL, reuses the OpenCode custom provider on the same
|
|
16
|
+
* endpoint, so the in-house names reach it without calling the endpoint.
|
|
17
|
+
*
|
|
18
|
+
* A row: `{ id, name, provider, providerName, source, note, local, available, reason?, context?,
|
|
19
|
+
* output?, cost?, reasoning?, variants? }`; `id` is the value written into `model:`. A group
|
|
20
|
+
* (`groups`) is one provider with its source line and availability, so a local runtime that is not
|
|
21
|
+
* running still shows. `inherit` is the first row on every host.
|
|
22
|
+
*/
|
|
23
|
+
import os from 'node:os';
|
|
24
|
+
import path from 'node:path';
|
|
25
|
+
|
|
26
|
+
import { isFile, readText } from '../lib/fs.mjs';
|
|
27
|
+
import { isDict, isTruthy } from '../lib/json.mjs';
|
|
28
|
+
import { loadJsonObject } from '../hosts/settings.mjs';
|
|
29
|
+
import { loadAgentOverrides } from '../hosts/native.mjs';
|
|
30
|
+
|
|
31
|
+
/** How many agents of the install at `dir` carry a model pin: the Installs panel's one-line summary. */
|
|
32
|
+
export function pinCountOf(dir) {
|
|
33
|
+
return Object.values(loadAgentOverrides(dir, () => {})).filter((e) => isDict(e) && isTruthy(e.model)).length;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const PROBE_MS = 1000;
|
|
37
|
+
/** The aliases a Claude Code sub-agent accepts; `default`/`best`/`opusplan` are not agent values. */
|
|
38
|
+
const CLAUDE_ALIASES = [['opus', 'Opus'], ['sonnet', 'Sonnet'], ['haiku', 'Haiku'], ['fable', 'Fable']];
|
|
39
|
+
|
|
40
|
+
const SESSION = { provider: 'session', providerName: 'Session model', source: 'session' };
|
|
41
|
+
|
|
42
|
+
/** Lower-cased host, no trailing `/`, no `/v1`: two spellings of one endpoint compare equal. */
|
|
43
|
+
export function normalizeUrl(u) {
|
|
44
|
+
if (typeof u !== 'string' || !u.trim()) return '';
|
|
45
|
+
let s = u.trim();
|
|
46
|
+
const m = /^([a-z][a-z0-9+.-]*:\/\/)([^/?#]*)(.*)$/i.exec(s);
|
|
47
|
+
if (m) s = `${m[1].toLowerCase()}${m[2].toLowerCase()}${m[3]}`;
|
|
48
|
+
s = s.replace(/\/+$/, '').replace(/\/v1$/i, '').replace(/\/+$/, '');
|
|
49
|
+
return s;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const isLocalUrl = (u) => /^https?:\/\/(127\.0\.0\.1|localhost|\[::1\])([:/]|$)/i.test(String(u ?? '').trim());
|
|
53
|
+
// The JSONC reader hands a number back as `parseJson`'s wrapper object, so `+v` reads both forms.
|
|
54
|
+
const num = (v) => {
|
|
55
|
+
if (typeof v === 'boolean' || v === null || v === undefined || Array.isArray(v) || isDict(v)) return undefined;
|
|
56
|
+
return typeof v === 'number' || typeof v === 'object' ? (Number.isFinite(+v) ? +v : undefined) : undefined;
|
|
57
|
+
};
|
|
58
|
+
const text = (v) => (typeof v === 'string' && v.trim() ? v.trim() : undefined);
|
|
59
|
+
|
|
60
|
+
/** A row from named fields only. `extra` is `{ name, limit, cost, reasoning, variants }` from a config or catalogue. */
|
|
61
|
+
function row(id, base, extra = {}) {
|
|
62
|
+
const r = { id, name: text(extra.name) ?? id, ...base, available: base.available ?? true };
|
|
63
|
+
if (r.available) delete r.reason;
|
|
64
|
+
const context = num(extra.limit?.context); if (context !== undefined) r.context = context;
|
|
65
|
+
const output = num(extra.limit?.output); if (output !== undefined) r.output = output;
|
|
66
|
+
const ci = num(extra.cost?.input); const co = num(extra.cost?.output);
|
|
67
|
+
if (ci !== undefined || co !== undefined) r.cost = { input: ci ?? null, output: co ?? null };
|
|
68
|
+
if (typeof extra.reasoning === 'boolean') r.reasoning = extra.reasoning;
|
|
69
|
+
const v = isDict(extra.variants) ? Object.keys(extra.variants) : Array.isArray(extra.variants) ? extra.variants.filter((x) => typeof x === 'string') : null;
|
|
70
|
+
if (v && v.length) r.variants = v;
|
|
71
|
+
return r;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Fill what a row lacks from a catalogue model of the same id; never overwrite what the config said. */
|
|
75
|
+
function enrich(r, cat) {
|
|
76
|
+
if (!isDict(cat)) return r;
|
|
77
|
+
const from = row(r.id, {}, cat);
|
|
78
|
+
for (const k of ['context', 'output', 'cost', 'reasoning', 'variants']) if (r[k] === undefined && from[k] !== undefined) r[k] = from[k];
|
|
79
|
+
return r;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function readJson(p) {
|
|
83
|
+
try { const d = JSON.parse(readText(p)); return isDict(d) ? d : null; } catch { return null; }
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** `GET url` on loopback, no header at all, `PROBE_MS`; the parsed body or null. */
|
|
87
|
+
async function probe(fetchFn, url) {
|
|
88
|
+
try {
|
|
89
|
+
const res = await fetchFn(url, { signal: AbortSignal.timeout(PROBE_MS), redirect: 'error' });
|
|
90
|
+
if (!res || !res.ok) return null;
|
|
91
|
+
return await res.json();
|
|
92
|
+
} catch { return null; }
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** `{ name, ids }` of the local runtime, `ids` null when it does not answer. */
|
|
96
|
+
async function localRuntime(fetchFn, which) {
|
|
97
|
+
if (which === 'ollama') {
|
|
98
|
+
const d = await probe(fetchFn, 'http://127.0.0.1:11434/api/tags');
|
|
99
|
+
const ids = Array.isArray(d?.models) ? d.models.map((m) => text(m?.name) ?? text(m?.model)).filter(Boolean) : null;
|
|
100
|
+
return { id: 'ollama', name: 'Ollama', ids };
|
|
101
|
+
}
|
|
102
|
+
let d = await probe(fetchFn, 'http://127.0.0.1:1234/api/v1/models');
|
|
103
|
+
if (!d) d = await probe(fetchFn, 'http://127.0.0.1:1234/api/v0/models');
|
|
104
|
+
const list = Array.isArray(d?.models) ? d.models : Array.isArray(d?.data) ? d.data : null;
|
|
105
|
+
const ids = list ? list.filter((m) => !/embed/i.test(String(m?.type ?? ''))).map((m) => text(m?.key) ?? text(m?.id)).filter(Boolean) : null;
|
|
106
|
+
return { id: 'lmstudio', name: 'LM Studio', ids };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Both local runtimes, probed together. */
|
|
110
|
+
const localRuntimes = (fetchFn) => Promise.all([localRuntime(fetchFn, 'ollama'), localRuntime(fetchFn, 'lmstudio')]);
|
|
111
|
+
|
|
112
|
+
// ---- OpenCode ------------------------------------------------------------------------------------
|
|
113
|
+
|
|
114
|
+
const xdg = (env, home, name, dflt) => env[name] || path.join(home, dflt);
|
|
115
|
+
|
|
116
|
+
/** The opencode config files that apply: the user's, then the project's. Order is merge order. */
|
|
117
|
+
function opencodeConfigFiles({ host, scope, root, dir, env, home }) {
|
|
118
|
+
const dirs = [];
|
|
119
|
+
const add = (d) => { if (d && !dirs.includes(d)) dirs.push(d); };
|
|
120
|
+
add(env.OPENCODE_CONFIG_DIR);
|
|
121
|
+
add(path.join(xdg(env, home, 'XDG_CONFIG_HOME', '.config'), 'opencode'));
|
|
122
|
+
const projectDirs = scope === 'project' ? [root, path.join(root, '.opencode')] : [];
|
|
123
|
+
if (scope === 'global' && host === 'opencode') add(dir);
|
|
124
|
+
return [...dirs, ...projectDirs].flatMap((d) => [path.join(d, 'opencode.json'), path.join(d, 'opencode.jsonc')]);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A whole-string `{env:X}` reference resolved against the env; a URL is not a secret. Anything else as written. */
|
|
128
|
+
const envRef = (v, env) => {
|
|
129
|
+
const m = typeof v === 'string' ? /^\{env:([A-Za-z_][A-Za-z0-9_]*)\}$/.exec(v) : null;
|
|
130
|
+
return m ? text(env[m[1]]) : v;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* The custom providers the OpenCode configs define (`provider` V1, `providers` V2), the two
|
|
135
|
+
* `*_providers` lists and the files read. Of `options` only `baseURL` is read; a key may sit beside it.
|
|
136
|
+
*/
|
|
137
|
+
export function readOpencodeConfig(ctx) {
|
|
138
|
+
const providers = new Map();
|
|
139
|
+
let enabled = null;
|
|
140
|
+
const disabled = new Set();
|
|
141
|
+
const files = [];
|
|
142
|
+
for (const f of opencodeConfigFiles(ctx)) {
|
|
143
|
+
const { state, data } = loadJsonObject(f);
|
|
144
|
+
if (state !== 'ok') continue;
|
|
145
|
+
files.push(f);
|
|
146
|
+
for (const key of ['provider', 'providers']) {
|
|
147
|
+
if (!isDict(data[key])) continue;
|
|
148
|
+
for (const [id, p] of Object.entries(data[key])) {
|
|
149
|
+
if (id === '__proto__' || !isDict(p)) continue;
|
|
150
|
+
const baseURL = envRef(text(p.options?.baseURL) ?? text(p.options?.baseUrl) ?? text(p.baseURL), ctx.env);
|
|
151
|
+
providers.set(id, { id, name: text(p.name) ?? id, baseURL, models: isDict(p.models) ? p.models : {}, file: path.basename(f) });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (Array.isArray(data.enabled_providers)) enabled = new Set(data.enabled_providers.filter((x) => typeof x === 'string'));
|
|
155
|
+
if (Array.isArray(data.disabled_providers)) for (const x of data.disabled_providers) if (typeof x === 'string') disabled.add(x);
|
|
156
|
+
}
|
|
157
|
+
for (const id of [...providers.keys()]) if (disabled.has(id) || (enabled && !enabled.has(id))) providers.delete(id);
|
|
158
|
+
return { providers, enabled, disabled, files };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async function opencodeModels(ctx, add, group) {
|
|
162
|
+
const { env, home, fetchFn } = ctx;
|
|
163
|
+
const cfg = readOpencodeConfig(ctx);
|
|
164
|
+
const catFile = env.OPENCODE_MODELS_PATH || path.join(xdg(env, home, 'XDG_CACHE_HOME', '.cache'), 'opencode', 'models.json');
|
|
165
|
+
const catalogue = isFile(catFile) ? readJson(catFile) : null;
|
|
166
|
+
for (const p of cfg.providers.values()) {
|
|
167
|
+
const note = `configured in ${p.file}`;
|
|
168
|
+
group({ provider: p.id, providerName: p.name, source: 'config', note, local: false });
|
|
169
|
+
for (const [mid, m] of Object.entries(p.models)) {
|
|
170
|
+
if (mid === '__proto__') continue;
|
|
171
|
+
const r = row(`${p.id}/${mid}`, { provider: p.id, providerName: p.name, source: 'config', note, local: false }, { name: mid, ...(isDict(m) ? m : {}) });
|
|
172
|
+
add(enrich(r, catalogue?.[p.id]?.models?.[mid]));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (catalogue) {
|
|
176
|
+
const auth = readJson(path.join(xdg(env, home, 'XDG_DATA_HOME', '.local/share'), 'opencode', 'auth.json'));
|
|
177
|
+
for (const [pid, p] of Object.entries(catalogue)) {
|
|
178
|
+
if (pid === '__proto__' || !isDict(p) || cfg.providers.has(pid) || cfg.disabled.has(pid)) continue;
|
|
179
|
+
if (cfg.enabled && !cfg.enabled.has(pid)) continue;
|
|
180
|
+
const saved = !!auth && Object.hasOwn(auth, pid);
|
|
181
|
+
const envKey = Array.isArray(p.env) && p.env.some((n) => typeof n === 'string' && String(env[n] ?? '').trim());
|
|
182
|
+
if (!saved && !envKey) continue;
|
|
183
|
+
const note = `catalogue · ${saved ? 'credentials saved' : 'key found'}`;
|
|
184
|
+
const name = text(p.name) ?? pid;
|
|
185
|
+
group({ provider: pid, providerName: name, source: 'catalogue', note, local: false });
|
|
186
|
+
for (const [mid, m] of Object.entries(isDict(p.models) ? p.models : {})) {
|
|
187
|
+
if (!isDict(m) || m.status === 'alpha' || m.status === 'deprecated') continue;
|
|
188
|
+
add(row(`${pid}/${mid}`, { provider: pid, providerName: name, source: 'catalogue', note, local: false }, { name: mid, ...m }));
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
for (const rt of await localRuntimes(fetchFn)) {
|
|
193
|
+
if (cfg.disabled.has(rt.id)) continue;
|
|
194
|
+
const up = rt.ids !== null;
|
|
195
|
+
group({ provider: rt.id, providerName: rt.name, source: 'local', note: up ? 'local · running' : 'local · not running', local: true, available: up, ...(up ? {} : { reason: `${rt.name} not running` }) });
|
|
196
|
+
for (const id of rt.ids ?? []) add(row(`${rt.id}/${id}`, { provider: rt.id, providerName: rt.name, source: 'local', note: 'local · running', local: true }, { name: id }));
|
|
197
|
+
}
|
|
198
|
+
return cfg;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// ---- OpenClaude ----------------------------------------------------------------------------------
|
|
202
|
+
|
|
203
|
+
const on = (v) => { const s = String(v ?? '').trim().toLowerCase(); return s !== '' && s !== '0' && s !== 'false'; };
|
|
204
|
+
const PROFILE_KEYS = ['CLAUDE_CODE_USE_OPENAI', 'CLAUDE_CODE_USE_GEMINI', 'CLAUDE_CODE_USE_MISTRAL', 'OPENAI_BASE_URL', 'OPENAI_MODEL', 'GEMINI_MODEL', 'MISTRAL_MODEL'];
|
|
205
|
+
const KEY_VARS = ['OPENAI_API_KEY', 'GEMINI_API_KEY', 'GOOGLE_API_KEY', 'MISTRAL_API_KEY'];
|
|
206
|
+
|
|
207
|
+
/** The active OpenClaude provider: env first, then `.openclaude-profile.json`, then `.openclaude.json`. */
|
|
208
|
+
function openclaudeActive({ env, home }) {
|
|
209
|
+
const configHome = env.OPENCLAUDE_CONFIG_DIR || path.join(home, '.openclaude');
|
|
210
|
+
const pf = readJson(path.join(configHome, '.openclaude-profile.json'));
|
|
211
|
+
const fileEnv = isDict(pf?.env) ? pf.env : {};
|
|
212
|
+
// Named keys only; the secrets that file holds stay where they are, reduced to one boolean.
|
|
213
|
+
const get = (k) => (text(env[k]) ?? text(fileEnv[k]));
|
|
214
|
+
const settled = Object.fromEntries(PROFILE_KEYS.map((k) => [k, get(k)]));
|
|
215
|
+
const prof = readJson(path.join(env.OPENCLAUDE_CONFIG_DIR || home, '.openclaude.json'));
|
|
216
|
+
const entry = Array.isArray(prof?.providerProfiles)
|
|
217
|
+
? prof.providerProfiles.find((p) => isDict(p) && p.id === prof.activeProviderProfileId) : null;
|
|
218
|
+
const flag = on(settled.CLAUDE_CODE_USE_OPENAI) ? 'openai' : on(settled.CLAUDE_CODE_USE_GEMINI) ? 'gemini'
|
|
219
|
+
: on(settled.CLAUDE_CODE_USE_MISTRAL) ? 'mistral' : null;
|
|
220
|
+
const kind = flag ?? (text(entry?.provider) && entry.provider !== 'anthropic' ? entry.provider : null);
|
|
221
|
+
const modelVar = { openai: 'OPENAI_MODEL', gemini: 'GEMINI_MODEL', mistral: 'MISTRAL_MODEL' }[flag];
|
|
222
|
+
return {
|
|
223
|
+
configHome, kind, anthropic: kind === null,
|
|
224
|
+
model: (modelVar ? settled[modelVar] : null) ?? text(entry?.model) ?? null,
|
|
225
|
+
baseUrl: settled.OPENAI_BASE_URL ?? text(entry?.baseUrl) ?? null,
|
|
226
|
+
hasKey: KEY_VARS.some((k) => !!get(k)) || !!entry?.apiKey,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
async function openclaudeModels(ctx, add, group) {
|
|
231
|
+
const { fetchFn, dir } = ctx;
|
|
232
|
+
const a = openclaudeActive(ctx);
|
|
233
|
+
// The company's own names: the OpenCode custom provider on the same endpoint (never called).
|
|
234
|
+
const want = normalizeUrl(a.baseUrl);
|
|
235
|
+
if (want) {
|
|
236
|
+
for (const p of readOpencodeConfig(ctx).providers.values()) {
|
|
237
|
+
if (normalizeUrl(p.baseURL) !== want) continue;
|
|
238
|
+
const note = `same endpoint as OpenCode provider ${p.id}`;
|
|
239
|
+
group({ provider: p.id, providerName: p.name, source: 'config', note, local: false });
|
|
240
|
+
for (const [mid, m] of Object.entries(p.models)) {
|
|
241
|
+
if (mid !== '__proto__') add(row(mid, { provider: p.id, providerName: p.name, source: 'config', note, local: false }, isDict(m) ? m : {}));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (a.model) {
|
|
246
|
+
const p = a.kind ?? 'provider';
|
|
247
|
+
group({ provider: p, providerName: a.kind ?? 'Active provider', source: 'provider', note: 'active provider', local: false });
|
|
248
|
+
add(row(a.model, { provider: p, providerName: a.kind ?? 'Active provider', source: 'provider', note: 'active provider', local: isLocalUrl(a.baseUrl), available: a.hasKey || isLocalUrl(a.baseUrl), reason: 'no key found' }));
|
|
249
|
+
}
|
|
250
|
+
if (isLocalUrl(a.baseUrl)) {
|
|
251
|
+
for (const rt of await localRuntimes(fetchFn)) {
|
|
252
|
+
const up = rt.ids !== null;
|
|
253
|
+
group({ provider: rt.id, providerName: rt.name, source: 'local', note: up ? 'local · running' : 'local · not running', local: true, available: up, ...(up ? {} : { reason: `${rt.name} not running` }) });
|
|
254
|
+
for (const id of rt.ids ?? []) add(row(id, { provider: rt.id, providerName: rt.name, source: 'local', note: 'local · running', local: true }));
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
const seen = new Set();
|
|
258
|
+
for (const d of [a.configHome, dir]) {
|
|
259
|
+
if (!d || seen.has(d)) continue;
|
|
260
|
+
seen.add(d);
|
|
261
|
+
const { state, data } = loadJsonObject(path.join(d, 'settings.json'));
|
|
262
|
+
if (state !== 'ok' || !isDict(data.agentModels)) continue;
|
|
263
|
+
group({ provider: 'route', providerName: 'Routes', source: 'route', note: 'route', local: false });
|
|
264
|
+
for (const k of Object.keys(data.agentModels)) {
|
|
265
|
+
if (k !== '__proto__') add(row(k, { provider: 'route', providerName: 'Routes', source: 'route', note: 'route', local: false }));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
if (a.anthropic) {
|
|
269
|
+
group({ provider: 'anthropic', providerName: 'Anthropic aliases', source: 'alias', note: 'Anthropic aliases', local: false });
|
|
270
|
+
for (const [id, name] of [...CLAUDE_ALIASES.slice(0, 3)]) add(row(id, { provider: 'anthropic', providerName: 'Anthropic aliases', source: 'alias', note: 'Anthropic aliases', local: false }, { name }));
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// ---- Claude Code ---------------------------------------------------------------------------------
|
|
275
|
+
|
|
276
|
+
/** `availableModels` of the install's settings (local over shared), or null when none is set. */
|
|
277
|
+
function claudeAvailable({ dir }) {
|
|
278
|
+
let list = null;
|
|
279
|
+
for (const f of ['settings.json', 'settings.local.json']) {
|
|
280
|
+
const { state, data } = loadJsonObject(path.join(dir, f));
|
|
281
|
+
if (state === 'ok' && Array.isArray(data.availableModels)) list = data.availableModels.filter((x) => typeof x === 'string').map((x) => x.trim()).filter(Boolean);
|
|
282
|
+
}
|
|
283
|
+
return list;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** An alias is allowed by an entry that is the family, or a version/full id of it. */
|
|
287
|
+
const aliasAllowed = (alias, list) => list === null || list.map((x) => x.toLowerCase()).some((e) => e === alias || e.startsWith(`${alias}-`) || e.startsWith(`claude-${alias}`) || e.startsWith(`${alias}[`));
|
|
288
|
+
|
|
289
|
+
function claudeModels(ctx, add, group) {
|
|
290
|
+
const list = claudeAvailable(ctx);
|
|
291
|
+
const base = { provider: 'anthropic', providerName: 'Claude Code aliases', source: 'alias', note: list ? 'aliases allowed by availableModels' : 'Claude Code aliases', local: false };
|
|
292
|
+
group(base);
|
|
293
|
+
for (const [id, name] of CLAUDE_ALIASES) if (aliasAllowed(id, list)) add(row(id, base, { name }));
|
|
294
|
+
for (const e of list ?? []) {
|
|
295
|
+
const l = e.toLowerCase();
|
|
296
|
+
if (CLAUDE_ALIASES.some(([a]) => l === a || l.startsWith(`${a}-`) || l.startsWith(`claude-${a}`))) continue;
|
|
297
|
+
add(row(e, { ...base, note: 'availableModels' }));
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* `{ models, groups, notes }` for one install. `ctx`: `{ host, scope, dir, root, inUse?, env?, home?,
|
|
303
|
+
* fetchFn? }`: `dir` the install's config dir, `inUse` the model ids its `agent-overrides.json` holds.
|
|
304
|
+
*/
|
|
305
|
+
export async function readModelCatalog(ctx0) {
|
|
306
|
+
const ctx = { env: process.env, home: os.homedir(), fetchFn: globalThis.fetch, inUse: [], ...ctx0 };
|
|
307
|
+
const models = [];
|
|
308
|
+
const ids = new Set();
|
|
309
|
+
const groups = [];
|
|
310
|
+
const add = (r) => { if (!ids.has(r.id)) { ids.add(r.id); models.push(r); } };
|
|
311
|
+
const group = (g) => { if (!groups.some((x) => x.provider === g.provider && x.note === g.note)) groups.push(g); };
|
|
312
|
+
group({ ...SESSION, note: 'inherit', local: false, available: true });
|
|
313
|
+
add({ id: 'inherit', name: 'Session model (inherit)', ...SESSION, note: 'inherit', local: false, available: true });
|
|
314
|
+
if (ctx.host === 'claude') claudeModels(ctx, add, group);
|
|
315
|
+
else if (ctx.host === 'opencode') await opencodeModels(ctx, add, group);
|
|
316
|
+
else if (ctx.host === 'openclaude') await openclaudeModels(ctx, add, group);
|
|
317
|
+
const listed = new Set(ids);
|
|
318
|
+
const inUse = [...new Set(ctx.inUse.filter((x) => typeof x === 'string' && x.trim()))];
|
|
319
|
+
if (inUse.length) group({ provider: 'in-use', providerName: 'In use', source: 'in-use', note: 'written in agent-overrides.json', local: false, available: true });
|
|
320
|
+
for (const id of inUse) {
|
|
321
|
+
models.push({ id, name: id, provider: 'in-use', providerName: 'In use', source: 'in-use', note: 'written in agent-overrides.json', local: false, available: true, detected: listed.has(id) });
|
|
322
|
+
}
|
|
323
|
+
return { models, groups };
|
|
324
|
+
}
|
package/js/web/routes.mjs
CHANGED
|
@@ -28,7 +28,7 @@ import { apiUsage } from './usage-api.mjs';
|
|
|
28
28
|
import { apiProfiles } from './profiles-api.mjs';
|
|
29
29
|
import { fleetSort } from './state.mjs';
|
|
30
30
|
import { apiGates } from './gates-api.mjs';
|
|
31
|
-
import { apiAgentModels, apiAgentModelsSave } from './agent-models-api.mjs';
|
|
31
|
+
import { apiAgentModels, apiAgentModelsFull, apiAgentModelsSave } from './agent-models-api.mjs';
|
|
32
32
|
import { migratePreview } from '../maintain/migrate.mjs';
|
|
33
33
|
import { apiProfile, apiProfileSave, apiRules, apiRulesDecide, apiRulesMutate, apiRulesPromote } from './user-files.mjs';
|
|
34
34
|
|
|
@@ -65,7 +65,7 @@ export const POST_ROUTES = new Map([
|
|
|
65
65
|
// ever consulted — the same shape as `/api/memory/delete` and `/api/activity` above.
|
|
66
66
|
['/api/loops/preset', [apiLoopsPresetMutate, false]],
|
|
67
67
|
['/api/autostart', [apiAutostart, true]],
|
|
68
|
-
// The `tiers` map and the per-agent model pins of one
|
|
68
|
+
// The `tiers` map and the per-agent model pins of one install's agent-overrides.json (any host but Bob).
|
|
69
69
|
['/api/agent-models', [apiAgentModelsSave, true]],
|
|
70
70
|
]);
|
|
71
71
|
|
|
@@ -232,7 +232,9 @@ export const STATE_ROUTES = {
|
|
|
232
232
|
// answers — a daemon whose POST worked and whose GET 501'd would have no way to obtain one.
|
|
233
233
|
'/api/rules': apiRules,
|
|
234
234
|
'/api/loadout': (state) => apiLoadout(state),
|
|
235
|
-
|
|
235
|
+
// `?models=0`: the per-agent view alone, for a page that does not list models (no probe of a runtime).
|
|
236
|
+
'/api/agent-models': (state, url = '') => (/[?&]models=0(&|$)/.test(String(url))
|
|
237
|
+
? apiAgentModels(state) : apiAgentModelsFull(state)),
|
|
236
238
|
'/api/mcp': apiMcp,
|
|
237
239
|
'/api/loops': apiLoops,
|
|
238
240
|
'/api/loops/active': apiLoopsActive,
|
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`, `exports` 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": "6.0.
|
|
4
|
+
"version": "6.0.3",
|
|
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",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## When to dispatch
|
|
6
6
|
- The {{MEMORY}} store needs tidying in bulk. The session context says so in one
|
|
7
|
-
line when a
|
|
7
|
+
line when a `misc` topic exists; or the user asks
|
|
8
8
|
to tidy, dedupe or re-topic their memory.
|
|
9
9
|
- `geneseed memory consolidate` reported duplicate descriptions that need a merge.
|
|
10
10
|
|
package/src/memory/README.md
CHANGED
|
@@ -87,9 +87,10 @@ memory that carries a `force`; revising one stays with the agent and the user.
|
|
|
87
87
|
`archive/` needs the user's consent ({{LAW:deletion-is-deliberate}}):
|
|
88
88
|
`geneseed memory list --archived`, then `geneseed memory rm <name> --archived --purge`.
|
|
89
89
|
`archive/` is part of this git-ignored store.
|
|
90
|
-
- When
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
- When facts sit in `misc` (no `topic:` and no `type:`), the session context says so in
|
|
91
|
+
one line; the memory-curator {{AGENT}} then assigns topics, merges and archives in
|
|
92
|
+
bulk, and proposes deletions for approval. The size of a topic never raises it: a large
|
|
93
|
+
store is read through its topic files, not curated for its size.
|
|
93
94
|
- Don't store what the repo already records (code structure, git history, the
|
|
94
95
|
{{LAWS}}, `user-rules.md`). Store what was *non-obvious*.
|
|
95
96
|
- When the same `feedback` lesson keeps recurring, propose promoting it into a
|
|
@@ -114,8 +115,26 @@ lowercase `[a-z0-9-]`. Both levels are generated from the fact files:
|
|
|
114
115
|
`geneseed memory consolidate --memory <this dir>` rebuilds them (refreshing each
|
|
115
116
|
hook from its `description`), and the `learn` hook rebuilds them after every fact it
|
|
116
117
|
writes, updates or archives. Only top-level fact files are indexed; `archive/` and
|
|
117
|
-
`agents/` never are.
|
|
118
|
-
|
|
118
|
+
`agents/` never are.
|
|
119
|
+
|
|
120
|
+
**A top-level file whose name is all capitals is a store document, not a fact:** `MEMORY.md`,
|
|
121
|
+
`README.md`, `ARCHIVE-INDEX.md`. It is never indexed, never filed under `misc`, never shown to
|
|
122
|
+
`learn`, and `geneseed memory rm` refuses it. Name a fact in lower case.
|
|
123
|
+
|
|
124
|
+
**A build moves a flat index to this layout, once, in every store it manages** — each install's
|
|
125
|
+
and the machine tier's. It keeps each pointer's own title and hook and
|
|
126
|
+
every other line of the old `MEMORY.md` (headings, prose, a pointer to a store document), and it
|
|
127
|
+
never touches a fact file. The hand-written headings that grouped the old fact lines now sit above
|
|
128
|
+
nothing; delete them once if they bother you.
|
|
129
|
+
|
|
130
|
+
**Rules the old index loaded every session become drafts.** A flat index was cut by position at
|
|
131
|
+
session start, so what sat in its first 3 072 characters loaded by accident. At the move, a
|
|
132
|
+
`feedback` fact whose line sat there, any fact with `force: constraint`, and a `feedback` fact whose
|
|
133
|
+
description says *always* or *never* (*toujours*, *jamais*) are written to `user-rules.draft.md`
|
|
134
|
+
(at most 30), exactly as the fold drafts a rule; `user-rules.md` is never written without your
|
|
135
|
+
decision. Until you approve or reject a draft in the console or with the rule {{SKILL}}, its fact
|
|
136
|
+
keeps loading at session start, in a slot of at most 1 800 characters under the map; a decided
|
|
137
|
+
draft leaves it. A second build drafts nothing new.
|
|
119
138
|
|
|
120
139
|
## Per-{{AGENT}} memory (`agents/` subdirectory)
|
|
121
140
|
|
|
@@ -52,7 +52,9 @@ The lines under the pointer are the rule as it stands, with its own metadata lin
|
|
|
52
52
|
blocks after it. This line is a record: leave every `R<n>` citation in the facts as it is.
|
|
53
53
|
6. Delete the block.
|
|
54
54
|
|
|
55
|
-
Leave the host file alone. The next fold of that host removes the rule from it.
|
|
55
|
+
Leave the host file alone. The next fold of that host removes the rule from it. A block from host
|
|
56
|
+
`memory` is a fact of the store the build migrated: its `source` is the fact file, and nothing
|
|
57
|
+
removes the fact. Either decision ends the fact's loading under the memory map at session start.
|
|
56
58
|
- **Reject** means "keep it on this host only". Set the row's `state` to `rejected`, and delete
|
|
57
59
|
the block. The rule stays in the host file, and the fold never drafts it again.
|
|
58
60
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# {{SKILL}}: rule — consolidation flow
|
|
2
2
|
|
|
3
3
|
Tends the {{MEMORY}} set as a whole. A store too large for one careful read (a
|
|
4
|
-
topic over 40 facts, or a `misc` topic)
|
|
4
|
+
topic over 40 facts, or a `misc` topic) may go to the memory-curator {{AGENT}}
|
|
5
5
|
instead: it runs this flow topic by topic in its own context and also assigns topics.
|
|
6
6
|
|
|
7
7
|
1. **Read the whole set once**: `MEMORY.md`, its `topics/` files, every fact they
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./DataTable-b9zTShqJ.js";var i=e(t(),1),a={x:260,y:190},o=110,s=28,c=14,l=44,u=e=>e*Math.PI/180,d=e=>Math.round(e*10)/10,f=(e,t=o,n=a)=>({x:d(n.x+t*Math.cos(u(e))),y:d(n.y+t*Math.sin(u(e)))}),p=e=>e/o*(180/Math.PI)+3,m=(e,t,n,r=0)=>`M${t.x},${t.y} A${e},${e} 0 ${r} 1 ${n.x},${n.y}`,h=d(f(205).x-6),g=e=>e.length*6.4,_=e=>({x:e.x-g(e.name)/2,y:e.y-7,w:g(e.name),h:14}),v=(e,t)=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h,y=(e,t)=>e.some((n,r)=>[...e.slice(r+1),...t.filter(e=>!e.gate)].some(e=>v(_(n),_(e))));function b(e){return e?.gate===`human`?e.gateOn?.length?`Human gate on ${e.gateOn.join(`, `)}`:`Human gate`:null}function x(e,t=[]){let n=S(e,t,0);if(n.mode!==`ring`)return n;let r=Math.min(...n.entry.map(e=>e.y-30),...n.nodes.map(e=>e.y-e.r-12),...n.inner.map(e=>e.cy-e.r-12),...n.exit?[n.exit.y-24]:[]);return r<0?S(e,t,Math.ceil(-r)):n}function S(e,t,n){let r={x:a.x,y:a.y+n},i=(e,t=o)=>f(e,t,r),u=e=>t.find(t=>t.name===e),h=e=>u(e)?.effect??null,_=e=>b(u(e)),v=e.loops||[],x=v.find(e=>e.iteration);if(!x||x.nodes.length>8)return C(e,h,_);let S=Math.max(...e.nodes.map(e=>v.filter(t=>t.nodes.includes(e)).length)),w=v.filter(e=>e!==x);if(S>3||w.some(e=>!e.nodes.every(e=>x.nodes.includes(e))))return C(e,h,_);let T=x.nodes[0],E=new Set(e.edges.filter(e=>e.to===T).map(e=>e.from)),D=new Map;for(let e of[...w].sort((e,t)=>e.nodes.length-t.nodes.length))for(let t of e.nodes.slice(1))t!==T&&!E.has(t)&&!D.has(t)&&D.set(t,e);let O=x.nodes.filter(e=>!D.has(e));if(O.length<2||w.some(e=>D.has(e.nodes[0])))return C(e,h,_);let k=360/O.length,A=O.map((e,t)=>({name:e,a:-90+t*k,r:s})),j=A.findIndex(e=>h(e.name)===`mutate`);j>=0&&A.splice(j,0,{name:`validate`,a:A[j].a-k/2,r:c,gate:!0});let M=A.map(e=>({name:e.name,...i(e.a),r:e.r,effect:e.gate?null:h(e.name),gate:!!e.gate,inner:!1,human:e.gate?null:_(e.name)})),N=A.map((e,t)=>{let n=A[(t+1)%A.length],r=(t+1===A.length?n.a+360:n.a)-p(n.r)-2,a=e.a+p(e.r);return{d:m(o,i(a),i(r),+(r-a>180)),kind:`ring`}}),P=[],F=new Map;for(let e of w)F.set(e.nodes[0],[...F.get(e.nodes[0])||[],e]);for(let[e,t]of F){let n=A.find(t=>t.name===e),r=i(n.a),c=t.length>1;t.sort((e,t)=>e.nodes.length-t.nodes.length).forEach((e,t)=>{let u=i(n.a+(c?t?18:-18:0),o+(c?54:44)),p=Math.atan2(u.y-r.y,u.x-r.x)*(180/Math.PI),g=e.nodes.filter(t=>D.get(t)===e),v=e=>g.map((t,n)=>({name:t,...f(p+(n-(g.length-1)/2)*e,l,u)})),b=105;for(;b<150&&y(v(b),M);)b+=5;v(b).forEach(({name:e,...t})=>{M.push({name:e,...t,r:s,effect:h(e),gate:!1,inner:!0,human:_(e)})});let x=p+180;N.push({d:m(l,f(x+42,l,u),f(x+138,l,u)),kind:`inner`}),N.push({d:m(l,f(x+222,l,u),f(x+318,l,u)),kind:`inner`});let S=`${e.nodes.join(e.nodes.length===2?` ⇄ `:` → `)} · max ${e.max}`,C={lx:u.x,ly:u.y+l+20,anchor:`middle`};if(c){let e=u.x>=a.x,t=Math.max(l,...g.map(e=>{let t=M.find(t=>t.name===e);return Math.abs(t.x-u.x)+s}));C={lx:d(u.x+(e?t+8:-t-8)),ly:d(u.y+4),anchor:e?`start`:`end`}}P.push({loop:e.name,cx:u.x,cy:u.y,r:l,label:S,...C})})}let I=i(205).y,L=e.nodes.filter(e=>!x.nodes.includes(e)),R=L.map((e,t)=>({name:e,x:40,y:d(I-44*(L.length-1-t)),human:_(e)})),z=e.edges.find(e=>e.to===`$close`)?.from,B=M.find(e=>e.name===z),V=B?{from:z,x:B.x+200,y:B.y-30,d:`M${B.x+s},${B.y-6} C${B.x+90},${B.y-40} ${B.x+170},${B.y-40} ${B.x+200},${B.y-30}`}:null,H=Math.max(540,...M.map(e=>e.x+e.r+8),...V?[V.x+6+g(`close`)+8]:[],...P.map(e=>e.cx+e.r+8),...P.map(e=>e.anchor===`start`?e.lx+g(e.label)+8:e.lx+g(e.label)/2+8)),U=Math.max(300,...M.map(e=>e.y+e.r+12),...P.map(e=>Math.max(e.cy+e.r,e.ly)+12));return{mode:`ring`,width:Math.ceil(H),height:Math.ceil(U),center:{x:r.x,y:r.y,r:o},nodes:M,arcs:N,inner:P,entry:R,exit:V}}function C(e,t,n){let r=e.loops||[],i=e=>36+16*r.filter(t=>t!==e&&t.nodes.every(t=>e.nodes.includes(t))).length,a=Math.max(s,...r.map(i))+30,o=new Map(e.nodes.map((e,t)=>[e,60+t*100])),c=e.nodes.map(e=>({name:e,x:o.get(e),y:a,r:s,effect:t(e),gate:!1,inner:!1,human:n(e)})),l=e.nodes.slice(1).map((t,n)=>({d:`M${o.get(e.nodes[n])+s},${a} L${o.get(t)-s-4},${a}`,kind:`flow`})),u=r.map(e=>{let t=i(e),n=Math.min(...e.nodes.map(e=>o.get(e))),r=Math.max(...e.nodes.map(e=>o.get(e))),s={x:n-t,y:a-t,w:r-n+2*t,h:2*t};return l.push({d:`M${r},${s.y+s.h} L${n+4},${s.y+s.h}`,kind:`flow`}),{loop:e.name,label:`${e.name} · max ${e.max}`,box:s}});return{mode:`flow`,width:60+e.nodes.length*100,height:2*a,center:null,nodes:c,arcs:l,inner:u,entry:[],exit:null}}var w=n();function T({x:e,y:t,label:n}){return(0,w.jsxs)(`g`,{className:`lr-human`,children:[(0,w.jsx)(`title`,{children:n}),(0,w.jsx)(`circle`,{cx:e,cy:t,r:`9`}),(0,w.jsx)(`circle`,{cx:e,cy:t-2.4,r:`2.6`,className:`lr-human-fig`}),(0,w.jsx)(`path`,{d:`M${e-4.6},${t+5.6} a4.6,4.6 0 0 1 9.2,0 Z`,className:`lr-human-fig`})]})}function E({graph:e,bricks:t,onSelect:n,highlight:r}){let i=x(e,t),a=(e.loops||[]).find(e=>e.iteration),o=e=>`${e.name} brick${e.human?`, ${e.human.toLowerCase()}`:``}`,s=e=>t=>{(t.type===`click`||t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n?.(e))};return(0,w.jsxs)(`svg`,{className:`loop-ring`,viewBox:`0 0 ${i.width} ${i.height}`,style:{"--loop-w":`${i.width}px`},role:`group`,"aria-label":`${e.name} loop: ${e.nodes.join(`, `)}`,children:[(0,w.jsx)(`defs`,{children:[`ring`,`inner`,`flow`].map(e=>(0,w.jsx)(`marker`,{id:`lr-arrow-${e}`,markerWidth:`10`,markerHeight:`10`,refX:`7`,refY:`4`,orient:`auto`,children:(0,w.jsx)(`path`,{d:`M0,0 L8,4 L0,8 Z`,className:`lr-head-${e}`})},e))}),i.mode===`ring`&&i.inner.map(e=>(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`circle`,{cx:e.cx,cy:e.cy,r:e.r,className:`lr-inner`}),(0,w.jsx)(`text`,{x:e.lx,y:e.ly,textAnchor:e.anchor,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.mode===`flow`&&i.inner.map(e=>(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`rect`,{x:e.box.x,y:e.box.y,width:e.box.w,height:e.box.h,rx:`14`,className:`lr-box`}),(0,w.jsx)(`text`,{x:e.box.x+10,y:e.box.y-6,className:`lr-sub lr-good`,children:e.label})]},e.loop)),i.arcs.map((e,t)=>(0,w.jsx)(`path`,{d:e.d,className:`lr-${e.kind}`,markerEnd:`url(#lr-arrow-${e.kind})`},t)),i.entry.length>0&&(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`path`,{d:`M40,${i.entry.at(-1).y} L${h},${i.entry.at(-1).y}`,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),i.entry.map(e=>(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`text`,{x:e.x,y:e.y-10,className:`lr-lbl`,children:e.name}),(0,w.jsx)(`text`,{x:e.x,y:e.y+18,className:`lr-sub`,children:`setup · 1×`}),e.human?(0,w.jsx)(T,{x:e.x-14,y:e.y-14,label:e.human}):null]},e.name))]}),i.nodes.map(e=>e.gate?(0,w.jsxs)(`g`,{className:`lr-gate`,children:[(0,w.jsx)(`title`,{children:`validate — the engine scores the change before the first mutate step`}),(0,w.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,w.jsx)(`text`,{x:e.x,y:e.y+5,textAnchor:`middle`,children:`⛨`}),(0,w.jsx)(`text`,{x:e.x+20,y:e.y-10,className:`lr-sub lr-warn`,children:`validate`})]},e.name):(0,w.jsxs)(`g`,{className:`lr-node${e.inner?` inner`:``}${e.effect===`mutate`?` mutate`:``}${e.name===r?` current`:``}`,"aria-current":e.name===r?`step`:void 0,...n?{role:`button`,tabIndex:0,"aria-label":o(e),onClick:s(e.name),onKeyDown:s(e.name)}:{role:`img`,"aria-label":`${o(e)}${e.name===r?`, current step`:``}`},children:[(0,w.jsx)(`circle`,{cx:e.x,cy:e.y,r:e.r}),(0,w.jsx)(`text`,{x:e.x,y:e.y+4,textAnchor:`middle`,children:e.name}),e.human?(0,w.jsx)(T,{x:e.x+e.r*.74,y:e.y-e.r*.74,label:e.human}):null]},e.name)),i.exit&&(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`path`,{d:i.exit.d,className:`lr-flow`,markerEnd:`url(#lr-arrow-flow)`}),(0,w.jsx)(`text`,{x:i.exit.x+6,y:i.exit.y+4,className:`lr-lbl`,children:`close`}),(0,w.jsx)(`text`,{x:i.exit.x-90,y:i.exit.y-10,textAnchor:`middle`,className:`lr-sub`,children:`done`})]}),i.center&&a&&(0,w.jsxs)(`g`,{children:[(0,w.jsx)(`text`,{x:i.center.x,y:i.center.y-4,textAnchor:`middle`,className:`lr-title`,children:e.name}),(0,w.jsxs)(`text`,{x:i.center.x,y:i.center.y+16,textAnchor:`middle`,className:`lr-sub lr-acc`,children:[`iterations · max `,a.max]})]})]})}var D=[`prudent`,`balanced`,`aggressive`],O={running:`acc`,awaiting:`warn`,unreadable:`bad`},k=e=>!!e.graph,A=e=>({key:e,label:e,align:`right`,render:t=>(0,w.jsx)(`span`,{className:`num`,children:t[e]})}),j=[A(`iteration`),{key:`intent`,label:`intent`},A(`declared`),A(`actual`),{key:`decision`,label:`decision`},{key:`tests`,label:`tests`}];function M({history:e}){return e.length?(0,w.jsx)(`div`,{className:`loop-history`,children:(0,w.jsx)(r,{caption:`Iterations`,captionHidden:!0,columns:j,rows:e,rowKey:e=>e.iteration})}):(0,w.jsx)(`p`,{className:`panel-note`,children:`No iteration finished yet.`})}function N({loop:e,bricks:t,onPreset:n}){let r=k(e)?(e.graph.loops||[]).find(e=>e.iteration):null,[a,o]=(0,i.useState)(!1);return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`reader-tags`,children:[(0,w.jsx)(`span`,{className:`tag acc`,children:`Active loop`}),(0,w.jsx)(`span`,{className:`tag${O[e.status]?` ${O[e.status]}`:``}`,children:e.status})]}),(0,w.jsx)(`h2`,{className:`reader-title`,children:e.title}),(0,w.jsxs)(`p`,{className:`mono dim reader-src`,children:[e.branch,` · `,e.root]}),k(e)?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`p`,{className:`reader-lede`,children:[`Iteration `,e.iteration,r?` / ${r.max}`:``,` · at `,e.node]}),e.awaiting?(0,w.jsxs)(`p`,{className:`loop-run-wait t-warn`,children:[(0,w.jsxs)(`b`,{children:[`Awaiting `,e.awaiting.kind,e.awaiting.kind===`gate`?` at ${e.awaiting.node}`:``]}),` `,`— Answer in the agent's session.`]}):null,(0,w.jsxs)(`label`,{className:`panel-note loop-run-preset`,children:[`preset`,(0,w.jsx)(`select`,{className:`sel`,"aria-label":`Preset for ${e.title}`,value:e.preset,disabled:a,onChange:t=>{o(!0),Promise.resolve(n(e.root,t.target.value)).finally(()=>o(!1))},children:D.map(e=>(0,w.jsx)(`option`,{children:e},e))})]}),(0,w.jsx)(`a`,{href:`#/docs/loop-risk`,children:`What presets mean →`}),(0,w.jsx)(`hr`,{className:`hr`}),(0,w.jsx)(`div`,{className:`loop-graph`,children:(0,w.jsx)(E,{graph:e.graph,bricks:t,highlight:e.node})}),(0,w.jsx)(`h3`,{className:`loop-h2`,children:`Iterations`}),(0,w.jsx)(M,{history:e.history})]}):(0,w.jsx)(`p`,{className:`reader-lede`,children:e.status===`unreadable`?`Its LOOP.md cannot be read, so there is no state to show.`:`Its LOOP.md is gone: the loop closed and its state went with it.`})]})}export{E as a,T as i,O as n,b as o,k as r,x as s,N as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{A as i,At as a,Ct as o,D as s,E as c,F as l,H as u,L as d,M as f,N as p,O as m,Ot as h,P as g,T as _,bt as ee,et as te,it as ne,j as v,o as re,tt as y,w as b,xt as ie}from"./index-BILaKHbH.js";import{t as x}from"./EmptyState-CY5Pm2xy.js";import{_ as S,a as ae,c as C,f as w,g as T,h as E,i as D,l as O,m as k,n as A,o as j,p as M,r as N,s as P,t as F,u as I,v as L}from"./Bonsai-BoKo68Kw.js";import{s as oe}from"./motion-RlUl1osO.js";var R=e(t(),1),z=n(),B=4,V=56*B,H=24,U=165,W=188,G=(e,t)=>e>0?Math.max(1,Math.floor((e-32+H)/(V+H))):Math.max(1,t),K=e=>e.status===`blocked`?`bad`:f(e)?`warn`:e.status===`busy`?`ok`:``,q=e=>{let t=O(e);return t==null?null:Math.round(t*100)};function J(e,t,n){let r=b[e.status]||b.idle,i=t.pads.filter(e=>e.key!=null),a=t.pads.reduce((e,t)=>e+t.files.length,0)+t.fallen.reduce((e,t)=>e+t.files.length,0),o=q(e);return[`${e.title||m(e.cwd)||e.session_id}, ${e.chip||e.host||`unknown host`}, ${r.label}${e.phase?`, ${e.phase}`:``}`,`${e.turns||0} turns${o==null?``:`, context ${o} %`}${e.compactions?`, ${e.compactions} compactions`:``}`,i.length?`${i.length} sub-agent${i.length===1?``:`s`} running: ${i.map(e=>`${e.type||`agent`} (${e.files.length} file${e.files.length===1?``:`s`})`).join(`, `)}`:``,t.fallen.length?`${t.fallen.length} finished`:``,`${a} file${a===1?``:`s`} changed`,n.length?`shares ${n.length} file${n.length===1?``:`s`} with another session`:``,e.error?`error: ${e.error}`:``].filter(Boolean).join(`. `)}function Y({s:e,t,mine:n}){let r=q(e);return(0,z.jsxs)(`div`,{className:`card gd-card`,children:[(0,z.jsxs)(`dl`,{className:`gd-facts`,children:[e.model&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{children:`model`}),(0,z.jsx)(`dd`,{className:`mono`,children:e.model})]}),(0,z.jsx)(`dt`,{children:`turns`}),(0,z.jsx)(`dd`,{children:e.turns||0}),(0,z.jsx)(`dt`,{children:`context`}),(0,z.jsx)(`dd`,{children:r==null?`unknown`:`${r} %`}),(0,z.jsx)(`dt`,{children:`compactions`}),(0,z.jsx)(`dd`,{children:e.compactions||0})]}),t.fallen.length>0&&(0,z.jsxs)(`div`,{className:`dim act-xs`,children:[`finished: `,t.fallen.map(e=>`${e.type||`agent`} (${e.files.length})`).join(`, `)]}),n.map(e=>(0,z.jsxs)(`div`,{className:`act-xs ${e.kind===`same-worktree`?`t-bad`:`t-warn`}`,children:[`same file`,e.kind===`same-worktree`?``:`, other worktree`,`: `,e.path]},`${e.kind}:${e.path}`))]})}function X({s:e,worktree:t,sakura:n,mine:r,pad:i,onHover:a}){let o=L(e,n),s=(0,R.useMemo)(()=>w(e,{sakura:n}),[o]),c=b[e.status]||b.idle,l=Array.isArray(e.loops)?e.loops[0]:null,u=e.status!==`idle`,d=P(e),p=e.title||m(e.cwd)||e.session_id,h=q(e),g=(0,R.useRef)(null),_=(0,R.useCallback)(e=>a(d,e,Z(g.current)),[a,d]);return(0,z.jsxs)(`a`,{ref:g,className:`gd-tree${f(e)?` gd-needs`:``}`,href:e.href||I(e.session_id),"aria-label":J(e,s,r),"data-sid":e.session_id,onMouseEnter:e=>a(d,null,Z(e.currentTarget)),onMouseLeave:()=>a(null,null),onFocus:e=>a(d,null,Z(e.currentTarget)),onBlur:()=>a(null,null),onKeyDown:e=>D(e,s.pads.length,i,_),children:[(0,z.jsx)(N,{t:s,pad:i,swaying:u,onPad:_,px:B}),(0,z.jsxs)(`div`,{className:`gd-cap`,children:[(0,z.jsx)(`div`,{className:`gd-title`,title:p,children:p}),(0,z.jsxs)(`div`,{className:`row wrap gd-pills`,children:[(0,z.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip||e.host||`?`}),(0,z.jsx)(`span`,{className:`badge ${K(e)}`,children:c.label}),t&&(0,z.jsxs)(`span`,{className:`badge mono`,children:[`⎇ `,t]}),l&&(0,z.jsxs)(`span`,{className:`badge`,children:[`↻ `,l.title,l.iteration==null?``:` ${l.iteration}`]}),e.attribution===!1&&(0,z.jsx)(`span`,{className:`badge`,title:`attribution unavailable on ${e.host}`,children:`no attrib.`})]}),(0,z.jsxs)(`div`,{className:`mono gd-meta`,children:[e.turns||0,` turns`,h==null?``:` · ${h}%`]})]})]})}function se({pairs:e,count:t}){if(!e.length)return null;let n=t*V+(t-1)*H,r=e=>e*(V+H)+V/2;return(0,z.jsx)(`svg`,{className:`gd-threads`,width:n,height:56*B+20,"aria-hidden":`true`,children:e.map(({a:e,b:t,kind:n})=>{let[i,a]=e<t?[e,t]:[t,e],o=`gd-thread ${n===`same-worktree`?`red`:`amber`}`;if(a-i===1){let e=r(i)+30,t=r(a)-30,n=(e+t)/2;return(0,z.jsxs)(`g`,{className:o,children:[(0,z.jsx)(`path`,{d:`M${e} ${U} C${n} 179 ${n} 159 ${t} 169`}),(0,z.jsx)(`path`,{d:`M${e} 169 C${n} 159 ${n} 179 ${t} ${U}`})]},`${i}-${a}`)}return(0,z.jsx)(`g`,{className:o,children:(0,z.jsx)(`path`,{d:`M${r(i)} ${W} Q${(r(i)+r(a))/2} 222 ${r(a)} ${W}`})},`${i}-${a}`)})})}var Z=e=>e.offsetLeft;function ce({sessions:e,collisions:t}){let[n,r]=(0,R.useState)(j),[i,a]=(0,R.useState)(()=>new Set),o=()=>{let e=!n;r(e);try{window.localStorage.setItem(A,e?`1`:`0`)}catch{}},s=Array.isArray(t)?t:[],c=C(M(e)).map(e=>i.has(e.key)?{...e,collapsed:!1}:e),l=c.filter(e=>e.collapsed),u=e=>T(e,s);return(0,z.jsxs)(`section`,{className:`gd`,"aria-label":`Garden`,children:[(0,z.jsxs)(`div`,{className:`row between wrap gap-8 gd-head`,children:[(0,z.jsxs)(`span`,{className:`dim act-sm`,children:[e.length,` tree`,e.length===1?``:`s`,` · `,c.length,` `,c.length===1?`shelf`:`shelves`,` · a tree opens its session; hover or focus shows its details, and a tap or the arrow keys walk its pads`]}),(0,z.jsx)(`button`,{type:`button`,className:n?`chip-f on`:`chip-f`,"aria-pressed":n,onClick:o,children:`Pink blossom`})]}),l.length>0&&(0,z.jsx)(`div`,{className:`row wrap gap-8 gd-chips`,role:`group`,"aria-label":`Folded shelves`,children:l.map(e=>(0,z.jsxs)(`button`,{type:`button`,className:`chip-f`,"aria-expanded":!1,onClick:()=>a(t=>new Set(t).add(e.key)),children:[e.name,` · `,e.trees.length]},e.key))}),c.filter(e=>!e.collapsed).map(e=>(0,z.jsx)(le,{sh:e,sakura:n,cols:s,mineOf:u},e.key))]})}function le({sh:e,sakura:t,cols:n,mineOf:r}){let[i,a]=(0,R.useState)({sid:null,pad:null,x:0}),o=(0,R.useCallback)((e,t,n)=>a(r=>({sid:e,pad:t,x:n??(r.sid===e?r.x:0)})),[]),s=(0,R.useRef)(null),[c,l]=(0,R.useState)(0);(0,R.useLayoutEffect)(()=>{let e=s.current,t=()=>l(e.clientWidth);if(t(),typeof ResizeObserver>`u`)return window.addEventListener(`resize`,t),()=>window.removeEventListener(`resize`,t);let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let u=G(c,e.trees.length),d=S(e.trees,n),f=[];for(let t=0;t<e.trees.length;t+=u)f.push(t);let p=e.trees.findIndex(e=>P(e.s)===i.sid),m=p<0?null:e.trees[p].s,h=m?w(m,{sakura:t}):null,g=h&&i.pad!=null?h.pads[i.pad]:null,_=e.trees.length;return(0,z.jsxs)(`section`,{className:`gd-shelf`,"aria-label":`${e.name} shelf`,ref:s,children:[f.map(n=>{let a=e.trees.slice(n,n+u),s=n+a.length,c=d.filter(e=>e.a>=n&&e.a<s&&e.b>=n&&e.b<s).map(e=>({...e,a:e.a-n,b:e.b-n}));return(0,z.jsxs)(`div`,{className:`gd-row`,children:[(0,z.jsx)(`div`,{className:`gd-plank`,children:n===0&&(0,z.jsxs)(`h3`,{className:`gd-plate`,children:[e.name,` · `,_,` session`,_===1?``:`s`]})}),a.map(({s:e,worktree:n})=>(0,z.jsx)(X,{s:e,worktree:n,sakura:t,mine:r(P(e)),pad:P(e)===i.sid?i.pad:null,onHover:o},P(e))),(0,z.jsx)(se,{pairs:c,count:a.length}),m&&p>=n&&p<s&&(0,z.jsx)(`div`,{className:`gd-info`,"aria-hidden":`true`,style:{left:Math.max(0,i.x)},children:g?(0,z.jsx)(F,{pad:g}):(0,z.jsx)(Y,{s:m,t:h,mine:r(P(m))})})]},n)}),(0,z.jsx)(`span`,{className:`sr-only`,role:`status`,children:ae(g)})]})}var Q=e=>e.catch(()=>null);function ue({s:e}){let t=(0,R.useId)(),n=e.todos,r=v(e);return(0,z.jsxs)(`a`,{className:`card pad-md act-card`,href:e.href||I(e.session_id),"aria-labelledby":`${t}-t ${t}-st`,"aria-describedby":r?`${t}-c`:void 0,children:[(0,z.jsxs)(_,{s:e,id:t,heading:e.title||m(e.cwd)||e.session_id,children:[e.chip&&(0,z.jsx)(`span`,{className:`badge mono`,title:`The install this session runs in`,children:e.chip}),(0,z.jsx)(o,{name:`chevron`,className:`glyph act-chev`})]}),n&&n.total>0&&(0,z.jsx)(`div`,{className:`act-foot`,children:(0,z.jsxs)(`span`,{className:`row gap-8 dim act-sm`,children:[(0,z.jsx)(s,{done:n.done,total:n.total}),`plan `,n.done,`/`,n.total]})}),(0,z.jsxs)(`div`,{className:`dim mono act-updated`,children:[`updated `,h(e.updated_at),` ago`]})]})}var de={blocked:`is blocked`,"waiting-input":`waits for your answer`};function fe(e,t){if(!Array.isArray(t))return``;let n=t.filter(f),r=e.current;return e.current=new Set(n.map(e=>`${P(e)}:${e.status}`)),r?n.filter(e=>!r.has(`${P(e)}:${e.status}`)).map(e=>`${e.title||m(e.cwd)||e.session_id} ${de[e.status]}`).join(`. `):``}var pe=[[`all`,`All`],[`needs`,`Needs you`],[`runs`,`Runs`],[`gates`,`Gate asks`]];function me(){let e=new URLSearchParams(window.location.hash.split(`?`)[1]||``),t=e.get(`f`);return{f:pe.some(([e])=>e===t)?t:`all`,host:e.get(`host`)||``,project:e.get(`project`)||``,v:e.get(`v`)===`list`?`list`:`garden`}}function he(e){let t=new URLSearchParams;e.f!==`all`&&t.set(`f`,e.f),e.v===`list`&&t.set(`v`,`list`),e.host&&t.set(`host`,e.host),e.project&&t.set(`project`,e.project);let n=t.toString();window.history.replaceState(null,``,`#/activity${n?`?${n}`:``}`)}function ge({enabled:e,installs:t,onToggle:n}){let r=k(t);return(0,z.jsxs)(`section`,{className:`card pad-md act-track`,"aria-labelledby":`act-track-h`,children:[(0,z.jsx)(o,{name:`activity`,className:`glyph act-fixed`}),(0,z.jsxs)(`div`,{className:`act-grow`,children:[(0,z.jsx)(`h2`,{id:`act-track-h`,className:`act-track-title`,children:e?`Live sessions are on`:`Live sessions are off`}),!e&&(0,z.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,z.jsxs)(`ul`,{className:`stack gap-8 act-fixed act-sm`,"aria-label":`Tracking per install`,children:[t.length===0&&(0,z.jsx)(`li`,{className:`dim`,children:`No active install to track.`}),t.map((e,t)=>(0,z.jsxs)(`li`,{className:`row gap-10`,children:[(0,z.jsxs)(`span`,{id:`act-track-l${t}`,title:e.path,children:[`Track live sessions in `,(0,z.jsx)(`span`,{className:`mono`,children:r.get(e.install)})]}),(0,z.jsx)(`div`,{className:`sw-toggle${e.enabled?` on`:``}`,role:`switch`,"aria-checked":e.enabled,"aria-labelledby":`act-track-l${t}`,tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.key===` `&&t.preventDefault(),n(e))}})]},e.install))]})]})}function _e({jobs:e,loading:t}){let n=typeof e?.cap==`number`?e.cap:void 0,r=p(e?.jobs,{days:14,cap:n}),i=l(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),u=`Runs per day: ${r.filter(e=>e.n).map(e=>`${e.n} on ${g(e.key)}`).join(`, `)||`none`}.`+(c?s?` Days before ${g(s.key)} are older than the runs the log keeps.`:` No run is in the log yet.`:``);return(0,z.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-runs-h`,children:[(0,z.jsxs)(`div`,{className:`act-stat-head`,children:[(0,z.jsx)(`h2`,{id:`act-runs-h`,className:`act-lbl`,children:`Runs per day · 14 days`}),e&&(0,z.jsx)(`span`,{className:`act-big`,children:o})]}),t?(0,z.jsx)(y,{label:`Reading the job log…`}):e?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`act-runs`,role:`img`,"aria-label":u,ref:i,children:r.map(e=>e.nodata?(0,z.jsx)(`i`,{className:`nodata`},e.key):e.n?(0,z.jsx)(`i`,{"data-sweep":!0,style:{height:`${e.n/a*100}%`},title:`${g(e.key)}: ${e.n}`},e.key):(0,z.jsx)(`i`,{className:`zero`},e.key))}),(0,z.jsxs)(`div`,{className:`mono act-axis`,"aria-hidden":`true`,children:[(0,z.jsx)(`span`,{children:g(r[0].key)}),(0,z.jsx)(`span`,{children:g(r[7].key)}),(0,z.jsx)(`span`,{children:`today`})]}),c&&(0,z.jsxs)(`span`,{className:`dim act-xs`,children:[`Hatched: older than the runs the log keeps`,n?` (last ${n})`:``,`.`]})]}):(0,z.jsx)(`p`,{className:`dim act-sm`,children:`The job log could not be read.`})]})}function ve({rows:e,gates:t,loading:n}){let r=e.reduce((e,t)=>e+t.n,0);return(0,z.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-gates-h`,children:[(0,z.jsxs)(`div`,{className:`act-stat-head`,children:[(0,z.jsx)(`h2`,{id:`act-gates-h`,className:`act-lbl`,children:`Gate asks by rule · 30 days`}),t&&(0,z.jsx)(`span`,{className:`act-big`,children:r})]}),n?(0,z.jsx)(y,{label:`Reading the gate ledger…`}):e.length?(0,z.jsx)(`ul`,{className:`gate-rows`,children:e.slice(0,6).map((e,t)=>(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`span`,{className:`act-ell`,children:[e.name,` `,(0,z.jsx)(`span`,{className:`mono dim act-xs`,children:e.rule})]}),(0,z.jsx)(c,{vals:e.per_day,i:t,sweep:!0}),(0,z.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,z.jsx)(`p`,{className:`dim act-sm`,children:t?`No gate asked in 30 days.`:`The gate ledger could not be read.`})]})}var ye={done:[`ok`,`done`],failed:[`bad`,`failed`],running:[``,`running`]};function be({job:e,longest:t}){let n=d(e),r=e.duration?Math.round(e.duration*10)/10:0,[i,a]=ye[e.status]||[``,e.status||`…`],s=e.status===`running`?`Still running`:r?`Took ${r} second${r===1?``:`s`}`:`No duration`,c=e.started?new Date(e.started*1e3).toLocaleTimeString(`en-GB`,{hour:`2-digit`,minute:`2-digit`}):`—`;return(0,z.jsxs)(`li`,{className:`act-row`,children:[(0,z.jsx)(`span`,{className:`mono dim act-xs`,children:c}),(0,z.jsx)(o,{name:`play`,className:`glyph act-glyph`}),(0,z.jsxs)(`span`,{className:`act-what`,children:[(0,z.jsx)(`span`,{className:`act-row-title`,children:n.verb}),n.scope&&(0,z.jsx)(`span`,{className:`dim act-xs act-ell`,title:n.command,children:n.scope})]}),(0,z.jsx)(`span`,{className:`act-dur`,role:`img`,"aria-label":s,children:(0,z.jsx)(`span`,{"data-sweep":!0,style:{width:t>0?`${(e.duration||0)/t*100}%`:`0%`}})}),(0,z.jsx)(`span`,{className:`badge ${i}`,children:a})]})}function xe({gate:e}){return(0,z.jsxs)(`li`,{className:`act-row gate`,children:[(0,z.jsx)(`span`,{className:`mono dim act-xs`,children:`—`}),(0,z.jsx)(o,{name:`rule`,className:`glyph act-glyph t-warn`}),(0,z.jsxs)(`span`,{className:`act-what`,children:[(0,z.jsx)(`span`,{className:`act-row-title`,children:e.title}),(0,z.jsx)(`span`,{className:`dim act-xs`,children:`Gate ledger`})]}),(0,z.jsx)(`span`,{className:`act-dur-none`,"aria-hidden":`true`}),(0,z.jsx)(`span`,{className:`badge warn`,children:`asked`})]})}var Se=5,$=(e,t)=>[...new Set([...e.filter(Boolean),t].filter(Boolean))];function Ce(){let[e,t]=(0,R.useState)(null),[n,o]=(0,R.useState)(``),[s,c]=(0,R.useState)(me),[d,p]=(0,R.useState)(!1),[h,g]=(0,R.useState)(``),_=(0,R.useRef)(null),v=e=>{let t={...s,...e};c(t),he(t)};ie(e=>r.activity().then(n=>{if(e()){t(ee(n)),o(``);let e=fe(_,n?.activity);e&&g(t=>t===e?e+`\xA0`:e)}},t=>{e()&&o(t.message)}),2e3,[]);let b=a(()=>Q(r.jobs()),[]),S=a(()=>Q(r.gates()),[]),ae=a(()=>Q(r.catalog(`laws`)),[]),C=!e||e.enabled!==!1,w=Array.isArray(e?.installs)?e.installs:[],T=E(e?.activity,w).sort((e,t)=>e.session_id<t.session_id?-1:+(e.session_id>t.session_id)),D=oe(),O=C&&e?T.filter(f).length:null,k=new Set(T.map(P)),A=s.v===`list`?E(e?.ended,w).filter(e=>!k.has(P(e))):[],j=$([...T,...A].map(e=>e.host),s.host),M=$([...T,...A].map(e=>m(e.cwd)),s.project),N=s.host&&s.project?`host or project`:s.host?`host`:s.project?`project`:``,F=e=>(!s.host||e.host===s.host)&&(!s.project||m(e.cwd)===s.project),I=T.filter(e=>F(e)&&(s.f!==`needs`||f(e))),L=s.f===`all`||s.f===`needs`,B=s.f===`all`&&C?A.filter(F):[],V=d?B:B.slice(0,Se),H=!N&&(s.f===`all`||s.f===`runs`),U=!N&&(s.f===`all`||s.f===`gates`),W=b.data?.jobs||[],G=re(S.data,ae.data),K=i(W,G,S.data?.days).map(e=>({...e,runs:H?e.runs:[],gate:U?e.gate:null})).filter(e=>e.runs.length||e.gate),q=Math.max(0,...W.map(e=>e.duration||0)),J=l(K.flatMap(e=>e.runs.map(e=>`${e.id}:${e.duration}`)).join(`,`),`scaleX`),Y=async e=>{let n=!e.enabled;try{let i=await r.activityToggle(n,{host:e.host,path:e.path});if(i.ok===!1){o(i.error||`Could not change tracking`);return}let a=t=>i.enabled?t||[]:(t||[]).flatMap(t=>{let n=(t.installs||[t.install]).filter(t=>t!==e.install);return n.length?[{...t,install:n[0],installs:n}]:[]});t(t=>{let n=(t?.installs||[]).map(t=>t.install===e.install?{...t,enabled:i.enabled}:t);return{...t||{},installs:n,enabled:n.length===0||n.some(e=>e.enabled),activity:a(t?.activity),ended:a(t?.ended)}}),o(``)}catch(e){o(e.message)}},X=(e,t,n)=>(0,z.jsxs)(`span`,{className:`row gap-8 act-sm`,children:[(0,z.jsx)(`label`,{htmlFor:`act-f-${e}`,children:t}),(0,z.jsxs)(`select`,{id:`act-f-${e}`,className:`sel`,value:s[e],disabled:n.length===0,title:n.length===0?`No source carries a ${e} yet`:void 0,onChange:t=>v({[e]:t.target.value}),children:[(0,z.jsxs)(`option`,{value:``,children:[`All `,e===`host`?`hosts`:`projects`]}),n.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]})]});return(0,z.jsxs)(`div`,{className:`page-fill`,children:[(0,z.jsx)(u,{title:`Activity`,sub:`What your agents ran, what the gates asked, and which sessions are waiting on you.`}),(0,z.jsx)(`div`,{className:`sr-only`,"aria-live":`polite`,children:h}),n&&(0,z.jsx)(`div`,{className:`act-gap`,children:(0,z.jsx)(te,{error:n})}),e&&(0,z.jsx)(ge,{enabled:C,installs:w,onToggle:Y}),(0,z.jsxs)(`div`,{className:`act-today`,children:[(0,z.jsx)(_e,{jobs:b.data,loading:b.loading}),(0,z.jsx)(ve,{rows:G,gates:S.data,loading:S.loading}),(0,z.jsxs)(`section`,{className:`card pad-md act-stat`,"aria-labelledby":`act-wait-h`,children:[(0,z.jsx)(`h2`,{id:`act-wait-h`,className:`act-lbl`,children:`Waiting on you`}),!e&&!n?(0,z.jsx)(y,{}):e?(0,z.jsxs)(z.Fragment,{children:[C?(0,z.jsxs)(`span`,{className:`act-big act-wait`,children:[O,` `,(0,z.jsx)(`span`,{className:`dim act-sm`,children:O===1?`session`:`sessions`})]}):null,(0,z.jsx)(`p`,{className:`dim act-sm`,children:C?`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,z.jsx)(`p`,{className:`dim act-sm`,children:`The sessions could not be read.`})]})]}),(0,z.jsxs)(`div`,{className:`row wrap gap-8 act-filters`,children:[(0,z.jsx)(`div`,{role:`group`,"aria-label":`Filter`,className:`row wrap gap-8`,children:pe.map(([e,t])=>(0,z.jsxs)(`button`,{type:`button`,className:s.f===e?`chip-f on`:`chip-f`,"aria-pressed":s.f===e,onClick:()=>v({f:e}),children:[t,e===`needs`&&O>0?(0,z.jsxs)(`span`,{className:`mono`,children:[` `,O]}):null]},e))}),X(`host`,`Host`,j),X(`project`,`Project`,M),(0,z.jsx)(ne,{"aria-label":`Live sessions view`,children:[[`list`,`List`],[`garden`,`Garden`]].map(([e,t])=>(0,z.jsx)(`button`,{type:`button`,className:s.v===e?`on`:``,"aria-pressed":s.v===e,onClick:()=>v({v:e}),children:t},e))})]}),N&&s.f!==`needs`&&(0,z.jsxs)(`p`,{className:`dim act-sm`,children:[`Runs and gate asks carry no `,N,`; showing sessions only.`]}),L&&(e?!C&&s.f!==`needs`?null:I.length===0?s.f===`needs`?(0,z.jsx)(x,{title:`Nothing waits on you`}):(0,z.jsx)(x,{title:`No active sessions`,children:`Start an agent session and it appears here.`}):s.v===`garden`?(0,z.jsx)(ce,{sessions:I,collisions:e.collisions}):(0,z.jsx)(`div`,{className:`stack gap-12 act-live`,ref:D,children:I.map(e=>(0,z.jsx)(`div`,{"data-flip":P(e),children:(0,z.jsx)(ue,{s:e})},P(e)))}):(0,z.jsx)(y,{label:`Reading live sessions…`})),B.length>0&&(0,z.jsxs)(`section`,{className:`stack gap-12 act-live act-ended`,"aria-labelledby":`act-ended-h`,children:[(0,z.jsx)(`h2`,{id:`act-ended-h`,className:`act-lbl`,children:`Recently ended`}),V.map(e=>(0,z.jsx)(`div`,{children:(0,z.jsx)(ue,{s:e})},P(e))),B.length>Se&&(0,z.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-expanded":d,onClick:()=>p(e=>!e),children:d?`Show fewer`:`Show all ${B.length}`})]}),s.f!==`needs`&&(0,z.jsx)(`section`,{"aria-label":`Feed`,className:`stack gap-16 act-feed`,ref:J,children:K.map(e=>(0,z.jsxs)(`section`,{className:`card act-day`,children:[(0,z.jsxs)(`h3`,{className:`act-day-h`,children:[(0,z.jsx)(`span`,{children:e.title}),(0,z.jsx)(`span`,{className:`mono dim`,children:e.sum})]}),(0,z.jsxs)(`ul`,{className:`act-rows`,children:[e.runs.map(e=>(0,z.jsx)(be,{job:e,longest:q},e.id)),e.gate&&(0,z.jsx)(xe,{gate:e.gate})]})]},e.key))})]})}export{Ce as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{i as t,t as n}from"./react-C1iE8mnY.js";import{t as r}from"./api-C8nMUU1i.js";import{Ct as i,H as a,M as o,O as s,Ot as c,T as l,bt as u,et as d,k as f,tt as p,xt as m}from"./index-BILaKHbH.js";import{a as h,d as g,f as _,i as v,l as y,o as b,r as x,t as S,v as C}from"./Bonsai-BoKo68Kw.js";import{t as w}from"./EmptyState-CY5Pm2xy.js";var T=e(t(),1),E=n();function D(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 O({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(`${f(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,E.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,E.jsx)(`span`,{className:`badge act-who ${t?``:`acc`}`,children:t?`you`:`agent`}),(0,E.jsxs)(`div`,{className:`act-grow act-sm`,children:[!t&&(0,E.jsx)(`span`,{className:`feed-dot act-inline-dot ${D(e)||`acc`}`}),e.kind===`thinking`&&(0,E.jsx)(`span`,{className:`dim`,children:`thinking: `}),r?(0,E.jsx)(`span`,{className:`dim`,children:i}):t?i:(0,E.jsx)(`b`,{children:i}),e.error&&(0,E.jsxs)(`span`,{className:`dim`,children:[`: `,e.error]})]}),n.length>0&&(0,E.jsx)(`span`,{className:`dim mono act-xs act-fixed`,children:n.join(` · `)}),e.t?(0,E.jsx)(`time`,{className:`mono dim act-xs act-fixed`,dateTime:new Date(e.t).toISOString(),title:`${c(e.t/1e3)} ago`,children:new Date(e.t).toTimeString().slice(0,8)}):null]})}function k({turns:e}){return!e||e.length===0?(0,E.jsx)(`div`,{className:`dim act-sm`,children:`No conversation captured yet.`}):(0,E.jsx)(`div`,{className:`stack gap-12`,children:e.map((e,t)=>{let n=e.role===`user`;return(0,E.jsxs)(`div`,{className:`row gap-10 act-line`,children:[(0,E.jsx)(`span`,{className:`badge act-who ${n?``:`acc`}`,children:n?`you`:`agent`}),(0,E.jsx)(`div`,{className:`act-min act-sm${n?``:` muted`}`,children:e.text})]},t)})})}var A=5;function j({s:e}){let[t]=(0,T.useState)(b),[n,r]=(0,T.useState)(null),i=!!e.ended,a=i?{...e,status:o(e)?`busy`:e.status,error:null}:e,s=C(a,t),c=(0,T.useMemo)(()=>_(a,{sakura:t}),[s]),l=(0,T.useCallback)(e=>r(e),[]),u=y(e),d=Number(e.turns)||0,f=Number(e.compactions)||0,p=[`${d} turn${d===1?``:`s`}`,`context ${u==null?`unknown`:`${Math.round(u*100)} %`}`,`${f} compaction${f===1?``:`s`}`,`sub-agents: ${c.pads.filter(e=>e.key!=null).length} ${i?`unfinished`:`running`}, ${c.fallen.length} finished`].join(` · `),m=n==null?null:c.pads[n];return(0,E.jsxs)(`div`,{className:`card pad-md act-mt gd-detail${!i&&o(e)?` gd-needs`:``}`,children:[(0,E.jsx)(`div`,{role:`group`,tabIndex:0,"aria-label":`Bonsai pads, arrow keys walk them`,onKeyDown:e=>v(e,c.pads.length,n,l),children:(0,E.jsx)(x,{t:c,pad:n,swaying:!i&&e.status!==`idle`,onPad:l,px:A,label:`Bonsai of this session${i?`, ended`:``}: ${p}`})}),(0,E.jsxs)(`div`,{className:`stack gap-8 act-min`,children:[i&&(0,E.jsx)(`span`,{className:`dim act-xs`,children:`ended`}),(0,E.jsx)(`div`,{className:`dim act-sm`,children:p}),(0,E.jsx)(`span`,{className:`sr-only`,role:`status`,children:h(m)}),m?(0,E.jsx)(S,{pad:m}):(0,E.jsx)(`div`,{className:`dim act-xs`,children:`Hover or tap a pad, or use the arrow keys, for its files.`})]})]})}function M({sid:e}){let{sid:t,install:n}=g(e,window.location.hash),[o,f]=(0,T.useState)(null),[h,_]=(0,T.useState)(``),[v,y]=(0,T.useState)(!1),[b,x]=(0,T.useState)(!1),S=(0,T.useId)();m(e=>v?void 0:r.activityDetail(t,n).then(t=>{e()&&(f(u(t)),_(``),y(!1))},t=>{e()&&(t.status===404?y(!0):_(t.message))}),2e3,[t,v]);let C=(0,E.jsxs)(`a`,{className:`btn ghost sm act-back`,href:`#/activity`,children:[(0,E.jsx)(i,{name:`arrow`}),` Activity`]});if(v)return(0,E.jsxs)(`div`,{className:`page-fill`,children:[C,(0,E.jsx)(w,{title:`Session ended`,action:(0,E.jsx)(`a`,{href:`#/activity`,children:`Back to Activity`}),children:`It's no longer live.`})]});if(!o)return(0,E.jsxs)(`div`,{className:`page-fill`,children:[C,h?(0,E.jsx)(d,{error:h}):(0,E.jsx)(p,{label:`Loading session…`})]});let D=o.session,A=D.files,M=D.todos,N=!!(A&&A.items&&A.items.length>0),P=!!(M&&M.items&&M.items.length>0),F=o.conversation||[],I=o.timeline||[],L=[...F.filter(e=>e.role===`user`).map(e=>({who:`you`,text:e.text,t:e.t||0})),...I.map(e=>({...e,who:`agent`}))].sort((e,t)=>(e.t||0)-(t.t||0));return(0,E.jsxs)(`div`,{className:`page-fill`,children:[C,(0,E.jsx)(a,{title:D.title||s(D.cwd)||D.session_id,sub:D.cwd?(0,E.jsx)(`span`,{className:`mono act-cwd`,title:D.cwd,children:D.cwd}):null}),h&&(0,E.jsx)(`div`,{className:`act-gap`,children:(0,E.jsx)(d,{error:h})}),(0,E.jsxs)(`div`,{className:`card pad-md`,children:[(0,E.jsx)(l,{s:D}),(0,E.jsxs)(`div`,{className:`dim act-updated`,children:[`updated `,c(D.updated_at),` ago`]})]}),(0,E.jsx)(j,{s:D}),(N||P)&&(0,E.jsxs)(`div`,{className:`grid gap-12 act-panels${N&&P?` two`:``}`,children:[N&&(0,E.jsxs)(`div`,{className:`card pad-md`,children:[(0,E.jsx)(`div`,{className:`card-head`,children:(0,E.jsxs)(`h2`,{children:[`Files touched `,(0,E.jsxs)(`span`,{className:`dim`,children:[`(`,A.count,`)`]})]})}),(0,E.jsx)(`div`,{className:`stack act-list`,children:A.items.map(e=>(0,E.jsxs)(`div`,{className:`row between gap-12 act-sm`,children:[(0,E.jsx)(`span`,{className:`mono act-ell act-grow`,title:e.file,children:e.file}),(0,E.jsxs)(`span`,{className:`act-fixed`,children:[(0,E.jsxs)(`span`,{className:`t-good`,children:[`+`,e.additions]}),` `,(0,E.jsxs)(`span`,{className:`t-bad`,children:[`−`,e.deletions]})]})]},e.file))})]}),P&&(0,E.jsxs)(`div`,{className:`card pad-md`,children:[(0,E.jsx)(`div`,{className:`card-head`,children:(0,E.jsxs)(`h2`,{children:[`Plan`,` `,(0,E.jsxs)(`span`,{className:`dim`,children:[`(`,M.done,`/`,M.total,`)`]})]})}),(0,E.jsx)(`div`,{className:`stack act-list`,children:M.items.map((e,t)=>(0,E.jsxs)(`div`,{className:`row gap-8 act-sm`,children:[(0,E.jsx)(`span`,{className:`feed-dot ${e.status===`completed`?`ok`:e.status===`in_progress`?`acc`:``}`}),(0,E.jsx)(`span`,{className:e.status===`completed`?`act-done`:void 0,children:e.content})]},t))})]})]}),(0,E.jsxs)(`div`,{className:`card pad-md act-mt`,children:[(0,E.jsxs)(`div`,{className:`card-head act-tl-head`,children:[(0,E.jsx)(`h2`,{children:`Timeline`}),I.length>0&&(0,E.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":b,"aria-controls":S,onClick:()=>x(e=>!e),children:b?`Show conversation`:`Show full stream (${L.length})`})]}),(0,E.jsx)(`div`,{id:S,children:b?(0,E.jsx)(`div`,{className:`stack gap-12`,children:L.map((e,t)=>(0,E.jsx)(O,{rec:e},t))}):(0,E.jsx)(k,{turns:F})})]})]})}export{j as SessionTree,M as default};
|