fix
Browse filesFiles changed (4)
195 unmodified lines196197198199200201679 unmodified lines881882883884885886887888889890891892893195 unmodified linesprovider: str = "auto"history: List[List[str]] = []agent_mode: bool = Falseclass DeploymentRequest(BaseModel):679 unmodified linesprint(f"[Auto-Deploy] - History items: {len(history_list)}")print(f"[Auto-Deploy] - Username: {auth.username}")print(f"[Auto-Deploy] - Code length: {len(generated_code)}")# Deploy the codesuccess, message, space_url = deploy_to_huggingface_space(code=generated_code,language=language,token=auth.token,username=auth.username,history=history_list)195 unmodified lines196197198199200201202679 unmodified lines882883884885886887888889890891892893894895896195 unmodified linesprovider: str = "auto"history: List[List[str]] = []agent_mode: bool = Falseexisting_repo_id: Optional[str] = None # For auto-deploy to update existing spaceclass DeploymentRequest(BaseModel):679 unmodified linesprint(f"[Auto-Deploy] - History items: {len(history_list)}")print(f"[Auto-Deploy] - Username: {auth.username}")print(f"[Auto-Deploy] - Code length: {len(generated_code)}")print(f"[Auto-Deploy] - Existing repo ID from request: {request.existing_repo_id}")# Deploy the code (update existing space if provided)success, message, space_url = deploy_to_huggingface_space(code=generated_code,language=language,token=auth.token,username=auth.username,existing_repo_id=request.existing_repo_id, # Use duplicated/imported spacehistory=history_list)
284 unmodified lines285286287288289290284 unmodified linesprovider: 'auto',history: messages.map((m) => [m.role, m.content]),agent_mode: false,};const assistantMessage: Message = {284 unmodified lines285286287288289290291284 unmodified linesprovider: 'auto',history: messages.map((m) => [m.role, m.content]),agent_mode: false,existing_repo_id: currentRepoId || undefined, // Pass duplicated/imported space ID for auto-deploy};const assistantMessage: Message = {
256 unmodified lines257258259260261262263264265266267268269256 unmodified linesconst duplicateResult = await apiClient.duplicateSpace(fromSpaceId);if (duplicateResult.success) {// Show success message with link to duplicated spacealert(`✅ Space duplicated successfully!\n\nView your space: ${duplicateResult.space_url}`);// Also load the code in the editorconst importResult = await apiClient.importProject(importUrl);if (importResult.status === 'success' && onImport && importResult.code) {onImport(importResult.code, importResult.language || 'html', duplicateResult.space_url);}setShowImportDialog(false);256 unmodified lines257258259260261262263264265266267268269270256 unmodified linesconst duplicateResult = await apiClient.duplicateSpace(fromSpaceId);if (duplicateResult.success) {// Also load the code in the editorconst importResult = await apiClient.importProject(importUrl);if (importResult.status === 'success' && onImport && importResult.code) {// Pass the duplicated space URL so it's tracked for future deploymentsonImport(importResult.code, importResult.language || 'html', duplicateResult.space_url);// Show success message with link to duplicated spacealert(`✅ Space duplicated successfully!\n\nYour space: ${duplicateResult.space_url}\n\nThe code has been loaded in the editor. Any changes you deploy will update this duplicated space.`);}setShowImportDialog(false);
18 unmodified lines19202122232418 unmodified linesprovider: string;history: string[][];agent_mode: boolean;}export interface CodeGenerationResponse {18 unmodified lines1920212223242518 unmodified linesprovider: string;history: string[][];agent_mode: boolean;existing_repo_id?: string; // For auto-deploy to update existing space}export interface CodeGenerationResponse {
backend_api.py+4-1
frontend/src/app/page.tsx+1
frontend/src/components/LandingPage.tsx+4-3
frontend/src/types/index.ts+1