Documentation
¶
Overview ¶
Package resources owns LiveAgent-compatible prompt resources.
Index ¶
- Constants
- Variables
- func CanonicalWorkdir(workdir string) (string, error)
- type AgentTemplate
- type ProjectPrompt
- type PromptState
- type PromptStore
- func (s *PromptStore) Create(item AgentTemplate, base *uint64) (PromptState, error)
- func (s *PromptStore) Delete(id string, base *uint64) (PromptState, error)
- func (s *PromptStore) Patch(id string, patch TemplatePatch) (PromptState, error)
- func (s *PromptStore) Replace(items []AgentTemplate, base *uint64) (PromptState, error)
- func (s *PromptStore) Resolve(workdir string, override *ProjectPrompt) (global string, project ProjectPrompt, effective string, err error)
- func (s *PromptStore) SetProject(project ProjectPrompt, base *uint64) (PromptState, error)
- func (s *PromptStore) Snapshot() PromptState
- type TemplatePatch
Constants ¶
View Source
const MaxPromptSize = 1 << 20
Variables ¶
View Source
var ( ErrConflict = errors.New("prompt revision conflict") ErrNotFound = errors.New("prompt template not found") )
Functions ¶
func CanonicalWorkdir ¶
Types ¶
type AgentTemplate ¶
type ProjectPrompt ¶
type PromptState ¶
type PromptState struct {
Revision uint64 `json:"revision"`
Templates []AgentTemplate `json:"templates"`
Projects map[string]ProjectPrompt `json:"-"`
}
type PromptStore ¶
type PromptStore struct {
// contains filtered or unexported fields
}
PromptStore is independent of provider settings and directory instruction files.
func OpenPrompts ¶
func OpenPrompts(root string) (*PromptStore, error)
func (*PromptStore) Create ¶
func (s *PromptStore) Create(item AgentTemplate, base *uint64) (PromptState, error)
func (*PromptStore) Delete ¶
func (s *PromptStore) Delete(id string, base *uint64) (PromptState, error)
func (*PromptStore) Patch ¶
func (s *PromptStore) Patch(id string, patch TemplatePatch) (PromptState, error)
func (*PromptStore) Replace ¶
func (s *PromptStore) Replace(items []AgentTemplate, base *uint64) (PromptState, error)
func (*PromptStore) Resolve ¶
func (s *PromptStore) Resolve(workdir string, override *ProjectPrompt) (global string, project ProjectPrompt, effective string, err error)
Resolve replaces only the global template layer, never system/brain/AGENTS rules.
func (*PromptStore) SetProject ¶
func (s *PromptStore) SetProject(project ProjectPrompt, base *uint64) (PromptState, error)
func (*PromptStore) Snapshot ¶
func (s *PromptStore) Snapshot() PromptState
Click to show internal directories.
Click to hide internal directories.