mcpruntime

package
v0.0.0-...-3c1f2a6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageRepository = "1panel/mcp-server"
	ContainerName   = "1panel-mcp"

	SocketDirectory = "/etc/1panel/mcp-runtime"
	CoreSocket      = SocketDirectory + "/core.sock"
)

Variables

View Source
var ErrUnsupported = errors.New("MCP Docker runtime requires a local rootful Linux Docker daemon without user namespace remapping")

Functions

func ValidateImage

func ValidateImage(value string) error

Types

type CleanupReference

type CleanupReference struct {
	ContainerID         string `json:"containerID"`
	PreviousContainerID string `json:"previousContainerID"`
	PreviousImageID     string `json:"previousImageID"`
}

type CleanupResult

type CleanupResult struct {
	ContainerRemoved    bool   `json:"containerRemoved,omitempty"`
	ImageRemoved        bool   `json:"imageRemoved,omitempty"`
	ImageRetainedReason string `json:"imageRetainedReason,omitempty"`
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New() *Controller

func (*Controller) Handle

func (c *Controller) Handle(ctx context.Context, req Request) (Response, error)

func (*Controller) HandleWithProgress

func (c *Controller) HandleWithProgress(ctx context.Context, req Request, progress func(PullProgress) error) (Response, error)

type PullEvent

type PullEvent struct {
	Type string `json:"type"`
	PullProgress
	Error string `json:"error,omitempty"`
}

type PullProgress

type PullProgress struct {
	Status  string `json:"status,omitempty"`
	ID      string `json:"id,omitempty"`
	Current int64  `json:"current,omitempty"`
	Total   int64  `json:"total,omitempty"`
}

type Request

type Request struct {
	Operation      string            `json:"operation"`
	Image          string            `json:"image"`
	Port           int               `json:"port"`
	Enabled        bool              `json:"enabled"`
	Restart        bool              `json:"restart"`
	ImageID        string            `json:"imageID,omitempty"`
	StreamProgress bool              `json:"streamProgress,omitempty"`
	Cleanup        *CleanupReference `json:"cleanup,omitempty"`
	DeleteOldImage bool              `json:"deleteOldImage,omitempty"`
}

type Response

type Response struct {
	State         *State            `json:"state,omitempty"`
	Catalog       json.RawMessage   `json:"catalog,omitempty"`
	Logs          string            `json:"logs,omitempty"`
	Error         string            `json:"error,omitempty"`
	ImageID       string            `json:"imageID,omitempty"`
	Cleanup       *CleanupReference `json:"cleanup,omitempty"`
	CleanupResult *CleanupResult    `json:"cleanupResult,omitempty"`
}

type State

type State struct {
	Installed      bool   `json:"installed"`
	Status         string `json:"status"`
	Ready          bool   `json:"ready"`
	Reason         string `json:"reason,omitempty"`
	AdapterVersion string `json:"adapterVersion,omitempty"`
	Image          string `json:"image,omitempty"`
	ImageID        string `json:"imageID,omitempty"`
}

Jump to

Keyboard shortcuts

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