@sellable/mcp 0.1.309 → 0.1.311

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.
@@ -165,10 +165,15 @@ When reporting branch runtime proof, use this shape under
165
165
  - `runId` or `fallbackId`
166
166
  - `startedAt` and `updatedAt`
167
167
  - `basisToken` and `basis`
168
+ - `basis.selectedLeadListId`, `basis.workflowTableId`, and either
169
+ `basis.reviewBatchRowHash` or non-empty `basis.reviewBatchRowIds`
168
170
  - optional `messageDraftOutputRef`, `messageDraftOutput`, and `error`
169
171
 
170
172
  Do not tell the UI to show Message Draft Builder as running unless this proof
171
173
  exists and points at the current non-empty campaign-table execution slice.
174
+ Use `workerStatuses.messageDraftBuilder` only for simple badge text such as
175
+ `running`; never put `runId`, `statusSource`, `status`, or `basis` under
176
+ `workerStatuses`, and never use a `messageDrafting` key.
172
177
  If the host cannot launch a background branch and the parent thread runs this
173
178
  same contract inline, report `statusSource: "parent-thread-fallback"` and
174
179
  `status: "fallback-active"` while working, then `status: "ready"` when the
@@ -416,6 +416,90 @@ export declare const campaignToolDefinitions: ({
416
416
  };
417
417
  workerStatuses: {
418
418
  type: string;
419
+ description: string;
420
+ properties: {
421
+ leadFitBuilder: {
422
+ type: string[];
423
+ enum: (string | null)[];
424
+ };
425
+ messageDraftBuilder: {
426
+ type: string[];
427
+ enum: (string | null)[];
428
+ };
429
+ };
430
+ additionalProperties: boolean;
431
+ };
432
+ workerDetails: {
433
+ type: string;
434
+ description: string;
435
+ properties: {
436
+ messageDraftBuilder: {
437
+ type: string[];
438
+ description: string;
439
+ properties: {
440
+ statusSource: {
441
+ type: string;
442
+ enum: string[];
443
+ };
444
+ status: {
445
+ type: string;
446
+ enum: string[];
447
+ };
448
+ runId: {
449
+ type: string[];
450
+ };
451
+ fallbackId: {
452
+ type: string[];
453
+ };
454
+ startedAt: {
455
+ type: string;
456
+ };
457
+ updatedAt: {
458
+ type: string;
459
+ };
460
+ basisToken: {
461
+ type: string[];
462
+ };
463
+ basis: {
464
+ type: string;
465
+ properties: {
466
+ campaignId: {
467
+ type: string[];
468
+ };
469
+ selectedLeadListId: {
470
+ type: string[];
471
+ };
472
+ workflowTableId: {
473
+ type: string[];
474
+ };
475
+ reviewBatchRowHash: {
476
+ type: string[];
477
+ };
478
+ reviewBatchRowIds: {
479
+ type: string[];
480
+ items: {
481
+ type: string;
482
+ };
483
+ };
484
+ filterChoice: {
485
+ type: string[];
486
+ };
487
+ };
488
+ };
489
+ messageDraftOutputRef: {
490
+ type: string[];
491
+ };
492
+ messageDraftOutput: {
493
+ type: string[];
494
+ };
495
+ error: {
496
+ type: string[];
497
+ };
498
+ };
499
+ required: string[];
500
+ };
501
+ };
502
+ additionalProperties: boolean;
419
503
  };
420
504
  };
421
505
  required: string[];
@@ -531,6 +615,90 @@ export declare const campaignToolDefinitions: ({
531
615
  };
532
616
  workerStatuses: {
533
617
  type: string;
618
+ description: string;
619
+ properties: {
620
+ leadFitBuilder: {
621
+ type: string[];
622
+ enum: (string | null)[];
623
+ };
624
+ messageDraftBuilder: {
625
+ type: string[];
626
+ enum: (string | null)[];
627
+ };
628
+ };
629
+ additionalProperties: boolean;
630
+ };
631
+ workerDetails: {
632
+ type: string;
633
+ description: string;
634
+ properties: {
635
+ messageDraftBuilder: {
636
+ type: string[];
637
+ description: string;
638
+ properties: {
639
+ statusSource: {
640
+ type: string;
641
+ enum: string[];
642
+ };
643
+ status: {
644
+ type: string;
645
+ enum: string[];
646
+ };
647
+ runId: {
648
+ type: string[];
649
+ };
650
+ fallbackId: {
651
+ type: string[];
652
+ };
653
+ startedAt: {
654
+ type: string;
655
+ };
656
+ updatedAt: {
657
+ type: string;
658
+ };
659
+ basisToken: {
660
+ type: string[];
661
+ };
662
+ basis: {
663
+ type: string;
664
+ properties: {
665
+ campaignId: {
666
+ type: string[];
667
+ };
668
+ selectedLeadListId: {
669
+ type: string[];
670
+ };
671
+ workflowTableId: {
672
+ type: string[];
673
+ };
674
+ reviewBatchRowHash: {
675
+ type: string[];
676
+ };
677
+ reviewBatchRowIds: {
678
+ type: string[];
679
+ items: {
680
+ type: string;
681
+ };
682
+ };
683
+ filterChoice: {
684
+ type: string[];
685
+ };
686
+ };
687
+ };
688
+ messageDraftOutputRef: {
689
+ type: string[];
690
+ };
691
+ messageDraftOutput: {
692
+ type: string[];
693
+ };
694
+ error: {
695
+ type: string[];
696
+ };
697
+ };
698
+ required: string[];
699
+ };
700
+ };
701
+ additionalProperties: boolean;
534
702
  };
535
703
  };
536
704
  required: string[];
@@ -10,6 +10,99 @@ const LEAD_SOURCE_PROVIDERS = {
10
10
  PROSPEO: "prospeo",
11
11
  SIGNAL_DISCOVERY: "signal-discovery",
12
12
  };
13
+ const WATCH_NARRATION_TOOL_SCHEMA = {
14
+ type: "object",
15
+ description: "Single structured watch-guide narration object to send with currentStep changes. Include what just happened, what the browser is showing now, what Codex is doing next, and nextAction so the browser guide mirrors Codex progress. Do not send separate guideHeadline/guideBody fields. Use workerStatuses only for simple string badges; put Message Drafting runtime proof under workerDetails.messageDraftBuilder.",
16
+ properties: {
17
+ stage: {
18
+ type: "string",
19
+ enum: [
20
+ "brief-review",
21
+ "find-leads",
22
+ "review-batch",
23
+ "fit-message",
24
+ "review-ready",
25
+ ],
26
+ },
27
+ headline: { type: "string" },
28
+ visibleState: { type: "string" },
29
+ agentIntent: { type: "string" },
30
+ nextAction: { type: ["string", "null"] },
31
+ safety: { type: ["string", "null"] },
32
+ progressLabel: { type: ["string", "null"] },
33
+ blockedReason: { type: ["string", "null"] },
34
+ workerStatuses: {
35
+ type: "object",
36
+ description: 'Simple display badges only. Allowed keys are leadFitBuilder and messageDraftBuilder; values are "idle", "running", "ready", "blocked", or null. Do not put runId, statusSource, basis, or rich worker proof here.',
37
+ properties: {
38
+ leadFitBuilder: {
39
+ type: ["string", "null"],
40
+ enum: ["idle", "running", "ready", "blocked", null],
41
+ },
42
+ messageDraftBuilder: {
43
+ type: ["string", "null"],
44
+ enum: ["idle", "running", "ready", "blocked", null],
45
+ },
46
+ },
47
+ additionalProperties: false,
48
+ },
49
+ workerDetails: {
50
+ type: "object",
51
+ description: "Rich runtime proof for background workers. Message Drafting proof must use workerDetails.messageDraftBuilder, not workerStatuses.messageDrafting.",
52
+ properties: {
53
+ messageDraftBuilder: {
54
+ type: ["object", "null"],
55
+ description: 'Runtime proof that Message Drafting actually started or fell back inline. For a spawned background worker use statusSource "branch" and status "branch-running"; for inline fallback use statusSource "parent-thread-fallback" and status "fallback-active". The basis must include selectedLeadListId, workflowTableId, and either reviewBatchRowHash or reviewBatchRowIds so the watched UI can trust the current execution slice.',
56
+ properties: {
57
+ statusSource: {
58
+ type: "string",
59
+ enum: ["branch", "parent-thread-fallback"],
60
+ },
61
+ status: {
62
+ type: "string",
63
+ enum: [
64
+ "branch-running",
65
+ "fallback-active",
66
+ "spawn-failed",
67
+ "fallback-superseded",
68
+ "branch-superseded",
69
+ "ready",
70
+ "blocked",
71
+ "retry-needed",
72
+ "stale",
73
+ ],
74
+ },
75
+ runId: { type: ["string", "null"] },
76
+ fallbackId: { type: ["string", "null"] },
77
+ startedAt: { type: "string" },
78
+ updatedAt: { type: "string" },
79
+ basisToken: { type: ["string", "null"] },
80
+ basis: {
81
+ type: "object",
82
+ properties: {
83
+ campaignId: { type: ["string", "null"] },
84
+ selectedLeadListId: { type: ["string", "null"] },
85
+ workflowTableId: { type: ["string", "null"] },
86
+ reviewBatchRowHash: { type: ["string", "null"] },
87
+ reviewBatchRowIds: {
88
+ type: ["array", "null"],
89
+ items: { type: "string" },
90
+ },
91
+ filterChoice: { type: ["string", "null"] },
92
+ },
93
+ },
94
+ messageDraftOutputRef: { type: ["string", "null"] },
95
+ messageDraftOutput: { type: ["object", "null"] },
96
+ error: { type: ["string", "null"] },
97
+ },
98
+ required: ["statusSource", "status", "startedAt", "updatedAt", "basis"],
99
+ },
100
+ },
101
+ additionalProperties: false,
102
+ },
103
+ },
104
+ required: ["stage", "headline", "visibleState", "agentIntent", "nextAction"],
105
+ };
13
106
  function normalizeLeadSourceProvider(input) {
14
107
  if (!input)
15
108
  return null;
@@ -236,37 +329,7 @@ export const campaignToolDefinitions = [
236
329
  type: ["string", "null"],
237
330
  description: "Workflow step ID (headless or UI step ID such as filter-rules)",
238
331
  },
239
- watchNarration: {
240
- type: "object",
241
- description: "Single structured watch-guide narration object to send with currentStep changes. Include what just happened, what the browser is showing now, what Codex is doing next, and nextAction so the browser guide mirrors Codex progress.",
242
- properties: {
243
- stage: {
244
- type: "string",
245
- enum: [
246
- "brief-review",
247
- "find-leads",
248
- "review-batch",
249
- "fit-message",
250
- "review-ready",
251
- ],
252
- },
253
- headline: { type: "string" },
254
- visibleState: { type: "string" },
255
- agentIntent: { type: "string" },
256
- nextAction: { type: ["string", "null"] },
257
- safety: { type: ["string", "null"] },
258
- progressLabel: { type: ["string", "null"] },
259
- blockedReason: { type: ["string", "null"] },
260
- workerStatuses: { type: "object" },
261
- },
262
- required: [
263
- "stage",
264
- "headline",
265
- "visibleState",
266
- "agentIntent",
267
- "nextAction",
268
- ],
269
- },
332
+ watchNarration: WATCH_NARRATION_TOOL_SCHEMA,
270
333
  leadSourceType: {
271
334
  type: ["string", "null"],
272
335
  description: "Lead source type (existing | new)",
@@ -344,37 +407,7 @@ export const campaignToolDefinitions = [
344
407
  type: "string",
345
408
  description: "Guarded manual recovery clear. currentStep:null is accepted only when this matches the durable step being cleared.",
346
409
  },
347
- watchNarration: {
348
- type: "object",
349
- description: "Single structured watch-guide narration object to send with currentStep changes. Include what just happened, what the browser is showing now, what Codex is doing next, and nextAction so the browser guide mirrors Codex progress. Do not send separate guideHeadline/guideBody fields.",
350
- properties: {
351
- stage: {
352
- type: "string",
353
- enum: [
354
- "brief-review",
355
- "find-leads",
356
- "review-batch",
357
- "fit-message",
358
- "review-ready",
359
- ],
360
- },
361
- headline: { type: "string" },
362
- visibleState: { type: "string" },
363
- agentIntent: { type: "string" },
364
- nextAction: { type: ["string", "null"] },
365
- safety: { type: ["string", "null"] },
366
- progressLabel: { type: ["string", "null"] },
367
- blockedReason: { type: ["string", "null"] },
368
- workerStatuses: { type: "object" },
369
- },
370
- required: [
371
- "stage",
372
- "headline",
373
- "visibleState",
374
- "agentIntent",
375
- "nextAction",
376
- ],
377
- },
410
+ watchNarration: WATCH_NARRATION_TOOL_SCHEMA,
378
411
  interactionMode: {
379
412
  type: "string",
380
413
  enum: ["step-by-step", "autonomous", "ask-when-needed"],
@@ -331,8 +331,8 @@ export function getPostFindLeadsScoutRegistry() {
331
331
  "basis.campaignId",
332
332
  "basis.selectedLeadListId",
333
333
  "basis.workflowTableId",
334
- "basis.currentExecutionSliceNonEmpty",
335
- "basis.sampleRows or basis.sampleRowSummary",
334
+ "basis.reviewBatchRowHash or basis.reviewBatchRowIds",
335
+ "basis.filterChoice",
336
336
  ],
337
337
  promptRequired: 'Load current campaign brief/table state through scoped tools. Before drafting: get_subskill_prompt({ subskillName: "generate-messages" }); every required message asset named by generate-messages Mode 0 through get_subskill_asset, including gold-standard-message-examples.md, gold-standard-message-patterns.md, ai-tells.md, sellable-cleanup-rules.md, ai-native-tokens.md, and token-fill-examples.md. Do not use shell/local filesystem reads, repo paths, plugin-cache paths, /Users paths, local artifacts, alternate prompts, or examples-only prompts. After candidate generation/revision and before returning ready: get_subskill_prompt({ subskillName: "create-campaign-v2-validation" }) as the final internal validation gate. If required prompts/assets cannot load through MCP tools, return blocked/retry-needed instead of drafting from memory.',
338
338
  basisFields: [
@@ -342,6 +342,7 @@ export function getPostFindLeadsScoutRegistry() {
342
342
  "selectedLeadListId",
343
343
  "workflowTableId",
344
344
  "filter choice",
345
+ "runtime proof row identity: reviewBatchRowHash or reviewBatchRowIds",
345
346
  "concise brief summary: offer, buyer, safe proof, blocked claims",
346
347
  "concise source summary and source-use rule",
347
348
  "3-5 sample campaign-table rows with name, title, company when available, and signal",
@@ -363,9 +364,9 @@ export function getPostFindLeadsScoutRegistry() {
363
364
  reusePolicy: "The first completed Message Drafting 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/execution-slice identity mismatches or the initial output failed. If filters were chosen but leadScoringRubrics are not yet visible when the branch reads campaign state, Message Drafting must not wait, retry, or return blocked; missing saved rubrics are parent-owned filter setup, and the branch should return status ready with basisStatus usable_initial when campaign/list/table identity and the non-empty execution slice match. User copy feedback before approve-message is an explicit Message Drafting revision and must be routed back through the message branch with the current recommendation and basis.",
364
365
  },
365
366
  usage: {
366
- 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. If no background-agent tool is callable, start the same full message branch inline before filter drafting or before skip-filter message review, record it as statusSource parent-thread-fallback, 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.",
367
+ 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.',
367
368
  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.",
368
- 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. If no background-agent tool is callable, start that same full message branch inline before filter drafting or before skip-filter message review, record 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 the campaign/list/table and 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.',
369
+ 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.',
369
370
  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 or a send count. For "prepare/generate X messages", set targetPreparedMessages:X, omit maxRowsToCheck so the backend calibrates on at least 100 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. Poll get_campaign_message_preparation_status and summarize preparation-job status: checked rows, passed/prepared/approved count, target, estimated row budget remaining, and stop reason. For "approve X messages", use approvalMode:approve but still do not launch. For "schedule X 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.',
370
371
  },
371
372
  };
@@ -1110,6 +1110,90 @@ export declare const allTools: ({
1110
1110
  };
1111
1111
  workerStatuses: {
1112
1112
  type: string;
1113
+ description: string;
1114
+ properties: {
1115
+ leadFitBuilder: {
1116
+ type: string[];
1117
+ enum: (string | null)[];
1118
+ };
1119
+ messageDraftBuilder: {
1120
+ type: string[];
1121
+ enum: (string | null)[];
1122
+ };
1123
+ };
1124
+ additionalProperties: boolean;
1125
+ };
1126
+ workerDetails: {
1127
+ type: string;
1128
+ description: string;
1129
+ properties: {
1130
+ messageDraftBuilder: {
1131
+ type: string[];
1132
+ description: string;
1133
+ properties: {
1134
+ statusSource: {
1135
+ type: string;
1136
+ enum: string[];
1137
+ };
1138
+ status: {
1139
+ type: string;
1140
+ enum: string[];
1141
+ };
1142
+ runId: {
1143
+ type: string[];
1144
+ };
1145
+ fallbackId: {
1146
+ type: string[];
1147
+ };
1148
+ startedAt: {
1149
+ type: string;
1150
+ };
1151
+ updatedAt: {
1152
+ type: string;
1153
+ };
1154
+ basisToken: {
1155
+ type: string[];
1156
+ };
1157
+ basis: {
1158
+ type: string;
1159
+ properties: {
1160
+ campaignId: {
1161
+ type: string[];
1162
+ };
1163
+ selectedLeadListId: {
1164
+ type: string[];
1165
+ };
1166
+ workflowTableId: {
1167
+ type: string[];
1168
+ };
1169
+ reviewBatchRowHash: {
1170
+ type: string[];
1171
+ };
1172
+ reviewBatchRowIds: {
1173
+ type: string[];
1174
+ items: {
1175
+ type: string;
1176
+ };
1177
+ };
1178
+ filterChoice: {
1179
+ type: string[];
1180
+ };
1181
+ };
1182
+ };
1183
+ messageDraftOutputRef: {
1184
+ type: string[];
1185
+ };
1186
+ messageDraftOutput: {
1187
+ type: string[];
1188
+ };
1189
+ error: {
1190
+ type: string[];
1191
+ };
1192
+ };
1193
+ required: string[];
1194
+ };
1195
+ };
1196
+ additionalProperties: boolean;
1113
1197
  };
1114
1198
  };
1115
1199
  required: string[];
@@ -1225,6 +1309,90 @@ export declare const allTools: ({
1225
1309
  };
1226
1310
  workerStatuses: {
1227
1311
  type: string;
1312
+ description: string;
1313
+ properties: {
1314
+ leadFitBuilder: {
1315
+ type: string[];
1316
+ enum: (string | null)[];
1317
+ };
1318
+ messageDraftBuilder: {
1319
+ type: string[];
1320
+ enum: (string | null)[];
1321
+ };
1322
+ };
1323
+ additionalProperties: boolean;
1324
+ };
1325
+ workerDetails: {
1326
+ type: string;
1327
+ description: string;
1328
+ properties: {
1329
+ messageDraftBuilder: {
1330
+ type: string[];
1331
+ description: string;
1332
+ properties: {
1333
+ statusSource: {
1334
+ type: string;
1335
+ enum: string[];
1336
+ };
1337
+ status: {
1338
+ type: string;
1339
+ enum: string[];
1340
+ };
1341
+ runId: {
1342
+ type: string[];
1343
+ };
1344
+ fallbackId: {
1345
+ type: string[];
1346
+ };
1347
+ startedAt: {
1348
+ type: string;
1349
+ };
1350
+ updatedAt: {
1351
+ type: string;
1352
+ };
1353
+ basisToken: {
1354
+ type: string[];
1355
+ };
1356
+ basis: {
1357
+ type: string;
1358
+ properties: {
1359
+ campaignId: {
1360
+ type: string[];
1361
+ };
1362
+ selectedLeadListId: {
1363
+ type: string[];
1364
+ };
1365
+ workflowTableId: {
1366
+ type: string[];
1367
+ };
1368
+ reviewBatchRowHash: {
1369
+ type: string[];
1370
+ };
1371
+ reviewBatchRowIds: {
1372
+ type: string[];
1373
+ items: {
1374
+ type: string;
1375
+ };
1376
+ };
1377
+ filterChoice: {
1378
+ type: string[];
1379
+ };
1380
+ };
1381
+ };
1382
+ messageDraftOutputRef: {
1383
+ type: string[];
1384
+ };
1385
+ messageDraftOutput: {
1386
+ type: string[];
1387
+ };
1388
+ error: {
1389
+ type: string[];
1390
+ };
1391
+ };
1392
+ required: string[];
1393
+ };
1394
+ };
1395
+ additionalProperties: boolean;
1228
1396
  };
1229
1397
  };
1230
1398
  required: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.309",
3
+ "version": "0.1.311",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -965,6 +965,13 @@ updates.
965
965
  background-agent tool is callable, start the same full message branch inline
966
966
  before filter drafting or skip-filter message review and record it as
967
967
  `statusSource: "parent-thread-fallback"`.
968
+ After a spawned branch starts, persist rich proof under
969
+ `watchNarration.workerDetails.messageDraftBuilder` with
970
+ `statusSource: "branch"`, `status: "branch-running"`, `runId`, timestamps,
971
+ selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or
972
+ reviewBatchRowIds. `workerStatuses.messageDraftBuilder` is only the optional
973
+ simple badge (`running`); never put rich proof under `workerStatuses` or use
974
+ a `messageDrafting` key.
968
975
  Do not use any alternate, examples-only, or local-artifact message prompt. Message review and
969
976
  message QA require Message Drafting output:
970
977
  do not draft from a checklist, local markdown artifact, or parent-thread
@@ -273,7 +273,7 @@ customer-facing source-choice labels.
273
273
 
274
274
  After `confirm_lead_list` copies source rows and records the review batch, ask the filter-choice question immediately. Do not call `get_post_find_leads_scout_registry`, load filter/message prompts, or spawn Message Drafting before that question. Before it: short setup summary plus add filters, skip filters, or revise source; no extra watch link.
275
275
 
276
- After filter choice, the only normal background worker is Message Drafting (`post-find-leads-message-scout`). The registry lookup is not a launch. Both choices must run this kickoff: call the registry, then start Message Drafting via `Task`/`spawn_agent` before filter refs, `save_rubrics`, or skip review. YOLO follows the same no-extra-question kickoff rule. If no background tool is callable, run the same full branch inline as `parent-thread-fallback`; otherwise return `blocked` / `retry-needed`. `update_campaign({ currentStep: "messages" })` is not proof of kickoff.
276
+ After filter choice, the only normal background worker is Message Drafting (`post-find-leads-message-scout`). The registry lookup is not a launch. Both choices must run this kickoff: call the registry, then start Message Drafting via `Task`/`spawn_agent` before filter refs, `save_rubrics`, or skip review. YOLO follows the same no-extra-question kickoff rule. If no background tool is callable, run the same full branch inline as `parent-thread-fallback`; otherwise return `blocked` / `retry-needed`. `update_campaign({ currentStep: "messages" })` is not proof of kickoff. After launch, persist rich proof under `watchNarration.workerDetails.messageDraftBuilder` with `statusSource: "branch"`, `status: "branch-running"`, `runId`, timestamps, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds; `workerStatuses.messageDraftBuilder` is only the optional simple badge (`running`). Never put rich proof under `workerStatuses` or use a `messageDrafting` key.
277
277
 
278
278
  Parent thread writes filters. On the filters path, start Message Drafting, load `references/filter-leads.md`, save rubrics, and ask users to approve saved criteria. Keep Filter Rules until criteria approval. After approval, move to `currentStep: "apply-icp-rubric"` so the app shows Filter Leads while Message Drafting finishes; no cells until template approval. Say Message Drafting is preparing it.
279
279
 
@@ -202,6 +202,23 @@ After confirmed source rows are copied:
202
202
  "workerStatuses": {
203
203
  "leadFitBuilder": "idle",
204
204
  "messageDraftBuilder": "running"
205
+ },
206
+ "workerDetails": {
207
+ "messageDraftBuilder": {
208
+ "statusSource": "branch",
209
+ "status": "branch-running",
210
+ "runId": "message-drafting-thread-id",
211
+ "startedAt": "2026-05-09T10:00:00.000Z",
212
+ "updatedAt": "2026-05-09T10:00:00.000Z",
213
+ "basisToken": "message-drafting-basis-1",
214
+ "basis": {
215
+ "campaignId": "campaign-id",
216
+ "selectedLeadListId": "source-lead-list-id",
217
+ "workflowTableId": "campaign-table-id",
218
+ "reviewBatchRowHash": "review-batch-hash",
219
+ "filterChoice": "use-filters"
220
+ }
221
+ }
205
222
  }
206
223
  }
207
224
  ```
@@ -214,6 +231,9 @@ Any cleanup/manual-review row means recommend light filters by default. This is
214
231
  a user decision gate, not active filtering; do not say filtering the batch before
215
232
  rubrics are saved. Message Drafting should start after the filter-choice answer;
216
233
  mark it running only when that branch actually started.
234
+ `workerStatuses.messageDraftBuilder` is a simple badge only. Put branch runtime
235
+ proof under `workerDetails.messageDraftBuilder`; do not put rich objects under
236
+ `workerStatuses`, and do not use a `messageDrafting` key.
217
237
  When the user chooses filters, immediately persist `enableICPFilters: true` and
218
238
  move to `create-icp-rubric` so the watched app shows Filter Rules while Codex
219
239
  defines the rules in chat. After `save_rubrics`, keep the app on Filter Rules so