@sellable/mcp 0.1.334 → 0.1.336

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/index-dev.js CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
package/dist/server.js CHANGED
@@ -6,9 +6,8 @@ import { getAuthStatus } from "./tools/auth.js";
6
6
  import { handleAddColumn, handleCommitBlueprint, } from "./tools/blueprint-commit.js";
7
7
  import { bootstrapCreateCampaign } from "./tools/bootstrap.js";
8
8
  import { prepareCampaignAbTest } from "./tools/campaign-ab-test.js";
9
- import { fillCampaignHorizon } from "./tools/campaign-horizon-fill.js";
10
9
  import { cancelPrepareCampaignMessages, getPrepareCampaignMessagesStatus, startPrepareCampaignMessages, } from "./tools/campaign-message-preparation.js";
11
- import { getCampaignTableSchema, queueCampaignCells, reviseMessageTemplateAndRerun, selectCampaignCells, waitForCampaignProcessing, } from "./tools/campaign-processing.js";
10
+ import { getCampaignTableSchema, queueCampaignCells, recordCampaignReviewBatch, reviseMessageTemplateAndRerun, selectCampaignCells, waitForCampaignProcessing, } from "./tools/campaign-processing.js";
12
11
  import { createCampaign, duplicateCampaign, getCampaign, getCampaignMessagesPreview, getCampaigns, pauseCampaign, startCampaign, updateCampaign, updateCampaignBrief, } from "./tools/campaigns.js";
13
12
  import { queueCells, updateCell } from "./tools/cells.js";
14
13
  import { handleStartCliLogin, handleWaitForCliLogin, } from "./tools/cli-login.js";
@@ -179,12 +178,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
179
178
  case "get_campaign_messages_preview":
180
179
  result = await getCampaignMessagesPreview(args);
181
180
  break;
182
- case "fill_campaign_horizon":
183
- result = await fillCampaignHorizon(args);
184
- if (args?.campaignId) {
185
- markCampaignContextDirty(args.campaignId, "fill_campaign_horizon");
186
- }
187
- break;
188
181
  case "start_campaign_message_preparation":
189
182
  case "start_prepare_campaign_messages":
190
183
  result = await startPrepareCampaignMessages(args);
@@ -219,6 +212,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
219
212
  markCampaignContextDirty(args.campaignId, "queue_campaign_cells");
220
213
  }
221
214
  break;
215
+ case "record_campaign_review_batch":
216
+ result = await recordCampaignReviewBatch(args);
217
+ break;
222
218
  case "wait_for_campaign_processing":
223
219
  result = await waitForCampaignProcessing(args);
224
220
  break;
@@ -9,7 +9,6 @@ type StartPrepareMessagesInput = PrepareMessagesBaseInput & {
9
9
  targetPreparedMessages?: number;
10
10
  maxRowsToCheck?: number;
11
11
  batchSize?: number;
12
- maxBatchRows?: number;
13
12
  approvalMode?: ApprovalMode;
14
13
  autoContinue?: boolean;
15
14
  disableLowPassRateStop?: boolean;
@@ -46,12 +45,6 @@ export declare const campaignMessagePreparationToolDefinitions: ({
46
45
  maximum: number;
47
46
  description: string;
48
47
  };
49
- maxBatchRows: {
50
- type: string;
51
- minimum: number;
52
- maximum: number;
53
- description: string;
54
- };
55
48
  approvalMode: {
56
49
  type: string;
57
50
  enum: string[];
@@ -88,7 +81,6 @@ export declare const campaignMessagePreparationToolDefinitions: ({
88
81
  targetPreparedMessages?: undefined;
89
82
  maxRowsToCheck?: undefined;
90
83
  batchSize?: undefined;
91
- maxBatchRows?: undefined;
92
84
  approvalMode?: undefined;
93
85
  autoContinue?: undefined;
94
86
  disableLowPassRateStop?: undefined;
@@ -6,7 +6,7 @@ async function postPrepareMessages(body) {
6
6
  export const campaignMessagePreparationToolDefinitions = [
7
7
  {
8
8
  name: "start_campaign_message_preparation",
9
- description: 'Start a bounded campaign message preparation job for a CampaignOffer campaignId. Use this after lead/message approval when the user asks to "fill up", "load", "prepare", or "schedule" sends for attached senders. It never launches the campaign. The job queues pending Enrich Prospect cells first, lets ICP/rubric and Generate Message cascade, then marks ready or approves only the bounded cohort. Omit maxRowsToCheck and batchSize for the adaptive default: calibrate on at least 100 actually-enriched rows, estimate the row budget from observed rubric/pass yield, cap rows at 300, and process at most 100 newly checked rows at a time. The worker will not pull another row batch while the current checked batch still has queueable or active cells. Do not interpret checkedRows as enriched rows; use progress.enrichedRows, needsEnrichRows, activeCellCount, preparedMessages, and stopReason.',
9
+ description: 'Start a bounded campaign message preparation job for a CampaignOffer campaignId. Use this after lead/message approval when the user asks to "fill up", "load", "prepare", or "schedule" sends for attached senders. It never launches the campaign. The job queues pending Enrich Prospect cells first, lets ICP/rubric and Generate Message cascade, then marks ready or approves only the bounded cohort. Omit maxRowsToCheck and batchSize for the adaptive default: calibrate on at least 100 actually-enriched rows, estimate the row budget from observed rubric/pass yield, cap rows at 2500, then use batches up to 250 once the sample is strong enough. Do not interpret checkedRows as enriched rows; use progress.enrichedRows, needsEnrichRows, activeCellCount, preparedMessages, and stopReason.',
10
10
  inputSchema: {
11
11
  type: "object",
12
12
  properties: {
@@ -19,20 +19,14 @@ export const campaignMessagePreparationToolDefinitions = [
19
19
  maxRowsToCheck: {
20
20
  type: "number",
21
21
  minimum: 1,
22
- maximum: 300,
23
- description: "Optional override capped by the backend at 300. Omit this for adaptive sample-based row budgeting.",
22
+ maximum: 2500,
23
+ description: "Optional override capped by the backend at 2500. Omit this for adaptive sample-based row budgeting.",
24
24
  },
25
25
  batchSize: {
26
26
  type: "number",
27
27
  minimum: 1,
28
- maximum: 100,
29
- description: "Optional first-batch override capped by the backend at 100. Omit this to sample 100 rows.",
30
- },
31
- maxBatchRows: {
32
- type: "number",
33
- minimum: 1,
34
- maximum: 100,
35
- description: "Optional max rows to add in any single preparation batch. Capped by the backend at 100.",
28
+ maximum: 250,
29
+ description: "Optional first-batch override capped by the backend at 250. Omit this to sample 100 rows before larger batches.",
36
30
  },
37
31
  approvalMode: {
38
32
  type: "string",
@@ -84,7 +78,6 @@ export function startPrepareCampaignMessages(input) {
84
78
  targetPreparedMessages: input.targetPreparedMessages,
85
79
  maxRowsToCheck: input.maxRowsToCheck,
86
80
  batchSize: input.batchSize,
87
- maxBatchRows: input.maxBatchRows,
88
81
  approvalMode: input.approvalMode,
89
82
  autoContinue: input.autoContinue,
90
83
  disableLowPassRateStop: input.disableLowPassRateStop,
@@ -42,6 +42,11 @@ type ReviseTemplateInput = SchemaInput & {
42
42
  rowSelector?: RowSelector;
43
43
  limit?: number;
44
44
  };
45
+ type RecordReviewBatchInput = SchemaInput & {
46
+ tableId: string;
47
+ rowIds: string[];
48
+ enrichCellIds?: string[];
49
+ };
45
50
  type ReviseTemplateResponse = Record<string, unknown> & {
46
51
  approvalsReset?: number;
47
52
  };
@@ -99,6 +104,8 @@ export declare const campaignProcessingToolDefinitions: ({
99
104
  templateRevision?: undefined;
100
105
  timeoutMs?: undefined;
101
106
  intervalMs?: undefined;
107
+ rowIds?: undefined;
108
+ enrichCellIds?: undefined;
102
109
  templateMarkdown?: undefined;
103
110
  approvedMessageTemplate?: undefined;
104
111
  };
@@ -154,6 +161,8 @@ export declare const campaignProcessingToolDefinitions: ({
154
161
  templateRevision?: undefined;
155
162
  timeoutMs?: undefined;
156
163
  intervalMs?: undefined;
164
+ rowIds?: undefined;
165
+ enrichCellIds?: undefined;
157
166
  templateMarkdown?: undefined;
158
167
  approvedMessageTemplate?: undefined;
159
168
  };
@@ -213,6 +222,8 @@ export declare const campaignProcessingToolDefinitions: ({
213
222
  templateRevision?: undefined;
214
223
  timeoutMs?: undefined;
215
224
  intervalMs?: undefined;
225
+ rowIds?: undefined;
226
+ enrichCellIds?: undefined;
216
227
  templateMarkdown?: undefined;
217
228
  approvedMessageTemplate?: undefined;
218
229
  };
@@ -252,12 +263,52 @@ export declare const campaignProcessingToolDefinitions: ({
252
263
  limit?: undefined;
253
264
  forceRerun?: undefined;
254
265
  reason?: undefined;
266
+ rowIds?: undefined;
267
+ enrichCellIds?: undefined;
255
268
  templateMarkdown?: undefined;
256
269
  approvedMessageTemplate?: undefined;
257
270
  };
258
271
  additionalProperties: boolean;
259
272
  required?: undefined;
260
273
  };
274
+ } | {
275
+ name: string;
276
+ description: string;
277
+ inputSchema: {
278
+ type: string;
279
+ properties: {
280
+ tableId: {
281
+ type: string;
282
+ };
283
+ rowIds: {
284
+ type: string;
285
+ items: {
286
+ type: string;
287
+ };
288
+ };
289
+ enrichCellIds: {
290
+ type: string;
291
+ items: {
292
+ type: string;
293
+ };
294
+ };
295
+ campaignId?: undefined;
296
+ columnRole?: undefined;
297
+ rowSelector?: undefined;
298
+ limit?: undefined;
299
+ forceRerun?: undefined;
300
+ reason?: undefined;
301
+ minPassedCount?: undefined;
302
+ minGeneratedMessages?: undefined;
303
+ templateRevision?: undefined;
304
+ timeoutMs?: undefined;
305
+ intervalMs?: undefined;
306
+ templateMarkdown?: undefined;
307
+ approvedMessageTemplate?: undefined;
308
+ };
309
+ required: string[];
310
+ additionalProperties: boolean;
311
+ };
261
312
  } | {
262
313
  name: string;
263
314
  description: string;
@@ -308,6 +359,8 @@ export declare const campaignProcessingToolDefinitions: ({
308
359
  templateRevision?: undefined;
309
360
  timeoutMs?: undefined;
310
361
  intervalMs?: undefined;
362
+ rowIds?: undefined;
363
+ enrichCellIds?: undefined;
311
364
  };
312
365
  required: string[];
313
366
  additionalProperties: boolean;
@@ -316,6 +369,7 @@ export declare const campaignProcessingToolDefinitions: ({
316
369
  export declare function getCampaignTableSchema(input: SchemaInput): Promise<CampaignProcessingSchemaResponse>;
317
370
  export declare function selectCampaignCells(input: SelectInput): Promise<unknown>;
318
371
  export declare function queueCampaignCells(input: QueueInput): Promise<unknown>;
372
+ export declare function recordCampaignReviewBatch(input: RecordReviewBatchInput): Promise<unknown>;
319
373
  export declare function reviseMessageTemplateAndRerun(input: ReviseTemplateInput): Promise<ReviseTemplateResponse>;
320
374
  export declare function waitForCampaignProcessing(input: WaitInput): Promise<{
321
375
  ready: boolean;
@@ -142,6 +142,20 @@ export const campaignProcessingToolDefinitions = [
142
142
  additionalProperties: false,
143
143
  },
144
144
  },
145
+ {
146
+ name: "record_campaign_review_batch",
147
+ description: "Record a fresh campaign-table review batch from explicit row IDs. Use for same-source new-sample recovery after a zero-pass bounded filter run; do not use for new lead sourcing.",
148
+ inputSchema: {
149
+ type: "object",
150
+ properties: {
151
+ tableId: { type: "string" },
152
+ rowIds: { type: "array", items: { type: "string" } },
153
+ enrichCellIds: { type: "array", items: { type: "string" } },
154
+ },
155
+ required: ["tableId", "rowIds"],
156
+ additionalProperties: false,
157
+ },
158
+ },
145
159
  {
146
160
  name: "revise_message_template_and_rerun",
147
161
  description: "Update the approved message template in the campaign brief, mark prior generated messages stale, reset unsent approvals, and force-rerun Generate Message cells. Does not directly overwrite row message cells.",
@@ -192,6 +206,12 @@ export async function queueCampaignCells(input) {
192
206
  ...input,
193
207
  });
194
208
  }
209
+ export async function recordCampaignReviewBatch(input) {
210
+ return postCampaignProcessing({
211
+ action: "recordReviewBatch",
212
+ ...input,
213
+ });
214
+ }
195
215
  export async function reviseMessageTemplateAndRerun(input) {
196
216
  const result = await postCampaignProcessing({
197
217
  action: "reviseTemplateAndRerun",
@@ -245,28 +265,36 @@ function buildProcessingTimeoutRecovery({ input, schema, stats, minPassedCount,
245
265
  },
246
266
  });
247
267
  }
248
- if (!passFloorMet && pendingWorkCount === 0 && campaignId) {
268
+ if (!passFloorMet && pendingWorkCount === 0) {
249
269
  suggestedToolCalls.push({
250
- tool: "search_signals",
251
- reason: "The checked sample missed the validation floor; revise the source before Settings.",
270
+ tool: "get_rows_minimal",
271
+ reason: "The checked sample missed the validation floor; inspect compact row miss patterns before choosing rubric revision, same-source new sample, or source revision.",
252
272
  args: {
253
- campaignOfferId: campaignId,
254
- currentStep: "signal-discovery",
255
- currentStepTransition: "revise-source-after-validation",
273
+ ...(campaignId ? { campaignId } : { tableId: schema.tableId }),
256
274
  },
257
275
  });
276
+ suggestedToolCalls.push({
277
+ tool: "record_campaign_review_batch",
278
+ reason: "If the source is still viable but this slice was unrepresentative, record explicit same-source rowIds as a fresh review batch, then queue enrich on rowSelector reviewBatch.",
279
+ args: {
280
+ tableId: schema.tableId,
281
+ rowIds: ["<choose unprocessed same-source row ids>"],
282
+ },
283
+ });
284
+ }
285
+ if (!passFloorMet && pendingWorkCount === 0 && campaignId) {
258
286
  suggestedToolCalls.push({
259
287
  tool: "update_campaign",
260
- reason: "If the user chooses a non-source revision path, persist the chosen recovery step explicitly.",
288
+ reason: "Persist the chosen recovery step explicitly; do not jump straight to source revision unless rubric relaxation and same-source sampling are not viable.",
261
289
  args: {
262
290
  campaignId,
263
- currentStep: "signal-discovery",
264
- currentStepTransition: "revise-source-after-validation",
291
+ currentStep: "apply-icp-rubric",
292
+ currentStepTransition: "sample-needs-revision",
265
293
  },
266
294
  });
267
295
  }
268
296
  const nextAction = !passFloorMet && pendingWorkCount === 0
269
- ? "revise-source-or-filters"
297
+ ? "revise-rubric-new-sample-or-source"
270
298
  : !generatedFloorMet
271
299
  ? "queue-or-retry-message-generation"
272
300
  : pendingWorkCount > 0
@@ -404,7 +432,7 @@ export async function waitForCampaignProcessing(input) {
404
432
  minGeneratedMessages,
405
433
  },
406
434
  recovery,
407
- guidance: "Surface this partial validation checkpoint before taking another action. Use recovery.suggestedToolCalls to retry processing, queue missing work, or revise source/filter/message quality instead of moving to Settings on a weak sample.",
435
+ guidance: "Surface this partial validation checkpoint before taking another action. Use recovery.suggestedToolCalls to retry processing, queue missing work, revise rubrics, record a fresh same-source sample, revise source, or revise message quality instead of moving to Settings on a weak sample.",
408
436
  stats: lastStats,
409
437
  };
410
438
  }
@@ -371,7 +371,7 @@ export function getPostFindLeadsScoutRegistry() {
371
371
  codex: 'After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not spawn anything before that question. After the answer, launch only Message Drafting. The filter-choice answer is the post-import user gate for this single worker; do not ask another question about starting it in step-wise or YOLO mode. The registry lookup is not a launch: after get_post_find_leads_scout_registry, immediately invoke Task/spawn_agent or the host background-agent mechanism before loading filter-leads.md, before saving rubrics, and before treating skip-filters as ready for message review. Both choices route through this kickoff; do not let filters_skipped jump straight from filter-choice to message-generation. If filters are chosen, the parent stays on Filter Rules and drafts/saves rubrics with MCP tools while Message Drafting runs in the background. If filters are skipped, move to Messages/message review only after Message Drafting has started or is ready; update_campaign(currentStep=messages) is not proof of launch. If the named Message Drafting custom agent is unavailable, spawn a generic gpt-5.5 xhigh Message Drafting background agent with the same lean campaign/table basis. When the background worker starts, persist workerDetails.messageDraftBuilder with statusSource "branch", status "branch-running", runId, startedAt, updatedAt, basisToken when known, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds; workerStatuses.messageDraftBuilder may be "running" as a simple badge only. Never put rich proof under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start the same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource "parent-thread-fallback" and status "fallback-active", and require the same live context, prompt, assets, and validation gate before message review; do not wait until filters are saved and then call the registry.',
372
372
  claude: "After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not invoke any Task/Agent before that question. After the answer, invoke only Message Drafting. If filters are chosen, parent drafts/saves rubrics with MCP tools while Message Drafting runs, asks filter approval, then joins Message Drafting. If filters are skipped, invoke only Message Drafting and move to Messages/message review.",
373
373
  parentThreadRule: 'Named agents are optional acceleration, but message drafting is not optional. The only normal background worker is Message Drafting. The filter-choice answer is the campaign-scoped go-ahead for this single post-import worker; do not ask another question to start it in step-wise or YOLO mode. If a named agent is unavailable, use a generic gpt-5.5 xhigh Message Drafting background agent. source work and filter work stay in the parent thread with MCP tools. If post-find-leads-message-scout is available, run it as the background Message Draft Builder after the filter-choice answer. The registry lookup is not a launch: get_post_find_leads_scout_registry only identifies the worker, and Message Drafting counts as started only after Task/spawn_agent or the host background-agent tool is invoked, or after the parent begins the same full message branch inline because no background-agent tool is callable. This launch must happen before loading filter-leads.md, save_rubrics, filter approval, or skip-filter message review; currentStep=messages is not proof of launch. If post-find-leads-message-scout is absent, do not customer-surface install status. Do not silently treat message drafting as started; the main thread must either launch the background worker or execute the same message branch from CampaignOffer state, selected source state, workflowTableId, and initial campaign-table execution slice rows. For a spawned worker, record workerDetails.messageDraftBuilder with statusSource branch / status branch-running, runId, startedAt, updatedAt, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds. workerStatuses.messageDraftBuilder is optional simple badge text only ("running", "ready", "blocked", "idle"); never put runId/statusSource/basis under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start that same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource parent-thread-fallback / status fallback-active then ready, and require the same live context, prompt, assets, and validation gate before message review; do not report that as a background worker failure. If neither branch nor inline fallback can run, return blocked/retry-needed; do not wait until filters are saved and then call the registry. The Message Drafting handoff must be lean. Do not paste copied row counts, brief hashes, review-batch hashes, full reviewBatchRowIds, broad row data, or local debug artifacts into the spawn prompt. Local markdown/json files are not normal-path inputs. The filter-choice question is the first post-import user gate; do not load post-lead registries or filter references before it. Message drafting starts after the filter-choice answer, must load get_subskill_prompt({ subskillName: "generate-messages" }), and must load every required message asset named by generate-messages Mode 0 through get_subskill_asset before drafting. Reference Asset Loading means loading the required pre-draft reference pack before drafting; return blocked/retry-needed if required assets cannot be loaded; load ai-tells.md because it is never optional. The branch or parent-thread fallback loads the full generate-messages prompt and every referenced asset through get_subskill_asset. After generating/revising the candidate and before returning ready, must load get_subskill_prompt({ subskillName: "create-campaign-v2-validation" }) as the final internal validation gate, must read live campaign table state through scoped MCP/product tools, and must reject mismatched selectedLeadListId/workflowTableId/campaign/workspace input. Do not block when filters were chosen but leadScoringRubrics are not yet visible in the branch read; the parent owns save_rubrics and filter approval in parallel, so Message Drafting should return status ready with basisStatus usable_initial when campaign/list/table identity and the non-empty execution slice match. Do not use any alternate, local-artifact, or examples-only message prompt. User copy feedback, message QA, or rewrite requests before approve-message must be routed back to Message Drafting with the current recommendation, lean campaign/table basis, and latest user text; the parent must not rewrite or QA the template from memory and must not call update_campaign_brief before approve-message. The worker validates internally and returns only templateRecommendation, tokenFillRules, renderedGoodSample, status, approveOrReviseRecommendation, validationStatus, outputAt, outputHash, and blocked/retry detail. Do not render renderedFallbackSample, risk notes, or a qaReceipt on the normal happy path. On the filter path, save_rubrics keeps the browser on Filter Rules after save_rubrics so the user can approve the saved criteria; after saved-filter approval, move to Filter Leads with currentStep=apply-icp-rubric whether Message Drafting is ready or still running. Wait there for message approval. Enrichment, filtering, Generate Message cells, sender setup, sequence attach, and launch wait for template approval on the Use Template path. On the skip path, move to Messages/message review after Message Drafting has started or is ready and wait for message approval before enrichment or Settings. Do not render message review from checklist or shortcut instructions; message review requires a messageDraftRecommendation whose basis proves the generate-messages prompt, required message assets, and validation gate ran for the current campaign/table execution slice. Do not automatically rerun Message Drafting after filters/enrichment finish; show the initial draft by default and offer an enriched rewrite only with explicit user opt-in. Handoff and recommendation output are Markdown with labeled fields, not raw JSON.',
374
- prepareMessagesRule: 'Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. Only call start_campaign_message_preparation when the user explicitly asks for more prepared messages, a send count, or to fill up/load sends for senders. Treat "fill up/load sends" as capacity-fill preparation: calculate the bounded target from sender capacity when needed, then let the job queue pending Enrich Prospect cells first, wait for ICP/rubric and Generate Message to cascade, and mark ready or approve only the target cohort. Do not interpret checkedRows as enriched rows; it is only the table cursor. Poll get_campaign_message_preparation_status and summarize enrichedRows, needsEnrichRows, activeCellCount, passed/prepared/approved count, target, estimated row budget remaining, and stopReason. For "prepare/generate X messages", set targetPreparedMessages:X, omit maxRowsToCheck so the backend calibrates on at least 100 actually-enriched rows, estimates the row budget from observed rubric/pass yield, caps maxRowsToCheck at 300, and use approvalMode:mark_ready. After the calibration sample settles, the backend continues in batches capped at 100 newly checked rows and will not pull another row batch while the current checked batch still has queueable or active cells. For "approve X messages", use approvalMode:approve but still do not launch. For "schedule X sends" or "fill sender sends", use approvalMode:approve to approve exactly the bounded X-message cohort during preparation, then continue through sender, sequence, and final launch greenlight; final launch must verify that bounded cohort and must not broad approve-all. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, call cancel_campaign_message_preparation; otherwise do not cancel a healthy prepare run. cancel_campaign_message_preparation cancels the same pending workflow-table cells as the UI Cancel Pending Cells action. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until final launch greenlight.',
374
+ prepareMessagesRule: 'Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. Only call start_campaign_message_preparation when the user explicitly asks for more prepared messages, a send count, or to fill up/load sends for senders. Treat "fill up/load sends" as capacity-fill preparation: calculate the bounded target from sender capacity when needed, then let the job queue pending Enrich Prospect cells first, wait for ICP/rubric and Generate Message to cascade, and mark ready or approve only the target cohort. Do not interpret checkedRows as enriched rows; it is only the table cursor. Poll get_campaign_message_preparation_status and summarize enrichedRows, needsEnrichRows, activeCellCount, passed/prepared/approved count, target, estimated row budget remaining, and stopReason. For "prepare/generate X messages", set targetPreparedMessages:X, omit maxRowsToCheck so the backend calibrates on at least 100 actually-enriched rows, estimates the row budget from observed rubric/pass yield, caps maxRowsToCheck at 2500, and use approvalMode:mark_ready. After the calibration sample settles, the backend adapts later batches up to 250 rows while recalculating yield. For "approve X messages", use approvalMode:approve but still do not launch. For "schedule X sends" or "fill sender sends", use approvalMode:approve to approve exactly the bounded X-message cohort during preparation, then continue through sender, sequence, and final launch greenlight; final launch must verify that bounded cohort and must not broad approve-all. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, call cancel_campaign_message_preparation; otherwise do not cancel a healthy prepare run. cancel_campaign_message_preparation cancels the same pending workflow-table cells as the UI Cancel Pending Cells action. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until final launch greenlight.',
375
375
  },
376
376
  };
377
377
  }
@@ -474,83 +474,6 @@ export declare const allTools: ({
474
474
  required: string[];
475
475
  additionalProperties: boolean;
476
476
  };
477
- } | {
478
- name: string;
479
- description: string;
480
- inputSchema: {
481
- type: string;
482
- properties: {
483
- action: {
484
- type: string;
485
- enum: string[];
486
- description: string;
487
- };
488
- campaignId: {
489
- type: string;
490
- description: string;
491
- };
492
- tableId: {
493
- type: string;
494
- description: string;
495
- };
496
- stateRevision: {
497
- type: string;
498
- description: string;
499
- };
500
- excludedPostIds: {
501
- type: string;
502
- items: {
503
- type: string;
504
- };
505
- maxItems: number;
506
- description: string;
507
- };
508
- excludedPostUrls: {
509
- type: string;
510
- items: {
511
- type: string;
512
- };
513
- maxItems: number;
514
- description: string;
515
- };
516
- excludedAuthorProfileUrls: {
517
- type: string;
518
- items: {
519
- type: string;
520
- };
521
- maxItems: number;
522
- description: string;
523
- };
524
- excludedAuthorNames: {
525
- type: string;
526
- items: {
527
- type: string;
528
- };
529
- maxItems: number;
530
- description: string;
531
- };
532
- targetPreparedMessages: {
533
- type: string;
534
- minimum: number;
535
- maximum: number;
536
- description: string;
537
- };
538
- maxRowsToCheck: {
539
- type: string;
540
- minimum: number;
541
- maximum: number;
542
- description: string;
543
- };
544
- batchSize: {
545
- type: string;
546
- minimum: number;
547
- maximum: number;
548
- description: string;
549
- };
550
- };
551
- required: string[];
552
- additionalProperties: boolean;
553
- };
554
477
  } | {
555
478
  name: string;
556
479
  description: string;
@@ -581,12 +504,6 @@ export declare const allTools: ({
581
504
  maximum: number;
582
505
  description: string;
583
506
  };
584
- maxBatchRows: {
585
- type: string;
586
- minimum: number;
587
- maximum: number;
588
- description: string;
589
- };
590
507
  approvalMode: {
591
508
  type: string;
592
509
  enum: string[];
@@ -623,7 +540,6 @@ export declare const allTools: ({
623
540
  targetPreparedMessages?: undefined;
624
541
  maxRowsToCheck?: undefined;
625
542
  batchSize?: undefined;
626
- maxBatchRows?: undefined;
627
543
  approvalMode?: undefined;
628
544
  autoContinue?: undefined;
629
545
  disableLowPassRateStop?: undefined;
@@ -690,6 +606,8 @@ export declare const allTools: ({
690
606
  templateRevision?: undefined;
691
607
  timeoutMs?: undefined;
692
608
  intervalMs?: undefined;
609
+ rowIds?: undefined;
610
+ enrichCellIds?: undefined;
693
611
  templateMarkdown?: undefined;
694
612
  approvedMessageTemplate?: undefined;
695
613
  };
@@ -745,6 +663,8 @@ export declare const allTools: ({
745
663
  templateRevision?: undefined;
746
664
  timeoutMs?: undefined;
747
665
  intervalMs?: undefined;
666
+ rowIds?: undefined;
667
+ enrichCellIds?: undefined;
748
668
  templateMarkdown?: undefined;
749
669
  approvedMessageTemplate?: undefined;
750
670
  };
@@ -804,6 +724,8 @@ export declare const allTools: ({
804
724
  templateRevision?: undefined;
805
725
  timeoutMs?: undefined;
806
726
  intervalMs?: undefined;
727
+ rowIds?: undefined;
728
+ enrichCellIds?: undefined;
807
729
  templateMarkdown?: undefined;
808
730
  approvedMessageTemplate?: undefined;
809
731
  };
@@ -843,12 +765,52 @@ export declare const allTools: ({
843
765
  limit?: undefined;
844
766
  forceRerun?: undefined;
845
767
  reason?: undefined;
768
+ rowIds?: undefined;
769
+ enrichCellIds?: undefined;
846
770
  templateMarkdown?: undefined;
847
771
  approvedMessageTemplate?: undefined;
848
772
  };
849
773
  additionalProperties: boolean;
850
774
  required?: undefined;
851
775
  };
776
+ } | {
777
+ name: string;
778
+ description: string;
779
+ inputSchema: {
780
+ type: string;
781
+ properties: {
782
+ tableId: {
783
+ type: string;
784
+ };
785
+ rowIds: {
786
+ type: string;
787
+ items: {
788
+ type: string;
789
+ };
790
+ };
791
+ enrichCellIds: {
792
+ type: string;
793
+ items: {
794
+ type: string;
795
+ };
796
+ };
797
+ campaignId?: undefined;
798
+ columnRole?: undefined;
799
+ rowSelector?: undefined;
800
+ limit?: undefined;
801
+ forceRerun?: undefined;
802
+ reason?: undefined;
803
+ minPassedCount?: undefined;
804
+ minGeneratedMessages?: undefined;
805
+ templateRevision?: undefined;
806
+ timeoutMs?: undefined;
807
+ intervalMs?: undefined;
808
+ templateMarkdown?: undefined;
809
+ approvedMessageTemplate?: undefined;
810
+ };
811
+ required: string[];
812
+ additionalProperties: boolean;
813
+ };
852
814
  } | {
853
815
  name: string;
854
816
  description: string;
@@ -899,6 +861,8 @@ export declare const allTools: ({
899
861
  templateRevision?: undefined;
900
862
  timeoutMs?: undefined;
901
863
  intervalMs?: undefined;
864
+ rowIds?: undefined;
865
+ enrichCellIds?: undefined;
902
866
  };
903
867
  required: string[];
904
868
  additionalProperties: boolean;
@@ -2,7 +2,6 @@ import { authToolDefinitions } from "./auth.js";
2
2
  import { blueprintCommitToolDefinitions } from "./blueprint-commit.js";
3
3
  import { bootstrapToolDefinitions } from "./bootstrap.js";
4
4
  import { campaignAbTestToolDefinitions } from "./campaign-ab-test.js";
5
- import { campaignHorizonFillToolDefinitions } from "./campaign-horizon-fill.js";
6
5
  import { campaignMessagePreparationToolDefinitions } from "./campaign-message-preparation.js";
7
6
  import { campaignProcessingToolDefinitions } from "./campaign-processing.js";
8
7
  import { campaignToolDefinitions } from "./campaigns.js";
@@ -43,7 +42,6 @@ import { workspaceToolDefinitions } from "./workspaces.js";
43
42
  export const allTools = [
44
43
  ...campaignToolDefinitions,
45
44
  ...campaignAbTestToolDefinitions,
46
- ...campaignHorizonFillToolDefinitions,
47
45
  ...campaignMessagePreparationToolDefinitions,
48
46
  ...campaignProcessingToolDefinitions,
49
47
  ...authToolDefinitions,
@@ -1,10 +1,6 @@
1
1
  export interface WorkflowTableListItem {
2
2
  id: string;
3
3
  name: string;
4
- workspaceId: string | null;
5
- status: string | null;
6
- campaignStatus: string | null;
7
- dashboardBucket: "active" | "archived";
8
4
  type: string | null;
9
5
  campaignOfferId: string | null;
10
6
  campaignBacked: boolean;
@@ -6,7 +6,7 @@ import { getApi } from "../api.js";
6
6
  export const tableToolDefinitions = [
7
7
  {
8
8
  name: "list_tables",
9
- description: "List all workflow tables in the active workspace. Returns metadata including workspaceId, workflow status, campaignStatus, dashboardBucket, whether each table is campaign-backed, and whether it has a sequence attached.\n\n" +
9
+ description: "List all workflow tables in the active workspace. Returns metadata including whether each table is campaign-backed and whether it has a sequence attached.\n\n" +
10
10
  "Unlike get_campaigns, this lists every WorkflowTable regardless of how it was created, including create_workflow_table, create_on_demand_table, and UI-created tables.",
11
11
  inputSchema: {
12
12
  type: "object",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.334",
3
+ "version": "0.1.336",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -44,9 +44,9 @@ allowed-tools:
44
44
  - mcp__sellable__save_rubrics
45
45
  - mcp__sellable__get_campaign_table_schema
46
46
  - mcp__sellable__select_campaign_cells
47
+ - mcp__sellable__record_campaign_review_batch
47
48
  - mcp__sellable__queue_campaign_cells
48
49
  - mcp__sellable__wait_for_campaign_processing
49
- - mcp__sellable__fill_campaign_horizon
50
50
  - mcp__sellable__start_campaign_message_preparation
51
51
  - mcp__sellable__get_campaign_message_preparation_status
52
52
  - mcp__sellable__cancel_campaign_message_preparation
@@ -105,16 +105,15 @@ most one direct `enrich_with_prospeo` sample when row evidence is too thin.
105
105
  After filter approval, the browser should move to Filter Leads with
106
106
  `currentStep: "apply-icp-rubric"` and show template waiting/approval copy until
107
107
  the template is approved.
108
+ If the bounded filter run later returns `0/N` passes, do not immediately find
109
+ new leads. Load `references/sample-validation-loop.md`, run the zero-pass
110
+ rule-relaxability audit, then choose exactly one recovery: revise saved
111
+ rubrics, record a fresh same-source review batch, or change lead source. Change
112
+ source only when safe relaxation and same-source sampling would still fail or
113
+ would pass bad-fit rows.
108
114
  The default path stays the existing first campaign-table execution slice:
109
115
  review the normal `reviewBatchLimit:15`, approve reviewed draft rows, then move
110
116
  to Settings/sequence/final greenlight. Only call
111
- `fill_campaign_horizon` for explicit source-cleanup horizon-fill requests, such
112
- as "fill sends from Signal Discovery but not John Cutler posts." Run
113
- `fill_campaign_horizon({ action:"audit", ... })` first, then apply with the
114
- returned `stateRevision`. It imports/prepares at most 300 eligible non-excluded
115
- source rows in the first pass, caps prep batches at 100, skips existing rows
116
- from excluded post/author sources, and does not launch the campaign. If the
117
- user only asks for generic extra sends with no source cleanup, use
118
117
  `start_campaign_message_preparation` when the user explicitly asks for more
119
118
  prepared messages, a send count, or language like "fill up/load sends for these
120
119
  senders." Treat those requests as capacity-fill preparation: calculate the
@@ -128,9 +127,8 @@ count `checkedRows` as enriched rows; it is only the table cursor. Use
128
127
  messages", set `targetPreparedMessages:X`, omit `maxRowsToCheck`, and keep
129
128
  `approvalMode:"mark_ready"`. The backend calibrates on at least 100 actually
130
129
  enriched rows, estimates the row budget from observed rubric/pass yield, caps
131
- `maxRowsToCheck` at 300, then continues in batches capped at 100 newly checked
132
- rows. It will not pull another row batch while the current checked batch still
133
- has queueable or active cells. If the user says "approve X messages", use
130
+ `maxRowsToCheck` at 2500, then adapts later batches up to 250 rows while
131
+ recalculating yield. If the user says "approve X messages", use
134
132
  `approvalMode:"approve"` but still do not launch. If the user says "schedule X
135
133
  sends" or asks to fill sender sends, use `approvalMode:"approve"` to approve
136
134
  exactly the bounded X-message cohort during preparation, then continue through
@@ -1081,7 +1079,11 @@ updates.
1081
1079
  rubrics and Message Drafting runs.
1082
1080
  After rubrics save, keep Filter Rules visible for approval; after approval,
1083
1081
  move to Filter Leads with `currentStep: "apply-icp-rubric"` and wait there
1084
- while Message Drafting finishes or the template is approved.
1082
+ while Message Drafting finishes or the template is approved. After template
1083
+ approval and bounded scoring, a `0/N` pass result must run the
1084
+ sample-validation zero-pass rule-relaxability audit before any lead-source
1085
+ revision; the three allowed recoveries are rubric revision, fresh
1086
+ same-source sample, or source revision.
1085
1087
  If filters are skipped, launch Message Drafting before moving to
1086
1088
  Messages/message review; updating `currentStep` to `messages` is not proof
1087
1089
  that the background worker started. Queue the bounded campaign-table