rule

package
v1.261105.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MPL-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateRuleRequest

type CreateRuleRequest typ.Rule

CreateRuleRequest represents the request to create a rule

type DeleteRuleResponse

type DeleteRuleResponse struct {
	Success bool   `json:"success" example:"true"`
	Message string `json:"message" example:"Rule deleted successfully"`
}

DeleteRuleResponse represents the response for deleting a rule

type FlagRegistryResponse added in v0.260531.1

type FlagRegistryResponse struct {
	Success bool           `json:"success" example:"true"`
	Data    []typ.FlagSpec `json:"data"`
}

FlagRegistryResponse exposes the catalog of supported rule-level flags so the UI can render an extension catalog without hard-coding the list.

type Handler

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

Handler handles rule HTTP requests

func NewHandler

func NewHandler(cfg *config.Config) *Handler

NewHandler creates a new rule handler

func (*Handler) CreateRule

func (h *Handler) CreateRule(c *gin.Context)

CreateRule creates a new rule

func (*Handler) DeleteRule

func (h *Handler) DeleteRule(c *gin.Context)

DeleteRule deletes a rule

func (*Handler) GetFlagRegistry added in v0.260531.1

func (h *Handler) GetFlagRegistry(c *gin.Context)

GetFlagRegistry returns the catalog of supported rule-level flags.

func (*Handler) GetRule

func (h *Handler) GetRule(c *gin.Context)

GetRule returns a specific rule by UUID

func (*Handler) GetRules

func (h *Handler) GetRules(c *gin.Context)

GetRules returns all rules, filtered by scenario

func (*Handler) RegisterRoutes added in v1.261002.1

func (h *Handler) RegisterRoutes(rt *module.Routes)

func (*Handler) UpdateRule

func (h *Handler) UpdateRule(c *gin.Context)

UpdateRule creates or updates a rule

type RuleResponse

type RuleResponse struct {
	Success bool      `json:"success" example:"true"`
	Data    *typ.Rule `json:"data"`
}

RuleResponse represents a rule configuration response

type RulesResponse

type RulesResponse struct {
	Success bool        `json:"success" example:"true"`
	Data    interface{} `json:"data"`
}

RulesResponse represents the response for getting all rules

type UpdateRuleRequest

type UpdateRuleRequest typ.Rule

UpdateRuleRequest represents the request to set/update a rule

type UpdateRuleResponse

type UpdateRuleResponse struct {
	Success bool   `json:"success" example:"true"`
	Message string `json:"message" example:"Rule saved successfully"`
	Data    struct {
		UUID          string                      `json:"uuid"`
		Scenario      string                      `json:"scenario" example:"openai"`
		RequestModel  string                      `json:"request_model" example:"gpt-3.5-turbo"`
		ResponseModel string                      `json:"response_model" example:"gpt-3.5-turbo"`
		Description   string                      `json:"description" example:"My rule description"`
		Provider      string                      `json:"provider" example:"openai"`
		DefaultModel  string                      `json:"default_model" example:"gpt-3.5-turbo"`
		Active        bool                        `json:"active" example:"true"`
		SmartEnabled  bool                        `json:"smart_enabled" example:"false"`
		SmartRouting  []smartrouting.SmartRouting `json:"smart_routing,omitempty"`
		// Flags echoes the rule's persisted feature flags. Creation seeds
		// per-scenario defaults (e.g. team rules get claude_code_compat +
		// clean_header), so the client must read them back from here to reflect
		// the true stored state without a follow-up refresh.
		Flags typ.RuleFlags `json:"flags,omitempty"`
	} `json:"data"`
}

UpdateRuleResponse represents the response for setting/updating a rule

Jump to

Keyboard shortcuts

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