Documentation
¶
Overview ¶
Package execution provides Capability → Driver Command mapping for EAN 2.0.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AIAdapter ¶
type AIAdapter struct {
// contains filtered or unexported fields
}
AIAdapter bridges EAN Capability Invoke → ai_agent.Agent task pipeline. Create is always real (quota + mock/remote pipeline); optional wait polls until waiting_confirm / failed / cancelled or ctx deadline.
func NewAIAdapter ¶
NewAIAdapter wraps an existing Agent. agent must be non-nil.
func SharedAIAdapter ¶
func SharedAIAdapter() *AIAdapter
SharedAIAdapter returns a process-wide default adapter (local mode Agent). Northbound MQTT/NATS runtimes use this when Server has not injected a custom Agent.
type AICommandExecutor ¶
type AICommandExecutor interface {
Execute(ctx context.Context, cmd DriverCommand) (any, error)
}
AICommandExecutor runs AI.* DriverCommands (protocol reverse / doc parse).
type CapabilityMapper ¶
type CapabilityMapper struct {
// contains filtered or unexported fields
}
CapabilityMapper maps EAN Capability Invokes to Driver Commands.
func NewCapabilityMapper ¶
func NewCapabilityMapper(executor Executor) *CapabilityMapper
NewCapabilityMapper creates a mapper. executor may be nil (returns mapping only errors on execute).
func (*CapabilityMapper) Map ¶
func (m *CapabilityMapper) Map(req capability.InvokeRequest, cap capability.Capability) (DriverCommand, error)
Map converts a Capability Invoke into a DriverCommand without executing it. For unified capabilities (unified=true), protocol may be empty — the DriverExecutor will auto-resolve it from the channel's Protocol field.
func (*CapabilityMapper) MapAndExecute ¶
func (m *CapabilityMapper) MapAndExecute(ctx context.Context, req capability.InvokeRequest, cap capability.Capability) (any, error)
MapAndExecute implements capability.Mapper.
type DeviceScanner ¶
type DeviceScanner interface {
ScanDevice(ctx context.Context, channelID, deviceID string, params map[string]any) (any, error)
ScanChannel(ctx context.Context, channelID string, params map[string]any) (any, error)
}
DeviceScanner is the optional ScanEngine browse path.
type DiagnosticsProvider ¶
DiagnosticsProvider is the optional diagnostics path.
type DriverCommand ¶
type DriverCommand struct {
Protocol string
Command string // ReadPoints | WritePoint | ScanDevices | GetDevicePoints | Diagnostics | AI.*
Args map[string]any
}
DriverCommand is the lower-level command produced by Capability mapping.
type DriverExecutor ¶
type DriverExecutor struct {
// contains filtered or unexported fields
}
DriverExecutor executes mapped DriverCommands against ShadowCore / ScanEngine / Driver via SouthboundManager (typically *core.ChannelManager). AI.* commands delegate to AIAdapter.
func NewDriverExecutor ¶
func NewDriverExecutor(sb model.SouthboundManager) *DriverExecutor
NewDriverExecutor wires a real southbound backend. sb may be nil (Execute errors). AI commands require SetAI / NewWiredExecutor.
func NewWiredExecutor ¶
func NewWiredExecutor(sb model.SouthboundManager) *DriverExecutor
NewWiredExecutor builds a DriverExecutor with SharedAIAdapter attached.
func (*DriverExecutor) Execute ¶
func (e *DriverExecutor) Execute(ctx context.Context, cmd DriverCommand) (any, error)
Execute runs a DriverCommand on the real I/O path.
func (*DriverExecutor) SetAI ¶
func (e *DriverExecutor) SetAI(ai AICommandExecutor)
SetAI attaches an AI command executor (protocol_reverse / doc_parse).
type Executor ¶
type Executor interface {
Execute(ctx context.Context, cmd DriverCommand) (any, error)
}
Executor executes a mapped DriverCommand against ScanEngine / Driver / AI adapters. Wiring to concrete southbound managers is intentionally deferred so the Capability Runtime can be brought up without changing ScanEngine hot paths.