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.
type Remote ¶
type Remote interface {
Send(ctx context.Context, msg envelope.Message) (a2aclient.TaskHandle, error)
Status(ctx context.Context, h a2aclient.TaskHandle) (a2aclient.State, error)
Result(ctx context.Context, h a2aclient.TaskHandle) (envelope.Message, error)
}
Remote is the remote-task round trip a2aack polls: send, status, result. *a2aclient.Client implements it.
Click to show internal directories.
Click to hide internal directories.