@sellable/mcp 0.1.465 → 0.1.467

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 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 blockers 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.`,
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, post the full sender/campaign/action approval packet in normal chat as Markdown first, then ask request_user_input/AskUserQuestion with exactly Accept and Decline and a compact body that refers back to the posted packet; do not duplicate the campaign table or full operator packet inside the structured question. The chat packet 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 blockers 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
  }
@@ -150,6 +150,7 @@ export function refillSendsCommand(input = {}) {
150
150
  ? `, untilDate: "${untilDate}"`
151
151
  : `, horizonSendDays: ${horizonSendDays}`}, approvalMode: "${approvalMode}" }) before any import, prep, approval, start, or schedule-affecting action.`,
152
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
+ "Refill target lanes are only connection invites (send_invite) or paid InMails (send_inmail_closed). Do not count send_dm or send_inmail_open as horizon target capacity; they may exist in sequences, but the planner must pick the refill lane from the most recent active campaign-backed send evidence for each sender.",
153
154
  "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
155
  `Resolve route with resolve_campaign_fill_route({ intent: "${intent}"${input.campaignId ? `, campaignId: "${input.campaignId}"` : ""}${input.tableId ? `, tableId: "${input.tableId}"` : ""} }).`,
155
156
  '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.',
@@ -161,20 +162,18 @@ export function refillSendsCommand(input = {}) {
161
162
  "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
163
  "Fresh reread get_campaign_refill_state immediately before any import, prep, approval, or horizon-fill mutation.",
163
164
  "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 credit facts are stale or missing and get_refill_target_plan returns refresh_paid_inmail_credits action candidates, include the exact sender ids and credit-cache write side effect in the bounded packet, call refresh_paid_inmail_credits only for those exact senders after approval/--yolo, then rerun get_refill_target_plan before any prep/import/approval/start action.",
165
- "If paid InMail feasibility is below threshold after a fresh credit read, report the exact sender/campaign/table/column threshold action or connection fallback; --yolo must not lower paid InMail thresholds or create campaigns.",
166
- "In --yolo or after one Accept, continue through every safe selected sender/campaign action covered by the rendered target packet; credit-refresh and sent/scheduled-count progress changes stateRevision and should continue while targetShapeRevision is stable.",
165
+ "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.",
166
+ "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.",
167
167
  "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.",
168
168
  ],
169
169
  approvalContract: yolo
170
- ? "Auto-accept only the rendered bounded refill target packet after get_refill_target_plan and fresh reread. Continue through every safe credit-refresh/apply/prep/start action inside that packet, including refresh_paid_inmail_credits only for exact sender ids named in the packet and 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, refreshing credits for senders outside the packet, or creating connection campaigns."
170
+ ? "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."
171
171
  : hasSenderSelectors
172
- ? "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 including exact-sender refresh_paid_inmail_credits credit-cache writes when present, 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."
173
- : "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
+ ? "Before mutation, post the full bounded refill packet in normal chat as Markdown, including 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. Then ask the final Accept/Decline structured approval question with a compact body that refers back to the posted packet instead of duplicating it. Only ask when get_refill_target_plan reports a positive remaining projected/ready gap. 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."
173
+ : "Ask which eligible enrolled senders to refill first, then, before mutation, post the full bounded refill packet in normal chat as Markdown and ask the final Accept/Decline structured approval question with a compact body that refers back to the posted packet.",
174
174
  forbiddenActions: [
175
175
  "start_campaign outside an exact selected PAUSED campaign-backed refill packet",
176
176
  "lower paid InMail thresholds",
177
- "refresh paid InMail credits for senders outside the rendered eligible sender packet",
178
177
  "create connection campaigns",
179
178
  "manual launch/send or direct sending outside product scheduler side effects",
180
179
  "archive or delete cleanup",
@@ -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 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.",
9
+ description: "read-only refill target planner to call before any refill mutation. It identifies eligible senders and infers one implicit refill lane per sender: connection invites or paid InMails, chosen from future scheduled, recent scheduled, and ready-to-schedule evidence in active campaign-backed sequence campaigns before falling back to campaign sequences. DMs and open-profile InMails are follow-up sequence actions, not refill target lanes. The planner 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: {
@@ -53,15 +53,9 @@ export const refillTargetPlanToolDefinitions = [
53
53
  type: "array",
54
54
  items: {
55
55
  type: "string",
56
- enum: [
57
- "send_invite",
58
- "send_dm",
59
- "send_inmail_open",
60
- "send_inmail_closed",
61
- "react_and_comment",
62
- ],
56
+ enum: ["send_invite", "send_inmail_closed"],
63
57
  },
64
- description: "Optional workflow send column/action types. If omitted, the planner infers per-sender lanes from future scheduled, ready-to-schedule, and recent scheduled evidence before falling back to selected active campaign sequences.",
58
+ description: "Optional refill target lane override. Supported refill lanes are connection invites (send_invite) and paid InMails (send_inmail_closed) only. If omitted, the planner infers one per-sender lane from active campaign future scheduled, recent scheduled, and ready-to-schedule evidence before falling back to selected active campaign sequences.",
65
59
  },
66
60
  approvalMode: {
67
61
  type: "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.465",
3
+ "version": "0.1.467",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -117,21 +117,30 @@ eligible senders, selected sender-local days, gross target, actual sent
117
117
  coverage, scheduler-owned scheduled coverage across active enrolled campaigns,
118
118
  projected coverage (`sent + scheduled`), inferred per-sender send lane/action
119
119
  selections, ready buffer, remaining projected gap, paid-InMail credit/threshold
120
- feasibility, `targetShapeRevision`, and `stateRevision`. When `actionTypes` are
121
- omitted, trust the target plan's inferred lane rather than asking whether to
122
- fill connections, DMs, or InMails. If the target plan is complete by projected
123
- coverage, report that the selected target is already filled and no-op without
124
- asking for approval. If the ready buffer covers the projected gap but scheduled
125
- coverage is still short, run only a bounded read-only scheduler settle/reread
126
- loop and report `awaiting_scheduler_after_ready_buffer` if it does not settle.
120
+ feasibility, `targetShapeRevision`, and `stateRevision`. Refill target lanes
121
+ are only connection invites (`send_invite`) or paid InMails
122
+ (`send_inmail_closed`), chosen per sender from the most recent current
123
+ dashboard-active campaign-backed send evidence. DMs (`send_dm`) and
124
+ open-profile InMails (`send_inmail_open`) may exist in sequences, but they are
125
+ not refill horizon target capacity and must not be counted as refill sent,
126
+ scheduled, or ready coverage. When `actionTypes` are omitted, trust the target
127
+ plan's inferred connection-or-paid-InMail lane rather than asking which of those
128
+ two lanes to fill. If a stale target plan selects `send_dm` or
129
+ `send_inmail_open`, stop and re-plan with the current planner before mutation.
130
+ Short form: trust the target plan's inferred lane only when it is a
131
+ connection-invite or paid-InMail refill lane.
132
+ If the target plan is complete by projected coverage, report that the selected
133
+ target is already filled and no-op without asking for approval. If the ready
134
+ buffer covers the projected gap but scheduled coverage is still short, run only
135
+ a bounded read-only scheduler settle/reread loop and report
136
+ `awaiting_scheduler_after_ready_buffer` if it does not settle.
127
137
  If paid InMail credit facts are stale or missing and the target plan returns a
128
138
  `refresh_paid_inmail_credits` action candidate, include the exact sender id,
129
139
  campaign/table/column proof, expected sender-credit-cache writes, and rerun plan
130
140
  step in the bounded packet. After `refresh_paid_inmail_credits`, rerun
131
141
  `get_refill_target_plan` before any prep/import/approval/start action. If paid
132
142
  InMail is below threshold after a fresh credit read, report the exact
133
- campaign/table/column threshold action or connection fallback; `--yolo` does not
134
- lower paid-InMail thresholds or create campaigns.
143
+ campaign/table/column threshold action or connection fallback; `--yolo` does not lower paid-InMail thresholds or create campaigns.
135
144
 
136
145
  If the plain route's managed waterfall targets are stale, for example skipped
137
146
  targets show archived/completed shared slots or the returned targets do not cover
@@ -147,13 +156,15 @@ host-native structured question gate, not plain chat:
147
156
  - Claude Code: use `AskUserQuestion`.
148
157
 
149
158
  The approval question must present the final refill step with exactly two
150
- choices: `Accept` and `Decline`. The question body must include the operator
151
- output packet: workspace, sender scope, a campaign-by-campaign table with
152
- campaign name, sender names, action, target count/cap, source/list, and
153
- blocker/skip reason, then exact ids, expected side effects, forbidden actions,
154
- and the stop condition. Treat `Accept` as permission for only the rendered
155
- target, caps, mode, and side effects. Treat `Decline` as a hard stop with no
156
- mutation.
159
+ choices: `Accept` and `Decline`. Render the full operator output packet in
160
+ normal chat immediately before opening the structured approval question so it
161
+ can be displayed as Markdown. The chat packet must include workspace, sender
162
+ scope, a campaign-by-campaign table with campaign name, sender names, action,
163
+ target count/cap, source/list, and blocker/skip reason, then exact ids,
164
+ expected side effects, forbidden actions, and the stop condition. The structured
165
+ question body must be compact and refer back to the posted packet instead of
166
+ duplicating it. Treat `Accept` as permission for only the rendered target, caps,
167
+ mode, and side effects. Treat `Decline` as a hard stop with no mutation.
157
168
 
158
169
  If Christian includes `--yolo` in the same refill request, treat that flag as
159
170
  auto-accept for the rendered bounded refill packet after the required fresh state
@@ -67,10 +67,20 @@ campaign.
67
67
  campaigns, projected coverage (`sent + scheduled`), ready buffer, remaining
68
68
  projected gap, paid-InMail credit/threshold feasibility, bounded action
69
69
  candidates, `targetShapeRevision`, and `stateRevision`.
70
- When `actionTypes` are omitted, trust the target plan's inferred lane; do not
71
- ask the operator whether to fill connections, DMs, or InMails after the plan
72
- has already inferred that from future scheduled, ready, and recent scheduled
73
- evidence.
70
+ Refill target lanes are binary per sender: connection invites
71
+ (`send_invite`) or paid InMails (`send_inmail_closed`). DMs
72
+ (`send_dm`) and open-profile InMails (`send_inmail_open`) can remain in the
73
+ sequence, but they are follow-up actions, not refill horizon capacity. Do not
74
+ count their sent, scheduled, or ready cells when deciding whether a sender
75
+ needs refill. When `actionTypes` are omitted, trust the target plan's
76
+ inferred connection-or-paid-InMail lane; do not ask the operator which of
77
+ those two lanes to fill after the plan has inferred that from active
78
+ campaign future scheduled, recent scheduled, and ready evidence. If a stale
79
+ planner/tool response selects `send_dm` or `send_inmail_open`, treat that as
80
+ unsupported stale refill state and re-plan with a current planner before any
81
+ mutation.
82
+ Short form: trust the target plan's inferred lane only when it is a
83
+ connection-invite or paid-InMail refill lane.
74
84
  If `status:"complete"`, report the target, selected dates, sent count,
75
85
  scheduled count, projected count, campaign ids, and no-op proof without
76
86
  asking for approval or mutating.
@@ -84,8 +94,7 @@ campaign.
84
94
  step in the bounded packet. After `refresh_paid_inmail_credits`, rerun
85
95
  `get_refill_target_plan` before any prep/import/approval/start action. If paid
86
96
  InMail is below threshold after a fresh credit read, report the exact
87
- campaign/table/column threshold action or connection fallback; `--yolo` does not
88
- lower paid-InMail thresholds or create campaigns.
97
+ campaign/table/column threshold action or connection fallback; `--yolo` does not lower paid-InMail thresholds or create campaigns.
89
98
  2. Call `resolve_campaign_fill_route`. Use `intent:"plain"` for generic
90
99
  fill/load language, `intent:"active"` only when the user explicitly narrowed
91
100
  to active regular campaigns or when the plain route has stale managed
@@ -161,7 +170,9 @@ Use the refill-state response as the current facts receipt:
161
170
  approved, ready to schedule, scheduled;
162
171
  - active message prep job;
163
172
  - scheduler-owned scheduled counts by date/action from cells with non-null
164
- `scheduledFor`; treat these as the last sends/continuation signal;
173
+ `scheduledFor`; treat connection-invite and paid-InMail cells as the refill
174
+ lane continuation signal and the last sends/continuation signal, and ignore
175
+ DM/open-InMail cells for refill target capacity;
165
176
  - latest scheduled send date, latest scheduled-cell update when present,
166
177
  sender overlap with the requested or inferred sender set, and whether future
167
178
  scheduled sends already exist;
@@ -210,6 +221,19 @@ in the best same-sender campaign and keep all source-copy/prep caps tied to that
210
221
  two-day packet.
211
222
  Short form: default `--yolo refill senders` target is each eligible sender's two-send-day gap.
212
223
 
224
+ Lane selection must choose one refill lane per sender from current
225
+ dashboard-active campaign-backed sequence evidence:
226
+
227
+ 1. Prefer the sender's most recent future scheduled refill action, then the most
228
+ recent recent scheduled refill action, then ready refill rows.
229
+ 2. Refill actions are only `send_invite` and `send_inmail_closed`.
230
+ 3. If the most recent active campaign evidence is DM or open InMail, ignore it
231
+ for refill lane selection and use the nearest connection-invite or paid-InMail
232
+ evidence instead.
233
+ 4. If no connection/paid-InMail evidence exists, fall back to the selected
234
+ active campaign sequence, still choosing only one of `send_invite` or
235
+ `send_inmail_closed` for that sender.
236
+
213
237
  For `--yolo` fill/schedule requests, do not treat "ready" as completion. Build
214
238
  and maintain a horizon saturation ledger for every selected sender from
215
239
  `get_refill_target_plan`. A sender is complete only when a final target-plan or
@@ -405,15 +429,17 @@ If they changed, stop. A second concurrent refill run must see the first run's
405
429
  import/prep state on reread and avoid duplicate work.
406
430
 
407
431
  After the final reread and before the first mutating refill primitive, render
408
- one final approval packet in campaign-name-first language, then ask a
409
- host-native structured question with exactly two choices: `Accept` and
410
- `Decline`. The question is the execution boundary.
432
+ one final approval packet in normal chat, in campaign-name-first language, so
433
+ Codex/Claude can display the packet as Markdown. Then ask a host-native
434
+ structured question with exactly two choices: `Accept` and `Decline`. The
435
+ question is the execution boundary, but the full packet belongs in chat, not in
436
+ the structured question body.
411
437
  Short form: exactly two choices: `Accept` and `Decline`.
412
438
 
413
439
  - In Codex interactive sessions, use `request_user_input`.
414
440
  - In Claude Code interactive sessions, use `AskUserQuestion`.
415
- - The question body must include this exact operator output packet shape before
416
- the choices:
441
+ - The normal chat message immediately before the structured question must
442
+ include this exact operator output packet shape:
417
443
  - workspace name/id and mode (`--yolo` or approval-required);
418
444
  - sender scope, including selected sender names and skipped sender names with
419
445
  health/enrollment reasons;
@@ -425,10 +451,13 @@ Short form: exactly two choices: `Accept` and `Decline`.
425
451
  - expected side effects, including any exact-sender
426
452
  `refresh_paid_inmail_credits` credit-cache writes, forbidden actions, and the
427
453
  stop/rollback condition.
428
- - The `Accept` choice must name the exact campaign, workspace id, campaign id,
429
- workflow table id, source/action ids when relevant, caps/dates, approval mode,
430
- expected side effects, including exact-sender paid-InMail credit refreshes when
431
- present, and stop/rollback condition.
454
+ - The structured question body must be compact and refer back to the posted
455
+ chat packet. Do not duplicate the campaign table or full operator packet
456
+ inside `request_user_input` / `AskUserQuestion`; refer back to the posted
457
+ packet instead of duplicating it.
458
+ - The `Accept` choice description must name that it accepts only the posted
459
+ packet, with its exact workspace, campaign/table/source/action ids,
460
+ caps/dates, approval mode, side effects, and stop condition.
432
461
  - The `Decline` choice must stop with no mutation.
433
462
  - Do not proceed from a plain chat "ok", "yes", "go", or "do it" when the
434
463
  structured question tool is available. If the structured question tool is not