@sellable/mcp 0.1.461 → 0.1.462

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.
@@ -373,7 +373,7 @@ export function getPostFindLeadsScoutRegistry() {
373
373
  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.',
374
374
  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.",
375
375
  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.',
376
- prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, the sender/campaign/action approval packet must be asked through request_user_input/AskUserQuestion with exactly Accept and Decline; do not use plain chat approval. The approval question body must show workspace, sender scope, a campaign-by-campaign table, exact ids/caps/dates, side effects, forbidden actions, and stop condition before mutation. Default --yolo horizon is a two-send-day horizon: two sender-local send days, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus future scheduler-owned scheduled sends and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting future scheduled and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a horizon saturation ledger per selected sender with selected send days, gross capacity, future scheduler-owned scheduled counts, ready-to-schedule buffer, remaining scheduled gap, remaining ready-or-scheduled gap, and the next MCP primitive. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/start result, recompute the horizon saturation ledger, and keep going until scheduler-owned scheduledFor cells fill the requested horizon or a concrete blocker/timeout is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the gap but scheduled cells do not, run a bounded scheduler-settle loop and report awaiting_scheduler_after_ready_buffer as not complete when timeout is reached. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor fill the requested horizon, and never call them complete unless a final re-read proves the same. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if scheduler-owned scheduledFor cells are not present, report prepared/approved/ready - awaiting scheduler instead of success. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
376
+ prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, the sender/campaign/action approval packet must be asked through request_user_input/AskUserQuestion with exactly Accept and Decline; do not use plain chat approval. The approval question body must show workspace, sender scope, a campaign-by-campaign table, exact ids/caps/dates, side effects, forbidden actions, and stop condition before mutation. Default --yolo horizon is a two-send-day horizon: two sender-local send days, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus projected coverage (actual sent plus future scheduler-owned scheduled sends) and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting actual sent coverage, future scheduled rows, and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a horizon saturation ledger per selected sender with selected send days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected coverage, ready-to-schedule buffer, remaining projected gap, paid-InMail threshold feasibility, and the next MCP primitive. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/start result, recompute the horizon saturation ledger, and keep going until projected coverage (sent + scheduled) fills the requested horizon or a concrete blocker/timeout is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the projected gap but scheduled cells do not, run a bounded scheduler-settle loop and report awaiting_scheduler_after_ready_buffer as not complete when timeout is reached. Paid-InMail threshold changes and connection-campaign creation are explicit continuation options, never --yolo side effects. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health and paid-InMail threshold blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor contribute to projected coverage, and never call them complete unless a final re-read proves projected coverage fills the requested horizon. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if projected coverage does not fill the horizon, report prepared/approved/ready - awaiting scheduler instead of success. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
377
377
  },
378
378
  };
379
379
  }
@@ -149,8 +149,8 @@ export function refillSendsCommand(input = {}) {
149
149
  : ""}${senders.length > 0 ? `, senders: ${JSON.stringify(senders)}` : ""}${untilDate
150
150
  ? `, untilDate: "${untilDate}"`
151
151
  : `, horizonSendDays: ${horizonSendDays}`}, approvalMode: "${approvalMode}" }) before any import, prep, approval, start, or schedule-affecting action.`,
152
- "If get_refill_target_plan returns status complete, report gross target, selected days, scheduled count, campaign ids, targetShapeRevision, and no-op proof without asking for approval.",
153
- "If remainingReadyOrScheduledGap is 0 but remainingScheduledGap is positive, run only a bounded read-only scheduler settle/reread loop; do not ask for prep/import/approval.",
152
+ "If get_refill_target_plan returns status complete, report eligible sender ledger, gross target, selected days, sent count, scheduled count, projected count, campaign ids, targetShapeRevision, and no-op proof without asking for approval.",
153
+ "If remainingReadyOrProjectedGap is 0 but remainingProjectedGap is positive, run only a bounded read-only scheduler settle/reread loop; do not ask for prep/import/approval.",
154
154
  `Resolve route with resolve_campaign_fill_route({ intent: "${intent}"${input.campaignId ? `, campaignId: "${input.campaignId}"` : ""}${input.tableId ? `, tableId: "${input.tableId}"` : ""} }).`,
155
155
  'If the plain route shows stale managed waterfall evidence, archived/completed shared slots, or targets that do not cover the selected sender set, immediately call resolve_campaign_fill_route({ intent: "active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked.',
156
156
  "Call list_senders and get_sender_routing, then resolve sender selectors against active enrolled campaign-backed sequence senders.",
@@ -160,17 +160,20 @@ export function refillSendsCommand(input = {}) {
160
160
  "Read get_campaign_refill_state for enough exact candidate campaigns to pick the best per-sender target by recent/future scheduler-owned sends, then recent result evidence, then source health.",
161
161
  "Treat current dashboard-active PAUSED campaign-backed sequence campaigns as start-eligible candidates: read refill state before deciding whether to prep, approve, start, or skip.",
162
162
  "Fresh reread get_campaign_refill_state immediately before any import, prep, approval, or horizon-fill mutation.",
163
- "Maintain a target-led horizon saturation ledger per selected sender from get_refill_target_plan: selected days, gross capacity, future scheduler-owned scheduled counts, ready-to-schedule buffer, remaining scheduled gap, remaining ready-or-scheduled gap, targetShapeRevision, stateRevision, and next MCP primitive.",
164
- "In --yolo or after one Accept, continue through every safe selected sender/campaign action covered by the rendered target packet; scheduled-count progress changes stateRevision and should continue while targetShapeRevision is stable.",
165
- "Do not complete a fill/schedule request until a final get_campaign_refill_state reread proves scheduler-owned scheduledFor cells fill the horizon, or report a concrete blocker such as awaiting_scheduler_after_ready_buffer.",
163
+ "Maintain a target-led horizon saturation ledger per selected sender from get_refill_target_plan: selected days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected counts, ready-to-schedule buffer, remaining projected gap, paid InMail threshold feasibility, targetShapeRevision, stateRevision, and next MCP primitive.",
164
+ "If paid InMail feasibility is below threshold, stale, or missing, report the exact sender/campaign/table/column threshold action or connection fallback; --yolo must not lower paid InMail thresholds or create campaigns.",
165
+ "In --yolo or after one Accept, continue through every safe selected sender/campaign action covered by the rendered target packet; sent/scheduled-count progress changes stateRevision and should continue while targetShapeRevision is stable.",
166
+ "Do not complete a fill/schedule request until a final get_refill_target_plan or refill-state reread proves projected coverage (sent + scheduled) fills the horizon, or report a concrete blocker such as awaiting_scheduler_after_ready_buffer or paid_inmail_below_threshold.",
166
167
  ],
167
168
  approvalContract: yolo
168
- ? "Auto-accept only the rendered bounded refill target packet after get_refill_target_plan and fresh reread. Continue through every safe apply/prep/start action inside that packet, including start_campaign only for exact selected PAUSED campaign-backed sequence refill targets named in the packet. After each action, rerun get_refill_target_plan; keep going while targetShapeRevision is stable and scheduled counts progress toward the target, even though stateRevision changes. Ready-to-schedule rows are buffer, not completion. If ready buffer covers the gap, use only read-only scheduler settle/reread. Stop immediately if targetShapeRevision changes because sender set, route, ids, caps, dates, blockers, action class, or side-effect class drifts."
169
+ ? "Auto-accept only the rendered bounded refill target packet after get_refill_target_plan and fresh reread. Continue through every safe apply/prep/start action inside that packet, including start_campaign only for exact selected PAUSED campaign-backed sequence refill targets named in the packet. After each action, rerun get_refill_target_plan; keep going while targetShapeRevision is stable and projected coverage (sent + scheduled) progresses toward the target, even though stateRevision changes. Ready-to-schedule rows are buffer, not completion. If ready buffer covers the projected gap, use only read-only scheduler settle/reread. Stop immediately if targetShapeRevision changes because sender set, route, ids, caps, dates, blockers, action class, paid InMail threshold feasibility, or side-effect class drifts. --yolo does not authorize lowering paid InMail thresholds or creating connection campaigns."
169
170
  : hasSenderSelectors
170
- ? "Ask the final Accept/Decline structured approval question before mutation only when get_refill_target_plan reports a positive remaining ready-or-scheduled gap. Include workspace, sender scope, campaign table, exact ids, caps/dates, gross target, scheduled count, ready buffer, remaining scheduled gap, targetShapeRevision/stateRevision, side effects, forbidden actions, and stop condition. If target is complete, no-op without approval. If ready buffer covers the target, run only read-only scheduler settle/reread."
171
- : "Ask which eligible enrolled senders to refill first, then ask the final Accept/Decline structured approval question before mutation only when get_refill_target_plan reports a positive remaining ready-or-scheduled gap.",
171
+ ? "Ask the final Accept/Decline structured approval question before mutation only when get_refill_target_plan reports a positive remaining projected/ready gap. Include workspace, sender scope, campaign table, exact ids, caps/dates, gross target, sent count, scheduled count, projected count, ready buffer, remaining projected gap, paid InMail threshold feasibility, targetShapeRevision/stateRevision, side effects, forbidden actions, and stop condition. If target is complete by projected coverage, no-op without approval. If ready buffer covers the projected gap, run only read-only scheduler settle/reread. Threshold changes and campaign creation need separate explicit approval."
172
+ : "Ask which eligible enrolled senders to refill first, then ask the final Accept/Decline structured approval question before mutation only when get_refill_target_plan reports a positive remaining projected/ready gap.",
172
173
  forbiddenActions: [
173
174
  "start_campaign outside an exact selected PAUSED campaign-backed refill packet",
175
+ "lower paid InMail thresholds",
176
+ "create connection campaigns",
174
177
  "manual launch/send or direct sending outside product scheduler side effects",
175
178
  "archive or delete cleanup",
176
179
  "direct scheduler writes",
@@ -6,7 +6,7 @@ async function postRefillTargetPlan(body) {
6
6
  export const refillTargetPlanToolDefinitions = [
7
7
  {
8
8
  name: "get_refill_target_plan",
9
- description: "read-only refill target planner to call before any refill mutation. It infers implicit per-sender send lanes from future scheduled, ready-to-schedule, and recent scheduled evidence before falling back to campaign sequences, then computes selected sender-local days, gross scheduled-send target, scheduler-owned scheduled coverage across active enrolled campaigns, ready buffer, remaining scheduled gap, bounded action candidates, and targetRevision drift proof. This tool does not create rows, import leads, prepare messages, approve messages, does not schedule sends, start campaigns, launch, spend InMail credits, or write scheduler fields. Complete targets no-op without approval; incomplete targets must be followed by a bounded approval packet.",
9
+ description: "read-only refill target planner to call before any refill mutation. It identifies eligible senders, infers implicit per-sender send lanes from future scheduled, ready-to-schedule, and recent scheduled evidence before falling back to campaign sequences, then computes selected sender-local days, gross target, actual sent coverage, scheduler-owned scheduled coverage, projected coverage (sent + scheduled), ready buffer, remaining projected gap, paid InMail credit/threshold feasibility, bounded action candidates, and targetRevision drift proof. This tool does not create rows, import leads, prepare messages, approve messages, does not schedule sends, start campaigns, lower paid InMail thresholds, create campaigns, launch, spend InMail credits, or write scheduler fields. Complete projected targets no-op without approval; incomplete targets must be followed by a bounded approval packet.",
10
10
  inputSchema: {
11
11
  type: "object",
12
12
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.461",
3
+ "version": "0.1.462",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -112,16 +112,20 @@ side effects, and stop/rollback condition.
112
112
 
113
113
  Immediately after loading the internal workflow, call
114
114
  `get_refill_target_plan`. The target plan is the canonical first fact receipt:
115
- selected sender-local days, gross scheduled-send target, scheduler-owned
116
- scheduled coverage across active enrolled campaigns, inferred per-sender send
117
- lane/action selections, ready buffer, remaining scheduled gap, remaining
118
- ready-or-scheduled gap, `targetShapeRevision`, and `stateRevision`. When
119
- `actionTypes` are omitted, trust the target plan's inferred lane rather than
120
- asking whether to fill connections, DMs, or InMails. If the target plan is
121
- complete, report that the selected target is already filled and no-op without
122
- asking for approval. If the ready buffer covers the target but scheduled
123
- coverage is still short, run only a bounded read-only scheduler settle/reread loop and report
124
- `awaiting_scheduler_after_ready_buffer` if it does not settle.
115
+ eligible senders, selected sender-local days, gross target, actual sent
116
+ coverage, scheduler-owned scheduled coverage across active enrolled campaigns,
117
+ projected coverage (`sent + scheduled`), inferred per-sender send lane/action
118
+ selections, ready buffer, remaining projected gap, paid-InMail credit/threshold
119
+ feasibility, `targetShapeRevision`, and `stateRevision`. When `actionTypes` are
120
+ omitted, trust the target plan's inferred lane rather than asking whether to
121
+ fill connections, DMs, or InMails. If the target plan is complete by projected
122
+ coverage, report that the selected target is already filled and no-op without
123
+ asking for approval. If the ready buffer covers the projected gap but scheduled
124
+ coverage is still short, run only a bounded read-only scheduler settle/reread
125
+ loop and report `awaiting_scheduler_after_ready_buffer` if it does not settle.
126
+ If paid InMail is below threshold, stale, or missing credit facts, report the
127
+ exact campaign/table/column threshold action or connection fallback; `--yolo`
128
+ does not lower paid-InMail thresholds or create campaigns.
125
129
 
126
130
  If the plain route's managed waterfall targets are stale, for example skipped
127
131
  targets show archived/completed shared slots or the returned targets do not cover
@@ -160,10 +164,12 @@ effect. Starting a paused campaign can let the product scheduler schedule/send
160
164
  approved eligible sequence actions, so include that expected side effect in the
161
165
  packet. It does not authorize starting unrelated, archived, completed, draft, or
162
166
  direct campaigns, separate launch/send actions, archive or delete cleanup,
163
- direct scheduler writes, sender reassignment, or campaigns outside those
167
+ direct scheduler writes, sender reassignment, paid-InMail threshold changes,
168
+ connection campaign creation, or campaigns outside those
164
169
  selected for the eligible sender set. Stop and re-plan if the route, sender set,
165
- ids, caps, blockers, action class, or side-effect class drift before mutation.
166
- Scheduled counts increasing toward the approved target are expected progress:
170
+ ids, caps, blockers, paid-InMail feasibility, action class, or side-effect class
171
+ drift before mutation. Sent/scheduled counts increasing toward the approved
172
+ target are expected progress:
167
173
  they change `stateRevision`, not `targetShapeRevision`, and do not require a
168
174
  second approval.
169
175
 
@@ -175,19 +181,20 @@ return concrete continuation options with campaign names, exact ids, which optio
175
181
  is already covered by the current packet, and which option needs a new approval
176
182
  packet.
177
183
 
178
- For `--yolo` fill/schedule requests, completion means scheduler-proven horizon
179
- saturation, not merely prepared/approved/ready rows. Maintain a horizon
180
- saturation ledger per selected sender: selected send days, gross capacity,
181
- future scheduler-owned scheduled cells with non-null `scheduledFor`,
182
- ready-to-schedule buffer, remaining scheduled gap, remaining ready-or-scheduled
183
- gap, `targetShapeRevision`, `stateRevision`, and the next MCP primitive that can
184
- reduce the gap. After every
185
- apply/prep/start result, wait for processing, reread refill state, recompute the
186
- ledger, then keep applying safe bounded actions until the scheduled count fills
187
- the horizon or a concrete blocker/timeout is proven. If ready rows cover the
188
- horizon but the scheduler has not picked them up yet, run a bounded scheduler
189
- settle loop and report `awaiting_scheduler_after_ready_buffer` as not complete
190
- when the timeout is reached.
184
+ For `--yolo` fill/schedule requests, completion means projected horizon
185
+ saturation (`sent + scheduled`), not merely prepared/approved/ready rows.
186
+ Maintain a horizon saturation ledger per selected sender: selected send days,
187
+ gross capacity, actual sent cells, future scheduler-owned scheduled cells with
188
+ non-null `scheduledFor`, projected count, ready-to-schedule buffer, remaining
189
+ projected gap, paid-InMail feasibility, `targetShapeRevision`,
190
+ `stateRevision`, and the next MCP primitive that can reduce the gap. After every
191
+ apply/prep/start result, wait for processing, reread the target plan/refill
192
+ state, recompute the ledger, then keep applying safe bounded actions until
193
+ projected coverage fills the horizon or a concrete blocker/timeout is proven.
194
+ If ready rows cover the projected gap but the scheduler has not picked them up
195
+ yet, run a bounded scheduler settle loop and report
196
+ `awaiting_scheduler_after_ready_buffer` as not complete when the timeout is
197
+ reached.
191
198
 
192
199
  In `--yolo`, the default two-day fill horizon is two send days unless
193
200
  `--until`/`untilDate` is provided. If an until date is provided, compute bounded
@@ -60,21 +60,26 @@ enrolled in active campaign-backed sequence campaigns, not one arbitrary active
60
60
  campaign.
61
61
 
62
62
  1. Call `get_refill_target_plan` first. This read-only target plan is the
63
- canonical opening receipt: selected sender-local days, gross scheduled-send
64
- target, inferred per-sender send lane/action selections, scheduler-owned
65
- scheduled coverage across active enrolled campaigns, ready buffer, remaining
66
- scheduled gap, remaining ready-or-scheduled gap, bounded action candidates,
67
- `targetShapeRevision`, and `stateRevision`.
63
+ canonical opening receipt: eligible senders, selected sender-local days,
64
+ gross target, inferred per-sender send lane/action selections, actual sent
65
+ coverage, scheduler-owned scheduled coverage across active enrolled
66
+ campaigns, projected coverage (`sent + scheduled`), ready buffer, remaining
67
+ projected gap, paid-InMail credit/threshold feasibility, bounded action
68
+ candidates, `targetShapeRevision`, and `stateRevision`.
68
69
  When `actionTypes` are omitted, trust the target plan's inferred lane; do not
69
70
  ask the operator whether to fill connections, DMs, or InMails after the plan
70
71
  has already inferred that from future scheduled, ready, and recent scheduled
71
72
  evidence.
72
- If `status:"complete"`, report the target, selected dates, scheduled count,
73
- campaign ids, and no-op proof without asking for approval or mutating.
74
- If `remainingReadyOrScheduledGap:0` but `remainingScheduledGap>0`, run only a
73
+ If `status:"complete"`, report the target, selected dates, sent count,
74
+ scheduled count, projected count, campaign ids, and no-op proof without
75
+ asking for approval or mutating.
76
+ If `remainingReadyOrProjectedGap:0` but `remainingProjectedGap>0`, run only a
75
77
  bounded read-only scheduler settle/reread loop; do not ask for
76
78
  prep/import/approval. If the scheduler still does not fill, report
77
79
  `awaiting_scheduler_after_ready_buffer`.
80
+ If paid InMail feasibility is below threshold, stale, or missing, report the
81
+ exact campaign/table/column threshold action or connection fallback; `--yolo`
82
+ does not lower paid-InMail thresholds or create campaigns.
78
83
  2. Call `resolve_campaign_fill_route`. Use `intent:"plain"` for generic
79
84
  fill/load language, `intent:"active"` only when the user explicitly narrowed
80
85
  to active regular campaigns or when the plain route has stale managed
@@ -141,10 +146,11 @@ Use the refill-state response as the current facts receipt:
141
146
  scan/import caps, and proof;
142
147
  - sender ids, healthy senders, disconnected senders, and daily capacity;
143
148
  - horizon saturation ledger per target sender: sender-local send days in scope,
144
- gross horizon capacity, future scheduler-owned scheduled counts in that
145
- window, ready-to-schedule buffer, remaining scheduled gap, remaining
146
- ready-or-scheduled gap, `targetShapeRevision`, `stateRevision`, and the next
147
- smallest MCP primitive that can reduce the gap;
149
+ gross horizon capacity, actual sent coverage, future scheduler-owned
150
+ scheduled counts in that window, projected coverage (`sent + scheduled`),
151
+ ready-to-schedule buffer, remaining projected gap, paid-InMail
152
+ credit/threshold feasibility, `targetShapeRevision`, `stateRevision`, and the
153
+ next smallest MCP primitive that can reduce the gap;
148
154
  - row/stage counts: source available, rows, enriched, passed, generated,
149
155
  approved, ready to schedule, scheduled;
150
156
  - active message prep job;
@@ -201,19 +207,18 @@ Short form: default `--yolo refill senders` target is each eligible sender's two
201
207
  For `--yolo` fill/schedule requests, do not treat "ready" as completion. Build
202
208
  and maintain a horizon saturation ledger for every selected sender from
203
209
  `get_refill_target_plan`. A sender is complete only when a final target-plan or
204
- refill-state reread proves scheduler-owned scheduled cells with non-null
205
- `scheduledFor` meet or exceed the sender's horizon capacity for the selected
206
- send days. Put another way: complete only when a final
207
- `get_campaign_refill_state` reread proves the scheduler-owned non-null
208
- `scheduledFor` coverage. Ready-to-schedule rows are only buffer for the product scheduler. If
209
- ready plus scheduled covers the horizon but scheduled cells do not yet, run a
210
- bounded read-only scheduler settle loop: wait, reread, recompute the ledger, and
211
- continue until scheduled coverage is proved or the loop reaches an explicit
212
- timeout/blocker. Timeout is `awaiting_scheduler_after_ready_buffer`, not
213
- success, and it does not need a prep/import/approval packet. Short form: ready
214
- buffer is not success.
210
+ refill-state reread proves projected coverage (`sent + scheduled`) meets or
211
+ exceeds the sender's horizon capacity for the selected send days. Put another
212
+ way: complete when the same daily-limit/readback model would show no remaining
213
+ send-day capacity for that selected lane. Ready-to-schedule rows are only buffer
214
+ for the product scheduler. If ready plus projected coverage covers the horizon
215
+ but scheduled cells do not yet, run a bounded read-only scheduler settle loop:
216
+ wait, reread, recompute the ledger, and continue until projected coverage is
217
+ proved or the loop reaches an explicit timeout/blocker. Timeout is
218
+ `awaiting_scheduler_after_ready_buffer`, not success, and it does not need a
219
+ prep/import/approval packet. Short form: ready buffer is not success.
215
220
  Short form: use a bounded scheduler settle loop before calling it blocked.
216
- Short form: `--yolo refill senders` completes only on scheduled horizon saturation or a concrete blocker.
221
+ Short form: `--yolo refill senders` completes only on projected horizon saturation or a concrete blocker.
217
222
 
218
223
  Rank candidates in this order:
219
224
 
@@ -434,10 +439,10 @@ same refill request, do not ask the `Accept` / `Decline` question. Instead:
434
439
  5. after each terminal apply/prep/start result, reread state, settle processing
435
440
  when needed, recompute the horizon saturation ledger, and continue with the
436
441
  next smallest safe action inside the same bounded packet until every selected
437
- sender is scheduled through the horizon or blocked by evidence. Do not stop
438
- at "loaded" or "awaiting scheduler" unless no in-packet MCP action remains
439
- and the scheduler-settle loop times out; report that as a blocker, not a
440
- completed refill.
442
+ sender is saturated by projected coverage or blocked by evidence. Do not
443
+ stop at "loaded" or "awaiting scheduler" unless no in-packet MCP action
444
+ remains and the scheduler-settle loop times out; report that as a blocker,
445
+ not a completed refill.
441
446
 
442
447
  In `--yolo`, do not stop after the first selected campaign if the request was
443
448
  sender-scoped and more selected senders or same-packet start-eligible campaigns
@@ -524,13 +529,13 @@ when generated/pass counts are still settling, then poll `get_campaign_refill_st
524
529
  remains awaiting scheduler. Do not force scheduler fields directly.
525
530
 
526
531
  For requested fill/refill completion, continue the saturation loop after each
527
- poll: recompute scheduled horizon coverage by sender and date, subtract it from
532
+ poll: recompute projected horizon coverage by sender and date, subtract it from
528
533
  the requested horizon capacity, and decide whether another safe prep/import/
529
- approval pass is required. If scheduled coverage is still short and ready buffer
534
+ approval pass is required. If projected coverage is still short and ready buffer
530
535
  is also short, run the next bounded MCP primitive that can create more eligible
531
536
  rows: `fill_campaign_horizon` for the selected evergreen target, or
532
537
  `start_campaign_message_preparation`, source import/replenishment, and bounded
533
- approval for the selected regular target. If scheduled coverage is short but
538
+ approval for the selected regular target. If projected coverage is short but
534
539
  ready buffer covers the gap, keep polling the scheduler until it fills or the
535
540
  explicit scheduler-settle timeout is hit. Never mark the refill complete while a
536
541
  daily limit/readback equivalent would still show the selected send day below