gtm-now 0.6.0 → 0.7.0

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 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,70 @@ 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
+ query: {
8071
+ ...query.job_title?.length && { job_title: query.job_title },
8072
+ ...query.seniority?.length && { seniority: query.seniority },
8073
+ ...query.department?.length && { department: query.department },
8074
+ ...query.location?.length && { location: query.location },
8075
+ ...query.company_name && { company_name: query.company_name },
8076
+ ...query.company_domain && { company_domain: query.company_domain },
8077
+ ...query.industry?.length && { industry: query.industry },
8078
+ ...query.company_size?.length && { company_size: query.company_size },
8079
+ ...query.keywords?.length && { keywords: query.keywords }
8080
+ },
8081
+ limit: query.limit ?? 25,
8082
+ offset: query.offset ?? 0
8083
+ })
8084
+ });
8085
+ }
8086
+ // ─── Person Enrichment ──────────────────────────────────
8087
+ async enrichPerson(params) {
8088
+ return this.request("/enrich-person", {
8089
+ method: "POST",
8090
+ body: JSON.stringify({
8091
+ only_verified_email: true,
8092
+ data: {
8093
+ first_name: params.first_name,
8094
+ last_name: params.last_name,
8095
+ ...params.company_website && { company_website: params.company_website },
8096
+ ...params.linkedin_url && { linkedin_url: params.linkedin_url }
8097
+ }
8098
+ })
8099
+ });
8100
+ }
8101
+ // ─── Account Info ───────────────────────────────────────
8102
+ async getAccountInfo() {
8103
+ return this.request("/account-information", {
8104
+ method: "GET"
8105
+ });
8106
+ }
8107
+ };
8108
+ }
8109
+ });
8110
+
8101
8111
  // ../integrations/dist/disco/client.js
8102
8112
  var DiscoClient;
8103
- var init_client12 = __esm({
8113
+ var init_client13 = __esm({
8104
8114
  "../integrations/dist/disco/client.js"() {
8105
8115
  "use strict";
8106
8116
  init_base_client();
@@ -8257,7 +8267,7 @@ var init_client12 = __esm({
8257
8267
 
8258
8268
  // ../integrations/dist/apollo/client.js
8259
8269
  var ApolloClient;
8260
- var init_client13 = __esm({
8270
+ var init_client14 = __esm({
8261
8271
  "../integrations/dist/apollo/client.js"() {
8262
8272
  "use strict";
8263
8273
  init_base_client();
@@ -8328,7 +8338,7 @@ var init_client13 = __esm({
8328
8338
 
8329
8339
  // ../integrations/dist/smartlead/client.js
8330
8340
  var MAX_LEADS_PER_REQUEST2, SmartLeadClient;
8331
- var init_client14 = __esm({
8341
+ var init_client15 = __esm({
8332
8342
  "../integrations/dist/smartlead/client.js"() {
8333
8343
  "use strict";
8334
8344
  init_base_client();
@@ -8395,7 +8405,7 @@ var init_client14 = __esm({
8395
8405
  });
8396
8406
 
8397
8407
  // ../integrations/dist/slack/client.js
8398
- var init_client15 = __esm({
8408
+ var init_client16 = __esm({
8399
8409
  "../integrations/dist/slack/client.js"() {
8400
8410
  "use strict";
8401
8411
  init_base_client();
@@ -8403,7 +8413,7 @@ var init_client15 = __esm({
8403
8413
  });
8404
8414
 
8405
8415
  // ../integrations/dist/calcom/client.js
8406
- var init_client16 = __esm({
8416
+ var init_client17 = __esm({
8407
8417
  "../integrations/dist/calcom/client.js"() {
8408
8418
  "use strict";
8409
8419
  init_base_client();
@@ -8411,7 +8421,7 @@ var init_client16 = __esm({
8411
8421
  });
8412
8422
 
8413
8423
  // ../integrations/dist/gemini/client.js
8414
- var init_client17 = __esm({
8424
+ var init_client18 = __esm({
8415
8425
  "../integrations/dist/gemini/client.js"() {
8416
8426
  "use strict";
8417
8427
  init_base_client();
@@ -8419,7 +8429,7 @@ var init_client17 = __esm({
8419
8429
  });
8420
8430
 
8421
8431
  // ../integrations/dist/unipile/client.js
8422
- var init_client18 = __esm({
8432
+ var init_client19 = __esm({
8423
8433
  "../integrations/dist/unipile/client.js"() {
8424
8434
  "use strict";
8425
8435
  init_base_client();
@@ -8427,7 +8437,7 @@ var init_client18 = __esm({
8427
8437
  });
8428
8438
 
8429
8439
  // ../integrations/dist/twilio/client.js
8430
- var init_client19 = __esm({
8440
+ var init_client20 = __esm({
8431
8441
  "../integrations/dist/twilio/client.js"() {
8432
8442
  "use strict";
8433
8443
  init_dist();
@@ -8436,7 +8446,7 @@ var init_client19 = __esm({
8436
8446
  });
8437
8447
 
8438
8448
  // ../integrations/dist/linear/client.js
8439
- var init_client20 = __esm({
8449
+ var init_client21 = __esm({
8440
8450
  "../integrations/dist/linear/client.js"() {
8441
8451
  "use strict";
8442
8452
  init_base_client();
@@ -8444,7 +8454,7 @@ var init_client20 = __esm({
8444
8454
  });
8445
8455
 
8446
8456
  // ../integrations/dist/zapmail/client.js
8447
- var init_client21 = __esm({
8457
+ var init_client22 = __esm({
8448
8458
  "../integrations/dist/zapmail/client.js"() {
8449
8459
  "use strict";
8450
8460
  init_base_client();
@@ -8469,7 +8479,7 @@ var init_factory = __esm({
8469
8479
 
8470
8480
  // ../integrations/dist/harvest/client.js
8471
8481
  var HarvestClient;
8472
- var init_client22 = __esm({
8482
+ var init_client23 = __esm({
8473
8483
  "../integrations/dist/harvest/client.js"() {
8474
8484
  "use strict";
8475
8485
  init_base_client();
@@ -8561,9 +8571,10 @@ var init_dist2 = __esm({
8561
8571
  init_client19();
8562
8572
  init_client20();
8563
8573
  init_client21();
8574
+ init_client22();
8564
8575
  init_parser();
8565
8576
  init_factory();
8566
- init_client22();
8577
+ init_client23();
8567
8578
  }
8568
8579
  });
8569
8580
 
@@ -9021,27 +9032,48 @@ var init_disco = __esm({
9021
9032
  });
9022
9033
 
9023
9034
  // src/providers/adapters/prospeo.ts
9024
- var ProspeoMcpAdapter;
9035
+ function mapSeniorityToProspeo(values) {
9036
+ if (!values || values.length === 0) return void 0;
9037
+ const mapped = values.map((v) => SENIORITY_TO_PROSPEO[v] ?? v);
9038
+ return [...new Set(mapped)];
9039
+ }
9040
+ function mapEmployeeRange(min, max) {
9041
+ if (min == null && max == null) return void 0;
9042
+ const ranges = ["1-10", "11-50", "51-200", "201-500", "501-1000", "1001-5000", "5001+"];
9043
+ return ranges.filter((r) => {
9044
+ const parts = r.replace("+", "").split("-").map(Number);
9045
+ const lo = parts[0] ?? 0;
9046
+ const hi = parts[1] ?? 1e5;
9047
+ return (min == null || hi >= min) && (max == null || lo <= max);
9048
+ });
9049
+ }
9050
+ var SENIORITY_TO_PROSPEO, ProspeoMcpAdapter;
9025
9051
  var init_prospeo2 = __esm({
9026
9052
  "src/providers/adapters/prospeo.ts"() {
9027
9053
  "use strict";
9028
9054
  init_dist();
9029
9055
  init_dist2();
9056
+ SENIORITY_TO_PROSPEO = {
9057
+ c_suite: "c_level",
9058
+ founder: "c_level",
9059
+ owner: "c_level",
9060
+ partner: "c_level",
9061
+ head: "director",
9062
+ senior: "senior",
9063
+ entry: "entry",
9064
+ intern: "entry"
9065
+ };
9030
9066
  ProspeoMcpAdapter = class {
9031
9067
  name = "prospeo";
9032
- capabilities = ["enrich_email"];
9033
- notes = "Best for: email finding from LinkedIn URLs. Good hit rate on LinkedIn-active professionals.";
9068
+ capabilities = ["find_people", "enrich_email"];
9069
+ notes = "Best for: city-level people search, industry filtering, email finding from LinkedIn URLs. Rich enrichment data (phone, title, company details).";
9034
9070
  client;
9035
9071
  constructor(apiKey) {
9036
- this.client = new ProspeoAdapter(apiKey);
9072
+ this.client = new ProspeoClient({ apiKey });
9037
9073
  }
9038
9074
  async checkCredentials() {
9039
9075
  try {
9040
- await this.client.findEmail({
9041
- firstName: "test",
9042
- lastName: "test",
9043
- company: "test.invalid"
9044
- });
9076
+ await this.client.getAccountInfo();
9045
9077
  return true;
9046
9078
  } catch (error) {
9047
9079
  logError(
@@ -9051,20 +9083,62 @@ var init_prospeo2 = __esm({
9051
9083
  return false;
9052
9084
  }
9053
9085
  }
9086
+ async checkCredits() {
9087
+ try {
9088
+ const info = await this.client.getAccountInfo();
9089
+ return {
9090
+ remaining: info.credits,
9091
+ unit: "credits",
9092
+ provider: this.name
9093
+ };
9094
+ } catch (error) {
9095
+ logError("prospeo:checkCredits", error instanceof Error ? error : new Error(String(error)));
9096
+ return null;
9097
+ }
9098
+ }
9099
+ // ─── PeopleFinder ────────────────────────────────────────
9100
+ async findPeople(query) {
9101
+ const response = await this.client.searchPeople({
9102
+ job_title: query.job_title ? [query.job_title] : void 0,
9103
+ seniority: mapSeniorityToProspeo(query.seniority),
9104
+ department: query.department,
9105
+ location: query.location ? [query.location] : void 0,
9106
+ company_name: query.company_name,
9107
+ company_domain: query.company_domain ?? (query.company_domains ? query.company_domains[0] : void 0),
9108
+ industry: query.filter_industry,
9109
+ company_size: mapEmployeeRange(query.min_employees, query.max_employees),
9110
+ limit: query.limit ?? 25,
9111
+ offset: query.offset ?? 0
9112
+ });
9113
+ return response.results.map((p) => ({
9114
+ first_name: p.first_name,
9115
+ last_name: p.last_name,
9116
+ job_title: p.job_title ?? void 0,
9117
+ company: p.company_name ?? void 0,
9118
+ company_domain: p.company_domain ?? void 0,
9119
+ email: p.email ?? void 0,
9120
+ phone: p.phone ?? void 0,
9121
+ linkedin_url: p.linkedin_url ?? void 0,
9122
+ seniority: p.seniority ?? void 0,
9123
+ department: p.department ?? void 0,
9124
+ location: p.location ?? void 0,
9125
+ sources: [this.name]
9126
+ }));
9127
+ }
9054
9128
  // ─── EmailEnricher ──────────────────────────────────────
9055
9129
  async enrichEmail(contact) {
9056
9130
  try {
9057
- const result = await this.client.findEmail({
9058
- firstName: contact.first_name,
9059
- lastName: contact.last_name,
9060
- company: contact.company ?? "",
9061
- domain: contact.company_domain,
9062
- linkedinUrl: contact.linkedin_url
9131
+ const domain = contact.company_domain ?? (contact.company ? `${contact.company.toLowerCase().replace(/[^a-z0-9]/g, "")}.com` : void 0);
9132
+ const response = await this.client.enrichPerson({
9133
+ first_name: contact.first_name,
9134
+ last_name: contact.last_name,
9135
+ company_website: domain,
9136
+ linkedin_url: contact.linkedin_url
9063
9137
  });
9064
- if (!result?.email) return null;
9138
+ if (response.error || !response.person?.email?.email) return null;
9065
9139
  return {
9066
- email: result.email,
9067
- quality: result.confidence ? `${result.confidence}%` : void 0,
9140
+ email: response.person.email.email,
9141
+ quality: response.person.email.status === "verified" ? "95%" : "70%",
9068
9142
  provider: this.name
9069
9143
  };
9070
9144
  } catch (error) {
@@ -9139,6 +9213,16 @@ var init_plusvibe = __esm({
9139
9213
  provider: this.name
9140
9214
  };
9141
9215
  }
9216
+ // ─── Campaign Creation ───────────────────────────────────
9217
+ async createCampaign(name) {
9218
+ const campaign = await this.client.createCampaign({ camp_name: name });
9219
+ return {
9220
+ id: campaign.id,
9221
+ name: campaign.name,
9222
+ status: campaign.status,
9223
+ provider: this.name
9224
+ };
9225
+ }
9142
9226
  };
9143
9227
  }
9144
9228
  });
@@ -10405,6 +10489,16 @@ async function handleCampaign(args, ctx) {
10405
10489
  if (!leads?.length) throw new Error("leads array is required for add_leads action");
10406
10490
  return manager.addLeadsToCampaign(campaignId, leads);
10407
10491
  }
10492
+ case "create": {
10493
+ const name = args.name;
10494
+ if (!name) throw new Error("name is required for create action");
10495
+ if (!manager.createCampaign) {
10496
+ throw new Error(
10497
+ `Provider "${provider.name}" does not support campaign creation. Currently only PlusVibe supports this action.`
10498
+ );
10499
+ }
10500
+ return manager.createCampaign(name);
10501
+ }
10408
10502
  default:
10409
10503
  throw new Error(`Unknown campaign action: ${action}`);
10410
10504
  }
@@ -11288,14 +11382,14 @@ var init_campaign2 = __esm({
11288
11382
  campaignTools = [
11289
11383
  {
11290
11384
  name: "gtm_campaign",
11291
- description: "Manage cold email campaigns. List campaigns, get stats, or add leads to a campaign. Supports PlusVibe, Instantly, and Smartlead providers.",
11385
+ description: "Manage cold email campaigns. List campaigns, get stats, add leads, or create a new campaign. Supports PlusVibe, Instantly, and Smartlead providers.",
11292
11386
  inputSchema: {
11293
11387
  type: "object",
11294
11388
  properties: {
11295
11389
  action: {
11296
11390
  type: "string",
11297
- enum: ["list", "stats", "add_leads"],
11298
- description: "Action to perform: list (all campaigns), stats (campaign metrics), add_leads (push contacts)"
11391
+ enum: ["list", "stats", "add_leads", "create"],
11392
+ description: "Action to perform: list (all campaigns), stats (campaign metrics), add_leads (push contacts), create (new campaign)"
11299
11393
  },
11300
11394
  campaign_id: {
11301
11395
  type: "string",
@@ -11319,6 +11413,10 @@ var init_campaign2 = __esm({
11319
11413
  },
11320
11414
  description: "Leads to add (required for add_leads action)"
11321
11415
  },
11416
+ name: {
11417
+ type: "string",
11418
+ description: "Campaign name (required for create action)"
11419
+ },
11322
11420
  provider: {
11323
11421
  type: "string",
11324
11422
  description: "Provider override (uses first available campaign_email provider if omitted)"
@@ -12033,12 +12131,13 @@ var init_validation = __esm({
12033
12131
  }),
12034
12132
  // 8. Cold email campaign management
12035
12133
  gtm_campaign: z2.object({
12036
- action: z2.enum(["list", "stats", "add_leads"], {
12037
- message: "action must be one of: list, stats, add_leads"
12134
+ action: z2.enum(["list", "stats", "add_leads", "create"], {
12135
+ message: "action must be one of: list, stats, add_leads, create"
12038
12136
  }),
12039
12137
  campaign_id: z2.string().optional(),
12040
12138
  leads: z2.array(campaignLeadSchema).optional(),
12041
- name: z2.string().optional()
12139
+ name: z2.string().optional(),
12140
+ provider: z2.string().optional()
12042
12141
  }),
12043
12142
  // 9. LinkedIn outreach management
12044
12143
  gtm_outreach: z2.object({