a2aack

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package a2aack turns a remote A2A task round trip into the agent composition layer's AckWait. Wait resolves one gated step through a Remote: send, poll, result, verify, and ack. See docs/plans/a2aack.md for the contract.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoClient means Wait got a nil client.
	ErrNoClient = errors.New("a2aack: client is required")
	// ErrNoPoll means the poll interval is not positive.
	ErrNoPoll = errors.New("a2aack: poll interval must be positive")
	// ErrShortTimeout means the timeout does not cover one poll.
	ErrShortTimeout = errors.New("a2aack: timeout must cover one poll")
	// ErrRemoteFailed means the remote task ended failed, canceled,
	// rejected, or in a state a2aack cannot resolve.
	ErrRemoteFailed = errors.New("a2aack: remote task failed")
	// ErrTimeout means the exchange outran its deadline or ctx.
	ErrTimeout = errors.New("a2aack: remote task timed out")
	// ErrSignerMismatch means the result verified but its signer is
	// not the pinned Options.ExpectSigner.
	ErrSignerMismatch = errors.New("a2aack: result signer is not the expected remote")
)

Functions

func Wait

func Wait(c Remote, opts Options) (func(context.Context, envelope.Message) (envelope.Ack, error), error)

Wait returns the AckWait that resolves one step through c. Wait validates c and opts before it returns the AckWait, never inside a poll tick. It returns (nil, ErrNoClient) for a nil c and (nil, opts.Validate()) for invalid options.

Types

type Options

type Options struct {
	Poll    time.Duration // between Status calls; required, positive
	Timeout time.Duration // whole-exchange deadline; at least Poll
	// ExpectSigner pins the remote: when set, the confirmed ack
	// requires the result's Signer to equal it. Empty accepts any
	// signer that verifies, which suits loopback and tests only.
	ExpectSigner string
}

Options configures the AckWait poll loop.

func (Options) Validate

func (o Options) Validate() error

Validate checks that Poll is positive and Timeout covers at least one Poll.

type Remote

Remote is the remote-task round trip a2aack polls: send, status, result. *a2aclient.Client implements it.

Jump to

Keyboard shortcuts

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