Documentation
¶
Overview ¶
Package profile stores per-identity Agent.md profiles on disk.
Index ¶
- Constants
- Variables
- func AddFact(agentMD, fact string) (string, bool, error)
- func DefaultRoot() string
- func FormatSectionTree(agentMD string) string
- func RenderAgentMD(c AgentContent) string
- func RenderContextBlock(agentMD string) string
- type AgentContent
- type LoadedProfile
- type Metadata
- type Preferences
- type Profile
- type Section
- type Store
Constants ¶
const ( // ProfileBlockStart marks the beginning of the protected Agent.md context block. ProfileBlockStart = "<profile:Agent.md>" // ProfileBlockEnd marks the end of the protected Agent.md context block. ProfileBlockEnd = "</profile:Agent.md>" )
const MaxAgentMDBytes = 32768
MaxAgentMDBytes caps the rendered Agent.md profile size.
Variables ¶
var ( // ErrInvalidIdentity is returned when a profile identity is empty, malformed, or escapes the profile root. ErrInvalidIdentity = errors.New("invalid profile identity") // ErrProfileNotFound is returned when one or more required profile files are missing. ErrProfileNotFound = errors.New("profile not found") )
Functions ¶
func DefaultRoot ¶
func DefaultRoot() string
DefaultRoot returns the default per-user Aura profile directory.
func FormatSectionTree ¶
FormatSectionTree renders a compact ASCII tree for CLI display.
func RenderAgentMD ¶
func RenderAgentMD(c AgentContent) string
RenderAgentMD renders Agent.md with a stable section order.
func RenderContextBlock ¶
RenderContextBlock wraps Agent.md for the protected messages[1] user-role block.
Types ¶
type AgentContent ¶
type AgentContent struct {
Identity []string
ExpertiseTools []string
ProjectsGoals []string
Interests []string
People []string
Style []string
Vetoes []string
CustomInstructions []string
}
AgentContent is the structured form rendered into Agent.md.
type LoadedProfile ¶
type LoadedProfile struct {
AgentMD string
Preferences Preferences
Metadata Metadata
Changelog string
}
LoadedProfile is the full profile state reconstructed from disk.
type Metadata ¶
type Metadata struct {
Version int `json:"version"`
SchemaVersion int `json:"schema_version,omitempty"`
OnboardingCompleted bool `json:"onboarding_completed"`
OnboardingSkipped bool `json:"onboarding_skipped,omitempty"`
GeneratedAt string `json:"generated_at,omitempty"`
LastUpdatedAt string `json:"last_updated_at,omitempty"`
}
Metadata tracks profile versioning and onboarding state.
type Preferences ¶
type Preferences struct {
Lang string `json:"lang,omitempty"`
Timezone string `json:"timezone,omitempty"`
Location string `json:"location,omitempty"`
VoiceMode bool `json:"voice_mode,omitempty"`
CanProactiveMessage bool `json:"can_proactive_message,omitempty"`
TonePreference string `json:"tone_preference,omitempty"`
ResponseLength string `json:"response_length,omitempty"`
}
Preferences is the structured companion file beside Agent.md.
type Profile ¶
type Profile struct {
AgentMD string
Preferences Preferences
Metadata Metadata
Change string
}
Profile is the write input for one identity profile.
type Section ¶
Section is a parsed Agent.md H2 section for display.
func ParseSections ¶
ParseSections returns Agent.md H2 sections in file order.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes profile files under Root/<identity>/.
func (*Store) AddFact ¶
AddFact inserts fact under Agent.md's Identity section and appends the changelog.
func (*Store) ReadProfile ¶
func (s *Store) ReadProfile(identity string) (LoadedProfile, error)
ReadProfile reads Agent.md, preferences, metadata, and changelog for identity.