@curviate/cli 0.45.0 → 0.46.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 (29) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/{account-FDPUPVFB.js → account-O5UX5UAH.js} +90 -36
  3. package/dist/{chunk-BLJGV6ST.js → chunk-2FECYCAC.js} +3 -3
  4. package/dist/{chunk-XZJQQJBE.js → chunk-76E3O6HY.js} +11 -0
  5. package/dist/{chunk-PCZH5QJA.js → chunk-DGIDAO2H.js} +1 -1
  6. package/dist/{chunk-B5NIX4G6.js → chunk-FXF5FF3W.js} +6 -0
  7. package/dist/{chunk-EGDDVF3Q.js → chunk-LCGXJGPB.js} +7 -11
  8. package/dist/{chunk-FD4AANAA.js → chunk-LD6WPZZM.js} +3 -3
  9. package/dist/cli.js +20 -20
  10. package/dist/{comment-G4EXIIAQ.js → comment-BKGVJYS2.js} +6 -6
  11. package/dist/{company-IOSYYCXY.js → company-F2AZTDPK.js} +6 -6
  12. package/dist/{connect-GHABKXB2.js → connect-TX6PT7NV.js} +10 -10
  13. package/dist/{doctor-ICAEETCL.js → doctor-USTZQ75D.js} +2 -2
  14. package/dist/{exit-codes-YSFFFWMS.js → exit-codes-TMAIV7EM.js} +1 -1
  15. package/dist/{feed-XC5235UF.js → feed-ANBPRGFQ.js} +5 -5
  16. package/dist/{group-JDP2HVSV.js → group-HFF7LDDQ.js} +4 -4
  17. package/dist/{inbox-W3KR65VD.js → inbox-XQMGW6RT.js} +4 -4
  18. package/dist/{inboxes-XYS3IRT6.js → inboxes-CILMIVVD.js} +4 -4
  19. package/dist/{job-OJB4VSI2.js → job-TOJDDJ2P.js} +5 -5
  20. package/dist/{message-VZHXBKTO.js → message-WCBNBPAJ.js} +4 -4
  21. package/dist/{notification-RIUSYJV6.js → notification-CJ3LEHFL.js} +4 -4
  22. package/dist/{post-ZQIYCN7A.js → post-OQWJRL4B.js} +13 -12
  23. package/dist/{profile-COLBPBGO.js → profile-GT6ZD37M.js} +10 -10
  24. package/dist/{recruiter-4KFVMKZQ.js → recruiter-ZKWG6QG3.js} +5 -5
  25. package/dist/{sales-nav-IOBEJ4OP.js → sales-nav-WV3YHYD6.js} +4 -4
  26. package/dist/{search-3MRQE6VC.js → search-VAZEQ2WJ.js} +14 -14
  27. package/dist/{setup-BPNLAHPC.js → setup-GGXMHXAF.js} +2 -2
  28. package/dist/{webhook-ND7XZ7FW.js → webhook-5M47UX6U.js} +9 -4
  29. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -6,6 +6,83 @@ 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 (before 1.0.0, a minor); a fix is a patch.
8
8
 
9
+ ## [Unreleased]
10
+
11
+ ## [0.46.1] - 2026-10-04
12
+
13
+ Requires `@curviate/sdk` 0.41.0.
14
+
15
+ ### Fixed
16
+
17
+ - **`account link --account-id` refuses an empty or blank value.** `--account-id ""`
18
+ (for instance `--account-id "$ACC"` with `ACC` unset) used to open a NEW connect,
19
+ and `--account-id " "` sent a reconnect with a blank id. Both now exit 2 before
20
+ any request, and the message says to pass an `acc_...` id or omit the flag.
21
+ - **A blank `<account_id>` positional is refused.** `account get|update|disconnect`
22
+ and `account checkpoint solve|poll|request` with an empty or whitespace-only id
23
+ used to send it to the server (`/v1/accounts/%20%20`, or `account_id: " "` in a
24
+ body). They now exit 2 before any request.
25
+ - **`webhook update --account-ids ""` is refused.** It was silently dropped, so the
26
+ update went through without the change. An empty or blank list now exits 2 before
27
+ any request, as `webhook create` already did.
28
+
29
+ ## [0.46.0] - 2026-10-03
30
+
31
+ Requires `@curviate/sdk` 0.41.0.
32
+
33
+ ### Breaking
34
+
35
+ - **`account link` requires a connection location on a new connect.** Pass
36
+ exactly one of `--country` (a two-letter ISO code, e.g. `--country US`, the
37
+ country the account's owner normally signs in from), `--ip` (a public IPv4)
38
+ or your own proxy (`--proxy-host`). Without one, or with two, the command
39
+ exits 2 with a guiding message before any request, seats read or prompt;
40
+ `--preview` renders nothing then. The API refuses such a connect anyway. A
41
+ reconnect (`--account-id`) may omit it to keep the account's location.
42
+ `--country` is case-insensitive and sent upper-case.
43
+ - **`account update --clear-proxy` requires `--country`.** Clearing your own
44
+ proxy now names the managed location to return to; alone it exits 2 before
45
+ the request.
46
+ - **`account update` prints the updated account** (the API now returns it),
47
+ with `connection_location` re-read after a location change.
48
+
49
+ ### Added
50
+
51
+ - **Pinned to `@curviate/sdk` 0.41.0**, which carries the connection-location
52
+ contract. `CONNECTION_LOCATION_REQUIRED` exits 2 (the same exit as the
53
+ command's own pre-request refusal) and `CONNECTION_LOCATION_UNAVAILABLE`
54
+ exits 8; before this release both arrived as `INTERNAL` and exited 1. On the
55
+ latter, the `--json` error envelope carries `connectionLocation` and human
56
+ mode prints "Connects from now: ..." when the API re-read where the account
57
+ connects from after a change.
58
+ - **`--allow-country-fallback`** on `account link` (with `--country` or
59
+ `--ip`, including a reconnect) and `account update`: allow a connection from
60
+ another country when none is free in the chosen one. Without it a location
61
+ is strict. On `update`, alone, it changes the strictness of the configured
62
+ country; `--no-allow-country-fallback` makes it strict.
63
+ - **`account update --country`** moves an account's connection location.
64
+ - **`account list` and `account get`** show each account's
65
+ `connection_location` (country, current country, mode, strict) by default.
66
+ - `--proxy-protocol` accepts `socks4`.
67
+
68
+ ### Changed
69
+
70
+ - **`search posts` and `company posts` slim output carries more.** Each item now
71
+ has `created_at` (the post's date as the API derives it, `null` when unknown),
72
+ `share_url`, and the full `text` (no more 200-character cut). `author.name`
73
+ reads the author's `display_name` when the API sends that shape, so it is no
74
+ longer `null` for most results.
75
+ - **Post id help names every accepted form.** Post-level commands and
76
+ `comment list` accept the `id` from `search posts`, URN forms
77
+ (`activity`, `ugcPost`, `share`) and post URLs with a `share-` slug, and their
78
+ help says so.
79
+ - **`search posts` help** warns that a result's text can repeat fragments
80
+ around links, mentions and hashtags, and points at `post get` for the clean
81
+ body.
82
+ - **`feed home` help** says every post carries its text and `created_at`, and
83
+ that on the default recent sort every engagement count is `null` (unknown,
84
+ not zero).
85
+
9
86
  ## [0.45.0] - 2026-10-01
10
87
 
11
88
  Requires `@curviate/sdk` 0.40.1.
@@ -6,7 +6,7 @@ import {
6
6
  slimAccountGet,
7
7
  slimAccountList,
8
8
  slimAccountListItem
9
- } from "./chunk-EGDDVF3Q.js";
9
+ } from "./chunk-LCGXJGPB.js";
10
10
  import {
11
11
  buildPreviewOutput
12
12
  } from "./chunk-TCUYH5GO.js";
@@ -25,10 +25,10 @@ import {
25
25
  resolveEffectiveConfig,
26
26
  streamAll,
27
27
  writeNdjsonItem
28
- } from "./chunk-B5NIX4G6.js";
28
+ } from "./chunk-FXF5FF3W.js";
29
29
  import {
30
30
  AUTH_NEEDED
31
- } from "./chunk-XZJQQJBE.js";
31
+ } from "./chunk-76E3O6HY.js";
32
32
  import {
33
33
  createClient
34
34
  } from "./chunk-UJOTQPL6.js";
@@ -199,7 +199,7 @@ function resolveOutputOpts(flags) {
199
199
  async function handleError(err, outOpts, out) {
200
200
  const { CurviateError } = await import("@curviate/sdk");
201
201
  if (err instanceof CurviateError) {
202
- const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
202
+ const { getExitCode } = await import("./exit-codes-TMAIV7EM.js");
203
203
  renderError(err, outOpts, out);
204
204
  process.exit(getExitCode(err));
205
205
  }
@@ -237,9 +237,19 @@ async function runAccountList(client, flags, out) {
237
237
  await handleError(err, outOpts, out);
238
238
  }
239
239
  }
240
+ function requireAccountId(flags, out) {
241
+ const id = flags["account-id"];
242
+ if (id === void 0 || id.trim() === "") {
243
+ out.stderr.write(
244
+ "error: account_id is required and was missing or blank. Pass an acc_... id (`curviate account list`; for a checkpoint, the provisional account_id from the 202 response).\n"
245
+ );
246
+ process.exit(2);
247
+ }
248
+ return id;
249
+ }
240
250
  async function runAccountGet(client, flags, out) {
241
251
  rejectAllOnNonPaginated(flags.all, out);
242
- const accountId = flags["account-id"] ?? "";
252
+ const accountId = requireAccountId(flags, out);
243
253
  const outOpts = resolveOutputOpts(flags);
244
254
  try {
245
255
  const result = await client.accounts.get(accountId);
@@ -286,6 +296,42 @@ ${body}`;
286
296
  }
287
297
  out.stdout.write(body + "\n");
288
298
  }
299
+ function assertLocationFlags(flags, out, opts) {
300
+ const fail = (message) => {
301
+ out.stderr.write(`error: ${message}
302
+ `);
303
+ process.exit(2);
304
+ };
305
+ const named = ["country", "ip", "proxy-host"].filter((k) => flags[k] !== void 0);
306
+ for (const k of named) if (flags[k].trim() === "") fail(`--${k} was given an empty value.`);
307
+ if (named.length > 1) {
308
+ fail(
309
+ `pass one location source, not ${named.map((k) => `--${k}`).join(" and ")}: ` + (named.includes("proxy-host") ? "your own proxy decides the location by itself." : "--ip overrides --country.")
310
+ );
311
+ }
312
+ if (named.length === 0 && opts.requireOne) {
313
+ fail(
314
+ "choose where LinkedIn sees this account connecting from. Pass --country with the two-letter code of the country its owner normally signs in from (e.g. --country US), --ip with a public IPv4 address, or your own proxy with --proxy-host. Nothing was sent."
315
+ );
316
+ }
317
+ if (flags.country !== void 0 && !/^[a-z]{2}$/i.test(flags.country.trim())) {
318
+ fail("--country takes a two-letter ISO 3166-1 country code, e.g. US or DE.");
319
+ }
320
+ if (flags["allow-country-fallback"] !== void 0) {
321
+ if (flags["proxy-host"] !== void 0) {
322
+ fail("--allow-country-fallback applies to a managed location (--country or --ip), not to your own proxy; remove one.");
323
+ }
324
+ if (!opts.fallbackAlone && flags.country === void 0 && flags.ip === void 0) {
325
+ fail("--allow-country-fallback applies to --country or --ip; pass one of them with it.");
326
+ }
327
+ }
328
+ }
329
+ function managedLocationBody(flags) {
330
+ return {
331
+ ...flags.country !== void 0 ? { country: flags.country.trim().toUpperCase() } : {},
332
+ ...flags["allow-country-fallback"] !== void 0 ? { allow_country_fallback: flags["allow-country-fallback"] } : {}
333
+ };
334
+ }
289
335
  async function buildAuthBody(flags, ctx) {
290
336
  const body = {};
291
337
  if (flags["auth-method"]) body["auth_method"] = flags["auth-method"];
@@ -372,8 +418,8 @@ async function buildAuthBody(flags, ctx) {
372
418
  };
373
419
  }
374
420
  }
375
- if (flags.country) body["country"] = flags.country;
376
- if (flags.ip) body["ip"] = flags.ip;
421
+ Object.assign(body, managedLocationBody(flags));
422
+ if (flags.ip !== void 0) body["ip"] = flags.ip.trim();
377
423
  if (flags["proxy-host"]) {
378
424
  const proxyPassword = await resolveSecret({
379
425
  flagValue: flags["proxy-password"],
@@ -583,6 +629,12 @@ async function runAccountLink(client, flags, out, io = {}) {
583
629
  out.stderr.write("error: --auth-method is required for account link (credentials | cookie).\n");
584
630
  process.exit(2);
585
631
  }
632
+ if (flags["account-id"] !== void 0 && flags["account-id"].trim() === "") {
633
+ out.stderr.write(
634
+ "error: --account-id was given an empty value. Pass the acc_... id of the account to reconnect (`curviate account list`), or omit the flag entirely to connect a new account.\n"
635
+ );
636
+ process.exit(2);
637
+ }
586
638
  checkCredentialConflicts(flags, out);
587
639
  if (!flags.preview && flags["auth-method"] === "cookie" && !flags["user-agent"]) {
588
640
  out.stderr.write(
@@ -590,6 +642,7 @@ async function runAccountLink(client, flags, out, io = {}) {
590
642
  );
591
643
  process.exit(2);
592
644
  }
645
+ assertLocationFlags(flags, out, { requireOne: !flags["account-id"], fallbackAlone: false });
593
646
  const outOpts = resolveOutputOpts(flags);
594
647
  if (flags["seat-id"] !== void 0 && flags["seat-id"].trim() === "") {
595
648
  out.stderr.write(
@@ -734,7 +787,7 @@ async function runAccountConnectSessionPoll(client, flags, out, io = {}) {
734
787
  if (outcome.kind === "terminal_failure") {
735
788
  renderSuccess(outcome.result, outOpts, out);
736
789
  out.stderr.write(
737
- `This connect session has ${outcome.status}. Start a new connect: curviate account link.
790
+ `This connect session has ${outcome.status}. Start a new connect: curviate account link --auth-method <m> --country <CC>.
738
791
  `
739
792
  );
740
793
  process.exit(9);
@@ -748,7 +801,7 @@ async function runAccountConnectSessionPoll(client, flags, out, io = {}) {
748
801
  process.exit(AUTH_NEEDED);
749
802
  }
750
803
  async function runAccountUpdate(client, flags, out) {
751
- const accountId = flags["account-id"] ?? "";
804
+ const accountId = requireAccountId(flags, out);
752
805
  const body = {};
753
806
  if (flags.metadata !== void 0) {
754
807
  let parsed;
@@ -771,8 +824,16 @@ async function runAccountUpdate(client, flags, out) {
771
824
  out.stderr.write("error: --clear-proxy cannot be combined with --proxy-host (choose one).\n");
772
825
  process.exit(2);
773
826
  }
827
+ if (flags.country === void 0) {
828
+ out.stderr.write(
829
+ "error: --clear-proxy needs --country: name the country this account should connect from instead (e.g. --clear-proxy --country US).\n"
830
+ );
831
+ process.exit(2);
832
+ }
774
833
  body["proxy"] = null;
775
834
  }
835
+ assertLocationFlags(flags, out, { requireOne: false, fallbackAlone: true });
836
+ Object.assign(body, managedLocationBody(flags));
776
837
  if (flags["proxy-host"]) {
777
838
  const proxyPassword = await resolveSecret({
778
839
  flagValue: flags["proxy-password"],
@@ -805,7 +866,7 @@ async function runAccountUpdate(client, flags, out) {
805
866
  }
806
867
  }
807
868
  async function runAccountDisconnect(client, flags, out) {
808
- const accountId = flags["account-id"] ?? "";
869
+ const accountId = requireAccountId(flags, out);
809
870
  const outOpts = resolveOutputOpts(flags);
810
871
  if (flags.preview) {
811
872
  const preview = buildPreviewOutput({
@@ -824,15 +885,11 @@ async function runAccountDisconnect(client, flags, out) {
824
885
  }
825
886
  }
826
887
  async function runAccountCheckpointSolve(client, flags, out) {
827
- if (!flags["account-id"]) {
828
- out.stderr.write("error: account_id is required (the provisional account_id from the 202 response).\n");
829
- process.exit(2);
830
- }
831
888
  if (!flags.code) {
832
889
  out.stderr.write("error: --code is required (the OTP / 2FA code).\n");
833
890
  process.exit(2);
834
891
  }
835
- const accountId = flags["account-id"] ?? "";
892
+ const accountId = requireAccountId(flags, out);
836
893
  const body = { code: flags.code };
837
894
  const outOpts = resolveOutputOpts(flags);
838
895
  if (flags.preview) {
@@ -860,11 +917,7 @@ async function runAccountCheckpointSolve(client, flags, out) {
860
917
  }
861
918
  }
862
919
  async function runAccountCheckpointRequest(client, flags, out) {
863
- if (!flags["account-id"]) {
864
- out.stderr.write("error: account_id is required (the provisional account_id from the 202 response).\n");
865
- process.exit(2);
866
- }
867
- const accountId = flags["account-id"] ?? "";
920
+ const accountId = requireAccountId(flags, out);
868
921
  const outOpts = resolveOutputOpts(flags);
869
922
  const body = flags.challenge !== void 0 ? { challenge: flags.challenge } : void 0;
870
923
  if (flags.preview) {
@@ -918,11 +971,7 @@ async function runCheckpointPollWaitLoop(client, accountId, ctx) {
918
971
  }
919
972
  }
920
973
  async function runAccountCheckpointPoll(client, flags, out, io = {}) {
921
- if (!flags["account-id"]) {
922
- out.stderr.write("error: account_id is required (the provisional account_id from the 202 response).\n");
923
- process.exit(2);
924
- }
925
- const accountId = flags["account-id"] ?? "";
974
+ const accountId = requireAccountId(flags, out);
926
975
  const outOpts = resolveOutputOpts(flags);
927
976
  if (flags.preview) {
928
977
  const preview = buildPreviewOutput({
@@ -974,7 +1023,7 @@ async function runAccountCheckpointPoll(client, flags, out, io = {}) {
974
1023
  }
975
1024
  if (outcome.kind === "terminal_failure") {
976
1025
  renderSuccess(outcome.result, outOpts, out);
977
- out.stderr.write(`This checkpoint has ${outcome.status}. Start over: curviate account link or curviate account reconnect.
1026
+ out.stderr.write(`This checkpoint has ${outcome.status}. Start over: curviate account link --auth-method <m> --country <CC>, or add --account-id <acc_...> to reconnect an existing account.
978
1027
  `);
979
1028
  process.exit(9);
980
1029
  return;
@@ -1078,10 +1127,11 @@ var accountLinkCommand = defineCommand({
1078
1127
  name: "link",
1079
1128
  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`.",
1080
1129
  examples: [
1081
- "curviate account link --auth-method credentials --email jane@example.com --password-stdin",
1130
+ "curviate account link --auth-method credentials --email jane@example.com --password-stdin --country US",
1082
1131
  "curviate account link --auth-method credentials --email jane@example.com --password-stdin --account-id acc_YOUR_ACCOUNT_ID --seat-id SEAT_ID"
1083
1132
  ],
1084
1133
  requires: [
1134
+ "Exactly one of --country, --ip or --proxy-host on a new connect; a reconnect (--account-id) may omit it to keep the account's location.",
1085
1135
  "--user-agent with --auth-method cookie.",
1086
1136
  "--seat-id with --preview or --account-id, and when zero or several seats are free.",
1087
1137
  "--password-stdin only with --auth-method credentials; --li-at-stdin only with --auth-method cookie."
@@ -1097,10 +1147,11 @@ var accountLinkCommand = defineCommand({
1097
1147
  "li-at": { type: "string", description: `LinkedIn session cookie li_at (cookie method). ${PW_WARNING("--li-at-stdin", "CURVIATE_LINKEDIN_LI_AT")}` },
1098
1148
  "li-at-stdin": { type: "boolean", description: "Read the li_at session cookie from stdin (one line, trimmed).", default: false },
1099
1149
  "li-a": { type: "string", description: `Optional premium session cookie li_a (cookie method). ${OPTIONAL_SECRET_WARNING("CURVIATE_LINKEDIN_LI_A")}` },
1100
- country: { type: "string", description: "Proxy location hint (ISO 3166-1 alpha-2)." },
1101
- ip: { type: "string", description: "IP to infer the managed proxy location." },
1102
- "proxy-protocol": { type: "string", description: "Proxy protocol: http | https | socks5." },
1103
- "proxy-host": { type: "string", description: "Proxy host or IP." },
1150
+ country: { type: "string", description: "Where LinkedIn sees this account connecting from: a two-letter ISO 3166-1 country code (e.g. US, DE; case-insensitive), the country its owner normally signs in from. A new connect needs exactly one of --country, --ip or --proxy-host. Strict: the connect fails rather than use another country, unless --allow-country-fallback." },
1151
+ ip: { type: "string", description: "A public IPv4 address whose country becomes the connection location (strict, like --country). An alternative to --country." },
1152
+ "allow-country-fallback": { type: "boolean", description: "With --country or --ip: allow a connection from another country when none is free in the chosen one. Without it the connect is strict and fails instead." },
1153
+ "proxy-protocol": { type: "string", description: "Proxy protocol: http | https | socks5 | socks4." },
1154
+ "proxy-host": { type: "string", description: "Your own proxy's host or IP. Your proxy decides where LinkedIn sees the account connecting from, so --country, --ip and --allow-country-fallback are not accepted with it." },
1104
1155
  "proxy-port": { type: "string", description: "Proxy port." },
1105
1156
  "proxy-username": { type: "string", description: "Proxy auth username." },
1106
1157
  "proxy-password": { type: "string", description: `Proxy auth password. ${OPTIONAL_SECRET_WARNING("CURVIATE_PROXY_PASSWORD")}` },
@@ -1192,19 +1243,22 @@ var accountConnectSessionCommand = defineCommand({
1192
1243
  var accountUpdateCommand = defineCommand({
1193
1244
  meta: {
1194
1245
  name: "update",
1195
- description: "Update an account's metadata and/or custom-proxy configuration.",
1246
+ description: "Update an account's metadata, connection location or own proxy. Prints the updated account, with connection_location re-read after a location change.",
1196
1247
  examples: [
1197
1248
  `curviate account update acc_YOUR_ACCOUNT_ID --metadata '{"team":"growth"}'`,
1198
- "curviate account update acc_YOUR_ACCOUNT_ID --clear-proxy"
1249
+ "curviate account update acc_YOUR_ACCOUNT_ID --country DE",
1250
+ "curviate account update acc_YOUR_ACCOUNT_ID --clear-proxy --country DE"
1199
1251
  ]
1200
1252
  },
1201
1253
  args: {
1202
1254
  ...WRITE_SINGLE_FLAGS,
1203
1255
  "account-id": { type: "positional", description: "Account id (acc_...)." },
1204
1256
  metadata: { type: "string", description: `Custom metadata as a JSON object (flat string->string map). Replaces the store wholesale. Example: '{"team":"growth"}'.` },
1205
- "clear-proxy": { type: "boolean", description: "Clear the custom proxy (revert to automatic proxy protection). Mutually exclusive with --proxy-host.", default: false },
1206
- "proxy-protocol": { type: "string", description: "Proxy protocol: http | https | socks5." },
1207
- "proxy-host": { type: "string", description: "Proxy host or IP." },
1257
+ country: { type: "string", description: "Move this account's connection location to this two-letter ISO 3166-1 country code (e.g. US, DE). LinkedIn sees a new IP there and may ask the owner to verify, so change it only when the current location is wrong. Strict unless --allow-country-fallback. On an account using your own proxy, pass --clear-proxy with it." },
1258
+ "allow-country-fallback": { type: "boolean", description: "Allow a connection from another country when none is free in the chosen one. Alone, it changes the strictness of the configured country; --no-allow-country-fallback makes it strict." },
1259
+ "clear-proxy": { type: "boolean", description: "Stop using your own proxy and return to a managed location. Requires --country. Mutually exclusive with --proxy-host.", default: false },
1260
+ "proxy-protocol": { type: "string", description: "Proxy protocol: http | https | socks5 | socks4." },
1261
+ "proxy-host": { type: "string", description: "Your own proxy's host or IP. Not accepted with --country." },
1208
1262
  "proxy-port": { type: "string", description: "Proxy port." },
1209
1263
  "proxy-username": { type: "string", description: "Proxy auth username." },
1210
1264
  "proxy-password": { type: "string", description: `Proxy auth password. ${OPTIONAL_SECRET_WARNING("CURVIATE_PROXY_PASSWORD")}` }
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readablePage
4
- } from "./chunk-B5NIX4G6.js";
4
+ } from "./chunk-FXF5FF3W.js";
5
5
  import {
6
6
  getExitCode
7
- } from "./chunk-XZJQQJBE.js";
7
+ } from "./chunk-76E3O6HY.js";
8
8
  import {
9
9
  assertNoStdinPlaceholder
10
10
  } from "./chunk-TC4ZPUWI.js";
@@ -141,7 +141,7 @@ async function soleConnectedAccount(client, flags, out) {
141
141
  const { accounts } = listed;
142
142
  if (accounts.length === 0) {
143
143
  out.stderr.write(
144
- "error: no LinkedIn account is connected to this workspace yet. Connect one with `curviate account link`, then retry.\n"
144
+ "error: no LinkedIn account is connected to this workspace yet. Connect one with `curviate account link --auth-method <m> --country <CC>`, then retry.\n"
145
145
  );
146
146
  process.exit(2);
147
147
  }
@@ -16,6 +16,10 @@ var EXIT_CODE_MAP = {
16
16
  // it is user_fixable, and it is never retryable AS SENT. Re-send with a
17
17
  // chosen id, which is the exit-2 contract exactly.
18
18
  FILTER_CANDIDATES_REQUIRED: 2,
19
+ // 2: a connect named no location (or a PATCH cleared your own proxy without
20
+ // a country). `account link` refuses this itself before any request with the
21
+ // same exit, so the API's 400 and the CLI's own guard read alike.
22
+ CONNECTION_LOCATION_REQUIRED: 2,
19
23
  // Not found (4)
20
24
  RESOURCE_NOT_FOUND: 4,
21
25
  ACCOUNT_NOT_FOUND: 4,
@@ -44,6 +48,13 @@ var EXIT_CODE_MAP = {
44
48
  LINKEDIN_OPERATION_NOT_SUPPORTED: 8,
45
49
  CONNECTION_REQUEST_CONFLICT: 8,
46
50
  REAUTH_REQUIRED: 8,
51
+ // Connection location. `CONNECTION_LOCATION_UNAVAILABLE` -> 8: a 422 saying
52
+ // no connection is free in that country right now, or a change landed
53
+ // elsewhere (the envelope then carries `connectionLocation`, where the
54
+ // account connects from now). The request was well formed; the connection
55
+ // cannot land there, which is account/connection state. user_fixable, not
56
+ // retryable as sent: pick a nearby country or allow fallback.
57
+ CONNECTION_LOCATION_UNAVAILABLE: 8,
47
58
  // Checkpoint flow (9)
48
59
  CHECKPOINT_NOT_FOUND: 9,
49
60
  CHECKPOINT_EXPIRED: 9,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UEAX6KUB.js";
5
5
  import {
6
6
  readableId
7
- } from "./chunk-B5NIX4G6.js";
7
+ } from "./chunk-FXF5FF3W.js";
8
8
 
9
9
  // src/lib/member-id.ts
10
10
  var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
@@ -222,6 +222,12 @@ ${safety.safetyHint.message}`;
222
222
  Paused budget row: ${safety.budgetRow}${wait} (other rows on this account still work)`;
223
223
  }
224
224
  }
225
+ const loc = errJson.connectionLocation;
226
+ if (loc) {
227
+ const mode = loc.mode === "custom" ? "your own proxy" : loc.mode === "auto" ? "managed" : "mode unknown";
228
+ msg += `
229
+ Connects from now: ${loc.current_country ?? loc.country ?? "unknown"} (${mode}${loc.strict ? ", strict" : ""})`;
230
+ }
225
231
  if (errJson.retryAfterMs) {
226
232
  msg += `
227
233
  Retry after: ${errJson.retryAfterMs}ms`;
@@ -218,19 +218,13 @@ function slimSearchJobs(data) {
218
218
  }
219
219
  function slimSearchPostsItem(item) {
220
220
  const rawAuthor = item["author"] !== null && item["author"] !== void 0 && typeof item["author"] === "object" ? item["author"] : null;
221
- const author = rawAuthor !== null ? { name: rawAuthor["name"] ?? null } : null;
222
- const rawText = item["text"];
223
- let text;
224
- if (rawText === null || rawText === void 0) {
225
- text = null;
226
- } else {
227
- const s = String(rawText);
228
- text = s.length > 200 ? s.slice(0, 200) : s;
229
- }
221
+ const author = rawAuthor !== null ? { name: rawAuthor["name"] ?? rawAuthor["display_name"] ?? null } : null;
230
222
  return {
231
223
  id: item["id"] ?? null,
232
224
  author,
233
- text,
225
+ created_at: item["created_at"] ?? null,
226
+ share_url: item["share_url"] ?? null,
227
+ text: item["text"] ?? null,
234
228
  reaction_count: item["reaction_count"] ?? null,
235
229
  comment_count: item["comment_count"] ?? null
236
230
  };
@@ -249,7 +243,8 @@ function slimAccountListItem(item) {
249
243
  headline: item["headline"] ?? null,
250
244
  seat_id: item["seat_id"] ?? null,
251
245
  connected_at: item["connected_at"] ?? null,
252
- external_id: item["external_id"] ?? null
246
+ external_id: item["external_id"] ?? null,
247
+ connection_location: item["connection_location"] ?? null
253
248
  };
254
249
  }
255
250
  function slimAccountList(data) {
@@ -268,6 +263,7 @@ function slimAccountGet(data) {
268
263
  seat_id: d["seat_id"] ?? null,
269
264
  connected_at: d["connected_at"] ?? null,
270
265
  external_id: d["external_id"] ?? null,
266
+ connection_location: d["connection_location"] ?? null,
271
267
  last_checked_at: d["last_checked_at"] ?? null,
272
268
  quotas: d["quotas"] ?? [],
273
269
  account_states: d["account_states"] ?? []
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-UEAX6KUB.js";
19
19
  import {
20
20
  requireAccount
21
- } from "./chunk-BLJGV6ST.js";
21
+ } from "./chunk-2FECYCAC.js";
22
22
  import {
23
23
  buildPreviewOutput
24
24
  } from "./chunk-TCUYH5GO.js";
@@ -29,7 +29,7 @@ import {
29
29
  renderSuccess,
30
30
  renderUnexpectedError,
31
31
  resolveEffectiveConfig
32
- } from "./chunk-B5NIX4G6.js";
32
+ } from "./chunk-FXF5FF3W.js";
33
33
  import {
34
34
  createClient,
35
35
  downloadBinary
@@ -105,7 +105,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
105
105
  async function handleSdkError(err, outOpts, out) {
106
106
  const { CurviateError } = await import("@curviate/sdk");
107
107
  if (err instanceof CurviateError) {
108
- const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
108
+ const { getExitCode } = await import("./exit-codes-TMAIV7EM.js");
109
109
  renderError(err, outOpts, out);
110
110
  process.exit(getExitCode(err));
111
111
  }
package/dist/cli.js CHANGED
@@ -27,30 +27,30 @@ var main = defineCommand({
27
27
  // Subcommand registry, names and descriptions are static for help rendering;
28
28
  // the handler implementation is loaded lazily on first invocation.
29
29
  subCommands: {
30
- setup: () => import("./setup-BPNLAHPC.js").then((m) => m.setupCommand),
31
- doctor: () => import("./doctor-ICAEETCL.js").then((m) => m.doctorCommand),
30
+ setup: () => import("./setup-GGXMHXAF.js").then((m) => m.setupCommand),
31
+ doctor: () => import("./doctor-USTZQ75D.js").then((m) => m.doctorCommand),
32
32
  login: () => import("./login-OHAHNBRW.js").then((m) => m.loginCommand),
33
33
  config: () => import("./config-K4G3VSBA.js").then((m) => m.configCommand),
34
34
  // ---------------------------------------------------------------------------
35
35
  // Noun groups, lazy-loaded on first invocation.
36
36
  // ---------------------------------------------------------------------------
37
- profile: () => import("./profile-COLBPBGO.js").then((m) => m.profileCommand),
38
- company: () => import("./company-IOSYYCXY.js").then((m) => m.companyCommand),
39
- job: () => import("./job-OJB4VSI2.js").then((m) => m.jobCommand),
40
- connect: () => import("./connect-GHABKXB2.js").then((m) => m.connectCommand),
41
- search: () => import("./search-3MRQE6VC.js").then((m) => m.searchCommand),
42
- inbox: () => import("./inbox-W3KR65VD.js").then((m) => m.inboxCommand),
43
- inboxes: () => import("./inboxes-XYS3IRT6.js").then((m) => m.inboxesCommand),
44
- message: () => import("./message-VZHXBKTO.js").then((m) => m.messageCommand),
45
- post: () => import("./post-ZQIYCN7A.js").then((m) => m.postCommand),
46
- comment: () => import("./comment-G4EXIIAQ.js").then((m) => m.commentCommand),
47
- account: () => import("./account-FDPUPVFB.js").then((m) => m.accountCommand),
48
- webhook: () => import("./webhook-ND7XZ7FW.js").then((m) => m.webhookCommand),
49
- "sales-nav": () => import("./sales-nav-IOBEJ4OP.js").then((m) => m.salesNavCommand),
50
- recruiter: () => import("./recruiter-4KFVMKZQ.js").then((m) => m.recruiterCommand),
51
- group: () => import("./group-JDP2HVSV.js").then((m) => m.groupCommand),
52
- feed: () => import("./feed-XC5235UF.js").then((m) => m.feedCommand),
53
- notification: () => import("./notification-RIUSYJV6.js").then((m) => m.notificationCommand)
37
+ profile: () => import("./profile-GT6ZD37M.js").then((m) => m.profileCommand),
38
+ company: () => import("./company-F2AZTDPK.js").then((m) => m.companyCommand),
39
+ job: () => import("./job-TOJDDJ2P.js").then((m) => m.jobCommand),
40
+ connect: () => import("./connect-TX6PT7NV.js").then((m) => m.connectCommand),
41
+ search: () => import("./search-VAZEQ2WJ.js").then((m) => m.searchCommand),
42
+ inbox: () => import("./inbox-XQMGW6RT.js").then((m) => m.inboxCommand),
43
+ inboxes: () => import("./inboxes-CILMIVVD.js").then((m) => m.inboxesCommand),
44
+ message: () => import("./message-WCBNBPAJ.js").then((m) => m.messageCommand),
45
+ post: () => import("./post-OQWJRL4B.js").then((m) => m.postCommand),
46
+ comment: () => import("./comment-BKGVJYS2.js").then((m) => m.commentCommand),
47
+ account: () => import("./account-O5UX5UAH.js").then((m) => m.accountCommand),
48
+ webhook: () => import("./webhook-5M47UX6U.js").then((m) => m.webhookCommand),
49
+ "sales-nav": () => import("./sales-nav-WV3YHYD6.js").then((m) => m.salesNavCommand),
50
+ recruiter: () => import("./recruiter-ZKWG6QG3.js").then((m) => m.recruiterCommand),
51
+ group: () => import("./group-HFF7LDDQ.js").then((m) => m.groupCommand),
52
+ feed: () => import("./feed-ANBPRGFQ.js").then((m) => m.feedCommand),
53
+ notification: () => import("./notification-CJ3LEHFL.js").then((m) => m.notificationCommand)
54
54
  },
55
55
  async run() {
56
56
  const { runMain } = await import("citty");
@@ -447,7 +447,7 @@ async function dispatch(root, rawArgs) {
447
447
  }
448
448
  const { CurviateError } = await import("@curviate/sdk");
449
449
  if (err instanceof CurviateError) {
450
- const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
450
+ const { getExitCode } = await import("./exit-codes-TMAIV7EM.js");
451
451
  process.exit(getExitCode(err));
452
452
  }
453
453
  process.exit(code === "EARG" ? 2 : 1);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-PCZH5QJA.js";
4
+ } from "./chunk-DGIDAO2H.js";
5
5
  import {
6
6
  AttachError,
7
7
  describeAttachment,
@@ -11,7 +11,7 @@ import {
11
11
  import "./chunk-UEAX6KUB.js";
12
12
  import {
13
13
  requireAccount
14
- } from "./chunk-BLJGV6ST.js";
14
+ } from "./chunk-2FECYCAC.js";
15
15
  import {
16
16
  buildPreviewOutput
17
17
  } from "./chunk-TCUYH5GO.js";
@@ -27,8 +27,8 @@ import {
27
27
  resolveEffectiveConfig,
28
28
  streamAll,
29
29
  writeNdjsonItem
30
- } from "./chunk-B5NIX4G6.js";
31
- import "./chunk-XZJQQJBE.js";
30
+ } from "./chunk-FXF5FF3W.js";
31
+ import "./chunk-76E3O6HY.js";
32
32
  import {
33
33
  createClient
34
34
  } from "./chunk-UJOTQPL6.js";
@@ -66,7 +66,7 @@ function buildListQuery(flags, out) {
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-YSFFFWMS.js");
69
+ const { getExitCode } = await import("./exit-codes-TMAIV7EM.js");
70
70
  renderError(err, outOpts, out);
71
71
  process.exit(getExitCode(err));
72
72
  }
@@ -415,7 +415,7 @@ var commentListCommand = defineCommand({
415
415
  },
416
416
  args: {
417
417
  ...readOnly(GLOBAL_FLAGS),
418
- postId: { type: "positional", description: "Post id (or share URN) to list comments for." }
418
+ postId: { type: "positional", description: "Post to list comments for: the `id` from search posts or a post read, a bare numeric activity id, a urn:li:activity|ugcPost|share:N URN, or a full LinkedIn post URL." }
419
419
  },
420
420
  async run({ args }) {
421
421
  await withClient(args, runCommentList);
@@ -7,10 +7,10 @@ import {
7
7
  slimSearchJobs,
8
8
  slimSearchPeople,
9
9
  slimSearchPosts
10
- } from "./chunk-EGDDVF3Q.js";
10
+ } from "./chunk-LCGXJGPB.js";
11
11
  import {
12
12
  sentAsNotice
13
- } from "./chunk-FD4AANAA.js";
13
+ } from "./chunk-LD6WPZZM.js";
14
14
  import "./chunk-UWO2D4HW.js";
15
15
  import "./chunk-HOQ7EUHJ.js";
16
16
  import {
@@ -23,7 +23,7 @@ import {
23
23
  } from "./chunk-UEAX6KUB.js";
24
24
  import {
25
25
  requireAccount
26
- } from "./chunk-BLJGV6ST.js";
26
+ } from "./chunk-2FECYCAC.js";
27
27
  import {
28
28
  buildPreviewOutput
29
29
  } from "./chunk-TCUYH5GO.js";
@@ -41,8 +41,8 @@ import {
41
41
  resolveEffectiveConfig,
42
42
  streamAll,
43
43
  writeNdjsonItem
44
- } from "./chunk-B5NIX4G6.js";
45
- import "./chunk-XZJQQJBE.js";
44
+ } from "./chunk-FXF5FF3W.js";
45
+ import "./chunk-76E3O6HY.js";
46
46
  import {
47
47
  createClient
48
48
  } from "./chunk-UJOTQPL6.js";
@@ -86,7 +86,7 @@ async function resolveCompanyId(ns, raw) {
86
86
  async function handleSdkError(err, outOpts, out) {
87
87
  const { CurviateError } = await import("@curviate/sdk");
88
88
  if (err instanceof CurviateError) {
89
- const { getExitCode } = await import("./exit-codes-YSFFFWMS.js");
89
+ const { getExitCode } = await import("./exit-codes-TMAIV7EM.js");
90
90
  renderError(err, outOpts, out);
91
91
  process.exit(getExitCode(err));
92
92
  }