Documentation
¶
Index ¶
- Constants
- func Changes(expected, published *Metadata) ([]string, error)
- func CheckTools(tools []Tool) error
- func Generate(ctx context.Context, options GenerateRequest) (map[string][]byte, error)
- func Load() error
- func SameContract(a, b *Contract) (bool, error)
- type Contract
- type Event
- type GenerateRequest
- type Identity
- type Metadata
- type Resource
- type Tool
Constants ¶
View Source
const ( Marker = "holon-generated-apps-v1" MediaType = "application/vnd.holon.mcp-contract.v1+json" )
View Source
const PythonOwnTypes = "_own.py"
View Source
const TypeScriptDeclarations = "index.d.mts"
View Source
const TypeScriptModule = "index.mjs"
Variables ¶
This section is empty.
Functions ¶
func CheckTools ¶
CheckTools requires each tool to have a valid MCP name and an MCP Tool inputSchema that is an object of type object.
func SameContract ¶
Types ¶
type Contract ¶
type Contract struct {
Tools []Tool `json:"tools"`
Resources []Resource `json:"resources,omitempty"`
Events []Event `json:"events,omitempty"`
}
func (Contract) MarshalJSON ¶
type Event ¶
type Event struct {
Name string `json:"name"`
Input json.RawMessage `json:"inputSchema"`
Payload json.RawMessage `json:"payloadSchema"`
}
type GenerateRequest ¶
type GenerateRequest struct {
Target string `json:"target"`
Identity Identity `json:"identity"`
Requires map[string]Identity `json:"requires,omitempty"`
Contracts map[string]*Contract `json:"contracts,omitempty"`
Own string `json:"own,omitempty"`
OwnTools *Contract `json:"own_tools,omitempty"`
App string `json:"app,omitempty"`
GoModule string `json:"go_module,omitempty"`
}
type Metadata ¶
type Metadata struct {
Identity Identity `json:"identity"`
Schema *Contract `json:"schema,omitempty"`
Requires map[string]string `json:"requires,omitempty"`
}
func ParseMetadata ¶
type Resource ¶
type Resource struct {
URI string `json:"uri"`
Output json.RawMessage `json:"outputSchema"`
}
type Tool ¶
type Tool struct {
Name string `json:"name"`
Input json.RawMessage `json:"inputSchema"`
Output json.RawMessage `json:"outputSchema,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.