Documentation
¶
Overview ¶
Package mcpcontract holds the typed-contract wire format Holon publishes in image metadata and helpers for generated files. Comparison and generation live in mcptype.
Index ¶
Constants ¶
const ( Marker = "holon-generated-apps-v1" DigestAnnotation = "sh.holon.contract.digest" MediaType = "application/vnd.holon.mcp-contract.v1+json" )
Variables ¶
This section is empty.
Functions ¶
func StableTime ¶
StableTime returns the mtime Holon gives a file it writes into a build context. BuildKit's incremental sync resends a file only when its size or mtime changed, so the time must be fixed for unchanged content and differ for changed content of the same size. It is 1980 (the zip epoch) plus a content-derived offset of under 105 days.
Types ¶
type Contract ¶
type Contract struct {
Tools []Tool `json:"tools"`
Resources []Resource `json:"resources,omitempty"`
}
func (Contract) MarshalJSON ¶
MarshalJSON writes "tools" as an array even when there are none, as the v1 contract document requires.
type Metadata ¶
type Metadata struct {
Identity Identity `json:"identity"`
Schema *Contract `json:"schema,omitempty"`
Requires map[string]string `json:"requires,omitempty"`
}
Metadata is the contract document stored as an OCI blob. Requires pins each dependency to its exact document bytes in the consumer's repository.
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"`
}