outbound-sdk 0.2.1 → 0.5.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 (175) hide show
  1. package/README.md +2 -2
  2. package/dist/alerts/check-evaluate.d.ts +53 -0
  3. package/dist/alerts/check-measure.d.ts +100 -0
  4. package/dist/alerts/check-schema.d.ts +184 -0
  5. package/dist/alerts/check-validate.d.ts +18 -0
  6. package/dist/alerts/index.d.ts +7 -0
  7. package/dist/alerts/index.js +684 -20
  8. package/dist/alerts/plugin.d.ts +20 -3
  9. package/dist/audit/index.js +2 -2
  10. package/dist/benchmarks/index.js +5 -5
  11. package/dist/budget/index.d.ts +5 -2
  12. package/dist/budget/index.js +12 -10
  13. package/dist/cards/content.d.ts +6 -1
  14. package/dist/cards/format.d.ts +17 -2
  15. package/dist/cards/index.d.ts +1 -1
  16. package/dist/cards/index.js +298 -132
  17. package/dist/cards/parts.d.ts +9 -2
  18. package/dist/cards/render.d.ts +20 -3
  19. package/dist/chunks/{chunk-U2D34ARZ.js → chunk-2D42TQFU.js} +3 -3
  20. package/dist/chunks/{chunk-6CVZOUHB.js → chunk-3S32R2MH.js} +53 -63
  21. package/dist/chunks/chunk-4PA526S7.js +17 -0
  22. package/dist/chunks/{chunk-RCZ7ZZFU.js → chunk-5J7GGV62.js} +12 -5
  23. package/dist/chunks/chunk-6TKFISG4.js +676 -0
  24. package/dist/chunks/{chunk-AFU5E5QB.js → chunk-BK5SLY32.js} +104 -84
  25. package/dist/chunks/{chunk-VQSCHOBV.js → chunk-BLCJHP5H.js} +11 -4
  26. package/dist/chunks/{chunk-SBIZDCRY.js → chunk-BN6WCAWX.js} +7 -7
  27. package/dist/chunks/{chunk-4PSO6JEK.js → chunk-BOWXGMN3.js} +6 -21
  28. package/dist/chunks/{chunk-PURHK3JU.js → chunk-EHSJGQ5K.js} +8 -8
  29. package/dist/chunks/{chunk-IPUYZD4O.js → chunk-GFDNRWR3.js} +1 -1
  30. package/dist/chunks/chunk-HPNGSG5E.js +51 -0
  31. package/dist/chunks/chunk-HWHI4LFY.js +102 -0
  32. package/dist/chunks/{chunk-E7JHLNLG.js → chunk-J7DDZ4C2.js} +15 -2
  33. package/dist/chunks/{chunk-DJ2IUQEU.js → chunk-JWGSB7PT.js} +6 -6
  34. package/dist/chunks/{chunk-R3Y56YVF.js → chunk-OLPMBRXM.js} +4 -3
  35. package/dist/chunks/{chunk-YOTW5ESM.js → chunk-PQSTQKRD.js} +2 -2
  36. package/dist/chunks/chunk-PTZO4QXR.js +15 -0
  37. package/dist/chunks/{chunk-LVYG7XZJ.js → chunk-QAKJ76HB.js} +1 -1
  38. package/dist/chunks/chunk-QGRZDTX4.js +26 -0
  39. package/dist/chunks/chunk-WGW3ROLY.js +18 -0
  40. package/dist/chunks/{chunk-XC6CZP73.js → chunk-WH6V3YNN.js} +32 -1
  41. package/dist/chunks/{chunk-P3IJBJUI.js → chunk-X4RDBD4J.js} +296 -62
  42. package/dist/chunks/chunk-XL6LJVHJ.js +71 -0
  43. package/dist/chunks/{chunk-XNFESPZH.js → chunk-YYCT3NGV.js} +200 -39
  44. package/dist/chunks/{chunk-UAT3JSJZ.js → chunk-ZOAG2C6V.js} +2 -2
  45. package/dist/cli/bin.js +19 -30
  46. package/dist/cli/commands.d.ts +11 -0
  47. package/dist/cli/index.d.ts +3 -0
  48. package/dist/cli/index.js +18 -13
  49. package/dist/cli/mcp.d.ts +5 -0
  50. package/dist/cli/update.d.ts +15 -0
  51. package/dist/clients/index.d.ts +1 -1
  52. package/dist/clients/index.js +35 -10
  53. package/dist/clients/plugin.d.ts +9 -2
  54. package/dist/combine/index.js +7 -6
  55. package/dist/emailbison/account.d.ts +7 -0
  56. package/dist/emailbison/adapter.d.ts +5 -0
  57. package/dist/emailbison/capabilities.d.ts +78 -0
  58. package/dist/emailbison/client.d.ts +29 -0
  59. package/dist/emailbison/index.d.ts +30 -0
  60. package/dist/emailbison/index.js +1017 -0
  61. package/dist/emailbison/mail.d.ts +5 -0
  62. package/dist/emailbison/map-mail.d.ts +13 -0
  63. package/dist/emailbison/map-sequence.d.ts +12 -0
  64. package/dist/emailbison/map-stats.d.ts +47 -0
  65. package/dist/emailbison/map.d.ts +24 -0
  66. package/dist/emailbison/native-params.d.ts +5 -0
  67. package/dist/emailbison/native-workspace.d.ts +167 -0
  68. package/dist/emailbison/native.d.ts +327 -0
  69. package/dist/emailbison/stats.d.ts +4 -0
  70. package/dist/emailbison/webhooks.d.ts +2 -0
  71. package/dist/exporter/index.d.ts +5 -2
  72. package/dist/exporter/index.js +2 -2
  73. package/dist/failover/index.js +3 -3
  74. package/dist/fixtures/index.js +10 -9
  75. package/dist/heyreach/capabilities.d.ts +3 -0
  76. package/dist/heyreach/client.d.ts +2 -0
  77. package/dist/heyreach/index.js +83 -51
  78. package/dist/heyreach/map.d.ts +5 -2
  79. package/dist/identity/index.js +33 -17
  80. package/dist/identity/plugin.d.ts +2 -0
  81. package/dist/index.d.ts +2 -2
  82. package/dist/index.js +29 -25
  83. package/dist/insights/campaign.d.ts +3 -0
  84. package/dist/insights/capped.d.ts +29 -0
  85. package/dist/insights/copy/copy-audit.d.ts +2 -0
  86. package/dist/insights/copy/copy-reuse.d.ts +27 -3
  87. package/dist/insights/copy/index.d.ts +8 -8
  88. package/dist/insights/copy/reply-timing.d.ts +8 -0
  89. package/dist/insights/copy/reuse-base.d.ts +32 -0
  90. package/dist/insights/copy/shared.d.ts +39 -15
  91. package/dist/insights/copy/step-funnel.d.ts +16 -5
  92. package/dist/insights/copy/variant-test.d.ts +19 -8
  93. package/dist/insights/cost.d.ts +91 -0
  94. package/dist/insights/define.d.ts +78 -3
  95. package/dist/insights/fields.d.ts +16 -0
  96. package/dist/insights/index.d.ts +6 -4
  97. package/dist/insights/index.js +1816 -748
  98. package/dist/insights/inputs.generated.d.ts +951 -0
  99. package/dist/insights/ops/campaign-diagnosis.d.ts +3 -1
  100. package/dist/insights/ops/campaign-ranking.d.ts +15 -7
  101. package/dist/insights/ops/channel-mix.d.ts +2 -1
  102. package/dist/insights/ops/client-report.d.ts +18 -5
  103. package/dist/insights/ops/index.d.ts +8 -4
  104. package/dist/insights/ops/period-comparison.d.ts +14 -3
  105. package/dist/insights/ops/pipeline-forecast.d.ts +14 -4
  106. package/dist/insights/ops/shared.d.ts +39 -24
  107. package/dist/insights/ops/tag-rollup.d.ts +2 -1
  108. package/dist/insights/people/account-summary.d.ts +13 -0
  109. package/dist/insights/people/dropped-replies.d.ts +8 -0
  110. package/dist/insights/people/find.d.ts +7 -1
  111. package/dist/insights/people/hot-leads.d.ts +16 -1
  112. package/dist/insights/people/person-summary.d.ts +6 -0
  113. package/dist/insights/people/read.d.ts +26 -10
  114. package/dist/insights/people/suppression-check.d.ts +11 -2
  115. package/dist/insights/plugin.d.ts +26 -5
  116. package/dist/insights/ref.d.ts +6 -0
  117. package/dist/insights/registry.d.ts +30 -18
  118. package/dist/insights/run-cap.d.ts +35 -0
  119. package/dist/insights/senders/bounce-watch.d.ts +25 -8
  120. package/dist/insights/senders/capacity-sends.d.ts +22 -0
  121. package/dist/insights/senders/domain-health.d.ts +10 -4
  122. package/dist/insights/senders/index.d.ts +14 -6
  123. package/dist/insights/senders/read.d.ts +15 -14
  124. package/dist/insights/senders/sender-capacity.d.ts +5 -13
  125. package/dist/insights/senders/sender-load.d.ts +2 -0
  126. package/dist/insights/stats.d.ts +8 -0
  127. package/dist/insights/tools.d.ts +13 -2
  128. package/dist/instantly/capabilities.d.ts +13 -0
  129. package/dist/instantly/client.d.ts +2 -0
  130. package/dist/instantly/index.js +77 -49
  131. package/dist/instantly/map.d.ts +6 -2
  132. package/dist/internal/adapter.d.ts +12 -0
  133. package/dist/internal/engine/request.d.ts +5 -0
  134. package/dist/internal/entities.d.ts +3 -20
  135. package/dist/internal/errors.d.ts +44 -0
  136. package/dist/internal/fields.d.ts +1 -1
  137. package/dist/internal/json.d.ts +9 -2
  138. package/dist/internal/lists.d.ts +24 -0
  139. package/dist/internal/numbers.d.ts +8 -0
  140. package/dist/internal/outbound/collections.d.ts +4 -0
  141. package/dist/internal/outbound/create.d.ts +24 -3
  142. package/dist/internal/outbound/outbound.d.ts +18 -2
  143. package/dist/internal/outbound/validate.d.ts +4 -0
  144. package/dist/internal/outbound/walker.d.ts +3 -2
  145. package/dist/internal/plural.d.ts +12 -0
  146. package/dist/internal/renamed.d.ts +28 -0
  147. package/dist/internal/request-cap.d.ts +35 -0
  148. package/dist/internal/vocabulary.d.ts +20 -0
  149. package/dist/loader/index.js +5 -5
  150. package/dist/memory/adapter.d.ts +7 -0
  151. package/dist/memory/demo-stats.d.ts +3 -0
  152. package/dist/memory/demo.d.ts +14 -3
  153. package/dist/memory/index.d.ts +1 -0
  154. package/dist/memory/index.js +209 -104
  155. package/dist/providers/index.d.ts +92 -0
  156. package/dist/providers/index.js +3 -1
  157. package/dist/reconcile/index.js +5 -4
  158. package/dist/redact/index.js +13 -7
  159. package/dist/redact/plugin.d.ts +7 -0
  160. package/dist/smartlead/capabilities.d.ts +5 -0
  161. package/dist/smartlead/index.js +119 -66
  162. package/dist/smartlead/shared.d.ts +13 -0
  163. package/dist/sync/index.js +2 -2
  164. package/dist/tools/ai-sdk.js +10 -6
  165. package/dist/tools/campaign-tools.d.ts +1 -1
  166. package/dist/tools/claude-agent.js +10 -6
  167. package/dist/tools/index.d.ts +2 -2
  168. package/dist/tools/index.js +16 -9
  169. package/dist/tools/input-problem.d.ts +8 -0
  170. package/dist/tools/registry.d.ts +26 -2
  171. package/dist/tools/shared.d.ts +27 -1
  172. package/dist/tracing/index.js +2 -2
  173. package/dist/webhooks/index.js +22 -12
  174. package/package.json +8 -2
  175. package/dist/chunks/chunk-FKH5N47I.js +0 -40
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  isJsonObject,
3
3
  isString
4
- } from "./chunk-VQSCHOBV.js";
4
+ } from "./chunk-BLCJHP5H.js";
5
5
 
6
6
  // src/internal/redact.ts
7
7
  var EMAIL = /[\w.!#$%&'*+/=?^`{|}~-]+@[\w-]+(?:\.[\w-]+)+/gu;
@@ -86,6 +86,17 @@ var OutboundError = class extends Error {
86
86
  retryAfterMs;
87
87
  aborted;
88
88
  timedOut;
89
+ /**
90
+ * What stopped a `RateLimited` call: the vendor, a deadline, or a request
91
+ * cap of your own. `undefined` on every other code.
92
+ */
93
+ limit;
94
+ /**
95
+ * Set when `listAll().toArray()` stopped part way: the records it had
96
+ * fetched and the cursor to resume from. A partial answer is never returned
97
+ * as if it were complete.
98
+ */
99
+ partial;
89
100
  /** `true` when retrying the same call cannot succeed. */
90
101
  permanent;
91
102
  [BRAND] = true;
@@ -99,7 +110,9 @@ var OutboundError = class extends Error {
99
110
  this.retryAfterMs = options.retryAfterMs;
100
111
  this.aborted = options.aborted ?? false;
101
112
  this.timedOut = options.timedOut ?? false;
102
- this.permanent = this.aborted || !RETRYABLE.has(code);
113
+ this.limit = code === "RateLimited" ? options.limit ?? (options.status === void 0 ? void 0 : "vendor") : void 0;
114
+ this.partial = options.partial;
115
+ this.permanent = this.aborted || !RETRYABLE.has(code) || this.limit === "call" || this.limit === "run";
103
116
  }
104
117
  /** Type guard that also recognises errors from another copy of the package. */
105
118
  static is(cause) {
@@ -1,13 +1,13 @@
1
- import {
2
- stableId
3
- } from "./chunk-FHKSLCVW.js";
4
1
  import {
5
2
  eventData,
6
3
  refTo
7
- } from "./chunk-U2D34ARZ.js";
4
+ } from "./chunk-2D42TQFU.js";
8
5
  import {
9
6
  SCHEMA_VERSION
10
- } from "./chunk-4PSO6JEK.js";
7
+ } from "./chunk-QGRZDTX4.js";
8
+ import {
9
+ stableId
10
+ } from "./chunk-FHKSLCVW.js";
11
11
  import {
12
12
  compactObject,
13
13
  emailAddress,
@@ -19,7 +19,7 @@ import {
19
19
  objects,
20
20
  text,
21
21
  timestamp
22
- } from "./chunk-VQSCHOBV.js";
22
+ } from "./chunk-BLCJHP5H.js";
23
23
 
24
24
  // src/heyreach/webhooks.ts
25
25
  var EVENT_TYPES = /* @__PURE__ */ new Map([
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  createTools
3
- } from "./chunk-AFU5E5QB.js";
3
+ } from "./chunk-BK5SLY32.js";
4
4
  import {
5
5
  parseJson
6
- } from "./chunk-VQSCHOBV.js";
6
+ } from "./chunk-BLCJHP5H.js";
7
7
 
8
8
  // src/tools/index.ts
9
9
  var toFunction = (tool) => ({
@@ -27,7 +27,8 @@ var openaiTools = (outbound, options = {}) => {
27
27
  const result = tool === void 0 || input === void 0 ? {
28
28
  error: {
29
29
  code: "Invalid",
30
- message: tool === void 0 ? `Unknown tool ${name}` : "The arguments are not valid JSON"
30
+ message: tool === void 0 ? `Unknown tool ${name}` : "The arguments are not valid JSON",
31
+ retryable: false
31
32
  },
32
33
  next: "Call one of the listed tools with a JSON object.",
33
34
  ok: false
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  SCHEMA_VERSION
3
- } from "./chunk-4PSO6JEK.js";
3
+ } from "./chunk-QGRZDTX4.js";
4
4
  import {
5
5
  makeRef
6
- } from "./chunk-LVYG7XZJ.js";
6
+ } from "./chunk-QAKJ76HB.js";
7
7
 
8
8
  // src/internal/metrics.ts
9
9
  var METRIC_DEFINITIONS = {
@@ -0,0 +1,15 @@
1
+ // src/internal/plural.ts
2
+ var noun = (amount, one, many = `${one}s`) => amount === 1 ? one : many;
3
+ var plural = (amount, one, many = `${one}s`) => `${amount} ${noun(amount, one, many)}`;
4
+ var shownKey = (key) => {
5
+ if (key.startsWith("email:")) {
6
+ return key.slice("email:".length);
7
+ }
8
+ return key.startsWith("linkedin:") ? `linkedin.com/in/${key.slice("linkedin:".length)}` : key;
9
+ };
10
+
11
+ export {
12
+ noun,
13
+ plural,
14
+ shownKey
15
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  OutboundError
3
- } from "./chunk-E7JHLNLG.js";
3
+ } from "./chunk-J7DDZ4C2.js";
4
4
 
5
5
  // src/internal/ref.ts
6
6
  var SEPARATOR = ":";
@@ -0,0 +1,26 @@
1
+ // src/internal/vocabulary.ts
2
+ import { z } from "zod";
3
+ var SCHEMA_VERSION = 1;
4
+ var campaignStatusSchema = z.enum([
5
+ "active",
6
+ "archived",
7
+ "completed",
8
+ "draft",
9
+ "paused",
10
+ "unknown"
11
+ ]);
12
+ var replyCategorySchema = z.enum([
13
+ "bounce",
14
+ "negative",
15
+ "neutral",
16
+ "ooo",
17
+ "positive",
18
+ "unknown",
19
+ "unsubscribe"
20
+ ]);
21
+
22
+ export {
23
+ SCHEMA_VERSION,
24
+ campaignStatusSchema,
25
+ replyCategorySchema
26
+ };
@@ -0,0 +1,18 @@
1
+ import {
2
+ run
3
+ } from "./chunk-X4RDBD4J.js";
4
+
5
+ // src/cli/bin.ts
6
+ import process from "node:process";
7
+ import { createInterface } from "node:readline";
8
+ process.exitCode = await run(process.argv.slice(2), {
9
+ stderr: (text) => {
10
+ process.stderr.write(`${text}
11
+ `);
12
+ },
13
+ stdin: () => createInterface({ input: process.stdin }),
14
+ stdout: (text) => {
15
+ process.stdout.write(`${text}
16
+ `);
17
+ }
18
+ });
@@ -1,5 +1,5 @@
1
1
  // src/providers/index.ts
2
- var providers = [
2
+ var CATALOG = [
3
3
  {
4
4
  channels: ["email"],
5
5
  docsUrl: "https://developer.instantly.ai/",
@@ -60,6 +60,31 @@ var providers = [
60
60
  name: "HeyReach",
61
61
  note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation."
62
62
  },
63
+ {
64
+ channels: ["email"],
65
+ docsUrl: "https://dedi.emailbison.com/api/reference",
66
+ envVars: [
67
+ {
68
+ description: "API key (an api-user key is scoped to one workspace).",
69
+ name: "EMAILBISON_API_KEY",
70
+ required: true
71
+ },
72
+ {
73
+ description: "The URL you log in to EmailBison with. Defaults to https://dedi.emailbison.com.",
74
+ name: "EMAILBISON_BASE_URL",
75
+ required: false
76
+ },
77
+ {
78
+ description: "A label for this client or workspace.",
79
+ name: "EMAILBISON_WORKSPACE_ID",
80
+ required: false
81
+ }
82
+ ],
83
+ id: "emailbison",
84
+ maturity: "unverified",
85
+ name: "EmailBison",
86
+ note: "Never run against a live account. Written from the public documentation and tested offline only."
87
+ },
63
88
  {
64
89
  channels: ["email", "linkedin"],
65
90
  docsUrl: null,
@@ -70,11 +95,17 @@ var providers = [
70
95
  note: "Holds data in memory. For tests and demos; there is no vendor behind it."
71
96
  }
72
97
  ];
98
+ var providers = CATALOG;
99
+ var IDS = new Set(
100
+ providers.map((provider) => provider.id)
101
+ );
102
+ var isProviderId = (value) => typeof value === "string" && IDS.has(value);
73
103
  var findProvider = (id) => providers.find((provider) => provider.id === id);
74
104
  var PROVIDER_ENV = "OUTBOUND_SDK_PROVIDER";
75
105
 
76
106
  export {
77
107
  providers,
108
+ isProviderId,
78
109
  findProvider,
79
110
  PROVIDER_ENV
80
111
  };