1mod constants;
10mod engine;
11mod extractor;
12mod fence;
13mod format;
14mod run;
15mod schema;
16mod ssrf;
17mod types;
18
19pub use constants::*;
20pub use engine::{default_engine, FetchError, ReqwestEngine, WebFetchEngine, WebFetchEngineInput, WebFetchEngineResult};
21pub use format::{
22 format_http_error_text, format_ok_text, format_redirect_loop_text,
23 head_and_tail, render_request_block, spill_to_file,
24};
25pub use schema::{
26 safe_parse_webfetch_params, WebFetchParams, WebFetchParseError,
27 WEBFETCH_TOOL_DESCRIPTION, WEBFETCH_TOOL_NAME,
28};
29pub use ssrf::{classify_host, classify_ip, BlockClass, SsrfDecision};
30pub use types::{
31 CachedResponse, FetchMetadata, WebFetchCache, WebFetchError, WebFetchExtract,
32 WebFetchHttpError, WebFetchMethod, WebFetchOk, WebFetchPermissionPolicy,
33 WebFetchRedirectLoop, WebFetchResult, WebFetchSessionConfig,
34};
35
36pub async fn webfetch(
37 params: serde_json::Value,
38 session: &WebFetchSessionConfig,
39) -> WebFetchResult {
40 run::webfetch_run(params, session).await
41}