Spaces:
Running
Running
export interface User { | |
fullname: string; | |
avatarUrl: string; | |
name: string; | |
isLocalUse?: boolean; | |
isPro: boolean; | |
id: string; | |
token?: string; | |
} | |
export interface HtmlHistory { | |
html: string; | |
createdAt: Date; | |
prompt: string; | |
} | |
export interface Project { | |
title: string; | |
html: string; | |
prompts: string[]; | |
user_id: string; | |
space_id: string; | |
_id?: string; | |
_updatedAt?: Date; | |
_createdAt?: Date; | |
// New fields for enhanced project management | |
fileStructure?: { | |
rootFolderId?: string; | |
totalFiles: number; | |
totalSize: number; | |
lastFileModified?: Date; | |
}; | |
settings?: { | |
defaultFileType: FileType; | |
autoSave: boolean; | |
aiAssistance: boolean; | |
}; | |
} | |
// File and Folder Types | |
export type FileType = | |
| 'html' | 'css' | 'js' | 'ts' | 'jsx' | 'tsx' | 'vue' | 'json' | |
| 'md' | 'txt' | 'py' | 'php' | 'xml' | 'svg' | 'yaml' | 'yml' | |
| 'png' | 'jpg' | 'jpeg' | 'gif' | 'ico' | 'webp' | 'pdf'; | |
export interface FileDocument { | |
_id: string; | |
name: string; // اسم الملف مع الامتداد | |
content: string; // محتوى الملف | |
type: FileType; // نوع الملف | |
path: string; // المسار الكامل للملف | |
projectId: string; // معرف المشروع | |
parentFolderId?: string; // معرف المجلد الأب (اختياري) | |
size: number; // حجم الملف بالبايت | |
encoding: string; // ترميز الملف (utf-8, base64, etc.) | |
isGenerated: boolean; // هل تم إنشاؤه بالAI | |
lastModifiedBy: 'user' | 'ai'; // آخر من عدل الملف | |
createdAt: Date; | |
updatedAt: Date; | |
} | |
export interface FolderDocument { | |
_id: string; | |
name: string; // اسم المجلد | |
path: string; // المسار الكامل للمجلد | |
projectId: string; // معرف المشروع | |
parentFolderId?: string; // معرف المجلد الأب (اختياري) | |
children: string[]; // معرفات الملفات والمجلدات الفرعية | |
isRoot: boolean; // هل هو المجلد الجذر | |
createdAt: Date; | |
updatedAt: Date; | |
} | |
// File Version Control | |
export interface FileVersion { | |
_id: string; | |
fileId: string; | |
content: string; | |
timestamp: Date; | |
author: 'user' | 'ai'; | |
changeDescription: string; | |
diff: string; | |
} | |
// Project Analytics | |
export interface ProjectStats { | |
totalFiles: number; | |
totalLines: number; | |
totalSize: number; | |
fileTypes: Record<string, number>; | |
complexity: { | |
score: number; | |
factors: string[]; | |
}; | |
quality: { | |
score: number; | |
issues: string[]; | |
}; | |
performance: { | |
score: number; | |
suggestions: string[]; | |
}; | |
} | |
// Pro Agent System Types | |
export interface ProAgentStep { | |
id: string; | |
name: string; | |
description: string; | |
status: 'pending' | 'running' | 'completed' | 'error'; | |
result?: string; | |
error?: string; | |
startTime?: Date; | |
endTime?: Date; | |
duration?: number; | |
} | |
export interface ProAgentWorkflow { | |
id: string; | |
userPrompt: string; | |
steps: ProAgentStep[]; | |
currentStepIndex: number; | |
status: 'idle' | 'running' | 'completed' | 'error'; | |
finalResult?: string; | |
totalDuration?: number; | |
createdAt: Date; | |
completedAt?: Date; | |
} | |
export interface ProAgentConfig { | |
enabled: boolean; | |
model: string; | |
provider: string; | |
temperature: number; | |
maxTokens: number; | |
timeout: number; // في الثواني | |
retryAttempts: number; | |
} | |
export interface ProAgentStepResult { | |
stepId: string; | |
success: boolean; | |
result?: string; | |
error?: string; | |
metadata?: Record<string, any>; | |
} | |