tools

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 68 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

The browser tools: browser_exec runs the model's Python against a real browser, browser_cdp and browser_dialog reach a browser attached over DevTools, browser_vault fills what the user saved into the page

Index

Constants

View Source
const (
	// Debugging port of a browser started for /browser connect
	DefaultPort = 9222
	DefaultURL  = "http://127.0.0.1:9222"
)
View Source
const (
	Exec   = "browser_exec"
	CDP    = "browser_cdp"
	Dialog = "browser_dialog"
	Vault  = "browser_vault"
)

Names of the browser tools, which the views of the chat name too

Variables

This section is empty.

Functions

func Browsers

func Browsers() []string

Keys of the browsers whose profile can be used, for the close-profile flag

func CloseProfile

func CloseProfile(cfg *config.Config, browser string) (bool, string)

Ends the browser holding the profile of the browser given, else of the default one, as Close in /browser does

func Opaque

func Opaque(method string, result any, keep func(data string) any) any

Result of the method with the base64 it carries at its declared paths given to keep in its place, such as its size, for a person who can't read it

func SharedState

func SharedState() string

Folder of the launcher state of the shared profiles of this user, which every icebath of the computer shares and which outlives them

Types

type BadAddress

type BadAddress struct{ Message string }

Error of an address /browser connect refuses, for the person to fix

func (*BadAddress) Error

func (e *BadAddress) Error() string

type Browser

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

The browser host of the plugin: what /browser and `icebath browser` reach

func Register

func Register(registry *tools.Registry, stores *sessionstore.Registry, profiles *profile.Registry, cfg *config.Config, host *browser.Browser,
	desktop *botdesktop.Desktop, term *terminal.Terminal, safe *vault.Vault, pm *packages.Packages) *Browser

func (*Browser) Attach

func (b *Browser) Attach(ctx context.Context, cfg *config.Config, endpoint, shown string)

Attaches the profile's browser tools to the endpoint, an empty one detaching them; the profile's browsers closed on each side of the change. Shown is the endpoint as a person is shown it, the endpoint itself for none

func (*Browser) CloseProfile

func (b *Browser) CloseProfile(cfg *config.Config, name string) (bool, string)

Ends the browser holding the user's own profile, that of the browser named or else of the default one

func (*Browser) Connect

func (b *Browser) Connect(ctx context.Context, cfg *config.Config, address string, say func(message, level string)) (bool, string, error)

Checks, reaches or launches the browser at the address and attaches the profile's browser tools to it, telling each step; whether they are attached and the endpoint, or the one tried when no browser answered

func (*Browser) Disconnect

func (b *Browser) Disconnect(ctx context.Context, cfg *config.Config) (string, bool, error)

Detaches the profile's browser tools from the browser they were attached to and forgets its address, answering what happened; held when an environment variable still names an address, which wins

func (*Browser) Endpoint

func (b *Browser) Endpoint(cfg *config.Config) string

Endpoint the profile drives over DevTools, empty when none is attached

func (*Browser) Holder

func (b *Browser) Holder(cfg *config.Config) string

Environment variable that names the address of the browser over the settings, empty when none does

func (*Browser) Installed

func (b *Browser) Installed(cfg *config.Config) []Installed

Every Chromium browser installed on this computer that the profile's browser starts, by its name and its program

func (*Browser) Launcher

func (b *Browser) Launcher() browser.Registrant

The launcher as the browser host takes it, for the plugin to register

func (*Browser) Reap

func (b *Browser) Reap() int

Stops the Chromium of owners that are gone, of the profiles this icebath serves and of every shared profile, reclaiming their throwaway folders: how many it stopped

func (*Browser) Shown

func (b *Browser) Shown(cfg *config.Config) string

Endpoint the profile drives over DevTools as a person is shown it, empty when none is attached: the one attached as it was given, else browser.cdp_url as the settings write it, every ${NAME} kept rather than the value of the variable it names

func (*Browser) Trial

func (b *Browser) Trial(ctx context.Context, cfg *config.Config) (time.Duration, error)

Starts a Chromium of its own for the profile in a throwaway profile, waits until it answers over DevTools and stops it again, as a check that the browser of this computer runs: how long it took to answer, or why it did not

type Capture

type Capture struct {
	Title, Path string
}

A file a program the browser tools start for a profile writes its output to, which outlives icebath

func Captures

func Captures(cfg *config.Config) []Capture

The files the programs the browser tools started for the profile write their output to, as far as they are there: the browser started for the agent to attach to, and each lightpanda server of a session

type Installed

type Installed struct {
	Title, Path, Key string
}

A browser installed on this computer: its name, its program, and the key CloseProfile takes for it

type OwnProfile

type OwnProfile struct {
	// Folder inside the browser's data, such as Default or Profile 2, and the name the browser shows for it
	Folder, Name string
	// The one the browser used last
	Last bool
}

A profile of the browser your own profile is copied from

func OwnProfiles

func OwnProfiles() (string, []OwnProfile)

Title of the default browser and its profiles, those its Local State names that are there; no title for a default icebath knows not. The default is the one found at most glanceFor ago

Jump to

Keyboard shortcuts

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