magicui

package
v0.59.5 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicUIRegistryURL = "https://raw.githubusercontent.com/magicuidesign/magicui/main/registry.json"
	MagicUIDocsURL     = "https://magicui.design"
	MagicUIGitHubURL   = "https://github.com/magicuidesign/magicui"
)

Constants for cache keys and TTLs

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	Data      any
	Timestamp time.Time
}

CacheEntry represents a cached value with timestamp

type ComponentInfo

type ComponentInfo struct {
	Name         string   `json:"name"`
	Title        string   `json:"title"`
	Description  string   `json:"description"`
	Dependencies []string `json:"dependencies,omitempty"`
	Files        []File   `json:"files,omitempty"`
}

ComponentInfo holds details for a Magic UI component

type File

type File struct {
	Path   string `json:"path"`
	Type   string `json:"type"`
	Target string `json:"target"`
}

File represents a component file from the registry

type MagicUITool

type MagicUITool struct{}

MagicUITool provides access to Magic UI component library

func (*MagicUITool) Definition

func (t *MagicUITool) Definition() mcp.Tool

Definition returns the tool's definition for MCP registration

func (*MagicUITool) Execute

func (t *MagicUITool) Execute(ctx context.Context, logger *logrus.Logger, cache *sync.Map, args map[string]any) (*mcp.CallToolResult, error)

Execute executes the Magic UI tool

func (*MagicUITool) ProvideExtendedInfo

func (t *MagicUITool) ProvideExtendedInfo() *tools.ExtendedHelp

ProvideExtendedInfo provides detailed usage information for the Magic UI tool

type Registry

type Registry struct {
	Name     string         `json:"name"`
	Homepage string         `json:"homepage"`
	Items    []RegistryItem `json:"items"`
}

Registry represents the Magic UI registry structure

type RegistryItem

type RegistryItem struct {
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	Title        string   `json:"title,omitempty"`
	Description  string   `json:"description,omitempty"`
	Dependencies []string `json:"dependencies,omitempty"`
	Files        []File   `json:"files,omitempty"`
}

RegistryItem represents a single item in the Magic UI registry

Jump to

Keyboard shortcuts

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