@signaliz/sdk 1.0.13 → 1.0.14
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 +12 -0
- package/dist/{chunk-DJVOGXVD.mjs → chunk-EVFQETTN.mjs} +140 -0
- package/dist/cli.js +142 -135
- package/dist/cli.mjs +4 -136
- package/dist/index.d.mts +31 -1
- package/dist/index.d.ts +31 -1
- package/dist/index.js +141 -0
- package/dist/index.mjs +3 -1
- package/dist/mcp-config.js +139 -0
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,9 +99,16 @@ const readiness = await signaliz.campaignBuilderAgent.readiness({
|
|
|
99
99
|
targetCount: 500,
|
|
100
100
|
builtIns: ['lead_generation', 'local_leads', 'email_finding', 'email_verification', 'signals'],
|
|
101
101
|
});
|
|
102
|
+
const proof = await signaliz.campaignBuilderAgent.proof({
|
|
103
|
+
goal: 'Build a strategy-template campaign for mature local operators',
|
|
104
|
+
strategyTemplate: 'non-medical-home-care',
|
|
105
|
+
targetCount: 25,
|
|
106
|
+
builtIns: ['lead_generation', 'local_leads', 'email_finding', 'email_verification', 'signals'],
|
|
107
|
+
});
|
|
102
108
|
|
|
103
109
|
console.log(plan.strategyMemoryStatus?.ready);
|
|
104
110
|
console.log(readiness.summary.ready);
|
|
111
|
+
console.log(proof.success);
|
|
105
112
|
console.log(plan.mcpFlow.filter((step) =>
|
|
106
113
|
['gtm_provider_recipe_prepare', 'gtm_provider_route_activate'].includes(step.tool)
|
|
107
114
|
));
|
|
@@ -139,6 +146,11 @@ npx @signaliz/sdk campaign-agent doctor \
|
|
|
139
146
|
--request-file campaign-request.json \
|
|
140
147
|
--json
|
|
141
148
|
|
|
149
|
+
npx @signaliz/cli build "Build a strategy-template campaign for local operators" \
|
|
150
|
+
--strategy-template non-medical-home-care \
|
|
151
|
+
--target-count 25 \
|
|
152
|
+
--use-local-leads
|
|
153
|
+
|
|
142
154
|
npx @signaliz/sdk campaign-agent status campaign_build_id --json
|
|
143
155
|
npx @signaliz/sdk campaign-agent review campaign_build_id --limit 100 --json
|
|
144
156
|
npx @signaliz/sdk campaign-agent rows campaign_build_id --limit 100 --json
|
|
@@ -1698,6 +1698,13 @@ var CampaignBuilderAgent = class {
|
|
|
1698
1698
|
const plan = await this.createPlan(request, options);
|
|
1699
1699
|
return createCampaignBuilderReadiness(plan);
|
|
1700
1700
|
}
|
|
1701
|
+
async proof(request, options = {}) {
|
|
1702
|
+
const plan = await this.createPlan(request, options);
|
|
1703
|
+
const result = await this.dryRunPlan(plan, {
|
|
1704
|
+
idempotencyKey: options.idempotencyKey
|
|
1705
|
+
});
|
|
1706
|
+
return createCampaignBuilderProofReceipt(plan, result);
|
|
1707
|
+
}
|
|
1701
1708
|
async commitPlan(plan, options = {}) {
|
|
1702
1709
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1703
1710
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2143,6 +2150,72 @@ function createCampaignBuilderReadiness(plan) {
|
|
|
2143
2150
|
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2144
2151
|
};
|
|
2145
2152
|
}
|
|
2153
|
+
function createCampaignBuilderProofReceipt(plan, result) {
|
|
2154
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2155
|
+
const dryRunResult = asRecord(result);
|
|
2156
|
+
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
2157
|
+
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
2158
|
+
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
2159
|
+
const gates = [
|
|
2160
|
+
{
|
|
2161
|
+
id: "strategy_memory_ready",
|
|
2162
|
+
passed: memoryReady,
|
|
2163
|
+
ready: strategyMemory.ready ?? null,
|
|
2164
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
id: "campaign_plan_ready",
|
|
2168
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2169
|
+
plan_id: plan.planId,
|
|
2170
|
+
flow_steps: plan.mcpFlow.length
|
|
2171
|
+
},
|
|
2172
|
+
{
|
|
2173
|
+
id: "approval_gates_present",
|
|
2174
|
+
passed: plan.approvals.length > 0,
|
|
2175
|
+
approval_types: plan.approvals.map((approval) => approval.type)
|
|
2176
|
+
},
|
|
2177
|
+
{
|
|
2178
|
+
id: "dry_run_completed",
|
|
2179
|
+
passed: dryRunCompleted,
|
|
2180
|
+
status: dryRunResult.status ?? null,
|
|
2181
|
+
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
2182
|
+
},
|
|
2183
|
+
{
|
|
2184
|
+
id: "no_spendful_launch",
|
|
2185
|
+
passed: noLaunch,
|
|
2186
|
+
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
2187
|
+
}
|
|
2188
|
+
];
|
|
2189
|
+
return {
|
|
2190
|
+
receipt_version: "campaign-agent-proof.v1",
|
|
2191
|
+
source: "signaliz.campaignBuilderAgent.proof",
|
|
2192
|
+
success: gates.every((gate) => gate.passed),
|
|
2193
|
+
safety: {
|
|
2194
|
+
spendful_tools_called: false,
|
|
2195
|
+
external_writes_called: false,
|
|
2196
|
+
sender_loads_called: false,
|
|
2197
|
+
email_sends_called: false,
|
|
2198
|
+
dry_run_only: true
|
|
2199
|
+
},
|
|
2200
|
+
campaign: {
|
|
2201
|
+
plan_id: plan.planId,
|
|
2202
|
+
campaign_name: plan.campaignName,
|
|
2203
|
+
strategy_template: campaignBuilderProofStrategyTemplate(plan),
|
|
2204
|
+
target_count: plan.targetCount,
|
|
2205
|
+
estimated_credits: plan.estimatedCredits,
|
|
2206
|
+
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
2207
|
+
},
|
|
2208
|
+
gates,
|
|
2209
|
+
strategy_memory_status: summarizeCampaignBuilderProofStrategyMemory(strategyMemory),
|
|
2210
|
+
dry_run_result: summarizeCampaignBuilderProofDryRun(dryRunResult),
|
|
2211
|
+
recommended_next_actions: [
|
|
2212
|
+
"Review the plan, approvals, and dry-run result.",
|
|
2213
|
+
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
2214
|
+
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
2215
|
+
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
2216
|
+
]
|
|
2217
|
+
};
|
|
2218
|
+
}
|
|
2146
2219
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2147
2220
|
if (approval.planId !== plan.planId) {
|
|
2148
2221
|
return plan.approvals;
|
|
@@ -3585,6 +3658,72 @@ function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
|
3585
3658
|
];
|
|
3586
3659
|
return actions.filter((item) => Boolean(item));
|
|
3587
3660
|
}
|
|
3661
|
+
function campaignBuilderProofStrategyTemplate(plan) {
|
|
3662
|
+
const buildRequest = asRecord(plan.buildRequest);
|
|
3663
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
3664
|
+
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3665
|
+
const statusTemplateRecord = asRecord(statusTemplate);
|
|
3666
|
+
const flowTemplate = plan.mcpFlow.map((step) => asRecord(step.arguments).strategy_template ?? asRecord(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
3667
|
+
return firstNonEmptyString(
|
|
3668
|
+
buildRequest.strategyTemplate,
|
|
3669
|
+
buildRequest.strategy_template,
|
|
3670
|
+
statusTemplate,
|
|
3671
|
+
statusTemplateRecord.slug,
|
|
3672
|
+
statusTemplateRecord.id,
|
|
3673
|
+
flowTemplate
|
|
3674
|
+
);
|
|
3675
|
+
}
|
|
3676
|
+
function summarizeCampaignBuilderProofStrategyMemory(strategyMemory) {
|
|
3677
|
+
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
3678
|
+
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3679
|
+
const templateRecord = asRecord(template);
|
|
3680
|
+
const coverage = asRecord(strategyMemory.coverage);
|
|
3681
|
+
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
3682
|
+
const sourceGroups = rawSourceGroups.map((group) => {
|
|
3683
|
+
const sourceGroup = asRecord(group);
|
|
3684
|
+
return {
|
|
3685
|
+
id: sourceGroup.id ?? null,
|
|
3686
|
+
required: sourceGroup.required ?? null,
|
|
3687
|
+
ready: sourceGroup.ready ?? null,
|
|
3688
|
+
counts: asRecord(sourceGroup.counts)
|
|
3689
|
+
};
|
|
3690
|
+
});
|
|
3691
|
+
return {
|
|
3692
|
+
ready: strategyMemory.ready ?? null,
|
|
3693
|
+
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
3694
|
+
source_tool: firstNonEmptyString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
3695
|
+
strategy_template: {
|
|
3696
|
+
slug: firstNonEmptyString(template, templateRecord.slug, templateRecord.id),
|
|
3697
|
+
label: firstNonEmptyString(templateRecord.label)
|
|
3698
|
+
},
|
|
3699
|
+
coverage: {
|
|
3700
|
+
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
3701
|
+
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
3702
|
+
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
3703
|
+
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
3704
|
+
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
3705
|
+
memories: coverage.memories ?? null
|
|
3706
|
+
},
|
|
3707
|
+
source_groups: sourceGroups,
|
|
3708
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
3709
|
+
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
3710
|
+
};
|
|
3711
|
+
}
|
|
3712
|
+
function summarizeCampaignBuilderProofDryRun(dryRunResult) {
|
|
3713
|
+
return {
|
|
3714
|
+
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
3715
|
+
status: dryRunResult.status ?? null,
|
|
3716
|
+
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
3717
|
+
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
3718
|
+
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
3719
|
+
};
|
|
3720
|
+
}
|
|
3721
|
+
function firstNonEmptyString(...values) {
|
|
3722
|
+
for (const value of values) {
|
|
3723
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
3724
|
+
}
|
|
3725
|
+
return null;
|
|
3726
|
+
}
|
|
3588
3727
|
function diagnosticMessages2(value) {
|
|
3589
3728
|
if (!Array.isArray(value)) return [];
|
|
3590
3729
|
return value.map((item) => {
|
|
@@ -6596,6 +6735,7 @@ export {
|
|
|
6596
6735
|
CampaignBuilderAgent,
|
|
6597
6736
|
createCampaignBuilderAgentPlan,
|
|
6598
6737
|
createCampaignBuilderReadiness,
|
|
6738
|
+
createCampaignBuilderProofReceipt,
|
|
6599
6739
|
getMissingCampaignBuilderApprovals,
|
|
6600
6740
|
createCampaignBuilderApproval,
|
|
6601
6741
|
getCampaignBuilderStrategyTemplate,
|
package/dist/cli.js
CHANGED
|
@@ -1704,6 +1704,13 @@ var CampaignBuilderAgent = class {
|
|
|
1704
1704
|
const plan = await this.createPlan(request, options);
|
|
1705
1705
|
return createCampaignBuilderReadiness(plan);
|
|
1706
1706
|
}
|
|
1707
|
+
async proof(request, options = {}) {
|
|
1708
|
+
const plan = await this.createPlan(request, options);
|
|
1709
|
+
const result = await this.dryRunPlan(plan, {
|
|
1710
|
+
idempotencyKey: options.idempotencyKey
|
|
1711
|
+
});
|
|
1712
|
+
return createCampaignBuilderProofReceipt(plan, result);
|
|
1713
|
+
}
|
|
1707
1714
|
async commitPlan(plan, options = {}) {
|
|
1708
1715
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1709
1716
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2149,6 +2156,72 @@ function createCampaignBuilderReadiness(plan) {
|
|
|
2149
2156
|
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2150
2157
|
};
|
|
2151
2158
|
}
|
|
2159
|
+
function createCampaignBuilderProofReceipt(plan, result) {
|
|
2160
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2161
|
+
const dryRunResult = asRecord(result);
|
|
2162
|
+
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
2163
|
+
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
2164
|
+
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
2165
|
+
const gates = [
|
|
2166
|
+
{
|
|
2167
|
+
id: "strategy_memory_ready",
|
|
2168
|
+
passed: memoryReady,
|
|
2169
|
+
ready: strategyMemory.ready ?? null,
|
|
2170
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
2171
|
+
},
|
|
2172
|
+
{
|
|
2173
|
+
id: "campaign_plan_ready",
|
|
2174
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2175
|
+
plan_id: plan.planId,
|
|
2176
|
+
flow_steps: plan.mcpFlow.length
|
|
2177
|
+
},
|
|
2178
|
+
{
|
|
2179
|
+
id: "approval_gates_present",
|
|
2180
|
+
passed: plan.approvals.length > 0,
|
|
2181
|
+
approval_types: plan.approvals.map((approval) => approval.type)
|
|
2182
|
+
},
|
|
2183
|
+
{
|
|
2184
|
+
id: "dry_run_completed",
|
|
2185
|
+
passed: dryRunCompleted,
|
|
2186
|
+
status: dryRunResult.status ?? null,
|
|
2187
|
+
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
id: "no_spendful_launch",
|
|
2191
|
+
passed: noLaunch,
|
|
2192
|
+
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
2193
|
+
}
|
|
2194
|
+
];
|
|
2195
|
+
return {
|
|
2196
|
+
receipt_version: "campaign-agent-proof.v1",
|
|
2197
|
+
source: "signaliz.campaignBuilderAgent.proof",
|
|
2198
|
+
success: gates.every((gate) => gate.passed),
|
|
2199
|
+
safety: {
|
|
2200
|
+
spendful_tools_called: false,
|
|
2201
|
+
external_writes_called: false,
|
|
2202
|
+
sender_loads_called: false,
|
|
2203
|
+
email_sends_called: false,
|
|
2204
|
+
dry_run_only: true
|
|
2205
|
+
},
|
|
2206
|
+
campaign: {
|
|
2207
|
+
plan_id: plan.planId,
|
|
2208
|
+
campaign_name: plan.campaignName,
|
|
2209
|
+
strategy_template: campaignBuilderProofStrategyTemplate(plan),
|
|
2210
|
+
target_count: plan.targetCount,
|
|
2211
|
+
estimated_credits: plan.estimatedCredits,
|
|
2212
|
+
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
2213
|
+
},
|
|
2214
|
+
gates,
|
|
2215
|
+
strategy_memory_status: summarizeCampaignBuilderProofStrategyMemory(strategyMemory),
|
|
2216
|
+
dry_run_result: summarizeCampaignBuilderProofDryRun(dryRunResult),
|
|
2217
|
+
recommended_next_actions: [
|
|
2218
|
+
"Review the plan, approvals, and dry-run result.",
|
|
2219
|
+
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
2220
|
+
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
2221
|
+
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
2222
|
+
]
|
|
2223
|
+
};
|
|
2224
|
+
}
|
|
2152
2225
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2153
2226
|
if (approval.planId !== plan.planId) {
|
|
2154
2227
|
return plan.approvals;
|
|
@@ -3591,6 +3664,72 @@ function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
|
3591
3664
|
];
|
|
3592
3665
|
return actions.filter((item) => Boolean(item));
|
|
3593
3666
|
}
|
|
3667
|
+
function campaignBuilderProofStrategyTemplate(plan) {
|
|
3668
|
+
const buildRequest = asRecord(plan.buildRequest);
|
|
3669
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
3670
|
+
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3671
|
+
const statusTemplateRecord = asRecord(statusTemplate);
|
|
3672
|
+
const flowTemplate = plan.mcpFlow.map((step) => asRecord(step.arguments).strategy_template ?? asRecord(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
3673
|
+
return firstNonEmptyString(
|
|
3674
|
+
buildRequest.strategyTemplate,
|
|
3675
|
+
buildRequest.strategy_template,
|
|
3676
|
+
statusTemplate,
|
|
3677
|
+
statusTemplateRecord.slug,
|
|
3678
|
+
statusTemplateRecord.id,
|
|
3679
|
+
flowTemplate
|
|
3680
|
+
);
|
|
3681
|
+
}
|
|
3682
|
+
function summarizeCampaignBuilderProofStrategyMemory(strategyMemory) {
|
|
3683
|
+
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
3684
|
+
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3685
|
+
const templateRecord = asRecord(template);
|
|
3686
|
+
const coverage = asRecord(strategyMemory.coverage);
|
|
3687
|
+
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
3688
|
+
const sourceGroups = rawSourceGroups.map((group) => {
|
|
3689
|
+
const sourceGroup = asRecord(group);
|
|
3690
|
+
return {
|
|
3691
|
+
id: sourceGroup.id ?? null,
|
|
3692
|
+
required: sourceGroup.required ?? null,
|
|
3693
|
+
ready: sourceGroup.ready ?? null,
|
|
3694
|
+
counts: asRecord(sourceGroup.counts)
|
|
3695
|
+
};
|
|
3696
|
+
});
|
|
3697
|
+
return {
|
|
3698
|
+
ready: strategyMemory.ready ?? null,
|
|
3699
|
+
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
3700
|
+
source_tool: firstNonEmptyString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
3701
|
+
strategy_template: {
|
|
3702
|
+
slug: firstNonEmptyString(template, templateRecord.slug, templateRecord.id),
|
|
3703
|
+
label: firstNonEmptyString(templateRecord.label)
|
|
3704
|
+
},
|
|
3705
|
+
coverage: {
|
|
3706
|
+
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
3707
|
+
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
3708
|
+
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
3709
|
+
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
3710
|
+
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
3711
|
+
memories: coverage.memories ?? null
|
|
3712
|
+
},
|
|
3713
|
+
source_groups: sourceGroups,
|
|
3714
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
3715
|
+
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
3716
|
+
};
|
|
3717
|
+
}
|
|
3718
|
+
function summarizeCampaignBuilderProofDryRun(dryRunResult) {
|
|
3719
|
+
return {
|
|
3720
|
+
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
3721
|
+
status: dryRunResult.status ?? null,
|
|
3722
|
+
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
3723
|
+
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
3724
|
+
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
3725
|
+
};
|
|
3726
|
+
}
|
|
3727
|
+
function firstNonEmptyString(...values) {
|
|
3728
|
+
for (const value of values) {
|
|
3729
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
3730
|
+
}
|
|
3731
|
+
return null;
|
|
3732
|
+
}
|
|
3594
3733
|
function diagnosticMessages2(value) {
|
|
3595
3734
|
if (!Array.isArray(value)) return [];
|
|
3596
3735
|
return value.map((item) => {
|
|
@@ -7011,12 +7150,11 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
7011
7150
|
if (!readiness.summary.ready) process.exitCode = 1;
|
|
7012
7151
|
return;
|
|
7013
7152
|
}
|
|
7014
|
-
const plan = await signaliz.campaignBuilderAgent.createPlan(request, planOptions);
|
|
7015
7153
|
if (subcommand === "proof" || subcommand === "smoke") {
|
|
7016
|
-
const
|
|
7154
|
+
const proof = await signaliz.campaignBuilderAgent.proof(request, {
|
|
7155
|
+
...planOptions,
|
|
7017
7156
|
idempotencyKey: stringFlag(flags, "idempotency-key")
|
|
7018
7157
|
});
|
|
7019
|
-
const proof = createCampaignAgentProofReceipt(plan, result);
|
|
7020
7158
|
if (booleanFlag(flags, "json")) {
|
|
7021
7159
|
printJson(proof);
|
|
7022
7160
|
} else {
|
|
@@ -7025,6 +7163,7 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
7025
7163
|
if (!proof.success) process.exitCode = 1;
|
|
7026
7164
|
return;
|
|
7027
7165
|
}
|
|
7166
|
+
const plan = await signaliz.campaignBuilderAgent.createPlan(request, planOptions);
|
|
7028
7167
|
if (isCommitPlan) {
|
|
7029
7168
|
const result = await signaliz.campaignBuilderAgent.commitPlan(plan, {
|
|
7030
7169
|
confirm: isConfirmedCommit,
|
|
@@ -7616,138 +7755,6 @@ function printCampaignAgentRows(result) {
|
|
|
7616
7755
|
function asRecord4(value) {
|
|
7617
7756
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
7618
7757
|
}
|
|
7619
|
-
function createCampaignAgentProofReceipt(plan, result) {
|
|
7620
|
-
const strategyMemory = asRecord4(plan.strategyMemoryStatus);
|
|
7621
|
-
const dryRunResult = asRecord4(result);
|
|
7622
|
-
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
7623
|
-
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
7624
|
-
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
7625
|
-
const gates = [
|
|
7626
|
-
{
|
|
7627
|
-
id: "strategy_memory_ready",
|
|
7628
|
-
passed: memoryReady,
|
|
7629
|
-
ready: strategyMemory.ready ?? null,
|
|
7630
|
-
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
7631
|
-
},
|
|
7632
|
-
{
|
|
7633
|
-
id: "campaign_plan_ready",
|
|
7634
|
-
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
7635
|
-
plan_id: plan.planId,
|
|
7636
|
-
flow_steps: plan.mcpFlow.length
|
|
7637
|
-
},
|
|
7638
|
-
{
|
|
7639
|
-
id: "approval_gates_present",
|
|
7640
|
-
passed: plan.approvals.length > 0,
|
|
7641
|
-
approval_types: plan.approvals.map((approval) => approval.type)
|
|
7642
|
-
},
|
|
7643
|
-
{
|
|
7644
|
-
id: "dry_run_completed",
|
|
7645
|
-
passed: dryRunCompleted,
|
|
7646
|
-
status: dryRunResult.status ?? null,
|
|
7647
|
-
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
7648
|
-
},
|
|
7649
|
-
{
|
|
7650
|
-
id: "no_spendful_launch",
|
|
7651
|
-
passed: noLaunch,
|
|
7652
|
-
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
7653
|
-
}
|
|
7654
|
-
];
|
|
7655
|
-
return {
|
|
7656
|
-
receipt_version: "campaign-agent-proof.v1",
|
|
7657
|
-
source: "signaliz campaign-agent proof",
|
|
7658
|
-
success: gates.every((gate) => gate.passed),
|
|
7659
|
-
safety: {
|
|
7660
|
-
spendful_tools_called: false,
|
|
7661
|
-
external_writes_called: false,
|
|
7662
|
-
sender_loads_called: false,
|
|
7663
|
-
email_sends_called: false,
|
|
7664
|
-
dry_run_only: true
|
|
7665
|
-
},
|
|
7666
|
-
campaign: {
|
|
7667
|
-
plan_id: plan.planId,
|
|
7668
|
-
campaign_name: plan.campaignName,
|
|
7669
|
-
strategy_template: campaignAgentStrategyTemplate(plan),
|
|
7670
|
-
target_count: plan.targetCount,
|
|
7671
|
-
estimated_credits: plan.estimatedCredits,
|
|
7672
|
-
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
7673
|
-
},
|
|
7674
|
-
gates,
|
|
7675
|
-
strategy_memory_status: summarizeCampaignAgentStrategyMemory(strategyMemory),
|
|
7676
|
-
dry_run_result: summarizeCampaignAgentDryRun(dryRunResult),
|
|
7677
|
-
recommended_next_actions: [
|
|
7678
|
-
"Review the plan, approvals, and dry-run result.",
|
|
7679
|
-
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
7680
|
-
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
7681
|
-
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
7682
|
-
]
|
|
7683
|
-
};
|
|
7684
|
-
}
|
|
7685
|
-
function campaignAgentString(...values) {
|
|
7686
|
-
for (const value of values) {
|
|
7687
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
7688
|
-
}
|
|
7689
|
-
return null;
|
|
7690
|
-
}
|
|
7691
|
-
function campaignAgentStrategyTemplate(plan) {
|
|
7692
|
-
const buildRequest = asRecord4(plan.buildRequest);
|
|
7693
|
-
const strategyMemory = asRecord4(plan.strategyMemoryStatus);
|
|
7694
|
-
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
7695
|
-
const statusTemplateRecord = asRecord4(statusTemplate);
|
|
7696
|
-
const flowTemplate = plan.mcpFlow.map((step) => asRecord4(step.arguments).strategy_template ?? asRecord4(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
7697
|
-
return campaignAgentString(
|
|
7698
|
-
buildRequest.strategyTemplate,
|
|
7699
|
-
buildRequest.strategy_template,
|
|
7700
|
-
statusTemplate,
|
|
7701
|
-
statusTemplateRecord.slug,
|
|
7702
|
-
statusTemplateRecord.id,
|
|
7703
|
-
flowTemplate
|
|
7704
|
-
);
|
|
7705
|
-
}
|
|
7706
|
-
function summarizeCampaignAgentStrategyMemory(strategyMemory) {
|
|
7707
|
-
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
7708
|
-
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
7709
|
-
const templateRecord = asRecord4(template);
|
|
7710
|
-
const coverage = asRecord4(strategyMemory.coverage);
|
|
7711
|
-
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
7712
|
-
const sourceGroups = rawSourceGroups.map((group) => {
|
|
7713
|
-
const sourceGroup = asRecord4(group);
|
|
7714
|
-
return {
|
|
7715
|
-
id: sourceGroup.id ?? null,
|
|
7716
|
-
required: sourceGroup.required ?? null,
|
|
7717
|
-
ready: sourceGroup.ready ?? null,
|
|
7718
|
-
counts: asRecord4(sourceGroup.counts)
|
|
7719
|
-
};
|
|
7720
|
-
});
|
|
7721
|
-
return {
|
|
7722
|
-
ready: strategyMemory.ready ?? null,
|
|
7723
|
-
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
7724
|
-
source_tool: campaignAgentString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
7725
|
-
strategy_template: {
|
|
7726
|
-
slug: campaignAgentString(template, templateRecord.slug, templateRecord.id),
|
|
7727
|
-
label: campaignAgentString(templateRecord.label)
|
|
7728
|
-
},
|
|
7729
|
-
coverage: {
|
|
7730
|
-
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
7731
|
-
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
7732
|
-
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
7733
|
-
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
7734
|
-
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
7735
|
-
memories: coverage.memories ?? null
|
|
7736
|
-
},
|
|
7737
|
-
source_groups: sourceGroups,
|
|
7738
|
-
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
7739
|
-
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
7740
|
-
};
|
|
7741
|
-
}
|
|
7742
|
-
function summarizeCampaignAgentDryRun(dryRunResult) {
|
|
7743
|
-
return {
|
|
7744
|
-
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
7745
|
-
status: dryRunResult.status ?? null,
|
|
7746
|
-
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
7747
|
-
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
7748
|
-
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
7749
|
-
};
|
|
7750
|
-
}
|
|
7751
7758
|
function printCampaignAgentProof(proof) {
|
|
7752
7759
|
console.log(`Campaign-agent proof: ${proof.success ? "passed" : "failed"}`);
|
|
7753
7760
|
const campaign = asRecord4(proof.campaign);
|
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-EVFQETTN.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli.ts
|
|
9
9
|
import { readFileSync, writeFileSync } from "fs";
|
|
@@ -426,12 +426,11 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
426
426
|
if (!readiness.summary.ready) process.exitCode = 1;
|
|
427
427
|
return;
|
|
428
428
|
}
|
|
429
|
-
const plan = await signaliz.campaignBuilderAgent.createPlan(request, planOptions);
|
|
430
429
|
if (subcommand === "proof" || subcommand === "smoke") {
|
|
431
|
-
const
|
|
430
|
+
const proof = await signaliz.campaignBuilderAgent.proof(request, {
|
|
431
|
+
...planOptions,
|
|
432
432
|
idempotencyKey: stringFlag(flags, "idempotency-key")
|
|
433
433
|
});
|
|
434
|
-
const proof = createCampaignAgentProofReceipt(plan, result);
|
|
435
434
|
if (booleanFlag(flags, "json")) {
|
|
436
435
|
printJson(proof);
|
|
437
436
|
} else {
|
|
@@ -440,6 +439,7 @@ async function handleCampaignAgentCommand(signaliz, argv) {
|
|
|
440
439
|
if (!proof.success) process.exitCode = 1;
|
|
441
440
|
return;
|
|
442
441
|
}
|
|
442
|
+
const plan = await signaliz.campaignBuilderAgent.createPlan(request, planOptions);
|
|
443
443
|
if (isCommitPlan) {
|
|
444
444
|
const result = await signaliz.campaignBuilderAgent.commitPlan(plan, {
|
|
445
445
|
confirm: isConfirmedCommit,
|
|
@@ -1031,138 +1031,6 @@ function printCampaignAgentRows(result) {
|
|
|
1031
1031
|
function asRecord(value) {
|
|
1032
1032
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
1033
1033
|
}
|
|
1034
|
-
function createCampaignAgentProofReceipt(plan, result) {
|
|
1035
|
-
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
1036
|
-
const dryRunResult = asRecord(result);
|
|
1037
|
-
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
1038
|
-
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
1039
|
-
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
1040
|
-
const gates = [
|
|
1041
|
-
{
|
|
1042
|
-
id: "strategy_memory_ready",
|
|
1043
|
-
passed: memoryReady,
|
|
1044
|
-
ready: strategyMemory.ready ?? null,
|
|
1045
|
-
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
1046
|
-
},
|
|
1047
|
-
{
|
|
1048
|
-
id: "campaign_plan_ready",
|
|
1049
|
-
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
1050
|
-
plan_id: plan.planId,
|
|
1051
|
-
flow_steps: plan.mcpFlow.length
|
|
1052
|
-
},
|
|
1053
|
-
{
|
|
1054
|
-
id: "approval_gates_present",
|
|
1055
|
-
passed: plan.approvals.length > 0,
|
|
1056
|
-
approval_types: plan.approvals.map((approval) => approval.type)
|
|
1057
|
-
},
|
|
1058
|
-
{
|
|
1059
|
-
id: "dry_run_completed",
|
|
1060
|
-
passed: dryRunCompleted,
|
|
1061
|
-
status: dryRunResult.status ?? null,
|
|
1062
|
-
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
id: "no_spendful_launch",
|
|
1066
|
-
passed: noLaunch,
|
|
1067
|
-
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
1068
|
-
}
|
|
1069
|
-
];
|
|
1070
|
-
return {
|
|
1071
|
-
receipt_version: "campaign-agent-proof.v1",
|
|
1072
|
-
source: "signaliz campaign-agent proof",
|
|
1073
|
-
success: gates.every((gate) => gate.passed),
|
|
1074
|
-
safety: {
|
|
1075
|
-
spendful_tools_called: false,
|
|
1076
|
-
external_writes_called: false,
|
|
1077
|
-
sender_loads_called: false,
|
|
1078
|
-
email_sends_called: false,
|
|
1079
|
-
dry_run_only: true
|
|
1080
|
-
},
|
|
1081
|
-
campaign: {
|
|
1082
|
-
plan_id: plan.planId,
|
|
1083
|
-
campaign_name: plan.campaignName,
|
|
1084
|
-
strategy_template: campaignAgentStrategyTemplate(plan),
|
|
1085
|
-
target_count: plan.targetCount,
|
|
1086
|
-
estimated_credits: plan.estimatedCredits,
|
|
1087
|
-
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
1088
|
-
},
|
|
1089
|
-
gates,
|
|
1090
|
-
strategy_memory_status: summarizeCampaignAgentStrategyMemory(strategyMemory),
|
|
1091
|
-
dry_run_result: summarizeCampaignAgentDryRun(dryRunResult),
|
|
1092
|
-
recommended_next_actions: [
|
|
1093
|
-
"Review the plan, approvals, and dry-run result.",
|
|
1094
|
-
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
1095
|
-
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
1096
|
-
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
1097
|
-
]
|
|
1098
|
-
};
|
|
1099
|
-
}
|
|
1100
|
-
function campaignAgentString(...values) {
|
|
1101
|
-
for (const value of values) {
|
|
1102
|
-
if (typeof value === "string" && value.trim()) return value;
|
|
1103
|
-
}
|
|
1104
|
-
return null;
|
|
1105
|
-
}
|
|
1106
|
-
function campaignAgentStrategyTemplate(plan) {
|
|
1107
|
-
const buildRequest = asRecord(plan.buildRequest);
|
|
1108
|
-
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
1109
|
-
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
1110
|
-
const statusTemplateRecord = asRecord(statusTemplate);
|
|
1111
|
-
const flowTemplate = plan.mcpFlow.map((step) => asRecord(step.arguments).strategy_template ?? asRecord(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
1112
|
-
return campaignAgentString(
|
|
1113
|
-
buildRequest.strategyTemplate,
|
|
1114
|
-
buildRequest.strategy_template,
|
|
1115
|
-
statusTemplate,
|
|
1116
|
-
statusTemplateRecord.slug,
|
|
1117
|
-
statusTemplateRecord.id,
|
|
1118
|
-
flowTemplate
|
|
1119
|
-
);
|
|
1120
|
-
}
|
|
1121
|
-
function summarizeCampaignAgentStrategyMemory(strategyMemory) {
|
|
1122
|
-
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
1123
|
-
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
1124
|
-
const templateRecord = asRecord(template);
|
|
1125
|
-
const coverage = asRecord(strategyMemory.coverage);
|
|
1126
|
-
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
1127
|
-
const sourceGroups = rawSourceGroups.map((group) => {
|
|
1128
|
-
const sourceGroup = asRecord(group);
|
|
1129
|
-
return {
|
|
1130
|
-
id: sourceGroup.id ?? null,
|
|
1131
|
-
required: sourceGroup.required ?? null,
|
|
1132
|
-
ready: sourceGroup.ready ?? null,
|
|
1133
|
-
counts: asRecord(sourceGroup.counts)
|
|
1134
|
-
};
|
|
1135
|
-
});
|
|
1136
|
-
return {
|
|
1137
|
-
ready: strategyMemory.ready ?? null,
|
|
1138
|
-
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
1139
|
-
source_tool: campaignAgentString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
1140
|
-
strategy_template: {
|
|
1141
|
-
slug: campaignAgentString(template, templateRecord.slug, templateRecord.id),
|
|
1142
|
-
label: campaignAgentString(templateRecord.label)
|
|
1143
|
-
},
|
|
1144
|
-
coverage: {
|
|
1145
|
-
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
1146
|
-
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
1147
|
-
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
1148
|
-
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
1149
|
-
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
1150
|
-
memories: coverage.memories ?? null
|
|
1151
|
-
},
|
|
1152
|
-
source_groups: sourceGroups,
|
|
1153
|
-
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
1154
|
-
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
1155
|
-
};
|
|
1156
|
-
}
|
|
1157
|
-
function summarizeCampaignAgentDryRun(dryRunResult) {
|
|
1158
|
-
return {
|
|
1159
|
-
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
1160
|
-
status: dryRunResult.status ?? null,
|
|
1161
|
-
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
1162
|
-
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
1163
|
-
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
1164
|
-
};
|
|
1165
|
-
}
|
|
1166
1034
|
function printCampaignAgentProof(proof) {
|
|
1167
1035
|
console.log(`Campaign-agent proof: ${proof.success ? "passed" : "failed"}`);
|
|
1168
1036
|
const campaign = asRecord(proof.campaign);
|
package/dist/index.d.mts
CHANGED
|
@@ -1094,6 +1094,34 @@ interface CampaignBuilderApprovedRunResult {
|
|
|
1094
1094
|
finalStatus?: CampaignBuildStatus;
|
|
1095
1095
|
deliveryApproval?: ApproveDeliveryResult;
|
|
1096
1096
|
}
|
|
1097
|
+
type CampaignBuilderProofOptions = CampaignBuilderPlanOptions & BuildOptions;
|
|
1098
|
+
interface CampaignBuilderProofReceipt {
|
|
1099
|
+
receipt_version: 'campaign-agent-proof.v1';
|
|
1100
|
+
source: string;
|
|
1101
|
+
success: boolean;
|
|
1102
|
+
safety: {
|
|
1103
|
+
spendful_tools_called: boolean;
|
|
1104
|
+
external_writes_called: boolean;
|
|
1105
|
+
sender_loads_called: boolean;
|
|
1106
|
+
email_sends_called: boolean;
|
|
1107
|
+
dry_run_only: boolean;
|
|
1108
|
+
};
|
|
1109
|
+
campaign: {
|
|
1110
|
+
plan_id: string;
|
|
1111
|
+
campaign_name: string;
|
|
1112
|
+
strategy_template: string | null;
|
|
1113
|
+
target_count: number;
|
|
1114
|
+
estimated_credits: number;
|
|
1115
|
+
operating_playbooks: string[];
|
|
1116
|
+
};
|
|
1117
|
+
gates: Array<UnknownRecord$1 & {
|
|
1118
|
+
id: string;
|
|
1119
|
+
passed: boolean;
|
|
1120
|
+
}>;
|
|
1121
|
+
strategy_memory_status: UnknownRecord$1;
|
|
1122
|
+
dry_run_result: UnknownRecord$1;
|
|
1123
|
+
recommended_next_actions: string[];
|
|
1124
|
+
}
|
|
1097
1125
|
interface CampaignBuilderBuildReviewOptions extends CampaignRowsOptions {
|
|
1098
1126
|
/** Number of rows to sample for review. Defaults to 100. */
|
|
1099
1127
|
limit?: number;
|
|
@@ -1178,6 +1206,7 @@ declare class CampaignBuilderAgent {
|
|
|
1178
1206
|
constructor(client: HttpClient);
|
|
1179
1207
|
createPlan(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderAgentPlan>;
|
|
1180
1208
|
readiness(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderReadinessPacket>;
|
|
1209
|
+
proof(request: CampaignBuilderAgentRequest, options?: CampaignBuilderProofOptions): Promise<CampaignBuilderProofReceipt>;
|
|
1181
1210
|
commitPlan(plan: CampaignBuilderAgentPlan, options?: CampaignBuilderPlanCommitOptions): Promise<CampaignBuilderPlanCommitResult>;
|
|
1182
1211
|
dryRunPlan(plan: CampaignBuilderAgentPlan, options?: BuildOptions): Promise<CampaignBuildResult>;
|
|
1183
1212
|
buildApprovedPlan(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval, options?: CampaignBuilderBuildOptions): Promise<CampaignBuildResult>;
|
|
@@ -1208,6 +1237,7 @@ declare function createCampaignBuilderAgentPlan(request: CampaignBuilderAgentReq
|
|
|
1208
1237
|
warnings?: string[];
|
|
1209
1238
|
}): CampaignBuilderAgentPlan;
|
|
1210
1239
|
declare function createCampaignBuilderReadiness(plan: CampaignBuilderAgentPlan): CampaignBuilderReadinessPacket;
|
|
1240
|
+
declare function createCampaignBuilderProofReceipt(plan: CampaignBuilderAgentPlan, result: unknown): CampaignBuilderProofReceipt;
|
|
1211
1241
|
declare function getMissingCampaignBuilderApprovals(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval): CampaignBuilderRequiredApproval[];
|
|
1212
1242
|
declare function createCampaignBuilderApproval(plan: CampaignBuilderAgentPlan, input: Omit<CampaignBuilderApproval, 'planId' | 'approvedAt'>): CampaignBuilderApproval;
|
|
1213
1243
|
declare function getCampaignBuilderStrategyTemplate(value: unknown): CampaignBuilderStrategyTemplate | undefined;
|
|
@@ -3468,4 +3498,4 @@ declare class Signaliz {
|
|
|
3468
3498
|
discover(query: string, category?: string): Promise<MCPToolInfo[]>;
|
|
3469
3499
|
}
|
|
3470
3500
|
|
|
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 };
|
|
3501
|
+
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 CampaignBuilderProofOptions, type CampaignBuilderProofReceipt, 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, createCampaignBuilderProofReceipt, createCampaignBuilderReadiness, createCampaignBuilderToolRoute, getCampaignBuilderOperatingPlaybook, getCampaignBuilderOperatingPlaybooksForRequest, getCampaignBuilderStrategyTemplate, getMissingCampaignBuilderApprovals, normalizeExecutionReference };
|
package/dist/index.d.ts
CHANGED
|
@@ -1094,6 +1094,34 @@ interface CampaignBuilderApprovedRunResult {
|
|
|
1094
1094
|
finalStatus?: CampaignBuildStatus;
|
|
1095
1095
|
deliveryApproval?: ApproveDeliveryResult;
|
|
1096
1096
|
}
|
|
1097
|
+
type CampaignBuilderProofOptions = CampaignBuilderPlanOptions & BuildOptions;
|
|
1098
|
+
interface CampaignBuilderProofReceipt {
|
|
1099
|
+
receipt_version: 'campaign-agent-proof.v1';
|
|
1100
|
+
source: string;
|
|
1101
|
+
success: boolean;
|
|
1102
|
+
safety: {
|
|
1103
|
+
spendful_tools_called: boolean;
|
|
1104
|
+
external_writes_called: boolean;
|
|
1105
|
+
sender_loads_called: boolean;
|
|
1106
|
+
email_sends_called: boolean;
|
|
1107
|
+
dry_run_only: boolean;
|
|
1108
|
+
};
|
|
1109
|
+
campaign: {
|
|
1110
|
+
plan_id: string;
|
|
1111
|
+
campaign_name: string;
|
|
1112
|
+
strategy_template: string | null;
|
|
1113
|
+
target_count: number;
|
|
1114
|
+
estimated_credits: number;
|
|
1115
|
+
operating_playbooks: string[];
|
|
1116
|
+
};
|
|
1117
|
+
gates: Array<UnknownRecord$1 & {
|
|
1118
|
+
id: string;
|
|
1119
|
+
passed: boolean;
|
|
1120
|
+
}>;
|
|
1121
|
+
strategy_memory_status: UnknownRecord$1;
|
|
1122
|
+
dry_run_result: UnknownRecord$1;
|
|
1123
|
+
recommended_next_actions: string[];
|
|
1124
|
+
}
|
|
1097
1125
|
interface CampaignBuilderBuildReviewOptions extends CampaignRowsOptions {
|
|
1098
1126
|
/** Number of rows to sample for review. Defaults to 100. */
|
|
1099
1127
|
limit?: number;
|
|
@@ -1178,6 +1206,7 @@ declare class CampaignBuilderAgent {
|
|
|
1178
1206
|
constructor(client: HttpClient);
|
|
1179
1207
|
createPlan(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderAgentPlan>;
|
|
1180
1208
|
readiness(request: CampaignBuilderAgentRequest, options?: CampaignBuilderPlanOptions): Promise<CampaignBuilderReadinessPacket>;
|
|
1209
|
+
proof(request: CampaignBuilderAgentRequest, options?: CampaignBuilderProofOptions): Promise<CampaignBuilderProofReceipt>;
|
|
1181
1210
|
commitPlan(plan: CampaignBuilderAgentPlan, options?: CampaignBuilderPlanCommitOptions): Promise<CampaignBuilderPlanCommitResult>;
|
|
1182
1211
|
dryRunPlan(plan: CampaignBuilderAgentPlan, options?: BuildOptions): Promise<CampaignBuildResult>;
|
|
1183
1212
|
buildApprovedPlan(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval, options?: CampaignBuilderBuildOptions): Promise<CampaignBuildResult>;
|
|
@@ -1208,6 +1237,7 @@ declare function createCampaignBuilderAgentPlan(request: CampaignBuilderAgentReq
|
|
|
1208
1237
|
warnings?: string[];
|
|
1209
1238
|
}): CampaignBuilderAgentPlan;
|
|
1210
1239
|
declare function createCampaignBuilderReadiness(plan: CampaignBuilderAgentPlan): CampaignBuilderReadinessPacket;
|
|
1240
|
+
declare function createCampaignBuilderProofReceipt(plan: CampaignBuilderAgentPlan, result: unknown): CampaignBuilderProofReceipt;
|
|
1211
1241
|
declare function getMissingCampaignBuilderApprovals(plan: CampaignBuilderAgentPlan, approval: CampaignBuilderApproval): CampaignBuilderRequiredApproval[];
|
|
1212
1242
|
declare function createCampaignBuilderApproval(plan: CampaignBuilderAgentPlan, input: Omit<CampaignBuilderApproval, 'planId' | 'approvedAt'>): CampaignBuilderApproval;
|
|
1213
1243
|
declare function getCampaignBuilderStrategyTemplate(value: unknown): CampaignBuilderStrategyTemplate | undefined;
|
|
@@ -3468,4 +3498,4 @@ declare class Signaliz {
|
|
|
3468
3498
|
discover(query: string, category?: string): Promise<MCPToolInfo[]>;
|
|
3469
3499
|
}
|
|
3470
3500
|
|
|
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 };
|
|
3501
|
+
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 CampaignBuilderProofOptions, type CampaignBuilderProofReceipt, 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, createCampaignBuilderProofReceipt, 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
|
+
createCampaignBuilderProofReceipt: () => createCampaignBuilderProofReceipt,
|
|
41
42
|
createCampaignBuilderReadiness: () => createCampaignBuilderReadiness,
|
|
42
43
|
createCampaignBuilderToolRoute: () => createCampaignBuilderToolRoute,
|
|
43
44
|
getCampaignBuilderOperatingPlaybook: () => getCampaignBuilderOperatingPlaybook,
|
|
@@ -1748,6 +1749,13 @@ var CampaignBuilderAgent = class {
|
|
|
1748
1749
|
const plan = await this.createPlan(request, options);
|
|
1749
1750
|
return createCampaignBuilderReadiness(plan);
|
|
1750
1751
|
}
|
|
1752
|
+
async proof(request, options = {}) {
|
|
1753
|
+
const plan = await this.createPlan(request, options);
|
|
1754
|
+
const result = await this.dryRunPlan(plan, {
|
|
1755
|
+
idempotencyKey: options.idempotencyKey
|
|
1756
|
+
});
|
|
1757
|
+
return createCampaignBuilderProofReceipt(plan, result);
|
|
1758
|
+
}
|
|
1751
1759
|
async commitPlan(plan, options = {}) {
|
|
1752
1760
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1753
1761
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2193,6 +2201,72 @@ function createCampaignBuilderReadiness(plan) {
|
|
|
2193
2201
|
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2194
2202
|
};
|
|
2195
2203
|
}
|
|
2204
|
+
function createCampaignBuilderProofReceipt(plan, result) {
|
|
2205
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2206
|
+
const dryRunResult = asRecord(result);
|
|
2207
|
+
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
2208
|
+
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
2209
|
+
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
2210
|
+
const gates = [
|
|
2211
|
+
{
|
|
2212
|
+
id: "strategy_memory_ready",
|
|
2213
|
+
passed: memoryReady,
|
|
2214
|
+
ready: strategyMemory.ready ?? null,
|
|
2215
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
2216
|
+
},
|
|
2217
|
+
{
|
|
2218
|
+
id: "campaign_plan_ready",
|
|
2219
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2220
|
+
plan_id: plan.planId,
|
|
2221
|
+
flow_steps: plan.mcpFlow.length
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
id: "approval_gates_present",
|
|
2225
|
+
passed: plan.approvals.length > 0,
|
|
2226
|
+
approval_types: plan.approvals.map((approval) => approval.type)
|
|
2227
|
+
},
|
|
2228
|
+
{
|
|
2229
|
+
id: "dry_run_completed",
|
|
2230
|
+
passed: dryRunCompleted,
|
|
2231
|
+
status: dryRunResult.status ?? null,
|
|
2232
|
+
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
id: "no_spendful_launch",
|
|
2236
|
+
passed: noLaunch,
|
|
2237
|
+
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
2238
|
+
}
|
|
2239
|
+
];
|
|
2240
|
+
return {
|
|
2241
|
+
receipt_version: "campaign-agent-proof.v1",
|
|
2242
|
+
source: "signaliz.campaignBuilderAgent.proof",
|
|
2243
|
+
success: gates.every((gate) => gate.passed),
|
|
2244
|
+
safety: {
|
|
2245
|
+
spendful_tools_called: false,
|
|
2246
|
+
external_writes_called: false,
|
|
2247
|
+
sender_loads_called: false,
|
|
2248
|
+
email_sends_called: false,
|
|
2249
|
+
dry_run_only: true
|
|
2250
|
+
},
|
|
2251
|
+
campaign: {
|
|
2252
|
+
plan_id: plan.planId,
|
|
2253
|
+
campaign_name: plan.campaignName,
|
|
2254
|
+
strategy_template: campaignBuilderProofStrategyTemplate(plan),
|
|
2255
|
+
target_count: plan.targetCount,
|
|
2256
|
+
estimated_credits: plan.estimatedCredits,
|
|
2257
|
+
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
2258
|
+
},
|
|
2259
|
+
gates,
|
|
2260
|
+
strategy_memory_status: summarizeCampaignBuilderProofStrategyMemory(strategyMemory),
|
|
2261
|
+
dry_run_result: summarizeCampaignBuilderProofDryRun(dryRunResult),
|
|
2262
|
+
recommended_next_actions: [
|
|
2263
|
+
"Review the plan, approvals, and dry-run result.",
|
|
2264
|
+
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
2265
|
+
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
2266
|
+
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
2267
|
+
]
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2196
2270
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2197
2271
|
if (approval.planId !== plan.planId) {
|
|
2198
2272
|
return plan.approvals;
|
|
@@ -3635,6 +3709,72 @@ function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
|
3635
3709
|
];
|
|
3636
3710
|
return actions.filter((item) => Boolean(item));
|
|
3637
3711
|
}
|
|
3712
|
+
function campaignBuilderProofStrategyTemplate(plan) {
|
|
3713
|
+
const buildRequest = asRecord(plan.buildRequest);
|
|
3714
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
3715
|
+
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3716
|
+
const statusTemplateRecord = asRecord(statusTemplate);
|
|
3717
|
+
const flowTemplate = plan.mcpFlow.map((step) => asRecord(step.arguments).strategy_template ?? asRecord(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
3718
|
+
return firstNonEmptyString(
|
|
3719
|
+
buildRequest.strategyTemplate,
|
|
3720
|
+
buildRequest.strategy_template,
|
|
3721
|
+
statusTemplate,
|
|
3722
|
+
statusTemplateRecord.slug,
|
|
3723
|
+
statusTemplateRecord.id,
|
|
3724
|
+
flowTemplate
|
|
3725
|
+
);
|
|
3726
|
+
}
|
|
3727
|
+
function summarizeCampaignBuilderProofStrategyMemory(strategyMemory) {
|
|
3728
|
+
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
3729
|
+
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3730
|
+
const templateRecord = asRecord(template);
|
|
3731
|
+
const coverage = asRecord(strategyMemory.coverage);
|
|
3732
|
+
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
3733
|
+
const sourceGroups = rawSourceGroups.map((group) => {
|
|
3734
|
+
const sourceGroup = asRecord(group);
|
|
3735
|
+
return {
|
|
3736
|
+
id: sourceGroup.id ?? null,
|
|
3737
|
+
required: sourceGroup.required ?? null,
|
|
3738
|
+
ready: sourceGroup.ready ?? null,
|
|
3739
|
+
counts: asRecord(sourceGroup.counts)
|
|
3740
|
+
};
|
|
3741
|
+
});
|
|
3742
|
+
return {
|
|
3743
|
+
ready: strategyMemory.ready ?? null,
|
|
3744
|
+
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
3745
|
+
source_tool: firstNonEmptyString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
3746
|
+
strategy_template: {
|
|
3747
|
+
slug: firstNonEmptyString(template, templateRecord.slug, templateRecord.id),
|
|
3748
|
+
label: firstNonEmptyString(templateRecord.label)
|
|
3749
|
+
},
|
|
3750
|
+
coverage: {
|
|
3751
|
+
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
3752
|
+
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
3753
|
+
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
3754
|
+
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
3755
|
+
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
3756
|
+
memories: coverage.memories ?? null
|
|
3757
|
+
},
|
|
3758
|
+
source_groups: sourceGroups,
|
|
3759
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
3760
|
+
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
3761
|
+
};
|
|
3762
|
+
}
|
|
3763
|
+
function summarizeCampaignBuilderProofDryRun(dryRunResult) {
|
|
3764
|
+
return {
|
|
3765
|
+
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
3766
|
+
status: dryRunResult.status ?? null,
|
|
3767
|
+
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
3768
|
+
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
3769
|
+
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
3770
|
+
};
|
|
3771
|
+
}
|
|
3772
|
+
function firstNonEmptyString(...values) {
|
|
3773
|
+
for (const value of values) {
|
|
3774
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
3775
|
+
}
|
|
3776
|
+
return null;
|
|
3777
|
+
}
|
|
3638
3778
|
function diagnosticMessages2(value) {
|
|
3639
3779
|
if (!Array.isArray(value)) return [];
|
|
3640
3780
|
return value.map((item) => {
|
|
@@ -6654,6 +6794,7 @@ var Signaliz = class {
|
|
|
6654
6794
|
createCampaignBuilderAgentPlan,
|
|
6655
6795
|
createCampaignBuilderAgentRequestTemplate,
|
|
6656
6796
|
createCampaignBuilderApproval,
|
|
6797
|
+
createCampaignBuilderProofReceipt,
|
|
6657
6798
|
createCampaignBuilderReadiness,
|
|
6658
6799
|
createCampaignBuilderToolRoute,
|
|
6659
6800
|
getCampaignBuilderOperatingPlaybook,
|
package/dist/index.mjs
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
createCampaignBuilderAgentPlan,
|
|
18
18
|
createCampaignBuilderAgentRequestTemplate,
|
|
19
19
|
createCampaignBuilderApproval,
|
|
20
|
+
createCampaignBuilderProofReceipt,
|
|
20
21
|
createCampaignBuilderReadiness,
|
|
21
22
|
createCampaignBuilderToolRoute,
|
|
22
23
|
getCampaignBuilderOperatingPlaybook,
|
|
@@ -24,7 +25,7 @@ import {
|
|
|
24
25
|
getCampaignBuilderStrategyTemplate,
|
|
25
26
|
getMissingCampaignBuilderApprovals,
|
|
26
27
|
normalizeExecutionReference
|
|
27
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-EVFQETTN.mjs";
|
|
28
29
|
export {
|
|
29
30
|
Ai,
|
|
30
31
|
CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS,
|
|
@@ -44,6 +45,7 @@ export {
|
|
|
44
45
|
createCampaignBuilderAgentPlan,
|
|
45
46
|
createCampaignBuilderAgentRequestTemplate,
|
|
46
47
|
createCampaignBuilderApproval,
|
|
48
|
+
createCampaignBuilderProofReceipt,
|
|
47
49
|
createCampaignBuilderReadiness,
|
|
48
50
|
createCampaignBuilderToolRoute,
|
|
49
51
|
getCampaignBuilderOperatingPlaybook,
|
package/dist/mcp-config.js
CHANGED
|
@@ -1721,6 +1721,13 @@ var CampaignBuilderAgent = class {
|
|
|
1721
1721
|
const plan = await this.createPlan(request, options);
|
|
1722
1722
|
return createCampaignBuilderReadiness(plan);
|
|
1723
1723
|
}
|
|
1724
|
+
async proof(request, options = {}) {
|
|
1725
|
+
const plan = await this.createPlan(request, options);
|
|
1726
|
+
const result = await this.dryRunPlan(plan, {
|
|
1727
|
+
idempotencyKey: options.idempotencyKey
|
|
1728
|
+
});
|
|
1729
|
+
return createCampaignBuilderProofReceipt(plan, result);
|
|
1730
|
+
}
|
|
1724
1731
|
async commitPlan(plan, options = {}) {
|
|
1725
1732
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1726
1733
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2166,6 +2173,72 @@ function createCampaignBuilderReadiness(plan) {
|
|
|
2166
2173
|
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2167
2174
|
};
|
|
2168
2175
|
}
|
|
2176
|
+
function createCampaignBuilderProofReceipt(plan, result) {
|
|
2177
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2178
|
+
const dryRunResult = asRecord(result);
|
|
2179
|
+
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
2180
|
+
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
2181
|
+
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
2182
|
+
const gates = [
|
|
2183
|
+
{
|
|
2184
|
+
id: "strategy_memory_ready",
|
|
2185
|
+
passed: memoryReady,
|
|
2186
|
+
ready: strategyMemory.ready ?? null,
|
|
2187
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
2188
|
+
},
|
|
2189
|
+
{
|
|
2190
|
+
id: "campaign_plan_ready",
|
|
2191
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2192
|
+
plan_id: plan.planId,
|
|
2193
|
+
flow_steps: plan.mcpFlow.length
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
id: "approval_gates_present",
|
|
2197
|
+
passed: plan.approvals.length > 0,
|
|
2198
|
+
approval_types: plan.approvals.map((approval) => approval.type)
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
id: "dry_run_completed",
|
|
2202
|
+
passed: dryRunCompleted,
|
|
2203
|
+
status: dryRunResult.status ?? null,
|
|
2204
|
+
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
2205
|
+
},
|
|
2206
|
+
{
|
|
2207
|
+
id: "no_spendful_launch",
|
|
2208
|
+
passed: noLaunch,
|
|
2209
|
+
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
2210
|
+
}
|
|
2211
|
+
];
|
|
2212
|
+
return {
|
|
2213
|
+
receipt_version: "campaign-agent-proof.v1",
|
|
2214
|
+
source: "signaliz.campaignBuilderAgent.proof",
|
|
2215
|
+
success: gates.every((gate) => gate.passed),
|
|
2216
|
+
safety: {
|
|
2217
|
+
spendful_tools_called: false,
|
|
2218
|
+
external_writes_called: false,
|
|
2219
|
+
sender_loads_called: false,
|
|
2220
|
+
email_sends_called: false,
|
|
2221
|
+
dry_run_only: true
|
|
2222
|
+
},
|
|
2223
|
+
campaign: {
|
|
2224
|
+
plan_id: plan.planId,
|
|
2225
|
+
campaign_name: plan.campaignName,
|
|
2226
|
+
strategy_template: campaignBuilderProofStrategyTemplate(plan),
|
|
2227
|
+
target_count: plan.targetCount,
|
|
2228
|
+
estimated_credits: plan.estimatedCredits,
|
|
2229
|
+
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
2230
|
+
},
|
|
2231
|
+
gates,
|
|
2232
|
+
strategy_memory_status: summarizeCampaignBuilderProofStrategyMemory(strategyMemory),
|
|
2233
|
+
dry_run_result: summarizeCampaignBuilderProofDryRun(dryRunResult),
|
|
2234
|
+
recommended_next_actions: [
|
|
2235
|
+
"Review the plan, approvals, and dry-run result.",
|
|
2236
|
+
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
2237
|
+
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
2238
|
+
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
2239
|
+
]
|
|
2240
|
+
};
|
|
2241
|
+
}
|
|
2169
2242
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2170
2243
|
if (approval.planId !== plan.planId) {
|
|
2171
2244
|
return plan.approvals;
|
|
@@ -3507,6 +3580,72 @@ function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
|
3507
3580
|
];
|
|
3508
3581
|
return actions.filter((item) => Boolean(item));
|
|
3509
3582
|
}
|
|
3583
|
+
function campaignBuilderProofStrategyTemplate(plan) {
|
|
3584
|
+
const buildRequest = asRecord(plan.buildRequest);
|
|
3585
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
3586
|
+
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3587
|
+
const statusTemplateRecord = asRecord(statusTemplate);
|
|
3588
|
+
const flowTemplate = plan.mcpFlow.map((step) => asRecord(step.arguments).strategy_template ?? asRecord(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
3589
|
+
return firstNonEmptyString(
|
|
3590
|
+
buildRequest.strategyTemplate,
|
|
3591
|
+
buildRequest.strategy_template,
|
|
3592
|
+
statusTemplate,
|
|
3593
|
+
statusTemplateRecord.slug,
|
|
3594
|
+
statusTemplateRecord.id,
|
|
3595
|
+
flowTemplate
|
|
3596
|
+
);
|
|
3597
|
+
}
|
|
3598
|
+
function summarizeCampaignBuilderProofStrategyMemory(strategyMemory) {
|
|
3599
|
+
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
3600
|
+
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3601
|
+
const templateRecord = asRecord(template);
|
|
3602
|
+
const coverage = asRecord(strategyMemory.coverage);
|
|
3603
|
+
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
3604
|
+
const sourceGroups = rawSourceGroups.map((group) => {
|
|
3605
|
+
const sourceGroup = asRecord(group);
|
|
3606
|
+
return {
|
|
3607
|
+
id: sourceGroup.id ?? null,
|
|
3608
|
+
required: sourceGroup.required ?? null,
|
|
3609
|
+
ready: sourceGroup.ready ?? null,
|
|
3610
|
+
counts: asRecord(sourceGroup.counts)
|
|
3611
|
+
};
|
|
3612
|
+
});
|
|
3613
|
+
return {
|
|
3614
|
+
ready: strategyMemory.ready ?? null,
|
|
3615
|
+
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
3616
|
+
source_tool: firstNonEmptyString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
3617
|
+
strategy_template: {
|
|
3618
|
+
slug: firstNonEmptyString(template, templateRecord.slug, templateRecord.id),
|
|
3619
|
+
label: firstNonEmptyString(templateRecord.label)
|
|
3620
|
+
},
|
|
3621
|
+
coverage: {
|
|
3622
|
+
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
3623
|
+
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
3624
|
+
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
3625
|
+
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
3626
|
+
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
3627
|
+
memories: coverage.memories ?? null
|
|
3628
|
+
},
|
|
3629
|
+
source_groups: sourceGroups,
|
|
3630
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
3631
|
+
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
3632
|
+
};
|
|
3633
|
+
}
|
|
3634
|
+
function summarizeCampaignBuilderProofDryRun(dryRunResult) {
|
|
3635
|
+
return {
|
|
3636
|
+
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
3637
|
+
status: dryRunResult.status ?? null,
|
|
3638
|
+
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
3639
|
+
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
3640
|
+
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3643
|
+
function firstNonEmptyString(...values) {
|
|
3644
|
+
for (const value of values) {
|
|
3645
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
3646
|
+
}
|
|
3647
|
+
return null;
|
|
3648
|
+
}
|
|
3510
3649
|
function diagnosticMessages2(value) {
|
|
3511
3650
|
if (!Array.isArray(value)) return [];
|
|
3512
3651
|
return value.map((item) => {
|
package/dist/mcp-config.mjs
CHANGED