@curviate/cli 0.49.0 → 0.50.0-next.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 (70) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +12 -5
  3. package/dist/{account-2BH2Q6VG.js → account-U7UJIE3H.js} +784 -116
  4. package/dist/analytics-MZU2WKON.js +27 -0
  5. package/dist/beta-consent-67IDUV3K.js +81 -0
  6. package/dist/billing-QAW75YE7.js +124 -0
  7. package/dist/{chunk-RXWODUWA.js → chunk-2W4RN5ON.js} +18 -2
  8. package/dist/{chunk-MGB6FE4A.js → chunk-3Z6PXS6N.js} +6 -6
  9. package/dist/chunk-5S3MJVI5.js +22 -0
  10. package/dist/{chunk-V7FJWTZW.js → chunk-6LBOGIVE.js} +4 -4
  11. package/dist/{chunk-Z7OQSWBD.js → chunk-6PLDAEMO.js} +85 -10
  12. package/dist/chunk-73DJ3KNE.js +54 -0
  13. package/dist/{chunk-3RCW7URJ.js → chunk-A57ZILRU.js} +1 -1
  14. package/dist/chunk-AVI7J47S.js +52 -0
  15. package/dist/{chunk-JYKYD57J.js → chunk-CKVCBGQX.js} +1 -1
  16. package/dist/chunk-EIA66ESN.js +339 -0
  17. package/dist/{chunk-YLSJ4HKU.js → chunk-ENBIMEKS.js} +26 -1
  18. package/dist/{chunk-LCGXJGPB.js → chunk-GHMRPX5H.js} +7 -1
  19. package/dist/chunk-GOICALYQ.js +28 -0
  20. package/dist/{chunk-PQWDDSV7.js → chunk-L7JH3W56.js} +1 -1
  21. package/dist/chunk-LCPPXOPN.js +528 -0
  22. package/dist/chunk-LRMPS4UQ.js +144 -0
  23. package/dist/{chunk-5ZGTU4VD.js → chunk-LULN3II2.js} +78 -5
  24. package/dist/chunk-PPGKQJKU.js +38 -0
  25. package/dist/chunk-Q3ZPRFUX.js +20 -0
  26. package/dist/{chunk-SA2QHAXG.js → chunk-QM57YDJE.js} +13 -201
  27. package/dist/{chunk-Y7MZZRYR.js → chunk-RYWWSZUH.js} +14 -2
  28. package/dist/{chunk-TEAWYLPO.js → chunk-TYNVJDYK.js} +49 -18
  29. package/dist/cli.js +34 -18
  30. package/dist/{comment-MRDPDA33.js → comment-6NRZILAS.js} +90 -11
  31. package/dist/{company-2AEHSGHA.js → company-VXE7IEPT.js} +65 -15
  32. package/dist/{config-NRBKHXES.js → config-3WP7OD35.js} +53 -4
  33. package/dist/{connect-4XEBV5V3.js → connect-FBK6UWZP.js} +63 -18
  34. package/dist/contact-HFPZ3KGL.js +32 -0
  35. package/dist/contact-groups-AI4MLGQS.js +399 -0
  36. package/dist/contact-import-54Y7EMU2.js +336 -0
  37. package/dist/core-RLMWMQEI.js +46 -0
  38. package/dist/do-not-contact-LQ5V6SPE.js +200 -0
  39. package/dist/{doctor-BZ4DA7DV.js → doctor-KKRL7TEF.js} +65 -11
  40. package/dist/{document-RKHRWXNT.js → document-GFRWPQFV.js} +1 -1
  41. package/dist/{draft-C5N6EOO5.js → draft-VSWZOCDR.js} +60 -14
  42. package/dist/{enrollment-BNQOUKI7.js → enrollment-OACCSBM5.js} +31 -19
  43. package/dist/{examples-NIMSIXMV.js → examples-JJB4DZKK.js} +2 -2
  44. package/dist/{exit-codes-TLMKTLRI.js → exit-codes-7DBETBDT.js} +1 -1
  45. package/dist/export-AQHAFVAB.js +96 -0
  46. package/dist/{feed-DFUU7SUJ.js → feed-HY4HT75U.js} +13 -10
  47. package/dist/{group-CSD2OWOZ.js → group-A3SMBFU5.js} +18 -10
  48. package/dist/{inbox-SNSPWI7J.js → inbox-YHUO2RPI.js} +31 -12
  49. package/dist/{inboxes-RIRHPS4H.js → inboxes-GKLMHPDR.js} +14 -10
  50. package/dist/incoming-NHROOOIZ.js +218 -0
  51. package/dist/{job-6PNXXZNF.js → job-QBW3PGWL.js} +65 -13
  52. package/dist/{login-Y7JBAHCW.js → login-GWIYHKYO.js} +13 -4
  53. package/dist/{message-2IK4MBBG.js → message-BFLN2VHS.js} +9 -7
  54. package/dist/{motion-7ATUXO6R.js → motion-LTWU2GPC.js} +39 -117
  55. package/dist/network-CNSBX2SR.js +235 -0
  56. package/dist/{notification-VYK5NDEB.js → notification-DCCFJPXU.js} +38 -11
  57. package/dist/notifications-AQBXBK4K.js +231 -0
  58. package/dist/{post-AN6T2OJF.js → post-PINZHSPS.js} +92 -12
  59. package/dist/{profile-UQY64642.js → profile-MJQJSNYR.js} +76 -20
  60. package/dist/{recruiter-OY4RN5HH.js → recruiter-X6GX4A2G.js} +133 -22
  61. package/dist/{sales-nav-KLODLYMW.js → sales-nav-44GYWDYE.js} +74 -19
  62. package/dist/{search-NWP5S6CF.js → search-SULIN6TB.js} +55 -23
  63. package/dist/{setup-YPPFLH2N.js → setup-ZQRHMRMB.js} +69 -17
  64. package/dist/team-TM6LRUY5.js +450 -0
  65. package/dist/tier-Z3U6AT7H.js +61 -0
  66. package/dist/unibox-BIMI2KY5.js +402 -0
  67. package/dist/{webhook-OHKBL3YS.js → webhook-EHXRTHBG.js} +257 -27
  68. package/package.json +2 -2
  69. package/dist/chunk-D2S5OCYU.js +0 -38
  70. package/dist/core-RGU2SCBN.js +0 -46
@@ -1,20 +1,25 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- DEFAULT_FILTER_READERS,
4
- assembleFilters,
5
- splitCsv
6
- } from "./chunk-3RCW7URJ.js";
7
2
  import {
8
3
  AttachError,
9
4
  readAttachment,
10
5
  toAttachmentPayload
11
6
  } from "./chunk-5I6JJJIV.js";
7
+ import {
8
+ AS_ACCOUNT,
9
+ BUDGET,
10
+ TARGET
11
+ } from "./chunk-Q3ZPRFUX.js";
12
12
  import {
13
13
  resolveIdentifier
14
14
  } from "./chunk-UEAX6KUB.js";
15
+ import {
16
+ DEFAULT_FILTER_READERS,
17
+ assembleFilters,
18
+ splitCsv
19
+ } from "./chunk-A57ZILRU.js";
15
20
  import {
16
21
  requireAccount
17
- } from "./chunk-V7FJWTZW.js";
22
+ } from "./chunk-6LBOGIVE.js";
18
23
  import {
19
24
  buildPreviewOutput
20
25
  } from "./chunk-TCUYH5GO.js";
@@ -25,29 +30,31 @@ import {
25
30
  readableObject,
26
31
  readablePage,
27
32
  rejectPaginationModifiersWithoutAll,
33
+ streamAll
34
+ } from "./chunk-LRMPS4UQ.js";
35
+ import {
28
36
  renderError,
29
37
  renderSuccess,
30
38
  renderUnexpectedError,
31
- resolveEffectiveConfig,
32
- streamAll,
33
39
  writeNdjsonItem
34
- } from "./chunk-SA2QHAXG.js";
35
- import "./chunk-RXWODUWA.js";
40
+ } from "./chunk-QM57YDJE.js";
36
41
  import {
37
- createClient
38
- } from "./chunk-5ZGTU4VD.js";
42
+ createClient,
43
+ resolveEffectiveConfig
44
+ } from "./chunk-LULN3II2.js";
39
45
  import {
40
46
  GLOBAL_FLAGS,
41
47
  READ_SINGLE_FLAGS,
42
48
  WRITE_FLAGS,
43
49
  readOnly
44
- } from "./chunk-Y7MZZRYR.js";
50
+ } from "./chunk-RYWWSZUH.js";
45
51
  import {
46
52
  DESCRIPTIONS
47
- } from "./chunk-D2S5OCYU.js";
48
- import "./chunk-TEAWYLPO.js";
53
+ } from "./chunk-73DJ3KNE.js";
54
+ import "./chunk-TYNVJDYK.js";
49
55
  import "./chunk-FDJMAF7D.js";
50
56
  import "./chunk-ZYURL5VK.js";
57
+ import "./chunk-2W4RN5ON.js";
51
58
 
52
59
  // src/commands/sales-nav.ts
53
60
  import { defineCommand } from "citty";
@@ -71,7 +78,7 @@ function normalizeAttachPaths(attach) {
71
78
  async function handleSdkError(err, outOpts, out) {
72
79
  const { CurviateError } = await import("@curviate/sdk");
73
80
  if (err instanceof CurviateError) {
74
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
81
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
75
82
  renderError(err, outOpts, out);
76
83
  process.exit(getExitCode(err));
77
84
  }
@@ -512,6 +519,15 @@ var salesNavMessageNewCommand = defineCommand({
512
519
  meta: {
513
520
  name: "new",
514
521
  description: "Start a new Sales Navigator chat.",
522
+ risk: "write",
523
+ rules: {
524
+ changes: "Starts a Sales Navigator chat with the member and sends the opening message.",
525
+ visible_to: "The recipient.",
526
+ budget_rows: ["inmail"],
527
+ retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core inbox list` first.",
528
+ undo: "Cannot be undone."
529
+ },
530
+ errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, LINKEDIN_FEATURE_NOT_SUBSCRIBED: "the Account has no Sales Navigator subscription.", RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person." },
515
531
  examples: [
516
532
  `curviate core sales-nav message new --to ACwAAA1234567 --subject "Quick question" "Hi Jane, a quick question about your team's tooling."`
517
533
  ]
@@ -526,9 +542,9 @@ var salesNavMessageNewCommand = defineCommand({
526
542
  },
527
543
  subject: { type: "string", description: "Message subject line (required for Sales Navigator messaging).", required: true },
528
544
  text: { type: "positional", description: "Opening message text." },
529
- attach: { type: "string", description: "File to attach (repeatable, max 7 MiB each)." },
530
- voice: { type: "string", description: "Voice message file (max 7 MiB)." },
531
- video: { type: "string", description: "Video message file (max 7 MiB)." }
545
+ attach: { type: "string", description: "File to attach (repeatable)." },
546
+ voice: { type: "string", description: "Voice message file." },
547
+ video: { type: "string", description: "Video message file." }
532
548
  },
533
549
  async run({ args }) {
534
550
  const flags = args;
@@ -562,6 +578,10 @@ var salesNavSearchPeopleCommand = defineCommand({
562
578
  meta: {
563
579
  name: "people",
564
580
  description: "Search Sales Navigator member profiles.",
581
+ risk: "read",
582
+ rules: {
583
+ budget_rows: ["search"]
584
+ },
565
585
  examples: [
566
586
  'curviate core sales-nav search people --keywords "head of data"',
567
587
  "curviate core sales-nav search people --filters-file filters.json"
@@ -599,6 +619,10 @@ var salesNavSearchCompaniesCommand = defineCommand({
599
619
  meta: {
600
620
  name: "companies",
601
621
  description: "Search Sales Navigator companies.",
622
+ risk: "read",
623
+ rules: {
624
+ budget_rows: ["search"]
625
+ },
602
626
  examples: [
603
627
  "curviate core sales-nav search companies --keywords fintech"
604
628
  ]
@@ -631,6 +655,7 @@ var salesNavSearchParametersCommand = defineCommand({
631
655
  meta: {
632
656
  name: "parameters",
633
657
  description: "Resolve Sales Navigator filter parameter IDs. Paginated: --cursor pages manually, --all streams every page as NDJSON.",
658
+ risk: "read",
634
659
  examples: [
635
660
  "curviate core sales-nav search parameters --type REGION --keywords Berlin"
636
661
  ]
@@ -666,6 +691,10 @@ var salesNavSearchCommand = defineCommand({
666
691
  meta: {
667
692
  name: "search",
668
693
  description: "Sales Navigator search operations. Also runs a pasted Sales Navigator search/list URL directly.",
694
+ risk: "read",
695
+ rules: {
696
+ budget_rows: ["search"]
697
+ },
669
698
  examples: [
670
699
  'curviate core sales-nav search "https://www.linkedin.com/sales/search/people?query=(keywords%3Aai)"'
671
700
  ]
@@ -711,6 +740,10 @@ var salesNavProfileCommand = defineCommand({
711
740
  meta: {
712
741
  name: "profile",
713
742
  description: "Get a Sales Navigator enriched member profile.",
743
+ risk: "read",
744
+ rules: {
745
+ budget_rows: ["profile_views"]
746
+ },
714
747
  examples: [
715
748
  "curviate core sales-nav profile https://www.linkedin.com/in/janesmith"
716
749
  ]
@@ -742,6 +775,15 @@ var salesNavSaveLeadCommand = defineCommand({
742
775
  meta: {
743
776
  name: "save-lead",
744
777
  description: "Save a Sales Navigator member into a lead list.",
778
+ risk: "write",
779
+ rules: {
780
+ changes: "Adds the member to a lead list in Sales Navigator.",
781
+ visible_to: "Your Sales Navigator seat, and whoever the list is shared with.",
782
+ budget_rows: [],
783
+ retry: "Read the list with `curviate core sales-nav browse-lead-list <list_id>` first.",
784
+ undo: "Remove the lead from the list in Sales Navigator; the CLI has no command for it."
785
+ },
786
+ errors: { ...AS_ACCOUNT, ...TARGET, LINKEDIN_FEATURE_NOT_SUBSCRIBED: "the Account has no Sales Navigator subscription." },
745
787
  examples: [
746
788
  "curviate core sales-nav save-lead ACwAAA1234567 --list 987654"
747
789
  ]
@@ -774,6 +816,7 @@ var salesNavAccountListsCommand = defineCommand({
774
816
  meta: {
775
817
  name: "account-lists",
776
818
  description: "List the saved-account (company) lists on the operator's Sales Navigator seat.",
819
+ risk: "read",
777
820
  examples: [
778
821
  "curviate core sales-nav account-lists"
779
822
  ]
@@ -801,6 +844,7 @@ var salesNavLeadListsCommand = defineCommand({
801
844
  meta: {
802
845
  name: "lead-lists",
803
846
  description: "List the saved-lead (member) lists on the operator's Sales Navigator seat.",
847
+ risk: "read",
804
848
  examples: [
805
849
  "curviate core sales-nav lead-lists"
806
850
  ]
@@ -828,6 +872,7 @@ var salesNavBrowseAccountListCommand = defineCommand({
828
872
  meta: {
829
873
  name: "browse-account-list",
830
874
  description: "Browse the saved accounts (companies) in one account list.",
875
+ risk: "read",
831
876
  examples: [
832
877
  "curviate core sales-nav browse-account-list 987654",
833
878
  "curviate core sales-nav browse-account-list 987654 --sort-by DATE_ADDED --sort-order DESCENDING"
@@ -862,6 +907,7 @@ var salesNavBrowseLeadListCommand = defineCommand({
862
907
  meta: {
863
908
  name: "browse-lead-list",
864
909
  description: "Browse the saved leads (members) in one lead list.",
910
+ risk: "read",
865
911
  examples: [
866
912
  "curviate core sales-nav browse-lead-list 987654",
867
913
  "curviate core sales-nav browse-lead-list 987654 --spotlight RECENT_POSITION_CHANGE"
@@ -896,6 +942,15 @@ var salesNavSaveAccountCommand = defineCommand({
896
942
  meta: {
897
943
  name: "save-account",
898
944
  description: "Save a LinkedIn company into an account list.",
945
+ risk: "write",
946
+ rules: {
947
+ changes: "Adds the company to an account list in Sales Navigator.",
948
+ visible_to: "Your Sales Navigator seat, and whoever the list is shared with.",
949
+ budget_rows: [],
950
+ retry: "Read the list with `curviate core sales-nav browse-account-list <list_id>` first.",
951
+ undo: "Remove the company from the list in Sales Navigator; the CLI has no command for it."
952
+ },
953
+ errors: { ...AS_ACCOUNT, ...TARGET, LINKEDIN_FEATURE_NOT_SUBSCRIBED: "the Account has no Sales Navigator subscription." },
899
954
  examples: [
900
955
  "curviate core sales-nav save-account 1234567 --list 987654"
901
956
  ]
@@ -3,10 +3,7 @@ import {
3
3
  DEFAULT_FILTER_READERS,
4
4
  assembleFilters,
5
5
  splitCsv
6
- } from "./chunk-3RCW7URJ.js";
7
- import {
8
- requireAccount
9
- } from "./chunk-V7FJWTZW.js";
6
+ } from "./chunk-A57ZILRU.js";
10
7
  import {
11
8
  slimSearchCompanies,
12
9
  slimSearchCompaniesItem,
@@ -16,7 +13,10 @@ import {
16
13
  slimSearchPeopleItem,
17
14
  slimSearchPosts,
18
15
  slimSearchPostsItem
19
- } from "./chunk-LCGXJGPB.js";
16
+ } from "./chunk-GHMRPX5H.js";
17
+ import {
18
+ requireAccount
19
+ } from "./chunk-6LBOGIVE.js";
20
20
  import {
21
21
  intFlag,
22
22
  intListFlag
@@ -27,27 +27,29 @@ import {
27
27
  readMaxPagesFlag,
28
28
  readablePage,
29
29
  rejectPaginationModifiersWithoutAll,
30
+ streamAll
31
+ } from "./chunk-LRMPS4UQ.js";
32
+ import {
30
33
  renderError,
31
34
  renderSuccess,
32
35
  renderUnexpectedError,
33
- resolveEffectiveConfig,
34
- streamAll,
35
36
  writeNdjsonItem
36
- } from "./chunk-SA2QHAXG.js";
37
- import "./chunk-RXWODUWA.js";
37
+ } from "./chunk-QM57YDJE.js";
38
38
  import {
39
- createClient
40
- } from "./chunk-5ZGTU4VD.js";
39
+ createClient,
40
+ resolveEffectiveConfig
41
+ } from "./chunk-LULN3II2.js";
41
42
  import {
42
43
  GLOBAL_FLAGS,
43
44
  readOnly
44
- } from "./chunk-Y7MZZRYR.js";
45
+ } from "./chunk-RYWWSZUH.js";
45
46
  import {
46
47
  DESCRIPTIONS
47
- } from "./chunk-D2S5OCYU.js";
48
- import "./chunk-TEAWYLPO.js";
48
+ } from "./chunk-73DJ3KNE.js";
49
+ import "./chunk-TYNVJDYK.js";
49
50
  import "./chunk-FDJMAF7D.js";
50
51
  import "./chunk-ZYURL5VK.js";
52
+ import "./chunk-2W4RN5ON.js";
51
53
 
52
54
  // src/commands/search.ts
53
55
  import { defineCommand } from "citty";
@@ -224,7 +226,7 @@ async function runSearchPeople(client, flags, out, readers = DEFAULT_FILTER_READ
224
226
  } catch (err) {
225
227
  const { CurviateError } = await import("@curviate/sdk");
226
228
  if (err instanceof CurviateError) {
227
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
229
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
228
230
  renderError(err, outOpts, out);
229
231
  process.exit(getExitCode(err));
230
232
  }
@@ -266,7 +268,7 @@ async function runSearchCompanies(client, flags, out, readers = DEFAULT_FILTER_R
266
268
  } catch (err) {
267
269
  const { CurviateError } = await import("@curviate/sdk");
268
270
  if (err instanceof CurviateError) {
269
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
271
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
270
272
  renderError(err, outOpts, out);
271
273
  process.exit(getExitCode(err));
272
274
  }
@@ -308,7 +310,7 @@ async function runSearchPosts(client, flags, out, readers = DEFAULT_FILTER_READE
308
310
  } catch (err) {
309
311
  const { CurviateError } = await import("@curviate/sdk");
310
312
  if (err instanceof CurviateError) {
311
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
313
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
312
314
  renderError(err, outOpts, out);
313
315
  process.exit(getExitCode(err));
314
316
  }
@@ -350,7 +352,7 @@ async function runSearchJobs(client, flags, out, readers = DEFAULT_FILTER_READER
350
352
  } catch (err) {
351
353
  const { CurviateError } = await import("@curviate/sdk");
352
354
  if (err instanceof CurviateError) {
353
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
355
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
354
356
  renderError(err, outOpts, out);
355
357
  process.exit(getExitCode(err));
356
358
  }
@@ -398,7 +400,7 @@ async function runSearchParameters(client, flags, out) {
398
400
  } catch (err) {
399
401
  const { CurviateError } = await import("@curviate/sdk");
400
402
  if (err instanceof CurviateError) {
401
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
403
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
402
404
  renderError(err, outOpts, out);
403
405
  process.exit(getExitCode(err));
404
406
  }
@@ -440,7 +442,7 @@ async function runSearchGroups(client, flags, out) {
440
442
  } catch (err) {
441
443
  const { CurviateError } = await import("@curviate/sdk");
442
444
  if (err instanceof CurviateError) {
443
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
445
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
444
446
  renderError(err, outOpts, out);
445
447
  process.exit(getExitCode(err));
446
448
  }
@@ -484,7 +486,7 @@ async function runSearchServices(client, flags, out) {
484
486
  } catch (err) {
485
487
  const { CurviateError } = await import("@curviate/sdk");
486
488
  if (err instanceof CurviateError) {
487
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
489
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
488
490
  renderError(err, outOpts, out);
489
491
  process.exit(getExitCode(err));
490
492
  }
@@ -526,7 +528,7 @@ async function runSearchServiceParameters(client, flags, out) {
526
528
  } catch (err) {
527
529
  const { CurviateError } = await import("@curviate/sdk");
528
530
  if (err instanceof CurviateError) {
529
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
531
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
530
532
  renderError(err, outOpts, out);
531
533
  process.exit(getExitCode(err));
532
534
  }
@@ -565,7 +567,7 @@ async function runSearchFromUrl(client, flags, out) {
565
567
  } catch (err) {
566
568
  const { CurviateError } = await import("@curviate/sdk");
567
569
  if (err instanceof CurviateError) {
568
- const { getExitCode } = await import("./exit-codes-TLMKTLRI.js");
570
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
569
571
  renderError(err, outOpts, out);
570
572
  process.exit(getExitCode(err));
571
573
  }
@@ -577,6 +579,10 @@ var searchPeopleCommand = defineCommand({
577
579
  meta: {
578
580
  name: "people",
579
581
  description: "Search members with structured filters.",
582
+ risk: "read",
583
+ rules: {
584
+ budget_rows: ["search"]
585
+ },
580
586
  examples: [
581
587
  'curviate core search people --keywords "AI engineer"',
582
588
  'curviate core search people --keywords "AI engineer" --location 106967730',
@@ -621,6 +627,10 @@ var searchCompaniesCommand = defineCommand({
621
627
  meta: {
622
628
  name: "companies",
623
629
  description: "Search companies.",
630
+ risk: "read",
631
+ rules: {
632
+ budget_rows: ["search"]
633
+ },
624
634
  examples: [
625
635
  'curviate core search companies --keywords "developer tools"',
626
636
  "curviate core search companies --keywords robotics --headcount 11-50,51-200"
@@ -660,6 +670,10 @@ var searchPostsCommand = defineCommand({
660
670
  meta: {
661
671
  name: "posts",
662
672
  description: "Search posts. Each result's text can repeat fragments around links, mentions and hashtags; use `curviate core post get <id>` for the clean body.",
673
+ risk: "read",
674
+ rules: {
675
+ budget_rows: ["search"]
676
+ },
663
677
  examples: [
664
678
  'curviate core search posts --keywords "agent infrastructure"',
665
679
  'curviate core search posts --keywords "agent infrastructure" --date-posted past_week'
@@ -703,6 +717,10 @@ var searchJobsCommand = defineCommand({
703
717
  meta: {
704
718
  name: "jobs",
705
719
  description: "Search jobs.",
720
+ risk: "read",
721
+ rules: {
722
+ budget_rows: ["search"]
723
+ },
706
724
  examples: [
707
725
  'curviate core search jobs --keywords "AI engineer"',
708
726
  'curviate core search jobs --keywords "AI engineer" --location 106967730 --presence remote'
@@ -760,6 +778,7 @@ var searchParametersCommand = defineCommand({
760
778
  meta: {
761
779
  name: "parameters",
762
780
  description: "Resolve human-readable terms to opaque filter IDs. Paginated: --cursor pages manually, --all streams every page as NDJSON.",
781
+ risk: "read",
763
782
  examples: [
764
783
  "curviate core search parameters --type LOCATION --keywords Berlin",
765
784
  "curviate core search parameters --type COMPANY --keywords Acme"
@@ -796,6 +815,10 @@ var searchGroupsCommand = defineCommand({
796
815
  meta: {
797
816
  name: "groups",
798
817
  description: "Keyword search for LinkedIn groups. A no-match search returns an empty list, not an error.",
818
+ risk: "read",
819
+ rules: {
820
+ budget_rows: ["search"]
821
+ },
799
822
  examples: [
800
823
  'curviate core search groups "gtm engineering"'
801
824
  ]
@@ -826,6 +849,10 @@ var searchServicesCommand = defineCommand({
826
849
  meta: {
827
850
  name: "services",
828
851
  description: "Search Services Marketplace providers with structured filters. At least one of --keywords, --service-category, or --location is required. Resolve --service-category/--location values with `curviate core search service-parameters` first, both take opaque ids, not free text.",
852
+ risk: "read",
853
+ rules: {
854
+ budget_rows: ["search"]
855
+ },
829
856
  examples: [
830
857
  "curviate core search services --keywords marketing",
831
858
  "curviate core search services --service-category 100 --location 106967730"
@@ -864,6 +891,7 @@ var searchServiceParametersCommand = defineCommand({
864
891
  meta: {
865
892
  name: "service-parameters",
866
893
  description: "Resolve human-readable service-filter terms into the opaque ids `curviate core search services` accepts. Paginated: --cursor pages manually, --all streams every page as NDJSON.",
894
+ risk: "read",
867
895
  examples: [
868
896
  "curviate core search service-parameters --type service_category --keywords marketing"
869
897
  ]
@@ -898,6 +926,10 @@ var searchCommand = defineCommand({
898
926
  meta: {
899
927
  name: "search",
900
928
  description: DESCRIPTIONS.search,
929
+ risk: "read",
930
+ rules: {
931
+ budget_rows: ["search"]
932
+ },
901
933
  examples: [
902
934
  'curviate core search "https://www.linkedin.com/search/results/people/?keywords=ai%20engineer"'
903
935
  ]
@@ -1,30 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- readablePage,
4
- resolveEffectiveConfig
5
- } from "./chunk-SA2QHAXG.js";
6
- import {
7
- getExitCode
8
- } from "./chunk-RXWODUWA.js";
3
+ readablePage
4
+ } from "./chunk-LRMPS4UQ.js";
5
+ import "./chunk-QM57YDJE.js";
9
6
  import {
10
7
  readlineSync
11
- } from "./chunk-YLSJ4HKU.js";
8
+ } from "./chunk-ENBIMEKS.js";
12
9
  import {
13
10
  createClient,
14
11
  getConfigPath,
12
+ isPlainObject,
13
+ resolveEffectiveConfig,
15
14
  writeProfile
16
- } from "./chunk-5ZGTU4VD.js";
15
+ } from "./chunk-LULN3II2.js";
17
16
  import {
18
- GLOBAL_FLAGS
19
- } from "./chunk-Y7MZZRYR.js";
17
+ GLOBAL_FLAGS,
18
+ getTeamFlag
19
+ } from "./chunk-RYWWSZUH.js";
20
20
  import {
21
21
  DESCRIPTIONS
22
- } from "./chunk-D2S5OCYU.js";
22
+ } from "./chunk-73DJ3KNE.js";
23
23
  import {
24
24
  defaultReadStdin,
25
25
  isStdinToken,
26
26
  resolveTextOrStdin
27
27
  } from "./chunk-ZYURL5VK.js";
28
+ import {
29
+ getExitCode
30
+ } from "./chunk-2W4RN5ON.js";
28
31
 
29
32
  // src/commands/setup.ts
30
33
  import { defineCommand } from "citty";
@@ -88,10 +91,12 @@ function appRoot(baseUrl, override) {
88
91
  }
89
92
  return `${parsed.origin}${parsed.pathname.replace(/\/?api\/?$/, "").replace(/\/$/, "")}`;
90
93
  }
91
- function authorizeUrl(baseUrl, sessionId, publicKey, appUrlOverride) {
94
+ function authorizeUrl(baseUrl, sessionId, publicKey, appUrlOverride, team) {
92
95
  const url = new URL(`${appRoot(baseUrl, appUrlOverride)}/cli`);
93
96
  url.searchParams.set("sid", sessionId);
94
97
  url.searchParams.set("pk", publicKey);
98
+ url.searchParams.set("picker", "1");
99
+ if (team) url.searchParams.set("team", team);
95
100
  return url.toString();
96
101
  }
97
102
  function exchangeUrl(baseUrl) {
@@ -202,8 +207,11 @@ async function defaultOpen(url) {
202
207
  const open = (await import("open")).default;
203
208
  return open(url);
204
209
  }
205
- async function defaultVerify(apiKey, baseUrl) {
206
- readablePage(await createClient({ apiKey, baseUrl }).accounts.list());
210
+ async function defaultVerify(apiKey, baseUrl, team) {
211
+ readablePage(await createClient({ apiKey, baseUrl, team: team ?? null }).accounts.list());
212
+ }
213
+ async function defaultListTeams(apiKey, baseUrl) {
214
+ return createClient({ apiKey, baseUrl, team: null }).teams.list({ limit: 100 });
207
215
  }
208
216
  function resolveSetupIO(io = {}) {
209
217
  return {
@@ -221,6 +229,7 @@ function resolveSetupIO(io = {}) {
221
229
  open: io.open ?? defaultOpen,
222
230
  fetch: io.fetch ?? fetch,
223
231
  verify: io.verify ?? defaultVerify,
232
+ listTeams: io.listTeams ?? defaultListTeams,
224
233
  generate: io.generate ?? generateSessionMaterial
225
234
  };
226
235
  }
@@ -263,7 +272,8 @@ async function runSetup(args, io) {
263
272
  baseUrl,
264
273
  material.sessionId,
265
274
  material.publicKey,
266
- io.env[APP_URL_ENV]
275
+ io.env[APP_URL_ENV],
276
+ getTeamFlag()
267
277
  );
268
278
  if (json) {
269
279
  await writeResumeState({
@@ -348,14 +358,17 @@ async function finishExchange(baseUrl, material, code, profileName, opts, io) {
348
358
  );
349
359
  return 1;
350
360
  }
361
+ const team = result.body.team_id === void 0 ? void 0 : await confirmTeam(apiKey, baseUrl, result.body.team_id, opts, io);
351
362
  await writeProfile(profileName, {
352
363
  apiKey,
353
364
  tenant: result.body.tenant_name,
365
+ // Always written: a Team key replacing an all-teams one must not keep its Team.
366
+ team,
354
367
  ...result.body.account_id !== void 0 ? { account: result.body.account_id } : {}
355
368
  });
356
369
  await clearResumeState();
357
370
  try {
358
- await io.verify(apiKey, baseUrl);
371
+ await io.verify(apiKey, baseUrl, team);
359
372
  } catch (err) {
360
373
  io.stderr.write(
361
374
  "error: the credential was saved but a verifying call did not succeed. Run `curviate doctor` for detail.\n"
@@ -366,6 +379,7 @@ async function finishExchange(baseUrl, material, code, profileName, opts, io) {
366
379
  ok: true,
367
380
  tenant: result.body.tenant_name,
368
381
  profile: profileName,
382
+ team: team ?? null,
369
383
  ...result.body.account_id !== void 0 ? { account_id: result.body.account_id } : {}
370
384
  };
371
385
  if (opts.json) {
@@ -379,23 +393,61 @@ async function finishExchange(baseUrl, material, code, profileName, opts, io) {
379
393
  io.stderr.write(`Default account set to ${result.body.account_id}.
380
394
  `);
381
395
  }
396
+ if (team !== void 0) io.stderr.write(`This key works in all your Teams; calls act in ${team} (change it with \`curviate team switch <team_id>\` or --team).
397
+ `);
382
398
  io.stderr.write("Run `curviate doctor` to confirm.\n");
383
399
  }
384
400
  return 0;
385
401
  }
402
+ async function confirmTeam(apiKey, baseUrl, teamId, opts, io) {
403
+ let rows;
404
+ try {
405
+ const page = await io.listTeams(apiKey, baseUrl);
406
+ const items = isPlainObject(page) ? page["items"] : void 0;
407
+ if (!Array.isArray(items)) return teamId;
408
+ rows = items.filter((t) => isPlainObject(t) && typeof t["team_id"] === "string");
409
+ } catch {
410
+ return teamId;
411
+ }
412
+ const ids = rows.map((t) => t.team_id);
413
+ if (ids.includes(teamId)) return teamId;
414
+ io.stderr.write(`The Team you picked (${teamId}) is no longer one of yours.
415
+ `);
416
+ if (!opts.json && io.isTTY && ids.length > 0) {
417
+ for (const t of rows) io.stderr.write(` ${t.team_id} ${typeof t.name === "string" ? t.name : ""}
418
+ `);
419
+ const picked = (await io.prompt("Team to act in (team id, empty for none): ")).trim();
420
+ if (ids.includes(picked)) return picked;
421
+ }
422
+ io.stderr.write("No Team saved: pass --team, set CURVIATE_TEAM, or run `curviate team switch <team_id>` (`curviate team list` shows them).\n");
423
+ return void 0;
424
+ }
386
425
  var setupCommand = defineCommand({
387
426
  meta: {
388
427
  name: "setup",
389
428
  description: DESCRIPTIONS.setup,
429
+ risk: "write",
430
+ rules: {
431
+ changes: "Opens the dashboard, exchanges the code it shows for an API key and saves it as a local profile.",
432
+ visible_to: "Your workspace lists the new API key; nothing reaches LinkedIn.",
433
+ budget_rows: [],
434
+ retry: "Each run creates another API key; revoke the unused ones in the dashboard.",
435
+ undo: "Revoke the key in the dashboard and remove the profile with `curviate config reset --profile <name> --yes`."
436
+ },
437
+ errors: { INVALID_REQUEST: "the code was not accepted or has expired: run `curviate setup` again for a fresh one." },
390
438
  examples: [
391
439
  "curviate setup",
392
- "curviate setup --json",
440
+ "curviate setup --json --team tnt_01HZY3K8Q2",
393
441
  "curviate setup --code -"
394
442
  ]
395
443
  },
396
444
  args: {
397
445
  profile: GLOBAL_FLAGS.profile,
398
446
  "base-url": GLOBAL_FLAGS["base-url"],
447
+ team: {
448
+ type: "string",
449
+ description: "Preselect this Team (tnt_...) on the authorize page."
450
+ },
399
451
  json: GLOBAL_FLAGS.json,
400
452
  "no-browser": {
401
453
  type: "boolean",