@curviate/cli 0.48.0 → 0.50.0-next.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.
Files changed (70) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +47 -6
  3. package/dist/{account-WKQHMM7P.js → account-KGCGUYKF.js} +668 -116
  4. package/dist/analytics-HRAD4ABO.js +27 -0
  5. package/dist/beta-consent-364JI6IL.js +81 -0
  6. package/dist/billing-3SSVRS2Y.js +124 -0
  7. package/dist/{chunk-Q63IIPL2.js → chunk-25MO7BYN.js} +4 -4
  8. package/dist/{chunk-76SWLAZ6.js → chunk-2W4RN5ON.js} +59 -1
  9. package/dist/chunk-5S3MJVI5.js +22 -0
  10. package/dist/chunk-67S4JHZZ.js +339 -0
  11. package/dist/chunk-73DJ3KNE.js +54 -0
  12. package/dist/chunk-CQGDMARG.js +525 -0
  13. package/dist/{chunk-Y7K4UBFC.js → chunk-DOHBOYXN.js} +1 -1
  14. package/dist/{chunk-TSOIZBBU.js → chunk-DSGKYZDK.js} +1 -1
  15. package/dist/{chunk-YLSJ4HKU.js → chunk-ENBIMEKS.js} +26 -1
  16. package/dist/{chunk-LCGXJGPB.js → chunk-GHMRPX5H.js} +7 -1
  17. package/dist/chunk-GOICALYQ.js +28 -0
  18. package/dist/chunk-L4CIJT6F.js +144 -0
  19. package/dist/{chunk-PQWDDSV7.js → chunk-L7JH3W56.js} +1 -1
  20. package/dist/{chunk-YFXLXION.js → chunk-OE6YFYUM.js} +85 -10
  21. package/dist/chunk-PPGKQJKU.js +38 -0
  22. package/dist/{chunk-MKGVNDMJ.js → chunk-QM57YDJE.js} +13 -201
  23. package/dist/{chunk-CVMSQ3OF.js → chunk-RYWWSZUH.js} +17 -3
  24. package/dist/chunk-T6GBS5SS.js +58 -0
  25. package/dist/{chunk-AYKKXGTR.js → chunk-TE3WBPW6.js} +392 -14
  26. package/dist/chunk-UL53T4O6.js +52 -0
  27. package/dist/chunk-UWQPX4AE.js +20 -0
  28. package/dist/{chunk-OHXYFICP.js → chunk-YXVF5UST.js} +77 -4
  29. package/dist/cli.js +35 -17
  30. package/dist/{comment-7IQ6ZOJF.js → comment-5JKGNYOY.js} +90 -11
  31. package/dist/{company-RD7RDGSA.js → company-TXST2VXW.js} +65 -15
  32. package/dist/{config-EYBNYRGK.js → config-TVIQUVNK.js} +53 -4
  33. package/dist/{connect-HVXT67A6.js → connect-RBL6U4KV.js} +63 -18
  34. package/dist/contact-YAHC5QFX.js +32 -0
  35. package/dist/contact-groups-DKOIBC57.js +399 -0
  36. package/dist/contact-import-ITSJQV7K.js +336 -0
  37. package/dist/core-PWMJPPRG.js +46 -0
  38. package/dist/do-not-contact-WDYIBWYA.js +200 -0
  39. package/dist/{doctor-HUXQERLQ.js → doctor-F7JLPTED.js} +65 -11
  40. package/dist/{document-AUUCGST2.js → document-BHYAUJ6F.js} +1 -1
  41. package/dist/{draft-DFO22K6Q.js → draft-TDJJUXLH.js} +60 -14
  42. package/dist/enrollment-Q6UOKHPY.js +484 -0
  43. package/dist/{examples-64YT5V5K.js → examples-DQSVIIXZ.js} +2 -2
  44. package/dist/{exit-codes-AW6KHDDN.js → exit-codes-7DBETBDT.js} +1 -1
  45. package/dist/export-HIJSCJS6.js +96 -0
  46. package/dist/{feed-JWP6ANPI.js → feed-W56ZTA4Z.js} +13 -10
  47. package/dist/{group-SIQFJEZV.js → group-AUALYK5H.js} +18 -10
  48. package/dist/{inbox-MMIMCA5O.js → inbox-HLZR2ZPV.js} +31 -12
  49. package/dist/{inboxes-RND3D4C7.js → inboxes-IZTRD6FE.js} +14 -10
  50. package/dist/incoming-ULB2RNV4.js +218 -0
  51. package/dist/{job-ACFKBLFK.js → job-55IKS6LP.js} +65 -13
  52. package/dist/{login-ZOB5KVKQ.js → login-DPZ6CXNO.js} +13 -4
  53. package/dist/{message-OFK6UVXR.js → message-J44YKRDS.js} +9 -7
  54. package/dist/motion-SQI5F2EK.js +868 -0
  55. package/dist/network-K4QD7APQ.js +235 -0
  56. package/dist/{notification-KKGAZU7M.js → notification-SEDXZHXO.js} +38 -11
  57. package/dist/notifications-HGIBRUNQ.js +231 -0
  58. package/dist/{post-A5SBCFB2.js → post-L467SKIG.js} +92 -12
  59. package/dist/{profile-4SOOQZ4K.js → profile-A2N6RMR2.js} +79 -23
  60. package/dist/{recruiter-YN73STDP.js → recruiter-AR75RHBO.js} +132 -21
  61. package/dist/{sales-nav-JXF5RY2K.js → sales-nav-C2AYFXPV.js} +73 -18
  62. package/dist/{search-JAL242A2.js → search-Z4DZIG4X.js} +55 -23
  63. package/dist/{setup-WICWH4JG.js → setup-45BEVX6B.js} +69 -17
  64. package/dist/team-6QWY4IFP.js +450 -0
  65. package/dist/tier-2HS3BXDF.js +61 -0
  66. package/dist/unibox-DHUKG65Z.js +402 -0
  67. package/dist/{webhook-UGKVYWBC.js → webhook-Q53WUAI2.js} +273 -45
  68. package/package.json +2 -2
  69. package/dist/chunk-GQKC6E5K.js +0 -36
  70. package/dist/core-6XYGUNAY.js +0 -46
@@ -2,11 +2,13 @@
2
2
  import {
3
3
  betaOverrideHeader,
4
4
  getRecheck,
5
+ getTeamFlag,
5
6
  getWriteKind,
6
7
  isPoll
7
- } from "./chunk-CVMSQ3OF.js";
8
+ } from "./chunk-RYWWSZUH.js";
8
9
  import {
9
- assertNoStdinPlaceholder
10
+ assertNoStdinPlaceholder,
11
+ isStdinToken
10
12
  } from "./chunk-ZYURL5VK.js";
11
13
 
12
14
  // src/lib/config.ts
@@ -30,6 +32,7 @@ var PROFILE_FIELD_TYPES = {
30
32
  account: "string",
31
33
  baseUrl: "string",
32
34
  tenant: "string",
35
+ team: "string",
33
36
  timeout: "number"
34
37
  };
35
38
  function isPlainObject(value) {
@@ -193,13 +196,79 @@ async function updateProfileField(profileName, field, value) {
193
196
  profile.baseUrl = value !== void 0 ? String(value) : void 0;
194
197
  } else if (field === "tenant") {
195
198
  profile.tenant = value !== void 0 ? String(value) : void 0;
199
+ } else if (field === "team") {
200
+ profile.team = value !== void 0 ? String(value) : void 0;
196
201
  }
197
202
  await writeConfig(cfg);
198
203
  }
199
204
 
205
+ // src/lib/resolve.ts
206
+ var lastTeam = () => void 0;
207
+ var resolvedTeam = () => lastTeam();
208
+ var DEFAULT_BASE_URL = "https://api.curviate.com";
209
+ var DEFAULT_TIMEOUT_MS = 3e4;
210
+ async function resolveEffectiveConfig(flags) {
211
+ const file = await readConfigFile();
212
+ const fromProfile = (field) => profileValue(file, flags.profile, field);
213
+ if (isStdinToken(flags.apiKey)) {
214
+ process.stderr.write("error: --api-key - reads stdin only on `curviate login`. Set CURVIATE_API_KEY, or save the key with `curviate login --api-key -`.\n");
215
+ process.exit(2);
216
+ }
217
+ const profileKey = flags.apiKey === void 0 && process.env["CURVIATE_API_KEY"] === void 0 ? fromProfile("apiKey") : void 0;
218
+ const apiKey = flags.apiKey ?? process.env["CURVIATE_API_KEY"] ?? profileKey;
219
+ const apiKeySource = flags.apiKey !== void 0 ? "flag" : process.env["CURVIATE_API_KEY"] !== void 0 ? "env" : profileKey !== void 0 ? "profile" : "none";
220
+ const baseUrl = flags.baseUrl ?? process.env["CURVIATE_BASE_URL"] ?? fromProfile("baseUrl") ?? DEFAULT_BASE_URL;
221
+ const timeoutFlag = flags.timeout === void 0 ? void 0 : /^[1-9]\d*$/.test(flags.timeout) ? Number(flags.timeout) : NaN;
222
+ const keyAndUrlBypassProfile = apiKeySource !== "profile" && apiKeySource !== "none" && (flags.baseUrl ?? process.env["CURVIATE_BASE_URL"]) !== void 0;
223
+ const profileTimeout = () => {
224
+ try {
225
+ return fromProfile("timeout");
226
+ } catch (err) {
227
+ if (keyAndUrlBypassProfile) return void 0;
228
+ throw err;
229
+ }
230
+ };
231
+ const timeout = timeoutFlag ?? profileTimeout() ?? DEFAULT_TIMEOUT_MS;
232
+ const flagTeam = getTeamFlag();
233
+ if (flagTeam !== void 0 && flagTeam.trim() === "") {
234
+ process.stderr.write("error: --team was given an empty value. Pass a Team id (tnt_...), or leave it out.\n");
235
+ process.exit(2);
236
+ }
237
+ const envTeam = process.env["CURVIATE_TEAM"] || void 0;
238
+ const effective = {
239
+ apiKey,
240
+ baseUrl,
241
+ timeout,
242
+ apiKeySource,
243
+ // Account: flag > env > profile. Read on access: a root-scoped command never
244
+ // takes it, so a broken profile account must not refuse that command.
245
+ get account() {
246
+ return flags.account ?? process.env["CURVIATE_ACCOUNT"] ?? fromProfile("account");
247
+ },
248
+ // Tenant: only meaningful when the key itself came from the profile.
249
+ get tenant() {
250
+ return apiKeySource === "profile" ? fromProfile("tenant") : void 0;
251
+ },
252
+ // Read on access, like `account`: a command that sends nothing never reads it.
253
+ get team() {
254
+ return flagTeam?.trim() ?? envTeam ?? fromProfile("team");
255
+ },
256
+ get teamSource() {
257
+ return flagTeam !== void 0 ? "flag" : envTeam !== void 0 ? "env" : fromProfile("team") !== void 0 ? "profile" : "none";
258
+ }
259
+ };
260
+ lastTeam = () => effective.team;
261
+ return effective;
262
+ }
263
+
200
264
  // src/lib/client.ts
201
265
  import { AsyncLocalStorage } from "async_hooks";
202
266
  import { Curviate, CurviateError as CurviateError2 } from "@curviate/sdk";
267
+
268
+ // package.json
269
+ var version = "0.50.0-next.0";
270
+
271
+ // src/lib/client.ts
203
272
  function headerStrings(headers) {
204
273
  if (!headers) return [];
205
274
  if (headers instanceof Headers) {
@@ -335,17 +404,20 @@ function createClient(config) {
335
404
  return new Curviate({
336
405
  apiKey: config.apiKey.trim(),
337
406
  fetch: guardedFetch,
407
+ // Replaces the SDK's own `sdk/<version>`: exactly one Curviate-Client header per request.
408
+ client: `cli/${version}`,
338
409
  ...config.baseUrl !== void 0 ? { baseUrl: config.baseUrl } : {},
339
- ...config.timeout !== void 0 ? { timeout: config.timeout } : {}
410
+ ...config.timeout !== void 0 ? { timeout: config.timeout } : {},
411
+ ...teamOption(config.team === void 0 ? resolvedTeam() : config.team)
340
412
  });
341
413
  }
414
+ var teamOption = (team) => team ? { team } : {};
342
415
 
343
416
  export {
344
417
  PROFILE_FIELD_TYPES,
345
418
  isPlainObject,
346
419
  assertStructure,
347
420
  readConfigFile,
348
- profileValue,
349
421
  getConfigPath,
350
422
  readConfig,
351
423
  writeProfile,
@@ -353,6 +425,7 @@ export {
353
425
  renameProfile,
354
426
  removeProfile,
355
427
  updateProfileField,
428
+ resolveEffectiveConfig,
356
429
  downloadBinary,
357
430
  baseUrlProblem,
358
431
  withoutUserinfo,
package/dist/cli.js CHANGED
@@ -1,20 +1,21 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- intFlag
4
- } from "./chunk-NNV2OYEF.js";
5
2
  import {
6
3
  SECRET_FLAGS
7
4
  } from "./chunk-TCUYH5GO.js";
5
+ import {
6
+ intFlag
7
+ } from "./chunk-NNV2OYEF.js";
8
8
  import {
9
9
  GLOBAL_FLAGS,
10
10
  STATE_WRITES,
11
11
  parseBetaFlag,
12
12
  setBetaOverride,
13
+ setTeamFlag,
13
14
  setWriteKind
14
- } from "./chunk-CVMSQ3OF.js";
15
+ } from "./chunk-RYWWSZUH.js";
15
16
  import {
16
17
  lazy
17
- } from "./chunk-GQKC6E5K.js";
18
+ } from "./chunk-73DJ3KNE.js";
18
19
  import {
19
20
  editDistance
20
21
  } from "./chunk-FDJMAF7D.js";
@@ -44,19 +45,33 @@ var main = defineCommand({
44
45
  // Subcommand registry, names and descriptions are static for help rendering;
45
46
  // the handler implementation is loaded lazily on first invocation.
46
47
  subCommands: {
47
- setup: lazy("setup", () => import("./setup-WICWH4JG.js").then((m) => m.setupCommand)),
48
- doctor: lazy("doctor", () => import("./doctor-HUXQERLQ.js").then((m) => m.doctorCommand)),
49
- login: lazy("login", () => import("./login-ZOB5KVKQ.js").then((m) => m.loginCommand)),
50
- config: lazy("config", () => import("./config-EYBNYRGK.js").then((m) => m.configCommand)),
51
- account: lazy("account", () => import("./account-WKQHMM7P.js").then((m) => m.accountCommand)),
52
- webhook: lazy("webhook", () => import("./webhook-UGKVYWBC.js").then((m) => m.webhookCommand)),
48
+ setup: lazy("setup", () => import("./setup-45BEVX6B.js").then((m) => m.setupCommand)),
49
+ doctor: lazy("doctor", () => import("./doctor-F7JLPTED.js").then((m) => m.doctorCommand)),
50
+ login: lazy("login", () => import("./login-DPZ6CXNO.js").then((m) => m.loginCommand)),
51
+ config: lazy("config", () => import("./config-TVIQUVNK.js").then((m) => m.configCommand)),
52
+ account: lazy("account", () => import("./account-KGCGUYKF.js").then((m) => m.accountCommand)),
53
+ motion: lazy("motion", () => import("./motion-SQI5F2EK.js").then((m) => m.motionCommand)),
54
+ enrollment: lazy("enrollment", () => import("./enrollment-Q6UOKHPY.js").then((m) => m.enrollmentCommand)),
55
+ contact: lazy("contact", () => import("./contact-YAHC5QFX.js").then((m) => m.contactCommand)),
56
+ "do-not-contact": lazy("do-not-contact", () => import("./do-not-contact-WDYIBWYA.js").then((m) => m.doNotContactCommand)),
57
+ unibox: lazy("unibox", () => import("./unibox-DHUKG65Z.js").then((m) => m.uniboxCommand)),
58
+ network: lazy("network", () => import("./network-K4QD7APQ.js").then((m) => m.networkCommand)),
59
+ analytics: lazy("analytics", () => import("./analytics-HRAD4ABO.js").then((m) => m.analyticsCommand)),
60
+ notification: lazy("notification", () => import("./notifications-HGIBRUNQ.js").then((m) => m.notificationsCommand)),
61
+ export: lazy("export", () => import("./export-HIJSCJS6.js").then((m) => m.exportCommand)),
62
+ billing: lazy("billing", () => import("./billing-3SSVRS2Y.js").then((m) => m.billingCommand)),
63
+ tier: lazy("tier", () => import("./tier-2HS3BXDF.js").then((m) => m.tierCommand)),
64
+ team: lazy("team", () => import("./team-6QWY4IFP.js").then((m) => m.teamCommand)),
65
+ incoming: lazy("incoming", () => import("./incoming-ULB2RNV4.js").then((m) => m.incomingCommand)),
66
+ beta: lazy("beta", () => import("./beta-consent-364JI6IL.js").then((m) => m.betaCommand)),
67
+ webhook: lazy("webhook", () => import("./webhook-Q53WUAI2.js").then((m) => m.webhookCommand)),
53
68
  // The LinkedIn building blocks. Reserved product groups
54
- // (motion, contact, unibox, network, analytics, notification, team) land
55
- // between `account` and `webhook` with their owning specs.
56
- core: lazy("core", () => import("./core-6XYGUNAY.js").then((m) => m.coreCommand))
69
+ // (unibox, network, analytics, team) land
70
+ // between `enrollment` and `webhook` with their owning specs.
71
+ core: lazy("core", () => import("./core-PWMJPPRG.js").then((m) => m.coreCommand))
57
72
  },
58
73
  async run() {
59
- const { showHelp } = await import("./examples-64YT5V5K.js");
74
+ const { showHelp } = await import("./examples-DQSVIIXZ.js");
60
75
  await showHelp(main, ["curviate"]);
61
76
  }
62
77
  });
@@ -201,6 +216,8 @@ function arityPhrase(count) {
201
216
  return `${count} positional arguments`;
202
217
  }
203
218
  async function extraPositionals(cmd, rawArgs) {
219
+ const argsDef = await resolveValue(cmd.args ?? {});
220
+ if (Object.values(argsDef).some((def) => def?.type === "positional" && def.variadic)) return [];
204
221
  const booleanFlags = await routingBooleanFlagNames(cmd);
205
222
  const declaredFlags = await routingDeclaredFlagNames(cmd);
206
223
  const { positionals } = walkTokens(rawArgs, booleanFlags, declaredFlags);
@@ -346,7 +363,7 @@ async function dispatch(root, rawArgs) {
346
363
  helpFor = "curviate";
347
364
  if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
348
365
  const { leaf, path } = await resolveLeaf(root, rawArgs.filter((a) => a !== "--help" && a !== "-h"));
349
- const { showHelp } = await import("./examples-64YT5V5K.js");
366
+ const { showHelp } = await import("./examples-DQSVIIXZ.js");
350
367
  await showHelp(leaf, path);
351
368
  await new Promise((done) => process.stdout.write("", () => done()));
352
369
  process.exit(0);
@@ -407,6 +424,7 @@ async function dispatch(root, rawArgs) {
407
424
  );
408
425
  const limit = ctx.args["limit"];
409
426
  if (typeof limit === "string") intFlag("limit", limit);
427
+ setTeamFlag(ctx.args["team"]);
410
428
  return originalRun(ctx);
411
429
  }
412
430
  } : {}
@@ -427,7 +445,7 @@ async function dispatch(root, rawArgs) {
427
445
  if (code === "EARG") process.stderr.write(helpPointer());
428
446
  const { CurviateError } = await import("@curviate/sdk");
429
447
  if (err instanceof CurviateError) {
430
- const { getExitCode } = await import("./exit-codes-AW6KHDDN.js");
448
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
431
449
  process.exit(getExitCode(err));
432
450
  }
433
451
  process.exit(code === "EARG" ? 2 : 1);
@@ -1,17 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-Y7K4UBFC.js";
4
+ } from "./chunk-DOHBOYXN.js";
5
5
  import {
6
6
  AttachError,
7
7
  describeAttachment,
8
8
  readAttachment,
9
9
  toAttachmentPayload
10
10
  } from "./chunk-5I6JJJIV.js";
11
+ import {
12
+ AS_ACCOUNT,
13
+ BUDGET,
14
+ TARGET
15
+ } from "./chunk-UWQPX4AE.js";
11
16
  import "./chunk-UEAX6KUB.js";
12
17
  import {
13
18
  requireAccount
14
- } from "./chunk-Q63IIPL2.js";
19
+ } from "./chunk-25MO7BYN.js";
15
20
  import {
16
21
  buildPreviewOutput
17
22
  } from "./chunk-TCUYH5GO.js";
@@ -21,28 +26,30 @@ import {
21
26
  readMaxPagesFlag,
22
27
  readablePage,
23
28
  rejectPaginationModifiersWithoutAll,
29
+ streamAll
30
+ } from "./chunk-L4CIJT6F.js";
31
+ import {
24
32
  renderError,
25
33
  renderSuccess,
26
34
  renderUnexpectedError,
27
- resolveEffectiveConfig,
28
- streamAll,
29
35
  writeNdjsonItem
30
- } from "./chunk-MKGVNDMJ.js";
31
- import "./chunk-76SWLAZ6.js";
36
+ } from "./chunk-QM57YDJE.js";
32
37
  import {
33
- createClient
34
- } from "./chunk-OHXYFICP.js";
38
+ createClient,
39
+ resolveEffectiveConfig
40
+ } from "./chunk-YXVF5UST.js";
35
41
  import {
36
42
  GLOBAL_FLAGS,
37
43
  WRITE_SINGLE_FLAGS,
38
44
  readOnly
39
- } from "./chunk-CVMSQ3OF.js";
45
+ } from "./chunk-RYWWSZUH.js";
40
46
  import {
41
47
  DESCRIPTIONS
42
- } from "./chunk-GQKC6E5K.js";
48
+ } from "./chunk-73DJ3KNE.js";
43
49
  import {
44
50
  resolveTextOrStdin
45
51
  } from "./chunk-ZYURL5VK.js";
52
+ import "./chunk-2W4RN5ON.js";
46
53
 
47
54
  // src/commands/comment.ts
48
55
  import { defineCommand } from "citty";
@@ -71,7 +78,7 @@ function buildListQuery(flags, out) {
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-AW6KHDDN.js");
81
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
75
82
  renderError(err, outOpts, out);
76
83
  process.exit(getExitCode(err));
77
84
  }
@@ -413,6 +420,10 @@ var commentListCommand = defineCommand({
413
420
  meta: {
414
421
  name: "list",
415
422
  description: "List the comments on a post. A very recent add/delete may take a few minutes to appear or clear here (LinkedIn-side indexing).",
423
+ risk: "read",
424
+ rules: {
425
+ budget_rows: ["content_poll", "profile_views"]
426
+ },
416
427
  examples: [
417
428
  "curviate core comment list 7290000000000000000",
418
429
  "curviate core comment list 7290000000000000000 --all"
@@ -430,6 +441,10 @@ var commentRepliesCommand = defineCommand({
430
441
  meta: {
431
442
  name: "replies",
432
443
  description: "List the replies to a comment.",
444
+ risk: "read",
445
+ rules: {
446
+ budget_rows: ["content_poll", "profile_views"]
447
+ },
433
448
  examples: [
434
449
  "curviate core comment replies 7290000000000000000 COMMENT_ID",
435
450
  "curviate core comment replies 7290000000000000000 COMMENT_ID --all"
@@ -448,6 +463,10 @@ var commentReactionsCommand = defineCommand({
448
463
  meta: {
449
464
  name: "reactions",
450
465
  description: "List the reactions on a comment.",
466
+ risk: "read",
467
+ rules: {
468
+ budget_rows: ["content_poll", "profile_views"]
469
+ },
451
470
  examples: [
452
471
  "curviate core comment reactions 7290000000000000000 COMMENT_ID"
453
472
  ]
@@ -465,6 +484,10 @@ var commentUserCommand = defineCommand({
465
484
  meta: {
466
485
  name: "user",
467
486
  description: "List the comments authored by a user (accepts 'me').",
487
+ risk: "read",
488
+ rules: {
489
+ budget_rows: ["content_poll", "profile_views"]
490
+ },
468
491
  examples: [
469
492
  "curviate core comment user me",
470
493
  "curviate core comment user janesmith --limit 10"
@@ -482,6 +505,15 @@ var commentAddCommand = defineCommand({
482
505
  meta: {
483
506
  name: "add",
484
507
  description: "Publish a comment on a post.",
508
+ risk: "write",
509
+ rules: {
510
+ changes: "Publishes your comment on the post.",
511
+ visible_to: "The post's author and everyone who can see its comments.",
512
+ budget_rows: ["comments"],
513
+ retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core comment list <post_id>` first.",
514
+ undo: "`curviate core comment delete <post_id> <comment_id>`."
515
+ },
516
+ errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET },
485
517
  examples: [
486
518
  'curviate core comment add 7290000000000000000 "Useful breakdown, thanks for sharing."'
487
519
  ]
@@ -500,6 +532,15 @@ var commentReplyCommand = defineCommand({
500
532
  meta: {
501
533
  name: "reply",
502
534
  description: "Reply to a comment.",
535
+ risk: "write",
536
+ rules: {
537
+ changes: "Publishes your reply to the comment.",
538
+ visible_to: "The comment's author and everyone who can see the thread.",
539
+ budget_rows: ["comments"],
540
+ retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core comment replies <post_id> <comment_id>` first.",
541
+ undo: "`curviate core comment delete <post_id> <comment_id>`."
542
+ },
543
+ errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET },
503
544
  examples: [
504
545
  'curviate core comment reply 7290000000000000000 COMMENT_ID "Agreed, that matches what we saw."'
505
546
  ]
@@ -519,6 +560,15 @@ var commentEditCommand = defineCommand({
519
560
  meta: {
520
561
  name: "edit",
521
562
  description: "Edit your own comment.",
563
+ risk: "write",
564
+ rules: {
565
+ changes: "Replaces the text of your comment.",
566
+ visible_to: "Everyone who can see the comment.",
567
+ budget_rows: [],
568
+ retry: "Safe: the same text written again leaves the comment the same.",
569
+ undo: "Edit it again with the previous text."
570
+ },
571
+ errors: { ...AS_ACCOUNT, ...TARGET },
522
572
  examples: [
523
573
  'curviate core comment edit 7290000000000000000 COMMENT_ID "Useful breakdown, thanks for writing it up."'
524
574
  ]
@@ -537,6 +587,17 @@ var commentDeleteCommand = defineCommand({
537
587
  meta: {
538
588
  name: "delete",
539
589
  description: "Delete your own comment.",
590
+ risk: "high",
591
+ rules: {
592
+ changes: "Deletes one of your comments.",
593
+ visible_to: "Everyone: the comment disappears from the post.",
594
+ budget_rows: [],
595
+ retry: "Safe: a deleted comment is gone, so a repeat has nothing to delete.",
596
+ undo: "Cannot be undone.",
597
+ blast_radius: "One comment, with its replies and reactions."
598
+ },
599
+ errors: { ...AS_ACCOUNT, ...TARGET },
600
+ seeAlso: ["curviate core comment list"],
540
601
  examples: [
541
602
  "curviate core comment delete 7290000000000000000 COMMENT_ID"
542
603
  ]
@@ -554,6 +615,15 @@ var commentReactCommand = defineCommand({
554
615
  meta: {
555
616
  name: "react",
556
617
  description: "React to a comment (like|celebrate|support|love|insightful|funny).",
618
+ risk: "write",
619
+ rules: {
620
+ changes: "Adds your reaction to the comment.",
621
+ visible_to: "The comment's author and anyone who can see its reactions.",
622
+ budget_rows: ["post_likes"],
623
+ retry: "Reacting again replaces your reaction; it never adds a second.",
624
+ undo: "`curviate core comment unreact <post_id> <comment_id>`."
625
+ },
626
+ errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET },
557
627
  examples: [
558
628
  "curviate core comment react 7290000000000000000 COMMENT_ID insightful"
559
629
  ]
@@ -572,6 +642,15 @@ var commentUnreactCommand = defineCommand({
572
642
  meta: {
573
643
  name: "unreact",
574
644
  description: "Remove your reaction from a comment.",
645
+ risk: "write",
646
+ rules: {
647
+ changes: "Removes your reaction from the comment.",
648
+ visible_to: "The comment's author and anyone who can see its reactions.",
649
+ budget_rows: [],
650
+ retry: "A second call answers REACTION_NOT_FOUND and changes nothing.",
651
+ undo: "`curviate core comment react <post_id> <comment_id>`."
652
+ },
653
+ errors: { ...AS_ACCOUNT, ...TARGET, REACTION_NOT_FOUND: "you have no reaction on the comment." },
575
654
  examples: [
576
655
  "curviate core comment unreact 7290000000000000000 COMMENT_ID insightful"
577
656
  ]
@@ -1,19 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  sentAsNotice
4
- } from "./chunk-YFXLXION.js";
4
+ } from "./chunk-OE6YFYUM.js";
5
5
  import {
6
6
  AttachError,
7
7
  readAttachment,
8
8
  toAttachmentPayload
9
9
  } from "./chunk-5I6JJJIV.js";
10
10
  import "./chunk-UWO2D4HW.js";
11
+ import {
12
+ AS_ACCOUNT,
13
+ TARGET
14
+ } from "./chunk-UWQPX4AE.js";
11
15
  import {
12
16
  resolveIdentifier
13
17
  } from "./chunk-UEAX6KUB.js";
14
- import {
15
- requireAccount
16
- } from "./chunk-Q63IIPL2.js";
17
18
  import {
18
19
  reencodeInvitableFollowers,
19
20
  reencodeInviteTokenItem,
@@ -22,7 +23,10 @@ import {
22
23
  slimSearchJobs,
23
24
  slimSearchPeople,
24
25
  slimSearchPosts
25
- } from "./chunk-LCGXJGPB.js";
26
+ } from "./chunk-GHMRPX5H.js";
27
+ import {
28
+ requireAccount
29
+ } from "./chunk-25MO7BYN.js";
26
30
  import {
27
31
  buildPreviewOutput
28
32
  } from "./chunk-TCUYH5GO.js";
@@ -34,30 +38,32 @@ import {
34
38
  readableObject,
35
39
  readablePage,
36
40
  rejectPaginationModifiersWithoutAll,
41
+ streamAll
42
+ } from "./chunk-L4CIJT6F.js";
43
+ import {
37
44
  renderError,
38
45
  renderSuccess,
39
46
  renderUnexpectedError,
40
- resolveEffectiveConfig,
41
- streamAll,
42
47
  writeNdjsonItem
43
- } from "./chunk-MKGVNDMJ.js";
44
- import "./chunk-76SWLAZ6.js";
48
+ } from "./chunk-QM57YDJE.js";
45
49
  import {
46
- createClient
47
- } from "./chunk-OHXYFICP.js";
50
+ createClient,
51
+ resolveEffectiveConfig
52
+ } from "./chunk-YXVF5UST.js";
48
53
  import {
49
54
  GLOBAL_FLAGS,
50
55
  READ_SINGLE_FLAGS,
51
56
  WRITE_FLAGS,
52
57
  readOnly
53
- } from "./chunk-CVMSQ3OF.js";
58
+ } from "./chunk-RYWWSZUH.js";
54
59
  import {
55
60
  DESCRIPTIONS
56
- } from "./chunk-GQKC6E5K.js";
61
+ } from "./chunk-73DJ3KNE.js";
57
62
  import "./chunk-FDJMAF7D.js";
58
63
  import {
59
64
  resolveTextOrStdin
60
65
  } from "./chunk-ZYURL5VK.js";
66
+ import "./chunk-2W4RN5ON.js";
61
67
 
62
68
  // src/commands/company.ts
63
69
  import { defineCommand } from "citty";
@@ -91,7 +97,7 @@ async function resolveCompanyId(ns, raw) {
91
97
  async function handleSdkError(err, outOpts, out) {
92
98
  const { CurviateError } = await import("@curviate/sdk");
93
99
  if (err instanceof CurviateError) {
94
- const { getExitCode } = await import("./exit-codes-AW6KHDDN.js");
100
+ const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
95
101
  renderError(err, outOpts, out);
96
102
  process.exit(getExitCode(err));
97
103
  }
@@ -516,6 +522,7 @@ var companyEmployeesCommand = defineCommand({
516
522
  meta: {
517
523
  name: "employees",
518
524
  description: "List people who currently work at the company.",
525
+ risk: "read",
519
526
  examples: [
520
527
  "curviate core company employees acmecorp",
521
528
  'curviate core company employees 1234567 --keywords "machine learning"'
@@ -549,6 +556,7 @@ var companyPostsCommand = defineCommand({
549
556
  meta: {
550
557
  name: "posts",
551
558
  description: "List the company's posts.",
559
+ risk: "read",
552
560
  examples: [
553
561
  "curviate core company posts acmecorp",
554
562
  "curviate core company posts 1234567 --limit 5"
@@ -580,6 +588,7 @@ var companyJobsCommand = defineCommand({
580
588
  meta: {
581
589
  name: "jobs",
582
590
  description: "List the company's open job postings.",
591
+ risk: "read",
583
592
  examples: [
584
593
  "curviate core company jobs acmecorp",
585
594
  "curviate core company jobs 1234567 --keywords engineer"
@@ -612,6 +621,10 @@ var companyInvitableFollowersCommand = defineCommand({
612
621
  meta: {
613
622
  name: "invitable-followers",
614
623
  description: "List the account's 1st-degree connections who are eligible to be invited to follow the company page. This is the read that seeds `curviate core company follow-invite`. Items carry no name or headline (a wire limitation), so hydrate a candidate via `curviate core profile <id>` before deciding who to invite. `invite_token` is always returned as base64 (the raw value can carry binary bytes unsafe to print).",
624
+ risk: "read",
625
+ rules: {
626
+ budget_rows: ["content_poll"]
627
+ },
615
628
  examples: [
616
629
  "curviate core company invitable-followers 1234567"
617
630
  ]
@@ -642,6 +655,17 @@ var companyFollowInviteCommand = defineCommand({
642
655
  meta: {
643
656
  name: "follow-invite",
644
657
  description: "Invite the account's 1st-degree connections to follow the administered company page. Write, admin-gated (the account must administer the page with invite rights). Pass the AC... member ids from `curviate core company invitable-followers`, one --invitee per invitee. All-or-nothing: for an all-valid request you get one outcome per invitee, in request order (invited/already_invited/ineligible/not_found); if any invitee id is invalid the whole request rejects with a 404, not a partial result. Re-inviting an already-invited member is a safe no-op (the same invitation id, never a duplicate).",
658
+ risk: "high",
659
+ rules: {
660
+ changes: "Invites the chosen connections to follow the company page you administer.",
661
+ visible_to: "Each invitee, who gets the invitation from LinkedIn.",
662
+ budget_rows: [],
663
+ retry: "Safe: re-inviting a member who is already invited returns the same invitation and sends no second one.",
664
+ undo: "An invitation cannot be withdrawn from the CLI.",
665
+ blast_radius: "One invitation per --invitee, all from your Account in one call."
666
+ },
667
+ errors: { ...AS_ACCOUNT, ...TARGET, RESOURCE_ACCESS_RESTRICTED: "the Account does not administer the page." },
668
+ seeAlso: ["curviate core company invitable-followers", "curviate core company managed"],
645
669
  examples: [
646
670
  "curviate core company follow-invite 1234567 --invitee ACoAAB1cDeFgHiJkLmNoP"
647
671
  ]
@@ -651,7 +675,7 @@ var companyFollowInviteCommand = defineCommand({
651
675
  id: { type: "positional", description: "Company identifier (URL, slug, or numeric id), resolved to the numeric id first, including under --preview." },
652
676
  invitee: {
653
677
  type: "string",
654
- description: "AC... member id to invite (from `curviate core company invitable-followers`). Repeatable, at least one required, max 50 per request.",
678
+ description: "AC... member id to invite (from `curviate core company invitable-followers`). Repeatable, at least one required.",
655
679
  required: true
656
680
  }
657
681
  },
@@ -677,6 +701,7 @@ var companyManagedCommand = defineCommand({
677
701
  meta: {
678
702
  name: "managed",
679
703
  description: "List the company pages the connected account administers. An empty result is valid, the account administers no pages.",
704
+ risk: "read",
680
705
  examples: [
681
706
  "curviate core company managed"
682
707
  ]
@@ -704,6 +729,10 @@ var companyFollowersCommand = defineCommand({
704
729
  meta: {
705
730
  name: "followers",
706
731
  description: "List a company page's followers, newest first. Admin-gated: the account must administer the page (see `curviate core company managed`).",
732
+ risk: "read",
733
+ rules: {
734
+ budget_rows: ["content_poll"]
735
+ },
707
736
  examples: [
708
737
  "curviate core company followers 1234567",
709
738
  "curviate core company followers 1234567 --all"
@@ -735,6 +764,7 @@ var companyChatsCommand = defineCommand({
735
764
  meta: {
736
765
  name: "chats",
737
766
  description: "List the conversations in a company page's admin message inbox, newest-activity-first. Admin-gated. Beta.",
767
+ risk: "read",
738
768
  examples: [
739
769
  "curviate core company chats 1234567"
740
770
  ]
@@ -765,6 +795,7 @@ var companyChatCommand = defineCommand({
765
795
  meta: {
766
796
  name: "chat",
767
797
  description: "Retrieve one conversation from a company page's admin inbox. Admin-gated.",
798
+ risk: "read",
768
799
  examples: [
769
800
  "curviate core company chat 1234567 2-YTQ3ODU3Njgt"
770
801
  ]
@@ -796,6 +827,7 @@ var companyMessagesCommand = defineCommand({
796
827
  meta: {
797
828
  name: "messages",
798
829
  description: "List a company-inbox conversation's messages, newest first. Admin-gated.",
830
+ risk: "read",
799
831
  examples: [
800
832
  "curviate core company messages 1234567 2-YTQ3ODU3Njgt"
801
833
  ]
@@ -827,6 +859,7 @@ var companyMessageCommand = defineCommand({
827
859
  meta: {
828
860
  name: "message",
829
861
  description: "Retrieve one message from a company-inbox conversation. Admin-gated. See also: `curviate core company reply` (send).",
862
+ risk: "read",
830
863
  examples: [
831
864
  "curviate core company message 1234567 2-YTQ3ODU3Njgt MSG_ID"
832
865
  ]
@@ -859,6 +892,10 @@ var companySearchChatsCommand = defineCommand({
859
892
  meta: {
860
893
  name: "search-chats",
861
894
  description: "Search or filter a company page's admin inbox. Exactly one mode per call: free-text <query>, --topic, or --unread; mutually exclusive, enforced server-side. Admin-gated. Beta.",
895
+ risk: "read",
896
+ rules: {
897
+ budget_rows: ["search"]
898
+ },
862
899
  examples: [
863
900
  "curviate core company search-chats 1234567 sophie",
864
901
  "curviate core company search-chats 1234567 sophie --unread"
@@ -893,6 +930,15 @@ var companyReplyCommand = defineCommand({
893
930
  meta: {
894
931
  name: "reply",
895
932
  description: "Reply to a company-inbox conversation, as the page (write, admin-gated: the account must administer the page). Takes the normal 2-... chat id from `curviate core company chats`; the endpoint resolves the page mailbox internally from the company id. Reply-only, this cannot start a new conversation on the page's behalf. See also: `curviate core company chats` (the read that returns the chat id) and `curviate core message send` (the personal equivalent).",
933
+ risk: "write",
934
+ rules: {
935
+ changes: "Sends a reply in a company-inbox conversation, as the page.",
936
+ visible_to: "The person in the conversation, as the page.",
937
+ budget_rows: [],
938
+ retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core company messages <company_id> <chat_id>` first.",
939
+ undo: "Cannot be undone from the CLI: delete the message on LinkedIn."
940
+ },
941
+ errors: { ...AS_ACCOUNT, ...TARGET, RESOURCE_ACCESS_RESTRICTED: "the Account does not administer the page." },
896
942
  examples: [
897
943
  'curviate core company reply 1234567 2-YTQ3ODU3Njgt "Thanks for reaching out, happy to help."'
898
944
  ]
@@ -929,6 +975,10 @@ var companyCommand = defineCommand({
929
975
  meta: {
930
976
  name: "company",
931
977
  description: DESCRIPTIONS.company,
978
+ risk: "read",
979
+ rules: {
980
+ budget_rows: ["content_poll"]
981
+ },
932
982
  examples: [
933
983
  "curviate core company acmecorp",
934
984
  "curviate core company https://www.linkedin.com/company/acmecorp"