@sellable/mcp 0.1.505 → 0.1.506
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/index-dev.js +0 -0
- package/dist/index.js +0 -0
- package/dist/tools/campaign-message-preparation.d.ts +27 -26
- package/dist/tools/campaign-message-preparation.js +12 -27
- package/dist/tools/leads.d.ts +0 -47
- package/dist/tools/leads.js +10 -24
- package/dist/tools/prompts.js +1 -1
- package/dist/tools/refill-sends.d.ts +78 -28
- package/dist/tools/refill-sends.js +171 -566
- package/dist/tools/refill-target-plan.js +8 -61
- package/dist/tools/registry.d.ts +84 -48
- package/package.json +1 -1
- package/skills/refill-sends/SKILL.md +11 -22
- package/skills/refill-sends-workflow/SKILL.md +6 -11
package/dist/index-dev.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
File without changes
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
type ApprovalMode = "mark_ready" | "approve";
|
|
2
2
|
type RowSelector = {
|
|
3
|
+
type: "reviewBatch";
|
|
4
|
+
basisHash?: string;
|
|
5
|
+
limit?: number;
|
|
6
|
+
} | {
|
|
7
|
+
type: "rowIds";
|
|
8
|
+
rowIds: string[];
|
|
9
|
+
} | {
|
|
3
10
|
type: "needsEnrichment";
|
|
4
11
|
limit?: number;
|
|
5
12
|
} | {
|
|
6
13
|
type: "needsApproval";
|
|
7
14
|
limit?: number;
|
|
8
15
|
} | {
|
|
9
|
-
type: "
|
|
16
|
+
type: "passedRows";
|
|
10
17
|
limit?: number;
|
|
11
18
|
} | {
|
|
12
|
-
type: "
|
|
19
|
+
type: "needsGeneratedMessage";
|
|
13
20
|
limit?: number;
|
|
14
21
|
} | {
|
|
15
22
|
type: "staleGeneratedMessages";
|
|
@@ -28,13 +35,9 @@ type StartPrepareMessagesInput = PrepareMessagesBaseInput & {
|
|
|
28
35
|
batchSize?: number;
|
|
29
36
|
maxBatchRows?: number;
|
|
30
37
|
approvalMode?: ApprovalMode;
|
|
31
|
-
rowSelector?: RowSelector;
|
|
32
38
|
autoContinue?: boolean;
|
|
33
39
|
disableLowPassRateStop?: boolean;
|
|
34
|
-
|
|
35
|
-
requestSource?: string;
|
|
36
|
-
senderId?: string;
|
|
37
|
-
actionType?: string;
|
|
40
|
+
rowSelector?: RowSelector;
|
|
38
41
|
};
|
|
39
42
|
type StatusPrepareMessagesInput = PrepareMessagesBaseInput;
|
|
40
43
|
type CancelPrepareMessagesInput = PrepareMessagesBaseInput;
|
|
@@ -79,6 +82,13 @@ export declare const campaignMessagePreparationToolDefinitions: ({
|
|
|
79
82
|
enum: string[];
|
|
80
83
|
description: string;
|
|
81
84
|
};
|
|
85
|
+
autoContinue: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
disableLowPassRateStop: {
|
|
89
|
+
type: string;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
82
92
|
rowSelector: {
|
|
83
93
|
type: string;
|
|
84
94
|
description: string;
|
|
@@ -87,6 +97,15 @@ export declare const campaignMessagePreparationToolDefinitions: ({
|
|
|
87
97
|
type: string;
|
|
88
98
|
enum: string[];
|
|
89
99
|
};
|
|
100
|
+
basisHash: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
rowIds: {
|
|
104
|
+
type: string;
|
|
105
|
+
items: {
|
|
106
|
+
type: string;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
90
109
|
limit: {
|
|
91
110
|
type: string;
|
|
92
111
|
minimum: number;
|
|
@@ -96,22 +115,6 @@ export declare const campaignMessagePreparationToolDefinitions: ({
|
|
|
96
115
|
required: string[];
|
|
97
116
|
additionalProperties: boolean;
|
|
98
117
|
};
|
|
99
|
-
autoContinue: {
|
|
100
|
-
type: string;
|
|
101
|
-
};
|
|
102
|
-
senderId: {
|
|
103
|
-
type: string;
|
|
104
|
-
description: string;
|
|
105
|
-
};
|
|
106
|
-
actionType: {
|
|
107
|
-
type: string;
|
|
108
|
-
enum: string[];
|
|
109
|
-
description: string;
|
|
110
|
-
};
|
|
111
|
-
disableLowPassRateStop: {
|
|
112
|
-
type: string;
|
|
113
|
-
description: string;
|
|
114
|
-
};
|
|
115
118
|
workspaceId: {
|
|
116
119
|
type: string;
|
|
117
120
|
description: string;
|
|
@@ -146,11 +149,9 @@ export declare const campaignMessagePreparationToolDefinitions: ({
|
|
|
146
149
|
batchSize?: undefined;
|
|
147
150
|
maxBatchRows?: undefined;
|
|
148
151
|
approvalMode?: undefined;
|
|
149
|
-
rowSelector?: undefined;
|
|
150
152
|
autoContinue?: undefined;
|
|
151
|
-
senderId?: undefined;
|
|
152
|
-
actionType?: undefined;
|
|
153
153
|
disableLowPassRateStop?: undefined;
|
|
154
|
+
rowSelector?: undefined;
|
|
154
155
|
};
|
|
155
156
|
additionalProperties: boolean;
|
|
156
157
|
required?: undefined;
|
|
@@ -43,45 +43,34 @@ export const campaignMessagePreparationToolDefinitions = [
|
|
|
43
43
|
enum: ["mark_ready", "approve"],
|
|
44
44
|
description: "Defaults to mark_ready. Use approve only when the user explicitly asks to flip Approved cells. Approval is not scheduling; it only makes the bounded cohort eligible for downstream scheduler ownership.",
|
|
45
45
|
},
|
|
46
|
+
autoContinue: { type: "boolean" },
|
|
47
|
+
disableLowPassRateStop: {
|
|
48
|
+
type: "boolean",
|
|
49
|
+
description: "Operator override for explicit fill/exhaust requests. When true, keep processing eligible rows even if the enriched sample pass rate is low. Still bounded by targetPreparedMessages and maxRowsToCheck.",
|
|
50
|
+
},
|
|
46
51
|
rowSelector: {
|
|
47
52
|
type: "object",
|
|
48
|
-
description: 'Optional
|
|
53
|
+
description: 'Optional row selector for scoped refill frontiers. Use {"type":"needsEnrichment","limit":N} to prepare the next unenriched/refill rows selected by get_refill_target_plan.',
|
|
49
54
|
properties: {
|
|
50
55
|
type: {
|
|
51
56
|
type: "string",
|
|
52
57
|
enum: [
|
|
58
|
+
"reviewBatch",
|
|
59
|
+
"rowIds",
|
|
53
60
|
"needsEnrichment",
|
|
54
61
|
"needsApproval",
|
|
62
|
+
"passedRows",
|
|
55
63
|
"needsGeneratedMessage",
|
|
56
|
-
"reviewBatch",
|
|
57
64
|
"staleGeneratedMessages",
|
|
58
65
|
],
|
|
59
66
|
},
|
|
67
|
+
basisHash: { type: "string" },
|
|
68
|
+
rowIds: { type: "array", items: { type: "string" } },
|
|
60
69
|
limit: { type: "number", minimum: 1, maximum: 500 },
|
|
61
70
|
},
|
|
62
71
|
required: ["type"],
|
|
63
72
|
additionalProperties: false,
|
|
64
73
|
},
|
|
65
|
-
autoContinue: { type: "boolean" },
|
|
66
|
-
senderId: {
|
|
67
|
-
type: "string",
|
|
68
|
-
description: "Optional refill-scope sender id. Used with actionType by refill_sends so preparation skips rows already attempted by other send actions.",
|
|
69
|
-
},
|
|
70
|
-
actionType: {
|
|
71
|
-
type: "string",
|
|
72
|
-
enum: [
|
|
73
|
-
"send_invite",
|
|
74
|
-
"send_dm",
|
|
75
|
-
"send_inmail_open",
|
|
76
|
-
"send_inmail_closed",
|
|
77
|
-
"react_and_comment",
|
|
78
|
-
],
|
|
79
|
-
description: "Optional refill-scope send action. InMail scopes treat open and paid InMail as one contact-reuse family.",
|
|
80
|
-
},
|
|
81
|
-
disableLowPassRateStop: {
|
|
82
|
-
type: "boolean",
|
|
83
|
-
description: "Operator override for explicit fill/exhaust requests. When true, keep processing eligible rows even if the enriched sample pass rate is low. Still bounded by targetPreparedMessages and maxRowsToCheck.",
|
|
84
|
-
},
|
|
85
74
|
workspaceId: {
|
|
86
75
|
type: "string",
|
|
87
76
|
description: "Explicit request-scoped workspace id for scheduled/yolo refill automation.",
|
|
@@ -131,13 +120,9 @@ export function startPrepareCampaignMessages(input) {
|
|
|
131
120
|
batchSize: input.batchSize,
|
|
132
121
|
maxBatchRows: input.maxBatchRows,
|
|
133
122
|
approvalMode: input.approvalMode,
|
|
134
|
-
rowSelector: input.rowSelector,
|
|
135
123
|
autoContinue: input.autoContinue,
|
|
136
124
|
disableLowPassRateStop: input.disableLowPassRateStop,
|
|
137
|
-
|
|
138
|
-
requestSource: input.requestSource,
|
|
139
|
-
senderId: input.senderId,
|
|
140
|
-
actionType: input.actionType,
|
|
125
|
+
rowSelector: input.rowSelector,
|
|
141
126
|
...(workspaceId ? { workspaceId } : {}),
|
|
142
127
|
}, workspaceId ?? undefined);
|
|
143
128
|
}
|
package/dist/tools/leads.d.ts
CHANGED
|
@@ -181,8 +181,6 @@ export type ConfirmLeadListInput = {
|
|
|
181
181
|
reviewBatchLimit?: number;
|
|
182
182
|
includeRawImportResult?: boolean;
|
|
183
183
|
allowPartialSourceList?: boolean;
|
|
184
|
-
sourceRowIds?: string[];
|
|
185
|
-
sourceRowLimit?: number;
|
|
186
184
|
/**
|
|
187
185
|
* Deprecated alias for reviewBatchLimit. Confirming a lead list now copies the
|
|
188
186
|
* confirmed source into the campaign table; this value no longer caps clone
|
|
@@ -297,8 +295,6 @@ export declare const leadToolDefinitions: ({
|
|
|
297
295
|
keepInSync?: undefined;
|
|
298
296
|
jobId?: undefined;
|
|
299
297
|
reviewBatchLimit?: undefined;
|
|
300
|
-
sourceRowIds?: undefined;
|
|
301
|
-
sourceRowLimit?: undefined;
|
|
302
298
|
allowPartialSourceList?: undefined;
|
|
303
299
|
includeRawImportResult?: undefined;
|
|
304
300
|
selections?: undefined;
|
|
@@ -493,8 +489,6 @@ export declare const leadToolDefinitions: ({
|
|
|
493
489
|
keepInSync?: undefined;
|
|
494
490
|
jobId?: undefined;
|
|
495
491
|
reviewBatchLimit?: undefined;
|
|
496
|
-
sourceRowIds?: undefined;
|
|
497
|
-
sourceRowLimit?: undefined;
|
|
498
492
|
allowPartialSourceList?: undefined;
|
|
499
493
|
includeRawImportResult?: undefined;
|
|
500
494
|
selections?: undefined;
|
|
@@ -588,8 +582,6 @@ export declare const leadToolDefinitions: ({
|
|
|
588
582
|
keepInSync?: undefined;
|
|
589
583
|
jobId?: undefined;
|
|
590
584
|
reviewBatchLimit?: undefined;
|
|
591
|
-
sourceRowIds?: undefined;
|
|
592
|
-
sourceRowLimit?: undefined;
|
|
593
585
|
allowPartialSourceList?: undefined;
|
|
594
586
|
includeRawImportResult?: undefined;
|
|
595
587
|
selections?: undefined;
|
|
@@ -755,8 +747,6 @@ export declare const leadToolDefinitions: ({
|
|
|
755
747
|
keepInSync?: undefined;
|
|
756
748
|
jobId?: undefined;
|
|
757
749
|
reviewBatchLimit?: undefined;
|
|
758
|
-
sourceRowIds?: undefined;
|
|
759
|
-
sourceRowLimit?: undefined;
|
|
760
750
|
allowPartialSourceList?: undefined;
|
|
761
751
|
includeRawImportResult?: undefined;
|
|
762
752
|
selections?: undefined;
|
|
@@ -864,8 +854,6 @@ export declare const leadToolDefinitions: ({
|
|
|
864
854
|
keepInSync?: undefined;
|
|
865
855
|
jobId?: undefined;
|
|
866
856
|
reviewBatchLimit?: undefined;
|
|
867
|
-
sourceRowIds?: undefined;
|
|
868
|
-
sourceRowLimit?: undefined;
|
|
869
857
|
allowPartialSourceList?: undefined;
|
|
870
858
|
includeRawImportResult?: undefined;
|
|
871
859
|
selections?: undefined;
|
|
@@ -982,8 +970,6 @@ export declare const leadToolDefinitions: ({
|
|
|
982
970
|
keepInSync?: undefined;
|
|
983
971
|
jobId?: undefined;
|
|
984
972
|
reviewBatchLimit?: undefined;
|
|
985
|
-
sourceRowIds?: undefined;
|
|
986
|
-
sourceRowLimit?: undefined;
|
|
987
973
|
allowPartialSourceList?: undefined;
|
|
988
974
|
includeRawImportResult?: undefined;
|
|
989
975
|
selections?: undefined;
|
|
@@ -1089,8 +1075,6 @@ export declare const leadToolDefinitions: ({
|
|
|
1089
1075
|
keepInSync?: undefined;
|
|
1090
1076
|
jobId?: undefined;
|
|
1091
1077
|
reviewBatchLimit?: undefined;
|
|
1092
|
-
sourceRowIds?: undefined;
|
|
1093
|
-
sourceRowLimit?: undefined;
|
|
1094
1078
|
allowPartialSourceList?: undefined;
|
|
1095
1079
|
includeRawImportResult?: undefined;
|
|
1096
1080
|
selections?: undefined;
|
|
@@ -1201,8 +1185,6 @@ export declare const leadToolDefinitions: ({
|
|
|
1201
1185
|
keepInSync?: undefined;
|
|
1202
1186
|
jobId?: undefined;
|
|
1203
1187
|
reviewBatchLimit?: undefined;
|
|
1204
|
-
sourceRowIds?: undefined;
|
|
1205
|
-
sourceRowLimit?: undefined;
|
|
1206
1188
|
allowPartialSourceList?: undefined;
|
|
1207
1189
|
includeRawImportResult?: undefined;
|
|
1208
1190
|
selections?: undefined;
|
|
@@ -1301,8 +1283,6 @@ export declare const leadToolDefinitions: ({
|
|
|
1301
1283
|
keepInSync?: undefined;
|
|
1302
1284
|
jobId?: undefined;
|
|
1303
1285
|
reviewBatchLimit?: undefined;
|
|
1304
|
-
sourceRowIds?: undefined;
|
|
1305
|
-
sourceRowLimit?: undefined;
|
|
1306
1286
|
allowPartialSourceList?: undefined;
|
|
1307
1287
|
includeRawImportResult?: undefined;
|
|
1308
1288
|
selections?: undefined;
|
|
@@ -2193,8 +2173,6 @@ export declare const leadToolDefinitions: ({
|
|
|
2193
2173
|
keepInSync?: undefined;
|
|
2194
2174
|
jobId?: undefined;
|
|
2195
2175
|
reviewBatchLimit?: undefined;
|
|
2196
|
-
sourceRowIds?: undefined;
|
|
2197
|
-
sourceRowLimit?: undefined;
|
|
2198
2176
|
allowPartialSourceList?: undefined;
|
|
2199
2177
|
includeRawImportResult?: undefined;
|
|
2200
2178
|
selections?: undefined;
|
|
@@ -2302,8 +2280,6 @@ export declare const leadToolDefinitions: ({
|
|
|
2302
2280
|
keepInSync?: undefined;
|
|
2303
2281
|
jobId?: undefined;
|
|
2304
2282
|
reviewBatchLimit?: undefined;
|
|
2305
|
-
sourceRowIds?: undefined;
|
|
2306
|
-
sourceRowLimit?: undefined;
|
|
2307
2283
|
allowPartialSourceList?: undefined;
|
|
2308
2284
|
includeRawImportResult?: undefined;
|
|
2309
2285
|
selections?: undefined;
|
|
@@ -3349,8 +3325,6 @@ export declare const leadToolDefinitions: ({
|
|
|
3349
3325
|
keepInSync?: undefined;
|
|
3350
3326
|
jobId?: undefined;
|
|
3351
3327
|
reviewBatchLimit?: undefined;
|
|
3352
|
-
sourceRowIds?: undefined;
|
|
3353
|
-
sourceRowLimit?: undefined;
|
|
3354
3328
|
allowPartialSourceList?: undefined;
|
|
3355
3329
|
includeRawImportResult?: undefined;
|
|
3356
3330
|
selections?: undefined;
|
|
@@ -3505,8 +3479,6 @@ export declare const leadToolDefinitions: ({
|
|
|
3505
3479
|
keepInSync?: undefined;
|
|
3506
3480
|
jobId?: undefined;
|
|
3507
3481
|
reviewBatchLimit?: undefined;
|
|
3508
|
-
sourceRowIds?: undefined;
|
|
3509
|
-
sourceRowLimit?: undefined;
|
|
3510
3482
|
allowPartialSourceList?: undefined;
|
|
3511
3483
|
includeRawImportResult?: undefined;
|
|
3512
3484
|
selections?: undefined;
|
|
@@ -3648,8 +3620,6 @@ export declare const leadToolDefinitions: ({
|
|
|
3648
3620
|
keepInSync?: undefined;
|
|
3649
3621
|
jobId?: undefined;
|
|
3650
3622
|
reviewBatchLimit?: undefined;
|
|
3651
|
-
sourceRowIds?: undefined;
|
|
3652
|
-
sourceRowLimit?: undefined;
|
|
3653
3623
|
allowPartialSourceList?: undefined;
|
|
3654
3624
|
includeRawImportResult?: undefined;
|
|
3655
3625
|
selections?: undefined;
|
|
@@ -3746,8 +3716,6 @@ export declare const leadToolDefinitions: ({
|
|
|
3746
3716
|
keepInSync?: undefined;
|
|
3747
3717
|
jobId?: undefined;
|
|
3748
3718
|
reviewBatchLimit?: undefined;
|
|
3749
|
-
sourceRowIds?: undefined;
|
|
3750
|
-
sourceRowLimit?: undefined;
|
|
3751
3719
|
allowPartialSourceList?: undefined;
|
|
3752
3720
|
includeRawImportResult?: undefined;
|
|
3753
3721
|
selections?: undefined;
|
|
@@ -3794,17 +3762,6 @@ export declare const leadToolDefinitions: ({
|
|
|
3794
3762
|
type: string;
|
|
3795
3763
|
description: string;
|
|
3796
3764
|
};
|
|
3797
|
-
sourceRowIds: {
|
|
3798
|
-
type: string;
|
|
3799
|
-
items: {
|
|
3800
|
-
type: string;
|
|
3801
|
-
};
|
|
3802
|
-
description: string;
|
|
3803
|
-
};
|
|
3804
|
-
sourceRowLimit: {
|
|
3805
|
-
type: string;
|
|
3806
|
-
description: string;
|
|
3807
|
-
};
|
|
3808
3765
|
allowPartialSourceList: {
|
|
3809
3766
|
type: string;
|
|
3810
3767
|
description: string;
|
|
@@ -4014,8 +3971,6 @@ export declare const leadToolDefinitions: ({
|
|
|
4014
3971
|
keepInSync?: undefined;
|
|
4015
3972
|
jobId?: undefined;
|
|
4016
3973
|
reviewBatchLimit?: undefined;
|
|
4017
|
-
sourceRowIds?: undefined;
|
|
4018
|
-
sourceRowLimit?: undefined;
|
|
4019
3974
|
allowPartialSourceList?: undefined;
|
|
4020
3975
|
includeRawImportResult?: undefined;
|
|
4021
3976
|
};
|
|
@@ -4113,8 +4068,6 @@ export declare const leadToolDefinitions: ({
|
|
|
4113
4068
|
keepInSync?: undefined;
|
|
4114
4069
|
jobId?: undefined;
|
|
4115
4070
|
reviewBatchLimit?: undefined;
|
|
4116
|
-
sourceRowIds?: undefined;
|
|
4117
|
-
sourceRowLimit?: undefined;
|
|
4118
4071
|
allowPartialSourceList?: undefined;
|
|
4119
4072
|
includeRawImportResult?: undefined;
|
|
4120
4073
|
selections?: undefined;
|
package/dist/tools/leads.js
CHANGED
|
@@ -2202,15 +2202,6 @@ export const leadToolDefinitions = [
|
|
|
2202
2202
|
type: "number",
|
|
2203
2203
|
description: "Number of campaign rows to use as the initial review/process sample. Defaults to 15.",
|
|
2204
2204
|
},
|
|
2205
|
-
sourceRowIds: {
|
|
2206
|
-
type: "array",
|
|
2207
|
-
items: { type: "string" },
|
|
2208
|
-
description: "Optional exact source WorkflowTableRow ids to copy from the selected source lead list. Use only for bounded refill same-source copy packets.",
|
|
2209
|
-
},
|
|
2210
|
-
sourceRowLimit: {
|
|
2211
|
-
type: "number",
|
|
2212
|
-
description: "Optional cap for copying the first N source rows. Prefer sourceRowIds when a refill packet provides exact ids.",
|
|
2213
|
-
},
|
|
2214
2205
|
allowPartialSourceList: {
|
|
2215
2206
|
type: "boolean",
|
|
2216
2207
|
description: "Explicit override for user-approved early continuation. Default false. When true, confirm_lead_list may copy the currently materialized rows from a still-running source import; use only after the user explicitly asks to keep going with the partial list.",
|
|
@@ -3642,11 +3633,11 @@ export async function searchSignals(input) {
|
|
|
3642
3633
|
const effectiveHeadlineICPCriteria = headlineICPCriteria && headlineICPCriteria.length > 0
|
|
3643
3634
|
? headlineICPCriteria
|
|
3644
3635
|
: rubricGuidelines;
|
|
3645
|
-
if (campaignOfferId
|
|
3636
|
+
if (campaignOfferId) {
|
|
3646
3637
|
await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
|
|
3647
3638
|
leadSourceType: "new",
|
|
3648
3639
|
leadSourceProvider: "signal-discovery",
|
|
3649
|
-
currentStep: searchCurrentStep,
|
|
3640
|
+
...(searchCurrentStep ? { currentStep: searchCurrentStep } : {}),
|
|
3650
3641
|
...(currentStepTransition ? { currentStepTransition } : {}),
|
|
3651
3642
|
watchNarration: buildSignalDiscoverySearchWatchNarration(),
|
|
3652
3643
|
});
|
|
@@ -3662,9 +3653,9 @@ export async function searchSignals(input) {
|
|
|
3662
3653
|
}
|
|
3663
3654
|
const response = await api.post(`/api/v1/signal-discovery/search-signals`, searchRequest);
|
|
3664
3655
|
const summary = summarizeSignalSearchResponse(response);
|
|
3665
|
-
if (campaignOfferId
|
|
3656
|
+
if (campaignOfferId) {
|
|
3666
3657
|
await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
|
|
3667
|
-
currentStep: searchCurrentStep,
|
|
3658
|
+
...(searchCurrentStep ? { currentStep: searchCurrentStep } : {}),
|
|
3668
3659
|
...(currentStepTransition ? { currentStepTransition } : {}),
|
|
3669
3660
|
watchNarration: buildSignalDiscoveryResultsWatchNarration(summary.postsReturned),
|
|
3670
3661
|
});
|
|
@@ -4139,7 +4130,7 @@ export async function confirmLeadList(input) {
|
|
|
4139
4130
|
const api = getApi();
|
|
4140
4131
|
const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
|
|
4141
4132
|
const requestOptions = workspaceRequestOptions(workspaceId);
|
|
4142
|
-
const { campaignOfferId, currentStep, confirmed, sourceLeadListId, campaignName, keepInSync, jobId, reviewBatchLimit, includeRawImportResult, allowPartialSourceList, targetLeadCount,
|
|
4133
|
+
const { campaignOfferId, currentStep, confirmed, sourceLeadListId, campaignName, keepInSync, jobId, reviewBatchLimit, includeRawImportResult, allowPartialSourceList, targetLeadCount, } = input;
|
|
4143
4134
|
assertInteractionApproval({
|
|
4144
4135
|
campaignId: campaignOfferId,
|
|
4145
4136
|
action: "confirm-lead-list",
|
|
@@ -4345,8 +4336,6 @@ export async function confirmLeadList(input) {
|
|
|
4345
4336
|
campaignName,
|
|
4346
4337
|
keepInSync,
|
|
4347
4338
|
currentStep: null,
|
|
4348
|
-
sourceRowIds,
|
|
4349
|
-
sourceRowLimit,
|
|
4350
4339
|
...(workspaceId ? { workspaceId } : {}),
|
|
4351
4340
|
};
|
|
4352
4341
|
const importResult = await (requestOptions
|
|
@@ -4582,7 +4571,7 @@ export function getProviderPrompt(input) {
|
|
|
4582
4571
|
}
|
|
4583
4572
|
export async function selectPromisingPosts(input) {
|
|
4584
4573
|
const api = getApi();
|
|
4585
|
-
const { campaignOfferId, selections, headlineICPCriteria,
|
|
4574
|
+
const { campaignOfferId, selections, headlineICPCriteria, selectionMode, mode, scrapePlanMode, targetEngagerCount, maxPostsToScrape, } = input;
|
|
4586
4575
|
const effectiveMode = selectionMode ?? mode ?? "replace";
|
|
4587
4576
|
const effectiveScrapePlanMode = scrapePlanMode ??
|
|
4588
4577
|
(targetEngagerCount || maxPostsToScrape
|
|
@@ -4682,13 +4671,10 @@ Approval card should say:
|
|
|
4682
4671
|
|
|
4683
4672
|
**Approve scraping ${selectionResult.selectedCount} recommended LinkedIn post${selectionResult.selectedCount === 1 ? "" : "s"}?**`;
|
|
4684
4673
|
}
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
watchNarration: buildSelectedPostApprovalWatchNarration(selectionResult.selectedCount, recommendedPostCount, recommendationTargetEngagerCount),
|
|
4690
|
-
});
|
|
4691
|
-
}
|
|
4674
|
+
await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
|
|
4675
|
+
currentStep: "signal-discovery",
|
|
4676
|
+
watchNarration: buildSelectedPostApprovalWatchNarration(selectionResult.selectedCount, recommendedPostCount, recommendationTargetEngagerCount),
|
|
4677
|
+
});
|
|
4692
4678
|
return {
|
|
4693
4679
|
success: true,
|
|
4694
4680
|
selectedCount: selectionResult.selectedCount,
|
package/dist/tools/prompts.js
CHANGED
|
@@ -373,7 +373,7 @@ export function getPostFindLeadsScoutRegistry() {
|
|
|
373
373
|
codex: 'After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not spawn anything before that question. After the answer, launch only Message Drafting. The filter-choice answer is the post-import user gate for this single worker; do not ask another question about starting it in step-wise or YOLO mode. The registry lookup is not a launch: after get_post_find_leads_scout_registry, immediately invoke Task/spawn_agent or the host background-agent mechanism before loading filter-leads.md, before saving rubrics, and before treating skip-filters as ready for message review. Both choices route through this kickoff; do not let filters_skipped jump straight from filter-choice to message-generation. If filters are chosen, the parent stays on Filter Rules and drafts/saves rubrics with MCP tools while Message Drafting runs in the background. If filters are skipped, move to Messages/message review only after Message Drafting has started or is ready; update_campaign(currentStep=messages) is not proof of launch. If the named Message Drafting custom agent is unavailable, spawn a generic gpt-5.5 xhigh Message Drafting background agent with the same lean campaign/table basis. When the background worker starts, persist workerDetails.messageDraftBuilder with statusSource "branch", status "branch-running", runId, startedAt, updatedAt, basisToken when known, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds; workerStatuses.messageDraftBuilder may be "running" as a simple badge only. Never put rich proof under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start the same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource "parent-thread-fallback" and status "fallback-active", and require the same live context, prompt, assets, and validation gate before message review; do not wait until filters are saved and then call the registry.',
|
|
374
374
|
claude: "After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not invoke any Task/Agent before that question. After the answer, invoke only Message Drafting. If filters are chosen, parent drafts/saves rubrics with MCP tools while Message Drafting runs, asks filter approval, then joins Message Drafting. If filters are skipped, invoke only Message Drafting and move to Messages/message review.",
|
|
375
375
|
parentThreadRule: 'Named agents are optional acceleration, but message drafting is not optional. The only normal background worker is Message Drafting. The filter-choice answer is the campaign-scoped go-ahead for this single post-import worker; do not ask another question to start it in step-wise or YOLO mode. If a named agent is unavailable, use a generic gpt-5.5 xhigh Message Drafting background agent. source work and filter work stay in the parent thread with MCP tools. If post-find-leads-message-scout is available, run it as the background Message Draft Builder after the filter-choice answer. The registry lookup is not a launch: get_post_find_leads_scout_registry only identifies the worker, and Message Drafting counts as started only after Task/spawn_agent or the host background-agent tool is invoked, or after the parent begins the same full message branch inline because no background-agent tool is callable. This launch must happen before loading filter-leads.md, save_rubrics, filter approval, or skip-filter message review; currentStep=messages is not proof of launch. If post-find-leads-message-scout is absent, do not customer-surface install status. Do not silently treat message drafting as started; the main thread must either launch the background worker or execute the same message branch from CampaignOffer state, selected source state, workflowTableId, and initial campaign-table execution slice rows. For a spawned worker, record workerDetails.messageDraftBuilder with statusSource branch / status branch-running, runId, startedAt, updatedAt, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds. workerStatuses.messageDraftBuilder is optional simple badge text only ("running", "ready", "blocked", "idle"); never put runId/statusSource/basis under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start that same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource parent-thread-fallback / status fallback-active then ready, and require the same live context, prompt, assets, and validation gate before message review; do not report that as a background worker failure. If neither branch nor inline fallback can run, return blocked/retry-needed; do not wait until filters are saved and then call the registry. The Message Drafting handoff must be lean. Do not paste copied row counts, brief hashes, review-batch hashes, full reviewBatchRowIds, broad row data, or local debug artifacts into the spawn prompt. Local markdown/json files are not normal-path inputs. The filter-choice question is the first post-import user gate; do not load post-lead registries or filter references before it. Message drafting starts after the filter-choice answer, must load get_subskill_prompt({ subskillName: "generate-messages" }), and must load every required message asset named by generate-messages Mode 0 through get_subskill_asset before drafting. Reference Asset Loading means loading the required pre-draft reference pack before drafting; return blocked/retry-needed if required assets cannot be loaded; load ai-tells.md because it is never optional. The branch or parent-thread fallback loads the full generate-messages prompt and every referenced asset through get_subskill_asset. After generating/revising the candidate and before returning ready, must load get_subskill_prompt({ subskillName: "create-campaign-v2-validation" }) as the final internal validation gate, must read live campaign table state through scoped MCP/product tools, and must reject mismatched selectedLeadListId/workflowTableId/campaign/workspace input. Do not block when filters were chosen but leadScoringRubrics are not yet visible in the branch read; the parent owns save_rubrics and filter approval in parallel, so Message Drafting should return status ready with basisStatus usable_initial when campaign/list/table identity and the non-empty execution slice match. Do not use any alternate, local-artifact, or examples-only message prompt. User copy feedback, message QA, or rewrite requests before approve-message must be routed back to Message Drafting with the current recommendation, lean campaign/table basis, and latest user text; the parent must not rewrite or QA the template from memory and must not call update_campaign_brief before approve-message. The worker validates internally and returns only templateRecommendation, tokenFillRules, renderedGoodSample, status, approveOrReviseRecommendation, validationStatus, outputAt, outputHash, and blocked/retry detail. Do not render renderedFallbackSample, risk notes, or a qaReceipt on the normal happy path. On the filter path, save_rubrics keeps the browser on Filter Rules after save_rubrics so the user can approve the saved criteria; after saved-filter approval, move to Filter Leads with currentStep=apply-icp-rubric whether Message Drafting is ready or still running. Wait there for message approval. Enrichment, filtering, Generate Message cells, sender setup, sequence attach, and launch wait for template approval on the Use Template path. On the skip path, move to Messages/message review after Message Drafting has started or is ready and wait for message approval before enrichment or Settings. Do not render message review from checklist or shortcut instructions; message review requires a messageDraftRecommendation whose basis proves the generate-messages prompt, required message assets, and validation gate ran for the current campaign/table execution slice. Do not automatically rerun Message Drafting after filters/enrichment finish; show the initial draft by default and offer an enriched rewrite only with explicit user opt-in. Handoff and recommendation output are Markdown with labeled fields, not raw JSON.',
|
|
376
|
-
prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, post the full sender/campaign/action approval packet in normal chat as Markdown first, then ask request_user_input/AskUserQuestion with exactly Accept and Decline and a compact body that refers back to the posted packet; do not duplicate the campaign table or full operator packet inside the structured question. The chat packet must show workspace, sender scope, a campaign-by-campaign table, exact ids/caps/dates, side effects, forbidden actions, and stop condition before mutation. Default --yolo target is the scheduler-forward 48-hour target window: sender-local send days whose configured sending windows overlap the rolling target window, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus projected coverage (actual sent plus future scheduler-owned scheduled sends) and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting actual sent coverage, future scheduled rows, and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a target-window saturation ledger per selected sender with selected send days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected coverage, ready-to-schedule buffer, remaining projected gap, paid-InMail threshold feasibility, and the next MCP primitive. The structured packet lives in target.senderRefillPlans[] with target.eligibleSenderLedger, campaignRanking.options, sourcePlan, nextActions, manualAlternates, and target.globalActionQueue; preserve Need to prepare, Goal, Already sent, Scheduled, Ready and waiting to be scheduled, and Still need labels. In --yolo, execute exactly one globally ranked primitive from the post-refresh target.globalActionQueue[0], then rerun get_refill_target_plan before choosing another action. Refill action ladder: approve generated rows only when an explicit bounded approval gate exists, process all existing same-campaign unenriched/unprepared rows in bounded batches before any source work, then copy bounded net-new rows from the selected source (selectedLeadListId, provider, and source fingerprint preserved), then use provider-aligned source-more. A new source or provider switch changes the reply-rate baseline and is a manual alternate, not a --yolo side effect. The refill_sends MCP command maintains a run-local refreshedPaidInmailSenderIds set: if the first target plan contains refresh_paid_inmail_credits for stale/missing paid-InMail facts, refill_sends refreshes each selected paid-InMail sender at most once, reruns get_refill_target_plan, and returns autoPaidInmailRefresh plus the post-refresh targetPlan before the operator chooses prep/source-copy/bounded-approval/read-only wait. Do not present paid-credit refresh as the next operator action after refill_sends has returned a post-refresh targetPlan. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/source-copy/bounded-approval/read-only wait result, recompute the target-window saturation ledger, and keep going until projected coverage (sent + scheduled) fills the scheduler-forward target window or a concrete non-scheduler blocker is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the projected gap but scheduled cells do not, report loaded, awaiting scheduler and run a persistent read-only scheduler wait/reread loop and keep the run open while awaiting_scheduler_after_ready_buffer is the only remaining state. Paid-InMail threshold changes and connection-campaign creation are explicit continuation options, never --yolo side effects. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet; do not return final completion for scheduler wait unless Christian explicitly asks for status or stops the run. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers and paid-InMail threshold blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. Trust schedulerGate.sendable and scheduler blockers over raw unipileAccountStatus labels alone. For long-running prep use compact prep status checks, reread target plans after prep or cancel, avoid huge parallel target-plan reads when output is large, and if prepared/ready rows grow but sender-level projected coverage does not move after one bounded settle loop, pivot to compact prep status or a scheduler-proven lane instead of waiting on campaign-level ready counts. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor contribute to projected coverage, and never call them complete unless a final re-read proves projected coverage fills the scheduler-forward target window. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if projected coverage does not fill the horizon, keep polling when ready buffer covers the gap and report only interim prepared/approved/ready - awaiting scheduler status if Christian asks. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
|
|
376
|
+
prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, post the full sender/campaign/action approval packet in normal chat as Markdown first, then ask request_user_input/AskUserQuestion with exactly Accept and Decline and a compact body that refers back to the posted packet; do not duplicate the campaign table or full operator packet inside the structured question. The chat packet must show workspace, sender scope, a campaign-by-campaign table, exact ids/caps/dates, side effects, forbidden actions, and stop condition before mutation. Default --yolo target is the scheduler-forward 48-hour target window: sender-local send days whose configured sending windows overlap the rolling target window, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus projected coverage (actual sent plus future scheduler-owned scheduled sends) and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting actual sent coverage, future scheduled rows, and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a target-window saturation ledger per selected sender with selected send days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected coverage, ready-to-schedule buffer, remaining projected gap, paid-InMail threshold feasibility, and the next MCP primitive. The structured packet lives in target.senderRefillPlans[] with target.eligibleSenderLedger, campaignRanking.options, sourcePlan, nextActions, manualAlternates, and target.globalActionQueue; preserve Need to prepare, Goal, Already sent, Scheduled, Ready and waiting to be scheduled, and Still need labels. In --yolo, execute exactly one globally ranked primitive from the post-refresh target.globalActionQueue[0], then rerun get_refill_target_plan before choosing another action. The refill_sends MCP command maintains a run-local refreshedPaidInmailSenderIds set: if the first target plan contains refresh_paid_inmail_credits for stale/missing paid-InMail facts, refill_sends refreshes each selected paid-InMail sender at most once, reruns get_refill_target_plan to obtain the post-refresh targetPlan, then may apply the first supported yolo-eligible global primitive and return autoPaidInmailRefresh, yoloExecution, and final targetPlan evidence. Do not present paid-credit refresh as the next operator action after refill_sends has returned autoPaidInmailRefresh; inspect yoloExecution and continue from the final targetPlan when it applied an action. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/start result, recompute the target-window saturation ledger, and keep going until projected coverage (sent + scheduled) fills the scheduler-forward target window or a concrete non-scheduler blocker is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the projected gap but scheduled cells do not, report loaded, awaiting scheduler and run a persistent read-only scheduler wait/reread loop and keep the run open while awaiting_scheduler_after_ready_buffer is the only remaining state. Paid-InMail threshold changes and connection-campaign creation are explicit continuation options, never --yolo side effects. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet; do not return final completion for scheduler wait unless Christian explicitly asks for status or stops the run. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers and paid-InMail threshold blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. Trust schedulerGate.sendable and scheduler blockers over raw unipileAccountStatus labels alone. For long-running prep use compact prep status checks, reread target plans after prep or cancel, avoid huge parallel target-plan reads when output is large, and if prepared/ready rows grow but sender-level projected coverage does not move after one bounded settle loop, pivot to compact prep status or a scheduler-proven lane instead of waiting on campaign-level ready counts. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor contribute to projected coverage, and never call them complete unless a final re-read proves projected coverage fills the scheduler-forward target window. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if projected coverage does not fill the horizon, keep polling when ready buffer covers the gap and report only interim prepared/approved/ready - awaiting scheduler status if Christian asks. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
|
|
377
377
|
},
|
|
378
378
|
};
|
|
379
379
|
}
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
type RefillSendsIntent = "plain" | "active" | "evergreen";
|
|
2
2
|
type RefillSendsApprovalMode = "approve" | "mark_ready";
|
|
3
3
|
type RefillSendsExecutionMode = "manual" | "scheduled" | "yolo";
|
|
4
|
+
type RefillSendsRowSelector = {
|
|
5
|
+
type: "reviewBatch";
|
|
6
|
+
basisHash?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
} | {
|
|
9
|
+
type: "rowIds";
|
|
10
|
+
rowIds: string[];
|
|
11
|
+
} | {
|
|
12
|
+
type: "needsEnrichment";
|
|
13
|
+
limit?: number;
|
|
14
|
+
} | {
|
|
15
|
+
type: "needsApproval";
|
|
16
|
+
limit?: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: "passedRows";
|
|
19
|
+
limit?: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: "needsGeneratedMessage";
|
|
22
|
+
limit?: number;
|
|
23
|
+
} | {
|
|
24
|
+
type: "staleGeneratedMessages";
|
|
25
|
+
limit?: number;
|
|
26
|
+
};
|
|
4
27
|
type RefillSendsCommandInput = {
|
|
5
28
|
yolo?: boolean;
|
|
6
29
|
executionMode?: RefillSendsExecutionMode;
|
|
@@ -182,15 +205,6 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
|
|
|
182
205
|
workspaceId?: undefined;
|
|
183
206
|
workspaceResolution?: undefined;
|
|
184
207
|
};
|
|
185
|
-
yoloExecution: {
|
|
186
|
-
enabled: false;
|
|
187
|
-
status: "not_run_without_yolo";
|
|
188
|
-
selectedAction: null;
|
|
189
|
-
targetPlanReread: false;
|
|
190
|
-
result?: undefined;
|
|
191
|
-
refusalReason?: undefined;
|
|
192
|
-
postActionFirstAction?: undefined;
|
|
193
|
-
};
|
|
194
208
|
command: string;
|
|
195
209
|
tool: string;
|
|
196
210
|
promptName: string;
|
|
@@ -260,23 +274,19 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
|
|
|
260
274
|
};
|
|
261
275
|
} | {
|
|
262
276
|
targetPlan: unknown;
|
|
277
|
+
targetPlanBeforeYoloAction: unknown;
|
|
263
278
|
targetPlanBeforePaidRefresh: unknown;
|
|
264
|
-
targetPlanBeforeYoloPrimitive: unknown;
|
|
265
279
|
autoPaidInmailRefresh: {
|
|
266
280
|
enabled: boolean;
|
|
267
281
|
status: string;
|
|
268
282
|
refreshedPaidInmailSenderIds: string[];
|
|
269
283
|
failedPaidInmailRefreshes: {
|
|
270
284
|
senderId: string;
|
|
271
|
-
attempts?: number;
|
|
272
285
|
error: string;
|
|
273
|
-
errors?: string[];
|
|
274
286
|
}[];
|
|
275
287
|
refreshReceipts: {
|
|
276
288
|
senderId: string;
|
|
277
289
|
actionKey: string | null;
|
|
278
|
-
attempts: number;
|
|
279
|
-
retryErrors: string[];
|
|
280
290
|
receipt: import("./senders.js").RefreshPaidInmailCreditsResponse;
|
|
281
291
|
}[];
|
|
282
292
|
attemptedSenderIds: string[];
|
|
@@ -286,21 +296,61 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
|
|
|
286
296
|
note: string;
|
|
287
297
|
};
|
|
288
298
|
yoloExecution: {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
299
|
+
status: string;
|
|
300
|
+
applied: boolean;
|
|
301
|
+
note: string;
|
|
302
|
+
action?: undefined;
|
|
303
|
+
toolName?: undefined;
|
|
304
|
+
input?: undefined;
|
|
305
|
+
startedAt?: undefined;
|
|
306
|
+
endedAt?: undefined;
|
|
307
|
+
startReceipt?: undefined;
|
|
308
|
+
waitReceipt?: undefined;
|
|
309
|
+
enabled: boolean;
|
|
310
|
+
workspaceId: string | null;
|
|
311
|
+
workspaceResolution: string;
|
|
312
|
+
targetPlanRereadAfterAction: boolean;
|
|
296
313
|
} | {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
314
|
+
status: string;
|
|
315
|
+
applied: boolean;
|
|
316
|
+
action: Record<string, unknown>;
|
|
317
|
+
note: string;
|
|
318
|
+
toolName?: undefined;
|
|
319
|
+
input?: undefined;
|
|
320
|
+
startedAt?: undefined;
|
|
321
|
+
endedAt?: undefined;
|
|
322
|
+
startReceipt?: undefined;
|
|
323
|
+
waitReceipt?: undefined;
|
|
324
|
+
enabled: boolean;
|
|
325
|
+
workspaceId: string | null;
|
|
326
|
+
workspaceResolution: string;
|
|
327
|
+
targetPlanRereadAfterAction: boolean;
|
|
328
|
+
} | {
|
|
329
|
+
status: string;
|
|
330
|
+
applied: boolean;
|
|
331
|
+
action: Record<string, unknown>;
|
|
332
|
+
toolName: string;
|
|
333
|
+
input: {
|
|
334
|
+
workspaceId?: string | undefined;
|
|
335
|
+
rowSelector?: RefillSendsRowSelector | undefined;
|
|
336
|
+
approvalMode?: RefillSendsApprovalMode | undefined;
|
|
337
|
+
targetPreparedMessages?: number | undefined;
|
|
338
|
+
tableId?: string | undefined;
|
|
339
|
+
campaignId: string;
|
|
340
|
+
};
|
|
341
|
+
startedAt: string;
|
|
342
|
+
endedAt: string;
|
|
343
|
+
startReceipt: unknown;
|
|
344
|
+
waitReceipt: {
|
|
345
|
+
waited: boolean;
|
|
346
|
+
timedOut: boolean;
|
|
347
|
+
receipt: unknown;
|
|
348
|
+
};
|
|
349
|
+
note?: undefined;
|
|
350
|
+
enabled: boolean;
|
|
351
|
+
workspaceId: string | null;
|
|
352
|
+
workspaceResolution: string;
|
|
353
|
+
targetPlanRereadAfterAction: boolean;
|
|
304
354
|
};
|
|
305
355
|
command: string;
|
|
306
356
|
tool: string;
|