feat(ui): add ai settings web interface for repos and orgs
Add comprehensive web UI for configuring AI features at repository and organization levels, completing the activation workflow for AI operations. Repository AI Settings (repo/settings/ai): - Enable/disable AI unit for the repository - Toggle Tier 1 operations (auto-respond, auto-review, auto-triage, workflow inspection) - Configure Tier 2 agent mode with trigger labels and runtime limits - Set escalation rules (label, team assignment) - Override provider/model preferences - Add custom instructions for different operation types Organization AI Settings (org/settings/ai): - Configure org-level AI provider and model - Set encrypted API key (with masked display) - Define rate limits (max operations per hour) - Whitelist allowed operations - Enable/disable agent mode for org repositories Both interfaces include proper permission checks, form validation, and cascade resolution display (showing inherited vs. overridden values). Adds navigation entries to settings sidebars and full i18n support.
This commit is contained in:
@@ -187,21 +187,31 @@ type SummarizeChangesResponse struct {
|
||||
ImpactAssessment string `json:"impact_assessment"`
|
||||
}
|
||||
|
||||
// IssueComment represents a comment on an issue for AI context
|
||||
type IssueComment struct {
|
||||
Author string `json:"author"`
|
||||
Body string `json:"body"`
|
||||
CreatedAt string `json:"created_at,omitempty"`
|
||||
}
|
||||
|
||||
// GenerateIssueResponseRequest is the request for generating an AI response to an issue
|
||||
type GenerateIssueResponseRequest struct {
|
||||
RepoID int64 `json:"repo_id"`
|
||||
IssueID int64 `json:"issue_id"`
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
CustomInstructions string `json:"custom_instructions,omitempty"`
|
||||
RepoID int64 `json:"repo_id"`
|
||||
IssueID int64 `json:"issue_id"`
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
Comments []IssueComment `json:"comments,omitempty"`
|
||||
ResponseType string `json:"response_type,omitempty"` // clarification, solution, acknowledgment
|
||||
CustomInstructions string `json:"custom_instructions,omitempty"`
|
||||
}
|
||||
|
||||
// GenerateIssueResponseResponse is the response from generating an issue response
|
||||
type GenerateIssueResponseResponse struct {
|
||||
Response string `json:"response"`
|
||||
Confidence float64 `json:"confidence"`
|
||||
InputTokens int `json:"input_tokens"`
|
||||
OutputTokens int `json:"output_tokens"`
|
||||
Response string `json:"response"`
|
||||
FollowUpQuestions []string `json:"follow_up_questions,omitempty"`
|
||||
Confidence float64 `json:"confidence"`
|
||||
InputTokens int `json:"input_tokens"`
|
||||
OutputTokens int `json:"output_tokens"`
|
||||
}
|
||||
|
||||
// HealthCheckResponse is the response from a health check
|
||||
|
||||
Reference in New Issue
Block a user