@decodo/mcp-server 1.0.3 → 1.1.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/README.md +93 -34
- package/build/clients/scraper-api-client.js +78 -16
- package/build/clients/scraper-api-client.js.map +1 -1
- package/build/constants.js +35 -1
- package/build/constants.js.map +1 -1
- package/build/index.js +11 -11
- package/build/index.js.map +1 -1
- package/build/server/sapi-base-server.js +76 -0
- package/build/server/sapi-base-server.js.map +1 -0
- package/build/server/sapi-http-server.js +11 -0
- package/build/server/sapi-http-server.js.map +1 -0
- package/build/server/sapi-stdio-server.js +11 -0
- package/build/server/sapi-stdio-server.js.map +1 -0
- package/build/server.js +53 -0
- package/build/server.js.map +1 -0
- package/build/tools/amazon-bestsellers/amazon-bestsellers-tool.js +55 -0
- package/build/tools/amazon-bestsellers/amazon-bestsellers-tool.js.map +1 -0
- package/build/tools/amazon-bestsellers/index.js +18 -0
- package/build/tools/amazon-bestsellers/index.js.map +1 -0
- package/build/tools/amazon-pricing/amazon-pricing-tool.js +67 -0
- package/build/tools/amazon-pricing/amazon-pricing-tool.js.map +1 -0
- package/build/tools/amazon-pricing/index.js +18 -0
- package/build/tools/amazon-pricing/index.js.map +1 -0
- package/build/tools/amazon-product/amazon-product-tool.js +62 -0
- package/build/tools/amazon-product/amazon-product-tool.js.map +1 -0
- package/build/tools/amazon-product/index.js +18 -0
- package/build/tools/amazon-product/index.js.map +1 -0
- package/build/tools/amazon-search/amazon-search-tool.js +63 -0
- package/build/tools/amazon-search/amazon-search-tool.js.map +1 -0
- package/build/tools/amazon-search/index.js +18 -0
- package/build/tools/amazon-search/index.js.map +1 -0
- package/build/tools/amazon-sellers/amazon-sellers-tool.js +56 -0
- package/build/tools/amazon-sellers/amazon-sellers-tool.js.map +1 -0
- package/build/tools/amazon-sellers/index.js +18 -0
- package/build/tools/amazon-sellers/index.js.map +1 -0
- package/build/tools/bing-search/bing-search-tool.js +64 -0
- package/build/tools/bing-search/bing-search-tool.js.map +1 -0
- package/build/tools/bing-search/index.js +18 -0
- package/build/tools/bing-search/index.js.map +1 -0
- package/build/tools/chatgpt/chatgpt-tool.js +47 -0
- package/build/tools/chatgpt/chatgpt-tool.js.map +1 -0
- package/build/tools/chatgpt/index.js +18 -0
- package/build/tools/chatgpt/index.js.map +1 -0
- package/build/tools/google-ads/google-ads-tool.js +59 -0
- package/build/tools/google-ads/google-ads-tool.js.map +1 -0
- package/build/tools/google-ads/index.js +18 -0
- package/build/tools/google-ads/index.js.map +1 -0
- package/build/tools/google-ai-mode/google-ai-mode-tool.js +50 -0
- package/build/tools/google-ai-mode/google-ai-mode-tool.js.map +1 -0
- package/build/tools/google-ai-mode/index.js +18 -0
- package/build/tools/google-ai-mode/index.js.map +1 -0
- package/build/tools/google-lens/google-lens-tool.js +52 -0
- package/build/tools/google-lens/google-lens-tool.js.map +1 -0
- package/build/tools/google-lens/index.js +18 -0
- package/build/tools/google-lens/index.js.map +1 -0
- package/build/tools/google-search/google-search-tool.js +60 -0
- package/build/tools/google-search/google-search-tool.js.map +1 -0
- package/build/tools/google-search/index.js +18 -0
- package/build/tools/google-search/index.js.map +1 -0
- package/build/tools/google-travel-hotels/google-travel-hotels-tool.js +52 -0
- package/build/tools/google-travel-hotels/google-travel-hotels-tool.js.map +1 -0
- package/build/tools/google-travel-hotels/index.js +18 -0
- package/build/tools/google-travel-hotels/index.js.map +1 -0
- package/build/tools/index.js +30 -5
- package/build/tools/index.js.map +1 -1
- package/build/tools/perplexity/index.js +18 -0
- package/build/tools/perplexity/index.js.map +1 -0
- package/build/tools/perplexity/perplexity-tool.js +46 -0
- package/build/tools/perplexity/perplexity-tool.js.map +1 -0
- package/build/tools/reddit-post/index.js +18 -0
- package/build/tools/reddit-post/index.js.map +1 -0
- package/build/tools/reddit-post/reddit-post-tool.js +51 -0
- package/build/tools/reddit-post/reddit-post-tool.js.map +1 -0
- package/build/tools/reddit-subreddit/index.js +18 -0
- package/build/tools/reddit-subreddit/index.js.map +1 -0
- package/build/tools/reddit-subreddit/reddit-subreddit-tool.js +49 -0
- package/build/tools/reddit-subreddit/reddit-subreddit-tool.js.map +1 -0
- package/build/tools/reddit-user/index.js +18 -0
- package/build/tools/reddit-user/index.js.map +1 -0
- package/build/tools/reddit-user/reddit-user-tool.js +55 -0
- package/build/tools/reddit-user/reddit-user-tool.js.map +1 -0
- package/build/tools/scrape-as-markdown/index.js +18 -0
- package/build/tools/scrape-as-markdown/index.js.map +1 -0
- package/build/tools/scrape-as-markdown/scrape-as-markdown-tool.js +79 -0
- package/build/tools/scrape-as-markdown/scrape-as-markdown-tool.js.map +1 -0
- package/build/tools/screenshot/index.js +18 -0
- package/build/tools/screenshot/index.js.map +1 -0
- package/build/tools/screenshot/screenshot-tool.js +48 -0
- package/build/tools/screenshot/screenshot-tool.js.map +1 -0
- package/build/tools/target-product/index.js +18 -0
- package/build/tools/target-product/index.js.map +1 -0
- package/build/tools/target-product/target-product-tool.js +50 -0
- package/build/tools/target-product/target-product-tool.js.map +1 -0
- package/build/tools/target-search/index.js +18 -0
- package/build/tools/target-search/index.js.map +1 -0
- package/build/tools/target-search/target-search-tool.js +56 -0
- package/build/tools/target-search/target-search-tool.js.map +1 -0
- package/build/tools/tiktok-post/index.js +18 -0
- package/build/tools/tiktok-post/index.js.map +1 -0
- package/build/tools/tiktok-post/tiktok-post-tool.js +48 -0
- package/build/tools/tiktok-post/tiktok-post-tool.js.map +1 -0
- package/build/tools/tiktok-shop-product/index.js +18 -0
- package/build/tools/tiktok-shop-product/index.js.map +1 -0
- package/build/tools/tiktok-shop-product/tiktok-shop-product-tool.js +47 -0
- package/build/tools/tiktok-shop-product/tiktok-shop-product-tool.js.map +1 -0
- package/build/tools/tiktok-shop-search/index.js +18 -0
- package/build/tools/tiktok-shop-search/index.js.map +1 -0
- package/build/tools/tiktok-shop-search/tiktok-shop-search-tool.js +54 -0
- package/build/tools/tiktok-shop-search/tiktok-shop-search-tool.js.map +1 -0
- package/build/tools/tiktok-shop-url/index.js +18 -0
- package/build/tools/tiktok-shop-url/index.js.map +1 -0
- package/build/tools/tiktok-shop-url/tiktok-shop-url-tool.js +45 -0
- package/build/tools/tiktok-shop-url/tiktok-shop-url-tool.js.map +1 -0
- package/build/tools/tool.js +7 -0
- package/build/tools/tool.js.map +1 -0
- package/build/tools/walmart-product/index.js +18 -0
- package/build/tools/walmart-product/index.js.map +1 -0
- package/build/tools/walmart-product/walmart-product-tool.js +61 -0
- package/build/tools/walmart-product/walmart-product-tool.js.map +1 -0
- package/build/tools/walmart-search/index.js +18 -0
- package/build/tools/walmart-search/index.js.map +1 -0
- package/build/tools/walmart-search/walmart-search-tool.js +62 -0
- package/build/tools/walmart-search/walmart-search-tool.js.map +1 -0
- package/build/tools/youtube-channel/index.js +18 -0
- package/build/tools/youtube-channel/index.js.map +1 -0
- package/build/tools/youtube-channel/youtube-channel-tool.js +48 -0
- package/build/tools/youtube-channel/youtube-channel-tool.js.map +1 -0
- package/build/tools/youtube-metadata/index.js +18 -0
- package/build/tools/youtube-metadata/index.js.map +1 -0
- package/build/tools/youtube-metadata/youtube-metadata-tool.js +43 -0
- package/build/tools/youtube-metadata/youtube-metadata-tool.js.map +1 -0
- package/build/tools/youtube-search/index.js +18 -0
- package/build/tools/youtube-search/index.js.map +1 -0
- package/build/tools/youtube-search/youtube-search-tool.js +43 -0
- package/build/tools/youtube-search/youtube-search-tool.js.map +1 -0
- package/build/tools/youtube-subtitles/index.js +18 -0
- package/build/tools/youtube-subtitles/index.js.map +1 -0
- package/build/tools/youtube-subtitles/youtube-subtitles-tool.js +48 -0
- package/build/tools/youtube-subtitles/youtube-subtitles-tool.js.map +1 -0
- package/build/utils.js +14 -3
- package/build/utils.js.map +1 -1
- package/build/zod/zod-types.js +12 -4
- package/build/zod/zod-types.js.map +1 -1
- package/package.json +37 -12
- package/build/sapi-mcp-server.js +0 -40
- package/build/sapi-mcp-server.js.map +0 -1
- package/build/tools/amazon-search-parsed-tool.js +0 -46
- package/build/tools/amazon-search-parsed-tool.js.map +0 -1
- package/build/tools/google-search-parsed-tool.js +0 -54
- package/build/tools/google-search-parsed-tool.js.map +0 -1
- package/build/tools/reddit-post-tool.js +0 -34
- package/build/tools/reddit-post-tool.js.map +0 -1
- package/build/tools/reddit-subreddit-tool.js +0 -34
- package/build/tools/reddit-subreddit-tool.js.map +0 -1
- package/build/tools/scrape-as-markdown-tool.js +0 -70
- package/build/tools/scrape-as-markdown-tool.js.map +0 -1
- package/build/tools/scrape-tool.js +0 -70
- package/build/tools/scrape-tool.js.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TiktokShopProductTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const zod_types_1 = require("../../zod/zod-types");
|
|
10
|
+
const tool_1 = require("../tool");
|
|
11
|
+
class TiktokShopProductTool extends tool_1.Tool {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.toolset = constants_1.TOOLSET.ECOMMERCE;
|
|
15
|
+
this.transformResponse = ({ data }) => {
|
|
16
|
+
return { data: JSON.stringify(data) };
|
|
17
|
+
};
|
|
18
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
19
|
+
server.registerTool('tiktok_shop_product', {
|
|
20
|
+
description: 'Scrape TikTok Shop Product page',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
product_id: zod_1.default.string().describe('TikTok Shop product ID (e.g., "1731541214379741272")'),
|
|
23
|
+
jsRender: zod_types_1.zodJsRender,
|
|
24
|
+
deviceType: zod_types_1.zodDeviceType,
|
|
25
|
+
country: zod_types_1.zodCountry,
|
|
26
|
+
},
|
|
27
|
+
annotations: {
|
|
28
|
+
readOnlyHint: true,
|
|
29
|
+
openWorldHint: true,
|
|
30
|
+
},
|
|
31
|
+
}, async (scrapingParams) => {
|
|
32
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.TIKTOK_SHOP_PRODUCT, markdown: true });
|
|
33
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: 'text',
|
|
38
|
+
text: JSON.stringify(data),
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.TiktokShopProductTool = TiktokShopProductTool;
|
|
47
|
+
//# sourceMappingURL=tiktok-shop-product-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiktok-shop-product-tool.js","sourceRoot":"","sources":["../../../src/tools/tiktok-shop-product/tiktok-shop-product-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,mDAA6E;AAC7E,kCAAqD;AAErD,MAAa,qBAAsB,SAAQ,WAAI;IAA/C;;QACE,YAAO,GAAG,mBAAO,CAAC,SAAS,CAAC;QAE5B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;gBACE,WAAW,EAAE,iCAAiC;gBAC9C,WAAW,EAAE;oBACX,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;oBACvF,QAAQ,EAAE,uBAAW;oBACrB,UAAU,EAAE,yBAAa;oBACzB,OAAO,EAAE,sBAAU;iBACpB;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,mBAAmB,EAC/C,QAAQ,EAAE,IAAI,GACY,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;yBAC3B;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AA3CD,sDA2CC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./tiktok-shop-search-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/tiktok-shop-search/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TiktokShopSearchTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const zod_types_1 = require("../../zod/zod-types");
|
|
11
|
+
const tool_1 = require("../tool");
|
|
12
|
+
class TiktokShopSearchTool extends tool_1.Tool {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.toolset = constants_1.TOOLSET.ECOMMERCE;
|
|
16
|
+
this.transformResponse = ({ data }) => {
|
|
17
|
+
for (const fieldToRemove of TiktokShopSearchTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
|
|
18
|
+
data = (0, utils_1.removeKeyFromNestedObject)({ obj: data, keyToRemove: fieldToRemove });
|
|
19
|
+
}
|
|
20
|
+
return { data: JSON.stringify(data) };
|
|
21
|
+
};
|
|
22
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
23
|
+
server.registerTool('tiktok_shop_search', {
|
|
24
|
+
description: 'Scrape TikTok Shop Search results with automatic parsing',
|
|
25
|
+
inputSchema: {
|
|
26
|
+
query: zod_1.default.string().describe('Search query for TikTok Shop products'),
|
|
27
|
+
geo: zod_types_1.zodGeo,
|
|
28
|
+
jsRender: zod_types_1.zodJsRender,
|
|
29
|
+
country: zod_types_1.zodCountry,
|
|
30
|
+
deviceType: zod_types_1.zodDeviceType,
|
|
31
|
+
},
|
|
32
|
+
annotations: {
|
|
33
|
+
readOnlyHint: true,
|
|
34
|
+
openWorldHint: true,
|
|
35
|
+
},
|
|
36
|
+
}, async (scrapingParams) => {
|
|
37
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.TIKTOK_SHOP_SEARCH, markdown: true });
|
|
38
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
39
|
+
const { data: text } = this.transformResponse({ data });
|
|
40
|
+
return {
|
|
41
|
+
content: [
|
|
42
|
+
{
|
|
43
|
+
type: 'text',
|
|
44
|
+
text,
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.TiktokShopSearchTool = TiktokShopSearchTool;
|
|
53
|
+
TiktokShopSearchTool.FIELDS_WITH_HIGH_CHAR_COUNT = ['suggested', 'refinements'];
|
|
54
|
+
//# sourceMappingURL=tiktok-shop-search-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiktok-shop-search-tool.js","sourceRoot":"","sources":["../../../src/tools/tiktok-shop-search/tiktok-shop-search-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,uCAAwD;AACxD,mDAAqF;AACrF,kCAAqD;AAErD,MAAa,oBAAqB,SAAQ,WAAI;IAA9C;;QACE,YAAO,GAAG,mBAAO,CAAC,SAAS,CAAC;QAI5B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,KAAK,MAAM,aAAa,IAAI,oBAAoB,CAAC,2BAA2B,EAAE,CAAC;gBAC7E,IAAI,GAAG,IAAA,iCAAyB,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;YAC9E,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;gBACE,WAAW,EAAE,0DAA0D;gBACvE,WAAW,EAAE;oBACX,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;oBACnE,GAAG,EAAE,kBAAM;oBACX,QAAQ,EAAE,uBAAW;oBACrB,OAAO,EAAE,sBAAU;oBACnB,UAAU,EAAE,yBAAa;iBAC1B;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,kBAAkB,EAC9C,QAAQ,EAAE,IAAI,GACY,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBAExD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI;yBACL;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;;AApDD,oDAoDC;AAjDgB,gDAA2B,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,AAA/B,CAAgC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./tiktok-shop-url-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/tiktok-shop-url/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TiktokShopUrlTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const zod_types_1 = require("../../zod/zod-types");
|
|
10
|
+
const tool_1 = require("../tool");
|
|
11
|
+
class TiktokShopUrlTool extends tool_1.Tool {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.toolset = constants_1.TOOLSET.ECOMMERCE;
|
|
15
|
+
this.transformResponse = ({ data }) => {
|
|
16
|
+
return { data: JSON.stringify(data) };
|
|
17
|
+
};
|
|
18
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
19
|
+
server.registerTool('tiktok_shop_url', {
|
|
20
|
+
description: 'Scrape TikTok Shop page by URL',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
url: zod_1.default.string().describe('TikTok Shop URL (e.g., "https://www.tiktok.com/shop/s?q=HEADPHONES")'),
|
|
23
|
+
jsRender: zod_types_1.zodJsRender,
|
|
24
|
+
},
|
|
25
|
+
annotations: {
|
|
26
|
+
readOnlyHint: true,
|
|
27
|
+
openWorldHint: true,
|
|
28
|
+
},
|
|
29
|
+
}, async (scrapingParams) => {
|
|
30
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.TIKTOK_SHOP_URL });
|
|
31
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: 'text',
|
|
36
|
+
text: JSON.stringify(data),
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.TiktokShopUrlTool = TiktokShopUrlTool;
|
|
45
|
+
//# sourceMappingURL=tiktok-shop-url-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiktok-shop-url-tool.js","sourceRoot":"","sources":["../../../src/tools/tiktok-shop-url/tiktok-shop-url-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,mDAAkD;AAClD,kCAAqD;AAErD,MAAa,iBAAkB,SAAQ,WAAI;IAA3C;;QACE,YAAO,GAAG,mBAAO,CAAC,SAAS,CAAC;QAE5B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;gBACE,WAAW,EAAE,gCAAgC;gBAC7C,WAAW,EAAE;oBACX,GAAG,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;oBAChG,QAAQ,EAAE,uBAAW;iBACtB;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,eAAe,GACjB,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;yBAC3B;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AAxCD,8CAwCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../src/tools/tool.ts"],"names":[],"mappings":";;;AAUA,MAAsB,IAAI;CAYzB;AAZD,oBAYC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./walmart-product-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/walmart-product/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WalmartProductTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const zod_types_1 = require("../../zod/zod-types");
|
|
11
|
+
const tool_1 = require("../tool");
|
|
12
|
+
const zodDeliveryZip = zod_1.default
|
|
13
|
+
.string()
|
|
14
|
+
.describe('ZIP code for delivery location')
|
|
15
|
+
.optional();
|
|
16
|
+
const zodStoreId = zod_1.default
|
|
17
|
+
.string()
|
|
18
|
+
.describe('Walmart store ID for local inventory')
|
|
19
|
+
.optional();
|
|
20
|
+
class WalmartProductTool extends tool_1.Tool {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.toolset = constants_1.TOOLSET.ECOMMERCE;
|
|
24
|
+
this.transformResponse = ({ data }) => {
|
|
25
|
+
for (const fieldToRemove of WalmartProductTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
|
|
26
|
+
data = (0, utils_1.removeKeyFromNestedObject)({ obj: data, keyToRemove: fieldToRemove });
|
|
27
|
+
}
|
|
28
|
+
return { data: JSON.stringify(data) };
|
|
29
|
+
};
|
|
30
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
31
|
+
server.registerTool('walmart_product', {
|
|
32
|
+
description: 'Scrape Walmart Product page with automatic parsing',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
product_id: zod_1.default.string().describe('Walmart product ID (e.g., "15296401808")'),
|
|
35
|
+
jsRender: zod_types_1.zodJsRender,
|
|
36
|
+
deliveryZip: zodDeliveryZip,
|
|
37
|
+
storeId: zodStoreId,
|
|
38
|
+
},
|
|
39
|
+
annotations: {
|
|
40
|
+
readOnlyHint: true,
|
|
41
|
+
openWorldHint: true,
|
|
42
|
+
},
|
|
43
|
+
}, async (scrapingParams) => {
|
|
44
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.WALMART_PRODUCT, parse: true });
|
|
45
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
46
|
+
const { data: text } = this.transformResponse({ data });
|
|
47
|
+
return {
|
|
48
|
+
content: [
|
|
49
|
+
{
|
|
50
|
+
type: 'text',
|
|
51
|
+
text,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.WalmartProductTool = WalmartProductTool;
|
|
60
|
+
WalmartProductTool.FIELDS_WITH_HIGH_CHAR_COUNT = ['specifications', 'breadcrumbs'];
|
|
61
|
+
//# sourceMappingURL=walmart-product-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walmart-product-tool.js","sourceRoot":"","sources":["../../../src/tools/walmart-product/walmart-product-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,uCAAwD;AACxD,mDAAkD;AAClD,kCAAqD;AAErD,MAAM,cAAc,GAAG,aAAC;KACrB,MAAM,EAAE;KACR,QAAQ,CAAC,gCAAgC,CAAC;KAC1C,QAAQ,EAAE,CAAC;AAEd,MAAM,UAAU,GAAG,aAAC;KACjB,MAAM,EAAE;KACR,QAAQ,CAAC,sCAAsC,CAAC;KAChD,QAAQ,EAAE,CAAC;AAEd,MAAa,kBAAmB,SAAQ,WAAI;IAA5C;;QACE,YAAO,GAAG,mBAAO,CAAC,SAAS,CAAC;QAI5B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,KAAK,MAAM,aAAa,IAAI,kBAAkB,CAAC,2BAA2B,EAAE,CAAC;gBAC3E,IAAI,GAAG,IAAA,iCAAyB,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;YAC9E,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;gBACE,WAAW,EAAE,oDAAoD;gBACjE,WAAW,EAAE;oBACX,UAAU,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;oBAC3E,QAAQ,EAAE,uBAAW;oBACrB,WAAW,EAAE,cAAc;oBAC3B,OAAO,EAAE,UAAU;iBACpB;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,eAAe,EAC3C,KAAK,EAAE,IAAI,GACe,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBAExD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI;yBACL;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;;AAnDD,gDAmDC;AAhDgB,8CAA2B,GAAG,CAAC,gBAAgB,EAAE,aAAa,CAAC,AAApC,CAAqC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./walmart-search-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/walmart-search/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WalmartSearchTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const zod_types_1 = require("../../zod/zod-types");
|
|
11
|
+
const tool_1 = require("../tool");
|
|
12
|
+
const zodDeliveryZip = zod_1.default
|
|
13
|
+
.string()
|
|
14
|
+
.describe('ZIP code for delivery location')
|
|
15
|
+
.optional();
|
|
16
|
+
const zodWalmartStoreId = zod_1.default
|
|
17
|
+
.string()
|
|
18
|
+
.describe('Walmart store ID for local inventory')
|
|
19
|
+
.optional();
|
|
20
|
+
class WalmartSearchTool extends tool_1.Tool {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.toolset = constants_1.TOOLSET.ECOMMERCE;
|
|
24
|
+
this.transformResponse = ({ data }) => {
|
|
25
|
+
for (const fieldToRemove of WalmartSearchTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
|
|
26
|
+
data = (0, utils_1.removeKeyFromNestedObject)({ obj: data, keyToRemove: fieldToRemove });
|
|
27
|
+
}
|
|
28
|
+
return { data: JSON.stringify(data) };
|
|
29
|
+
};
|
|
30
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
31
|
+
server.registerTool('walmart_search', {
|
|
32
|
+
description: 'Scrape Walmart Search results with automatic parsing',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
query: zod_1.default.string().describe('Search query for Walmart products (e.g., "camping tent")'),
|
|
35
|
+
jsRender: zod_types_1.zodJsRender,
|
|
36
|
+
deviceType: zod_types_1.zodDeviceType,
|
|
37
|
+
deliveryZip: zodDeliveryZip,
|
|
38
|
+
storeId: zodWalmartStoreId,
|
|
39
|
+
},
|
|
40
|
+
annotations: {
|
|
41
|
+
readOnlyHint: true,
|
|
42
|
+
openWorldHint: true,
|
|
43
|
+
},
|
|
44
|
+
}, async (scrapingParams) => {
|
|
45
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.WALMART_SEARCH, markdown: true });
|
|
46
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
47
|
+
const { data: text } = this.transformResponse({ data });
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{
|
|
51
|
+
type: 'text',
|
|
52
|
+
text,
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.WalmartSearchTool = WalmartSearchTool;
|
|
61
|
+
WalmartSearchTool.FIELDS_WITH_HIGH_CHAR_COUNT = ['suggested', 'refinements'];
|
|
62
|
+
//# sourceMappingURL=walmart-search-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walmart-search-tool.js","sourceRoot":"","sources":["../../../src/tools/walmart-search/walmart-search-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,uCAAwD;AACxD,mDAAiE;AACjE,kCAAqD;AAErD,MAAM,cAAc,GAAG,aAAC;KACrB,MAAM,EAAE;KACR,QAAQ,CAAC,gCAAgC,CAAC;KAC1C,QAAQ,EAAE,CAAC;AAEd,MAAM,iBAAiB,GAAG,aAAC;KACxB,MAAM,EAAE;KACR,QAAQ,CAAC,sCAAsC,CAAC;KAChD,QAAQ,EAAE,CAAC;AAEd,MAAa,iBAAkB,SAAQ,WAAI;IAA3C;;QACE,YAAO,GAAG,mBAAO,CAAC,SAAS,CAAC;QAI5B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,KAAK,MAAM,aAAa,IAAI,iBAAiB,CAAC,2BAA2B,EAAE,CAAC;gBAC1E,IAAI,GAAG,IAAA,iCAAyB,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;YAC9E,CAAC;YAED,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;gBACE,WAAW,EAAE,sDAAsD;gBACnE,WAAW,EAAE;oBACX,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;oBACtF,QAAQ,EAAE,uBAAW;oBACrB,UAAU,EAAE,yBAAa;oBACzB,WAAW,EAAE,cAAc;oBAC3B,OAAO,EAAE,iBAAiB;iBAC3B;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,cAAc,EAC1C,QAAQ,EAAE,IAAI,GACY,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBAExD,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI;yBACL;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;;AApDD,8CAoDC;AAjDgB,6CAA2B,GAAG,CAAC,WAAW,EAAE,aAAa,CAAC,AAA/B,CAAgC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./youtube-channel-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/youtube-channel/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.YoutubeChannelTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const tool_1 = require("../tool");
|
|
10
|
+
const zodLimit = zod_1.default
|
|
11
|
+
.number()
|
|
12
|
+
.describe('Maximum number of videos to return')
|
|
13
|
+
.optional();
|
|
14
|
+
class YoutubeChannelTool extends tool_1.Tool {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.toolset = constants_1.TOOLSET.SOCIAL_MEDIA;
|
|
18
|
+
this.transformResponse = ({ data }) => {
|
|
19
|
+
return { data: JSON.stringify(data) };
|
|
20
|
+
};
|
|
21
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
22
|
+
server.registerTool('youtube_channel', {
|
|
23
|
+
description: 'Scrape YouTube channel videos with automatic parsing',
|
|
24
|
+
inputSchema: {
|
|
25
|
+
query: zod_1.default.string().describe('YouTube channel handle or ID (e.g., "@decodo_official")'),
|
|
26
|
+
limit: zodLimit,
|
|
27
|
+
},
|
|
28
|
+
annotations: {
|
|
29
|
+
readOnlyHint: true,
|
|
30
|
+
openWorldHint: true,
|
|
31
|
+
},
|
|
32
|
+
}, async (scrapingParams) => {
|
|
33
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.YOUTUBE_CHANNEL, parse: true });
|
|
34
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
35
|
+
return {
|
|
36
|
+
content: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: JSON.stringify(data),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.YoutubeChannelTool = YoutubeChannelTool;
|
|
48
|
+
//# sourceMappingURL=youtube-channel-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"youtube-channel-tool.js","sourceRoot":"","sources":["../../../src/tools/youtube-channel/youtube-channel-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,kCAAqD;AAErD,MAAM,QAAQ,GAAG,aAAC;KACf,MAAM,EAAE;KACR,QAAQ,CAAC,oCAAoC,CAAC;KAC9C,QAAQ,EAAE,CAAC;AAEd,MAAa,kBAAmB,SAAQ,WAAI;IAA5C;;QACE,YAAO,GAAG,mBAAO,CAAC,YAAY,CAAC;QAE/B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;gBACE,WAAW,EAAE,sDAAsD;gBACnE,WAAW,EAAE;oBACX,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;oBACrF,KAAK,EAAE,QAAQ;iBAChB;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,eAAe,EAC3C,KAAK,EAAE,IAAI,GACe,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;yBAC3B;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AAzCD,gDAyCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./youtube-metadata-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/youtube-metadata/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.YoutubeMetadataTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const tool_1 = require("../tool");
|
|
10
|
+
class YoutubeMetadataTool extends tool_1.Tool {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.toolset = constants_1.TOOLSET.SOCIAL_MEDIA;
|
|
14
|
+
this.transformResponse = ({ data }) => {
|
|
15
|
+
return { data: JSON.stringify(data) };
|
|
16
|
+
};
|
|
17
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
18
|
+
server.registerTool('youtube_metadata', {
|
|
19
|
+
description: 'Scrape YouTube video metadata',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
query: zod_1.default.string().describe('YouTube video ID (e.g., "dFu9aKJoqGg")'),
|
|
22
|
+
},
|
|
23
|
+
annotations: {
|
|
24
|
+
readOnlyHint: true,
|
|
25
|
+
openWorldHint: true,
|
|
26
|
+
},
|
|
27
|
+
}, async (scrapingParams) => {
|
|
28
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.YOUTUBE_METADATA });
|
|
29
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: JSON.stringify(data),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.YoutubeMetadataTool = YoutubeMetadataTool;
|
|
43
|
+
//# sourceMappingURL=youtube-metadata-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"youtube-metadata-tool.js","sourceRoot":"","sources":["../../../src/tools/youtube-metadata/youtube-metadata-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,kCAAqD;AAErD,MAAa,mBAAoB,SAAQ,WAAI;IAA7C;;QACE,YAAO,GAAG,mBAAO,CAAC,YAAY,CAAC;QAE/B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;gBACE,WAAW,EAAE,+BAA+B;gBAC5C,WAAW,EAAE;oBACX,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;iBACrE;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,gBAAgB,GAClB,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;yBAC3B;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AAvCD,kDAuCC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./youtube-search-tool"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/youtube-search/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.YoutubeSearchTool = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../../constants");
|
|
9
|
+
const tool_1 = require("../tool");
|
|
10
|
+
class YoutubeSearchTool extends tool_1.Tool {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.toolset = constants_1.TOOLSET.SOCIAL_MEDIA;
|
|
14
|
+
this.transformResponse = ({ data }) => {
|
|
15
|
+
return { data: JSON.stringify(data) };
|
|
16
|
+
};
|
|
17
|
+
this.register = ({ server, sapiClient, auth }) => {
|
|
18
|
+
server.registerTool('youtube_search', {
|
|
19
|
+
description: 'Search YouTube videos',
|
|
20
|
+
inputSchema: {
|
|
21
|
+
query: zod_1.default.string().describe('YouTube search query (e.g., "How to care for chinchillas")'),
|
|
22
|
+
},
|
|
23
|
+
annotations: {
|
|
24
|
+
readOnlyHint: true,
|
|
25
|
+
openWorldHint: true,
|
|
26
|
+
},
|
|
27
|
+
}, async (scrapingParams) => {
|
|
28
|
+
const params = Object.assign(Object.assign({}, scrapingParams), { target: constants_1.SCRAPER_API_TARGETS.YOUTUBE_SEARCH });
|
|
29
|
+
const { data } = await sapiClient.scrape({ auth, scrapingParams: params });
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{
|
|
33
|
+
type: 'text',
|
|
34
|
+
text: JSON.stringify(data),
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.YoutubeSearchTool = YoutubeSearchTool;
|
|
43
|
+
//# sourceMappingURL=youtube-search-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"youtube-search-tool.js","sourceRoot":"","sources":["../../../src/tools/youtube-search/youtube-search-tool.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAoB;AAEpB,+CAA+D;AAC/D,kCAAqD;AAErD,MAAa,iBAAkB,SAAQ,WAAI;IAA3C;;QACE,YAAO,GAAG,mBAAO,CAAC,YAAY,CAAC;QAE/B,sBAAiB,GAAG,CAAC,EAAE,IAAI,EAAoB,EAAE,EAAE;YACjD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC,CAAC;QAEF,aAAQ,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAwB,EAAE,EAAE;YAChE,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;gBACE,WAAW,EAAE,uBAAuB;gBACpC,WAAW,EAAE;oBACX,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;iBACzF;gBACD,WAAW,EAAE;oBACX,YAAY,EAAE,IAAI;oBAClB,aAAa,EAAE,IAAI;iBACpB;aACF,EACD,KAAK,EAAE,cAAiC,EAAE,EAAE;gBAC1C,MAAM,MAAM,GAAG,gCACV,cAAc,KACjB,MAAM,EAAE,+BAAmB,CAAC,cAAc,GAChB,CAAC;gBAE7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAC,MAAM,CAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC;gBAEnF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;yBAC3B;qBACF;iBACF,CAAC;YACJ,CAAC,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CAAA;AAvCD,8CAuCC"}
|