projection

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientAntigravity = "antigravity"
	ClientClaude      = "claude"
	ClientCodex       = "codex"
	ClientCopilot     = "copilot"
	ClientVSCode      = "vscode"
)

Client identifiers used by MCP projection and `mcp.servers[].clients`.

View Source
const BuiltInDispatchServerID = "agent-layer"

BuiltInDispatchServerID is the reserved ID of the Agent Layer MCP server that exposes the Agent Dispatch tools. It is derived Agent Layer state rather than a `[[mcp.servers]]` entry, and config validation keeps the same ID unavailable to user-defined servers.

Variables

This section is empty.

Functions

func EffectiveServerIDs added in v0.15.0

func EffectiveServerIDs(cfg config.Config, client string) []string

EffectiveServerIDs returns the sorted IDs of every MCP server a client actually receives.

func EnabledServerIDs

func EnabledServerIDs(servers []config.MCPServer, client string) []string

EnabledServerIDs returns sorted MCP server ids enabled for the client.

Types

type Approvals

type Approvals struct {
	AllowCommands bool
	AllowMCP      bool
	Commands      []string
}

Approvals captures the resolved approvals policy and allowlist.

func BuildApprovals

func BuildApprovals(cfg config.Config, commands []string) Approvals

BuildApprovals resolves approvals.mode into per-feature flags.

type EnvVarResolver

type EnvVarResolver = config.EnvVarReplacer

EnvVarResolver returns a replacement string for a resolved env var.

func ClientPlaceholderResolver added in v0.5.6

func ClientPlaceholderResolver(clientSyntax string) EnvVarResolver

ClientPlaceholderResolver returns a resolver that preserves placeholders in client-specific syntax. clientSyntax is a format string like "${%s}" or "${env:%s}" where %s is the env var name. Built-in placeholders (like AL_REPO_ROOT) are resolved to their actual values.

func FullValueResolver added in v0.5.6

func FullValueResolver(_ map[string]string) EnvVarResolver

FullValueResolver returns a resolver that keeps resolved env values. Missing values still error during substitution before the resolver runs.

type MCPServerResolveError added in v0.5.6

type MCPServerResolveError struct {
	ServerID string
	Err      error
}

MCPServerResolveError wraps a server-specific resolve error.

func (*MCPServerResolveError) Error added in v0.5.6

func (e *MCPServerResolveError) Error() string

func (*MCPServerResolveError) Unwrap added in v0.5.6

func (e *MCPServerResolveError) Unwrap() error

type ResolvedMCPServer

type ResolvedMCPServer struct {
	ID            string
	Transport     string
	URL           string
	Headers       map[string]string
	HTTPTransport string
	Command       string
	Args          []string
	Env           map[string]string
	// ToolTimeoutSeconds is a per-server execution bound. Only the built-in
	// Agent Dispatch server sets it, and only clients with a documented
	// per-server timeout field project it; zero means the client default.
	ToolTimeoutSeconds int
}

ResolvedMCPServer is a normalized MCP server with env substitution applied.

func BuiltInDispatchServer added in v0.15.0

func BuiltInDispatchServer(cfg config.Config, client string) (ResolvedMCPServer, bool)

BuiltInDispatchServer returns the derived Agent Dispatch MCP server for one client, or false when that client is not an enabled dispatch caller. It is the single source every surface reads from: native MCP projection, permission allowlists, warning accounting, and doctor.

func EffectiveMCPServers added in v0.15.0

func EffectiveMCPServers(cfg config.Config, env map[string]string, client string, resolver EnvVarResolver) ([]ResolvedMCPServer, error)

EffectiveMCPServers returns every MCP server a client actually receives: the user's enabled servers plus the derived built-in Agent Dispatch server.

func ResolveEffectiveEnabledMCPServers added in v0.15.0

func ResolveEffectiveEnabledMCPServers(cfg config.Config, env map[string]string) ([]ResolvedMCPServer, error)

ResolveEffectiveEnabledMCPServers resolves every MCP server that at least one enabled client actually receives, including the built-in Agent Dispatch server. Warning and doctor accounting use it so the tools Agent Layer itself adds are measured alongside user-configured servers.

func ResolveEnabledMCPServers added in v0.5.6

func ResolveEnabledMCPServers(servers []config.MCPServer, env map[string]string) ([]ResolvedMCPServer, error)

ResolveEnabledMCPServers resolves all enabled MCP servers without client filtering. This is useful for operations like doctor checks that need to connect to all servers.

func ResolveMCPServers

func ResolveMCPServers(servers []config.MCPServer, env map[string]string, client string, resolver EnvVarResolver) ([]ResolvedMCPServer, error)

ResolveMCPServers filters and resolves MCP servers for a client.

Jump to

Keyboard shortcuts

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