@curviate/cli 0.40.0 → 0.42.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 (32) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/dist/{account-LTXAUBBP.js → account-PFK5YROZ.js} +81 -26
  3. package/dist/{chunk-OTBJATDE.js → chunk-B5NIX4G6.js} +6 -1
  4. package/dist/{chunk-LD5KJSCT.js → chunk-BLJGV6ST.js} +2 -2
  5. package/dist/{chunk-6W7364S3.js → chunk-KJ24DIAJ.js} +1 -1
  6. package/dist/{chunk-T6G5AASF.js → chunk-OUMMWC7G.js} +79 -26
  7. package/dist/{chunk-BGVK73VI.js → chunk-PCZH5QJA.js} +1 -1
  8. package/dist/{chunk-XDQHNUEU.js → chunk-TC4ZPUWI.js} +12 -6
  9. package/dist/{chunk-DCZR4M7G.js → chunk-UJOTQPL6.js} +1 -1
  10. package/dist/cli.js +64 -53
  11. package/dist/{comment-2CSBSBOH.js → comment-G4EXIIAQ.js} +83 -29
  12. package/dist/{company-ZUIUR5UN.js → company-WX5QOASS.js} +104 -50
  13. package/dist/{config-RUBXWFQ3.js → config-K4G3VSBA.js} +44 -9
  14. package/dist/{connect-LSXKNEL2.js → connect-IYTFL7NT.js} +44 -21
  15. package/dist/{doctor-FHOHIQPX.js → doctor-ICAEETCL.js} +8 -4
  16. package/dist/examples-IJL3A6SZ.js +18 -0
  17. package/dist/{feed-UUHB2FXI.js → feed-XC5235UF.js} +16 -14
  18. package/dist/{group-NUCO3P2W.js → group-JDP2HVSV.js} +31 -20
  19. package/dist/{inbox-DEZTGTPO.js → inbox-W3KR65VD.js} +51 -24
  20. package/dist/{inboxes-F3NIQQRK.js → inboxes-XYS3IRT6.js} +23 -17
  21. package/dist/{job-YMGO3WJH.js → job-XW3WM57J.js} +112 -34
  22. package/dist/{login-YTVPIN27.js → login-OHAHNBRW.js} +7 -3
  23. package/dist/{message-RSBUXI64.js → message-5XC7U4JC.js} +5 -5
  24. package/dist/{notification-EJ35OD3Q.js → notification-RIUSYJV6.js} +26 -16
  25. package/dist/{post-VHVQ56A7.js → post-LSEBRQYK.js} +96 -32
  26. package/dist/{profile-3CBNI42H.js → profile-NHTYGX7K.js} +130 -43
  27. package/dist/{recruiter-M7XUFYNR.js → recruiter-4SDAROK4.js} +219 -67
  28. package/dist/{sales-nav-S47OCEUC.js → sales-nav-77NP3UXV.js} +102 -42
  29. package/dist/{search-UWI37MKG.js → search-XDOQZAVG.js} +80 -39
  30. package/dist/{setup-3EQRACT6.js → setup-BPNLAHPC.js} +9 -4
  31. package/dist/{webhook-I4U4C4XE.js → webhook-XOPRW63N.js} +62 -23
  32. package/package.json +3 -2
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readablePage,
4
4
  resolveEffectiveConfig
5
- } from "./chunk-OTBJATDE.js";
5
+ } from "./chunk-B5NIX4G6.js";
6
6
  import {
7
7
  getExitCode
8
8
  } from "./chunk-XZJQQJBE.js";
@@ -12,10 +12,10 @@ import {
12
12
  isPlainObject,
13
13
  readConfigFile,
14
14
  withoutUserinfo
15
- } from "./chunk-DCZR4M7G.js";
15
+ } from "./chunk-UJOTQPL6.js";
16
16
  import {
17
17
  GLOBAL_FLAGS
18
- } from "./chunk-XDQHNUEU.js";
18
+ } from "./chunk-TC4ZPUWI.js";
19
19
 
20
20
  // src/commands/doctor.ts
21
21
  import { defineCommand } from "citty";
@@ -170,7 +170,11 @@ function renderHuman(report, io) {
170
170
  var doctorCommand = defineCommand({
171
171
  meta: {
172
172
  name: "doctor",
173
- description: "Check that this machine can call the API: config, credential source, workspace, reachability and connected accounts."
173
+ description: "Check that this machine can call the API: config, credential source, workspace, reachability and connected accounts.",
174
+ examples: [
175
+ "curviate doctor",
176
+ "curviate doctor --json"
177
+ ]
174
178
  },
175
179
  args: {
176
180
  profile: GLOBAL_FLAGS.profile,
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/examples.ts
4
+ import { showUsage } from "citty";
5
+ async function showUsageWithExamples(cmd, parent) {
6
+ await showUsage(cmd, parent);
7
+ const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
8
+ const block = (title, lines = []) => lines.length ? process.stdout.write(`${title}
9
+
10
+ ${lines.map((l) => ` ${l}`).join("\n")}
11
+
12
+ `) : void 0;
13
+ block("REQUIRES", meta?.requires);
14
+ block("EXAMPLES", meta?.examples);
15
+ }
16
+ export {
17
+ showUsageWithExamples
18
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  requireAccount
4
- } from "./chunk-LD5KJSCT.js";
4
+ } from "./chunk-BLJGV6ST.js";
5
5
  import {
6
6
  pageDelayFromFlags,
7
7
  readCursorFlag,
@@ -14,14 +14,15 @@ import {
14
14
  resolveEffectiveConfig,
15
15
  streamAll,
16
16
  writeNdjsonItem
17
- } from "./chunk-OTBJATDE.js";
17
+ } from "./chunk-B5NIX4G6.js";
18
18
  import "./chunk-XZJQQJBE.js";
19
19
  import {
20
20
  createClient
21
- } from "./chunk-DCZR4M7G.js";
21
+ } from "./chunk-UJOTQPL6.js";
22
22
  import {
23
- GLOBAL_FLAGS
24
- } from "./chunk-XDQHNUEU.js";
23
+ GLOBAL_FLAGS,
24
+ readOnly
25
+ } from "./chunk-TC4ZPUWI.js";
25
26
 
26
27
  // src/commands/feed.ts
27
28
  import { defineCommand } from "citty";
@@ -31,12 +32,6 @@ function buildOutputStreams() {
31
32
  stderr: { write: (s) => process.stderr.write(s) }
32
33
  };
33
34
  }
34
- function rejectPreviewOnRead(preview, out) {
35
- if (preview) {
36
- out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
37
- process.exit(2);
38
- }
39
- }
40
35
  function resolveOutputOpts(flags) {
41
36
  return {
42
37
  json: (flags.json ?? false) || !process.stdout.isTTY,
@@ -56,7 +51,6 @@ async function handleSdkError(err, outOpts, out) {
56
51
  process.exit(1);
57
52
  }
58
53
  async function runFeedHome(client, flags, out) {
59
- rejectPreviewOnRead(flags.preview, out);
60
54
  rejectPaginationModifiersWithoutAll(flags, out);
61
55
  const accountId = await requireAccount(client, flags, out);
62
56
  const ns = client.account(accountId);
@@ -88,14 +82,22 @@ async function runFeedHome(client, flags, out) {
88
82
  }
89
83
  }
90
84
  var FEED_ARGS = {
91
- ...GLOBAL_FLAGS,
85
+ ...readOnly(GLOBAL_FLAGS),
92
86
  sort: {
93
87
  type: "string",
94
88
  description: "Sort order: recent (default, reverse-chronological, always available) or relevant (LinkedIn's ranked 'top' feed, shared throttled budget). Ignored when --cursor is supplied."
95
89
  }
96
90
  };
97
91
  var feedHomeCommand = defineCommand({
98
- meta: { name: "home", description: "Read the connected account's LinkedIn home feed as agent-actionable posts." },
92
+ meta: {
93
+ name: "home",
94
+ description: "Read the connected account's LinkedIn home feed as agent-actionable posts. On the default recent sort the feed is an index: each post's text is null and only the author's name resolves, so fetch a body with `curviate post get <id>`. --sort relevant fills text and engagement.",
95
+ examples: [
96
+ "curviate feed home",
97
+ "curviate feed home --sort relevant",
98
+ "curviate feed home --all --max-pages 3"
99
+ ]
100
+ },
99
101
  args: FEED_ARGS,
100
102
  async run({ args }) {
101
103
  const flags = args;
@@ -4,11 +4,12 @@ import {
4
4
  } from "./chunk-UEAX6KUB.js";
5
5
  import {
6
6
  requireAccount
7
- } from "./chunk-LD5KJSCT.js";
7
+ } from "./chunk-BLJGV6ST.js";
8
8
  import {
9
9
  pageDelayFromFlags,
10
10
  readCursorFlag,
11
11
  readMaxPagesFlag,
12
+ readableObject,
12
13
  readablePage,
13
14
  rejectPaginationModifiersWithoutAll,
14
15
  renderError,
@@ -17,15 +18,16 @@ import {
17
18
  resolveEffectiveConfig,
18
19
  streamAll,
19
20
  writeNdjsonItem
20
- } from "./chunk-OTBJATDE.js";
21
+ } from "./chunk-B5NIX4G6.js";
21
22
  import "./chunk-XZJQQJBE.js";
22
23
  import {
23
24
  createClient
24
- } from "./chunk-DCZR4M7G.js";
25
+ } from "./chunk-UJOTQPL6.js";
25
26
  import {
26
27
  GLOBAL_FLAGS,
27
- READ_SINGLE_FLAGS
28
- } from "./chunk-XDQHNUEU.js";
28
+ READ_SINGLE_FLAGS,
29
+ readOnly
30
+ } from "./chunk-TC4ZPUWI.js";
29
31
 
30
32
  // src/commands/group.ts
31
33
  import { defineCommand } from "citty";
@@ -35,12 +37,6 @@ function buildOutputStreams() {
35
37
  stderr: { write: (s) => process.stderr.write(s) }
36
38
  };
37
39
  }
38
- function rejectPreviewOnRead(preview, out) {
39
- if (preview) {
40
- out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
41
- process.exit(2);
42
- }
43
- }
44
40
  function rejectAllOnNonPaginated(all, out) {
45
41
  if (all) {
46
42
  out.stderr.write("error: --all is not supported on non-paginated commands.\n");
@@ -66,7 +62,6 @@ async function handleSdkError(err, outOpts, out) {
66
62
  process.exit(1);
67
63
  }
68
64
  async function runGroupList(client, flags, out) {
69
- rejectPreviewOnRead(flags.preview, out);
70
65
  rejectPaginationModifiersWithoutAll(flags, out);
71
66
  const accountId = await requireAccount(client, flags, out);
72
67
  const ns = client.account(accountId);
@@ -98,7 +93,6 @@ async function runGroupList(client, flags, out) {
98
93
  }
99
94
  }
100
95
  async function runGroupGet(client, flags, out) {
101
- rejectPreviewOnRead(flags.preview, out);
102
96
  rejectAllOnNonPaginated(flags.all, out);
103
97
  const accountId = await requireAccount(client, flags, out);
104
98
  const groupId = normalizeGroupId(flags.groupId ?? "");
@@ -106,13 +100,13 @@ async function runGroupGet(client, flags, out) {
106
100
  const outOpts = resolveOutputOpts(flags);
107
101
  try {
108
102
  const result = await ns.groups.get(groupId);
103
+ readableObject(result);
109
104
  renderSuccess(result, outOpts, out);
110
105
  } catch (err) {
111
106
  await handleSdkError(err, outOpts, out);
112
107
  }
113
108
  }
114
109
  async function runGroupMembers(client, flags, out) {
115
- rejectPreviewOnRead(flags.preview, out);
116
110
  rejectPaginationModifiersWithoutAll(flags, out);
117
111
  const accountId = await requireAccount(client, flags, out);
118
112
  const groupId = normalizeGroupId(flags.groupId ?? "");
@@ -145,9 +139,16 @@ async function runGroupMembers(client, flags, out) {
145
139
  }
146
140
  }
147
141
  var groupListCommand = defineCommand({
148
- meta: { name: "list", description: "List the groups the connected account belongs to. Pass --target to enumerate another member's groups instead (a partial, interests-only read)." },
142
+ meta: {
143
+ name: "list",
144
+ description: "List the groups the connected account belongs to. Pass --target to enumerate another member's groups instead (a partial, interests-only read).",
145
+ examples: [
146
+ "curviate group list",
147
+ "curviate group list --target janesmith"
148
+ ]
149
+ },
149
150
  args: {
150
- ...GLOBAL_FLAGS,
151
+ ...readOnly(GLOBAL_FLAGS),
151
152
  target: {
152
153
  type: "string",
153
154
  description: "Target another LinkedIn member's groups instead of your own: a vanity slug or full /in/{vanity} URL. Omit to enumerate your own groups (a complete read)."
@@ -172,9 +173,15 @@ var groupListCommand = defineCommand({
172
173
  }
173
174
  });
174
175
  var groupGetCommand = defineCommand({
175
- meta: { name: "get", description: "Get one LinkedIn group's full detail: name, member count, description, admin contact, and write-feasibility gates." },
176
+ meta: {
177
+ name: "get",
178
+ description: "Get one LinkedIn group's full detail: name, member count, description, admin contact, and write-feasibility gates.",
179
+ examples: [
180
+ "curviate group get 12345678"
181
+ ]
182
+ },
176
183
  args: {
177
- ...READ_SINGLE_FLAGS,
184
+ ...readOnly(READ_SINGLE_FLAGS),
178
185
  groupId: { type: "positional", description: "Numeric group id, or a full group URL (e.g. https://www.linkedin.com/groups/9123014/)." }
179
186
  },
180
187
  async run({ args }) {
@@ -198,10 +205,14 @@ var groupGetCommand = defineCommand({
198
205
  var groupMembersCommand = defineCommand({
199
206
  meta: {
200
207
  name: "members",
201
- description: "List (or search by name) a group's members: id, profile URL, name, headline, and relationship signal. Requires the connected account be a member of the group."
208
+ description: "List (or search by name) a group's members: id, profile URL, name, headline, and relationship signal. Requires the connected account be a member of the group.",
209
+ examples: [
210
+ "curviate group members 12345678",
211
+ "curviate group members 12345678 --name sophie"
212
+ ]
202
213
  },
203
214
  args: {
204
- ...GLOBAL_FLAGS,
215
+ ...readOnly(GLOBAL_FLAGS),
205
216
  groupId: { type: "positional", description: "Numeric group id, or a full group URL." },
206
217
  name: {
207
218
  type: "string",
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-UEAX6KUB.js";
9
9
  import {
10
10
  requireAccount
11
- } from "./chunk-LD5KJSCT.js";
11
+ } from "./chunk-BLJGV6ST.js";
12
12
  import {
13
13
  buildPreviewOutput
14
14
  } from "./chunk-TCUYH5GO.js";
@@ -16,6 +16,7 @@ import {
16
16
  pageDelayFromFlags,
17
17
  readCursorFlag,
18
18
  readMaxPagesFlag,
19
+ readableObject,
19
20
  readablePage,
20
21
  rejectPaginationModifiersWithoutAll,
21
22
  renderError,
@@ -24,16 +25,17 @@ import {
24
25
  resolveEffectiveConfig,
25
26
  streamAll,
26
27
  writeNdjsonItem
27
- } from "./chunk-OTBJATDE.js";
28
+ } from "./chunk-B5NIX4G6.js";
28
29
  import "./chunk-XZJQQJBE.js";
29
30
  import {
30
31
  createClient
31
- } from "./chunk-DCZR4M7G.js";
32
+ } from "./chunk-UJOTQPL6.js";
32
33
  import {
33
34
  GLOBAL_FLAGS,
34
35
  READ_SINGLE_FLAGS,
35
- WRITE_SINGLE_FLAGS
36
- } from "./chunk-XDQHNUEU.js";
36
+ WRITE_SINGLE_FLAGS,
37
+ readOnly
38
+ } from "./chunk-TC4ZPUWI.js";
37
39
 
38
40
  // src/commands/inbox.ts
39
41
  import { defineCommand } from "citty";
@@ -43,12 +45,6 @@ function buildOutputStreams() {
43
45
  stderr: { write: (s) => process.stderr.write(s) }
44
46
  };
45
47
  }
46
- function rejectPreviewOnRead(preview, out) {
47
- if (preview) {
48
- out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
49
- process.exit(2);
50
- }
51
- }
52
48
  function rejectAllOnNonPaginated(all, out) {
53
49
  if (all) {
54
50
  out.stderr.write("error: --all is not supported on non-paginated commands.\n");
@@ -109,7 +105,6 @@ async function handleSdkError(err, outOpts, out) {
109
105
  process.exit(1);
110
106
  }
111
107
  async function runInboxList(client, flags, out) {
112
- rejectPreviewOnRead(flags.preview, out);
113
108
  rejectPaginationModifiersWithoutAll(flags, out);
114
109
  const accountId = await requireAccount(client, flags, out);
115
110
  const ns = client.account(accountId);
@@ -145,7 +140,6 @@ async function runInboxList(client, flags, out) {
145
140
  }
146
141
  }
147
142
  async function runInboxGet(client, flags, out) {
148
- rejectPreviewOnRead(flags.preview, out);
149
143
  rejectAllOnNonPaginated(flags.all, out);
150
144
  const retrieval = parseRetrievalFlags(flags);
151
145
  if (!retrieval.ok) {
@@ -159,6 +153,7 @@ async function runInboxGet(client, flags, out) {
159
153
  const outOpts = resolveOutputOpts(flags);
160
154
  try {
161
155
  const result = await ns.messaging.getChat(chatId, retrieval.query);
156
+ readableObject(result);
162
157
  renderSuccess(result, outOpts, out);
163
158
  } catch (err) {
164
159
  await handleSdkError(err, outOpts, out);
@@ -183,7 +178,6 @@ async function runInboxMarkRead(client, flags, out) {
183
178
  }
184
179
  }
185
180
  async function runInboxMessages(client, flags, out) {
186
- rejectPreviewOnRead(flags.preview, out);
187
181
  rejectPaginationModifiersWithoutAll(flags, out);
188
182
  const retrieval = parseRetrievalFlags(flags);
189
183
  if (!retrieval.ok) {
@@ -238,7 +232,6 @@ async function runInboxMessages(client, flags, out) {
238
232
  }
239
233
  }
240
234
  async function runInboxSearch(client, flags, out) {
241
- rejectPreviewOnRead(flags.preview, out);
242
235
  rejectPaginationModifiersWithoutAll(flags, out);
243
236
  const accountId = await requireAccount(client, flags, out);
244
237
  const query = flags.query ?? "";
@@ -278,9 +271,17 @@ async function runInboxSearch(client, flags, out) {
278
271
  }
279
272
  }
280
273
  var inboxListCommand = defineCommand({
281
- meta: { name: "list", description: "List inbox chats." },
274
+ meta: {
275
+ name: "list",
276
+ description: "List inbox chats.",
277
+ examples: [
278
+ "curviate inbox list",
279
+ "curviate inbox list --unread",
280
+ "curviate inbox list --inbox archived --all"
281
+ ]
282
+ },
282
283
  args: {
283
- ...GLOBAL_FLAGS,
284
+ ...readOnly(GLOBAL_FLAGS),
284
285
  limit: { type: "string", description: "Number of items to return per page (1-25, default 20)." },
285
286
  unread: {
286
287
  type: "boolean",
@@ -311,10 +312,16 @@ var inboxListCommand = defineCommand({
311
312
  }
312
313
  });
313
314
  var inboxGetCommand = defineCommand({
314
- meta: { name: "get", description: "Get details of a single chat." },
315
+ meta: {
316
+ name: "get",
317
+ description: "Get details of a single chat.",
318
+ examples: [
319
+ "curviate inbox get 2-YTQ3ODU3Njgt"
320
+ ]
321
+ },
315
322
  args: {
316
323
  // Single-object read: READ_SINGLE_FLAGS omits pagination flags, keeps --fields
317
- ...READ_SINGLE_FLAGS,
324
+ ...readOnly(READ_SINGLE_FLAGS),
318
325
  ...RETRIEVAL_FLAGS,
319
326
  chatId: { type: "positional", description: "Chat ID." }
320
327
  },
@@ -337,7 +344,13 @@ var inboxGetCommand = defineCommand({
337
344
  }
338
345
  });
339
346
  var inboxMarkReadCommand = defineCommand({
340
- meta: { name: "mark-read", description: "Mark a chat as read." },
347
+ meta: {
348
+ name: "mark-read",
349
+ description: "Mark a chat as read.",
350
+ examples: [
351
+ "curviate inbox mark-read 2-YTQ3ODU3Njgt"
352
+ ]
353
+ },
341
354
  args: {
342
355
  // Write command: WRITE_SINGLE_FLAGS omits pagination flags, keeps --fields
343
356
  ...WRITE_SINGLE_FLAGS,
@@ -362,9 +375,17 @@ var inboxMarkReadCommand = defineCommand({
362
375
  }
363
376
  });
364
377
  var inboxMessagesCommand = defineCommand({
365
- meta: { name: "messages", description: "List messages in a chat. A very recent send/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `message get <chat_id> <message_id>` reflects it immediately. `--mode cache_only` is answered only for an unfiltered, uncursored first page of a chat whose whole message set fits in that one page (`--limit`, at most 25), and only after a walk of the chat reached its end: any unfiltered page fetched from LinkedIn (such as `--mode live` without `--all`) restarts that walk, and `--all` walks to the end and closes it. A read carrying `--before`, `--after` or `--cursor` is never served from the store." },
378
+ meta: {
379
+ name: "messages",
380
+ description: "List messages in a chat. A very recent send/delete may take a few minutes to appear or clear here (LinkedIn-side indexing); `message get <chat_id> <message_id>` reflects it immediately. `--mode cache_only` is answered only for an unfiltered, uncursored first page of a chat whose whole message set fits in that one page (`--limit`, at most 25), and only after a walk of the chat reached its end: any unfiltered page fetched from LinkedIn (such as `--mode live` without `--all`) restarts that walk, and `--all` walks to the end and closes it. A read carrying `--before`, `--after` or `--cursor` is never served from the store.",
381
+ examples: [
382
+ "curviate inbox messages 2-YTQ3ODU3Njgt",
383
+ "curviate inbox messages 2-YTQ3ODU3Njgt --limit 20",
384
+ "curviate inbox messages 2-YTQ3ODU3Njgt --after 2026-06-01T00:00:00Z"
385
+ ]
386
+ },
366
387
  args: {
367
- ...GLOBAL_FLAGS,
388
+ ...readOnly(GLOBAL_FLAGS),
368
389
  ...RETRIEVAL_FLAGS,
369
390
  limit: { type: "string", description: "Number of items to return per page (1-25, default 20)." },
370
391
  chatId: { type: "positional", description: "Chat ID." },
@@ -396,9 +417,15 @@ var inboxMessagesCommand = defineCommand({
396
417
  }
397
418
  });
398
419
  var inboxSearchCommand = defineCommand({
399
- meta: { name: "search", description: "Free-text search the account's own inbox (matches participant names and message content)." },
420
+ meta: {
421
+ name: "search",
422
+ description: "Free-text search the account's own inbox (matches participant names and message content).",
423
+ examples: [
424
+ "curviate inbox search sophie"
425
+ ]
426
+ },
400
427
  args: {
401
- ...GLOBAL_FLAGS,
428
+ ...readOnly(GLOBAL_FLAGS),
402
429
  limit: { type: "string", description: "Number of items to return per page (1-100, default 20)." },
403
430
  query: { type: "positional", description: "Search term (e.g. a name or a phrase from a message)." }
404
431
  },
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  requireAccount
4
- } from "./chunk-LD5KJSCT.js";
4
+ } from "./chunk-BLJGV6ST.js";
5
5
  import {
6
6
  pageDelayFromFlags,
7
7
  readCursorFlag,
8
8
  readMaxPagesFlag,
9
+ readableObject,
9
10
  readablePage,
10
11
  rejectPaginationModifiersWithoutAll,
11
12
  renderError,
@@ -14,15 +15,16 @@ import {
14
15
  resolveEffectiveConfig,
15
16
  streamAll,
16
17
  writeNdjsonItem
17
- } from "./chunk-OTBJATDE.js";
18
+ } from "./chunk-B5NIX4G6.js";
18
19
  import "./chunk-XZJQQJBE.js";
19
20
  import {
20
21
  createClient
21
- } from "./chunk-DCZR4M7G.js";
22
+ } from "./chunk-UJOTQPL6.js";
22
23
  import {
23
24
  GLOBAL_FLAGS,
24
- READ_SINGLE_FLAGS
25
- } from "./chunk-XDQHNUEU.js";
25
+ READ_SINGLE_FLAGS,
26
+ readOnly
27
+ } from "./chunk-TC4ZPUWI.js";
26
28
 
27
29
  // src/commands/inboxes.ts
28
30
  import { defineCommand } from "citty";
@@ -32,12 +34,6 @@ function buildOutputStreams() {
32
34
  stderr: { write: (s) => process.stderr.write(s) }
33
35
  };
34
36
  }
35
- function rejectPreviewOnRead(preview, out) {
36
- if (preview) {
37
- out.stderr.write("error: --preview is only valid on write commands (mutations). Reads just run.\n");
38
- process.exit(2);
39
- }
40
- }
41
37
  function rejectAllOnNonPaginated(all, out) {
42
38
  if (all) {
43
39
  out.stderr.write("error: --all is not supported on non-paginated commands.\n");
@@ -73,7 +69,6 @@ function validateLimitRange(raw, out) {
73
69
  }
74
70
  }
75
71
  async function runInboxesList(client, flags, out) {
76
- rejectPreviewOnRead(flags.preview, out);
77
72
  rejectAllOnNonPaginated(flags.all, out);
78
73
  const accountId = await requireAccount(client, flags, out);
79
74
  const ns = client.account(accountId);
@@ -83,13 +78,13 @@ async function runInboxesList(client, flags, out) {
83
78
  if (flags["company-id"]) params["company_id"] = flags["company-id"];
84
79
  try {
85
80
  const result = await ns.inboxes.list(params);
81
+ readableObject(result);
86
82
  renderSuccess(result, outOpts, out);
87
83
  } catch (err) {
88
84
  await handleSdkError(err, outOpts, out);
89
85
  }
90
86
  }
91
87
  async function runInboxesChats(client, flags, out) {
92
- rejectPreviewOnRead(flags.preview, out);
93
88
  rejectPaginationModifiersWithoutAll(flags, out);
94
89
  const accountId = await requireAccount(client, flags, out);
95
90
  const inboxId = flags.inboxId ?? "";
@@ -122,11 +117,18 @@ async function runInboxesChats(client, flags, out) {
122
117
  }
123
118
  }
124
119
  var inboxesListCommand = defineCommand({
125
- meta: { name: "list", description: "Discover the account's inboxes (personal + company pages)." },
120
+ meta: {
121
+ name: "list",
122
+ description: "Discover the account's inboxes (personal + company pages).",
123
+ examples: [
124
+ "curviate inboxes list",
125
+ "curviate inboxes list --kind company"
126
+ ]
127
+ },
126
128
  args: {
127
129
  // Single-object-shaped read: READ_SINGLE_FLAGS omits pagination flags
128
130
  // (this response carries no cursor, every inbox comes back in one call).
129
- ...READ_SINGLE_FLAGS,
131
+ ...readOnly(READ_SINGLE_FLAGS),
130
132
  kind: {
131
133
  type: "string",
132
134
  description: "Filter to only personal or only company inboxes: personal | company. Omit to list both."
@@ -157,10 +159,14 @@ var inboxesListCommand = defineCommand({
157
159
  var inboxesChatsCommand = defineCommand({
158
160
  meta: {
159
161
  name: "chats",
160
- description: "List an inbox's conversations. Each chat id is send-ready: reply with `message send <chat_id> \"<text>\"`. A company inbox's chat id (e.g. COMPANY_83734124_2-...) sends AS THE PAGE, no separate flag needed. Company inboxes are reply-only and cannot start a new conversation."
162
+ description: "List an inbox's conversations. Each chat id is send-ready: reply with `message send <chat_id> \"<text>\"`. A company inbox's chat id (e.g. COMPANY_83734124_2-...) sends AS THE PAGE, no separate flag needed. Company inboxes are reply-only and cannot start a new conversation.",
163
+ examples: [
164
+ "curviate inboxes chats CLASSIC_PRIMARY",
165
+ "curviate inboxes chats COMPANY_1234567_PRIMARY --limit 10"
166
+ ]
161
167
  },
162
168
  args: {
163
- ...GLOBAL_FLAGS,
169
+ ...readOnly(GLOBAL_FLAGS),
164
170
  limit: { type: "string", description: "Number of items to return per page (1-25, default 20)." },
165
171
  inboxId: { type: "positional", description: "Inbox id from `inboxes list` (e.g. CLASSIC_PRIMARY or COMPANY_83734124_PRIMARY)." }
166
172
  },