Documentation
¶
Index ¶
- func CredentialFault(err error) error
- func Encode(data any, err error) []byte
- func ErrorDetails(err error) (code, hint string)
- func InvalidArgument(message string) error
- func NewFault(code, message, hint string, cause error) error
- func OAuthManager(name string, p ProviderConfig, store credentials.Store) (*oauthclient.Manager, error)
- func ValidateSearchAliases(aliases map[string][]string) error
- type ActionMetrics
- type CallPlan
- type Capability
- type Config
- type DiscoveryFailure
- type DiscoveryResult
- type Envelope
- type Fault
- type HTTPResult
- type Provider
- type ProviderConfig
- type ProviderSummary
- type Request
- type Runtime
- type RuntimeOptions
- type SearchIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CredentialFault ¶
CredentialFault converts a deliberately redacted credential error into the common machine-readable envelope. Backend stderr never becomes a cause.
func ErrorDetails ¶
func InvalidArgument ¶
func OAuthManager ¶
func OAuthManager(name string, p ProviderConfig, store credentials.Store) (*oauthclient.Manager, error)
func ValidateSearchAliases ¶
Types ¶
type ActionMetrics ¶
type Capability ¶
type Config ¶
type Config struct {
SchemaVersion int `json:"schema_version,omitempty"`
Providers map[string]ProviderConfig `json:"providers"`
Credentials map[string]credentials.Definition `json:"credentials,omitempty"`
SearchAliases map[string][]string `json:"search_aliases,omitempty"`
}
func LoadConfig ¶
type DiscoveryFailure ¶
type DiscoveryResult ¶
type DiscoveryResult struct {
Items []Capability `json:"items"`
Complete bool `json:"complete"`
Failures []DiscoveryFailure `json:"failures"`
}
type HTTPResult ¶
type ProviderConfig ¶
type ProviderConfig struct {
Type string `json:"type"`
Transport string `json:"transport,omitempty"`
Command []string `json:"command,omitempty"`
URL string `json:"url,omitempty"`
Spec string `json:"spec,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Env map[string]string `json:"env,omitempty"`
Allow []string `json:"allow,omitempty"`
Description string `json:"description,omitempty"`
Keywords []string `json:"keywords,omitempty"`
SkillFiles []string `json:"skill_files,omitempty"`
SkillDescriptions []string `json:"skill_descriptions,omitempty"`
BearerCredential string `json:"bearer_credential,omitempty"`
HeaderCredentials map[string]string `json:"header_credentials,omitempty"`
EnvCredentials map[string]string `json:"env_credentials,omitempty"`
OAuth *oauthclient.Config `json:"oauth,omitempty"`
OAuthProfile string `json:"-"`
CatalogSource string `json:"catalog_source,omitempty"`
// contains filtered or unexported fields
}
type ProviderSummary ¶
type Request ¶
type Request struct {
Action string `json:"action"`
Target string `json:"target,omitempty"`
Query string `json:"query,omitempty"`
Args map[string]any `json:"args,omitempty"`
Method string `json:"method,omitempty"`
Path string `json:"path,omitempty"`
Limit int `json:"limit,omitempty"`
Match string `json:"match,omitempty"`
Full bool `json:"full,omitempty"`
BestEffort bool `json:"bestEffort,omitempty"`
Refresh bool `json:"refresh,omitempty"`
ProvidersOnly bool `json:"providersOnly,omitempty"`
AllTools bool `json:"allTools,omitempty"`
ExpectedContract string `json:"expectedContract,omitempty"`
HTTPQuery map[string][]string `json:"httpQuery,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Body json.RawMessage `json:"body,omitempty"`
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewWithCredentials ¶
func NewWithCredentials(c Config, maxBytes int64, resolver *credentials.Resolver) *Runtime
func NewWithOptions ¶
func NewWithOptions(c Config, maxBytes int64, resolver *credentials.Resolver, opts RuntimeOptions) *Runtime
func (*Runtime) Stats ¶
func (r *Runtime) Stats() map[string]ActionMetrics
Stats is a bounded, process-local snapshot. It contains no provider, query or argument labels.
type RuntimeOptions ¶
type RuntimeOptions struct {
CatalogTTL time.Duration
DiscoveryConcurrency int
ProviderTimeout time.Duration
CatalogMaxBytes int64
}
RuntimeOptions belongs to one immutable config and one security principal. A zero TTL preserves live discovery; concurrency defaults to four providers.
type SearchIndex ¶
type SearchIndex struct {
// contains filtered or unexported fields
}
func NewSearchIndex ¶
func NewSearchIndex(caps []Capability, providers map[string]ProviderConfig) *SearchIndex
func NewSearchIndexWithAliases ¶
func NewSearchIndexWithAliases(caps []Capability, providers map[string]ProviderConfig, aliases map[string][]string) (*SearchIndex, error)
NewSearchIndexWithAliases adds bounded, one-pass query aliases from trusted local metadata. It does not alter operation authority or argument values.
func (*SearchIndex) Search ¶
func (index *SearchIndex) Search(query string) []Capability
Search preserves exact IDs as the strongest evidence. Scores are ranking values, not probabilities; fuzzy fallback is used only with no lexical hits.