From bae2812bebab2f230ddf788f12340573b1848709 Mon Sep 17 00:00:00 2001 From: Developers Digest <124798203+developersdigest@users.noreply.github.com> Date: Thu, 17 Sep 2026 14:02:45 -0400 Subject: [PATCH] fix: hide execution receipts for catalogue list lookups --- src/__tests__/alexandria-beta.test.ts | 1 + src/commands/alexandria.ts | 5 +++-- src/commands/list.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/__tests__/alexandria-beta.test.ts b/src/__tests__/alexandria-beta.test.ts index 3cc1456ea0..e84e17d4de 100644 --- a/src/__tests__/alexandria-beta.test.ts +++ b/src/__tests__/alexandria-beta.test.ts @@ -288,6 +288,7 @@ it('preserves scoped next requests, pagination and discovery receipts', async () output, ]); expect(result.code).toBe(0); + expect(result.stderr).not.toMatch(/Request ID:|Scrape ID:|Credits:/); expect(requests[0].body.alexandria).toEqual([next]); const parsed = JSON.parse(readFileSync(output, 'utf8')); const page = parsed.data.alexandria[0].data; diff --git a/src/commands/alexandria.ts b/src/commands/alexandria.ts index 77f57caa96..0ca1a11a71 100644 --- a/src/commands/alexandria.ts +++ b/src/commands/alexandria.ts @@ -15,6 +15,7 @@ export type AlexandriaOptions = { output?: string; json?: boolean; pretty?: boolean; + showReceipt?: boolean; }; export function requireAlexandriaKey(apiKey?: string): void { @@ -125,7 +126,7 @@ export async function requestAlexandria( throw new Error('Invalid --request-id.'); requireAlexandriaKey(options.apiKey); // Print before execution so even an interrupted request can reuse its identity. - console.error(`Request ID: ${requestId}`); + if (options.showReceipt !== false) console.error(`Request ID: ${requestId}`); let envelope: Record; try { const app = getClient({ apiKey: options.apiKey, apiUrl: options.apiUrl }); @@ -147,7 +148,7 @@ export async function requestAlexandria( envelope = apiFailure(error); } const receipt = receiptFor(envelope, 'scrape', requestId); - printReceipt(receipt, false); + if (options.showReceipt !== false) printReceipt(receipt, false); printRetry(envelope); return { ...envelope, requestId, receipt }; } diff --git a/src/commands/list.ts b/src/commands/list.ts index 4f095a81f1..97ee1bfaec 100644 --- a/src/commands/list.ts +++ b/src/commands/list.ts @@ -330,7 +330,7 @@ export async function handleList( options: selectors, }, ], - options + { ...options, showReceipt: false } ); receipts.push({ requestId: envelope.requestId,