@coldiq/mcp 0.1.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/client.d.ts +8 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +47 -0
- package/dist/client.js.map +1 -0
- package/dist/executor.d.ts +21 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +130 -0
- package/dist/executor.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +49 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +3104 -0
- package/dist/registry.js.map +1 -0
- package/dist/tools/enrich-company.d.ts +22 -0
- package/dist/tools/enrich-company.d.ts.map +1 -0
- package/dist/tools/enrich-company.js +21 -0
- package/dist/tools/enrich-company.js.map +1 -0
- package/dist/tools/enrich-email.d.ts +24 -0
- package/dist/tools/enrich-email.d.ts.map +1 -0
- package/dist/tools/enrich-email.js +19 -0
- package/dist/tools/enrich-email.js.map +1 -0
- package/dist/tools/enrich-emails.d.ts +31 -0
- package/dist/tools/enrich-emails.d.ts.map +1 -0
- package/dist/tools/enrich-emails.js +146 -0
- package/dist/tools/enrich-emails.js.map +1 -0
- package/dist/tools/enrich-person.d.ts +26 -0
- package/dist/tools/enrich-person.d.ts.map +1 -0
- package/dist/tools/enrich-person.js +23 -0
- package/dist/tools/enrich-person.js.map +1 -0
- package/dist/tools/fetch-page-content.d.ts +22 -0
- package/dist/tools/fetch-page-content.d.ts.map +1 -0
- package/dist/tools/fetch-page-content.js +32 -0
- package/dist/tools/fetch-page-content.js.map +1 -0
- package/dist/tools/find-email.d.ts +24 -0
- package/dist/tools/find-email.d.ts.map +1 -0
- package/dist/tools/find-email.js +19 -0
- package/dist/tools/find-email.js.map +1 -0
- package/dist/tools/find-emails.d.ts +31 -0
- package/dist/tools/find-emails.d.ts.map +1 -0
- package/dist/tools/find-emails.js +146 -0
- package/dist/tools/find-emails.js.map +1 -0
- package/dist/tools/find-influencers.d.ts +29 -0
- package/dist/tools/find-influencers.d.ts.map +1 -0
- package/dist/tools/find-influencers.js +30 -0
- package/dist/tools/find-influencers.js.map +1 -0
- package/dist/tools/find-people.d.ts +26 -0
- package/dist/tools/find-people.d.ts.map +1 -0
- package/dist/tools/find-people.js +61 -0
- package/dist/tools/find-people.js.map +1 -0
- package/dist/tools/find-phone.d.ts +24 -0
- package/dist/tools/find-phone.d.ts.map +1 -0
- package/dist/tools/find-phone.js +48 -0
- package/dist/tools/find-phone.js.map +1 -0
- package/dist/tools/find-signals.d.ts +26 -0
- package/dist/tools/find-signals.d.ts.map +1 -0
- package/dist/tools/find-signals.js +82 -0
- package/dist/tools/find-signals.js.map +1 -0
- package/dist/tools/search-ads.d.ts +33 -0
- package/dist/tools/search-ads.d.ts.map +1 -0
- package/dist/tools/search-ads.js +33 -0
- package/dist/tools/search-ads.js.map +1 -0
- package/dist/tools/search-companies.d.ts +42 -0
- package/dist/tools/search-companies.d.ts.map +1 -0
- package/dist/tools/search-companies.js +37 -0
- package/dist/tools/search-companies.js.map +1 -0
- package/dist/tools/search-jobs.d.ts +51 -0
- package/dist/tools/search-jobs.d.ts.map +1 -0
- package/dist/tools/search-jobs.js +64 -0
- package/dist/tools/search-jobs.js.map +1 -0
- package/dist/tools/search-places.d.ts +47 -0
- package/dist/tools/search-places.d.ts.map +1 -0
- package/dist/tools/search-places.js +42 -0
- package/dist/tools/search-places.js.map +1 -0
- package/dist/tools/search-reddit.d.ts +27 -0
- package/dist/tools/search-reddit.d.ts.map +1 -0
- package/dist/tools/search-reddit.js +30 -0
- package/dist/tools/search-reddit.js.map +1 -0
- package/dist/tools/search-seo.d.ts +37 -0
- package/dist/tools/search-seo.d.ts.map +1 -0
- package/dist/tools/search-seo.js +49 -0
- package/dist/tools/search-seo.js.map +1 -0
- package/dist/tools/search-web.d.ts +23 -0
- package/dist/tools/search-web.d.ts.map +1 -0
- package/dist/tools/search-web.js +20 -0
- package/dist/tools/search-web.js.map +1 -0
- package/dist/tools/verify-email.d.ts +20 -0
- package/dist/tools/verify-email.d.ts.map +1 -0
- package/dist/tools/verify-email.js +15 -0
- package/dist/tools/verify-email.js.map +1 -0
- package/package.json +28 -0
- package/src/client.ts +60 -0
- package/src/executor.ts +182 -0
- package/src/index.ts +155 -0
- package/src/registry.ts +3159 -0
- package/src/tools/enrich-company.ts +25 -0
- package/src/tools/enrich-person.ts +27 -0
- package/src/tools/fetch-page-content.ts +36 -0
- package/src/tools/find-email.ts +23 -0
- package/src/tools/find-emails.ts +190 -0
- package/src/tools/find-influencers.ts +34 -0
- package/src/tools/find-people.ts +69 -0
- package/src/tools/find-phone.ts +53 -0
- package/src/tools/find-signals.ts +93 -0
- package/src/tools/search-ads.ts +44 -0
- package/src/tools/search-companies.ts +41 -0
- package/src/tools/search-jobs.ts +73 -0
- package/src/tools/search-places.ts +52 -0
- package/src/tools/search-reddit.ts +34 -0
- package/src/tools/search-seo.ts +59 -0
- package/src/tools/search-web.ts +24 -0
- package/src/tools/verify-email.ts +19 -0
- package/test-ads-live.ts +77 -0
- package/test-company-live.ts +91 -0
- package/test-email-live.ts +171 -0
- package/test-influencers-live.ts +66 -0
- package/test-jobs-live.ts +69 -0
- package/test-linkupapi-live.ts +137 -0
- package/test-phone-live.ts +41 -0
- package/test-places-live.ts +89 -0
- package/test-reddit-live.ts +66 -0
- package/test-search-live.ts +79 -0
- package/test-seo-live.ts +68 -0
- package/test-web-live.ts +67 -0
- package/tests/client.test.ts +90 -0
- package/tests/executor.test.ts +83 -0
- package/tests/gtm/01-icp-to-emails.test.ts +43 -0
- package/tests/gtm/02-icp-bulk-emails.test.ts +38 -0
- package/tests/gtm/03-icp-to-phones.test.ts +39 -0
- package/tests/gtm/04-funding-signal-outreach.test.ts +42 -0
- package/tests/gtm/05-hiring-signal-decisionmakers.test.ts +41 -0
- package/tests/gtm/06-intent-signal-outreach.test.ts +44 -0
- package/tests/gtm/07-places-to-content.test.ts +50 -0
- package/tests/gtm/08-domain-to-account.test.ts +44 -0
- package/tests/gtm/09-linkedin-to-everything.test.ts +41 -0
- package/tests/gtm/10-jobs-vs-signals-routing.test.ts +38 -0
- package/tests/gtm/11-find-vs-enrich-routing.test.ts +39 -0
- package/tests/gtm/12-bogus-domain-graceful.test.ts +42 -0
- package/tests/gtm/13-private-linkedin-graceful.test.ts +44 -0
- package/tests/gtm/14-empty-handoff.test.ts +43 -0
- package/tests/gtm/15-seo-reddit-research.test.ts +38 -0
- package/tests/gtm/README.md +59 -0
- package/tests/gtm/harness.ts +217 -0
- package/tests/gtm/tools-bridge.ts +232 -0
- package/tests/gtm-scenarios.md +32 -0
- package/tests/live/smoke-report.ts +255 -0
- package/tests/live/smoke.test.ts +134 -0
- package/tests/registry-enrich-person.test.ts +447 -0
- package/tests/registry-fetch-page-content.test.ts +90 -0
- package/tests/registry-find-people.test.ts +467 -0
- package/tests/registry-find-signals.test.ts +470 -0
- package/tests/registry-linkupapi.test.ts +331 -0
- package/tests/registry-search-companies.test.ts +188 -0
- package/tests/registry-search-jobs.test.ts +116 -0
- package/tests/registry.test.ts +2210 -0
- package/tests/tools/enrich-company.test.ts +92 -0
- package/tests/tools/enrich-email.test.ts +94 -0
- package/tests/tools/enrich-emails.test.ts +271 -0
- package/tests/tools/enrich-person.test.ts +140 -0
- package/tests/tools/fetch-page-content.test.ts +108 -0
- package/tests/tools/find-influencers.test.ts +91 -0
- package/tests/tools/find-people.test.ts +344 -0
- package/tests/tools/find-phone.test.ts +100 -0
- package/tests/tools/find-signals.test.ts +110 -0
- package/tests/tools/search-ads.test.ts +182 -0
- package/tests/tools/search-companies.test.ts +58 -0
- package/tests/tools/search-jobs.test.ts +210 -0
- package/tests/tools/search-places.test.ts +114 -0
- package/tests/tools/search-reddit.test.ts +125 -0
- package/tests/tools/search-seo.test.ts +183 -0
- package/tests/tools/search-web.test.ts +79 -0
- package/tests/tools/verify-email.test.ts +68 -0
- package/tsconfig.json +17 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeWithFallback, isExecutionError } from '../executor.js';
|
|
3
|
+
export const findSignalsName = 'find_signals';
|
|
4
|
+
export const findSignalsDescription = 'Retrieve sales intelligence signals — funding rounds, acquisitions, hiring activity, job changes, buying intent, news, and startup posts. ' +
|
|
5
|
+
'Each call targets one signal type. Two modes: ' +
|
|
6
|
+
'Company-targeted (funding | acquisition | hiring | job_change | intent): accepts companies/domains/industries/countries/since filters. ' +
|
|
7
|
+
'intent REQUIRES at least one of companies or domains. ' +
|
|
8
|
+
'Feed-style (news | startup_post): country and since only — does NOT filter by company. Passing companies/domains for these types is rejected. ' +
|
|
9
|
+
'hiring returns aggregated company-level hiring activity (e.g. "X is rapidly expanding") — for individual job postings use search_jobs instead.';
|
|
10
|
+
export const findSignalsSchema = {
|
|
11
|
+
signal_type: z
|
|
12
|
+
.enum(['funding', 'acquisition', 'hiring', 'job_change', 'news', 'intent', 'startup_post'])
|
|
13
|
+
.describe('Signal type to retrieve. ' +
|
|
14
|
+
'Company-targeted: "funding" (fundraising rounds), "acquisition" (M&A), "hiring" (company hiring surge — not individual postings), ' +
|
|
15
|
+
'"job_change" (people who recently changed roles), "intent" (companies showing buying intent). ' +
|
|
16
|
+
'Feed-style (country/date filter only — company filter not supported): "news" (company news events), "startup_post" (Product Hunt, Hacker News, etc.)'),
|
|
17
|
+
companies: z
|
|
18
|
+
.array(z.string())
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Company names to filter signals for (e.g. ["ColdIQ", "HubSpot"]). Only used by company-targeted signal types: funding, acquisition, hiring, job_change, intent. Rejected for news and startup_post.'),
|
|
21
|
+
domains: z
|
|
22
|
+
.array(z.string())
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Company domains to filter signals for (e.g. ["coldiq.com"]). Only used by company-targeted types. Required for intent when companies is absent.'),
|
|
25
|
+
since: z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Return signals after this date. ISO date format, e.g. "2026-01-01".'),
|
|
29
|
+
industries: z
|
|
30
|
+
.array(z.string())
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Industry names to filter by (e.g. ["Software", "SaaS"]). Only used by company-targeted signal types.'),
|
|
33
|
+
countries: z
|
|
34
|
+
.array(z.string())
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('ISO country codes or names to filter by (e.g. ["US", "GB"]). Works for all signal types.'),
|
|
37
|
+
limit: z
|
|
38
|
+
.number()
|
|
39
|
+
.int()
|
|
40
|
+
.min(1)
|
|
41
|
+
.max(100)
|
|
42
|
+
.default(25)
|
|
43
|
+
.describe('Maximum number of signals to return (1–100).'),
|
|
44
|
+
};
|
|
45
|
+
export async function findSignalsHandler(input) {
|
|
46
|
+
const hasCompanies = Array.isArray(input.companies) && input.companies.length > 0;
|
|
47
|
+
const hasDomains = Array.isArray(input.domains) && input.domains.length > 0;
|
|
48
|
+
if (input.signal_type === 'intent' && !hasCompanies && !hasDomains) {
|
|
49
|
+
return {
|
|
50
|
+
content: [{
|
|
51
|
+
type: 'text',
|
|
52
|
+
text: JSON.stringify({ error: 'intent signal_type requires at least one of: companies or domains' }, null, 2),
|
|
53
|
+
}],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if ((input.signal_type === 'news' || input.signal_type === 'startup_post') && (hasCompanies || hasDomains)) {
|
|
58
|
+
return {
|
|
59
|
+
content: [{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: JSON.stringify({
|
|
62
|
+
error: 'news and startup_post are feed-style signal types that only filter by country and since date — they do not support company filtering. Remove companies/domains, or use signal_type=intent for company-targeted intent signals.',
|
|
63
|
+
}, null, 2),
|
|
64
|
+
}],
|
|
65
|
+
isError: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const result = await executeWithFallback('find_signals', input);
|
|
69
|
+
if (isExecutionError(result)) {
|
|
70
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], isError: true };
|
|
71
|
+
}
|
|
72
|
+
// buying_intents upstream has no limit param — truncate to requested limit
|
|
73
|
+
if (input.signal_type === 'intent') {
|
|
74
|
+
const limit = typeof input.limit === 'number' ? input.limit : 25;
|
|
75
|
+
const typed = result;
|
|
76
|
+
if (Array.isArray(typed.data?.data)) {
|
|
77
|
+
typed.data.data = typed.data.data.slice(0, limit);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=find-signals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-signals.js","sourceRoot":"","sources":["../../src/tools/find-signals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtE,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAA;AAE7C,MAAM,CAAC,MAAM,sBAAsB,GACjC,4IAA4I;IAC5I,gDAAgD;IAChD,yIAAyI;IACzI,wDAAwD;IACxD,gJAAgJ;IAChJ,gJAAgJ,CAAA;AAElJ,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,CAAC;SACX,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;SAC1F,QAAQ,CACP,2BAA2B;QAC3B,oIAAoI;QACpI,gGAAgG;QAChG,sJAAsJ,CACvJ;IACH,SAAS,EAAE,CAAC;SACT,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SACjB,QAAQ,EAAE;SACV,QAAQ,CAAC,qMAAqM,CAAC;IAClN,OAAO,EAAE,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,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACxF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchAdsName = "search_ads";
|
|
3
|
+
export declare const searchAdsDescription = "Search live ad creatives across 5 ad libraries (Google Ads Transparency, LinkedIn Ad Library, Meta Ads Library, Twitter/X Ads, Reddit Ads) \u2014 a high-signal GTM input for competitive intelligence, ICP refinement, and pitch personalization. Routes by input: domains/advertiser_ids \u2192 Google only; search_urls \u2192 LinkedIn only; bare query \u2192 Google \u2192 Meta \u2192 Twitter \u2192 Reddit waterfall. Use platform=\"google\"|\"linkedin\"|\"meta\"|\"twitter\"|\"reddit\" to pin to one platform. All providers are async (~10\u201360s). Cost: ~5 credits per call (Twitter charges 1 credit per ad returned; Meta does not refund on failure).";
|
|
4
|
+
export declare const searchAdsSchema: {
|
|
5
|
+
query: z.ZodOptional<z.ZodString>;
|
|
6
|
+
domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
advertiser_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
search_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
country: z.ZodOptional<z.ZodString>;
|
|
10
|
+
max_results: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
ad_type: z.ZodOptional<z.ZodEnum<["ALL", "POLITICAL_AND_ISSUE_ADS"]>>;
|
|
12
|
+
start_date: z.ZodOptional<z.ZodString>;
|
|
13
|
+
end_date: z.ZodOptional<z.ZodString>;
|
|
14
|
+
industry: z.ZodOptional<z.ZodEnum<["TECH_B2C", "TECH_B2B", "EDUCATION", "ENTERTAINMENT", "HEALTH_AND_BEAUTY", "GAMING", "EMPLOYMENT", "RETAIL_AND_ECOMMERCE", "AUTO", "FINANCIAL_SERVICES", "TRAVEL", "REAL_ESTATE", "GAMBLING_AND_FANTASY_SPORTS", "POLITICS_AND_GOVERNMENT", "CONSUMER_PACKAGED_GOODS", "OTHER"]>>;
|
|
15
|
+
budget_category: z.ZodOptional<z.ZodEnum<["LOW", "MEDIUM", "HIGH"]>>;
|
|
16
|
+
post_type: z.ZodOptional<z.ZodEnum<["IMAGE", "VIDEO", "TEXT"]>>;
|
|
17
|
+
objective_type: z.ZodOptional<z.ZodEnum<["AWARENESS", "CONVERSIONS", "APP_INSTALLS", "TRAFFIC", "VIDEO_VIEWABLE_IMPRESSIONS"]>>;
|
|
18
|
+
platform: z.ZodOptional<z.ZodEnum<["google", "linkedin", "meta", "twitter", "reddit"]>>;
|
|
19
|
+
};
|
|
20
|
+
export declare function searchAdsHandler(input: Record<string, unknown>): Promise<{
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
content: {
|
|
28
|
+
type: "text";
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
isError?: undefined;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=search-ads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-ads.d.ts","sourceRoot":"","sources":["../../src/tools/search-ads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,aAAa,eAAe,CAAA;AAEzC,eAAO,MAAM,oBAAoB,8oBAC0jB,CAAA;AAE3lB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CA2B3B,CAAA;AAED,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAMpE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeWithFallback, isExecutionError } from '../executor.js';
|
|
3
|
+
export const searchAdsName = 'search_ads';
|
|
4
|
+
export const searchAdsDescription = 'Search live ad creatives across 5 ad libraries (Google Ads Transparency, LinkedIn Ad Library, Meta Ads Library, Twitter/X Ads, Reddit Ads) — a high-signal GTM input for competitive intelligence, ICP refinement, and pitch personalization. Routes by input: domains/advertiser_ids → Google only; search_urls → LinkedIn only; bare query → Google → Meta → Twitter → Reddit waterfall. Use platform="google"|"linkedin"|"meta"|"twitter"|"reddit" to pin to one platform. All providers are async (~10–60s). Cost: ~5 credits per call (Twitter charges 1 credit per ad returned; Meta does not refund on failure).';
|
|
5
|
+
export const searchAdsSchema = {
|
|
6
|
+
query: z.string().optional().describe('Advertiser/company name or keyword. Routes to Google→Meta→Twitter→Reddit when no platform-specific input is set.'),
|
|
7
|
+
domains: z.array(z.string()).optional().describe('Company domains (e.g. ["salesforce.com"]). Routes to Google Ads only.'),
|
|
8
|
+
advertiser_ids: z.array(z.string()).optional().describe('Google Ads Transparency advertiser IDs (e.g. ["AR16735076323512287233"]). Routes to Google Ads only.'),
|
|
9
|
+
search_urls: z.array(z.string()).optional().describe('Pre-built LinkedIn Ad Library URLs from linkedin.com/ad-library. Routes to LinkedIn only. Build at linkedin.com/ad-library/search using accountOwner/countries/dateOption filters.'),
|
|
10
|
+
country: z.string().optional().describe('ISO country code (2-letter for Meta/Twitter; longer accepted by Google as region). Ignored by Reddit.'),
|
|
11
|
+
max_results: z.number().int().min(1).max(200).default(25).describe('Max ads per provider call (1–200). Per-provider caps: Google 1000, LinkedIn 200, Meta 200, Twitter 100. Twitter charges 1 credit per ad returned.'),
|
|
12
|
+
ad_type: z.enum(['ALL', 'POLITICAL_AND_ISSUE_ADS']).optional().describe('Meta only. Defaults to ALL.'),
|
|
13
|
+
start_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe('Twitter only. Date range start, YYYY-MM-DD.'),
|
|
14
|
+
end_date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional().describe('Twitter only. Date range end, YYYY-MM-DD.'),
|
|
15
|
+
industry: z.enum([
|
|
16
|
+
'TECH_B2C', 'TECH_B2B', 'EDUCATION', 'ENTERTAINMENT', 'HEALTH_AND_BEAUTY',
|
|
17
|
+
'GAMING', 'EMPLOYMENT', 'RETAIL_AND_ECOMMERCE', 'AUTO', 'FINANCIAL_SERVICES',
|
|
18
|
+
'TRAVEL', 'REAL_ESTATE', 'GAMBLING_AND_FANTASY_SPORTS', 'POLITICS_AND_GOVERNMENT',
|
|
19
|
+
'CONSUMER_PACKAGED_GOODS', 'OTHER',
|
|
20
|
+
]).optional().describe('Reddit only. Filter by industry category.'),
|
|
21
|
+
budget_category: z.enum(['LOW', 'MEDIUM', 'HIGH']).optional().describe('Reddit only.'),
|
|
22
|
+
post_type: z.enum(['IMAGE', 'VIDEO', 'TEXT']).optional().describe('Reddit only.'),
|
|
23
|
+
objective_type: z.enum(['AWARENESS', 'CONVERSIONS', 'APP_INSTALLS', 'TRAFFIC', 'VIDEO_VIEWABLE_IMPRESSIONS']).optional().describe('Reddit only.'),
|
|
24
|
+
platform: z.enum(['google', 'linkedin', 'meta', 'twitter', 'reddit']).optional().describe('Pin to one platform; skips all others. Useful for cross-platform comparison via separate calls.'),
|
|
25
|
+
};
|
|
26
|
+
export async function searchAdsHandler(input) {
|
|
27
|
+
const result = await executeWithFallback('search_ads', input);
|
|
28
|
+
if (isExecutionError(result)) {
|
|
29
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], isError: true };
|
|
30
|
+
}
|
|
31
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=search-ads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-ads.js","sourceRoot":"","sources":["../../src/tools/search-ads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EA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QAC7B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACvG,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACxF,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchCompaniesName = "search_companies";
|
|
3
|
+
export declare const searchCompaniesDescription = "Search B2B companies by industry, size, geography, founding year, tech stack, funding, revenue, exclusion lists, and hiring signals. Routing is automatic: strict firmographic filters (revenue, employee bands, exclusion lists) get high-precision providers first; tech-stack and funding-stage filters route to specialized providers; loose keyword/geo searches fall back to broad providers; a LinkedIn Sales Navigator search URL enables URL-based discovery as a final fallback. Default limit: 25.";
|
|
4
|
+
export declare const searchCompaniesSchema: {
|
|
5
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
industries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
technologies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
min_employees: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
max_employees: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
min_founded_year: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
max_founded_year: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
funding_stages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
min_funding_amount: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
max_funding_amount: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
min_funding_year: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
max_funding_year: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
min_revenue: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
max_revenue: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
exclude_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
22
|
+
exclude_industries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
23
|
+
exclude_countries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
is_hiring: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
min_workforce_growth_pct: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
linkedin_search_url: z.ZodOptional<z.ZodString>;
|
|
27
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
28
|
+
};
|
|
29
|
+
export declare function searchCompaniesHandler(input: Record<string, unknown>): Promise<{
|
|
30
|
+
content: {
|
|
31
|
+
type: "text";
|
|
32
|
+
text: string;
|
|
33
|
+
}[];
|
|
34
|
+
isError: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
isError?: undefined;
|
|
41
|
+
}>;
|
|
42
|
+
//# sourceMappingURL=search-companies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-companies.d.ts","sourceRoot":"","sources":["../../src/tools/search-companies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,mBAAmB,qBAAqB,CAAA;AAErD,eAAO,MAAM,0BAA0B,kfAC0c,CAAA;AAEjf,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;CAwBjC,CAAA;AAED,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAM1E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeWithFallback, isExecutionError } from '../executor.js';
|
|
3
|
+
export const searchCompaniesName = 'search_companies';
|
|
4
|
+
export const searchCompaniesDescription = 'Search B2B companies by industry, size, geography, founding year, tech stack, funding, revenue, exclusion lists, and hiring signals. Routing is automatic: strict firmographic filters (revenue, employee bands, exclusion lists) get high-precision providers first; tech-stack and funding-stage filters route to specialized providers; loose keyword/geo searches fall back to broad providers; a LinkedIn Sales Navigator search URL enables URL-based discovery as a final fallback. Default limit: 25.';
|
|
5
|
+
export const searchCompaniesSchema = {
|
|
6
|
+
keywords: z.array(z.string()).optional().describe('Industry keywords or topics (e.g. ["SaaS", "fintech"])'),
|
|
7
|
+
countries: z.array(z.string()).optional().describe('2-letter ISO country codes (e.g. ["FR", "US"])'),
|
|
8
|
+
locations: z.array(z.string()).optional().describe('City/region filters as free-text strings (e.g. ["Paris, France", "San Francisco, California"]). Narrows results beyond country-level.'),
|
|
9
|
+
industries: z.array(z.string()).optional().describe('Industry names (e.g. ["Technology", "Healthcare"])'),
|
|
10
|
+
technologies: z.array(z.string()).optional().describe('Tech stack filters — routes to tech-aware providers. Pass technology names or slugs e.g. ["Salesforce", "HubSpot"].'),
|
|
11
|
+
min_employees: z.number().optional().describe('Minimum employee count'),
|
|
12
|
+
max_employees: z.number().optional().describe('Maximum employee count'),
|
|
13
|
+
min_founded_year: z.number().optional().describe('Earliest founding year'),
|
|
14
|
+
max_founded_year: z.number().optional().describe('Latest founding year'),
|
|
15
|
+
funding_stages: z.array(z.string()).optional().describe('Funding stage filters e.g. ["seed", "series_a", "series_b"]. Exact stage IDs vary by provider.'),
|
|
16
|
+
min_funding_amount: z.number().optional().describe('Minimum total funding raised (USD)'),
|
|
17
|
+
max_funding_amount: z.number().optional().describe('Maximum total funding raised (USD)'),
|
|
18
|
+
min_funding_year: z.number().optional().describe('Earliest year of last funding round'),
|
|
19
|
+
max_funding_year: z.number().optional().describe('Latest year of last funding round'),
|
|
20
|
+
min_revenue: z.number().optional().describe('Minimum estimated annual revenue (USD)'),
|
|
21
|
+
max_revenue: z.number().optional().describe('Maximum estimated annual revenue (USD)'),
|
|
22
|
+
exclude_domains: z.array(z.string()).optional().describe('Company domains to exclude from results'),
|
|
23
|
+
exclude_industries: z.array(z.string()).optional().describe('Industry names to exclude from results'),
|
|
24
|
+
exclude_countries: z.array(z.string()).optional().describe('2-letter ISO country codes to exclude from results'),
|
|
25
|
+
is_hiring: z.boolean().optional().describe('Filter to companies currently posting jobs'),
|
|
26
|
+
min_workforce_growth_pct: z.number().optional().describe('Minimum workforce growth % over the past 12 months (e.g. 10 for 10%)'),
|
|
27
|
+
linkedin_search_url: z.string().optional().describe('LinkedIn Sales Navigator company search URL — when provided, enables URL-based prospect discovery as a final fallback. Most users should leave this unset.'),
|
|
28
|
+
limit: z.number().min(1).max(100).default(25).describe('Max results to return (default: 25, max: 100)'),
|
|
29
|
+
};
|
|
30
|
+
export async function searchCompaniesHandler(input) {
|
|
31
|
+
const result = await executeWithFallback('search_companies', input);
|
|
32
|
+
if (isExecutionError(result)) {
|
|
33
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], isError: true };
|
|
34
|
+
}
|
|
35
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=search-companies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-companies.js","sourceRoot":"","sources":["../../src/tools/search-companies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtE,MAAM,CAAC,MAA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CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4JAA4J,CAAC;IACjN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+CAA+C,CAAC;CACxG,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,KAA8B;IACzE,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAA;IACnE,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACvG,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACxF,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchJobsName = "search_jobs";
|
|
3
|
+
export declare const searchJobsDescription = "Search live job postings as a GTM buying signal \u2014 find companies hiring for specific roles, on specific ATS platforms, in specific regions. Filter routing is automatic: ATS slugs and company-domain filters route to broad career-site coverage (175k+ company sites, 54 ATS platforms); LinkedIn-only filters (seniority, industry, employee count, easy apply) route to LinkedIn. Shared filters (title, location, description, work arrangement, employment type, taxonomies) work everywhere. For aggregated hiring activity at the company level (e.g. \"X is hiring fast\"), use find_signals(signal_type=\"hiring\") instead. Default limit: 25.";
|
|
4
|
+
export declare const searchJobsSchema: {
|
|
5
|
+
title_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
exclude_title_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
|
+
locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
exclude_locations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
9
|
+
description_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
|
+
exclude_description_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
+
companies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
exclude_companies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
remote: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
exclude_agencies: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
posted_after: z.ZodOptional<z.ZodString>;
|
|
16
|
+
time_range: z.ZodDefault<z.ZodOptional<z.ZodEnum<["1h", "24h", "7d", "6m"]>>>;
|
|
17
|
+
include_description: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
18
|
+
employment_types: z.ZodOptional<z.ZodArray<z.ZodEnum<["FULL_TIME", "PART_TIME", "CONTRACTOR", "TEMPORARY", "INTERN", "VOLUNTEER", "PER_DIEM", "OTHER"]>, "many">>;
|
|
19
|
+
work_arrangements: z.ZodOptional<z.ZodArray<z.ZodEnum<["On-site", "Hybrid", "Remote OK", "Remote Solely"]>, "many">>;
|
|
20
|
+
experience_levels: z.ZodOptional<z.ZodArray<z.ZodEnum<["0-2", "2-5", "5-10", "10+"]>, "many">>;
|
|
21
|
+
has_salary: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
has_visa_sponsorship: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
taxonomies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
ats_slugs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
exclude_ats_slugs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
company_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
28
|
+
exclude_company_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
29
|
+
seniority_levels: z.ZodOptional<z.ZodArray<z.ZodEnum<["Entry level", "Associate", "Mid-Senior level", "Director", "Executive", "Internship", "Not Applicable"]>, "many">>;
|
|
30
|
+
industries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
organization_slugs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
exclude_organization_slugs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
33
|
+
min_employees: z.ZodOptional<z.ZodNumber>;
|
|
34
|
+
max_employees: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
easy_apply_only: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
exclude_easy_apply: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
};
|
|
38
|
+
export declare function searchJobsHandler(input: Record<string, unknown>): Promise<{
|
|
39
|
+
content: {
|
|
40
|
+
type: "text";
|
|
41
|
+
text: string;
|
|
42
|
+
}[];
|
|
43
|
+
isError: boolean;
|
|
44
|
+
} | {
|
|
45
|
+
content: {
|
|
46
|
+
type: "text";
|
|
47
|
+
text: string;
|
|
48
|
+
}[];
|
|
49
|
+
isError?: undefined;
|
|
50
|
+
}>;
|
|
51
|
+
//# sourceMappingURL=search-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-jobs.d.ts","sourceRoot":"","sources":["../../src/tools/search-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAavB,eAAO,MAAM,cAAc,gBAAgB,CAAA;AAE3C,eAAO,MAAM,qBAAqB,moBACulB,CAAA;AAEznB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC5B,CAAA;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAcrE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeWithFallback, isExecutionError } from '../executor.js';
|
|
3
|
+
const _CAREER_SITE_ONLY = ['ats_slugs', 'exclude_ats_slugs', 'company_domains', 'exclude_company_domains'];
|
|
4
|
+
const _LINKEDIN_ONLY = ['seniority_levels', 'industries', 'organization_slugs', 'exclude_organization_slugs', 'min_employees', 'max_employees', 'easy_apply_only', 'exclude_easy_apply'];
|
|
5
|
+
function _isFilterSet(input, keys) {
|
|
6
|
+
return keys.some((k) => {
|
|
7
|
+
const v = input[k];
|
|
8
|
+
return !!v && (!Array.isArray(v) || v.length > 0);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const searchJobsName = 'search_jobs';
|
|
12
|
+
export const searchJobsDescription = 'Search live job postings as a GTM buying signal — find companies hiring for specific roles, on specific ATS platforms, in specific regions. Filter routing is automatic: ATS slugs and company-domain filters route to broad career-site coverage (175k+ company sites, 54 ATS platforms); LinkedIn-only filters (seniority, industry, employee count, easy apply) route to LinkedIn. Shared filters (title, location, description, work arrangement, employment type, taxonomies) work everywhere. For aggregated hiring activity at the company level (e.g. "X is hiring fast"), use find_signals(signal_type="hiring") instead. Default limit: 25.';
|
|
13
|
+
export const searchJobsSchema = {
|
|
14
|
+
// --- shared filters ---
|
|
15
|
+
title_keywords: z.array(z.string()).optional().describe('Job title terms to match (supports prefix matching, e.g. "engineer:*"). OR-joined across terms.'),
|
|
16
|
+
exclude_title_keywords: z.array(z.string()).optional().describe('Title terms to exclude.'),
|
|
17
|
+
locations: z.array(z.string()).optional().describe('Locations in "City, State/Region, Country" format (English), e.g. ["Austin, Texas, United States"].'),
|
|
18
|
+
exclude_locations: z.array(z.string()).optional(),
|
|
19
|
+
description_keywords: z.array(z.string()).optional().describe('Free-text terms to search in job descriptions.'),
|
|
20
|
+
exclude_description_keywords: z.array(z.string()).optional(),
|
|
21
|
+
companies: z.array(z.string()).optional().describe('Company names to include.'),
|
|
22
|
+
exclude_companies: z.array(z.string()).optional(),
|
|
23
|
+
remote: z.boolean().optional().describe('Include remote jobs only.'),
|
|
24
|
+
exclude_agencies: z.boolean().optional().describe('Filter out staffing agencies and job boards.'),
|
|
25
|
+
posted_after: z.string().optional().describe('Only return jobs posted after this date, e.g. "2026-01-01" or ISO datetime.'),
|
|
26
|
+
time_range: z.enum(['1h', '24h', '7d', '6m']).optional().default('7d').describe('Recency window for the search.'),
|
|
27
|
+
include_description: z.boolean().optional().default(false).describe('Include full job description text in results (slower, more tokens).'),
|
|
28
|
+
employment_types: z.array(z.enum(['FULL_TIME', 'PART_TIME', 'CONTRACTOR', 'TEMPORARY', 'INTERN', 'VOLUNTEER', 'PER_DIEM', 'OTHER'])).optional(),
|
|
29
|
+
work_arrangements: z.array(z.enum(['On-site', 'Hybrid', 'Remote OK', 'Remote Solely'])).optional(),
|
|
30
|
+
experience_levels: z.array(z.enum(['0-2', '2-5', '5-10', '10+'])).optional().describe('AI-inferred years-of-experience bands.'),
|
|
31
|
+
has_salary: z.boolean().optional().describe('Only return postings that include salary information.'),
|
|
32
|
+
has_visa_sponsorship: z.boolean().optional(),
|
|
33
|
+
taxonomies: z.array(z.string()).optional().describe('AI-inferred industry taxonomies, e.g. ["Technology", "Healthcare"].'),
|
|
34
|
+
limit: z.number().int().min(10).max(500).default(25).describe('Max jobs to return (10–500, default 25).'),
|
|
35
|
+
// --- Career-site-only routing filters ---
|
|
36
|
+
ats_slugs: z.array(z.string()).optional().describe('Return only jobs from these ATS platforms, e.g. ["greenhouse", "workday", "ashby", "lever"]. Routes to career-site source; LinkedIn is skipped.'),
|
|
37
|
+
exclude_ats_slugs: z.array(z.string()).optional(),
|
|
38
|
+
company_domains: z.array(z.string()).optional().describe('Restrict to jobs posted by companies with these domains (exact match). Routes to career-site source.'),
|
|
39
|
+
exclude_company_domains: z.array(z.string()).optional(),
|
|
40
|
+
// --- LinkedIn-only routing filters ---
|
|
41
|
+
seniority_levels: z.array(z.enum(['Entry level', 'Associate', 'Mid-Senior level', 'Director', 'Executive', 'Internship', 'Not Applicable'])).optional().describe('LinkedIn seniority filter. Routes to LinkedIn source; career-site is skipped.'),
|
|
42
|
+
industries: z.array(z.string()).optional().describe('LinkedIn industry names (exact match). Routes to LinkedIn source.'),
|
|
43
|
+
organization_slugs: z.array(z.string()).optional().describe('LinkedIn company slugs to include. Routes to LinkedIn source.'),
|
|
44
|
+
exclude_organization_slugs: z.array(z.string()).optional(),
|
|
45
|
+
min_employees: z.number().int().min(1).optional().describe('Minimum company employee count (≥1). Routes to LinkedIn source.'),
|
|
46
|
+
max_employees: z.number().int().min(1).optional(),
|
|
47
|
+
easy_apply_only: z.boolean().optional().describe('Only LinkedIn Easy Apply jobs. Routes to LinkedIn source.'),
|
|
48
|
+
exclude_easy_apply: z.boolean().optional().describe('Exclude LinkedIn Easy Apply jobs. Routes to LinkedIn source.'),
|
|
49
|
+
};
|
|
50
|
+
export async function searchJobsHandler(input) {
|
|
51
|
+
if (_isFilterSet(input, _CAREER_SITE_ONLY) && _isFilterSet(input, _LINKEDIN_ONLY)) {
|
|
52
|
+
const err = {
|
|
53
|
+
error: 'Contradictory filters: ATS/domain filters (ats_slugs, company_domains) are Career Site only, ' +
|
|
54
|
+
'while seniority/industry/employee filters are LinkedIn only. Remove one set.',
|
|
55
|
+
};
|
|
56
|
+
return { content: [{ type: 'text', text: JSON.stringify(err, null, 2) }], isError: true };
|
|
57
|
+
}
|
|
58
|
+
const result = await executeWithFallback('search_jobs', input);
|
|
59
|
+
if (isExecutionError(result)) {
|
|
60
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], isError: true };
|
|
61
|
+
}
|
|
62
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=search-jobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-jobs.js","sourceRoot":"","sources":["../../src/tools/search-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtE,MAAM,iBAAiB,GAAG,CAAC,WAAW,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,yBAAyB,CAAC,CAAA;AAC1G,MAAM,cAAc,GAAG,CAAC,kBAAkB,EAAE,YAAY,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CAAA;AAExL,SAAS,YAAY,CAAC,KAA8B,EAAE,IAAc;IAClE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACrB,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;QAClB,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAA;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAChC,unBAAunB,CAAA;AAEznB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,yBAAyB;IACzB,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iGAAiG,CAAC;IAC1J,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ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C,QAAQ,CAAC,2DAA2D,CAAC;IAC7G,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8DAA8D,CAAC;CACpH,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAA8B;IACpE,IAAI,YAAY,CAAC,KAAK,EAAE,iBAAiB,CAAC,IAAI,YAAY,CAAC,KAAK,EAAE,cAAc,CAAC,EAAE,CAAC;QAClF,MAAM,GAAG,GAAG;YACV,KAAK,EACH,+FAA+F;gBAC/F,8EAA8E;SACjF,CAAA;QACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACpG,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;IAC9D,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACvG,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACxF,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchPlacesName = "search_places";
|
|
3
|
+
export declare const searchPlacesDescription = "Search local businesses and places via 2 providers (Openmart Search, Google Maps Scraper) \u2014 useful for territory mapping, local-services prospecting, restaurant/retail/vertical research. Routes by input: structured filters or country in {US,CA,AU,PR,NZ} \u2192 Openmart (sync, ~1s) first, then Google Maps Scraper (async, ~30\u2013120s) as fallback or for global coverage. Use provider=\"openmart\"|\"google_maps\" to pin to one. Cost: 1 credit per place returned (both providers).";
|
|
4
|
+
export declare const searchPlacesSchema: {
|
|
5
|
+
query: z.ZodOptional<z.ZodString>;
|
|
6
|
+
country: z.ZodOptional<z.ZodString>;
|
|
7
|
+
city: z.ZodOptional<z.ZodString>;
|
|
8
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
9
|
+
provider: z.ZodOptional<z.ZodEnum<["openmart", "google_maps"]>>;
|
|
10
|
+
state: z.ZodOptional<z.ZodString>;
|
|
11
|
+
zip_code: z.ZodOptional<z.ZodString>;
|
|
12
|
+
lat: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
long: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
geo_radius: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
|
+
min_overall_rating: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
max_overall_rating: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
min_total_reviews: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
max_total_reviews: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
ownership_type: z.ZodOptional<z.ZodEnum<["INDEPENDENT", "FAMILY", "FRANCHISE", "CHAIN"]>>;
|
|
21
|
+
has_website: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
has_valid_website: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
has_contact_info: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
min_price_tier: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
max_price_tier: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
include_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
27
|
+
exclude_keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
28
|
+
exclude_root_domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
29
|
+
start_urls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
include_opening_hours: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
+
include_additional_info: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
language: z.ZodOptional<z.ZodString>;
|
|
33
|
+
};
|
|
34
|
+
export declare function searchPlacesHandler(input: Record<string, unknown>): Promise<{
|
|
35
|
+
content: {
|
|
36
|
+
type: "text";
|
|
37
|
+
text: string;
|
|
38
|
+
}[];
|
|
39
|
+
isError: boolean;
|
|
40
|
+
} | {
|
|
41
|
+
content: {
|
|
42
|
+
type: "text";
|
|
43
|
+
text: string;
|
|
44
|
+
}[];
|
|
45
|
+
isError?: undefined;
|
|
46
|
+
}>;
|
|
47
|
+
//# sourceMappingURL=search-places.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-places.d.ts","sourceRoot":"","sources":["../../src/tools/search-places.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,uBAAuB,2eACmb,CAAA;AAEvd,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmC9B,CAAA;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAMvE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeWithFallback, isExecutionError } from '../executor.js';
|
|
3
|
+
export const searchPlacesName = 'search_places';
|
|
4
|
+
export const searchPlacesDescription = 'Search local businesses and places via 2 providers (Openmart Search, Google Maps Scraper) — useful for territory mapping, local-services prospecting, restaurant/retail/vertical research. Routes by input: structured filters or country in {US,CA,AU,PR,NZ} → Openmart (sync, ~1s) first, then Google Maps Scraper (async, ~30–120s) as fallback or for global coverage. Use provider="openmart"|"google_maps" to pin to one. Cost: 1 credit per place returned (both providers).';
|
|
5
|
+
export const searchPlacesSchema = {
|
|
6
|
+
query: z.string().optional().describe('Free-text query (e.g. "coffee shops in Brooklyn", "law firm New York"). Used by both providers.'),
|
|
7
|
+
country: z.string().optional().describe('ISO country code. Openmart accepts US/CA/AU/PR/NZ only — outside this set, routes to Google Maps. Auto-cased per provider.'),
|
|
8
|
+
city: z.string().optional().describe('City name. Used by both providers.'),
|
|
9
|
+
limit: z.number().int().min(1).max(200).default(25).describe('Max places per provider call (1–200). Openmart caps at 500 internally; Google Maps at 200. Default 25.'),
|
|
10
|
+
provider: z.enum(['openmart', 'google_maps']).optional().describe('Pin to one provider; skips the other. Useful for explicit cross-provider comparison via separate calls.'),
|
|
11
|
+
state: z.string().optional().describe('Openmart only. State name or 2-letter code.'),
|
|
12
|
+
zip_code: z.string().optional().describe('Openmart only.'),
|
|
13
|
+
lat: z.number().optional().describe('Openmart only. Latitude for radius search.'),
|
|
14
|
+
long: z.number().optional().describe('Openmart only. Longitude for radius search.'),
|
|
15
|
+
geo_radius: z.number().int().positive().optional().describe('Openmart only. Search radius in meters around lat/long.'),
|
|
16
|
+
tags: z.array(z.string()).max(100).optional().describe('Openmart only. Category tags (mutually exclusive with query upstream — query is ignored if tags non-empty).'),
|
|
17
|
+
min_overall_rating: z.number().min(0).max(5).optional().describe('Openmart only.'),
|
|
18
|
+
max_overall_rating: z.number().min(0).max(5).optional().describe('Openmart only.'),
|
|
19
|
+
min_total_reviews: z.number().int().min(0).optional().describe('Openmart only.'),
|
|
20
|
+
max_total_reviews: z.number().int().min(0).optional().describe('Openmart only.'),
|
|
21
|
+
ownership_type: z.enum(['INDEPENDENT', 'FAMILY', 'FRANCHISE', 'CHAIN']).optional().describe('Openmart only.'),
|
|
22
|
+
has_website: z.boolean().optional().describe('Openmart only.'),
|
|
23
|
+
has_valid_website: z.boolean().optional().describe('Openmart only.'),
|
|
24
|
+
has_contact_info: z.boolean().optional().describe('Openmart only.'),
|
|
25
|
+
min_price_tier: z.number().int().optional().describe('Openmart only. 1–4 (1=$, 4=$$$$).'),
|
|
26
|
+
max_price_tier: z.number().int().optional().describe('Openmart only.'),
|
|
27
|
+
include_keywords: z.array(z.string()).max(64).optional().describe('Openmart only. Free-text terms that must appear in result fields.'),
|
|
28
|
+
exclude_keywords: z.array(z.string()).max(64).optional().describe('Openmart only.'),
|
|
29
|
+
exclude_root_domains: z.array(z.string()).max(10000).optional().describe('Openmart only. Skip results whose website root domain is in this list.'),
|
|
30
|
+
start_urls: z.array(z.string().url()).max(10).optional().describe('Google Maps only. Pre-built google.com/maps URLs (place/search/reviews). Routes to Google Maps only. 1–10 URLs.'),
|
|
31
|
+
include_opening_hours: z.boolean().optional().describe('Google Maps only. Routes to Google Maps only when set.'),
|
|
32
|
+
include_additional_info: z.boolean().optional().describe('Google Maps only. Adds amenities/accessibility fields. Routes to Google Maps only when set.'),
|
|
33
|
+
language: z.string().optional().describe('Google Maps only. ISO 639-1 (e.g. "en", "fr"). Routes to Google Maps only when set.'),
|
|
34
|
+
};
|
|
35
|
+
export async function searchPlacesHandler(input) {
|
|
36
|
+
const result = await executeWithFallback('search_places', input);
|
|
37
|
+
if (isExecutionError(result)) {
|
|
38
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], isError: true };
|
|
39
|
+
}
|
|
40
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=search-places.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-places.js","sourceRoot":"","sources":["../../src/tools/search-places.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBA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CAAA;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,KAA8B;IACtE,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,eAAe,EAAE,KAAK,CAAC,CAAA;IAChE,IAAI,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IACvG,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;AACxF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const searchRedditName = "search_reddit";
|
|
3
|
+
export declare const searchRedditDescription = "Scrape Reddit posts and comments via 1 provider (Reddit Scraper). Requires at least one subreddit or post URL. Optionally filter by keyword query within those URLs. Supports sorting, time filters, comment inclusion. Async (~30\u2013120s). Cost: 1 credit per item returned.";
|
|
4
|
+
export declare const searchRedditSchema: {
|
|
5
|
+
start_urls: z.ZodArray<z.ZodString, "many">;
|
|
6
|
+
query: z.ZodOptional<z.ZodString>;
|
|
7
|
+
type: z.ZodDefault<z.ZodEnum<["posts", "comments"]>>;
|
|
8
|
+
sort: z.ZodOptional<z.ZodEnum<["relevance", "hot", "top", "new", "comments"]>>;
|
|
9
|
+
time: z.ZodOptional<z.ZodEnum<["hour", "day", "week", "month", "year", "all"]>>;
|
|
10
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
max_comments_per_post: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
include_comments: z.ZodOptional<z.ZodBoolean>;
|
|
13
|
+
};
|
|
14
|
+
export declare function searchRedditHandler(input: Record<string, unknown>): Promise<{
|
|
15
|
+
content: {
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}[];
|
|
19
|
+
isError: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
isError?: undefined;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=search-reddit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-reddit.d.ts","sourceRoot":"","sources":["../../src/tools/search-reddit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,gBAAgB,kBAAkB,CAAA;AAE/C,eAAO,MAAM,uBAAuB,qRAC2O,CAAA;AAE/Q,eAAO,MAAM,kBAAkB;;;;;;;;;CAiB9B,CAAA;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;GAMvE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeWithFallback, isExecutionError } from '../executor.js';
|
|
3
|
+
export const searchRedditName = 'search_reddit';
|
|
4
|
+
export const searchRedditDescription = 'Scrape Reddit posts and comments via 1 provider (Reddit Scraper). Requires at least one subreddit or post URL. Optionally filter by keyword query within those URLs. Supports sorting, time filters, comment inclusion. Async (~30–120s). Cost: 1 credit per item returned.';
|
|
5
|
+
export const searchRedditSchema = {
|
|
6
|
+
start_urls: z.array(z.string().url()).min(1).max(25)
|
|
7
|
+
.describe('Reddit URLs to scrape (subreddit, post, or search URL). At least 1 required. Up to 25. Example: ["https://www.reddit.com/r/sales/"]'),
|
|
8
|
+
query: z.string().optional()
|
|
9
|
+
.describe('Optional keyword filter applied within the provided URLs e.g. "best CRM for startups".'),
|
|
10
|
+
type: z.enum(['posts', 'comments']).default('posts')
|
|
11
|
+
.describe('Scrape posts or comments.'),
|
|
12
|
+
sort: z.enum(['relevance', 'hot', 'top', 'new', 'comments']).optional()
|
|
13
|
+
.describe('Sort order for results.'),
|
|
14
|
+
time: z.enum(['hour', 'day', 'week', 'month', 'year', 'all']).optional()
|
|
15
|
+
.describe('Time filter.'),
|
|
16
|
+
limit: z.number().int().min(1).max(200).default(10)
|
|
17
|
+
.describe('Max items to return (1–200). 1 credit per item.'),
|
|
18
|
+
max_comments_per_post: z.number().int().min(1).max(1000).optional()
|
|
19
|
+
.describe('Max comments per post when type=comments.'),
|
|
20
|
+
include_comments: z.boolean().optional()
|
|
21
|
+
.describe('Include comments alongside posts.'),
|
|
22
|
+
};
|
|
23
|
+
export async function searchRedditHandler(input) {
|
|
24
|
+
const result = await executeWithFallback('search_reddit', input);
|
|
25
|
+
if (isExecutionError(result)) {
|
|
26
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], isError: true };
|
|
27
|
+
}
|
|
28
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=search-reddit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-reddit.js","sourceRoot":"","sources":["../../src/tools/search-reddit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAA;AAE/C,MAAM,CAAC,MAAM,uBAAuB,GAClC,6QAA6Q,CAAA;AAE/Q,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,C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