chompyy 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +11 -0
  2. package/dist/agentlimits.js +77 -0
  3. package/dist/agentusage.js +96 -0
  4. package/dist/appstate.js +63 -3
  5. package/dist/away.js +44 -5
  6. package/dist/blueprint.js +3 -7
  7. package/dist/board.js +1 -0
  8. package/dist/cli.js +263 -5
  9. package/dist/codexquota.js +106 -0
  10. package/dist/codexusage.js +10 -0
  11. package/dist/config.js +2 -0
  12. package/dist/context.js +30 -0
  13. package/dist/costs.js +1 -0
  14. package/dist/demon.js +20 -0
  15. package/dist/label.js +33 -0
  16. package/dist/menu.js +17 -0
  17. package/dist/nightcap.js +60 -0
  18. package/dist/nudge.js +47 -18
  19. package/dist/pacing.js +16 -1
  20. package/dist/questions.js +71 -0
  21. package/dist/recap.js +74 -0
  22. package/dist/receipt.js +48 -0
  23. package/dist/recipe.js +79 -0
  24. package/dist/stamps.js +14 -0
  25. package/dist/triggers.js +5 -0
  26. package/dist/usage.js +21 -1
  27. package/dist/vendor/codeburn/antigravity.js +309 -0
  28. package/dist/vendor/codeburn/codex.js +429 -0
  29. package/dist/vendor/codeburn/copilot.js +292 -0
  30. package/dist/vendor/codeburn/gemini.js +195 -0
  31. package/dist/vendor/codeburn/grokbot.js +182 -0
  32. package/dist/vendor/codeburn/kimi.js +178 -0
  33. package/dist/vendor/codeburn/shims/chalk.js +14 -0
  34. package/dist/vendor/codeburn/shims/strip-ansi.js +6 -0
  35. package/dist/vendor/codeburn/src/act/backup.js +83 -0
  36. package/dist/vendor/codeburn/src/act/model-defaults.js +151 -0
  37. package/dist/vendor/codeburn/src/act/types.js +37 -0
  38. package/dist/vendor/codeburn/src/bash-utils.js +204 -0
  39. package/dist/vendor/codeburn/src/behavioral-weight.js +47 -0
  40. package/dist/vendor/codeburn/src/cache-dir.js +26 -0
  41. package/dist/vendor/codeburn/src/cache-refresh-lock.js +543 -0
  42. package/dist/vendor/codeburn/src/cache-sweep.js +67 -0
  43. package/dist/vendor/codeburn/src/classifier.js +209 -0
  44. package/dist/vendor/codeburn/src/claude-identity.js +223 -0
  45. package/dist/vendor/codeburn/src/codex-cache.js +377 -0
  46. package/dist/vendor/codeburn/src/codex-fork-replay.js +232 -0
  47. package/dist/vendor/codeburn/src/codex-jsonl-fields.js +99 -0
  48. package/dist/vendor/codeburn/src/codex-session-index.js +113 -0
  49. package/dist/vendor/codeburn/src/codex-throughput.js +544 -0
  50. package/dist/vendor/codeburn/src/compare-stats.js +405 -0
  51. package/dist/vendor/codeburn/src/config.js +145 -0
  52. package/dist/vendor/codeburn/src/content-utils.js +56 -0
  53. package/dist/vendor/codeburn/src/context-tree-codex.js +329 -0
  54. package/dist/vendor/codeburn/src/context-tree.js +664 -0
  55. package/dist/vendor/codeburn/src/copilot-aiu.js +16 -0
  56. package/dist/vendor/codeburn/src/currency.js +189 -0
  57. package/dist/vendor/codeburn/src/cursor-cache.js +238 -0
  58. package/dist/vendor/codeburn/src/cursor-import.js +402 -0
  59. package/dist/vendor/codeburn/src/cursor-sync.js +256 -0
  60. package/dist/vendor/codeburn/src/daily-cache.js +2036 -0
  61. package/dist/vendor/codeburn/src/data/litellm-snapshot.json +1 -0
  62. package/dist/vendor/codeburn/src/data/pricing-fallback.json +1 -0
  63. package/dist/vendor/codeburn/src/day-aggregator.js +327 -0
  64. package/dist/vendor/codeburn/src/editor-data-dir.js +11 -0
  65. package/dist/vendor/codeburn/src/fetch-utils.js +18 -0
  66. package/dist/vendor/codeburn/src/format.js +118 -0
  67. package/dist/vendor/codeburn/src/fs-utils.js +270 -0
  68. package/dist/vendor/codeburn/src/git-origin.js +334 -0
  69. package/dist/vendor/codeburn/src/granular-history.js +328 -0
  70. package/dist/vendor/codeburn/src/hermes-session-ledger.js +512 -0
  71. package/dist/vendor/codeburn/src/launcher-homes.js +142 -0
  72. package/dist/vendor/codeburn/src/live-sessions.js +358 -0
  73. package/dist/vendor/codeburn/src/math-utils.js +8 -0
  74. package/dist/vendor/codeburn/src/menubar-json.js +294 -0
  75. package/dist/vendor/codeburn/src/models.js +1879 -0
  76. package/dist/vendor/codeburn/src/optimize-one-hour-cache.js +92 -0
  77. package/dist/vendor/codeburn/src/optimize.js +4110 -0
  78. package/dist/vendor/codeburn/src/parse-workers.js +219 -0
  79. package/dist/vendor/codeburn/src/parser.js +6953 -0
  80. package/dist/vendor/codeburn/src/path-privacy.js +26 -0
  81. package/dist/vendor/codeburn/src/plans.js +135 -0
  82. package/dist/vendor/codeburn/src/pr-signals.js +132 -0
  83. package/dist/vendor/codeburn/src/project-filter-warnings.js +33 -0
  84. package/dist/vendor/codeburn/src/provider-issues.js +30 -0
  85. package/dist/vendor/codeburn/src/providers/amp.js +286 -0
  86. package/dist/vendor/codeburn/src/providers/antigravity.js +1731 -0
  87. package/dist/vendor/codeburn/src/providers/claude.js +551 -0
  88. package/dist/vendor/codeburn/src/providers/cline-cli.js +401 -0
  89. package/dist/vendor/codeburn/src/providers/cline.js +63 -0
  90. package/dist/vendor/codeburn/src/providers/codebuff.js +336 -0
  91. package/dist/vendor/codeburn/src/providers/codewhale.js +442 -0
  92. package/dist/vendor/codeburn/src/providers/codex.js +1720 -0
  93. package/dist/vendor/codeburn/src/providers/command-code.js +196 -0
  94. package/dist/vendor/codeburn/src/providers/copilot.js +3278 -0
  95. package/dist/vendor/codeburn/src/providers/crush.js +226 -0
  96. package/dist/vendor/codeburn/src/providers/cursor-agent.js +837 -0
  97. package/dist/vendor/codeburn/src/providers/cursor.js +1163 -0
  98. package/dist/vendor/codeburn/src/providers/devin.js +569 -0
  99. package/dist/vendor/codeburn/src/providers/droid.js +324 -0
  100. package/dist/vendor/codeburn/src/providers/dsh.js +690 -0
  101. package/dist/vendor/codeburn/src/providers/forge.js +245 -0
  102. package/dist/vendor/codeburn/src/providers/gemini.js +230 -0
  103. package/dist/vendor/codeburn/src/providers/goose.js +252 -0
  104. package/dist/vendor/codeburn/src/providers/grok.js +581 -0
  105. package/dist/vendor/codeburn/src/providers/grokbot.js +290 -0
  106. package/dist/vendor/codeburn/src/providers/hermes.js +771 -0
  107. package/dist/vendor/codeburn/src/providers/ibm-bob.js +53 -0
  108. package/dist/vendor/codeburn/src/providers/index.js +360 -0
  109. package/dist/vendor/codeburn/src/providers/kilo-code.js +50 -0
  110. package/dist/vendor/codeburn/src/providers/kimi.js +363 -0
  111. package/dist/vendor/codeburn/src/providers/kimicode.js +402 -0
  112. package/dist/vendor/codeburn/src/providers/kiro.js +1174 -0
  113. package/dist/vendor/codeburn/src/providers/lingtai-tui.js +372 -0
  114. package/dist/vendor/codeburn/src/providers/mistral-vibe-unified.js +236 -0
  115. package/dist/vendor/codeburn/src/providers/mistral-vibe.js +405 -0
  116. package/dist/vendor/codeburn/src/providers/mux.js +242 -0
  117. package/dist/vendor/codeburn/src/providers/open-design.js +217 -0
  118. package/dist/vendor/codeburn/src/providers/openclaude.js +309 -0
  119. package/dist/vendor/codeburn/src/providers/openclaw.js +442 -0
  120. package/dist/vendor/codeburn/src/providers/opencode-file-parser.js +131 -0
  121. package/dist/vendor/codeburn/src/providers/opencode.js +91 -0
  122. package/dist/vendor/codeburn/src/providers/pi.js +429 -0
  123. package/dist/vendor/codeburn/src/providers/quickdesk.js +491 -0
  124. package/dist/vendor/codeburn/src/providers/qwen.js +193 -0
  125. package/dist/vendor/codeburn/src/providers/session-message.js +118 -0
  126. package/dist/vendor/codeburn/src/providers/sqlite-session-parser.js +457 -0
  127. package/dist/vendor/codeburn/src/providers/types.js +5 -0
  128. package/dist/vendor/codeburn/src/providers/vercel-gateway.js +135 -0
  129. package/dist/vendor/codeburn/src/providers/vscode-cline-parser.js +212 -0
  130. package/dist/vendor/codeburn/src/providers/warp.js +575 -0
  131. package/dist/vendor/codeburn/src/providers/zcode.js +249 -0
  132. package/dist/vendor/codeburn/src/providers/zed.js +187 -0
  133. package/dist/vendor/codeburn/src/providers/zerostack.js +139 -0
  134. package/dist/vendor/codeburn/src/quota/antigravity.js +310 -0
  135. package/dist/vendor/codeburn/src/quota/claude.js +244 -0
  136. package/dist/vendor/codeburn/src/quota/cursor.js +301 -0
  137. package/dist/vendor/codeburn/src/quota/security.js +299 -0
  138. package/dist/vendor/codeburn/src/quota/types.js +1 -0
  139. package/dist/vendor/codeburn/src/scan-facts.js +99 -0
  140. package/dist/vendor/codeburn/src/session-cache.js +3040 -0
  141. package/dist/vendor/codeburn/src/session-count-label.js +14 -0
  142. package/dist/vendor/codeburn/src/session-output.js +139 -0
  143. package/dist/vendor/codeburn/src/session-population.js +30 -0
  144. package/dist/vendor/codeburn/src/sessions-report.js +1342 -0
  145. package/dist/vendor/codeburn/src/sqlite.js +528 -0
  146. package/dist/vendor/codeburn/src/sync/otlp.js +420 -0
  147. package/dist/vendor/codeburn/src/telemetry-snapshot.js +244 -0
  148. package/dist/vendor/codeburn/src/token-estimate.js +5 -0
  149. package/dist/vendor/codeburn/src/types.js +16 -0
  150. package/dist/vendor/codeburn/src/work-units.js +126 -0
  151. package/dist/vendor/codeburn/src/workflow-insights.js +228 -0
  152. package/dist/vendor/codeburn/src/wsl.js +198 -0
  153. package/dist/vendor/codeburn/src/yield.js +666 -0
  154. package/package.json +1 -1
@@ -0,0 +1,329 @@
1
+ // @ts-nocheck: codeburn type-checks this under its own tsconfig; Chompyy adds noUncheckedIndexedAccess (see UPSTREAM.md)
2
+ import { readdir, stat } from 'fs/promises';
3
+ import { existsSync } from 'fs';
4
+ import { basename, join } from 'path';
5
+ import { homedir } from 'os';
6
+ import { readSessionLines, readTextHeadSync } from './fs-utils.js';
7
+ import { isRolloutFileName } from './launcher-homes.js';
8
+ import { estimateTokensFromChars } from './token-estimate.js';
9
+ import { add, estimateTokens, IMAGE_TOKEN_FALLBACK, lineToText, newAcc, readChunk, snapshot, } from './context-tree.js';
10
+ // Injected harness content: any tag-shaped block that isn't an image marker,
11
+ // plus the AGENTS.md / mentioned-files preambles Codex prepends to turns.
12
+ function isCodexMetaText(text) {
13
+ const t = text.trimStart();
14
+ if (t.startsWith('<'))
15
+ return !t.startsWith('<image');
16
+ return t.startsWith('# AGENTS.md') || t.startsWith('# Files mentioned');
17
+ }
18
+ function addCodexItem(accs, item) {
19
+ if (item.type === 'message' && item.role === 'assistant') {
20
+ for (const acc of accs) {
21
+ acc.assistantCount += 1;
22
+ acc.messages += 1;
23
+ }
24
+ if (!Array.isArray(item.content))
25
+ return;
26
+ for (const block of item.content) {
27
+ if (block == null || typeof block !== 'object')
28
+ continue;
29
+ const b = block;
30
+ if ((b.type === 'output_text' || b.type === 'text') && typeof b.text === 'string') {
31
+ for (const acc of accs)
32
+ add(acc.assistantText, estimateTokens(b.text));
33
+ }
34
+ }
35
+ }
36
+ else if (item.type === 'message' && item.role === 'user') {
37
+ for (const acc of accs) {
38
+ acc.userCount += 1;
39
+ acc.messages += 1;
40
+ }
41
+ if (!Array.isArray(item.content))
42
+ return;
43
+ for (const block of item.content) {
44
+ if (block == null || typeof block !== 'object')
45
+ continue;
46
+ const b = block;
47
+ if (b.type === 'input_image') {
48
+ for (const acc of accs)
49
+ add(acc.userImage, IMAGE_TOKEN_FALLBACK);
50
+ }
51
+ else if ((b.type === 'input_text' || b.type === 'text') && typeof b.text === 'string') {
52
+ // Rollouts reference images as short "<image name=...>" markers; the
53
+ // pixels never hit the file, so charge a flat estimate per marker.
54
+ if (b.text.trimStart().startsWith('<image')) {
55
+ for (const acc of accs)
56
+ add(acc.userImage, IMAGE_TOKEN_FALLBACK);
57
+ }
58
+ else if (isCodexMetaText(b.text)) {
59
+ for (const acc of accs)
60
+ add(acc.userMeta, estimateTokens(b.text));
61
+ }
62
+ else {
63
+ for (const acc of accs)
64
+ add(acc.userText, estimateTokens(b.text));
65
+ }
66
+ }
67
+ }
68
+ }
69
+ else if (item.type === 'message' && item.role === 'developer') {
70
+ // Injected per-turn instructions (permissions, harness rules), not user text.
71
+ if (!Array.isArray(item.content))
72
+ return;
73
+ for (const block of item.content) {
74
+ if (block == null || typeof block !== 'object')
75
+ continue;
76
+ const b = block;
77
+ if ((b.type === 'input_text' || b.type === 'text') && typeof b.text === 'string') {
78
+ for (const acc of accs)
79
+ add(acc.userMeta, estimateTokens(b.text));
80
+ }
81
+ }
82
+ }
83
+ else if (item.type === 'compaction') {
84
+ // The compaction summary ships encrypted; base64 is ~4/3 of the plaintext,
85
+ // so estimate from the decoded size.
86
+ const encrypted = item.encrypted_content;
87
+ const chars = typeof encrypted === 'string' ? encrypted.length * 0.75 : 0;
88
+ for (const acc of accs)
89
+ add(acc.userCompactSummary, estimateTokensFromChars(chars));
90
+ }
91
+ else if (item.type === 'reasoning') {
92
+ // Tokens are patched from cumulative usage after the walk.
93
+ for (const acc of accs)
94
+ acc.assistantReasoning.count += 1;
95
+ }
96
+ else if (item.type === 'function_call' || item.type === 'custom_tool_call' || item.type === 'local_shell_call' || item.type === 'web_search_call') {
97
+ const tool = typeof item.name === 'string' && item.name
98
+ ? item.name
99
+ : item.type === 'local_shell_call'
100
+ ? 'shell'
101
+ : item.type === 'web_search_call'
102
+ ? 'web_search'
103
+ : 'unknown';
104
+ let argText = '';
105
+ if (typeof item.arguments === 'string')
106
+ argText = item.arguments;
107
+ else if (typeof item.input === 'string')
108
+ argText = item.input;
109
+ else {
110
+ try {
111
+ argText = JSON.stringify(item.arguments ?? item.input ?? item.action ?? {});
112
+ }
113
+ catch {
114
+ argText = '';
115
+ }
116
+ }
117
+ const tokens = estimateTokens(argText);
118
+ for (const acc of accs) {
119
+ add(acc.toolCall, tokens);
120
+ const stat = acc.byTool.get(tool) ?? { count: 0, tokens: 0 };
121
+ add(stat, tokens);
122
+ acc.byTool.set(tool, stat);
123
+ }
124
+ }
125
+ else if (item.type === 'function_call_output' || item.type === 'custom_tool_call_output') {
126
+ let out = '';
127
+ if (typeof item.output === 'string')
128
+ out = item.output;
129
+ else {
130
+ try {
131
+ out = JSON.stringify(item.output ?? '');
132
+ }
133
+ catch {
134
+ out = '';
135
+ }
136
+ }
137
+ const tokens = estimateTokens(out);
138
+ for (const acc of accs)
139
+ add(acc.toolResult, tokens);
140
+ }
141
+ }
142
+ export async function buildCodexContextTree(session) {
143
+ const full = newAcc();
144
+ let segment = newAcc();
145
+ let compactions = 0;
146
+ let model = 'unknown';
147
+ let systemTokens = 0;
148
+ let contextWindow = null;
149
+ let lastTotalReasoning = 0;
150
+ let segmentStartReasoning = 0;
151
+ let lastUsage = null;
152
+ for await (const line of readSessionLines(session.filePath, undefined, { largeLineAsBuffer: true })) {
153
+ const text = lineToText(line);
154
+ if (!text || text.charCodeAt(0) !== 123)
155
+ continue;
156
+ let entry;
157
+ try {
158
+ entry = JSON.parse(text);
159
+ }
160
+ catch {
161
+ continue;
162
+ }
163
+ const payload = entry.payload;
164
+ if (!payload)
165
+ continue;
166
+ if (entry.type === 'session_meta') {
167
+ const instructions = payload.base_instructions?.text;
168
+ if (typeof instructions === 'string')
169
+ systemTokens = estimateTokens(instructions);
170
+ }
171
+ else if (entry.type === 'turn_context') {
172
+ if (typeof payload.model === 'string' && payload.model)
173
+ model = payload.model;
174
+ }
175
+ else if (entry.type === 'compacted') {
176
+ compactions += 1;
177
+ segment = newAcc();
178
+ segmentStartReasoning = lastTotalReasoning;
179
+ if (typeof payload.message === 'string' && payload.message) {
180
+ add(segment.userCompactSummary, estimateTokens(payload.message));
181
+ }
182
+ // The originals already landed in `full`, so the replacement history
183
+ // seeds only the new live window.
184
+ if (Array.isArray(payload.replacement_history)) {
185
+ for (const item of payload.replacement_history) {
186
+ if (item != null && typeof item === 'object')
187
+ addCodexItem([segment], item);
188
+ }
189
+ }
190
+ }
191
+ else if (entry.type === 'response_item') {
192
+ addCodexItem([full, segment], payload);
193
+ }
194
+ else if (entry.type === 'event_msg' && payload.type === 'token_count') {
195
+ const info = payload.info;
196
+ const totalReasoning = info?.total_token_usage?.reasoning_output_tokens;
197
+ if (typeof totalReasoning === 'number')
198
+ lastTotalReasoning = totalReasoning;
199
+ if (info?.last_token_usage)
200
+ lastUsage = info.last_token_usage;
201
+ if (typeof info?.model_context_window === 'number' && info.model_context_window > 0) {
202
+ contextWindow = info.model_context_window;
203
+ }
204
+ }
205
+ }
206
+ full.assistantReasoning.tokens = lastTotalReasoning;
207
+ segment.assistantReasoning.tokens = Math.max(0, lastTotalReasoning - segmentStartReasoning);
208
+ if (systemTokens > 0) {
209
+ add(full.system, systemTokens);
210
+ add(segment.system, systemTokens);
211
+ }
212
+ let reported = null;
213
+ if (lastUsage) {
214
+ const context = lastUsage.total_tokens ?? (lastUsage.input_tokens ?? 0) + (lastUsage.output_tokens ?? 0);
215
+ if (context > 0) {
216
+ // No guessing for OpenAI windows: without model_context_window the
217
+ // percentage is omitted rather than computed against a wrong constant.
218
+ reported = { context, window: contextWindow };
219
+ }
220
+ }
221
+ return {
222
+ session,
223
+ model,
224
+ compactions,
225
+ reported,
226
+ effective: snapshot(segment),
227
+ full: snapshot(full),
228
+ };
229
+ }
230
+ const ROLLOUT_RE = /^rollout-.{19}-(.+)\.jsonl(?:\.zst)?$/;
231
+ // Mirrors the CODEX_HOME handling of providers/codex.ts.
232
+ function codexSessionsRoot() {
233
+ return join(process.env['CODEX_HOME'] ?? join(homedir(), '.codex'), 'sessions');
234
+ }
235
+ async function listRolloutFiles() {
236
+ const root = codexSessionsRoot();
237
+ if (!existsSync(root))
238
+ return [];
239
+ let files;
240
+ try {
241
+ files = await readdir(root, { recursive: true });
242
+ }
243
+ catch {
244
+ return [];
245
+ }
246
+ const rollouts = [];
247
+ const all = new Set(files);
248
+ for (const rel of files) {
249
+ if (rel.endsWith('.zst') && all.has(rel.slice(0, -4)))
250
+ continue;
251
+ const name = basename(rel);
252
+ const match = ROLLOUT_RE.exec(name);
253
+ if (match && isRolloutFileName(name))
254
+ rollouts.push({ filePath: join(root, rel), sessionId: match[1] });
255
+ }
256
+ return rollouts;
257
+ }
258
+ async function statRef(file) {
259
+ try {
260
+ const info = await stat(file.filePath);
261
+ if (!info.isFile() || info.size === 0)
262
+ return null;
263
+ return { ...file, project: '', mtimeMs: info.mtimeMs, sizeBytes: info.size };
264
+ }
265
+ catch {
266
+ return null;
267
+ }
268
+ }
269
+ function newestFirst(refs) {
270
+ return refs.filter((r) => r !== null).sort((a, b) => b.mtimeMs - a.mtimeMs);
271
+ }
272
+ export async function listCodexSessionRefs() {
273
+ const files = await listRolloutFiles();
274
+ return newestFirst(await Promise.all(files.map(statRef)));
275
+ }
276
+ // Id lookups match filenames directly so only the matching files get stated.
277
+ export async function findCodexSession(idPrefix) {
278
+ const matches = (await listRolloutFiles()).filter((f) => f.sessionId.startsWith(idPrefix));
279
+ return newestFirst(await Promise.all(matches.map(statRef)))[0] ?? null;
280
+ }
281
+ // Codex stores no session name; use the head chunk for the cwd (project) and
282
+ // the first real user message as a stand-in title.
283
+ async function readCodexHeadInfo(ref) {
284
+ let chunk;
285
+ try {
286
+ chunk = ref.filePath.endsWith('.zst')
287
+ ? readTextHeadSync(ref.filePath, 262_144).toString('utf-8')
288
+ : await readChunk(ref.filePath, 0, 262_144);
289
+ }
290
+ catch {
291
+ return { project: '', title: '' };
292
+ }
293
+ let project = '';
294
+ let title = '';
295
+ for (const line of chunk.split('\n')) {
296
+ if (project && title)
297
+ break;
298
+ let entry;
299
+ try {
300
+ entry = JSON.parse(line);
301
+ }
302
+ catch {
303
+ continue;
304
+ }
305
+ const payload = entry.payload;
306
+ if (!payload)
307
+ continue;
308
+ if (!project && entry.type === 'session_meta' && typeof payload.cwd === 'string' && payload.cwd) {
309
+ project = basename(payload.cwd);
310
+ }
311
+ if (!title && entry.type === 'response_item' && payload.type === 'message' && payload.role === 'user' && Array.isArray(payload.content)) {
312
+ for (const block of payload.content) {
313
+ const b = block;
314
+ if ((b.type === 'input_text' || b.type === 'text') && typeof b.text === 'string' && b.text.trim() && !isCodexMetaText(b.text)) {
315
+ title = b.text.replace(/\s+/g, ' ').trim().slice(0, 80);
316
+ break;
317
+ }
318
+ }
319
+ }
320
+ }
321
+ return { project, title };
322
+ }
323
+ export async function listRecentCodexSessions(limit = 15) {
324
+ const refs = (await listCodexSessionRefs()).slice(0, limit);
325
+ return Promise.all(refs.map(async (ref) => {
326
+ const info = await readCodexHeadInfo(ref);
327
+ return { ...ref, project: info.project, title: info.title };
328
+ }));
329
+ }