outbound-sdk 0.4.0 → 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 (90) 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 +635 -2
  8. package/dist/budget/index.d.ts +2 -0
  9. package/dist/budget/index.js +1 -0
  10. package/dist/cards/index.js +2 -1
  11. package/dist/chunks/{chunk-5CFO3CXG.js → chunk-3S32R2MH.js} +33 -67
  12. package/dist/chunks/{chunk-ZFVHM5JI.js → chunk-5J7GGV62.js} +11 -4
  13. package/dist/chunks/chunk-6TKFISG4.js +676 -0
  14. package/dist/chunks/{chunk-E6DSDCPI.js → chunk-BK5SLY32.js} +92 -101
  15. package/dist/chunks/{chunk-A6WVOCA4.js → chunk-BN6WCAWX.js} +4 -4
  16. package/dist/chunks/{chunk-IZFTTMJP.js → chunk-EHSJGQ5K.js} +5 -5
  17. package/dist/chunks/chunk-HPNGSG5E.js +51 -0
  18. package/dist/chunks/chunk-HWHI4LFY.js +102 -0
  19. package/dist/chunks/{chunk-Y5RAJ6PZ.js → chunk-OLPMBRXM.js} +3 -2
  20. package/dist/chunks/chunk-WGW3ROLY.js +18 -0
  21. package/dist/chunks/{chunk-7ZDS6SZD.js → chunk-WH6V3YNN.js} +25 -0
  22. package/dist/chunks/{chunk-7LNJJ2RO.js → chunk-X4RDBD4J.js} +102 -11
  23. package/dist/chunks/chunk-XL6LJVHJ.js +71 -0
  24. package/dist/chunks/{chunk-5FVKRIEJ.js → chunk-YYCT3NGV.js} +35 -11
  25. package/dist/cli/bin.js +13 -28
  26. package/dist/cli/index.d.ts +3 -0
  27. package/dist/cli/index.js +12 -11
  28. package/dist/cli/update.d.ts +15 -0
  29. package/dist/emailbison/account.d.ts +7 -0
  30. package/dist/emailbison/adapter.d.ts +5 -0
  31. package/dist/emailbison/capabilities.d.ts +78 -0
  32. package/dist/emailbison/client.d.ts +29 -0
  33. package/dist/emailbison/index.d.ts +30 -0
  34. package/dist/emailbison/index.js +1017 -0
  35. package/dist/emailbison/mail.d.ts +5 -0
  36. package/dist/emailbison/map-mail.d.ts +13 -0
  37. package/dist/emailbison/map-sequence.d.ts +12 -0
  38. package/dist/emailbison/map-stats.d.ts +47 -0
  39. package/dist/emailbison/map.d.ts +24 -0
  40. package/dist/emailbison/native-params.d.ts +5 -0
  41. package/dist/emailbison/native-workspace.d.ts +167 -0
  42. package/dist/emailbison/native.d.ts +327 -0
  43. package/dist/emailbison/stats.d.ts +4 -0
  44. package/dist/emailbison/webhooks.d.ts +2 -0
  45. package/dist/fixtures/index.js +6 -6
  46. package/dist/heyreach/capabilities.d.ts +3 -0
  47. package/dist/heyreach/index.js +20 -20
  48. package/dist/index.js +19 -18
  49. package/dist/insights/copy/copy-reuse.d.ts +6 -6
  50. package/dist/insights/copy/shared.d.ts +2 -2
  51. package/dist/insights/copy/step-funnel.d.ts +5 -5
  52. package/dist/insights/copy/variant-test.d.ts +2 -2
  53. package/dist/insights/cost.d.ts +91 -0
  54. package/dist/insights/define.d.ts +22 -1
  55. package/dist/insights/index.d.ts +4 -3
  56. package/dist/insights/index.js +331 -27
  57. package/dist/insights/inputs.generated.d.ts +4 -4
  58. package/dist/insights/ops/campaign-ranking.d.ts +3 -3
  59. package/dist/insights/ops/index.d.ts +2 -2
  60. package/dist/insights/ops/shared.d.ts +11 -1
  61. package/dist/insights/plugin.d.ts +19 -0
  62. package/dist/insights/registry.d.ts +2 -2
  63. package/dist/insights/run-cap.d.ts +35 -0
  64. package/dist/insights/senders/bounce-watch.d.ts +4 -4
  65. package/dist/insights/senders/domain-health.d.ts +2 -2
  66. package/dist/insights/senders/sender-load.d.ts +1 -1
  67. package/dist/insights/tools.d.ts +10 -0
  68. package/dist/instantly/capabilities.d.ts +13 -0
  69. package/dist/instantly/index.js +41 -28
  70. package/dist/internal/adapter.d.ts +12 -0
  71. package/dist/internal/outbound/outbound.d.ts +5 -1
  72. package/dist/internal/request-cap.d.ts +35 -0
  73. package/dist/loader/index.js +2 -2
  74. package/dist/memory/index.js +10 -10
  75. package/dist/providers/index.d.ts +21 -1
  76. package/dist/providers/index.js +1 -1
  77. package/dist/redact/index.js +4 -4
  78. package/dist/smartlead/capabilities.d.ts +5 -0
  79. package/dist/smartlead/index.js +24 -24
  80. package/dist/tools/ai-sdk.js +5 -3
  81. package/dist/tools/claude-agent.js +5 -3
  82. package/dist/tools/index.d.ts +2 -2
  83. package/dist/tools/index.js +11 -6
  84. package/dist/tools/registry.d.ts +20 -1
  85. package/dist/tools/shared.d.ts +20 -1
  86. package/dist/webhooks/index.js +16 -7
  87. package/package.json +8 -2
  88. package/dist/chunks/chunk-K4USHN4C.js +0 -40
  89. package/dist/chunks/chunk-LVQUSKEX.js +0 -17
  90. package/dist/chunks/{chunk-C4LS2HNV.js → chunk-JWGSB7PT.js} +3 -3
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # outbound-sdk
2
2
 
3
- One small, typed, read-only TypeScript API over outbound sending tools: Instantly, Smartlead and HeyReach.
3
+ One small, typed, read-only TypeScript API over outbound sending tools: Instantly, Smartlead, HeyReach and EmailBison.
4
4
 
5
5
  - **Read-only.** It never sends, pauses, edits or deletes anything in a vendor tool.
6
6
  - **Stores nothing.** A plugin that keeps state takes a store you supply.
7
7
  - **Calls no AI model.** Your agent does the reasoning; the SDK supplies the numbers.
8
8
  - **Swap the adapter, keep the code.**
9
9
 
10
- > HeyReach and Instantly are `beta`: their reads were run against a live workspace each. Smartlead ships untested: it has never been run against a live account, and is written from public documentation and tested offline only.
10
+ > HeyReach and Instantly are `beta`: their reads were run against a live workspace each. Smartlead ships untested: it has never been run against a live account, and is written from public documentation and tested offline only. EmailBison ships untested too: no live account has been available, so it is written from EmailBison's API reference and tested offline only.
11
11
 
12
12
  ## Install
13
13
 
@@ -0,0 +1,53 @@
1
+ import type { CheckNumbers, CheckRead } from "./check-measure.ts";
2
+ import type { Check, CheckMetricName, CheckOp } from "./check-schema.ts";
3
+ import type { Alert, AlertRule } from "./plugin.ts";
4
+ /** One subject that broke the check, with the numbers that broke it. */
5
+ export interface CheckBreach extends Alert {
6
+ readonly metric: CheckMetricName;
7
+ readonly op: CheckOp;
8
+ /** What was measured. */
9
+ readonly value: number | string;
10
+ /** The check's `value`. */
11
+ readonly threshold: number | string;
12
+ readonly day: string | null;
13
+ /** The counts behind `value`, such as `{ bounced: 18, sent: 200 }`. */
14
+ readonly numbers: CheckNumbers;
15
+ }
16
+ export interface CheckResult {
17
+ /** The check's `name`, or its metric when it has none. */
18
+ readonly check: string;
19
+ /**
20
+ * `fail` when at least one subject broke the check. `pass` when none did,
21
+ * including when nothing could be measured (see `checked`). `not_checked`
22
+ * when the input is not what the metric reads, or is another client's.
23
+ */
24
+ readonly status: "fail" | "not_checked" | "pass";
25
+ /** Every subject that broke it. Empty unless `status` is `fail`. */
26
+ readonly breaches: readonly CheckBreach[];
27
+ /** Subjects measured and compared. */
28
+ readonly checked: number;
29
+ /** Subjects seen but not measured: too few sends, a missing count, an unknown status, a day before the window. */
30
+ readonly skipped: number;
31
+ /** Why the check did not run, for `not_checked`. Otherwise `null`. */
32
+ readonly reason: string | null;
33
+ }
34
+ export interface EvaluateCheckOptions {
35
+ /** The client the input belongs to, for a check scoped to a client. */
36
+ readonly client?: string | undefined;
37
+ /** The moment a `window` counts back from. Defaults to now. */
38
+ readonly now?: Date | number | string | undefined;
39
+ }
40
+ /** Throws `Invalid` with every problem and its fix when the input is not a check. */
41
+ export declare const parseCheck: (input: unknown) => Check;
42
+ /**
43
+ * Checks a data check against what was read and returns pass or fail with
44
+ * the exact numbers that broke it. Throws `Invalid` for a malformed check,
45
+ * listing each problem and its fix.
46
+ */
47
+ export declare const evaluateCheck: (input: Check, read: CheckRead, options?: EvaluateCheckOptions) => CheckResult;
48
+ /**
49
+ * A data check as an `AlertRule`, for the `alerts` plugin. Only a check on
50
+ * records (stats rows or senders) can be a rule; an insight's check is run
51
+ * with `evaluateCheck` on that insight's answer.
52
+ */
53
+ export declare const checkRule: (input: Check, options?: EvaluateCheckOptions) => AlertRule;
@@ -0,0 +1,100 @@
1
+ import { z } from "zod";
2
+ import type { MetricRow } from "../internal/entities.ts";
3
+ import type { OutboundRecord } from "../internal/outbound/operations.ts";
4
+ import type { CheckMetricName, CheckSource } from "./check-schema.ts";
5
+ /** The counts behind a measured value, by name. */
6
+ export type CheckNumbers = Readonly<Record<string, number | string | null>>;
7
+ /** One subject's reading of a metric. */
8
+ export interface Measurement {
9
+ readonly subject: string;
10
+ readonly subjectName: string | null;
11
+ readonly value: number | string;
12
+ readonly numbers: CheckNumbers;
13
+ readonly day: string | null;
14
+ readonly campaign: string | null;
15
+ readonly sender: string | null;
16
+ readonly person: string | null;
17
+ }
18
+ export interface Readings {
19
+ readonly measured: readonly Measurement[];
20
+ /** Subjects seen but not measurable: too few sends, a missing count, an unknown status. */
21
+ readonly skipped: number;
22
+ }
23
+ /** The readings, or why the input is not what the metric reads. */
24
+ export type Measured = {
25
+ readonly ok: true;
26
+ readonly readings: Readings;
27
+ } | {
28
+ readonly ok: false;
29
+ readonly reason: string;
30
+ };
31
+ export interface MeasureOptions {
32
+ readonly minSent: number;
33
+ /** The first day a daily row counts, `YYYY-MM-DD`, or `null` for every day. */
34
+ readonly fromDay: string | null;
35
+ }
36
+ declare const droppedAnswer: z.ZodObject<{
37
+ dropped: z.ZodArray<z.ZodObject<{
38
+ campaign: z.ZodNullable<z.ZodString>;
39
+ category: z.ZodString;
40
+ email: z.ZodNullable<z.ZodString>;
41
+ hoursWaiting: z.ZodNumber;
42
+ lead: z.ZodNullable<z.ZodString>;
43
+ linkedinUrl: z.ZodNullable<z.ZodString>;
44
+ name: z.ZodNullable<z.ZodString>;
45
+ receivedAt: z.ZodString;
46
+ reply: z.ZodString;
47
+ unansweredReplies: z.ZodNumber;
48
+ }, z.core.$strip>>;
49
+ olderThanHours: z.ZodNumber;
50
+ }, z.core.$strip>;
51
+ declare const forecastAnswer: z.ZodObject<{
52
+ campaign: z.ZodString;
53
+ campaignName: z.ZodString;
54
+ dailyContactRate: z.ZodNullable<z.ZodNumber>;
55
+ daysLeft: z.ZodNullable<z.ZodNumber>;
56
+ estimate: z.ZodLiteral<true>;
57
+ remaining: z.ZodNumber;
58
+ }, z.core.$strip>;
59
+ declare const suppressionAnswer: z.ZodObject<{
60
+ byCampaign: z.ZodArray<z.ZodObject<{
61
+ campaign: z.ZodString;
62
+ campaignName: z.ZodString;
63
+ leadsRead: z.ZodNumber;
64
+ violations: z.ZodNumber;
65
+ }, z.core.$strip>>;
66
+ violations: z.ZodArray<z.ZodUnknown>;
67
+ }, z.core.$strip>;
68
+ declare const gapsAnswer: z.ZodObject<{
69
+ campaign: z.ZodString;
70
+ totals: z.ZodObject<{
71
+ leadsRead: z.ZodNumber;
72
+ }, z.core.$strip>;
73
+ unknownVariables: z.ZodArray<z.ZodString>;
74
+ variables: z.ZodArray<z.ZodObject<{
75
+ gap: z.ZodBoolean;
76
+ leadsAffected: z.ZodNullable<z.ZodNumber>;
77
+ leadsWithoutValue: z.ZodNullable<z.ZodNumber>;
78
+ name: z.ZodString;
79
+ }, z.core.$strip>>;
80
+ }, z.core.$strip>;
81
+ type Frozen<Value> = Value extends readonly (infer Item)[] ? readonly Frozen<Item>[] : Value extends object ? {
82
+ readonly [Key in keyof Value]: Frozen<Value[Key]>;
83
+ } : Value;
84
+ /** The fields of an insight's answer that a check reads. */
85
+ export type CheckAnswer = Frozen<z.infer<typeof droppedAnswer> | z.infer<typeof forecastAnswer> | z.infer<typeof gapsAnswer> | z.infer<typeof suppressionAnswer>>;
86
+ /**
87
+ * What a check reads: a record or an array of them, a stats result
88
+ * (`{ rows }`), a page (`{ items }`), or an insight's result or its `data`.
89
+ */
90
+ export type CheckRead = CheckAnswer | OutboundRecord | readonly OutboundRecord[] | {
91
+ readonly data: CheckAnswer;
92
+ readonly insight: string;
93
+ } | {
94
+ readonly items: readonly OutboundRecord[];
95
+ } | {
96
+ readonly rows: readonly MetricRow[];
97
+ };
98
+ /** Reads the metric from the input. */
99
+ export declare const measure: (metric: CheckMetricName, source: CheckSource, input: CheckRead, options: MeasureOptions) => Measured;
100
+ export {};
@@ -0,0 +1,184 @@
1
+ import { z } from "zod";
2
+ /** What a metric is read from: a stats row, a sender, or one insight's answer. */
3
+ export type CheckSource = "droppedReplies" | "personalizationGaps" | "pipelineForecast" | "senders" | "stats" | "suppressionCheck";
4
+ export type ScopeKey = "campaign" | "client" | "person" | "sender";
5
+ export interface CheckMetric {
6
+ /** What to read, and so what to pass to `evaluateCheck`. */
7
+ readonly reads: CheckSource;
8
+ /** `rate` is a fraction from 0 to 1; `status` compares a sender status. */
9
+ readonly unit: "count" | "days" | "hours" | "rate" | "status";
10
+ /** The scope keys this metric can be narrowed by. */
11
+ readonly scope: readonly ScopeKey[];
12
+ readonly description: string;
13
+ }
14
+ /** Every metric a data check can read. */
15
+ export declare const CHECK_METRICS: {
16
+ readonly blocked_leads: {
17
+ readonly description: "Leads in a campaign that are on a block list, per campaign. Read with `suppressionCheck`.";
18
+ readonly reads: "suppressionCheck";
19
+ readonly scope: readonly ["client", "campaign"];
20
+ readonly unit: "count";
21
+ };
22
+ readonly bounce_rate: {
23
+ readonly description: "Bounced divided by sent, per stats row. Rows with fewer than `min_sent` sends are skipped.";
24
+ readonly reads: "stats";
25
+ readonly scope: readonly ScopeKey[];
26
+ readonly unit: "rate";
27
+ };
28
+ readonly broken_variable_leads: {
29
+ readonly description: "Leads who get broken copy from one merge variable with no value and no fallback, per variable. Read with `personalizationGaps`.";
30
+ readonly reads: "personalizationGaps";
31
+ readonly scope: readonly ["client", "campaign"];
32
+ readonly unit: "count";
33
+ };
34
+ readonly lead_runway_days: {
35
+ readonly description: "Days until a campaign runs out of leads at its recent contact rate. Read with `pipelineForecast`.";
36
+ readonly reads: "pipelineForecast";
37
+ readonly scope: readonly ["client", "campaign"];
38
+ readonly unit: "days";
39
+ };
40
+ readonly positive_reply_waiting_hours: {
41
+ readonly description: "Hours a positive reply has waited with no answer, per reply. Read with `droppedReplies`.";
42
+ readonly reads: "droppedReplies";
43
+ readonly scope: readonly ["client", "campaign", "person"];
44
+ readonly unit: "hours";
45
+ };
46
+ readonly reply_rate: {
47
+ readonly description: "Replies divided by leads contacted (or sent), per stats row. Rows with fewer than `min_sent` sends are skipped.";
48
+ readonly reads: "stats";
49
+ readonly scope: readonly ScopeKey[];
50
+ readonly unit: "rate";
51
+ };
52
+ readonly sender_status: {
53
+ readonly description: "A sender's status: active, paused, disconnected or error. A sender whose status is unknown is skipped.";
54
+ readonly reads: "senders";
55
+ readonly scope: readonly ["client", "sender"];
56
+ readonly unit: "status";
57
+ };
58
+ readonly sent: {
59
+ readonly description: "Messages sent, per stats row. With `window`, daily rows older than the window are skipped.";
60
+ readonly reads: "stats";
61
+ readonly scope: readonly ScopeKey[];
62
+ readonly unit: "count";
63
+ };
64
+ };
65
+ export type CheckMetricName = keyof typeof CHECK_METRICS;
66
+ declare const NUMBER_OPS: readonly [">", ">=", "<", "<=", "==", "!="];
67
+ export type CheckOp = (typeof NUMBER_OPS)[number];
68
+ export declare const OP_ALIASES: Map<string, ">" | ">=" | "<" | "<=" | "==" | "!=">;
69
+ export declare const baseSchema: z.ZodObject<{
70
+ metric: z.ZodEnum<{
71
+ sent: "sent";
72
+ blocked_leads: "blocked_leads";
73
+ bounce_rate: "bounce_rate";
74
+ broken_variable_leads: "broken_variable_leads";
75
+ lead_runway_days: "lead_runway_days";
76
+ positive_reply_waiting_hours: "positive_reply_waiting_hours";
77
+ reply_rate: "reply_rate";
78
+ sender_status: "sender_status";
79
+ }>;
80
+ min_sent: z.ZodOptional<z.ZodNumber>;
81
+ name: z.ZodOptional<z.ZodString>;
82
+ op: z.ZodEnum<{
83
+ ">": ">";
84
+ ">=": ">=";
85
+ "<": "<";
86
+ "<=": "<=";
87
+ "==": "==";
88
+ "!=": "!=";
89
+ }>;
90
+ scope: z.ZodOptional<z.ZodObject<{
91
+ campaign: z.ZodOptional<z.ZodString>;
92
+ client: z.ZodOptional<z.ZodString>;
93
+ person: z.ZodOptional<z.ZodString>;
94
+ sender: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strict>>;
96
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
97
+ window: z.ZodOptional<z.ZodObject<{
98
+ days: z.ZodNumber;
99
+ }, z.core.$strict>>;
100
+ }, z.core.$strict>;
101
+ export interface Fit {
102
+ readonly path: readonly string[];
103
+ readonly message: string;
104
+ }
105
+ export declare const looseCheck: z.ZodObject<{
106
+ metric: z.ZodEnum<{
107
+ sent: "sent";
108
+ blocked_leads: "blocked_leads";
109
+ bounce_rate: "bounce_rate";
110
+ broken_variable_leads: "broken_variable_leads";
111
+ lead_runway_days: "lead_runway_days";
112
+ positive_reply_waiting_hours: "positive_reply_waiting_hours";
113
+ reply_rate: "reply_rate";
114
+ sender_status: "sender_status";
115
+ }>;
116
+ min_sent: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<boolean, unknown>>;
117
+ op: z.ZodCatch<z.ZodOptional<z.ZodString>>;
118
+ scope: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
119
+ value: z.ZodCatch<z.ZodUnion<readonly [z.ZodPipe<z.ZodNumber, z.ZodTransform<{
120
+ readonly kind: "none";
121
+ } | {
122
+ readonly kind: "number";
123
+ readonly value: number;
124
+ } | {
125
+ readonly kind: "string";
126
+ readonly value: string;
127
+ }, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<{
128
+ readonly kind: "none";
129
+ } | {
130
+ readonly kind: "number";
131
+ readonly value: number;
132
+ } | {
133
+ readonly kind: "string";
134
+ readonly value: string;
135
+ }, string>>]>>;
136
+ window: z.ZodPipe<z.ZodOptional<z.ZodUnknown>, z.ZodTransform<boolean, unknown>>;
137
+ }, z.core.$strip>;
138
+ type LooseCheck = z.infer<typeof looseCheck>;
139
+ /**
140
+ * The rules that depend on the metric: what its value is, which operators,
141
+ * scope keys and options it takes. Read from the input as given, so they are
142
+ * reported beside a wrong field elsewhere rather than after it is fixed.
143
+ */
144
+ export declare const fitIssues: (check: LooseCheck) => Fit[];
145
+ /**
146
+ * The Zod schema of a data check. `z.toJSONSchema(checkSchema)` gives a JSON
147
+ * Schema for an editor or a model's structured output. `validateCheck` gives
148
+ * the same verdict with every problem listed at once.
149
+ */
150
+ export declare const checkSchema: z.ZodObject<{
151
+ metric: z.ZodEnum<{
152
+ sent: "sent";
153
+ blocked_leads: "blocked_leads";
154
+ bounce_rate: "bounce_rate";
155
+ broken_variable_leads: "broken_variable_leads";
156
+ lead_runway_days: "lead_runway_days";
157
+ positive_reply_waiting_hours: "positive_reply_waiting_hours";
158
+ reply_rate: "reply_rate";
159
+ sender_status: "sender_status";
160
+ }>;
161
+ min_sent: z.ZodOptional<z.ZodNumber>;
162
+ name: z.ZodOptional<z.ZodString>;
163
+ op: z.ZodEnum<{
164
+ ">": ">";
165
+ ">=": ">=";
166
+ "<": "<";
167
+ "<=": "<=";
168
+ "==": "==";
169
+ "!=": "!=";
170
+ }>;
171
+ scope: z.ZodOptional<z.ZodObject<{
172
+ campaign: z.ZodOptional<z.ZodString>;
173
+ client: z.ZodOptional<z.ZodString>;
174
+ person: z.ZodOptional<z.ZodString>;
175
+ sender: z.ZodOptional<z.ZodString>;
176
+ }, z.core.$strict>>;
177
+ value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
178
+ window: z.ZodOptional<z.ZodObject<{
179
+ days: z.ZodNumber;
180
+ }, z.core.$strict>>;
181
+ }, z.core.$strict>;
182
+ /** A data check, as written in JSON. */
183
+ export type Check = z.infer<typeof checkSchema>;
184
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { Check } from "./check-schema.ts";
2
+ export interface CheckIssue {
3
+ /** Where the problem is, like `scope.person` or `value`. Empty for the whole check. */
4
+ readonly path: string;
5
+ /** What is wrong and what to write instead. */
6
+ readonly message: string;
7
+ }
8
+ export type CheckValidation = {
9
+ readonly ok: true;
10
+ readonly check: Check;
11
+ } | {
12
+ readonly ok: false;
13
+ readonly issues: readonly CheckIssue[];
14
+ };
15
+ /** Validates a check and lists every problem with its fix, without throwing. */
16
+ export declare const validateCheck: (input: unknown) => CheckValidation;
17
+ /** One line per problem: `scope.person: bounce_rate cannot be narrowed by person…`. */
18
+ export declare const describeIssues: (issues: readonly CheckIssue[]) => string;
@@ -1,2 +1,9 @@
1
1
  export { alerts, bounceRateAbove, memoryAlertDedupe, noSends, replyRateBelow, senderNotActive, } from "./plugin.ts";
2
2
  export type { Alert, AlertDedupe, AlertRule, AlertsExtension, AlertsOptions, RateRuleOptions, } from "./plugin.ts";
3
+ export { CHECK_METRICS, checkSchema } from "./check-schema.ts";
4
+ export { describeIssues, validateCheck } from "./check-validate.ts";
5
+ export { checkRule, evaluateCheck, parseCheck } from "./check-evaluate.ts";
6
+ export type { Check, CheckMetric, CheckMetricName, CheckOp, CheckSource, ScopeKey, } from "./check-schema.ts";
7
+ export type { CheckIssue, CheckValidation } from "./check-validate.ts";
8
+ export type { CheckBreach, CheckResult, EvaluateCheckOptions, } from "./check-evaluate.ts";
9
+ export type { CheckAnswer, CheckNumbers, CheckRead } from "./check-measure.ts";