Documentation
¶
Overview ¶
Package planmode provides a pure interactive plan-mode state machine. It has no I/O; hosts own persistence, prompts, and tool gating.
Index ¶
- type Snapshot
- type State
- type Tracker
- func (t *Tracker) Activate() bool
- func (t *Tracker) AllowsWriteTool(editPath string) bool
- func (t *Tracker) ApproveExit() bool
- func (t *Tracker) ClearPendingExitReminder()
- func (t *Tracker) CompleteExit() bool
- func (t *Tracker) EnterPending() bool
- func (t *Tracker) HasPendingExitReminder() bool
- func (t *Tracker) IncrementReminderCount()
- func (t *Tracker) IsActive() bool
- func (t *Tracker) IsAwaitingPlanApproval() bool
- func (t *Tracker) PlanFilePath() string
- func (t *Tracker) RequestExit(turnInFlight bool) bool
- func (t *Tracker) SetAwaitingPlanApproval(awaiting bool)
- func (t *Tracker) ShouldAutoApproveEdit(editPath string) bool
- func (t *Tracker) ShouldUseFullReminder() bool
- func (t *Tracker) Snapshot() Snapshot
- func (t *Tracker) State() State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
State State `json:"state"`
WasPreviouslyActive bool `json:"was_previously_active"`
ReminderCount uint32 `json:"reminder_count"`
PendingExitReminder bool `json:"pending_exit_reminder"`
AwaitingPlanApproval bool `json:"awaiting_plan_approval"`
}
Snapshot is a persistable view of plan-mode lifecycle state.
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker manages plan-mode transitions without SessionActor / I/O deps.
func FromSnapshot ¶
FromSnapshot restores a tracker. Transient Pending/ExitPending collapse on restart: Pending→Inactive, ExitPending→Inactive with exit reminder.
func (*Tracker) AllowsWriteTool ¶
AllowsWriteTool reports whether a write-side-effect tool may run. In Active plan mode only the plan-file write path is allowed; other writes must be blocked by the host.
func (*Tracker) ApproveExit ¶
ApproveExit completes an approved exit_plan_mode while Active.
func (*Tracker) ClearPendingExitReminder ¶
func (t *Tracker) ClearPendingExitReminder()
func (*Tracker) CompleteExit ¶
CompleteExit finishes ExitPending after the in-flight turn ends.
func (*Tracker) EnterPending ¶
EnterPending is the client toggle ON. Returns whether state changed.
func (*Tracker) HasPendingExitReminder ¶
func (*Tracker) IncrementReminderCount ¶
func (t *Tracker) IncrementReminderCount()
func (*Tracker) IsAwaitingPlanApproval ¶
func (*Tracker) PlanFilePath ¶
func (*Tracker) RequestExit ¶
RequestExit is the client toggle OFF. Idle Active → Inactive; in-flight Active → ExitPending.
func (*Tracker) SetAwaitingPlanApproval ¶
func (*Tracker) ShouldAutoApproveEdit ¶
ShouldAutoApproveEdit reports whether an edit path targets the plan file while plan mode is active (hosts may skip write approval for that file).