@sellable/mcp 0.1.463 → 0.1.465
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +4 -1
- package/dist/tools/prompts.js +1 -1
- package/dist/tools/refill-sends.js +6 -4
- package/dist/tools/senders.d.ts +24 -0
- package/dist/tools/senders.js +51 -0
- package/package.json +1 -1
- package/skills/refill-sends/SKILL.md +11 -4
- package/skills/refill-sends-workflow/SKILL.md +33 -15
package/dist/server.js
CHANGED
|
@@ -43,7 +43,7 @@ import { allTools } from "./tools/registry.js";
|
|
|
43
43
|
import { getRows, getTableRows, getTableRowsMinimal } from "./tools/rows.js";
|
|
44
44
|
import { addRubricItem, checkRubric, deleteRubricItem, draftRubrics, saveRubrics, selectNecessaryRubrics, updateRubricItem, waitForRubricResults, } from "./tools/rubrics.js";
|
|
45
45
|
import { getSenderRoutingTool, setSenderRoutingTool, } from "./tools/sender-routing.js";
|
|
46
|
-
import { getSender, listSenders } from "./tools/senders.js";
|
|
46
|
+
import { getSender, listSenders, refreshPaidInmailCredits, } from "./tools/senders.js";
|
|
47
47
|
import { attachRecommendedSequence, attachSequence, createWorkflowTable, } from "./tools/sequencer.js";
|
|
48
48
|
import { setupEvergreenCampaigns } from "./tools/setup-evergreen-campaigns.js";
|
|
49
49
|
import { exportTableCsv, listTables } from "./tools/tables.js";
|
|
@@ -524,6 +524,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
524
524
|
case "get_sender":
|
|
525
525
|
result = await getSender(args);
|
|
526
526
|
break;
|
|
527
|
+
case "refresh_paid_inmail_credits":
|
|
528
|
+
result = await refreshPaidInmailCredits(args);
|
|
529
|
+
break;
|
|
527
530
|
case "search_apollo":
|
|
528
531
|
result = await searchApollo(args);
|
|
529
532
|
break;
|
package/dist/tools/prompts.js
CHANGED
|
@@ -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 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, 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.`,
|
|
377
377
|
},
|
|
378
378
|
};
|
|
379
379
|
}
|
|
@@ -161,18 +161,20 @@ export function refillSendsCommand(input = {}) {
|
|
|
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
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
|
|
165
|
-
"
|
|
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.",
|
|
166
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.",
|
|
167
168
|
],
|
|
168
169
|
approvalContract: yolo
|
|
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."
|
|
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
171
|
: hasSenderSelectors
|
|
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 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."
|
|
172
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.",
|
|
173
174
|
forbiddenActions: [
|
|
174
175
|
"start_campaign outside an exact selected PAUSED campaign-backed refill packet",
|
|
175
176
|
"lower paid InMail thresholds",
|
|
177
|
+
"refresh paid InMail credits for senders outside the rendered eligible sender packet",
|
|
176
178
|
"create connection campaigns",
|
|
177
179
|
"manual launch/send or direct sending outside product scheduler side effects",
|
|
178
180
|
"archive or delete cleanup",
|
package/dist/tools/senders.d.ts
CHANGED
|
@@ -28,6 +28,29 @@ export type GetSenderInput = {
|
|
|
28
28
|
export type SenderDetailResponse = {
|
|
29
29
|
sender: any;
|
|
30
30
|
};
|
|
31
|
+
export type RefreshPaidInmailCreditsInput = {
|
|
32
|
+
senderId: string;
|
|
33
|
+
};
|
|
34
|
+
export type PaidInmailCreditStatus = {
|
|
35
|
+
available: number;
|
|
36
|
+
balance: number | null;
|
|
37
|
+
sentSince: number;
|
|
38
|
+
checkedAt: string | null;
|
|
39
|
+
needsRefresh: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type RefreshPaidInmailCreditsResponse = {
|
|
42
|
+
senderId: string;
|
|
43
|
+
refreshed: true;
|
|
44
|
+
credits: PaidInmailCreditStatus;
|
|
45
|
+
sideEffects: {
|
|
46
|
+
refreshedLinkedInDerivedCreditFacts: true;
|
|
47
|
+
updatedSenderCreditCache: true;
|
|
48
|
+
campaignMutation: false;
|
|
49
|
+
schedulerMutation: false;
|
|
50
|
+
thresholdMutation: false;
|
|
51
|
+
sendMutation: false;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
31
54
|
export declare const senderToolDefinitions: ({
|
|
32
55
|
name: string;
|
|
33
56
|
description: string;
|
|
@@ -56,4 +79,5 @@ export declare const senderToolDefinitions: ({
|
|
|
56
79
|
})[];
|
|
57
80
|
export declare function listSenders(): Promise<ListSendersResponse>;
|
|
58
81
|
export declare function getSender(input: GetSenderInput): Promise<SenderDetailResponse>;
|
|
82
|
+
export declare function refreshPaidInmailCredits(input: RefreshPaidInmailCreditsInput): Promise<RefreshPaidInmailCreditsResponse>;
|
|
59
83
|
export {};
|
package/dist/tools/senders.js
CHANGED
|
@@ -124,6 +124,21 @@ export const senderToolDefinitions = [
|
|
|
124
124
|
additionalProperties: false,
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
|
+
{
|
|
128
|
+
name: "refresh_paid_inmail_credits",
|
|
129
|
+
description: "Refresh the cached paid InMail credit facts for one exact sender in the active workspace by calling Sellable's product credit refresh path. This updates only the sender credit cache (balance, sentSince, checkedAt) and returns the fresh status. It does not mutate campaigns, lower thresholds, approve messages, schedule sends, start campaigns, send messages, spend InMail credits, or write scheduler fields. Use this when get_refill_target_plan returns a refresh_paid_inmail_credits action candidate, then rerun get_refill_target_plan before any refill mutation.",
|
|
130
|
+
inputSchema: {
|
|
131
|
+
type: "object",
|
|
132
|
+
properties: {
|
|
133
|
+
senderId: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "Exact Sender.id to refresh. The API verifies the sender belongs to the active workspace.",
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
required: ["senderId"],
|
|
139
|
+
additionalProperties: false,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
127
142
|
];
|
|
128
143
|
export async function listSenders() {
|
|
129
144
|
const api = getApi();
|
|
@@ -151,3 +166,39 @@ export async function getSender(input) {
|
|
|
151
166
|
const sender = await api.get(`/api/v1/outbound-sender-identities/${encodeURIComponent(input.senderId)}`);
|
|
152
167
|
return { sender };
|
|
153
168
|
}
|
|
169
|
+
function normalizeCreditStatus(raw) {
|
|
170
|
+
return {
|
|
171
|
+
available: Number(raw?.available ?? 0),
|
|
172
|
+
balance: raw?.balance === null || raw?.balance === undefined
|
|
173
|
+
? null
|
|
174
|
+
: Number(raw.balance),
|
|
175
|
+
sentSince: Number(raw?.sentSince ?? 0),
|
|
176
|
+
checkedAt: typeof raw?.checkedAt === "string"
|
|
177
|
+
? raw.checkedAt
|
|
178
|
+
: raw?.checkedAt
|
|
179
|
+
? new Date(raw.checkedAt).toISOString()
|
|
180
|
+
: null,
|
|
181
|
+
needsRefresh: raw?.needsRefresh === true,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export async function refreshPaidInmailCredits(input) {
|
|
185
|
+
const senderId = input.senderId?.trim();
|
|
186
|
+
if (!senderId) {
|
|
187
|
+
throw new Error("senderId is required.");
|
|
188
|
+
}
|
|
189
|
+
const api = getApi();
|
|
190
|
+
const result = await api.post(`/api/v3/senders/${encodeURIComponent(senderId)}/refresh-inmail-credits`, {});
|
|
191
|
+
return {
|
|
192
|
+
senderId,
|
|
193
|
+
refreshed: true,
|
|
194
|
+
credits: normalizeCreditStatus(result?.credits),
|
|
195
|
+
sideEffects: {
|
|
196
|
+
refreshedLinkedInDerivedCreditFacts: true,
|
|
197
|
+
updatedSenderCreditCache: true,
|
|
198
|
+
campaignMutation: false,
|
|
199
|
+
schedulerMutation: false,
|
|
200
|
+
thresholdMutation: false,
|
|
201
|
+
sendMutation: false,
|
|
202
|
+
},
|
|
203
|
+
};
|
|
204
|
+
}
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ visibility: public
|
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- mcp__sellable__refill_sends
|
|
7
7
|
- mcp__sellable__get_refill_target_plan
|
|
8
|
+
- mcp__sellable__refresh_paid_inmail_credits
|
|
8
9
|
- mcp__sellable__get_auth_status
|
|
9
10
|
- mcp__sellable__start_cli_login
|
|
10
11
|
- mcp__sellable__wait_for_cli_login
|
|
@@ -123,9 +124,14 @@ coverage, report that the selected target is already filled and no-op without
|
|
|
123
124
|
asking for approval. If the ready buffer covers the projected gap but scheduled
|
|
124
125
|
coverage is still short, run only a bounded read-only scheduler settle/reread
|
|
125
126
|
loop and report `awaiting_scheduler_after_ready_buffer` if it does not settle.
|
|
126
|
-
If paid InMail
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
If paid InMail credit facts are stale or missing and the target plan returns a
|
|
128
|
+
`refresh_paid_inmail_credits` action candidate, include the exact sender id,
|
|
129
|
+
campaign/table/column proof, expected sender-credit-cache writes, and rerun plan
|
|
130
|
+
step in the bounded packet. After `refresh_paid_inmail_credits`, rerun
|
|
131
|
+
`get_refill_target_plan` before any prep/import/approval/start action. If paid
|
|
132
|
+
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.
|
|
129
135
|
|
|
130
136
|
If the plain route's managed waterfall targets are stale, for example skipped
|
|
131
137
|
targets show archived/completed shared slots or the returned targets do not cover
|
|
@@ -165,7 +171,8 @@ approved eligible sequence actions, so include that expected side effect in the
|
|
|
165
171
|
packet. It does not authorize starting unrelated, archived, completed, draft, or
|
|
166
172
|
direct campaigns, separate launch/send actions, archive or delete cleanup,
|
|
167
173
|
direct scheduler writes, sender reassignment, paid-InMail threshold changes,
|
|
168
|
-
connection campaign creation,
|
|
174
|
+
connection campaign creation, paid-InMail credit refreshes outside the exact
|
|
175
|
+
rendered sender packet, or campaigns outside those
|
|
169
176
|
selected for the eligible sender set. Stop and re-plan if the route, sender set,
|
|
170
177
|
ids, caps, blockers, paid-InMail feasibility, action class, or side-effect class
|
|
171
178
|
drift before mutation. Sent/scheduled counts increasing toward the approved
|
|
@@ -4,6 +4,7 @@ description: Internal skill-led refill sends workflow for regular campaigns and
|
|
|
4
4
|
visibility: internal
|
|
5
5
|
allowed-tools:
|
|
6
6
|
- mcp__sellable__get_refill_target_plan
|
|
7
|
+
- mcp__sellable__refresh_paid_inmail_credits
|
|
7
8
|
- mcp__sellable__list_senders
|
|
8
9
|
- mcp__sellable__get_sender_routing
|
|
9
10
|
- mcp__sellable__get_campaign_waterfall
|
|
@@ -77,9 +78,14 @@ campaign.
|
|
|
77
78
|
bounded read-only scheduler settle/reread loop; do not ask for
|
|
78
79
|
prep/import/approval. If the scheduler still does not fill, report
|
|
79
80
|
`awaiting_scheduler_after_ready_buffer`.
|
|
80
|
-
If paid InMail
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
If paid InMail credit facts are stale or missing and the target plan returns a
|
|
82
|
+
`refresh_paid_inmail_credits` action candidate, include the exact sender id,
|
|
83
|
+
campaign/table/column proof, expected sender-credit-cache write, and rerun plan
|
|
84
|
+
step in the bounded packet. After `refresh_paid_inmail_credits`, rerun
|
|
85
|
+
`get_refill_target_plan` before any prep/import/approval/start action. If paid
|
|
86
|
+
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.
|
|
83
89
|
2. Call `resolve_campaign_fill_route`. Use `intent:"plain"` for generic
|
|
84
90
|
fill/load language, `intent:"active"` only when the user explicitly narrowed
|
|
85
91
|
to active regular campaigns or when the plain route has stale managed
|
|
@@ -416,10 +422,13 @@ Short form: exactly two choices: `Accept` and `Decline`.
|
|
|
416
422
|
- exact workspace id, campaign id, workflow table id, source/action ids when
|
|
417
423
|
relevant, freshness/state hash, caps/dates, approval mode, and the next
|
|
418
424
|
MCP primitive to call;
|
|
419
|
-
- expected side effects,
|
|
425
|
+
- expected side effects, including any exact-sender
|
|
426
|
+
`refresh_paid_inmail_credits` credit-cache writes, forbidden actions, and the
|
|
427
|
+
stop/rollback condition.
|
|
420
428
|
- The `Accept` choice must name the exact campaign, workspace id, campaign id,
|
|
421
429
|
workflow table id, source/action ids when relevant, caps/dates, approval mode,
|
|
422
|
-
expected side effects,
|
|
430
|
+
expected side effects, including exact-sender paid-InMail credit refreshes when
|
|
431
|
+
present, and stop/rollback condition.
|
|
423
432
|
- The `Decline` choice must stop with no mutation.
|
|
424
433
|
- Do not proceed from a plain chat "ok", "yes", "go", or "do it" when the
|
|
425
434
|
structured question tool is available. If the structured question tool is not
|
|
@@ -431,18 +440,22 @@ Short form: exactly two choices: `Accept` and `Decline`.
|
|
|
431
440
|
same refill request, do not ask the `Accept` / `Decline` question. Instead:
|
|
432
441
|
|
|
433
442
|
1. render the same final approval packet;
|
|
434
|
-
2. reread `get_campaign_refill_state
|
|
443
|
+
2. reread `get_campaign_refill_state` and, when the packet includes paid-InMail
|
|
444
|
+
credit refreshes, verify the current `get_refill_target_plan` action
|
|
445
|
+
candidates still name the same sender ids, campaign ids, table ids, and
|
|
446
|
+
column ids;
|
|
435
447
|
3. verify the route, workspace id, campaign id, table id, source/action ids,
|
|
436
448
|
caps/dates, approval mode, blockers, and side-effect class still match the
|
|
437
449
|
packet;
|
|
438
450
|
4. execute only the exact packet;
|
|
439
|
-
5. after each terminal apply/prep/start result,
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
not a completed
|
|
451
|
+
5. after each terminal credit-refresh/apply/prep/start result, rerun
|
|
452
|
+
`get_refill_target_plan`, reread state, settle processing when needed,
|
|
453
|
+
recompute the horizon saturation ledger, and continue with the next smallest
|
|
454
|
+
safe action inside the same bounded packet until every selected sender is
|
|
455
|
+
saturated by projected coverage or blocked by evidence. Do not stop at
|
|
456
|
+
"loaded" or "awaiting scheduler" unless no in-packet MCP action remains and
|
|
457
|
+
the scheduler-settle loop times out; report that as a blocker, not a completed
|
|
458
|
+
refill.
|
|
446
459
|
|
|
447
460
|
In `--yolo`, do not stop after the first selected campaign if the request was
|
|
448
461
|
sender-scoped and more selected senders or same-packet start-eligible campaigns
|
|
@@ -464,8 +477,9 @@ Short form: in `--yolo`, go as far as the packet safely allows, then give exact
|
|
|
464
477
|
`--yolo` authorizes `start_campaign` only for selected `PAUSED` refill targets
|
|
465
478
|
named in the exact packet. It never authorizes starting unrelated, archived,
|
|
466
479
|
completed, draft, or direct campaigns, separate launch/send actions,
|
|
467
|
-
archive/delete cleanup, raw scheduler writes, sender reassignment,
|
|
468
|
-
|
|
480
|
+
archive/delete cleanup, raw scheduler writes, sender reassignment, paid-InMail
|
|
481
|
+
credit refreshes for senders not named in the packet, extra senders beyond the
|
|
482
|
+
eligible sender set, or higher caps than the packet named. In
|
|
469
483
|
sender-scoped `--yolo`, a bounded packet containing all eligible enrolled
|
|
470
484
|
senders and at most one best campaign per sender is covered; arbitrary expanded
|
|
471
485
|
campaign sets are not. If any state or scope drifts, stop and re-plan instead of
|
|
@@ -564,6 +578,10 @@ the current source or ask for more research instead of walking the ladder.
|
|
|
564
578
|
- Never expose internal direct campaign types as an operator refill path.
|
|
565
579
|
- Never claim scheduled success without rereading scheduler-owned cells with
|
|
566
580
|
non-null `scheduledFor`.
|
|
581
|
+
- Never call `refresh_paid_inmail_credits` except for exact sender ids named in
|
|
582
|
+
the rendered refill packet; after refresh, rerun `get_refill_target_plan` and
|
|
583
|
+
stop if the fresh status is still missing, stale, below threshold, or drifts to
|
|
584
|
+
a different campaign/table/column.
|
|
567
585
|
- No mutation in production unless Christian explicitly approves exact
|
|
568
586
|
workspace, campaign/table ids, source/action ids, caps/dates, approval mode,
|
|
569
587
|
expected side effects, and rollback/stop condition.
|