outbound-sdk 0.0.0-stage → 0.2.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 (284) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -2
  3. package/dist/alerts/index.d.ts +2 -0
  4. package/dist/alerts/index.js +140 -0
  5. package/dist/alerts/plugin.d.ts +58 -0
  6. package/dist/audit/index.d.ts +33 -0
  7. package/dist/audit/index.js +60 -0
  8. package/dist/benchmarks/index.d.ts +29 -0
  9. package/dist/benchmarks/index.js +72 -0
  10. package/dist/budget/index.d.ts +21 -0
  11. package/dist/budget/index.js +71 -0
  12. package/dist/cache/index.d.ts +31 -0
  13. package/dist/cache/index.js +11 -0
  14. package/dist/cards/content.d.ts +43 -0
  15. package/dist/cards/copy-cards.d.ts +2 -0
  16. package/dist/cards/format.d.ts +39 -0
  17. package/dist/cards/index.d.ts +9 -0
  18. package/dist/cards/index.js +2070 -0
  19. package/dist/cards/notify-cards.d.ts +14 -0
  20. package/dist/cards/ops-cards.d.ts +2 -0
  21. package/dist/cards/parts.d.ts +22 -0
  22. package/dist/cards/people-cards.d.ts +2 -0
  23. package/dist/cards/render.d.ts +28 -0
  24. package/dist/cards/sender-cards.d.ts +2 -0
  25. package/dist/cards/slack-rich.d.ts +19 -0
  26. package/dist/cards/slack-text.d.ts +10 -0
  27. package/dist/cards/slack.d.ts +21 -0
  28. package/dist/cards/spec.d.ts +86 -0
  29. package/dist/cards/tool-cards.d.ts +4 -0
  30. package/dist/chunks/chunk-4O2HRTTI.js +75 -0
  31. package/dist/chunks/chunk-4PSO6JEK.js +357 -0
  32. package/dist/chunks/chunk-6CVZOUHB.js +152 -0
  33. package/dist/chunks/chunk-AFU5E5QB.js +714 -0
  34. package/dist/chunks/chunk-DJ2IUQEU.js +111 -0
  35. package/dist/chunks/chunk-E7JHLNLG.js +187 -0
  36. package/dist/chunks/chunk-FHKSLCVW.js +154 -0
  37. package/dist/chunks/chunk-FKH5N47I.js +40 -0
  38. package/dist/chunks/chunk-HZCTYL22.js +29 -0
  39. package/dist/chunks/chunk-IPUYZD4O.js +25 -0
  40. package/dist/chunks/chunk-IVH3NMQZ.js +61 -0
  41. package/dist/chunks/chunk-LVYG7XZJ.js +45 -0
  42. package/dist/chunks/chunk-NAKXLBA6.js +30 -0
  43. package/dist/chunks/chunk-NAWZ73QS.js +22 -0
  44. package/dist/chunks/chunk-PMSSUWD7.js +636 -0
  45. package/dist/chunks/chunk-PURHK3JU.js +432 -0
  46. package/dist/chunks/chunk-R3Y56YVF.js +43 -0
  47. package/dist/chunks/chunk-RCZ7ZZFU.js +92 -0
  48. package/dist/chunks/chunk-SBIZDCRY.js +106 -0
  49. package/dist/chunks/chunk-U2D34ARZ.js +41 -0
  50. package/dist/chunks/chunk-UAT3JSJZ.js +331 -0
  51. package/dist/chunks/chunk-VQSCHOBV.js +111 -0
  52. package/dist/chunks/chunk-XC6CZP73.js +80 -0
  53. package/dist/chunks/chunk-XNFESPZH.js +2307 -0
  54. package/dist/chunks/chunk-YOTW5ESM.js +118 -0
  55. package/dist/cli/bin.d.ts +2 -0
  56. package/dist/cli/bin.js +35 -0
  57. package/dist/cli/commands.d.ts +19 -0
  58. package/dist/cli/config.d.ts +22 -0
  59. package/dist/cli/index.d.ts +17 -0
  60. package/dist/cli/index.js +30 -0
  61. package/dist/cli/mcp.d.ts +14 -0
  62. package/dist/cli/stdio.d.ts +9 -0
  63. package/dist/clients/index.d.ts +2 -0
  64. package/dist/clients/index.js +117 -0
  65. package/dist/clients/plugin.d.ts +42 -0
  66. package/dist/combine/account.d.ts +4 -0
  67. package/dist/combine/adapter.d.ts +9 -0
  68. package/dist/combine/index.d.ts +2 -0
  69. package/dist/combine/index.js +420 -0
  70. package/dist/combine/route.d.ts +24 -0
  71. package/dist/exporter/index.d.ts +29 -0
  72. package/dist/exporter/index.js +77 -0
  73. package/dist/failover/index.d.ts +11 -0
  74. package/dist/failover/index.js +45 -0
  75. package/dist/fixtures/index.d.ts +27 -0
  76. package/dist/fixtures/index.js +260 -0
  77. package/dist/fixtures/scrub.d.ts +5 -0
  78. package/dist/heyreach/account.d.ts +11 -0
  79. package/dist/heyreach/adapter.d.ts +5 -0
  80. package/dist/heyreach/capabilities.d.ts +70 -0
  81. package/dist/heyreach/client.d.ts +18 -0
  82. package/dist/heyreach/inbox.d.ts +7 -0
  83. package/dist/heyreach/index.d.ts +25 -0
  84. package/dist/heyreach/index.js +1931 -0
  85. package/dist/heyreach/leads.d.ts +4 -0
  86. package/dist/heyreach/lookup.d.ts +15 -0
  87. package/dist/heyreach/map-account.d.ts +31 -0
  88. package/dist/heyreach/map-sequence.d.ts +5 -0
  89. package/dist/heyreach/map-stats.d.ts +13 -0
  90. package/dist/heyreach/map.d.ts +37 -0
  91. package/dist/heyreach/native-organization.d.ts +128 -0
  92. package/dist/heyreach/native-voice.d.ts +106 -0
  93. package/dist/heyreach/native.d.ts +496 -0
  94. package/dist/heyreach/paging.d.ts +7 -0
  95. package/dist/heyreach/webhooks.d.ts +3 -0
  96. package/dist/identity/index.d.ts +3 -0
  97. package/dist/identity/index.js +159 -0
  98. package/dist/identity/keys.d.ts +9 -0
  99. package/dist/identity/plugin.d.ts +34 -0
  100. package/dist/index.d.ts +33 -0
  101. package/dist/index.js +131 -0
  102. package/dist/insights/copy/copy-audit.d.ts +55 -0
  103. package/dist/insights/copy/copy-checks.d.ts +44 -0
  104. package/dist/insights/copy/copy-reuse.d.ts +59 -0
  105. package/dist/insights/copy/index.d.ts +67 -0
  106. package/dist/insights/copy/reply-timing.d.ts +63 -0
  107. package/dist/insights/copy/shared.d.ts +53 -0
  108. package/dist/insights/copy/step-funnel.d.ts +66 -0
  109. package/dist/insights/copy/variant-test.d.ts +64 -0
  110. package/dist/insights/define.d.ts +98 -0
  111. package/dist/insights/index.d.ts +10 -0
  112. package/dist/insights/index.js +4937 -0
  113. package/dist/insights/ops/anomalies.d.ts +80 -0
  114. package/dist/insights/ops/campaign-diagnosis.d.ts +39 -0
  115. package/dist/insights/ops/campaign-ranking.d.ts +56 -0
  116. package/dist/insights/ops/channel-mix.d.ts +44 -0
  117. package/dist/insights/ops/client-report.d.ts +76 -0
  118. package/dist/insights/ops/diagnosis-checks.d.ts +48 -0
  119. package/dist/insights/ops/index.d.ts +135 -0
  120. package/dist/insights/ops/period-comparison.d.ts +86 -0
  121. package/dist/insights/ops/pipeline-forecast.d.ts +44 -0
  122. package/dist/insights/ops/shared.d.ts +155 -0
  123. package/dist/insights/ops/tag-rollup.d.ts +32 -0
  124. package/dist/insights/people/account-summary.d.ts +68 -0
  125. package/dist/insights/people/dropped-replies.d.ts +51 -0
  126. package/dist/insights/people/find.d.ts +18 -0
  127. package/dist/insights/people/hot-leads.d.ts +67 -0
  128. package/dist/insights/people/index.d.ts +88 -0
  129. package/dist/insights/people/lead-collisions.d.ts +43 -0
  130. package/dist/insights/people/person-summary.d.ts +46 -0
  131. package/dist/insights/people/personalization-gaps.d.ts +60 -0
  132. package/dist/insights/people/read.d.ts +40 -0
  133. package/dist/insights/people/suppression-check.d.ts +53 -0
  134. package/dist/insights/plugin.d.ts +40 -0
  135. package/dist/insights/registry.d.ts +335 -0
  136. package/dist/insights/senders/bounce-watch.d.ts +70 -0
  137. package/dist/insights/senders/domain-health.d.ts +69 -0
  138. package/dist/insights/senders/index.d.ts +74 -0
  139. package/dist/insights/senders/read.d.ts +37 -0
  140. package/dist/insights/senders/sender-capacity.d.ts +67 -0
  141. package/dist/insights/senders/sender-load.d.ts +52 -0
  142. package/dist/insights/senders/settings-audit.d.ts +48 -0
  143. package/dist/insights/senders/warmup-readiness.d.ts +39 -0
  144. package/dist/insights/stats.d.ts +45 -0
  145. package/dist/insights/tools.d.ts +16 -0
  146. package/dist/insights/types.d.ts +4 -0
  147. package/dist/instantly/adapter-account.d.ts +5 -0
  148. package/dist/instantly/adapter-mail.d.ts +3 -0
  149. package/dist/instantly/adapter.d.ts +7 -0
  150. package/dist/instantly/capabilities.d.ts +85 -0
  151. package/dist/instantly/client.d.ts +24 -0
  152. package/dist/instantly/index.d.ts +27 -0
  153. package/dist/instantly/index.js +2627 -0
  154. package/dist/instantly/map-account.d.ts +38 -0
  155. package/dist/instantly/map-lead.d.ts +18 -0
  156. package/dist/instantly/map-stats.d.ts +25 -0
  157. package/dist/instantly/map.d.ts +22 -0
  158. package/dist/instantly/native-agents-sales.d.ts +161 -0
  159. package/dist/instantly/native-agents.d.ts +156 -0
  160. package/dist/instantly/native-campaigns.d.ts +101 -0
  161. package/dist/instantly/native-leads.d.ts +93 -0
  162. package/dist/instantly/native-params.d.ts +7 -0
  163. package/dist/instantly/native-search.d.ts +82 -0
  164. package/dist/instantly/native-senders.d.ts +182 -0
  165. package/dist/instantly/native-supersearch.d.ts +149 -0
  166. package/dist/instantly/native-workspace.d.ts +170 -0
  167. package/dist/instantly/native.d.ts +1081 -0
  168. package/dist/instantly/pages.d.ts +29 -0
  169. package/dist/instantly/stats.d.ts +5 -0
  170. package/dist/instantly/webhooks.d.ts +3 -0
  171. package/dist/internal/adapter.d.ts +211 -0
  172. package/dist/internal/capabilities.d.ts +104 -0
  173. package/dist/internal/client.d.ts +15 -0
  174. package/dist/internal/concurrency.d.ts +8 -0
  175. package/dist/internal/cursor.d.ts +10 -0
  176. package/dist/internal/engine/budget.d.ts +44 -0
  177. package/dist/internal/engine/engine.d.ts +45 -0
  178. package/dist/internal/engine/rate-store.d.ts +25 -0
  179. package/dist/internal/engine/request.d.ts +34 -0
  180. package/dist/internal/engine/retry.d.ts +21 -0
  181. package/dist/internal/engine/runtime.d.ts +13 -0
  182. package/dist/internal/entities-account.d.ts +205 -0
  183. package/dist/internal/entities.d.ts +493 -0
  184. package/dist/internal/env.d.ts +4 -0
  185. package/dist/internal/errors.d.ts +62 -0
  186. package/dist/internal/fields.d.ts +462 -0
  187. package/dist/internal/hooks.d.ts +55 -0
  188. package/dist/internal/json.d.ts +49 -0
  189. package/dist/internal/lead-fields.d.ts +21 -0
  190. package/dist/internal/lead-status.d.ts +13 -0
  191. package/dist/internal/limits.d.ts +34 -0
  192. package/dist/internal/metrics.d.ts +64 -0
  193. package/dist/internal/native.d.ts +81 -0
  194. package/dist/internal/outbound/api.d.ts +292 -0
  195. package/dist/internal/outbound/collections.d.ts +31 -0
  196. package/dist/internal/outbound/core.d.ts +36 -0
  197. package/dist/internal/outbound/create.d.ts +16 -0
  198. package/dist/internal/outbound/handles.d.ts +7 -0
  199. package/dist/internal/outbound/native.d.ts +4 -0
  200. package/dist/internal/outbound/operation-shared.d.ts +28 -0
  201. package/dist/internal/outbound/operations-account.d.ts +41 -0
  202. package/dist/internal/outbound/operations.d.ts +42 -0
  203. package/dist/internal/outbound/outbound.d.ts +67 -0
  204. package/dist/internal/outbound/plugins.d.ts +40 -0
  205. package/dist/internal/outbound/raw.d.ts +9 -0
  206. package/dist/internal/outbound/specs-account.d.ts +20 -0
  207. package/dist/internal/outbound/specs.d.ts +14 -0
  208. package/dist/internal/outbound/stats.d.ts +7 -0
  209. package/dist/internal/outbound/validate.d.ts +5 -0
  210. package/dist/internal/outbound/walker.d.ts +22 -0
  211. package/dist/internal/page.d.ts +14 -0
  212. package/dist/internal/record.d.ts +36 -0
  213. package/dist/internal/records.d.ts +7 -0
  214. package/dist/internal/redact.d.ts +18 -0
  215. package/dist/internal/ref.d.ts +16 -0
  216. package/dist/internal/sequence.d.ts +14 -0
  217. package/dist/internal/sha256.d.ts +6 -0
  218. package/dist/internal/text.d.ts +11 -0
  219. package/dist/internal/url.d.ts +9 -0
  220. package/dist/loader/index.d.ts +24 -0
  221. package/dist/loader/index.js +16 -0
  222. package/dist/memory/account-reads.d.ts +5 -0
  223. package/dist/memory/account.d.ts +81 -0
  224. package/dist/memory/adapter.d.ts +16 -0
  225. package/dist/memory/data.d.ts +137 -0
  226. package/dist/memory/demo.d.ts +7 -0
  227. package/dist/memory/index.d.ts +5 -0
  228. package/dist/memory/index.js +867 -0
  229. package/dist/memory/stats.d.ts +6 -0
  230. package/dist/memory/store.d.ts +18 -0
  231. package/dist/providers/index.d.ts +22 -0
  232. package/dist/providers/index.js +10 -0
  233. package/dist/reconcile/index.d.ts +2 -0
  234. package/dist/reconcile/index.js +72 -0
  235. package/dist/reconcile/plugin.d.ts +55 -0
  236. package/dist/redact/index.d.ts +2 -0
  237. package/dist/redact/index.js +197 -0
  238. package/dist/redact/plugin.d.ts +22 -0
  239. package/dist/redis/index.d.ts +41 -0
  240. package/dist/redis/index.js +114 -0
  241. package/dist/smartlead/account.d.ts +5 -0
  242. package/dist/smartlead/adapter.d.ts +5 -0
  243. package/dist/smartlead/capabilities.d.ts +87 -0
  244. package/dist/smartlead/client.d.ts +18 -0
  245. package/dist/smartlead/hmac.d.ts +7 -0
  246. package/dist/smartlead/index.d.ts +24 -0
  247. package/dist/smartlead/index.js +2329 -0
  248. package/dist/smartlead/leads.d.ts +9 -0
  249. package/dist/smartlead/lookup.d.ts +8 -0
  250. package/dist/smartlead/mail.d.ts +5 -0
  251. package/dist/smartlead/map-account.d.ts +34 -0
  252. package/dist/smartlead/map-messages.d.ts +31 -0
  253. package/dist/smartlead/map-stats.d.ts +36 -0
  254. package/dist/smartlead/map.d.ts +62 -0
  255. package/dist/smartlead/native-analytics.d.ts +242 -0
  256. package/dist/smartlead/native-campaigns.d.ts +211 -0
  257. package/dist/smartlead/native-inbox.d.ts +141 -0
  258. package/dist/smartlead/native-params.d.ts +12 -0
  259. package/dist/smartlead/native-services.d.ts +204 -0
  260. package/dist/smartlead/native.d.ts +785 -0
  261. package/dist/smartlead/shared.d.ts +29 -0
  262. package/dist/smartlead/stats.d.ts +5 -0
  263. package/dist/smartlead/webhooks.d.ts +3 -0
  264. package/dist/sync/index.d.ts +2 -0
  265. package/dist/sync/index.js +158 -0
  266. package/dist/sync/plugin.d.ts +58 -0
  267. package/dist/tools/account-tools.d.ts +21 -0
  268. package/dist/tools/ai-sdk.d.ts +8 -0
  269. package/dist/tools/ai-sdk.js +28 -0
  270. package/dist/tools/campaign-tools.d.ts +59 -0
  271. package/dist/tools/claude-agent.d.ts +18 -0
  272. package/dist/tools/claude-agent.js +42 -0
  273. package/dist/tools/index.d.ts +28 -0
  274. package/dist/tools/index.js +22 -0
  275. package/dist/tools/people-tools.d.ts +19 -0
  276. package/dist/tools/registry.d.ts +34 -0
  277. package/dist/tools/shared.d.ts +75 -0
  278. package/dist/tracing/index.d.ts +25 -0
  279. package/dist/tracing/index.js +69 -0
  280. package/dist/webhooks/index.d.ts +3 -0
  281. package/dist/webhooks/index.js +227 -0
  282. package/dist/webhooks/parse.d.ts +41 -0
  283. package/dist/webhooks/secret.d.ts +4 -0
  284. package/package.json +181 -4
@@ -0,0 +1,867 @@
1
+ import {
2
+ emptyCounts,
3
+ sumCounts
4
+ } from "../chunks/chunk-YOTW5ESM.js";
5
+ import {
6
+ profileSlug
7
+ } from "../chunks/chunk-NAWZ73QS.js";
8
+ import {
9
+ stableId
10
+ } from "../chunks/chunk-FHKSLCVW.js";
11
+ import {
12
+ recordBase,
13
+ refTo,
14
+ refsTo
15
+ } from "../chunks/chunk-U2D34ARZ.js";
16
+ import {
17
+ SCHEMA_VERSION,
18
+ leadProgressSchema
19
+ } from "../chunks/chunk-4PSO6JEK.js";
20
+ import {
21
+ assertWorkspaceId,
22
+ makeRef
23
+ } from "../chunks/chunk-LVYG7XZJ.js";
24
+ import {
25
+ OutboundError,
26
+ makeErrorMapper
27
+ } from "../chunks/chunk-E7JHLNLG.js";
28
+ import {
29
+ isNumber
30
+ } from "../chunks/chunk-VQSCHOBV.js";
31
+
32
+ // src/memory/account.ts
33
+ var base = (identity, sourceId) => recordBase(identity, sourceId, null);
34
+ var toSettings = (identity, campaignId, seed) => ({
35
+ ...base(identity, campaignId),
36
+ campaignRef: makeRef(identity.provider, identity.workspaceId, campaignId),
37
+ dailyLimit: seed.dailyLimit ?? null,
38
+ dailyNewLeads: seed.dailyNewLeads ?? null,
39
+ endDate: seed.endDate ?? null,
40
+ gapMinutes: seed.gapMinutes ?? null,
41
+ plainText: seed.plainText ?? null,
42
+ schedule: (seed.schedule ?? []).map((window) => ({
43
+ days: [...window.days ?? []],
44
+ from: window.from ?? null,
45
+ name: window.name ?? null,
46
+ timezone: window.timezone ?? null,
47
+ to: window.to ?? null
48
+ })),
49
+ startDate: seed.startDate ?? null,
50
+ stopOnAutoReply: seed.stopOnAutoReply ?? null,
51
+ stopOnReply: seed.stopOnReply ?? null,
52
+ tracking: {
53
+ clicks: seed.trackClicks ?? null,
54
+ opens: seed.trackOpens ?? null
55
+ }
56
+ });
57
+ var toHealth = (identity, sender, seed) => ({
58
+ ...base(identity, sender.id),
59
+ blacklisted: seed.blacklisted ?? null,
60
+ checkedAt: seed.checkedAt ?? null,
61
+ connected: seed.connected ?? null,
62
+ dns: {
63
+ dkim: seed.dkim ?? null,
64
+ dmarc: seed.dmarc ?? null,
65
+ mx: seed.mx ?? null,
66
+ spf: seed.spf ?? null
67
+ },
68
+ domain: sender.address?.split("@")[1]?.trim().toLowerCase() ?? null,
69
+ issues: [...seed.issues ?? []],
70
+ senderRef: makeRef(identity.provider, identity.workspaceId, sender.id),
71
+ warmup: seed.warmup === void 0 ? null : {
72
+ inbox: seed.warmup.inbox ?? null,
73
+ received: seed.warmup.received ?? null,
74
+ score: seed.warmup.score ?? null,
75
+ sent: seed.warmup.sent ?? null,
76
+ spam: seed.warmup.spam ?? null
77
+ }
78
+ });
79
+ var toList = (identity, seed, size) => ({
80
+ ...base(identity, seed.id),
81
+ createdAt: seed.createdAt ?? null,
82
+ kind: seed.kind ?? "leads",
83
+ name: seed.name ?? seed.id,
84
+ size
85
+ });
86
+ var toBlockEntry = (identity, seed) => ({
87
+ ...base(identity, seed.id),
88
+ createdAt: seed.createdAt ?? null,
89
+ kind: seed.kind ?? (seed.value.includes("@") ? "email" : "domain"),
90
+ value: seed.value.trim().toLowerCase()
91
+ });
92
+ var toTag = (identity, seed) => ({
93
+ ...base(identity, seed.id),
94
+ description: seed.description ?? null,
95
+ name: seed.name ?? seed.id
96
+ });
97
+ var toWebhook = (identity, seed) => ({
98
+ ...base(identity, seed.id),
99
+ active: seed.active ?? true,
100
+ campaignRefs: refsTo(identity, [seed.campaignId]),
101
+ createdAt: seed.createdAt ?? null,
102
+ eventTypes: [...seed.eventTypes ?? []],
103
+ events: [...seed.events ?? []],
104
+ name: seed.name ?? null,
105
+ url: seed.url
106
+ });
107
+ var toPlacementTest = (identity, seed) => ({
108
+ ...base(identity, seed.id),
109
+ campaignRef: seed.campaignId === void 0 ? null : makeRef(identity.provider, identity.workspaceId, seed.campaignId),
110
+ createdAt: seed.createdAt ?? null,
111
+ endsAt: seed.endsAt ?? null,
112
+ kind: seed.kind ?? null,
113
+ name: seed.name ?? seed.id,
114
+ nextRunAt: seed.nextRunAt ?? null,
115
+ startsAt: seed.startsAt ?? null,
116
+ status: seed.status ?? "active"
117
+ });
118
+
119
+ // src/memory/data.ts
120
+ var base2 = (identity, sourceId) => recordBase(identity, sourceId, null);
121
+ var refOrNull = refTo;
122
+ var toCampaign = (identity, seed) => ({
123
+ ...base2(identity, seed.id),
124
+ channel: seed.channel ?? "email",
125
+ createdAt: seed.createdAt ?? null,
126
+ name: seed.name ?? seed.id,
127
+ status: seed.status ?? "active",
128
+ tags: [...seed.tags ?? []]
129
+ });
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,
134
+ index,
135
+ parentIndex: step.parentIndex ?? (index === 0 ? null : index - 1),
136
+ variants: step.variants.map((variant, variantIndex) => ({
137
+ body: variant.body ?? null,
138
+ contentHash: stableId(variant.subject, variant.body),
139
+ subject: variant.subject ?? null,
140
+ variantKey: variant.key ?? String.fromCodePoint(65 + variantIndex)
141
+ }))
142
+ }));
143
+ var toSequence = (identity, seed) => ({
144
+ ...base2(identity, seed.id),
145
+ campaignRef: makeRef(identity.provider, identity.workspaceId, seed.id),
146
+ kind: "main",
147
+ name: null,
148
+ steps: toSteps(seed.steps ?? [], seed.channel)
149
+ });
150
+ var toSubsequence = (identity, campaign, seed) => ({
151
+ ...base2(identity, seed.id),
152
+ campaignRef: makeRef(identity.provider, identity.workspaceId, campaign.id),
153
+ kind: "subsequence",
154
+ name: seed.name ?? seed.id,
155
+ steps: toSteps(seed.steps, campaign.channel)
156
+ });
157
+ var toSender = (identity, seed) => ({
158
+ ...base2(identity, seed.id),
159
+ address: seed.address?.trim().toLowerCase() ?? null,
160
+ dailyLimit: seed.dailyLimit ?? null,
161
+ kind: seed.linkedinUrl === void 0 ? "mailbox" : "linkedin",
162
+ linkedinUrl: seed.linkedinUrl ?? null,
163
+ mailProvider: seed.mailProvider ?? null,
164
+ name: seed.name ?? null,
165
+ status: seed.status ?? "active",
166
+ tags: [...seed.tags ?? []],
167
+ warmup: seed.warmup === void 0 ? null : { enabled: seed.warmup.enabled, score: seed.warmup.score ?? null }
168
+ });
169
+ var toEngagement = (seed) => ({
170
+ clicks: seed.clicks ?? null,
171
+ lastContactedAt: seed.lastContactedAt ?? null,
172
+ lastOpenedAt: seed.lastOpenedAt ?? null,
173
+ lastRepliedAt: seed.lastRepliedAt ?? null,
174
+ opens: seed.opens ?? null,
175
+ repliedStepIndex: seed.repliedStepIndex ?? null,
176
+ replies: seed.replies ?? null,
177
+ stepIndex: seed.stepIndex ?? null
178
+ });
179
+ var PROGRESS = /* @__PURE__ */ new Set([
180
+ "active",
181
+ "completed",
182
+ "paused"
183
+ ]);
184
+ var standingOf = (seed) => {
185
+ const status = seed.status ?? "active";
186
+ const flagOf = (given, outcome) => given ?? (status === outcome ? true : null);
187
+ return {
188
+ bounced: flagOf(seed.bounced, "bounced"),
189
+ progress: seed.progress ?? leadProgressSchema.parse(PROGRESS.has(status) ? status : "unknown"),
190
+ replied: flagOf(seed.replied, "replied"),
191
+ status,
192
+ unsubscribed: flagOf(seed.unsubscribed, "unsubscribed")
193
+ };
194
+ };
195
+ var toLead = (identity, seed) => ({
196
+ ...base2(identity, seed.id),
197
+ ...standingOf(seed),
198
+ campaignRef: refOrNull(identity, seed.campaignId),
199
+ company: seed.company ?? null,
200
+ companyLinkedinUrl: seed.companyLinkedinUrl ?? null,
201
+ createdAt: seed.createdAt ?? null,
202
+ custom: { ...seed.custom },
203
+ email: seed.email?.trim().toLowerCase() ?? null,
204
+ engagement: seed.engagement === void 0 ? null : toEngagement(seed.engagement),
205
+ firstName: seed.firstName ?? null,
206
+ interest: seed.interest ?? null,
207
+ interestCategory: seed.interestCategory ?? null,
208
+ tags: [...seed.tags ?? []],
209
+ lastName: seed.lastName ?? null,
210
+ linkedinUrl: seed.linkedinUrl ?? null,
211
+ location: seed.location ?? null,
212
+ phone: seed.phone ?? null,
213
+ title: seed.title ?? null,
214
+ website: seed.website ?? null
215
+ });
216
+ var messageFields = (identity, seed, channel, includeBody) => ({
217
+ ...base2(identity, seed.id),
218
+ bodyHtml: null,
219
+ bodyText: includeBody ? seed.body ?? null : null,
220
+ campaignRef: refOrNull(identity, seed.campaignId),
221
+ channel,
222
+ leadRef: refOrNull(identity, seed.leadId),
223
+ senderRef: refOrNull(identity, seed.senderId),
224
+ sentAt: seed.sentAt,
225
+ stepIndex: seed.stepIndex ?? null,
226
+ subject: seed.subject ?? null,
227
+ threadId: seed.threadId ?? null,
228
+ variantKey: seed.variantKey ?? null
229
+ });
230
+ var toMessage = (identity, seed, channel, includeBody) => ({
231
+ ...messageFields(identity, seed, channel, includeBody),
232
+ direction: seed.direction
233
+ });
234
+ var toReply = (identity, seed, channel, includeBody) => ({
235
+ ...messageFields(identity, seed, channel, includeBody),
236
+ category: seed.category ?? "unknown",
237
+ categorySource: seed.category === void 0 ? null : "vendor",
238
+ direction: "in",
239
+ isAuto: seed.isAuto ?? null,
240
+ unread: seed.unread ?? null
241
+ });
242
+ var toMetricRow = (identity, counts) => ({
243
+ ...counts,
244
+ contentHash: null,
245
+ date: identity.date,
246
+ evidence: "exact",
247
+ provider: identity.provider,
248
+ schemaVersion: SCHEMA_VERSION,
249
+ scope: identity.scope,
250
+ scopeRef: makeRef(identity.provider, identity.workspaceId, identity.scopeId),
251
+ stepIndex: identity.stepIndex,
252
+ timezone: identity.date === null ? null : "UTC",
253
+ variantKey: identity.variantKey,
254
+ workspaceId: identity.workspaceId
255
+ });
256
+
257
+ // src/memory/store.ts
258
+ var paginate = (items, query, pageSize) => {
259
+ const offset = isNumber(query.next) ? query.next : 0;
260
+ const size = Math.min(query.limit ?? pageSize, pageSize);
261
+ const end = offset + size;
262
+ return end < items.length ? { items: items.slice(offset, end), next: end } : { items: items.slice(offset, end) };
263
+ };
264
+ var notFound = (provider, what, id) => new OutboundError("NotFound", `${what} ${id} was not found`, {
265
+ provider,
266
+ status: 404
267
+ });
268
+ var findCampaign = (store, id) => {
269
+ const seed = store.data.campaigns?.find((campaign) => campaign.id === id);
270
+ if (seed === void 0) {
271
+ throw notFound(store.identity.provider, "Campaign", id);
272
+ }
273
+ return seed;
274
+ };
275
+
276
+ // src/memory/account-reads.ts
277
+ var accountReads = (store) => {
278
+ const { data, identity, pageSize } = store;
279
+ const page = (items, query) => Promise.resolve(paginate(items, query, pageSize));
280
+ const sizeOf = (listId) => (data.leads ?? []).filter((lead) => (lead.listIds ?? []).includes(listId)).length;
281
+ return {
282
+ // Counted from the seeded leads of the campaign, by their progress.
283
+ getCampaignProgress: (id) => {
284
+ findCampaign(store, id);
285
+ const mine = (data.leads ?? []).filter((lead) => lead.campaignId === id);
286
+ const counted = (progress) => mine.filter((lead) => toLead(identity, lead).progress === progress).length;
287
+ return Promise.resolve({
288
+ ...recordBase(identity, id, null),
289
+ blocked: null,
290
+ campaignRef: makeRef(identity.provider, identity.workspaceId, id),
291
+ completed: counted("completed"),
292
+ failed: null,
293
+ inProgress: counted("active"),
294
+ leads: mine.length,
295
+ notStarted: null,
296
+ stopped: counted("paused")
297
+ });
298
+ },
299
+ getCampaignSettings: (id) => Promise.resolve(
300
+ toSettings(identity, id, findCampaign(store, id).settings ?? {})
301
+ ),
302
+ getList: (id) => {
303
+ const seed = data.lists?.find((list) => list.id === id);
304
+ return seed === void 0 ? Promise.reject(notFound(identity.provider, "List", id)) : Promise.resolve(toList(identity, seed, sizeOf(seed.id)));
305
+ },
306
+ getSenderHealth: (id) => {
307
+ const seed = data.senders?.find((sender) => sender.id === id);
308
+ return seed === void 0 ? Promise.reject(notFound(identity.provider, "Sender", id)) : Promise.resolve(toHealth(identity, seed, seed.health ?? {}));
309
+ },
310
+ listBlocklist: (query) => page(
311
+ (data.blocklist ?? []).map((seed) => toBlockEntry(identity, seed)),
312
+ query
313
+ ),
314
+ getWebhook: (id) => {
315
+ const seed = data.webhooks?.find((webhook) => webhook.id === id);
316
+ return seed === void 0 ? Promise.reject(notFound(identity.provider, "Webhook", id)) : Promise.resolve(toWebhook(identity, seed));
317
+ },
318
+ listLists: (query) => page(
319
+ (data.lists ?? []).map(
320
+ (seed) => toList(identity, seed, sizeOf(seed.id))
321
+ ),
322
+ query
323
+ ),
324
+ listPlacementTests: (query) => page(
325
+ (data.placementTests ?? []).map(
326
+ (seed) => toPlacementTest(identity, seed)
327
+ ),
328
+ query
329
+ ),
330
+ listSubsequences: (query) => {
331
+ const campaign = findCampaign(store, query.campaignId);
332
+ return page(
333
+ (campaign.subsequences ?? []).map(
334
+ (seed) => toSubsequence(identity, campaign, seed)
335
+ ),
336
+ query
337
+ );
338
+ },
339
+ listTags: (query) => page(
340
+ (data.tags ?? []).map((seed) => toTag(identity, seed)),
341
+ query
342
+ ),
343
+ listWebhooks: (query) => page(
344
+ (data.webhooks ?? []).flatMap(
345
+ (seed) => query.campaignId === void 0 || seed.campaignId === query.campaignId ? [toWebhook(identity, seed)] : []
346
+ ),
347
+ query
348
+ )
349
+ };
350
+ };
351
+
352
+ // src/memory/stats.ts
353
+ var matchesScope = (row, query) => {
354
+ switch (query.scope) {
355
+ case "workspace": {
356
+ return row.senderId === void 0 && row.stepIndex === void 0;
357
+ }
358
+ case "campaign": {
359
+ return (query.scopeId === void 0 || row.campaignId === query.scopeId) && row.senderId === void 0 && row.stepIndex === void 0;
360
+ }
361
+ case "step": {
362
+ return row.campaignId === query.scopeId && row.stepIndex !== void 0;
363
+ }
364
+ case "sender": {
365
+ return row.senderId === query.scopeId;
366
+ }
367
+ default: {
368
+ const unreachable = query.scope;
369
+ return unreachable;
370
+ }
371
+ }
372
+ };
373
+ var inRange = (row, query) => (query.from === void 0 || row.date >= query.from) && (query.to === void 0 || row.date <= query.to);
374
+ var groupKey = (row, query) => [
375
+ query.scope === "campaign" ? row.campaignId : "",
376
+ query.by === "day" ? row.date : "",
377
+ query.scope === "step" ? row.stepIndex : "",
378
+ query.scope === "step" ? row.variantKey ?? "" : ""
379
+ ].join("|");
380
+ var queryStats = (identity, seeds, query) => {
381
+ const groups = /* @__PURE__ */ new Map();
382
+ for (const row of seeds) {
383
+ if (matchesScope(row, query) && inRange(row, query)) {
384
+ const key = groupKey(row, query);
385
+ groups.set(key, [...groups.get(key) ?? [], row]);
386
+ }
387
+ }
388
+ return [...groups.values()].map((rows) => {
389
+ const [first] = rows;
390
+ return toMetricRow(
391
+ {
392
+ ...identity,
393
+ date: query.by === "day" ? first?.date ?? null : null,
394
+ scope: query.scope,
395
+ scopeId: query.scopeId ?? (query.scope === "campaign" ? first?.campaignId : void 0) ?? identity.workspaceId,
396
+ stepIndex: query.scope === "step" ? first?.stepIndex ?? null : null,
397
+ variantKey: query.scope === "step" ? first?.variantKey ?? null : null
398
+ },
399
+ sumCounts(rows.map((row) => ({ ...emptyCounts(), ...row.counts })))
400
+ );
401
+ }).toSorted(
402
+ (left, right) => (left.date ?? "").localeCompare(right.date ?? "") || (left.stepIndex ?? 0) - (right.stepIndex ?? 0) || (left.variantKey ?? "").localeCompare(right.variantKey ?? "")
403
+ );
404
+ };
405
+
406
+ // src/memory/adapter.ts
407
+ var FULL_CAPABILITIES = {
408
+ blocklist: true,
409
+ "campaigns.bySender": true,
410
+ "campaigns.progress": true,
411
+ "campaigns.settings": true,
412
+ "campaigns.status": "server",
413
+ "leads.byCampaign": true,
414
+ "leads.engagement": true,
415
+ "leads.get": true,
416
+ "leads.list": true,
417
+ "leads.lookup": true,
418
+ "leads.since": "server",
419
+ "leads.timeline": true,
420
+ "lists.get": true,
421
+ "lists.leads": true,
422
+ "lists.list": true,
423
+ "messages.body": "full",
424
+ "messages.byThread": true,
425
+ "messages.list": true,
426
+ "messages.since": "server",
427
+ "placementTests.list": true,
428
+ "replies.category": "vendor",
429
+ "replies.list": true,
430
+ "replies.since": "server",
431
+ "replies.unread": "server",
432
+ "senders.byCampaign": true,
433
+ "senders.get": true,
434
+ "senders.health": true,
435
+ "senders.list": true,
436
+ "senders.warmup": true,
437
+ sequence: true,
438
+ "sequence.subsequences": true,
439
+ "stats.byDay": "exact",
440
+ "stats.bySender": "exact",
441
+ "stats.byStep": "exact",
442
+ "stats.allCampaigns": "full",
443
+ "stats.campaign": "exact",
444
+ "stats.workspace": "exact",
445
+ tags: true,
446
+ "webhooks.get": true,
447
+ "webhooks.list": true,
448
+ workspaces: true
449
+ };
450
+ var within = (time, range) => time === void 0 ? range.since === void 0 && range.until === void 0 : (range.since === void 0 || time >= range.since) && (range.until === void 0 || time <= range.until);
451
+ var filtersByTime = (store, key) => store.capabilities[key] === "server";
452
+ var selectMessages = (store, query, key) => (store.data.messages ?? []).filter(
453
+ (message) => (query.campaignId === void 0 || message.campaignId === query.campaignId) && (query.leadId === void 0 || message.leadId === query.leadId) && (query.threadId === void 0 || message.threadId === query.threadId) && (!filtersByTime(store, key) || within(message.sentAt, query))
454
+ );
455
+ var selectLeads = (store, query) => (store.data.leads ?? []).filter(
456
+ (lead) => (query.campaignId === void 0 || lead.campaignId === query.campaignId) && (query.listId === void 0 || (lead.listIds ?? []).includes(query.listId)) && (query.email === void 0 || lead.email?.trim().toLowerCase() === query.email) && (query.linkedinUrl === void 0 || profileSlug(lead.linkedinUrl) !== null && profileSlug(lead.linkedinUrl) === profileSlug(query.linkedinUrl)) && (!filtersByTime(store, "leads.since") || within(lead.createdAt, query))
457
+ );
458
+ var getters = (store) => {
459
+ const { data, identity } = store;
460
+ return {
461
+ getCampaign: (id) => Promise.resolve(toCampaign(identity, findCampaign(store, id))),
462
+ getLead: (id) => {
463
+ const seed = data.leads?.find((lead) => lead.id === id);
464
+ return seed === void 0 ? Promise.reject(notFound(identity.provider, "Lead", id)) : Promise.resolve(toLead(identity, seed));
465
+ },
466
+ getSender: (id) => {
467
+ const seed = data.senders?.find((sender) => sender.id === id);
468
+ return seed === void 0 ? Promise.reject(notFound(identity.provider, "Sender", id)) : Promise.resolve(toSender(identity, seed));
469
+ },
470
+ getSequence: (id) => Promise.resolve(toSequence(identity, findCampaign(store, id)))
471
+ };
472
+ };
473
+ var selectCampaigns = (store, query) => {
474
+ const { data } = store;
475
+ const filterHere = store.capabilities["campaigns.status"] === "server";
476
+ const attached = query.senderId === void 0 ? void 0 : (data.senders ?? []).find((sender) => sender.id === query.senderId)?.campaignIds;
477
+ return (data.campaigns ?? []).filter(
478
+ (campaign) => (query.senderId === void 0 || (attached ?? []).includes(campaign.id)) && (!filterHere || query.status === void 0 || (campaign.status ?? "active") === query.status)
479
+ );
480
+ };
481
+ var listers = (store) => {
482
+ const { data, identity, pageSize } = store;
483
+ return {
484
+ listCampaigns: (query) => Promise.resolve(
485
+ paginate(
486
+ selectCampaigns(store, query).map(
487
+ (seed) => toCampaign(identity, seed)
488
+ ),
489
+ query,
490
+ pageSize
491
+ )
492
+ ),
493
+ listLeads: (query) => {
494
+ const seeds = selectLeads(store, query);
495
+ return Promise.resolve(
496
+ paginate(
497
+ seeds.map((seed) => toLead(identity, seed)),
498
+ query,
499
+ pageSize
500
+ )
501
+ );
502
+ },
503
+ listMessages: (query) => Promise.resolve(
504
+ paginate(
505
+ selectMessages(store, query, "messages.since").map(
506
+ (seed) => toMessage(
507
+ identity,
508
+ seed,
509
+ store.channelOf(seed.campaignId),
510
+ query.includeBody
511
+ )
512
+ ),
513
+ query,
514
+ pageSize
515
+ )
516
+ ),
517
+ listReplies: (query) => Promise.resolve(
518
+ paginate(
519
+ selectMessages(store, query, "replies.since").filter(
520
+ (seed) => seed.direction === "in" && (query.unread === void 0 || seed.unread === query.unread) && (query.category === void 0 || (seed.category ?? "unknown") === query.category)
521
+ ).map(
522
+ (seed) => toReply(
523
+ identity,
524
+ seed,
525
+ store.channelOf(seed.campaignId),
526
+ query.includeBody
527
+ )
528
+ ),
529
+ query,
530
+ pageSize
531
+ )
532
+ ),
533
+ listSenders: (query) => {
534
+ const seeds = (data.senders ?? []).filter(
535
+ (sender) => query.campaignId === void 0 || (sender.campaignIds ?? []).includes(query.campaignId)
536
+ );
537
+ return Promise.resolve(
538
+ paginate(
539
+ seeds.map((seed) => toSender(identity, seed)),
540
+ query,
541
+ pageSize
542
+ )
543
+ );
544
+ },
545
+ listWorkspaces: () => Promise.resolve({
546
+ items: [
547
+ {
548
+ ...recordBase(identity, identity.workspaceId, null),
549
+ name: identity.workspaceId
550
+ }
551
+ ]
552
+ }),
553
+ stats: (query) => {
554
+ const ofCampaign = query.scopeId !== void 0 && (query.scope === "campaign" || query.scope === "step");
555
+ return ofCampaign && !store.mentionsCampaign(query.scopeId) ? Promise.reject(
556
+ notFound(identity.provider, "Campaign", query.scopeId ?? "")
557
+ ) : Promise.resolve(queryStats(identity, data.stats ?? [], query));
558
+ }
559
+ };
560
+ };
561
+ var memory = (options = {}) => {
562
+ const provider = options.name ?? "memory";
563
+ const identity = {
564
+ provider,
565
+ workspaceId: assertWorkspaceId(options.workspaceId ?? "default", provider)
566
+ };
567
+ const data = options.data ?? {};
568
+ const capabilities = { ...FULL_CAPABILITIES, ...options.capabilities };
569
+ const channels = new Map(
570
+ (data.campaigns ?? []).map((seed) => [seed.id, seed.channel ?? "email"])
571
+ );
572
+ const mentioned = /* @__PURE__ */ new Set([
573
+ ...channels.keys(),
574
+ ...(data.stats ?? []).map((seed) => seed.campaignId),
575
+ ...(data.leads ?? []).map((seed) => seed.campaignId),
576
+ ...(data.messages ?? []).map((seed) => seed.campaignId),
577
+ ...(data.senders ?? []).flatMap((seed) => seed.campaignIds ?? [])
578
+ ]);
579
+ const store = {
580
+ capabilities,
581
+ channelOf: (campaignId) => (campaignId === void 0 ? void 0 : channels.get(campaignId)) ?? "email",
582
+ data,
583
+ identity,
584
+ mentionsCampaign: (campaignId) => campaignId !== void 0 && mentioned.has(campaignId),
585
+ pageSize: options.pageSize ?? 50
586
+ };
587
+ return {
588
+ ...getters(store),
589
+ ...listers(store),
590
+ ...accountReads(store),
591
+ capabilities,
592
+ costs: {},
593
+ // Nothing is rate limited in memory; the numbers only keep the engine's math defined.
594
+ limits: {
595
+ source: "in-memory adapter, not a vendor limit",
596
+ windows: [{ perMs: 1e3, requests: 1e6 }]
597
+ },
598
+ mapError: makeErrorMapper(provider),
599
+ maturity: "stable",
600
+ name: provider,
601
+ raw: {
602
+ authorize: (spec) => spec,
603
+ baseUrl: "memory://outbound-sdk",
604
+ // There is no vendor API behind this adapter, so raw has nothing to read.
605
+ isRead: () => false
606
+ },
607
+ secrets: [],
608
+ workspaceId: identity.workspaceId
609
+ };
610
+ };
611
+
612
+ // src/memory/demo.ts
613
+ var campaigns = [
614
+ {
615
+ createdAt: "2026-10-01T09:00:00.000Z",
616
+ id: "cmp_founders",
617
+ name: "Q4 SaaS founders",
618
+ settings: {
619
+ dailyLimit: 80,
620
+ dailyNewLeads: 30,
621
+ gapMinutes: 12,
622
+ schedule: [
623
+ {
624
+ days: [1, 2, 3, 4, 5],
625
+ from: "09:00",
626
+ name: "Weekdays",
627
+ timezone: "America/New_York",
628
+ to: "17:00"
629
+ }
630
+ ],
631
+ startDate: "2026-10-05",
632
+ stopOnAutoReply: false,
633
+ stopOnReply: true,
634
+ trackClicks: false,
635
+ trackOpens: true
636
+ },
637
+ status: "active",
638
+ steps: [
639
+ {
640
+ delayDays: 0,
641
+ variants: [
642
+ {
643
+ body: "Hi {{firstName}}, saw your launch.",
644
+ subject: "Quick question"
645
+ },
646
+ {
647
+ body: "Hi {{firstName}}, congrats on the launch.",
648
+ subject: "Congrats"
649
+ }
650
+ ]
651
+ },
652
+ {
653
+ delayDays: 3,
654
+ variants: [
655
+ { body: "Following up on my note.", subject: "Re: Quick question" }
656
+ ]
657
+ }
658
+ ],
659
+ tags: ["client-a"]
660
+ },
661
+ {
662
+ createdAt: "2026-09-12T09:00:00.000Z",
663
+ id: "cmp_agencies",
664
+ name: "Agency owners",
665
+ status: "paused",
666
+ steps: [
667
+ {
668
+ delayDays: 0,
669
+ variants: [
670
+ { body: "Hello {{firstName}}.", subject: "Idea for {{company}}" }
671
+ ]
672
+ }
673
+ ],
674
+ tags: ["client-b"]
675
+ }
676
+ ];
677
+ var leads = [
678
+ {
679
+ campaignId: "cmp_founders",
680
+ company: "Example Co",
681
+ createdAt: "2026-10-02T10:00:00.000Z",
682
+ email: "person1@example.com",
683
+ engagement: {
684
+ lastContactedAt: "2026-10-05T14:00:00.000Z",
685
+ lastRepliedAt: "2026-10-06T09:30:00.000Z",
686
+ opens: 2,
687
+ replies: 1,
688
+ stepIndex: 0
689
+ },
690
+ firstName: "Alex",
691
+ id: "lead_1",
692
+ interest: "Interested",
693
+ lastName: "Example",
694
+ listIds: ["lst_founders"],
695
+ status: "replied",
696
+ title: "Founder"
697
+ },
698
+ {
699
+ campaignId: "cmp_founders",
700
+ company: "Sample Ltd",
701
+ createdAt: "2026-10-03T10:00:00.000Z",
702
+ email: "person2@example.com",
703
+ firstName: "Sam",
704
+ id: "lead_2",
705
+ listIds: ["lst_founders"],
706
+ lastName: "Sample",
707
+ status: "active",
708
+ title: "CEO"
709
+ },
710
+ {
711
+ campaignId: "cmp_agencies",
712
+ company: "Demo Agency",
713
+ createdAt: "2026-09-13T10:00:00.000Z",
714
+ email: "person3@example.com",
715
+ firstName: "Dana",
716
+ id: "lead_3",
717
+ lastName: "Demo",
718
+ status: "bounced",
719
+ title: "Owner"
720
+ }
721
+ ];
722
+ var messages = [
723
+ {
724
+ body: "Hi Alex, saw your launch.",
725
+ campaignId: "cmp_founders",
726
+ direction: "out",
727
+ id: "msg_1",
728
+ leadId: "lead_1",
729
+ senderId: "mbx_1",
730
+ sentAt: "2026-10-05T14:00:00.000Z",
731
+ stepIndex: 0,
732
+ subject: "Quick question",
733
+ threadId: "thr_1",
734
+ variantKey: "A"
735
+ },
736
+ {
737
+ body: "Thanks, happy to chat next week.",
738
+ campaignId: "cmp_founders",
739
+ category: "positive",
740
+ direction: "in",
741
+ id: "msg_2",
742
+ isAuto: false,
743
+ leadId: "lead_1",
744
+ senderId: "mbx_1",
745
+ sentAt: "2026-10-06T09:30:00.000Z",
746
+ subject: "Re: Quick question",
747
+ threadId: "thr_1"
748
+ },
749
+ {
750
+ body: "Hi Sam, congrats on the launch.",
751
+ campaignId: "cmp_founders",
752
+ direction: "out",
753
+ id: "msg_3",
754
+ leadId: "lead_2",
755
+ senderId: "mbx_2",
756
+ sentAt: "2026-10-05T14:05:00.000Z",
757
+ stepIndex: 0,
758
+ subject: "Congrats",
759
+ variantKey: "B"
760
+ }
761
+ ];
762
+ var senders = [
763
+ {
764
+ address: "outreach1@example.com",
765
+ campaignIds: ["cmp_founders"],
766
+ dailyLimit: 40,
767
+ health: {
768
+ checkedAt: "2026-10-06T00:00:00.000Z",
769
+ connected: true,
770
+ dkim: true,
771
+ dmarc: true,
772
+ mx: true,
773
+ spf: true,
774
+ warmup: { inbox: 96, received: 90, score: 96, sent: 100, spam: 4 }
775
+ },
776
+ id: "mbx_1",
777
+ name: "Outreach One",
778
+ warmup: { enabled: true, score: 96 }
779
+ },
780
+ {
781
+ address: "outreach2@example.com",
782
+ campaignIds: ["cmp_founders", "cmp_agencies"],
783
+ dailyLimit: 40,
784
+ health: {
785
+ checkedAt: "2026-10-06T00:00:00.000Z",
786
+ connected: true,
787
+ dkim: false,
788
+ dmarc: true,
789
+ issues: ["DKIM selector not found"],
790
+ mx: true,
791
+ spf: true,
792
+ warmup: { inbox: 75, received: 70, score: 88, sent: 100, spam: 25 }
793
+ },
794
+ id: "mbx_2",
795
+ name: "Outreach Two",
796
+ warmup: { enabled: true, score: 88 }
797
+ }
798
+ ];
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"
838
+ }
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
+ });
864
+ export {
865
+ demoData,
866
+ memory
867
+ };