handlers

package
v0.0.0-...-446cfcf Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(authorizer auth.Authorizer, r *http.Request, res auth.Resource) *errors.APIError

func CreateSecret

func CreateSecret(kubeClient client.Client, name string, namespace string, data map[string]string) (*corev1.Secret, error)

func DecodeJSONBody

func DecodeJSONBody(r *http.Request, target any) error

DecodeJSONBody decodes a JSON request body into the provided struct

func FlattenStructToMap

func FlattenStructToMap(data any, targetMap map[string]any)

flattenStructToMap uses reflection to add fields of a struct to a map, using json tags as keys.

func GetIntPathParam

func GetIntPathParam(r *http.Request, name string) (int, error)

GetIntPathParam gets an integer path parameter from the request

func GetPathParam

func GetPathParam(r *http.Request, name string) (string, error)

GetPathParam gets a path parameter from the request

func GetPrincipal

func GetPrincipal(r *http.Request) (auth.Principal, error)

func GetUserID

func GetUserID(r *http.Request) (string, error)

func RespondNotFoundOrError

func RespondNotFoundOrError(w ErrorResponseWriter, notFoundMessage string, err error)

RespondNotFoundOrError writes a 404 only when err is a missing-record error from the database client; anything else is a backend failure and must surface as a 500 rather than masquerade as not-found.

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, message string)

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload any)

Types

type AddSessionMemoryBatchRequest

type AddSessionMemoryBatchRequest struct {
	Items []AddSessionMemoryRequest `json:"items"`
}

AddSessionMemoryBatchRequest represents the request body for adding multiple memory sessions

type AddSessionMemoryRequest

type AddSessionMemoryRequest struct {
	AgentName string          `json:"agent_name"`
	UserID    string          `json:"user_id"`
	Content   string          `json:"content"`
	Vector    []float32       `json:"vector"`
	Metadata  json.RawMessage `json:"metadata,omitempty"`
	TTLDays   int             `json:"ttl_days,omitempty"`
}

AddSessionMemoryRequest represents the request body for adding a memory session

type AgentHarnessGatewayConfig

type AgentHarnessGatewayConfig struct {
	AtenetRouterURL string
}

AgentHarnessGatewayConfig configures the Substrate harness /acp WebSocket proxy. Traffic is proxied through atenet-router (Envoy) using actor Host-based routing.

type AgentHarnessSessionActorResponse

type AgentHarnessSessionActorResponse struct {
	Namespace string `json:"namespace"`
	Name      string `json:"name"`
	SessionID string `json:"sessionId"`
	ActorID   string `json:"actorId,omitempty"`
	// State is the actor lifecycle state ("running", "suspended", "missing").
	State string `json:"state,omitempty"`
}

AgentHarnessSessionActorResponse is returned when a per-session actor is provisioned or suspended.

type AgentsHandler

type AgentsHandler struct {
	*Base
}

AgentsHandler handles agent-related requests

func NewAgentsHandler

func NewAgentsHandler(base *Base) *AgentsHandler

NewAgentsHandler creates a new AgentsHandler

func (*AgentsHandler) HandleCreateAgent

func (h *AgentsHandler) HandleCreateAgent(w ErrorResponseWriter, r *http.Request)

HandleCreateAgent handles POST /api/agents requests using database

func (*AgentsHandler) HandleCreateAgentHarness

func (h *AgentsHandler) HandleCreateAgentHarness(w ErrorResponseWriter, r *http.Request)

HandleCreateAgentHarness handles POST /api/agentharnesses requests (kagent.dev/v1alpha2 AgentHarness — OpenClaw VM, etc.).

func (*AgentsHandler) HandleCreateSandboxAgent

func (h *AgentsHandler) HandleCreateSandboxAgent(w ErrorResponseWriter, r *http.Request)

HandleCreateSandboxAgent handles POST /api/sandboxagents requests.

func (*AgentsHandler) HandleDeleteAgent

func (h *AgentsHandler) HandleDeleteAgent(w ErrorResponseWriter, r *http.Request)

HandleDeleteAgent handles DELETE /api/agents/{namespace}/{name} requests using database

func (*AgentsHandler) HandleDeleteAgentHarness

func (h *AgentsHandler) HandleDeleteAgentHarness(w ErrorResponseWriter, r *http.Request)

HandleDeleteAgentHarness handles DELETE /api/agentharnesses/{namespace}/{name} for known backends only.

func (*AgentsHandler) HandleDeleteSandboxAgent

func (h *AgentsHandler) HandleDeleteSandboxAgent(w ErrorResponseWriter, r *http.Request)

HandleDeleteSandboxAgent handles DELETE /api/sandboxagents/{namespace}/{name} requests.

func (*AgentsHandler) HandleGetAgent

func (h *AgentsHandler) HandleGetAgent(w ErrorResponseWriter, r *http.Request)

HandleGetAgent handles GET /api/agents/{namespace}/{name} requests using database

func (*AgentsHandler) HandleGetAgentHarness

func (h *AgentsHandler) HandleGetAgentHarness(w ErrorResponseWriter, r *http.Request)

HandleGetAgentHarness handles GET /api/agentharnesses/{namespace}/{name} for known backends only.

func (*AgentsHandler) HandleGetSandboxAgent

func (h *AgentsHandler) HandleGetSandboxAgent(w ErrorResponseWriter, r *http.Request)

HandleGetSandboxAgent handles GET /api/sandboxagents/{namespace}/{name} requests.

func (*AgentsHandler) HandleListAgents

func (h *AgentsHandler) HandleListAgents(w ErrorResponseWriter, r *http.Request)

HandleListAgents handles GET /api/agents requests using database. Optional query param: namespace=<ns>.

func (*AgentsHandler) HandleListSandboxAgents

func (h *AgentsHandler) HandleListSandboxAgents(w ErrorResponseWriter, r *http.Request)

HandleListSandboxAgents handles GET /api/sandboxagents requests using database.

func (*AgentsHandler) HandleUpdateAgent

func (h *AgentsHandler) HandleUpdateAgent(w ErrorResponseWriter, r *http.Request)

HandleUpdateAgent handles PUT /api/agents/{namespace}/{name} requests using database

func (*AgentsHandler) HandleUpdateSandboxAgent

func (h *AgentsHandler) HandleUpdateSandboxAgent(w ErrorResponseWriter, r *http.Request)

HandleUpdateSandboxAgent handles PUT /api/sandboxagents/{namespace}/{name} requests.

type Base

type Base struct {
	KubeClient         client.Client
	DefaultModelConfig types.NamespacedName
	DatabaseService    database.Client
	Authorizer         auth.Authorizer // Interface for authorization checks
	ProxyURL           string
	WatchedNamespaces  []string
	SandboxBackend     sandboxbackend.Backend
	MCPEgressPlaintext bool
}

Base holds common dependencies for all handlers

type CheckpointsHandler

type CheckpointsHandler struct {
	*Base
}

CheckpointsHandler handles LangGraph checkpoint-related requests

func NewCheckpointsHandler

func NewCheckpointsHandler(base *Base) *CheckpointsHandler

NewCheckpointsHandler creates a new CheckpointsHandler

func (*CheckpointsHandler) HandleDeleteThread

func (h *CheckpointsHandler) HandleDeleteThread(w ErrorResponseWriter, r *http.Request)

HandleDeleteThread handles DELETE /api/langgraph/checkpoints/{thread_id} requests

func (*CheckpointsHandler) HandleListCheckpoints

func (h *CheckpointsHandler) HandleListCheckpoints(w ErrorResponseWriter, r *http.Request)

HandleListCheckpoints handles GET /api/langgraph/checkpoints requests

func (*CheckpointsHandler) HandlePutCheckpoint

func (h *CheckpointsHandler) HandlePutCheckpoint(w ErrorResponseWriter, r *http.Request)

HandlePutCheckpoint handles POST /api/langgraph/checkpoints requests

func (*CheckpointsHandler) HandlePutWrites

func (h *CheckpointsHandler) HandlePutWrites(w ErrorResponseWriter, r *http.Request)

HandlePutWrites handles POST /api/langgraph/checkpoints/writes requests

type CrewAIHandler

type CrewAIHandler struct {
	*Base
}

CrewAIHandler handles CrewAI-related requests

func NewCrewAIHandler

func NewCrewAIHandler(base *Base) *CrewAIHandler

NewCrewAIHandler creates a new CrewAIHandler

func (*CrewAIHandler) HandleGetFlowState

func (h *CrewAIHandler) HandleGetFlowState(w ErrorResponseWriter, r *http.Request)

HandleGetFlowState handles GET /api/crewai/flows/state requests

func (*CrewAIHandler) HandleGetMemory

func (h *CrewAIHandler) HandleGetMemory(w ErrorResponseWriter, r *http.Request)

HandleGetMemory handles GET /api/crewai/memory requests

func (*CrewAIHandler) HandleResetMemory

func (h *CrewAIHandler) HandleResetMemory(w ErrorResponseWriter, r *http.Request)

HandleResetMemory handles DELETE /api/crewai/memory requests

func (*CrewAIHandler) HandleStoreFlowState

func (h *CrewAIHandler) HandleStoreFlowState(w ErrorResponseWriter, r *http.Request)

HandleStoreFlowState handles POST /api/crewai/flows/state requests

func (*CrewAIHandler) HandleStoreMemory

func (h *CrewAIHandler) HandleStoreMemory(w ErrorResponseWriter, r *http.Request)

HandleStoreMemory handles POST /api/crewai/memory requests

type CurrentUserHandler

type CurrentUserHandler struct{}

func NewCurrentUserHandler

func NewCurrentUserHandler() *CurrentUserHandler

func (*CurrentUserHandler) HandleGetCurrentUser

func (h *CurrentUserHandler) HandleGetCurrentUser(w http.ResponseWriter, r *http.Request)

type ErrorResponseWriter

type ErrorResponseWriter interface {
	http.ResponseWriter
	RespondWithError(err error)
	Flush()
}

type FeedbackHandler

type FeedbackHandler struct {
	*Base
}

FeedbackHandler handles user feedback submissions

func NewFeedbackHandler

func NewFeedbackHandler(base *Base) *FeedbackHandler

NewFeedbackHandler creates a new feedback handler

func (*FeedbackHandler) HandleCreateFeedback

func (h *FeedbackHandler) HandleCreateFeedback(w ErrorResponseWriter, r *http.Request)

HandleCreateFeedback handles the submission of user feedback and forwards it to the Python backend

func (*FeedbackHandler) HandleListFeedback

func (h *FeedbackHandler) HandleListFeedback(w ErrorResponseWriter, r *http.Request)

type Handlers

type Handlers struct {
	KubeClient          client.Client
	AgentHarnessGateway *AgentHarnessGatewayConfig
	// AgentHarnessSessionActor creates/suspends the per-session substrate actors
	// that back each AgentHarness chat session.
	AgentHarnessSessionActor *substrate.AgentHarnessSessionActorBackend

	Health              *HealthHandler
	ModelConfig         *ModelConfigHandler
	Model               *ModelHandler
	ModelProviderConfig *ModelProviderConfigHandler
	Sessions            *SessionsHandler
	SessionShares       *SessionSharesHandler
	Agents              *AgentsHandler
	Tools               *ToolsHandler
	ToolServers         *ToolServersHandler
	MCPApps             *MCPAppsHandler
	ToolServerTypes     *ToolServerTypesHandler
	Memory              *MemoryHandler
	Feedback            *FeedbackHandler
	Namespaces          *NamespacesHandler
	PromptTemplates     *PromptTemplatesHandler
	Tasks               *TasksHandler
	Checkpoints         *CheckpointsHandler
	CrewAI              *CrewAIHandler
	CurrentUser         *CurrentUserHandler
	Substrate           *SubstrateHandler
}

Handlers holds all the HTTP handler components

func NewHandlers

func NewHandlers(
	kubeClient client.Client,
	defaultModelConfig types.NamespacedName,
	dbService database.Client,
	watchedNamespaces []string,
	authorizer auth.Authorizer,
	proxyURL string,
	rcnclr reconciler.KagentReconciler,
	sandboxBackend sandboxbackend.Backend,
	agentHarnessGateway *AgentHarnessGatewayConfig,
	substrateAteClient *substrate.Client,
	mcpEgressPlaintext bool,
	substrateSandboxActorBackend *substrate.SandboxAgentActorBackend,
	agentHarnessSessionActorBackend *substrate.AgentHarnessSessionActorBackend,
) *Handlers

NewHandlers creates a new Handlers instance with all handler components.

func (*Handlers) HandleAgentHarnessGateway

func (h *Handlers) HandleAgentHarnessGateway(w ErrorResponseWriter, r *http.Request)

HandleAgentHarnessGateway proxies the browser /acp WebSocket to the actor's acp-shim via atenet-router. It is the only externally reachable surface for a Substrate harness actor: every backend (including OpenClaw) is reached purely over ACP, never the in-sandbox gateway directly.

func (*Handlers) HandleEnsureAgentHarnessSessionActor

func (h *Handlers) HandleEnsureAgentHarnessSessionActor(w ErrorResponseWriter, r *http.Request)

HandleEnsureAgentHarnessSessionActor provisions (creates + resumes) the substrate actor for a single AgentHarness chat session. The UI calls this when a new chat is started so the actor is warm before the /acp WebSocket connects; provisioning could alternatively be deferred to the first message, in which case the gateway lazily creates the actor on connect.

func (*Handlers) HandleGetAgentHarnessSessionActor

func (h *Handlers) HandleGetAgentHarnessSessionActor(w ErrorResponseWriter, r *http.Request)

HandleGetAgentHarnessSessionActor reports the lifecycle state of a single AgentHarness chat session actor ("running", "suspended", or "missing"). The UI uses it to render the per-session status indicator in the sidebar.

func (*Handlers) HandleSuspendAgentHarnessSessionActor

func (h *Handlers) HandleSuspendAgentHarnessSessionActor(w ErrorResponseWriter, r *http.Request)

HandleSuspendAgentHarnessSessionActor checkpoints and frees the substrate actor for a single AgentHarness chat session. The actor is resumed automatically on the next /acp connection.

type HealthHandler

type HealthHandler struct{}

HealthHandler handles health check requests

func NewHealthHandler

func NewHealthHandler() *HealthHandler

NewHealthHandler creates a new HealthHandler

func (*HealthHandler) HandleHealth

func (h *HealthHandler) HandleHealth(w http.ResponseWriter, r *http.Request)

HandleHealth handles GET /health requests

type KAgentCheckpointPayload

type KAgentCheckpointPayload struct {
	ThreadID           string  `json:"thread_id"`
	CheckpointNS       string  `json:"checkpoint_ns"`
	CheckpointID       string  `json:"checkpoint_id"`
	ParentCheckpointID *string `json:"parent_checkpoint_id"`
	Checkpoint         string  `json:"checkpoint"`
	Metadata           string  `json:"metadata"`
	Type               string  `json:"type_"`
	Version            int     `json:"version"`
}

KAgentCheckpointPayload represents checkpoint payload data

type KAgentCheckpointTuple

type KAgentCheckpointTuple struct {
	ThreadID           string                        `json:"thread_id"`
	CheckpointNS       string                        `json:"checkpoint_ns"`
	CheckpointID       string                        `json:"checkpoint_id"`
	ParentCheckpointID *string                       `json:"parent_checkpoint_id"`
	Checkpoint         string                        `json:"checkpoint"`
	Metadata           string                        `json:"metadata"`
	Type               string                        `json:"type_"`
	Writes             *KAgentCheckpointWritePayload `json:"writes"`
}

KAgentCheckpointTuple represents a complete checkpoint tuple

type KAgentCheckpointTupleResponse

type KAgentCheckpointTupleResponse struct {
	Data []KAgentCheckpointTuple `json:"data"`
}

KAgentCheckpointTupleResponse represents the response containing checkpoint tuples

type KAgentCheckpointWritePayload

type KAgentCheckpointWritePayload struct {
	ThreadID     string                  `json:"thread_id"`
	CheckpointNS string                  `json:"checkpoint_ns"`
	CheckpointID string                  `json:"checkpoint_id"`
	TaskID       string                  `json:"task_id"`
	Writes       []KagentCheckpointWrite `json:"writes"`
}

KAgentCheckpointWritePayload represents checkpoint write payload data

type KagentCheckpointWrite

type KagentCheckpointWrite struct {
	Idx     int    `json:"idx"`
	Channel string `json:"channel"`
	Type    string `json:"type_"`
	Value   string `json:"value"`
}

KagentCheckpointWrite represents a single checkpoint write operation

type KagentFlowStatePayload

type KagentFlowStatePayload struct {
	ThreadID   string         `json:"thread_id"`
	MethodName string         `json:"method_name"`
	StateData  map[string]any `json:"state_data"`
}

KagentFlowStatePayload represents flow state payload data

type KagentFlowStateResponse

type KagentFlowStateResponse struct {
	Data KagentFlowStatePayload `json:"data"`
}

KagentFlowStateResponse represents flow state response data

type KagentMemoryPayload

type KagentMemoryPayload struct {
	ThreadID   string         `json:"thread_id"`
	UserID     string         `json:"user_id"`
	MemoryData map[string]any `json:"memory_data"`
}

KagentMemoryPayload represents memory payload data from Python

type KagentMemoryResponse

type KagentMemoryResponse struct {
	Data []KagentMemoryPayload `json:"data"`
}

KagentMemoryResponse represents memory response data

type ListMemoryResponse

type ListMemoryResponse struct {
	ID          string `json:"id"`
	Content     string `json:"content"`
	AccessCount int    `json:"access_count"`
	CreatedAt   string `json:"created_at"`
	ExpiresAt   string `json:"expires_at,omitempty"`
}

ListMemoryResponse represents a single memory item for the list endpoint

type MCPAppToolResponse

type MCPAppToolResponse struct {
	Name          string         `json:"name"`
	Description   string         `json:"description,omitempty"`
	InputSchema   any            `json:"inputSchema,omitempty"`
	UIResourceURI string         `json:"uiResourceUri,omitempty"`
	Meta          map[string]any `json:"_meta,omitempty"`
}

type MCPAppsHandler

type MCPAppsHandler struct {
	*Base
}

func NewMCPAppsHandler

func NewMCPAppsHandler(base *Base) *MCPAppsHandler

func (*MCPAppsHandler) HandleCallTool

func (h *MCPAppsHandler) HandleCallTool(w ErrorResponseWriter, r *http.Request)

func (*MCPAppsHandler) HandleListTools

func (h *MCPAppsHandler) HandleListTools(w ErrorResponseWriter, r *http.Request)

func (*MCPAppsHandler) HandleReadResource

func (h *MCPAppsHandler) HandleReadResource(w ErrorResponseWriter, r *http.Request)

type MemoryHandler

type MemoryHandler struct {
	*Base
}

MemoryHandler handles Memory requests

func NewMemoryHandler

func NewMemoryHandler(base *Base) *MemoryHandler

NewMemoryHandler creates a new MemoryHandler

func (*MemoryHandler) AddSession

func (h *MemoryHandler) AddSession(w ErrorResponseWriter, r *http.Request)

AddSession handles POST /api/memories/sessions

func (*MemoryHandler) AddSessionBatch

func (h *MemoryHandler) AddSessionBatch(w ErrorResponseWriter, r *http.Request)

AddSessionBatch handles POST /api/memories/sessions/batch

func (*MemoryHandler) Delete

func (h *MemoryHandler) Delete(w ErrorResponseWriter, r *http.Request)

Delete handles DELETE /api/memories

func (*MemoryHandler) List

List handles GET /api/memories and returns all memories for an agent+user, ranked by access frequency

func (*MemoryHandler) Search

func (h *MemoryHandler) Search(w ErrorResponseWriter, r *http.Request)

Search handles POST /api/memories/search

type ModelConfigHandler

type ModelConfigHandler struct {
	*Base
}

ModelConfigHandler handles ModelConfiguration requests

func NewModelConfigHandler

func NewModelConfigHandler(base *Base) *ModelConfigHandler

NewModelConfigHandler creates a new ModelConfigHandler

func (*ModelConfigHandler) HandleCreateModelConfig

func (h *ModelConfigHandler) HandleCreateModelConfig(w ErrorResponseWriter, r *http.Request)

HandleCreateModelConfig handles POST /api/modelconfigs requests

func (*ModelConfigHandler) HandleDeleteModelConfig

func (h *ModelConfigHandler) HandleDeleteModelConfig(w ErrorResponseWriter, r *http.Request)

HandleDeleteModelConfig handles DELETE /api/modelconfigs/{namespace}/{name} requests

func (*ModelConfigHandler) HandleGetModelConfig

func (h *ModelConfigHandler) HandleGetModelConfig(w ErrorResponseWriter, r *http.Request)

HandleGetModelConfig handles GET /api/modelconfigs/{namespace}/{name} requests

func (*ModelConfigHandler) HandleListModelConfigs

func (h *ModelConfigHandler) HandleListModelConfigs(w ErrorResponseWriter, r *http.Request)

HandleListModelConfigs handles GET /api/modelconfigs requests

func (*ModelConfigHandler) HandleUpdateModelConfig

func (h *ModelConfigHandler) HandleUpdateModelConfig(w ErrorResponseWriter, r *http.Request)

HandleUpdateModelConfig handles PUT /api/modelconfigs/{namespace}/{name} requests

type ModelHandler

type ModelHandler struct {
	*Base
}

ModelHandler handles model requests

func NewModelHandler

func NewModelHandler(base *Base) *ModelHandler

NewModelHandler creates a new ModelHandler

func (*ModelHandler) HandleListSupportedModels

func (h *ModelHandler) HandleListSupportedModels(w ErrorResponseWriter, r *http.Request)

type ModelProviderConfigHandler

type ModelProviderConfigHandler struct {
	*Base
	// contains filtered or unexported fields
}

ModelProviderConfigHandler handles model provider config requests

func NewModelProviderConfigHandler

func NewModelProviderConfigHandler(base *Base, rcnclr reconciler.KagentReconciler) *ModelProviderConfigHandler

NewModelProviderConfigHandler creates a new ModelProviderConfigHandler

func (*ModelProviderConfigHandler) HandleGetProviderModels

func (h *ModelProviderConfigHandler) HandleGetProviderModels(w ErrorResponseWriter, r *http.Request)

HandleGetProviderModels discovers and returns available models for a specific model provider. GET /api/modelproviderconfigs/configured/{name}/models?refresh=true

func (*ModelProviderConfigHandler) HandleListConfiguredProviders

func (h *ModelProviderConfigHandler) HandleListConfiguredProviders(w ErrorResponseWriter, r *http.Request)

HandleListConfiguredProviders returns the list of model providers configured via ModelProviderConfig CRDs. GET /api/modelproviderconfigs/configured

func (*ModelProviderConfigHandler) HandleListSupportedMemoryProviders

func (h *ModelProviderConfigHandler) HandleListSupportedMemoryProviders(w ErrorResponseWriter, r *http.Request)

func (*ModelProviderConfigHandler) HandleListSupportedModelProviders

func (h *ModelProviderConfigHandler) HandleListSupportedModelProviders(w ErrorResponseWriter, r *http.Request)

type ModelProviderResponse

type ModelProviderResponse struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Endpoint string `json:"endpoint"`
}

ModelProviderResponse is the API response format for listing model providers

type ModelsResponse

type ModelsResponse struct {
	Provider string   `json:"provider"`
	Models   []string `json:"models"`
}

ModelsResponse is the API response format for listing models

type NamespacesHandler

type NamespacesHandler struct {
	*Base
}

NamespacesHandler handles namespace-related requests

func NewNamespacesHandler

func NewNamespacesHandler(base *Base) *NamespacesHandler

NewNamespacesHandler creates a new NamespacesHandler

func (*NamespacesHandler) HandleListNamespaces

func (h *NamespacesHandler) HandleListNamespaces(w ErrorResponseWriter, r *http.Request)

HandleListNamespaces returns a list of namespaces based on the watch configuration

type PromptTemplatesHandler

type PromptTemplatesHandler struct {
	*Base
}

PromptTemplatesHandler manages ConfigMaps used as prompt template libraries.

func NewPromptTemplatesHandler

func NewPromptTemplatesHandler(base *Base) *PromptTemplatesHandler

NewPromptTemplatesHandler creates a PromptTemplatesHandler.

func (*PromptTemplatesHandler) HandleCreatePromptTemplate

func (h *PromptTemplatesHandler) HandleCreatePromptTemplate(w ErrorResponseWriter, r *http.Request)

HandleCreatePromptTemplate handles POST /api/prompttemplates

func (*PromptTemplatesHandler) HandleDeletePromptTemplate

func (h *PromptTemplatesHandler) HandleDeletePromptTemplate(w ErrorResponseWriter, r *http.Request)

HandleDeletePromptTemplate handles DELETE /api/prompttemplates/{namespace}/{name}

func (*PromptTemplatesHandler) HandleGetPromptTemplate

func (h *PromptTemplatesHandler) HandleGetPromptTemplate(w ErrorResponseWriter, r *http.Request)

HandleGetPromptTemplate handles GET /api/prompttemplates/{namespace}/{name}

func (*PromptTemplatesHandler) HandleListPromptTemplates

func (h *PromptTemplatesHandler) HandleListPromptTemplates(w ErrorResponseWriter, r *http.Request)

HandleListPromptTemplates handles GET /api/prompttemplates?namespace=…

func (*PromptTemplatesHandler) HandleUpdatePromptTemplate

func (h *PromptTemplatesHandler) HandleUpdatePromptTemplate(w ErrorResponseWriter, r *http.Request)

HandleUpdatePromptTemplate handles PUT /api/prompttemplates/{namespace}/{name}

type RunRequest

type RunRequest struct {
	Task string `json:"task"`
}

RunRequest represents a run creation request

type SearchSessionMemoryRequest

type SearchSessionMemoryRequest struct {
	AgentName string    `json:"agent_name"`
	UserID    string    `json:"user_id"`
	Vector    []float32 `json:"vector"`
	Limit     int       `json:"limit"`
	MinScore  float64   `json:"min_score"` // Minimum similarity score (0-1)
}

SearchSessionMemoryRequest represents the request body for searching memory sessions

type SearchSessionMemoryResponse

type SearchSessionMemoryResponse struct {
	ID        string          `json:"id"`
	Content   string          `json:"content"`
	Score     float64         `json:"score"`
	Metadata  json.RawMessage `json:"metadata"`
	CreatedAt time.Time       `json:"created_at"`
}

SearchSessionMemoryResponse represents a found memory item

type SessionResponse

type SessionResponse struct {
	Session  *database.Session `json:"session"`
	Events   []*database.Event `json:"events"`
	ReadOnly *bool             `json:"read_only,omitempty"`
}

type SessionSharesHandler

type SessionSharesHandler struct {
	*Base
}

SessionSharesHandler handles session share CRUD operations.

func NewSessionSharesHandler

func NewSessionSharesHandler(base *Base) *SessionSharesHandler

func (*SessionSharesHandler) HandleCreateSessionShare

func (h *SessionSharesHandler) HandleCreateSessionShare(w ErrorResponseWriter, r *http.Request)

HandleCreateSessionShare handles POST /api/sessions/{session_id}/shares. Only the session owner may create share links.

func (*SessionSharesHandler) HandleDeleteSessionShare

func (h *SessionSharesHandler) HandleDeleteSessionShare(w ErrorResponseWriter, r *http.Request)

HandleDeleteSessionShare handles DELETE /api/sessions/{session_id}/shares/{token}. Only the session owner may delete share links.

func (*SessionSharesHandler) HandleListSessionShares

func (h *SessionSharesHandler) HandleListSessionShares(w ErrorResponseWriter, r *http.Request)

HandleListSessionShares handles GET /api/sessions/{session_id}/shares. Only the session owner may list share links.

type SessionsHandler

type SessionsHandler struct {
	*Base
	SubstrateSandboxActorBackend *substrate.SandboxAgentActorBackend
}

SessionsHandler handles session-related requests

func NewSessionsHandler

func NewSessionsHandler(base *Base, substrateSandboxActorBackend *substrate.SandboxAgentActorBackend) *SessionsHandler

NewSessionsHandler creates a new SessionsHandler

func (*SessionsHandler) HandleAddEventToSession

func (h *SessionsHandler) HandleAddEventToSession(w ErrorResponseWriter, r *http.Request)

func (*SessionsHandler) HandleCreateSession

func (h *SessionsHandler) HandleCreateSession(w ErrorResponseWriter, r *http.Request)

HandleCreateSession handles POST /api/sessions requests using database

func (*SessionsHandler) HandleDeleteSession

func (h *SessionsHandler) HandleDeleteSession(w ErrorResponseWriter, r *http.Request)

HandleDeleteSession handles DELETE /api/sessions/{session_id} requests using database

func (*SessionsHandler) HandleGetSession

func (h *SessionsHandler) HandleGetSession(w ErrorResponseWriter, r *http.Request)

HandleGetSession handles GET /api/sessions/{session_id} requests using database

func (*SessionsHandler) HandleGetSessionsForAgent

func (h *SessionsHandler) HandleGetSessionsForAgent(w ErrorResponseWriter, r *http.Request)

func (*SessionsHandler) HandleListSessions

func (h *SessionsHandler) HandleListSessions(w ErrorResponseWriter, r *http.Request)

HandleListSessions handles GET /api/sessions requests using database

func (*SessionsHandler) HandleListTasksForSession

func (h *SessionsHandler) HandleListTasksForSession(w ErrorResponseWriter, r *http.Request)

HandleListSessionRuns handles GET /api/sessions/{session_id}/tasks requests using database

func (*SessionsHandler) HandleUpdateSession

func (h *SessionsHandler) HandleUpdateSession(w ErrorResponseWriter, r *http.Request)

HandleUpdateSession handles PUT and PATCH /api/sessions/{session_id} requests. It applies a partial update to the session identified by the {session_id} path param: it sets the display name when "name" is provided, and re-points the session at a different agent when "agent_ref" is provided. At least one of the two must be present.

type SubstrateHandler

type SubstrateHandler struct {
	*Base
	AteClient *substrate.Client
}

SubstrateHandler exposes Agent Substrate inventory for the UI.

func NewSubstrateHandler

func NewSubstrateHandler(base *Base, ateClient *substrate.Client) *SubstrateHandler

NewSubstrateHandler creates a SubstrateHandler.

func (*SubstrateHandler) HandleGetSubstrateStatus

func (h *SubstrateHandler) HandleGetSubstrateStatus(w ErrorResponseWriter, r *http.Request)

HandleGetSubstrateStatus handles GET /api/substrate/status?namespace=…

type TasksHandler

type TasksHandler struct {
	*Base
}

TasksHandler handles task-related requests

func NewTasksHandler

func NewTasksHandler(base *Base) *TasksHandler

NewTasksHandler creates a new TasksHandler

func (*TasksHandler) HandleCreateTask

func (h *TasksHandler) HandleCreateTask(w ErrorResponseWriter, r *http.Request)

func (*TasksHandler) HandleDeleteTask

func (h *TasksHandler) HandleDeleteTask(w ErrorResponseWriter, r *http.Request)

func (*TasksHandler) HandleGetTask

func (h *TasksHandler) HandleGetTask(w ErrorResponseWriter, r *http.Request)

type ToolServerCreateRequest

type ToolServerCreateRequest struct {
	// Type specifies which kind of tool server to create
	Type ToolServerType `json:"type"`

	// RemoteMCPServer is used when Type is "RemoteMCPServer"
	RemoteMCPServer *v1alpha2.RemoteMCPServer `json:"remoteMCPServer,omitempty"`

	// MCPServer is used when Type is "MCPServer"
	MCPServer *v1alpha1.MCPServer `json:"mcpServer,omitempty"`

	// Secrets are optional companion Secrets to create or update
	// alongside the ToolServer. Each entry materializes as a key in a
	// Kubernetes Secret of type Opaque, owned by the created
	// ToolServer so K8s GC cleans them up on delete. Names referenced
	// here (e.g. RemoteMCPServer.spec.tls.caCertSecretRef,
	// RemoteMCPServer.spec.headersFrom[].valueFrom.secretRef.name,
	// MCPServer.spec.secretRefs[].name) must match a Secret described
	// in this list when the operator wants the API to materialize the
	// content inline. Pre-existing Secrets can also be referenced
	// directly without supplying material here.
	Secrets []api.SecretMaterial `json:"secrets,omitempty"`
}

ToolServerCreateRequest represents a request to create either a RemoteMCPServer or MCPServer

type ToolServerType

type ToolServerType string

ToolServerType represents the type of tool server to create

const (
	ToolServerTypeRemoteMCPServer ToolServerType = "RemoteMCPServer"
	ToolServerTypeMCPServer       ToolServerType = "MCPServer"
)

type ToolServerTypes

type ToolServerTypes []ToolServerType

func GetSupportedToolServerTypes

func GetSupportedToolServerTypes(cli client.Client) (ToolServerTypes, error)

func (ToolServerTypes) Join

func (t ToolServerTypes) Join(sep string) string

type ToolServerTypesHandler

type ToolServerTypesHandler struct {
	*Base
}

ToolServerTypesHandler handles ToolServerType-related requests

func NewToolServerTypesHandler

func NewToolServerTypesHandler(base *Base) *ToolServerTypesHandler

NewToolServerTypesHandler creates a new ToolServerTypesHandler

func (*ToolServerTypesHandler) HandleListToolServerTypes

func (h *ToolServerTypesHandler) HandleListToolServerTypes(w ErrorResponseWriter, r *http.Request)

HandleListToolServerTypes handles GET /api/toolservertypes requests

type ToolServersHandler

type ToolServersHandler struct {
	*Base
}

ToolServersHandler handles ToolServer-related requests

func NewToolServersHandler

func NewToolServersHandler(base *Base) *ToolServersHandler

NewToolServersHandler creates a new ToolServersHandler

func (*ToolServersHandler) HandleCreateToolServer

func (h *ToolServersHandler) HandleCreateToolServer(w ErrorResponseWriter, r *http.Request)

HandleCreateToolServer handles POST /api/toolservers requests

func (*ToolServersHandler) HandleDeleteToolServer

func (h *ToolServersHandler) HandleDeleteToolServer(w ErrorResponseWriter, r *http.Request)

HandleDeleteToolServer handles DELETE /api/toolservers/{namespace}/{name} requests

func (*ToolServersHandler) HandleListToolServers

func (h *ToolServersHandler) HandleListToolServers(w ErrorResponseWriter, r *http.Request)

HandleListToolServers handles GET /api/toolservers requests

type ToolsHandler

type ToolsHandler struct {
	*Base
}

ToolsHandler handles tool-related requests

func NewToolsHandler

func NewToolsHandler(base *Base) *ToolsHandler

NewToolsHandler creates a new ToolsHandler

func (*ToolsHandler) HandleListTools

func (h *ToolsHandler) HandleListTools(w ErrorResponseWriter, r *http.Request)

HandleListTools handles GET /api/tools requests using database

Jump to

Keyboard shortcuts

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