@curviate/cli 0.26.0 → 0.28.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/README.md +58 -0
  3. package/dist/{account-ZNBG7C3J.js → account-5KGM6EPR.js} +4 -4
  4. package/dist/{chunk-RPRIMRIU.js → chunk-2OG6M6ME.js} +11 -0
  5. package/dist/{chunk-PMWEDWJ3.js → chunk-5KANHEBN.js} +38 -5
  6. package/dist/{chunk-RZ36UBML.js → chunk-63X3VI3T.js} +5 -2
  7. package/dist/{chunk-RJTG5YWE.js → chunk-6P52Q2GK.js} +2 -2
  8. package/dist/{chunk-V75UFUF2.js → chunk-GHT2DLZR.js} +1 -1
  9. package/dist/chunk-PQWDDSV7.js +65 -0
  10. package/dist/{chunk-KTKKZGJV.js → chunk-TAOXJNQN.js} +3 -3
  11. package/dist/cli.js +17 -17
  12. package/dist/{comment-TTOQPMSO.js → comment-BLG4WHST.js} +6 -6
  13. package/dist/{company-HD3WIYP6.js → company-ZT65QZ6F.js} +6 -6
  14. package/dist/{connect-Y2FWUXDA.js → connect-57AUN33D.js} +10 -10
  15. package/dist/{exit-codes-4RCNQJUB.js → exit-codes-U5CHA6FT.js} +1 -1
  16. package/dist/{feed-I7QG7Y2Y.js → feed-3AWI2URQ.js} +5 -5
  17. package/dist/{group-RXZVIOTU.js → group-DYC2NX5M.js} +5 -5
  18. package/dist/{inbox-25JJBITH.js → inbox-CQO2I47N.js} +25 -7
  19. package/dist/{inboxes-CD3OVL76.js → inboxes-XQ2B6X3Q.js} +5 -5
  20. package/dist/{job-ITLUWM3G.js → job-NUT4QMH2.js} +5 -5
  21. package/dist/{message-WNYEHK2B.js → message-KMNRUD4H.js} +4 -4
  22. package/dist/{notification-5PETFBMH.js → notification-LEM57IBY.js} +5 -5
  23. package/dist/{post-7IROSWFO.js → post-FXAANNUB.js} +6 -6
  24. package/dist/{profile-MF5L5BTE.js → profile-72V55PZM.js} +40 -13
  25. package/dist/{recruiter-24BX6WU3.js → recruiter-JUNB5AUR.js} +5 -5
  26. package/dist/{sales-nav-3EY4H6MR.js → sales-nav-BALVVD35.js} +5 -5
  27. package/dist/{search-UPYL2NB6.js → search-QCXTK33P.js} +13 -13
  28. package/dist/{webhook-SUCCPKXZ.js → webhook-D4QRWF7W.js} +3 -3
  29. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,123 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
  Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
7
7
  a new command or flag is a minor; a breaking command/flag/exit-code change is a major; a fix is a patch.
8
8
 
9
+ ## [0.28.0] - 2026-09-06
10
+
11
+ Pins `@curviate/sdk` at `0.27.0` and re-vendors the OpenAPI fixture from it
12
+ (`server_git_sha 2a86542f...`). No command, flag or exit code changes meaning,
13
+ and no source change was needed: everything below is a consequence of the API
14
+ the CLI talks to, surfaced here because it changes what some calls answer.
15
+
16
+ ### Changed
17
+
18
+ - **`message.delivered` is no longer a subscribable webhook event.** The
19
+ platform never emitted it. `curviate webhook events` now lists 27 events,
20
+ 7 of them messaging, where it listed 28 and 8.
21
+
22
+ `--events` on `webhook create` and `webhook update` is a free-form
23
+ comma-separated string that the CLI passes through unvalidated, so this is
24
+ not a client-side usage error (exit `2`): sending `message.delivered` now
25
+ gets a `400` from the API and exits on the request-error path like any other
26
+ rejected value. Drop it from the list.
27
+
28
+ **Reading an existing subscription is unaffected.** `events` on
29
+ `webhook list` and `webhook get` is a plain string array, not the create
30
+ enum. A subscription created before 2026-09-06 may still echo
31
+ `message.delivered` in its stored `events` until the server-side cleanup
32
+ migration lands; it was never delivered. It renders as an ordinary value and
33
+ nothing throws.
34
+
35
+ The read-path replacement is `is_delivered` on the message resource.
36
+ - **`notices[]` can now carry `EXPANSION_WITHHELD_CEILING`** on the reads that
37
+ accept `--expand public_identifier`, alongside `EXPANSION_LIMIT_REACHED` and
38
+ `EXPANSION_WITHHELD_ACTIVITY_WINDOW`: the expansion was withheld because the
39
+ account is at an account-safety ceiling. It renders through the same
40
+ `notice [CODE] message` line as its two siblings, on stderr in human mode and
41
+ carried on the response in `--json`, so no output shape changes and no
42
+ branch on the existing codes breaks.
43
+ - **The warn-posture safety hint reads differently.** On a `2xx` that carries
44
+ `safety_warning`, `hint.message` now says the action went through and how far
45
+ past the ceiling the row stands, rather than restating the ceiling. The CLI
46
+ prints the server's string verbatim, in both human and `--json` output, so
47
+ this is prose only: no field moved and nothing needs re-parsing. An agent
48
+ matching on the old sentence should match on `safety_warning.blocked` or
49
+ `hint.parameter` instead.
50
+ - **A `502` whose upstream response could not be interpreted is not worth
51
+ retrying.** The API documents `retry_likely_to_succeed` as the field that
52
+ separates the two `502` cases, and the do-not-retry one carries
53
+ `retry_hint: {"kind": "never"}`. Both fields were already on the wire and the
54
+ CLI already surfaces them; nothing about its own behaviour changes here.
55
+
56
+ ## [0.27.0] - 2026-09-06
57
+
58
+ Pins `@curviate/sdk` at `0.26.0`, which is what makes the last two items of
59
+ this release possible: `inbox get` can carry the retrieval pair, and exit `14`
60
+ is reachable. No command, flag or exit code changes meaning.
61
+
62
+ ### Added
63
+
64
+ - **`--mode` and `--max-age` on the reads that can be served from a stored
65
+ copy.** `--mode auto|live|refill|cache_only` says how willing a read is to
66
+ reach LinkedIn; `--max-age <seconds>` sets the oldest stored copy it will
67
+ accept and overrides the `auto`, `live` and `refill` presets in both
68
+ directions. Available on `profile <id>`, `profile me`, `inbox get` and
69
+ `inbox messages`, the four reads the API declares them on. The activity listings on the profile
70
+ commands (`--posts`, `--comments`, `--reactions`, `--followers`) reject them
71
+ with exit `2` rather than sending a parameter their endpoints answer with a
72
+ `400`.
73
+ - **Client-side validation, before any request is sent.** An unknown `--mode`,
74
+ a `--max-age` that is not a whole number from `0` to `31536000`, or
75
+ `--mode cache_only` combined with `--max-age` is a usage error (exit `2`)
76
+ with nothing transmitted. The last of those mirrors the API: `cache_only`
77
+ never reaches LinkedIn at any age, so a freshness threshold cannot change
78
+ its answer, and the pair is refused rather than one of the two being
79
+ silently ignored.
80
+ - **Provenance on the response.** These reads carry `source` (`store` or
81
+ `live`) and `observed_at`, plus `withdrawn`/`withdrawn_at` when the platform
82
+ says the resource is gone. All of them now survive `--fields` and the slim
83
+ projection, which previously dropped them (both layers rebuild output from an
84
+ allowlist). In human mode the same facts go to stderr as a one-line
85
+ `provenance:` note, leaving stdout parseable. Under `--all`, where items
86
+ stream as raw NDJSON and never pass through the single-response renderer,
87
+ each page's note goes to stderr the same way page-scoped `notices` already
88
+ do, so the highest-volume read path is not the one that cannot say where its
89
+ data came from. A stored copy can carry less than a live one, so
90
+ `source: "store"` is the signal to re-read with `--mode live` when message
91
+ bodies or contact fields matter.
92
+ - **Exit code `14`, nothing stored.** `NOT_STORED` answers a
93
+ `--mode cache_only` read the store cannot satisfy. It is deliberately not
94
+ `4`: the resource may exist perfectly well on LinkedIn and this API simply
95
+ holds no copy, so re-checking the id is the wrong move; the fix is another
96
+ mode. A `502` under `cache_only` keeps its existing mapping, because "we
97
+ could not look" and "we hold nothing" are different answers and only one is
98
+ worth retrying.
99
+
100
+ - **The id-resolution pre-call obeys the mode too.** `profile <id> --sections`
101
+ with a slug resolves the slug to a provider id with a first read before the
102
+ enriched one. That pre-call now carries `mode`/`max_age`; previously it went
103
+ out with neither, so `--mode cache_only` reached LinkedIn once before the
104
+ read it was meant to prevent: the mode's only guarantee, broken under a
105
+ `200` with nothing to notice.
106
+
107
+ ### Changed
108
+
109
+ - **`@curviate/sdk` pinned at `0.26.0`** (was `0.25.0`), an exact pin as
110
+ always. Two things this release needed shipped there, and both were held
111
+ open by tests written to fail on the day the wait ended:
112
+ - `messaging.getChat(chatId, params?)` takes the retrieval query, so
113
+ **`inbox get` now carries `--mode`/`--max-age`** like the other three
114
+ store-served reads. The chat-id normalization still runs first, so the
115
+ pair rides the bare provider id rather than a thread URL.
116
+ - `NOT_STORED` is in the SDK's error taxonomy, so **exit `14` is now
117
+ reachable**. It previously decoded to `INTERNAL` and the binary answered
118
+ `1`; a `--mode cache_only` read the store cannot satisfy now exits `14`,
119
+ and, because the code is deliberately not retryable, on the first reply
120
+ rather than after a retry loop against an answer that cannot change.
121
+ Nothing else in the SDK bump reaches this binary: the SDK's own type-level
122
+ breaking change (`row` is `string | null` on errors and safety warnings) is
123
+ absorbed by the CLI's existing `typeof === "string"` guard, and the widened
124
+ response enums are read, never exhaustively switched.
125
+
9
126
  ## [0.26.0] - 2026-09-05
10
127
 
11
128
  ### Added
package/README.md CHANGED
@@ -442,6 +442,63 @@ curviate recruiter jobs --account acc_1 --limit 10 --json \
442
442
  curviate recruiter job get "https://www.linkedin.com/jobs/view/4428113858" --account acc_1 --json
443
443
  ```
444
444
 
445
+ ## Retrieval modes
446
+
447
+ Some reads can be answered from the copy Curviate already holds instead of
448
+ calling LinkedIn. `--mode` says how willing a read is to fetch, and `--max-age`
449
+ sets the oldest stored copy it will accept.
450
+
451
+ | `--mode` | Behaviour |
452
+ |------|---------|
453
+ | `auto` | Default. Serve a stored copy while it is within the resource's freshness threshold, otherwise fetch. |
454
+ | `live` | Always fetch. Same as `--max-age 0`. |
455
+ | `refill` | Serve a stored copy at any age; fetch only when nothing is stored yet. |
456
+ | `cache_only` | Never fetch. A store miss is refused rather than fetched (see the exit-`14` note below). |
457
+
458
+ `--max-age <seconds>` is a whole number from `0` to `31536000` (one year). It
459
+ overrides the `auto`, `live` and `refill` presets in both directions. It cannot
460
+ be combined with `--mode cache_only`, whose guarantee is not a freshness
461
+ threshold: that combination is a usage error (exit `2`) before any request is
462
+ sent.
463
+
464
+ Available on the four reads that can be served from a stored copy:
465
+ `profile <id>`, `profile me`, `inbox get` and `inbox messages`. The activity
466
+ listings on the profile commands (`--posts`, `--comments`, `--reactions`,
467
+ `--followers`) do not accept them and reject them with exit `2`.
468
+
469
+ ### Telling a served copy from a fetch
470
+
471
+ Every response from these reads carries `source` (`store` or `live`) and
472
+ `observed_at`, and they survive `--fields` and the slim projection. In human
473
+ mode the same facts go to stderr as a one-line `provenance:` note, so stdout
474
+ stays parseable.
475
+
476
+ A stored copy can carry less than a live one: message bodies and contact fields
477
+ are stripped before anything is stored, so `source: "store"` is the signal to
478
+ re-read with `--mode live` when you need them.
479
+
480
+ ### Exit `14`: nothing stored
481
+
482
+ A `--mode cache_only` read the store cannot answer exits `14`. It is not
483
+ "not found" (exit `4`): the resource may exist perfectly well on LinkedIn and
484
+ this API simply holds no copy, so re-checking the id is the wrong move. It is
485
+ not a failure either. The fix is another mode, and it is never worth retrying
486
+ as sent, because the answer cannot change until you change the mode.
487
+
488
+ ```bash
489
+ # The default: a fresh stored copy if there is one, otherwise fetch
490
+ curviate profile me --account acc_1 --json
491
+
492
+ # Serve whatever is stored at any age, and fetch only if nothing is
493
+ curviate profile me --account acc_1 --mode refill --json
494
+
495
+ # Accept a stored copy up to five minutes old, otherwise fetch
496
+ curviate profile me --account acc_1 --max-age 300 --fields first_name,source,observed_at --json
497
+
498
+ # A single chat from the store, never LinkedIn. Exit 14 if nothing is stored.
499
+ curviate inbox get 2-AbCdEf== --account acc_1 --mode cache_only --json
500
+ ```
501
+
445
502
  ## Exit codes
446
503
 
447
504
  | Code | Meaning |
@@ -460,6 +517,7 @@ curviate recruiter job get "https://www.linkedin.com/jobs/view/4428113858" --acc
460
517
  | 11 | Billing issue (payment required, failed, or seat cancelled) |
461
518
  | 12 | Auth action needed (a pending checkpoint; not an error) |
462
519
  | 13 | Account-safety budget: Curviate's own ceiling refused the action |
520
+ | 14 | Nothing stored: a `--mode cache_only` read the store cannot answer. Retry with another mode, not with the same request |
463
521
 
464
522
  ### 6 and 13 are both `429`, and they need different actions
465
523
 
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  pageDelayFromFlags,
12
12
  streamAll
13
- } from "./chunk-RZ36UBML.js";
13
+ } from "./chunk-63X3VI3T.js";
14
14
  import {
15
15
  buildPreviewOutput
16
16
  } from "./chunk-R3VLWLVV.js";
@@ -20,7 +20,7 @@ import {
20
20
  renderSuccess,
21
21
  renderUnexpectedError,
22
22
  resolveEffectiveConfig
23
- } from "./chunk-PMWEDWJ3.js";
23
+ } from "./chunk-5KANHEBN.js";
24
24
  import "./chunk-KTY7R27U.js";
25
25
  import {
26
26
  GLOBAL_FLAGS,
@@ -30,7 +30,7 @@ import {
30
30
  } from "./chunk-AHYUM2XQ.js";
31
31
  import {
32
32
  AUTH_NEEDED
33
- } from "./chunk-RPRIMRIU.js";
33
+ } from "./chunk-2OG6M6ME.js";
34
34
 
35
35
  // src/commands/account.ts
36
36
  import { defineCommand } from "citty";
@@ -220,7 +220,7 @@ function resolveOutputOpts(flags) {
220
220
  async function handleError(err, outOpts, out) {
221
221
  const { CurviateError } = await import("@curviate/sdk");
222
222
  if (err instanceof CurviateError) {
223
- const { getExitCode } = await import("./exit-codes-4RCNQJUB.js");
223
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
224
224
  renderError(err, outOpts, out);
225
225
  process.exit(getExitCode(err.code));
226
226
  }
@@ -62,6 +62,17 @@ var EXIT_CODE_MAP = {
62
62
  SEAT_CANCELLED: 11,
63
63
  // Account-safety budget (13), see the note above for why this is not 6
64
64
  BUDGET_EXHAUSTED: 13,
65
+ // Nothing stored (14), A NEW BUCKET, and deliberately not 4.
66
+ // `NOT_STORED` is a 422 answering a `--mode cache_only` read: the resource
67
+ // may exist perfectly well on LinkedIn, and this API simply holds no copy of
68
+ // it, so it is NOT "not found" and re-checking the id is the wrong move. It
69
+ // is not 1 either: nothing failed. It is user_fixable and not retryable AS
70
+ // SENT — the fix is another mode (`refill` fetches it once, `auto` fetches
71
+ // now), which is the same shape as exit 2 but reached without a malformed
72
+ // request, so it earns its own number rather than muddying either.
73
+ // A 502 under cache_only stays 7: "we could not look" and "we hold nothing"
74
+ // are different answers and only one of them is worth retrying.
75
+ NOT_STORED: 14,
65
76
  // Internal / uncaught (1), last resort bucket
66
77
  INTERNAL: 1,
67
78
  PLATFORM_NOT_IMPLEMENTED: 1
@@ -95,13 +95,43 @@ function applyProjection(data, fields) {
95
95
  }
96
96
  return data;
97
97
  }
98
+ var isPlain = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
98
99
  function withPreservedNotices(original, rendered) {
99
- const isPlain = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
100
100
  if (!isPlain(original) || !isPlain(rendered)) return rendered;
101
+ let out = rendered;
101
102
  const notices = original["notices"];
102
- if (!Array.isArray(notices) || notices.length === 0) return rendered;
103
- if (rendered["notices"] === notices) return rendered;
104
- return { ...rendered, notices };
103
+ if (Array.isArray(notices) && notices.length > 0 && rendered["notices"] !== notices) {
104
+ out = { ...out, notices };
105
+ }
106
+ return withPreservedProvenance(original, out);
107
+ }
108
+ var PROVENANCE_KEYS = ["source", "observed_at", "withdrawn", "withdrawn_at"];
109
+ function withPreservedProvenance(original, rendered) {
110
+ if (!isPlain(original) || !isPlain(rendered)) return rendered;
111
+ if (!isRetrievalSource(original["source"])) return rendered;
112
+ const carried = { ...rendered };
113
+ for (const key of PROVENANCE_KEYS) {
114
+ if (Object.prototype.hasOwnProperty.call(original, key)) carried[key] = original[key];
115
+ }
116
+ return carried;
117
+ }
118
+ function isRetrievalSource(v) {
119
+ return v === "store" || v === "live";
120
+ }
121
+ function renderProvenanceNote(data) {
122
+ if (typeof data !== "object" || data === null || Array.isArray(data)) return null;
123
+ const d = data;
124
+ const source = d["source"];
125
+ if (!isRetrievalSource(source)) return null;
126
+ let line = `provenance: source=${source}`;
127
+ const observedAt = d["observed_at"];
128
+ if (typeof observedAt === "string" && observedAt !== "") line += ` observed_at=${observedAt}`;
129
+ if (d["withdrawn"] === true) {
130
+ const withdrawnAt = d["withdrawn_at"];
131
+ line += typeof withdrawnAt === "string" && withdrawnAt !== "" ? ` withdrawn=true withdrawn_at=${withdrawnAt}` : " withdrawn=true";
132
+ }
133
+ if (source === "store") line += " (re-read with --mode live to fetch)";
134
+ return line + "\n";
105
135
  }
106
136
  function firstProjectableItem(data) {
107
137
  const isPlainObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
@@ -132,7 +162,7 @@ function renderSuccess(data, opts, out) {
132
162
  const json = isJsonMode(opts);
133
163
  const fields = opts.fields ? opts.fields.split(",").map((f) => f.trim()).filter(Boolean) : [];
134
164
  const slimmed = !opts.verbose && opts.slim ? opts.slim(data) : data;
135
- const unknownFields = detectUnknownFields(slimmed, fields);
165
+ const unknownFields = detectUnknownFields(withPreservedNotices(data, slimmed), fields);
136
166
  if (unknownFields) {
137
167
  out.stderr.write(
138
168
  `warning: --fields not present on the response: ${unknownFields.unknown.join(", ")}. Available keys: ${unknownFields.available.join(", ")}.
@@ -143,6 +173,8 @@ function renderSuccess(data, opts, out) {
143
173
  if (json) {
144
174
  out.stdout.write(JSON.stringify(projected) + "\n");
145
175
  } else {
176
+ const provenance = renderProvenanceNote(data);
177
+ if (provenance) out.stderr.write(provenance);
146
178
  out.stdout.write(renderHuman(projected) + "\n");
147
179
  }
148
180
  }
@@ -247,6 +279,7 @@ function renderUnexpectedError(err, out) {
247
279
  export {
248
280
  resolveEffectiveConfig,
249
281
  createClient,
282
+ renderProvenanceNote,
250
283
  renderSuccess,
251
284
  renderNotices,
252
285
  renderError,
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- renderNotices
4
- } from "./chunk-PMWEDWJ3.js";
3
+ renderNotices,
4
+ renderProvenanceNote
5
+ } from "./chunk-5KANHEBN.js";
5
6
 
6
7
  // src/lib/paginate.ts
7
8
  var PaginateError = class extends Error {
@@ -56,6 +57,8 @@ async function* streamAll(fn, params, opts = {}) {
56
57
  if (opts.out) {
57
58
  const pageNotices = renderNotices(page.notices);
58
59
  if (pageNotices) opts.out.stderr.write(pageNotices + "\n");
60
+ const pageProvenance = renderProvenanceNote(page);
61
+ if (pageProvenance) opts.out.stderr.write(pageProvenance);
59
62
  }
60
63
  if (Array.isArray(items)) {
61
64
  for (const item of items) {
@@ -11,10 +11,10 @@ async function resolveMemberProviderId(ns, raw) {
11
11
  const profile = await ns.users.get(normalized, {});
12
12
  return profile.id;
13
13
  }
14
- async function resolveMemberOrMeProviderId(ns, raw) {
14
+ async function resolveMemberOrMeProviderId(ns, raw, query = {}) {
15
15
  const normalized = resolveIdentifier(raw);
16
16
  if (normalized === "me" || MEMBER_PROVIDER_ID_RE.test(normalized)) return normalized;
17
- const profile = await ns.users.get(normalized, {});
17
+ const profile = await ns.users.get(normalized, query);
18
18
  return profile.id;
19
19
  }
20
20
 
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-AHYUM2XQ.js";
5
5
  import {
6
6
  getExitCode
7
- } from "./chunk-RPRIMRIU.js";
7
+ } from "./chunk-2OG6M6ME.js";
8
8
 
9
9
  // src/lib/path-safety.ts
10
10
  var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/retrieval.ts
4
+ var RETRIEVAL_MODES = ["live", "auto", "refill", "cache_only"];
5
+ var MAX_AGE_CEILING_SECONDS = 31536e3;
6
+ var RETRIEVAL_FLAGS = {
7
+ mode: {
8
+ type: "string",
9
+ description: "How willing this read is to reach LinkedIn: auto (default, a stored copy while it is fresh), live (always fetch), refill (a stored copy at any age, fetch only when nothing is stored), cache_only (never fetch; a store miss is refused rather than fetched). Not combinable with --max-age under cache_only."
10
+ },
11
+ "max-age": {
12
+ type: "string",
13
+ description: `Maximum age in seconds of a stored copy this read will accept (integer, 0-${MAX_AGE_CEILING_SECONDS}). Overrides the auto/live/refill presets in both directions; 0 is the same as --mode live.`
14
+ }
15
+ };
16
+ var NON_NEGATIVE_INTEGER = /^\d+$/;
17
+ function hasRetrievalFlags(flags) {
18
+ return flags.mode !== void 0 || flags["max-age"] !== void 0;
19
+ }
20
+ function parseRetrievalFlags(flags) {
21
+ const query = {};
22
+ const rawMode = flags.mode;
23
+ if (rawMode !== void 0) {
24
+ if (!RETRIEVAL_MODES.includes(rawMode)) {
25
+ return {
26
+ ok: false,
27
+ error: `error: --mode must be one of: ${RETRIEVAL_MODES.join(", ")}.` + (rawMode === "" ? " Omit the flag to use the default (auto).\n" : ` Received "${rawMode}".
28
+ `)
29
+ };
30
+ }
31
+ query.mode = rawMode;
32
+ }
33
+ const rawMaxAge = flags["max-age"];
34
+ if (rawMaxAge !== void 0) {
35
+ if (query.mode === "cache_only") {
36
+ return {
37
+ ok: false,
38
+ error: "error: --mode cache_only cannot be combined with --max-age. cache_only never reaches LinkedIn at any age, so a freshness threshold cannot change its answer. Drop --max-age, or use --mode refill (stored at any age, fetch only when nothing is stored).\n"
39
+ };
40
+ }
41
+ if (!NON_NEGATIVE_INTEGER.test(rawMaxAge)) {
42
+ return {
43
+ ok: false,
44
+ error: `error: --max-age must be a whole number of seconds (0-${MAX_AGE_CEILING_SECONDS}). Received "${rawMaxAge}".
45
+ `
46
+ };
47
+ }
48
+ const seconds = Number(rawMaxAge);
49
+ if (seconds > MAX_AGE_CEILING_SECONDS) {
50
+ return {
51
+ ok: false,
52
+ error: `error: --max-age must be at most ${MAX_AGE_CEILING_SECONDS} seconds (one year). Received "${rawMaxAge}".
53
+ `
54
+ };
55
+ }
56
+ query.max_age = seconds;
57
+ }
58
+ return { ok: true, query };
59
+ }
60
+
61
+ export {
62
+ RETRIEVAL_FLAGS,
63
+ hasRetrievalFlags,
64
+ parseRetrievalFlags
65
+ };
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-UEAX6KUB.js";
19
19
  import {
20
20
  requireAccount
21
- } from "./chunk-V75UFUF2.js";
21
+ } from "./chunk-GHT2DLZR.js";
22
22
  import {
23
23
  buildPreviewOutput
24
24
  } from "./chunk-R3VLWLVV.js";
@@ -28,7 +28,7 @@ import {
28
28
  renderSuccess,
29
29
  renderUnexpectedError,
30
30
  resolveEffectiveConfig
31
- } from "./chunk-PMWEDWJ3.js";
31
+ } from "./chunk-5KANHEBN.js";
32
32
  import {
33
33
  READ_SINGLE_FLAGS,
34
34
  WRITE_FLAGS,
@@ -71,7 +71,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
71
71
  async function handleSdkError(err, outOpts, out) {
72
72
  const { CurviateError } = await import("@curviate/sdk");
73
73
  if (err instanceof CurviateError) {
74
- const { getExitCode } = await import("./exit-codes-4RCNQJUB.js");
74
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
75
75
  renderError(err, outOpts, out);
76
76
  process.exit(getExitCode(err.code));
77
77
  }
package/dist/cli.js CHANGED
@@ -340,23 +340,23 @@ var main = defineCommand({
340
340
  // ---------------------------------------------------------------------------
341
341
  // Noun groups, lazy-loaded on first invocation.
342
342
  // ---------------------------------------------------------------------------
343
- profile: () => import("./profile-MF5L5BTE.js").then((m) => m.profileCommand),
344
- company: () => import("./company-HD3WIYP6.js").then((m) => m.companyCommand),
345
- job: () => import("./job-ITLUWM3G.js").then((m) => m.jobCommand),
346
- connect: () => import("./connect-Y2FWUXDA.js").then((m) => m.connectCommand),
347
- search: () => import("./search-UPYL2NB6.js").then((m) => m.searchCommand),
348
- inbox: () => import("./inbox-25JJBITH.js").then((m) => m.inboxCommand),
349
- inboxes: () => import("./inboxes-CD3OVL76.js").then((m) => m.inboxesCommand),
350
- message: () => import("./message-WNYEHK2B.js").then((m) => m.messageCommand),
351
- post: () => import("./post-7IROSWFO.js").then((m) => m.postCommand),
352
- comment: () => import("./comment-TTOQPMSO.js").then((m) => m.commentCommand),
353
- account: () => import("./account-ZNBG7C3J.js").then((m) => m.accountCommand),
354
- webhook: () => import("./webhook-SUCCPKXZ.js").then((m) => m.webhookCommand),
355
- "sales-nav": () => import("./sales-nav-3EY4H6MR.js").then((m) => m.salesNavCommand),
356
- recruiter: () => import("./recruiter-24BX6WU3.js").then((m) => m.recruiterCommand),
357
- group: () => import("./group-RXZVIOTU.js").then((m) => m.groupCommand),
358
- feed: () => import("./feed-I7QG7Y2Y.js").then((m) => m.feedCommand),
359
- notification: () => import("./notification-5PETFBMH.js").then((m) => m.notificationCommand)
343
+ profile: () => import("./profile-72V55PZM.js").then((m) => m.profileCommand),
344
+ company: () => import("./company-ZT65QZ6F.js").then((m) => m.companyCommand),
345
+ job: () => import("./job-NUT4QMH2.js").then((m) => m.jobCommand),
346
+ connect: () => import("./connect-57AUN33D.js").then((m) => m.connectCommand),
347
+ search: () => import("./search-QCXTK33P.js").then((m) => m.searchCommand),
348
+ inbox: () => import("./inbox-CQO2I47N.js").then((m) => m.inboxCommand),
349
+ inboxes: () => import("./inboxes-XQ2B6X3Q.js").then((m) => m.inboxesCommand),
350
+ message: () => import("./message-KMNRUD4H.js").then((m) => m.messageCommand),
351
+ post: () => import("./post-FXAANNUB.js").then((m) => m.postCommand),
352
+ comment: () => import("./comment-BLG4WHST.js").then((m) => m.commentCommand),
353
+ account: () => import("./account-5KGM6EPR.js").then((m) => m.accountCommand),
354
+ webhook: () => import("./webhook-D4QRWF7W.js").then((m) => m.webhookCommand),
355
+ "sales-nav": () => import("./sales-nav-BALVVD35.js").then((m) => m.salesNavCommand),
356
+ recruiter: () => import("./recruiter-JUNB5AUR.js").then((m) => m.recruiterCommand),
357
+ group: () => import("./group-DYC2NX5M.js").then((m) => m.groupCommand),
358
+ feed: () => import("./feed-3AWI2URQ.js").then((m) => m.feedCommand),
359
+ notification: () => import("./notification-LEM57IBY.js").then((m) => m.notificationCommand)
360
360
  },
361
361
  async run() {
362
362
  const { runMain } = await import("citty");
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-RJTG5YWE.js";
4
+ } from "./chunk-6P52Q2GK.js";
5
5
  import {
6
6
  AttachError,
7
7
  describeAttachment,
@@ -11,11 +11,11 @@ import {
11
11
  import {
12
12
  pageDelayFromFlags,
13
13
  streamAll
14
- } from "./chunk-RZ36UBML.js";
14
+ } from "./chunk-63X3VI3T.js";
15
15
  import "./chunk-UEAX6KUB.js";
16
16
  import {
17
17
  requireAccount
18
- } from "./chunk-V75UFUF2.js";
18
+ } from "./chunk-GHT2DLZR.js";
19
19
  import {
20
20
  buildPreviewOutput
21
21
  } from "./chunk-R3VLWLVV.js";
@@ -25,14 +25,14 @@ import {
25
25
  renderSuccess,
26
26
  renderUnexpectedError,
27
27
  resolveEffectiveConfig
28
- } from "./chunk-PMWEDWJ3.js";
28
+ } from "./chunk-5KANHEBN.js";
29
29
  import "./chunk-KTY7R27U.js";
30
30
  import {
31
31
  GLOBAL_FLAGS,
32
32
  WRITE_SINGLE_FLAGS,
33
33
  resolveTextOrStdin
34
34
  } from "./chunk-AHYUM2XQ.js";
35
- import "./chunk-RPRIMRIU.js";
35
+ import "./chunk-2OG6M6ME.js";
36
36
 
37
37
  // src/commands/comment.ts
38
38
  import { defineCommand } from "citty";
@@ -66,7 +66,7 @@ function buildListQuery(flags) {
66
66
  async function handleSdkError(err, outOpts, out) {
67
67
  const { CurviateError } = await import("@curviate/sdk");
68
68
  if (err instanceof CurviateError) {
69
- const { getExitCode } = await import("./exit-codes-4RCNQJUB.js");
69
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
70
70
  renderError(err, outOpts, out);
71
71
  process.exit(getExitCode(err.code));
72
72
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sentAsNotice
4
- } from "./chunk-KTKKZGJV.js";
4
+ } from "./chunk-TAOXJNQN.js";
5
5
  import "./chunk-HOQ7EUHJ.js";
6
6
  import {
7
7
  AttachError,
@@ -20,14 +20,14 @@ import {
20
20
  import {
21
21
  pageDelayFromFlags,
22
22
  streamAll
23
- } from "./chunk-RZ36UBML.js";
23
+ } from "./chunk-63X3VI3T.js";
24
24
  import "./chunk-UWO2D4HW.js";
25
25
  import {
26
26
  resolveIdentifier
27
27
  } from "./chunk-UEAX6KUB.js";
28
28
  import {
29
29
  requireAccount
30
- } from "./chunk-V75UFUF2.js";
30
+ } from "./chunk-GHT2DLZR.js";
31
31
  import {
32
32
  buildPreviewOutput
33
33
  } from "./chunk-R3VLWLVV.js";
@@ -37,14 +37,14 @@ import {
37
37
  renderSuccess,
38
38
  renderUnexpectedError,
39
39
  resolveEffectiveConfig
40
- } from "./chunk-PMWEDWJ3.js";
40
+ } from "./chunk-5KANHEBN.js";
41
41
  import "./chunk-KTY7R27U.js";
42
42
  import {
43
43
  GLOBAL_FLAGS,
44
44
  WRITE_FLAGS,
45
45
  resolveTextOrStdin
46
46
  } from "./chunk-AHYUM2XQ.js";
47
- import "./chunk-RPRIMRIU.js";
47
+ import "./chunk-2OG6M6ME.js";
48
48
 
49
49
  // src/commands/company.ts
50
50
  import { defineCommand } from "citty";
@@ -85,7 +85,7 @@ async function resolveCompanyId(ns, raw) {
85
85
  async function handleSdkError(err, outOpts, out) {
86
86
  const { CurviateError } = await import("@curviate/sdk");
87
87
  if (err instanceof CurviateError) {
88
- const { getExitCode } = await import("./exit-codes-4RCNQJUB.js");
88
+ const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
89
89
  renderError(err, outOpts, out);
90
90
  process.exit(getExitCode(err.code));
91
91
  }