Documentation
¶
Overview ¶
Package agentcard provides a block-partitioned A2A Agent Card upstream with deterministic failure modes and a per-scope request counter.
The control plane fetches a passthrough Agent proxy's public card from its upstream and caches the result, so the property worth asserting is how many times the upstream was actually contacted. A scenario addresses the service as
http://testbench:3013/<block>/<scope>/<mode>
where <scope> is a scenario-unique name and <mode> selects the upstream's behaviour. The control plane appends the well-known card path, and every card request increments the scope's counter, which GET /<block>/test/requests?scope=<scope> reports.
Index ¶
Constants ¶
const ( // ModeOK serves the scope's card. ModeOK = "ok" // ModeAlternate serves a different card for the same scope, so a changed upstream is // distinguishable from a cached one. ModeAlternate = "alternate" // ModeAuth serves the card only when CredentialHeader carries Credential(scope), and answers // 401 otherwise. ModeAuth = "auth" // ModeMalformed answers 200 with a body that is not a JSON document. ModeMalformed = "malformed" // ModeSlow answers only after the control plane's fetch budget has elapsed. ModeSlow = "slow" // ModeServerError answers 500. ModeServerError = "status500" )
Card modes, the second path segment.
const CredentialHeader = "X-Card-Key"
CredentialHeader is the header the auth mode requires.
const Port = 3013
Port is the container port used by the testbench.
Variables ¶
This section is empty.
Functions ¶
func Card ¶
Card returns the deterministic Agent Card served for a scope under the given name. It carries every key a managed card requires, so the same document can also be saved as managed content.
func Credential ¶
Credential returns the credential ModeAuth expects for a scope.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements testbench.Service and testbench.Partitioned.
func (*Service) PartitionKey ¶
PartitionKey returns the partitioning strategy used by this stateful service.