@signaliz/cli 1.0.50 → 1.0.51
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/dist/bin.js +25 -5
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -216,10 +216,16 @@ function normalizeSignalsEverythingResult(request, value) {
|
|
|
216
216
|
source: stringValue(item.source)
|
|
217
217
|
};
|
|
218
218
|
}).filter((item) => Boolean(item.url)) : [];
|
|
219
|
+
const eventDate = stringValue(signal.event_date || signal.date) || evidence[0]?.publishedAt || "";
|
|
220
|
+
const sourceUrl = stringValue(signal.source_url || signal.url) || evidence[0]?.url || null;
|
|
221
|
+
if (!eventDate || !sourceUrl || !evidence.some((item) => Boolean(item.publishedAt))) {
|
|
222
|
+
throw new Error("Signals Everything response violated the dated-evidence and source-URL contract.");
|
|
223
|
+
}
|
|
219
224
|
return {
|
|
220
225
|
company: { name, domain },
|
|
221
226
|
title: stringValue(signal.title || signal.summary || signal.content),
|
|
222
|
-
|
|
227
|
+
eventDate,
|
|
228
|
+
sourceUrl,
|
|
223
229
|
evidence
|
|
224
230
|
};
|
|
225
231
|
});
|
|
@@ -245,6 +251,9 @@ function normalizeSignalsEverythingResult(request, value) {
|
|
|
245
251
|
nextPollAfterSeconds: numberValue(value.next_poll_after_seconds),
|
|
246
252
|
signals: signals2,
|
|
247
253
|
signalCount: signals2.length,
|
|
254
|
+
...numberValue(value.available_company_signal_count) === void 0 ? {} : {
|
|
255
|
+
availableCompanySignalCount: numberValue(value.available_company_signal_count)
|
|
256
|
+
},
|
|
248
257
|
...maxCost === void 0 ? {} : {
|
|
249
258
|
costGuardrail: {
|
|
250
259
|
maxCostPerQualifiedSignalUsd: maxCost,
|
|
@@ -258,6 +267,7 @@ function normalizeSignalsEverythingResult(request, value) {
|
|
|
258
267
|
async function discoverSignalsEverything(request) {
|
|
259
268
|
const body = request.signalSearchRunId ? {
|
|
260
269
|
signal_search_run_id: request.signalSearchRunId,
|
|
270
|
+
...request.limit === void 0 ? {} : { limit: request.limit },
|
|
261
271
|
...request.dryRun === void 0 ? {} : { dry_run: request.dryRun },
|
|
262
272
|
...request.idempotencyKey ? { idempotency_key: request.idempotencyKey } : {}
|
|
263
273
|
} : {
|
|
@@ -617,7 +627,10 @@ async function signals(args) {
|
|
|
617
627
|
const startedAt = Date.now();
|
|
618
628
|
while (signalDiscoveryIsPending(result.status) && result.signalSearchRunId && Date.now() - startedAt < maxWaitMs) {
|
|
619
629
|
await sleep(Math.max(250, pollIntervalMs ?? (result.nextPollAfterSeconds || 5) * 1e3));
|
|
620
|
-
result = await discoverSignalsEverything({
|
|
630
|
+
result = await discoverSignalsEverything({
|
|
631
|
+
signalSearchRunId: result.signalSearchRunId,
|
|
632
|
+
limit: request.limit
|
|
633
|
+
});
|
|
621
634
|
}
|
|
622
635
|
}
|
|
623
636
|
output(result, () => {
|
|
@@ -638,8 +651,15 @@ async function signals(args) {
|
|
|
638
651
|
`);
|
|
639
652
|
return;
|
|
640
653
|
}
|
|
641
|
-
|
|
654
|
+
const available = result.availableCompanySignalCount ?? result.signalCount;
|
|
655
|
+
process.stdout.write(`Qualified companies returned: ${result.signalCount}
|
|
642
656
|
`);
|
|
657
|
+
if (available > result.signalCount) {
|
|
658
|
+
process.stdout.write(
|
|
659
|
+
`Retained cohort: ${available}. Expand without new acquisition: signaliz signals --signal-search-run-id ${result.signalSearchRunId} --limit ${available}
|
|
660
|
+
`
|
|
661
|
+
);
|
|
662
|
+
}
|
|
643
663
|
const guardrail = result.costGuardrail;
|
|
644
664
|
if (guardrail) {
|
|
645
665
|
process.stdout.write(
|
|
@@ -648,8 +668,8 @@ async function signals(args) {
|
|
|
648
668
|
);
|
|
649
669
|
}
|
|
650
670
|
for (const signal of result.signals.slice(0, 20)) {
|
|
651
|
-
process.stdout.write(`- ${signal.company.name} (${signal.company.domain}) \u2014 ${signal.title}
|
|
652
|
-
${signal.sourceUrl
|
|
671
|
+
process.stdout.write(`- ${signal.company.name} (${signal.company.domain}) \u2014 ${signal.eventDate} \u2014 ${signal.title}
|
|
672
|
+
${signal.sourceUrl}
|
|
653
673
|
`);
|
|
654
674
|
}
|
|
655
675
|
if (result.signalCount > 20) process.stdout.write(`Showing 20 of ${result.signalCount}; use --json for the full result.
|
package/package.json
CHANGED