@curviate/cli 0.50.0-next.5 → 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 +6 -0
  2. package/README.md +29 -0
  3. package/dist/{account-WF27VTZF.js → account-TBPPGZME.js} +8 -8
  4. package/dist/{analytics-Z7AE5JEI.js → analytics-ECRDJRTF.js} +5 -5
  5. package/dist/{beta-consent-VETVR6KP.js → beta-consent-7RLD2CJU.js} +4 -4
  6. package/dist/{billing-TYXPR6ZC.js → billing-6AJ4AB77.js} +5 -5
  7. package/dist/{chunk-73DJ3KNE.js → chunk-FBBZVIFJ.js} +2 -1
  8. package/dist/{chunk-X62K5XDP.js → chunk-K26JD5NC.js} +6 -6
  9. package/dist/{chunk-GGJTO3PN.js → chunk-LTPME424.js} +2 -2
  10. package/dist/{chunk-I3HD5UFH.js → chunk-N7UA24IK.js} +1 -1
  11. package/dist/{chunk-QLBNUWM2.js → chunk-NKB4RJUH.js} +57 -23
  12. package/dist/{chunk-HOS3JH4L.js → chunk-QFUZCTD7.js} +2 -2
  13. package/dist/{chunk-5YQXZIFH.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-RLZP2PL4.js → chunk-XJOWMIW2.js} +11 -11
  17. package/dist/{chunk-UFHZGBFD.js → chunk-XPQP2FZX.js} +1 -1
  18. package/dist/{chunk-EHTSCHKM.js → chunk-YGNDS4CW.js} +1 -1
  19. package/dist/cli.js +25 -25
  20. package/dist/{comment-YAQSZNYS.js → comment-7QCABJ53.js} +13 -13
  21. package/dist/{company-4K75VGBM.js → company-LH56TXM6.js} +12 -12
  22. package/dist/{config-OESEJHKZ.js → config-YBFTZASA.js} +2 -2
  23. package/dist/{connect-LZJQOYX2.js → connect-5X5VIQOO.js} +11 -11
  24. package/dist/{contact-XE7HK4RI.js → contact-6GSXKSL7.js} +8 -8
  25. package/dist/{contact-groups-IHF7GMNG.js → contact-groups-6S6AM5WV.js} +10 -10
  26. package/dist/{contact-import-SSPUBHAH.js → contact-import-CQW3RQGN.js} +9 -9
  27. package/dist/core-5NYENM4A.js +46 -0
  28. package/dist/{do-not-contact-LOUCA7JT.js → do-not-contact-6DFZYGRI.js} +5 -5
  29. package/dist/{doctor-Q3434Q7N.js → doctor-OUDGTEYR.js} +4 -4
  30. package/dist/{draft-SOO3UJIO.js → draft-AETHWRIX.js} +9 -9
  31. package/dist/{enrollment-YQMSDXVJ.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-F6ZFNZ7L.js → export-XOAHDY7W.js} +4 -4
  35. package/dist/{feed-YE4HOQ2M.js → feed-W3LMXJHQ.js} +6 -6
  36. package/dist/{group-OCKSOR65.js → group-TLC75WME.js} +6 -6
  37. package/dist/{inbox-VGCODDRH.js → inbox-ID4EFMTQ.js} +6 -6
  38. package/dist/{inboxes-XHP6F3MQ.js → inboxes-SRBQ3FAI.js} +6 -6
  39. package/dist/{incoming-AA3MTRAG.js → incoming-I3TNXHDV.js} +5 -5
  40. package/dist/{job-KFZNTBXT.js → job-V5BVH6EN.js} +6 -6
  41. package/dist/{login-BD7JQXGX.js → login-TRGTHHB3.js} +2 -2
  42. package/dist/{message-IXUDKHBW.js → message-CAAOJEYQ.js} +7 -7
  43. package/dist/{motion-QSANYJKR.js → motion-NQKMLNH4.js} +90 -7
  44. package/dist/{network-A5M6SLRI.js → network-CDMKWOZG.js} +5 -5
  45. package/dist/{notification-XRCV5XNX.js → notification-SC4SHB5F.js} +6 -6
  46. package/dist/{notifications-SU7NKFGF.js → notifications-VN2MDDPZ.js} +6 -6
  47. package/dist/{post-YWXQ2MVL.js → post-TWHMSQP4.js} +12 -12
  48. package/dist/{profile-JVNJAAZ7.js → profile-4J3RB7US.js} +16 -16
  49. package/dist/{recruiter-34G433BX.js → recruiter-QUNXM3CY.js} +11 -11
  50. package/dist/{sales-nav-34WK5HF6.js → sales-nav-4U6F7GPN.js} +11 -11
  51. package/dist/{search-43YUBUEH.js → search-7HD2X2WX.js} +14 -14
  52. package/dist/{setup-RFSXQVN6.js → setup-YH5DNST4.js} +4 -4
  53. package/dist/{team-WSRM74PS.js → team-G5C3LDYA.js} +5 -5
  54. package/dist/{tier-JQYS4MMF.js → tier-N7CENZXH.js} +4 -4
  55. package/dist/{unibox-LFTLITLA.js → unibox-I7VDPY6A.js} +5 -5
  56. package/dist/{webhook-HX2NOPNE.js → webhook-OPXGVBFW.js} +5 -5
  57. package/package.json +2 -2
  58. package/dist/core-524AMFTQ.js +0 -46
package/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@ a new command or flag is a minor; a breaking command/flag/exit-code change is a
10
10
 
11
11
  Requires the next `@curviate/sdk` (a commit pin on the SDK PR build until it is published; `check:sdk-pin` refuses a publish until the pin is a version). The vendored OpenAPI fixture is re-copied from the SDK's, regenerated from the deployed staging document.
12
12
 
13
+ ### Voice notes
14
+
15
+ - `curviate motion voice-clip upload <file>` uploads one audio file (MP3, WAV, M4A, WebM or Ogg; 1 to 120 seconds, up to 20 MiB, 100 uploads per Team per 24 hours) and prints the clip; its `id` (`vc_...`) is the `clip_id` of a `voice.send` step. `motion voice-clip get <id>` reads one back. `--preview` sends nothing. A refused upload is exit `2` (`VOICE_CLIP_INVALID` names the reason), `PAYLOAD_TOO_LARGE` over 20 MiB, `RATE_LIMIT_TENANT` (exit `6`) past the cap.
16
+ - `motion lint`, `motion create` and `motion update` check a `voice.send` step with the SDK's validator (R13 a malformed `clip_id`, R19 no `fallback`, no text beside a clip).
17
+ - `message new`, `message send` and the bare `message <chat_id>`: one `--attach` audio file alone, with no text, to one person arrives as a voice note (the text argument is optional then). `--as-file` sends every attachment as a download (`send_mode: "file"`), audio included, and then text may come with it. Audio with text, a second file or shared content is exit `2` with nothing sent; `--as-file` without `--attach` is exit `2`.
18
+
13
19
  ### Added
14
20
 
15
21
  - `message new --to` is repeatable: two or more different people start a group chat, `--subject` its name. A person named twice counts once (`--preview` shows the list sent). A voice note stays out of groups.
package/README.md CHANGED
@@ -276,6 +276,20 @@ curviate core message send 2-YTQ3ODU3Njgt --share-job 4012345678 --account acc_1
276
276
 
277
277
  `--share-post` takes the post id from `curviate core post get` or a list (an activity id, URN or share URL also works); `--share-job` takes the numeric job id or a job URL. Both together, no text, or `--attach` is exit `2` with nothing sent. A company-page chat and Sales Navigator or Recruiter chats do not take shared content. Whether a post id renders in the message is unproven until a live send.
278
278
 
279
+ ### 9. Send a voice note
280
+
281
+ One audio file (MP3, WAV, M4A, WebM or Ogg), alone, with no text, to one person arrives as a voice note. A direct message states no duration limit; a size the platform refuses is `PAYLOAD_TOO_LARGE`. Audio to a group, in InMail or to a company page stays a file.
282
+
283
+ ```bash
284
+ curviate core message send 2-YTQ3ODU3Njgt --attach hello.m4a --account acc_1 --preview # nothing sent
285
+ curviate core message new --to janesmith --attach hello.m4a --account acc_1
286
+
287
+ # Keep audio a file download instead (it may then carry text):
288
+ curviate core message send 2-YTQ3ODU3Njgt "The recording." --attach hello.m4a --as-file --account acc_1
289
+ ```
290
+
291
+ Audio with text, with a second file, or with `--share-post` / `--share-job` is exit `2` with nothing sent (add `--as-file` to send files as downloads). `--as-file` without `--attach` is exit `2`.
292
+
279
293
  ## Company
280
294
 
281
295
  Company commands (`curviate core company ...`) are Core-tier reads. `curviate core company <id>` accepts a public
@@ -352,6 +366,21 @@ motion.json:7:32 error R12 pause.wait: must be a duration between 1m and 365d: a
352
366
 
353
367
  `curviate motion create` and `curviate motion update` check the same way before anything is sent. `curviate motion get mot_1 --json` prints a file `curviate motion update mot_1 --file -` accepts as is; add `--if-revision <n>` to refuse the save when someone changed the Sequence since you read it.
354
368
 
369
+ ### Voice notes in a Sequence
370
+
371
+ A `voice.send` step plays an uploaded clip instead of text. Upload the file once, then put its id in the Sequence. Nothing reaches LinkedIn until you start the Motion.
372
+
373
+ ```bash
374
+ curviate motion voice-clip upload intro.mp3 --json # {"id":"vc_...","duration_ms":42010,...}: 1 to 120 s, up to 20 MiB, 100 uploads per Team per 24 hours
375
+ curviate motion voice-clip get vc_01J8Z3K9P0Q1R2S3T4V5W6X7Y8
376
+ ```
377
+
378
+ ```json
379
+ { "id": "voice", "do": "voice.send", "with": { "clip_id": "vc_01J8Z3K9P0Q1R2S3T4V5W6X7Y8", "fallback": "Hi, thanks for connecting." }, "next": "end" }
380
+ ```
381
+
382
+ `fallback` is required and has no variables: it is sent as text when the audio cannot go. For A/B, use `variants: [{ "id": "a", "clip_id": "vc_..." }, { "id": "b", "clip_id": "vc_..." }]` with a shared `with.fallback`, and no text. `curviate motion lint` checks the shape (`R13` a malformed `clip_id`, `R19` no `fallback`); a `clip_id` that is not a clip of your Team is refused when the Motion is saved. `VOICE_CLIP_INVALID` (exit 2) names the reason an upload was refused: not audio, unreadable, under 1 or over 120 seconds; a clip is never shortened. Over 20 MiB is `PAYLOAD_TOO_LARGE`; the 101st upload in 24 hours is `RATE_LIMIT_TENANT` (exit 6, `Retry-After`). A clip no Sequence uses is deleted 30 days after its upload.
383
+
355
384
  ### 2. Find and fix Enrollments
356
385
 
357
386
  ```bash
@@ -10,7 +10,7 @@ import {
10
10
  grammarParams,
11
11
  renderOverview,
12
12
  windowParams
13
- } from "./chunk-X62K5XDP.js";
13
+ } from "./chunk-K26JD5NC.js";
14
14
  import {
15
15
  print,
16
16
  table
@@ -22,7 +22,7 @@ import {
22
22
  outputOpts,
23
23
  rootClient,
24
24
  usage
25
- } from "./chunk-GGJTO3PN.js";
25
+ } from "./chunk-LTPME424.js";
26
26
  import {
27
27
  buildPreviewOutput
28
28
  } from "./chunk-TCUYH5GO.js";
@@ -37,7 +37,7 @@ import {
37
37
  readablePage,
38
38
  rejectPaginationModifiersWithoutAll,
39
39
  streamAll
40
- } from "./chunk-UFHZGBFD.js";
40
+ } from "./chunk-XPQP2FZX.js";
41
41
  import {
42
42
  isJsonMode,
43
43
  renderError,
@@ -53,7 +53,7 @@ import {
53
53
  import {
54
54
  createClient,
55
55
  resolveEffectiveConfig
56
- } from "./chunk-I3HD5UFH.js";
56
+ } from "./chunk-N7UA24IK.js";
57
57
  import {
58
58
  GLOBAL_FLAGS,
59
59
  READ_SINGLE_FLAGS,
@@ -62,7 +62,7 @@ import {
62
62
  } from "./chunk-RYWWSZUH.js";
63
63
  import {
64
64
  DESCRIPTIONS
65
- } from "./chunk-73DJ3KNE.js";
65
+ } from "./chunk-FBBZVIFJ.js";
66
66
  import {
67
67
  parseDocument,
68
68
  readFileFlag
@@ -74,7 +74,7 @@ import {
74
74
  } from "./chunk-ZYURL5VK.js";
75
75
  import {
76
76
  AUTH_NEEDED
77
- } from "./chunk-2W4RN5ON.js";
77
+ } from "./chunk-QW5K5DTC.js";
78
78
 
79
79
  // src/commands/account-insights.ts
80
80
  import { defineCommand } from "citty";
@@ -666,7 +666,7 @@ var connectRequestCommand = defineCommand4({
666
666
  meta: { name: "connect-request", description: "Connect a LinkedIn account without any credential passing through you: create a request, give the person its link, read it until done." },
667
667
  subCommands: { create: createCmd, get: getCmd2, cancel: cancelCmd },
668
668
  async run() {
669
- const { showHelp } = await import("./examples-74FXGJ7X.js");
669
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
670
670
  await showHelp(connectRequestCommand, ["curviate", "account", "connect-request"]);
671
671
  }
672
672
  });
@@ -697,7 +697,7 @@ function resolveOutputOpts(flags) {
697
697
  async function handleError(err, outOpts, out) {
698
698
  const { CurviateError } = await import("@curviate/sdk");
699
699
  if (err instanceof CurviateError) {
700
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
700
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
701
701
  renderError(err, outOpts, out);
702
702
  process.exit(getExitCode(err));
703
703
  }
@@ -6,16 +6,16 @@ import {
6
6
  grammarParams,
7
7
  renderOverview,
8
8
  windowParams
9
- } from "./chunk-X62K5XDP.js";
9
+ } from "./chunk-K26JD5NC.js";
10
10
  import "./chunk-5S3MJVI5.js";
11
11
  import "./chunk-PPGKQJKU.js";
12
- import "./chunk-GGJTO3PN.js";
12
+ import "./chunk-LTPME424.js";
13
13
  import "./chunk-NNV2OYEF.js";
14
- import "./chunk-UFHZGBFD.js";
14
+ import "./chunk-XPQP2FZX.js";
15
15
  import "./chunk-QM57YDJE.js";
16
- import "./chunk-I3HD5UFH.js";
16
+ import "./chunk-N7UA24IK.js";
17
17
  import "./chunk-RYWWSZUH.js";
18
- import "./chunk-73DJ3KNE.js";
18
+ import "./chunk-FBBZVIFJ.js";
19
19
  import "./chunk-ZYURL5VK.js";
20
20
  export {
21
21
  GRAMMAR_ARGS,
@@ -4,14 +4,14 @@ import {
4
4
  outputOpts,
5
5
  rootClient,
6
6
  usage
7
- } from "./chunk-GGJTO3PN.js";
7
+ } from "./chunk-LTPME424.js";
8
8
  import {
9
9
  buildPreviewOutput
10
10
  } from "./chunk-TCUYH5GO.js";
11
11
  import {
12
12
  renderSuccess
13
13
  } from "./chunk-QM57YDJE.js";
14
- import "./chunk-I3HD5UFH.js";
14
+ import "./chunk-N7UA24IK.js";
15
15
  import {
16
16
  READ_SINGLE_FLAGS,
17
17
  WRITE_SINGLE_FLAGS,
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-RYWWSZUH.js";
20
20
  import {
21
21
  DESCRIPTIONS
22
- } from "./chunk-73DJ3KNE.js";
22
+ } from "./chunk-FBBZVIFJ.js";
23
23
  import "./chunk-ZYURL5VK.js";
24
24
 
25
25
  // src/commands/beta-consent.ts
@@ -72,7 +72,7 @@ var betaCommand = defineCommand({
72
72
  meta: { name: "beta", description: DESCRIPTIONS.beta },
73
73
  subCommands: { status: statusCmd, update: updateCmd },
74
74
  async run() {
75
- const { showHelp } = await import("./examples-74FXGJ7X.js");
75
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
76
76
  await showHelp(betaCommand, ["curviate", "beta"]);
77
77
  }
78
78
  });
@@ -7,7 +7,7 @@ import {
7
7
  outputOpts,
8
8
  rootClient,
9
9
  usage
10
- } from "./chunk-GGJTO3PN.js";
10
+ } from "./chunk-LTPME424.js";
11
11
  import {
12
12
  intFlag
13
13
  } from "./chunk-NNV2OYEF.js";
@@ -18,21 +18,21 @@ import {
18
18
  readablePage,
19
19
  rejectPaginationModifiersWithoutAll,
20
20
  streamAll
21
- } from "./chunk-UFHZGBFD.js";
21
+ } from "./chunk-XPQP2FZX.js";
22
22
  import {
23
23
  renderSuccess,
24
24
  writeNdjsonItem
25
25
  } from "./chunk-QM57YDJE.js";
26
26
  import {
27
27
  downloadBinary
28
- } from "./chunk-I3HD5UFH.js";
28
+ } from "./chunk-N7UA24IK.js";
29
29
  import {
30
30
  GLOBAL_FLAGS,
31
31
  readOnly
32
32
  } from "./chunk-RYWWSZUH.js";
33
33
  import {
34
34
  DESCRIPTIONS
35
- } from "./chunk-73DJ3KNE.js";
35
+ } from "./chunk-FBBZVIFJ.js";
36
36
  import "./chunk-ZYURL5VK.js";
37
37
 
38
38
  // src/commands/billing.ts
@@ -115,7 +115,7 @@ var billingCommand = defineCommand({
115
115
  meta: { name: "billing", description: DESCRIPTIONS.billing },
116
116
  subCommands: { invoices: invoicesCmd },
117
117
  async run() {
118
- const { showHelp } = await import("./examples-74FXGJ7X.js");
118
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
119
119
  await showHelp(billingCommand, ["curviate", "billing"]);
120
120
  }
121
121
  });
@@ -7,7 +7,8 @@ var DESCRIPTIONS = {
7
7
  login: "Save an API key to a local profile. Run `curviate core profile me` to verify.",
8
8
  config: "Manage CLI profiles and settings.",
9
9
  account: "LinkedIn account connection management.",
10
- motion: "Motions: one Sequence run for the Contacts of your Team's Contact lists, from its sending Accounts, paced on a schedule. Create and edit drafts, preview, start, pause, resume, archive, add or remove Contacts; lint a Sequence and write a template offline. Your Team's data: every role reads; writes need motion-send on each sending Account, and Motions need the Automate plan.",
10
+ motion: "Motions: one Sequence run for the Contacts of your Team's Contact lists, from its sending Accounts, paced on a schedule. Create and edit drafts, preview, start, pause, resume, archive, add or remove Contacts; lint a Sequence and write a template offline; upload the audio of a voice note step (`curviate motion voice-clip`). Your Team's data: every role reads; writes need motion-send on each sending Account, and Motions need the Automate plan.",
11
+ motionVoiceClip: "Voice clips: the audio a `voice.send` step plays. Upload one audio file (1 to 120 seconds, up to 20 MiB), then put its id in a Sequence as `clip_id`; read one back. Nothing reaches LinkedIn until a Motion that uses it is started. Uploads need the Automate plan.",
11
12
  enrollment: "Enrollments: one Contact in one Motion on one Account. List and read them; pause, resume, retry a failed Step, stop, send a custom event, reassign, or act on many at once. Your Team's data: every role reads; writes need operate on the Enrollment's Account.",
12
13
  contact: "Contacts: the people in your Team's lists, not LinkedIn actions. List, read, add, change and delete them; import and export; enrich from LinkedIn profiles. Subgroups: `curviate contact lists` (Contact lists, including combining lists), `curviate contact tags`, `curviate contact imports`. Your Team's data: every role reads and writes; deleting is for Owners and Managers.",
13
14
  "do-not-contact": "Do-not-contact: your Team's one list of people no Motion contacts and no write reaches (a write toward them exits 10). List, read, add, change the reason, remove. Any member adds; removing is for Owners and Managers.",
@@ -13,7 +13,7 @@ import {
13
13
  outputOpts,
14
14
  rootClient,
15
15
  usage
16
- } from "./chunk-GGJTO3PN.js";
16
+ } from "./chunk-LTPME424.js";
17
17
  import {
18
18
  intFlag
19
19
  } from "./chunk-NNV2OYEF.js";
@@ -24,14 +24,14 @@ import {
24
24
  readablePage,
25
25
  rejectPaginationModifiersWithoutAll,
26
26
  streamAll
27
- } from "./chunk-UFHZGBFD.js";
27
+ } from "./chunk-XPQP2FZX.js";
28
28
  import {
29
29
  renderSuccess,
30
30
  writeNdjsonItem
31
31
  } from "./chunk-QM57YDJE.js";
32
32
  import {
33
33
  downloadBinary
34
- } from "./chunk-I3HD5UFH.js";
34
+ } from "./chunk-N7UA24IK.js";
35
35
  import {
36
36
  GLOBAL_FLAGS,
37
37
  READ_SINGLE_FLAGS,
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-RYWWSZUH.js";
40
40
  import {
41
41
  DESCRIPTIONS
42
- } from "./chunk-73DJ3KNE.js";
42
+ } from "./chunk-FBBZVIFJ.js";
43
43
 
44
44
  // src/commands/analytics.ts
45
45
  import { defineCommand } from "citty";
@@ -312,7 +312,7 @@ var eventsCommand = defineCommand({
312
312
  meta: { name: "events", description: "The records behind the analytics numbers." },
313
313
  subCommands: { list: eventsListCmd },
314
314
  async run() {
315
- const { showHelp } = await import("./examples-74FXGJ7X.js");
315
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
316
316
  await showHelp(eventsCommand, ["curviate", "analytics", "events"]);
317
317
  }
318
318
  });
@@ -324,7 +324,7 @@ var analyticsCommand = defineCommand({
324
324
  export: exportCmd
325
325
  },
326
326
  async run() {
327
- const { showHelp } = await import("./examples-74FXGJ7X.js");
327
+ const { showHelp } = await import("./examples-ICAGL2S5.js");
328
328
  await showHelp(analyticsCommand, ["curviate", "analytics"]);
329
329
  }
330
330
  });
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  createClient,
8
8
  resolveEffectiveConfig
9
- } from "./chunk-I3HD5UFH.js";
9
+ } from "./chunk-N7UA24IK.js";
10
10
 
11
11
  // src/lib/root-command.ts
12
12
  var outputOpts = (f) => ({
@@ -35,7 +35,7 @@ async function rootClient(f) {
35
35
  async function fail(err, f) {
36
36
  const { CurviateError } = await import("@curviate/sdk");
37
37
  if (err instanceof CurviateError) {
38
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
38
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
39
39
  renderError(err, outputOpts(f), process);
40
40
  process.exit(getExitCode(err));
41
41
  }
@@ -274,7 +274,7 @@ import { AsyncLocalStorage } from "async_hooks";
274
274
  import { Curviate, CurviateError as CurviateError2 } from "@curviate/sdk";
275
275
 
276
276
  // package.json
277
- var version = "0.50.0-next.5";
277
+ var version = "0.50.0-next.6";
278
278
 
279
279
  // src/lib/client.ts
280
280
  function headerStrings(headers) {
@@ -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
@@ -18,16 +13,22 @@ import {
18
13
  resolveIdentifier,
19
14
  resolveJobIdentifier
20
15
  } from "./chunk-UEAX6KUB.js";
16
+ import {
17
+ AttachError,
18
+ isAudioFile,
19
+ readAttachment,
20
+ toAttachmentPayload
21
+ } from "./chunk-VHNF6OZD.js";
21
22
  import {
22
23
  requireAccount
23
- } from "./chunk-HOS3JH4L.js";
24
+ } from "./chunk-QFUZCTD7.js";
24
25
  import {
25
26
  buildPreviewOutput
26
27
  } from "./chunk-TCUYH5GO.js";
27
28
  import {
28
29
  readableId,
29
30
  readableObject
30
- } from "./chunk-UFHZGBFD.js";
31
+ } from "./chunk-XPQP2FZX.js";
31
32
  import {
32
33
  renderError,
33
34
  renderSuccess,
@@ -37,7 +38,7 @@ import {
37
38
  createClient,
38
39
  downloadBinary,
39
40
  resolveEffectiveConfig
40
- } from "./chunk-I3HD5UFH.js";
41
+ } from "./chunk-N7UA24IK.js";
41
42
  import {
42
43
  READ_SINGLE_FLAGS,
43
44
  WRITE_FLAGS,
@@ -45,7 +46,7 @@ import {
45
46
  } from "./chunk-RYWWSZUH.js";
46
47
  import {
47
48
  DESCRIPTIONS
48
- } from "./chunk-73DJ3KNE.js";
49
+ } from "./chunk-FBBZVIFJ.js";
49
50
  import {
50
51
  looksLikeCommandWord,
51
52
  nearestSubcommand
@@ -130,6 +131,20 @@ function readSharedContent(flags, text, attachPaths, out) {
130
131
  if (attachPaths.length > 0) refuse(`${flag} cannot be combined with --attach.`);
131
132
  return post !== void 0 ? { type: "post", id: raw } : { type: "job_posting", id: resolveJobIdentifier(raw) };
132
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
+ }
133
148
  function normalizeToValues(to) {
134
149
  return (Array.isArray(to) ? to : to === void 0 ? [] : [to]).filter((v) => v !== "");
135
150
  }
@@ -138,7 +153,7 @@ var MEMBER_PROVIDER_ID_RE = /^A[CDE][A-Za-z0-9_-]{4,}$/;
138
153
  async function handleSdkError(err, outOpts, out) {
139
154
  const { CurviateError } = await import("@curviate/sdk");
140
155
  if (err instanceof CurviateError) {
141
- const { getExitCode } = await import("./exit-codes-7DBETBDT.js");
156
+ const { getExitCode } = await import("./exit-codes-CYQHN4NE.js");
142
157
  renderError(err, outOpts, out);
143
158
  process.exit(getExitCode(err));
144
159
  }
@@ -176,6 +191,7 @@ async function runMessageNew(client, flags, out, _readStdin) {
176
191
  const outOpts = resolveOutputOpts(flags);
177
192
  const text = await resolveTextOrStdin(rawText, out, _readStdin);
178
193
  const sharedContent = readSharedContent(flags, text, attachPaths, out);
194
+ const { voiceNote, sendMode } = readVoiceNote(flags, text, attachPaths, out);
179
195
  const attendeeIds = [];
180
196
  for (const rawTo of rawTos) {
181
197
  const resolvedSlugOrId = resolveIdentifier(rawTo);
@@ -192,15 +208,17 @@ async function runMessageNew(client, flags, out, _readStdin) {
192
208
  }
193
209
  if (providerId !== void 0 && !attendeeIds.includes(providerId)) attendeeIds.push(providerId);
194
210
  }
195
- const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf));
211
+ const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf, sendMode));
196
212
  if (flags.preview) {
197
213
  const preview = buildPreviewOutput({
198
214
  method: "messaging.startChat",
199
215
  args: { attendees_ids: attendeeIds },
200
216
  body: {
201
217
  attendees_ids: attendeeIds,
202
- text,
218
+ ...voiceNote ? {} : { text },
203
219
  ...subject !== void 0 ? { subject } : {},
220
+ ...voiceNote ? { voice_note: true } : {},
221
+ ...sendMode ? { send_mode: sendMode } : {},
204
222
  ...sharedContent ? { shared_content: sharedContent } : {}
205
223
  },
206
224
  account: accountId,
@@ -214,7 +232,8 @@ async function runMessageNew(client, flags, out, _readStdin) {
214
232
  }
215
233
  const body = {
216
234
  attendees_ids: attendeeIds,
217
- text,
235
+ // A voice note carries no text: the key is left out, never sent empty.
236
+ ...voiceNote ? {} : { text },
218
237
  // Present only when the flag was given: an absent subject must leave the
219
238
  // key out, never send `subject: ""` (the server has no `.min(1)`).
220
239
  ...subject !== void 0 ? { subject } : {},
@@ -235,6 +254,7 @@ async function runMessageSend(client, flags, out, _readStdin) {
235
254
  const attachPaths = normalizeAttachPaths(flags.attach);
236
255
  const text = await resolveTextOrStdin(rawText, out, _readStdin);
237
256
  const sharedContent = readSharedContent(flags, text, attachPaths, out);
257
+ const { voiceNote, sendMode } = readVoiceNote(flags, text, attachPaths, out);
238
258
  let attachBuffers = [];
239
259
  try {
240
260
  attachBuffers = await Promise.all(attachPaths.map((p) => readAttachment(p)));
@@ -250,7 +270,12 @@ async function runMessageSend(client, flags, out, _readStdin) {
250
270
  const preview = buildPreviewOutput({
251
271
  method: "messaging.sendMessage",
252
272
  args: { chat_id: chatId },
253
- body: { text, ...sharedContent ? { shared_content: sharedContent } : {} },
273
+ body: {
274
+ ...voiceNote ? {} : { text },
275
+ ...sharedContent ? { shared_content: sharedContent } : {},
276
+ ...voiceNote ? { voice_note: true } : {},
277
+ ...sendMode ? { send_mode: sendMode } : {}
278
+ },
254
279
  account: accountId,
255
280
  attachments: attachBuffers.map((buf, i) => ({
256
281
  name: attachPaths[i] ? attachPaths[i].split("/").pop() ?? attachPaths[i] : `attachment_${i}`,
@@ -262,9 +287,9 @@ async function runMessageSend(client, flags, out, _readStdin) {
262
287
  if (willSendAs) out.stderr.write(willSendAs);
263
288
  return;
264
289
  }
265
- const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf));
290
+ const attachmentPayloads = attachBuffers.map((buf, i) => toAttachmentPayload(attachPaths[i], buf, sendMode));
266
291
  const body = {
267
- text,
292
+ ...voiceNote ? {} : { text },
268
293
  ...attachmentPayloads.length > 0 ? { attachments: attachmentPayloads } : {},
269
294
  ...sharedContent ? { shared_content: sharedContent } : {}
270
295
  };
@@ -458,6 +483,11 @@ async function runMessageInMailBalance(client, flags, out) {
458
483
  await handleSdkError(err, outOpts, out);
459
484
  }
460
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
+ };
461
491
  var SHARE_ARGS = {
462
492
  "share-post": {
463
493
  type: "string",
@@ -484,7 +514,7 @@ var messageNewCommand = defineCommand({
484
514
  examples: [
485
515
  'curviate core message new --to janesmith "Hi Jane, enjoyed your post on agent evals."',
486
516
  'curviate core message new --to janesmith --to ACoAAAexample --subject "Q4 intro" "Hi both, meet each other." --preview',
487
- 'curviate core message new --to janesmith --share-job 4012345678 "Thought of you for this one."'
517
+ "curviate core message new --to janesmith --attach hello.m4a"
488
518
  ]
489
519
  },
490
520
  args: {
@@ -495,12 +525,13 @@ var messageNewCommand = defineCommand({
495
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.",
496
526
  required: true
497
527
  },
498
- 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." },
499
529
  subject: {
500
530
  type: "string",
501
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."
502
532
  },
503
- attach: { type: "string", description: "File to attach (repeatable). Not with --share-post or --share-job. A voice note stays out of groups." },
533
+ attach: { type: "string", description: ATTACH_DESC },
534
+ "as-file": AS_FILE,
504
535
  ...SHARE_ARGS
505
536
  },
506
537
  async run({ args }) {
@@ -790,7 +821,8 @@ var messageSendCommand = defineCommand({
790
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." },
791
822
  examples: [
792
823
  'curviate core message send 2-YTQ3ODU3Njgt "Thanks, that makes sense."',
793
- 'curviate core message send 2-YTQ3ODU3Njgt --share-post 7380123456789012345 "This is the post I meant." --preview'
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"
794
826
  ]
795
827
  },
796
828
  args: {
@@ -800,8 +832,9 @@ var messageSendCommand = defineCommand({
800
832
  type: "positional",
801
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."
802
834
  },
803
- text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin (e.g. via heredoc or pipe)." },
804
- attach: { type: "string", description: "File to attach (repeatable). Not with --share-post or --share-job." },
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,
805
838
  ...SHARE_ARGS
806
839
  },
807
840
  async run({ args }) {
@@ -912,7 +945,8 @@ var messageCommand = defineCommand({
912
945
  required: false
913
946
  },
914
947
  text: { type: "positional", stdinArg: true, description: "Message text. Pass - to read from stdin.", required: false },
915
- attach: { type: "string", description: "File to attach (repeatable). Not with --share-post or --share-job." },
948
+ attach: { type: "string", description: ATTACH_DESC },
949
+ "as-file": AS_FILE,
916
950
  ...SHARE_ARGS
917
951
  },
918
952
  subCommands: {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readablePage
4
- } from "./chunk-UFHZGBFD.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-GGJTO3PN.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
  };