app

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 13 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

This section is empty.

Variables

View Source
var ErrTurnActive = errors.New("a turn is already active")

Functions

This section is empty.

Types

type Agent

type Agent interface {
	FormatUserMessage(content string) string
	Submit(ctx context.Context, sessionID string, input string) (<-chan agentcore.StreamEvent, error)
	ReplaceMessages(messages []agentcore.Message)
}

type Session

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

func NewSession

func NewSession(agent Agent, workingDir string) (*Session, error)

func NewSessionWithoutStore

func NewSessionWithoutStore(agent Agent) *Session

func (*Session) AppendAssistantTurn

func (s *Session) AppendAssistantTurn(transcript []session.TranscriptItem, message agentcore.Message, interrupted bool, errText string) error

func (*Session) AppendAutoCompaction

func (s *Session) AppendAutoCompaction(checkpointTranscript []session.TranscriptItem, checkpoint agentcore.Message, messages []agentcore.Message) error

func (*Session) AppendCompaction

func (s *Session) AppendCompaction(transcript []session.TranscriptItem, messages []agentcore.Message, status string) error

func (*Session) AppendUserMessage

func (s *Session) AppendUserMessage(content string) error

func (*Session) CurrentID

func (s *Session) CurrentID() string

func (*Session) List

func (s *Session) List() ([]session.Summary, error)

func (*Session) Load

func (s *Session) Load(summary session.Summary) (*session.LoadedSession, error)

func (*Session) ObserveToolCall

func (s *Session) ObserveToolCall(call *agentcore.ToolCall) bool

func (*Session) Reset

func (s *Session) Reset()

func (*Session) Resume

func (s *Session) Resume(loaded *session.LoadedSession)

func (*Session) SetAgent

func (s *Session) SetAgent(agent Agent)

func (*Session) StartTurn

func (s *Session) StartTurn(ctx context.Context, input string) (*Turn, error)

func (*Session) Todos

func (s *Session) Todos() Todos

type Todos

type Todos = tools.TodoList

func TodosFromEvents

func TodosFromEvents(events []session.Event) Todos

func TodosFromToolCall

func TodosFromToolCall(name string, input map[string]any, errText string) (Todos, bool)

type Turn

type Turn struct {
	Events <-chan agentcore.StreamEvent
	// contains filtered or unexported fields
}

Turn is one prompt submission. Close releases the session's active-turn slot and cancels the turn; it is safe to call more than once.

func (*Turn) Close

func (t *Turn) Close()

func (*Turn) ConfigureMemory

func (t *Turn) ConfigureMemory(workingDir string, retainOutput bool)

func (*Turn) Memory

func (t *Turn) Memory() *agentcore.TurnMemory

func (*Turn) RecordToolCall

func (t *Turn) RecordToolCall(call *agentcore.ToolCall, response string)

func (*Turn) ResetMemory

func (t *Turn) ResetMemory()

Jump to

Keyboard shortcuts

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