appstate

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 9 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

This section is empty.

Functions

func WithoutSystemMessages

func WithoutSystemMessages(messages []core.Message) []core.Message

Types

type AppState

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

func New

func New(client llm.LLMClient, workingDir string) *AppState

func (*AppState) AddMessage

func (s *AppState) AddMessage(role core.Role, content string)

func (*AppState) AddUserMessage

func (s *AppState) AddUserMessage(content string) string

func (*AppState) AppendMessage

func (s *AppState) AppendMessage(message core.Message)

func (*AppState) ApplyCompaction

func (s *AppState) ApplyCompaction(summary string) error

func (*AppState) ClearContextMetrics

func (s *AppState) ClearContextMetrics()

func (*AppState) ClearMessages

func (s *AppState) ClearMessages()

func (*AppState) EffectiveToolRegistry

func (s *AppState) EffectiveToolRegistry() *tools.Registry

EffectiveToolRegistry is for display/subagents; chat requests use the full registry.

func (*AppState) FindEnabledSkill

func (s *AppState) FindEnabledSkill(name string) (skills.Skill, bool)

func (*AppState) FormatUserMessage

func (s *AppState) FormatUserMessage(content string) string

func (*AppState) GetClient

func (s *AppState) GetClient() llm.LLMClient

func (*AppState) GetContextBreakdown

func (s *AppState) GetContextBreakdown() core.ContextBreakdown

GetContextBreakdown estimates token usage per context category. When the provider has reported input token usage, category counts are scaled so they sum to the reported total; otherwise raw heuristic estimates are returned.

func (*AppState) GetLastUsage

func (s *AppState) GetLastUsage() *core.TokenUsage

func (*AppState) GetMessages

func (s *AppState) GetMessages() []core.Message

func (*AppState) GetSkills

func (s *AppState) GetSkills() skills.Discovery

func (*AppState) GetSkillsConfig

func (s *AppState) GetSkillsConfig() skills.Config

func (*AppState) GetSubagents

func (s *AppState) GetSubagents() subagents.Discovery

func (*AppState) GetToolRegistry

func (s *AppState) GetToolRegistry() *tools.Registry

func (*AppState) IsAdversaryClientReady

func (s *AppState) IsAdversaryClientReady() bool

func (*AppState) IsClientReady

func (s *AppState) IsClientReady(cfg *config.ResolvedConfig) bool

func (*AppState) Mode

func (s *AppState) Mode() llm.AgentMode

func (*AppState) RegisterTool

func (s *AppState) RegisterTool(tool tools.Tool) error

func (*AppState) ReloadSkills

func (s *AppState) ReloadSkills() skills.Discovery

func (*AppState) ReloadSubagents

func (s *AppState) ReloadSubagents() subagents.Discovery

func (*AppState) RemoveSkillStatus

func (s *AppState) RemoveSkillStatus(name string) error

func (*AppState) ReplaceMessages

func (s *AppState) ReplaceMessages(messages []core.Message)

func (*AppState) ResetClientState

func (s *AppState) ResetClientState()

func (*AppState) SetAdversaryClient

func (s *AppState) SetAdversaryClient(client llm.LLMClient)

func (*AppState) SetLastUsage

func (s *AppState) SetLastUsage(usage *core.TokenUsage)

func (*AppState) SetMode

func (s *AppState) SetMode(mode llm.AgentMode)

func (*AppState) SetSkillStatus

func (s *AppState) SetSkillStatus(name string, status skills.Status) error

func (*AppState) SkillSuggestions

func (s *AppState) SkillSuggestions() []skills.Skill

func (*AppState) SkillsCatalog

func (s *AppState) SkillsCatalog() string

func (*AppState) StreamAdversary

func (s *AppState) StreamAdversary(ctx context.Context, focus string) (<-chan core.StreamEvent, error)

func (*AppState) StreamBtw

func (s *AppState) StreamBtw(ctx context.Context, question string, opts ...core.StreamOptions) (<-chan core.StreamEvent, error)

func (*AppState) StreamChat

func (s *AppState) StreamChat(ctx context.Context, cfg *config.ResolvedConfig, opts ...core.StreamOptions) (<-chan core.StreamEvent, error)

func (*AppState) StreamCompact

func (s *AppState) StreamCompact(ctx context.Context, cfg *config.ResolvedConfig, extraPrompt string, opts core.StreamOptions) (<-chan core.StreamEvent, error)

func (*AppState) SubagentsCatalog

func (s *AppState) SubagentsCatalog() string

func (*AppState) UpdateClient

func (s *AppState) UpdateClient(client llm.LLMClient)

func (*AppState) WorkingDir

func (s *AppState) WorkingDir() string

Jump to

Keyboard shortcuts

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