@sellable/mcp 0.1.95 → 0.1.97
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/tools/leads.d.ts +9 -0
- package/dist/tools/leads.js +28 -1
- package/package.json +1 -1
package/dist/tools/leads.d.ts
CHANGED
|
@@ -2457,7 +2457,16 @@ export declare function confirmLeadList(input: ConfirmLeadListInput): Promise<{
|
|
|
2457
2457
|
campaignTableName?: string;
|
|
2458
2458
|
leadsImported?: number;
|
|
2459
2459
|
leadsSkipped?: number;
|
|
2460
|
+
rowIds?: string[];
|
|
2461
|
+
requestedTargetLeadCount?: number;
|
|
2462
|
+
sourceRowLimit?: number;
|
|
2460
2463
|
};
|
|
2464
|
+
boundedReviewBatch: {
|
|
2465
|
+
requestedTargetLeadCount: number;
|
|
2466
|
+
importedRowCount: number;
|
|
2467
|
+
keptRowCount: number | null;
|
|
2468
|
+
trimmedOverflowRowCount: number;
|
|
2469
|
+
} | undefined;
|
|
2461
2470
|
message: string;
|
|
2462
2471
|
}>;
|
|
2463
2472
|
export declare function getProviderPrompt(input: GetProviderPromptInput): string;
|
package/dist/tools/leads.js
CHANGED
|
@@ -1035,7 +1035,7 @@ export const leadToolDefinitions = [
|
|
|
1035
1035
|
},
|
|
1036
1036
|
targetLeadCount: {
|
|
1037
1037
|
type: "number",
|
|
1038
|
-
description: "Target lead count requested
|
|
1038
|
+
description: "Target lead count requested. Also caps the campaign-table clone for bounded review batches.",
|
|
1039
1039
|
},
|
|
1040
1040
|
confirmed: {
|
|
1041
1041
|
type: "boolean",
|
|
@@ -2262,9 +2262,26 @@ export async function confirmLeadList(input) {
|
|
|
2262
2262
|
campaignOfferId,
|
|
2263
2263
|
campaignName,
|
|
2264
2264
|
keepInSync,
|
|
2265
|
+
...(typeof targetLeadCount === "number" ? { targetLeadCount } : {}),
|
|
2265
2266
|
...(shouldSetCurrentStep ? { currentStep: effectiveCurrentStep } : {}),
|
|
2266
2267
|
});
|
|
2267
2268
|
const campaignTableId = importResult.workflowTableId ?? importResult.campaignTableId;
|
|
2269
|
+
const requestedTargetLeadCount = typeof targetLeadCount === "number" && Number.isFinite(targetLeadCount)
|
|
2270
|
+
? Math.max(1, Math.floor(targetLeadCount))
|
|
2271
|
+
: null;
|
|
2272
|
+
const importedRowIds = Array.isArray(importResult.rowIds)
|
|
2273
|
+
? importResult.rowIds.filter((rowId) => typeof rowId === "string" && rowId.trim().length > 0)
|
|
2274
|
+
: [];
|
|
2275
|
+
const overflowRowIds = campaignTableId && requestedTargetLeadCount !== null
|
|
2276
|
+
? importedRowIds.slice(requestedTargetLeadCount)
|
|
2277
|
+
: [];
|
|
2278
|
+
if (campaignTableId && overflowRowIds.length > 0) {
|
|
2279
|
+
const deleteBatchSize = 25;
|
|
2280
|
+
for (let index = 0; index < overflowRowIds.length; index += deleteBatchSize) {
|
|
2281
|
+
const batch = overflowRowIds.slice(index, index + deleteBatchSize);
|
|
2282
|
+
await Promise.all(batch.map((rowId) => api.delete(`/api/v3/workflow-tables/${campaignTableId}/rows/${rowId}`)));
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2268
2285
|
// Persist currentStep if the caller asked for it. Do NOT touch
|
|
2269
2286
|
// selectedLeadListId here: the campaign table id is already saved to
|
|
2270
2287
|
// CampaignOffer.workflowTableId by /api/v3/campaign-builder/import-leads,
|
|
@@ -2283,6 +2300,16 @@ export async function confirmLeadList(input) {
|
|
|
2283
2300
|
sourceLeadListId: resolvedLeadListId,
|
|
2284
2301
|
campaignTableId: campaignTableId ?? null,
|
|
2285
2302
|
importResult,
|
|
2303
|
+
boundedReviewBatch: requestedTargetLeadCount !== null
|
|
2304
|
+
? {
|
|
2305
|
+
requestedTargetLeadCount,
|
|
2306
|
+
importedRowCount: importedRowIds.length,
|
|
2307
|
+
keptRowCount: importedRowIds.length > 0
|
|
2308
|
+
? Math.min(importedRowIds.length, requestedTargetLeadCount)
|
|
2309
|
+
: null,
|
|
2310
|
+
trimmedOverflowRowCount: overflowRowIds.length,
|
|
2311
|
+
}
|
|
2312
|
+
: undefined,
|
|
2286
2313
|
message: "Lead list imported into campaign table. Next: move to filter-choice, then wait_for_campaign_table_ready, then sample with get_rows_minimal.",
|
|
2287
2314
|
};
|
|
2288
2315
|
}
|