@sellable/mcp 0.1.96 → 0.1.98

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.
@@ -56,6 +56,16 @@ export function markSenderEnrichmentObserved(input) {
56
56
  return senderEnrichmentSnapshot;
57
57
  }
58
58
  export function markSenderResearchCompleted(input) {
59
+ const completedAt = new Date().toISOString();
60
+ if (!researchPromptStates.sender) {
61
+ const state = {
62
+ loadedAt: completedAt,
63
+ mode: "sender",
64
+ subskillName: "research-sender",
65
+ };
66
+ researchPromptStates.sender = state;
67
+ latestResearchPromptState = state;
68
+ }
59
69
  const toNonNegativeInteger = (value) => {
60
70
  if (typeof value !== "number" || Number.isNaN(value))
61
71
  return 0;
@@ -64,7 +74,7 @@ export function markSenderResearchCompleted(input) {
64
74
  return Math.max(0, Math.floor(value));
65
75
  };
66
76
  senderResearchCompletionState = {
67
- completedAt: new Date().toISOString(),
77
+ completedAt,
68
78
  depth: input?.depth ?? "minimal-verification",
69
79
  proofItemsFound: toNonNegativeInteger(input?.proofItemsFound),
70
80
  caseStudyItemsFound: toNonNegativeInteger(input?.caseStudyItemsFound),
@@ -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;
@@ -2266,6 +2266,22 @@ export async function confirmLeadList(input) {
2266
2266
  ...(shouldSetCurrentStep ? { currentStep: effectiveCurrentStep } : {}),
2267
2267
  });
2268
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
+ }
2269
2285
  // Persist currentStep if the caller asked for it. Do NOT touch
2270
2286
  // selectedLeadListId here: the campaign table id is already saved to
2271
2287
  // CampaignOffer.workflowTableId by /api/v3/campaign-builder/import-leads,
@@ -2284,6 +2300,16 @@ export async function confirmLeadList(input) {
2284
2300
  sourceLeadListId: resolvedLeadListId,
2285
2301
  campaignTableId: campaignTableId ?? null,
2286
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,
2287
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.",
2288
2314
  };
2289
2315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.96",
3
+ "version": "0.1.98",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",