Documentation
¶
Overview ¶
Package planmodetool implements the EnterPlanMode and ExitPlanMode tools.
These tools let the model request permission to enter/exit plan mode. Entering requires user consent (the TUI shows a prompt); exiting presents the plan and asks the user to approve before implementation begins.
Port of src/tools/EnterPlanModeTool/ and src/tools/ExitPlanModeTool/.
Index ¶
- type EnterPlanMode
- func (t *EnterPlanMode) Description() string
- func (t *EnterPlanMode) Execute(ctx context.Context, _ json.RawMessage) (tool.Result, error)
- func (t *EnterPlanMode) InputSchema() json.RawMessage
- func (t *EnterPlanMode) IsConcurrencySafe(_ json.RawMessage) bool
- func (t *EnterPlanMode) IsReadOnly(_ json.RawMessage) bool
- func (t *EnterPlanMode) Name() string
- type ExitPlanMode
- func (t *ExitPlanMode) Description() string
- func (t *ExitPlanMode) Execute(ctx context.Context, raw json.RawMessage) (tool.Result, error)
- func (t *ExitPlanMode) InputSchema() json.RawMessage
- func (t *ExitPlanMode) IsConcurrencySafe(_ json.RawMessage) bool
- func (t *ExitPlanMode) IsReadOnly(_ json.RawMessage) bool
- func (t *ExitPlanMode) Name() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EnterPlanMode ¶
type EnterPlanMode struct {
// SetMode changes the active permission mode (nil = no-op).
SetMode func(permissions.Mode)
// AskEnter, when non-nil, prompts the user for approval before entering.
// Returns true if the user consents.
AskEnter func(ctx context.Context) bool
}
EnterPlanMode is the tool the model calls to request plan mode entry. The TUI must install SetMode and AskEnter callbacks before use.
func (*EnterPlanMode) Description ¶
func (t *EnterPlanMode) Description() string
func (*EnterPlanMode) Execute ¶
func (t *EnterPlanMode) Execute(ctx context.Context, _ json.RawMessage) (tool.Result, error)
func (*EnterPlanMode) InputSchema ¶
func (t *EnterPlanMode) InputSchema() json.RawMessage
func (*EnterPlanMode) IsConcurrencySafe ¶
func (t *EnterPlanMode) IsConcurrencySafe(_ json.RawMessage) bool
func (*EnterPlanMode) IsReadOnly ¶
func (t *EnterPlanMode) IsReadOnly(_ json.RawMessage) bool
func (*EnterPlanMode) Name ¶
func (t *EnterPlanMode) Name() string
type ExitPlanMode ¶
type ExitPlanMode struct {
// SetMode changes the active permission mode (nil = no-op).
SetMode func(permissions.Mode)
// AskApprove, when non-nil, shows the plan to the user and returns true if
// they approve. When nil, the plan is auto-approved.
AskApprove func(ctx context.Context, plan string) bool
}
ExitPlanMode is the tool the model calls to present a plan and ask for approval. The user is shown the plan text and either approves or rejects.
func (*ExitPlanMode) Description ¶
func (t *ExitPlanMode) Description() string
func (*ExitPlanMode) Execute ¶
func (t *ExitPlanMode) Execute(ctx context.Context, raw json.RawMessage) (tool.Result, error)
func (*ExitPlanMode) InputSchema ¶
func (t *ExitPlanMode) InputSchema() json.RawMessage
func (*ExitPlanMode) IsConcurrencySafe ¶
func (t *ExitPlanMode) IsConcurrencySafe(_ json.RawMessage) bool
func (*ExitPlanMode) IsReadOnly ¶
func (t *ExitPlanMode) IsReadOnly(_ json.RawMessage) bool
func (*ExitPlanMode) Name ¶
func (t *ExitPlanMode) Name() string