shellsession

package
v1.0.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 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

Index

Constants

View Source
const (
	ToolsProviderName = "shell_session"
	ToolRun           = "shell_session_run"
	ToolRead          = "shell_session_read"
)

Variables

This section is empty.

Functions

func NewTools

func NewTools(mgr Manager) taskengine.ToolsRepo

Types

type Chunk

type Chunk struct {
	Offset int64
	Data   string
	Reset  bool
}

type Config

type Config struct {
	CwdResolver     func(ctx context.Context) string
	Workspace       *vfs.Factory
	Shell           string
	ScrollbackBytes int
	IdleTimeout     time.Duration
	ScrubEnv        func([]string) []string
}

type Manager

type Manager interface {
	Run(ctx context.Context, sessionID, line string) (RunResult, error)
	Read(sessionID string, since int64, tailBytes int) ReadResult
	Subscribe(sessionID string, fn func(Chunk)) (cancel func())
	Kill(sessionID string)
	Shutdown()
}

func NewManager

func NewManager(cfg Config) Manager

type ReadResult

type ReadResult struct {
	Content    string
	FromOffset int64
	NextOffset int64
	Exists     bool
}

type ReadResultJSON

type ReadResultJSON struct {
	Content    string `json:"content"`
	FromOffset int64  `json:"from_offset"`
	NextOffset int64  `json:"next_offset"`
	Exists     bool   `json:"exists"`
	Note       string `json:"note,omitempty"`
}

type RunResult

type RunResult struct {
	Offset   int64
	Snapshot string
	Started  bool
}

type RunResultJSON

type RunResultJSON struct {
	Offset  int64  `json:"offset"`
	Output  string `json:"output"`
	Started bool   `json:"started_new_shell,omitempty"`
	Note    string `json:"note,omitempty"`
}

Jump to

Keyboard shortcuts

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