toolconfirmation

package
v1.145.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package toolconfirmation provides tool approval and rejection dialogs.

Index

Constants

View Source
const ToolRejectionDialogID = "tool-rejection-reason"

ToolRejectionDialogID is the unique identifier for the tool rejection reason dialog.

Variables

This section is empty.

Functions

func NewToolConfirmationDialog

func NewToolConfirmationDialog(ar *animation.Runtime, msg *runtime.ToolCallConfirmationEvent, sessionState ConfirmationSessionState, opts ...messages.Option) common.Dialog

NewToolConfirmationDialog creates a new tool confirmation dialog

func NewToolRejectionReasonDialog

func NewToolRejectionReasonDialog() common.Dialog

NewToolRejectionReasonDialog creates a multi-choice dialog for selecting the reason for rejecting a tool call.

Types

type ConfirmationSessionState

type ConfirmationSessionState interface {
	messages.SessionState
	SetYoloMode(yoloMode bool)
}

ConfirmationSessionState is the session-state surface the confirmation dialog needs: the message list's surface for rendering the tool call, plus the session-wide approval flip for the "all tools" decision.

type Response

type Response struct {
	Response string // "approve", "reject", or "approve-session"
}

Response represents the user's response to tool confirmation

type RuntimeResumeMsg

type RuntimeResumeMsg struct {
	Request runtime.ResumeRequest
}

func HandleToolRejectionResult

func HandleToolRejectionResult(result common.MultiChoiceResult) *RuntimeResumeMsg

HandleToolRejectionResult processes the result from the tool rejection dialog and returns the appropriate RuntimeResumeMsg. Returns nil if the result was cancelled (user should stay in confirmation dialog).

Jump to

Keyboard shortcuts

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