engineapi

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package engineapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.0 DO NOT EDIT.

Package engineapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerFromMux

func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type ADCConfig

type ADCConfig struct {
	// Device sysfs path to the IIO device directory, e.g. "/sys/bus/iio/devices/iio:device0"
	Device string `json:"device"`
}

ADCConfig defines model for ADCConfig.

type AgentBootCallback

type AgentBootCallback struct {
	// Address Externally reachable HTTP(S) URL of the engine. Optional — Cloud-mode engines behind NAT may omit this; the backend then stores the address as SQL NULL and rejects push deploys for this agent, while bundle deploys and liveness still work.
	Address *string `json:"address,omitempty"`

	// Error Human-readable failure detail. Set when status='booterror', null otherwise.
	Error *string `json:"error,omitempty"`

	// LoadedDeviceManifest Hardware resources available on the device, keyed by driver instance ID. Drives runtime driver instantiation on the engine.
	LoadedDeviceManifest *DeviceManifest `json:"loadedDeviceManifest,omitempty"`

	// Status Boot result reported by the engine. 'online' when the manifest loaded cleanly and the engine is ready to accept deploy requests; 'booterror' when something blocked startup (missing driver, invalid manifest, etc.).
	Status AgentBootCallbackStatus `json:"status"`
}

AgentBootCallback defines model for AgentBootCallback.

type AgentBootCallbackStatus

type AgentBootCallbackStatus string

AgentBootCallbackStatus Boot result reported by the engine. 'online' when the manifest loaded cleanly and the engine is ready to accept deploy requests; 'booterror' when something blocked startup (missing driver, invalid manifest, etc.).

const (
	Booterror AgentBootCallbackStatus = "booterror"
	Online    AgentBootCallbackStatus = "online"
)

Defines values for AgentBootCallbackStatus.

func (AgentBootCallbackStatus) Valid

func (e AgentBootCallbackStatus) Valid() bool

Valid indicates whether the value is a known member of the AgentBootCallbackStatus enum.

type AgentHeartbeatRequest

type AgentHeartbeatRequest struct {
	// Address Externally reachable HTTP(S) URL of the engine. Optional — Cloud-mode engines behind NAT may omit this; the heartbeat then only refreshes liveness via the AgentKeyAuth middleware without writing the address column.
	Address *string `json:"address,omitempty"`
}

AgentHeartbeatRequest defines model for AgentHeartbeatRequest.

type AgentRuntimeStatusResponse

type AgentRuntimeStatusResponse struct {
	Status AgentRuntimeStatusResponseStatus `json:"status"`
}

AgentRuntimeStatusResponse defines model for AgentRuntimeStatusResponse.

type AgentRuntimeStatusResponseStatus

type AgentRuntimeStatusResponseStatus string

AgentRuntimeStatusResponseStatus defines model for AgentRuntimeStatusResponse.Status.

const (
	AgentRuntimeStatusResponseStatusIdle    AgentRuntimeStatusResponseStatus = "idle"
	AgentRuntimeStatusResponseStatusRunning AgentRuntimeStatusResponseStatus = "running"
)

Defines values for AgentRuntimeStatusResponseStatus.

func (AgentRuntimeStatusResponseStatus) Valid

Valid indicates whether the value is a known member of the AgentRuntimeStatusResponseStatus enum.

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type DACConfig

type DACConfig struct {
	// Device sysfs path to the IIO device directory, e.g. "/sys/bus/iio/devices/iio:device1"
	Device string `json:"device"`
}

DACConfig defines model for DACConfig.

type Deploy204Response

type Deploy204Response struct {
}

func (Deploy204Response) VisitDeployResponse

func (response Deploy204Response) VisitDeployResponse(w http.ResponseWriter) error

type Deploy400JSONResponse

type Deploy400JSONResponse EngineError

func (Deploy400JSONResponse) VisitDeployResponse

func (response Deploy400JSONResponse) VisitDeployResponse(w http.ResponseWriter) error

type Deploy422JSONResponse

type Deploy422JSONResponse EngineError

func (Deploy422JSONResponse) VisitDeployResponse

func (response Deploy422JSONResponse) VisitDeployResponse(w http.ResponseWriter) error

type DeployJSONRequestBody

type DeployJSONRequestBody = DeployRequest

DeployJSONRequestBody defines body for Deploy for application/json ContentType.

type DeployRequest

type DeployRequest struct {
	// ExternalResources Deploy-time configs for a workflow's non-device external resources (MQTT transports, custom-model providers, ...), keyed by the platform resource id the DeploymentMapping points at. Replaces the former NetworkManifest. Device-owned configs (drivers) stay in the boot DeviceManifest; this carries only deploy-delivered, swappable configs.
	ExternalResources *ExternalResources `json:"externalResources,omitempty"`

	// Mapping Binds a binding-free workflow's logical resource ids to concrete platform resources for one deploy, keyed by workflow resource id. The pool a binding's ref resolves against is determined by the workflow resource's type: hardware channels resolve against the boot DeviceManifest; MQTT channels and custom models against the deploy ExternalResources; RAG memory against the boot-configured backend (the ref is the collection id).
	Mapping *DeploymentMapping `json:"mapping,omitempty"`

	// Workflow Workflow represents the deployment format of a project, passed to agents.
	Workflow *externalRef0.Workflow `json:"workflow,omitempty"`
}

DeployRequest Engine-served POST /deploy body: a binding-free workflow, the deploy mapping that binds its logical resource ids to this environment, and the resolved external-resource configs those bindings point at. workflow is intentionally NOT required so it generates as a pointer (the handler nil-checks it).

type DeployRequestObject

type DeployRequestObject struct {
	Body *DeployJSONRequestBody
}

type DeployResponseObject

type DeployResponseObject interface {
	VisitDeployResponse(w http.ResponseWriter) error
}

type DeploymentMapping

type DeploymentMapping map[string]ResourceBinding

DeploymentMapping Binds a binding-free workflow's logical resource ids to concrete platform resources for one deploy, keyed by workflow resource id. The pool a binding's ref resolves against is determined by the workflow resource's type: hardware channels resolve against the boot DeviceManifest; MQTT channels and custom models against the deploy ExternalResources; RAG memory against the boot-configured backend (the ref is the collection id).

type DeviceManifest

type DeviceManifest struct {
	Adcs    *map[string]ADCConfig    `json:"adcs,omitempty"`
	Dacs    *map[string]DACConfig    `json:"dacs,omitempty"`
	Gpios   *map[string]GPIOConfig   `json:"gpios,omitempty"`
	Pwms    *map[string]PWMConfig    `json:"pwms,omitempty"`
	Serials *map[string]SerialConfig `json:"serials,omitempty"`
}

DeviceManifest Hardware resources available on the device, keyed by driver instance ID. Drives runtime driver instantiation on the engine.

type EngineError

type EngineError struct {
	Error string `json:"error"`
}

EngineError Error body for /deploy 400/422. Distinct from control-plane ErrorResponse.

type ExternalResourceConfig

type ExternalResourceConfig struct {
	// contains filtered or unexported fields
}

ExternalResourceConfig Tagged union of deploy-time external-resource configs, discriminated by runtime kind (not by ownership — locality like on-device vs cloud lives inside an arm). New kinds extend this oneOf.

func (ExternalResourceConfig) AsLLMProviderConfig added in v1.0.2

func (t ExternalResourceConfig) AsLLMProviderConfig() (LLMProviderConfig, error)

AsLLMProviderConfig returns the union data inside the ExternalResourceConfig as a LLMProviderConfig

func (ExternalResourceConfig) AsMQTTConnection

func (t ExternalResourceConfig) AsMQTTConnection() (MQTTConnection, error)

AsMQTTConnection returns the union data inside the ExternalResourceConfig as a MQTTConnection

func (ExternalResourceConfig) Discriminator

func (t ExternalResourceConfig) Discriminator() (string, error)

func (*ExternalResourceConfig) FromLLMProviderConfig added in v1.0.2

func (t *ExternalResourceConfig) FromLLMProviderConfig(v LLMProviderConfig) error

FromLLMProviderConfig overwrites any union data inside the ExternalResourceConfig as the provided LLMProviderConfig

func (*ExternalResourceConfig) FromMQTTConnection

func (t *ExternalResourceConfig) FromMQTTConnection(v MQTTConnection) error

FromMQTTConnection overwrites any union data inside the ExternalResourceConfig as the provided MQTTConnection

func (ExternalResourceConfig) MarshalJSON

func (t ExternalResourceConfig) MarshalJSON() ([]byte, error)

func (*ExternalResourceConfig) MergeLLMProviderConfig added in v1.0.2

func (t *ExternalResourceConfig) MergeLLMProviderConfig(v LLMProviderConfig) error

MergeLLMProviderConfig performs a merge with any union data inside the ExternalResourceConfig, using the provided LLMProviderConfig

func (*ExternalResourceConfig) MergeMQTTConnection

func (t *ExternalResourceConfig) MergeMQTTConnection(v MQTTConnection) error

MergeMQTTConnection performs a merge with any union data inside the ExternalResourceConfig, using the provided MQTTConnection

func (*ExternalResourceConfig) UnmarshalJSON

func (t *ExternalResourceConfig) UnmarshalJSON(b []byte) error

func (ExternalResourceConfig) ValueByDiscriminator

func (t ExternalResourceConfig) ValueByDiscriminator() (interface{}, error)

type ExternalResources

type ExternalResources map[string]ExternalResourceConfig

ExternalResources Deploy-time configs for a workflow's non-device external resources (MQTT transports, custom-model providers, ...), keyed by the platform resource id the DeploymentMapping points at. Replaces the former NetworkManifest. Device-owned configs (drivers) stay in the boot DeviceManifest; this carries only deploy-delivered, swappable configs.

type GPIOConfig

type GPIOConfig struct {
	// Chip cdev chip name or path, e.g. "gpiochip0" or "/dev/gpiochip0"
	Chip string `json:"chip"`
}

GPIOConfig defines model for GPIOConfig.

type Healthz200JSONResponse

type Healthz200JSONResponse HealthzResponse

func (Healthz200JSONResponse) VisitHealthzResponse

func (response Healthz200JSONResponse) VisitHealthzResponse(w http.ResponseWriter) error

type HealthzRequestObject

type HealthzRequestObject struct {
}

type HealthzResponse

type HealthzResponse struct {
	// Status Engine runner state.
	Status State `json:"status"`
}

HealthzResponse defines model for HealthzResponse.

type HealthzResponseObject

type HealthzResponseObject interface {
	VisitHealthzResponse(w http.ResponseWriter) error
}

type InvalidParamFormatError

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type LLMProviderConfig added in v1.0.2

type LLMProviderConfig struct {
	// ApiKey Optional bearer credential for the endpoint.
	ApiKey *string `json:"apiKey,omitempty"`

	// Model Upstream model name the endpoint serves; defaults to the workflow model id when empty.
	Model *string               `json:"model,omitempty"`
	Type  LLMProviderConfigType `json:"type"`

	// Url Base URL of the inference endpoint (http:// or https://).
	Url string `json:"url"`
}

LLMProviderConfig Resolved connection to a self-hosted/custom LLM endpoint the llmproxy doesn't ship. The engine registers it as an llmproxy provider for the workflow's custom model; the model's capabilities come from its declared workflow entry, so they are not repeated here.

type LLMProviderConfigType added in v1.0.2

type LLMProviderConfigType string

LLMProviderConfigType defines model for LLMProviderConfig.Type.

const (
	Selfhosted LLMProviderConfigType = "selfhosted"
)

Defines values for LLMProviderConfigType.

func (LLMProviderConfigType) Valid added in v1.0.2

func (e LLMProviderConfigType) Valid() bool

Valid indicates whether the value is a known member of the LLMProviderConfigType enum.

type LogEntry

type LogEntry struct {
	Action               string                 `json:"action"`
	Level                LogEntryLevel          `json:"level"`
	Msg                  string                 `json:"msg"`
	Summary              string                 `json:"summary"`
	Time                 time.Time              `json:"time"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

LogEntry Single log event emitted by the engine. The reserved keys (level/action/summary/msg/time) populate dedicated agent_activity columns; any extra top-level keys are bucketed into the details JSONB column on ingest.

func (LogEntry) Get

func (a LogEntry) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for LogEntry. Returns the specified element and whether it was found

func (LogEntry) MarshalJSON

func (a LogEntry) MarshalJSON() ([]byte, error)

Override default JSON handling for LogEntry to handle AdditionalProperties

func (*LogEntry) Set

func (a *LogEntry) Set(fieldName string, value interface{})

Setter for additional properties for LogEntry

func (*LogEntry) UnmarshalJSON

func (a *LogEntry) UnmarshalJSON(b []byte) error

Override default JSON handling for LogEntry to handle AdditionalProperties

type LogEntryLevel

type LogEntryLevel string

LogEntryLevel defines model for LogEntry.Level.

const (
	Debug LogEntryLevel = "debug"
	Error LogEntryLevel = "error"
	Fatal LogEntryLevel = "fatal"
	Info  LogEntryLevel = "info"
	Warn  LogEntryLevel = "warn"
)

Defines values for LogEntryLevel.

func (LogEntryLevel) Valid

func (e LogEntryLevel) Valid() bool

Valid indicates whether the value is a known member of the LogEntryLevel enum.

type MQTTConnection

type MQTTConnection struct {
	BrokerURL string  `json:"brokerUrl"`
	ClientID  *string `json:"clientId,omitempty"`
	Password  *string `json:"password,omitempty"`

	// PublishPrefix Topic prefix the engine prepends to workflow-level publish topics ({networkId}/{agentId}/).
	PublishPrefix *string `json:"publishPrefix,omitempty"`

	// SubscribePrefix Topic prefix the engine prepends to workflow-level subscribe filters ({networkId}/+/).
	SubscribePrefix *string            `json:"subscribePrefix,omitempty"`
	Type            MQTTConnectionType `json:"type"`
	Username        *string            `json:"username,omitempty"`
	Will            *MQTTWill          `json:"will,omitempty"`
}

MQTTConnection defines model for MQTTConnection.

type MQTTConnectionType

type MQTTConnectionType string

MQTTConnectionType defines model for MQTTConnection.Type.

const (
	Mqtt MQTTConnectionType = "mqtt"
)

Defines values for MQTTConnectionType.

func (MQTTConnectionType) Valid

func (e MQTTConnectionType) Valid() bool

Valid indicates whether the value is a known member of the MQTTConnectionType enum.

type MQTTWill

type MQTTWill struct {
	Payload string `json:"payload"`

	// Qos MQTT QoS (0,1,2). Cast to byte at the paho call site.
	Qos    int    `json:"qos"`
	Retain bool   `json:"retain"`
	Topic  string `json:"topic"`
}

MQTTWill defines model for MQTTWill.

type MemoryFileWrite

type MemoryFileWrite struct {
	Content string `json:"content"`
}

MemoryFileWrite Body of PUT /agents/memory/{name}.

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type PWMConfig

type PWMConfig struct {
	// Chip sysfs path to the pwmchip directory, e.g. "/sys/class/pwm/pwmchip0"
	Chip string `json:"chip"`
}

PWMConfig defines model for PWMConfig.

type RagQueryRequest

type RagQueryRequest struct {
	// CollectionID Collection to query
	CollectionID string `json:"collectionId"`

	// Query Search query text
	Query string `json:"query"`

	// TopK Number of results to return
	TopK *int `json:"topK,omitempty"`
}

RagQueryRequest defines model for RagQueryRequest.

type RagQueryResult

type RagQueryResult struct {
	ChunkID    string  `json:"chunkId"`
	Content    string  `json:"content"`
	DocumentID string  `json:"documentId"`
	Score      float64 `json:"score"`
}

RagQueryResult defines model for RagQueryResult.

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error

func (e *RequiredParamError) Error() string

type ResourceBinding

type ResourceBinding struct {
	// Index Per-channel physical sub-address within the driver (GPIO line / ADC-PWM-DAC channel). Omitted when the resource has no sub-address.
	Index *int `json:"index,omitempty"`

	// Ref Shared platform resource id this binds to.
	Ref string `json:"ref"`
}

ResourceBinding How one workflow resource binds to the environment. `ref` is the shared platform resource it points at (driver instance id, external resource id, or RAG collection id) — a sharing identity, so many workflow resources may share one ref and the engine builds it once. `index` is the optional per-channel physical sub-address within that resource: GPIO line, or ADC/PWM/DAC channel number. Absent for UART, MQTT, memory and models.

type SerialConfig

type SerialConfig struct {
	// Baud Baud rate; falls back to 115200 when zero
	Baud *int `json:"baud,omitempty"`

	// Device Serial device path, e.g. "/dev/ttyUSB0" or "COM3"
	Device string `json:"device"`
}

SerialConfig defines model for SerialConfig.

type ServerInterface

type ServerInterface interface {
	// Deploy or hot-swap a workflow.
	// (POST /deploy)
	Deploy(w http.ResponseWriter, r *http.Request)
	// Engine runner state.
	// (GET /healthz)
	Healthz(w http.ResponseWriter, r *http.Request)
	// Stop the running workflow (idempotent when idle).
	// (POST /stop)
	Stop(w http.ResponseWriter, r *http.Request)
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) Deploy

Deploy operation middleware

func (*ServerInterfaceWrapper) Healthz

Healthz operation middleware

func (*ServerInterfaceWrapper) Stop

Stop operation middleware

type State

type State string

State Engine runner state.

const (
	StateIdle    State = "idle"
	StateRunning State = "running"
)

Defines values for State.

func (State) Valid

func (e State) Valid() bool

Valid indicates whether the value is a known member of the State enum.

type Stop204Response

type Stop204Response struct {
}

func (Stop204Response) VisitStopResponse

func (response Stop204Response) VisitStopResponse(w http.ResponseWriter) error

type StopRequestObject

type StopRequestObject struct {
}

type StopResponseObject

type StopResponseObject interface {
	VisitStopResponse(w http.ResponseWriter) error
}

type StrictHTTPServerOptions

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc

type StrictHandlerFunc func(ctx context.Context, w http.ResponseWriter, r *http.Request, request any) (any, error)

type StrictMiddlewareFunc

type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Deploy or hot-swap a workflow.
	// (POST /deploy)
	Deploy(ctx context.Context, request DeployRequestObject) (DeployResponseObject, error)
	// Engine runner state.
	// (GET /healthz)
	Healthz(ctx context.Context, request HealthzRequestObject) (HealthzResponseObject, error)
	// Stop the running workflow (idempotent when idle).
	// (POST /stop)
	Stop(ctx context.Context, request StopRequestObject) (StopResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

type UnescapedCookieParamError

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap

func (e *UnescapedCookieParamError) Unwrap() error

type Unimplemented

type Unimplemented struct{}

func (Unimplemented) Deploy

func (_ Unimplemented) Deploy(w http.ResponseWriter, r *http.Request)

Deploy or hot-swap a workflow. (POST /deploy)

func (Unimplemented) Healthz

func (_ Unimplemented) Healthz(w http.ResponseWriter, r *http.Request)

Engine runner state. (GET /healthz)

func (Unimplemented) Stop

Stop the running workflow (idempotent when idle). (POST /stop)

type UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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