Documentation
¶
Index ¶
- func BudgetLimitPrompt(state State) string
- func ContinuationPrompt(state State) string
- func StartPrompt(state State) string
- func ValidateStatus(status Status) error
- type Change
- type ChangeReceiver
- type Manager
- func (m *Manager) Block(reason string) (State, error)
- func (m *Manager) Clear() (State, error)
- func (m *Manager) Complete(reason string) (State, error)
- func (m *Manager) Create(objective string) (State, error)
- func (m *Manager) CreateWithBudget(objective string, tokenBudget int) (State, error)
- func (m *Manager) Pause() (State, error)
- func (m *Manager) Restore(state State) error
- func (m *Manager) Resume() (State, error)
- func (m *Manager) ResumeWithBudget(tokenBudget int) (State, error)
- func (m *Manager) SetChangeHandler(fn func(Change))
- func (m *Manager) SetSuspender(fn func() bool)
- func (m *Manager) SetTokenCounter(fn func() int)
- func (m *Manager) Snapshot() State
- func (m *Manager) UsageLimit(reason string) (State, error)
- type Signal
- type SignalReceiver
- type State
- type StateAppender
- type Status
- type Store
- type TokenCounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BudgetLimitPrompt ¶
func ContinuationPrompt ¶
func StartPrompt ¶
func ValidateStatus ¶
Types ¶
type ChangeReceiver ¶
type ChangeReceiver interface {
HandleGoalChange(Change)
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(receiver SignalReceiver, stateAppender StateAppender) *Manager
func (*Manager) CreateWithBudget ¶
func (*Manager) ResumeWithBudget ¶
func (*Manager) SetChangeHandler ¶
func (*Manager) SetSuspender ¶
func (*Manager) SetTokenCounter ¶
type Signal ¶
Signal is the narrow runtime contract consumed by agent.Session. Keeping it in this package lets Manager wire continuation without importing agent.
type SignalReceiver ¶
type SignalReceiver interface {
SetGoalSignal(func() Signal)
}
type State ¶
type State struct {
ID string
Objective string
Status Status
CreatedAt time.Time
UpdatedAt time.Time
CompletedAt time.Time
BlockedAt time.Time
BudgetLimitedAt time.Time
UsageLimitedAt time.Time
Reason string
BlockedReason string
BlockedCount int
BlockedAttemptTokenTotal int
BudgetLimitReported bool
TokenBudget int
TokensUsed int
TokenTotalAtLastAccount int
}
func StateFromEntry ¶
func StateFromEntry(entry storage.GoalStateEntry) State
StateFromEntry converts a persisted goal entry back into runtime state. Inverse of the mapping in replaceAndPersist.
type StateAppender ¶
type StateAppender interface {
AppendGoalState(storage.GoalStateEntry) error
}
type TokenCounter ¶
type TokenCounter interface {
TotalTokens() int
}
Click to show internal directories.
Click to hide internal directories.