plan

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractTitle

func ExtractTitle(content string) string

ExtractTitle pulls the first heading or non-empty line from plan content as a display title. Used by the TUI to label review surfaces.

Types

type AllowedPrompt added in v0.1.3

type AllowedPrompt struct {
	Tool   string
	Prompt string
}

AllowedPrompt is a semantic description of an action the user pre-approved during plan exit (e.g. {Tool: "Bash", Prompt: "run tests"}). Unlike a command-prefix whitelist, prompts are surfaced to the user during ask dialogs as reference labels — they do NOT auto-allow tool calls.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(session *agent.Session, approvalEngine *approval.Engine, planStore *storage.PlanStore, sessionStore *storage.Store) *Manager

func (*Manager) Cancel

func (c *Manager) Cancel() error

Cancel is invoked from /plan cancel: ends plan mode without expecting any plan file to exist. Sets cancelPending so the next user prompt picks up a one-shot "you have exited plan mode" reminder — exit_plan_mode carries an equivalent signal in its tool_result, but /plan cancel has no tool_result to ride on, so the reminder pipeline closes that gap.

func (*Manager) CurrentPlan

func (c *Manager) CurrentPlan() (string, error)

func (*Manager) CurrentPlanPath

func (c *Manager) CurrentPlanPath() string

func (*Manager) Enter

func (c *Manager) Enter() (string, error)

Enter transitions from PhaseOff to PhasePlanning, generating a fresh plan file slug and writing the plan-mode overlay prompt into the session.

func (*Manager) Exit added in v0.1.3

func (c *Manager) Exit() (string, error)

Exit unconditionally transitions out of plan mode and returns the plan content. User approval is enforced upstream by approval.Engine.Decide (ask-style: the tool declares it needs approval and the engine handles the prompt). When this method is reached the user has already approved or the call is from /plan cancel.

func (*Manager) Restore

func (c *Manager) Restore(state State) error

func (*Manager) Snapshot

func (c *Manager) Snapshot() State

type Phase

type Phase string
const (
	PhaseOff      Phase = "off"
	PhasePlanning Phase = "planning"
)

type State

type State struct {
	Phase   Phase
	Slug    string
	PreMode string
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *Store

func (*Store) Replace

func (s *Store) Replace(state State)

func (*Store) Snapshot

func (s *Store) Snapshot() State

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL