@signaliz/cli 1.0.82 → 1.0.85

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 +11 -2
  2. package/dist/bin.js +129 -1
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @signaliz/cli
2
2
 
3
- The Signaliz CLI exposes all five core products, plus Signal Awareness and
4
- Signaliz Flow through the same public contract:
3
+ The Signaliz CLI exposes all five core products, Signal Awareness,
4
+ Signaliz Flow, and delivered managed builds through one public contract:
5
5
 
6
6
  ```bash
7
7
  npm install -g @signaliz/cli
@@ -19,6 +19,7 @@ signaliz auth login
19
19
  # https://api.signaliz.com/functions/v1/api/v1/signal-awareness/companies/delete
20
20
  # https://api.signaliz.com/functions/v1/api/v1/signal-awareness/companies/schedule
21
21
  # https://api.signaliz.com/functions/v1/api/v1/flow
22
+ # https://api.signaliz.com/functions/v1/api/v1/managed-builds
22
23
  # The same contracts are available under /api/v2/.
23
24
 
24
25
  signaliz find-email --company-domain example.com --full-name "Jane Doe"
@@ -70,6 +71,14 @@ signaliz flow --signal-query "companies with recent hiring" \
70
71
  signaliz flow --run-id run_... --json
71
72
  # Keep polling the returned run ID until status is completed or failed.
72
73
  # Flow leaves generated copy in review and never sends outreach.
74
+
75
+ # Delivered GTM Contractor builds publish their Clay budget and fixed
76
+ # Signaliz-credit price before each reusable run.
77
+ signaliz builds list
78
+ signaliz builds get --build-id BLD-A1B2C3D4E5F6
79
+ signaliz builds run --build-id BLD-A1B2C3D4E5F6 \
80
+ --input request.json --idempotency-key customer-run-001
81
+ signaliz builds status --run-id 11111111-1111-4111-8111-111111111111 --json
73
82
  ```
74
83
 
75
84
  Use `--json` with any product command for structured output.
package/dist/bin.js CHANGED
@@ -17,7 +17,7 @@ var CONFIG_DIR = (0, import_node_path.join)((0, import_node_os.homedir)(), ".sig
17
17
  var CONFIG_FILE = (0, import_node_path.join)(CONFIG_DIR, "config.json");
18
18
  var HELP = `Signaliz CLI
19
19
 
20
- Six product commands:
20
+ Product commands:
21
21
  signaliz find-email --linkedin-url https://www.linkedin.com/in/jane-doe [--no-wait]
22
22
  signaliz find-email --company-domain example.com --full-name "Jane Doe" [--no-wait]
23
23
  signaliz find-email --run-id run_... Resume an existing Find Email run without duplicate spend
@@ -50,6 +50,12 @@ Six product commands:
50
50
  signaliz awareness schedule --domain acme.com --schedule daily|weekly|monthly
51
51
  signaliz flow --signal-query "companies with recent hiring" --campaign-offer "..." [--limit 5] [--lookback-days 90] [--people-titles "CEO,VP Sales"]
52
52
  signaliz flow --run-id run_... Read a durable Flow checkpoint without dispatching new work
53
+ signaliz builds list
54
+ signaliz builds get --build-id BLD-...
55
+ signaliz builds quote --build-id BLD-... [--input request.json]
56
+ signaliz builds run --build-id BLD-... [--input request.json] --confirm-spend --max-credits <number> [--idempotency-key <key>]
57
+ signaliz builds status --run-id <uuid> [--limit 100]
58
+ signaliz builds download --run-id <uuid> --out results.csv
53
59
 
54
60
  Access and connection:
55
61
  signaliz auth login
@@ -1944,6 +1950,126 @@ async function awareness(args) {
1944
1950
  output(result, () => process.stdout.write(`Monitor deleted: ${monitorId || domain}
1945
1951
  `));
1946
1952
  }
1953
+ function readManagedBuildInput() {
1954
+ const source = flag("input");
1955
+ if (!source) return {};
1956
+ let raw;
1957
+ try {
1958
+ raw = source.trim().startsWith("{") ? source.trim() : (0, import_node_fs.readFileSync)(source === "-" ? 0 : source, "utf8").trim();
1959
+ } catch (error) {
1960
+ throw new CliInputError(`Unable to read managed-build input: ${error instanceof Error ? error.message : String(error)}`);
1961
+ }
1962
+ try {
1963
+ const parsed = JSON.parse(raw);
1964
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("input must be one JSON object");
1965
+ return parsed;
1966
+ } catch (error) {
1967
+ throw new CliInputError(`Managed-build input must be valid JSON: ${error instanceof Error ? error.message : String(error)}`);
1968
+ }
1969
+ }
1970
+ async function managedBuilds(args) {
1971
+ const action = args[0] || "list";
1972
+ const client = createClient();
1973
+ if (action === "list") {
1974
+ const result = await client.listManagedBuilds();
1975
+ output(result, () => {
1976
+ if (!result.builds.length) return process.stdout.write("No Final Build systems are assigned to this workspace.\n");
1977
+ for (const build of result.builds) {
1978
+ process.stdout.write(`${build.build_id} ${build.name} ${build.fixed_credits_per_run} credits/run
1979
+ `);
1980
+ }
1981
+ });
1982
+ return;
1983
+ }
1984
+ if (action === "get") {
1985
+ const buildId = flag("build-id");
1986
+ if (!buildId) throw new CliInputError("signaliz builds get requires --build-id BLD-...");
1987
+ const result = await client.getManagedBuild(buildId);
1988
+ output(result, () => {
1989
+ process.stdout.write(`${result.build.build_id} \u2014 ${result.build.name}
1990
+ `);
1991
+ process.stdout.write(`Base price: ${result.build.fixed_credits_per_run} Signaliz credits for ${result.build.included_records_per_run} included record(s)
1992
+ `);
1993
+ process.stdout.write(`Additional records: ${result.build.additional_record_credits} Signaliz credits each \xB7 max ${result.build.max_records_per_run}
1994
+ `);
1995
+ process.stdout.write(`Estimated Clay use: ${result.build.clay_credits_budget_per_run} base + ${result.build.additional_clay_credits_per_record} per additional record
1996
+ `);
1997
+ if (result.build.delivery_notes) process.stdout.write(`${result.build.delivery_notes}
1998
+ `);
1999
+ });
2000
+ return;
2001
+ }
2002
+ if (action === "quote") {
2003
+ const buildId = flag("build-id");
2004
+ if (!buildId) throw new CliInputError("signaliz builds quote requires --build-id BLD-...");
2005
+ const result = await client.quoteManagedBuildRun(buildId, readManagedBuildInput());
2006
+ output(result, () => {
2007
+ process.stdout.write(`${result.quote.item_count} record(s): ${result.quote.total_signaliz_credits} Signaliz credits
2008
+ `);
2009
+ process.stdout.write(`Estimated Clay consumption: ${result.quote.estimated_clay_credits} credits
2010
+ `);
2011
+ process.stdout.write("No run created and no credits charged.\n");
2012
+ });
2013
+ return;
2014
+ }
2015
+ if (action === "run") {
2016
+ const buildId = flag("build-id");
2017
+ if (!buildId) throw new CliInputError("signaliz builds run requires --build-id BLD-...");
2018
+ const maxCredits = numberFlag("max-credits");
2019
+ if (!hasFlag("confirm-spend") || maxCredits === void 0) {
2020
+ throw new CliInputError("Live managed-build runs require --confirm-spend and --max-credits <number>. Use builds quote first.");
2021
+ }
2022
+ const result = await client.runManagedBuild(buildId, readManagedBuildInput(), {
2023
+ idempotencyKey: flag("idempotency-key"),
2024
+ confirmSpend: true,
2025
+ maxCredits
2026
+ });
2027
+ output(result, () => {
2028
+ if (!result.run) throw new CliInputError(result.message || "Managed build was not queued.");
2029
+ process.stdout.write(`Managed build queued: ${result.run.run_id}
2030
+ `);
2031
+ process.stdout.write(`Charged: ${result.run.fixed_credits_charged} Signaliz credits (${result.run.billing_status})
2032
+ `);
2033
+ process.stdout.write(`Check results: signaliz builds status --run-id ${result.run.run_id}
2034
+ `);
2035
+ });
2036
+ return;
2037
+ }
2038
+ if (action === "status") {
2039
+ const runId = flag("run-id");
2040
+ if (!runId) throw new CliInputError("signaliz builds status requires --run-id <uuid>");
2041
+ const limit = numberFlag("limit") ?? 100;
2042
+ requireIntegerInRange(limit, "--limit", 1, 500);
2043
+ const result = await client.getManagedBuildRun(runId, limit);
2044
+ output(result, () => {
2045
+ process.stdout.write(`${result.run.build_id} run ${result.run.run_id}: ${result.run.status}
2046
+ `);
2047
+ process.stdout.write(`Results returned: ${result.returned || 0}
2048
+ `);
2049
+ const csv = result.artifacts?.csv?.download_url;
2050
+ if (csv) process.stdout.write(`CSV: ${csv}
2051
+ `);
2052
+ if (result.run.error) process.stdout.write(`Error: ${result.run.error}
2053
+ `);
2054
+ });
2055
+ return;
2056
+ }
2057
+ if (action === "download") {
2058
+ const runId = flag("run-id");
2059
+ const out = flag("out");
2060
+ if (!runId || !out) throw new CliInputError("signaliz builds download requires --run-id <uuid> --out results.csv");
2061
+ const result = await client.getManagedBuildRun(runId, 1);
2062
+ const url = result.artifacts?.csv?.download_url;
2063
+ if (!url) throw new CliInputError("This run does not have a CSV artifact yet. Check builds status first.");
2064
+ const response = await fetch(url);
2065
+ if (!response.ok) throw new Error(`CSV download failed (HTTP ${response.status}).`);
2066
+ (0, import_node_fs.writeFileSync)(out, Buffer.from(await response.arrayBuffer()));
2067
+ output({ success: true, run_id: runId, path: out }, () => process.stdout.write(`Saved ${out}
2068
+ `));
2069
+ return;
2070
+ }
2071
+ throw new CliInputError("Usage: signaliz builds list|get|quote|run|status|download");
2072
+ }
1947
2073
  async function main() {
1948
2074
  const [, , command, ...args] = process.argv;
1949
2075
  if (!command || ["help", "--help", "-h"].includes(command)) {
@@ -1967,6 +2093,8 @@ async function main() {
1967
2093
  return awareness(args);
1968
2094
  case "flow":
1969
2095
  return flow();
2096
+ case "builds":
2097
+ return managedBuilds(args);
1970
2098
  case "signal-to-copy":
1971
2099
  return signalToCopy();
1972
2100
  case "health":
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signaliz/cli",
3
- "version": "1.0.82",
4
- "description": "Signaliz CLI for Company Signal Enrichment, Signals First, Signal Awareness, Signal to Copy AI, and Signaliz Flow.",
3
+ "version": "1.0.85",
4
+ "description": "Signaliz CLI for core products, Signal Awareness, Signaliz Flow, and reusable managed builds.",
5
5
  "bin": {
6
6
  "signaliz": "dist/bin.js"
7
7
  },
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "build": "tsup src/bin.ts --format cjs --clean",
14
- "test": "npm run build && node tests/help.test.cjs",
14
+ "test": "npm run build && node tests/help.test.cjs && node tests/managed-builds.test.cjs",
15
15
  "prepublishOnly": "npm run build"
16
16
  },
17
17
  "keywords": [
@@ -29,7 +29,7 @@
29
29
  "node": ">=18"
30
30
  },
31
31
  "dependencies": {
32
- "@signaliz/sdk": "^1.0.83"
32
+ "@signaliz/sdk": "^1.0.89"
33
33
  },
34
34
  "devDependencies": {
35
35
  "tsup": "^8.0.0",