Documentation
¶
Overview ¶
Package plan implements plan mode: the agent first explores read-only and drafts a plan, then calls ExitPlanMode to present it for approval. On approval the session transitions out of the read-only "plan" permission mode so the agent can implement. A Controller holds the current mode; the harness reads it via QueryInput.PermissionModeFunc so the change takes effect mid-loop.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnterTool ¶
func EnterTool(c *Controller) tool.CoreTool
EnterTool lets the agent switch itself into plan mode mid-session.
Types ¶
type Approver ¶
Approver is the host's plan-approval callback (a CLI prompt, a GUI, or an automated policy). It returns whether the plan is approved and, if not, optional feedback for the agent to revise against.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller tracks the live permission mode for a planning session.
func NewController ¶
func NewController(start, target permission.Mode) *Controller
NewController starts in `start` mode; on approval the mode becomes `target` (defaulting to acceptEdits when empty).
func (*Controller) Enter ¶
func (c *Controller) Enter()
Enter transitions into plan mode, remembering the mode to restore.
func (*Controller) InPlan ¶
func (c *Controller) InPlan() bool
InPlan reports whether the controller is currently in plan mode.
func (*Controller) Mode ¶
func (c *Controller) Mode() permission.Mode
Mode returns the current permission mode (thread-safe; read by the harness).