web

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollapseWhitespace

func CollapseWhitespace(s string) string

CollapseWhitespace reduces runs of whitespace and blank lines.

func HTMLToText

func HTMLToText(rawHTML string) string

HTMLToText converts HTML to simplified readable text.

func NewSafeHTTPClient

func NewSafeHTTPClient(timeout time.Duration) *http.Client

NewSafeHTTPClient returns an HTTP client that revalidates every dial target and refuses private/local destinations.

func NewSafeHTTPClientWithOptions

func NewSafeHTTPClientWithOptions(timeout time.Duration, opts URLSecurityOptions) *http.Client

NewSafeHTTPClientWithOptions returns an HTTP client that revalidates every dial target using explicit URL security options.

func ValidateHTTPURL

func ValidateHTTPURL(ctx context.Context, rawURL string, opts URLSecurityOptions) (*url.URL, error)

ValidateHTTPURL validates an agent-supplied HTTP(S) URL. Private/local destinations are rejected unless opts explicitly allows them.

func ValidatePublicHTTPURL

func ValidatePublicHTTPURL(ctx context.Context, rawURL string) (*url.URL, error)

ValidatePublicHTTPURL validates an agent-supplied HTTP(S) URL and rejects private/local destinations.

Types

type FetchTool

type FetchTool struct {
	AllowPrivateNetworkURLs bool
}

FetchTool fetches a URL and converts HTML to readable text.

func (*FetchTool) Description

func (t *FetchTool) Description() string

func (*FetchTool) Execute

func (t *FetchTool) Execute(ctx context.Context, input json.RawMessage, _ string) (agentsdk.ToolResult, error)

func (*FetchTool) InputSchema

func (t *FetchTool) InputSchema() json.RawMessage

func (*FetchTool) IsEnabled

func (t *FetchTool) IsEnabled(_ *agentsdk.RunContext) bool

func (*FetchTool) IsReadOnly

func (t *FetchTool) IsReadOnly() bool

func (*FetchTool) Name

func (t *FetchTool) Name() string

func (*FetchTool) NeedsApproval

func (t *FetchTool) NeedsApproval() bool

func (*FetchTool) TimeoutSeconds

func (t *FetchTool) TimeoutSeconds() int

type URLSecurityOptions

type URLSecurityOptions struct {
	AllowPrivateNetworkURLs bool
}

Jump to

Keyboard shortcuts

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