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,40 @@
1
+ import { z } from "zod";
2
+ import type { Campaign, CampaignStatus, Lead } from "../../internal/entities.ts";
3
+ import type { ListAll } from "../../internal/outbound/api.ts";
4
+ import type { InsightContext } from "../define.ts";
5
+ /** Reads at most `max` records, and says so in a note when more exist. */
6
+ export declare const readCapped: <Item>(context: InsightContext, open: (max: number) => ListAll<Item>, max: number, what: string) => Promise<Item[]>;
7
+ export declare const statusesField: z.ZodDefault<z.ZodArray<z.ZodEnum<{
8
+ active: "active";
9
+ archived: "archived";
10
+ completed: "completed";
11
+ draft: "draft";
12
+ paused: "paused";
13
+ unknown: "unknown";
14
+ }>>>;
15
+ /**
16
+ * Campaigns in the given statuses, up to `max`. Without a status filter on
17
+ * the adapter the first `max` campaigns are read and filtered here.
18
+ */
19
+ export declare const campaignsIn: (context: InsightContext, statuses: readonly CampaignStatus[], max: number) => Promise<Campaign[]>;
20
+ /** The leads of one campaign, up to `max`. Needs `leads.byCampaign`. */
21
+ export declare const leadsOf: (context: InsightContext, campaign: string, max: number) => Promise<Lead[]>;
22
+ /** First and last name joined, or `null` when the vendor has neither. */
23
+ export declare const nameOf: (lead: Lead) => string | null;
24
+ /** The part of an email address after the `@`, or `null`. */
25
+ export declare const domainOf: (email: string | null) => string | null;
26
+ export declare const DEFAULT_POSITIVE_LABELS: string[];
27
+ export declare const positiveLabelsField: z.ZodDefault<z.ZodArray<z.ZodString>>;
28
+ /** `null` when the lead has no label, so "not interested" is never guessed. */
29
+ export declare const isPositive: (label: string | null, labels: readonly string[]) => boolean | null;
30
+ /** Whether the vendor says the lead replied: a status, a count or a time. */
31
+ export declare const hasReplied: (lead: Lead) => boolean;
32
+ /**
33
+ * Says which records lack open, click and reply counts, and only when some
34
+ * do. One tool: the adapter's own declaration decides. A combined instance
35
+ * lacks `leads.engagement` as soon as one tool does, although the others
36
+ * still fill the counts, so there each tool is judged by the records read
37
+ * and the ones with no counts on any lead are named. `effect` finishes the
38
+ * sentence, for example `those are null`.
39
+ */
40
+ export declare const noteEngagement: (context: InsightContext, leads: readonly Lead[], effect: string) => void;
@@ -0,0 +1,53 @@
1
+ export type SuppressionMatch = "domain" | "email" | "linkedin";
2
+ export interface SuppressionViolation {
3
+ readonly lead: string;
4
+ readonly email: string | null;
5
+ readonly linkedinUrl: string | null;
6
+ readonly leadStatus: string;
7
+ readonly campaign: string;
8
+ readonly campaignName: string;
9
+ /** The block list entry's ref. */
10
+ readonly entry: string;
11
+ readonly entryValue: string;
12
+ /** `email` for the exact address, `domain` for its domain, `linkedin` for the profile. */
13
+ readonly matchedBy: SuppressionMatch;
14
+ /** `false` when the entry is on another tool's block list than the campaign's. */
15
+ readonly sameTool: boolean;
16
+ readonly finding: string;
17
+ }
18
+ export interface SuppressionCampaign {
19
+ readonly campaign: string;
20
+ readonly campaignName: string;
21
+ readonly leadsRead: number;
22
+ readonly violations: number;
23
+ }
24
+ export interface SuppressionCheck {
25
+ /** Leads still `active` first, then by campaign and lead. */
26
+ readonly violations: readonly SuppressionViolation[];
27
+ /** Every campaign checked, most violations first. */
28
+ readonly byCampaign: readonly SuppressionCampaign[];
29
+ readonly totals: {
30
+ readonly violations: number;
31
+ readonly byMatch: {
32
+ readonly email: number;
33
+ readonly domain: number;
34
+ readonly linkedin: number;
35
+ };
36
+ readonly campaignsRead: number;
37
+ readonly leadsRead: number;
38
+ readonly blockEntriesRead: number;
39
+ /** Entries of a kind that cannot be matched to a lead: a company name or the vendor's `other`. */
40
+ readonly blockEntriesNotChecked: number;
41
+ };
42
+ }
43
+ export declare const suppressionCheck: import("../define.ts").InsightDefinition<"suppressionCheck", {
44
+ max_block_entries: number;
45
+ max_campaigns: number;
46
+ max_leads_per_campaign: number;
47
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
48
+ }, SuppressionCheck, {
49
+ max_block_entries?: number | undefined;
50
+ max_campaigns?: number | undefined;
51
+ max_leads_per_campaign?: number | undefined;
52
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
53
+ }>;
@@ -0,0 +1,40 @@
1
+ import type { Json } from "../internal/json.ts";
2
+ import type { OutboundApi } from "../internal/outbound/api.ts";
3
+ import type { OutboundPlugin } from "../internal/outbound/plugins.ts";
4
+ import type { InsightResult, RunOptions } from "./define.ts";
5
+ import type { AnyInsight } from "./registry.ts";
6
+ type InputOf<Definition> = Definition extends {
7
+ readonly given?: infer Given;
8
+ } ? Given : never;
9
+ type DataOf<Definition> = Definition extends {
10
+ readonly run: (...args: never[]) => Promise<infer Data>;
11
+ } ? Data : never;
12
+ /** One method per insight: `outbound.insights.personSummary({ person })`. */
13
+ export type Insights = {
14
+ readonly [Definition in AnyInsight as Definition["key"]]: (input: InputOf<Definition>, options?: RunOptions) => Promise<InsightResult<DataOf<Definition>>>;
15
+ };
16
+ export interface InsightsExtension {
17
+ readonly insights: Insights;
18
+ }
19
+ /** Runs one insight by its tool name or method name, with JSON input. Rejects with `Invalid` for an unknown name. */
20
+ export declare const runInsightByName: (outbound: OutboundApi, name: string, input?: Json, options?: RunOptions) => Promise<InsightResult<Json>>;
21
+ export interface ListedInsight {
22
+ readonly name: string;
23
+ readonly key: string;
24
+ readonly description: string;
25
+ readonly needs: readonly string[];
26
+ /** The input as JSON Schema. */
27
+ readonly parameters: Json;
28
+ }
29
+ /** What each insight is called, what it answers and what it takes. */
30
+ export declare const listInsights: () => ListedInsight[];
31
+ /**
32
+ * Adds `outbound.insights`: one typed method per insight.
33
+ *
34
+ * ```ts
35
+ * const outbound = createOutbound({ adapter, plugins: [insights()] });
36
+ * await outbound.insights.personSummary({ person: "jane@example.com" });
37
+ * ```
38
+ */
39
+ export declare const insights: () => OutboundPlugin<InsightsExtension>;
40
+ export {};
@@ -0,0 +1,335 @@
1
+ import type { InsightEntry } from "./define.ts";
2
+ export declare const INSIGHTS: readonly [import("./define.ts").InsightDefinition<"personSummary", {
3
+ max_campaigns: number;
4
+ person: string;
5
+ }, import("./people/person-summary.ts").PersonSummary, {
6
+ person: string;
7
+ max_campaigns?: number | undefined;
8
+ }>, import("./define.ts").InsightDefinition<"accountSummary", {
9
+ allow_free_domains: boolean;
10
+ domain: string;
11
+ max_campaigns: number;
12
+ max_leads: number;
13
+ positive_labels: string[];
14
+ }, import("./people/account-summary.ts").AccountSummary, {
15
+ domain: string;
16
+ allow_free_domains?: boolean | undefined;
17
+ max_campaigns?: number | undefined;
18
+ max_leads?: number | undefined;
19
+ positive_labels?: string[] | undefined;
20
+ }>, import("./define.ts").InsightDefinition<"leadCollisions", {
21
+ max_campaigns: number;
22
+ max_leads_per_campaign: number;
23
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
24
+ }, import("./people/lead-collisions.ts").LeadCollisions, {
25
+ max_campaigns?: number | undefined;
26
+ max_leads_per_campaign?: number | undefined;
27
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
28
+ }>, import("./define.ts").InsightDefinition<"suppressionCheck", {
29
+ max_block_entries: number;
30
+ max_campaigns: number;
31
+ max_leads_per_campaign: number;
32
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
33
+ }, import("./people/suppression-check.ts").SuppressionCheck, {
34
+ max_block_entries?: number | undefined;
35
+ max_campaigns?: number | undefined;
36
+ max_leads_per_campaign?: number | undefined;
37
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
38
+ }>, import("./define.ts").InsightDefinition<"droppedReplies", {
39
+ categories: ("unknown" | "bounce" | "negative" | "neutral" | "ooo" | "positive" | "unsubscribe")[];
40
+ include_auto: boolean;
41
+ max_replies: number;
42
+ older_than_hours: number;
43
+ since: string | null;
44
+ }, import("./people/dropped-replies.ts").DroppedReplies, {
45
+ categories?: ("unknown" | "bounce" | "negative" | "neutral" | "ooo" | "positive" | "unsubscribe")[] | undefined;
46
+ include_auto?: boolean | undefined;
47
+ max_replies?: number | undefined;
48
+ older_than_hours?: number | undefined;
49
+ since?: string | null | undefined;
50
+ }>, import("./define.ts").InsightDefinition<"hotLeads", {
51
+ campaign: string | null;
52
+ count_cap: number;
53
+ limit: number;
54
+ max_leads: number;
55
+ positive_labels: string[];
56
+ recency_days: number;
57
+ weight_click: number;
58
+ weight_interest: number;
59
+ weight_open: number;
60
+ weight_recency: number;
61
+ weight_reply: number;
62
+ }, import("./people/hot-leads.ts").HotLeads, {
63
+ campaign?: string | null | undefined;
64
+ count_cap?: number | undefined;
65
+ limit?: number | undefined;
66
+ max_leads?: number | undefined;
67
+ positive_labels?: string[] | undefined;
68
+ recency_days?: number | undefined;
69
+ weight_click?: number | undefined;
70
+ weight_interest?: number | undefined;
71
+ weight_open?: number | undefined;
72
+ weight_recency?: number | undefined;
73
+ weight_reply?: number | undefined;
74
+ }>, import("./define.ts").InsightDefinition<"personalizationGaps", {
75
+ campaign: string;
76
+ limit: number;
77
+ max_leads: number;
78
+ }, import("./people/personalization-gaps.ts").PersonalizationGaps, {
79
+ campaign: string;
80
+ limit?: number | undefined;
81
+ max_leads?: number | undefined;
82
+ }>, import("./define.ts").InsightDefinition<"stepFunnel", {
83
+ campaign: string;
84
+ from: string | null;
85
+ min_reply_rate: number;
86
+ to: string | null;
87
+ }, import("./copy/step-funnel.ts").StepFunnel, {
88
+ campaign: string;
89
+ from?: string | null | undefined;
90
+ min_reply_rate?: number | undefined;
91
+ to?: string | null | undefined;
92
+ }>, import("./define.ts").InsightDefinition<"variantTest", {
93
+ alpha: number;
94
+ campaign: string;
95
+ from: string | null;
96
+ metric: "positive" | "replied" | "clicked" | "opened";
97
+ min_sent: number;
98
+ to: string | null;
99
+ }, import("./copy/variant-test.ts").VariantTest, {
100
+ campaign: string;
101
+ alpha?: number | undefined;
102
+ from?: string | null | undefined;
103
+ metric?: "positive" | "replied" | "clicked" | "opened" | undefined;
104
+ min_sent?: number | undefined;
105
+ to?: string | null | undefined;
106
+ }>, import("./define.ts").InsightDefinition<"copyAudit", {
107
+ campaign: string;
108
+ max_body_words: number;
109
+ max_caps_words: number;
110
+ max_connection_chars: number;
111
+ max_exclamations: number;
112
+ max_links: number;
113
+ max_subject_chars: number;
114
+ spam_words: string[];
115
+ }, import("./copy/copy-audit.ts").CopyAudit, {
116
+ campaign: string;
117
+ max_body_words?: number | undefined;
118
+ max_caps_words?: number | undefined;
119
+ max_connection_chars?: number | undefined;
120
+ max_exclamations?: number | undefined;
121
+ max_links?: number | undefined;
122
+ max_subject_chars?: number | undefined;
123
+ spam_words?: string[] | undefined;
124
+ }>, import("./define.ts").InsightDefinition<"copyReuse", {
125
+ max_campaigns: number;
126
+ min_sent: number;
127
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
128
+ }, import("./copy/copy-reuse.ts").CopyReuse, {
129
+ max_campaigns?: number | undefined;
130
+ min_sent?: number | undefined;
131
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
132
+ }>, import("./define.ts").InsightDefinition<"replyTiming", {
133
+ campaign: string | null;
134
+ max_messages: number;
135
+ since: string | null;
136
+ timezone_offset_minutes: number;
137
+ }, import("./copy/reply-timing.ts").ReplyTiming, {
138
+ campaign?: string | null | undefined;
139
+ max_messages?: number | undefined;
140
+ since?: string | null | undefined;
141
+ timezone_offset_minutes?: number | undefined;
142
+ }>, import("./define.ts").InsightDefinition<"domainHealth", {
143
+ max_senders: number;
144
+ spam_rate_threshold: number;
145
+ }, import("./senders/domain-health.ts").DomainHealth, {
146
+ max_senders?: number | undefined;
147
+ spam_rate_threshold?: number | undefined;
148
+ }>, import("./define.ts").InsightDefinition<"senderCapacity", {
149
+ days: number;
150
+ max_campaigns: number;
151
+ max_senders: number;
152
+ }, import("./senders/sender-capacity.ts").SenderCapacity, {
153
+ days?: number | undefined;
154
+ max_campaigns?: number | undefined;
155
+ max_senders?: number | undefined;
156
+ }>, import("./define.ts").InsightDefinition<"bounceWatch", {
157
+ include_senders: boolean;
158
+ max_campaigns: number;
159
+ max_senders_per_campaign: number;
160
+ min_sent: number;
161
+ threshold: number;
162
+ from?: string | undefined;
163
+ to?: string | undefined;
164
+ }, import("./senders/bounce-watch.ts").BounceWatch, {
165
+ from?: string | undefined;
166
+ include_senders?: boolean | undefined;
167
+ max_campaigns?: number | undefined;
168
+ max_senders_per_campaign?: number | undefined;
169
+ min_sent?: number | undefined;
170
+ threshold?: number | undefined;
171
+ to?: string | undefined;
172
+ }>, import("./define.ts").InsightDefinition<"warmupReadiness", {
173
+ check_health: boolean;
174
+ max_senders: number;
175
+ max_spam_rate: number;
176
+ min_score: number;
177
+ }, import("./senders/warmup-readiness.ts").WarmupReadiness, {
178
+ check_health?: boolean | undefined;
179
+ max_senders?: number | undefined;
180
+ max_spam_rate?: number | undefined;
181
+ min_score?: number | undefined;
182
+ }>, import("./define.ts").InsightDefinition<"senderLoad", {
183
+ max_campaigns: number;
184
+ max_campaigns_per_sender: number;
185
+ max_senders: number;
186
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
187
+ }, import("./senders/sender-load.ts").SenderLoad, {
188
+ max_campaigns?: number | undefined;
189
+ max_campaigns_per_sender?: number | undefined;
190
+ max_senders?: number | undefined;
191
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
192
+ }>, import("./define.ts").InsightDefinition<"settingsAudit", {
193
+ max_campaigns: number;
194
+ max_daily_limit_per_sender: number;
195
+ max_senders_per_campaign: number;
196
+ max_window_hours: number;
197
+ min_gap_minutes: number;
198
+ min_window_hours: number;
199
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
200
+ }, import("./senders/settings-audit.ts").SettingsAudit, {
201
+ max_campaigns?: number | undefined;
202
+ max_daily_limit_per_sender?: number | undefined;
203
+ max_senders_per_campaign?: number | undefined;
204
+ max_window_hours?: number | undefined;
205
+ min_gap_minutes?: number | undefined;
206
+ min_window_hours?: number | undefined;
207
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
208
+ }>, import("./define.ts").InsightDefinition<"campaignDiagnosis", {
209
+ campaign: string;
210
+ daily_limit_share: number;
211
+ max_bounce_rate: number;
212
+ max_send_drop: number;
213
+ max_senders: number;
214
+ min_positive_share: number;
215
+ min_reply_rate: number;
216
+ min_sent: number;
217
+ min_weekly_hours: number;
218
+ recent_days: number;
219
+ from: string | null;
220
+ to: string | null;
221
+ }, import("./ops/campaign-diagnosis.ts").CampaignDiagnosis, {
222
+ campaign: string;
223
+ daily_limit_share?: number | undefined;
224
+ max_bounce_rate?: number | undefined;
225
+ max_send_drop?: number | undefined;
226
+ max_senders?: number | undefined;
227
+ min_positive_share?: number | undefined;
228
+ min_reply_rate?: number | undefined;
229
+ min_sent?: number | undefined;
230
+ min_weekly_hours?: number | undefined;
231
+ recent_days?: number | undefined;
232
+ from?: string | null | undefined;
233
+ to?: string | null | undefined;
234
+ }>, import("./define.ts").InsightDefinition<"pipelineForecast", {
235
+ campaign: string;
236
+ days: number;
237
+ max_leads: number;
238
+ }, import("./ops/pipeline-forecast.ts").PipelineForecast, {
239
+ campaign: string;
240
+ days?: number | undefined;
241
+ max_leads?: number | undefined;
242
+ }>, import("./define.ts").InsightDefinition<"anomalies", {
243
+ baseline_days: number;
244
+ campaign: string | null;
245
+ days: number;
246
+ metrics: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[];
247
+ min_baseline_points: number;
248
+ threshold: number;
249
+ }, import("./ops/anomalies.ts").Anomalies, {
250
+ baseline_days?: number | undefined;
251
+ campaign?: string | null | undefined;
252
+ days?: number | undefined;
253
+ metrics?: ("positive" | "bounced" | "replied" | "unsubscribed" | "clicked" | "contacted" | "opened" | "sent")[] | undefined;
254
+ min_baseline_points?: number | undefined;
255
+ threshold?: number | undefined;
256
+ }>, import("./define.ts").InsightDefinition<"periodComparison", {
257
+ alpha: number;
258
+ days: number;
259
+ min_sent: number;
260
+ max_campaigns: number;
261
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
262
+ }, import("./ops/period-comparison.ts").PeriodComparison, {
263
+ alpha?: number | undefined;
264
+ days?: number | undefined;
265
+ min_sent?: number | undefined;
266
+ max_campaigns?: number | undefined;
267
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
268
+ }>, import("./define.ts").InsightDefinition<"campaignRanking", {
269
+ metric: "reply_rate" | "bounce_rate" | "positive_reply_rate";
270
+ min_sent: number;
271
+ max_campaigns: number;
272
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
273
+ from: string | null;
274
+ to: string | null;
275
+ }, import("./ops/campaign-ranking.ts").CampaignRanking, {
276
+ metric?: "reply_rate" | "bounce_rate" | "positive_reply_rate" | undefined;
277
+ min_sent?: number | undefined;
278
+ max_campaigns?: number | undefined;
279
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
280
+ from?: string | null | undefined;
281
+ to?: string | null | undefined;
282
+ }>, import("./define.ts").InsightDefinition<"channelMix", {
283
+ alpha: number;
284
+ max_campaigns: number;
285
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
286
+ from: string | null;
287
+ to: string | null;
288
+ }, import("./ops/channel-mix.ts").ChannelMix, {
289
+ alpha?: number | undefined;
290
+ max_campaigns?: number | undefined;
291
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
292
+ from?: string | null | undefined;
293
+ to?: string | null | undefined;
294
+ }>, import("./define.ts").InsightDefinition<"tagRollup", {
295
+ min_sent: number;
296
+ max_campaigns: number;
297
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
298
+ from: string | null;
299
+ to: string | null;
300
+ }, import("./ops/tag-rollup.ts").TagRollup, {
301
+ min_sent?: number | undefined;
302
+ max_campaigns?: number | undefined;
303
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
304
+ from?: string | null | undefined;
305
+ to?: string | null | undefined;
306
+ }>, import("./define.ts").InsightDefinition<"clientReport", {
307
+ alpha: number;
308
+ anomaly_threshold: number;
309
+ baseline_days: number;
310
+ days: number;
311
+ max_bounce_rate: number;
312
+ max_leads_per_campaign: number;
313
+ min_baseline_points: number;
314
+ min_sent: number;
315
+ runway_days: number;
316
+ top: number;
317
+ max_campaigns: number;
318
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
319
+ }, import("./ops/client-report.ts").ClientReport, {
320
+ alpha?: number | undefined;
321
+ anomaly_threshold?: number | undefined;
322
+ baseline_days?: number | undefined;
323
+ days?: number | undefined;
324
+ max_bounce_rate?: number | undefined;
325
+ max_leads_per_campaign?: number | undefined;
326
+ min_baseline_points?: number | undefined;
327
+ min_sent?: number | undefined;
328
+ runway_days?: number | undefined;
329
+ top?: number | undefined;
330
+ max_campaigns?: number | undefined;
331
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
332
+ }>];
333
+ export type AnyInsight = (typeof INSIGHTS)[number];
334
+ /** The same list with each insight's input and answer types set aside. */
335
+ export declare const ENTRIES: readonly InsightEntry[];
@@ -0,0 +1,70 @@
1
+ import type { Interval } from "../stats.ts";
2
+ export interface BounceCounts {
3
+ readonly bounced: number;
4
+ readonly sent: number;
5
+ /** Bounced divided by sent. `null` when nothing was sent. */
6
+ readonly rate: number | null;
7
+ /** The Wilson interval of the rate; wide on few sends. */
8
+ readonly interval: Interval | null;
9
+ }
10
+ export interface BounceSender extends BounceCounts {
11
+ readonly sender: string;
12
+ readonly address: string | null;
13
+ readonly name: string | null;
14
+ }
15
+ export interface BounceCampaign extends BounceCounts {
16
+ readonly campaign: string;
17
+ readonly name: string;
18
+ readonly status: string;
19
+ readonly finding: string;
20
+ /**
21
+ * The campaign's senders over the threshold, worst first, counted over
22
+ * everything each sender sent in the period, not this campaign alone.
23
+ * `null` when the senders were not checked.
24
+ */
25
+ readonly senders: readonly BounceSender[] | null;
26
+ }
27
+ export interface BounceUnknown {
28
+ readonly campaign: string;
29
+ readonly name: string;
30
+ readonly status: string;
31
+ readonly reason: string;
32
+ }
33
+ export interface BounceWatch {
34
+ /** Campaigns over the threshold, worst first. */
35
+ readonly over: readonly BounceCampaign[];
36
+ /** Campaigns with fewer sends than `min_sent`, whatever their rate. */
37
+ readonly tooFewSends: readonly BounceCampaign[];
38
+ /** Campaigns the vendor reports no sent or bounce count for. They are not clean. */
39
+ readonly unknown: readonly BounceUnknown[];
40
+ readonly totals: {
41
+ readonly campaigns: number;
42
+ readonly over: number;
43
+ readonly clean: number;
44
+ readonly tooFewSends: number;
45
+ readonly unknown: number;
46
+ /** Over the campaigns with a known sent and bounce count. */
47
+ readonly bounced: number | null;
48
+ readonly sent: number | null;
49
+ readonly rate: number | null;
50
+ };
51
+ readonly threshold: number;
52
+ readonly minSent: number;
53
+ }
54
+ export declare const bounceWatch: import("../define.ts").InsightDefinition<"bounceWatch", {
55
+ include_senders: boolean;
56
+ max_campaigns: number;
57
+ max_senders_per_campaign: number;
58
+ min_sent: number;
59
+ threshold: number;
60
+ from?: string | undefined;
61
+ to?: string | undefined;
62
+ }, BounceWatch, {
63
+ from?: string | undefined;
64
+ include_senders?: boolean | undefined;
65
+ max_campaigns?: number | undefined;
66
+ max_senders_per_campaign?: number | undefined;
67
+ min_sent?: number | undefined;
68
+ threshold?: number | undefined;
69
+ to?: string | undefined;
70
+ }>;
@@ -0,0 +1,69 @@
1
+ import type { Interval } from "../stats.ts";
2
+ import type { DnsRecord } from "./read.ts";
3
+ export type DomainRisk = "high" | "low" | "medium" | "unknown";
4
+ export interface DomainMailbox {
5
+ readonly sender: string;
6
+ readonly address: string | null;
7
+ readonly status: string;
8
+ /** `null` when the vendor does not say. */
9
+ readonly connected: boolean | null;
10
+ readonly blacklisted: boolean | null;
11
+ readonly failingDns: readonly DnsRecord[];
12
+ /** Problems in the vendor's own words. */
13
+ readonly issues: readonly string[];
14
+ }
15
+ export interface DomainWarmup {
16
+ /** Mailboxes that report warmup spam. The pooled numbers cover only these. */
17
+ readonly mailboxes: number;
18
+ readonly sent: number | null;
19
+ readonly spam: number | null;
20
+ readonly spamRate: number | null;
21
+ /** The Wilson interval of the spam rate; wide when few warmup emails were sent. */
22
+ readonly interval: Interval | null;
23
+ }
24
+ export interface DomainReport {
25
+ readonly domain: string;
26
+ readonly risk: DomainRisk;
27
+ /** Why the domain has its risk level, most serious first. */
28
+ readonly reasons: readonly string[];
29
+ readonly mailboxes: readonly DomainMailbox[];
30
+ /** DNS records that fail on at least one mailbox. */
31
+ readonly failingDns: readonly DnsRecord[];
32
+ readonly disconnected: number;
33
+ readonly blacklisted: number;
34
+ readonly warmup: DomainWarmup;
35
+ /** Checks the vendor reported for no mailbox of the domain. */
36
+ readonly notReported: readonly string[];
37
+ }
38
+ export interface LinkedinSeat {
39
+ readonly sender: string;
40
+ readonly name: string | null;
41
+ readonly linkedinUrl: string | null;
42
+ readonly status: string;
43
+ readonly connected: boolean | null;
44
+ readonly issues: readonly string[];
45
+ }
46
+ export interface DomainHealth {
47
+ /** Worst domain first. */
48
+ readonly domains: readonly DomainReport[];
49
+ /** LinkedIn seats have no domain; disconnected seats first. */
50
+ readonly linkedinSeats: readonly LinkedinSeat[];
51
+ /** Mailboxes whose domain is not known, by sender ref. */
52
+ readonly mailboxesWithoutDomain: readonly string[];
53
+ readonly totals: {
54
+ readonly senders: number;
55
+ readonly domains: number;
56
+ readonly high: number;
57
+ readonly medium: number;
58
+ readonly low: number;
59
+ readonly unknown: number;
60
+ readonly linkedinSeats: number;
61
+ };
62
+ }
63
+ export declare const domainHealth: import("../define.ts").InsightDefinition<"domainHealth", {
64
+ max_senders: number;
65
+ spam_rate_threshold: number;
66
+ }, DomainHealth, {
67
+ max_senders?: number | undefined;
68
+ spam_rate_threshold?: number | undefined;
69
+ }>;