describe

package
v0.13.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDescriptorFile = ".claw-describe.json"

Variables

This section is empty.

Functions

func BuildFeedRegistry

func BuildFeedRegistry(descriptors map[string]*ServiceDescriptor) (map[string]FeedSpec, error)

func ResolveBuildContextDir

func ResolveBuildContextDir(baseDir string, raw interface{}) (string, error)

func ResolveBuildContextFile

func ResolveBuildContextFile(baseDir string, buildRaw interface{}, containerPath string) (string, error)

Types

type AuthDescriptor

type AuthDescriptor struct {
	Type string `json:"type"`
	Env  string `json:"env,omitempty"`
}

type DiscoveryMetadata added in v0.13.0

type DiscoveryMetadata struct {
	Command            string   `json:"command,omitempty"`
	Args               []string `json:"args,omitempty"`
	WrapperImage       string   `json:"wrapper_image,omitempty"`
	WrapperImageDigest string   `json:"wrapper_image_digest,omitempty"`
	WrapperImageID     string   `json:"wrapper_image_id,omitempty"`
	DiscoveredAt       string   `json:"discovered_at,omitempty"`
	MCPProtocolVersion string   `json:"mcp_protocol_version,omitempty"`
	ToolCount          int      `json:"tool_count,omitempty"`
}

type EndpointDescriptor

type EndpointDescriptor struct {
	Method      string `json:"method"`
	Path        string `json:"path"`
	Description string `json:"description,omitempty"`
}

type FeedDescriptor

type FeedDescriptor struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	TTL         int    `json:"ttl"`
	Description string `json:"description,omitempty"`
}

type FeedSpec

type FeedSpec struct {
	Name        string
	Source      string
	Path        string
	TTL         int
	Description string
	Auth        *AuthDescriptor
}

type MCPDescriptor added in v0.11.0

type MCPDescriptor struct {
	Transport string `json:"transport,omitempty"`
	Path      string `json:"path,omitempty"`
}

type MemoryDescriptor added in v0.5.0

type MemoryDescriptor struct {
	Recall *MemoryEndpoint `json:"recall,omitempty"`
	Retain *MemoryEndpoint `json:"retain,omitempty"`
	Forget *MemoryEndpoint `json:"forget,omitempty"`
}

type MemoryEndpoint added in v0.5.0

type MemoryEndpoint struct {
	Path string `json:"path"`
}

type ServiceDescriptor

type ServiceDescriptor struct {
	Version        int                  `json:"version"`
	Description    string               `json:"description,omitempty"`
	Feeds          []FeedDescriptor     `json:"feeds,omitempty"`
	MCP            *MCPDescriptor       `json:"mcp,omitempty"`
	Tools          []ToolDescriptor     `json:"tools,omitempty"`
	Memory         *MemoryDescriptor    `json:"memory,omitempty"`
	Endpoints      []EndpointDescriptor `json:"endpoints,omitempty"`
	Auth           *AuthDescriptor      `json:"auth,omitempty"`
	Skill          string               `json:"skill,omitempty"`
	XClawDiscovery *DiscoveryMetadata   `json:"x-claw-discovery,omitempty"`
}

func LoadFromBuildContext

func LoadFromBuildContext(baseDir string, buildRaw interface{}, descriptorPath string) (*ServiceDescriptor, string, error)

func LoadFromFile

func LoadFromFile(path string) (*ServiceDescriptor, error)

func LoadFromImage

func LoadFromImage(imageRef, descriptorPath string) (*ServiceDescriptor, error)

func Parse

func Parse(data []byte) (*ServiceDescriptor, error)

func (*ServiceDescriptor) Validate

func (d *ServiceDescriptor) Validate() error

type ToolDescriptor added in v0.5.0

type ToolDescriptor struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	InputSchema map[string]interface{} `json:"inputSchema"`
	HTTP        *ToolHTTP              `json:"http,omitempty"`
	Annotations map[string]interface{} `json:"annotations,omitempty"`
}

type ToolHTTP added in v0.5.0

type ToolHTTP struct {
	Method  string `json:"method"`
	Path    string `json:"path"`
	Body    string `json:"body,omitempty"`
	BodyKey string `json:"body_key,omitempty"`
}

type ToolRegistry added in v0.5.0

type ToolRegistry map[string][]ToolSpec

func BuildToolRegistry added in v0.5.0

func BuildToolRegistry(descriptors map[string]*ServiceDescriptor) (ToolRegistry, error)

type ToolSpec added in v0.5.0

type ToolSpec struct {
	Name        string
	Service     string
	Description string
	InputSchema map[string]interface{}
	HTTP        *ToolHTTP
	MCP         *MCPDescriptor
	Annotations map[string]interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL