gtm-now 0.6.0 → 0.7.1
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/index.js +179 -87
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -928,61 +928,10 @@ var init_leadmagic = __esm({
|
|
|
928
928
|
});
|
|
929
929
|
|
|
930
930
|
// ../integrations/dist/enrichment/adapters/prospeo.js
|
|
931
|
-
var ProspeoAdapter;
|
|
932
931
|
var init_prospeo = __esm({
|
|
933
932
|
"../integrations/dist/enrichment/adapters/prospeo.js"() {
|
|
934
933
|
"use strict";
|
|
935
934
|
init_dist();
|
|
936
|
-
ProspeoAdapter = class {
|
|
937
|
-
name = "prospeo";
|
|
938
|
-
apiKey;
|
|
939
|
-
constructor(apiKey) {
|
|
940
|
-
this.apiKey = apiKey;
|
|
941
|
-
}
|
|
942
|
-
isConfigured() {
|
|
943
|
-
return this.apiKey.length > 0;
|
|
944
|
-
}
|
|
945
|
-
async findEmail(params) {
|
|
946
|
-
const domain = params.domain ?? `${params.company.toLowerCase().replace(/[^a-z0-9]/g, "")}.com`;
|
|
947
|
-
if (!params.firstName || !params.lastName || !domain)
|
|
948
|
-
return null;
|
|
949
|
-
const controller = new AbortController();
|
|
950
|
-
const timeout = setTimeout(() => controller.abort(), 15e3);
|
|
951
|
-
try {
|
|
952
|
-
const res = await fetch("https://api.prospeo.io/enrich-person", {
|
|
953
|
-
method: "POST",
|
|
954
|
-
headers: {
|
|
955
|
-
"Content-Type": "application/json",
|
|
956
|
-
"X-KEY": this.apiKey
|
|
957
|
-
},
|
|
958
|
-
body: JSON.stringify({
|
|
959
|
-
only_verified_email: true,
|
|
960
|
-
data: {
|
|
961
|
-
first_name: params.firstName,
|
|
962
|
-
last_name: params.lastName,
|
|
963
|
-
company_website: domain,
|
|
964
|
-
...params.linkedinUrl ? { linkedin_url: params.linkedinUrl } : {}
|
|
965
|
-
}
|
|
966
|
-
}),
|
|
967
|
-
signal: controller.signal
|
|
968
|
-
});
|
|
969
|
-
if (!res.ok) {
|
|
970
|
-
logError("Prospeo:findEmail", new Error(`HTTP ${res.status}`), { domain });
|
|
971
|
-
return null;
|
|
972
|
-
}
|
|
973
|
-
const data = await res.json();
|
|
974
|
-
if (data.error || !data.person?.email?.email)
|
|
975
|
-
return null;
|
|
976
|
-
return {
|
|
977
|
-
email: data.person.email.email,
|
|
978
|
-
confidence: data.person.email.status === "verified" ? 95 : 70,
|
|
979
|
-
provider: "prospeo"
|
|
980
|
-
};
|
|
981
|
-
} finally {
|
|
982
|
-
clearTimeout(timeout);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
};
|
|
986
935
|
}
|
|
987
936
|
});
|
|
988
937
|
|
|
@@ -8098,9 +8047,59 @@ var init_client11 = __esm({
|
|
|
8098
8047
|
}
|
|
8099
8048
|
});
|
|
8100
8049
|
|
|
8050
|
+
// ../integrations/dist/prospeo/client.js
|
|
8051
|
+
var ProspeoClient;
|
|
8052
|
+
var init_client12 = __esm({
|
|
8053
|
+
"../integrations/dist/prospeo/client.js"() {
|
|
8054
|
+
"use strict";
|
|
8055
|
+
init_base_client();
|
|
8056
|
+
ProspeoClient = class extends BaseApiClient {
|
|
8057
|
+
constructor(config) {
|
|
8058
|
+
super({
|
|
8059
|
+
name: "Prospeo",
|
|
8060
|
+
baseUrl: config.baseUrl ?? "https://api.prospeo.io",
|
|
8061
|
+
headers: { "X-KEY": config.apiKey },
|
|
8062
|
+
timeoutMs: config.timeoutMs
|
|
8063
|
+
});
|
|
8064
|
+
}
|
|
8065
|
+
// ─── People Search ──────────────────────────────────────
|
|
8066
|
+
async searchPeople(query) {
|
|
8067
|
+
return this.request("/search-person", {
|
|
8068
|
+
method: "POST",
|
|
8069
|
+
body: JSON.stringify({
|
|
8070
|
+
page: query.page ?? 1,
|
|
8071
|
+
filters: query.filters
|
|
8072
|
+
})
|
|
8073
|
+
});
|
|
8074
|
+
}
|
|
8075
|
+
// ─── Person Enrichment ──────────────────────────────────
|
|
8076
|
+
async enrichPerson(params) {
|
|
8077
|
+
return this.request("/enrich-person", {
|
|
8078
|
+
method: "POST",
|
|
8079
|
+
body: JSON.stringify({
|
|
8080
|
+
only_verified_email: true,
|
|
8081
|
+
data: {
|
|
8082
|
+
first_name: params.first_name,
|
|
8083
|
+
last_name: params.last_name,
|
|
8084
|
+
...params.company_website && { company_website: params.company_website },
|
|
8085
|
+
...params.linkedin_url && { linkedin_url: params.linkedin_url }
|
|
8086
|
+
}
|
|
8087
|
+
})
|
|
8088
|
+
});
|
|
8089
|
+
}
|
|
8090
|
+
// ─── Account Info ───────────────────────────────────────
|
|
8091
|
+
async getAccountInfo() {
|
|
8092
|
+
return this.request("/account-information", {
|
|
8093
|
+
method: "GET"
|
|
8094
|
+
});
|
|
8095
|
+
}
|
|
8096
|
+
};
|
|
8097
|
+
}
|
|
8098
|
+
});
|
|
8099
|
+
|
|
8101
8100
|
// ../integrations/dist/disco/client.js
|
|
8102
8101
|
var DiscoClient;
|
|
8103
|
-
var
|
|
8102
|
+
var init_client13 = __esm({
|
|
8104
8103
|
"../integrations/dist/disco/client.js"() {
|
|
8105
8104
|
"use strict";
|
|
8106
8105
|
init_base_client();
|
|
@@ -8257,7 +8256,7 @@ var init_client12 = __esm({
|
|
|
8257
8256
|
|
|
8258
8257
|
// ../integrations/dist/apollo/client.js
|
|
8259
8258
|
var ApolloClient;
|
|
8260
|
-
var
|
|
8259
|
+
var init_client14 = __esm({
|
|
8261
8260
|
"../integrations/dist/apollo/client.js"() {
|
|
8262
8261
|
"use strict";
|
|
8263
8262
|
init_base_client();
|
|
@@ -8328,7 +8327,7 @@ var init_client13 = __esm({
|
|
|
8328
8327
|
|
|
8329
8328
|
// ../integrations/dist/smartlead/client.js
|
|
8330
8329
|
var MAX_LEADS_PER_REQUEST2, SmartLeadClient;
|
|
8331
|
-
var
|
|
8330
|
+
var init_client15 = __esm({
|
|
8332
8331
|
"../integrations/dist/smartlead/client.js"() {
|
|
8333
8332
|
"use strict";
|
|
8334
8333
|
init_base_client();
|
|
@@ -8395,7 +8394,7 @@ var init_client14 = __esm({
|
|
|
8395
8394
|
});
|
|
8396
8395
|
|
|
8397
8396
|
// ../integrations/dist/slack/client.js
|
|
8398
|
-
var
|
|
8397
|
+
var init_client16 = __esm({
|
|
8399
8398
|
"../integrations/dist/slack/client.js"() {
|
|
8400
8399
|
"use strict";
|
|
8401
8400
|
init_base_client();
|
|
@@ -8403,7 +8402,7 @@ var init_client15 = __esm({
|
|
|
8403
8402
|
});
|
|
8404
8403
|
|
|
8405
8404
|
// ../integrations/dist/calcom/client.js
|
|
8406
|
-
var
|
|
8405
|
+
var init_client17 = __esm({
|
|
8407
8406
|
"../integrations/dist/calcom/client.js"() {
|
|
8408
8407
|
"use strict";
|
|
8409
8408
|
init_base_client();
|
|
@@ -8411,7 +8410,7 @@ var init_client16 = __esm({
|
|
|
8411
8410
|
});
|
|
8412
8411
|
|
|
8413
8412
|
// ../integrations/dist/gemini/client.js
|
|
8414
|
-
var
|
|
8413
|
+
var init_client18 = __esm({
|
|
8415
8414
|
"../integrations/dist/gemini/client.js"() {
|
|
8416
8415
|
"use strict";
|
|
8417
8416
|
init_base_client();
|
|
@@ -8419,7 +8418,7 @@ var init_client17 = __esm({
|
|
|
8419
8418
|
});
|
|
8420
8419
|
|
|
8421
8420
|
// ../integrations/dist/unipile/client.js
|
|
8422
|
-
var
|
|
8421
|
+
var init_client19 = __esm({
|
|
8423
8422
|
"../integrations/dist/unipile/client.js"() {
|
|
8424
8423
|
"use strict";
|
|
8425
8424
|
init_base_client();
|
|
@@ -8427,7 +8426,7 @@ var init_client18 = __esm({
|
|
|
8427
8426
|
});
|
|
8428
8427
|
|
|
8429
8428
|
// ../integrations/dist/twilio/client.js
|
|
8430
|
-
var
|
|
8429
|
+
var init_client20 = __esm({
|
|
8431
8430
|
"../integrations/dist/twilio/client.js"() {
|
|
8432
8431
|
"use strict";
|
|
8433
8432
|
init_dist();
|
|
@@ -8436,7 +8435,7 @@ var init_client19 = __esm({
|
|
|
8436
8435
|
});
|
|
8437
8436
|
|
|
8438
8437
|
// ../integrations/dist/linear/client.js
|
|
8439
|
-
var
|
|
8438
|
+
var init_client21 = __esm({
|
|
8440
8439
|
"../integrations/dist/linear/client.js"() {
|
|
8441
8440
|
"use strict";
|
|
8442
8441
|
init_base_client();
|
|
@@ -8444,7 +8443,7 @@ var init_client20 = __esm({
|
|
|
8444
8443
|
});
|
|
8445
8444
|
|
|
8446
8445
|
// ../integrations/dist/zapmail/client.js
|
|
8447
|
-
var
|
|
8446
|
+
var init_client22 = __esm({
|
|
8448
8447
|
"../integrations/dist/zapmail/client.js"() {
|
|
8449
8448
|
"use strict";
|
|
8450
8449
|
init_base_client();
|
|
@@ -8469,7 +8468,7 @@ var init_factory = __esm({
|
|
|
8469
8468
|
|
|
8470
8469
|
// ../integrations/dist/harvest/client.js
|
|
8471
8470
|
var HarvestClient;
|
|
8472
|
-
var
|
|
8471
|
+
var init_client23 = __esm({
|
|
8473
8472
|
"../integrations/dist/harvest/client.js"() {
|
|
8474
8473
|
"use strict";
|
|
8475
8474
|
init_base_client();
|
|
@@ -8561,9 +8560,10 @@ var init_dist2 = __esm({
|
|
|
8561
8560
|
init_client19();
|
|
8562
8561
|
init_client20();
|
|
8563
8562
|
init_client21();
|
|
8563
|
+
init_client22();
|
|
8564
8564
|
init_parser();
|
|
8565
8565
|
init_factory();
|
|
8566
|
-
|
|
8566
|
+
init_client23();
|
|
8567
8567
|
}
|
|
8568
8568
|
});
|
|
8569
8569
|
|
|
@@ -9021,27 +9021,45 @@ var init_disco = __esm({
|
|
|
9021
9021
|
});
|
|
9022
9022
|
|
|
9023
9023
|
// src/providers/adapters/prospeo.ts
|
|
9024
|
-
|
|
9024
|
+
function mapSeniority2(values) {
|
|
9025
|
+
if (!values?.length) return void 0;
|
|
9026
|
+
const mapped = values.map((v) => SENIORITY_TO_PROSPEO[v] ?? v);
|
|
9027
|
+
return [...new Set(mapped)];
|
|
9028
|
+
}
|
|
9029
|
+
function mapHeadcountCustom(min, max) {
|
|
9030
|
+
if (min == null && max == null) return void 0;
|
|
9031
|
+
return { ...min != null && { min }, ...max != null && { max } };
|
|
9032
|
+
}
|
|
9033
|
+
var SENIORITY_TO_PROSPEO, ProspeoMcpAdapter;
|
|
9025
9034
|
var init_prospeo2 = __esm({
|
|
9026
9035
|
"src/providers/adapters/prospeo.ts"() {
|
|
9027
9036
|
"use strict";
|
|
9028
9037
|
init_dist();
|
|
9029
9038
|
init_dist2();
|
|
9039
|
+
SENIORITY_TO_PROSPEO = {
|
|
9040
|
+
c_suite: "C-Suite",
|
|
9041
|
+
founder: "C-Suite",
|
|
9042
|
+
owner: "C-Suite",
|
|
9043
|
+
partner: "C-Suite",
|
|
9044
|
+
vp: "VP",
|
|
9045
|
+
head: "Director",
|
|
9046
|
+
director: "Director",
|
|
9047
|
+
manager: "Manager",
|
|
9048
|
+
senior: "Senior",
|
|
9049
|
+
entry: "Entry",
|
|
9050
|
+
intern: "Entry"
|
|
9051
|
+
};
|
|
9030
9052
|
ProspeoMcpAdapter = class {
|
|
9031
9053
|
name = "prospeo";
|
|
9032
|
-
capabilities = ["enrich_email"];
|
|
9033
|
-
notes = "Best for:
|
|
9054
|
+
capabilities = ["find_people", "enrich_email"];
|
|
9055
|
+
notes = "Best for: city-level people search with industry/seniority/department/headcount filters, email enrichment, company technology detection, funding data. 200M+ contacts.";
|
|
9034
9056
|
client;
|
|
9035
9057
|
constructor(apiKey) {
|
|
9036
|
-
this.client = new
|
|
9058
|
+
this.client = new ProspeoClient({ apiKey });
|
|
9037
9059
|
}
|
|
9038
9060
|
async checkCredentials() {
|
|
9039
9061
|
try {
|
|
9040
|
-
await this.client.
|
|
9041
|
-
firstName: "test",
|
|
9042
|
-
lastName: "test",
|
|
9043
|
-
company: "test.invalid"
|
|
9044
|
-
});
|
|
9062
|
+
await this.client.getAccountInfo();
|
|
9045
9063
|
return true;
|
|
9046
9064
|
} catch (error) {
|
|
9047
9065
|
logError(
|
|
@@ -9051,20 +9069,69 @@ var init_prospeo2 = __esm({
|
|
|
9051
9069
|
return false;
|
|
9052
9070
|
}
|
|
9053
9071
|
}
|
|
9072
|
+
async checkCredits() {
|
|
9073
|
+
try {
|
|
9074
|
+
const info = await this.client.getAccountInfo();
|
|
9075
|
+
return { remaining: info.credits, unit: "credits", provider: this.name };
|
|
9076
|
+
} catch (error) {
|
|
9077
|
+
logError("prospeo:checkCredits", error instanceof Error ? error : new Error(String(error)));
|
|
9078
|
+
return null;
|
|
9079
|
+
}
|
|
9080
|
+
}
|
|
9081
|
+
// ─── PeopleFinder ────────────────────────────────────────
|
|
9082
|
+
async findPeople(query) {
|
|
9083
|
+
const filters = {};
|
|
9084
|
+
if (query.job_title) filters.person_job_title = query.job_title;
|
|
9085
|
+
if (query.seniority) filters.person_seniority = mapSeniority2(query.seniority);
|
|
9086
|
+
if (query.department?.length) filters.person_department = query.department[0];
|
|
9087
|
+
if (query.location) filters.person_location_search = query.location;
|
|
9088
|
+
if (query.company_domain) filters.company = query.company_domain;
|
|
9089
|
+
if (query.company_domains?.length) filters.company = query.company_domains[0];
|
|
9090
|
+
if (query.company_name) filters.company = query.company_name;
|
|
9091
|
+
if (query.filter_industry?.length) {
|
|
9092
|
+
filters.company_industry = { include: query.filter_industry };
|
|
9093
|
+
}
|
|
9094
|
+
if (query.min_employees != null || query.max_employees != null) {
|
|
9095
|
+
filters.company_headcount_custom = mapHeadcountCustom(
|
|
9096
|
+
query.min_employees,
|
|
9097
|
+
query.max_employees
|
|
9098
|
+
);
|
|
9099
|
+
}
|
|
9100
|
+
if (query.skills?.length) {
|
|
9101
|
+
filters.company_keywords = { include: query.skills };
|
|
9102
|
+
}
|
|
9103
|
+
const page = query.offset ? Math.floor(query.offset / (query.limit ?? 25)) + 1 : 1;
|
|
9104
|
+
const response = await this.client.searchPeople({ page, filters });
|
|
9105
|
+
if (response.error || !response.data?.length) return [];
|
|
9106
|
+
return response.data.map((r) => ({
|
|
9107
|
+
first_name: r.person?.first_name ?? "",
|
|
9108
|
+
last_name: r.person?.last_name ?? "",
|
|
9109
|
+
job_title: r.person?.job_title,
|
|
9110
|
+
company: r.company?.name,
|
|
9111
|
+
company_domain: r.company?.domain,
|
|
9112
|
+
email: r.person?.email,
|
|
9113
|
+
phone: r.person?.phone,
|
|
9114
|
+
linkedin_url: r.person?.linkedin_url,
|
|
9115
|
+
seniority: r.person?.seniority,
|
|
9116
|
+
department: r.person?.department,
|
|
9117
|
+
location: r.person?.location ?? r.company?.location,
|
|
9118
|
+
sources: [this.name]
|
|
9119
|
+
}));
|
|
9120
|
+
}
|
|
9054
9121
|
// ─── EmailEnricher ──────────────────────────────────────
|
|
9055
9122
|
async enrichEmail(contact) {
|
|
9056
9123
|
try {
|
|
9057
|
-
const
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9124
|
+
const domain = contact.company_domain ?? (contact.company ? `${contact.company.toLowerCase().replace(/[^a-z0-9]/g, "")}.com` : void 0);
|
|
9125
|
+
const response = await this.client.enrichPerson({
|
|
9126
|
+
first_name: contact.first_name,
|
|
9127
|
+
last_name: contact.last_name,
|
|
9128
|
+
company_website: domain,
|
|
9129
|
+
linkedin_url: contact.linkedin_url
|
|
9063
9130
|
});
|
|
9064
|
-
if (!
|
|
9131
|
+
if (response.error || !response.person?.email?.email) return null;
|
|
9065
9132
|
return {
|
|
9066
|
-
email:
|
|
9067
|
-
quality:
|
|
9133
|
+
email: response.person.email.email,
|
|
9134
|
+
quality: response.person.email.status === "verified" ? "95%" : "70%",
|
|
9068
9135
|
provider: this.name
|
|
9069
9136
|
};
|
|
9070
9137
|
} catch (error) {
|
|
@@ -9139,6 +9206,16 @@ var init_plusvibe = __esm({
|
|
|
9139
9206
|
provider: this.name
|
|
9140
9207
|
};
|
|
9141
9208
|
}
|
|
9209
|
+
// ─── Campaign Creation ───────────────────────────────────
|
|
9210
|
+
async createCampaign(name) {
|
|
9211
|
+
const campaign = await this.client.createCampaign({ camp_name: name });
|
|
9212
|
+
return {
|
|
9213
|
+
id: campaign.id,
|
|
9214
|
+
name: campaign.name,
|
|
9215
|
+
status: campaign.status,
|
|
9216
|
+
provider: this.name
|
|
9217
|
+
};
|
|
9218
|
+
}
|
|
9142
9219
|
};
|
|
9143
9220
|
}
|
|
9144
9221
|
});
|
|
@@ -10405,6 +10482,16 @@ async function handleCampaign(args, ctx) {
|
|
|
10405
10482
|
if (!leads?.length) throw new Error("leads array is required for add_leads action");
|
|
10406
10483
|
return manager.addLeadsToCampaign(campaignId, leads);
|
|
10407
10484
|
}
|
|
10485
|
+
case "create": {
|
|
10486
|
+
const name = args.name;
|
|
10487
|
+
if (!name) throw new Error("name is required for create action");
|
|
10488
|
+
if (!manager.createCampaign) {
|
|
10489
|
+
throw new Error(
|
|
10490
|
+
`Provider "${provider.name}" does not support campaign creation. Currently only PlusVibe supports this action.`
|
|
10491
|
+
);
|
|
10492
|
+
}
|
|
10493
|
+
return manager.createCampaign(name);
|
|
10494
|
+
}
|
|
10408
10495
|
default:
|
|
10409
10496
|
throw new Error(`Unknown campaign action: ${action}`);
|
|
10410
10497
|
}
|
|
@@ -11288,14 +11375,14 @@ var init_campaign2 = __esm({
|
|
|
11288
11375
|
campaignTools = [
|
|
11289
11376
|
{
|
|
11290
11377
|
name: "gtm_campaign",
|
|
11291
|
-
description: "Manage cold email campaigns. List campaigns, get stats,
|
|
11378
|
+
description: "Manage cold email campaigns. List campaigns, get stats, add leads, or create a new campaign. Supports PlusVibe, Instantly, and Smartlead providers.",
|
|
11292
11379
|
inputSchema: {
|
|
11293
11380
|
type: "object",
|
|
11294
11381
|
properties: {
|
|
11295
11382
|
action: {
|
|
11296
11383
|
type: "string",
|
|
11297
|
-
enum: ["list", "stats", "add_leads"],
|
|
11298
|
-
description: "Action to perform: list (all campaigns), stats (campaign metrics), add_leads (push contacts)"
|
|
11384
|
+
enum: ["list", "stats", "add_leads", "create"],
|
|
11385
|
+
description: "Action to perform: list (all campaigns), stats (campaign metrics), add_leads (push contacts), create (new campaign)"
|
|
11299
11386
|
},
|
|
11300
11387
|
campaign_id: {
|
|
11301
11388
|
type: "string",
|
|
@@ -11319,6 +11406,10 @@ var init_campaign2 = __esm({
|
|
|
11319
11406
|
},
|
|
11320
11407
|
description: "Leads to add (required for add_leads action)"
|
|
11321
11408
|
},
|
|
11409
|
+
name: {
|
|
11410
|
+
type: "string",
|
|
11411
|
+
description: "Campaign name (required for create action)"
|
|
11412
|
+
},
|
|
11322
11413
|
provider: {
|
|
11323
11414
|
type: "string",
|
|
11324
11415
|
description: "Provider override (uses first available campaign_email provider if omitted)"
|
|
@@ -12033,12 +12124,13 @@ var init_validation = __esm({
|
|
|
12033
12124
|
}),
|
|
12034
12125
|
// 8. Cold email campaign management
|
|
12035
12126
|
gtm_campaign: z2.object({
|
|
12036
|
-
action: z2.enum(["list", "stats", "add_leads"], {
|
|
12037
|
-
message: "action must be one of: list, stats, add_leads"
|
|
12127
|
+
action: z2.enum(["list", "stats", "add_leads", "create"], {
|
|
12128
|
+
message: "action must be one of: list, stats, add_leads, create"
|
|
12038
12129
|
}),
|
|
12039
12130
|
campaign_id: z2.string().optional(),
|
|
12040
12131
|
leads: z2.array(campaignLeadSchema).optional(),
|
|
12041
|
-
name: z2.string().optional()
|
|
12132
|
+
name: z2.string().optional(),
|
|
12133
|
+
provider: z2.string().optional()
|
|
12042
12134
|
}),
|
|
12043
12135
|
// 9. LinkedIn outreach management
|
|
12044
12136
|
gtm_outreach: z2.object({
|