admin

package
v0.1.59 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package admin exposes core-owned platform administration endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCreator

type AgentCreator struct {
	ID          string `json:"id"`
	Email       string `json:"email"`
	DisplayName string `json:"display_name"`
}

type AgentItem

type AgentItem struct {
	ID                   string        `json:"id"`
	CreatorID            string        `json:"creator_id"`
	Slug                 string        `json:"slug"`
	Name                 string        `json:"name"`
	Description          string        `json:"description"`
	EndpointURL          string        `json:"endpoint_url"`
	PricePerCallCents    int32         `json:"price_per_call_cents"`
	Tags                 []string      `json:"tags"`
	LifecycleStatus      string        `json:"lifecycle_status"`
	Visibility           string        `json:"visibility"`
	CertificationStatus  string        `json:"certification_status"`
	RejectionReason      *string       `json:"rejection_reason,omitempty"`
	TotalCalls           int32         `json:"total_calls"`
	TotalRevenueCents    int64         `json:"total_revenue_cents"`
	ConnectionMode       string        `json:"connection_mode"`
	MCPToolName          *string       `json:"mcp_tool_name,omitempty"`
	RecommendedTaskCount int32         `json:"recommended_task_count"`
	ChosenTaskCount      int32         `json:"chosen_task_count"`
	CompletedTaskCount   int32         `json:"completed_task_count"`
	LastRunAt            *string       `json:"last_run_at,omitempty"`
	CreatedAt            string        `json:"created_at"`
	UpdatedAt            string        `json:"updated_at"`
	CertifiedAt          *string       `json:"certified_at,omitempty"`
	Creator              *AgentCreator `json:"creator,omitempty"`
}

type AgentListResponse

type AgentListResponse struct {
	Items  []AgentItem `json:"items"`
	Total  int32       `json:"total"`
	Limit  int32       `json:"limit"`
	Offset int32       `json:"offset"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Email           string `json:"email"`
	DisplayName     string `json:"display_name"`
	Password        string `json:"password"`
	IsAdmin         bool   `json:"is_admin"`
	IsCreator       bool   `json:"is_creator"`
	CreatorVerified bool   `json:"creator_verified"`
}

type Handler

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

func NewHandler

func NewHandler(svc *Service) *Handler

func (*Handler) CreateUser

func (h *Handler) CreateUser(c echo.Context) error

func (*Handler) ListAgents

func (h *Handler) ListAgents(c echo.Context) error

func (*Handler) ListTasks

func (h *Handler) ListTasks(c echo.Context) error

func (*Handler) ListUsers

func (h *Handler) ListUsers(c echo.Context) error

func (*Handler) Register

func (h *Handler) Register(api *echo.Group, jwtMiddleware, adminMiddleware echo.MiddlewareFunc)

func (*Handler) Summary

func (h *Handler) Summary(c echo.Context) error

func (*Handler) UpdateAgentModeration

func (h *Handler) UpdateAgentModeration(c echo.Context) error

func (*Handler) UpdateUserFlags

func (h *Handler) UpdateUserFlags(c echo.Context) error

type Service

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

func NewService

func NewService(dbtx db.DBTX) *Service

func (*Service) CreateUser

func (s *Service) CreateUser(ctx context.Context, req *CreateUserRequest) (*UserItem, error)

func (*Service) ListAgents

func (s *Service) ListAgents(ctx context.Context, query, lifecycle, visibility, certification string, limit, offset int32) (*AgentListResponse, error)

func (*Service) ListTasks

func (s *Service) ListTasks(ctx context.Context, query, status string, limit, offset int32) (*TaskListResponse, error)

func (*Service) ListUsers

func (s *Service) ListUsers(ctx context.Context, query, role string, limit, offset int32) (*UserListResponse, error)

func (*Service) Summary

func (s *Service) Summary(ctx context.Context) (*SummaryResponse, error)

func (*Service) UpdateAgentModeration

func (s *Service) UpdateAgentModeration(ctx context.Context, agentID uuid.UUID, req *UpdateAgentModerationRequest) (*AgentItem, error)

func (*Service) UpdateUserFlags

func (s *Service) UpdateUserFlags(ctx context.Context, actorID, targetID uuid.UUID, req *UpdateUserFlagsRequest) (*UserItem, error)

type SummaryResponse

type SummaryResponse struct {
	TotalUsers       int32 `json:"total_users"`
	AdminUsers       int32 `json:"admin_users"`
	CreatorUsers     int32 `json:"creator_users"`
	VerifiedCreators int32 `json:"verified_creators"`
	TotalAgents      int32 `json:"total_agents"`
	ActiveAgents     int32 `json:"active_agents"`
	DisabledAgents   int32 `json:"disabled_agents"`
	PendingAgents    int32 `json:"pending_agents"`
	CertifiedAgents  int32 `json:"certified_agents"`
	TotalTasks       int32 `json:"total_tasks"`
	CompletedTasks   int32 `json:"completed_tasks"`
}

SummaryResponse is the admin console aggregate snapshot.

type TaskAgent

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

type TaskItem

type TaskItem struct {
	ID                    string     `json:"id"`
	UserID                string     `json:"user_id"`
	Query                 string     `json:"query"`
	Visibility            string     `json:"visibility"`
	ParsedSkills          []string   `json:"parsed_skills"`
	MCPTools              []string   `json:"mcp_tools"`
	RecommendedAgentCount int        `json:"recommended_agent_count"`
	Status                string     `json:"status"`
	ChosenAgentID         *string    `json:"chosen_agent_id,omitempty"`
	ChosenAt              *string    `json:"chosen_at,omitempty"`
	CompletedAt           *string    `json:"completed_at,omitempty"`
	CompletionSummary     *string    `json:"completion_summary,omitempty"`
	CompletionRunID       *string    `json:"completion_run_id,omitempty"`
	CreatedAt             string     `json:"created_at"`
	User                  *TaskUser  `json:"user,omitempty"`
	ChosenAgent           *TaskAgent `json:"chosen_agent,omitempty"`
}

type TaskListResponse

type TaskListResponse struct {
	Items  []TaskItem `json:"items"`
	Total  int32      `json:"total"`
	Limit  int32      `json:"limit"`
	Offset int32      `json:"offset"`
}

type TaskUser

type TaskUser struct {
	ID          string `json:"id"`
	Email       string `json:"email"`
	DisplayName string `json:"display_name"`
}

type UpdateAgentModerationRequest

type UpdateAgentModerationRequest struct {
	LifecycleStatus     string `json:"lifecycle_status"`
	Visibility          string `json:"visibility"`
	CertificationStatus string `json:"certification_status"`
	RejectionReason     string `json:"rejection_reason"`
}

type UpdateUserFlagsRequest

type UpdateUserFlagsRequest struct {
	IsAdmin         *bool `json:"is_admin"`
	IsCreator       *bool `json:"is_creator"`
	CreatorVerified *bool `json:"creator_verified"`
	Disabled        *bool `json:"disabled"`
}

type UserItem

type UserItem struct {
	ID               string  `json:"id"`
	Email            string  `json:"email"`
	DisplayName      string  `json:"display_name"`
	AvatarURL        string  `json:"avatar_url,omitempty"`
	HasPassword      bool    `json:"has_password"`
	IsOAuthUser      bool    `json:"is_oauth_user"`
	OAuthProvider    string  `json:"oauth_provider,omitempty"`
	AuthMethod       string  `json:"auth_method"`
	IsCreator        bool    `json:"is_creator"`
	CreatorVerified  bool    `json:"creator_verified"`
	IsAdmin          bool    `json:"is_admin"`
	Disabled         bool    `json:"disabled"`
	DisabledAt       *string `json:"disabled_at,omitempty"`
	CreatedAt        string  `json:"created_at"`
	UpdatedAt        string  `json:"updated_at"`
	AgentCount       int32   `json:"agent_count"`
	ActiveAgentCount int32   `json:"active_agent_count"`
	TaskCount        int32   `json:"task_count"`
	RunCount         int32   `json:"run_count"`
	LastTaskAt       *string `json:"last_task_at,omitempty"`
	LastRunAt        *string `json:"last_run_at,omitempty"`
}

type UserListResponse

type UserListResponse struct {
	Items  []UserItem `json:"items"`
	Total  int32      `json:"total"`
	Limit  int32      `json:"limit"`
	Offset int32      `json:"offset"`
}

Jump to

Keyboard shortcuts

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