@signaliz/cli 1.0.52 → 1.0.54
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.
- package/README.md +3 -0
- package/dist/bin.js +18 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -74,6 +74,9 @@ JSONL writes one `{ "type": "result", ... }` line per input followed by one
|
|
|
74
74
|
`{ "type": "summary", ... }` line. Input order and cardinality are preserved.
|
|
75
75
|
Failed result lines preserve `errorCode`, `retryEligible`, and
|
|
76
76
|
`retryAfterSeconds` when the API supplies recovery guidance.
|
|
77
|
+
The CLI exits non-zero whenever a single result has `success: false` or a batch
|
|
78
|
+
contains any failed row. Machine output remains complete, so agents can inspect
|
|
79
|
+
successful rows while treating the command as failed.
|
|
77
80
|
|
|
78
81
|
If a single request or batch submission response is lost, rerun the same
|
|
79
82
|
command with `--idempotency-key <key>` to recover the original request, durable
|
package/dist/bin.js
CHANGED
|
@@ -206,6 +206,7 @@ function batchOutput(value) {
|
|
|
206
206
|
durationMs: value.durationMs
|
|
207
207
|
})}
|
|
208
208
|
`);
|
|
209
|
+
if (value.failed > 0) process.exitCode = 1;
|
|
209
210
|
return;
|
|
210
211
|
}
|
|
211
212
|
output(value, () => {
|
|
@@ -213,6 +214,7 @@ function batchOutput(value) {
|
|
|
213
214
|
`);
|
|
214
215
|
if (value.failed > 0) process.stdout.write("Use --json to inspect per-record errors.\n");
|
|
215
216
|
});
|
|
217
|
+
if (value.failed > 0) process.exitCode = 1;
|
|
216
218
|
}
|
|
217
219
|
function dryRunOutput(value) {
|
|
218
220
|
const raw = record(value.raw);
|
|
@@ -382,6 +384,17 @@ function output(value, human) {
|
|
|
382
384
|
`);
|
|
383
385
|
}
|
|
384
386
|
}
|
|
387
|
+
function outputFailedCoreProduct(value, fallbackMessage) {
|
|
388
|
+
const result = record(value);
|
|
389
|
+
if (result.success !== false) return false;
|
|
390
|
+
const raw = record(result.raw);
|
|
391
|
+
const nestedError = record(raw.error);
|
|
392
|
+
const message = stringValue(result.error || nestedError.message || raw.message || raw.error) || fallbackMessage;
|
|
393
|
+
output(value, () => process.stdout.write(`${message}
|
|
394
|
+
`));
|
|
395
|
+
process.exitCode = 1;
|
|
396
|
+
return true;
|
|
397
|
+
}
|
|
385
398
|
function stringifyMachineJson(value, space) {
|
|
386
399
|
const omitRaw = hasFlag("omit-raw");
|
|
387
400
|
return JSON.stringify(value, omitRaw ? (key, item) => key === "raw" ? void 0 : item : void 0, space);
|
|
@@ -500,6 +513,7 @@ async function findEmail() {
|
|
|
500
513
|
}
|
|
501
514
|
const result = await createClient().findEmail(request);
|
|
502
515
|
const publicResult = customerEmailResult(result);
|
|
516
|
+
if (outputFailedCoreProduct(publicResult, "No verified email found")) return;
|
|
503
517
|
output(publicResult, () => {
|
|
504
518
|
process.stdout.write(`${result.email || "No email found"} (${result.verificationStatus})
|
|
505
519
|
`);
|
|
@@ -556,6 +570,7 @@ async function verifyEmail(args) {
|
|
|
556
570
|
}
|
|
557
571
|
const result = await createClient().verifyEmail(email, options);
|
|
558
572
|
const publicResult = customerEmailResult(result);
|
|
573
|
+
if (outputFailedCoreProduct(publicResult, "Email verification failed")) return;
|
|
559
574
|
output(publicResult, () => {
|
|
560
575
|
if (result.status === "processing") {
|
|
561
576
|
process.stdout.write(`Verification processing: ${result.verificationRunId}
|
|
@@ -640,6 +655,7 @@ async function companySignals() {
|
|
|
640
655
|
return;
|
|
641
656
|
}
|
|
642
657
|
const result = customerSignalResult(await createClient().enrichCompanySignals(request));
|
|
658
|
+
if (outputFailedCoreProduct(result, "Company Signal enrichment failed")) return;
|
|
643
659
|
output(result, () => {
|
|
644
660
|
process.stdout.write(`Company: ${result.company.name || result.company.domain}
|
|
645
661
|
Signals: ${result.signalCount}
|
|
@@ -792,9 +808,6 @@ async function signalToCopy() {
|
|
|
792
808
|
const title = flag("title");
|
|
793
809
|
const campaignOffer = flag("campaign-offer") || flag("offer");
|
|
794
810
|
const signalRunId = flag("signal-run-id");
|
|
795
|
-
if (!signalRunId && (!companyDomain || !personName || !title || !campaignOffer)) {
|
|
796
|
-
fail('Usage: signaliz signal-to-copy --company-domain example.com --person-name "Jane Doe" --title "VP Sales" --campaign-offer "pipeline intelligence" OR signaliz signal-to-copy --signal-run-id copy_...');
|
|
797
|
-
}
|
|
798
811
|
const request = {
|
|
799
812
|
companyDomain,
|
|
800
813
|
personName,
|
|
@@ -813,6 +826,7 @@ async function signalToCopy() {
|
|
|
813
826
|
return;
|
|
814
827
|
}
|
|
815
828
|
const result = customerSignalResult(await createClient().signalToCopy(request));
|
|
829
|
+
if (outputFailedCoreProduct(result, "Signal to Copy failed")) return;
|
|
816
830
|
output(result, () => {
|
|
817
831
|
if (result.variations.length === 0) {
|
|
818
832
|
process.stdout.write(`${String(result.raw.message || "Signal research completed without supported evidence.")}
|
|
@@ -912,7 +926,7 @@ main().catch((error) => {
|
|
|
912
926
|
process.stdout.write(`${stringifyMachineJson({
|
|
913
927
|
success: false,
|
|
914
928
|
error: "product_request_failed",
|
|
915
|
-
error_code: signalizError?.code || (error instanceof RangeError ? "INPUT_001" : "CLI_ERROR"),
|
|
929
|
+
error_code: signalizError?.code || (error instanceof RangeError || error instanceof TypeError ? "INPUT_001" : "CLI_ERROR"),
|
|
916
930
|
message,
|
|
917
931
|
retry_eligible: signalizError?.isRetryable ?? false,
|
|
918
932
|
...signalizError?.retryAfter !== void 0 ? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signaliz/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.54",
|
|
4
4
|
"description": "Signaliz CLI for Signals Everything, Find Email, Verify Email, Company Signal Enrichment, and Signal to Copy AI.",
|
|
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.
|
|
32
|
+
"@signaliz/sdk": "^1.0.58"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"tsup": "^8.0.0",
|