@sellable/mcp 0.1.511 → 0.1.512

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.
@@ -70,6 +70,7 @@ export type SalesNavSearchInput = {
70
70
  };
71
71
  export type ProspeoSearchInput = {
72
72
  filters: Record<string, unknown>;
73
+ workspaceId?: string;
73
74
  page?: number;
74
75
  searchId?: string;
75
76
  campaignOfferId?: string;
@@ -166,6 +167,7 @@ export type ImportLeadsInput = {
166
167
  };
167
168
  export type CancelLeadImportInput = {
168
169
  campaignOfferId: string;
170
+ workspaceId?: string;
169
171
  tableId: string;
170
172
  provider: "apollo" | "prospeo" | "sales-nav";
171
173
  };
@@ -278,6 +280,7 @@ export declare const leadToolDefinitions: ({
278
280
  previewOnly?: undefined;
279
281
  companySearchToken?: undefined;
280
282
  selectedCompanyIds?: undefined;
283
+ workspaceId?: undefined;
281
284
  domainFilterId?: undefined;
282
285
  type?: undefined;
283
286
  profileUrl?: undefined;
@@ -474,6 +477,7 @@ export declare const leadToolDefinitions: ({
474
477
  previewOnly?: undefined;
475
478
  companySearchToken?: undefined;
476
479
  selectedCompanyIds?: undefined;
480
+ workspaceId?: undefined;
477
481
  domainFilterId?: undefined;
478
482
  type?: undefined;
479
483
  profileUrl?: undefined;
@@ -569,6 +573,7 @@ export declare const leadToolDefinitions: ({
569
573
  previewOnly?: undefined;
570
574
  companySearchToken?: undefined;
571
575
  selectedCompanyIds?: undefined;
576
+ workspaceId?: undefined;
572
577
  domainFilterId?: undefined;
573
578
  type?: undefined;
574
579
  profileUrl?: undefined;
@@ -736,6 +741,7 @@ export declare const leadToolDefinitions: ({
736
741
  previewOnly?: undefined;
737
742
  companySearchToken?: undefined;
738
743
  selectedCompanyIds?: undefined;
744
+ workspaceId?: undefined;
739
745
  domainFilterId?: undefined;
740
746
  type?: undefined;
741
747
  profileUrl?: undefined;
@@ -845,6 +851,7 @@ export declare const leadToolDefinitions: ({
845
851
  previewOnly?: undefined;
846
852
  companySearchToken?: undefined;
847
853
  selectedCompanyIds?: undefined;
854
+ workspaceId?: undefined;
848
855
  domainFilterId?: undefined;
849
856
  type?: undefined;
850
857
  profileUrl?: undefined;
@@ -963,6 +970,7 @@ export declare const leadToolDefinitions: ({
963
970
  previewOnly?: undefined;
964
971
  companySearchToken?: undefined;
965
972
  selectedCompanyIds?: undefined;
973
+ workspaceId?: undefined;
966
974
  domainFilterId?: undefined;
967
975
  type?: undefined;
968
976
  profileUrl?: undefined;
@@ -1070,6 +1078,7 @@ export declare const leadToolDefinitions: ({
1070
1078
  previewOnly?: undefined;
1071
1079
  companySearchToken?: undefined;
1072
1080
  selectedCompanyIds?: undefined;
1081
+ workspaceId?: undefined;
1073
1082
  domainFilterId?: undefined;
1074
1083
  type?: undefined;
1075
1084
  profileUrl?: undefined;
@@ -1182,6 +1191,7 @@ export declare const leadToolDefinitions: ({
1182
1191
  previewOnly?: undefined;
1183
1192
  companySearchToken?: undefined;
1184
1193
  selectedCompanyIds?: undefined;
1194
+ workspaceId?: undefined;
1185
1195
  domainFilterId?: undefined;
1186
1196
  type?: undefined;
1187
1197
  profileUrl?: undefined;
@@ -1282,6 +1292,7 @@ export declare const leadToolDefinitions: ({
1282
1292
  previewOnly?: undefined;
1283
1293
  companySearchToken?: undefined;
1284
1294
  selectedCompanyIds?: undefined;
1295
+ workspaceId?: undefined;
1285
1296
  domainFilterId?: undefined;
1286
1297
  type?: undefined;
1287
1298
  profileUrl?: undefined;
@@ -2174,6 +2185,7 @@ export declare const leadToolDefinitions: ({
2174
2185
  exclude?: undefined;
2175
2186
  companySearchToken?: undefined;
2176
2187
  selectedCompanyIds?: undefined;
2188
+ workspaceId?: undefined;
2177
2189
  domainFilterId?: undefined;
2178
2190
  type?: undefined;
2179
2191
  profileUrl?: undefined;
@@ -2283,6 +2295,7 @@ export declare const leadToolDefinitions: ({
2283
2295
  seedDomains?: undefined;
2284
2296
  sort?: undefined;
2285
2297
  previewOnly?: undefined;
2298
+ workspaceId?: undefined;
2286
2299
  domainFilterId?: undefined;
2287
2300
  type?: undefined;
2288
2301
  profileUrl?: undefined;
@@ -3269,6 +3282,10 @@ export declare const leadToolDefinitions: ({
3269
3282
  type: string;
3270
3283
  description: string;
3271
3284
  };
3285
+ workspaceId: {
3286
+ type: string;
3287
+ description: string;
3288
+ };
3272
3289
  searchName: {
3273
3290
  type: string;
3274
3291
  description: string;
@@ -3493,6 +3510,7 @@ export declare const leadToolDefinitions: ({
3493
3510
  previewOnly?: undefined;
3494
3511
  companySearchToken?: undefined;
3495
3512
  selectedCompanyIds?: undefined;
3513
+ workspaceId?: undefined;
3496
3514
  domainFilterId?: undefined;
3497
3515
  sourceLeadListId?: undefined;
3498
3516
  targetLeadCount?: undefined;
@@ -3525,6 +3543,10 @@ export declare const leadToolDefinitions: ({
3525
3543
  type: string;
3526
3544
  description: string;
3527
3545
  };
3546
+ workspaceId: {
3547
+ type: string;
3548
+ description: string;
3549
+ };
3528
3550
  provider: {
3529
3551
  type: string;
3530
3552
  enum: string[];
@@ -3668,6 +3690,10 @@ export declare const leadToolDefinitions: ({
3668
3690
  type: string;
3669
3691
  description: string;
3670
3692
  };
3693
+ workspaceId: {
3694
+ type: string;
3695
+ description: string;
3696
+ };
3671
3697
  tableId: {
3672
3698
  type: string;
3673
3699
  description: string;
@@ -3766,6 +3792,10 @@ export declare const leadToolDefinitions: ({
3766
3792
  type: string;
3767
3793
  description: string;
3768
3794
  };
3795
+ workspaceId: {
3796
+ type: string;
3797
+ description: string;
3798
+ };
3769
3799
  sourceLeadListId: {
3770
3800
  type: string;
3771
3801
  description: string;
@@ -3998,6 +4028,7 @@ export declare const leadToolDefinitions: ({
3998
4028
  previewOnly?: undefined;
3999
4029
  companySearchToken?: undefined;
4000
4030
  selectedCompanyIds?: undefined;
4031
+ workspaceId?: undefined;
4001
4032
  domainFilterId?: undefined;
4002
4033
  type?: undefined;
4003
4034
  profileUrl?: undefined;
@@ -4095,6 +4126,7 @@ export declare const leadToolDefinitions: ({
4095
4126
  previewOnly?: undefined;
4096
4127
  companySearchToken?: undefined;
4097
4128
  selectedCompanyIds?: undefined;
4129
+ workspaceId?: undefined;
4098
4130
  domainFilterId?: undefined;
4099
4131
  type?: undefined;
4100
4132
  profileUrl?: undefined;
@@ -4554,6 +4586,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4554
4586
  targetLeadCount?: undefined;
4555
4587
  existingCount?: undefined;
4556
4588
  createdLeadList?: undefined;
4589
+ selectedLeadListIdUpdated?: undefined;
4557
4590
  jobResult?: undefined;
4558
4591
  } | {
4559
4592
  error: string;
@@ -4603,6 +4636,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4603
4636
  targetLeadCount?: undefined;
4604
4637
  existingCount?: undefined;
4605
4638
  createdLeadList?: undefined;
4639
+ selectedLeadListIdUpdated?: undefined;
4606
4640
  jobResult?: undefined;
4607
4641
  } | {
4608
4642
  provider: "signal-discovery" | "sales-nav" | "prospeo";
@@ -4652,6 +4686,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4652
4686
  targetLeadCount?: undefined;
4653
4687
  existingCount?: undefined;
4654
4688
  createdLeadList?: undefined;
4689
+ selectedLeadListIdUpdated?: undefined;
4655
4690
  jobResult?: undefined;
4656
4691
  } | {
4657
4692
  provider: string;
@@ -4687,6 +4722,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4687
4722
  targetLeadCount?: undefined;
4688
4723
  existingCount?: undefined;
4689
4724
  createdLeadList?: undefined;
4725
+ selectedLeadListIdUpdated?: undefined;
4690
4726
  jobResult?: undefined;
4691
4727
  } | {
4692
4728
  provider: string;
@@ -4742,6 +4778,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4742
4778
  targetLeadCount?: undefined;
4743
4779
  existingCount?: undefined;
4744
4780
  createdLeadList?: undefined;
4781
+ selectedLeadListIdUpdated?: undefined;
4745
4782
  jobResult?: undefined;
4746
4783
  } | {
4747
4784
  provider: string;
@@ -4771,6 +4808,7 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4771
4808
  needsInvalidPostConfirmation?: undefined;
4772
4809
  existingCount?: undefined;
4773
4810
  createdLeadList?: undefined;
4811
+ selectedLeadListIdUpdated?: undefined;
4774
4812
  jobResult?: undefined;
4775
4813
  } | {
4776
4814
  provider: "sales-nav" | "prospeo";
@@ -4820,11 +4858,13 @@ export declare function importLeads(input: ImportLeadsInput): Promise<{
4820
4858
  warnings?: undefined;
4821
4859
  targetLeadCount?: undefined;
4822
4860
  createdLeadList?: undefined;
4861
+ selectedLeadListIdUpdated?: undefined;
4823
4862
  jobResult?: undefined;
4824
4863
  } | {
4825
4864
  provider: "sales-nav" | "prospeo";
4826
4865
  leadListId: string;
4827
4866
  createdLeadList: any;
4867
+ selectedLeadListIdUpdated: boolean;
4828
4868
  jobResult: any;
4829
4869
  jobId: string | undefined;
4830
4870
  targetLeadCount: number | null;
@@ -1970,6 +1970,10 @@ export const leadToolDefinitions = [
1970
1970
  type: "string",
1971
1971
  description: "Campaign offer ID to associate search",
1972
1972
  },
1973
+ workspaceId: {
1974
+ type: "string",
1975
+ description: "Explicit request-scoped workspace id. Pass this instead of switching the shared active workspace.",
1976
+ },
1973
1977
  searchName: {
1974
1978
  type: "string",
1975
1979
  description: "Optional name for the search. Use descriptive names that encode ICP intent (e.g., 'Fintech Compliance Directors 201-1000 US').",
@@ -2077,6 +2081,10 @@ export const leadToolDefinitions = [
2077
2081
  type: "string",
2078
2082
  description: "Campaign offer ID",
2079
2083
  },
2084
+ workspaceId: {
2085
+ type: "string",
2086
+ description: "Explicit request-scoped workspace id. Pass this instead of switching the shared active workspace.",
2087
+ },
2080
2088
  provider: {
2081
2089
  type: "string",
2082
2090
  enum: ["apollo", "sales-nav", "prospeo", "signal-discovery"],
@@ -2151,6 +2159,10 @@ export const leadToolDefinitions = [
2151
2159
  type: "string",
2152
2160
  description: "Campaign offer ID. Required for audit context; not used to resolve provider or tableId.",
2153
2161
  },
2162
+ workspaceId: {
2163
+ type: "string",
2164
+ description: "Explicit request-scoped workspace id. Pass this instead of switching the shared active workspace.",
2165
+ },
2154
2166
  tableId: {
2155
2167
  type: "string",
2156
2168
  description: "Lead list (workflow table) ID to cancel. Required; callers have this from campaign context.",
@@ -2174,6 +2186,10 @@ export const leadToolDefinitions = [
2174
2186
  type: "string",
2175
2187
  description: "Campaign offer ID",
2176
2188
  },
2189
+ workspaceId: {
2190
+ type: "string",
2191
+ description: "Explicit request-scoped workspace id. Pass this instead of switching the shared active workspace.",
2192
+ },
2177
2193
  sourceLeadListId: {
2178
2194
  type: "string",
2179
2195
  description: "Lead list ID to import into campaign. If omitted, uses campaign.selectedLeadListId.",
@@ -3118,6 +3134,8 @@ export async function searchProspeo(input) {
3118
3134
  campaignOfferId: input?.campaignOfferId,
3119
3135
  });
3120
3136
  const api = getApi();
3137
+ const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
3138
+ const requestOptions = workspaceRequestOptions(workspaceId);
3121
3139
  const rawInput = input;
3122
3140
  if ("domains" in rawInput) {
3123
3141
  throw new Error("search_prospeo does not accept raw domains. Use load_csv_domains or save_domain_filters for known domain lists. For generated company/account lookalikes, use search_prospeo_companies, then confirm_prospeo_company_accounts, then pass the returned domainFilterId.");
@@ -3128,9 +3146,11 @@ export async function searchProspeo(input) {
3128
3146
  nestedCompany?.names !== undefined) {
3129
3147
  throw new Error("search_prospeo does not accept filters.company.websites or filters.company.names. For known accounts, resolve names/domains into a domainFilterId with load_csv_domains or save_domain_filters. For company/account lookalikes, use search_prospeo_companies first, then confirm_prospeo_company_accounts.");
3130
3148
  }
3131
- const safeInput = normalizeProspeoSearchInputForMcp(input);
3149
+ const { workspaceId: _workspaceId, ...safeInput } = normalizeProspeoSearchInputForMcp(input);
3132
3150
  try {
3133
- const response = await api.post(`/api/v3/prospeo/search`, safeInput);
3151
+ const response = requestOptions
3152
+ ? await api.post(`/api/v3/prospeo/search`, safeInput, requestOptions)
3153
+ : await api.post(`/api/v3/prospeo/search`, safeInput);
3134
3154
  return compactProspeoSearchResponse(response);
3135
3155
  }
3136
3156
  catch (error) {
@@ -3138,7 +3158,9 @@ export async function searchProspeo(input) {
3138
3158
  if (!fallbackInput) {
3139
3159
  throw error;
3140
3160
  }
3141
- const fallbackResponse = await api.post(`/api/v3/prospeo/search`, fallbackInput);
3161
+ const fallbackResponse = requestOptions
3162
+ ? await api.post(`/api/v3/prospeo/search`, fallbackInput, requestOptions)
3163
+ : await api.post(`/api/v3/prospeo/search`, fallbackInput);
3142
3164
  const keyword = String(fallbackInput.filters.person_name_or_job_title ?? "title keyword");
3143
3165
  return compactProspeoSearchResponse(fallbackResponse, {
3144
3166
  warnings: [
@@ -3673,6 +3695,15 @@ export async function searchSignals(input) {
3673
3695
  }
3674
3696
  export async function importLeads(input) {
3675
3697
  const api = getApi();
3698
+ const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
3699
+ const requestOptions = workspaceRequestOptions(workspaceId);
3700
+ const apiGet = (path) => requestOptions ? api.get(path, requestOptions) : api.get(path);
3701
+ const apiPost = (path, body) => requestOptions
3702
+ ? api.post(path, body, requestOptions)
3703
+ : api.post(path, body);
3704
+ const apiPut = (path, body) => requestOptions
3705
+ ? api.put(path, body, requestOptions)
3706
+ : api.put(path, body);
3676
3707
  const { campaignOfferId, currentStep, sourceLeadListId: inputSourceLeadListId, searchId, targetLeadCount, mode, searchName, leadListName, headlineICPCriteria, targetEngagerCount, maxPostsToScrape, allowInvalidSignalPosts, rubricGuidelines, confirmed, } = input;
3677
3708
  assertInteractionApproval({
3678
3709
  campaignId: campaignOfferId,
@@ -3685,9 +3716,12 @@ export async function importLeads(input) {
3685
3716
  let provider = input.provider;
3686
3717
  let campaignCurrentStep;
3687
3718
  let campaignSelectedLeadListId;
3688
- if (!provider || currentStep === undefined || mode === undefined) {
3719
+ if (!provider ||
3720
+ currentStep === undefined ||
3721
+ mode === undefined ||
3722
+ Boolean(inputSourceLeadListId)) {
3689
3723
  // Pull campaign once when we need provider or to determine default step behavior.
3690
- const campaign = await api.get(`/api/v2/campaign-offers/${campaignOfferId}`);
3724
+ const campaign = await apiGet(`/api/v2/campaign-offers/${campaignOfferId}`);
3691
3725
  if (!provider) {
3692
3726
  provider = normalizeImportProvider(campaign.leadSourceProvider);
3693
3727
  }
@@ -3809,7 +3843,7 @@ export async function importLeads(input) {
3809
3843
  const effectiveTargetEngagerCount = normalizePositiveInteger(targetEngagerCount) ?? null;
3810
3844
  // Get selected posts from the campaign's signal search tabs
3811
3845
  // Note: API returns flat fields (postUrl, postContent, authorName, etc.)
3812
- const tabsResponse = await api.get(`/api/v3/campaigns/${campaignOfferId}/signal-discovery/tabs`);
3846
+ const tabsResponse = await apiGet(`/api/v3/campaigns/${campaignOfferId}/signal-discovery/tabs`);
3813
3847
  // Collect all selected posts, mapping from API format to signal-leads/create format
3814
3848
  const selectedPosts = [];
3815
3849
  for (const tab of tabsResponse.tabs || []) {
@@ -3935,7 +3969,7 @@ export async function importLeads(input) {
3935
3969
  ? headlineICPCriteria
3936
3970
  : rubricGuidelines;
3937
3971
  // Start the scrape job
3938
- const result = await api.post(`/api/v3/campaigns/${campaignOfferId}/signal-leads/create`, {
3972
+ const result = await apiPost(`/api/v3/campaigns/${campaignOfferId}/signal-leads/create`, {
3939
3973
  posts: postsToScrape,
3940
3974
  targetEngagerCount: importSelection.targetEngagerCount ?? undefined,
3941
3975
  ...(effectiveHeadlineICPCriteria &&
@@ -3948,7 +3982,7 @@ export async function importLeads(input) {
3948
3982
  });
3949
3983
  // CRITICAL: Update selectedLeadListId so UI subscribes to correct table
3950
3984
  // This enables realtime updates in LeadListCanvas
3951
- await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
3985
+ await apiPut(`/api/v2/campaign-offers/${campaignOfferId}`, {
3952
3986
  selectedLeadListId: result.tableId,
3953
3987
  ...(shouldSetCurrentStep ? { currentStep: postImportCurrentStep } : {}),
3954
3988
  ...(shouldSetCurrentStep
@@ -3992,7 +4026,7 @@ export async function importLeads(input) {
3992
4026
  const fallbackName = leadListName ||
3993
4027
  (searchName ? `${providerLabel} - ${searchName}` : undefined) ||
3994
4028
  `${providerLabel} Import ${new Date().toISOString().slice(0, 10)}`;
3995
- const createResult = await api.post(`/api/v3/lead-lists`, {
4029
+ const createResult = await apiPost(`/api/v3/lead-lists`, {
3996
4030
  name: fallbackName,
3997
4031
  templateType: "lead_list",
3998
4032
  });
@@ -4009,7 +4043,7 @@ export async function importLeads(input) {
4009
4043
  const startImport = async () => {
4010
4044
  if (provider === "sales-nav") {
4011
4045
  // Sales Nav export flow
4012
- return api.post(`/api/v3/sales-nav/export`, {
4046
+ return apiPost(`/api/v3/sales-nav/export`, {
4013
4047
  searchId,
4014
4048
  workflowTableId: leadListId,
4015
4049
  campaignOfferId,
@@ -4018,7 +4052,7 @@ export async function importLeads(input) {
4018
4052
  });
4019
4053
  }
4020
4054
  if (provider === "prospeo") {
4021
- return api.post(`/api/v3/lead-lists/${leadListId}/prospeo-import/start`, {
4055
+ return apiPost(`/api/v3/lead-lists/${leadListId}/prospeo-import/start`, {
4022
4056
  searchId,
4023
4057
  campaignOfferId,
4024
4058
  targetLeadCount: cappedTargetLeadCount ?? defaultProviderSourceListTarget,
@@ -4069,24 +4103,30 @@ export async function importLeads(input) {
4069
4103
  throw error;
4070
4104
  }
4071
4105
  }
4072
- // Update selectedLeadListId so UI subscribes to the source lead list
4073
- // This enables realtime updates while the import job runs.
4074
- await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
4075
- selectedLeadListId: leadListId,
4076
- ...(shouldSetCurrentStep ? { currentStep: effectiveCurrentStep } : {}),
4077
- ...(shouldSetCurrentStep
4078
- ? {
4079
- watchNarration: buildSourceImportWatchNarration({
4080
- provider,
4081
- targetLeadCount: cappedTargetLeadCount ?? null,
4082
- }),
4083
- }
4084
- : {}),
4085
- });
4106
+ const selectedLeadListAlreadyCurrent = campaignSelectedLeadListId === leadListId;
4107
+ const shouldUpdateSelectedLeadList = !selectedLeadListAlreadyCurrent || shouldSetCurrentStep;
4108
+ if (shouldUpdateSelectedLeadList) {
4109
+ // Update selectedLeadListId so UI subscribes to the source lead list.
4110
+ // For refill same-source continuations with currentStep:null this is often
4111
+ // already true, so avoid a redundant campaign write.
4112
+ await apiPut(`/api/v2/campaign-offers/${campaignOfferId}`, {
4113
+ selectedLeadListId: leadListId,
4114
+ ...(shouldSetCurrentStep ? { currentStep: effectiveCurrentStep } : {}),
4115
+ ...(shouldSetCurrentStep
4116
+ ? {
4117
+ watchNarration: buildSourceImportWatchNarration({
4118
+ provider,
4119
+ targetLeadCount: cappedTargetLeadCount ?? null,
4120
+ }),
4121
+ }
4122
+ : {}),
4123
+ });
4124
+ }
4086
4125
  return {
4087
4126
  provider,
4088
4127
  leadListId,
4089
4128
  createdLeadList,
4129
+ selectedLeadListIdUpdated: shouldUpdateSelectedLeadList,
4090
4130
  jobResult,
4091
4131
  jobId,
4092
4132
  targetLeadCount: cappedTargetLeadCount ?? null,
@@ -4106,13 +4146,17 @@ export async function cancelLeadImport(input) {
4106
4146
  throw new Error(`cancel_lead_import: provider must be 'apollo', 'prospeo', or 'sales-nav' (got '${input.provider}'). Signal Discovery is not supported.`);
4107
4147
  }
4108
4148
  const api = getApi();
4149
+ const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
4150
+ const requestOptions = workspaceRequestOptions(workspaceId);
4109
4151
  const path = input.provider === "apollo"
4110
4152
  ? `/api/v3/lead-lists/${input.tableId}/apollo-import/cancel`
4111
4153
  : input.provider === "sales-nav"
4112
4154
  ? `/api/v3/lead-lists/${input.tableId}/sales-nav-import/cancel`
4113
4155
  : `/api/v3/lead-lists/${input.tableId}/prospeo-import/cancel`;
4114
4156
  try {
4115
- const result = await api.post(path, {});
4157
+ const result = await (requestOptions
4158
+ ? api.post(path, {}, requestOptions)
4159
+ : api.post(path, {}));
4116
4160
  return {
4117
4161
  cancelled: true,
4118
4162
  provider: input.provider,
@@ -4147,7 +4191,7 @@ export async function confirmLeadList(input) {
4147
4191
  });
4148
4192
  let resolvedLeadListId = sourceLeadListId;
4149
4193
  let resolvedProvider;
4150
- if (!resolvedLeadListId || currentStep === undefined || !resolvedProvider) {
4194
+ if (!resolvedLeadListId || currentStep === undefined) {
4151
4195
  const campaign = requestOptions
4152
4196
  ? await api.get(`/api/v2/campaign-offers/${campaignOfferId}`, requestOptions)
4153
4197
  : await api.get(`/api/v2/campaign-offers/${campaignOfferId}`);
@@ -4202,6 +4246,9 @@ export async function confirmLeadList(input) {
4202
4246
  ? await api.get(`/api/v3/workflow-tables/${resolvedLeadListId}?mode=meta`, requestOptions)
4203
4247
  : await api.get(`/api/v3/workflow-tables/${resolvedLeadListId}?mode=meta`);
4204
4248
  const leadListConfig = leadListMeta.table?.config ?? null;
4249
+ if (!resolvedProvider) {
4250
+ resolvedProvider = normalizeImportProvider(leadListConfig?.importProvider);
4251
+ }
4205
4252
  const leadListRowCount = leadListMeta.rowCount ?? 0;
4206
4253
  const importProgress = leadListConfig?.importProgress ?? null;
4207
4254
  const signalSourceTargetLeadCount = resolvedProvider === "signal-discovery" &&
@@ -4431,12 +4478,16 @@ export async function confirmLeadList(input) {
4431
4478
  .filter((cellId) => typeof cellId === "string");
4432
4479
  let recordedReviewBatch = null;
4433
4480
  if (campaignTableId && reviewBatchRowIds.length > 0) {
4434
- const recordResult = await api.post("/api/v3/mcp/campaign-processing", {
4481
+ const recordBody = {
4435
4482
  action: "recordReviewBatch",
4436
4483
  tableId: campaignTableId,
4437
4484
  rowIds: reviewBatchRowIds,
4438
4485
  enrichCellIds: reviewBatchEnrichCellIds,
4439
- });
4486
+ ...(workspaceId ? { workspaceId } : {}),
4487
+ };
4488
+ const recordResult = await (requestOptions
4489
+ ? api.post("/api/v3/mcp/campaign-processing", recordBody, requestOptions)
4490
+ : api.post("/api/v3/mcp/campaign-processing", recordBody));
4440
4491
  recordedReviewBatch = recordResult.reviewBatch ?? null;
4441
4492
  }
4442
4493
  const compactReviewBatch = {
@@ -4474,7 +4525,7 @@ export async function confirmLeadList(input) {
4474
4525
  // campaign table id makes that endpoint 404 with "Lead list not found"
4475
4526
  // and silently breaks the Leads → Filter Continue button.
4476
4527
  if (shouldSetCurrentStep) {
4477
- await api.put(`/api/v2/campaign-offers/${campaignOfferId}`, {
4528
+ const updateBody = {
4478
4529
  currentStep: effectiveCurrentStep,
4479
4530
  ...(effectiveCurrentStep === "filter-choice"
4480
4531
  ? {
@@ -4485,7 +4536,11 @@ export async function confirmLeadList(input) {
4485
4536
  }),
4486
4537
  }
4487
4538
  : {}),
4488
- });
4539
+ ...(workspaceId ? { workspaceId } : {}),
4540
+ };
4541
+ await (requestOptions
4542
+ ? api.put(`/api/v2/campaign-offers/${campaignOfferId}`, updateBody, requestOptions)
4543
+ : api.put(`/api/v2/campaign-offers/${campaignOfferId}`, updateBody));
4489
4544
  }
4490
4545
  return {
4491
4546
  sourceLeadListId: resolvedLeadListId,
@@ -137,7 +137,7 @@ export interface PostFindLeadsScoutRegistryResponse {
137
137
  }
138
138
  export declare const DEFAULT_SUBSKILL_PROMPT_CHUNK_CHARS = 48000;
139
139
  export declare const MAX_SUBSKILL_PROMPT_CHUNK_CHARS = 48000;
140
- export declare const ALLOWED_SUBSKILL_PROMPT_NAMES: readonly ["building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
140
+ export declare const ALLOWED_SUBSKILL_PROMPT_NAMES: readonly ["building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
141
141
  export declare const promptToolDefinitions: ({
142
142
  name: string;
143
143
  description: string;
@@ -181,7 +181,7 @@ export declare const promptToolDefinitions: ({
181
181
  properties: {
182
182
  subskillName: {
183
183
  type: string;
184
- enum: readonly ["building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
184
+ enum: readonly ["building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
185
185
  description: string;
186
186
  };
187
187
  offset: {
@@ -216,7 +216,7 @@ export declare const promptToolDefinitions: ({
216
216
  properties: {
217
217
  subskillName: {
218
218
  type: string;
219
- enum: readonly ["building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
219
+ enum: readonly ["building-gtm-tables", "content", "create-ab-test", "create-campaign", "create-campaign-brief", "create-campaign-v2", "create-campaign-v2-tail", "create-campaign-v2-validation", "create-evergreen-campaigns", "create-post", "create-rubric", "engage", "enrich-prospects", "fill-send-horizon", "find-leads", "foundation", "generate-messages", "interview", "load-voice", "refresh-sender-engagement", "refill-sends", "refill-sends-evergreen", "refill-sends-evergreen-workflow", "refill-sends-workflow", "research", "research-prospect", "research-sender", "weekly-campaign-summary", "workflow-sequences"];
220
220
  description: string;
221
221
  };
222
222
  assetPath: {
@@ -38,6 +38,8 @@ export const ALLOWED_SUBSKILL_PROMPT_NAMES = [
38
38
  "load-voice",
39
39
  "refresh-sender-engagement",
40
40
  "refill-sends",
41
+ "refill-sends-evergreen",
42
+ "refill-sends-evergreen-workflow",
41
43
  "refill-sends-workflow",
42
44
  "research",
43
45
  "research-prospect",
@@ -0,0 +1,28 @@
1
+ type RefillSendsEvergreenInput = {
2
+ workspaceId?: string;
3
+ };
4
+ export declare const refillSendsEvergreenToolDefinitions: {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: string;
9
+ properties: {
10
+ workspaceId: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ };
15
+ required: string[];
16
+ additionalProperties: boolean;
17
+ };
18
+ }[];
19
+ export declare function refillSendsEvergreenCommand(input: RefillSendsEvergreenInput): {
20
+ readOnly: boolean;
21
+ workspaceId: string | null;
22
+ firstOperationalSteps: string[];
23
+ approvalContract: string;
24
+ forbiddenActions: string[];
25
+ fillWindow: string;
26
+ hostExamples: string[];
27
+ };
28
+ export {};
@@ -0,0 +1,47 @@
1
+ export const refillSendsEvergreenToolDefinitions = [
2
+ {
3
+ name: "refill_sends_evergreen",
4
+ description: "Read-only Phase 85 evergreen refill command contract. It performs no mutations and only tells the operator to call get_evergreen_refill_plan for a dry-run packet and journal.",
5
+ inputSchema: {
6
+ type: "object",
7
+ properties: {
8
+ workspaceId: {
9
+ type: "string",
10
+ description: "Explicit request-scoped workspace id.",
11
+ },
12
+ },
13
+ required: ["workspaceId"],
14
+ additionalProperties: false,
15
+ },
16
+ },
17
+ ];
18
+ export function refillSendsEvergreenCommand(input) {
19
+ return {
20
+ readOnly: true,
21
+ workspaceId: input.workspaceId ?? null,
22
+ firstOperationalSteps: [
23
+ "Call get_evergreen_refill_plan with the explicit workspaceId.",
24
+ "Read the returned packet, globalActionQueue, per-sender plans, and itinerary before taking any action.",
25
+ "Review the dry-run journal file path returned by get_evergreen_refill_plan.",
26
+ "Phase 85 is PLAN-ONLY; execution arrives in Phase 86.",
27
+ ],
28
+ approvalContract: "Nothing is approved or executable in Phase 85. The evergreen command is read-only; Phase 86 introduces execution approval.",
29
+ forbiddenActions: [
30
+ "Do not schedule sends.",
31
+ "Do not send messages.",
32
+ "Do not approve messages.",
33
+ "Do not prepare messages.",
34
+ "Do not start or launch campaigns.",
35
+ "Do not create campaigns.",
36
+ "Do not switch providers or source families.",
37
+ "Do not lower paid InMail thresholds.",
38
+ "Do not refresh paid InMail credits.",
39
+ "Do not write scheduler fields.",
40
+ ],
41
+ fillWindow: "Use only the target window and caps returned by get_evergreen_refill_plan.",
42
+ hostExamples: [
43
+ "refill_sends_evergreen({ workspaceId })",
44
+ "get_evergreen_refill_plan({ workspaceId })",
45
+ ],
46
+ };
47
+ }