@sickr/replay 0.4.3 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +23 -8
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -113,10 +113,15 @@ export function handleInit(provider, handle) {
113
113
  catch { /* none */ }
114
114
  writeFileSync(configPath(), JSON.stringify({ ...existing, handle }, null, 2) + '\n');
115
115
  }
116
+ const labelLine = handle
117
+ ? `Your prompts will be labelled "${handle}".\n`
118
+ : 'Tip: set SICKR_HANDLE or run `init --as "<name>"` to label your prompts.\n';
119
+ const nextSteps = provider === 'codex'
120
+ ? 'Next: in Codex, run `/hooks` to review & trust these hooks (Codex gates new hooks),\nthen use Codex as normal and: npx @sickr/replay open --codex\n'
121
+ : 'Use Claude Code as normal, then: npx @sickr/replay open\n';
116
122
  process.stdout.write(`sickr: installed ${p.name} recording hooks in ${settingsPath}\n` +
117
123
  `Runs are recorded locally to ${runsDir()} (secrets redacted).\n` +
118
- (handle ? `Your prompts will be labelled "${handle}".\n` : 'Tip: set SICKR_HANDLE or run `init --as "<name>"` to label your prompts.\n') +
119
- `Use ${p.name} as normal, then: npx @sickr/replay open\n`);
124
+ labelLine + nextSteps);
120
125
  }
121
126
  /** Stop recording: remove SICKR's hooks from this project (both providers), keep runs. */
122
127
  export function handleStop() {
@@ -179,7 +184,11 @@ function openInBrowser(file) {
179
184
  /** A short, human-readable summary of a run: agent + first prompt + event count. */
180
185
  function runSummary(id) {
181
186
  const run = loadRun(id);
182
- const agent = run.events.find((e) => e.kind === 'response')?.label || '—';
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 : '—';
183
192
  const prompt = (run.events.find((e) => e.kind === 'prompt')?.detail || '').replace(/\s+/g, ' ').trim();
184
193
  return { agent, prompt, events: run.events.length };
185
194
  }
@@ -221,11 +230,15 @@ function handleOpen(runId, provider) {
221
230
  `→ ${out} (newest run; use \`list\` to see others, \`open <id>\` to pick one)\n`);
222
231
  openInBrowser(out);
223
232
  }
224
- function handleList() {
233
+ function handleList(provider) {
225
234
  const dir = runsDir();
226
- const files = existsSync(dir) ? readdirSync(dir).filter((f) => f.endsWith('.ndjson')) : [];
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
+ }
227
240
  if (files.length === 0) {
228
- 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');
229
242
  return;
230
243
  }
231
244
  files
@@ -330,9 +343,11 @@ async function main() {
330
343
  handleOpen(rest.find((a) => !a.startsWith('-')), openProvider);
331
344
  return;
332
345
  }
333
- case 'list':
334
- handleList();
346
+ case 'list': {
347
+ const listProvider = rest.includes('--codex') ? 'codex' : rest.includes('--claude') ? 'claude' : undefined;
348
+ handleList(listProvider);
335
349
  return;
350
+ }
336
351
  case 'stop':
337
352
  handleStop();
338
353
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sickr/replay",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "type": "module",
5
5
  "description": "npx @sickr/replay — local Claude Code audit + one-click share. The free wedge into SICKR.",
6
6
  "bin": { "replay": "dist/cli.js" },