@signaliz/cli 1.0.65 → 1.0.67

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 (3) hide show
  1. package/README.md +6 -2
  2. package/dist/bin.js +119 -33
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -53,10 +53,14 @@ signaliz signals "companies showing signals they need account-signal automation"
53
53
  --limit 100 --sources web,news
54
54
  signaliz signals --signal-search-run-id run_... --wait --json
55
55
 
56
- # Monitor companies and retrieve seven-field verified signal rows
57
- # reason and replacement pointers forward.
56
+ # Monitor companies with the fixed Company Signal evidence engine.
57
+ signaliz awareness create --company-name "Acme" --domain acme.com --schedule daily
58
+ signaliz awareness schedule --monitor-id <uuid> --schedule monthly
59
+ signaliz awareness import --input companies.json --schedule weekly
58
60
  signaliz awareness list --limit 100 --offset 0 --json
59
61
  signaliz awareness signals --monitor-id <uuid> --limit 100 --offset 0 --json
62
+ signaliz awareness set-output --mode webhook --webhook-url https://hooks.example.com/signaliz
63
+ signaliz awareness export --monitor-id <uuid> --json
60
64
 
61
65
  # Flow starts and resumes through the versioned REST contract.
62
66
  signaliz flow --signal-query "companies with recent hiring" \
package/dist/bin.js CHANGED
@@ -39,11 +39,19 @@ Six product commands:
39
39
  signaliz signals "companies that just got funded" [--icp-context "..."] [--limit 100] [--sources web,news] [--after-date YYYY-MM-DD --before-date YYYY-MM-DD] [--wait]
40
40
  signaliz signals-first "companies that just got funded" [--limit 100] [--lookback-days 30] [--wait]
41
41
  signaliz signals --signal-search-run-id run_... Resume an existing company-attributed signal search
42
- signaliz awareness create --company-name "Acme" --domain acme.com [--schedule daily] [--monthly-credit-cap 100]
42
+ signaliz awareness create --company-name "Acme" --domain acme.com [--schedule daily|weekly|monthly | --schedule-cron "0 8 * * *"]
43
+ signaliz awareness import --input companies.json [--schedule daily]
43
44
  signaliz awareness list [--limit 100] [--offset 0]
45
+ signaliz awareness update --monitor-id <uuid> [--company-name "Acme"] [--schedule weekly] [--webhook-url https://...]
46
+ signaliz awareness schedule --monitor-id <uuid> --schedule monthly
44
47
  signaliz awareness run --monitor-id <uuid> --idempotency-key <key>
45
48
  signaliz awareness signals [--monitor-id <uuid>]
46
49
  signaliz awareness pause|resume|delete --monitor-id <uuid>
50
+ signaliz awareness settings
51
+ signaliz awareness set-output --mode csv|webhook [--webhook-url https://...]
52
+ signaliz awareness test-webhook --webhook-url https://...
53
+ signaliz awareness export [--monitor-id <uuid>] --json
54
+ signaliz awareness send-export --input signals.jsonl
47
55
  signaliz flow --signal-query "companies with recent hiring" --campaign-offer "..." [--limit 5] [--lookback-days 90] [--people-titles "CEO,VP Sales"]
48
56
  signaliz flow --run-id run_... Read a durable Flow checkpoint without dispatching new work
49
57
 
@@ -388,10 +396,8 @@ function publicCompanySignalRows(value, fallbackCompany) {
388
396
  const eventId = signalText(
389
397
  signal.event_id || signal.eventId || signal.fact_id || signal.factId || raw.event_id || raw.eventId || raw.fact_id || raw.factId
390
398
  ).toLowerCase();
391
- const identities = [
392
- ...eventId ? [`event:${eventId}`] : [],
393
- `source:${row.source.toLowerCase()}`
394
- ];
399
+ const title = row.signal_title.toLowerCase().replace(/https?:\/\/\S+/g, " ").replace(/[^a-z0-9$.\s]+/g, " ").replace(/\s+/g, " ").trim();
400
+ const identities = eventId ? [`event:${eventId}`] : title && row.date ? [`event:${title}|${row.date}`] : [`source:${row.source.toLowerCase()}`];
395
401
  if (identities.some((identity) => seenEvents.has(identity))) continue;
396
402
  identities.forEach((identity) => seenEvents.add(identity));
397
403
  rows.push(row);
@@ -695,7 +701,7 @@ function customerCompanySignalBatch(value) {
695
701
  function customerSignalAwarenessResult(value) {
696
702
  const result = record(value);
697
703
  const { raw: _raw, signals: _signals, ...publicResult } = result;
698
- const signals2 = Array.isArray(result.signals) ? oneSignalPerCompany(publicSignalRows(result.signals)) : void 0;
704
+ const signals2 = Array.isArray(result.signals) ? publicSignalRows(result.signals) : void 0;
699
705
  return {
700
706
  ...publicResult,
701
707
  ...signals2 ? { signals: signals2 } : {}
@@ -1842,18 +1848,36 @@ function awarenessSchedule() {
1842
1848
  every_6_hours: "0 */6 * * *",
1843
1849
  daily: "0 8 * * *",
1844
1850
  every_2_days: "0 8 */2 * *",
1845
- weekly: "0 8 * * 1"
1851
+ weekly: "0 8 * * 1",
1852
+ monthly: "0 8 1 * *"
1846
1853
  };
1847
1854
  if (!schedules[schedule]) {
1848
- throw new CliInputError("--schedule must be every_6_hours, daily, every_2_days, or weekly");
1855
+ throw new CliInputError("--schedule must be every_6_hours, daily, every_2_days, weekly, or monthly");
1849
1856
  }
1850
1857
  return schedules[schedule];
1851
1858
  }
1852
1859
  async function awareness(args) {
1853
1860
  const action = args[0];
1854
1861
  const monitorId = flag("monitor-id");
1855
- if (!action || !["create", "list", "run", "signals", "pause", "resume", "delete"].includes(action)) {
1856
- throw new CliInputError("Usage: signaliz awareness <create|list|run|signals|pause|resume|delete>");
1862
+ const actions = [
1863
+ "create",
1864
+ "import",
1865
+ "list",
1866
+ "update",
1867
+ "schedule",
1868
+ "run",
1869
+ "signals",
1870
+ "pause",
1871
+ "resume",
1872
+ "delete",
1873
+ "settings",
1874
+ "set-output",
1875
+ "test-webhook",
1876
+ "export",
1877
+ "send-export"
1878
+ ];
1879
+ if (!action || !actions.includes(action)) {
1880
+ throw new CliInputError(`Usage: signaliz awareness <${actions.join("|")}>`);
1857
1881
  }
1858
1882
  const client = createClient();
1859
1883
  if (action === "create") {
@@ -1862,32 +1886,42 @@ async function awareness(args) {
1862
1886
  if (!companyName || !domain) {
1863
1887
  throw new CliInputError('Usage: signaliz awareness create --company-name "Acme" --domain acme.com');
1864
1888
  }
1865
- const monthlyCreditCap = numberFlag("monthly-credit-cap");
1866
- if (monthlyCreditCap !== void 0) requireIntegerInRange(monthlyCreditCap, "--monthly-credit-cap", 1, 1e4);
1867
- const lookbackDays = numberFlag("lookback-days");
1868
- if (lookbackDays !== void 0) requireIntegerInRange(lookbackDays, "--lookback-days", 1, 365);
1869
- const signalTypes = csvFlag("signal-types");
1870
1889
  const result2 = await client.createSignalMonitor({
1871
1890
  companyName,
1872
1891
  domain,
1873
- template: flag("template") === "basic" ? "basic" : "full_intelligence",
1874
1892
  scheduleCron: awarenessSchedule(),
1875
- monthlyCreditCap,
1876
- webhookUrl: flag("webhook-url"),
1877
- signalConfig: {
1878
- ...lookbackDays !== void 0 ? { lookback_days: lookbackDays } : {},
1879
- ...signalTypes ? { signal_types: signalTypes } : {},
1880
- ...flag("research-prompt") ? { research_prompt: flag("research-prompt") } : {}
1881
- }
1893
+ webhookUrl: flag("webhook-url")
1882
1894
  });
1883
1895
  output(result2, () => process.stdout.write(`Monitor created: ${String(result2.monitor?.id || "pending")}
1896
+ `));
1897
+ return;
1898
+ }
1899
+ if (action === "import") {
1900
+ const rows = readBatchInput();
1901
+ if (!rows) throw new CliInputError("signaliz awareness import requires --input <json-or-jsonl-file>");
1902
+ if (rows.length > 500) throw new CliInputError(`Signal Awareness imports at most 500 companies; received ${rows.length}`);
1903
+ const monitors = rows.map((value, index) => {
1904
+ const row = record(value);
1905
+ const companyName = stringValue(row.company_name ?? row.companyName ?? row.company ?? row.name);
1906
+ const domain = stringValue(row.domain ?? row.website);
1907
+ if (!companyName || !domain) throw new CliInputError(`Awareness import row ${index + 1} requires company_name and domain`);
1908
+ return { companyName, domain };
1909
+ });
1910
+ const result2 = await client.bulkCreateSignalMonitors(monitors, {
1911
+ scheduleCron: awarenessSchedule(),
1912
+ webhookUrl: flag("webhook-url")
1913
+ });
1914
+ output(result2, () => process.stdout.write(`Created: ${result2.created || 0}
1915
+ Skipped: ${result2.skipped || 0}
1884
1916
  `));
1885
1917
  return;
1886
1918
  }
1887
1919
  if (action === "list") {
1888
1920
  const offset = numberFlag("offset");
1921
+ const limit = numberFlag("limit");
1922
+ if (limit !== void 0) requireIntegerInRange(limit, "--limit", 1, 500);
1889
1923
  if (offset !== void 0) requireIntegerInRange(offset, "--offset", 0, 1e4);
1890
- const result2 = await client.listSignalMonitors(numberFlag("limit"), offset);
1924
+ const result2 = await client.listSignalMonitors(limit, offset);
1891
1925
  output(result2, () => {
1892
1926
  for (const monitor of result2.monitors || []) {
1893
1927
  process.stdout.write(`${String(monitor.company_name)} ${String(monitor.status)} ${String(monitor.next_run_at || "not scheduled")} ${String(monitor.id)}
@@ -1898,13 +1932,10 @@ async function awareness(args) {
1898
1932
  }
1899
1933
  if (action === "signals") {
1900
1934
  const offset = numberFlag("offset");
1935
+ const limit = numberFlag("limit");
1936
+ if (limit !== void 0) requireIntegerInRange(limit, "--limit", 1, 500);
1901
1937
  if (offset !== void 0) requireIntegerInRange(offset, "--offset", 0, 1e4);
1902
- const result2 = customerSignalAwarenessResult(await client.signalAwareness({
1903
- action: "list_signals",
1904
- monitorId,
1905
- limit: numberFlag("limit"),
1906
- offset
1907
- }));
1938
+ const result2 = customerSignalAwarenessResult(await client.listSignalAwarenessSignals(monitorId, limit, offset));
1908
1939
  output(result2, () => {
1909
1940
  for (const signal of result2.signals || []) {
1910
1941
  process.stdout.write(`${signal.signal_type} ${signal.signal_title} ${signal.signal_summary} ${signal.source} ${signal.date} ${signal.company_name} ${signal.domain}
@@ -1913,7 +1944,64 @@ async function awareness(args) {
1913
1944
  });
1914
1945
  return;
1915
1946
  }
1947
+ if (action === "settings") {
1948
+ const result2 = await client.getSignalAwarenessSettings();
1949
+ output(result2, () => process.stdout.write(`Output: ${result2.outputMode || "csv"}
1950
+ Webhook: ${result2.webhookUrl || "not configured"}
1951
+ `));
1952
+ return;
1953
+ }
1954
+ if (action === "set-output") {
1955
+ const mode = flag("mode");
1956
+ if (mode !== "csv" && mode !== "webhook") throw new CliInputError("signaliz awareness set-output requires --mode csv|webhook");
1957
+ const webhookUrl = flag("webhook-url");
1958
+ if (mode === "webhook" && !webhookUrl) throw new CliInputError("--webhook-url is required when --mode webhook");
1959
+ const result2 = await client.setSignalAwarenessOutput(mode, webhookUrl);
1960
+ output(result2, () => process.stdout.write(`Signal Awareness output set to ${mode}
1961
+ `));
1962
+ return;
1963
+ }
1964
+ if (action === "test-webhook") {
1965
+ const webhookUrl = flag("webhook-url");
1966
+ if (!webhookUrl) throw new CliInputError("signaliz awareness test-webhook requires --webhook-url https://...");
1967
+ const result2 = await client.testSignalAwarenessWebhook(webhookUrl);
1968
+ output(result2, () => process.stdout.write(`Webhook returned HTTP ${result2.webhookStatus || "unknown"}
1969
+ `));
1970
+ return;
1971
+ }
1972
+ if (action === "export") {
1973
+ const result2 = customerSignalAwarenessResult(await client.exportSignalAwareness(monitorId));
1974
+ output(result2, () => process.stdout.write(`Companies: ${result2.monitors?.length || 0}
1975
+ Signals: ${result2.signals?.length || 0}
1976
+ `));
1977
+ return;
1978
+ }
1979
+ if (action === "send-export") {
1980
+ const rows = readBatchInput();
1981
+ if (!rows) throw new CliInputError("signaliz awareness send-export requires --input <json-or-jsonl-file>");
1982
+ if (rows.length > 2e3) throw new CliInputError(`Signal Awareness sends at most 2,000 signals per call; received ${rows.length}`);
1983
+ const signals2 = publicSignalRows(rows);
1984
+ if (signals2.length !== rows.length) throw new CliInputError("Every send-export row must contain signal_type, source, date, company_name, and domain");
1985
+ const result2 = await client.sendSignalAwarenessExport(signals2);
1986
+ output(result2, () => process.stdout.write(`Delivered: ${result2.delivered || 0}
1987
+ Webhook: HTTP ${result2.webhookStatus || "unknown"}
1988
+ `));
1989
+ return;
1990
+ }
1916
1991
  if (!monitorId) throw new CliInputError(`signaliz awareness ${action} requires --monitor-id <uuid>`);
1992
+ if (action === "update" || action === "schedule") {
1993
+ const scheduleCron = awarenessSchedule();
1994
+ const companyName = flag("company-name");
1995
+ const webhookUrl = hasFlag("clear-webhook") ? null : flag("webhook-url");
1996
+ if (action === "schedule" && !scheduleCron) throw new CliInputError("signaliz awareness schedule requires --schedule or --schedule-cron");
1997
+ if (!companyName && !scheduleCron && webhookUrl === void 0) {
1998
+ throw new CliInputError("signaliz awareness update requires --company-name, --schedule/--schedule-cron, --webhook-url, or --clear-webhook");
1999
+ }
2000
+ const result2 = await client.updateSignalMonitor(monitorId, { companyName, scheduleCron, webhookUrl });
2001
+ output(result2, () => process.stdout.write(`Monitor updated: ${monitorId}
2002
+ `));
2003
+ return;
2004
+ }
1917
2005
  if (action === "run") {
1918
2006
  if (hasFlag("dry-run")) {
1919
2007
  const result3 = await client.signalAwareness({ action: "manual_run", monitorId, idempotencyKey: flag("idempotency-key"), dryRun: true });
@@ -1929,9 +2017,7 @@ Credits used: ${result2.creditsUsed || 0}
1929
2017
  });
1930
2018
  return;
1931
2019
  }
1932
- const result = await client.signalAwareness(
1933
- action === "delete" ? { action: "delete", monitorId } : { action: "update", monitorId, updates: { status: action === "resume" ? "active" : "paused", ...action === "resume" ? { auto_paused: false, auto_pause_reason: null } : {} } }
1934
- );
2020
+ const result = action === "delete" ? await client.deleteSignalMonitor(monitorId) : action === "resume" ? await client.resumeSignalMonitor(monitorId) : await client.pauseSignalMonitor(monitorId);
1935
2021
  output(result, () => process.stdout.write(`Monitor ${action === "delete" ? "deleted" : action === "resume" ? "resumed" : "paused"}: ${monitorId}
1936
2022
  `));
1937
2023
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/cli",
3
- "version": "1.0.65",
3
+ "version": "1.0.67",
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.68"
32
+ "@signaliz/sdk": "^1.0.72"
33
33
  },
34
34
  "devDependencies": {
35
35
  "tsup": "^8.0.0",