package tool import ( "context" "crypto/tls" "crypto/x509" "encoding/json" "fmt" "io" "net/http" "net/url" "os" "regexp" "strings" "time" "github.com/Autumn-27/norma/permission" "golang.org/x/net/html" ) // WebFetchConfig tunes the network behavior of a WebFetch tool. type WebFetchConfig struct { // Proxy, when set, routes requests through this http(s) proxy URL. Empty = direct. Proxy string // CACert, when set, is a path to a PEM CA certificate added to the system // trust pool. This lets WebFetch *verify* HTTPS fetched through a MITM/recording // proxy that re-signs certificates with its own CA — the proper alternative to // InsecureTLS, keeping verification on for every other connection. Preferred // over InsecureTLS; ignored when InsecureTLS is set. CACert string // InsecureTLS skips TLS certificate verification entirely (equivalent to // curl -k). A blunt fallback when no CA cert is available; prefer CACert. InsecureTLS bool } // NewWebFetch builds the WebFetch tool: fetches a URL over HTTP(S) and returns // its content as Markdown (HTML is parsed and rendered; non-HTML is returned // as-is). With extract=true it also appends a RECON section that preserves the // signal HTML→Markdown normally discards — comments,