Documentation
¶
Index ¶
- func BuildEnvDiff(storedEnvInfo string, platform, pwd, envLabel string, envInfo *utils.EnvInfo) string
- func CollectReminders(rc *ReminderContext) []string
- func FormatReminders(msgs []string) string
- func GetPlanSystemPrompt(platform, pwd, envLabel string, envInfo *utils.EnvInfo) string
- func GetSystemPrompt(platform, pwd, envLabel string, envInfo *utils.EnvInfo, ...) string
- func HasAgentsMd(pwd string) string
- func SerializeEnvInfo(platform, pwd, envLabel string, envInfo *utils.EnvInfo) string
- type MemoryConfig
- type MemoryLoader
- type ReminderContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildEnvDiff ¶ added in v0.4.6
func BuildEnvDiff(storedEnvInfo string, platform, pwd, envLabel string, envInfo *utils.EnvInfo) string
BuildEnvDiff compares a stored environment snapshot (from session) with the current environment and returns a human-readable diff string. Returns "" if nothing changed.
func CollectReminders ¶
func CollectReminders(rc *ReminderContext) []string
CollectReminders evaluates all built-in reminders and returns the messages for those whose condition is met. Returns nil if no reminders fire.
func FormatReminders ¶
FormatReminders formats collected reminder strings into a single system message block, or returns empty string if none.
func GetPlanSystemPrompt ¶
GetPlanSystemPrompt returns the system prompt for Plan mode (read-only exploration).
func GetSystemPrompt ¶
func HasAgentsMd ¶
HasAgentsMd returns the path to agents.md (case-insensitive) in pwd, or "".
Types ¶
type MemoryConfig ¶
MemoryConfig controls how AGENTS.md files are loaded and merged.
type MemoryLoader ¶
type MemoryLoader struct {
// contains filtered or unexported fields
}
MemoryLoader loads and merges multi-level AGENTS.md files with @include support.
func NewMemoryLoader ¶
func NewMemoryLoader(cfg MemoryConfig) *MemoryLoader
NewMemoryLoader creates a MemoryLoader with the given config.
func (*MemoryLoader) Load ¶
func (m *MemoryLoader) Load(pwd string) (string, error)
Load loads and merges multi-level AGENTS.md files:
- ~/.jcode/AGENTS.md (global)
- {pwd}/AGENTS.md (project-level)
- {pwd}/AGENTS.local.md (local, expected gitignored)
Each file's @include directives are resolved recursively. The merged result is truncated to MaxTotalChars.
type ReminderContext ¶
type ReminderContext struct {
Iteration int
TokensUsed int64
ContextLimit int
HasIncompleteTodo bool
IncompleteTodoN int
ConsecutiveErrors int
EnvLabel string
IsRemote bool
PlanContent string // non-empty when executing an approved plan
// Goal context, set when an active session goal exists.
GoalActive bool
GoalObjective string
}
ReminderContext carries the runtime state needed to evaluate reminder conditions.