agent

package
v0.4.29 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 14 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 agent joins the tunnel to the tool plane: it accepts channels the SaaS opens and serves the ones it is willing to serve.

This is where the pieces meet, and where the claim they exist to support has to hold — that a compromised or prompt-injected SaaS can at worst read. The protocol makes an address unrepresentable, the sandbox makes a tool call read-only, and this package must not become the place either stops being true.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Tools *toolplane.Registry

	// Console serves the human plane. Nil refuses every console channel,
	// which is the right default: an agent with no node identity configured
	// must not guess which node it is.
	Console *console.Handler

	// Web serves web channels. Nil refuses them, which is the default: a node
	// exposes no web target until one is configured.
	Web *console.WebHandler

	// CallTimeout bounds one tool call end to end. Zero uses the default.
	CallTimeout time.Duration
}

Server serves channels for one session.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context, sess *tunnel.Session) error

Serve accepts channels until the session ends or ctx is cancelled.

Each channel is handled in its own goroutine: a tool that hangs must not stall the accept loop, or one slow call would block every other channel on the connection — including the console channels a human is waiting on.

Jump to

Keyboard shortcuts

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