Documentation
¶
Index ¶
- func FeatureMiddleware(gate *features.FeatureGate, feature features.Feature) echo.MiddlewareFunc
- type ApprovalConfig
- type ApprovalHandler
- func (h *ApprovalHandler) AuthorizeToolCall(ctx context.Context, req tools.ToolApprovalRequest) (tools.ToolApprovalDecision, error)
- func (h *ApprovalHandler) Enqueue(userID string, req *PendingRequest)
- func (h *ApprovalHandler) GetConfig(c echo.Context) error
- func (h *ApprovalHandler) GetPending(userID string) map[string]any
- func (h *ApprovalHandler) GetPendingByRun(runID string) *PendingRequest
- func (h *ApprovalHandler) GetPendingBySession(sessionID string) map[string]any
- func (h *ApprovalHandler) RegisterRoutes(g *echo.Group)
- func (h *ApprovalHandler) Resolve(c echo.Context) error
- func (h *ApprovalHandler) SetExecResolver(r ExecApprovalResolver)
- func (h *ApprovalHandler) SetObserver(observer tools.RuntimeEventObserver)
- func (h *ApprovalHandler) SetRiskScorer(scorer ToolApprovalRiskScorer)
- func (h *ApprovalHandler) UpdateConfig(c echo.Context) error
- type CompatibilityResponse
- type ConvertToolsRequest
- type ExecApprovalResolveResult
- type ExecApprovalResolver
- type FeaturesHandler
- func (h *FeaturesHandler) GetAllFeatures(c echo.Context) error
- func (h *FeaturesHandler) GetCLIDependentFeatures(c echo.Context) error
- func (h *FeaturesHandler) GetFeature(c echo.Context) error
- func (h *FeaturesHandler) GetFeaturesByCategory(c echo.Context) error
- func (h *FeaturesHandler) GetStatus(c echo.Context) error
- func (h *FeaturesHandler) RegisterRoutes(e *echo.Echo)
- type GetStatsRequest
- type LinkPreviewHandler
- type LinkPreviewResponse
- type NetworkHandler
- func (h *NetworkHandler) GetAddresses(c echo.Context) error
- func (h *NetworkHandler) GetPreferred(c echo.Context) error
- func (h *NetworkHandler) GetStatus(c echo.Context) error
- func (h *NetworkHandler) InitializeCORSOrigins() error
- func (h *NetworkHandler) RegisterGroupRoutes(g *echo.Group)
- func (h *NetworkHandler) RegisterRoutes(e *echo.Echo)
- type PendingRequest
- type ProviderCompatibility
- type RemoteAccessHandler
- func (h *RemoteAccessHandler) GetDiagnostics(c echo.Context) error
- func (h *RemoteAccessHandler) GetNgrokStatus(c echo.Context) error
- func (h *RemoteAccessHandler) GetQRCode(c echo.Context) error
- func (h *RemoteAccessHandler) GetRemoteAccessConfig(c echo.Context) error
- func (h *RemoteAccessHandler) GetRemoteAccessLogs(c echo.Context) error
- func (h *RemoteAccessHandler) GetRemoteAccessStatus(c echo.Context) error
- func (h *RemoteAccessHandler) RegisterGroupRoutes(g *echo.Group)
- func (h *RemoteAccessHandler) RegisterRoutes(e *echo.Echo)
- func (h *RemoteAccessHandler) StartRemoteAccess(c echo.Context) error
- func (h *RemoteAccessHandler) StopRemoteAccess(c echo.Context) error
- func (h *RemoteAccessHandler) UpdateRemoteAccessConfig(c echo.Context) error
- type SDKRemoteAccessHandler
- func (h *SDKRemoteAccessHandler) GetDiagnostics(c echo.Context) error
- func (h *SDKRemoteAccessHandler) GetQRCode(c echo.Context) error
- func (h *SDKRemoteAccessHandler) GetRemoteAccessConfig(c echo.Context) error
- func (h *SDKRemoteAccessHandler) GetRemoteAccessLogs(c echo.Context) error
- func (h *SDKRemoteAccessHandler) GetRemoteAccessStatus(c echo.Context) error
- func (h *SDKRemoteAccessHandler) RegisterGroupRoutes(g *echo.Group)
- func (h *SDKRemoteAccessHandler) RegisterRoutes(e *echo.Echo)
- func (h *SDKRemoteAccessHandler) SetJWTService(jwt *auth.JWTService)
- func (h *SDKRemoteAccessHandler) StartRemoteAccess(c echo.Context) error
- func (h *SDKRemoteAccessHandler) StopRemoteAccess(c echo.Context) error
- func (h *SDKRemoteAccessHandler) UpdateRemoteAccessConfig(c echo.Context) error
- type SetConsentRequest
- type StartRemoteAccessRequest
- type StartTunnelRequest
- type StatsHandler
- func (h *StatsHandler) ClearStats(c echo.Context) error
- func (h *StatsHandler) ExportStats(c echo.Context) error
- func (h *StatsHandler) GetConsentInfo(c echo.Context) error
- func (h *StatsHandler) GetConsentStatus(c echo.Context) error
- func (h *StatsHandler) GetRecentEvents(c echo.Context) error
- func (h *StatsHandler) GetStats(c echo.Context) error
- func (h *StatsHandler) RegisterRoutes(e *echo.Echo)
- func (h *StatsHandler) SetConsentStatus(c echo.Context) error
- type TestToolCallingRequest
- type TestToolCallingResponse
- type ToolApprovalRiskScore
- type ToolApprovalRiskScorer
- type ToolsHandler
- func (h *ToolsHandler) ConvertTools(c echo.Context) error
- func (h *ToolsHandler) GetAllCapabilities(c echo.Context) error
- func (h *ToolsHandler) GetCompatibility(c echo.Context) error
- func (h *ToolsHandler) GetProviderCapabilities(c echo.Context) error
- func (h *ToolsHandler) RegisterRoutes(e *echo.Echo)
- func (h *ToolsHandler) TestToolCalling(c echo.Context) error
- type TunnelHandler
- func (h *TunnelHandler) EnsureTunnelURL(ctx context.Context) (string, error)
- func (h *TunnelHandler) GetDiagnostics(c echo.Context) error
- func (h *TunnelHandler) GetProviders(c echo.Context) error
- func (h *TunnelHandler) GetQRCode(c echo.Context) error
- func (h *TunnelHandler) GetTunnelConfig(c echo.Context) error
- func (h *TunnelHandler) GetTunnelLogs(c echo.Context) error
- func (h *TunnelHandler) GetTunnelStatus(c echo.Context) error
- func (h *TunnelHandler) RegisterGroupRoutes(g *echo.Group)
- func (h *TunnelHandler) RegisterRoutes(e *echo.Echo)
- func (h *TunnelHandler) SetJWTService(jwt *auth.JWTService)
- func (h *TunnelHandler) StartTunnel(c echo.Context) error
- func (h *TunnelHandler) StopTunnel(c echo.Context) error
- func (h *TunnelHandler) UpdateTunnelConfig(c echo.Context) error
- type UpdateRemoteAccessConfigRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FeatureMiddleware ¶
func FeatureMiddleware(gate *features.FeatureGate, feature features.Feature) echo.MiddlewareFunc
FeatureMiddleware creates middleware that checks if a feature is enabled.
Types ¶
type ApprovalConfig ¶
type ApprovalConfig struct {
Enabled bool `json:"enabled"`
DefaultPolicy string `json:"default_policy"` // auto, ask, deny
ToolPolicies map[string]string `json:"tool_policies"`
}
ApprovalConfig holds the tool-call approval policy.
type ApprovalHandler ¶
type ApprovalHandler struct {
// contains filtered or unexported fields
}
ApprovalHandler serves the /api/v1/approval endpoints.
func NewApprovalHandler ¶
func NewApprovalHandler(broker *sse.Broker) *ApprovalHandler
NewApprovalHandler creates a new handler with sensible defaults.
func (*ApprovalHandler) AuthorizeToolCall ¶
func (h *ApprovalHandler) AuthorizeToolCall(ctx context.Context, req tools.ToolApprovalRequest) (tools.ToolApprovalDecision, error)
AuthorizeToolCall enforces generic tool approval policies at runtime.
func (*ApprovalHandler) Enqueue ¶
func (h *ApprovalHandler) Enqueue(userID string, req *PendingRequest)
Enqueue adds a new pending request and pushes an SSE event. Called by the tool executor when a tool call needs approval.
func (*ApprovalHandler) GetConfig ¶
func (h *ApprovalHandler) GetConfig(c echo.Context) error
GetConfig returns the current approval configuration.
func (*ApprovalHandler) GetPending ¶
func (h *ApprovalHandler) GetPending(userID string) map[string]any
GetPending returns the most recent pending tool approval request for a user.
func (*ApprovalHandler) GetPendingByRun ¶
func (h *ApprovalHandler) GetPendingByRun(runID string) *PendingRequest
GetPendingByRun returns the first pending tool approval request for a harness run.
func (*ApprovalHandler) GetPendingBySession ¶
func (h *ApprovalHandler) GetPendingBySession(sessionID string) map[string]any
GetPendingBySession returns the most recent pending tool approval request for a session.
func (*ApprovalHandler) RegisterRoutes ¶
func (h *ApprovalHandler) RegisterRoutes(g *echo.Group)
RegisterRoutes registers approval endpoints on the given group.
func (*ApprovalHandler) Resolve ¶
func (h *ApprovalHandler) Resolve(c echo.Context) error
Resolve approves or denies a pending request. Falls back to the exec approval resolver if the request is not found locally.
func (*ApprovalHandler) SetExecResolver ¶
func (h *ApprovalHandler) SetExecResolver(r ExecApprovalResolver)
SetExecResolver wires the exec approval manager so that POST /approval/resolve can also resolve exec tool approvals.
func (*ApprovalHandler) SetObserver ¶
func (h *ApprovalHandler) SetObserver(observer tools.RuntimeEventObserver)
SetObserver wires lifecycle notifications for tool approval requests.
func (*ApprovalHandler) SetRiskScorer ¶
func (h *ApprovalHandler) SetRiskScorer(scorer ToolApprovalRiskScorer)
SetRiskScorer wires an optional context-aware scorer that can escalate ambiguous auto-approved tool calls into explicit approval requests.
func (*ApprovalHandler) UpdateConfig ¶
func (h *ApprovalHandler) UpdateConfig(c echo.Context) error
UpdateConfig replaces the approval configuration.
type CompatibilityResponse ¶
type CompatibilityResponse struct {
Providers map[string]ProviderCompatibility `json:"providers"`
}
CompatibilityResponse represents the tool compatibility response.
type ConvertToolsRequest ¶
type ConvertToolsRequest struct {
Provider string `json:"provider"`
Tools []adapters.Tool `json:"tools"`
}
ConvertToolsRequest represents the convert tools request.
type ExecApprovalResolveResult ¶
ExecApprovalResolveResult describes the outcome of resolving an exec approval.
type ExecApprovalResolver ¶
type ExecApprovalResolver interface {
ResolveApproval(id string, decision string, bindingHash string) ExecApprovalResolveResult
}
ExecApprovalResolver resolves exec-specific approval requests. Implemented by a wrapper around tools.ApprovalManager to avoid circular imports.
type FeaturesHandler ¶
type FeaturesHandler struct {
// contains filtered or unexported fields
}
FeaturesHandler handles feature gating API requests.
func NewFeaturesHandler ¶
func NewFeaturesHandler(gate *features.FeatureGate) *FeaturesHandler
NewFeaturesHandler creates a new features handler.
func (*FeaturesHandler) GetAllFeatures ¶
func (h *FeaturesHandler) GetAllFeatures(c echo.Context) error
GetAllFeatures returns all features and their status.
func (*FeaturesHandler) GetCLIDependentFeatures ¶
func (h *FeaturesHandler) GetCLIDependentFeatures(c echo.Context) error
GetCLIDependentFeatures returns features that require CLI.
func (*FeaturesHandler) GetFeature ¶
func (h *FeaturesHandler) GetFeature(c echo.Context) error
GetFeature returns information about a specific feature.
func (*FeaturesHandler) GetFeaturesByCategory ¶
func (h *FeaturesHandler) GetFeaturesByCategory(c echo.Context) error
GetFeaturesByCategory returns features grouped by category.
func (*FeaturesHandler) GetStatus ¶
func (h *FeaturesHandler) GetStatus(c echo.Context) error
GetStatus returns the overall feature status.
func (*FeaturesHandler) RegisterRoutes ¶
func (h *FeaturesHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers feature routes.
type GetStatsRequest ¶
type GetStatsRequest struct {
Period string `query:"period"` // hour, day, week, month, all
}
GetStatsRequest represents the get stats request.
type LinkPreviewHandler ¶
type LinkPreviewHandler struct {
// contains filtered or unexported fields
}
LinkPreviewHandler handles link preview API requests.
func NewLinkPreviewHandler ¶
func NewLinkPreviewHandler() *LinkPreviewHandler
NewLinkPreviewHandler creates a new link preview handler.
func (*LinkPreviewHandler) GetLinkPreview ¶
func (h *LinkPreviewHandler) GetLinkPreview(c echo.Context) error
GetLinkPreview fetches and returns metadata for a given URL. @Summary Get link preview @Description Fetches Open Graph and meta tags from a URL to generate a preview @Tags utils @Produce json @Param url query string true "URL to fetch preview for" @Success 200 {object} LinkPreviewResponse @Failure 400 {object} map[string]string @Failure 500 {object} map[string]string @Router /api/v1/link-preview [get]
func (*LinkPreviewHandler) RegisterRoutes ¶
func (h *LinkPreviewHandler) RegisterRoutes(g *echo.Group)
RegisterRoutes registers link preview routes.
type LinkPreviewResponse ¶
type LinkPreviewResponse struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Image string `json:"image,omitempty"`
Favicon string `json:"favicon,omitempty"`
SiteName string `json:"siteName,omitempty"`
URL string `json:"url"`
}
LinkPreviewResponse represents the link preview metadata.
type NetworkHandler ¶
type NetworkHandler struct {
// contains filtered or unexported fields
}
NetworkHandler handles network-related API requests.
func NewNetworkHandler ¶
func NewNetworkHandler(port int) *NetworkHandler
NewNetworkHandler creates a new network handler.
func (*NetworkHandler) GetAddresses ¶
func (h *NetworkHandler) GetAddresses(c echo.Context) error
GetAddresses returns all available network addresses. @Summary Get network addresses @Description Returns all available network addresses for accessing the application @Tags network @Produce json @Success 200 {object} network.NetworkAddresses @Router /api/v1/network/addresses [get]
func (*NetworkHandler) GetPreferred ¶
func (h *NetworkHandler) GetPreferred(c echo.Context) error
GetPreferred returns the preferred network address for sharing. @Summary Get preferred address @Description Returns the best network address for sharing with other devices @Tags network @Produce json @Success 200 {object} map[string]interface{} @Router /api/v1/network/preferred [get]
func (*NetworkHandler) GetStatus ¶
func (h *NetworkHandler) GetStatus(c echo.Context) error
GetStatus returns the network connectivity status. @Summary Get network status @Description Returns the network connectivity status @Tags network @Produce json @Success 200 {object} map[string]interface{} @Router /api/v1/network/status [get]
func (*NetworkHandler) InitializeCORSOrigins ¶
func (h *NetworkHandler) InitializeCORSOrigins() error
InitializeCORSOrigins detects local network addresses and adds them to CORS allowed origins. This should be called during server initialization.
func (*NetworkHandler) RegisterGroupRoutes ¶
func (h *NetworkHandler) RegisterGroupRoutes(g *echo.Group)
RegisterGroupRoutes registers network routes on an existing API group.
func (*NetworkHandler) RegisterRoutes ¶
func (h *NetworkHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers network routes.
type PendingRequest ¶
type PendingRequest struct {
ID string `json:"id"`
RunID string `json:"run_id,omitempty"`
StepIndex int `json:"step_index,omitempty"`
ToolName string `json:"tool_name"`
ToolCallID string `json:"tool_call_id"`
Arguments map[string]any `json:"arguments"`
SessionID string `json:"session_id,omitempty"`
RouteKind string `json:"route_kind,omitempty"`
Provider string `json:"provider,omitempty"`
ProviderID string `json:"provider_id,omitempty"`
Model string `json:"model,omitempty"`
AgentID string `json:"agent_id,omitempty"`
PolicySource string `json:"policy_source,omitempty"`
RiskLevel string `json:"risk_level,omitempty"`
BindingHash string `json:"binding_hash,omitempty"`
Purpose string `json:"purpose,omitempty"`
RiskSummary string `json:"risk_summary,omitempty"`
ScopeSummary string `json:"scope_summary,omitempty"`
ExpectedEffects string `json:"expected_effects,omitempty"`
AffectedTargets []string `json:"affected_targets,omitempty"`
CreatedAt string `json:"created_at"`
ExpiresAt int64 `json:"expires_at,omitempty"`
UserID string `json:"-"`
}
PendingRequest is a tool call waiting for user approval.
type ProviderCompatibility ¶
type ProviderCompatibility struct {
Name string `json:"name"`
ToolCalling string `json:"tool_calling"` // native, partial, none
AdapterType string `json:"adapter_type"` // native, ccnexus, cliproxy
Streaming bool `json:"streaming"`
Vision bool `json:"vision"`
MaxTokens int `json:"max_tokens"`
NeedsAdapter bool `json:"needs_adapter"`
}
ProviderCompatibility represents a provider's tool calling compatibility.
type RemoteAccessHandler ¶
type RemoteAccessHandler struct {
// contains filtered or unexported fields
}
RemoteAccessHandler handles remote access API requests.
func NewRemoteAccessHandler ¶
func NewRemoteAccessHandler(tm *ngrok.TunnelManager, serverPort int) *RemoteAccessHandler
NewRemoteAccessHandler creates a new remote access handler.
func NewRemoteAccessHandlerWithRepo ¶
func NewRemoteAccessHandlerWithRepo(tm *ngrok.TunnelManager, repo *ngrok.Repository, serverPort int) *RemoteAccessHandler
NewRemoteAccessHandlerWithRepo creates a new remote access handler with repository.
func (*RemoteAccessHandler) GetDiagnostics ¶
func (h *RemoteAccessHandler) GetDiagnostics(c echo.Context) error
GetDiagnostics returns diagnostic information for troubleshooting.
func (*RemoteAccessHandler) GetNgrokStatus ¶
func (h *RemoteAccessHandler) GetNgrokStatus(c echo.Context) error
GetNgrokStatus returns the ngrok installation status (from PATH).
func (*RemoteAccessHandler) GetQRCode ¶
func (h *RemoteAccessHandler) GetQRCode(c echo.Context) error
GetQRCode returns the raw QR payload for the current tunnel URL.
func (*RemoteAccessHandler) GetRemoteAccessConfig ¶
func (h *RemoteAccessHandler) GetRemoteAccessConfig(c echo.Context) error
GetRemoteAccessConfig returns the remote access configuration.
func (*RemoteAccessHandler) GetRemoteAccessLogs ¶
func (h *RemoteAccessHandler) GetRemoteAccessLogs(c echo.Context) error
GetRemoteAccessLogs returns the remote access logs.
func (*RemoteAccessHandler) GetRemoteAccessStatus ¶
func (h *RemoteAccessHandler) GetRemoteAccessStatus(c echo.Context) error
GetRemoteAccessStatus returns the current remote access status.
func (*RemoteAccessHandler) RegisterGroupRoutes ¶
func (h *RemoteAccessHandler) RegisterGroupRoutes(g *echo.Group)
RegisterGroupRoutes registers remote access routes on an existing API group.
func (*RemoteAccessHandler) RegisterRoutes ¶
func (h *RemoteAccessHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers remote access routes.
func (*RemoteAccessHandler) StartRemoteAccess ¶
func (h *RemoteAccessHandler) StartRemoteAccess(c echo.Context) error
StartRemoteAccess starts the remote access tunnel.
func (*RemoteAccessHandler) StopRemoteAccess ¶
func (h *RemoteAccessHandler) StopRemoteAccess(c echo.Context) error
StopRemoteAccess stops the remote access tunnel.
func (*RemoteAccessHandler) UpdateRemoteAccessConfig ¶
func (h *RemoteAccessHandler) UpdateRemoteAccessConfig(c echo.Context) error
UpdateRemoteAccessConfig updates the remote access configuration.
type SDKRemoteAccessHandler ¶
type SDKRemoteAccessHandler struct {
// contains filtered or unexported fields
}
SDKRemoteAccessHandler handles remote access API requests using SDK tunnel manager.
func NewSDKRemoteAccessHandler ¶
func NewSDKRemoteAccessHandler(tm *ngrok.SDKTunnelManager, configProvider ngrok.ConfigProvider, serverPort int) *SDKRemoteAccessHandler
NewSDKRemoteAccessHandler creates a new SDK-based remote access handler.
func (*SDKRemoteAccessHandler) GetDiagnostics ¶
func (h *SDKRemoteAccessHandler) GetDiagnostics(c echo.Context) error
GetDiagnostics returns diagnostic information for troubleshooting.
func (*SDKRemoteAccessHandler) GetQRCode ¶
func (h *SDKRemoteAccessHandler) GetQRCode(c echo.Context) error
GetQRCode returns the raw QR payload for the tunnel URL with embedded auth token.
func (*SDKRemoteAccessHandler) GetRemoteAccessConfig ¶
func (h *SDKRemoteAccessHandler) GetRemoteAccessConfig(c echo.Context) error
GetRemoteAccessConfig returns the remote access configuration.
func (*SDKRemoteAccessHandler) GetRemoteAccessLogs ¶
func (h *SDKRemoteAccessHandler) GetRemoteAccessLogs(c echo.Context) error
GetRemoteAccessLogs returns the remote access logs.
func (*SDKRemoteAccessHandler) GetRemoteAccessStatus ¶
func (h *SDKRemoteAccessHandler) GetRemoteAccessStatus(c echo.Context) error
GetRemoteAccessStatus returns the current tunnel status.
func (*SDKRemoteAccessHandler) RegisterGroupRoutes ¶
func (h *SDKRemoteAccessHandler) RegisterGroupRoutes(g *echo.Group)
RegisterGroupRoutes registers remote access routes on an existing API group.
func (*SDKRemoteAccessHandler) RegisterRoutes ¶
func (h *SDKRemoteAccessHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers remote access routes.
func (*SDKRemoteAccessHandler) SetJWTService ¶
func (h *SDKRemoteAccessHandler) SetJWTService(jwt *auth.JWTService)
SetJWTService sets the JWT service for generating access tokens in QR codes.
func (*SDKRemoteAccessHandler) StartRemoteAccess ¶
func (h *SDKRemoteAccessHandler) StartRemoteAccess(c echo.Context) error
StartRemoteAccess starts the remote access tunnel.
func (*SDKRemoteAccessHandler) StopRemoteAccess ¶
func (h *SDKRemoteAccessHandler) StopRemoteAccess(c echo.Context) error
StopRemoteAccess stops the remote access tunnel.
func (*SDKRemoteAccessHandler) UpdateRemoteAccessConfig ¶
func (h *SDKRemoteAccessHandler) UpdateRemoteAccessConfig(c echo.Context) error
UpdateRemoteAccessConfig updates the remote access configuration.
type SetConsentRequest ¶
type SetConsentRequest struct {
Consented bool `json:"consented"`
ClearData bool `json:"clear_data,omitempty"` // Only used when revoking consent
}
SetConsentRequest represents the set consent request.
type StartRemoteAccessRequest ¶
type StartRemoteAccessRequest struct {
Port int `json:"port"`
Authtoken string `json:"authtoken,omitempty"`
}
StartRemoteAccessRequest represents the start remote access request.
type StartTunnelRequest ¶
type StartTunnelRequest struct {
Provider string `json:"provider"`
Port int `json:"port"`
NgrokAuthtoken string `json:"ngrok_authtoken,omitempty"`
NgrokDomain string `json:"ngrok_domain,omitempty"`
CloudflareToken string `json:"cloudflare_token,omitempty"`
}
StartTunnelRequest represents the start tunnel request.
type StatsHandler ¶
type StatsHandler struct {
// contains filtered or unexported fields
}
StatsHandler handles statistics API requests.
func NewStatsHandler ¶
func NewStatsHandler(collector *stats.StatisticsCollector, consentManager *stats.ConsentManager) *StatsHandler
NewStatsHandler creates a new stats handler.
func (*StatsHandler) ClearStats ¶
func (h *StatsHandler) ClearStats(c echo.Context) error
ClearStats clears all statistics.
func (*StatsHandler) ExportStats ¶
func (h *StatsHandler) ExportStats(c echo.Context) error
ExportStats exports statistics data.
func (*StatsHandler) GetConsentInfo ¶
func (h *StatsHandler) GetConsentInfo(c echo.Context) error
GetConsentInfo returns information about what data is collected.
func (*StatsHandler) GetConsentStatus ¶
func (h *StatsHandler) GetConsentStatus(c echo.Context) error
GetConsentStatus returns the current consent status.
func (*StatsHandler) GetRecentEvents ¶
func (h *StatsHandler) GetRecentEvents(c echo.Context) error
GetRecentEvents returns recent API call events.
func (*StatsHandler) GetStats ¶
func (h *StatsHandler) GetStats(c echo.Context) error
GetStats returns usage statistics.
func (*StatsHandler) RegisterRoutes ¶
func (h *StatsHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers statistics routes.
func (*StatsHandler) SetConsentStatus ¶
func (h *StatsHandler) SetConsentStatus(c echo.Context) error
SetConsentStatus sets the consent status.
type TestToolCallingRequest ¶
type TestToolCallingRequest struct {
Provider string `json:"provider"`
Model string `json:"model,omitempty"`
}
TestToolCallingRequest represents the test tool calling request.
type TestToolCallingResponse ¶
type TestToolCallingResponse struct {
Success bool `json:"success"`
Provider string `json:"provider"`
Model string `json:"model,omitempty"`
ToolCalling string `json:"tool_calling"`
AdapterUsed string `json:"adapter_used"`
TestResult string `json:"test_result"`
ErrorMessage string `json:"error_message,omitempty"`
LatencyMs int64 `json:"latency_ms"`
}
TestToolCallingResponse represents the test tool calling response.
type ToolApprovalRiskScore ¶
type ToolApprovalRiskScore struct {
Score float64 `json:"score"`
Confidence float64 `json:"confidence"`
RiskLevel string `json:"risk_level"`
RecommendedMode string `json:"recommended_mode"`
Reason string `json:"reason"`
Signals []string `json:"signals,omitempty"`
}
ToolApprovalRiskScore captures a context-aware approval recommendation for a tool call. The scorer is advisory: hard-coded deny/ask policies still win.
type ToolApprovalRiskScorer ¶
type ToolApprovalRiskScorer interface {
ScoreToolApproval(ctx context.Context, req tools.ToolApprovalRequest) (*ToolApprovalRiskScore, error)
}
ToolApprovalRiskScorer evaluates whether an otherwise auto-approved tool call should be escalated into an explicit user approval request.
func NewLLMToolApprovalRiskScorer ¶
func NewLLMToolApprovalRiskScorer(caller llm.Provider, registry *tools.Registry) ToolApprovalRiskScorer
NewLLMToolApprovalRiskScorer creates a best-effort scorer that uses the auxiliary LLM path to classify ambiguous tool calls. Returning nil keeps the runtime on static approval rules only.
type ToolsHandler ¶
type ToolsHandler struct {
// contains filtered or unexported fields
}
ToolsHandler handles tool calling API requests.
func NewToolsHandler ¶
func NewToolsHandler(router *adapters.CapabilityRouter) *ToolsHandler
NewToolsHandler creates a new tools handler.
func (*ToolsHandler) ConvertTools ¶
func (h *ToolsHandler) ConvertTools(c echo.Context) error
ConvertTools converts tools to the appropriate format for a provider.
func (*ToolsHandler) GetAllCapabilities ¶
func (h *ToolsHandler) GetAllCapabilities(c echo.Context) error
GetAllCapabilities returns capabilities for all known providers.
func (*ToolsHandler) GetCompatibility ¶
func (h *ToolsHandler) GetCompatibility(c echo.Context) error
GetCompatibility returns tool calling compatibility for all providers.
func (*ToolsHandler) GetProviderCapabilities ¶
func (h *ToolsHandler) GetProviderCapabilities(c echo.Context) error
GetProviderCapabilities returns capabilities for a specific provider.
func (*ToolsHandler) RegisterRoutes ¶
func (h *ToolsHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers tool calling routes.
func (*ToolsHandler) TestToolCalling ¶
func (h *ToolsHandler) TestToolCalling(c echo.Context) error
TestToolCalling tests tool calling with a specific provider.
type TunnelHandler ¶
type TunnelHandler struct {
// contains filtered or unexported fields
}
TunnelHandler handles remote access API requests with multiple provider support.
func NewTunnelHandler ¶
func NewTunnelHandler(configProvider ngrok.ConfigProvider, serverPort int) *TunnelHandler
NewTunnelHandler creates a new tunnel handler with multiple provider support.
func (*TunnelHandler) EnsureTunnelURL ¶
func (h *TunnelHandler) EnsureTunnelURL(ctx context.Context) (string, error)
EnsureTunnelURL reuses the active tunnel when possible and otherwise starts the saved default provider so callers can build authenticated QR flows.
func (*TunnelHandler) GetDiagnostics ¶
func (h *TunnelHandler) GetDiagnostics(c echo.Context) error
GetDiagnostics returns diagnostic information.
func (*TunnelHandler) GetProviders ¶
func (h *TunnelHandler) GetProviders(c echo.Context) error
GetProviders returns available tunnel providers.
func (*TunnelHandler) GetQRCode ¶
func (h *TunnelHandler) GetQRCode(c echo.Context) error
GetQRCode returns the raw QR payload for the tunnel URL.
func (*TunnelHandler) GetTunnelConfig ¶
func (h *TunnelHandler) GetTunnelConfig(c echo.Context) error
GetTunnelConfig returns the tunnel configuration.
func (*TunnelHandler) GetTunnelLogs ¶
func (h *TunnelHandler) GetTunnelLogs(c echo.Context) error
GetTunnelLogs returns the tunnel logs.
func (*TunnelHandler) GetTunnelStatus ¶
func (h *TunnelHandler) GetTunnelStatus(c echo.Context) error
GetTunnelStatus returns the current tunnel status.
func (*TunnelHandler) RegisterGroupRoutes ¶
func (h *TunnelHandler) RegisterGroupRoutes(g *echo.Group)
RegisterGroupRoutes registers tunnel routes on an existing API group.
func (*TunnelHandler) RegisterRoutes ¶
func (h *TunnelHandler) RegisterRoutes(e *echo.Echo)
RegisterRoutes registers tunnel routes.
func (*TunnelHandler) SetJWTService ¶
func (h *TunnelHandler) SetJWTService(jwt *auth.JWTService)
SetJWTService sets the JWT service for generating access tokens in QR codes.
func (*TunnelHandler) StartTunnel ¶
func (h *TunnelHandler) StartTunnel(c echo.Context) error
StartTunnel starts the tunnel with the specified provider.
func (*TunnelHandler) StopTunnel ¶
func (h *TunnelHandler) StopTunnel(c echo.Context) error
StopTunnel stops the active tunnel.
func (*TunnelHandler) UpdateTunnelConfig ¶
func (h *TunnelHandler) UpdateTunnelConfig(c echo.Context) error
UpdateTunnelConfig updates the tunnel configuration.
type UpdateRemoteAccessConfigRequest ¶
type UpdateRemoteAccessConfigRequest struct {
Enabled bool `json:"enabled"`
NgrokAuthtoken string `json:"ngrok_authtoken,omitempty"`
NotificationEmail string `json:"notification_email,omitempty"`
NotifyOnURLChange bool `json:"notify_on_url_change"`
NotifyOnExpiryWarning bool `json:"notify_on_expiry_warning"`
NotifyOnError bool `json:"notify_on_error"`
}
UpdateRemoteAccessConfigRequest represents the update config request.