@purveyors/cli 0.15.1 → 0.19.2

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/README.md CHANGED
@@ -12,7 +12,7 @@ Use `purvey --help` for quick command discovery, `purvey context` for the dense
12
12
  - Package: `@purveyors/cli`
13
13
  - Runtime: Node.js 20+
14
14
  - No pre-existing session required: `auth`, `config`, `context`, `manifest`
15
- - Viewer role required: `catalog`
15
+ - Viewer role required: `catalog` (excluding structured process filters on `catalog search`)
16
16
  - Member role required: `inventory`, `roast`, `sales`, `tasting`
17
17
  - Preferred machine-readable contract: `purvey manifest`
18
18
  - Dense human-readable reference: `purvey context`
@@ -68,12 +68,17 @@ purvey auth login
68
68
  # For agents, CI, or remote machines, use headless flow:
69
69
  # purvey auth login --headless
70
70
 
71
+ # If automatic browser callback handling fails or you paste a bad URL, paste the full callback URL back into the terminal. The CLI keeps waiting until a valid callback is received.
72
+
71
73
  # 2. Confirm the session and role
72
74
  purvey auth status
73
75
 
74
- # 3. Search the catalog (requires viewer role)
76
+ # 3. Search the catalog (viewer role for basic filters, member role for structured process filters)
75
77
  purvey catalog search --origin "Ethiopia" --stocked --pretty
76
78
 
79
+ # Example with structured process filters and proof output
80
+ purvey catalog search --origin "Ethiopia" --processing-base-method "Washed" --include-proof --pretty
81
+
77
82
  # 4. Check inventory (requires member role)
78
83
  purvey inventory list --stocked --pretty
79
84
 
@@ -100,18 +105,18 @@ Use the right reference surface for the job:
100
105
 
101
106
  The npm package is both a binary and a shared TypeScript product surface. `coffee-app` and agent runtimes import CLI business functions directly, so exported subpaths are part of the supported machine contract.
102
107
 
103
- | Import path | Use it for |
104
- | -------------------------- | ---------------------------------------------- |
105
- | `@purveyors/cli` | CLI entrypoint package root |
106
- | `@purveyors/cli/catalog` | Catalog search, lookup, stats, similar coffees |
107
- | `@purveyors/cli/inventory` | Green coffee inventory operations |
108
- | `@purveyors/cli/roast` | Roast profile operations |
109
- | `@purveyors/cli/sales` | Sales record operations |
110
- | `@purveyors/cli/tasting` | Tasting note and rating operations |
111
- | `@purveyors/cli/lib` | Shared library helpers |
112
- | `@purveyors/cli/manifest` | Stable machine-readable CLI manifest |
113
- | `@purveyors/cli/artisan` | Artisan `.alog` parsing and import utilities |
114
- | `@purveyors/cli/ai` | AI helper surface used by CLI workflows |
108
+ | Import path | Use it for |
109
+ | -------------------------- | ------------------------------------------------------------------------------------ |
110
+ | `@purveyors/cli` | CLI entrypoint package root |
111
+ | `@purveyors/cli/catalog` | Catalog search, lookup, stats, premium ranking, supplier aggregates, similar coffees |
112
+ | `@purveyors/cli/inventory` | Green coffee inventory operations |
113
+ | `@purveyors/cli/roast` | Roast profile operations |
114
+ | `@purveyors/cli/sales` | Sales record operations |
115
+ | `@purveyors/cli/tasting` | Tasting note and rating operations |
116
+ | `@purveyors/cli/lib` | Shared library helpers |
117
+ | `@purveyors/cli/manifest` | Stable machine-readable CLI manifest |
118
+ | `@purveyors/cli/artisan` | Artisan `.alog` parsing and import utilities |
119
+ | `@purveyors/cli/ai` | AI helper surface used by CLI workflows |
115
120
 
116
121
  Shell integrations should usually start with `purvey manifest`. In-process agent and website integrations should import the smallest relevant subpath instead of shelling out when they are already running in Node.js.
117
122
 
@@ -128,7 +133,8 @@ No pre-existing session is required for `auth`, `config`, `context`, or `manifes
128
133
 
129
134
  All remote data commands require a valid authenticated session:
130
135
 
131
- - `catalog` requires the `viewer` role
136
+ - `catalog` requires the `viewer` role by default
137
+ - `catalog search` structured process filters require the `member` role under the current session-authenticated CLI path
132
138
  - `inventory`, `roast`, `sales`, and `tasting` require the `member` role
133
139
 
134
140
  `purvey` uses Google OAuth through purveyors.io.
@@ -148,6 +154,8 @@ purvey auth login --headless
148
154
  # Paste the full callback URL back into the terminal
149
155
  ```
150
156
 
157
+ If the browser cannot return to the CLI during interactive login, paste the full callback URL back into the terminal. Invalid pasted URLs are ignored, and the CLI keeps waiting until a valid callback is received. Use `purvey auth login --headless` when you need the CLI to print the OAuth URL for another browser.
158
+
151
159
  Status:
152
160
 
153
161
  ```bash
@@ -166,10 +174,10 @@ Credentials are stored at `~/.config/purvey/credentials.json`.
166
174
 
167
175
  ### Auth roles
168
176
 
169
- | Role | Access |
170
- | -------- | ------------------------------------------------------------------- |
171
- | `viewer` | `catalog search`, `catalog get`, `catalog stats`, `catalog similar` |
172
- | `member` | All viewer commands, plus `inventory`, `roast`, `sales`, `tasting` |
177
+ | Role | Access |
178
+ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
179
+ | `viewer` | `catalog search`, `catalog get`, `catalog stats`, excluding structured process filters |
180
+ | `member` | All viewer commands, `catalog similar`, structured process filters on `catalog search`, plus `inventory`, `roast`, `sales`, `tasting` under the session-authenticated CLI path |
173
181
 
174
182
  `auth`, `config`, `context`, and `manifest` remain available without a pre-existing session.
175
183
 
@@ -274,7 +282,7 @@ purvey auth logout
274
282
 
275
283
  Notes:
276
284
 
277
- - `auth login` uses browser-based Google OAuth.
285
+ - `auth login` uses browser-based Google OAuth, listens for the localhost callback, and also accepts a pasted callback URL if the browser cannot return to the CLI. Invalid pasted callback URLs are ignored so you can paste again while the CLI keeps waiting.
278
286
  - `auth login --headless` prints an OAuth URL and accepts a pasted callback URL.
279
287
  - `auth status --json` is the safest mode for scripts.
280
288
  - `auth status --csv` is supported for spreadsheet-style checks, but JSON remains the better integration format.
@@ -284,12 +292,21 @@ Notes:
284
292
  - `purvey catalog search`
285
293
  - `purvey catalog get <id>`
286
294
  - `purvey catalog stats`
295
+ - `purvey catalog rank-premium`
296
+ - `purvey catalog supplier-list`
297
+ - `purvey catalog supplier-detail <supplier>`
298
+ - `purvey catalog supplier-rank`
287
299
  - `purvey catalog similar <id>`
288
300
 
289
301
  `catalog search` filters:
290
302
 
291
303
  - `--origin <text>`; origin, country, continent, or region
292
304
  - `--process <method>`; processing method
305
+ - `--processing-base-method <method>`; canonical structured process base method
306
+ - `--fermentation-type <type>`; structured fermentation type
307
+ - `--process-additive <additive>`; disclosed process additive
308
+ - `--processing-disclosure-level <level>`; structured process disclosure level
309
+ - `--processing-confidence-min <n>`; minimum structured process confidence from `0` to `1`
293
310
  - `--price-min <n>`; minimum USD/lb
294
311
  - `--price-max <n>`; maximum USD/lb
295
312
  - `--flavor <keywords>`; comma-separated flavor terms
@@ -303,29 +320,70 @@ Notes:
303
320
  - `--sort <price|price-desc|name|origin|newest>`
304
321
  - `--offset <n>`; pagination offset
305
322
  - `--limit <n>`; default `10`
323
+ - `--include-proof`; request canonical proof summaries from `/v1/catalog?include=proof`
306
324
 
307
325
  `catalog similar <id>` options:
308
326
 
309
- - `--threshold <0-1>`; default `0.70`
310
- - `--limit <n>`; default `10`
311
- - `--stocked-only`
327
+ - `--threshold <score>`; canonical similarity threshold `0.5` to `0.99`, default `0.70`
328
+ - `--limit <count>`; default `10`, max `25`
329
+ - `--stocked-only`; request only currently stocked coffees
330
+ - `--mode <all|likely_same|similar_profile>`; default `all`
331
+
332
+ `catalog rank-premium` options:
333
+
334
+ - `--origin <origin>`; optional origin filter
335
+ - `--process <method>`; optional process filter
336
+ - `--supplier <name>`; optional supplier filter
337
+ - `--stocked`; only include currently stocked coffees
338
+ - `--price-max <n>`; maximum USD/lb
339
+ - `--min-score <n>`; minimum Purveyor Score
340
+ - `--include-unscored`; include unscored rows after scored rows
341
+ - `--sample-size <n>`; rows to sample before ranking, default `250`, max `5000`
342
+ - `--limit <n>`; default `10`, max `50`
343
+
344
+ `catalog supplier-*` options:
345
+
346
+ - `supplier-list`: `--stocked`, `--sample-size <n>` (catalog rows per fetch page, default `5000`, max `5000`), `--limit <n>`
347
+ - `supplier-detail <supplier>`: `--stocked`, `--top-coffees <n>`, `--sample-size <n>` (catalog rows per fetch page, default `5000`, max `5000`)
348
+ - `supplier-rank`: `--stocked`, `--min-coffees <n>`, `--sample-size <n>` (catalog rows per fetch page, default `5000`, max `5000`), `--limit <n>`
312
349
 
313
350
  Examples:
314
351
 
315
352
  ```bash
316
353
  purvey catalog search --origin "Ethiopia" --pretty
354
+ purvey catalog search --processing-base-method "Natural" --fermentation-type "Anaerobic" --pretty
355
+ purvey catalog search --process-additive "hops" --processing-confidence-min 0.8 --pretty
317
356
  purvey catalog search --supplier "Royal Coffee" --stocked --pretty
318
357
  purvey catalog search --ids "1182,1183,1200"
319
358
  purvey catalog search --stocked --sort price --offset 10 --limit 10
359
+ purvey catalog search --origin "Ethiopia" --include-proof --json
360
+ PARCHMENT_API_KEY="$PURVEYORS_API_KEY" purvey catalog search --origin "Ethiopia" --include-proof --limit 5 --json
320
361
  purvey catalog similar 1182 --threshold 0.85 --stocked-only --pretty
362
+ purvey catalog similar 1182 --json | jq '.data.groups.canonical_candidates'
363
+ purvey catalog rank-premium --stocked --limit 10 --pretty
364
+ purvey catalog supplier-rank --stocked --min-coffees 3 --json
365
+ purvey catalog supplier-detail "Royal Coffee" --pretty
321
366
  purvey catalog stats --pretty
322
367
  purvey catalog get 1182 --pretty
368
+ purvey catalog get 1182 --include-proof --json
323
369
  ```
324
370
 
325
371
  Notes:
326
372
 
327
- - Catalog commands require an authenticated `viewer` role.
373
+ - Catalog commands require an authenticated `viewer` role by default.
374
+ - Structured process filters on `catalog search` require an authenticated `member` role under the current session-authenticated CLI path.
375
+ - Structured process filters use the canonical `/v1/catalog` query contract names while preserving the legacy `--process` label filter.
376
+ - `--include-proof` is an opt-in API-backed catalog read. It consumes the canonical proof summary returned by `/v1/catalog?include=proof`; the CLI does not compute proof fields locally or duplicate web/API proof logic.
377
+ - `--include-proof` rejects CLI-only filters that `/v1/catalog` cannot yet preserve exactly, such as `--flavor`, `--supplier`, `--drying-method`, and `--sort newest`.
378
+ - If you want proof output against an API-key deployment, set `PARCHMENT_API_KEY` or `PURVEYORS_API_KEY` before running the command. Otherwise the CLI uses your logged-in Purveyors session token.
328
379
  - `catalog get` and `catalog similar` both take `coffee_catalog.catalog_id`.
380
+ - `catalog rank-premium` reads `coffee_catalog.purveyor_score` and returns confidence, tier, factor breakdown, version, and update metadata in the `purveyor_score` object; the CLI does not recompute the upstream Purveyor Score model.
381
+ - Catalog intelligence responses include `meta.sample_limited`, `meta.sample_order`, and `meta.truncated` where relevant so agents can distinguish ranked samples from full supplier aggregates. Supplier aggregate responses also include `meta.rows_examined`.
382
+ - Supplier aggregate commands summarize catalog row counts, stocked counts, Purveyor Score coverage, average score, average confidence, price range, origin/process coverage, and representative top coffees with score qualifiers.
383
+ - `catalog similar` uses the beta canonical `/v1/catalog/{id}/similar` API contract, not the legacy direct RPC path.
384
+ - `catalog similar --json` requires member access or a paid API tier and returns the grouped canonical response object: `data.target`, `data.groups.canonical_candidates`, `data.groups.similar_recommendations`, optional `data.matches`, and `meta`.
385
+ - `canonical_candidates` are likely same-lot candidates; `similar_recommendations` are substitutes/profile matches and include blocker reasons when identity gates disagree.
386
+ - The command preserves `classification_version`, `query_strategy`, score dimensions, proof summaries, pricing metadata, and classification/blocker details supplied by the API.
329
387
  - `catalog stats` returns aggregate catalog metrics, not your personal inventory metrics.
330
388
 
331
389
  ### inventory
@@ -466,6 +524,7 @@ Notes:
466
524
 
467
525
  - Roast commands require an authenticated `member` role.
468
526
  - `--coffee-id` uses inventory IDs.
527
+ - `roast import` and `roast watch` normalize pasted paths by trimming whitespace, removing one layer of matching quotes, and accepting common shell-escaped characters.
469
528
  - `roast watch --auto-match` is mutually exclusive with `--coffee-id`.
470
529
  - `roast watch --commit-mode` defaults to `batch`.
471
530
 
@@ -526,19 +585,20 @@ Notes:
526
585
 
527
586
  ### tasting
528
587
 
529
- - `purvey tasting get <catalog-id>`
530
- - `purvey tasting rate [inventory-id]`
588
+ - `purvey tasting get <bean-id>`
589
+ - `purvey tasting rate [bean-id]`
531
590
 
532
591
  ID distinction:
533
592
 
534
- - `tasting get` takes a `catalog_id`
535
- - `tasting rate` takes an `inventory id`
593
+ - `tasting get <bean-id>` takes a `catalog_id`
594
+ - `tasting rate [bean-id]` takes an inventory ID
595
+ - The CLI token is `bean-id` for both tasting commands, but the backing ID type is different
536
596
 
537
- `purvey tasting get <catalog-id>` options:
597
+ `purvey tasting get <bean-id>` options:
538
598
 
539
599
  - `--filter <user|supplier|both>`; default `both`
540
600
 
541
- `purvey tasting rate [inventory-id]` options:
601
+ `purvey tasting rate [bean-id]` options:
542
602
 
543
603
  - `--aroma <1-5>`; required in flag mode
544
604
  - `--body <1-5>`; required in flag mode
@@ -649,6 +709,8 @@ purvey roast watch ~/artisan/ --auto-match
649
709
  purvey roast watch --resume
650
710
  ```
651
711
 
712
+ Watch mode runs until Ctrl+C or SIGTERM. On shutdown it waits for active imports, commits queued batch-mode roasts, prints the verification summary, and leaves session state available for `--resume`.
713
+
652
714
  ### Export records for spreadsheets
653
715
 
654
716
  ```bash
@@ -670,7 +732,7 @@ purvey auth status 2>/dev/null | jq .
670
732
 
671
733
  Use the right ID for the right command.
672
734
 
673
- - `catalog_id`: `coffee_catalog` rows; used by `catalog get`, `inventory add --catalog-id`, `tasting get`, `roast list --catalog-id`
735
+ - `catalog_id`: `coffee_catalog` rows; used by `catalog get`, `catalog similar`, `inventory add --catalog-id`, `tasting get`, `roast list --catalog-id`
674
736
  - `inventory id`: `green_coffee_inv` rows; used by `inventory get/update/delete`, `roast --coffee-id`, `tasting rate`, `roast list --coffee-id`
675
737
  - `roast_id`: `roast_data` rows; used by `roast get/delete`, `sales --roast-id`, `roast list --roast-id`
676
738
  - `sales record` also supports resolving a roast from `inventory id` plus `--batch-name`; if that selector is ambiguous, use exact `roast_id`
@@ -681,6 +743,8 @@ Use the right ID for the right command.
681
743
  - `PURVEYORS_SUPABASE_URL`: override the Supabase project URL
682
744
  - `PURVEYORS_SUPABASE_ANON_KEY`: override the Supabase anon key
683
745
  - `PURVEYORS_BASE_URL`: override the Purveyors web base URL
746
+ - `PURVEYORS_API_KEY`: API-key token used by API-backed catalog proof reads and paid-tier similarity reads when you want to call canonical API contracts without relying on the local OAuth session
747
+ - `PARCHMENT_API_KEY`: alternate API-key variable accepted for the same API-backed proof and paid-tier similarity path
684
748
  - `PURVEY_DEBUG`: enable verbose error output
685
749
 
686
750
  ## For AI agents
@@ -699,7 +763,7 @@ Why this CLI works well for agents:
699
763
 
700
764
  - stable command names
701
765
  - structured stdout by default
702
- - headless auth flow
766
+ - browser auth with pasted-callback fallback and headless auth
703
767
  - documented exit codes and role boundaries
704
768
  - dedicated machine-readable manifest command
705
769
  - dedicated dense human-readable reference command
@@ -709,6 +773,14 @@ Why this CLI works well for agents:
709
773
 
710
774
  The scripting contract is simple: stdout carries successful payloads, stderr carries status and fatal errors, and exit codes stay stable.
711
775
 
776
+ Agent integration rules of thumb:
777
+
778
+ - Discover first with `purvey manifest`, then call the narrowest command or package subpath that fits the job.
779
+ - Use `purvey context` when a human-readable operator summary is useful before tool selection.
780
+ - Prefer OAuth session tokens for normal user workflows; use `PURVEYORS_API_KEY` or `PARCHMENT_API_KEY` only when you intentionally need the API-key catalog proof path or a paid-tier similarity path.
781
+ - Treat `--include-proof` as API output, not a local scoring feature. If a filter cannot round-trip through `/v1/catalog?include=proof`, the CLI rejects that invocation instead of returning misleading proof data.
782
+ - Treat `catalog similar` as the canonical `/v1/catalog/{id}/similar` contract. Preserve the distinction between `canonical_candidates` and `similar_recommendations`; do not flatten or re-sort grouped results unless you have a specific downstream reason.
783
+
712
784
  ## Troubleshooting
713
785
 
714
786
  **`Error: not logged in` or exit code 3**
@@ -1,6 +1,23 @@
1
1
  import { Command } from 'commander';
2
+ interface CallbackResult {
3
+ accessToken: string;
4
+ refreshToken: string;
5
+ expiresIn: number;
6
+ }
7
+ interface ManualCallbackReader {
8
+ promise: Promise<CallbackResult>;
9
+ close: () => void;
10
+ }
11
+ type ManualCallbackQuestion = (query: string, callback: (answer: string) => void) => void;
12
+ /**
13
+ * Extract Supabase OAuth tokens from a full callback URL, URL fragment, or
14
+ * query string. Exported for auth-flow contract tests.
15
+ */
16
+ export declare function parseOAuthCallbackUrl(callbackUrl: string): CallbackResult;
17
+ export declare function createManualCallbackReaderForQuestion(question: ManualCallbackQuestion, closeQuestion: () => void, canRead: boolean): ManualCallbackReader | null;
2
18
  /**
3
19
  * Build and return the `auth` command subtree.
4
20
  */
5
21
  export declare function buildAuthCommand(): Command;
22
+ export {};
6
23
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuUpC;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAkF1C"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAQD,UAAU,oBAAoB;IAC5B,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACjC,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;AA6G1F;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAoCzE;AAED,wBAAgB,qCAAqC,CACnD,QAAQ,EAAE,sBAAsB,EAChC,aAAa,EAAE,MAAM,IAAI,EACzB,OAAO,EAAE,OAAO,GACf,oBAAoB,GAAG,IAAI,CAwC7B;AAoOD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAkF1C"}
@@ -6,6 +6,7 @@ import { outputData, shouldUseInteractiveOutput, success, info, warn } from '../
6
6
  import { withErrorHandling, AuthError, exitCodeForError } from '../lib/errors.js';
7
7
  import chalk from 'chalk';
8
8
  import ora from 'ora';
9
+ import { createInterface } from 'readline';
9
10
  const DEFAULT_CALLBACK_HOST = 'localhost';
10
11
  const CALLBACK_PATH = '/auth/callback';
11
12
  /**
@@ -86,60 +87,177 @@ function startCallbackServer() {
86
87
  reject(new AuthError('Failed to start callback server.'));
87
88
  return;
88
89
  }
89
- resolve({ port: addr.port, tokenPromise });
90
+ resolve({
91
+ port: addr.port,
92
+ tokenPromise,
93
+ close: () => {
94
+ try {
95
+ server.close();
96
+ }
97
+ catch {
98
+ // Server may already be closed after an automatic callback.
99
+ }
100
+ },
101
+ });
90
102
  });
91
103
  server.on('error', (err) => reject(err));
92
104
  });
93
105
  }
106
+ /**
107
+ * Extract Supabase OAuth tokens from a full callback URL, URL fragment, or
108
+ * query string. Exported for auth-flow contract tests.
109
+ */
110
+ export function parseOAuthCallbackUrl(callbackUrl) {
111
+ const trimmed = callbackUrl.trim();
112
+ if (!trimmed) {
113
+ throw new AuthError('No URL provided.');
114
+ }
115
+ // Supabase usually puts tokens in the fragment:
116
+ // #access_token=...&refresh_token=...
117
+ let tokenStr = '';
118
+ if (trimmed.includes('#')) {
119
+ tokenStr = trimmed.split('#')[1] ?? '';
120
+ }
121
+ else if (trimmed.includes('?')) {
122
+ tokenStr = trimmed.split('?').slice(1).join('?');
123
+ }
124
+ else {
125
+ // Allow pasting just the fragment/query content.
126
+ tokenStr = trimmed;
127
+ }
128
+ const params = new URLSearchParams(tokenStr);
129
+ const accessToken = params.get('access_token');
130
+ const refreshToken = params.get('refresh_token');
131
+ const expiresIn = params.get('expires_in');
132
+ if (!accessToken || !refreshToken) {
133
+ throw new AuthError('Could not extract tokens from the URL.\n' +
134
+ ' Make sure you copied the full callback URL including the #access_token=... part.');
135
+ }
136
+ return {
137
+ accessToken,
138
+ refreshToken,
139
+ expiresIn: parseInt(expiresIn ?? '3600', 10),
140
+ };
141
+ }
142
+ export function createManualCallbackReaderForQuestion(question, closeQuestion, canRead) {
143
+ if (!canRead)
144
+ return null;
145
+ let closed = false;
146
+ const prompt = chalk.bold(' If the browser cannot return here, paste the full callback URL: ');
147
+ const promise = new Promise((resolve) => {
148
+ const ask = () => {
149
+ if (closed)
150
+ return;
151
+ question(prompt, (answer) => {
152
+ if (closed)
153
+ return;
154
+ try {
155
+ const callbackResult = parseOAuthCallbackUrl(answer);
156
+ closed = true;
157
+ closeQuestion();
158
+ resolve(callbackResult);
159
+ }
160
+ catch (error) {
161
+ const message = error instanceof Error ? error.message : 'Failed to parse callback URL.';
162
+ console.log(chalk.yellow(` Ignoring invalid callback URL: ${message}`));
163
+ console.log(chalk.dim(' Still waiting for the browser callback; paste a valid URL to retry.'));
164
+ ask();
165
+ }
166
+ });
167
+ };
168
+ ask();
169
+ });
170
+ return {
171
+ promise,
172
+ close: () => {
173
+ if (closed)
174
+ return;
175
+ closed = true;
176
+ closeQuestion();
177
+ },
178
+ };
179
+ }
180
+ function createManualCallbackReader() {
181
+ if (!process.stdin.isTTY)
182
+ return null;
183
+ const rl = createInterface({
184
+ input: process.stdin,
185
+ output: process.stdout,
186
+ });
187
+ return createManualCallbackReaderForQuestion(rl.question.bind(rl), () => rl.close(), process.stdin.isTTY);
188
+ }
94
189
  /**
95
190
  * `purvey auth login`
96
191
  * Opens a browser for Google OAuth via Supabase, captures the callback token.
97
192
  */
98
193
  const loginAction = withErrorHandling(async () => {
99
- const { port, tokenPromise } = await startCallbackServer();
194
+ const callbackServer = await startCallbackServer();
195
+ const { port, tokenPromise } = callbackServer;
100
196
  const redirectTo = `http://${DEFAULT_CALLBACK_HOST}:${port}${CALLBACK_PATH}`;
101
- const supabase = createAnonClient();
102
- const { data, error } = await supabase.auth.signInWithOAuth({
103
- provider: 'google',
104
- options: { redirectTo },
105
- });
106
- if (error || !data.url) {
107
- throw new AuthError('Failed to generate OAuth URL.', error);
108
- }
109
- console.log(chalk.bold('\n Opening browser for authentication...'));
110
- console.log(chalk.dim(` If the browser does not open, visit:\n ${data.url}\n`));
111
- // Open browser cross-platform (graceful fallback for headless)
112
197
  try {
113
- const { spawn } = await import('child_process');
114
- const openCmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
115
- const child = spawn(openCmd, [data.url], { detached: true, stdio: 'ignore' });
116
- child.on('error', () => {
117
- // Browser open failed (headless environment) — user can visit URL manually
198
+ const supabase = createAnonClient();
199
+ const { data, error } = await supabase.auth.signInWithOAuth({
200
+ provider: 'google',
201
+ options: { redirectTo },
118
202
  });
119
- child.unref();
203
+ if (error || !data.url) {
204
+ throw new AuthError('Failed to generate OAuth URL.', error);
205
+ }
206
+ console.log(chalk.bold('\n Opening browser for authentication...'));
207
+ console.log(chalk.dim(` If the browser does not open, visit:\n ${data.url}\n`));
208
+ console.log(chalk.dim(' Waiting for the browser callback. If the browser lands on a localhost URL but\n' +
209
+ ' the CLI does not finish, copy that full URL and paste it below.\n'));
210
+ // Open browser cross-platform (graceful fallback for headless)
211
+ try {
212
+ const { spawn } = await import('child_process');
213
+ const openCmd = process.platform === 'darwin'
214
+ ? 'open'
215
+ : process.platform === 'win32'
216
+ ? 'start'
217
+ : 'xdg-open';
218
+ const child = spawn(openCmd, [data.url], { detached: true, stdio: 'ignore' });
219
+ child.on('error', () => {
220
+ // Browser open failed (headless environment) — user can visit URL manually
221
+ });
222
+ child.unref();
223
+ }
224
+ catch {
225
+ // Gracefully ignore — URL is already printed above
226
+ }
227
+ const manualReader = createManualCallbackReader();
228
+ const spinner = ora({ text: 'Waiting for authentication...', stream: process.stderr }).start();
229
+ let callbackResult;
230
+ try {
231
+ callbackResult = await Promise.race([
232
+ tokenPromise,
233
+ ...(manualReader ? [manualReader.promise] : []),
234
+ ]);
235
+ }
236
+ finally {
237
+ manualReader?.close();
238
+ }
239
+ const { accessToken, refreshToken, expiresIn } = callbackResult;
240
+ spinner.succeed('Authentication received');
241
+ // Fetch user info to confirm identity
242
+ const client = createAnonClient();
243
+ await client.auth.setSession({ access_token: accessToken, refresh_token: refreshToken });
244
+ const { data: { user }, } = await client.auth.getUser();
245
+ const creds = {
246
+ accessToken,
247
+ refreshToken,
248
+ expiresAt: Date.now() + expiresIn * 1000,
249
+ user: {
250
+ id: user?.id ?? 'unknown',
251
+ email: user?.email ?? 'unknown',
252
+ role: user?.role,
253
+ },
254
+ };
255
+ await writeCredentials(creds);
256
+ success(`Logged in as ${chalk.bold(creds.user.email)}`);
120
257
  }
121
- catch {
122
- // Gracefully ignore — URL is already printed above
258
+ finally {
259
+ callbackServer.close();
123
260
  }
124
- const spinner = ora({ text: 'Waiting for authentication...', stream: process.stderr }).start();
125
- const { accessToken, refreshToken, expiresIn } = await tokenPromise;
126
- spinner.succeed('Authentication received');
127
- // Fetch user info to confirm identity
128
- const client = createAnonClient();
129
- await client.auth.setSession({ access_token: accessToken, refresh_token: refreshToken });
130
- const { data: { user }, } = await client.auth.getUser();
131
- const creds = {
132
- accessToken,
133
- refreshToken,
134
- expiresAt: Date.now() + expiresIn * 1000,
135
- user: {
136
- id: user?.id ?? 'unknown',
137
- email: user?.email ?? 'unknown',
138
- role: user?.role,
139
- },
140
- };
141
- await writeCredentials(creds);
142
- success(`Logged in as ${chalk.bold(creds.user.email)}`);
143
261
  });
144
262
  /**
145
263
  * `purvey auth status`
@@ -213,27 +331,7 @@ const headlessLoginAction = withErrorHandling(async () => {
213
331
  if (!callbackUrl) {
214
332
  throw new AuthError('No URL provided.');
215
333
  }
216
- // Extract tokens from the URL fragment or query params
217
- // Supabase puts them in the fragment: #access_token=...&refresh_token=...
218
- let tokenStr = '';
219
- if (callbackUrl.includes('#')) {
220
- tokenStr = callbackUrl.split('#')[1];
221
- }
222
- else if (callbackUrl.includes('?')) {
223
- tokenStr = callbackUrl.split('?').slice(1).join('?');
224
- }
225
- else {
226
- // Maybe they pasted just the fragment part
227
- tokenStr = callbackUrl;
228
- }
229
- const params = new URLSearchParams(tokenStr);
230
- const accessToken = params.get('access_token');
231
- const refreshToken = params.get('refresh_token');
232
- const expiresIn = params.get('expires_in');
233
- if (!accessToken || !refreshToken) {
234
- throw new AuthError('Could not extract tokens from the URL.\n' +
235
- ' Make sure you copied the full callback URL including the #access_token=... part.');
236
- }
334
+ const { accessToken, refreshToken, expiresIn } = parseOAuthCallbackUrl(callbackUrl);
237
335
  const spinner = ora({ text: 'Validating session...', stream: process.stderr }).start();
238
336
  const client = createAnonClient();
239
337
  const { data: { user }, error: userError, } = await client.auth.getUser(accessToken);
@@ -244,7 +342,7 @@ const headlessLoginAction = withErrorHandling(async () => {
244
342
  const creds = {
245
343
  accessToken,
246
344
  refreshToken,
247
- expiresAt: Date.now() + parseInt(expiresIn ?? '3600', 10) * 1000,
345
+ expiresAt: Date.now() + expiresIn * 1000,
248
346
  user: {
249
347
  id: user.id,
250
348
  email: user.email ?? 'unknown',
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,0BAA0B,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAElF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAC1C,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAavC;;;;;;GAMG;AACH,SAAS,mBAAmB;IAC1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,YAA4C,CAAC;QACjD,IAAI,WAAkC,CA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,KAAK,CAAC,GAAG,CAAC,+BAA+B,CAAC;IAC1C,KAAK,CAAC,GAAG,CAAC,mCAAmC,CAAC;IAC9C,KAAK,CAAC,GAAG,CAAC,iDAAiD,CAAC;IAC5D,KAAK,CAAC,GAAG,CAAC,iCAAiC,CAAC;;;;;;CAM/C,CACE,CAAC;IAEF,IAAI;SACD,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,oCAAoC,CAAC;SACjD,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;SAC9C,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC;SAChC,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;CAkBL,CACI;SACA,MAAM,CAAC,YAAY,CAAC,CAAC;IAExB,IAAI;SACD,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,0BAA0B,CAAC;SACvC,WAAW,CACV,OAAO,EACP;;;;;;;CAOL,CACI;SACA,MAAM,CAAC,YAAY,CAAC,CAAC;IAExB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -5,7 +5,9 @@ export type { CatalogItem, CatalogStats };
5
5
  export { sanitizeFilterValue, computeCatalogStats };
6
6
  /**
7
7
  * `purvey catalog` — Browse the coffee catalog.
8
- * Requires an authenticated viewer session.
8
+ * Requires an authenticated viewer session. Structured process filters on
9
+ * `catalog search` require member access under the current session-authenticated
10
+ * CLI path.
9
11
  */
10
12
  export declare function buildCatalogCommand(): Command;
11
13
  //# sourceMappingURL=catalog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/commands/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAKL,mBAAmB,EACnB,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAiC,MAAM,mBAAmB,CAAC;AAIlG,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAoCpD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAwS7C"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/commands/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EASL,mBAAmB,EACnB,mBAAmB,EAGpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,mBAAmB,CAAC;AAKrF,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAiFpD;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAmjB7C"}