@curviate/cli 0.35.0 → 0.37.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,67 @@ 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.37.0] - 2026-09-19
12
+
13
+ Re-vendored from `@curviate/sdk` 0.35.0.
14
+
15
+ ### Changed
16
+
17
+ - **`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.
18
+ - **`account link --seat-id` is optional: omitted, the only free seat is
19
+ used.** A first run had no seat id and no way to hold one, so the command
20
+ refused at argument validation and the documented non-interactive path (exit
21
+ 12, then `curviate account checkpoint solve`) was unreachable. The command
22
+ now reads `curviate account seats` itself when `--seat-id` is omitted and
23
+ connects into the single seat listed free, stating which one on stderr. Zero
24
+ free seats and several free seats both refuse and connect nothing: zero names
25
+ how to free or add one, several lists every candidate and asks for
26
+ `--seat-id`. Passing `--seat-id` costs no seats read and behaves exactly as
27
+ before. `--seat-id` is still required with `--preview` (which calls nothing)
28
+ and with `--account-id` (a reconnect keeps the seat that account already
29
+ holds). No API change: the resolution uses the existing public seats read.
30
+ An EMPTY `--seat-id` stays a usage error rather than becoming an omission,
31
+ so `--seat-id "$SEAT"` with `SEAT` unset still exits `2` instead of binding
32
+ the free seat.
33
+
34
+ ### Fixed
35
+
36
+ - **Re-vendored `test/fixtures/openapi.json`, second refresh in this batch.**
37
+ Production now serves the Sales Navigator profile `description` relabel
38
+ (was "About/summary text. Present when populated.", now "Professional
39
+ headline. Present when populated. Reading it back through Curviate stores
40
+ it in your tenant's entity records, with no expiry."), which the previous
41
+ refresh below predated. One description string changed. No command, flag,
42
+ exit code or output shape changes; the `@curviate/sdk` pin stays exactly
43
+ `0.34.0`.
44
+ - **Re-vendored `test/fixtures/openapi.json` from the refreshed
45
+ `@curviate/sdk` snapshot.** The previous copy described company-page names,
46
+ company-page follower names and headlines, several Recruiter person fields
47
+ and the Recruiter `recruiting_profile` object as content that passes through
48
+ and is never stored. Reading those responses back does store them, in the
49
+ tenant's entity records, with no expiry, so eight response-field claims were
50
+ false and are now corrected, along with a Recruiter profile field that was
51
+ labelled the About section and is in fact the professional headline. 23
52
+ description strings in all. No command, flag, exit code or output shape
53
+ changes, and the `@curviate/sdk` pin stays exactly `0.34.0`: the snapshot is
54
+ a test fixture, not part of the published surface, and the sibling-SDK
55
+ description check only runs while the pin and the sibling version agree.
56
+
57
+ ## [0.36.0] - 2026-09-18
58
+
59
+ ### Fixed
60
+
61
+ - **Re-vendored `test/fixtures/openapi.json` from `@curviate/sdk@0.34.0`.**
62
+ The previous copy (vendored from `0.33.0`) still carried the superseded
63
+ ordinary-message subject retention wording ("Ordinary messages have none")
64
+ on three `Message.specifics.subject` sites, which production no longer
65
+ serves: a live round-trip showed an ordinary message sent with a subject
66
+ does carry one. `@curviate/sdk` dependency bumped to the exact `0.34.0`.
67
+ - `check-vendored-descriptions` was previously `SKIPPED` on this repo (the
68
+ sibling `../sdk` checkout sat at 0.34.0 while this package's pin was still
69
+ 0.33.0, so the guard's own version-match precondition never fired). It now
70
+ runs a real comparison and passes.
71
+
11
72
  ## [0.35.0] - 2026-09-18
12
73
 
13
74
  ### 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),
@@ -431,7 +431,7 @@ var main = defineCommand({
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),
@@ -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.35.0",
3
+ "version": "0.37.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.33.0",
49
+ "@curviate/sdk": "0.35.0",
50
50
  "citty": "^0.1.6",
51
51
  "open": "^10.1.0"
52
52
  },