@sellable/mcp 0.1.334 → 0.1.335
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 +34 -19
- package/dist/api.js +5 -3
- package/dist/auth.js +44 -13
- package/dist/tools/campaign-horizon-fill.js +1 -1
- package/dist/tools/campaign-message-preparation.js +2 -2
- package/dist/tools/campaigns.js +1 -1
- package/dist/tools/prompts.js +1 -1
- package/package.json +1 -1
- package/skills/create-campaign/SKILL.md +5 -1
- package/skills/fill-send-horizon/SKILL.md +18 -11
package/README.md
CHANGED
|
@@ -96,8 +96,17 @@ startup/auth update check and tells the agent to run
|
|
|
96
96
|
`curl -fsSL "https://app.sellable.dev/api/v2/cli/install" | sh` when the
|
|
97
97
|
installed runtime is behind npm.
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
First-run login is the normal auth path. Install Sellable, launch a workflow in
|
|
100
|
+
Claude Code or Codex, and let the agent complete the browser magic-link login.
|
|
101
|
+
If the browser login page shows a manual fallback, paste:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
sellable auth set <token> --workspace-id <workspace_id>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
For CI/env-only scripted installs, operators can set `SELLABLE_TOKEN` and
|
|
108
|
+
`SELLABLE_WORKSPACE_ID` before running the curl installer. The public path
|
|
109
|
+
remains:
|
|
101
110
|
|
|
102
111
|
```bash
|
|
103
112
|
curl -fsSL "https://app.sellable.dev/api/v2/cli/install" | sh
|
|
@@ -117,11 +126,17 @@ and publishes with a temporary npm config file. Prefer `NPM_TOKEN=<npm token>` i
|
|
|
117
126
|
`prod.env`; `NODE_AUTH_TOKEN`, `SELLABLE_NPM_TOKEN`, and `NPM_PUBLISH_TOKEN` are
|
|
118
127
|
also supported.
|
|
119
128
|
|
|
120
|
-
### 2.
|
|
129
|
+
### 2. First-Run Login
|
|
121
130
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
Launch a Sellable workflow after install. The agent will start first-run login,
|
|
132
|
+
send the magic link, wait for browser confirmation, and write canonical auth to
|
|
133
|
+
`~/.sellable/config.json`.
|
|
134
|
+
|
|
135
|
+
If the browser confirmation page shows a scripted fallback, paste:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
sellable auth set <token> --workspace-id <workspace_id>
|
|
139
|
+
```
|
|
125
140
|
|
|
126
141
|
### 3. Claude Setup Fallback
|
|
127
142
|
|
|
@@ -135,17 +150,9 @@ Install MCP server manually:
|
|
|
135
150
|
claude mcp add --transport stdio sellable -- npm exec --yes --package @sellable/mcp@latest -- sellable-mcp
|
|
136
151
|
```
|
|
137
152
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{
|
|
142
|
-
"token": "skt_live_your_token_here",
|
|
143
|
-
"activeWorkspaceId": "your_workspace_id"
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
The token is provided when you generate it. Use `list_workspaces` +
|
|
148
|
-
`set_active_workspace` to choose a workspace if you don't know the ID yet.
|
|
153
|
+
Do not hand-edit auth JSON for normal setup. Use first-run login or the
|
|
154
|
+
`sellable auth set <token> --workspace-id <workspace_id>` fallback so the
|
|
155
|
+
canonical config shape stays consistent.
|
|
149
156
|
|
|
150
157
|
### 4. Codex Setup
|
|
151
158
|
|
|
@@ -524,13 +531,21 @@ generation is not part of these inbox tools.
|
|
|
524
531
|
|
|
525
532
|
### "Sellable not configured" Error
|
|
526
533
|
|
|
527
|
-
|
|
534
|
+
Run a Sellable workflow to start first-run login. If the browser login page
|
|
535
|
+
shows a manual fallback, paste:
|
|
536
|
+
|
|
537
|
+
```bash
|
|
538
|
+
sellable auth set <token> --workspace-id <workspace_id>
|
|
539
|
+
```
|
|
528
540
|
|
|
529
541
|
### Token Not Working
|
|
530
542
|
|
|
531
543
|
1. Make sure token starts with `skt_`
|
|
532
544
|
2. Check token is not revoked
|
|
533
|
-
3.
|
|
545
|
+
3. If the token came from an older Settings flow and returns 403 on campaign or
|
|
546
|
+
enrichment writes, regenerate through first-run login or the scripted
|
|
547
|
+
fallback command above
|
|
548
|
+
4. Verify activeWorkspaceId matches your workspace (or run list_workspaces + set_active_workspace)
|
|
534
549
|
|
|
535
550
|
## Support
|
|
536
551
|
|
package/dist/api.js
CHANGED
|
@@ -19,9 +19,11 @@ export class SellableApi {
|
|
|
19
19
|
const missingWorkspace = status === 400 && errorText.includes("Workspace");
|
|
20
20
|
const guidance = isAuthError
|
|
21
21
|
? "Sellable authentication failed.\n\n" +
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
22
|
+
"Run the first-run Sellable login flow from a Sellable workflow, then retry.\n\n" +
|
|
23
|
+
"If the browser login page shows a manual fallback command, use:\n" +
|
|
24
|
+
"sellable auth set <token> --workspace-id <workspace_id>\n\n" +
|
|
25
|
+
`Current config path: ${getConfigPath()}\n\n` +
|
|
26
|
+
"Older copied Settings tokens can be stale, restricted, or missing write/credit permissions. Sign in again so Sellable mints the current agent token."
|
|
25
27
|
: missingWorkspace
|
|
26
28
|
? "No active workspace selected.\n\n" +
|
|
27
29
|
"Run list_workspaces then set_active_workspace to choose a workspace."
|
package/dist/auth.js
CHANGED
|
@@ -48,6 +48,16 @@ export function getConfigPath() {
|
|
|
48
48
|
}
|
|
49
49
|
return candidates[0];
|
|
50
50
|
}
|
|
51
|
+
function getConfigWritePath() {
|
|
52
|
+
const explicitConfigPath = process.env.SELLABLE_CONFIG_PATH?.trim();
|
|
53
|
+
if (explicitConfigPath) {
|
|
54
|
+
return path.resolve(explicitConfigPath);
|
|
55
|
+
}
|
|
56
|
+
if (configFileName === "sellable.json") {
|
|
57
|
+
return path.join(os.homedir(), ".sellable", "config.json");
|
|
58
|
+
}
|
|
59
|
+
return getConfigPath();
|
|
60
|
+
}
|
|
51
61
|
function normalizeConfig(raw) {
|
|
52
62
|
return {
|
|
53
63
|
...raw,
|
|
@@ -66,14 +76,12 @@ export function getConfig() {
|
|
|
66
76
|
const configPath = getConfigPath();
|
|
67
77
|
if (!fs.existsSync(configPath)) {
|
|
68
78
|
throw new Error("Sellable not configured.\n\n" +
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
"Run a Sellable workflow to start first-run login, for example /sellable:create-campaign in Claude Code or $sellable:create-campaign in Codex.\n\n" +
|
|
80
|
+
"If the browser login page shows a manual fallback command, paste it in your terminal:\n" +
|
|
81
|
+
"sellable auth set <token> --workspace-id <workspace_id>\n\n" +
|
|
82
|
+
`Preferred config path: ${getConfigWritePath()}\n\n` +
|
|
73
83
|
"Config path resolution order:\n" +
|
|
74
|
-
`${renderConfigPathOrder(configPathCandidates)}
|
|
75
|
-
"Get your token at: https://app.sellable.dev/settings?tab=integrations\n" +
|
|
76
|
-
"Then run list_workspaces + set_active_workspace to select a workspace.");
|
|
84
|
+
`${renderConfigPathOrder(configPathCandidates)}`);
|
|
77
85
|
}
|
|
78
86
|
try {
|
|
79
87
|
const content = fs.readFileSync(configPath, "utf-8");
|
|
@@ -118,7 +126,8 @@ export function updateActiveWorkspace(params) {
|
|
|
118
126
|
fs.mkdirSync(configDir, { recursive: true });
|
|
119
127
|
}
|
|
120
128
|
if (!fs.existsSync(configPath)) {
|
|
121
|
-
throw new Error(
|
|
129
|
+
throw new Error("Sellable not configured. Run a Sellable workflow to start first-run login, " +
|
|
130
|
+
"or paste the browser fallback command: sellable auth set <token> --workspace-id <workspace_id>.");
|
|
122
131
|
}
|
|
123
132
|
const content = fs.readFileSync(configPath, "utf-8");
|
|
124
133
|
let raw;
|
|
@@ -158,7 +167,8 @@ export function updateActiveWorkspace(params) {
|
|
|
158
167
|
function readRawConfigFile() {
|
|
159
168
|
const configPath = getConfigPath();
|
|
160
169
|
if (!fs.existsSync(configPath)) {
|
|
161
|
-
throw new Error(
|
|
170
|
+
throw new Error("Sellable not configured. Run a Sellable workflow to start first-run login, " +
|
|
171
|
+
"or paste the browser fallback command: sellable auth set <token> --workspace-id <workspace_id>.");
|
|
162
172
|
}
|
|
163
173
|
const content = fs.readFileSync(configPath, "utf-8");
|
|
164
174
|
try {
|
|
@@ -197,15 +207,36 @@ function writeRawConfigFile(configPath, raw) {
|
|
|
197
207
|
* new config without an MCP server restart.
|
|
198
208
|
*/
|
|
199
209
|
export function writeNewConfig(opts) {
|
|
200
|
-
const configPath =
|
|
201
|
-
|
|
210
|
+
const configPath = getConfigWritePath();
|
|
211
|
+
let raw = {};
|
|
212
|
+
if (fs.existsSync(configPath)) {
|
|
213
|
+
const content = fs.readFileSync(configPath, "utf-8");
|
|
214
|
+
try {
|
|
215
|
+
raw = JSON.parse(content);
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
if (error instanceof SyntaxError) {
|
|
219
|
+
throw new Error(`Invalid JSON in ${configPath}: ${error.message}`);
|
|
220
|
+
}
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const authFields = {
|
|
202
225
|
token: opts.token,
|
|
203
226
|
activeWorkspaceId: opts.activeWorkspaceId,
|
|
204
227
|
apiUrl: opts.apiUrl,
|
|
205
228
|
};
|
|
206
|
-
if (opts.activeWorkspaceName)
|
|
207
|
-
|
|
229
|
+
if (opts.activeWorkspaceName)
|
|
230
|
+
authFields.activeWorkspaceName = opts.activeWorkspaceName;
|
|
231
|
+
const { envConfig, set } = getActiveEnvConfigRef(raw);
|
|
232
|
+
const nextEnvConfig = {
|
|
233
|
+
...envConfig,
|
|
234
|
+
...authFields,
|
|
235
|
+
};
|
|
236
|
+
if (!opts.activeWorkspaceName) {
|
|
237
|
+
delete nextEnvConfig.activeWorkspaceName;
|
|
208
238
|
}
|
|
239
|
+
set(nextEnvConfig);
|
|
209
240
|
writeRawConfigFile(configPath, raw);
|
|
210
241
|
return { configPath };
|
|
211
242
|
}
|
|
@@ -6,7 +6,7 @@ async function postHorizonFill(body) {
|
|
|
6
6
|
export const campaignHorizonFillToolDefinitions = [
|
|
7
7
|
{
|
|
8
8
|
name: "fill_campaign_horizon",
|
|
9
|
-
description: "Audit or apply a bounded CampaignOffer horizon fill from Signal Discovery/source lead-list rows. Use audit first to get stateRevision, then apply with that stateRevision. Apply imports at most 300 eligible non-excluded source rows, starts bounded message preparation in approval mode, skips rows from excluded posts/authors, and does not start or
|
|
9
|
+
description: "Audit or apply a bounded CampaignOffer horizon fill from Signal Discovery/source lead-list rows. Use audit first to get stateRevision, then apply with that stateRevision. Apply imports at most 300 eligible non-excluded source rows, starts bounded message preparation in approval mode, skips rows from excluded posts/authors, and does not start, launch, send, or directly write scheduledFor. Prepared/approved rows are intermediate only; report scheduled completion only after re-reading scheduler-owned scheduled cells with non-null scheduledFor.",
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: "object",
|
|
12
12
|
properties: {
|
|
@@ -6,7 +6,7 @@ async function postPrepareMessages(body) {
|
|
|
6
6
|
export const campaignMessagePreparationToolDefinitions = [
|
|
7
7
|
{
|
|
8
8
|
name: "start_campaign_message_preparation",
|
|
9
|
-
description: 'Start a bounded campaign message preparation job for a CampaignOffer campaignId. Use this after lead/message approval when the user asks to "fill up", "load",
|
|
9
|
+
description: 'Start a bounded campaign message preparation job for a CampaignOffer campaignId. Use this after lead/message approval when the user asks to "fill up", "load", or "prepare" sends for attached senders. It never launches the campaign, sends messages, or directly writes scheduledFor. The job queues pending Enrich Prospect cells first, lets ICP/rubric and Generate Message cascade, then marks ready or approves only the bounded cohort. Prepared/approved/ready rows are intermediate only; scheduled completion requires a later re-read proving scheduler-owned scheduled cells with non-null scheduledFor. Omit maxRowsToCheck and batchSize for the adaptive default: calibrate on at least 100 actually-enriched rows, estimate the row budget from observed rubric/pass yield, cap rows at 300, and process at most 100 newly checked rows at a time. The worker will not pull another row batch while the current checked batch still has queueable or active cells. Do not interpret checkedRows as enriched rows; use progress.enrichedRows, needsEnrichRows, activeCellCount, preparedMessages, approvedMessages, and stopReason.',
|
|
10
10
|
inputSchema: {
|
|
11
11
|
type: "object",
|
|
12
12
|
properties: {
|
|
@@ -37,7 +37,7 @@ export const campaignMessagePreparationToolDefinitions = [
|
|
|
37
37
|
approvalMode: {
|
|
38
38
|
type: "string",
|
|
39
39
|
enum: ["mark_ready", "approve"],
|
|
40
|
-
description: "Defaults to mark_ready. Use approve only when the user explicitly asks to flip Approved cells.",
|
|
40
|
+
description: "Defaults to mark_ready. Use approve only when the user explicitly asks to flip Approved cells. Approval is not scheduling; it only makes the bounded cohort eligible for downstream scheduler ownership.",
|
|
41
41
|
},
|
|
42
42
|
autoContinue: { type: "boolean" },
|
|
43
43
|
disableLowPassRateStop: {
|
package/dist/tools/campaigns.js
CHANGED
|
@@ -441,7 +441,7 @@ export const campaignToolDefinitions = [
|
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
443
|
name: "start_campaign",
|
|
444
|
-
description: "Start a paused campaign, enabling the sweeper to send messages.",
|
|
444
|
+
description: "Start a paused campaign, enabling the sweeper to send messages. This is an explicit human launch/start action and must not be used as part of fill-send-horizon, message preparation, or scheduling-proof flows.",
|
|
445
445
|
inputSchema: {
|
|
446
446
|
type: "object",
|
|
447
447
|
properties: {
|
package/dist/tools/prompts.js
CHANGED
|
@@ -371,7 +371,7 @@ export function getPostFindLeadsScoutRegistry() {
|
|
|
371
371
|
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.',
|
|
372
372
|
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.",
|
|
373
373
|
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.',
|
|
374
|
-
prepareMessagesRule: 'Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. Only call start_campaign_message_preparation when the user explicitly asks for more prepared messages, a send count, or to fill up/load sends for senders. Treat "fill up/load sends" as capacity-fill preparation: calculate the bounded target from sender capacity when needed, then let the job queue pending Enrich Prospect cells first, wait for ICP/rubric and Generate Message to cascade, and mark ready or approve only the target cohort. Do not interpret checkedRows as enriched rows; it is only the table cursor. Poll get_campaign_message_preparation_status and summarize enrichedRows, needsEnrichRows, activeCellCount, passed/prepared/approved count, target, estimated row budget remaining, and stopReason. For "prepare/generate X messages", set targetPreparedMessages:X, omit maxRowsToCheck so the backend calibrates on at least 100 actually-enriched rows, estimates the row budget from observed rubric/pass yield, caps maxRowsToCheck at 300, and use approvalMode:mark_ready. After the calibration sample settles, the backend continues in batches capped at 100 newly checked rows and will not pull another row batch while the current checked batch still has queueable or active cells. For "approve X messages", use approvalMode:approve but still do not launch. For "schedule X sends" or "fill sender sends", use approvalMode:approve
|
|
374
|
+
prepareMessagesRule: 'Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. Only call start_campaign_message_preparation when the user explicitly asks for more prepared messages, a send count, or to fill up/load sends for senders. Treat "fill up/load sends" as capacity-fill preparation: calculate the bounded target from sender capacity when needed, then let the job queue pending Enrich Prospect cells first, wait for ICP/rubric and Generate Message to cascade, and mark ready or approve only the target cohort. Do not interpret checkedRows as enriched rows; it is only the table cursor. Poll get_campaign_message_preparation_status and summarize enrichedRows, needsEnrichRows, activeCellCount, passed/prepared/approved count, target, estimated row budget remaining, and stopReason. 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. For "prepare/generate X messages", set targetPreparedMessages:X, omit maxRowsToCheck so the backend calibrates on at least 100 actually-enriched rows, estimates the row budget from observed rubric/pass yield, caps maxRowsToCheck at 300, and use approvalMode:mark_ready. After the calibration sample settles, the backend continues in batches capped at 100 newly checked rows and will not pull another row batch while the current checked batch still has queueable or active cells. For "approve X messages", use approvalMode:approve but still do not launch. For "schedule X sends" or "fill sender sends", use approvalMode:approve only when the user explicitly asked for approval, approve exactly the bounded X-message cohort during preparation, 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. 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, call cancel_campaign_message_preparation; otherwise do not cancel a healthy prepare run. cancel_campaign_message_preparation cancels the same pending workflow-table cells as the UI Cancel Pending Cells action. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until explicit launch/start approval outside fill-horizon.',
|
|
375
375
|
},
|
|
376
376
|
};
|
|
377
377
|
}
|
package/package.json
CHANGED
|
@@ -893,7 +893,11 @@ updates.
|
|
|
893
893
|
|
|
894
894
|
1. Call `mcp__sellable__get_auth_status({})`.
|
|
895
895
|
2. If auth is not OK with `error.type === "config"` or `error.type === "auth"`,
|
|
896
|
-
the user has not signed in yet. Run the FTUX
|
|
896
|
+
the user has not signed in yet. Run first-run login through the FTUX
|
|
897
|
+
magic-link handoff. If a browser page or tool guidance gives the user a
|
|
898
|
+
manual fallback, it must be
|
|
899
|
+
`sellable auth set <token> --workspace-id <workspace_id>`. Do not instruct
|
|
900
|
+
the user to hand-edit JSON auth config.
|
|
897
901
|
|
|
898
902
|
a. Say to the user verbatim:
|
|
899
903
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fill-send-horizon
|
|
3
|
-
description:
|
|
3
|
+
description: Fill campaigns' next N-day send horizon through product-native enrichment, message prep, exact-row approval, and scheduler-owned scheduling proof. Prepared/generated/approved rows are intermediate only; success requires scheduled workflow cells with scheduledFor assigned by the existing scheduler. Never launches campaigns, never spends paid InMail.
|
|
4
4
|
visibility: internal
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Fill Send Horizon
|
|
8
8
|
|
|
9
9
|
<role>
|
|
10
|
-
You are a campaign operations agent keeping send queues full. Your job: for each target campaign, make sure the next two working days (or the requested horizon) have prepared,
|
|
10
|
+
You are a campaign operations agent keeping send queues full. Your job: for each target campaign, make sure the next two working days (or the requested horizon) have actual scheduled workflow-table action cells with `scheduledFor` assigned by the existing scheduler path. Enriched, generated, prepared, approved, or `ready_to_schedule` rows are progress only; they are not completion by themselves. Never launch a campaign or send anything yourself.
|
|
11
11
|
</role>
|
|
12
12
|
|
|
13
13
|
<inputs>
|
|
@@ -23,11 +23,16 @@ Optional inputs: `targetPreparedMessages` (default: leave unset for the adaptive
|
|
|
23
23
|
<objective>
|
|
24
24
|
For each target campaign:
|
|
25
25
|
|
|
26
|
-
1. `get_campaign`
|
|
27
|
-
2.
|
|
28
|
-
3.
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
1. `get_campaign` -> confirm workspace, workflowTableId, campaign status, sender IDs, current stats, and scheduled/ready/approved/prepared counts where the tool exposes them. Skip and report any campaign whose table is ARCHIVED.
|
|
27
|
+
2. If the campaign already has enough scheduled workflow-table action cells with non-null `scheduledFor` for the requested horizon, stop as `already scheduled`.
|
|
28
|
+
3. If there are eligible rows but the horizon is not scheduled, use the product-native fill/prep tools only on the bounded target cohort:
|
|
29
|
+
- Prefer `fill_campaign_horizon({ action: "audit" })` then `fill_campaign_horizon({ action: "apply", stateRevision })` when the campaign has a source lead list / Signal Discovery source and needs import plus message prep.
|
|
30
|
+
- Use `start_campaign_message_preparation({ campaignId })` when rows already exist and only enrichment/rubric/message prep/approval readiness is needed.
|
|
31
|
+
- Omit `maxRowsToCheck` and `batchSize` for the adaptive default unless the invoking prompt sets them.
|
|
32
|
+
4. Poll `get_campaign_message_preparation_status` until the job completes or stops. Read `progress.enrichedRows`, `preparedMessages`, `approvedMessages`, `activeCellCount`, and `stopReason`; never treat `checkedRows` as enriched rows.
|
|
33
|
+
5. After any prep/approval work, re-read campaign/table state. Do not report the horizon as scheduled unless the re-read proves scheduler-owned scheduled cells with non-null `scheduledFor`. If only prepared/approved/ready cells exist, report the exact state as `prepared/approved/ready - awaiting scheduler`, not complete.
|
|
34
|
+
6. If the stop reason is source exhaustion (no more eligible rows), report it as "source thin - needs new leads" and name `refresh-sender-engagement` (for post-engager lanes) or `find-leads` as the refill path. Do not invent leads.
|
|
35
|
+
7. Report per campaign: scheduled count, ready-to-schedule count, prepared count, approved count, remaining horizon gap, and the single next operator action.
|
|
31
36
|
</objective>
|
|
32
37
|
|
|
33
38
|
<waterfall>
|
|
@@ -54,9 +59,11 @@ thomas waterfall (stored order): Post Engagers 1/4 (source thin) → Shared Sign
|
|
|
54
59
|
<safety>
|
|
55
60
|
- **Never call `start_campaign`, `start_on_demand_campaign`, or `start_direct_campaign`.** Activating a campaign is always an explicit human action outside this skill.
|
|
56
61
|
- Use `approvalMode: "approve"` ONLY when the invoking prompt explicitly says to auto-approve (e.g. "fill and approve"). Default is `mark_ready` — a human approves in the UI.
|
|
62
|
+
- Auto-approval is not scheduling. It can make rows eligible for the scheduler, but only scheduler-owned `scheduledFor` cells count as scheduled completion.
|
|
57
63
|
- Never use a sender from one workspace for another workspace's campaign. If `get_campaign` shows a workspace mismatch with the active workspace, stop and report.
|
|
58
64
|
- Paid InMail: never opt a campaign into paid-InMail templates or spend credits. If a campaign's sequence already includes a paid-InMail step, note it in the report but do not alter it.
|
|
59
|
-
-
|
|
65
|
+
- Do not write `WorkflowTableCell.scheduledFor` directly. Scheduling must happen through the existing workflow-table scheduler/sweeper path.
|
|
66
|
+
- This skill fills readiness and verifies scheduling; the product's sweeper sends only from ACTIVE campaigns, only approved rows, only inside sending hours. Say so in the report so the operator knows nothing went out.
|
|
60
67
|
</safety>
|
|
61
68
|
|
|
62
69
|
<output>
|
|
@@ -64,9 +71,9 @@ One compact report:
|
|
|
64
71
|
|
|
65
72
|
```
|
|
66
73
|
Fill Send Horizon — {date}
|
|
67
|
-
• {Campaign A}: {
|
|
74
|
+
• {Campaign A}: scheduled {s}/{target} for the horizon ({r} ready, {p} prepared, {a} approved) — {state}
|
|
68
75
|
• {Campaign B}: source thin after {k} prepared — refill via refresh-sender-engagement
|
|
69
|
-
Next operator action: approve
|
|
70
|
-
Nothing was sent or launched; campaigns remain in their current status.
|
|
76
|
+
Next operator action: {approve messages | wait for scheduler | refresh source | launch separately if you intentionally want sends to go out}
|
|
77
|
+
Nothing was sent or launched; campaigns remain in their current status. Prepared/approved/ready rows were not counted as scheduled unless scheduler-owned scheduledFor cells were re-read.
|
|
71
78
|
```
|
|
72
79
|
</output>
|