@sellable/mcp 0.1.363 → 0.1.364
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/server.js
CHANGED
|
@@ -43,6 +43,7 @@ import { addRubricItem, checkRubric, deleteRubricItem, draftRubrics, saveRubrics
|
|
|
43
43
|
import { getSenderRoutingTool, setSenderRoutingTool, } from "./tools/sender-routing.js";
|
|
44
44
|
import { getSender, listSenders } from "./tools/senders.js";
|
|
45
45
|
import { attachRecommendedSequence, attachSequence, createWorkflowTable, } from "./tools/sequencer.js";
|
|
46
|
+
import { setupEvergreenCampaigns } from "./tools/setup-evergreen-campaigns.js";
|
|
46
47
|
import { exportTableCsv, listTables } from "./tools/tables.js";
|
|
47
48
|
import { handleVerifyTableRow } from "./tools/verify-row.js";
|
|
48
49
|
import { sanitizeWatchUrlsForMcpResult } from "./tools/watch-url-security.js";
|
|
@@ -69,6 +70,34 @@ function parseOptionalNumber(value) {
|
|
|
69
70
|
}
|
|
70
71
|
return undefined;
|
|
71
72
|
}
|
|
73
|
+
function markEvergreenSetupCampaignsDirty(args) {
|
|
74
|
+
if (!args || args.mode !== "verify")
|
|
75
|
+
return;
|
|
76
|
+
const campaignIds = new Set();
|
|
77
|
+
const bindings = Array.isArray(args.bindings) ? args.bindings : [];
|
|
78
|
+
for (const binding of bindings) {
|
|
79
|
+
if (!binding || typeof binding !== "object" || Array.isArray(binding)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const campaignId = binding.campaignId;
|
|
83
|
+
if (typeof campaignId === "string" && campaignId.trim()) {
|
|
84
|
+
campaignIds.add(campaignId.trim());
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const receipts = Array.isArray(args.receipts) ? args.receipts : [];
|
|
88
|
+
for (const receipt of receipts) {
|
|
89
|
+
if (!receipt || typeof receipt !== "object" || Array.isArray(receipt)) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const campaignId = receipt.campaignId;
|
|
93
|
+
if (typeof campaignId === "string" && campaignId.trim()) {
|
|
94
|
+
campaignIds.add(campaignId.trim());
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
for (const campaignId of campaignIds) {
|
|
98
|
+
markCampaignContextDirty(campaignId, "setup_evergreen_campaigns");
|
|
99
|
+
}
|
|
100
|
+
}
|
|
72
101
|
function formatSubskillPromptText(result) {
|
|
73
102
|
const header = result.chunkCount && result.chunkCount > 1
|
|
74
103
|
? [
|
|
@@ -188,6 +217,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
188
217
|
case "get_campaign_refill_state":
|
|
189
218
|
result = await getCampaignRefillState(args);
|
|
190
219
|
break;
|
|
220
|
+
case "setup_evergreen_campaigns":
|
|
221
|
+
result = await setupEvergreenCampaigns(args);
|
|
222
|
+
markEvergreenSetupCampaignsDirty(args);
|
|
223
|
+
break;
|
|
191
224
|
case "fill_campaign_horizon":
|
|
192
225
|
result = await fillCampaignHorizon(args);
|
|
193
226
|
if (args?.campaignId) {
|
package/dist/tools/registry.js
CHANGED
|
@@ -38,6 +38,7 @@ import { rubricToolDefinitions } from "./rubrics.js";
|
|
|
38
38
|
import { senderRoutingToolDefinitions } from "./sender-routing.js";
|
|
39
39
|
import { senderToolDefinitions } from "./senders.js";
|
|
40
40
|
import { sequencerToolDefinitions } from "./sequencer.js";
|
|
41
|
+
import { setupEvergreenCampaignsToolDefinitions } from "./setup-evergreen-campaigns.js";
|
|
41
42
|
import { tableToolDefinitions } from "./tables.js";
|
|
42
43
|
import { verifyRowToolDefinitions } from "./verify-row.js";
|
|
43
44
|
import { waterfallToolDefinitions } from "./waterfalls.js";
|
|
@@ -48,6 +49,7 @@ export const allTools = [
|
|
|
48
49
|
...campaignAbTestToolDefinitions,
|
|
49
50
|
...campaignFillRoutingToolDefinitions,
|
|
50
51
|
...campaignRefillStateToolDefinitions,
|
|
52
|
+
...setupEvergreenCampaignsToolDefinitions,
|
|
51
53
|
...campaignHorizonFillToolDefinitions,
|
|
52
54
|
...campaignMessagePreparationToolDefinitions,
|
|
53
55
|
...campaignProcessingToolDefinitions,
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
type SetupEvergreenCampaignsInput = {
|
|
2
|
+
mode?: "plan" | "verify";
|
|
3
|
+
depth?: "structure_only" | "customer_visible";
|
|
4
|
+
yolo?: boolean;
|
|
5
|
+
allConnectedSenders?: boolean;
|
|
6
|
+
selectedSenderIds?: string[];
|
|
7
|
+
postEngagerSenderIds?: string[];
|
|
8
|
+
sharedSenderIds?: string[];
|
|
9
|
+
bindings?: Array<{
|
|
10
|
+
laneKey: string;
|
|
11
|
+
campaignId: string;
|
|
12
|
+
tableId: string;
|
|
13
|
+
}>;
|
|
14
|
+
planRevision?: string;
|
|
15
|
+
selectedActionIds?: string[];
|
|
16
|
+
receipts?: Array<Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
export declare const setupEvergreenCampaignsToolDefinitions: {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: string;
|
|
23
|
+
properties: {
|
|
24
|
+
mode: {
|
|
25
|
+
type: string;
|
|
26
|
+
enum: string[];
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
depth: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
yolo: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
allConnectedSenders: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
selectedSenderIds: {
|
|
43
|
+
type: string;
|
|
44
|
+
items: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
maxItems: number;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
postEngagerSenderIds: {
|
|
51
|
+
type: string;
|
|
52
|
+
items: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
maxItems: number;
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
sharedSenderIds: {
|
|
59
|
+
type: string;
|
|
60
|
+
items: {
|
|
61
|
+
type: string;
|
|
62
|
+
};
|
|
63
|
+
maxItems: number;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
bindings: {
|
|
67
|
+
type: string;
|
|
68
|
+
maxItems: number;
|
|
69
|
+
items: {
|
|
70
|
+
type: string;
|
|
71
|
+
properties: {
|
|
72
|
+
laneKey: {
|
|
73
|
+
type: string;
|
|
74
|
+
};
|
|
75
|
+
campaignId: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
tableId: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
required: string[];
|
|
83
|
+
additionalProperties: boolean;
|
|
84
|
+
};
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
planRevision: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
selectedActionIds: {
|
|
92
|
+
type: string;
|
|
93
|
+
items: {
|
|
94
|
+
type: string;
|
|
95
|
+
};
|
|
96
|
+
maxItems: number;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
receipts: {
|
|
100
|
+
type: string;
|
|
101
|
+
maxItems: number;
|
|
102
|
+
items: {
|
|
103
|
+
type: string;
|
|
104
|
+
};
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
required: never[];
|
|
109
|
+
additionalProperties: boolean;
|
|
110
|
+
};
|
|
111
|
+
}[];
|
|
112
|
+
export declare function setupEvergreenCampaigns(input: SetupEvergreenCampaignsInput): Promise<unknown>;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { getApi } from "../api.js";
|
|
2
|
+
async function postSetupEvergreenCampaigns(body) {
|
|
3
|
+
const api = getApi();
|
|
4
|
+
return api.post("/api/v3/mcp/setup-evergreen-campaigns", body);
|
|
5
|
+
}
|
|
6
|
+
export const setupEvergreenCampaignsToolDefinitions = [
|
|
7
|
+
{
|
|
8
|
+
name: "setup_evergreen_campaigns",
|
|
9
|
+
description: "Evergreen campaign setup plan/verify command. Use plan mode first to inspect exact workspace/sender/campaign/table/source state and receive immutable lane packets. `selectedSenderIds` is a legacy shorthand for both scopes; prefer `postEngagerSenderIds` for the Post Engagers sender scope and `sharedSenderIds` for the shared lane sender scope when they differ. The command plans one Post Engagers lane per post-engager sender plus shared Signal Discovery and Shared Cold Fallback lanes for the shared sender set. yolo is only a parent-skill auto-execution hint for safe lane packets; this backend command remains read-only in plan mode and verifies receipts in verify mode. When safe-yolo needs normal setup work, the parent skill may ask for bounded delegated approval: one approval over the current planRevision, selected action ids, caps, allowed side-effect classes, and stop conditions lets lane workers execute without per-substep approval while staying inside that packet. Lane workers must execute creation, source import, create-campaign workflow steps, generate-messages, sequence attachment, pause_campaign review-state transition when the current table is still DRAFT, and review readiness through existing create-campaign workflow/subskills, then return receipts here for verification. Customer-visible verify receipts must include createCampaignStepReceipt with setupPlanCall, campaignBriefReceipt, sourceDecisionReceipt, filterDecisionReceipt, messageDraftingReceipt, reviewBatchReceipt, sequenceReceipt, and verifyCall. messageDraftingReceipt must use statusSource:'branch' or statusSource:'packaged-generate-messages-worker' and include proof that generate-messages was loaded, start_campaign_message_preparation/get_campaign_message_preparation_status ran when the packaged worker path is used, validationResult:'passed', a passed qualityReview, and at least 3 concrete sampleMessages with row ids, generated message text, pass verdicts, and no issues; Shared Cold Fallback samples with a standalone name followed by 'Hey there' are rejected. This command does not launch campaigns, does not schedule sends, does not assign scheduler-owned send fields, does not raw-write campaign status, does not archive/delete cleanup targets, and does not spend paid credits.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
mode: {
|
|
14
|
+
type: "string",
|
|
15
|
+
enum: ["plan", "verify"],
|
|
16
|
+
description: 'Defaults to "plan". Verify only validates worker receipts.',
|
|
17
|
+
},
|
|
18
|
+
depth: {
|
|
19
|
+
type: "string",
|
|
20
|
+
enum: ["structure_only", "customer_visible"],
|
|
21
|
+
description: 'Use "customer_visible" for full setup proof or "structure_only" when only ensuring lane shells/config.',
|
|
22
|
+
},
|
|
23
|
+
yolo: {
|
|
24
|
+
type: "boolean",
|
|
25
|
+
description: "plan mode only. Requests auto-executable lane packets when state is safe; never authorizes cleanup, launch, scheduling, sending, or ambiguous target choice.",
|
|
26
|
+
},
|
|
27
|
+
allConnectedSenders: {
|
|
28
|
+
type: "boolean",
|
|
29
|
+
description: "Plan sender-owned Post Engagers lanes for all eligible connected senders in the active workspace.",
|
|
30
|
+
},
|
|
31
|
+
selectedSenderIds: {
|
|
32
|
+
type: "array",
|
|
33
|
+
items: { type: "string" },
|
|
34
|
+
maxItems: 25,
|
|
35
|
+
description: "Legacy shorthand: exact OutboundSenderIdentity ids for both sender-owned Post Engagers lanes and shared-lane sender set. Prefer scoped fields when those differ.",
|
|
36
|
+
},
|
|
37
|
+
postEngagerSenderIds: {
|
|
38
|
+
type: "array",
|
|
39
|
+
items: { type: "string" },
|
|
40
|
+
maxItems: 25,
|
|
41
|
+
description: "Exact OutboundSenderIdentity ids that should receive sender-owned Post Engagers lanes.",
|
|
42
|
+
},
|
|
43
|
+
sharedSenderIds: {
|
|
44
|
+
type: "array",
|
|
45
|
+
items: { type: "string" },
|
|
46
|
+
maxItems: 25,
|
|
47
|
+
description: "Exact OutboundSenderIdentity ids attached to shared Signal Discovery and Shared Cold Fallback lanes.",
|
|
48
|
+
},
|
|
49
|
+
bindings: {
|
|
50
|
+
type: "array",
|
|
51
|
+
maxItems: 20,
|
|
52
|
+
items: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {
|
|
55
|
+
laneKey: { type: "string" },
|
|
56
|
+
campaignId: { type: "string" },
|
|
57
|
+
tableId: { type: "string" },
|
|
58
|
+
},
|
|
59
|
+
required: ["laneKey", "campaignId", "tableId"],
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
},
|
|
62
|
+
description: "Exact existing campaign/table bindings to reuse for lane keys. Do not pass names.",
|
|
63
|
+
},
|
|
64
|
+
planRevision: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Required for verify. Copy from the immediately preceding plan.",
|
|
67
|
+
},
|
|
68
|
+
selectedActionIds: {
|
|
69
|
+
type: "array",
|
|
70
|
+
items: { type: "string" },
|
|
71
|
+
maxItems: 20,
|
|
72
|
+
description: "Required for verify. Immutable action ids selected from the current plan.",
|
|
73
|
+
},
|
|
74
|
+
receipts: {
|
|
75
|
+
type: "array",
|
|
76
|
+
maxItems: 20,
|
|
77
|
+
items: { type: "object" },
|
|
78
|
+
description: "Required for verify. Structured lane worker receipts from create-campaign/source/message/sequence execution. Customer-visible lanes must include createCampaignStepReceipt with setupPlanCall, campaignBriefReceipt, sourceDecisionReceipt, filterDecisionReceipt, messageDraftingReceipt, reviewBatchReceipt, sequenceReceipt, and verifyCall.",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
required: [],
|
|
82
|
+
additionalProperties: false,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
export function setupEvergreenCampaigns(input) {
|
|
87
|
+
return postSetupEvergreenCampaigns({
|
|
88
|
+
mode: input.mode,
|
|
89
|
+
yolo: input.yolo,
|
|
90
|
+
depth: input.depth,
|
|
91
|
+
allConnectedSenders: input.allConnectedSenders,
|
|
92
|
+
selectedSenderIds: input.selectedSenderIds,
|
|
93
|
+
postEngagerSenderIds: input.postEngagerSenderIds,
|
|
94
|
+
sharedSenderIds: input.sharedSenderIds,
|
|
95
|
+
bindings: input.bindings,
|
|
96
|
+
planRevision: input.planRevision,
|
|
97
|
+
selectedActionIds: input.selectedActionIds,
|
|
98
|
+
receipts: input.receipts,
|
|
99
|
+
});
|
|
100
|
+
}
|