cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CatalogFixtureEnv    = "DWS_CATALOG_FIXTURE"
	CacheDirEnv          = "DWS_CACHE_DIR"
	DefaultMarketBaseURL = "https://mcp.dingtalk.com"
)

Variables

This section is empty.

Functions

func NewMCPCommand

func NewMCPCommand(ctx context.Context, loader CatalogLoader, runner executor.Runner) *cobra.Command

func NewSchemaCommand

func NewSchemaCommand(loader CatalogLoader) *cobra.Command

func OverridePriority

func OverridePriority(cmd *cobra.Command) int

OverridePriority delegates to cobracmd.OverridePriority.

func SetOverridePriority

func SetOverridePriority(cmd *cobra.Command, priority int)

SetOverridePriority delegates to cobracmd.SetOverridePriority.

func ValidateInputSchema

func ValidateInputSchema(params map[string]any, schema map[string]any) error

ValidateInputSchema performs strict local validation for MCP tool inputs. It enforces required/type/enum checks and rejects unknown properties by default.

Types

type CatalogLoader

type CatalogLoader interface {
	Load(context.Context) (ir.Catalog, error)
}

type EnvironmentLoader

type EnvironmentLoader struct {
	LookupEnv func(string) (string, bool)
	// CatalogBaseURLOverride allows tests to redirect catalog discovery.
	CatalogBaseURLOverride string
	// DiscoveryTimeout overrides the default timeout for live registry discovery.
	// Zero means use defaultDiscoveryTimeout.
	DiscoveryTimeout time.Duration
}

func NewEnvironmentLoader

func NewEnvironmentLoader() EnvironmentLoader

func (EnvironmentLoader) Load

type FixtureLoader

type FixtureLoader struct {
	Path string
}

func (FixtureLoader) Load

type FlagKind

type FlagKind string

type FlagSpec

type FlagSpec struct {
	PropertyName string
	FlagName     string
	Alias        string
	Shorthand    string
	Kind         FlagKind
	Description  string
}

func BuildFlagSpecs

func BuildFlagSpecs(schema map[string]any, hints map[string]ir.CLIFlagHint) []FlagSpec

type StaticLoader

type StaticLoader struct {
	Catalog ir.Catalog
}

func (StaticLoader) Load

func (l StaticLoader) Load(_ context.Context) (ir.Catalog, error)

Jump to

Keyboard shortcuts

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