outbound-sdk 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alerts/index.js +1 -1
- package/dist/budget/index.js +1 -1
- package/dist/cards/index.js +217 -100
- package/dist/cards/sender-tool-cards.d.ts +6 -0
- package/dist/chunks/{chunk-UAHYPASH.js → chunk-3LRIWQEJ.js} +2 -1
- package/dist/chunks/{chunk-UZLFZZ2U.js → chunk-6BSFR5SF.js} +14 -2
- package/dist/chunks/{chunk-FTK4JS65.js → chunk-BTIJ24UY.js} +89 -9
- package/dist/chunks/{chunk-OVTYA3IB.js → chunk-EAG5NIPM.js} +614 -206
- package/dist/chunks/{chunk-A7DLJUA6.js → chunk-FT6HMMMP.js} +3 -1
- package/dist/chunks/chunk-I7GBBHD2.js +80 -0
- package/dist/chunks/{chunk-UOJG4VYF.js → chunk-LD5OAELW.js} +1 -1
- package/dist/chunks/{chunk-KMQHXFIZ.js → chunk-LJNU4LAR.js} +2094 -1014
- package/dist/chunks/{chunk-POBAY3TI.js → chunk-NLYGMVXS.js} +30 -0
- package/dist/chunks/{chunk-V7JKTNRO.js → chunk-OE45PREW.js} +1 -1
- package/dist/chunks/{chunk-MEEJIIIA.js → chunk-OP2GL7ZT.js} +77 -8
- package/dist/chunks/{chunk-YFJ3OQZS.js → chunk-OPLXELPS.js} +5 -1
- package/dist/chunks/{chunk-CVLGFVDC.js → chunk-PDYE6CWS.js} +136 -64
- package/dist/chunks/{chunk-OMCDMELK.js → chunk-PUIHJFK4.js} +1 -1
- package/dist/chunks/{chunk-MPE6VLLY.js → chunk-UZ4YWUZ7.js} +1 -1
- package/dist/chunks/{tools-AVJ3XJ5A.js → tools-VCCH3JNL.js} +13 -6
- package/dist/cli/bin.js +11 -10
- package/dist/cli/config.d.ts +0 -2
- package/dist/cli/index.js +10 -9
- package/dist/cli/offered.d.ts +31 -2
- package/dist/cli/serve.d.ts +4 -2
- package/dist/combine/index.js +60 -4
- package/dist/emailbison/index.js +4 -4
- package/dist/fixtures/index.js +4 -4
- package/dist/heyreach/index.js +17 -6
- package/dist/identity/index.js +46 -11
- package/dist/identity/keys.d.ts +1 -1
- package/dist/index.js +8 -6
- package/dist/insights/capped.d.ts +14 -1
- package/dist/insights/define.d.ts +8 -6
- package/dist/insights/index.d.ts +1 -1
- package/dist/insights/index.js +12 -61
- package/dist/insights/inputs.generated.d.ts +91 -16
- package/dist/insights/ops/campaign-ranking.d.ts +8 -1
- package/dist/insights/ops/channel-mix.d.ts +8 -1
- package/dist/insights/ops/client-report.d.ts +28 -18
- package/dist/insights/ops/client-runway.d.ts +43 -0
- package/dist/insights/ops/index.d.ts +6 -1
- package/dist/insights/ops/period-comparison.d.ts +35 -2
- package/dist/insights/ops/pipeline-forecast.d.ts +14 -9
- package/dist/insights/ops/shared.d.ts +49 -2
- package/dist/insights/ops/tag-rollup.d.ts +8 -1
- package/dist/insights/people/coverage.d.ts +26 -0
- package/dist/insights/people/dropped-replies-check.d.ts +19 -3
- package/dist/insights/people/dropped-replies.d.ts +6 -2
- package/dist/insights/people/find.d.ts +5 -4
- package/dist/insights/people/hot-leads.d.ts +10 -1
- package/dist/insights/people/index.d.ts +26 -2
- package/dist/insights/people/lead-collisions.d.ts +18 -1
- package/dist/insights/people/person-summary.d.ts +15 -3
- package/dist/insights/people/suppression-check.d.ts +18 -1
- package/dist/insights/people/thread-context.d.ts +79 -0
- package/dist/insights/people/thread-contexts.d.ts +59 -0
- package/dist/insights/people/thread-read.d.ts +33 -0
- package/dist/insights/registry.d.ts +29 -3
- package/dist/insights/senders/domain-health.d.ts +1 -1
- package/dist/insights/senders/index.d.ts +1 -1
- package/dist/insights/senders/read.d.ts +9 -0
- package/dist/insights/tools.d.ts +35 -2
- package/dist/instantly/adapter.d.ts +3 -2
- package/dist/instantly/capabilities.d.ts +5 -0
- package/dist/instantly/index.js +255 -66
- package/dist/instantly/lead-ids.d.ts +11 -0
- package/dist/instantly/map-lead.d.ts +19 -2
- package/dist/instantly/senders.d.ts +3 -0
- package/dist/internal/adapter.d.ts +7 -0
- package/dist/internal/capabilities.d.ts +8 -0
- package/dist/internal/entities.d.ts +24 -1
- package/dist/internal/fields.d.ts +10 -0
- package/dist/internal/outbound/api.d.ts +12 -0
- package/dist/internal/outbound/operations-account.d.ts +4 -1
- package/dist/internal/outbound/outbound.d.ts +2 -1
- package/dist/internal/outbound/specs-account.d.ts +2 -1
- package/dist/internal/person.d.ts +32 -0
- package/dist/internal/records.d.ts +2 -2
- package/dist/internal/reply-people.d.ts +25 -7
- package/dist/internal/runway.d.ts +38 -5
- package/dist/internal/url.d.ts +2 -1
- package/dist/loader/index.js +1 -1
- package/dist/memory/data.d.ts +2 -1
- package/dist/memory/index.js +6 -4
- package/dist/redact/index.d.ts +1 -1
- package/dist/redact/index.js +62 -31
- package/dist/redact/plugin.d.ts +13 -11
- package/dist/redact/tokens.d.ts +18 -1
- package/dist/smartlead/index.js +21 -7
- package/dist/tools/account-tools.d.ts +0 -5
- package/dist/tools/ai-sdk.js +5 -3
- package/dist/tools/campaign-tools.d.ts +0 -4
- package/dist/tools/claude-agent.js +5 -3
- package/dist/tools/deliverability-check.d.ts +9 -0
- package/dist/tools/index.js +6 -4
- package/dist/tools/people-tools.d.ts +4 -1
- package/dist/tools/person-input.d.ts +17 -0
- package/dist/tools/registry.d.ts +8 -1
- package/dist/tools/sender-health.d.ts +8 -0
- package/dist/tools/sender-impact.d.ts +38 -0
- package/dist/tools/shared.d.ts +5 -0
- package/dist/webhooks/index.js +6 -6
- package/package.json +1 -1
- /package/dist/chunks/{chunk-5XLR6XVV.js → chunk-HNYJO6B4.js} +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -6,24 +6,25 @@ import {
|
|
|
6
6
|
run,
|
|
7
7
|
serveStdio,
|
|
8
8
|
throttleMonitor
|
|
9
|
-
} from "../chunks/chunk-
|
|
10
|
-
import "../chunks/chunk-
|
|
11
|
-
import "../chunks/chunk-
|
|
12
|
-
import "../chunks/chunk-
|
|
9
|
+
} from "../chunks/chunk-PDYE6CWS.js";
|
|
10
|
+
import "../chunks/chunk-PUIHJFK4.js";
|
|
11
|
+
import "../chunks/chunk-EAG5NIPM.js";
|
|
12
|
+
import "../chunks/chunk-BTIJ24UY.js";
|
|
13
13
|
import "../chunks/chunk-4PA526S7.js";
|
|
14
|
+
import "../chunks/chunk-I7GBBHD2.js";
|
|
14
15
|
import "../chunks/chunk-HZCTYL22.js";
|
|
15
|
-
import "../chunks/chunk-
|
|
16
|
+
import "../chunks/chunk-OP2GL7ZT.js";
|
|
16
17
|
import "../chunks/chunk-4O2HRTTI.js";
|
|
17
18
|
import "../chunks/chunk-HPNGSG5E.js";
|
|
18
|
-
import "../chunks/chunk-
|
|
19
|
+
import "../chunks/chunk-FT6HMMMP.js";
|
|
19
20
|
import "../chunks/chunk-PTZO4QXR.js";
|
|
20
|
-
import "../chunks/chunk-
|
|
21
|
+
import "../chunks/chunk-NLYGMVXS.js";
|
|
21
22
|
import "../chunks/chunk-CPACP4YD.js";
|
|
22
23
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
24
|
+
import "../chunks/chunk-OPLXELPS.js";
|
|
23
25
|
import "../chunks/chunk-HXB2IOJJ.js";
|
|
24
|
-
import "../chunks/chunk-YFJ3OQZS.js";
|
|
25
26
|
import "../chunks/chunk-KVAG5GM2.js";
|
|
26
|
-
import "../chunks/chunk-
|
|
27
|
+
import "../chunks/chunk-HNYJO6B4.js";
|
|
27
28
|
import "../chunks/chunk-NFWWA7MI.js";
|
|
28
29
|
import "../chunks/chunk-XYHM4KHC.js";
|
|
29
30
|
import "../chunks/chunk-45TXPJW7.js";
|
package/dist/cli/offered.d.ts
CHANGED
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import type { Json } from "../internal/json.ts";
|
|
2
2
|
import type { OutboundApi } from "../internal/outbound/api.ts";
|
|
3
3
|
import type { OutboundTool } from "../tools/index.ts";
|
|
4
|
-
import type { PluginFlags } from "./config.ts";
|
|
4
|
+
import type { InsightToolCaps, PluginFlags } from "./config.ts";
|
|
5
|
+
import { Answer } from "./envelope.ts";
|
|
6
|
+
export interface Catalog {
|
|
7
|
+
/** The tools this instance offers: the built-in ones, then the insights. */
|
|
8
|
+
readonly tools: readonly OutboundTool[];
|
|
9
|
+
/** Every other tool, by name, with the reason it is left out. */
|
|
10
|
+
readonly leftOut: Readonly<Record<string, string>>;
|
|
11
|
+
/**
|
|
12
|
+
* Of `leftOut`, the tools another setting would offer, with how: those
|
|
13
|
+
* redact left out, and those one tool of a combined instance serves alone.
|
|
14
|
+
* The MCP server names them; what the vendor cannot do it does not.
|
|
15
|
+
*/
|
|
16
|
+
readonly turnOn: Readonly<Record<string, string>>;
|
|
17
|
+
/** Each tool of a combined instance as its own instance; none on any other. */
|
|
18
|
+
readonly members: readonly OutboundApi[];
|
|
19
|
+
/** What the instance offers by name, whatever `wanted` names. */
|
|
20
|
+
readonly offered: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The one catalog every CLI surface reads. `unmasked` is the same instance
|
|
24
|
+
* without redact, to tell which tools redact left out; `wanted` is what
|
|
25
|
+
* `--tools` names, which narrows what is offered but not what is left out.
|
|
26
|
+
*/
|
|
27
|
+
export declare const catalog: (outbound: OutboundApi, caps: InsightToolCaps, unmasked?: OutboundApi | undefined, wanted?: ReadonlySet<string> | undefined) => Promise<Catalog>;
|
|
5
28
|
/** The tools `outbound mcp` offers: the built-in ones, then the insights. */
|
|
6
|
-
export declare const offeredTools: (outbound: OutboundApi, flags: PluginFlags) => Promise<
|
|
29
|
+
export declare const offeredTools: (outbound: OutboundApi, flags: PluginFlags) => Promise<Catalog>;
|
|
7
30
|
/** A tool as `outbound tools` lists it: its inputs as JSON Schema, as `outbound insight` lists them. */
|
|
8
31
|
export declare const describeTool: (tool: OutboundTool) => Json;
|
|
9
32
|
/** Whether the tool has an input with no default, so it cannot run on none. */
|
|
10
33
|
export declare const requiresInput: (tool: OutboundTool) => boolean;
|
|
34
|
+
/** A catalog list, with each left-out tool's reason as a note. */
|
|
35
|
+
export declare const listedWith: (items: Json, leftOut: Readonly<Record<string, string>>) => Answer;
|
|
36
|
+
/** `outbound insight` with no name: the catalog's insights, and why each other one is left out. */
|
|
37
|
+
export declare const listedInsights: ({ leftOut, offered, }: Catalog) => Promise<Answer>;
|
|
38
|
+
/** Throws `Unsupported` with the reason when the catalog leaves the tool out. */
|
|
39
|
+
export declare const refuseLeftOut: (outbound: OutboundApi, { leftOut }: Catalog, name: string) => void;
|
package/dist/cli/serve.d.ts
CHANGED
|
@@ -11,7 +11,9 @@ export interface ServeIo {
|
|
|
11
11
|
readonly throttled?: (() => ThrottleTotal) | undefined;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Serves MCP on stdio
|
|
15
|
-
*
|
|
14
|
+
* Serves MCP on stdio: the CLI's catalog, and every tool it leaves out named
|
|
15
|
+
* with the reason. `unmasked` is the same instance without redact, to tell
|
|
16
|
+
* which tools redact left out; `wanted` is what `--tools` names, and a name
|
|
17
|
+
* the catalog leaves out is refused with its reason.
|
|
16
18
|
*/
|
|
17
19
|
export declare const serve: (outbound: OutboundApi, io: ServeIo, unmasked: OutboundApi | undefined, wanted: ReadonlySet<string> | undefined, caps: InsightToolCaps) => Promise<void>;
|
package/dist/combine/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
mergeFields,
|
|
4
4
|
resolveCapabilities,
|
|
5
5
|
resolveFields
|
|
6
|
-
} from "../chunks/chunk-
|
|
6
|
+
} from "../chunks/chunk-FT6HMMMP.js";
|
|
7
7
|
import {
|
|
8
8
|
recordBase
|
|
9
9
|
} from "../chunks/chunk-U5AK6OJM.js";
|
|
10
|
-
import "../chunks/chunk-
|
|
10
|
+
import "../chunks/chunk-NLYGMVXS.js";
|
|
11
11
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
12
12
|
import {
|
|
13
13
|
parseRef
|
|
@@ -378,8 +378,30 @@ var lists = (members) => ({
|
|
|
378
378
|
}))
|
|
379
379
|
})
|
|
380
380
|
});
|
|
381
|
+
var readsThreads = (member) => resolveCapabilities(member.capabilities)["messages.byThread"];
|
|
382
|
+
var pageThread = (members, ctx, query) => pageNewestFirst(
|
|
383
|
+
members.filter(readsThreads),
|
|
384
|
+
ctx,
|
|
385
|
+
query,
|
|
386
|
+
async (member, memberCtx, next) => {
|
|
387
|
+
if (member.listMessages === void 0) {
|
|
388
|
+
throw missing2(member, "listMessages");
|
|
389
|
+
}
|
|
390
|
+
try {
|
|
391
|
+
return await member.listMessages({ ...query, next }, memberCtx);
|
|
392
|
+
} catch (error) {
|
|
393
|
+
if (OutboundError.is(error) && (error.code === "Invalid" || error.code === "NotFound")) {
|
|
394
|
+
return { items: [] };
|
|
395
|
+
}
|
|
396
|
+
throw error;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
);
|
|
381
400
|
var messageLists = (members) => ({
|
|
382
401
|
listMessages: (query, ctx) => {
|
|
402
|
+
if (query.threadId !== void 0 && query.leadId === void 0 && query.campaignId === void 0) {
|
|
403
|
+
return pageThread(members, ctx, query);
|
|
404
|
+
}
|
|
383
405
|
const lead = query.leadId === void 0 ? void 0 : routeRef(members, ctx, query.leadId, "Lead");
|
|
384
406
|
return scopedOrAcross(
|
|
385
407
|
lead === void 0 ? members : [lead.member],
|
|
@@ -406,6 +428,18 @@ var messageLists = (members) => ({
|
|
|
406
428
|
},
|
|
407
429
|
pageNewestFirst
|
|
408
430
|
),
|
|
431
|
+
listSenderHealth: (query, ctx) => scopedOrAcross(
|
|
432
|
+
members,
|
|
433
|
+
ctx,
|
|
434
|
+
query,
|
|
435
|
+
(member, memberCtx, scoped) => {
|
|
436
|
+
if (member.listSenderHealth === void 0) {
|
|
437
|
+
throw missing2(member, "listSenderHealth");
|
|
438
|
+
}
|
|
439
|
+
return member.listSenderHealth(scoped, memberCtx);
|
|
440
|
+
},
|
|
441
|
+
takeInTurn
|
|
442
|
+
),
|
|
409
443
|
listSenders: (query, ctx) => scopedOrAcross(
|
|
410
444
|
members,
|
|
411
445
|
ctx,
|
|
@@ -456,6 +490,28 @@ var lookups = (members) => ({
|
|
|
456
490
|
routed.ctx
|
|
457
491
|
);
|
|
458
492
|
}
|
|
493
|
+
if (query.scopeIds !== void 0) {
|
|
494
|
+
const routes = query.scopeIds.map(
|
|
495
|
+
(id) => routeRef(members, ctx, id, "Stats scope")
|
|
496
|
+
);
|
|
497
|
+
const asked = members.flatMap((member) => {
|
|
498
|
+
const own = routes.filter((routed) => routed.member === member);
|
|
499
|
+
const [first] = own;
|
|
500
|
+
return first === void 0 ? [] : [{ first, own }];
|
|
501
|
+
});
|
|
502
|
+
const perSenders = await Promise.all(
|
|
503
|
+
asked.map(({ first, own }) => {
|
|
504
|
+
if (first.member.stats === void 0) {
|
|
505
|
+
throw missing2(first.member, "stats");
|
|
506
|
+
}
|
|
507
|
+
return first.member.stats(
|
|
508
|
+
{ ...query, scopeIds: own.map((routed) => routed.id) },
|
|
509
|
+
first.ctx
|
|
510
|
+
);
|
|
511
|
+
})
|
|
512
|
+
);
|
|
513
|
+
return perSenders.flat();
|
|
514
|
+
}
|
|
459
515
|
const perMember = await Promise.all(
|
|
460
516
|
members.map((member) => {
|
|
461
517
|
if (member.stats === void 0) {
|
|
@@ -479,8 +535,8 @@ var combine = (members) => {
|
|
|
479
535
|
...accountReads(members),
|
|
480
536
|
capabilities: {
|
|
481
537
|
...intersectCapabilities(first ?? resolveCapabilities(), ...rest),
|
|
482
|
-
// A thread id
|
|
483
|
-
"messages.byThread":
|
|
538
|
+
// A thread id names no member, so every member that reads threads is asked.
|
|
539
|
+
"messages.byThread": members.some(readsThreads),
|
|
484
540
|
// A native read belongs to one vendor; reach it through workspace(id).
|
|
485
541
|
native: false,
|
|
486
542
|
// A combined instance always knows its workspaces: they are its members.
|
package/dist/emailbison/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
toTag,
|
|
23
23
|
toWebhook,
|
|
24
24
|
toWorkspace
|
|
25
|
-
} from "../chunks/chunk-
|
|
25
|
+
} from "../chunks/chunk-6BSFR5SF.js";
|
|
26
26
|
import {
|
|
27
27
|
applyTracking,
|
|
28
28
|
ownTracking,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
import {
|
|
41
41
|
toVariant,
|
|
42
42
|
variantKey
|
|
43
|
-
} from "../chunks/chunk-
|
|
43
|
+
} from "../chunks/chunk-LD5OAELW.js";
|
|
44
44
|
import "../chunks/chunk-FALWG5U3.js";
|
|
45
45
|
import {
|
|
46
46
|
defineNative,
|
|
@@ -52,17 +52,17 @@ import {
|
|
|
52
52
|
recordBase,
|
|
53
53
|
refTo
|
|
54
54
|
} from "../chunks/chunk-U5AK6OJM.js";
|
|
55
|
-
import "../chunks/chunk-
|
|
55
|
+
import "../chunks/chunk-NLYGMVXS.js";
|
|
56
56
|
import {
|
|
57
57
|
emptyCounts,
|
|
58
58
|
metricRow,
|
|
59
59
|
sumCounts
|
|
60
60
|
} from "../chunks/chunk-CPACP4YD.js";
|
|
61
61
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
62
|
+
import "../chunks/chunk-OPLXELPS.js";
|
|
62
63
|
import {
|
|
63
64
|
assertWorkspaceId
|
|
64
65
|
} from "../chunks/chunk-HXB2IOJJ.js";
|
|
65
|
-
import "../chunks/chunk-YFJ3OQZS.js";
|
|
66
66
|
import "../chunks/chunk-KVAG5GM2.js";
|
|
67
67
|
import {
|
|
68
68
|
readEnv,
|
package/dist/fixtures/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
evidenceSchema
|
|
3
|
-
} from "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-NLYGMVXS.js";
|
|
4
4
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
5
|
+
import {
|
|
6
|
+
profileSlug
|
|
7
|
+
} from "../chunks/chunk-OPLXELPS.js";
|
|
5
8
|
import {
|
|
6
9
|
makeRef,
|
|
7
10
|
parseRef
|
|
8
11
|
} from "../chunks/chunk-HXB2IOJJ.js";
|
|
9
|
-
import {
|
|
10
|
-
profileSlug
|
|
11
|
-
} from "../chunks/chunk-YFJ3OQZS.js";
|
|
12
12
|
import {
|
|
13
13
|
stableId
|
|
14
14
|
} from "../chunks/chunk-KVAG5GM2.js";
|
package/dist/heyreach/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
listIn,
|
|
14
14
|
toVariant,
|
|
15
15
|
variantKey
|
|
16
|
-
} from "../chunks/chunk-
|
|
16
|
+
} from "../chunks/chunk-LD5OAELW.js";
|
|
17
17
|
import {
|
|
18
18
|
normalizeBody
|
|
19
19
|
} from "../chunks/chunk-FALWG5U3.js";
|
|
@@ -26,18 +26,18 @@ import {
|
|
|
26
26
|
refTo,
|
|
27
27
|
refsTo
|
|
28
28
|
} from "../chunks/chunk-U5AK6OJM.js";
|
|
29
|
-
import "../chunks/chunk-
|
|
29
|
+
import "../chunks/chunk-NLYGMVXS.js";
|
|
30
30
|
import {
|
|
31
31
|
emptyCounts,
|
|
32
32
|
metricRow
|
|
33
33
|
} from "../chunks/chunk-CPACP4YD.js";
|
|
34
34
|
import "../chunks/chunk-QGRZDTX4.js";
|
|
35
|
+
import {
|
|
36
|
+
profileSlug
|
|
37
|
+
} from "../chunks/chunk-OPLXELPS.js";
|
|
35
38
|
import {
|
|
36
39
|
assertWorkspaceId
|
|
37
40
|
} from "../chunks/chunk-HXB2IOJJ.js";
|
|
38
|
-
import {
|
|
39
|
-
profileSlug
|
|
40
|
-
} from "../chunks/chunk-YFJ3OQZS.js";
|
|
41
41
|
import {
|
|
42
42
|
stableId
|
|
43
43
|
} from "../chunks/chunk-KVAG5GM2.js";
|
|
@@ -272,6 +272,7 @@ var profileFields = (identity, profile, raw) => ({
|
|
|
272
272
|
tags: tagNames(field(profile, "tags")),
|
|
273
273
|
linkedinUrl: text(field(profile, "profileUrl")),
|
|
274
274
|
location: text(field(profile, "location")),
|
|
275
|
+
meeting: null,
|
|
275
276
|
// HeyReach profiles carry no phone number and no company website.
|
|
276
277
|
phone: null,
|
|
277
278
|
recipientMailProvider: null,
|
|
@@ -427,6 +428,7 @@ var fields = {
|
|
|
427
428
|
// LinkedIn has no bounce and no unsubscribe.
|
|
428
429
|
bounced: false,
|
|
429
430
|
engagement: false,
|
|
431
|
+
meeting: false,
|
|
430
432
|
phone: false,
|
|
431
433
|
recipientMailProvider: false,
|
|
432
434
|
unsubscribed: false,
|
|
@@ -434,9 +436,13 @@ var fields = {
|
|
|
434
436
|
},
|
|
435
437
|
message: {
|
|
436
438
|
bodyHtml: false,
|
|
439
|
+
// Read only by the Instantly adapter, whose emails name their lead by address.
|
|
440
|
+
leadEmail: false,
|
|
437
441
|
isAuto: false,
|
|
438
442
|
isAutoSource: false,
|
|
439
443
|
stepIndex: false,
|
|
444
|
+
// HeyReach documents no link to a Unibox conversation.
|
|
445
|
+
url: false,
|
|
440
446
|
variantKey: false
|
|
441
447
|
},
|
|
442
448
|
metricRow: {
|
|
@@ -464,6 +470,7 @@ var fields = {
|
|
|
464
470
|
placementTest: false,
|
|
465
471
|
reply: {
|
|
466
472
|
bodyHtml: false,
|
|
473
|
+
leadEmail: false,
|
|
467
474
|
// The lead's newest auto-tag, not a label on the message.
|
|
468
475
|
category: "derived",
|
|
469
476
|
categorySource: "derived",
|
|
@@ -471,6 +478,7 @@ var fields = {
|
|
|
471
478
|
isAutoSource: false,
|
|
472
479
|
leftCompany: false,
|
|
473
480
|
stepIndex: false,
|
|
481
|
+
url: false,
|
|
474
482
|
variantKey: false
|
|
475
483
|
},
|
|
476
484
|
sender: {
|
|
@@ -590,7 +598,8 @@ var caveats = [
|
|
|
590
598
|
"Three documented reads are not offered: the workspace API keys and a LinkedIn account's proxy (both return secrets, and raw refuses them), and a voice message's audio file, which is not JSON and would not survive the request engine, which reads every body as text. A voice message's transcript and duration are in its conversation.",
|
|
591
599
|
"The workspace's tags cannot be listed: the API creates tags and reads one lead's tags, nothing more. A tag has a name and a colour and no id.",
|
|
592
600
|
"Only the voice_note_received webhook payload is documented. Other events are assumed to share its skeleton, and the lowercase event_type names are inferred from two examples.",
|
|
593
|
-
"Webhooks are not signed; correlation_id is the only identifier and is assumed to be stable across redelivery."
|
|
601
|
+
"Webhooks are not signed; correlation_id is the only identifier and is assumed to be stable across redelivery.",
|
|
602
|
+
"A message's or reply's url is null: HeyReach documents no link to a Unibox conversation, and no read returns one (checked live on 2026-11-17: a conversation's only URLs are LinkedIn profile, image and company links)."
|
|
594
603
|
];
|
|
595
604
|
|
|
596
605
|
// src/heyreach/paging.ts
|
|
@@ -940,6 +949,8 @@ var messageFields = (scope, conversation, raw) => {
|
|
|
940
949
|
subject: text(raw.subject),
|
|
941
950
|
// Without the account the conversation cannot be read back, so no thread.
|
|
942
951
|
threadId: conversationId === "" || accountId === null ? null : `${accountId}:${conversationId}`,
|
|
952
|
+
// HeyReach documents no link to a conversation in its Unibox.
|
|
953
|
+
url: null,
|
|
943
954
|
variantKey: null
|
|
944
955
|
};
|
|
945
956
|
};
|
package/dist/identity/index.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PERSON_FORMS,
|
|
3
|
+
assertRefReadable,
|
|
4
|
+
leadRefParts,
|
|
5
|
+
personKey
|
|
6
|
+
} from "../chunks/chunk-I7GBBHD2.js";
|
|
1
7
|
import {
|
|
2
8
|
mapConcurrent
|
|
3
9
|
} from "../chunks/chunk-HZCTYL22.js";
|
|
4
10
|
import {
|
|
5
11
|
profileSlug
|
|
6
|
-
} from "../chunks/chunk-
|
|
12
|
+
} from "../chunks/chunk-OPLXELPS.js";
|
|
13
|
+
import "../chunks/chunk-HXB2IOJJ.js";
|
|
7
14
|
import {
|
|
8
15
|
OutboundError
|
|
9
16
|
} from "../chunks/chunk-XYHM4KHC.js";
|
|
@@ -22,12 +29,11 @@ var keysOf = (record) => [emailKey(record.email), linkedinKey(record.linkedinUrl
|
|
|
22
29
|
(key) => key !== null
|
|
23
30
|
);
|
|
24
31
|
var toKey = (identifier) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
if (lower.startsWith("email:") || lower.startsWith("linkedin:")) {
|
|
32
|
+
const lower = identifier.trim().toLowerCase();
|
|
33
|
+
if (/^(?:email|linkedin):[^:]+$/u.test(lower)) {
|
|
28
34
|
return lower;
|
|
29
35
|
}
|
|
30
|
-
return
|
|
36
|
+
return personKey(identifier);
|
|
31
37
|
};
|
|
32
38
|
|
|
33
39
|
// src/identity/plugin.ts
|
|
@@ -120,24 +126,53 @@ var assertIdentifiersReadable = (outbound) => {
|
|
|
120
126
|
}
|
|
121
127
|
};
|
|
122
128
|
var bySentAt = (left, right) => (left.sentAt ?? "").localeCompare(right.sentAt ?? "");
|
|
123
|
-
var
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
129
|
+
var start = async (outbound, identifier, tally) => {
|
|
130
|
+
const ref = leadRefParts(identifier);
|
|
131
|
+
if (ref === null) {
|
|
132
|
+
const key2 = toKey(identifier);
|
|
133
|
+
if (key2 === null) {
|
|
134
|
+
throw new OutboundError(
|
|
135
|
+
"Invalid",
|
|
136
|
+
`person() needs a person key, or ${PERSON_FORMS}`,
|
|
137
|
+
{ provider: outbound.provider }
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
return { key: key2, lead: null };
|
|
141
|
+
}
|
|
142
|
+
assertRefReadable(outbound, { ...ref, text: identifier.trim() });
|
|
143
|
+
const local = personKey(ref.sourceId);
|
|
144
|
+
if (local !== null) {
|
|
145
|
+
return { key: local, lead: null };
|
|
146
|
+
}
|
|
147
|
+
const lead = await outbound.leads.get(identifier.trim());
|
|
148
|
+
tally.requests += lead.meta.requests;
|
|
149
|
+
const [key] = keysOf(lead);
|
|
150
|
+
if (key === void 0) {
|
|
126
151
|
throw new OutboundError(
|
|
127
|
-
"
|
|
128
|
-
|
|
152
|
+
"NotFound",
|
|
153
|
+
`The lead ${identifier.trim()} has no email address or LinkedIn profile to link its records by`,
|
|
154
|
+
{ provider: outbound.provider }
|
|
129
155
|
);
|
|
130
156
|
}
|
|
157
|
+
return { key, lead };
|
|
158
|
+
};
|
|
159
|
+
var lookup = async (outbound, identifier, options) => {
|
|
131
160
|
assertIdentifiersReadable(outbound);
|
|
161
|
+
const tally = { requests: 0 };
|
|
162
|
+
const { key, lead } = await start(outbound, identifier, tally);
|
|
132
163
|
const keys = /* @__PURE__ */ new Set([key]);
|
|
133
164
|
const found = /* @__PURE__ */ new Map();
|
|
134
|
-
const tally = { requests: 0 };
|
|
135
165
|
if (outbound.capabilities["leads.lookup"] && options.campaignIds === void 0) {
|
|
136
166
|
await find(outbound, keys, found, tally);
|
|
137
167
|
} else if (await collect(outbound, options, keys, found, tally)) {
|
|
138
168
|
await collect(outbound, options, keys, found, tally);
|
|
139
169
|
}
|
|
140
170
|
const records = [...found.values()];
|
|
171
|
+
if (lead !== null && !records.some(
|
|
172
|
+
(record) => record.ref === lead.ref && record.campaignRef === lead.campaignRef
|
|
173
|
+
)) {
|
|
174
|
+
records.unshift(lead);
|
|
175
|
+
}
|
|
141
176
|
const wantsTimeline = (options.timeline ?? true) && outbound.capabilities["leads.timeline"];
|
|
142
177
|
const timelines = wantsTimeline ? await Promise.all(
|
|
143
178
|
records.map(
|
package/dist/identity/keys.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export declare const keysOf: (record: {
|
|
|
5
5
|
readonly email: string | null;
|
|
6
6
|
readonly linkedinUrl: string | null;
|
|
7
7
|
}) => string[];
|
|
8
|
-
/** Accepts a person key, an email address or a LinkedIn URL. */
|
|
8
|
+
/** Accepts a person key, an email address or a LinkedIn URL. A lead ref is not one. */
|
|
9
9
|
export declare const toKey: (identifier: string) => string | null;
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Outbound,
|
|
4
4
|
createOutbound,
|
|
5
5
|
fullJitterBackoff
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-OP2GL7ZT.js";
|
|
7
7
|
import {
|
|
8
8
|
MemoryRateLimitStore
|
|
9
9
|
} from "./chunks/chunk-4O2HRTTI.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
senderHealthSchema,
|
|
23
23
|
tagSchema,
|
|
24
24
|
webhookSubscriptionSchema
|
|
25
|
-
} from "./chunks/chunk-
|
|
25
|
+
} from "./chunks/chunk-FT6HMMMP.js";
|
|
26
26
|
import "./chunks/chunk-PTZO4QXR.js";
|
|
27
27
|
import {
|
|
28
28
|
defineNative
|
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
leadSchema,
|
|
38
38
|
leadStatusSchema,
|
|
39
39
|
mailProviderSchema,
|
|
40
|
+
meetingStatusSchema,
|
|
40
41
|
messageSchema,
|
|
41
42
|
metricRowSchema,
|
|
42
43
|
metricScopeSchema,
|
|
@@ -47,7 +48,7 @@ import {
|
|
|
47
48
|
senderStatusSchema,
|
|
48
49
|
sequenceSchema,
|
|
49
50
|
workspaceSchema
|
|
50
|
-
} from "./chunks/chunk-
|
|
51
|
+
} from "./chunks/chunk-NLYGMVXS.js";
|
|
51
52
|
import {
|
|
52
53
|
METRIC_DEFINITIONS,
|
|
53
54
|
computeRates,
|
|
@@ -59,13 +60,13 @@ import {
|
|
|
59
60
|
campaignStatusSchema,
|
|
60
61
|
replyCategorySchema
|
|
61
62
|
} from "./chunks/chunk-QGRZDTX4.js";
|
|
63
|
+
import {
|
|
64
|
+
profileSlug
|
|
65
|
+
} from "./chunks/chunk-OPLXELPS.js";
|
|
62
66
|
import {
|
|
63
67
|
makeRef,
|
|
64
68
|
parseRef
|
|
65
69
|
} from "./chunks/chunk-HXB2IOJJ.js";
|
|
66
|
-
import {
|
|
67
|
-
profileSlug
|
|
68
|
-
} from "./chunks/chunk-YFJ3OQZS.js";
|
|
69
70
|
import {
|
|
70
71
|
sha256Hex,
|
|
71
72
|
stableId
|
|
@@ -111,6 +112,7 @@ export {
|
|
|
111
112
|
mailProviderSchema,
|
|
112
113
|
makeErrorMapper,
|
|
113
114
|
makeRef,
|
|
115
|
+
meetingStatusSchema,
|
|
114
116
|
messageSchema,
|
|
115
117
|
metricRowSchema,
|
|
116
118
|
metricScopeSchema,
|
|
@@ -22,8 +22,21 @@ export interface CampaignsRead {
|
|
|
22
22
|
export declare const campaignsReadOf: (read: Capped<Campaign>) => CampaignsRead;
|
|
23
23
|
/** `active`, `active or paused`, `active, paused or completed`. */
|
|
24
24
|
export declare const either: (words: readonly string[]) => string;
|
|
25
|
+
/** A tool of a combined instance none of whose campaigns was read, because none is in the states asked for. */
|
|
26
|
+
export interface SkippedTool {
|
|
27
|
+
/** The tool's `provider:workspaceId`. */
|
|
28
|
+
readonly tool: string;
|
|
29
|
+
readonly provider: string;
|
|
30
|
+
readonly workspaceId: string;
|
|
31
|
+
/** Why none of its campaigns was read. */
|
|
32
|
+
readonly reason: string;
|
|
33
|
+
}
|
|
34
|
+
/** The campaigns read, and the tools of a combined instance left out because none of theirs is in the states asked for. */
|
|
35
|
+
export interface CampaignsListed extends Capped<Campaign> {
|
|
36
|
+
readonly skipped: readonly SkippedTool[];
|
|
37
|
+
}
|
|
25
38
|
/**
|
|
26
39
|
* The campaigns in the given states, up to `max` in all. On a combined
|
|
27
40
|
* instance `max` is shared among its tools, so each gets its share.
|
|
28
41
|
*/
|
|
29
|
-
export declare const readCampaignsIn: (context: InsightContext, statuses: readonly CampaignStatus[], max: number, input?: string) => Promise<
|
|
42
|
+
export declare const readCampaignsIn: (context: InsightContext, statuses: readonly CampaignStatus[], max: number, input?: string) => Promise<CampaignsListed>;
|
|
@@ -11,7 +11,7 @@ export interface InsightMeta {
|
|
|
11
11
|
readonly evidence: Evidence;
|
|
12
12
|
/** Vendor requests the insight made. */
|
|
13
13
|
readonly requests: number;
|
|
14
|
-
/** `false` when a cap stopped a read early,
|
|
14
|
+
/** `false` when the answer covers part of the data: a cap stopped a read early, or a record could not be checked. */
|
|
15
15
|
readonly complete: boolean;
|
|
16
16
|
/** What the reader should know before trusting the numbers. */
|
|
17
17
|
readonly notes: readonly string[];
|
|
@@ -74,7 +74,7 @@ export interface InsightContext {
|
|
|
74
74
|
readonly rows: (stats: StatsResult) => readonly MetricRow[];
|
|
75
75
|
/**
|
|
76
76
|
* Reads each item, a few side by side, and returns the results in order.
|
|
77
|
-
*
|
|
77
|
+
* Unless the insight sets `partialOnCap: false`, an item whose read a request cap
|
|
78
78
|
* stopped is left out, and the answer is marked incomplete with a note
|
|
79
79
|
* such as `Read 18 of 24 campaigns`; `what` names the items in the plural.
|
|
80
80
|
* Any other failure, and every failure elsewhere, is thrown.
|
|
@@ -157,10 +157,12 @@ export interface InsightSpec<Key extends string, Input, Data, Given = Input> {
|
|
|
157
157
|
/** The input that makes a run cheaper when lowered, such as `max_campaigns`. */
|
|
158
158
|
readonly scales?: (keyof Input & string) | undefined;
|
|
159
159
|
/**
|
|
160
|
-
* `
|
|
161
|
-
* request cap that stops `context.all` or
|
|
162
|
-
* keeps what they read, and the answer comes back
|
|
163
|
-
* and a note naming the cap, instead of
|
|
160
|
+
* `false` for an insight whose answer means nothing over part of the
|
|
161
|
+
* data. By default a request cap that stops `context.all` or
|
|
162
|
+
* `context.each` part way keeps what they read, and the answer comes back
|
|
163
|
+
* with `complete: false` and a note naming the cap, instead of throwing
|
|
164
|
+
* away the requests already spent; with `false` the run fails with
|
|
165
|
+
* `RateLimited` instead.
|
|
164
166
|
*/
|
|
165
167
|
readonly partialOnCap?: boolean | undefined;
|
|
166
168
|
readonly run: (context: InsightContext, input: Input) => Promise<Data>;
|
package/dist/insights/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { insightCost, insights, listInsights, runInsightByName, } from "./plugin
|
|
|
2
2
|
export type { InsightCostEstimate, Insights, InsightsExtension, } from "./plugin.ts";
|
|
3
3
|
export type { InsightCost, Price } from "./cost.ts";
|
|
4
4
|
export type { InsightInputs } from "./inputs.generated.ts";
|
|
5
|
-
export { INSIGHT_TOOL_CEILING, insightTools } from "./tools.ts";
|
|
5
|
+
export { INSIGHT_TOOL_CEILING, insightTools, membersOf } from "./tools.ts";
|
|
6
6
|
export type { InsightToolsOptions } from "./tools.ts";
|
|
7
7
|
export { defineInsight, runInsight } from "./define.ts";
|
|
8
8
|
export type { Cap, InsightContext, InsightDefinition, InsightMeta, InsightResult, RunOptions, } from "./define.ts";
|