@signaliz/sdk 1.0.49 → 1.0.50

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 CHANGED
@@ -97,21 +97,22 @@ when the REST API supplies them, including after automatic row retries are
97
97
  exhausted.
98
98
 
99
99
  For an ambiguous single request or batch submission failure, retry with the
100
- same `idempotencyKey` to recover the original request or supported email job without duplicate
100
+ same `idempotencyKey` to recover the original request or durable job without duplicate
101
101
  work.
102
102
 
103
- Each batch accepts up to 5,000 items. For Company Signals and Signal to Copy,
104
- the SDK chunks inputs into synchronous requests of at most 25 and waits for
105
- every chunk. It never returns queued work, job IDs, or polling instructions.
103
+ Each batch accepts up to 5,000 items. For all four core products, batches larger
104
+ than 25 use one recoverable REST job; the SDK waits for completion and retrieves
105
+ every result page before returning, so callers never receive queued work or
106
+ polling instructions. Find Email, Verify Email, and Signal to Copy use 500-row
107
+ result pages, while Company Signals uses 25-row result pages.
106
108
  Exact duplicate tasks are single-flighted across each full batch without
107
109
  changing input order or result cardinality. Set `compactDuplicates: true` to
108
110
  return repeated successful rows as `duplicateOf` references to the zero-based
109
- canonical input index; the default remains expanded for compatibility. Find Email and Verify Email
110
- batches
111
- larger than 25 use one cache-aware recoverable REST job with 500-row result
112
- pages. Company Signal Enrichment and Signal to Copy always use client-side
113
- 25-row chunks with terminal per-row results. Signal to Copy also shares company
114
- research across copy recipients.
111
+ canonical input index; the default remains expanded for compatibility. Signal
112
+ to Copy durable jobs use available company-signal data only. If any copy row
113
+ explicitly requests `skipCache` or `enableDeepSearch`, the SDK preserves that
114
+ fresh-research behavior by using synchronous client-side chunks of at most 25.
115
+ Signal to Copy also shares company research across copy recipients.
115
116
 
116
117
  Company Signal Enrichment defaults `online` and `enableDeepSearch` to `true`
117
118
  unless the caller explicitly disables them. Its `searchMode` defaults to
@@ -524,7 +524,10 @@ var Signaliz = class {
524
524
  request: signalToCopyRequestBody(params)
525
525
  }));
526
526
  const uniqueRequests = deduplicated.uniqueItems;
527
- const uniqueResults = await this.runSignalCopyBatchChunks(uniqueRequests, options);
527
+ const requiresFreshResearch = uniqueRequests.some(
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);
528
531
  const results = requests.map((_, index) => ({
529
532
  ...uniqueResults[deduplicated.sourceIndexByInput[index]],
530
533
  index
@@ -650,6 +653,35 @@ var Signaliz = class {
650
653
  if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
651
654
  return rows;
652
655
  }
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
+ 500,
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
+ }
653
685
  async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
654
686
  const results = new Array(requests.length);
655
687
  const rateLimited = [];
@@ -702,8 +734,8 @@ var Signaliz = class {
702
734
  const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
703
735
  const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
704
736
  const uniqueTasks = deduplicated.uniqueItems;
705
- 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;
706
- if (path !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
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 } : path === "api/v1/company-signals" ? { label: "Company Signals", pageSize: 25, maxWaitMs: 20 * 6e4 } : void 0;
738
+ if (recoverableBatch && uniqueTasks.length > 25) {
707
739
  const rows = await this.runRecoverableCoreBatchJob(
708
740
  path,
709
741
  uniqueTasks.map((task) => task.request),
@@ -712,12 +744,16 @@ var Signaliz = class {
712
744
  recoverableBatch.maxWaitMs,
713
745
  options?.idempotencyKey
714
746
  );
715
- const uniqueResults2 = rows.map((raw) => ({
716
- index: uniqueTasks[Number(raw.index)].index,
717
- success: !recoverableJobRowFailed(raw),
718
- raw,
719
- error: recoverableJobRowFailed(raw) ? raw.error || raw._error || raw.message || raw.failure_reason || `${recoverableBatch.label} item failed` : void 0
720
- }));
747
+ const uniqueResults2 = new Array(uniqueTasks.length);
748
+ for (const raw of rows) {
749
+ const index = Number(raw.index);
750
+ uniqueResults2[index] = {
751
+ index: uniqueTasks[index].index,
752
+ success: !recoverableJobRowFailed(raw),
753
+ raw,
754
+ error: recoverableJobRowFailed(raw) ? raw.error || raw._error || raw.message || raw.failure_reason || `${recoverableBatch.label} item failed` : void 0
755
+ };
756
+ }
721
757
  return tasks.map((task, index) => ({
722
758
  ...uniqueResults2[deduplicated.sourceIndexByInput[index]],
723
759
  index: task.index
package/dist/index.d.mts CHANGED
@@ -338,6 +338,7 @@ declare class Signaliz {
338
338
  private runCoreProductDryRun;
339
339
  private runSignalCopyBatchChunks;
340
340
  private runRecoverableCoreBatchJob;
341
+ private runRecoverableSignalCopyBatch;
341
342
  private runSignalCopyBatchChunk;
342
343
  private runCoreBatchRound;
343
344
  listTools(): Promise<MCPToolInfo[]>;
package/dist/index.d.ts CHANGED
@@ -338,6 +338,7 @@ declare class Signaliz {
338
338
  private runCoreProductDryRun;
339
339
  private runSignalCopyBatchChunks;
340
340
  private runRecoverableCoreBatchJob;
341
+ private runRecoverableSignalCopyBatch;
341
342
  private runSignalCopyBatchChunk;
342
343
  private runCoreBatchRound;
343
344
  listTools(): Promise<MCPToolInfo[]>;
package/dist/index.js CHANGED
@@ -551,7 +551,10 @@ var Signaliz = class {
551
551
  request: signalToCopyRequestBody(params)
552
552
  }));
553
553
  const uniqueRequests = deduplicated.uniqueItems;
554
- const uniqueResults = await this.runSignalCopyBatchChunks(uniqueRequests, options);
554
+ const requiresFreshResearch = uniqueRequests.some(
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);
555
558
  const results = requests.map((_, index) => ({
556
559
  ...uniqueResults[deduplicated.sourceIndexByInput[index]],
557
560
  index
@@ -677,6 +680,35 @@ var Signaliz = class {
677
680
  if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
678
681
  return rows;
679
682
  }
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
+ 500,
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
+ }
680
712
  async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
681
713
  const results = new Array(requests.length);
682
714
  const rateLimited = [];
@@ -729,8 +761,8 @@ var Signaliz = class {
729
761
  const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
730
762
  const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
731
763
  const uniqueTasks = deduplicated.uniqueItems;
732
- 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;
733
- if (path !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
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 } : path === "api/v1/company-signals" ? { label: "Company Signals", pageSize: 25, maxWaitMs: 20 * 6e4 } : void 0;
765
+ if (recoverableBatch && uniqueTasks.length > 25) {
734
766
  const rows = await this.runRecoverableCoreBatchJob(
735
767
  path,
736
768
  uniqueTasks.map((task) => task.request),
@@ -739,12 +771,16 @@ var Signaliz = class {
739
771
  recoverableBatch.maxWaitMs,
740
772
  options?.idempotencyKey
741
773
  );
742
- const uniqueResults2 = rows.map((raw) => ({
743
- index: uniqueTasks[Number(raw.index)].index,
744
- success: !recoverableJobRowFailed(raw),
745
- raw,
746
- error: recoverableJobRowFailed(raw) ? raw.error || raw._error || raw.message || raw.failure_reason || `${recoverableBatch.label} item failed` : void 0
747
- }));
774
+ const uniqueResults2 = new Array(uniqueTasks.length);
775
+ for (const raw of rows) {
776
+ const index = Number(raw.index);
777
+ uniqueResults2[index] = {
778
+ index: uniqueTasks[index].index,
779
+ success: !recoverableJobRowFailed(raw),
780
+ raw,
781
+ error: recoverableJobRowFailed(raw) ? raw.error || raw._error || raw.message || raw.failure_reason || `${recoverableBatch.label} item failed` : void 0
782
+ };
783
+ }
748
784
  return tasks.map((task, index) => ({
749
785
  ...uniqueResults2[deduplicated.sourceIndexByInput[index]],
750
786
  index: task.index
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Signaliz,
3
3
  SignalizError
4
- } from "./chunk-KA66GBVZ.mjs";
4
+ } from "./chunk-BFMRS2FT.mjs";
5
5
  export {
6
6
  Signaliz,
7
7
  SignalizError
@@ -555,7 +555,10 @@ var Signaliz = class {
555
555
  request: signalToCopyRequestBody(params)
556
556
  }));
557
557
  const uniqueRequests = deduplicated.uniqueItems;
558
- const uniqueResults = await this.runSignalCopyBatchChunks(uniqueRequests, options);
558
+ const requiresFreshResearch = uniqueRequests.some(
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);
559
562
  const results = requests.map((_, index) => ({
560
563
  ...uniqueResults[deduplicated.sourceIndexByInput[index]],
561
564
  index
@@ -681,6 +684,35 @@ var Signaliz = class {
681
684
  if (seen.size !== requests.length) throw new Error(`${label} batch returned incomplete indexed results`);
682
685
  return rows;
683
686
  }
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
+ 500,
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
+ }
684
716
  async runSignalCopyBatchChunk(requests, concurrency, rowRateLimitAttempt = 0) {
685
717
  const results = new Array(requests.length);
686
718
  const rateLimited = [];
@@ -733,8 +765,8 @@ var Signaliz = class {
733
765
  const { serverConcurrency, chunkConcurrency } = batchConcurrencyPlan(options);
734
766
  const deduplicated = dedupeExactBatchItems(tasks, (task) => JSON.stringify(task.request));
735
767
  const uniqueTasks = deduplicated.uniqueItems;
736
- 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;
737
- if (path2 !== "api/v1/company-signals" && recoverableBatch && uniqueTasks.length > 25) {
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 } : path2 === "api/v1/company-signals" ? { label: "Company Signals", pageSize: 25, maxWaitMs: 20 * 6e4 } : void 0;
769
+ if (recoverableBatch && uniqueTasks.length > 25) {
738
770
  const rows = await this.runRecoverableCoreBatchJob(
739
771
  path2,
740
772
  uniqueTasks.map((task) => task.request),
@@ -743,12 +775,16 @@ var Signaliz = class {
743
775
  recoverableBatch.maxWaitMs,
744
776
  options?.idempotencyKey
745
777
  );
746
- const uniqueResults2 = rows.map((raw) => ({
747
- index: uniqueTasks[Number(raw.index)].index,
748
- success: !recoverableJobRowFailed(raw),
749
- raw,
750
- error: recoverableJobRowFailed(raw) ? raw.error || raw._error || raw.message || raw.failure_reason || `${recoverableBatch.label} item failed` : void 0
751
- }));
778
+ const uniqueResults2 = new Array(uniqueTasks.length);
779
+ for (const raw of rows) {
780
+ const index = Number(raw.index);
781
+ uniqueResults2[index] = {
782
+ index: uniqueTasks[index].index,
783
+ success: !recoverableJobRowFailed(raw),
784
+ raw,
785
+ error: recoverableJobRowFailed(raw) ? raw.error || raw._error || raw.message || raw.failure_reason || `${recoverableBatch.label} item failed` : void 0
786
+ };
787
+ }
752
788
  return tasks.map((task, index) => ({
753
789
  ...uniqueResults2[deduplicated.sourceIndexByInput[index]],
754
790
  index: task.index
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-KA66GBVZ.mjs";
4
+ } from "./chunk-BFMRS2FT.mjs";
5
5
 
6
6
  // src/mcp-config.ts
7
7
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/sdk",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Signaliz SDK for Find Email, Verify Email, Company Signal Enrichment, and Signal to Copy AI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",