@tool-bridge/server 0.1.0 → 0.3.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/airtable-V6446SVY.js +792 -0
- package/dist/alt_text_generator_ai-HV7JZPDT.js +72 -0
- package/dist/amap-TTTVB6WS.js +755 -0
- package/dist/anthropic-JH3RA363.js +224 -0
- package/dist/apify-ETNN7ITU.js +262 -0
- package/dist/brave_search-3DDR2MMB.js +322 -0
- package/dist/chunk-CSJEZHQO.js +252 -0
- package/dist/chunk-JLTYA2B3.js +20121 -0
- package/dist/chunk-K7FVSFUX.js +333 -0
- package/dist/{chunk-6SMIQ6QU.js → chunk-KGYJEEBI.js} +2770 -21574
- package/dist/circleci-MX3TX3HC.js +409 -0
- package/dist/clerk-MRPORVF4.js +1036 -0
- package/dist/cloudflare_dns-OWP7DD7L.js +605 -0
- package/dist/cohere-GPECP66S.js +197 -0
- package/dist/confluence-BN7LZ6BC.js +436 -0
- package/dist/convertapi-SBEOFOFQ.js +161 -0
- package/dist/currencyapi-P2YY7Y7P.js +306 -0
- package/dist/deepseek-MWB3NYIN.js +205 -0
- package/dist/docker_hub-3JSCIGQ3.js +946 -0
- package/dist/dropbox-RFIBDAXO.js +1308 -0
- package/dist/dub-YVP57ELQ.js +706 -0
- package/dist/e2b-NFSUHTZR.js +305 -0
- package/dist/exa-KTDY6IV3.js +360 -0
- package/dist/fal_ai-OCUENLNQ.js +405 -0
- package/dist/feishu-5CWBQ7E5.js +225 -0
- package/dist/feishu_custom_bot-ZJR22OK6.js +240 -0
- package/dist/figma-YULGANSA.js +798 -0
- package/dist/firehydrant-2V6YSYAP.js +573 -0
- package/dist/fixer-LTCDB3CJ.js +171 -0
- package/dist/fly-IXPKMAML.js +478 -0
- package/dist/front-KRFB4M5X.js +379 -0
- package/dist/geocodio-VVURKYHQ.js +236 -0
- package/dist/ghost-6J2RIOUB.js +341 -0
- package/dist/github-5Z6KQRYH.js +5410 -0
- package/dist/gmail-KU4NZ7VA.js +1894 -0
- package/dist/googlecalendar-X44DFFXG.js +2539 -0
- package/dist/googledocs-WSGLPKSF.js +1322 -0
- package/dist/grafana-4PKSSDXY.js +817 -0
- package/dist/graphhopper-DF65ZNGK.js +336 -0
- package/dist/index.d.ts +181 -2
- package/dist/index.js +2 -1
- package/dist/ip2proxy-UCAQ5P2J.js +118 -0
- package/dist/ipgeolocation_io-UX6FCA2S.js +333 -0
- package/dist/ipqualityscore-MKTRXIZJ.js +287 -0
- package/dist/jina_ai-MRHPCSV5.js +119 -0
- package/dist/jira-EG7ZPOIW.js +627 -0
- package/dist/langsmith-FNO3RCOZ.js +597 -0
- package/dist/lemlist-SN6BJHSG.js +298 -0
- package/dist/linear-H3VU4PSD.js +2163 -0
- package/dist/logsnag-OY2JJT2H.js +167 -0
- package/dist/main.js +246 -2
- package/dist/mattermost-C5SQ7PGD.js +320 -0
- package/dist/mem0-LMLE5BFC.js +567 -0
- package/dist/memos-UWFAMBZC.js +781 -0
- package/dist/metabase-SRYDSDJ6.js +365 -0
- package/dist/mistral_ai-YNIJ7VDM.js +1195 -0
- package/dist/mother_duck-CPGOFEXE.js +322 -0
- package/dist/ngrok-CDJFBSOM.js +375 -0
- package/dist/notes-DIVFH3P3.js +109 -0
- package/dist/notion-HGDKS4HK.js +945 -0
- package/dist/open_exchange_rates-COHHYJDD.js +216 -0
- package/dist/openai-4TRT66GW.js +795 -0
- package/dist/opengraph_io-YKVW4PXI.js +377 -0
- package/dist/openrouter-6CV7B7V5.js +444 -0
- package/dist/outline-YWDUK5F7.js +604 -0
- package/dist/paddle-MEU7HWDZ.js +464 -0
- package/dist/perplexity-MRQUDBIC.js +238 -0
- package/dist/pinecone-JI7X2TAF.js +599 -0
- package/dist/pipedrive-6JQPAW23.js +453 -0
- package/dist/polar-7BF56CMC.js +400 -0
- package/dist/posthog-YPU5ADEN.js +3462 -0
- package/dist/postmark-BEU5OFKU.js +441 -0
- package/dist/prerender-UT5GOOZH.js +180 -0
- package/dist/pubmed-3SGOE24Q.js +1052 -0
- package/dist/railway-CEK4GLRQ.js +452 -0
- package/dist/readwise-DXQUQU67.js +482 -0
- package/dist/render-7TGAU5AW.js +473 -0
- package/dist/replicate-VICFSQ5A.js +347 -0
- package/dist/resend-3E76WK3O.js +100 -0
- package/dist/rootly-36GY46BY.js +345 -0
- package/dist/scrapfly-VDVUYAHX.js +289 -0
- package/dist/scrapingbee-3KTPMAVY.js +247 -0
- package/dist/screenshot_fyi-LKG62C3J.js +116 -0
- package/dist/semantic_scholar-4WREECYO.js +626 -0
- package/dist/sentry-HUQTGXOV.js +1139 -0
- package/dist/shodan-SGRKU4KS.js +303 -0
- package/dist/shopify-YCZ4L5HT.js +620 -0
- package/dist/stripe-OEBKMELB.js +583 -0
- package/dist/supabase-I3DBY7L4.js +937 -0
- package/dist/tavily-B2YHCNRD.js +349 -0
- package/dist/telegram-2VYJELZX.js +1773 -0
- package/dist/telnyx-HHXD3CXL.js +237 -0
- package/dist/todoist-PHFDEEIS.js +672 -0
- package/dist/trello-WUSAK6YN.js +1091 -0
- package/dist/turso-FW56U2B3.js +432 -0
- package/dist/twilio-M5JI7XHA.js +321 -0
- package/dist/umami-HAYODRC4.js +411 -0
- package/dist/unsplash-EDPTNEHJ.js +364 -0
- package/dist/upstash_redis-GC2CLIWD.js +299 -0
- package/dist/uptimerobot-XMSNYLIT.js +481 -0
- package/dist/v2ex-KU4ECD65.js +672 -0
- package/dist/vercel-THPCEFHW.js +1096 -0
- package/dist/wolfram_alpha_api-WHHTH4GU.js +212 -0
- package/dist/wordpress-O6TQEQNF.js +822 -0
- package/dist/workos-A3VHHWI3.js +681 -0
- package/dist/zhihu-BJAI64YJ.js +273 -0
- package/package.json +5 -4
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createProviderPlugin,
|
|
3
|
+
guardedFetch,
|
|
4
|
+
requireApiKey,
|
|
5
|
+
upstreamError
|
|
6
|
+
} from "./chunk-CSJEZHQO.js";
|
|
7
|
+
import "./chunk-K7FVSFUX.js";
|
|
8
|
+
import {
|
|
9
|
+
TBError,
|
|
10
|
+
external_exports
|
|
11
|
+
} from "./chunk-JLTYA2B3.js";
|
|
12
|
+
import "./chunk-MLKGABMK.js";
|
|
13
|
+
|
|
14
|
+
// ../plugins/src/shodan/api.ts
|
|
15
|
+
var SERVICE = "shodan";
|
|
16
|
+
var API_BASE = "https://api.shodan.io";
|
|
17
|
+
var API_INFO_PATH = "/api-info";
|
|
18
|
+
function record(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
20
|
+
}
|
|
21
|
+
function invalidResponse(field) {
|
|
22
|
+
return upstreamError(502, `Shodan ${field} response is invalid`);
|
|
23
|
+
}
|
|
24
|
+
function requiredText(value, field) {
|
|
25
|
+
if (typeof value !== "string" || value.trim() === "") throw invalidResponse(field);
|
|
26
|
+
return value.trim();
|
|
27
|
+
}
|
|
28
|
+
function requiredCount(value, field) {
|
|
29
|
+
if (typeof value !== "number" || !Number.isInteger(value) || value < 0) throw invalidResponse(field);
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
function optionalCount(value, field) {
|
|
33
|
+
return value === void 0 ? void 0 : requiredCount(value, field);
|
|
34
|
+
}
|
|
35
|
+
function optionalFlag(value) {
|
|
36
|
+
return typeof value === "boolean" ? value : void 0;
|
|
37
|
+
}
|
|
38
|
+
function objectArray(value, field) {
|
|
39
|
+
if (!Array.isArray(value) || value.some((item) => record(item) === void 0)) throw invalidResponse(field);
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
function textArray(value, field) {
|
|
43
|
+
if (value === void 0) return [];
|
|
44
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || item.trim() === "")) {
|
|
45
|
+
throw invalidResponse(field);
|
|
46
|
+
}
|
|
47
|
+
return value.map((item) => item.trim());
|
|
48
|
+
}
|
|
49
|
+
function compact(input) {
|
|
50
|
+
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0));
|
|
51
|
+
}
|
|
52
|
+
function errorMessage(payload, status) {
|
|
53
|
+
if (typeof payload === "string" && payload.trim() !== "") return payload.trim();
|
|
54
|
+
const body = record(payload);
|
|
55
|
+
for (const key of ["error", "message"]) {
|
|
56
|
+
const value = body?.[key];
|
|
57
|
+
if (typeof value === "string" && value.trim() !== "") return value.trim();
|
|
58
|
+
}
|
|
59
|
+
return `Shodan request failed with ${status || 500}`;
|
|
60
|
+
}
|
|
61
|
+
async function request(ctx, path, query = {}) {
|
|
62
|
+
const url = new URL(path, API_BASE);
|
|
63
|
+
for (const [key, value] of Object.entries(query)) {
|
|
64
|
+
if (value !== void 0) url.searchParams.set(key, String(value));
|
|
65
|
+
}
|
|
66
|
+
url.searchParams.set("key", requireApiKey(ctx, SERVICE));
|
|
67
|
+
let response;
|
|
68
|
+
let raw;
|
|
69
|
+
try {
|
|
70
|
+
response = await guardedFetch(url.toString(), { method: "GET", headers: { accept: "application/json" } });
|
|
71
|
+
raw = await response.text();
|
|
72
|
+
} catch (error) {
|
|
73
|
+
const message = error instanceof Error ? `Shodan request failed: ${error.message}` : "Shodan request failed";
|
|
74
|
+
throw upstreamError(502, message);
|
|
75
|
+
}
|
|
76
|
+
let payload = null;
|
|
77
|
+
if (raw !== "") {
|
|
78
|
+
try {
|
|
79
|
+
payload = JSON.parse(raw);
|
|
80
|
+
} catch {
|
|
81
|
+
if (response.ok) throw upstreamError(502, "Shodan returned invalid JSON");
|
|
82
|
+
payload = raw;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (!response.ok) throw upstreamError(response.status, errorMessage(payload, response.status));
|
|
86
|
+
const body = record(payload);
|
|
87
|
+
if (body === void 0) throw upstreamError(502, "Shodan returned an invalid JSON response");
|
|
88
|
+
return body;
|
|
89
|
+
}
|
|
90
|
+
function joinCommaList(values, field) {
|
|
91
|
+
if (values === void 0 || values.length === 0) {
|
|
92
|
+
throw new TBError("invalid_argument", `${field} is required`);
|
|
93
|
+
}
|
|
94
|
+
return values.map((item, index) => {
|
|
95
|
+
const trimmed = item.trim();
|
|
96
|
+
if (trimmed === "") throw new TBError("invalid_argument", `${field}[${index}] is required`);
|
|
97
|
+
if (trimmed.includes(",")) throw new TBError("invalid_argument", `${field}[${index}] must not contain commas`);
|
|
98
|
+
return trimmed;
|
|
99
|
+
}).join(",");
|
|
100
|
+
}
|
|
101
|
+
async function getApiInfo(_input, ctx) {
|
|
102
|
+
const payload = await request(ctx, API_INFO_PATH);
|
|
103
|
+
return compact({
|
|
104
|
+
plan: requiredText(payload.plan, "plan"),
|
|
105
|
+
https: optionalFlag(payload.https),
|
|
106
|
+
monitored_ips: requiredCount(payload.monitored_ips, "monitored_ips"),
|
|
107
|
+
query_credits: requiredCount(payload.query_credits, "query_credits"),
|
|
108
|
+
scan_credits: requiredCount(payload.scan_credits, "scan_credits"),
|
|
109
|
+
telnet: optionalFlag(payload.telnet),
|
|
110
|
+
unlocked: optionalFlag(payload.unlocked),
|
|
111
|
+
unlocked_left: optionalCount(payload.unlocked_left, "unlocked_left"),
|
|
112
|
+
usage_limits: record(payload.usage_limits)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async function searchHosts(input, ctx) {
|
|
116
|
+
const payload = await request(ctx, "/shodan/host/search", {
|
|
117
|
+
query: input.query,
|
|
118
|
+
facets: input.facets,
|
|
119
|
+
page: input.page,
|
|
120
|
+
minify: input.minify
|
|
121
|
+
});
|
|
122
|
+
return compact({
|
|
123
|
+
matches: objectArray(payload.matches, "matches"),
|
|
124
|
+
total: requiredCount(payload.total, "total"),
|
|
125
|
+
facets: record(payload.facets)
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async function countSearchResults(input, ctx) {
|
|
129
|
+
const payload = await request(ctx, "/shodan/host/count", { query: input.query, facets: input.facets });
|
|
130
|
+
return compact({
|
|
131
|
+
total: requiredCount(payload.total, "total"),
|
|
132
|
+
facets: record(payload.facets)
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
async function getHost(input, ctx) {
|
|
136
|
+
const path = `/shodan/host/${encodeURIComponent(input.ip)}`;
|
|
137
|
+
return { host: await request(ctx, path, { history: input.history, minify: input.minify }) };
|
|
138
|
+
}
|
|
139
|
+
async function getDomainInfo(input, ctx) {
|
|
140
|
+
if (input.domain === void 0 || input.domain.trim() === "") {
|
|
141
|
+
throw new TBError("invalid_argument", "domain is required");
|
|
142
|
+
}
|
|
143
|
+
const payload = await request(ctx, `/dns/domain/${encodeURIComponent(input.domain.trim())}`);
|
|
144
|
+
return {
|
|
145
|
+
domain: requiredText(payload.domain, "domain"),
|
|
146
|
+
tags: textArray(payload.tags, "tags"),
|
|
147
|
+
data: payload.data === void 0 ? [] : objectArray(payload.data, "data"),
|
|
148
|
+
subdomains: textArray(payload.subdomains, "subdomains"),
|
|
149
|
+
more: optionalFlag(payload.more) ?? false
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
async function resolveHostnames(input, ctx) {
|
|
153
|
+
const payload = await request(ctx, "/dns/resolve", {
|
|
154
|
+
hostnames: joinCommaList(input.hostnames, "hostnames")
|
|
155
|
+
});
|
|
156
|
+
const entries = Object.entries(payload).flatMap(([key, value]) => {
|
|
157
|
+
if (value === null) return [];
|
|
158
|
+
if (typeof value !== "string" || value.trim() === "") throw invalidResponse("results");
|
|
159
|
+
return [[key, value.trim()]];
|
|
160
|
+
});
|
|
161
|
+
return { results: Object.fromEntries(entries) };
|
|
162
|
+
}
|
|
163
|
+
async function reverseDnsLookup(input, ctx) {
|
|
164
|
+
const payload = await request(ctx, "/dns/reverse", { ips: joinCommaList(input.ips, "ips") });
|
|
165
|
+
const entries = Object.entries(payload).map(([key, value]) => {
|
|
166
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || item.trim() === "")) {
|
|
167
|
+
throw invalidResponse("results");
|
|
168
|
+
}
|
|
169
|
+
return [key, value.map((item) => item.trim())];
|
|
170
|
+
});
|
|
171
|
+
return { results: Object.fromEntries(entries) };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// ../plugins/src/shodan/schema.ts
|
|
175
|
+
var getApiInfoInput = external_exports.strictObject({}).describe("Input parameters for retrieving Shodan API account information.");
|
|
176
|
+
var getApiInfoOutput = external_exports.strictObject({
|
|
177
|
+
plan: external_exports.string().min(1).describe("Subscription plan name returned by Shodan."),
|
|
178
|
+
https: external_exports.boolean().describe("Whether HTTPS scanning access is enabled for the API key.").optional(),
|
|
179
|
+
monitored_ips: external_exports.int().min(0).describe("Number of monitored IP addresses currently tracked by the account."),
|
|
180
|
+
query_credits: external_exports.int().min(0).describe("Remaining query credits available to the API key."),
|
|
181
|
+
scan_credits: external_exports.int().min(0).describe("Remaining scan credits available to the API key."),
|
|
182
|
+
telnet: external_exports.boolean().describe("Whether telnet access is enabled for the API key.").optional(),
|
|
183
|
+
unlocked: external_exports.boolean().describe("Whether unlocked search filters are enabled for the API key.").optional(),
|
|
184
|
+
unlocked_left: external_exports.int().min(0).describe("Remaining unlocked query credits available to the API key.").optional(),
|
|
185
|
+
usage_limits: external_exports.looseObject({}).describe("Raw JSON object returned by Shodan.").optional()
|
|
186
|
+
}).describe("API account information returned by Shodan.");
|
|
187
|
+
var searchHostsInput = external_exports.strictObject({
|
|
188
|
+
query: external_exports.string().min(1).describe("Search query string passed to the Shodan host search endpoint."),
|
|
189
|
+
facets: external_exports.string().min(1).describe("Facet aggregation string such as org:5,country:3.").optional(),
|
|
190
|
+
page: external_exports.int().min(1).describe("1-based results page to request from Shodan.").optional(),
|
|
191
|
+
minify: external_exports.boolean().describe("Whether to request minified banner results from Shodan.").optional()
|
|
192
|
+
}).describe("Input parameters for searching hosts in Shodan.");
|
|
193
|
+
var searchHostsOutput = external_exports.strictObject({
|
|
194
|
+
matches: external_exports.array(external_exports.looseObject({}).describe("Raw JSON object returned by Shodan.")).describe("List of raw JSON objects returned by Shodan."),
|
|
195
|
+
total: external_exports.int().min(0).describe("Total number of matching hosts."),
|
|
196
|
+
facets: external_exports.looseObject({}).describe("Raw JSON object returned by Shodan.").optional()
|
|
197
|
+
}).describe("Normalized host search results returned by Shodan.");
|
|
198
|
+
var countSearchResultsInput = external_exports.strictObject({
|
|
199
|
+
query: external_exports.string().min(1).describe("Search query string passed to the Shodan host count endpoint."),
|
|
200
|
+
facets: external_exports.string().min(1).describe("Facet aggregation string such as org:5,country:3.").optional()
|
|
201
|
+
}).describe("Input parameters for counting Shodan host search results.");
|
|
202
|
+
var countSearchResultsOutput = external_exports.strictObject({
|
|
203
|
+
total: external_exports.int().min(0).describe("Total number of matching hosts."),
|
|
204
|
+
facets: external_exports.looseObject({}).describe("Raw JSON object returned by Shodan.").optional()
|
|
205
|
+
}).describe("Normalized host count results returned by Shodan.");
|
|
206
|
+
var getHostInput = external_exports.strictObject({
|
|
207
|
+
ip: external_exports.string().min(1).describe("IPv4 or IPv6 address to inspect in Shodan."),
|
|
208
|
+
history: external_exports.boolean().describe("Whether to include historical banners for the host.").optional(),
|
|
209
|
+
minify: external_exports.boolean().describe("Whether to request a minified host payload from Shodan.").optional()
|
|
210
|
+
}).describe("Input parameters for retrieving Shodan host details.");
|
|
211
|
+
var getHostOutput = external_exports.strictObject({
|
|
212
|
+
host: external_exports.looseObject({}).describe("Raw JSON object returned by Shodan.").optional()
|
|
213
|
+
}).describe("Normalized host details returned by Shodan.");
|
|
214
|
+
var getDomainInfoInput = external_exports.strictObject({
|
|
215
|
+
domain: external_exports.string().min(1).describe("Domain name to inspect in the Shodan DNS endpoint.").optional()
|
|
216
|
+
}).describe("Input parameters for retrieving Shodan domain information.");
|
|
217
|
+
var getDomainInfoOutput = external_exports.strictObject({
|
|
218
|
+
domain: external_exports.string().min(1).describe("Domain name returned by Shodan.").optional(),
|
|
219
|
+
tags: external_exports.array(external_exports.string().min(1).describe("One tag returned by Shodan for the requested domain.")).describe("Tags returned by Shodan for the requested domain.").optional(),
|
|
220
|
+
data: external_exports.array(external_exports.looseObject({}).describe("Raw JSON object returned by Shodan.")).describe("List of raw JSON objects returned by Shodan.").optional(),
|
|
221
|
+
subdomains: external_exports.array(external_exports.string().min(1).describe("One subdomain label returned by Shodan.")).describe("Known subdomain labels returned by Shodan.").optional(),
|
|
222
|
+
more: external_exports.boolean().describe("Whether Shodan has additional subdomain data beyond the current payload.").optional()
|
|
223
|
+
}).describe("Normalized domain information returned by Shodan.");
|
|
224
|
+
var resolveHostnamesInput = external_exports.strictObject({
|
|
225
|
+
hostnames: external_exports.array(external_exports.string().min(1).describe("One hostname to resolve in Shodan.")).min(1).describe("Hostnames to resolve with Shodan.").optional()
|
|
226
|
+
}).describe("Input parameters for resolving hostnames with Shodan.");
|
|
227
|
+
var resolveHostnamesOutput = external_exports.strictObject({
|
|
228
|
+
results: external_exports.record(external_exports.string(), external_exports.string().min(1).describe("Resolved IP address returned by Shodan.")).describe("Mapping of hostname to resolved IP address returned by Shodan.").optional()
|
|
229
|
+
}).describe("Normalized hostname resolution results returned by Shodan.");
|
|
230
|
+
var reverseDnsLookupInput = external_exports.strictObject({
|
|
231
|
+
ips: external_exports.array(external_exports.string().min(1).describe("One IP address to reverse-resolve in Shodan.")).min(1).describe("IP addresses to reverse-resolve with Shodan.").optional()
|
|
232
|
+
}).describe("Input parameters for reverse-resolving IP addresses with Shodan.");
|
|
233
|
+
var reverseDnsLookupOutput = external_exports.strictObject({
|
|
234
|
+
results: external_exports.record(external_exports.string(), external_exports.array(external_exports.string().min(1).describe("One hostname returned by Shodan for the IP address.")).describe("Hostnames returned by Shodan for one IP address.")).describe("Mapping of IP address to hostnames returned by Shodan.").optional()
|
|
235
|
+
}).describe("Normalized reverse DNS results returned by Shodan.");
|
|
236
|
+
var shodanActions = {
|
|
237
|
+
get_api_info: {
|
|
238
|
+
description: "Get API account information and remaining credits from Shodan.",
|
|
239
|
+
effect: "read",
|
|
240
|
+
inputSchema: getApiInfoInput,
|
|
241
|
+
outputSchema: external_exports.toJSONSchema(getApiInfoOutput, { io: "output", unrepresentable: "any" })
|
|
242
|
+
},
|
|
243
|
+
search_hosts: {
|
|
244
|
+
description: "Search Shodan hosts with a query string and optional facet aggregation.",
|
|
245
|
+
effect: "read",
|
|
246
|
+
inputSchema: searchHostsInput,
|
|
247
|
+
outputSchema: external_exports.toJSONSchema(searchHostsOutput, { io: "output", unrepresentable: "any" })
|
|
248
|
+
},
|
|
249
|
+
count_search_results: {
|
|
250
|
+
description: "Count Shodan hosts matching a query and optionally return facet aggregations.",
|
|
251
|
+
effect: "read",
|
|
252
|
+
inputSchema: countSearchResultsInput,
|
|
253
|
+
outputSchema: external_exports.toJSONSchema(countSearchResultsOutput, { io: "output", unrepresentable: "any" })
|
|
254
|
+
},
|
|
255
|
+
get_host: {
|
|
256
|
+
description: "Get Shodan host details for one IP address.",
|
|
257
|
+
effect: "read",
|
|
258
|
+
inputSchema: getHostInput,
|
|
259
|
+
outputSchema: external_exports.toJSONSchema(getHostOutput, { io: "output", unrepresentable: "any" })
|
|
260
|
+
},
|
|
261
|
+
get_domain_info: {
|
|
262
|
+
description: "Get DNS domain information and known subdomains from Shodan.",
|
|
263
|
+
effect: "read",
|
|
264
|
+
inputSchema: getDomainInfoInput,
|
|
265
|
+
outputSchema: external_exports.toJSONSchema(getDomainInfoOutput, { io: "output", unrepresentable: "any" })
|
|
266
|
+
},
|
|
267
|
+
resolve_hostnames: {
|
|
268
|
+
description: "Resolve hostnames to IP addresses with the Shodan DNS resolve endpoint.",
|
|
269
|
+
effect: "write",
|
|
270
|
+
inputSchema: resolveHostnamesInput,
|
|
271
|
+
outputSchema: external_exports.toJSONSchema(resolveHostnamesOutput, { io: "output", unrepresentable: "any" })
|
|
272
|
+
},
|
|
273
|
+
reverse_dns_lookup: {
|
|
274
|
+
description: "Reverse-resolve IP addresses to hostnames with the Shodan DNS reverse endpoint.",
|
|
275
|
+
effect: "write",
|
|
276
|
+
inputSchema: reverseDnsLookupInput,
|
|
277
|
+
outputSchema: external_exports.toJSONSchema(reverseDnsLookupOutput, { io: "output", unrepresentable: "any" })
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// ../plugins/src/shodan/index.ts
|
|
282
|
+
function createShodanPlugin() {
|
|
283
|
+
return createProviderPlugin({
|
|
284
|
+
description: "Shodan",
|
|
285
|
+
actions: shodanActions,
|
|
286
|
+
// 上游 credentialValidators 打的就是 /api-info;它只读、无入参,且不消耗 query credits。
|
|
287
|
+
credentialProbe: "get_api_info",
|
|
288
|
+
handlers: {
|
|
289
|
+
get_api_info: getApiInfo,
|
|
290
|
+
search_hosts: searchHosts,
|
|
291
|
+
count_search_results: countSearchResults,
|
|
292
|
+
get_host: getHost,
|
|
293
|
+
get_domain_info: getDomainInfo,
|
|
294
|
+
resolve_hostnames: resolveHostnames,
|
|
295
|
+
reverse_dns_lookup: reverseDnsLookup
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
var shodan_default = createShodanPlugin();
|
|
300
|
+
export {
|
|
301
|
+
createShodanPlugin,
|
|
302
|
+
shodan_default as default
|
|
303
|
+
};
|