@sellable/mcp 0.1.413 → 0.1.414

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/README.md CHANGED
@@ -16,7 +16,7 @@ Each message gets 5+ minutes of Claude attention with deep research - no other t
16
16
 
17
17
  ### Prompt Source Of Truth
18
18
 
19
- There are six public Sellable entrypoints shared across hosts:
19
+ There are seven public Sellable entrypoints shared across hosts:
20
20
 
21
21
  - `sellable:create-campaign`
22
22
  - `sellable:create-ab-test`
@@ -24,6 +24,7 @@ There are six public Sellable entrypoints shared across hosts:
24
24
  - `sellable:foundation`
25
25
  - `sellable:content`
26
26
  - `sellable:create-post`
27
+ - `sellable:refill-sends`
27
28
 
28
29
  The create-campaign public wrapper at
29
30
  `mcp/sellable/skills/create-campaign/SKILL.md` handles auth/bootstrap and loads
@@ -63,6 +64,13 @@ reader value, validates proof/AI tells, and saves content artifacts under
63
64
 
64
65
  - `mcp/sellable/skills/create-post/SKILL.md`
65
66
 
67
+ The refill-sends public command wrapper plans and executes approval-gated send
68
+ refills. It supports `--yolo` and optional sender selectors such as
69
+ `--sender "Christian Reyes"` or typed MCP calls to `refill_sends({ yolo,
70
+ senders })` from:
71
+
72
+ - `mcp/sellable/skills/refill-sends/SKILL.md`
73
+
66
74
  Keep `create-campaign-v2` and `load-voice` internal. Do not advertise either as
67
75
  a public command. `load-voice` remains a direct MCP utility for generic writing
68
76
  surfaces that are not posts or campaigns.
@@ -186,10 +194,10 @@ The installer does the full local setup:
186
194
  After the installer passes, fully quit and reopen Codex Desktop. Start a new
187
195
  thread and select `Sellable Create Campaign`, `Sellable Create A/B Test`,
188
196
  `Sellable Create Evergreen Campaigns`, `Sellable Foundation`,
189
- `Sellable Content`, or `Sellable Create Post`; or invoke
197
+ `Sellable Content`, `Sellable Create Post`, or `Sellable Refill Sends`; or invoke
190
198
  `$sellable:create-campaign`, `$sellable:create-ab-test`,
191
199
  `$sellable:create-evergreen-campaigns`, `$sellable:foundation`,
192
- `$sellable:content`, or `$sellable:create-post`. If the app still says
200
+ `$sellable:content`, `$sellable:create-post`, or `$sellable:refill-sends`. If the app still says
193
201
  `mcp__sellable__*` tools are missing after the installer passes, check that
194
202
  `~/.codex/config.toml` contains both `[marketplaces.sellable]` and
195
203
  `[plugins."sellable@sellable"]`.
@@ -206,12 +214,14 @@ Use these names consistently:
206
214
  - Claude Code command: `/sellable:foundation`
207
215
  - Claude Code command: `/sellable:content`
208
216
  - Claude Code command: `/sellable:create-post`
217
+ - Claude Code command: `/sellable:refill-sends`
209
218
  - Codex command: `$sellable:create-campaign`
210
219
  - Codex command: `$sellable:create-ab-test`
211
220
  - Codex command: `$sellable:create-evergreen-campaigns`
212
221
  - Codex command: `$sellable:foundation`
213
222
  - Codex command: `$sellable:content`
214
223
  - Codex command: `$sellable:create-post`
224
+ - Codex command: `$sellable:refill-sends`
215
225
  - Codex Desktop plugin: `sellable@sellable`
216
226
  - Codex visible skill: `Sellable Create Campaign`
217
227
  - Codex visible skill: `Sellable Create A/B Test`
@@ -219,14 +229,17 @@ Use these names consistently:
219
229
  - Codex visible skill: `Sellable Foundation`
220
230
  - Codex visible skill: `Sellable Content`
221
231
  - Codex visible skill: `Sellable Create Post`
232
+ - Codex visible skill: `Sellable Refill Sends`
222
233
  - Codex skill frontmatter name: `create-campaign`
223
234
  - Codex skill frontmatter name: `create-ab-test`
224
235
  - Codex skill frontmatter name: `create-evergreen-campaigns`
225
236
  - Codex skill frontmatter name: `foundation`
226
237
  - Codex skill frontmatter name: `content`
227
238
  - Codex skill frontmatter name: `create-post`
239
+ - Codex skill frontmatter name: `refill-sends`
228
240
  - MCP server name: `sellable`
229
241
  - Internal workflow prompt: `create-campaign-v2`
242
+ - Internal workflow prompt: `refill-sends-workflow`
230
243
  - Internal/backward-compatible memory prompt: `interview`
231
244
 
232
245
  Never tell users to run `/sellable:create-campaign-v2`,
@@ -279,6 +292,13 @@ Use the create-campaign skill:
279
292
  /sellable:create-campaign
280
293
  ```
281
294
 
295
+ Use the refill command for sender send refills:
296
+
297
+ ```
298
+ /sellable:refill-sends --yolo
299
+ /sellable:refill-sends --sender "Christian Reyes" --sender "Thomas Nobbs"
300
+ ```
301
+
282
302
  Then describe intent naturally, for example:
283
303
 
284
304
  - "Let's make a campaign with sellable"
@@ -299,6 +319,13 @@ Use the Codex skill entrypoint:
299
319
  $sellable:create-campaign
300
320
  ```
301
321
 
322
+ Use the Codex refill command with the same flags:
323
+
324
+ ```
325
+ $sellable:refill-sends --yolo
326
+ $sellable:refill-sends --sender "Christian Reyes" --sender "Thomas Nobbs"
327
+ ```
328
+
302
329
  Installed skill package path:
303
330
 
304
331
  - `~/.codex/plugins/cache/sellable/sellable/<version>/skills/sellable-create-campaign/SKILL.md`
package/dist/index-dev.js CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
package/dist/server.js CHANGED
@@ -37,6 +37,7 @@ import { addOnDemandLeads, createOnDemandCampaign, createOnDemandTable, initOnDe
37
37
  import { upsertRubric } from "./tools/processing.js";
38
38
  import { completeSenderResearch, getPostFindLeadsScoutRegistry, getSourceScoutRegistry, getSubskillAsset, getSubskillPrompt, listSubskillPrompts, searchSubskillPrompts, } from "./tools/prompts.js";
39
39
  import { waitForCampaignTableReady, waitForLeadListReady, } from "./tools/readiness.js";
40
+ import { refillSendsCommand } from "./tools/refill-sends.js";
40
41
  import { allTools } from "./tools/registry.js";
41
42
  import { getRows, getTableRows, getTableRowsMinimal } from "./tools/rows.js";
42
43
  import { addRubricItem, checkRubric, deleteRubricItem, draftRubrics, saveRubrics, selectNecessaryRubrics, updateRubricItem, waitForRubricResults, } from "./tools/rubrics.js";
@@ -217,6 +218,9 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
217
218
  case "get_campaign_refill_state":
218
219
  result = await getCampaignRefillState(args);
219
220
  break;
221
+ case "refill_sends":
222
+ result = refillSendsCommand(args);
223
+ break;
220
224
  case "setup_evergreen_campaigns":
221
225
  result = await setupEvergreenCampaigns(args);
222
226
  markEvergreenSetupCampaignsDirty(args);
@@ -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" }) and get_campaign_refill_state before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; 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: calculate the bounded target from sender capacity when needed, then use the refill workflow to decide same-campaign source replenishment, enrichment/prep, approval/ready state, scheduler reread, and sender-health blockers. Do not create warm-post-engager side campaigns. 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. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; inspect reviewBatch/table selectors or use adaptive/wider bounded prep so appended rows are included. 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. Before source import, prep, or approval, require exact visible approval 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, but still do not launch. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if scheduler-owned scheduledFor cells are not present, report prepared/approved/ready - awaiting scheduler instead of success. Do not call start_campaign as part of fill/schedule horizon. Do not call start_campaign as part of refill sends. Launch/start is a separate explicit human action after the operator intentionally wants sends to go out, and it must still verify that the bounded cohort is the only approved cohort and must not broad approve-all. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until explicit launch/start approval outside refill sends.`,
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"; 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 two sender-local send days, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus future scheduler-owned scheduled sends and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting future scheduled and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Do not stop after filling only one sender when the request was sender-scoped. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. 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 operate on the reviewBatch first; inspect reviewBatch/table selectors or use adaptive/wider bounded prep so appended rows are included. 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. Before source import, prep, or approval, require exact visible approval 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, but still do not launch. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if scheduler-owned scheduledFor cells are not present, report prepared/approved/ready - awaiting scheduler instead of success. Do not call start_campaign as part of fill/schedule horizon. Do not call start_campaign as part of refill sends. Launch/start is a separate explicit human action after the operator intentionally wants sends to go out, and it must still verify that the bounded cohort is the only approved cohort and must not broad approve-all. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until explicit launch/start approval outside refill sends.`,
377
377
  },
378
378
  };
379
379
  }
@@ -0,0 +1,113 @@
1
+ type RefillSendsIntent = "plain" | "active" | "evergreen";
2
+ type RefillSendsApprovalMode = "approve" | "mark_ready";
3
+ type RefillSendsCommandInput = {
4
+ yolo?: boolean;
5
+ senders?: string[];
6
+ senderIds?: string[];
7
+ senderNames?: string[];
8
+ horizonSendDays?: number;
9
+ campaignId?: string;
10
+ tableId?: string;
11
+ intent?: RefillSendsIntent;
12
+ approvalMode?: RefillSendsApprovalMode;
13
+ };
14
+ export declare const refillSendsToolDefinitions: {
15
+ name: string;
16
+ description: string;
17
+ inputSchema: {
18
+ type: string;
19
+ properties: {
20
+ yolo: {
21
+ type: string;
22
+ description: string;
23
+ };
24
+ senders: {
25
+ type: string;
26
+ items: {
27
+ type: string;
28
+ };
29
+ description: string;
30
+ };
31
+ senderIds: {
32
+ type: string;
33
+ items: {
34
+ type: string;
35
+ };
36
+ description: string;
37
+ };
38
+ senderNames: {
39
+ type: string;
40
+ items: {
41
+ type: string;
42
+ };
43
+ description: string;
44
+ };
45
+ horizonSendDays: {
46
+ type: string;
47
+ minimum: number;
48
+ maximum: number;
49
+ description: string;
50
+ };
51
+ campaignId: {
52
+ type: string;
53
+ description: string;
54
+ };
55
+ tableId: {
56
+ type: string;
57
+ description: string;
58
+ };
59
+ intent: {
60
+ type: string;
61
+ enum: string[];
62
+ description: string;
63
+ };
64
+ approvalMode: {
65
+ type: string;
66
+ enum: string[];
67
+ description: string;
68
+ };
69
+ };
70
+ required: never[];
71
+ additionalProperties: boolean;
72
+ };
73
+ }[];
74
+ export declare function refillSendsCommand(input?: RefillSendsCommandInput): {
75
+ command: string;
76
+ tool: string;
77
+ promptName: string;
78
+ workflowPromptName: string;
79
+ yolo: boolean;
80
+ intent: RefillSendsIntent;
81
+ horizonSendDays: number;
82
+ approvalMode: RefillSendsApprovalMode;
83
+ campaignId: string | null;
84
+ tableId: string | null;
85
+ senderScope: string;
86
+ senderSelectors: {
87
+ senders: string[];
88
+ senderIds: string[];
89
+ senderNames: string[];
90
+ };
91
+ firstOperationalSteps: string[];
92
+ approvalContract: string;
93
+ forbiddenActions: string[];
94
+ hostExamples: {
95
+ claude: string[];
96
+ codex: string[];
97
+ mcpTool: {
98
+ name: string;
99
+ arguments: {
100
+ yolo: boolean;
101
+ senders: string[];
102
+ senderIds: string[];
103
+ senderNames: string[];
104
+ horizonSendDays: number;
105
+ campaignId: string | undefined;
106
+ tableId: string | undefined;
107
+ intent: RefillSendsIntent;
108
+ approvalMode: RefillSendsApprovalMode;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ export {};
@@ -0,0 +1,150 @@
1
+ const DEFAULT_HORIZON_SEND_DAYS = 2;
2
+ function normalizeStrings(values) {
3
+ if (!Array.isArray(values))
4
+ return [];
5
+ return [
6
+ ...new Set(values
7
+ .map((value) => (typeof value === "string" ? value.trim() : ""))
8
+ .filter(Boolean)),
9
+ ];
10
+ }
11
+ function normalizeHorizonSendDays(value) {
12
+ if (typeof value !== "number" || !Number.isFinite(value)) {
13
+ return DEFAULT_HORIZON_SEND_DAYS;
14
+ }
15
+ return Math.max(1, Math.min(7, Math.floor(value)));
16
+ }
17
+ export const refillSendsToolDefinitions = [
18
+ {
19
+ name: "refill_sends",
20
+ description: "Typed command entrypoint for Sellable refill sends. Accepts --yolo semantics and optional sender selectors, then returns the bounded execution contract for the skill-led refill workflow. This tool does not mutate campaigns, import leads, approve messages, schedule sends, launch, archive, delete, or write scheduler rows.",
21
+ inputSchema: {
22
+ type: "object",
23
+ properties: {
24
+ yolo: {
25
+ type: "boolean",
26
+ description: "When true, auto-accept the rendered bounded refill packet after the required fresh state reread. Without sender selectors, yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns.",
27
+ },
28
+ senders: {
29
+ type: "array",
30
+ items: { type: "string" },
31
+ description: "Optional sender selectors as names or ids. Use this for command text like --sender 'Christian Reyes'. Exact resolution still happens through list_senders before mutation.",
32
+ },
33
+ senderIds: {
34
+ type: "array",
35
+ items: { type: "string" },
36
+ description: "Optional exact Sender.id values to scope refill work.",
37
+ },
38
+ senderNames: {
39
+ type: "array",
40
+ items: { type: "string" },
41
+ description: "Optional sender display names to resolve through list_senders before campaign selection.",
42
+ },
43
+ horizonSendDays: {
44
+ type: "number",
45
+ minimum: 1,
46
+ maximum: 7,
47
+ description: "Number of sender-local send days to fill. Defaults to 2.",
48
+ },
49
+ campaignId: {
50
+ type: "string",
51
+ description: "Optional exact CampaignOffer.id to narrow routing. Do not pass campaign names.",
52
+ },
53
+ tableId: {
54
+ type: "string",
55
+ description: "Optional exact WorkflowTable.id to narrow routing. Do not pass table names.",
56
+ },
57
+ intent: {
58
+ type: "string",
59
+ enum: ["plain", "active", "evergreen"],
60
+ description: 'Route intent. Use "plain" for normal refill/load requests unless the user explicitly says active or evergreen.',
61
+ },
62
+ approvalMode: {
63
+ type: "string",
64
+ enum: ["approve", "mark_ready"],
65
+ description: 'Preparation mode for the final packet. Use "approve" only when the user asked to fill/schedule sender sends; otherwise default to "mark_ready".',
66
+ },
67
+ },
68
+ required: [],
69
+ additionalProperties: false,
70
+ },
71
+ },
72
+ ];
73
+ export function refillSendsCommand(input = {}) {
74
+ const senders = normalizeStrings(input.senders);
75
+ const senderIds = normalizeStrings(input.senderIds);
76
+ const senderNames = normalizeStrings(input.senderNames);
77
+ const hasSenderSelectors = senders.length > 0 || senderIds.length > 0 || senderNames.length > 0;
78
+ const yolo = input.yolo === true;
79
+ const horizonSendDays = normalizeHorizonSendDays(input.horizonSendDays);
80
+ const intent = input.intent ?? "plain";
81
+ const approvalMode = input.approvalMode ?? (yolo ? "approve" : "mark_ready");
82
+ const senderScope = hasSenderSelectors
83
+ ? "selected_senders"
84
+ : yolo
85
+ ? "all_eligible_healthy_senders_enrolled_in_active_campaign_backed_sequences"
86
+ : "ask_user_for_eligible_enrolled_senders_before_mutation";
87
+ return {
88
+ command: "refill-sends",
89
+ tool: "refill_sends",
90
+ promptName: "refill-sends",
91
+ workflowPromptName: "refill-sends-workflow",
92
+ yolo,
93
+ intent,
94
+ horizonSendDays,
95
+ approvalMode,
96
+ campaignId: input.campaignId ?? null,
97
+ tableId: input.tableId ?? null,
98
+ senderScope,
99
+ senderSelectors: {
100
+ senders,
101
+ senderIds,
102
+ senderNames,
103
+ },
104
+ firstOperationalSteps: [
105
+ 'Load get_subskill_prompt({ subskillName: "refill-sends-workflow" }) before any product operation.',
106
+ `Resolve route with resolve_campaign_fill_route({ intent: "${intent}"${input.campaignId ? `, campaignId: "${input.campaignId}"` : ""}${input.tableId ? `, tableId: "${input.tableId}"` : ""} }).`,
107
+ "Call list_senders and get_sender_routing, then resolve sender selectors against active enrolled campaign-backed sequence senders.",
108
+ "Read get_campaign_refill_state for enough exact candidate campaigns to pick the best per-sender target by recent/future scheduler-owned sends, then recent result evidence, then source health.",
109
+ "Fresh reread get_campaign_refill_state immediately before any import, prep, approval, or horizon-fill mutation.",
110
+ ],
111
+ approvalContract: yolo
112
+ ? "Auto-accept only the rendered bounded refill packet after fresh reread. Stop if sender set, route, ids, caps, dates, blockers, or side-effect class drift."
113
+ : hasSenderSelectors
114
+ ? "Ask the final Accept/Decline structured approval question before mutation, including workspace, sender scope, campaign table, exact ids, caps/dates, side effects, forbidden actions, and stop condition."
115
+ : "Ask which eligible enrolled senders to refill first, then ask the final Accept/Decline structured approval question before mutation.",
116
+ forbiddenActions: [
117
+ "start_campaign",
118
+ "launch or send",
119
+ "archive or delete cleanup",
120
+ "direct scheduler writes",
121
+ "sender reassignment",
122
+ "campaigns outside the rendered eligible sender packet",
123
+ "on-demand or unrelated active-campaign fallback unless the refill workflow proves the selected same-sender lane is blocked or exhausted",
124
+ ],
125
+ hostExamples: {
126
+ claude: [
127
+ "/sellable:refill-sends --yolo",
128
+ '/sellable:refill-sends --sender "Christian Reyes" --sender "Thomas Nobbs"',
129
+ ],
130
+ codex: [
131
+ "$sellable:refill-sends --yolo",
132
+ '$sellable:refill-sends --sender "Christian Reyes" --sender "Thomas Nobbs"',
133
+ ],
134
+ mcpTool: {
135
+ name: "refill_sends",
136
+ arguments: {
137
+ yolo,
138
+ senders,
139
+ senderIds,
140
+ senderNames,
141
+ horizonSendDays,
142
+ campaignId: input.campaignId,
143
+ tableId: input.tableId,
144
+ intent,
145
+ approvalMode,
146
+ },
147
+ },
148
+ },
149
+ };
150
+ }
@@ -33,6 +33,7 @@ import { onDemandToolDefinitions } from "./one-off.js";
33
33
  import { processingToolDefinitions } from "./processing.js";
34
34
  import { promptToolDefinitions } from "./prompts.js";
35
35
  import { readinessToolDefinitions } from "./readiness.js";
36
+ import { refillSendsToolDefinitions } from "./refill-sends.js";
36
37
  import { rowToolDefinitions } from "./rows.js";
37
38
  import { rubricToolDefinitions } from "./rubrics.js";
38
39
  import { senderRoutingToolDefinitions } from "./sender-routing.js";
@@ -49,6 +50,7 @@ export const allTools = [
49
50
  ...campaignAbTestToolDefinitions,
50
51
  ...campaignFillRoutingToolDefinitions,
51
52
  ...campaignRefillStateToolDefinitions,
53
+ ...refillSendsToolDefinitions,
52
54
  ...setupEvergreenCampaignsToolDefinitions,
53
55
  ...campaignHorizonFillToolDefinitions,
54
56
  ...campaignMessagePreparationToolDefinitions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.413",
3
+ "version": "0.1.414",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -123,6 +123,7 @@ such as "fill campaigns", "fill up", "refill sends", "max out sends", or
123
123
  ```text
124
124
  get_subskill_prompt({ subskillName: "refill-sends-workflow" })
125
125
  resolve_campaign_fill_route({ intent:"plain" })
126
+ list_senders
126
127
  get_campaign_refill_state
127
128
  ```
128
129
 
@@ -133,15 +134,27 @@ campaign refill. Route outcomes are `route:"evergreen_horizon"`,
133
134
  returns `route:"ask_create"`, ask whether to create a normal campaign or
134
135
  evergreen campaigns. Campaign creation is allowed only after this route and
135
136
  explicit user selection; it is never the default response to plain fill. When
136
- more leads are needed, the refill workflow must recommend same-campaign
137
- source-ladder replenishment; do not create warm-post-engager side campaigns,
138
- on-demand campaigns, or unrelated campaigns. Surface sender-health blockers
139
- separately from prepared/approved/scheduled counts.
137
+ choosing among active targets, use refill-state scheduled-count evidence to
138
+ continue the campaign that most recently had scheduler-owned sends for the
139
+ relevant sender set; do not treat every active campaign as a refill candidate.
140
+ In `--yolo` fill/refill mode, default to one best recent-send campaign and a
141
+ two-send-day horizon: subtract future scheduler-owned scheduled sends and
142
+ ready-to-schedule rows from healthy sender daily capacity, then prepare only
143
+ that bounded gap.
144
+ When more leads are needed, the refill workflow must recommend same-campaign
145
+ source-ladder replenishment first; do not create warm-post-engager side
146
+ campaigns, on-demand campaigns, or unrelated campaigns. If same-source copy hits
147
+ `USER_ADDED_ROWS_LIMIT_EXCEEDED`, split the current source into a bounded
148
+ same-source LinkedIn profile list, confirm that smaller list into the same
149
+ campaign, and operate on the copied review batch first. Surface sender-health
150
+ blockers separately from prepared/approved/scheduled counts.
140
151
 
141
152
  Treat active fills as capacity-fill preparation: calculate the bounded target
142
153
  from sender capacity when needed, then use the refill workflow to decide source
143
- replenishment, enrichment/prep, approval policy, and scheduler proof. Mutation
144
- requires exact visible approval and a fresh `get_campaign_refill_state` reread.
154
+ replenishment, enrichment/prep, approval policy, and scheduler proof. Present
155
+ operator decisions by campaign name and sender name first, with campaign/table
156
+ ids as proof only. Mutation requires exact visible approval and a fresh
157
+ `get_campaign_refill_state` reread.
145
158
  For already-running regular campaigns that need Signal Discovery source
146
159
  replenishment, the refill workflow owns the guarded recovery: clear
147
160
  `currentStep` only with `clearCurrentStepIfMatches:"running"`, load the
@@ -55,12 +55,6 @@ raise your hand for X (creepy to reach out based on that, i know) - but
55
55
  this felt too on the nose to ignore"` shapes only when the source was an
56
56
  explicit lead-magnet comment, reply, or opt-in.
57
57
 
58
- Shared evergreen exception: for Shared Signal Discovery and other shared
59
- evergreen lanes, the weak-signal permissioned bridge above is still a tell.
60
- Reject `hope this is relevant`, `might be interested`, and `saw you in a few
61
- conversations` as openers; require a concrete signal/problem bridge or omit the
62
- source line.
63
-
64
58
  **Severity:** REJECT
65
59
 
66
60
  ## Tell #3 — Explicit date or duration references about the recipient
@@ -203,32 +203,6 @@ Why it works:
203
203
  **Proof ranks used:** rank 1 (mechanism - 1,000+ conditions from one blood
204
204
  draw), rank 3 (risk before claims).
205
205
 
206
- Do not use the Superpower weak-signal hedge pattern for Shared Evergreen Signal Discovery. Shared evergreen lanes are reused across multiple senders and must not open with `hope this is relevant`, `might be interested`, or `saw you in a few conversations`. Use the safe pattern below instead.
207
-
208
- ### Shared Evergreen Signal Discovery Safe Pattern
209
-
210
- Use when the campaign is a shared evergreen signal lane and the source signal is
211
- real but not sender-owned.
212
-
213
- ```text
214
- Hey {{first_name}},
215
-
216
- The AI-assisted GTM conversations keep coming back to one problem: turning good LinkedIn signal into review-ready pipeline without another outbound dashboard.
217
-
218
- Sellable helps teams find signal-matched prospects, filter for fit, and generate reviewed LinkedIn copy from one workflow.
219
-
220
- Curious if LinkedIn outbound is a channel you're trying to make more reliable this quarter?
221
- ```
222
-
223
- Why it works:
224
-
225
- - no low-confidence relevance hedge
226
- - no `I'm building` or founder-only first person
227
- - no internal workflow vocabulary such as Codex, MCP, agent workflows, workflow
228
- table, lead source, or signal discovery
229
- - the signal becomes a buyer problem instead of an activity-log opener
230
- - safe for multiple senders attached to the same shared lane
231
-
232
206
  ## Conditional Examples
233
207
 
234
208
  Use these only when the campaign motion matches.
@@ -445,25 +419,24 @@ Tokenized shape:
445
419
  Hey there
446
420
 
447
421
  Thanks for the support on my post about {{post_topic_line}}
422
+
423
+ Curious, is this something you're dealing with right now?
448
424
  ```
449
425
 
450
426
  Transfer rules:
451
427
 
452
428
  - Do not hardcode a post topic. Fill `{{post_topic_line}}` from the actual
453
429
  selected sender-authored post or use a safer source-specific phrase.
454
- - Do not add a relevance question, CTA, product line, or extra paragraph after
455
- the thank-you line. The reply-rate lesson is the casual warm acknowledgment,
456
- not a cold pitch appended to it.
457
430
  - Do not use "showing some love"; it reads too casual for executive/VP/director
458
431
  contacts.
459
432
  - Keep the thank-you line. The point of this motion is acknowledging real
460
- sender-owned support without appending a cold relevance question. Do not
461
- flatten it back to "saw you pop up" unless the sender specifically asks for
462
- that wording.
433
+ sender-owned support before asking a light relevance question. Do not flatten
434
+ it back to "saw you pop up" unless the sender specifically asks for that
435
+ wording.
463
436
  - Do not copy this shape into shared lanes, third-party thread sources, or cold
464
437
  fallback campaigns.
465
- - Do not pitch, ask for a meeting, or mention internal product vocabulary in
466
- message one.
438
+ - Keep the question closed and problem-oriented; do not pitch, ask for a
439
+ meeting, or mention internal product vocabulary in message one.
467
440
 
468
441
  ## Useful CTA Shapes
469
442
 
@@ -199,21 +199,11 @@ Shape:
199
199
  Prefer:
200
200
 
201
201
  - lowercase or casual casing when the motion supports it
202
- - an honest line like "hope this is relevant" or "so may be off, but this seemed relevant" only for non-evergreen weak-signal campaigns
202
+ - an honest line like "hope this is relevant" or "so may be off, but this seemed relevant"
203
203
  - a concrete CTA that names the useful conversation or asset
204
204
  - binary options only when the brief explicitly supports two real next steps
205
205
  - direct wording over polished marketing language
206
206
 
207
- Shared Evergreen Signal Discovery override:
208
-
209
- - Do not use `hope this is relevant`, `might be interested`, or `saw you in a
210
- few conversations` as the opener.
211
- - Do not use `I'm building`, `I've mapped`, `my company`, or `my team`.
212
- - Turn the source topic into a buyer problem bridge, then write the product line
213
- in team/company voice.
214
- - If the source topic cannot support a concrete bridge, omit the source line and
215
- start from a role/company/problem observation.
216
-
217
207
  Avoid:
218
208
 
219
209
  - copying a gimmick like "from a claude code terminal" unless the brief
@@ -74,7 +74,7 @@ Revise or reject the sample when any of these happen.
74
74
  - **actions are implied, not stated** — e.g. "runs that chain as AI agents" when a clearer version would name the specific actions (verb + object, one per line)
75
75
  - **category-level opener used when a per-lead signal exists** — if `lead-sample.json` carries any per-lead signal (post, hire, visible tool, topic engagement), the opener must reference it. Category-level openers of shape `"Most [category] teams still do X by hand"` are only acceptable when zero per-lead signal is in the sample. When a category-level opener is used as fallback, Findings must flag it explicitly
76
76
  - **mind-reading from engagement signals** — a topic engagement, post, public activity, role, company, or hiring trigger does not prove buyer intent. Reject phrases like `"AI-GTM stack is clearly on your mind"`, `"you're clearly focused on..."`, `"obviously relevant"`, or `"already thinking about..."` unless that exact priority is explicitly present in `lead-sample.json`. Translate to low-certainty buyer context or omit the signal from copy.
77
- - **source-y signal narration** — reject `"saw you on..."`, `"saw you engaging with..."`, `"you commented on..."`, `"your LinkedIn activity..."`, `"you might not remember the thread..."`, `"found you through [source] and your role looked close..."`, or any line that makes the recipient feel watched unless the chosen archived motion is intentionally self-aware about the signal. For sender-owned LinkedIn post sources, a light first-person acknowledgment is allowed when row data proves a reaction/comment: `"appreciate you showing some love on my post about [topic]"` or `"thanks for showing support on my [topic] post"`. Do not name a comment unless comment text is present. Follow the acknowledgment with a soft relevance bridge before broad pain/product copy, e.g. `"figured this might be relevant if LinkedIn is becoming more of a GTM channel for [company]"`. For third-party LinkedIn-post-sourced campaigns, a topic-level bridge is allowed when it explains why the note exists and stays apologetically uncertain: `"saw you in a few conversations about [topic], so may be off, but this seemed relevant."`, `"saw you in a few conversations around [topic], so hope this is relevant."`, or `"found you in a thread about [topic], so may be off, but this seemed relevant."` Shared evergreen signal exception: these hedges are blocked for Shared Signal Discovery and other shared evergreen lanes; use a concrete signal/problem bridge or omit the source line. Reserve `"raise your hand"` language for explicit lead-magnet comments, replies, or opt-ins. Translate the signal into natural buyer context or omit it.
77
+ - **source-y signal narration** — reject `"saw you on..."`, `"saw you engaging with..."`, `"you commented on..."`, `"your LinkedIn activity..."`, `"you might not remember the thread..."`, `"found you through [source] and your role looked close..."`, or any line that makes the recipient feel watched unless the chosen archived motion is intentionally self-aware about the signal. For sender-owned LinkedIn post sources, a light first-person acknowledgment is allowed when row data proves a reaction/comment: `"appreciate you showing some love on my post about [topic]"` or `"thanks for showing support on my [topic] post"`. Do not name a comment unless comment text is present. Follow the acknowledgment with a soft relevance bridge before broad pain/product copy, e.g. `"figured this might be relevant if LinkedIn is becoming more of a GTM channel for [company]"`. For third-party LinkedIn-post-sourced campaigns, a topic-level bridge is allowed when it explains why the note exists and stays apologetically uncertain: `"saw you in a few conversations about [topic], so may be off, but this seemed relevant."`, `"saw you in a few conversations around [topic], so hope this is relevant."`, or `"found you in a thread about [topic], so may be off, but this seemed relevant."` Reserve `"raise your hand"` language for explicit lead-magnet comments, replies, or opt-ins. Translate the signal into natural buyer context or omit it.
78
78
  - **sender-owned source rendered as third-party** — hard fail when the source post is sender-owned and the draft says `"found you in a thread"`, `"saw you in a thread"`, `"saw you in conversations"`, or `"saw you in a few conversations"` as if the post were third-party. For sender-owned sources, the copy must either use a light first-person acknowledgment plus a soft relevance bridge, or omit the source line. If multiple senders may send the campaign, or the final sender/source-owner match is ambiguous, do not assume a specific `my post` voice or name a specific sender; omit the sender-owned source line until row-level sender ownership is proven. Neutral low-certainty thread/source language is only for truly third-party sources.
79
79
  - **fake line-to-line continuity** — reject line stacks where the source acknowledgment, relevance bridge, product line, and CTA do not actually build on each other. Each line must make the next line feel earned. If two adjacent lines could be swapped, deleted, or joined with `"anyway"` without changing the meaning, the transition is fake. In sender-owned post campaigns, the chain should be: support on my post -> why this topic may matter for the company -> what the product/problem does about that same topic -> low-friction next step.
80
80
  - **assumptive title-fit opener** — reject `"Your [role] role at [company] looked close to this problem"` or `"looked close to this outbound campaign problem"`. This asserts fit from title/company. Keep the apologetic uncertainty instead: `"may be off, but if [workflow] is relevant to what you're working on..."`.