@leadpoet/client 0.1.4 → 0.1.5
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 +50 -13
- package/cli.js +46 -2
- package/cli.js.map +2 -2
- package/client.js +47 -2
- package/client.js.map +2 -2
- package/mcp.js +3969 -71
- package/mcp.js.map +4 -4
- package/package.json +13 -2
- package/skill/SKILL.md +73 -6
- package/types/scripts/leadpoet-mcp.d.ts +1 -7
- package/types/shared/account-monitoring.d.ts +1169 -0
- package/types/shared/assistant-brief.d.ts +1681 -0
- package/types/shared/assistant-memories.d.ts +62 -0
- package/types/shared/assistant-send-forecast.d.ts +442 -0
- package/types/shared/assistant.d.ts +238 -0
- package/types/shared/employee-count.d.ts +90 -0
- package/types/shared/gtm-context.d.ts +233 -0
- package/types/shared/icp-product-selection.d.ts +27 -0
- package/types/shared/icp-profile.d.ts +2625 -0
- package/types/shared/industry-taxonomy.d.ts +1 -0
- package/types/shared/lead-request-limits.d.ts +4 -0
- package/types/shared/leadpoet-client.d.ts +1315 -0
- package/types/shared/leadpoet-mcp-server.d.ts +39 -0
- package/types/shared/mcp-connect.d.ts +22 -0
- package/types/shared/monitor-technologies.d.ts +38 -0
- package/types/shared/outreach-analytics.d.ts +334 -0
- package/types/shared/outreach-audience-filters.d.ts +156 -0
- package/types/shared/outreach-audience-segments.d.ts +135 -0
- package/types/shared/outreach-enums.d.ts +22 -0
- package/types/shared/outreach-v2-contract.d.ts +253 -0
- package/types/shared/plan-entitlements.d.ts +75 -0
- package/types/shared/plan-features.d.ts +50 -0
- package/types/shared/request-credit-constants.d.ts +13 -0
- package/types/shared/website-fact-language.d.ts +9 -0
- package/types/shared/workspace-operations.d.ts +1975 -29
- package/types/shared/workspace-tool-metadata.d.ts +1083 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Agent memory: lasting preferences a person asked the agent to remember in
|
|
4
|
+
* one workspace, such as how they like outreach written or who they target.
|
|
5
|
+
* The agent reads them at the start of every answer. A memory is saved only
|
|
6
|
+
* when the person runs the agent's card or edits it in the agent's Memory tab.
|
|
7
|
+
*/
|
|
8
|
+
export declare const AGENT_MEMORY_TOPICS: readonly ["messaging", "icp", "other"];
|
|
9
|
+
export type AgentMemoryTopic = (typeof AGENT_MEMORY_TOPICS)[number];
|
|
10
|
+
export declare const AGENT_MEMORY_TOPIC_LABELS: Record<AgentMemoryTopic, string>;
|
|
11
|
+
export declare const AGENT_MEMORY_LIMITS: {
|
|
12
|
+
readonly contentChars: 300;
|
|
13
|
+
/** Active memories per person per workspace; each answer reads all of them. */
|
|
14
|
+
readonly active: 20;
|
|
15
|
+
};
|
|
16
|
+
export declare const agentMemoryCreateSchema: z.ZodObject<{
|
|
17
|
+
/** Makes a retried save return the same memory. */
|
|
18
|
+
operation_id: z.ZodString;
|
|
19
|
+
topic: z.ZodEnum<["messaging", "icp", "other"]>;
|
|
20
|
+
/** The preference, as the person put it. */
|
|
21
|
+
content: z.ZodEffects<z.ZodString, string, string>;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
operation_id: string;
|
|
24
|
+
content: string;
|
|
25
|
+
topic: "other" | "messaging" | "icp";
|
|
26
|
+
}, {
|
|
27
|
+
operation_id: string;
|
|
28
|
+
content: string;
|
|
29
|
+
topic: "other" | "messaging" | "icp";
|
|
30
|
+
}>;
|
|
31
|
+
export type AgentMemoryCreate = z.infer<typeof agentMemoryCreateSchema>;
|
|
32
|
+
/** A change to one memory. Archived is final; it no longer reaches the agent. */
|
|
33
|
+
export declare const agentMemoryUpdateSchema: z.ZodEffects<z.ZodObject<{
|
|
34
|
+
topic: z.ZodOptional<z.ZodEnum<["messaging", "icp", "other"]>>;
|
|
35
|
+
content: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
36
|
+
status: z.ZodOptional<z.ZodLiteral<"archived">>;
|
|
37
|
+
}, "strict", z.ZodTypeAny, {
|
|
38
|
+
status?: "archived" | undefined;
|
|
39
|
+
content?: string | undefined;
|
|
40
|
+
topic?: "other" | "messaging" | "icp" | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
status?: "archived" | undefined;
|
|
43
|
+
content?: string | undefined;
|
|
44
|
+
topic?: "other" | "messaging" | "icp" | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
status?: "archived" | undefined;
|
|
47
|
+
content?: string | undefined;
|
|
48
|
+
topic?: "other" | "messaging" | "icp" | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
status?: "archived" | undefined;
|
|
51
|
+
content?: string | undefined;
|
|
52
|
+
topic?: "other" | "messaging" | "icp" | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
export type AgentMemoryUpdate = z.infer<typeof agentMemoryUpdateSchema>;
|
|
55
|
+
export type AgentMemory = {
|
|
56
|
+
id: string;
|
|
57
|
+
topic: AgentMemoryTopic;
|
|
58
|
+
content: string;
|
|
59
|
+
status: "active" | "archived";
|
|
60
|
+
created_at: string;
|
|
61
|
+
updated_at: string;
|
|
62
|
+
};
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { reviewSummarySchema, type BriefReader } from "./assistant-brief";
|
|
3
|
+
/**
|
|
4
|
+
* The week's send forecast: how much the workspace's connected senders can
|
|
5
|
+
* send, how much they are likely to send at their recent pace, and what is
|
|
6
|
+
* lined up behind them (approved queue, Review, first messages waiting their
|
|
7
|
+
* turn). One builder serves the in-app agent, the Slack agent and MCP; each
|
|
8
|
+
* caller supplies only how to run a workspace read as the user.
|
|
9
|
+
*
|
|
10
|
+
* Senders rarely run at their limits: company pacing, campaign contact caps
|
|
11
|
+
* and retry spacing hold sends back on purpose. So the expected volume is each
|
|
12
|
+
* channel's capacity for the week times the share of its capacity it actually
|
|
13
|
+
* used over the last 7 days, never the bare limits. A read that fails makes
|
|
14
|
+
* its lines unavailable; it is never shown as zero.
|
|
15
|
+
*/
|
|
16
|
+
export declare const SEND_FORECAST_WEEKS: readonly ["current", "next"];
|
|
17
|
+
export type SendForecastWeek = (typeof SEND_FORECAST_WEEKS)[number];
|
|
18
|
+
export declare const sendForecastInputSchema: z.ZodObject<{
|
|
19
|
+
week: z.ZodEnum<["current", "next"]>;
|
|
20
|
+
timezone: z.ZodDefault<z.ZodEffects<z.ZodString, string, string>>;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
week: "next" | "current";
|
|
23
|
+
timezone: string;
|
|
24
|
+
}, {
|
|
25
|
+
week: "next" | "current";
|
|
26
|
+
timezone?: string | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
export type SendForecastInput = z.infer<typeof sendForecastInputSchema>;
|
|
29
|
+
export declare const SEND_FORECAST_TOOL: {
|
|
30
|
+
name: string;
|
|
31
|
+
title: string;
|
|
32
|
+
description: string;
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: "object";
|
|
35
|
+
properties: {
|
|
36
|
+
week: {
|
|
37
|
+
type: string;
|
|
38
|
+
enum: ("next" | "current")[];
|
|
39
|
+
};
|
|
40
|
+
timezone: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
required: string[];
|
|
46
|
+
additionalProperties: boolean;
|
|
47
|
+
};
|
|
48
|
+
inputError: string;
|
|
49
|
+
};
|
|
50
|
+
/** Campaign pages read for waiting contacts; a workspace past this many campaigns gets a partial count. */
|
|
51
|
+
export declare const FORECAST_CAMPAIGN_PAGES = 5;
|
|
52
|
+
declare const accountsSchema: z.ZodObject<{
|
|
53
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
54
|
+
channel: z.ZodString;
|
|
55
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
57
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
58
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
59
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
60
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
61
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
62
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
63
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
64
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
65
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
66
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
67
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
68
|
+
channel: z.ZodString;
|
|
69
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
71
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
72
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
73
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
74
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
75
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
76
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
77
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
78
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
79
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
80
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
81
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
82
|
+
channel: z.ZodString;
|
|
83
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
85
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
86
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
87
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
88
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
89
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
90
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
91
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
92
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
93
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
94
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
95
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
96
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
97
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
98
|
+
channel: z.ZodString;
|
|
99
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
101
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
102
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
103
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
104
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
105
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
106
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
107
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
108
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
109
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
110
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
111
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
112
|
+
channel: z.ZodString;
|
|
113
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
115
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
116
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
117
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
118
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
119
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
120
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
121
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
122
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
123
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
124
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
125
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
126
|
+
channel: z.ZodString;
|
|
127
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
129
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
130
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
131
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
132
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
133
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
134
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
135
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
136
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
137
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
138
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
139
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
140
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
141
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
142
|
+
channel: z.ZodString;
|
|
143
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
144
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
145
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
146
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
147
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
148
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
149
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
150
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
151
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
152
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
153
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
154
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
155
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
156
|
+
channel: z.ZodString;
|
|
157
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
158
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
159
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
161
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
162
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
163
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
164
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
165
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
166
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
167
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
168
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
169
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
170
|
+
channel: z.ZodString;
|
|
171
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
paused: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
173
|
+
sending_pause: z.ZodOptional<z.ZodUnknown>;
|
|
174
|
+
invitation_hold: z.ZodOptional<z.ZodUnknown>;
|
|
175
|
+
health: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
176
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
177
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
178
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
179
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
180
|
+
sendable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
181
|
+
}, z.ZodTypeAny, "passthrough">>>>;
|
|
182
|
+
delivery_safety: z.ZodOptional<z.ZodUnknown>;
|
|
183
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
184
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
185
|
+
declare const reportSchema: z.ZodObject<{
|
|
186
|
+
summary: z.ZodObject<{
|
|
187
|
+
sent: z.ZodNumber;
|
|
188
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
190
|
+
sent: z.ZodNumber;
|
|
191
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
193
|
+
sent: z.ZodNumber;
|
|
194
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
196
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
197
|
+
summary: z.ZodObject<{
|
|
198
|
+
sent: z.ZodNumber;
|
|
199
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
201
|
+
sent: z.ZodNumber;
|
|
202
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
204
|
+
sent: z.ZodNumber;
|
|
205
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
207
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
208
|
+
summary: z.ZodObject<{
|
|
209
|
+
sent: z.ZodNumber;
|
|
210
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
212
|
+
sent: z.ZodNumber;
|
|
213
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
214
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
215
|
+
sent: z.ZodNumber;
|
|
216
|
+
messaged_prospects: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
218
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
219
|
+
declare const campaignsPageSchema: z.ZodObject<{
|
|
220
|
+
strategies: z.ZodArray<z.ZodObject<{
|
|
221
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
223
|
+
reason_code: z.ZodString;
|
|
224
|
+
contact_count: z.ZodNumber;
|
|
225
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
227
|
+
reason_code: z.ZodString;
|
|
228
|
+
contact_count: z.ZodNumber;
|
|
229
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
230
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
231
|
+
reason_code: z.ZodString;
|
|
232
|
+
contact_count: z.ZodNumber;
|
|
233
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
234
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
235
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
236
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
238
|
+
reason_code: z.ZodString;
|
|
239
|
+
contact_count: z.ZodNumber;
|
|
240
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
241
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
242
|
+
reason_code: z.ZodString;
|
|
243
|
+
contact_count: z.ZodNumber;
|
|
244
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
246
|
+
reason_code: z.ZodString;
|
|
247
|
+
contact_count: z.ZodNumber;
|
|
248
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
249
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
250
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
251
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
253
|
+
reason_code: z.ZodString;
|
|
254
|
+
contact_count: z.ZodNumber;
|
|
255
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
257
|
+
reason_code: z.ZodString;
|
|
258
|
+
contact_count: z.ZodNumber;
|
|
259
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
261
|
+
reason_code: z.ZodString;
|
|
262
|
+
contact_count: z.ZodNumber;
|
|
263
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
264
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
265
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
266
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
267
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
268
|
+
strategies: z.ZodArray<z.ZodObject<{
|
|
269
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
270
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
271
|
+
reason_code: z.ZodString;
|
|
272
|
+
contact_count: z.ZodNumber;
|
|
273
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
274
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
275
|
+
reason_code: z.ZodString;
|
|
276
|
+
contact_count: z.ZodNumber;
|
|
277
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
279
|
+
reason_code: z.ZodString;
|
|
280
|
+
contact_count: z.ZodNumber;
|
|
281
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
282
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
283
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
284
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
285
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
286
|
+
reason_code: z.ZodString;
|
|
287
|
+
contact_count: z.ZodNumber;
|
|
288
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
290
|
+
reason_code: z.ZodString;
|
|
291
|
+
contact_count: z.ZodNumber;
|
|
292
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
293
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
294
|
+
reason_code: z.ZodString;
|
|
295
|
+
contact_count: z.ZodNumber;
|
|
296
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
298
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
299
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
301
|
+
reason_code: z.ZodString;
|
|
302
|
+
contact_count: z.ZodNumber;
|
|
303
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
304
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
305
|
+
reason_code: z.ZodString;
|
|
306
|
+
contact_count: z.ZodNumber;
|
|
307
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
308
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
309
|
+
reason_code: z.ZodString;
|
|
310
|
+
contact_count: z.ZodNumber;
|
|
311
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
313
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
314
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
315
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
316
|
+
strategies: z.ZodArray<z.ZodObject<{
|
|
317
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
319
|
+
reason_code: z.ZodString;
|
|
320
|
+
contact_count: z.ZodNumber;
|
|
321
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
322
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
323
|
+
reason_code: z.ZodString;
|
|
324
|
+
contact_count: z.ZodNumber;
|
|
325
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
326
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
327
|
+
reason_code: z.ZodString;
|
|
328
|
+
contact_count: z.ZodNumber;
|
|
329
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
330
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
331
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
332
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
333
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
334
|
+
reason_code: z.ZodString;
|
|
335
|
+
contact_count: z.ZodNumber;
|
|
336
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
337
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
338
|
+
reason_code: z.ZodString;
|
|
339
|
+
contact_count: z.ZodNumber;
|
|
340
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
341
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
342
|
+
reason_code: z.ZodString;
|
|
343
|
+
contact_count: z.ZodNumber;
|
|
344
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
345
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
346
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
347
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
+
current_waits: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
349
|
+
reason_code: z.ZodString;
|
|
350
|
+
contact_count: z.ZodNumber;
|
|
351
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
352
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
353
|
+
reason_code: z.ZodString;
|
|
354
|
+
contact_count: z.ZodNumber;
|
|
355
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
356
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
357
|
+
reason_code: z.ZodString;
|
|
358
|
+
contact_count: z.ZodNumber;
|
|
359
|
+
next_check_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
360
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
361
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
362
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
363
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
364
|
+
export type ForecastChannelId = "email" | "linkedin_messages" | "linkedin_invitations";
|
|
365
|
+
export type ForecastChannel = {
|
|
366
|
+
channel: ForecastChannelId;
|
|
367
|
+
label: string;
|
|
368
|
+
/** Senders counted: active, not paused and with readable limits. */
|
|
369
|
+
senders: number;
|
|
370
|
+
/** The most these senders can send in the forecast days, at today's limits. */
|
|
371
|
+
capacity: number;
|
|
372
|
+
sent_last_7_days: number;
|
|
373
|
+
capacity_last_7_days: number;
|
|
374
|
+
/** sent_last_7_days / capacity_last_7_days, from 0 to 1; null when there was no capacity. */
|
|
375
|
+
pace: number | null;
|
|
376
|
+
/** capacity x pace, rounded; null when pace is unknown. */
|
|
377
|
+
expected: number | null;
|
|
378
|
+
};
|
|
379
|
+
export type SendForecast = {
|
|
380
|
+
title: string;
|
|
381
|
+
week: SendForecastWeek;
|
|
382
|
+
timezone: string;
|
|
383
|
+
/** Local dates (YYYY-MM-DD) the forecast covers. */
|
|
384
|
+
period: {
|
|
385
|
+
from: string;
|
|
386
|
+
to: string;
|
|
387
|
+
};
|
|
388
|
+
generated_at: string;
|
|
389
|
+
channels: ForecastChannel[];
|
|
390
|
+
/** Email plus LinkedIn messages expected; invitations are counted on their own. */
|
|
391
|
+
expected_messages: number | null;
|
|
392
|
+
/** Expected messages x last 7 days' contacts per message. */
|
|
393
|
+
expected_contacts: number | null;
|
|
394
|
+
/** The count the Queued screen shows, on every sender; null if it couldn't be read. */
|
|
395
|
+
queued_in_active_campaigns: number | null;
|
|
396
|
+
/**
|
|
397
|
+
* Approved messages already queued on these senders, by sender channel, in
|
|
398
|
+
* active and paused campaigns together. Nov 10: named "including paused",
|
|
399
|
+
* the Agent called the whole total the paused campaigns' queue.
|
|
400
|
+
*/
|
|
401
|
+
queued_in_active_and_paused_campaigns: {
|
|
402
|
+
email: number;
|
|
403
|
+
linkedin: number;
|
|
404
|
+
} | null;
|
|
405
|
+
review: {
|
|
406
|
+
drafts_awaiting_decision: number;
|
|
407
|
+
in_paused_campaigns: number;
|
|
408
|
+
more: boolean;
|
|
409
|
+
} | null;
|
|
410
|
+
/** Contacts whose first message waits its turn, from active campaigns. */
|
|
411
|
+
waiting_first_messages: {
|
|
412
|
+
copilot_batch: number;
|
|
413
|
+
next_copilot_batch_at: string | null;
|
|
414
|
+
waiting_for_autopilot_capacity: number;
|
|
415
|
+
partial: boolean;
|
|
416
|
+
} | null;
|
|
417
|
+
notes: string[];
|
|
418
|
+
unavailable: string[];
|
|
419
|
+
};
|
|
420
|
+
type Reads = {
|
|
421
|
+
accounts: z.infer<typeof accountsSchema> | null;
|
|
422
|
+
recent: z.infer<typeof reportSchema> | null;
|
|
423
|
+
review: z.infer<typeof reviewSummarySchema> | null;
|
|
424
|
+
campaigns: Array<z.infer<typeof campaignsPageSchema>> | null;
|
|
425
|
+
};
|
|
426
|
+
/** The forecast days and the last 7 local days its pace is read from. */
|
|
427
|
+
export declare function forecastPeriods(week: SendForecastWeek, now: Date, timeZone: string): {
|
|
428
|
+
today: string;
|
|
429
|
+
period: {
|
|
430
|
+
from: string;
|
|
431
|
+
to: string;
|
|
432
|
+
};
|
|
433
|
+
recent: {
|
|
434
|
+
from: string;
|
|
435
|
+
to: string;
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
/** Builds the forecast from its reads. Pure: the same reads always give the same forecast. */
|
|
439
|
+
export declare function buildSendForecast(input: SendForecastInput, now: Date, raw: Partial<Record<keyof Reads | "queue", unknown>>): SendForecast;
|
|
440
|
+
/** Runs the forecast's reads in parallel with the caller's reader, then builds it. */
|
|
441
|
+
export declare function loadSendForecast(input: SendForecastInput, read: BriefReader, now?: Date): Promise<SendForecast>;
|
|
442
|
+
export {};
|