@signaliz/cli 1.0.66 → 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 +117 -29
  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
 
@@ -693,7 +701,7 @@ function customerCompanySignalBatch(value) {
693
701
  function customerSignalAwarenessResult(value) {
694
702
  const result = record(value);
695
703
  const { raw: _raw, signals: _signals, ...publicResult } = result;
696
- const signals2 = Array.isArray(result.signals) ? oneSignalPerCompany(publicSignalRows(result.signals)) : void 0;
704
+ const signals2 = Array.isArray(result.signals) ? publicSignalRows(result.signals) : void 0;
697
705
  return {
698
706
  ...publicResult,
699
707
  ...signals2 ? { signals: signals2 } : {}
@@ -1840,18 +1848,36 @@ function awarenessSchedule() {
1840
1848
  every_6_hours: "0 */6 * * *",
1841
1849
  daily: "0 8 * * *",
1842
1850
  every_2_days: "0 8 */2 * *",
1843
- weekly: "0 8 * * 1"
1851
+ weekly: "0 8 * * 1",
1852
+ monthly: "0 8 1 * *"
1844
1853
  };
1845
1854
  if (!schedules[schedule]) {
1846
- 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");
1847
1856
  }
1848
1857
  return schedules[schedule];
1849
1858
  }
1850
1859
  async function awareness(args) {
1851
1860
  const action = args[0];
1852
1861
  const monitorId = flag("monitor-id");
1853
- if (!action || !["create", "list", "run", "signals", "pause", "resume", "delete"].includes(action)) {
1854
- 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("|")}>`);
1855
1881
  }
1856
1882
  const client = createClient();
1857
1883
  if (action === "create") {
@@ -1860,32 +1886,42 @@ async function awareness(args) {
1860
1886
  if (!companyName || !domain) {
1861
1887
  throw new CliInputError('Usage: signaliz awareness create --company-name "Acme" --domain acme.com');
1862
1888
  }
1863
- const monthlyCreditCap = numberFlag("monthly-credit-cap");
1864
- if (monthlyCreditCap !== void 0) requireIntegerInRange(monthlyCreditCap, "--monthly-credit-cap", 1, 1e4);
1865
- const lookbackDays = numberFlag("lookback-days");
1866
- if (lookbackDays !== void 0) requireIntegerInRange(lookbackDays, "--lookback-days", 1, 365);
1867
- const signalTypes = csvFlag("signal-types");
1868
1889
  const result2 = await client.createSignalMonitor({
1869
1890
  companyName,
1870
1891
  domain,
1871
- template: flag("template") === "basic" ? "basic" : "full_intelligence",
1872
1892
  scheduleCron: awarenessSchedule(),
1873
- monthlyCreditCap,
1874
- webhookUrl: flag("webhook-url"),
1875
- signalConfig: {
1876
- ...lookbackDays !== void 0 ? { lookback_days: lookbackDays } : {},
1877
- ...signalTypes ? { signal_types: signalTypes } : {},
1878
- ...flag("research-prompt") ? { research_prompt: flag("research-prompt") } : {}
1879
- }
1893
+ webhookUrl: flag("webhook-url")
1880
1894
  });
1881
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}
1882
1916
  `));
1883
1917
  return;
1884
1918
  }
1885
1919
  if (action === "list") {
1886
1920
  const offset = numberFlag("offset");
1921
+ const limit = numberFlag("limit");
1922
+ if (limit !== void 0) requireIntegerInRange(limit, "--limit", 1, 500);
1887
1923
  if (offset !== void 0) requireIntegerInRange(offset, "--offset", 0, 1e4);
1888
- const result2 = await client.listSignalMonitors(numberFlag("limit"), offset);
1924
+ const result2 = await client.listSignalMonitors(limit, offset);
1889
1925
  output(result2, () => {
1890
1926
  for (const monitor of result2.monitors || []) {
1891
1927
  process.stdout.write(`${String(monitor.company_name)} ${String(monitor.status)} ${String(monitor.next_run_at || "not scheduled")} ${String(monitor.id)}
@@ -1896,13 +1932,10 @@ async function awareness(args) {
1896
1932
  }
1897
1933
  if (action === "signals") {
1898
1934
  const offset = numberFlag("offset");
1935
+ const limit = numberFlag("limit");
1936
+ if (limit !== void 0) requireIntegerInRange(limit, "--limit", 1, 500);
1899
1937
  if (offset !== void 0) requireIntegerInRange(offset, "--offset", 0, 1e4);
1900
- const result2 = customerSignalAwarenessResult(await client.signalAwareness({
1901
- action: "list_signals",
1902
- monitorId,
1903
- limit: numberFlag("limit"),
1904
- offset
1905
- }));
1938
+ const result2 = customerSignalAwarenessResult(await client.listSignalAwarenessSignals(monitorId, limit, offset));
1906
1939
  output(result2, () => {
1907
1940
  for (const signal of result2.signals || []) {
1908
1941
  process.stdout.write(`${signal.signal_type} ${signal.signal_title} ${signal.signal_summary} ${signal.source} ${signal.date} ${signal.company_name} ${signal.domain}
@@ -1911,7 +1944,64 @@ async function awareness(args) {
1911
1944
  });
1912
1945
  return;
1913
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
+ }
1914
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
+ }
1915
2005
  if (action === "run") {
1916
2006
  if (hasFlag("dry-run")) {
1917
2007
  const result3 = await client.signalAwareness({ action: "manual_run", monitorId, idempotencyKey: flag("idempotency-key"), dryRun: true });
@@ -1927,9 +2017,7 @@ Credits used: ${result2.creditsUsed || 0}
1927
2017
  });
1928
2018
  return;
1929
2019
  }
1930
- const result = await client.signalAwareness(
1931
- action === "delete" ? { action: "delete", monitorId } : { action: "update", monitorId, updates: { status: action === "resume" ? "active" : "paused", ...action === "resume" ? { auto_paused: false, auto_pause_reason: null } : {} } }
1932
- );
2020
+ const result = action === "delete" ? await client.deleteSignalMonitor(monitorId) : action === "resume" ? await client.resumeSignalMonitor(monitorId) : await client.pauseSignalMonitor(monitorId);
1933
2021
  output(result, () => process.stdout.write(`Monitor ${action === "delete" ? "deleted" : action === "resume" ? "resumed" : "paused"}: ${monitorId}
1934
2022
  `));
1935
2023
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/cli",
3
- "version": "1.0.66",
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",