Documentation
¶
Overview ¶
Package ctxedit builds, annotates, persists, and loads context overrides for PM tasks. It gives power users surgical control over what context is sent to the AI before a task runs.
Index ¶
- Constants
- func Build(plan *pm.Plan, task *pm.Task, workDir string, injectCtx bool, ...) string
- func ClearAllOverrides(workDir string) (int, error)
- func ClearOverride(workDir string, taskID int) error
- func LoadOverride(workDir string, taskID int) (string, error)
- func OverridePath(workDir string, taskID int) string
- func SaveOverride(workDir string, taskID int, content string) error
- type Section
Constants ¶
const OverrideDir = ".cloop"
OverrideDir is the subdirectory under workDir where override files are stored.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(plan *pm.Plan, task *pm.Task, workDir string, injectCtx bool, pruneTokenBudget int) string
Build constructs the exact prompt string the orchestrator would send for task, mirroring the logic in pkg/pm.ExecuteTaskPrompt. workDir is used to load adaptive prompt hints; pass "" to skip. pruneTokenBudget mirrors the orchestrator's context-pruning budget (0 = no pruning).
func ClearAllOverrides ¶
ClearAllOverrides removes all context_override_*.txt files in workDir/.cloop/.
func ClearOverride ¶
ClearOverride removes the context override for taskID. Returns nil if the file does not exist.
func LoadOverride ¶
LoadOverride reads the context override file for taskID from workDir. Returns ("", nil) if no override exists.
Capped at maxOverrideBytes so a corrupt or runaway override file cannot OOM the process or balloon the next AI prompt.
func OverridePath ¶
OverridePath returns the absolute path for the context override file of a given task.