@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
  sentAsNotice
4
- } from "./chunk-T5LPGAGJ.js";
4
+ } from "./chunk-MBO4LBLY.js";
5
5
  import "./chunk-HOQ7EUHJ.js";
6
6
  import {
7
7
  AttachError,
@@ -24,7 +24,10 @@ import {
24
24
  import "./chunk-UWO2D4HW.js";
25
25
  import {
26
26
  resolveIdentifier
27
- } from "./chunk-DMQZEPQE.js";
27
+ } from "./chunk-UEAX6KUB.js";
28
+ import {
29
+ requireAccount
30
+ } from "./chunk-3BO6GVS2.js";
28
31
  import {
29
32
  buildPreviewOutput
30
33
  } from "./chunk-R3VLWLVV.js";
@@ -42,6 +45,7 @@ import {
42
45
  import {
43
46
  resolveTextOrStdin
44
47
  } from "./chunk-ZYURL5VK.js";
48
+ import "./chunk-PMRQXBCP.js";
45
49
 
46
50
  // src/commands/company.ts
47
51
  import { defineCommand } from "citty";
@@ -51,13 +55,6 @@ function buildOutputStreams() {
51
55
  stderr: { write: (s) => process.stderr.write(s) }
52
56
  };
53
57
  }
54
- function requireAccount(account, out) {
55
- if (!account) {
56
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
57
- process.exit(2);
58
- }
59
- return account;
60
- }
61
58
  function rejectPreviewOnRead(preview, out) {
62
59
  if (preview) {
63
60
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -106,7 +103,7 @@ async function runCompanyGet(client, flags, out) {
106
103
  out.stderr.write("error: --sections is not supported on company commands.\n");
107
104
  process.exit(2);
108
105
  }
109
- const accountId = requireAccount(flags.account, out);
106
+ const accountId = await requireAccount(client, flags, out);
110
107
  const rawId = flags.id ?? "";
111
108
  const resolvedId = resolveIdentifier(rawId);
112
109
  const outOpts = { ...resolveOutputOpts(flags), slim: slimCompany };
@@ -119,7 +116,7 @@ async function runCompanyGet(client, flags, out) {
119
116
  }
120
117
  async function runCompanyEmployees(client, flags, out) {
121
118
  rejectPreviewOnRead(flags.preview, out);
122
- const accountId = requireAccount(flags.account, out);
119
+ const accountId = await requireAccount(client, flags, out);
123
120
  const ns = client.account(accountId);
124
121
  const outOpts = resolveOutputOpts(flags);
125
122
  const params = {};
@@ -149,7 +146,7 @@ async function runCompanyEmployees(client, flags, out) {
149
146
  }
150
147
  async function runCompanyPosts(client, flags, out) {
151
148
  rejectPreviewOnRead(flags.preview, out);
152
- const accountId = requireAccount(flags.account, out);
149
+ const accountId = await requireAccount(client, flags, out);
153
150
  const ns = client.account(accountId);
154
151
  const outOpts = resolveOutputOpts(flags);
155
152
  const params = {};
@@ -177,7 +174,7 @@ async function runCompanyPosts(client, flags, out) {
177
174
  }
178
175
  async function runCompanyJobs(client, flags, out) {
179
176
  rejectPreviewOnRead(flags.preview, out);
180
- const accountId = requireAccount(flags.account, out);
177
+ const accountId = await requireAccount(client, flags, out);
181
178
  const ns = client.account(accountId);
182
179
  const outOpts = resolveOutputOpts(flags);
183
180
  const params = {};
@@ -206,7 +203,7 @@ async function runCompanyJobs(client, flags, out) {
206
203
  }
207
204
  async function runCompanyInvitableFollowers(client, flags, out) {
208
205
  rejectPreviewOnRead(flags.preview, out);
209
- const accountId = requireAccount(flags.account, out);
206
+ const accountId = await requireAccount(client, flags, out);
210
207
  const ns = client.account(accountId);
211
208
  const outOpts = resolveOutputOpts(flags);
212
209
  const params = {};
@@ -234,7 +231,7 @@ async function runCompanyInvitableFollowers(client, flags, out) {
234
231
  }
235
232
  }
236
233
  async function runCompanyFollowInvite(client, flags, out) {
237
- const accountId = requireAccount(flags.account, out);
234
+ const accountId = await requireAccount(client, flags, out);
238
235
  const ns = client.account(accountId);
239
236
  const outOpts = resolveOutputOpts(flags);
240
237
  const inviteeIds = normalizeInviteeIds(flags.invitee);
@@ -264,7 +261,7 @@ async function runCompanyFollowInvite(client, flags, out) {
264
261
  }
265
262
  async function runCompanyManaged(client, flags, out) {
266
263
  rejectPreviewOnRead(flags.preview, out);
267
- const accountId = requireAccount(flags.account, out);
264
+ const accountId = await requireAccount(client, flags, out);
268
265
  const ns = client.account(accountId);
269
266
  const outOpts = resolveOutputOpts(flags);
270
267
  const params = {};
@@ -291,7 +288,7 @@ async function runCompanyManaged(client, flags, out) {
291
288
  }
292
289
  async function runCompanyFollowers(client, flags, out) {
293
290
  rejectPreviewOnRead(flags.preview, out);
294
- const accountId = requireAccount(flags.account, out);
291
+ const accountId = await requireAccount(client, flags, out);
295
292
  const ns = client.account(accountId);
296
293
  const outOpts = resolveOutputOpts(flags);
297
294
  const params = {};
@@ -319,7 +316,7 @@ async function runCompanyFollowers(client, flags, out) {
319
316
  }
320
317
  async function runCompanyChats(client, flags, out) {
321
318
  rejectPreviewOnRead(flags.preview, out);
322
- const accountId = requireAccount(flags.account, out);
319
+ const accountId = await requireAccount(client, flags, out);
323
320
  const ns = client.account(accountId);
324
321
  const outOpts = resolveOutputOpts(flags);
325
322
  const params = {};
@@ -351,7 +348,7 @@ async function runCompanyChat(client, flags, out) {
351
348
  out.stderr.write("error: --all is not supported on non-paginated commands.\n");
352
349
  process.exit(2);
353
350
  }
354
- const accountId = requireAccount(flags.account, out);
351
+ const accountId = await requireAccount(client, flags, out);
355
352
  const ns = client.account(accountId);
356
353
  const outOpts = resolveOutputOpts(flags);
357
354
  const chatId = flags.chatId ?? "";
@@ -365,7 +362,7 @@ async function runCompanyChat(client, flags, out) {
365
362
  }
366
363
  async function runCompanyMessages(client, flags, out) {
367
364
  rejectPreviewOnRead(flags.preview, out);
368
- const accountId = requireAccount(flags.account, out);
365
+ const accountId = await requireAccount(client, flags, out);
369
366
  const ns = client.account(accountId);
370
367
  const outOpts = resolveOutputOpts(flags);
371
368
  const chatId = flags.chatId ?? "";
@@ -398,7 +395,7 @@ async function runCompanyMessage(client, flags, out) {
398
395
  out.stderr.write("error: --all is not supported on non-paginated commands.\n");
399
396
  process.exit(2);
400
397
  }
401
- const accountId = requireAccount(flags.account, out);
398
+ const accountId = await requireAccount(client, flags, out);
402
399
  const ns = client.account(accountId);
403
400
  const outOpts = resolveOutputOpts(flags);
404
401
  const chatId = flags.chatId ?? "";
@@ -413,7 +410,7 @@ async function runCompanyMessage(client, flags, out) {
413
410
  }
414
411
  async function runCompanySearchChats(client, flags, out) {
415
412
  rejectPreviewOnRead(flags.preview, out);
416
- const accountId = requireAccount(flags.account, out);
413
+ const accountId = await requireAccount(client, flags, out);
417
414
  const ns = client.account(accountId);
418
415
  const outOpts = resolveOutputOpts(flags);
419
416
  const params = {};
@@ -443,7 +440,7 @@ async function runCompanySearchChats(client, flags, out) {
443
440
  }
444
441
  }
445
442
  async function runCompanyReply(client, flags, out, _readStdin) {
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
  const chatId = flags.chatId ?? "";
@@ -14,7 +14,10 @@ import {
14
14
  } from "./chunk-H6XD3F66.js";
15
15
  import {
16
16
  resolveIdentifier
17
- } from "./chunk-DMQZEPQE.js";
17
+ } from "./chunk-UEAX6KUB.js";
18
+ import {
19
+ requireAccount
20
+ } from "./chunk-3BO6GVS2.js";
18
21
  import {
19
22
  buildPreviewOutput
20
23
  } from "./chunk-R3VLWLVV.js";
@@ -30,6 +33,7 @@ import {
30
33
  WRITE_FLAGS
31
34
  } from "./chunk-CUTMZWL6.js";
32
35
  import "./chunk-ZYURL5VK.js";
36
+ import "./chunk-PMRQXBCP.js";
33
37
 
34
38
  // src/commands/connect.ts
35
39
  import { defineCommand } from "citty";
@@ -39,13 +43,6 @@ function buildOutputStreams() {
39
43
  stderr: { write: (s) => process.stderr.write(s) }
40
44
  };
41
45
  }
42
- function requireAccount(account, out) {
43
- if (!account) {
44
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
45
- process.exit(2);
46
- }
47
- return account;
48
- }
49
46
  function rejectPreviewOnRead(preview, out) {
50
47
  if (preview) {
51
48
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -61,7 +58,7 @@ function resolveOutputOpts(flags) {
61
58
  };
62
59
  }
63
60
  async function runConnectSend(client, flags, out) {
64
- const accountId = requireAccount(flags.account, out);
61
+ const accountId = await requireAccount(client, flags, out);
65
62
  const rawId = flags.id ?? "";
66
63
  const resolvedId = resolveIdentifier(rawId);
67
64
  const body = {
@@ -96,7 +93,7 @@ async function runConnectSend(client, flags, out) {
96
93
  }
97
94
  async function runConnectSent(client, flags, out) {
98
95
  rejectPreviewOnRead(flags.preview, out);
99
- const accountId = requireAccount(flags.account, out);
96
+ const accountId = await requireAccount(client, flags, out);
100
97
  const ns = client.account(accountId);
101
98
  const outOpts = resolveOutputOpts(flags);
102
99
  const all = flags.all ?? false;
@@ -134,7 +131,7 @@ async function runConnectSent(client, flags, out) {
134
131
  }
135
132
  async function runConnectReceived(client, flags, out) {
136
133
  rejectPreviewOnRead(flags.preview, out);
137
- const accountId = requireAccount(flags.account, out);
134
+ const accountId = await requireAccount(client, flags, out);
138
135
  const ns = client.account(accountId);
139
136
  const outOpts = resolveOutputOpts(flags);
140
137
  const all = flags.all ?? false;
@@ -171,7 +168,7 @@ async function runConnectReceived(client, flags, out) {
171
168
  }
172
169
  }
173
170
  async function runConnectAccept(client, flags, out) {
174
- const accountId = requireAccount(flags.account, out);
171
+ const accountId = await requireAccount(client, flags, out);
175
172
  const invitationId = flags.id ?? "";
176
173
  if (flags.preview) {
177
174
  const preview = buildPreviewOutput({
@@ -200,7 +197,7 @@ async function runConnectAccept(client, flags, out) {
200
197
  }
201
198
  }
202
199
  async function runConnectDecline(client, flags, out) {
203
- const accountId = requireAccount(flags.account, out);
200
+ const accountId = await requireAccount(client, flags, out);
204
201
  const invitationId = flags.id ?? "";
205
202
  if (flags.preview) {
206
203
  const preview = buildPreviewOutput({
@@ -229,7 +226,7 @@ async function runConnectDecline(client, flags, out) {
229
226
  }
230
227
  }
231
228
  async function runConnectCancel(client, flags, out) {
232
- const accountId = requireAccount(flags.account, out);
229
+ const accountId = await requireAccount(client, flags, out);
233
230
  const invitationId = flags.id ?? "";
234
231
  if (flags.preview) {
235
232
  const preview = buildPreviewOutput({
@@ -3,6 +3,9 @@ import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
5
  } from "./chunk-H6XD3F66.js";
6
+ import {
7
+ requireAccount
8
+ } from "./chunk-3BO6GVS2.js";
6
9
  import {
7
10
  createClient,
8
11
  renderError,
@@ -14,6 +17,7 @@ import {
14
17
  GLOBAL_FLAGS
15
18
  } from "./chunk-CUTMZWL6.js";
16
19
  import "./chunk-ZYURL5VK.js";
20
+ import "./chunk-PMRQXBCP.js";
17
21
 
18
22
  // src/commands/feed.ts
19
23
  import { defineCommand } from "citty";
@@ -23,13 +27,6 @@ function buildOutputStreams() {
23
27
  stderr: { write: (s) => process.stderr.write(s) }
24
28
  };
25
29
  }
26
- function requireAccount(account, out) {
27
- if (!account) {
28
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
29
- process.exit(2);
30
- }
31
- return account;
32
- }
33
30
  function rejectPreviewOnRead(preview, out) {
34
31
  if (preview) {
35
32
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -56,7 +53,7 @@ async function handleSdkError(err, outOpts, out) {
56
53
  }
57
54
  async function runFeedHome(client, flags, out) {
58
55
  rejectPreviewOnRead(flags.preview, out);
59
- const accountId = requireAccount(flags.account, out);
56
+ const accountId = await requireAccount(client, flags, out);
60
57
  const ns = client.account(accountId);
61
58
  const outOpts = resolveOutputOpts(flags);
62
59
  const all = flags.all ?? false;
@@ -3,6 +3,12 @@ import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
5
  } from "./chunk-H6XD3F66.js";
6
+ import {
7
+ normalizeGroupId
8
+ } from "./chunk-UEAX6KUB.js";
9
+ import {
10
+ requireAccount
11
+ } from "./chunk-3BO6GVS2.js";
6
12
  import {
7
13
  createClient,
8
14
  renderError,
@@ -15,6 +21,7 @@ import {
15
21
  READ_SINGLE_FLAGS
16
22
  } from "./chunk-CUTMZWL6.js";
17
23
  import "./chunk-ZYURL5VK.js";
24
+ import "./chunk-PMRQXBCP.js";
18
25
 
19
26
  // src/commands/group.ts
20
27
  import { defineCommand } from "citty";
@@ -24,13 +31,6 @@ function buildOutputStreams() {
24
31
  stderr: { write: (s) => process.stderr.write(s) }
25
32
  };
26
33
  }
27
- function requireAccount(account, out) {
28
- if (!account) {
29
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
30
- process.exit(2);
31
- }
32
- return account;
33
- }
34
34
  function rejectPreviewOnRead(preview, out) {
35
35
  if (preview) {
36
36
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -63,7 +63,7 @@ async function handleSdkError(err, outOpts, out) {
63
63
  }
64
64
  async function runGroupList(client, flags, out) {
65
65
  rejectPreviewOnRead(flags.preview, out);
66
- const accountId = requireAccount(flags.account, out);
66
+ const accountId = await requireAccount(client, flags, out);
67
67
  const ns = client.account(accountId);
68
68
  const outOpts = resolveOutputOpts(flags);
69
69
  const all = flags.all ?? false;
@@ -93,8 +93,8 @@ async function runGroupList(client, flags, out) {
93
93
  async function runGroupGet(client, flags, out) {
94
94
  rejectPreviewOnRead(flags.preview, out);
95
95
  rejectAllOnNonPaginated(flags.all, out);
96
- const accountId = requireAccount(flags.account, out);
97
- const groupId = flags.groupId ?? "";
96
+ const accountId = await requireAccount(client, flags, out);
97
+ const groupId = normalizeGroupId(flags.groupId ?? "");
98
98
  const ns = client.account(accountId);
99
99
  const outOpts = resolveOutputOpts(flags);
100
100
  try {
@@ -106,8 +106,8 @@ async function runGroupGet(client, flags, out) {
106
106
  }
107
107
  async function runGroupMembers(client, flags, out) {
108
108
  rejectPreviewOnRead(flags.preview, out);
109
- const accountId = requireAccount(flags.account, out);
110
- const groupId = flags.groupId ?? "";
109
+ const accountId = await requireAccount(client, flags, out);
110
+ const groupId = normalizeGroupId(flags.groupId ?? "");
111
111
  const ns = client.account(accountId);
112
112
  const outOpts = resolveOutputOpts(flags);
113
113
  const all = flags.all ?? false;
@@ -5,7 +5,10 @@ import {
5
5
  } from "./chunk-H6XD3F66.js";
6
6
  import {
7
7
  normalizeChatId
8
- } from "./chunk-DMQZEPQE.js";
8
+ } from "./chunk-UEAX6KUB.js";
9
+ import {
10
+ requireAccount
11
+ } from "./chunk-3BO6GVS2.js";
9
12
  import {
10
13
  buildPreviewOutput
11
14
  } from "./chunk-R3VLWLVV.js";
@@ -22,6 +25,7 @@ import {
22
25
  WRITE_SINGLE_FLAGS
23
26
  } from "./chunk-CUTMZWL6.js";
24
27
  import "./chunk-ZYURL5VK.js";
28
+ import "./chunk-PMRQXBCP.js";
25
29
 
26
30
  // src/commands/inbox.ts
27
31
  import { defineCommand } from "citty";
@@ -31,13 +35,6 @@ function buildOutputStreams() {
31
35
  stderr: { write: (s) => process.stderr.write(s) }
32
36
  };
33
37
  }
34
- function requireAccount(account, out) {
35
- if (!account) {
36
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
37
- process.exit(2);
38
- }
39
- return account;
40
- }
41
38
  function rejectPreviewOnRead(preview, out) {
42
39
  if (preview) {
43
40
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -94,7 +91,7 @@ async function handleSdkError(err, outOpts, out) {
94
91
  }
95
92
  async function runInboxList(client, flags, out) {
96
93
  rejectPreviewOnRead(flags.preview, out);
97
- const accountId = requireAccount(flags.account, out);
94
+ const accountId = await requireAccount(client, flags, out);
98
95
  const ns = client.account(accountId);
99
96
  const outOpts = resolveOutputOpts(flags);
100
97
  const all = flags.all ?? false;
@@ -125,7 +122,7 @@ async function runInboxList(client, flags, out) {
125
122
  async function runInboxGet(client, flags, out) {
126
123
  rejectPreviewOnRead(flags.preview, out);
127
124
  rejectAllOnNonPaginated(flags.all, out);
128
- const accountId = requireAccount(flags.account, out);
125
+ const accountId = await requireAccount(client, flags, out);
129
126
  const chatId = normalizeChatId(flags.chatId ?? "");
130
127
  const ns = client.account(accountId);
131
128
  const outOpts = resolveOutputOpts(flags);
@@ -137,7 +134,7 @@ async function runInboxGet(client, flags, out) {
137
134
  }
138
135
  }
139
136
  async function runInboxMarkRead(client, flags, out) {
140
- const accountId = requireAccount(flags.account, out);
137
+ const accountId = await requireAccount(client, flags, out);
141
138
  const chatId = normalizeChatId(flags.chatId ?? "");
142
139
  const body = { read: true };
143
140
  if (flags.preview) {
@@ -156,7 +153,7 @@ async function runInboxMarkRead(client, flags, out) {
156
153
  }
157
154
  async function runInboxMessages(client, flags, out) {
158
155
  rejectPreviewOnRead(flags.preview, out);
159
- const accountId = requireAccount(flags.account, out);
156
+ const accountId = await requireAccount(client, flags, out);
160
157
  const chatId = normalizeChatId(flags.chatId ?? "");
161
158
  const ns = client.account(accountId);
162
159
  const outOpts = resolveOutputOpts(flags);
@@ -192,7 +189,7 @@ async function runInboxMessages(client, flags, out) {
192
189
  }
193
190
  async function runInboxSearch(client, flags, out) {
194
191
  rejectPreviewOnRead(flags.preview, out);
195
- const accountId = requireAccount(flags.account, out);
192
+ const accountId = await requireAccount(client, flags, out);
196
193
  const query = flags.query ?? "";
197
194
  if (!query) {
198
195
  out.stderr.write("error: <query> is required.\n");
@@ -3,6 +3,9 @@ import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
5
  } from "./chunk-H6XD3F66.js";
6
+ import {
7
+ requireAccount
8
+ } from "./chunk-3BO6GVS2.js";
6
9
  import {
7
10
  createClient,
8
11
  renderError,
@@ -15,6 +18,7 @@ import {
15
18
  READ_SINGLE_FLAGS
16
19
  } from "./chunk-CUTMZWL6.js";
17
20
  import "./chunk-ZYURL5VK.js";
21
+ import "./chunk-PMRQXBCP.js";
18
22
 
19
23
  // src/commands/inboxes.ts
20
24
  import { defineCommand } from "citty";
@@ -24,13 +28,6 @@ function buildOutputStreams() {
24
28
  stderr: { write: (s) => process.stderr.write(s) }
25
29
  };
26
30
  }
27
- function requireAccount(account, out) {
28
- if (!account) {
29
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
30
- process.exit(2);
31
- }
32
- return account;
33
- }
34
31
  function rejectPreviewOnRead(preview, out) {
35
32
  if (preview) {
36
33
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -74,7 +71,7 @@ function validateLimitRange(raw, out) {
74
71
  async function runInboxesList(client, flags, out) {
75
72
  rejectPreviewOnRead(flags.preview, out);
76
73
  rejectAllOnNonPaginated(flags.all, out);
77
- const accountId = requireAccount(flags.account, out);
74
+ const accountId = await requireAccount(client, flags, out);
78
75
  const ns = client.account(accountId);
79
76
  const outOpts = resolveOutputOpts(flags);
80
77
  const params = {};
@@ -89,7 +86,7 @@ async function runInboxesList(client, flags, out) {
89
86
  }
90
87
  async function runInboxesChats(client, flags, out) {
91
88
  rejectPreviewOnRead(flags.preview, out);
92
- const accountId = requireAccount(flags.account, out);
89
+ const accountId = await requireAccount(client, flags, out);
93
90
  const inboxId = flags.inboxId ?? "";
94
91
  const ns = client.account(accountId);
95
92
  const outOpts = resolveOutputOpts(flags);
@@ -14,7 +14,10 @@ import {
14
14
  } from "./chunk-UWO2D4HW.js";
15
15
  import {
16
16
  resolveJobIdentifier
17
- } from "./chunk-DMQZEPQE.js";
17
+ } from "./chunk-UEAX6KUB.js";
18
+ import {
19
+ requireAccount
20
+ } from "./chunk-3BO6GVS2.js";
18
21
  import {
19
22
  buildPreviewOutput
20
23
  } from "./chunk-R3VLWLVV.js";
@@ -31,6 +34,7 @@ import {
31
34
  WRITE_SINGLE_FLAGS
32
35
  } from "./chunk-CUTMZWL6.js";
33
36
  import "./chunk-ZYURL5VK.js";
37
+ import "./chunk-PMRQXBCP.js";
34
38
 
35
39
  // src/commands/job.ts
36
40
  import { defineCommand } from "citty";
@@ -60,13 +64,6 @@ function buildOutputStreams() {
60
64
  stderr: { write: (s) => process.stderr.write(s) }
61
65
  };
62
66
  }
63
- function requireAccount(account, out) {
64
- if (!account) {
65
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
66
- process.exit(2);
67
- }
68
- return account;
69
- }
70
67
  function rejectPreviewOnRead(preview, out) {
71
68
  if (preview) {
72
69
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -123,7 +120,7 @@ function buildApplyMethod(flags, out) {
123
120
  }
124
121
  async function runJobGet(client, flags, out) {
125
122
  rejectPreviewOnRead(flags.preview, out);
126
- const accountId = requireAccount(flags.account, out);
123
+ const accountId = await requireAccount(client, flags, out);
127
124
  const resolvedId = resolveJobIdentifier(flags.id ?? "");
128
125
  const ns = client.account(accountId);
129
126
  const outOpts = resolveOutputOpts(flags);
@@ -136,7 +133,7 @@ async function runJobGet(client, flags, out) {
136
133
  }
137
134
  async function runJobList(client, flags, out) {
138
135
  rejectPreviewOnRead(flags.preview, out);
139
- const accountId = requireAccount(flags.account, out);
136
+ const accountId = await requireAccount(client, flags, out);
140
137
  const state = requireFlag(flags.state, "--state", out);
141
138
  const ns = client.account(accountId);
142
139
  const outOpts = resolveOutputOpts(flags);
@@ -241,7 +238,7 @@ async function runJobListAllStates(ns, flags, out, outOpts, opts) {
241
238
  }
242
239
  async function runJobBudget(client, flags, out) {
243
240
  rejectPreviewOnRead(flags.preview, out);
244
- const accountId = requireAccount(flags.account, out);
241
+ const accountId = await requireAccount(client, flags, out);
245
242
  const jobId = resolveJobIdentifier(flags.id ?? "");
246
243
  const ns = client.account(accountId);
247
244
  const outOpts = resolveOutputOpts(flags);
@@ -254,7 +251,7 @@ async function runJobBudget(client, flags, out) {
254
251
  }
255
252
  async function runJobApplicants(client, flags, out) {
256
253
  rejectPreviewOnRead(flags.preview, out);
257
- const accountId = requireAccount(flags.account, out);
254
+ const accountId = await requireAccount(client, flags, out);
258
255
  const jobId = resolveJobIdentifier(flags.id ?? "");
259
256
  const ns = client.account(accountId);
260
257
  const outOpts = resolveOutputOpts(flags);
@@ -288,7 +285,7 @@ async function runJobApplicants(client, flags, out) {
288
285
  }
289
286
  async function runJobApplicantGet(client, flags, out) {
290
287
  rejectPreviewOnRead(flags.preview, out);
291
- const accountId = requireAccount(flags.account, out);
288
+ const accountId = await requireAccount(client, flags, out);
292
289
  const jobId = resolveJobIdentifier(flags.id ?? "");
293
290
  const applicantId = flags.applicantId ?? "";
294
291
  const ns = client.account(accountId);
@@ -302,7 +299,7 @@ async function runJobApplicantGet(client, flags, out) {
302
299
  }
303
300
  async function runJobApplicantResume(client, flags, out, isTTY) {
304
301
  rejectPreviewOnRead(flags.preview, out);
305
- const accountId = requireAccount(flags.account, out);
302
+ const accountId = await requireAccount(client, flags, out);
306
303
  const jobId = resolveJobIdentifier(flags.id ?? "");
307
304
  const applicantId = flags.applicantId ?? "";
308
305
  const ns = client.account(accountId);
@@ -319,7 +316,7 @@ async function runJobApplicantResume(client, flags, out, isTTY) {
319
316
  }
320
317
  }
321
318
  async function runJobCreate(client, flags, out) {
322
- const accountId = requireAccount(flags.account, out);
319
+ const accountId = await requireAccount(client, flags, out);
323
320
  if (!flags["job-title"] && !flags["job-title-id"]) {
324
321
  out.stderr.write("error: --job-title (a free-text name) or --job-title-id is required.\n");
325
322
  process.exit(2);
@@ -363,7 +360,7 @@ async function runJobCreate(client, flags, out) {
363
360
  }
364
361
  }
365
362
  async function runJobUpdate(client, flags, out) {
366
- const accountId = requireAccount(flags.account, out);
363
+ const accountId = await requireAccount(client, flags, out);
367
364
  const jobId = resolveJobIdentifier(flags.id ?? "");
368
365
  const body = {};
369
366
  const jobTitle = buildRef(flags["job-title-id"], flags["job-title"]);
@@ -397,7 +394,7 @@ async function runJobUpdate(client, flags, out) {
397
394
  }
398
395
  }
399
396
  async function runJobPublish(client, flags, out) {
400
- const accountId = requireAccount(flags.account, out);
397
+ const accountId = await requireAccount(client, flags, out);
401
398
  const jobId = resolveJobIdentifier(flags.id ?? "");
402
399
  const mode = requireFlag(flags.mode, "--mode", out);
403
400
  requireEnum(mode, PUBLISH_MODES, "--mode", out);
@@ -429,7 +426,7 @@ async function runJobPublish(client, flags, out) {
429
426
  }
430
427
  }
431
428
  async function runJobClose(client, flags, out) {
432
- const accountId = requireAccount(flags.account, out);
429
+ const accountId = await requireAccount(client, flags, out);
433
430
  const jobId = resolveJobIdentifier(flags.id ?? "");
434
431
  if (flags.preview) {
435
432
  const preview = buildPreviewOutput({ method: "jobs.close", args: { job_id: jobId }, body: {}, account: accountId });
@@ -13,15 +13,17 @@ import {
13
13
  runMessageSend,
14
14
  sentAsNotice,
15
15
  willSendAsNotice
16
- } from "./chunk-T5LPGAGJ.js";
16
+ } from "./chunk-MBO4LBLY.js";
17
17
  import "./chunk-HOQ7EUHJ.js";
18
18
  import "./chunk-BGZW6B7G.js";
19
19
  import "./chunk-UWO2D4HW.js";
20
- import "./chunk-DMQZEPQE.js";
20
+ import "./chunk-UEAX6KUB.js";
21
+ import "./chunk-3BO6GVS2.js";
21
22
  import "./chunk-R3VLWLVV.js";
22
23
  import "./chunk-JA3NNST6.js";
23
24
  import "./chunk-CUTMZWL6.js";
24
25
  import "./chunk-ZYURL5VK.js";
26
+ import "./chunk-PMRQXBCP.js";
25
27
  export {
26
28
  guardBareMessageForm,
27
29
  messageCommand,
@@ -3,6 +3,9 @@ import {
3
3
  pageDelayFromFlags,
4
4
  streamAll
5
5
  } from "./chunk-H6XD3F66.js";
6
+ import {
7
+ requireAccount
8
+ } from "./chunk-3BO6GVS2.js";
6
9
  import {
7
10
  buildPreviewOutput
8
11
  } from "./chunk-R3VLWLVV.js";
@@ -18,6 +21,7 @@ import {
18
21
  WRITE_SINGLE_FLAGS
19
22
  } from "./chunk-CUTMZWL6.js";
20
23
  import "./chunk-ZYURL5VK.js";
24
+ import "./chunk-PMRQXBCP.js";
21
25
 
22
26
  // src/commands/notification.ts
23
27
  import { defineCommand } from "citty";
@@ -27,13 +31,6 @@ function buildOutputStreams() {
27
31
  stderr: { write: (s) => process.stderr.write(s) }
28
32
  };
29
33
  }
30
- function requireAccount(account, out) {
31
- if (!account) {
32
- out.stderr.write("error: --account is required for this command. Set it via --account, CURVIATE_ACCOUNT, or `curviate config set-account`.\n");
33
- process.exit(2);
34
- }
35
- return account;
36
- }
37
34
  function rejectPreviewOnRead(preview, out) {
38
35
  if (preview) {
39
36
  out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
@@ -60,7 +57,7 @@ async function handleSdkError(err, outOpts, out) {
60
57
  }
61
58
  async function runNotificationList(client, flags, out) {
62
59
  rejectPreviewOnRead(flags.preview, out);
63
- const accountId = requireAccount(flags.account, out);
60
+ const accountId = await requireAccount(client, flags, out);
64
61
  const ns = client.account(accountId);
65
62
  const outOpts = resolveOutputOpts(flags);
66
63
  const all = flags.all ?? false;
@@ -88,7 +85,7 @@ async function runNotificationList(client, flags, out) {
88
85
  }
89
86
  }
90
87
  async function runNotificationDelete(client, flags, out) {
91
- const accountId = requireAccount(flags.account, out);
88
+ const accountId = await requireAccount(client, flags, out);
92
89
  const cardUrn = flags.cardUrn ?? "";
93
90
  if (flags.preview) {
94
91
  const preview = buildPreviewOutput({ method: "notifications.delete", args: { card_urn: cardUrn }, body: {}, account: accountId });
@@ -105,7 +102,7 @@ async function runNotificationDelete(client, flags, out) {
105
102
  }
106
103
  }
107
104
  async function runNotificationShowLess(client, flags, out) {
108
- const accountId = requireAccount(flags.account, out);
105
+ const accountId = await requireAccount(client, flags, out);
109
106
  const cardUrn = flags.cardUrn ?? "";
110
107
  if (flags.preview) {
111
108
  const preview = buildPreviewOutput({ method: "notifications.showLess", args: { card_urn: cardUrn }, body: {}, account: accountId });