Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
6ac77df
🐛 fix when logout problem and failed to get session
Phinease Sep 11, 2025
bd9e742
Merge pull request #1171 from ModelEngine-Group/bwq/0904_re
Bavichi Sep 11, 2025
73adb23
🐛 Fix terminal tool working directory permission #1183
Phinease Sep 12, 2025
956f598
♻️ Refactor: cleanup console log.
Sep 12, 2025
5a609d7
♻️ Refactor: cleanup console log.
Sep 12, 2025
f0f971a
♻️ Refactor: cleanup console log.
Sep 12, 2025
28c3dae
♻️ Refactor: cleanup console log.
Sep 12, 2025
5875ebd
♻️ Refactor cleanup console log.
Phinease Sep 12, 2025
3c0acaa
🐛 Bug fix: northbound import error
liutao12138 Sep 12, 2025
754796d
🐛 Bug fix: re-include make/ folder in .dockerignore
liutao12138 Sep 12, 2025
2b32fbb
Update opensource-memorial-wall.md
CSJSAJA Sep 12, 2025
9285895
Update opensource-memorial-wall.md
Phinease Sep 15, 2025
3104758
♻️ Add cursor rules of frontend
WMC001 Sep 12, 2025
d0041f1
Merge pull request #1197 from ModelEngine-Group/wmc/refactor_0902
WMC001 Sep 15, 2025
b42addd
Update opensource-memorial-wall.md
EXUAN0312 Sep 15, 2025
29510d0
🔨 Rewrite voice APPID/TOKEN when deploying in service
ljy65535 Sep 15, 2025
90d1598
🐛 Terminal tool does not start in debug mode #1157
WMC001 Sep 15, 2025
a64569d
🐛 Better agent running log printing
ljy65535 Sep 15, 2025
c896981
🧪 modify test_core_agent.py
ljy65535 Sep 15, 2025
728fe72
Merge pull request #1204 from EXUAN0312/patch-1
Phinease Sep 15, 2025
7fcf1c6
🧪 modify test_core_agent.py
ljy65535 Sep 15, 2025
3bd7c94
llm incorrectly regard no_think as a tool/assistant
SimengBian Sep 15, 2025
9a0072c
🐛 Terminal tool does not start in debug mode #1157
Phinease Sep 15, 2025
fdf4b69
🐛 Bug fix: northbound api cannot store and get conversation history list
Jasonxia007 Sep 15, 2025
5408f6f
llm incorrectly regard no_think as a tool/assistant
SimengBian Sep 15, 2025
f82e6b8
Merge branch 'bsm-dev' of https://github.com/ModelEngine-Group/nexent…
SimengBian Sep 15, 2025
c5055cb
🐛 Use conversation_id and user_id as the primary key of the thread pool
ljy65535 Sep 16, 2025
d5be4c7
🐛 llm incorrectly regard no_think as a tool/assistant
Phinease Sep 16, 2025
fa4d63d
🐛 Bug fix: northbound api cannot store and get conversation history list
Phinease Sep 16, 2025
f9992a8
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Sep 16, 2025
e930357
🔨 Rewrite voice APPID/TOKEN when deploying in service
Phinease Sep 16, 2025
a13116f
🐛 Better agent running log printing
Phinease Sep 16, 2025
d9d17d7
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Sep 16, 2025
8e4b20f
🧪 modify test_agent_run_manager.py
ljy65535 Sep 16, 2025
40ee159
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Sep 16, 2025
784f0c2
Update opensource-memorial-wall.md
TypeABC Sep 16, 2025
950b45c
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Sep 16, 2025
b55b234
Merge pull request #1226 from TypeABC/patch-2
Phinease Sep 16, 2025
0efc807
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Sep 16, 2025
951282e
📝 add cursor rule for test file
ljy65535 Sep 16, 2025
a6ea21d
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Sep 16, 2025
574e330
✨ The terminal tool supports password login #1052
WMC001 Sep 16, 2025
64af1eb
🐛 Refreshing the knowledge base or Agent configuration page will retu…
Phinease Sep 17, 2025
c5a11e3
🐛 Use conversation_id and user_id as the primary key of the agent run…
Phinease Sep 17, 2025
02890ec
📝 add cursor rule for test file
Phinease Sep 17, 2025
b332204
✨ Unit test: The terminal tool supports password login #1052
WMC001 Sep 17, 2025
688a003
✨ Unit test add: The terminal tool supports password login #1052
WMC001 Sep 17, 2025
2e2b205
✨ The terminal tool supports password login #1052
Phinease Sep 17, 2025
6c93db5
🐛 When generating prompts using deep thinking models, it is necessary…
Sep 17, 2025
48266ba
🐛 When generating prompts using deep thinking models, it is necessary…
Sep 17, 2025
a7cf50e
🐛 When generating prompts using deep thinking models, it is necessary…
Phinease Sep 18, 2025
a35e658
🐛 a better way to distinguish between executable and generated code #832
Phinease Sep 18, 2025
8a8746a
🐛 a better way to distinguish between executable and generated code #832
Phinease Sep 18, 2025
52c3227
🐛 a better way to distinguish between executable and generated code #832
Phinease Sep 18, 2025
7407196
♻️ Refresh the tool list when backend service is initialized #1250
WMC001 Sep 18, 2025
b6b2664
♻️ Unit test: Refresh the tool list when backend service is initializ…
WMC001 Sep 18, 2025
e054c47
♻️ Refresh the tool list when backend service is initialized #1250
Phinease Sep 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .cursor/rules/frontend/component_layer_rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
globs: frontend/components/**/*.tsx
description: Component layer rules for reusable UI components
---

### Purpose and Scope

- Component layer contains reusable UI components for `frontend/components/**/*.tsx`
- Responsibilities: Create reusable components, implement business logic, handle interactions, provide consistent UI
- **MANDATORY**: All components must use TypeScript and functional components

### Component Organization

- **`components/ui/`** - Base UI components (buttons, inputs, dialogs, etc.)
- **`components/auth/`** - Authentication-related components
- **`components/providers/`** - Context providers and global state management
- Use index files for clean imports: `export { Button } from './button'`

### Component Structure

- Use functional components with TypeScript
- Define proper interfaces for all props
- Use React hooks for state management
- Implement proper error boundaries where needed
- Follow single responsibility principle

### Props and State Management

- All props must be typed with interfaces
- Use optional props with default values when appropriate
- Prefer controlled components over uncontrolled
- Use local state for component-specific data
- Use context for shared state across components
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log

### Styling and Design

- Use Tailwind CSS classes for styling
- Follow design system patterns and spacing
- Ensure responsive design with mobile-first approach
- Use CSS variables for theme colors
- Implement proper focus states and accessibility

### Internationalization

- All user-facing text must use `useTranslation` hook
- Use descriptive translation keys: `t('button.save')` instead of `t('save')`
- Provide fallback text for missing translations
- Group related translations in namespaces

### Error Handling

- Implement proper error boundaries for component trees
- Handle async operations with loading and error states
- Provide meaningful error messages to users
- Log errors appropriately for debugging

### Example
```tsx
// frontend/components/ui/button.tsx
import React from 'react';
import { useTranslation } from 'react-i18next';
import { cn } from '@/lib/utils';

interface ButtonProps {
children: React.ReactNode;
variant?: 'primary' | 'secondary' | 'outline';
size?: 'sm' | 'md' | 'lg';
disabled?: boolean;
loading?: boolean;
onClick?: () => void;
className?: string;
}

export function Button({
children,
variant = 'primary',
size = 'md',
disabled = false,
loading = false,
onClick,
className,
}: ButtonProps) {
const { t } = useTranslation('common');

return (
<button
className={cn(
'inline-flex items-center justify-center rounded-md font-medium transition-colors',
variant === 'primary' && 'bg-primary text-primary-foreground hover:bg-primary/90',
variant === 'secondary' && 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
variant === 'outline' && 'border border-input bg-background hover:bg-accent',
size === 'sm' && 'h-9 px-3 text-sm',
size === 'md' && 'h-10 px-4 py-2',
size === 'lg' && 'h-11 px-8 text-lg',
className
)}
disabled={disabled || loading}
onClick={onClick}
>
{loading && <div className="mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" />}
{children}
</button>
);
}
```
86 changes: 86 additions & 0 deletions .cursor/rules/frontend/hook_layer_rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
globs: frontend/hooks/**/*.ts
description: Hook layer rules for custom React hooks and state management
---

### Purpose and Scope

- Hook layer contains custom React hooks for `frontend/hooks/**/*.ts`
- Responsibilities: Encapsulate state logic, provide service interfaces, handle loading/error states
- **MANDATORY**: All hooks must be named `useXxx` and use TypeScript

### Hook Organization

- **`hooks/useAuth.ts`** - Authentication state and operations
- **`hooks/useConfig.ts`** - Configuration management
- **`hooks/useChat.ts`** - Chat-related state and operations
- **`hooks/useMemory.ts`** - Memory management
- Use descriptive names indicating the hook's purpose

### Hook Structure

- Use TypeScript for all hook definitions
- Return objects with descriptive property names
- Handle loading, error, and success states consistently
- Implement proper cleanup for side effects
- Use proper dependency arrays in useEffect

### Essential Hook Usage

| Hook | Purpose | When to Use |
|------|---------|-------------|
| `useState` | Store component state | Simple state like toggles, counters |
| `useReducer` | Complex state logic | Multiple state dependencies |
| `useContext` | Share data between components | Theme, user info, global state |
| `useEffect` | Handle side effects | Data fetching, subscriptions, timers |
| `useCallback` | Prevent function recreation | Callbacks passed to child components |
| `useMemo` | Cache calculations | Expensive computations |
| `useRef` | Store mutable values | DOM nodes, timer IDs |

### State Management

- Use useState for local component state
- Use useReducer for complex state logic
- Use useContext for shared state across components
- Implement proper state updates and immutability
- Handle async state updates correctly
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log

### Error Handling

- Handle async errors gracefully
- Provide meaningful error messages
- Log errors appropriately for debugging
- Implement retry logic for transient failures

### Example
```typescript
// frontend/hooks/useAuth.ts
import { useState, useEffect, useCallback } from 'react';
import { authService } from '@/services/authService';

export function useAuth() {
const [user, setUser] = useState(null);
const [isLoading, setIsLoading] = useState(true);
const [error, setError] = useState(null);

const login = useCallback(async (credentials) => {
setIsLoading(true);
setError(null);
try {
const response = await authService.login(credentials);
if (response.success) {
setUser(response.data.user);
} else {
setError(response.error);
}
} catch (err) {
setError(err.message);
} finally {
setIsLoading(false);
}
}, []);

return { user, isLoading, error, login };
}
```
61 changes: 61 additions & 0 deletions .cursor/rules/frontend/page_layer_rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
globs: frontend/app/**/*.tsx
description: Page layer rules for Next.js App Router pages and layouts
---

### Purpose and Scope

- Page layer handles routing and layouts for `frontend/app/**/*.tsx`
- Responsibilities: Define routes, handle data fetching, provide layouts, coordinate state
- **MANDATORY**: All pages must support internationalization through `[locale]` dynamic route

### File Structure

- **`page.tsx`** - Page components that define routes
- **`layout.tsx`** - Layout components that wrap pages
- **`loading.tsx`** - Loading UI components
- Use kebab-case for new route segments
- Prefer nested layouts over prop drilling

### Internationalization

- Client components: `const { t } = useTranslation('namespace')`
- Server components: `getTranslations` from `next-intl`
- Organize translation keys by feature/namespace

### Data Fetching

- Use Server Components for initial data fetching
- Use `fetch` with proper caching for server-side data
- Client-side fetching: custom hooks in `hooks/` directory
- Handle loading and error states appropriately

### Layout and Metadata

- Define metadata in `layout.tsx` using Next.js metadata API
- Use dynamic metadata for page-specific information
- Ensure responsive design with Tailwind CSS
- Maintain consistent layout structure

### State Management

- Use React Context for shared page-level state
- Keep page-specific state local to component
- Use custom hooks for complex state logic
- Avoid prop drilling with context providers
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log

### Example
```tsx
// frontend/app/[locale]/chat/page.tsx
import { useTranslations } from 'next-intl';

export default function ChatPage({ params }: { params: { locale: string } }) {
const t = useTranslations('chat');
return (
<div className="flex h-screen">
<h1 className="text-2xl font-bold p-4">{t('title')}</h1>
</div>
);
}
```
52 changes: 52 additions & 0 deletions .cursor/rules/frontend/service_layer_rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
globs: frontend/services/**/*.ts
description: Compact service layer rules for API calls and data management
---

### Purpose and Scope

- Service layer handles API communication and data management for `frontend/services/**/*.ts`
- **CRITICAL**: All API URLs must come from [api.ts](mdc:frontend/services/api.ts) - never hardcode URLs
- Responsibilities: API calls, request/response transformation, error handling, type safety

### API URL Management

- **MANDATORY**: Import and use `API_ENDPOINTS` from [api.ts](mdc:frontend/services/api.ts)
- **FORBIDDEN**: Hardcoded URLs, direct string concatenation for endpoints
- Use `fetchWithErrorHandling` from [api.ts](mdc:frontend/services/api.ts) for all requests

### Service Organization

- **`services/api.ts`** - Base configuration, endpoints, error handling
- **`services/*Service.ts`** - Domain-specific API calls (auth, chat, config, etc.)
- Use descriptive names matching the domain they serve

### Error Handling

- Use `ApiError` class from [api.ts](mdc:frontend/services/api.ts)
- Handle 401/499 status codes for session expiration
- Provide meaningful error messages for user feedback

### Type Safety

- Define TypeScript interfaces for all request/response data
- Use generic types for reusable API functions
- Export types for use in components and hooks
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log

### Example
```typescript
// frontend/services/authService.ts
import { API_ENDPOINTS, fetchWithErrorHandling, ApiError } from './api';

export const authService = {
async signin(credentials: SigninRequest): Promise<SigninResponse> {
const response = await fetchWithErrorHandling(API_ENDPOINTS.user.signin, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(credentials),
});
return response.json();
}
};
```
68 changes: 68 additions & 0 deletions .cursor/rules/frontend/type_layer_rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
globs: frontend/types/**/*.ts
description: Type layer rules for TypeScript type definitions and interfaces
---

### Purpose and Scope

- Type layer contains TypeScript definitions for `frontend/types/**/*.ts`
- Responsibilities: Define type-safe interfaces, API types, reusable utilities, ensure consistency
- **MANDATORY**: All types must be exported and use TypeScript

### Type Organization

- **`types/auth.ts`** - Authentication-related types
- **`types/chat.ts`** - Chat and conversation types
- **`types/config.ts`** - Configuration types
- **`types/api.ts`** - API-related types
- Use descriptive names matching the domain they represent

### Type Definition Standards

- Use interfaces for object shapes and API contracts
- Use type aliases for unions, primitives, and computed types
- Use enums for fixed sets of string/number values
- Use generic types for reusable type patterns
- Export all types for use in other modules

### API Type Definitions

- Define separate interfaces for request and response data
- Use consistent naming conventions (e.g., `UserRequest`, `UserResponse`)
- Include optional fields with proper typing
- Use union types for status fields and enums
- Provide JSDoc comments for complex types

### Component Props Types

- Define interfaces for all component props
- Use descriptive property names
- Include proper optional/required field indicators
- Use generic types for reusable component patterns
- Export types for use in component files
- **CRITICAL**: All logging must use [logger.ts](mdc:frontend/lib/logger.ts) - never use console.log

### Utility Types

- Create utility types for common patterns
- Use mapped types for transformations
- Implement conditional types for complex logic
- Provide type guards for runtime validation

### Example
```typescript
// frontend/types/auth.ts
export interface User {
id: string;
email: string;
name: string;
avatar?: string;
role: UserRole;
createdAt: string;
updatedAt: string;
}

// Utility types
export type UserUpdateData = Partial<Pick<User, 'name' | 'avatar'>>;
export type UserCreateData = Omit<User, 'id' | 'createdAt' | 'updatedAt'>;
```
Loading
Loading