handlers

package
v0.0.0-...-a766d22 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 54 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 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 Substrate harness HTTP/WebSocket proxy. Traffic is proxied through atenet-router (Envoy) using actor Host-based routing.

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/NemoClaw 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

	Health              *HealthHandler
	ModelConfig         *ModelConfigHandler
	Model               *ModelHandler
	ModelProviderConfig *ModelProviderConfigHandler
	Sessions            *SessionsHandler
	Agents              *AgentsHandler
	Tools               *ToolsHandler
	ToolServers         *ToolServersHandler
	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,
) *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 browser traffic to the actor OpenClaw gateway via atenet-router.

func (*Handlers) HandleSandboxSSHWebSocket ¶

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

HandleSandboxSSHWebSocket upgrades to WebSocket, accepts one JSON start frame, mints an SSH session via OpenShell gRPC from inside the cluster, opens a ForwardTcp relay and SSH shell, then proxies terminal I/O (same wire protocol as scripts/openshell-ssh-ws.mjs).

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 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"`
}

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 /api/sessions requests using database

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