@sellable/mcp 0.1.498 → 0.1.499
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.
|
@@ -7,6 +7,9 @@ import { refreshPaidInmailCredits } from "./senders.js";
|
|
|
7
7
|
const DEFAULT_SCHEDULER_FORWARD_HOURS = 48;
|
|
8
8
|
const PAID_INMAIL_REFRESH_MAX_ATTEMPTS = 3;
|
|
9
9
|
const PAID_INMAIL_REFRESH_RETRY_DELAY_MS = Number(process.env.SELLABLE_MCP_PAID_REFRESH_RETRY_DELAY_MS ?? "1000");
|
|
10
|
+
const SIGNAL_DISCOVERY_MIN_REFILL_POSTS = 3;
|
|
11
|
+
const SIGNAL_DISCOVERY_MAX_REFILL_POSTS = 10;
|
|
12
|
+
const SIGNAL_DISCOVERY_TARGET_ROWS_PER_POST = 150;
|
|
10
13
|
function normalizeStrings(values) {
|
|
11
14
|
if (!Array.isArray(values))
|
|
12
15
|
return [];
|
|
@@ -502,6 +505,9 @@ function postIdsFromSignalSearch(summary, maxPosts) {
|
|
|
502
505
|
: [];
|
|
503
506
|
return uniqueStrings([...recommendedPostIds, ...topPostIds]).slice(0, Math.max(1, maxPosts));
|
|
504
507
|
}
|
|
508
|
+
function maxSignalDiscoveryPostsForSourceLimit(sourceRowLimit) {
|
|
509
|
+
return Math.min(SIGNAL_DISCOVERY_MAX_REFILL_POSTS, Math.max(SIGNAL_DISCOVERY_MIN_REFILL_POSTS, Math.ceil(sourceRowLimit / SIGNAL_DISCOVERY_TARGET_ROWS_PER_POST)));
|
|
510
|
+
}
|
|
505
511
|
function refillPrepareRequestHash(params) {
|
|
506
512
|
return [
|
|
507
513
|
"refill_sends",
|
|
@@ -553,7 +559,7 @@ async function continueSignalDiscoverySource(action) {
|
|
|
553
559
|
numberValue(toolInput.targetRows) ??
|
|
554
560
|
numberValue(action.targetRows) ??
|
|
555
561
|
100)));
|
|
556
|
-
const maxPostsToScrape =
|
|
562
|
+
const maxPostsToScrape = maxSignalDiscoveryPostsForSourceLimit(sourceRowLimit);
|
|
557
563
|
if (!campaignOfferId || !sourceLeadListId || !sourceFingerprint) {
|
|
558
564
|
return {
|
|
559
565
|
status: "refused",
|