@sellable/mcp 0.1.501 → 0.1.502

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.
@@ -1,4 +1,20 @@
1
1
  type ApprovalMode = "mark_ready" | "approve";
2
+ type RowSelector = {
3
+ type: "needsEnrichment";
4
+ limit?: number;
5
+ } | {
6
+ type: "needsApproval";
7
+ limit?: number;
8
+ } | {
9
+ type: "needsGeneratedMessage";
10
+ limit?: number;
11
+ } | {
12
+ type: "reviewBatch";
13
+ limit?: number;
14
+ } | {
15
+ type: "staleGeneratedMessages";
16
+ limit?: number;
17
+ };
2
18
  type PrepareMessagesBaseInput = {
3
19
  campaignId?: string;
4
20
  tableId?: string;
@@ -11,6 +27,7 @@ type StartPrepareMessagesInput = PrepareMessagesBaseInput & {
11
27
  batchSize?: number;
12
28
  maxBatchRows?: number;
13
29
  approvalMode?: ApprovalMode;
30
+ rowSelector?: RowSelector;
14
31
  autoContinue?: boolean;
15
32
  disableLowPassRateStop?: boolean;
16
33
  requestHash?: string;
@@ -61,6 +78,23 @@ export declare const campaignMessagePreparationToolDefinitions: ({
61
78
  enum: string[];
62
79
  description: string;
63
80
  };
81
+ rowSelector: {
82
+ type: string;
83
+ description: string;
84
+ properties: {
85
+ type: {
86
+ type: string;
87
+ enum: string[];
88
+ };
89
+ limit: {
90
+ type: string;
91
+ minimum: number;
92
+ maximum: number;
93
+ };
94
+ };
95
+ required: string[];
96
+ additionalProperties: boolean;
97
+ };
64
98
  autoContinue: {
65
99
  type: string;
66
100
  };
@@ -103,6 +137,7 @@ export declare const campaignMessagePreparationToolDefinitions: ({
103
137
  batchSize?: undefined;
104
138
  maxBatchRows?: undefined;
105
139
  approvalMode?: undefined;
140
+ rowSelector?: undefined;
106
141
  autoContinue?: undefined;
107
142
  senderId?: undefined;
108
143
  actionType?: undefined;
@@ -39,6 +39,25 @@ export const campaignMessagePreparationToolDefinitions = [
39
39
  enum: ["mark_ready", "approve"],
40
40
  description: "Defaults to mark_ready. Use approve only when the user explicitly asks to flip Approved cells. Approval is not scheduling; it only makes the bounded cohort eligible for downstream scheduler ownership.",
41
41
  },
42
+ rowSelector: {
43
+ type: "object",
44
+ description: 'Optional semantic row selector for refill frontiers. For regular refill preparation, use {type:"needsEnrichment"} so the backend starts at the actual unenriched table frontier instead of a generic prefix scan.',
45
+ properties: {
46
+ type: {
47
+ type: "string",
48
+ enum: [
49
+ "needsEnrichment",
50
+ "needsApproval",
51
+ "needsGeneratedMessage",
52
+ "reviewBatch",
53
+ "staleGeneratedMessages",
54
+ ],
55
+ },
56
+ limit: { type: "number", minimum: 1, maximum: 500 },
57
+ },
58
+ required: ["type"],
59
+ additionalProperties: false,
60
+ },
42
61
  autoContinue: { type: "boolean" },
43
62
  senderId: {
44
63
  type: "string",
@@ -101,6 +120,7 @@ export function startPrepareCampaignMessages(input) {
101
120
  batchSize: input.batchSize,
102
121
  maxBatchRows: input.maxBatchRows,
103
122
  approvalMode: input.approvalMode,
123
+ rowSelector: input.rowSelector,
104
124
  autoContinue: input.autoContinue,
105
125
  disableLowPassRateStop: input.disableLowPassRateStop,
106
126
  requestHash: input.requestHash,
@@ -336,6 +336,22 @@ function stringArray(value) {
336
336
  return [];
337
337
  return value.filter((item) => typeof item === "string");
338
338
  }
339
+ function prepareRowSelectorValue(value) {
340
+ const selector = recordValue(value);
341
+ const type = stringValue(selector?.type);
342
+ if (type !== "needsEnrichment" &&
343
+ type !== "needsApproval" &&
344
+ type !== "needsGeneratedMessage" &&
345
+ type !== "reviewBatch" &&
346
+ type !== "staleGeneratedMessages") {
347
+ return undefined;
348
+ }
349
+ const limit = numberValue(selector?.limit);
350
+ return {
351
+ type,
352
+ ...(limit && limit > 0 ? { limit: Math.floor(limit) } : {}),
353
+ };
354
+ }
339
355
  function uniqueStrings(values) {
340
356
  const seen = new Set();
341
357
  const result = [];
@@ -526,6 +542,9 @@ function refillPrepareRequestHash(params) {
526
542
  actionSourceLeadListId(params.action) ?? "no-source-list",
527
543
  actionActionType(params.action) ?? "no-action-type",
528
544
  params.approvalMode,
545
+ params.rowSelector
546
+ ? `${params.rowSelector.type}:${params.rowSelector.limit ?? "no-limit"}`
547
+ : "no-row-selector",
529
548
  ].join(":");
530
549
  }
531
550
  function boundedApprovalLimit(action) {
@@ -741,6 +760,7 @@ async function executeOneYoloPrimitive(action) {
741
760
  const tableId = actionTableId(action) ?? undefined;
742
761
  const toolInput = actionToolInput(action);
743
762
  const targetPreparedMessages = numberValue(toolInput.targetPreparedMessages);
763
+ const rowSelector = prepareRowSelectorValue(toolInput.rowSelector);
744
764
  const approvalMode = toolInput.approvalMode === "approve" ? "approve" : "mark_ready";
745
765
  if (!campaignId ||
746
766
  !targetPreparedMessages ||
@@ -756,6 +776,7 @@ async function executeOneYoloPrimitive(action) {
756
776
  targetPreparedMessages,
757
777
  maxRowsToCheck: numberValue(toolInput.maxRowsToCheck) ?? 300,
758
778
  approvalMode,
779
+ rowSelector,
759
780
  autoContinue: true,
760
781
  disableLowPassRateStop: true,
761
782
  senderId: actionSenderId(action) ?? undefined,
@@ -765,6 +786,7 @@ async function executeOneYoloPrimitive(action) {
765
786
  campaignId,
766
787
  tableId,
767
788
  approvalMode,
789
+ rowSelector,
768
790
  }),
769
791
  requestSource: "refill_sends",
770
792
  });
@@ -601,6 +601,7 @@ export declare const allTools: ({
601
601
  batchSize?: undefined;
602
602
  maxBatchRows?: undefined;
603
603
  approvalMode?: undefined;
604
+ rowSelector?: undefined;
604
605
  autoContinue?: undefined;
605
606
  senderId?: undefined;
606
607
  actionType?: undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.501",
3
+ "version": "0.1.502",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",