@sickr/replay 0.4.4 → 0.4.5
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/dist/cli.js +16 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -184,7 +184,11 @@ function openInBrowser(file) {
|
|
|
184
184
|
/** A short, human-readable summary of a run: agent + first prompt + event count. */
|
|
185
185
|
function runSummary(id) {
|
|
186
186
|
const run = loadRun(id);
|
|
187
|
-
|
|
187
|
+
// Use the LATEST response label — long-lived runs may carry pre-provider
|
|
188
|
+
// ('Response') labels from older CLI versions in their early events.
|
|
189
|
+
const responses = run.events.filter((e) => e.kind === 'response');
|
|
190
|
+
const last = responses.length ? responses[responses.length - 1].label : '';
|
|
191
|
+
const agent = last && last !== 'Response' ? last : '—';
|
|
188
192
|
const prompt = (run.events.find((e) => e.kind === 'prompt')?.detail || '').replace(/\s+/g, ' ').trim();
|
|
189
193
|
return { agent, prompt, events: run.events.length };
|
|
190
194
|
}
|
|
@@ -226,11 +230,15 @@ function handleOpen(runId, provider) {
|
|
|
226
230
|
`→ ${out} (newest run; use \`list\` to see others, \`open <id>\` to pick one)\n`);
|
|
227
231
|
openInBrowser(out);
|
|
228
232
|
}
|
|
229
|
-
function handleList() {
|
|
233
|
+
function handleList(provider) {
|
|
230
234
|
const dir = runsDir();
|
|
231
|
-
|
|
235
|
+
let files = existsSync(dir) ? readdirSync(dir).filter((f) => f.endsWith('.ndjson')) : [];
|
|
236
|
+
if (provider) {
|
|
237
|
+
const want = PROVIDERS[provider].label;
|
|
238
|
+
files = files.filter((f) => loadRun(f.replace(/\.ndjson$/, '')).events.some((e) => e.kind === 'response' && e.label === want));
|
|
239
|
+
}
|
|
232
240
|
if (files.length === 0) {
|
|
233
|
-
process.stdout.write('sickr: no runs yet.\n');
|
|
241
|
+
process.stdout.write(provider ? `sickr: no ${PROVIDERS[provider].label} runs yet.\n` : 'sickr: no runs yet.\n');
|
|
234
242
|
return;
|
|
235
243
|
}
|
|
236
244
|
files
|
|
@@ -335,9 +343,11 @@ async function main() {
|
|
|
335
343
|
handleOpen(rest.find((a) => !a.startsWith('-')), openProvider);
|
|
336
344
|
return;
|
|
337
345
|
}
|
|
338
|
-
case 'list':
|
|
339
|
-
|
|
346
|
+
case 'list': {
|
|
347
|
+
const listProvider = rest.includes('--codex') ? 'codex' : rest.includes('--claude') ? 'claude' : undefined;
|
|
348
|
+
handleList(listProvider);
|
|
340
349
|
return;
|
|
350
|
+
}
|
|
341
351
|
case 'stop':
|
|
342
352
|
handleStop();
|
|
343
353
|
return;
|
package/package.json
CHANGED