@signaliz/sdk 1.0.13 → 1.0.15
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 +27 -0
- package/dist/{chunk-DJVOGXVD.mjs → chunk-6OZWMAV3.mjs} +351 -0
- package/dist/cli.js +406 -137
- package/dist/cli.mjs +60 -139
- package/dist/index.d.mts +84 -1
- package/dist/index.d.ts +84 -1
- package/dist/index.js +353 -0
- package/dist/index.mjs +5 -1
- package/dist/mcp-config.js +451 -0
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38,6 +38,8 @@ __export(index_exports, {
|
|
|
38
38
|
createCampaignBuilderAgentPlan: () => createCampaignBuilderAgentPlan,
|
|
39
39
|
createCampaignBuilderAgentRequestTemplate: () => createCampaignBuilderAgentRequestTemplate,
|
|
40
40
|
createCampaignBuilderApproval: () => createCampaignBuilderApproval,
|
|
41
|
+
createCampaignBuilderBuildKit: () => createCampaignBuilderBuildKit,
|
|
42
|
+
createCampaignBuilderProofReceipt: () => createCampaignBuilderProofReceipt,
|
|
41
43
|
createCampaignBuilderReadiness: () => createCampaignBuilderReadiness,
|
|
42
44
|
createCampaignBuilderToolRoute: () => createCampaignBuilderToolRoute,
|
|
43
45
|
getCampaignBuilderOperatingPlaybook: () => getCampaignBuilderOperatingPlaybook,
|
|
@@ -1748,6 +1750,16 @@ var CampaignBuilderAgent = class {
|
|
|
1748
1750
|
const plan = await this.createPlan(request, options);
|
|
1749
1751
|
return createCampaignBuilderReadiness(plan);
|
|
1750
1752
|
}
|
|
1753
|
+
async proof(request, options = {}) {
|
|
1754
|
+
const plan = await this.createPlan(request, options);
|
|
1755
|
+
const result = await this.dryRunPlan(plan, {
|
|
1756
|
+
idempotencyKey: options.idempotencyKey
|
|
1757
|
+
});
|
|
1758
|
+
return createCampaignBuilderProofReceipt(plan, result);
|
|
1759
|
+
}
|
|
1760
|
+
buildKit(options = {}) {
|
|
1761
|
+
return createCampaignBuilderBuildKit(options);
|
|
1762
|
+
}
|
|
1751
1763
|
async commitPlan(plan, options = {}) {
|
|
1752
1764
|
const writeMode = options.confirm === true && options.dryRun === false;
|
|
1753
1765
|
if (writeMode && !options.approvedBy) {
|
|
@@ -2193,6 +2205,72 @@ function createCampaignBuilderReadiness(plan) {
|
|
|
2193
2205
|
nextActions: campaignReadinessNextActions(plan, ready, customRoutes.length)
|
|
2194
2206
|
};
|
|
2195
2207
|
}
|
|
2208
|
+
function createCampaignBuilderProofReceipt(plan, result) {
|
|
2209
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
2210
|
+
const dryRunResult = asRecord(result);
|
|
2211
|
+
const memoryReady = plan.strategyMemoryStatus ? strategyMemory.ready !== false : false;
|
|
2212
|
+
const dryRunCompleted = dryRunResult.dryRun === true || dryRunResult.dry_run === true || dryRunResult.status === "dry_run";
|
|
2213
|
+
const noLaunch = dryRunCompleted && !dryRunResult.campaignBuildId && !dryRunResult.campaign_build_id;
|
|
2214
|
+
const gates = [
|
|
2215
|
+
{
|
|
2216
|
+
id: "strategy_memory_ready",
|
|
2217
|
+
passed: memoryReady,
|
|
2218
|
+
ready: strategyMemory.ready ?? null,
|
|
2219
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0
|
|
2220
|
+
},
|
|
2221
|
+
{
|
|
2222
|
+
id: "campaign_plan_ready",
|
|
2223
|
+
passed: Boolean(plan.planId && plan.mcpFlow.length > 0),
|
|
2224
|
+
plan_id: plan.planId,
|
|
2225
|
+
flow_steps: plan.mcpFlow.length
|
|
2226
|
+
},
|
|
2227
|
+
{
|
|
2228
|
+
id: "approval_gates_present",
|
|
2229
|
+
passed: plan.approvals.length > 0,
|
|
2230
|
+
approval_types: plan.approvals.map((approval) => approval.type)
|
|
2231
|
+
},
|
|
2232
|
+
{
|
|
2233
|
+
id: "dry_run_completed",
|
|
2234
|
+
passed: dryRunCompleted,
|
|
2235
|
+
status: dryRunResult.status ?? null,
|
|
2236
|
+
current_phase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null
|
|
2237
|
+
},
|
|
2238
|
+
{
|
|
2239
|
+
id: "no_spendful_launch",
|
|
2240
|
+
passed: noLaunch,
|
|
2241
|
+
campaign_build_id: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null
|
|
2242
|
+
}
|
|
2243
|
+
];
|
|
2244
|
+
return {
|
|
2245
|
+
receipt_version: "campaign-agent-proof.v1",
|
|
2246
|
+
source: "signaliz.campaignBuilderAgent.proof",
|
|
2247
|
+
success: gates.every((gate) => gate.passed),
|
|
2248
|
+
safety: {
|
|
2249
|
+
spendful_tools_called: false,
|
|
2250
|
+
external_writes_called: false,
|
|
2251
|
+
sender_loads_called: false,
|
|
2252
|
+
email_sends_called: false,
|
|
2253
|
+
dry_run_only: true
|
|
2254
|
+
},
|
|
2255
|
+
campaign: {
|
|
2256
|
+
plan_id: plan.planId,
|
|
2257
|
+
campaign_name: plan.campaignName,
|
|
2258
|
+
strategy_template: campaignBuilderProofStrategyTemplate(plan),
|
|
2259
|
+
target_count: plan.targetCount,
|
|
2260
|
+
estimated_credits: plan.estimatedCredits,
|
|
2261
|
+
operating_playbooks: plan.operatingPlaybooks.map((playbook) => playbook.slug)
|
|
2262
|
+
},
|
|
2263
|
+
gates,
|
|
2264
|
+
strategy_memory_status: summarizeCampaignBuilderProofStrategyMemory(strategyMemory),
|
|
2265
|
+
dry_run_result: summarizeCampaignBuilderProofDryRun(dryRunResult),
|
|
2266
|
+
recommended_next_actions: [
|
|
2267
|
+
"Review the plan, approvals, and dry-run result.",
|
|
2268
|
+
"Use campaign-agent commit-plan --confirm-write only after review.",
|
|
2269
|
+
"Use campaign-agent build-approved only with --confirm-launch, approval identity, approval types, and spend limit.",
|
|
2270
|
+
"When an approved build reaches pending_approval, review rows and approve delivery through the Campaigns SDK."
|
|
2271
|
+
]
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2196
2274
|
function getMissingCampaignBuilderApprovals(plan, approval) {
|
|
2197
2275
|
if (approval.planId !== plan.planId) {
|
|
2198
2276
|
return plan.approvals;
|
|
@@ -2346,6 +2424,156 @@ function createCampaignBuilderAgentRequestTemplate(input = {}) {
|
|
|
2346
2424
|
}
|
|
2347
2425
|
});
|
|
2348
2426
|
}
|
|
2427
|
+
function createCampaignBuilderBuildKit(input = {}) {
|
|
2428
|
+
const requestFile = input.requestFile || "campaign-request.json";
|
|
2429
|
+
const cliPackage = input.cliPackage || "@signaliz/cli";
|
|
2430
|
+
const sdkPackage = input.sdkPackage || "@signaliz/sdk";
|
|
2431
|
+
const request = createCampaignBuilderAgentRequestTemplate(input);
|
|
2432
|
+
const strategyTemplate = stringValue(request.strategyTemplate) ?? null;
|
|
2433
|
+
const builtIns = request.builtIns ?? DEFAULT_CAMPAIGN_BUILDER_BUILT_INS;
|
|
2434
|
+
const useLocalLeads = builtIns.includes("local_leads");
|
|
2435
|
+
const customRoutes = [
|
|
2436
|
+
...request.integrations ?? [],
|
|
2437
|
+
...routesFromCustomerTools(request.customerTools ?? [])
|
|
2438
|
+
].filter((route) => route.provider !== "signaliz");
|
|
2439
|
+
const strategyFlag = strategyTemplate ? ` --strategy-template ${shellArg(strategyTemplate)}` : "";
|
|
2440
|
+
const targetFlag = request.targetCount ? ` --target-count ${request.targetCount}` : "";
|
|
2441
|
+
const localLeadsFlag = useLocalLeads ? " --use-local-leads" : "";
|
|
2442
|
+
const cliBase = `npx ${cliPackage}`;
|
|
2443
|
+
const sdkCliBase = `npx ${sdkPackage}`;
|
|
2444
|
+
const brief = request.goal || "Build a strategy-template campaign for the target ICP.";
|
|
2445
|
+
const mcpArgs = campaignBuilderBuildKitMcpArgs(request);
|
|
2446
|
+
return {
|
|
2447
|
+
kit_version: "campaign-builder-kit.v1",
|
|
2448
|
+
source: "signaliz.campaignBuilderAgent.buildKit",
|
|
2449
|
+
request_file: requestFile,
|
|
2450
|
+
request,
|
|
2451
|
+
strategy_template: strategyTemplate,
|
|
2452
|
+
built_in_lanes: builtIns,
|
|
2453
|
+
operating_playbooks: getCampaignBuilderOperatingPlaybooksForRequest(request).map((playbook) => playbook.slug),
|
|
2454
|
+
custom_routes: customRoutes.map((route) => ({
|
|
2455
|
+
provider: String(route.provider),
|
|
2456
|
+
layer: String(route.layer),
|
|
2457
|
+
tool: firstNonEmptyString(route.toolName),
|
|
2458
|
+
mcp_server: firstNonEmptyString(route.mcpServerName),
|
|
2459
|
+
mode: route.mode ?? "if_available",
|
|
2460
|
+
approval_required: route.approvalRequired === true || route.mode === "required"
|
|
2461
|
+
})),
|
|
2462
|
+
approval_boundaries: request.approvalPolicy?.requireApprovalFor ?? DEFAULT_CAMPAIGN_BUILDER_APPROVAL_TYPES,
|
|
2463
|
+
byo_tool_pattern: {
|
|
2464
|
+
cli_flag: "--custom-tool provider:layer:tool[:mcp]",
|
|
2465
|
+
request_fragment: createCampaignBuilderToolRoute({
|
|
2466
|
+
provider: "workspace_mcp",
|
|
2467
|
+
layer: "enrichment",
|
|
2468
|
+
gtmLayers: ["company_enrichment"],
|
|
2469
|
+
toolName: "workspace_account_enrich",
|
|
2470
|
+
mcpServerName: "workspace-mcp",
|
|
2471
|
+
label: "Workspace account enrichment",
|
|
2472
|
+
mode: "required",
|
|
2473
|
+
approvalRequired: true
|
|
2474
|
+
})
|
|
2475
|
+
},
|
|
2476
|
+
cli_commands: [
|
|
2477
|
+
{
|
|
2478
|
+
id: "write_request",
|
|
2479
|
+
label: "Write reusable request JSON",
|
|
2480
|
+
command: `${cliBase} campaign-agent init${strategyFlag}${targetFlag}${localLeadsFlag} --output-file ${shellArg(requestFile)}`,
|
|
2481
|
+
safety: "local file only; no MCP calls, credits, provider writes, sender loads, exports, or sends"
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
id: "proof_shortcut",
|
|
2485
|
+
label: "Run no-spend campaign-builder proof",
|
|
2486
|
+
command: `${cliBase} build ${shellArg(brief)}${strategyFlag}${targetFlag}${localLeadsFlag} --json`,
|
|
2487
|
+
safety: "strategy memory, Kernel plan, approvals, and forced build_campaign dry-run only"
|
|
2488
|
+
},
|
|
2489
|
+
{
|
|
2490
|
+
id: "plan",
|
|
2491
|
+
label: "Inspect the full campaign-agent plan",
|
|
2492
|
+
command: `${sdkCliBase} campaign-agent plan --request-file ${shellArg(requestFile)} --json`,
|
|
2493
|
+
safety: "read-only MCP planning and provider-route dry-runs"
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
id: "doctor",
|
|
2497
|
+
label: "Check readiness gates",
|
|
2498
|
+
command: `${sdkCliBase} campaign-agent doctor --request-file ${shellArg(requestFile)} --json`,
|
|
2499
|
+
safety: "read-only readiness checks for Memory, Brain, built-ins, BYO routes, and approvals"
|
|
2500
|
+
},
|
|
2501
|
+
{
|
|
2502
|
+
id: "commit_preview",
|
|
2503
|
+
label: "Preview GTM campaign object commit",
|
|
2504
|
+
command: `${sdkCliBase} campaign-agent commit-plan --request-file ${shellArg(requestFile)} --json`,
|
|
2505
|
+
safety: "dry-run commit; writes only with --confirm-write and --approved-by"
|
|
2506
|
+
},
|
|
2507
|
+
{
|
|
2508
|
+
id: "approved_launch",
|
|
2509
|
+
label: "Launch after explicit approval",
|
|
2510
|
+
command: `${sdkCliBase} campaign-agent build-approved --request-file ${shellArg(requestFile)} --confirm-launch --approve-all --approved-by operator@example.com --spend-limit ${request.signalizDefaults?.maxCredits ?? 0} --json`,
|
|
2511
|
+
safety: "spendful path; requires human approval identity, approval types, and spend limit"
|
|
2512
|
+
}
|
|
2513
|
+
],
|
|
2514
|
+
mcp_calls: [
|
|
2515
|
+
{
|
|
2516
|
+
id: "request_template",
|
|
2517
|
+
tool: "gtm_campaign_agent_request_template",
|
|
2518
|
+
arguments: mcpArgs,
|
|
2519
|
+
safety: "read-only reusable request generation"
|
|
2520
|
+
},
|
|
2521
|
+
{
|
|
2522
|
+
id: "readiness",
|
|
2523
|
+
tool: "gtm_campaign_agent_readiness",
|
|
2524
|
+
arguments: mcpArgs,
|
|
2525
|
+
safety: "read-only preflight across strategy memory, Kernel plan, lanes, routes, and approvals"
|
|
2526
|
+
},
|
|
2527
|
+
{
|
|
2528
|
+
id: "proof",
|
|
2529
|
+
tool: "gtm_campaign_agent_proof",
|
|
2530
|
+
arguments: { ...mcpArgs, idempotency_key: "campaign-agent-proof-001" },
|
|
2531
|
+
safety: "forces build_campaign dry_run=true and confirm_spend=false"
|
|
2532
|
+
},
|
|
2533
|
+
{
|
|
2534
|
+
id: "plan",
|
|
2535
|
+
tool: "gtm_campaign_agent_plan",
|
|
2536
|
+
arguments: mcpArgs,
|
|
2537
|
+
safety: "read-only one-call campaign-agent runbook"
|
|
2538
|
+
},
|
|
2539
|
+
{
|
|
2540
|
+
id: "commit_preview",
|
|
2541
|
+
tool: "gtm_campaign_build_plan_commit",
|
|
2542
|
+
arguments: {
|
|
2543
|
+
name: request.campaignName,
|
|
2544
|
+
campaign_brief: request.goal,
|
|
2545
|
+
lead_count: request.targetCount,
|
|
2546
|
+
dry_run: true,
|
|
2547
|
+
confirm: false
|
|
2548
|
+
},
|
|
2549
|
+
safety: "dry-run commit preview only"
|
|
2550
|
+
}
|
|
2551
|
+
],
|
|
2552
|
+
sdk_example: {
|
|
2553
|
+
language: "typescript",
|
|
2554
|
+
code: campaignBuilderBuildKitSdkExample(request, requestFile)
|
|
2555
|
+
},
|
|
2556
|
+
verification: [
|
|
2557
|
+
`${cliBase} campaign-agent proof --request-file ${shellArg(requestFile)} --json`,
|
|
2558
|
+
`${cliBase} campaign-agent doctor --request-file ${shellArg(requestFile)} --json`,
|
|
2559
|
+
"Confirm proof.success is true and dry_run_result.status is dry_run before any approved launch.",
|
|
2560
|
+
"Confirm no campaign_build_id exists in a proof receipt before moving to approved launch."
|
|
2561
|
+
],
|
|
2562
|
+
privacy: {
|
|
2563
|
+
client_names_allowed: false,
|
|
2564
|
+
notes: [
|
|
2565
|
+
"Use strategy templates, operating playbooks, and anonymized workflow patterns instead of client names.",
|
|
2566
|
+
"Do not include raw leads, private replies, domains, secrets, or customer account labels in public kit output."
|
|
2567
|
+
]
|
|
2568
|
+
},
|
|
2569
|
+
next_actions: [
|
|
2570
|
+
`Write or review ${requestFile}.`,
|
|
2571
|
+
"Run the proof command before spending credits or activating provider writes.",
|
|
2572
|
+
"Add BYO integrations with --custom-tool provider:layer:tool[:mcp] or the request_fragment shape.",
|
|
2573
|
+
"Use build-approved only after human approval, spend limit, and delivery review policy are set."
|
|
2574
|
+
]
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2349
2577
|
function createCampaignBuilderToolRoute(input) {
|
|
2350
2578
|
return {
|
|
2351
2579
|
provider: input.provider ?? "custom_mcp",
|
|
@@ -2361,6 +2589,63 @@ function createCampaignBuilderToolRoute(input) {
|
|
|
2361
2589
|
rationale: `${input.label ?? input.provider ?? "Custom tool"} is a user-provided campaign-builder route for ${input.layer}.`
|
|
2362
2590
|
};
|
|
2363
2591
|
}
|
|
2592
|
+
function campaignBuilderBuildKitMcpArgs(request) {
|
|
2593
|
+
return compact({
|
|
2594
|
+
goal: request.goal,
|
|
2595
|
+
campaign_brief: request.goal,
|
|
2596
|
+
campaign_name: request.campaignName,
|
|
2597
|
+
account_label: request.accountLabel,
|
|
2598
|
+
account_context: request.accountContext,
|
|
2599
|
+
strategy_template: request.strategyTemplate,
|
|
2600
|
+
operating_playbooks: request.operatingPlaybooks,
|
|
2601
|
+
target_icp: request.icp,
|
|
2602
|
+
target_count: request.targetCount,
|
|
2603
|
+
builtins: request.builtIns,
|
|
2604
|
+
include_local_leads: request.builtIns?.includes("local_leads") || void 0,
|
|
2605
|
+
preferred_providers: request.preferredProviders,
|
|
2606
|
+
custom_tools: request.integrations?.map((route) => compact({
|
|
2607
|
+
provider: route.provider,
|
|
2608
|
+
layer: route.layer,
|
|
2609
|
+
gtm_layers: route.gtmLayers ?? (route.gtmLayer ? [route.gtmLayer] : void 0),
|
|
2610
|
+
tool: route.toolName,
|
|
2611
|
+
mcp: route.mcpServerName,
|
|
2612
|
+
mode: route.mode,
|
|
2613
|
+
approval_required: route.approvalRequired
|
|
2614
|
+
})),
|
|
2615
|
+
include_nango_catalog: request.agencyContext?.includeNangoCatalog,
|
|
2616
|
+
include_memory: request.memory?.enabled,
|
|
2617
|
+
include_brain: true,
|
|
2618
|
+
include_provider_routes: true,
|
|
2619
|
+
include_delivery_risk: true
|
|
2620
|
+
});
|
|
2621
|
+
}
|
|
2622
|
+
function campaignBuilderBuildKitSdkExample(request, requestFile) {
|
|
2623
|
+
const proofRequest = {
|
|
2624
|
+
goal: request.goal,
|
|
2625
|
+
strategyTemplate: request.strategyTemplate,
|
|
2626
|
+
targetCount: request.targetCount,
|
|
2627
|
+
builtIns: request.builtIns,
|
|
2628
|
+
integrations: request.integrations
|
|
2629
|
+
};
|
|
2630
|
+
return [
|
|
2631
|
+
"import { Signaliz, createCampaignBuilderBuildKit } from '@signaliz/sdk';",
|
|
2632
|
+
"",
|
|
2633
|
+
`const kit = createCampaignBuilderBuildKit({ requestFile: ${JSON.stringify(requestFile)}, ...${JSON.stringify(proofRequest, null, 2)} });`,
|
|
2634
|
+
"console.log(kit.cli_commands.find((command) => command.id === 'proof_shortcut')?.command);",
|
|
2635
|
+
"",
|
|
2636
|
+
"const signaliz = new Signaliz({ apiKey: process.env.SIGNALIZ_API_KEY! });",
|
|
2637
|
+
"const proof = await signaliz.campaignBuilderAgent.proof(kit.request, {",
|
|
2638
|
+
" idempotencyKey: `campaign-agent-proof-${Date.now()}`,",
|
|
2639
|
+
"});",
|
|
2640
|
+
"",
|
|
2641
|
+
'if (!proof.success || proof.dry_run_result?.status !== "dry_run") {',
|
|
2642
|
+
" throw new Error('Campaign proof failed or launched work unexpectedly');",
|
|
2643
|
+
"}"
|
|
2644
|
+
].join("\n");
|
|
2645
|
+
}
|
|
2646
|
+
function shellArg(value) {
|
|
2647
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
2648
|
+
}
|
|
2364
2649
|
function normalizeTemplateKey(value) {
|
|
2365
2650
|
return String(value || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
2366
2651
|
}
|
|
@@ -3635,6 +3920,72 @@ function campaignReadinessNextActions(plan, ready, customRouteCount) {
|
|
|
3635
3920
|
];
|
|
3636
3921
|
return actions.filter((item) => Boolean(item));
|
|
3637
3922
|
}
|
|
3923
|
+
function campaignBuilderProofStrategyTemplate(plan) {
|
|
3924
|
+
const buildRequest = asRecord(plan.buildRequest);
|
|
3925
|
+
const strategyMemory = asRecord(plan.strategyMemoryStatus);
|
|
3926
|
+
const statusTemplate = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3927
|
+
const statusTemplateRecord = asRecord(statusTemplate);
|
|
3928
|
+
const flowTemplate = plan.mcpFlow.map((step) => asRecord(step.arguments).strategy_template ?? asRecord(step.arguments).strategyTemplate).find((value) => typeof value === "string" && value.trim());
|
|
3929
|
+
return firstNonEmptyString(
|
|
3930
|
+
buildRequest.strategyTemplate,
|
|
3931
|
+
buildRequest.strategy_template,
|
|
3932
|
+
statusTemplate,
|
|
3933
|
+
statusTemplateRecord.slug,
|
|
3934
|
+
statusTemplateRecord.id,
|
|
3935
|
+
flowTemplate
|
|
3936
|
+
);
|
|
3937
|
+
}
|
|
3938
|
+
function summarizeCampaignBuilderProofStrategyMemory(strategyMemory) {
|
|
3939
|
+
if (Object.keys(strategyMemory).length === 0) return { ready: false };
|
|
3940
|
+
const template = strategyMemory.strategy_template ?? strategyMemory.strategyTemplate;
|
|
3941
|
+
const templateRecord = asRecord(template);
|
|
3942
|
+
const coverage = asRecord(strategyMemory.coverage);
|
|
3943
|
+
const rawSourceGroups = Array.isArray(strategyMemory.source_groups) ? strategyMemory.source_groups : Array.isArray(strategyMemory.sourceGroups) ? strategyMemory.sourceGroups : [];
|
|
3944
|
+
const sourceGroups = rawSourceGroups.map((group) => {
|
|
3945
|
+
const sourceGroup = asRecord(group);
|
|
3946
|
+
return {
|
|
3947
|
+
id: sourceGroup.id ?? null,
|
|
3948
|
+
required: sourceGroup.required ?? null,
|
|
3949
|
+
ready: sourceGroup.ready ?? null,
|
|
3950
|
+
counts: asRecord(sourceGroup.counts)
|
|
3951
|
+
};
|
|
3952
|
+
});
|
|
3953
|
+
return {
|
|
3954
|
+
ready: strategyMemory.ready ?? null,
|
|
3955
|
+
read_only: strategyMemory.read_only ?? strategyMemory.readOnly ?? null,
|
|
3956
|
+
source_tool: firstNonEmptyString(strategyMemory.source_tool, strategyMemory.sourceTool),
|
|
3957
|
+
strategy_template: {
|
|
3958
|
+
slug: firstNonEmptyString(template, templateRecord.slug, templateRecord.id),
|
|
3959
|
+
label: firstNonEmptyString(templateRecord.label)
|
|
3960
|
+
},
|
|
3961
|
+
coverage: {
|
|
3962
|
+
required_groups_ready: coverage.required_groups_ready ?? coverage.requiredGroupsReady ?? null,
|
|
3963
|
+
required_groups_total: coverage.required_groups_total ?? coverage.requiredGroupsTotal ?? null,
|
|
3964
|
+
source_groups_ready: coverage.source_groups_ready ?? coverage.sourceGroupsReady ?? null,
|
|
3965
|
+
source_groups_total: coverage.source_groups_total ?? coverage.sourceGroupsTotal ?? null,
|
|
3966
|
+
knowledge_docs: coverage.knowledge_docs ?? coverage.knowledgeDocs ?? null,
|
|
3967
|
+
memories: coverage.memories ?? null
|
|
3968
|
+
},
|
|
3969
|
+
source_groups: sourceGroups,
|
|
3970
|
+
blocker_count: Array.isArray(strategyMemory.blockers) ? strategyMemory.blockers.length : 0,
|
|
3971
|
+
warning_count: Array.isArray(strategyMemory.warnings) ? strategyMemory.warnings.length : 0
|
|
3972
|
+
};
|
|
3973
|
+
}
|
|
3974
|
+
function summarizeCampaignBuilderProofDryRun(dryRunResult) {
|
|
3975
|
+
return {
|
|
3976
|
+
dryRun: dryRunResult.dryRun ?? dryRunResult.dry_run ?? null,
|
|
3977
|
+
status: dryRunResult.status ?? null,
|
|
3978
|
+
currentPhase: dryRunResult.currentPhase ?? dryRunResult.current_phase ?? null,
|
|
3979
|
+
campaignBuildId: dryRunResult.campaignBuildId ?? dryRunResult.campaign_build_id ?? null,
|
|
3980
|
+
plannedTargetCount: dryRunResult.plannedTargetCount ?? dryRunResult.planned_target_count ?? null
|
|
3981
|
+
};
|
|
3982
|
+
}
|
|
3983
|
+
function firstNonEmptyString(...values) {
|
|
3984
|
+
for (const value of values) {
|
|
3985
|
+
if (typeof value === "string" && value.trim()) return value;
|
|
3986
|
+
}
|
|
3987
|
+
return null;
|
|
3988
|
+
}
|
|
3638
3989
|
function diagnosticMessages2(value) {
|
|
3639
3990
|
if (!Array.isArray(value)) return [];
|
|
3640
3991
|
return value.map((item) => {
|
|
@@ -6654,6 +7005,8 @@ var Signaliz = class {
|
|
|
6654
7005
|
createCampaignBuilderAgentPlan,
|
|
6655
7006
|
createCampaignBuilderAgentRequestTemplate,
|
|
6656
7007
|
createCampaignBuilderApproval,
|
|
7008
|
+
createCampaignBuilderBuildKit,
|
|
7009
|
+
createCampaignBuilderProofReceipt,
|
|
6657
7010
|
createCampaignBuilderReadiness,
|
|
6658
7011
|
createCampaignBuilderToolRoute,
|
|
6659
7012
|
getCampaignBuilderOperatingPlaybook,
|
package/dist/index.mjs
CHANGED
|
@@ -17,6 +17,8 @@ import {
|
|
|
17
17
|
createCampaignBuilderAgentPlan,
|
|
18
18
|
createCampaignBuilderAgentRequestTemplate,
|
|
19
19
|
createCampaignBuilderApproval,
|
|
20
|
+
createCampaignBuilderBuildKit,
|
|
21
|
+
createCampaignBuilderProofReceipt,
|
|
20
22
|
createCampaignBuilderReadiness,
|
|
21
23
|
createCampaignBuilderToolRoute,
|
|
22
24
|
getCampaignBuilderOperatingPlaybook,
|
|
@@ -24,7 +26,7 @@ import {
|
|
|
24
26
|
getCampaignBuilderStrategyTemplate,
|
|
25
27
|
getMissingCampaignBuilderApprovals,
|
|
26
28
|
normalizeExecutionReference
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-6OZWMAV3.mjs";
|
|
28
30
|
export {
|
|
29
31
|
Ai,
|
|
30
32
|
CAMPAIGN_BUILDER_OPERATING_PLAYBOOKS,
|
|
@@ -44,6 +46,8 @@ export {
|
|
|
44
46
|
createCampaignBuilderAgentPlan,
|
|
45
47
|
createCampaignBuilderAgentRequestTemplate,
|
|
46
48
|
createCampaignBuilderApproval,
|
|
49
|
+
createCampaignBuilderBuildKit,
|
|
50
|
+
createCampaignBuilderProofReceipt,
|
|
47
51
|
createCampaignBuilderReadiness,
|
|
48
52
|
createCampaignBuilderToolRoute,
|
|
49
53
|
getCampaignBuilderOperatingPlaybook,
|