@oxygen-agent/cli 1.1014.1997 → 1.1014.2040

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 (119) hide show
  1. package/README.md +1 -1
  2. package/dist/command-families/tables/options.d.ts +1 -0
  3. package/dist/command-families/tables/register-automation.js +3 -1
  4. package/dist/commands/observability.js +4 -4
  5. package/dist/commands/table-runs.js +10 -0
  6. package/dist/commands/tags.js +2 -2
  7. package/dist/commands/workflows.js +31 -10
  8. package/dist/http-client.d.ts +1 -1
  9. package/dist/http-client.js +1 -1
  10. package/node_modules/@oxygen/formula/dist/cross-row-function.d.ts +13 -0
  11. package/node_modules/@oxygen/formula/dist/cross-row-function.js +1 -0
  12. package/node_modules/@oxygen/formula/dist/{refactor-internals → cross-row-functions}/novelty-score.d.ts +2 -0
  13. package/node_modules/@oxygen/formula/dist/{refactor-internals → cross-row-functions}/novelty-score.js +1 -0
  14. package/node_modules/@oxygen/formula/dist/cross-row-functions.generated.d.ts +3 -0
  15. package/node_modules/@oxygen/formula/dist/cross-row-functions.generated.js +3 -0
  16. package/node_modules/@oxygen/formula/dist/evaluate.d.ts +12 -1
  17. package/node_modules/@oxygen/formula/dist/evaluate.js +28 -3
  18. package/node_modules/@oxygen/recipe-sdk/dist/index.d.ts +2 -0
  19. package/node_modules/@oxygen/shared/dist/capability-discovery.js +1 -1
  20. package/node_modules/@oxygen/shared/dist/cell-format.js +2 -2
  21. package/node_modules/@oxygen/shared/dist/collab.d.ts +1 -1
  22. package/node_modules/@oxygen/shared/dist/contracts/geo.js +1 -1
  23. package/node_modules/@oxygen/shared/dist/dnc-identities.js +1 -1
  24. package/node_modules/@oxygen/shared/dist/error-redaction.d.ts +1 -1
  25. package/node_modules/@oxygen/shared/dist/error-redaction.js +2 -2
  26. package/node_modules/@oxygen/shared/dist/esp-contract.d.ts +133 -0
  27. package/node_modules/@oxygen/shared/dist/esp-contract.js +121 -0
  28. package/node_modules/@oxygen/shared/dist/{geo.js → geo/geo.js} +2 -2
  29. package/node_modules/@oxygen/shared/dist/index.d.ts +6 -5
  30. package/node_modules/@oxygen/shared/dist/index.js +7 -5
  31. package/node_modules/@oxygen/shared/dist/knowledge-bootstrap.js +1 -1
  32. package/node_modules/@oxygen/shared/dist/linkedin-connection-identity.js +1 -1
  33. package/node_modules/@oxygen/shared/dist/{sending-domain-rollout.js → mailboxes/sending-domain-rollout.js} +1 -1
  34. package/node_modules/@oxygen/shared/dist/mcp-event-contract.js +1 -1
  35. package/node_modules/@oxygen/shared/dist/{social-post-metrics-core.d.ts → posts/metrics-core.d.ts} +1 -1
  36. package/node_modules/@oxygen/shared/dist/{social-post-metrics-linkedin.d.ts → posts/metrics-linkedin.d.ts} +1 -1
  37. package/node_modules/@oxygen/shared/dist/{social-post-metrics-linkedin.js → posts/metrics-linkedin.js} +2 -2
  38. package/node_modules/@oxygen/shared/dist/{social-post-metrics-series.d.ts → posts/metrics-series.d.ts} +1 -1
  39. package/node_modules/@oxygen/shared/dist/{social-post-metrics-series.js → posts/metrics-series.js} +1 -1
  40. package/node_modules/@oxygen/shared/dist/{social-post-metrics-x.d.ts → posts/metrics-x.d.ts} +1 -1
  41. package/node_modules/@oxygen/shared/dist/{social-post-metrics-x.js → posts/metrics-x.js} +2 -2
  42. package/node_modules/@oxygen/shared/dist/{social-post-metrics.d.ts → posts/metrics.d.ts} +3 -3
  43. package/node_modules/@oxygen/shared/dist/{social-post-metrics.js → posts/metrics.js} +3 -3
  44. package/node_modules/@oxygen/shared/dist/recipient-provider.d.ts +2 -10
  45. package/node_modules/@oxygen/shared/dist/recipient-provider.js +1 -9
  46. package/node_modules/@oxygen/shared/dist/sequence-internals/esp-policy.d.ts +2 -118
  47. package/node_modules/@oxygen/shared/dist/sequence-internals/esp-policy.js +2 -107
  48. package/node_modules/@oxygen/shared/dist/sequences.d.ts +0 -1
  49. package/node_modules/@oxygen/shared/dist/sequences.js +0 -2
  50. package/node_modules/@oxygen/shared/dist/{native-chat-discovery.d.ts → support/native-chat-discovery.d.ts} +1 -1
  51. package/node_modules/@oxygen/shared/dist/{native-chat-discovery.js → support/native-chat-discovery.js} +1 -1
  52. package/node_modules/@oxygen/shared/dist/suppression-entries.js +1 -1
  53. package/node_modules/@oxygen/shared/dist/table-field-types.d.ts +1 -1
  54. package/node_modules/@oxygen/shared/dist/table-field-types.js +2 -2
  55. package/node_modules/@oxygen/shared/dist/{column-output-fields.js → tables/column-output-fields.js} +4 -4
  56. package/node_modules/@oxygen/shared/dist/{tags.d.ts → tags/tags.d.ts} +1 -1
  57. package/node_modules/@oxygen/shared/dist/{tags.js → tags/tags.js} +1 -1
  58. package/node_modules/@oxygen/shared/dist/ugc-amplification-identity.js +1 -1
  59. package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
  60. package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
  61. package/node_modules/@oxygen/shared/dist/workspace-placement-bulk.d.ts +6 -0
  62. package/node_modules/@oxygen/shared/dist/workspace-placement-bulk.js +9 -2
  63. package/node_modules/@oxygen/shared/dist/workspace-placement-schedule.d.ts +44 -0
  64. package/node_modules/@oxygen/shared/dist/workspace-placement-schedule.js +90 -0
  65. package/node_modules/@oxygen/shared/dist/workspace-placement-view.d.ts +24 -0
  66. package/node_modules/@oxygen/shared/dist/workspace-placement-view.js +5 -4
  67. package/node_modules/@oxygen/shared/dist/workspace-placement.d.ts +4 -0
  68. package/node_modules/@oxygen/shared/dist/workspace-placement.js +7 -1
  69. package/node_modules/@oxygen/shared/package.json +0 -25
  70. package/node_modules/@oxygen/workflows/dist/cron.d.ts +42 -0
  71. package/node_modules/@oxygen/workflows/dist/cron.js +271 -0
  72. package/node_modules/@oxygen/workflows/dist/event-dispatch.d.ts +2 -1
  73. package/node_modules/@oxygen/workflows/dist/graph/condition.d.ts +3 -0
  74. package/node_modules/@oxygen/workflows/dist/graph/condition.js +19 -0
  75. package/node_modules/@oxygen/workflows/dist/graph/expression.d.ts +1 -2
  76. package/node_modules/@oxygen/workflows/dist/graph/expression.js +2 -19
  77. package/node_modules/@oxygen/workflows/dist/graph/types.d.ts +4 -3
  78. package/node_modules/@oxygen/workflows/dist/index.d.ts +8 -985
  79. package/node_modules/@oxygen/workflows/dist/index.js +8 -1221
  80. package/node_modules/@oxygen/workflows/dist/manifest-builders.d.ts +73 -0
  81. package/node_modules/@oxygen/workflows/dist/manifest-builders.js +102 -0
  82. package/node_modules/@oxygen/workflows/dist/manifest-guards.d.ts +16 -0
  83. package/node_modules/@oxygen/workflows/dist/manifest-guards.js +34 -0
  84. package/node_modules/@oxygen/workflows/dist/manifest-hash.d.ts +47 -0
  85. package/node_modules/@oxygen/workflows/dist/manifest-hash.js +102 -0
  86. package/node_modules/@oxygen/workflows/dist/manifest-lint.d.ts +17 -0
  87. package/node_modules/@oxygen/workflows/dist/manifest-lint.js +474 -0
  88. package/node_modules/@oxygen/workflows/dist/manifest-types.d.ts +256 -0
  89. package/node_modules/@oxygen/workflows/dist/manifest-types.js +9 -0
  90. package/node_modules/@oxygen/workflows/dist/pure-function.d.ts +17 -0
  91. package/node_modules/@oxygen/workflows/dist/pure-function.js +130 -0
  92. package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-comparison.d.ts +1 -17
  93. package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-comparison.js +1 -93
  94. package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-pattern.d.ts +16 -0
  95. package/node_modules/@oxygen/workflows/dist/refactor-internals/condition-pattern.js +92 -0
  96. package/node_modules/@oxygen/workflows/dist/workflow-schemas.d.ts +545 -0
  97. package/node_modules/@oxygen/workflows/dist/workflow-schemas.js +135 -0
  98. package/node_modules/@oxygen/workflows/package.json +4 -0
  99. package/package.json +1 -1
  100. /package/node_modules/@oxygen/shared/dist/{geo.d.ts → geo/geo.d.ts} +0 -0
  101. /package/node_modules/@oxygen/shared/dist/{sending-domain-rollout.d.ts → mailboxes/sending-domain-rollout.d.ts} +0 -0
  102. /package/node_modules/@oxygen/shared/dist/{attempt-provenance.d.ts → observability/attempt-provenance.d.ts} +0 -0
  103. /package/node_modules/@oxygen/shared/dist/{attempt-provenance.js → observability/attempt-provenance.js} +0 -0
  104. /package/node_modules/@oxygen/shared/dist/{linkedin-mentions.d.ts → posts/linkedin-mentions.d.ts} +0 -0
  105. /package/node_modules/@oxygen/shared/dist/{linkedin-mentions.js → posts/linkedin-mentions.js} +0 -0
  106. /package/node_modules/@oxygen/shared/dist/{linkedin-post-keywords.d.ts → posts/linkedin-post-keywords.d.ts} +0 -0
  107. /package/node_modules/@oxygen/shared/dist/{linkedin-post-keywords.js → posts/linkedin-post-keywords.js} +0 -0
  108. /package/node_modules/@oxygen/shared/dist/{linkedin-post-url.d.ts → posts/linkedin-post-url.d.ts} +0 -0
  109. /package/node_modules/@oxygen/shared/dist/{linkedin-post-url.js → posts/linkedin-post-url.js} +0 -0
  110. /package/node_modules/@oxygen/shared/dist/{social-post-metrics-core.js → posts/metrics-core.js} +0 -0
  111. /package/node_modules/@oxygen/shared/dist/{native-chat.d.ts → support/native-chat.d.ts} +0 -0
  112. /package/node_modules/@oxygen/shared/dist/{native-chat.js → support/native-chat.js} +0 -0
  113. /package/node_modules/@oxygen/shared/dist/{plain-support-events.d.ts → support/plain-support-events.d.ts} +0 -0
  114. /package/node_modules/@oxygen/shared/dist/{plain-support-events.js → support/plain-support-events.js} +0 -0
  115. /package/node_modules/@oxygen/shared/dist/{column-output-fields.d.ts → tables/column-output-fields.d.ts} +0 -0
  116. /package/node_modules/@oxygen/shared/dist/{linkedin-url.d.ts → tables/linkedin-url.d.ts} +0 -0
  117. /package/node_modules/@oxygen/shared/dist/{linkedin-url.js → tables/linkedin-url.js} +0 -0
  118. /package/node_modules/@oxygen/shared/dist/{select-options.d.ts → tables/select-options.d.ts} +0 -0
  119. /package/node_modules/@oxygen/shared/dist/{select-options.js → tables/select-options.js} +0 -0
@@ -0,0 +1,121 @@
1
+ /**
2
+ * The ESP vocabulary: matching modes, routing-policy shapes and recipient families.
3
+ * Declarations only, so contracts and settings types can name them without loading
4
+ * the routing and MX-inference code in `sequence-internals/esp-policy.ts`, which re-exports all of it.
5
+ */
6
+ /**
7
+ * ESP (email service provider) MATCHING mode for a sequence (settings.esp_matching).
8
+ * Deliverability lore: a send lands better when the SENDING mailbox and the
9
+ * RECIPIENT sit on the same provider (Google→Google, Microsoft→Microsoft), so at
10
+ * mailbox-pick the dispatcher can bias rotation toward a same-ESP mailbox.
11
+ * - "off" — no ESP bias; rotation is pure LRU / domain-spread.
12
+ * - "prefer" — (DEFAULT) pick a same-ESP mailbox when one is available, else
13
+ * fall back to any sendable mailbox (never blocks a send). On by default
14
+ * because it only ever improves deliverability and cannot starve sends.
15
+ * - "strict" — require a same-ESP mailbox; when none is available the action is
16
+ * DEFERRED with a visible skipped_reason rather than sent cross-provider.
17
+ * Power-user setting, reachable via CLI/MCP; the web "Provider Matching"
18
+ * checkbox toggles off↔prefer only.
19
+ */
20
+ export const ESP_MATCHING_MODES = ["off", "prefer", "strict"];
21
+ // Provider Matching is ON by default (prefer): a same-provider send lands better,
22
+ // and prefer never blocks — an absent setting biases mailbox pick without risk.
23
+ export const DEFAULT_ESP_MATCHING_MODE = "prefer";
24
+ /**
25
+ * The MATCHABLE email-provider a recipient routes through — the narrow set ESP
26
+ * matching can act on. Kept intentionally aligned with EMAIL_MAILBOX_PROVIDERS in
27
+ * tenant-db so a mailbox's `provider` and a resolved recipient ESP compare
28
+ * directly: we can only bias rotation toward a provider we can actually SEND
29
+ * from, and the pool is Google/Microsoft only.
30
+ *
31
+ * This is deliberately NARROWER than RECIPIENT_ESP_FAMILIES (what we DISPLAY).
32
+ * A domain behind Proofpoint has family "proofpoint" but may still be matchable
33
+ * as "microsoft" — see resolveEspFamily.
34
+ */
35
+ export const RECIPIENT_ESPS = ["google", "microsoft"];
36
+ /**
37
+ * WEIGHTED SENDER ROUTING — the object form of settings.esp_matching.
38
+ *
39
+ * The three scalar modes above answer one question ("bias toward the recipient's
40
+ * own provider, yes or no"), and they bake in the assumption that same-provider
41
+ * is always better. That assumption fails whenever one provider's senders are in
42
+ * bad standing: a workspace whose Google-hosted domains are refused by Gmail
43
+ * wants its Google-hosted RECIPIENTS served from Microsoft senders, which no
44
+ * scalar mode can express. "off" does not express it either, because free
45
+ * rotation still hands Google recipients a Google sender in proportion to the
46
+ * pool.
47
+ *
48
+ * So the object form states the routing directly, as SEND SHARES per recipient
49
+ * provider:
50
+ *
51
+ * { mode: "prefer",
52
+ * routes: { google: { microsoft: 100 }, microsoft: { microsoft: 100 } },
53
+ * exclude: [{ domain: "burned.example", from_recipients: ["google"] }] }
54
+ *
55
+ * `routes` is keyed by the RECIPIENT's resolved provider; the inner map is the
56
+ * SENDER provider. Weights are relative shares, so { google: 3, microsoft: 1 }
57
+ * and { google: 75, microsoft: 25 } are the same policy and nothing has to sum
58
+ * to 100. An omitted weight is zero. A bucket whose entry is explicitly present
59
+ * but carries no positive weight means "no opinion, rotate freely for this
60
+ * recipient class"; a bucket the operator never mentioned keeps the historical
61
+ * same-provider default, so editing Google routing cannot silently change how
62
+ * Microsoft recipients are served.
63
+ *
64
+ * `exclude` is a hard never, not a preference: a sender domain listed here is
65
+ * removed from the candidate pool for the named recipient buckets (all buckets
66
+ * when `from_recipients` is absent) in EVERY mode, including "off", and it
67
+ * survives the prefer-fallback. A deliverability guard that a matching toggle
68
+ * could disarm would not be a guard.
69
+ *
70
+ * The scalar modes remain valid values and are read as policies, so there is one
71
+ * routing code path rather than two: "prefer" becomes { mode: "prefer" } with no
72
+ * routes, which resolves to the same-provider default and behaves exactly as it
73
+ * did before.
74
+ */
75
+ export const ESP_ROUTE_BUCKETS = ["google", "microsoft", "unknown"];
76
+ /** Cap on settings.esp_matching.exclude — a routing policy, not a suppression list. */
77
+ export const MAX_ESP_SENDER_EXCLUSIONS = 50;
78
+ /** Upper bound on a single route weight; relative shares never need more. */
79
+ export const MAX_ESP_ROUTE_WEIGHT = 1_000_000;
80
+ /**
81
+ * The DISPLAY taxonomy: the mail-infrastructure family a recipient domain sits
82
+ * on. Wider than RecipientEsp because "everything that isn't Google or Microsoft"
83
+ * is not one thing — a list that is 23% Proofpoint is a very different
84
+ * deliverability problem from one that is 23% self-hosted, and collapsing both to
85
+ * null (today's behavior) hides that. Split into three groups:
86
+ *
87
+ * - MAILBOX providers (google, microsoft) — imply a matchable ESP.
88
+ * - GATEWAY vendors (proofpoint, mimecast, ...) — security filters that sit IN
89
+ * FRONT of a mailbox provider. Their MX tells you the filter, NOT where the
90
+ * mailbox lives; the SPF fallback is what sees behind them.
91
+ * - OTHER mailbox hosts (zoho, yahoo, fastmail, ...) and self_hosted — real
92
+ * destinations we simply cannot send as, so never matchable.
93
+ */
94
+ export const RECIPIENT_ESP_FAMILIES = [
95
+ "google",
96
+ "microsoft",
97
+ "proofpoint",
98
+ "mimecast",
99
+ "barracuda",
100
+ "cisco",
101
+ "zscaler",
102
+ "trendmicro",
103
+ "sophos",
104
+ "zoho",
105
+ "yahoo",
106
+ "apple",
107
+ "proton",
108
+ "fastmail",
109
+ "gmx",
110
+ "amazon",
111
+ "self_hosted",
112
+ ];
113
+ /**
114
+ * The recipient side of a deliverability breakdown: which mail infrastructure accepted (or refused)
115
+ * a send. One vocabulary over the ESP-family tables in `sequence-internals/esp-policy.ts`, so MX
116
+ * suffixes and consumer domains are never listed twice. Google and Microsoft are mailbox hosts; the
117
+ * four named gateways front most enterprise mailboxes and filter differently from the host behind
118
+ * them. Every other resolved family (Zoho, Yahoo, other gateways, self-hosted) is `other`;
119
+ * an unresolved or failed lookup is `unknown`, never `other`.
120
+ */
121
+ export const RECIPIENT_PROVIDERS = ["google", "microsoft", "proofpoint", "mimecast", "barracuda", "cisco", "other", "unknown"];
@@ -1,5 +1,5 @@
1
- import { OxygenError } from "./cli-result.js";
2
- import { resolveDeployEnv } from "./deploy-env.js";
1
+ import { OxygenError } from "../cli-result.js";
2
+ import { resolveDeployEnv } from "../deploy-env.js";
3
3
  export const GEO_ENGINES = [
4
4
  "chatgpt",
5
5
  "gemini",
@@ -13,7 +13,7 @@ export * from "./plan-limits.js";
13
13
  export * from "./plan-band.js";
14
14
  export * from "./sending-seats.js";
15
15
  export * from "./sending-seat-capacity.js";
16
- export * from "./plain-support-events.js";
16
+ export * from "./support/plain-support-events.js";
17
17
  export * from "./provider-balance-signal.js";
18
18
  export * from "./provider-funding-errors.js";
19
19
  export * from "./publishing-limits.js";
@@ -58,10 +58,10 @@ export * from "./knowledge-vault-markdown.js";
58
58
  export * from "./knowledge-seed-content.js";
59
59
  export * from "./langfuse.js";
60
60
  export * from "./llm-usage.js";
61
- export * from "./linkedin-mentions.js";
62
- export * from "./linkedin-post-url.js";
61
+ export * from "./posts/linkedin-mentions.js";
62
+ export * from "./posts/linkedin-post-url.js";
63
63
  export * from "./linkedin-quota-denial.js";
64
- export * from "./linkedin-url.js";
64
+ export * from "./tables/linkedin-url.js";
65
65
  export * from "./linkedin-sequences.js";
66
66
  export * from "./member-columns.js";
67
67
  export * from "./microsoft-consent-url.js";
@@ -77,6 +77,7 @@ export * from "./sequence-terminal-events.js";
77
77
  export * from "./call-outcomes.js";
78
78
  export * from "./dial-guardrail-overrides.js";
79
79
  export * from "./sequences.js";
80
+ export { ESP_MATCHING_MODES, type EspMatchingMode, DEFAULT_ESP_MATCHING_MODE, isEspMatchingMode, validateEspMatchingSetting, RECIPIENT_ESPS, type RecipientEsp, ESP_ROUTE_BUCKETS, type EspRouteBucket, type EspRouteWeights, type EspSenderExclusion, type EspRoutingPolicy, type EspMatchingSetting, type ResolvedEspPolicy, MAX_ESP_SENDER_EXCLUSIONS, MAX_ESP_ROUTE_WEIGHT, isEspRouteBucket, normalizeEspSenderDomain, espPolicyFromSetting, espRouteWeightsFor, espRouteCandidates, espExcludedSenderDomains, RECIPIENT_ESP_FAMILIES, type RecipientEspFamily, isRecipientEspFamily, isEspGatewayFamily, matchableEspFromFamily, familyFromMxHosts, espFromSpfRecords, inferRecipientEspFamily, inferRecipientEsp, espFromMxHosts, } from "./sequence-internals/esp-policy.js";
80
81
  export * from "./suppression-entries.js";
81
82
  export * from "./dnc-identities.js";
82
83
  export * from "./dnc-rules.js";
@@ -92,7 +93,7 @@ export * from "./social-capabilities.js";
92
93
  export * from "./signup-lead-deliveries.js";
93
94
  export * from "./sql-error.js";
94
95
  export * from "./postgres-text.js";
95
- export * from "./tags.js";
96
+ export * from "./tags/tags.js";
96
97
  export * from "./telemetry.js";
97
98
  export * from "./tenant-database-secret.js";
98
99
  export * from "./egress-transport-readiness.js";
@@ -13,7 +13,7 @@ export * from "./plan-limits.js";
13
13
  export * from "./plan-band.js";
14
14
  export * from "./sending-seats.js";
15
15
  export * from "./sending-seat-capacity.js";
16
- export * from "./plain-support-events.js";
16
+ export * from "./support/plain-support-events.js";
17
17
  export * from "./provider-balance-signal.js";
18
18
  export * from "./provider-funding-errors.js";
19
19
  export * from "./publishing-limits.js";
@@ -58,10 +58,10 @@ export * from "./knowledge-vault-markdown.js";
58
58
  export * from "./knowledge-seed-content.js";
59
59
  export * from "./langfuse.js";
60
60
  export * from "./llm-usage.js";
61
- export * from "./linkedin-mentions.js";
62
- export * from "./linkedin-post-url.js";
61
+ export * from "./posts/linkedin-mentions.js";
62
+ export * from "./posts/linkedin-post-url.js";
63
63
  export * from "./linkedin-quota-denial.js";
64
- export * from "./linkedin-url.js";
64
+ export * from "./tables/linkedin-url.js";
65
65
  export * from "./linkedin-sequences.js";
66
66
  export * from "./member-columns.js";
67
67
  export * from "./microsoft-consent-url.js";
@@ -77,6 +77,8 @@ export * from "./sequence-terminal-events.js";
77
77
  export * from "./call-outcomes.js";
78
78
  export * from "./dial-guardrail-overrides.js";
79
79
  export * from "./sequences.js";
80
+ // The ESP contract the root barrel has always carried (it used to arrive through sequences.ts).
81
+ export { ESP_MATCHING_MODES, DEFAULT_ESP_MATCHING_MODE, isEspMatchingMode, validateEspMatchingSetting, RECIPIENT_ESPS, ESP_ROUTE_BUCKETS, MAX_ESP_SENDER_EXCLUSIONS, MAX_ESP_ROUTE_WEIGHT, isEspRouteBucket, normalizeEspSenderDomain, espPolicyFromSetting, espRouteWeightsFor, espRouteCandidates, espExcludedSenderDomains, RECIPIENT_ESP_FAMILIES, isRecipientEspFamily, isEspGatewayFamily, matchableEspFromFamily, familyFromMxHosts, espFromSpfRecords, inferRecipientEspFamily, inferRecipientEsp, espFromMxHosts, } from "./sequence-internals/esp-policy.js";
80
82
  export * from "./suppression-entries.js";
81
83
  export * from "./dnc-identities.js";
82
84
  export * from "./dnc-rules.js";
@@ -103,7 +105,7 @@ export * from "./social-capabilities.js";
103
105
  export * from "./signup-lead-deliveries.js";
104
106
  export * from "./sql-error.js";
105
107
  export * from "./postgres-text.js";
106
- export * from "./tags.js";
108
+ export * from "./tags/tags.js";
107
109
  export * from "./telemetry.js";
108
110
  export * from "./tenant-database-secret.js";
109
111
  export * from "./egress-transport-readiness.js";
@@ -55,7 +55,7 @@
55
55
  * The provider sub-cap covers every external research leg, including fallbacks.
56
56
  */
57
57
  import { normalizeLinkedinCompanyUrl } from "./dnc-identities.js";
58
- import { normalizeLinkedinProfileUrl } from "./linkedin-url.js";
58
+ import { normalizeLinkedinProfileUrl } from "./tables/linkedin-url.js";
59
59
  /**
60
60
  * Hard ceiling on managed credits ONE workspace bootstrap may spend, all phases.
61
61
  * 150 since 2026-10-18 (founder, current chat: "increase to at least 100 ... don't
@@ -1,4 +1,4 @@
1
- import { normalizeLinkedinProfileUrl, isLinkedinMemberIdHandle } from "./linkedin-url.js";
1
+ import { normalizeLinkedinProfileUrl, isLinkedinMemberIdHandle } from "./tables/linkedin-url.js";
2
2
  const LINKEDIN_PROFILE_URN_PREFIX = /^urn:li:(?:fs_miniProfile|fsd_profile|member):/;
3
3
  const LINKEDIN_CLASSIC_MEMBER_ID = /^ACo[A-Za-z0-9_-]+$/;
4
4
  function stripLinkedinProfileUrn(value) {
@@ -1,4 +1,4 @@
1
- import { CliHttpError } from "./cli-http-error.js";
1
+ import { CliHttpError } from "../cli-http-error.js";
2
2
  export const SENDING_DOMAIN_ROLLOUT_CODE = "sending_domain_rollout_unavailable";
3
3
  export const SENDING_DOMAIN_ROLLOUT_MESSAGE = "Sending-domain setup and delivery are not available yet.";
4
4
  /** The operator switch that admits the sending-domain lane in one environment. */
@@ -3,7 +3,7 @@ import { arr, enumOf, int, nullable, num, obj, str, unwrapNullable, validateCont
3
3
  import { CRM_ACTIVITY_CREATED_EVENT } from "./crm-activity-events.js";
4
4
  import { CRM_EMAIL_REPLY_CLASSIFIED_EVENT, CRM_WORKFLOW_EVENT_SOURCE, } from "./crm-reply-events.js";
5
5
  import { NOTETAKER_MEETING_COMPLETED_EVENT, NOTETAKER_WORKFLOW_EVENT_SOURCE } from "./notetaker-events.js";
6
- import { slugifyOption } from "./select-options.js";
6
+ import { slugifyOption } from "./tables/select-options.js";
7
7
  import { SEQUENCE_ENROLLMENT_TERMINAL_EVENT, SEQUENCE_TERMINAL_EVENT_SOURCE, SEQUENCE_TERMINAL_STATUSES, } from "./sequence-terminal-events.js";
8
8
  import { resolveAppBaseUrl } from "./signed-token.js";
9
9
  import { isRecord, readCoercedString, readTrimmedString } from "./type-guards.js";
@@ -1,4 +1,4 @@
1
- import type { SocialPostMetric } from "./social-capabilities.js";
1
+ import type { SocialPostMetric } from "../social-capabilities.js";
2
2
  /**
3
3
  * One provider read of a post's engagement, parsed into the registry vocabulary.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { type ParsedSocialPostMetrics } from "./social-post-metrics-core.js";
1
+ import { type ParsedSocialPostMetrics } from "./metrics-core.js";
2
2
  /**
3
3
  * Bump when the parse of a stored LinkedIn payload changes meaning, so stored raw
4
4
  * payloads can be re-derived.
@@ -1,5 +1,5 @@
1
- import { pickMetricCount, presentMetrics, readMetricCount, } from "./social-post-metrics-core.js";
2
- import { isRecord } from "./type-guards.js";
1
+ import { pickMetricCount, presentMetrics, readMetricCount, } from "./metrics-core.js";
2
+ import { isRecord } from "../type-guards.js";
3
3
  /**
4
4
  * Bump when the parse of a stored LinkedIn payload changes meaning, so stored raw
5
5
  * payloads can be re-derived.
@@ -1,4 +1,4 @@
1
- import type { SocialPostMetric } from "./social-capabilities.js";
1
+ import type { SocialPostMetric } from "../social-capabilities.js";
2
2
  /**
3
3
  * Engagement EARNED per day, derived from cumulative provider counters.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { zoneOffsetMs } from "./zoned-time.js";
1
+ import { zoneOffsetMs } from "../zoned-time.js";
2
2
  export const EARNED_SERIES_MAX_PRORATE_MS = 3 * 24 * 60 * 60 * 1000;
3
3
  function pointsFor(timeline, metric) {
4
4
  const points = [];
@@ -1,4 +1,4 @@
1
- import { type ParsedSocialPostMetrics } from "./social-post-metrics-core.js";
1
+ import { type ParsedSocialPostMetrics } from "./metrics-core.js";
2
2
  export declare const X_COMPOSIO_POST_METRICS_PARSER_VERSION = 1;
3
3
  /**
4
4
  * Every field the X parse reads, and nothing else: the post's and its media's
@@ -1,5 +1,5 @@
1
- import { pickMetricCount, presentMetrics, } from "./social-post-metrics-core.js";
2
- import { isRecord } from "./type-guards.js";
1
+ import { pickMetricCount, presentMetrics, } from "./metrics-core.js";
2
+ import { isRecord } from "../type-guards.js";
3
3
  export const X_COMPOSIO_POST_METRICS_PARSER_VERSION = 1;
4
4
  function xPostEnvelope(payload) {
5
5
  const firstData = isRecord(payload.data) ? payload.data : payload;
@@ -1,6 +1,6 @@
1
- import { type SocialPostMetric } from "./social-capabilities.js";
2
- import type { ParsedSocialPostMetrics } from "./social-post-metrics-core.js";
3
- export type { ParsedSocialPostMetrics } from "./social-post-metrics-core.js";
1
+ import { type SocialPostMetric } from "../social-capabilities.js";
2
+ import type { ParsedSocialPostMetrics } from "./metrics-core.js";
3
+ export type { ParsedSocialPostMetrics } from "./metrics-core.js";
4
4
  /** Null when no parser is registered for the pair. */
5
5
  export declare function parseSocialPostMetrics(input: {
6
6
  channel: string;
@@ -1,6 +1,6 @@
1
- import { getSocialCapabilityProfile, SOCIAL_POST_METRICS, } from "./social-capabilities.js";
2
- import { LINKEDIN_UNIPILE_POST_METRICS_PARSER_VERSION, linkedInUnipileMetricEvidence, parseLinkedInUnipilePostMetrics, } from "./social-post-metrics-linkedin.js";
3
- import { parseXComposioPostMetrics, X_COMPOSIO_POST_METRICS_PARSER_VERSION, xComposioMetricEvidence, } from "./social-post-metrics-x.js";
1
+ import { getSocialCapabilityProfile, SOCIAL_POST_METRICS, } from "../social-capabilities.js";
2
+ import { LINKEDIN_UNIPILE_POST_METRICS_PARSER_VERSION, linkedInUnipileMetricEvidence, parseLinkedInUnipilePostMetrics, } from "./metrics-linkedin.js";
3
+ import { parseXComposioPostMetrics, X_COMPOSIO_POST_METRICS_PARSER_VERSION, xComposioMetricEvidence, } from "./metrics-x.js";
4
4
  const POST_METRICS_PARSERS = {
5
5
  "linkedin:unipile": {
6
6
  version: LINKEDIN_UNIPILE_POST_METRICS_PARSER_VERSION,
@@ -1,13 +1,5 @@
1
- /**
2
- * The recipient side of a deliverability breakdown: which mail infrastructure accepted (or refused)
3
- * a send. One vocabulary over the ESP-family tables in `sequence-internals/esp-policy.ts`, so MX
4
- * suffixes and consumer domains are never listed twice. Google and Microsoft are mailbox hosts; the
5
- * four named gateways front most enterprise mailboxes and filter differently from the host behind
6
- * them. Every other resolved family (Zoho, Yahoo, other gateways, self-hosted) is `other`;
7
- * an unresolved or failed lookup is `unknown`, never `other`.
8
- */
9
- export declare const RECIPIENT_PROVIDERS: readonly ["google", "microsoft", "proofpoint", "mimecast", "barracuda", "cisco", "other", "unknown"];
10
- export type RecipientProvider = (typeof RECIPIENT_PROVIDERS)[number];
1
+ import type { RecipientProvider } from "./esp-contract.js";
2
+ export { RECIPIENT_PROVIDERS, type RecipientProvider } from "./esp-contract.js";
11
3
  /** A stored ESP family (recipient_esp_cache.family) as a provider; null means not resolved. */
12
4
  export declare function recipientProviderFromFamily(family: string | null | undefined): RecipientProvider;
13
5
  /** MX exchange hosts as a provider. An answer naming no known vendor is `other`; no hosts is `unknown`. */
@@ -1,13 +1,5 @@
1
1
  import { consumerRecipientDomainFamilies, familyFromMxHosts, inferRecipientEspFamily, } from "./sequence-internals/esp-policy.js";
2
- /**
3
- * The recipient side of a deliverability breakdown: which mail infrastructure accepted (or refused)
4
- * a send. One vocabulary over the ESP-family tables in `sequence-internals/esp-policy.ts`, so MX
5
- * suffixes and consumer domains are never listed twice. Google and Microsoft are mailbox hosts; the
6
- * four named gateways front most enterprise mailboxes and filter differently from the host behind
7
- * them. Every other resolved family (Zoho, Yahoo, other gateways, self-hosted) is `other`;
8
- * an unresolved or failed lookup is `unknown`, never `other`.
9
- */
10
- export const RECIPIENT_PROVIDERS = ["google", "microsoft", "proofpoint", "mimecast", "barracuda", "cisco", "other", "unknown"];
2
+ export { RECIPIENT_PROVIDERS } from "./esp-contract.js";
11
3
  const NAMED_PROVIDERS = new Set(["google", "microsoft", "proofpoint", "mimecast", "barracuda", "cisco"]);
12
4
  /** A stored ESP family (recipient_esp_cache.family) as a provider; null means not resolved. */
13
5
  export function recipientProviderFromFamily(family) {
@@ -1,20 +1,5 @@
1
- /**
2
- * ESP (email service provider) MATCHING mode for a sequence (settings.esp_matching).
3
- * Deliverability lore: a send lands better when the SENDING mailbox and the
4
- * RECIPIENT sit on the same provider (Google→Google, Microsoft→Microsoft), so at
5
- * mailbox-pick the dispatcher can bias rotation toward a same-ESP mailbox.
6
- * - "off" — no ESP bias; rotation is pure LRU / domain-spread.
7
- * - "prefer" — (DEFAULT) pick a same-ESP mailbox when one is available, else
8
- * fall back to any sendable mailbox (never blocks a send). On by default
9
- * because it only ever improves deliverability and cannot starve sends.
10
- * - "strict" — require a same-ESP mailbox; when none is available the action is
11
- * DEFERRED with a visible skipped_reason rather than sent cross-provider.
12
- * Power-user setting, reachable via CLI/MCP; the web "Provider Matching"
13
- * checkbox toggles off↔prefer only.
14
- */
15
- export declare const ESP_MATCHING_MODES: readonly ["off", "prefer", "strict"];
16
- export type EspMatchingMode = (typeof ESP_MATCHING_MODES)[number];
17
- export declare const DEFAULT_ESP_MATCHING_MODE: EspMatchingMode;
1
+ import { type EspMatchingMode, type RecipientEsp, type EspRouteBucket, type EspRouteWeights, type ResolvedEspPolicy, type RecipientEspFamily } from "../esp-contract.js";
2
+ export { ESP_MATCHING_MODES, type EspMatchingMode, DEFAULT_ESP_MATCHING_MODE, RECIPIENT_ESPS, type RecipientEsp, ESP_ROUTE_BUCKETS, type EspRouteBucket, type EspRouteWeights, type EspSenderExclusion, type EspRoutingPolicy, type EspMatchingSetting, type ResolvedEspPolicy, MAX_ESP_SENDER_EXCLUSIONS, MAX_ESP_ROUTE_WEIGHT, RECIPIENT_ESP_FAMILIES, type RecipientEspFamily, } from "../esp-contract.js";
18
3
  export declare function isEspMatchingMode(value: unknown): value is EspMatchingMode;
19
4
  /**
20
5
  * Validate settings.esp_matching before persistence. Absent/null is valid and
@@ -27,91 +12,6 @@ export declare function isEspMatchingMode(value: unknown): value is EspMatchingM
27
12
  * settings validator alongside the budget/prioritization checks.
28
13
  */
29
14
  export declare function validateEspMatchingSetting(value: unknown): void;
30
- /**
31
- * The MATCHABLE email-provider a recipient routes through — the narrow set ESP
32
- * matching can act on. Kept intentionally aligned with EMAIL_MAILBOX_PROVIDERS in
33
- * tenant-db so a mailbox's `provider` and a resolved recipient ESP compare
34
- * directly: we can only bias rotation toward a provider we can actually SEND
35
- * from, and the pool is Google/Microsoft only.
36
- *
37
- * This is deliberately NARROWER than RECIPIENT_ESP_FAMILIES (what we DISPLAY).
38
- * A domain behind Proofpoint has family "proofpoint" but may still be matchable
39
- * as "microsoft" — see resolveEspFamily.
40
- */
41
- export declare const RECIPIENT_ESPS: readonly ["google", "microsoft"];
42
- export type RecipientEsp = (typeof RECIPIENT_ESPS)[number];
43
- /**
44
- * WEIGHTED SENDER ROUTING — the object form of settings.esp_matching.
45
- *
46
- * The three scalar modes above answer one question ("bias toward the recipient's
47
- * own provider, yes or no"), and they bake in the assumption that same-provider
48
- * is always better. That assumption fails whenever one provider's senders are in
49
- * bad standing: a workspace whose Google-hosted domains are refused by Gmail
50
- * wants its Google-hosted RECIPIENTS served from Microsoft senders, which no
51
- * scalar mode can express. "off" does not express it either, because free
52
- * rotation still hands Google recipients a Google sender in proportion to the
53
- * pool.
54
- *
55
- * So the object form states the routing directly, as SEND SHARES per recipient
56
- * provider:
57
- *
58
- * { mode: "prefer",
59
- * routes: { google: { microsoft: 100 }, microsoft: { microsoft: 100 } },
60
- * exclude: [{ domain: "burned.example", from_recipients: ["google"] }] }
61
- *
62
- * `routes` is keyed by the RECIPIENT's resolved provider; the inner map is the
63
- * SENDER provider. Weights are relative shares, so { google: 3, microsoft: 1 }
64
- * and { google: 75, microsoft: 25 } are the same policy and nothing has to sum
65
- * to 100. An omitted weight is zero. A bucket whose entry is explicitly present
66
- * but carries no positive weight means "no opinion, rotate freely for this
67
- * recipient class"; a bucket the operator never mentioned keeps the historical
68
- * same-provider default, so editing Google routing cannot silently change how
69
- * Microsoft recipients are served.
70
- *
71
- * `exclude` is a hard never, not a preference: a sender domain listed here is
72
- * removed from the candidate pool for the named recipient buckets (all buckets
73
- * when `from_recipients` is absent) in EVERY mode, including "off", and it
74
- * survives the prefer-fallback. A deliverability guard that a matching toggle
75
- * could disarm would not be a guard.
76
- *
77
- * The scalar modes remain valid values and are read as policies, so there is one
78
- * routing code path rather than two: "prefer" becomes { mode: "prefer" } with no
79
- * routes, which resolves to the same-provider default and behaves exactly as it
80
- * did before.
81
- */
82
- export declare const ESP_ROUTE_BUCKETS: readonly ["google", "microsoft", "unknown"];
83
- /** The RECIPIENT side of a route: a matchable provider, or "unknown" when resolution failed. */
84
- export type EspRouteBucket = (typeof ESP_ROUTE_BUCKETS)[number];
85
- /** The SENDER side of a route: relative send shares per mailbox provider. */
86
- export type EspRouteWeights = Partial<Record<RecipientEsp, number>>;
87
- export type EspSenderExclusion = {
88
- domain: string;
89
- from_recipients?: EspRouteBucket[];
90
- };
91
- export type EspRoutingPolicy = {
92
- mode?: EspMatchingMode;
93
- routes?: Partial<Record<EspRouteBucket, EspRouteWeights>>;
94
- exclude?: EspSenderExclusion[];
95
- };
96
- /** settings.esp_matching accepts either the legacy scalar or the routing policy. */
97
- export type EspMatchingSetting = EspMatchingMode | EspRoutingPolicy;
98
- /**
99
- * A policy with every field present, which is what the dispatcher and the launch
100
- * preview consume. Produced only by espPolicyFromSetting so both surfaces answer
101
- * identically from the same stored value.
102
- */
103
- export type ResolvedEspPolicy = {
104
- mode: EspMatchingMode;
105
- routes: Partial<Record<EspRouteBucket, EspRouteWeights>>;
106
- exclude: Array<{
107
- domain: string;
108
- buckets: readonly EspRouteBucket[];
109
- }>;
110
- };
111
- /** Cap on settings.esp_matching.exclude — a routing policy, not a suppression list. */
112
- export declare const MAX_ESP_SENDER_EXCLUSIONS = 50;
113
- /** Upper bound on a single route weight; relative shares never need more. */
114
- export declare const MAX_ESP_ROUTE_WEIGHT = 1000000;
115
15
  export declare function isEspRouteBucket(value: unknown): value is EspRouteBucket;
116
16
  /**
117
17
  * A sending domain as the mailbox table stores it: lowercase, no leading "@".
@@ -161,22 +61,6 @@ export declare function espRouteCandidates(input: {
161
61
  * prefer-fallback — see the exclude contract above.
162
62
  */
163
63
  export declare function espExcludedSenderDomains(policy: ResolvedEspPolicy, bucket: EspRouteBucket): string[];
164
- /**
165
- * The DISPLAY taxonomy: the mail-infrastructure family a recipient domain sits
166
- * on. Wider than RecipientEsp because "everything that isn't Google or Microsoft"
167
- * is not one thing — a list that is 23% Proofpoint is a very different
168
- * deliverability problem from one that is 23% self-hosted, and collapsing both to
169
- * null (today's behavior) hides that. Split into three groups:
170
- *
171
- * - MAILBOX providers (google, microsoft) — imply a matchable ESP.
172
- * - GATEWAY vendors (proofpoint, mimecast, ...) — security filters that sit IN
173
- * FRONT of a mailbox provider. Their MX tells you the filter, NOT where the
174
- * mailbox lives; the SPF fallback is what sees behind them.
175
- * - OTHER mailbox hosts (zoho, yahoo, fastmail, ...) and self_hosted — real
176
- * destinations we simply cannot send as, so never matchable.
177
- */
178
- export declare const RECIPIENT_ESP_FAMILIES: readonly ["google", "microsoft", "proofpoint", "mimecast", "barracuda", "cisco", "zscaler", "trendmicro", "sophos", "zoho", "yahoo", "apple", "proton", "fastmail", "gmx", "amazon", "self_hosted"];
179
- export type RecipientEspFamily = (typeof RECIPIENT_ESP_FAMILIES)[number];
180
64
  export declare function isRecipientEspFamily(value: unknown): value is RecipientEspFamily;
181
65
  export declare function isEspGatewayFamily(family: RecipientEspFamily | null | undefined): boolean;
182
66
  /**
@@ -1,23 +1,7 @@
1
1
  import { OxygenError } from "../cli-result.js";
2
2
  import { hashVariantKey } from "../sequence-template.js";
3
- /**
4
- * ESP (email service provider) MATCHING mode for a sequence (settings.esp_matching).
5
- * Deliverability lore: a send lands better when the SENDING mailbox and the
6
- * RECIPIENT sit on the same provider (Google→Google, Microsoft→Microsoft), so at
7
- * mailbox-pick the dispatcher can bias rotation toward a same-ESP mailbox.
8
- * - "off" — no ESP bias; rotation is pure LRU / domain-spread.
9
- * - "prefer" — (DEFAULT) pick a same-ESP mailbox when one is available, else
10
- * fall back to any sendable mailbox (never blocks a send). On by default
11
- * because it only ever improves deliverability and cannot starve sends.
12
- * - "strict" — require a same-ESP mailbox; when none is available the action is
13
- * DEFERRED with a visible skipped_reason rather than sent cross-provider.
14
- * Power-user setting, reachable via CLI/MCP; the web "Provider Matching"
15
- * checkbox toggles off↔prefer only.
16
- */
17
- export const ESP_MATCHING_MODES = ["off", "prefer", "strict"];
18
- // Provider Matching is ON by default (prefer): a same-provider send lands better,
19
- // and prefer never blocks — an absent setting biases mailbox pick without risk.
20
- export const DEFAULT_ESP_MATCHING_MODE = "prefer";
3
+ import { ESP_MATCHING_MODES, DEFAULT_ESP_MATCHING_MODE, RECIPIENT_ESPS, ESP_ROUTE_BUCKETS, MAX_ESP_SENDER_EXCLUSIONS, MAX_ESP_ROUTE_WEIGHT, RECIPIENT_ESP_FAMILIES, } from "../esp-contract.js";
4
+ export { ESP_MATCHING_MODES, DEFAULT_ESP_MATCHING_MODE, RECIPIENT_ESPS, ESP_ROUTE_BUCKETS, MAX_ESP_SENDER_EXCLUSIONS, MAX_ESP_ROUTE_WEIGHT, RECIPIENT_ESP_FAMILIES, } from "../esp-contract.js";
21
5
  export function isEspMatchingMode(value) {
22
6
  return typeof value === "string" && ESP_MATCHING_MODES.includes(value);
23
7
  }
@@ -118,62 +102,6 @@ function validateEspRoutingPolicy(record) {
118
102
  });
119
103
  }
120
104
  }
121
- /**
122
- * The MATCHABLE email-provider a recipient routes through — the narrow set ESP
123
- * matching can act on. Kept intentionally aligned with EMAIL_MAILBOX_PROVIDERS in
124
- * tenant-db so a mailbox's `provider` and a resolved recipient ESP compare
125
- * directly: we can only bias rotation toward a provider we can actually SEND
126
- * from, and the pool is Google/Microsoft only.
127
- *
128
- * This is deliberately NARROWER than RECIPIENT_ESP_FAMILIES (what we DISPLAY).
129
- * A domain behind Proofpoint has family "proofpoint" but may still be matchable
130
- * as "microsoft" — see resolveEspFamily.
131
- */
132
- export const RECIPIENT_ESPS = ["google", "microsoft"];
133
- /**
134
- * WEIGHTED SENDER ROUTING — the object form of settings.esp_matching.
135
- *
136
- * The three scalar modes above answer one question ("bias toward the recipient's
137
- * own provider, yes or no"), and they bake in the assumption that same-provider
138
- * is always better. That assumption fails whenever one provider's senders are in
139
- * bad standing: a workspace whose Google-hosted domains are refused by Gmail
140
- * wants its Google-hosted RECIPIENTS served from Microsoft senders, which no
141
- * scalar mode can express. "off" does not express it either, because free
142
- * rotation still hands Google recipients a Google sender in proportion to the
143
- * pool.
144
- *
145
- * So the object form states the routing directly, as SEND SHARES per recipient
146
- * provider:
147
- *
148
- * { mode: "prefer",
149
- * routes: { google: { microsoft: 100 }, microsoft: { microsoft: 100 } },
150
- * exclude: [{ domain: "burned.example", from_recipients: ["google"] }] }
151
- *
152
- * `routes` is keyed by the RECIPIENT's resolved provider; the inner map is the
153
- * SENDER provider. Weights are relative shares, so { google: 3, microsoft: 1 }
154
- * and { google: 75, microsoft: 25 } are the same policy and nothing has to sum
155
- * to 100. An omitted weight is zero. A bucket whose entry is explicitly present
156
- * but carries no positive weight means "no opinion, rotate freely for this
157
- * recipient class"; a bucket the operator never mentioned keeps the historical
158
- * same-provider default, so editing Google routing cannot silently change how
159
- * Microsoft recipients are served.
160
- *
161
- * `exclude` is a hard never, not a preference: a sender domain listed here is
162
- * removed from the candidate pool for the named recipient buckets (all buckets
163
- * when `from_recipients` is absent) in EVERY mode, including "off", and it
164
- * survives the prefer-fallback. A deliverability guard that a matching toggle
165
- * could disarm would not be a guard.
166
- *
167
- * The scalar modes remain valid values and are read as policies, so there is one
168
- * routing code path rather than two: "prefer" becomes { mode: "prefer" } with no
169
- * routes, which resolves to the same-provider default and behaves exactly as it
170
- * did before.
171
- */
172
- export const ESP_ROUTE_BUCKETS = ["google", "microsoft", "unknown"];
173
- /** Cap on settings.esp_matching.exclude — a routing policy, not a suppression list. */
174
- export const MAX_ESP_SENDER_EXCLUSIONS = 50;
175
- /** Upper bound on a single route weight; relative shares never need more. */
176
- export const MAX_ESP_ROUTE_WEIGHT = 1_000_000;
177
105
  export function isEspRouteBucket(value) {
178
106
  return typeof value === "string" && ESP_ROUTE_BUCKETS.includes(value);
179
107
  }
@@ -323,39 +251,6 @@ export function espExcludedSenderDomains(policy, bucket) {
323
251
  }
324
252
  return [...domains];
325
253
  }
326
- /**
327
- * The DISPLAY taxonomy: the mail-infrastructure family a recipient domain sits
328
- * on. Wider than RecipientEsp because "everything that isn't Google or Microsoft"
329
- * is not one thing — a list that is 23% Proofpoint is a very different
330
- * deliverability problem from one that is 23% self-hosted, and collapsing both to
331
- * null (today's behavior) hides that. Split into three groups:
332
- *
333
- * - MAILBOX providers (google, microsoft) — imply a matchable ESP.
334
- * - GATEWAY vendors (proofpoint, mimecast, ...) — security filters that sit IN
335
- * FRONT of a mailbox provider. Their MX tells you the filter, NOT where the
336
- * mailbox lives; the SPF fallback is what sees behind them.
337
- * - OTHER mailbox hosts (zoho, yahoo, fastmail, ...) and self_hosted — real
338
- * destinations we simply cannot send as, so never matchable.
339
- */
340
- export const RECIPIENT_ESP_FAMILIES = [
341
- "google",
342
- "microsoft",
343
- "proofpoint",
344
- "mimecast",
345
- "barracuda",
346
- "cisco",
347
- "zscaler",
348
- "trendmicro",
349
- "sophos",
350
- "zoho",
351
- "yahoo",
352
- "apple",
353
- "proton",
354
- "fastmail",
355
- "gmx",
356
- "amazon",
357
- "self_hosted",
358
- ];
359
254
  export function isRecipientEspFamily(value) {
360
255
  return typeof value === "string" && RECIPIENT_ESP_FAMILIES.includes(value);
361
256
  }
@@ -91,7 +91,6 @@ export declare const SEQUENCE_EMAIL_COLUMN_KEYS: readonly ["email", "email_addre
91
91
  export declare function recipientEmailFromRow(rowValues: Record<string, unknown> | null | undefined, emailColumnKey?: string | null): string | null;
92
92
  /** The `{{key}}` columns one template reads (the copy-provenance stamp keys its entries by them). */
93
93
  export { templateColumnKeys };
94
- export { ESP_MATCHING_MODES, type EspMatchingMode, DEFAULT_ESP_MATCHING_MODE, isEspMatchingMode, validateEspMatchingSetting, RECIPIENT_ESPS, type RecipientEsp, ESP_ROUTE_BUCKETS, type EspRouteBucket, type EspRouteWeights, type EspSenderExclusion, type EspRoutingPolicy, type EspMatchingSetting, type ResolvedEspPolicy, MAX_ESP_SENDER_EXCLUSIONS, MAX_ESP_ROUTE_WEIGHT, isEspRouteBucket, normalizeEspSenderDomain, espPolicyFromSetting, espRouteWeightsFor, espRouteCandidates, espExcludedSenderDomains, RECIPIENT_ESP_FAMILIES, type RecipientEspFamily, isRecipientEspFamily, isEspGatewayFamily, matchableEspFromFamily, familyFromMxHosts, espFromSpfRecords, inferRecipientEspFamily, inferRecipientEsp, espFromMxHosts, } from "./sequence-internals/esp-policy.js";
95
94
  /**
96
95
  * row_values keys an enrollment's phone number may live under, in
97
96
  * send-precedence order, for WhatsApp sends. The enroll path resolves the FIRST