@signaliz/sdk 1.0.52 → 1.0.53
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 -3
- package/dist/{chunk-IFHOCPIP.mjs → chunk-MC7EZ3BP.mjs} +20 -64
- package/dist/index.d.mts +6 -20
- package/dist/index.d.ts +6 -20
- package/dist/index.js +20 -64
- package/dist/index.mjs +1 -1
- package/dist/mcp-config.js +20 -64
- package/dist/mcp-config.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -129,8 +129,8 @@ only when fresh or deeper research is required.
|
|
|
129
129
|
Unclassified evidence is returned by signal enrichment but is not used to
|
|
130
130
|
generate outreach copy.
|
|
131
131
|
Each normalized signal keeps `date` separate from crawl-time `detectedAt` and
|
|
132
|
-
also exposes
|
|
133
|
-
`
|
|
134
|
-
|
|
132
|
+
also exposes customer-facing classification fields such as `datePrecision`,
|
|
133
|
+
`signalFamily`, `eventType`, `eventLabel`, and `classification`. Provider,
|
|
134
|
+
billing, cache, routing, and validation internals are intentionally omitted.
|
|
135
135
|
|
|
136
136
|
`listTools()` and `health()` are connection helpers, not additional products.
|
|
@@ -39,7 +39,11 @@ function publicRetryDetails(body) {
|
|
|
39
39
|
const details = {
|
|
40
40
|
...body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : {},
|
|
41
41
|
...body?.retry_after !== void 0 ? { retry_after: body.retry_after } : {},
|
|
42
|
-
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {}
|
|
42
|
+
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {},
|
|
43
|
+
...body?.run_id !== void 0 ? { run_id: body.run_id } : {},
|
|
44
|
+
...body?.signal_run_id !== void 0 ? { signal_run_id: body.signal_run_id } : {},
|
|
45
|
+
...body?.company_signal_run_id !== void 0 ? { company_signal_run_id: body.company_signal_run_id } : {},
|
|
46
|
+
...body?.resume_context_persisted !== void 0 ? { resume_context_persisted: body.resume_context_persisted } : {}
|
|
43
47
|
};
|
|
44
48
|
return Object.keys(details).length > 0 ? details : void 0;
|
|
45
49
|
}
|
|
@@ -524,10 +528,7 @@ var Signaliz = class {
|
|
|
524
528
|
request: signalToCopyRequestBody(params)
|
|
525
529
|
}));
|
|
526
530
|
const uniqueRequests = deduplicated.uniqueItems;
|
|
527
|
-
const
|
|
528
|
-
(request) => request.skipCache === true || request.enableDeepSearch === true
|
|
529
|
-
);
|
|
530
|
-
const uniqueResults = uniqueRequests.length > 25 && !requiresFreshResearch ? await this.runRecoverableSignalCopyBatch(uniqueRequests, options) : await this.runSignalCopyBatchChunks(uniqueRequests, options);
|
|
531
|
+
const uniqueResults = await this.runSignalCopyBatchChunks(uniqueRequests, options);
|
|
531
532
|
const results = requests.map((_, index) => ({
|
|
532
533
|
...uniqueResults[deduplicated.sourceIndexByInput[index]],
|
|
533
534
|
index
|
|
@@ -558,7 +559,7 @@ var Signaliz = class {
|
|
|
558
559
|
for (let offset = 0; offset < uniqueRequests.length; offset += 25) {
|
|
559
560
|
chunks.push({ offset, requests: uniqueRequests.slice(offset, offset + 25) });
|
|
560
561
|
}
|
|
561
|
-
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
|
|
562
|
+
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options, 25, 25);
|
|
562
563
|
const chunkBatch = await runBatch(
|
|
563
564
|
chunks,
|
|
564
565
|
(chunk) => this.runSignalCopyBatchChunk(chunk.requests, serverConcurrency),
|
|
@@ -653,35 +654,6 @@ var Signaliz = class {
|
|
|
653
654
|
if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
|
|
654
655
|
return rows;
|
|
655
656
|
}
|
|
656
|
-
async runRecoverableSignalCopyBatch(requests, options) {
|
|
657
|
-
const rows = await this.runRecoverableCoreBatchJob(
|
|
658
|
-
"api/v1/signal-to-copy",
|
|
659
|
-
requests.map(signalToCopyRequestBody),
|
|
660
|
-
"Signal to Copy",
|
|
661
|
-
100,
|
|
662
|
-
20 * 6e4,
|
|
663
|
-
options?.idempotencyKey
|
|
664
|
-
);
|
|
665
|
-
const results = new Array(requests.length);
|
|
666
|
-
for (const row of rows) {
|
|
667
|
-
const index = Number(row.index);
|
|
668
|
-
if (recoverableJobRowFailed(row)) {
|
|
669
|
-
results[index] = batchItemFailure(
|
|
670
|
-
index,
|
|
671
|
-
row.error || row._error || row.message || row.failure_reason || "Signal to Copy item failed",
|
|
672
|
-
row
|
|
673
|
-
);
|
|
674
|
-
continue;
|
|
675
|
-
}
|
|
676
|
-
try {
|
|
677
|
-
assertTerminalSignalResponse(row, "Signal to Copy");
|
|
678
|
-
results[index] = { index, success: true, data: normalizeSignalToCopyResult(row) };
|
|
679
|
-
} catch (error) {
|
|
680
|
-
results[index] = batchItemFailure(index, error instanceof Error ? error.message : String(error), row);
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
return results;
|
|
684
|
-
}
|
|
685
657
|
async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
|
|
686
658
|
const results = new Array(requests.length);
|
|
687
659
|
const rateLimited = [];
|
|
@@ -731,12 +703,11 @@ var Signaliz = class {
|
|
|
731
703
|
return results;
|
|
732
704
|
}
|
|
733
705
|
async runCoreBatchRound(path, tasks, options, rowRateLimitAttempt = 0) {
|
|
734
|
-
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
|
|
706
|
+
const { serverConcurrency, chunkConcurrency } = path === "api/v1/company-signals" ? batchConcurrencyPlan(options, 25, 25) : batchConcurrencyPlan(options);
|
|
735
707
|
const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
|
|
736
708
|
const uniqueTasks = deduplicated.uniqueItems;
|
|
737
|
-
const recoverableBatch = path === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } :
|
|
738
|
-
|
|
739
|
-
if (recoverableBatch && uniqueTasks.length > 25 && !containsSignalRunRecovery) {
|
|
709
|
+
const recoverableBatch = path === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : void 0;
|
|
710
|
+
if (path !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
|
|
740
711
|
const rows = await this.runRecoverableCoreBatchJob(
|
|
741
712
|
path,
|
|
742
713
|
uniqueTasks.map((task) => task.request),
|
|
@@ -1001,6 +972,7 @@ function companySignalRequestBody(params) {
|
|
|
1001
972
|
enable_outreach_intelligence: params.enableOutreachIntelligence,
|
|
1002
973
|
enable_predictive_intelligence: params.enablePredictiveIntelligence,
|
|
1003
974
|
skip_cache: params.skipCache,
|
|
975
|
+
include_candidate_evidence: params.includeCandidateEvidence,
|
|
1004
976
|
wait_for_result: true,
|
|
1005
977
|
max_wait_ms: params.maxWaitMs,
|
|
1006
978
|
dry_run: params.dryRun,
|
|
@@ -1018,7 +990,6 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1018
990
|
domain: data.company?.domain ?? params.companyDomain ?? null
|
|
1019
991
|
},
|
|
1020
992
|
signals: rawSignals.map((signal) => {
|
|
1021
|
-
const metadata = signal.metadata && typeof signal.metadata === "object" && !Array.isArray(signal.metadata) ? signal.metadata : void 0;
|
|
1022
993
|
return {
|
|
1023
994
|
id: signal.id,
|
|
1024
995
|
title: signal.title ?? "",
|
|
@@ -1027,40 +998,25 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1027
998
|
date: signal.date ?? null,
|
|
1028
999
|
detectedAt: signal.detected_at ?? null,
|
|
1029
1000
|
datePrecision: signal.date_precision,
|
|
1030
|
-
hasSpecificDate: signal.has_specific_date ?? metadata?.has_specific_date,
|
|
1031
1001
|
sourceUrl: signal.source_url ?? signal.url ?? null,
|
|
1032
1002
|
sourceType: signal.source_type,
|
|
1033
|
-
sourceProvenance: signal.source_provenance,
|
|
1034
1003
|
confidence: signal.confidence ?? signal.confidence_score ?? null,
|
|
1035
|
-
entityConfidence: signal.entity_confidence ?? metadata?.entity_confidence ?? null,
|
|
1036
1004
|
signalFamily: signal.signal_family,
|
|
1037
1005
|
eventType: signal.signal_event_type,
|
|
1038
1006
|
eventLabel: signal.signal_event_label,
|
|
1039
|
-
classification: signal.signal_classification ?? null
|
|
1040
|
-
derived: signal.derived === true,
|
|
1041
|
-
evidencePublishedDate: signal.evidence_published_date ?? metadata?.evidence_published_date ?? null,
|
|
1042
|
-
signalFeedSource: signal.signal_feed_source ?? metadata?.signal_feed_source,
|
|
1043
|
-
metadata
|
|
1007
|
+
classification: signal.signal_classification ?? null
|
|
1044
1008
|
};
|
|
1045
1009
|
}),
|
|
1046
1010
|
signalCount: data.signal_count ?? data.total_signals ?? rawSignals.length,
|
|
1047
1011
|
signalSummary: data.signal_summary ?? null,
|
|
1048
|
-
signalSummarySource: data.signal_summary_source,
|
|
1049
1012
|
intelligence: data.intelligence ?? null,
|
|
1050
1013
|
copyFuel: data.copy_fuel ?? null,
|
|
1051
1014
|
evidenceValidation: data.evidence_validation,
|
|
1052
|
-
evidenceSources: data.evidence_sources,
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
resultReturnedFrom: data.result_returned_from,
|
|
1058
|
-
cacheHit: data.cache_hit,
|
|
1059
|
-
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
1060
|
-
liveProviderCalled: data.live_provider_called,
|
|
1061
|
-
aiProviderCalled: data.ai_provider_called,
|
|
1062
|
-
byoAiUsed: data.byo_ai_used,
|
|
1063
|
-
metadata: data.metadata,
|
|
1015
|
+
evidenceSources: data.metadata?.evidence_sources ?? data.evidence_sources,
|
|
1016
|
+
evidenceCount: data.evidence_count,
|
|
1017
|
+
evidenceCountTotal: data.evidence_count_total,
|
|
1018
|
+
evidenceSourcesOmitted: data.evidence_sources_omitted,
|
|
1019
|
+
evidenceScope: data.evidence_scope,
|
|
1064
1020
|
raw: data
|
|
1065
1021
|
};
|
|
1066
1022
|
}
|
|
@@ -1079,9 +1035,9 @@ function validatedBatchConcurrency(options) {
|
|
|
1079
1035
|
}
|
|
1080
1036
|
return concurrency;
|
|
1081
1037
|
}
|
|
1082
|
-
function batchConcurrencyPlan(options) {
|
|
1083
|
-
const concurrency = validatedBatchConcurrency(options);
|
|
1084
|
-
const serverConcurrency = Math.min(
|
|
1038
|
+
function batchConcurrencyPlan(options, defaultConcurrency = 10, maximumServerConcurrency = 10) {
|
|
1039
|
+
const concurrency = options?.concurrency === void 0 ? defaultConcurrency : validatedBatchConcurrency(options);
|
|
1040
|
+
const serverConcurrency = Math.min(maximumServerConcurrency, concurrency);
|
|
1085
1041
|
return {
|
|
1086
1042
|
serverConcurrency,
|
|
1087
1043
|
chunkConcurrency: Math.max(1, Math.floor(concurrency / serverConcurrency))
|
package/dist/index.d.mts
CHANGED
|
@@ -169,6 +169,8 @@ interface CompanySignalEnrichmentParams {
|
|
|
169
169
|
enableOutreachIntelligence?: boolean;
|
|
170
170
|
enablePredictiveIntelligence?: boolean;
|
|
171
171
|
skipCache?: boolean;
|
|
172
|
+
/** Include all evaluated evidence candidates, including rejected diagnostics. Defaults to selected-signal evidence only. */
|
|
173
|
+
includeCandidateEvidence?: boolean;
|
|
172
174
|
/** @deprecated Company Signals is always synchronous; this option is ignored. */
|
|
173
175
|
waitForResult?: boolean;
|
|
174
176
|
/** Maximum server-side synchronous execution window. */
|
|
@@ -188,20 +190,13 @@ interface CompanySignal {
|
|
|
188
190
|
date?: string | null;
|
|
189
191
|
detectedAt?: string | null;
|
|
190
192
|
datePrecision?: string;
|
|
191
|
-
hasSpecificDate?: boolean;
|
|
192
193
|
sourceUrl?: string | null;
|
|
193
194
|
sourceType?: string;
|
|
194
|
-
sourceProvenance?: string;
|
|
195
195
|
confidence?: number | null;
|
|
196
|
-
entityConfidence?: number | null;
|
|
197
196
|
signalFamily?: string;
|
|
198
197
|
eventType?: string;
|
|
199
198
|
eventLabel?: string;
|
|
200
199
|
classification?: Record<string, unknown> | string | null;
|
|
201
|
-
derived?: boolean;
|
|
202
|
-
evidencePublishedDate?: string | null;
|
|
203
|
-
signalFeedSource?: string;
|
|
204
|
-
metadata?: Record<string, unknown>;
|
|
205
200
|
}
|
|
206
201
|
interface CompanySignalEnrichmentResult {
|
|
207
202
|
success: boolean;
|
|
@@ -214,22 +209,14 @@ interface CompanySignalEnrichmentResult {
|
|
|
214
209
|
signals: CompanySignal[];
|
|
215
210
|
signalCount: number;
|
|
216
211
|
signalSummary: string | null;
|
|
217
|
-
signalSummarySource?: string;
|
|
218
212
|
intelligence?: Record<string, unknown> | null;
|
|
219
213
|
copyFuel?: Record<string, unknown> | null;
|
|
220
214
|
evidenceValidation?: Record<string, unknown>;
|
|
221
215
|
evidenceSources?: Record<string, unknown>[];
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
resultReturnedFrom?: string;
|
|
227
|
-
cacheHit?: boolean;
|
|
228
|
-
freshEnrichmentUsed?: boolean;
|
|
229
|
-
liveProviderCalled?: boolean;
|
|
230
|
-
aiProviderCalled?: boolean;
|
|
231
|
-
byoAiUsed?: boolean;
|
|
232
|
-
metadata?: Record<string, unknown>;
|
|
216
|
+
evidenceCount?: number;
|
|
217
|
+
evidenceCountTotal?: number;
|
|
218
|
+
evidenceSourcesOmitted?: number;
|
|
219
|
+
evidenceScope?: 'selected_signals' | 'all_candidates';
|
|
233
220
|
raw: Record<string, unknown>;
|
|
234
221
|
}
|
|
235
222
|
interface SignalToCopyParams {
|
|
@@ -338,7 +325,6 @@ declare class Signaliz {
|
|
|
338
325
|
private runCoreProductDryRun;
|
|
339
326
|
private runSignalCopyBatchChunks;
|
|
340
327
|
private runRecoverableCoreBatchJob;
|
|
341
|
-
private runRecoverableSignalCopyBatch;
|
|
342
328
|
private runSignalCopyBatchChunk;
|
|
343
329
|
private runCoreBatchRound;
|
|
344
330
|
listTools(): Promise<MCPToolInfo[]>;
|
package/dist/index.d.ts
CHANGED
|
@@ -169,6 +169,8 @@ interface CompanySignalEnrichmentParams {
|
|
|
169
169
|
enableOutreachIntelligence?: boolean;
|
|
170
170
|
enablePredictiveIntelligence?: boolean;
|
|
171
171
|
skipCache?: boolean;
|
|
172
|
+
/** Include all evaluated evidence candidates, including rejected diagnostics. Defaults to selected-signal evidence only. */
|
|
173
|
+
includeCandidateEvidence?: boolean;
|
|
172
174
|
/** @deprecated Company Signals is always synchronous; this option is ignored. */
|
|
173
175
|
waitForResult?: boolean;
|
|
174
176
|
/** Maximum server-side synchronous execution window. */
|
|
@@ -188,20 +190,13 @@ interface CompanySignal {
|
|
|
188
190
|
date?: string | null;
|
|
189
191
|
detectedAt?: string | null;
|
|
190
192
|
datePrecision?: string;
|
|
191
|
-
hasSpecificDate?: boolean;
|
|
192
193
|
sourceUrl?: string | null;
|
|
193
194
|
sourceType?: string;
|
|
194
|
-
sourceProvenance?: string;
|
|
195
195
|
confidence?: number | null;
|
|
196
|
-
entityConfidence?: number | null;
|
|
197
196
|
signalFamily?: string;
|
|
198
197
|
eventType?: string;
|
|
199
198
|
eventLabel?: string;
|
|
200
199
|
classification?: Record<string, unknown> | string | null;
|
|
201
|
-
derived?: boolean;
|
|
202
|
-
evidencePublishedDate?: string | null;
|
|
203
|
-
signalFeedSource?: string;
|
|
204
|
-
metadata?: Record<string, unknown>;
|
|
205
200
|
}
|
|
206
201
|
interface CompanySignalEnrichmentResult {
|
|
207
202
|
success: boolean;
|
|
@@ -214,22 +209,14 @@ interface CompanySignalEnrichmentResult {
|
|
|
214
209
|
signals: CompanySignal[];
|
|
215
210
|
signalCount: number;
|
|
216
211
|
signalSummary: string | null;
|
|
217
|
-
signalSummarySource?: string;
|
|
218
212
|
intelligence?: Record<string, unknown> | null;
|
|
219
213
|
copyFuel?: Record<string, unknown> | null;
|
|
220
214
|
evidenceValidation?: Record<string, unknown>;
|
|
221
215
|
evidenceSources?: Record<string, unknown>[];
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
resultReturnedFrom?: string;
|
|
227
|
-
cacheHit?: boolean;
|
|
228
|
-
freshEnrichmentUsed?: boolean;
|
|
229
|
-
liveProviderCalled?: boolean;
|
|
230
|
-
aiProviderCalled?: boolean;
|
|
231
|
-
byoAiUsed?: boolean;
|
|
232
|
-
metadata?: Record<string, unknown>;
|
|
216
|
+
evidenceCount?: number;
|
|
217
|
+
evidenceCountTotal?: number;
|
|
218
|
+
evidenceSourcesOmitted?: number;
|
|
219
|
+
evidenceScope?: 'selected_signals' | 'all_candidates';
|
|
233
220
|
raw: Record<string, unknown>;
|
|
234
221
|
}
|
|
235
222
|
interface SignalToCopyParams {
|
|
@@ -338,7 +325,6 @@ declare class Signaliz {
|
|
|
338
325
|
private runCoreProductDryRun;
|
|
339
326
|
private runSignalCopyBatchChunks;
|
|
340
327
|
private runRecoverableCoreBatchJob;
|
|
341
|
-
private runRecoverableSignalCopyBatch;
|
|
342
328
|
private runSignalCopyBatchChunk;
|
|
343
329
|
private runCoreBatchRound;
|
|
344
330
|
listTools(): Promise<MCPToolInfo[]>;
|
package/dist/index.js
CHANGED
|
@@ -66,7 +66,11 @@ function publicRetryDetails(body) {
|
|
|
66
66
|
const details = {
|
|
67
67
|
...body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : {},
|
|
68
68
|
...body?.retry_after !== void 0 ? { retry_after: body.retry_after } : {},
|
|
69
|
-
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {}
|
|
69
|
+
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {},
|
|
70
|
+
...body?.run_id !== void 0 ? { run_id: body.run_id } : {},
|
|
71
|
+
...body?.signal_run_id !== void 0 ? { signal_run_id: body.signal_run_id } : {},
|
|
72
|
+
...body?.company_signal_run_id !== void 0 ? { company_signal_run_id: body.company_signal_run_id } : {},
|
|
73
|
+
...body?.resume_context_persisted !== void 0 ? { resume_context_persisted: body.resume_context_persisted } : {}
|
|
70
74
|
};
|
|
71
75
|
return Object.keys(details).length > 0 ? details : void 0;
|
|
72
76
|
}
|
|
@@ -551,10 +555,7 @@ var Signaliz = class {
|
|
|
551
555
|
request: signalToCopyRequestBody(params)
|
|
552
556
|
}));
|
|
553
557
|
const uniqueRequests = deduplicated.uniqueItems;
|
|
554
|
-
const
|
|
555
|
-
(request) => request.skipCache === true || request.enableDeepSearch === true
|
|
556
|
-
);
|
|
557
|
-
const uniqueResults = uniqueRequests.length > 25 && !requiresFreshResearch ? await this.runRecoverableSignalCopyBatch(uniqueRequests, options) : await this.runSignalCopyBatchChunks(uniqueRequests, options);
|
|
558
|
+
const uniqueResults = await this.runSignalCopyBatchChunks(uniqueRequests, options);
|
|
558
559
|
const results = requests.map((_, index) => ({
|
|
559
560
|
...uniqueResults[deduplicated.sourceIndexByInput[index]],
|
|
560
561
|
index
|
|
@@ -585,7 +586,7 @@ var Signaliz = class {
|
|
|
585
586
|
for (let offset = 0; offset < uniqueRequests.length; offset += 25) {
|
|
586
587
|
chunks.push({ offset, requests: uniqueRequests.slice(offset, offset + 25) });
|
|
587
588
|
}
|
|
588
|
-
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
|
|
589
|
+
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options, 25, 25);
|
|
589
590
|
const chunkBatch = await runBatch(
|
|
590
591
|
chunks,
|
|
591
592
|
(chunk) => this.runSignalCopyBatchChunk(chunk.requests, serverConcurrency),
|
|
@@ -680,35 +681,6 @@ var Signaliz = class {
|
|
|
680
681
|
if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
|
|
681
682
|
return rows;
|
|
682
683
|
}
|
|
683
|
-
async runRecoverableSignalCopyBatch(requests, options) {
|
|
684
|
-
const rows = await this.runRecoverableCoreBatchJob(
|
|
685
|
-
"api/v1/signal-to-copy",
|
|
686
|
-
requests.map(signalToCopyRequestBody),
|
|
687
|
-
"Signal to Copy",
|
|
688
|
-
100,
|
|
689
|
-
20 * 6e4,
|
|
690
|
-
options?.idempotencyKey
|
|
691
|
-
);
|
|
692
|
-
const results = new Array(requests.length);
|
|
693
|
-
for (const row of rows) {
|
|
694
|
-
const index = Number(row.index);
|
|
695
|
-
if (recoverableJobRowFailed(row)) {
|
|
696
|
-
results[index] = batchItemFailure(
|
|
697
|
-
index,
|
|
698
|
-
row.error || row._error || row.message || row.failure_reason || "Signal to Copy item failed",
|
|
699
|
-
row
|
|
700
|
-
);
|
|
701
|
-
continue;
|
|
702
|
-
}
|
|
703
|
-
try {
|
|
704
|
-
assertTerminalSignalResponse(row, "Signal to Copy");
|
|
705
|
-
results[index] = { index, success: true, data: normalizeSignalToCopyResult(row) };
|
|
706
|
-
} catch (error) {
|
|
707
|
-
results[index] = batchItemFailure(index, error instanceof Error ? error.message : String(error), row);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
return results;
|
|
711
|
-
}
|
|
712
684
|
async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
|
|
713
685
|
const results = new Array(requests.length);
|
|
714
686
|
const rateLimited = [];
|
|
@@ -758,12 +730,11 @@ var Signaliz = class {
|
|
|
758
730
|
return results;
|
|
759
731
|
}
|
|
760
732
|
async runCoreBatchRound(path, tasks, options, rowRateLimitAttempt = 0) {
|
|
761
|
-
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
|
|
733
|
+
const { serverConcurrency, chunkConcurrency } = path === "api/v1/company-signals" ? batchConcurrencyPlan(options, 25, 25) : batchConcurrencyPlan(options);
|
|
762
734
|
const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
|
|
763
735
|
const uniqueTasks = deduplicated.uniqueItems;
|
|
764
|
-
const recoverableBatch = path === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } :
|
|
765
|
-
|
|
766
|
-
if (recoverableBatch && uniqueTasks.length > 25 && !containsSignalRunRecovery) {
|
|
736
|
+
const recoverableBatch = path === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : void 0;
|
|
737
|
+
if (path !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
|
|
767
738
|
const rows = await this.runRecoverableCoreBatchJob(
|
|
768
739
|
path,
|
|
769
740
|
uniqueTasks.map((task) => task.request),
|
|
@@ -1028,6 +999,7 @@ function companySignalRequestBody(params) {
|
|
|
1028
999
|
enable_outreach_intelligence: params.enableOutreachIntelligence,
|
|
1029
1000
|
enable_predictive_intelligence: params.enablePredictiveIntelligence,
|
|
1030
1001
|
skip_cache: params.skipCache,
|
|
1002
|
+
include_candidate_evidence: params.includeCandidateEvidence,
|
|
1031
1003
|
wait_for_result: true,
|
|
1032
1004
|
max_wait_ms: params.maxWaitMs,
|
|
1033
1005
|
dry_run: params.dryRun,
|
|
@@ -1045,7 +1017,6 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1045
1017
|
domain: data.company?.domain ?? params.companyDomain ?? null
|
|
1046
1018
|
},
|
|
1047
1019
|
signals: rawSignals.map((signal) => {
|
|
1048
|
-
const metadata = signal.metadata && typeof signal.metadata === "object" && !Array.isArray(signal.metadata) ? signal.metadata : void 0;
|
|
1049
1020
|
return {
|
|
1050
1021
|
id: signal.id,
|
|
1051
1022
|
title: signal.title ?? "",
|
|
@@ -1054,40 +1025,25 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1054
1025
|
date: signal.date ?? null,
|
|
1055
1026
|
detectedAt: signal.detected_at ?? null,
|
|
1056
1027
|
datePrecision: signal.date_precision,
|
|
1057
|
-
hasSpecificDate: signal.has_specific_date ?? metadata?.has_specific_date,
|
|
1058
1028
|
sourceUrl: signal.source_url ?? signal.url ?? null,
|
|
1059
1029
|
sourceType: signal.source_type,
|
|
1060
|
-
sourceProvenance: signal.source_provenance,
|
|
1061
1030
|
confidence: signal.confidence ?? signal.confidence_score ?? null,
|
|
1062
|
-
entityConfidence: signal.entity_confidence ?? metadata?.entity_confidence ?? null,
|
|
1063
1031
|
signalFamily: signal.signal_family,
|
|
1064
1032
|
eventType: signal.signal_event_type,
|
|
1065
1033
|
eventLabel: signal.signal_event_label,
|
|
1066
|
-
classification: signal.signal_classification ?? null
|
|
1067
|
-
derived: signal.derived === true,
|
|
1068
|
-
evidencePublishedDate: signal.evidence_published_date ?? metadata?.evidence_published_date ?? null,
|
|
1069
|
-
signalFeedSource: signal.signal_feed_source ?? metadata?.signal_feed_source,
|
|
1070
|
-
metadata
|
|
1034
|
+
classification: signal.signal_classification ?? null
|
|
1071
1035
|
};
|
|
1072
1036
|
}),
|
|
1073
1037
|
signalCount: data.signal_count ?? data.total_signals ?? rawSignals.length,
|
|
1074
1038
|
signalSummary: data.signal_summary ?? null,
|
|
1075
|
-
signalSummarySource: data.signal_summary_source,
|
|
1076
1039
|
intelligence: data.intelligence ?? null,
|
|
1077
1040
|
copyFuel: data.copy_fuel ?? null,
|
|
1078
1041
|
evidenceValidation: data.evidence_validation,
|
|
1079
|
-
evidenceSources: data.evidence_sources,
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
resultReturnedFrom: data.result_returned_from,
|
|
1085
|
-
cacheHit: data.cache_hit,
|
|
1086
|
-
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
1087
|
-
liveProviderCalled: data.live_provider_called,
|
|
1088
|
-
aiProviderCalled: data.ai_provider_called,
|
|
1089
|
-
byoAiUsed: data.byo_ai_used,
|
|
1090
|
-
metadata: data.metadata,
|
|
1042
|
+
evidenceSources: data.metadata?.evidence_sources ?? data.evidence_sources,
|
|
1043
|
+
evidenceCount: data.evidence_count,
|
|
1044
|
+
evidenceCountTotal: data.evidence_count_total,
|
|
1045
|
+
evidenceSourcesOmitted: data.evidence_sources_omitted,
|
|
1046
|
+
evidenceScope: data.evidence_scope,
|
|
1091
1047
|
raw: data
|
|
1092
1048
|
};
|
|
1093
1049
|
}
|
|
@@ -1106,9 +1062,9 @@ function validatedBatchConcurrency(options) {
|
|
|
1106
1062
|
}
|
|
1107
1063
|
return concurrency;
|
|
1108
1064
|
}
|
|
1109
|
-
function batchConcurrencyPlan(options) {
|
|
1110
|
-
const concurrency = validatedBatchConcurrency(options);
|
|
1111
|
-
const serverConcurrency = Math.min(
|
|
1065
|
+
function batchConcurrencyPlan(options, defaultConcurrency = 10, maximumServerConcurrency = 10) {
|
|
1066
|
+
const concurrency = options?.concurrency === void 0 ? defaultConcurrency : validatedBatchConcurrency(options);
|
|
1067
|
+
const serverConcurrency = Math.min(maximumServerConcurrency, concurrency);
|
|
1112
1068
|
return {
|
|
1113
1069
|
serverConcurrency,
|
|
1114
1070
|
chunkConcurrency: Math.max(1, Math.floor(concurrency / serverConcurrency))
|
package/dist/index.mjs
CHANGED
package/dist/mcp-config.js
CHANGED
|
@@ -70,7 +70,11 @@ function publicRetryDetails(body) {
|
|
|
70
70
|
const details = {
|
|
71
71
|
...body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : {},
|
|
72
72
|
...body?.retry_after !== void 0 ? { retry_after: body.retry_after } : {},
|
|
73
|
-
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {}
|
|
73
|
+
...body?.retry_after_seconds !== void 0 ? { retry_after_seconds: body.retry_after_seconds } : {},
|
|
74
|
+
...body?.run_id !== void 0 ? { run_id: body.run_id } : {},
|
|
75
|
+
...body?.signal_run_id !== void 0 ? { signal_run_id: body.signal_run_id } : {},
|
|
76
|
+
...body?.company_signal_run_id !== void 0 ? { company_signal_run_id: body.company_signal_run_id } : {},
|
|
77
|
+
...body?.resume_context_persisted !== void 0 ? { resume_context_persisted: body.resume_context_persisted } : {}
|
|
74
78
|
};
|
|
75
79
|
return Object.keys(details).length > 0 ? details : void 0;
|
|
76
80
|
}
|
|
@@ -555,10 +559,7 @@ var Signaliz = class {
|
|
|
555
559
|
request: signalToCopyRequestBody(params)
|
|
556
560
|
}));
|
|
557
561
|
const uniqueRequests = deduplicated.uniqueItems;
|
|
558
|
-
const
|
|
559
|
-
(request) => request.skipCache === true || request.enableDeepSearch === true
|
|
560
|
-
);
|
|
561
|
-
const uniqueResults = uniqueRequests.length > 25 && !requiresFreshResearch ? await this.runRecoverableSignalCopyBatch(uniqueRequests, options) : await this.runSignalCopyBatchChunks(uniqueRequests, options);
|
|
562
|
+
const uniqueResults = await this.runSignalCopyBatchChunks(uniqueRequests, options);
|
|
562
563
|
const results = requests.map((_, index) => ({
|
|
563
564
|
...uniqueResults[deduplicated.sourceIndexByInput[index]],
|
|
564
565
|
index
|
|
@@ -589,7 +590,7 @@ var Signaliz = class {
|
|
|
589
590
|
for (let offset = 0; offset < uniqueRequests.length; offset += 25) {
|
|
590
591
|
chunks.push({ offset, requests: uniqueRequests.slice(offset, offset + 25) });
|
|
591
592
|
}
|
|
592
|
-
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
|
|
593
|
+
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options, 25, 25);
|
|
593
594
|
const chunkBatch = await runBatch(
|
|
594
595
|
chunks,
|
|
595
596
|
(chunk) => this.runSignalCopyBatchChunk(chunk.requests, serverConcurrency),
|
|
@@ -684,35 +685,6 @@ var Signaliz = class {
|
|
|
684
685
|
if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
|
|
685
686
|
return rows;
|
|
686
687
|
}
|
|
687
|
-
async runRecoverableSignalCopyBatch(requests, options) {
|
|
688
|
-
const rows = await this.runRecoverableCoreBatchJob(
|
|
689
|
-
"api/v1/signal-to-copy",
|
|
690
|
-
requests.map(signalToCopyRequestBody),
|
|
691
|
-
"Signal to Copy",
|
|
692
|
-
100,
|
|
693
|
-
20 * 6e4,
|
|
694
|
-
options?.idempotencyKey
|
|
695
|
-
);
|
|
696
|
-
const results = new Array(requests.length);
|
|
697
|
-
for (const row of rows) {
|
|
698
|
-
const index = Number(row.index);
|
|
699
|
-
if (recoverableJobRowFailed(row)) {
|
|
700
|
-
results[index] = batchItemFailure(
|
|
701
|
-
index,
|
|
702
|
-
row.error || row._error || row.message || row.failure_reason || "Signal to Copy item failed",
|
|
703
|
-
row
|
|
704
|
-
);
|
|
705
|
-
continue;
|
|
706
|
-
}
|
|
707
|
-
try {
|
|
708
|
-
assertTerminalSignalResponse(row, "Signal to Copy");
|
|
709
|
-
results[index] = { index, success: true, data: normalizeSignalToCopyResult(row) };
|
|
710
|
-
} catch (error) {
|
|
711
|
-
results[index] = batchItemFailure(index, error instanceof Error ? error.message : String(error), row);
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
return results;
|
|
715
|
-
}
|
|
716
688
|
async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
|
|
717
689
|
const results = new Array(requests.length);
|
|
718
690
|
const rateLimited = [];
|
|
@@ -762,12 +734,11 @@ var Signaliz = class {
|
|
|
762
734
|
return results;
|
|
763
735
|
}
|
|
764
736
|
async runCoreBatchRound(path2, tasks, options, rowRateLimitAttempt = 0) {
|
|
765
|
-
const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
|
|
737
|
+
const { serverConcurrency, chunkConcurrency } = path2 === "api/v1/company-signals" ? batchConcurrencyPlan(options, 25, 25) : batchConcurrencyPlan(options);
|
|
766
738
|
const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
|
|
767
739
|
const uniqueTasks = deduplicated.uniqueItems;
|
|
768
|
-
const recoverableBatch = path2 === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path2 === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } :
|
|
769
|
-
|
|
770
|
-
if (recoverableBatch && uniqueTasks.length > 25 && !containsSignalRunRecovery) {
|
|
740
|
+
const recoverableBatch = path2 === "api/v1/find-email" ? { label: "Find Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : path2 === "api/v1/verify-email" ? { label: "Verify Email", pageSize: 500, maxWaitMs: 20 * 6e4 } : void 0;
|
|
741
|
+
if (path2 !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
|
|
771
742
|
const rows = await this.runRecoverableCoreBatchJob(
|
|
772
743
|
path2,
|
|
773
744
|
uniqueTasks.map((task) => task.request),
|
|
@@ -1032,6 +1003,7 @@ function companySignalRequestBody(params) {
|
|
|
1032
1003
|
enable_outreach_intelligence: params.enableOutreachIntelligence,
|
|
1033
1004
|
enable_predictive_intelligence: params.enablePredictiveIntelligence,
|
|
1034
1005
|
skip_cache: params.skipCache,
|
|
1006
|
+
include_candidate_evidence: params.includeCandidateEvidence,
|
|
1035
1007
|
wait_for_result: true,
|
|
1036
1008
|
max_wait_ms: params.maxWaitMs,
|
|
1037
1009
|
dry_run: params.dryRun,
|
|
@@ -1049,7 +1021,6 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1049
1021
|
domain: data.company?.domain ?? params.companyDomain ?? null
|
|
1050
1022
|
},
|
|
1051
1023
|
signals: rawSignals.map((signal) => {
|
|
1052
|
-
const metadata = signal.metadata && typeof signal.metadata === "object" && !Array.isArray(signal.metadata) ? signal.metadata : void 0;
|
|
1053
1024
|
return {
|
|
1054
1025
|
id: signal.id,
|
|
1055
1026
|
title: signal.title ?? "",
|
|
@@ -1058,40 +1029,25 @@ function normalizeCompanySignalResult(params, data) {
|
|
|
1058
1029
|
date: signal.date ?? null,
|
|
1059
1030
|
detectedAt: signal.detected_at ?? null,
|
|
1060
1031
|
datePrecision: signal.date_precision,
|
|
1061
|
-
hasSpecificDate: signal.has_specific_date ?? metadata?.has_specific_date,
|
|
1062
1032
|
sourceUrl: signal.source_url ?? signal.url ?? null,
|
|
1063
1033
|
sourceType: signal.source_type,
|
|
1064
|
-
sourceProvenance: signal.source_provenance,
|
|
1065
1034
|
confidence: signal.confidence ?? signal.confidence_score ?? null,
|
|
1066
|
-
entityConfidence: signal.entity_confidence ?? metadata?.entity_confidence ?? null,
|
|
1067
1035
|
signalFamily: signal.signal_family,
|
|
1068
1036
|
eventType: signal.signal_event_type,
|
|
1069
1037
|
eventLabel: signal.signal_event_label,
|
|
1070
|
-
classification: signal.signal_classification ?? null
|
|
1071
|
-
derived: signal.derived === true,
|
|
1072
|
-
evidencePublishedDate: signal.evidence_published_date ?? metadata?.evidence_published_date ?? null,
|
|
1073
|
-
signalFeedSource: signal.signal_feed_source ?? metadata?.signal_feed_source,
|
|
1074
|
-
metadata
|
|
1038
|
+
classification: signal.signal_classification ?? null
|
|
1075
1039
|
};
|
|
1076
1040
|
}),
|
|
1077
1041
|
signalCount: data.signal_count ?? data.total_signals ?? rawSignals.length,
|
|
1078
1042
|
signalSummary: data.signal_summary ?? null,
|
|
1079
|
-
signalSummarySource: data.signal_summary_source,
|
|
1080
1043
|
intelligence: data.intelligence ?? null,
|
|
1081
1044
|
copyFuel: data.copy_fuel ?? null,
|
|
1082
1045
|
evidenceValidation: data.evidence_validation,
|
|
1083
|
-
evidenceSources: data.evidence_sources,
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
resultReturnedFrom: data.result_returned_from,
|
|
1089
|
-
cacheHit: data.cache_hit,
|
|
1090
|
-
freshEnrichmentUsed: data.fresh_enrichment_used,
|
|
1091
|
-
liveProviderCalled: data.live_provider_called,
|
|
1092
|
-
aiProviderCalled: data.ai_provider_called,
|
|
1093
|
-
byoAiUsed: data.byo_ai_used,
|
|
1094
|
-
metadata: data.metadata,
|
|
1046
|
+
evidenceSources: data.metadata?.evidence_sources ?? data.evidence_sources,
|
|
1047
|
+
evidenceCount: data.evidence_count,
|
|
1048
|
+
evidenceCountTotal: data.evidence_count_total,
|
|
1049
|
+
evidenceSourcesOmitted: data.evidence_sources_omitted,
|
|
1050
|
+
evidenceScope: data.evidence_scope,
|
|
1095
1051
|
raw: data
|
|
1096
1052
|
};
|
|
1097
1053
|
}
|
|
@@ -1110,9 +1066,9 @@ function validatedBatchConcurrency(options) {
|
|
|
1110
1066
|
}
|
|
1111
1067
|
return concurrency;
|
|
1112
1068
|
}
|
|
1113
|
-
function batchConcurrencyPlan(options) {
|
|
1114
|
-
const concurrency = validatedBatchConcurrency(options);
|
|
1115
|
-
const serverConcurrency = Math.min(
|
|
1069
|
+
function batchConcurrencyPlan(options, defaultConcurrency = 10, maximumServerConcurrency = 10) {
|
|
1070
|
+
const concurrency = options?.concurrency === void 0 ? defaultConcurrency : validatedBatchConcurrency(options);
|
|
1071
|
+
const serverConcurrency = Math.min(maximumServerConcurrency, concurrency);
|
|
1116
1072
|
return {
|
|
1117
1073
|
serverConcurrency,
|
|
1118
1074
|
chunkConcurrency: Math.max(1, Math.floor(concurrency / serverConcurrency))
|
package/dist/mcp-config.mjs
CHANGED
package/package.json
CHANGED