@sellable/mcp 0.1.476 → 0.1.477
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tools/leads.d.ts +47 -0
- package/dist/tools/leads.js +12 -1
- package/dist/tools/prompts.js +1 -1
- package/dist/tools/refill-sends.d.ts +27 -0
- package/dist/tools/refill-sends.js +164 -4
- package/dist/tools/refill-target-plan.js +45 -0
- package/dist/tools/registry.d.ts +45 -0
- package/package.json +1 -1
- package/skills/refill-sends/SKILL.md +21 -7
- package/skills/refill-sends-workflow/SKILL.md +9 -2
package/dist/tools/leads.d.ts
CHANGED
|
@@ -179,6 +179,8 @@ export type ConfirmLeadListInput = {
|
|
|
179
179
|
reviewBatchLimit?: number;
|
|
180
180
|
includeRawImportResult?: boolean;
|
|
181
181
|
allowPartialSourceList?: boolean;
|
|
182
|
+
sourceRowIds?: string[];
|
|
183
|
+
sourceRowLimit?: number;
|
|
182
184
|
/**
|
|
183
185
|
* Deprecated alias for reviewBatchLimit. Confirming a lead list now copies the
|
|
184
186
|
* confirmed source into the campaign table; this value no longer caps clone
|
|
@@ -293,6 +295,8 @@ export declare const leadToolDefinitions: ({
|
|
|
293
295
|
keepInSync?: undefined;
|
|
294
296
|
jobId?: undefined;
|
|
295
297
|
reviewBatchLimit?: undefined;
|
|
298
|
+
sourceRowIds?: undefined;
|
|
299
|
+
sourceRowLimit?: undefined;
|
|
296
300
|
allowPartialSourceList?: undefined;
|
|
297
301
|
includeRawImportResult?: undefined;
|
|
298
302
|
selections?: undefined;
|
|
@@ -487,6 +491,8 @@ export declare const leadToolDefinitions: ({
|
|
|
487
491
|
keepInSync?: undefined;
|
|
488
492
|
jobId?: undefined;
|
|
489
493
|
reviewBatchLimit?: undefined;
|
|
494
|
+
sourceRowIds?: undefined;
|
|
495
|
+
sourceRowLimit?: undefined;
|
|
490
496
|
allowPartialSourceList?: undefined;
|
|
491
497
|
includeRawImportResult?: undefined;
|
|
492
498
|
selections?: undefined;
|
|
@@ -580,6 +586,8 @@ export declare const leadToolDefinitions: ({
|
|
|
580
586
|
keepInSync?: undefined;
|
|
581
587
|
jobId?: undefined;
|
|
582
588
|
reviewBatchLimit?: undefined;
|
|
589
|
+
sourceRowIds?: undefined;
|
|
590
|
+
sourceRowLimit?: undefined;
|
|
583
591
|
allowPartialSourceList?: undefined;
|
|
584
592
|
includeRawImportResult?: undefined;
|
|
585
593
|
selections?: undefined;
|
|
@@ -745,6 +753,8 @@ export declare const leadToolDefinitions: ({
|
|
|
745
753
|
keepInSync?: undefined;
|
|
746
754
|
jobId?: undefined;
|
|
747
755
|
reviewBatchLimit?: undefined;
|
|
756
|
+
sourceRowIds?: undefined;
|
|
757
|
+
sourceRowLimit?: undefined;
|
|
748
758
|
allowPartialSourceList?: undefined;
|
|
749
759
|
includeRawImportResult?: undefined;
|
|
750
760
|
selections?: undefined;
|
|
@@ -852,6 +862,8 @@ export declare const leadToolDefinitions: ({
|
|
|
852
862
|
keepInSync?: undefined;
|
|
853
863
|
jobId?: undefined;
|
|
854
864
|
reviewBatchLimit?: undefined;
|
|
865
|
+
sourceRowIds?: undefined;
|
|
866
|
+
sourceRowLimit?: undefined;
|
|
855
867
|
allowPartialSourceList?: undefined;
|
|
856
868
|
includeRawImportResult?: undefined;
|
|
857
869
|
selections?: undefined;
|
|
@@ -968,6 +980,8 @@ export declare const leadToolDefinitions: ({
|
|
|
968
980
|
keepInSync?: undefined;
|
|
969
981
|
jobId?: undefined;
|
|
970
982
|
reviewBatchLimit?: undefined;
|
|
983
|
+
sourceRowIds?: undefined;
|
|
984
|
+
sourceRowLimit?: undefined;
|
|
971
985
|
allowPartialSourceList?: undefined;
|
|
972
986
|
includeRawImportResult?: undefined;
|
|
973
987
|
selections?: undefined;
|
|
@@ -1073,6 +1087,8 @@ export declare const leadToolDefinitions: ({
|
|
|
1073
1087
|
keepInSync?: undefined;
|
|
1074
1088
|
jobId?: undefined;
|
|
1075
1089
|
reviewBatchLimit?: undefined;
|
|
1090
|
+
sourceRowIds?: undefined;
|
|
1091
|
+
sourceRowLimit?: undefined;
|
|
1076
1092
|
allowPartialSourceList?: undefined;
|
|
1077
1093
|
includeRawImportResult?: undefined;
|
|
1078
1094
|
selections?: undefined;
|
|
@@ -1183,6 +1199,8 @@ export declare const leadToolDefinitions: ({
|
|
|
1183
1199
|
keepInSync?: undefined;
|
|
1184
1200
|
jobId?: undefined;
|
|
1185
1201
|
reviewBatchLimit?: undefined;
|
|
1202
|
+
sourceRowIds?: undefined;
|
|
1203
|
+
sourceRowLimit?: undefined;
|
|
1186
1204
|
allowPartialSourceList?: undefined;
|
|
1187
1205
|
includeRawImportResult?: undefined;
|
|
1188
1206
|
selections?: undefined;
|
|
@@ -1281,6 +1299,8 @@ export declare const leadToolDefinitions: ({
|
|
|
1281
1299
|
keepInSync?: undefined;
|
|
1282
1300
|
jobId?: undefined;
|
|
1283
1301
|
reviewBatchLimit?: undefined;
|
|
1302
|
+
sourceRowIds?: undefined;
|
|
1303
|
+
sourceRowLimit?: undefined;
|
|
1284
1304
|
allowPartialSourceList?: undefined;
|
|
1285
1305
|
includeRawImportResult?: undefined;
|
|
1286
1306
|
selections?: undefined;
|
|
@@ -2171,6 +2191,8 @@ export declare const leadToolDefinitions: ({
|
|
|
2171
2191
|
keepInSync?: undefined;
|
|
2172
2192
|
jobId?: undefined;
|
|
2173
2193
|
reviewBatchLimit?: undefined;
|
|
2194
|
+
sourceRowIds?: undefined;
|
|
2195
|
+
sourceRowLimit?: undefined;
|
|
2174
2196
|
allowPartialSourceList?: undefined;
|
|
2175
2197
|
includeRawImportResult?: undefined;
|
|
2176
2198
|
selections?: undefined;
|
|
@@ -2278,6 +2300,8 @@ export declare const leadToolDefinitions: ({
|
|
|
2278
2300
|
keepInSync?: undefined;
|
|
2279
2301
|
jobId?: undefined;
|
|
2280
2302
|
reviewBatchLimit?: undefined;
|
|
2303
|
+
sourceRowIds?: undefined;
|
|
2304
|
+
sourceRowLimit?: undefined;
|
|
2281
2305
|
allowPartialSourceList?: undefined;
|
|
2282
2306
|
includeRawImportResult?: undefined;
|
|
2283
2307
|
selections?: undefined;
|
|
@@ -3323,6 +3347,8 @@ export declare const leadToolDefinitions: ({
|
|
|
3323
3347
|
keepInSync?: undefined;
|
|
3324
3348
|
jobId?: undefined;
|
|
3325
3349
|
reviewBatchLimit?: undefined;
|
|
3350
|
+
sourceRowIds?: undefined;
|
|
3351
|
+
sourceRowLimit?: undefined;
|
|
3326
3352
|
allowPartialSourceList?: undefined;
|
|
3327
3353
|
includeRawImportResult?: undefined;
|
|
3328
3354
|
selections?: undefined;
|
|
@@ -3477,6 +3503,8 @@ export declare const leadToolDefinitions: ({
|
|
|
3477
3503
|
keepInSync?: undefined;
|
|
3478
3504
|
jobId?: undefined;
|
|
3479
3505
|
reviewBatchLimit?: undefined;
|
|
3506
|
+
sourceRowIds?: undefined;
|
|
3507
|
+
sourceRowLimit?: undefined;
|
|
3480
3508
|
allowPartialSourceList?: undefined;
|
|
3481
3509
|
includeRawImportResult?: undefined;
|
|
3482
3510
|
selections?: undefined;
|
|
@@ -3618,6 +3646,8 @@ export declare const leadToolDefinitions: ({
|
|
|
3618
3646
|
keepInSync?: undefined;
|
|
3619
3647
|
jobId?: undefined;
|
|
3620
3648
|
reviewBatchLimit?: undefined;
|
|
3649
|
+
sourceRowIds?: undefined;
|
|
3650
|
+
sourceRowLimit?: undefined;
|
|
3621
3651
|
allowPartialSourceList?: undefined;
|
|
3622
3652
|
includeRawImportResult?: undefined;
|
|
3623
3653
|
selections?: undefined;
|
|
@@ -3714,6 +3744,8 @@ export declare const leadToolDefinitions: ({
|
|
|
3714
3744
|
keepInSync?: undefined;
|
|
3715
3745
|
jobId?: undefined;
|
|
3716
3746
|
reviewBatchLimit?: undefined;
|
|
3747
|
+
sourceRowIds?: undefined;
|
|
3748
|
+
sourceRowLimit?: undefined;
|
|
3717
3749
|
allowPartialSourceList?: undefined;
|
|
3718
3750
|
includeRawImportResult?: undefined;
|
|
3719
3751
|
selections?: undefined;
|
|
@@ -3760,6 +3792,17 @@ export declare const leadToolDefinitions: ({
|
|
|
3760
3792
|
type: string;
|
|
3761
3793
|
description: string;
|
|
3762
3794
|
};
|
|
3795
|
+
sourceRowIds: {
|
|
3796
|
+
type: string;
|
|
3797
|
+
items: {
|
|
3798
|
+
type: string;
|
|
3799
|
+
};
|
|
3800
|
+
description: string;
|
|
3801
|
+
};
|
|
3802
|
+
sourceRowLimit: {
|
|
3803
|
+
type: string;
|
|
3804
|
+
description: string;
|
|
3805
|
+
};
|
|
3763
3806
|
allowPartialSourceList: {
|
|
3764
3807
|
type: string;
|
|
3765
3808
|
description: string;
|
|
@@ -3969,6 +4012,8 @@ export declare const leadToolDefinitions: ({
|
|
|
3969
4012
|
keepInSync?: undefined;
|
|
3970
4013
|
jobId?: undefined;
|
|
3971
4014
|
reviewBatchLimit?: undefined;
|
|
4015
|
+
sourceRowIds?: undefined;
|
|
4016
|
+
sourceRowLimit?: undefined;
|
|
3972
4017
|
allowPartialSourceList?: undefined;
|
|
3973
4018
|
includeRawImportResult?: undefined;
|
|
3974
4019
|
};
|
|
@@ -4066,6 +4111,8 @@ export declare const leadToolDefinitions: ({
|
|
|
4066
4111
|
keepInSync?: undefined;
|
|
4067
4112
|
jobId?: undefined;
|
|
4068
4113
|
reviewBatchLimit?: undefined;
|
|
4114
|
+
sourceRowIds?: undefined;
|
|
4115
|
+
sourceRowLimit?: undefined;
|
|
4069
4116
|
allowPartialSourceList?: undefined;
|
|
4070
4117
|
includeRawImportResult?: undefined;
|
|
4071
4118
|
selections?: undefined;
|
package/dist/tools/leads.js
CHANGED
|
@@ -2201,6 +2201,15 @@ export const leadToolDefinitions = [
|
|
|
2201
2201
|
type: "number",
|
|
2202
2202
|
description: "Number of campaign rows to use as the initial review/process sample. Defaults to 15.",
|
|
2203
2203
|
},
|
|
2204
|
+
sourceRowIds: {
|
|
2205
|
+
type: "array",
|
|
2206
|
+
items: { type: "string" },
|
|
2207
|
+
description: "Optional exact source WorkflowTableRow ids to copy from the selected source lead list. Use only for bounded refill same-source copy packets.",
|
|
2208
|
+
},
|
|
2209
|
+
sourceRowLimit: {
|
|
2210
|
+
type: "number",
|
|
2211
|
+
description: "Optional cap for copying the first N source rows. Prefer sourceRowIds when a refill packet provides exact ids.",
|
|
2212
|
+
},
|
|
2204
2213
|
allowPartialSourceList: {
|
|
2205
2214
|
type: "boolean",
|
|
2206
2215
|
description: "Explicit override for user-approved early continuation. Default false. When true, confirm_lead_list may copy the currently materialized rows from a still-running source import; use only after the user explicitly asks to keep going with the partial list.",
|
|
@@ -4127,7 +4136,7 @@ export async function cancelLeadImport(input) {
|
|
|
4127
4136
|
}
|
|
4128
4137
|
export async function confirmLeadList(input) {
|
|
4129
4138
|
const api = getApi();
|
|
4130
|
-
const { campaignOfferId, currentStep, confirmed, sourceLeadListId, campaignName, keepInSync, jobId, reviewBatchLimit, includeRawImportResult, allowPartialSourceList, targetLeadCount, } = input;
|
|
4139
|
+
const { campaignOfferId, currentStep, confirmed, sourceLeadListId, campaignName, keepInSync, jobId, reviewBatchLimit, includeRawImportResult, allowPartialSourceList, targetLeadCount, sourceRowIds, sourceRowLimit, } = input;
|
|
4131
4140
|
assertInteractionApproval({
|
|
4132
4141
|
campaignId: campaignOfferId,
|
|
4133
4142
|
action: "confirm-lead-list",
|
|
@@ -4329,6 +4338,8 @@ export async function confirmLeadList(input) {
|
|
|
4329
4338
|
campaignName,
|
|
4330
4339
|
keepInSync,
|
|
4331
4340
|
currentStep: null,
|
|
4341
|
+
sourceRowIds,
|
|
4342
|
+
sourceRowLimit,
|
|
4332
4343
|
})
|
|
4333
4344
|
.catch((error) => {
|
|
4334
4345
|
if (isTerminalAccessError(error)) {
|
package/dist/tools/prompts.js
CHANGED
|
@@ -373,7 +373,7 @@ export function getPostFindLeadsScoutRegistry() {
|
|
|
373
373
|
codex: 'After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not spawn anything before that question. After the answer, launch only Message Drafting. The filter-choice answer is the post-import user gate for this single worker; do not ask another question about starting it in step-wise or YOLO mode. The registry lookup is not a launch: after get_post_find_leads_scout_registry, immediately invoke Task/spawn_agent or the host background-agent mechanism before loading filter-leads.md, before saving rubrics, and before treating skip-filters as ready for message review. Both choices route through this kickoff; do not let filters_skipped jump straight from filter-choice to message-generation. If filters are chosen, the parent stays on Filter Rules and drafts/saves rubrics with MCP tools while Message Drafting runs in the background. If filters are skipped, move to Messages/message review only after Message Drafting has started or is ready; update_campaign(currentStep=messages) is not proof of launch. If the named Message Drafting custom agent is unavailable, spawn a generic gpt-5.5 xhigh Message Drafting background agent with the same lean campaign/table basis. When the background worker starts, persist workerDetails.messageDraftBuilder with statusSource "branch", status "branch-running", runId, startedAt, updatedAt, basisToken when known, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds; workerStatuses.messageDraftBuilder may be "running" as a simple badge only. Never put rich proof under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start the same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource "parent-thread-fallback" and status "fallback-active", and require the same live context, prompt, assets, and validation gate before message review; do not wait until filters are saved and then call the registry.',
|
|
374
374
|
claude: "After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not invoke any Task/Agent before that question. After the answer, invoke only Message Drafting. If filters are chosen, parent drafts/saves rubrics with MCP tools while Message Drafting runs, asks filter approval, then joins Message Drafting. If filters are skipped, invoke only Message Drafting and move to Messages/message review.",
|
|
375
375
|
parentThreadRule: 'Named agents are optional acceleration, but message drafting is not optional. The only normal background worker is Message Drafting. The filter-choice answer is the campaign-scoped go-ahead for this single post-import worker; do not ask another question to start it in step-wise or YOLO mode. If a named agent is unavailable, use a generic gpt-5.5 xhigh Message Drafting background agent. source work and filter work stay in the parent thread with MCP tools. If post-find-leads-message-scout is available, run it as the background Message Draft Builder after the filter-choice answer. The registry lookup is not a launch: get_post_find_leads_scout_registry only identifies the worker, and Message Drafting counts as started only after Task/spawn_agent or the host background-agent tool is invoked, or after the parent begins the same full message branch inline because no background-agent tool is callable. This launch must happen before loading filter-leads.md, save_rubrics, filter approval, or skip-filter message review; currentStep=messages is not proof of launch. If post-find-leads-message-scout is absent, do not customer-surface install status. Do not silently treat message drafting as started; the main thread must either launch the background worker or execute the same message branch from CampaignOffer state, selected source state, workflowTableId, and initial campaign-table execution slice rows. For a spawned worker, record workerDetails.messageDraftBuilder with statusSource branch / status branch-running, runId, startedAt, updatedAt, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds. workerStatuses.messageDraftBuilder is optional simple badge text only ("running", "ready", "blocked", "idle"); never put runId/statusSource/basis under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start that same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource parent-thread-fallback / status fallback-active then ready, and require the same live context, prompt, assets, and validation gate before message review; do not report that as a background worker failure. If neither branch nor inline fallback can run, return blocked/retry-needed; do not wait until filters are saved and then call the registry. The Message Drafting handoff must be lean. Do not paste copied row counts, brief hashes, review-batch hashes, full reviewBatchRowIds, broad row data, or local debug artifacts into the spawn prompt. Local markdown/json files are not normal-path inputs. The filter-choice question is the first post-import user gate; do not load post-lead registries or filter references before it. Message drafting starts after the filter-choice answer, must load get_subskill_prompt({ subskillName: "generate-messages" }), and must load every required message asset named by generate-messages Mode 0 through get_subskill_asset before drafting. Reference Asset Loading means loading the required pre-draft reference pack before drafting; return blocked/retry-needed if required assets cannot be loaded; load ai-tells.md because it is never optional. The branch or parent-thread fallback loads the full generate-messages prompt and every referenced asset through get_subskill_asset. After generating/revising the candidate and before returning ready, must load get_subskill_prompt({ subskillName: "create-campaign-v2-validation" }) as the final internal validation gate, must read live campaign table state through scoped MCP/product tools, and must reject mismatched selectedLeadListId/workflowTableId/campaign/workspace input. Do not block when filters were chosen but leadScoringRubrics are not yet visible in the branch read; the parent owns save_rubrics and filter approval in parallel, so Message Drafting should return status ready with basisStatus usable_initial when campaign/list/table identity and the non-empty execution slice match. Do not use any alternate, local-artifact, or examples-only message prompt. User copy feedback, message QA, or rewrite requests before approve-message must be routed back to Message Drafting with the current recommendation, lean campaign/table basis, and latest user text; the parent must not rewrite or QA the template from memory and must not call update_campaign_brief before approve-message. The worker validates internally and returns only templateRecommendation, tokenFillRules, renderedGoodSample, status, approveOrReviseRecommendation, validationStatus, outputAt, outputHash, and blocked/retry detail. Do not render renderedFallbackSample, risk notes, or a qaReceipt on the normal happy path. On the filter path, save_rubrics keeps the browser on Filter Rules after save_rubrics so the user can approve the saved criteria; after saved-filter approval, move to Filter Leads with currentStep=apply-icp-rubric whether Message Drafting is ready or still running. Wait there for message approval. Enrichment, filtering, Generate Message cells, sender setup, sequence attach, and launch wait for template approval on the Use Template path. On the skip path, move to Messages/message review after Message Drafting has started or is ready and wait for message approval before enrichment or Settings. Do not render message review from checklist or shortcut instructions; message review requires a messageDraftRecommendation whose basis proves the generate-messages prompt, required message assets, and validation gate ran for the current campaign/table execution slice. Do not automatically rerun Message Drafting after filters/enrichment finish; show the initial draft by default and offer an enriched rewrite only with explicit user opt-in. Handoff and recommendation output are Markdown with labeled fields, not raw JSON.',
|
|
376
|
-
prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, post the full sender/campaign/action approval packet in normal chat as Markdown first, then ask request_user_input/AskUserQuestion with exactly Accept and Decline and a compact body that refers back to the posted packet; do not duplicate the campaign table or full operator packet inside the structured question. The chat packet 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 target is the scheduler-forward 48-hour target window: sender-local send days whose configured sending windows overlap the rolling target window, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus projected coverage (actual sent plus future scheduler-owned scheduled sends) and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting actual sent coverage, future scheduled rows, and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a target-window saturation ledger per selected sender with selected send days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected coverage, ready-to-schedule buffer, remaining projected gap, paid-InMail threshold feasibility, and the next MCP primitive. The structured packet lives in target.senderRefillPlans[] with target.eligibleSenderLedger, campaignRanking.options, sourcePlan, nextActions, manualAlternates, and target.globalActionQueue; preserve Need to prepare, Goal, Already sent, Scheduled, Ready and waiting to be scheduled, and Still need labels. In --yolo, execute exactly one globally ranked primitive from the post-refresh target.globalActionQueue[0], then rerun get_refill_target_plan before choosing another action. The refill_sends MCP command maintains a run-local refreshedPaidInmailSenderIds set: if the first target plan contains refresh_paid_inmail_credits for stale/missing paid-InMail facts, refill_sends refreshes each selected paid-InMail sender at most once, reruns get_refill_target_plan, and returns autoPaidInmailRefresh plus the post-refresh targetPlan before the operator chooses prep, approval, start, or fallback. Do not present paid-credit refresh as the next operator action after refill_sends has returned a post-refresh targetPlan. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/start result, recompute the target-window saturation ledger, and keep going until projected coverage (sent + scheduled) fills the scheduler-forward target window or a concrete non-scheduler blocker is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the projected gap but scheduled cells do not, report loaded, awaiting scheduler and run a persistent read-only scheduler wait/reread loop and keep the run open while awaiting_scheduler_after_ready_buffer is the only remaining state. Paid-InMail threshold changes and connection-campaign creation are explicit continuation options, never --yolo side effects. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet; do not return final completion for scheduler wait unless Christian explicitly asks for status or stops the run. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers and paid-InMail threshold blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. Trust schedulerGate.sendable and scheduler blockers over raw unipileAccountStatus labels alone. For long-running prep use compact prep status checks, reread target plans after prep or cancel, avoid huge parallel target-plan reads when output is large, and if prepared/ready rows grow but sender-level projected coverage does not move after one bounded settle loop, pivot to compact prep status or a scheduler-proven lane instead of waiting on campaign-level ready counts. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor contribute to projected coverage, and never call them complete unless a final re-read proves projected coverage fills the scheduler-forward target window. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if projected coverage does not fill the horizon, keep polling when ready buffer covers the gap and report only interim prepared/approved/ready - awaiting scheduler status if Christian asks. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
|
|
376
|
+
prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; if a plain managed-waterfall route has archived/completed skipped slots or does not cover the named sender set, immediately refetch with resolve_campaign_fill_route({ intent:"active" }) and inspect current dashboard-active ACTIVE/PAUSED campaign-backed sequence campaigns before declaring a sender blocked; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation, and treat "refill senders", "fill senders", "max out senders", and "load everyone up" as sender-scoped capacity-fill preparation. For sender-scoped requests with no named senders, --yolo means all eligible healthy senders enrolled in active campaign-backed sequence campaigns in the active workspace; without --yolo, ask which eligible enrolled senders to refill before choosing campaigns or mutating. In non-yolo interactive Codex or Claude Code sessions, post the full sender/campaign/action approval packet in normal chat as Markdown first, then ask request_user_input/AskUserQuestion with exactly Accept and Decline and a compact body that refers back to the posted packet; do not duplicate the campaign table or full operator packet inside the structured question. The chat packet 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 target is the scheduler-forward 48-hour target window: sender-local send days whose configured sending windows overlap the rolling target window, skipping no-send-hour days. For campaign-scoped fill/refill, select the best recent-send campaign and calculate the bounded gap from healthy sender daily capacity minus projected coverage (actual sent plus future scheduler-owned scheduled sends) and ready-to-schedule rows, then prepare only that gap. For sender-scoped fill/refill, calculate the bounded gap per eligible sender across active enrolled campaigns, counting actual sent coverage, future scheduled rows, and ready-to-schedule rows across those campaigns, then choose the best same-sender campaign to fill each sender gap: prefer recent/future scheduler-owned sends for that sender, then strongest recent result evidence, then source health. Maintain a target-window saturation ledger per selected sender with selected send days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected coverage, ready-to-schedule buffer, remaining projected gap, paid-InMail threshold feasibility, and the next MCP primitive. The structured packet lives in target.senderRefillPlans[] with target.eligibleSenderLedger, campaignRanking.options, sourcePlan, nextActions, manualAlternates, and target.globalActionQueue; preserve Need to prepare, Goal, Already sent, Scheduled, Ready and waiting to be scheduled, and Still need labels. In --yolo, execute exactly one globally ranked primitive from the post-refresh target.globalActionQueue[0], then rerun get_refill_target_plan before choosing another action. Refill action ladder: approve generated rows only when an explicit bounded approval gate exists, process all existing same-campaign unenriched/unprepared rows in bounded batches before any source work, then copy bounded net-new rows from the selected source (selectedLeadListId, provider, and source fingerprint preserved), then use provider-aligned source-more. A new source or provider switch changes the reply-rate baseline and is a manual alternate, not a --yolo side effect. The refill_sends MCP command maintains a run-local refreshedPaidInmailSenderIds set: if the first target plan contains refresh_paid_inmail_credits for stale/missing paid-InMail facts, refill_sends refreshes each selected paid-InMail sender at most once, reruns get_refill_target_plan, and returns autoPaidInmailRefresh plus the post-refresh targetPlan before the operator chooses prep/source-copy/read-only wait. Do not present paid-credit refresh as the next operator action after refill_sends has returned a post-refresh targetPlan. Do not stop after filling only one sender when the request was sender-scoped. In --yolo, continue through every safe selected sender/campaign action covered by the rendered packet, reread after each terminal apply/prep/source-copy/read-only wait result, recompute the target-window saturation ledger, and keep going until projected coverage (sent + scheduled) fills the scheduler-forward target window or a concrete non-scheduler blocker is proven. Ready-to-schedule rows are buffer, not completion; if ready covers the projected gap but scheduled cells do not, report loaded, awaiting scheduler and run a persistent read-only scheduler wait/reread loop and keep the run open while awaiting_scheduler_after_ready_buffer is the only remaining state. Paid-InMail threshold changes and connection-campaign creation are explicit continuation options, never --yolo side effects. When no safe in-packet action remains return concrete continuation options with campaign names, exact ids, and which options require a new approval packet; do not return final completion for scheduler wait unless Christian explicitly asks for status or stops the run. Use the refill workflow to decide whether to enrich/prep more rows in that same recent-send/best-result campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the selected same-sender lane is blocked/exhausted/already loaded while the sender still has a gap, or ask what to create. Do not create warm-post-engager side campaigns. Surface sender-health blockers and paid-InMail threshold blockers separately from prepared/approved/scheduled counts. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. Trust schedulerGate.sendable and scheduler blockers over raw unipileAccountStatus labels alone. For long-running prep use compact prep status checks, reread target plans after prep or cancel, avoid huge parallel target-plan reads when output is large, and if prepared/ready rows grow but sender-level projected coverage does not move after one bounded settle loop, pivot to compact prep status or a scheduler-proven lane instead of waiting on campaign-level ready counts. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. Before prep, inspect get_campaign_refill_state.preparationFrontier. If hasLaterPreparedIsland:true or earliestUnpreparedRow exists before later successful enrichment, use rowSelector:{type:"needsEnrichment"} with columnRole:"enrich" in table-position order or start_campaign_message_preparation adaptive defaults; do not use the UI Jump anchor or needsGeneratedMessage as the refill cursor. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; if confirm_lead_list returns USER_ADDED_ROWS_LIMIT_EXCEEDED, create a bounded same-source split from selectedLeadListId with get_rows_minimal/load_csv_linkedin_leads, confirm that smaller source list into the same campaign, and inspect reviewBatch only as diagnostics unless the approved packet explicitly prioritizes the just-copied split and earlier needsEnrichment rows are exhausted, dependency-blocked, or excluded. For approval diagnostics use rowSelector:{type:"needsApproval"} after current generated messages exist; mutating Approved cells still requires approvalMode:approve and exact bounded approval. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor contribute to projected coverage, and never call them complete unless a final re-read proves projected coverage fills the scheduler-forward target window. Before source import, prep, approval, or selected paused campaign start, require exact visible approval or --yolo packet auto-accept and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if projected coverage does not fill the horizon, keep polling when ready buffer covers the gap and report only interim prepared/approved/ready - awaiting scheduler status if Christian asks. Do not call start_campaign as part of fill/schedule horizon. start_campaign is allowed in refill only for exact selected PAUSED, dashboard-active, campaign-backed sequence targets named in the bounded packet, and the packet must state that starting can let the product scheduler schedule/send approved eligible sequence actions. Never start unrelated, archived, completed, draft, direct, or non-selected campaigns, never broad approve-all, and never use direct scheduler writes. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane.`,
|
|
377
377
|
},
|
|
378
378
|
};
|
|
379
379
|
}
|
|
@@ -159,6 +159,15 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
|
|
|
159
159
|
attemptedSenderIds?: undefined;
|
|
160
160
|
targetPlanReread?: undefined;
|
|
161
161
|
};
|
|
162
|
+
yoloExecution: {
|
|
163
|
+
enabled: false;
|
|
164
|
+
status: "not_run_without_yolo";
|
|
165
|
+
selectedAction: null;
|
|
166
|
+
targetPlanReread: false;
|
|
167
|
+
result?: undefined;
|
|
168
|
+
refusalReason?: undefined;
|
|
169
|
+
postActionFirstAction?: undefined;
|
|
170
|
+
};
|
|
162
171
|
command: string;
|
|
163
172
|
tool: string;
|
|
164
173
|
promptName: string;
|
|
@@ -225,6 +234,7 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
|
|
|
225
234
|
} | {
|
|
226
235
|
targetPlan: unknown;
|
|
227
236
|
targetPlanBeforePaidRefresh: unknown;
|
|
237
|
+
targetPlanBeforeYoloPrimitive: unknown;
|
|
228
238
|
autoPaidInmailRefresh: {
|
|
229
239
|
enabled: boolean;
|
|
230
240
|
status: string;
|
|
@@ -242,6 +252,23 @@ export declare function executeRefillSendsCommand(input?: RefillSendsCommandInpu
|
|
|
242
252
|
targetPlanReread: boolean;
|
|
243
253
|
note: string;
|
|
244
254
|
};
|
|
255
|
+
yoloExecution: {
|
|
256
|
+
enabled: true;
|
|
257
|
+
status: "skipped_after_paid_refresh";
|
|
258
|
+
selectedAction: null;
|
|
259
|
+
targetPlanReread: true;
|
|
260
|
+
result?: undefined;
|
|
261
|
+
refusalReason?: undefined;
|
|
262
|
+
postActionFirstAction?: undefined;
|
|
263
|
+
} | {
|
|
264
|
+
enabled: true;
|
|
265
|
+
status: "no_action" | "read_only_reread" | "executed_and_reread" | "refused";
|
|
266
|
+
selectedAction: Record<string, unknown> | null;
|
|
267
|
+
result: unknown;
|
|
268
|
+
targetPlanReread: boolean;
|
|
269
|
+
refusalReason: string | undefined;
|
|
270
|
+
postActionFirstAction: Record<string, unknown> | null;
|
|
271
|
+
};
|
|
245
272
|
command: string;
|
|
246
273
|
tool: string;
|
|
247
274
|
promptName: string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getRefillTargetPlan } from "./refill-target-plan.js";
|
|
2
2
|
import { refreshPaidInmailCredits } from "./senders.js";
|
|
3
|
+
import { startPrepareCampaignMessages } from "./campaign-message-preparation.js";
|
|
4
|
+
import { confirmLeadList } from "./leads.js";
|
|
3
5
|
const DEFAULT_SCHEDULER_FORWARD_HOURS = 48;
|
|
4
6
|
function normalizeStrings(values) {
|
|
5
7
|
if (!Array.isArray(values))
|
|
@@ -58,7 +60,7 @@ function normalizeTargetDate(value) {
|
|
|
58
60
|
export const refillSendsToolDefinitions = [
|
|
59
61
|
{
|
|
60
62
|
name: "refill_sends",
|
|
61
|
-
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. In --yolo, it may refresh stale paid InMail credit cache facts
|
|
63
|
+
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. In --yolo, it may refresh stale paid InMail credit cache facts once, or execute exactly one safe primitive from target.globalActionQueue[0] (bounded existing-row preparation, bounded same-source copy, or read-only wait) and reread. It does not approve messages without the bounded approval gate, lower paid InMail thresholds, switch source families, create campaigns, schedule sends, launch, archive, delete, or write scheduler rows.",
|
|
62
64
|
inputSchema: {
|
|
63
65
|
type: "object",
|
|
64
66
|
properties: {
|
|
@@ -213,14 +215,14 @@ export function refillSendsCommand(input = {}) {
|
|
|
213
215
|
"Treat current dashboard-active PAUSED campaign-backed sequence campaigns as start-eligible candidates: read refill state before deciding whether to prep, approve, start, or skip.",
|
|
214
216
|
"Fresh reread get_campaign_refill_state immediately before any import, prep, approval, or horizon-fill mutation.",
|
|
215
217
|
"Maintain a target-window saturation ledger per selected sender from get_refill_target_plan: selected days, gross capacity, actual sent counts, future scheduler-owned scheduled counts, projected counts, ready-to-schedule buffer, remaining projected gap, paid InMail threshold feasibility, targetShapeRevision, stateRevision, and next MCP primitive.",
|
|
216
|
-
"In --yolo, this tool automatically maintains a run-local refreshedPaidInmailSenderIds set: when the first target plan returns refresh_paid_inmail_credits candidates for selected paid-InMail lanes, it refreshes each exact sender at most once, reruns get_refill_target_plan, and returns the post-refresh targetPlan before any prep/
|
|
218
|
+
"In --yolo, this tool automatically maintains a run-local refreshedPaidInmailSenderIds set: when the first target plan returns refresh_paid_inmail_credits candidates for selected paid-InMail lanes, it refreshes each exact sender at most once, reruns get_refill_target_plan, and returns the post-refresh targetPlan before any prep/source-copy/read-only wait action is chosen.",
|
|
217
219
|
"Do not present paid-credit refresh as the next operator action after refill_sends returns autoPaidInmailRefresh and the post-refresh targetPlan.",
|
|
218
220
|
"If paid InMail feasibility remains below threshold after that automatic refresh, report the exact sender/campaign/table/column threshold action or same-campaign connection fallback; --yolo must not lower paid InMail thresholds or create campaigns.",
|
|
219
221
|
"In --yolo or after one Accept, continue through every safe selected sender/campaign action covered by the rendered target packet; sent/scheduled-count progress changes stateRevision and should continue while targetShapeRevision is stable.",
|
|
220
222
|
"Do not complete a fill/schedule request until a final get_refill_target_plan or refill-state reread proves projected coverage (sent + scheduled) fills the scheduler-forward target window. Treat awaiting_scheduler_after_ready_buffer as loaded, awaiting scheduler when ready buffer covers the gap; do not import/prep more rows in that state, and keep polling unless Christian stops/statuses the run or a concrete non-scheduler blocker such as paid_inmail_below_threshold appears.",
|
|
221
223
|
],
|
|
222
224
|
approvalContract: yolo
|
|
223
|
-
? "Auto-accept only the rendered bounded refill target packet after get_refill_target_plan and fresh reread. Execute one globally ranked primitive from target.globalActionQueue at a time, then rerun get_refill_target_plan before taking another action. Continue through every safe
|
|
225
|
+
? "Auto-accept only the rendered bounded refill target packet after get_refill_target_plan and fresh reread. Execute one globally ranked primitive from target.globalActionQueue at a time, then rerun get_refill_target_plan before taking another action. Continue through every safe prep/source-copy/read-only wait action inside that packet. Approval, start_campaign, source-family switches, threshold changes, and campaign creation require their own explicit gates. After each safe action, rerun get_refill_target_plan; keep going while targetShapeRevision is stable and projected coverage (sent + scheduled) progresses toward the target, even though stateRevision changes. Ready-to-schedule rows are buffer, not completion. If ready buffer covers the projected gap, use only persistent read-only scheduler wait/reread and keep the run open until projected coverage fills or Christian stops/statuses it. Stop immediately if targetShapeRevision changes because sender set, route, ids, caps, dates, blockers, action class, paid InMail threshold feasibility, or side-effect class drifts. --yolo does not authorize lowering paid InMail thresholds or creating connection campaigns."
|
|
224
226
|
: hasSenderSelectors
|
|
225
227
|
? "Before mutation, post the full bounded refill packet in normal chat as Markdown, including workspace, sender scope, campaign table, exact ids, caps/dates, gross target, sent count, scheduled count, projected count, ready buffer, remaining projected gap, paid InMail threshold feasibility, targetShapeRevision/stateRevision, side effects, forbidden actions, and stop condition. Then ask the final Accept/Decline structured approval question with a compact body that refers back to the posted packet instead of duplicating it. Only ask when get_refill_target_plan reports a positive remaining projected/ready gap. If target is complete by projected coverage, no-op without approval. If ready buffer covers the projected gap, run only persistent read-only scheduler wait/reread and keep the run open until projected coverage fills or Christian stops/statuses it. Threshold changes and campaign creation need separate explicit approval."
|
|
226
228
|
: "Ask which eligible enrolled senders to refill first, then, before mutation, post the full bounded refill packet in normal chat as Markdown and ask the final Accept/Decline structured approval question with a compact body that refers back to the posted packet.",
|
|
@@ -302,6 +304,14 @@ function recordValue(value) {
|
|
|
302
304
|
function stringValue(value) {
|
|
303
305
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
304
306
|
}
|
|
307
|
+
function numberValue(value) {
|
|
308
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
309
|
+
}
|
|
310
|
+
function stringArray(value) {
|
|
311
|
+
if (!Array.isArray(value))
|
|
312
|
+
return [];
|
|
313
|
+
return value.filter((item) => typeof item === "string");
|
|
314
|
+
}
|
|
305
315
|
function paidRefreshActionFrom(value) {
|
|
306
316
|
const action = recordValue(value);
|
|
307
317
|
if (!action || action.type !== "refresh_paid_inmail_credits")
|
|
@@ -349,6 +359,121 @@ function collectPaidInmailRefreshActions(plan) {
|
|
|
349
359
|
add(action);
|
|
350
360
|
return [...bySender.values()];
|
|
351
361
|
}
|
|
362
|
+
function firstGlobalAction(plan) {
|
|
363
|
+
const root = recordValue(plan);
|
|
364
|
+
const target = recordValue(root?.target);
|
|
365
|
+
const globalActionQueue = Array.isArray(target?.globalActionQueue)
|
|
366
|
+
? target.globalActionQueue
|
|
367
|
+
: [];
|
|
368
|
+
const [first] = globalActionQueue;
|
|
369
|
+
return recordValue(first);
|
|
370
|
+
}
|
|
371
|
+
function actionIds(action) {
|
|
372
|
+
return recordValue(action.ids) ?? {};
|
|
373
|
+
}
|
|
374
|
+
function actionToolInput(action) {
|
|
375
|
+
return recordValue(action.toolInput) ?? {};
|
|
376
|
+
}
|
|
377
|
+
function actionCampaignId(action) {
|
|
378
|
+
const ids = actionIds(action);
|
|
379
|
+
const toolInput = actionToolInput(action);
|
|
380
|
+
return (stringValue(toolInput.campaignId) ??
|
|
381
|
+
stringValue(toolInput.campaignOfferId) ??
|
|
382
|
+
stringValue(ids.campaignId) ??
|
|
383
|
+
stringValue(action.campaignId));
|
|
384
|
+
}
|
|
385
|
+
function actionTableId(action) {
|
|
386
|
+
const ids = actionIds(action);
|
|
387
|
+
const toolInput = actionToolInput(action);
|
|
388
|
+
return (stringValue(toolInput.tableId) ??
|
|
389
|
+
stringValue(ids.tableId) ??
|
|
390
|
+
stringValue(action.tableId));
|
|
391
|
+
}
|
|
392
|
+
function actionSourceLeadListId(action) {
|
|
393
|
+
const ids = actionIds(action);
|
|
394
|
+
const toolInput = actionToolInput(action);
|
|
395
|
+
return (stringValue(toolInput.sourceLeadListId) ??
|
|
396
|
+
stringValue(ids.sourceLeadListId) ??
|
|
397
|
+
stringValue(action.sourceLeadListId));
|
|
398
|
+
}
|
|
399
|
+
async function executeOneYoloPrimitive(action) {
|
|
400
|
+
if (!action)
|
|
401
|
+
return { status: "no_action" };
|
|
402
|
+
if (action.yoloEligible === false) {
|
|
403
|
+
return {
|
|
404
|
+
status: "refused",
|
|
405
|
+
refusalReason: "first global action is not yolo eligible",
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
switch (action.type) {
|
|
409
|
+
case "wait_for_scheduler":
|
|
410
|
+
case "wait_for_active_work":
|
|
411
|
+
case "wait_for_source_import":
|
|
412
|
+
return { status: "read_only_reread", result: { waited: true } };
|
|
413
|
+
case "prepare_messages": {
|
|
414
|
+
const campaignId = actionCampaignId(action);
|
|
415
|
+
const tableId = actionTableId(action) ?? undefined;
|
|
416
|
+
const toolInput = actionToolInput(action);
|
|
417
|
+
const targetPreparedMessages = numberValue(toolInput.targetPreparedMessages);
|
|
418
|
+
const approvalMode = toolInput.approvalMode === "approve" ? "approve" : "mark_ready";
|
|
419
|
+
if (!campaignId || !targetPreparedMessages || targetPreparedMessages <= 0) {
|
|
420
|
+
return {
|
|
421
|
+
status: "refused",
|
|
422
|
+
refusalReason: "prepare_messages action is missing campaignId or bounded targetPreparedMessages",
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
const result = await startPrepareCampaignMessages({
|
|
426
|
+
campaignId,
|
|
427
|
+
tableId,
|
|
428
|
+
targetPreparedMessages,
|
|
429
|
+
approvalMode,
|
|
430
|
+
autoContinue: true,
|
|
431
|
+
});
|
|
432
|
+
return { status: "executed_and_reread", result };
|
|
433
|
+
}
|
|
434
|
+
case "copy_selected_source_rows": {
|
|
435
|
+
const campaignOfferId = actionCampaignId(action);
|
|
436
|
+
const sourceLeadListId = actionSourceLeadListId(action);
|
|
437
|
+
const toolInput = actionToolInput(action);
|
|
438
|
+
const sourceRowIds = stringArray(toolInput.sourceRowIds);
|
|
439
|
+
const sourceRowLimit = numberValue(toolInput.sourceRowLimit);
|
|
440
|
+
const sourceFingerprint = stringValue(toolInput.sourceFingerprint) ??
|
|
441
|
+
stringValue(actionIds(action).sourceFingerprint);
|
|
442
|
+
if (!campaignOfferId || !sourceLeadListId || !sourceFingerprint) {
|
|
443
|
+
return {
|
|
444
|
+
status: "refused",
|
|
445
|
+
refusalReason: "copy_selected_source_rows action is missing campaignOfferId, sourceLeadListId, or sourceFingerprint",
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
if (sourceRowIds.length === 0 && (!sourceRowLimit || sourceRowLimit <= 0)) {
|
|
449
|
+
return {
|
|
450
|
+
status: "refused",
|
|
451
|
+
refusalReason: "copy_selected_source_rows action is missing exact sourceRowIds or a bounded sourceRowLimit",
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
const result = await confirmLeadList({
|
|
455
|
+
campaignOfferId,
|
|
456
|
+
sourceLeadListId,
|
|
457
|
+
currentStep: null,
|
|
458
|
+
confirmed: true,
|
|
459
|
+
sourceRowIds: sourceRowIds.length > 0 ? sourceRowIds : undefined,
|
|
460
|
+
sourceRowLimit: sourceRowIds.length > 0 ? undefined : sourceRowLimit ?? undefined,
|
|
461
|
+
reviewBatchLimit: sourceRowIds.length > 0 ? sourceRowIds.length : sourceRowLimit ?? undefined,
|
|
462
|
+
});
|
|
463
|
+
return { status: "executed_and_reread", result };
|
|
464
|
+
}
|
|
465
|
+
case "approve_messages":
|
|
466
|
+
return {
|
|
467
|
+
status: "refused",
|
|
468
|
+
refusalReason: "approve_messages requires the bounded approval mutation gate; refill_sends yolo will not treat select_campaign_cells as approval",
|
|
469
|
+
};
|
|
470
|
+
default:
|
|
471
|
+
return {
|
|
472
|
+
status: "refused",
|
|
473
|
+
refusalReason: `action ${String(action.type)} is not a safe yolo primitive`,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
}
|
|
352
477
|
export async function executeRefillSendsCommand(input = {}) {
|
|
353
478
|
const command = refillSendsCommand(input);
|
|
354
479
|
if (input.yolo !== true) {
|
|
@@ -361,6 +486,12 @@ export async function executeRefillSendsCommand(input = {}) {
|
|
|
361
486
|
failedPaidInmailRefreshes: [],
|
|
362
487
|
note: "Automatic paid InMail credit refresh only runs for --yolo refill_sends calls.",
|
|
363
488
|
},
|
|
489
|
+
yoloExecution: {
|
|
490
|
+
enabled: false,
|
|
491
|
+
status: "not_run_without_yolo",
|
|
492
|
+
selectedAction: null,
|
|
493
|
+
targetPlanReread: false,
|
|
494
|
+
},
|
|
364
495
|
};
|
|
365
496
|
}
|
|
366
497
|
const targetPlanInput = targetPlanInputFor(input);
|
|
@@ -391,10 +522,21 @@ export async function executeRefillSendsCommand(input = {}) {
|
|
|
391
522
|
const targetPlan = refreshActions.length > 0
|
|
392
523
|
? await getRefillTargetPlan(targetPlanInput)
|
|
393
524
|
: targetPlanBeforePaidRefresh;
|
|
525
|
+
const selectedAction = refreshActions.length > 0 ? null : firstGlobalAction(targetPlan);
|
|
526
|
+
const primitiveAttempt = refreshActions.length > 0
|
|
527
|
+
? null
|
|
528
|
+
: await executeOneYoloPrimitive(selectedAction);
|
|
529
|
+
const shouldRereadAfterPrimitive = primitiveAttempt?.status === "executed_and_reread" ||
|
|
530
|
+
primitiveAttempt?.status === "read_only_reread";
|
|
531
|
+
const postActionTargetPlan = shouldRereadAfterPrimitive
|
|
532
|
+
? await getRefillTargetPlan(targetPlanInput)
|
|
533
|
+
: null;
|
|
534
|
+
const finalTargetPlan = postActionTargetPlan ?? targetPlan;
|
|
394
535
|
return {
|
|
395
536
|
...command,
|
|
396
|
-
targetPlan,
|
|
537
|
+
targetPlan: finalTargetPlan,
|
|
397
538
|
targetPlanBeforePaidRefresh: refreshActions.length > 0 ? targetPlanBeforePaidRefresh : null,
|
|
539
|
+
targetPlanBeforeYoloPrimitive: refreshActions.length === 0 && postActionTargetPlan ? targetPlan : null,
|
|
398
540
|
autoPaidInmailRefresh: {
|
|
399
541
|
enabled: true,
|
|
400
542
|
status: refreshActions.length === 0
|
|
@@ -411,5 +553,23 @@ export async function executeRefillSendsCommand(input = {}) {
|
|
|
411
553
|
? "refill_sends refreshed stale paid InMail credit facts internally, once per sender, then returned the post-refresh targetPlan."
|
|
412
554
|
: "No stale or missing paid InMail credit refresh candidates were present in the initial target plan.",
|
|
413
555
|
},
|
|
556
|
+
yoloExecution: refreshActions.length > 0
|
|
557
|
+
? {
|
|
558
|
+
enabled: true,
|
|
559
|
+
status: "skipped_after_paid_refresh",
|
|
560
|
+
selectedAction: null,
|
|
561
|
+
targetPlanReread: true,
|
|
562
|
+
}
|
|
563
|
+
: {
|
|
564
|
+
enabled: true,
|
|
565
|
+
status: primitiveAttempt?.status ?? "no_action",
|
|
566
|
+
selectedAction,
|
|
567
|
+
result: primitiveAttempt?.result,
|
|
568
|
+
targetPlanReread: shouldRereadAfterPrimitive,
|
|
569
|
+
refusalReason: primitiveAttempt?.refusalReason,
|
|
570
|
+
postActionFirstAction: postActionTargetPlan
|
|
571
|
+
? firstGlobalAction(postActionTargetPlan)
|
|
572
|
+
: null,
|
|
573
|
+
},
|
|
414
574
|
};
|
|
415
575
|
}
|
|
@@ -9,6 +9,13 @@ const SAFE_PACKET_ACTION_TYPES = new Set([
|
|
|
9
9
|
"approve_messages",
|
|
10
10
|
"start_paused_campaign",
|
|
11
11
|
"wait_for_scheduler",
|
|
12
|
+
"wait_for_active_work",
|
|
13
|
+
"wait_for_source_import",
|
|
14
|
+
"copy_selected_source_rows",
|
|
15
|
+
"continue_signal_discovery_source",
|
|
16
|
+
"continue_sales_nav_source",
|
|
17
|
+
"continue_prospeo_source",
|
|
18
|
+
"manual_source_replenishment",
|
|
12
19
|
"refresh_paid_inmail_credits",
|
|
13
20
|
"lower_paid_inmail_threshold",
|
|
14
21
|
"switch_to_connection_lane",
|
|
@@ -18,6 +25,10 @@ const MANUAL_ONLY_PACKET_ACTION_TYPES = new Set([
|
|
|
18
25
|
"lower_paid_inmail_threshold",
|
|
19
26
|
"switch_to_connection_lane",
|
|
20
27
|
"create_connection_campaign",
|
|
28
|
+
"continue_signal_discovery_source",
|
|
29
|
+
"continue_sales_nav_source",
|
|
30
|
+
"continue_prospeo_source",
|
|
31
|
+
"manual_source_replenishment",
|
|
21
32
|
]);
|
|
22
33
|
const SOURCE_PLAN_STATES = new Set([
|
|
23
34
|
"not_needed",
|
|
@@ -26,6 +37,8 @@ const SOURCE_PLAN_STATES = new Set([
|
|
|
26
37
|
"needs_signal_import",
|
|
27
38
|
"waiting_for_import",
|
|
28
39
|
"needs_confirm",
|
|
40
|
+
"needs_same_source_copy",
|
|
41
|
+
"needs_provider_continuation",
|
|
29
42
|
"source_shortfall",
|
|
30
43
|
"provider_exhausted",
|
|
31
44
|
"provider_missing",
|
|
@@ -152,6 +165,16 @@ function sanitizeActionCandidate(candidate) {
|
|
|
152
165
|
tableId: stringValue(candidate.tableId),
|
|
153
166
|
tableName: stringValue(candidate.tableName) ?? null,
|
|
154
167
|
columnId: stringValue(candidate.columnId) ?? null,
|
|
168
|
+
sourceLeadListId: stringValue(candidate.sourceLeadListId) ?? null,
|
|
169
|
+
leadSourceProvider: stringValue(candidate.leadSourceProvider) ?? null,
|
|
170
|
+
sourceFingerprint: stringValue(candidate.sourceFingerprint) ?? null,
|
|
171
|
+
sourceInventoryStatus: stringValue(candidate.sourceInventoryStatus) ?? null,
|
|
172
|
+
sourceRowIds: stringArray(candidate.sourceRowIds),
|
|
173
|
+
sourceRowLimit: typeof candidate.sourceRowLimit === "number"
|
|
174
|
+
? candidate.sourceRowLimit
|
|
175
|
+
: undefined,
|
|
176
|
+
activeJobId: stringValue(candidate.activeJobId) ?? null,
|
|
177
|
+
activeImportStatus: stringValue(candidate.activeImportStatus) ?? null,
|
|
155
178
|
targetRows: typeof candidate.targetRows === "number" ? candidate.targetRows : undefined,
|
|
156
179
|
columnRole: stringValue(candidate.columnRole),
|
|
157
180
|
rowSelector: sanitizeRowSelector(candidate.rowSelector),
|
|
@@ -189,6 +212,21 @@ function sanitizeToolInput(value) {
|
|
|
189
212
|
campaignId: stringValue(value.campaignId),
|
|
190
213
|
tableId: stringValue(value.tableId),
|
|
191
214
|
columnId: stringValue(value.columnId) ?? null,
|
|
215
|
+
sourceLeadListId: stringValue(value.sourceLeadListId) ?? null,
|
|
216
|
+
leadSourceProvider: stringValue(value.leadSourceProvider) ?? null,
|
|
217
|
+
sourceFingerprint: stringValue(value.sourceFingerprint) ?? null,
|
|
218
|
+
activeJobId: stringValue(value.activeJobId) ?? null,
|
|
219
|
+
activeImportStatus: stringValue(value.activeImportStatus) ?? null,
|
|
220
|
+
sourceInventoryStatus: stringValue(value.sourceInventoryStatus) ?? null,
|
|
221
|
+
sourceRowIds: stringArray(value.sourceRowIds),
|
|
222
|
+
sourceRowLimit: typeof value.sourceRowLimit === "number"
|
|
223
|
+
? value.sourceRowLimit
|
|
224
|
+
: undefined,
|
|
225
|
+
campaignOfferId: stringValue(value.campaignOfferId),
|
|
226
|
+
provider: stringValue(value.provider),
|
|
227
|
+
allowDifferentSourceLeadList: typeof value.allowDifferentSourceLeadList === "boolean"
|
|
228
|
+
? value.allowDifferentSourceLeadList
|
|
229
|
+
: undefined,
|
|
192
230
|
targetPreparedMessages: typeof value.targetPreparedMessages === "number"
|
|
193
231
|
? value.targetPreparedMessages
|
|
194
232
|
: undefined,
|
|
@@ -215,6 +253,10 @@ function sanitizePacketIds(value) {
|
|
|
215
253
|
campaignId: stringValue(value.campaignId),
|
|
216
254
|
tableId: stringValue(value.tableId),
|
|
217
255
|
columnId: stringValue(value.columnId) ?? null,
|
|
256
|
+
sourceLeadListId: stringValue(value.sourceLeadListId) ?? null,
|
|
257
|
+
leadSourceProvider: stringValue(value.leadSourceProvider) ?? null,
|
|
258
|
+
sourceFingerprint: stringValue(value.sourceFingerprint) ?? null,
|
|
259
|
+
activeJobId: stringValue(value.activeJobId) ?? null,
|
|
218
260
|
};
|
|
219
261
|
}
|
|
220
262
|
function sanitizeStructuredAction(action, selectedBySender, mode, rank) {
|
|
@@ -334,6 +376,9 @@ function sanitizeSourcePlan(value) {
|
|
|
334
376
|
reason: stringValue(value.reason),
|
|
335
377
|
campaignId: stringValue(value.campaignId),
|
|
336
378
|
tableId: stringValue(value.tableId),
|
|
379
|
+
sourceLeadListId: stringValue(value.sourceLeadListId) ?? null,
|
|
380
|
+
leadSourceProvider: stringValue(value.leadSourceProvider) ?? null,
|
|
381
|
+
sourceFingerprint: stringValue(value.sourceFingerprint) ?? null,
|
|
337
382
|
remainingRowsNeeded: typeof value.remainingRowsNeeded === "number"
|
|
338
383
|
? value.remainingRowsNeeded
|
|
339
384
|
: undefined,
|
package/dist/tools/registry.d.ts
CHANGED
|
@@ -2952,6 +2952,8 @@ export declare const allTools: ({
|
|
|
2952
2952
|
keepInSync?: undefined;
|
|
2953
2953
|
jobId?: undefined;
|
|
2954
2954
|
reviewBatchLimit?: undefined;
|
|
2955
|
+
sourceRowIds?: undefined;
|
|
2956
|
+
sourceRowLimit?: undefined;
|
|
2955
2957
|
allowPartialSourceList?: undefined;
|
|
2956
2958
|
includeRawImportResult?: undefined;
|
|
2957
2959
|
selections?: undefined;
|
|
@@ -3146,6 +3148,8 @@ export declare const allTools: ({
|
|
|
3146
3148
|
keepInSync?: undefined;
|
|
3147
3149
|
jobId?: undefined;
|
|
3148
3150
|
reviewBatchLimit?: undefined;
|
|
3151
|
+
sourceRowIds?: undefined;
|
|
3152
|
+
sourceRowLimit?: undefined;
|
|
3149
3153
|
allowPartialSourceList?: undefined;
|
|
3150
3154
|
includeRawImportResult?: undefined;
|
|
3151
3155
|
selections?: undefined;
|
|
@@ -3239,6 +3243,8 @@ export declare const allTools: ({
|
|
|
3239
3243
|
keepInSync?: undefined;
|
|
3240
3244
|
jobId?: undefined;
|
|
3241
3245
|
reviewBatchLimit?: undefined;
|
|
3246
|
+
sourceRowIds?: undefined;
|
|
3247
|
+
sourceRowLimit?: undefined;
|
|
3242
3248
|
allowPartialSourceList?: undefined;
|
|
3243
3249
|
includeRawImportResult?: undefined;
|
|
3244
3250
|
selections?: undefined;
|
|
@@ -3404,6 +3410,8 @@ export declare const allTools: ({
|
|
|
3404
3410
|
keepInSync?: undefined;
|
|
3405
3411
|
jobId?: undefined;
|
|
3406
3412
|
reviewBatchLimit?: undefined;
|
|
3413
|
+
sourceRowIds?: undefined;
|
|
3414
|
+
sourceRowLimit?: undefined;
|
|
3407
3415
|
allowPartialSourceList?: undefined;
|
|
3408
3416
|
includeRawImportResult?: undefined;
|
|
3409
3417
|
selections?: undefined;
|
|
@@ -3511,6 +3519,8 @@ export declare const allTools: ({
|
|
|
3511
3519
|
keepInSync?: undefined;
|
|
3512
3520
|
jobId?: undefined;
|
|
3513
3521
|
reviewBatchLimit?: undefined;
|
|
3522
|
+
sourceRowIds?: undefined;
|
|
3523
|
+
sourceRowLimit?: undefined;
|
|
3514
3524
|
allowPartialSourceList?: undefined;
|
|
3515
3525
|
includeRawImportResult?: undefined;
|
|
3516
3526
|
selections?: undefined;
|
|
@@ -3627,6 +3637,8 @@ export declare const allTools: ({
|
|
|
3627
3637
|
keepInSync?: undefined;
|
|
3628
3638
|
jobId?: undefined;
|
|
3629
3639
|
reviewBatchLimit?: undefined;
|
|
3640
|
+
sourceRowIds?: undefined;
|
|
3641
|
+
sourceRowLimit?: undefined;
|
|
3630
3642
|
allowPartialSourceList?: undefined;
|
|
3631
3643
|
includeRawImportResult?: undefined;
|
|
3632
3644
|
selections?: undefined;
|
|
@@ -3732,6 +3744,8 @@ export declare const allTools: ({
|
|
|
3732
3744
|
keepInSync?: undefined;
|
|
3733
3745
|
jobId?: undefined;
|
|
3734
3746
|
reviewBatchLimit?: undefined;
|
|
3747
|
+
sourceRowIds?: undefined;
|
|
3748
|
+
sourceRowLimit?: undefined;
|
|
3735
3749
|
allowPartialSourceList?: undefined;
|
|
3736
3750
|
includeRawImportResult?: undefined;
|
|
3737
3751
|
selections?: undefined;
|
|
@@ -3842,6 +3856,8 @@ export declare const allTools: ({
|
|
|
3842
3856
|
keepInSync?: undefined;
|
|
3843
3857
|
jobId?: undefined;
|
|
3844
3858
|
reviewBatchLimit?: undefined;
|
|
3859
|
+
sourceRowIds?: undefined;
|
|
3860
|
+
sourceRowLimit?: undefined;
|
|
3845
3861
|
allowPartialSourceList?: undefined;
|
|
3846
3862
|
includeRawImportResult?: undefined;
|
|
3847
3863
|
selections?: undefined;
|
|
@@ -3940,6 +3956,8 @@ export declare const allTools: ({
|
|
|
3940
3956
|
keepInSync?: undefined;
|
|
3941
3957
|
jobId?: undefined;
|
|
3942
3958
|
reviewBatchLimit?: undefined;
|
|
3959
|
+
sourceRowIds?: undefined;
|
|
3960
|
+
sourceRowLimit?: undefined;
|
|
3943
3961
|
allowPartialSourceList?: undefined;
|
|
3944
3962
|
includeRawImportResult?: undefined;
|
|
3945
3963
|
selections?: undefined;
|
|
@@ -4830,6 +4848,8 @@ export declare const allTools: ({
|
|
|
4830
4848
|
keepInSync?: undefined;
|
|
4831
4849
|
jobId?: undefined;
|
|
4832
4850
|
reviewBatchLimit?: undefined;
|
|
4851
|
+
sourceRowIds?: undefined;
|
|
4852
|
+
sourceRowLimit?: undefined;
|
|
4833
4853
|
allowPartialSourceList?: undefined;
|
|
4834
4854
|
includeRawImportResult?: undefined;
|
|
4835
4855
|
selections?: undefined;
|
|
@@ -4937,6 +4957,8 @@ export declare const allTools: ({
|
|
|
4937
4957
|
keepInSync?: undefined;
|
|
4938
4958
|
jobId?: undefined;
|
|
4939
4959
|
reviewBatchLimit?: undefined;
|
|
4960
|
+
sourceRowIds?: undefined;
|
|
4961
|
+
sourceRowLimit?: undefined;
|
|
4940
4962
|
allowPartialSourceList?: undefined;
|
|
4941
4963
|
includeRawImportResult?: undefined;
|
|
4942
4964
|
selections?: undefined;
|
|
@@ -5982,6 +6004,8 @@ export declare const allTools: ({
|
|
|
5982
6004
|
keepInSync?: undefined;
|
|
5983
6005
|
jobId?: undefined;
|
|
5984
6006
|
reviewBatchLimit?: undefined;
|
|
6007
|
+
sourceRowIds?: undefined;
|
|
6008
|
+
sourceRowLimit?: undefined;
|
|
5985
6009
|
allowPartialSourceList?: undefined;
|
|
5986
6010
|
includeRawImportResult?: undefined;
|
|
5987
6011
|
selections?: undefined;
|
|
@@ -6136,6 +6160,8 @@ export declare const allTools: ({
|
|
|
6136
6160
|
keepInSync?: undefined;
|
|
6137
6161
|
jobId?: undefined;
|
|
6138
6162
|
reviewBatchLimit?: undefined;
|
|
6163
|
+
sourceRowIds?: undefined;
|
|
6164
|
+
sourceRowLimit?: undefined;
|
|
6139
6165
|
allowPartialSourceList?: undefined;
|
|
6140
6166
|
includeRawImportResult?: undefined;
|
|
6141
6167
|
selections?: undefined;
|
|
@@ -6277,6 +6303,8 @@ export declare const allTools: ({
|
|
|
6277
6303
|
keepInSync?: undefined;
|
|
6278
6304
|
jobId?: undefined;
|
|
6279
6305
|
reviewBatchLimit?: undefined;
|
|
6306
|
+
sourceRowIds?: undefined;
|
|
6307
|
+
sourceRowLimit?: undefined;
|
|
6280
6308
|
allowPartialSourceList?: undefined;
|
|
6281
6309
|
includeRawImportResult?: undefined;
|
|
6282
6310
|
selections?: undefined;
|
|
@@ -6373,6 +6401,8 @@ export declare const allTools: ({
|
|
|
6373
6401
|
keepInSync?: undefined;
|
|
6374
6402
|
jobId?: undefined;
|
|
6375
6403
|
reviewBatchLimit?: undefined;
|
|
6404
|
+
sourceRowIds?: undefined;
|
|
6405
|
+
sourceRowLimit?: undefined;
|
|
6376
6406
|
allowPartialSourceList?: undefined;
|
|
6377
6407
|
includeRawImportResult?: undefined;
|
|
6378
6408
|
selections?: undefined;
|
|
@@ -6419,6 +6449,17 @@ export declare const allTools: ({
|
|
|
6419
6449
|
type: string;
|
|
6420
6450
|
description: string;
|
|
6421
6451
|
};
|
|
6452
|
+
sourceRowIds: {
|
|
6453
|
+
type: string;
|
|
6454
|
+
items: {
|
|
6455
|
+
type: string;
|
|
6456
|
+
};
|
|
6457
|
+
description: string;
|
|
6458
|
+
};
|
|
6459
|
+
sourceRowLimit: {
|
|
6460
|
+
type: string;
|
|
6461
|
+
description: string;
|
|
6462
|
+
};
|
|
6422
6463
|
allowPartialSourceList: {
|
|
6423
6464
|
type: string;
|
|
6424
6465
|
description: string;
|
|
@@ -6628,6 +6669,8 @@ export declare const allTools: ({
|
|
|
6628
6669
|
keepInSync?: undefined;
|
|
6629
6670
|
jobId?: undefined;
|
|
6630
6671
|
reviewBatchLimit?: undefined;
|
|
6672
|
+
sourceRowIds?: undefined;
|
|
6673
|
+
sourceRowLimit?: undefined;
|
|
6631
6674
|
allowPartialSourceList?: undefined;
|
|
6632
6675
|
includeRawImportResult?: undefined;
|
|
6633
6676
|
};
|
|
@@ -6725,6 +6768,8 @@ export declare const allTools: ({
|
|
|
6725
6768
|
keepInSync?: undefined;
|
|
6726
6769
|
jobId?: undefined;
|
|
6727
6770
|
reviewBatchLimit?: undefined;
|
|
6771
|
+
sourceRowIds?: undefined;
|
|
6772
|
+
sourceRowLimit?: undefined;
|
|
6728
6773
|
allowPartialSourceList?: undefined;
|
|
6729
6774
|
includeRawImportResult?: undefined;
|
|
6730
6775
|
selections?: undefined;
|
package/package.json
CHANGED
|
@@ -89,10 +89,16 @@ When the host can call typed MCP tools, start with:
|
|
|
89
89
|
refill_sends({ yolo?: boolean, senders?: string[], senderIds?: string[], senderNames?: string[], horizonSendDays?: number, untilDate?: "YYYY-MM-DD", targetDate?: "YYYY-MM-DD" })
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
That command helper
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
That command helper normalizes arguments and returns the execution contract. In
|
|
93
|
+
non-yolo mode it does not mutate. In `--yolo`, it may execute exactly one safe
|
|
94
|
+
bounded primitive from the fresh `target.globalActionQueue[0]`, then reread and
|
|
95
|
+
return the new target plan; currently safe primitives are paid-credit refresh,
|
|
96
|
+
existing-row message preparation, same-source row copy, and read-only wait
|
|
97
|
+
rereads. It does not approve messages without the bounded approval gate, lower
|
|
98
|
+
paid-InMail thresholds, switch source families, create campaigns, launch, send,
|
|
99
|
+
or write scheduler rows. Continue with the workflow below for route selection,
|
|
100
|
+
state rereads, approval gating, source import, preparation, and bounded
|
|
101
|
+
approval.
|
|
96
102
|
|
|
97
103
|
First call `get_auth_status({})`. If auth or active workspace is not OK, follow
|
|
98
104
|
the returned login/workspace guidance before route resolution. Do not run refill
|
|
@@ -164,12 +170,20 @@ Structured planner packet:
|
|
|
164
170
|
- `manualAlternates` are not yolo actions. Threshold lowering and campaign
|
|
165
171
|
creation are manual continuations only.
|
|
166
172
|
|
|
173
|
+
Refill action ladder: approve generated rows only when an explicit bounded
|
|
174
|
+
approval gate exists, process all existing same-campaign unenriched/unprepared
|
|
175
|
+
rows in bounded batches before any source work, then copy bounded net-new rows
|
|
176
|
+
from the selected source (`selectedLeadListId`, provider, and source
|
|
177
|
+
fingerprint preserved), then use provider-aligned source-more. A new source or
|
|
178
|
+
provider switch changes the reply-rate baseline and is a manual alternate, not a
|
|
179
|
+
`--yolo` side effect.
|
|
180
|
+
|
|
167
181
|
Run-local paid-credit guard: in `--yolo`, the `refill_sends` MCP command
|
|
168
182
|
automatically maintains a `refreshedPaidInmailSenderIds` set for the current
|
|
169
183
|
command call. If its first target plan has stale/missing paid-InMail credit
|
|
170
184
|
facts, it refreshes each selected sender at most once, reruns
|
|
171
185
|
`get_refill_target_plan`, and returns the post-refresh `targetPlan` before
|
|
172
|
-
choosing the next prep/
|
|
186
|
+
choosing the next prep/source-copy/read-only wait action. If fresh facts are still below
|
|
173
187
|
threshold, below-threshold paid-InMail facts fall back to an existing connection
|
|
174
188
|
lane, the same Sales Nav cascade campaign's connection branch, or a manual
|
|
175
189
|
continuation.
|
|
@@ -258,7 +272,7 @@ they change `stateRevision`, not `targetShapeRevision`, and do not require a
|
|
|
258
272
|
second approval.
|
|
259
273
|
|
|
260
274
|
In `--yolo`, continue as far as the rendered packet safely allows. After each
|
|
261
|
-
apply/prep/
|
|
275
|
+
apply/prep/source-copy/read-only wait result, reread state, settle processing when needed, and move to
|
|
262
276
|
the next selected sender or start-eligible same-packet campaign instead of
|
|
263
277
|
stopping after the first partial result. If no in-packet safe action remains,
|
|
264
278
|
return concrete continuation options with campaign names, exact ids, which option
|
|
@@ -272,7 +286,7 @@ selected sender: selected send days, gross capacity, actual sent cells, future
|
|
|
272
286
|
scheduler-owned scheduled cells with non-null `scheduledFor`, projected count,
|
|
273
287
|
ready-to-schedule buffer, remaining projected gap, paid-InMail feasibility,
|
|
274
288
|
`targetShapeRevision`, `stateRevision`, and the next MCP primitive that can
|
|
275
|
-
reduce the gap. After every apply/prep/
|
|
289
|
+
reduce the gap. After every apply/prep/source-copy/read-only wait result, wait for processing, reread
|
|
276
290
|
the target plan/refill state, recompute the ledger, then keep applying safe
|
|
277
291
|
bounded actions until projected coverage fills the target window or a concrete
|
|
278
292
|
non-scheduler blocker is proven.
|
|
@@ -108,12 +108,19 @@ in-progress wait state, not a reason to mark the goal complete or blocked.
|
|
|
108
108
|
- `nextActions[0]` is the current sender's smallest safe primitive.
|
|
109
109
|
- `manualAlternates` are not yolo actions. Threshold lowering and campaign
|
|
110
110
|
creation are manual continuations only.
|
|
111
|
+
Refill action ladder: approve generated rows only when an explicit bounded
|
|
112
|
+
approval gate exists, process all existing same-campaign
|
|
113
|
+
unenriched/unprepared rows in bounded batches before any source work, then
|
|
114
|
+
copy bounded net-new rows from the selected source (`selectedLeadListId`,
|
|
115
|
+
provider, and source fingerprint preserved), then use provider-aligned
|
|
116
|
+
source-more. A new source or provider switch changes the reply-rate baseline
|
|
117
|
+
and is a manual alternate, not a `--yolo` side effect.
|
|
111
118
|
Run-local paid-credit guard: in `--yolo`, the `refill_sends` MCP command
|
|
112
119
|
automatically maintains a `refreshedPaidInmailSenderIds` set for the current
|
|
113
120
|
command call. If its first target plan has stale/missing paid-InMail credit
|
|
114
121
|
facts, it refreshes each selected sender at most once, reruns
|
|
115
122
|
`get_refill_target_plan`, and returns the post-refresh `targetPlan` before
|
|
116
|
-
choosing the next prep/
|
|
123
|
+
choosing the next prep/source-copy/read-only wait action. If fresh facts are still below
|
|
117
124
|
threshold, below-threshold paid-InMail facts fall back to an existing
|
|
118
125
|
connection lane, the same Sales Nav cascade campaign's connection branch, or
|
|
119
126
|
a manual continuation.
|
|
@@ -552,7 +559,7 @@ same refill request, do not ask the `Accept` / `Decline` question. Instead:
|
|
|
552
559
|
caps/dates, approval mode, blockers, and side-effect class still match the
|
|
553
560
|
packet;
|
|
554
561
|
4. execute only the exact packet;
|
|
555
|
-
5. after each terminal credit-refresh/apply/prep/
|
|
562
|
+
5. after each terminal credit-refresh/apply/prep/source-copy/read-only wait result, rerun
|
|
556
563
|
`get_refill_target_plan`, reread state, settle processing when needed,
|
|
557
564
|
recompute the target-window saturation ledger, and continue with the next smallest
|
|
558
565
|
safe action inside the same bounded packet until every selected sender is
|