@curviate/cli 0.36.0 → 0.38.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/CHANGELOG.md CHANGED
@@ -8,6 +8,88 @@ a new command or flag is a minor; a breaking command/flag/exit-code change is a
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [0.38.0] - 2026-09-20
12
+
13
+ Re-vendored from `@curviate/sdk` 0.36.0.
14
+
15
+ ### Added
16
+
17
+ - **`search parameters` paginates.** The API gained a `cursor` input on the
18
+ filter-ID resolver, so the command that used to refuse `--all` now offers
19
+ the full pagination set: `--cursor` to page manually, `--all` to stream
20
+ every page as NDJSON, and `--max-pages` / `--page-delay` to bound and pace
21
+ that stream. It walks until the cursor comes back null, and behaves exactly
22
+ like `search groups`, down to the NDJSON notice and the truncation
23
+ sentinel. A call that passes none of these is unchanged.
24
+
25
+ ### Changed
26
+
27
+ - **`search parameters --help` offers the pagination flags** instead of
28
+ hiding them, and its one-liner says the command pages. `--all` was
29
+ previously an unknown flag there and exited 2; it is now accepted.
30
+ - **`--max-pages` / `--page-delay` on `search parameters` without `--all`**
31
+ is a usage error (exit 2), the same refusal every other streaming command
32
+ gives, rather than being silently ignored.
33
+ - **A `search parameters` 2xx that is not a page exits 7**, matching every
34
+ other list read. It previously rendered whatever came back.
35
+ - **Re-vendored `test/fixtures/openapi.json`** from the `@curviate/sdk`
36
+ 0.36.0 snapshot, byte-identical to it. Production now serves a `cursor`
37
+ query input on the filter-ID resolver, describes `offset` as its numeric
38
+ fallback, and names a malformed cursor among the causes of that
39
+ endpoint's `400`.
40
+
41
+ ### Fixed
42
+
43
+ - The `@curviate/sdk` pin moves from exactly `0.35.0` to exactly `0.36.0`.
44
+ The command's query type is compiler-coupled to that build, so the two move
45
+ together.
46
+
47
+ ## [0.37.0] - 2026-09-19
48
+
49
+ Re-vendored from `@curviate/sdk` 0.35.0.
50
+
51
+ ### Changed
52
+
53
+ - **`account link --help` states that `--user-agent` is required with `--auth-method cookie`**, and the exit-2 refusal says which string to pass; the flag was documented only by what it is for, so the requirement was undiscoverable from the tool.
54
+ - **`account link --seat-id` is optional: omitted, the only free seat is
55
+ used.** A first run had no seat id and no way to hold one, so the command
56
+ refused at argument validation and the documented non-interactive path (exit
57
+ 12, then `curviate account checkpoint solve`) was unreachable. The command
58
+ now reads `curviate account seats` itself when `--seat-id` is omitted and
59
+ connects into the single seat listed free, stating which one on stderr. Zero
60
+ free seats and several free seats both refuse and connect nothing: zero names
61
+ how to free or add one, several lists every candidate and asks for
62
+ `--seat-id`. Passing `--seat-id` costs no seats read and behaves exactly as
63
+ before. `--seat-id` is still required with `--preview` (which calls nothing)
64
+ and with `--account-id` (a reconnect keeps the seat that account already
65
+ holds). No API change: the resolution uses the existing public seats read.
66
+ An EMPTY `--seat-id` stays a usage error rather than becoming an omission,
67
+ so `--seat-id "$SEAT"` with `SEAT` unset still exits `2` instead of binding
68
+ the free seat.
69
+
70
+ ### Fixed
71
+
72
+ - **Re-vendored `test/fixtures/openapi.json`, second refresh in this batch.**
73
+ Production now serves the Sales Navigator profile `description` relabel
74
+ (was "About/summary text. Present when populated.", now "Professional
75
+ headline. Present when populated. Reading it back through Curviate stores
76
+ it in your tenant's entity records, with no expiry."), which the previous
77
+ refresh below predated. One description string changed. No command, flag,
78
+ exit code or output shape changes; the `@curviate/sdk` pin stays exactly
79
+ `0.34.0`.
80
+ - **Re-vendored `test/fixtures/openapi.json` from the refreshed
81
+ `@curviate/sdk` snapshot.** The previous copy described company-page names,
82
+ company-page follower names and headlines, several Recruiter person fields
83
+ and the Recruiter `recruiting_profile` object as content that passes through
84
+ and is never stored. Reading those responses back does store them, in the
85
+ tenant's entity records, with no expiry, so eight response-field claims were
86
+ false and are now corrected, along with a Recruiter profile field that was
87
+ labelled the About section and is in fact the professional headline. 23
88
+ description strings in all. No command, flag, exit code or output shape
89
+ changes, and the `@curviate/sdk` pin stays exactly `0.34.0`: the snapshot is
90
+ a test fixture, not part of the published surface, and the sibling-SDK
91
+ description check only runs while the pin and the sibling version agree.
92
+
11
93
  ## [0.36.0] - 2026-09-18
12
94
 
13
95
  ### Fixed
@@ -510,20 +510,87 @@ async function handleAccountConnectResult(client, result, ctx) {
510
510
  successVerb: ctx.successVerb
511
511
  });
512
512
  }
513
- async function runAccountLink(client, flags, out, io = {}) {
514
- if (!flags["seat-id"]) {
515
- out.stderr.write("error: --seat-id is required for account link.\n");
513
+ async function soleFreeSeat(client, out, outOpts) {
514
+ let result;
515
+ try {
516
+ result = readablePage(await client.accounts.listSeats());
517
+ } catch (err) {
518
+ await handleError(err, outOpts, out);
519
+ throw err;
520
+ }
521
+ const free = [];
522
+ let unreadable = false;
523
+ for (const item of result.items) {
524
+ if (item === null || typeof item !== "object") {
525
+ unreadable = true;
526
+ continue;
527
+ }
528
+ const seat = item;
529
+ if (typeof seat.occupied !== "boolean") unreadable = true;
530
+ else if (!seat.occupied) {
531
+ if (typeof seat.seat_id === "string" && seat.seat_id.length > 0) free.push(seat.seat_id);
532
+ else unreadable = true;
533
+ }
534
+ }
535
+ if (unreadable) {
536
+ out.stderr.write(
537
+ "error: --seat-id is required: the seat list carried an entry this CLI could not read, so a seat cannot be picked for you. Run `curviate account seats` and pass --seat-id.\n"
538
+ );
539
+ process.exit(2);
540
+ }
541
+ if (free.length === 0) {
542
+ out.stderr.write(
543
+ "error: no free seat to connect into, so --seat-id cannot be picked for you. Run `curviate account seats` to see your seats. A seat is listed free only while a connect into it would be accepted right now, so an empty list can also mean the workspace has no seats or that billing needs attention. Free one with `curviate account disconnect <account_id>`, or add a seat in billing on your dashboard.\n"
544
+ );
545
+ process.exit(2);
546
+ }
547
+ if (free.length > 1) {
548
+ out.stderr.write(
549
+ `error: --seat-id is required: ${free.length} seats are free (${free.join(", ")}). Pass --seat-id <seat_id> to say which one this account takes.
550
+ `
551
+ );
516
552
  process.exit(2);
517
553
  }
554
+ const seatId = free[0];
555
+ out.stderr.write(`note: no --seat-id given, connecting into the only free seat ${seatId}.
556
+ `);
557
+ return seatId;
558
+ }
559
+ async function runAccountLink(client, flags, out, io = {}) {
518
560
  if (!flags["auth-method"]) {
519
561
  out.stderr.write("error: --auth-method is required for account link (credentials | cookie).\n");
520
562
  process.exit(2);
521
563
  }
522
564
  checkCredentialConflicts(flags, out);
523
565
  if (!flags.preview && flags["auth-method"] === "cookie" && !flags["user-agent"]) {
524
- out.stderr.write("error: --user-agent is required when --auth-method=cookie.\n");
566
+ out.stderr.write(
567
+ "error: --user-agent is required when --auth-method=cookie. Pass the User-Agent string of the browser the li_at cookie was copied from; the cookie only works paired with it.\n"
568
+ );
525
569
  process.exit(2);
526
570
  }
571
+ const outOpts = resolveOutputOpts(flags);
572
+ if (flags["seat-id"] !== void 0 && flags["seat-id"].trim() === "") {
573
+ out.stderr.write(
574
+ "error: --seat-id was given an empty value. Pass a seat id from `curviate account seats`, or omit the flag entirely to use the only free seat.\n"
575
+ );
576
+ process.exit(2);
577
+ }
578
+ let seatId = flags["seat-id"];
579
+ if (!seatId) {
580
+ if (flags.preview) {
581
+ out.stderr.write(
582
+ "error: --seat-id is required with --preview, which does not call the API to find it. Run `curviate account seats` to list your seats.\n"
583
+ );
584
+ process.exit(2);
585
+ }
586
+ if (flags["account-id"]) {
587
+ out.stderr.write(
588
+ "error: --seat-id is required with --account-id: a reconnect names the seat that account already holds, so it is not picked for you. Run `curviate account seats` to see it.\n"
589
+ );
590
+ process.exit(2);
591
+ }
592
+ seatId = await soleFreeSeat(client, out, outOpts);
593
+ }
527
594
  const resolvedIo = resolveCredentialIO(io);
528
595
  const authBody = await buildAuthBody(flags, {
529
596
  out,
@@ -534,14 +601,13 @@ async function runAccountLink(client, flags, out, io = {}) {
534
601
  previewMode: flags.preview ?? false
535
602
  });
536
603
  const body = {
537
- seat_id: flags["seat-id"],
604
+ seat_id: seatId,
538
605
  ...authBody,
539
606
  // --account-id (0.15.0): present -> re-authenticate this existing account in
540
607
  // place (reconnect); omit -> connect a new account, with NO account_id key in
541
608
  // the body at all (not undefined, not empty).
542
609
  ...flags["account-id"] ? { account_id: flags["account-id"] } : {}
543
610
  };
544
- const outOpts = resolveOutputOpts(flags);
545
611
  if (flags.preview) {
546
612
  const preview = buildPreviewOutput({ method: "auth.intent", args: {}, body });
547
613
  out.stdout.write(JSON.stringify(preview) + "\n");
@@ -958,11 +1024,11 @@ var accountSeatsCommand = defineCommand({
958
1024
  var accountLinkCommand = defineCommand({
959
1025
  meta: {
960
1026
  name: "link",
961
- description: "Connect a LinkedIn account to an empty seat. If LinkedIn requires verification you'll be prompted for the code interactively. Given --seat-id and --auth-method, a non-interactive shell exits 12 at that step and you finish with `curviate account checkpoint solve <account_id> --code`."
1027
+ description: "Connect a LinkedIn account to an empty seat. If LinkedIn requires verification you'll be prompted for the code interactively. Given --auth-method and its credentials, a non-interactive shell exits 12 at that step and you finish with `curviate account checkpoint solve <account_id> --code`."
962
1028
  },
963
1029
  args: {
964
1030
  ...WRITE_SINGLE_FLAGS,
965
- "seat-id": { type: "string", description: "Empty seat to bind the account to, listed by `curviate account seats` (a free seat there is one this call accepts right now).", required: true },
1031
+ "seat-id": { type: "string", description: "Empty seat to bind the account to, listed by `curviate account seats` (a free seat there is one this call accepts right now). Omit it and the only free seat is used; with zero or several free the command says so and connects nothing. Required with --preview (which calls nothing) and with --account-id (a reconnect keeps the seat that account already holds)." },
966
1032
  "auth-method": { type: "string", description: "Authentication method: credentials | cookie.", required: true },
967
1033
  email: { type: "string", description: "LinkedIn email (credentials method)." },
968
1034
  password: { type: "string", description: `LinkedIn password (credentials method). ${PW_WARNING("--password-stdin", "CURVIATE_LINKEDIN_PASSWORD")}` },
@@ -977,7 +1043,7 @@ var accountLinkCommand = defineCommand({
977
1043
  "proxy-port": { type: "string", description: "Proxy port." },
978
1044
  "proxy-username": { type: "string", description: "Proxy auth username." },
979
1045
  "proxy-password": { type: "string", description: `Proxy auth password. ${OPTIONAL_SECRET_WARNING("CURVIATE_PROXY_PASSWORD")}` },
980
- "user-agent": { type: "string", description: "Browser User-Agent to pin for this account." },
1046
+ "user-agent": { type: "string", description: "Browser User-Agent to pin for this account. Required with --auth-method cookie: a session cookie only works paired with the User-Agent of the browser it was copied from, and the command exits 2 without it. Optional with --auth-method credentials, where it is still pinned for the account when given." },
981
1047
  "recruiter-contract-id": { type: "string", description: "Recruiter contract to bind to. Only meaningful when the LinkedIn account holds a Recruiter subscription." },
982
1048
  "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." },
983
1049
  "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." },
package/dist/cli.js CHANGED
@@ -414,7 +414,7 @@ var main = defineCommand({
414
414
  // Subcommand registry, names and descriptions are static for help rendering;
415
415
  // the handler implementation is loaded lazily on first invocation.
416
416
  subCommands: {
417
- setup: () => import("./setup-ANHJZJ2S.js").then((m) => m.setupCommand),
417
+ setup: () => import("./setup-YUSWG77F.js").then((m) => m.setupCommand),
418
418
  doctor: () => import("./doctor-Z6OSCGKT.js").then((m) => m.doctorCommand),
419
419
  login: () => import("./login-YTVPIN27.js").then((m) => m.loginCommand),
420
420
  config: () => import("./config-RUBXWFQ3.js").then((m) => m.configCommand),
@@ -425,13 +425,13 @@ var main = defineCommand({
425
425
  company: () => import("./company-OWND3W3L.js").then((m) => m.companyCommand),
426
426
  job: () => import("./job-ESKS2LDJ.js").then((m) => m.jobCommand),
427
427
  connect: () => import("./connect-3E7EC5ZM.js").then((m) => m.connectCommand),
428
- search: () => import("./search-CS6VN5AG.js").then((m) => m.searchCommand),
428
+ search: () => import("./search-WRMVQU6C.js").then((m) => m.searchCommand),
429
429
  inbox: () => import("./inbox-DQLX2LR7.js").then((m) => m.inboxCommand),
430
430
  inboxes: () => import("./inboxes-WMNHOPY7.js").then((m) => m.inboxesCommand),
431
431
  message: () => import("./message-5W2R3YHS.js").then((m) => m.messageCommand),
432
432
  post: () => import("./post-NLI76K74.js").then((m) => m.postCommand),
433
433
  comment: () => import("./comment-G6RB2PBZ.js").then((m) => m.commentCommand),
434
- account: () => import("./account-463D5EVY.js").then((m) => m.accountCommand),
434
+ account: () => import("./account-TYKHUB7X.js").then((m) => m.accountCommand),
435
435
  webhook: () => import("./webhook-NGMRJMQ5.js").then((m) => m.webhookCommand),
436
436
  "sales-nav": () => import("./sales-nav-SW6WJVMD.js").then((m) => m.salesNavCommand),
437
437
  recruiter: () => import("./recruiter-AEJRHIX5.js").then((m) => m.recruiterCommand),
@@ -363,7 +363,7 @@ async function runSearchJobs(client, flags, out, readers = DEFAULT_FILTER_READER
363
363
  }
364
364
  async function runSearchParameters(client, flags, out) {
365
365
  rejectPreviewOnRead(flags.preview, out);
366
- rejectAllOnNonPaginated(flags.all, out);
366
+ rejectPaginationModifiersWithoutAll(flags, out);
367
367
  if (!flags.type) {
368
368
  out.stderr.write("error: --type is required.\n");
369
369
  process.exit(2);
@@ -375,13 +375,28 @@ async function runSearchParameters(client, flags, out) {
375
375
  const accountId = await requireAccount(client, flags, out);
376
376
  const ns = client.account(accountId);
377
377
  const outOpts = resolveOutputOpts(flags);
378
+ const all = flags.all ?? false;
379
+ const maxPages = flags["max-pages"] ? parseInt(flags["max-pages"], 10) : 100;
378
380
  const query = {
379
381
  type: flags.type,
380
382
  keywords: flags.keywords
381
383
  };
382
384
  if (flags.limit) query.limit = parseInt(flags.limit, 10);
385
+ if (flags.cursor) query.cursor = flags.cursor;
383
386
  try {
387
+ if (all) {
388
+ const fn = (p) => ns.search.getParameters(p);
389
+ for await (const item of streamAll(fn, query, {
390
+ maxPages,
391
+ out,
392
+ pageDelayMs: pageDelayFromFlags(flags)
393
+ })) {
394
+ writeNdjsonItem(out, item, outOpts.fields);
395
+ }
396
+ return;
397
+ }
384
398
  const result = await ns.search.getParameters(query);
399
+ readablePage(result);
385
400
  renderSuccess(result, outOpts, out);
386
401
  } catch (err) {
387
402
  const { CurviateError } = await import("@curviate/sdk");
@@ -701,9 +716,12 @@ var searchJobsCommand = defineCommand({
701
716
  }
702
717
  });
703
718
  var searchParametersCommand = defineCommand({
704
- meta: { name: "parameters", description: "Resolve human-readable terms to opaque filter IDs." },
719
+ meta: {
720
+ name: "parameters",
721
+ description: "Resolve human-readable terms to opaque filter IDs. Paginated: --cursor pages manually, --all streams every page as NDJSON."
722
+ },
705
723
  args: {
706
- ...NON_STREAM_FLAGS,
724
+ ...GLOBAL_FLAGS,
707
725
  type: {
708
726
  type: "string",
709
727
  description: "Parameter type: LOCATION, PEOPLE, CONNECTIONS, COMPANY, SCHOOL, INDUSTRY, SERVICE, JOB_FUNCTION, JOB_TITLE, EMPLOYMENT_TYPE, SKILL.",
@@ -23,40 +23,12 @@ import {
23
23
 
24
24
  // src/commands/setup.ts
25
25
  import { defineCommand } from "citty";
26
- import { createDecipheriv, createECDH, hkdfSync, randomBytes } from "crypto";
27
26
  import { chmod, mkdir, readFile, rm, writeFile } from "fs/promises";
28
27
  import { dirname, join } from "path";
29
28
  import { CurviateError } from "@curviate/sdk";
30
- var CODE_ALPHABET = "BCDFGHJKLMNPQRSTVWXZ";
31
- function normaliseCode(raw) {
32
- let out = "";
33
- const upper = raw.toUpperCase();
34
- for (const char of upper) if (CODE_ALPHABET.includes(char)) out += char;
35
- return out;
36
- }
37
- var APP_URL_ENV = "CURVIATE_APP_URL";
38
- function appRoot(baseUrl, override) {
39
- if (override !== void 0 && override !== "") {
40
- const explicit = new URL(override);
41
- return `${explicit.origin}${explicit.pathname.replace(/\/$/, "")}`;
42
- }
43
- const parsed = new URL(baseUrl);
44
- const labels = parsed.hostname.split(".");
45
- if (labels[0] === "api" && labels.length > 1) {
46
- labels[0] = "app";
47
- return `${parsed.protocol}//${labels.join(".")}${parsed.port ? `:${parsed.port}` : ""}`;
48
- }
49
- return `${parsed.origin}${parsed.pathname.replace(/\/?api\/?$/, "").replace(/\/$/, "")}`;
50
- }
51
- function authorizeUrl(baseUrl, sessionId, publicKey, appUrlOverride) {
52
- const url = new URL(`${appRoot(baseUrl, appUrlOverride)}/cli`);
53
- url.searchParams.set("sid", sessionId);
54
- url.searchParams.set("pk", publicKey);
55
- return url.toString();
56
- }
57
- function exchangeUrl(baseUrl) {
58
- return `${baseUrl.replace(/\/$/, "")}/api/auth/cli/exchange`;
59
- }
29
+
30
+ // src/lib/seal.ts
31
+ import { createDecipheriv, createECDH, hkdfSync, randomBytes } from "crypto";
60
32
  var SESSION_ID_BYTES = 18;
61
33
  var HKDF_INFO = "curviate-cli-setup-v1";
62
34
  var SEAL_ALG = "ECDH-P256-HKDF-SHA256-A256GCM";
@@ -88,6 +60,38 @@ function unsealApiKey(sealed, privateKey) {
88
60
  decipher.setAuthTag(tag);
89
61
  return Buffer.concat([decipher.update(body), decipher.final()]).toString("utf8");
90
62
  }
63
+
64
+ // src/commands/setup.ts
65
+ var CODE_ALPHABET = "BCDFGHJKLMNPQRSTVWXZ";
66
+ function normaliseCode(raw) {
67
+ let out = "";
68
+ const upper = raw.toUpperCase();
69
+ for (const char of upper) if (CODE_ALPHABET.includes(char)) out += char;
70
+ return out;
71
+ }
72
+ var APP_URL_ENV = "CURVIATE_APP_URL";
73
+ function appRoot(baseUrl, override) {
74
+ if (override !== void 0 && override !== "") {
75
+ const explicit = new URL(override);
76
+ return `${explicit.origin}${explicit.pathname.replace(/\/$/, "")}`;
77
+ }
78
+ const parsed = new URL(baseUrl);
79
+ const labels = parsed.hostname.split(".");
80
+ if (labels[0] === "api" && labels.length > 1) {
81
+ labels[0] = "app";
82
+ return `${parsed.protocol}//${labels.join(".")}${parsed.port ? `:${parsed.port}` : ""}`;
83
+ }
84
+ return `${parsed.origin}${parsed.pathname.replace(/\/?api\/?$/, "").replace(/\/$/, "")}`;
85
+ }
86
+ function authorizeUrl(baseUrl, sessionId, publicKey, appUrlOverride) {
87
+ const url = new URL(`${appRoot(baseUrl, appUrlOverride)}/cli`);
88
+ url.searchParams.set("sid", sessionId);
89
+ url.searchParams.set("pk", publicKey);
90
+ return url.toString();
91
+ }
92
+ function exchangeUrl(baseUrl) {
93
+ return `${baseUrl.replace(/\/$/, "")}/api/auth/cli/exchange`;
94
+ }
91
95
  function resumeStatePath() {
92
96
  return join(dirname(getConfigPath()), "setup-session.json");
93
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.36.0",
3
+ "version": "0.38.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "clean": "rm -rf dist *.tsbuildinfo"
47
47
  },
48
48
  "dependencies": {
49
- "@curviate/sdk": "0.34.0",
49
+ "@curviate/sdk": "0.36.0",
50
50
  "citty": "^0.1.6",
51
51
  "open": "^10.1.0"
52
52
  },