Documentation
¶
Index ¶
- type AgentChange
- type AgentDiff
- type ConfigDiff
- type Handler
- func (h *Handler) CurrentConfig() *config.Stack
- func (h *Handler) Reload(ctx context.Context) (*ReloadResult, error)
- func (h *Handler) SetLogger(logger *slog.Logger)
- func (h *Handler) SetNoExpand(noExpand bool)
- func (h *Handler) SetRegisterServerFunc(fn func(ctx context.Context, server config.MCPServer, hostPort int) error)
- type MCPServerChange
- type MCPServerDiff
- type ReloadResult
- type ResourceChange
- type ResourceDiff
- type Watcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentChange ¶
AgentChange represents a modification to an existing agent.
type AgentDiff ¶
type AgentDiff struct {
Added []config.Agent
Removed []config.Agent
Modified []AgentChange
}
AgentDiff contains changes to agents.
type ConfigDiff ¶
type ConfigDiff struct {
MCPServers MCPServerDiff
Agents AgentDiff
Resources ResourceDiff
// NetworkChanged indicates if the network config changed (requires full restart)
NetworkChanged bool
}
ConfigDiff represents the differences between two stack configurations.
func ComputeDiff ¶
func ComputeDiff(old, new *config.Stack) *ConfigDiff
ComputeDiff computes the differences between two stack configurations.
func (*ConfigDiff) IsEmpty ¶
func (d *ConfigDiff) IsEmpty() bool
IsEmpty returns true if there are no changes.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler manages hot reload for a running stack.
func NewHandler ¶
func NewHandler(stackPath string, currentCfg *config.Stack, gateway *mcp.Gateway, rt *runtime.Orchestrator, port, basePort, gatewayPort int) *Handler
NewHandler creates a reload handler.
func (*Handler) CurrentConfig ¶
CurrentConfig returns the current stack configuration.
func (*Handler) Reload ¶
func (h *Handler) Reload(ctx context.Context) (*ReloadResult, error)
Reload reloads the configuration from disk and applies changes.
func (*Handler) SetNoExpand ¶
SetNoExpand sets whether to skip OpenAPI env var expansion.
type MCPServerChange ¶
MCPServerChange represents a modification to an existing MCP server.
type MCPServerDiff ¶
type MCPServerDiff struct {
Added []config.MCPServer
Removed []config.MCPServer
Modified []MCPServerChange
}
MCPServerDiff contains changes to MCP servers.
type ReloadResult ¶
type ReloadResult struct {
Success bool `json:"success"`
Message string `json:"message"`
Added []string `json:"added,omitempty"`
Removed []string `json:"removed,omitempty"`
Modified []string `json:"modified,omitempty"`
Errors []string `json:"errors,omitempty"`
}
ReloadResult contains the result of a reload operation.
type ResourceChange ¶
ResourceChange represents a modification to an existing resource.
type ResourceDiff ¶
type ResourceDiff struct {
Added []config.Resource
Removed []config.Resource
Modified []ResourceChange
}
ResourceDiff contains changes to resources.
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher monitors a stack file for changes and triggers reload.
func NewWatcher ¶
NewWatcher creates a file watcher for the given stack path. onChange is called when the file changes (after debouncing).
func (*Watcher) SetDebounce ¶
SetDebounce sets the debounce duration for file changes.
func (*Watcher) Watch ¶
Watch starts watching the file for changes. Blocks until context is cancelled.
We watch the parent directory rather than the file directly because most editors use atomic saves (write to temp file, then rename). When a file is renamed over the watched file, fsnotify loses track of it. Watching the directory catches all events including renames.