Documentation
¶
Overview ¶
Package state defines the State interface and supporting types for ore's conversation history model.
State is a mutable interface: Append() mutates in place. Turns() returns a defensive copy of the internal slice so providers can safely iterate without synchronization. The in-memory implementation (Buffer) is intentionally not goroutine-safe; concurrency control is a future middleware concern.
Package state defines the State interface and supporting types for ore's conversation history model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer is a simple in-memory implementation of State. It is not safe for concurrent use.
type State ¶
type State interface {
// Turns returns a defensive copy of the turn history.
Turns() []Turn
// Append adds a new turn to the state. It mutates in place.
Append(role Role, artifacts ...artifact.Artifact)
}
State is a mutable conversation state that the core loop appends to.
func NewVirtualTurnState ¶
NewVirtualTurnState creates a state wrapper that prepends virtual turns before the base state's turns. If virtual is empty, it returns the base state directly as an identity optimization.
type VirtualTurnState ¶
type VirtualTurnState struct {
// contains filtered or unexported fields
}
VirtualTurnState wraps a base State, prepending virtual turns to the slice returned by Turns(). Append() delegates to the base state. This enables inference assembly transforms to inject content that appears in the provider's view without mutating the persistent conversation buffer.
func (*VirtualTurnState) Append ¶
func (v *VirtualTurnState) Append(role Role, artifacts ...artifact.Artifact)
Append delegates to the underlying base state.
func (*VirtualTurnState) Turns ¶
func (v *VirtualTurnState) Turns() []Turn
Turns returns a defensive copy of the virtual turns followed by the base state's turns.