@sellable/mcp 0.1.410 → 0.1.411

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.
@@ -3,9 +3,6 @@ name: refill-sends-workflow
3
3
  description: Internal skill-led refill sends workflow for regular campaigns and evergreen campaigns.
4
4
  visibility: internal
5
5
  allowed-tools:
6
- - mcp__sellable__list_senders
7
- - mcp__sellable__get_sender_routing
8
- - mcp__sellable__get_campaign_waterfall
9
6
  - mcp__sellable__resolve_campaign_fill_route
10
7
  - mcp__sellable__get_campaign_refill_state
11
8
  - mcp__sellable__fill_campaign_horizon
@@ -36,7 +33,6 @@ allowed-tools:
36
33
  - mcp__sellable__get_table_rows
37
34
  - mcp__sellable__get_campaign_table_schema
38
35
  - mcp__sellable__select_campaign_cells
39
- - mcp__sellable__queue_campaign_cells
40
36
  - mcp__sellable__wait_for_campaign_processing
41
37
  - mcp__sellable__get_sender
42
38
  ---
@@ -52,45 +48,15 @@ prep, readiness, and evergreen primitives.
52
48
  Plain phrases that enter here include "fill", "refill sends", "max out sends",
53
49
  "load everyone up", and "fill horizon sends".
54
50
 
55
- Sender-scoped phrases include "refill senders", "fill senders", "max out
56
- senders", and "load everyone up". A sender-scoped request targets senders
57
- enrolled in active campaign-backed sequence campaigns, not one arbitrary active
58
- campaign.
59
-
60
51
  1. Call `resolve_campaign_fill_route` first. Use `intent:"plain"` for generic
61
52
  fill/load language, `intent:"active"` only when the user explicitly narrowed
62
53
  to active regular campaigns, and `intent:"evergreen"` only when the user
63
54
  explicitly asked for evergreen or horizon work.
64
- 2. Resolve sender context before choosing a target. Call `list_senders`; when a
65
- managed program is involved, also call `get_campaign_waterfall`, and call
66
- `get_sender_routing` when territory rules may constrain sender eligibility.
67
- If the user named senders, map those names to exact sender ids. If the user
68
- did not name senders and the request is sender-scoped:
69
- - in `--yolo`, target all eligible healthy senders enrolled in active
70
- campaign-backed sequence campaigns returned by the route/state evidence;
71
- - outside `--yolo`, ask which eligible enrolled senders to refill before
72
- choosing campaigns or mutating.
73
- If the request is campaign-scoped or ambiguous "fill sends" language, infer
74
- the relevant senders from the most recent scheduler-owned sends in
75
- refill-state readbacks and report that inference.
76
- Short form: `--yolo refill senders` means all eligible enrolled senders; non-yolo asks which enrolled senders.
77
- 3. Read `get_campaign_refill_state` for candidate campaigns from the resolver
78
- result. For a broad `active_campaigns` route, inspect enough candidates to
79
- identify the campaign or small campaign set that most recently had
80
- scheduler-owned sends for the relevant sender set. Do not stop after the
81
- first resolver target unless it is also the most recent sender-relevant send
82
- lane.
83
- Short form: Do not stop after the first resolver target unless recent-send evidence supports it.
84
- In `--yolo` sender-scoped mode, selecting every active campaign is still a
85
- scope error, but selecting one best refill campaign per eligible sender is
86
- expected. Pick the single highest-ranked recent-send or best-result campaign
87
- for each target sender unless the refill-state evidence proves that a sender
88
- already has enough ready/scheduled rows across enrolled campaigns or that a
89
- different same-sender campaign is needed because the best lane is blocked.
90
- Short form: `--yolo refill senders` selects all eligible enrolled senders, then the best campaign per sender.
91
- 4. Pick exact ids from the selected refill-state response. Do not use campaign
92
- names or table names as target identifiers for tool calls.
93
- 5. Classify the target from refill state:
55
+ 2. Pick exact ids from the resolver result. Do not use campaign names or table
56
+ names as target identifiers.
57
+ 3. Call `get_campaign_refill_state` for the selected `campaignId` or `tableId`.
58
+ This must be the next target-specific research primitive.
59
+ 4. Classify the target from refill state:
94
60
  - regular campaign: campaign-backed workflow table with normal source,
95
61
  sequence, senders, and send/refill stages.
96
62
  - evergreen campaign: managed always-on lane with current source evidence.
@@ -111,10 +77,7 @@ Use the refill-state response as the current facts receipt:
111
77
  approved, ready to schedule, scheduled;
112
78
  - active message prep job;
113
79
  - scheduler-owned scheduled counts by date/action from cells with non-null
114
- `scheduledFor`; treat these as the last sends/continuation signal;
115
- - latest scheduled send date, latest scheduled-cell update when present,
116
- sender overlap with the requested or inferred sender set, and whether future
117
- scheduled sends already exist;
80
+ `scheduledFor`;
118
81
  - `freshness.stateHash` and exact campaign/table/workspace ids.
119
82
 
120
83
  Empty or unsafe states stop with the blocker: no fillable target, missing or deleted campaign,
@@ -126,76 +89,9 @@ scheduler, or unsupported direct campaign type.
126
89
 
127
90
  For regular campaign workspaces, rank regular campaigns from route and
128
91
  `get_campaign_refill_state` evidence. Choose the best existing refill target.
129
- The default campaign-scoped refill interpretation is "continue the campaign that
130
- was actually sending most recently for the relevant available senders", not
131
- "touch every active campaign". The default sender-scoped refill interpretation is
132
- "fill every eligible target sender from the best enrolled active campaign for
133
- that sender", not "fill only the first/best campaign globally".
134
-
135
- Default `--yolo` horizon is two send days when the user asks to fill, refill,
136
- load, or max sends without naming a different horizon. Send days are sender-local
137
- days with configured sending hours; do not treat weekends or other no-send-hour
138
- days as fillable capacity. If the user explicitly names a no-send calendar date,
139
- report that date as unschedulable and continue only for the next valid send day
140
- when the packet says "send days" or the user asked to max/refill senders broadly.
141
-
142
- For campaign-scoped requests, compute the target from the selected campaign's
143
- healthy sender daily capacity for the next two send days, minus already
144
- scheduler-owned future scheduled sends for those days and minus rows already
145
- ready to schedule. For sender-scoped requests, compute that gap per target sender
146
- across all active enrolled campaigns for that sender; count future scheduled
147
- cells and ready-to-schedule cells in any active enrolled campaign toward that
148
- sender's gap before preparing more rows. If ready/scheduled rows already cover a
149
- sender's gap, do not add rows or prep for that sender; report that the sender is
150
- loaded and awaiting the scheduler. If the gap is positive, prepare only the gap
151
- in the best same-sender campaign and keep all source-copy/prep caps tied to that
152
- two-day packet.
153
- Short form: default `--yolo refill senders` target is each eligible sender's two-send-day gap.
154
-
155
- Rank candidates in this order:
156
-
157
- 1. **Sender match**: campaigns whose healthy sender ids match the user-named
158
- senders, or the inferred sender set when the user said only "fill sends" or
159
- "load senders". Do not include campaigns merely because they are active when
160
- their sender set is unrelated.
161
- 2. **Recent sends**: campaigns with the newest scheduler-owned scheduled counts
162
- and non-null `scheduledFor` cells for those senders. Future scheduled sends
163
- are stronger continuation evidence than old historical sends; otherwise use
164
- the latest scheduled send date / newest scheduled-cell update from refill
165
- state.
166
- 3. **Continuation capacity**: campaigns with healthy senders, remaining daily
167
- capacity, and a gap between current ready-to-schedule rows and the desired
168
- sender capacity.
169
- 4. **Same-campaign source health**: prefer campaigns whose current source has
170
- enough `sourceAvailable` inventory to prepare the gap. If source inventory
171
- is low or exhausted, choose same-campaign row replenishment before switching
172
- campaigns.
173
- 5. **Campaign scope**: keep the selected set small. For campaign-scoped
174
- requests, normally choose one campaign. For sender-scoped requests, choose at
175
- most one best campaign per target sender unless evidence shows one sender
176
- needs multiple same-sender campaigns because the first is blocked or already
177
- loaded.
178
-
179
92
  Do not create side campaigns, warm-post-engager side campaigns, on-demand campaigns,
180
93
  or unrelated campaigns as the default answer to a fill request.
181
94
 
182
- For each selected campaign, decide the next action by the smallest sufficient
183
- step:
184
-
185
- - **Enrich/prep more rows in the same campaign** when sender health is good,
186
- recent sends point to this campaign, and `sourceAvailable` can cover the
187
- ready-to-schedule gap.
188
- - **Add/import more rows to the same campaign/source path** when the campaign is
189
- the right recent-send lane but source inventory or viable rows cannot cover
190
- the gap.
191
- - **Use a different existing campaign** only when the recent-send/best-result
192
- campaign for that sender is blocked, archived, missing sequence/source/senders,
193
- disconnected, exhausted with no viable same-campaign replenishment path,
194
- already loaded while the sender still has a gap, or the user explicitly asks
195
- to move to another campaign.
196
- - **Ask what to create** only after resolver/state evidence shows there is no
197
- suitable existing campaign for the requested sender set.
198
-
199
95
  When the best regular campaign is source-exhausted, recommend same-campaign source-ladder replenishment.
200
96
  Keep `selectedLeadListId` source identity distinct
201
97
  from the campaign `workflowTableId`.
@@ -213,30 +109,6 @@ Source replenishment choices:
213
109
  source prospects into the same campaign/source-list path, then confirm
214
110
  readiness.
215
111
 
216
- When reusing an existing source list on an already-large campaign, handle the
217
- campaign-table row cap automatically in `--yolo` mode. If `confirm_lead_list`
218
- fails with `USER_ADDED_ROWS_LIMIT_EXCEEDED`, parse `remainingRows`,
219
- `currentRows`, `requestedRows`, and `maxRows`; do not stop just because the full
220
- source list is too large. Instead, create a bounded same-source split:
221
-
222
- 1. choose a split size no larger than `remainingRows`, the two-day refill row
223
- budget, and the first-pass processing cap unless the packet named a higher
224
- cap;
225
- 2. read compact rows from the current `selectedLeadListId` with
226
- `get_rows_minimal`;
227
- 3. create a temporary bounded LinkedIn profile source list with
228
- `load_csv_linkedin_leads`, preserving useful source columns such as post URL,
229
- post author, engagement type/text, keyword, confidence, and why;
230
- 4. call `confirm_lead_list` with that bounded source-list id, the same campaign
231
- id, and `currentStep:"running"` for ACTIVE campaigns;
232
- 5. verify the campaign table row count and review batch with
233
- `get_campaign_table_schema` before any prep/approval.
234
-
235
- Do not use `add_on_demand_leads` or create an on-demand table as the automatic
236
- regular-campaign fallback. The fallback must stay same-campaign and
237
- source-list-backed.
238
- Short form: row-cap fallback means bounded same-source split, not stop or on-demand.
239
-
240
112
  ### Running Campaign Signal Discovery Recovery
241
113
 
242
114
  For an already-running regular campaign that needs same-campaign Signal
@@ -274,10 +146,10 @@ returns to Running after same-campaign source rows are copied. Do not call
274
146
  post-copy state transition.
275
147
 
276
148
  Before any source mutation, show exact approval evidence: workspace id,
277
- campaign name, campaign id, workflow table id, source/provider id, source-list
278
- id when known, import caps, target dates/caps, dedupe/DNC/provider exclusion expectations, and expected row side effects. Present the campaign name and plain-English reason first; include ids only as proof and execution targets.
279
- Then reread `get_campaign_refill_state`; if `freshness.stateHash` or exact ids
280
- changed, stop and ask for a fresh approval.
149
+ campaign id, workflow table id, source/provider id, source-list id when known,
150
+ import caps, target dates/caps, dedupe/DNC/provider exclusion expectations, and
151
+ expected row side effects. Then reread `get_campaign_refill_state`; if
152
+ `freshness.stateHash` or exact ids changed, stop and ask for a fresh approval.
281
153
 
282
154
  After source import, call `wait_for_lead_list_ready` and `confirm_lead_list`
283
155
  with the source-list id and campaign id. Imports append to the existing
@@ -307,87 +179,18 @@ Before prep or approval mutation, reread `get_campaign_refill_state` and compare
307
179
  If they changed, stop. A second concurrent refill run must see the first run's
308
180
  import/prep state on reread and avoid duplicate work.
309
181
 
310
- After the final reread and before the first mutating refill primitive, render
311
- one final approval packet in campaign-name-first language, then ask a
312
- host-native structured question with exactly two choices: `Accept` and
313
- `Decline`. The question is the execution boundary.
314
- Short form: exactly two choices: `Accept` and `Decline`.
315
-
316
- - In Codex interactive sessions, use `request_user_input`.
317
- - In Claude Code interactive sessions, use `AskUserQuestion`.
318
- - The question body must include this exact operator output packet shape before
319
- the choices:
320
- - workspace name/id and mode (`--yolo` or approval-required);
321
- - sender scope, including selected sender names and skipped sender names with
322
- health/enrollment reasons;
323
- - a campaign-by-campaign plan table with campaign name, sender names, action,
324
- target count/cap, source/list, and blocker/skip reason;
325
- - exact workspace id, campaign id, workflow table id, source/action ids when
326
- relevant, freshness/state hash, caps/dates, approval mode, and the next
327
- MCP primitive to call;
328
- - expected side effects, forbidden actions, and the stop/rollback condition.
329
- - The `Accept` choice must name the exact campaign, workspace id, campaign id,
330
- workflow table id, source/action ids when relevant, caps/dates, approval mode,
331
- expected side effects, and stop/rollback condition.
332
- - The `Decline` choice must stop with no mutation.
333
- - Do not proceed from a plain chat "ok", "yes", "go", or "do it" when the
334
- structured question tool is available. If the structured question tool is not
335
- available in an interactive session, stop and tell the user the quick question
336
- panel is required for refill approvals. In non-interactive exec/automation,
337
- print the approval packet and stop before mutation.
338
-
339
- `--yolo` mode is explicit auto-accept. If Christian includes `--yolo` in the
340
- same refill request, do not ask the `Accept` / `Decline` question. Instead:
341
-
342
- 1. render the same final approval packet;
343
- 2. reread `get_campaign_refill_state`;
344
- 3. verify the route, workspace id, campaign id, table id, source/action ids,
345
- caps/dates, approval mode, blockers, and side-effect class still match the
346
- packet;
347
- 4. execute only the exact packet.
348
-
349
- `--yolo` never authorizes launch/start, sending, archive/delete cleanup, raw
350
- scheduler writes, sender reassignment, unrelated campaigns, extra senders beyond
351
- the eligible sender set, or higher caps than the packet named. In sender-scoped
352
- `--yolo`, a bounded packet containing all eligible enrolled senders and at most
353
- one best campaign per sender is covered; arbitrary expanded campaign sets are
354
- not. If any state or scope drifts, stop and re-plan instead of auto-accepting the
355
- changed action.
356
- Short form: all eligible enrolled senders are covered by sender-scoped `--yolo`; arbitrary expanded campaign sets are not.
357
- Short form: direct scheduler writes are not covered by `--yolo`.
358
- Short form: stop and re-plan instead of auto-accepting the changed action.
359
-
360
182
  After same-campaign source copy, inspect the actual campaign-table position of
361
183
  the copied rows before starting prep. Newly copied rows often land after the first 100 table rows. Use `get_campaign_table_schema` to read the `reviewBatch`,
362
184
  then use `select_campaign_cells` diagnostics against
363
185
  `rowSelector:{ type:"reviewBatch" }` for `enrich`, `generateMessage`, and
364
186
  `approved` roles when needed.
365
187
 
366
- For bounded split refills, operate on the review batch first. Queue
367
- `queue_campaign_cells` for `columnRole:"enrich"` on
368
- `rowSelector:{ type:"reviewBatch" }`, wait for campaign processing, then queue
369
- `columnRole:"generateMessage"` for the same review batch or
370
- `needsGeneratedMessage` rows. If the bounded packet explicitly uses
371
- `approvalMode:"approve"` because the user asked to fill/schedule sends or
372
- provided `--yolo` for a two-day send fill, approve only the bounded review-batch
373
- cohort after current generated messages exist. Do not broad approve existing
374
- table rows.
375
-
376
188
  If review-batch enrich cells are pending or Generate Message cells are
377
189
  dependency-blocked, omit `maxRowsToCheck` so the adaptive prep job can cover the
378
190
  bounded table scan, or set a bounded cap high enough to include appended rows
379
191
  when row count evidence requires it. Do not run a fixed `maxRowsToCheck:100` prep pass after appending rows to a larger existing campaign table; it can spend
380
192
  the whole budget on older rows and miss the refill batch.
381
193
 
382
- Bound `targetPreparedMessages` to the actual ready-to-schedule gap for the
383
- selected campaign and sender set. In sender-scoped mode, compute and report the
384
- gap per sender. If ready/scheduled rows across active enrolled campaigns already
385
- cover a sender's gap, do not start prep for that sender; report that the sender
386
- is already loaded and awaiting the scheduler. If source inventory is available
387
- and the gap is small, prepare only the sender gap instead of filling every active
388
- campaign.
389
- Short form: prepare only the per-sender gap instead of filling every active campaign.
390
-
391
194
  Scheduled success requires a post-action reread proving scheduler-owned cells
392
195
  with non-null `scheduledFor`. Prepared, approved, and ready-to-schedule rows are
393
196
  intermediate states; report them as awaiting scheduler unless scheduled cells
@@ -422,24 +225,9 @@ the current source or ask for more research instead of walking the ladder.
422
225
  - No mutation in production unless Christian explicitly approves exact
423
226
  workspace, campaign/table ids, source/action ids, caps/dates, approval mode,
424
227
  expected side effects, and rollback/stop condition.
425
- - In interactive Codex or Claude Code, that explicit approval must be collected
426
- through the host-native `Accept` / `Decline` question gate.
427
- - `--yolo` in the current refill request is explicit auto-accept for the
428
- rendered bounded refill packet only; it does not loosen the launch/send,
429
- scheduler-write, archive/delete, or drift rules above.
430
228
 
431
229
  ## Report
432
230
 
433
- Report in campaign-name-first language:
434
-
435
- - selected campaign name(s), target type, and sender names;
436
- - why they were selected, including last scheduled send date/future scheduled
437
- send evidence and sender overlap;
438
- - whether the smallest next step is enrich/prep more in that campaign, add rows
439
- to that campaign/source, use a different existing campaign, or ask what to
440
- create;
441
- - source state, blockers, exact next primitive, approval required, and the
442
- freshness hash used.
443
-
444
- Keep ids visible but secondary: show them under "Exact target" or "Proof", not
445
- as the main decision text. Say explicitly: nothing was launched and nothing was sent.
231
+ Report the selected target, target type, source state, blockers, exact next
232
+ primitive, approval required, and the freshness hash used. Say explicitly that
233
+ nothing was launched and nothing was sent.
@@ -1,113 +0,0 @@
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 {};
@@ -1,150 +0,0 @@
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
- }