diff --git a/RAG/docs/HISTORIAL_SESIONES.md b/RAG/docs/HISTORIAL_SESIONES.md index a154ff8..2061688 100644 --- a/RAG/docs/HISTORIAL_SESIONES.md +++ b/RAG/docs/HISTORIAL_SESIONES.md @@ -47,4 +47,5 @@ Dar continuidad al RAG en `RAG/` a partir del estado actual documentado. - Limpieza ejecutada exitosamente sobre el `scope` del código fuente antiguo (`RAG/src`). - Reingesta del directorio `RAG/src` con el código actualizado. - Documento de seguimiento `RAG/docs/TASK_LIMPIEZA.md` y documentacion API `RAG/docs/API_RAG.md` actualizados. -- Implementacion de ingesta directa de carpetas locales desde el playground: el navegador respeta `.gitignore`, empaqueta la carpeta en un `.zip` en memoria y el backend usa `adm-zip` para extraerla de forma segura en un directorio temporal antes de la ingesta. +- Implementacion de ingesta directa de carpetas locales desde el playground: el navegador empaqueta la carpeta en un `.zip` en memoria (filtrando `node_modules`, `dist`, `.git`, etc. con logica nativa) y el backend usa `adm-zip` para extraerla de forma segura en un directorio temporal antes de la ingesta. +- Correccion de error `ReferenceError: ignore is not defined` eliminando dependencia externa en el frontend. diff --git a/RAG/public/playground/app.js b/RAG/public/playground/app.js index c687983..ccfed9b 100644 --- a/RAG/public/playground/app.js +++ b/RAG/public/playground/app.js @@ -355,25 +355,24 @@ ingestButton.addEventListener("click", async () => { ingestResult.textContent = "Empaquetando carpeta local (esto puede tardar unos segundos)..."; const zip = new JSZip(); - const ig = ignore(); - // Buscar .gitignore en la raiz - const gitignoreFile = Array.from(ingestUploadFolder.files).find(f => f.webkitRelativePath.match(/^[^\/]+\/\.gitignore$/)); - if (gitignoreFile) { - const content = await gitignoreFile.text(); - ig.add(content); - } - - // Reglas hardcodeadas de seguridad - ig.add(['node_modules/', '.git/', '.venv/', 'dist/', 'build/']); - let addedCount = 0; for (const file of ingestUploadFolder.files) { // webkitRelativePath format: "FolderName/path/to/file.ext" - // Le quitamos el primer segmento (FolderName) para validar con ignore correctamente + // Le quitamos el primer segmento (FolderName) para la ruta interna const relativePath = file.webkitRelativePath.split('/').slice(1).join('/'); - if (relativePath && !ig.ignores(relativePath)) { + // Filtro nativo simple sin depender de la libreria ignore + const isIgnored = + relativePath.startsWith('node_modules/') || + relativePath.startsWith('.git/') || + relativePath.startsWith('.venv/') || + relativePath.startsWith('dist/') || + relativePath.startsWith('build/') || + relativePath.includes('/node_modules/') || + relativePath.includes('/.git/'); + + if (relativePath && !isIgnored) { zip.file(relativePath, file); addedCount++; } diff --git a/RAG/public/playground/index.html b/RAG/public/playground/index.html index 4d57481..c857360 100644 --- a/RAG/public/playground/index.html +++ b/RAG/public/playground/index.html @@ -6,7 +6,6 @@