feat: 自动更新

This commit is contained in:
npc0-hue
2026-07-15 19:43:06 +08:00
parent f64eb0831f
commit f3b14b7945
54 changed files with 3207 additions and 589 deletions
@@ -0,0 +1,35 @@
## MODIFIED Requirements
### Requirement: AI provider management preserves secret boundaries
AI provider management SHALL reject raw key material in request fields and SHALL never expose raw API keys in API responses or frontend-visible types.
#### Scenario: Raw key is submitted during update
- **WHEN** a create or update request includes raw key material instead of a secret reference in `apiKeyRef`
- **THEN** the platform MUST reject the request with a validation error and MUST NOT persist the provider
#### Scenario: Provider is returned to UI
- **WHEN** the backend or frontend API client returns provider data
- **THEN** the response/type MUST include `apiKeyRef` only and MUST NOT include `apiKey`, `rawApiKey`, or equivalent raw credential fields
#### Scenario: Provider management route is accessed without platform admin
- **WHEN** a client creates, lists, reads, updates, tests, changes status, or lists models for AI providers without a platform administrator bearer session
- **THEN** the platform MUST reject the request with a stable JSON authorization error
### Requirement: AI provider console page is functional
The management console SHALL provide a functional operational view for configured providers while keeping normal setup focused on provider kind and platform-owned secret references.
#### Scenario: Operator opens AI provider page
- **WHEN** the AI provider page renders
- **THEN** it MUST show provider counts, status distribution, configured model counts, and a provider table
#### Scenario: Operator creates provider from normal form
- **WHEN** an operator creates a provider through the normal form
- **THEN** the page MUST generate the provider ID and apply provider-specific defaults for Base URL, model list, relay mode, timeout, and redaction policy before submitting named API requests
#### Scenario: Operator edits advanced provider metadata
- **WHEN** an operator opens advanced settings
- **THEN** the page MAY allow editing Base URL, model list, default model, relay mode, timeout, and redaction policy without requiring the operator to manually edit the provider ID
#### Scenario: Operator uses provider actions
- **WHEN** an operator triggers enable/disable, test, or model-list actions
- **THEN** the page MUST call the matching API client methods and display the redacted result state
@@ -0,0 +1,12 @@
## MODIFIED Requirements
### Requirement: Uploaded backgrounds remain readable and restrained
The platform_web theme system SHALL preserve uploaded background visibility while keeping operational surfaces readable and avoiding harsh high-saturation overlays.
#### Scenario: Magical-girl theme uses a custom background
- **WHEN** `data-custom-background="true"` and `data-theme-palette="magical-girl"` are active
- **THEN** shared operational surfaces MUST use restrained translucent materials, muted frame accessories, and reduced glow so the background does not become visually harsh
#### Scenario: Custom background theme styling changes
- **WHEN** custom-background shared CSS is modified
- **THEN** CSS contract tests or theme documentation MUST cover the intended restraint so future changes do not reintroduce excessive pink/gold gradients