@sellable/mcp 0.1.515 → 0.1.517

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.
@@ -29,6 +29,7 @@ type StartPrepareMessagesInput = PrepareMessagesBaseInput & {
29
29
  maxBatchRows?: number;
30
30
  approvalMode?: ApprovalMode;
31
31
  rowSelector?: RowSelector;
32
+ excludeRowIds?: string[];
32
33
  autoContinue?: boolean;
33
34
  disableLowPassRateStop?: boolean;
34
35
  requestHash?: string;
@@ -96,6 +97,14 @@ export declare const campaignMessagePreparationToolDefinitions: ({
96
97
  required: string[];
97
98
  additionalProperties: boolean;
98
99
  };
100
+ excludeRowIds: {
101
+ type: string;
102
+ items: {
103
+ type: string;
104
+ };
105
+ maxItems: number;
106
+ description: string;
107
+ };
99
108
  autoContinue: {
100
109
  type: string;
101
110
  };
@@ -147,6 +156,7 @@ export declare const campaignMessagePreparationToolDefinitions: ({
147
156
  maxBatchRows?: undefined;
148
157
  approvalMode?: undefined;
149
158
  rowSelector?: undefined;
159
+ excludeRowIds?: undefined;
150
160
  autoContinue?: undefined;
151
161
  senderId?: undefined;
152
162
  actionType?: undefined;
@@ -62,6 +62,12 @@ export const campaignMessagePreparationToolDefinitions = [
62
62
  required: ["type"],
63
63
  additionalProperties: false,
64
64
  },
65
+ excludeRowIds: {
66
+ type: "array",
67
+ items: { type: "string" },
68
+ maxItems: 5000,
69
+ description: "Optional row IDs to skip when retrying after a prior bounded prep cohort failed.",
70
+ },
65
71
  autoContinue: { type: "boolean" },
66
72
  senderId: {
67
73
  type: "string",
@@ -132,6 +138,7 @@ export function startPrepareCampaignMessages(input) {
132
138
  maxBatchRows: input.maxBatchRows,
133
139
  approvalMode: input.approvalMode,
134
140
  rowSelector: input.rowSelector,
141
+ excludeRowIds: input.excludeRowIds,
135
142
  autoContinue: input.autoContinue,
136
143
  disableLowPassRateStop: input.disableLowPassRateStop,
137
144
  requestHash: input.requestHash,
@@ -146,6 +146,7 @@ export type SignalSearchInput = {
146
146
  headlineICPCriteria?: string[];
147
147
  rubricGuidelines?: string[];
148
148
  confirmed?: boolean;
149
+ workspaceId?: string;
149
150
  };
150
151
  export type ImportLeadsInput = {
151
152
  campaignOfferId: string;
@@ -3655,6 +3655,17 @@ export async function searchSignals(input) {
3655
3655
  campaignOfferId: input?.campaignOfferId,
3656
3656
  });
3657
3657
  const api = getApi();
3658
+ const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
3659
+ const requestOptions = workspaceRequestOptions(workspaceId);
3660
+ const apiPut = (path, body) => requestOptions
3661
+ ? api.put(path, body, requestOptions)
3662
+ : api.put(path, body);
3663
+ const apiPatch = (path, body) => requestOptions
3664
+ ? api.patch(path, body, requestOptions)
3665
+ : api.patch(path, body);
3666
+ const apiPost = (path, body) => requestOptions
3667
+ ? api.post(path, body, requestOptions)
3668
+ : api.post(path, body);
3658
3669
  const { campaignOfferId, headlineICPCriteria, rubricGuidelines, currentStepTransition, } = input;
3659
3670
  const searchRequest = { ...input };
3660
3671
  delete searchRequest.currentStepTransition;
@@ -3665,7 +3676,7 @@ export async function searchSignals(input) {
3665
3676
  ? headlineICPCriteria
3666
3677
  : rubricGuidelines;
3667
3678
  if (campaignOfferId && searchCurrentStep) {
3668
- await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
3679
+ await apiPut(`/api/v2/campaign-offers/${campaignOfferId}`, {
3669
3680
  leadSourceType: "new",
3670
3681
  leadSourceProvider: "signal-discovery",
3671
3682
  currentStep: searchCurrentStep,
@@ -3675,17 +3686,17 @@ export async function searchSignals(input) {
3675
3686
  }
3676
3687
  // Persist criteria early so user take-over has filters ready.
3677
3688
  if (campaignOfferId && effectiveHeadlineICPCriteria?.length) {
3678
- await api.patch(`/api/v3/campaigns/${campaignOfferId}/signal-discovery/posts`, {
3689
+ await apiPatch(`/api/v3/campaigns/${campaignOfferId}/signal-discovery/posts`, {
3679
3690
  selectedIds: [],
3680
3691
  unselectedIds: [],
3681
3692
  headlineICPCriteria: effectiveHeadlineICPCriteria,
3682
3693
  rubricGuidelines: effectiveHeadlineICPCriteria,
3683
3694
  });
3684
3695
  }
3685
- const response = await api.post(`/api/v1/signal-discovery/search-signals`, searchRequest);
3696
+ const response = await apiPost(`/api/v1/signal-discovery/search-signals`, searchRequest);
3686
3697
  const summary = summarizeSignalSearchResponse(response);
3687
3698
  if (campaignOfferId && searchCurrentStep) {
3688
- await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
3699
+ await apiPut(`/api/v2/campaign-offers/${campaignOfferId}`, {
3689
3700
  currentStep: searchCurrentStep,
3690
3701
  ...(currentStepTransition ? { currentStepTransition } : {}),
3691
3702
  watchNarration: buildSignalDiscoveryResultsWatchNarration(summary.postsReturned),
@@ -602,6 +602,7 @@ export async function executeRerunErroredCellsPrimitive(params) {
602
602
  tableId,
603
603
  columnRole: operation.columnRole,
604
604
  rowSelector: operation.rowSelector,
605
+ forceRerun: true,
605
606
  };
606
607
  const result = requestOptions
607
608
  ? await api.post("/api/v3/mcp/campaign-processing", body, requestOptions)
@@ -633,6 +634,7 @@ export async function executeOneYoloPrimitive(action, workspaceId) {
633
634
  const tableId = actionTableId(action) ?? undefined;
634
635
  const toolInput = actionToolInput(action);
635
636
  const targetPreparedMessages = numberValue(toolInput.targetPreparedMessages);
637
+ const excludeRowIds = uniqueStrings(stringArray(toolInput.excludeRowIds)).slice(0, 5000);
636
638
  const rowSelector = prepareRowSelectorValue(toolInput.rowSelector);
637
639
  const approvalMode = toolInput.approvalMode === "approve" ? "approve" : "mark_ready";
638
640
  if (!campaignId ||
@@ -651,6 +653,7 @@ export async function executeOneYoloPrimitive(action, workspaceId) {
651
653
  maxRowsToCheck: numberValue(toolInput.maxRowsToCheck) ?? 300,
652
654
  approvalMode,
653
655
  rowSelector,
656
+ ...(excludeRowIds.length > 0 ? { excludeRowIds } : {}),
654
657
  autoContinue: true,
655
658
  disableLowPassRateStop: true,
656
659
  senderId: actionSenderId(action) ?? undefined,
@@ -9,6 +9,7 @@ const SAFE_PACKET_ACTION_TYPES = new Set([
9
9
  "prepare_messages",
10
10
  "approve_messages",
11
11
  "start_paused_campaign",
12
+ "rerun_errored_cells",
12
13
  "wait_for_scheduler",
13
14
  "wait_for_active_work",
14
15
  "wait_for_source_import",
@@ -216,6 +217,33 @@ function sanitizeRowSelector(value) {
216
217
  : {}),
217
218
  };
218
219
  }
220
+ function sanitizeRerunErroredCellsOperations(value) {
221
+ if (!Array.isArray(value))
222
+ return [];
223
+ return value.flatMap((raw) => {
224
+ if (!isRecord(raw))
225
+ return [];
226
+ const columnRole = stringValue(raw.columnRole);
227
+ if (columnRole !== "icpScore" && columnRole !== "generateMessage") {
228
+ return [];
229
+ }
230
+ const rowSelector = sanitizeRowSelector(raw.rowSelector);
231
+ if (rowSelector?.type !== "rowIds")
232
+ return [];
233
+ const rowIds = Array.isArray(rowSelector.rowIds)
234
+ ? stringArray(rowSelector.rowIds)
235
+ : [];
236
+ if (rowIds.length === 0)
237
+ return [];
238
+ return [
239
+ {
240
+ columnRole,
241
+ rowSelector: { type: "rowIds", rowIds },
242
+ cellIds: stringArray(raw.cellIds),
243
+ },
244
+ ];
245
+ });
246
+ }
219
247
  function sanitizeToolInput(value) {
220
248
  if (!isRecord(value))
221
249
  return {};
@@ -256,6 +284,7 @@ function sanitizeToolInput(value) {
256
284
  ? value.availableCredits
257
285
  : undefined,
258
286
  threshold: typeof value.threshold === "number" ? value.threshold : undefined,
287
+ operations: sanitizeRerunErroredCellsOperations(value.operations),
259
288
  };
260
289
  }
261
290
  function sanitizePacketIds(value) {
@@ -610,6 +610,7 @@ export declare const allTools: ({
610
610
  maxBatchRows?: undefined;
611
611
  approvalMode?: undefined;
612
612
  rowSelector?: undefined;
613
+ excludeRowIds?: undefined;
613
614
  autoContinue?: undefined;
614
615
  senderId?: undefined;
615
616
  actionType?: undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.515",
3
+ "version": "0.1.517",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",