Documentation
¶
Index ¶
Constants ¶
View Source
const AgentNameHeader = "X-Agent-Name"
AgentNameHeader carries the agent slug (e.g. "claude-code") to the MCP server, which uses it to attribute requests to a specific agent.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent interface {
// Name returns a stable identifier (e.g. "claude-code").
Name() string
// Detected reports whether the agent is installed on this machine.
Detected() bool
// AsGlobalInjector returns the user-level injector if this agent supports global config.
AsGlobalInjector() (GlobalInjector, bool)
// AsWorkspaceInjector returns the workspace injector if this agent supports project config.
AsWorkspaceInjector() (WorkspaceInjector, bool)
}
Agent is an AI coding agent that may be installed on the current machine.
func FilterDetected ¶
FilterDetected returns the subset of agents whose Detected() method returns true.
func NewRegistry ¶
func NewRegistry() []Agent
NewRegistry returns all known agent adapters initialised with the current user's home directory.
type GlobalInjector ¶
type GlobalInjector interface {
// GlobalConfigPath returns the absolute path to the global config file.
GlobalConfigPath() string
// InjectGlobal writes the SafeDep entry. Idempotent; preserves all other keys.
InjectGlobal(cfg MCPConfig) error
// RemoveGlobal deletes the SafeDep entry. No-op if absent.
RemoveGlobal() error
// GlobalConfigured reports whether the SafeDep entry is present in the
// global config file. Returns false (no error) when the file is absent.
GlobalConfigured() (bool, error)
}
GlobalInjector writes or removes the SafeDep MCP config from a user-level config file.
type WorkspaceInjector ¶
type WorkspaceInjector interface {
// WorkspaceConfigPath returns the absolute path to the workspace config file.
// The path may or may not be inside workspaceDir depending on the agent.
WorkspaceConfigPath(workspaceDir string) string
// InjectWorkspace writes the SafeDep entry. Idempotent; preserves all other keys.
InjectWorkspace(workspaceDir string, cfg MCPConfig) error
// RemoveWorkspace deletes the SafeDep entry. No-op if absent.
RemoveWorkspace(workspaceDir string) error
// WorkspaceConfigured reports whether the SafeDep entry is present in the
// workspace config file. Returns false (no error) when the file is absent.
WorkspaceConfigured(workspaceDir string) (bool, error)
}
WorkspaceInjector writes or removes the SafeDep MCP config from a workspace config file.
Click to show internal directories.
Click to hide internal directories.