feat: Finalize VitePress site structure and styling

This commit is contained in:
tycon
2025-10-11 23:05:08 +08:00
parent 86777756b4
commit bca5292f1f
4460 changed files with 1059060 additions and 9046 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,47 @@
# Leap AI 工具总结
Leap AI 提供了以下核心工具来构建全栈应用程序:
1. **create_artifact** - 创建包含所有项目文件的综合工件
- 用于使用 Encore.ts 后端和 React 前端构建全栈应用程序
- 支持创建、修改、删除和移动文件操作
2. **define_backend_service** - 定义 Encore.ts 后端服务
- 定义具有适当结构的后端服务
- 支持定义 API 端点和数据库配置
3. **create_react_component** - 创建 React 组件
- 创建带有 TypeScript 和 Tailwind CSS 的 React 组件
- 支持组件属性定义和后端 API 调用
4. **setup_authentication** - 设置身份验证
- 使用 Clerk 为后端和前端设置身份验证
- 支持受保护路由配置
5. **create_database_migration** - 创建数据库迁移
- 为 Encore.ts 数据库创建新的 SQL 迁移文件
- 支持多种数据库操作类型
6. **setup_streaming_api** - 设置流式 API
- 为实时通信设置流式 API
- 支持三种流式 API 类型
7. **configure_secrets** - 配置密钥管理
- 为 API 密钥和敏感数据配置密钥管理
- 支持密钥描述和必需性标记
8. **setup_object_storage** - 设置对象存储
- 为文件上传设置对象存储桶
- 支持公共访问和版本控制配置
9. **setup_pubsub** - 设置发布/订阅
- 为事件驱动架构设置 Pub/Sub 主题和订阅
- 支持消息传递保证配置
10. **create_test_suite** - 创建测试套件
- 使用 Vitest 为后端和前端创建测试套件
- 支持多种测试类型
## tools.json
```json
@@ -5,21 +49,21 @@
"tools": [
{
"name": "create_artifact",
"description": "Creates a comprehensive artifact containing all project files for building full-stack applications with Encore.ts backend and React frontend",
"description": "创建包含所有项目文件的综合工件,用于使用 Encore.ts 后端和 React 前端构建全栈应用程序",
"parameters": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Descriptive identifier for the project in snake-case (e.g., 'todo-app', 'blog-platform')"
"description": "项目的描述性标识符,使用蛇形命名法(例如,'todo-app', 'blog-platform'"
},
"title": {
"type": "string",
"description": "Human-readable title for the project (e.g., 'Todo App', 'Blog Platform')"
"description": "项目的可读标题(例如,'Todo App', 'Blog Platform'"
},
"commit": {
"type": "string",
"description": "Brief description of changes in 3-10 words max"
"description": "更改的简短描述,最多 3-10 个单词"
},
"files": {
"type": "array",
@@ -28,11 +72,11 @@
"properties": {
"path": {
"type": "string",
"description": "Relative file path from project root"
"description": "相对于项目根目录的文件路径"
},
"content": {
"type": "string",
"description": "Complete file content - NEVER use placeholders or truncation"
"description": "完整的文件内容 - 永远不要使用占位符或截断"
},
"action": {
"type": "string",
@@ -42,15 +86,15 @@
"delete",
"move"
],
"description": "Action to perform on the file"
"description": "要对文件执行的操作"
},
"from": {
"type": "string",
"description": "Source path for move operations"
"description": "移动操作的源路径"
},
"to": {
"type": "string",
"description": "Target path for move operations"
"description": "移动操作的目标路径"
}
},
"required": [
@@ -70,13 +114,13 @@
},
{
"name": "define_backend_service",
"description": "Defines an Encore.ts backend service with proper structure",
"description": "定义具有适当结构的 Encore.ts 后端服务",
"parameters": {
"type": "object",
"properties": {
"serviceName": {
"type": "string",
"description": "Name of the backend service"
"description": "后端服务的名称"
},
"endpoints": {
"type": "array",
@@ -85,7 +129,7 @@
"properties": {
"name": {
"type": "string",
"description": "Unique endpoint name"
"description": "唯一的端点名称"
},
"method": {
"type": "string",
@@ -96,19 +140,19 @@
"DELETE",
"PATCH"
],
"description": "HTTP method"
"description": "HTTP 方法"
},
"path": {
"type": "string",
"description": "API path with parameters (e.g., '/users/:id')"
"description": "带参数的 API 路径(例如,'/users/:id'"
},
"expose": {
"type": "boolean",
"description": "Whether endpoint is publicly accessible"
"description": "端点是否公开可访问"
},
"auth": {
"type": "boolean",
"description": "Whether endpoint requires authentication"
"description": "端点是否需要身份验证"
}
},
"required": [
@@ -123,7 +167,7 @@
"properties": {
"name": {
"type": "string",
"description": "Database name"
"description": "数据库名称"
},
"tables": {
"type": "array",
@@ -132,7 +176,7 @@
"properties": {
"name": {
"type": "string",
"description": "Table name"
"description": "表名"
},
"columns": {
"type": "array",
@@ -172,17 +216,17 @@
},
{
"name": "create_react_component",
"description": "Creates a React component with TypeScript and Tailwind CSS",
"description": "创建带有 TypeScript Tailwind CSS 的 React 组件",
"parameters": {
"type": "object",
"properties": {
"componentName": {
"type": "string",
"description": "Name of the React component"
"description": "React 组件的名称"
},
"path": {
"type": "string",
"description": "Path where component should be created"
"description": "组件应创建的路径"
},
"props": {
"type": "array",
@@ -207,7 +251,7 @@
},
"useBackend": {
"type": "boolean",
"description": "Whether component uses backend API calls"
"description": "组件是否使用后端 API 调用"
},
"styling": {
"type": "object",
@@ -219,15 +263,15 @@
"dark",
"system"
],
"description": "Component theme"
"description": "组件主题"
},
"responsive": {
"type": "boolean",
"description": "Whether component is responsive"
"description": "组件是否响应式"
},
"animations": {
"type": "boolean",
"description": "Whether to include subtle animations"
"description": "是否包含细微动画"
}
}
}
@@ -240,7 +284,7 @@
},
{
"name": "setup_authentication",
"description": "Sets up authentication using Clerk for both backend and frontend",
"description": "使用 Clerk 为后端和前端设置身份验证",
"parameters": {
"type": "object",
"properties": {
@@ -249,7 +293,7 @@
"enum": [
"clerk"
],
"description": "Authentication provider"
"description": "身份验证提供者"
},
"features": {
"type": "array",
@@ -268,7 +312,7 @@
"items": {
"type": "string"
},
"description": "API endpoints that require authentication"
"description": "需要身份验证的 API 端点"
}
},
"required": [
@@ -278,17 +322,17 @@
},
{
"name": "create_database_migration",
"description": "Creates a new SQL migration file for Encore.ts database",
"description": "为 Encore.ts 数据库创建新的 SQL 迁移文件",
"parameters": {
"type": "object",
"properties": {
"migrationName": {
"type": "string",
"description": "Descriptive name for the migration"
"description": "迁移的描述性名称"
},
"version": {
"type": "integer",
"description": "Migration version number"
"description": "迁移版本号"
},
"operations": {
"type": "array",
@@ -307,7 +351,7 @@
},
"sql": {
"type": "string",
"description": "Raw SQL for the operation"
"description": "操作的原始 SQL"
}
},
"required": [
@@ -326,7 +370,7 @@
},
{
"name": "setup_streaming_api",
"description": "Sets up streaming APIs for real-time communication",
"description": "为实时通信设置流式 API",
"parameters": {
"type": "object",
"properties": {
@@ -337,26 +381,26 @@
"streamOut",
"streamInOut"
],
"description": "Type of streaming API"
"description": "流式 API 类型"
},
"endpoint": {
"type": "string",
"description": "Stream endpoint path"
"description": "流端点路径"
},
"messageTypes": {
"type": "object",
"properties": {
"handshake": {
"type": "object",
"description": "Handshake message schema"
"description": "握手消息模式"
},
"incoming": {
"type": "object",
"description": "Incoming message schema"
"description": "传入消息模式"
},
"outgoing": {
"type": "object",
"description": "Outgoing message schema"
"description": "传出消息模式"
}
}
}
@@ -369,7 +413,7 @@
},
{
"name": "configure_secrets",
"description": "Configures secret management for API keys and sensitive data",
"description": "为 API 密钥和敏感数据配置密钥管理",
"parameters": {
"type": "object",
"properties": {
@@ -380,15 +424,15 @@
"properties": {
"name": {
"type": "string",
"description": "Secret name (e.g., 'OpenAIKey', 'DatabaseURL')"
"description": "密钥名称(例如,'OpenAIKey', 'DatabaseURL'"
},
"description": {
"type": "string",
"description": "Description of what the secret is used for"
"description": "密钥用途的描述"
},
"required": {
"type": "boolean",
"description": "Whether this secret is required for the app to function"
"description": "此密钥对于应用程序功能是否必需"
}
},
"required": [
@@ -405,7 +449,7 @@
},
{
"name": "setup_object_storage",
"description": "Sets up object storage buckets for file uploads",
"description": "为文件上传设置对象存储桶",
"parameters": {
"type": "object",
"properties": {
@@ -416,22 +460,22 @@
"properties": {
"name": {
"type": "string",
"description": "Bucket name"
"description": "存储桶名称"
},
"public": {
"type": "boolean",
"description": "Whether bucket contents are publicly accessible"
"description": "存储桶内容是否公开可访问"
},
"versioned": {
"type": "boolean",
"description": "Whether to enable object versioning"
"description": "是否启用对象版本控制"
},
"allowedFileTypes": {
"type": "array",
"items": {
"type": "string"
},
"description": "Allowed file MIME types"
"description": "允许的文件 MIME 类型"
}
},
"required": [
@@ -447,7 +491,7 @@
},
{
"name": "setup_pubsub",
"description": "Sets up Pub/Sub topics and subscriptions for event-driven architecture",
"description": "为事件驱动架构设置 Pub/Sub 主题和订阅",
"parameters": {
"type": "object",
"properties": {
@@ -458,11 +502,11 @@
"properties": {
"name": {
"type": "string",
"description": "Topic name"
"description": "主题名称"
},
"eventSchema": {
"type": "object",
"description": "TypeScript interface for event data"
"description": "事件数据的 TypeScript 接口"
},
"deliveryGuarantee": {
"type": "string",
@@ -470,7 +514,7 @@
"at-least-once",
"exactly-once"
],
"description": "Message delivery guarantee"
"description": "消息传递保证"
}
},
"required": [
@@ -486,15 +530,15 @@
"properties": {
"name": {
"type": "string",
"description": "Subscription name"
"description": "订阅名称"
},
"topicName": {
"type": "string",
"description": "Name of topic to subscribe to"
"description": "要订阅的主题名称"
},
"handler": {
"type": "string",
"description": "Handler function description"
"description": "处理函数描述"
}
},
"required": [
@@ -512,7 +556,7 @@
},
{
"name": "create_test_suite",
"description": "Creates test suites using Vitest for backend and frontend",
"description": "使用 Vitest 为后端和前端创建测试套件",
"parameters": {
"type": "object",
"properties": {
@@ -523,7 +567,7 @@
"frontend",
"integration"
],
"description": "Type of tests to create"
"description": "要创建的测试类型"
},
"testFiles": {
"type": "array",
@@ -532,11 +576,11 @@
"properties": {
"path": {
"type": "string",
"description": "Test file path"
"description": "测试文件路径"
},
"description": {
"type": "string",
"description": "What the test file covers"
"description": "测试文件涵盖的内容"
},
"testCases": {
"type": "array",
@@ -572,49 +616,49 @@
],
"guidelines": {
"code_quality": [
"Use 2 spaces for indentation",
"Split functionality into smaller, focused modules",
"Keep files as small as possible",
"Use proper TypeScript typing throughout",
"Follow consistent naming conventions",
"Include comprehensive error handling",
"Add meaningful comments for complex logic"
"使用 2 个空格进行缩进",
"将功能拆分为更小的、专注的模块",
"保持文件尽可能小",
"在整个项目中使用适当的 TypeScript 类型",
"遵循一致的命名约定",
"包含全面的错误处理",
"为复杂逻辑添加有意义的注释"
],
"backend_requirements": [
"All backend code must use Encore.ts",
"Store data using SQL Database or Object Storage",
"Never store data in memory or local files",
"All services go under backend/ folder",
"Each API endpoint in its own file",
"Unique endpoint names across the application",
"Use template literals for database queries",
"Document all API endpoints with comments"
"所有后端代码必须使用 Encore.ts",
"使用 SQL 数据库或对象存储存储数据",
"永远不要在内存或本地文件中存储数据",
"所有服务都放在 backend/ 文件夹下",
"每个 API 端点放在单独的文件中",
"跨应用程序的端点名称必须唯一",
"使用模板字面量进行数据库查询",
"用注释记录所有 API 端点"
],
"frontend_requirements": [
"Use React with TypeScript and Tailwind CSS",
"Import backend client as: import backend from '~backend/client'",
"Use shadcn/ui components when appropriate",
"Create responsive designs for all screen sizes",
"Include subtle animations and interactions",
"Use proper error handling with console.error logs",
"Split components into smaller, reusable modules",
"Frontend code goes in frontend/ folder (no src/ subfolder)"
"使用 React TypeScript Tailwind CSS",
"导入后端客户端为:import backend from '~backend/client'",
"在适当的时候使用 shadcn/ui 组件",
"为所有屏幕尺寸创建响应式设计",
"包含细微动画和交互",
"使用适当的错误处理和 console.error 日志",
"将组件拆分为更小的、可重用的模块",
"前端代码放在 frontend/ 文件夹下(无 src/ 子文件夹)"
],
"file_handling": [
"Always provide FULL file content",
"NEVER use placeholders or truncation",
"Only output files that need changes",
"Use leapFile for creates/modifications",
"Use leapDeleteFile for deletions",
"Use leapMoveFile for renames/moves",
"Exclude auto-generated files (package.json, etc.)"
"始终提供完整的文件内容",
"永远不要使用占位符或截断",
"仅输出需要更改的文件",
"使用 leapFile 进行创建/修改",
"使用 leapDeleteFile 进行删除",
"使用 leapMoveFile 进行重命名/移动",
"排除自动生成的文件(package.json 等)"
],
"security": [
"Use secrets for all sensitive data",
"Implement proper authentication when requested",
"Validate all user inputs",
"Use proper CORS settings",
"Follow security best practices for APIs"
"为所有敏感数据使用密钥",
"在请求时实现适当的身份验证",
"验证所有用户输入",
"使用适当的 CORS 设置",
"遵循 API 的安全最佳实践"
]
}
}