@sellable/mcp 0.1.516 → 0.1.517
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 +1 -0
- package/dist/tools/leads.js +15 -4
- package/package.json +1 -1
package/dist/tools/leads.d.ts
CHANGED
package/dist/tools/leads.js
CHANGED
|
@@ -3655,6 +3655,17 @@ export async function searchSignals(input) {
|
|
|
3655
3655
|
campaignOfferId: input?.campaignOfferId,
|
|
3656
3656
|
});
|
|
3657
3657
|
const api = getApi();
|
|
3658
|
+
const workspaceId = normalizeExplicitWorkspaceId(input.workspaceId);
|
|
3659
|
+
const requestOptions = workspaceRequestOptions(workspaceId);
|
|
3660
|
+
const apiPut = (path, body) => requestOptions
|
|
3661
|
+
? api.put(path, body, requestOptions)
|
|
3662
|
+
: api.put(path, body);
|
|
3663
|
+
const apiPatch = (path, body) => requestOptions
|
|
3664
|
+
? api.patch(path, body, requestOptions)
|
|
3665
|
+
: api.patch(path, body);
|
|
3666
|
+
const apiPost = (path, body) => requestOptions
|
|
3667
|
+
? api.post(path, body, requestOptions)
|
|
3668
|
+
: api.post(path, body);
|
|
3658
3669
|
const { campaignOfferId, headlineICPCriteria, rubricGuidelines, currentStepTransition, } = input;
|
|
3659
3670
|
const searchRequest = { ...input };
|
|
3660
3671
|
delete searchRequest.currentStepTransition;
|
|
@@ -3665,7 +3676,7 @@ export async function searchSignals(input) {
|
|
|
3665
3676
|
? headlineICPCriteria
|
|
3666
3677
|
: rubricGuidelines;
|
|
3667
3678
|
if (campaignOfferId && searchCurrentStep) {
|
|
3668
|
-
await
|
|
3679
|
+
await apiPut(`/api/v2/campaign-offers/${campaignOfferId}`, {
|
|
3669
3680
|
leadSourceType: "new",
|
|
3670
3681
|
leadSourceProvider: "signal-discovery",
|
|
3671
3682
|
currentStep: searchCurrentStep,
|
|
@@ -3675,17 +3686,17 @@ export async function searchSignals(input) {
|
|
|
3675
3686
|
}
|
|
3676
3687
|
// Persist criteria early so user take-over has filters ready.
|
|
3677
3688
|
if (campaignOfferId && effectiveHeadlineICPCriteria?.length) {
|
|
3678
|
-
await
|
|
3689
|
+
await apiPatch(`/api/v3/campaigns/${campaignOfferId}/signal-discovery/posts`, {
|
|
3679
3690
|
selectedIds: [],
|
|
3680
3691
|
unselectedIds: [],
|
|
3681
3692
|
headlineICPCriteria: effectiveHeadlineICPCriteria,
|
|
3682
3693
|
rubricGuidelines: effectiveHeadlineICPCriteria,
|
|
3683
3694
|
});
|
|
3684
3695
|
}
|
|
3685
|
-
const response = await
|
|
3696
|
+
const response = await apiPost(`/api/v1/signal-discovery/search-signals`, searchRequest);
|
|
3686
3697
|
const summary = summarizeSignalSearchResponse(response);
|
|
3687
3698
|
if (campaignOfferId && searchCurrentStep) {
|
|
3688
|
-
await
|
|
3699
|
+
await apiPut(`/api/v2/campaign-offers/${campaignOfferId}`, {
|
|
3689
3700
|
currentStep: searchCurrentStep,
|
|
3690
3701
|
...(currentStepTransition ? { currentStepTransition } : {}),
|
|
3691
3702
|
watchNarration: buildSignalDiscoveryResultsWatchNarration(summary.postsReturned),
|