customcommands

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package customcommands loads project and user-defined slash commands.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("custom command not found")

Functions

This section is empty.

Types

type Command

type Command struct {
	Name             string   `json:"name"`
	Path             string   `json:"path"`
	Source           string   `json:"source"`
	PluginRoot       string   `json:"plugin_root,omitempty"`
	PluginData       string   `json:"plugin_data,omitempty"`
	Description      string   `json:"description,omitempty"`
	AllowedTools     []string `json:"allowed_tools,omitempty"`
	ArgumentHint     string   `json:"argument_hint,omitempty"`
	Arguments        []string `json:"arguments,omitempty"`
	FrontmatterError string   `json:"frontmatter_error,omitempty"`
	Preview          string   `json:"preview"`
	Body             string   `json:"body,omitempty"`
	Active           bool     `json:"active"`
	ShadowedBy       string   `json:"shadowed_by,omitempty"`
	ShadowedByPath   string   `json:"shadowed_by_path,omitempty"`
}

func Find

func Find(configHome, workspace, name string) (Command, error)

func Load

func Load(configHome, workspace string) ([]Command, error)

func LoadWithManifests

func LoadWithManifests(configHome, workspace string, manifests []plugins.Manifest) ([]Command, error)

LoadWithManifests loads commands from a resolved runtime plugin set.

type DiscoveryRoot

type DiscoveryRoot struct {
	Source     string `json:"source"`
	Label      string `json:"label"`
	Path       string `json:"path"`
	Exists     bool   `json:"exists"`
	PluginID   string `json:"plugin_id,omitempty"`
	PluginRoot string `json:"plugin_root,omitempty"`
}

func Sources

func Sources(configHome, workspace string) []DiscoveryRoot

func SourcesWithManifests

func SourcesWithManifests(configHome, workspace string, manifests []plugins.Manifest) []DiscoveryRoot

SourcesWithManifests reports command roots for a resolved runtime plugin set.

type InstallReport

type InstallReport struct {
	Kind   string `json:"kind"`
	Action string `json:"action"`
	Status string `json:"status"`
	Name   string `json:"name"`
	Source string `json:"source"`
	Path   string `json:"path"`
	Target string `json:"target"`
}

func Install

func Install(source string, targetRoot string, explicitName string, targetLabel string) (InstallReport, error)

type Rendered

type Rendered struct {
	Name         string   `json:"name"`
	Path         string   `json:"path"`
	Source       string   `json:"source"`
	PluginRoot   string   `json:"plugin_root,omitempty"`
	PluginData   string   `json:"plugin_data,omitempty"`
	Description  string   `json:"description,omitempty"`
	AllowedTools []string `json:"allowed_tools,omitempty"`
	ArgumentHint string   `json:"argument_hint,omitempty"`
	Arguments    []string `json:"arguments,omitempty"`
	Args         string   `json:"args,omitempty"`
	Rendered     string   `json:"rendered"`
}

func Render

func Render(command Command, args string) Rendered

func RenderWithSession

func RenderWithSession(command Command, args string, sessionID string) Rendered

type SourceNotFoundError

type SourceNotFoundError struct {
	Source string
	Err    error
}

func (SourceNotFoundError) Error

func (e SourceNotFoundError) Error() string

func (SourceNotFoundError) Unwrap

func (e SourceNotFoundError) Unwrap() error

type UninstallReport

type UninstallReport struct {
	Kind    string `json:"kind"`
	Action  string `json:"action"`
	Status  string `json:"status"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	Removed bool   `json:"removed"`
}

func Uninstall

func Uninstall(name string, roots []string) (UninstallReport, error)

Jump to

Keyboard shortcuts

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