outbound-sdk 0.11.0 → 0.13.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 (105) hide show
  1. package/dist/alerts/index.js +1 -1
  2. package/dist/budget/index.js +1 -1
  3. package/dist/cards/index.js +217 -100
  4. package/dist/cards/sender-tool-cards.d.ts +6 -0
  5. package/dist/chunks/{chunk-UAHYPASH.js → chunk-3LRIWQEJ.js} +2 -1
  6. package/dist/chunks/{chunk-UZLFZZ2U.js → chunk-6BSFR5SF.js} +14 -2
  7. package/dist/chunks/{chunk-FTK4JS65.js → chunk-BTIJ24UY.js} +89 -9
  8. package/dist/chunks/{chunk-OVTYA3IB.js → chunk-EAG5NIPM.js} +614 -206
  9. package/dist/chunks/{chunk-A7DLJUA6.js → chunk-FT6HMMMP.js} +3 -1
  10. package/dist/chunks/chunk-I7GBBHD2.js +80 -0
  11. package/dist/chunks/{chunk-UOJG4VYF.js → chunk-LD5OAELW.js} +1 -1
  12. package/dist/chunks/{chunk-KMQHXFIZ.js → chunk-LJNU4LAR.js} +2094 -1014
  13. package/dist/chunks/{chunk-POBAY3TI.js → chunk-NLYGMVXS.js} +30 -0
  14. package/dist/chunks/{chunk-V7JKTNRO.js → chunk-OE45PREW.js} +1 -1
  15. package/dist/chunks/{chunk-MEEJIIIA.js → chunk-OP2GL7ZT.js} +77 -8
  16. package/dist/chunks/{chunk-YFJ3OQZS.js → chunk-OPLXELPS.js} +5 -1
  17. package/dist/chunks/{chunk-CVLGFVDC.js → chunk-PDYE6CWS.js} +136 -64
  18. package/dist/chunks/{chunk-OMCDMELK.js → chunk-PUIHJFK4.js} +1 -1
  19. package/dist/chunks/{chunk-MPE6VLLY.js → chunk-UZ4YWUZ7.js} +1 -1
  20. package/dist/chunks/{tools-AVJ3XJ5A.js → tools-VCCH3JNL.js} +13 -6
  21. package/dist/cli/bin.js +11 -10
  22. package/dist/cli/config.d.ts +0 -2
  23. package/dist/cli/index.js +10 -9
  24. package/dist/cli/offered.d.ts +31 -2
  25. package/dist/cli/serve.d.ts +4 -2
  26. package/dist/combine/index.js +60 -4
  27. package/dist/emailbison/index.js +4 -4
  28. package/dist/fixtures/index.js +4 -4
  29. package/dist/heyreach/index.js +17 -6
  30. package/dist/identity/index.js +46 -11
  31. package/dist/identity/keys.d.ts +1 -1
  32. package/dist/index.js +8 -6
  33. package/dist/insights/capped.d.ts +14 -1
  34. package/dist/insights/define.d.ts +8 -6
  35. package/dist/insights/index.d.ts +1 -1
  36. package/dist/insights/index.js +12 -61
  37. package/dist/insights/inputs.generated.d.ts +91 -16
  38. package/dist/insights/ops/campaign-ranking.d.ts +8 -1
  39. package/dist/insights/ops/channel-mix.d.ts +8 -1
  40. package/dist/insights/ops/client-report.d.ts +28 -18
  41. package/dist/insights/ops/client-runway.d.ts +43 -0
  42. package/dist/insights/ops/index.d.ts +6 -1
  43. package/dist/insights/ops/period-comparison.d.ts +35 -2
  44. package/dist/insights/ops/pipeline-forecast.d.ts +14 -9
  45. package/dist/insights/ops/shared.d.ts +49 -2
  46. package/dist/insights/ops/tag-rollup.d.ts +8 -1
  47. package/dist/insights/people/coverage.d.ts +26 -0
  48. package/dist/insights/people/dropped-replies-check.d.ts +19 -3
  49. package/dist/insights/people/dropped-replies.d.ts +6 -2
  50. package/dist/insights/people/find.d.ts +5 -4
  51. package/dist/insights/people/hot-leads.d.ts +10 -1
  52. package/dist/insights/people/index.d.ts +26 -2
  53. package/dist/insights/people/lead-collisions.d.ts +18 -1
  54. package/dist/insights/people/person-summary.d.ts +15 -3
  55. package/dist/insights/people/suppression-check.d.ts +18 -1
  56. package/dist/insights/people/thread-context.d.ts +79 -0
  57. package/dist/insights/people/thread-contexts.d.ts +59 -0
  58. package/dist/insights/people/thread-read.d.ts +33 -0
  59. package/dist/insights/registry.d.ts +29 -3
  60. package/dist/insights/senders/domain-health.d.ts +1 -1
  61. package/dist/insights/senders/index.d.ts +1 -1
  62. package/dist/insights/senders/read.d.ts +9 -0
  63. package/dist/insights/tools.d.ts +35 -2
  64. package/dist/instantly/adapter.d.ts +3 -2
  65. package/dist/instantly/capabilities.d.ts +5 -0
  66. package/dist/instantly/index.js +255 -66
  67. package/dist/instantly/lead-ids.d.ts +11 -0
  68. package/dist/instantly/map-lead.d.ts +19 -2
  69. package/dist/instantly/senders.d.ts +3 -0
  70. package/dist/internal/adapter.d.ts +7 -0
  71. package/dist/internal/capabilities.d.ts +8 -0
  72. package/dist/internal/entities.d.ts +24 -1
  73. package/dist/internal/fields.d.ts +10 -0
  74. package/dist/internal/outbound/api.d.ts +12 -0
  75. package/dist/internal/outbound/operations-account.d.ts +4 -1
  76. package/dist/internal/outbound/outbound.d.ts +2 -1
  77. package/dist/internal/outbound/specs-account.d.ts +2 -1
  78. package/dist/internal/person.d.ts +32 -0
  79. package/dist/internal/records.d.ts +2 -2
  80. package/dist/internal/reply-people.d.ts +25 -7
  81. package/dist/internal/runway.d.ts +38 -5
  82. package/dist/internal/url.d.ts +2 -1
  83. package/dist/loader/index.js +1 -1
  84. package/dist/memory/data.d.ts +2 -1
  85. package/dist/memory/index.js +6 -4
  86. package/dist/redact/index.d.ts +1 -1
  87. package/dist/redact/index.js +62 -31
  88. package/dist/redact/plugin.d.ts +13 -11
  89. package/dist/redact/tokens.d.ts +18 -1
  90. package/dist/smartlead/index.js +21 -7
  91. package/dist/tools/account-tools.d.ts +0 -5
  92. package/dist/tools/ai-sdk.js +5 -3
  93. package/dist/tools/campaign-tools.d.ts +0 -4
  94. package/dist/tools/claude-agent.js +5 -3
  95. package/dist/tools/deliverability-check.d.ts +9 -0
  96. package/dist/tools/index.js +6 -4
  97. package/dist/tools/people-tools.d.ts +4 -1
  98. package/dist/tools/person-input.d.ts +17 -0
  99. package/dist/tools/registry.d.ts +8 -1
  100. package/dist/tools/sender-health.d.ts +8 -0
  101. package/dist/tools/sender-impact.d.ts +38 -0
  102. package/dist/tools/shared.d.ts +5 -0
  103. package/dist/webhooks/index.js +6 -6
  104. package/package.json +1 -1
  105. /package/dist/chunks/{chunk-5XLR6XVV.js → chunk-HNYJO6B4.js} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  metricRowSchema,
7
7
  senderSchema,
8
8
  senderStatusSchema
9
- } from "../chunks/chunk-POBAY3TI.js";
9
+ } from "../chunks/chunk-NLYGMVXS.js";
10
10
  import {
11
11
  computeRates
12
12
  } from "../chunks/chunk-CPACP4YD.js";
@@ -20,7 +20,7 @@ var budget = (options) => {
20
20
  const live = /* @__PURE__ */ new WeakMap();
21
21
  const spent = (provider) => new OutboundError(
22
22
  "RateLimited",
23
- `The run used its budget of ${plural(options.maxRequests, "request")} to ${provider}. ${options.setting === void 0 ? "Call requestBudget.reset() to start a new run, or raise budget()'s maxRequests." : `Raise ${options.setting}.`}`,
23
+ `The run used its budget of ${plural(options.maxRequests, "request")} to ${provider}. That budget is a cap you set, not the vendor's rate limit. ${options.setting === void 0 ? "Call requestBudget.reset() to start a new run, or raise budget()'s maxRequests." : `Raise ${options.setting}.`}`,
24
24
  { limit: "run", provider }
25
25
  );
26
26
  return {
@@ -836,20 +836,24 @@ var accountSummary = (data) => {
836
836
  };
837
837
  };
838
838
  var findings = (items, dot) => items.map((item) => `${dot} ${show(item, "finding")}`);
839
+ var incompleteCheck = (totals, total) => field(totals, total) === null;
840
+ var unclean = (data, incomplete) => incomplete ? `\u{1F7E1} ${show(data, "finding")}` : null;
839
841
  var leadCollisions = (data) => {
840
842
  const totals = child(data, "totals");
841
- const found = num(totals, "collisions") ?? 0;
843
+ const found = num(totals, "collisionsFound") ?? num(totals, "collisions") ?? 0;
844
+ const incomplete = incompleteCheck(totals, "collisions");
842
845
  const concurrent = num(totals, "concurrent") ?? found;
843
- const problem = concurrent > 0 ? `\u{1F7E1} ${plural(concurrent, "person", "people")} in two or more campaigns at once.` : `\u{1F7E1} ${plural(found, "person", "people")} in two or more campaigns, none active in two now.`;
846
+ const least = incomplete ? "At least " : "";
847
+ const problem = concurrent > 0 ? `\u{1F7E1} ${least}${plural(concurrent, "person", "people")} in two or more campaigns at once.` : `\u{1F7E1} ${least}${plural(found, "person", "people")} in two or more campaigns, none active in two now.`;
844
848
  return {
845
849
  bullets: findings(rows(data, "collisions"), "\u{1F7E1}"),
846
850
  finding: verdict(
847
851
  num(totals, "leadsRead"),
848
- found === 0 ? null : problem,
852
+ found > 0 ? problem : unclean(data, incomplete),
849
853
  "Nobody is in two campaigns at once."
850
854
  ),
851
855
  stats: [
852
- ["Collisions", int(found)],
856
+ [incomplete ? "Collisions found" : "Collisions", int(found)],
853
857
  ["Across tools", int(num(totals, "acrossTools"))],
854
858
  ["Within one tool", int(num(totals, "withinTool"))],
855
859
  ["Leads read", int(num(totals, "leadsRead"))]
@@ -859,25 +863,29 @@ var leadCollisions = (data) => {
859
863
  };
860
864
  var suppressionCheck = (data) => {
861
865
  const totals = child(data, "totals");
862
- const found = num(totals, "violations") ?? 0;
866
+ const found = num(totals, "violationsFound") ?? num(totals, "violations") ?? 0;
867
+ const incomplete = incompleteCheck(totals, "violations");
863
868
  const byMatch = child(totals, "byMatch");
864
869
  const moreEntries = bool(totals, "moreBlockEntriesExist") === true;
865
870
  const capped = [
871
+ ...bool(totals, "moreCampaignsExist") === true ? [
872
+ `\u{1F7E1} Stopped at ${plural(num(totals, "campaignsRead") ?? 0, "campaign")}; more exist and were not checked.`
873
+ ] : [],
866
874
  ...moreEntries ? [
867
875
  `\u{1F7E1} Stopped at ${plural(num(totals, "blockEntriesRead") ?? 0, "block list entry", "block list entries")}; more exist and were not checked.`
868
876
  ] : [],
869
877
  ...bool(totals, "moreLeadsExist") === true ? ["\u{1F7E1} A campaign had more leads than were read; those were not checked."] : []
870
878
  ];
871
- const problem = found === 0 ? null : `\u{1F534} ${plural(found, "blocked lead")} still in a campaign.`;
879
+ const problem = found === 0 ? null : `\u{1F534} ${incomplete ? "At least " : ""}${plural(found, "blocked lead")} still in a campaign.`;
872
880
  return {
873
881
  bullets: [...capped, ...findings(rows(data, "violations"), "\u{1F534}")],
874
882
  finding: verdict(
875
883
  num(totals, "leadsRead"),
876
- problem ?? (moreEntries ? "\u{1F7E1} No blocked lead found in the entries read, but more entries exist." : null),
884
+ problem ?? unclean(data, incomplete) ?? (moreEntries ? "\u{1F7E1} No blocked lead found in the entries read, but more entries exist." : null),
877
885
  "No blocked lead is in a campaign."
878
886
  ),
879
887
  stats: [
880
- ["Violations", int(found)],
888
+ [incomplete ? "Violations found" : "Violations", int(found)],
881
889
  ["Already stopped, not counted", int(num(totals, "alreadyStopped"))],
882
890
  ["By email", int(num(byMatch, "email"))],
883
891
  ["By domain", int(num(byMatch, "domain"))],
@@ -962,6 +970,56 @@ var hotLeads = (data) => {
962
970
  title: "Hot leads"
963
971
  };
964
972
  };
973
+ var FOLLOW_UP = /* @__PURE__ */ new Map([
974
+ ["answered", "Answered"],
975
+ ["automatic", "Automatic reply last"],
976
+ ["inbound_unanswered", "Reply owed"],
977
+ ["meeting", "Meeting recorded"],
978
+ ["no_messages", "No messages"],
979
+ ["not_read", "Not read"]
980
+ ]);
981
+ var threadContext = (data) => {
982
+ const coverage = child(data, "coverage");
983
+ const threads = rows(data, "threads");
984
+ const unchecked = rows(coverage, "unchecked").length;
985
+ const remaining = num(coverage, "remaining") ?? 0;
986
+ const owed = threads.filter(
987
+ (thread) => bool(child(thread, "followUp"), "needed") === true
988
+ ).length;
989
+ return {
990
+ bullets: [
991
+ ...unchecked > 0 ? [`\u{1F7E1} Could not read ${plural(unchecked, "conversation")}.`] : [],
992
+ ...remaining > 0 ? [`\u{1F7E1} ${plural(remaining, "conversation")} left for the next page.`] : [],
993
+ "Rules read who wrote last and when, never the words: read the latest message before acting."
994
+ ],
995
+ finding: verdict(
996
+ num(coverage, "checked"),
997
+ owed === 0 ? null : `\u{1F534} The latest message is inbound and unanswered in ${plural(owed, "conversation")}.`,
998
+ "No conversation read ends with an unanswered inbound message."
999
+ ),
1000
+ stats: [
1001
+ ["Requested", int(num(coverage, "requested"))],
1002
+ ["Read", int(num(coverage, "checked"))],
1003
+ ["Found", int(num(coverage, "found"))],
1004
+ ["Could not read", int(unchecked)]
1005
+ ],
1006
+ table: {
1007
+ align: [LEFT, LEFT, LEFT, LEFT],
1008
+ cards: { subtitle: [1, 2], title: 0 },
1009
+ headers: ["Lead or thread", "Latest message", "Meeting", "Follow-up"],
1010
+ rows: threads.map((thread) => {
1011
+ const latest = child(child(thread, "activity"), "latest");
1012
+ return [
1013
+ str(thread, "email") ?? str(thread, "linkedinUrl") ?? str(thread, "lead") ?? show(child(thread, "target"), "id"),
1014
+ str(latest, "sentAt") === null ? DASH : `${str(latest, "direction") === "in" ? "Inbound" : "Outbound"}, ${day(str(latest, "sentAt"))}`,
1015
+ words(show(thread, "meeting")),
1016
+ FOLLOW_UP.get(str(child(thread, "followUp"), "basis") ?? "") ?? DASH
1017
+ ];
1018
+ })
1019
+ },
1020
+ title: "Conversations"
1021
+ };
1022
+ };
965
1023
  var personalizationGaps = (data) => {
966
1024
  const totals = child(data, "totals");
967
1025
  const affected = num(totals, "leadsAffected") ?? 0;
@@ -1004,7 +1062,8 @@ var PEOPLE_CARDS = /* @__PURE__ */ new Map([
1004
1062
  ["lead_collisions", leadCollisions],
1005
1063
  ["person_summary", personSummary],
1006
1064
  ["personalization_gaps", personalizationGaps],
1007
- ["suppression_check", suppressionCheck]
1065
+ ["suppression_check", suppressionCheck],
1066
+ ["thread_context", threadContext]
1008
1067
  ]);
1009
1068
 
1010
1069
  // src/cards/sender-cards.ts
@@ -1316,9 +1375,153 @@ var buildSpec = (frame) => {
1316
1375
  return { elements, root: "card" };
1317
1376
  };
1318
1377
 
1319
- // src/cards/tool-cards.ts
1378
+ // src/cards/sender-tool-cards.ts
1320
1379
  var RIGHT2 = "right";
1321
1380
  var LEFT2 = "left";
1381
+ var warmup = (sender) => {
1382
+ const score = num(sender, "warmup_score");
1383
+ if (score !== null) {
1384
+ return int(score);
1385
+ }
1386
+ const enabled = bool(sender, "warmup_enabled");
1387
+ if (enabled === null) {
1388
+ return DASH;
1389
+ }
1390
+ return enabled ? "On" : "Off";
1391
+ };
1392
+ var impactLine = (sender) => {
1393
+ if (!isJsonObject(field(sender, "impact"))) {
1394
+ return "";
1395
+ }
1396
+ const impact = child(sender, "impact");
1397
+ const campaigns = rows(impact, "active_campaigns");
1398
+ const count2 = num(impact, "active_campaign_count");
1399
+ const sent = num(child(impact, "recent_sends"), "sent");
1400
+ const last = str(impact, "last_sent_on");
1401
+ const parts = [
1402
+ count2 === null ? "active campaigns unknown" : `${plural(count2, "active campaign")}${campaigns.length === 0 ? "" : ` (${campaigns.map((campaign) => show(campaign, "name")).join(", ")})`}`,
1403
+ sent === null ? "recent sends unknown" : `${int(sent)} sent in 14 days`,
1404
+ ...last === null ? [] : [`last sent ${last}`]
1405
+ ];
1406
+ return `: ${parts.join(", ")}`;
1407
+ };
1408
+ var who = (sender) => str(sender, "address") ?? str(sender, "name") ?? "A LinkedIn seat";
1409
+ var failingBullets = (senders) => senders.flatMap(
1410
+ (sender) => isJsonObject(field(sender, "impact")) ? [
1411
+ `\u{1F534} **${who(sender)}** (${show(sender, "status")})${impactLine(sender)}`
1412
+ ] : []
1413
+ );
1414
+ var senderHealth = (data) => {
1415
+ const senders = rows(data, "senders");
1416
+ const unhealthy = num(data, "unhealthy") ?? 0;
1417
+ const checked = num(data, "checked") ?? senders.length;
1418
+ const failing = num(data, "failing");
1419
+ const stats = [
1420
+ ["Senders checked", int(checked)],
1421
+ ["Not active", int(unhealthy)],
1422
+ ...failing === null ? [] : [["Failing", int(failing)]]
1423
+ ];
1424
+ return {
1425
+ bullets: failingBullets(senders),
1426
+ finding: verdict(
1427
+ checked,
1428
+ unhealthy === 0 ? null : `\u{1F534} ${int(unhealthy)} of ${plural(checked, "sender")} ${unhealthy === 1 ? "needs" : "need"} attention.`,
1429
+ `No sender needs attention (${int(checked)} checked).`
1430
+ ),
1431
+ stats,
1432
+ table: {
1433
+ align: [LEFT2, LEFT2, LEFT2, RIGHT2, RIGHT2],
1434
+ headers: ["Sender", "Kind", "Status", "Daily limit", "Warmup"],
1435
+ rows: senders.map((sender) => [
1436
+ str(sender, "address") ?? show(sender, "sender"),
1437
+ show(sender, "kind"),
1438
+ show(sender, "status"),
1439
+ int(num(sender, "daily_limit")),
1440
+ warmup(sender)
1441
+ ]),
1442
+ // The more count covers every sender checked, not only those in the answer.
1443
+ total: checked
1444
+ },
1445
+ title: "Sender health"
1446
+ };
1447
+ };
1448
+ var dns = (sender, record) => {
1449
+ const passes = bool(child(sender, "dns"), record);
1450
+ if (passes === null) {
1451
+ return DASH;
1452
+ }
1453
+ return passes ? "\u2713" : "\u2717";
1454
+ };
1455
+ var coverageStats = (data) => {
1456
+ if (!isJsonObject(field(data, "coverage"))) {
1457
+ return [];
1458
+ }
1459
+ const coverage = child(data, "coverage");
1460
+ const byReason = child(coverage, "not_checked_by_reason");
1461
+ return [
1462
+ ["Checked in full", int(num(coverage, "checked"))],
1463
+ ["Not checked", int(num(coverage, "not_checked"))],
1464
+ ...["cap", "unsupported", "error"].flatMap((reason) => {
1465
+ const amount = num(byReason, reason) ?? 0;
1466
+ return amount === 0 ? [] : [[`Not checked: ${reason}`, int(amount)]];
1467
+ })
1468
+ ];
1469
+ };
1470
+ var deliverabilityCheck = (data) => {
1471
+ const senders = rows(data, "senders");
1472
+ const broken = num(data, "with_problems") ?? 0;
1473
+ const screened = num(data, "screened") ?? senders.length;
1474
+ return {
1475
+ bullets: senders.flatMap((sender) => {
1476
+ const problems = strings(sender, "problems");
1477
+ return problems.length === 0 ? [] : [
1478
+ `\u{1F534} **${show(sender, "address")}**: ${problems.join("; ")}${impactLine(sender)}`
1479
+ ];
1480
+ }),
1481
+ finding: verdict(
1482
+ screened,
1483
+ broken === 0 ? null : `\u{1F534} ${int(broken)} of ${plural(screened, "sender")} ${noun(broken, "has", "have")} a problem.`,
1484
+ `No problem found on ${plural(screened, "sender")}.`
1485
+ ),
1486
+ stats: coverageStats(data),
1487
+ table: {
1488
+ align: [LEFT2, "center", "center", "center", "center", LEFT2, RIGHT2],
1489
+ headers: [
1490
+ "Sender",
1491
+ "SPF",
1492
+ "DKIM",
1493
+ "DMARC",
1494
+ "MX",
1495
+ "Signed in",
1496
+ "Spam rate"
1497
+ ],
1498
+ rows: senders.map(
1499
+ (sender) => bool(sender, "checked") === false ? [
1500
+ show(sender, "address"),
1501
+ DASH,
1502
+ DASH,
1503
+ DASH,
1504
+ DASH,
1505
+ `not checked (${show(child(sender, "not_checked"), "reason")})`,
1506
+ DASH
1507
+ ] : [
1508
+ show(sender, "address"),
1509
+ dns(sender, "spf"),
1510
+ dns(sender, "dkim"),
1511
+ dns(sender, "dmarc"),
1512
+ dns(sender, "mx"),
1513
+ yesNo(bool(sender, "connected")),
1514
+ pct(num(sender, "warmup_spam_rate"))
1515
+ ]
1516
+ )
1517
+ },
1518
+ title: "Deliverability check"
1519
+ };
1520
+ };
1521
+
1522
+ // src/cards/tool-cards.ts
1523
+ var RIGHT3 = "right";
1524
+ var LEFT3 = "left";
1322
1525
  var metricCells = (metrics) => [
1323
1526
  int(num(metrics, "sent")),
1324
1527
  int(num(metrics, "replied")),
@@ -1347,7 +1550,7 @@ var campaignOverview = (data) => {
1347
1550
  finding: top === void 0 ? "No campaign has a reply rate yet." : `${show(top, "name")} leads at ${pct(rate(top))} reply rate.`,
1348
1551
  subtitle: plural(campaigns.length, "campaign"),
1349
1552
  table: {
1350
- align: [LEFT2, RIGHT2, RIGHT2, RIGHT2, RIGHT2, RIGHT2],
1553
+ align: [LEFT3, RIGHT3, RIGHT3, RIGHT3, RIGHT3, RIGHT3],
1351
1554
  headers: [
1352
1555
  "Campaign",
1353
1556
  "Sent",
@@ -1401,7 +1604,7 @@ var winningSteps = (data) => {
1401
1604
  finding: top === void 0 ? "The vendor reports no reply rate by step for this campaign." : `Step ${stepOf(top, "step")}${str(top, "variant") === null ? "" : ` variant ${show(top, "variant")}`} leads at ${pct(num(child(top, "metrics"), "reply_rate"))}.`,
1402
1605
  subtitle: show(data, "campaign"),
1403
1606
  table: {
1404
- align: [LEFT2, LEFT2, RIGHT2, RIGHT2, RIGHT2],
1607
+ align: [LEFT3, LEFT3, RIGHT3, RIGHT3, RIGHT3],
1405
1608
  headers: ["Step", "Variant", "Sent", "Replies", "Reply rate"],
1406
1609
  rows: steps.map((each) => {
1407
1610
  const metrics = child(each, "metrics");
@@ -1417,47 +1620,6 @@ var winningSteps = (data) => {
1417
1620
  title: "Winning steps"
1418
1621
  };
1419
1622
  };
1420
- var warmup = (sender) => {
1421
- const score = num(sender, "warmup_score");
1422
- if (score !== null) {
1423
- return int(score);
1424
- }
1425
- const enabled = bool(sender, "warmup_enabled");
1426
- if (enabled === null) {
1427
- return DASH;
1428
- }
1429
- return enabled ? "On" : "Off";
1430
- };
1431
- var senderHealth = (data) => {
1432
- const senders = rows(data, "senders");
1433
- const unhealthy = num(data, "unhealthy") ?? 0;
1434
- const checked = num(data, "checked") ?? senders.length;
1435
- return {
1436
- finding: verdict(
1437
- checked,
1438
- unhealthy === 0 ? null : `\u{1F534} ${int(unhealthy)} of ${plural(checked, "sender")} ${unhealthy === 1 ? "needs" : "need"} attention.`,
1439
- `No sender needs attention (${int(checked)} checked).`
1440
- ),
1441
- stats: [
1442
- ["Senders checked", int(checked)],
1443
- ["Not active", int(unhealthy)]
1444
- ],
1445
- table: {
1446
- align: [LEFT2, LEFT2, LEFT2, RIGHT2, RIGHT2],
1447
- headers: ["Sender", "Kind", "Status", "Daily limit", "Warmup"],
1448
- rows: senders.map((sender) => [
1449
- str(sender, "address") ?? show(sender, "sender"),
1450
- show(sender, "kind"),
1451
- show(sender, "status"),
1452
- int(num(sender, "daily_limit")),
1453
- warmup(sender)
1454
- ]),
1455
- // The more count covers every sender checked, not only those in the answer.
1456
- total: checked
1457
- },
1458
- title: "Sender health"
1459
- };
1460
- };
1461
1623
  var quote = (body) => {
1462
1624
  const content = str(body, "untrusted_content");
1463
1625
  return content === null ? "" : `
@@ -1512,7 +1674,7 @@ var compareClients = (data) => {
1512
1674
  ),
1513
1675
  subtitle: plural(clients.length, "client"),
1514
1676
  table: {
1515
- align: [LEFT2, RIGHT2, RIGHT2, RIGHT2, RIGHT2, RIGHT2],
1677
+ align: [LEFT3, RIGHT3, RIGHT3, RIGHT3, RIGHT3, RIGHT3],
1516
1678
  headers: [
1517
1679
  "Client",
1518
1680
  "Campaigns",
@@ -1579,57 +1741,12 @@ var campaignSetup = (data) => ({
1579
1741
  subtitle: show(data, "campaign"),
1580
1742
  title: "Campaign setup"
1581
1743
  });
1582
- var dns = (sender, record) => {
1583
- const passes = bool(child(sender, "dns"), record);
1584
- if (passes === null) {
1585
- return DASH;
1586
- }
1587
- return passes ? "\u2713" : "\u2717";
1588
- };
1589
- var deliverabilityCheck = (data) => {
1590
- const senders = rows(data, "senders");
1591
- const broken = num(data, "with_problems") ?? 0;
1592
- const screened = num(data, "screened") ?? senders.length;
1593
- return {
1594
- bullets: senders.flatMap((sender) => {
1595
- const problems = strings(sender, "problems");
1596
- return problems.length === 0 ? [] : [`\u{1F534} **${show(sender, "address")}**: ${problems.join("; ")}`];
1597
- }),
1598
- finding: verdict(
1599
- screened,
1600
- broken === 0 ? null : `\u{1F534} ${int(broken)} of ${plural(screened, "sender")} ${noun(broken, "has", "have")} a problem.`,
1601
- `No problem found on ${plural(screened, "sender")}.`
1602
- ),
1603
- table: {
1604
- align: [LEFT2, "center", "center", "center", "center", LEFT2, RIGHT2],
1605
- headers: [
1606
- "Sender",
1607
- "SPF",
1608
- "DKIM",
1609
- "DMARC",
1610
- "MX",
1611
- "Signed in",
1612
- "Spam rate"
1613
- ],
1614
- rows: senders.map((sender) => [
1615
- show(sender, "address"),
1616
- dns(sender, "spf"),
1617
- dns(sender, "dkim"),
1618
- dns(sender, "dmarc"),
1619
- dns(sender, "mx"),
1620
- yesNo(bool(sender, "connected")),
1621
- pct(num(sender, "warmup_spam_rate"))
1622
- ])
1623
- },
1624
- title: "Deliverability check"
1625
- };
1626
- };
1627
1744
  var audienceLists = (data) => {
1628
1745
  const lists = rows(data, "lists");
1629
1746
  return {
1630
1747
  subtitle: plural(lists.length, "list"),
1631
1748
  table: {
1632
- align: [LEFT2, LEFT2, RIGHT2, LEFT2],
1749
+ align: [LEFT3, LEFT3, RIGHT3, LEFT3],
1633
1750
  headers: ["List", "Kind", "Size", "Created"],
1634
1751
  rows: lists.map((list2) => [
1635
1752
  show(list2, "name"),
@@ -0,0 +1,6 @@
1
+ import type { Json } from "../internal/json.ts";
2
+ import type { CardContent } from "./content.ts";
3
+ type CardBuilder = (data: Json) => CardContent;
4
+ export declare const senderHealth: CardBuilder;
5
+ export declare const deliverabilityCheck: CardBuilder;
6
+ export {};
@@ -6,7 +6,7 @@ import {
6
6
  leadStanding,
7
7
  toVariant,
8
8
  variantKey
9
- } from "./chunk-UOJG4VYF.js";
9
+ } from "./chunk-LD5OAELW.js";
10
10
  import {
11
11
  eventData,
12
12
  recordBase,
@@ -216,6 +216,7 @@ var leadRecord = (identity, lead, place) => ({
216
216
  lastName: text(lead.last_name),
217
217
  linkedinUrl: text(lead.linkedin_profile),
218
218
  location: text(lead.location),
219
+ meeting: null,
219
220
  phone: text(lead.phone_number),
220
221
  recipientMailProvider: null,
221
222
  tags: [...place.tags],
@@ -5,7 +5,7 @@ import {
5
5
  createVendorClient,
6
6
  leadStanding,
7
7
  listIn
8
- } from "./chunk-UOJG4VYF.js";
8
+ } from "./chunk-LD5OAELW.js";
9
9
  import {
10
10
  normalizeBody
11
11
  } from "./chunk-FALWG5U3.js";
@@ -127,6 +127,7 @@ var fields = {
127
127
  interestCategory: "derived",
128
128
  linkedinUrl: false,
129
129
  location: false,
130
+ meeting: false,
130
131
  phone: false,
131
132
  recipientMailProvider: false,
132
133
  tags: false,
@@ -136,8 +137,12 @@ var fields = {
136
137
  // A message is not marked automatic; a reply is.
137
138
  message: {
138
139
  isAuto: false,
140
+ // Read only by the Instantly adapter, whose emails name their lead by address.
141
+ leadEmail: false,
139
142
  isAutoSource: false,
140
143
  stepIndex: false,
144
+ // No link to one master inbox conversation is documented.
145
+ url: false,
141
146
  variantKey: false
142
147
  },
143
148
  metricRow: {
@@ -160,9 +165,11 @@ var fields = {
160
165
  },
161
166
  placementTest: false,
162
167
  reply: {
168
+ leadEmail: false,
163
169
  // A fixed rule reads the sender, subject and body when automated_reply is missing.
164
170
  leftCompany: "derived",
165
171
  stepIndex: false,
172
+ url: false,
166
173
  variantKey: false
167
174
  },
168
175
  sender: { linkedinUrl: false },
@@ -232,7 +239,8 @@ var caveats = [
232
239
  "Webhooks: only EMAIL_SENT, MANUAL_EMAIL_SENT and TAG_ATTACHED have documented payloads. The others are read with the same data keys. Payloads carry no event id, so the id is derived from the event type and the ids in data.",
233
240
  "Webhook signatures are not verified: the signing scheme behind webhooks_secret_key is undocumented. Put a secret in the webhook URL.",
234
241
  "Block list entries come from two lists: emails first, then domains.",
235
- "A lead list's size is leads_succeeded."
242
+ "A lead list's size is leads_succeeded.",
243
+ "A message's or reply's url is null: EmailBison documents no link to one master inbox conversation, and no read returns one."
236
244
  ];
237
245
 
238
246
  // src/emailbison/client.ts
@@ -315,6 +323,7 @@ var toSentMessage = (identity, raw, includeBody) => ({
315
323
  subject: text(raw.email_subject),
316
324
  // A campaign email is not in the master inbox, so it has no thread there.
317
325
  threadId: null,
326
+ url: null,
318
327
  variantKey: null
319
328
  });
320
329
  var isOutgoing = (raw) => (text(raw.folder) ?? "").toLowerCase() === "sent";
@@ -331,6 +340,8 @@ var inboxFields = (identity, raw, includeBody) => ({
331
340
  subject: text(raw.subject) ?? text(raw.email_subject),
332
341
  // Any reply in a conversation reads the whole conversation.
333
342
  threadId: text(raw.id),
343
+ // EmailBison documents no link to one master inbox conversation.
344
+ url: null,
334
345
  variantKey: null
335
346
  });
336
347
  var toInboxMessage = (identity, raw, includeBody) => ({
@@ -523,6 +534,7 @@ var toLead = (identity, raw, campaignId = null) => {
523
534
  lastName: text(raw.last_name),
524
535
  linkedinUrl: null,
525
536
  location: null,
537
+ meeting: null,
526
538
  phone: null,
527
539
  recipientMailProvider: null,
528
540
  tags: [],
@@ -1,3 +1,9 @@
1
+ import {
2
+ PERSON_FORMS,
3
+ leadRefParts,
4
+ notAPerson,
5
+ personKey
6
+ } from "./chunk-I7GBBHD2.js";
1
7
  import {
2
8
  computeRates
3
9
  } from "./chunk-CPACP4YD.js";
@@ -224,18 +230,83 @@ var splitActive = (leads) => {
224
230
  } : { active: active.length, inSequence: null, notStarted: null };
225
231
  };
226
232
  var leadsToStart = (split) => split.notStarted ?? split.active;
227
- var runwayDays = (split, byStatus, complete, pace) => {
228
- const left = leadsToStart(split);
229
- if (left === 0) {
230
- return complete && byStatus.unknown === 0 ? 0 : null;
233
+ var runwayOf = (split, byStatus, complete, pace) => {
234
+ const remaining = leadsToStart(split);
235
+ const moving = pace !== null && pace > 0;
236
+ const base = { inSequence: split.inSequence, pace, remaining };
237
+ if (remaining === 0) {
238
+ const counted = complete && byStatus.unknown === 0;
239
+ return {
240
+ ...base,
241
+ daysLeft: counted && moving ? 0 : null,
242
+ state: counted ? "out_of_leads" : "unknown"
243
+ };
244
+ }
245
+ return moving ? { ...base, daysLeft: roundTo(remaining / pace), state: "draining" } : { ...base, daysLeft: null, state: "stalled" };
246
+ };
247
+ var RUNWAY_MAX_LEADS = 5e3;
248
+ var runwayStatus = (capabilities) => capabilities["leads.byStatus"] === true ? "active" : void 0;
249
+
250
+ // src/tools/person-input.ts
251
+ import { z as z3 } from "zod";
252
+ var personFields = {
253
+ email: z3.string().optional().describe("The person's email address, for example jane@acme.com"),
254
+ lead_ref: z3.string().optional().describe(
255
+ "A lead ref exactly as another tool returned it (provider:workspace:id), for example a reply's leadRef or a lead's ref. A ref's provider picks the tool it is read from"
256
+ ),
257
+ linkedin_url: z3.string().optional().describe("The person's LinkedIn profile URL"),
258
+ person: z3.string().optional().describe(
259
+ `Any of ${PERSON_FORMS}. Give exactly one of person, lead_ref, email and linkedin_url`
260
+ )
261
+ };
262
+ var NAMES = ["lead_ref", "email", "linkedin_url", "person"];
263
+ var wrongKind = (name, value) => {
264
+ const isRef = leadRefParts(value) !== null;
265
+ const key = personKey(value);
266
+ switch (name) {
267
+ case "lead_ref": {
268
+ return isRef ? null : `takes a lead ref as another tool returned it (provider:workspace:id); ${key === null ? notAPerson(value) : `pass "${value.trim()}" as ${key.startsWith("email:") ? "email" : "linkedin_url"} instead`}`;
269
+ }
270
+ case "email": {
271
+ if (key?.startsWith("email:") === true) {
272
+ return null;
273
+ }
274
+ return isRef ? `takes an email address; "${value.trim()}" is a lead ref, so pass it as lead_ref` : `takes an email address: ${notAPerson(value)}`;
275
+ }
276
+ case "linkedin_url": {
277
+ if (key?.startsWith("linkedin:") === true) {
278
+ return null;
279
+ }
280
+ return isRef ? `takes a LinkedIn profile URL; "${value.trim()}" is a lead ref, so pass it as lead_ref` : `takes a LinkedIn profile URL, for example https://www.linkedin.com/in/jane-doe; "${value.trim()}" is not one`;
281
+ }
282
+ default: {
283
+ return isRef || key !== null ? null : notAPerson(value);
284
+ }
231
285
  }
232
- return pace === null || pace <= 0 ? null : roundTo(left / pace);
233
286
  };
287
+ var checkPerson = (values, context) => {
288
+ const given = NAMES.filter((name2) => values[name2] !== void 0);
289
+ if (given.length !== 1) {
290
+ context.addIssue({
291
+ code: "custom",
292
+ message: `needs exactly one of lead_ref, email, linkedin_url or person (${PERSON_FORMS})${given.length > 1 ? `, but got ${given.join(" and ")}` : ""}`,
293
+ path: []
294
+ });
295
+ return;
296
+ }
297
+ const [name] = given;
298
+ const value = name === void 0 ? void 0 : values[name];
299
+ if (name === void 0 || value === void 0) {
300
+ return;
301
+ }
302
+ const problem = wrongKind(name, value);
303
+ if (problem !== null) {
304
+ context.addIssue({ code: "custom", message: problem, path: [name] });
305
+ }
306
+ };
307
+ var personOf = (values) => values.lead_ref ?? values.email ?? values.linkedin_url ?? values.person ?? "";
234
308
 
235
309
  export {
236
- SCREENED_AT_MOST,
237
- warmupAtZero,
238
- listProblemsOf,
239
310
  UNTRUSTED_NOTE,
240
311
  DEFAULT_BODY_CHARS,
241
312
  day,
@@ -251,10 +322,19 @@ export {
251
322
  namesCampaign,
252
323
  routedByCampaign,
253
324
  withCampaign,
325
+ SCREENED_AT_MOST,
326
+ brokenStatus,
327
+ warmupAtZero,
328
+ listProblemsOf,
254
329
  inputProblem,
255
330
  paceWindow,
256
331
  newLeadsPerDay,
257
332
  splitActive,
258
333
  leadsToStart,
259
- runwayDays
334
+ runwayOf,
335
+ RUNWAY_MAX_LEADS,
336
+ runwayStatus,
337
+ personFields,
338
+ checkPerson,
339
+ personOf
260
340
  };