outbound-sdk 0.4.0 → 0.6.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.
- package/README.md +2 -2
- package/dist/alerts/check-evaluate.d.ts +53 -0
- package/dist/alerts/check-measure.d.ts +100 -0
- package/dist/alerts/check-schema.d.ts +184 -0
- package/dist/alerts/check-validate.d.ts +18 -0
- package/dist/alerts/index.d.ts +7 -0
- package/dist/alerts/index.js +635 -2
- package/dist/budget/index.d.ts +2 -0
- package/dist/budget/index.js +1 -0
- package/dist/cards/format.d.ts +1 -1
- package/dist/cards/index.js +49 -19
- package/dist/cards/parts.d.ts +1 -6
- package/dist/chunks/{chunk-7LNJJ2RO.js → chunk-3JOC5DGD.js} +127 -17
- package/dist/chunks/chunk-53DCVFUB.js +55 -0
- package/dist/chunks/{chunk-E6DSDCPI.js → chunk-BK5SLY32.js} +92 -101
- package/dist/chunks/chunk-HPNGSG5E.js +51 -0
- package/dist/chunks/chunk-HWHI4LFY.js +102 -0
- package/dist/chunks/chunk-MGR6HREO.js +91 -0
- package/dist/chunks/{chunk-Y5RAJ6PZ.js → chunk-OLPMBRXM.js} +3 -2
- package/dist/chunks/{chunk-IZFTTMJP.js → chunk-PHNQ3WC2.js} +5 -5
- package/dist/chunks/chunk-SXGCKCAR.js +678 -0
- package/dist/chunks/chunk-TFICTGM2.js +18 -0
- package/dist/chunks/{chunk-ZFVHM5JI.js → chunk-UWUPUMM2.js} +11 -4
- package/dist/chunks/{chunk-A6WVOCA4.js → chunk-W22SDX6S.js} +4 -4
- package/dist/chunks/{chunk-7ZDS6SZD.js → chunk-WH6V3YNN.js} +25 -0
- package/dist/chunks/chunk-XL6LJVHJ.js +71 -0
- package/dist/chunks/{chunk-5FVKRIEJ.js → chunk-YYCT3NGV.js} +35 -11
- package/dist/cli/bin.js +13 -28
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +12 -11
- package/dist/cli/output.d.ts +9 -0
- package/dist/cli/update.d.ts +15 -0
- package/dist/emailbison/account.d.ts +7 -0
- package/dist/emailbison/adapter.d.ts +5 -0
- package/dist/emailbison/capabilities.d.ts +78 -0
- package/dist/emailbison/client.d.ts +29 -0
- package/dist/emailbison/index.d.ts +30 -0
- package/dist/emailbison/index.js +1018 -0
- package/dist/emailbison/mail.d.ts +5 -0
- package/dist/emailbison/map-mail.d.ts +13 -0
- package/dist/emailbison/map-sequence.d.ts +12 -0
- package/dist/emailbison/map-stats.d.ts +47 -0
- package/dist/emailbison/map.d.ts +24 -0
- package/dist/emailbison/native-params.d.ts +5 -0
- package/dist/emailbison/native-workspace.d.ts +167 -0
- package/dist/emailbison/native.d.ts +327 -0
- package/dist/emailbison/stats.d.ts +4 -0
- package/dist/emailbison/webhooks.d.ts +2 -0
- package/dist/fixtures/index.js +6 -6
- package/dist/heyreach/capabilities.d.ts +3 -0
- package/dist/heyreach/index.js +22 -20
- package/dist/index.js +19 -18
- package/dist/insights/copy/copy-preview.d.ts +58 -0
- package/dist/insights/copy/copy-reuse.d.ts +0 -13
- package/dist/insights/copy/index.d.ts +9 -0
- package/dist/insights/copy/reuse-base.d.ts +0 -2
- package/dist/insights/copy/shared.d.ts +3 -8
- package/dist/insights/copy/step-funnel.d.ts +1 -12
- package/dist/insights/copy/variant-test.d.ts +0 -5
- package/dist/insights/cost.d.ts +91 -0
- package/dist/insights/define.d.ts +22 -1
- package/dist/insights/index.d.ts +4 -3
- package/dist/insights/index.js +810 -415
- package/dist/insights/inputs.generated.d.ts +21 -24
- package/dist/insights/ops/campaign-diagnosis.d.ts +0 -2
- package/dist/insights/ops/campaign-ranking.d.ts +3 -3
- package/dist/insights/ops/client-report.d.ts +0 -2
- package/dist/insights/ops/index.d.ts +2 -6
- package/dist/insights/ops/shared.d.ts +10 -2
- package/dist/insights/plugin.d.ts +19 -0
- package/dist/insights/registry.d.ts +10 -10
- package/dist/insights/run-cap.d.ts +35 -0
- package/dist/insights/senders/bounce-watch.d.ts +0 -11
- package/dist/insights/senders/domain-health.d.ts +0 -7
- package/dist/insights/senders/index.d.ts +0 -4
- package/dist/insights/senders/sender-load.d.ts +0 -2
- package/dist/insights/tools.d.ts +10 -0
- package/dist/insights/types.d.ts +1 -1
- package/dist/insights/variables.d.ts +33 -0
- package/dist/instantly/capabilities.d.ts +13 -0
- package/dist/instantly/index.js +43 -28
- package/dist/internal/adapter.d.ts +12 -0
- package/dist/internal/outbound/outbound.d.ts +5 -1
- package/dist/internal/request-cap.d.ts +35 -0
- package/dist/loader/index.js +2 -2
- package/dist/memory/index.js +10 -10
- package/dist/providers/index.d.ts +21 -1
- package/dist/providers/index.js +1 -1
- package/dist/redact/index.js +4 -4
- package/dist/smartlead/capabilities.d.ts +5 -0
- package/dist/smartlead/index.js +26 -24
- package/dist/tools/ai-sdk.js +5 -3
- package/dist/tools/claude-agent.js +5 -3
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +11 -6
- package/dist/tools/registry.d.ts +20 -1
- package/dist/tools/shared.d.ts +20 -1
- package/dist/webhooks/index.js +17 -7
- package/package.json +8 -2
- package/dist/chunks/chunk-5CFO3CXG.js +0 -176
- package/dist/chunks/chunk-K4USHN4C.js +0 -40
- package/dist/chunks/chunk-LVQUSKEX.js +0 -17
- package/dist/internal/renamed.d.ts +0 -28
- package/dist/chunks/{chunk-C4LS2HNV.js → chunk-JWGSB7PT.js} +3 -3
package/dist/instantly/index.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EVENT_TYPES,
|
|
3
3
|
instantlyEvents
|
|
4
|
-
} from "../chunks/chunk-
|
|
4
|
+
} from "../chunks/chunk-W22SDX6S.js";
|
|
5
5
|
import {
|
|
6
|
-
createVendorClient,
|
|
7
6
|
flatMapPage,
|
|
8
|
-
listIn,
|
|
9
7
|
mapPage,
|
|
10
|
-
normalizeBody,
|
|
11
8
|
withLeadFields,
|
|
12
9
|
withMappedFields
|
|
13
|
-
} from "../chunks/chunk-
|
|
10
|
+
} from "../chunks/chunk-XL6LJVHJ.js";
|
|
14
11
|
import {
|
|
12
|
+
createVendorClient,
|
|
15
13
|
leadStanding,
|
|
14
|
+
listIn,
|
|
16
15
|
toVariant,
|
|
17
16
|
variantKey
|
|
18
|
-
} from "../chunks/chunk-
|
|
17
|
+
} from "../chunks/chunk-MGR6HREO.js";
|
|
18
|
+
import {
|
|
19
|
+
normalizeBody
|
|
20
|
+
} from "../chunks/chunk-53DCVFUB.js";
|
|
19
21
|
import {
|
|
20
22
|
defineNative,
|
|
21
23
|
inBody,
|
|
@@ -24,17 +26,6 @@ import {
|
|
|
24
26
|
inQuery,
|
|
25
27
|
inQueryRequired
|
|
26
28
|
} from "../chunks/chunk-NAKXLBA6.js";
|
|
27
|
-
import {
|
|
28
|
-
emptyCounts,
|
|
29
|
-
metricRow,
|
|
30
|
-
sumCounts
|
|
31
|
-
} from "../chunks/chunk-PQSTQKRD.js";
|
|
32
|
-
import "../chunks/chunk-NAWZ73QS.js";
|
|
33
|
-
import "../chunks/chunk-FHKSLCVW.js";
|
|
34
|
-
import {
|
|
35
|
-
readEnv,
|
|
36
|
-
requireCredential
|
|
37
|
-
} from "../chunks/chunk-GFDNRWR3.js";
|
|
38
29
|
import {
|
|
39
30
|
eventTypesOf,
|
|
40
31
|
recordBase,
|
|
@@ -42,10 +33,21 @@ import {
|
|
|
42
33
|
refsTo
|
|
43
34
|
} from "../chunks/chunk-2D42TQFU.js";
|
|
44
35
|
import "../chunks/chunk-BOWXGMN3.js";
|
|
36
|
+
import {
|
|
37
|
+
emptyCounts,
|
|
38
|
+
metricRow,
|
|
39
|
+
sumCounts
|
|
40
|
+
} from "../chunks/chunk-PQSTQKRD.js";
|
|
45
41
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
46
42
|
import {
|
|
47
43
|
assertWorkspaceId
|
|
48
44
|
} from "../chunks/chunk-QAKJ76HB.js";
|
|
45
|
+
import "../chunks/chunk-NAWZ73QS.js";
|
|
46
|
+
import "../chunks/chunk-FHKSLCVW.js";
|
|
47
|
+
import {
|
|
48
|
+
readEnv,
|
|
49
|
+
requireCredential
|
|
50
|
+
} from "../chunks/chunk-GFDNRWR3.js";
|
|
49
51
|
import {
|
|
50
52
|
OutboundError,
|
|
51
53
|
makeErrorMapper,
|
|
@@ -511,26 +513,39 @@ var limits = {
|
|
|
511
513
|
]
|
|
512
514
|
};
|
|
513
515
|
var costs = {
|
|
514
|
-
"blocklist.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
516
|
+
"blocklist.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
515
517
|
// The campaign, its tag assignments, then the tags' names.
|
|
516
518
|
"campaigns.get": { perPage: 3 },
|
|
517
519
|
// The campaigns, their tag assignments, then the tags' names.
|
|
518
|
-
"campaigns.list": { pageSize: PAGE_SIZE, perPage: 3 },
|
|
520
|
+
"campaigns.list": { pageSize: PAGE_SIZE, perPage: 3, perWalk: 1 },
|
|
519
521
|
"campaigns.settings": { perPage: 1 },
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
"
|
|
523
|
-
"
|
|
524
|
-
|
|
522
|
+
// A custom interest label costs one more read of the label list, made only
|
|
523
|
+
// when the lead or a page of leads holds one.
|
|
524
|
+
"leads.get": { perPage: 1, perWalk: 1 },
|
|
525
|
+
"leads.list": {
|
|
526
|
+
pageSize: PAGE_SIZE,
|
|
527
|
+
perPage: 1,
|
|
528
|
+
perPageAtMost: 2,
|
|
529
|
+
perWalk: 1
|
|
530
|
+
},
|
|
531
|
+
"lists.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
532
|
+
"messages.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
533
|
+
// The same label read, for a page of replies with a custom status.
|
|
534
|
+
"replies.list": {
|
|
535
|
+
pageSize: PAGE_SIZE,
|
|
536
|
+
perPage: 1,
|
|
537
|
+
perPageAtMost: 2,
|
|
538
|
+
perWalk: 1
|
|
539
|
+
},
|
|
525
540
|
"senders.get": { perPage: 1 },
|
|
526
541
|
// The account, its DNS test, then its warmup analytics.
|
|
527
542
|
"senders.health": { perPage: 3 },
|
|
528
|
-
"senders.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
543
|
+
"senders.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
529
544
|
"sequence.get": { perPage: 1 },
|
|
530
|
-
"sequence.subsequences": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
545
|
+
"sequence.subsequences": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
531
546
|
stats: { perPage: 1 },
|
|
532
|
-
"tags.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
533
|
-
"webhooks.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
547
|
+
"tags.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
548
|
+
"webhooks.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
534
549
|
"workspaces.list": { perPage: 1 }
|
|
535
550
|
};
|
|
536
551
|
var caveats = [
|
|
@@ -139,6 +139,18 @@ export interface OperationCost {
|
|
|
139
139
|
readonly pageSize?: number | undefined;
|
|
140
140
|
/** Extra requests per record, for example one per lead to fetch a body. */
|
|
141
141
|
readonly perRecord?: number | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* The most extra requests a listing makes once, whatever its length, for
|
|
144
|
+
* example a lookup of category names on its first page. Counted in the
|
|
145
|
+
* upper bound of an insight's cost, never in its lower bound.
|
|
146
|
+
*/
|
|
147
|
+
readonly perWalk?: number | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* The most requests one page can cost, when some pages cost more than
|
|
150
|
+
* `perPage`, for example a label lookup made only when a page holds a
|
|
151
|
+
* custom label. Counted in the upper bound of an insight's cost only.
|
|
152
|
+
*/
|
|
153
|
+
readonly perPageAtMost?: number | undefined;
|
|
142
154
|
}
|
|
143
155
|
export interface Adapter<Native extends NativeCatalog = NoNative> {
|
|
144
156
|
readonly name: string;
|
|
@@ -9,6 +9,8 @@ import type { Campaign, Lead, Message, Reply, Sender, Workspace } from "../entit
|
|
|
9
9
|
import type { FieldCoverage } from "../fields.ts";
|
|
10
10
|
import type { OutboundHooks } from "../hooks.ts";
|
|
11
11
|
import type { NativeCatalog, NoNative } from "../native.ts";
|
|
12
|
+
import { CAPPED } from "../request-cap.ts";
|
|
13
|
+
import type { CappedAccess } from "../request-cap.ts";
|
|
12
14
|
import type { CampaignFilters, CampaignHandle, Collection, Estimate, EstimateQuery, LeadFilters, LeadHandle, ListHandle, MessageFilters, NativeClient, OutboundApi, RawClient, ReadCollection, ReplyFilters, SenderFilters, SenderHandle, StatsResult, ThreadHandle, TopLevelStatsOptions, WebhookFilters } from "./api.ts";
|
|
13
15
|
import type { OutboundPlugin } from "./plugins.ts";
|
|
14
16
|
export interface OutboundOptions<Native extends NativeCatalog = NoNative> extends Omit<OperationOptions, "maxRequests"> {
|
|
@@ -54,7 +56,7 @@ export declare class Outbound<Native extends NativeCatalog = NoNative> implement
|
|
|
54
56
|
readonly webhooks: Collection<WebhookSubscription, WebhookFilters>;
|
|
55
57
|
readonly raw: RawClient;
|
|
56
58
|
readonly native: NativeClient<Native>;
|
|
57
|
-
constructor(options: OutboundOptions<Native>, engine?: RequestEngine);
|
|
59
|
+
constructor(options: OutboundOptions<Native>, engine?: RequestEngine, layers?: readonly OutboundPlugin[]);
|
|
58
60
|
get provider(): string;
|
|
59
61
|
get workspaceId(): string;
|
|
60
62
|
get capabilities(): Capabilities;
|
|
@@ -73,6 +75,8 @@ export declare class Outbound<Native extends NativeCatalog = NoNative> implement
|
|
|
73
75
|
* plugins and what they add, so `outbound.workspace(id).insights` works.
|
|
74
76
|
*/
|
|
75
77
|
workspace(id: string): this;
|
|
78
|
+
/** For a cap shared across calls, as insights and tools use. Not public. */
|
|
79
|
+
get [CAPPED](): CappedAccess;
|
|
76
80
|
stats(options?: TopLevelStatsOptions): Promise<StatsResult>;
|
|
77
81
|
limits(): Promise<LimitsSnapshot[]>;
|
|
78
82
|
estimate(query: EstimateQuery): Estimate;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { OperationCost } from "./adapter.ts";
|
|
2
|
+
import type { OutboundApi } from "./outbound/api.ts";
|
|
3
|
+
import type { OutboundPlugin } from "./outbound/plugins.ts";
|
|
4
|
+
export declare const CAPPED: unique symbol;
|
|
5
|
+
/** Counts requests as they are sent, and stops one that would pass the cap. */
|
|
6
|
+
export interface RequestGuard {
|
|
7
|
+
/** Throws when no request is left. Runs before the request is sent. */
|
|
8
|
+
readonly check: (provider: string) => void;
|
|
9
|
+
/** Counts the request being sent. */
|
|
10
|
+
readonly count: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CappedAccess {
|
|
13
|
+
/** What the adapter's reads cost, or `undefined` when it declares none. */
|
|
14
|
+
readonly costs: Readonly<Record<string, OperationCost>> | undefined;
|
|
15
|
+
/** The same instance with `layer` innermost, kept out of `plugins`. */
|
|
16
|
+
readonly guarded: (layer: OutboundPlugin) => OutboundApi;
|
|
17
|
+
}
|
|
18
|
+
/** What an instance built by `createOutbound` offers for a shared cap; `undefined` on anything else. */
|
|
19
|
+
export declare const cappedAccess: (outbound: OutboundApi) => CappedAccess | undefined;
|
|
20
|
+
export interface RequestCounter extends RequestGuard {
|
|
21
|
+
/** Requests counted so far. */
|
|
22
|
+
readonly used: () => number;
|
|
23
|
+
/** `true` once a request was stopped at the cap. */
|
|
24
|
+
readonly stopped: () => boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Allows `cap` requests in all. `stop` builds the error for the request that
|
|
28
|
+
* would pass it. `Infinity` counts without stopping.
|
|
29
|
+
*/
|
|
30
|
+
export declare const requestCounter: (cap: number, stop: (provider: string) => Error) => RequestCounter;
|
|
31
|
+
/**
|
|
32
|
+
* `outbound` with every request counted by `guard`. An instance not built by
|
|
33
|
+
* `createOutbound` is returned as it is: there is nothing to count through.
|
|
34
|
+
*/
|
|
35
|
+
export declare const withGuard: <Api extends OutboundApi>(outbound: Api, guard: RequestGuard) => Api;
|
package/dist/loader/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
configuredProviders,
|
|
4
4
|
fromEnv,
|
|
5
5
|
loadableProviders
|
|
6
|
-
} from "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-UWUPUMM2.js";
|
|
7
7
|
import "../chunks/chunk-GFDNRWR3.js";
|
|
8
|
-
import "../chunks/chunk-7ZDS6SZD.js";
|
|
9
8
|
import "../chunks/chunk-J7DDZ4C2.js";
|
|
10
9
|
import "../chunks/chunk-BLCJHP5H.js";
|
|
10
|
+
import "../chunks/chunk-WH6V3YNN.js";
|
|
11
11
|
export {
|
|
12
12
|
ALL_PROVIDERS,
|
|
13
13
|
configuredProviders,
|
package/dist/memory/index.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
emptyCounts,
|
|
3
|
-
sumCounts
|
|
4
|
-
} from "../chunks/chunk-PQSTQKRD.js";
|
|
5
|
-
import {
|
|
6
|
-
profileSlug
|
|
7
|
-
} from "../chunks/chunk-NAWZ73QS.js";
|
|
8
|
-
import {
|
|
9
|
-
stableId
|
|
10
|
-
} from "../chunks/chunk-FHKSLCVW.js";
|
|
11
1
|
import {
|
|
12
2
|
recordBase,
|
|
13
3
|
refTo,
|
|
@@ -16,6 +6,10 @@ import {
|
|
|
16
6
|
import {
|
|
17
7
|
leadProgressSchema
|
|
18
8
|
} from "../chunks/chunk-BOWXGMN3.js";
|
|
9
|
+
import {
|
|
10
|
+
emptyCounts,
|
|
11
|
+
sumCounts
|
|
12
|
+
} from "../chunks/chunk-PQSTQKRD.js";
|
|
19
13
|
import {
|
|
20
14
|
SCHEMA_VERSION
|
|
21
15
|
} from "../chunks/chunk-QGRZDTX4.js";
|
|
@@ -23,6 +17,12 @@ import {
|
|
|
23
17
|
assertWorkspaceId,
|
|
24
18
|
makeRef
|
|
25
19
|
} from "../chunks/chunk-QAKJ76HB.js";
|
|
20
|
+
import {
|
|
21
|
+
profileSlug
|
|
22
|
+
} from "../chunks/chunk-NAWZ73QS.js";
|
|
23
|
+
import {
|
|
24
|
+
stableId
|
|
25
|
+
} from "../chunks/chunk-FHKSLCVW.js";
|
|
26
26
|
import {
|
|
27
27
|
OutboundError,
|
|
28
28
|
makeErrorMapper
|
|
@@ -64,6 +64,26 @@ declare const CATALOG: readonly [{
|
|
|
64
64
|
readonly maturity: "beta";
|
|
65
65
|
readonly name: "HeyReach";
|
|
66
66
|
readonly note: "Its reads were run, read-only, against one live workspace. Fixtures are built from the documentation.";
|
|
67
|
+
}, {
|
|
68
|
+
readonly channels: readonly ["email"];
|
|
69
|
+
readonly docsUrl: "https://dedi.emailbison.com/api/reference";
|
|
70
|
+
readonly envVars: readonly [{
|
|
71
|
+
readonly description: "API key (an api-user key is scoped to one workspace).";
|
|
72
|
+
readonly name: "EMAILBISON_API_KEY";
|
|
73
|
+
readonly required: true;
|
|
74
|
+
}, {
|
|
75
|
+
readonly description: "The URL you log in to EmailBison with. Defaults to https://dedi.emailbison.com.";
|
|
76
|
+
readonly name: "EMAILBISON_BASE_URL";
|
|
77
|
+
readonly required: false;
|
|
78
|
+
}, {
|
|
79
|
+
readonly description: "A label for this client or workspace.";
|
|
80
|
+
readonly name: "EMAILBISON_WORKSPACE_ID";
|
|
81
|
+
readonly required: false;
|
|
82
|
+
}];
|
|
83
|
+
readonly id: "emailbison";
|
|
84
|
+
readonly maturity: "unverified";
|
|
85
|
+
readonly name: "EmailBison";
|
|
86
|
+
readonly note: "Never run against a live account. Written from the public documentation and tested offline only.";
|
|
67
87
|
}, {
|
|
68
88
|
readonly channels: readonly ["email", "linkedin"];
|
|
69
89
|
readonly docsUrl: null;
|
|
@@ -73,7 +93,7 @@ declare const CATALOG: readonly [{
|
|
|
73
93
|
readonly name: "In-memory (tests and demos)";
|
|
74
94
|
readonly note: "Holds data in memory. For tests and demos; there is no vendor behind it.";
|
|
75
95
|
}];
|
|
76
|
-
/** The id of a provider in the catalog: `instantly`, `smartlead`, `heyreach` or `memory`. */
|
|
96
|
+
/** The id of a provider in the catalog: `instantly`, `smartlead`, `heyreach`, `emailbison` or `memory`. */
|
|
77
97
|
export type ProviderId = (typeof CATALOG)[number]["id"];
|
|
78
98
|
export declare const providers: readonly ProviderInfo[];
|
|
79
99
|
/**
|
package/dist/providers/index.js
CHANGED
package/dist/redact/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
makeRef,
|
|
3
|
+
parseRef
|
|
4
|
+
} from "../chunks/chunk-QAKJ76HB.js";
|
|
1
5
|
import {
|
|
2
6
|
profileSlug
|
|
3
7
|
} from "../chunks/chunk-NAWZ73QS.js";
|
|
4
8
|
import {
|
|
5
9
|
stableId
|
|
6
10
|
} from "../chunks/chunk-FHKSLCVW.js";
|
|
7
|
-
import {
|
|
8
|
-
makeRef,
|
|
9
|
-
parseRef
|
|
10
|
-
} from "../chunks/chunk-QAKJ76HB.js";
|
|
11
11
|
import {
|
|
12
12
|
OutboundError
|
|
13
13
|
} from "../chunks/chunk-J7DDZ4C2.js";
|
|
@@ -37,10 +37,12 @@ export declare const costs: {
|
|
|
37
37
|
};
|
|
38
38
|
"leads.get": {
|
|
39
39
|
perPage: number;
|
|
40
|
+
perWalk: number;
|
|
40
41
|
};
|
|
41
42
|
"leads.list": {
|
|
42
43
|
pageSize: number;
|
|
43
44
|
perPage: number;
|
|
45
|
+
perWalk: number;
|
|
44
46
|
};
|
|
45
47
|
"lists.list": {
|
|
46
48
|
pageSize: number;
|
|
@@ -53,6 +55,7 @@ export declare const costs: {
|
|
|
53
55
|
"replies.list": {
|
|
54
56
|
pageSize: number;
|
|
55
57
|
perPage: number;
|
|
58
|
+
perWalk: number;
|
|
56
59
|
};
|
|
57
60
|
"senders.get": {
|
|
58
61
|
perPage: number;
|
|
@@ -70,6 +73,7 @@ export declare const costs: {
|
|
|
70
73
|
"sequence.subsequences": {
|
|
71
74
|
pageSize: number;
|
|
72
75
|
perPage: number;
|
|
76
|
+
perWalk: number;
|
|
73
77
|
};
|
|
74
78
|
stats: {
|
|
75
79
|
perPage: number;
|
|
@@ -79,6 +83,7 @@ export declare const costs: {
|
|
|
79
83
|
};
|
|
80
84
|
"webhooks.list": {
|
|
81
85
|
perPage: number;
|
|
86
|
+
perWalk: number;
|
|
82
87
|
};
|
|
83
88
|
"workspaces.list": {
|
|
84
89
|
perPage: number;
|
package/dist/smartlead/index.js
CHANGED
|
@@ -13,19 +13,21 @@ import {
|
|
|
13
13
|
toWorkspace,
|
|
14
14
|
unwrap,
|
|
15
15
|
withoutSecrets
|
|
16
|
-
} from "../chunks/chunk-
|
|
16
|
+
} from "../chunks/chunk-PHNQ3WC2.js";
|
|
17
17
|
import {
|
|
18
|
-
createVendorClient,
|
|
19
18
|
flatMapPage,
|
|
20
|
-
listIn,
|
|
21
19
|
mapPage,
|
|
22
|
-
normalizeBody,
|
|
23
20
|
withLeadFields,
|
|
24
21
|
withMappedFields
|
|
25
|
-
} from "../chunks/chunk-
|
|
22
|
+
} from "../chunks/chunk-XL6LJVHJ.js";
|
|
23
|
+
import {
|
|
24
|
+
createVendorClient,
|
|
25
|
+
fromOne,
|
|
26
|
+
listIn
|
|
27
|
+
} from "../chunks/chunk-MGR6HREO.js";
|
|
26
28
|
import {
|
|
27
|
-
|
|
28
|
-
} from "../chunks/chunk-
|
|
29
|
+
normalizeBody
|
|
30
|
+
} from "../chunks/chunk-53DCVFUB.js";
|
|
29
31
|
import {
|
|
30
32
|
defineNative,
|
|
31
33
|
inBody,
|
|
@@ -34,18 +36,6 @@ import {
|
|
|
34
36
|
inQuery,
|
|
35
37
|
inQueryRequired
|
|
36
38
|
} from "../chunks/chunk-NAKXLBA6.js";
|
|
37
|
-
import {
|
|
38
|
-
emptyCounts,
|
|
39
|
-
metricRow
|
|
40
|
-
} from "../chunks/chunk-PQSTQKRD.js";
|
|
41
|
-
import "../chunks/chunk-NAWZ73QS.js";
|
|
42
|
-
import {
|
|
43
|
-
stableId
|
|
44
|
-
} from "../chunks/chunk-FHKSLCVW.js";
|
|
45
|
-
import {
|
|
46
|
-
readEnv,
|
|
47
|
-
requireCredential
|
|
48
|
-
} from "../chunks/chunk-GFDNRWR3.js";
|
|
49
39
|
import {
|
|
50
40
|
eventTypesOf,
|
|
51
41
|
recordBase,
|
|
@@ -53,12 +43,24 @@ import {
|
|
|
53
43
|
refsTo
|
|
54
44
|
} from "../chunks/chunk-2D42TQFU.js";
|
|
55
45
|
import "../chunks/chunk-BOWXGMN3.js";
|
|
46
|
+
import {
|
|
47
|
+
emptyCounts,
|
|
48
|
+
metricRow
|
|
49
|
+
} from "../chunks/chunk-PQSTQKRD.js";
|
|
56
50
|
import {
|
|
57
51
|
replyCategorySchema
|
|
58
52
|
} from "../chunks/chunk-QGRZDTX4.js";
|
|
59
53
|
import {
|
|
60
54
|
assertWorkspaceId
|
|
61
55
|
} from "../chunks/chunk-QAKJ76HB.js";
|
|
56
|
+
import "../chunks/chunk-NAWZ73QS.js";
|
|
57
|
+
import {
|
|
58
|
+
stableId
|
|
59
|
+
} from "../chunks/chunk-FHKSLCVW.js";
|
|
60
|
+
import {
|
|
61
|
+
readEnv,
|
|
62
|
+
requireCredential
|
|
63
|
+
} from "../chunks/chunk-GFDNRWR3.js";
|
|
62
64
|
import {
|
|
63
65
|
OutboundError,
|
|
64
66
|
makeErrorMapper,
|
|
@@ -218,31 +220,31 @@ var costs = {
|
|
|
218
220
|
"campaigns.settings": { perPage: 1 },
|
|
219
221
|
// The lead, then its tags, then the category list when the lead has a
|
|
220
222
|
// category.
|
|
221
|
-
"leads.get": { perPage: 2 },
|
|
223
|
+
"leads.get": { perPage: 2, perWalk: 1 },
|
|
222
224
|
// The first page also reads the lead category list and, without a
|
|
223
225
|
// campaign, the campaign list. A lookup by address is one request, two
|
|
224
226
|
// when a campaign gives a lead category, and never walks leads.
|
|
225
|
-
"leads.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
227
|
+
"leads.list": { pageSize: PAGE_SIZE, perPage: 1, perWalk: 2 },
|
|
226
228
|
"lists.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
227
229
|
// A lead's timeline costs one request per campaign the lead is in, plus one
|
|
228
230
|
// to find those campaigns. A thread is one request.
|
|
229
231
|
"messages.list": { pageSize: ACTIVITIES_PAGE_SIZE, perPage: 1 },
|
|
230
232
|
// The first page of a walk also reads the lead category list.
|
|
231
|
-
"replies.list": { pageSize: INBOX_PAGE_SIZE, perPage: 1 },
|
|
233
|
+
"replies.list": { pageSize: INBOX_PAGE_SIZE, perPage: 1, perWalk: 1 },
|
|
232
234
|
"senders.get": { perPage: 1 },
|
|
233
235
|
// The mailbox, then its warmup statistics.
|
|
234
236
|
"senders.health": { perPage: 2 },
|
|
235
237
|
"senders.list": { pageSize: PAGE_SIZE, perPage: 1 },
|
|
236
238
|
"sequence.get": { perPage: 1 },
|
|
237
239
|
// One subsequence per page; the first page also reads the campaign list.
|
|
238
|
-
"sequence.subsequences": { pageSize: 1, perPage: 1 },
|
|
240
|
+
"sequence.subsequences": { pageSize: 1, perPage: 1, perWalk: 1 },
|
|
239
241
|
// A mailbox's totals cost two: the mailbox for its address, then the list.
|
|
240
242
|
// Daily rows cost two: the day-wise counts, then the positive replies.
|
|
241
243
|
stats: { perPage: 1 },
|
|
242
244
|
"tags.list": { perPage: 1 },
|
|
243
245
|
// One campaign per page; without a campaign, the first page also reads the
|
|
244
246
|
// campaign list.
|
|
245
|
-
"webhooks.list": { perPage: 1 },
|
|
247
|
+
"webhooks.list": { perPage: 1, perWalk: 1 },
|
|
246
248
|
"workspaces.list": { perPage: 1 }
|
|
247
249
|
};
|
|
248
250
|
var caveats = [
|
package/dist/tools/ai-sdk.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTools
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-BK5SLY32.js";
|
|
4
|
+
import "../chunks/chunk-HWHI4LFY.js";
|
|
5
5
|
import "../chunks/chunk-HZCTYL22.js";
|
|
6
|
-
import "../chunks/chunk-
|
|
6
|
+
import "../chunks/chunk-HPNGSG5E.js";
|
|
7
|
+
import "../chunks/chunk-PTZO4QXR.js";
|
|
7
8
|
import "../chunks/chunk-BOWXGMN3.js";
|
|
9
|
+
import "../chunks/chunk-PQSTQKRD.js";
|
|
8
10
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
9
11
|
import "../chunks/chunk-QAKJ76HB.js";
|
|
10
12
|
import "../chunks/chunk-J7DDZ4C2.js";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createTools
|
|
3
|
-
} from "../chunks/chunk-
|
|
4
|
-
import "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-BK5SLY32.js";
|
|
4
|
+
import "../chunks/chunk-HWHI4LFY.js";
|
|
5
5
|
import "../chunks/chunk-HZCTYL22.js";
|
|
6
|
-
import "../chunks/chunk-
|
|
6
|
+
import "../chunks/chunk-HPNGSG5E.js";
|
|
7
|
+
import "../chunks/chunk-PTZO4QXR.js";
|
|
7
8
|
import "../chunks/chunk-BOWXGMN3.js";
|
|
9
|
+
import "../chunks/chunk-PQSTQKRD.js";
|
|
8
10
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
9
11
|
import "../chunks/chunk-QAKJ76HB.js";
|
|
10
12
|
import "../chunks/chunk-J7DDZ4C2.js";
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import type { Json } from "../internal/json.ts";
|
|
|
2
2
|
import type { OutboundApi } from "../internal/outbound/api.ts";
|
|
3
3
|
import type { ToolsOptions } from "./registry.ts";
|
|
4
4
|
export { createTools, TOOL_NAMES } from "./registry.ts";
|
|
5
|
-
export type { OutboundTool, ToolName, ToolsOptions } from "./registry.ts";
|
|
6
|
-
export { DEFAULT_BODY_CHARS, UNTRUSTED_NOTE } from "./shared.ts";
|
|
5
|
+
export type { OutboundTool, ToolCallOptions, ToolName, ToolsOptions, } from "./registry.ts";
|
|
6
|
+
export { DEFAULT_BODY_CHARS, DEFAULT_TOOL_REQUESTS, UNTRUSTED_NOTE, } from "./shared.ts";
|
|
7
7
|
export type { MetricSummary, ToolFailure, ToolResult, ToolSuccess, } from "./shared.ts";
|
|
8
8
|
/** One function tool in the OpenAI SDK's shape. */
|
|
9
9
|
export interface OpenAiFunctionTool {
|
package/dist/tools/index.js
CHANGED
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openaiTools
|
|
3
|
-
} from "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-OLPMBRXM.js";
|
|
4
4
|
import {
|
|
5
|
-
DEFAULT_BODY_CHARS,
|
|
6
5
|
TOOL_NAMES,
|
|
7
|
-
UNTRUSTED_NOTE,
|
|
8
6
|
createTools
|
|
9
|
-
} from "../chunks/chunk-
|
|
10
|
-
import
|
|
7
|
+
} from "../chunks/chunk-BK5SLY32.js";
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_BODY_CHARS,
|
|
10
|
+
DEFAULT_TOOL_REQUESTS,
|
|
11
|
+
UNTRUSTED_NOTE
|
|
12
|
+
} from "../chunks/chunk-HWHI4LFY.js";
|
|
11
13
|
import "../chunks/chunk-HZCTYL22.js";
|
|
12
|
-
import "../chunks/chunk-
|
|
14
|
+
import "../chunks/chunk-HPNGSG5E.js";
|
|
15
|
+
import "../chunks/chunk-PTZO4QXR.js";
|
|
13
16
|
import "../chunks/chunk-BOWXGMN3.js";
|
|
17
|
+
import "../chunks/chunk-PQSTQKRD.js";
|
|
14
18
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
15
19
|
import "../chunks/chunk-QAKJ76HB.js";
|
|
16
20
|
import "../chunks/chunk-J7DDZ4C2.js";
|
|
17
21
|
import "../chunks/chunk-BLCJHP5H.js";
|
|
18
22
|
export {
|
|
19
23
|
DEFAULT_BODY_CHARS,
|
|
24
|
+
DEFAULT_TOOL_REQUESTS,
|
|
20
25
|
TOOL_NAMES,
|
|
21
26
|
UNTRUSTED_NOTE,
|
|
22
27
|
createTools,
|
package/dist/tools/registry.d.ts
CHANGED
|
@@ -4,6 +4,15 @@ import type { OutboundApi } from "../internal/outbound/api.ts";
|
|
|
4
4
|
import type { ToolResult } from "./shared.ts";
|
|
5
5
|
/** The fields of a tool's input object, each a Zod schema. */
|
|
6
6
|
export type InputFields = z.ZodObject["shape"];
|
|
7
|
+
/** What a caller of `call` can set for that one call. */
|
|
8
|
+
export interface ToolCallOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The most vendor requests this call may send, retries included. Replaces
|
|
11
|
+
* the tool's default; `Infinity` removes it. `createTools` passes its
|
|
12
|
+
* `maxRequestsPerToolCall` here.
|
|
13
|
+
*/
|
|
14
|
+
readonly maxRequests?: number | undefined;
|
|
15
|
+
}
|
|
7
16
|
/** A tool with its input type erased, so tools of different inputs sit in one list. */
|
|
8
17
|
export interface OutboundTool {
|
|
9
18
|
readonly name: string;
|
|
@@ -19,8 +28,10 @@ export interface OutboundTool {
|
|
|
19
28
|
* a model's arguments, an object typed from the schema and a
|
|
20
29
|
* `Record<string, unknown>` are all taken as they are.
|
|
21
30
|
*/
|
|
22
|
-
readonly call: (input: unknown) => Promise<ToolResult>;
|
|
31
|
+
readonly call: (input: unknown, options?: ToolCallOptions) => Promise<ToolResult>;
|
|
23
32
|
}
|
|
33
|
+
/** Throws `Invalid` unless `cap` is a positive integer or `Infinity`. */
|
|
34
|
+
export declare const checkCap: (cap: number | undefined, setting: string) => void;
|
|
24
35
|
export declare const TOOL_NAMES: readonly ["campaign_overview", "campaign_trend", "winning_steps", "sender_health", "reply_samples", "lead_runway", "compare_clients", "cross_channel_lead", "campaign_setup", "deliverability_check", "audience_lists", "vendor_read"];
|
|
25
36
|
export type ToolName = (typeof TOOL_NAMES)[number];
|
|
26
37
|
export interface ToolsOptions {
|
|
@@ -28,6 +39,14 @@ export interface ToolsOptions {
|
|
|
28
39
|
readonly only?: readonly ToolName[] | undefined;
|
|
29
40
|
/** More tools to offer after the built-in ones, for example `insightTools(outbound)`. */
|
|
30
41
|
readonly extra?: readonly OutboundTool[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The most vendor requests one tool call may send, retries included,
|
|
44
|
+
* counted across every read the call makes. Without it a built-in tool
|
|
45
|
+
* call may send 100 and an insight tool call what its input can cost, at
|
|
46
|
+
* most 500. `Infinity` removes the default. A `maxRequestsPerCall` on the
|
|
47
|
+
* instance and `budget()` still apply under it.
|
|
48
|
+
*/
|
|
49
|
+
readonly maxRequestsPerToolCall?: number | undefined;
|
|
31
50
|
}
|
|
32
51
|
/** What `next` says when the hint a tool wrote names a tool that is not on offer. */
|
|
33
52
|
export declare const NEXT_FALLBACK = "Pick another of the listed tools to go further.";
|
package/dist/tools/shared.d.ts
CHANGED
|
@@ -27,7 +27,17 @@ export interface ToolFailure {
|
|
|
27
27
|
readonly error: {
|
|
28
28
|
readonly code: string;
|
|
29
29
|
readonly message: string;
|
|
30
|
+
/**
|
|
31
|
+
* `false` when the same call fails the same way again: a request cap was
|
|
32
|
+
* reached, or the input or the adapter cannot work. Always set on a
|
|
33
|
+
* result from this package; a tool of your own may leave it out.
|
|
34
|
+
*/
|
|
35
|
+
readonly retryable?: boolean | undefined;
|
|
30
36
|
};
|
|
37
|
+
/** Set when the tool sent vendor requests before it failed. */
|
|
38
|
+
readonly meta?: {
|
|
39
|
+
readonly requests: number;
|
|
40
|
+
} | undefined;
|
|
31
41
|
readonly next: string;
|
|
32
42
|
}
|
|
33
43
|
export type ToolResult = ToolFailure | ToolSuccess;
|
|
@@ -79,4 +89,13 @@ export interface MetricSummary {
|
|
|
79
89
|
export declare const summarize: (row: MetricRow) => MetricSummary;
|
|
80
90
|
/** `derived` wins over `sampled`, which wins over `exact`. */
|
|
81
91
|
export declare const weakest: (all: readonly Evidence[]) => Evidence;
|
|
82
|
-
|
|
92
|
+
/** The default `maxRequestsPerToolCall` of a built-in tool. */
|
|
93
|
+
export declare const DEFAULT_TOOL_REQUESTS = 100;
|
|
94
|
+
/** What a model is told after a request cap stopped a tool call. */
|
|
95
|
+
export declare const capNext: (cap: number, isDefault: boolean, lower?: {
|
|
96
|
+
readonly input: string;
|
|
97
|
+
readonly to: number;
|
|
98
|
+
readonly sure: boolean;
|
|
99
|
+
}) => string;
|
|
100
|
+
/** A thrown error as a tool result. `requests` is what the call sent before it. */
|
|
101
|
+
export declare const failure: (cause: unknown, requests?: number, next?: string) => ToolFailure;
|