outbound-sdk 0.5.0 → 0.7.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 (130) hide show
  1. package/dist/alerts/check-schema.d.ts +1 -1
  2. package/dist/alerts/index.js +6 -6
  3. package/dist/audit/index.js +2 -2
  4. package/dist/benchmarks/index.js +4 -4
  5. package/dist/budget/index.js +2 -2
  6. package/dist/cards/format.d.ts +1 -1
  7. package/dist/cards/index.js +101 -62
  8. package/dist/cards/parts.d.ts +1 -6
  9. package/dist/chunks/{chunk-BLCJHP5H.js → chunk-45TXPJW7.js} +1 -0
  10. package/dist/chunks/chunk-4AVYRVN5.js +239 -0
  11. package/dist/chunks/{chunk-YYCT3NGV.js → chunk-65YAGEWZ.js} +24 -7
  12. package/dist/chunks/{chunk-BN6WCAWX.js → chunk-7I3EPR23.js} +3 -3
  13. package/dist/chunks/{chunk-3S32R2MH.js → chunk-BNDHEDHD.js} +2 -53
  14. package/dist/chunks/chunk-DNPNTD5W.js +81 -0
  15. package/dist/chunks/chunk-FALWG5U3.js +56 -0
  16. package/dist/chunks/{chunk-OLPMBRXM.js → chunk-GL7BABF2.js} +2 -2
  17. package/dist/chunks/{chunk-ZOAG2C6V.js → chunk-HIAK2GCI.js} +9 -2
  18. package/dist/chunks/{chunk-6TKFISG4.js → chunk-I7DXXGNZ.js} +42 -9
  19. package/dist/chunks/{chunk-BK5SLY32.js → chunk-JRL3QRBS.js} +264 -76
  20. package/dist/chunks/{chunk-EHSJGQ5K.js → chunk-KTYTE2BU.js} +4 -3
  21. package/dist/chunks/{chunk-JWGSB7PT.js → chunk-LD6F46UT.js} +2 -2
  22. package/dist/chunks/{chunk-2D42TQFU.js → chunk-LVZGIKNF.js} +2 -2
  23. package/dist/chunks/{chunk-PQSTQKRD.js → chunk-M2VXGLLZ.js} +35 -2
  24. package/dist/chunks/{chunk-5J7GGV62.js → chunk-MW4C6LTN.js} +2 -2
  25. package/dist/chunks/chunk-OK3GAZMT.js +51 -0
  26. package/dist/chunks/{chunk-BOWXGMN3.js → chunk-POBAY3TI.js} +80 -4
  27. package/dist/chunks/{chunk-J7DDZ4C2.js → chunk-QFC4ZHD3.js} +1 -1
  28. package/dist/chunks/{chunk-GFDNRWR3.js → chunk-UFQ4WMLU.js} +1 -1
  29. package/dist/chunks/{chunk-WGW3ROLY.js → chunk-Y7KECJAV.js} +1 -1
  30. package/dist/chunks/{chunk-QAKJ76HB.js → chunk-YW6FFVSZ.js} +1 -1
  31. package/dist/chunks/{chunk-X4RDBD4J.js → chunk-ZJCVLBAE.js} +445 -119
  32. package/dist/cli/bin.js +14 -14
  33. package/dist/cli/by-name.d.ts +28 -0
  34. package/dist/cli/commands.d.ts +2 -1
  35. package/dist/cli/config.d.ts +3 -2
  36. package/dist/cli/envelope.d.ts +50 -0
  37. package/dist/cli/index.d.ts +3 -0
  38. package/dist/cli/index.js +13 -13
  39. package/dist/cli/listing.d.ts +13 -0
  40. package/dist/cli/native.d.ts +4 -0
  41. package/dist/cli/options.d.ts +88 -0
  42. package/dist/cli/output.d.ts +21 -0
  43. package/dist/cli/suggest.d.ts +10 -0
  44. package/dist/clients/index.js +6 -6
  45. package/dist/combine/index.js +7 -7
  46. package/dist/emailbison/capabilities.d.ts +1 -0
  47. package/dist/emailbison/index.js +38 -13
  48. package/dist/emailbison/map-stats.d.ts +10 -0
  49. package/dist/exporter/index.js +2 -2
  50. package/dist/failover/index.js +2 -2
  51. package/dist/fixtures/index.js +4 -4
  52. package/dist/heyreach/capabilities.d.ts +3 -0
  53. package/dist/heyreach/index.js +36 -12
  54. package/dist/heyreach/map-account.d.ts +2 -2
  55. package/dist/identity/index.js +2 -2
  56. package/dist/index.js +9 -7
  57. package/dist/insights/copy/audit-samples.d.ts +24 -0
  58. package/dist/insights/copy/audit-variant.d.ts +34 -0
  59. package/dist/insights/copy/copy-audit.d.ts +26 -12
  60. package/dist/insights/copy/copy-preview.d.ts +71 -0
  61. package/dist/insights/copy/copy-reuse.d.ts +0 -13
  62. package/dist/insights/copy/index.d.ts +15 -0
  63. package/dist/insights/copy/reply-timing.d.ts +4 -0
  64. package/dist/insights/copy/reuse-base.d.ts +0 -2
  65. package/dist/insights/copy/shared.d.ts +7 -9
  66. package/dist/insights/copy/step-funnel.d.ts +21 -18
  67. package/dist/insights/copy/variant-test.d.ts +2 -8
  68. package/dist/insights/index.js +1357 -717
  69. package/dist/insights/inputs.generated.d.ts +67 -34
  70. package/dist/insights/ops/campaign-diagnosis.d.ts +2 -2
  71. package/dist/insights/ops/client-report.d.ts +0 -2
  72. package/dist/insights/ops/diagnosis-checks.d.ts +20 -1
  73. package/dist/insights/ops/index.d.ts +2 -4
  74. package/dist/insights/ops/pipeline-forecast.d.ts +17 -6
  75. package/dist/insights/ops/shared.d.ts +0 -2
  76. package/dist/insights/people/account-summary.d.ts +14 -1
  77. package/dist/insights/people/auto-replies.d.ts +14 -0
  78. package/dist/insights/people/dropped-replies.d.ts +1 -1
  79. package/dist/insights/people/hot-leads.d.ts +5 -1
  80. package/dist/insights/people/index.d.ts +4 -0
  81. package/dist/insights/people/lead-collisions.d.ts +11 -2
  82. package/dist/insights/people/person-summary.d.ts +19 -3
  83. package/dist/insights/people/personalization-gaps.d.ts +14 -8
  84. package/dist/insights/people/suppression-check.d.ts +9 -0
  85. package/dist/insights/registry.d.ts +20 -8
  86. package/dist/insights/senders/bounce-watch.d.ts +0 -11
  87. package/dist/insights/senders/domain-health.d.ts +0 -7
  88. package/dist/insights/senders/index.d.ts +0 -4
  89. package/dist/insights/senders/sender-load.d.ts +0 -2
  90. package/dist/insights/step.d.ts +15 -0
  91. package/dist/insights/types.d.ts +1 -1
  92. package/dist/insights/variables.d.ts +35 -0
  93. package/dist/instantly/capabilities.d.ts +4 -0
  94. package/dist/instantly/index.js +265 -53
  95. package/dist/instantly/map-stats.d.ts +4 -0
  96. package/dist/instantly/stats-tracking.d.ts +19 -0
  97. package/dist/instantly/thread.d.ts +9 -0
  98. package/dist/internal/adapter.d.ts +5 -0
  99. package/dist/internal/auto-reply.d.ts +20 -0
  100. package/dist/internal/capabilities.d.ts +2 -0
  101. package/dist/internal/entities-account.d.ts +1 -0
  102. package/dist/internal/entities.d.ts +79 -2
  103. package/dist/internal/fields.d.ts +37 -1
  104. package/dist/internal/metrics.d.ts +23 -1
  105. package/dist/internal/outbound/api.d.ts +2 -0
  106. package/dist/internal/records.d.ts +2 -2
  107. package/dist/internal/reply-people.d.ts +37 -0
  108. package/dist/internal/runway.d.ts +42 -0
  109. package/dist/internal/sender-screen.d.ts +9 -0
  110. package/dist/internal/tracking.d.ts +33 -0
  111. package/dist/loader/index.js +4 -4
  112. package/dist/memory/data.d.ts +2 -1
  113. package/dist/memory/index.js +23 -12
  114. package/dist/redact/index.js +3 -3
  115. package/dist/smartlead/capabilities.d.ts +4 -0
  116. package/dist/smartlead/index.js +154 -38
  117. package/dist/smartlead/map-account.d.ts +3 -0
  118. package/dist/smartlead/stats-tracking.d.ts +22 -0
  119. package/dist/sync/index.js +2 -2
  120. package/dist/tools/ai-sdk.js +8 -7
  121. package/dist/tools/by-name.d.ts +18 -0
  122. package/dist/tools/campaign-tools.d.ts +6 -2
  123. package/dist/tools/claude-agent.js +8 -7
  124. package/dist/tools/index.js +9 -8
  125. package/dist/tools/shared.d.ts +7 -0
  126. package/dist/tracing/index.js +2 -2
  127. package/dist/webhooks/index.js +12 -10
  128. package/package.json +1 -1
  129. package/dist/chunks/chunk-HWHI4LFY.js +0 -102
  130. package/dist/internal/renamed.d.ts +0 -28
@@ -50,6 +50,12 @@ export interface InsightInputs {
50
50
  };
51
51
  /** The input of `leadCollisions` (the `lead_collisions` tool). */
52
52
  readonly leadCollisions: {
53
+ /**
54
+ * Also report a person in two or more campaigns of whom fewer than two memberships are still active, for example one who completed one campaign and is now in another. By default only people active in two or more campaigns at once are reported.
55
+ *
56
+ * Defaults to `false`.
57
+ */
58
+ readonly include_past?: boolean | undefined;
53
59
  /**
54
60
  * The most campaigns to read. Each costs one request per page of its leads.
55
61
  *
@@ -71,6 +77,12 @@ export interface InsightInputs {
71
77
  };
72
78
  /** The input of `suppressionCheck` (the `suppression_check` tool). */
73
79
  readonly suppressionCheck: {
80
+ /**
81
+ * Only a matching lead in one of these states is a violation: active, paused, unknown (not yet started, or the tool does not say), completed, skipped (the tool decided never to send), replied, bounced or unsubscribed. Other matches are counted in totals.alreadyStopped. Defaults to the leads still being sent to.
82
+ *
83
+ * At least 1 item. Each one of `active`, `bounced`, `completed`, `paused`, `replied`, `skipped`, `unknown`, `unsubscribed`. Defaults to `["active","paused","unknown"]`.
84
+ */
85
+ readonly lead_statuses?: ("active" | "bounced" | "completed" | "paused" | "replied" | "skipped" | "unknown" | "unsubscribed")[] | undefined;
74
86
  /**
75
87
  * The most block list entries to read. A vendor request returns about 50 to 100.
76
88
  *
@@ -105,7 +117,7 @@ export interface InsightInputs {
105
117
  */
106
118
  readonly categories?: ("bounce" | "negative" | "neutral" | "ooo" | "positive" | "unknown" | "unsubscribe")[] | undefined;
107
119
  /**
108
- * Set to true to also check replies the vendor marks as automatic
120
+ * Set to true to also check replies flagged automatic, by the vendor or by a fixed rule
109
121
  *
110
122
  * Defaults to `false`.
111
123
  */
@@ -201,7 +213,7 @@ export interface InsightInputs {
201
213
  /** The input of `personalizationGaps` (the `personalization_gaps` tool). */
202
214
  readonly personalizationGaps: {
203
215
  /**
204
- * The campaign's ref (provider:workspace:id)
216
+ * The campaign's ref (provider:workspace:id) or name
205
217
  *
206
218
  * Not empty. Required.
207
219
  */
@@ -222,7 +234,7 @@ export interface InsightInputs {
222
234
  /** The input of `stepFunnel` (the `step_funnel` tool). */
223
235
  readonly stepFunnel: {
224
236
  /**
225
- * The campaign's ref, for example `instantly:acme:abc123`
237
+ * The campaign's ref, for example `instantly:acme:abc123`, or its name
226
238
  *
227
239
  * Not empty. Required.
228
240
  */
@@ -240,7 +252,7 @@ export interface InsightInputs {
240
252
  */
241
253
  readonly to?: string | null | undefined;
242
254
  /**
243
- * A step earns its place when the low end of its reply rate interval is above this. 0 asks only that the rate is reliably above zero.
255
+ * A step earns its place when the low end of its reply rate interval is above this and it has at least 5 replies. 0 asks only that the rate is reliably above zero.
244
256
  *
245
257
  * A number from 0 to 1. Defaults to `0`.
246
258
  */
@@ -255,7 +267,7 @@ export interface InsightInputs {
255
267
  */
256
268
  readonly alpha?: number | undefined;
257
269
  /**
258
- * The campaign's ref, for example `instantly:acme:abc123`
270
+ * The campaign's ref, for example `instantly:acme:abc123`, or its name
259
271
  *
260
272
  * Not empty. Required.
261
273
  */
@@ -288,7 +300,7 @@ export interface InsightInputs {
288
300
  /** The input of `copyAudit` (the `copy_audit` tool). */
289
301
  readonly copyAudit: {
290
302
  /**
291
- * The campaign's ref, for example `instantly:acme:abc123`
303
+ * The campaign's ref, for example `instantly:acme:abc123`, or its name
292
304
  *
293
305
  * Not empty. Required.
294
306
  */
@@ -323,12 +335,24 @@ export interface InsightInputs {
323
335
  * A whole number from 0 to 9,007,199,254,740,991. Defaults to `1`.
324
336
  */
325
337
  readonly max_links?: number | undefined;
338
+ /**
339
+ * The most leads to read when picking the samples. Read only when copy is written per lead.
340
+ *
341
+ * A whole number from 1 to 1000. Defaults to `100`.
342
+ */
343
+ readonly max_leads?: number | undefined;
326
344
  /**
327
345
  * The most characters a subject may have.
328
346
  *
329
347
  * A whole number from 0 to 9,007,199,254,740,991. Defaults to `60`.
330
348
  */
331
349
  readonly max_subject_chars?: number | undefined;
350
+ /**
351
+ * How many leads' rendered copy to audit when a subject or body is mostly variables, such as {{body_1}} filled from a custom field. The leads that fill the most of those variables are used. 0 audits the copy as stored only.
352
+ *
353
+ * A whole number from 0 to 20. Defaults to `3`.
354
+ */
355
+ readonly samples?: number | undefined;
332
356
  /**
333
357
  * Words and phrases to flag in email copy, matched whole and without case. Replaces the default list.
334
358
  *
@@ -336,6 +360,27 @@ export interface InsightInputs {
336
360
  */
337
361
  readonly spam_words?: string[] | undefined;
338
362
  };
363
+ /** The input of `copyPreview` (the `copy_preview` tool). */
364
+ readonly copyPreview: {
365
+ /**
366
+ * The campaign's ref, for example `instantly:acme:abc123`, or its name
367
+ *
368
+ * Not empty. Required.
369
+ */
370
+ readonly campaign: string;
371
+ /**
372
+ * The lead's ref to render the copy for. null picks the lead read with the most variables filled.
373
+ *
374
+ * Not empty. Defaults to `null`.
375
+ */
376
+ readonly lead?: string | null | undefined;
377
+ /**
378
+ * The most leads to read when picking one. Ignored when `lead` is given.
379
+ *
380
+ * A whole number from 1 to 1000. Defaults to `100`.
381
+ */
382
+ readonly max_leads?: number | undefined;
383
+ };
339
384
  /** The input of `copyReuse` (the `copy_reuse` tool). */
340
385
  readonly copyReuse: {
341
386
  /**
@@ -365,6 +410,12 @@ export interface InsightInputs {
365
410
  * Not empty. Defaults to `null`.
366
411
  */
367
412
  readonly campaign?: string | null | undefined;
413
+ /**
414
+ * Count replies flagged automatic (isAuto true), such as out-of-office messages and autoresponders. false leaves them out of every figure and counts them in counts.autoReplies.
415
+ *
416
+ * Defaults to `false`.
417
+ */
418
+ readonly include_auto?: boolean | undefined;
368
419
  /**
369
420
  * The most messages to read, sent and received together. A page of messages costs 1 request.
370
421
  *
@@ -398,12 +449,6 @@ export interface InsightInputs {
398
449
  * A number from 0 to 1. Defaults to `0.1`.
399
450
  */
400
451
  readonly max_spam_rate?: number | undefined;
401
- /**
402
- * @deprecated Renamed to `max_spam_rate`. Removed in 0.6.0.
403
- *
404
- * A number from 0 to 1.
405
- */
406
- readonly spam_rate_threshold?: number | undefined;
407
452
  };
408
453
  /** The input of `senderCapacity` (the `sender_capacity` tool). */
409
454
  readonly senderCapacity: {
@@ -476,12 +521,6 @@ export interface InsightInputs {
476
521
  * A whole number from 0 to 9,007,199,254,740,991. Defaults to `100`.
477
522
  */
478
523
  readonly min_sent?: number | undefined;
479
- /**
480
- * @deprecated Renamed to `max_bounce_rate`. Removed in 0.6.0.
481
- *
482
- * A number from 0 to 1.
483
- */
484
- readonly threshold?: number | undefined;
485
524
  /**
486
525
  * Only campaigns in one of these states are read: active, paused, completed, draft, archived or unknown
487
526
  *
@@ -603,7 +642,7 @@ export interface InsightInputs {
603
642
  */
604
643
  readonly to?: string | null | undefined;
605
644
  /**
606
- * The campaign's ref
645
+ * The campaign's ref or name
607
646
  *
608
647
  * At least 3 characters. Required.
609
648
  */
@@ -633,9 +672,15 @@ export interface InsightInputs {
633
672
  */
634
673
  readonly max_send_drop?: number | undefined;
635
674
  /**
636
- * The most senders of the campaign to read
675
+ * The most leads to read when sends fell or stopped, to tell lead runout from a fault. A page of leads is one request.
637
676
  *
638
- * A whole number from 1 to 500. Defaults to `50`.
677
+ * A whole number from 1 to 50,000. Defaults to `2000`.
678
+ */
679
+ readonly max_leads?: number | undefined;
680
+ /**
681
+ * The most of the campaign's own senders to read and screen for a status that is not active or a warmup score of 0
682
+ *
683
+ * A whole number from 1 to 500. Defaults to `500`.
639
684
  */
640
685
  readonly max_senders?: number | undefined;
641
686
  /**
@@ -662,17 +707,11 @@ export interface InsightInputs {
662
707
  * A number from 0 to 168. Defaults to `20`.
663
708
  */
664
709
  readonly min_weekly_hours?: number | undefined;
665
- /**
666
- * @deprecated Renamed to `days`. Removed in 0.6.0.
667
- *
668
- * A whole number from 1 to 30.
669
- */
670
- readonly recent_days?: number | undefined;
671
710
  };
672
711
  /** The input of `pipelineForecast` (the `pipeline_forecast` tool). */
673
712
  readonly pipelineForecast: {
674
713
  /**
675
- * The campaign's ref
714
+ * The campaign's ref or name
676
715
  *
677
716
  * At least 3 characters. Required.
678
717
  */
@@ -941,11 +980,5 @@ export interface InsightInputs {
941
980
  * A number, 0 or more. Defaults to `7`.
942
981
  */
943
982
  readonly runway_days?: number | undefined;
944
- /**
945
- * @deprecated Renamed to `limit`. Removed in 0.6.0.
946
- *
947
- * A whole number from 1 to 20.
948
- */
949
- readonly top?: number | undefined;
950
983
  };
951
984
  }
@@ -16,6 +16,7 @@ export declare const campaignDiagnosis: import("../define.ts").InsightDefinition
16
16
  daily_limit_share: number;
17
17
  max_bounce_rate: number;
18
18
  max_send_drop: number;
19
+ max_leads: number;
19
20
  max_senders: number;
20
21
  min_positive_share: number;
21
22
  min_reply_rate: number;
@@ -23,19 +24,18 @@ export declare const campaignDiagnosis: import("../define.ts").InsightDefinition
23
24
  min_weekly_hours: number;
24
25
  from: string | null;
25
26
  to: string | null;
26
- recent_days?: number | undefined;
27
27
  }, CampaignDiagnosis, {
28
28
  campaign: string;
29
29
  days?: number | undefined;
30
30
  daily_limit_share?: number | undefined;
31
31
  max_bounce_rate?: number | undefined;
32
32
  max_send_drop?: number | undefined;
33
+ max_leads?: number | undefined;
33
34
  max_senders?: number | undefined;
34
35
  min_positive_share?: number | undefined;
35
36
  min_reply_rate?: number | undefined;
36
37
  min_sent?: number | undefined;
37
38
  min_weekly_hours?: number | undefined;
38
- recent_days?: number | undefined;
39
39
  from?: string | null | undefined;
40
40
  to?: string | null | undefined;
41
41
  }>;
@@ -71,7 +71,6 @@ export declare const clientReport: import("../define.ts").InsightDefinition<"cli
71
71
  runway_days: number;
72
72
  max_campaigns: number;
73
73
  statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
74
- top?: number | undefined;
75
74
  }, ClientReport, {
76
75
  alpha?: number | undefined;
77
76
  anomaly_threshold?: number | undefined;
@@ -83,7 +82,6 @@ export declare const clientReport: import("../define.ts").InsightDefinition<"cli
83
82
  min_baseline_points?: number | undefined;
84
83
  min_sent?: number | undefined;
85
84
  runway_days?: number | undefined;
86
- top?: number | undefined;
87
85
  max_campaigns?: number | undefined;
88
86
  statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
89
87
  }>;
@@ -1,7 +1,7 @@
1
1
  import type { CampaignSettings } from "../../internal/entities-account.ts";
2
2
  import type { Campaign, Sender } from "../../internal/entities.ts";
3
3
  import type { Rates, Totals } from "./shared.ts";
4
- export type DiagnosisCode = "falling_sends" | "few_positive_replies" | "high_bounce_rate" | "inactive_sender" | "low_reply_rate" | "no_recent_sends" | "schedule_limits_volume" | "short_sequence" | "too_little_volume" | "tracking_off";
4
+ export type DiagnosisCode = "contacted_exceeds_leads" | "falling_sends" | "few_positive_replies" | "high_bounce_rate" | "inactive_sender" | "low_reply_rate" | "no_recent_sends" | "out_of_leads" | "schedule_limits_volume" | "short_sequence" | "too_little_volume" | "tracking_off";
5
5
  export interface DiagnosisFinding {
6
6
  readonly code: DiagnosisCode;
7
7
  readonly severity: "high" | "low" | "medium";
@@ -20,6 +20,19 @@ export interface RecentSends {
20
20
  readonly before: number | null;
21
21
  /** Days in the recent window the vendor reports a send count for. */
22
22
  readonly daysWithData: number;
23
+ /** New leads started per day in the last `days`. `null` when the vendor reports no daily contacted count. */
24
+ readonly startedPerDay: number | null;
25
+ }
26
+ /** The campaign's leads, read only when its sends fell or stopped. */
27
+ export interface LeadsLeft {
28
+ /** Active leads: not replied, bounced, unsubscribed, paused or finished. */
29
+ readonly active: number;
30
+ /** Active leads whose sequence has not started, or every active lead when the vendor does not say. */
31
+ readonly toStart: number;
32
+ /** Active leads partway through the sequence. `null` when the vendor does not say. */
33
+ readonly inSequence: number | null;
34
+ /** Days until no lead is left to start, at `startedPerDay`. `null` when it cannot be known. */
35
+ readonly daysLeft: number | null;
23
36
  }
24
37
  /** What was read about the campaign. A part that could not be read is `null`. */
25
38
  export interface Facts {
@@ -32,6 +45,10 @@ export interface Facts {
32
45
  readonly steps: number | null;
33
46
  readonly senders: readonly Sender[] | null;
34
47
  readonly recent: RecentSends | null;
48
+ /** Read only when sends fell or stopped, every lead was read and the vendor listed some. */
49
+ readonly leads: LeadsLeft | null;
50
+ /** Every lead in the campaign, from its progress. `null` when not read. */
51
+ readonly campaignLeads: number | null;
35
52
  }
36
53
  export interface Limits {
37
54
  readonly minReplyRate: number;
@@ -42,6 +59,8 @@ export interface Limits {
42
59
  readonly minWeeklyHours: number;
43
60
  readonly dailyLimitShare: number;
44
61
  }
62
+ /** Whether the recent sends fell or stopped enough to be a finding, so the leads left are worth reading. */
63
+ export declare const sendsFellOrStopped: (campaign: Campaign, recent: RecentSends | null, limits: Pick<Limits, "maxSendDrop">) => boolean;
45
64
  /** Every finding, most serious first. */
46
65
  export declare const diagnose: (facts: Facts, limits: Limits) => DiagnosisFinding[];
47
66
  /** Rates that could not be judged because the vendor reports no count for them. */
@@ -4,6 +4,7 @@ export declare const OPS_INSIGHTS: readonly [import("../define.ts").InsightDefin
4
4
  daily_limit_share: number;
5
5
  max_bounce_rate: number;
6
6
  max_send_drop: number;
7
+ max_leads: number;
7
8
  max_senders: number;
8
9
  min_positive_share: number;
9
10
  min_reply_rate: number;
@@ -11,19 +12,18 @@ export declare const OPS_INSIGHTS: readonly [import("../define.ts").InsightDefin
11
12
  min_weekly_hours: number;
12
13
  from: string | null;
13
14
  to: string | null;
14
- recent_days?: number | undefined;
15
15
  }, import("./campaign-diagnosis.ts").CampaignDiagnosis, {
16
16
  campaign: string;
17
17
  days?: number | undefined;
18
18
  daily_limit_share?: number | undefined;
19
19
  max_bounce_rate?: number | undefined;
20
20
  max_send_drop?: number | undefined;
21
+ max_leads?: number | undefined;
21
22
  max_senders?: number | undefined;
22
23
  min_positive_share?: number | undefined;
23
24
  min_reply_rate?: number | undefined;
24
25
  min_sent?: number | undefined;
25
26
  min_weekly_hours?: number | undefined;
26
- recent_days?: number | undefined;
27
27
  from?: string | null | undefined;
28
28
  to?: string | null | undefined;
29
29
  }>, import("../define.ts").InsightDefinition<"pipelineForecast", {
@@ -111,7 +111,6 @@ export declare const OPS_INSIGHTS: readonly [import("../define.ts").InsightDefin
111
111
  runway_days: number;
112
112
  max_campaigns: number;
113
113
  statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
114
- top?: number | undefined;
115
114
  }, import("./client-report.ts").ClientReport, {
116
115
  alpha?: number | undefined;
117
116
  anomaly_threshold?: number | undefined;
@@ -123,7 +122,6 @@ export declare const OPS_INSIGHTS: readonly [import("../define.ts").InsightDefin
123
122
  min_baseline_points?: number | undefined;
124
123
  min_sent?: number | undefined;
125
124
  runway_days?: number | undefined;
126
- top?: number | undefined;
127
125
  max_campaigns?: number | undefined;
128
126
  statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
129
127
  }>];
@@ -14,15 +14,26 @@ export interface PipelineForecast extends CampaignLabel {
14
14
  /** `false` when `max_leads` stopped the read, so `remaining` is a minimum. */
15
15
  readonly leadsComplete: boolean;
16
16
  readonly byStatus: Readonly<Record<LeadStatus, number>>;
17
- /** Leads still active in the campaign: not replied, bounced, unsubscribed, paused or finished. */
17
+ /** Leads still active in the campaign: not replied, bounced, unsubscribed, paused, skipped or finished. */
18
18
  readonly remaining: number;
19
- /** New leads contacted per day over the last `days`. `null` when the vendor has no daily contacted count. */
19
+ /**
20
+ * Active leads whose sequence has not started: no step sent, no contact.
21
+ * `null` when the vendor reports neither for any lead read.
22
+ */
23
+ readonly notStarted: number | null;
24
+ /** Active leads partway through the sequence. `null` with `notStarted`. */
25
+ readonly inSequence: number | null;
26
+ /**
27
+ * New leads started per day over the last `days`: the daily `contacted`
28
+ * count, never emails sent. `null` when the vendor has no daily contacted count.
29
+ */
20
30
  readonly dailyContactRate: number | null;
21
31
  /**
22
- * `remaining` divided by `dailyContactRate`, and `0` when every lead was
23
- * read and none is left. `null` when the remaining leads are unknown (the
24
- * cap stopped the read, or a lead's status is unknown) or some remain with
25
- * no contact rate to divide by.
32
+ * `notStarted` (or `remaining` when that is `null`) divided by
33
+ * `dailyContactRate`, and `0` when every lead was read and none is left to
34
+ * start. `null` when the leads left are unknown (the cap stopped the read,
35
+ * or a lead's status is unknown) or some are left with no pace to divide by.
36
+ * `lead_runway` returns the same figure as `runway_days`.
26
37
  */
27
38
  readonly daysLeft: number | null;
28
39
  /** The campaign's reply rate so far, over its whole history. */
@@ -50,8 +50,6 @@ export interface CampaignLabel {
50
50
  /** The campaign's ref. */
51
51
  readonly campaign: string;
52
52
  readonly campaignName: string;
53
- /** @deprecated Use `campaignName`. Removed in 0.6.0. */
54
- readonly name: string;
55
53
  readonly status: CampaignStatus;
56
54
  readonly channel: "email" | "linkedin";
57
55
  readonly provider: string;
@@ -39,6 +39,16 @@ export interface AccountPerson {
39
39
  }
40
40
  export interface AccountSummary {
41
41
  readonly domain: string;
42
+ /**
43
+ * `search` when the tool found the domain's leads itself (`leads.byDomain`),
44
+ * `scan` when leads were read in order and matched here, up to `max_leads`.
45
+ */
46
+ readonly foundBy: "scan" | "search";
47
+ /**
48
+ * One sentence on who was found. When a scan stopped with leads unread, it
49
+ * says that nobody matching does not mean nobody at the company is there.
50
+ */
51
+ readonly finding: string;
42
52
  /** Sorted by most recent reply, then people who replied at an unknown time, then the rest by email. */
43
53
  readonly people: readonly AccountPerson[];
44
54
  readonly totals: {
@@ -49,7 +59,10 @@ export interface AccountSummary {
49
59
  readonly interested: number;
50
60
  /** Leads looked at to find them. */
51
61
  readonly leadsRead: number;
52
- /** Leads with no email address, which a domain cannot match. */
62
+ /**
63
+ * Leads with no email address, which a domain cannot match. A search by
64
+ * domain never returns them, so it is then 0.
65
+ */
53
66
  readonly leadsWithoutEmail: number;
54
67
  /**
55
68
  * `true` when `max_leads` or `max_campaigns` stopped the read with more
@@ -0,0 +1,14 @@
1
+ import type { Lead } from "../../internal/entities.ts";
2
+ import type { InsightContext } from "../define.ts";
3
+ /** The most replies read to find leads whose replies were all automatic. */
4
+ export declare const AUTO_CHECK_REPLIES = 200;
5
+ /** A lead's own ref and, when it has an address, the ref a reply may name it by. */
6
+ export declare const refsOf: (lead: Lead) => string[];
7
+ /**
8
+ * The refs of leads whose every reply read is flagged automatic, by the
9
+ * vendor or by a fixed rule. A lead with one reply not flagged is not in it,
10
+ * nor is a lead none of whose replies were read. Reads at most
11
+ * `AUTO_CHECK_REPLIES` replies, newest first, and nothing when no lead
12
+ * counted replies or the tool cannot list replies.
13
+ */
14
+ export declare const autoOnlyRefs: (context: InsightContext, campaign: string | null, leads: readonly Lead[]) => Promise<ReadonlySet<string>>;
@@ -28,7 +28,7 @@ export interface DroppedReplies {
28
28
  readonly repliesRead: number;
29
29
  /** Left out for a category that needs no answer. */
30
30
  readonly skippedByCategory: number;
31
- /** Left out because the vendor marks them as automatic. */
31
+ /** Left out because they are flagged automatic, by the vendor or by a fixed rule. */
32
32
  readonly skippedAuto: number;
33
33
  /** Conversations the remaining replies belong to. */
34
34
  readonly conversations: number;
@@ -49,7 +49,11 @@ export interface HotLeads {
49
49
  readonly moreLeadsExist: boolean;
50
50
  /** Leads past the cap, read because they replied within `recency_days`. Counted in `leadsRead`. */
51
51
  readonly fromReplies: number;
52
- /** Leads the vendor labels out-of-office or bounced, whose replies earned no points. */
52
+ /**
53
+ * Leads with replies that earned no points because they were automatic:
54
+ * the vendor labels the lead out-of-office or bounced, or every reply of
55
+ * the lead read was flagged automatic.
56
+ */
53
57
  readonly autoReplied: number;
54
58
  /** Leads the vendor labels negative, such as not interested or wrong person, which earn no points at all and are listed after every lead with a score above 0. A label in `positive_labels` is not counted here. */
55
59
  readonly negative: number;
@@ -17,19 +17,23 @@ export declare const PEOPLE_INSIGHTS: readonly [import("../define.ts").InsightDe
17
17
  max_leads?: number | undefined;
18
18
  positive_labels?: string[] | undefined;
19
19
  }>, import("../define.ts").InsightDefinition<"leadCollisions", {
20
+ include_past: boolean;
20
21
  max_campaigns: number;
21
22
  max_leads_per_campaign: number;
22
23
  statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
23
24
  }, import("./lead-collisions.ts").LeadCollisions, {
25
+ include_past?: boolean | undefined;
24
26
  max_campaigns?: number | undefined;
25
27
  max_leads_per_campaign?: number | undefined;
26
28
  statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
27
29
  }>, import("../define.ts").InsightDefinition<"suppressionCheck", {
30
+ lead_statuses: ("active" | "completed" | "paused" | "unknown" | "bounced" | "replied" | "skipped" | "unsubscribed")[];
28
31
  max_block_entries: number;
29
32
  max_campaigns: number;
30
33
  max_leads_per_campaign: number;
31
34
  statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
32
35
  }, import("./suppression-check.ts").SuppressionCheck, {
36
+ lead_statuses?: ("active" | "completed" | "paused" | "unknown" | "bounced" | "replied" | "skipped" | "unsubscribed")[] | undefined;
33
37
  max_block_entries?: number | undefined;
34
38
  max_campaigns?: number | undefined;
35
39
  max_leads_per_campaign?: number | undefined;
@@ -10,7 +10,7 @@ export interface LeadCollision {
10
10
  /** Every exact identifier the person's records carry, as `email:` or `linkedin:` keys. */
11
11
  readonly identifiers: readonly string[];
12
12
  readonly campaignCount: number;
13
- /** Campaigns in which the lead's own status is still `active`. */
13
+ /** Campaigns in which the lead's own status is still `active`. Two or more means the outreach overlaps now. */
14
14
  readonly stillActive: number;
15
15
  /** `across_tools` when the campaigns are in more than one tool, otherwise `within_tool`. */
16
16
  readonly scope: "across_tools" | "within_tool";
@@ -20,10 +20,17 @@ export interface LeadCollision {
20
20
  readonly finding: string;
21
21
  }
22
22
  export interface LeadCollisions {
23
- /** Most campaigns first, then collisions across tools, then by identifier. */
23
+ /** Most active campaigns first, then most campaigns, then collisions across tools, then by identifier. */
24
24
  readonly collisions: readonly LeadCollision[];
25
25
  readonly totals: {
26
26
  readonly collisions: number;
27
+ /** Collisions returned in which two or more memberships are still active. */
28
+ readonly concurrent: number;
29
+ /**
30
+ * People in two or more campaigns of whom fewer than two memberships are
31
+ * still active. They are in `collisions` only with `include_past`.
32
+ */
33
+ readonly pastOverlaps: number;
27
34
  readonly acrossTools: number;
28
35
  readonly withinTool: number;
29
36
  readonly campaignsRead: number;
@@ -33,10 +40,12 @@ export interface LeadCollisions {
33
40
  };
34
41
  }
35
42
  export declare const leadCollisions: import("../define.ts").InsightDefinition<"leadCollisions", {
43
+ include_past: boolean;
36
44
  max_campaigns: number;
37
45
  max_leads_per_campaign: number;
38
46
  statuses: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[];
39
47
  }, LeadCollisions, {
48
+ include_past?: boolean | undefined;
40
49
  max_campaigns?: number | undefined;
41
50
  max_leads_per_campaign?: number | undefined;
42
51
  statuses?: ("active" | "archived" | "completed" | "draft" | "paused" | "unknown")[] | undefined;
@@ -5,21 +5,37 @@ export interface PersonCampaign {
5
5
  readonly channel: "email" | "linkedin";
6
6
  readonly provider: string;
7
7
  readonly lead: string;
8
+ /**
9
+ * The lead's status, agreeing with `replied`: when the vendor says
10
+ * `replied` only because of automatic replies, this is where the lead is in
11
+ * the sequence instead, and `vendorLeadStatus` keeps the vendor's word.
12
+ */
8
13
  readonly leadStatus: string;
14
+ /** The lead's status as the vendor's record gives it, before automatic replies are set aside. */
15
+ readonly vendorLeadStatus: string;
9
16
  /** The vendor's own label, for example `Interested`. */
10
17
  readonly interest: string | null;
11
18
  readonly messagesSent: number;
12
- /** Replies from the person. 0 when the vendor labels the lead out-of-office or bounced. */
19
+ /** Replies from the person, not counting replies flagged automatic. 0 when `autoReplied`. */
13
20
  readonly replies: number;
14
21
  readonly replied: boolean;
15
22
  /**
16
- * `true` when the vendor labels the lead out-of-office or bounced: its
17
- * replies were automatic, so they are not counted as the person replying.
23
+ * `true` when the vendor labels the lead out-of-office or bounced, or when
24
+ * every reply in the thread is flagged automatic (by the vendor or a fixed
25
+ * rule): its replies are not counted as the person replying.
18
26
  */
19
27
  readonly autoReplied: boolean;
20
28
  /** Steps the person replied to, counted from 0. Empty when the vendor does not tie a reply to a step. */
29
+ readonly repliedStepIndexes: readonly number[];
30
+ /** `repliedStepIndexes` counted from 1, as a person counts: `[2]` is the second email. */
31
+ readonly repliedStepNumbers: readonly number[];
32
+ /** @deprecated Use `repliedStepIndexes` (the same values, counted from 0) or `repliedStepNumbers`. Removed in 0.8.0. */
21
33
  readonly repliedSteps: readonly number[];
22
34
  /** The last step sent, counted from 0. */
35
+ readonly lastStepIndex: number | null;
36
+ /** `lastStepIndex` counted from 1, as a person counts. */
37
+ readonly lastStepNumber: number | null;
38
+ /** @deprecated Use `lastStepIndex` (the same value, counted from 0) or `lastStepNumber`. Removed in 0.8.0. */
23
39
  readonly lastStep: number | null;
24
40
  readonly firstContactedAt: string | null;
25
41
  readonly lastContactedAt: string | null;
@@ -1,6 +1,5 @@
1
- export interface VariableUse {
2
- /** The step, counted from 0. */
3
- readonly step: number;
1
+ import type { StepPosition } from "../step.ts";
2
+ export interface VariableUse extends StepPosition {
4
3
  readonly variant: string;
5
4
  readonly field: "body" | "subject";
6
5
  readonly fallback: boolean;
@@ -12,16 +11,23 @@ export interface CopyVariable {
12
11
  * `builtin` for first name, last name, company, title and email; `custom`
13
12
  * when a lead read has a custom field of that name; `unknown` when no
14
13
  * lead read has it, which is a sender or system variable the tool fills
15
- * itself, or a field nobody has.
14
+ * itself, or a field nobody has. A sender variable also has `sender: true`.
16
15
  */
17
16
  readonly source: "builtin" | "custom" | "unknown";
18
- /** `false` when every use has a fallback, or the source is unknown. */
17
+ /**
18
+ * `true` when the tool fills it from the sending account at send time,
19
+ * such as Instantly's `{{accountSignature}}`: not a lead field, and not
20
+ * listed in `unknownVariables`. Its `source` is `unknown`. Always set;
21
+ * optional in the type so a variable built by hand still fits.
22
+ */
23
+ readonly sender?: boolean;
24
+ /** `true` when at least one lead read gets broken copy from it, so `leadsAffected` is above 0. */
19
25
  readonly gap: boolean;
20
26
  readonly steps: readonly number[];
21
27
  readonly uses: readonly VariableUse[];
22
- /** Leads read with no value for it. `null` for an unknown variable. */
28
+ /** Leads read with no value for it. `null` for a sender or unknown variable. */
23
29
  readonly leadsWithoutValue: number | null;
24
- /** Leads who get broken copy from it: 0 when every use has a fallback. `null` for an unknown variable. */
30
+ /** Leads who get broken copy from it: 0 when every use has a fallback. `null` for a sender or unknown variable. */
25
31
  readonly leadsAffected: number | null;
26
32
  }
27
33
  export interface GapLead {
@@ -38,7 +44,7 @@ export interface PersonalizationGaps {
38
44
  readonly variables: readonly CopyVariable[];
39
45
  /** Leads missing at least one variable, most missing first, up to `limit`. */
40
46
  readonly leads: readonly GapLead[];
41
- /** Variables no lead read has a value for and that are not built in. Check them by hand. */
47
+ /** Variables no lead read has a value for and that are neither built in nor filled from the sender. Check them by hand. */
42
48
  readonly unknownVariables: readonly string[];
43
49
  readonly totals: {
44
50
  readonly steps: number;