Documentation
¶
Overview ¶
Package management provides the management API handlers and middleware for configuring the server and managing auth files.
Index ¶
- func CompleteOAuthSession(state string)
- func CompleteOAuthSessionsByProvider(provider string) int
- func GetOAuthSession(state string) (provider string, status string, ok bool)
- func IsOAuthSessionPending(state, provider string) bool
- func NormalizeOAuthProvider(provider string) (string, error)
- func RegisterOAuthSession(state, provider string)
- func SetOAuthSessionError(state, message string)
- func ValidateOAuthState(state string) error
- func WriteConfig(path string, data []byte) error
- func WriteOAuthCallbackFile(authDir, provider, state, code, errorMessage string) (string, error)
- func WriteOAuthCallbackFileForPendingSession(authDir, provider, state, code, errorMessage string) (string, error)
- type CacheMetricsResponse
- type DashboardResponse
- type DiscoverModelsRequest
- type FeedbackHandler
- type FeedbackRequest
- type FeedbackStatsResponse
- type Handler
- func (h *Handler) DeleteAPIKeys(c *gin.Context)
- func (h *Handler) DeleteAmpModelMappings(c *gin.Context)
- func (h *Handler) DeleteAmpUpstreamAPIKey(c *gin.Context)
- func (h *Handler) DeleteAmpUpstreamURL(c *gin.Context)
- func (h *Handler) DeleteAuthFile(c *gin.Context)
- func (h *Handler) DeleteClaudeKey(c *gin.Context)
- func (h *Handler) DeleteCodexKey(c *gin.Context)
- func (h *Handler) DeleteGeminiKey(c *gin.Context)
- func (h *Handler) DeleteLogs(c *gin.Context)
- func (h *Handler) DeleteOAuthExcludedModels(c *gin.Context)
- func (h *Handler) DeleteOpenAICompat(c *gin.Context)
- func (h *Handler) DeleteProxyURL(c *gin.Context)
- func (h *Handler) DeleteSwitchAIKey(c *gin.Context)
- func (h *Handler) DiscoverModels(c *gin.Context)
- func (h *Handler) DownloadAuthFile(c *gin.Context)
- func (h *Handler) DownloadRequestErrorLog(c *gin.Context)
- func (h *Handler) GetAPIKeys(c *gin.Context)
- func (h *Handler) GetAmpCode(c *gin.Context)
- func (h *Handler) GetAmpForceModelMappings(c *gin.Context)
- func (h *Handler) GetAmpModelMappings(c *gin.Context)
- func (h *Handler) GetAmpRestrictManagementToLocalhost(c *gin.Context)
- func (h *Handler) GetAmpUpstreamAPIKey(c *gin.Context)
- func (h *Handler) GetAmpUpstreamURL(c *gin.Context)
- func (h *Handler) GetAnalytics(c *gin.Context)
- func (h *Handler) GetAuthFileModels(c *gin.Context)
- func (h *Handler) GetAuthStatus(c *gin.Context)
- func (h *Handler) GetAutoRouteJournal(c *gin.Context)
- func (h *Handler) GetAutoRouteStatus(c *gin.Context)
- func (h *Handler) GetClaudeKeys(c *gin.Context)
- func (h *Handler) GetCodexKeys(c *gin.Context)
- func (h *Handler) GetConfig(c *gin.Context)
- func (h *Handler) GetConfigYAML(c *gin.Context)
- func (h *Handler) GetDebug(c *gin.Context)
- func (h *Handler) GetGeminiKeys(c *gin.Context)
- func (h *Handler) GetHeartbeatStatus(c *gin.Context)
- func (h *Handler) GetHooksStatus(c *gin.Context)
- func (h *Handler) GetLatestVersion(c *gin.Context)
- func (h *Handler) GetLoggingToFile(c *gin.Context)
- func (h *Handler) GetLogs(c *gin.Context)
- func (h *Handler) GetMaxRetryInterval(c *gin.Context)
- func (h *Handler) GetMemoryStats(c *gin.Context)
- func (h *Handler) GetOAuthExcludedModels(c *gin.Context)
- func (h *Handler) GetOpenAICompat(c *gin.Context)
- func (h *Handler) GetProxyURL(c *gin.Context)
- func (h *Handler) GetRequestErrorLogs(c *gin.Context)
- func (h *Handler) GetRequestLog(c *gin.Context)
- func (h *Handler) GetRequestLogByID(c *gin.Context)
- func (h *Handler) GetRequestRetry(c *gin.Context)
- func (h *Handler) GetSetupStatus(c *gin.Context)
- func (h *Handler) GetSteeringRules(c *gin.Context)
- func (h *Handler) GetSuperbrainMetrics(c *gin.Context)
- func (h *Handler) GetSwitchAIKeys(c *gin.Context)
- func (h *Handler) GetSwitchPreviewModel(c *gin.Context)
- func (h *Handler) GetSwitchProject(c *gin.Context)
- func (h *Handler) GetUsageStatistics(c *gin.Context)
- func (h *Handler) GetUsageStatisticsEnabled(c *gin.Context)
- func (h *Handler) GetWebsocketAuth(c *gin.Context)
- func (h *Handler) HandleCacheClear(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleCacheMetrics(w http.ResponseWriter, r *http.Request)
- func (h *Handler) HandleDashboard(c *gin.Context)
- func (h *Handler) ImportVertexCredential(c *gin.Context)
- func (h *Handler) InitializeSecret(c *gin.Context)
- func (h *Handler) ListAuthFiles(c *gin.Context)
- func (h *Handler) Middleware() gin.HandlerFunc
- func (h *Handler) PatchAPIKeys(c *gin.Context)
- func (h *Handler) PatchAmpModelMappings(c *gin.Context)
- func (h *Handler) PatchClaudeKey(c *gin.Context)
- func (h *Handler) PatchCodexKey(c *gin.Context)
- func (h *Handler) PatchGeminiKey(c *gin.Context)
- func (h *Handler) PatchOAuthExcludedModels(c *gin.Context)
- func (h *Handler) PatchOpenAICompat(c *gin.Context)
- func (h *Handler) PatchSwitchAIKey(c *gin.Context)
- func (h *Handler) PostOAuthCallback(c *gin.Context)
- func (h *Handler) PutAPIKeys(c *gin.Context)
- func (h *Handler) PutAmpForceModelMappings(c *gin.Context)
- func (h *Handler) PutAmpModelMappings(c *gin.Context)
- func (h *Handler) PutAmpRestrictManagementToLocalhost(c *gin.Context)
- func (h *Handler) PutAmpUpstreamAPIKey(c *gin.Context)
- func (h *Handler) PutAmpUpstreamURL(c *gin.Context)
- func (h *Handler) PutClaudeKeys(c *gin.Context)
- func (h *Handler) PutCodexKeys(c *gin.Context)
- func (h *Handler) PutConfigYAML(c *gin.Context)
- func (h *Handler) PutDebug(c *gin.Context)
- func (h *Handler) PutGeminiKeys(c *gin.Context)
- func (h *Handler) PutLoggingToFile(c *gin.Context)
- func (h *Handler) PutMaxRetryInterval(c *gin.Context)
- func (h *Handler) PutOAuthExcludedModels(c *gin.Context)
- func (h *Handler) PutOpenAICompat(c *gin.Context)
- func (h *Handler) PutProxyURL(c *gin.Context)
- func (h *Handler) PutRequestLog(c *gin.Context)
- func (h *Handler) PutRequestRetry(c *gin.Context)
- func (h *Handler) PutSwitchAIKeys(c *gin.Context)
- func (h *Handler) PutSwitchPreviewModel(c *gin.Context)
- func (h *Handler) PutSwitchProject(c *gin.Context)
- func (h *Handler) PutUsageStatisticsEnabled(c *gin.Context)
- func (h *Handler) PutWebsocketAuth(c *gin.Context)
- func (h *Handler) ReloadHooks(c *gin.Context)
- func (h *Handler) ReloadSteering(c *gin.Context)
- func (h *Handler) RequestAnthropicToken(c *gin.Context)
- func (h *Handler) RequestAntigravityToken(c *gin.Context)
- func (h *Handler) RequestCodexToken(c *gin.Context)
- func (h *Handler) RequestGeminiCLIToken(c *gin.Context)
- func (h *Handler) RequestIFlowCookieToken(c *gin.Context)
- func (h *Handler) RequestIFlowToken(c *gin.Context)
- func (h *Handler) RequestQwenToken(c *gin.Context)
- func (h *Handler) ResetSecret(c *gin.Context)
- func (h *Handler) SetAuthManager(manager *coreauth.Manager)
- func (h *Handler) SetAutoResolver(ar *autoroute.AutoResolver)
- func (h *Handler) SetConfig(cfg *config.Config)
- func (h *Handler) SetIntelligenceService(svc IntelligenceService)
- func (h *Handler) SetLocalPassword(password string)
- func (h *Handler) SetLogDirectory(dir string)
- func (h *Handler) SetServiceCoordinator(coordinator ServiceCoordinatorInterface)
- func (h *Handler) SetUsageStatistics(stats *usage.RequestStatistics)
- func (h *Handler) SkipSecret(c *gin.Context)
- func (h *Handler) TestProvider(c *gin.Context)
- func (h *Handler) UploadAuthFile(c *gin.Context)
- type IntelligenceService
- type ModelInfo
- type ServerStats
- type ServiceCoordinatorInterface
- type SkillMetadata
- type SkillsHandler
- type SkillsResponse
- type SystemStats
- type TestProviderRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteOAuthSession ¶
func CompleteOAuthSession(state string)
func IsOAuthSessionPending ¶
func NormalizeOAuthProvider ¶
func RegisterOAuthSession ¶
func RegisterOAuthSession(state, provider string)
func SetOAuthSessionError ¶
func SetOAuthSessionError(state, message string)
func ValidateOAuthState ¶
func WriteConfig ¶
func WriteOAuthCallbackFile ¶
Types ¶
type CacheMetricsResponse ¶
type CacheMetricsResponse struct {
Enabled bool `json:"enabled"`
Metrics map[string]interface{} `json:"metrics,omitempty"`
Error string `json:"error,omitempty"`
}
CacheMetricsResponse represents the cache metrics API response.
type DashboardResponse ¶
type DashboardResponse struct {
Timestamp string `json:"timestamp"`
System SystemStats `json:"system"`
Server ServerStats `json:"server"`
}
DashboardResponse is the JSON structure returned by the observability dashboard endpoint.
type DiscoverModelsRequest ¶
type FeedbackHandler ¶
type FeedbackHandler struct {
// contains filtered or unexported fields
}
FeedbackHandler handles the /v0/management/feedback endpoint. It requires an intelligence service to be provided.
func NewFeedbackHandler ¶
func NewFeedbackHandler(intelligenceService *intelligence.Service) *FeedbackHandler
NewFeedbackHandler creates a new feedback handler.
Parameters:
- intelligenceService: The intelligence service instance
Returns:
- *FeedbackHandler: A new handler instance
func (*FeedbackHandler) GetFeedbackStats ¶
func (h *FeedbackHandler) GetFeedbackStats(c *gin.Context)
GetFeedbackStats handles GET /v0/management/feedback/stats Returns aggregated statistics about feedback records.
Response:
- 200: Success with statistics
- 503: Intelligence services not enabled
func (*FeedbackHandler) GetRecentFeedback ¶
func (h *FeedbackHandler) GetRecentFeedback(c *gin.Context)
GetRecentFeedback handles GET /v0/management/feedback/recent Returns the most recent feedback records.
Query Parameters:
- limit: Maximum number of records to return (default: 100)
Response:
- 200: Success with feedback records
- 503: Intelligence services not enabled
func (*FeedbackHandler) SubmitFeedback ¶
func (h *FeedbackHandler) SubmitFeedback(c *gin.Context)
SubmitFeedback handles POST /v0/management/feedback Accepts explicit feedback submission from clients.
Request Body:
- FeedbackRequest: The feedback data
Response:
- 201: Feedback recorded successfully
- 400: Invalid request body
- 503: Intelligence services not enabled
type FeedbackRequest ¶
type FeedbackRequest struct {
Query string `json:"query" binding:"required"`
Intent string `json:"intent" binding:"required"`
SelectedModel string `json:"selected_model" binding:"required"`
RoutingTier string `json:"routing_tier" binding:"required"`
Confidence float64 `json:"confidence"`
MatchedSkill string `json:"matched_skill,omitempty"`
CascadeOccurred bool `json:"cascade_occurred"`
ResponseQuality float64 `json:"response_quality,omitempty"`
LatencyMs int64 `json:"latency_ms" binding:"required"`
Success bool `json:"success"`
ErrorMessage string `json:"error_message,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
FeedbackRequest represents a request to submit feedback.
type FeedbackStatsResponse ¶
type FeedbackStatsResponse struct {
TotalRecords int64 `json:"total_records"`
SuccessRate float64 `json:"success_rate"`
TierDistribution map[string]int64 `json:"tier_distribution"`
AvgLatencyMs float64 `json:"avg_latency_ms"`
CascadeRate float64 `json:"cascade_rate"`
}
FeedbackStatsResponse represents aggregated feedback statistics.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler aggregates config reference, persistence path and helpers.
func NewHandler ¶
NewHandler creates a new management handler instance.
func (*Handler) DeleteAPIKeys ¶
func (*Handler) DeleteAmpModelMappings ¶
DeleteAmpModelMappings removes specified model mappings by "from" field.
func (*Handler) DeleteAmpUpstreamAPIKey ¶
DeleteAmpUpstreamAPIKey clears the ampcode upstream API key.
func (*Handler) DeleteAmpUpstreamURL ¶
DeleteAmpUpstreamURL clears the ampcode upstream URL.
func (*Handler) DeleteAuthFile ¶
Delete auth files: single by name or all
func (*Handler) DeleteClaudeKey ¶
func (*Handler) DeleteCodexKey ¶
func (*Handler) DeleteGeminiKey ¶
func (*Handler) DeleteLogs ¶
DeleteLogs removes all rotated log files and truncates the active log.
func (*Handler) DeleteOAuthExcludedModels ¶
func (*Handler) DeleteOpenAICompat ¶
func (*Handler) DeleteProxyURL ¶
func (*Handler) DeleteSwitchAIKey ¶
func (*Handler) DiscoverModels ¶
func (*Handler) DownloadAuthFile ¶
Download single auth file by name
func (*Handler) DownloadRequestErrorLog ¶
DownloadRequestErrorLog downloads a specific error request log file by name.
func (*Handler) GetAmpCode ¶
GetAmpCode returns the complete ampcode configuration.
func (*Handler) GetAmpForceModelMappings ¶
GetAmpForceModelMappings returns whether model mappings are forced.
func (*Handler) GetAmpModelMappings ¶
GetAmpModelMappings returns the ampcode model mappings.
func (*Handler) GetAmpRestrictManagementToLocalhost ¶
GetAmpRestrictManagementToLocalhost returns the localhost restriction setting.
func (*Handler) GetAmpUpstreamAPIKey ¶
GetAmpUpstreamAPIKey returns the ampcode upstream API key.
func (*Handler) GetAmpUpstreamURL ¶
GetAmpUpstreamURL returns the ampcode upstream URL.
func (*Handler) GetAnalytics ¶
GetAnalytics returns computed analytics from the memory system. GET /v0/management/analytics
func (*Handler) GetAuthFileModels ¶
GetAuthFileModels returns the models supported by a specific auth file
func (*Handler) GetAuthStatus ¶
func (*Handler) GetAutoRouteJournal ¶
GetAutoRouteJournal returns the latest routing decisions from the ring buffer.
func (*Handler) GetAutoRouteStatus ¶
GetAutoRouteStatus returns the active weights and metrics from the AutoRouting Lab.
func (*Handler) GetClaudeKeys ¶
claude-api-key: []ClaudeKey
func (*Handler) GetCodexKeys ¶
codex-api-key: []CodexKey
func (*Handler) GetConfigYAML ¶
GetConfigYAML returns the raw config.yaml file bytes without re-encoding. It preserves comments and original formatting/styles.
func (*Handler) GetGeminiKeys ¶
gemini-api-key: []GeminiKey
func (*Handler) GetHeartbeatStatus ¶
GetHeartbeatStatus returns the current status of all monitored providers. GET /v0/management/heartbeat/status
func (*Handler) GetHooksStatus ¶
GetHooksStatus returns all loaded hooks and their configuration. GET /v0/management/hooks/status
func (*Handler) GetLatestVersion ¶
GetLatestVersion returns the latest release version from GitHub without downloading assets.
func (*Handler) GetLoggingToFile ¶
UsageStatisticsEnabled
func (*Handler) GetMaxRetryInterval ¶
Max retry interval
func (*Handler) GetMemoryStats ¶
GetMemoryStats returns statistics about the memory system. GET /v0/management/memory/stats
func (*Handler) GetOAuthExcludedModels ¶
oauth-excluded-models: map[string][]string
func (*Handler) GetOpenAICompat ¶
openai-compatibility: []OpenAICompatibility
func (*Handler) GetRequestErrorLogs ¶
GetRequestErrorLogs lists error request log files when RequestLog is disabled. It returns an empty list when RequestLog is enabled.
func (*Handler) GetRequestLogByID ¶
GetRequestLogByID finds and downloads a request log file by its request ID. The ID is matched against the suffix of log file names (format: *-{requestID}.log).
func (*Handler) GetSetupStatus ¶
GetSetupStatus returns whether a management password is currently configured.
func (*Handler) GetSteeringRules ¶
GetSteeringRules returns all loaded steering rules. GET /v0/management/steering/rules
func (*Handler) GetSuperbrainMetrics ¶
GetSuperbrainMetrics returns the current Superbrain metrics snapshot. This endpoint exposes observability data for monitoring autonomous healing operations.
Response includes: - Healing attempts, successes, and failures - Breakdown by healing type and failure type - Latency statistics - Active monitoring contexts and queued actions - Success/failure rates
func (*Handler) GetSwitchAIKeys ¶
switchai-api-key: []SwitchAIKey
func (*Handler) GetSwitchPreviewModel ¶
func (*Handler) GetSwitchProject ¶
Quota exceeded toggles
func (*Handler) GetUsageStatistics ¶
GetUsageStatistics returns the in-memory request statistics snapshot.
func (*Handler) GetUsageStatisticsEnabled ¶
UsageStatisticsEnabled
func (*Handler) GetWebsocketAuth ¶
Websocket auth
func (*Handler) HandleCacheClear ¶
func (h *Handler) HandleCacheClear(w http.ResponseWriter, r *http.Request)
HandleCacheClear clears all entries from the semantic cache. POST /v0/management/cache/clear
func (*Handler) HandleCacheMetrics ¶
func (h *Handler) HandleCacheMetrics(w http.ResponseWriter, r *http.Request)
HandleCacheMetrics returns cache performance metrics. GET /v0/management/cache/metrics
func (*Handler) HandleDashboard ¶
HandleDashboard returns a Gin handler that serves the observability dashboard JSON. This endpoint aggregates runtime metrics without introducing new data collection — it reads from existing Go runtime stats and the Prometheus collectors already registered.
The dashboard is designed for consumption by monitoring UIs and health check scripts.
func (*Handler) ImportVertexCredential ¶
ImportVertexCredential handles uploading a Vertex service account JSON and saving it as an auth record.
func (*Handler) InitializeSecret ¶
InitializeSecret allows setting the initial management password if none is configured.
func (*Handler) ListAuthFiles ¶
func (*Handler) Middleware ¶
func (h *Handler) Middleware() gin.HandlerFunc
Middleware enforces access control for management endpoints. All requests (local and remote) require a valid management key. Additionally, remote access requires allow-remote-management=true.
func (*Handler) PatchAPIKeys ¶
func (*Handler) PatchAmpModelMappings ¶
PatchAmpModelMappings adds or updates model mappings.
func (*Handler) PatchClaudeKey ¶
func (*Handler) PatchCodexKey ¶
func (*Handler) PatchGeminiKey ¶
func (*Handler) PatchOAuthExcludedModels ¶
func (*Handler) PatchOpenAICompat ¶
func (*Handler) PatchSwitchAIKey ¶
func (*Handler) PostOAuthCallback ¶
func (*Handler) PutAPIKeys ¶
func (*Handler) PutAmpForceModelMappings ¶
PutAmpForceModelMappings updates the force model mappings setting.
func (*Handler) PutAmpModelMappings ¶
PutAmpModelMappings replaces all ampcode model mappings.
func (*Handler) PutAmpRestrictManagementToLocalhost ¶
PutAmpRestrictManagementToLocalhost updates the localhost restriction setting.
func (*Handler) PutAmpUpstreamAPIKey ¶
PutAmpUpstreamAPIKey updates the ampcode upstream API key.
func (*Handler) PutAmpUpstreamURL ¶
PutAmpUpstreamURL updates the ampcode upstream URL.
func (*Handler) PutClaudeKeys ¶
func (*Handler) PutCodexKeys ¶
func (*Handler) PutConfigYAML ¶
func (*Handler) PutGeminiKeys ¶
func (*Handler) PutLoggingToFile ¶
func (*Handler) PutMaxRetryInterval ¶
func (*Handler) PutOAuthExcludedModels ¶
func (*Handler) PutOpenAICompat ¶
func (*Handler) PutProxyURL ¶
func (*Handler) PutRequestLog ¶
func (*Handler) PutRequestRetry ¶
func (*Handler) PutSwitchAIKeys ¶
func (*Handler) PutSwitchPreviewModel ¶
func (*Handler) PutSwitchProject ¶
func (*Handler) PutUsageStatisticsEnabled ¶
func (*Handler) PutWebsocketAuth ¶
func (*Handler) ReloadHooks ¶
ReloadHooks reloads hooks from disk without restarting the server. POST /v0/management/hooks/reload
func (*Handler) ReloadSteering ¶
ReloadSteering reloads steering rules from disk without restarting the server. POST /v0/management/steering/reload
func (*Handler) RequestAnthropicToken ¶
func (*Handler) RequestAntigravityToken ¶
func (*Handler) RequestCodexToken ¶
func (*Handler) RequestGeminiCLIToken ¶
func (*Handler) RequestIFlowCookieToken ¶
func (*Handler) RequestIFlowToken ¶
func (*Handler) RequestQwenToken ¶
func (*Handler) ResetSecret ¶
func (*Handler) SetAuthManager ¶
SetAuthManager updates the auth manager reference used by management endpoints.
func (*Handler) SetAutoResolver ¶
func (h *Handler) SetAutoResolver(ar *autoroute.AutoResolver)
SetAutoResolver sets the auto-routing telemetry bridge for the dashboard.
func (*Handler) SetConfig ¶
SetConfig updates the in-memory config reference when the server hot-reloads.
func (*Handler) SetIntelligenceService ¶
func (h *Handler) SetIntelligenceService(svc IntelligenceService)
SetIntelligenceService updates the intelligence service reference.
func (*Handler) SetLocalPassword ¶
SetLocalPassword configures the runtime-local password accepted for localhost requests.
func (*Handler) SetLogDirectory ¶
SetLogDirectory updates the directory where main.log should be looked up.
func (*Handler) SetServiceCoordinator ¶
func (h *Handler) SetServiceCoordinator(coordinator ServiceCoordinatorInterface)
SetServiceCoordinator updates the service coordinator reference.
func (*Handler) SetUsageStatistics ¶
func (h *Handler) SetUsageStatistics(stats *usage.RequestStatistics)
SetUsageStatistics allows replacing the usage statistics reference.
func (*Handler) SkipSecret ¶
func (*Handler) TestProvider ¶
TestProvider attempts to verify if a provider is correctly configured and reachable.
func (*Handler) UploadAuthFile ¶
Upload auth file: multipart or raw JSON with ?name=
type IntelligenceService ¶
type IntelligenceService interface {
IsEnabled() bool
GetSemanticCache() intelligence.SemanticCacheInterface
}
IntelligenceService defines the interface for accessing intelligence features.
type ServerStats ¶
type ServerStats struct {
Uptime string `json:"uptime"`
}
ServerStats reports proxy server metadata.
type ServiceCoordinatorInterface ¶
type ServiceCoordinatorInterface interface {
GetMemory() interface{}
GetHeartbeat() interface{}
GetSteering() interface{}
GetHooks() interface{}
}
ServiceCoordinatorInterface defines the interface for accessing the service coordinator.
type SkillMetadata ¶
type SkillMetadata struct {
// ID is the unique identifier for the skill
ID string `json:"id"`
// Name is the human-readable name
Name string `json:"name"`
// Description explains what the skill does
Description string `json:"description"`
// RequiredCapability specifies which capability slot this skill needs
RequiredCapability string `json:"required_capability"`
// HasEmbedding indicates whether an embedding has been computed for this skill
HasEmbedding bool `json:"has_embedding"`
}
SkillMetadata represents metadata for a single skill.
type SkillsHandler ¶
type SkillsHandler struct {
// contains filtered or unexported fields
}
SkillsHandler handles the /v0/management/skills endpoint. It requires an intelligence service to be provided.
func NewSkillsHandler ¶
func NewSkillsHandler(intelligenceService *intelligence.Service) *SkillsHandler
NewSkillsHandler creates a new skills handler.
Parameters:
- intelligenceService: The intelligence service instance
Returns:
- *SkillsHandler: A new handler instance
func (*SkillsHandler) GetSkills ¶
func (h *SkillsHandler) GetSkills(c *gin.Context)
GetSkills handles GET /v0/management/skills Returns skill count, metadata, and usage statistics.
Response:
- 200: Success with skill metadata
- 503: Intelligence services not enabled
type SkillsResponse ¶
type SkillsResponse struct {
// Count is the total number of loaded skills
Count int `json:"count"`
// Skills contains metadata for all loaded skills
Skills []SkillMetadata `json:"skills"`
// EmbeddingsAvailable indicates whether embeddings have been computed
EmbeddingsAvailable bool `json:"embeddings_available"`
// UsageStats contains usage statistics for each skill
UsageStats map[string]int64 `json:"usage_stats,omitempty"`
}
SkillsResponse represents the response for the skills endpoint.
type SystemStats ¶
type SystemStats struct {
Goroutines int `json:"goroutines"`
HeapAllocMB float64 `json:"heap_alloc_mb"`
HeapSysMB float64 `json:"heap_sys_mb"`
NumGC uint32 `json:"num_gc"`
GoVersion string `json:"go_version"`
NumCPU int `json:"num_cpu"`
}
SystemStats reports Go runtime metrics.
type TestProviderRequest ¶
type TestProviderRequest struct {
ProviderID string `json:"provider_id"`
Category string `json:"category"`
Config map[string]interface{} `json:"config"`
}
TestProviderRequest defines the payload for testing a provider configuration.
Source Files
¶
- auth_anthropic.go
- auth_antigravity.go
- auth_codex.go
- auth_files.go
- auth_gemini.go
- autoroute.go
- cache.go
- config_basic.go
- config_lists.go
- dashboard.go
- discover_models.go
- feedback.go
- handler.go
- intelligence.go
- intelligence_reload.go
- logs.go
- oauth_callback.go
- oauth_sessions.go
- quota.go
- skills.go
- superbrain_metrics.go
- test_provider.go
- usage.go
- vertex_import.go