@signaliz/cli 1.0.81 → 1.0.84

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 +13 -2
  2. package/dist/bin.js +87 -11
  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 the Signaliz 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"
@@ -68,6 +69,16 @@ signaliz awareness delete --domain acme.com
68
69
  signaliz flow --signal-query "companies with recent hiring" \
69
70
  --campaign-offer "pipeline intelligence"
70
71
  signaliz flow --run-id run_... --json
72
+ # Keep polling the returned run ID until status is completed or failed.
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
71
82
  ```
72
83
 
73
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,10 @@ 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 run --build-id BLD-... [--input request.json] [--idempotency-key <key>]
56
+ signaliz builds status --run-id <uuid> [--limit 100]
53
57
 
54
58
  Access and connection:
55
59
  signaliz auth login
@@ -1619,6 +1623,9 @@ async function flow() {
1619
1623
  if (!signalQuery || !campaignOffer) {
1620
1624
  fail('Usage: signaliz flow --signal-query "companies with recent hiring" --campaign-offer "your offer" [--limit 5]');
1621
1625
  }
1626
+ if (hasFlag("dry-run")) {
1627
+ throw new CliInputError("Signaliz Flow starts immediately; --dry-run is no longer supported.");
1628
+ }
1622
1629
  const removedFlowControls = [
1623
1630
  "after-date",
1624
1631
  "before-date",
@@ -1660,16 +1667,6 @@ async function flow() {
1660
1667
  requireIntegerInRange(request.signalLimit, "limit", 1, 25);
1661
1668
  requireIntegerInRange(request.lookbackDays, "lookbackDays", 1, 365);
1662
1669
  requireIntegerInRange(request.peoplePerCompany, "peoplePerCompany", 1, 5);
1663
- if (hasFlag("dry-run")) {
1664
- const result2 = await createClient().startFlow({ ...request, dryRun: true });
1665
- output(result2, () => {
1666
- process.stdout.write(`Signaliz Flow plan: up to ${result2.plan.maximumReviewCandidates} review candidates. No work was dispatched.
1667
- `);
1668
- for (const safeguard of result2.plan.safeguards) process.stdout.write(`- ${safeguard}
1669
- `);
1670
- });
1671
- return;
1672
- }
1673
1670
  const result = await createClient().startFlow(request);
1674
1671
  output(result, () => process.stdout.write(`Signaliz Flow started: ${result.runId}
1675
1672
  Check status: signaliz flow --run-id ${result.runId}
@@ -1951,6 +1948,83 @@ async function awareness(args) {
1951
1948
  output(result, () => process.stdout.write(`Monitor deleted: ${monitorId || domain}
1952
1949
  `));
1953
1950
  }
1951
+ function readManagedBuildInput() {
1952
+ const source = flag("input");
1953
+ if (!source) return {};
1954
+ let raw;
1955
+ try {
1956
+ raw = source.trim().startsWith("{") ? source.trim() : (0, import_node_fs.readFileSync)(source === "-" ? 0 : source, "utf8").trim();
1957
+ } catch (error) {
1958
+ throw new CliInputError(`Unable to read managed-build input: ${error instanceof Error ? error.message : String(error)}`);
1959
+ }
1960
+ try {
1961
+ const parsed = JSON.parse(raw);
1962
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error("input must be one JSON object");
1963
+ return parsed;
1964
+ } catch (error) {
1965
+ throw new CliInputError(`Managed-build input must be valid JSON: ${error instanceof Error ? error.message : String(error)}`);
1966
+ }
1967
+ }
1968
+ async function managedBuilds(args) {
1969
+ const action = args[0] || "list";
1970
+ const client = createClient();
1971
+ if (action === "list") {
1972
+ const result = await client.listManagedBuilds();
1973
+ output(result, () => {
1974
+ if (!result.builds.length) return process.stdout.write("No Final Build systems are assigned to this workspace.\n");
1975
+ for (const build of result.builds) {
1976
+ process.stdout.write(`${build.build_id} ${build.name} ${build.fixed_credits_per_run} credits/run
1977
+ `);
1978
+ }
1979
+ });
1980
+ return;
1981
+ }
1982
+ if (action === "get") {
1983
+ const buildId = flag("build-id");
1984
+ if (!buildId) throw new CliInputError("signaliz builds get requires --build-id BLD-...");
1985
+ const result = await client.getManagedBuild(buildId);
1986
+ output(result, () => {
1987
+ process.stdout.write(`${result.build.build_id} \u2014 ${result.build.name}
1988
+ `);
1989
+ process.stdout.write(`Fixed price: ${result.build.fixed_credits_per_run} Signaliz credits/run (${result.build.clay_credits_budget_per_run} Clay-credit budget)
1990
+ `);
1991
+ if (result.build.delivery_notes) process.stdout.write(`${result.build.delivery_notes}
1992
+ `);
1993
+ });
1994
+ return;
1995
+ }
1996
+ if (action === "run") {
1997
+ const buildId = flag("build-id");
1998
+ if (!buildId) throw new CliInputError("signaliz builds run requires --build-id BLD-...");
1999
+ const result = await client.runManagedBuild(buildId, readManagedBuildInput(), flag("idempotency-key"));
2000
+ output(result, () => {
2001
+ process.stdout.write(`Managed build queued: ${result.run.run_id}
2002
+ `);
2003
+ process.stdout.write(`Charged: ${result.run.fixed_credits_charged} Signaliz credits (${result.run.billing_status})
2004
+ `);
2005
+ process.stdout.write(`Check results: signaliz builds status --run-id ${result.run.run_id}
2006
+ `);
2007
+ });
2008
+ return;
2009
+ }
2010
+ if (action === "status") {
2011
+ const runId = flag("run-id");
2012
+ if (!runId) throw new CliInputError("signaliz builds status requires --run-id <uuid>");
2013
+ const limit = numberFlag("limit") ?? 100;
2014
+ requireIntegerInRange(limit, "--limit", 1, 500);
2015
+ const result = await client.getManagedBuildRun(runId, limit);
2016
+ output(result, () => {
2017
+ process.stdout.write(`${result.run.build_id} run ${result.run.run_id}: ${result.run.status}
2018
+ `);
2019
+ process.stdout.write(`Results returned: ${result.returned || 0}
2020
+ `);
2021
+ if (result.run.error) process.stdout.write(`Error: ${result.run.error}
2022
+ `);
2023
+ });
2024
+ return;
2025
+ }
2026
+ throw new CliInputError("Usage: signaliz builds list|get|run|status");
2027
+ }
1954
2028
  async function main() {
1955
2029
  const [, , command, ...args] = process.argv;
1956
2030
  if (!command || ["help", "--help", "-h"].includes(command)) {
@@ -1974,6 +2048,8 @@ async function main() {
1974
2048
  return awareness(args);
1975
2049
  case "flow":
1976
2050
  return flow();
2051
+ case "builds":
2052
+ return managedBuilds(args);
1977
2053
  case "signal-to-copy":
1978
2054
  return signalToCopy();
1979
2055
  case "health":
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@signaliz/cli",
3
- "version": "1.0.81",
4
- "description": "Signaliz CLI for Company Signal Enrichment, Signals First, Signal Awareness, Signal to Copy AI, and Signaliz Flow.",
3
+ "version": "1.0.84",
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.88"
33
33
  },
34
34
  "devDependencies": {
35
35
  "tsup": "^8.0.0",