feat: 添加视觉设计语言系统并重构认证页面UI

- 新增 visual_design_language.md 设计规范文档
- 新增 auth 设计 tokens (authBackground, authCard, authInput, feedback 系列等)
- 重构登录/注册/验证码/重置密码页面为新设计系统
- 新增 AuthHeroHeader, AuthSurfaceCard, AuthSection, AuthField, PasswordField 组件
- 重构 AppBanner 和 Toast 支持多类型配置 (info/success/warning/error)
- 后端 AgentScope: 重整 schemas/prompts/tools 作用域, 新增协议文档
- 更新 AGENTS.md 集成视觉设计语言约束
This commit is contained in:
qzl
2026-03-13 14:10:13 +08:00
parent fb3c649db7
commit a10a2db27a
100 changed files with 6333 additions and 4800 deletions
+69
View File
@@ -0,0 +1,69 @@
# Agent Chat Messages Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
Chat messages in agent conversations with metadata for tracking and telemetry.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Message Metadata
```typescript
interface AgentChatMessageMetadata {
run_id?: string; // Unique run identifier
stage?: string; // Processing stage (e.g., "intent", "execution")
latency_ms?: number; // Processing latency in milliseconds
message_id?: string; // Message identifier
[key: string]: any; // Additional custom fields allowed
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| metadata | jsonb | Message metadata including run_id, stage, latency_ms, message_id |
---
## JSON Examples
### Basic Message Metadata
```json
{
"run_id": "run_1773286460762"
}
```
### Stage Completion Metadata
```json
{
"run_id": "run_1773286460762",
"stage": "intent",
"latency_ms": 2610,
"message_id": "intent-run_1773286460762"
}
```
### Tool Execution Metadata
```json
{
"run_id": "run_1773287162123",
"stage": "tool_execution",
"latency_ms": 1500,
"message_id": "tool_run_abc123",
"tool_name": "calendar_create_event"
}
```
+59
View File
@@ -0,0 +1,59 @@
# Agent Chat Sessions Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
Agent chat session state snapshot for preserving conversation context.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Session State Snapshot
```typescript
interface SessionStateSnapshot {
// Reserved for future use
// Currently unused, allowing custom extensions
[key: string]: any;
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| state_snapshot | jsonb | Session state for preserving conversation context |
---
## JSON Examples
### Empty State
```json
{}
```
### Future Usage Example
```json
{
"conversation_context": {
"last_topic": "calendar_events",
"mentioned_dates": ["2026-03-15", "2026-03-20"]
},
"agent_memory": {
"user_preferences": {
"timezone": "Asia/Shanghai",
"language": "zh-CN"
}
}
}
```
+130
View File
@@ -0,0 +1,130 @@
# Inbox Messages Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
Inbox messages are notifications sent to users for various events like friend requests and calendar invites.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Message Types
```typescript
type InboxMessageType = 'friend_request' | 'calendar' | 'system' | 'group';
```
```typescript
type InboxMessageStatus = 'pending' | 'accepted' | 'rejected' | 'dismissed';
```
---
## Content Schema
### Calendar Invite Content
```typescript
interface CalendarInviteContent {
type: 'invite';
permission: number; // 1=view, 4=edit, 8=invite
action: 'pending';
}
```
### Calendar Update Content
```typescript
interface CalendarUpdateContent {
type: 'update';
title: string;
action: 'updated';
}
```
### Calendar Delete Content
```typescript
interface CalendarDeleteContent {
type: 'delete';
title: string;
action: 'deleted';
}
```
### Friendship Request Content
```typescript
interface FriendshipContent {
type: 'request';
message?: string; // Optional friend request message
}
```
---
## Union Type
```typescript
type InboxMessageContent =
| CalendarInviteContent
| CalendarUpdateContent
| CalendarDeleteContent
| FriendshipContent;
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| content | jsonb | Structured content based on message_type |
---
## JSON Examples
### Friend Request
```json
{
"type": "request",
"message": "Hi, let's be friends!"
}
```
### Calendar Invite
```json
{
"type": "invite",
"permission": 4,
"action": "pending"
}
```
### Calendar Update
```json
{
"type": "update",
"title": "Team Meeting",
"action": "updated"
}
```
### Calendar Delete
```json
{
"type": "delete",
"title": "Team Meeting",
"action": "deleted"
}
```
+53
View File
@@ -0,0 +1,53 @@
# Invite Codes Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
Invite codes for referral system with reward configuration.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Reward Configuration
```typescript
interface InviteCodeRewardConfig {
// Reserved for future use
// Currently unused, allowing custom extensions
[key: string]: any;
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| reward_config | jsonb | Reward configuration for invite codes |
---
## JSON Examples
### Empty Config
```json
{}
```
### Future Usage Example
```json
{
"reward_type": "credits",
"reward_amount": 100,
"currency": "USD",
"max_rewards_per_user": 5
}
```
+66
View File
@@ -0,0 +1,66 @@
# Memories Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
User memories stored in the system with flexible content structure.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Memory Content
```typescript
interface MemoryContent {
// Reserved for future use
// Currently unused, allowing custom extensions
[key: string]: any;
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| content | jsonb | Memory content with flexible structure |
---
## JSON Examples
### Empty Content
```json
{}
```
### Future Usage Example
```json
{
"text": "Remember that user prefers morning meetings",
"category": "preference",
"importance": "high",
"tags": ["meetings", "morning", "preference"]
}
```
### Agent Memory Example
```json
{
"summary": "User discussed vacation plans for March",
"entities": {
"dates": ["2026-03-15", "2026-03-20"],
"locations": ["Tokyo", "Osaka"]
},
"sentiment": "positive"
}
```
+88
View File
@@ -0,0 +1,88 @@
# Profiles Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
User profile settings with privacy and notification preferences.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Preference Settings
### Privacy
```typescript
interface PrivacySettings {
show_email?: boolean;
show_online_status?: boolean;
}
```
### Notification
```typescript
interface NotificationSettings {
friend_request?: boolean;
calendar_invite?: boolean;
calendar_update?: boolean;
calendar_delete?: boolean;
system_message?: boolean;
}
```
---
## Profile Settings V1
```typescript
interface ProfileSettingsV1 {
privacy?: PrivacySettings;
notification?: NotificationSettings;
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| settings | jsonb | User preferences including privacy and notification settings |
---
## JSON Examples
### Default Settings
```json
{
"privacy": {
"show_email": false,
"show_online_status": true
},
"notification": {
"friend_request": true,
"calendar_invite": true,
"calendar_update": true,
"calendar_delete": true,
"system_message": true
}
}
```
### Minimal Settings
```json
{
"notification": {
"friend_request": false
}
}
```
+106
View File
@@ -0,0 +1,106 @@
# Schedule Items Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
Schedule items represent calendar events with metadata, attachments, and sharing capabilities.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## Status
```typescript
type ScheduleItemStatus = 'active' | 'completed' | 'canceled' | 'archived';
```
## Source Type
```typescript
type ScheduleItemSourceType = 'manual' | 'imported' | 'agent_generated';
```
---
## Metadata Schema
### Attachment Type
```typescript
type AttachmentType = 'document' | 'reminder';
```
### Attachment
```typescript
interface ScheduleItemMetadataAttachment {
name: string;
type: AttachmentType;
visible_to: string[]; // UUIDs
url?: string;
note?: string;
content?: string;
}
```
### Metadata
```typescript
interface ScheduleItemMetadata {
color?: string; // "#RRGGBB" format
location?: string;
notes?: string;
attachments?: ScheduleItemMetadataAttachment[];
reminder_minutes?: number; // 0-10080 (0 to 7 days)
version: 1;
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| metadata | jsonb | Structured metadata including color, location, notes, attachments, reminders |
---
## JSON Examples
### Basic Metadata
```json
{
"color": "#3B82F6",
"location": "Conference Room A",
"notes": "Bring presentation slides",
"reminder_minutes": 15,
"version": 1
}
```
### With Attachment
```json
{
"color": "#10B981",
"location": "https://meet.example.com/abc123",
"notes": "Weekly sync meeting",
"attachments": [
{
"name": "agenda.pdf",
"type": "document",
"url": "https://storage.example.com/agenda.pdf",
"visible_to": ["uuid1", "uuid2"]
}
],
"reminder_minutes": 30,
"version": 1
}
```
+66
View File
@@ -0,0 +1,66 @@
# System Agents Protocol
> **NOTE**: This document is the single source of truth. All implementations must follow this specification.
## Overview
System agent configuration for LLM parameters.
## Version
- **Current**: `1.0`
- **Status**: Active
---
## LLM Configuration
```typescript
interface SystemAgentLLMConfig {
temperature?: number; // 0.0 - 2.0
max_tokens?: number; // >= 1
timeout_seconds?: number; // > 0, <= 300, default 30
}
```
---
## Database Field
| Field | Type | Description |
|-------|------|-------------|
| config | jsonb | LLM configuration including temperature, max_tokens, timeout |
---
## JSON Examples
### Default Configuration
```json
{
"temperature": 0.7,
"max_tokens": null,
"timeout_seconds": 30
}
```
### Creative Configuration
```json
{
"temperature": 1.2,
"max_tokens": 2000,
"timeout_seconds": 60
}
```
### Precise Configuration
```json
{
"temperature": 0.1,
"max_tokens": 500,
"timeout_seconds": 30
}
```