Documentation
¶
Index ¶
- type AdminHandler
- func (h *AdminHandler) GenerateToken(c *gin.Context)
- func (h *AdminHandler) GetAuditLogs(c *gin.Context)
- func (h *AdminHandler) GetRateLimitStats(c *gin.Context)
- func (h *AdminHandler) GetStats(c *gin.Context)
- func (h *AdminHandler) ResetRateLimit(c *gin.Context)
- func (h *AdminHandler) RevokeToken(c *gin.Context)
- func (h *AdminHandler) ValidateToken(c *gin.Context)
- type AuditLogEntry
- type BotSettingsHandler
- func (h *BotSettingsHandler) CreateSettings(c *gin.Context)
- func (h *BotSettingsHandler) DeleteSettings(c *gin.Context)
- func (h *BotSettingsHandler) GetPlatformConfig(c *gin.Context)
- func (h *BotSettingsHandler) GetPlatforms(c *gin.Context)
- func (h *BotSettingsHandler) GetSettings(c *gin.Context)
- func (h *BotSettingsHandler) GetSettingsByUUID(c *gin.Context)
- func (h *BotSettingsHandler) ListSettings(c *gin.Context)
- func (h *BotSettingsHandler) ToggleSettings(c *gin.Context)
- func (h *BotSettingsHandler) UpdateSettings(c *gin.Context)
- func (h *BotSettingsHandler) UpdateSettingsLegacy(c *gin.Context)
- type BotSettingsPayload
- type CloseRequest
- type CloseResponse
- type ExecuteRequest
- type ExecuteResponse
- type GenerateTokenRequest
- type Handler
- type HandshakeRequest
- type HandshakeResponse
- type ListTokensRequest
- type RemoteCCHandler
- func (h *RemoteCCHandler) Chat(c *gin.Context)
- func (h *RemoteCCHandler) ClearSessions(c *gin.Context)
- func (h *RemoteCCHandler) GetSession(c *gin.Context)
- func (h *RemoteCCHandler) GetSessionMessages(c *gin.Context)
- func (h *RemoteCCHandler) GetSessionState(c *gin.Context)
- func (h *RemoteCCHandler) GetSessions(c *gin.Context)
- func (h *RemoteCCHandler) UpdateSessionState(c *gin.Context)
- type RemoteChatMessage
- type RemoteChatRequest
- type RemoteChatResponse
- type RemoteSession
- type RemoteSessionState
- type RemoteSessionStateUpdate
- type ResetRateLimitRequest
- type RevokeTokenRequest
- type StatsResponse
- type StatusResponse
- type TokenInfo
- type TokenValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminHandler ¶
type AdminHandler struct {
// contains filtered or unexported fields
}
AdminHandler handles admin API requests
func NewAdminHandler ¶
func NewAdminHandler(sessionMgr *session.Manager, auditLogger *audit.Logger, rateLimiter *middleware.RateLimiter, cfg *config.Config) *AdminHandler
NewAdminHandler creates a new admin handler
func (*AdminHandler) GenerateToken ¶
func (h *AdminHandler) GenerateToken(c *gin.Context)
GenerateToken handles POST /admin/tokens/generate
func (*AdminHandler) GetAuditLogs ¶
func (h *AdminHandler) GetAuditLogs(c *gin.Context)
GetAuditLogs handles GET /admin/logs Query params: page, limit, action, user_id, start_date, end_date
func (*AdminHandler) GetRateLimitStats ¶
func (h *AdminHandler) GetRateLimitStats(c *gin.Context)
GetRateLimitStats handles GET /admin/ratelimit/stats
func (*AdminHandler) GetStats ¶
func (h *AdminHandler) GetStats(c *gin.Context)
GetStats handles GET /admin/stats
func (*AdminHandler) ResetRateLimit ¶
func (h *AdminHandler) ResetRateLimit(c *gin.Context)
ResetRateLimit handles POST /admin/ratelimit/reset
func (*AdminHandler) RevokeToken ¶
func (h *AdminHandler) RevokeToken(c *gin.Context)
RevokeToken handles POST /admin/tokens/revoke
func (*AdminHandler) ValidateToken ¶
func (h *AdminHandler) ValidateToken(c *gin.Context)
ValidateToken handles POST /admin/tokens/validate
type AuditLogEntry ¶
type AuditLogEntry struct {
Timestamp string `json:"timestamp"`
Level string `json:"level"`
Action string `json:"action"`
UserID string `json:"user_id"`
ClientIP string `json:"client_ip"`
SessionID string `json:"session_id"`
RequestID string `json:"request_id"`
Success bool `json:"success"`
DurationMs int64 `json:"duration_ms"`
Details map[string]interface{} `json:"details,omitempty"`
}
AuditLogEntry represents an audit log entry for API response
type BotSettingsHandler ¶
type BotSettingsHandler struct {
// contains filtered or unexported fields
}
func NewBotSettingsHandler ¶
func NewBotSettingsHandler(store *bot.Store, manager *bot.Manager) *BotSettingsHandler
func (*BotSettingsHandler) CreateSettings ¶
func (h *BotSettingsHandler) CreateSettings(c *gin.Context)
CreateSettings creates a new bot configuration
func (*BotSettingsHandler) DeleteSettings ¶
func (h *BotSettingsHandler) DeleteSettings(c *gin.Context)
DeleteSettings deletes a bot configuration
func (*BotSettingsHandler) GetPlatformConfig ¶
func (h *BotSettingsHandler) GetPlatformConfig(c *gin.Context)
GetPlatformConfig returns auth configuration for a specific platform
func (*BotSettingsHandler) GetPlatforms ¶
func (h *BotSettingsHandler) GetPlatforms(c *gin.Context)
GetPlatforms returns all supported bot platforms with their configurations
func (*BotSettingsHandler) GetSettings ¶
func (h *BotSettingsHandler) GetSettings(c *gin.Context)
GetSettings returns all bot settings (V2 API - returns array)
func (*BotSettingsHandler) GetSettingsByUUID ¶
func (h *BotSettingsHandler) GetSettingsByUUID(c *gin.Context)
GetSettingsByUUID returns a single bot configuration by UUID
func (*BotSettingsHandler) ListSettings ¶
func (h *BotSettingsHandler) ListSettings(c *gin.Context)
ListSettings returns all bot configurations (V2 API)
func (*BotSettingsHandler) ToggleSettings ¶
func (h *BotSettingsHandler) ToggleSettings(c *gin.Context)
ToggleSettings toggles the enabled status of a bot configuration
func (*BotSettingsHandler) UpdateSettings ¶
func (h *BotSettingsHandler) UpdateSettings(c *gin.Context)
UpdateSettings updates an existing bot configuration
func (*BotSettingsHandler) UpdateSettingsLegacy ¶
func (h *BotSettingsHandler) UpdateSettingsLegacy(c *gin.Context)
UpdateSettingsLegacy is the legacy update endpoint for backward compatibility
type BotSettingsPayload ¶
type BotSettingsPayload struct {
UUID string `json:"uuid,omitempty"`
Name string `json:"name,omitempty"`
Platform string `json:"platform"`
AuthType string `json:"auth_type"`
Auth map[string]string `json:"auth"`
ProxyURL string `json:"proxy_url,omitempty"`
ChatID string `json:"chat_id,omitempty"`
BashAllowlist []string `json:"bash_allowlist,omitempty"`
Enabled bool `json:"enabled"`
// Legacy field for backward compatibility
Token string `json:"token,omitempty"`
}
type CloseRequest ¶
type CloseRequest struct {
SessionID string `json:"session_id" binding:"required"`
}
CloseRequest represents the close request body
type CloseResponse ¶
type CloseResponse struct {
SessionID string `json:"session_id"`
Status string `json:"status"`
Message string `json:"message,omitempty"`
}
CloseResponse represents the close response
type ExecuteRequest ¶
type ExecuteRequest struct {
SessionID string `json:"session_id" binding:"required"`
Request string `json:"request" binding:"required"`
}
ExecuteRequest represents the execute request body
type ExecuteResponse ¶
type ExecuteResponse struct {
SessionID string `json:"session_id"`
Status string `json:"status"`
Summary string `json:"summary"`
Error string `json:"error,omitempty"`
}
ExecuteResponse represents the execute response
type GenerateTokenRequest ¶
type GenerateTokenRequest struct {
ClientID string `json:"client_id" binding:"required"`
Description string `json:"description,omitempty"`
ExpiryHours int `json:"expiry_hours,omitempty"` // 0 = no expiry
}
GenerateTokenRequest represents the request body for generating a token
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles API requests
func NewHandler ¶
func NewHandler(sessionMgr *session.Manager, ab *agentboot.AgentBoot, summary *summarizer.Engine, auditLogger *audit.Logger) *Handler
NewHandler creates a new API handler
type HandshakeRequest ¶
type HandshakeRequest struct {
}
HandshakeRequest represents the handshake request body
type HandshakeResponse ¶
type HandshakeResponse struct {
SessionID string `json:"session_id"`
Status string `json:"status"`
ExpiresAt string `json:"expires_at"`
}
HandshakeResponse represents the handshake response
type ListTokensRequest ¶
type ListTokensRequest struct {
ActiveOnly bool `json:"active_only,omitempty"`
}
ListTokensRequest represents the request body for listing tokens
type RemoteCCHandler ¶
type RemoteCCHandler struct {
// contains filtered or unexported fields
}
RemoteCCHandler handles remote Claude Code requests
func NewRemoteCCHandler ¶
func NewRemoteCCHandler(sessionMgr *session.Manager, ab *agentboot.AgentBoot, summaryEngine *summarizer.Engine, auditLogger *audit.Logger, cfg *config.Config, permHandler permission.Handler) *RemoteCCHandler
NewRemoteCCHandler creates a new remote-coder handler
func (*RemoteCCHandler) Chat ¶
func (h *RemoteCCHandler) Chat(c *gin.Context)
Chat handles POST /remote-coder/chat
func (*RemoteCCHandler) ClearSessions ¶
func (h *RemoteCCHandler) ClearSessions(c *gin.Context)
ClearSessions handles POST /remote-coder/sessions/clear
func (*RemoteCCHandler) GetSession ¶
func (h *RemoteCCHandler) GetSession(c *gin.Context)
GetSession handles GET /remote-coder/sessions/:id
func (*RemoteCCHandler) GetSessionMessages ¶
func (h *RemoteCCHandler) GetSessionMessages(c *gin.Context)
GetSessionMessages handles GET /remote-coder/sessions/:id/messages
func (*RemoteCCHandler) GetSessionState ¶
func (h *RemoteCCHandler) GetSessionState(c *gin.Context)
GetSessionState handles GET /remote-coder/sessions/:id/state
func (*RemoteCCHandler) GetSessions ¶
func (h *RemoteCCHandler) GetSessions(c *gin.Context)
GetSessions handles GET /remote-coder/sessions
func (*RemoteCCHandler) UpdateSessionState ¶
func (h *RemoteCCHandler) UpdateSessionState(c *gin.Context)
UpdateSessionState handles PUT /remote-coder/sessions/:id/state
type RemoteChatMessage ¶
type RemoteChatMessage struct {
Role string `json:"role"`
Content string `json:"content"`
Summary string `json:"summary,omitempty"`
Timestamp string `json:"timestamp"`
}
RemoteChatMessage represents a chat message for API response
type RemoteChatRequest ¶
type RemoteChatRequest struct {
SessionID string `json:"session_id,omitempty"`
Message string `json:"message" binding:"required"`
Context map[string]interface{} `json:"context,omitempty"`
}
RemoteChatRequest represents a chat request to Claude Code
type RemoteChatResponse ¶
type RemoteChatResponse struct {
SessionID string `json:"session_id"`
Message string `json:"message"`
Summary string `json:"summary"` // Chopped/summarized response
FullResponse string `json:"full_response,omitempty"` // Full response (if requested)
Success bool `json:"success"`
Error string `json:"error,omitempty"`
}
RemoteChatResponse represents a chat response from Claude Code
type RemoteSession ¶
type RemoteSession struct {
ID string `json:"id"`
Status string `json:"status"`
Request string `json:"request,omitempty"`
Response string `json:"response,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt string `json:"created_at"`
LastActivity string `json:"last_activity"`
ExpiresAt string `json:"expires_at"`
ProjectPath string `json:"project_path,omitempty"`
}
RemoteSession represents a remote session for API response
type RemoteSessionState ¶
type RemoteSessionState struct {
ProjectPath string `json:"project_path,omitempty"`
ExpandedMessages []int `json:"expanded_messages,omitempty"`
}
RemoteSessionState represents persisted UI/session state
type RemoteSessionStateUpdate ¶
type RemoteSessionStateUpdate struct {
ProjectPath *string `json:"project_path,omitempty"`
ExpandedMessages *[]int `json:"expanded_messages,omitempty"`
}
RemoteSessionStateUpdate represents a partial update to session state
type ResetRateLimitRequest ¶
type ResetRateLimitRequest struct {
IP string `json:"ip"`
}
ResetRateLimitRequest represents the request body for resetting rate limit
type RevokeTokenRequest ¶
type RevokeTokenRequest struct {
ClientID string `json:"client_id" binding:"required"`
}
RevokeTokenRequest represents the request body for revoking a token
type StatsResponse ¶
type StatsResponse struct {
TotalSessions int `json:"total_sessions"`
ActiveSessions int `json:"active_sessions"`
CompletedSessions int `json:"completed_sessions"`
FailedSessions int `json:"failed_sessions"`
ClosedSessions int `json:"closed_sessions"`
RecentActions map[string]int `json:"recent_actions"`
Uptime string `json:"uptime"`
RateLimitStats map[string]interface{} `json:"rate_limit_stats"`
}
StatsResponse represents the stats response
type StatusResponse ¶
type StatusResponse struct {
SessionID string `json:"session_id"`
Status string `json:"status"`
Request string `json:"request,omitempty"`
Summary string `json:"summary,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt string `json:"created_at"`
LastActivity string `json:"last_activity"`
ExpiresAt string `json:"expires_at"`
}
StatusResponse represents the status response
type TokenInfo ¶
type TokenInfo struct {
Token string `json:"token"`
ClientID string `json:"client_id"`
ExpiresAt string `json:"expires_at"`
CreatedAt string `json:"created_at"`
}
TokenInfo represents token information for response
type TokenValidationResult ¶
type TokenValidationResult struct {
Valid bool `json:"valid"`
ClientID string `json:"client_id,omitempty"`
Message string `json:"message,omitempty"`
}
TokenValidationResult represents the result of token validation