Documentation
¶
Index ¶
- Constants
- func AddScheduleToConfig(...) error
- func RemoveScheduleFromConfig(path, name string) error
- func SetAuthConfig(path, passwordHash, sessionSecret string) error
- func UpdateAgentInConfig(path, name string, changes map[string]any) error
- func UpdateScheduleInConfig(...) error
- type LifecycleManager
- func (lm *LifecycleManager) AddPlugin(ctx context.Context, name string, cfg config.PluginConfig) error
- func (lm *LifecycleManager) AddTool(ctx context.Context, name string, cfg config.ToolConfig) error
- func (lm *LifecycleManager) ListPlugins() []PluginStatus
- func (lm *LifecycleManager) ListTools() []ServerStatus
- func (lm *LifecycleManager) RemovePlugin(ctx context.Context, name string) error
- func (lm *LifecycleManager) RemoveTool(ctx context.Context, name string) error
- func (lm *LifecycleManager) ToolManager() *Manager
- func (lm *LifecycleManager) TrackPlugin(name string, cfg config.PluginConfig)
- type Manager
- func (m *Manager) AdoptFrom(source *Manager)
- func (m *Manager) Close() error
- func (m *Manager) Execute(ctx context.Context, call llm.ToolCall) (string, error)
- func (m *Manager) RegisterServer(ctx context.Context, name string, cfg config.ToolConfig) error
- func (m *Manager) RegisterSession(ctx context.Context, name string, session *mcp.ClientSession) error
- func (m *Manager) ServerInfo(name string) (ServerStatus, bool)
- func (m *Manager) ServerNames() []string
- func (m *Manager) ToolDefs() []llm.ToolDef
- func (m *Manager) ToolNames() []string
- func (m *Manager) UnregisterServer(name string) error
- type PluginStatus
- type ServerStatus
Constants ¶
const DefaultMaxTools = 50
DefaultMaxTools is the combined limit for tools + plugins.
Variables ¶
This section is empty.
Functions ¶
func AddScheduleToConfig ¶ added in v0.9.0
func AddScheduleToConfig(path, name, schedExpr, skillName, channel, sessionMode, sessionTier, agent string, tags []string, enabled bool) error
AddScheduleToConfig appends a [[schedules]] entry to the TOML config.
func RemoveScheduleFromConfig ¶ added in v0.9.0
RemoveScheduleFromConfig removes a [[schedules]] entry matched by name.
func SetAuthConfig ¶ added in v0.13.0
SetAuthConfig persists password_hash and session_secret to [api.auth] in the TOML config file. Used by the PIN-protected account setup flow.
func UpdateAgentInConfig ¶ added in v0.11.0
UpdateAgentInConfig updates fields of an [[agents]] entry matched by name. Only keys present in changes are applied (partial update).
Types ¶
type LifecycleManager ¶ added in v0.1.0
type LifecycleManager struct {
// contains filtered or unexported fields
}
LifecycleManager coordinates adding and removing MCP tools and plugins at runtime, persisting changes to the TOML config file.
func NewLifecycleManager ¶ added in v0.1.0
func NewLifecycleManager(toolMgr *Manager, configPath string, maxTools int, logger *slog.Logger) *LifecycleManager
NewLifecycleManager creates a lifecycle manager wrapping the given tool.Manager. configPath is the path to denkeeper.toml. maxTools is the combined limit (0 uses DefaultMaxTools).
func (*LifecycleManager) AddPlugin ¶ added in v0.1.0
func (lm *LifecycleManager) AddPlugin(ctx context.Context, name string, cfg config.PluginConfig) error
func (*LifecycleManager) AddTool ¶ added in v0.1.0
func (lm *LifecycleManager) AddTool(ctx context.Context, name string, cfg config.ToolConfig) error
AddTool validates the config, spawns the MCP server, registers it, and persists the [tools.<name>] section to denkeeper.toml.
func (*LifecycleManager) ListPlugins ¶ added in v0.1.0
func (lm *LifecycleManager) ListPlugins() []PluginStatus
ListPlugins returns metadata for all registered plugins.
func (*LifecycleManager) ListTools ¶ added in v0.1.0
func (lm *LifecycleManager) ListTools() []ServerStatus
ListTools returns metadata for all registered MCP tool servers.
func (*LifecycleManager) RemovePlugin ¶ added in v0.1.0
func (lm *LifecycleManager) RemovePlugin(ctx context.Context, name string) error
RemovePlugin unregisters and removes [plugins.<name>] from denkeeper.toml.
func (*LifecycleManager) RemoveTool ¶ added in v0.1.0
func (lm *LifecycleManager) RemoveTool(ctx context.Context, name string) error
RemoveTool unregisters the MCP server and removes [tools.<name>] from denkeeper.toml.
func (*LifecycleManager) ToolManager ¶ added in v0.1.0
func (lm *LifecycleManager) ToolManager() *Manager
ToolManager returns the underlying tool.Manager.
func (*LifecycleManager) TrackPlugin ¶ added in v0.1.0
func (lm *LifecycleManager) TrackPlugin(name string, cfg config.PluginConfig)
TrackPlugin registers a plugin that was loaded at startup so ListPlugins can report it. This avoids re-registering already-running plugins.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages MCP tool server connections and tool execution.
func NewManager ¶
NewManager creates a manager with no servers registered.
func (*Manager) AdoptFrom ¶
AdoptFrom stores a reference to source as a parent manager. The child manager delegates tool lookups to the parent, so tools added to the parent at runtime (e.g. via the REST API) are immediately visible to all agents. Both managers share the same underlying *mcp.ClientSession pointers, which is safe for concurrent use.
func (*Manager) Execute ¶
Execute runs a single tool call and returns the text result. If the tool is not found locally, it delegates to the parent manager.
func (*Manager) RegisterServer ¶
RegisterServer connects to an MCP server (stdio subprocess or remote SSE) based on the transport field in cfg, and discovers its available tools.
func (*Manager) RegisterSession ¶
func (m *Manager) RegisterSession(ctx context.Context, name string, session *mcp.ClientSession) error
RegisterSession registers an already-connected MCP client session without spawning a subprocess. Use this for in-process servers (e.g. configmcp).
func (*Manager) ServerInfo ¶ added in v0.1.0
func (m *Manager) ServerInfo(name string) (ServerStatus, bool)
ServerInfo returns metadata about a registered server. The second return value is false if the server is not registered. Checks the parent manager if the server is not found locally.
func (*Manager) ServerNames ¶ added in v0.1.0
ServerNames returns the names of all registered MCP servers, including those from the parent manager (if any).
func (*Manager) ToolDefs ¶
ToolDefs returns OpenAI-format tool definitions for all registered tools, including those from the parent manager (if any).
func (*Manager) ToolNames ¶
ToolNames returns the names of all registered MCP tools, including those from the parent manager (if any).
func (*Manager) UnregisterServer ¶ added in v0.1.0
UnregisterServer stops the MCP server for the given config name, removes its tools from the tool map, and closes the connection. Returns an error if the server is not registered.
type PluginStatus ¶ added in v0.1.0
type PluginStatus struct {
Name string `json:"name"`
Type string `json:"type"`
Command string `json:"command,omitempty"`
Image string `json:"image,omitempty"`
Args []string `json:"args,omitempty"`
Capabilities []string `json:"capabilities,omitempty"`
ToolNames []string `json:"tool_names"`
Status string `json:"status"`
}
PluginStatus exposes metadata about a registered plugin.
type ServerStatus ¶ added in v0.1.0
type ServerStatus struct {
Name string `json:"name"`
Command string `json:"command,omitempty"`
Args []string `json:"-"` // excluded from JSON (may contain secrets)
ArgsCount int `json:"args_count"` // safe count for display
ToolNames []string `json:"tool_names"`
Status string `json:"status"` // "connected", "error", "stopped", "disabled"
Transport string `json:"transport,omitempty"`
URL string `json:"url,omitempty"` // redacted
}
ServerStatus exposes metadata about a registered MCP server.