tools

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tools implements executable capabilities (Tools, §49). It is strictly separated from Skills (knowledge) and Executors (coding runtimes).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher

type Fetcher struct {
	// contains filtered or unexported fields
}

Fetcher is the controlled research web tool (§46). It fetches http(s) URLs to PUBLIC addresses only, blocking SSRF into loopback/private/link-local/ metadata networks (§15, §73). It is deterministic and never takes URLs from raw model output — callers pass validated, config-supplied URLs.

func NewFetcher

func NewFetcher() *Fetcher

NewFetcher builds a fetcher with SSRF-safe dialing and redirect limits.

func (*Fetcher) Fetch

func (f *Fetcher) Fetch(ctx context.Context, url string) (string, error)

Fetch retrieves url, extracts readable text, and returns it (truncated to the size cap). Only public http(s) addresses are reachable.

func (*Fetcher) FetchJSON added in v0.7.0

func (f *Fetcher) FetchJSON(ctx context.Context, url string) ([]byte, error)

FetchJSON retrieves url as a JSON document (raw bytes, size-capped) through the same SSRF-guarded client as Fetch: public http(s) addresses only, at most 5 redirects, none to a non-http scheme. Unlike Fetch it does not strip markup -- an outcome metric's url source reads a number out of the body with a JSON pointer, and HTML-stripping would corrupt a string value that happened to contain a '<'.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL