@purveyors/cli 0.33.3 → 0.35.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.
- package/README.md +95 -11
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +21 -0
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/catalog.d.ts.map +1 -1
- package/dist/commands/catalog.js +40 -13
- package/dist/commands/catalog.js.map +1 -1
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +34 -11
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/market.d.ts.map +1 -1
- package/dist/commands/market.js +40 -2
- package/dist/commands/market.js.map +1 -1
- package/dist/commands/price-index.d.ts +4 -2
- package/dist/commands/price-index.d.ts.map +1 -1
- package/dist/commands/price-index.js +148 -5
- package/dist/commands/price-index.js.map +1 -1
- package/dist/commands/reference-profile.d.ts.map +1 -1
- package/dist/commands/reference-profile.js +47 -4
- package/dist/commands/reference-profile.js.map +1 -1
- package/dist/commands/roast.d.ts.map +1 -1
- package/dist/commands/roast.js +42 -1
- package/dist/commands/roast.js.map +1 -1
- package/dist/lib/catalog.d.ts +26 -18
- package/dist/lib/catalog.d.ts.map +1 -1
- package/dist/lib/catalog.js +38 -46
- package/dist/lib/catalog.js.map +1 -1
- package/dist/lib/inventory.d.ts +8 -1
- package/dist/lib/inventory.d.ts.map +1 -1
- package/dist/lib/inventory.js +19 -5
- package/dist/lib/inventory.js.map +1 -1
- package/dist/lib/manifest.d.ts +13 -0
- package/dist/lib/manifest.d.ts.map +1 -1
- package/dist/lib/manifest.js +286 -18
- package/dist/lib/manifest.js.map +1 -1
- package/dist/lib/market.d.ts.map +1 -1
- package/dist/lib/numeric-contracts.d.ts +8 -0
- package/dist/lib/numeric-contracts.d.ts.map +1 -1
- package/dist/lib/numeric-contracts.js +2 -0
- package/dist/lib/numeric-contracts.js.map +1 -1
- package/dist/lib/parchment.d.ts +10 -1
- package/dist/lib/parchment.d.ts.map +1 -1
- package/dist/lib/parchment.js +11 -1
- package/dist/lib/parchment.js.map +1 -1
- package/dist/lib/reference-profiles.d.ts +80 -0
- package/dist/lib/reference-profiles.d.ts.map +1 -1
- package/dist/lib/reference-profiles.js +91 -0
- package/dist/lib/reference-profiles.js.map +1 -1
- package/dist/lib/roast.d.ts +19 -0
- package/dist/lib/roast.d.ts.map +1 -1
- package/dist/lib/roast.js +23 -0
- package/dist/lib/roast.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +10 -0
- package/dist/program.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Coffee intelligence from your terminal.
|
|
4
4
|
|
|
5
|
-
`purvey` is the official CLI for [purveyors.io](https://purveyors.io). It gives coffee professionals, developers, and AI agents direct access to the Purveyors platform from the terminal: catalog search, Market Index intelligence, price-index snapshots, procurement brief reads, inventory tracking, roast logging, sales records, tasting notes, and Artisan `.alog` import.
|
|
5
|
+
`purvey` is the official CLI for [purveyors.io](https://purveyors.io). It gives coffee professionals, developers, and AI agents direct access to the Purveyors platform from the terminal: catalog search, Market Index intelligence, price-index snapshots, matched price comparisons, and chart history, procurement brief reads, inventory tracking, roast logging, sales records, tasting notes, and Artisan `.alog` import.
|
|
6
6
|
|
|
7
7
|
Use `purvey --help` for quick command discovery, `purvey context` for the dense human-readable operator reference, `purvey manifest` for the preferred machine-readable contract, or `@purveyors/cli/manifest` in-process.
|
|
8
8
|
|
|
@@ -13,8 +13,8 @@ Use `purvey --help` for quick command discovery, `purvey context` for the dense
|
|
|
13
13
|
- Runtime: Node.js 20+
|
|
14
14
|
- No pre-existing credentials required: `auth`, `config`, `context`, `manifest`
|
|
15
15
|
- Viewer role required: `catalog` (excluding structured process filters on `catalog search`)
|
|
16
|
-
- Member role required: `
|
|
17
|
-
- Mixed public and entitled access: `market` public teaser slices are unauthenticated; filtered slices require Parchment Intelligence access
|
|
16
|
+
- Member role required: `procurement`, `inventory`, `roast`, `sales`, `tasting`
|
|
17
|
+
- Mixed public and entitled access: `market` and `price-index` public teaser slices are unauthenticated; filtered, non-public, and evidence slices require a credential and, where entitled, Parchment Intelligence access
|
|
18
18
|
- Preferred machine-readable contract: `purvey manifest`
|
|
19
19
|
- Dense human-readable reference: `purvey context`
|
|
20
20
|
- Compatibility JSON alias: `purvey context --json`
|
|
@@ -106,6 +106,11 @@ Use the right reference surface for the job:
|
|
|
106
106
|
- `purvey context --json` and `purvey context --pretty` emit the same JSON payload as `purvey manifest`, but exist mainly for compatibility with tooling that already shells out to `context`.
|
|
107
107
|
- `@purveyors/cli/manifest` exposes the same contract in-process for Node.js and agent runtimes.
|
|
108
108
|
|
|
109
|
+
Manifest commands carry `sdkMethods`, the `@purveyors/sdk` operations whose canonical endpoints
|
|
110
|
+
they consume, and, for writes, `confirmedActionEquivalents`, the Purveyors web assistant's
|
|
111
|
+
confirmed-action types they perform with an API key. An agent that knows an SDK operation can
|
|
112
|
+
use these fields to find the matching command.
|
|
113
|
+
|
|
109
114
|
## Package exports and integration boundary
|
|
110
115
|
|
|
111
116
|
The npm package is both a binary and a reusable TypeScript surface for Node.js callers that specifically want CLI behavior. The CLI itself consumes `@purveyors/sdk`, which is the typed client for the canonical Parchment API. The SDK does not call or embed CLI functions.
|
|
@@ -144,7 +149,9 @@ Remote data commands require a valid owner-bound API key with the required scope
|
|
|
144
149
|
- `catalog` requires the `viewer` role by default
|
|
145
150
|
- `catalog search` structured process filters require the `member` role
|
|
146
151
|
- `market` has public teaser slices for `signals --summary`, unfiltered retail `stats`, and process/retail/month `metadata`; all filtered or non-public slices require Parchment Intelligence access enforced server-side
|
|
147
|
-
- `
|
|
152
|
+
- `market overview` requires any signed-in session or API key; `market evidence` requires Parchment Intelligence access
|
|
153
|
+
- `price-index history` is public for windows up to 90 days; longer windows require Parchment Intelligence access
|
|
154
|
+
- `price-index` snapshots, `price-index comparisons`, `price-index comparison`, `procurement`, `inventory`, `roast`, `sales`, and `tasting` require the `member` role
|
|
148
155
|
- `reference-profile` requires a `member` credential plus Studio access, enforced server-side by Parchment
|
|
149
156
|
|
|
150
157
|
`purvey` uses Google OAuth through purveyors.io.
|
|
@@ -195,7 +202,7 @@ Credentials are stored at `~/.config/purvey/credentials.json`.
|
|
|
195
202
|
|
|
196
203
|
The `reference-profile` commands also require Studio access; the API enforces this entitlement.
|
|
197
204
|
|
|
198
|
-
Market Index teaser slices are public. Filtered `market signals`, origin/process/wholesale `market stats`,
|
|
205
|
+
Market Index teaser slices are public. Filtered `market signals`, origin/process/wholesale `market stats`, non-public `market metadata`, `market evidence`, `price-index comparisons`, `price-index comparison`, and `price-index history` windows over 90 days require Parchment Intelligence access; API-key denial is enforced by the canonical API. The stored login key carries `catalog:read`, which is also the canonical read scope for Market Index, Price Index, and procurement.
|
|
199
206
|
|
|
200
207
|
`auth`, `config`, `context`, and `manifest` remain available without pre-existing credentials.
|
|
201
208
|
|
|
@@ -286,6 +293,7 @@ fi
|
|
|
286
293
|
- `purvey auth status --json`
|
|
287
294
|
- `purvey auth status --pretty`
|
|
288
295
|
- `purvey auth status --csv`
|
|
296
|
+
- `purvey auth whoami`
|
|
289
297
|
- `purvey auth logout`
|
|
290
298
|
|
|
291
299
|
Examples:
|
|
@@ -295,6 +303,7 @@ purvey auth login
|
|
|
295
303
|
purvey auth login --headless
|
|
296
304
|
purvey auth status --pretty
|
|
297
305
|
purvey auth status --csv
|
|
306
|
+
purvey auth whoami | jq '.capabilities.profileStudio'
|
|
298
307
|
purvey auth logout
|
|
299
308
|
```
|
|
300
309
|
|
|
@@ -304,13 +313,14 @@ Notes:
|
|
|
304
313
|
- `auth login --headless` prints the approval URL without trying to open a local browser. Approve it from any browser; nothing is pasted back.
|
|
305
314
|
- `auth status --json` is the safest mode for scripts.
|
|
306
315
|
- `auth status --csv` is supported for spreadsheet-style checks, but JSON remains the better integration format.
|
|
316
|
+
- `auth whoami` prints Parchment's `GET /v1/me` response unchanged for the credential the CLI would send: roles, API plan, scopes, Price Index access, and capabilities such as `capabilities.profileStudio`. Like the rest of `auth`, it needs no existing credential; without one it prints Parchment's anonymous principal (`authenticated: false`).
|
|
307
317
|
|
|
308
318
|
### catalog
|
|
309
319
|
|
|
310
320
|
- `purvey catalog search`
|
|
311
321
|
- `purvey catalog get <id>`
|
|
312
322
|
- `purvey catalog stats`
|
|
313
|
-
- `purvey catalog facets
|
|
323
|
+
- `purvey catalog facets [field]`
|
|
314
324
|
- `purvey catalog rank`
|
|
315
325
|
- `purvey catalog rank-premium`
|
|
316
326
|
- `purvey catalog supplier-list`
|
|
@@ -333,6 +343,9 @@ Notes:
|
|
|
333
343
|
- `--ids <n,n,...>`; fetch specific catalog IDs, ignores limit and offset
|
|
334
344
|
- `--variety <text>`; partial cultivar match
|
|
335
345
|
- `--stocked-days <n>`; stocked within N days
|
|
346
|
+
- `--supplier <name>`; partial supplier/source match
|
|
347
|
+
- `--drying-method <method>`; drying-method filter, matched by Parchment
|
|
348
|
+
- `--flavor <keywords>`; comma-separated flavor keywords, a coffee matches any keyword
|
|
336
349
|
- `--stocked`; only currently stocked coffees
|
|
337
350
|
- `--sort <price|price-desc|name|origin>`
|
|
338
351
|
- `--offset <n>`; pagination offset
|
|
@@ -346,15 +359,16 @@ Notes:
|
|
|
346
359
|
- `--stocked-only`; request only currently stocked coffees
|
|
347
360
|
- `--mode <all|likely_same|similar_profile>`; default `all`
|
|
348
361
|
|
|
349
|
-
`catalog facets
|
|
362
|
+
`catalog facets [field]` options:
|
|
350
363
|
|
|
351
364
|
- Fields: `supplier`, `country`, `processing_base_method`, `fermentation_type`, `drying_method`, `grade`, `wholesale`
|
|
365
|
+
- Without a field, prints the canonical `/v1/catalog/facets` envelope (`values`, `facets`, `meta`) unchanged. With a field, prints `{ field, facet, data, meta }` for that counted facet.
|
|
352
366
|
- `--all`; use all visible catalog rows instead of the default stocked-only scope.
|
|
353
|
-
- `--limit <n>`; default `60`, max `100`
|
|
354
367
|
|
|
355
368
|
`catalog rank` options:
|
|
356
369
|
|
|
357
370
|
- `--objective <premium|value|fresh_arrival|rare_origin>`; default `premium`
|
|
371
|
+
- `--supplier <name>`; optional supplier filter
|
|
358
372
|
- `--country <country>`; optional country filter
|
|
359
373
|
- `--process <method>`; optional process filter
|
|
360
374
|
- `--stocked`; only include currently stocked coffees. This is the default unless `--all` is passed.
|
|
@@ -390,13 +404,16 @@ purvey catalog search --processing-base-method "Natural" --fermentation-type "An
|
|
|
390
404
|
purvey catalog search --process-additive "hops" --processing-confidence-min 0.8 --pretty
|
|
391
405
|
purvey catalog search --name "Gesha" --stocked --pretty
|
|
392
406
|
purvey catalog search --ids "1182,1183,1200"
|
|
407
|
+
purvey catalog search --supplier "Royal" --flavor "blueberry,jasmine" --stocked --pretty
|
|
393
408
|
purvey catalog search --stocked --sort price --offset 10 --limit 10
|
|
394
409
|
purvey catalog search --origin "Ethiopia" --include-proof --json
|
|
395
410
|
PARCHMENT_API_KEY="$PURVEYORS_API_KEY" purvey catalog search --origin "Ethiopia" --include-proof --limit 5 --json
|
|
396
411
|
purvey catalog similar 1182 --threshold 0.85 --stocked-only --pretty
|
|
397
412
|
purvey catalog similar 1182 --json | jq '.data.groups.canonical_candidates'
|
|
398
413
|
purvey catalog facets supplier --pretty
|
|
414
|
+
purvey catalog facets --all --json
|
|
399
415
|
purvey catalog rank --objective value --country Ethiopia --price-max 12 --json
|
|
416
|
+
purvey catalog rank --objective premium --supplier "Royal Coffee" --limit 5 --json
|
|
400
417
|
purvey catalog rank-premium --stocked --limit 10 --pretty
|
|
401
418
|
purvey catalog supplier-rank --country Ethiopia --non-wholesale-only --min-coffees 3 --json
|
|
402
419
|
purvey catalog supplier-detail "Royal Coffee" --pretty
|
|
@@ -410,11 +427,12 @@ Notes:
|
|
|
410
427
|
- Catalog commands require an authenticated `viewer` role by default.
|
|
411
428
|
- Structured process filters on `catalog search` require an authenticated `member` role.
|
|
412
429
|
- Structured process filters use the canonical `/v1/catalog` query contract names while preserving the legacy `--process` label filter.
|
|
430
|
+
- `--supplier`, `--drying-method`, and `--flavor` pass through to the canonical `/v1/catalog` `supplier`, `dryingMethod`, and `flavorKeywords` parameters; Parchment applies them, not the CLI.
|
|
413
431
|
- `--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.
|
|
414
432
|
- If you want proof output against a specific API-key deployment, set `PARCHMENT_API_KEY` or `PURVEYORS_API_KEY`. Otherwise the CLI uses the key created by `purvey auth login`.
|
|
415
433
|
- `catalog get` and `catalog similar` both take `coffee_catalog.catalog_id`.
|
|
416
434
|
- `catalog rank` and `catalog rank-premium` read `coffee_catalog.purveyor_score` as the canonical quality signal; the CLI does not recompute the upstream Purveyor Score model.
|
|
417
|
-
- `catalog facets` and `catalog rank` are generic agent/client intelligence surfaces. Facet counts come from the canonical API across the selected stocked/all-visible scope;
|
|
435
|
+
- `catalog facets` and `catalog rank` are generic agent/client intelligence surfaces. Facet values, counts, and metadata come from the canonical API unchanged across the selected stocked/all-visible scope; counts for multi-valued dimensions can overlap, so do not sum them. Ranking responses include sample metadata so callers do not mistake sampled rarity for whole-catalog guarantees.
|
|
418
436
|
- Catalog intelligence responses include `meta.sample_limited`, `meta.sample_order`, `meta.truncated`, and rows-examined style metadata where relevant so agents can distinguish ranked samples from full supplier aggregates. Supplier aggregate responses also include `meta.rows_examined`.
|
|
419
437
|
- 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.
|
|
420
438
|
- `catalog similar` uses the beta canonical `/v1/catalog/{id}/similar` API contract, not the legacy direct RPC path.
|
|
@@ -426,6 +444,9 @@ Notes:
|
|
|
426
444
|
### price-index
|
|
427
445
|
|
|
428
446
|
- `purvey price-index`
|
|
447
|
+
- `purvey price-index comparisons`
|
|
448
|
+
- `purvey price-index comparison`
|
|
449
|
+
- `purvey price-index history`
|
|
429
450
|
|
|
430
451
|
`price-index` filters:
|
|
431
452
|
|
|
@@ -438,25 +459,53 @@ Notes:
|
|
|
438
459
|
- `--page <n>`; 1-based page number
|
|
439
460
|
- `--limit <n>`; results per page, min `1`, max `100`
|
|
440
461
|
|
|
462
|
+
`price-index comparisons` options:
|
|
463
|
+
|
|
464
|
+
- `--wholesale <true|false|all>`
|
|
465
|
+
|
|
466
|
+
`price-index comparison` options:
|
|
467
|
+
|
|
468
|
+
- `--origin <origin>`; required
|
|
469
|
+
- `--from <YYYY-MM-DD>`; required
|
|
470
|
+
- `--to <YYYY-MM-DD>`; required, within 365 days of `--from`
|
|
471
|
+
- `--wholesale <true|false>`
|
|
472
|
+
|
|
473
|
+
`price-index history` options:
|
|
474
|
+
|
|
475
|
+
- `--window-days <n>`; min `1`, max `365`; windows over 90 days require Parchment Intelligence access
|
|
476
|
+
- `--page <n>`; 1-based page number
|
|
477
|
+
- `--limit <n>`; results per page, min `1`, max `10000`
|
|
478
|
+
- `--order <asc|desc>`
|
|
479
|
+
|
|
480
|
+
The snapshot filters above belong to the bare `price-index` command; subcommands reject them.
|
|
481
|
+
|
|
441
482
|
Examples:
|
|
442
483
|
|
|
443
484
|
```bash
|
|
444
485
|
purvey price-index --pretty
|
|
445
486
|
purvey price-index --origin "Ethiopia" --from 2026-01-01 --to 2026-06-30 --json
|
|
446
487
|
PARCHMENT_API_KEY="$PURVEYORS_API_KEY" purvey price-index --limit 25 --json
|
|
488
|
+
purvey price-index comparisons --pretty
|
|
489
|
+
purvey price-index comparison --origin "Ethiopia" --from 2026-08-31 --to 2026-09-30 --json
|
|
490
|
+
purvey price-index history --window-days 30 --order desc --json
|
|
447
491
|
```
|
|
448
492
|
|
|
449
493
|
Notes:
|
|
450
494
|
|
|
451
495
|
- `price-index` is backed by the canonical Parchment API `GET /v1/price-index` through `@purveyors/sdk`.
|
|
452
496
|
- Session-token use requires the local `member` role; API-key use is accepted via `PARCHMENT_API_KEY` or `PURVEYORS_API_KEY` and PPI entitlement is enforced server-side.
|
|
453
|
-
- `
|
|
497
|
+
- `price-index comparisons` (`GET /v1/price-index/comparisons`) lists the origins that have an exact 30-day matched comparison. Each comparison carries its `significance` object verbatim; `classification` is `quiet`, `normal`, `notable`, `exceptional`, or `null`. `null` means fewer than eight baseline windows exist, not that the move is quiet.
|
|
498
|
+
- `price-index comparison` (`GET /v1/price-index/comparison`) compares one origin between two exact dates. When fresh coverage is insufficient, `changePercent` is `null`, never zero.
|
|
499
|
+
- `price-index history` (`GET /v1/price-index/history`) returns tier-one chart history and runs without credentials for windows up to 90 days.
|
|
500
|
+
- `PARCHMENT_API_BASE_URL` overrides the canonical API base for these SDK-backed commands.
|
|
454
501
|
|
|
455
502
|
### market
|
|
456
503
|
|
|
457
504
|
- `purvey market signals`
|
|
458
505
|
- `purvey market stats`
|
|
459
506
|
- `purvey market metadata`
|
|
507
|
+
- `purvey market overview`
|
|
508
|
+
- `purvey market evidence`
|
|
460
509
|
|
|
461
510
|
`market signals` filters:
|
|
462
511
|
|
|
@@ -494,6 +543,8 @@ purvey market signals --summary --pretty
|
|
|
494
543
|
purvey market signals --type price_drop --origin "Ethiopia" --json
|
|
495
544
|
purvey market stats --pretty
|
|
496
545
|
purvey market metadata --dimension score --origin "Ethiopia" --grain month --json
|
|
546
|
+
purvey market overview --pretty
|
|
547
|
+
purvey market evidence --json
|
|
497
548
|
PARCHMENT_API_KEY="$PURVEYORS_API_KEY" purvey market signals --market wholesale --json
|
|
498
549
|
```
|
|
499
550
|
|
|
@@ -502,6 +553,8 @@ Notes:
|
|
|
502
553
|
- `market` commands are backed by canonical Parchment API endpoints through `@purveyors/sdk`; the CLI does not compute Market Index intelligence locally.
|
|
503
554
|
- Public teaser slices: `signals --summary`, `stats` with no origin/process and `market=retail`, and `metadata` at dimension=process/no-origin/market=retail/grain=month.
|
|
504
555
|
- Any filtered or non-public market slice requires Parchment Intelligence access, enforced server-side for API-key calls.
|
|
556
|
+
- `market overview` (`GET /v1/market/overview`) returns aggregate-only daily change, coverage, movement, process mix, and origin price distributions. The API rejects anonymous calls; any signed-in session or API key receives the same public evidence.
|
|
557
|
+
- `market evidence` (`GET /v1/market/evidence`) returns named arrivals, delistings, comparable lots, and supplier health and price ranges. It requires Parchment Intelligence access.
|
|
505
558
|
- `--json` returns the API response verbatim.
|
|
506
559
|
|
|
507
560
|
### procurement
|
|
@@ -550,7 +603,8 @@ Notes:
|
|
|
550
603
|
|
|
551
604
|
`inventory add` flags:
|
|
552
605
|
|
|
553
|
-
- `--catalog-id <id>`;
|
|
606
|
+
- `--catalog-id <id>`; the catalog lot to add
|
|
607
|
+
- `--manual-name <name>`; name for a coffee that is not in the catalog (flag mode needs exactly one of `--catalog-id` or `--manual-name`)
|
|
554
608
|
- `--qty <lbs>`; required in flag mode
|
|
555
609
|
- `--cost <dollars>`
|
|
556
610
|
- `--tax-ship <dollars>`
|
|
@@ -565,6 +619,7 @@ Notes:
|
|
|
565
619
|
- `--tax-ship <dollars>`
|
|
566
620
|
- `--notes <text>`
|
|
567
621
|
- `--stocked <true|false>`
|
|
622
|
+
- `--rank <n>`; owner-assigned integer rank
|
|
568
623
|
|
|
569
624
|
`inventory delete <id>` options:
|
|
570
625
|
|
|
@@ -575,8 +630,10 @@ Examples:
|
|
|
575
630
|
```bash
|
|
576
631
|
purvey inventory list --stocked --pretty
|
|
577
632
|
purvey inventory add --catalog-id 128 --qty 10 --cost 8.50
|
|
633
|
+
purvey inventory add --manual-name "Farm-gate Ethiopia lot 7" --qty 12 --cost 96
|
|
578
634
|
purvey inventory add --form
|
|
579
635
|
purvey inventory update 7 --stocked false
|
|
636
|
+
purvey inventory update 7 --rank 1
|
|
580
637
|
purvey inventory delete 7 --yes
|
|
581
638
|
```
|
|
582
639
|
|
|
@@ -590,6 +647,7 @@ Notes:
|
|
|
590
647
|
|
|
591
648
|
- `purvey roast list`
|
|
592
649
|
- `purvey roast get <id>`
|
|
650
|
+
- `purvey roast chart <id>`
|
|
593
651
|
- `purvey roast create`
|
|
594
652
|
- `purvey roast update <id>`
|
|
595
653
|
- `purvey roast delete <id>`
|
|
@@ -614,6 +672,14 @@ Notes:
|
|
|
614
672
|
- `--include-temps`
|
|
615
673
|
- `--include-events`
|
|
616
674
|
|
|
675
|
+
`roast chart <id>` options:
|
|
676
|
+
|
|
677
|
+
- `--target-points <n>`; approximate samples per series, `50` to `1000` (Parchment defaults to `400`)
|
|
678
|
+
|
|
679
|
+
`roast chart` prints Parchment's canonical chart-data envelope unchanged: sampled series,
|
|
680
|
+
events, and metadata. `data.metadata.revision` is the immutable chart revision that
|
|
681
|
+
`reference-profile compare` accepts as `roast:<id>@<revision>`.
|
|
682
|
+
|
|
617
683
|
`roast create` flags:
|
|
618
684
|
|
|
619
685
|
- `--coffee-id <id>`; required in flag mode
|
|
@@ -622,6 +688,8 @@ Notes:
|
|
|
622
688
|
- `--oz-out <oz>`
|
|
623
689
|
- `--roast-date <YYYY-MM-DD>`
|
|
624
690
|
- `--notes <text>`
|
|
691
|
+
- `--targets <text>`
|
|
692
|
+
- `--roaster-type <text>`
|
|
625
693
|
- `--form`
|
|
626
694
|
|
|
627
695
|
`roast update <id>` flags:
|
|
@@ -658,6 +726,7 @@ Examples:
|
|
|
658
726
|
```bash
|
|
659
727
|
purvey roast list --catalog-id 128 --pretty
|
|
660
728
|
purvey roast get 123 --include-temps --pretty
|
|
729
|
+
purvey roast chart 123 --target-points 120 --json
|
|
661
730
|
purvey roast create --coffee-id 7 --batch-name "Ethiopia Guji Light" --oz-in 16
|
|
662
731
|
purvey roast import ~/artisan/ethiopia.alog --coffee-id 7 --roast-targets "Aim for 18% development"
|
|
663
732
|
purvey roast watch ~/artisan/ --auto-match
|
|
@@ -677,6 +746,7 @@ Notes:
|
|
|
677
746
|
- `purvey reference-profile list [--include-archived]`
|
|
678
747
|
- `purvey reference-profile get <profile-id>`
|
|
679
748
|
- `purvey reference-profile chart <profile-id> <revision-id>`
|
|
749
|
+
- `purvey reference-profile compare <left> <right> [--unit F|C] [--target-points <n>]`
|
|
680
750
|
- `purvey reference-profile import <file>`
|
|
681
751
|
- `purvey reference-profile preview <profile-id> <revision-id> --request <file>`
|
|
682
752
|
- `purvey reference-profile save <profile-id> <revision-id> --request <file>`
|
|
@@ -712,6 +782,20 @@ be ordered and each nonzero `delta` is bounded from -20 to 20. For example:
|
|
|
712
782
|
}
|
|
713
783
|
```
|
|
714
784
|
|
|
785
|
+
The request file may also carry optional provenance for the plan: `userGoal` (up to 600
|
|
786
|
+
characters), `modelRecommendation` (up to 800), and `userEdits` (up to 800).
|
|
787
|
+
|
|
788
|
+
`compare` returns Parchment's charge-aligned measured deltas between two immutable
|
|
789
|
+
revisions. Each side is a selector: `revision:<uuid>` (an exact reference revision),
|
|
790
|
+
`profile:<uuid>` (that profile's current revision), `roast:<roast-id>` (the roast's current
|
|
791
|
+
chart revision), or `roast:<roast-id>@<revision>` (an exact chart revision from `roast chart`).
|
|
792
|
+
`--unit` defaults to `F` and `--target-points` defaults to `400` (`50` to `1000`).
|
|
793
|
+
|
|
794
|
+
```bash
|
|
795
|
+
purvey reference-profile compare roast:123 profile:5ea1af6f-234c-43a9-9bf8-5678dd24f854 --pretty
|
|
796
|
+
purvey reference-profile compare roast:123 roast:124 --unit C --json
|
|
797
|
+
```
|
|
798
|
+
|
|
715
799
|
Example flow:
|
|
716
800
|
|
|
717
801
|
Replace the sample UUIDs below with the profile and revision IDs returned by your commands.
|
|
@@ -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;AAIpC,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAS7E,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK1E,KAAK,aAAa,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;AAEtD,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,0BAA0B,CAAC,EAAE,MAAM,IAAI,CAAC;CACzC;AAWD,4DAA4D;AAC5D,wBAAgB,cAAc,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAIxE;AAUD,uFAAuF;AACvF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS1D;AAuFD,wFAAwF;AACxF,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAiBxE;AAeD;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAiGhG;AAiFD,wBAAgB,gBAAgB,IAAI,OAAO,CAsG1C"}
|
package/dist/commands/auth.js
CHANGED
|
@@ -8,6 +8,7 @@ import ora from 'ora';
|
|
|
8
8
|
import { validateSession } from '../lib/auth-client.js';
|
|
9
9
|
import { writeCredentials, deleteCredentials } from '../lib/config.js';
|
|
10
10
|
import { getParchmentBaseUrl } from '../lib/parchment-base.js';
|
|
11
|
+
import { getParchmentIdentity } from '../lib/parchment.js';
|
|
11
12
|
import { outputData, shouldUseInteractiveOutput, success, info, warn } from '../lib/output.js';
|
|
12
13
|
import { withErrorHandling, AuthError, exitCodeForError } from '../lib/errors.js';
|
|
13
14
|
const DEFAULT_POLL_INTERVAL_SECONDS = 5;
|
|
@@ -345,6 +346,26 @@ Notes:
|
|
|
345
346
|
When piped or redirected, output is compact JSON (same as all other commands).
|
|
346
347
|
`)
|
|
347
348
|
.action(statusAction);
|
|
349
|
+
auth
|
|
350
|
+
.command('whoami')
|
|
351
|
+
.description('Show the canonical identity, plan, scopes, and capabilities for the active credential')
|
|
352
|
+
.addHelpText('after', `
|
|
353
|
+
Examples:
|
|
354
|
+
purvey auth whoami --pretty
|
|
355
|
+
purvey auth whoami | jq '.capabilities.profileStudio'
|
|
356
|
+
|
|
357
|
+
Notes:
|
|
358
|
+
Prints Parchment's GET /v1/me response unchanged: authenticated, userId, appRoles,
|
|
359
|
+
primaryAppRole, apiPlan, ppiAccess, apiScopes, and capabilities (for example
|
|
360
|
+
capabilities.profileStudio for Studio reference-profile access).
|
|
361
|
+
Uses PARCHMENT_API_KEY or PURVEYORS_API_KEY when set, otherwise the key stored by
|
|
362
|
+
'purvey auth login'. With no credential it prints Parchment's anonymous principal
|
|
363
|
+
(authenticated: false). Use 'purvey auth status' for a local check.
|
|
364
|
+
`)
|
|
365
|
+
.action(withErrorHandling(async (_, cmd) => {
|
|
366
|
+
const opts = cmd.optsWithGlobals();
|
|
367
|
+
outputData(await getParchmentIdentity(), opts);
|
|
368
|
+
}));
|
|
348
369
|
auth
|
|
349
370
|
.command('logout')
|
|
350
371
|
.description('Clear stored credentials')
|
|
@@ -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,UAAU,EAAE,W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,CAAC,CAAC;IAExB,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -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;AAGpC,OAAO,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/commands/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAYL,mBAAmB,EACnB,mBAAmB,EAOpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAoB,MAAM,mBAAmB,CAAC;AAUrF,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAkEpD;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAisB7C"}
|
package/dist/commands/catalog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { outputData, info } from '../lib/output.js';
|
|
3
3
|
import { withErrorHandling, PrvrsError } from '../lib/errors.js';
|
|
4
|
-
import { searchCatalog, getCatalog, getCatalogStats, getCatalogSimilarity, listCatalogFacets, rankCatalog, catalogRankPremium, supplierList, supplierDetail, supplierRank, computeCatalogStats, sanitizeFilterValue, catalogSortFields, CATALOG_SEARCH_MAX_LIMIT, SUPPLIER_MIN_COFFEES_MAX, catalogFacetFields, catalogRankObjectives, catalogSimilarityModes, } from '../lib/catalog.js';
|
|
4
|
+
import { searchCatalog, getCatalog, getCatalogStats, getCatalogSimilarity, getCatalogFacets, listCatalogFacets, rankCatalog, catalogRankPremium, supplierList, supplierDetail, supplierRank, computeCatalogStats, sanitizeFilterValue, catalogSortFields, CATALOG_SEARCH_MAX_LIMIT, SUPPLIER_MIN_COFFEES_MAX, catalogFacetFields, catalogRankObjectives, catalogSimilarityModes, } from '../lib/catalog.js';
|
|
5
5
|
import { CLI_NUMERIC_BOUNDS } from '../lib/numeric-contracts.js';
|
|
6
6
|
import { parseStrictInt4Id, parseStrictOffset, parseStrictPositiveCount, } from '../lib/strict-number.js';
|
|
7
7
|
export { sanitizeFilterValue, computeCatalogStats };
|
|
@@ -70,6 +70,9 @@ export function buildCatalogCommand() {
|
|
|
70
70
|
.option('--ids <n,n,...>', 'Fetch specific catalog IDs (comma-separated, ignores limit)')
|
|
71
71
|
.option('--variety <text>', 'Filter by coffee variety/cultivar (partial match)')
|
|
72
72
|
.option('--stocked-days <n>', 'Only show coffees stocked within N days')
|
|
73
|
+
.option('--supplier <name>', 'Filter by supplier/source name (partial match)')
|
|
74
|
+
.option('--drying-method <method>', 'Filter by drying method (matched by Parchment)')
|
|
75
|
+
.option('--flavor <keywords>', 'Comma-separated flavor keywords; matches any keyword')
|
|
73
76
|
.option('--stocked', 'Only show currently stocked coffees')
|
|
74
77
|
.option('--sort <field>', `Sort results by: ${catalogSortFields.join(', ')}`)
|
|
75
78
|
.option('--offset <n>', 'Skip N results (for pagination)', '0')
|
|
@@ -90,6 +93,8 @@ Examples:
|
|
|
90
93
|
purvey catalog search --ids "1182,1183,1200"
|
|
91
94
|
purvey catalog search --variety "gesha" --stocked --pretty
|
|
92
95
|
purvey catalog search --stocked-days 30 --pretty
|
|
96
|
+
purvey catalog search --supplier "Royal" --stocked --pretty
|
|
97
|
+
purvey catalog search --flavor "blueberry,jasmine" --drying-method "raised bed" --pretty
|
|
93
98
|
purvey catalog search --origin "Ethiopia" --include-proof --json
|
|
94
99
|
|
|
95
100
|
Sort fields:
|
|
@@ -111,6 +116,8 @@ Notes:
|
|
|
111
116
|
--processing-confidence-min accepts a decimal from 0 to 1.
|
|
112
117
|
--variety filters on cultivar_detail (partial match, case-insensitive).
|
|
113
118
|
--stocked-days N shows only coffees stocked within the last N days.
|
|
119
|
+
--supplier, --drying-method, and --flavor map to the canonical /v1/catalog
|
|
120
|
+
supplier, dryingMethod, and flavorKeywords parameters; Parchment applies them.
|
|
114
121
|
--ids fetches specific catalog items by ID, ignoring --limit and --offset.
|
|
115
122
|
--offset + --limit enables pagination through large result sets.
|
|
116
123
|
--include-proof uses the canonical /v1/catalog?include=proof response and does
|
|
@@ -157,6 +164,16 @@ Notes:
|
|
|
157
164
|
? parseNonNegativeIntegerArg(opts.offset, `Invalid --offset: "${opts.offset}". Must be a non-negative integer.`)
|
|
158
165
|
: undefined;
|
|
159
166
|
const limit = parseBoundedPositiveIntegerArg(opts.limit, '--limit', CLI_NUMERIC_BOUNDS.catalogSearchLimit.minimum, CATALOG_SEARCH_MAX_LIMIT);
|
|
167
|
+
let flavor;
|
|
168
|
+
if (opts.flavor !== undefined) {
|
|
169
|
+
flavor = String(opts.flavor)
|
|
170
|
+
.split(',')
|
|
171
|
+
.map((keyword) => keyword.trim())
|
|
172
|
+
.filter(Boolean);
|
|
173
|
+
if (flavor.length === 0) {
|
|
174
|
+
throw new PrvrsError('INVALID_ARGUMENT', `Invalid --flavor: "${String(opts.flavor)}". Provide at least one keyword.`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
160
177
|
const includeProof = opts.includeProof ? true : undefined;
|
|
161
178
|
const data = await searchCatalog({
|
|
162
179
|
origin: opts.origin,
|
|
@@ -167,6 +184,9 @@ Notes:
|
|
|
167
184
|
ids: parsedIds,
|
|
168
185
|
variety: opts.variety,
|
|
169
186
|
stockedDays,
|
|
187
|
+
supplier: opts.supplier,
|
|
188
|
+
dryingMethod: opts.dryingMethod,
|
|
189
|
+
flavor,
|
|
170
190
|
processingBaseMethod: opts.processingBaseMethod,
|
|
171
191
|
fermentationType: opts.fermentationType,
|
|
172
192
|
processAdditive: opts.processAdditive,
|
|
@@ -234,36 +254,40 @@ Notes:
|
|
|
234
254
|
}));
|
|
235
255
|
// ── catalog facets ───────────────────────────────────────────────────────
|
|
236
256
|
catalog
|
|
237
|
-
.command('facets
|
|
238
|
-
.description('List
|
|
257
|
+
.command('facets [field]')
|
|
258
|
+
.description('List counted catalog facet values for filter discovery')
|
|
239
259
|
.option('--all', 'Use all visible catalog rows instead of default stocked-only scope')
|
|
240
|
-
.option('--limit <n>', 'Maximum facet values to return (1-100)', '60')
|
|
241
260
|
.addHelpText('after', `
|
|
242
261
|
Examples:
|
|
243
262
|
purvey catalog facets supplier --pretty
|
|
244
|
-
purvey catalog facets country --
|
|
245
|
-
purvey catalog facets
|
|
263
|
+
purvey catalog facets country --all --json
|
|
264
|
+
purvey catalog facets --pretty # every counted facet
|
|
246
265
|
|
|
247
266
|
Fields:
|
|
248
267
|
supplier, country, processing_base_method, fermentation_type, drying_method, grade, wholesale
|
|
249
268
|
|
|
250
269
|
Notes:
|
|
251
|
-
|
|
270
|
+
Without a field, prints the canonical /v1/catalog/facets envelope (values, facets, meta) unchanged.
|
|
271
|
+
With a field, prints { field, facet, data, meta }: that facet's counted values and Parchment's meta.
|
|
272
|
+
Counts are computed by Parchment after visibility and entitlement filters; counts for
|
|
273
|
+
multi-valued dimensions can overlap, so do not sum them.
|
|
252
274
|
By default only currently stocked catalog rows are included; use --all for all visible rows.
|
|
253
|
-
meta.stocked_only/scope, meta.rows_examined, and meta.truncated describe the canonical counted scope.
|
|
254
275
|
Requires an authenticated viewer session.
|
|
255
276
|
`)
|
|
256
277
|
.action(withErrorHandling(async (field, opts, cmd) => {
|
|
257
278
|
const globalOpts = cmd.optsWithGlobals();
|
|
279
|
+
const stockedOnly = opts.all ? false : true;
|
|
280
|
+
if (field === undefined) {
|
|
281
|
+
outputData(await getCatalogFacets({ stockedOnly }), globalOpts);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
258
284
|
if (!catalogFacetFields.includes(field)) {
|
|
259
285
|
throw new PrvrsError('INVALID_ARGUMENT', `Invalid field: "${field}". Must be one of: ${catalogFacetFields.join(', ')}.`);
|
|
260
286
|
}
|
|
261
|
-
const
|
|
287
|
+
const data = await listCatalogFacets({
|
|
262
288
|
field: field,
|
|
263
|
-
stockedOnly
|
|
264
|
-
|
|
265
|
-
};
|
|
266
|
-
const data = await listCatalogFacets(input);
|
|
289
|
+
stockedOnly,
|
|
290
|
+
});
|
|
267
291
|
outputData(data, globalOpts);
|
|
268
292
|
}));
|
|
269
293
|
// ── catalog rank ─────────────────────────────────────────────────────────
|
|
@@ -271,6 +295,7 @@ Notes:
|
|
|
271
295
|
.command('rank')
|
|
272
296
|
.description('Rank catalog candidates by a deterministic objective')
|
|
273
297
|
.option('--objective <objective>', `Ranking objective: ${catalogRankObjectives.join(', ')}`, 'premium')
|
|
298
|
+
.option('--supplier <name>', 'Filter by supplier/source name')
|
|
274
299
|
.option('--country <country>', 'Filter by country')
|
|
275
300
|
.option('--process <method>', 'Filter by processing method')
|
|
276
301
|
.option('--stocked', 'Only include currently stocked coffees')
|
|
@@ -285,6 +310,7 @@ Examples:
|
|
|
285
310
|
purvey catalog rank --objective premium --stocked --limit 10 --pretty
|
|
286
311
|
purvey catalog rank --objective value --country Ethiopia --price-max 12 --json
|
|
287
312
|
purvey catalog rank --objective rare_origin --stocked --pretty
|
|
313
|
+
purvey catalog rank --objective premium --supplier "Royal Coffee" --limit 5 --json
|
|
288
314
|
|
|
289
315
|
Notes:
|
|
290
316
|
Objectives: premium, value, fresh_arrival, rare_origin.
|
|
@@ -301,6 +327,7 @@ Notes:
|
|
|
301
327
|
}
|
|
302
328
|
const input = {
|
|
303
329
|
objective: objective,
|
|
330
|
+
supplier: opts.supplier,
|
|
304
331
|
country: opts.country,
|
|
305
332
|
process: opts.process,
|
|
306
333
|
stockedOnly: opts.all ? false : opts.stocked ? true : true,
|