bridge

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 26 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 terminates the app protocol (PROTOCOL.md) on the stdin and stdout of `stagent bridge`, which the app runs over an SSH exec channel.

hello, ping and session.spawn are answered here; daemon methods are forwarded verbatim over one daemon connection and session methods over one connection per session holder. Notifications from the daemon and the holders are relayed to the app unchanged. The bridge holds no state of its own that matters: when it exits, holders and agents keep running.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvDump

func EnvDump() int

EnvDump is `stagent __env`: print the process environment after envMarker, NUL separated. The bridge runs it through the user's login shell to learn the environment their terminal sessions get.

func Main

func Main(args []string) int

Main runs `stagent bridge` until stdin closes or the SSH session ends.

Types

type Bridge

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

Bridge serves one app connection.

func New

func New(l *paths.Layout, w io.Writer) *Bridge

New creates a bridge writing app messages to w.

func (*Bridge) Serve

func (b *Bridge) Serve(ctx context.Context, r io.Reader) error

Serve reads app requests from r until it ends (EOF is a clean exit), the SSH session ends or the app output fails, then closes every daemon and holder connection.

Jump to

Keyboard shortcuts

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