api

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: AGPL-3.0 Imports: 89 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CredentialUnset means no api_key is configured at all.
	CredentialUnset = "unset"
	// CredentialInline means a literal key is stored on the provider.
	CredentialInline = "inline"
	// CredentialSecret means the key is a $SECRET/ or $ENV/ reference that
	// resolves to a non-empty value.
	CredentialSecret = "secret"
	// CredentialUnresolved means the key is a $SECRET/ or $ENV/ reference that
	// resolves to nothing -- the dangling reference that makes a fresh instance
	// look configured when it is not.
	CredentialUnresolved = "unresolved"
)

Credential status values reported alongside a provider's api_key.

A brand-new instance bootstraps OPENAI_KEY and ANTHROPIC_KEY as secrets with *empty values*, then seeds providers pointing at them with Active: true. The list rendered a healthy "Proxied" dot regardless, so the instance looked completely configured and the first real call failed with nothing in the UI explaining why. These let the UI tell the three cases apart.

View Source
const (
	CatalogItemLLM            = "llm"
	CatalogItemDatasource     = "datasource"
	CatalogItemTool           = "tool"
	CatalogItemPluginResource = "plugin_resource"
	CatalogItemMCPServer      = "mcp_server"
	CatalogItemModelRouter    = "model_router"
	CatalogItemSemanticRouter = "semantic_router"
)

Catalog item types.

View Source
const (
	// CheckSpecValidation means the OpenAPI document was parsed and validated.
	// Nothing was contacted.
	CheckSpecValidation = "spec_validation"
	// CheckConnectivity means the upstream service was actually contacted.
	CheckConnectivity = "connectivity"
)

Check kinds reported by adminTestSubmission.

The endpoint does two materially different things depending on resource type, and the UI presented both as "Test Connection" -- so a reviewer could approve a tool whose server block points nowhere, believing the upstream had been reached. The response now states which guarantee it actually provides.

Variables

This section is empty.

Functions

func SetBuildInfo

func SetBuildInfo(version, buildHash, buildTime string)

SetBuildInfo lets package main hand this package the build-time values set via -ldflags. Called once, before the server starts.

Types

type API

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

func New

func New(service *services.Service, disableCORS bool, authService *auth.AuthService, config *auth.Config, proxy *proxy.Proxy, frontend fs.FS, licensingService licensing.Service) (*API, error)

New builds the admin API: the gin router with its middleware and routes. frontend is the built admin UI rooted at its build directory (ui.FS). New leaves gin's process-wide mode to the caller.

func NewAPI

func NewAPI(service *services.Service, disableCORS bool, authService *auth.AuthService, config *auth.Config, proxy *proxy.Proxy, frontend fs.FS, licensingService licensing.Service) *API

NewAPI builds the API like New but panics where New returns an error, which suits tests.

func (*API) CreatePluginSchedule

func (a *API) CreatePluginSchedule(c *gin.Context)

CreatePluginSchedule creates a new schedule for a plugin POST /api/v1/plugins/:id/schedules

func (*API) DeletePluginSchedule

func (a *API) DeletePluginSchedule(c *gin.Context)

DeletePluginSchedule deletes a schedule DELETE /api/v1/plugins/:id/schedules/:schedule_id

func (*API) GetPluginScheduleDetail

func (a *API) GetPluginScheduleDetail(c *gin.Context)

GetPluginScheduleDetail returns details for a specific schedule GET /api/v1/plugins/:id/schedules/:schedule_id

func (*API) GetPluginScheduleExecutions

func (a *API) GetPluginScheduleExecutions(c *gin.Context)

GetPluginScheduleExecutions returns execution history for a schedule GET /api/v1/plugins/:id/schedules/:schedule_id/executions

func (*API) GetPluginSchedules

func (a *API) GetPluginSchedules(c *gin.Context)

GetPluginSchedules returns all schedules for a plugin GET /api/v1/plugins/:id/schedules

func (*API) GetToolDocumentation

func (a *API) GetToolDocumentation(c *gin.Context)

@Summary Get tool documentation @Description Get documentation for a specific tool (Enterprise Edition only) @Tags tool-catalogues @Accept json @Produce json @Param catalogueId path int true "Tool Catalogue ID" @Param toolId path int true "Tool ID" @Success 200 {object} map[string]interface{} @Failure 402 {object} ErrorResponse @Router /api/v1/tool-catalogues/{catalogueId}/tools/{toolId}/documentation [get] @Security BearerAuth

func (*API) HandleActivateAgent

func (a *API) HandleActivateAgent(c *gin.Context)

HandleActivateAgent handles POST /api/agents/:id/activate - activates agent config

func (*API) HandleAgentMessage

func (a *API) HandleAgentMessage(c *gin.Context)

HandleAgentMessage handles POST /api/agents/:id/message - sends a message to an active agent session

func (*API) HandleAgentSSE

func (a *API) HandleAgentSSE(c *gin.Context)

HandleAgentSSE handles GET /api/agents/:id/stream - establishes SSE connection for agent communication

func (*API) HandleChatSSE

func (a *API) HandleChatSSE(c *gin.Context)

HandleChatSSE handles Server-Sent Events for chat sessions

func (*API) HandleCreateAgent

func (a *API) HandleCreateAgent(c *gin.Context)

HandleCreateAgent handles POST /api/agents - creates new agent config

func (*API) HandleDeactivateAgent

func (a *API) HandleDeactivateAgent(c *gin.Context)

HandleDeactivateAgent handles POST /api/agents/:id/deactivate - deactivates agent config

func (*API) HandleDeleteAgent

func (a *API) HandleDeleteAgent(c *gin.Context)

HandleDeleteAgent handles DELETE /api/agents/:id - deletes agent config

func (*API) HandleGetAgent

func (a *API) HandleGetAgent(c *gin.Context)

HandleGetAgent handles GET /api/agents/:id - gets specific agent config

func (*API) HandleListAgents

func (a *API) HandleListAgents(c *gin.Context)

HandleListAgents handles GET /api/agents - lists available agent configs

func (*API) HandleUpdateAgent

func (a *API) HandleUpdateAgent(c *gin.Context)

HandleUpdateAgent handles PUT /api/agents/:id - updates agent config

func (*API) Handler

func (a *API) Handler() http.Handler

Handler returns the API and UI for serving under the configured base path. Routes are registered at the root; the handler strips the base path.

func (*API) InitComplianceService

func (a *API) InitComplianceService()

InitComplianceService initializes the compliance service

func (*API) OAuthMetadataHandler

func (a *API) OAuthMetadataHandler() http.Handler

OAuthMetadataHandler serves the OAuth authorization server metadata. With a base path the issuer carries a path, and RFC 8414 clients look the metadata up at the host root with the path appended (/.well-known/oauth-authorization-server/ai-studio); a host mounts this handler there, since that URL lies outside Studio's base path.

func (*API) ProcessFileEmbeddingHandler

func (a *API) ProcessFileEmbeddingHandler(c *gin.Context)

@Summary Process file embeddings for a datasource @Description Process and create embeddings for all files in a datasource @Tags datasources @Accept json @Produce json @Param id path int true "Datasource ID" @Success 202 {object} SuccessResponse @Failure 400 {object} ErrorResponse @Failure 404 {object} ErrorResponse @Failure 500 {object} ErrorResponse @Router /datasources/{id}/process-embeddings [post] @Security BearerAuth

func (*API) Router

func (a *API) Router() *gin.Engine

Router returns the router instance

func (*API) Run

func (a *API) Run(addr string, certFile string, keyFile string) error

func (*API) SSOAuthMiddleware

func (a *API) SSOAuthMiddleware() gin.HandlerFunc

SSOAuthMiddleware - CE: Always returns unauthorized

func (*API) SetAuditService

func (a *API) SetAuditService(s audit.Service)

SetAuditService swaps the audit trail implementation. The recording middleware is registered once at construction and dispatches through the current service, so this may be called after NewAPI (tests use it).

func (*API) SetClusterStatus

func (a *API) SetClusterStatus(f ClusterStatusFunc)

SetClusterStatus supplies the cluster status the /cluster/status endpoint reports (set by pkg/studio).

func (*API) SetupAgentV2Routes

func (a *API) SetupAgentV2Routes(r *gin.RouterGroup)

SetupAgentV2Routes registers the v2 agent endpoints.

func (*API) SetupChatRoutes

func (a *API) SetupChatRoutes(r *gin.RouterGroup)

func (*API) SetupChatV2Routes

func (a *API) SetupChatV2Routes(r *gin.RouterGroup)

SetupChatV2Routes registers the v2 endpoints on the same authenticated group as the v1 chat routes.

func (*API) Shutdown

func (a *API) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the API server, if Run started one, and the audit trail writer, which runs whether or not the router is served by Run.

func (*API) UpdatePluginSchedule

func (a *API) UpdatePluginSchedule(c *gin.Context)

UpdatePluginSchedule updates a schedule PUT /api/v1/plugins/:id/schedules/:schedule_id

func (*API) UploadFileToSession

func (a *API) UploadFileToSession(c *gin.Context)

type AccessTokenResponse

type AccessTokenResponse struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"` // In seconds
	RefreshToken string `json:"refresh_token,omitempty"`
	Scope        string `json:"scope,omitempty"`
}

AccessTokenResponse defines the structure for successful token responses.

type AdminReviewInput

type AdminReviewInput struct {
	Data struct {
		Attributes struct {
			FinalPrivacyScore  int            `json:"final_privacy_score"`
			AssignedCatalogues models.JSONMap `json:"assigned_catalogues"`
			ReviewNotes        string         `json:"review_notes"`
			Feedback           string         `json:"feedback"` // submitter-facing feedback (for reject/changes_requested)
			// MCP server submissions only: the reviewer's deployment target and
			// whether to publish the created server right away.
			GatewayTags *[]string `json:"gateway_tags"`
			Publish     bool      `json:"publish"`
		} `json:"attributes"`
	} `json:"data"`
}

type AgentConfigRequest

type AgentConfigRequest struct {
	Name        string                 `json:"name" binding:"required"`
	Description string                 `json:"description"`
	PluginID    uint                   `json:"plugin_id" binding:"required"`
	AppID       uint                   `json:"app_id" binding:"required"`
	Config      map[string]interface{} `json:"config"`
	GroupIDs    []uint                 `json:"group_ids"`
	// IsActive is the live switch. Omitted = active on create (the historical
	// default), unchanged on update. Setting it needs agents:publish.
	IsActive  *bool  `json:"is_active"`
	Namespace string `json:"namespace"`
}

AgentConfigRequest represents the request body for creating/updating an agent config

type AgentMessageRequest

type AgentMessageRequest struct {
	Message   string                   `json:"message" binding:"required"`
	History   []map[string]interface{} `json:"history"`
	SessionID string                   `json:"session_id"`
}

AgentMessageRequest represents the request body for sending a message to an agent

type AppDetailResponse

type AppDetailResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name            string     `json:"name"`
		Description     string     `json:"description"`
		UserID          uint       `json:"user_id"`
		CredentialID    uint       `json:"credential_id"`
		DatasourceIDs   []uint     `json:"datasource_ids"`
		LLMIDs          []uint     `json:"llm_ids"`
		ToolIDs         []uint     `json:"tool_ids"`
		MonthlyBudget   *float64   `json:"monthly_budget"`
		BudgetStartDate *time.Time `json:"budget_start_date"`
		TeamID          *uint      `json:"team_id"`
		// BudgetSource tells the portal where the budget came from: "team"
		// when the App's team hands out budgets from a pool, else empty.
		BudgetSource string           `json:"budget_source,omitempty"`
		IsOrphaned   bool             `json:"is_orphaned"`
		IsActive     bool             `json:"is_active"`
		Credential   CredentialDetail `json:"credential"`
		// MCPServerIDs / MCPServers mirror the list endpoint (serializeApp):
		// the portal app page mounts its "MCP access" section from them.
		MCPServerIDs []uint               `json:"mcp_server_ids"`
		MCPServers   []AppMCPServerOutput `json:"mcp_servers,omitempty"`
		// Model Routers the app is granted (Enterprise); the portal app page
		// shows their unified-ingress model strings.
		ModelRouterIDs []uint                 `json:"model_router_ids"`
		ModelRouters   []AppModelRouterOutput `json:"model_routers,omitempty"`
		// Semantic Routers the app is granted (Enterprise).
		SemanticRouterIDs []uint                    `json:"semantic_router_ids"`
		SemanticRouters   []AppSemanticRouterOutput `json:"semantic_routers,omitempty"`
	} `json:"attributes"`
}

AppDetailResponse represents the detailed response for app-related operations @Description App detail response model

type AppInput

type AppInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name            string                 `json:"name"`
			Description     string                 `json:"description"`
			UserID          uint                   `json:"user_id"`
			DatasourceIDs   []uint                 `json:"datasource_ids"`
			LLMIDs          []uint                 `json:"llm_ids"`
			ToolIDs         []uint                 `json:"tool_ids"`
			MonthlyBudget   *float64               `json:"monthly_budget"`
			BudgetStartDate *time.Time             `json:"budget_start_date"`
			Namespace       string                 `json:"namespace,omitempty"`
			Metadata        map[string]interface{} `json:"metadata,omitempty"`
			PluginResources []PluginResourceInput  `json:"plugin_resources,omitempty"`
			// MCPServerIDs binds Tyk-managed MCP servers (Enterprise). Omitted
			// leaves the bindings unchanged on update; an empty list clears them.
			MCPServerIDs *[]uint `json:"mcp_server_ids,omitempty"`
			// ModelRouterIDs grants Model Routers (Enterprise). Omitted leaves
			// the grants unchanged on update; an empty list clears them.
			ModelRouterIDs *[]uint `json:"model_router_ids,omitempty"`
			// SemanticRouterIDs grants Semantic Routers (Enterprise), with
			// the same omitted/empty rules.
			SemanticRouterIDs *[]uint `json:"semantic_router_ids,omitempty"`
			// IsActive is the live switch. Omitted = unchanged on update, live
			// on create (unless the caller lacks apps:publish, in which case
			// the app is created inactive). Setting it needs apps:publish.
			IsActive *bool `json:"is_active,omitempty"`
			// TeamID attributes the App to a team (Enterprise team budgets).
			// Omitted = the owner's budget team on create, unchanged on update.
			TeamID *uint `json:"team_id,omitempty"`
		} `json:"attributes"`
	} `json:"data"`
}

AppInput represents the input for app-related operations @Description App input model

type AppListResponse

type AppListResponse struct {
	Data []AppResponse `json:"data"`
	Meta struct {
		TotalCount int64 `json:"total_count"`
		TotalPages int   `json:"total_pages"`
		PageSize   int   `json:"page_size"`
		PageNumber int   `json:"page_number"`
	} `json:"meta"`
}

AppListResponse represents the response for listing apps @Description App list response model

type AppMCPServerOutput

type AppMCPServerOutput struct {
	ID           uint   `json:"id"`
	Name         string `json:"name"`
	Slug         string `json:"slug"`
	ConnectionID *uint  `json:"connection_id"`
	AuthMode     string `json:"auth_mode"`
	EndpointURL  string `json:"endpoint_url"`
	Brokerable   bool   `json:"brokerable"`
}

AppMCPServerOutput is the slim projection of a bound MCP server in App responses.

type AppModelRouterOutput

type AppModelRouterOutput struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
	Slug string `json:"slug"`
}

AppModelRouterOutput is the slim projection of a granted Model Router in App responses. Model is what a client sends to the unified ingress for it.

type AppResponse

type AppResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name         string `json:"name"`
		Description  string `json:"description"`
		UserID       uint   `json:"user_id"`
		CredentialID uint   `json:"credential_id"`
		// CredentialActive is the state of the app's credential, null when the
		// app has none, so the apps list can show it without a credentials fetch.
		CredentialActive *bool                  `json:"credential_active"`
		DatasourceIDs    []uint                 `json:"datasource_ids"`
		LLMIDs           []uint                 `json:"llm_ids"`
		ToolIDs          []uint                 `json:"tool_ids"`
		MonthlyBudget    *float64               `json:"monthly_budget"`
		BudgetStartDate  *time.Time             `json:"budget_start_date"`
		TeamID           *uint                  `json:"team_id"`
		IsActive         bool                   `json:"is_active"` // live switch (apps:publish)
		IsOrphaned       bool                   `json:"is_orphaned"`
		Metadata         map[string]interface{} `json:"metadata,omitempty"`
		Namespace        string                 `json:"namespace,omitempty"`
		PluginResources  []PluginResourceOutput `json:"plugin_resources,omitempty"`
		// Tyk-managed MCP servers bound to the app (Enterprise).
		MCPServerIDs []uint               `json:"mcp_server_ids"`
		MCPServers   []AppMCPServerOutput `json:"mcp_servers,omitempty"`
		// Model Routers the app is granted (Enterprise).
		ModelRouterIDs []uint                 `json:"model_router_ids"`
		ModelRouters   []AppModelRouterOutput `json:"model_routers,omitempty"`
		// Semantic Routers the app is granted (Enterprise).
		SemanticRouterIDs []uint                    `json:"semantic_router_ids"`
		SemanticRouters   []AppSemanticRouterOutput `json:"semantic_routers,omitempty"`
	} `json:"attributes"`
}

AppResponse represents the response for app-related operations @Description App response model

type AppSemanticRouterOutput

type AppSemanticRouterOutput struct {
	ID     uint     `json:"id"`
	Name   string   `json:"name"`
	Slug   string   `json:"slug"`
	Models []string `json:"models"`
}

AppSemanticRouterOutput is the slim projection of a granted Semantic Router in App responses. Models are what a client sends to the unified ingress.

type AppUsageSummary

type AppUsageSummary struct {
	AppID           string     `json:"app_id"`
	CurrentSpend    float64    `json:"current_spend"`
	MonthlyBudget   *float64   `json:"monthly_budget"`
	Percentage      *float64   `json:"percentage"`
	BudgetStartDate time.Time  `json:"budget_start_date"`
	LastAccessAt    *time.Time `json:"last_access_at"`
	Requests30d     int64      `json:"requests_30d"`
}

AppUsageSummary is one app's budget position and recent activity for the portal overview.

type AppUsageSummaryResponse

type AppUsageSummaryResponse struct {
	Data map[string]AppUsageSummary `json:"data"`
	// SpendTracked is false in Community Edition, where spending is not
	// recorded and current_spend is always zero.
	SpendTracked bool `json:"spend_tracked"`
}

AppUsageSummaryResponse is the body of GET /common/apps/usage-summary.

type AppWithTools

type AppWithTools struct {
	ID          uint     `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Tools       []string `json:"tools"`
}

type ApprovalRequest

type ApprovalRequest struct {
	Approved bool `json:"approved" binding:"required"`
}

type AttestationTemplateInput

type AttestationTemplateInput struct {
	Data struct {
		Attributes struct {
			Name          string `json:"name"`
			Text          string `json:"text"`
			Required      bool   `json:"required"`
			AppliesToType string `json:"applies_to_type"`
			Active        bool   `json:"active"`
			SortOrder     int    `json:"sort_order"`
		} `json:"attributes"`
	} `json:"data"`
}

type AuthResponse

type AuthResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Token string `json:"token"`
		User  struct {
			ID    string `json:"id"`
			Email string `json:"email"`
			Name  string `json:"name"`
		} `json:"user"`
	} `json:"attributes"`
}

AuthResponse represents the response for successful authentication operations @Description Auth response model

type BrandingConfig

type BrandingConfig struct {
	AppTitle         string `json:"app_title"`
	PrimaryColor     string `json:"primary_color"`
	SecondaryColor   string `json:"secondary_color"`
	BackgroundColor  string `json:"background_color"`
	CustomCSS        string `json:"custom_css"`
	HasCustomFavicon bool   `json:"has_custom_favicon"`
}

BrandingConfig holds branding customization settings for the frontend

type BrandingSettingsAttributes

type BrandingSettingsAttributes struct {
	AppTitle         string `json:"app_title"`
	PrimaryColor     string `json:"primary_color"`
	SecondaryColor   string `json:"secondary_color"`
	BackgroundColor  string `json:"background_color"`
	CustomCSS        string `json:"custom_css"`
	HasCustomFavicon bool   `json:"has_custom_favicon"`
}

type BrandingSettingsResponse

type BrandingSettingsResponse struct {
	Type       string                     `json:"type"`
	ID         string                     `json:"id"`
	Attributes BrandingSettingsAttributes `json:"attributes"`
}

type BulkActionInput

type BulkActionInput struct {
	Action string   `json:"action" example:"deactivate"`
	IDs    []BulkID `json:"ids" swaggertype:"array,integer"`
}

BulkActionInput is the request body of a bulk action. @Description Bulk action request

type BulkActionResponse

type BulkActionResponse struct {
	Data struct {
		Action    string             `json:"action"`
		Results   []BulkActionResult `json:"results"`
		Succeeded int                `json:"succeeded"`
		Failed    int                `json:"failed"`
	} `json:"data"`
}

BulkActionResponse is the envelope of a bulk action. @Description Bulk action response

type BulkActionResult

type BulkActionResult struct {
	ID    uint   `json:"id"`
	OK    bool   `json:"ok"`
	Error string `json:"error,omitempty"`
}

BulkActionResult is one id's outcome. @Description One object's outcome in a bulk action

type BulkID

type BulkID uint

BulkID is an object id that may arrive as a JSON number or as a numeric string: JSON:API rows carry string ids, so a list page posts back what it was given. Anything else fails to bind and the request is a 400.

func (*BulkID) UnmarshalJSON

func (id *BulkID) UnmarshalJSON(data []byte) error

type CMessageListResponse

type CMessageListResponse struct {
	Data []CMessageResponse `json:"data"`
}

type CMessageResponse

type CMessageResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Session   string    `json:"session"`
		Content   any       `json:"content"`
		CreatedAt time.Time `json:"created_at"`
		ChatID    uint      `json:"chat_id"`
	} `json:"attributes"`
}

CMessageResponse represents the response structure for a CMessage @Description CMessage response model

type CallOperationInput

type CallOperationInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			OperationID string                 `json:"operation_id"`
			Parameters  map[string][]string    `json:"parameters"`
			Payload     map[string]interface{} `json:"payload"`
			Headers     map[string][]string    `json:"headers"`
		} `json:"attributes"`
	} `json:"data"`
}

CallOperationInput represents the input for calling a tool operation

type CatalogFilterOption

type CatalogFilterOption struct {
	Type string `json:"type"`
	ID   string `json:"id"`
	Name string `json:"name"`
}

CatalogFilterOption is one catalog the caller can filter by.

type CatalogItem

type CatalogItem struct {
	Type       string                `json:"type"`
	ID         string                `json:"id"`
	Attributes CatalogItemAttributes `json:"attributes"`
	// Portal-visible governed metadata (Enterprise), display-ready.
	GovernedMetadata interface{} `json:"governed_metadata,omitempty"`
}

CatalogItem is one entry of the unified catalog.

type CatalogItemAttributes

type CatalogItemAttributes struct {
	Name             string `json:"name"`
	ShortDescription string `json:"short_description"`
	LongDescription  string `json:"long_description,omitempty"`
	LogoURL          string `json:"logo_url,omitempty"`
	// Kind is the type-specific sub-classification: the vendor code of an LLM
	// provider, the store type of a data source, the protocol of a tool and
	// "<plugin id>:<slug>" for a plugin resource. KindLabel is set when the
	// backend knows a display name (plugin resource types); the UI maps the
	// built-in codes itself.
	Kind               string       `json:"kind"`
	KindLabel          string       `json:"kind_label,omitempty"`
	PrivacyScore       *int         `json:"privacy_score"`
	CommunitySubmitted bool         `json:"community_submitted"`
	Tags               []string     `json:"tags"`
	Catalogs           []CatalogRef `json:"catalogs"`
	CreatedAt          *time.Time   `json:"created_at"`
	UpdatedAt          *time.Time   `json:"updated_at"`
	// AccessGrantedViaApp says whether building an App is how a developer
	// gets to use this item. Always true for LLM providers, data sources and
	// tools; for plugin resources it is the type's resolved value with any
	// per-instance override applied. When false the portal shows no
	// "Build app" action.
	//
	// PortalDetailURL is the providing plugin's own page for the item, set
	// whenever the type declared portal_detail_path. When access is not
	// granted through an App it replaces the built-in detail page as the
	// item's detail view; otherwise it is a secondary link next to
	// "Build app".
	AccessGrantedViaApp bool   `json:"access_granted_via_app"`
	PortalDetailURL     string `json:"portal_detail_url,omitempty"`

	// LLM providers
	DefaultModel  string   `json:"default_model,omitempty"`
	AllowedModels []string `json:"allowed_models,omitempty"`
	// Detail responses only: the known models and the provider's metadata
	// (secrets redacted, as on the admin API).
	Models   []CatalogModelInfo     `json:"models,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`

	// Data sources
	EmbedVendor string `json:"embed_vendor,omitempty"`
	EmbedModel  string `json:"embed_model,omitempty"`

	// Tools. A tool is served by the AI Studio gateway; the access methods say
	// how an App may reach it, and each URL is present only when its method is
	// switched on. A tool with neither method on is chat only and is not in
	// the catalog at all.
	Operations        []string `json:"operations,omitempty"`
	RESTAccessEnabled *bool    `json:"rest_access_enabled,omitempty"`
	MCPAccessEnabled  *bool    `json:"mcp_access_enabled,omitempty"`
	RESTEndpointURL   string   `json:"rest_endpoint_url,omitempty"`
	MCPEndpointURL    string   `json:"mcp_endpoint_url,omitempty"`

	// Plugin resources
	ResourceType *CatalogResourceType `json:"resource_type,omitempty"`

	// MCP servers (Tyk-managed): how a client reaches the proxy and what it
	// offers. Brokerable says whether an App credential can be minted for it.
	AuthMode     string                               `json:"auth_mode,omitempty"`
	AuthHeader   string                               `json:"auth_header,omitempty"`
	EndpointURL  string                               `json:"endpoint_url,omitempty"`
	EndpointURLs map[string]string                    `json:"endpoint_urls,omitempty"`
	Primitives   []models.MCPPrimitive                `json:"primitives,omitempty"`
	GatewayTags  []string                             `json:"gateway_tags,omitempty"`
	Brokerable   *bool                                `json:"brokerable,omitempty"`
	OAuth        *models.MCPProtectedResourceMetadata `json:"oauth,omitempty"`

	// Model Routers: the slug, the "{slug}/{model}" strings a client sends
	// to the unified ingress, and (detail only) the LLMs it can route to.
	RouterSlug   string             `json:"router_slug,omitempty"`
	RouterModels []string           `json:"router_models,omitempty"`
	RouterLLMs   []CatalogRouterLLM `json:"router_llms,omitempty"`
	// RouterRoutes are a Semantic Router's routes (name and description; the
	// examples and keywords that pick them are configuration and stay out).
	RouterRoutes []CatalogRouterRoute `json:"router_routes,omitempty"`
}

CatalogItemAttributes is the one shape every catalog item is rendered in.

type CatalogItemResponse

type CatalogItemResponse struct {
	Data CatalogItem `json:"data"`
}

CatalogItemResponse is the body of the per-item detail endpoints.

type CatalogKindFacet

type CatalogKindFacet struct {
	Type  string `json:"type"`
	Kind  string `json:"kind"`
	Label string `json:"label,omitempty"`
	Count int    `json:"count"`
}

CatalogKindFacet is one kind (vendor, store type, protocol, resource type) present in the caller's accessible set, for the Kind filter.

type CatalogListMeta

type CatalogListMeta struct {
	Total         int                   `json:"total"`
	Page          int                   `json:"page"`
	PageSize      int                   `json:"page_size"`
	TotalPages    int                   `json:"total_pages"`
	Counts        map[string]int        `json:"counts"`
	Kinds         []CatalogKindFacet    `json:"kinds"`
	Catalogs      []CatalogFilterOption `json:"catalogs"`
	ResourceTypes []CatalogResourceType `json:"resource_types"`
}

CatalogListMeta carries the page position and the facets the browse page builds its filters from. Total is the number of items matching the query; Counts, Kinds, Catalogs and ResourceTypes describe the caller's whole accessible set so the filter controls do not shrink as filters are applied.

type CatalogListResponse

type CatalogListResponse struct {
	Data []CatalogItem   `json:"data"`
	Meta CatalogListMeta `json:"meta"`
}

CatalogListResponse is the body of GET /common/catalog.

type CatalogModelInfo

type CatalogModelInfo struct {
	Name                  string   `json:"name"`
	IsDefault             bool     `json:"is_default"`
	InputPricePerMillion  *float64 `json:"input_price_per_million,omitempty"`
	OutputPricePerMillion *float64 `json:"output_price_per_million,omitempty"`
	Currency              string   `json:"currency,omitempty"`
}

CatalogModelInfo is one model an LLM provider serves, as far as the platform knows: the default model, the literal entries of the allow list, and every model in the vendor's price table that the allow list admits. Prices are reported per million tokens because that is how developers compare them.

type CatalogRef

type CatalogRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

CatalogRef names one catalog an item is available through.

type CatalogResourceType

type CatalogResourceType struct {
	PluginID uint   `json:"plugin_id"`
	Slug     string `json:"slug"`
	Name     string `json:"name"`
	Icon     string `json:"icon,omitempty"`
	// AccessGrantedViaApp is the type-level answer to "does an App credential
	// grant access to these?"; the item carries the per-instance value.
	AccessGrantedViaApp bool `json:"access_granted_via_app"`
}

CatalogResourceType describes the plugin resource type of a plugin resource item.

type CatalogRouterLLM

type CatalogRouterLLM struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	Vendor string `json:"vendor"`
}

CatalogRouterLLM is one LLM a router can send a request to.

type CatalogRouterRoute

type CatalogRouterRoute struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	Default     bool   `json:"default,omitempty"`
}

CatalogRouterRoute is one route of a Semantic Router, as the portal shows it.

type CatalogueGroupsResponse

type CatalogueGroupsResponse struct {
	Data []services.CatalogueGroup `json:"data"`
}

CatalogueGroupsResponse lists the teams a catalogue is shared with. @Description Teams using a catalogue

type CatalogueInput

type CatalogueInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name string `json:"name"`
		} `json:"attributes"`
	} `json:"data"`
}

CatalogueInput represents the input for catalogue-related operations @Description Catalogue input model

type CatalogueLLMInput

type CatalogueLLMInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

CatalogueLLMInput represents the input for adding an LLM to a catalogue @Description Catalogue-LLM relationship input model

type CatalogueResponse

type CatalogueResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name     string   `json:"name"`
		LLMNames []string `json:"llm_names"`
	} `json:"attributes"`
}

CatalogueResponse represents the response for catalogue-related operations @Description Catalogue response model

type CatalogueRouterRef

type CatalogueRouterRef struct {
	ID     uint   `json:"id"`
	Name   string `json:"name"`
	Slug   string `json:"slug"`
	Active bool   `json:"active"`
}

CatalogueRouterRef is one router published in a catalogue.

type CatalogueRoutersInput

type CatalogueRoutersInput struct {
	ModelRouterIDs    *[]uint `json:"model_router_ids"`
	SemanticRouterIDs *[]uint `json:"semantic_router_ids"`
}

CatalogueRoutersInput replaces a catalogue's routers. A list left out leaves that kind unchanged; an empty list removes them all.

type ChatDefaultsResponse

type ChatDefaultsResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name                string                        `json:"name"`
		DefaultDataSource   *SimplifiedDataSourceResponse `json:"default_data_source"`
		DefaultTools        []SimplifiedToolResponse      `json:"default_tools"`
		SupportsTools       bool                          `json:"supports_tools"`
		RagResultsPerSource int                           `json:"rag_results_per_source"`
	} `json:"attributes"`
}

type ChatHistoryRecordInput

type ChatHistoryRecordInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			SessionID string `json:"session_id"`
			ChatID    uint   `json:"chat_id"`
			UserID    uint   `json:"user_id"`
			Name      string `json:"name"`
		} `json:"attributes"`
	} `json:"data"`
}

ChatHistoryRecordInput represents the input for chat history record-related operations @Description Chat History Record input model

type ChatHistoryRecordListResponse

type ChatHistoryRecordListResponse struct {
	Data []ChatHistoryRecordResponse `json:"data"`
}

ChatHistoryRecordListResponse represents the response for listing chat history records @Description Chat History Record list response model

type ChatHistoryRecordResponse

type ChatHistoryRecordResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		SessionID string `json:"session_id"`
		ChatID    uint   `json:"chat_id"`
		UserID    uint   `json:"user_id"`
		Name      string `json:"name"`
	} `json:"attributes"`
}

ChatHistoryRecordResponse represents the response for chat history record-related operations @Description Chat History Record response model

type ChatInput

type ChatInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name                string `json:"name"`
			Description         string `json:"description"`
			LLMSettingsID       uint   `json:"llm_settings_id"`
			LLMID               uint   `json:"llm_id"`
			GroupIDs            []uint `json:"group_ids"`
			FilterIDs           []uint `json:"filter_ids"`
			RagN                int    `json:"rag_n"`
			ToolSupport         bool   `json:"tool_support"`
			SystemPrompt        string `json:"system_prompt"`
			DefaultDataSourceID int    `json:"default_data_source_id"`
			DefaultToolIDs      []uint `json:"default_tool_ids"`
		} `json:"attributes"`
	} `json:"data"`
}

ChatInput represents the input for chat-related operations @Description Chat input model

type ChatMessage

type ChatMessage struct {
	Type        string               `json:"type"`
	Payload     string               `json:"payload"`
	FileRefs    []string             `json:"file_refs"`
	Tools       []models.Tool        `json:"tools,omitempty"`
	Datasources []*models.Datasource `json:"datasources,omitempty"`
}

type ChatResponse

type ChatResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name                string                   `json:"name"`
		Description         string                   `json:"description"`
		LLMSettingsID       string                   `json:"llm_settings_id"`
		LLMID               string                   `json:"llm_id"`
		Groups              []GroupResponse          `json:"groups"`
		Filters             []FilterResponse         `json:"filters"`
		RagN                int                      `json:"rag_n"`
		ToolSupport         bool                     `json:"tool_support"`
		SystemPrompt        string                   `json:"system_prompt"`
		DefaultDataSourceID int                      `json:"default_data_source_id"`
		DefaultDataSource   DatasourceResponse       `json:"default_data_source"`
		ExtraContext        []FileStoreResponse      `json:"extra_context"`
		DefaultTools        []ToolResponse           `json:"default_tools"`
		PromptTemplates     []PromptTemplateResponse `json:"prompt_templates"`
	} `json:"attributes"`
}

ChatResponse represents the response for chat-related operations @Description Chat response model

type CloneRoleInput

type CloneRoleInput struct {
	Name string `json:"name"`
}

CloneRoleInput names the copy. @Description Clone role input

type ClusterStatusFunc

type ClusterStatusFunc func(ctx context.Context) (interface{}, error)

ClusterStatusFunc reports the control plane's replicas (pkg/cluster.Status).

type ConsentDetailsResponse

type ConsentDetailsResponse struct {
	AuthRequestID string         `json:"auth_req_id"`
	ClientName    string         `json:"client_name"`
	Scopes        []string       `json:"scopes"`
	AvailableApps []AppWithTools `json:"available_apps"`
	NoAppsMessage string         `json:"no_apps_message,omitempty"`
}

type CreateAppRequest

type CreateAppRequest struct {
	Name            string                `json:"name" binding:"required"`
	Description     string                `json:"description" binding:"required"`
	DataSourceIDs   []uint                `json:"data_source_ids" binding:"required"`
	LLMIDs          []uint                `json:"llm_ids" binding:"required"`
	ToolIDs         []uint                `json:"tool_ids" binding:"required"`
	MonthlyBudget   *float64              `json:"monthly_budget"`
	BudgetStartDate *time.Time            `json:"budget_start_date"`
	PluginResources []PluginResourceInput `json:"plugin_resources,omitempty"`
	// MCPServerIDs binds Tyk-managed MCP servers the user's teams can see.
	MCPServerIDs []uint `json:"mcp_server_ids,omitempty"`
	// ModelRouterIDs grants Model Routers published in the user's LLM
	// catalogues (Enterprise).
	ModelRouterIDs []uint `json:"model_router_ids,omitempty"`
	// SemanticRouterIDs grants Semantic Routers published in the user's LLM
	// catalogues (Enterprise).
	SemanticRouterIDs []uint `json:"semantic_router_ids,omitempty"`
}

CreateAppRequest represents the request body for creating a new app

type CredentialDetail

type CredentialDetail struct {
	KeyID  string `json:"key_id"`
	Secret string `json:"secret"`
	Active bool   `json:"active"`
}

CredentialDetail represents the credential details @Description Credential detail model

type CredentialInput

type CredentialInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			KeyID  string `json:"key_id"`
			Secret string `json:"secret"`
			Active bool   `json:"active"`
		} `json:"attributes"`
	} `json:"data"`
}

CredentialInput represents the input for credential-related operations @Description Credential input model

type CredentialResponse

type CredentialResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		KeyID  string `json:"key_id"`
		Secret string `json:"secret"`
		Active bool   `json:"active"`
	} `json:"attributes"`
}

CredentialResponse represents the response for credential-related operations @Description Credential response model

type DataCatalogueDatasourceInput

type DataCatalogueDatasourceInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

DataCatalogueDatasourceInput represents the input for adding a datasource to a data catalogue @Description Data Catalogue-Datasource relationship input model

type DataCatalogueInput

type DataCatalogueInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name             string `json:"name"`
			ShortDescription string `json:"short_description"`
			LongDescription  string `json:"long_description"`
			Icon             string `json:"icon"`
		} `json:"attributes"`
	} `json:"data"`
}

DataCatalogueInput represents the input for data catalogue-related operations @Description Data Catalogue input model

type DataCatalogueResponse

type DataCatalogueResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name             string               `json:"name"`
		ShortDescription string               `json:"short_description"`
		LongDescription  string               `json:"long_description"`
		Icon             string               `json:"icon"`
		Datasources      []DatasourceResponse `json:"datasources"`
		Tags             []TagResponse        `json:"tags"`
	} `json:"attributes"`
}

DataCatalogueResponse represents the response for data catalogue-related operations @Description Data Catalogue response model

type DataCatalogueTagInput

type DataCatalogueTagInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

DataCatalogueTagInput represents the input for adding a tag to a data catalogue @Description Data Catalogue-Tag relationship input model

type DatasourceInput

type DatasourceInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name             string   `json:"name"`
			ShortDescription string   `json:"short_description"`
			LongDescription  string   `json:"long_description"`
			Icon             string   `json:"icon"`
			Url              string   `json:"url"`
			PrivacyScore     int      `json:"privacy_score"`
			UserID           uint     `json:"user_id"`
			Tags             []string `json:"tags"`
			DBConnString     string   `json:"db_conn_string"`
			DBSourceType     string   `json:"db_source_type"`
			DBConnAPIKey     string   `json:"db_conn_api_key"`
			DBName           string   `json:"db_name"`
			EmbedVendor      string   `json:"embed_vendor"`
			EmbedUrl         string   `json:"embed_url"`
			EmbedAPIKey      string   `json:"embed_api_key"`
			EmbedModel       string   `json:"embed_model"`
			// EmbedderID links an embedder and takes precedence over the
			// embed_* fields (0 unlinks). Without it, the embed_* fields are
			// resolved to a matching embedder.
			EmbedderID *uint  `json:"embedder_id,omitempty"`
			Active     bool   `json:"active"`
			Namespace  string `json:"namespace"`
			// Governed metadata (Enterprise). nil = untouched; {} = clear.
			GovernedMetadata *map[string]interface{} `json:"governed_metadata,omitempty"`
		} `json:"attributes"`
	} `json:"data"`
}

DatasourceInput represents the input for datasource-related operations @Description Datasource input model

type DatasourceResponse

type DatasourceResponse struct {
	Type string `json:"type"`
	ID   string `json:"id"`
	// Governed metadata (Enterprise); see LLMResponse.
	GovernedMetadata       interface{} `json:"governed_metadata,omitempty"`
	GovernedMetadataStatus string      `json:"governed_metadata_status,omitempty"`
	Attributes             struct {
		Name             string              `json:"name"`
		ShortDescription string              `json:"short_description"`
		LongDescription  string              `json:"long_description"`
		Icon             string              `json:"icon"`
		Url              string              `json:"url"`
		PrivacyScore     int                 `json:"privacy_score"`
		UserID           uint                `json:"user_id"`
		Tags             []TagResponse       `json:"tags"`
		DBConnString     string              `json:"db_conn_string"`
		DBSourceType     string              `json:"db_source_type"`
		DBConnAPIKey     string              `json:"db_conn_api_key"`
		HasDBConnAPIKey  bool                `json:"has_db_conn_api_key"`
		DBName           string              `json:"db_name"`
		EmbedVendor      string              `json:"embed_vendor"`
		EmbedUrl         string              `json:"embed_url"`
		EmbedAPIKey      string              `json:"embed_api_key"`
		HasEmbedAPIKey   bool                `json:"has_embed_api_key"`
		EmbedModel       string              `json:"embed_model"`
		EmbedderID       *uint               `json:"embedder_id"`
		EmbedderName     string              `json:"embedder_name"`
		Active           bool                `json:"active"`
		Namespace        string              `json:"namespace"`
		Files            []FileStoreResponse `json:"files"`
	} `json:"attributes"`
}

DatasourceResponse represents the response for datasource-related operations @Description Datasource response model

type DependencyInput

type DependencyInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

DependencyInput represents the input for adding or removing a dependency @Description Dependency input model

type DependencyListResponse

type DependencyListResponse struct {
	Data []ToolResponse `json:"data"`
}

DependencyListResponse represents the response for listing dependencies @Description Dependency list response model

type DependentsResponse

type DependentsResponse struct {
	Data struct {
		Type       string              `json:"type"`
		ID         string              `json:"id"`
		Attributes services.Dependents `json:"attributes"`
	} `json:"data"`
}

DependentsResponse is the JSON:API-style envelope for a dependents lookup. Every array in attributes is always present (empty when nothing references the object) and total is their sum. @Description Dependents response model

type EdgeListResponse

type EdgeListResponse struct {
	Data []EdgeResponse `json:"data"`
	Meta struct {
		TotalCount int64 `json:"total_count"`
		TotalPages int   `json:"total_pages"`
		PageSize   int   `json:"page_size"`
		PageNumber int   `json:"page_number"`
	} `json:"meta"`
}

EdgeListResponse represents a list of edges

type EdgeOwner

type EdgeOwner struct {
	OwnerNodeID string `json:"owner_node_id"`
	// OwnerLabel is the replica's label (cluster.NodeOptions.Label), empty
	// when it has none or is no longer registered.
	OwnerLabel string `json:"owner_label"`
	// OwnerLive: the replica's registration is fresh.
	OwnerLive bool `json:"owner_live"`
}

EdgeOwner is the Studio replica holding an edge's configuration stream: empty when no replica holds it (the edge is not connected). With several replicas (a Dashboard's Studio and headless control planes in MDCB), it tells operators which one serves the edge.

type EdgeResponse

type EdgeResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		EdgeID        string                 `json:"edge_id"`
		Namespace     string                 `json:"namespace"` // Always "default" in CE
		Version       string                 `json:"version"`
		BuildHash     string                 `json:"build_hash"`
		Metadata      map[string]interface{} `json:"metadata"`
		LastHeartbeat *time.Time             `json:"last_heartbeat"`
		Status        string                 `json:"status"`
		SessionID     string                 `json:"session_id"`
		// Sync status fields for configuration sync tracking
		SyncStatus     string     `json:"sync_status"`
		LoadedChecksum string     `json:"loaded_checksum"`
		LoadedVersion  string     `json:"loaded_version"`
		LastSyncAck    *time.Time `json:"last_sync_ack"`
		CreatedAt      time.Time  `json:"created_at"`
		UpdatedAt      time.Time  `json:"updated_at"`
		EdgeOwner
	} `json:"attributes"`
}

EdgeResponse represents an edge instance in API responses CE: Namespace field is always "default"

type EffectiveAccessResponse

type EffectiveAccessResponse struct {
	UserID         uint                               `json:"user_id"`
	Permissions    []string                           `json:"permissions"`
	Roles          []rbac.RoleSummary                 `json:"roles"`
	Sources        map[string][]rbac.PermissionSource `json:"sources"`
	IsFullAdmin    bool                               `json:"is_full_admin"`
	HasAdminAccess bool                               `json:"has_admin_access"`
	Enabled        bool                               `json:"enabled"`
}

EffectiveAccessResponse is a user's resolved access. Sources maps each entry of Permissions to the bindings (role, direct or via team) that grant it. @Description Effective permissions for a user

type EmbedderAttributes

type EmbedderAttributes struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	LLMID       *uint  `json:"llm_id"`
	Vendor      string `json:"vendor"`
	Endpoint    string `json:"endpoint"`
	// APIKey: "[redacted]" on update keeps the stored key.
	APIKey       string `json:"api_key"`
	Model        string `json:"model"`
	PrivacyScore int    `json:"privacy_score"`
}

EmbedderAttributes is an embedder as the API reads and writes it. A linked embedder sets llm_id and takes its vendor, endpoint, key and privacy score from that LLM; a standalone one sets vendor (its API compatibility), endpoint, api_key and privacy_score itself.

type EmbedderInput

type EmbedderInput struct {
	Data struct {
		Type       string             `json:"type"`
		Attributes EmbedderAttributes `json:"attributes"`
	} `json:"data"`
}

EmbedderInput is the JSON:API body of an embedder create or update.

type EndpointAuthPluginsRequest

type EndpointAuthPluginsRequest struct {
	// PluginIDs in execution order; empty detaches every auth plugin.
	PluginIDs []uint `json:"plugin_ids"`
}

EndpointAuthPluginsRequest replaces an endpoint's auth plugin list.

type ErrorResponse

type ErrorResponse struct {
	Errors []struct {
		Title  string `json:"title"`
		Detail string `json:"detail"`
	} `json:"errors"`
}

ErrorResponse represents an error response @Description Error response model

type ExportRequest

type ExportRequest struct {
	SourceType string `json:"source_type" binding:"required,oneof=app llm user"`
	SourceID   uint   `json:"source_id" binding:"required"`
	StartDate  string `json:"start_date" binding:"required"`
	EndDate    string `json:"end_date" binding:"required"`
	Search     string `json:"search"`
}

ExportRequest represents the request body for starting an export

type FileStoreInput

type FileStoreInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			FileName    string `json:"file_name"`
			Description string `json:"description"`
			Content     string `json:"content"`
			Length      int    `json:"length"`
		} `json:"attributes"`
	} `json:"data"`
}

FileStoreInput represents the input for filestore-related operations @Description FileStore input model

type FileStoreResponse

type FileStoreResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		FileName        string    `json:"file_name"`
		Description     string    `json:"description"`
		Content         string    `json:"-"`
		Length          int       `json:"length"`
		LastProcessedOn time.Time `json:"last_processed_on"`
	} `json:"attributes"`
}

FileStoreResponse represents the response for filestore-related operations @Description FileStore response model

type FilterAttributes

type FilterAttributes struct {
	Name           string                 `json:"name"`
	Description    string                 `json:"description"`
	Script         []byte                 `json:"script"`
	ResponseFilter bool                   `json:"response_filter"`
	Namespace      string                 `json:"namespace"`
	Kind           string                 `json:"kind"`
	Config         map[string]interface{} `json:"config,omitempty"`
}

FilterAttributes is the attribute block of a filter response. @Description Filter attributes

type FilterInput

type FilterInput struct {
	Data struct {
		Type       string                `json:"type"`
		Attributes FilterInputAttributes `json:"attributes"`
	} `json:"data"`
}

FilterInput represents the input for filter-related operations @Description Filter input model

type FilterInputAttributes

type FilterInputAttributes struct {
	Name           string `json:"name"`
	Description    string `json:"description"`
	Script         []byte `json:"script"`
	ResponseFilter bool   `json:"response_filter"`
	Namespace      string `json:"namespace"`
	// Kind is "script" (default) or "guardrail".
	Kind string `json:"kind"`
	// Config is the guardrail configuration (provider, detectors,
	// action, ...) for a guardrail filter.
	Config map[string]interface{} `json:"config"`
}

FilterInputAttributes is the attribute block of a filter create or update request. It mirrors FilterAttributes, the response block. @Description Filter input attributes

type FilterResponse

type FilterResponse struct {
	Type       string           `json:"type"`
	ID         string           `json:"id"`
	Attributes FilterAttributes `json:"attributes"`
}

FilterResponse represents the response for filter-related operations @Description Filter response model

type FilterTestInput

type FilterTestInput struct {
	Script string                 `json:"script"`
	Kind   string                 `json:"kind"`
	Config map[string]interface{} `json:"config"`
	// FilterID names the saved filter this test belongs to. A guardrail config
	// whose connection holds $SECRET/ or $ENV/ references is only run when
	// its connection block matches that saved filter's, so the test endpoint
	// cannot be used to send a resolved secret to a caller-chosen endpoint.
	FilterID       uint                   `json:"filter_id"`
	ResponseFilter bool                   `json:"response_filter"`
	Input          map[string]interface{} `json:"input" binding:"required"`
}

FilterTestInput represents the input for testing a filter. A script filter sends Script; a guardrail filter sends Kind "guardrail" and Config, and the test performs a real call to the configured provider. @Description Filter test input model

type FilterTestOutput

type FilterTestOutput struct {
	Success bool                   `json:"success"`
	Output  map[string]interface{} `json:"output,omitempty"`
	Error   string                 `json:"error,omitempty"`
}

FilterTestOutput represents the output of a filter test execution @Description Filter test output model

type ForgotPasswordInput

type ForgotPasswordInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Email string `json:"email"`
		} `json:"attributes"`
	} `json:"data"`
}

ForgotPasswordInput represents the input for forgot password operations @Description Forgot Password input model

type ForgotPasswordResponse

type ForgotPasswordResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

ForgotPasswordResponse represents the response for a successful forgot password request @Description ForgotPassword response model

type FrontendConfig

type FrontendConfig struct {
	APIBaseURL           string `json:"apiBaseURL"`
	ProxyURL             string `json:"proxyURL"`
	ToolDisplayURL       string `json:"toolDisplayURL"`
	DataSourceDisplayURL string `json:"dataSourceDisplayURL"`
	// UnifiedRouterPath is the base path of the gateway's unified OpenAI-compatible
	// ingress ({base}/chat/completions), normalized as the proxy itself resolves it.
	// Empty when the ingress is disabled, so the portal hides it instead of
	// advertising an endpoint that would 404.
	UnifiedRouterPath string            `json:"unifiedRouterPath"`
	DefaultSignUpMode string            `json:"defaultSignUpMode"`
	TIBEnabled        bool              `json:"tibEnabled"`
	IsEnterprise      bool              `json:"is_enterprise"`
	DocsLinks         map[string]string `json:"docsLinks"`
	Branding          *BrandingConfig   `json:"branding,omitempty"`
	DocsEnabled       bool              `json:"docsEnabled"`
	DocsURL           string            `json:"docsURL,omitempty"`
	// AllowSSOUserAPIKeys mirrors ALLOW_SSO_USER_API_KEYS so the console can
	// hide key issuance for SSO-provisioned users instead of offering a
	// button that returns 403.
	AllowSSOUserAPIKeys bool `json:"allowSSOUserAPIKeys"`
	// BasePath is the path prefix the console is served under ("" for the
	// root), so it can build URLs and route under it.
	BasePath string `json:"basePath"`
	// AuthMode is "local" when Studio signs users in itself and "host" when
	// the application it is embedded in does; then LoginURL and LogoutURL
	// say where to send the user.
	AuthMode  string `json:"authMode"`
	LoginURL  string `json:"loginURL,omitempty"`
	LogoutURL string `json:"logoutURL,omitempty"`
	// CSRFTokenHeader and CSRFTokenURL say how the console obtains and
	// presents a CSRF token for cookie-authenticated writes.
	CSRFTokenHeader string `json:"csrfTokenHeader"`
	CSRFTokenURL    string `json:"csrfTokenURL"`
	// Chrome is "none" when the host application draws the navigation, and
	// the console then leaves out its top bar and drawers; "full" otherwise.
	Chrome string `json:"chrome"`
}

FrontendConfig holds front-end configuration settings @Description Front-end config model

type GroupAttributes

type GroupAttributes struct {
	Name           string                  `json:"name"`
	Users          []UserResponse          `json:"users,omitempty"`
	Catalogues     []CatalogueResponse     `json:"catalogues,omitempty"`
	DataCatalogues []DataCatalogueResponse `json:"data_catalogues,omitempty"`
	ToolCatalogues []ToolCatalogueResponse `json:"tool_catalogues,omitempty"`
	Roles          []rbac.RoleSummary      `json:"roles,omitempty"`
}

GroupAttributes is the group (team) payload. @Description Group attributes

type GroupCatalogueInput

type GroupCatalogueInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

GroupCatalogueInput represents the input for adding a catalogue to a group @Description Group-Catalogue relationship input model

type GroupCataloguesRequest

type GroupCataloguesRequest struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Catalogues     []uint `json:"catalogues"`
			DataCatalogues []uint `json:"data_catalogues"`
			ToolCatalogues []uint `json:"tool_catalogues"`
		} `json:"attributes"`
	} `json:"data"`
}

type GroupDataCatalogueInput

type GroupDataCatalogueInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

GroupDataCatalogueInput represents the input for adding a data catalogue to a group @Description Group-DataCatalogue relationship input model

type GroupInput

type GroupInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name           string `json:"name"`
			Members        []uint `json:"members"`
			Catalogues     []uint `json:"catalogues"`
			DataCatalogues []uint `json:"data_catalogues"`
			ToolCatalogues []uint `json:"tool_catalogues"`
		} `json:"attributes"`
	} `json:"data"`
}

GroupInput represents the input for group-related operations @Description Group input model

type GroupListResponse

type GroupListResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name               string             `json:"name"`
		UserCount          int                `json:"user_count"`
		CatalogueCount     int                `json:"catalogue_count"`
		DataCatalogueCount int                `json:"data_catalogue_count"`
		ToolCatalogueCount int                `json:"tool_catalogue_count"`
		CatalogueNames     []string           `json:"catalogue_names"`
		DataCatalogueNames []string           `json:"data_catalogue_names"`
		ToolCatalogueNames []string           `json:"tool_catalogue_names"`
		Roles              []rbac.RoleSummary `json:"roles,omitempty"`
	} `json:"attributes"`
}

type GroupResponse

type GroupResponse struct {
	Type       string          `json:"type"`
	ID         string          `json:"id"`
	Attributes GroupAttributes `json:"attributes"`
}

GroupResponse represents the response for group-related operations @Description Group response model

type GroupToolCatalogueInput

type GroupToolCatalogueInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

GroupToolCatalogueInput represents the input for adding a tool catalogue to a group @Description Group-ToolCatalogue relationship input model

type GroupUsersInput

type GroupUsersInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Members []uint `json:"members"`
		} `json:"attributes"`
	} `json:"data"`
}

type HubSession

type HubSession interface {
	ID() string
	Stop()
}

HubSession is what the SessionHub manages: chat-room sessions and agent sessions both satisfy it.

type LLMInput

type LLMInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name             string                 `json:"name"`
			APIKey           string                 `json:"api_key"`
			APIEndpoint      string                 `json:"api_endpoint"`
			PrivacyScore     int                    `json:"privacy_score"`
			ShortDescription string                 `json:"short_description"`
			LongDescription  string                 `json:"long_description"`
			LogoURL          string                 `json:"logo_url"`
			Vendor           string                 `json:"vendor"`
			Active           bool                   `json:"active"`
			Filters          []uint                 `json:"filters"`
			DefaultModel     string                 `json:"default_model"`
			AllowedModels    []string               `json:"allowed_models"`
			MonthlyBudget    *float64               `json:"monthly_budget"`
			BudgetStartDate  *string                `json:"budget_start_date"`
			Namespace        string                 `json:"namespace,omitempty"`
			DontLogBodies    bool                   `json:"dont_log_bodies"`
			Metadata         map[string]interface{} `json:"metadata,omitempty"`
			// Governed metadata (Enterprise). nil = untouched; {} = clear.
			GovernedMetadata *map[string]interface{} `json:"governed_metadata,omitempty"`
			// Failover waterfall. On PATCH an absent key keeps the stored
			// value and an explicit null clears it.
			Failover *models.LLMFailover `json:"failover,omitempty"`
		} `json:"attributes"`
	} `json:"data"`
}

LLMInput represents the input for LLM-related operations @Description LLM input model

type LLMResponse

type LLMResponse struct {
	Type string `json:"type"`
	ID   string `json:"id"`
	// Governed metadata (Enterprise): admin responses carry the raw values map and a
	// status; portal responses carry a display-ready [{key,label,type,value}] list.
	GovernedMetadata       interface{} `json:"governed_metadata,omitempty"`
	GovernedMetadataStatus string      `json:"governed_metadata_status,omitempty"`
	Attributes             struct {
		Name             string                 `json:"name"`
		APIKey           string                 `json:"api_key"`
		HasAPIKey        bool                   `json:"has_api_key"`
		CredentialStatus string                 `json:"credential_status"`
		CredentialRef    string                 `json:"credential_ref,omitempty"`
		APIEndpoint      string                 `json:"api_endpoint"`
		PrivacyScore     int                    `json:"privacy_score"`
		ShortDescription string                 `json:"short_description"`
		LongDescription  string                 `json:"long_description"`
		LogoURL          string                 `json:"logo_url"`
		Vendor           string                 `json:"vendor"`
		Active           bool                   `json:"active"`
		Filters          []FilterResponse       `json:"filters"`
		DefaultModel     string                 `json:"default_model"`
		AllowedModels    []string               `json:"allowed_models"`
		MonthlyBudget    *float64               `json:"monthly_budget"`
		BudgetStartDate  *time.Time             `json:"budget_start_date"`
		Namespace        string                 `json:"namespace"`
		DontLogBodies    bool                   `json:"dont_log_bodies"`
		Plugins          []PluginResponse       `json:"plugins"`
		Metadata         map[string]interface{} `json:"metadata,omitempty"`
		Failover         *models.LLMFailover    `json:"failover,omitempty"`
	} `json:"attributes"`
}

LLMResponse represents the response for LLM-related operations @Description LLM response model

type LLMSettingsInput

type LLMSettingsInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			ModelName         string                 `json:"model_name"`
			MaxLength         int                    `json:"max_length"`
			MaxTokens         int                    `json:"max_tokens"`
			Metadata          map[string]interface{} `json:"metadata"`
			MinLength         int                    `json:"min_length"`
			RepetitionPenalty float64                `json:"repetition_penalty"`
			Seed              int                    `json:"seed"`
			StopWords         []string               `json:"stop_words"`
			Temperature       float64                `json:"temperature"`
			TopK              int                    `json:"top_k"`
			TopP              float64                `json:"top_p"`
			SystemPrompt      string                 `json:"system_prompt"`
		} `json:"attributes"`
	} `json:"data"`
}

LLMSettingsInput represents the input structure for creating or updating LLM settings @Description LLM settings input model

type LLMSettingsResponse

type LLMSettingsResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		ModelName         string                 `json:"model_name"`
		MaxLength         int                    `json:"max_length"`
		MaxTokens         int                    `json:"max_tokens"`
		Metadata          map[string]interface{} `json:"metadata"`
		MinLength         int                    `json:"min_length"`
		RepetitionPenalty float64                `json:"repetition_penalty"`
		Seed              int                    `json:"seed"`
		StopWords         []string               `json:"stop_words"`
		Temperature       float64                `json:"temperature"`
		TopK              int                    `json:"top_k"`
		TopP              float64                `json:"top_p"`
		SystemPrompt      string                 `json:"system_prompt"`
	} `json:"attributes"`
}

LLMSettingsResponse represents the response structure for LLM settings @Description LLM settings response model

type LoginInput

type LoginInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Email    string `json:"email"`
			Password string `json:"password"`
		} `json:"attributes"`
	} `json:"data"`
}

LoginInput represents the input for login operations @Description Login input model

type LoginPageProfileResponse

type LoginPageProfileResponse struct {
	Type       string `json:"type"`
	ID         uint   `json:"id"`
	Attributes struct {
		ProfileID            string `json:"profile_id"`
		Name                 string `json:"name"`
		SelectedProviderType string `json:"selected_provider_type"`
		LoginURL             string `json:"login_url"`
		UseInLoginPage       bool   `json:"use_in_login_page"`
	} `json:"attributes"`
}

LoginPageProfileResponse is the sanitized SSO profile returned by the public, unauthenticated /login-sso-profile endpoint. It intentionally exposes only what the login page needs to render the SSO button — never provider_config, identity_handler_config, or any other credential-bearing fields. @Description Sanitized login page SSO profile model

type LoginResponse

type LoginResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

LoginResponse represents the response for successful login @Description Login response model

type LogoutResponse

type LogoutResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

LogoutResponse represents the response for successful logout @Description Logout response model

type MarketplaceAdminHandlers

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

MarketplaceAdminHandlers handles marketplace management API endpoints Community Edition: Returns 403 Forbidden for all management operations

func NewMarketplaceAdminHandlers

func NewMarketplaceAdminHandlers(service interface{}, marketplaceService interface{}) *MarketplaceAdminHandlers

NewMarketplaceAdminHandlers creates marketplace admin handlers for Community Edition

func (*MarketplaceAdminHandlers) AddMarketplace

func (h *MarketplaceAdminHandlers) AddMarketplace(c *gin.Context)

AddMarketplace returns 403 in Community Edition

func (*MarketplaceAdminHandlers) GetMarketplace

func (h *MarketplaceAdminHandlers) GetMarketplace(c *gin.Context)

GetMarketplace returns 403 in Community Edition

func (*MarketplaceAdminHandlers) ListMarketplaces

func (h *MarketplaceAdminHandlers) ListMarketplaces(c *gin.Context)

ListMarketplaces returns 403 in Community Edition

func (*MarketplaceAdminHandlers) RemoveMarketplace

func (h *MarketplaceAdminHandlers) RemoveMarketplace(c *gin.Context)

RemoveMarketplace returns 403 in Community Edition

func (*MarketplaceAdminHandlers) SyncMarketplace

func (h *MarketplaceAdminHandlers) SyncMarketplace(c *gin.Context)

SyncMarketplace returns 403 in Community Edition

func (*MarketplaceAdminHandlers) UpdateMarketplace

func (h *MarketplaceAdminHandlers) UpdateMarketplace(c *gin.Context)

UpdateMarketplace returns 403 in Community Edition

func (*MarketplaceAdminHandlers) ValidateMarketplaceURL

func (h *MarketplaceAdminHandlers) ValidateMarketplaceURL(c *gin.Context)

ValidateMarketplaceURL returns 403 in Community Edition

type MarketplaceHandlers

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

MarketplaceHandlers contains handlers for marketplace operations

func NewMarketplaceHandlers

func NewMarketplaceHandlers(marketplaceService *services.MarketplaceService) *MarketplaceHandlers

NewMarketplaceHandlers creates new marketplace handlers

func (*MarketplaceHandlers) GetAvailableUpdates

func (h *MarketplaceHandlers) GetAvailableUpdates(c *gin.Context)

GetAvailableUpdates returns plugins with available updates GET /api/marketplace/updates

func (*MarketplaceHandlers) GetCategories

func (h *MarketplaceHandlers) GetCategories(c *gin.Context)

GetCategories returns available plugin categories GET /api/marketplace/categories

func (*MarketplaceHandlers) GetInstallMetadata

func (h *MarketplaceHandlers) GetInstallMetadata(c *gin.Context)

GetInstallMetadata returns metadata needed to pre-populate the plugin creation wizard GET /api/marketplace/plugins/:id/install-metadata

func (*MarketplaceHandlers) GetPlugin

func (h *MarketplaceHandlers) GetPlugin(c *gin.Context)

GetPlugin returns details for a specific marketplace plugin GET /api/marketplace/plugins/:id

func (*MarketplaceHandlers) GetPluginVersions

func (h *MarketplaceHandlers) GetPluginVersions(c *gin.Context)

GetPluginVersions returns all versions of a marketplace plugin GET /api/marketplace/plugins/:id/versions

func (*MarketplaceHandlers) GetPublishers

func (h *MarketplaceHandlers) GetPublishers(c *gin.Context)

GetPublishers returns available plugin publishers GET /api/marketplace/publishers

func (*MarketplaceHandlers) GetStats

func (h *MarketplaceHandlers) GetStats(c *gin.Context)

GetStats returns marketplace statistics GET /api/marketplace/stats

func (*MarketplaceHandlers) GetSyncStatus

func (h *MarketplaceHandlers) GetSyncStatus(c *gin.Context)

GetSyncStatus returns the current sync status GET /api/marketplace/sync-status

func (*MarketplaceHandlers) ListPlugins

func (h *MarketplaceHandlers) ListPlugins(c *gin.Context)

ListPlugins returns paginated list of marketplace plugins GET /api/marketplace/plugins

func (*MarketplaceHandlers) SyncMarketplace

func (h *MarketplaceHandlers) SyncMarketplace(c *gin.Context)

SyncMarketplace triggers a manual marketplace sync POST /api/marketplace/sync

type MetadataSchemaInput

type MetadataSchemaInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name        string                    `json:"name"`
			Slug        string                    `json:"slug"`
			Description string                    `json:"description"`
			AppliesTo   []string                  `json:"applies_to"`
			Fields      []models.MetadataFieldDef `json:"fields"`
			Enforcement string                    `json:"enforcement"`
			Active      *bool                     `json:"active"`
			Order       *int                      `json:"order"`
		} `json:"attributes"`
	} `json:"data"`
}

MetadataSchemaInput is the JSON:API body for schema create/update.

type MetadataValidationError

type MetadataValidationError struct {
	Title  string `json:"title"`
	Detail string `json:"detail"`
	Code   string `json:"code,omitempty"`
	Source *struct {
		Pointer string `json:"pointer"`
	} `json:"source,omitempty"`
}

MetadataValidationError is one governed-metadata validation problem. Source.Pointer is a JSON pointer into the request body (e.g. /data/attributes/governed_metadata/risk_tier) so forms can highlight the field.

type MetadataValidationErrorResponse

type MetadataValidationErrorResponse struct {
	Errors []MetadataValidationError `json:"errors"`
}

MetadataValidationErrorResponse is returned with HTTP 422 when governed metadata fails validation under an enforcing schema, or when a plugin hook rejects the change.

type MetadataVocabularyInput

type MetadataVocabularyInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name        string                  `json:"name"`
			Slug        string                  `json:"slug"`
			Description string                  `json:"description"`
			Terms       []models.VocabularyTerm `json:"terms"`
		} `json:"attributes"`
	} `json:"data"`
}

MetadataVocabularyInput is the JSON:API body for vocabulary create/update.

type ModelMappingInput

type ModelMappingInput struct {
	SourceModel string `json:"source_model"`
	TargetModel string `json:"target_model"`
}

ModelMappingInput represents a mapping in the input

type ModelPoolInput

type ModelPoolInput struct {
	Name               string            `json:"name"`
	ModelPattern       string            `json:"model_pattern"`
	SelectionAlgorithm string            `json:"selection_algorithm"`
	Priority           int               `json:"priority"`
	Vendors            []PoolVendorInput `json:"vendors"`
}

ModelPoolInput represents a pool in the input

type ModelPriceInput

type ModelPriceInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			ModelName    string  `json:"model_name"`
			Vendor       string  `json:"vendor"`
			CPT          float64 `json:"cpt"`
			CPIT         float64 `json:"cpit"`
			CacheWritePT float64 `json:"cache_write_pt"`
			CacheReadPT  float64 `json:"cache_read_pt"`
			Currency     string  `json:"currency"`
		} `json:"attributes"`
	} `json:"data"`
}

ModelPriceInput represents the input for model price-related operations @Description Model Price input model

type ModelPriceResponse

type ModelPriceResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		ModelName    string  `json:"model_name"`
		Vendor       string  `json:"vendor"`
		CPT          float64 `json:"cpt"`
		CPIT         float64 `json:"cpit"`
		CacheWritePT float64 `json:"cache_write_pt"`
		CacheReadPT  float64 `json:"cache_read_pt"`
		Currency     string  `json:"currency"`
	} `json:"attributes"`
}

ModelPriceResponse represents the response for model price-related operations @Description Model Price response model

type ModelRouterInput

type ModelRouterInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name        string `json:"name"`
			Slug        string `json:"slug"`
			Description string `json:"description"`
			APICompat   string `json:"api_compat"`
			// Active is the live switch. Omitted = inactive on create (the
			// model default), unchanged on update. Setting it needs
			// model-routers:publish.
			Active    *bool            `json:"active"`
			Namespace string           `json:"namespace"`
			Pools     []ModelPoolInput `json:"pools"`
			// Portal presentation (the router is published in LLM catalogues).
			ShortDescription string `json:"short_description"`
			LongDescription  string `json:"long_description"`
			LogoURL          string `json:"logo_url"`
		} `json:"attributes"`
	} `json:"data"`
}

ModelRouterInput represents the JSON:API input for creating/updating a model router

type NavItem struct {
	ID         string    `json:"id"`
	Text       string    `json:"text"`
	Path       string    `json:"path,omitempty"`
	Icon       string    `json:"icon,omitempty"`
	Exact      bool      `json:"exact,omitempty"`
	Title      string    `json:"title,omitempty"`
	Permission string    `json:"permission,omitempty"`
	PluginID   uint      `json:"pluginId,omitempty"`
	Items      []NavItem `json:"items,omitempty"`
}

NavItem is one entry of the console's navigation: a page (Path) or a group of pages (Items). Paths are the console's own routes, without the base path. Icon names a Font Awesome icon the console ships. Permission is the one that unlocks the entry; the manifest only lists entries the user may open, so a host need not check it.

type NavManifest struct {
	Surfaces []NavItem `json:"surfaces"`
	Admin    []NavItem `json:"admin"`
	Portal   []NavItem `json:"portal"`
	Chat     []NavItem `json:"chat"`
}

NavManifest is the navigation a user may see: the surfaces (Admin, Portal, Chat) the console's top bar switches between, and the menu of each. The console's drawers render from it, and a host that draws its own navigation (Options.Chromeless) builds its menu from it. A surface the user may not use has an empty menu.

type NotificationHandlers

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

func NewNotificationHandlers

func NewNotificationHandlers(notificationService *services.NotificationService) *NotificationHandlers

func (*NotificationHandlers) ListNotifications

func (h *NotificationHandlers) ListNotifications(c *gin.Context)

ListNotifications handles GET /api/v1/notifications

Query: limit (default 20), offset (default 0), unread=true to list only unread ones. Response: {"data":[...], "meta":{"total","unread","limit","offset"}} where total counts the rows matching the filter and unread is the user's unread count regardless of the filter.

func (*NotificationHandlers) MarkAllAsRead

func (h *NotificationHandlers) MarkAllAsRead(c *gin.Context)

MarkAllAsRead handles PUT /api/v1/notifications/read-all

func (*NotificationHandlers) MarkAsRead

func (h *NotificationHandlers) MarkAsRead(c *gin.Context)

MarkAsRead handles PUT /api/v1/notifications/:id/read. Only the recipient can mark a notification read; anyone else's id is a 404.

func (*NotificationHandlers) UnreadCount

func (h *NotificationHandlers) UnreadCount(c *gin.Context)

UnreadCount handles GET /api/v1/notifications/unread/count

type OAuthErrorResponse

type OAuthErrorResponse struct {
	Error            string `json:"error"`
	ErrorDescription string `json:"error_description,omitempty"`
	ErrorURI         string `json:"error_uri,omitempty"`
}

OAuthErrorResponse defines the structure for OAuth 2.0 error responses.

type OAuthServerMetadata

type OAuthServerMetadata struct {
	Issuer                                string   `json:"issuer"`
	AuthorizationEndpoint                 string   `json:"authorization_endpoint"`
	TokenEndpoint                         string   `json:"token_endpoint"`
	RegistrationEndpoint                  string   `json:"registration_endpoint,omitempty"`
	ScopesSupported                       []string `json:"scopes_supported,omitempty"`
	ResponseTypesSupported                []string `json:"response_types_supported"`
	GrantTypesSupported                   []string `json:"grant_types_supported,omitempty"`
	TokenEndpointAuthMethodsSupported     []string `json:"token_endpoint_auth_methods_supported,omitempty"`
	CodeChallengeMethodsSupported         []string `json:"code_challenge_methods_supported,omitempty"`
	IntrospectionEndpoint                 string   `json:"introspection_endpoint,omitempty"`
	RevocationEndpoint                    string   `json:"revocation_endpoint,omitempty"`
	DeviceAuthorizationEndpoint           string   `json:"device_authorization_endpoint,omitempty"`
	PushedAuthorizationRequestEndpoint    string   `json:"pushed_authorization_request_endpoint,omitempty"`
	RequirePushedAuthorizationRequests    bool     `json:"require_pushed_authorization_requests,omitempty"`
	TlsClientCertificateBoundAccessTokens bool     `json:"tls_client_certificate_bound_access_tokens,omitempty"`
	RequestURIParameterSupported          bool     `json:"request_uri_parameter_supported,omitempty"`
	RequestParameterSupported             bool     `json:"request_parameter_supported,omitempty"`
	ServiceDocumentation                  string   `json:"service_documentation,omitempty"`
	UILocalesSupported                    []string `json:"ui_locales_supported,omitempty"`
	OpPolicyURI                           string   `json:"op_policy_uri,omitempty"`
	OpTosURI                              string   `json:"op_tos_uri,omitempty"`
	JwksURI                               string   `json:"jwks_uri,omitempty"`
}

OAuthServerMetadata defines the structure for the AS metadata response.

type ObjectMetadataInput

type ObjectMetadataInput struct {
	Values map[string]interface{} `json:"values"`
	Merge  bool                   `json:"merge"`
}

ObjectMetadataInput is the body for PUT /metadata/objects/:type/:id.

type OperationInput

type OperationInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Operation string `json:"operation"`
		} `json:"attributes"`
	} `json:"data"`
	// Operation is the bare-form alternative to the data envelope above.
	Operation string `json:"operation,omitempty"`
}

OperationInput represents the input for adding or removing operations from a tool. The bare form {"operation": "<operationId>"} is accepted as well. @Description Operation input model

type OperationsResponse

type OperationsResponse struct {
	Operations []string `json:"operations"`
}

OperationsResponse represents the response for tool operations @Description Tool operations response model

type PaginatedProxyLogs

type PaginatedProxyLogs struct {
	Data []ProxyLogResponse `json:"data"`
	Meta struct {
		TotalCount int64 `json:"total_count"`
		TotalPages int   `json:"total_pages"`
		PageSize   int   `json:"page_size"`
		PageNumber int   `json:"page_number"`
	} `json:"meta"`
}

PaginatedProxyLogs represents the paginated response for proxy logs @Description Proxy log list response model

type PermissionCatalogueResponse

type PermissionCatalogueResponse struct {
	Enabled   bool             `json:"enabled"`
	Groups    []string         `json:"groups"`
	Resources []authz.Resource `json:"resources"`
	Actions   []authz.Action   `json:"actions"`
	// Version changes whenever a plugin registers or removes permission
	// resources, so clients can tell a cached catalogue is stale.
	Version uint64 `json:"version"`
}

PermissionCatalogueResponse is the catalogue the role editor renders. @Description Permission catalogue

type PluginInput

type PluginInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name            string                 `json:"name"`
			Slug            string                 `json:"slug"`
			Description     string                 `json:"description"`
			Command         string                 `json:"command"`
			Checksum        string                 `json:"checksum,omitempty"`
			Config          map[string]interface{} `json:"config"`
			HookType        string                 `json:"hook_type"`
			IsActive        bool                   `json:"is_active"`
			Namespace       string                 `json:"namespace,omitempty"`
			PluginType      string                 `json:"plugin_type,omitempty"`
			OCIReference    string                 `json:"oci_reference,omitempty"`
			LoadImmediately bool                   `json:"load_immediately,omitempty"`
		} `json:"attributes"`
	} `json:"data"`
}

PluginInput represents the input for plugin-related operations @Description Plugin input model

type PluginListResponse

type PluginListResponse struct {
	Data []PluginResponse `json:"data"`
	Meta struct {
		TotalCount int64 `json:"total_count"`
		TotalPages int   `json:"total_pages"`
		PageSize   int   `json:"page_size"`
		PageNumber int   `json:"page_number"`
	} `json:"meta"`
	// UpdatesAvailable counts installed plugins (across all pages) with a newer marketplace version.
	UpdatesAvailable int64 `json:"updates_available"`
}

PluginListResponse represents a list of plugins

type PluginMarketplaceInfo

type PluginMarketplaceInfo struct {
	MarketplaceID    string `json:"marketplace_id"`
	InstalledVersion string `json:"installed_version"`
	AvailableVersion string `json:"available_version"`
	UpdateAvailable  bool   `json:"update_available"`
}

PluginMarketplaceInfo links an installed plugin back to the marketplace entry it came from. It is served on the plugin API (not only on the marketplace API) so anyone who can read plugins can see that an update exists.

type PluginResourceInput

type PluginResourceInput struct {
	PluginID         uint     `json:"plugin_id"`
	ResourceTypeSlug string   `json:"resource_type_slug"`
	InstanceIDs      []string `json:"instance_ids"`
}

PluginResourceInput represents plugin resources to associate with an app

type PluginResourceOutput

type PluginResourceOutput struct {
	PluginID         uint     `json:"plugin_id"`
	ResourceTypeSlug string   `json:"resource_type_slug"`
	ResourceTypeName string   `json:"resource_type_name"`
	InstanceIDs      []string `json:"instance_ids"`
}

PluginResourceOutput represents plugin resources in an app response

type PluginResponse

type PluginResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name         string                 `json:"name"`
		Description  string                 `json:"description"`
		Command      string                 `json:"command"`
		Checksum     string                 `json:"checksum,omitempty"`
		Config       map[string]interface{} `json:"config"`
		HookType     string                 `json:"hook_type"`
		IsActive     bool                   `json:"is_active"`
		Namespace    string                 `json:"namespace"`
		PluginType   string                 `json:"plugin_type"`   // "gateway" or "ai_studio"
		OCIReference string                 `json:"oci_reference"` // OCI artifact reference (for OCI plugins)
		Manifest     map[string]interface{} `json:"manifest"`      // Plugin manifest for UI extensions
		CreatedAt    string                 `json:"created_at"`
		UpdatedAt    string                 `json:"updated_at"`
	} `json:"attributes"`
	// PermissionKey is the RBAC resource that stands for this plugin
	// ("plugin:<manifest id>"); omitted for plugins with no admin surface.
	// Top level rather than inside Attributes so the many hand-written
	// Attributes literals in this package stay untouched.
	PermissionKey string `json:"permission_key,omitempty"`
	// Version and Marketplace are top level for the same reason.
	Version       string                 `json:"version,omitempty"`
	Marketplace   *PluginMarketplaceInfo `json:"marketplace,omitempty"`
	Relationships *struct {
		LLMs struct {
			Data []struct {
				Type       string `json:"type"`
				ID         string `json:"id"`
				Attributes struct {
					Name   string `json:"name"`
					Vendor string `json:"vendor"`
					Active bool   `json:"active"`
				} `json:"attributes"`
			} `json:"data"`
		} `json:"llms"`
	} `json:"relationships,omitempty"`
}

PluginResponse represents a plugin in API responses

type PluginUpgradePreviewRequest

type PluginUpgradePreviewRequest struct {
	Version string `json:"version"` // empty = latest upgrade candidate
}

PluginUpgradePreviewRequest selects the version to preview.

type PluginUpgradeResponse

type PluginUpgradeResponse struct {
	Data    PluginResponse                `json:"data"`
	Upgrade *services.PluginUpgradeResult `json:"upgrade"`
}

PluginUpgradeResponse is returned by a completed upgrade.

type PoolVendorInput

type PoolVendorInput struct {
	LLMID    uint                `json:"llm_id"`
	Weight   int                 `json:"weight"`
	Active   bool                `json:"active"`
	Mappings []ModelMappingInput `json:"mappings"`
}

PoolVendorInput represents a vendor in the input

type PreferencesResponse

type PreferencesResponse struct {
	// NotificationsEnabled is the in-app admin fan-out consent (new users,
	// app requests). It can only be on for administrators.
	NotificationsEnabled bool `json:"notifications_enabled"`
	// EmailNotificationsEnabled controls whether notifications are also
	// emailed; the bell receives them either way.
	EmailNotificationsEnabled bool `json:"email_notifications_enabled"`
}

PreferencesResponse is the body of GET/PATCH /common/me/preferences. @Description Notification preferences of the signed-in user

type PreferencesUpdateRequest

type PreferencesUpdateRequest struct {
	NotificationsEnabled      *bool `json:"notifications_enabled"`
	EmailNotificationsEnabled *bool `json:"email_notifications_enabled"`
}

PreferencesUpdateRequest is the body of PATCH /common/me/preferences; omitted fields are left unchanged. @Description Notification preferences to change

type ProfileInput

type ProfileInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			ProfileID                 string                 `json:"profile_id"`
			Name                      string                 `json:"name"`
			OrgID                     string                 `json:"org_id"`
			ActionType                string                 `json:"action_type"`
			MatchedPolicyID           string                 `json:"matched_policy_id"`
			Type                      string                 `json:"type"`
			ProviderName              string                 `json:"provider_name"`
			CustomEmailField          string                 `json:"custom_email_field"`
			CustomUserIDField         string                 `json:"custom_user_id_field"`
			ProviderConfig            map[string]interface{} `json:"provider_config"`
			IdentityHandlerConfig     map[string]interface{} `json:"identity_handler_config"`
			ProviderConstraintsDomain string                 `json:"provider_constraints_domain"`
			ProviderConstraintsGroup  string                 `json:"provider_constraints_group"`
			ReturnURL                 string                 `json:"return_url"`
			DefaultUserGroupID        string                 `json:"default_user_group_id"`
			CustomUserGroupField      string                 `json:"custom_user_group_field"`
			UserGroupMapping          map[string]string      `json:"user_group_mapping"`
			UserGroupSeparator        string                 `json:"user_group_separator"`
			SSOOnlyForRegisteredUsers bool                   `json:"sso_only_for_registered_users"`
			// Provisioning defaults for users this profile creates. Pointers so
			// that an omitted field means "show" rather than "hide".
			NewUserShowPortal *bool `json:"new_user_show_portal"`
			NewUserShowChat   *bool `json:"new_user_show_chat"`
		} `json:"attributes"`
	} `json:"data"`
}

ProfileInput represents the input for creating/updating an SSO profile @Description Profile input model

type ProfileListItem

type ProfileListItem struct {
	Type       string `json:"type"`
	ID         uint   `json:"id"`
	Attributes struct {
		Name           string    `json:"name"`
		ProfileID      string    `json:"profile_id"`
		ProfileType    string    `json:"profile_type"`
		ProviderType   string    `json:"provider_type"`
		UpdatedBy      string    `json:"updated_by"`
		UpdatedAt      time.Time `json:"updated_at"`
		UseInLoginPage bool      `json:"use_in_login_page"`
	} `json:"attributes"`
}

ProfileListItem represents a simplified profile item for list responses @Description Profile list item model

type ProfileResponse

type ProfileResponse struct {
	Type       string `json:"type"`
	ID         uint   `json:"id"`
	Attributes struct {
		ProfileID                 string                 `json:"profile_id"`
		Name                      string                 `json:"name"`
		OrgID                     string                 `json:"org_id"`
		ActionType                string                 `json:"action_type"`
		MatchedPolicyID           string                 `json:"matched_policy_id"`
		Type                      string                 `json:"type"`
		ProviderName              string                 `json:"provider_name"`
		CustomEmailField          string                 `json:"custom_email_field"`
		CustomUserIDField         string                 `json:"custom_user_id_field"`
		ProviderConfig            map[string]interface{} `json:"provider_config"`
		IdentityHandlerConfig     map[string]interface{} `json:"identity_handler_config"`
		ProviderConstraintsDomain string                 `json:"provider_constraints_domain"`
		ProviderConstraintsGroup  string                 `json:"provider_constraints_group"`
		ReturnURL                 string                 `json:"return_url"`
		DefaultUserGroupID        string                 `json:"default_user_group_id"`
		CustomUserGroupField      string                 `json:"custom_user_group_field"`
		UserGroupMapping          map[string]string      `json:"user_group_mapping"`
		UserGroupSeparator        string                 `json:"user_group_separator"`
		SSOOnlyForRegisteredUsers bool                   `json:"sso_only_for_registered_users"`
		NewUserShowPortal         bool                   `json:"new_user_show_portal"`
		NewUserShowChat           bool                   `json:"new_user_show_chat"`
		SelectedProviderType      string                 `json:"selected_provider_type"`
		LoginURL                  string                 `json:"login_url"`
		CallbackURL               string                 `json:"callback_url"`
		FailureRedirectURL        string                 `json:"failure_redirect_url"`
		UseInLoginPage            bool                   `json:"use_in_login_page"`
	} `json:"attributes"`
}

ProfileResponse represents the response for an SSO profile @Description Profile response model

type ProfilesResponse

type ProfilesResponse struct {
	Data []ProfileListItem `json:"data"`
	Meta struct {
		TotalCount int64 `json:"total_count"`
		TotalPages int   `json:"total_pages"`
		PageSize   int   `json:"page_size"`
		PageNumber int   `json:"page_number"`
	} `json:"meta"`
}

ProfilesResponse represents the paginated response for listing profiles @Description Profiles list response model

type PromptTemplateInput

type PromptTemplateInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name   string `json:"name"`
			Prompt string `json:"prompt"`
			ChatID uint   `json:"chat_id"`
		} `json:"attributes"`
	} `json:"data"`
}

PromptTemplateInput represents the input for prompt template-related operations @Description Prompt Template input model

type PromptTemplateResponse

type PromptTemplateResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name   string `json:"name"`
		Prompt string `json:"prompt"`
		ChatID uint   `json:"chat_id"`
	} `json:"attributes"`
}

PromptTemplateResponse represents the response for prompt template-related operations @Description Prompt Template response model

type ProxyLogResponse

type ProxyLogResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		AppID        uint      `json:"app_id"`
		UserID       uint      `json:"user_id"`
		TimeStamp    time.Time `json:"time_stamp"`
		Vendor       string    `json:"vendor"`
		RequestBody  string    `json:"request_body"`
		ResponseBody string    `json:"response_body"`
		ResponseCode int       `json:"response_code"`
	} `json:"attributes"`
}

ProxyLogResponse represents the response structure for a proxy log entry @Description Proxy log response model

type RegisterInput

type RegisterInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Email      string `json:"email"`
			Name       string `json:"name"`
			Password   string `json:"password"`
			WithPortal bool   `json:"with_portal"`
			WithChat   bool   `json:"with_chat"`
		} `json:"attributes"`
	} `json:"data"`
}

RegisterInput represents the input for registration operations @Description Register input model

type RegisterOAuthClientInput

type RegisterOAuthClientInput struct {
	ClientName              string   `json:"client_name" binding:"required"`
	RedirectURIs            []string `json:"redirect_uris" binding:"required,dive,url"`
	Scope                   string   `json:"scope"` // Optional
	GrantTypes              []string `json:"grant_types"`
	ResponseTypes           []string `json:"response_types"`
	TokenEndpointAuthMethod string   `json:"token_endpoint_auth_method"`
}

OAuth Client Registration

type RegisterOAuthClientOutput

type RegisterOAuthClientOutput struct {
	ClientID                string   `json:"client_id"`
	ClientSecret            string   `json:"client_secret,omitempty"` // Only shown once
	ClientName              string   `json:"client_name"`
	RedirectURIs            []string `json:"redirect_uris"`
	Scope                   string   `json:"scope"`
	GrantTypes              []string `json:"grant_types"`
	ResponseTypes           []string `json:"response_types"`
	TokenEndpointAuthMethod string   `json:"token_endpoint_auth_method"`
	ClientSecretExpiresAt   int      `json:"client_secret_expires_at"` // RFC7591: 0 means never expires
}

type RegisterResponse

type RegisterResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

RegisterResponse represents the response for successful registration @Description Register response model

type ResendVerificationInput

type ResendVerificationInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Email string `json:"email"`
		} `json:"attributes"`
	} `json:"data"`
}

ResendVerificationInput represents the input for resending verification email operations @Description Resend Verification input model

type ResendVerificationResponse

type ResendVerificationResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

ResendVerificationResponse represents the response for resending verification email @Description ResendVerification response model

type ResetPasswordInput

type ResetPasswordInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Token    string `json:"token"`
			Password string `json:"password"`
		} `json:"attributes"`
	} `json:"data"`
}

ResetPasswordInput represents the input for reset password operations @Description Reset Password input model

type ResetPasswordResponse

type ResetPasswordResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

ResetPasswordResponse represents the response for a successful password reset @Description ResetPassword response model

type RoleAttributes

type RoleAttributes struct {
	Name        string   `json:"name"`
	Slug        string   `json:"slug"`
	Description string   `json:"description"`
	IsSystem    bool     `json:"is_system"`
	Permissions []string `json:"permissions"`
	// OrphanedPermissions are held permissions whose resource is not in the
	// catalogue right now: grants on a plugin that is uninstalled or not
	// loaded. They stay on the role and take effect again when the plugin
	// returns; the role editor lists them separately.
	OrphanedPermissions []string  `json:"orphaned_permissions"`
	UsersCount          int64     `json:"users_count"`
	GroupsCount         int64     `json:"groups_count"`
	CreatedAt           time.Time `json:"created_at"`
	UpdatedAt           time.Time `json:"updated_at"`
}

RoleAttributes is the role payload. @Description Role attributes

type RoleBindingAttributes

type RoleBindingAttributes struct {
	SubjectType string            `json:"subject_type"`
	SubjectID   uint              `json:"subject_id"`
	RoleID      uint              `json:"role_id"`
	Role        *rbac.RoleSummary `json:"role,omitempty"`
	ScopeType   string            `json:"scope_type"`
	ScopeID     string            `json:"scope_id"`
	// Source is "host" for a binding the host application manages
	// (read-only here), empty otherwise.
	Source    string    `json:"source"`
	CreatedAt time.Time `json:"created_at"`
}

RoleBindingAttributes is the binding payload. @Description Role binding attributes

type RoleBindingInput

type RoleBindingInput struct {
	SubjectType string `json:"subject_type"`
	SubjectID   uint   `json:"subject_id"`
	RoleID      uint   `json:"role_id"`
}

RoleBindingInput assigns a role to a user or team. @Description Role binding input model

type RoleBindingResponse

type RoleBindingResponse struct {
	Type       string                `json:"type"`
	ID         string                `json:"id"`
	Attributes RoleBindingAttributes `json:"attributes"`
}

RoleBindingResponse wraps a binding. @Description Role binding response model

type RoleInput

type RoleInput struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Permissions []string `json:"permissions"`
}

RoleInput is the create/update payload for a role. @Description Role input model

type RoleResponse

type RoleResponse struct {
	Type       string         `json:"type"`
	ID         string         `json:"id"`
	Attributes RoleAttributes `json:"attributes"`
}

RoleResponse wraps a role in the JSON:API-style envelope used across the API. @Description Role response model

type RouterCatalogueRef

type RouterCatalogueRef struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

RouterCatalogueRef names a catalogue a router is published in.

type SecretInput

type SecretInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Value   string `json:"value"`
			VarName string `json:"var_name"`
		} `json:"attributes"`
	} `json:"data"`
}

SecretInput represents the input for secret-related operations @Description Secret input model

type SecretListResponse

type SecretListResponse struct {
	Data []SecretResponse `json:"data"`
	Meta struct {
		TotalCount int64 `json:"total_count"`
		TotalPages int   `json:"total_pages"`
		PageSize   int   `json:"page_size"`
		PageNumber int   `json:"page_number"`
	} `json:"meta"`
}

SecretListResponse represents the paginated response for listing secrets @Description Secret list response model

type SecretReferenceResponse

type SecretReferenceResponse struct {
	Type string `json:"type"`
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

SecretReferenceResponse is one object that references a secret @Description Secret reference model

type SecretResponse

type SecretResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Value   string `json:"value"`
		VarName string `json:"var_name"`
		// HasValue says whether the secret holds a non-empty value without
		// exposing it, so the list can flag a placeholder that was never
		// filled in.
		HasValue bool `json:"has_value"`
		// ReferencedBy lists the objects that read this secret through a
		// $SECRET/<name> reference. Always present, empty when nothing does.
		ReferencedBy []SecretReferenceResponse `json:"referenced_by"`
	} `json:"attributes"`
}

SecretResponse represents the response for secret-related operations @Description Secret response model

type SemanticRouterAttributes

type SemanticRouterAttributes struct {
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
	// Active is the live switch. Omitted = inactive on create, unchanged on
	// update. Setting it needs semantic-routers:publish.
	Active    *bool  `json:"active"`
	Namespace string `json:"namespace"`
	// Portal presentation (the router is published in LLM catalogues).
	ShortDescription string `json:"short_description"`
	LongDescription  string `json:"long_description"`
	LogoURL          string `json:"logo_url"`

	Settings sr.Settings `json:"settings"`
	Routes   []sr.Route  `json:"routes"`

	// EmbedderID is the embedder of the embedding stage (0 or omitted: none).
	// A settings.embedding naming an LLM ({llm_id, model}) is still accepted
	// and saved as the embedder linked to that LLM with that model.
	EmbedderID *uint `json:"embedder_id"`
}

SemanticRouterAttributes is a router as the API reads and writes it.

type SemanticRouterInput

type SemanticRouterInput struct {
	Data struct {
		Type       string                   `json:"type"`
		Attributes SemanticRouterAttributes `json:"attributes"`
	} `json:"data"`
}

SemanticRouterInput is the JSON:API body of a create or update.

type SemanticRouterTestInput

type SemanticRouterTestInput struct {
	Messages []SemanticRouterTestMessage `json:"messages" binding:"required"`
	Model    string                      `json:"model"`
	// Router is the draft to test (POST /semantic-routers/test only).
	Router *SemanticRouterAttributes `json:"router,omitempty"`
}

SemanticRouterTestInput is what the test panel classifies. Model is what follows the slug in the model string: "auto" (the default) or a route name when explicit routes are allowed.

type SemanticRouterTestMessage

type SemanticRouterTestMessage struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

SemanticRouterTestMessage is one message of a test conversation.

type SessionHub

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

SessionHub keeps live sessions in memory across HTTP requests.

A session is kept alive while any caller holds a reference (a v1 SSE connection, a v2 run, a tool/datasource/upload request) and for an idle TTL after the last reference is released; a reaper then stops it. "Stop" is the only way a session leaves the hub apart from Remove, so a session is never stopped while someone is using it, and the same id never maps to two live session objects (which the previous ChatHub allowed on reconnect).

func NewSessionHub

func NewSessionHub(ttl time.Duration) *SessionHub

NewSessionHub creates a hub whose idle sessions are stopped after ttl.

func (*SessionHub) Acquire

func (h *SessionHub) Acquire(id string, load func() (HubSession, error)) (HubSession, func(), error)

Acquire returns the live session for id, loading it with load when the hub has none. Concurrent callers for the same id share one load. The returned release must be called exactly once when the caller no longer needs the session; the hub keeps it alive until then and for ttl afterwards.

func (*SessionHub) Add

func (h *SessionHub) Add(s HubSession) (HubSession, func())

Add registers an already started session and takes one reference on it. If a session with the same id is already present the existing one wins and the given session is stopped.

func (*SessionHub) Get

func (h *SessionHub) Get(id string) (HubSession, bool)

Get returns the live session for id without taking a reference. Use it only for read-only peeks; anything that outlives the current statement should Acquire.

func (*SessionHub) Len

func (h *SessionHub) Len() int

Len reports the number of live sessions.

func (*SessionHub) Reap

func (h *SessionHub) Reap() int

Reap stops and removes sessions that have had no references for longer than the TTL. It returns how many were stopped.

func (*SessionHub) Refs

func (h *SessionHub) Refs(id string) int

Refs reports the reference count of a session (0 when absent). Test helper.

func (*SessionHub) Remove

func (h *SessionHub) Remove(id string)

Remove stops a session and drops it from the hub regardless of references. Use it for explicit session termination only.

func (*SessionHub) StartReaper

func (h *SessionHub) StartReaper(interval time.Duration)

StartReaper runs Reap periodically for the life of the process. Safe to call more than once.

type SimplifiedDataSourceResponse

type SimplifiedDataSourceResponse struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

SimplifiedDataSourceResponse represents a redacted version of datasource information

type SimplifiedToolResponse

type SimplifiedToolResponse struct {
	ID   uint   `json:"id"`
	Name string `json:"name"`
}

SimplifiedToolResponse represents a redacted version of tool information

type SubmissionInput

type SubmissionInput struct {
	Data struct {
		Attributes struct {
			ResourceType         string         `json:"resource_type"`
			PluginResourceTypeID *uint          `json:"plugin_resource_type_id"` // required when resource_type == "plugin"
			Status               string         `json:"status"`                  // draft or submitted
			ResourcePayload      models.JSONMap `json:"resource_payload"`
			Attestations         models.JSONMap `json:"attestations"`
			SuggestedPrivacy     int            `json:"suggested_privacy"`
			PrivacyJustification string         `json:"privacy_justification"`
			PrimaryContact       string         `json:"primary_contact"`
			SecondaryContact     string         `json:"secondary_contact"`
			SLAExpectation       string         `json:"sla_expectation"`
			DataCutoffDate       *string        `json:"data_cutoff_date"` // ISO 8601 string
			DocumentationURL     string         `json:"documentation_url"`
			Notes                string         `json:"notes"`
		} `json:"attributes"`
	} `json:"data"`
}

type SubmitConsentInput

type SubmitConsentInput struct {
	AuthRequestID string `json:"auth_req_id" form:"auth_req_id" binding:"required"`
	Decision      string `json:"decision" form:"decision" binding:"required"`
	SelectedAppID uint   `json:"selected_app_id" form:"selected_app_id"`
}

type SuccessResponse

type SuccessResponse struct {
	Message string `json:"message"`
}

Add this struct if you haven't already defined it

type SyncStatusHandlers

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

SyncStatusHandlers handles sync status API endpoints

func NewSyncStatusHandlers

func NewSyncStatusHandlers(syncStatusService *services.SyncStatusService) *SyncStatusHandlers

NewSyncStatusHandlers creates a new SyncStatusHandlers

func (*SyncStatusHandlers) GetNamespaceSyncStatus

func (h *SyncStatusHandlers) GetNamespaceSyncStatus(c *gin.Context)

GetNamespaceSyncStatus handles GET /api/v1/sync/status/:namespace @Summary Get sync status for namespace @Description Get detailed synchronization status for a specific namespace @Tags sync @Param namespace path string true "Namespace" @Produce json @Success 200 {object} map[string]interface{} @Router /api/v1/sync/status/{namespace} [get] @Security BearerAuth

func (*SyncStatusHandlers) GetPendingChanges

func (h *SyncStatusHandlers) GetPendingChanges(c *gin.Context)

GetPendingChanges handles GET /api/v1/sync/pending-changes?namespace=default @Summary Preview what a push would change @Description List the gateway-visible objects created, updated or deleted in a namespace since its last configuration push. Use "global" (or omit) for the global namespace. @Tags sync @Param namespace query string false "Namespace (default: global)" @Produce json @Success 200 {object} map[string]services.PendingChanges @Router /api/v1/sync/pending-changes [get] @Security BearerAuth

func (*SyncStatusHandlers) GetSyncAuditLog

func (h *SyncStatusHandlers) GetSyncAuditLog(c *gin.Context)

GetSyncAuditLog handles GET /api/v1/sync/audit @Summary Get sync audit log @Description Get sync audit log entries with filtering @Tags sync @Param namespace query string false "Filter by namespace" @Param edge_id query string false "Filter by edge ID" @Param event_type query string false "Filter by event type" @Param limit query int false "Limit results" default(50) @Produce json @Success 200 {object} map[string]interface{} @Router /api/v1/sync/audit [get] @Security BearerAuth

func (*SyncStatusHandlers) GetSyncStatus

func (h *SyncStatusHandlers) GetSyncStatus(c *gin.Context)

GetSyncStatus handles GET /api/v1/sync/status @Summary Get sync status summary @Description Get synchronization status for all namespaces @Tags sync @Produce json @Success 200 {object} map[string]interface{} @Router /api/v1/sync/status [get] @Security BearerAuth

type TagInput

type TagInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name string `json:"name"`
		} `json:"attributes"`
	} `json:"data"`
}

TagInput represents the input for tag-related operations @Description Tag input model

type TagResponse

type TagResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name string `json:"name"`
	} `json:"attributes"`
}

TagResponse represents the response for tag-related operations @Description Tag response model

type TeamBudgetSettingsBody

type TeamBudgetSettingsBody struct {
	Enabled bool `json:"enabled"`
}

TeamBudgetSettingsBody is the global team budget switch.

type ToolCatalogueInput

type ToolCatalogueInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name             string `json:"name"`
			ShortDescription string `json:"short_description"`
			LongDescription  string `json:"long_description"`
			Icon             string `json:"icon"`
		} `json:"attributes"`
	} `json:"data"`
}

ToolCatalogueInput represents the input for tool catalogue-related operations @Description Tool Catalogue input model

type ToolCatalogueResponse

type ToolCatalogueResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Name             string         `json:"name"`
		ShortDescription string         `json:"short_description"`
		LongDescription  string         `json:"long_description"`
		Icon             string         `json:"icon"`
		Tools            []ToolResponse `json:"tools"`
		Tags             []TagResponse  `json:"tags"`
	} `json:"attributes"`
}

ToolCatalogueResponse represents the response for tool catalogue-related operations @Description Tool Catalogue response model

type ToolCatalogueTagInput

type ToolCatalogueTagInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

ToolCatalogueTagInput represents the input for adding a tag to a tool catalogue @Description Tool Catalogue-Tag relationship input model

type ToolCatalogueToolInput

type ToolCatalogueToolInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

ToolCatalogueToolInput represents the input for adding a tool to a tool catalogue @Description Tool Catalogue-Tool relationship input model

type ToolGatewayAccess

type ToolGatewayAccess struct {
	// Slug is the path segment the gateway serves the tool under. It is
	// computed server-side (with transliteration), so clients must not derive
	// it from the name.
	Slug string `json:"slug"`
	// Access methods. Chat is always available and is not listed.
	// AppGrantable is false for a chat-only tool, which cannot be bound to an
	// App.
	RESTAccessEnabled bool `json:"rest_access_enabled"`
	MCPAccessEnabled  bool `json:"mcp_access_enabled"`
	AppGrantable      bool `json:"app_grantable"`
	// Gateway URLs of the two access methods, built from TOOL_DISPLAY_URL (or
	// PROXY_URL) and the slug. Empty for client tools and when no base URL is
	// configured. They say where a method is served, not whether it is on.
	RESTEndpointURL string `json:"rest_endpoint_url"`
	MCPEndpointURL  string `json:"mcp_endpoint_url"`
}

ToolGatewayAccess describes how an App may reach a tool on the gateway. It is embedded, so its fields appear directly among the tool's attributes.

type ToolImportConnection

type ToolImportConnection struct {
	ID             uint   `json:"id"`
	Name           string `json:"name"`
	DashboardURL   string `json:"dashboard_url"`
	Status         string `json:"status"`
	Degraded       bool   `json:"degraded"`
	DegradedReason string `json:"degraded_reason,omitempty"`
	EffectiveMode  string `json:"effective_mode"`
	// APIsRead is the probed state of the apis_read capability
	// (ok | denied | unverified | no), empty when never probed.
	APIsRead string `json:"apis_read"`
}

ToolImportConnection is what the Tools import wizard needs to know about a connection: enough to pick one and to explain why it may not work.

type ToolInput

type ToolInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Name        string `json:"name"`
			Description string `json:"description"`
			ToolType    string `json:"tool_type"`
			// OASSpec must be the base64 encoding of the UTF-8 OpenAPI
			// document. Raw JSON or YAML is rejected with a 400.
			OASSpec        string   `json:"oas_spec"`
			PrivacyScore   int      `json:"privacy_score"`
			AuthKey        string   `json:"auth_key"`
			AuthSchemaName string   `json:"auth_schema_name"`
			Operations     []string `json:"operations"`
			Namespace      string   `json:"namespace"`
			// Active is the live switch. Omitted = unchanged on update, live on
			// create (unless the caller lacks tools:publish, in which case the
			// tool is created inactive). Setting it needs tools:publish.
			Active *bool `json:"active,omitempty"`
			// Access methods. Omitted = unchanged on update; on create a new
			// tool is chat only (both off). Not accepted on client tools.
			RESTAccessEnabled *bool `json:"rest_access_enabled,omitempty"`
			MCPAccessEnabled  *bool `json:"mcp_access_enabled,omitempty"`
			// Governed metadata (Enterprise). nil = untouched; {} = clear.
			GovernedMetadata *map[string]interface{} `json:"governed_metadata,omitempty"`
		} `json:"attributes"`
	} `json:"data"`
}

ToolInput represents the input for tool-related operations @Description Tool input model

type ToolResponse

type ToolResponse struct {
	Type string `json:"type"`
	ID   string `json:"id"`
	// Governed metadata (Enterprise); see LLMResponse.
	GovernedMetadata       interface{}            `json:"governed_metadata,omitempty"`
	GovernedMetadataStatus string                 `json:"governed_metadata_status,omitempty"`
	Attributes             ToolResponseAttributes `json:"attributes"`
}

ToolResponse represents the response for tool-related operations @Description Tool response model

type ToolResponseAttributes

type ToolResponseAttributes struct {
	Name           string              `json:"name"`
	Description    string              `json:"description"`
	ToolType       string              `json:"tool_type"`
	OASSpec        string              `json:"oas_spec"`
	PrivacyScore   int                 `json:"privacy_score"`
	Operations     []string            `json:"operations"`
	AuthKey        string              `json:"auth_key"`
	HasAuthKey     bool                `json:"has_auth_key"`
	AuthSchemaName string              `json:"auth_schema_name"`
	Active         bool                `json:"active"`
	Namespace      string              `json:"namespace"`
	FileStores     []FileStoreResponse `json:"file_stores"`
	Filters        []FilterResponse    `json:"filters"`
	Dependencies   []ToolResponse      `json:"dependencies"`

	// Flattened into the attributes; see toolGatewayAccess.
	ToolGatewayAccess
}

ToolResponseAttributes is the attribute block of a ToolResponse.

type UpdateBrandingSettingsRequest

type UpdateBrandingSettingsRequest struct {
	AppTitle        *string `json:"app_title"`
	PrimaryColor    *string `json:"primary_color"`
	SecondaryColor  *string `json:"secondary_color"`
	BackgroundColor *string `json:"background_color"`
	CustomCSS       *string `json:"custom_css"`
}

type UpdateSubmissionInput

type UpdateSubmissionInput struct {
	Data struct {
		Attributes struct {
			ResourceType         string         `json:"resource_type"`
			TargetResourceID     uint           `json:"target_resource_id"`
			Status               string         `json:"status"`
			ResourcePayload      models.JSONMap `json:"resource_payload"`
			Attestations         models.JSONMap `json:"attestations"`
			SuggestedPrivacy     int            `json:"suggested_privacy"`
			PrivacyJustification string         `json:"privacy_justification"`
			PrimaryContact       string         `json:"primary_contact"`
			SecondaryContact     string         `json:"secondary_contact"`
			SLAExpectation       string         `json:"sla_expectation"`
			DataCutoffDate       *string        `json:"data_cutoff_date"`
			DocumentationURL     string         `json:"documentation_url"`
			Notes                string         `json:"notes"`
		} `json:"attributes"`
	} `json:"data"`
}

type UserAccessibleCataloguesResponse

type UserAccessibleCataloguesResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Catalogues []CatalogueResponse `json:"catalogues"`
	} `json:"attributes"`
}

UserAccessibleCataloguesResponse represents the response for user-accessible catalogues @Description User accessible catalogues response model

type UserAttributes

type UserAttributes struct {
	Email                string             `json:"email"`
	Name                 string             `json:"name"`
	IsAdmin              bool               `json:"is_admin"`
	ShowChat             bool               `json:"show_chat"`
	ShowPortal           bool               `json:"show_portal"`
	EmailVerified        bool               `json:"email_verified"`
	APIKey               string             `json:"api_key,omitempty"`
	APIKeyHint           string             `json:"api_key_hint,omitempty"`
	HasAPIKey            bool               `json:"has_api_key"`
	NotificationsEnabled bool               `json:"notifications_enabled"`
	AccessToSSOConfig    bool               `json:"access_to_sso_config"`
	Role                 string             `json:"role"`
	Groups               []GroupResponse    `json:"groups,omitempty"`
	Roles                []rbac.RoleSummary `json:"roles,omitempty"`

	// Provenance and activity. auth_source is local | admin | sso | host;
	// sso_profile_id names the identity provider profile that provisioned
	// (or last signed in) the user.
	AuthSource       string     `json:"auth_source"`
	SSOProfileID     string     `json:"sso_profile_id,omitempty"`
	LastLoginAt      *time.Time `json:"last_login_at,omitempty"`
	LastLoginMethod  string     `json:"last_login_method,omitempty"`
	APIKeyLastUsedAt *time.Time `json:"api_key_last_used_at,omitempty"`

	// Account switch. A disabled user cannot authenticate by any means.
	Disabled   bool       `json:"disabled"`
	DisabledAt *time.Time `json:"disabled_at,omitempty"`

	// BudgetTeamID is the team the user's new Apps and chat spend are
	// attributed to (Enterprise team budgets); null = resolved automatically.
	BudgetTeamID *uint `json:"budget_team_id"`
}

UserAttributes is the user payload. api_key is only present when the caller may see it (their own key, or they hold users:write); otherwise api_key_hint carries the last four characters. @Description User attributes

type UserBudgetTeamBody

type UserBudgetTeamBody struct {
	TeamID *uint `json:"team_id"`
}

UserBudgetTeamBody sets the team a user's new Apps are attributed to.

type UserGroupInput

type UserGroupInput struct {
	Data struct {
		Type string `json:"type"`
		ID   string `json:"id"`
	} `json:"data"`
}

UserGroupInput represents the input for adding a user to a group @Description User-group relationship input model

type UserInput

type UserInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Email                string `json:"email"`
			Name                 string `json:"name"`
			Password             string `json:"password,omitempty"`
			IsAdmin              *bool  `json:"is_admin"` // omitted means unchanged; roles are the source of truth in Enterprise
			ShowChat             bool   `json:"show_chat"`
			ShowPortal           bool   `json:"show_portal"`
			EmailVerified        bool   `json:"email_verified"`
			NotificationsEnabled bool   `json:"notifications_enabled"`
			AccessToSSOConfig    bool   `json:"access_to_sso_config"`
			Groups               []uint `json:"groups"`
		} `json:"attributes"`
	} `json:"data"`
}

UserInput represents the input for user-related operations @Description User input model

type UserResponse

type UserResponse struct {
	Type       string         `json:"type"`
	ID         string         `json:"id"`
	Attributes UserAttributes `json:"attributes"`
}

UserResponse represents the response for user-related operations @Description User response model

type UserWithEntitlementsResponse

type UserWithEntitlementsResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Email        string `json:"email"`
		Name         string `json:"name"`
		IsAdmin      bool   `json:"is_admin"`
		IsSuperAdmin bool   `json:"is_super_admin"`
		// HasAdminAccess is true when the user holds at least one permission
		// and may therefore open the administration surface.
		HasAdminAccess bool `json:"has_admin_access"`
		// Permissions is the effective permission set; ["*"] for full admins.
		Permissions []string `json:"permissions"`
		// Roles lists the roles behind the permissions (Enterprise only).
		Roles []rbac.RoleSummary `json:"roles"`
		// RBACEnabled reports whether fine-grained roles are active.
		RBACEnabled bool `json:"rbac_enabled"`

		// Profile fields for the signed-in user's own menu. AccountType is
		// the legacy role label the users list shows as "role"; the key
		// itself is never included here (see POST /common/me/api-key/roll).
		AccountType               string     `json:"account_type"`
		AuthSource                string     `json:"auth_source"`
		HasAPIKey                 bool       `json:"has_api_key"`
		APIKeyLastUsedAt          *time.Time `json:"api_key_last_used_at"`
		NotificationsEnabled      bool       `json:"notifications_enabled"`
		EmailNotificationsEnabled bool       `json:"email_notifications_enabled"`
		// SSOAPIKeysAllowed is whether this user may hold an API key under
		// the ALLOW_SSO_USER_API_KEYS policy (always true for non-SSO users).
		SSOAPIKeysAllowed bool `json:"sso_api_keys_allowed"`

		UIOptions struct {
			ShowChat       bool `json:"show_chat"`
			ShowPortal     bool `json:"show_portal"`
			ShowSSOConfig  bool `json:"show_sso_config"`
			SkipQuickStart bool `json:"skip_quick_start"`
		} `json:"ui_options"`
		Entitlements struct {
			Catalogues     []CatalogueResponse     `json:"catalogues"`
			DataCatalogues []DataCatalogueResponse `json:"data_catalogues"`
			ToolCatalogues []ToolCatalogueResponse `json:"tool_catalogues"`
			Chats          []ChatResponse          `json:"chats"`
		} `json:"entitlements"`
	} `json:"attributes"`
}

UserWithEntitlementsResponse represents the response for the current user with entitlements @Description User with entitlements response model

type V2ChatSummary

type V2ChatSummary struct {
	ID              uint                    `json:"id"`
	Name            string                  `json:"name"`
	Description     string                  `json:"description"`
	ToolSupport     bool                    `json:"tool_support"`
	PromptTemplates []models.PromptTemplate `json:"prompt_templates"`
}

type V2ClientToolInfo

type V2ClientToolInfo struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Schema      json.RawMessage `json:"schema"`
	UI          json.RawMessage `json:"ui,omitempty"`
}

V2ClientToolInfo describes a tool the browser executes (human-in-the-loop).

type V2Message

type V2Message struct {
	ID        string    `json:"id"`
	Role      string    `json:"role"` // "user" | "assistant"
	Parts     []V2Part  `json:"parts"`
	CreatedAt time.Time `json:"created_at"`
}

V2Message is one thread message as the v2 chat API exposes it: the shape assistant-ui's ThreadMessageLike expects, built server-side from the stored llms.MessageContent rows so no client has to re-derive tool calls from text.

type V2Part

type V2Part struct {
	Type string `json:"type"`

	// text
	Text string `json:"text,omitempty"`

	// tool-call
	ToolCallID string          `json:"toolCallId,omitempty"`
	ToolName   string          `json:"toolName,omitempty"`
	ArgsText   string          `json:"argsText,omitempty"`
	Args       json.RawMessage `json:"args,omitempty"`
	Result     json.RawMessage `json:"result,omitempty"`
	IsError    bool            `json:"isError,omitempty"`

	// data
	Name string          `json:"name,omitempty"`
	Data json.RawMessage `json:"data,omitempty"`
}

V2Part is a message content part. Type is one of "text", "tool-call" or "data"; only the fields relevant to the type are set.

type V2RunRequest

type V2RunRequest struct {
	Message        string         `json:"message"`
	FileRefs       []string       `json:"file_refs"`
	Regenerate     bool           `json:"regenerate"`
	AfterMessageID *string        `json:"after_message_id"`
	ToolResults    []V2ToolResult `json:"tool_results"`
}

V2RunRequest is the body of POST /chat-sessions/:session_id/runs.

Exactly one of these shapes is expected:

  • {message, file_refs?}: append a user turn and run.
  • {message, after_message_id}: an edit; rewind the history to just after the given message id ("" or "root" = the start) first.
  • {regenerate: true, after_message_id?}: re-run the model on the history rewound to after the given id (default: after the last user turn).
  • {tool_results}: resume a turn waiting on client-side tools.

type V2SessionResponse

type V2SessionResponse struct {
	SessionID   string             `json:"session_id"`
	Tools       []V2ToolSummary    `json:"tools"`
	Datasources []V2SourceSummary  `json:"datasources"`
	ClientTools []V2ClientToolInfo `json:"client_tools"`
	// PendingToolCallIDs lists client tool calls still waiting for an answer
	// when a session is resumed, so the UI can offer them again.
	PendingToolCallIDs []string      `json:"pending_tool_call_ids,omitempty"`
	Chat               V2ChatSummary `json:"chat"`
}

V2SessionResponse is returned by POST /chat/:chat_id/sessions.

type V2SourceSummary

type V2SourceSummary struct {
	ID               uint   `json:"id"`
	Name             string `json:"name"`
	ShortDescription string `json:"short_description"`
}

type V2ToolResult

type V2ToolResult struct {
	ToolCallID string          `json:"tool_call_id"`
	Result     json.RawMessage `json:"result"`
	IsError    bool            `json:"is_error"`
}

type V2ToolSummary

type V2ToolSummary struct {
	ID          uint   `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	ToolType    string `json:"tool_type"`
}

type ValidateAndLoadResponse

type ValidateAndLoadResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Command      string                 `json:"command"`
		HookTypes    []string               `json:"hook_types"`
		PrimaryHook  string                 `json:"primary_hook"`
		ConfigSchema map[string]interface{} `json:"config_schema,omitempty"`
		Manifest     map[string]interface{} `json:"manifest,omitempty"`
		Scopes       []string               `json:"scopes"`
		Status       string                 `json:"status"`
		LoadedAt     string                 `json:"loaded_at"`
	} `json:"attributes"`
}

type ValidateMetadataInput

type ValidateMetadataInput struct {
	ObjectType string                 `json:"object_type"`
	Values     map[string]interface{} `json:"values"`
}

ValidateMetadataInput is the body for POST /metadata/validate.

type VendorListResponse

type VendorListResponse struct {
	Data []string `json:"data"`
}

VendorListResponse represents the response for vendor list operations @Description Vendor list response model

type VerifyEmailInput

type VerifyEmailInput struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Token string `json:"token"`
		} `json:"attributes"`
	} `json:"data"`
}

VerifyEmailInput represents the input for email verification operations @Description Verify Email input model

type VerifyEmailResponse

type VerifyEmailResponse struct {
	Data struct {
		Type       string `json:"type"`
		Attributes struct {
			Message string `json:"message"`
		} `json:"attributes"`
	} `json:"data"`
}

VerifyEmailResponse represents the response for successful email verification @Description VerifyEmail response model

type WorkflowStatusResponse

type WorkflowStatusResponse struct {
	Type       string `json:"type"`
	ID         string `json:"id"`
	Attributes struct {
		Status                  string   `json:"status"`
		ServiceScopes           []string `json:"service_scopes"`
		ServiceAccessAuthorized bool     `json:"service_access_authorized"`
		RequiresApproval        bool     `json:"requires_approval"`
		LastManifestLoadedAt    string   `json:"last_manifest_loaded_at,omitempty"`
	} `json:"attributes"`
}

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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