Documentation
¶
Overview ¶
Package plan provides plan-mode guidance and approval-gated exit, matching core/plan-mode. The fixed plan:policy section (order 500) appears in the system prompt only while plan mode is active. Entering emits plan/mode(on). The exit_plan_mode tool asks through M14 User Questions: approval removes the section and emits plan/mode(off); rejection keeps plan mode active.
Index ¶
Constants ¶
const PlanPolicySectionName = "plan_policy"
PlanPolicySectionName names the plan:policy section.
Variables ¶
This section is empty.
Functions ¶
func Enter ¶
func Enter(sl *session.SessionLog, sys *sysprompt.Assembler) error
Enter emits plan/mode(on) and installs the plan:policy section.
func Exit ¶
func Exit(sl *session.SessionLog, sys *sysprompt.Assembler) error
Exit emits plan/mode(off) and removes the plan:policy section.
func IsActive ¶
func IsActive(sl *session.SessionLog) bool
IsActive reports whether plan mode is active.
Types ¶
type ExitPlanModeResult ¶
type ExitPlanModeResult struct {
// Approved reports whether approval was granted.
Approved bool
// Exited reports actual exit, which requires approval.
Exited bool
}
ExitPlanModeResult reports exit_plan_mode approval.
type ExitPlanModeTool ¶
type ExitPlanModeTool struct {
// contains filtered or unexported fields
}
ExitPlanModeTool removes plan:policy only after UserQuestion approval.
func NewExitPlanModeTool ¶
func NewExitPlanModeTool(sl *session.SessionLog, sys *sysprompt.Assembler) *ExitPlanModeTool
NewExitPlanModeTool creates the exit_plan_mode tool.
func (*ExitPlanModeTool) Description ¶
func (t *ExitPlanModeTool) Description() string
Description returns the tool description.
func (*ExitPlanModeTool) Execute ¶
Execute requests approval, exiting and removing plan:policy only if approved.
func (*ExitPlanModeTool) Name ¶
func (t *ExitPlanModeTool) Name() string
Name returns the tool name.