@sellable/mcp 0.1.135 → 0.1.137

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.
@@ -243,6 +243,9 @@ function checkMessages(campaign) {
243
243
  if (!hasApprovedMessageTemplate(campaign)) {
244
244
  missing.push("approvedMessageTemplate");
245
245
  }
246
+ if (campaign.currentStep === "auto-execute-messaging") {
247
+ missing.push("generatedMessageReview");
248
+ }
246
249
  return { stepId: "messages", missing };
247
250
  }
248
251
  function checkSettings(campaign) {
@@ -17,7 +17,7 @@ export const processingToolDefinitions = [
17
17
  },
18
18
  currentStep: {
19
19
  type: ["string", "null"],
20
- description: "Headless workflow step ID",
20
+ description: "Headless workflow step ID only when paired with the visible watch narration expected by the campaign-offers API; do not use as a separate step-only fixup after rubric, sender, sequence, or start work.",
21
21
  },
22
22
  enableICPFilters: {
23
23
  type: "boolean",
@@ -99,9 +99,7 @@ export interface SourceScoutRegistryResponse {
99
99
  export interface PostFindLeadsScoutRegistryResponse {
100
100
  version: number;
101
101
  trigger: "find_leads_source_approved";
102
- requiredArtifacts?: string[];
103
102
  requiredInputs?: string[];
104
- optionalDebugArtifacts?: string[];
105
103
  scouts: Array<{
106
104
  id: string;
107
105
  name: string;
@@ -125,12 +123,21 @@ export interface PostFindLeadsScoutRegistryResponse {
125
123
  }>;
126
124
  joinGate: {
127
125
  afterAllComplete: boolean;
128
- requiredArtifacts?: string[];
129
126
  requiredState?: string[];
130
- optionalDebugArtifacts?: string[];
127
+ noFilterRequiredState?: string[];
128
+ skipFilterRule?: string;
131
129
  show: string[];
132
130
  nextStage: string;
133
131
  };
132
+ messageDraftBranchContract?: {
133
+ firstAllowedStart: string;
134
+ forbiddenStarts: string[];
135
+ runtimeProofTransport: string;
136
+ runtimeProofRequiredFields: string[];
137
+ basisFields: string[];
138
+ compactOutputFields: string[];
139
+ reusePolicy?: string;
140
+ };
134
141
  usage: {
135
142
  codex: string;
136
143
  claude: string;
@@ -256,12 +256,13 @@ export function getPostFindLeadsScoutRegistry() {
256
256
  trigger: "find_leads_source_approved",
257
257
  requiredInputs: [
258
258
  "campaignId",
259
+ "campaign revision or campaignUpdatedAt",
259
260
  "campaignBrief",
260
261
  "source decision and selectedLeadList/source state",
261
262
  "workflowTableId",
262
- "imported review-batch rows from selectedLeadList",
263
+ "imported review-batch rows from selectedLeadList with row ids/hash",
264
+ "filter choice and filter/rubric basis when present",
263
265
  ],
264
- optionalDebugArtifacts: ["brief.md", "lead-review.md", "lead-sample.json"],
265
266
  scouts: scouts.map((agent) => ({
266
267
  id: String(agent.id || ""),
267
268
  name: String(agent.name || ""),
@@ -290,14 +291,57 @@ export function getPostFindLeadsScoutRegistry() {
290
291
  joinGate: {
291
292
  afterAllComplete: true,
292
293
  requiredState: ["leadScoringRubrics", "messageDraftRecommendation"],
293
- optionalDebugArtifacts: ["lead-filter.md", "message-validation.md"],
294
+ noFilterRequiredState: ["messageDraftRecommendation"],
295
+ skipFilterRule: "leadScoringRubrics may be absent only when the user explicitly skips filters with enableICPFilters=false; messageDraftRecommendation is still required before template review.",
294
296
  show: ["readable_filters_with_reasons", "sample_message_for_approval"],
295
297
  nextStage: "message-review",
296
298
  },
299
+ messageDraftBranchContract: {
300
+ firstAllowedStart: "after confirm_lead_list imports a non-empty bounded review batch and get_rows_minimal confirms rows for workflowTableId",
301
+ forbiddenStarts: [
302
+ "source recommendation",
303
+ "provider import job alone",
304
+ "zero-row review batch",
305
+ ],
306
+ runtimeProofTransport: "CampaignOffer.watchNarration.workerDetails.messageDraftBuilder",
307
+ runtimeProofRequiredFields: [
308
+ "runId or fallbackId",
309
+ "statusSource",
310
+ "status",
311
+ "startedAt",
312
+ "updatedAt",
313
+ "basisToken",
314
+ "basis.selectedLeadListId",
315
+ "basis.workflowTableId",
316
+ "basis.reviewBatchRowHash or basis.reviewBatchRowIds",
317
+ ],
318
+ basisFields: [
319
+ "campaign revision or updatedAt",
320
+ "brief hash",
321
+ "selectedLeadListId",
322
+ "workflowTableId",
323
+ "bounded review-batch row ids/hash",
324
+ "filter choice",
325
+ "filter/rubric basis when present",
326
+ ],
327
+ compactOutputFields: [
328
+ "templateRecommendation",
329
+ "tokenFillRules",
330
+ "renderedSample",
331
+ "concerns",
332
+ "status",
333
+ "basisStatus",
334
+ "basisToken",
335
+ "outputAt",
336
+ "outputHash",
337
+ "error or retry detail",
338
+ ],
339
+ reusePolicy: "The first completed Message Draft Builder recommendation remains the default review candidate. Later Lead Fit Builder, Filter Leads, enrichment, or rubric completion may make an enriched rewrite available, but does not automatically retry or replace the initial draft unless campaign/brief/source/list/table/review-batch identity mismatches or the initial output failed.",
340
+ },
297
341
  usage: {
298
342
  codex: "After the user approves or auto-confirms the lead source, spawn both returned scout `name` values in one assistant turn only when the current Codex host exposes those custom agents.",
299
343
  claude: "After lead source approval, invoke both returned Task/Agent subagents in one assistant message only when the current Claude session lists those agents, so filter-leads and message generation run concurrently.",
300
- parentThreadRule: "Named agents are optional acceleration. If they are absent, do not customer-surface install status; the main thread still orchestrates filter and message branches from CampaignOffer state, selected source state, workflowTableId, and imported review-batch rows. Debug markdown/json artifacts are optional only. The message branch must load the full generate-messages prompt and may use the create-campaign-v2 message-review safety gate as a supplemental approval check. Join before message review.",
344
+ parentThreadRule: "Named agents are optional acceleration. If they are absent, do not customer-surface install status; the main thread still orchestrates filter and message branches from CampaignOffer state, selected source state, workflowTableId, and imported review-batch rows. Local markdown/json files are not normal-path inputs. The message branch must load the full generate-messages prompt, must read live campaign/review-batch state through scoped MCP/product tools, must reject mismatched selectedLeadListId/workflowTableId/campaign/workspace input, and may use the create-campaign-v2 message-review safety gate as a supplemental approval check. Join before message review. Do not automatically rerun Message Draft Builder after filters/enrichment finish; show the initial draft by default and offer an enriched rewrite only with explicit user opt-in.",
301
345
  },
302
346
  };
303
347
  }
@@ -35,6 +35,7 @@ export type AttachRecommendedSequenceInput = {
35
35
  export type AttachRecommendedSequenceResponse = {
36
36
  success: boolean;
37
37
  version: number;
38
+ currentStep?: string;
38
39
  template?: {
39
40
  name?: string;
40
41
  entryNodeId?: string;
@@ -85,7 +85,7 @@ export const sequencerToolDefinitions = [
85
85
  },
86
86
  currentStep: {
87
87
  type: "string",
88
- description: "Optional CampaignOffer currentStep to persist with the sequence attach, usually 'send' after the recommended sequence is bound.",
88
+ description: "Optional CampaignOffer currentStep to persist atomically with the sequence attach, usually 'send' after the recommended sequence is bound. The backend writes the matching watch narration; do not follow with a separate step-only update_campaign fixup.",
89
89
  },
90
90
  },
91
91
  required: ["campaignId"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.135",
3
+ "version": "0.1.137",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",