@signaliz/sdk 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/{chunk-XJQ6KGNQ.mjs → chunk-DJVOGXVD.mjs} +162 -0
- package/dist/cli.js +213 -5
- package/dist/cli.mjs +53 -6
- package/dist/index.d.mts +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.js +163 -0
- package/dist/index.mjs +3 -1
- package/dist/mcp-config.js +161 -0
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,8 +93,15 @@ const plan = await signaliz.campaignBuilderAgent.createPlan({
|
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
const dryRun = await signaliz.campaignBuilderAgent.dryRunPlan(plan);
|
|
96
|
+
const readiness = await signaliz.campaignBuilderAgent.readiness({
|
|
97
|
+
goal: 'Build a strategy-template campaign for mature local operators',
|
|
98
|
+
strategyTemplate: 'non-medical-home-care',
|
|
99
|
+
targetCount: 500,
|
|
100
|
+
builtIns: ['lead_generation', 'local_leads', 'email_finding', 'email_verification', 'signals'],
|
|
101
|
+
});
|
|
96
102
|
|
|
97
103
|
console.log(plan.strategyMemoryStatus?.ready);
|
|
104
|
+
console.log(readiness.summary.ready);
|
|
98
105
|
console.log(plan.mcpFlow.filter((step) =>
|
|
99
106
|
['gtm_provider_recipe_prepare', 'gtm_provider_route_activate'].includes(step.tool)
|
|
100
107
|
));
|
|
@@ -128,6 +135,10 @@ npx @signaliz/sdk campaign-agent plan \
|
|
|
128
135
|
--target-count 250 \
|
|
129
136
|
--json
|
|
130
137
|
|
|
138
|
+
npx @signaliz/sdk campaign-agent doctor \
|
|
139
|
+
--request-file campaign-request.json \
|
|
140
|
+
--json
|
|
141
|
+
|
|
131
142
|
npx @signaliz/sdk campaign-agent status campaign_build_id --json
|
|
132
143
|
npx @signaliz/sdk campaign-agent review campaign_build_id --limit 100 --json
|
|
133
144
|
npx @signaliz/sdk campaign-agent rows campaign_build_id --limit 100 --json
|
|
@@ -1191,6 +1191,13 @@ var DEFAULT_CAMPAIGN_BUILDER_BUILT_INS = [
|
|
|
1191
1191
|
"email_verification",
|
|
1192
1192
|
"signals"
|
|
1193
1193
|
];
|
|
1194
|
+
var CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS = {
|
|
1195
|
+
lead_generation: "signaliz-lead-generation",
|
|
1196
|
+
local_leads: "signaliz-local-leads",
|
|
1197
|
+
email_finding: "signaliz-email-finding",
|
|
1198
|
+
email_verification: "signaliz-email-verification",
|
|
1199
|
+
signals: "signaliz-signals"
|
|
1200
|
+
};
|
|
1194
1201
|
var DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES = [
|
|
1195
1202
|
"memory_retrieval",
|
|
1196
1203
|
"spend",
|
|
@@ -1687,6 +1694,10 @@ var CampaignBuilderAgent = class {
|
|
|
1687
1694
|
}
|
|
1688
1695
|
return plan;
|
|
1689
1696
|
}
|
|
1697
|
+
async readiness(request, options = {}) {
|
|
1698
|
+
const plan = await this.createPlan(request, options);
|
|
1699
|
+
return createCampaignBuilderReadiness(plan);
|
|
1700
|
+
}
|
|
1690
1701
|
async commitPlan(plan, options = {}) {
|
|
1691
1702
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1692
1703
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2047,6 +2058,91 @@ function createCampaignBuilderAgentPlan(request, context = {}) {
|
|
|
2047
2058
|
warnings: context.warnings ?? []
|
|
2048
2059
|
};
|
|
2049
2060
|
}
|
|
2061
|
+
function createCampaignBuilderReadiness(plan) {
|
|
2062
|
+
const lanes = plan.routes.map((route) => createCampaignBuilderReadinessLane(route, plan));
|
|
2063
|
+
const builtInLanes = lanes.filter((lane) => lane.builtIn);
|
|
2064
|
+
const customRoutes = lanes.filter((lane) => lane.customRoute);
|
|
2065
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2066
|
+
const deliveryRisk = asRecord(plan.buildRequest.deliveryRisk);
|
|
2067
|
+
const deliveryRiskBlockers = arrayOfStrings(deliveryRisk.blockers) ?? [];
|
|
2068
|
+
const deliveryRiskValue = asRecord(deliveryRisk.risk);
|
|
2069
|
+
const deliveryRiskLevel = stringValue(deliveryRiskValue.risk_level ?? deliveryRiskValue.riskLevel);
|
|
2070
|
+
const memoryReady = !plan.strategyMemoryStatus || strategyMemory.ready !== false;
|
|
2071
|
+
const kernelPlanReady = Object.keys(asRecord(plan.kernelPlan)).length > 0;
|
|
2072
|
+
const deliveryRiskReady = !plan.buildRequest.deliveryRisk || deliveryRiskBlockers.length === 0 && !["high", "critical", "blocked"].includes(String(deliveryRiskLevel ?? "").toLowerCase());
|
|
2073
|
+
const builtInsReady = builtInLanes.length > 0 && builtInLanes.every((lane) => lane.ready);
|
|
2074
|
+
const customRoutesReady = customRoutes.every((lane) => lane.ready);
|
|
2075
|
+
const approvalGatesReady = plan.approvals.length > 0;
|
|
2076
|
+
const gates = [
|
|
2077
|
+
{
|
|
2078
|
+
id: "campaign_plan_created",
|
|
2079
|
+
label: "Campaign plan created",
|
|
2080
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2081
|
+
detail: plan.planId ? `Plan ${plan.planId} has ${plan.mcpFlow.length} MCP step(s).` : "No campaign-builder plan was created."
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
id: "built_in_lanes_ready",
|
|
2085
|
+
label: "Built-in lanes ready",
|
|
2086
|
+
passed: builtInsReady,
|
|
2087
|
+
detail: `${builtInLanes.filter((lane) => lane.ready).length}/${builtInLanes.length} Signaliz built-in lane(s) are present.`
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
id: "strategy_memory_ready",
|
|
2091
|
+
label: "Strategy memory ready",
|
|
2092
|
+
passed: memoryReady,
|
|
2093
|
+
detail: plan.strategyMemoryStatus ? "Strategy memory readiness was checked." : "Strategy memory readiness was not requested."
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
id: "kernel_plan_attached",
|
|
2097
|
+
label: "Kernel plan attached",
|
|
2098
|
+
passed: kernelPlanReady,
|
|
2099
|
+
detail: kernelPlanReady ? "Kernel planner evidence is attached." : "Kernel planner evidence is not attached."
|
|
2100
|
+
},
|
|
2101
|
+
{
|
|
2102
|
+
id: "delivery_risk_clear",
|
|
2103
|
+
label: "Delivery risk clear",
|
|
2104
|
+
passed: deliveryRiskReady,
|
|
2105
|
+
detail: plan.buildRequest.deliveryRisk ? `Delivery risk is ${deliveryRiskLevel || "available"} with ${deliveryRiskBlockers.length} blocker(s).` : "Delivery risk preflight was not requested."
|
|
2106
|
+
},
|
|
2107
|
+
{
|
|
2108
|
+
id: "custom_routes_prepared",
|
|
2109
|
+
label: "Custom routes prepared",
|
|
2110
|
+
passed: customRoutesReady,
|
|
2111
|
+
detail: customRoutes.length === 0 ? "No BYO routes were requested." : `${customRoutes.filter((lane) => lane.ready).length}/${customRoutes.length} BYO route(s) have read-only setup steps.`
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
id: "approval_gates_present",
|
|
2115
|
+
label: "Approval gates present",
|
|
2116
|
+
passed: approvalGatesReady,
|
|
2117
|
+
detail: approvalGatesReady ? `${plan.approvals.length} approval gate(s) are attached.` : "No approval gates are attached."
|
|
2118
|
+
}
|
|
2119
|
+
];
|
|
2120
|
+
const blockers = [
|
|
2121
|
+
...gates.filter((gate) => !gate.passed).map((gate) => gate.detail),
|
|
2122
|
+
...lanes.flatMap((lane) => lane.blockers)
|
|
2123
|
+
];
|
|
2124
|
+
const score = gates.length === 0 ? 0 : Math.round(gates.filter((gate) => gate.passed).length / gates.length * 100);
|
|
2125
|
+
const ready = blockers.length === 0;
|
|
2126
|
+
return {
|
|
2127
|
+
plan,
|
|
2128
|
+
lanes,
|
|
2129
|
+
gates,
|
|
2130
|
+
summary: {
|
|
2131
|
+
ready,
|
|
2132
|
+
score,
|
|
2133
|
+
targetCount: plan.targetCount,
|
|
2134
|
+
estimatedCredits: plan.estimatedCredits,
|
|
2135
|
+
builtInLanesReady: builtInLanes.filter((lane) => lane.ready).length,
|
|
2136
|
+
builtInLanesTotal: builtInLanes.length,
|
|
2137
|
+
customRoutesReady: customRoutes.filter((lane) => lane.ready).length,
|
|
2138
|
+
customRoutesTotal: customRoutes.length,
|
|
2139
|
+
approvalGateCount: plan.approvals.length,
|
|
2140
|
+
blockers,
|
|
2141
|
+
warnings: plan.warnings
|
|
2142
|
+
},
|
|
2143
|
+
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2050
2146
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2051
2147
|
if (approval.planId !== plan.planId) {
|
|
2052
2148
|
return plan.approvals;
|
|
@@ -3424,6 +3520,71 @@ function campaignReviewRowHasCopy(row) {
|
|
|
3424
3520
|
stringValue(data.subject) || stringValue(data.subject_line) || stringValue(data.subjectLine) || stringValue(data.opener) || stringValue(data.body) || stringValue(data.cta) || stringValue(copy.subject) || stringValue(copy.body) || stringValue(rawCopy.subject) || stringValue(rawCopy.body)
|
|
3425
3521
|
);
|
|
3426
3522
|
}
|
|
3523
|
+
function createCampaignBuilderReadinessLane(route, plan) {
|
|
3524
|
+
const builtIn = campaignBuilderBuiltInForRoute(route);
|
|
3525
|
+
const customRoute = route.provider !== "signaliz" && route.provider !== "csv" && builtIn === void 0;
|
|
3526
|
+
const prepareStep = plan.mcpFlow.find(
|
|
3527
|
+
(step) => step.tool === "gtm_provider_recipe_prepare" && step.arguments.provider_id === route.provider
|
|
3528
|
+
);
|
|
3529
|
+
const activateStep = plan.mcpFlow.find(
|
|
3530
|
+
(step) => step.tool === "gtm_provider_route_activate" && step.arguments.provider_id === route.provider
|
|
3531
|
+
);
|
|
3532
|
+
const readOnlySetup = !customRoute || prepareStep?.readOnly === true && activateStep?.readOnly === true && activateStep.arguments.dry_run === true && activateStep.arguments.confirm === false;
|
|
3533
|
+
const blockers = [
|
|
3534
|
+
customRoute && !prepareStep ? `${route.label ?? route.provider} is missing provider recipe setup.` : void 0,
|
|
3535
|
+
customRoute && !activateStep ? `${route.label ?? route.provider} is missing provider route dry-run setup.` : void 0,
|
|
3536
|
+
customRoute && !readOnlySetup ? `${route.label ?? route.provider} route setup must stay read-only before approval.` : void 0,
|
|
3537
|
+
route.mode === "required" && !route.toolName && customRoute ? `${route.label ?? route.provider} is required but has no tool name.` : void 0
|
|
3538
|
+
].filter((item) => Boolean(item));
|
|
3539
|
+
return {
|
|
3540
|
+
id: route.id ?? `${route.provider}-${route.layer}`,
|
|
3541
|
+
label: route.label ?? readinessLaneLabel(route, builtIn),
|
|
3542
|
+
layer: route.layer,
|
|
3543
|
+
gtmLayers: gtmLayersForRoute(route),
|
|
3544
|
+
provider: route.provider,
|
|
3545
|
+
toolName: route.toolName,
|
|
3546
|
+
mode: route.mode ?? "if_available",
|
|
3547
|
+
builtIn,
|
|
3548
|
+
approvalRequired: route.approvalRequired === true || plan.approvals.some((approval) => approval.routeId === route.id),
|
|
3549
|
+
customRoute,
|
|
3550
|
+
readOnlySetup,
|
|
3551
|
+
ready: blockers.length === 0,
|
|
3552
|
+
blockers,
|
|
3553
|
+
nextAction: customRoute ? `Review ${route.provider} route setup before launch approval.` : void 0
|
|
3554
|
+
};
|
|
3555
|
+
}
|
|
3556
|
+
function campaignBuilderBuiltInForRoute(route) {
|
|
3557
|
+
return Object.entries(CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS).find(([, routeId]) => route.id === routeId)?.[0];
|
|
3558
|
+
}
|
|
3559
|
+
function readinessLaneLabel(route, builtIn) {
|
|
3560
|
+
if (builtIn) {
|
|
3561
|
+
const labels = {
|
|
3562
|
+
lead_generation: "Signaliz lead generation",
|
|
3563
|
+
local_leads: "Signaliz local leads",
|
|
3564
|
+
email_finding: "Signaliz email finding",
|
|
3565
|
+
email_verification: "Signaliz email verification",
|
|
3566
|
+
signals: "Signaliz signals"
|
|
3567
|
+
};
|
|
3568
|
+
return labels[builtIn];
|
|
3569
|
+
}
|
|
3570
|
+
return `${route.provider} ${route.layer}`;
|
|
3571
|
+
}
|
|
3572
|
+
function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
3573
|
+
const requestHint = "--request-file campaign-request.json";
|
|
3574
|
+
if (ready) {
|
|
3575
|
+
return [
|
|
3576
|
+
`signaliz campaign-agent proof ${requestHint} --json`,
|
|
3577
|
+
`signaliz campaign-agent commit-plan ${requestHint} --json`,
|
|
3578
|
+
`signaliz campaign-agent build-approved ${requestHint} --confirm-launch --approve-all --approved-by operator@example.com --spend-limit ${plan.estimatedCredits}`
|
|
3579
|
+
];
|
|
3580
|
+
}
|
|
3581
|
+
const actions = [
|
|
3582
|
+
plan.strategyMemoryStatus && asRecord(plan.strategyMemoryStatus).ready === false ? "signaliz gtm strategy-memory --strategy-template <strategy_template> --include-samples --json" : void 0,
|
|
3583
|
+
customRouteCount > 0 ? "Review BYO provider recipe and route dry-run steps in the readiness packet." : void 0,
|
|
3584
|
+
`signaliz campaign-agent plan ${requestHint} --json`
|
|
3585
|
+
];
|
|
3586
|
+
return actions.filter((item) => Boolean(item));
|
|
3587
|
+
}
|
|
3427
3588
|
function diagnosticMessages2(value) {
|
|
3428
3589
|
if (!Array.isArray(value)) return [];
|
|
3429
3590
|
return value.map((item) => {
|
|
@@ -6434,6 +6595,7 @@ export {
|
|
|
6434
6595
|
CAMPAIGN_BUILDER_STRATEGY_TEMPLATES,
|
|
6435
6596
|
CampaignBuilderAgent,
|
|
6436
6597
|
createCampaignBuilderAgentPlan,
|
|
6598
|
+
createCampaignBuilderReadiness,
|
|
6437
6599
|
getMissingCampaignBuilderApprovals,
|
|
6438
6600
|
createCampaignBuilderApproval,
|
|
6439
6601
|
getCampaignBuilderStrategyTemplate,
|
package/dist/cli.js
CHANGED
|
@@ -1197,6 +1197,13 @@ var DEFAULT_CAMPAIGN_BUILDER_BUILT_INS = [
|
|
|
1197
1197
|
"email_verification",
|
|
1198
1198
|
"signals"
|
|
1199
1199
|
];
|
|
1200
|
+
var CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS = {
|
|
1201
|
+
lead_generation: "signaliz-lead-generation",
|
|
1202
|
+
local_leads: "signaliz-local-leads",
|
|
1203
|
+
email_finding: "signaliz-email-finding",
|
|
1204
|
+
email_verification: "signaliz-email-verification",
|
|
1205
|
+
signals: "signaliz-signals"
|
|
1206
|
+
};
|
|
1200
1207
|
var DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES = [
|
|
1201
1208
|
"memory_retrieval",
|
|
1202
1209
|
"spend",
|
|
@@ -1693,6 +1700,10 @@ var CampaignBuilderAgent = class {
|
|
|
1693
1700
|
}
|
|
1694
1701
|
return plan;
|
|
1695
1702
|
}
|
|
1703
|
+
async readiness(request, options = {}) {
|
|
1704
|
+
const plan = await this.createPlan(request, options);
|
|
1705
|
+
return createCampaignBuilderReadiness(plan);
|
|
1706
|
+
}
|
|
1696
1707
|
async commitPlan(plan, options = {}) {
|
|
1697
1708
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1698
1709
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2053,6 +2064,91 @@ function createCampaignBuilderAgentPlan(request, context = {}) {
|
|
|
2053
2064
|
warnings: context.warnings ?? []
|
|
2054
2065
|
};
|
|
2055
2066
|
}
|
|
2067
|
+
function createCampaignBuilderReadiness(plan) {
|
|
2068
|
+
const lanes = plan.routes.map((route) => createCampaignBuilderReadinessLane(route, plan));
|
|
2069
|
+
const builtInLanes = lanes.filter((lane) => lane.builtIn);
|
|
2070
|
+
const customRoutes = lanes.filter((lane) => lane.customRoute);
|
|
2071
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2072
|
+
const deliveryRisk = asRecord(plan.buildRequest.deliveryRisk);
|
|
2073
|
+
const deliveryRiskBlockers = arrayOfStrings(deliveryRisk.blockers) ?? [];
|
|
2074
|
+
const deliveryRiskValue = asRecord(deliveryRisk.risk);
|
|
2075
|
+
const deliveryRiskLevel = stringValue(deliveryRiskValue.risk_level ?? deliveryRiskValue.riskLevel);
|
|
2076
|
+
const memoryReady = !plan.strategyMemoryStatus || strategyMemory.ready !== false;
|
|
2077
|
+
const kernelPlanReady = Object.keys(asRecord(plan.kernelPlan)).length > 0;
|
|
2078
|
+
const deliveryRiskReady = !plan.buildRequest.deliveryRisk || deliveryRiskBlockers.length === 0 && !["high", "critical", "blocked"].includes(String(deliveryRiskLevel ?? "").toLowerCase());
|
|
2079
|
+
const builtInsReady = builtInLanes.length > 0 && builtInLanes.every((lane) => lane.ready);
|
|
2080
|
+
const customRoutesReady = customRoutes.every((lane) => lane.ready);
|
|
2081
|
+
const approvalGatesReady = plan.approvals.length > 0;
|
|
2082
|
+
const gates = [
|
|
2083
|
+
{
|
|
2084
|
+
id: "campaign_plan_created",
|
|
2085
|
+
label: "Campaign plan created",
|
|
2086
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2087
|
+
detail: plan.planId ? `Plan ${plan.planId} has ${plan.mcpFlow.length} MCP step(s).` : "No campaign-builder plan was created."
|
|
2088
|
+
},
|
|
2089
|
+
{
|
|
2090
|
+
id: "built_in_lanes_ready",
|
|
2091
|
+
label: "Built-in lanes ready",
|
|
2092
|
+
passed: builtInsReady,
|
|
2093
|
+
detail: `${builtInLanes.filter((lane) => lane.ready).length}/${builtInLanes.length} Signaliz built-in lane(s) are present.`
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
id: "strategy_memory_ready",
|
|
2097
|
+
label: "Strategy memory ready",
|
|
2098
|
+
passed: memoryReady,
|
|
2099
|
+
detail: plan.strategyMemoryStatus ? "Strategy memory readiness was checked." : "Strategy memory readiness was not requested."
|
|
2100
|
+
},
|
|
2101
|
+
{
|
|
2102
|
+
id: "kernel_plan_attached",
|
|
2103
|
+
label: "Kernel plan attached",
|
|
2104
|
+
passed: kernelPlanReady,
|
|
2105
|
+
detail: kernelPlanReady ? "Kernel planner evidence is attached." : "Kernel planner evidence is not attached."
|
|
2106
|
+
},
|
|
2107
|
+
{
|
|
2108
|
+
id: "delivery_risk_clear",
|
|
2109
|
+
label: "Delivery risk clear",
|
|
2110
|
+
passed: deliveryRiskReady,
|
|
2111
|
+
detail: plan.buildRequest.deliveryRisk ? `Delivery risk is ${deliveryRiskLevel || "available"} with ${deliveryRiskBlockers.length} blocker(s).` : "Delivery risk preflight was not requested."
|
|
2112
|
+
},
|
|
2113
|
+
{
|
|
2114
|
+
id: "custom_routes_prepared",
|
|
2115
|
+
label: "Custom routes prepared",
|
|
2116
|
+
passed: customRoutesReady,
|
|
2117
|
+
detail: customRoutes.length === 0 ? "No BYO routes were requested." : `${customRoutes.filter((lane) => lane.ready).length}/${customRoutes.length} BYO route(s) have read-only setup steps.`
|
|
2118
|
+
},
|
|
2119
|
+
{
|
|
2120
|
+
id: "approval_gates_present",
|
|
2121
|
+
label: "Approval gates present",
|
|
2122
|
+
passed: approvalGatesReady,
|
|
2123
|
+
detail: approvalGatesReady ? `${plan.approvals.length} approval gate(s) are attached.` : "No approval gates are attached."
|
|
2124
|
+
}
|
|
2125
|
+
];
|
|
2126
|
+
const blockers = [
|
|
2127
|
+
...gates.filter((gate) => !gate.passed).map((gate) => gate.detail),
|
|
2128
|
+
...lanes.flatMap((lane) => lane.blockers)
|
|
2129
|
+
];
|
|
2130
|
+
const score = gates.length === 0 ? 0 : Math.round(gates.filter((gate) => gate.passed).length / gates.length * 100);
|
|
2131
|
+
const ready = blockers.length === 0;
|
|
2132
|
+
return {
|
|
2133
|
+
plan,
|
|
2134
|
+
lanes,
|
|
2135
|
+
gates,
|
|
2136
|
+
summary: {
|
|
2137
|
+
ready,
|
|
2138
|
+
score,
|
|
2139
|
+
targetCount: plan.targetCount,
|
|
2140
|
+
estimatedCredits: plan.estimatedCredits,
|
|
2141
|
+
builtInLanesReady: builtInLanes.filter((lane) => lane.ready).length,
|
|
2142
|
+
builtInLanesTotal: builtInLanes.length,
|
|
2143
|
+
customRoutesReady: customRoutes.filter((lane) => lane.ready).length,
|
|
2144
|
+
customRoutesTotal: customRoutes.length,
|
|
2145
|
+
approvalGateCount: plan.approvals.length,
|
|
2146
|
+
blockers,
|
|
2147
|
+
warnings: plan.warnings
|
|
2148
|
+
},
|
|
2149
|
+
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2056
2152
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2057
2153
|
if (approval.planId !== plan.planId) {
|
|
2058
2154
|
return plan.approvals;
|
|
@@ -3430,6 +3526,71 @@ function campaignReviewRowHasCopy(row) {
|
|
|
3430
3526
|
stringValue(data.subject) || stringValue(data.subject_line) || stringValue(data.subjectLine) || stringValue(data.opener) || stringValue(data.body) || stringValue(data.cta) || stringValue(copy.subject) || stringValue(copy.body) || stringValue(rawCopy.subject) || stringValue(rawCopy.body)
|
|
3431
3527
|
);
|
|
3432
3528
|
}
|
|
3529
|
+
function createCampaignBuilderReadinessLane(route, plan) {
|
|
3530
|
+
const builtIn = campaignBuilderBuiltInForRoute(route);
|
|
3531
|
+
const customRoute = route.provider !== "signaliz" && route.provider !== "csv" && builtIn === void 0;
|
|
3532
|
+
const prepareStep = plan.mcpFlow.find(
|
|
3533
|
+
(step) => step.tool === "gtm_provider_recipe_prepare" && step.arguments.provider_id === route.provider
|
|
3534
|
+
);
|
|
3535
|
+
const activateStep = plan.mcpFlow.find(
|
|
3536
|
+
(step) => step.tool === "gtm_provider_route_activate" && step.arguments.provider_id === route.provider
|
|
3537
|
+
);
|
|
3538
|
+
const readOnlySetup = !customRoute || prepareStep?.readOnly === true && activateStep?.readOnly === true && activateStep.arguments.dry_run === true && activateStep.arguments.confirm === false;
|
|
3539
|
+
const blockers = [
|
|
3540
|
+
customRoute && !prepareStep ? `${route.label ?? route.provider} is missing provider recipe setup.` : void 0,
|
|
3541
|
+
customRoute && !activateStep ? `${route.label ?? route.provider} is missing provider route dry-run setup.` : void 0,
|
|
3542
|
+
customRoute && !readOnlySetup ? `${route.label ?? route.provider} route setup must stay read-only before approval.` : void 0,
|
|
3543
|
+
route.mode === "required" && !route.toolName && customRoute ? `${route.label ?? route.provider} is required but has no tool name.` : void 0
|
|
3544
|
+
].filter((item) => Boolean(item));
|
|
3545
|
+
return {
|
|
3546
|
+
id: route.id ?? `${route.provider}-${route.layer}`,
|
|
3547
|
+
label: route.label ?? readinessLaneLabel(route, builtIn),
|
|
3548
|
+
layer: route.layer,
|
|
3549
|
+
gtmLayers: gtmLayersForRoute(route),
|
|
3550
|
+
provider: route.provider,
|
|
3551
|
+
toolName: route.toolName,
|
|
3552
|
+
mode: route.mode ?? "if_available",
|
|
3553
|
+
builtIn,
|
|
3554
|
+
approvalRequired: route.approvalRequired === true || plan.approvals.some((approval) => approval.routeId === route.id),
|
|
3555
|
+
customRoute,
|
|
3556
|
+
readOnlySetup,
|
|
3557
|
+
ready: blockers.length === 0,
|
|
3558
|
+
blockers,
|
|
3559
|
+
nextAction: customRoute ? `Review ${route.provider} route setup before launch approval.` : void 0
|
|
3560
|
+
};
|
|
3561
|
+
}
|
|
3562
|
+
function campaignBuilderBuiltInForRoute(route) {
|
|
3563
|
+
return Object.entries(CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS).find(([, routeId]) => route.id === routeId)?.[0];
|
|
3564
|
+
}
|
|
3565
|
+
function readinessLaneLabel(route, builtIn) {
|
|
3566
|
+
if (builtIn) {
|
|
3567
|
+
const labels = {
|
|
3568
|
+
lead_generation: "Signaliz lead generation",
|
|
3569
|
+
local_leads: "Signaliz local leads",
|
|
3570
|
+
email_finding: "Signaliz email finding",
|
|
3571
|
+
email_verification: "Signaliz email verification",
|
|
3572
|
+
signals: "Signaliz signals"
|
|
3573
|
+
};
|
|
3574
|
+
return labels[builtIn];
|
|
3575
|
+
}
|
|
3576
|
+
return `${route.provider} ${route.layer}`;
|
|
3577
|
+
}
|
|
3578
|
+
function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
3579
|
+
const requestHint = "--request-file campaign-request.json";
|
|
3580
|
+
if (ready) {
|
|
3581
|
+
return [
|
|
3582
|
+
`signaliz campaign-agent proof ${requestHint} --json`,
|
|
3583
|
+
`signaliz campaign-agent commit-plan ${requestHint} --json`,
|
|
3584
|
+
`signaliz campaign-agent build-approved ${requestHint} --confirm-launch --approve-all --approved-by operator@example.com --spend-limit ${plan.estimatedCredits}`
|
|
3585
|
+
];
|
|
3586
|
+
}
|
|
3587
|
+
const actions = [
|
|
3588
|
+
plan.strategyMemoryStatus && asRecord(plan.strategyMemoryStatus).ready === false ? "signaliz gtm strategy-memory --strategy-template <strategy_template> --include-samples --json" : void 0,
|
|
3589
|
+
customRouteCount > 0 ? "Review BYO provider recipe and route dry-run steps in the readiness packet." : void 0,
|
|
3590
|
+
`signaliz campaign-agent plan ${requestHint} --json`
|
|
3591
|
+
];
|
|
3592
|
+
return actions.filter((item) => Boolean(item));
|
|
3593
|
+
}
|
|
3433
3594
|
function diagnosticMessages2(value) {
|
|
3434
3595
|
if (!Array.isArray(value)) return [];
|
|
3435
3596
|
return value.map((item) => {
|
|
@@ -6807,13 +6968,14 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
6807
6968
|
await handleCampaignAgentReviewCommand(signaliz, subcommand, argv.slice(1));
|
|
6808
6969
|
return;
|
|
6809
6970
|
}
|
|
6810
|
-
if (!["plan", "proof", "smoke", "commit-plan", "dry-run", "build-approved", "launch-approved"].includes(subcommand)) {
|
|
6971
|
+
if (!["plan", "doctor", "readiness", "preflight", "proof", "smoke", "commit-plan", "dry-run", "build-approved", "launch-approved"].includes(subcommand)) {
|
|
6811
6972
|
printCampaignAgentHelp();
|
|
6812
6973
|
return;
|
|
6813
6974
|
}
|
|
6814
6975
|
const flags = parseFlags(argv.slice(1));
|
|
6976
|
+
const isDoctor = subcommand === "doctor" || subcommand === "readiness" || subcommand === "preflight";
|
|
6815
6977
|
const requestFromFile = campaignAgentRequestFileFromFlags(flags);
|
|
6816
|
-
const goal = stringFlag(flags, "goal", "brief") ?? stringOrUndefined(requestFromFile?.goal);
|
|
6978
|
+
const goal = stringFlag(flags, "goal", "brief") ?? stringOrUndefined(requestFromFile?.goal) ?? (isDoctor ? "Build a strategy-template campaign for the target ICP." : void 0);
|
|
6817
6979
|
if (!goal) throw new Error(`campaign-agent ${subcommand} requires --goal or a request file with goal`);
|
|
6818
6980
|
const isApprovedBuild = subcommand === "build-approved" || subcommand === "launch-approved";
|
|
6819
6981
|
const isCommitPlan = subcommand === "commit-plan";
|
|
@@ -6832,13 +6994,24 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
6832
6994
|
requestFromFile,
|
|
6833
6995
|
campaignAgentRequestFromFlags(goal, flags, { includeDefaults: !requestFromFile })
|
|
6834
6996
|
);
|
|
6835
|
-
const
|
|
6997
|
+
const planOptions = {
|
|
6836
6998
|
discoverCapabilities: !booleanFlag(flags, "skip-discovery"),
|
|
6837
6999
|
scopeCampaign: !booleanFlag(flags, "skip-scope"),
|
|
6838
7000
|
includeStrategyMemoryStatus: !booleanFlag(flags, "no-strategy-memory"),
|
|
6839
7001
|
includeKernelPlan: !booleanFlag(flags, "no-kernel-plan"),
|
|
6840
7002
|
includeDeliveryRisk: !booleanFlag(flags, "no-delivery-risk")
|
|
6841
|
-
}
|
|
7003
|
+
};
|
|
7004
|
+
if (isDoctor) {
|
|
7005
|
+
const readiness = await signaliz.campaignBuilderAgent.readiness(request, planOptions);
|
|
7006
|
+
if (booleanFlag(flags, "json")) {
|
|
7007
|
+
printJson(readiness);
|
|
7008
|
+
} else {
|
|
7009
|
+
printCampaignAgentReadiness(readiness);
|
|
7010
|
+
}
|
|
7011
|
+
if (!readiness.summary.ready) process.exitCode = 1;
|
|
7012
|
+
return;
|
|
7013
|
+
}
|
|
7014
|
+
const plan = await signaliz.campaignBuilderAgent.createPlan(request, planOptions);
|
|
6842
7015
|
if (subcommand === "proof" || subcommand === "smoke") {
|
|
6843
7016
|
const result = await signaliz.campaignBuilderAgent.dryRunPlan(plan, {
|
|
6844
7017
|
idempotencyKey: stringFlag(flags, "idempotency-key")
|
|
@@ -7326,6 +7499,39 @@ function printCampaignAgentExecution(payload, flags) {
|
|
|
7326
7499
|
console.log("\nResult:");
|
|
7327
7500
|
printJson(payload.result);
|
|
7328
7501
|
}
|
|
7502
|
+
function printCampaignAgentReadiness(readiness) {
|
|
7503
|
+
const summary = asRecord4(readiness.summary);
|
|
7504
|
+
const plan = readiness.plan;
|
|
7505
|
+
console.log(`Readiness: ${summary.ready === true ? "ready" : "blocked"} (${summary.score ?? 0}%)`);
|
|
7506
|
+
if (plan?.campaignName) console.log(`Campaign: ${plan.campaignName}`);
|
|
7507
|
+
if (summary.targetCount !== void 0) console.log(`Target: ${summary.targetCount}`);
|
|
7508
|
+
if (summary.estimatedCredits !== void 0) console.log(`Estimated credits: ${summary.estimatedCredits}`);
|
|
7509
|
+
console.log(`Built-ins: ${summary.builtInLanesReady ?? 0}/${summary.builtInLanesTotal ?? 0}`);
|
|
7510
|
+
console.log(`BYO routes: ${summary.customRoutesReady ?? 0}/${summary.customRoutesTotal ?? 0}`);
|
|
7511
|
+
console.log(`Approval gates: ${summary.approvalGateCount ?? 0}`);
|
|
7512
|
+
if (Array.isArray(readiness.gates) && readiness.gates.length > 0) {
|
|
7513
|
+
console.log("\nGates:");
|
|
7514
|
+
for (const gate of readiness.gates) {
|
|
7515
|
+
console.log(`- ${gate.passed ? "PASS" : "BLOCKED"} ${gate.label}: ${gate.detail}`);
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
if (Array.isArray(readiness.lanes) && readiness.lanes.length > 0) {
|
|
7519
|
+
console.log("\nLanes:");
|
|
7520
|
+
for (const lane of readiness.lanes) {
|
|
7521
|
+
console.log(`- ${lane.ready ? "READY" : "BLOCKED"} ${lane.label}: ${lane.toolName || lane.provider}`);
|
|
7522
|
+
}
|
|
7523
|
+
}
|
|
7524
|
+
const blockers = Array.isArray(summary.blockers) ? summary.blockers : [];
|
|
7525
|
+
if (blockers.length > 0) {
|
|
7526
|
+
console.log("\nBlockers:");
|
|
7527
|
+
for (const blocker of blockers.slice(0, 8)) console.log(`- ${blocker}`);
|
|
7528
|
+
}
|
|
7529
|
+
const nextActions = Array.isArray(readiness.nextActions) ? readiness.nextActions : [];
|
|
7530
|
+
if (nextActions.length > 0) {
|
|
7531
|
+
console.log("\nNext:");
|
|
7532
|
+
for (const action of nextActions) console.log(`- ${action}`);
|
|
7533
|
+
}
|
|
7534
|
+
}
|
|
7329
7535
|
function printCampaignAgentBuildStatus(status) {
|
|
7330
7536
|
console.log(`Campaign: ${status.name || status.campaignBuildId}`);
|
|
7331
7537
|
if (status.campaignId) console.log(`Campaign ID: ${status.campaignId}`);
|
|
@@ -7576,6 +7782,7 @@ Usage:
|
|
|
7576
7782
|
signaliz gtm memory search --query "proof-first vertical gate" --json
|
|
7577
7783
|
signaliz gtm plan --brief "Build 500 verified leads for..." --strategy-template non-medical-home-care --lead-count 500 --json
|
|
7578
7784
|
signaliz campaign-agent init --strategy-template non-medical-home-care --target-count 250 --use-local-leads --json > campaign-request.json
|
|
7785
|
+
signaliz campaign-agent doctor --request-file campaign-request.json --json
|
|
7579
7786
|
signaliz campaign-agent plan --goal "Build a strategy-template campaign..." --strategy-template industrial-ot-resilience --target-count 500 --builtins lead_generation,email_finding,email_verification,signals
|
|
7580
7787
|
signaliz campaign-agent proof --goal "Build a strategy-template campaign..." --strategy-template non-medical-home-care --target-count 100 --json
|
|
7581
7788
|
signaliz campaign-agent plan --request-file examples/campaign-builder-agent-request.json --target-count 250 --json
|
|
@@ -7612,6 +7819,7 @@ function printCampaignAgentHelp() {
|
|
|
7612
7819
|
Signaliz campaign-agent commands:
|
|
7613
7820
|
|
|
7614
7821
|
signaliz campaign-agent init [--goal TEXT] [--strategy-template ID] [--target-count N] [--use-local-leads] [--with-byo-placeholder] [--output-file FILE] [--json]
|
|
7822
|
+
signaliz campaign-agent doctor [--goal TEXT | --request-file FILE] [--strategy-template ID] [--target-count N] [--builtins lead_generation,email_finding,email_verification,signals,local_leads] [--custom-tool provider:layer:tool[:mcp]] [--json]
|
|
7615
7823
|
signaliz campaign-agent plan (--goal TEXT | --request-file FILE) [--campaign-name NAME] [--workspace-label NAME] [--strategy-template industrial-ot-resilience|non-medical-home-care|agency-founder-led|cloud-infrastructure-displacement] [--operating-playbooks proof-first-vertical-gate,signal-led-copy-approval] [--target-count N] [--icp JSON] [--builtins lead_generation,email_finding,email_verification,signals,local_leads] [--use-local-leads] [--custom-tool provider:layer:tool[:mcp]] [--preferred-providers signaliz_native,octave] [--partners clay,instantly,nango] [--no-strategy-memory] [--no-kernel-plan] [--no-delivery-risk] [--json]
|
|
7616
7824
|
signaliz campaign-agent proof (--goal TEXT | --request-file FILE) [--strategy-template ID] [--target-count N] [--use-local-leads] [--custom-tool provider:layer:tool[:mcp]] [--idempotency-key KEY] [--json]
|
|
7617
7825
|
signaliz campaign-agent commit-plan (--goal TEXT | --request-file FILE) [--confirm-write --approved-by EMAIL] [--idempotency-key KEY] [--json]
|
|
@@ -7623,7 +7831,7 @@ Signaliz campaign-agent commands:
|
|
|
7623
7831
|
signaliz campaign-agent artifacts <campaign_build_id> [--json]
|
|
7624
7832
|
signaliz campaign-agent approve <campaign_build_id> --destination-type json|csv|webhook [--destination-config JSON] [--json]
|
|
7625
7833
|
|
|
7626
|
-
The init command emits a reusable JSON CampaignBuilderAgentRequest. The plan command composes an approval-gated strategy-template MCP flow. Proof runs the same plan path plus build_campaign dry_run=true and returns a no-spend receipt. Use --request-file to load a reusable request, then override fields such as --target-count or --strategy-template from the command line. Use --strategy-template to merge a private-safe strategy pattern into the plan without exposing private account labels, and --operating-playbooks to add reusable build-loop gates such as proof-first vertical qualification, net-new suppression, cache-first inventory, and signal-led copy approval. Built-ins map to Signaliz-native tools: lead_generation -> generate_leads, local_leads -> generate_local_leads, email_finding -> find_and_verify_emails, email_verification -> verify_emails, signals -> enrich_company_signals. Add BYO tools with --custom-tool provider:layer:tool[:mcp] or key=value pairs such as provider=apollo,layer=source,tool=apollo_search,mcp=apollo. Use --no-strategy-patterns or --no-workflow-patterns to disable default private strategy memory hints. Commit-plan dry-runs by default and writes only with --confirm-write plus approval identity. Dry-run executes build_campaign with dry_run=true. Approved build requires explicit launch confirmation and approval metadata; add --commit-before-launch to persist the reviewed plan as a GTM campaign before launch, --wait to poll until completion or pending approval, and --approve-delivery to approve reviewed webhook delivery after pending_approval. Use review to inspect status, sampled rows, artifacts, and delivery-readiness gates before approving delivery or routing rows to external tools.
|
|
7834
|
+
The init command emits a reusable JSON CampaignBuilderAgentRequest. Doctor returns a readiness packet for built-in lanes, BYO routes, Memory, Brain, Kernel planning, and approval gates. The plan command composes an approval-gated strategy-template MCP flow. Proof runs the same plan path plus build_campaign dry_run=true and returns a no-spend receipt. Use --request-file to load a reusable request, then override fields such as --target-count or --strategy-template from the command line. Use --strategy-template to merge a private-safe strategy pattern into the plan without exposing private account labels, and --operating-playbooks to add reusable build-loop gates such as proof-first vertical qualification, net-new suppression, cache-first inventory, and signal-led copy approval. Built-ins map to Signaliz-native tools: lead_generation -> generate_leads, local_leads -> generate_local_leads, email_finding -> find_and_verify_emails, email_verification -> verify_emails, signals -> enrich_company_signals. Add BYO tools with --custom-tool provider:layer:tool[:mcp] or key=value pairs such as provider=apollo,layer=source,tool=apollo_search,mcp=apollo. Use --no-strategy-patterns or --no-workflow-patterns to disable default private strategy memory hints. Commit-plan dry-runs by default and writes only with --confirm-write plus approval identity. Dry-run executes build_campaign with dry_run=true. Approved build requires explicit launch confirmation and approval metadata; add --commit-before-launch to persist the reviewed plan as a GTM campaign before launch, --wait to poll until completion or pending approval, and --approve-delivery to approve reviewed webhook delivery after pending_approval. Use review to inspect status, sampled rows, artifacts, and delivery-readiness gates before approving delivery or routing rows to external tools.
|
|
7627
7835
|
`);
|
|
7628
7836
|
}
|
|
7629
7837
|
main().catch((e) => {
|
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
Signaliz,
|
|
4
4
|
createCampaignBuilderAgentRequestTemplate,
|
|
5
5
|
createCampaignBuilderApproval
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DJVOGXVD.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { readFileSync, writeFileSync } from "fs";
|
|
@@ -383,13 +383,14 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
383
383
|
await handleCampaignAgentReviewCommand(signaliz, subcommand, argv.slice(1));
|
|
384
384
|
return;
|
|
385
385
|
}
|
|
386
|
-
if (!["plan", "proof", "smoke", "commit-plan", "dry-run", "build-approved", "launch-approved"].includes(subcommand)) {
|
|
386
|
+
if (!["plan", "doctor", "readiness", "preflight", "proof", "smoke", "commit-plan", "dry-run", "build-approved", "launch-approved"].includes(subcommand)) {
|
|
387
387
|
printCampaignAgentHelp();
|
|
388
388
|
return;
|
|
389
389
|
}
|
|
390
390
|
const flags = parseFlags(argv.slice(1));
|
|
391
|
+
const isDoctor = subcommand === "doctor" || subcommand === "readiness" || subcommand === "preflight";
|
|
391
392
|
const requestFromFile = campaignAgentRequestFileFromFlags(flags);
|
|
392
|
-
const goal = stringFlag(flags, "goal", "brief") ?? stringOrUndefined(requestFromFile?.goal);
|
|
393
|
+
const goal = stringFlag(flags, "goal", "brief") ?? stringOrUndefined(requestFromFile?.goal) ?? (isDoctor ? "Build a strategy-template campaign for the target ICP." : void 0);
|
|
393
394
|
if (!goal) throw new Error(`campaign-agent ${subcommand} requires --goal or a request file with goal`);
|
|
394
395
|
const isApprovedBuild = subcommand === "build-approved" || subcommand === "launch-approved";
|
|
395
396
|
const isCommitPlan = subcommand === "commit-plan";
|
|
@@ -408,13 +409,24 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
408
409
|
requestFromFile,
|
|
409
410
|
campaignAgentRequestFromFlags(goal, flags, { includeDefaults: !requestFromFile })
|
|
410
411
|
);
|
|
411
|
-
const
|
|
412
|
+
const planOptions = {
|
|
412
413
|
discoverCapabilities: !booleanFlag(flags, "skip-discovery"),
|
|
413
414
|
scopeCampaign: !booleanFlag(flags, "skip-scope"),
|
|
414
415
|
includeStrategyMemoryStatus: !booleanFlag(flags, "no-strategy-memory"),
|
|
415
416
|
includeKernelPlan: !booleanFlag(flags, "no-kernel-plan"),
|
|
416
417
|
includeDeliveryRisk: !booleanFlag(flags, "no-delivery-risk")
|
|
417
|
-
}
|
|
418
|
+
};
|
|
419
|
+
if (isDoctor) {
|
|
420
|
+
const readiness = await signaliz.campaignBuilderAgent.readiness(request, planOptions);
|
|
421
|
+
if (booleanFlag(flags, "json")) {
|
|
422
|
+
printJson(readiness);
|
|
423
|
+
} else {
|
|
424
|
+
printCampaignAgentReadiness(readiness);
|
|
425
|
+
}
|
|
426
|
+
if (!readiness.summary.ready) process.exitCode = 1;
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
const plan = await signaliz.campaignBuilderAgent.createPlan(request, planOptions);
|
|
418
430
|
if (subcommand === "proof" || subcommand === "smoke") {
|
|
419
431
|
const result = await signaliz.campaignBuilderAgent.dryRunPlan(plan, {
|
|
420
432
|
idempotencyKey: stringFlag(flags, "idempotency-key")
|
|
@@ -902,6 +914,39 @@ function printCampaignAgentExecution(payload, flags) {
|
|
|
902
914
|
console.log("\nResult:");
|
|
903
915
|
printJson(payload.result);
|
|
904
916
|
}
|
|
917
|
+
function printCampaignAgentReadiness(readiness) {
|
|
918
|
+
const summary = asRecord(readiness.summary);
|
|
919
|
+
const plan = readiness.plan;
|
|
920
|
+
console.log(`Readiness: ${summary.ready === true ? "ready" : "blocked"} (${summary.score ?? 0}%)`);
|
|
921
|
+
if (plan?.campaignName) console.log(`Campaign: ${plan.campaignName}`);
|
|
922
|
+
if (summary.targetCount !== void 0) console.log(`Target: ${summary.targetCount}`);
|
|
923
|
+
if (summary.estimatedCredits !== void 0) console.log(`Estimated credits: ${summary.estimatedCredits}`);
|
|
924
|
+
console.log(`Built-ins: ${summary.builtInLanesReady ?? 0}/${summary.builtInLanesTotal ?? 0}`);
|
|
925
|
+
console.log(`BYO routes: ${summary.customRoutesReady ?? 0}/${summary.customRoutesTotal ?? 0}`);
|
|
926
|
+
console.log(`Approval gates: ${summary.approvalGateCount ?? 0}`);
|
|
927
|
+
if (Array.isArray(readiness.gates) && readiness.gates.length > 0) {
|
|
928
|
+
console.log("\nGates:");
|
|
929
|
+
for (const gate of readiness.gates) {
|
|
930
|
+
console.log(`- ${gate.passed ? "PASS" : "BLOCKED"} ${gate.label}: ${gate.detail}`);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
if (Array.isArray(readiness.lanes) && readiness.lanes.length > 0) {
|
|
934
|
+
console.log("\nLanes:");
|
|
935
|
+
for (const lane of readiness.lanes) {
|
|
936
|
+
console.log(`- ${lane.ready ? "READY" : "BLOCKED"} ${lane.label}: ${lane.toolName || lane.provider}`);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
const blockers = Array.isArray(summary.blockers) ? summary.blockers : [];
|
|
940
|
+
if (blockers.length > 0) {
|
|
941
|
+
console.log("\nBlockers:");
|
|
942
|
+
for (const blocker of blockers.slice(0, 8)) console.log(`- ${blocker}`);
|
|
943
|
+
}
|
|
944
|
+
const nextActions = Array.isArray(readiness.nextActions) ? readiness.nextActions : [];
|
|
945
|
+
if (nextActions.length > 0) {
|
|
946
|
+
console.log("\nNext:");
|
|
947
|
+
for (const action of nextActions) console.log(`- ${action}`);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
905
950
|
function printCampaignAgentBuildStatus(status) {
|
|
906
951
|
console.log(`Campaign: ${status.name || status.campaignBuildId}`);
|
|
907
952
|
if (status.campaignId) console.log(`Campaign ID: ${status.campaignId}`);
|
|
@@ -1152,6 +1197,7 @@ Usage:
|
|
|
1152
1197
|
signaliz gtm memory search --query "proof-first vertical gate" --json
|
|
1153
1198
|
signaliz gtm plan --brief "Build 500 verified leads for..." --strategy-template non-medical-home-care --lead-count 500 --json
|
|
1154
1199
|
signaliz campaign-agent init --strategy-template non-medical-home-care --target-count 250 --use-local-leads --json > campaign-request.json
|
|
1200
|
+
signaliz campaign-agent doctor --request-file campaign-request.json --json
|
|
1155
1201
|
signaliz campaign-agent plan --goal "Build a strategy-template campaign..." --strategy-template industrial-ot-resilience --target-count 500 --builtins lead_generation,email_finding,email_verification,signals
|
|
1156
1202
|
signaliz campaign-agent proof --goal "Build a strategy-template campaign..." --strategy-template non-medical-home-care --target-count 100 --json
|
|
1157
1203
|
signaliz campaign-agent plan --request-file examples/campaign-builder-agent-request.json --target-count 250 --json
|
|
@@ -1188,6 +1234,7 @@ function printCampaignAgentHelp() {
|
|
|
1188
1234
|
Signaliz campaign-agent commands:
|
|
1189
1235
|
|
|
1190
1236
|
signaliz campaign-agent init [--goal TEXT] [--strategy-template ID] [--target-count N] [--use-local-leads] [--with-byo-placeholder] [--output-file FILE] [--json]
|
|
1237
|
+
signaliz campaign-agent doctor [--goal TEXT | --request-file FILE] [--strategy-template ID] [--target-count N] [--builtins lead_generation,email_finding,email_verification,signals,local_leads] [--custom-tool provider:layer:tool[:mcp]] [--json]
|
|
1191
1238
|
signaliz campaign-agent plan (--goal TEXT | --request-file FILE) [--campaign-name NAME] [--workspace-label NAME] [--strategy-template industrial-ot-resilience|non-medical-home-care|agency-founder-led|cloud-infrastructure-displacement] [--operating-playbooks proof-first-vertical-gate,signal-led-copy-approval] [--target-count N] [--icp JSON] [--builtins lead_generation,email_finding,email_verification,signals,local_leads] [--use-local-leads] [--custom-tool provider:layer:tool[:mcp]] [--preferred-providers signaliz_native,octave] [--partners clay,instantly,nango] [--no-strategy-memory] [--no-kernel-plan] [--no-delivery-risk] [--json]
|
|
1192
1239
|
signaliz campaign-agent proof (--goal TEXT | --request-file FILE) [--strategy-template ID] [--target-count N] [--use-local-leads] [--custom-tool provider:layer:tool[:mcp]] [--idempotency-key KEY] [--json]
|
|
1193
1240
|
signaliz campaign-agent commit-plan (--goal TEXT | --request-file FILE) [--confirm-write --approved-by EMAIL] [--idempotency-key KEY] [--json]
|
|
@@ -1199,7 +1246,7 @@ Signaliz campaign-agent commands:
|
|
|
1199
1246
|
signaliz campaign-agent artifacts <campaign_build_id> [--json]
|
|
1200
1247
|
signaliz campaign-agent approve <campaign_build_id> --destination-type json|csv|webhook [--destination-config JSON] [--json]
|
|
1201
1248
|
|
|
1202
|
-
The init command emits a reusable JSON CampaignBuilderAgentRequest. The plan command composes an approval-gated strategy-template MCP flow. Proof runs the same plan path plus build_campaign dry_run=true and returns a no-spend receipt. Use --request-file to load a reusable request, then override fields such as --target-count or --strategy-template from the command line. Use --strategy-template to merge a private-safe strategy pattern into the plan without exposing private account labels, and --operating-playbooks to add reusable build-loop gates such as proof-first vertical qualification, net-new suppression, cache-first inventory, and signal-led copy approval. Built-ins map to Signaliz-native tools: lead_generation -> generate_leads, local_leads -> generate_local_leads, email_finding -> find_and_verify_emails, email_verification -> verify_emails, signals -> enrich_company_signals. Add BYO tools with --custom-tool provider:layer:tool[:mcp] or key=value pairs such as provider=apollo,layer=source,tool=apollo_search,mcp=apollo. Use --no-strategy-patterns or --no-workflow-patterns to disable default private strategy memory hints. Commit-plan dry-runs by default and writes only with --confirm-write plus approval identity. Dry-run executes build_campaign with dry_run=true. Approved build requires explicit launch confirmation and approval metadata; add --commit-before-launch to persist the reviewed plan as a GTM campaign before launch, --wait to poll until completion or pending approval, and --approve-delivery to approve reviewed webhook delivery after pending_approval. Use review to inspect status, sampled rows, artifacts, and delivery-readiness gates before approving delivery or routing rows to external tools.
|
|
1249
|
+
The init command emits a reusable JSON CampaignBuilderAgentRequest. Doctor returns a readiness packet for built-in lanes, BYO routes, Memory, Brain, Kernel planning, and approval gates. The plan command composes an approval-gated strategy-template MCP flow. Proof runs the same plan path plus build_campaign dry_run=true and returns a no-spend receipt. Use --request-file to load a reusable request, then override fields such as --target-count or --strategy-template from the command line. Use --strategy-template to merge a private-safe strategy pattern into the plan without exposing private account labels, and --operating-playbooks to add reusable build-loop gates such as proof-first vertical qualification, net-new suppression, cache-first inventory, and signal-led copy approval. Built-ins map to Signaliz-native tools: lead_generation -> generate_leads, local_leads -> generate_local_leads, email_finding -> find_and_verify_emails, email_verification -> verify_emails, signals -> enrich_company_signals. Add BYO tools with --custom-tool provider:layer:tool[:mcp] or key=value pairs such as provider=apollo,layer=source,tool=apollo_search,mcp=apollo. Use --no-strategy-patterns or --no-workflow-patterns to disable default private strategy memory hints. Commit-plan dry-runs by default and writes only with --confirm-write plus approval identity. Dry-run executes build_campaign with dry_run=true. Approved build requires explicit launch confirmation and approval metadata; add --commit-before-launch to persist the reviewed plan as a GTM campaign before launch, --wait to poll until completion or pending approval, and --approve-delivery to approve reviewed webhook delivery after pending_approval. Use review to inspect status, sampled rows, artifacts, and delivery-readiness gates before approving delivery or routing rows to external tools.
|
|
1203
1250
|
`);
|
|
1204
1251
|
}
|
|
1205
1252
|
main().catch((e) => {
|
package/dist/index.d.mts
CHANGED
|
@@ -1126,6 +1126,48 @@ interface CampaignBuilderBuildReview {
|
|
|
1126
1126
|
summary: CampaignBuilderBuildReviewSummary;
|
|
1127
1127
|
nextActions: string[];
|
|
1128
1128
|
}
|
|
1129
|
+
interface CampaignBuilderReadinessLane {
|
|
1130
|
+
id: string;
|
|
1131
|
+
label: string;
|
|
1132
|
+
layer: CampaignBuilderLayer;
|
|
1133
|
+
gtmLayers: string[];
|
|
1134
|
+
provider: CampaignBuilderProvider;
|
|
1135
|
+
toolName?: string;
|
|
1136
|
+
mode: CampaignBuilderRouteMode;
|
|
1137
|
+
builtIn?: CampaignBuilderBuiltInTool;
|
|
1138
|
+
approvalRequired: boolean;
|
|
1139
|
+
customRoute: boolean;
|
|
1140
|
+
readOnlySetup: boolean;
|
|
1141
|
+
ready: boolean;
|
|
1142
|
+
blockers: string[];
|
|
1143
|
+
nextAction?: string;
|
|
1144
|
+
}
|
|
1145
|
+
interface CampaignBuilderReadinessGate {
|
|
1146
|
+
id: string;
|
|
1147
|
+
label: string;
|
|
1148
|
+
passed: boolean;
|
|
1149
|
+
detail: string;
|
|
1150
|
+
}
|
|
1151
|
+
interface CampaignBuilderReadinessSummary {
|
|
1152
|
+
ready: boolean;
|
|
1153
|
+
score: number;
|
|
1154
|
+
targetCount: number;
|
|
1155
|
+
estimatedCredits: number;
|
|
1156
|
+
builtInLanesReady: number;
|
|
1157
|
+
builtInLanesTotal: number;
|
|
1158
|
+
customRoutesReady: number;
|
|
1159
|
+
customRoutesTotal: number;
|
|
1160
|
+
approvalGateCount: number;
|
|
1161
|
+
blockers: string[];
|
|
1162
|
+
warnings: string[];
|
|
1163
|
+
}
|
|
1164
|
+
interface CampaignBuilderReadinessPacket {
|
|
1165
|
+
plan: CampaignBuilderAgentPlan;
|
|
1166
|
+
lanes: CampaignBuilderReadinessLane[];
|
|
1167
|
+
gates: CampaignBuilderReadinessGate[];
|
|
1168
|
+
summary: CampaignBuilderReadinessSummary;
|
|
1169
|
+
nextActions: string[];
|
|
1170
|
+
}
|
|
1129
1171
|
declare const DEFAULT_SIGNALIZ_CAMPAIGN_BUILDER_DEFAULTS: Required<Pick<SignalizCampaignBuilderDefaults, 'requireVerifiedEmail' | 'dedupKeys' | 'allowDownscale'>> & SignalizCampaignBuilderDefaults;
|
|
1130
1172
|
declare const DEFAULT_CAMPAIGN_BUILDER_BUILT_INS: CampaignBuilderBuiltInTool[];
|
|
1131
1173
|
declare const DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES: CampaignBuilderApprovalType[];
|
|
@@ -1135,6 +1177,7 @@ declare class CampaignBuilderAgent {
|
|
|
1135
1177
|
private client;
|
|
1136
1178
|
constructor(client: HttpClient);
|
|
1137
1179
|
createPlan(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderAgentPlan>;
|
|
1180
|
+
readiness(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderReadinessPacket>;
|
|
1138
1181
|
commitPlan(plan: CampaignBuilderAgentPlan, options?: CampaignBuilderPlanCommitOptions): Promise<CampaignBuilderPlanCommitResult>;
|
|
1139
1182
|
dryRunPlan(plan: CampaignBuilderAgentPlan, options?: BuildOptions): Promise<CampaignBuildResult>;
|
|
1140
1183
|
buildApprovedPlan(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval, options?: CampaignBuilderBuildOptions): Promise<CampaignBuildResult>;
|
|
@@ -1164,6 +1207,7 @@ declare function createCampaignBuilderAgentPlan(request: CampaignBuilderAgentReq
|
|
|
1164
1207
|
scopeBrainPreflight?: UnknownRecord$1;
|
|
1165
1208
|
warnings?: string[];
|
|
1166
1209
|
}): CampaignBuilderAgentPlan;
|
|
1210
|
+
declare function createCampaignBuilderReadiness(plan: CampaignBuilderAgentPlan): CampaignBuilderReadinessPacket;
|
|
1167
1211
|
declare function getMissingCampaignBuilderApprovals(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval): CampaignBuilderRequiredApproval[];
|
|
1168
1212
|
declare function createCampaignBuilderApproval(plan: CampaignBuilderAgentPlan, input: Omit<CampaignBuilderApproval, 'planId' | 'approvedAt'>): CampaignBuilderApproval;
|
|
1169
1213
|
declare function getCampaignBuilderStrategyTemplate(value: unknown): CampaignBuilderStrategyTemplate | undefined;
|
|
@@ -3424,4 +3468,4 @@ declare class Signaliz {
|
|
|
3424
3468
|
discover(query: string, category?: string): Promise<MCPToolInfo[]>;
|
|
3425
3469
|
}
|
|
3426
3470
|
|
|
3427
|
-
export { Ai, type ApproveDeliveryResult, type BuildOptions, CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS, CAMPAIGN_BUILDER_STRATEGY_TEMPLATES, type CampaignArtifact, type CampaignBuildRequest$1 as CampaignBuildRequest, type CampaignBuildResult$1 as CampaignBuildResult, type CampaignBuildRow, type CampaignBuildStatus, CampaignBuilderAgent, type CampaignBuilderAgentPlan, type CampaignBuilderAgentProvider, type CampaignBuilderAgentRequest, type CampaignBuilderAgentRequestTemplateOptions, type CampaignBuilderApproval, type CampaignBuilderApprovalPolicy, type CampaignBuilderApprovalType, type CampaignBuilderApprovedRunOptions, type CampaignBuilderApprovedRunResult, type CampaignBuilderBuildOptions, type CampaignBuilderBuiltInTool, type CampaignBuilderCustomerTool, type CampaignBuilderGtmLayer, type CampaignBuilderIntegrationRoute, type CampaignBuilderLayer, type CampaignBuilderMcpStep, type CampaignBuilderMemoryPlan, type CampaignBuilderMemoryQuery, type CampaignBuilderMemoryScope, type CampaignBuilderOperatingPlaybook, type CampaignBuilderOperatingPlaybookSlug, type CampaignBuilderPlanCommitOptions, type CampaignBuilderPlanCommitResult, type CampaignBuilderPlanOptions, type CampaignBuilderProvider, type CampaignBuilderRequiredApproval, type CampaignBuilderRouteMode, type CampaignBuilderStrategyTemplate, type CampaignBuilderStrategyTemplateSlug, type CampaignBuilderWorkspaceContext, type CampaignDeliveryMode, type CampaignProviderRouteReadback, type CampaignRowsOptions, type CampaignRowsResult, Campaigns, type CancelBuildResult, type CompanyIntelligenceParams, type CompanyIntelligenceResult, type CreateOutputSinkRequest, type CreateRoutineRequest, type CreateSystemParams, type CustomAiAttachment, type CustomAiFusionConfig, type CustomAiMultiModelParams, type CustomAiMultiModelResult, type CustomAiOutputField, DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES, DEFAULT_CAMPAIGN_BUILDER_BUILT_INS, DEFAULT_SIGNALIZ_CAMPAIGN_BUILDER_DEFAULTS, type EmailBatchJobResult, type EnrichSignalsParams, type EnrichSignalsResult, type ErrorType, type ExecutionReference, type ExecutionReferenceInput, type ExecutionReferenceKind, type FindAndVerifyEmailContact, type FindEmailParams, type FindEmailResult, type GenerateLeadsParams, type GenerateLocalLeadsParams, type GtmActorType, type GtmAuthStrategy, type GtmBrainAggregateCalibrationsInput, type GtmBrainAggregatePatternsInput, type GtmBrainCalibrateDeliverabilityInput, type GtmBrainDeliveryRiskInput, type GtmBrainDistillRunInput, type GtmBrainExtractPatternsInput, type GtmBrainFailurePatternsOptions, type GtmBrainLearningAction, type GtmBrainLearningCyclePhase, type GtmBrainLearningCyclePlanInput, type GtmBrainLearningCyclePlanResult, type GtmBrainLearningCycleRunInput, type GtmBrainLearningEvidenceCounts, type GtmBrainLearningLane, type GtmBrainLearningLaneId, type GtmBrainLearningLaneState, type GtmBrainLearningLaneSummary, type GtmBrainLearningPhaseReadiness, type GtmBrainLearningPhaseStatus, type GtmBrainLearningRecommendedToolCall, type GtmBrainPatternsOptions, type GtmBrainSeedDefaultsInput, type GtmCalibrationDimensionType, type GtmCampaignAgentPlanInput, type GtmCampaignAgentRequestTemplateInput, type GtmCampaignBuildPlanInput, type GtmCampaignCreateInput, type GtmCampaignGetOptions, type GtmCampaignHistoryCampaignInput, type GtmCampaignHistoryImportBatchInput, type GtmCampaignHistoryImportInput, type GtmCampaignHistoryImportRunInput, type GtmCampaignHistoryMemoryInput, type GtmCampaignLearningStatusResult, type GtmCampaignListOptions, type GtmCampaignLogInput, type GtmCampaignSource, type GtmCampaignStartContextInput, type GtmCampaignStatus, type GtmCampaignStrategyMemoryStatusInput, type GtmCampaignStrategyTemplateSlug, type GtmCampaignStrategyTemplatesOptions, type GtmCampaignUpdateInput, type GtmConnectionRegisterInput, type GtmConnectionsListOptions, type GtmExistingCampaignAuditBoundary, type GtmExistingCampaignAuditBySearchOptions, type GtmExistingCampaignAuditOptions, type GtmExistingCampaignAuditRecommendation, type GtmExistingCampaignAuditResult, type GtmExistingCampaignCompletenessStep, type GtmExistingCampaignDiscoverOptions, type GtmExistingCampaignDiscoveryResult, type GtmExistingCampaignMcpRequest, type GtmExistingCampaignOption, type GtmFeedbackIngestInput, type GtmIntegrationRecipeCreateInput, type GtmInvocationType, GtmKernel, type GtmKernelImportPreviewInput, type GtmKernelImportRunInput, type GtmLayer, type GtmLayerRouteSetInput, type GtmLayerRoutesGetOptions, type GtmMemorySearchOptions, type GtmMemoryType, type GtmPatternType, type GtmProviderLinkInput, type GtmProviderRecipePrepareInput, type GtmProviderRouteActivateInput, type GtmWebhookDeliverInput, type GtmWorkspaceBootstrapStatusOptions, type GtmWorkspaceContextOptions, type HttpRequestParams, type HttpRequestResult, type IcpDetail, type IcpSummary, Icps, type ImportOctaveResult, type LeadGenJobResult, type ListOutputSinksOptions, type MCPToolInfo, type NativeGtmCapabilityInfo, Ops, type OpsApproveRequest, type OpsApproveResult, type OpsBlueprint, type OpsCadence, type OpsCreateRequest, type OpsCreateResult, type OpsDashboardOptions, type OpsDashboardResult, type OpsDebugDiagnosticError, type OpsDebugOptions, type OpsDebugResult, type OpsPlanRequest, type OpsPlanResult, type OpsPrimitive, type OpsPrimitiveConcurrencyPolicy, type OpsPrimitiveDeadLetterPolicy, type OpsPrimitiveObservabilityPolicy, type OpsPrimitivePermissionLevel, type OpsPrimitiveRetryPolicy, type OpsPrimitiveWorkspaceScope, type OpsQueueStatus, type OpsQueueStatusOptions, type OpsQuickstartStep, type OpsQuickstartWorkflow, type OpsReadinessCheck, type OpsReadinessOptions, type OpsReadinessResult, type OpsReplayResult, type OpsResultsOptions, type OpsResultsResult, type OpsRoutine, type OpsRoutineDeleteResult, type OpsRoutineRunResult, type OpsRoutineSinkResult, type OpsRoutineStatus, type OpsRoutineTick, type OpsRoutineTickItem, type OpsRoutineTickItemsResult, type OpsRoutineTicksResult, type OpsRoutinesResult, type OpsRunOptions, type OpsRunResult, type OpsSink, type OpsSinkType, type OpsStatusOptions, type OpsStatusResult, type OpsTriggerBatchRunStatus, type OpsTriggerRunStatus, type OpsTriggerRunStatusOptions, type PlatformHealth, type RunNativeGtmCapabilityParams, type RunProgressEvent, type RunResult, type RunRoutineRequest, type RunSystemParams, type Signal, Signaliz, type SignalizCampaignBuilderDefaults, type SignalizConfig, SignalizError, type SignalizErrorData, type SimpleOpStatus, type SystemResult, type UpdateRoutineRequest, type VerifyEmailResult, type WaitOptions, type WorkspaceInfo, applyCampaignBuilderStrategyTemplate, collectExecutionReferences, createCampaignBuilderAgentPlan, createCampaignBuilderAgentRequestTemplate, createCampaignBuilderApproval, createCampaignBuilderToolRoute, getCampaignBuilderOperatingPlaybook, getCampaignBuilderOperatingPlaybooksForRequest, getCampaignBuilderStrategyTemplate, getMissingCampaignBuilderApprovals, normalizeExecutionReference };
|
|
3471
|
+
export { Ai, type ApproveDeliveryResult, type BuildOptions, CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS, CAMPAIGN_BUILDER_STRATEGY_TEMPLATES, type CampaignArtifact, type CampaignBuildRequest$1 as CampaignBuildRequest, type CampaignBuildResult$1 as CampaignBuildResult, type CampaignBuildRow, type CampaignBuildStatus, CampaignBuilderAgent, type CampaignBuilderAgentPlan, type CampaignBuilderAgentProvider, type CampaignBuilderAgentRequest, type CampaignBuilderAgentRequestTemplateOptions, type CampaignBuilderApproval, type CampaignBuilderApprovalPolicy, type CampaignBuilderApprovalType, type CampaignBuilderApprovedRunOptions, type CampaignBuilderApprovedRunResult, type CampaignBuilderBuildOptions, type CampaignBuilderBuiltInTool, type CampaignBuilderCustomerTool, type CampaignBuilderGtmLayer, type CampaignBuilderIntegrationRoute, type CampaignBuilderLayer, type CampaignBuilderMcpStep, type CampaignBuilderMemoryPlan, type CampaignBuilderMemoryQuery, type CampaignBuilderMemoryScope, type CampaignBuilderOperatingPlaybook, type CampaignBuilderOperatingPlaybookSlug, type CampaignBuilderPlanCommitOptions, type CampaignBuilderPlanCommitResult, type CampaignBuilderPlanOptions, type CampaignBuilderProvider, type CampaignBuilderReadinessGate, type CampaignBuilderReadinessLane, type CampaignBuilderReadinessPacket, type CampaignBuilderReadinessSummary, type CampaignBuilderRequiredApproval, type CampaignBuilderRouteMode, type CampaignBuilderStrategyTemplate, type CampaignBuilderStrategyTemplateSlug, type CampaignBuilderWorkspaceContext, type CampaignDeliveryMode, type CampaignProviderRouteReadback, type CampaignRowsOptions, type CampaignRowsResult, Campaigns, type CancelBuildResult, type CompanyIntelligenceParams, type CompanyIntelligenceResult, type CreateOutputSinkRequest, type CreateRoutineRequest, type CreateSystemParams, type CustomAiAttachment, type CustomAiFusionConfig, type CustomAiMultiModelParams, type CustomAiMultiModelResult, type CustomAiOutputField, DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES, DEFAULT_CAMPAIGN_BUILDER_BUILT_INS, DEFAULT_SIGNALIZ_CAMPAIGN_BUILDER_DEFAULTS, type EmailBatchJobResult, type EnrichSignalsParams, type EnrichSignalsResult, type ErrorType, type ExecutionReference, type ExecutionReferenceInput, type ExecutionReferenceKind, type FindAndVerifyEmailContact, type FindEmailParams, type FindEmailResult, type GenerateLeadsParams, type GenerateLocalLeadsParams, type GtmActorType, type GtmAuthStrategy, type GtmBrainAggregateCalibrationsInput, type GtmBrainAggregatePatternsInput, type GtmBrainCalibrateDeliverabilityInput, type GtmBrainDeliveryRiskInput, type GtmBrainDistillRunInput, type GtmBrainExtractPatternsInput, type GtmBrainFailurePatternsOptions, type GtmBrainLearningAction, type GtmBrainLearningCyclePhase, type GtmBrainLearningCyclePlanInput, type GtmBrainLearningCyclePlanResult, type GtmBrainLearningCycleRunInput, type GtmBrainLearningEvidenceCounts, type GtmBrainLearningLane, type GtmBrainLearningLaneId, type GtmBrainLearningLaneState, type GtmBrainLearningLaneSummary, type GtmBrainLearningPhaseReadiness, type GtmBrainLearningPhaseStatus, type GtmBrainLearningRecommendedToolCall, type GtmBrainPatternsOptions, type GtmBrainSeedDefaultsInput, type GtmCalibrationDimensionType, type GtmCampaignAgentPlanInput, type GtmCampaignAgentRequestTemplateInput, type GtmCampaignBuildPlanInput, type GtmCampaignCreateInput, type GtmCampaignGetOptions, type GtmCampaignHistoryCampaignInput, type GtmCampaignHistoryImportBatchInput, type GtmCampaignHistoryImportInput, type GtmCampaignHistoryImportRunInput, type GtmCampaignHistoryMemoryInput, type GtmCampaignLearningStatusResult, type GtmCampaignListOptions, type GtmCampaignLogInput, type GtmCampaignSource, type GtmCampaignStartContextInput, type GtmCampaignStatus, type GtmCampaignStrategyMemoryStatusInput, type GtmCampaignStrategyTemplateSlug, type GtmCampaignStrategyTemplatesOptions, type GtmCampaignUpdateInput, type GtmConnectionRegisterInput, type GtmConnectionsListOptions, type GtmExistingCampaignAuditBoundary, type GtmExistingCampaignAuditBySearchOptions, type GtmExistingCampaignAuditOptions, type GtmExistingCampaignAuditRecommendation, type GtmExistingCampaignAuditResult, type GtmExistingCampaignCompletenessStep, type GtmExistingCampaignDiscoverOptions, type GtmExistingCampaignDiscoveryResult, type GtmExistingCampaignMcpRequest, type GtmExistingCampaignOption, type GtmFeedbackIngestInput, type GtmIntegrationRecipeCreateInput, type GtmInvocationType, GtmKernel, type GtmKernelImportPreviewInput, type GtmKernelImportRunInput, type GtmLayer, type GtmLayerRouteSetInput, type GtmLayerRoutesGetOptions, type GtmMemorySearchOptions, type GtmMemoryType, type GtmPatternType, type GtmProviderLinkInput, type GtmProviderRecipePrepareInput, type GtmProviderRouteActivateInput, type GtmWebhookDeliverInput, type GtmWorkspaceBootstrapStatusOptions, type GtmWorkspaceContextOptions, type HttpRequestParams, type HttpRequestResult, type IcpDetail, type IcpSummary, Icps, type ImportOctaveResult, type LeadGenJobResult, type ListOutputSinksOptions, type MCPToolInfo, type NativeGtmCapabilityInfo, Ops, type OpsApproveRequest, type OpsApproveResult, type OpsBlueprint, type OpsCadence, type OpsCreateRequest, type OpsCreateResult, type OpsDashboardOptions, type OpsDashboardResult, type OpsDebugDiagnosticError, type OpsDebugOptions, type OpsDebugResult, type OpsPlanRequest, type OpsPlanResult, type OpsPrimitive, type OpsPrimitiveConcurrencyPolicy, type OpsPrimitiveDeadLetterPolicy, type OpsPrimitiveObservabilityPolicy, type OpsPrimitivePermissionLevel, type OpsPrimitiveRetryPolicy, type OpsPrimitiveWorkspaceScope, type OpsQueueStatus, type OpsQueueStatusOptions, type OpsQuickstartStep, type OpsQuickstartWorkflow, type OpsReadinessCheck, type OpsReadinessOptions, type OpsReadinessResult, type OpsReplayResult, type OpsResultsOptions, type OpsResultsResult, type OpsRoutine, type OpsRoutineDeleteResult, type OpsRoutineRunResult, type OpsRoutineSinkResult, type OpsRoutineStatus, type OpsRoutineTick, type OpsRoutineTickItem, type OpsRoutineTickItemsResult, type OpsRoutineTicksResult, type OpsRoutinesResult, type OpsRunOptions, type OpsRunResult, type OpsSink, type OpsSinkType, type OpsStatusOptions, type OpsStatusResult, type OpsTriggerBatchRunStatus, type OpsTriggerRunStatus, type OpsTriggerRunStatusOptions, type PlatformHealth, type RunNativeGtmCapabilityParams, type RunProgressEvent, type RunResult, type RunRoutineRequest, type RunSystemParams, type Signal, Signaliz, type SignalizCampaignBuilderDefaults, type SignalizConfig, SignalizError, type SignalizErrorData, type SimpleOpStatus, type SystemResult, type UpdateRoutineRequest, type VerifyEmailResult, type WaitOptions, type WorkspaceInfo, applyCampaignBuilderStrategyTemplate, collectExecutionReferences, createCampaignBuilderAgentPlan, createCampaignBuilderAgentRequestTemplate, createCampaignBuilderApproval, createCampaignBuilderReadiness, createCampaignBuilderToolRoute, getCampaignBuilderOperatingPlaybook, getCampaignBuilderOperatingPlaybooksForRequest, getCampaignBuilderStrategyTemplate, getMissingCampaignBuilderApprovals, normalizeExecutionReference };
|
package/dist/index.d.ts
CHANGED
|
@@ -1126,6 +1126,48 @@ interface CampaignBuilderBuildReview {
|
|
|
1126
1126
|
summary: CampaignBuilderBuildReviewSummary;
|
|
1127
1127
|
nextActions: string[];
|
|
1128
1128
|
}
|
|
1129
|
+
interface CampaignBuilderReadinessLane {
|
|
1130
|
+
id: string;
|
|
1131
|
+
label: string;
|
|
1132
|
+
layer: CampaignBuilderLayer;
|
|
1133
|
+
gtmLayers: string[];
|
|
1134
|
+
provider: CampaignBuilderProvider;
|
|
1135
|
+
toolName?: string;
|
|
1136
|
+
mode: CampaignBuilderRouteMode;
|
|
1137
|
+
builtIn?: CampaignBuilderBuiltInTool;
|
|
1138
|
+
approvalRequired: boolean;
|
|
1139
|
+
customRoute: boolean;
|
|
1140
|
+
readOnlySetup: boolean;
|
|
1141
|
+
ready: boolean;
|
|
1142
|
+
blockers: string[];
|
|
1143
|
+
nextAction?: string;
|
|
1144
|
+
}
|
|
1145
|
+
interface CampaignBuilderReadinessGate {
|
|
1146
|
+
id: string;
|
|
1147
|
+
label: string;
|
|
1148
|
+
passed: boolean;
|
|
1149
|
+
detail: string;
|
|
1150
|
+
}
|
|
1151
|
+
interface CampaignBuilderReadinessSummary {
|
|
1152
|
+
ready: boolean;
|
|
1153
|
+
score: number;
|
|
1154
|
+
targetCount: number;
|
|
1155
|
+
estimatedCredits: number;
|
|
1156
|
+
builtInLanesReady: number;
|
|
1157
|
+
builtInLanesTotal: number;
|
|
1158
|
+
customRoutesReady: number;
|
|
1159
|
+
customRoutesTotal: number;
|
|
1160
|
+
approvalGateCount: number;
|
|
1161
|
+
blockers: string[];
|
|
1162
|
+
warnings: string[];
|
|
1163
|
+
}
|
|
1164
|
+
interface CampaignBuilderReadinessPacket {
|
|
1165
|
+
plan: CampaignBuilderAgentPlan;
|
|
1166
|
+
lanes: CampaignBuilderReadinessLane[];
|
|
1167
|
+
gates: CampaignBuilderReadinessGate[];
|
|
1168
|
+
summary: CampaignBuilderReadinessSummary;
|
|
1169
|
+
nextActions: string[];
|
|
1170
|
+
}
|
|
1129
1171
|
declare const DEFAULT_SIGNALIZ_CAMPAIGN_BUILDER_DEFAULTS: Required<Pick<SignalizCampaignBuilderDefaults, 'requireVerifiedEmail' | 'dedupKeys' | 'allowDownscale'>> & SignalizCampaignBuilderDefaults;
|
|
1130
1172
|
declare const DEFAULT_CAMPAIGN_BUILDER_BUILT_INS: CampaignBuilderBuiltInTool[];
|
|
1131
1173
|
declare const DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES: CampaignBuilderApprovalType[];
|
|
@@ -1135,6 +1177,7 @@ declare class CampaignBuilderAgent {
|
|
|
1135
1177
|
private client;
|
|
1136
1178
|
constructor(client: HttpClient);
|
|
1137
1179
|
createPlan(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderAgentPlan>;
|
|
1180
|
+
readiness(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderReadinessPacket>;
|
|
1138
1181
|
commitPlan(plan: CampaignBuilderAgentPlan, options?: CampaignBuilderPlanCommitOptions): Promise<CampaignBuilderPlanCommitResult>;
|
|
1139
1182
|
dryRunPlan(plan: CampaignBuilderAgentPlan, options?: BuildOptions): Promise<CampaignBuildResult>;
|
|
1140
1183
|
buildApprovedPlan(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval, options?: CampaignBuilderBuildOptions): Promise<CampaignBuildResult>;
|
|
@@ -1164,6 +1207,7 @@ declare function createCampaignBuilderAgentPlan(request: CampaignBuilderAgentReq
|
|
|
1164
1207
|
scopeBrainPreflight?: UnknownRecord$1;
|
|
1165
1208
|
warnings?: string[];
|
|
1166
1209
|
}): CampaignBuilderAgentPlan;
|
|
1210
|
+
declare function createCampaignBuilderReadiness(plan: CampaignBuilderAgentPlan): CampaignBuilderReadinessPacket;
|
|
1167
1211
|
declare function getMissingCampaignBuilderApprovals(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval): CampaignBuilderRequiredApproval[];
|
|
1168
1212
|
declare function createCampaignBuilderApproval(plan: CampaignBuilderAgentPlan, input: Omit<CampaignBuilderApproval, 'planId' | 'approvedAt'>): CampaignBuilderApproval;
|
|
1169
1213
|
declare function getCampaignBuilderStrategyTemplate(value: unknown): CampaignBuilderStrategyTemplate | undefined;
|
|
@@ -3424,4 +3468,4 @@ declare class Signaliz {
|
|
|
3424
3468
|
discover(query: string, category?: string): Promise<MCPToolInfo[]>;
|
|
3425
3469
|
}
|
|
3426
3470
|
|
|
3427
|
-
export { Ai, type ApproveDeliveryResult, type BuildOptions, CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS, CAMPAIGN_BUILDER_STRATEGY_TEMPLATES, type CampaignArtifact, type CampaignBuildRequest$1 as CampaignBuildRequest, type CampaignBuildResult$1 as CampaignBuildResult, type CampaignBuildRow, type CampaignBuildStatus, CampaignBuilderAgent, type CampaignBuilderAgentPlan, type CampaignBuilderAgentProvider, type CampaignBuilderAgentRequest, type CampaignBuilderAgentRequestTemplateOptions, type CampaignBuilderApproval, type CampaignBuilderApprovalPolicy, type CampaignBuilderApprovalType, type CampaignBuilderApprovedRunOptions, type CampaignBuilderApprovedRunResult, type CampaignBuilderBuildOptions, type CampaignBuilderBuiltInTool, type CampaignBuilderCustomerTool, type CampaignBuilderGtmLayer, type CampaignBuilderIntegrationRoute, type CampaignBuilderLayer, type CampaignBuilderMcpStep, type CampaignBuilderMemoryPlan, type CampaignBuilderMemoryQuery, type CampaignBuilderMemoryScope, type CampaignBuilderOperatingPlaybook, type CampaignBuilderOperatingPlaybookSlug, type CampaignBuilderPlanCommitOptions, type CampaignBuilderPlanCommitResult, type CampaignBuilderPlanOptions, type CampaignBuilderProvider, type CampaignBuilderRequiredApproval, type CampaignBuilderRouteMode, type CampaignBuilderStrategyTemplate, type CampaignBuilderStrategyTemplateSlug, type CampaignBuilderWorkspaceContext, type CampaignDeliveryMode, type CampaignProviderRouteReadback, type CampaignRowsOptions, type CampaignRowsResult, Campaigns, type CancelBuildResult, type CompanyIntelligenceParams, type CompanyIntelligenceResult, type CreateOutputSinkRequest, type CreateRoutineRequest, type CreateSystemParams, type CustomAiAttachment, type CustomAiFusionConfig, type CustomAiMultiModelParams, type CustomAiMultiModelResult, type CustomAiOutputField, DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES, DEFAULT_CAMPAIGN_BUILDER_BUILT_INS, DEFAULT_SIGNALIZ_CAMPAIGN_BUILDER_DEFAULTS, type EmailBatchJobResult, type EnrichSignalsParams, type EnrichSignalsResult, type ErrorType, type ExecutionReference, type ExecutionReferenceInput, type ExecutionReferenceKind, type FindAndVerifyEmailContact, type FindEmailParams, type FindEmailResult, type GenerateLeadsParams, type GenerateLocalLeadsParams, type GtmActorType, type GtmAuthStrategy, type GtmBrainAggregateCalibrationsInput, type GtmBrainAggregatePatternsInput, type GtmBrainCalibrateDeliverabilityInput, type GtmBrainDeliveryRiskInput, type GtmBrainDistillRunInput, type GtmBrainExtractPatternsInput, type GtmBrainFailurePatternsOptions, type GtmBrainLearningAction, type GtmBrainLearningCyclePhase, type GtmBrainLearningCyclePlanInput, type GtmBrainLearningCyclePlanResult, type GtmBrainLearningCycleRunInput, type GtmBrainLearningEvidenceCounts, type GtmBrainLearningLane, type GtmBrainLearningLaneId, type GtmBrainLearningLaneState, type GtmBrainLearningLaneSummary, type GtmBrainLearningPhaseReadiness, type GtmBrainLearningPhaseStatus, type GtmBrainLearningRecommendedToolCall, type GtmBrainPatternsOptions, type GtmBrainSeedDefaultsInput, type GtmCalibrationDimensionType, type GtmCampaignAgentPlanInput, type GtmCampaignAgentRequestTemplateInput, type GtmCampaignBuildPlanInput, type GtmCampaignCreateInput, type GtmCampaignGetOptions, type GtmCampaignHistoryCampaignInput, type GtmCampaignHistoryImportBatchInput, type GtmCampaignHistoryImportInput, type GtmCampaignHistoryImportRunInput, type GtmCampaignHistoryMemoryInput, type GtmCampaignLearningStatusResult, type GtmCampaignListOptions, type GtmCampaignLogInput, type GtmCampaignSource, type GtmCampaignStartContextInput, type GtmCampaignStatus, type GtmCampaignStrategyMemoryStatusInput, type GtmCampaignStrategyTemplateSlug, type GtmCampaignStrategyTemplatesOptions, type GtmCampaignUpdateInput, type GtmConnectionRegisterInput, type GtmConnectionsListOptions, type GtmExistingCampaignAuditBoundary, type GtmExistingCampaignAuditBySearchOptions, type GtmExistingCampaignAuditOptions, type GtmExistingCampaignAuditRecommendation, type GtmExistingCampaignAuditResult, type GtmExistingCampaignCompletenessStep, type GtmExistingCampaignDiscoverOptions, type GtmExistingCampaignDiscoveryResult, type GtmExistingCampaignMcpRequest, type GtmExistingCampaignOption, type GtmFeedbackIngestInput, type GtmIntegrationRecipeCreateInput, type GtmInvocationType, GtmKernel, type GtmKernelImportPreviewInput, type GtmKernelImportRunInput, type GtmLayer, type GtmLayerRouteSetInput, type GtmLayerRoutesGetOptions, type GtmMemorySearchOptions, type GtmMemoryType, type GtmPatternType, type GtmProviderLinkInput, type GtmProviderRecipePrepareInput, type GtmProviderRouteActivateInput, type GtmWebhookDeliverInput, type GtmWorkspaceBootstrapStatusOptions, type GtmWorkspaceContextOptions, type HttpRequestParams, type HttpRequestResult, type IcpDetail, type IcpSummary, Icps, type ImportOctaveResult, type LeadGenJobResult, type ListOutputSinksOptions, type MCPToolInfo, type NativeGtmCapabilityInfo, Ops, type OpsApproveRequest, type OpsApproveResult, type OpsBlueprint, type OpsCadence, type OpsCreateRequest, type OpsCreateResult, type OpsDashboardOptions, type OpsDashboardResult, type OpsDebugDiagnosticError, type OpsDebugOptions, type OpsDebugResult, type OpsPlanRequest, type OpsPlanResult, type OpsPrimitive, type OpsPrimitiveConcurrencyPolicy, type OpsPrimitiveDeadLetterPolicy, type OpsPrimitiveObservabilityPolicy, type OpsPrimitivePermissionLevel, type OpsPrimitiveRetryPolicy, type OpsPrimitiveWorkspaceScope, type OpsQueueStatus, type OpsQueueStatusOptions, type OpsQuickstartStep, type OpsQuickstartWorkflow, type OpsReadinessCheck, type OpsReadinessOptions, type OpsReadinessResult, type OpsReplayResult, type OpsResultsOptions, type OpsResultsResult, type OpsRoutine, type OpsRoutineDeleteResult, type OpsRoutineRunResult, type OpsRoutineSinkResult, type OpsRoutineStatus, type OpsRoutineTick, type OpsRoutineTickItem, type OpsRoutineTickItemsResult, type OpsRoutineTicksResult, type OpsRoutinesResult, type OpsRunOptions, type OpsRunResult, type OpsSink, type OpsSinkType, type OpsStatusOptions, type OpsStatusResult, type OpsTriggerBatchRunStatus, type OpsTriggerRunStatus, type OpsTriggerRunStatusOptions, type PlatformHealth, type RunNativeGtmCapabilityParams, type RunProgressEvent, type RunResult, type RunRoutineRequest, type RunSystemParams, type Signal, Signaliz, type SignalizCampaignBuilderDefaults, type SignalizConfig, SignalizError, type SignalizErrorData, type SimpleOpStatus, type SystemResult, type UpdateRoutineRequest, type VerifyEmailResult, type WaitOptions, type WorkspaceInfo, applyCampaignBuilderStrategyTemplate, collectExecutionReferences, createCampaignBuilderAgentPlan, createCampaignBuilderAgentRequestTemplate, createCampaignBuilderApproval, createCampaignBuilderToolRoute, getCampaignBuilderOperatingPlaybook, getCampaignBuilderOperatingPlaybooksForRequest, getCampaignBuilderStrategyTemplate, getMissingCampaignBuilderApprovals, normalizeExecutionReference };
|
|
3471
|
+
export { Ai, type ApproveDeliveryResult, type BuildOptions, CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS, CAMPAIGN_BUILDER_STRATEGY_TEMPLATES, type CampaignArtifact, type CampaignBuildRequest$1 as CampaignBuildRequest, type CampaignBuildResult$1 as CampaignBuildResult, type CampaignBuildRow, type CampaignBuildStatus, CampaignBuilderAgent, type CampaignBuilderAgentPlan, type CampaignBuilderAgentProvider, type CampaignBuilderAgentRequest, type CampaignBuilderAgentRequestTemplateOptions, type CampaignBuilderApproval, type CampaignBuilderApprovalPolicy, type CampaignBuilderApprovalType, type CampaignBuilderApprovedRunOptions, type CampaignBuilderApprovedRunResult, type CampaignBuilderBuildOptions, type CampaignBuilderBuiltInTool, type CampaignBuilderCustomerTool, type CampaignBuilderGtmLayer, type CampaignBuilderIntegrationRoute, type CampaignBuilderLayer, type CampaignBuilderMcpStep, type CampaignBuilderMemoryPlan, type CampaignBuilderMemoryQuery, type CampaignBuilderMemoryScope, type CampaignBuilderOperatingPlaybook, type CampaignBuilderOperatingPlaybookSlug, type CampaignBuilderPlanCommitOptions, type CampaignBuilderPlanCommitResult, type CampaignBuilderPlanOptions, type CampaignBuilderProvider, type CampaignBuilderReadinessGate, type CampaignBuilderReadinessLane, type CampaignBuilderReadinessPacket, type CampaignBuilderReadinessSummary, type CampaignBuilderRequiredApproval, type CampaignBuilderRouteMode, type CampaignBuilderStrategyTemplate, type CampaignBuilderStrategyTemplateSlug, type CampaignBuilderWorkspaceContext, type CampaignDeliveryMode, type CampaignProviderRouteReadback, type CampaignRowsOptions, type CampaignRowsResult, Campaigns, type CancelBuildResult, type CompanyIntelligenceParams, type CompanyIntelligenceResult, type CreateOutputSinkRequest, type CreateRoutineRequest, type CreateSystemParams, type CustomAiAttachment, type CustomAiFusionConfig, type CustomAiMultiModelParams, type CustomAiMultiModelResult, type CustomAiOutputField, DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES, DEFAULT_CAMPAIGN_BUILDER_BUILT_INS, DEFAULT_SIGNALIZ_CAMPAIGN_BUILDER_DEFAULTS, type EmailBatchJobResult, type EnrichSignalsParams, type EnrichSignalsResult, type ErrorType, type ExecutionReference, type ExecutionReferenceInput, type ExecutionReferenceKind, type FindAndVerifyEmailContact, type FindEmailParams, type FindEmailResult, type GenerateLeadsParams, type GenerateLocalLeadsParams, type GtmActorType, type GtmAuthStrategy, type GtmBrainAggregateCalibrationsInput, type GtmBrainAggregatePatternsInput, type GtmBrainCalibrateDeliverabilityInput, type GtmBrainDeliveryRiskInput, type GtmBrainDistillRunInput, type GtmBrainExtractPatternsInput, type GtmBrainFailurePatternsOptions, type GtmBrainLearningAction, type GtmBrainLearningCyclePhase, type GtmBrainLearningCyclePlanInput, type GtmBrainLearningCyclePlanResult, type GtmBrainLearningCycleRunInput, type GtmBrainLearningEvidenceCounts, type GtmBrainLearningLane, type GtmBrainLearningLaneId, type GtmBrainLearningLaneState, type GtmBrainLearningLaneSummary, type GtmBrainLearningPhaseReadiness, type GtmBrainLearningPhaseStatus, type GtmBrainLearningRecommendedToolCall, type GtmBrainPatternsOptions, type GtmBrainSeedDefaultsInput, type GtmCalibrationDimensionType, type GtmCampaignAgentPlanInput, type GtmCampaignAgentRequestTemplateInput, type GtmCampaignBuildPlanInput, type GtmCampaignCreateInput, type GtmCampaignGetOptions, type GtmCampaignHistoryCampaignInput, type GtmCampaignHistoryImportBatchInput, type GtmCampaignHistoryImportInput, type GtmCampaignHistoryImportRunInput, type GtmCampaignHistoryMemoryInput, type GtmCampaignLearningStatusResult, type GtmCampaignListOptions, type GtmCampaignLogInput, type GtmCampaignSource, type GtmCampaignStartContextInput, type GtmCampaignStatus, type GtmCampaignStrategyMemoryStatusInput, type GtmCampaignStrategyTemplateSlug, type GtmCampaignStrategyTemplatesOptions, type GtmCampaignUpdateInput, type GtmConnectionRegisterInput, type GtmConnectionsListOptions, type GtmExistingCampaignAuditBoundary, type GtmExistingCampaignAuditBySearchOptions, type GtmExistingCampaignAuditOptions, type GtmExistingCampaignAuditRecommendation, type GtmExistingCampaignAuditResult, type GtmExistingCampaignCompletenessStep, type GtmExistingCampaignDiscoverOptions, type GtmExistingCampaignDiscoveryResult, type GtmExistingCampaignMcpRequest, type GtmExistingCampaignOption, type GtmFeedbackIngestInput, type GtmIntegrationRecipeCreateInput, type GtmInvocationType, GtmKernel, type GtmKernelImportPreviewInput, type GtmKernelImportRunInput, type GtmLayer, type GtmLayerRouteSetInput, type GtmLayerRoutesGetOptions, type GtmMemorySearchOptions, type GtmMemoryType, type GtmPatternType, type GtmProviderLinkInput, type GtmProviderRecipePrepareInput, type GtmProviderRouteActivateInput, type GtmWebhookDeliverInput, type GtmWorkspaceBootstrapStatusOptions, type GtmWorkspaceContextOptions, type HttpRequestParams, type HttpRequestResult, type IcpDetail, type IcpSummary, Icps, type ImportOctaveResult, type LeadGenJobResult, type ListOutputSinksOptions, type MCPToolInfo, type NativeGtmCapabilityInfo, Ops, type OpsApproveRequest, type OpsApproveResult, type OpsBlueprint, type OpsCadence, type OpsCreateRequest, type OpsCreateResult, type OpsDashboardOptions, type OpsDashboardResult, type OpsDebugDiagnosticError, type OpsDebugOptions, type OpsDebugResult, type OpsPlanRequest, type OpsPlanResult, type OpsPrimitive, type OpsPrimitiveConcurrencyPolicy, type OpsPrimitiveDeadLetterPolicy, type OpsPrimitiveObservabilityPolicy, type OpsPrimitivePermissionLevel, type OpsPrimitiveRetryPolicy, type OpsPrimitiveWorkspaceScope, type OpsQueueStatus, type OpsQueueStatusOptions, type OpsQuickstartStep, type OpsQuickstartWorkflow, type OpsReadinessCheck, type OpsReadinessOptions, type OpsReadinessResult, type OpsReplayResult, type OpsResultsOptions, type OpsResultsResult, type OpsRoutine, type OpsRoutineDeleteResult, type OpsRoutineRunResult, type OpsRoutineSinkResult, type OpsRoutineStatus, type OpsRoutineTick, type OpsRoutineTickItem, type OpsRoutineTickItemsResult, type OpsRoutineTicksResult, type OpsRoutinesResult, type OpsRunOptions, type OpsRunResult, type OpsSink, type OpsSinkType, type OpsStatusOptions, type OpsStatusResult, type OpsTriggerBatchRunStatus, type OpsTriggerRunStatus, type OpsTriggerRunStatusOptions, type PlatformHealth, type RunNativeGtmCapabilityParams, type RunProgressEvent, type RunResult, type RunRoutineRequest, type RunSystemParams, type Signal, Signaliz, type SignalizCampaignBuilderDefaults, type SignalizConfig, SignalizError, type SignalizErrorData, type SimpleOpStatus, type SystemResult, type UpdateRoutineRequest, type VerifyEmailResult, type WaitOptions, type WorkspaceInfo, applyCampaignBuilderStrategyTemplate, collectExecutionReferences, createCampaignBuilderAgentPlan, createCampaignBuilderAgentRequestTemplate, createCampaignBuilderApproval, createCampaignBuilderReadiness, createCampaignBuilderToolRoute, getCampaignBuilderOperatingPlaybook, getCampaignBuilderOperatingPlaybooksForRequest, getCampaignBuilderStrategyTemplate, getMissingCampaignBuilderApprovals, normalizeExecutionReference };
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
createCampaignBuilderAgentPlan: () => createCampaignBuilderAgentPlan,
|
|
39
39
|
createCampaignBuilderAgentRequestTemplate: () => createCampaignBuilderAgentRequestTemplate,
|
|
40
40
|
createCampaignBuilderApproval: () => createCampaignBuilderApproval,
|
|
41
|
+
createCampaignBuilderReadiness: () => createCampaignBuilderReadiness,
|
|
41
42
|
createCampaignBuilderToolRoute: () => createCampaignBuilderToolRoute,
|
|
42
43
|
getCampaignBuilderOperatingPlaybook: () => getCampaignBuilderOperatingPlaybook,
|
|
43
44
|
getCampaignBuilderOperatingPlaybooksForRequest: () => getCampaignBuilderOperatingPlaybooksForRequest,
|
|
@@ -1240,6 +1241,13 @@ var DEFAULT_CAMPAIGN_BUILDER_BUILT_INS = [
|
|
|
1240
1241
|
"email_verification",
|
|
1241
1242
|
"signals"
|
|
1242
1243
|
];
|
|
1244
|
+
var CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS = {
|
|
1245
|
+
lead_generation: "signaliz-lead-generation",
|
|
1246
|
+
local_leads: "signaliz-local-leads",
|
|
1247
|
+
email_finding: "signaliz-email-finding",
|
|
1248
|
+
email_verification: "signaliz-email-verification",
|
|
1249
|
+
signals: "signaliz-signals"
|
|
1250
|
+
};
|
|
1243
1251
|
var DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES = [
|
|
1244
1252
|
"memory_retrieval",
|
|
1245
1253
|
"spend",
|
|
@@ -1736,6 +1744,10 @@ var CampaignBuilderAgent = class {
|
|
|
1736
1744
|
}
|
|
1737
1745
|
return plan;
|
|
1738
1746
|
}
|
|
1747
|
+
async readiness(request, options = {}) {
|
|
1748
|
+
const plan = await this.createPlan(request, options);
|
|
1749
|
+
return createCampaignBuilderReadiness(plan);
|
|
1750
|
+
}
|
|
1739
1751
|
async commitPlan(plan, options = {}) {
|
|
1740
1752
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1741
1753
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2096,6 +2108,91 @@ function createCampaignBuilderAgentPlan(request, context = {}) {
|
|
|
2096
2108
|
warnings: context.warnings ?? []
|
|
2097
2109
|
};
|
|
2098
2110
|
}
|
|
2111
|
+
function createCampaignBuilderReadiness(plan) {
|
|
2112
|
+
const lanes = plan.routes.map((route) => createCampaignBuilderReadinessLane(route, plan));
|
|
2113
|
+
const builtInLanes = lanes.filter((lane) => lane.builtIn);
|
|
2114
|
+
const customRoutes = lanes.filter((lane) => lane.customRoute);
|
|
2115
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2116
|
+
const deliveryRisk = asRecord(plan.buildRequest.deliveryRisk);
|
|
2117
|
+
const deliveryRiskBlockers = arrayOfStrings(deliveryRisk.blockers) ?? [];
|
|
2118
|
+
const deliveryRiskValue = asRecord(deliveryRisk.risk);
|
|
2119
|
+
const deliveryRiskLevel = stringValue(deliveryRiskValue.risk_level ?? deliveryRiskValue.riskLevel);
|
|
2120
|
+
const memoryReady = !plan.strategyMemoryStatus || strategyMemory.ready !== false;
|
|
2121
|
+
const kernelPlanReady = Object.keys(asRecord(plan.kernelPlan)).length > 0;
|
|
2122
|
+
const deliveryRiskReady = !plan.buildRequest.deliveryRisk || deliveryRiskBlockers.length === 0 && !["high", "critical", "blocked"].includes(String(deliveryRiskLevel ?? "").toLowerCase());
|
|
2123
|
+
const builtInsReady = builtInLanes.length > 0 && builtInLanes.every((lane) => lane.ready);
|
|
2124
|
+
const customRoutesReady = customRoutes.every((lane) => lane.ready);
|
|
2125
|
+
const approvalGatesReady = plan.approvals.length > 0;
|
|
2126
|
+
const gates = [
|
|
2127
|
+
{
|
|
2128
|
+
id: "campaign_plan_created",
|
|
2129
|
+
label: "Campaign plan created",
|
|
2130
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2131
|
+
detail: plan.planId ? `Plan ${plan.planId} has ${plan.mcpFlow.length} MCP step(s).` : "No campaign-builder plan was created."
|
|
2132
|
+
},
|
|
2133
|
+
{
|
|
2134
|
+
id: "built_in_lanes_ready",
|
|
2135
|
+
label: "Built-in lanes ready",
|
|
2136
|
+
passed: builtInsReady,
|
|
2137
|
+
detail: `${builtInLanes.filter((lane) => lane.ready).length}/${builtInLanes.length} Signaliz built-in lane(s) are present.`
|
|
2138
|
+
},
|
|
2139
|
+
{
|
|
2140
|
+
id: "strategy_memory_ready",
|
|
2141
|
+
label: "Strategy memory ready",
|
|
2142
|
+
passed: memoryReady,
|
|
2143
|
+
detail: plan.strategyMemoryStatus ? "Strategy memory readiness was checked." : "Strategy memory readiness was not requested."
|
|
2144
|
+
},
|
|
2145
|
+
{
|
|
2146
|
+
id: "kernel_plan_attached",
|
|
2147
|
+
label: "Kernel plan attached",
|
|
2148
|
+
passed: kernelPlanReady,
|
|
2149
|
+
detail: kernelPlanReady ? "Kernel planner evidence is attached." : "Kernel planner evidence is not attached."
|
|
2150
|
+
},
|
|
2151
|
+
{
|
|
2152
|
+
id: "delivery_risk_clear",
|
|
2153
|
+
label: "Delivery risk clear",
|
|
2154
|
+
passed: deliveryRiskReady,
|
|
2155
|
+
detail: plan.buildRequest.deliveryRisk ? `Delivery risk is ${deliveryRiskLevel || "available"} with ${deliveryRiskBlockers.length} blocker(s).` : "Delivery risk preflight was not requested."
|
|
2156
|
+
},
|
|
2157
|
+
{
|
|
2158
|
+
id: "custom_routes_prepared",
|
|
2159
|
+
label: "Custom routes prepared",
|
|
2160
|
+
passed: customRoutesReady,
|
|
2161
|
+
detail: customRoutes.length === 0 ? "No BYO routes were requested." : `${customRoutes.filter((lane) => lane.ready).length}/${customRoutes.length} BYO route(s) have read-only setup steps.`
|
|
2162
|
+
},
|
|
2163
|
+
{
|
|
2164
|
+
id: "approval_gates_present",
|
|
2165
|
+
label: "Approval gates present",
|
|
2166
|
+
passed: approvalGatesReady,
|
|
2167
|
+
detail: approvalGatesReady ? `${plan.approvals.length} approval gate(s) are attached.` : "No approval gates are attached."
|
|
2168
|
+
}
|
|
2169
|
+
];
|
|
2170
|
+
const blockers = [
|
|
2171
|
+
...gates.filter((gate) => !gate.passed).map((gate) => gate.detail),
|
|
2172
|
+
...lanes.flatMap((lane) => lane.blockers)
|
|
2173
|
+
];
|
|
2174
|
+
const score = gates.length === 0 ? 0 : Math.round(gates.filter((gate) => gate.passed).length / gates.length * 100);
|
|
2175
|
+
const ready = blockers.length === 0;
|
|
2176
|
+
return {
|
|
2177
|
+
plan,
|
|
2178
|
+
lanes,
|
|
2179
|
+
gates,
|
|
2180
|
+
summary: {
|
|
2181
|
+
ready,
|
|
2182
|
+
score,
|
|
2183
|
+
targetCount: plan.targetCount,
|
|
2184
|
+
estimatedCredits: plan.estimatedCredits,
|
|
2185
|
+
builtInLanesReady: builtInLanes.filter((lane) => lane.ready).length,
|
|
2186
|
+
builtInLanesTotal: builtInLanes.length,
|
|
2187
|
+
customRoutesReady: customRoutes.filter((lane) => lane.ready).length,
|
|
2188
|
+
customRoutesTotal: customRoutes.length,
|
|
2189
|
+
approvalGateCount: plan.approvals.length,
|
|
2190
|
+
blockers,
|
|
2191
|
+
warnings: plan.warnings
|
|
2192
|
+
},
|
|
2193
|
+
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2099
2196
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2100
2197
|
if (approval.planId !== plan.planId) {
|
|
2101
2198
|
return plan.approvals;
|
|
@@ -3473,6 +3570,71 @@ function campaignReviewRowHasCopy(row) {
|
|
|
3473
3570
|
stringValue(data.subject) || stringValue(data.subject_line) || stringValue(data.subjectLine) || stringValue(data.opener) || stringValue(data.body) || stringValue(data.cta) || stringValue(copy.subject) || stringValue(copy.body) || stringValue(rawCopy.subject) || stringValue(rawCopy.body)
|
|
3474
3571
|
);
|
|
3475
3572
|
}
|
|
3573
|
+
function createCampaignBuilderReadinessLane(route, plan) {
|
|
3574
|
+
const builtIn = campaignBuilderBuiltInForRoute(route);
|
|
3575
|
+
const customRoute = route.provider !== "signaliz" && route.provider !== "csv" && builtIn === void 0;
|
|
3576
|
+
const prepareStep = plan.mcpFlow.find(
|
|
3577
|
+
(step) => step.tool === "gtm_provider_recipe_prepare" && step.arguments.provider_id === route.provider
|
|
3578
|
+
);
|
|
3579
|
+
const activateStep = plan.mcpFlow.find(
|
|
3580
|
+
(step) => step.tool === "gtm_provider_route_activate" && step.arguments.provider_id === route.provider
|
|
3581
|
+
);
|
|
3582
|
+
const readOnlySetup = !customRoute || prepareStep?.readOnly === true && activateStep?.readOnly === true && activateStep.arguments.dry_run === true && activateStep.arguments.confirm === false;
|
|
3583
|
+
const blockers = [
|
|
3584
|
+
customRoute && !prepareStep ? `${route.label ?? route.provider} is missing provider recipe setup.` : void 0,
|
|
3585
|
+
customRoute && !activateStep ? `${route.label ?? route.provider} is missing provider route dry-run setup.` : void 0,
|
|
3586
|
+
customRoute && !readOnlySetup ? `${route.label ?? route.provider} route setup must stay read-only before approval.` : void 0,
|
|
3587
|
+
route.mode === "required" && !route.toolName && customRoute ? `${route.label ?? route.provider} is required but has no tool name.` : void 0
|
|
3588
|
+
].filter((item) => Boolean(item));
|
|
3589
|
+
return {
|
|
3590
|
+
id: route.id ?? `${route.provider}-${route.layer}`,
|
|
3591
|
+
label: route.label ?? readinessLaneLabel(route, builtIn),
|
|
3592
|
+
layer: route.layer,
|
|
3593
|
+
gtmLayers: gtmLayersForRoute(route),
|
|
3594
|
+
provider: route.provider,
|
|
3595
|
+
toolName: route.toolName,
|
|
3596
|
+
mode: route.mode ?? "if_available",
|
|
3597
|
+
builtIn,
|
|
3598
|
+
approvalRequired: route.approvalRequired === true || plan.approvals.some((approval) => approval.routeId === route.id),
|
|
3599
|
+
customRoute,
|
|
3600
|
+
readOnlySetup,
|
|
3601
|
+
ready: blockers.length === 0,
|
|
3602
|
+
blockers,
|
|
3603
|
+
nextAction: customRoute ? `Review ${route.provider} route setup before launch approval.` : void 0
|
|
3604
|
+
};
|
|
3605
|
+
}
|
|
3606
|
+
function campaignBuilderBuiltInForRoute(route) {
|
|
3607
|
+
return Object.entries(CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS).find(([, routeId]) => route.id === routeId)?.[0];
|
|
3608
|
+
}
|
|
3609
|
+
function readinessLaneLabel(route, builtIn) {
|
|
3610
|
+
if (builtIn) {
|
|
3611
|
+
const labels = {
|
|
3612
|
+
lead_generation: "Signaliz lead generation",
|
|
3613
|
+
local_leads: "Signaliz local leads",
|
|
3614
|
+
email_finding: "Signaliz email finding",
|
|
3615
|
+
email_verification: "Signaliz email verification",
|
|
3616
|
+
signals: "Signaliz signals"
|
|
3617
|
+
};
|
|
3618
|
+
return labels[builtIn];
|
|
3619
|
+
}
|
|
3620
|
+
return `${route.provider} ${route.layer}`;
|
|
3621
|
+
}
|
|
3622
|
+
function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
3623
|
+
const requestHint = "--request-file campaign-request.json";
|
|
3624
|
+
if (ready) {
|
|
3625
|
+
return [
|
|
3626
|
+
`signaliz campaign-agent proof ${requestHint} --json`,
|
|
3627
|
+
`signaliz campaign-agent commit-plan ${requestHint} --json`,
|
|
3628
|
+
`signaliz campaign-agent build-approved ${requestHint} --confirm-launch --approve-all --approved-by operator@example.com --spend-limit ${plan.estimatedCredits}`
|
|
3629
|
+
];
|
|
3630
|
+
}
|
|
3631
|
+
const actions = [
|
|
3632
|
+
plan.strategyMemoryStatus && asRecord(plan.strategyMemoryStatus).ready === false ? "signaliz gtm strategy-memory --strategy-template <strategy_template> --include-samples --json" : void 0,
|
|
3633
|
+
customRouteCount > 0 ? "Review BYO provider recipe and route dry-run steps in the readiness packet." : void 0,
|
|
3634
|
+
`signaliz campaign-agent plan ${requestHint} --json`
|
|
3635
|
+
];
|
|
3636
|
+
return actions.filter((item) => Boolean(item));
|
|
3637
|
+
}
|
|
3476
3638
|
function diagnosticMessages2(value) {
|
|
3477
3639
|
if (!Array.isArray(value)) return [];
|
|
3478
3640
|
return value.map((item) => {
|
|
@@ -6492,6 +6654,7 @@ var Signaliz = class {
|
|
|
6492
6654
|
createCampaignBuilderAgentPlan,
|
|
6493
6655
|
createCampaignBuilderAgentRequestTemplate,
|
|
6494
6656
|
createCampaignBuilderApproval,
|
|
6657
|
+
createCampaignBuilderReadiness,
|
|
6495
6658
|
createCampaignBuilderToolRoute,
|
|
6496
6659
|
getCampaignBuilderOperatingPlaybook,
|
|
6497
6660
|
getCampaignBuilderOperatingPlaybooksForRequest,
|
package/dist/index.mjs
CHANGED
|
@@ -17,13 +17,14 @@ import {
|
|
|
17
17
|
createCampaignBuilderAgentPlan,
|
|
18
18
|
createCampaignBuilderAgentRequestTemplate,
|
|
19
19
|
createCampaignBuilderApproval,
|
|
20
|
+
createCampaignBuilderReadiness,
|
|
20
21
|
createCampaignBuilderToolRoute,
|
|
21
22
|
getCampaignBuilderOperatingPlaybook,
|
|
22
23
|
getCampaignBuilderOperatingPlaybooksForRequest,
|
|
23
24
|
getCampaignBuilderStrategyTemplate,
|
|
24
25
|
getMissingCampaignBuilderApprovals,
|
|
25
26
|
normalizeExecutionReference
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-DJVOGXVD.mjs";
|
|
27
28
|
export {
|
|
28
29
|
Ai,
|
|
29
30
|
CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS,
|
|
@@ -43,6 +44,7 @@ export {
|
|
|
43
44
|
createCampaignBuilderAgentPlan,
|
|
44
45
|
createCampaignBuilderAgentRequestTemplate,
|
|
45
46
|
createCampaignBuilderApproval,
|
|
47
|
+
createCampaignBuilderReadiness,
|
|
46
48
|
createCampaignBuilderToolRoute,
|
|
47
49
|
getCampaignBuilderOperatingPlaybook,
|
|
48
50
|
getCampaignBuilderOperatingPlaybooksForRequest,
|
package/dist/mcp-config.js
CHANGED
|
@@ -1222,6 +1222,13 @@ var DEFAULT_CAMPAIGN_BUILDER_BUILT_INS = [
|
|
|
1222
1222
|
"email_verification",
|
|
1223
1223
|
"signals"
|
|
1224
1224
|
];
|
|
1225
|
+
var CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS = {
|
|
1226
|
+
lead_generation: "signaliz-lead-generation",
|
|
1227
|
+
local_leads: "signaliz-local-leads",
|
|
1228
|
+
email_finding: "signaliz-email-finding",
|
|
1229
|
+
email_verification: "signaliz-email-verification",
|
|
1230
|
+
signals: "signaliz-signals"
|
|
1231
|
+
};
|
|
1225
1232
|
var CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS = [
|
|
1226
1233
|
{
|
|
1227
1234
|
slug: "cache-first-large-list",
|
|
@@ -1710,6 +1717,10 @@ var CampaignBuilderAgent = class {
|
|
|
1710
1717
|
}
|
|
1711
1718
|
return plan;
|
|
1712
1719
|
}
|
|
1720
|
+
async readiness(request, options = {}) {
|
|
1721
|
+
const plan = await this.createPlan(request, options);
|
|
1722
|
+
return createCampaignBuilderReadiness(plan);
|
|
1723
|
+
}
|
|
1713
1724
|
async commitPlan(plan, options = {}) {
|
|
1714
1725
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1715
1726
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2070,6 +2081,91 @@ function createCampaignBuilderAgentPlan(request, context = {}) {
|
|
|
2070
2081
|
warnings: context.warnings ?? []
|
|
2071
2082
|
};
|
|
2072
2083
|
}
|
|
2084
|
+
function createCampaignBuilderReadiness(plan) {
|
|
2085
|
+
const lanes = plan.routes.map((route) => createCampaignBuilderReadinessLane(route, plan));
|
|
2086
|
+
const builtInLanes = lanes.filter((lane) => lane.builtIn);
|
|
2087
|
+
const customRoutes = lanes.filter((lane) => lane.customRoute);
|
|
2088
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2089
|
+
const deliveryRisk = asRecord(plan.buildRequest.deliveryRisk);
|
|
2090
|
+
const deliveryRiskBlockers = arrayOfStrings(deliveryRisk.blockers) ?? [];
|
|
2091
|
+
const deliveryRiskValue = asRecord(deliveryRisk.risk);
|
|
2092
|
+
const deliveryRiskLevel = stringValue(deliveryRiskValue.risk_level ?? deliveryRiskValue.riskLevel);
|
|
2093
|
+
const memoryReady = !plan.strategyMemoryStatus || strategyMemory.ready !== false;
|
|
2094
|
+
const kernelPlanReady = Object.keys(asRecord(plan.kernelPlan)).length > 0;
|
|
2095
|
+
const deliveryRiskReady = !plan.buildRequest.deliveryRisk || deliveryRiskBlockers.length === 0 && !["high", "critical", "blocked"].includes(String(deliveryRiskLevel ?? "").toLowerCase());
|
|
2096
|
+
const builtInsReady = builtInLanes.length > 0 && builtInLanes.every((lane) => lane.ready);
|
|
2097
|
+
const customRoutesReady = customRoutes.every((lane) => lane.ready);
|
|
2098
|
+
const approvalGatesReady = plan.approvals.length > 0;
|
|
2099
|
+
const gates = [
|
|
2100
|
+
{
|
|
2101
|
+
id: "campaign_plan_created",
|
|
2102
|
+
label: "Campaign plan created",
|
|
2103
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2104
|
+
detail: plan.planId ? `Plan ${plan.planId} has ${plan.mcpFlow.length} MCP step(s).` : "No campaign-builder plan was created."
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
id: "built_in_lanes_ready",
|
|
2108
|
+
label: "Built-in lanes ready",
|
|
2109
|
+
passed: builtInsReady,
|
|
2110
|
+
detail: `${builtInLanes.filter((lane) => lane.ready).length}/${builtInLanes.length} Signaliz built-in lane(s) are present.`
|
|
2111
|
+
},
|
|
2112
|
+
{
|
|
2113
|
+
id: "strategy_memory_ready",
|
|
2114
|
+
label: "Strategy memory ready",
|
|
2115
|
+
passed: memoryReady,
|
|
2116
|
+
detail: plan.strategyMemoryStatus ? "Strategy memory readiness was checked." : "Strategy memory readiness was not requested."
|
|
2117
|
+
},
|
|
2118
|
+
{
|
|
2119
|
+
id: "kernel_plan_attached",
|
|
2120
|
+
label: "Kernel plan attached",
|
|
2121
|
+
passed: kernelPlanReady,
|
|
2122
|
+
detail: kernelPlanReady ? "Kernel planner evidence is attached." : "Kernel planner evidence is not attached."
|
|
2123
|
+
},
|
|
2124
|
+
{
|
|
2125
|
+
id: "delivery_risk_clear",
|
|
2126
|
+
label: "Delivery risk clear",
|
|
2127
|
+
passed: deliveryRiskReady,
|
|
2128
|
+
detail: plan.buildRequest.deliveryRisk ? `Delivery risk is ${deliveryRiskLevel || "available"} with ${deliveryRiskBlockers.length} blocker(s).` : "Delivery risk preflight was not requested."
|
|
2129
|
+
},
|
|
2130
|
+
{
|
|
2131
|
+
id: "custom_routes_prepared",
|
|
2132
|
+
label: "Custom routes prepared",
|
|
2133
|
+
passed: customRoutesReady,
|
|
2134
|
+
detail: customRoutes.length === 0 ? "No BYO routes were requested." : `${customRoutes.filter((lane) => lane.ready).length}/${customRoutes.length} BYO route(s) have read-only setup steps.`
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
id: "approval_gates_present",
|
|
2138
|
+
label: "Approval gates present",
|
|
2139
|
+
passed: approvalGatesReady,
|
|
2140
|
+
detail: approvalGatesReady ? `${plan.approvals.length} approval gate(s) are attached.` : "No approval gates are attached."
|
|
2141
|
+
}
|
|
2142
|
+
];
|
|
2143
|
+
const blockers = [
|
|
2144
|
+
...gates.filter((gate) => !gate.passed).map((gate) => gate.detail),
|
|
2145
|
+
...lanes.flatMap((lane) => lane.blockers)
|
|
2146
|
+
];
|
|
2147
|
+
const score = gates.length === 0 ? 0 : Math.round(gates.filter((gate) => gate.passed).length / gates.length * 100);
|
|
2148
|
+
const ready = blockers.length === 0;
|
|
2149
|
+
return {
|
|
2150
|
+
plan,
|
|
2151
|
+
lanes,
|
|
2152
|
+
gates,
|
|
2153
|
+
summary: {
|
|
2154
|
+
ready,
|
|
2155
|
+
score,
|
|
2156
|
+
targetCount: plan.targetCount,
|
|
2157
|
+
estimatedCredits: plan.estimatedCredits,
|
|
2158
|
+
builtInLanesReady: builtInLanes.filter((lane) => lane.ready).length,
|
|
2159
|
+
builtInLanesTotal: builtInLanes.length,
|
|
2160
|
+
customRoutesReady: customRoutes.filter((lane) => lane.ready).length,
|
|
2161
|
+
customRoutesTotal: customRoutes.length,
|
|
2162
|
+
approvalGateCount: plan.approvals.length,
|
|
2163
|
+
blockers,
|
|
2164
|
+
warnings: plan.warnings
|
|
2165
|
+
},
|
|
2166
|
+
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2167
|
+
};
|
|
2168
|
+
}
|
|
2073
2169
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2074
2170
|
if (approval.planId !== plan.planId) {
|
|
2075
2171
|
return plan.approvals;
|
|
@@ -3346,6 +3442,71 @@ function campaignReviewRowHasCopy(row) {
|
|
|
3346
3442
|
stringValue(data.subject) || stringValue(data.subject_line) || stringValue(data.subjectLine) || stringValue(data.opener) || stringValue(data.body) || stringValue(data.cta) || stringValue(copy.subject) || stringValue(copy.body) || stringValue(rawCopy.subject) || stringValue(rawCopy.body)
|
|
3347
3443
|
);
|
|
3348
3444
|
}
|
|
3445
|
+
function createCampaignBuilderReadinessLane(route, plan) {
|
|
3446
|
+
const builtIn = campaignBuilderBuiltInForRoute(route);
|
|
3447
|
+
const customRoute = route.provider !== "signaliz" && route.provider !== "csv" && builtIn === void 0;
|
|
3448
|
+
const prepareStep = plan.mcpFlow.find(
|
|
3449
|
+
(step) => step.tool === "gtm_provider_recipe_prepare" && step.arguments.provider_id === route.provider
|
|
3450
|
+
);
|
|
3451
|
+
const activateStep = plan.mcpFlow.find(
|
|
3452
|
+
(step) => step.tool === "gtm_provider_route_activate" && step.arguments.provider_id === route.provider
|
|
3453
|
+
);
|
|
3454
|
+
const readOnlySetup = !customRoute || prepareStep?.readOnly === true && activateStep?.readOnly === true && activateStep.arguments.dry_run === true && activateStep.arguments.confirm === false;
|
|
3455
|
+
const blockers = [
|
|
3456
|
+
customRoute && !prepareStep ? `${route.label ?? route.provider} is missing provider recipe setup.` : void 0,
|
|
3457
|
+
customRoute && !activateStep ? `${route.label ?? route.provider} is missing provider route dry-run setup.` : void 0,
|
|
3458
|
+
customRoute && !readOnlySetup ? `${route.label ?? route.provider} route setup must stay read-only before approval.` : void 0,
|
|
3459
|
+
route.mode === "required" && !route.toolName && customRoute ? `${route.label ?? route.provider} is required but has no tool name.` : void 0
|
|
3460
|
+
].filter((item) => Boolean(item));
|
|
3461
|
+
return {
|
|
3462
|
+
id: route.id ?? `${route.provider}-${route.layer}`,
|
|
3463
|
+
label: route.label ?? readinessLaneLabel(route, builtIn),
|
|
3464
|
+
layer: route.layer,
|
|
3465
|
+
gtmLayers: gtmLayersForRoute(route),
|
|
3466
|
+
provider: route.provider,
|
|
3467
|
+
toolName: route.toolName,
|
|
3468
|
+
mode: route.mode ?? "if_available",
|
|
3469
|
+
builtIn,
|
|
3470
|
+
approvalRequired: route.approvalRequired === true || plan.approvals.some((approval) => approval.routeId === route.id),
|
|
3471
|
+
customRoute,
|
|
3472
|
+
readOnlySetup,
|
|
3473
|
+
ready: blockers.length === 0,
|
|
3474
|
+
blockers,
|
|
3475
|
+
nextAction: customRoute ? `Review ${route.provider} route setup before launch approval.` : void 0
|
|
3476
|
+
};
|
|
3477
|
+
}
|
|
3478
|
+
function campaignBuilderBuiltInForRoute(route) {
|
|
3479
|
+
return Object.entries(CAMPAIGN_BUILDER_BUILT_IN_ROUTE_IDS).find(([, routeId]) => route.id === routeId)?.[0];
|
|
3480
|
+
}
|
|
3481
|
+
function readinessLaneLabel(route, builtIn) {
|
|
3482
|
+
if (builtIn) {
|
|
3483
|
+
const labels = {
|
|
3484
|
+
lead_generation: "Signaliz lead generation",
|
|
3485
|
+
local_leads: "Signaliz local leads",
|
|
3486
|
+
email_finding: "Signaliz email finding",
|
|
3487
|
+
email_verification: "Signaliz email verification",
|
|
3488
|
+
signals: "Signaliz signals"
|
|
3489
|
+
};
|
|
3490
|
+
return labels[builtIn];
|
|
3491
|
+
}
|
|
3492
|
+
return `${route.provider} ${route.layer}`;
|
|
3493
|
+
}
|
|
3494
|
+
function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
3495
|
+
const requestHint = "--request-file campaign-request.json";
|
|
3496
|
+
if (ready) {
|
|
3497
|
+
return [
|
|
3498
|
+
`signaliz campaign-agent proof ${requestHint} --json`,
|
|
3499
|
+
`signaliz campaign-agent commit-plan ${requestHint} --json`,
|
|
3500
|
+
`signaliz campaign-agent build-approved ${requestHint} --confirm-launch --approve-all --approved-by operator@example.com --spend-limit ${plan.estimatedCredits}`
|
|
3501
|
+
];
|
|
3502
|
+
}
|
|
3503
|
+
const actions = [
|
|
3504
|
+
plan.strategyMemoryStatus && asRecord(plan.strategyMemoryStatus).ready === false ? "signaliz gtm strategy-memory --strategy-template <strategy_template> --include-samples --json" : void 0,
|
|
3505
|
+
customRouteCount > 0 ? "Review BYO provider recipe and route dry-run steps in the readiness packet." : void 0,
|
|
3506
|
+
`signaliz campaign-agent plan ${requestHint} --json`
|
|
3507
|
+
];
|
|
3508
|
+
return actions.filter((item) => Boolean(item));
|
|
3509
|
+
}
|
|
3349
3510
|
function diagnosticMessages2(value) {
|
|
3350
3511
|
if (!Array.isArray(value)) return [];
|
|
3351
3512
|
return value.map((item) => {
|
package/dist/mcp-config.mjs
CHANGED