persondecide

package
v1.172.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 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 persondecide is how a tool call an agent makes waits on a person (#2643, #2875): the question the person's MCP client asks them (elicitation: an input request on a 2026-07-28 client, asked in band on an older one that can be asked), and otherwise a request filed in the portal's Approvals, answered with APPROVAL_REQUIRED so the agent stops and tells the person. A change the person accepted is carried out with the key of the move they accepted; a move whose state changed between the question and the answer is not carried out.

The site moves (promote, rollback, a public domain) and the renames of an application or a script decide through this one flow.

Index

Constants

View Source
const (
	CodeApprovalRequired = "approval_required"
	CodeApprovalFiled    = "approval_filed"
	CategoryApproval     = "approval_required"
)

The error code and category a change that waits on the person answers with: the codes a held tool call answers with (#2437), so a client reads them alike.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flow

type Flow struct {
	// Prefix is what every key of this tool's moves starts with, so an
	// answer meant for another tool's question is not read as this one's.
	Prefix string
	// File files the request a person decides in the portal and returns its
	// id.
	File func(ctx context.Context, m Move) (string, error)
	// Message is the text an error is answered with.
	Message func(error) string
	// Result is the result a value is answered with.
	Result func(v any) *mcp.CallToolResult
	// Give is what the agent is told to give the person when the request is
	// filed; "" is the request alone.
	Give string
	// Changed is what a call answers when the subject moved between the
	// question and the person's answer; "" is a general sentence.
	Changed string
}

Flow is one tool's use of the decision.

func (Flow) Run

func (f Flow) Run(ctx context.Context, req *mcp.CallToolRequest, run func(decided string) (any, error)) *mcp.CallToolResult

Run carries out run, as the person's answer when the call carries one, and asks the person when run answers that the change waits on them. run is given the key of the move the person accepted, "" for none.

type Move

type Move interface {
	// Key names the change exactly: an answer or approval for one change
	// never carries out another. It starts with the flow's prefix.
	Key() string
	// Question is what the person is asked.
	Question() string
}

Move is one change an agent asked for, as the person is asked about it.

type Waiting

type Waiting interface {
	error
	Waiting() Move
}

Waiting is the error a change returns while it waits on the person.

Jump to

Keyboard shortcuts

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