Documentation
¶
Index ¶
- Constants
- Variables
- func AvailableText(install string) string
- func Catalog() (plugins []CatalogPlugin, markets []MarketInfo, errs []string)
- func ClaudeUnused(dir string) []string
- func Commit(dir string) string
- func MarketplacesText() string
- func PluginsText(list []api.PluginInfo) string
- func RemoveMarketplace(name string) error
- func RemovePlugin(name string) error
- func UpdateMarketplace(ctx context.Context, name string) (before, after string, err error)
- func UpdatePlugin(ctx context.Context, name string) (before, after string, err error)
- func UserPluginsDir() string
- type Auth
- type CatalogPlugin
- type Installed
- type Key
- type MCPConfig
- type Manifest
- type MarketInfo
- type MarketPlugin
- type Marketplace
- type Plugin
- type Said
- func (s Said) Installed(got Installed) string
- func (s Said) MarketAdded(m Marketplace) string
- func (s Said) MarketRemoved(name string) string
- func (s Said) MarketUpdated(name, before, after string) string
- func (s Said) NeedsCredentials(name string) string
- func (s Said) Removed(name string) string
- func (s Said) Updated(name, before, after string) string
- type ToolConfig
Constants ¶
const BuiltIn = "kairocode"
BuiltIn is the name of the marketplace KairoCode comes with.
const ClaudeMarketplaceManifest = ".claude-plugin/marketplace.json"
ClaudeMarketplaceManifest is where a Claude Code marketplace has its catalog.
const ManifestFile = "kairocode-plugin.json"
ManifestFile is the file KairoCode reads in a plugin's folder.
const MarketplaceManifest = "kairocode-marketplace.json"
MarketplaceManifest is the file a marketplace has at its top.
Variables ¶
var NamePattern = regexp.MustCompile(`^[a-zA-Z0-9_-]{1,64}$`)
NamePattern is a name the model's API takes.
Functions ¶
func AvailableText ¶
AvailableText lists the marketplaces' plugins not installed, by marketplace, and how to install one (install: the command's words).
func Catalog ¶
func Catalog() (plugins []CatalogPlugin, markets []MarketInfo, errs []string)
Catalog is every marketplace's plugins, the marketplaces, and why any could not be read.
func ClaudeUnused ¶
ClaudeUnused is what of a Claude Code plugin at dir KairoCode does not use: its commands, subagents, hooks, language servers and output styles.
func RemoveMarketplace ¶
RemoveMarketplace removes a marketplace the user added. The plugins installed from it stay.
func RemovePlugin ¶
RemovePlugin removes an installed plugin; its credentials stay until disconnected.
func UpdateMarketplace ¶
UpdateMarketplace brings a git marketplace to its latest commit: the commits before and after.
func UpdatePlugin ¶
UpdatePlugin brings an installed plugin up to date: one of a marketplace is installed again as the marketplace has it now (a git one brought to its latest commit first); a git one is pulled. The versions before and after.
func UserPluginsDir ¶
func UserPluginsDir() string
UserPluginsDir is the folder of the user's plugins.
Types ¶
type Auth ¶
type Auth struct {
Type string `json:"type"` // none, key, oauth
Keys []Key `json:"keys"`
ClientID string `json:"client_id"` // oauth: a client registered beforehand (else registered dynamically)
}
Auth is what a plugin needs to connect: none, keys (each named, given where the manifest writes {secret:NAME}), or oauth.
type CatalogPlugin ¶
type CatalogPlugin = api.CatalogPlugin
type Installed ¶
type Installed struct {
Name string
From string // the marketplace, or the URL or folder
Version string
Auth string // none, key, oauth
// ConnectNow: its marketplace says to ask for its credentials as it
// is installed.
ConnectNow bool
}
Installed is a plugin as it was installed.
type MCPConfig ¶
type MCPConfig struct {
Type string `json:"type"` // local, remote
Command []string `json:"command"`
Environment map[string]string `json:"environment"`
URL string `json:"url"`
Headers map[string]string `json:"headers"`
Enabled *bool `json:"enabled"`
}
MCPConfig is an MCP server as kairocode.json and a plugin's manifest write it.
type Manifest ¶
type Manifest struct {
Name string `json:"name"`
Description string `json:"description"`
Version string `json:"version"`
MCP *MCPConfig `json:"mcp"`
Auth Auth `json:"auth"`
Tools map[string]ToolConfig `json:"tools"` // effects, by the server's tool name (* ends a prefix)
}
Manifest is a plugin's kairocode-plugin.json.
type MarketInfo ¶
type MarketInfo = api.MarketInfo
type MarketPlugin ¶
type MarketPlugin struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
// Source: ./<path> in the marketplace, or a git URL: then Path, a
// folder in the repository (else all of it); Ref, a branch or a tag;
// SHA, the commit (else the ref's latest).
Source string `json:"source"`
Path string `json:"path,omitempty"`
Ref string `json:"ref,omitempty"`
SHA string `json:"sha,omitempty"`
// Connect: when its credentials are asked for: install (as it is
// installed), or use (when it is used; the default).
Connect string `json:"connect,omitempty"`
// Unsupported: why it cannot be installed (a Claude Code one's source
// KairoCode does not take, say).
Unsupported string `json:"-"`
// contains filtered or unexported fields
}
MarketPlugin is a plugin of a marketplace.
type Marketplace ¶
type Marketplace struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
Plugins []MarketPlugin `json:"plugins"`
// Where it is: built in, a folder, or a git repository's clone.
Source string `json:"-"` // as added ("" when built in)
Commit string `json:"-"` // a git one's
BuiltIn bool `json:"-"`
Claude bool `json:"-"` // Claude Code's (.claude-plugin/marketplace.json)
// contains filtered or unexported fields
}
Marketplace is a catalog of plugins.
func AddMarketplace ¶
func AddMarketplace(ctx context.Context, src string) (Marketplace, error)
AddMarketplace adds a marketplace: a folder (read where it is), or a git repository (a URL, or GitHub's owner/repo), cloned and kept at its commit.
func Marketplaces ¶
func Marketplaces() (list []Marketplace, errs []error)
Marketplaces are the marketplaces: the built-in one, then the user's in the order they were added. One that cannot be read is in errs.
type Plugin ¶
type Plugin struct {
opencode.Plugin
Manifest Manifest
Source string // the manifest's path
Err error // why it could not be read
}
Plugin is a plugin as read.
type Said ¶
type Said struct{ Prefix string }
Said is how the plugin commands tell what they did, the same in each front end but for its command (Prefix: "/plugin", "kairocode plugin").
func (Said) MarketAdded ¶
func (s Said) MarketAdded(m Marketplace) string
MarketAdded: m can be installed from.
func (Said) MarketRemoved ¶
MarketRemoved: name is gone; what was installed from it is not.
func (Said) MarketUpdated ¶
MarketUpdated: name went from before to after.
func (Said) NeedsCredentials ¶
NeedsCredentials: name is installed, and is not connected yet.
type ToolConfig ¶
type ToolConfig struct {
Effect string `json:"effect"`
Description string `json:"description"`
Schema json.RawMessage `json:"schema"`
Command []string `json:"command"`
}
ToolConfig is a custom tool, or the effect of an MCP server's tool, as kairocode.json and a plugin's manifest write it.