outbound-sdk 0.11.0 → 0.13.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 (105) hide show
  1. package/dist/alerts/index.js +1 -1
  2. package/dist/budget/index.js +1 -1
  3. package/dist/cards/index.js +217 -100
  4. package/dist/cards/sender-tool-cards.d.ts +6 -0
  5. package/dist/chunks/{chunk-UAHYPASH.js → chunk-3LRIWQEJ.js} +2 -1
  6. package/dist/chunks/{chunk-UZLFZZ2U.js → chunk-6BSFR5SF.js} +14 -2
  7. package/dist/chunks/{chunk-FTK4JS65.js → chunk-BTIJ24UY.js} +89 -9
  8. package/dist/chunks/{chunk-OVTYA3IB.js → chunk-EAG5NIPM.js} +614 -206
  9. package/dist/chunks/{chunk-A7DLJUA6.js → chunk-FT6HMMMP.js} +3 -1
  10. package/dist/chunks/chunk-I7GBBHD2.js +80 -0
  11. package/dist/chunks/{chunk-UOJG4VYF.js → chunk-LD5OAELW.js} +1 -1
  12. package/dist/chunks/{chunk-KMQHXFIZ.js → chunk-LJNU4LAR.js} +2094 -1014
  13. package/dist/chunks/{chunk-POBAY3TI.js → chunk-NLYGMVXS.js} +30 -0
  14. package/dist/chunks/{chunk-V7JKTNRO.js → chunk-OE45PREW.js} +1 -1
  15. package/dist/chunks/{chunk-MEEJIIIA.js → chunk-OP2GL7ZT.js} +77 -8
  16. package/dist/chunks/{chunk-YFJ3OQZS.js → chunk-OPLXELPS.js} +5 -1
  17. package/dist/chunks/{chunk-CVLGFVDC.js → chunk-PDYE6CWS.js} +136 -64
  18. package/dist/chunks/{chunk-OMCDMELK.js → chunk-PUIHJFK4.js} +1 -1
  19. package/dist/chunks/{chunk-MPE6VLLY.js → chunk-UZ4YWUZ7.js} +1 -1
  20. package/dist/chunks/{tools-AVJ3XJ5A.js → tools-VCCH3JNL.js} +13 -6
  21. package/dist/cli/bin.js +11 -10
  22. package/dist/cli/config.d.ts +0 -2
  23. package/dist/cli/index.js +10 -9
  24. package/dist/cli/offered.d.ts +31 -2
  25. package/dist/cli/serve.d.ts +4 -2
  26. package/dist/combine/index.js +60 -4
  27. package/dist/emailbison/index.js +4 -4
  28. package/dist/fixtures/index.js +4 -4
  29. package/dist/heyreach/index.js +17 -6
  30. package/dist/identity/index.js +46 -11
  31. package/dist/identity/keys.d.ts +1 -1
  32. package/dist/index.js +8 -6
  33. package/dist/insights/capped.d.ts +14 -1
  34. package/dist/insights/define.d.ts +8 -6
  35. package/dist/insights/index.d.ts +1 -1
  36. package/dist/insights/index.js +12 -61
  37. package/dist/insights/inputs.generated.d.ts +91 -16
  38. package/dist/insights/ops/campaign-ranking.d.ts +8 -1
  39. package/dist/insights/ops/channel-mix.d.ts +8 -1
  40. package/dist/insights/ops/client-report.d.ts +28 -18
  41. package/dist/insights/ops/client-runway.d.ts +43 -0
  42. package/dist/insights/ops/index.d.ts +6 -1
  43. package/dist/insights/ops/period-comparison.d.ts +35 -2
  44. package/dist/insights/ops/pipeline-forecast.d.ts +14 -9
  45. package/dist/insights/ops/shared.d.ts +49 -2
  46. package/dist/insights/ops/tag-rollup.d.ts +8 -1
  47. package/dist/insights/people/coverage.d.ts +26 -0
  48. package/dist/insights/people/dropped-replies-check.d.ts +19 -3
  49. package/dist/insights/people/dropped-replies.d.ts +6 -2
  50. package/dist/insights/people/find.d.ts +5 -4
  51. package/dist/insights/people/hot-leads.d.ts +10 -1
  52. package/dist/insights/people/index.d.ts +26 -2
  53. package/dist/insights/people/lead-collisions.d.ts +18 -1
  54. package/dist/insights/people/person-summary.d.ts +15 -3
  55. package/dist/insights/people/suppression-check.d.ts +18 -1
  56. package/dist/insights/people/thread-context.d.ts +79 -0
  57. package/dist/insights/people/thread-contexts.d.ts +59 -0
  58. package/dist/insights/people/thread-read.d.ts +33 -0
  59. package/dist/insights/registry.d.ts +29 -3
  60. package/dist/insights/senders/domain-health.d.ts +1 -1
  61. package/dist/insights/senders/index.d.ts +1 -1
  62. package/dist/insights/senders/read.d.ts +9 -0
  63. package/dist/insights/tools.d.ts +35 -2
  64. package/dist/instantly/adapter.d.ts +3 -2
  65. package/dist/instantly/capabilities.d.ts +5 -0
  66. package/dist/instantly/index.js +255 -66
  67. package/dist/instantly/lead-ids.d.ts +11 -0
  68. package/dist/instantly/map-lead.d.ts +19 -2
  69. package/dist/instantly/senders.d.ts +3 -0
  70. package/dist/internal/adapter.d.ts +7 -0
  71. package/dist/internal/capabilities.d.ts +8 -0
  72. package/dist/internal/entities.d.ts +24 -1
  73. package/dist/internal/fields.d.ts +10 -0
  74. package/dist/internal/outbound/api.d.ts +12 -0
  75. package/dist/internal/outbound/operations-account.d.ts +4 -1
  76. package/dist/internal/outbound/outbound.d.ts +2 -1
  77. package/dist/internal/outbound/specs-account.d.ts +2 -1
  78. package/dist/internal/person.d.ts +32 -0
  79. package/dist/internal/records.d.ts +2 -2
  80. package/dist/internal/reply-people.d.ts +25 -7
  81. package/dist/internal/runway.d.ts +38 -5
  82. package/dist/internal/url.d.ts +2 -1
  83. package/dist/loader/index.js +1 -1
  84. package/dist/memory/data.d.ts +2 -1
  85. package/dist/memory/index.js +6 -4
  86. package/dist/redact/index.d.ts +1 -1
  87. package/dist/redact/index.js +62 -31
  88. package/dist/redact/plugin.d.ts +13 -11
  89. package/dist/redact/tokens.d.ts +18 -1
  90. package/dist/smartlead/index.js +21 -7
  91. package/dist/tools/account-tools.d.ts +0 -5
  92. package/dist/tools/ai-sdk.js +5 -3
  93. package/dist/tools/campaign-tools.d.ts +0 -4
  94. package/dist/tools/claude-agent.js +5 -3
  95. package/dist/tools/deliverability-check.d.ts +9 -0
  96. package/dist/tools/index.js +6 -4
  97. package/dist/tools/people-tools.d.ts +4 -1
  98. package/dist/tools/person-input.d.ts +17 -0
  99. package/dist/tools/registry.d.ts +8 -1
  100. package/dist/tools/sender-health.d.ts +8 -0
  101. package/dist/tools/sender-impact.d.ts +38 -0
  102. package/dist/tools/shared.d.ts +5 -0
  103. package/dist/webhooks/index.js +6 -6
  104. package/package.json +1 -1
  105. /package/dist/chunks/{chunk-5XLR6XVV.js → chunk-HNYJO6B4.js} +0 -0
@@ -2,26 +2,28 @@ import type { Lead } from "../internal/entities.ts";
2
2
  import type { ListAll } from "../internal/outbound/api.ts";
3
3
  import type { OutboundPlugin } from "../internal/outbound/plugins.ts";
4
4
  import type { Identifier } from "./tokens.ts";
5
- export { KNOWN_TOKENS, MIN_KEY_LENGTH } from "./tokens.ts";
5
+ export { KNOWN_TOKENS, MIN_KEY_LENGTH, REDACT_KEY_ENV } from "./tokens.ts";
6
6
  export type RedactField = "body" | "company" | "custom" | "email" | "linkedin" | "name" | "phone" | "subject";
7
7
  export interface RedactOptions {
8
8
  /** What to mask. Defaults to everything. */
9
9
  readonly fields?: readonly RedactField[] | undefined;
10
10
  /**
11
11
  * `mask` replaces a value with `[redacted]`, and an address or a profile
12
- * with a token keyed for this plugin, so people can still be counted and
13
- * joined while it lives. `hash` replaces every value with a stable token,
14
- * so the same person gets the same token from one run to the next.
12
+ * with a keyed token, so people can still be counted and joined. `hash`
13
+ * replaces every value with a token under the key. `hash` with no key is
14
+ * deprecated: its tokens can be computed from a guessed address, so it
15
+ * warns once on stderr and adds a note to every answer.
15
16
  */
16
17
  readonly strategy?: "hash" | "mask" | undefined;
17
18
  /**
18
19
  * A secret, at least `MIN_KEY_LENGTH` (32) characters, that keys the
19
- * tokens `mask` writes for addresses and profiles. With it the same person
20
- * gets the same token in every instance and process given the same key, so
21
- * redacted data can be joined across runs. Without it each plugin makes a
22
- * random key of its own. Anyone holding the key can test a guessed address
23
- * against a token, and a new key gives every person a new token. Only for
24
- * `mask`; `hash` needs no key.
20
+ * tokens. Defaults to `OUTBOUND_REDACT_KEY`, as in the CLI and
21
+ * `outbound mcp`. With it the same person gets the same token in every
22
+ * instance and process given the same key, under `mask` and `hash` alike,
23
+ * so redacted data can be joined across runs. Without it `mask` makes a
24
+ * random key for each plugin, and `hash` is unkeyed. Anyone holding the
25
+ * key can test a guessed address against a token, and a new key gives
26
+ * every person a new token.
25
27
  */
26
28
  readonly key?: string | undefined;
27
29
  }
@@ -34,7 +36,7 @@ export interface RedactExtension {
34
36
  readonly strategy: "hash" | "mask";
35
37
  /**
36
38
  * What this redact writes in place of `value` in a masked field: the
37
- * stable token under `hash`, so a caller can find a known address among
39
+ * token under `hash`, so a caller can find a known address among
38
40
  * hashed records without the records holding it; `[redacted]` under
39
41
  * `mask`, whose tokens for addresses and profiles are keyed and never
40
42
  * given out.
@@ -1,7 +1,17 @@
1
+ import type { Operation } from "../internal/outbound/operations.ts";
1
2
  /** The shortest `key` `redact` accepts. */
2
3
  export declare const MIN_KEY_LENGTH = 32;
4
+ /** The environment variable `redact` reads its key from when none is given. */
5
+ export declare const REDACT_KEY_ENV = "OUTBOUND_REDACT_KEY";
3
6
  export declare const keyedToken: (secret: string | undefined) => ((value: string) => string);
4
- export declare const checkedKey: (key: string | undefined, strategy: "hash" | "mask") => string | undefined;
7
+ export declare const checkedKey: (key: string | undefined) => string | undefined;
8
+ /** On every answer that holds a token from a redact with no key, by strategy. */
9
+ export declare const KEYLESS_NOTES: {
10
+ readonly hash: "redact's hash strategy has no key, so anyone can compute a token from a guessed email address or profile. Unkeyed hash is deprecated: set OUTBOUND_REDACT_KEY or pass redact({ key }) to key it.";
11
+ readonly mask: "redact has no key, so its tokens for addresses and profiles hold only within this instance or process and do not join across runs. Set OUTBOUND_REDACT_KEY or pass redact({ key }) to keep them.";
12
+ };
13
+ /** Warns once per process that a hash with no key can be recomputed. */
14
+ export declare const warnUnkeyedHash: () => void;
5
15
  export type Identifier = "email" | "linkedin";
6
16
  /** The most tokens one redact remembers the value of; the oldest go first. */
7
17
  export declare const KNOWN_TOKENS = 10000;
@@ -19,3 +29,10 @@ export interface Known {
19
29
  readonly remask: (text: string) => string;
20
30
  }
21
31
  export declare const knownTokens: () => Known;
32
+ /** What to do about a token no process can put back but the one that wrote it. */
33
+ export declare const UNKNOWN_TOKEN_REMEDY = "Redact keeps what each token stands for in memory, only in the process that wrote it, so it is not sent to the vendor. Run the tool that returned it again in this session. The redact key (redact's key option, or OUTBOUND_REDACT_KEY in the environment) keeps tokens the same across runs, so a token you kept matches its records again once they are read in the new session.";
34
+ /**
35
+ * Refuses a call that still names a token once every known one is put back:
36
+ * a token from another session or process would reach the vendor as it is.
37
+ */
38
+ export declare const refuseUnknownTokens: (operation: Operation, provider: string) => void;
@@ -13,7 +13,7 @@ import {
13
13
  toWorkspace,
14
14
  unwrap,
15
15
  withoutSecrets
16
- } from "../chunks/chunk-UAHYPASH.js";
16
+ } from "../chunks/chunk-3LRIWQEJ.js";
17
17
  import {
18
18
  applyTracking,
19
19
  ownTracking,
@@ -32,7 +32,7 @@ import {
32
32
  createVendorClient,
33
33
  fromOne,
34
34
  listIn
35
- } from "../chunks/chunk-UOJG4VYF.js";
35
+ } from "../chunks/chunk-LD5OAELW.js";
36
36
  import {
37
37
  normalizeBody
38
38
  } from "../chunks/chunk-FALWG5U3.js";
@@ -50,7 +50,7 @@ import {
50
50
  refTo,
51
51
  refsTo
52
52
  } from "../chunks/chunk-U5AK6OJM.js";
53
- import "../chunks/chunk-POBAY3TI.js";
53
+ import "../chunks/chunk-NLYGMVXS.js";
54
54
  import {
55
55
  emptyCounts,
56
56
  metricRow
@@ -58,10 +58,10 @@ import {
58
58
  import {
59
59
  replyCategorySchema
60
60
  } from "../chunks/chunk-QGRZDTX4.js";
61
+ import "../chunks/chunk-OPLXELPS.js";
61
62
  import {
62
63
  assertWorkspaceId
63
64
  } from "../chunks/chunk-HXB2IOJJ.js";
64
- import "../chunks/chunk-YFJ3OQZS.js";
65
65
  import {
66
66
  stableId
67
67
  } from "../chunks/chunk-KVAG5GM2.js";
@@ -186,11 +186,20 @@ var fields = {
186
186
  lead: {
187
187
  companyLinkedinUrl: false,
188
188
  engagement: false,
189
+ meeting: false,
189
190
  recipientMailProvider: false,
190
191
  title: false
191
192
  },
192
- // A message is not marked automatic; a reply is.
193
- message: { isAuto: false, isAutoSource: false, variantKey: false },
193
+ // A message is not marked automatic; a reply is. No link to one master
194
+ // inbox conversation is documented.
195
+ message: {
196
+ isAuto: false,
197
+ // Read only by the Instantly adapter, whose emails name their lead by address.
198
+ leadEmail: false,
199
+ isAutoSource: false,
200
+ url: false,
201
+ variantKey: false
202
+ },
194
203
  metricRow: {
195
204
  completed: false,
196
205
  connectionsAccepted: false,
@@ -209,6 +218,7 @@ var fields = {
209
218
  // SmartDelivery's list gives a test's schedule and nothing else about it.
210
219
  placementTest: { campaignRef: false, createdAt: false, nextRunAt: false },
211
220
  reply: {
221
+ leadEmail: false,
212
222
  // The lead's category, not a label on the message.
213
223
  category: "derived",
214
224
  categorySource: "derived",
@@ -218,6 +228,7 @@ var fields = {
218
228
  leftCompany: "derived",
219
229
  // The master inbox does not say which step a reply answers.
220
230
  stepIndex: false,
231
+ url: false,
221
232
  variantKey: false
222
233
  },
223
234
  sender: { linkedinUrl: false },
@@ -308,7 +319,8 @@ var caveats = [
308
319
  "Tags come from GET /email-accounts/tags; whether campaign tags share that list is unconfirmed.",
309
320
  "Webhooks are listed per campaign; without one the adapter walks the campaigns and returns each once. User-level or client-level webhooks may appear under none.",
310
321
  "Placement tests are read from SmartDelivery (smartdelivery.smartlead.ai) with the same key: an account without the product is refused. The list is documented without pages, and manual is read as a one-time test. A test's results stay native, because SmartDelivery reports them as rates.",
311
- "Block list entries with an @ are emails, the rest domains."
322
+ "Block list entries with an @ are emails, the rest domains.",
323
+ "A message's or reply's url is null: Smartlead documents no link to one master inbox conversation. The app_url and ui_master_inbox_link of its webhooks are documented with the master inbox page only (https://app.smartlead.ai/app/master-inbox), and no read returns a link."
312
324
  ];
313
325
 
314
326
  // src/smartlead/map-account.ts
@@ -551,6 +563,8 @@ var messageFields = (identity, place, parts, includeBody) => ({
551
563
  stepIndex: place.stepIndex ?? null,
552
564
  subject: parts.subject,
553
565
  threadId: place.threadId ?? null,
566
+ // Smartlead documents no link to one master inbox conversation.
567
+ url: null,
554
568
  variantKey: null
555
569
  });
556
570
  var activityMessages = (identity, row, activity, includeBody) => {
@@ -4,11 +4,6 @@ declare const setupInput: z.ZodObject<{
4
4
  campaign: z.ZodString;
5
5
  }, z.core.$strip>;
6
6
  export declare const campaignSetup: ToolDefinition<z.infer<typeof setupInput>>;
7
- declare const deliverabilityInput: z.ZodObject<{
8
- campaign: z.ZodOptional<z.ZodString>;
9
- limit: z.ZodDefault<z.ZodNumber>;
10
- }, z.core.$strip>;
11
- export declare const deliverabilityCheck: ToolDefinition<z.infer<typeof deliverabilityInput>>;
12
7
  declare const nativeInput: z.ZodObject<{
13
8
  name: z.ZodOptional<z.ZodString>;
14
9
  params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  createTools
3
- } from "../chunks/chunk-OVTYA3IB.js";
4
- import "../chunks/chunk-FTK4JS65.js";
3
+ } from "../chunks/chunk-EAG5NIPM.js";
4
+ import "../chunks/chunk-BTIJ24UY.js";
5
5
  import "../chunks/chunk-4PA526S7.js";
6
+ import "../chunks/chunk-I7GBBHD2.js";
6
7
  import "../chunks/chunk-HZCTYL22.js";
7
8
  import "../chunks/chunk-HPNGSG5E.js";
8
9
  import "../chunks/chunk-PTZO4QXR.js";
9
- import "../chunks/chunk-POBAY3TI.js";
10
+ import "../chunks/chunk-NLYGMVXS.js";
10
11
  import "../chunks/chunk-CPACP4YD.js";
11
12
  import "../chunks/chunk-QGRZDTX4.js";
13
+ import "../chunks/chunk-OPLXELPS.js";
12
14
  import "../chunks/chunk-HXB2IOJJ.js";
13
15
  import "../chunks/chunk-XYHM4KHC.js";
14
16
  import "../chunks/chunk-45TXPJW7.js";
@@ -38,10 +38,6 @@ declare const stepsInput: z.ZodObject<{
38
38
  to: z.ZodOptional<z.ZodString>;
39
39
  }, z.core.$strip>;
40
40
  export declare const winningSteps: ToolDefinition<z.infer<typeof stepsInput>>;
41
- declare const healthInput: z.ZodObject<{
42
- limit: z.ZodDefault<z.ZodNumber>;
43
- }, z.core.$strip>;
44
- export declare const senderHealth: ToolDefinition<z.infer<typeof healthInput>>;
45
41
  declare const samplesInput: z.ZodObject<{
46
42
  campaign: z.ZodOptional<z.ZodString>;
47
43
  by: z.ZodDefault<z.ZodEnum<{
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  createTools
3
- } from "../chunks/chunk-OVTYA3IB.js";
4
- import "../chunks/chunk-FTK4JS65.js";
3
+ } from "../chunks/chunk-EAG5NIPM.js";
4
+ import "../chunks/chunk-BTIJ24UY.js";
5
5
  import "../chunks/chunk-4PA526S7.js";
6
+ import "../chunks/chunk-I7GBBHD2.js";
6
7
  import "../chunks/chunk-HZCTYL22.js";
7
8
  import "../chunks/chunk-HPNGSG5E.js";
8
9
  import "../chunks/chunk-PTZO4QXR.js";
9
- import "../chunks/chunk-POBAY3TI.js";
10
+ import "../chunks/chunk-NLYGMVXS.js";
10
11
  import "../chunks/chunk-CPACP4YD.js";
11
12
  import "../chunks/chunk-QGRZDTX4.js";
13
+ import "../chunks/chunk-OPLXELPS.js";
12
14
  import "../chunks/chunk-HXB2IOJJ.js";
13
15
  import "../chunks/chunk-XYHM4KHC.js";
14
16
  import "../chunks/chunk-45TXPJW7.js";
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ import type { ToolDefinition } from "./shared.ts";
3
+ declare const checkInput: z.ZodObject<{
4
+ campaign: z.ZodOptional<z.ZodString>;
5
+ limit: z.ZodDefault<z.ZodNumber>;
6
+ max_checked: z.ZodOptional<z.ZodNumber>;
7
+ }, z.core.$strip>;
8
+ export declare const deliverabilityCheck: ToolDefinition<z.infer<typeof checkInput>>;
9
+ export {};
@@ -1,22 +1,24 @@
1
1
  import {
2
2
  openaiTools
3
- } from "../chunks/chunk-OMCDMELK.js";
3
+ } from "../chunks/chunk-PUIHJFK4.js";
4
4
  import {
5
5
  TOOL_NAMES,
6
6
  createTools
7
- } from "../chunks/chunk-OVTYA3IB.js";
7
+ } from "../chunks/chunk-EAG5NIPM.js";
8
8
  import {
9
9
  DEFAULT_BODY_CHARS,
10
10
  DEFAULT_TOOL_REQUESTS,
11
11
  UNTRUSTED_NOTE
12
- } from "../chunks/chunk-FTK4JS65.js";
12
+ } from "../chunks/chunk-BTIJ24UY.js";
13
13
  import "../chunks/chunk-4PA526S7.js";
14
+ import "../chunks/chunk-I7GBBHD2.js";
14
15
  import "../chunks/chunk-HZCTYL22.js";
15
16
  import "../chunks/chunk-HPNGSG5E.js";
16
17
  import "../chunks/chunk-PTZO4QXR.js";
17
- import "../chunks/chunk-POBAY3TI.js";
18
+ import "../chunks/chunk-NLYGMVXS.js";
18
19
  import "../chunks/chunk-CPACP4YD.js";
19
20
  import "../chunks/chunk-QGRZDTX4.js";
21
+ import "../chunks/chunk-OPLXELPS.js";
20
22
  import "../chunks/chunk-HXB2IOJJ.js";
21
23
  import "../chunks/chunk-XYHM4KHC.js";
22
24
  import "../chunks/chunk-45TXPJW7.js";
@@ -12,8 +12,11 @@ declare const compareInput: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  export declare const compareClients: ToolDefinition<z.infer<typeof compareInput>>;
14
14
  declare const personInput: z.ZodObject<{
15
+ email: z.ZodOptional<z.ZodString>;
16
+ lead_ref: z.ZodOptional<z.ZodString>;
17
+ linkedin_url: z.ZodOptional<z.ZodString>;
18
+ person: z.ZodOptional<z.ZodString>;
15
19
  include_bodies: z.ZodDefault<z.ZodBoolean>;
16
- person: z.ZodString;
17
20
  }, z.core.$strip>;
18
21
  export declare const crossChannelLead: ToolDefinition<z.infer<typeof personInput>>;
19
22
  export {};
@@ -0,0 +1,17 @@
1
+ import { z } from "zod";
2
+ export declare const personFields: {
3
+ email: z.ZodOptional<z.ZodString>;
4
+ lead_ref: z.ZodOptional<z.ZodString>;
5
+ linkedin_url: z.ZodOptional<z.ZodString>;
6
+ person: z.ZodOptional<z.ZodString>;
7
+ };
8
+ export interface PersonFields {
9
+ readonly email?: string | undefined;
10
+ readonly lead_ref?: string | undefined;
11
+ readonly linkedin_url?: string | undefined;
12
+ readonly person?: string | undefined;
13
+ }
14
+ /** For `superRefine`: exactly one person field, holding its own kind. */
15
+ export declare const checkPerson: (values: PersonFields, context: z.RefinementCtx) => void;
16
+ /** The one person field given. Call it on values `checkPerson` passed. */
17
+ export declare const personOf: (values: PersonFields) => string;
@@ -47,6 +47,13 @@ export interface ToolsOptions {
47
47
  * instance and `budget()` still apply under it.
48
48
  */
49
49
  readonly maxRequestsPerToolCall?: number | undefined;
50
+ /**
51
+ * On a combined instance, each of its tools as its own instance
52
+ * (`membersOf` in `outbound-sdk/insights`). With them a tool that takes a
53
+ * campaign is offered when one of them supports it, and answers for that
54
+ * tool's campaigns.
55
+ */
56
+ readonly members?: readonly OutboundApi[] | undefined;
50
57
  }
51
58
  /** What `next` says when the hint a tool wrote names a tool that is not on offer. */
52
59
  export declare const NEXT_FALLBACK = "Pick another of the listed tools to go further.";
@@ -55,7 +62,7 @@ export declare const NEXT_FALLBACK = "Pick another of the listed tools to go fur
55
62
  * the words of an `Unsupported` error. `undefined` for a name that is not a
56
63
  * built-in tool, or one the instance offers.
57
64
  */
58
- export declare const leftOutReason: (outbound: OutboundApi, name: string) => string | undefined;
65
+ export declare const leftOutReason: (outbound: OutboundApi, name: string, members?: readonly OutboundApi[]) => string | undefined;
59
66
  /**
60
67
  * The tool set for one instance. A tool that needs a plugin the instance does
61
68
  * not have, or a capability the adapter lacks or a plugin turned off, is left
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import type { ToolDefinition } from "./shared.ts";
3
+ declare const healthInput: z.ZodObject<{
4
+ impact: z.ZodDefault<z.ZodBoolean>;
5
+ limit: z.ZodDefault<z.ZodNumber>;
6
+ }, z.core.$strip>;
7
+ export declare const senderHealth: ToolDefinition<z.infer<typeof healthInput>>;
8
+ export {};
@@ -0,0 +1,38 @@
1
+ import type { SenderHealth } from "../internal/entities-account.ts";
2
+ import type { Sender } from "../internal/entities.ts";
3
+ import type { JsonObject } from "../internal/json.ts";
4
+ import type { OutboundApi } from "../internal/outbound/api.ts";
5
+ /** The days of sends read for each failing sender, today included. */
6
+ export declare const IMPACT_DAYS = 14;
7
+ /**
8
+ * Failing senders past this many get no impact, with a note, where each
9
+ * sender's days cost a read of their own.
10
+ */
11
+ export declare const IMPACT_AT_MOST = 10;
12
+ /**
13
+ * The same where one call reads many senders' days: each sender then costs
14
+ * only the listing of its campaigns.
15
+ */
16
+ export declare const IMPACT_BATCHED_AT_MOST = 200;
17
+ /** The vendor reports the sender disconnected or failing, or that it cannot sign in. */
18
+ export declare const isFailing: (sender: Sender, health?: SenderHealth | null) => boolean;
19
+ /** A request cap the caller set stopped the read: retrying stops there again. */
20
+ export declare const isCapStop: (cause: unknown) => boolean;
21
+ export interface Impact {
22
+ readonly impact: JsonObject;
23
+ readonly requests: number;
24
+ }
25
+ export interface Impacts {
26
+ /** By sender ref. */
27
+ readonly bySender: ReadonlyMap<string, JsonObject>;
28
+ readonly requests: number;
29
+ readonly notes: readonly string[];
30
+ /** Failing senders left without impact. */
31
+ readonly skipped: number;
32
+ }
33
+ /**
34
+ * The impact of the first failing senders, in the order given:
35
+ * `IMPACT_BATCHED_AT_MOST` where the adapter reads many senders' days in one
36
+ * call, `IMPACT_AT_MOST` where each sender's days cost a read of their own.
37
+ */
38
+ export declare const readImpacts: (outbound: OutboundApi, failing: readonly Sender[], now?: number) => Promise<Impacts>;
@@ -18,6 +18,11 @@ export interface ToolSuccess {
18
18
  * otherwise guesses the range it asks for.
19
19
  */
20
20
  readonly today?: string | undefined;
21
+ /**
22
+ * When the answer was computed, ISO 8601 UTC: the time the numbers are
23
+ * as of. Set on every result a tool from `createTools` returns.
24
+ */
25
+ readonly computedAt?: string | undefined;
21
26
  /**
22
27
  * `false` when the answer covers part of what was asked, for example
23
28
  * when `limit` cut a list or a cap stopped a read; `notes` says why.
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  instantlyEvents
3
- } from "../chunks/chunk-MPE6VLLY.js";
3
+ } from "../chunks/chunk-UZ4YWUZ7.js";
4
4
  import {
5
5
  smartleadEvents
6
- } from "../chunks/chunk-UAHYPASH.js";
6
+ } from "../chunks/chunk-3LRIWQEJ.js";
7
7
  import {
8
8
  heyreachEvents
9
9
  } from "../chunks/chunk-UWD65SK7.js";
10
10
  import {
11
11
  emailbisonEvents
12
- } from "../chunks/chunk-UZLFZZ2U.js";
12
+ } from "../chunks/chunk-6BSFR5SF.js";
13
13
  import "../chunks/chunk-SYUMA3CP.js";
14
- import "../chunks/chunk-UOJG4VYF.js";
14
+ import "../chunks/chunk-LD5OAELW.js";
15
15
  import "../chunks/chunk-FALWG5U3.js";
16
16
  import "../chunks/chunk-U5AK6OJM.js";
17
- import "../chunks/chunk-POBAY3TI.js";
17
+ import "../chunks/chunk-NLYGMVXS.js";
18
18
  import {
19
19
  SCHEMA_VERSION
20
20
  } from "../chunks/chunk-QGRZDTX4.js";
21
+ import "../chunks/chunk-OPLXELPS.js";
21
22
  import "../chunks/chunk-HXB2IOJJ.js";
22
- import "../chunks/chunk-YFJ3OQZS.js";
23
23
  import {
24
24
  stableId
25
25
  } from "../chunks/chunk-KVAG5GM2.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "outbound-sdk",
3
- "version": "0.11.0",
3
+ "version": "0.13.0",
4
4
  "description": "One small, typed, read-only API over outbound sending tools.",
5
5
  "keywords": [
6
6
  "cold-email",