Documentation
¶
Overview ¶
Package agentroute defines the unified Agent ingress route model (docs/plans/unified-agent-runtime.md §6). An AgentRoute targets a stable agent_id; the resolved Agent's runtime.type selects the execution backend, so changing an Agent's runtime never changes its route, URL, or VirtualKey allowlist. M5 exposes this model through Admin, CLI, bundles, Caddy, and the standalone dispatcher.
Index ¶
- Constants
- Variables
- func DecodeStoredAgentRoute(data []byte) (any, error)
- func DecodeTargetAgentID(targetPolicy json.RawMessage) (string, error)
- type AgentLookup
- type AgentRoute
- type AgentRouteBaseConfig
- type AgentRouteConfig
- type AgentRouteResolver
- func (r *AgentRouteResolver) ConfigManager() *routecore.AgentRouteConfigManager
- func (r *AgentRouteResolver) CreateConfig(ctx context.Context, route routecore.AgentRouteConfig, tag string) error
- func (r *AgentRouteResolver) DeleteConfig(ctx context.Context, routeID string) error
- func (r *AgentRouteResolver) GetConfig(ctx context.Context, routeID string) (routecore.AgentRouteConfig, error)
- func (r *AgentRouteResolver) ListConfigs(ctx context.Context, opts RouteListOptions) ([]routecore.AgentRouteConfig, error)
- func (r *AgentRouteResolver) Resolve(ctx context.Context, cfg routecore.AgentRouteConfig) (*AgentRoute, error)
- func (r *AgentRouteResolver) ResolveByID(ctx context.Context, routeID string) (*AgentRoute, error)
- func (r *AgentRouteResolver) SetAgentLookup(lookup AgentLookup)
- func (r *AgentRouteResolver) UpdateConfig(ctx context.Context, routeID string, route routecore.AgentRouteConfig) error
- type RouteAuthPolicy
- type RouteKind
- type RouteListOptions
- type RouteMatch
- type RouteProtocol
Constants ¶
const (
RouteKindAgent = routecore.RouteKindAgent
)
const (
RouteProtocolAgent = routecore.RouteProtocolAgent
)
Variables ¶
var ( ErrRouteNotConfigured = routecore.ErrRouteNotConfigured ErrStaticRouteReadOnly = routecore.ErrStaticRouteReadOnly ErrInvalidRouteID = routecore.ErrInvalidRouteID )
Functions ¶
func DecodeStoredAgentRoute ¶
func DecodeTargetAgentID ¶
func DecodeTargetAgentID(targetPolicy json.RawMessage) (string, error)
DecodeTargetAgentID extracts the agent id from a persisted agent route target policy. The dispatcher uses it to stamp explicit agent attribution on the turn span before dispatch.
Types ¶
type AgentLookup ¶
AgentLookup reports whether a target Agent exists. Existence is a management validity check only: disabled Agents and Agents whose backend is not currently executable remain valid route targets (plan §6.2).
type AgentRoute ¶
type AgentRoute struct {
AgentRouteBaseConfig
AgentID string `json:"agent_id"`
}
AgentRoute is the runtime route object used by dispatcher/runtime code.
func NewAgentRouteFromConfig ¶
func NewAgentRouteFromConfig(cfg AgentRouteBaseConfig) (AgentRoute, error)
func NewRuntimeAgentRoute ¶
func NewRuntimeAgentRoute(cfg AgentRouteConfig) AgentRoute
func (AgentRoute) Config ¶
func (r AgentRoute) Config() AgentRouteConfig
func (AgentRoute) MarshalJSON ¶
func (r AgentRoute) MarshalJSON() ([]byte, error)
func (AgentRoute) ToConfig ¶
func (r AgentRoute) ToConfig() (AgentRouteBaseConfig, error)
func (*AgentRoute) UnmarshalJSON ¶
func (r *AgentRoute) UnmarshalJSON(data []byte) error
type AgentRouteBaseConfig ¶
type AgentRouteBaseConfig = routecore.AgentRouteConfig
type AgentRouteConfig ¶
type AgentRouteConfig struct {
AgentRouteBaseConfig
AgentID string `json:"agent_id"`
}
AgentRouteConfig is the expanded config form with direct agent_id access.
func NewAgentRouteConfigFromConfig ¶
func NewAgentRouteConfigFromConfig(cfg AgentRouteBaseConfig) (AgentRouteConfig, error)
func (AgentRouteConfig) MarshalJSON ¶
func (r AgentRouteConfig) MarshalJSON() ([]byte, error)
func (*AgentRouteConfig) Normalize ¶
func (r *AgentRouteConfig) Normalize()
func (*AgentRouteConfig) NormalizeTimestamps ¶
func (r *AgentRouteConfig) NormalizeTimestamps(now time.Time)
func (AgentRouteConfig) ToConfig ¶
func (r AgentRouteConfig) ToConfig() (AgentRouteBaseConfig, error)
func (*AgentRouteConfig) UnmarshalJSON ¶
func (r *AgentRouteConfig) UnmarshalJSON(data []byte) error
type AgentRouteResolver ¶
type AgentRouteResolver struct {
// contains filtered or unexported fields
}
func NewAgentRouteResolver ¶
func NewAgentRouteResolver(configManager *routecore.AgentRouteConfigManager) *AgentRouteResolver
func (*AgentRouteResolver) ConfigManager ¶
func (r *AgentRouteResolver) ConfigManager() *routecore.AgentRouteConfigManager
func (*AgentRouteResolver) CreateConfig ¶
func (r *AgentRouteResolver) CreateConfig(ctx context.Context, route routecore.AgentRouteConfig, tag string) error
func (*AgentRouteResolver) DeleteConfig ¶
func (r *AgentRouteResolver) DeleteConfig(ctx context.Context, routeID string) error
func (*AgentRouteResolver) GetConfig ¶
func (r *AgentRouteResolver) GetConfig(ctx context.Context, routeID string) (routecore.AgentRouteConfig, error)
func (*AgentRouteResolver) ListConfigs ¶
func (r *AgentRouteResolver) ListConfigs(ctx context.Context, opts RouteListOptions) ([]routecore.AgentRouteConfig, error)
func (*AgentRouteResolver) Resolve ¶
func (r *AgentRouteResolver) Resolve(ctx context.Context, cfg routecore.AgentRouteConfig) (*AgentRoute, error)
func (*AgentRouteResolver) ResolveByID ¶
func (r *AgentRouteResolver) ResolveByID(ctx context.Context, routeID string) (*AgentRoute, error)
func (*AgentRouteResolver) SetAgentLookup ¶
func (r *AgentRouteResolver) SetAgentLookup(lookup AgentLookup)
SetAgentLookup wires the optional target-existence check used by CreateConfig/UpdateConfig. When nil, target validation is skipped.
func (*AgentRouteResolver) UpdateConfig ¶
func (r *AgentRouteResolver) UpdateConfig(ctx context.Context, routeID string, route routecore.AgentRouteConfig) error
type RouteAuthPolicy ¶
type RouteAuthPolicy = routecore.RouteAuthPolicy
type RouteListOptions ¶
type RouteListOptions = routecore.RouteListOptions
type RouteMatch ¶
type RouteMatch = routecore.RouteMatchPolicy
type RouteProtocol ¶
type RouteProtocol = routecore.RouteProtocol