@curviate/cli 0.50.0-next.4 → 0.50.0-next.6

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 (58) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +43 -0
  3. package/dist/{account-7KKJEHAM.js → account-TBPPGZME.js} +8 -8
  4. package/dist/{analytics-XBAFRYSC.js → analytics-ECRDJRTF.js} +5 -5
  5. package/dist/{beta-consent-FP2QGN6M.js → beta-consent-7RLD2CJU.js} +4 -4
  6. package/dist/{billing-AQ5VNIYA.js → billing-6AJ4AB77.js} +5 -5
  7. package/dist/{chunk-73DJ3KNE.js → chunk-FBBZVIFJ.js} +2 -1
  8. package/dist/{chunk-RRSWFGXM.js → chunk-K26JD5NC.js} +6 -6
  9. package/dist/{chunk-3SF6JIMA.js → chunk-LTPME424.js} +2 -2
  10. package/dist/{chunk-56JSZNRW.js → chunk-N7UA24IK.js} +1 -1
  11. package/dist/{chunk-2MWTZLAG.js → chunk-NKB4RJUH.js} +129 -45
  12. package/dist/{chunk-JYCNHE72.js → chunk-QFUZCTD7.js} +2 -2
  13. package/dist/{chunk-COYDNWKF.js → chunk-QOVYLEUY.js} +2 -2
  14. package/dist/{chunk-2W4RN5ON.js → chunk-QW5K5DTC.js} +2 -0
  15. package/dist/{chunk-5I6JJJIV.js → chunk-VHNF6OZD.js} +8 -3
  16. package/dist/{chunk-QL6VKMTA.js → chunk-XJOWMIW2.js} +11 -11
  17. package/dist/{chunk-FO54X4T2.js → chunk-XPQP2FZX.js} +1 -1
  18. package/dist/{chunk-Q5GVXN7Z.js → chunk-YGNDS4CW.js} +1 -1
  19. package/dist/cli.js +25 -25
  20. package/dist/{comment-OZZGWNIV.js → comment-7QCABJ53.js} +13 -13
  21. package/dist/{company-HM23JZT4.js → company-LH56TXM6.js} +12 -12
  22. package/dist/{config-KHXQZD6F.js → config-YBFTZASA.js} +2 -2
  23. package/dist/{connect-HBQ4PLTS.js → connect-5X5VIQOO.js} +11 -11
  24. package/dist/{contact-325QZ5IB.js → contact-6GSXKSL7.js} +8 -8
  25. package/dist/{contact-groups-TXPUYQYC.js → contact-groups-6S6AM5WV.js} +10 -10
  26. package/dist/{contact-import-6G2DUCIN.js → contact-import-CQW3RQGN.js} +9 -9
  27. package/dist/core-5NYENM4A.js +46 -0
  28. package/dist/{do-not-contact-CP6WKW5T.js → do-not-contact-6DFZYGRI.js} +5 -5
  29. package/dist/{doctor-GDBH2PH7.js → doctor-OUDGTEYR.js} +4 -4
  30. package/dist/{draft-IWI7E5VJ.js → draft-AETHWRIX.js} +9 -9
  31. package/dist/{enrollment-2JVHRUNI.js → enrollment-KXLN32RT.js} +6 -6
  32. package/dist/{examples-74FXGJ7X.js → examples-ICAGL2S5.js} +1 -1
  33. package/dist/{exit-codes-7DBETBDT.js → exit-codes-CYQHN4NE.js} +1 -1
  34. package/dist/{export-URIKCSIO.js → export-XOAHDY7W.js} +4 -4
  35. package/dist/{feed-ZBATBTD2.js → feed-W3LMXJHQ.js} +6 -6
  36. package/dist/{group-D43R5JQU.js → group-TLC75WME.js} +6 -6
  37. package/dist/{inbox-6DTW4XJE.js → inbox-ID4EFMTQ.js} +6 -6
  38. package/dist/{inboxes-TFZQ57MK.js → inboxes-SRBQ3FAI.js} +6 -6
  39. package/dist/{incoming-RHKXXZQE.js → incoming-I3TNXHDV.js} +5 -5
  40. package/dist/{job-ARXJVJID.js → job-V5BVH6EN.js} +6 -6
  41. package/dist/{login-CH75UC6I.js → login-TRGTHHB3.js} +2 -2
  42. package/dist/{message-WTGOJZGL.js → message-CAAOJEYQ.js} +7 -7
  43. package/dist/{motion-TQU6ZS6N.js → motion-NQKMLNH4.js} +90 -7
  44. package/dist/{network-JUQA3X5S.js → network-CDMKWOZG.js} +5 -5
  45. package/dist/{notification-GN5Y25GL.js → notification-SC4SHB5F.js} +6 -6
  46. package/dist/{notifications-C5CBK574.js → notifications-VN2MDDPZ.js} +6 -6
  47. package/dist/{post-HT2UWXXO.js → post-TWHMSQP4.js} +12 -12
  48. package/dist/{profile-ZSBAZPFQ.js → profile-4J3RB7US.js} +16 -16
  49. package/dist/{recruiter-CSG4XSZ4.js → recruiter-QUNXM3CY.js} +11 -11
  50. package/dist/{sales-nav-LDI7MTGU.js → sales-nav-4U6F7GPN.js} +11 -11
  51. package/dist/{search-NLIL5SXI.js → search-7HD2X2WX.js} +14 -14
  52. package/dist/{setup-UGELD4FZ.js → setup-YH5DNST4.js} +4 -4
  53. package/dist/{team-LWDBXG4K.js → team-G5C3LDYA.js} +5 -5
  54. package/dist/{tier-LOI4ZOVV.js → tier-N7CENZXH.js} +4 -4
  55. package/dist/{unibox-IL6SRMK2.js → unibox-I7VDPY6A.js} +13 -6
  56. package/dist/{webhook-TAXMQNEK.js → webhook-OPXGVBFW.js} +5 -5
  57. package/package.json +2 -2
  58. package/dist/core-HXREJJCJ.js +0 -46
@@ -1,9 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- AttachError,
4
- readAttachment,
5
- toAttachmentPayload
6
- } from "./chunk-5I6JJJIV.js";
7
2
  import {
8
3
  BinaryOutputError,
9
4
  writeBinaryOutput
@@ -15,18 +10,25 @@ import {
15
10
  } from "./chunk-Q3ZPRFUX.js";
16
11
  import {
17
12
  normalizeChatId,
18
- resolveIdentifier
13
+ resolveIdentifier,
14
+ resolveJobIdentifier
19
15
  } from "./chunk-UEAX6KUB.js";
16
+ import {
17
+ AttachError,
18
+ isAudioFile,
19
+ readAttachment,
20
+ toAttachmentPayload
21
+ } from "./chunk-VHNF6OZD.js";
20
22
  import {
21
23
  requireAccount
22
- } from "./chunk-JYCNHE72.js";
24
+ } from "./chunk-QFUZCTD7.js";
23
25
  import {
24
26
  buildPreviewOutput
25
27
  } from "./chunk-TCUYH5GO.js";
26
28
  import {
27
29
  readableId,
28
30
  readableObject
29
- } from "./chunk-FO54X4T2.js";
31
+ } from "./chunk-XPQP2FZX.js";
30
32
  import {
31
33
  renderError,
32
34
  renderSuccess,
@@ -36,7 +38,7 @@ import {
36
38
  createClient,
37
39
  downloadBinary,
38
40
  resolveEffectiveConfig
39
- } from "./chunk-56JSZNRW.js";
41
+ } from "./chunk-N7UA24IK.js";
40
42
  import {
41
43
  READ_SINGLE_FLAGS,
42
44
  WRITE_FLAGS,
@@ -44,7 +46,7 @@ import {
44
46
  } from "./chunk-RYWWSZUH.js";
45
47
  import {
46
48
  DESCRIPTIONS
47
- } from "./chunk-73DJ3KNE.js";
49
+ } from "./chunk-FBBZVIFJ.js";
48
50
  import {
49
51
  looksLikeCommandWord,
50
52
  nearestSubcommand
@@ -112,12 +114,46 @@ function normalizeAttachPaths(attach) {
112
114
  if (!attach) return [];
113
115
  return Array.isArray(attach) ? attach : [attach];
114
116
  }
117
+ function readSharedContent(flags, text, attachPaths, out) {
118
+ const post = flags["share-post"];
119
+ const job = flags["share-job"];
120
+ if (post === void 0 && job === void 0) return void 0;
121
+ const refuse = (msg) => {
122
+ out.stderr.write(`error: ${msg}
123
+ `);
124
+ process.exit(2);
125
+ };
126
+ if (post !== void 0 && job !== void 0) refuse("pass --share-post or --share-job, not both.");
127
+ const flag = post !== void 0 ? "--share-post" : "--share-job";
128
+ const raw = (post ?? job ?? "").trim();
129
+ if (raw === "") refuse(`${flag} was given an empty value. Pass the id, or omit the flag.`);
130
+ if (text.trim() === "") refuse(`${flag} needs the message text: the ${post !== void 0 ? "post" : "job posting"} is shown beside it.`);
131
+ if (attachPaths.length > 0) refuse(`${flag} cannot be combined with --attach.`);
132
+ return post !== void 0 ? { type: "post", id: raw } : { type: "job_posting", id: resolveJobIdentifier(raw) };
133
+ }
134
+ function readVoiceNote(flags, text, attachPaths, out) {
135
+ const refuse = (msg) => {
136
+ out.stderr.write(`error: ${msg}
137
+ `);
138
+ process.exit(2);
139
+ };
140
+ const asFile = flags["as-file"] === true;
141
+ if (text.trim() === "" && attachPaths.length === 0) refuse("nothing to send: pass the message text, or --attach a file.");
142
+ if (asFile && attachPaths.length === 0) refuse("--as-file needs --attach: it sends the attached files as downloads.");
143
+ if (asFile || !attachPaths.some(isAudioFile)) return { voiceNote: false, sendMode: asFile ? "file" : void 0 };
144
+ if (attachPaths.length > 1) refuse("a voice note is one audio file alone: pass a single --attach, or add --as-file to send the files as downloads.");
145
+ if (text.trim() !== "") refuse("a voice note carries no text: drop the text, or add --as-file to send the audio as a download with it.");
146
+ return { voiceNote: true, sendMode: void 0 };
147
+ }
148
+ function normalizeToValues(to) {
149
+ return (Array.isArray(to) ? to : to === void 0 ? [] : [to]).filter((v) => v !== "");
150
+ }
115
151
  var MEMBER_URN_RE = /^urn:li:member:\d+$/;
116
152
  var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
117
153
  async function handleSdkError(err, outOpts, out) {
118
154
  const { CurviateError } = await import("@curviate/sdk");
119
155
  if (err instanceof CurviateError) {
120
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
156
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
121
157
  renderError(err, outOpts, out);
122
158
  process.exit(getExitCode(err));
123
159
  }
@@ -137,7 +173,7 @@ function willSendAsNotice(chatId) {
137
173
  async function runMessageNew(client, flags, out, _readStdin) {
138
174
  const subject = readChatSubjectFlag(flags, out);
139
175
  const accountId = await requireAccount(client, flags, out);
140
- const rawTo = flags.to ?? "";
176
+ const rawTos = normalizeToValues(flags.to);
141
177
  const rawText = flags.text ?? "";
142
178
  const attachPaths = normalizeAttachPaths(flags.attach);
143
179
  let attachBuffers = [];
@@ -154,24 +190,37 @@ async function runMessageNew(client, flags, out, _readStdin) {
154
190
  const ns = client.account(accountId);
155
191
  const outOpts = resolveOutputOpts(flags);
156
192
  const text = await resolveTextOrStdin(rawText, out, _readStdin);
157
- const resolvedSlugOrId = resolveIdentifier(rawTo);
158
- let providerId;
159
- if (MEMBER_PROVIDER_ID_RE.test(resolvedSlugOrId)) {
160
- providerId = resolvedSlugOrId;
161
- } else {
162
- try {
163
- providerId = readableId(await ns.users.get(resolvedSlugOrId, {}));
164
- } catch (err) {
165
- await handleSdkError(err, outOpts, out);
166
- return;
193
+ const sharedContent = readSharedContent(flags, text, attachPaths, out);
194
+ const { voiceNote, sendMode } = readVoiceNote(flags, text, attachPaths, out);
195
+ const attendeeIds = [];
196
+ for (const rawTo of rawTos) {
197
+ const resolvedSlugOrId = resolveIdentifier(rawTo);
198
+ let providerId;
199
+ if (MEMBER_PROVIDER_ID_RE.test(resolvedSlugOrId)) {
200
+ providerId = resolvedSlugOrId;
201
+ } else {
202
+ try {
203
+ providerId = readableId(await ns.users.get(resolvedSlugOrId, {}));
204
+ } catch (err) {
205
+ await handleSdkError(err, outOpts, out);
206
+ return;
207
+ }
167
208
  }
209
+ if (providerId !== void 0 && !attendeeIds.includes(providerId)) attendeeIds.push(providerId);
168
210
  }
169
- const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf));
211
+ const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf, sendMode));
170
212
  if (flags.preview) {
171
213
  const preview = buildPreviewOutput({
172
214
  method: "messaging.startChat",
173
- args: { attendees_ids: [providerId] },
174
- body: { attendees_ids: [providerId], text, ...subject !== void 0 ? { subject } : {} },
215
+ args: { attendees_ids: attendeeIds },
216
+ body: {
217
+ attendees_ids: attendeeIds,
218
+ ...voiceNote ? {} : { text },
219
+ ...subject !== void 0 ? { subject } : {},
220
+ ...voiceNote ? { voice_note: true } : {},
221
+ ...sendMode ? { send_mode: sendMode } : {},
222
+ ...sharedContent ? { shared_content: sharedContent } : {}
223
+ },
175
224
  account: accountId,
176
225
  attachments: attachBuffers.map((buf, i) => ({
177
226
  name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
@@ -182,12 +231,14 @@ async function runMessageNew(client, flags, out, _readStdin) {
182
231
  return;
183
232
  }
184
233
  const body = {
185
- attendees_ids: [providerId],
186
- text,
234
+ attendees_ids: attendeeIds,
235
+ // A voice note carries no text: the key is left out, never sent empty.
236
+ ...voiceNote ? {} : { text },
187
237
  // Present only when the flag was given: an absent subject must leave the
188
238
  // key out, never send `subject: ""` (the server has no `.min(1)`).
189
239
  ...subject !== void 0 ? { subject } : {},
190
- ...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {}
240
+ ...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {},
241
+ ...sharedContent ? { shared_content: sharedContent } : {}
191
242
  };
192
243
  try {
193
244
  const result = await ns.messaging.startChat(body);
@@ -202,6 +253,8 @@ async function runMessageSend(client, flags, out, _readStdin) {
202
253
  const rawText = flags.text ?? "";
203
254
  const attachPaths = normalizeAttachPaths(flags.attach);
204
255
  const text = await resolveTextOrStdin(rawText, out, _readStdin);
256
+ const sharedContent = readSharedContent(flags, text, attachPaths, out);
257
+ const { voiceNote, sendMode } = readVoiceNote(flags, text, attachPaths, out);
205
258
  let attachBuffers = [];
206
259
  try {
207
260
  attachBuffers = await Promise.all(attachPaths.map((p) => readAttachment(p)));
@@ -217,7 +270,12 @@ async function runMessageSend(client, flags, out, _readStdin) {
217
270
  const preview = buildPreviewOutput({
218
271
  method: "messaging.sendMessage",
219
272
  args: { chat_id: chatId },
220
- body: { text },
273
+ body: {
274
+ ...voiceNote ? {} : { text },
275
+ ...sharedContent ? { shared_content: sharedContent } : {},
276
+ ...voiceNote ? { voice_note: true } : {},
277
+ ...sendMode ? { send_mode: sendMode } : {}
278
+ },
221
279
  account: accountId,
222
280
  attachments: attachBuffers.map((buf, i) => ({
223
281
  name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
@@ -229,10 +287,11 @@ async function runMessageSend(client, flags, out, _readStdin) {
229
287
  if (willSendAs) out.stderr.write(willSendAs);
230
288
  return;
231
289
  }
232
- const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf));
290
+ const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf, sendMode));
233
291
  const body = {
234
- text,
235
- ...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {}
292
+ ...voiceNote ? {} : { text },
293
+ ...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {},
294
+ ...sharedContent ? { shared_content: sharedContent } : {}
236
295
  };
237
296
  const ns = client.account(accountId);
238
297
  const outOpts = resolveOutputOpts(flags);
@@ -363,7 +422,7 @@ async function runMessageAttachment(client, flags, out, isTTY) {
363
422
  async function runMessageInMail(client, flags, out, _readStdin) {
364
423
  const subject = readInMailSubjectFlag(flags, out);
365
424
  const accountId = await requireAccount(client, flags, out);
366
- const rawTo = flags.to ?? "";
425
+ const rawTo = normalizeToValues(flags.to)[0] ?? "";
367
426
  if (!rawTo) {
368
427
  out.stderr.write(
369
428
  "error: --to: not a valid LinkedIn URL, slug, provider-id, or URN.\n"
@@ -424,21 +483,38 @@ async function runMessageInMailBalance(client, flags, out) {
424
483
  await handleSdkError(err, outOpts, out);
425
484
  }
426
485
  }
486
+ var ATTACH_DESC = "File to attach (repeatable). Not with --share-post or --share-job. One audio file (MP3, WAV, M4A, WebM, Ogg) alone, with no text, to one person, arrives as a voice note: no duration limit is stated here, and a size the platform refuses is PAYLOAD_TOO_LARGE. Audio to a group, in InMail or to a company page stays a file. --as-file keeps audio a file.";
487
+ var AS_FILE = {
488
+ type: "boolean",
489
+ description: "Send every --attach as a file download, audio included (send_mode file). Then the audio may carry text, and several files may go together."
490
+ };
491
+ var SHARE_ARGS = {
492
+ "share-post": {
493
+ type: "string",
494
+ description: "Show a post natively in the message, beside the text (text required, no --attach). The post id from `curviate core post get` or a list; an activity id, URN or share URL also works. Not with --share-job. Whether a post id renders in the message is unproven until a live send."
495
+ },
496
+ "share-job": {
497
+ type: "string",
498
+ description: "Show a job posting natively in the message, beside the text (text required, no --attach). The numeric job id or a LinkedIn job URL. Not with --share-post."
499
+ }
500
+ };
427
501
  var messageNewCommand = defineCommand({
428
502
  meta: {
429
503
  name: "new",
430
504
  description: "Start a new chat with one or more members.",
431
505
  risk: "write",
432
506
  rules: {
433
- changes: "Starts a chat with the recipient and sends the opening message from your Account.",
434
- visible_to: "The recipient, in their LinkedIn inbox.",
507
+ changes: "Starts a chat with the recipient (a group chat with two or more --to) and sends the opening message from your Account.",
508
+ visible_to: "The recipient, or every member of a group, in their LinkedIn inbox.",
435
509
  budget_rows: ["messages_first_degree"],
436
510
  retry: "Not safe: requests carry no idempotency key, so a retry after a timeout can repeat it. Read `curviate core inbox list` first.",
437
511
  undo: "`curviate core message delete <chat_id> <message_id>` removes the message; the chat stays and the recipient may have read it."
438
512
  },
439
513
  errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person." },
440
514
  examples: [
441
- 'curviate core message new --to janesmith "Hi Jane, enjoyed your post on agent evals."'
515
+ 'curviate core message new --to janesmith "Hi Jane, enjoyed your post on agent evals."',
516
+ 'curviate core message new --to janesmith --to ACoAAAexample --subject "Q4 intro" "Hi both, meet each other." --preview',
517
+ "curviate core message new --to janesmith --attach hello.m4a"
442
518
  ]
443
519
  },
444
520
  args: {
@@ -446,15 +522,17 @@ var messageNewCommand = defineCommand({
446
522
  ...WRITE_FLAGS,
447
523
  to: {
448
524
  type: "string",
449
- description: "Recipient: LinkedIn profile URL (e.g. https://www.linkedin.com/in/some-slug), bare slug (e.g. some-slug), or provider ID (e.g. ACoAAA...). URL and slug inputs resolve the provider ID automatically.",
525
+ description: "Recipient (repeatable): LinkedIn profile URL (e.g. https://www.linkedin.com/in/some-slug), bare slug (e.g. some-slug), or provider ID (e.g. ACoAAA...). URL and slug inputs resolve the provider ID automatically. One --to starts a direct chat; two or more different people start a group chat. A person named twice counts once.",
450
526
  required: true
451
527
  },
452
- text: { type: "positional", stdinArg: true, description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
528
+ text: { type: "positional", stdinArg: true, required: false, description: "Opening message text. Pass - to read from stdin (e.g. via heredoc or pipe). Omit it only for a voice note: one --attach audio file alone." },
453
529
  subject: {
454
530
  type: "string",
455
- description: "Optional conversation name / subject line (at most 200 characters). Omit it for an unnamed chat; an empty value is a usage error."
531
+ description: "Optional conversation name / subject line (at most 200 characters). The group's name when there are two or more people. Omit it for an unnamed chat; an empty value is a usage error."
456
532
  },
457
- attach: { type: "string", description: "File to attach (repeatable)." }
533
+ attach: { type: "string", description: ATTACH_DESC },
534
+ "as-file": AS_FILE,
535
+ ...SHARE_ARGS
458
536
  },
459
537
  async run({ args }) {
460
538
  const flags = args;
@@ -742,7 +820,9 @@ var messageSendCommand = defineCommand({
742
820
  },
743
821
  errors: { ...AS_ACCOUNT, ...BUDGET, ...TARGET, RECIPIENT_UNREACHABLE: "LinkedIn will not let the Account message this person.", CHAT_NOT_VISIBLE: "the chat is not visible to the Account." },
744
822
  examples: [
745
- 'curviate core message send 2-YTQ3ODU3Njgt "Thanks, that makes sense."'
823
+ 'curviate core message send 2-YTQ3ODU3Njgt "Thanks, that makes sense."',
824
+ 'curviate core message send 2-YTQ3ODU3Njgt --share-post 7380123456789012345 "This is the post I meant." --preview',
825
+ "curviate core message send 2-YTQ3ODU3Njgt --attach hello.m4a"
746
826
  ]
747
827
  },
748
828
  args: {
@@ -752,8 +832,10 @@ var messageSendCommand = defineCommand({
752
832
  type: "positional",
753
833
  description: "Chat ID or LinkedIn messaging thread URL. A COMPANY_ chat id sends as the company page; any other chat id sends as the connected member."
754
834
  },
755
- text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
756
- attach: { type: "string", description: "File to attach (repeatable)." }
835
+ text: { type: "positional", stdinArg: true, required: false, description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe). Omit it only for a voice note: one --attach audio file alone." },
836
+ attach: { type: "string", description: ATTACH_DESC },
837
+ "as-file": AS_FILE,
838
+ ...SHARE_ARGS
757
839
  },
758
840
  async run({ args }) {
759
841
  const flags = args;
@@ -815,7 +897,7 @@ var MESSAGE_SUBCOMMANDS = [
815
897
  "inmail",
816
898
  "inmail-balance"
817
899
  ];
818
- var MESSAGE_USAGE = 'Usage: curviate core message new --to <attendee> "<text>" [--subject <s>] [--attach <file>...]\n curviate core message send <chat_id> "<text>" [--attach <file>...]\n curviate core message <chat_id> "<text>" [--attach <file>...]\n curviate core message get <chat_id> <message_id>\n curviate core message edit <chat_id> <message_id> "<text>"\n curviate core message delete <chat_id> <message_id>\n curviate core message react <chat_id> <message_id> <emoji>\n curviate core message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate core message inmail --to <id> --subject <s> "<text>"\n curviate core message inmail-balance\n';
900
+ var MESSAGE_USAGE = 'Usage: curviate core message new --to <attendee>... "<text>" [--subject <s>] [--attach <file>... | --share-post <id> | --share-job <id>]\n curviate core message send <chat_id> "<text>" [--attach <file>... | --share-post <id> | --share-job <id>]\n curviate core message <chat_id> "<text>" [--attach <file>... | --share-post <id> | --share-job <id>]\n curviate core message get <chat_id> <message_id>\n curviate core message edit <chat_id> <message_id> "<text>"\n curviate core message delete <chat_id> <message_id>\n curviate core message react <chat_id> <message_id> <emoji>\n curviate core message attachment <chat_id> <message_id> <attachment_id> [-o <file>]\n curviate core message inmail --to <id> --subject <s> "<text>"\n curviate core message inmail-balance\n';
819
901
  function guardBareMessageForm(chatId, out) {
820
902
  if (!looksLikeCommandWord(chatId)) return;
821
903
  const suggestion = nearestSubcommand(chatId, [...MESSAGE_SUBCOMMANDS]);
@@ -863,7 +945,9 @@ var messageCommand = defineCommand({
863
945
  required: false
864
946
  },
865
947
  text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin.", required: false },
866
- attach: { type: "string", description: "File to attach (repeatable)." }
948
+ attach: { type: "string", description: ATTACH_DESC },
949
+ "as-file": AS_FILE,
950
+ ...SHARE_ARGS
867
951
  },
868
952
  subCommands: {
869
953
  new: messageNewCommand,
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readablePage
4
- } from "./chunk-FO54X4T2.js";
4
+ } from "./chunk-XPQP2FZX.js";
5
5
  import {
6
6
  assertNoStdinPlaceholder
7
7
  } from "./chunk-ZYURL5VK.js";
8
8
  import {
9
9
  getExitCode
10
- } from "./chunk-2W4RN5ON.js";
10
+ } from "./chunk-QW5K5DTC.js";
11
11
 
12
12
  // src/lib/path-safety.ts
13
13
  var UNSAFE_CHARS = /[\u0000-\u0020\u007F/\\?#%]/;
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  fail,
4
4
  outputOpts
5
- } from "./chunk-3SF6JIMA.js";
5
+ } from "./chunk-LTPME424.js";
6
6
 
7
7
  // src/lib/chunks.ts
8
8
  async function sendInChunks(ids, size, send, f) {
@@ -32,7 +32,7 @@ async function sendChunked(chunks, send, f, unit) {
32
32
  `);
33
33
  return fail(err, f);
34
34
  }
35
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
35
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
36
36
  const e = err.toJSON();
37
37
  if (outputOpts(f).json) process.stdout.write(JSON.stringify({ error: e, progress }) + "\n");
38
38
  process.stderr.write(
@@ -213,6 +213,8 @@ var EXIT_CODE_MAP = {
213
213
  CONTACT_NOT_ENROLLABLE: 2,
214
214
  CHAT_NOT_ONE_TO_ONE: 2,
215
215
  STEP_IN_FLIGHT: 7,
216
+ // Voice clips: the file is empty, not audio, undecodable or outside 1 to 120 seconds; it never succeeds as sent.
217
+ VOICE_CLIP_INVALID: 2,
216
218
  // Client-side: no response within --timeout. Transient, as a refused connection is.
217
219
  CLIENT_TIMEOUT: 7
218
220
  };
@@ -43,18 +43,23 @@ var MIME_BY_EXT = {
43
43
  function guessContentType(filePath) {
44
44
  return MIME_BY_EXT[extname(filePath).toLowerCase()] ?? "application/octet-stream";
45
45
  }
46
- function toAttachmentPayload(filePath, buf) {
46
+ function toAttachmentPayload(filePath, buf, sendMode) {
47
47
  return {
48
48
  content: buf.toString("base64"),
49
49
  content_type: guessContentType(filePath),
50
- filename: basename(filePath)
50
+ filename: basename(filePath),
51
+ ...sendMode ? { send_mode: sendMode } : {}
51
52
  };
52
53
  }
54
+ function isAudioFile(filePath) {
55
+ return guessContentType(filePath).startsWith("audio/");
56
+ }
53
57
 
54
58
  export {
55
59
  AttachError,
56
60
  readAttachment,
57
61
  describeAttachment,
58
62
  guessContentType,
59
- toAttachmentPayload
63
+ toAttachmentPayload,
64
+ isAudioFile
60
65
  };
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  requireAccount
4
- } from "./chunk-JYCNHE72.js";
4
+ } from "./chunk-QFUZCTD7.js";
5
5
  import {
6
6
  writeAtomic
7
7
  } from "./chunk-GOICALYQ.js";
8
8
  import {
9
9
  sendInChunks
10
- } from "./chunk-COYDNWKF.js";
10
+ } from "./chunk-QOVYLEUY.js";
11
11
  import {
12
12
  fail,
13
13
  listFlag,
14
14
  outputOpts,
15
15
  rootClient,
16
16
  usage
17
- } from "./chunk-3SF6JIMA.js";
17
+ } from "./chunk-LTPME424.js";
18
18
  import {
19
19
  buildPreviewOutput
20
20
  } from "./chunk-TCUYH5GO.js";
@@ -29,14 +29,14 @@ import {
29
29
  readablePage,
30
30
  rejectPaginationModifiersWithoutAll,
31
31
  streamAll
32
- } from "./chunk-FO54X4T2.js";
32
+ } from "./chunk-XPQP2FZX.js";
33
33
  import {
34
34
  renderSuccess,
35
35
  writeNdjsonItem
36
36
  } from "./chunk-QM57YDJE.js";
37
37
  import {
38
38
  downloadBinary
39
- } from "./chunk-56JSZNRW.js";
39
+ } from "./chunk-N7UA24IK.js";
40
40
  import {
41
41
  GLOBAL_FLAGS,
42
42
  READ_SINGLE_FLAGS,
@@ -46,7 +46,7 @@ import {
46
46
  import {
47
47
  DESCRIPTIONS,
48
48
  lazy
49
- } from "./chunk-73DJ3KNE.js";
49
+ } from "./chunk-FBBZVIFJ.js";
50
50
 
51
51
  // src/commands/contact.ts
52
52
  import { defineCommand } from "citty";
@@ -501,15 +501,15 @@ var contactCommand = defineCommand({
501
501
  create: createCmd,
502
502
  update: updateCmd,
503
503
  delete: deleteCmd,
504
- import: lazy("contactImport", () => import("./contact-import-6G2DUCIN.js").then((m) => m.contactImportCommand)),
504
+ import: lazy("contactImport", () => import("./contact-import-CQW3RQGN.js").then((m) => m.contactImportCommand)),
505
505
  export: exportCmd,
506
506
  enrich: enrichCmd,
507
- lists: lazy("contactLists", () => import("./contact-groups-TXPUYQYC.js").then((m) => m.contactListsCommand)),
508
- tags: lazy("contactTags", () => import("./contact-groups-TXPUYQYC.js").then((m) => m.contactTagsCommand)),
509
- imports: lazy("contactImports", () => import("./contact-import-6G2DUCIN.js").then((m) => m.contactImportsCommand))
507
+ lists: lazy("contactLists", () => import("./contact-groups-6S6AM5WV.js").then((m) => m.contactListsCommand)),
508
+ tags: lazy("contactTags", () => import("./contact-groups-6S6AM5WV.js").then((m) => m.contactTagsCommand)),
509
+ imports: lazy("contactImports", () => import("./contact-import-CQW3RQGN.js").then((m) => m.contactImportsCommand))
510
510
  },
511
511
  async run() {
512
- const { showHelp } = await import("./examples-74FXGJ7X.js");
512
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
513
513
  await showHelp(contactCommand, ["curviate", "contact"]);
514
514
  }
515
515
  });
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-QM57YDJE.js";
6
6
  import {
7
7
  isPlainObject
8
- } from "./chunk-56JSZNRW.js";
8
+ } from "./chunk-N7UA24IK.js";
9
9
 
10
10
  // src/lib/paginate.ts
11
11
  import { CurviateError } from "@curviate/sdk";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-UEAX6KUB.js";
5
5
  import {
6
6
  readableId
7
- } from "./chunk-FO54X4T2.js";
7
+ } from "./chunk-XPQP2FZX.js";
8
8
 
9
9
  // src/lib/member-id.ts
10
10
  var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
package/dist/cli.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-RYWWSZUH.js";
16
16
  import {
17
17
  lazy
18
- } from "./chunk-73DJ3KNE.js";
18
+ } from "./chunk-FBBZVIFJ.js";
19
19
  import {
20
20
  editDistance
21
21
  } from "./chunk-FDJMAF7D.js";
@@ -45,33 +45,33 @@ var main = defineCommand({
45
45
  // Subcommand registry, names and descriptions are static for help rendering;
46
46
  // the handler implementation is loaded lazily on first invocation.
47
47
  subCommands: {
48
- setup: lazy("setup", () => import("./setup-UGELD4FZ.js").then((m) => m.setupCommand)),
49
- doctor: lazy("doctor", () => import("./doctor-GDBH2PH7.js").then((m) => m.doctorCommand)),
50
- login: lazy("login", () => import("./login-CH75UC6I.js").then((m) => m.loginCommand)),
51
- config: lazy("config", () => import("./config-KHXQZD6F.js").then((m) => m.configCommand)),
52
- account: lazy("account", () => import("./account-7KKJEHAM.js").then((m) => m.accountCommand)),
53
- motion: lazy("motion", () => import("./motion-TQU6ZS6N.js").then((m) => m.motionCommand)),
54
- enrollment: lazy("enrollment", () => import("./enrollment-2JVHRUNI.js").then((m) => m.enrollmentCommand)),
55
- contact: lazy("contact", () => import("./contact-325QZ5IB.js").then((m) => m.contactCommand)),
56
- "do-not-contact": lazy("do-not-contact", () => import("./do-not-contact-CP6WKW5T.js").then((m) => m.doNotContactCommand)),
57
- unibox: lazy("unibox", () => import("./unibox-IL6SRMK2.js").then((m) => m.uniboxCommand)),
58
- network: lazy("network", () => import("./network-JUQA3X5S.js").then((m) => m.networkCommand)),
59
- analytics: lazy("analytics", () => import("./analytics-XBAFRYSC.js").then((m) => m.analyticsCommand)),
60
- notification: lazy("notification", () => import("./notifications-C5CBK574.js").then((m) => m.notificationsCommand)),
61
- export: lazy("export", () => import("./export-URIKCSIO.js").then((m) => m.exportCommand)),
62
- billing: lazy("billing", () => import("./billing-AQ5VNIYA.js").then((m) => m.billingCommand)),
63
- tier: lazy("tier", () => import("./tier-LOI4ZOVV.js").then((m) => m.tierCommand)),
64
- team: lazy("team", () => import("./team-LWDBXG4K.js").then((m) => m.teamCommand)),
65
- incoming: lazy("incoming", () => import("./incoming-RHKXXZQE.js").then((m) => m.incomingCommand)),
66
- beta: lazy("beta", () => import("./beta-consent-FP2QGN6M.js").then((m) => m.betaCommand)),
67
- webhook: lazy("webhook", () => import("./webhook-TAXMQNEK.js").then((m) => m.webhookCommand)),
48
+ setup: lazy("setup", () => import("./setup-YH5DNST4.js").then((m) => m.setupCommand)),
49
+ doctor: lazy("doctor", () => import("./doctor-OUDGTEYR.js").then((m) => m.doctorCommand)),
50
+ login: lazy("login", () => import("./login-TRGTHHB3.js").then((m) => m.loginCommand)),
51
+ config: lazy("config", () => import("./config-YBFTZASA.js").then((m) => m.configCommand)),
52
+ account: lazy("account", () => import("./account-TBPPGZME.js").then((m) => m.accountCommand)),
53
+ motion: lazy("motion", () => import("./motion-NQKMLNH4.js").then((m) => m.motionCommand)),
54
+ enrollment: lazy("enrollment", () => import("./enrollment-KXLN32RT.js").then((m) => m.enrollmentCommand)),
55
+ contact: lazy("contact", () => import("./contact-6GSXKSL7.js").then((m) => m.contactCommand)),
56
+ "do-not-contact": lazy("do-not-contact", () => import("./do-not-contact-6DFZYGRI.js").then((m) => m.doNotContactCommand)),
57
+ unibox: lazy("unibox", () => import("./unibox-I7VDPY6A.js").then((m) => m.uniboxCommand)),
58
+ network: lazy("network", () => import("./network-CDMKWOZG.js").then((m) => m.networkCommand)),
59
+ analytics: lazy("analytics", () => import("./analytics-ECRDJRTF.js").then((m) => m.analyticsCommand)),
60
+ notification: lazy("notification", () => import("./notifications-VN2MDDPZ.js").then((m) => m.notificationsCommand)),
61
+ export: lazy("export", () => import("./export-XOAHDY7W.js").then((m) => m.exportCommand)),
62
+ billing: lazy("billing", () => import("./billing-6AJ4AB77.js").then((m) => m.billingCommand)),
63
+ tier: lazy("tier", () => import("./tier-N7CENZXH.js").then((m) => m.tierCommand)),
64
+ team: lazy("team", () => import("./team-G5C3LDYA.js").then((m) => m.teamCommand)),
65
+ incoming: lazy("incoming", () => import("./incoming-I3TNXHDV.js").then((m) => m.incomingCommand)),
66
+ beta: lazy("beta", () => import("./beta-consent-7RLD2CJU.js").then((m) => m.betaCommand)),
67
+ webhook: lazy("webhook", () => import("./webhook-OPXGVBFW.js").then((m) => m.webhookCommand)),
68
68
  // The LinkedIn building blocks. Reserved product groups
69
69
  // (unibox, network, analytics, team) land
70
70
  // between `enrollment` and `webhook` with their owning specs.
71
- core: lazy("core", () => import("./core-HXREJJCJ.js").then((m) => m.coreCommand))
71
+ core: lazy("core", () => import("./core-5NYENM4A.js").then((m) => m.coreCommand))
72
72
  },
73
73
  async run() {
74
- const { showHelp } = await import("./examples-74FXGJ7X.js");
74
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
75
75
  await showHelp(main, ["curviate"]);
76
76
  }
77
77
  });
@@ -363,7 +363,7 @@ async function dispatch(root, rawArgs) {
363
363
  helpFor = "curviate";
364
364
  if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
365
365
  const { leaf, path } = await resolveLeaf(root, rawArgs.filter((a) => a !== "--help" && a !== "-h"));
366
- const { showHelp } = await import("./examples-74FXGJ7X.js");
366
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
367
367
  await showHelp(leaf, path);
368
368
  await new Promise((done) => process.stdout.write("", () => done()));
369
369
  process.exit(0);
@@ -445,7 +445,7 @@ async function dispatch(root, rawArgs) {
445
445
  if (code === "EARG") process.stderr.write(helpPointer());
446
446
  const { CurviateError } = await import("@curviate/sdk");
447
447
  if (err instanceof CurviateError) {
448
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
448
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
449
449
  process.exit(getExitCode(err));
450
450
  }
451
451
  process.exit(code === "EARG" ? 2 : 1);
@@ -1,22 +1,22 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  resolveMemberOrMeProviderId
4
- } from "./chunk-Q5GVXN7Z.js";
5
- import {
6
- AttachError,
7
- describeAttachment,
8
- readAttachment,
9
- toAttachmentPayload
10
- } from "./chunk-5I6JJJIV.js";
4
+ } from "./chunk-YGNDS4CW.js";
11
5
  import {
12
6
  AS_ACCOUNT,
13
7
  BUDGET,
14
8
  TARGET
15
9
  } from "./chunk-Q3ZPRFUX.js";
16
10
  import "./chunk-UEAX6KUB.js";
11
+ import {
12
+ AttachError,
13
+ describeAttachment,
14
+ readAttachment,
15
+ toAttachmentPayload
16
+ } from "./chunk-VHNF6OZD.js";
17
17
  import {
18
18
  requireAccount
19
- } from "./chunk-JYCNHE72.js";
19
+ } from "./chunk-QFUZCTD7.js";
20
20
  import {
21
21
  buildPreviewOutput
22
22
  } from "./chunk-TCUYH5GO.js";
@@ -27,7 +27,7 @@ import {
27
27
  readablePage,
28
28
  rejectPaginationModifiersWithoutAll,
29
29
  streamAll
30
- } from "./chunk-FO54X4T2.js";
30
+ } from "./chunk-XPQP2FZX.js";
31
31
  import {
32
32
  renderError,
33
33
  renderSuccess,
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  createClient,
39
39
  resolveEffectiveConfig
40
- } from "./chunk-56JSZNRW.js";
40
+ } from "./chunk-N7UA24IK.js";
41
41
  import {
42
42
  GLOBAL_FLAGS,
43
43
  WRITE_SINGLE_FLAGS,
@@ -45,11 +45,11 @@ import {
45
45
  } from "./chunk-RYWWSZUH.js";
46
46
  import {
47
47
  DESCRIPTIONS
48
- } from "./chunk-73DJ3KNE.js";
48
+ } from "./chunk-FBBZVIFJ.js";
49
49
  import {
50
50
  resolveTextOrStdin
51
51
  } from "./chunk-ZYURL5VK.js";
52
- import "./chunk-2W4RN5ON.js";
52
+ import "./chunk-QW5K5DTC.js";
53
53
 
54
54
  // src/commands/comment.ts
55
55
  import { defineCommand } from "citty";
@@ -78,7 +78,7 @@ function buildListQuery(flags, out) {
78
78
  async function handleSdkError(err, outOpts, out) {
79
79
  const { CurviateError } = await import("@curviate/sdk");
80
80
  if (err instanceof CurviateError) {
81
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
81
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
82
82
  renderError(err, outOpts, out);
83
83
  process.exit(getExitCode(err));
84
84
  }