sessionadapter

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sessionadapter adapts harness sessions to the terminal Agent contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter = sessionAdapter

Agent is the reusable harness-session adapter consumed by terminal applications.

func New

New wraps a newly created session. Fresh sessions have no replay backlog. It is the plain test/explicitly-ephemeral constructor; production clients that promise enduring delivery must use NewWithReplay or Restore.

func NewWithReplay

func NewWithReplay(ctx context.Context, sess session.SessionController, store ReplayOpener) (*Adapter, error)

NewWithReplay wraps a newly created session and cold-replays the public enduring events already committed during rig construction. It is intended for interactive clients that subscribe after primers have been created.

func Restore

func Restore(ctx context.Context, sess session.SessionController, store ReplayOpener) (*Adapter, error)

Restore wraps a restored session and reconstructs its public enduring backlog and open-gate index before returning it to the TUI.

type GateNotOpenError

type GateNotOpenError struct {
	LoopID          uuid.UUID
	ToolExecutionID uuid.UUID
}

GateNotOpenError reports that no open gate matches the (loop, tool-execution) a gate reply addressed. It is fail-secure: an Approve/Deny/ProvideAnswer for a call with no live gate touches nothing and returns this. It is errors.As-able.

func (*GateNotOpenError) Error

func (e *GateNotOpenError) Error() string

type ReplayOpener

type ReplayOpener interface {
	OpenEventReplayer(uuid.UUID, sessionstore.ReplayRequest) (journal.EventReplayer, error)
}

replayOpener is the narrow slice of the session store the adapter needs: open a durable public event replayer for one session. *sessionstore.Store satisfies it.

Jump to

Keyboard shortcuts

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