@signaliz/cli 1.0.69 → 1.0.70

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 +63 -19
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -24,7 +24,7 @@ Six product commands:
24
24
  signaliz find-email --job-id job_... Resume an existing Find Email batch without redispatch
25
25
  signaliz verify-email [jane@example.com] [--verification-run-id run_...] [--no-wait] [--max-wait-ms 600000]
26
26
  signaliz verify-email --job-id job_... Resume an existing Verify Email batch without redispatch
27
- signaliz company-signals --domain example.com --research-prompt "Why would this company use Signaliz?"
27
+ signaliz company-signals --domain example.com [--research-prompt "Optional research lens"] [--lookback-days 365]
28
28
  signaliz company-signals --input companies.json --no-wait Submit a durable >25-row batch and return its job
29
29
  signaliz company-signals --job-id job_... Resume an existing Company Signals batch without redispatch
30
30
  signaliz company-signals --signal-run-id run_... Read a completed run without duplicate spend
@@ -39,7 +39,13 @@ Six product commands:
39
39
  signaliz signals "companies that just got funded" [--limit 100] [--wait]
40
40
  signaliz signals-first "companies that just got funded" [--limit 100] [--wait]
41
41
  signaliz awareness add --domain acme.com [--schedule daily|weekly|monthly]
42
+ signaliz awareness list
43
+ signaliz awareness run --monitor-id <uuid> [--idempotency-key <key>]
44
+ signaliz awareness pause|resume --monitor-id <uuid>
42
45
  signaliz awareness signals --domain acme.com
46
+ signaliz awareness signals --monitor-id <uuid>
47
+ signaliz awareness export [--monitor-id <uuid>]
48
+ signaliz awareness settings
43
49
  signaliz awareness delete --domain acme.com
44
50
  signaliz awareness schedule --domain acme.com --schedule daily|weekly|monthly
45
51
  signaliz flow --signal-query "companies with recent hiring" --campaign-offer "..." [--limit 5] [--lookback-days 90] [--people-titles "CEO,VP Sales"]
@@ -72,7 +78,7 @@ Common flags:
72
78
  --event-id <sha256> Pin one canonical signal event in Signal to Copy
73
79
  --dry-run Return a no-spend plan without provider calls, jobs, or writes
74
80
 
75
- Company Signals requires --domain and --research-prompt. Signaliz checks its cache and returns the newest distinct events that pass its deterministic date, source, company, evidence, and duplicate gates. Durable batch rows require domain and research_prompt. Signal to Copy accepts --run-without-signal yes|no. Signals First accepts only a query and --limit up to 100. Signal Awareness management uses only a company domain and, for schedule changes, daily, weekly, or monthly.
81
+ Company Signals requires only --domain; --research-prompt and --lookback-days are optional. Signaliz checks its cache and returns the newest distinct events that pass its deterministic date, source, company, evidence, and duplicate gates. Durable batch rows require domain. Signal to Copy accepts --run-without-signal yes|no. Signals First accepts a query and --limit up to 100, plus recovery, idempotency, and dry-run controls. Signal Awareness supports simple domain commands and the full monitor lifecycle.
76
82
  `;
77
83
  function loadConfig() {
78
84
  if (!(0, import_node_fs.existsSync)(CONFIG_FILE)) return {};
@@ -405,12 +411,19 @@ function customerEmailResult(value, kind) {
405
411
  const result = record(value);
406
412
  const raw = record(result.raw);
407
413
  if (kind === "verify") {
414
+ const isCatchAll2 = result.isCatchAll === true || raw.is_catch_all === true || raw.email_is_catch_all === true;
415
+ const okToSend = result.okToSend === true || raw.ok_to_send === true;
416
+ const rawStatus = String(result.status || raw.status || "").trim().toLowerCase();
417
+ const legacyVerdict = String(
418
+ raw.verification_status || raw.verification_verdict || raw.deliverability_status || ""
419
+ ).trim().toLowerCase();
420
+ const status = rawStatus && !["completed", "processing"].includes(rawStatus) ? rawStatus : rawStatus === "processing" ? "processing" : legacyVerdict ? legacyVerdict : okToSend ? "valid" : isCatchAll2 ? "catch_all" : "unknown";
408
421
  return {
409
422
  email: typeof result.email === "string" ? result.email : typeof raw.email === "string" ? raw.email : null,
410
- status: result.status || raw.status || "completed",
411
- is_catch_all: result.isCatchAll === true || raw.is_catch_all === true || raw.email_is_catch_all === true,
423
+ status,
424
+ is_catch_all: isCatchAll2,
412
425
  credits_charged: safeNonNegativeNumber(result.creditsCharged ?? raw.credits_charged) ?? 0,
413
- ok_to_send: result.okToSend === true || raw.ok_to_send === true
426
+ ok_to_send: okToSend
414
427
  };
415
428
  }
416
429
  if (String(result.status || "").toLowerCase() === "processing") {
@@ -904,16 +917,20 @@ function normalizeSignalsEverythingResult(request, value) {
904
917
  async function discoverSignalsEverything(request) {
905
918
  const body = request.signalSearchRunId ? {
906
919
  signal_search_run_id: request.signalSearchRunId,
907
- ...request.limit === void 0 ? {} : { limit: request.limit }
920
+ ...request.limit === void 0 ? {} : { limit: request.limit },
921
+ ...request.dryRun === void 0 ? {} : { dry_run: request.dryRun }
908
922
  } : {
909
923
  query: request.query,
910
- limit: request.limit ?? 100
924
+ limit: request.limit ?? 100,
925
+ ...request.dryRun === void 0 ? {} : { dry_run: request.dryRun },
926
+ ...request.idempotencyKey ? { idempotency_key: request.idempotencyKey } : {}
911
927
  };
912
928
  const response = await fetch(`${resolveBaseUrl()}/api/v1/signals`, {
913
929
  method: "POST",
914
930
  headers: {
915
931
  "Content-Type": "application/json",
916
- Authorization: `Bearer ${resolveApiKey()}`
932
+ Authorization: `Bearer ${resolveApiKey()}`,
933
+ ...request.idempotencyKey ? { "Idempotency-Key": request.idempotencyKey } : {}
917
934
  },
918
935
  body: JSON.stringify(body)
919
936
  });
@@ -1341,16 +1358,17 @@ async function companySignals() {
1341
1358
  companyDomain: row.companyDomain || row.company_domain || row.domain,
1342
1359
  domain: row.domain || row.companyDomain || row.company_domain,
1343
1360
  researchPrompt: row.researchPrompt || row.research_prompt,
1361
+ lookbackDays: row.lookbackDays || row.lookback_days,
1344
1362
  idempotencyKey: row.idempotencyKey || row.idempotency_key
1345
1363
  };
1346
1364
  });
1347
1365
  if (durableBatch) {
1348
1366
  const incompatible = requests.some(
1349
- (request2) => Boolean(stringValue(request2.signalRunId)) || Boolean(stringValue(request2.idempotencyKey)) || !stringValue(request2.domain) || !stringValue(request2.researchPrompt)
1367
+ (request2) => Boolean(stringValue(request2.signalRunId)) || Boolean(stringValue(request2.idempotencyKey)) || !stringValue(request2.domain)
1350
1368
  );
1351
1369
  if (incompatible) {
1352
1370
  throw new CliInputError(
1353
- "Company Signals batches larger than 25 require domain and research_prompt rows without per-row controls or recovery IDs."
1371
+ "Company Signals batches larger than 25 require domain rows without per-row controls or recovery IDs."
1354
1372
  );
1355
1373
  }
1356
1374
  } else if (hasFlag("no-wait") && !hasFlag("dry-run")) {
@@ -1387,13 +1405,14 @@ async function companySignals() {
1387
1405
  const companyDomain = flag("domain") || flag("company-domain");
1388
1406
  const researchPrompt = flag("research-prompt");
1389
1407
  const signalRunId = flag("signal-run-id");
1390
- if ((!companyDomain || !researchPrompt) && !signalRunId) {
1391
- throw new CliInputError('Usage: signaliz company-signals --domain example.com --research-prompt "Why now?"');
1408
+ if (!companyDomain && !signalRunId) {
1409
+ throw new CliInputError('Usage: signaliz company-signals --domain example.com [--research-prompt "Why now?"]');
1392
1410
  }
1393
1411
  const request = {
1394
1412
  signalRunId,
1395
1413
  domain: companyDomain,
1396
- researchPrompt
1414
+ researchPrompt,
1415
+ lookbackDays: numberFlag("lookback-days")
1397
1416
  };
1398
1417
  if (hasFlag("dry-run")) {
1399
1418
  const result2 = await createClient().enrichCompanySignals({ ...request, dryRun: true });
@@ -1460,7 +1479,9 @@ async function signals(args) {
1460
1479
  const request = {
1461
1480
  query,
1462
1481
  signalSearchRunId,
1463
- limit: numberFlag("limit")
1482
+ limit: numberFlag("limit"),
1483
+ dryRun: hasFlag("dry-run") || void 0,
1484
+ idempotencyKey: flag("idempotency-key")
1464
1485
  };
1465
1486
  let result = await discoverSignalsEverything(request);
1466
1487
  if (hasFlag("wait")) {
@@ -1824,15 +1845,35 @@ function yesNoFlag(name) {
1824
1845
  }
1825
1846
  async function awareness(args) {
1826
1847
  const action = args[0];
1827
- const actions = ["add", "signals", "delete", "schedule"];
1848
+ const actions = ["add", "list", "run", "pause", "resume", "signals", "export", "settings", "delete", "schedule"];
1828
1849
  if (!action || !actions.includes(action)) {
1829
1850
  throw new CliInputError(`Usage: signaliz awareness <${actions.join("|")}>`);
1830
1851
  }
1831
1852
  const domain = flag("domain");
1832
- if (!domain) throw new CliInputError(`signaliz awareness ${action} requires --domain <company-domain>`);
1853
+ const monitorId = flag("monitor-id");
1833
1854
  const client = createClient();
1855
+ if (action === "list") {
1856
+ const result2 = await client.listSignalMonitors(numberFlag("limit"), numberFlag("offset"));
1857
+ output(result2);
1858
+ return;
1859
+ }
1860
+ if (action === "settings") {
1861
+ output(await client.getSignalAwarenessSettings());
1862
+ return;
1863
+ }
1864
+ if (action === "run" || action === "pause" || action === "resume") {
1865
+ if (!monitorId) throw new CliInputError(`signaliz awareness ${action} requires --monitor-id <uuid>`);
1866
+ const result2 = action === "run" ? await client.runSignalMonitor(monitorId, flag("idempotency-key")) : action === "pause" ? await client.pauseSignalMonitor(monitorId) : await client.resumeSignalMonitor(monitorId);
1867
+ output(result2);
1868
+ return;
1869
+ }
1870
+ if (action === "export") {
1871
+ output(await client.exportSignalAwareness(monitorId));
1872
+ return;
1873
+ }
1834
1874
  if (action === "signals") {
1835
- const result2 = customerSignalAwarenessResult(await client.listAllSignalAwarenessSignals(domain));
1875
+ if (!domain && !monitorId) throw new CliInputError("signaliz awareness signals requires --domain or --monitor-id");
1876
+ const result2 = customerSignalAwarenessResult(monitorId ? await client.listSignalAwarenessSignals(monitorId, numberFlag("limit"), numberFlag("offset")) : await client.listAllSignalAwarenessSignals(domain));
1836
1877
  output(result2, () => {
1837
1878
  for (const signal of result2.signals || []) {
1838
1879
  process.stdout.write(`${signal.signal_type} ${signal.signal_title} ${signal.signal_summary} ${signal.source} ${signal.date} ${signal.company_name} ${signal.domain}
@@ -1842,12 +1883,14 @@ async function awareness(args) {
1842
1883
  return;
1843
1884
  }
1844
1885
  if (action === "add") {
1886
+ if (!domain) throw new CliInputError("signaliz awareness add requires --domain <company-domain>");
1845
1887
  const result2 = await client.addSignalAwarenessCompany(domain, awarenessSchedule() ?? "daily");
1846
1888
  output(result2, () => process.stdout.write(`Company added: ${domain}
1847
1889
  `));
1848
1890
  return;
1849
1891
  }
1850
1892
  if (action === "schedule") {
1893
+ if (!domain) throw new CliInputError("signaliz awareness schedule requires --domain <company-domain>");
1851
1894
  const schedule = awarenessSchedule();
1852
1895
  if (!schedule) throw new CliInputError("signaliz awareness schedule requires --schedule daily|weekly|monthly");
1853
1896
  const result2 = await client.changeSignalAwarenessSchedule(domain, schedule);
@@ -1855,8 +1898,9 @@ async function awareness(args) {
1855
1898
  `));
1856
1899
  return;
1857
1900
  }
1858
- const result = await client.deleteSignalAwarenessCompany(domain);
1859
- output(result, () => process.stdout.write(`Company deleted: ${domain}
1901
+ if (!domain && !monitorId) throw new CliInputError("signaliz awareness delete requires --domain or --monitor-id");
1902
+ const result = monitorId ? await client.deleteSignalMonitor(monitorId) : await client.deleteSignalAwarenessCompany(domain);
1903
+ output(result, () => process.stdout.write(`Monitor deleted: ${monitorId || domain}
1860
1904
  `));
1861
1905
  }
1862
1906
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/cli",
3
- "version": "1.0.69",
3
+ "version": "1.0.70",
4
4
  "description": "Signaliz CLI for Company Signal Enrichment, Signals First, Signal Awareness, Signal to Copy AI, and Signaliz Flow.",
5
5
  "bin": {
6
6
  "signaliz": "dist/bin.js"
@@ -29,7 +29,7 @@
29
29
  "node": ">=18"
30
30
  },
31
31
  "dependencies": {
32
- "@signaliz/sdk": "^1.0.74"
32
+ "@signaliz/sdk": "^1.0.75"
33
33
  },
34
34
  "devDependencies": {
35
35
  "tsup": "^8.0.0",