wrapped-agents 1.0.0 → 1.2.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.
@@ -0,0 +1,323 @@
1
+ // Gemini CLI reader, plus the shared reader for Qwen Code (qwen-code.mjs). Beta: built from the tools' source, not yet
2
+ // verified on real data. Read from the public repositories only; no Google service or API is used.
3
+ //
4
+ // Gemini CLI (github.com/google-gemini/gemini-cli), runtime dir ~/.gemini (or $GEMINI_CLI_HOME/.gemini):
5
+ // tmp/<project>/chats/session-<time>-<id>.jsonl one session; <project> is a slug (projects.json) or an older sha256 hash
6
+ // tmp/<project>/chats/<parentSessionId>/<id>.jsonl subagent sessions (kind: 'subagent')
7
+ // tmp/<project>/chats/session-*.json older whole-file ConversationRecord
8
+ // tmp/<project>/logs.json [{ sessionId, messageId, timestamp, type: 'user', message }] prompt log
9
+ // JSONL lines: a metadata record { sessionId, projectHash, startTime, kind }, MessageRecord { id, timestamp, type:
10
+ // 'user'|'gemini'|'info'|'error'|'warning', content, displayContent, tokens: { input, output, cached, thoughts, tool, total },
11
+ // model, toolCalls: [{ name, args, status }] } (re-appended with the same id when updated), { $rewindTo }, { $patch }, { $set }.
12
+ // https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/services/chatRecordingTypes.ts
13
+ // https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/services/chatRecordingService.ts
14
+ // https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/config/storage.ts
15
+ // tokens.input is promptTokenCount, which includes tokens.cached (Gemini usage metadata), so input = input − cached.
16
+ // Theme: settings.json `ui.theme` (older: top-level `theme`); custom themes in `ui.customThemes` / `customThemes` or ~/.gemini/theme.json.
17
+ // https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/themes.md
18
+ //
19
+ // Qwen Code (github.com/QwenLM/qwen-code) forked Gemini CLI but now writes its own format, ~/.qwen (or $QWEN_HOME):
20
+ // projects/<sanitized-cwd>/chats/<sessionId>.jsonl, one ChatRecord per line: { uuid, parentUuid, sessionId, timestamp,
21
+ // type: 'user'|'assistant'|'tool_result'|'system', subtype?, provenance?, isSidechain?, agentId?, cwd, version, message:
22
+ // { role, parts }, model, usageMetadata: { promptTokenCount, candidatesTokenCount, cachedContentTokenCount,
23
+ // thoughtsTokenCount, toolUsePromptTokenCount }, systemPayload } (system subtypes: chat_compression, slash_command, rewind…)
24
+ // https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/services/chatRecordingService.ts
25
+ // https://github.com/QwenLM/qwen-code/blob/main/packages/core/src/config/storage.ts
26
+ // Older Qwen Code versions wrote the Gemini layout under ~/.qwen/tmp/, which is read the same way as Gemini CLI.
27
+ import path from 'node:path';
28
+ import {
29
+ eachLine, parse, readJSON, isDir, walk, localDate, toMs, windowOf, basename, maxConcurrent, gitUndoKinds,
30
+ emptyUndos, phraseCounts, emptyAssistant, addPhrases, inc, addTok, emptyFacts, day, countPromptTime, finishCoverage,
31
+ longestSession, mostResumed, realEnv,
32
+ } from './_util.mjs';
33
+ import { PromptStats } from './_prompts.mjs';
34
+ import { mapFiles } from './_pool.mjs';
35
+
36
+ const RATE = /\b429\b|rate.?limit|too many requests|quota|resource.?exhausted/i;
37
+ const SHELL = /^(run_shell_command|shell|bash)$/i;
38
+ const IGNORED = /^(<session_context>|<hook_context>|\?)/; // not prompts (sessionUtils.isIgnoredUserContent); '/' kept as slash
39
+
40
+ /** text and image count from a Gemini PartListUnion */
41
+ function partsText(c) {
42
+ if (typeof c === 'string') return { text: c, images: 0 };
43
+ const arr = Array.isArray(c) ? c : c && typeof c === 'object' ? [c] : [];
44
+ let text = '', images = 0, other = false;
45
+ for (const p of arr) {
46
+ if (typeof p === 'string') { text += (text ? ' ' : '') + p; continue; }
47
+ if (!p || typeof p !== 'object') continue;
48
+ if (typeof p.text === 'string' && !p.thought) text += (text ? ' ' : '') + p.text;
49
+ else if (/^image\//.test(String((p.inlineData || p.fileData || {}).mimeType || ''))) images++;
50
+ else if (p.functionResponse || p.functionCall) other = true;
51
+ }
52
+ return { text, images, other };
53
+ }
54
+
55
+ // ------------------------------------------------------------------ Gemini layout (one file, in a worker)
56
+ export async function scanGeminiFile(file, ctx) {
57
+ const win = ms => ms >= ctx.start && ms < ctx.end;
58
+ const msgs = new Map(); let meta = {}; let rewinds = 0;
59
+ const take = m => { if (m && typeof m.id === 'string' && m.type) msgs.set(m.id, m); };
60
+ if (file.endsWith('.json')) {
61
+ const o = await readJSON(file); if (!o || typeof o !== 'object') return null;
62
+ meta = o; for (const m of Array.isArray(o.messages) ? o.messages : []) take(m);
63
+ } else {
64
+ await eachLine(file, line => {
65
+ const o = parse(line); if (!o || typeof o !== 'object') return;
66
+ if (typeof o.$rewindTo === 'string') { rewinds++; return; }
67
+ if (o.$patch) { const p = o.$patch; const ups = [p, ...(Array.isArray(p.updates) ? p.updates : [])];
68
+ for (const u of ups) { const m = u && msgs.get(u.id); if (m && u.content !== undefined) m.content = u.content; } return; }
69
+ if (o.$set && typeof o.$set === 'object') { meta = { ...meta, ...o.$set }; for (const m of Array.isArray(o.$set.messages) ? o.$set.messages : []) take(m); return; }
70
+ if (typeof o.sessionId === 'string' && typeof o.projectHash === 'string') { meta = { ...meta, ...o }; for (const m of Array.isArray(o.messages) ? o.messages : []) take(m); return; }
71
+ take(o); // a message record; a later copy with the same id is the updated one
72
+ });
73
+ }
74
+ const r = { sid: meta.sessionId || path.basename(file).replace(/\.jsonl?$/, ''), sub: meta.kind === 'subagent', t: [], prompts: [], models: [],
75
+ tools: [], undo: [], phr: [], rl: [], rewinds: 0 };
76
+ for (const m of msgs.values()) {
77
+ const ms = toMs(m.timestamp); if (!win(ms)) continue;
78
+ r.t.push(ms);
79
+ if (m.type === 'user') {
80
+ const { text, images, other } = partsText(m.displayContent ?? m.content);
81
+ const t = text.trim();
82
+ if ((!t && !images) || IGNORED.test(t) || (other && !t)) continue;
83
+ r.prompts.push([ms, text, images]);
84
+ } else if (m.type === 'gemini') {
85
+ const k = m.tokens;
86
+ if (k && typeof k === 'object') {
87
+ const cached = +k.cached || 0, inp = Math.max(0, (+k.input || 0) - cached) + (+k.tool || 0);
88
+ r.models.push([m.model || '?', ms, inp, (+k.output || 0) + (+k.thoughts || 0), cached]);
89
+ }
90
+ for (const tc of Array.isArray(m.toolCalls) ? m.toolCalls : []) {
91
+ if (!tc || !tc.name) continue; r.tools.push(String(tc.name));
92
+ if (SHELL.test(tc.name)) { const u = gitUndoKinds(String((tc.args || {}).command || '')); if (u) r.undo.push(u); }
93
+ }
94
+ const pc = phraseCounts(partsText(m.content).text); if (pc) r.phr.push(pc);
95
+ } else if (m.type === 'error') {
96
+ if (RATE.test(partsText(m.content).text)) r.rl.push(ms);
97
+ }
98
+ }
99
+ if (r.t.length) r.rewinds = rewinds;
100
+ return r;
101
+ }
102
+
103
+ // ------------------------------------------------------------------ Qwen Code layout (one file, in a worker)
104
+ export async function scanQwenFile(file, ctx) {
105
+ const win = ms => ms >= ctx.start && ms < ctx.end;
106
+ const r = { sid: path.basename(file, '.jsonl'), cwd: null, version: null, vAt: 0, t: [], prompts: [], models: [], tools: [], undo: [], phr: [],
107
+ rl: [], rewinds: 0, compactions: 0, slash: [], agents: [], uuids: [] };
108
+ await eachLine(file, line => {
109
+ const o = parse(line); if (!o || typeof o !== 'object' || !o.type) return;
110
+ const ms = toMs(o.timestamp);
111
+ if (o.version && ms >= r.vAt) { r.version = String(o.version); r.vAt = ms; }
112
+ if (!win(ms)) return;
113
+ if (o.sessionId) r.sid = o.sessionId;
114
+ if (o.forkedFrom) return; // a /branch copy of a record already counted in its source session
115
+ if (o.uuid) r.uuids.push(o.uuid); // backstop: any other copy with the same uuid is de-duplicated on the main thread
116
+ const k = o.uuid || null; const side = !!o.isSidechain;
117
+ if (!side && o.cwd && !r.cwd) r.cwd = o.cwd;
118
+ if (!side) r.t.push([k, ms]);
119
+ if (side && o.agentId) r.agents.push(String(o.agentId));
120
+ const parts = (o.message && o.message.parts) || [];
121
+ if (o.type === 'user') {
122
+ if (side || (o.provenance && o.provenance !== 'real_user') || (o.subtype && o.subtype !== 'mid_turn_user_message')) return;
123
+ const pt = partsText(parts); const sp = o.systemPayload || {};
124
+ const text = typeof sp.displayText === 'string' && sp.displayText ? sp.displayText : pt.text;
125
+ const t = text.trim();
126
+ if ((!t && !pt.images) || IGNORED.test(t) || (pt.other && !t) || t.startsWith('/')) return; // slash commands come from system records
127
+ r.prompts.push([k, ms, text, pt.images]);
128
+ } else if (o.type === 'assistant') {
129
+ const u = o.usageMetadata;
130
+ if (u && typeof u === 'object') {
131
+ const cached = +u.cachedContentTokenCount || 0;
132
+ r.models.push([k, o.model || '?', ms, Math.max(0, (+u.promptTokenCount || 0) - cached) + (+u.toolUsePromptTokenCount || 0), (+u.candidatesTokenCount || 0) + (+u.thoughtsTokenCount || 0), cached]);
133
+ }
134
+ for (const p of Array.isArray(parts) ? parts : []) {
135
+ const fc = p && p.functionCall; if (!fc || !fc.name) continue;
136
+ r.tools.push([k, String(fc.name)]);
137
+ if (SHELL.test(fc.name)) { const g = gitUndoKinds(String((fc.args || {}).command || '')); if (g) r.undo.push([k, g]); }
138
+ }
139
+ if (!side) { const pc = phraseCounts(partsText(parts).text); if (pc) r.phr.push([k, pc]); }
140
+ } else if (o.type === 'system') {
141
+ const sp = o.systemPayload || {};
142
+ if (o.subtype === 'chat_compression') r.compactions++;
143
+ else if (o.subtype === 'rewind') r.rewinds++;
144
+ else if (o.subtype === 'slash_command' && sp.phase === 'invocation' && typeof sp.rawCommand === 'string' && !side) r.slash.push([k, ms, sp.rawCommand]);
145
+ else if (o.subtype === 'turn_result' && RATE.test(JSON.stringify(sp.error || ''))) r.rl.push(ms);
146
+ }
147
+ });
148
+ return r;
149
+ }
150
+
151
+ // ------------------------------------------------------------------ reader factory
152
+ const BUILTIN = new Set(['ansi', 'atom one', 'ayu', 'default', 'dracula', 'github', 'holiday', 'shades of purple', 'solarized dark', 'tokyo night',
153
+ 'ansi light', 'ayu light', 'default light', 'github light', 'google code', 'solarized light', 'xcode', 'no color', 'qwen dark', 'qwen light',
154
+ 'github dark colorblind', 'github light colorblind']);
155
+
156
+ /** cfg: { id, label, tool, dir: '.gemini', homeEnv: 'GEMINI_CLI_HOME', qwen: bool } */
157
+ export function makeReader(cfg) {
158
+ const BETA = `beta reader (built from ${cfg.tool}'s source, not yet verified on real data)`;
159
+ const base = env => {
160
+ const h = realEnv(env, cfg.homeEnv);
161
+ return cfg.qwen ? (h || path.join(env.home, cfg.dir)) : path.join(h || env.home, cfg.dir);
162
+ };
163
+ // Qwen Code keeps sessions under $QWEN_RUNTIME_DIR when set, settings under $QWEN_HOME
164
+ const runBase = env => (cfg.qwen && realEnv(env, 'QWEN_RUNTIME_DIR')) || base(env);
165
+ const roots = async env => {
166
+ const b = runBase(env); const out = [];
167
+ if (await isDir(path.join(b, 'tmp'))) out.push(path.join(b, 'tmp'));
168
+ if (cfg.qwen && await isDir(path.join(b, 'projects'))) out.push(path.join(b, 'projects'));
169
+ return out;
170
+ };
171
+
172
+ async function detect(env) {
173
+ // tmp/ exists for every install; it is found only when it holds a session or a prompt log
174
+ const out = [];
175
+ for (const r of await roots(env)) {
176
+ const hit = (await walk(r, (n, p) => /\.jsonl?$/.test(n) && (/[\\/]chats[\\/]/.test(p) || n === 'logs.json'))).length > 0;
177
+ if (hit) out.push(r);
178
+ }
179
+ return { found: out.length > 0, roots: out };
180
+ }
181
+
182
+ async function read(env, opts = {}) {
183
+ const w = windowOf(env, opts); const progress = opts.onProgress || (() => {});
184
+ const f = emptyFacts(cfg.id, cfg.label); const ps = new PromptStats(); const b = base(env); const rb = runBase(env);
185
+ f.coverage.notes.push(BETA);
186
+ const sessions = new Map(); const bySession = new Map(); const concEv = [];
187
+ const undos = emptyUndos(); const assistant = emptyAssistant(); const rlDays = new Set();
188
+ let rlHits = 0, subagents = 0, rewinds = 0, compactions = null; const agentIds = new Set();
189
+ const projectName = await projectNames(b);
190
+ const promptAt = (sid, proj, ms, text, images) => {
191
+ ps.add(text, { images }); countPromptTime(f, ms); concEv.push([ms, sid]);
192
+ if (proj) inc(f.projects, proj);
193
+ const s = bySession.get(sid) || { days: new Set(), project: proj }; s.days.add(localDate(ms)); bySession.set(sid, s);
194
+ };
195
+ const times = (sid, proj, list) => { if (!list.length) return; const s = sessions.get(sid) || { t: [], project: proj }; for (const t of list) s.t.push(t); sessions.set(sid, s); };
196
+ const tok = (model, ms, i, o, cr) => { addTok(f.models, model, ms, i, o, cr, 0); day(f, localDate(ms)).tokens += i + o + cr; };
197
+
198
+ // Gemini layout: tmp/<project>/chats/**
199
+ const tmp = path.join(rb, 'tmp');
200
+ const gfiles = (await isDir(tmp)) ? await walk(tmp, (n, p) => /[\\/]chats[\\/]/.test(p) && (/\.jsonl$/.test(n) || /^session-.*\.json$/.test(n))) : [];
201
+ const seenSid = new Set();
202
+ if (gfiles.length) f.coverage.sources.push('tmp/*/chats/*.jsonl');
203
+ progress(`${cfg.label}: ${gfiles.length} session files`);
204
+ await mapFiles(import.meta.url, 'scanGeminiFile', gfiles, { start: w.start, end: w.end }, (r, file) => {
205
+ const rel = path.relative(tmp, file.path).split(/[\\/]/);
206
+ const proj = projectName(rel[0]); const sub = r.sub || rel.length > 3;
207
+ seenSid.add(r.sid);
208
+ if (sub) { if (r.t.length) subagents++; }
209
+ else {
210
+ times(r.sid, proj, r.t);
211
+ for (const [ms, text, images] of r.prompts) promptAt(r.sid, proj, ms, text, images);
212
+ }
213
+ for (const [m, ms, i, o, cr] of r.models) tok(m, ms, i, o, cr);
214
+ for (const n of r.tools) inc(f.tools, n);
215
+ for (const u of r.undo) for (const k of u) undos[k]++;
216
+ for (const c of r.phr) addPhrases(assistant, c);
217
+ for (const ms of r.rl) { rlHits++; rlDays.add(localDate(ms)); }
218
+ rewinds += r.rewinds;
219
+ }, { onProgress: m => progress(`${cfg.label}: ${m}`) });
220
+
221
+ // prompt logs for sessions without a chat file (older versions, or chat recording turned off)
222
+ const logs = (await isDir(tmp)) ? await walk(tmp, n => n === 'logs.json') : [];
223
+ let fromLogs = 0;
224
+ for (const lf of logs) {
225
+ const arr = await readJSON(lf.path); if (!Array.isArray(arr)) continue;
226
+ const proj = projectName(path.relative(tmp, lf.path).split(/[\\/]/)[0]);
227
+ for (const e of arr) {
228
+ if (!e || e.type !== 'user' || seenSid.has(e.sessionId)) continue;
229
+ const ms = toMs(e.timestamp); if (!(ms >= w.start && ms < w.end)) continue;
230
+ const text = String(e.message || ''); if (!text.trim() || IGNORED.test(text.trim())) continue;
231
+ promptAt(e.sessionId || lf.path, proj, ms, text, 0); times(e.sessionId || lf.path, proj, [ms]); fromLogs++;
232
+ }
233
+ }
234
+ if (fromLogs) { f.coverage.sources.push('tmp/*/logs.json'); f.coverage.notes.push(`${fromLogs} prompts from logs.json only (no chat file: prompts and times, no tokens or tools)`); }
235
+
236
+ // Qwen Code layout: projects/<cwd>/chats/<sessionId>.jsonl
237
+ if (cfg.qwen) {
238
+ const pdir = path.join(rb, 'projects');
239
+ const qfiles = (await isDir(pdir)) ? await walk(pdir, (n, p) => n.endsWith('.jsonl') && /[\\/]chats[\\/]/.test(p)) : [];
240
+ if (qfiles.length) { f.coverage.sources.push('projects/*/chats/*.jsonl'); compactions = 0; }
241
+ const seen = new Set();
242
+ let vAt = 0;
243
+ await mapFiles(import.meta.url, 'scanQwenFile', qfiles, { start: w.start, end: w.end }, r => {
244
+ if (r.version && r.vAt >= vAt) { f.version = r.version; vAt = r.vAt; }
245
+ const proj = basename(r.cwd);
246
+ // de-dup across forks: only records whose uuid has not been seen count (order: largest file first)
247
+ const novel = new Set(r.uuids.filter(u => !seen.has(u)));
248
+ const isNew = k => !k || novel.has(k);
249
+ times(r.sid, proj, r.t.filter(([k]) => isNew(k)).map(([, ms]) => ms));
250
+ for (const [k, ms, text, images] of r.prompts) if (isNew(k)) promptAt(r.sid, proj, ms, text, images);
251
+ for (const [k, ms, cmd] of r.slash) if (isNew(k)) promptAt(r.sid, proj, ms, cmd, 0);
252
+ for (const [k, m, ms, i, o, cr] of r.models) if (isNew(k)) tok(m, ms, i, o, cr);
253
+ for (const [k, n] of r.tools) if (isNew(k)) inc(f.tools, n);
254
+ for (const [k, u] of r.undo) if (isNew(k)) for (const x of u) undos[x]++;
255
+ for (const [k, c] of r.phr) if (isNew(k)) addPhrases(assistant, c);
256
+ for (const ms of r.rl) { rlHits++; rlDays.add(localDate(ms)); }
257
+ for (const a of r.agents) agentIds.add(a);
258
+ compactions += r.compactions; rewinds += r.rewinds;
259
+ for (const u of novel) seen.add(u);
260
+ }, { onProgress: m => progress(`${cfg.label}: ${m}`) });
261
+ subagents += agentIds.size;
262
+ }
263
+
264
+ for (const [, s] of sessions) {
265
+ let mn = Infinity; for (const t of s.t) { if (t < mn) mn = t; day(f, localDate(t)); }
266
+ day(f, localDate(mn)).sessions++; f.sessions.count++;
267
+ }
268
+ f.sessions.longest = longestSession(sessions);
269
+ f.sessions.mostResumed = mostResumed(bySession);
270
+ f.sessions.maxConcurrent = maxConcurrent(concEv);
271
+ f.prompts = ps.toJSON(); f.slash = ps.slash;
272
+ f.subagents = subagents; f.interrupts = null; f.compactions = compactions;
273
+ f.rateLimits = { hits: rlHits, days: rlDays.size };
274
+ f.lines = null; f.gitUndos = undos; f.assistant = assistant; f.rewinds = rewinds;
275
+ f.projects = Object.fromEntries(Object.entries(f.projects).sort((a, b) => b[1] - a[1]).slice(0, 20));
276
+ f.theme = await readTheme(env, b, cfg);
277
+ return finishCoverage(f);
278
+ }
279
+
280
+ return { id: cfg.id, label: cfg.label, detect, read };
281
+ }
282
+
283
+ /** tmp/<id> → project folder name: projects.json { projects: { "/abs/path": "slug" } } or tmp/<slug>/.project_root */
284
+ async function projectNames(b) {
285
+ const reg = await readJSON(path.join(b, 'projects.json')); const bySlug = new Map();
286
+ for (const [p, slug] of Object.entries((reg && reg.projects) || {})) bySlug.set(slug, basename(p));
287
+ // a slug is the folder's own name (slugified); older sha256(cwd) directory names can't be turned back into a folder
288
+ return id => (bySlug.has(id) ? bySlug.get(id) : /^[0-9a-f]{64}$/.test(id) ? null : id || null);
289
+ }
290
+
291
+ // ------------------------------------------------------------------ theme
292
+ async function readTheme(env, b, cfg) {
293
+ const settings = await readJSON(path.join(b, 'settings.json')) || {};
294
+ const ui = settings.ui && typeof settings.ui === 'object' ? settings.ui : {};
295
+ const name = typeof ui.theme === 'string' ? ui.theme : typeof settings.theme === 'string' ? settings.theme : null;
296
+ if (!name) return null;
297
+ let def = null;
298
+ if (/\.json$/i.test(name)) def = await readJSON(name.startsWith('~') ? path.join(env.home, name.slice(1)) : path.isAbsolute(name) ? name : path.join(b, name));
299
+ if (!def) {
300
+ const files = [await readJSON(path.join(b, 'theme.json')), await readJSON(path.join(realEnv(env, 'XDG_CONFIG_HOME') || path.join(env.home, '.config'), cfg.qwen ? 'qwen' : 'gemini', 'theme.json'))];
301
+ for (const src of [...files, ui.customThemes, settings.customThemes]) {
302
+ if (!src || typeof src !== 'object') continue;
303
+ if (src[name] && typeof src[name] === 'object') { def = src[name]; break; }
304
+ if (src.name === name && src.type === 'custom') { def = src; break; }
305
+ }
306
+ }
307
+ if (!def) return { name, builtin: BUILTIN.has(name.toLowerCase()), colors: null };
308
+ const hex = v => (typeof v === 'string' && /^#[0-9a-f]{3,8}$/i.test(v) ? v.toLowerCase() : null);
309
+ const g = (...ks) => { for (const k of ks) { const v = k.split('.').reduce((o, x) => (o && typeof o === 'object' ? o[x] : undefined), def); const c = hex(v); if (c) return c; } return null; };
310
+ const colors = {
311
+ background: g('background.primary', 'Background'), foreground: g('text.primary', 'Foreground'),
312
+ primary: g('text.accent', 'AccentBlue', 'text.link'), accent: g('text.link', 'AccentPurple', 'text.accent'),
313
+ surface: g('background.secondary', 'ui.focus', 'DiffAdded'), success: g('status.success', 'AccentGreen'),
314
+ };
315
+ for (const [k, ...src] of [['secondary', 'text.secondary', 'Gray'], ['muted', 'ui.comment', 'Comment'], ['error', 'status.error', 'AccentRed'], ['warning', 'status.warning', 'AccentYellow']]) { const c = g(...src); if (c) colors[k] = c; }
316
+ return { name, builtin: false, colors: Object.values(colors).some(Boolean) ? colors : null };
317
+ }
318
+
319
+ const gemini = makeReader({ id: 'gemini-cli', label: 'Gemini CLI', tool: 'Gemini CLI', dir: '.gemini', homeEnv: 'GEMINI_CLI_HOME', qwen: false });
320
+ export const id = gemini.id;
321
+ export const label = gemini.label;
322
+ export const detect = gemini.detect;
323
+ export const read = gemini.read;
@@ -1,8 +1,12 @@
1
1
  // All harness readers, in display order. Each: { id, label, detect(env), read(env, opts) } (docs/CONTRACT.md §1).
2
2
  import * as claudeCode from './claude-code.mjs';
3
3
  import * as codex from './codex.mjs';
4
+ import * as cursor from './cursor.mjs';
5
+ import * as geminiCli from './gemini-cli.mjs';
6
+ import * as qwenCode from './qwen-code.mjs';
7
+ import * as opencode from './opencode.mjs';
4
8
  import * as pi from './pi.mjs';
5
9
  import * as mistralVibe from './mistral-vibe.mjs';
6
10
 
7
- export const readers = [claudeCode, codex, pi, mistralVibe];
8
- export { claudeCode, codex, pi, mistralVibe };
11
+ export const readers = [claudeCode, codex, cursor, geminiCli, qwenCode, opencode, pi, mistralVibe];
12
+ export { claudeCode, codex, cursor, geminiCli, qwenCode, opencode, pi, mistralVibe };