toolconfirmation

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 18 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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