@curviate/cli 0.30.0 → 0.31.1

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 (38) hide show
  1. package/CHANGELOG.md +153 -0
  2. package/README.md +65 -12
  3. package/dist/{account-5KGM6EPR.js → account-DZRX4YOK.js} +28 -12
  4. package/dist/{chunk-GHT2DLZR.js → chunk-A73TUZBK.js} +4 -4
  5. package/dist/{chunk-LCIUD7S2.js → chunk-JRKM4OV2.js} +1 -1
  6. package/dist/{chunk-5KANHEBN.js → chunk-KQXYEQAD.js} +0 -56
  7. package/dist/{chunk-63X3VI3T.js → chunk-LKF5MZIP.js} +1 -1
  8. package/dist/chunk-PKSKQ3LN.js +68 -0
  9. package/dist/{chunk-AHYUM2XQ.js → chunk-SKJNLN37.js} +12 -2
  10. package/dist/chunk-TD2ZIXFR.js +67 -0
  11. package/dist/{chunk-KTY7R27U.js → chunk-TQJ77SL4.js} +3 -1
  12. package/dist/chunk-X3YWBMBC.js +151 -0
  13. package/dist/{chunk-TAOXJNQN.js → chunk-Y3H55OSY.js} +14 -12
  14. package/dist/cli.js +36 -22
  15. package/dist/{comment-BLG4WHST.js → comment-6JI4Q6QY.js} +17 -14
  16. package/dist/{company-ZT65QZ6F.js → company-RLU5SHUO.js} +25 -22
  17. package/dist/{config-5HB2J3RY.js → config-FUHT23SX.js} +2 -2
  18. package/dist/{connect-57AUN33D.js → connect-63NUITEZ.js} +22 -19
  19. package/dist/doctor-KSLZNAKH.js +198 -0
  20. package/dist/{exit-codes-U5CHA6FT.js → exit-codes-RUKZC4WV.js} +1 -1
  21. package/dist/{feed-3AWI2URQ.js → feed-PAWXR56T.js} +12 -9
  22. package/dist/{group-DYC2NX5M.js → group-ZIIWI7JV.js} +12 -9
  23. package/dist/{inbox-ZRFIFOEP.js → inbox-GIPLWRHQ.js} +14 -11
  24. package/dist/{inboxes-XQ2B6X3Q.js → inboxes-ECGEMDH7.js} +12 -9
  25. package/dist/{job-NUT4QMH2.js → job-WPWIAVQY.js} +14 -11
  26. package/dist/{login-KNNEN4HP.js → login-3OAUY7TG.js} +3 -3
  27. package/dist/{message-KMNRUD4H.js → message-JQL2XABC.js} +9 -7
  28. package/dist/{notification-LEM57IBY.js → notification-URSGC7OR.js} +14 -11
  29. package/dist/{post-FXAANNUB.js → post-2HI6KL73.js} +17 -14
  30. package/dist/{profile-72V55PZM.js → profile-4BXLUYMH.js} +25 -22
  31. package/dist/{recruiter-JUNB5AUR.js → recruiter-OUXQ5XYU.js} +24 -18
  32. package/dist/{sales-nav-BALVVD35.js → sales-nav-MJAMCSBO.js} +22 -16
  33. package/dist/{search-QCXTK33P.js → search-M3R35BIB.js} +21 -18
  34. package/dist/setup-YV5PVIU5.js +419 -0
  35. package/dist/{webhook-D4QRWF7W.js → webhook-3TEYA3B2.js} +10 -7
  36. package/package.json +2 -2
  37. package/dist/chunk-2OG6M6ME.js +0 -89
  38. package/dist/{chunk-H4KV7MIN.js → chunk-YLSJ4HKU.js} +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,159 @@ 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.31.1] - 2026-09-10
10
+
11
+ ### Fixed
12
+
13
+ - `doctor` reported an unreachable API as `api reachable: PASS` and blamed the
14
+ credential instead, at exit `1`. Reachability was decided from the SDK error's
15
+ **code**, on the premise that a transport failure carries no code; the transport
16
+ wraps every fetch rejection as `INTERNAL`, so the premise was false and the check
17
+ was wrong in both directions: a 503 that came back over a working connection was
18
+ reported unreachable.
19
+
20
+ Reachability now follows `httpStatus`, which is what records that a response came
21
+ back at all. **Exit codes move for these cases, in the direction the documented
22
+ contract always claimed:** an unreachable API now exits `7` rather than `1`, and a
23
+ request the client refuses to build before sending (an empty `--api-key`, a
24
+ malformed base URL) keeps its own exit code rather than being reported as a
25
+ network fault.
26
+
27
+ - `doctor` no longer reports `credential valid: rejected: INTERNAL` when no response
28
+ came back. Nothing asked the credential anything; it now says the check was not
29
+ made, and why.
30
+
31
+ ## [0.31.0] - 2026-09-09
32
+
33
+ Follows the SDK to `0.30.0` and catches the CLI up to the server-side tier
34
+ retirement, the connect rework and the beta consent gate.
35
+
36
+ **Breaking for anyone matching on error codes, not on exit codes.** Exit 5 still
37
+ means the same thing and still fires in the same situations, so a script that
38
+ branches on `$?` needs no change. A script that reads `.error.code` out of
39
+ `--json` sees `NO_ACTIVE_SEAT` where a current deployment used to answer
40
+ `TIER_NOT_ACTIVE`, and no longer sees `.error.requiredTier` at all.
41
+
42
+ **`TIER_NOT_ACTIVE` and `PREMIUM_CONFLICT` still exit 5 and 8.** They are
43
+ deprecated rather than dropped, because this CLI is pointed at whichever
44
+ deployment you configure, and one that predates the seat-based entitlement
45
+ rollout still answers them. Unmapped they would fall to exit 1, which reads as
46
+ "the tool broke" for a plain billing refusal. Each shares its successor's exit
47
+ code, so branching on `$?` is deployment-independent: `TIER_NOT_ACTIVE` and
48
+ `NO_ACTIVE_SEAT` both exit 5, and you need no logic to tell which deployment
49
+ answered.
50
+
51
+ Ripple: this release rides the same wave as the SDK it pins, and the wire
52
+ contract moved before either of them. It is one release rather than three
53
+ because the CLI had two unpublished pin bumps waiting behind it.
54
+
55
+ ### Changed
56
+
57
+ - **`@curviate/sdk` pinned at `0.30.0`** (exact, as always), and
58
+ `test/fixtures/openapi.json` re-vendored from that release
59
+ (`server_git_sha ebddaea7...`, 125 paths), with `VENDORED_FROM.json`'s
60
+ `sdkVersion`, salted `sha256`, `vendoredAt` and `sourceServerGitSha`
61
+ refreshed together so `check:fixture-pin` stays closed.
62
+
63
+ - **Exit 5 now carries three codes instead of two.** `NO_ACTIVE_SEAT`
64
+ (replacing `TIER_NOT_ACTIVE`), `LINKEDIN_FEATURE_NOT_SUBSCRIBED`, and the new
65
+ `BETA_NOT_ENABLED`. They share one exit code because the remedy has the same
66
+ SHAPE (a human changes something and you retry) and a scripted caller wants
67
+ one bucket for that. They are not interchangeable: the fixes live in three
68
+ different systems, so read the `code` in the `--json` envelope. Reusing 5 for
69
+ the beta refusal rather than minting a new number is deliberate; an exit code
70
+ is a public contract and a new one breaks every existing case statement.
71
+
72
+ - **The documented exit codes are now checked for reachability**, so removing
73
+ the last code from a bucket reds instead of leaving a dead row in the README
74
+ table. That check is what will catch `PREMIUM_CONFLICT`'s eventual removal
75
+ from exit 8, when the deprecation ends.
76
+
77
+ - **The `Required tier: <tier>` line is gone from human-mode error output**,
78
+ along with the SDK field that fed it. Nothing ever asserted that line while
79
+ it existed, which is exactly why it could have been left behind silently;
80
+ both its absence and the code-and-message line that remains are now asserted.
81
+
82
+ - **Sales Navigator and Recruiter are marked beta in `--help` and the README**,
83
+ and neither describes a Curviate-side entitlement any more. There is no
84
+ add-on to buy and no tier on a seat: one ordinary paid seat entitles every
85
+ command in both groups. What they need is the LinkedIn account's own Sales
86
+ Navigator or Recruiter subscription.
87
+
88
+ - **Exit-code table row 5** now reads "No active seat, the LinkedIn account
89
+ lacks the subscription, or beta consent is missing".
90
+
91
+ - **Twenty-one error codes now get a real exit code instead of falling to 1.**
92
+ `@curviate/sdk` 0.30.0 exports codes it previously did not, each of which the
93
+ API already returned; until now the SDK decoded every one to `INTERNAL` and
94
+ this CLI exited 1, which reads as "the tool broke" for a refusal that is
95
+ usually yours to fix.
96
+
97
+ Now: `4` for `NOT_FOUND` and `REACTION_NOT_FOUND`; `7` for
98
+ `SUBSTRATE_LINK_FAILED`, `SUBSTRATE_CAP_REACHED`, `BILLING_CHECKOUT_FAILED`
99
+ and `BILLING_PORTAL_UNAVAILABLE`, all of which are a dependency failing
100
+ rather than a bad request; `2` for `ADMIN_BYPASS` and
101
+ `INVALID_CANCELLATION_SOURCE`, where the request itself does not apply or a
102
+ field value is wrong; and `11` for the remaining thirteen, which are tenant
103
+ standing, seat and subscription state, and the free-trial limits.
104
+
105
+ **If you branch on exit 1 to detect any of these, that check needs
106
+ updating.** Everything else is additive: a case that fell through to 1 now
107
+ gets a specific number, and `--json` carries the real code where it used to
108
+ carry `INTERNAL`.
109
+
110
+ - **`RATE_LIMITED` loses its exit-code entry**, because `@curviate/sdk` 0.30.0
111
+ withdrew the code: the API never produced it (the substrate's own
112
+ `RATE_LIMITED` is translated to `PLATFORM_RATE_LIMIT` before any response is
113
+ written). Nothing changes for any real response. The throttle codes that do
114
+ arrive, `RATE_LIMIT_ACCOUNT`, `RATE_LIMIT_TENANT`, `PLATFORM_RATE_LIMIT` and
115
+ `LINKEDIN_RATE_LIMITED`, all still exit 6.
116
+
117
+ ### Fixed
118
+
119
+ - **`company` inbox beta markers were wrong in both directions.**
120
+ `company chat` claimed beta for an operation that is stable, promising a gate
121
+ that cannot fire; `company search-chats` omitted it for one that IS beta, so a
122
+ caller got no warning the call can be refused for missing beta consent. Both
123
+ now match the served badge, and the match is checked mechanically per
124
+ operation rather than by hand, so the two cannot drift apart again.
125
+
126
+ ### Added
127
+
128
+ - **`--beta`, a global flag.** Allows beta operations for one invocation:
129
+ `--beta` (or `--beta=true`) opts in, `--beta=false` opts out even where the
130
+ workspace has consented, and omitting it leaves the workspace setting to
131
+ decide. It persists nothing, in any profile, config file or environment
132
+ variable, because durable beta consent is a workspace setting a human owns in
133
+ the dashboard. Accepts the same value grammar as the API header it sets
134
+ (`true|false`, `1|0`, `on|off`, `yes|no`), and an unrecognised value is a
135
+ usage error (exit 2) with no request sent. `--no-beta` is accepted as a
136
+ synonym for `--beta=false`, and takes no value of its own: `--no-beta=false`
137
+ is a usage error rather than a guess at which negation was meant.
138
+
139
+ Worth knowing if you were relying on the old behaviour: an invalid value used
140
+ to be impossible to express and now refuses loudly rather than guessing. The
141
+ argument parser reads `--beta=maybe` as `true`, so guessing would mean opting
142
+ IN on a typo, which is the one direction a consent flag must not fail in.
143
+
144
+ - **`account link --linkedin-premium <sales_navigator|recruiter>`.** Narrows a
145
+ connect to one LinkedIn premium surface. Omit it and the connect asks for
146
+ every product and LinkedIn activates whichever ones the account holds; set it
147
+ to `recruiter` for an account that holds both, where Sales Navigator would
148
+ otherwise win. It applies to THAT call only and is never remembered, so
149
+ restate it on every connect and reconnect where Recruiter must win. The
150
+ previous `trial_premium` field is gone from the connect surface, and was
151
+ never exposed as a CLI flag.
152
+
153
+ An unrecognised value is a usage error (exit 2) with no request sent, and so
154
+ is an EMPTY one: `--linkedin-premium="$PREF"` with `PREF` unset would
155
+ otherwise take the same path as omitting the flag, which asks for every
156
+ product and lets Sales Navigator win. Under `--preview` it reports the
157
+ problem and renders instead of exiting, since a client-side render never
158
+ exits.
159
+
160
+ ---
161
+
9
162
  ## [0.30.0] - 2026-09-07
10
163
 
11
164
  Pins `@curviate/sdk` at `0.29.0` and re-vendors the OpenAPI fixture from it
package/README.md CHANGED
@@ -23,6 +23,40 @@ Requires Node.js 18 or later.
23
23
 
24
24
  ## Authentication
25
25
 
26
+ **Option 0: `curviate setup`** (the one-command path). It prints a link, opens
27
+ it if there is a browser here, and waits. Sign in, press Authorize, paste the
28
+ code it shows you back into the terminal, and the key lands in a local profile:
29
+
30
+ ```
31
+ curviate setup
32
+ ```
33
+
34
+ There is no browser on the machine, or you are on a remote shell? Nothing
35
+ changes: the link is printed either way, and the code can be opened on a phone
36
+ and pasted back. `--no-browser` forces that shape.
37
+
38
+ Agents run the same flow in two steps, because an agent cannot read a browser:
39
+
40
+ ```
41
+ curviate setup --json # prints {"authorize_url": ..., "next_step": "curviate setup --code -"}
42
+ curviate setup --code - # the code arrives on stdin, so it stays out of argv and shell history
43
+ ```
44
+
45
+ Self-hosting, or serving the dashboard somewhere unusual? Set
46
+ `CURVIATE_APP_URL` to the host that serves the authorize page. Otherwise the
47
+ link is derived from the API base URL.
48
+
49
+ Then `curviate doctor` answers "can I run?" in one call: version, config path,
50
+ active profile, base URL, which precedence tier the credential came from
51
+ (never its value), whether the API is reachable and the key valid, and the
52
+ connected accounts with their status. It exits `0` when every check passes and
53
+ with the first failing check's code otherwise.
54
+
55
+ `doctor` also names the workspace the credential belongs to, but only when the
56
+ key it resolved is one `curviate setup` wrote to a profile. A key from
57
+ `CURVIATE_API_KEY` or `--api-key` may belong to another workspace entirely, so
58
+ it is reported as unknown rather than guessed at.
59
+
26
60
  **Option 1: interactive login** (stores a profile in `~/.config/curviate/`):
27
61
 
28
62
  ```bash
@@ -69,6 +103,7 @@ Global flags available on every command:
69
103
  --page-delay Milliseconds to pause between pages when --all is used (default 400)
70
104
  --preview Show what would happen without sending any write request
71
105
  --verbose Output the full SDK response instead of the slim default
106
+ --beta Allow beta operations for this call only (--beta, --beta=false)
72
107
  --base-url Override the API base URL (for testing)
73
108
  --timeout Request timeout in milliseconds (default: 30000)
74
109
  ```
@@ -146,16 +181,20 @@ curviate profile "$PROFILE_URL" --posts --fields id --account acc_1 --json \
146
181
  | xargs -I{} curviate post react {} --account acc_1 --reaction like
147
182
  ```
148
183
 
149
- ### 4. Check tier entitlement before a Sales Navigator sweep
184
+ ### 4. Check entitlement before a Sales Navigator sweep
150
185
 
151
- Exit code `5` means the account lacks the required add-on. Branch on it in a script:
186
+ Exit code `5` is the entitlement refusal. Three different things produce it and the
187
+ `code` in the JSON body says which: `NO_ACTIVE_SEAT` (no Curviate seat covers the
188
+ account), `LINKEDIN_FEATURE_NOT_SUBSCRIBED` (the LinkedIn account lacks its own Sales
189
+ Navigator subscription) or `BETA_NOT_ENABLED` (the workspace has not opted into beta).
190
+ Branch on the exit code for the retry decision and read the code for the remedy:
152
191
 
153
192
  ```bash
154
193
  curviate sales-nav search people --keywords "VP Engineering" --account acc_1 --json \
155
194
  || {
156
195
  code=$?
157
196
  if [ "$code" -eq 5 ]; then
158
- echo "Sales Navigator add-on required. Upgrade at https://docs.curviate.com"
197
+ echo "Entitlement refused. Read .error.code for which of the three it was."
159
198
  else
160
199
  echo "Search failed with exit code $code"
161
200
  exit "$code"
@@ -228,11 +267,18 @@ curviate company jobs 112013061 --all --account acc_1 --json # streams every p
228
267
 
229
268
  ## Sales Navigator
230
269
 
231
- Sales Navigator commands (`curviate sales-nav ...`) require an account with the Sales Navigator
232
- add-on tier attached. A call against an account without it fails with **exit code `5`** and a
233
- `TIER_NOT_ACTIVE` error body naming the required tier (`sales_nav`); branch on the exit code the
234
- same way as example 4 above. Write commands (`save-lead`, `save-account`, `message new`) accept
235
- `--preview` to render the request without sending it.
270
+ Sales Navigator commands (`curviate sales-nav ...`) are **beta**: this surface has not been
271
+ exercised against a real Sales Navigator subscription yet, so its responses may still move.
272
+
273
+ There is no Sales Navigator add-on to buy from Curviate and no tier on a seat: one ordinary
274
+ paid seat entitles every command here. What these commands do need is the LinkedIn account's
275
+ own Sales Navigator subscription. A refusal is **exit code `5`** with one of three codes in
276
+ the JSON body: `NO_ACTIVE_SEAT` (no Curviate seat covers the account, fix it in billing),
277
+ `LINKEDIN_FEATURE_NOT_SUBSCRIBED` (the LinkedIn account lacks the subscription, fix it on
278
+ LinkedIn) or `BETA_NOT_ENABLED` (a human enables beta in Settings, or pass `--beta` for this
279
+ call). Branch on the exit code the same way as example 4 above, and read the code for the
280
+ remedy. Write commands (`save-lead`, `save-account`, `message new`) accept `--preview` to
281
+ render the request without sending it.
236
282
 
237
283
  ### 1. Search Sales Navigator profiles, then get one full profile
238
284
 
@@ -321,9 +367,16 @@ curviate sales-nav save-account 112013061 --account acc_1 --list 987654
321
367
 
322
368
  ## Recruiter
323
369
 
324
- Recruiter commands (`curviate recruiter ...`) require an account with the Recruiter add-on tier
325
- attached. A call against an account without it fails with **exit code `5`** and a `TIER_NOT_ACTIVE`
326
- error body naming the required tier (`recruiter`). The surface is project-centric: most
370
+ Recruiter commands (`curviate recruiter ...`) are **beta**: this surface has not been exercised
371
+ against a real Recruiter subscription yet, so its responses may still move.
372
+
373
+ There is no Recruiter add-on to buy from Curviate and no tier on a seat: one ordinary paid seat
374
+ entitles every command here. What these commands do need is the LinkedIn account's own Recruiter
375
+ subscription. A refusal is **exit code `5`** with one of three codes in the JSON body:
376
+ `NO_ACTIVE_SEAT` (no Curviate seat covers the account, fix it in billing),
377
+ `LINKEDIN_FEATURE_NOT_SUBSCRIBED` (the LinkedIn account lacks the subscription, fix it on
378
+ LinkedIn) or `BETA_NOT_ENABLED` (a human enables beta in Settings, or pass `--beta` for this
379
+ call). The surface is project-centric: most
327
380
  operations are scoped to a hiring project id. Write commands (`save-candidate`, `project update`,
328
381
  `project-job create`/`update`, `job create`/`publish`/`close`, `message new`) accept `--preview`
329
382
  to render the request without sending it.
@@ -508,7 +561,7 @@ curviate inbox get 2-AbCdEf== --account acc_1 --mode cache_only --json
508
561
  | 2 | Usage / argument error |
509
562
  | 3 | Authentication or authorization failure |
510
563
  | 4 | Resource not found |
511
- | 5 | Feature requires an add-on or higher plan |
564
+ | 5 | No active seat, the LinkedIn account lacks the subscription, or beta consent is missing |
512
565
  | 6 | Rate limited |
513
566
  | 7 | Transient platform error (retry likely to succeed) |
514
567
  | 8 | Account or connection state blocks the request |
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readlineSync
4
- } from "./chunk-H4KV7MIN.js";
4
+ } from "./chunk-YLSJ4HKU.js";
5
5
  import {
6
6
  slimAccountGet,
7
7
  slimAccountList,
@@ -10,27 +10,30 @@ import {
10
10
  import {
11
11
  pageDelayFromFlags,
12
12
  streamAll
13
- } from "./chunk-63X3VI3T.js";
13
+ } from "./chunk-LKF5MZIP.js";
14
14
  import {
15
15
  buildPreviewOutput
16
16
  } from "./chunk-R3VLWLVV.js";
17
17
  import {
18
- createClient,
19
18
  renderError,
20
19
  renderSuccess,
21
- renderUnexpectedError,
20
+ renderUnexpectedError
21
+ } from "./chunk-KQXYEQAD.js";
22
+ import {
23
+ createClient,
22
24
  resolveEffectiveConfig
23
- } from "./chunk-5KANHEBN.js";
24
- import "./chunk-KTY7R27U.js";
25
+ } from "./chunk-TD2ZIXFR.js";
26
+ import "./chunk-PKSKQ3LN.js";
27
+ import {
28
+ AUTH_NEEDED
29
+ } from "./chunk-X3YWBMBC.js";
30
+ import "./chunk-TQJ77SL4.js";
25
31
  import {
26
32
  GLOBAL_FLAGS,
27
33
  READ_SINGLE_FLAGS,
28
34
  WRITE_SINGLE_FLAGS,
29
35
  defaultReadStdin
30
- } from "./chunk-AHYUM2XQ.js";
31
- import {
32
- AUTH_NEEDED
33
- } from "./chunk-2OG6M6ME.js";
36
+ } from "./chunk-SKJNLN37.js";
34
37
 
35
38
  // src/commands/account.ts
36
39
  import { defineCommand } from "citty";
@@ -220,7 +223,7 @@ function resolveOutputOpts(flags) {
220
223
  async function handleError(err, outOpts, out) {
221
224
  const { CurviateError } = await import("@curviate/sdk");
222
225
  if (err instanceof CurviateError) {
223
- const { getExitCode } = await import("./exit-codes-U5CHA6FT.js");
226
+ const { getExitCode } = await import("./exit-codes-RUKZC4WV.js");
224
227
  renderError(err, outOpts, out);
225
228
  process.exit(getExitCode(err.code));
226
229
  }
@@ -273,6 +276,18 @@ async function buildAuthBody(flags, ctx) {
273
276
  if (flags["auth-method"]) body["auth_method"] = flags["auth-method"];
274
277
  if (flags["user-agent"]) body["user_agent"] = flags["user-agent"];
275
278
  if (flags["recruiter-contract-id"]) body["recruiter_contract_id"] = flags["recruiter-contract-id"];
279
+ if (flags["linkedin-premium"] !== void 0) {
280
+ const value = flags["linkedin-premium"];
281
+ if (value !== "sales_navigator" && value !== "recruiter") {
282
+ ctx.out.stderr.write(
283
+ `error: --linkedin-premium must be one of: sales_navigator, recruiter. Got "${value}".
284
+ `
285
+ );
286
+ if (!ctx.previewMode) process.exit(2);
287
+ } else {
288
+ body["linkedin_premium"] = value;
289
+ }
290
+ }
276
291
  if (flags["auth-method"] === "credentials") {
277
292
  const password = await resolveSecret({
278
293
  flagValue: flags.password,
@@ -922,7 +937,8 @@ var accountLinkCommand = defineCommand({
922
937
  "proxy-username": { type: "string", description: "Proxy auth username." },
923
938
  "proxy-password": { type: "string", description: `Proxy auth password. ${OPTIONAL_SECRET_WARNING("CURVIATE_PROXY_PASSWORD")}` },
924
939
  "user-agent": { type: "string", description: "Browser User-Agent to pin for this account." },
925
- "recruiter-contract-id": { type: "string", description: "Recruiter contract to bind to (Recruiter tier only)." },
940
+ "recruiter-contract-id": { type: "string", description: "Recruiter contract to bind to. Only meaningful when the LinkedIn account holds a Recruiter subscription." },
941
+ "linkedin-premium": { type: "string", description: "Narrow this connection to one LinkedIn premium surface: sales_navigator | recruiter. Omit it and the connect asks for every product and LinkedIn activates what the account holds. Applies to THIS call only and is never remembered, so restate it on every connect and reconnect where Recruiter must win." },
926
942
  "account-id": { type: "string", description: "Existing account id (acc_...) to re-authenticate IN PLACE. Passing it makes this an in-place reconnect of that account. Omit to connect a NEW account into --seat-id." },
927
943
  "no-interactive": {
928
944
  type: "boolean",
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- assertNoStdinPlaceholder
4
- } from "./chunk-AHYUM2XQ.js";
5
2
  import {
6
3
  getExitCode
7
- } from "./chunk-2OG6M6ME.js";
4
+ } from "./chunk-X3YWBMBC.js";
5
+ import {
6
+ assertNoStdinPlaceholder
7
+ } from "./chunk-SKJNLN37.js";
8
8
 
9
9
  // src/lib/path-safety.ts
10
10
  var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  isStdinToken
4
- } from "./chunk-AHYUM2XQ.js";
4
+ } from "./chunk-SKJNLN37.js";
5
5
 
6
6
  // src/lib/search-filters.ts
7
7
  import { readFile } from "fs/promises";
@@ -1,54 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- readConfig
4
- } from "./chunk-KTY7R27U.js";
5
- import {
6
- assertNoStdinPlaceholder
7
- } from "./chunk-AHYUM2XQ.js";
8
-
9
- // src/lib/resolve.ts
10
- var DEFAULT_BASE_URL = "https://api.curviate.com";
11
- var DEFAULT_TIMEOUT_MS = 3e4;
12
- async function resolveEffectiveConfig(flags) {
13
- const cfg = await readConfig();
14
- const profileName = flags.profile ?? (cfg?.active ?? "default");
15
- const profile = cfg?.profiles[profileName];
16
- const apiKey = flags.apiKey ?? process.env["CURVIATE_API_KEY"] ?? profile?.apiKey ?? void 0;
17
- const baseUrl = flags.baseUrl ?? process.env["CURVIATE_BASE_URL"] ?? profile?.baseUrl ?? DEFAULT_BASE_URL;
18
- const timeoutFlag = flags.timeout !== void 0 ? parseInt(flags.timeout, 10) : void 0;
19
- const timeout = timeoutFlag ?? profile?.timeout ?? DEFAULT_TIMEOUT_MS;
20
- const account = flags.account ?? process.env["CURVIATE_ACCOUNT"] ?? profile?.account ?? void 0;
21
- return { apiKey, baseUrl, timeout, account };
22
- }
23
-
24
- // src/lib/client.ts
25
- import { Curviate } from "@curviate/sdk";
26
- function headerStrings(headers) {
27
- if (!headers) return [];
28
- if (headers instanceof Headers) {
29
- const out = [];
30
- headers.forEach((value, key) => out.push(key, value));
31
- return out;
32
- }
33
- if (Array.isArray(headers)) return headers.flat().map(String);
34
- return Object.entries(headers).flat().map(String);
35
- }
36
- var guardedFetch = (input, init) => {
37
- assertNoStdinPlaceholder("the request about to be sent", [
38
- String(input instanceof Request ? input.url : input),
39
- ...headerStrings(init?.headers),
40
- typeof init?.body === "string" ? init.body : void 0
41
- ]);
42
- return fetch(input, init);
43
- };
44
- function createClient(config) {
45
- return new Curviate({
46
- apiKey: config.apiKey.trim(),
47
- fetch: guardedFetch,
48
- ...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
49
- ...config.timeout !== void 0 ? { timeout: config.timeout } : {}
50
- });
51
- }
52
2
 
53
3
  // src/lib/output.ts
54
4
  function isJsonMode(opts) {
@@ -227,10 +177,6 @@ function renderError(err, opts, out) {
227
177
  );
228
178
  } else {
229
179
  let msg = `Error: [${errJson.code}] ${errJson.message}`;
230
- if (errJson.requiredTier) {
231
- msg += `
232
- Required tier: ${errJson.requiredTier}`;
233
- }
234
180
  const safety = errJson;
235
181
  if (safety.budgetRow) {
236
182
  if (errJson.code === "BUDGET_EXHAUSTED") {
@@ -277,8 +223,6 @@ function renderUnexpectedError(err, out) {
277
223
  }
278
224
 
279
225
  export {
280
- resolveEffectiveConfig,
281
- createClient,
282
226
  renderProvenanceNote,
283
227
  renderSuccess,
284
228
  renderNotices,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  renderNotices,
4
4
  renderProvenanceNote
5
- } from "./chunk-5KANHEBN.js";
5
+ } from "./chunk-KQXYEQAD.js";
6
6
 
7
7
  // src/lib/paginate.ts
8
8
  var PaginateError = class extends Error {
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/beta.ts
4
+ var BETA_CONSENT_HEADER = "X-Curviate-Beta";
5
+ var TRUE_TOKENS = /* @__PURE__ */ new Set(["true", "1", "on", "yes"]);
6
+ var FALSE_TOKENS = /* @__PURE__ */ new Set(["false", "0", "off", "no"]);
7
+ var BETA_ACCEPTED_VALUES = "true|false, 1|0, on|off, yes|no (case-insensitive)";
8
+ function parseBetaFlag(rawArgs) {
9
+ let value;
10
+ const rest = [];
11
+ let endOfFlags = false;
12
+ for (const arg of rawArgs) {
13
+ if (endOfFlags) {
14
+ rest.push(arg);
15
+ continue;
16
+ }
17
+ if (arg === "--") {
18
+ endOfFlags = true;
19
+ rest.push(arg);
20
+ continue;
21
+ }
22
+ if (arg === "--beta") {
23
+ value = true;
24
+ continue;
25
+ }
26
+ if (arg === "--no-beta") {
27
+ value = false;
28
+ continue;
29
+ }
30
+ if (arg.startsWith("--no-beta=")) {
31
+ return {
32
+ ok: false,
33
+ error: `--no-beta takes no value. Use --no-beta, or --beta=${BETA_ACCEPTED_VALUES.split(",")[0].split("|")[1]}.`
34
+ };
35
+ }
36
+ if (arg.startsWith("--beta=")) {
37
+ const raw = arg.slice("--beta=".length).trim().toLowerCase();
38
+ if (TRUE_TOKENS.has(raw)) {
39
+ value = true;
40
+ continue;
41
+ }
42
+ if (FALSE_TOKENS.has(raw)) {
43
+ value = false;
44
+ continue;
45
+ }
46
+ return {
47
+ ok: false,
48
+ error: `--beta must be one of ${BETA_ACCEPTED_VALUES}. Got "${arg.slice("--beta=".length)}".`
49
+ };
50
+ }
51
+ rest.push(arg);
52
+ }
53
+ return { ok: true, value, rest };
54
+ }
55
+ var override;
56
+ function setBetaOverride(value) {
57
+ override = value;
58
+ }
59
+ function betaOverrideHeader() {
60
+ if (override === void 0) return {};
61
+ return { [BETA_CONSENT_HEADER]: override ? "true" : "false" };
62
+ }
63
+
64
+ export {
65
+ parseBetaFlag,
66
+ setBetaOverride,
67
+ betaOverrideHeader
68
+ };
@@ -136,6 +136,14 @@ var GLOBAL_FLAGS = {
136
136
  type: "boolean",
137
137
  description: "Output the full SDK response instead of the slim default.",
138
138
  default: false
139
+ },
140
+ // Declared here so `--help` renders it and the dispatcher's routing scan
141
+ // recognises it, but its VALUE is never read from citty: the dispatcher
142
+ // parses and strips the token first (see lib/beta.ts for why citty 0.1.6
143
+ // cannot express an optional-valued boolean without silently opting in).
144
+ beta: {
145
+ type: "boolean",
146
+ description: "Allow beta operations for THIS call only (--beta, --beta=false). A gated operation refuses BETA_NOT_ENABLED (exit 5) until a human enables beta in Settings, or you pass --beta for this call. Persists nothing."
139
147
  }
140
148
  };
141
149
  var WRITE_FLAGS = {
@@ -146,7 +154,8 @@ var WRITE_FLAGS = {
146
154
  timeout: GLOBAL_FLAGS.timeout,
147
155
  json: GLOBAL_FLAGS.json,
148
156
  preview: GLOBAL_FLAGS.preview,
149
- verbose: GLOBAL_FLAGS.verbose
157
+ verbose: GLOBAL_FLAGS.verbose,
158
+ beta: GLOBAL_FLAGS.beta
150
159
  };
151
160
  var READ_SINGLE_FLAGS = {
152
161
  "api-key": GLOBAL_FLAGS["api-key"],
@@ -157,7 +166,8 @@ var READ_SINGLE_FLAGS = {
157
166
  json: GLOBAL_FLAGS.json,
158
167
  fields: GLOBAL_FLAGS.fields,
159
168
  preview: GLOBAL_FLAGS.preview,
160
- verbose: GLOBAL_FLAGS.verbose
169
+ verbose: GLOBAL_FLAGS.verbose,
170
+ beta: GLOBAL_FLAGS.beta
161
171
  };
162
172
  var WRITE_SINGLE_FLAGS = READ_SINGLE_FLAGS;
163
173
 
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ betaOverrideHeader
4
+ } from "./chunk-PKSKQ3LN.js";
5
+ import {
6
+ readConfig
7
+ } from "./chunk-TQJ77SL4.js";
8
+ import {
9
+ assertNoStdinPlaceholder
10
+ } from "./chunk-SKJNLN37.js";
11
+
12
+ // src/lib/client.ts
13
+ import { Curviate } from "@curviate/sdk";
14
+ function headerStrings(headers) {
15
+ if (!headers) return [];
16
+ if (headers instanceof Headers) {
17
+ const out = [];
18
+ headers.forEach((value, key) => out.push(key, value));
19
+ return out;
20
+ }
21
+ if (Array.isArray(headers)) return headers.flat().map(String);
22
+ return Object.entries(headers).flat().map(String);
23
+ }
24
+ var guardedFetch = (input, init) => {
25
+ const beta = betaOverrideHeader();
26
+ let merged = init;
27
+ if (Object.keys(beta).length > 0) {
28
+ const headers = new Headers(init?.headers);
29
+ for (const [name, value] of Object.entries(beta)) headers.set(name, value);
30
+ merged = { ...init, headers };
31
+ }
32
+ assertNoStdinPlaceholder("the request about to be sent", [
33
+ String(input instanceof Request ? input.url : input),
34
+ ...headerStrings(merged?.headers),
35
+ typeof merged?.body === "string" ? merged.body : void 0
36
+ ]);
37
+ return fetch(input, merged);
38
+ };
39
+ function createClient(config) {
40
+ return new Curviate({
41
+ apiKey: config.apiKey.trim(),
42
+ fetch: guardedFetch,
43
+ ...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
44
+ ...config.timeout !== void 0 ? { timeout: config.timeout } : {}
45
+ });
46
+ }
47
+
48
+ // src/lib/resolve.ts
49
+ var DEFAULT_BASE_URL = "https://api.curviate.com";
50
+ var DEFAULT_TIMEOUT_MS = 3e4;
51
+ async function resolveEffectiveConfig(flags) {
52
+ const cfg = await readConfig();
53
+ const profileName = flags.profile ?? (cfg?.active ?? "default");
54
+ const profile = cfg?.profiles[profileName];
55
+ const apiKey = flags.apiKey ?? process.env["CURVIATE_API_KEY"] ?? profile?.apiKey ?? void 0;
56
+ const apiKeySource = flags.apiKey !== void 0 ? "flag" : process.env["CURVIATE_API_KEY"] !== void 0 ? "env" : profile?.apiKey !== void 0 ? "profile" : "none";
57
+ const baseUrl = flags.baseUrl ?? process.env["CURVIATE_BASE_URL"] ?? profile?.baseUrl ?? DEFAULT_BASE_URL;
58
+ const timeoutFlag = flags.timeout !== void 0 ? parseInt(flags.timeout, 10) : void 0;
59
+ const timeout = timeoutFlag ?? profile?.timeout ?? DEFAULT_TIMEOUT_MS;
60
+ const account = flags.account ?? process.env["CURVIATE_ACCOUNT"] ?? profile?.account ?? void 0;
61
+ return { apiKey, baseUrl, timeout, account, apiKeySource };
62
+ }
63
+
64
+ export {
65
+ createClient,
66
+ resolveEffectiveConfig
67
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  assertNoStdinPlaceholder
4
- } from "./chunk-AHYUM2XQ.js";
4
+ } from "./chunk-SKJNLN37.js";
5
5
 
6
6
  // src/lib/config.ts
7
7
  import {
@@ -129,6 +129,8 @@ async function updateProfileField(profileName, field, value) {
129
129
  profile.account = value !== void 0 ? String(value) : void 0;
130
130
  } else if (field === "baseUrl") {
131
131
  profile.baseUrl = value !== void 0 ? String(value) : void 0;
132
+ } else if (field === "tenant") {
133
+ profile.tenant = value !== void 0 ? String(value) : void 0;
132
134
  }
133
135
  }
134
136
  await writeConfig(cfg);