@curviate/cli 0.57.0 → 0.59.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 +114 -0
  2. package/README.md +9 -2
  3. package/dist/{account-IRIYB2SG.js → account-EUHYWIDH.js} +52 -16
  4. package/dist/{analytics-IRSCLVOL.js → analytics-SQQIMSLF.js} +6 -6
  5. package/dist/{beta-consent-NQVGFZL3.js → beta-consent-DFS7YMZR.js} +4 -4
  6. package/dist/billing-3FRIQFY3.js +19 -0
  7. package/dist/{chunk-OE4CY3ZL.js → chunk-5AJS2V4T.js} +1 -1
  8. package/dist/{chunk-AMTKGO37.js → chunk-5Z3CCE5N.js} +1 -1
  9. package/dist/{chunk-A6JGJGDF.js → chunk-72PYX57P.js} +16 -16
  10. package/dist/{billing-TCTP44ZB.js → chunk-7CSXYRSO.js} +125 -14
  11. package/dist/{chunk-SCUTAREU.js → chunk-EWSOIFG2.js} +17 -0
  12. package/dist/{chunk-3ZQNOKEK.js → chunk-F3FEY4D5.js} +2 -2
  13. package/dist/{chunk-F7CLAS5Y.js → chunk-HG2G5OAZ.js} +2 -2
  14. package/dist/{chunk-6OT6TS7N.js → chunk-HJ7YY4HE.js} +2 -2
  15. package/dist/{chunk-RKNW4UX4.js → chunk-JKOQX46J.js} +6 -0
  16. package/dist/{chunk-VHNF6OZD.js → chunk-JY26SUNH.js} +18 -2
  17. package/dist/{chunk-RXDG57B2.js → chunk-KD2XY7RS.js} +1 -1
  18. package/dist/{chunk-RTT75CXE.js → chunk-QRTMRTKA.js} +88 -15
  19. package/dist/{chunk-VPFV7YV3.js → chunk-R2MIDSMB.js} +6 -6
  20. package/dist/{chunk-AG6G3PRQ.js → chunk-TNLIV3SW.js} +17 -13
  21. package/dist/{chunk-3B5M2RUN.js → chunk-VKHAL6WT.js} +1 -1
  22. package/dist/{chunk-5LGKZBAY.js → chunk-ZC4S4B32.js} +4 -3
  23. package/dist/cli.js +33 -33
  24. package/dist/{comment-PNHEKGZX.js → comment-DA6XPY4F.js} +8 -8
  25. package/dist/{company-OUFF23SU.js → company-IWVNUBWS.js} +8 -8
  26. package/dist/{company-record-ULPDDB6L.js → company-record-ZJMW3NC6.js} +95 -10
  27. package/dist/{config-U6VDNL2P.js → config-P4HKPOCW.js} +2 -2
  28. package/dist/{connect-ICNXC37R.js → connect-AELFEVR7.js} +11 -11
  29. package/dist/{contact-K6RIVQWU.js → contact-FHN3A7MJ.js} +9 -9
  30. package/dist/{contact-groups-CNH2VB6A.js → contact-groups-HNZTN6I6.js} +11 -11
  31. package/dist/{contact-import-FK22UTN2.js → contact-import-PJFRLCHR.js} +11 -11
  32. package/dist/core-R7R44CVA.js +46 -0
  33. package/dist/{do-not-contact-BQHXNHTV.js → do-not-contact-KSH36NMT.js} +22 -20
  34. package/dist/{doctor-ZYPZF5BE.js → doctor-BEO4E227.js} +4 -4
  35. package/dist/{document-H65EXU4L.js → document-G6UND26L.js} +1 -1
  36. package/dist/{domain-HLOT6Y4A.js → domain-HF3WXWUT.js} +5 -5
  37. package/dist/{draft-JGQ36JSH.js → draft-2KBRHBBH.js} +5 -5
  38. package/dist/{enrollment-CF634DB4.js → enrollment-QPE54QQN.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-J4JQRE2A.js} +4 -4
  42. package/dist/{feed-RQHEDZVL.js → feed-PHF2ROIT.js} +6 -6
  43. package/dist/{group-LRMG76FN.js → group-SLXDOCHV.js} +6 -6
  44. package/dist/{inbox-5RGG5RQG.js → inbox-IDILZLPC.js} +6 -6
  45. package/dist/{inboxes-ZFY6ZP33.js → inboxes-QLP5PWTS.js} +6 -6
  46. package/dist/{incoming-3MJ4CP6H.js → incoming-XG6IBPU6.js} +8 -8
  47. package/dist/{job-QFIUTHHT.js → job-WUYHK6OX.js} +6 -6
  48. package/dist/{login-THXWX5HZ.js → login-3RIU257N.js} +2 -2
  49. package/dist/mailbox-CJRCYZGL.js +772 -0
  50. package/dist/{message-DM5OUKQS.js → message-EBVO4ZZI.js} +7 -7
  51. package/dist/{motion-NKOAK7NU.js → motion-7XQ3E4GI.js} +121 -16
  52. package/dist/{network-VKJUMZ2L.js → network-X5XL44GB.js} +12 -12
  53. package/dist/{notification-XW5J6KFA.js → notification-QNGHG5EO.js} +6 -6
  54. package/dist/{notifications-USYOV54R.js → notifications-MOLNELNE.js} +9 -9
  55. package/dist/{post-M2G3BK4A.js → post-XYSFN5OP.js} +8 -8
  56. package/dist/{profile-3SG64IEG.js → profile-7LJLU4Y5.js} +12 -12
  57. package/dist/{recruiter-7OUGZ776.js → recruiter-ALQNIRYR.js} +9 -9
  58. package/dist/{sales-nav-HHQLLM5C.js → sales-nav-HYZXNYCC.js} +9 -9
  59. package/dist/{search-5LMSLUH4.js → search-DNCPCFRR.js} +16 -16
  60. package/dist/{setup-6F4HYUSZ.js → setup-QI5FW6VD.js} +4 -4
  61. package/dist/{signal-LVODDBOY.js → signal-J2TLIT47.js} +126 -19
  62. package/dist/{team-MSOPELF6.js → team-PPPCJ5HT.js} +8 -8
  63. package/dist/{tier-RXHOAQ6L.js → tier-NFWWW34H.js} +4 -4
  64. package/dist/{unibox-UAA6WIGZ.js → unibox-52C7G5LK.js} +318 -16
  65. package/dist/{webhook-J2H7X766.js → webhook-J3JYMSY2.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,25 @@ import {
3
3
  print,
4
4
  table
5
5
  } from "./chunk-5S3MJVI5.js";
6
+ import {
7
+ AttachError,
8
+ openUpload,
9
+ readAttachment,
10
+ toAttachmentPayload
11
+ } from "./chunk-JY26SUNH.js";
6
12
  import {
7
13
  fail,
8
14
  listFlag,
9
15
  outputOpts,
10
16
  rootClient,
11
17
  usage
12
- } from "./chunk-3ZQNOKEK.js";
13
- import {
14
- intFlag
15
- } from "./chunk-NNV2OYEF.js";
18
+ } from "./chunk-F3FEY4D5.js";
16
19
  import {
17
20
  buildPreviewOutput
18
21
  } from "./chunk-TCUYH5GO.js";
22
+ import {
23
+ intFlag
24
+ } from "./chunk-NNV2OYEF.js";
19
25
  import {
20
26
  pageDelayFromFlags,
21
27
  readCursorFlag,
@@ -23,12 +29,12 @@ import {
23
29
  readablePage,
24
30
  rejectPaginationModifiersWithoutAll,
25
31
  streamAll
26
- } from "./chunk-OE4CY3ZL.js";
32
+ } from "./chunk-5AJS2V4T.js";
27
33
  import {
28
34
  renderSuccess,
29
35
  writeNdjsonItem
30
36
  } from "./chunk-QM57YDJE.js";
31
- import "./chunk-RXDG57B2.js";
37
+ import "./chunk-KD2XY7RS.js";
32
38
  import {
33
39
  GLOBAL_FLAGS,
34
40
  WRITE_SINGLE_FLAGS,
@@ -36,11 +42,16 @@ import {
36
42
  } from "./chunk-QLKGOIWS.js";
37
43
  import {
38
44
  DESCRIPTIONS
39
- } from "./chunk-5LGKZBAY.js";
45
+ } from "./chunk-ZC4S4B32.js";
40
46
  import "./chunk-ZYURL5VK.js";
41
47
 
42
48
  // src/commands/unibox.ts
43
49
  import { defineCommand } from "citty";
50
+ import { stat } from "fs/promises";
51
+ import { basename } from "path";
52
+ var EMAIL_MAX_FILES = 10;
53
+ var EMAIL_MAX_FILE_BYTES = 20 * 1024 * 1024;
54
+ var EMAIL_INLINE_MAX_BYTES = 6 * 1024 * 1024;
44
55
  var ids = (f) => ({ accountId: String(f.accountId ?? ""), chatId: String(f.chatId ?? "") });
45
56
  var preview = (method, args, body = {}) => print(JSON.stringify(buildPreviewOutput({ method, args, body })));
46
57
  async function paged(f, params, fetch, human) {
@@ -81,10 +92,14 @@ async function runList(c, f) {
81
92
  const unread = (i) => i["unread"] ? i["marked_unread"] ? "marked" : "yes" : "";
82
93
  const campaign = (i) => i["campaign_context"]?.["campaign_name"];
83
94
  const label = (i) => i["reply_label"]?.["label"];
95
+ const channels = (i) => (i["channels"] ?? []).join("+");
96
+ const marks = (i) => Object.entries(i["marks"] ?? {}).filter(([, v]) => v).map(([k]) => k).join(", ");
97
+ const next = (i) => [i["chat_id"] ? "reply" : "", i["channels"]?.includes("email") && !marks(i) ? "email" : ""].filter(Boolean).join(", ");
84
98
  print(table(
85
- ["ACCOUNT", "CHAT", "WITH", "UNREAD", "LAST", "FROM", "LABEL", "CAMPAIGN", "TAGS"],
86
- page.items.map((i) => [i["account_id"], i["chat_id"], chatWith(i), unread(i), i["last_activity_at"], i["last_message_from"], label(i), campaign(i), i["tags"]?.join(", ")])
99
+ ["ACCOUNT", "CHAT", "WITH", "CHANNELS", "UNREAD", "LAST", "FROM", "LABEL", "MARKS", "NEXT", "CAMPAIGN", "TAGS", "CONVERSATION"],
100
+ page.items.map((i) => [i["account_id"], i["chat_id"], chatWith(i), channels(i), unread(i), i["last_activity_at"], i["last_message_from"], label(i), marks(i), next(i), campaign(i), i["tags"]?.join(", "), i["conversation_id"]])
87
101
  ));
102
+ if (page.items.length) print('NEXT reply: `curviate unibox reply <ACCOUNT> <CHAT> "<text>"`; email: `curviate unibox email send <CONVERSATION> "<text>" --thread <thread_id>` (threads: `curviate unibox conversation timeline <CONVERSATION> --channel email`). An email-only conversation has no CHAT and takes email only.');
88
103
  if (typeof page["total"] === "number") print(`total: ${page["total"]} chats match`);
89
104
  });
90
105
  } catch (err) {
@@ -116,6 +131,132 @@ async function runMessages(c, f) {
116
131
  await fail(err, f);
117
132
  }
118
133
  }
134
+ var conversationId = (f, cmd) => {
135
+ const id = String(f.conversationId ?? "");
136
+ return id.trim() !== "" ? id : usage(`the conversation id is missing: \`curviate unibox ${cmd} <conversation_id>\` (each chat of \`unibox list\` carries conversation_id).`);
137
+ };
138
+ async function runConversationMark(c, f) {
139
+ const id = conversationId(f, "conversation mark");
140
+ if (f.read === void 0 === (f.unread === void 0)) usage("pass exactly one of --read or --unread.");
141
+ const body = { read: f.read ?? !f.unread };
142
+ if (f.preview) return preview("unibox.markConversation", { conversation_id: id }, body);
143
+ try {
144
+ renderSuccess(await c.unibox.markConversation(id, body), outputOpts(f), process);
145
+ } catch (err) {
146
+ await fail(err, f);
147
+ }
148
+ }
149
+ async function runEmailSend(c, f) {
150
+ const id = conversationId(f, "email send");
151
+ if (!f.text || f.text.trim() === "") usage('the email text is required: `curviate unibox email send <conversation_id> "<text>" (--thread <thread_id> | --subject <subject>)`.');
152
+ 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).");
153
+ 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.");
154
+ const body = { text: f.text, ...f.thread !== void 0 ? { thread_id: f.thread } : { subject: f.subject }, ...f.mailbox !== void 0 ? { mailbox_id: f.mailbox } : {} };
155
+ const cc = f.cc === void 0 ? [] : listFlag("cc", f.cc);
156
+ const bcc = f.bcc === void 0 ? [] : listFlag("bcc", f.bcc);
157
+ if (cc.length + bcc.length > 20) usage("--cc and --bcc take at most 20 addresses together.");
158
+ if (cc.length) body["cc"] = cc;
159
+ if (bcc.length) body["bcc"] = bcc;
160
+ const paths = f.attach === void 0 ? [] : [].concat(f.attach);
161
+ if (paths.length > EMAIL_MAX_FILES) usage(`--attach takes at most ${EMAIL_MAX_FILES} files.`);
162
+ const sizes = [];
163
+ for (const p of paths) {
164
+ try {
165
+ const st = await stat(p);
166
+ if (!st.isFile()) throw new Error("not a file");
167
+ sizes.push(st.size);
168
+ } catch (err) {
169
+ usage(`Cannot read attachment "${basename(p)}": ${err instanceof Error ? err.message : "unknown error"}. Pass a valid file path.`);
170
+ }
171
+ }
172
+ const total = sizes.reduce((n, x) => n + x, 0);
173
+ 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.`);
174
+ const byId = total > EMAIL_INLINE_MAX_BYTES;
175
+ if (f.preview) {
176
+ const note = byId ? { attachment_ids: paths.map((p, i) => `<upload ${basename(p)} (${sizes[i]} bytes)>`) } : { attachments: paths.map((p, i) => `${basename(p)} (${sizes[i]} bytes)`) };
177
+ return void print(JSON.stringify(buildPreviewOutput({ method: "unibox.sendEmail", args: { conversation_id: id }, body: { ...body, ...note } })));
178
+ }
179
+ try {
180
+ if (byId) {
181
+ const ids2 = [];
182
+ for (const p of paths) {
183
+ const file = await openUpload(p, EMAIL_MAX_FILE_BYTES);
184
+ ids2.push((await c.campaigns.attachments.upload(file.data, { filename: basename(p) })).id);
185
+ }
186
+ body["attachment_ids"] = ids2;
187
+ } else if (paths.length) {
188
+ body["attachments"] = await Promise.all(paths.map(async (p) => {
189
+ const a = toAttachmentPayload(p, await readAttachment(p));
190
+ return { filename: a.filename, content_type: a.content_type, content: a.content };
191
+ }));
192
+ }
193
+ const sent = await c.unibox.sendEmail(id, body);
194
+ for (const w of sent["warnings"] ?? []) {
195
+ process.stderr.write(`warning: ${String(w["code"])}: ${(w["addresses"] ?? []).join(", ")} got nothing; everyone else did.
196
+ `);
197
+ }
198
+ renderSuccess(sent, outputOpts(f), process);
199
+ } catch (err) {
200
+ if (err instanceof AttachError) usage(err.message);
201
+ if (err.outcomeUnknown === true) {
202
+ 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\`.
203
+ `);
204
+ }
205
+ await fail(err, f);
206
+ }
207
+ }
208
+ var messageId = (f, cmd) => {
209
+ const id = String(f.messageId ?? "");
210
+ return id.trim() !== "" ? id : usage(`the message id is missing: \`curviate unibox referral ${cmd} <message_id>\` (the reply labelled referral).`);
211
+ };
212
+ async function runReferralSearch(c, f) {
213
+ const id = messageId(f, "search");
214
+ const body = f.name === void 0 ? {} : { name: f.name };
215
+ if (f.preview) return preview("unibox.referralSearch", { message_id: id }, body);
216
+ try {
217
+ renderSuccess(await c.unibox.referralSearch(id, body), outputOpts(f), process);
218
+ } catch (err) {
219
+ await fail(err, f);
220
+ }
221
+ }
222
+ async function runReferralConfirm(c, f) {
223
+ const id = messageId(f, "confirm");
224
+ 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.");
225
+ const body = f["provider-id"] !== void 0 ? { provider_id: f["provider-id"] } : { linkedin_url: f["linkedin-url"] };
226
+ if (f.preview) return preview("unibox.referralConfirm", { message_id: id }, body);
227
+ try {
228
+ renderSuccess(await c.unibox.referralConfirm(id, body), outputOpts(f), process);
229
+ } catch (err) {
230
+ await fail(err, f);
231
+ }
232
+ }
233
+ async function runConversation(c, f) {
234
+ const id = conversationId(f, "conversation get");
235
+ try {
236
+ renderSuccess(await c.unibox.getConversation(id), outputOpts(f), process);
237
+ } catch (err) {
238
+ await fail(err, f);
239
+ }
240
+ }
241
+ async function runTimeline(c, f) {
242
+ const id = conversationId(f, "conversation timeline");
243
+ try {
244
+ const q = {};
245
+ if (f.channel !== void 0) {
246
+ if (!["linkedin", "email"].includes(f.channel)) usage("--channel takes linkedin or email.");
247
+ q["channel"] = f.channel;
248
+ }
249
+ if (f.limit !== void 0) q["limit"] = intFlag("limit", f.limit, 1, 100);
250
+ await paged(f, q, (p) => c.unibox.listConversationMessages(id, p), (page) => print(table(["AT", "CHANNEL", "FROM", "TEXT"], page.items.map((m) => [
251
+ m["timestamp"],
252
+ m["channel"] ?? "event",
253
+ m["channel"] === null ? m["kind"] : m["is_sender"] ? "me" : m["sender"]?.["display_name"] ?? m["from"] ?? m["sender_id"],
254
+ m["channel"] === null ? m["campaign_name"] ?? "" : m["channel"] === "email" ? m["subject"] ?? m["text"] : m["text"]
255
+ ]))));
256
+ } catch (err) {
257
+ await fail(err, f);
258
+ }
259
+ }
119
260
  async function runReply(c, f) {
120
261
  const { accountId, chatId } = ids(f);
121
262
  if (!f.text) usage('the message text is required: `curviate unibox reply <account_id> <chat_id> "<text>"`.');
@@ -170,21 +311,21 @@ async function runRefresh(c, f) {
170
311
  }
171
312
  var REPLY_LABELS = ["interested", "not_now", "not_interested", "opt_out", "out_of_office", "referral", "other"];
172
313
  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.");
314
+ const messageId2 = String(f.messageId ?? "");
315
+ if (messageId2.trim() === "") usage("the message id is required: `curviate unibox label <message_id>`, as `curviate unibox messages` prints it.");
175
316
  if (f.set !== void 0) {
176
317
  if (!REPLY_LABELS.includes(f.set)) usage(`--set takes one of ${REPLY_LABELS.join(", ")}.`);
177
318
  const body = { reply_label: f.set };
178
- if (f.preview) return preview("unibox.updateMessage", { message_id: messageId }, body);
319
+ if (f.preview) return preview("unibox.updateMessage", { message_id: messageId2 }, body);
179
320
  try {
180
- renderSuccess(await c.unibox.updateMessage(messageId, body), outputOpts(f), process);
321
+ renderSuccess(await c.unibox.updateMessage(messageId2, body), outputOpts(f), process);
181
322
  } catch (err) {
182
323
  await fail(err, f);
183
324
  }
184
325
  return;
185
326
  }
186
327
  try {
187
- const res = await c.unibox.getReplyLabel(messageId);
328
+ const res = await c.unibox.getReplyLabel(messageId2);
188
329
  if (outputOpts(f).json) return renderSuccess(res, outputOpts(f), process);
189
330
  const cur = res.current;
190
331
  print(cur ? `${String(cur["label"])} (${String(cur["source"])}${cur["confidence"] == null ? "" : `, confidence ${String(cur["confidence"])}`})` : "no label");
@@ -260,6 +401,161 @@ var getCmd = defineCommand({
260
401
  args: { ...readOnly(WRITE_SINGLE_FLAGS), accountId: ACCOUNT, chatId: CHAT },
261
402
  run: online(runGet)
262
403
  });
404
+ var conversationGetCmd = defineCommand({
405
+ meta: {
406
+ name: "get",
407
+ 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.",
408
+ risk: "read",
409
+ seeAlso: ["curviate unibox conversation timeline", "curviate unibox email send", "curviate unibox list"],
410
+ examples: ["curviate unibox conversation get cnv_YOUR_CONVERSATION_ID"]
411
+ },
412
+ args: { ...readOnly(WRITE_SINGLE_FLAGS), conversationId: { type: "positional", description: "Conversation id (cnv_...)." } },
413
+ run: online(runConversation)
414
+ });
415
+ var conversationTimelineCmd = defineCommand({
416
+ meta: {
417
+ name: "timeline",
418
+ 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.",
419
+ risk: "read",
420
+ seeAlso: ["curviate unibox conversation get", "curviate unibox messages"],
421
+ examples: ["curviate unibox conversation timeline cnv_YOUR_CONVERSATION_ID", "curviate unibox conversation timeline cnv_YOUR_CONVERSATION_ID --channel email --json"]
422
+ },
423
+ args: {
424
+ ...readOnly(GLOBAL_FLAGS),
425
+ limit: { ...GLOBAL_FLAGS.limit, description: "LinkedIn messages per page (1 to 100); every email and event since the oldest of them comes with them." },
426
+ conversationId: { type: "positional", description: "Conversation id (cnv_...)." },
427
+ channel: { type: "string", description: "Only linkedin or email." }
428
+ },
429
+ run: online(runTimeline)
430
+ });
431
+ var conversationMarkCmd = defineCommand({
432
+ meta: {
433
+ name: "mark",
434
+ 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.",
435
+ risk: "write",
436
+ rules: {
437
+ changes: "The conversation's read state: the LinkedIn chat's on LinkedIn, the email's in Curviate.",
438
+ visible_to: "Everyone who reads this Account's chats; on LinkedIn, the Account's own person.",
439
+ budget_rows: [],
440
+ retry: "Safe: the same state again.",
441
+ undo: "Run it again with the other flag."
442
+ },
443
+ examples: ["curviate unibox conversation mark cnv_YOUR_CONVERSATION_ID --unread"]
444
+ },
445
+ args: {
446
+ ...WRITE_SINGLE_FLAGS,
447
+ conversationId: { type: "positional", description: "Conversation id (cnv_...)." },
448
+ read: { type: "boolean", description: "Mark it read." },
449
+ unread: { type: "boolean", description: "Mark it unread." }
450
+ },
451
+ run: online(runConversationMark)
452
+ });
453
+ var conversationCmd = defineCommand({
454
+ meta: { name: "conversation", description: "One person on one Account across LinkedIn and email: read it (get), its timeline, mark it read or unread." },
455
+ subCommands: { get: conversationGetCmd, timeline: conversationTimelineCmd, mark: conversationMarkCmd },
456
+ async run() {
457
+ const { showHelp } = await import("./examples-5FJS47QF.js");
458
+ await showHelp(conversationCmd, ["curviate", "unibox", "conversation"]);
459
+ }
460
+ });
461
+ var emailSendCmd = defineCommand({
462
+ meta: {
463
+ name: "send",
464
+ 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 read from paths on this machine, at most 10, 20 MiB in all, refused here before anything is sent) ride along; a link usually lands better than a file. Up to 6 MiB in all the files go inside the one request; above that each is first uploaded as a file of your Team (`campaign attachment upload`, counted against its daily uploads, kept 30 days) and the email names them by id. Bcc addresses are never shown to the other recipients; do not repeat them where others read. 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.",
465
+ risk: "write",
466
+ rules: {
467
+ changes: "An email is sent to the Lead now; their open Enrollments on this Account end as on a reply.",
468
+ visible_to: "The Lead (the recipient), and everyone who reads this conversation.",
469
+ budget_rows: [],
470
+ retry: "Never blind: a retry after a timeout can send the email twice. Read `curviate unibox conversation timeline <id> --channel email` first.",
471
+ undo: "None: an email cannot be unsent."
472
+ },
473
+ errors: {
474
+ 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.",
475
+ MAILBOX_STATE_CONFLICT: "the Mailbox needs reconnecting, is paused, or has sent its daily limit; the message names the way on.",
476
+ 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.",
477
+ PLATFORM_ERROR: "the provider did not take the email: nothing was sent (exit 7 when a retry may work). reason attachment_refused: the files were refused (from a Microsoft sign-in Mailbox, more than about 2.2 MB in all, refused before anything is sent): send a link or smaller files. With an unknown outcome it may have been sent: exit 1, do not send it again.",
478
+ RESOURCE_NOT_FOUND: "no such conversation, or an uploaded file is gone; nothing was sent.",
479
+ UNSUPPORTED_MEDIA_TYPE: "an attachment is an executable, a script or a macro-enabled Office file; nothing was sent."
480
+ },
481
+ seeAlso: ["curviate unibox conversation get", "curviate unibox conversation timeline"],
482
+ examples: [
483
+ 'curviate unibox email send cnv_YOUR_CONVERSATION_ID "Thanks, Thursday works." --thread thr_YOUR_THREAD_ID',
484
+ 'curviate unibox email send cnv_YOUR_CONVERSATION_ID "Following up on our call." --subject "Next steps" --preview'
485
+ ]
486
+ },
487
+ args: {
488
+ ...WRITE_SINGLE_FLAGS,
489
+ conversationId: { type: "positional", description: "Conversation id (cnv_...)." },
490
+ text: { type: "positional", description: "The email's text, plain text, 1 to 10,000 characters." },
491
+ thread: { type: "string", description: "Reply in this thread (thread_id)." },
492
+ subject: { type: "string", description: "Start a new thread with this subject." },
493
+ mailbox: { type: "string", description: "New thread only: the Mailbox to send from (mbx_...), one of the conversation's email.mailboxes." },
494
+ cc: { type: "string", description: "Cc addresses, repeatable or a comma list; every recipient sees them." },
495
+ bcc: { type: "string", description: "Bcc addresses, repeatable or a comma list; no other recipient sees them." },
496
+ attach: { type: "string", description: "A file on this machine to send, repeatable: at most 10, 20 MiB in all (never a URL). From a Microsoft sign-in Mailbox, about 2.2 MB in all go; more is refused with PLATFORM_ERROR (reason attachment_refused) and nothing is sent: send a link or a smaller file." }
497
+ },
498
+ run: online(runEmailSend)
499
+ });
500
+ var emailCmd = defineCommand({
501
+ meta: { name: "email", description: "Email from a conversation: send one plain-text email to its Lead." },
502
+ subCommands: { send: emailSendCmd },
503
+ async run() {
504
+ const { showHelp } = await import("./examples-5FJS47QF.js");
505
+ await showHelp(emailCmd, ["curviate", "unibox", "email"]);
506
+ }
507
+ });
508
+ var MESSAGE = { type: "positional", description: "The reply labelled referral (message id)." };
509
+ var referralSearchCmd = defineCommand({
510
+ meta: {
511
+ name: "search",
512
+ 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.",
513
+ risk: "write",
514
+ rules: {
515
+ changes: "Nothing stored but the name on the label; the search spends the Account's search limit.",
516
+ visible_to: "Your Team. LinkedIn sees one search by the Account.",
517
+ budget_rows: ["search"],
518
+ retry: "Each call is a new search and spends the limit again.",
519
+ undo: "Nothing to undo."
520
+ },
521
+ errors: { NOT_A_REFERRAL: "the message's label is not referral; nothing was searched." },
522
+ seeAlso: ["curviate unibox referral confirm", "curviate unibox label"],
523
+ examples: ["curviate unibox referral search YOUR_MESSAGE_ID", 'curviate unibox referral search YOUR_MESSAGE_ID --name "Jane Doe"']
524
+ },
525
+ args: { ...WRITE_SINGLE_FLAGS, messageId: MESSAGE, name: { type: "string", description: "The name to search for, instead of the one Curviate suggests." } },
526
+ run: online(runReferralSearch)
527
+ });
528
+ var referralConfirmCmd = defineCommand({
529
+ meta: {
530
+ name: "confirm",
531
+ 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.",
532
+ risk: "write",
533
+ rules: {
534
+ changes: "A new Lead, or none when you already hold the person.",
535
+ visible_to: "Your Team.",
536
+ budget_rows: [],
537
+ retry: "Safe: a person you already hold answers with that Lead.",
538
+ undo: "`curviate lead delete <lead_id>`."
539
+ },
540
+ 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." },
541
+ examples: ["curviate unibox referral confirm YOUR_MESSAGE_ID --provider-id ACoAAB1234567"]
542
+ },
543
+ args: {
544
+ ...WRITE_SINGLE_FLAGS,
545
+ messageId: MESSAGE,
546
+ "provider-id": { type: "string", description: "A candidate's provider_id, from `unibox referral search`." },
547
+ "linkedin-url": { type: "string", description: "Or the person's LinkedIn profile URL." }
548
+ },
549
+ run: online(runReferralConfirm)
550
+ });
551
+ var referralCmd = defineCommand({
552
+ meta: { name: "referral", description: "A reply labelled Referral: find the referred person on LinkedIn, then save them as a Lead." },
553
+ subCommands: { search: referralSearchCmd, confirm: referralConfirmCmd },
554
+ async run() {
555
+ const { showHelp } = await import("./examples-5FJS47QF.js");
556
+ await showHelp(referralCmd, ["curviate", "unibox", "referral"]);
557
+ }
558
+ });
263
559
  var unreadCmd = defineCommand({
264
560
  meta: {
265
561
  name: "unread",
@@ -398,7 +694,10 @@ var labelCmd = defineCommand({
398
694
  args: {
399
695
  ...WRITE_SINGLE_FLAGS,
400
696
  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." }
697
+ set: {
698
+ type: "string",
699
+ 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)."
700
+ }
402
701
  },
403
702
  run: online(runLabel)
404
703
  });
@@ -444,6 +743,9 @@ var uniboxCommand = defineCommand({
444
743
  get: getCmd,
445
744
  unread: unreadCmd,
446
745
  messages: messagesCmd,
746
+ conversation: conversationCmd,
747
+ email: emailCmd,
748
+ referral: referralCmd,
447
749
  reply: replyCmd,
448
750
  mark: markCmd,
449
751
  tag: tagCmd,
@@ -454,7 +756,7 @@ var uniboxCommand = defineCommand({
454
756
  consent: consentCmd
455
757
  },
456
758
  async run() {
457
- const { showHelp } = await import("./examples-J4X5NEIE.js");
759
+ const { showHelp } = await import("./examples-5FJS47QF.js");
458
760
  await showHelp(uniboxCommand, ["curviate", "unibox"]);
459
761
  }
460
762
  });
@@ -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-F3FEY4D5.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-5AJS2V4T.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-KD2XY7RS.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-ZC4S4B32.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.59.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.55.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
- };