@signaliz/sdk 1.0.15 → 1.0.16

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.
@@ -1739,6 +1739,9 @@ var CampaignBuilderAgent = class {
1739
1739
  buildKit(options = {}) {
1740
1740
  return createCampaignBuilderBuildKit(options);
1741
1741
  }
1742
+ memoryKit(options = {}) {
1743
+ return createCampaignBuilderMemoryKit(options);
1744
+ }
1742
1745
  async commitPlan(plan, options = {}) {
1743
1746
  const writeMode = options.confirm === true && options.dryRun === false;
1744
1747
  if (writeMode && !options.approvedBy) {
@@ -2452,6 +2455,12 @@ function createCampaignBuilderBuildKit(input = {}) {
2452
2455
  command: `${cliBase} campaign-agent init${strategyFlag}${targetFlag}${localLeadsFlag} --output-file ${shellArg(requestFile)}`,
2453
2456
  safety: "local file only; no MCP calls, credits, provider writes, sender loads, exports, or sends"
2454
2457
  },
2458
+ {
2459
+ id: "memory_kit",
2460
+ label: "Inspect memory readiness and seed runner",
2461
+ command: `${sdkCliBase} campaign-agent memory-kit${strategyFlag}${targetFlag}${localLeadsFlag} --request-file ${shellArg(requestFile)} --json`,
2462
+ safety: "read-only memory readiness packet plus local seed dry-run commands"
2463
+ },
2455
2464
  {
2456
2465
  id: "proof_shortcut",
2457
2466
  label: "Run no-spend campaign-builder proof",
@@ -2546,6 +2555,147 @@ function createCampaignBuilderBuildKit(input = {}) {
2546
2555
  ]
2547
2556
  };
2548
2557
  }
2558
+ function createCampaignBuilderMemoryKit(input = {}) {
2559
+ const requestFile = input.requestFile || "campaign-request.json";
2560
+ const seedManifestFile = input.seedManifestFile || ".gtm-kernel-import-state/campaign-memory-dry-run.json";
2561
+ const cliPackage = input.cliPackage || "@signaliz/cli";
2562
+ const sdkPackage = input.sdkPackage || "@signaliz/sdk";
2563
+ const request = createCampaignBuilderAgentRequestTemplate(input);
2564
+ const strategyTemplate = stringValue(request.strategyTemplate) ?? null;
2565
+ const strategyFlag = strategyTemplate ? ` --strategy-template ${shellArg(strategyTemplate)}` : "";
2566
+ const targetFlag = request.targetCount ? ` --target-count ${request.targetCount}` : "";
2567
+ const localLeadsFlag = request.builtIns?.includes("local_leads") ? " --use-local-leads" : "";
2568
+ const cliBase = `npx ${cliPackage}`;
2569
+ const sdkCliBase = `npx ${sdkPackage}`;
2570
+ const source = campaignBuilderMemoryKitSource(input.source);
2571
+ const workspaceId = input.workspaceId || "your-workspace-id";
2572
+ const brief = request.goal || "Build a strategy-template campaign for the target ICP.";
2573
+ const statusArgs = compact({
2574
+ strategy_template: strategyTemplate,
2575
+ campaign_brief: brief,
2576
+ target_icp: request.icp,
2577
+ include_sources: true,
2578
+ include_samples: false,
2579
+ days: 90,
2580
+ limit: 25
2581
+ });
2582
+ const searchArgs = compact({
2583
+ query: request.memory?.queries?.[0]?.query || brief,
2584
+ layers: ["lead_generation", "email_finding", "email_verification", "company_enrichment", "copy_enrichment"],
2585
+ limit: 10
2586
+ });
2587
+ return {
2588
+ kit_version: "campaign-memory-kit.v1",
2589
+ source: "signaliz.campaignBuilderAgent.memoryKit",
2590
+ read_only: true,
2591
+ no_spend: true,
2592
+ no_provider_writes: true,
2593
+ client_names_allowed: false,
2594
+ request_file: requestFile,
2595
+ seed_manifest_file: seedManifestFile,
2596
+ request,
2597
+ strategy_template: strategyTemplate,
2598
+ operating_playbooks: getCampaignBuilderOperatingPlaybooksForRequest(request).map((playbook) => playbook.slug),
2599
+ memory_sources: source.memorySources,
2600
+ seed_runner: {
2601
+ local_script: "scripts/gtm-kernel/seed-import-runner.mjs",
2602
+ dry_run_command: [
2603
+ "node scripts/gtm-kernel/seed-import-runner.mjs",
2604
+ `--source ${source.seedSource}`,
2605
+ "--dry-run",
2606
+ `--workspace-id ${shellArg(input.workspaceId || "00000000-0000-4000-8000-000000000000")}`,
2607
+ `--manifest ${shellArg(seedManifestFile)}`,
2608
+ "--reset"
2609
+ ].join(" "),
2610
+ verify_manifest_command: source.verifyScript ? `node ${source.verifyScript} ${shellArg(seedManifestFile)}` : null,
2611
+ write_command: `GTM_KERNEL_WORKSPACE_ID=${shellArg(workspaceId)} node scripts/gtm-kernel/seed-import-runner.mjs --source ${source.seedSource} --write`,
2612
+ write_requires: ["SUPABASE_URL", "SUPABASE_SERVICE_ROLE_KEY", "GTM_KERNEL_WORKSPACE_ID", "explicit operator approval"]
2613
+ },
2614
+ cli_commands: [
2615
+ {
2616
+ id: "memory_status",
2617
+ label: "Check strategy memory readiness",
2618
+ command: `${sdkCliBase} gtm strategy-memory${strategyFlag} --brief ${shellArg(brief)} --json`,
2619
+ safety: "read-only MCP memory readiness; no credits, provider writes, sender loads, exports, or sends"
2620
+ },
2621
+ {
2622
+ id: "memory_search",
2623
+ label: "Search ranked campaign memory",
2624
+ command: `${sdkCliBase} gtm memory search --query ${shellArg(String(searchArgs.query || brief))} --limit 10 --json`,
2625
+ safety: "read-only ranked memory lookup"
2626
+ },
2627
+ {
2628
+ id: "seed_dry_run",
2629
+ label: "Dry-run private memory seed import",
2630
+ command: [
2631
+ "node scripts/gtm-kernel/seed-import-runner.mjs",
2632
+ `--source ${source.seedSource}`,
2633
+ "--dry-run",
2634
+ `--workspace-id ${shellArg(input.workspaceId || "00000000-0000-4000-8000-000000000000")}`,
2635
+ `--manifest ${shellArg(seedManifestFile)}`,
2636
+ "--reset"
2637
+ ].join(" "),
2638
+ safety: "local extraction and manifest only; no database writes"
2639
+ },
2640
+ {
2641
+ id: "write_request",
2642
+ label: "Write reusable campaign request JSON",
2643
+ command: `${cliBase} campaign-agent init${strategyFlag}${targetFlag}${localLeadsFlag} --output-file ${shellArg(requestFile)}`,
2644
+ safety: "local file only; no MCP calls, credits, provider writes, sender loads, exports, or sends"
2645
+ },
2646
+ {
2647
+ id: "proof",
2648
+ label: "Run campaign proof after memory check",
2649
+ command: `${cliBase} campaign-agent proof --request-file ${shellArg(requestFile)} --json`,
2650
+ safety: "read-only planning plus forced build_campaign dry-run with confirm_spend=false"
2651
+ }
2652
+ ],
2653
+ mcp_calls: [
2654
+ {
2655
+ id: "strategy_memory_status",
2656
+ tool: "gtm_campaign_strategy_memory_status",
2657
+ arguments: statusArgs,
2658
+ safety: "read-only strategy/workflow memory readiness with sources and no raw samples"
2659
+ },
2660
+ {
2661
+ id: "memory_search",
2662
+ tool: "gtm_memory_search",
2663
+ arguments: searchArgs,
2664
+ safety: "read-only ranked memory lookup"
2665
+ },
2666
+ {
2667
+ id: "campaign_agent_plan",
2668
+ tool: "gtm_campaign_agent_plan",
2669
+ arguments: campaignBuilderBuildKitMcpArgs(request),
2670
+ safety: "read-only campaign-agent plan using built-in Signaliz lanes, memory, Brain, Nango, and BYO routes"
2671
+ },
2672
+ {
2673
+ id: "campaign_agent_proof",
2674
+ tool: "gtm_campaign_agent_proof",
2675
+ arguments: { ...campaignBuilderBuildKitMcpArgs(request), idempotency_key: "campaign-agent-memory-proof-001" },
2676
+ safety: "forces build_campaign dry_run=true and confirm_spend=false after readiness"
2677
+ }
2678
+ ],
2679
+ sdk_example: {
2680
+ language: "typescript",
2681
+ code: campaignBuilderMemoryKitSdkExample(request, seedManifestFile)
2682
+ },
2683
+ privacy: {
2684
+ client_names_allowed: false,
2685
+ notes: [
2686
+ "Use strategy templates, operating playbooks, memory dimensions, and anonymized campaign patterns instead of client names.",
2687
+ "Do not expose raw leads, private replies, domains, secrets, provider payloads, or customer account labels in kit output.",
2688
+ "Seed writes are workspace-private and require explicit operator approval plus Supabase service credentials."
2689
+ ]
2690
+ },
2691
+ next_actions: [
2692
+ "Run memory_status before plan/proof so missing strategy coverage is visible.",
2693
+ `Run seed_dry_run and inspect ${seedManifestFile} before any memory write.`,
2694
+ "Use write_request to save the reusable campaign request, then run proof with no spend.",
2695
+ "Add BYO tools through campaign-agent --custom-tool only after route setup is reviewed."
2696
+ ]
2697
+ };
2698
+ }
2549
2699
  function createCampaignBuilderToolRoute(input) {
2550
2700
  return {
2551
2701
  provider: input.provider ?? "custom_mcp",
@@ -2615,6 +2765,85 @@ function campaignBuilderBuildKitSdkExample(request, requestFile) {
2615
2765
  "}"
2616
2766
  ].join("\n");
2617
2767
  }
2768
+ function campaignBuilderMemoryKitSdkExample(request, seedManifestFile) {
2769
+ const input = {
2770
+ goal: request.goal,
2771
+ strategyTemplate: request.strategyTemplate,
2772
+ targetCount: request.targetCount,
2773
+ builtIns: request.builtIns
2774
+ };
2775
+ return [
2776
+ "import { Signaliz, createCampaignBuilderMemoryKit } from '@signaliz/sdk';",
2777
+ "",
2778
+ `const kit = createCampaignBuilderMemoryKit({ seedManifestFile: ${JSON.stringify(seedManifestFile)}, ...${JSON.stringify(input, null, 2)} });`,
2779
+ "console.log(kit.cli_commands.find((command) => command.id === 'memory_status')?.command);",
2780
+ "",
2781
+ "const signaliz = new Signaliz({ apiKey: process.env.SIGNALIZ_API_KEY! });",
2782
+ "const status = await signaliz.gtm.campaignStrategyMemoryStatus({",
2783
+ " strategyTemplate: kit.request.strategyTemplate,",
2784
+ " campaignBrief: kit.request.goal,",
2785
+ " includeSources: true,",
2786
+ " includeSamples: false,",
2787
+ "});",
2788
+ "",
2789
+ "if (status?.ready === false) {",
2790
+ " throw new Error('Strategy memory is not ready for this campaign request');",
2791
+ "}"
2792
+ ].join("\n");
2793
+ }
2794
+ function campaignBuilderMemoryKitSource(source) {
2795
+ const normalized = normalizeTemplateKey(source || "agency");
2796
+ const catalog = {
2797
+ agency: {
2798
+ id: "agency_campaign_builder",
2799
+ label: "Agency campaign-builder strategy patterns",
2800
+ seed_source: "agency",
2801
+ scope: "private_strategy_docs",
2802
+ privacy: "workspace-private sanitized docs and abstracted campaign summaries"
2803
+ },
2804
+ workflow: {
2805
+ id: "workflow_pattern_corpus",
2806
+ label: "Workflow and table-build pattern corpus",
2807
+ seed_source: "building-clay",
2808
+ scope: "read_only_workflow_docs",
2809
+ privacy: "sanitized operating model and workflow patterns"
2810
+ },
2811
+ feedback: {
2812
+ id: "campaign_feedback",
2813
+ label: "Campaign feedback and reply patterns",
2814
+ seed_source: "instantly",
2815
+ scope: "workspace_private_feedback",
2816
+ privacy: "aggregate feedback, reply, and sequence performance memory"
2817
+ }
2818
+ };
2819
+ const sourceMap = {
2820
+ agency: "agency",
2821
+ "campaign-builder": "agency",
2822
+ "strategy-memory": "agency",
2823
+ "workflow-patterns": "workflow",
2824
+ workflow: "workflow",
2825
+ "building-clay": "workflow",
2826
+ clay: "workflow",
2827
+ "instantly-feedback": "feedback",
2828
+ instantly: "feedback",
2829
+ feedback: "feedback",
2830
+ all: "all"
2831
+ };
2832
+ const selected = sourceMap[normalized] || "agency";
2833
+ if (selected === "all") {
2834
+ return {
2835
+ seedSource: "all",
2836
+ verifyScript: null,
2837
+ memorySources: [catalog.agency, catalog.workflow, catalog.feedback]
2838
+ };
2839
+ }
2840
+ const item = catalog[selected];
2841
+ return {
2842
+ seedSource: item.seed_source,
2843
+ verifyScript: item.seed_source === "agency" ? "scripts/gtm-kernel/verify-agency-import-manifest.mjs" : item.seed_source === "building-clay" ? "scripts/gtm-kernel/verify-building-clay-import-manifest.mjs" : null,
2844
+ memorySources: [item]
2845
+ };
2846
+ }
2618
2847
  function shellArg(value) {
2619
2848
  return `'${value.replace(/'/g, "'\\''")}'`;
2620
2849
  }
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-6OZWMAV3.mjs";
4
+ } from "./chunk-5JNKSMNW.mjs";
5
5
 
6
6
  // src/mcp-config.ts
7
7
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/sdk",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Signaliz SDK — GTM Kernel, Nango routes, MCP, and enrichment for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",