tuiserver

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 96 Imported by: 1 module, 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 AttachBytesMaxBytes = attachBytesMaxBytes

Byte cap of an attached payload the owner's image staging enforces

Variables

View Source
var (
	SlashCompleter       func(ctx context.Context, skillCommands, skillBundles skills.SkillCommands) func(text string) []SlashCompletion
	GatewayKnownCommands func() map[string]bool
)

Hooks into pkg/commands assigned in cmd/icebath/wiring.go, the slash completer and the gateway command names

View Source
	ReleaseDate     string
	AvailableSkills func(ctx context.Context) *jsonutil.Object
	UpdateResult    func(timeout time.Duration) *int64
}

CLI banner facts the session info reports, assigned by the command wiring from the app package

CLI command tree of this binary with the plugin commands the process loaded for the scoped profile, assigned in cmd/icebath/wiring.go

View Source
var CatalogRegistry func(ctx context.Context) ([]CatalogCommand, map[string][]string)

Builtin registry rows in registry order and the subcommand table of pkg/commands, assigned in cmd/icebath/wiring.go

View Source
var ChatAppCommands struct {
	// Runs icebath webhook with the fields of the webhook form
	Webhook func(ctx context.Context, w io.Writer, p tuigateway.ChatAppsWebhookParams) (int, error)
	// Runs icebath send with its parsed words
	Send func(ctx context.Context, h string, ns map[string]any, w, errw io.Writer) (int, error)
}

Chat app commands of the gateway command line, wired by the binary so this package does not import it

View Source
var QuickSnapshots func(home string, t func(key string, kwargs map[string]any) string) SnapshotLines

Shared /snapshot command over a profile home and a catalog lookup, set by the wiring

View Source
var RegistryPluginCommands func(ctx context.Context) ([]CatalogCommand, map[string][]string)

Plugin owned registry commands sorted by name with their subcommand table, assigned in cmd/icebath/wiring.go

View Source
var SaveConfigValue func(ctx context.Context, keyPath string, value any) bool

Persists one dot separated key into the active home config, the cli save_config_value assigned in cmd/icebath/wiring.go

Functions

func AtExit

func AtExit()

Runs and clears the queued exit functions newest first, a panicking one not stopping the rest

func CommandCatalog

Registry backed slash metadata by category, each discovery source degrading into the warning on failure

func ConsumeTypedStopPhrase

func ConsumeTypedStopPhrase(ctx context.Context, text, sessionID string) (bool, error)

Typed stop check of the canonical prompt submit, the submitter answered in the reply instead of an event

func DecodeAttachBase64

func DecodeAttachBase64(raw, mimePrefix string, maxBytes int) ([]byte, error)

Decoded data URL or bare base64 payload under the cap, nil when invalid

func Dispatch

func Dispatch(ctx context.Context, req any, transport tuihost.Transport) map[string]any

Routes one inbound RPC, a long handler to the pool returning nil and every other inline with its response

func GatewayToolsets

func GatewayToolsets(ctx context.Context, platform string) (enabled, disabled []string)

Enabled and configured disabled toolsets a TUI session of the platform is built with

func HandleWS

func HandleWS(ctx context.Context, ws ServedSocket, authIdentity map[string]any, subprotocol *string, operator bool) error

Runs one WebSocket connection of a client, its requests answered by the session authority under the identity the upgrade verified

func PathCompletionItems

func PathCompletionItems(ctx context.Context, word, root, sessionKey string, local bool) ([]tuigateway.CompletionItem, error)

Path and context ref rows for a word rooted in a folder, an empty root meaning the terminal workspace

func ProfileRuntimeScope

func ProfileRuntimeScope(ctx context.Context, profileHome string) context.Context

Context bound to the home, hydrated secrets and terminal policy of a profile home, empty meaning the launch profile

func ProjectInfoForCwd

func ProjectInfoForCwd(ctx context.Context, cwd string) any

Project of a working directory with its id, slug, name and primary path, nil when none

func SessionSteerAuthority

func SessionSteerAuthority(ctx context.Context, sessionID string) (any, any)

Steer authority of the bound request as untyped values, both nil when the transport holds none

func SettleWorktree

func SettleWorktree(ctx context.Context, tree map[string]string, choice string, echo func(string))

Carries out an exit choice, else removes a clean tree and its branch or echoes why the tree is kept

func SlashCompletions

func SlashCompletions(ctx context.Context, text string, scope func(context.Context) (context.Context, error)) (tuigateway.CompleteSlashResult, error)

Slash popup rows for the text, skills and bundles read inside the scope of the calling session, for both routes

func SniffImageExt

func SniffImageExt(data []byte, filename string) string

Image extension from the filename hint, else magic bytes, else png

func StageImageBytes

func StageImageBytes(directory string, data []byte, ext, prefix string) (string, error)

Private collision free image staging shared by local and canonical byte uploads

Types

type CatalogCommand

type CatalogCommand struct {
	Name, Category, Description string
	Aliases                     []string
	GatewayOnly                 bool
}

One builtin registry command as the palette catalog reads it

type Handler

type Handler func(ctx context.Context, rid any, params map[string]any) map[string]any

JSON RPC handler of one registered method

type ProfileUnavailableError

type ProfileUnavailableError struct{ Msg string }

Explicit profile param naming no live profile on this host, answered as JSON RPC 4064

func (*ProfileUnavailableError) Error

func (e *ProfileUnavailableError) Error() string

func (*ProfileUnavailableError) ErrorKind

func (e *ProfileUnavailableError) ErrorKind() string

Python exception class name the error stands for

type ServedSocket

type ServedSocket interface {
	tuihost.WSConn
	Accept(ctx context.Context, subprotocol *string) error
	// Next text frame, a SocketDisconnect once the peer leaves
	ReceiveText(ctx context.Context) (string, error)
	// Peer address, nil when the server reports none
	Client() *SocketPeer
	// Raw stream socket under the connection, nil when the server exposes none
	RawConn() net.Conn
	// Session authority of the route scope, else of the app state, nil when the backend has none
	SessionAuthority() *gateway.SessionAuthority
}

Accepted WebSocket one session connection runs over, as the gateway session route hands it in

type SlashCompletion

type SlashCompletion struct {
	Text, Display, Meta string
}

One completion of the prompt slash completer, display and meta already plain text

type SnapshotLines

type SnapshotLines interface {
	List() ([]string, error)
	Create(parts []string) ([]string, error)
	Prune(parts []string) ([]string, error)
	RestoreTarget(parts []string) (string, []string, error)
}

Lines of the shared /snapshot subcommands

type SocketDisconnect

type SocketDisconnect struct {
	Code   any
	Reason any
}

Peer close a socket read reports, with its code and reason

func (*SocketDisconnect) Error

func (e *SocketDisconnect) Error() string

type SocketPeer

type SocketPeer struct {
	Host string
	Port *int
}

Host and port of a socket peer, the port nil when unknown

type StoreUnavailableError

type StoreUnavailableError = state.StoreUnavailableError

Session store that would not open, shared with the messaging gateway so both name the cause alike

Source Files

Jump to

Keyboard shortcuts

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