@sellable/mcp 0.1.550 → 0.1.551
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/agents/registry.json +2 -2
- package/dist/server.js +1 -1
- package/dist/tools/campaigns.d.ts +57 -8
- package/dist/tools/campaigns.js +28 -3
- package/dist/tools/leads.d.ts +22 -0
- package/dist/tools/leads.js +6 -1
- package/dist/tools/model-quality.js +6 -4
- package/dist/tools/prompts.js +6 -6
- package/dist/tools/registry.d.ts +88 -9
- package/dist/tools/sequencer.d.ts +16 -3
- package/dist/tools/sequencer.js +72 -36
- package/dist/tools/setup-evergreen-campaigns.d.ts +21 -0
- package/dist/tools/setup-evergreen-campaigns.js +23 -4
- package/package.json +1 -1
- package/skills/create-campaign/SKILL.md +3 -3
- package/skills/create-campaign-v2/SKILL.md +1 -1
- package/skills/create-campaign-v2/references/tier-routing-matrix.md +5 -0
- package/skills/create-evergreen-campaigns/SKILL.md +73 -24
- package/skills/refill-sends/SKILL.md +5 -0
- package/skills/refill-sends-v2/SKILL.md +5 -0
- package/skills/refill-sends-v2-workflow/SKILL.md +7 -0
- package/skills/refill-sends-v2-workflow/core/flow.v1.json +1 -0
package/dist/tools/registry.d.ts
CHANGED
|
@@ -1094,12 +1094,55 @@ export declare const allTools: ({
|
|
|
1094
1094
|
type: string;
|
|
1095
1095
|
description: string;
|
|
1096
1096
|
};
|
|
1097
|
+
name?: undefined;
|
|
1098
|
+
limit?: undefined;
|
|
1099
|
+
tableId?: undefined;
|
|
1100
|
+
leadLimit?: undefined;
|
|
1101
|
+
page?: undefined;
|
|
1102
|
+
filters?: undefined;
|
|
1103
|
+
clientProspectId?: undefined;
|
|
1104
|
+
senderLinkedinUrl?: undefined;
|
|
1105
|
+
offerPositioning?: undefined;
|
|
1106
|
+
campaignBrief?: undefined;
|
|
1107
|
+
messageGenerationMode?: undefined;
|
|
1108
|
+
currentStep?: undefined;
|
|
1109
|
+
watchNarration?: undefined;
|
|
1110
|
+
leadSourceType?: undefined;
|
|
1111
|
+
leadSourceProvider?: undefined;
|
|
1112
|
+
selectedLeadListId?: undefined;
|
|
1113
|
+
senderIds?: undefined;
|
|
1114
|
+
currentStepTransition?: undefined;
|
|
1115
|
+
clearCurrentStepIfMatches?: undefined;
|
|
1116
|
+
interactionMode?: undefined;
|
|
1117
|
+
enableICPFilters?: undefined;
|
|
1118
|
+
useMessagingTemplate?: undefined;
|
|
1119
|
+
rubric?: undefined;
|
|
1120
|
+
flowVersion?: undefined;
|
|
1121
|
+
workspaceId?: undefined;
|
|
1122
|
+
};
|
|
1123
|
+
required: string[];
|
|
1124
|
+
additionalProperties: boolean;
|
|
1125
|
+
};
|
|
1126
|
+
} | {
|
|
1127
|
+
name: string;
|
|
1128
|
+
description: string;
|
|
1129
|
+
inputSchema: {
|
|
1130
|
+
type: string;
|
|
1131
|
+
properties: {
|
|
1132
|
+
campaignId: {
|
|
1133
|
+
type: string;
|
|
1134
|
+
description: string;
|
|
1135
|
+
};
|
|
1136
|
+
name: {
|
|
1137
|
+
type: string;
|
|
1138
|
+
maxLength: number;
|
|
1139
|
+
description: string;
|
|
1140
|
+
};
|
|
1097
1141
|
limit?: undefined;
|
|
1098
1142
|
tableId?: undefined;
|
|
1099
1143
|
leadLimit?: undefined;
|
|
1100
1144
|
page?: undefined;
|
|
1101
1145
|
filters?: undefined;
|
|
1102
|
-
name?: undefined;
|
|
1103
1146
|
clientProspectId?: undefined;
|
|
1104
1147
|
senderLinkedinUrl?: undefined;
|
|
1105
1148
|
offerPositioning?: undefined;
|
|
@@ -1134,11 +1177,11 @@ export declare const allTools: ({
|
|
|
1134
1177
|
description: string;
|
|
1135
1178
|
};
|
|
1136
1179
|
campaignId?: undefined;
|
|
1180
|
+
name?: undefined;
|
|
1137
1181
|
tableId?: undefined;
|
|
1138
1182
|
leadLimit?: undefined;
|
|
1139
1183
|
page?: undefined;
|
|
1140
1184
|
filters?: undefined;
|
|
1141
|
-
name?: undefined;
|
|
1142
1185
|
clientProspectId?: undefined;
|
|
1143
1186
|
senderLinkedinUrl?: undefined;
|
|
1144
1187
|
offerPositioning?: undefined;
|
|
@@ -1172,12 +1215,12 @@ export declare const allTools: ({
|
|
|
1172
1215
|
type: string;
|
|
1173
1216
|
description: string;
|
|
1174
1217
|
};
|
|
1218
|
+
name?: undefined;
|
|
1175
1219
|
limit?: undefined;
|
|
1176
1220
|
tableId?: undefined;
|
|
1177
1221
|
leadLimit?: undefined;
|
|
1178
1222
|
page?: undefined;
|
|
1179
1223
|
filters?: undefined;
|
|
1180
|
-
name?: undefined;
|
|
1181
1224
|
clientProspectId?: undefined;
|
|
1182
1225
|
senderLinkedinUrl?: undefined;
|
|
1183
1226
|
offerPositioning?: undefined;
|
|
@@ -1258,8 +1301,8 @@ export declare const allTools: ({
|
|
|
1258
1301
|
additionalProperties: boolean;
|
|
1259
1302
|
};
|
|
1260
1303
|
};
|
|
1261
|
-
limit?: undefined;
|
|
1262
1304
|
name?: undefined;
|
|
1305
|
+
limit?: undefined;
|
|
1263
1306
|
clientProspectId?: undefined;
|
|
1264
1307
|
senderLinkedinUrl?: undefined;
|
|
1265
1308
|
offerPositioning?: undefined;
|
|
@@ -1296,6 +1339,7 @@ export declare const allTools: ({
|
|
|
1296
1339
|
name: {
|
|
1297
1340
|
type: string;
|
|
1298
1341
|
description: string;
|
|
1342
|
+
maxLength?: undefined;
|
|
1299
1343
|
};
|
|
1300
1344
|
clientProspectId: {
|
|
1301
1345
|
type: string;
|
|
@@ -1488,6 +1532,11 @@ export declare const allTools: ({
|
|
|
1488
1532
|
type: string;
|
|
1489
1533
|
description: string;
|
|
1490
1534
|
};
|
|
1535
|
+
name: {
|
|
1536
|
+
type: string;
|
|
1537
|
+
maxLength: number;
|
|
1538
|
+
description: string;
|
|
1539
|
+
};
|
|
1491
1540
|
offerPositioning: {
|
|
1492
1541
|
type: string;
|
|
1493
1542
|
description: string;
|
|
@@ -1675,7 +1724,6 @@ export declare const allTools: ({
|
|
|
1675
1724
|
leadLimit?: undefined;
|
|
1676
1725
|
page?: undefined;
|
|
1677
1726
|
filters?: undefined;
|
|
1678
|
-
name?: undefined;
|
|
1679
1727
|
clientProspectId?: undefined;
|
|
1680
1728
|
senderLinkedinUrl?: undefined;
|
|
1681
1729
|
messageGenerationMode?: undefined;
|
|
@@ -1698,12 +1746,12 @@ export declare const allTools: ({
|
|
|
1698
1746
|
type: string;
|
|
1699
1747
|
description: string;
|
|
1700
1748
|
};
|
|
1749
|
+
name?: undefined;
|
|
1701
1750
|
limit?: undefined;
|
|
1702
1751
|
tableId?: undefined;
|
|
1703
1752
|
leadLimit?: undefined;
|
|
1704
1753
|
page?: undefined;
|
|
1705
1754
|
filters?: undefined;
|
|
1706
|
-
name?: undefined;
|
|
1707
1755
|
clientProspectId?: undefined;
|
|
1708
1756
|
senderLinkedinUrl?: undefined;
|
|
1709
1757
|
offerPositioning?: undefined;
|
|
@@ -1740,12 +1788,12 @@ export declare const allTools: ({
|
|
|
1740
1788
|
type: string;
|
|
1741
1789
|
description: string;
|
|
1742
1790
|
};
|
|
1791
|
+
name?: undefined;
|
|
1743
1792
|
limit?: undefined;
|
|
1744
1793
|
tableId?: undefined;
|
|
1745
1794
|
leadLimit?: undefined;
|
|
1746
1795
|
page?: undefined;
|
|
1747
1796
|
filters?: undefined;
|
|
1748
|
-
name?: undefined;
|
|
1749
1797
|
clientProspectId?: undefined;
|
|
1750
1798
|
senderLinkedinUrl?: undefined;
|
|
1751
1799
|
offerPositioning?: undefined;
|
|
@@ -3186,6 +3234,7 @@ export declare const allTools: ({
|
|
|
3186
3234
|
sourceRowIds?: undefined;
|
|
3187
3235
|
sourceRowLimit?: undefined;
|
|
3188
3236
|
allowPartialSourceList?: undefined;
|
|
3237
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3189
3238
|
includeRawImportResult?: undefined;
|
|
3190
3239
|
selections?: undefined;
|
|
3191
3240
|
selectionMode?: undefined;
|
|
@@ -3383,6 +3432,7 @@ export declare const allTools: ({
|
|
|
3383
3432
|
sourceRowIds?: undefined;
|
|
3384
3433
|
sourceRowLimit?: undefined;
|
|
3385
3434
|
allowPartialSourceList?: undefined;
|
|
3435
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3386
3436
|
includeRawImportResult?: undefined;
|
|
3387
3437
|
selections?: undefined;
|
|
3388
3438
|
selectionMode?: undefined;
|
|
@@ -3479,6 +3529,7 @@ export declare const allTools: ({
|
|
|
3479
3529
|
sourceRowIds?: undefined;
|
|
3480
3530
|
sourceRowLimit?: undefined;
|
|
3481
3531
|
allowPartialSourceList?: undefined;
|
|
3532
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3482
3533
|
includeRawImportResult?: undefined;
|
|
3483
3534
|
selections?: undefined;
|
|
3484
3535
|
selectionMode?: undefined;
|
|
@@ -3647,6 +3698,7 @@ export declare const allTools: ({
|
|
|
3647
3698
|
sourceRowIds?: undefined;
|
|
3648
3699
|
sourceRowLimit?: undefined;
|
|
3649
3700
|
allowPartialSourceList?: undefined;
|
|
3701
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3650
3702
|
includeRawImportResult?: undefined;
|
|
3651
3703
|
selections?: undefined;
|
|
3652
3704
|
selectionMode?: undefined;
|
|
@@ -3757,6 +3809,7 @@ export declare const allTools: ({
|
|
|
3757
3809
|
sourceRowIds?: undefined;
|
|
3758
3810
|
sourceRowLimit?: undefined;
|
|
3759
3811
|
allowPartialSourceList?: undefined;
|
|
3812
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3760
3813
|
includeRawImportResult?: undefined;
|
|
3761
3814
|
selections?: undefined;
|
|
3762
3815
|
selectionMode?: undefined;
|
|
@@ -3876,6 +3929,7 @@ export declare const allTools: ({
|
|
|
3876
3929
|
sourceRowIds?: undefined;
|
|
3877
3930
|
sourceRowLimit?: undefined;
|
|
3878
3931
|
allowPartialSourceList?: undefined;
|
|
3932
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3879
3933
|
includeRawImportResult?: undefined;
|
|
3880
3934
|
selections?: undefined;
|
|
3881
3935
|
selectionMode?: undefined;
|
|
@@ -3984,6 +4038,7 @@ export declare const allTools: ({
|
|
|
3984
4038
|
sourceRowIds?: undefined;
|
|
3985
4039
|
sourceRowLimit?: undefined;
|
|
3986
4040
|
allowPartialSourceList?: undefined;
|
|
4041
|
+
allowDifferentSourceLeadList?: undefined;
|
|
3987
4042
|
includeRawImportResult?: undefined;
|
|
3988
4043
|
selections?: undefined;
|
|
3989
4044
|
selectionMode?: undefined;
|
|
@@ -4097,6 +4152,7 @@ export declare const allTools: ({
|
|
|
4097
4152
|
sourceRowIds?: undefined;
|
|
4098
4153
|
sourceRowLimit?: undefined;
|
|
4099
4154
|
allowPartialSourceList?: undefined;
|
|
4155
|
+
allowDifferentSourceLeadList?: undefined;
|
|
4100
4156
|
includeRawImportResult?: undefined;
|
|
4101
4157
|
selections?: undefined;
|
|
4102
4158
|
selectionMode?: undefined;
|
|
@@ -4198,6 +4254,7 @@ export declare const allTools: ({
|
|
|
4198
4254
|
sourceRowIds?: undefined;
|
|
4199
4255
|
sourceRowLimit?: undefined;
|
|
4200
4256
|
allowPartialSourceList?: undefined;
|
|
4257
|
+
allowDifferentSourceLeadList?: undefined;
|
|
4201
4258
|
includeRawImportResult?: undefined;
|
|
4202
4259
|
selections?: undefined;
|
|
4203
4260
|
selectionMode?: undefined;
|
|
@@ -5091,6 +5148,7 @@ export declare const allTools: ({
|
|
|
5091
5148
|
sourceRowIds?: undefined;
|
|
5092
5149
|
sourceRowLimit?: undefined;
|
|
5093
5150
|
allowPartialSourceList?: undefined;
|
|
5151
|
+
allowDifferentSourceLeadList?: undefined;
|
|
5094
5152
|
includeRawImportResult?: undefined;
|
|
5095
5153
|
selections?: undefined;
|
|
5096
5154
|
selectionMode?: undefined;
|
|
@@ -5201,6 +5259,7 @@ export declare const allTools: ({
|
|
|
5201
5259
|
sourceRowIds?: undefined;
|
|
5202
5260
|
sourceRowLimit?: undefined;
|
|
5203
5261
|
allowPartialSourceList?: undefined;
|
|
5262
|
+
allowDifferentSourceLeadList?: undefined;
|
|
5204
5263
|
includeRawImportResult?: undefined;
|
|
5205
5264
|
selections?: undefined;
|
|
5206
5265
|
selectionMode?: undefined;
|
|
@@ -6252,6 +6311,7 @@ export declare const allTools: ({
|
|
|
6252
6311
|
sourceRowIds?: undefined;
|
|
6253
6312
|
sourceRowLimit?: undefined;
|
|
6254
6313
|
allowPartialSourceList?: undefined;
|
|
6314
|
+
allowDifferentSourceLeadList?: undefined;
|
|
6255
6315
|
includeRawImportResult?: undefined;
|
|
6256
6316
|
selections?: undefined;
|
|
6257
6317
|
selectionMode?: undefined;
|
|
@@ -6409,6 +6469,7 @@ export declare const allTools: ({
|
|
|
6409
6469
|
sourceRowIds?: undefined;
|
|
6410
6470
|
sourceRowLimit?: undefined;
|
|
6411
6471
|
allowPartialSourceList?: undefined;
|
|
6472
|
+
allowDifferentSourceLeadList?: undefined;
|
|
6412
6473
|
includeRawImportResult?: undefined;
|
|
6413
6474
|
selections?: undefined;
|
|
6414
6475
|
selectionMode?: undefined;
|
|
@@ -6556,6 +6617,7 @@ export declare const allTools: ({
|
|
|
6556
6617
|
sourceRowIds?: undefined;
|
|
6557
6618
|
sourceRowLimit?: undefined;
|
|
6558
6619
|
allowPartialSourceList?: undefined;
|
|
6620
|
+
allowDifferentSourceLeadList?: undefined;
|
|
6559
6621
|
includeRawImportResult?: undefined;
|
|
6560
6622
|
selections?: undefined;
|
|
6561
6623
|
selectionMode?: undefined;
|
|
@@ -6658,6 +6720,7 @@ export declare const allTools: ({
|
|
|
6658
6720
|
sourceRowIds?: undefined;
|
|
6659
6721
|
sourceRowLimit?: undefined;
|
|
6660
6722
|
allowPartialSourceList?: undefined;
|
|
6723
|
+
allowDifferentSourceLeadList?: undefined;
|
|
6661
6724
|
includeRawImportResult?: undefined;
|
|
6662
6725
|
selections?: undefined;
|
|
6663
6726
|
selectionMode?: undefined;
|
|
@@ -6722,6 +6785,10 @@ export declare const allTools: ({
|
|
|
6722
6785
|
type: string;
|
|
6723
6786
|
description: string;
|
|
6724
6787
|
};
|
|
6788
|
+
allowDifferentSourceLeadList: {
|
|
6789
|
+
type: string;
|
|
6790
|
+
description: string;
|
|
6791
|
+
};
|
|
6725
6792
|
confirmed: {
|
|
6726
6793
|
type: string;
|
|
6727
6794
|
description: string;
|
|
@@ -6931,6 +6998,7 @@ export declare const allTools: ({
|
|
|
6931
6998
|
sourceRowIds?: undefined;
|
|
6932
6999
|
sourceRowLimit?: undefined;
|
|
6933
7000
|
allowPartialSourceList?: undefined;
|
|
7001
|
+
allowDifferentSourceLeadList?: undefined;
|
|
6934
7002
|
includeRawImportResult?: undefined;
|
|
6935
7003
|
};
|
|
6936
7004
|
required: string[];
|
|
@@ -7031,6 +7099,7 @@ export declare const allTools: ({
|
|
|
7031
7099
|
sourceRowIds?: undefined;
|
|
7032
7100
|
sourceRowLimit?: undefined;
|
|
7033
7101
|
allowPartialSourceList?: undefined;
|
|
7102
|
+
allowDifferentSourceLeadList?: undefined;
|
|
7034
7103
|
includeRawImportResult?: undefined;
|
|
7035
7104
|
selections?: undefined;
|
|
7036
7105
|
selectionMode?: undefined;
|
|
@@ -7950,9 +8019,10 @@ export declare const allTools: ({
|
|
|
7950
8019
|
};
|
|
7951
8020
|
tableId?: undefined;
|
|
7952
8021
|
template?: undefined;
|
|
8022
|
+
templateRef?: undefined;
|
|
7953
8023
|
confirmed?: undefined;
|
|
7954
|
-
campaignId?: undefined;
|
|
7955
8024
|
currentStep?: undefined;
|
|
8025
|
+
campaignId?: undefined;
|
|
7956
8026
|
};
|
|
7957
8027
|
required: string[];
|
|
7958
8028
|
};
|
|
@@ -7970,17 +8040,25 @@ export declare const allTools: ({
|
|
|
7970
8040
|
type: string;
|
|
7971
8041
|
description: string;
|
|
7972
8042
|
};
|
|
8043
|
+
templateRef: {
|
|
8044
|
+
type: string;
|
|
8045
|
+
enum: string[];
|
|
8046
|
+
description: string;
|
|
8047
|
+
};
|
|
7973
8048
|
confirmed: {
|
|
7974
8049
|
type: string;
|
|
7975
8050
|
description: string;
|
|
7976
8051
|
};
|
|
8052
|
+
currentStep: {
|
|
8053
|
+
type: string;
|
|
8054
|
+
description: string;
|
|
8055
|
+
};
|
|
7977
8056
|
name?: undefined;
|
|
7978
8057
|
senderId?: undefined;
|
|
7979
8058
|
clientProspectId?: undefined;
|
|
7980
8059
|
senderLinkedinUrl?: undefined;
|
|
7981
8060
|
sequenceActions?: undefined;
|
|
7982
8061
|
campaignId?: undefined;
|
|
7983
|
-
currentStep?: undefined;
|
|
7984
8062
|
};
|
|
7985
8063
|
required: string[];
|
|
7986
8064
|
};
|
|
@@ -8009,6 +8087,7 @@ export declare const allTools: ({
|
|
|
8009
8087
|
sequenceActions?: undefined;
|
|
8010
8088
|
tableId?: undefined;
|
|
8011
8089
|
template?: undefined;
|
|
8090
|
+
templateRef?: undefined;
|
|
8012
8091
|
};
|
|
8013
8092
|
required: string[];
|
|
8014
8093
|
};
|
|
@@ -19,12 +19,15 @@ export type CreateWorkflowTableResponse = {
|
|
|
19
19
|
};
|
|
20
20
|
export type AttachSequenceInput = {
|
|
21
21
|
tableId: string;
|
|
22
|
-
template
|
|
22
|
+
template?: Record<string, unknown>;
|
|
23
|
+
templateRef?: "connection_only";
|
|
23
24
|
confirmed?: boolean;
|
|
25
|
+
currentStep?: string;
|
|
24
26
|
};
|
|
25
27
|
export type AttachSequenceResponse = {
|
|
26
28
|
success: boolean;
|
|
27
29
|
version: number;
|
|
30
|
+
currentStep?: string;
|
|
28
31
|
_perf?: Record<string, number>;
|
|
29
32
|
};
|
|
30
33
|
export type AttachRecommendedSequenceInput = {
|
|
@@ -74,9 +77,10 @@ export declare const sequencerToolDefinitions: ({
|
|
|
74
77
|
};
|
|
75
78
|
tableId?: undefined;
|
|
76
79
|
template?: undefined;
|
|
80
|
+
templateRef?: undefined;
|
|
77
81
|
confirmed?: undefined;
|
|
78
|
-
campaignId?: undefined;
|
|
79
82
|
currentStep?: undefined;
|
|
83
|
+
campaignId?: undefined;
|
|
80
84
|
};
|
|
81
85
|
required: string[];
|
|
82
86
|
};
|
|
@@ -94,17 +98,25 @@ export declare const sequencerToolDefinitions: ({
|
|
|
94
98
|
type: string;
|
|
95
99
|
description: string;
|
|
96
100
|
};
|
|
101
|
+
templateRef: {
|
|
102
|
+
type: string;
|
|
103
|
+
enum: string[];
|
|
104
|
+
description: string;
|
|
105
|
+
};
|
|
97
106
|
confirmed: {
|
|
98
107
|
type: string;
|
|
99
108
|
description: string;
|
|
100
109
|
};
|
|
110
|
+
currentStep: {
|
|
111
|
+
type: string;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
101
114
|
name?: undefined;
|
|
102
115
|
senderId?: undefined;
|
|
103
116
|
clientProspectId?: undefined;
|
|
104
117
|
senderLinkedinUrl?: undefined;
|
|
105
118
|
sequenceActions?: undefined;
|
|
106
119
|
campaignId?: undefined;
|
|
107
|
-
currentStep?: undefined;
|
|
108
120
|
};
|
|
109
121
|
required: string[];
|
|
110
122
|
};
|
|
@@ -133,6 +145,7 @@ export declare const sequencerToolDefinitions: ({
|
|
|
133
145
|
sequenceActions?: undefined;
|
|
134
146
|
tableId?: undefined;
|
|
135
147
|
template?: undefined;
|
|
148
|
+
templateRef?: undefined;
|
|
136
149
|
};
|
|
137
150
|
required: string[];
|
|
138
151
|
};
|
package/dist/tools/sequencer.js
CHANGED
|
@@ -53,12 +53,21 @@ export const sequencerToolDefinitions = [
|
|
|
53
53
|
type: "object",
|
|
54
54
|
description: "Sequence template object with version, entryNodeId, nodes, and branches",
|
|
55
55
|
},
|
|
56
|
+
templateRef: {
|
|
57
|
+
type: "string",
|
|
58
|
+
enum: ["connection_only"],
|
|
59
|
+
description: "Optional backend-owned known template reference. Use connection_only for invite-only evergreen setup without duplicating app template JSON in MCP.",
|
|
60
|
+
},
|
|
56
61
|
confirmed: {
|
|
57
62
|
type: "boolean",
|
|
58
63
|
description: "Set true to overwrite existing sequence columns if the table already has them",
|
|
59
64
|
},
|
|
65
|
+
currentStep: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "Optional CampaignOffer currentStep to persist atomically with the sequence attach, usually 'send' for connection-only evergreen setup after the invite-only sequence is bound.",
|
|
68
|
+
},
|
|
60
69
|
},
|
|
61
|
-
required: ["tableId"
|
|
70
|
+
required: ["tableId"],
|
|
62
71
|
},
|
|
63
72
|
},
|
|
64
73
|
{
|
|
@@ -107,56 +116,57 @@ export async function attachSequence(input) {
|
|
|
107
116
|
const api = getApi();
|
|
108
117
|
const template = input.template;
|
|
109
118
|
const preValidationErrors = [];
|
|
110
|
-
if (
|
|
111
|
-
|
|
119
|
+
if (input.template && input.templateRef) {
|
|
120
|
+
throw new Error("INVALID_TEMPLATE: Pass either template or templateRef, not both.");
|
|
112
121
|
}
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
preValidationErrors.push("Template must have an 'entryNodeId' string.");
|
|
122
|
+
if (!input.template && !input.templateRef) {
|
|
123
|
+
throw new Error("INVALID_TEMPLATE: Pass template or templateRef.");
|
|
116
124
|
}
|
|
117
|
-
if (template
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
typeof template.entryNodeId
|
|
122
|
-
|
|
123
|
-
.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
.
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
if (input.template) {
|
|
126
|
+
if (!Array.isArray(template.nodes) || template.nodes.length === 0) {
|
|
127
|
+
preValidationErrors.push("Template must have a non-empty 'nodes' array.");
|
|
128
|
+
}
|
|
129
|
+
if (typeof template.entryNodeId !== "string" ||
|
|
130
|
+
template.entryNodeId.trim().length === 0) {
|
|
131
|
+
preValidationErrors.push("Template must have an 'entryNodeId' string.");
|
|
132
|
+
}
|
|
133
|
+
if (template.version !== 2) {
|
|
134
|
+
preValidationErrors.push("Template version must be 2.");
|
|
135
|
+
}
|
|
136
|
+
if (Array.isArray(template.nodes) &&
|
|
137
|
+
typeof template.entryNodeId === "string") {
|
|
138
|
+
const nodeIds = new Set(template.nodes
|
|
139
|
+
.map((node) => node && typeof node === "object"
|
|
140
|
+
? node.id
|
|
141
|
+
: null)
|
|
142
|
+
.filter((nodeId) => typeof nodeId === "string"));
|
|
143
|
+
if (template.entryNodeId && !nodeIds.has(template.entryNodeId)) {
|
|
144
|
+
preValidationErrors.push(`entryNodeId "${template.entryNodeId}" does not match any node id. Available node ids: ${Array.from(nodeIds).join(", ")}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (preValidationErrors.length > 0) {
|
|
148
|
+
throw new Error("INVALID_TEMPLATE: Template has structural issues:\n" +
|
|
149
|
+
preValidationErrors.map((issue) => ` - ${issue}`).join("\n") +
|
|
150
|
+
"\n\nFix these issues and retry.");
|
|
129
151
|
}
|
|
130
|
-
}
|
|
131
|
-
if (preValidationErrors.length > 0) {
|
|
132
|
-
throw new Error("INVALID_TEMPLATE: Template has structural issues:\n" +
|
|
133
|
-
preValidationErrors.map((issue) => ` - ${issue}`).join("\n") +
|
|
134
|
-
"\n\nFix these issues and retry.");
|
|
135
152
|
}
|
|
136
153
|
// Campaign-backed tables route to the campaigns endpoint so the MCP
|
|
137
154
|
// tool persists the sequence to the same place the UI does
|
|
138
155
|
// (`CampaignOffer.sequenceTemplate`). The workflow-tables endpoint
|
|
139
156
|
// writes to `WorkflowTable.config.sequenceTemplate`, which the UI
|
|
140
157
|
// doesn't read — hitting it on a campaign table is silently wrong.
|
|
141
|
-
|
|
142
|
-
try {
|
|
143
|
-
const tableMeta = await api.get(`/api/v3/workflow-tables/${input.tableId}?mode=meta`);
|
|
144
|
-
const rawCampaignId = tableMeta?.table?.config?.campaignOfferId;
|
|
145
|
-
if (typeof rawCampaignId === "string" && rawCampaignId.length > 0) {
|
|
146
|
-
campaignOfferId = rawCampaignId;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
// Fall back to workflow-tables path on meta-fetch failure —
|
|
151
|
-
// non-campaign tables won't have the field set anyway.
|
|
152
|
-
}
|
|
158
|
+
const campaignOfferId = await resolveCampaignOfferIdForTable(api, input.tableId);
|
|
153
159
|
const endpoint = campaignOfferId
|
|
154
160
|
? `/api/v3/campaigns/${campaignOfferId}/sequence`
|
|
155
161
|
: `/api/v3/workflow-tables/${input.tableId}/sequence`;
|
|
156
162
|
try {
|
|
157
163
|
return await api.put(endpoint, {
|
|
158
|
-
template: input.template,
|
|
164
|
+
...(input.template ? { template: input.template } : {}),
|
|
165
|
+
...(input.templateRef ? { templateRef: input.templateRef } : {}),
|
|
159
166
|
confirmed: input.confirmed,
|
|
167
|
+
...(input.currentStep !== undefined
|
|
168
|
+
? { currentStep: input.currentStep }
|
|
169
|
+
: {}),
|
|
160
170
|
});
|
|
161
171
|
}
|
|
162
172
|
catch (error) {
|
|
@@ -177,6 +187,32 @@ export async function attachSequence(input) {
|
|
|
177
187
|
throw error;
|
|
178
188
|
}
|
|
179
189
|
}
|
|
190
|
+
async function resolveCampaignOfferIdForTable(api, tableId) {
|
|
191
|
+
try {
|
|
192
|
+
const tableMeta = await api.get(`/api/v3/workflow-tables/${tableId}?mode=meta`);
|
|
193
|
+
const rawCampaignId = tableMeta?.table?.config?.campaignOfferId;
|
|
194
|
+
if (typeof rawCampaignId === "string" && rawCampaignId.length > 0) {
|
|
195
|
+
return rawCampaignId;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
// Continue to the inventory fallback below.
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
const tableInventory = await api.get("/api/v3/mcp/tables?limit=500");
|
|
203
|
+
const matchingTable = tableInventory?.tables?.find((table) => {
|
|
204
|
+
return table?.id === tableId;
|
|
205
|
+
});
|
|
206
|
+
const rawCampaignId = matchingTable?.campaignOfferId;
|
|
207
|
+
if (typeof rawCampaignId === "string" && rawCampaignId.length > 0) {
|
|
208
|
+
return rawCampaignId;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
// Fall back to workflow-tables path on inventory failure.
|
|
213
|
+
}
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
180
216
|
export async function attachRecommendedSequence(input) {
|
|
181
217
|
const api = getApi();
|
|
182
218
|
try {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type SetupEvergreenCampaignsInput = {
|
|
2
|
+
workspaceId?: string;
|
|
2
3
|
mode?: "plan" | "verify";
|
|
3
4
|
depth?: "structure_only" | "customer_visible";
|
|
4
5
|
handoffMode?: "create_campaign_goals";
|
|
@@ -15,6 +16,9 @@ type SetupEvergreenCampaignsInput = {
|
|
|
15
16
|
planRevision?: string;
|
|
16
17
|
selectedActionIds?: string[];
|
|
17
18
|
receipts?: Array<Record<string, unknown>>;
|
|
19
|
+
campaignSequenceOptions?: {
|
|
20
|
+
mode: "connection_only";
|
|
21
|
+
};
|
|
18
22
|
};
|
|
19
23
|
export declare const setupEvergreenCampaignsToolDefinitions: {
|
|
20
24
|
name: string;
|
|
@@ -27,6 +31,23 @@ export declare const setupEvergreenCampaignsToolDefinitions: {
|
|
|
27
31
|
enum: string[];
|
|
28
32
|
description: string;
|
|
29
33
|
};
|
|
34
|
+
workspaceId: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
campaignSequenceOptions: {
|
|
39
|
+
type: string;
|
|
40
|
+
properties: {
|
|
41
|
+
mode: {
|
|
42
|
+
type: string;
|
|
43
|
+
enum: string[];
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
additionalProperties: boolean;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
30
51
|
depth: {
|
|
31
52
|
type: string;
|
|
32
53
|
enum: string[];
|