Documentation
¶
Overview ¶
Package model is PlugIt's canonical intermediate representation of an API (SPEC §3.4). Ingesters produce a Manifest; curation, lint, token estimation and serving consume it. The package is pure: no I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
ContentType string `json:"contentType"`
Schema json.RawMessage `json:"schema"`
Required bool `json:"required,omitempty"`
Encoding map[string]Encoding `json:"encoding,omitempty"`
}
Body is a tool's request body.
type Encoding ¶
Encoding is how one form field is serialized (an OpenAPI encoding object, with explode resolved). Fields without one use style form, explode true.
type IssueKind ¶
type IssueKind string
IssueKind classifies an ingest problem. Lint rules map these to findings.
type Location ¶
type Location int
Location is where an argument is sent in the HTTP request.
func ParseLocation ¶
ParseLocation parses a location name as produced by Location.String.
func (Location) MarshalJSON ¶
MarshalJSON encodes l as its name.
func (*Location) UnmarshalJSON ¶
UnmarshalJSON decodes a name produced by MarshalJSON.
type Manifest ¶
type Manifest struct {
Title string `json:"title"`
Version string `json:"version"`
SpecVersion string `json:"specVersion"`
Servers []string `json:"servers,omitempty"`
Tools []Tool `json:"tools"`
Warnings []string `json:"warnings,omitempty"`
}
Manifest is the result of ingesting one spec.
type OpKey ¶
type OpKey string
OpKey is a tool's stable identity across renames and syncs: "METHOD /path/template", e.g. "GET /repos/{owner}/{repo}/issues".
type Param ¶
type Param struct {
Name string `json:"name"`
UpstreamName string `json:"upstreamName"`
In Location `json:"in"`
Required bool `json:"required,omitempty"`
Schema json.RawMessage `json:"schema"`
Desc string `json:"desc,omitempty"`
Hidden bool `json:"hidden,omitempty"`
}
Param is one argument of a tool.
type Safety ¶
type Safety int
Safety classifies what calling a tool can do.
func SafetyForMethod ¶
SafetyForMethod classifies an HTTP method. Unknown methods are treated as Destructive so that they fail closed under every policy mode.
func (Safety) MarshalJSON ¶
MarshalJSON encodes s as its name.
func (*Safety) UnmarshalJSON ¶
UnmarshalJSON decodes a name produced by MarshalJSON.
type Tool ¶
type Tool struct {
Key OpKey `json:"key"`
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Method string `json:"method"`
Path string `json:"path"`
Params []Param `json:"params,omitempty"`
Body *Body `json:"body,omitempty"`
Tags []string `json:"tags,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
Safety Safety `json:"safety"`
Issues []Issue `json:"issues,omitempty"`
}
Tool is one API operation exposed (or exposable) as an MCP tool.