Documentation
¶
Overview ¶
Package capability turns a bundle's OpenAPI interface into executable agent tools: it derives tool descriptors from operations (BuildTools) and invokes the live service (Invoke). It is HTTP/OpenAPI-specific today; when a second interface type is added, the shared shape it reveals should be extracted then rather than guessed now.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMutating ¶
IsMutating reports whether an HTTP method changes server state.
Types ¶
type Credentials ¶
Credentials maps a security-scheme name to its credential value.
type Result ¶
Result is the outcome of a live operation invocation.
func Invoke ¶
func Invoke(ctx context.Context, client *http.Client, op openapi.Operation, doc *openapi.Doc, baseURL string, args map[string]any, creds Credentials) (*Result, error)
Invoke executes an OpenAPI operation against a live service. Non-2xx responses are returned as a normal Result (so the agent sees the status/body); only transport-level failures return a Go error.
type Tool ¶
type Tool struct {
Name string
Method string
Path string
Summary string
Description string
Mutating bool
InputSchema map[string]any
Op openapi.Operation
}
Tool is a single agent-invocable operation derived from an OpenAPI operation.
func BuildTools ¶
BuildTools derives one Tool per operation. When allowWrites is false, mutating operations (POST/PUT/PATCH/DELETE) are omitted. Duplicate tool names (which can arise when operationIds are absent and derived ids collide) are disambiguated with a numeric suffix so no operation is silently dropped.