@sellable/mcp 0.1.305 → 0.1.307

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
@@ -1143,16 +1143,17 @@ function buildSignalDiscoverySourceRecommendation({ selectedPosts, targetEngager
1143
1143
  const recommendedCount = recommendedPosts.length;
1144
1144
  const totalVisibleEngagement = normalizedSelectedPosts.reduce((sum, post) => sum + post.likes + post.comments, 0);
1145
1145
  const recommendedVisibleEngagement = recommendedPosts.reduce((sum, post) => sum + post.likes + post.comments, 0);
1146
+ const fitRateForEstimate = targetEngagerCount && effectiveTargetEngagerCount > 0
1147
+ ? Math.min(1, targetGoodFitLeads / effectiveTargetEngagerCount)
1148
+ : defaultFitRate;
1149
+ const estimatedGoodFit = scrapePlan.estimatedEngagers * fitRateForEstimate;
1146
1150
  const tableRows = recommendedPosts
1147
1151
  .map((post) => {
1148
1152
  const engagement = post.likes + post.comments;
1149
- return `| ${escapeMarkdownTableCell(post.authorName)} | ${escapeMarkdownTableCell(post.reason)} | ${formatApproxInteger(engagement)} | ${formatApproxInteger(estimateScrapableSignalEngagers(post))} |`;
1153
+ const estimatedPostGoodFit = estimateScrapableSignalEngagers(post) * fitRateForEstimate;
1154
+ return `| ${escapeMarkdownTableCell(post.authorName)} | ${escapeMarkdownTableCell(post.reason)} | ${formatApproxInteger(engagement)} | ${formatApproxInteger(estimatedPostGoodFit)} |`;
1150
1155
  })
1151
1156
  .join("\n");
1152
- const fitRateForEstimate = targetEngagerCount && effectiveTargetEngagerCount > 0
1153
- ? Math.min(1, targetGoodFitLeads / effectiveTargetEngagerCount)
1154
- : defaultFitRate;
1155
- const estimatedGoodFit = scrapePlan.estimatedEngagers * fitRateForEstimate;
1156
1157
  const fitRateLabel = targetEngagerCount && effectiveTargetEngagerCount > 0
1157
1158
  ? "the approved buyer-search target"
1158
1159
  : `the ${Math.round(defaultFitRate * 100)}% starting estimate`;
@@ -1172,7 +1173,7 @@ I found ${recommendedCount.toLocaleString("en-US")} recommended LinkedIn post${r
1172
1173
 
1173
1174
  ### Recommended posts
1174
1175
 
1175
- | Post | Why this post | Public activity | People we can check |
1176
+ | Post | Why this post | Public activity | Est. likely prospects |
1176
1177
  |---|---|---:|---:|
1177
1178
  ${tableRows || "| Recommended posts | Campaign-matched public activity | - | - |"}
1178
1179
 
@@ -363,9 +363,9 @@ export function getPostFindLeadsScoutRegistry() {
363
363
  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
364
  },
365
365
  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 whenever Codex agent-launch policy is satisfied. 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. Treat YOLO/autonomous mode as campaign-scoped permission for this single post-import worker; do not ask for another permission click in YOLO. If the user has not enabled YOLO and has not explicitly asked for background agents/subagents/parallel agents/delegation/message bg agent in this campaign, ask once before loading the long message prompt in the parent. If permission is granted and 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.",
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
367
  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. YOLO/autonomous mode counts as campaign-scoped permission for this single post-import worker; do not ask for another permission click in YOLO. If a named agent is unavailable after permission, 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 fall back to parent-thread message drafting; the main thread must 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.',
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
369
  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
370
  },
371
371
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.305",
3
+ "version": "0.1.307",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -406,8 +406,11 @@ summary should be a compact `## Source Recommendation` block with:
406
406
  - first review: after the source list exists, add confirmed source rows to the
407
407
  campaign and review the first 15 leads before scaling
408
408
  - a selected-post table with post author/topic, why it fits, public activity,
409
- and people we can check
410
- - total public activity and likely prospect pool
409
+ and estimated likely prospects. Calculate each row's estimated likely
410
+ prospects from the sampled fit rate when available, otherwise from the stated
411
+ starting estimate; never duplicate public activity or people-to-check counts in
412
+ this column.
413
+ - total public activity, people to check, and likely prospect pool
411
414
  - next step: build the source list, add it to the campaign, and review the
412
415
  first 15 leads before scaling
413
416
  - fallback: switch to active LinkedIn profiles if the first sample is too noisy
@@ -939,17 +942,14 @@ updates.
939
942
  through `mcp__sellable__get_subskill_asset`, and before returning
940
943
  `mcp__sellable__get_subskill_prompt({ subskillName: "create-campaign-v2-validation" })`
941
944
  as the final internal validation gate.
942
- In Codex, YOLO/autonomous mode counts as campaign-scoped permission to use
943
- this single Message Drafting background agent. If the user has not enabled
944
- YOLO and has not explicitly asked for background agents, subagents, parallel
945
- agents, delegation, or a message/bg agent in this campaign, ask once for
946
- permission before loading the long message prompt in the parent. If
947
- permission is granted but the named custom agent is not
945
+ In Codex, the filter-choice answer is the campaign-scoped go-ahead to use
946
+ this single Message Drafting background agent in step-wise and YOLO modes.
947
+ Do not ask a separate question to start it. If the named custom agent is not
948
948
  available, spawn a generic background agent with `model: "gpt-5.5"` and
949
- `reasoning_effort: "xhigh"` using the same lean campaign/table basis. Do not
950
- silently fall back to parent-thread message drafting; parent fallback is
951
- allowed only when the user explicitly says to continue without a background
952
- agent.
949
+ `reasoning_effort: "xhigh"` using the same lean campaign/table basis. If no
950
+ background-agent tool is callable, start the same full message branch inline
951
+ before filter drafting or skip-filter message review and record it as
952
+ `statusSource: "parent-thread-fallback"`.
953
953
  Do not use any alternate, examples-only, or local-artifact message prompt. Message review and
954
954
  message QA require Message Drafting output:
955
955
  do not draft from a checklist, local markdown artifact, or parent-thread
@@ -252,9 +252,10 @@ After `import_leads`, poll `wait_for_lead_list_ready` until ready, failed, or
252
252
  cancelled. Rows appearing is not enough for `confirm_lead_list`; use
253
253
  `allowPartialSourceList: true` only when the user explicitly asks to continue early.
254
254
 
255
- For LinkedIn engagement, the Start Import approval uses `## Source
256
- Recommendation`, plain language, selected posts, people to check, likely
257
- prospects, cleanup risk, fallback, and the first 15-lead review.
255
+ For LinkedIn engagement, Start Import uses `## Source Recommendation`: selected
256
+ posts, people to check, likely prospects, cleanup risk, fallback, first 15-lead
257
+ review. Tables show public activity + est. likely prospects, not duplicate
258
+ people-to-check; rows = fit rate * checkable people.
258
259
 
259
260
  A source recommendation must show source path, filters/recipe, raw volume,
260
261
  sample size, sampled fits as n/N plus percentage/range, estimated usable
@@ -272,7 +273,7 @@ customer-facing source-choice labels.
272
273
 
273
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.
274
275
 
275
- 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: do not ask for another permission click. 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.
276
277
 
277
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.
278
279
 
@@ -267,6 +267,10 @@ For LinkedIn engagement, the second gate is not "approve source" in the abstract
267
267
  It is a concrete scrape approval: show a compact `## Source Recommendation`
268
268
  with the ~300 likely-prospect goal, people-to-check count, selected-post table,
269
269
  total public activity, likely prospect pool, first-review checkpoint, and fallback.
270
+ In the selected-post table, show public activity beside estimated likely
271
+ prospects. Do not duplicate the people-to-check/raw public-activity number in the
272
+ second numeric column; calculate row-level likely prospects from sampled fit rate
273
+ when available or the stated starting estimate.
270
274
  Keep the 10% planning floor as plain "at least 10% of the first sample should
271
275
  look like real prospects." The approval question should be
272
276
  "Approve scraping N recommended LinkedIn posts?" where N comes from the
@@ -333,15 +337,13 @@ brief/context, full `generate-messages` prompt, all referenced assets, and
333
337
  `create-campaign-v2-validation` inside its own branch before returning
334
338
  review-ready output.
335
339
 
336
- Only promise Message Drafting background work when it actually started. If the
337
- host cannot or should not launch that branch, do not silently move the long
338
- message prompt into the parent thread. In Codex, ask once for permission to use
339
- the post-import background agent. If the user declines, asks to continue without
340
- background agents, or no background tool is callable, use an explicit
341
- `parent-thread-fallback`: run the same Message Drafting branch inline, load the
342
- same live campaign/table context, prompt, assets, and validation gate, and record
343
- the fallback as the worker source instead of reporting a background failure. Say
344
- the real sequence:
340
+ Only promise Message Drafting background work when it actually started. The
341
+ filter-choice answer is the post-import gate for this single worker, so do not
342
+ ask another question before kickoff. If no background tool is callable, use an
343
+ explicit `parent-thread-fallback`: run the same Message Drafting branch inline,
344
+ load the same live campaign/table context, prompt, assets, and validation gate,
345
+ and record the fallback as the worker source instead of reporting a background
346
+ failure. Say the real sequence:
345
347
 
346
348
  ```text
347
349
  I’ll tighten the filter first, then run message generation from the same sample.