@signaliz/cli 1.0.91 → 1.0.92

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.
Files changed (2) hide show
  1. package/dist/bin.js +191 -1
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -69,6 +69,15 @@ Product commands:
69
69
  signaliz campaign-os audience-schedule --client-id <uuid> --audience-id <uuid> [--campaign-id <uuid>] [--cadence-minutes 1440] [--per-run-cap 100] [--source-policy cache_only|cache_then_review] [--enabled yes|no] [--run-now]
70
70
  signaliz campaign-os audience-preview --client-id <uuid> --audience-id <uuid> --idempotency-key <key>
71
71
  signaliz campaign-os compile --client-id <uuid> --campaign-id <uuid> [--providers all]
72
+ signaliz campaign-os alpha-plan --client-id <uuid> --client-name "Velox" --offer-summary "..." --icp-summary "..." --idempotency-key <key>
73
+ signaliz campaign-os alpha-discover --client-id <uuid> --client-name "Velox" --offer-summary "..." --icp-summary "..." --idempotency-key <key> --confirm-spend
74
+ signaliz campaign-os alpha-status --alpha-run-id <uuid>
75
+ signaliz campaign-os alpha-validate --client-id <uuid> --campaign-id <uuid> --alpha-run-id <uuid> --candidate-index 0 --sample-file sample.json --idempotency-key <key> --confirm-spend
76
+ signaliz campaign-os alpha-validation-status --validation-run-id <uuid>
77
+ signaliz campaign-os alpha-apply --validation-run-id <uuid>
78
+ signaliz campaign-os connections --client-id <uuid>
79
+ signaliz campaign-os source-binding --client-id <uuid> --binding-id <uuid> --name "CRM list" --source-kind audience --selector-file selector.json --idempotency-key <key>
80
+ signaliz campaign-os source-preflight --client-id <uuid> --source-binding-id <uuid> --idempotency-key <key> [--max-records 25]
72
81
  signaliz campaign-os request --client-id <uuid> [--campaign-id <uuid>] --agent codex --action provider_load --instructions "..." [--preflight-inputs-file inputs.json] --idempotency-key <key>
73
82
  signaliz campaign-os prepare-preflight --client-id <uuid> --request-id <uuid>
74
83
  signaliz campaign-os receipts [--client-id <uuid>] [--campaign-id <uuid>] [--limit 50]
@@ -2456,6 +2465,187 @@ async function campaignOs(args) {
2456
2465
  output(result, () => process.stdout.write("Compile preview recorded \xB7 provider calls 0 \xB7 no campaign created or sent\n"));
2457
2466
  return;
2458
2467
  }
2468
+ if (action === "alpha-plan" || action === "alpha-discover") {
2469
+ const clientId = flag("client-id");
2470
+ const clientName = flag("client-name");
2471
+ const offerSummary = flag("offer-summary");
2472
+ const icpSummary = flag("icp-summary");
2473
+ const idempotencyKey = flag("idempotency-key")?.trim();
2474
+ if (!clientId || !clientName || !offerSummary || !icpSummary || !idempotencyKey) {
2475
+ throw new CliInputError(`signaliz campaign-os ${action} requires --client-id, --client-name, --offer-summary, --icp-summary, and --idempotency-key`);
2476
+ }
2477
+ const params = {
2478
+ clientId,
2479
+ campaignId: flag("campaign-id"),
2480
+ clientName,
2481
+ offerSummary,
2482
+ icpSummary,
2483
+ buyerPersonas: csvFlag("buyer-personas"),
2484
+ knownEvidence: csvFlag("known-evidence"),
2485
+ preferredSources: csvFlag("preferred-sources"),
2486
+ idempotencyKey
2487
+ };
2488
+ if (action === "alpha-plan") {
2489
+ const result2 = await client.planCampaignOsAlpha(params);
2490
+ output(result2, () => {
2491
+ process.stdout.write("Signaliz Alpha plan ready \xB7 model calls 0 \xB7 web searches 0 \xB7 spend $0.00\n");
2492
+ process.stdout.write("Candidates will remain unvalidated until a measured sample proves them.\n");
2493
+ });
2494
+ return;
2495
+ }
2496
+ if (!hasFlag("confirm-spend")) {
2497
+ throw new CliInputError("signaliz campaign-os alpha-discover requires --confirm-spend for the $0.10 authorization ceiling");
2498
+ }
2499
+ const result = await client.startCampaignOsAlphaDiscovery(params);
2500
+ output(result, () => {
2501
+ const run = record(result.run);
2502
+ process.stdout.write(`Signaliz Alpha discovery started: ${String(run.id || "")} \xB7 ${String(run.status || "queued")} \xB7 authorized ceiling $0.10
2503
+ `);
2504
+ process.stdout.write("Output is candidate-only. Clay, audience creation, provider load, activation, queue, and send remain locked.\n");
2505
+ });
2506
+ return;
2507
+ }
2508
+ if (action === "alpha-status") {
2509
+ const alphaRunId = flag("alpha-run-id");
2510
+ if (!alphaRunId) {
2511
+ throw new CliInputError("signaliz campaign-os alpha-status requires --alpha-run-id <uuid>");
2512
+ }
2513
+ const result = await client.getCampaignOsAlphaRun(alphaRunId);
2514
+ output(result, () => {
2515
+ const run = record(result.run);
2516
+ process.stdout.write(`Signaliz Alpha run: ${String(run.status || "unknown")} \xB7 ${String(run.id || alphaRunId)}
2517
+ `);
2518
+ process.stdout.write("Completed output remains a source-cited candidate until a measured validation receipt exists.\n");
2519
+ });
2520
+ return;
2521
+ }
2522
+ if (action === "alpha-validate") {
2523
+ const clientId = flag("client-id");
2524
+ const campaignId = flag("campaign-id");
2525
+ const alphaRunId = flag("alpha-run-id");
2526
+ const candidateIndex = numberFlag("candidate-index");
2527
+ const sampleFile = flag("sample-file");
2528
+ const idempotencyKey = flag("idempotency-key")?.trim();
2529
+ if (!clientId || !campaignId || !alphaRunId || candidateIndex === void 0 || !sampleFile || !idempotencyKey) {
2530
+ throw new CliInputError("signaliz campaign-os alpha-validate requires --client-id, --campaign-id, --alpha-run-id, --candidate-index, --sample-file, and --idempotency-key");
2531
+ }
2532
+ requireIntegerInRange(candidateIndex, "--candidate-index", 0, 4);
2533
+ if (!hasFlag("confirm-spend")) {
2534
+ throw new CliInputError("signaliz campaign-os alpha-validate requires --confirm-spend for the fixed $0.25 maximum");
2535
+ }
2536
+ let sampleEntities;
2537
+ try {
2538
+ const parsed = JSON.parse((0, import_node_fs.readFileSync)(sampleFile, "utf8"));
2539
+ if (!Array.isArray(parsed) || parsed.length < 3 || parsed.length > 20) {
2540
+ throw new Error("file must contain a JSON array of 3-20 sample entities");
2541
+ }
2542
+ sampleEntities = parsed;
2543
+ } catch (error) {
2544
+ throw new CliInputError(`Unable to read --sample-file: ${error instanceof Error ? error.message : String(error)}`);
2545
+ }
2546
+ const result = await client.startCampaignOsAlphaValidation({
2547
+ clientId,
2548
+ campaignId,
2549
+ alphaRunId,
2550
+ candidateIndex,
2551
+ sampleEntities,
2552
+ idempotencyKey
2553
+ });
2554
+ output(result, () => {
2555
+ const run = record(result.run);
2556
+ process.stdout.write(`Signaliz Alpha validation started: ${String(run.id || "")} \xB7 ${String(run.status || "queued")} \xB7 maximum $0.25
2557
+ `);
2558
+ process.stdout.write("Passing status is receipt-derived. Clay and delivery providers remain locked.\n");
2559
+ });
2560
+ return;
2561
+ }
2562
+ if (action === "alpha-validation-status" || action === "alpha-apply") {
2563
+ const validationRunId = flag("validation-run-id");
2564
+ if (!validationRunId) {
2565
+ throw new CliInputError(`signaliz campaign-os ${action} requires --validation-run-id <uuid>`);
2566
+ }
2567
+ const result = action === "alpha-apply" ? await client.applyCampaignOsValidatedAlpha(validationRunId) : await client.getCampaignOsAlphaValidationRun(validationRunId);
2568
+ output(result, () => {
2569
+ const run = record(result.run);
2570
+ if (action === "alpha-apply") {
2571
+ process.stdout.write(`Validated Alpha applied to immutable CampaignSpec: ${String(run.applied_spec_version_id || "complete")}
2572
+ `);
2573
+ process.stdout.write("Provider load, activation, queue, and send remain locked.\n");
2574
+ } else {
2575
+ process.stdout.write(`Signaliz Alpha validation: ${String(run.status || "unknown")} \xB7 ${String(run.matched_count || 0)}/${String(run.sample_size || 0)} matched
2576
+ `);
2577
+ process.stdout.write(`Validation passed: ${run.validation_passed === true ? "yes" : "no"}
2578
+ `);
2579
+ }
2580
+ });
2581
+ return;
2582
+ }
2583
+ if (action === "connections") {
2584
+ const clientId = flag("client-id");
2585
+ if (!clientId) throw new CliInputError("signaliz campaign-os connections requires --client-id <uuid>");
2586
+ const result = await client.listCampaignOsConnections(clientId);
2587
+ output(result, () => {
2588
+ process.stdout.write(`${result.bindings.length} client binding(s) \xB7 ${result.source_bindings.length} exact source binding(s)
2589
+ `);
2590
+ process.stdout.write("OAuth tokens and raw provider values were not returned; no provider call occurred.\n");
2591
+ });
2592
+ return;
2593
+ }
2594
+ if (action === "source-binding" || action === "source-policy") {
2595
+ const clientId = flag("client-id");
2596
+ const bindingId = flag("binding-id");
2597
+ const name = flag("name");
2598
+ const sourceKind = flag("source-kind");
2599
+ const selectorFile = flag("selector-file");
2600
+ const idempotencyKey = flag("idempotency-key")?.trim();
2601
+ if (!clientId || !bindingId || !name || !sourceKind || !selectorFile || !idempotencyKey) {
2602
+ throw new CliInputError("signaliz campaign-os source-binding requires --client-id, --binding-id, --name, --source-kind, --selector-file, and --idempotency-key");
2603
+ }
2604
+ if (!["memory", "data", "audience", "trigger"].includes(sourceKind)) {
2605
+ throw new CliInputError("--source-kind must be memory, data, audience, or trigger");
2606
+ }
2607
+ let selector;
2608
+ try {
2609
+ const parsed = JSON.parse((0, import_node_fs.readFileSync)(selectorFile, "utf8"));
2610
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("file must contain one JSON object");
2611
+ selector = parsed;
2612
+ } catch (error) {
2613
+ throw new CliInputError(`Unable to read --selector-file: ${error instanceof Error ? error.message : String(error)}`);
2614
+ }
2615
+ const result = await client.createCampaignOsSourceBinding({
2616
+ clientId,
2617
+ bindingId,
2618
+ name,
2619
+ sourceKind,
2620
+ remoteObjectType: flag("remote-object-type"),
2621
+ remoteRef: flag("remote-ref"),
2622
+ selector,
2623
+ audienceId: flag("audience-id"),
2624
+ idempotencyKey
2625
+ });
2626
+ output(result, () => {
2627
+ const sourceBinding = record(result.source_binding);
2628
+ process.stdout.write(`Draft source binding: ${String(sourceBinding.name || name)} (${String(sourceBinding.id || "")})
2629
+ `);
2630
+ process.stdout.write("Provider calls: 0 \xB7 hydration: locked \xB7 realtime armed: false \xB7 send authorized: false\n");
2631
+ });
2632
+ return;
2633
+ }
2634
+ if (action === "source-preflight") {
2635
+ const clientId = flag("client-id");
2636
+ const sourceBindingId = flag("source-binding-id") || flag("source-policy-id");
2637
+ const idempotencyKey = flag("idempotency-key")?.trim();
2638
+ const maxRecords = numberFlag("max-records") ?? 25;
2639
+ if (!clientId || !sourceBindingId || !idempotencyKey) {
2640
+ throw new CliInputError("signaliz campaign-os source-preflight requires --client-id, --source-binding-id, and --idempotency-key");
2641
+ }
2642
+ requireIntegerInRange(maxRecords, "--max-records", 1, 25);
2643
+ const result = await client.preflightCampaignOsSourceBinding(clientId, sourceBindingId, idempotencyKey, maxRecords);
2644
+ output(result, () => {
2645
+ process.stdout.write("Source binding preflight recorded \xB7 provider calls 0 \xB7 source approval unchanged\n");
2646
+ });
2647
+ return;
2648
+ }
2459
2649
  if (action === "request") {
2460
2650
  const clientId = flag("client-id");
2461
2651
  const actionType = flag("action");
@@ -2560,7 +2750,7 @@ async function campaignOs(args) {
2560
2750
  });
2561
2751
  return;
2562
2752
  }
2563
- throw new CliInputError("Usage: signaliz campaign-os clients|context|knowledge|provider-runtime|build|build-status|draft|refine|audience-draft|materialize-cache-audience|audience-schedule|audience-preview|compile|request|prepare-preflight|receipts");
2753
+ throw new CliInputError("Usage: signaliz campaign-os clients|context|knowledge|provider-runtime|build|build-status|draft|refine|audience-draft|materialize-cache-audience|audience-schedule|audience-preview|compile|alpha-plan|alpha-discover|alpha-status|alpha-validate|alpha-validation-status|alpha-apply|connections|source-binding|source-preflight|request|prepare-preflight|receipts");
2564
2754
  }
2565
2755
  async function main() {
2566
2756
  const [, , command, ...args] = process.argv;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/cli",
3
- "version": "1.0.91",
3
+ "version": "1.0.92",
4
4
  "description": "Signaliz CLI for Campaign OS, core products, Signal Awareness, Signaliz Flow, and reusable managed builds.",
5
5
  "bin": {
6
6
  "signaliz": "dist/bin.js"
@@ -30,7 +30,7 @@
30
30
  "node": ">=18"
31
31
  },
32
32
  "dependencies": {
33
- "@signaliz/sdk": "^1.0.95"
33
+ "@signaliz/sdk": "^1.0.96"
34
34
  },
35
35
  "devDependencies": {
36
36
  "tsup": "^8.0.0",