@sellable/mcp 0.1.504 → 0.1.506

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.
Files changed (34) hide show
  1. package/dist/api.d.ts +5 -5
  2. package/dist/api.js +10 -10
  3. package/dist/index-dev.js +0 -0
  4. package/dist/index.js +0 -0
  5. package/dist/server.js +2 -2
  6. package/dist/tools/campaign-fill-routing.d.ts +5 -0
  7. package/dist/tools/campaign-fill-routing.js +13 -3
  8. package/dist/tools/campaign-message-preparation.d.ts +33 -23
  9. package/dist/tools/campaign-message-preparation.js +31 -30
  10. package/dist/tools/campaign-processing.d.ts +19 -0
  11. package/dist/tools/campaign-processing.js +31 -8
  12. package/dist/tools/campaign-refill-state.d.ts +5 -0
  13. package/dist/tools/campaign-refill-state.js +13 -3
  14. package/dist/tools/leads.d.ts +6 -47
  15. package/dist/tools/leads.js +26 -30
  16. package/dist/tools/prompts.js +1 -1
  17. package/dist/tools/readiness.d.ts +6 -0
  18. package/dist/tools/readiness.js +12 -5
  19. package/dist/tools/refill-sends.d.ts +112 -29
  20. package/dist/tools/refill-sends.js +222 -569
  21. package/dist/tools/refill-target-plan.d.ts +5 -0
  22. package/dist/tools/refill-target-plan.js +32 -65
  23. package/dist/tools/registry.d.ts +232 -48
  24. package/dist/tools/scheduler-fill-capacity.d.ts +5 -0
  25. package/dist/tools/scheduler-fill-capacity.js +13 -3
  26. package/dist/tools/sender-routing.d.ts +8 -1
  27. package/dist/tools/sender-routing.js +12 -3
  28. package/dist/tools/senders.d.ts +14 -1
  29. package/dist/tools/senders.js +31 -5
  30. package/dist/tools/workspace-context.d.ts +36 -0
  31. package/dist/tools/workspace-context.js +39 -0
  32. package/package.json +1 -1
  33. package/skills/refill-sends/SKILL.md +53 -29
  34. package/skills/refill-sends-workflow/SKILL.md +19 -12
@@ -148,6 +148,7 @@ export type SignalSearchInput = {
148
148
  };
149
149
  export type ImportLeadsInput = {
150
150
  campaignOfferId: string;
151
+ workspaceId?: string;
151
152
  currentStep?: string | null;
152
153
  confirmed?: boolean;
153
154
  provider?: "apollo" | "sales-nav" | "prospeo" | "signal-discovery";
@@ -170,6 +171,7 @@ export type CancelLeadImportInput = {
170
171
  };
171
172
  export type ConfirmLeadListInput = {
172
173
  campaignOfferId: string;
174
+ workspaceId?: string;
173
175
  currentStep?: string | null;
174
176
  confirmed?: boolean;
175
177
  sourceLeadListId?: string;
@@ -179,8 +181,6 @@ export type ConfirmLeadListInput = {
179
181
  reviewBatchLimit?: number;
180
182
  includeRawImportResult?: boolean;
181
183
  allowPartialSourceList?: boolean;
182
- sourceRowIds?: string[];
183
- sourceRowLimit?: number;
184
184
  /**
185
185
  * Deprecated alias for reviewBatchLimit. Confirming a lead list now copies the
186
186
  * confirmed source into the campaign table; this value no longer caps clone
@@ -295,8 +295,6 @@ export declare const leadToolDefinitions: ({
295
295
  keepInSync?: undefined;
296
296
  jobId?: undefined;
297
297
  reviewBatchLimit?: undefined;
298
- sourceRowIds?: undefined;
299
- sourceRowLimit?: undefined;
300
298
  allowPartialSourceList?: undefined;
301
299
  includeRawImportResult?: undefined;
302
300
  selections?: undefined;
@@ -491,8 +489,6 @@ export declare const leadToolDefinitions: ({
491
489
  keepInSync?: undefined;
492
490
  jobId?: undefined;
493
491
  reviewBatchLimit?: undefined;
494
- sourceRowIds?: undefined;
495
- sourceRowLimit?: undefined;
496
492
  allowPartialSourceList?: undefined;
497
493
  includeRawImportResult?: undefined;
498
494
  selections?: undefined;
@@ -586,8 +582,6 @@ export declare const leadToolDefinitions: ({
586
582
  keepInSync?: undefined;
587
583
  jobId?: undefined;
588
584
  reviewBatchLimit?: undefined;
589
- sourceRowIds?: undefined;
590
- sourceRowLimit?: undefined;
591
585
  allowPartialSourceList?: undefined;
592
586
  includeRawImportResult?: undefined;
593
587
  selections?: undefined;
@@ -753,8 +747,6 @@ export declare const leadToolDefinitions: ({
753
747
  keepInSync?: undefined;
754
748
  jobId?: undefined;
755
749
  reviewBatchLimit?: undefined;
756
- sourceRowIds?: undefined;
757
- sourceRowLimit?: undefined;
758
750
  allowPartialSourceList?: undefined;
759
751
  includeRawImportResult?: undefined;
760
752
  selections?: undefined;
@@ -862,8 +854,6 @@ export declare const leadToolDefinitions: ({
862
854
  keepInSync?: undefined;
863
855
  jobId?: undefined;
864
856
  reviewBatchLimit?: undefined;
865
- sourceRowIds?: undefined;
866
- sourceRowLimit?: undefined;
867
857
  allowPartialSourceList?: undefined;
868
858
  includeRawImportResult?: undefined;
869
859
  selections?: undefined;
@@ -980,8 +970,6 @@ export declare const leadToolDefinitions: ({
980
970
  keepInSync?: undefined;
981
971
  jobId?: undefined;
982
972
  reviewBatchLimit?: undefined;
983
- sourceRowIds?: undefined;
984
- sourceRowLimit?: undefined;
985
973
  allowPartialSourceList?: undefined;
986
974
  includeRawImportResult?: undefined;
987
975
  selections?: undefined;
@@ -1087,8 +1075,6 @@ export declare const leadToolDefinitions: ({
1087
1075
  keepInSync?: undefined;
1088
1076
  jobId?: undefined;
1089
1077
  reviewBatchLimit?: undefined;
1090
- sourceRowIds?: undefined;
1091
- sourceRowLimit?: undefined;
1092
1078
  allowPartialSourceList?: undefined;
1093
1079
  includeRawImportResult?: undefined;
1094
1080
  selections?: undefined;
@@ -1199,8 +1185,6 @@ export declare const leadToolDefinitions: ({
1199
1185
  keepInSync?: undefined;
1200
1186
  jobId?: undefined;
1201
1187
  reviewBatchLimit?: undefined;
1202
- sourceRowIds?: undefined;
1203
- sourceRowLimit?: undefined;
1204
1188
  allowPartialSourceList?: undefined;
1205
1189
  includeRawImportResult?: undefined;
1206
1190
  selections?: undefined;
@@ -1299,8 +1283,6 @@ export declare const leadToolDefinitions: ({
1299
1283
  keepInSync?: undefined;
1300
1284
  jobId?: undefined;
1301
1285
  reviewBatchLimit?: undefined;
1302
- sourceRowIds?: undefined;
1303
- sourceRowLimit?: undefined;
1304
1286
  allowPartialSourceList?: undefined;
1305
1287
  includeRawImportResult?: undefined;
1306
1288
  selections?: undefined;
@@ -2191,8 +2173,6 @@ export declare const leadToolDefinitions: ({
2191
2173
  keepInSync?: undefined;
2192
2174
  jobId?: undefined;
2193
2175
  reviewBatchLimit?: undefined;
2194
- sourceRowIds?: undefined;
2195
- sourceRowLimit?: undefined;
2196
2176
  allowPartialSourceList?: undefined;
2197
2177
  includeRawImportResult?: undefined;
2198
2178
  selections?: undefined;
@@ -2300,8 +2280,6 @@ export declare const leadToolDefinitions: ({
2300
2280
  keepInSync?: undefined;
2301
2281
  jobId?: undefined;
2302
2282
  reviewBatchLimit?: undefined;
2303
- sourceRowIds?: undefined;
2304
- sourceRowLimit?: undefined;
2305
2283
  allowPartialSourceList?: undefined;
2306
2284
  includeRawImportResult?: undefined;
2307
2285
  selections?: undefined;
@@ -3347,8 +3325,6 @@ export declare const leadToolDefinitions: ({
3347
3325
  keepInSync?: undefined;
3348
3326
  jobId?: undefined;
3349
3327
  reviewBatchLimit?: undefined;
3350
- sourceRowIds?: undefined;
3351
- sourceRowLimit?: undefined;
3352
3328
  allowPartialSourceList?: undefined;
3353
3329
  includeRawImportResult?: undefined;
3354
3330
  selections?: undefined;
@@ -3503,8 +3479,6 @@ export declare const leadToolDefinitions: ({
3503
3479
  keepInSync?: undefined;
3504
3480
  jobId?: undefined;
3505
3481
  reviewBatchLimit?: undefined;
3506
- sourceRowIds?: undefined;
3507
- sourceRowLimit?: undefined;
3508
3482
  allowPartialSourceList?: undefined;
3509
3483
  includeRawImportResult?: undefined;
3510
3484
  selections?: undefined;
@@ -3646,8 +3620,6 @@ export declare const leadToolDefinitions: ({
3646
3620
  keepInSync?: undefined;
3647
3621
  jobId?: undefined;
3648
3622
  reviewBatchLimit?: undefined;
3649
- sourceRowIds?: undefined;
3650
- sourceRowLimit?: undefined;
3651
3623
  allowPartialSourceList?: undefined;
3652
3624
  includeRawImportResult?: undefined;
3653
3625
  selections?: undefined;
@@ -3744,8 +3716,6 @@ export declare const leadToolDefinitions: ({
3744
3716
  keepInSync?: undefined;
3745
3717
  jobId?: undefined;
3746
3718
  reviewBatchLimit?: undefined;
3747
- sourceRowIds?: undefined;
3748
- sourceRowLimit?: undefined;
3749
3719
  allowPartialSourceList?: undefined;
3750
3720
  includeRawImportResult?: undefined;
3751
3721
  selections?: undefined;
@@ -3792,17 +3762,6 @@ export declare const leadToolDefinitions: ({
3792
3762
  type: string;
3793
3763
  description: string;
3794
3764
  };
3795
- sourceRowIds: {
3796
- type: string;
3797
- items: {
3798
- type: string;
3799
- };
3800
- description: string;
3801
- };
3802
- sourceRowLimit: {
3803
- type: string;
3804
- description: string;
3805
- };
3806
3765
  allowPartialSourceList: {
3807
3766
  type: string;
3808
3767
  description: string;
@@ -4012,8 +3971,6 @@ export declare const leadToolDefinitions: ({
4012
3971
  keepInSync?: undefined;
4013
3972
  jobId?: undefined;
4014
3973
  reviewBatchLimit?: undefined;
4015
- sourceRowIds?: undefined;
4016
- sourceRowLimit?: undefined;
4017
3974
  allowPartialSourceList?: undefined;
4018
3975
  includeRawImportResult?: undefined;
4019
3976
  };
@@ -4111,8 +4068,6 @@ export declare const leadToolDefinitions: ({
4111
4068
  keepInSync?: undefined;
4112
4069
  jobId?: undefined;
4113
4070
  reviewBatchLimit?: undefined;
4114
- sourceRowIds?: undefined;
4115
- sourceRowLimit?: undefined;
4116
4071
  allowPartialSourceList?: undefined;
4117
4072
  includeRawImportResult?: undefined;
4118
4073
  selections?: undefined;
@@ -4562,6 +4517,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4562
4517
  args: {
4563
4518
  sourceLeadListId: string;
4564
4519
  campaignOfferId: string;
4520
+ workspaceId?: string;
4565
4521
  currentStep?: string | null;
4566
4522
  confirmed?: boolean;
4567
4523
  provider?: "apollo" | "sales-nav" | "prospeo" | "signal-discovery";
@@ -4614,6 +4570,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4614
4570
  sourceLeadListId: string;
4615
4571
  mode: string;
4616
4572
  campaignOfferId: string;
4573
+ workspaceId?: string;
4617
4574
  currentStep?: string | null;
4618
4575
  confirmed?: boolean;
4619
4576
  provider?: "apollo" | "sales-nav" | "prospeo" | "signal-discovery";
@@ -4707,6 +4664,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4707
4664
  provider: string;
4708
4665
  confirmed: boolean;
4709
4666
  allowInvalidSignalPosts: boolean;
4667
+ workspaceId?: string;
4710
4668
  currentStep?: string | null;
4711
4669
  sourceLeadListId?: string;
4712
4670
  searchId?: string;
@@ -4781,6 +4739,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4781
4739
  sourceLeadListId: string;
4782
4740
  mode: string;
4783
4741
  campaignOfferId: string;
4742
+ workspaceId?: string;
4784
4743
  currentStep?: string | null;
4785
4744
  confirmed?: boolean;
4786
4745
  provider?: "apollo" | "sales-nav" | "prospeo" | "signal-discovery";
@@ -10,6 +10,7 @@ import { assertInteractionApproval } from "./interaction-mode.js";
10
10
  import { assertProviderPromptLoaded, markProviderPromptLoaded, } from "./provider-preflight.js";
11
11
  import { waitForLeadListReady } from "./readiness.js";
12
12
  import { getTableRowsMinimal } from "./rows.js";
13
+ import { normalizeExplicitWorkspaceId, workspaceRequestOptions, } from "./workspace-context.js";
13
14
  const entryPath = process.argv[1] ? resolve(process.argv[1]) : process.cwd();
14
15
  const entryDir = dirname(entryPath);
15
16
  const workspaceRoot = resolveWorkspaceRoot(entryDir);
@@ -2201,15 +2202,6 @@ export const leadToolDefinitions = [
2201
2202
  type: "number",
2202
2203
  description: "Number of campaign rows to use as the initial review/process sample. Defaults to 15.",
2203
2204
  },
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
- },
2213
2205
  allowPartialSourceList: {
2214
2206
  type: "boolean",
2215
2207
  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.",
@@ -3641,11 +3633,11 @@ export async function searchSignals(input) {
3641
3633
  const effectiveHeadlineICPCriteria = headlineICPCriteria && headlineICPCriteria.length > 0
3642
3634
  ? headlineICPCriteria
3643
3635
  : rubricGuidelines;
3644
- if (campaignOfferId && searchCurrentStep) {
3636
+ if (campaignOfferId) {
3645
3637
  await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
3646
3638
  leadSourceType: "new",
3647
3639
  leadSourceProvider: "signal-discovery",
3648
- currentStep: searchCurrentStep,
3640
+ ...(searchCurrentStep ? { currentStep: searchCurrentStep } : {}),
3649
3641
  ...(currentStepTransition ? { currentStepTransition } : {}),
3650
3642
  watchNarration: buildSignalDiscoverySearchWatchNarration(),
3651
3643
  });
@@ -3661,9 +3653,9 @@ export async function searchSignals(input) {
3661
3653
  }
3662
3654
  const response = await api.post(`/api/v1/signal-discovery/search-signals`, searchRequest);
3663
3655
  const summary = summarizeSignalSearchResponse(response);
3664
- if (campaignOfferId && searchCurrentStep) {
3656
+ if (campaignOfferId) {
3665
3657
  await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
3666
- currentStep: searchCurrentStep,
3658
+ ...(searchCurrentStep ? { currentStep: searchCurrentStep } : {}),
3667
3659
  ...(currentStepTransition ? { currentStepTransition } : {}),
3668
3660
  watchNarration: buildSignalDiscoveryResultsWatchNarration(summary.postsReturned),
3669
3661
  });
@@ -4136,7 +4128,9 @@ export async function cancelLeadImport(input) {
4136
4128
  }
4137
4129
  export async function confirmLeadList(input) {
4138
4130
  const api = getApi();
4139
- const { campaignOfferId, currentStep, confirmed, sourceLeadListId, campaignName, keepInSync, jobId, reviewBatchLimit, includeRawImportResult, allowPartialSourceList, targetLeadCount, sourceRowIds, sourceRowLimit, } = input;
4131
+ const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
4132
+ const requestOptions = workspaceRequestOptions(workspaceId);
4133
+ const { campaignOfferId, currentStep, confirmed, sourceLeadListId, campaignName, keepInSync, jobId, reviewBatchLimit, includeRawImportResult, allowPartialSourceList, targetLeadCount, } = input;
4140
4134
  assertInteractionApproval({
4141
4135
  campaignId: campaignOfferId,
4142
4136
  action: "confirm-lead-list",
@@ -4145,7 +4139,9 @@ export async function confirmLeadList(input) {
4145
4139
  let resolvedLeadListId = sourceLeadListId;
4146
4140
  let resolvedProvider;
4147
4141
  if (!resolvedLeadListId || currentStep === undefined || !resolvedProvider) {
4148
- const campaign = await api.get(`/api/v2/campaign-offers/${campaignOfferId}`);
4142
+ const campaign = requestOptions
4143
+ ? await api.get(`/api/v2/campaign-offers/${campaignOfferId}`, requestOptions)
4144
+ : await api.get(`/api/v2/campaign-offers/${campaignOfferId}`);
4149
4145
  if (!resolvedLeadListId) {
4150
4146
  resolvedLeadListId = campaign.selectedLeadListId ?? undefined;
4151
4147
  }
@@ -4193,7 +4189,9 @@ export async function confirmLeadList(input) {
4193
4189
  : "filter-choice";
4194
4190
  const shouldSetCurrentStep = typeof effectiveCurrentStep === "string" && effectiveCurrentStep.length > 0;
4195
4191
  let readiness;
4196
- const leadListMeta = await api.get(`/api/v3/workflow-tables/${resolvedLeadListId}?mode=meta`);
4192
+ const leadListMeta = requestOptions
4193
+ ? await api.get(`/api/v3/workflow-tables/${resolvedLeadListId}?mode=meta`, requestOptions)
4194
+ : await api.get(`/api/v3/workflow-tables/${resolvedLeadListId}?mode=meta`);
4197
4195
  const leadListConfig = leadListMeta.table?.config ?? null;
4198
4196
  const leadListRowCount = leadListMeta.rowCount ?? 0;
4199
4197
  const importProgress = leadListConfig?.importProgress ?? null;
@@ -4256,6 +4254,7 @@ export async function confirmLeadList(input) {
4256
4254
  readiness = await waitForLeadListReady({
4257
4255
  leadListId: resolvedLeadListId,
4258
4256
  campaignOfferId,
4257
+ workspaceId: workspaceId ?? undefined,
4259
4258
  provider: resolvedProvider,
4260
4259
  jobId,
4261
4260
  targetLeadCount: readinessTargetLeadCount,
@@ -4331,17 +4330,17 @@ export async function confirmLeadList(input) {
4331
4330
  }
4332
4331
  return "Campaign or source lead list could not be found. Re-open the correct campaign or reselect the source list before retrying confirm_lead_list.";
4333
4332
  };
4334
- const importResult = await api
4335
- .post(`/api/v3/campaign-builder/import-leads`, {
4333
+ const importBody = {
4336
4334
  sourceLeadListId: resolvedLeadListId,
4337
4335
  campaignOfferId,
4338
4336
  campaignName,
4339
4337
  keepInSync,
4340
4338
  currentStep: null,
4341
- sourceRowIds,
4342
- sourceRowLimit,
4343
- })
4344
- .catch((error) => {
4339
+ ...(workspaceId ? { workspaceId } : {}),
4340
+ };
4341
+ const importResult = await (requestOptions
4342
+ ? api.post(`/api/v3/campaign-builder/import-leads`, importBody, requestOptions)
4343
+ : api.post(`/api/v3/campaign-builder/import-leads`, importBody)).catch((error) => {
4345
4344
  if (isTerminalAccessError(error)) {
4346
4345
  throw new Error(formatTerminalAccessError(error));
4347
4346
  }
@@ -4572,7 +4571,7 @@ export function getProviderPrompt(input) {
4572
4571
  }
4573
4572
  export async function selectPromisingPosts(input) {
4574
4573
  const api = getApi();
4575
- const { campaignOfferId, selections, headlineICPCriteria, currentStep, selectionMode, mode, scrapePlanMode, targetEngagerCount, maxPostsToScrape, } = input;
4574
+ const { campaignOfferId, selections, headlineICPCriteria, selectionMode, mode, scrapePlanMode, targetEngagerCount, maxPostsToScrape, } = input;
4576
4575
  const effectiveMode = selectionMode ?? mode ?? "replace";
4577
4576
  const effectiveScrapePlanMode = scrapePlanMode ??
4578
4577
  (targetEngagerCount || maxPostsToScrape
@@ -4672,13 +4671,10 @@ Approval card should say:
4672
4671
 
4673
4672
  **Approve scraping ${selectionResult.selectedCount} recommended LinkedIn post${selectionResult.selectedCount === 1 ? "" : "s"}?**`;
4674
4673
  }
4675
- const selectionCurrentStep = currentStep === null ? undefined : (currentStep ?? "signal-discovery");
4676
- if (selectionCurrentStep) {
4677
- await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
4678
- currentStep: selectionCurrentStep,
4679
- watchNarration: buildSelectedPostApprovalWatchNarration(selectionResult.selectedCount, recommendedPostCount, recommendationTargetEngagerCount),
4680
- });
4681
- }
4674
+ await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
4675
+ currentStep: "signal-discovery",
4676
+ watchNarration: buildSelectedPostApprovalWatchNarration(selectionResult.selectedCount, recommendedPostCount, recommendationTargetEngagerCount),
4677
+ });
4682
4678
  return {
4683
4679
  success: true,
4684
4680
  selectedCount: selectionResult.selectedCount,
@@ -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. 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/bounded-approval/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/bounded-approval/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.`,
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 to obtain the post-refresh targetPlan, then may apply the first supported yolo-eligible global primitive and return autoPaidInmailRefresh, yoloExecution, and final targetPlan evidence. Do not present paid-credit refresh as the next operator action after refill_sends has returned autoPaidInmailRefresh; inspect yoloExecution and continue from the final targetPlan when it applied an action. 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.`,
377
377
  },
378
378
  };
379
379
  }
@@ -8,6 +8,7 @@ type WaitForCampaignTableReadyInput = {
8
8
  type WaitForLeadListReadyInput = {
9
9
  leadListId?: string;
10
10
  campaignOfferId?: string;
11
+ workspaceId?: string;
11
12
  provider?: "apollo" | "sales-nav" | "prospeo" | "signal-discovery" | "csv-linkedin";
12
13
  jobId?: string;
13
14
  targetLeadCount?: number;
@@ -51,6 +52,7 @@ export declare const readinessToolDefinitions: ({
51
52
  };
52
53
  leadListId?: undefined;
53
54
  campaignOfferId?: undefined;
55
+ workspaceId?: undefined;
54
56
  provider?: undefined;
55
57
  jobId?: undefined;
56
58
  targetLeadCount?: undefined;
@@ -73,6 +75,10 @@ export declare const readinessToolDefinitions: ({
73
75
  type: string;
74
76
  description: string;
75
77
  };
78
+ workspaceId: {
79
+ type: string;
80
+ description: string;
81
+ };
76
82
  provider: {
77
83
  type: string;
78
84
  description: string;
@@ -1,6 +1,7 @@
1
1
  import { getApi } from "../api.js";
2
2
  import { hydrateCampaignContextFromNavigation } from "./context.js";
3
3
  import { getCampaignNavigationState } from "./navigation.js";
4
+ import { workspaceRequestOptions } from "./workspace-context.js";
4
5
  const DEFAULT_TIMEOUT_MS = 90000;
5
6
  const DEFAULT_INTERVAL_MS = 2000;
6
7
  const TOOL_CALL_TIMEOUT_GUARD_MS = 55000;
@@ -108,6 +109,10 @@ export const readinessToolDefinitions = [
108
109
  type: "string",
109
110
  description: "Campaign offer ID (used to resolve selectedLeadListId if leadListId is missing).",
110
111
  },
112
+ workspaceId: {
113
+ type: "string",
114
+ description: "Explicit request-scoped workspace id for scheduled/yolo refill automation.",
115
+ },
111
116
  provider: {
112
117
  type: "string",
113
118
  description: "Lead provider (apollo, sales-nav, prospeo, signal-discovery). If omitted, derived from campaignOfferId when possible.",
@@ -193,6 +198,8 @@ export async function waitForCampaignTableReady(input) {
193
198
  }
194
199
  export async function waitForLeadListReady(input) {
195
200
  const api = getApi();
201
+ const requestOptions = workspaceRequestOptions(input.workspaceId);
202
+ const apiGet = (path) => requestOptions ? api.get(path, requestOptions) : api.get(path);
196
203
  const { effectiveTimeoutMs, guardApplied, requestedTimeoutMs } = resolveWaitTimeout(input.timeoutMs);
197
204
  const intervalMs = Math.max(500, input.intervalMs ?? DEFAULT_INTERVAL_MS);
198
205
  const requireRows = input.requireRows !== false;
@@ -201,7 +208,7 @@ export async function waitForLeadListReady(input) {
201
208
  let provider = input.provider;
202
209
  let targetLeadCount = input.targetLeadCount;
203
210
  if (input.campaignOfferId && (!leadListId || !provider)) {
204
- const campaign = await api.get(`/api/v2/campaign-offers/${input.campaignOfferId}`);
211
+ const campaign = await apiGet(`/api/v2/campaign-offers/${input.campaignOfferId}`);
205
212
  if (!leadListId) {
206
213
  leadListId = campaign?.selectedLeadListId ?? undefined;
207
214
  }
@@ -231,7 +238,7 @@ export async function waitForLeadListReady(input) {
231
238
  while (Date.now() - start <= effectiveTimeoutMs) {
232
239
  attempts += 1;
233
240
  try {
234
- const meta = await api.get(`/api/v3/workflow-tables/${leadListId}?mode=meta`);
241
+ const meta = await apiGet(`/api/v3/workflow-tables/${leadListId}?mode=meta`);
235
242
  const rowCount = meta?.rowCount ?? 0;
236
243
  lastRowCount = rowCount;
237
244
  const config = meta?.table?.config ?? null;
@@ -321,7 +328,7 @@ export async function waitForLeadListReady(input) {
321
328
  // If config didn't provide a status, fall back to provider-specific checks.
322
329
  if (!configStatus) {
323
330
  if (provider === "apollo") {
324
- const statusResponse = await api.get(`/api/v3/lead-lists/${leadListId}/apollo-import/status`);
331
+ const statusResponse = await apiGet(`/api/v3/lead-lists/${leadListId}/apollo-import/status`);
325
332
  const status = statusResponse?.status ?? null;
326
333
  lastStatus = status;
327
334
  statusTarget = statusResponse?.progress?.targetLeadCount ?? null;
@@ -364,7 +371,7 @@ export async function waitForLeadListReady(input) {
364
371
  }
365
372
  else if (provider === "sales-nav") {
366
373
  if (jobId) {
367
- const statusResponse = await api.get(`/api/v3/sales-nav/export?jobId=${jobId}`);
374
+ const statusResponse = await apiGet(`/api/v3/sales-nav/export?jobId=${jobId}`);
368
375
  const status = statusResponse?.job?.status ?? null;
369
376
  lastStatus = status;
370
377
  statusTarget = statusResponse?.job?.targetLeadCount ?? null;
@@ -410,7 +417,7 @@ export async function waitForLeadListReady(input) {
410
417
  }
411
418
  else if (provider === "prospeo") {
412
419
  if (jobId) {
413
- const statusResponse = await api.get(`/api/v3/lead-lists/${leadListId}/prospeo-import/status?jobId=${jobId}`);
420
+ const statusResponse = await apiGet(`/api/v3/lead-lists/${leadListId}/prospeo-import/status?jobId=${jobId}`);
414
421
  const status = statusResponse?.job?.status ?? null;
415
422
  lastStatus = status;
416
423
  statusTarget = statusResponse?.job?.targetLeadCount ?? null;