@curviate/cli 0.57.0 → 0.58.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 (68) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/README.md +9 -2
  3. package/dist/{account-IRIYB2SG.js → account-GSL6BCNX.js} +52 -16
  4. package/dist/{analytics-IRSCLVOL.js → analytics-4FUMJSMC.js} +6 -6
  5. package/dist/{beta-consent-NQVGFZL3.js → beta-consent-EC2QF6CM.js} +4 -4
  6. package/dist/billing-STRNXA4H.js +19 -0
  7. package/dist/{chunk-6OT6TS7N.js → chunk-3IL3D5IZ.js} +2 -2
  8. package/dist/{chunk-3ZQNOKEK.js → chunk-5OAJ4D65.js} +2 -2
  9. package/dist/{chunk-AMTKGO37.js → chunk-5Z3CCE5N.js} +1 -1
  10. package/dist/{billing-TCTP44ZB.js → chunk-7F6B7P32.js} +123 -12
  11. package/dist/{chunk-3B5M2RUN.js → chunk-CQHCPZ5I.js} +1 -1
  12. package/dist/{chunk-SCUTAREU.js → chunk-EWSOIFG2.js} +17 -0
  13. package/dist/{chunk-RKNW4UX4.js → chunk-JKOQX46J.js} +6 -0
  14. package/dist/{chunk-VHNF6OZD.js → chunk-JY26SUNH.js} +18 -2
  15. package/dist/{chunk-VPFV7YV3.js → chunk-KS4I4B3Z.js} +6 -6
  16. package/dist/{chunk-OE4CY3ZL.js → chunk-KUVJM5CP.js} +1 -1
  17. package/dist/{chunk-F7CLAS5Y.js → chunk-MLZSXQZC.js} +2 -2
  18. package/dist/{chunk-RXDG57B2.js → chunk-PBJZQZPO.js} +1 -1
  19. package/dist/{chunk-A6JGJGDF.js → chunk-WGGZWJPO.js} +16 -16
  20. package/dist/{chunk-AG6G3PRQ.js → chunk-WITIJCUU.js} +17 -13
  21. package/dist/{chunk-5LGKZBAY.js → chunk-XDPU2YAF.js} +4 -3
  22. package/dist/{chunk-RTT75CXE.js → chunk-XXB4MAX3.js} +86 -14
  23. package/dist/cli.js +33 -33
  24. package/dist/{comment-PNHEKGZX.js → comment-MUELYZYN.js} +8 -8
  25. package/dist/{company-OUFF23SU.js → company-5N7CXORR.js} +8 -8
  26. package/dist/{company-record-ULPDDB6L.js → company-record-HWLTP4TV.js} +95 -10
  27. package/dist/{config-U6VDNL2P.js → config-PI7JMQ2L.js} +2 -2
  28. package/dist/{connect-ICNXC37R.js → connect-NNZOOPWV.js} +11 -11
  29. package/dist/{contact-K6RIVQWU.js → contact-VNG7HRCN.js} +9 -9
  30. package/dist/{contact-groups-CNH2VB6A.js → contact-groups-6JF7VX6Q.js} +11 -11
  31. package/dist/{contact-import-FK22UTN2.js → contact-import-TMJWY2VD.js} +11 -11
  32. package/dist/core-ZRJY3HTF.js +46 -0
  33. package/dist/{do-not-contact-BQHXNHTV.js → do-not-contact-GDVIUNMT.js} +22 -20
  34. package/dist/{doctor-ZYPZF5BE.js → doctor-ZNAR5AZ2.js} +4 -4
  35. package/dist/{document-H65EXU4L.js → document-G6UND26L.js} +1 -1
  36. package/dist/{domain-HLOT6Y4A.js → domain-62YUYVDW.js} +5 -5
  37. package/dist/{draft-JGQ36JSH.js → draft-ED6RL67K.js} +5 -5
  38. package/dist/{enrollment-CF634DB4.js → enrollment-LN3Z3RC5.js} +14 -10
  39. package/dist/{examples-J4X5NEIE.js → examples-5FJS47QF.js} +2 -2
  40. package/dist/{exit-codes-P2FLCKM7.js → exit-codes-LQDMGDII.js} +1 -1
  41. package/dist/{export-ZQLDQYUZ.js → export-S6D4FEAG.js} +4 -4
  42. package/dist/{feed-RQHEDZVL.js → feed-AC7HWUCD.js} +6 -6
  43. package/dist/{group-LRMG76FN.js → group-6N37Q5ZS.js} +6 -6
  44. package/dist/{inbox-5RGG5RQG.js → inbox-JFRBROQ2.js} +6 -6
  45. package/dist/{inboxes-ZFY6ZP33.js → inboxes-IBZHZKSD.js} +6 -6
  46. package/dist/{incoming-3MJ4CP6H.js → incoming-YDRPPO24.js} +8 -8
  47. package/dist/{job-QFIUTHHT.js → job-CSRHIFZM.js} +6 -6
  48. package/dist/{login-THXWX5HZ.js → login-M7ZLOR2U.js} +2 -2
  49. package/dist/mailbox-E2K3I2VH.js +712 -0
  50. package/dist/{message-DM5OUKQS.js → message-SX6RDGWP.js} +7 -7
  51. package/dist/{motion-NKOAK7NU.js → motion-4HH3OFI6.js} +121 -16
  52. package/dist/{network-VKJUMZ2L.js → network-JQYLSQDH.js} +12 -12
  53. package/dist/{notification-XW5J6KFA.js → notification-ZAQM463D.js} +6 -6
  54. package/dist/{notifications-USYOV54R.js → notifications-N55F3DP3.js} +9 -9
  55. package/dist/{post-M2G3BK4A.js → post-SIHHJX3P.js} +8 -8
  56. package/dist/{profile-3SG64IEG.js → profile-VBHX3QGP.js} +12 -12
  57. package/dist/{recruiter-7OUGZ776.js → recruiter-7AGFKQPI.js} +9 -9
  58. package/dist/{sales-nav-HHQLLM5C.js → sales-nav-ADVFBKWB.js} +9 -9
  59. package/dist/{search-5LMSLUH4.js → search-THJFPGOH.js} +16 -16
  60. package/dist/{setup-6F4HYUSZ.js → setup-D6D7SNND.js} +4 -4
  61. package/dist/{signal-LVODDBOY.js → signal-TGSF7WEP.js} +126 -19
  62. package/dist/{team-MSOPELF6.js → team-MVNHCWJP.js} +8 -8
  63. package/dist/{tier-RXHOAQ6L.js → tier-DAF7Y2HN.js} +4 -4
  64. package/dist/{unibox-UAA6WIGZ.js → unibox-7B6B4SXB.js} +292 -14
  65. package/dist/{webhook-J2H7X766.js → webhook-NUVSTDXF.js} +12 -12
  66. package/package.json +3 -3
  67. package/dist/core-MPEBYNSL.js +0 -46
  68. package/dist/mailbox-54DPLNXA.js +0 -412
@@ -3,19 +3,24 @@ import {
3
3
  print,
4
4
  table
5
5
  } from "./chunk-5S3MJVI5.js";
6
+ import {
7
+ AttachError,
8
+ readAttachment,
9
+ toAttachmentPayload
10
+ } from "./chunk-JY26SUNH.js";
6
11
  import {
7
12
  fail,
8
13
  listFlag,
9
14
  outputOpts,
10
15
  rootClient,
11
16
  usage
12
- } from "./chunk-3ZQNOKEK.js";
13
- import {
14
- intFlag
15
- } from "./chunk-NNV2OYEF.js";
17
+ } from "./chunk-5OAJ4D65.js";
16
18
  import {
17
19
  buildPreviewOutput
18
20
  } from "./chunk-TCUYH5GO.js";
21
+ import {
22
+ intFlag
23
+ } from "./chunk-NNV2OYEF.js";
19
24
  import {
20
25
  pageDelayFromFlags,
21
26
  readCursorFlag,
@@ -23,12 +28,12 @@ import {
23
28
  readablePage,
24
29
  rejectPaginationModifiersWithoutAll,
25
30
  streamAll
26
- } from "./chunk-OE4CY3ZL.js";
31
+ } from "./chunk-KUVJM5CP.js";
27
32
  import {
28
33
  renderSuccess,
29
34
  writeNdjsonItem
30
35
  } from "./chunk-QM57YDJE.js";
31
- import "./chunk-RXDG57B2.js";
36
+ import "./chunk-PBJZQZPO.js";
32
37
  import {
33
38
  GLOBAL_FLAGS,
34
39
  WRITE_SINGLE_FLAGS,
@@ -36,11 +41,13 @@ import {
36
41
  } from "./chunk-QLKGOIWS.js";
37
42
  import {
38
43
  DESCRIPTIONS
39
- } from "./chunk-5LGKZBAY.js";
44
+ } from "./chunk-XDPU2YAF.js";
40
45
  import "./chunk-ZYURL5VK.js";
41
46
 
42
47
  // src/commands/unibox.ts
43
48
  import { defineCommand } from "citty";
49
+ var EMAIL_MAX_FILES = 10;
50
+ var EMAIL_MAX_FILE_BYTES = 20 * 1024 * 1024;
44
51
  var ids = (f) => ({ accountId: String(f.accountId ?? ""), chatId: String(f.chatId ?? "") });
45
52
  var preview = (method, args, body = {}) => print(JSON.stringify(buildPreviewOutput({ method, args, body })));
46
53
  async function paged(f, params, fetch, human) {
@@ -116,6 +123,117 @@ async function runMessages(c, f) {
116
123
  await fail(err, f);
117
124
  }
118
125
  }
126
+ var conversationId = (f, cmd) => {
127
+ const id = String(f.conversationId ?? "");
128
+ return id.trim() !== "" ? id : usage(`the conversation id is missing: \`curviate unibox ${cmd} <conversation_id>\` (each chat of \`unibox list\` carries conversation_id).`);
129
+ };
130
+ async function runConversationMark(c, f) {
131
+ const id = conversationId(f, "conversation mark");
132
+ if (f.read === void 0 === (f.unread === void 0)) usage("pass exactly one of --read or --unread.");
133
+ const body = { read: f.read ?? !f.unread };
134
+ if (f.preview) return preview("unibox.markConversation", { conversation_id: id }, body);
135
+ try {
136
+ renderSuccess(await c.unibox.markConversation(id, body), outputOpts(f), process);
137
+ } catch (err) {
138
+ await fail(err, f);
139
+ }
140
+ }
141
+ async function runEmailSend(c, f) {
142
+ const id = conversationId(f, "email send");
143
+ if (!f.text || f.text.trim() === "") usage('the email text is required: `curviate unibox email send <conversation_id> "<text>" (--thread <thread_id> | --subject <subject>)`.');
144
+ if (f.thread === void 0 === (f.subject === void 0)) usage("pass --thread <thread_id> to reply in a thread, or --subject <subject> to start a new one (not both).");
145
+ if (f.mailbox !== void 0 && f.thread !== void 0) usage("--mailbox goes with a new thread (--subject): a reply goes from its thread's Mailbox.");
146
+ const body = { text: f.text, ...f.thread !== void 0 ? { thread_id: f.thread } : { subject: f.subject }, ...f.mailbox !== void 0 ? { mailbox_id: f.mailbox } : {} };
147
+ const cc = f.cc === void 0 ? [] : listFlag("cc", f.cc);
148
+ const bcc = f.bcc === void 0 ? [] : listFlag("bcc", f.bcc);
149
+ if (cc.length + bcc.length > 20) usage("--cc and --bcc take at most 20 addresses together.");
150
+ if (cc.length) body["cc"] = cc;
151
+ if (bcc.length) body["bcc"] = bcc;
152
+ const paths = f.attach === void 0 ? [] : [].concat(f.attach);
153
+ if (paths.length > EMAIL_MAX_FILES) usage(`--attach takes at most ${EMAIL_MAX_FILES} files.`);
154
+ const files = [];
155
+ for (const p of paths) {
156
+ try {
157
+ files.push({ path: p, buf: await readAttachment(p) });
158
+ } catch (err) {
159
+ if (err instanceof AttachError) usage(err.message);
160
+ throw err;
161
+ }
162
+ }
163
+ const total = files.reduce((n, x) => n + x.buf.length, 0);
164
+ if (total > EMAIL_MAX_FILE_BYTES) usage(`--attach: the files total ${total} bytes, over 20 MiB; nothing was sent. A link usually lands better than a file.`);
165
+ if (files.length) body["attachments"] = files.map((x) => {
166
+ const a = toAttachmentPayload(x.path, x.buf);
167
+ return { filename: a.filename, content_type: a.content_type, content: a.content };
168
+ });
169
+ if (f.preview) return void print(JSON.stringify(buildPreviewOutput({ method: "unibox.sendEmail", args: { conversation_id: id }, body: { ...body, attachments: void 0 }, attachments: files.map((x) => ({ name: x.path.split("/").pop(), buffer: x.buf })) })));
170
+ try {
171
+ const sent = await c.unibox.sendEmail(id, body);
172
+ for (const w of sent["warnings"] ?? []) {
173
+ process.stderr.write(`warning: ${String(w["code"])}: ${(w["addresses"] ?? []).join(", ")} got nothing; everyone else did.
174
+ `);
175
+ }
176
+ renderSuccess(sent, outputOpts(f), process);
177
+ } catch (err) {
178
+ if (err.outcomeUnknown === true) {
179
+ process.stderr.write(`The outcome is unknown: the email may have been sent, and it is kept in the conversation as sent. Do not send it again; read \`curviate unibox conversation timeline ${id} --channel email\`.
180
+ `);
181
+ }
182
+ await fail(err, f);
183
+ }
184
+ }
185
+ var messageId = (f, cmd) => {
186
+ const id = String(f.messageId ?? "");
187
+ return id.trim() !== "" ? id : usage(`the message id is missing: \`curviate unibox referral ${cmd} <message_id>\` (the reply labelled referral).`);
188
+ };
189
+ async function runReferralSearch(c, f) {
190
+ const id = messageId(f, "search");
191
+ const body = f.name === void 0 ? {} : { name: f.name };
192
+ if (f.preview) return preview("unibox.referralSearch", { message_id: id }, body);
193
+ try {
194
+ renderSuccess(await c.unibox.referralSearch(id, body), outputOpts(f), process);
195
+ } catch (err) {
196
+ await fail(err, f);
197
+ }
198
+ }
199
+ async function runReferralConfirm(c, f) {
200
+ const id = messageId(f, "confirm");
201
+ if (f["provider-id"] === void 0 === (f["linkedin-url"] === void 0)) usage("pass exactly one of --provider-id (from `unibox referral search`) or --linkedin-url.");
202
+ const body = f["provider-id"] !== void 0 ? { provider_id: f["provider-id"] } : { linkedin_url: f["linkedin-url"] };
203
+ if (f.preview) return preview("unibox.referralConfirm", { message_id: id }, body);
204
+ try {
205
+ renderSuccess(await c.unibox.referralConfirm(id, body), outputOpts(f), process);
206
+ } catch (err) {
207
+ await fail(err, f);
208
+ }
209
+ }
210
+ async function runConversation(c, f) {
211
+ const id = conversationId(f, "conversation get");
212
+ try {
213
+ renderSuccess(await c.unibox.getConversation(id), outputOpts(f), process);
214
+ } catch (err) {
215
+ await fail(err, f);
216
+ }
217
+ }
218
+ async function runTimeline(c, f) {
219
+ const id = conversationId(f, "conversation timeline");
220
+ try {
221
+ const q = {};
222
+ if (f.channel !== void 0) {
223
+ if (!["linkedin", "email"].includes(f.channel)) usage("--channel takes linkedin or email.");
224
+ q["channel"] = f.channel;
225
+ }
226
+ if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 100);
227
+ await paged(f, q, (p) => c.unibox.listConversationMessages(id, p), (page) => print(table(["AT", "CHANNEL", "FROM", "TEXT"], page.items.map((m) => [
228
+ m["timestamp"],
229
+ m["channel"] ?? "event",
230
+ m["channel"] === null ? m["kind"] : m["is_sender"] ? "me" : m["sender"]?.["display_name"] ?? m["from"] ?? m["sender_id"],
231
+ m["channel"] === null ? m["campaign_name"] ?? "" : m["channel"] === "email" ? m["subject"] ?? m["text"] : m["text"]
232
+ ]))));
233
+ } catch (err) {
234
+ await fail(err, f);
235
+ }
236
+ }
119
237
  async function runReply(c, f) {
120
238
  const { accountId, chatId } = ids(f);
121
239
  if (!f.text) usage('the message text is required: `curviate unibox reply <account_id> <chat_id> "<text>"`.');
@@ -170,21 +288,21 @@ async function runRefresh(c, f) {
170
288
  }
171
289
  var REPLY_LABELS = ["interested", "not_now", "not_interested", "opt_out", "out_of_office", "referral", "other"];
172
290
  async function runLabel(c, f) {
173
- const messageId = String(f.messageId ?? "");
174
- if (messageId.trim() === "") usage("the message id is required: `curviate unibox label <message_id>`, as `curviate unibox messages` prints it.");
291
+ const messageId2 = String(f.messageId ?? "");
292
+ if (messageId2.trim() === "") usage("the message id is required: `curviate unibox label <message_id>`, as `curviate unibox messages` prints it.");
175
293
  if (f.set !== void 0) {
176
294
  if (!REPLY_LABELS.includes(f.set)) usage(`--set takes one of ${REPLY_LABELS.join(", ")}.`);
177
295
  const body = { reply_label: f.set };
178
- if (f.preview) return preview("unibox.updateMessage", { message_id: messageId }, body);
296
+ if (f.preview) return preview("unibox.updateMessage", { message_id: messageId2 }, body);
179
297
  try {
180
- renderSuccess(await c.unibox.updateMessage(messageId, body), outputOpts(f), process);
298
+ renderSuccess(await c.unibox.updateMessage(messageId2, body), outputOpts(f), process);
181
299
  } catch (err) {
182
300
  await fail(err, f);
183
301
  }
184
302
  return;
185
303
  }
186
304
  try {
187
- const res = await c.unibox.getReplyLabel(messageId);
305
+ const res = await c.unibox.getReplyLabel(messageId2);
188
306
  if (outputOpts(f).json) return renderSuccess(res, outputOpts(f), process);
189
307
  const cur = res.current;
190
308
  print(cur ? `${String(cur["label"])} (${String(cur["source"])}${cur["confidence"] == null ? "" : `, confidence ${String(cur["confidence"])}`})` : "no label");
@@ -260,6 +378,160 @@ var getCmd = defineCommand({
260
378
  args: { ...readOnly(WRITE_SINGLE_FLAGS), accountId: ACCOUNT, chatId: CHAT },
261
379
  run: online(runGet)
262
380
  });
381
+ var conversationGetCmd = defineCommand({
382
+ meta: {
383
+ name: "get",
384
+ description: "One conversation: one person on one account across LinkedIn and email (each chat of `unibox list` carries its conversation_id), with its channels, marks and email state (whether email is available, why not, and from which Mailboxes). From what Curviate has stored: no LinkedIn call, no mailbox read.",
385
+ risk: "read",
386
+ seeAlso: ["curviate unibox conversation timeline", "curviate unibox email send", "curviate unibox list"],
387
+ examples: ["curviate unibox conversation get cnv_YOUR_CONVERSATION_ID"]
388
+ },
389
+ args: { ...readOnly(WRITE_SINGLE_FLAGS), conversationId: { type: "positional", description: "Conversation id (cnv_...)." } },
390
+ run: online(runConversation)
391
+ });
392
+ var conversationTimelineCmd = defineCommand({
393
+ meta: {
394
+ name: "timeline",
395
+ description: "A conversation's timeline, newest first: its LinkedIn messages, its emails, and Campaign events (a bounce, an unsubscribe, the end of an Enrollment) in one list. A page holds --limit LinkedIn messages and every email and event since the oldest of them; --channel email serves every email at once. From what Curviate has stored: no LinkedIn call, no mailbox read.",
396
+ risk: "read",
397
+ seeAlso: ["curviate unibox conversation get", "curviate unibox messages"],
398
+ examples: ["curviate unibox conversation timeline cnv_YOUR_CONVERSATION_ID", "curviate unibox conversation timeline cnv_YOUR_CONVERSATION_ID --channel email --json"]
399
+ },
400
+ args: {
401
+ ...readOnly(GLOBAL_FLAGS),
402
+ limit: { ...GLOBAL_FLAGS.limit, description: "LinkedIn messages per page (1 to 100); every email and event since the oldest of them comes with them." },
403
+ conversationId: { type: "positional", description: "Conversation id (cnv_...)." },
404
+ channel: { type: "string", description: "Only linkedin or email." }
405
+ },
406
+ run: online(runTimeline)
407
+ });
408
+ var conversationMarkCmd = defineCommand({
409
+ meta: {
410
+ name: "mark",
411
+ description: "Mark a conversation read or unread: its LinkedIn chat on LinkedIn, as `unibox mark` does, and its email in Curviate (the Mailbox itself is never changed). Mark it unread to hand it to a person or another AI. An email from them makes it unread again.",
412
+ risk: "write",
413
+ rules: {
414
+ changes: "The conversation's read state: the LinkedIn chat's on LinkedIn, the email's in Curviate.",
415
+ visible_to: "Everyone who reads this Account's chats; on LinkedIn, the Account's own person.",
416
+ budget_rows: [],
417
+ retry: "Safe: the same state again.",
418
+ undo: "Run it again with the other flag."
419
+ },
420
+ examples: ["curviate unibox conversation mark cnv_YOUR_CONVERSATION_ID --unread"]
421
+ },
422
+ args: {
423
+ ...WRITE_SINGLE_FLAGS,
424
+ conversationId: { type: "positional", description: "Conversation id (cnv_...)." },
425
+ read: { type: "boolean", description: "Mark it read." },
426
+ unread: { type: "boolean", description: "Mark it unread." }
427
+ },
428
+ run: online(runConversationMark)
429
+ });
430
+ var conversationCmd = defineCommand({
431
+ meta: { name: "conversation", description: "One person on one Account across LinkedIn and email: read it (get), its timeline, mark it read or unread." },
432
+ subCommands: { get: conversationGetCmd, timeline: conversationTimelineCmd, mark: conversationMarkCmd },
433
+ async run() {
434
+ const { showHelp } = await import("./examples-5FJS47QF.js");
435
+ await showHelp(conversationCmd, ["curviate", "unibox", "conversation"]);
436
+ }
437
+ });
438
+ var emailSendCmd = defineCommand({
439
+ meta: {
440
+ name: "send",
441
+ description: "Send one plain-text email to the conversation's Lead, at once: a reply in one of its threads (--thread, a thread_id from `conversation timeline`), or a new thread (--subject, and --mailbox when more than one Mailbox can send). It goes to the Lead's one address with no signature and no opt-out line, counts against the Mailbox's daily limit, and ends the Lead's open Enrollments on this Account as a reply would. --cc and --bcc (at most 20 addresses together) and --attach (files, at most 10, 20 MiB in all, refused here before anything is sent) ride along; a link usually lands better than a file. A Cc or Bcc address the receiving server refused while it took the Lead's is a recipients_refused warning on stderr: those got nothing, everyone else did. Check first with `conversation get` that email is available. One request: a retry after a timeout can send twice, so read the timeline before you send again. An unknown outcome (the provider stopped answering after it had the whole email) exits 1, never 7: do not send it again.",
442
+ risk: "write",
443
+ rules: {
444
+ changes: "An email is sent to the Lead now; their open Enrollments on this Account end as on a reply.",
445
+ visible_to: "The Lead (the recipient), and everyone who reads this conversation.",
446
+ budget_rows: [],
447
+ retry: "Never blind: a retry after a timeout can send the email twice. Read `curviate unibox conversation timeline <id> --channel email` first.",
448
+ undo: "None: an email cannot be unsent."
449
+ },
450
+ errors: {
451
+ EMAIL_UNAVAILABLE: "email is not available in this conversation; reason names why (no_email_address, email_bounced, no_email, do_not_contact, no_mailbox, group_chat). Nothing is sent.",
452
+ MAILBOX_STATE_CONFLICT: "the Mailbox needs reconnecting, is paused, or has sent its daily limit; the message names the way on.",
453
+ DO_NOT_CONTACT: "a Cc or Bcc address is a Lead on your Do-not-contact list or opted out of email; nothing was sent.",
454
+ PLATFORM_ERROR: "the provider did not take the email: nothing was sent (exit 7 when a retry may work). With an unknown outcome it may have been sent: exit 1, do not send it again.",
455
+ UNSUPPORTED_MEDIA_TYPE: "an attachment is an executable, a script or a macro-enabled Office file; nothing was sent."
456
+ },
457
+ seeAlso: ["curviate unibox conversation get", "curviate unibox conversation timeline"],
458
+ examples: [
459
+ 'curviate unibox email send cnv_YOUR_CONVERSATION_ID "Thanks, Thursday works." --thread thr_YOUR_THREAD_ID',
460
+ 'curviate unibox email send cnv_YOUR_CONVERSATION_ID "Following up on our call." --subject "Next steps" --preview'
461
+ ]
462
+ },
463
+ args: {
464
+ ...WRITE_SINGLE_FLAGS,
465
+ conversationId: { type: "positional", description: "Conversation id (cnv_...)." },
466
+ text: { type: "positional", description: "The email's text, plain text, 1 to 10,000 characters." },
467
+ thread: { type: "string", description: "Reply in this thread (thread_id)." },
468
+ subject: { type: "string", description: "Start a new thread with this subject." },
469
+ mailbox: { type: "string", description: "New thread only: the Mailbox to send from (mbx_...), one of the conversation's email.mailboxes." },
470
+ cc: { type: "string", description: "Cc addresses, repeatable or a comma list; every recipient sees them." },
471
+ bcc: { type: "string", description: "Bcc addresses, repeatable or a comma list; no other recipient sees them." },
472
+ attach: { type: "string", description: "A file to send, repeatable: at most 10, 20 MiB in all. From a Microsoft sign-in Mailbox, about 2.2 MB in all go today; more is refused with PLATFORM_ERROR and nothing is sent: send a link or a smaller file." }
473
+ },
474
+ run: online(runEmailSend)
475
+ });
476
+ var emailCmd = defineCommand({
477
+ meta: { name: "email", description: "Email from a conversation: send one plain-text email to its Lead." },
478
+ subCommands: { send: emailSendCmd },
479
+ async run() {
480
+ const { showHelp } = await import("./examples-5FJS47QF.js");
481
+ await showHelp(emailCmd, ["curviate", "unibox", "email"]);
482
+ }
483
+ });
484
+ var MESSAGE = { type: "positional", description: "The reply labelled referral (message id)." };
485
+ var referralSearchCmd = defineCommand({
486
+ meta: {
487
+ name: "search",
488
+ description: "For a reply labelled Referral: one LinkedIn people search, as the conversation's Account, for the referred person (the name Curviate suggests from the reply, or --name). At most 10 candidates, each counted against the Account's search limit. A reply labelled otherwise is NOT_A_REFERRAL and nothing is searched.",
489
+ risk: "write",
490
+ rules: {
491
+ changes: "Nothing stored but the name on the label; the search spends the Account's search limit.",
492
+ visible_to: "Your Team. LinkedIn sees one search by the Account.",
493
+ budget_rows: ["search"],
494
+ retry: "Each call is a new search and spends the limit again.",
495
+ undo: "Nothing to undo."
496
+ },
497
+ errors: { NOT_A_REFERRAL: "the message's label is not referral; nothing was searched." },
498
+ seeAlso: ["curviate unibox referral confirm", "curviate unibox label"],
499
+ examples: ["curviate unibox referral search YOUR_MESSAGE_ID", 'curviate unibox referral search YOUR_MESSAGE_ID --name "Jane Doe"']
500
+ },
501
+ args: { ...WRITE_SINGLE_FLAGS, messageId: MESSAGE, name: { type: "string", description: "The name to search for, instead of the one Curviate suggests." } },
502
+ run: online(runReferralSearch)
503
+ });
504
+ var referralConfirmCmd = defineCommand({
505
+ meta: {
506
+ name: "confirm",
507
+ description: "For a reply labelled Referral: save the person you picked as a Lead (--provider-id from `referral search`, or --linkedin-url), or get the Lead you already hold. It never enrolls them.",
508
+ risk: "write",
509
+ rules: {
510
+ changes: "A new Lead, or none when you already hold the person.",
511
+ visible_to: "Your Team.",
512
+ budget_rows: [],
513
+ retry: "Safe: a person you already hold answers with that Lead.",
514
+ undo: "`curviate lead delete <lead_id>`."
515
+ },
516
+ errors: { NOT_A_REFERRAL: "the message's label is not referral; nothing was saved.", LEAD_LIMIT_REACHED: "a new Lead would pass your Team's Lead limit." },
517
+ examples: ["curviate unibox referral confirm YOUR_MESSAGE_ID --provider-id ACoAAB1234567"]
518
+ },
519
+ args: {
520
+ ...WRITE_SINGLE_FLAGS,
521
+ messageId: MESSAGE,
522
+ "provider-id": { type: "string", description: "A candidate's provider_id, from `unibox referral search`." },
523
+ "linkedin-url": { type: "string", description: "Or the person's LinkedIn profile URL." }
524
+ },
525
+ run: online(runReferralConfirm)
526
+ });
527
+ var referralCmd = defineCommand({
528
+ meta: { name: "referral", description: "A reply labelled Referral: find the referred person on LinkedIn, then save them as a Lead." },
529
+ subCommands: { search: referralSearchCmd, confirm: referralConfirmCmd },
530
+ async run() {
531
+ const { showHelp } = await import("./examples-5FJS47QF.js");
532
+ await showHelp(referralCmd, ["curviate", "unibox", "referral"]);
533
+ }
534
+ });
263
535
  var unreadCmd = defineCommand({
264
536
  meta: {
265
537
  name: "unread",
@@ -398,7 +670,10 @@ var labelCmd = defineCommand({
398
670
  args: {
399
671
  ...WRITE_SINGLE_FLAGS,
400
672
  messageId: { type: "positional", description: "The message id, as `curviate unibox messages` prints it." },
401
- set: { type: "string", description: "Set or correct the label: interested, not_now, not_interested, opt_out, out_of_office, referral or other." }
673
+ set: {
674
+ type: "string",
675
+ description: "Set or correct the label, each with its effect: interested (informs), not_now (informs), not_interested (puts the person on the Do-not-contact list when your Team turned that on), opt_out (puts the person on the Do-not-contact list), out_of_office (the Lead waits 7 days), referral (informs; the referred name rides on it, `unibox referral search` finds them), other (informs)."
676
+ }
402
677
  },
403
678
  run: online(runLabel)
404
679
  });
@@ -444,6 +719,9 @@ var uniboxCommand = defineCommand({
444
719
  get: getCmd,
445
720
  unread: unreadCmd,
446
721
  messages: messagesCmd,
722
+ conversation: conversationCmd,
723
+ email: emailCmd,
724
+ referral: referralCmd,
447
725
  reply: replyCmd,
448
726
  mark: markCmd,
449
727
  tag: tagCmd,
@@ -454,7 +732,7 @@ var uniboxCommand = defineCommand({
454
732
  consent: consentCmd
455
733
  },
456
734
  async run() {
457
- const { showHelp } = await import("./examples-J4X5NEIE.js");
735
+ const { showHelp } = await import("./examples-5FJS47QF.js");
458
736
  await showHelp(uniboxCommand, ["curviate", "unibox"]);
459
737
  }
460
738
  });
@@ -5,13 +5,13 @@ import {
5
5
  outputOpts,
6
6
  rootClient,
7
7
  usage
8
- } from "./chunk-3ZQNOKEK.js";
9
- import {
10
- intFlag
11
- } from "./chunk-NNV2OYEF.js";
8
+ } from "./chunk-5OAJ4D65.js";
12
9
  import {
13
10
  buildPreviewOutput
14
11
  } from "./chunk-TCUYH5GO.js";
12
+ import {
13
+ intFlag
14
+ } from "./chunk-NNV2OYEF.js";
15
15
  import {
16
16
  pageDelayFromFlags,
17
17
  readCursorFlag,
@@ -20,7 +20,7 @@ import {
20
20
  readablePage,
21
21
  rejectPaginationModifiersWithoutAll,
22
22
  streamAll
23
- } from "./chunk-OE4CY3ZL.js";
23
+ } from "./chunk-KUVJM5CP.js";
24
24
  import {
25
25
  renderError,
26
26
  renderSuccess,
@@ -30,7 +30,7 @@ import {
30
30
  import {
31
31
  createClient,
32
32
  resolveEffectiveConfig
33
- } from "./chunk-RXDG57B2.js";
33
+ } from "./chunk-PBJZQZPO.js";
34
34
  import {
35
35
  GLOBAL_FLAGS,
36
36
  READ_SINGLE_FLAGS,
@@ -39,10 +39,10 @@ import {
39
39
  } from "./chunk-QLKGOIWS.js";
40
40
  import {
41
41
  DESCRIPTIONS
42
- } from "./chunk-5LGKZBAY.js";
42
+ } from "./chunk-XDPU2YAF.js";
43
43
  import {
44
44
  readFileFlag
45
- } from "./chunk-RKNW4UX4.js";
45
+ } from "./chunk-JKOQX46J.js";
46
46
  import "./chunk-FDJMAF7D.js";
47
47
  import {
48
48
  isStdinToken
@@ -259,7 +259,7 @@ function resolveOutputOpts(flags) {
259
259
  async function handleError(err, outOpts, out) {
260
260
  const { CurviateError } = await import("@curviate/sdk");
261
261
  if (err instanceof CurviateError) {
262
- const { getExitCode } = await import("./exit-codes-P2FLCKM7.js");
262
+ const { getExitCode } = await import("./exit-codes-LQDMGDII.js");
263
263
  renderError(err, outOpts, out);
264
264
  process.exit(getExitCode(err));
265
265
  }
@@ -268,7 +268,7 @@ async function handleError(err, outOpts, out) {
268
268
  }
269
269
  async function runWebhookCreate(client, flags, out) {
270
270
  if (!flags.source) {
271
- out.stderr.write("error: --source is required (messaging | user | account_status | post | campaign).\n");
271
+ out.stderr.write("error: --source is required (messaging | user | account_status | post | campaign | signal).\n");
272
272
  process.exit(2);
273
273
  }
274
274
  if (!flags["request-url"]) {
@@ -478,7 +478,7 @@ var webhookCreateCommand = defineCommand2({
478
478
  examples: [
479
479
  "curviate webhook create --source messaging --request-url https://example.com/hooks/curviate --account-ids acc_YOUR_ACCOUNT_ID",
480
480
  "curviate webhook create --source campaign --request-url https://example.com/hooks/curviate --campaign-ids mot_YOUR_CAMPAIGN_ID",
481
- "curviate webhook create --source account_status --request-url https://example.com/hooks/curviate --name status"
481
+ "curviate webhook create --source signal --events signal.matched --request-url https://example.com/hooks/curviate"
482
482
  ]
483
483
  },
484
484
  args: {
@@ -486,7 +486,7 @@ var webhookCreateCommand = defineCommand2({
486
486
  ...DELIVERY_ARGS,
487
487
  source: {
488
488
  type: "string",
489
- description: "Event source: messaging | user | account_status | post (scheduled-post results: post.published, post.publish_failed) | campaign (campaign.status_changed, enrollment.started, enrollment.accepted, enrollment.replied, enrollment.skipped, enrollment.finished, step.failed, campaign.custom_event; opt-in only, named in --events: step.executed, enrollment.seen, enrollment.reassigned).",
489
+ description: "Event source: messaging | user | account_status | post (scheduled-post results: post.published, post.publish_failed) | campaign (campaign.status_changed, enrollment.started, enrollment.accepted, enrollment.replied, enrollment.skipped, enrollment.finished, step.failed, campaign.custom_event; opt-in only, named in --events: step.executed, enrollment.seen, enrollment.reassigned) | signal (one signal.<kind> per Signal of a watched Account, and signal.matched when a rule with --send-event acts: signal.post_engaged, signal.post_reposted, signal.network_posted, signal.profile_viewed, signal.followed_you, signal.mentioned_you, signal.connection_added, signal.matched).",
490
490
  required: true
491
491
  },
492
492
  "request-url": { type: "string", description: "HTTPS URL to receive webhook deliveries.", required: true },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@curviate/cli",
3
- "version": "0.57.0",
3
+ "version": "0.58.0",
4
4
  "private": false,
5
5
  "description": "Official command-line interface for the Curviate API.",
6
6
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "homepage": "https://docs.curviate.com",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/curviate/curviate-cli.git"
11
+ "url": "git+https://github.com/Curviate/curviate-cli.git"
12
12
  },
13
13
  "bugs": {
14
14
  "url": "https://github.com/curviate/curviate-cli/issues"
@@ -47,7 +47,7 @@
47
47
  "clean": "rm -rf dist *.tsbuildinfo"
48
48
  },
49
49
  "dependencies": {
50
- "@curviate/sdk": "0.53.0",
50
+ "@curviate/sdk": "0.54.0",
51
51
  "citty": "^0.1.6",
52
52
  "open": "^10.1.0"
53
53
  },
@@ -1,46 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- DESCRIPTIONS,
4
- lazy
5
- } from "./chunk-5LGKZBAY.js";
6
-
7
- // src/commands/core.ts
8
- import { defineCommand } from "citty";
9
- var coreCommand = defineCommand({
10
- meta: {
11
- name: "core",
12
- description: DESCRIPTIONS.core,
13
- rules: {
14
- notes: [
15
- "Writes reach LinkedIn immediately and are seen by the people they touch.",
16
- "A retry after a timeout can repeat a write: requests carry no idempotency key. Read the current state before retrying.",
17
- "Budget rows, ceilings and what is left: `curviate account get <account_id>`."
18
- ]
19
- }
20
- },
21
- subCommands: {
22
- profile: lazy("profile", () => import("./profile-3SG64IEG.js").then((m) => m.profileCommand)),
23
- company: lazy("company", () => import("./company-OUFF23SU.js").then((m) => m.companyCommand)),
24
- job: lazy("job", () => import("./job-QFIUTHHT.js").then((m) => m.jobCommand)),
25
- connect: lazy("connect", () => import("./connect-ICNXC37R.js").then((m) => m.connectCommand)),
26
- search: lazy("search", () => import("./search-5LMSLUH4.js").then((m) => m.searchCommand)),
27
- inbox: lazy("inbox", () => import("./inbox-5RGG5RQG.js").then((m) => m.inboxCommand)),
28
- inboxes: lazy("inboxes", () => import("./inboxes-ZFY6ZP33.js").then((m) => m.inboxesCommand)),
29
- message: lazy("message", () => import("./message-DM5OUKQS.js").then((m) => m.messageCommand)),
30
- post: lazy("post", () => import("./post-M2G3BK4A.js").then((m) => m.postCommand)),
31
- comment: lazy("comment", () => import("./comment-PNHEKGZX.js").then((m) => m.commentCommand)),
32
- "sales-nav": lazy("sales-nav", () => import("./sales-nav-HHQLLM5C.js").then((m) => m.salesNavCommand)),
33
- recruiter: lazy("recruiter", () => import("./recruiter-7OUGZ776.js").then((m) => m.recruiterCommand)),
34
- group: lazy("group", () => import("./group-LRMG76FN.js").then((m) => m.groupCommand)),
35
- feed: lazy("feed", () => import("./feed-RQHEDZVL.js").then((m) => m.feedCommand)),
36
- notification: lazy("coreNotification", () => import("./notification-XW5J6KFA.js").then((m) => m.notificationCommand)),
37
- draft: lazy("draft", () => import("./draft-JGQ36JSH.js").then((m) => m.draftCommand))
38
- },
39
- async run() {
40
- const { showHelp } = await import("./examples-J4X5NEIE.js");
41
- await showHelp(coreCommand, ["curviate", "core"]);
42
- }
43
- });
44
- export {
45
- coreCommand
46
- };