outbound-sdk 0.0.0-stage → 0.1.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 (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -2
  3. package/dist/alerts/index.d.ts +2 -0
  4. package/dist/alerts/index.js +136 -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 +70 -0
  10. package/dist/budget/index.d.ts +21 -0
  11. package/dist/budget/index.js +50 -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-7BCYLIDG.js +483 -0
  32. package/dist/chunks/chunk-B7V6EOAC.js +2273 -0
  33. package/dist/chunks/chunk-CMQ5ZHLZ.js +25 -0
  34. package/dist/chunks/chunk-F7MKFVIG.js +43 -0
  35. package/dist/chunks/chunk-FZF6CLPX.js +232 -0
  36. package/dist/chunks/chunk-GPEJG34O.js +53 -0
  37. package/dist/chunks/chunk-HEC7XFFH.js +65 -0
  38. package/dist/chunks/chunk-IBC52BX3.js +24 -0
  39. package/dist/chunks/chunk-LNCOGBMI.js +144 -0
  40. package/dist/chunks/chunk-LOXBLQ3I.js +180 -0
  41. package/dist/chunks/chunk-NAWZ73QS.js +22 -0
  42. package/dist/chunks/chunk-OCV66TS2.js +705 -0
  43. package/dist/chunks/chunk-Q465X22Y.js +548 -0
  44. package/dist/chunks/chunk-QTB747K4.js +100 -0
  45. package/dist/chunks/chunk-QZNNCXXD.js +92 -0
  46. package/dist/chunks/chunk-R6AM4GJR.js +105 -0
  47. package/dist/chunks/chunk-TIJKJJDW.js +6 -0
  48. package/dist/chunks/chunk-VURTOVGI.js +61 -0
  49. package/dist/chunks/chunk-WAM6N4OF.js +269 -0
  50. package/dist/chunks/chunk-WW746NJF.js +94 -0
  51. package/dist/chunks/chunk-XC6CZP73.js +80 -0
  52. package/dist/chunks/chunk-ZGHQYZEH.js +45 -0
  53. package/dist/cli/bin.d.ts +2 -0
  54. package/dist/cli/bin.js +34 -0
  55. package/dist/cli/commands.d.ts +16 -0
  56. package/dist/cli/index.d.ts +13 -0
  57. package/dist/cli/index.js +25 -0
  58. package/dist/cli/mcp.d.ts +14 -0
  59. package/dist/clients/index.d.ts +2 -0
  60. package/dist/clients/index.js +107 -0
  61. package/dist/clients/plugin.d.ts +42 -0
  62. package/dist/combine/account.d.ts +4 -0
  63. package/dist/combine/adapter.d.ts +9 -0
  64. package/dist/combine/index.d.ts +2 -0
  65. package/dist/combine/index.js +345 -0
  66. package/dist/combine/route.d.ts +17 -0
  67. package/dist/exporter/index.d.ts +29 -0
  68. package/dist/exporter/index.js +77 -0
  69. package/dist/failover/index.d.ts +11 -0
  70. package/dist/failover/index.js +45 -0
  71. package/dist/fixtures/index.d.ts +27 -0
  72. package/dist/fixtures/index.js +241 -0
  73. package/dist/fixtures/scrub.d.ts +5 -0
  74. package/dist/heyreach/account.d.ts +11 -0
  75. package/dist/heyreach/adapter.d.ts +5 -0
  76. package/dist/heyreach/capabilities.d.ts +68 -0
  77. package/dist/heyreach/client.d.ts +20 -0
  78. package/dist/heyreach/inbox.d.ts +7 -0
  79. package/dist/heyreach/index.d.ts +18 -0
  80. package/dist/heyreach/index.js +1708 -0
  81. package/dist/heyreach/lookup.d.ts +15 -0
  82. package/dist/heyreach/map-account.d.ts +25 -0
  83. package/dist/heyreach/map-sequence.d.ts +5 -0
  84. package/dist/heyreach/map-stats.d.ts +10 -0
  85. package/dist/heyreach/map.d.ts +35 -0
  86. package/dist/heyreach/native-organization.d.ts +128 -0
  87. package/dist/heyreach/native-voice.d.ts +106 -0
  88. package/dist/heyreach/native.d.ts +496 -0
  89. package/dist/heyreach/paging.d.ts +7 -0
  90. package/dist/heyreach/webhooks.d.ts +2 -0
  91. package/dist/identity/index.d.ts +3 -0
  92. package/dist/identity/index.js +148 -0
  93. package/dist/identity/keys.d.ts +9 -0
  94. package/dist/identity/plugin.d.ts +34 -0
  95. package/dist/index.d.ts +36 -0
  96. package/dist/index.js +119 -0
  97. package/dist/insights/copy/copy-audit.d.ts +55 -0
  98. package/dist/insights/copy/copy-checks.d.ts +44 -0
  99. package/dist/insights/copy/copy-reuse.d.ts +59 -0
  100. package/dist/insights/copy/index.d.ts +67 -0
  101. package/dist/insights/copy/reply-timing.d.ts +63 -0
  102. package/dist/insights/copy/shared.d.ts +53 -0
  103. package/dist/insights/copy/step-funnel.d.ts +66 -0
  104. package/dist/insights/copy/variant-test.d.ts +64 -0
  105. package/dist/insights/define.d.ts +98 -0
  106. package/dist/insights/index.d.ts +10 -0
  107. package/dist/insights/index.js +4873 -0
  108. package/dist/insights/ops/anomalies.d.ts +80 -0
  109. package/dist/insights/ops/campaign-diagnosis.d.ts +39 -0
  110. package/dist/insights/ops/campaign-ranking.d.ts +56 -0
  111. package/dist/insights/ops/channel-mix.d.ts +44 -0
  112. package/dist/insights/ops/client-report.d.ts +76 -0
  113. package/dist/insights/ops/diagnosis-checks.d.ts +48 -0
  114. package/dist/insights/ops/index.d.ts +135 -0
  115. package/dist/insights/ops/period-comparison.d.ts +86 -0
  116. package/dist/insights/ops/pipeline-forecast.d.ts +44 -0
  117. package/dist/insights/ops/shared.d.ts +149 -0
  118. package/dist/insights/ops/tag-rollup.d.ts +32 -0
  119. package/dist/insights/people/account-summary.d.ts +68 -0
  120. package/dist/insights/people/dropped-replies.d.ts +51 -0
  121. package/dist/insights/people/find.d.ts +18 -0
  122. package/dist/insights/people/hot-leads.d.ts +67 -0
  123. package/dist/insights/people/index.d.ts +88 -0
  124. package/dist/insights/people/lead-collisions.d.ts +43 -0
  125. package/dist/insights/people/person-summary.d.ts +46 -0
  126. package/dist/insights/people/personalization-gaps.d.ts +60 -0
  127. package/dist/insights/people/read.d.ts +40 -0
  128. package/dist/insights/people/suppression-check.d.ts +53 -0
  129. package/dist/insights/plugin.d.ts +40 -0
  130. package/dist/insights/registry.d.ts +335 -0
  131. package/dist/insights/senders/bounce-watch.d.ts +70 -0
  132. package/dist/insights/senders/domain-health.d.ts +69 -0
  133. package/dist/insights/senders/index.d.ts +74 -0
  134. package/dist/insights/senders/read.d.ts +37 -0
  135. package/dist/insights/senders/sender-capacity.d.ts +67 -0
  136. package/dist/insights/senders/sender-load.d.ts +52 -0
  137. package/dist/insights/senders/settings-audit.d.ts +48 -0
  138. package/dist/insights/senders/warmup-readiness.d.ts +39 -0
  139. package/dist/insights/stats.d.ts +45 -0
  140. package/dist/insights/tools.d.ts +16 -0
  141. package/dist/insights/types.d.ts +4 -0
  142. package/dist/instantly/adapter-account.d.ts +5 -0
  143. package/dist/instantly/adapter-mail.d.ts +3 -0
  144. package/dist/instantly/adapter.d.ts +7 -0
  145. package/dist/instantly/capabilities.d.ts +83 -0
  146. package/dist/instantly/client.d.ts +29 -0
  147. package/dist/instantly/index.d.ts +20 -0
  148. package/dist/instantly/index.js +2372 -0
  149. package/dist/instantly/map-account.d.ts +23 -0
  150. package/dist/instantly/map-lead.d.ts +18 -0
  151. package/dist/instantly/map-stats.d.ts +22 -0
  152. package/dist/instantly/map.d.ts +24 -0
  153. package/dist/instantly/native-agents-sales.d.ts +161 -0
  154. package/dist/instantly/native-agents.d.ts +156 -0
  155. package/dist/instantly/native-campaigns.d.ts +101 -0
  156. package/dist/instantly/native-leads.d.ts +93 -0
  157. package/dist/instantly/native-params.d.ts +24 -0
  158. package/dist/instantly/native-search.d.ts +82 -0
  159. package/dist/instantly/native-senders.d.ts +182 -0
  160. package/dist/instantly/native-supersearch.d.ts +149 -0
  161. package/dist/instantly/native-workspace.d.ts +170 -0
  162. package/dist/instantly/native.d.ts +1081 -0
  163. package/dist/instantly/pages.d.ts +29 -0
  164. package/dist/instantly/stats.d.ts +5 -0
  165. package/dist/instantly/webhooks.d.ts +2 -0
  166. package/dist/internal/adapter.d.ts +189 -0
  167. package/dist/internal/capabilities.d.ts +86 -0
  168. package/dist/internal/cursor.d.ts +10 -0
  169. package/dist/internal/engine/budget.d.ts +44 -0
  170. package/dist/internal/engine/engine.d.ts +45 -0
  171. package/dist/internal/engine/rate-store.d.ts +25 -0
  172. package/dist/internal/engine/request.d.ts +27 -0
  173. package/dist/internal/engine/retry.d.ts +21 -0
  174. package/dist/internal/engine/runtime.d.ts +13 -0
  175. package/dist/internal/entities-account.d.ts +135 -0
  176. package/dist/internal/entities.d.ts +389 -0
  177. package/dist/internal/env.d.ts +4 -0
  178. package/dist/internal/errors.d.ts +57 -0
  179. package/dist/internal/hooks.d.ts +55 -0
  180. package/dist/internal/json.d.ts +40 -0
  181. package/dist/internal/limits.d.ts +34 -0
  182. package/dist/internal/metrics.d.ts +52 -0
  183. package/dist/internal/native.d.ts +66 -0
  184. package/dist/internal/outbound/api.d.ts +267 -0
  185. package/dist/internal/outbound/collections.d.ts +31 -0
  186. package/dist/internal/outbound/core.d.ts +36 -0
  187. package/dist/internal/outbound/create.d.ts +16 -0
  188. package/dist/internal/outbound/handles.d.ts +7 -0
  189. package/dist/internal/outbound/native.d.ts +4 -0
  190. package/dist/internal/outbound/operation-shared.d.ts +28 -0
  191. package/dist/internal/outbound/operations-account.d.ts +29 -0
  192. package/dist/internal/outbound/operations.d.ts +42 -0
  193. package/dist/internal/outbound/outbound.d.ts +64 -0
  194. package/dist/internal/outbound/plugins.d.ts +40 -0
  195. package/dist/internal/outbound/raw.d.ts +9 -0
  196. package/dist/internal/outbound/specs-account.d.ts +16 -0
  197. package/dist/internal/outbound/specs.d.ts +14 -0
  198. package/dist/internal/outbound/stats.d.ts +7 -0
  199. package/dist/internal/outbound/validate.d.ts +5 -0
  200. package/dist/internal/outbound/walker.d.ts +22 -0
  201. package/dist/internal/record.d.ts +19 -0
  202. package/dist/internal/redact.d.ts +18 -0
  203. package/dist/internal/ref.d.ts +16 -0
  204. package/dist/internal/sha256.d.ts +4 -0
  205. package/dist/internal/text.d.ts +11 -0
  206. package/dist/internal/url.d.ts +9 -0
  207. package/dist/loader/index.d.ts +12 -0
  208. package/dist/loader/index.js +12 -0
  209. package/dist/memory/account-reads.d.ts +5 -0
  210. package/dist/memory/account.d.ts +67 -0
  211. package/dist/memory/adapter.d.ts +16 -0
  212. package/dist/memory/data.d.ts +122 -0
  213. package/dist/memory/demo.d.ts +7 -0
  214. package/dist/memory/index.d.ts +5 -0
  215. package/dist/memory/index.js +792 -0
  216. package/dist/memory/stats.d.ts +6 -0
  217. package/dist/memory/store.d.ts +18 -0
  218. package/dist/providers/index.d.ts +22 -0
  219. package/dist/providers/index.js +10 -0
  220. package/dist/reconcile/index.d.ts +2 -0
  221. package/dist/reconcile/index.js +72 -0
  222. package/dist/reconcile/plugin.d.ts +55 -0
  223. package/dist/redact/index.d.ts +2 -0
  224. package/dist/redact/index.js +192 -0
  225. package/dist/redact/plugin.d.ts +22 -0
  226. package/dist/redis/index.d.ts +41 -0
  227. package/dist/redis/index.js +114 -0
  228. package/dist/smartlead/account.d.ts +5 -0
  229. package/dist/smartlead/adapter.d.ts +5 -0
  230. package/dist/smartlead/capabilities.d.ts +85 -0
  231. package/dist/smartlead/client.d.ts +23 -0
  232. package/dist/smartlead/hmac.d.ts +9 -0
  233. package/dist/smartlead/index.d.ts +17 -0
  234. package/dist/smartlead/index.js +2170 -0
  235. package/dist/smartlead/leads.d.ts +6 -0
  236. package/dist/smartlead/lookup.d.ts +8 -0
  237. package/dist/smartlead/mail.d.ts +5 -0
  238. package/dist/smartlead/map-account.d.ts +22 -0
  239. package/dist/smartlead/map-messages.d.ts +31 -0
  240. package/dist/smartlead/map-stats.d.ts +37 -0
  241. package/dist/smartlead/map.d.ts +52 -0
  242. package/dist/smartlead/native-analytics.d.ts +242 -0
  243. package/dist/smartlead/native-campaigns.d.ts +211 -0
  244. package/dist/smartlead/native-inbox.d.ts +141 -0
  245. package/dist/smartlead/native-params.d.ts +33 -0
  246. package/dist/smartlead/native-services.d.ts +204 -0
  247. package/dist/smartlead/native.d.ts +785 -0
  248. package/dist/smartlead/shared.d.ts +28 -0
  249. package/dist/smartlead/stats.d.ts +5 -0
  250. package/dist/smartlead/webhooks.d.ts +2 -0
  251. package/dist/sync/index.d.ts +2 -0
  252. package/dist/sync/index.js +158 -0
  253. package/dist/sync/plugin.d.ts +58 -0
  254. package/dist/tools/account-tools.d.ts +21 -0
  255. package/dist/tools/ai-sdk.d.ts +8 -0
  256. package/dist/tools/ai-sdk.js +26 -0
  257. package/dist/tools/campaign-tools.d.ts +59 -0
  258. package/dist/tools/claude-agent.d.ts +18 -0
  259. package/dist/tools/claude-agent.js +40 -0
  260. package/dist/tools/index.d.ts +28 -0
  261. package/dist/tools/index.js +20 -0
  262. package/dist/tools/people-tools.d.ts +19 -0
  263. package/dist/tools/registry.d.ts +34 -0
  264. package/dist/tools/shared.d.ts +75 -0
  265. package/dist/tracing/index.d.ts +25 -0
  266. package/dist/tracing/index.js +69 -0
  267. package/dist/webhooks/index.d.ts +3 -0
  268. package/dist/webhooks/index.js +226 -0
  269. package/dist/webhooks/parse.d.ts +41 -0
  270. package/dist/webhooks/secret.d.ts +4 -0
  271. package/package.json +181 -4
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ import type { SenderHealth } from "../../internal/entities-account.ts";
3
+ import type { Campaign, CampaignStatus, Sender } from "../../internal/entities.ts";
4
+ import type { ListAll } from "../../internal/outbound/api.ts";
5
+ import type { InsightContext } from "../define.ts";
6
+ export declare const statusesInput: z.ZodDefault<z.ZodArray<z.ZodEnum<{
7
+ active: "active";
8
+ archived: "archived";
9
+ completed: "completed";
10
+ draft: "draft";
11
+ paused: "paused";
12
+ unknown: "unknown";
13
+ }>>>;
14
+ export declare const dayInput: (what: string) => z.ZodOptional<z.ZodString>;
15
+ /** Walks a listing up to `max` records, and says so in a note when more exist. */
16
+ export declare const readCapped: <Item>(context: InsightContext, walk: (max: number) => ListAll<Item>, max: number, what: string) => Promise<Item[]>;
17
+ /** The campaigns in the given statuses, up to `max`. */
18
+ export declare const readCampaigns: (context: InsightContext, statuses: readonly CampaignStatus[], max: number) => Promise<Campaign[]>;
19
+ /** The senders attached to one campaign, up to `max`. */
20
+ export declare const readCampaignSenders: (context: InsightContext, campaign: Campaign, max: number) => Promise<Sender[]>;
21
+ /** The part after the `@`, lowercased. `null` for a LinkedIn seat. */
22
+ export declare const domainOf: (address: string | null) => string | null;
23
+ export declare const DNS_RECORDS: readonly ["spf", "dkim", "dmarc", "mx"];
24
+ export type DnsRecord = (typeof DNS_RECORDS)[number];
25
+ /** The DNS records the vendor reports as missing or invalid. */
26
+ export declare const failingDns: (health: SenderHealth) => DnsRecord[];
27
+ /** The DNS records the vendor says nothing about. */
28
+ export declare const unknownDns: (health: SenderHealth) => DnsRecord[];
29
+ export interface WarmupSpam {
30
+ /** Warmup emails counted: those sent, or inbox plus spam when sent is not reported. */
31
+ readonly sent: number;
32
+ readonly spam: number;
33
+ }
34
+ /** Warmup emails that landed in spam and the number they are counted against, or `null` when either is unknown. */
35
+ export declare const warmupSpam: (health: SenderHealth) => WarmupSpam | null;
36
+ /** Today in UTC, plus or minus whole days, as `YYYY-MM-DD`. */
37
+ export declare const dayFrom: (now: number, offsetDays: number) => string;
@@ -0,0 +1,67 @@
1
+ export interface CapacityTotals {
2
+ /** The sum of the daily limits of active senders. `null` when no active sender reports one. */
3
+ readonly daily: number | null;
4
+ readonly mailboxDaily: number | null;
5
+ readonly linkedinDaily: number | null;
6
+ readonly activeSenders: number;
7
+ /** Active senders whose limit is counted in `daily`. */
8
+ readonly withLimit: number;
9
+ /** Active senders with no reported limit. They are not counted as 0. */
10
+ readonly withoutLimit: number;
11
+ readonly inactiveSenders: number;
12
+ }
13
+ export interface CapacityAsk {
14
+ /** The sum of the daily limits of active campaigns. `null` when none reports one. */
15
+ readonly daily: number | null;
16
+ readonly campaigns: number;
17
+ readonly withLimit: number;
18
+ readonly withoutLimit: number;
19
+ }
20
+ export interface CapacitySends {
21
+ /** Messages sent in the window divided by its days. A day the vendor has no row for counts as no sends. */
22
+ readonly averageDaily: number | null;
23
+ readonly total: number | null;
24
+ readonly days: number;
25
+ /** Days in the window the vendor reported a sent count for. */
26
+ readonly daysWithData: number;
27
+ readonly from: string;
28
+ readonly to: string;
29
+ /** `campaigns` when the sends were added up over the active campaigns read. */
30
+ readonly scope: "campaigns" | "workspace";
31
+ }
32
+ export interface ShortCampaign {
33
+ readonly campaign: string;
34
+ readonly name: string;
35
+ readonly dailyLimit: number;
36
+ /** The sum of the daily limits of the campaign's active senders. A sender shared with another campaign is counted in full. */
37
+ readonly senderCapacity: number;
38
+ readonly shortBy: number;
39
+ readonly senders: number;
40
+ readonly activeSenders: number;
41
+ readonly finding: string;
42
+ }
43
+ export interface SenderCapacity {
44
+ readonly finding: string;
45
+ readonly capacity: CapacityTotals;
46
+ /** `null` when the adapter cannot read campaign settings. */
47
+ readonly ask: CapacityAsk | null;
48
+ /** `null` when the adapter has no daily stats. */
49
+ readonly sends: CapacitySends | null;
50
+ /** Average daily sends divided by daily capacity. */
51
+ readonly utilization: number | null;
52
+ /** The daily ask divided by daily capacity. Over 1 means the campaigns ask for more than the senders can send. */
53
+ readonly askRatio: number | null;
54
+ /** Campaigns whose own senders cannot cover their daily limit, largest gap first. `null` when it could not be checked. */
55
+ readonly shortCampaigns: readonly ShortCampaign[] | null;
56
+ /** Campaigns left out of `shortCampaigns` because a limit is not reported. */
57
+ readonly uncheckedCampaigns: number | null;
58
+ }
59
+ export declare const senderCapacity: import("../define.ts").InsightDefinition<"senderCapacity", {
60
+ days: number;
61
+ max_campaigns: number;
62
+ max_senders: number;
63
+ }, SenderCapacity, {
64
+ days?: number | undefined;
65
+ max_campaigns?: number | undefined;
66
+ max_senders?: number | undefined;
67
+ }>;
@@ -0,0 +1,52 @@
1
+ export interface LoadedSender {
2
+ readonly sender: string;
3
+ readonly address: string | null;
4
+ readonly name: string | null;
5
+ readonly status: string;
6
+ readonly dailyLimit: number | null;
7
+ }
8
+ export interface OverusedSender extends LoadedSender {
9
+ /** How many of the campaigns read the sender is attached to. */
10
+ readonly campaigns: number;
11
+ readonly over: number;
12
+ readonly campaignRefs: readonly string[];
13
+ readonly finding: string;
14
+ }
15
+ export type CampaignSenderIssue = "inactive_sender" | "no_sender" | "single_sender";
16
+ export interface CampaignSenderRisk {
17
+ readonly campaign: string;
18
+ readonly name: string;
19
+ readonly senders: number;
20
+ readonly issues: readonly CampaignSenderIssue[];
21
+ /** The campaign's senders whose status is not active. */
22
+ readonly inactive: readonly LoadedSender[];
23
+ readonly finding: string;
24
+ }
25
+ export interface SenderLoad {
26
+ /** Senders in more campaigns than allowed, the most loaded first. */
27
+ readonly overused: readonly OverusedSender[];
28
+ /** Active senders attached to none of the campaigns read. */
29
+ readonly unused: readonly LoadedSender[];
30
+ /** Campaigns with no sender, one sender, or a sender that is not active. */
31
+ readonly campaigns: readonly CampaignSenderRisk[];
32
+ readonly totals: {
33
+ readonly senders: number;
34
+ readonly activeSenders: number;
35
+ readonly campaigns: number;
36
+ readonly overused: number;
37
+ readonly unused: number;
38
+ readonly campaignsAtRisk: number;
39
+ };
40
+ readonly maxCampaignsPerSender: number;
41
+ }
42
+ export declare const senderLoad: import("../define.ts").InsightDefinition<"senderLoad", {
43
+ max_campaigns: number;
44
+ max_campaigns_per_sender: number;
45
+ max_senders: number;
46
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
47
+ }, SenderLoad, {
48
+ max_campaigns?: number | undefined;
49
+ max_campaigns_per_sender?: number | undefined;
50
+ max_senders?: number | undefined;
51
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
52
+ }>;
@@ -0,0 +1,48 @@
1
+ export type SettingsCheck = "click_tracking" | "end_date_passed" | "gap_short" | "limit_over_senders" | "no_daily_limit" | "no_timezone" | "no_window" | "open_tracking" | "reply_does_not_stop" | "weekend" | "window_long" | "window_short";
2
+ export type SettingsSeverity = "high" | "low" | "medium";
3
+ export interface SettingsFinding {
4
+ readonly check: SettingsCheck;
5
+ readonly severity: SettingsSeverity;
6
+ readonly finding: string;
7
+ /** The setting's value behind the finding, when it has one. */
8
+ readonly value: number | string | null;
9
+ }
10
+ export interface AuditedCampaign {
11
+ readonly campaign: string;
12
+ readonly name: string;
13
+ readonly status: string;
14
+ /** Most serious first. */
15
+ readonly findings: readonly SettingsFinding[];
16
+ }
17
+ export type SettingsCheckCounts = Readonly<Record<SettingsCheck, number>>;
18
+ export interface SettingsAudit {
19
+ /** Campaigns with at least one finding, the one with the most serious findings first. */
20
+ readonly campaigns: readonly AuditedCampaign[];
21
+ /** How many campaigns each check flagged. */
22
+ readonly byCheck: SettingsCheckCounts;
23
+ readonly totals: {
24
+ readonly campaigns: number;
25
+ readonly withFindings: number;
26
+ readonly clean: number;
27
+ readonly high: number;
28
+ readonly medium: number;
29
+ readonly low: number;
30
+ };
31
+ }
32
+ export declare const settingsAudit: import("../define.ts").InsightDefinition<"settingsAudit", {
33
+ max_campaigns: number;
34
+ max_daily_limit_per_sender: number;
35
+ max_senders_per_campaign: number;
36
+ max_window_hours: number;
37
+ min_gap_minutes: number;
38
+ min_window_hours: number;
39
+ statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
40
+ }, SettingsAudit, {
41
+ max_campaigns?: number | undefined;
42
+ max_daily_limit_per_sender?: number | undefined;
43
+ max_senders_per_campaign?: number | undefined;
44
+ max_window_hours?: number | undefined;
45
+ min_gap_minutes?: number | undefined;
46
+ min_window_hours?: number | undefined;
47
+ statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
48
+ }>;
@@ -0,0 +1,39 @@
1
+ export declare const READINESS_REASONS: readonly ["not_active", "warmup_off", "score_low", "score_unknown", "no_daily_limit", "dns_failing", "warmup_spam_high"];
2
+ export type ReadinessReason = (typeof READINESS_REASONS)[number];
3
+ export interface UnreadySender {
4
+ readonly sender: string;
5
+ readonly kind: "linkedin" | "mailbox";
6
+ readonly address: string | null;
7
+ readonly name: string | null;
8
+ readonly status: string;
9
+ /** `null` when the vendor does not say. */
10
+ readonly warmupEnabled: boolean | null;
11
+ readonly score: number | null;
12
+ readonly dailyLimit: number | null;
13
+ readonly reasons: readonly ReadinessReason[];
14
+ /** Each reason in plain words, with the number behind it. */
15
+ readonly findings: readonly string[];
16
+ }
17
+ export type ReadinessCounts = Readonly<Record<ReadinessReason, number>>;
18
+ export interface WarmupReadiness {
19
+ /** Senders that are not ready, the one with the most reasons first. */
20
+ readonly notReady: readonly UnreadySender[];
21
+ readonly byReason: ReadinessCounts;
22
+ readonly ready: number;
23
+ readonly total: number;
24
+ /** LinkedIn seats among the senders. They are judged on status only. */
25
+ readonly linkedinSeats: number;
26
+ /** `true` when DNS records and warmup spam were checked too. */
27
+ readonly healthChecked: boolean;
28
+ }
29
+ export declare const warmupReadiness: import("../define.ts").InsightDefinition<"warmupReadiness", {
30
+ check_health: boolean;
31
+ max_senders: number;
32
+ max_spam_rate: number;
33
+ min_score: number;
34
+ }, WarmupReadiness, {
35
+ check_health?: boolean | undefined;
36
+ max_senders?: number | undefined;
37
+ max_spam_rate?: number | undefined;
38
+ min_score?: number | undefined;
39
+ }>;
@@ -0,0 +1,45 @@
1
+ /** Rounds to four decimal places. `null` stays `null`. */
2
+ export declare const round: (value: number | null) => number | null;
3
+ /** `part / whole`, or `null` when either is unknown or the whole is zero. */
4
+ export declare const rate: (part: number | null, whole: number | null) => number | null;
5
+ /** Adds the known values. `null` when none is known. */
6
+ export declare const total: (values: readonly (number | null)[]) => number | null;
7
+ export declare const mean: (values: readonly number[]) => number | null;
8
+ /** The value below which `fraction` of the values fall, by linear interpolation. */
9
+ export declare const percentile: (values: readonly number[], fraction: number) => number | null;
10
+ export declare const median: (values: readonly number[]) => number | null;
11
+ /** The sample standard deviation. `null` with fewer than two values. */
12
+ export declare const deviation: (values: readonly number[]) => number | null;
13
+ /** How many standard deviations `value` sits from the mean of `history`. */
14
+ export declare const zScore: (value: number, history: readonly number[]) => number | null;
15
+ export interface Interval {
16
+ readonly low: number;
17
+ readonly high: number;
18
+ }
19
+ /**
20
+ * The Wilson score interval for a rate at 95% confidence. Unlike the raw
21
+ * rate it stays honest on small samples: 2 replies from 10 sends gets a wide
22
+ * interval, 200 from 1,000 a narrow one.
23
+ */
24
+ export declare const wilson: (successes: number | null, trials: number | null) => Interval | null;
25
+ export interface ProportionTest {
26
+ /** Positive when the first rate is higher. */
27
+ readonly z: number;
28
+ /** Two-sided. Below 0.05 is the usual bar for "not chance". */
29
+ readonly pValue: number;
30
+ readonly significant: boolean;
31
+ }
32
+ export interface Sample {
33
+ readonly successes: number | null;
34
+ readonly trials: number | null;
35
+ }
36
+ /**
37
+ * The two-proportion z-test: is the difference between two rates more than
38
+ * chance would give? `null` when either side has no trials or both rates are
39
+ * 0 or 1.
40
+ */
41
+ export declare const compareRates: (first: Sample, second: Sample, alpha?: number) => ProportionTest | null;
42
+ /** A p-value for a sentence. One that rounds to 0 is written `p < 0.0001`, never `p = 0`. */
43
+ export declare const pText: (pValue: number) => string;
44
+ /** Counts how often each value occurs, in first-seen order. */
45
+ export declare const tally: <Value>(values: readonly Value[]) => Map<Value, number>;
@@ -0,0 +1,16 @@
1
+ import type { OutboundApi } from "../internal/outbound/api.ts";
2
+ import type { OutboundTool } from "../tools/index.ts";
3
+ export interface InsightToolsOptions {
4
+ /** Offer only these insights, by tool name. Defaults to every one the adapter can serve. */
5
+ readonly only?: readonly string[] | undefined;
6
+ }
7
+ /**
8
+ * The insights this instance can serve, as tools. An insight whose adapter
9
+ * lacks a capability it needs is left out, so a model is never offered a tool
10
+ * that cannot work.
11
+ *
12
+ * ```ts
13
+ * openaiTools(outbound, { extra: insightTools(outbound) });
14
+ * ```
15
+ */
16
+ export declare const insightTools: (outbound: OutboundApi, options?: InsightToolsOptions) => OutboundTool[];
@@ -0,0 +1,4 @@
1
+ export type { CheckCount, CheckName, CopyAudit, CopyFinding, CopyPiece, CopyReuse, CopyUse, FunnelStep, FunnelVariant, HourCount, ReplyTiming, ReusedCopy, Severity, StepFunnel, TestedVariant, TimeTable, VariantStepTest, VariantTest, VariantVerdict, WeekdayCount, } from "./copy/index.ts";
2
+ export type { ActionItem, Anomalies, Anomaly, AnomalyMetric, BounceProblem, CampaignComparison, CampaignDiagnosis, CampaignLabel, CampaignRanking, ChannelComparison, ChannelGroup, ChannelMix, ClientReport, Comparison, DayRange, DiagnosisCode, DiagnosisFinding, Estimate, LeadRunway, Measured, MetricCoverage, OpenRange, PeriodComparison, PeriodNumbers, PipelineForecast, ProviderGroup, RankedCampaign, RankingGap, RankingMetric, Rates, TagGroup, TagRollup, ThinCampaign, Totals, UnrankedCampaign, } from "./ops/index.ts";
3
+ export type { AccountPerson, AccountRecord, AccountSummary, CollisionCampaign, CopyVariable, DroppedReplies, DroppedReply, GapLead, HotLead, HotLeadParts, HotLeads, LeadCollision, LeadCollisions, PersonCampaign, PersonSummary, PersonalizationGaps, SuppressionCampaign, SuppressionCheck, SuppressionMatch, SuppressionViolation, VariableUse, } from "./people/index.ts";
4
+ export type { AuditedCampaign, BounceCampaign, BounceCounts, BounceSender, BounceUnknown, BounceWatch, CampaignSenderIssue, CampaignSenderRisk, CapacityAsk, CapacitySends, CapacityTotals, DnsRecord, DomainHealth, DomainMailbox, DomainReport, DomainRisk, DomainWarmup, LinkedinSeat, LoadedSender, OverusedSender, ReadinessCounts, ReadinessReason, SenderCapacity, SenderLoad, SettingsAudit, SettingsCheck, SettingsCheckCounts, SettingsFinding, SettingsSeverity, ShortCampaign, UnreadySender, WarmupReadiness, } from "./senders/index.ts";
@@ -0,0 +1,5 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { InstantlyClient } from "./client.ts";
3
+ type AccountReaders = Pick<Adapter, "getCampaignSettings" | "getSenderHealth" | "listBlocklist" | "listLists" | "listSubsequences" | "listTags" | "listWebhooks">;
4
+ export declare const accountReaders: (client: InstantlyClient) => AccountReaders;
5
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { InstantlyClient } from "./client.ts";
3
+ export declare const mailReaders: (client: InstantlyClient) => Pick<Adapter, "listMessages" | "listReplies">;
@@ -0,0 +1,7 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import { accountReaders } from "./adapter-account.ts";
3
+ import { mailReaders } from "./adapter-mail.ts";
4
+ import type { InstantlyClient } from "./client.ts";
5
+ type Readers = Pick<Adapter, "getCampaign" | "getLead" | "getSender" | "getSequence" | "listCampaigns" | "listLeads" | "listSenders" | "listWorkspaces" | "stats">;
6
+ export declare const readers: (client: InstantlyClient) => Readers & ReturnType<typeof accountReaders> & ReturnType<typeof mailReaders>;
7
+ export {};
@@ -0,0 +1,83 @@
1
+ import type { CapabilityDeclaration } from "../internal/capabilities.ts";
2
+ import type { LimitDeclaration } from "../internal/limits.ts";
3
+ export declare const BASE_URL = "https://api.instantly.ai/api/v2";
4
+ export declare const API_KEY_ENV = "INSTANTLY_API_KEY";
5
+ export declare const WORKSPACE_ENV = "INSTANTLY_WORKSPACE_ID";
6
+ /** `GET /emails` has its own limit, far below the workspace limit. */
7
+ export declare const EMAILS_LANE = "emails";
8
+ export declare const PAGE_SIZE = 100;
9
+ /** Three native reads have a limit of their own; each is a lane. */
10
+ export declare const LABEL_PREDICTION_LANE = "labelPrediction";
11
+ export declare const LOCAL_FILTERS_LANE = "localBusinessFilters";
12
+ export declare const LOCAL_SEARCH_LANE = "localBusinessSearch";
13
+ /** How many pages of tag assignments are read for one page of campaigns. */
14
+ export declare const TAG_PAGES = 10;
15
+ export declare const capabilities: CapabilityDeclaration;
16
+ export declare const limits: LimitDeclaration;
17
+ export declare const costs: {
18
+ "blocklist.list": {
19
+ pageSize: number;
20
+ perPage: number;
21
+ };
22
+ "campaigns.get": {
23
+ perPage: number;
24
+ };
25
+ "campaigns.list": {
26
+ pageSize: number;
27
+ perPage: number;
28
+ };
29
+ "campaigns.settings": {
30
+ perPage: number;
31
+ };
32
+ "leads.get": {
33
+ perPage: number;
34
+ };
35
+ "leads.list": {
36
+ pageSize: number;
37
+ perPage: number;
38
+ };
39
+ "lists.list": {
40
+ pageSize: number;
41
+ perPage: number;
42
+ };
43
+ "messages.list": {
44
+ pageSize: number;
45
+ perPage: number;
46
+ };
47
+ "replies.list": {
48
+ pageSize: number;
49
+ perPage: number;
50
+ };
51
+ "senders.get": {
52
+ perPage: number;
53
+ };
54
+ "senders.health": {
55
+ perPage: number;
56
+ };
57
+ "senders.list": {
58
+ pageSize: number;
59
+ perPage: number;
60
+ };
61
+ "sequence.get": {
62
+ perPage: number;
63
+ };
64
+ "sequence.subsequences": {
65
+ pageSize: number;
66
+ perPage: number;
67
+ };
68
+ stats: {
69
+ perPage: number;
70
+ };
71
+ "tags.list": {
72
+ pageSize: number;
73
+ perPage: number;
74
+ };
75
+ "webhooks.list": {
76
+ pageSize: number;
77
+ perPage: number;
78
+ };
79
+ "workspaces.list": {
80
+ perPage: number;
81
+ };
82
+ };
83
+ export declare const caveats: readonly string[];
@@ -0,0 +1,29 @@
1
+ import type { AdapterContext, HttpMethod, RawDescriptor } from "../internal/adapter.ts";
2
+ import type { Json, JsonObject } from "../internal/json.ts";
3
+ import type { Identity } from "../internal/record.ts";
4
+ import type { QueryValue } from "../internal/url.ts";
5
+ export interface ClientOptions {
6
+ readonly apiKey: string;
7
+ readonly baseUrl: string | undefined;
8
+ /** A sub workspace to act as, for an agency's admin workspace key. */
9
+ readonly asWorkspace: string | undefined;
10
+ readonly identity: Identity;
11
+ readonly readTags: boolean;
12
+ }
13
+ export interface GetOptions {
14
+ readonly query?: Readonly<Record<string, QueryValue>> | undefined;
15
+ readonly lane?: string | undefined;
16
+ }
17
+ export interface InstantlyClient {
18
+ readonly identity: Identity;
19
+ readonly raw: RawDescriptor;
20
+ readonly get: (ctx: AdapterContext, path: string, options?: GetOptions) => Promise<Json>;
21
+ readonly post: (ctx: AdapterContext, path: string, body: JsonObject) => Promise<Json>;
22
+ /** `false` when the caller turned the `tags` capability off. */
23
+ readonly readTags: boolean;
24
+ /** `get`, for an endpoint that returns one object. */
25
+ readonly getObject: (ctx: AdapterContext, path: string, options?: GetOptions) => Promise<JsonObject>;
26
+ }
27
+ export declare const isSecret: (path: string, query: URLSearchParams) => boolean;
28
+ export declare const isRead: (method: HttpMethod, path: string) => boolean;
29
+ export declare const createClient: (options: ClientOptions) => InstantlyClient;
@@ -0,0 +1,20 @@
1
+ import type { Adapter } from "../internal/adapter.ts";
2
+ import type { CapabilityDeclaration } from "../internal/capabilities.ts";
3
+ import type { InstantlyNative } from "./native.ts";
4
+ export declare const PROVIDER = "instantly";
5
+ export { NATIVE } from "./native.ts";
6
+ export type { InstantlyNative } from "./native.ts";
7
+ /** The environment variables this adapter reads. */
8
+ export declare const envVars: readonly ["INSTANTLY_API_KEY", "INSTANTLY_WORKSPACE_ID"];
9
+ export interface InstantlyOptions {
10
+ /** Defaults to `INSTANTLY_API_KEY`. A key with the `all:read` scope is enough. */
11
+ readonly apiKey?: string | undefined;
12
+ /** A label for this client or workspace. Defaults to `INSTANTLY_WORKSPACE_ID`, then `default`. */
13
+ readonly workspaceId?: string | undefined;
14
+ /** For an agency's admin workspace key: the sub workspace to act as. */
15
+ readonly asWorkspace?: string | undefined;
16
+ readonly baseUrl?: string | undefined;
17
+ /** Overrides what the adapter declares, for example on a plan without webhooks. */
18
+ readonly capabilities?: CapabilityDeclaration | undefined;
19
+ }
20
+ export declare const instantly: (options?: InstantlyOptions) => Adapter<InstantlyNative>;