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 ( Version = 1 Marker = "holon-generated-apps-v1" MediaType = "application/vnd.holon.mcp-contract.v1+json" )
Variables ¶
This section is empty.
Functions ¶
func Managed ¶
Managed reports whether directory is a package Holon generated before the public runtimes: the legacy Python holon/ copy or a Go holon/ client package, both marked in package.json.
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 Expectation ¶
type Metadata ¶
type Metadata struct {
Version int `json:"version"`
Identity Identity `json:"identity"`
Contract *Contract `json:"contract,omitempty"`
Requires map[string]Expectation `json:"requires,omitempty"`
}
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"`
}