@curviate/cli 0.22.0 → 0.23.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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-QJZ3LWOX.js";
4
+ } from "./chunk-RJTG5YWE.js";
5
5
  import {
6
6
  AttachError,
7
7
  readAttachment,
@@ -11,7 +11,10 @@ import {
11
11
  pageDelayFromFlags,
12
12
  streamAll
13
13
  } from "./chunk-H6XD3F66.js";
14
- import "./chunk-DMQZEPQE.js";
14
+ import "./chunk-UEAX6KUB.js";
15
+ import {
16
+ requireAccount
17
+ } from "./chunk-3BO6GVS2.js";
15
18
  import {
16
19
  buildPreviewOutput
17
20
  } from "./chunk-R3VLWLVV.js";
@@ -30,6 +33,7 @@ import {
30
33
  import {
31
34
  resolveTextOrStdin
32
35
  } from "./chunk-ZYURL5VK.js";
36
+ import "./chunk-PMRQXBCP.js";
33
37
 
34
38
  // src/commands/post.ts
35
39
  import { defineCommand } from "citty";
@@ -40,13 +44,6 @@ function buildOutputStreams() {
40
44
  stderr: { write: (s) => process.stderr.write(s) }
41
45
  };
42
46
  }
43
- function requireAccount(account, out) {
44
- if (!account) {
45
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
46
- process.exit(2);
47
- }
48
- return account;
49
- }
50
47
  function rejectPreviewOnRead(preview, out) {
51
48
  if (preview) {
52
49
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -89,7 +86,7 @@ async function handleSdkError(err, outOpts, out) {
89
86
  async function runPostGet(client, flags, out) {
90
87
  rejectPreviewOnRead(flags.preview, out);
91
88
  rejectAllOnNonPaginated(flags.all, out);
92
- const accountId = requireAccount(flags.account, out);
89
+ const accountId = await requireAccount(client, flags, out);
93
90
  const postId = flags.postId ?? "";
94
91
  const ns = client.account(accountId);
95
92
  const outOpts = resolveOutputOpts(flags);
@@ -101,7 +98,7 @@ async function runPostGet(client, flags, out) {
101
98
  }
102
99
  }
103
100
  async function runPostCreate(client, flags, out, _readStdin) {
104
- const accountId = requireAccount(flags.account, out);
101
+ const accountId = await requireAccount(client, flags, out);
105
102
  const rawText = flags.text ?? "";
106
103
  const attachPaths = normalizeAttachPaths(flags.attach);
107
104
  const text = await resolveTextOrStdin(rawText, out, _readStdin);
@@ -146,7 +143,7 @@ async function runPostCreate(client, flags, out, _readStdin) {
146
143
  }
147
144
  }
148
145
  async function runPostReact(client, flags, out) {
149
- const accountId = requireAccount(flags.account, out);
146
+ const accountId = await requireAccount(client, flags, out);
150
147
  const postId = flags.postId ?? "";
151
148
  const reaction = flags.reaction ?? flags.reactionAlias ?? "";
152
149
  if (!VALID_REACTIONS.has(reaction)) {
@@ -183,7 +180,7 @@ async function runPostReact(client, flags, out) {
183
180
  }
184
181
  async function runPostReactions(client, flags, out) {
185
182
  rejectPreviewOnRead(flags.preview, out);
186
- const accountId = requireAccount(flags.account, out);
183
+ const accountId = await requireAccount(client, flags, out);
187
184
  const postId = flags.postId ?? "";
188
185
  const ns = client.account(accountId);
189
186
  const outOpts = resolveOutputOpts(flags);
@@ -210,7 +207,7 @@ async function runPostReactions(client, flags, out) {
210
207
  }
211
208
  async function runPostSaved(client, flags, out) {
212
209
  rejectPreviewOnRead(flags.preview, out);
213
- const accountId = requireAccount(flags.account, out);
210
+ const accountId = await requireAccount(client, flags, out);
214
211
  const ns = client.account(accountId);
215
212
  const outOpts = resolveOutputOpts(flags);
216
213
  const all = flags.all ?? false;
@@ -235,7 +232,7 @@ async function runPostSaved(client, flags, out) {
235
232
  }
236
233
  }
237
234
  async function runPostSave(client, flags, out) {
238
- const accountId = requireAccount(flags.account, out);
235
+ const accountId = await requireAccount(client, flags, out);
239
236
  const postId = flags.postId ?? "";
240
237
  if (flags.preview) {
241
238
  const preview = buildPreviewOutput({ method: "posts.save", args: { post_id: postId }, body: {}, account: accountId });
@@ -252,7 +249,7 @@ async function runPostSave(client, flags, out) {
252
249
  }
253
250
  }
254
251
  async function runPostUnsave(client, flags, out) {
255
- const accountId = requireAccount(flags.account, out);
252
+ const accountId = await requireAccount(client, flags, out);
256
253
  const postId = flags.postId ?? "";
257
254
  if (flags.preview) {
258
255
  const preview = buildPreviewOutput({ method: "posts.unsave", args: { post_id: postId }, body: {}, account: accountId });
@@ -269,7 +266,7 @@ async function runPostUnsave(client, flags, out) {
269
266
  }
270
267
  }
271
268
  async function runPostDelete(client, flags, out) {
272
- const accountId = requireAccount(flags.account, out);
269
+ const accountId = await requireAccount(client, flags, out);
273
270
  const postId = flags.postId ?? "";
274
271
  if (flags.preview) {
275
272
  const preview = buildPreviewOutput({ method: "posts.delete", args: { post_id: postId }, body: {}, account: accountId });
@@ -286,7 +283,7 @@ async function runPostDelete(client, flags, out) {
286
283
  }
287
284
  }
288
285
  async function runPostUnreact(client, flags, out) {
289
- const accountId = requireAccount(flags.account, out);
286
+ const accountId = await requireAccount(client, flags, out);
290
287
  const postId = flags.postId ?? "";
291
288
  const reaction = flags.reaction ?? "";
292
289
  if (!VALID_REACTIONS.has(reaction)) {
@@ -316,7 +313,7 @@ async function runPostUnreact(client, flags, out) {
316
313
  }
317
314
  async function runPostUserPosts(client, flags, out) {
318
315
  rejectPreviewOnRead(flags.preview, out);
319
- const accountId = requireAccount(flags.account, out);
316
+ const accountId = await requireAccount(client, flags, out);
320
317
  const ns = client.account(accountId);
321
318
  const outOpts = resolveOutputOpts(flags);
322
319
  let userId;
@@ -349,7 +346,7 @@ async function runPostUserPosts(client, flags, out) {
349
346
  }
350
347
  async function runPostUserReactions(client, flags, out) {
351
348
  rejectPreviewOnRead(flags.preview, out);
352
- const accountId = requireAccount(flags.account, out);
349
+ const accountId = await requireAccount(client, flags, out);
353
350
  const ns = client.account(accountId);
354
351
  const outOpts = resolveOutputOpts(flags);
355
352
  let userId;
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  resolveMemberOrMeProviderId,
4
4
  resolveMemberProviderId
5
- } from "./chunk-QJZ3LWOX.js";
5
+ } from "./chunk-RJTG5YWE.js";
6
6
  import {
7
7
  AttachError,
8
8
  readAttachment,
@@ -18,7 +18,10 @@ import {
18
18
  } from "./chunk-H6XD3F66.js";
19
19
  import {
20
20
  resolveIdentifier
21
- } from "./chunk-DMQZEPQE.js";
21
+ } from "./chunk-UEAX6KUB.js";
22
+ import {
23
+ requireAccount
24
+ } from "./chunk-3BO6GVS2.js";
22
25
  import {
23
26
  buildPreviewOutput
24
27
  } from "./chunk-R3VLWLVV.js";
@@ -35,6 +38,7 @@ import {
35
38
  WRITE_SINGLE_FLAGS
36
39
  } from "./chunk-CUTMZWL6.js";
37
40
  import "./chunk-ZYURL5VK.js";
41
+ import "./chunk-PMRQXBCP.js";
38
42
 
39
43
  // src/commands/profile.ts
40
44
  import { defineCommand } from "citty";
@@ -77,13 +81,6 @@ function parseSectionsFlag(raw) {
77
81
  }
78
82
 
79
83
  // src/commands/profile.ts
80
- function requireAccount(account, out) {
81
- if (!account) {
82
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
83
- process.exit(2);
84
- }
85
- return account;
86
- }
87
84
  function rejectPreviewOnRead(preview, out) {
88
85
  if (preview) {
89
86
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -121,7 +118,7 @@ async function runProfileMe(client, flags, out) {
121
118
  process.exit(2);
122
119
  return;
123
120
  }
124
- const accountId = requireAccount(flags.account, out);
121
+ const accountId = await requireAccount(client, flags, out);
125
122
  const ns = client.account(accountId);
126
123
  const outOpts = resolveOutputOpts(flags);
127
124
  if (hasActivityFlag) {
@@ -243,7 +240,7 @@ async function runProfileGet(client, flags, out) {
243
240
  }
244
241
  parsedSections = result.sections;
245
242
  }
246
- const accountId = requireAccount(flags.account, out);
243
+ const accountId = await requireAccount(client, flags, out);
247
244
  const rawId = flags.id ?? "";
248
245
  const resolvedId = resolveIdentifier(rawId);
249
246
  const ns = client.account(accountId);
@@ -353,7 +350,7 @@ async function runProfileGet(client, flags, out) {
353
350
  }
354
351
  async function runProfileRelations(client, flags, out) {
355
352
  rejectPreviewOnRead(flags.preview, out);
356
- const accountId = requireAccount(flags.account, out);
353
+ const accountId = await requireAccount(client, flags, out);
357
354
  const ns = client.account(accountId);
358
355
  const outOpts = resolveOutputOpts(flags);
359
356
  const all = flags.all ?? false;
@@ -389,7 +386,7 @@ async function runProfileRelations(client, flags, out) {
389
386
  }
390
387
  }
391
388
  async function runProfileEndorse(client, flags, out) {
392
- const accountId = requireAccount(flags.account, out);
389
+ const accountId = await requireAccount(client, flags, out);
393
390
  const ns = client.account(accountId);
394
391
  const skillId = flags["endorsement-id"] ?? "";
395
392
  const outOpts = resolveOutputOpts(flags);
@@ -430,7 +427,7 @@ async function handleSdkError(err, outOpts, out) {
430
427
  async function runProfileSubscription(client, flags, out) {
431
428
  rejectPreviewOnRead(flags.preview, out);
432
429
  rejectAllOnNonPaginated(flags.all, out);
433
- const accountId = requireAccount(flags.account, out);
430
+ const accountId = await requireAccount(client, flags, out);
434
431
  const ns = client.account(accountId);
435
432
  const outOpts = resolveOutputOpts(flags);
436
433
  try {
@@ -443,7 +440,7 @@ async function runProfileSubscription(client, flags, out) {
443
440
  async function runProfileAnalytics(client, flags, out) {
444
441
  rejectPreviewOnRead(flags.preview, out);
445
442
  rejectAllOnNonPaginated(flags.all, out);
446
- const accountId = requireAccount(flags.account, out);
443
+ const accountId = await requireAccount(client, flags, out);
447
444
  const ns = client.account(accountId);
448
445
  const outOpts = resolveOutputOpts(flags);
449
446
  try {
@@ -455,7 +452,7 @@ async function runProfileAnalytics(client, flags, out) {
455
452
  }
456
453
  async function runProfileVisitors(client, flags, out) {
457
454
  rejectPreviewOnRead(flags.preview, out);
458
- const accountId = requireAccount(flags.account, out);
455
+ const accountId = await requireAccount(client, flags, out);
459
456
  const ns = client.account(accountId);
460
457
  const outOpts = resolveOutputOpts(flags);
461
458
  const all = flags.all ?? false;
@@ -486,7 +483,7 @@ async function runProfileVisitors(client, flags, out) {
486
483
  async function runProfileSsi(client, flags, out) {
487
484
  rejectPreviewOnRead(flags.preview, out);
488
485
  rejectAllOnNonPaginated(flags.all, out);
489
- const accountId = requireAccount(flags.account, out);
486
+ const accountId = await requireAccount(client, flags, out);
490
487
  const ns = client.account(accountId);
491
488
  const outOpts = resolveOutputOpts(flags);
492
489
  try {
@@ -497,7 +494,7 @@ async function runProfileSsi(client, flags, out) {
497
494
  }
498
495
  }
499
496
  async function runProfileUpdate(client, flags, out) {
500
- const accountId = requireAccount(flags.account, out);
497
+ const accountId = await requireAccount(client, flags, out);
501
498
  const body = {};
502
499
  if (flags["first-name"]) body.first_name = flags["first-name"];
503
500
  if (flags["last-name"]) body.last_name = flags["last-name"];
@@ -545,7 +542,7 @@ async function runProfileUpdate(client, flags, out) {
545
542
  }
546
543
  }
547
544
  async function runProfileFollow(client, flags, out) {
548
- const accountId = requireAccount(flags.account, out);
545
+ const accountId = await requireAccount(client, flags, out);
549
546
  const ns = client.account(accountId);
550
547
  const outOpts = resolveOutputOpts(flags);
551
548
  let providerId;
@@ -568,7 +565,7 @@ async function runProfileFollow(client, flags, out) {
568
565
  }
569
566
  }
570
567
  async function runProfileUnfollow(client, flags, out) {
571
- const accountId = requireAccount(flags.account, out);
568
+ const accountId = await requireAccount(client, flags, out);
572
569
  const ns = client.account(accountId);
573
570
  const outOpts = resolveOutputOpts(flags);
574
571
  let providerId;
@@ -592,7 +589,7 @@ async function runProfileUnfollow(client, flags, out) {
592
589
  }
593
590
  async function runProfileFollowers(client, flags, out) {
594
591
  rejectPreviewOnRead(flags.preview, out);
595
- const accountId = requireAccount(flags.account, out);
592
+ const accountId = await requireAccount(client, flags, out);
596
593
  const resolvedId = resolveIdentifier(flags.id ?? "");
597
594
  const ns = client.account(accountId);
598
595
  const outOpts = resolveOutputOpts(flags);
@@ -621,7 +618,7 @@ async function runProfileFollowers(client, flags, out) {
621
618
  }
622
619
  async function runProfileFollowing(client, flags, out) {
623
620
  rejectPreviewOnRead(flags.preview, out);
624
- const accountId = requireAccount(flags.account, out);
621
+ const accountId = await requireAccount(client, flags, out);
625
622
  const resolvedId = resolveIdentifier(flags.id ?? "");
626
623
  const ns = client.account(accountId);
627
624
  const outOpts = resolveOutputOpts(flags);
@@ -23,7 +23,10 @@ import {
23
23
  import {
24
24
  resolveIdentifier,
25
25
  resolveJobIdentifier
26
- } from "./chunk-DMQZEPQE.js";
26
+ } from "./chunk-UEAX6KUB.js";
27
+ import {
28
+ requireAccount
29
+ } from "./chunk-3BO6GVS2.js";
27
30
  import {
28
31
  buildPreviewOutput
29
32
  } from "./chunk-R3VLWLVV.js";
@@ -43,6 +46,7 @@ import {
43
46
  import {
44
47
  isStdinToken
45
48
  } from "./chunk-ZYURL5VK.js";
49
+ import "./chunk-PMRQXBCP.js";
46
50
 
47
51
  // src/commands/recruiter.ts
48
52
  import { defineCommand } from "citty";
@@ -53,13 +57,6 @@ function buildOutputStreams() {
53
57
  stderr: { write: (s) => process.stderr.write(s) }
54
58
  };
55
59
  }
56
- function requireAccount(account, out) {
57
- if (!account) {
58
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
59
- process.exit(2);
60
- }
61
- return account;
62
- }
63
60
  function rejectPreviewOnRead(preview, out) {
64
61
  if (preview) {
65
62
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -183,7 +180,7 @@ function requireRecruiterJobFields(body, extra, out) {
183
180
  }
184
181
  }
185
182
  async function runRecruiterMessageNew(client, flags, out) {
186
- const accountId = requireAccount(flags.account, out);
183
+ const accountId = await requireAccount(client, flags, out);
187
184
  const to = flags.to ?? "";
188
185
  const text = flags.text ?? "";
189
186
  const subject = flags.subject ?? "";
@@ -255,7 +252,7 @@ async function runRecruiterMessageNew(client, flags, out) {
255
252
  }
256
253
  async function runRecruiterProfile(client, flags, out) {
257
254
  rejectPreviewOnRead(flags.preview, out);
258
- const accountId = requireAccount(flags.account, out);
255
+ const accountId = await requireAccount(client, flags, out);
259
256
  const rawId = flags.identifier ?? "";
260
257
  const resolvedId = resolveIdentifier(rawId);
261
258
  const ns = client.account(accountId);
@@ -269,7 +266,7 @@ async function runRecruiterProfile(client, flags, out) {
269
266
  }
270
267
  async function runRecruiterSearchPeople(client, flags, out, readers = DEFAULT_FILTER_READERS) {
271
268
  rejectPreviewOnRead(flags.preview, out);
272
- const accountId = requireAccount(flags.account, out);
269
+ const accountId = await requireAccount(client, flags, out);
273
270
  const ns = client.account(accountId);
274
271
  const outOpts = resolveOutputOpts(flags);
275
272
  const all = flags.all ?? false;
@@ -327,7 +324,7 @@ async function runRecruiterSearchParameters(client, flags, out) {
327
324
  out.stderr.write("error: --type is required.\n");
328
325
  process.exit(2);
329
326
  }
330
- const accountId = requireAccount(flags.account, out);
327
+ const accountId = await requireAccount(client, flags, out);
331
328
  const ns = client.account(accountId);
332
329
  const outOpts = resolveOutputOpts(flags);
333
330
  const body = {
@@ -348,7 +345,7 @@ async function runRecruiterSearchParameters(client, flags, out) {
348
345
  }
349
346
  async function runRecruiterSearchFromUrl(client, flags, out) {
350
347
  rejectPreviewOnRead(flags.preview, out);
351
- const accountId = requireAccount(flags.account, out);
348
+ const accountId = await requireAccount(client, flags, out);
352
349
  const url = flags.url ?? "";
353
350
  const ns = client.account(accountId);
354
351
  const outOpts = resolveOutputOpts(flags);
@@ -387,7 +384,7 @@ async function runRecruiterSearchFromUrl(client, flags, out) {
387
384
  }
388
385
  async function runRecruiterListProjects(client, flags, out) {
389
386
  rejectPreviewOnRead(flags.preview, out);
390
- const accountId = requireAccount(flags.account, out);
387
+ const accountId = await requireAccount(client, flags, out);
391
388
  const ns = client.account(accountId);
392
389
  const outOpts = resolveOutputOpts(flags);
393
390
  const all = flags.all ?? false;
@@ -417,7 +414,7 @@ async function runRecruiterListProjects(client, flags, out) {
417
414
  }
418
415
  async function runRecruiterGetProject(client, flags, out) {
419
416
  rejectPreviewOnRead(flags.preview, out);
420
- const accountId = requireAccount(flags.account, out);
417
+ const accountId = await requireAccount(client, flags, out);
421
418
  const projectId = flags.projectId ?? "";
422
419
  const ns = client.account(accountId);
423
420
  const outOpts = resolveOutputOpts(flags);
@@ -429,7 +426,7 @@ async function runRecruiterGetProject(client, flags, out) {
429
426
  }
430
427
  }
431
428
  async function runRecruiterUpdateProject(client, flags, out) {
432
- const accountId = requireAccount(flags.account, out);
429
+ const accountId = await requireAccount(client, flags, out);
433
430
  const projectId = flags.projectId ?? "";
434
431
  const outOpts = resolveOutputOpts(flags);
435
432
  const body = {};
@@ -466,7 +463,7 @@ async function runRecruiterUpdateProject(client, flags, out) {
466
463
  }
467
464
  async function runRecruiterListPipeline(client, flags, out) {
468
465
  rejectPreviewOnRead(flags.preview, out);
469
- const accountId = requireAccount(flags.account, out);
466
+ const accountId = await requireAccount(client, flags, out);
470
467
  const projectId = flags.projectId ?? "";
471
468
  const ns = client.account(accountId);
472
469
  const outOpts = resolveOutputOpts(flags);
@@ -513,7 +510,7 @@ async function runRecruiterListPipeline(client, flags, out) {
513
510
  }
514
511
  async function runRecruiterGetProjectJob(client, flags, out) {
515
512
  rejectPreviewOnRead(flags.preview, out);
516
- const accountId = requireAccount(flags.account, out);
513
+ const accountId = await requireAccount(client, flags, out);
517
514
  const projectId = flags.projectId ?? "";
518
515
  const ns = client.account(accountId);
519
516
  const outOpts = resolveOutputOpts(flags);
@@ -526,7 +523,7 @@ async function runRecruiterGetProjectJob(client, flags, out) {
526
523
  }
527
524
  async function runRecruiterGetProjectJobBudget(client, flags, out) {
528
525
  rejectPreviewOnRead(flags.preview, out);
529
- const accountId = requireAccount(flags.account, out);
526
+ const accountId = await requireAccount(client, flags, out);
530
527
  const projectId = flags.projectId ?? "";
531
528
  const jobId = flags.jobId ?? "";
532
529
  const ns = client.account(accountId);
@@ -539,7 +536,7 @@ async function runRecruiterGetProjectJobBudget(client, flags, out) {
539
536
  }
540
537
  }
541
538
  async function runRecruiterSaveCandidate(client, flags, out) {
542
- const accountId = requireAccount(flags.account, out);
539
+ const accountId = await requireAccount(client, flags, out);
543
540
  const projectId = flags.projectId ?? "";
544
541
  const outOpts = resolveOutputOpts(flags);
545
542
  const body = {
@@ -566,7 +563,7 @@ async function runRecruiterSaveCandidate(client, flags, out) {
566
563
  }
567
564
  async function runRecruiterListJobs(client, flags, out) {
568
565
  rejectPreviewOnRead(flags.preview, out);
569
- const accountId = requireAccount(flags.account, out);
566
+ const accountId = await requireAccount(client, flags, out);
570
567
  const ns = client.account(accountId);
571
568
  const outOpts = resolveOutputOpts(flags);
572
569
  const all = flags.all ?? false;
@@ -595,7 +592,7 @@ async function runRecruiterListJobs(client, flags, out) {
595
592
  }
596
593
  }
597
594
  async function runRecruiterCreateJob(client, flags, out, readers = DEFAULT_JOB_CREATE_READERS) {
598
- const accountId = requireAccount(flags.account, out);
595
+ const accountId = await requireAccount(client, flags, out);
599
596
  const outOpts = resolveOutputOpts(flags);
600
597
  const assembled = await assembleRecruiterJobBody(flags, readers);
601
598
  if ("error" in assembled) {
@@ -624,7 +621,7 @@ async function runRecruiterCreateJob(client, flags, out, readers = DEFAULT_JOB_C
624
621
  }
625
622
  }
626
623
  async function runRecruiterCreateProjectJob(client, flags, out, readers = DEFAULT_JOB_CREATE_READERS) {
627
- const accountId = requireAccount(flags.account, out);
624
+ const accountId = await requireAccount(client, flags, out);
628
625
  const projectId = flags.projectId ?? "";
629
626
  const outOpts = resolveOutputOpts(flags);
630
627
  const assembled = await assembleRecruiterJobBody(flags, readers);
@@ -654,7 +651,7 @@ async function runRecruiterCreateProjectJob(client, flags, out, readers = DEFAUL
654
651
  }
655
652
  }
656
653
  async function runRecruiterUpdateProjectJob(client, flags, out, readers = DEFAULT_JOB_CREATE_READERS) {
657
- const accountId = requireAccount(flags.account, out);
654
+ const accountId = await requireAccount(client, flags, out);
658
655
  const projectId = flags.projectId ?? "";
659
656
  const jobId = flags.jobId ?? "";
660
657
  const outOpts = resolveOutputOpts(flags);
@@ -686,7 +683,7 @@ async function runRecruiterUpdateProjectJob(client, flags, out, readers = DEFAUL
686
683
  var RECRUITER_PUBLISH_MODES = ["FREE", "PROMOTED", "PROMOTED_PLUS"];
687
684
  var RECRUITER_BUDGET_SCOPES = ["DAILY", "TOTAL"];
688
685
  async function runRecruiterPublishJob(client, flags, out) {
689
- const accountId = requireAccount(flags.account, out);
686
+ const accountId = await requireAccount(client, flags, out);
690
687
  const projectId = flags.projectId ?? "";
691
688
  const jobId = flags.jobId ?? "";
692
689
  const outOpts = resolveOutputOpts(flags);
@@ -745,7 +742,7 @@ async function runRecruiterPublishJob(client, flags, out) {
745
742
  }
746
743
  }
747
744
  async function runRecruiterCloseJob(client, flags, out) {
748
- const accountId = requireAccount(flags.account, out);
745
+ const accountId = await requireAccount(client, flags, out);
749
746
  const projectId = flags.projectId ?? "";
750
747
  const jobId = flags.jobId ?? "";
751
748
  if (flags.preview) {
@@ -773,7 +770,7 @@ async function runRecruiterSearchTalentPool(client, flags, out, readers = DEFAUL
773
770
  out.stderr.write("error: --channel-id is required.\n");
774
771
  process.exit(2);
775
772
  }
776
- const accountId = requireAccount(flags.account, out);
773
+ const accountId = await requireAccount(client, flags, out);
777
774
  const projectId = flags.projectId ?? "";
778
775
  const ns = client.account(accountId);
779
776
  const outOpts = resolveOutputOpts(flags);
@@ -824,7 +821,7 @@ async function runRecruiterListApplicants(client, flags, out) {
824
821
  out.stderr.write("error: --channel-id is required.\n");
825
822
  process.exit(2);
826
823
  }
827
- const accountId = requireAccount(flags.account, out);
824
+ const accountId = await requireAccount(client, flags, out);
828
825
  const projectId = flags.projectId ?? "";
829
826
  const ns = client.account(accountId);
830
827
  const outOpts = resolveOutputOpts(flags);
@@ -841,7 +838,7 @@ async function runRecruiterListApplicants(client, flags, out) {
841
838
  }
842
839
  async function runRecruiterGetJob(client, flags, out) {
843
840
  rejectPreviewOnRead(flags.preview, out);
844
- const accountId = requireAccount(flags.account, out);
841
+ const accountId = await requireAccount(client, flags, out);
845
842
  const rawJobId = flags.jobId ?? "";
846
843
  const jobId = resolveJobIdentifier(rawJobId);
847
844
  const ns = client.account(accountId);
@@ -855,7 +852,7 @@ async function runRecruiterGetJob(client, flags, out) {
855
852
  }
856
853
  async function runRecruiterGetApplicant(client, flags, out) {
857
854
  rejectPreviewOnRead(flags.preview, out);
858
- const accountId = requireAccount(flags.account, out);
855
+ const accountId = await requireAccount(client, flags, out);
859
856
  const projectId = flags.projectId ?? "";
860
857
  const applicantId = flags.applicantId ?? "";
861
858
  const ns = client.account(accountId);
@@ -869,7 +866,7 @@ async function runRecruiterGetApplicant(client, flags, out) {
869
866
  }
870
867
  async function runRecruiterDownloadResume(client, flags, out, isTTY) {
871
868
  rejectPreviewOnRead(flags.preview, out);
872
- const accountId = requireAccount(flags.account, out);
869
+ const accountId = await requireAccount(client, flags, out);
873
870
  const projectId = flags.projectId ?? "";
874
871
  const applicantId = flags.applicantId ?? "";
875
872
  const ns = client.account(accountId);
@@ -16,7 +16,10 @@ import {
16
16
  } from "./chunk-H6XD3F66.js";
17
17
  import {
18
18
  resolveIdentifier
19
- } from "./chunk-DMQZEPQE.js";
19
+ } from "./chunk-UEAX6KUB.js";
20
+ import {
21
+ requireAccount
22
+ } from "./chunk-3BO6GVS2.js";
20
23
  import {
21
24
  buildPreviewOutput
22
25
  } from "./chunk-R3VLWLVV.js";
@@ -33,6 +36,7 @@ import {
33
36
  WRITE_FLAGS
34
37
  } from "./chunk-CUTMZWL6.js";
35
38
  import "./chunk-ZYURL5VK.js";
39
+ import "./chunk-PMRQXBCP.js";
36
40
 
37
41
  // src/commands/sales-nav.ts
38
42
  import { defineCommand } from "citty";
@@ -42,13 +46,6 @@ function buildOutputStreams() {
42
46
  stderr: { write: (s) => process.stderr.write(s) }
43
47
  };
44
48
  }
45
- function requireAccount(account, out) {
46
- if (!account) {
47
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
48
- process.exit(2);
49
- }
50
- return account;
51
- }
52
49
  function rejectPreviewOnRead(preview, out) {
53
50
  if (preview) {
54
51
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -78,7 +75,7 @@ async function handleSdkError(err, outOpts, out) {
78
75
  }
79
76
  async function runSalesNavSearchPeople(client, flags, out, readers = DEFAULT_FILTER_READERS) {
80
77
  rejectPreviewOnRead(flags.preview, out);
81
- const accountId = requireAccount(flags.account, out);
78
+ const accountId = await requireAccount(client, flags, out);
82
79
  const ns = client.account(accountId);
83
80
  const outOpts = resolveOutputOpts(flags);
84
81
  const all = flags.all ?? false;
@@ -128,7 +125,7 @@ async function runSalesNavSearchPeople(client, flags, out, readers = DEFAULT_FIL
128
125
  }
129
126
  async function runSalesNavSearchCompanies(client, flags, out, readers = DEFAULT_FILTER_READERS) {
130
127
  rejectPreviewOnRead(flags.preview, out);
131
- const accountId = requireAccount(flags.account, out);
128
+ const accountId = await requireAccount(client, flags, out);
132
129
  const ns = client.account(accountId);
133
130
  const outOpts = resolveOutputOpts(flags);
134
131
  const all = flags.all ?? false;
@@ -181,7 +178,7 @@ async function runSalesNavGetParameters(client, flags, out) {
181
178
  out.stderr.write("error: --type is required.\n");
182
179
  process.exit(2);
183
180
  }
184
- const accountId = requireAccount(flags.account, out);
181
+ const accountId = await requireAccount(client, flags, out);
185
182
  const ns = client.account(accountId);
186
183
  const outOpts = resolveOutputOpts(flags);
187
184
  const params = { type: flags.type };
@@ -196,7 +193,7 @@ async function runSalesNavGetParameters(client, flags, out) {
196
193
  }
197
194
  async function runSalesNavSearchFromUrl(client, flags, out) {
198
195
  rejectPreviewOnRead(flags.preview, out);
199
- const accountId = requireAccount(flags.account, out);
196
+ const accountId = await requireAccount(client, flags, out);
200
197
  const url = flags.url ?? "";
201
198
  const ns = client.account(accountId);
202
199
  const outOpts = resolveOutputOpts(flags);
@@ -234,7 +231,7 @@ async function runSalesNavSearchFromUrl(client, flags, out) {
234
231
  }
235
232
  }
236
233
  async function runSalesNavMessageNew(client, flags, out) {
237
- const accountId = requireAccount(flags.account, out);
234
+ const accountId = await requireAccount(client, flags, out);
238
235
  const to = flags.to ?? "";
239
236
  const text = flags.text ?? "";
240
237
  const subject = flags.subject ?? "";
@@ -300,7 +297,7 @@ async function runSalesNavMessageNew(client, flags, out) {
300
297
  }
301
298
  async function runSalesNavProfile(client, flags, out) {
302
299
  rejectPreviewOnRead(flags.preview, out);
303
- const accountId = requireAccount(flags.account, out);
300
+ const accountId = await requireAccount(client, flags, out);
304
301
  const rawId = flags.identifier ?? "";
305
302
  const resolvedId = resolveIdentifier(rawId);
306
303
  const ns = client.account(accountId);
@@ -313,7 +310,7 @@ async function runSalesNavProfile(client, flags, out) {
313
310
  }
314
311
  }
315
312
  async function runSalesNavSaveLead(client, flags, out) {
316
- const accountId = requireAccount(flags.account, out);
313
+ const accountId = await requireAccount(client, flags, out);
317
314
  const userId = flags.userId ?? "";
318
315
  const listId = flags.list ?? "";
319
316
  const outOpts = resolveOutputOpts(flags);
@@ -338,7 +335,7 @@ async function runSalesNavSaveLead(client, flags, out) {
338
335
  }
339
336
  async function runSalesNavAccountLists(client, flags, out) {
340
337
  rejectPreviewOnRead(flags.preview, out);
341
- const accountId = requireAccount(flags.account, out);
338
+ const accountId = await requireAccount(client, flags, out);
342
339
  const ns = client.account(accountId);
343
340
  const outOpts = resolveOutputOpts(flags);
344
341
  const all = flags.all ?? false;
@@ -366,7 +363,7 @@ async function runSalesNavAccountLists(client, flags, out) {
366
363
  }
367
364
  async function runSalesNavLeadLists(client, flags, out) {
368
365
  rejectPreviewOnRead(flags.preview, out);
369
- const accountId = requireAccount(flags.account, out);
366
+ const accountId = await requireAccount(client, flags, out);
370
367
  const ns = client.account(accountId);
371
368
  const outOpts = resolveOutputOpts(flags);
372
369
  const all = flags.all ?? false;
@@ -394,7 +391,7 @@ async function runSalesNavLeadLists(client, flags, out) {
394
391
  }
395
392
  async function runSalesNavBrowseAccountList(client, flags, out) {
396
393
  rejectPreviewOnRead(flags.preview, out);
397
- const accountId = requireAccount(flags.account, out);
394
+ const accountId = await requireAccount(client, flags, out);
398
395
  const listId = flags.listId ?? "";
399
396
  const ns = client.account(accountId);
400
397
  const outOpts = resolveOutputOpts(flags);
@@ -427,7 +424,7 @@ async function runSalesNavBrowseAccountList(client, flags, out) {
427
424
  }
428
425
  async function runSalesNavBrowseLeadList(client, flags, out) {
429
426
  rejectPreviewOnRead(flags.preview, out);
430
- const accountId = requireAccount(flags.account, out);
427
+ const accountId = await requireAccount(client, flags, out);
431
428
  const listId = flags.listId ?? "";
432
429
  const ns = client.account(accountId);
433
430
  const outOpts = resolveOutputOpts(flags);
@@ -459,7 +456,7 @@ async function runSalesNavBrowseLeadList(client, flags, out) {
459
456
  }
460
457
  }
461
458
  async function runSalesNavSaveAccount(client, flags, out) {
462
- const accountId = requireAccount(flags.account, out);
459
+ const accountId = await requireAccount(client, flags, out);
463
460
  const listId = flags.list ?? "";
464
461
  const companyId = flags.companyId ?? "";
465
462
  const outOpts = resolveOutputOpts(flags);