bridge

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 16 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 bridge is `actp <agent>@<server>`: a local stdio ACP agent that forwards everything to an agent on an actp server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LinkURL

func LinkURL(base, agent string) (string, error)

LinkURL builds the WebSocket URL of an agent's link endpoint.

func NoServerHint

func NoServerHint(base string) string

NoServerHint explains a URL where no actp server answers. Quick tunnel addresses change whenever the server restarts, which is the usual cause.

func Run

func Run(ctx context.Context, opts Options, stdin io.Reader, stdout io.Writer) error

Run bridges stdin/stdout to the remote agent until the client closes stdin (returns nil) or the remote session is lost (returns *LostError or another error).

Types

type LostError

type LostError struct{ Reason string }

LostError means the remote session is gone; the bridge should exit 1.

func (*LostError) Error

func (e *LostError) Error() string

type Map

type Map struct{ From, To string }

Map is one --map FROM=TO rule.

type Options

type Options struct {
	Agent      string
	BaseURL    string // http(s)://host[:port][/prefix]
	Token      string
	ClientName string
	// Cwd replaces every cwd the client sends, for example "actp://website".
	Cwd string
	// Maps rewrite cwd values that start with From.
	Maps        []Map
	Wire        wire.Options
	Logger      *slog.Logger
	GiveUpAfter time.Duration // stop reconnecting after this long (10 min)
	MaxBackoff  time.Duration // 30 s
}

Options configure a bridge.

Jump to

Keyboard shortcuts

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