Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Change ¶
type Change struct {
Key string
Type ChangeType
Content string
}
Change describes a context source that changed between reconciliations.
type ChangeType ¶
type ChangeType int
ChangeType describes the kind of change.
const ( ChangeAdded ChangeType = iota ChangeUpdated ChangeRemoved )
type ContextSource ¶
type ContextSource interface {
// Key returns a stable identifier for this source (e.g., "core/instructions").
Key() string
// Load fetches the current value of this source.
Load(ctx context.Context) (string, error)
// Render formats the value for inclusion in the system prompt.
Render(value string) string
// RenderUpdate formats a change notification when the value changes.
RenderUpdate(oldValue, newValue string) string
// RenderRemoval formats a notification when the source becomes unavailable.
RenderRemoval(value string) string
}
ContextSource provides a named piece of context that can change over time. Sources are evaluated before each LLM call and changes are emitted as mid-conversation system messages.
type DateTimeSource ¶
type DateTimeSource struct{}
DateTimeSource provides the current date and time.
func (DateTimeSource) Key ¶
func (DateTimeSource) Key() string
func (DateTimeSource) Render ¶
func (DateTimeSource) Render(value string) string
func (DateTimeSource) RenderRemoval ¶
func (DateTimeSource) RenderRemoval(_ string) string
func (DateTimeSource) RenderUpdate ¶
func (DateTimeSource) RenderUpdate(_, newVal string) string
type EnvironmentSource ¶
type EnvironmentSource struct {
WorkDir string
}
EnvironmentSource provides working directory, platform, and shell info.
func (EnvironmentSource) Key ¶
func (EnvironmentSource) Key() string
func (EnvironmentSource) Render ¶
func (EnvironmentSource) Render(value string) string
func (EnvironmentSource) RenderRemoval ¶
func (EnvironmentSource) RenderRemoval(_ string) string
func (EnvironmentSource) RenderUpdate ¶
func (EnvironmentSource) RenderUpdate(_, newVal string) string
type GitSource ¶
type GitSource struct {
WorkDir string
}
GitSource provides the current branch and last commit.
func (GitSource) RenderRemoval ¶
func (GitSource) RenderUpdate ¶
type InstructionsSource ¶
InstructionsSource discovers and renders AGENTS.md files.
func (InstructionsSource) Key ¶
func (InstructionsSource) Key() string
func (InstructionsSource) Load ¶
func (i InstructionsSource) Load(_ context.Context) (string, error)
func (InstructionsSource) Render ¶
func (InstructionsSource) Render(value string) string
func (InstructionsSource) RenderRemoval ¶
func (InstructionsSource) RenderRemoval(_ string) string
func (InstructionsSource) RenderUpdate ¶
func (InstructionsSource) RenderUpdate(_, newVal string) string
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages an ordered set of ContextSources and detects changes between reconciliation calls.
func NewRegistry ¶
func NewRegistry(sources ...ContextSource) *Registry
NewRegistry creates a Registry with the given sources.
func (*Registry) Add ¶
func (r *Registry) Add(source ContextSource)
Add registers a new context source.
type Snapshot ¶
Snapshot holds a JSON-encoded state map for change detection.
func NewSnapshot ¶
NewSnapshot creates a Snapshot from a state map.