outbound-sdk 0.2.0 → 0.4.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 (140) hide show
  1. package/dist/alerts/index.js +50 -19
  2. package/dist/alerts/plugin.d.ts +20 -3
  3. package/dist/audit/index.js +2 -2
  4. package/dist/benchmarks/index.js +5 -5
  5. package/dist/budget/index.d.ts +3 -2
  6. package/dist/budget/index.js +11 -10
  7. package/dist/cards/content.d.ts +6 -1
  8. package/dist/cards/format.d.ts +17 -2
  9. package/dist/cards/index.d.ts +1 -1
  10. package/dist/cards/index.js +297 -132
  11. package/dist/cards/parts.d.ts +9 -2
  12. package/dist/cards/render.d.ts +20 -3
  13. package/dist/chunks/{chunk-U2D34ARZ.js → chunk-2D42TQFU.js} +3 -3
  14. package/dist/chunks/chunk-4PA526S7.js +17 -0
  15. package/dist/chunks/{chunk-6CVZOUHB.js → chunk-5CFO3CXG.js} +24 -0
  16. package/dist/chunks/{chunk-XNFESPZH.js → chunk-5FVKRIEJ.js} +168 -31
  17. package/dist/chunks/{chunk-PMSSUWD7.js → chunk-7LNJJ2RO.js} +217 -58
  18. package/dist/chunks/{chunk-XC6CZP73.js → chunk-7ZDS6SZD.js} +7 -1
  19. package/dist/chunks/{chunk-SBIZDCRY.js → chunk-A6WVOCA4.js} +4 -4
  20. package/dist/chunks/{chunk-VQSCHOBV.js → chunk-BLCJHP5H.js} +11 -4
  21. package/dist/chunks/{chunk-4PSO6JEK.js → chunk-BOWXGMN3.js} +6 -21
  22. package/dist/chunks/{chunk-DJ2IUQEU.js → chunk-C4LS2HNV.js} +3 -3
  23. package/dist/chunks/{chunk-AFU5E5QB.js → chunk-E6DSDCPI.js} +98 -69
  24. package/dist/chunks/{chunk-IPUYZD4O.js → chunk-GFDNRWR3.js} +1 -1
  25. package/dist/chunks/{chunk-PURHK3JU.js → chunk-IZFTTMJP.js} +4 -4
  26. package/dist/chunks/{chunk-E7JHLNLG.js → chunk-J7DDZ4C2.js} +15 -2
  27. package/dist/chunks/{chunk-FKH5N47I.js → chunk-K4USHN4C.js} +1 -1
  28. package/dist/chunks/chunk-LVQUSKEX.js +17 -0
  29. package/dist/chunks/{chunk-YOTW5ESM.js → chunk-PQSTQKRD.js} +2 -2
  30. package/dist/chunks/chunk-PTZO4QXR.js +15 -0
  31. package/dist/chunks/{chunk-LVYG7XZJ.js → chunk-QAKJ76HB.js} +1 -1
  32. package/dist/chunks/chunk-QGRZDTX4.js +26 -0
  33. package/dist/chunks/{chunk-R3Y56YVF.js → chunk-Y5RAJ6PZ.js} +2 -2
  34. package/dist/chunks/{chunk-RCZ7ZZFU.js → chunk-ZFVHM5JI.js} +3 -3
  35. package/dist/chunks/{chunk-UAT3JSJZ.js → chunk-ZOAG2C6V.js} +2 -2
  36. package/dist/cli/bin.js +17 -13
  37. package/dist/cli/commands.d.ts +11 -0
  38. package/dist/cli/index.js +17 -13
  39. package/dist/cli/mcp.d.ts +5 -0
  40. package/dist/cli/version.d.ts +2 -0
  41. package/dist/clients/index.d.ts +1 -1
  42. package/dist/clients/index.js +35 -10
  43. package/dist/clients/plugin.d.ts +9 -2
  44. package/dist/combine/index.js +7 -6
  45. package/dist/exporter/index.d.ts +5 -2
  46. package/dist/exporter/index.js +2 -2
  47. package/dist/failover/index.js +3 -3
  48. package/dist/fixtures/index.js +5 -4
  49. package/dist/heyreach/client.d.ts +2 -0
  50. package/dist/heyreach/index.js +71 -39
  51. package/dist/heyreach/map.d.ts +5 -2
  52. package/dist/identity/index.js +33 -17
  53. package/dist/identity/plugin.d.ts +2 -0
  54. package/dist/index.d.ts +2 -2
  55. package/dist/index.js +13 -10
  56. package/dist/insights/campaign.d.ts +3 -0
  57. package/dist/insights/capped.d.ts +29 -0
  58. package/dist/insights/copy/copy-audit.d.ts +2 -0
  59. package/dist/insights/copy/copy-reuse.d.ts +27 -3
  60. package/dist/insights/copy/index.d.ts +8 -8
  61. package/dist/insights/copy/reply-timing.d.ts +8 -0
  62. package/dist/insights/copy/reuse-base.d.ts +32 -0
  63. package/dist/insights/copy/shared.d.ts +39 -15
  64. package/dist/insights/copy/step-funnel.d.ts +16 -5
  65. package/dist/insights/copy/variant-test.d.ts +19 -8
  66. package/dist/insights/define.d.ts +56 -2
  67. package/dist/insights/fields.d.ts +16 -0
  68. package/dist/insights/index.d.ts +2 -1
  69. package/dist/insights/index.js +1494 -730
  70. package/dist/insights/inputs.generated.d.ts +951 -0
  71. package/dist/insights/ops/campaign-diagnosis.d.ts +3 -1
  72. package/dist/insights/ops/campaign-ranking.d.ts +12 -4
  73. package/dist/insights/ops/channel-mix.d.ts +2 -1
  74. package/dist/insights/ops/client-report.d.ts +18 -5
  75. package/dist/insights/ops/index.d.ts +6 -2
  76. package/dist/insights/ops/period-comparison.d.ts +14 -3
  77. package/dist/insights/ops/pipeline-forecast.d.ts +14 -4
  78. package/dist/insights/ops/shared.d.ts +29 -24
  79. package/dist/insights/ops/tag-rollup.d.ts +2 -1
  80. package/dist/insights/people/account-summary.d.ts +13 -0
  81. package/dist/insights/people/dropped-replies.d.ts +8 -0
  82. package/dist/insights/people/find.d.ts +7 -1
  83. package/dist/insights/people/hot-leads.d.ts +16 -1
  84. package/dist/insights/people/person-summary.d.ts +6 -0
  85. package/dist/insights/people/read.d.ts +26 -10
  86. package/dist/insights/people/suppression-check.d.ts +11 -2
  87. package/dist/insights/plugin.d.ts +7 -5
  88. package/dist/insights/ref.d.ts +6 -0
  89. package/dist/insights/registry.d.ts +28 -16
  90. package/dist/insights/senders/bounce-watch.d.ts +25 -8
  91. package/dist/insights/senders/capacity-sends.d.ts +22 -0
  92. package/dist/insights/senders/domain-health.d.ts +10 -4
  93. package/dist/insights/senders/index.d.ts +14 -6
  94. package/dist/insights/senders/read.d.ts +15 -14
  95. package/dist/insights/senders/sender-capacity.d.ts +5 -13
  96. package/dist/insights/senders/sender-load.d.ts +2 -0
  97. package/dist/insights/stats.d.ts +8 -0
  98. package/dist/insights/tools.d.ts +3 -2
  99. package/dist/instantly/client.d.ts +2 -0
  100. package/dist/instantly/index.js +44 -29
  101. package/dist/instantly/map.d.ts +6 -2
  102. package/dist/internal/engine/request.d.ts +5 -0
  103. package/dist/internal/entities.d.ts +3 -20
  104. package/dist/internal/errors.d.ts +44 -0
  105. package/dist/internal/fields.d.ts +1 -1
  106. package/dist/internal/json.d.ts +9 -2
  107. package/dist/internal/lists.d.ts +24 -0
  108. package/dist/internal/numbers.d.ts +8 -0
  109. package/dist/internal/outbound/collections.d.ts +4 -0
  110. package/dist/internal/outbound/create.d.ts +24 -3
  111. package/dist/internal/outbound/outbound.d.ts +13 -1
  112. package/dist/internal/outbound/validate.d.ts +4 -0
  113. package/dist/internal/outbound/walker.d.ts +3 -2
  114. package/dist/internal/plural.d.ts +12 -0
  115. package/dist/internal/renamed.d.ts +28 -0
  116. package/dist/internal/vocabulary.d.ts +20 -0
  117. package/dist/loader/index.js +5 -5
  118. package/dist/memory/adapter.d.ts +7 -0
  119. package/dist/memory/demo-stats.d.ts +3 -0
  120. package/dist/memory/demo.d.ts +14 -3
  121. package/dist/memory/index.d.ts +1 -0
  122. package/dist/memory/index.js +200 -95
  123. package/dist/providers/index.d.ts +72 -0
  124. package/dist/providers/index.js +3 -1
  125. package/dist/reconcile/index.js +5 -4
  126. package/dist/redact/index.js +10 -4
  127. package/dist/redact/plugin.d.ts +7 -0
  128. package/dist/smartlead/index.js +102 -49
  129. package/dist/smartlead/shared.d.ts +13 -0
  130. package/dist/sync/index.js +2 -2
  131. package/dist/tools/ai-sdk.js +8 -6
  132. package/dist/tools/campaign-tools.d.ts +1 -1
  133. package/dist/tools/claude-agent.js +8 -6
  134. package/dist/tools/index.js +9 -7
  135. package/dist/tools/input-problem.d.ts +8 -0
  136. package/dist/tools/registry.d.ts +7 -2
  137. package/dist/tools/shared.d.ts +7 -0
  138. package/dist/tracing/index.js +2 -2
  139. package/dist/webhooks/index.js +10 -9
  140. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  emptyCounts,
3
3
  sumCounts
4
- } from "../chunks/chunk-YOTW5ESM.js";
4
+ } from "../chunks/chunk-PQSTQKRD.js";
5
5
  import {
6
6
  profileSlug
7
7
  } from "../chunks/chunk-NAWZ73QS.js";
@@ -12,22 +12,24 @@ import {
12
12
  recordBase,
13
13
  refTo,
14
14
  refsTo
15
- } from "../chunks/chunk-U2D34ARZ.js";
15
+ } from "../chunks/chunk-2D42TQFU.js";
16
16
  import {
17
- SCHEMA_VERSION,
18
17
  leadProgressSchema
19
- } from "../chunks/chunk-4PSO6JEK.js";
18
+ } from "../chunks/chunk-BOWXGMN3.js";
19
+ import {
20
+ SCHEMA_VERSION
21
+ } from "../chunks/chunk-QGRZDTX4.js";
20
22
  import {
21
23
  assertWorkspaceId,
22
24
  makeRef
23
- } from "../chunks/chunk-LVYG7XZJ.js";
25
+ } from "../chunks/chunk-QAKJ76HB.js";
24
26
  import {
25
27
  OutboundError,
26
28
  makeErrorMapper
27
- } from "../chunks/chunk-E7JHLNLG.js";
29
+ } from "../chunks/chunk-J7DDZ4C2.js";
28
30
  import {
29
31
  isNumber
30
- } from "../chunks/chunk-VQSCHOBV.js";
32
+ } from "../chunks/chunk-BLCJHP5H.js";
31
33
 
32
34
  // src/memory/account.ts
33
35
  var base = (identity, sourceId) => recordBase(identity, sourceId, null);
@@ -127,13 +129,13 @@ var toCampaign = (identity, seed) => ({
127
129
  status: seed.status ?? "active",
128
130
  tags: [...seed.tags ?? []]
129
131
  });
130
- var toSteps = (steps, channel) => steps.map((step, index) => ({
131
- action: step.action ?? (channel === "linkedin" ? "message" : "email"),
132
- branch: step.branch ?? null,
133
- delayDays: step.delayDays ?? null,
132
+ var toSteps = (steps, channel) => steps.map((step2, index) => ({
133
+ action: step2.action ?? (channel === "linkedin" ? "message" : "email"),
134
+ branch: step2.branch ?? null,
135
+ delayDays: step2.delayDays ?? null,
134
136
  index,
135
- parentIndex: step.parentIndex ?? (index === 0 ? null : index - 1),
136
- variants: step.variants.map((variant, variantIndex) => ({
137
+ parentIndex: step2.parentIndex ?? (index === 0 ? null : index - 1),
138
+ variants: step2.variants.map((variant, variantIndex) => ({
137
139
  body: variant.body ?? null,
138
140
  contentHash: stableId(variant.subject, variant.body),
139
141
  subject: variant.subject ?? null,
@@ -590,6 +592,7 @@ var memory = (options = {}) => {
590
592
  ...accountReads(store),
591
593
  capabilities,
592
594
  costs: {},
595
+ fields: options.fields,
593
596
  // Nothing is rate limited in memory; the numbers only keep the engine's math defined.
594
597
  limits: {
595
598
  source: "in-memory adapter, not a vendor limit",
@@ -609,10 +612,139 @@ var memory = (options = {}) => {
609
612
  };
610
613
  };
611
614
 
615
+ // src/memory/demo-stats.ts
616
+ var FOUNDERS = [
617
+ [15, 1, 15, 0, 14, 1, 1, 26, 1],
618
+ [14, 1, 16, 1, 15, 0, 1, 24, 0],
619
+ [16, 2, 14, 0, 15, 1, 2, 27, 1],
620
+ // The bounce spike.
621
+ [15, 1, 15, 0, 16, 0, 1, 22, 9],
622
+ [15, 0, 15, 1, 14, 1, 1, 25, 0],
623
+ [16, 1, 14, 0, 15, 0, 1, 26, 1],
624
+ [14, 1, 16, 0, 15, 1, 1, 23, 0],
625
+ // The week before: the same sends, and fewer replies (8 of 314, against
626
+ // 13 of 314 in the week above), so a weekly comparison has a change to show.
627
+ [15, 1, 15, 1, 14, 0, 2, 25, 1],
628
+ [16, 0, 15, 0, 15, 1, 0, 24, 0],
629
+ [15, 0, 14, 0, 16, 1, 1, 26, 1],
630
+ [14, 1, 15, 0, 15, 0, 1, 23, 0],
631
+ [15, 1, 16, 0, 14, 0, 1, 25, 1],
632
+ [16, 0, 15, 0, 15, 0, 0, 24, 0],
633
+ [15, 1, 14, 1, 15, 0, 1, 26, 1],
634
+ [14, 2, 15, 0, 16, 0, 1, 23, 0],
635
+ [15, 1, 16, 0, 15, 1, 1, 25, 1],
636
+ [16, 0, 14, 1, 14, 0, 0, 24, 0],
637
+ [15, 1, 15, 0, 15, 1, 1, 26, 1],
638
+ [14, 1, 16, 0, 16, 0, 1, 23, 0],
639
+ [15, 1, 15, 0, 15, 1, 1, 25, 1],
640
+ [16, 0, 14, 1, 14, 0, 0, 24, 0]
641
+ ];
642
+ var AGENCIES = [
643
+ [30, 1, 20, 0, 0, 18, 3],
644
+ [31, 0, 19, 0, 0, 17, 2],
645
+ [29, 0, 21, 1, 0, 19, 3],
646
+ [30, 1, 20, 0, 1, 18, 3],
647
+ [31, 0, 19, 1, 0, 17, 2],
648
+ [29, 1, 21, 0, 0, 19, 3],
649
+ [30, 0, 20, 1, 1, 18, 2],
650
+ // The week before: 3 replies from 350 sends, against 6 in the week above.
651
+ [30, 1, 20, 0, 0, 17, 3],
652
+ [31, 0, 19, 1, 0, 19, 2],
653
+ [29, 0, 21, 0, 0, 18, 3],
654
+ [30, 0, 20, 0, 0, 17, 2],
655
+ [31, 0, 19, 0, 0, 19, 3],
656
+ [29, 0, 21, 1, 1, 18, 2],
657
+ [30, 0, 20, 0, 0, 17, 3],
658
+ [31, 0, 19, 0, 0, 19, 2],
659
+ [29, 1, 21, 0, 0, 18, 3],
660
+ [30, 0, 20, 0, 0, 17, 2],
661
+ [30, 0, 20, 0, 0, 19, 3],
662
+ [31, 2, 19, 1, 1, 18, 2],
663
+ [29, 0, 21, 0, 0, 17, 3],
664
+ [30, 1, 20, 1, 0, 19, 2]
665
+ ];
666
+ var sumOf = (values) => values.reduce((sum, value) => sum + value, 0);
667
+ var rowsOf = (campaignId, date, steps, { bounced, opened, positive }) => {
668
+ const sent = sumOf(steps.map((step2) => step2.sent));
669
+ return [
670
+ {
671
+ campaignId,
672
+ counts: {
673
+ bounced,
674
+ // Step 0 is the first touch, so its sends are the leads contacted.
675
+ contacted: sumOf(
676
+ steps.flatMap((step2) => step2.stepIndex === 0 ? [step2.sent] : [])
677
+ ),
678
+ delivered: sent - bounced,
679
+ opened,
680
+ positive,
681
+ replied: sumOf(steps.map((step2) => step2.replied)),
682
+ sent
683
+ },
684
+ date
685
+ },
686
+ ...steps.map(({ replied, sent: stepSent, stepIndex, variantKey }) => ({
687
+ campaignId,
688
+ counts: { replied, sent: stepSent },
689
+ date,
690
+ stepIndex,
691
+ variantKey
692
+ }))
693
+ ];
694
+ };
695
+ var step = (stepIndex, variantKey, sent, replied) => ({ replied, sent, stepIndex, variantKey });
696
+ var demoStats = (day) => [
697
+ ...FOUNDERS.flatMap(
698
+ ([
699
+ a,
700
+ aReplied,
701
+ b,
702
+ bReplied,
703
+ follow,
704
+ followReplied,
705
+ positive,
706
+ opened,
707
+ bounced
708
+ ], index) => rowsOf(
709
+ "cmp_founders",
710
+ day(index + 1),
711
+ [
712
+ step(0, "A", a, aReplied),
713
+ step(0, "B", b, bReplied),
714
+ step(1, "A", follow, followReplied)
715
+ ],
716
+ { bounced, opened, positive }
717
+ )
718
+ ),
719
+ ...AGENCIES.flatMap(
720
+ ([first, firstReplied, follow, followReplied, positive, opened, bounced], index) => rowsOf(
721
+ "cmp_agencies",
722
+ day(index + 1),
723
+ [
724
+ step(0, "A", first, firstReplied),
725
+ step(1, "A", follow, followReplied)
726
+ ],
727
+ { bounced, opened, positive }
728
+ )
729
+ )
730
+ ];
731
+
612
732
  // src/memory/demo.ts
613
- var campaigns = [
733
+ var DAY = 864e5;
734
+ var clockAt = (now) => {
735
+ const today = Math.floor(now / DAY) * DAY;
736
+ const day = (days) => new Date(today - days * DAY).toISOString().slice(0, 10);
737
+ return {
738
+ at: (days, time) => `${day(days)}T${time}:00.000Z`,
739
+ day
740
+ };
741
+ };
742
+ var campaigns = ({
743
+ at,
744
+ day
745
+ }) => [
614
746
  {
615
- createdAt: "2026-10-01T09:00:00.000Z",
747
+ createdAt: at(23, "09:00"),
616
748
  id: "cmp_founders",
617
749
  name: "Q4 SaaS founders",
618
750
  settings: {
@@ -628,7 +760,7 @@ var campaigns = [
628
760
  to: "17:00"
629
761
  }
630
762
  ],
631
- startDate: "2026-10-05",
763
+ startDate: day(21),
632
764
  stopOnAutoReply: false,
633
765
  stopOnReply: true,
634
766
  trackClicks: false,
@@ -652,14 +784,14 @@ var campaigns = [
652
784
  {
653
785
  delayDays: 3,
654
786
  variants: [
655
- { body: "Following up on my note.", subject: "Re: Quick question" }
787
+ { body: "Following up on my note.", subject: "Following up" }
656
788
  ]
657
789
  }
658
790
  ],
659
791
  tags: ["client-a"]
660
792
  },
661
793
  {
662
- createdAt: "2026-09-12T09:00:00.000Z",
794
+ createdAt: at(30, "09:00"),
663
795
  id: "cmp_agencies",
664
796
  name: "Agency owners",
665
797
  status: "paused",
@@ -669,20 +801,27 @@ var campaigns = [
669
801
  variants: [
670
802
  { body: "Hello {{firstName}}.", subject: "Idea for {{company}}" }
671
803
  ]
804
+ },
805
+ // The same follow-up as "Q4 SaaS founders", so copy_reuse has copy to compare.
806
+ {
807
+ delayDays: 4,
808
+ variants: [
809
+ { body: "Following up on my note.", subject: "Following up" }
810
+ ]
672
811
  }
673
812
  ],
674
813
  tags: ["client-b"]
675
814
  }
676
815
  ];
677
- var leads = [
816
+ var leads = ({ at }) => [
678
817
  {
679
818
  campaignId: "cmp_founders",
680
819
  company: "Example Co",
681
- createdAt: "2026-10-02T10:00:00.000Z",
820
+ createdAt: at(15, "10:00"),
682
821
  email: "person1@example.com",
683
822
  engagement: {
684
- lastContactedAt: "2026-10-05T14:00:00.000Z",
685
- lastRepliedAt: "2026-10-06T09:30:00.000Z",
823
+ lastContactedAt: at(3, "14:00"),
824
+ lastRepliedAt: at(2, "09:30"),
686
825
  opens: 2,
687
826
  replies: 1,
688
827
  stepIndex: 0
@@ -698,7 +837,7 @@ var leads = [
698
837
  {
699
838
  campaignId: "cmp_founders",
700
839
  company: "Sample Ltd",
701
- createdAt: "2026-10-03T10:00:00.000Z",
840
+ createdAt: at(14, "10:00"),
702
841
  email: "person2@example.com",
703
842
  firstName: "Sam",
704
843
  id: "lead_2",
@@ -710,7 +849,7 @@ var leads = [
710
849
  {
711
850
  campaignId: "cmp_agencies",
712
851
  company: "Demo Agency",
713
- createdAt: "2026-09-13T10:00:00.000Z",
852
+ createdAt: at(25, "10:00"),
714
853
  email: "person3@example.com",
715
854
  firstName: "Dana",
716
855
  id: "lead_3",
@@ -719,7 +858,7 @@ var leads = [
719
858
  title: "Owner"
720
859
  }
721
860
  ];
722
- var messages = [
861
+ var messages = ({ at }) => [
723
862
  {
724
863
  body: "Hi Alex, saw your launch.",
725
864
  campaignId: "cmp_founders",
@@ -727,7 +866,7 @@ var messages = [
727
866
  id: "msg_1",
728
867
  leadId: "lead_1",
729
868
  senderId: "mbx_1",
730
- sentAt: "2026-10-05T14:00:00.000Z",
869
+ sentAt: at(3, "14:00"),
731
870
  stepIndex: 0,
732
871
  subject: "Quick question",
733
872
  threadId: "thr_1",
@@ -742,7 +881,7 @@ var messages = [
742
881
  isAuto: false,
743
882
  leadId: "lead_1",
744
883
  senderId: "mbx_1",
745
- sentAt: "2026-10-06T09:30:00.000Z",
884
+ sentAt: at(2, "09:30"),
746
885
  subject: "Re: Quick question",
747
886
  threadId: "thr_1"
748
887
  },
@@ -753,19 +892,19 @@ var messages = [
753
892
  id: "msg_3",
754
893
  leadId: "lead_2",
755
894
  senderId: "mbx_2",
756
- sentAt: "2026-10-05T14:05:00.000Z",
895
+ sentAt: at(3, "14:05"),
757
896
  stepIndex: 0,
758
897
  subject: "Congrats",
759
898
  variantKey: "B"
760
899
  }
761
900
  ];
762
- var senders = [
901
+ var senders = ({ at }) => [
763
902
  {
764
903
  address: "outreach1@example.com",
765
904
  campaignIds: ["cmp_founders"],
766
905
  dailyLimit: 40,
767
906
  health: {
768
- checkedAt: "2026-10-06T00:00:00.000Z",
907
+ checkedAt: at(2, "00:00"),
769
908
  connected: true,
770
909
  dkim: true,
771
910
  dmarc: true,
@@ -782,7 +921,7 @@ var senders = [
782
921
  campaignIds: ["cmp_founders", "cmp_agencies"],
783
922
  dailyLimit: 40,
784
923
  health: {
785
- checkedAt: "2026-10-06T00:00:00.000Z",
924
+ checkedAt: at(2, "00:00"),
786
925
  connected: true,
787
926
  dkim: false,
788
927
  dmarc: true,
@@ -796,71 +935,37 @@ var senders = [
796
935
  warmup: { enabled: true, score: 88 }
797
936
  }
798
937
  ];
799
- var stats = [
800
- {
801
- campaignId: "cmp_founders",
802
- counts: {
803
- bounced: 1,
804
- contacted: 50,
805
- delivered: 49,
806
- opened: 30,
807
- positive: 2,
808
- replied: 4,
809
- sent: 50
810
- },
811
- date: "2026-10-05"
812
- },
813
- {
814
- campaignId: "cmp_founders",
815
- counts: {
816
- bounced: 0,
817
- contacted: 40,
818
- delivered: 40,
819
- opened: 22,
820
- positive: 1,
821
- replied: 3,
822
- sent: 40
823
- },
824
- date: "2026-10-06"
825
- },
826
- {
827
- campaignId: "cmp_agencies",
828
- counts: {
829
- bounced: 4,
830
- contacted: 60,
831
- delivered: 56,
832
- opened: 18,
833
- positive: 0,
834
- replied: 1,
835
- sent: 60
836
- },
837
- date: "2026-10-05"
938
+ var demoData = (options = {}) => {
939
+ const now = options.now === void 0 ? Date.now() : new Date(options.now).getTime();
940
+ if (Number.isNaN(now)) {
941
+ throw new TypeError(`demoData: now is not a date: ${String(options.now)}`);
838
942
  }
839
- ];
840
- var demoData = () => ({
841
- blocklist: [{ id: "blk_1", value: "competitor.example" }],
842
- campaigns,
843
- lists: [
844
- {
845
- createdAt: "2026-09-30T09:00:00.000Z",
846
- id: "lst_founders",
847
- name: "SaaS founders"
848
- }
849
- ],
850
- tags: [{ description: "Work for client A", id: "tag_a", name: "client-a" }],
851
- webhooks: [
852
- {
853
- events: ["reply_received"],
854
- id: "wh_1",
855
- name: "Replies",
856
- url: "https://hooks.example.com/replies"
857
- }
858
- ],
859
- leads,
860
- messages,
861
- senders,
862
- stats
863
- });
943
+ const clock = clockAt(now);
944
+ return {
945
+ blocklist: [{ id: "blk_1", value: "competitor.example" }],
946
+ campaigns: campaigns(clock),
947
+ leads: leads(clock),
948
+ lists: [
949
+ {
950
+ createdAt: clock.at(24, "09:00"),
951
+ id: "lst_founders",
952
+ name: "SaaS founders"
953
+ }
954
+ ],
955
+ messages: messages(clock),
956
+ senders: senders(clock),
957
+ stats: demoStats(clock.day),
958
+ tags: [{ description: "Work for client A", id: "tag_a", name: "client-a" }],
959
+ webhooks: [
960
+ {
961
+ events: ["reply_received"],
962
+ id: "wh_1",
963
+ name: "Replies",
964
+ url: "https://hooks.example.com/replies"
965
+ }
966
+ ]
967
+ };
968
+ };
864
969
  export {
865
970
  demoData,
866
971
  memory
@@ -16,7 +16,79 @@ export interface ProviderInfo {
16
16
  /** The vendor's API documentation. */
17
17
  readonly docsUrl: string | null;
18
18
  }
19
+ declare const CATALOG: readonly [{
20
+ readonly channels: readonly ["email"];
21
+ readonly docsUrl: "https://developer.instantly.ai/";
22
+ readonly envVars: readonly [{
23
+ readonly description: "API V2 key. The all:read scope is enough.";
24
+ readonly name: "INSTANTLY_API_KEY";
25
+ readonly required: true;
26
+ }, {
27
+ readonly description: "A label for this client or workspace.";
28
+ readonly name: "INSTANTLY_WORKSPACE_ID";
29
+ readonly required: false;
30
+ }];
31
+ readonly id: "instantly";
32
+ readonly maturity: "beta";
33
+ readonly name: "Instantly";
34
+ readonly note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation.";
35
+ }, {
36
+ readonly channels: readonly ["email"];
37
+ readonly docsUrl: "https://api.smartlead.ai";
38
+ readonly envVars: readonly [{
39
+ readonly description: "API key. It is sent as a query parameter.";
40
+ readonly name: "SMARTLEAD_API_KEY";
41
+ readonly required: true;
42
+ }, {
43
+ readonly description: "A label for this client or workspace.";
44
+ readonly name: "SMARTLEAD_WORKSPACE_ID";
45
+ readonly required: false;
46
+ }];
47
+ readonly id: "smartlead";
48
+ readonly maturity: "unverified";
49
+ readonly name: "Smartlead";
50
+ readonly note: "Never run against a live account. Written from the public documentation and tested offline only.";
51
+ }, {
52
+ readonly channels: readonly ["linkedin"];
53
+ readonly docsUrl: "https://docs.heyreach.io/hey-reach-api.md";
54
+ readonly envVars: readonly [{
55
+ readonly description: "A workspace API key.";
56
+ readonly name: "HEYREACH_API_KEY";
57
+ readonly required: true;
58
+ }, {
59
+ readonly description: "A label for this client or workspace.";
60
+ readonly name: "HEYREACH_WORKSPACE_ID";
61
+ readonly required: false;
62
+ }];
63
+ readonly id: "heyreach";
64
+ readonly maturity: "beta";
65
+ readonly name: "HeyReach";
66
+ readonly note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation.";
67
+ }, {
68
+ readonly channels: readonly ["email", "linkedin"];
69
+ readonly docsUrl: null;
70
+ readonly envVars: readonly [];
71
+ readonly id: "memory";
72
+ readonly maturity: "stable";
73
+ readonly name: "In-memory (tests and demos)";
74
+ readonly note: "Holds data in memory. For tests and demos; there is no vendor behind it.";
75
+ }];
76
+ /** The id of a provider in the catalog: `instantly`, `smartlead`, `heyreach` or `memory`. */
77
+ export type ProviderId = (typeof CATALOG)[number]["id"];
19
78
  export declare const providers: readonly ProviderInfo[];
79
+ /**
80
+ * Whether a value is a provider id from the catalog, for checking a name that
81
+ * arrives as a string from a flag or an environment variable. A provider
82
+ * added to the catalog is accepted without a change here.
83
+ *
84
+ * ```ts
85
+ * if (value === ALL_PROVIDERS || isProviderId(value)) {
86
+ * await fromEnv({ provider: value });
87
+ * }
88
+ * ```
89
+ */
90
+ export declare const isProviderId: (value: unknown) => value is ProviderId;
20
91
  export declare const findProvider: (id: string) => ProviderInfo | undefined;
21
92
  /** The variable `outbound-sdk/loader` reads to pick an adapter. */
22
93
  export declare const PROVIDER_ENV = "OUTBOUND_SDK_PROVIDER";
94
+ export {};
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  PROVIDER_ENV,
3
3
  findProvider,
4
+ isProviderId,
4
5
  providers
5
- } from "../chunks/chunk-XC6CZP73.js";
6
+ } from "../chunks/chunk-7ZDS6SZD.js";
6
7
  export {
7
8
  PROVIDER_ENV,
8
9
  findProvider,
10
+ isProviderId,
9
11
  providers
10
12
  };
@@ -41,11 +41,12 @@ var checkEvents = async (outbound, check) => {
41
41
  };
42
42
  };
43
43
  var checkDeletions = async (outbound, check) => {
44
- const { campaignId } = check;
44
+ const { campaignId, deadline, maxRequests, retries, signal, timeout } = check;
45
+ const options = { deadline, maxRequests, retries, signal, timeout };
45
46
  const walks = {
46
- campaigns: () => outbound.campaigns.listAll(check),
47
- leads: () => outbound.leads.listAll({ ...check, campaignId }),
48
- senders: () => outbound.senders.listAll({ ...check, campaignId })
47
+ campaigns: () => outbound.campaigns.listAll(options),
48
+ leads: () => outbound.leads.listAll({ ...options, campaignId }),
49
+ senders: () => outbound.senders.listAll({ ...options, campaignId })
49
50
  };
50
51
  const listed = /* @__PURE__ */ new Set();
51
52
  for await (const record of walks[check.collection]()) {
@@ -7,15 +7,15 @@ import {
7
7
  import {
8
8
  makeRef,
9
9
  parseRef
10
- } from "../chunks/chunk-LVYG7XZJ.js";
10
+ } from "../chunks/chunk-QAKJ76HB.js";
11
11
  import {
12
12
  OutboundError
13
- } from "../chunks/chunk-E7JHLNLG.js";
13
+ } from "../chunks/chunk-J7DDZ4C2.js";
14
14
  import {
15
15
  isJsonArray,
16
16
  isJsonObject,
17
17
  isString
18
- } from "../chunks/chunk-VQSCHOBV.js";
18
+ } from "../chunks/chunk-BLCJHP5H.js";
19
19
 
20
20
  // src/redact/plugin.ts
21
21
  var ALL_FIELDS = [
@@ -179,7 +179,13 @@ var redact = (options = {}) => {
179
179
  data: redactEventData(masks, event.data),
180
180
  raw: null
181
181
  }),
182
- extend: () => ({ redacted: { fields: [...fields].toSorted(), strategy } }),
182
+ extend: () => ({
183
+ redacted: {
184
+ fields: [...fields].toSorted(),
185
+ hash: (value) => masks.replace(value) ?? MASK,
186
+ strategy
187
+ }
188
+ }),
183
189
  name: "redact",
184
190
  wrap: async (operation, next) => {
185
191
  const output = await next(operation);
@@ -16,6 +16,13 @@ export interface RedactExtension {
16
16
  readonly redacted: {
17
17
  readonly fields: readonly RedactField[];
18
18
  readonly strategy: "hash" | "mask";
19
+ /**
20
+ * What this redact writes in place of `value` in a masked field: the
21
+ * stable token under `hash`, so a caller can find a known address among
22
+ * hashed records without the records holding it; `[redacted]` under
23
+ * `mask`.
24
+ */
25
+ readonly hash: (value: string) => string;
19
26
  };
20
27
  }
21
28
  /** Masks emails, names, companies, LinkedIn URLs, custom fields and message text. */