@sellable/mcp 0.1.409 → 0.1.410

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,6 +3,9 @@ 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
6
9
  - mcp__sellable__resolve_campaign_fill_route
7
10
  - mcp__sellable__get_campaign_refill_state
8
11
  - mcp__sellable__fill_campaign_horizon
@@ -33,6 +36,7 @@ allowed-tools:
33
36
  - mcp__sellable__get_table_rows
34
37
  - mcp__sellable__get_campaign_table_schema
35
38
  - mcp__sellable__select_campaign_cells
39
+ - mcp__sellable__queue_campaign_cells
36
40
  - mcp__sellable__wait_for_campaign_processing
37
41
  - mcp__sellable__get_sender
38
42
  ---
@@ -48,15 +52,45 @@ prep, readiness, and evergreen primitives.
48
52
  Plain phrases that enter here include "fill", "refill sends", "max out sends",
49
53
  "load everyone up", and "fill horizon sends".
50
54
 
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
+
51
60
  1. Call `resolve_campaign_fill_route` first. Use `intent:"plain"` for generic
52
61
  fill/load language, `intent:"active"` only when the user explicitly narrowed
53
62
  to active regular campaigns, and `intent:"evergreen"` only when the user
54
63
  explicitly asked for evergreen or horizon work.
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:
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:
60
94
  - regular campaign: campaign-backed workflow table with normal source,
61
95
  sequence, senders, and send/refill stages.
62
96
  - evergreen campaign: managed always-on lane with current source evidence.
@@ -77,7 +111,10 @@ Use the refill-state response as the current facts receipt:
77
111
  approved, ready to schedule, scheduled;
78
112
  - active message prep job;
79
113
  - scheduler-owned scheduled counts by date/action from cells with non-null
80
- `scheduledFor`;
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;
81
118
  - `freshness.stateHash` and exact campaign/table/workspace ids.
82
119
 
83
120
  Empty or unsafe states stop with the blocker: no fillable target, missing or deleted campaign,
@@ -89,9 +126,76 @@ scheduler, or unsupported direct campaign type.
89
126
 
90
127
  For regular campaign workspaces, rank regular campaigns from route and
91
128
  `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
+
92
179
  Do not create side campaigns, warm-post-engager side campaigns, on-demand campaigns,
93
180
  or unrelated campaigns as the default answer to a fill request.
94
181
 
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
+
95
199
  When the best regular campaign is source-exhausted, recommend same-campaign source-ladder replenishment.
96
200
  Keep `selectedLeadListId` source identity distinct
97
201
  from the campaign `workflowTableId`.
@@ -109,6 +213,30 @@ Source replenishment choices:
109
213
  source prospects into the same campaign/source-list path, then confirm
110
214
  readiness.
111
215
 
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
+
112
240
  ### Running Campaign Signal Discovery Recovery
113
241
 
114
242
  For an already-running regular campaign that needs same-campaign Signal
@@ -146,10 +274,10 @@ returns to Running after same-campaign source rows are copied. Do not call
146
274
  post-copy state transition.
147
275
 
148
276
  Before any source mutation, show exact approval evidence: workspace id,
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.
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.
153
281
 
154
282
  After source import, call `wait_for_lead_list_ready` and `confirm_lead_list`
155
283
  with the source-list id and campaign id. Imports append to the existing
@@ -179,18 +307,87 @@ Before prep or approval mutation, reread `get_campaign_refill_state` and compare
179
307
  If they changed, stop. A second concurrent refill run must see the first run's
180
308
  import/prep state on reread and avoid duplicate work.
181
309
 
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
+
182
360
  After same-campaign source copy, inspect the actual campaign-table position of
183
361
  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`,
184
362
  then use `select_campaign_cells` diagnostics against
185
363
  `rowSelector:{ type:"reviewBatch" }` for `enrich`, `generateMessage`, and
186
364
  `approved` roles when needed.
187
365
 
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
+
188
376
  If review-batch enrich cells are pending or Generate Message cells are
189
377
  dependency-blocked, omit `maxRowsToCheck` so the adaptive prep job can cover the
190
378
  bounded table scan, or set a bounded cap high enough to include appended rows
191
379
  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
192
380
  the whole budget on older rows and miss the refill batch.
193
381
 
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
+
194
391
  Scheduled success requires a post-action reread proving scheduler-owned cells
195
392
  with non-null `scheduledFor`. Prepared, approved, and ready-to-schedule rows are
196
393
  intermediate states; report them as awaiting scheduler unless scheduled cells
@@ -225,9 +422,24 @@ the current source or ask for more research instead of walking the ladder.
225
422
  - No mutation in production unless Christian explicitly approves exact
226
423
  workspace, campaign/table ids, source/action ids, caps/dates, approval mode,
227
424
  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.
228
430
 
229
431
  ## Report
230
432
 
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.
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.